From b32da8747292384893ea07a0a5659b24eb216c10 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 17 Jul 2009 13:16:00 +0200 Subject: stable 2009.07.17 13:16 --- context/data/texworks/TUG/texworks.ini | 6 +- context/data/texworks/texworks-context.rme | 2 + context/data/texworks/texworks-setup.ini | 4 +- fonts/map/luatex/context/demo-font.lum | 70 + metapost/context/base/mp-core.mp | 2 +- scripts/context/lua/mtx-context.lua | 17 +- scripts/context/lua/mtx-convert.lua | 132 +- scripts/context/lua/mtx-grep.lua | 4 +- scripts/context/lua/mtx-texworks.lua | 96 + scripts/context/lua/mtx-tools.lua | 57 + scripts/context/lua/mtx-update.lua | 27 +- scripts/context/lua/mtxrun.lua | 9 + scripts/context/stubs/mswin/mtxrun.lua | 9 + scripts/context/stubs/mswin/mtxworks.cmd | 1 + scripts/context/stubs/unix/mtxrun | 9 + scripts/context/stubs/unix/mtxworks | 2 + tex/context/base/anch-pgr.mkii | 1 + tex/context/base/anch-pgr.mkiv | 311 +- tex/context/base/anch-pos.lua | 2 +- tex/context/base/anch-pos.mkiv | 14 - tex/context/base/anch-snc.tex | 2 - tex/context/base/attr-ini.lua | 335 +- tex/context/base/attr-ini.mkiv | 24 +- tex/context/base/back-ini.lua | 106 +- tex/context/base/back-ini.mkiv | 746 +--- tex/context/base/back-pdf.lua | 489 ++- tex/context/base/back-pdf.mkiv | 3232 +---------------- tex/context/base/bibl-bib.mkiv | 29 + tex/context/base/bibl-bib.tex | 29 - tex/context/base/buff-ini.lua | 49 + tex/context/base/buff-ini.mkiv | 35 + tex/context/base/buff-ver.mkii | 2 +- tex/context/base/buff-ver.mkiv | 24 +- tex/context/base/catc-ctx.tex | 43 + tex/context/base/catc-sym.tex | 69 + tex/context/base/colo-ext.mkiv | 2 +- tex/context/base/colo-hex.mkii | 18 +- tex/context/base/colo-hex.mkiv | 109 +- tex/context/base/colo-ini.lua | 278 +- tex/context/base/colo-ini.mkiv | 171 +- tex/context/base/cont-log.tex | 14 + tex/context/base/cont-new.mkii | 3 + tex/context/base/cont-new.mkiv | 101 +- tex/context/base/cont-new.tex | 738 +--- tex/context/base/context.mkii | 223 +- tex/context/base/context.mkiv | 184 +- tex/context/base/context.tex | 2 +- tex/context/base/core-def.mkii | 7 + tex/context/base/core-def.mkiv | 2 - tex/context/base/core-fil.mkii | 347 ++ tex/context/base/core-fil.mkiv | 317 ++ tex/context/base/core-fil.tex | 347 -- tex/context/base/core-gen.mkii | 166 + tex/context/base/core-gen.mkiv | 166 + tex/context/base/core-gen.tex | 166 - tex/context/base/core-grd.mkii | 1074 ++++++ tex/context/base/core-grd.mkiv | 1074 ++++++ tex/context/base/core-grd.tex | 1074 ------ tex/context/base/core-ini.mkii | 67 + tex/context/base/core-ini.mkiv | 67 + tex/context/base/core-ini.tex | 67 - tex/context/base/core-ins.tex | 103 - tex/context/base/core-job.mkiv | 41 +- tex/context/base/core-lme.tex | 55 - tex/context/base/core-lnt.tex | 197 -- tex/context/base/core-mak.tex | 84 - tex/context/base/core-mis.mkii | 66 + tex/context/base/core-mis.mkiv | 240 +- tex/context/base/core-par.mkii | 300 ++ tex/context/base/core-par.tex | 300 -- tex/context/base/core-spa.lua | 61 +- tex/context/base/core-spa.mkii | 64 +- tex/context/base/core-spa.mkiv | 410 ++- tex/context/base/core-stg.mkii | 72 + tex/context/base/core-stg.tex | 72 - tex/context/base/core-sys.mkiv | 45 +- tex/context/base/core-two.lua | 8 + tex/context/base/core-two.mkiv | 3 - tex/context/base/core-uti.mkii | 47 +- tex/context/base/core-uti.mkiv | 54 +- tex/context/base/core-var.mkii | 286 ++ tex/context/base/core-var.mkiv | 275 ++ tex/context/base/core-var.tex | 286 -- tex/context/base/enco-032.mkii | 82 + tex/context/base/enco-032.tex | 82 - tex/context/base/enco-037.mkii | 276 ++ tex/context/base/enco-037.tex | 276 -- tex/context/base/enco-acc.mkii | 139 + tex/context/base/enco-acc.tex | 139 - tex/context/base/enco-agr.mkii | 364 ++ tex/context/base/enco-agr.tex | 364 -- tex/context/base/enco-ans.mkii | 237 ++ tex/context/base/enco-ans.tex | 237 -- tex/context/base/enco-cas.mkii | 143 + tex/context/base/enco-cas.tex | 143 - tex/context/base/enco-chi.mkii | 371 ++ tex/context/base/enco-chi.tex | 371 -- tex/context/base/enco-com.mkii | 37 + tex/context/base/enco-com.tex | 37 - tex/context/base/enco-cyr.mkii | 1037 ++++++ tex/context/base/enco-cyr.tex | 1037 ------ tex/context/base/enco-def.mkii | 920 +++++ tex/context/base/enco-def.tex | 920 ----- tex/context/base/enco-ec.mkii | 295 ++ tex/context/base/enco-ec.tex | 295 -- tex/context/base/enco-ecm.mkii | 33 + tex/context/base/enco-ecm.tex | 33 - tex/context/base/enco-el.mkii | 272 ++ tex/context/base/enco-el.tex | 272 -- tex/context/base/enco-fde.mkii | 128 + tex/context/base/enco-fde.tex | 128 - tex/context/base/enco-ffr.mkii | 53 + tex/context/base/enco-ffr.tex | 53 - tex/context/base/enco-fpl.mkii | 98 + tex/context/base/enco-fpl.tex | 98 - tex/context/base/enco-fro.mkii | 35 + tex/context/base/enco-fro.tex | 35 - tex/context/base/enco-fsl.mkii | 32 + tex/context/base/enco-fsl.tex | 32 - tex/context/base/enco-grk.mkii | 190 + tex/context/base/enco-grk.tex | 190 - tex/context/base/enco-heb.mkii | 16 + tex/context/base/enco-heb.tex | 16 - tex/context/base/enco-ibm.mkii | 7 + tex/context/base/enco-ibm.tex | 7 - tex/context/base/enco-il2.mkii | 157 + tex/context/base/enco-il2.tex | 157 - tex/context/base/enco-ini.mkii | 12 +- tex/context/base/enco-ini.mkiv | 74 +- tex/context/base/enco-lat.mkii | 7 + tex/context/base/enco-lat.tex | 7 - tex/context/base/enco-mis.mkii | 188 + tex/context/base/enco-mis.tex | 188 - tex/context/base/enco-pdf.mkii | 278 ++ tex/context/base/enco-pdf.tex | 278 -- tex/context/base/enco-pfr.mkii | 305 ++ tex/context/base/enco-pfr.tex | 303 -- tex/context/base/enco-pol.mkii | 276 ++ tex/context/base/enco-pol.tex | 276 -- tex/context/base/enco-qx.mkii | 266 ++ tex/context/base/enco-qx.tex | 266 -- tex/context/base/enco-raw.mkii | 119 + tex/context/base/enco-raw.tex | 119 - tex/context/base/enco-run.mkii | 149 + tex/context/base/enco-run.tex | 149 - tex/context/base/enco-t5.mkii | 244 ++ tex/context/base/enco-t5.tex | 244 -- tex/context/base/enco-tbo.mkii | 222 ++ tex/context/base/enco-tbo.tex | 222 -- tex/context/base/enco-uc.mkii | 1091 ++++++ tex/context/base/enco-uc.tex | 1091 ------ tex/context/base/enco-vis.mkii | 3 + tex/context/base/enco-vis.tex | 3 - tex/context/base/enco-vna.mkii | 145 + tex/context/base/enco-vna.tex | 145 - tex/context/base/enco-win.mkii | 7 + tex/context/base/enco-win.tex | 7 - tex/context/base/enco-x5.mkii | 218 ++ tex/context/base/enco-x5.tex | 218 -- tex/context/base/filt-bas.mkii | 63 + tex/context/base/filt-bas.tex | 63 - tex/context/base/filt-ini.mkii | 121 + tex/context/base/filt-ini.tex | 133 - tex/context/base/font-arb.mkii | 5 + tex/context/base/font-arb.tex | 5 - tex/context/base/font-bfm.mkii | 196 ++ tex/context/base/font-bfm.tex | 196 -- tex/context/base/font-chi.mkii | 1156 +++++++ tex/context/base/font-chi.tex | 1156 ------- tex/context/base/font-chk.lua | 12 +- tex/context/base/font-cid.lua | 1 + tex/context/base/font-col.lua | 4 +- tex/context/base/font-heb.mkii | 5 + tex/context/base/font-heb.tex | 5 - tex/context/base/font-ini.mkii | 24 +- tex/context/base/font-ini.mkiv | 211 +- tex/context/base/font-jap.mkii | 83 + tex/context/base/font-jap.tex | 83 - tex/context/base/font-map.lua | 95 +- tex/context/base/font-mis.lua | 2 +- tex/context/base/font-otf.lua | 183 +- tex/context/base/font-otn.lua | 4 +- tex/context/base/font-run.mkii | 326 ++ tex/context/base/font-run.mkiv | 326 ++ tex/context/base/font-run.tex | 326 -- tex/context/base/font-tfm.lua | 19 +- tex/context/base/font-uni.mkii | 2 +- tex/context/base/font-xtx.mkii | 357 ++ tex/context/base/font-xtx.tex | 357 -- tex/context/base/grph-fig.mkiv | 212 +- tex/context/base/grph-inc.lua | 47 +- tex/context/base/grph-inc.mkii | 24 + tex/context/base/grph-inc.mkiv | 77 +- tex/context/base/grph-u3d.lua | 45 + tex/context/base/hand-def.mkii | 577 ++++ tex/context/base/hand-def.tex | 577 ---- tex/context/base/hand-ini.mkii | 18 +- tex/context/base/java-fld.tex | 27 +- tex/context/base/java-ini.lua | 112 + tex/context/base/java-ini.mkiv | 582 +--- tex/context/base/java-stp.tex | 16 +- tex/context/base/l-aux.lua | 31 +- tex/context/base/l-table.lua | 2 +- tex/context/base/l-xml.lua | 2 +- tex/context/base/lang-ara.mkiv | 150 + tex/context/base/lang-ara.tex | 150 - tex/context/base/lang-chi.mkii | 305 ++ tex/context/base/lang-chi.tex | 305 -- tex/context/base/lang-cjk.mkiv | 328 ++ tex/context/base/lang-cjk.tex | 328 -- tex/context/base/lang-ctx.mkii | 53 + tex/context/base/lang-ctx.tex | 53 - tex/context/base/lang-dis.mkii | 59 + tex/context/base/lang-dis.tex | 59 - tex/context/base/lang-ini.mkii | 2 +- tex/context/base/lang-ini.mkiv | 43 +- tex/context/base/lang-ita.tex | 10 +- tex/context/base/lang-jap.mkii | 234 ++ tex/context/base/lang-jap.tex | 234 -- tex/context/base/lang-lab.mkiv | 212 +- tex/context/base/lang-mis.mkii | 683 ++++ tex/context/base/lang-mis.mkiv | 683 ++++ tex/context/base/lang-mis.tex | 683 ---- tex/context/base/lang-run.mkii | 36 + tex/context/base/lang-run.tex | 36 - tex/context/base/lang-sla.tex | 22 - tex/context/base/lang-spe.mkiv | 111 - tex/context/base/lpdf-ano.lua | 573 +++ tex/context/base/lpdf-col.lua | 150 + tex/context/base/lpdf-fld.lua | 747 ++++ tex/context/base/lpdf-grp.lua | 70 + tex/context/base/lpdf-ini.lua | 314 +- tex/context/base/lpdf-ini.mkiv | 243 +- tex/context/base/lpdf-mis.lua | 230 ++ tex/context/base/lpdf-nod.lua | 53 + tex/context/base/lpdf-ren.lua | 210 ++ tex/context/base/lpdf-u3d.lua | 427 +++ tex/context/base/lpdf-wid.lua | 328 ++ tex/context/base/luat-bas.mkiv | 1 + tex/context/base/luat-cod.mkiv | 6 +- tex/context/base/luat-ini.mkiv | 28 +- tex/context/base/luat-lib.mkiv | 2 +- tex/context/base/lxml-ini.mkiv | 408 +++ tex/context/base/lxml-ini.tex | 408 --- tex/context/base/lxml-tab.lua | 2 +- tex/context/base/m-format.tex | 409 +++ tex/context/base/math-ams.mkii | 336 ++ tex/context/base/math-ams.tex | 336 -- tex/context/base/math-cow.mkii | 31 + tex/context/base/math-cow.tex | 31 - tex/context/base/math-def.mkiv | 2 +- tex/context/base/math-eul.mkii | 277 ++ tex/context/base/math-eul.tex | 277 -- tex/context/base/math-fou.mkii | 196 ++ tex/context/base/math-fou.tex | 196 -- tex/context/base/math-frc.mkiv | 12 +- tex/context/base/math-ini.mkii | 4 +- tex/context/base/math-inl.mkiv | 10 +- tex/context/base/math-lbr.mkii | 450 +++ tex/context/base/math-lbr.tex | 450 --- tex/context/base/math-noa.lua | 15 +- tex/context/base/math-tex.mkii | 718 ++++ tex/context/base/math-tex.tex | 718 ---- tex/context/base/math-tim.mkii | 371 ++ tex/context/base/math-tim.tex | 371 -- tex/context/base/math-uni.mkii | 237 ++ tex/context/base/math-uni.tex | 237 -- tex/context/base/math-vfu.lua | 54 +- tex/context/base/meta-ini.mkii | 29 +- tex/context/base/meta-ini.mkiv | 318 +- tex/context/base/meta-pag.mkii | 226 ++ tex/context/base/meta-pag.mkiv | 223 ++ tex/context/base/meta-pag.tex | 226 -- tex/context/base/meta-pdf.lua | 214 +- tex/context/base/meta-pdf.mkiv | 702 +--- tex/context/base/meta-pdh.lua | 62 +- tex/context/base/meta-pdh.mkiv | 780 +++++ tex/context/base/metatex.tex | 44 +- tex/context/base/mlib-ctx.lua | 11 +- tex/context/base/mlib-pdf.lua | 43 +- tex/context/base/mlib-pdf.mkiv | 6 +- tex/context/base/mlib-pps.lua | 360 +- tex/context/base/mlib-pps.mkiv | 18 +- tex/context/base/mlib-run.lua | 2 +- tex/context/base/mult-chk.lua | 2 +- tex/context/base/mult-chk.mkii | 3 + tex/context/base/mult-cld.lua | 174 + tex/context/base/mult-cld.mkiv | 20 + tex/context/base/mult-de.tex | 2 + tex/context/base/mult-def.lua | 13 + tex/context/base/mult-en.tex | 2 + tex/context/base/mult-fr.tex | 2 + tex/context/base/mult-his.tex | 1155 ------- tex/context/base/mult-ini.lua | 25 +- tex/context/base/mult-ini.mkiv | 3 + tex/context/base/mult-it.tex | 2 + tex/context/base/mult-nl.tex | 2 + tex/context/base/mult-ro.tex | 2 + tex/context/base/mult-sys.tex | 32 +- tex/context/base/node-dum.lua | 12 +- tex/context/base/node-fin.lua | 249 +- tex/context/base/node-fin.mkiv | 10 +- tex/context/base/node-ini.lua | 5 +- tex/context/base/node-inj.lua | 298 +- tex/context/base/node-pro.lua | 29 +- tex/context/base/node-ref.lua | 496 +++ tex/context/base/node-res.lua | 14 +- tex/context/base/node-seq.lua | 18 +- tex/context/base/node-shp.lua | 2 +- tex/context/base/node-tex.lua | 33 +- tex/context/base/node-tra.lua | 4 +- tex/context/base/node-tsk.lua | 16 +- tex/context/base/node-tst.lua | 13 +- tex/context/base/pack-bar.mkiv | 67 + tex/context/base/pack-box.mkiv | 37 +- tex/context/base/pack-lyr.mkiv | 417 +-- tex/context/base/pack-obj.lua | 2 +- tex/context/base/pack-obj.mkiv | 168 +- tex/context/base/pack-rul.lua | 55 +- tex/context/base/pack-rul.mkii | 13 + tex/context/base/pack-rul.mkiv | 538 ++- tex/context/base/page-app.mkii | 225 ++ tex/context/base/page-app.mkiv | 225 ++ tex/context/base/page-app.tex | 225 -- tex/context/base/page-bck.mkiv | 198 +- tex/context/base/page-flw.mkii | 107 + tex/context/base/page-flw.mkiv | 107 + tex/context/base/page-flw.tex | 107 - tex/context/base/page-imp.mkii | 1314 +++++++ tex/context/base/page-imp.mkiv | 1298 +++++++ tex/context/base/page-imp.tex | 1314 ------- tex/context/base/page-ini.mkiv | 203 +- tex/context/base/page-ins.mkii | 103 + tex/context/base/page-ins.mkiv | 94 + tex/context/base/page-lay.mkii | 1429 ++++++++ tex/context/base/page-lay.mkiv | 1404 ++++++++ tex/context/base/page-lay.tex | 1429 -------- tex/context/base/page-lin.mkiv | 7 +- tex/context/base/page-log.mkii | 202 ++ tex/context/base/page-log.tex | 218 -- tex/context/base/page-mak.mkii | 234 ++ tex/context/base/page-mak.mkiv | 233 ++ tex/context/base/page-mak.tex | 234 -- tex/context/base/page-mar.mkii | 867 +++++ tex/context/base/page-mar.mkiv | 838 +++++ tex/context/base/page-mar.tex | 867 ----- tex/context/base/page-mis.mkii | 268 ++ tex/context/base/page-mis.mkiv | 266 ++ tex/context/base/page-mis.tex | 268 -- tex/context/base/page-mul.mkii | 1773 ++++++++++ tex/context/base/page-mul.mkiv | 1755 ++++++++++ tex/context/base/page-mul.tex | 1773 ---------- tex/context/base/page-new.tex | 277 -- tex/context/base/page-not.mkii | 72 + tex/context/base/page-not.mkiv | 72 + tex/context/base/page-not.tex | 72 - tex/context/base/page-one.mkiv | 28 +- tex/context/base/page-par.mkii | 58 + tex/context/base/page-par.mkiv | 58 + tex/context/base/page-par.tex | 58 - tex/context/base/page-plg.mkii | 202 ++ tex/context/base/page-plg.mkiv | 198 ++ tex/context/base/page-plg.tex | 202 -- tex/context/base/page-run.mkii | 382 ++ tex/context/base/page-run.mkiv | 382 ++ tex/context/base/page-run.tex | 382 -- tex/context/base/page-set.mkii | 3109 +++++++++++++++++ tex/context/base/page-set.mkiv | 3104 +++++++++++++++++ tex/context/base/page-set.tex | 2815 --------------- tex/context/base/page-sid.mkii | 931 +++++ tex/context/base/page-sid.mkiv | 931 +++++ tex/context/base/page-sid.tex | 931 ----- tex/context/base/page-spr.mkii | 104 + tex/context/base/page-spr.mkiv | 103 + tex/context/base/page-spr.tex | 104 - tex/context/base/page-str.mkii | 376 ++ tex/context/base/page-str.mkiv | 380 ++ tex/context/base/page-str.tex | 374 -- tex/context/base/page-txt.mkiv | 455 +-- tex/context/base/pdfr-def.mkii | 843 +++++ tex/context/base/pdfr-def.tex | 843 ----- tex/context/base/pdfr-ec.mkii | 145 + tex/context/base/pdfr-ec.tex | 145 - tex/context/base/pdfr-il2.mkii | 233 ++ tex/context/base/prop-ini.mkiv | 8 +- tex/context/base/prop-lay.mkiv | 133 +- tex/context/base/regi-8859-1.mkii | 154 + tex/context/base/regi-8859-1.tex | 154 - tex/context/base/regi-8859-10.mkii | 152 + tex/context/base/regi-8859-10.tex | 152 - tex/context/base/regi-8859-13.mkii | 152 + tex/context/base/regi-8859-13.tex | 152 - tex/context/base/regi-8859-15.mkii | 154 + tex/context/base/regi-8859-15.tex | 154 - tex/context/base/regi-8859-16.mkii | 151 + tex/context/base/regi-8859-16.tex | 151 - tex/context/base/regi-8859-2.mkii | 152 + tex/context/base/regi-8859-2.tex | 152 - tex/context/base/regi-8859-3.mkii | 145 + tex/context/base/regi-8859-3.tex | 145 - tex/context/base/regi-8859-4.mkii | 152 + tex/context/base/regi-8859-4.tex | 152 - tex/context/base/regi-8859-5.mkii | 152 + tex/context/base/regi-8859-5.tex | 152 - tex/context/base/regi-8859-7.mkii | 153 + tex/context/base/regi-8859-7.tex | 153 - tex/context/base/regi-8859-9.mkii | 152 + tex/context/base/regi-8859-9.tex | 152 - tex/context/base/regi-cp1250.mkii | 153 + tex/context/base/regi-cp1250.tex | 153 - tex/context/base/regi-cp1251.mkii | 152 + tex/context/base/regi-cp1251.tex | 152 - tex/context/base/regi-cp1252.mkii | 156 + tex/context/base/regi-cp1252.tex | 156 - tex/context/base/regi-cp1253.mkii | 153 + tex/context/base/regi-cp1253.tex | 153 - tex/context/base/regi-cp1254.mkii | 153 + tex/context/base/regi-cp1254.tex | 153 - tex/context/base/regi-cp1257.mkii | 153 + tex/context/base/regi-cp1257.tex | 153 - tex/context/base/regi-cyp.mkii | 1169 +++++++ tex/context/base/regi-cyp.tex | 1169 ------- tex/context/base/regi-cyr.mkii | 722 ++++ tex/context/base/regi-cyr.tex | 722 ---- tex/context/base/regi-def.mkii | 21 + tex/context/base/regi-def.tex | 21 - tex/context/base/regi-ibm.mkii | 73 + tex/context/base/regi-ibm.tex | 73 - tex/context/base/regi-ini.mkii | 20 +- tex/context/base/regi-mac.mkii | 147 + tex/context/base/regi-mac.tex | 147 - tex/context/base/regi-run.mkii | 32 - tex/context/base/regi-uni.mkii | 24 + tex/context/base/regi-uni.tex | 24 - tex/context/base/regi-utf.mkii | 51 + tex/context/base/regi-utf.tex | 51 - tex/context/base/regi-vis.mkii | 158 + tex/context/base/regi-vis.tex | 158 - tex/context/base/s-pre-11.tex | 220 ++ tex/context/base/s-pre-12.tex | 226 ++ tex/context/base/s-pre-17.tex | 399 +++ tex/context/base/s-pre-18.tex | 177 + tex/context/base/s-pre-19.tex | 1 + tex/context/base/s-pre-26.tex | 255 ++ tex/context/base/s-pre-27.tex | 181 + tex/context/base/s-pre-61.tex | 2 +- tex/context/base/s-pre-93.tex | 210 ++ tex/context/base/scrn-bar.mkiv | 398 +++ tex/context/base/scrn-but.mkiv | 126 + tex/context/base/scrn-fld.mkii | 165 + tex/context/base/scrn-fld.mkiv | 1061 ++---- tex/context/base/scrn-int.lua | 111 + tex/context/base/scrn-int.mkii | 198 +- tex/context/base/scrn-int.mkiv | 2235 +++--------- tex/context/base/scrn-men.mkiv | 616 ++++ tex/context/base/scrn-nav.mkiv | 363 +- tex/context/base/sort-def.mkii | 450 +++ tex/context/base/sort-def.tex | 450 --- tex/context/base/sort-ini.lua | 118 +- tex/context/base/sort-ini.mkii | 12 +- tex/context/base/sort-lan.lua | 157 +- tex/context/base/sort-lan.mkii | 203 ++ tex/context/base/sort-lan.tex | 203 -- tex/context/base/spec-def.mkii | 1016 ++++++ tex/context/base/spec-def.tex | 1016 ------ tex/context/base/spec-dpm.mkii | 445 +++ tex/context/base/spec-dpm.tex | 445 --- tex/context/base/spec-dpx.mkii | 793 +++++ tex/context/base/spec-dpx.tex | 793 ----- tex/context/base/spec-dvi.mkii | 118 + tex/context/base/spec-dvi.tex | 118 - tex/context/base/spec-fdf.mkii | 3444 ++++++++++++++++++ tex/context/base/spec-fdf.tex | 3446 ------------------ tex/context/base/spec-ini.mkii | 559 +++ tex/context/base/spec-ini.tex | 591 ---- tex/context/base/spec-mis.mkii | 286 ++ tex/context/base/spec-mis.tex | 286 -- tex/context/base/spec-pdf.mkii | 484 +++ tex/context/base/spec-pdf.tex | 484 --- tex/context/base/spec-ps.mkii | 229 ++ tex/context/base/spec-ps.tex | 229 -- tex/context/base/spec-tpd.mkii | 1334 +++++++ tex/context/base/spec-tpd.tex | 1334 ------- tex/context/base/spec-tr.mkii | 107 + tex/context/base/spec-tr.tex | 107 - tex/context/base/spec-tst.mkii | 152 + tex/context/base/spec-tst.tex | 152 - tex/context/base/spec-var.mkii | 83 + tex/context/base/spec-var.tex | 83 - tex/context/base/spec-win.mkii | 99 + tex/context/base/spec-win.tex | 99 - tex/context/base/spec-xet.mkii | 66 + tex/context/base/spec-xet.tex | 66 - tex/context/base/spec-xtx.mkii | 87 + tex/context/base/spec-xtx.tex | 87 - tex/context/base/spec-yy.mkii | 90 + tex/context/base/spec-yy.tex | 90 - tex/context/base/strc-bkm.lua | 124 +- tex/context/base/strc-def.mkiv | 14 +- tex/context/base/strc-des.mkiv | 13 +- tex/context/base/strc-doc.lua | 182 +- tex/context/base/strc-doc.mkiv | 80 +- tex/context/base/strc-flt.mkiv | 74 +- tex/context/base/strc-itm.mkii | 8 + tex/context/base/strc-itm.mkiv | 48 +- tex/context/base/strc-lnt.mkii | 197 ++ tex/context/base/strc-lnt.mkiv | 193 ++ tex/context/base/strc-lst.lua | 15 +- tex/context/base/strc-lst.mkiv | 64 +- tex/context/base/strc-mar.lua | 2 +- tex/context/base/strc-mat.mkiv | 30 +- tex/context/base/strc-not.lua | 102 +- tex/context/base/strc-not.mkiv | 160 +- tex/context/base/strc-num.lua | 39 +- tex/context/base/strc-num.mkiv | 41 +- tex/context/base/strc-pag.lua | 15 +- tex/context/base/strc-pag.mkiv | 172 +- tex/context/base/strc-ref.lua | 421 ++- tex/context/base/strc-ref.mkiv | 916 ++--- tex/context/base/strc-reg.lua | 158 +- tex/context/base/strc-reg.mkiv | 192 +- tex/context/base/strc-ren.mkiv | 74 +- tex/context/base/strc-sec.mkii | 19 + tex/context/base/strc-sec.mkiv | 53 +- tex/context/base/strc-syn.lua | 14 +- tex/context/base/supp-box.tex | 172 +- tex/context/base/supp-emp.mkii | 398 +++ tex/context/base/supp-emp.tex | 398 --- tex/context/base/supp-eps.mkii | 202 ++ tex/context/base/supp-eps.tex | 202 -- tex/context/base/supp-lan.tex | 1377 -------- tex/context/base/supp-mis.mkii | 710 ++++ tex/context/base/supp-mis.tex | 710 ---- tex/context/base/supp-mpe.mkii | 1370 ++++++++ tex/context/base/supp-mpe.tex | 1370 -------- tex/context/base/supp-mps.mkii | 2133 ++++++++++++ tex/context/base/supp-mps.tex | 2133 ------------ tex/context/base/supp-mrk.mkii | 591 ++++ tex/context/base/supp-mrk.tex | 591 ---- tex/context/base/supp-pat.mkii | 179 + tex/context/base/supp-pat.tex | 179 - tex/context/base/supp-pdf.mkii | 2187 ++++++++++++ tex/context/base/supp-pdf.tex | 2187 ------------ tex/context/base/supp-ran.mkii | 2 +- tex/context/base/supp-spe.mkii | 164 + tex/context/base/supp-spe.tex | 164 - tex/context/base/supp-tpi.mkii | 353 ++ tex/context/base/supp-tpi.tex | 353 -- tex/context/base/symb-ini.mkii | 281 ++ tex/context/base/symb-ini.mkiv | 281 ++ tex/context/base/symb-ini.tex | 294 -- tex/context/base/symb-jmn.tex | 9 +- tex/context/base/symb-nav.tex | 10 +- tex/context/base/symb-run.mkii | 54 + tex/context/base/symb-run.mkiv | 54 + tex/context/base/symb-run.tex | 54 - tex/context/base/syst-aux.mkiv | 89 +- tex/context/base/syst-ext.mkii | 4980 +++++++++++++++++++++++++++ tex/context/base/syst-ext.tex | 4978 -------------------------- tex/context/base/syst-gen.mkii | 4420 ++++++++++++++++++++++++ tex/context/base/syst-gen.tex | 4420 ------------------------ tex/context/base/syst-ini.tex | 4 +- tex/context/base/syst-lua.lua | 2 - tex/context/base/syst-new.mkii | 868 +++++ tex/context/base/syst-new.tex | 868 ----- tex/context/base/syst-tex.mkii | 314 ++ tex/context/base/syst-tex.tex | 314 -- tex/context/base/tabl-ltb.mkii | 866 +++++ tex/context/base/tabl-ltb.mkiv | 866 +++++ tex/context/base/tabl-ltb.tex | 856 ----- tex/context/base/tabl-ntb.mkiv | 3 +- tex/context/base/tabl-nte.mkii | 107 + tex/context/base/tabl-nte.mkiv | 107 + tex/context/base/tabl-nte.tex | 107 - tex/context/base/tabl-pln.mkii | 91 + tex/context/base/tabl-pln.mkiv | 91 + tex/context/base/tabl-pln.tex | 91 - tex/context/base/tabl-tab.mkii | 2515 ++++++++++++++ tex/context/base/tabl-tab.mkiv | 2515 ++++++++++++++ tex/context/base/tabl-tab.tex | 2507 -------------- tex/context/base/tabl-tbl.mkii | 1439 ++++++++ tex/context/base/tabl-tbl.mkiv | 1472 ++++++++ tex/context/base/tabl-tbl.tex | 1439 -------- tex/context/base/tabl-tsp.mkii | 427 +++ tex/context/base/tabl-tsp.mkiv | 427 +++ tex/context/base/tabl-tsp.tex | 427 --- tex/context/base/task-ini.lua | 58 +- tex/context/base/thrd-ran.mkii | 168 + tex/context/base/thrd-ran.tex | 168 - tex/context/base/thrd-trg.mkii | 127 + tex/context/base/thrd-trg.tex | 127 - tex/context/base/todo-mkii.tex | 1 - tex/context/base/todo-mkiv.tex | 6 - tex/context/base/trac-inf.lua | 1 + tex/context/base/trac-log.lua | 7 +- tex/context/base/trac-tra.lua | 6 +- tex/context/base/trac-vis.mkiv | 28 +- tex/context/base/type-akb.tex | 253 -- tex/context/base/type-dis.tex | 241 -- tex/context/base/type-enc.tex | 1182 ------- tex/context/base/type-exa.tex | 27 - tex/context/base/type-ini.mkii | 9 +- tex/context/base/type-ini.mkiv | 145 +- tex/context/base/type-map.tex | 197 -- tex/context/base/type-old.tex | 320 -- tex/context/base/type-omg.tex | 204 -- tex/context/base/type-one.mkii | 1185 +++++++ tex/context/base/type-one.mkiv | 16 + tex/context/base/type-one.tex | 1171 +------ tex/context/base/type-otf.mkiv | 244 +- tex/context/base/type-run.mkii | 51 + tex/context/base/type-run.mkiv | 51 + tex/context/base/type-run.tex | 51 - tex/context/base/type-siz.mkii | 12 +- tex/context/base/type-siz.mkiv | 460 +-- tex/context/base/type-spe.tex | 49 - tex/context/base/type-syn.tex | 880 ----- tex/context/base/type-tmf.mkii | 1161 +++++++ tex/context/base/type-tmf.mkiv | 933 +++++ tex/context/base/type-tmf.tex | 1159 +------ tex/context/base/typo-krn.lua | 8 +- tex/context/base/typo-mir.lua | 6 +- tex/context/base/unic-000.mkii | 135 + tex/context/base/unic-000.tex | 135 - tex/context/base/unic-001.mkii | 220 ++ tex/context/base/unic-001.tex | 220 -- tex/context/base/unic-002.mkii | 104 + tex/context/base/unic-002.tex | 104 - tex/context/base/unic-003.mkii | 147 + tex/context/base/unic-003.tex | 147 - tex/context/base/unic-004.mkii | 291 ++ tex/context/base/unic-004.tex | 291 -- tex/context/base/unic-005.mkii | 50 + tex/context/base/unic-005.tex | 50 - tex/context/base/unic-030.mkii | 113 + tex/context/base/unic-030.tex | 113 - tex/context/base/unic-031.mkii | 283 ++ tex/context/base/unic-031.tex | 283 -- tex/context/base/unic-032.mkii | 278 ++ tex/context/base/unic-032.tex | 278 -- tex/context/base/unic-033.mkii | 275 ++ tex/context/base/unic-033.tex | 275 -- tex/context/base/unic-034.mkii | 274 ++ tex/context/base/unic-034.tex | 274 -- tex/context/base/unic-035.mkii | 32 + tex/context/base/unic-035.tex | 32 - tex/context/base/unic-037.mkii | 278 ++ tex/context/base/unic-037.tex | 278 -- tex/context/base/unic-039.mkii | 68 + tex/context/base/unic-039.tex | 68 - tex/context/base/unic-251.mkii | 34 + tex/context/base/unic-251.tex | 34 - tex/context/base/unic-cjk.mkii | 22 + tex/context/base/unic-cjk.tex | 22 - tex/context/base/unic-exp.mkii | 82 + tex/context/base/unic-exp.tex | 82 - tex/context/base/unic-ini.mkii | 6 +- tex/context/base/unic-run.mkii | 130 + tex/context/base/unic-run.tex | 130 - tex/context/base/verb-c.mkii | 484 +++ tex/context/base/verb-c.tex | 484 --- tex/context/base/verb-eif.mkii | 211 ++ tex/context/base/verb-eif.tex | 211 -- tex/context/base/verb-ini.mkii | 1810 ++++++++++ tex/context/base/verb-ini.tex | 1810 ---------- tex/context/base/verb-js.mkii | 171 + tex/context/base/verb-js.tex | 171 - tex/context/base/verb-jv.mkii | 222 ++ tex/context/base/verb-jv.tex | 222 -- tex/context/base/verb-mp.mkii | 364 ++ tex/context/base/verb-mp.tex | 364 -- tex/context/base/verb-pas.mkii | 266 ++ tex/context/base/verb-pas.tex | 266 -- tex/context/base/verb-pl.mkii | 547 +++ tex/context/base/verb-pl.tex | 547 --- tex/context/base/verb-raw.mkii | 7 + tex/context/base/verb-raw.tex | 7 - tex/context/base/verb-sql.mkii | 230 ++ tex/context/base/verb-sql.tex | 230 -- tex/context/base/verb-tex.mkii | 294 ++ tex/context/base/verb-tex.tex | 294 -- tex/context/base/verb-xml.mkii | 441 +++ tex/context/base/verb-xml.tex | 441 --- tex/context/base/xetx-chr.mkii | 1167 +++++++ tex/context/base/xetx-chr.tex | 1167 ------- tex/context/base/xetx-cls.mkii | 378 ++ tex/context/base/xetx-cls.tex | 378 -- tex/context/base/xetx-ini.mkii | 132 + tex/context/base/xetx-ini.tex | 132 - tex/context/base/xetx-utf.mkii | 1989 +++++++++++ tex/context/base/xetx-utf.tex | 1989 ----------- tex/context/base/xtag-exp.tex | 65 +- tex/context/base/xtag-ext.tex | 35 +- tex/context/base/xtag-hyp.tex | 22 +- tex/context/base/xtag-ini.tex | 13 +- tex/context/base/xtag-pre.tex | 9 +- tex/context/bib/bibl-ams.tex | 48 +- tex/context/bib/t-bib.mkiv | 2 - tex/context/bib/t-bib.tex | 4 +- tex/context/interface/cont-cs.xml | 3 + tex/context/interface/cont-de.xml | 3 + tex/context/interface/cont-en.xml | 3 + tex/context/interface/cont-fr.xml | 3 + tex/context/interface/cont-it.xml | 3 + tex/context/interface/cont-nl.xml | 3 + tex/context/interface/cont-pe.xml | 3 + tex/context/interface/cont-ro.xml | 3 + tex/context/interface/keys-cs.xml | 2 + tex/context/interface/keys-de.xml | 2 + tex/context/interface/keys-en.xml | 2 + tex/context/interface/keys-fr.xml | 2 + tex/context/interface/keys-it.xml | 2 + tex/context/interface/keys-nl.xml | 2 + tex/context/interface/keys-pe.xml | 2 + tex/context/interface/keys-ro.xml | 2 + tex/context/sample/demo-cld.cld | 74 + tex/context/sample/sample.tex | 8 +- tex/generic/context/luatex-fonts-merged.lua | 763 ++-- tex/generic/context/luatex-fonts.lua | 5 +- tex/generic/context/mptopdf.tex | 8 +- tex/generic/context/ppchtex.noc | 4 +- tpm/t-bib.tpm | 4 +- web2c/context.cnf | 4 +- 723 files changed, 125094 insertions(+), 107982 deletions(-) create mode 100644 context/data/texworks/texworks-context.rme create mode 100644 fonts/map/luatex/context/demo-font.lum create mode 100644 scripts/context/lua/mtx-texworks.lua create mode 100644 scripts/context/lua/mtx-tools.lua create mode 100644 scripts/context/stubs/mswin/mtxworks.cmd create mode 100755 scripts/context/stubs/unix/mtxworks create mode 100644 tex/context/base/bibl-bib.mkiv delete mode 100644 tex/context/base/bibl-bib.tex create mode 100644 tex/context/base/core-fil.mkii create mode 100644 tex/context/base/core-fil.mkiv delete mode 100644 tex/context/base/core-fil.tex create mode 100644 tex/context/base/core-gen.mkii create mode 100644 tex/context/base/core-gen.mkiv delete mode 100644 tex/context/base/core-gen.tex create mode 100644 tex/context/base/core-grd.mkii create mode 100644 tex/context/base/core-grd.mkiv delete mode 100644 tex/context/base/core-grd.tex create mode 100644 tex/context/base/core-ini.mkii create mode 100644 tex/context/base/core-ini.mkiv delete mode 100644 tex/context/base/core-ini.tex delete mode 100644 tex/context/base/core-ins.tex delete mode 100644 tex/context/base/core-lme.tex delete mode 100644 tex/context/base/core-lnt.tex delete mode 100644 tex/context/base/core-mak.tex create mode 100644 tex/context/base/core-par.mkii delete mode 100644 tex/context/base/core-par.tex create mode 100644 tex/context/base/core-stg.mkii delete mode 100644 tex/context/base/core-stg.tex create mode 100644 tex/context/base/core-var.mkii create mode 100644 tex/context/base/core-var.mkiv delete mode 100644 tex/context/base/core-var.tex create mode 100644 tex/context/base/enco-032.mkii delete mode 100644 tex/context/base/enco-032.tex create mode 100644 tex/context/base/enco-037.mkii delete mode 100644 tex/context/base/enco-037.tex create mode 100644 tex/context/base/enco-acc.mkii delete mode 100644 tex/context/base/enco-acc.tex create mode 100644 tex/context/base/enco-agr.mkii delete mode 100644 tex/context/base/enco-agr.tex create mode 100644 tex/context/base/enco-ans.mkii delete mode 100644 tex/context/base/enco-ans.tex create mode 100644 tex/context/base/enco-cas.mkii delete mode 100644 tex/context/base/enco-cas.tex create mode 100644 tex/context/base/enco-chi.mkii delete mode 100644 tex/context/base/enco-chi.tex create mode 100644 tex/context/base/enco-com.mkii delete mode 100644 tex/context/base/enco-com.tex create mode 100644 tex/context/base/enco-cyr.mkii delete mode 100644 tex/context/base/enco-cyr.tex create mode 100644 tex/context/base/enco-def.mkii delete mode 100644 tex/context/base/enco-def.tex create mode 100644 tex/context/base/enco-ec.mkii delete mode 100644 tex/context/base/enco-ec.tex create mode 100644 tex/context/base/enco-ecm.mkii delete mode 100644 tex/context/base/enco-ecm.tex create mode 100644 tex/context/base/enco-el.mkii delete mode 100644 tex/context/base/enco-el.tex create mode 100644 tex/context/base/enco-fde.mkii delete mode 100644 tex/context/base/enco-fde.tex create mode 100644 tex/context/base/enco-ffr.mkii delete mode 100644 tex/context/base/enco-ffr.tex create mode 100644 tex/context/base/enco-fpl.mkii delete mode 100644 tex/context/base/enco-fpl.tex create mode 100644 tex/context/base/enco-fro.mkii delete mode 100644 tex/context/base/enco-fro.tex create mode 100644 tex/context/base/enco-fsl.mkii delete mode 100644 tex/context/base/enco-fsl.tex create mode 100644 tex/context/base/enco-grk.mkii delete mode 100644 tex/context/base/enco-grk.tex create mode 100644 tex/context/base/enco-heb.mkii delete mode 100644 tex/context/base/enco-heb.tex create mode 100644 tex/context/base/enco-ibm.mkii delete mode 100644 tex/context/base/enco-ibm.tex create mode 100644 tex/context/base/enco-il2.mkii delete mode 100644 tex/context/base/enco-il2.tex create mode 100644 tex/context/base/enco-lat.mkii delete mode 100644 tex/context/base/enco-lat.tex create mode 100644 tex/context/base/enco-mis.mkii delete mode 100644 tex/context/base/enco-mis.tex create mode 100644 tex/context/base/enco-pdf.mkii delete mode 100644 tex/context/base/enco-pdf.tex create mode 100644 tex/context/base/enco-pfr.mkii delete mode 100644 tex/context/base/enco-pfr.tex create mode 100644 tex/context/base/enco-pol.mkii delete mode 100644 tex/context/base/enco-pol.tex create mode 100644 tex/context/base/enco-qx.mkii delete mode 100644 tex/context/base/enco-qx.tex create mode 100644 tex/context/base/enco-raw.mkii delete mode 100644 tex/context/base/enco-raw.tex create mode 100644 tex/context/base/enco-run.mkii delete mode 100644 tex/context/base/enco-run.tex create mode 100644 tex/context/base/enco-t5.mkii delete mode 100644 tex/context/base/enco-t5.tex create mode 100644 tex/context/base/enco-tbo.mkii delete mode 100644 tex/context/base/enco-tbo.tex create mode 100644 tex/context/base/enco-uc.mkii delete mode 100644 tex/context/base/enco-uc.tex create mode 100644 tex/context/base/enco-vis.mkii delete mode 100644 tex/context/base/enco-vis.tex create mode 100644 tex/context/base/enco-vna.mkii delete mode 100644 tex/context/base/enco-vna.tex create mode 100644 tex/context/base/enco-win.mkii delete mode 100644 tex/context/base/enco-win.tex create mode 100644 tex/context/base/enco-x5.mkii delete mode 100644 tex/context/base/enco-x5.tex create mode 100644 tex/context/base/filt-bas.mkii delete mode 100644 tex/context/base/filt-bas.tex create mode 100644 tex/context/base/filt-ini.mkii delete mode 100644 tex/context/base/filt-ini.tex create mode 100644 tex/context/base/font-arb.mkii delete mode 100644 tex/context/base/font-arb.tex create mode 100644 tex/context/base/font-bfm.mkii delete mode 100644 tex/context/base/font-bfm.tex create mode 100644 tex/context/base/font-chi.mkii delete mode 100644 tex/context/base/font-chi.tex create mode 100644 tex/context/base/font-heb.mkii delete mode 100644 tex/context/base/font-heb.tex create mode 100644 tex/context/base/font-jap.mkii delete mode 100644 tex/context/base/font-jap.tex create mode 100644 tex/context/base/font-run.mkii create mode 100644 tex/context/base/font-run.mkiv delete mode 100644 tex/context/base/font-run.tex create mode 100644 tex/context/base/font-xtx.mkii delete mode 100644 tex/context/base/font-xtx.tex create mode 100644 tex/context/base/grph-u3d.lua create mode 100644 tex/context/base/hand-def.mkii delete mode 100644 tex/context/base/hand-def.tex create mode 100644 tex/context/base/java-ini.lua create mode 100644 tex/context/base/lang-ara.mkiv delete mode 100644 tex/context/base/lang-ara.tex create mode 100644 tex/context/base/lang-chi.mkii delete mode 100644 tex/context/base/lang-chi.tex create mode 100644 tex/context/base/lang-cjk.mkiv delete mode 100644 tex/context/base/lang-cjk.tex create mode 100644 tex/context/base/lang-ctx.mkii delete mode 100644 tex/context/base/lang-ctx.tex create mode 100644 tex/context/base/lang-dis.mkii delete mode 100644 tex/context/base/lang-dis.tex create mode 100644 tex/context/base/lang-jap.mkii delete mode 100644 tex/context/base/lang-jap.tex create mode 100644 tex/context/base/lang-mis.mkii create mode 100644 tex/context/base/lang-mis.mkiv delete mode 100644 tex/context/base/lang-mis.tex create mode 100644 tex/context/base/lang-run.mkii delete mode 100644 tex/context/base/lang-run.tex delete mode 100644 tex/context/base/lang-spe.mkiv create mode 100644 tex/context/base/lpdf-ano.lua create mode 100644 tex/context/base/lpdf-col.lua create mode 100644 tex/context/base/lpdf-fld.lua create mode 100644 tex/context/base/lpdf-grp.lua create mode 100644 tex/context/base/lpdf-mis.lua create mode 100644 tex/context/base/lpdf-nod.lua create mode 100644 tex/context/base/lpdf-ren.lua create mode 100644 tex/context/base/lpdf-u3d.lua create mode 100644 tex/context/base/lpdf-wid.lua create mode 100644 tex/context/base/lxml-ini.mkiv delete mode 100644 tex/context/base/lxml-ini.tex create mode 100644 tex/context/base/m-format.tex create mode 100644 tex/context/base/math-ams.mkii delete mode 100644 tex/context/base/math-ams.tex create mode 100644 tex/context/base/math-cow.mkii delete mode 100644 tex/context/base/math-cow.tex create mode 100644 tex/context/base/math-eul.mkii delete mode 100644 tex/context/base/math-eul.tex create mode 100644 tex/context/base/math-fou.mkii delete mode 100644 tex/context/base/math-fou.tex create mode 100644 tex/context/base/math-lbr.mkii delete mode 100644 tex/context/base/math-lbr.tex create mode 100644 tex/context/base/math-tex.mkii delete mode 100644 tex/context/base/math-tex.tex create mode 100644 tex/context/base/math-tim.mkii delete mode 100644 tex/context/base/math-tim.tex create mode 100644 tex/context/base/math-uni.mkii delete mode 100644 tex/context/base/math-uni.tex create mode 100644 tex/context/base/meta-pag.mkii create mode 100644 tex/context/base/meta-pag.mkiv delete mode 100644 tex/context/base/meta-pag.tex create mode 100644 tex/context/base/meta-pdh.mkiv create mode 100644 tex/context/base/mult-cld.lua create mode 100644 tex/context/base/mult-cld.mkiv delete mode 100644 tex/context/base/mult-his.tex create mode 100644 tex/context/base/node-ref.lua create mode 100644 tex/context/base/pack-bar.mkiv create mode 100644 tex/context/base/page-app.mkii create mode 100644 tex/context/base/page-app.mkiv delete mode 100644 tex/context/base/page-app.tex create mode 100644 tex/context/base/page-flw.mkii create mode 100644 tex/context/base/page-flw.mkiv delete mode 100644 tex/context/base/page-flw.tex create mode 100644 tex/context/base/page-imp.mkii create mode 100644 tex/context/base/page-imp.mkiv delete mode 100644 tex/context/base/page-imp.tex create mode 100644 tex/context/base/page-ins.mkii create mode 100644 tex/context/base/page-ins.mkiv create mode 100644 tex/context/base/page-lay.mkii create mode 100644 tex/context/base/page-lay.mkiv delete mode 100644 tex/context/base/page-lay.tex create mode 100644 tex/context/base/page-log.mkii delete mode 100644 tex/context/base/page-log.tex create mode 100644 tex/context/base/page-mak.mkii create mode 100644 tex/context/base/page-mak.mkiv delete mode 100644 tex/context/base/page-mak.tex create mode 100644 tex/context/base/page-mar.mkii create mode 100644 tex/context/base/page-mar.mkiv delete mode 100644 tex/context/base/page-mar.tex create mode 100644 tex/context/base/page-mis.mkii create mode 100644 tex/context/base/page-mis.mkiv delete mode 100644 tex/context/base/page-mis.tex create mode 100644 tex/context/base/page-mul.mkii create mode 100644 tex/context/base/page-mul.mkiv delete mode 100644 tex/context/base/page-mul.tex delete mode 100644 tex/context/base/page-new.tex create mode 100644 tex/context/base/page-not.mkii create mode 100644 tex/context/base/page-not.mkiv delete mode 100644 tex/context/base/page-not.tex create mode 100644 tex/context/base/page-par.mkii create mode 100644 tex/context/base/page-par.mkiv delete mode 100644 tex/context/base/page-par.tex create mode 100644 tex/context/base/page-plg.mkii create mode 100644 tex/context/base/page-plg.mkiv delete mode 100644 tex/context/base/page-plg.tex create mode 100644 tex/context/base/page-run.mkii create mode 100644 tex/context/base/page-run.mkiv delete mode 100644 tex/context/base/page-run.tex create mode 100644 tex/context/base/page-set.mkii create mode 100644 tex/context/base/page-set.mkiv delete mode 100644 tex/context/base/page-set.tex create mode 100644 tex/context/base/page-sid.mkii create mode 100644 tex/context/base/page-sid.mkiv delete mode 100644 tex/context/base/page-sid.tex create mode 100644 tex/context/base/page-spr.mkii create mode 100644 tex/context/base/page-spr.mkiv delete mode 100644 tex/context/base/page-spr.tex create mode 100644 tex/context/base/page-str.mkii create mode 100644 tex/context/base/page-str.mkiv delete mode 100644 tex/context/base/page-str.tex create mode 100644 tex/context/base/pdfr-def.mkii delete mode 100644 tex/context/base/pdfr-def.tex create mode 100644 tex/context/base/pdfr-ec.mkii delete mode 100644 tex/context/base/pdfr-ec.tex create mode 100644 tex/context/base/pdfr-il2.mkii create mode 100644 tex/context/base/regi-8859-1.mkii delete mode 100644 tex/context/base/regi-8859-1.tex create mode 100644 tex/context/base/regi-8859-10.mkii delete mode 100644 tex/context/base/regi-8859-10.tex create mode 100644 tex/context/base/regi-8859-13.mkii delete mode 100644 tex/context/base/regi-8859-13.tex create mode 100644 tex/context/base/regi-8859-15.mkii delete mode 100644 tex/context/base/regi-8859-15.tex create mode 100644 tex/context/base/regi-8859-16.mkii delete mode 100644 tex/context/base/regi-8859-16.tex create mode 100644 tex/context/base/regi-8859-2.mkii delete mode 100644 tex/context/base/regi-8859-2.tex create mode 100644 tex/context/base/regi-8859-3.mkii delete mode 100644 tex/context/base/regi-8859-3.tex create mode 100644 tex/context/base/regi-8859-4.mkii delete mode 100644 tex/context/base/regi-8859-4.tex create mode 100644 tex/context/base/regi-8859-5.mkii delete mode 100644 tex/context/base/regi-8859-5.tex create mode 100644 tex/context/base/regi-8859-7.mkii delete mode 100644 tex/context/base/regi-8859-7.tex create mode 100644 tex/context/base/regi-8859-9.mkii delete mode 100644 tex/context/base/regi-8859-9.tex create mode 100644 tex/context/base/regi-cp1250.mkii delete mode 100644 tex/context/base/regi-cp1250.tex create mode 100644 tex/context/base/regi-cp1251.mkii delete mode 100644 tex/context/base/regi-cp1251.tex create mode 100644 tex/context/base/regi-cp1252.mkii delete mode 100644 tex/context/base/regi-cp1252.tex create mode 100644 tex/context/base/regi-cp1253.mkii delete mode 100644 tex/context/base/regi-cp1253.tex create mode 100644 tex/context/base/regi-cp1254.mkii delete mode 100644 tex/context/base/regi-cp1254.tex create mode 100644 tex/context/base/regi-cp1257.mkii delete mode 100644 tex/context/base/regi-cp1257.tex create mode 100644 tex/context/base/regi-cyp.mkii delete mode 100644 tex/context/base/regi-cyp.tex create mode 100644 tex/context/base/regi-cyr.mkii delete mode 100644 tex/context/base/regi-cyr.tex create mode 100644 tex/context/base/regi-def.mkii delete mode 100644 tex/context/base/regi-def.tex create mode 100644 tex/context/base/regi-ibm.mkii delete mode 100644 tex/context/base/regi-ibm.tex create mode 100644 tex/context/base/regi-mac.mkii delete mode 100644 tex/context/base/regi-mac.tex delete mode 100644 tex/context/base/regi-run.mkii create mode 100644 tex/context/base/regi-uni.mkii delete mode 100644 tex/context/base/regi-uni.tex create mode 100644 tex/context/base/regi-utf.mkii delete mode 100644 tex/context/base/regi-utf.tex create mode 100644 tex/context/base/regi-vis.mkii delete mode 100644 tex/context/base/regi-vis.tex create mode 100644 tex/context/base/s-pre-11.tex create mode 100644 tex/context/base/s-pre-12.tex create mode 100644 tex/context/base/s-pre-17.tex create mode 100644 tex/context/base/s-pre-18.tex create mode 100644 tex/context/base/s-pre-26.tex create mode 100644 tex/context/base/s-pre-27.tex create mode 100644 tex/context/base/s-pre-93.tex create mode 100644 tex/context/base/scrn-bar.mkiv create mode 100644 tex/context/base/scrn-but.mkiv create mode 100644 tex/context/base/scrn-int.lua create mode 100644 tex/context/base/scrn-men.mkiv create mode 100644 tex/context/base/sort-def.mkii delete mode 100644 tex/context/base/sort-def.tex create mode 100644 tex/context/base/sort-lan.mkii delete mode 100644 tex/context/base/sort-lan.tex create mode 100644 tex/context/base/spec-def.mkii delete mode 100644 tex/context/base/spec-def.tex create mode 100644 tex/context/base/spec-dpm.mkii delete mode 100644 tex/context/base/spec-dpm.tex create mode 100644 tex/context/base/spec-dpx.mkii delete mode 100644 tex/context/base/spec-dpx.tex create mode 100644 tex/context/base/spec-dvi.mkii delete mode 100644 tex/context/base/spec-dvi.tex create mode 100644 tex/context/base/spec-fdf.mkii delete mode 100644 tex/context/base/spec-fdf.tex create mode 100644 tex/context/base/spec-ini.mkii delete mode 100644 tex/context/base/spec-ini.tex create mode 100644 tex/context/base/spec-mis.mkii delete mode 100644 tex/context/base/spec-mis.tex create mode 100644 tex/context/base/spec-pdf.mkii delete mode 100644 tex/context/base/spec-pdf.tex create mode 100644 tex/context/base/spec-ps.mkii delete mode 100644 tex/context/base/spec-ps.tex create mode 100644 tex/context/base/spec-tpd.mkii delete mode 100644 tex/context/base/spec-tpd.tex create mode 100644 tex/context/base/spec-tr.mkii delete mode 100644 tex/context/base/spec-tr.tex create mode 100644 tex/context/base/spec-tst.mkii delete mode 100644 tex/context/base/spec-tst.tex create mode 100644 tex/context/base/spec-var.mkii delete mode 100644 tex/context/base/spec-var.tex create mode 100644 tex/context/base/spec-win.mkii delete mode 100644 tex/context/base/spec-win.tex create mode 100644 tex/context/base/spec-xet.mkii delete mode 100644 tex/context/base/spec-xet.tex create mode 100644 tex/context/base/spec-xtx.mkii delete mode 100644 tex/context/base/spec-xtx.tex create mode 100644 tex/context/base/spec-yy.mkii delete mode 100644 tex/context/base/spec-yy.tex create mode 100644 tex/context/base/strc-lnt.mkii create mode 100644 tex/context/base/strc-lnt.mkiv create mode 100644 tex/context/base/supp-emp.mkii delete mode 100644 tex/context/base/supp-emp.tex create mode 100644 tex/context/base/supp-eps.mkii delete mode 100644 tex/context/base/supp-eps.tex delete mode 100644 tex/context/base/supp-lan.tex create mode 100644 tex/context/base/supp-mis.mkii delete mode 100644 tex/context/base/supp-mis.tex create mode 100644 tex/context/base/supp-mpe.mkii delete mode 100644 tex/context/base/supp-mpe.tex create mode 100644 tex/context/base/supp-mps.mkii delete mode 100644 tex/context/base/supp-mps.tex create mode 100644 tex/context/base/supp-mrk.mkii delete mode 100644 tex/context/base/supp-mrk.tex create mode 100644 tex/context/base/supp-pat.mkii delete mode 100644 tex/context/base/supp-pat.tex create mode 100644 tex/context/base/supp-pdf.mkii delete mode 100644 tex/context/base/supp-pdf.tex create mode 100644 tex/context/base/supp-spe.mkii delete mode 100644 tex/context/base/supp-spe.tex create mode 100644 tex/context/base/supp-tpi.mkii delete mode 100644 tex/context/base/supp-tpi.tex create mode 100644 tex/context/base/symb-ini.mkii create mode 100644 tex/context/base/symb-ini.mkiv delete mode 100644 tex/context/base/symb-ini.tex create mode 100644 tex/context/base/symb-run.mkii create mode 100644 tex/context/base/symb-run.mkiv delete mode 100644 tex/context/base/symb-run.tex create mode 100644 tex/context/base/syst-ext.mkii delete mode 100644 tex/context/base/syst-ext.tex create mode 100644 tex/context/base/syst-gen.mkii delete mode 100644 tex/context/base/syst-gen.tex create mode 100644 tex/context/base/syst-new.mkii delete mode 100644 tex/context/base/syst-new.tex create mode 100644 tex/context/base/syst-tex.mkii delete mode 100644 tex/context/base/syst-tex.tex create mode 100644 tex/context/base/tabl-ltb.mkii create mode 100644 tex/context/base/tabl-ltb.mkiv delete mode 100644 tex/context/base/tabl-ltb.tex create mode 100644 tex/context/base/tabl-nte.mkii create mode 100644 tex/context/base/tabl-nte.mkiv delete mode 100644 tex/context/base/tabl-nte.tex create mode 100644 tex/context/base/tabl-pln.mkii create mode 100644 tex/context/base/tabl-pln.mkiv delete mode 100644 tex/context/base/tabl-pln.tex create mode 100644 tex/context/base/tabl-tab.mkii create mode 100644 tex/context/base/tabl-tab.mkiv delete mode 100644 tex/context/base/tabl-tab.tex create mode 100644 tex/context/base/tabl-tbl.mkii create mode 100644 tex/context/base/tabl-tbl.mkiv delete mode 100644 tex/context/base/tabl-tbl.tex create mode 100644 tex/context/base/tabl-tsp.mkii create mode 100644 tex/context/base/tabl-tsp.mkiv delete mode 100644 tex/context/base/tabl-tsp.tex create mode 100644 tex/context/base/thrd-ran.mkii delete mode 100644 tex/context/base/thrd-ran.tex create mode 100644 tex/context/base/thrd-trg.mkii delete mode 100644 tex/context/base/thrd-trg.tex delete mode 100644 tex/context/base/todo-mkii.tex delete mode 100644 tex/context/base/todo-mkiv.tex delete mode 100644 tex/context/base/type-akb.tex delete mode 100644 tex/context/base/type-dis.tex delete mode 100644 tex/context/base/type-enc.tex delete mode 100644 tex/context/base/type-exa.tex delete mode 100644 tex/context/base/type-map.tex delete mode 100644 tex/context/base/type-old.tex delete mode 100644 tex/context/base/type-omg.tex create mode 100644 tex/context/base/type-one.mkii create mode 100644 tex/context/base/type-one.mkiv create mode 100644 tex/context/base/type-run.mkii create mode 100644 tex/context/base/type-run.mkiv delete mode 100644 tex/context/base/type-run.tex delete mode 100644 tex/context/base/type-spe.tex delete mode 100644 tex/context/base/type-syn.tex create mode 100644 tex/context/base/type-tmf.mkii create mode 100644 tex/context/base/type-tmf.mkiv create mode 100644 tex/context/base/unic-000.mkii delete mode 100644 tex/context/base/unic-000.tex create mode 100644 tex/context/base/unic-001.mkii delete mode 100644 tex/context/base/unic-001.tex create mode 100644 tex/context/base/unic-002.mkii delete mode 100644 tex/context/base/unic-002.tex create mode 100644 tex/context/base/unic-003.mkii delete mode 100644 tex/context/base/unic-003.tex create mode 100644 tex/context/base/unic-004.mkii delete mode 100644 tex/context/base/unic-004.tex create mode 100644 tex/context/base/unic-005.mkii delete mode 100644 tex/context/base/unic-005.tex create mode 100644 tex/context/base/unic-030.mkii delete mode 100644 tex/context/base/unic-030.tex create mode 100644 tex/context/base/unic-031.mkii delete mode 100644 tex/context/base/unic-031.tex create mode 100644 tex/context/base/unic-032.mkii delete mode 100644 tex/context/base/unic-032.tex create mode 100644 tex/context/base/unic-033.mkii delete mode 100644 tex/context/base/unic-033.tex create mode 100644 tex/context/base/unic-034.mkii delete mode 100644 tex/context/base/unic-034.tex create mode 100644 tex/context/base/unic-035.mkii delete mode 100644 tex/context/base/unic-035.tex create mode 100644 tex/context/base/unic-037.mkii delete mode 100644 tex/context/base/unic-037.tex create mode 100644 tex/context/base/unic-039.mkii delete mode 100644 tex/context/base/unic-039.tex create mode 100644 tex/context/base/unic-251.mkii delete mode 100644 tex/context/base/unic-251.tex create mode 100644 tex/context/base/unic-cjk.mkii delete mode 100644 tex/context/base/unic-cjk.tex create mode 100644 tex/context/base/unic-exp.mkii delete mode 100644 tex/context/base/unic-exp.tex create mode 100644 tex/context/base/unic-run.mkii delete mode 100644 tex/context/base/unic-run.tex create mode 100644 tex/context/base/verb-c.mkii delete mode 100644 tex/context/base/verb-c.tex create mode 100644 tex/context/base/verb-eif.mkii delete mode 100644 tex/context/base/verb-eif.tex create mode 100644 tex/context/base/verb-ini.mkii delete mode 100644 tex/context/base/verb-ini.tex create mode 100644 tex/context/base/verb-js.mkii delete mode 100644 tex/context/base/verb-js.tex create mode 100644 tex/context/base/verb-jv.mkii delete mode 100644 tex/context/base/verb-jv.tex create mode 100644 tex/context/base/verb-mp.mkii delete mode 100644 tex/context/base/verb-mp.tex create mode 100644 tex/context/base/verb-pas.mkii delete mode 100644 tex/context/base/verb-pas.tex create mode 100644 tex/context/base/verb-pl.mkii delete mode 100644 tex/context/base/verb-pl.tex create mode 100644 tex/context/base/verb-raw.mkii delete mode 100644 tex/context/base/verb-raw.tex create mode 100644 tex/context/base/verb-sql.mkii delete mode 100644 tex/context/base/verb-sql.tex create mode 100644 tex/context/base/verb-tex.mkii delete mode 100644 tex/context/base/verb-tex.tex create mode 100644 tex/context/base/verb-xml.mkii delete mode 100644 tex/context/base/verb-xml.tex create mode 100644 tex/context/base/xetx-chr.mkii delete mode 100644 tex/context/base/xetx-chr.tex create mode 100644 tex/context/base/xetx-cls.mkii delete mode 100644 tex/context/base/xetx-cls.tex create mode 100644 tex/context/base/xetx-ini.mkii delete mode 100644 tex/context/base/xetx-ini.tex create mode 100644 tex/context/base/xetx-utf.mkii delete mode 100644 tex/context/base/xetx-utf.tex create mode 100644 tex/context/sample/demo-cld.cld diff --git a/context/data/texworks/TUG/texworks.ini b/context/data/texworks/TUG/texworks.ini index a0ff34539..8ef43433e 100644 --- a/context/data/texworks/TUG/texworks.ini +++ b/context/data/texworks/TUG/texworks.ini @@ -12,10 +12,10 @@ previewScale=200 magnifierSize=2 circularMagnifier=true defaultEngine=ConTeXt MkIV -binaryPaths=E:/context/lua, E:/tex/texmf-mswin/bin +binaryPaths= autoHideConsole=false -openDialogDir=E:/context/manuals/mk -recentFileList=D:/texworks/bin/texworks-setup.ini, E:/context/manuals/mk/mk-math.tex, E:/tmp/oeps.tex +openDialogDir= +recentFileList= [engines] size=6 diff --git a/context/data/texworks/texworks-context.rme b/context/data/texworks/texworks-context.rme new file mode 100644 index 000000000..7019cb78e --- /dev/null +++ b/context/data/texworks/texworks-context.rme @@ -0,0 +1,2 @@ +This is just a placeholder. We need to make sure that we end +up here in case of multiple texworks ini files. diff --git a/context/data/texworks/texworks-setup.ini b/context/data/texworks/texworks-setup.ini index 1c638fc1b..6357e775b 100644 --- a/context/data/texworks/texworks-setup.ini +++ b/context/data/texworks/texworks-setup.ini @@ -1,2 +1,2 @@ -inipath=./../../texmf-context/context/data/texworks -libpath=./../../texmf-context/context/data/texworks +inipath=. +libpath=. diff --git a/fonts/map/luatex/context/demo-font.lum b/fonts/map/luatex/context/demo-font.lum new file mode 100644 index 000000000..0beca031b --- /dev/null +++ b/fonts/map/luatex/context/demo-font.lum @@ -0,0 +1,70 @@ +if not modules then modules = { } end modules ['demo-font.lum'] = { + version = 1.001, + comment = "companion to font-map.lua", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +--[[ + + After some testing Taco and I decided that the lack of information + with regards to unicode mapping of alternative shapes can best be + handled by an auxiliary table. So, here is an example. This file + gets its place in TDS in: + + /fonts/map/luatex/context/demo-file.lum + + We recommend that you use a lowercase filename, just to prevent + lookup errors. Font filenames are already such a mess. + + A test file, dedicated to Dohyun Kim is: + + \usemodule[fnt-20] + + \starttext + + \definefontfeature + [otftracker-kozminprovi-regular] + [mode=node,vrt2=yes,script=latn] + + \setvariables + [otftracker] + [font=kozminprovi-regular, + sample=\char"3002] + + \stoptext + + In the resulting pdf file you will then find: + + begincmap + /CIDSystemInfo + << /Registry (TeX) + /Ordering (FNUMTE-KozMinProVI-Regular) + /Supplement 0 + >> def + /CMapName /TeX-Identity-FNUMTE-KozMinProVI-Regular def + /CMapType 2 def + 1 begincodespacerange + <0000> + endcodespacerange + 0 beginbfrange + endbfrange + 2 beginbfchar + <027B> <3002> + <1ED0> <3002> + endbfchar + endcmap + + Of course this assumes that the font used is the same as we + have on our machines. + +]]-- + +return { + version = 1.00, + fontname = "kozminprovi-regular.otf", + tounicode = { + ["Japan1.7888"] = 0x3002, + }, +} diff --git a/metapost/context/base/mp-core.mp b/metapost/context/base/mp-core.mp index 6720fe90d..7c5d5a1c1 100644 --- a/metapost/context/base/mp-core.mp +++ b/metapost/context/base/mp-core.mp @@ -346,7 +346,7 @@ boolean force_multi_par_chain ; force_multi_par_chain := true ; boolean one_piece_multi_par ; one_piece_multi_par := false ; boolean check_multi_par_chain ; check_multi_par_chain := true ; % extra page check -boolean multi_column_first_page_hack; multi_column_first_page_hack := false ; +boolean multi_column_first_page_hack; multi_column_first_page_hack := true ; % seems to work ok def simplify_multi_pars = % boundingbox ipv shape als optie for i := 1 upto nofmultipars : diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 3e0abb1e7..71d2eee56 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -9,6 +9,13 @@ if not modules then modules = { } end modules ['mtx-context'] = { scripts = scripts or { } scripts.context = scripts.context or { } +-- a demo cld file: +-- +-- context.starttext() +-- context.chapter("Hello There") +-- context.readfile("tufte","","not found") +-- context.stoptext() + -- l-file / todo function file.needsupdate(oldfile,newfile) @@ -521,6 +528,10 @@ end -- end -- end +scripts.context.cldsuffixes = table.tohash { + "cld", +} + scripts.context.xmlsuffixes = table.tohash { "xml", } @@ -648,6 +659,7 @@ function scripts.context.run(ctxdata,filename) if a and (a.engine == 'pdftex' or a.engine == 'xetex' or environment.argument("pdftex") or environment.argument("xetex")) then local texexec = resolvers.find_file("texexec.rb") or "" if texexec ~= "" then + os.setenv("RUBYOPT","") local command = string.format("ruby %s %s",texexec,environment.reconstruct_commandline(environment.arguments_after)) os.exec(command) end @@ -672,7 +684,9 @@ function scripts.context.run(ctxdata,filename) else filename = makestub("\\xmlprocess{\\xmldocument}{%s}{}",filename) end - elseif scripts.context.luasuffixes[suffix] then + elseif scripts.context.cldsuffixes[suffix] or environment.argument("forcecld") then + filename = makestub("\\ctxlua{context.runfile('%s')}",filename) + elseif scripts.context.luasuffixes[suffix] or environment.argument("forcelua") then filename = makestub("\\ctxlua{dofile('%s')}",filename) end -- @@ -1333,6 +1347,7 @@ messages.help = [[ --ctx=name use ctx file --version report installed context version --forcexml force xml stub (optional flag: --mkii) +--forcecld force cld (context lua document) stub --autopdf close pdf file in viewer and start pdf viewer afterwards --once only one run --purge(all) purge files (--pattern=...) diff --git a/scripts/context/lua/mtx-convert.lua b/scripts/context/lua/mtx-convert.lua index cf1d640c5..c0c383b17 100644 --- a/scripts/context/lua/mtx-convert.lua +++ b/scripts/context/lua/mtx-convert.lua @@ -6,66 +6,88 @@ if not modules then modules = { } end modules ['mtx-convert'] = { license = "see context related readme files" } -do +-- todo: eps and svg - graphics = graphics or { } - graphics.converters = graphics.converters or { } +graphics = graphics or { } +graphics.converters = graphics.converters or { } - local gsprogram = (os.platform == "windows" and "gswin32c") or "gs" - local gstemplate = "%s -q -sDEVICE=pdfwrite -dEPSCrop -dNOPAUSE -dNOCACHE -dBATCH -dAutoRotatePages=/None -dProcessColorModel=/DeviceCMYK -sOutputFile=%s %s -c quit" +local gsprogram = (os.platform == "windows" and "gswin32c") or "gs" +local gstemplate = "%s -q -sDEVICE=pdfwrite -dEPSCrop -dNOPAUSE -dNOCACHE -dBATCH -dAutoRotatePages=/None -dProcessColorModel=/DeviceCMYK -sOutputFile=%s %s -c quit" - function graphics.converters.eps(oldname,newname) - return gstemplate:format(gsprogram,newname,oldname) - end +function graphics.converters.eps(oldname,newname) + return gstemplate:format(gsprogram,newname,oldname) +end - local improgram = "convert" - local imtemplate = { - low = "%s -quality 0 -compress zip %s pdf:%s", - medium = "%s -quality 75 -compress zip %s pdf:%s", - high = "%s -quality 100 -compress zip %s pdf:%s", - } - - function graphics.converters.jpg(oldname,newname) - local ea = environment.arguments - local quality = (ea.high and 'high') or (ea.medium and 'medium') or (ea.low and 'low') or 'high' - return imtemplate[quality]:format(improgram,oldname,newname) +local improgram = "convert" +local imtemplate = { + low = "%s -quality 0 -compress zip %s pdf:%s", + medium = "%s -quality 75 -compress zip %s pdf:%s", + high = "%s -quality 100 -compress zip %s pdf:%s", +} + +function graphics.converters.jpg(oldname,newname) + local ea = environment.arguments + local quality = (ea.high and 'high') or (ea.medium and 'medium') or (ea.low and 'low') or 'high' + return imtemplate[quality]:format(improgram,oldname,newname) +end + +graphics.converters.tif = graphics.converters.jpg +graphics.converters.tiff = graphics.converters.jpg +graphics.converters.png = graphics.converters.jpg + +local function convert(kind,oldname,newname) + if graphics.converters[kind] then -- extra test + local tmpname = file.replacesuffix(newname,"tmp") + local command = graphics.converters[kind](oldname,tmpname) + logs.simple("command: %s",command) + io.flush() + os.spawn(command) + os.remove(newname) + os.rename(tmpname,newname) + if lfs.attributes(newname,"size") == 0 then + os.remove(newname) + end end +end - graphics.converters.tif = graphics.converters.jpg - graphics.converters.tiff = graphics.converters.jpg - graphics.converters.png = graphics.converters.jpg - - function graphics.converters.convertpath(inputpath,outputpath) - inputpath = inputpath or "." - outputpath = outputpath or "." - for name in lfs.dir(inputpath) do - local suffix = file.extname(name) - if name:find("%.$") then - -- skip . and .. - elseif graphics.converters[suffix] then - local oldname = file.join(inputpath,name) - local newname = file.join(outputpath,file.replacesuffix(name,"pdf")) - local et = lfs.attributes(oldname,"modification") - local pt = lfs.attributes(newname,"modification") - if not pt or et > pt then - dir.mkdirs(outputpath) - local tmpname = file.replacesuffix(newname,"tmp") - local command = graphics.converters[suffix](oldname,tmpname) - logs.simple("command: %s",command) - io.flush() - os.spawn(command) - os.remove(newname) - os.rename(tmpname,newname) - if lfs.attributes(newname,"size") == 0 then - os.remove(newname) - end - end - elseif lfs.isdir(inputpath .. "/".. name) then - graphics.converters.convertpath(inputpath .. "/".. name,outputpath .. "/".. name) +function graphics.converters.convertpath(inputpath,outputpath) + inputpath = inputpath or "." + outputpath = outputpath or "." + for name in lfs.dir(inputpath) do + local suffix = file.extname(name) + if name:find("%.$") then + -- skip . and .. + elseif graphics.converters[suffix] then + local oldname = file.join(inputpath,name) + local newname = file.join(outputpath,file.replacesuffix(name,"pdf")) + local et = lfs.attributes(oldname,"modification") + local pt = lfs.attributes(newname,"modification") + if not pt or et > pt then + dir.mkdirs(outputpath) + convert(suffix,oldname,newname) end + elseif lfs.isdir(inputpath .. "/".. name) then + graphics.converters.convertpath(inputpath .. "/".. name,outputpath .. "/".. name) end end +end +function graphics.converters.convertfile(oldname) + local suffix = file.extname(oldname) + if graphics.converters[suffix] then + local newname = file.replacesuffix(name,"pdf") + if oldname == newname then + -- todo: downsample, crop etc + elseif environment.argument("force") then + convert(suffix,oldname,newname) + else + local et = lfs.attributes(oldname,"modification") + local pt = lfs.attributes(newname,"modification") + if not pt or et > pt then + convert(suffix,oldname,newname) + end + end + end end scripts = scripts or { } @@ -88,6 +110,13 @@ function scripts.convert.convertall() end end +function scripts.convert.convertgiven() + for _, name in ipairs(environment.files) do + graphics.converters.convertfile(name) + end +end + + logs.extendbanner("Graphic Conversion Tools 0.10",true) messages.help = [[ @@ -95,11 +124,14 @@ messages.help = [[ --inputpath=string original graphics path --outputpath=string converted graphics path --watch watch folders +--force force conversion (even if older) --delay time between sweeps ]] if environment.argument("convertall") then scripts.convert.convertall() +elseif environment.files[1] then + scripts.convert.convertgiven() else logs.help(messages.help) end diff --git a/scripts/context/lua/mtx-grep.lua b/scripts/context/lua/mtx-grep.lua index 82a80314a..a6617d711 100644 --- a/scripts/context/lua/mtx-grep.lua +++ b/scripts/context/lua/mtx-grep.lua @@ -44,7 +44,7 @@ function scripts.grep.find(pattern, files, offset) -- skip elseif find(line,pattern) then m = m + 1 - write_nl(format("%s %s: %s",name,n,line)) + write_nl(format("%s %6i: %s",name,n,line)) io.flush() end end @@ -62,7 +62,7 @@ function scripts.grep.find(pattern, files, offset) n = n + 1 if find(line,pattern) then m = m + 1 - write_nl(format("%s %s: %s",name,n,line)) + write_nl(format("%s %6i: %s",name,n,line)) io.flush() end end diff --git a/scripts/context/lua/mtx-texworks.lua b/scripts/context/lua/mtx-texworks.lua new file mode 100644 index 000000000..f525d5336 --- /dev/null +++ b/scripts/context/lua/mtx-texworks.lua @@ -0,0 +1,96 @@ +if not modules then modules = { } end modules ['mtx-texworks'] = { + version = 1.002, + comment = "companion to mtxrun.lua", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +scripts = scripts or { } +scripts.texworks = scripts.texworks or { } + +local texworkspaths = { + "completion", + "configuration", + "dictionaries", + "translations", + "scripts", + "templates", + "TUG" +} + +local texworkssignal = "texworks-context.rme" +local texworkininame = "TeXworks.ini" + +function scripts.texworks.start(indeed) + local is_mswin = os.platform == "windows" + local workname = (is_mswin and "texworks.exe") or "TeXworks" + local fullname = nil + local binpaths = file.split_path(os.getenv("PATH")) or file.split_path(os.getenv("path")) + local datapath = resolvers.find_file(texworkssignal,"other text files") or "" + if datapath ~= "" then + datapath = file.dirname(datapath) -- data + if datapath == "" then + datapath = resolvers.ownpath + end + else + datapath = resolvers.find_file(texworkininame,"other text files") or "" + if datapath == "" then + datapath = resolvers.find_file(string.lower(texworkininame),"other text files") or "" + end + if datapath ~= "" and lfs.isfile(datapath) then + datapath = file.dirname(datapath) -- TUG + datapath = file.dirname(datapath) -- data + if datapath == "" then + datapath = resolvers.ownpath + end + end + end + if datapath == "" then + logs.simple("invalid datapath, maybe you need to regenerate the file database") + return false + end + if not binpaths or #binpaths == 0 then + logs.simple("invalid binpath") + return false + end + for i=1,#binpaths do + local p = file.join(binpaths[i],workname) + if lfs.isfile(p) then + fullname = p + break + end + end + if not fullname then + logs.simple("unable to locate %s",workname) + return false + end + for _, subpath in ipairs(texworkspaths) do + dir.makedirs(file.join(datapath,subpath)) + end + os.setenv("TW_INIPATH",datapath) + os.setenv("TW_LIBPATH",datapath) + if not indeed or environment.argument("verbose") then + logs.simple("data path: %s", datapath) + logs.simple("full name: %s", fullname) + end + if indeed then + os.launch(fullname) + end +end + + +logs.extendbanner("TeXworks startup script 1.0",true) + +messages.help = [[ +--start [--verbose] start texworks +--test report what will happen +]] + +if environment.argument("start") then + scripts.texworks.start(true) +elseif environment.argument("test") then + scripts.texworks.start() +else + logs.help(messages.help) +end diff --git a/scripts/context/lua/mtx-tools.lua b/scripts/context/lua/mtx-tools.lua new file mode 100644 index 000000000..87fd51dc6 --- /dev/null +++ b/scripts/context/lua/mtx-tools.lua @@ -0,0 +1,57 @@ +if not modules then modules = { } end modules ['mtx-tools'] = { + version = 1.002, + comment = "companion to mtxrun.lua", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- data tables by Thomas A. Schmitz + +local find, gsub = string.find, string.gsub + +scripts = scripts or { } +scripts.tools = scripts.tools or { } + +local bomb_1, bomb_2 = "^\254\255", "^\239\187\191" + +function scripts.tools.disarmutfbomb() + local force, done = environment.argument("force"), false + for _, name in ipairs(environment.files) do + if lfs.isfile(name) then + local data = io.loaddata(name) + if not data then + -- just skip + elseif find(data,bomb_1) then + logs.simple("file '%s' has a 2 character utf bomb",name) + if force then + io.savedata(name,(gsub(data,bomb_1,""))) + end + done = true + elseif find(data,bomb_2) then + logs.simple("file '%s' has a 3 character utf bomb",name) + if force then + io.savedata(name,(gsub(data,bomb_2,""))) + end + done = true + else + -- logs.simple("file '%s' has no utf bomb",name) + end + end + end + if done and not force then + logs.simple("use --force to do a real disarming") + end +end + +logs.extendbanner("All Kind Of Tools 1.0",true) + +messages.help = [[ +--disarmutfbomb remove utf bomb if present +]] + +if environment.argument("disarmutfbomb") then + scripts.tools.disarmutfbomb() +else + logs.help(messages.help) +end diff --git a/scripts/context/lua/mtx-update.lua b/scripts/context/lua/mtx-update.lua index 66f6898d3..bc6ca4026 100644 --- a/scripts/context/lua/mtx-update.lua +++ b/scripts/context/lua/mtx-update.lua @@ -102,6 +102,15 @@ scripts.update.engines = { }, } +scripts.update.goodies = { + ["scite"] = { + { "bin//scite/", "texmf-" }, + }, + ["texworks"] = { + { "bin//texworks/", "texmf-" }, + }, +} + scripts.update.platforms = { ["mswin"] = "mswin", ["windows"] = "mswin", @@ -163,7 +172,8 @@ function scripts.update.synchronize() local bin = states.get("rsync.program") -- rsync local url = states.get("rsync.server") -- contextgarden.net local version = states.get("context.version") -- current (or beta) - local extras = states.get("extras") -- extra goodies (like modules) + local extras = states.get("extras") -- extras (like modules) + local goodies = states.get("goodies") -- goodies (like editors) local force = environment.argument("force") bin = string.gsub(bin,"\\","/") @@ -285,6 +295,14 @@ function scripts.update.synchronize() end end + if goodies and type(goodies) == "table" then + for goodie, _ in pairs(goodies) do + for platform, _ in pairs(platforms) do + add_collection(scripts.update.goodies[goodie],platform) + end + end + end + local combined = { } for _, repository in ipairs(scripts.update.repositories) do if repositories[repository] then @@ -374,7 +392,8 @@ function scripts.update.make() local force = environment.argument("force") local texroot = scripts.update.fullpath(states.get("paths.root")) - local engines= states.get('engines') + local engines = states.get('engines') + local goodies = states.get('goodies') local platforms = states.get('platforms') local formats = states.get('formats') @@ -431,6 +450,7 @@ messages.help = [[ --texroot=string installation directory (not guessed for the moment) --engine=string tex engine (luatex, pdftex, xetex) --extras=string extra modules (can be list or 'all') +--goodies=string extra binaries (like scite and texworks) --force instead of a dryrun, do the real thing --update update minimal tree --make also make formats and generate file databases @@ -500,6 +520,9 @@ if scripts.savestate then for r in gmatch(environment.argument("extras") or "","([^, ]+)") do states.set("extras." .. r, true) end + for r in gmatch(environment.argument("goodies") or "","([^, ]+)") do + states.set("goodies." .. r, true) + end logs.report("state","loaded") diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 0c96ed446..d30350ea5 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -10070,6 +10070,12 @@ function runners.execute_ctx_script(filename,arguments) end end +function runners.timedrun(filename) -- just for me + if filename and filename ~= "" then + runners.timed(function() os.execute(filename) end) + end +end + function runners.timed(action) statistics.timed(action) end @@ -10197,6 +10203,9 @@ elseif environment.argument("locate") then elseif environment.argument("platform")then -- locate platform runners.locate_platform() +elseif environment.argument("timedrun") then + -- locate platform + runners.timedrun(filename) elseif environment.argument("help") or filename=='help' or filename == "" then logs.help(messages.help) -- execute script diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 0c96ed446..d30350ea5 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -10070,6 +10070,12 @@ function runners.execute_ctx_script(filename,arguments) end end +function runners.timedrun(filename) -- just for me + if filename and filename ~= "" then + runners.timed(function() os.execute(filename) end) + end +end + function runners.timed(action) statistics.timed(action) end @@ -10197,6 +10203,9 @@ elseif environment.argument("locate") then elseif environment.argument("platform")then -- locate platform runners.locate_platform() +elseif environment.argument("timedrun") then + -- locate platform + runners.timedrun(filename) elseif environment.argument("help") or filename=='help' or filename == "" then logs.help(messages.help) -- execute script diff --git a/scripts/context/stubs/mswin/mtxworks.cmd b/scripts/context/stubs/mswin/mtxworks.cmd new file mode 100644 index 000000000..322d9464d --- /dev/null +++ b/scripts/context/stubs/mswin/mtxworks.cmd @@ -0,0 +1 @@ +mtxrun --script texworks --start diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 0c96ed446..d30350ea5 100755 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -10070,6 +10070,12 @@ function runners.execute_ctx_script(filename,arguments) end end +function runners.timedrun(filename) -- just for me + if filename and filename ~= "" then + runners.timed(function() os.execute(filename) end) + end +end + function runners.timed(action) statistics.timed(action) end @@ -10197,6 +10203,9 @@ elseif environment.argument("locate") then elseif environment.argument("platform")then -- locate platform runners.locate_platform() +elseif environment.argument("timedrun") then + -- locate platform + runners.timedrun(filename) elseif environment.argument("help") or filename=='help' or filename == "" then logs.help(messages.help) -- execute script diff --git a/scripts/context/stubs/unix/mtxworks b/scripts/context/stubs/unix/mtxworks new file mode 100755 index 000000000..ef8f230c3 --- /dev/null +++ b/scripts/context/stubs/unix/mtxworks @@ -0,0 +1,2 @@ +#!/bin/sh +mtxrun --script texworks --start diff --git a/tex/context/base/anch-pgr.mkii b/tex/context/base/anch-pgr.mkii index bc4e0d828..fde8755c2 100644 --- a/tex/context/base/anch-pgr.mkii +++ b/tex/context/base/anch-pgr.mkii @@ -1352,6 +1352,7 @@ \def\do@@ammenuposition#1% {\ifnum\currentamposition>0 \dowithnextbox{\hpos{menu:#1:\realfolio}{\flushnextbox}}\hbox + % \hpos{menu:#1:\realfolio} % also ok if we skip over fi \fi} %D \macros diff --git a/tex/context/base/anch-pgr.mkiv b/tex/context/base/anch-pgr.mkiv index ba566f970..8e719e0d7 100644 --- a/tex/context/base/anch-pgr.mkiv +++ b/tex/context/base/anch-pgr.mkiv @@ -17,6 +17,9 @@ %D the reference point on the page. The next macro does so and %D is hooked into the page building routine. +%D I will speed up this module when I have a proper torture +%D test file. + \unprotect % in the future, the depth of tail will reflect page depth @@ -26,9 +29,9 @@ %D The next macros so some housekeeping. \def\pageanchor{page:0} % for the moment only one pagesize -\def\textanchor{text:\realfolio} -\def\headanchor{head:\realfolio} % virtual position -\def\tailanchor{tail:\realfolio} % virtual position +\def\textanchor{text:\the\realpageno} +\def\headanchor{head:\the\realpageno} % virtual position +\def\tailanchor{tail:\the\realpageno} % virtual position %D Anchors: @@ -201,7 +204,7 @@ \newtoks\everyinsertpositionaction \def\cleanuppositionaction#1% not in trialtypesetting - {\ifcsname\POSactionprefix#1++\endcsname % \ifundefined{\POSactionprefix#1++}\else + {\ifcsname\POSactionprefix#1++\endcsname \the\everycleanpositionaction \iflocalpositioning \letgvalue{\POSactionprefix#1++}\empty @@ -273,10 +276,6 @@ \let\stopMPpositiongraphic\relax -% \def\prepareMPpositionvariables -% {\ifundefined{\@@meta self}\setvalue{\@@meta self}{\currentposition}\fi -% \ifundefined{\@@meta from}\setvalue{\@@meta from}{\currentposition}\fi} - \def\prepareMPpositionvariables {\ifcsname\@@meta self\endcsname\else\setvalue{\@@meta self}{\currentposition}\fi \ifcsname\@@meta from\endcsname\else\setvalue{\@@meta from}{\currentposition}\fi} @@ -292,23 +291,26 @@ % Now we need a adapted action handler: \def\dopositionaction#1% test saves hash entry in etex - {\ifundefined{\POSactionprefix#1::}\else - \ifnum\MPp{#1}>\zerocount % new - \bgroup - \setbox\scratchbox\hbox - \bgroup - \traceposstring\clap\red{<#1>}% - \the\everyinsertpositionaction - \the\everypositionaction - \getvalue{\POSactionprefix#1::}% - \cleanuppositionaction{#1}% - \egroup % smashed is really needed else - \smashedbox\scratchbox % we get problems with too big - \egroup % overlays (s-pre-0x.tex) - \else - % shouldn't happen too often - \traceposstring\clap\cyan{<#1>}% - \fi + {\ifcsname\POSactionprefix#1::\endcsname + \dodopositionaction{#1}% + \fi} + +\def\dodopositionaction#1% + {\ifnum\MPp{#1}>\zerocount % new + \bgroup + \setbox\scratchbox\hbox + \bgroup + \traceposstring\clap\red{<#1>}% + \the\everyinsertpositionaction + \the\everypositionaction + \csname\POSactionprefix#1::\endcsname + \cleanuppositionaction{#1}% + \egroup % smashed is really needed else + \smashedbox\scratchbox % we get problems with too big + \egroup % overlays (s-pre-0x.tex) + \else + % shouldn't happen too often + \traceposstring\clap\cyan{<#1>}% \fi} \def\MPpositiongraphic @@ -607,28 +609,29 @@ \newcounter\localpositionnumber \def\MPanchornumber - {\iflocalpositioning\localpositionnumber\else\realfolio\fi} + {\iflocalpositioning\localpositionnumber\else\the\realpageno\fi} %D So far for the trickery. \newcount\textbackgrounddepth -\appendtoks - \expanded{\savecurrentvalue\noexpand\totalnofparbackgrounds{\number\nofparbackgrounds}}% -\to \everybye - -\appendtoks - \initializeparbackgrounds -\to \everystarttext - -\ifx\totalnofparbackgrounds\undefined \newcounter\totalnofparbackgrounds \fi \ifx\nofparbackgrounds \undefined \newcount \nofparbackgrounds \fi -\def\initializeparbackgrounds - {\ifcase\totalnofparbackgrounds\else - \global\positioningtrue - \global\positioningpartrue - \fi} +% \ifx\totalnofparbackgrounds\undefined \newcounter\totalnofparbackgrounds \fi +% +% \appendtoks +% \expanded{\savecurrentvalue\noexpand\totalnofparbackgrounds{\number\nofparbackgrounds}}% +% \to \everybye +% +% \appendtoks +% \initializeparbackgrounds +% \to \everystarttext +% +% \def\initializeparbackgrounds +% {\ifcase\totalnofparbackgrounds\else +% \global\positioningtrue +% \global\positioningpartrue +% \fi} \unexpanded\def\starttextbackground {\bgroup @@ -680,10 +683,6 @@ \def\currenttextbackground{#1}% \global\advance\nofparbackgrounds\plusone \edef\currentparbackground{pbg:\number\nofparbackgrounds}% -% \bgroup -% \advance\nofparbackgrounds\plusone -% \xdef\nextparbackground{pbg:\number\nofparbackgrounds}% -% \egroup \xdef\nextparbackground{pbg:\number\numexpr\nofparbackgrounds+\plusone\relax}% still xdef ? % todo : \synchonizepositionpage{b:\currentparbackground}{s:\currentparbackground}% \setuptextbackground[#1][#2]% @@ -695,8 +694,7 @@ % todo \backgroundvariable\c!variant \def\dopresettextbackground#1% todo: \backgroundparameter - {\ExpandFirstAfter\processaction % \EFA niet echt nodig - [\textbackgroundparameter\c!location] + {\normalexpanded{\noexpand\processaction[\textbackgroundparameter\c!location]} [ \v!text=>\let\dodostarttextbackground\dostarttextbackgroundtxt \let\dodostoptextbackground \dostoptextbackgroundtxt, \v!paragraph=>\let\dodostarttextbackground\dostarttextbackgroundpar @@ -754,7 +752,7 @@ \dostopattributes} \def\dostarttextbackgroundtxt - {\ifvmode \dontleavehmode \fi % was leavevmode, brrr + {\ifvmode \dontleavehmode \fi \dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty \fpos\currentparbackground\ignorespaces} @@ -762,37 +760,6 @@ {\tpos\currentparbackground \dostopattributes} -% keep this simple one, it's used in prikkels and alike -% -% \def\dostarttextbackgroundpar -% {\endgraf % new -% \getvalue{\??td\currenttextbackground\c!before}% -% \noindent\fpos\currentparbackground\ignorespaces -% \bgroup -% \nobreak \vskip-\lineheight \nobreak -% \doassignsomeskip\getvalue{\??td\currenttextbackground\c!topoffset}\to\scratchskip -% \kern\scratchskip\nobreak -% \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!leftoffset}}% -% \advance\leftskip\leftskipadaption -% \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!rightoffset}}% -% \advance\rightskip\leftskipadaption -% \dostartattributes{\??td\currenttextbackground}\c!style\c!color{}% -% \nowhitespace -% \seteffectivehsize -% \par} -% -% \def\dostoptextbackgroundpar -% {\par -% \dostopattributes -% \doassignsomeskip\getvalue{\??td\currenttextbackground\c!bottomoffset}\to\scratchskip -% \kern\scratchskip\nobreak -% \nobreak \vskip-\lineheight \nobreak -% \nowhitespace -% \egroup -% \nobreak \noindent \strut \hfill \kern\zeropoint \tpos\currentparbackground -% \endgraf % new -% \getvalue{\??td\currenttextbackground\c!after}} - \newskip\textbackgroundskip \def\dostarttextbackgroundpar @@ -868,52 +835,83 @@ \let\textparwidth \!!zeropoint \def\calculatetextpardimensions - {\docalculatetextpardimensions\btbanchor \etbanchor \MPparanchor} + {\docalculatetextpardimensions\btbanchor\etbanchor\MPparanchor} \def\calculatenexttextpardimensions {\docalculatetextpardimensions\nextbtbanchor\nextetbanchor\relax} -\def\docalculatetextpardimensions#1#2#3% todo: dimexpr - {\scratchcounter\MPp#2%\etbanchor - \advance\scratchcounter-\MPp#1%\btanchor - \edef\textparpages{\the\scratchcounter}% - \ifcase\scratchcounter - % one page - \scratchdimen \MPy#1%\btanchor - \advance\scratchdimen-\MPy#2%\etbanchor - \else - % two or more pages - \scratchdimen \MPy#1%\btanchor - \advance\scratchdimen-\MPy#2%\etbanchor - \advance\scratchdimen-\MPy\textanchor - \advance\scratchdimen \MPy\textanchor % - and then + ? - \advance\scratchdimen \MPh\textanchor\relax - \ifcase\scratchcounter>2 \ifnum\scratchcounter<5 - % more pages - \scratchdimen\textheight - \advance\scratchcounter \minusone - \multiply\scratchdimen \scratchcounter - \else - % keep'm small - \scratchdimen5\textheight - \fi \fi - \fi - \edef\textparheight{\the\scratchdimen}% - \ifcase\scratchcounter - % one page - \scratchdimen \MPx#2%\etbanchor - \advance\scratchdimen-\MPx#1%\btanchor - \else - % two or more pages / maybe also hang - \ifx#3\relax - \scratchdimen\makeupwidth % \textwidth - \else - \scratchdimen\MPw\MPparanchor - \advance\scratchdimen-\MPl\MPparanchor - \advance\scratchdimen-\MPr\MPparanchor - \fi - \fi - \edef\textparwidth{\the\scratchdimen}} +% \def\docalculatetextpardimensions#1#2#3% #1=\btbanchor #2=\etbanchor +% {\scratchcounter\numexpr\MPp#2-\MPp#1\relax +% \edef\textparpages{\the\scratchcounter}% +% \ifcase\scratchcounter +% % one page +% \scratchdimen\dimexpr\MPy#1-\MPy#2\relax +% \else +% % two or more pages +% \ifnum\scratchcounter>2 +% \ifnum\scratchcounter<5 +% % more pages +% \scratchdimen\textheight +% \advance\scratchcounter \minusone +% \multiply\scratchdimen \scratchcounter +% \else +% % keep'm small +% \scratchdimen5\textheight +% \fi +% \else +% \scratchdimen\dimexpr\MPy#1-\MPy#2-\MPy\textanchor+\MPy\textanchor+\MPh\textanchor\relax +% \fi +% \fi +% \edef\textparheight{\the\scratchdimen}% +% \ifcase\scratchcounter +% % one page +% \scratchdimen\dimexpr\MPx#2-\MPx#1\relax +% \else +% % two or more pages / maybe also hang +% \ifx#3\relax +% \scratchdimen\makeupwidth % \textwidth +% \else +% \scratchdimen\dimexpr\MPw\MPparanchor-\MPl\MPparanchor-\MPr\MPparanchor\relax +% \fi +% \fi +% \edef\textparwidth{\the\scratchdimen}} + +\def\docalculatetextpardimensions#1#2#3% #1=\btbanchor #2=\etbanchor (adapted 8/6/2009) + {\scratchcounter\numexpr\MPp#2-\MPp#1\relax + \edef\textparpages + {\the\scratchcounter}% + \edef\textparheight + {\the\dimexpr + \ifcase\scratchcounter + % one page + \MPy#1-\MPy#2% + \else + % two or more pages + \ifnum\scratchcounter>2 + \ifnum\scratchcounter<5 + % more pages + \textheight*\numexpr\scratchcounter+\minusone + \else + % keep'm small + 5\textheight + \fi + \else + \MPy#1-\MPy#2-\MPy\textanchor+\MPy\textanchor+\MPh\textanchor + \fi + \fi}% + \edef\textparwidth + {\the\dimexpr + \ifcase\scratchcounter + % one page + \dimexpr\MPx#2-\MPx#1% + \else + % two or more pages / maybe also hang + \ifx#3\relax + \makeupwidth % \textwidth + \else + \MPw\MPparanchor-\MPl\MPparanchor-\MPr\MPparanchor + \fi + \fi}} \def\mintextparheight{4\lineheight} @@ -938,7 +936,7 @@ \def\definetextbackground {\dodoubleempty\dodefinetextbackground} -\def\dodefinetextbackground[#1][#2]% +\def\dodefinetextbackground[#1][#2]% parent and ..parameter {\ifsecondargument % why ? \copyparameters[\??td#1][\??td] [\c!state,\c!location,\c!alternative,\c!mp,\c!method, @@ -1250,7 +1248,7 @@ % new but bugged % \setbox#1\hbox % {\hskip-\MPx{\s!margin:\number\currentmarginpos}% - % \hskip\MPx{head:\realfolio}% + % \hskip\MPx{head:\the\realpageno}% % \box#1}% % so far \setbox#1\hbox @@ -1278,7 +1276,7 @@ \dp#1\zeropoint \ht#1\zeropoint \fi - \graphicvadjust{\box#1}% + \graphicvadjust{\dontleavehmode\box#1}% dontleavehmode is needed to get direction right \egroup} \chardef\marginrepositionmethod\plusone % sidemethod @@ -1308,25 +1306,22 @@ % 0=notfound 1=found 2=currentpage -\def\do@@amposition#1#2#3% +\def\domenuitemposition#1#2#3% {\doifelsevalue{\??am#1\c!position}\v!yes {\doglobal\increment\currentamposition - \doifnumberelse{#2} - {\docheckrealreferencepage{#2}% - \global\chardef\currentamrealpage\ifrealreferencepage2\else1\fi} - {\doifreferencefoundelse{#2} - {\global\chardef\currentamrealpage\ifrealreferencepage2\else1\fi} - {\global\chardef\currentamrealpage0}}% % not found + \doifreferencefoundelse{#2}% 0=not found, 1=same page, >1=elsewhere + {\chardef\currentamrealpage\ifnum\currentreferencerealpage=\realpageno\plusone\else\plustwo\fi}% + {\chardef\currentamrealpage\plustwo}% \expanded {\doglobal\noexpand\appendtoks - #1_menu_button(\currentamposition,\the\currentamrealpage,\MPpos{#1:\currentamposition}) ; + #1_menu_button(\number\currentamposition,\the\currentamrealpage,\MPpos{#1:\currentamposition}) ; \to \MPmenutoks}% \hpos{#1:\currentamposition}{#3}} {#3}} -\def\do@@ammenuposition#1% +\def\dowholemenuposition#1% {\ifnum\currentamposition>0 - \dowithnextbox{\hpos{menu:#1:\realfolio}{\flushnextbox}}\hbox + \dowithnextbox{\hpos{menu:#1:\the\realpageno}{\flushnextbox}}\hbox \fi} %D \macros @@ -1337,6 +1332,7 @@ %D specified with symbolic names, and symbolic references to %D the graphics involved. Each table has its own namespace. +\newconditional\tablehaspositions \newcount\noftabpositions \newtoks \posXCtoks @@ -1346,10 +1342,13 @@ \def\tbPOSprefix {tbp:\number\noftabpositions:} +% \def\tableposindeed +% {\scratchtoks\posXCtoks +% \global\posXCtoks\emptytoks +% \the\scratchtoks} + \def\tablepos - {\scratchtoks\posXCtoks - \global\posXCtoks\emptytoks - \the\scratchtoks} + {\normalexpanded{\global\posXCtoks\emptytoks\the\posXCtoks}} \let\tabulatepos\tablepos @@ -1403,10 +1402,16 @@ \def\dodoXC[#1]% {{\let\NC\relax\processcommalist[#1]\dododoXC}} -\def\doGSC[#1]{\iffirstargument\dodoGSC[#1]\else\expandafter\NC\fi} -\def\doGFC[#1]{\iffirstargument\dodoGFC[#1]\else\expandafter\NC\fi} -\def\doGTC[#1]{\iffirstargument\dodoGTC[#1]\else\expandafter\NC\fi} -\def\doXC [#1]{\iffirstargument\dodoXC [#1]\else\expandafter\fi\NC} +\def\@@checktablepositionstate + {\iftrialtypesetting + \global\settrue\tablehaspositions + \firstargumentfalse + \fi} + +\def\doGSC[#1]{\@@checktablepositionstate\iffirstargument\dodoGSC[#1]\else\expandafter\NC\fi} +\def\doGFC[#1]{\@@checktablepositionstate\iffirstargument\dodoGFC[#1]\else\expandafter\NC\fi} +\def\doGTC[#1]{\@@checktablepositionstate\iffirstargument\dodoGTC[#1]\else\expandafter\NC\fi} +\def\doXC [#1]{\@@checktablepositionstate\iffirstargument\dodoXC [#1]\else\expandafter\fi\NC} \def\tbGSC{\dosingleempty\doGSC} \def\tbGFC{\dosingleempty\doGFC} @@ -1419,15 +1424,30 @@ \let\tabulatepos\tablepos \def\tabulatenormalpos - {\hss\tabulatepos\hss} + {\iftrialtypesetting + % nothing + \else\ifconditional\tablehaspositions + \hss\tabulatepos\hss + \else + % nothing + \fi\fi} \def\tabulateequalpos + {\iftrialtypesetting + \tabulateEQ + \else\ifconditional\tablehaspositions + \tabulateEQpos + \else + \tabulateEQ + \fi\fi} + +\def\tabulateEQpos {\setbox\scratchbox\hbox{\tabulateEQ}% \hbox to \wd\scratchbox{\hss\kern\zeropoint\tabulatepos\hss}% \hskip-\wd\scratchbox \box\scratchbox} -\def\tabulatenormalcolumn#1% overloaded +\def\tabulatenormalcolumn#1% overloaded later in node-bck {&\iftabulateequal\tabulateequalpos\else\tabulatenormalpos\fi &\global\chardef\tabulatetype#1&} @@ -1437,6 +1457,7 @@ \appendtoks \global\advance\noftabpositions\plusone + \global\setfalse\tablehaspositions \to \everytabulate % We need to handle paragraphs as well. @@ -1454,7 +1475,7 @@ \gdef\doflushtabulateepos{\epos{#1}}% \fi} -\def\splitofftabulatebox +\def\splitofftabulatebox % overloaded in node-bck {\dontcomplain \global\setbox\tabulatebox % % % global ? % % % \vsplit\tablebox\tabulatecolumn to \lineheight @@ -1465,11 +1486,12 @@ \ht\tabulatebox\strutht \dp\tabulatebox\strutdp \box\tabulatebox - \doflushtabulateepos} + \iftrialtypesetting\else\ifconditional\tablehaspositions\doflushtabulateepos\fi\fi} \appendtoks \let\dotablebpos\dotabulatebpos \let\dotableepos\dotabulateepos + \glet\doflushtabulateepos\relax \to \everytabulate %D In order to prevent potential clashes with abbreviations, @@ -1517,6 +1539,7 @@ \appendtoks \global\advance\noftabpositions\plusone + \global\setfalse\tablehaspositions \to \everytable %D Since we don't want nameclashes: diff --git a/tex/context/base/anch-pos.lua b/tex/context/base/anch-pos.lua index b6a66870f..b16fac05c 100644 --- a/tex/context/base/anch-pos.lua +++ b/tex/context/base/anch-pos.lua @@ -29,7 +29,7 @@ local dx, dy = "0pt", "0pt" local function initializer() ptbs, pcol = jobpositions.tobesaved, jobpositions.collected - local p = pcol["page:0"] + local p = pcol["page:0"] -- page:1 if p then -- to be checked ! --~ dx, dy = p[2] or "0pt", p[3] or "0pt" diff --git a/tex/context/base/anch-pos.mkiv b/tex/context/base/anch-pos.mkiv index f58f68302..88f492fb8 100644 --- a/tex/context/base/anch-pos.mkiv +++ b/tex/context/base/anch-pos.mkiv @@ -188,11 +188,6 @@ %D positions. \newcount\currentpositions % current number of positions -\newcounter\totalnofpositions % total from previous run - -\appendtoks - \expanded{\savecurrentvalue\noexpand\totalnofpositions{\the\currentpositions}}% -\to \everybye %D The next switch can be used to communicate a special %D situation. Positioning and associated actions can be @@ -216,15 +211,6 @@ \localpositioningfalse \to \everypagebody -% \def\checkpositions -% {\startnointerference -% \protectlabels -% \doutilities{positions}\jobname\empty\relax\relax -% \global\let\checkpositions\relax -% \stopnointerference} - -\let\checkpositions\relax - %D Since the positional values are to be fully expandable, we %D need to preload them as soon as possible, which is why we %D load the data when we start a text. diff --git a/tex/context/base/anch-snc.tex b/tex/context/base/anch-snc.tex index ed090eaf9..cf5b35d69 100644 --- a/tex/context/base/anch-snc.tex +++ b/tex/context/base/anch-snc.tex @@ -143,8 +143,6 @@ \starttext -\setupcolors[state=start] - \definesyncpositions[1] \startuseMPgraphic{sync} diff --git a/tex/context/base/attr-ini.lua b/tex/context/base/attr-ini.lua index a7d09bba1..afd69f1f5 100644 --- a/tex/context/base/attr-ini.lua +++ b/tex/context/base/attr-ini.lua @@ -7,6 +7,7 @@ if not modules then modules = { } end modules ['attr-ini'] = { } -- this module is being reconstructed +-- we can also do the nsnone via a metatable and then also se index 0 local type = type local format, gmatch = string.format, string.gmatch @@ -28,11 +29,6 @@ shipouts = shipouts or { } -- first implementation did that and while it saves a bit for glyphs and rules, it -- costs more resourses for transparencies. So why bother. --- namespace for all those features / plural becomes singular - --- i will do the resource stuff later, when we have an interface to pdf (ok, i can --- fake it with tokens but it will take some coding - -- -- colors -- @@ -63,6 +59,7 @@ colors = colors or { } colors.data = colors.data or { } colors.values = colors.values or { } colors.registered = colors.registered or { } + colors.enabled = true colors.weightgray = true colors.attribute = 0 @@ -174,38 +171,49 @@ function colors.spot(parent,f,d,p) return { 5, .5, .5, .5, .5, 0, 0, 0, .5, parent, f, d, p } end -function colors.reviver(n) - local d = data[n] - if not d then - local v = values[n] - if not v then - local gray = nodeinjections.graycolor(0) +local function graycolor(...) graycolor = nodeinjections.graycolor return graycolor(...) end +local function rgbcolor (...) rgbcolor = nodeinjections.rgbcolor return rgbcolor (...) end +local function cmykcolor(...) cmykcolor = nodeinjections.cmykcolor return cmykcolor(...) end +local function spotcolor(...) spotcolor = nodeinjections.spotcolor return spotcolor(...) end + +local function extender(colors,key) + if key == "none" then + local d = graycolor(0) + colors.none = d + return d + end +end + +local function reviver(data,n) + local v = values[n] + if not v then + local gray = graycolor(0) + d = { gray, gray, gray, gray } + logs.report("attributes","unable to revive color %s",n or "?") + else + local kind, gray, rgb, cmyk = v[1], graycolor(v[2]), rgbcolor(v[3],v[4],v[5]), cmykcolor(v[6],v[7],v[8],v[9]) + if kind == 2 then d = { gray, gray, gray, gray } - logs.report("attributes","unable to revive color %s",n or "?") - else - local kind, gray, rgb, cmyk = v[1], nodeinjections.graycolor(v[2]), nodeinjections.rgbcolor(v[3],v[4],v[5]), nodeinjections.cmykcolor(v[6],v[7],v[8],v[9]) - if kind == 2 then - d = { gray, gray, gray, gray } - elseif kind == 3 then - d = { rgb, gray, rgb, cmyk } - elseif kind == 4 then - d = { cmyk, gray, rgb, cmyk } - elseif kind == 5 then - local spot = nodeinjections.spotcolor(v[10],v[11],v[12],v[13]) - d = { spot, gray, rgb, cmyk } - end + elseif kind == 3 then + d = { rgb, gray, rgb, cmyk } + elseif kind == 4 then + d = { cmyk, gray, rgb, cmyk } + elseif kind == 5 then + local spot = spotcolor(v[10],v[11],v[12],v[13]) + d = { spot, gray, rgb, cmyk } end - data[n] = d end + data[n] = d return d end +setmetatable(colors, { __index = extender }) +setmetatable(colors.data, { __index = reviver }) + function colors.filter(n) return concat(data[n],":",5) end -colors.none = nodeinjections.graycolor(0) - function colors.setmodel(attribute,name,weightgray) colors.model = name colors.selector = numbers[attribute] @@ -221,7 +229,7 @@ function colors.register(attribute, name, colorspace, ...) -- passing 9 vars is color = #values+1 values[color] = colors[colorspace](...) registered[stamp] = color - colors.reviver(color) + -- colors.reviver(color) end if name then list[numbers[attribute]][name] = color -- not grouped, so only global colors @@ -244,9 +252,6 @@ shipouts.handle_color = nodes.install_attribute_handler { -- transparencies --- for the moment we manage transparencies in the pdf driver because --- first we need a nice interface to some pdf things - transparencies = transparencies or { } transparencies.registered = transparencies.registered or { } transparencies.data = transparencies.data or { } @@ -262,43 +267,45 @@ local data = transparencies.data local values = transparencies.values local template = "%s:%s" -local function reference(n) - reference = nodeinjections.transparency - return reference(n) -end +local function inject_transparency (...) inject_transparency = nodeinjections.transparency return inject_transparency (...) end +local function register_transparency(...) register_transparency = registrations.transparency return register_transparency(...) end function transparencies.register(name,a,t) local stamp = format(template,a,t) local n = registered[stamp] if not n then - n = #data+1 - data[n] = reference(n) + n = #values + 1 values[n] = { a, t } registered[stamp] = n - registrations.transparency(n,a,t) + register_transparency(n,a,t) end return registered[stamp] end -function transparencies.reviver(n) - local d = data[n] - if not d then - local v = values[n] - if not v then - d = reference(0) - logs.report("attributes","unable to revive transparency %s",n or "?") - else - d = reference(n) - registrations.transparency(n,v[1],v[2]) - end - data[n] = d +local function extender(transparencies,key) + if key == "none" then + local d = inject_transparency(0) + transparencies.none = d + return d + end +end + +local function reviver(data,n) + local v = values[n] + if not v then + d = inject_transparency(0) + else + d = inject_transparency(n) + register_transparency(n,v[1],v[2]) end + data[n] = d return d end --- check if there is an identity +setmetatable(transparencies, { __index = extender }) +setmetatable(transparencies.data, { __index = reviver }) -transparencies.none = reference(0) -- for the moment the pdf backend does this +-- check if there is an identity function transparencies.value(id) return values[id] @@ -308,8 +315,8 @@ shipouts.handle_transparency = nodes.install_attribute_handler { name = "transparency", namespace = transparencies, initializer = states.initialize, - finalizer = states.finalize , - processor = states.process , + finalizer = states.finalize, + processor = states.process, } --- overprint / knockout @@ -318,21 +325,35 @@ overprints = overprints or { } overprints.data = overprints.data or { } overprints.enabled = false -overprints.data[1] = nodeinjections.overprint() -overprints.data[2] = nodeinjections.knockout() - -overprints.none = overprints.data[2] - overprints.registered = { overprint = 1, knockout = 2, } ---~ storage.register("overprints/registered", overprints.registered, "overprints.registered") ---~ storage.register("overprints/data", overprints.data, "overprints.data") +local data, registered = overprints.data, overprints.registered -local data = overprints.data -local registered = overprints.registered +local function extender(overprints,key) + if key == "none" then + local d = data[2] + overprints.none = d + return d + end +end + +local function reviver(data,n) + if n == 1 then + local d = nodeinjections.overprint() -- called once + data[1] = d + return d + elseif n == 2 then + local d = nodeinjections.knockout() -- called once + data[2] = d + return d + end +end + +setmetatable(overprints, { __index = extender }) +setmetatable(overprints.data, { __index = reviver }) function overprints.register(stamp) return registered[stamp] or registered.overprint @@ -348,22 +369,42 @@ shipouts.handle_overprint = nodes.install_attribute_handler { --- negative / positive -negatives = negatives or { } -negatives.data = negatives.data or { } -negatives.enabled = false - -negatives.data[1] = nodeinjections.positive() -negatives.data[2] = nodeinjections.negative() - -negatives.none = negatives.data[1] +negatives = negatives or { } +negatives.data = negatives.data or { } +negatives.enabled = false negatives.registered = { positive = 1, negative = 2, } +local data, registered = negatives.data, negatives.registered + +local function extender(negatives,key) + if key == "none" then + local d = data[1] + negatives.none = d + return d + end +end + +local function reviver(data,n) + if n == 1 then + local d = nodeinjections.positive() -- called once + data[1] = d + return d + elseif n == 2 then + local d = nodeinjections.negative() -- called once + data[2] = d + return d + end +end + +setmetatable(negatives, { __index = extender }) +setmetatable(negatives.data, { __index = reviver }) + function negatives.register(stamp) - return negatives.registered[stamp] or negatives.registered.positive + return registered[stamp] or registered.positive end shipouts.handle_negative = nodes.install_attribute_handler { @@ -374,36 +415,52 @@ shipouts.handle_negative = nodes.install_attribute_handler { processor = states.process, } --- effects -- can be optimized +-- effects -- can be optimized (todo: metatables) effects = effects or { } effects.data = effects.data or { } +effects.values = effects.values or { } effects.registered = effects.registered or { } effects.enabled = false effects.stamp = "%s:%s:%s" storage.register("effects/registered", effects.registered, "effects.registered") -storage.register("effects/data", effects.data, "effects.data") +storage.register("effects/values", effects.values, "effects.values") -function effects.register(effect,stretch,rulethickness) - local stamp = format(effects.stamp,effect,stretch,rulethickness) - local n = effects.registered[stamp] - if not n then - n = #effects.data+1 - effects.data[n] = effects.reference(effect,stretch,rulethickness) - effects.registered[stamp] = n +local data, registered, values = effects.data, effects.registered, effects.values + +-- valid effects: normal inner outer both hidden (stretch,rulethickness,effect) + +local function effect(...) effect = nodeinjections.effect return effect(...) end + +local function extender(effects,key) + if key == "none" then + local d = effect(0,0,0) + effects.none = d + return d end - return effects.registered[stamp] end --- valid effects: normal inner outer both hidden - -function effects.reference(effect,stretch,rulethickness) - effects.reference = nodeinjections.effect - return nodeinjections.effect(stretch,rulethickness,effect) +local function reviver(data,n) + local e = values[n] -- we could nil values[n] now but hardly needed + local d = effect(v[1],v[2],v[3]) + data[n] = d + return d end -effects.none = effects.reference(0,0,0) +setmetatable(effects, { __index = extender }) +setmetatable(effects.data, { __index = reviver }) + +function effects.register(effect,stretch,rulethickness) + local stamp = format(effects.stamp,effect,stretch,rulethickness) + local n = registered[stamp] + if not n then + n = #values + 1 + values[n] = { effect, stretch, rulethickness } + registered[stamp] = n + end + return n +end shipouts.handle_effect = nodes.install_attribute_handler { name = "effect", @@ -413,61 +470,101 @@ shipouts.handle_effect = nodes.install_attribute_handler { processor = states.process, } --- layers (ugly code, due to no grouping and such) +-- layers (ugly code, due to no grouping and such); currently we use exclusive layers +-- but when we need it stacked layers might show up too; the next function based +-- approach can be replaced by static (metatable driven) resolvers viewerlayers = viewerlayers or { } viewerlayers.data = viewerlayers.data or { } viewerlayers.registered = viewerlayers.registered or { } +viewerlayers.values = viewerlayers.values or { } viewerlayers.enabled = false storage.register("viewerlayers/registered", viewerlayers.registered, "viewerlayers.registered") ---~ storage.register("viewerlayers/data", viewerlayers.data, "viewerlayers.data") +storage.register("viewerlayers/values", viewerlayers.values, "viewerlayers.values") local data = viewerlayers.data +local values = viewerlayers.values local registered = viewerlayers.registered local template = "%s" -local somedone = false -local somedata = { } -local nonedata = nodeinjections.stoplayer() +-- interwoven + +--~ local somedone = false +--~ local somedata = { } +--~ local nonedata = nodeinjections.stoplayer() +--~ +--~ function viewerlayers.none() -- no local +--~ if somedone then +--~ somedone = false +--~ return nonedata +--~ else +--~ return nil +--~ end +--~ end +--~ +--~ local function some(name) +--~ local sd = somedata[name] +--~ if not sd then +--~ sd = { +--~ nodeinjections.switchlayer(name), +--~ nodeinjections.startlayer(name), +--~ } +--~ somedata[name] = sd +--~ end +--~ if somedone then +--~ return sd[1] +--~ else +--~ somedone = true +--~ return sd[2] +--~ end +--~ end +--~ +--~ local function initializer(...) +--~ somedone = false +--~ return states.initialize(...) +--~ end +--~ +--~ viewerlayers.register = function(name) -- if not inimode redefine data[n] in first call +--~ local stamp = format(template,name) +--~ local n = registered[stamp] +--~ if not n then +--~ n = #data + 1 +--~ data[n] = function() return some(name) end -- slow but for the moment we don't store things in the format +--~ registered[stamp] = n +--~ end +--~ return registered[stamp] -- == n +--~ end -function viewerlayers.none() -- no local - if somedone then - somedone = false - return nonedata - else - return nil +-- stacked + +local function extender(viewerlayers,key) + if key == "none" then + local d = nodeinjections.stoplayer() + viewerlayers.none = d + return d end end -local function some(name) - local sd = somedata[name] - if not sd then - sd = { - nodeinjections.switchlayer(name), - nodeinjections.startlayer(name), - } - somedata[name] = sd - end - if somedone then - return sd[1] - else - somedone = true - return sd[2] - end +local function reviver(data,n) + local d = nodeinjections.startlayer(values[n]) + data[n] = d + return d end +setmetatable(viewerlayers, { __index = extender }) +setmetatable(viewerlayers.data, { __index = reviver }) + local function initializer(...) - somedone = false return states.initialize(...) end -viewerlayers.register = function(name) +viewerlayers.register = function(name) -- if not inimode redefine data[n] in first call local stamp = format(template,name) local n = registered[stamp] if not n then - n = #data + 1 - data[n] = function() return some(name) end -- slow but for the moment we don't store things in the format + n = #values + 1 + values[n] = name registered[stamp] = n end return registered[stamp] -- == n @@ -478,5 +575,5 @@ shipouts.handle_viewerlayer = nodes.install_attribute_handler { namespace = viewerlayers, initializer = initializer, finalizer = states.finalize, - processor = states.process, + processor = states.stacked, } diff --git a/tex/context/base/attr-ini.mkiv b/tex/context/base/attr-ini.mkiv index a44a16be6..f653e8c75 100644 --- a/tex/context/base/attr-ini.mkiv +++ b/tex/context/base/attr-ini.mkiv @@ -23,15 +23,17 @@ \definesystemattribute[state] \definesystemattribute[skip] \definesystemattribute[penalty] -\definesystemattribute[colormodel][global] % no reset -\definesystemattribute[color] -\definesystemattribute[transparency] -\definesystemattribute[background] +\definesystemattribute[colormodel][global] % no reset \chardef\colormodelattribute \dogetattributeid{colormodel} +\definesystemattribute[color] \chardef\colorattribute \dogetattributeid{color} +\definesystemattribute[transparency] \chardef\transparencyattribute \dogetattributeid{transparency} +\definesystemattribute[background] \chardef\backgroundattribute \dogetattributeid{background} \definesystemattribute[overprint] \definesystemattribute[negative] \definesystemattribute[effect] -\definesystemattribute[viewerlayer] -\definesystemattribute[reference] +\definesystemattribute[viewerlayer] \chardef\viewerlayerattribute \dogetattributeid{viewerlayer} +\definesystemattribute[reference] \chardef\referenceattribute \dogetattributeid{reference} +\definesystemattribute[destination] \chardef\destinationattribute \dogetattributeid{destination} +\definesystemattribute[graphicvadjust] \chardef\graphicvadjustattribute\dogetattributeid{graphicvadjust} % \definesystemattribute[ignore] % @@ -85,8 +87,7 @@ {\setevalue{(os:#1)}{\dosetattribute{overprint}{\ctxlua{tex.print(overprints.register('#2'))}}}} \def\dotriggeroverprint - {\initializePDFoverprint % temp here, to be tested in la code (states.collect) - \ctxlua{overprints.enabled=true}% + {\ctxlua{overprints.enabled=true}% \gdef\dotriggeroverprint##1{\csname(os:##1)\endcsname}% \dotriggeroverprint} @@ -99,8 +100,7 @@ {\setevalue{(ns:#1)}{\dosetattribute{negative}{\ctxlua{tex.print(negatives.register('#2'))}}}} \def\dotriggernegative - {\initializePDFnegative % temp here, to be tested in la code (states.collect) - \ctxlua{negatives.enabled=true}% + {\ctxlua{negatives.enabled=true}% \gdef\dotriggernegative##1{\csname(ns:##1)\endcsname}% \dotriggernegative} @@ -126,7 +126,7 @@ % \registereffect{both} % \registereffect{hidden} -% viewerlayers +% viewerlayers (will probably change a bit) % \def\registerviewerlayer#1#2% global ! % {\setxvalue{(vl:#1)}{\dosetattribute{viewerlayer}{\ctxlua{tex.print(viewerlayers.register('#2'))}}}} @@ -140,8 +140,6 @@ \setevalue{(vl:)}{\global\doresetattribute{viewerlayer}} -% - \def\dotriggerviewerlayer {\ctxlua{viewerlayers.enabled=true}% \gdef\dotriggerviewerlayer##1{\csname(vl:##1)\endcsname}% diff --git a/tex/context/base/back-ini.lua b/tex/context/base/back-ini.lua index 0a11c2ef7..bad6b0282 100644 --- a/tex/context/base/back-ini.lua +++ b/tex/context/base/back-ini.lua @@ -8,8 +8,12 @@ if not modules then modules = { } end modules ['back-ini'] = { backends = backends or { } +local trace_backend = false + local function nothing() return nil end +backends.nothing = nothing + backends.nodeinjections = { rgbcolor = nothing, cmykcolor = nothing, @@ -24,10 +28,61 @@ backends.nodeinjections = { startlayer = nothing, stoplayer = nothing, switchlayer = nothing, + + reference = nothing, + destination = nothing, + } backends.codeinjections = { - insertmovie = nothing, + + prerollreference = nothing, + + insertmovie = nothing, + insertsound = nothing, + + presetsymbollist = nothing, + registersymbol = nothing, + registeredsymbol = nothing, + + registercomment = nothing, + attachfile = nothing, + adddocumentinfo = nothing, + setupidentity = nothing, + setpagetransition = nothing, + defineviewerlayer = nothing, + addbookmarks = nothing, + addtransparencygroup = nothing, + + typesetfield = nothing, + finishfields = nothing, + doiffieldelse = nothing, + doiffieldgroupelse = nothing, + definefield = nothing, + clonefield = nothing, + definefieldset = nothing, + getfieldgroup = nothing, + setformsmethod = nothing, + getdefaultfieldvalue = nothing, + + setupcanvas = nothing, + + initializepage = nothing, + initializedocument = nothing, + finalizepage = nothing, + finalizedocument = nothing, + + flushpageactions = nothing, + flushdocumentactions = nothing, + + insertrenderingwindow = nothing, + processrendering = nothing, + kindofrendering = nothing, + flushrenderingwindow = nothing, + + setfigurecolorspace = nothing, + setfigurealternative = nothing, + } backends.registrations = { @@ -49,27 +104,40 @@ backends.current = "unknown" function backends.install(what) if type(what) == "string" then - backends.current = what - what = backends[what] - if what then - local wi = what.nodeinjections - if wi then - for k, v in next, wi do - nodeinjections[k] = v - end - end - local wi = what.codeinjections - if wi then - for k, v in next, wi do - codeinjections[k] = v - end + local backend = backends[what] + if backend then + if trace_backend then + logs.report("backend", "initializing backend %s (%s)",what,backend.comment or "no comment") end - local wi = what.registrations - if wi then - for k, v in next, wi do - registrations[k] = v + backends.current = what + for _, category in next, { "nodeinjections", "codeinjections", "registrations"} do + local plugin = backend[category] + if plugin then + local whereto = backends[category] + for name, meaning in next, whereto do + if plugin[name] then + whereto[name] = plugin[name] + -- logs.report("backend", "installing function %s in category %s of %s",name,category,what) + elseif trace_backend then + logs.report("backend", "no function %s in category %s of %s",name,category,what) + end + end + elseif trace_backend then + logs.report("backend", "no category %s in %s",category,what) end end + backends.helpers = backend.helpers + elseif trace_backend then + logs.report("backend", "no backend named %s",what) end end end + +statistics.register("used backend", function() + local bc = backends.current + if bc ~= "unknown" then + return string.format("%s (%s)",bc,backends[bc].comment or "no comment") + else + return nil + end +end) diff --git a/tex/context/base/back-ini.mkiv b/tex/context/base/back-ini.mkiv index a60b6a329..b074d04fe 100644 --- a/tex/context/base/back-ini.mkiv +++ b/tex/context/base/back-ini.mkiv @@ -11,6 +11,9 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +%D Most will go away here as it is replaced by \LUA\ calls to +%D backend functions. + \writestatus{loading}{ConTeXt Backend Macros / Initialization} \registerctxluafile{back-ini}{1.001} @@ -20,6 +23,9 @@ \unprotect +\ifdefined\everybackendshipout \else \newtoks\everybackendshipout \fi +\ifdefined\everylastbackendshipout \else \newtoks\everylastbackendshipout \fi + %D Right from the start \CONTEXT\ had a backend system based on %D runtime pluggable code. As most backend issues involved specials %D and since postprocessors had not that much in common, we ended up @@ -44,122 +50,6 @@ %D Not everything here makes sense and the content of this file will %D definitely change. -%D We use a couple of (global) variables because it saves us the -%D trouble of dealing with arguments. - -\letempty \@@DriverFieldName -\letempty \@@DriverFieldWidth -\letempty \@@DriverFieldHeight -\letempty \@@DriverFieldDefault -\letempty \@@DriverFieldNumber -\letempty \@@DriverFieldNumber -\letempty \@@DriverFieldStyle -\letempty \@@DriverFieldColor -\letempty \@@DriverFieldBackgroundColor -\letempty \@@DriverFieldFrameColor -\letempty \@@DriverFieldLayer -\letempty \@@DriverFieldOption -\letempty \@@DriverFieldAlign -\letempty \@@DriverFieldClickIn -\letempty \@@DriverFieldClickOut -\letempty \@@DriverFieldRegionIn -\letempty \@@DriverFieldRegionOut -\letempty \@@DriverFieldAfterKey -\letempty \@@DriverFieldFormat -\letempty \@@DriverFieldValidate -\letempty \@@DriverFieldCalculate -\letempty \@@DriverFieldFocusIn -\letempty \@@DriverFieldFocusOut - -\letempty \@@DriverCommentLayer -\letempty \@@DriverAttachmentLayer - -\letempty \@@DriverImageBox -\letempty \@@DriverImageOptions -\letempty \@@DriverImageWidth -\letempty \@@DriverImageHeight -\letempty \@@DriverImageFile -\letempty \@@DriverImageLabel -\letempty \@@DriverImageType -\letempty \@@DriverImageMethod -\letempty \@@DriverImagePage - -\newif\ifcollectreferenceactions - -%D \macros -%D {dostartgraymode,dostopgraymode, -%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode} -%D -%D Switching to and from color can be done in two ways: -%D -%D \startitemize[packed,n] -%D \item insert driver specific commands -%D \item pass instructions to the output device -%D \stopitemize -%D -%D The first approach is more general and lays the -%D responsibility at the driver side. Probably due to the fact -%D that \TEX\ does not directly support color, we have been -%D confronted for the last few years with changing special -%D definitions. The need for support depends on how a macro -%D package handles colored text that crosses the page boundary. -%D Again, there are two approaches. -%D -%D \startitemize[packed,n] -%D \item let \TEX\ do the job -%D \item let the driver handle things -%D \stopitemize -%D -%D The first approach is as driver independant as possible and -%D can easily be accomplished by using \TEX's mark mechanism. -%D In \CONTEXT\ we follow this approach. More and more, drivers -%D are starting to support color, including stacking them. -%D -%D Colors as well as grayscales can be represented in scales -%D from~0 to~1. When drivers use values in the range 0..255, -%D this value has to be adapted in the translation process. -%D Technically it's possible to get a grayscale from combining -%D colors. In the \cap{RGB} color system, a color with Red, -%D Green and Blue components of 0.80 show the same gray as a -%D Gray Scale specified 0.80. The \cap{CMYK} color system -%D supports a Black component apart from Cyan, Magenta and -%D Yellow. -%D -%D Depending on the target format, color support differs from -%D gray support. PostScript for example offers different -%D operators for setting gray and color. This is because -%D printing something using three colors is someting else than -%D printing with just black. -%D -%D In \CONTEXT\ we have implemented a color subsystem that -%D supports the use of well defined colors that, when printed -%D in black and white, still can be distinguished. This -%D approach enables us to serve both printed and electronic -%D versions, using colored text and illustrations. More on the -%D fundamentals of this topic can be found in the \cap{MAPS} of -%D the Dutch User Group, 14 (95.1). -%D -%D To satisfy all those needs, we define four specials which -%D supply enough information for drivers to act upon. We -%D could have used more general commands with the keywords -%D 'rgb' and 'gray', but because these specials are used often, -%D we prefer the more direct and shorter alternative. -%D -%D We start with the installation of color and grayscale -%D specials. The values are in the range 0..1 (e.g. 0.25). -%D -%D \starttyping -%D \dostartgraymode {gray} ... \dostopgraymode -%D \dostartrgbcolormode {red} {green} {blue} ... \dostopcolormode -%D \dostartcmykcolormode {cyan} {magenta} {yellow} {black} ... \dostopcolormode -%D \dostartgraycolormode {gray} ... \dostopcolormode -%D \stoptyping -%D -%D Because we can expect conflicts between drivers, we -%D implement them as category \type{or}. In previous versions -%D of \DVIPSONE\ the use of their color||specials did not -%D interfere with the PostScript ones, but recent versions do. - \let \dostartgraymode \gobbleoneargument \let \dostopgraymode \donothing \let \dostartrgbcolormode \gobblethreearguments @@ -167,70 +57,24 @@ \let \dostartgraycolormode \gobbleoneargument \let \dostopcolormode \donothing \let \dostartspotcolormode \gobbletwoarguments -\let \doregisterrgbspotcolor \gobblesevenarguments -\let \doregistercmykspotcolor \gobbleeightarguments -\let \doregistergrayspotcolor \gobblefourarguments -\let \doregisterrgbindexcolor \gobblesevenarguments -\let \doregistercmykindexcolor \gobbleeightarguments -\let \doregistergrayindexcolor \gobblefourarguments \let \doregisterspotcolorname \gobbletwoarguments \let \dostartnonecolormode \donothing \let \doregisternonecolor \donothing -%D \macros -%D {doinsertsoundtrack} -%D -%D Sounds are (for the moment) just files with -%D associated options. -%D -%D \starttyping -%D \doinsertsoundtrack {file} {label} {options} -%D \stoptyping +\let \doinsertsoundtrack \gobblethreearguments -\let \doinsertsoundtrack \gobblethreearguments - -%D \macros -%D {dostartrotation,dostoprotation, -%D dostartscaling,dostopscaling, -%D dostartmirroring,dostopmirroring, -%D dostartnegative,dostopnegative} -%D dostartoverprint,dostopoverprint} -%D -%D We support a couple of transformations and renderings: -%D -%D \starttyping -%D \dostartrotation {angle} ... \dostoprotation -%D \dostartscaling {x} {y} ... \dostopscaling -%D \dostartmirroring {x} {y} ... \dostopmirroring -%D \stoptyping - -\let \dostartrotation \gobbleoneargument -\let \dostoprotation \donothing -\let \dostartscaling \gobbletwoarguments -\let \dostopscaling \donothing -\let \dostartmirroring \donothing -\let \dostopmirroring \donothing - -\let \dostartnegative \donothing -\let \dostopnegative \donothing -\let \dostartoverprint \donothing -\let \dostopoverprint \donothing - -%D The following two specials are used in for instance \type -%D {\vadjust}'d margin material inside colored paragraphs. - -\let \dostartgraphicgroup \donothing -\let \dostopgraphicgroup \donothing - -%D \macros -%D {doselectfirstpaperbin, -%D doselectsecondpaperbin} -%D -%D Here are some very printer||specific ones. No further -%D comment. - -\let \doselectfirstpaperbin \donothing -\let \doselectsecondpaperbin \donothing +\let \dostartrotation \gobbleoneargument +\let \dostoprotation \donothing +\let \dostartscaling \gobbletwoarguments +\let \dostopscaling \donothing +\let \dostartmirroring \donothing +\let \dostopmirroring \donothing +\let \dostartnegative \donothing +\let \dostopnegative \donothing +\let \dostartoverprint \donothing +\let \dostopoverprint \donothing +\let \dostartgraphicgroup \donothing +\let \dostopgraphicgroup \donothing %D \macros %D {doovalbox} @@ -263,300 +107,8 @@ \let \dostartclipping \gobblethreearguments \let \dostopclipping \donothing -%D \macros -%D {dosetupidentity} -%D -%D We can declare some characteristics of the document with -%D -%D \starttyping -%D \dosetupidentity {title} {subject} {author} {creator} {date} {keys} -%D \stoptyping -%D -%D All data is in string format. - -\let \dosetupidentity \gobblesixarguments - -%D \macros -%D {dosetuppaper} -%D -%D This special can be used to tell the driver what page size -%D to use. The special takes three arguments. -%D -%D \starttyping -%D \dosetuppaper {type} {width} {height} -%D \stoptyping -%D -%D The type is one of the common identifiers, like A4, A5 or -%D B2. - -\let \dosetuppaper \gobblethreearguments - -%D \macros -%D {dosetupprinter} -%D -%D Some drivers enable the user to specify the paper type -%D used and/or page dimensions to be taken into account. -%D -%D \starttyping -%D \dosetupprinter {type} {hoffset} {voffset} {width} {height} -%D \stoptyping -%D -%D The first argument is one of \type{letter}, \type{legal}, -%D \type{A4}, \type{A5} etc. The dimensions are in -%D basepoints. - -\let \dosetupprinter \gobblefourarguments - -%D \macros -%D {dosetupopenaction, dosetupclosaction, -%D dosetupopenpageaction, dosetupclospageaction, -%D dosetupinteraction, -%D dosetupscreen, -%D dosetupviewmode} -%D -%D Here come some obscure interactive commands. Probably the -%D specs will change with the development of the macros that -%D use them. -%D -%D The first ones can be used to set up the interaction. -%D -%D \starttyping -%D \dosetupinteraction -%D \stoptyping -%D -%D Normally this command does nothing but giving a message -%D that some scheme is supported. -%D -%D \starttyping -%D \dosetupstartaction -%D \dosetupstopaction -%D \stoptyping -%D -%D These two setup the actions to be executed when the document -%D is opened and closed. -%D -%D The next commands sets up the page and screen. They are -%D kind of related. -%D -%D \starttyping -%D \dosetuppage {hoffset} {voffset} {width} {height} {options} -%D \dosetupscreen {hoffset} {voffset} {width} {height} {options} -%D \stoptyping -%D -%D The first four arguments are in points. Option~1 results in a -%D full screen launch. -%D -%D \starttyping -%D \dosetuppageview {keyword} -%D \stoptyping -%D -%D For the moment we only support \type{fit}. - -\let \dosetupinteraction \donothing -\let \dosetupopenaction \donothing -\let \dosetupscreen \gobblefourarguments -\let \dosetuppageview \gobbleoneargument -\let \dosetupcloseaction \donothing -\let \dosetupopenpageaction \donothing -\let \dosetupclosepageaction \donothing \let \dosetuprenderingopenpageaction \donothing \let \dosetuprenderingclosepageaction \donothing -\let \dosetupcropbox \gobblefourarguments -\let \dosetuptrimbox \gobblefourarguments -\let \dosetupartbox \gobblefourarguments -\let \dosetupbleedbox \gobblefourarguments - -%D \macros -%D {dostarthide, -%D dostophide} -%D -%D Not every part of the screen is suitable for paper. Menus -%D for instance have no meaning on an non||interactive medium. -%D These elements are hidden by means of: -%D -%D \starttyping -%D \dostarthide .. \dostophide -%D \stoptyping - -\let \dostarthide \donothing -\let \dostophide \donothing - -%D \macros -%D {dostartgotolocation, dostopgotolocation, -%D dostartgotorealpage, dostopgotorealpage} -%D -%D When we want to support hypertext buttons, again we have -%D to deal with two concepts. -%D -%D \startitemize[packed,n] -%D \item let \TEX\ highlight the text -%D \item let the driver show us where to click -%D \stopitemize -%D -%D The first approach is the most secure one. It gives us -%D complete control over the visual appearance of hyper -%D buttons. The second alternative lets the driver guess what -%D part of the text needs highlighting. As long as we deal with -%D not too complicated textual buttons, this is no problem. -%D It's even a bit more efficient when we take long mid -%D paragraph active regions into account. When we let \TEX\ -%D handle active sentences {\em for instance marked like this -%D one}, we have to take care of line- and pagebreaks ourselve. -%D However, it's no trivial matter to let a driver find out -%D where things begin and end. Because most hyperlinks can be -%D found in tables of contents and registers, the saving in -%D terms of bytes can be neglected and the first approach is a -%D clear winner. -%D -%D The most convenient way of cross||referencing is using named -%D destinations. A more simple scheme is using page numbers as -%D destinations. Because the latter alternative can often be -%D implemented more efficient, and because we cannot be sure -%D what scheme a driver supports, we always have to supply a -%D pagenumber, even when we use named destinations. -%D -%D To enable a driver to find out what to make active, we have -%D to provide begin and endpoints, so like with color, we use -%D pairs of specials. The first scheme can be satisfied with -%D proper dimensions of the areas to be made active. -%D -%D The interactive real work is done by the following four -%D specials. The reason for providing the first one with both -%D a label and a number, is a result of the quite poor -%D implementation of \type{pdfmarks} in version 1.0 of -%D Acrobat. Because only pagenumbers were supported as -%D destination, we had to provide both labels (\DVIWINDO) and -%D pagenumbers (\PDF). Some drivers use start stop pairs. -%D -%D \starttyping -%D \dostartgotolocation {w} {h} {url} {file} {label} {page} -%D \dostartgotorealpage {w} {h} {url} {file} {page} -%D \stoptyping -%D -%D Their counterparts are: -%D -%D \starttyping -%D \dostopgotolocation -%D \dostopgotorealpage -%D \stoptyping -%D -%D The internal alternative is used for system||generated -%D links, the external one for user||generated links. The -%D Uniform Resource Locator can be used to let the reader -%D surf the net. - -\let \dostartgotolocation \gobblesixarguments -\let \dostopgotolocation \donothing -\let \dostartgotorealpage \gobblefourarguments -\let \dostopgotorealpage \donothing - -%D One may wonder why jumps to page and location are not -%D combined. By splitting them, we enable macro||packages to -%D force the prefered alternative, while on the other hand -%D drivers can pick up the alternative desired most. - -%D \macros -%D {dostartgotoJS, doflushJSpreamble} -%D -%D Rather special is the option to include and execute -%D JavaScript code. This is a typical \PDF\ option. -%D -%D \starttyping -%D \dostartgotoJS {w} {h} {script} -%D \stoptyping -%D -%D This not so standard \TEX\ feature should be used with -%D care. Preamble scripts are flushed by -%D -%D \doflushJSpreamble {script} - -\let \dostartgotoJS \gobblethreearguments -\let \dostopgotoJS \donothing -\let \doflushJSpreamble \gobbleoneargument - -%D \macros -%D {dostartthisislocation, dostopthisislocation, -%D dostartthisisrealpage, dostopthisisrealpage} -%D -%D Before we can goto some location or page, we have to tell -%D the system where it can be found. Because some drivers -%D follow the \SGML\ approach of begin||end tags, we have to -%D support pairs. A possible extension to this scheme is -%D supplying coordinates for viewing the text. -%D -%D The opposite commands of \type{\dogotosomething} have only -%D one argument: -%D -%D \starttyping -%D \dostartthisislocation {label} -%D \dostartthisisrealpage {page} -%D \stoptyping -%D -%D These commands are accompanied by: -%D -%D \starttyping -%D \dostopthisislocation -%D \dostopthisisrealpage -%D \stoptyping -%D -%D As with all interactive commands's they are installed as -%D \type{and} category specials. - -\let \dostartthisislocation \gobbleoneargument -\let \dostopthisislocation \donothing -\let \dostartthisisrealpage \gobbleoneargument -\let \dostopthisisrealpage \donothing - -%D In \CONTEXT\ we don't use the \type{\stopsomething} -%D macros because we let \TEX\ take care of typographic -%D issues. - -%D \macros -%D {doresetgotowhereever} -%D -%D These and others need: - -\let \doresetgotowhereever \donothing - -%D \macros -%D {dostartexecutecommand, dostopexecutecommand} -%D -%D The actual behavior of the next pair of commands depends -%D much on the viewing engine. Therefore one cannot depend -%D too much on their support. -%D -%D \starttyping -%D \dostartexecutecommand {w} {h} {command} {options} -%D \stoptyping -%D -%D At least the next commands are supported (more examples -%D can be found in \type {spec-fdf.tex}: -%D -%D \startlinecorrection\setupalign[middle]\leavevmode -%D \starttable[|l|l|] -%D \HL -%D \NC \bf command \NC \bf action \NC\SR -%D \HL -%D \NC first \NC go to the first page \NC\FR -%D \NC previous \NC go to the previous page \NC\MR -%D \NC next \NC go to the next page \NC\MR -%D \NC last \NC go to the last page \NC\MR -%D \NC backward \NC go back to the link list \NC\MR -%D \NC forward \NC go forward in the link list \NC\MR -%D \NC print \NC enter print mode \NC\MR -%D \NC exit \NC exit viewer \NC\MR -%D \NC close \NC close document \NC\MR -%D \NC enter \NC enter viewer \NC\MR -%D \NC help \NC show help on the viewer \NC\LR -%D \HL -%D \stoptable -%D \stoplinecorrection -%D -%D Options are to be passed as a comma separated list of -%D assignments. - -\let \dostartexecutecommand \gobblefourarguments -\let \dostopexecutecommand \donothing %D \macros %D {dostartobject, @@ -590,229 +142,6 @@ \let \doinsertobject \gobbletwoarguments \let \doresetobjects \donothing -%D \macros -%D {doregisterfigure, doregisterfigurecolor} -%D -%D Images can be objects as well and it's up to the driver to -%D handle this. Alternative images are also up to the driver, -%D and the next macro tells the driver that the previous image -%D is somehow followed by another and that both have to be -%D handled together. This is a rather fuzzy model, but for the -%D moment it suits its purpose: low res screen versions combined -%D with high res printable ones. - -\let \doregisterfigure \gobbletwoarguments -\let \doregisterfigurecolor \gobbleoneargument - -% %D \macros -% %D {dogetobjectreference} -% %D -% %D For very special purposes, one can ask for the internal -% %D reference to the object. Beware! -% -% \let \dogetobjectreference \gobblethreearguments -% -% %D The first argument is the name, the second a macro that -% %D gets the associated value. - -%D \macros -%D {dostartrunprogram, dostoprunprogram, -%D dostartgotoprofile, dostopgotoprofile, -%D dobeginofprofile, -%D doendofprofile} -%D -%D These specials are still experimental. They are not yet -%D supported by the programs the way they should be. -%D -%D {\em --- still undocumented ---} - -\let \dostartrunprogram \gobblefourarguments -\let \dostoprunprogram \donothing -\let \dostartgotoprofile \gobblethreearguments -\let \dostopgotoprofile \donothing -\let \dobeginofprofile \gobblefourarguments -\let \doendofprofile \donothing - -%D \macros -%D {doinsertbookmark} -%D -%D Bookmarks, that is viewer generated tables of contents, are -%D a strange phenomena, mainly because \TEX\ can provide -%D whatever kind of table in much better quality. - -\let \doinsertbookmark \gobblefourarguments - -%D This special is called as: -%D -%D \starttyping -%D \doinstallbookmark {level} {nofsubentries} {text} {page} {open} -%D \stoptyping -%D -%D This definition is very \PDF\ oriented, so for more -%D information we kindly refer to the \PDF\ manuals. - -%D \macros -%D {dosetpagetransition} -%D -%D In presentations, fancy page transitions can, at least for a -%D short moment, let the audience focus at the screen. Like the -%D previous one, this special is very \PDF. -%D -%D \starttyping -%D \dosetpagetransition{dissolve}{0} -%D \stoptyping -%D -%D Transitions have symbolic names, like dissolve, box, split, -%D blinds, wipe and glitter. The second argument determines -%D the wait time (unless zero). - -\let \dosetpagetransition \gobbletwoarguments - -%D \macros -%D {dopresettextfield,dopresetlinefield, -%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, -%D dopresetbuttonfield,dopresetcheckfield, -%D dopresetradiofield,dopresetradiorecord} -%D -%D The special drivers are programmed independant from their -%D calling macros are thereby use the standard \TEX\ way of -%D passing parameters. Unfortunately fields often have more -%D than nine characteristics, so we pack some arguments in one. -%D -%D \starttyping -%D \dopresettextfield / \dopresetlinefield -%D {name} {width} {height} {default} {length} -%D {style,color} {options} {alignment} {actions} -%D -%D \dopresetchoicefield / \dopresetpopupfield / \dopresetcombofield -%D {name} {width} {height} {default} -%D {style,color} {options} {values} {actions} -%D -%D \dopresetpushfield -%D {name} {width} {height} {default} -%D {options} {values} {actions} -%D -%D \dopresetcheckfield -%D {name} {width} {height} {default} -%D {options} {values} {actions} -%D -%D \dopresetradiofield -%D {name} {width} {height} {default} -%D {options} {parent} {values} {actions} -%D -%D \dopresetradiorecord -%D {name} {top} {options} {kids} {actions} -%D \stoptyping - -\let \dopresetlinefield \gobbleninearguments -\let \dopresettextfield \gobbleninearguments -\let \dopresetchoicefield \gobbleeightarguments -\let \dopresetpopupfield \gobbleeightarguments -\let \dopresetcombofield \gobbleeightarguments -\let \dopresetpushfield \gobblesevenarguments -\let \dopresetcheckfield \gobblesevenarguments -\let \dopresetradiofield \gobbleeightarguments -\let \dopresetradiorecord \gobblefourarguments - -%D \macros -%D {dodefinefieldset,dogetfieldset,doiffieldset} -%D -%D Field sets, used in resetting and submitting, are handled -%D by: - -\let \dodefinefieldset \gobbletwoarguments -\let \dogetfieldset \gobbleoneargument -\let \doiffieldset \gobbletwoarguments - -%D \macros -%D {dosetfieldstatus} -%D -%D For practical reasons we set some field characteristics -%D using: -%D -%D \starttyping -%D \dosetfieldstatus {mode} {parent} {kids} {root} -%D \stoptyping - -\let \dosetfieldstatus \gobblefourarguments - -%D with: - -\def\fieldlonermode {0} % no \chardef here -\def\fieldparentmode{1} % no \chardef here -\def\fieldchildmode {2} % no \chardef here -\def\fieldcopymode {3} % no \chardef here - -%D \macros -%D {doregistercalculationset} -%D -%D We can define a calculation order list with: -%D -%D \starttyping -%D \doregistercalculationset {set identifier} -%D \stoptyping - -\let \doregistercalculationset \gobbleoneargument - -%D \macros -%D {doinsertcomment, doflushcomments} -%D -%D Not so much out of need, but to be complete, we also -%D implement text annotations, so called comment: -%D -%D \starttyping -%D \doinsertcomment -%D {title} {width} {height} {color} {open} {symbol} {collect} {data} -%D \stoptyping -%D -%D When enables, comments can be collected and flushed: -%D -%D \starttyping -%D \doflushcomments -%D \stoptyping - -\let \doinsertcomment \gobbleeightarguments -\let \doflushcomments \donothing - -%D \macros -%D {dostarttransparency,dostoptransparency} -%D -%D \starttyping -%D \dostarttransparency{fraction}{type} -%D \dostoptransparency -%D \stoptyping -%D -%D Although in \CONTEXT\ transparency is closely integrated -%D in the color drivers, in the end it is an independent -%D feature. - -\let \dostarttransparency \gobbletwoarguments -\let \dostoptransparency \donothing - -%D \macros -%D {doattachfile} -%D -%D \starttyping -%D \doattachfile{title}{width}{height}{depth}{color}{symbol}{filename}{source} -%D \stoptyping - -\let \doattachfile \gobbleeightarguments - -%D Experimental (properties): - -\let \dostartviewerlayer \gobbleoneargument -\let \dostopviewerlayer \donothing -\let \dodefineviewerlayer \gobblefivearguments -\let \domakeviewerlayerlist \gobbleoneargument - -\let \doinsertrenderingwindow \gobblefourarguments -\let \doinsertrendering \gobblefourarguments -\let \doinsertrenderingobject \gobblefourarguments -\let \doinsertrenderingobject \gobblefourarguments - -\let \dostartfonteffect \gobblethreearguments -\let \dostopfonteffect \donothing - %D From now on, mapfile loading is also a special; we assume the %D more or less standard dvips syntax. @@ -836,24 +165,6 @@ \newif\ifusepagedestinations -%D \macros -%D {ifhighlighthyperlinks} -%D -%D The next switch can be used to make user hyperlinks are -%D not highlighted when clicked on. - -\newif\ifhighlighthyperlinks - -%D \macros -%D {ifgotonewwindow} -%D -%D To make the {\em goto previous jump} feature more -%D convenient when using more than one file, it makes sense -%D to force the viewer to open a new window for each file -%D opened. - -\newif\ifgotonewwindow - %D \macros %D {jobsuffix} %D @@ -862,8 +173,6 @@ %D know what the target file will be. In other driver %D modules we wil set \type {\jobsuffix} to \type {pdf}. -% this will become a mode - \def\jobsuffix{pdf} \ifdefined\resetsystemmode \else @@ -876,21 +185,6 @@ \edef\jobsuffix{#1}% \setsystemmode\jobsuffix} -%D \macros -%D {everyresetspecials} -%D -%D Now what will this one do? We'll see in a few lines. - -\newtoks\everyresetspecials - -\appendtoksonce - \ifdefined\setjobsuffix\setjobsuffix{pdf}\fi -\to \everyresetspecials - -\def\defineoutput{\dodoubleargument\dodefineoutput} - -\def\usespecials [#1]{} -\def\dodefineoutput[#1][#2]{} -\def\setupoutput [#1]{} +\def\setupoutput[#1]{} % will be command line switch \protect \endinput diff --git a/tex/context/base/back-pdf.lua b/tex/context/base/back-pdf.lua index 7f04ced5f..b2e103d36 100644 --- a/tex/context/base/back-pdf.lua +++ b/tex/context/base/back-pdf.lua @@ -14,63 +14,30 @@ than one argument to .

--ldx]]-- local type, next, tostring = type, next, tostring -local char, byte, format, gsub = string.char, string.byte, string.format, string.gsub +local char, byte, format, gsub, rep, gmatch = string.char, string.byte, string.format, string.gsub, string.rep, string.gmatch local concat = table.concat +local round = math.round local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues local texsprint, texwrite = tex.sprint, tex.write ctxcatcodes = tex.ctxcatcodes -pdf = pdf or { } -- global +local copy_node = node.copy -backends.pdf = pdf -- registered - -function pdf.cleandestination(str) - texsprint((gsub(str,"[%/%#%<%>%[%]%(%)%-%s]+","-"))) -end - -function pdf.cleandestination(str) - texsprint((gsub(str,"[%/%#%<%>%[%]%(%)%-%s]+","-"))) -end - -function pdf.sanitizedstring(str) - texsprint((gsub(str,"([\\/#<>%[%]%(%)])","\\%1"))) -end - -function pdf.hexify(str) - texwrite("feff") - for b in utfvalues(str) do - if b < 0x10000 then - texwrite(format("%04x",b)) - else - texwrite(format("%04x%04x",b/1024+0xD800,b%1024+0xDC00)) - end - end -end - -function pdf.utf8to16(s,offset) -- derived from j. sauter's post on the list - offset = (offset and 0x110000) or 0 -- so, only an offset when true - texwrite(char(offset+254,offset+255)) - for c in utfvalues(s) do - if c < 0x10000 then - texwrite(char(offset+c/256,offset+c%256)) - else - c = c - 0x10000 - local c1, c2 = c / 1024 + 0xD800, c % 1024 + 0xDC00 - texwrite(char(offset+c1/256,offset+c1%256,offset+c2/256,offset+c2%256)) - end - end -end - -pdf.nodeinjections = pdf.nodeinjections or { } -- we hash elsewhere -pdf.codeinjections = pdf.codeinjections or { } -- we hash elsewhere -pdf.registrations = pdf.registrations or { } -- we hash elsewhere +local nodeinjections = backends.pdf.nodeinjections +local codeinjections = backends.pdf.codeinjections +local registrations = backends.pdf.registrations local pdfliteral, register = nodes.pdfliteral, nodes.register -local nodeinjections = pdf.nodeinjections -local codeinjections = pdf.codeinjections -local registrations = pdf.registrations +local pdfconstant = lpdf.constant +local pdfdictionary = lpdf.dictionary +local pdfarray = lpdf.array +local pdfreference = lpdf.reference +local pdfverbose = lpdf.verbose + +local pdfreserveobj = pdf.reserveobj +local pdfimmediateobj = pdf.immediateobj function nodeinjections.rgbcolor(r,g,b) return register(pdfliteral(format("%s %s %s rg %s %s %s RG",r,g,b,r,g,b))) @@ -80,7 +47,7 @@ function nodeinjections.cmykcolor(c,m,y,k) return register(pdfliteral(format("%s %s %s %s k %s %s %s %s K",c,m,y,k,c,m,y,k))) end -function nodeinjections.graycolor(s) +function nodeinjections.graycolor(s) -- caching 0/1 does not pay off return register(pdfliteral(format("%s g %s G",s,s))) end @@ -95,21 +62,15 @@ function nodeinjections.transparency(n) return register(pdfliteral(format("/Tr%s gs",n))) end -function nodeinjections.overprint() - return register(pdfliteral("/GSoverprint gs")) -end - -function nodeinjections.knockout() - return register(pdfliteral("/GSknockout gs")) -end - -function nodeinjections.positive() - return register(pdfliteral("/GSpositive gs")) -end +local positive = register(pdfliteral("/GSpositive gs")) +local negative = register(pdfliteral("/GSnegative gs")) +local overprint = register(pdfliteral("/GSoverprint gs")) +local knockout = register(pdfliteral("/GSknockout gs")) -function nodeinjections.negative() - return register(pdfliteral("/GSnegative gs")) -end +function nodeinjections.positive () return copy_node(positive) end +function nodeinjections.negative () return copy_node(negative) end +function nodeinjections.overprint() return copy_node(overprint) end +function nodeinjections.knockout () return copy_node(knockout) end local effects = { normal = 0, @@ -126,60 +87,379 @@ function nodeinjections.effect(stretch,rulethickness,effect) return register(pdfliteral(format("%s Tc %s w %s Tr",stretch,rulethickness,effect))) -- watch order end +-- cached .. + +local cache = { } + function nodeinjections.startlayer(name) - return register(pdfliteral(format("/OC /%s BDC",name))) + local c = cache[name] + if not c then + c = register(pdfliteral(format("/OC /%s BDC",name))) + cache[name] = c + end + return copy_node(c) end +local stop = register(pdfliteral("EMC")) + function nodeinjections.stoplayer() - return register(pdfliteral("EMC")) + return copy_node(stop) end +local cache = { } + function nodeinjections.switchlayer(name) - return register(pdfliteral(format("EMC /OC /%s BDC",name))) + local c = cache[name] + if not c then + c = register(pdfliteral(format("EMC /OC /%s BDC",name))) + end + return copy_node(c) end -- code -function codeinjections.insertmovie(spec) -- width, height, factor, repeat, controls, preview, label, foundname - local width, height, factor = spec.width, spec.height, spec.factor or number.dimenfactors.bp - local options, actions = "", "" - if spec["repeat"] then - actions = actions .. "/Mode /Repeat " +function codeinjections.insertmovie(specification) + -- managed in figure inclusion: width, height, factor, repeat, controls, preview, label, foundname + local width = specification.width + local height = specification.height + local factor = specification.factor or number.dimenfactors.bp + local moviedict = pdfdictionary { + F = specification.foundname, + Aspect = pdfarray { factor * width, factor * height }, + Poster = (specification.preview and true) or false, + } + local controldict = pdfdictionary { + ShowControls = (specification.controls and true) or false, + Mode = (specification["repeat"] and pdfconstant("Repeat")) or nil, + } + local action = pdfdictionary { + Subtype = pdfconstant("Movie"), + Border = pdfarray { 0, 0, 0 }, + T = format("movie %s",specification.label), + Movie = moviedict, + A = controldict, + } + node.write(nodes.pdfannot(width,height,0,action())) +end + +function codeinjections.insertsound(specification) + -- rmanaged in interaction: repeat, label, foundname + local soundclip = interactions.soundclip(specification.label) + if soundclip then + local controldict = pdfdictionary { + Mode = (specification["repeat"] and pdfconstant("Repeat")) or nil + } + local sounddict = pdfdictionary { + F = soundclip.filename + } + local action = pdfdictionary { + Subtype = pdfconstant("Movie"), + Border = pdfarray { 0, 0, 0 }, + T = format("sound %s",specification.label), + Movie = sounddict, + A = controldict, + } + node.write(nodes.pdfannot(0,0,0,action())) end - if spec.controls then - actions = actions .. "/ShowControls true " +end + +-- spot- and indexcolors + +local pdf_separation = pdfconstant("Separation") +local pdf_indexed = pdfconstant("Indexed") +local pdf_device_n = pdfconstant("DeviceN") +local pdf_device_rgb = pdfconstant("DeviceRGB") +local pdf_device_cmyk = pdfconstant("DeviceCMYK") +local pdf_device_gray = pdfconstant("Devicegray") +local pdf_extgstate = pdfconstant("ExtGState") + +local pdf_rbg_range = pdfarray { 0, 1, 0, 1, 0, 1 } +local pdf_cmyk_range = pdfarray { 0, 1, 0, 1, 0, 1, 0, 1 } +local pdf_gray_range = pdfarray { 0, 1 } + +local rgb_function = "dup %s mul exch dup %s mul exch %s mul" +local cmyk_function = "dup %s mul exch dup %s mul exch dup %s mul exch %s mul" +local gray_function = "%s mul" + +local documentcolorspaces = pdfdictionary() + +local spotcolorhash = { } -- not needed +local spotcolornames = { } +local indexcolorhash = { } +local delayedindexcolors = { } + +function registrations.spotcolorname(name,e) + spotcolornames[name] = e or name +end + +local function registersomespotcolor(name,noffractions,names,p,colorspace,range,funct) + noffractions = tonumber(noffractions) or 1 -- to be checked + if noffractions == 0 then + -- can't happen + elseif noffractions == 1 then + local dictionary = pdfdictionary { + FunctionType = 4, + Domain = { 0, 1 }, + Range = range, + } + local n = pdfimmediateobj("stream",format("{ %s }",funct),dictionary()) + local array = pdfarray { + pdf_separation, + pdfconstant(spotcolornames[name] or name), + colorspace, + pdfreference(n), + } + local m = pdfimmediateobj(tostring(array)) + local mr = pdfreference(m) + spotcolorhash[name] = m + documentcolorspaces[name] = mr + lpdf.adddocumentcolorspace(name,mr) else - actions = actions .. "/ShowControls false " - end - if spec.preview then - options = options .. "/Poster true " - end - if actions ~= "" then - actions= "/A <<" .. actions .. ">>" - end - return format( -- todo: doPDFannotation - "\\insertpdfannotation{%ssp}{%ssp}{/Subtype /Movie /Border [0 0 0] /T (movie %s) /Movie << /F (%s) /Aspect [%s %s] %s>> %s}", - width, height, spec.label, spec.foundname, factor * width, factor * height, options, actions - ) -end - -local s_template_g = "\\dodoPDFregistergrayspotcolor{%s}{%s}{%s}{%s}{%s}" -- n f d p s (p can go away) -local s_template_r = "\\dodoPDFregisterrgbspotcolor {%s}{%s}{%s}{%s}{%s}{%s}{%s}" -- n f d p r g b -local s_template_c = "\\dodoPDFregistercmykspotcolor{%s}{%s}{%s}{%s}{%s}{%s}{%s}{%s}" -- n f d p c m y k -local m_template_g = "\\doPDFregistergrayindexcolor{%s}{%s}{%s}{%s}{%s}" -- n f d p s (p can go away) -local m_template_r = "\\doPDFregisterrgbindexcolor {%s}{%s}{%s}{%s}{%s}{%s}{%s}" -- n f d p r g b -local m_template_c = "\\doPDFregistercmykindexcolor{%s}{%s}{%s}{%s}{%s}{%s}{%s}{%s}" -- n f d p c m y k -local s_template_e = "\\doPDFregisterspotcolorname{%s}{%s}" -- name, e -- todo in new backend: gsub(e," ","#20") -local t_template = "\\presetPDFtransparencybynumber{%s}{%s}{%s}" -- n, a, t - -function registrations.grayspotcolor (n,f,d,p,s) states.collect(format(s_template_g,n,f,d,p,s)) end -function registrations.rgbspotcolor (n,f,d,p,r,g,b) states.collect(format(s_template_r,n,f,d,p,r,g,b)) end -function registrations.cmykspotcolor (n,f,d,p,c,m,y,k) states.collect(format(s_template_c,n,f,d,p,c,m,y,k)) end -function registrations.grayindexcolor(n,f,d,p,s) states.collect(format(m_template_g,n,f,d,p,s)) end -function registrations.rgbindexcolor (n,f,d,p,r,g,b) states.collect(format(m_template_r,n,f,d,p,r,g,b)) end -function registrations.cmykindexcolor(n,f,d,p,c,m,y,k) states.collect(format(m_template_c,n,f,d,p,c,m,y,k)) end -function registrations.spotcolorname (name,e) states.collect(format(s_template_e,name,e)) end -- texsprint(ctxcatcodes,format(s_template_e,name,e)) -function registrations.transparency (n,a,t) states.collect(format(t_template ,n,a,t)) end -- too many, but experimental anyway + local cnames = pdfarray() + local domain = pdfarray() + for n in gmatch(names,"[^,]+") do + cnames[#cnames+1] = pdfconstant(spotcolornames[n] or n) + domain[#domain+1] = 0 + domain[#domain+1] = 1 + end + local dictionary = pdfdictionary { + FunctionType = 4, + Domain = domain, + Range = range, + } + local n = pdfimmediateobj("stream",format("{ %s %s }",rep("pop ",noffractions),funct),dictionary()) + local array = pdfarray { + pdf_device_n, + cnames, + colorspace, + pdfreference(n), + } + local m = pdfimmediateobj(tostring(array)) + local mr = pdfreference(m) + spotcolorhash[name] = m + documentcolorspaces[name] = mr + lpdf.adddocumentcolorspace(name,mr) + end +end + +function registersomeindexcolor(name,noffractions,names,p,colorspace,range,funct) + noffractions = tonumber(noffractions) or 1 -- to be checked + local cnames = pdfarray() + local domain = pdfarray() + if names == "" then + names = name .. ",None" + else + names = names .. ",None" + end + for n in gmatch(names,"[^,]+") do + cnames[#cnames+1] = pdfconstant(spotcolornames[n] or n) + domain[#domain+1] = 0 + domain[#domain+1] = 1 + end + local dictionary = pdfdictionary { + FunctionType = 4, + Domain = domain, + Range = range, + } + local n = pdfimmediateobj("stream",format("{ %s %s }",rep("exch pop ",noffractions),funct),dictionary()) -- exch pop + local a = pdfarray { + pdf_device_n, + cnames, + colorspace, + pdfreference(n), + } + if p == "" then + p = "1" + else + p = p .. ",1" + end + local pi = { } + for pp in gmatch(p,"[^,]+") do + pi[#pi+1] = tonumber(pp) + end + local vector, set, n = { }, { }, #pi + for i=255,0,-1 do + for j=1,n do + set[j] = format("%02X",round(pi[j]*i)) + end + vector[#vector+1] = concat(set) + end + vector = pdfverbose { "<", concat(vector, " "), ">" } + local n = pdfimmediateobj(tostring(pdfarray{ pdf_indexed, a, 255, vector })) + lpdf.adddocumentcolorspace(format("%s_indexed",name),pdfreference(n)) + return n +end + +-- actually, names (parent) is the hash + +local function delayindexcolor(name,names,func) + local hash = (names ~= "" and names) or name + -- logs.report("index colors","delaying '%s'",name) + delayedindexcolors[hash] = func +end + +local function indexcolorref(name) -- actually, names (parent) is the hash + if not indexcolorhash[name] then + -- logs.report("index colors","registering '%s'",name) + local delayedindexcolor = delayedindexcolors[name] + if type(delayedindexcolor) == "function" then + indexcolorhash[name] = delayedindexcolor() + delayedindexcolors[name] = true + end + end + return indexcolorhash[name] +end + +function registrations.rgbspotcolor(name,noffractions,names,p,r,g,b) + if noffractions == 1 then + registersomespotcolor(name,noffractions,names,p,pdf_device_rgb,pdf_rbg_range,format(rgb_function,r,g,b)) + else + registersomespotcolor(name,noffractions,names,p,pdf_device_rgb,pdf_rbg_range,format("%s %s %s",r,g,b)) + end + delayindexcolor(name,names,function() + return registersomeindexcolor(name,noffractions,names,p,pdf_device_rgb,pdf_rgb_range,format(rgb_function,r,g,b)) + end) +end + +function registrations.cmykspotcolor(name,noffractions,names,p,c,m,y,k) + if noffractions == 1 then + registersomespotcolor(name,noffractions,names,p,pdf_device_cmyk,pdf_cmyk_range,format(cmyk_function,c,m,y,k)) + else + registersomespotcolor(name,noffractions,names,p,pdf_device_cmyk,pdf_cmyk_range,format("%s %s %s %s",c,m,y,k)) + end + delayindexcolor(name,names,function() + return registersomeindexcolor(name,noffractions,names,p,pdf_device_cmyk,pdf_cmyk_range,format(cmyk_function,c,m,y,k)) + end) +end + +function registrations.grayspotcolor(name,noffractions,names,p,s) + if noffractions == 1 then + registersomespotcolor(name,noffractions,names,p,pdf_device_gray,pdf_gray_range,format(gray_function,s)) + else + registersomespotcolor(name,noffractions,names,p,pdf_device_gray,pdf_gray_range,s) + end + delayindexcolor(name,names,function() + return registersomeindexcolor(name,noffractions,names,p,pdf_device_gray,pdf_gray_range,format(gray_function,s)) + end) +end + +function registrations.rgbindexcolor(name,noffractions,names,p,r,g,b) + registersomeindexcolor(name,noffractions,names,p,pdf_device_rgb,pdf_rgb_range,format(rgb_function,r,g,b)) +end + +function registrations.cmykindexcolor(name,noffractions,names,p,c,m,y,k) + registersomeindexcolor(name,noffractions,names,p,pdf_device_cmyk,pdf_cmyk_range,format(cmyk_function,c,m,y,k)) +end + +function registrations.grayindexcolor(name,noffractions,names,p,s) + registersomeindexcolor(name,noffractions,names,p,pdf_device_gray,pdf_gray_range,gray_function) +end + +function codeinjections.setfigurecolorspace(data,figure) + local color = data.request.color + if color then + local ref = indexcolorref(color) + if ref then + figure.colorspace = ref + data.used.color = color + end + end +end + +-- transparency + +local transparencies = { [0] = + pdfconstant("Normal"), + pdfconstant("Normal"), + pdfconstant("Multiply"), + pdfconstant("Screen"), + pdfconstant("Overlay"), + pdfconstant("SoftLight"), + pdfconstant("HardLight"), + pdfconstant("ColorDodge"), + pdfconstant("ColorBurn"), + pdfconstant("Darken"), + pdfconstant("Lighten"), + pdfconstant("Difference"), + pdfconstant("Exclusion"), + pdfconstant("Compatible"), +} + +local documenttransparencies = { } +local transparencyhash = { } -- not needed + +local done = false + +function registrations.transparency(n,a,t) + if not done then + local d = pdfdictionary { + Type = pdf_extgstate, + ca = 1, + CA = 1, + BM = transparencies[1], + AIS = false, + } + local m = pdfimmediateobj(tostring(d)) + local mr = pdfreference(m) + transparencyhash[0] = m + documenttransparencies[0] = mr + lpdf.adddocumentextgstate("Tr0",mr) + done = true + end + if n > 0 then + local d = pdfdictionary { + Type = pdf_extgstate, + ca = tonumber(t), + CA = tonumber(t), + BM = transparencies[a] or transparencies[0], + AIS = false, + } + local m = pdfimmediateobj(tostring(d)) + local mr = pdfreference(m) + transparencyhash[n] = m + documenttransparencies[n] = mr + lpdf.adddocumentextgstate(format("Tr%s",n),mr) + end +end + +function codeinjections.adddocumentinfo(key,value) + lpdf.addtoinfo(key,lpdf.tosixteen(value)) +end + +-- graphics + +function codeinjections.setfigurealternative(data,figure) + local display = data.request.display + if display and display ~= "" then + local request = data.request + figures.push { + name = request.display, + page = request.page, + size = request.size, + prefix = request.prefix, + cache = request.cache, + width = request.width, + height = request.height, + } + figures.identify() + local displayfigure = figures.check() + if displayfigure then + -- figure.aform = true + img.immediatewrite(figure) + local a = lpdf.array { + lpdf.dictionary { + Image = lpdf.reference(figure.objnum), + DefaultForPrinting = true, + } + } + local d = lpdf.dictionary { + Alternates = lpdf.reference(pdf.immediateobj(tostring(a))), + } + displayfigure.attr = d() + return displayfigure, figures.current() + end + end +end -- eventually we need to load this runtime -- @@ -187,4 +467,7 @@ function registrations.transparency (n,a,t) states.collect(format(t_t -- -- but now we need to force this as we also load the pdf tex part which hooks into all kind of places +codeinjections.finalizepage = lpdf.finalizepage +codeinjections.finalizedocument = lpdf.finalizedocument + backends.install("pdf") diff --git a/tex/context/base/back-pdf.mkiv b/tex/context/base/back-pdf.mkiv index fcfc53091..aaba4554f 100644 --- a/tex/context/base/back-pdf.mkiv +++ b/tex/context/base/back-pdf.mkiv @@ -13,320 +13,14 @@ \writestatus{loading}{ConTeXt Backend Macros / PDF} -\registerctxluafile{back-pdf}{1.001} +\registerctxluafile{back-pdf}{1.001} % this will change \unprotect -%D When dealing with resources, we share the resource dictionaries -%D between all xforms. This is inefficent in the sense that when no -%D resources are used, redundant entries take space, but on the other -%D hand we save redundant dictionaries so it's a nice compromise. Maybe -%D that in \LUATEX\ I will reimplement most of the code here anyway. - -%D Initialization of fields is tricky. If a field has no -%D value, it is kind of not there. If ResetForm is used, the -%D default is assigned, but pushbuttons are spoiled. Adding a -%D \type {/MK} dictionary helps, but gives ugly down -%D appearances (displaced with background). What a mess. -%D Also, in order to get at least something, the \type {/AS} -%D key should be provided. - -%D A couple of variables: - -\newtoks \everybackendshipout -\newtoks \everylastbackendshipout - -\let\lastPDFaction\empty - -\ifdefined\everyPDFximage \else \newtoks\everyPDFximage \fi -\ifdefined\everyPDFxform \else \newtoks\everyPDFxform \fi -\ifdefined\everygoto \else \newtoks\everygoto \fi -\ifdefined\everysetfield \else \newtoks\everysetfield \fi - -%D A few helpers: - -\let\PDFcode \pdfliteral -\def\PDFcontentcode{\pdfliteral} -\def\PDFdirectcode {\pdfliteral direct} - -%D \macros -%D {PDFobjref} -%D -%D Just a shortcut. - -% Watch out, \def\PDFobjref#1{\purenumber#1 0 R} also works, but not when -% #1 == \the\whatever - -\def\PDFobjref#1{\purenumber{#1} 0 R} - -%D \macros -%D {PDFswapdir} - -\let\PDFswapdir\empty \def\PDFswapdir{\ifcase\inlinedirection\or\or-\fi} - -% the pdf spec changed cq. viewers started behaving differently / 5+ - -\chardef\overcomePDFpage\plusone % page numbers/ beware: optimizers remove this one -\chardef\overcomePDFpage\plustwo % page:number -\chardef\overcomePDFpage\plusthree % pdftex page ref feature - -%D \macros -%D {setPDFdestination} -%D -%D \PDF\ destinations should obey the specifications laid down -%D in the \PDF\ reference manual. The next macro strips illegal -%D characters from the destination name. - -\def\setPDFdestination #1{\xdef\PDFdestination{\ctxlua{pdf.cleandestination("\luaescapestring{#1}")}}} -\def\hexifiedPDFstring #1{\ctxlua{pdf.hexify("\luaescapestring{#1}")}} -\def\sanitizePDFencoding#1\to#2{\xdef#2{\ctxlua{pdf.hexify("\luaescapestring{#1}")}}} - -%D - -\def\appendtopdfpageresources #1{\normalexpanded{\global\pdfpageresources{#1\the\pdfpageresources}}} -\def\appendtopdfpageattributes #1{\normalexpanded{\global\pdfpageattr {#1\the\pdfpageattr }}} -\def\appendtopdfpagesattributes#1{\normalexpanded{\global\pdfpagesattr {#1\the\pdfpagesattr }}} -\def\appendtopdfcatalog {\pdfcatalog} -\def\appendtopdfinfo {\pdfinfo} - -\def\resetpdfpageattributes{\global\pdfpageattr\emptytoks} -\def\resetpdfpageresources {\global\pdfpageresources\emptytoks} - -%D Due to the fact that \PDFTEX\ has a different concept of -%D page attributes, we need: - -\appendtoksonce - \resetpdfpageattributes - \resetpdfpageresources -\to \everyaftershipout - -%D \macros -%D {insertpdfaction, -%D insertpdfannotation, -%D insertpdfannotationobject, -%D createpdfdictionaryobject, -%D createpdfarrayobject, -%D defaultobjectreference, -%D doPDFgetobjectreference} -%D -%D This module deals with \PDF\ support, including fill||in -%D forms. Before we present the largely unreadable bunch of -%D macros, we introduce the here||not||defined low level -%D interface macros. These must be provided by the special -%D drivers \type{pdf} (\ACROBAT) and \type{tpd} (\PDFTEX). -%D -%D \starttyping -%D \insertpdfaction #1#2#3 width height action -%D \insertpdfannotation #1#2#3 width height data -%D \createpdfannotationobject #1#2#3#4#5 class name width height data -%D \createpdfdictionaryobject #1#2#3 class name data -%D \createpdfarrayobject #1#2#3 class name data -%D -%D \defaultobjectreference #1#2 class name -%D \doPDFgetobjectreference #1#2#3 class name \PDFobjectreference -%D \doPDFgetobjectpagereference #1#2#3 class name \PDFobjectreference -%D \stoptyping -%D -%D The keywords reflect their use. For the moment we stick to -%D keywords, because that way at we get an indication of what -%D we're doing. - -\def\createpdfdictionaryobject#1#2#3% - {\flushatshipout - {\immediate\pdfobj{<< #3 >>}% - \dosetobjectreference{#1}{#2}{\the\pdflastobj}}} - -\def\createpdfarrayobject#1#2#3% - {\flushatshipout - {\immediate\pdfobj{[ #3 ]}% - \dosetobjectreference{#1}{#2}{\the\pdflastobj}}} - -\def\createpdfannotationobject#1#2#3#4#5% - {\insertpdfannotation{#3}{#4}{#5}% - \dosetobjectreference{#1}{#2}{\the\pdflastannot}} - -\def\createpdfactionobject#1#2#3#4#5% - {\insertpdfaction{#3}{#4}{#5}% - \dosetobjectreference{#1}{#2}{\the\pdflastannot}} - -%D \macros -%D {insertpdfaction,insertpdfannotation,ifsharePDFactions} -%D -%D Next we handle annotations. All link annotations are -%D implemented using the action dictionary. This enables us to -%D use multiple actions. The second macro is for instance -%D used for movie inclusion. - -\newif\ifsharePDFactions \sharePDFactionstrue - -\def\insertpdfaction#1#2#3% - {\xdef\lastPDFcontent{#3}% - \ifcollectreferenceactions - \global\let\lastPDFaction\lastPDFcontent - \else - \ifsharePDFactions - \ifcase\similarreference\relax - \xdef\lastPDFaction{<<\lastPDFcontent>>}% - \or - \immediate\pdfobj{<<\lastPDFcontent>>}% - \xdef\lastPDFaction{\PDFobjref\pdflastobj}% - \else - % leave \lastPDFaction untouched - \fi - \else - \xdef\lastPDFaction{<<\lastPDFcontent>>}% - \fi - \pdfannot - width #1 height #2 depth \zeropoint - {/Subtype /Link - /Border [0 0 0] - \ifhighlighthyperlinks \else /H /N \fi - /A \lastPDFaction}% - \fi} - -\def\insertpdfannotation#1#2#3% - {\pdfannot width #1 height #2 depth \zeropoint{#3}} - -%D \macros -%D {doPDFbookmark} -%D -%D Well, isn't the next one ugly? Thanks to the \PDF\ -%D standard. - -\def\doPDFbookmark#1#2#3#4#5% to be renamed - {\doPDFgetpagereference{#4}\PDFobjectreference - \pdfoutline - user {<>}% - \ifcase#2 \else count \ifcase#5-\fi#2 \fi - {#3}} - -%D For special (\METAPOST) effects, we need to build -%D resource dictionaries. Here is the framework. - -\let\docuPDFextgstates \empty -\let\docuPDFcolorspaces\empty -\let\docuPDFshades \empty - -\def\checkPDFextgstates - {\ifx\docuPDFextgstates\empty \else - \ifnum\realpageno=\lastpage\relax - \createpdfdictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}% - \fi - \doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference - \appendtopdfpageresources{/ExtGState \PDFobjectreference}% - \fi} - -\def\checkPDFcolorspaces - {\ifx\docuPDFcolorspaces\empty \else - \ifnum\realpageno=\lastpage\relax - \createpdfdictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}% - \fi - \doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference - \appendtopdfpageresources{/ColorSpace \PDFobjectreference}% - \fi} - -\def\checkPDFshades - {\ifx\docuPDFshades\empty \else - \ifnum\realpageno=\lastpage\relax - \createpdfdictionaryobject{FDF}{docushades}{\docuPDFshades}% - \fi - \doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference - \appendtopdfpageresources{/Shading \PDFobjectreference}% - \fi} - -\def\appendtoPDFdocumentextgstates #1{\xdef\docuPDFextgstates {\docuPDFextgstates \space#1}} -\def\appendtoPDFdocumentcolorspaces#1{\xdef\docuPDFcolorspaces{\docuPDFcolorspaces\space#1}} -\def\appendtoPDFdocumentshades #1{\xdef\docuPDFshades {\docuPDFshades \space#1}} - -%D Page actions: - -\let\lastpdfopenaction \empty -\let\lastpdfcloseaction\empty - -\def\dosetupopenaction {\appendtopdfcatalog{/OpenAction <<\lastPDFaction>>}} -\def\dosetupcloseaction{\appendtopdfcatalog{/CloseAction <<\lastPDFaction>>}} - -\def\dosetupopenpageaction {\glet\lastpdfopenaction \lastPDFaction} -\def\dosetupclosepageaction{\glet\lastpdfcloseaction\lastPDFaction} - -\def\checkPDFpageactions - {\iflocation % important since direct - \donefalse - \ifx\lastpdfopenaction \empty\!!doneafalse\else\donetrue\!!doneatrue\fi - \ifx\lastpdfcloseaction\empty\!!donebfalse\else\donetrue\!!donebtrue\fi - \ifdone - \appendtopdfpageattributes - {/AA <<\if!!donea/O <<\lastpdfopenaction >> \fi - \if!!doneb/C <<\lastpdfcloseaction>> \fi>>}% - \fi - \glet\lastpdfopenaction \empty - \glet\lastpdfcloseaction\empty - \fi} - -%D \macros -%D {ifPDFstrokecolor} -%D -%D We can reduce the filesize a bit by setting the next switch -%D to false. The amount of reduction depends on the use of -%D color, but don't expect more than a few percent. Zip -%D compression is already rather efficient in itself. - -\newif\ifPDFstrokecolor \PDFstrokecolortrue - -%D When submitting forms, we need to communicate the format. - -\chardef\submitoutputformat=0 % 0=unknown 1=HTML 2=FDF 3=XML - -\def\setsubmitoutputformat#1% - {\doifinsetelse{#1}{FDF,fdf} - {\chardef\submitoutputformat\plustwo} - {\doifinsetelse{#1}{XML,xml} - {\chardef\submitoutputformat\plusthree} - {\chardef\submitoutputformat\plusone}}% - \relax} - -%D Handy to have this available asap: - -\ifdefined\everyPDFxform \newtoks\everyPDFxform \fi -\ifdefined\everyPDFximage \newtoks\everyPDFximage \fi - -% once we can be sure that the latest versions of pdftex are -% available we can use: -% -% \pdfobj reserveobjnum \edef\one{\the\pdflastobj} -% \pdfobj reserveobjnum \edef\two{\the\pdflastobj} -% -% \pdfobj useobjnum \one {x} -% \pdfobj useobjnum \two {x} -% -% we then can rewrite part of spec-fdf because the other drivers -% already support symbolic references - -%D \macros -%D {jobsuffix} -%D -%D Being one of the first typographical systems able to support -%D advances \PDF\ support, \TEX\ is also one of the first -%D systems to produce high quality \PDF\ code directly. Thanks -%D to Han The Thanh c.s. the \TEX\ community can leap forward -%D once again. -%D -%D One important characteristic of \PDFTEX\ is that is can -%D produce standard \DVI\ code as well as \PDF\ code. This -%D enables us to use one format file to support both output -%D formats. - -%D All modules in this group use specials to tell drivers what -%D non||\TEX\ actions to take. Because from the \TEX\ point of -%D view, there is no difference between \DVI\ and \PDF, we -%D therefore only have to bend the \DVI\ driver support into -%D \PDF\ support. Technically spoken, specials no longer serve -%D a purpose, except from ending up as comment in the \PDF\ -%D file. +%D We will minimize the number of calls to \PDF\ specific primitives +%D and delegate all management and injection of code to the backend. %D -%D Before we continue we need to make sure if indeed those -%D \PDFTEX\ primitives are permitted. If no primitives are -%D available, we just stop reading any further. +%D Here we initialize some internal quantities. \pdfoutput = 1 \pdfhorigin = 1 true in @@ -338,2889 +32,141 @@ \pdfminorversion = 5 %pdfuniqueresname = 1 -\def\PDFversion{1.\number\pdfminorversion} - -%D For some internal testing we need to know the output -%D suffix. +%D This one can be consulted by users although the suffix is also +%D a system mode. \setjobsuffix{pdf} -%D \macros -%D {dosetuppaper} -%D -%D If we don't set the paper size, \PDFTEX\ will certainly do -%D it in a way we don't want, therefore we need: - -\def\dosetuppaper#1#2#3% - {\global\pdfpagewidth #2\relax - \global\pdfpageheight#3\relax} - -%D \macros -%D {doloadmapfile,doloadmapline,doresetmapfilelist} - -\def\doresetmapfilelist - {\global\let\doresetmapfilelist\relax - \pdfmapfile{original-empty.map}} - -\def\doloadmapfile #1#2{\pdfmapfile{#1#2}} -\def\doloadmapline #1#2{\pdfmapline{#1#2}} - -%D nasty but needed - -\appendtoksonce \loadallfontmapfiles \to \everyPDFximage -\appendtoksonce \loadallfontmapfiles \to \everyPDFxform - -%D left overs: - - \let\currentmovie\s!unknown - - \def\doPDFinsertmov - {\bgroup - \xdef\currentmovie{\@@DriverImageLabel}% - \PointsToBigPoints\@@DriverImageWidth \width - \PointsToBigPoints\@@DriverImageHeight\height - \let\pdf@@options\empty - \let\pdf@@actions\empty - \donefalse - \expanded{\processallactionsinset[\@@DriverImageOptions]} - [\v!controls=>\donetrue, - \v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }, - \v!preview=>\edef\pdf@@options{\pdf@@options /Poster true }]% - \edef\pdf@@actions{\pdf@@actions /ShowControls \ifdone true\else false\fi}% - \insertpdfannotation\@@DriverImageWidth\@@DriverImageHeight - {/Subtype /Movie - /Border [0 0 0] - /T (movie \currentmovie) - /Movie << /F (\@@DriverImageFile) /Aspect [\width\space\height] \pdf@@options >> - /A << \pdf@@actions >>}% - \egroup} - -%D \macros -%D {doinsertsoundtrack} -%D -%D We use numbers instead of labels to keep track of sounds. - -\let\currentsound\s!unknown - -\def\doinsertsoundtrack#1#2#3% - {\bgroup - \xdef\currentsound{#2}% - \let\pdf@@actions\empty - \@EA\processallactionsinset\@EA - [#3] - [\v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }]% - \collectdriverresource - %\flushatshipout % since it can be buried in a chained box - {\insertpdfannotation{0pt}{0pt} - {/Subtype /Movie - /Border [0 0 0] - /T (sound \currentsound) - /Movie <>% - \ifx\pdf@@actions\empty\else/A << \pdf@@actions >>\fi}}% - \egroup} - -%D \macros -%D {doPDFattachfile} - -\def\doPDFfilestreamobject#1#2#3#4% - {} - -\def\doPDFfilestreamidentifier#1% - {0} - -\def\doPDFgetfilestreamreference#1#2% - {0 0 R} - -\def\doattachfile#1#2#3#4#5#6#7#8% - {\bgroup % title width height color symbol file - \edefconvertedargument\PDFfile{#8}% - % beware: the symbol may (indirectly) use the file - % reference when typesetting the object number; - \presetPDFsymbolappearance{#5}{#6}{#2}{#3}{#4}% sets width/height - \startPDFsymbolappearance - \doPDFembedfile\PDFfile{#7}{#8}% - \doPDFgetembeddedfilereference\PDFfile\PDFobjectreference - \setFDFlayer\@@DriverAttachmentLayer - \insertpdfannotation{\width}{\totalheight} - {/Subtype /FileAttachment - /FS \PDFobjectreference\space - /Contents (#1) - \PDFsymbol - \FDFlayer - \PDFattributes}% - \stopPDFsymbolappearance - \egroup} - -% semi-public - -\def\doPDFembedfile#1#2#3% symbolic name | filename | user name - {\edefconvertedargument\PDFfile{#1}% - \doifnotflagged{a:\PDFfile}% - {\doPDFfilestreamobject{PDFEF}{\PDFfile}{#2}{#3}% - \doglobal\setflag{a:\PDFfile}}} - -\def\doPDFgetembeddedfilereference#1#2% - {\edefconvertedargument\PDFfile{#1}% - \doPDFgetobjectreference{PDFEF}\PDFfile#2} - -\def\doPDFgetembeddedfilestreamreference#1#2% - {\edefconvertedargument\PDFfile{#1}% - \doPDFgetfilestreamreference\PDFfile#2} % == \doPDFgetobjectreference{PDFFS}\PDFfile#2 - -% requested by Jens-Uwe Morawski: permits usage of pdftosrc -% in viewers that don't support attachments: -% -% \definesymbol -% [ObjectNumber] -% % [object number {\PDFattachmentnumber[xx]}] % named -% [object number \PDFattachmentnumber] % current -% -% \useattachment[test][xx][test.tex] -% \setupattachments[symbol=ObjectNumber] -% \attachment[test] - -\def\PDFattachmentnumber - {\dosingleargument\doPDFattachmentnumber} +%D For the moment we keep these. -\def\doPDFattachmentnumber[#1]% - {\iffirstargument - \doPDFfilestreamidentifier{#1}% - \else - \doPDFfilestreamidentifier\PDFfile - \fi} +\newtoks \pdfbackendeveryximage +\newtoks \pdfbackendeveryxform -%D \macros -%D {...} -%D -%D Rather preliminary. We have to wait till the complete specs -%D show up. As usual, we cannot really check it (Acrobat 6.0 -%D has a bug that inhibits us to make a test file). Half a day -%D of testing made clear that trying to control the plugin fails -%D in most cases (we need plugin specs -). We also miss a feature -%D to let acrobat wait with proceeding (action processing) till -%D the media clip is ready. - -% aiff audio/aiff -% au audio/basic -% avi video/avi -% mid audio/midi -% mov video/quicktime -% mp3 audio/x-mp3 (mpeg) -% mp4 audio/mp4 -% mp4 video/mp4 -% mpeg video/mpeg -% smil application/smil -% swf application/x-shockwave-flash - -% beware, this is preliminary code, should be improved - -\def\PDFrenderingspecs#1{\executeifdefined{PDFMR:#1}\empty} - -\def\PDFexecutestartrendering {/Rendition /OP 0 \PDFrenderingspecs\argumentA} -\def\PDFexecutestoprendering {/Rendition /OP 1 \PDFrenderingspecs\argumentA} -\def\PDFexecutepauserendering {/Rendition /OP 2 \PDFrenderingspecs\argumentA} -\def\PDFexecuteresumerendering {/Rendition /OP 3 \PDFrenderingspecs\argumentA} - -% todo : sub files -% -% \doPDFembedfile{pier-39.png}{pier-39.png}{pier-39.png}% -% \doPDFgetembeddedfilestreamreference{pier-39.png}\xPDFobjectreference -% \edef\xxxx{/RF [(pier-39.png) \xPDFobjectreference]}% - -% todo: alternative renderings -% -% object_1 -> <> >> -% object_2 -> <> >> -% rendering -> <> +%D These are the only official methods to add stuff to the resources. -\def\doinsertrendering#1#2#3#4% tag mime file options - {\ifundefined{PDFMR:#1}% - \doifinstringelse{://}{#3}\donetrue\donefalse % evt url as keyword - \createpdfdictionaryobject{PDFMF}{#1} - {/Type /Rendition - /S /MR - % does not work: /SP << /Type /MediaScreenParam /BE << /B [1 0 0] /O 0.5 >> >> - /C << /Type /MediaClip - /S /MCD - /N (#1) - /Alt [() (file not found)] % language id + message - /D << /Type /Filespec - /F (#3) - \ifdone/FS /URL\fi >> - /CT (#2) >>}% - % common code - \doifobjectreferencefoundelse{PDFMS}{#1} - {\doPDFgetobjectreference{PDFMS}{#1}\PDFobjectreferenceB} - {\doPDFgetobjectreference{PDFMU}{#1}\PDFobjectreferenceB}% - \doPDFgetobjectreference{PDFMF}{#1}\PDFobjectreferenceA - \setxvalue{PDFMR:#1}% needed /AA actions in /Screen - {/R \PDFobjectreferenceA - /AN \PDFobjectreferenceB}% - \doifobjectreferencefoundelse{PDFMS}{#1}\donothing - {\dodoinsertrenderingwindow{PDFMU}{#1}\zeropoint\zeropoint{#4}}% - \fi} +\def\pdfbackendsetcatalog #1#2{\ctxlua{lpdf.addtocatalog ("#1",\!!bs#2\!!es)}} \newtoks\pdfcatalog +\def\pdfbackendsetinfo #1#2{\ctxlua{lpdf.addtoinfo ("#1",\!!bs#2\!!es)}} \newtoks\pdfinfo +\def\pdfbackendsetname #1#2{\ctxlua{lpdf.addtonames ("#1",\!!bs#2\!!es)}} \newtoks\pdfnames -\def\doinsertrenderingobject#1#2#3#4% tag class objectname options - {\ifundefined{PDFMR:#1}% - \doPDFgetobjectreference{#2}{#3}\PDFobjectreference - \createpdfdictionaryobject{PDFMF}{#1} - {/Type /Rendition - /S /MR - /C << /Type /MediaClip - /S /MCD - /N (#1) - /D \PDFobjectreference>>}% - % common code - \doifobjectreferencefoundelse{PDFMS}{#1} - {\doPDFgetobjectreference{PDFMS}{#1}\PDFobjectreferenceB} - {\doPDFgetobjectreference{PDFMU}{#1}\PDFobjectreferenceB}% - \doPDFgetobjectreference{PDFMF}{#1}\PDFobjectreferenceA - \setxvalue{PDFMR:#1}% needed /AA actions in /Screen - {/R \PDFobjectreferenceA - /AN \PDFobjectreferenceB}% - \doifobjectreferencefoundelse{PDFMS}{#1}\donothing - {\dodoinsertrenderingwindow{PDFMU}{#1}\zeropoint\zeropoint{#4}}% - \fi} +\def\pdfbackendsetpageattribute #1#2{\ctxlua{lpdf.addtopageattributes ("#1",\!!bs#2\!!es)}} \newtoks\pdfpageresources +\def\pdfbackendsetpagesattribute#1#2{\ctxlua{lpdf.addtopagesattributes("#1",\!!bs#2\!!es)}} \newtoks\pdfpageattr +\def\pdfbackendsetpageresource #1#2{\ctxlua{lpdf.addtopageresources ("#1",\!!bs#2\!!es)}} \newtoks\pdfpagesattr -\def\doinsertrenderingwindow - {\dodoinsertrenderingwindow{PDFMS}} +\def\pdfbackendsetextgstate #1#2{\ctxlua{lpdf.adddocumentextgstate ("#1",lpdf.verbose(\!!bs#2\!!es))}} +\def\pdfbackendsetcolorspace #1#2{\ctxlua{lpdf.adddocumentcolorspace("#1",lpdf.verbose(\!!bs#2\!!es))}} +\def\pdfbackendsetpattern #1#2{\ctxlua{lpdf.adddocumentpattern ("#1",lpdf.verbose(\!!bs#2\!!es))}} +\def\pdfbackendsetshade #1#2{\ctxlua{lpdf.adddocumentshade ("#1",lpdf.verbose(\!!bs#2\!!es))}} -\def\dodoinsertrenderingwindow#1#2#3#4#5% - {\vbox to #4 \bgroup - \checkPDFscreenactions{#2}{#5}% - \doPDFgetobjectpagereference{PDFMF}{#2}\PDFobjectreferenceA - \doPDFgetobjectreference {PDFMF}{#2}\PDFobjectreferenceB - \vss - \hbox to #3 \bgroup - \createpdfannotationobject{#1}{#2}{#3}{#4} - {/Subtype /Screen - /P \PDFobjectreferenceA - /A \PDFobjectreferenceB - \PDFattributes - /Border [0 0 0]}% - \hss - \egroup - \egroup} - -\global\let\PDFrenderingopenpageaction \empty -\global\let\PDFrenderingclosepageaction\empty - -\def\checkPDFscreenactions#1#2% - {\let\PDFattributes\empty - \iflocation % important since direct -) - % the action can either (already) be set by the window handler - % or (normally when no window [i.e a zero dimensions one] is present) by keyword - \doifinset\v!auto{#2} - {% brrr, here instead of in navigation module, must move and become special - % now two sided dependency - \let\checkrendering\gobbleoneargument - \ifx\PDFrenderingopenpageaction \empty - \handlereferenceactions{\v!StartRendering{#1}}\dosetuprenderingopenpageaction - \fi - \ifx\PDFrenderingclosepageaction\empty - \handlereferenceactions{\v!StopRendering {#1}}\dosetuprenderingclosepageaction - \fi - }% - \donefalse - \ifx\PDFrenderingopenpageaction \empty\!!doneafalse\else\donetrue\!!doneatrue\fi - \ifx\PDFrenderingclosepageaction\empty\!!donebfalse\else\donetrue\!!donebtrue\fi - \ifdone - \edef\PDFattributes - {/AA <<\if!!donea/PO <<\PDFrenderingopenpageaction >> \fi - \if!!doneb/PC <<\PDFrenderingclosepageaction>> \fi>>}% - \fi - \global\let\PDFrenderingopenpageaction \empty - \global\let\PDFrenderingclosepageaction\empty - \fi} - -\def\dosetuprenderingopenpageaction {\global\let\PDFrenderingopenpageaction \lastPDFaction} -\def\dosetuprenderingclosepageaction{\global\let\PDFrenderingclosepageaction\lastPDFaction} +\def\pdfbackendcurrentresources {\ctxlua{lpdf.collectedresources()}} -%D For the moment we don't test for alternatives that -%D themselves have alternatives, especially cylcic -%D dependencies. +%D An example of usage is: -% \def\pdfimmediateximage{\immediate\pdfximage} -% -% \def\checkpdfimageattributes -% {\ifx\PDFfigurereference\empty -% \global\let\pdfimageattributes\empty -% \else -% \immediate\pdfobj -% {[ << /Image \PDFobjref\PDFfigurereference -% /DefaultForPrinting true >> ]}% -% \xdef\pdfimageattributes -% {attr {/Alternates \PDFobjref\pdflastobj}}% -% \fi} -% -% \global\let\PDFimagecolorreference\empty -% -% \def\checkpdfimagecolorspecs -% {\ifx\pdflastximagecolordepth \undefined -% \global\let\pdfimagecolorspecs\empty -% \else\ifx\PDFimagecolorreference\empty -% \global\let\pdfimagecolorspecs\empty -% \else -% \xdef\pdfimagecolorspecs{colorspace \PDFimagecolorreference\space}% -% \fi\fi -% \global\let\PDFimagecolorreference\empty} +\appendtoks % will change ... + \pdfbackendsetinfo{ConTeXt.Version}{(\contextversion)}% + \pdfbackendsetinfo{ConTeXt.Time} {(\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}% + \pdfbackendsetinfo{ConTeXt.Jobname}{(\jobname)}% + \pdfbackendsetinfo{ConTeXt.Url} {(www.pragma-ade.com)}% +\to \everylastbackendshipout -%D \macros -%D {doregisterfigure} -%D -%D Here is the fuzzy, very special dependant figure -%D registration special. We need to refer to the innermost -%D object (ximage). +%D Unfortunately this is still needed (also for \METAPOST\ to +%D \PDF\ converter): - \def\doregisterfigure#1#2% - {\doifundefined{IM::#1::#2} - {\setxvalue{IM::#1::#2}{\the\pdflastximage}}% - \xdef\PDFfigurereference{\getvalue{IM::#1::#2}}} +\def\doresetmapfilelist + {\global\let\doresetmapfilelist\relax + \pdfmapfile{original-empty.map}} -%D \macros -%D {doovalbox} -%D -%D Drawing frames with round corners is inherited from the -%D main module. -%D -%D For drawing ovals we use quite raw \PDF\ code. The next -%D implementation does not differ that much from the one -%D implemented in the \POSTSCRIPT\ driver. +\def\doloadmapfile #1#2{\pdfmapfile{#1#2}} +\def\doloadmapline #1#2{\pdfmapline{#1#2}} -\def\doPDFovalcalc#1#2#3% - {\PointsToBigPoints{\dimexpr#1+#2\relax}#3} +\appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryxform +\appendtoksonce \loadallfontmapfiles \to \pdfbackendeveryximage -\def\doovalbox#1#2#3#4#5#6#7#8% todo: \scratchdimen/\scatchbox - {\forcecolorhack - \bgroup - \dimen0=#4\divide\dimen0 \plustwo - \doPDFovalcalc{0pt}{+\dimen0}\xmin - \doPDFovalcalc{#1}{-\dimen0}\xmax - \doPDFovalcalc{#2}{-\dimen0}\ymax - \doPDFovalcalc{-#3}{+\dimen0}\ymin - \advance\dimen0 by #5% - \doPDFovalcalc{0pt}{+\dimen0}\xxmin - \doPDFovalcalc{#1}{-\dimen0}\xxmax - \doPDFovalcalc{#2}{-\dimen0}\yymax - \doPDFovalcalc{-#3}{+\dimen0}\yymin - \doPDFovalcalc{#4}{\zeropoint}\stroke - \doPDFovalcalc{#5}{\zeropoint}\radius - \edef\dostroke{#6}% - \edef\dofill{#7}% - \edef\mode{\number#8 \space}% - % no \ifcase, else \relax in pdfcode - \setbox\scratchbox\hbox - {\ifnum\dostroke\dofill>\zerocount - \ifPDFstrokecolor\else\ifnum\dostroke=\plusone - \writestatus\m!colors{pdf stroke color will fail}\wait - \fi\fi - \PDFcode - {q - \stroke\space w - \ifcase\mode - \xxmin\space \ymin \space m - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax\space \ymax \space y - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - h - \or % 1 - \xxmin\space \ymin \space m - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \ymax \space l - \xmin \space \ymax \space l - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - h - \or % 2 - \xxmin\space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \ymax \space l - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - h - \or % 3 - \xmin \space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax\space \ymax \space y - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \ymin \space l - h - \or % 4 - \xmin \space \ymin \space m - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax\space \ymax \space y - \xmin \space \ymax \space l - \xmin \space \ymin\space l - h - \or % 5 - \xmin \space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax\space \ymax \space y - \xmin \space \ymax \space l - \xmin \space \ymin \space l - h - \or % 6 - \xmin \space \ymin \space m - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \ymax \space l - \xmin \space \ymax \space l - \xmin \space \ymin \space l - h - \or - \xxmin\space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \ymax \space l - \xmin \space \ymax \space l - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - h - \or - \xmin \space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \ymax \space l - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \ymin \space l - h - \or % 9 top open - \xmin \space \ymax \space m - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \ymax \space l - \or % 10 right open - \xmax \space \ymax \space m - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - \xmax\space \ymin \space l - \or % 11 bottom open - \xmax \space \ymin \space m - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax \space \ymax\space y - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \ymin \space l - \or % 12 left open - \xmin \space \ymax \space m - \xxmax\space \ymax \space l - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmax \space \yymin\space l - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xmin \space \ymin \space l - \or % 13 - \xmin \space \ymax \space m - \xxmax\space \ymax \space l - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmax\space \ymin \space l - \or % 14 - \xmax \space \ymax \space m - \xmax \space \yymin\space l - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xmin \space \ymin \space l - \or % 15 - \xmax \space \ymin \space m - \xxmin\space \ymin \space l - \xmin \space \ymin \space \xmin \space \yymin\space y - \xmin \space \ymax \space l - \or % 16 - \xmin \space \ymin \space m - \xmin \space \yymax\space l - \xmin \space \ymax \space \xxmin\space \ymax \space y - \xmax \space \ymax \space l - \or % 17 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \or % 18 - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \or % 19 - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \or % 20 - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 21 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 22 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \or % 23 - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \or % 24 - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 25 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 26 - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 27 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \or % 28 - \fi - \ifnum\mode>8 - S - \else - \ifnum\dostroke=\plusone S \fi - \ifnum\dofill =\plusone f \fi - \fi - Q}% - \fi}% - \wd\scratchbox#1\ht\scratchbox#2\dp\scratchbox#3\box\scratchbox - \egroup} +%D Transformations. Some day we will use primitives (once they're fixed). -%D \macros -%D {dostartgraymode,dostopgraymode, -%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode, -%D dostopcolormode, -%D dostartrotation,dostoprotation, -%D dostartscaling,dostopscaling, -%D dostartmirroring,dostopmirroring, -%D dostartnegative,dostopnegative, -%D dostartoverprint,dostopoverprint} +\def\dostartgraphicgroup{\pdfliteral{q}} +\def\dostopgraphicgroup {\pdfliteral{Q}} \def\dostartrotation#1% grouped - {\setcalculatedcos\cos{#1}% - \setcalculatedsin\sin{#1}% - \forcecolorhack - \PDFcode{q \cos\space\sin\space\negated\sin\space\cos\space0 0 cm}} + {\forcecolorhack + \pdfliteral{q \ctxlua{lpdf.rotationcm(#1)}}} \def\dostoprotation - {\PDFcode{Q}} - -\def\@@PDFzeroscale{.0001} + {\pdfliteral{Q}} \def\dostartscaling#1#2% the test is needed because acrobat is bugged! {\forcecolorhack - \PDFcode{q \ifdim#1\points=\zeropoint\@@PDFzeroscale\else#1\fi\space 0 0 - \ifdim#2\points=\zeropoint\@@PDFzeroscale\else#2\fi\space 0 0 cm}} + \pdfliteral{q \ifdim#1\points=\zeropoint.0001\else#1\fi\space 0 0 + \ifdim#2\points=\zeropoint.0001\else#2\fi\space 0 0 cm}} \def\dostopscaling - {\PDFcode{Q}} - -\def\dostartmirroring{\PDFcode{-1 0 0 1 0 0 cm}} -\def\dostopmirroring {\PDFcode{-1 0 0 1 0 0 cm}} - -\def\dostartnegative {\ifdefined\initializePDFnegative \initializePDFnegative \PDFcode{/GSnegative gs}\fi} -\def\dostopnegative {\ifdefined\initializePDFnegative \initializePDFnegative \PDFcode{/GSpositive gs}\fi} -\def\dostartoverprint{\ifdefined\initializePDFoverprint\initializePDFoverprint\PDFcode{/GSoverprint gs}\fi} -\def\dostopoverprint {\ifdefined\initializePDFoverprint\initializePDFoverprint\PDFcode{/GSknockout gs}\fi} % wrong - -%D \macros -%D {doPDFstartgraymode,doPDFstopgraymode, -%D doPDFstartrgbcolormode,doPDFstartcmykcolormode,doPDFstartgraycolormode, -%D doPDFstopcolormode} -%D -%D In \PDF\ there are two color states, one for strokes and one -%D for fills. This means that we have to set the color in a -%D rather redundant looking way. Unfortunately this makes the -%D \PDF\ file much larger than needed. We can save few bytes -%D by not setting the stroke color. Due to zip compression we -%D only save a few percent. - -\def\dostartgraymode #1{\PDFcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} -\def\dostopgraymode {\PDFcode{0 g\ifPDFstrokecolor\space 0 G\fi}} -\def\dostartrgbcolormode #1#2#3{\PDFcode{#1 #2 #3 rg\ifPDFstrokecolor\space#1 #2 #3 RG\fi}} -\def\dostartcmykcolormode#1#2#3#4{\PDFcode{#1 #2 #3 #4 k\ifPDFstrokecolor\space#1 #2 #3 #4 K\fi}} -\def\dostartgraycolormode #1{\PDFcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} -\def\dostopcolormode {\PDFcode{0 g\ifPDFstrokecolor\space0 G\fi}} - -\def\dostartspotcolormode#1#2% redefining spotcolors is not possible anyway - {\ifundefined{pdf:scs:#2}% - \bgroup - \getcommacommandsize[#2]% - \ifcase\commalistsize\or - \setxvalue{pdf:scs:#2}{#2 SCN #2 scn}% \setxvalue{pdf:scs:#2}{#2 SC #2 sc}% - \else - \let\PDFspotcolorspecs\empty - \def\dospotcolorcommand##1{\edef\PDFspotcolorspecs{\PDFspotcolorspecs##1\space}}% - \processcommacommand[#2]\dospotcolorcommand - \setxvalue{pdf:scs:#2}{\PDFspotcolorspecs SCN \PDFspotcolorspecs scn}% - \fi - \egroup - \fi - \PDFcode{/#1 cs /#1 CS \PDFgetspotcolorspec{#2}}} - -\def\PDFgetspotcolorspec#1% - {\executeifdefined{pdf:scs:#1}\empty} % better no default than one with too less args - -\def\dostartnonecolormode - {\PDFcode{/None CS 1 SC /None cs 1 sc}} - -%D We need to register the spot colors and their fallbacks. - -% we cannot use /DeviceN since GS <=7.21 breaks on it -% and Jaws does not handle it at all {[/DeviceN [/All|/None] -% /Device#2 \PDFobjref\pdflastobj]} so we use separation -% colors that work and print ok - -\def\doPDFregistersomespotcolor#1#2#3#4% implemented in the driver - {\writestatus\m!systems{missing spot color definition}\wait} - -\def\doregisternonecolor % internal command - {\doregistergrayspotcolor{None}{1}% - \globallet\doregisternonecolor\relax} - -\def\dodoPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b - {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{RGB}{0.0 1.0 0.0 1.0 0.0 1.0}% - {\ifcase#2\or dup #5 mul exch dup #6 mul exch #7 mul\else#5 #6 #7\fi}} - -\def\dodoPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k - {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{CMYK}{0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0}% - {\ifcase#2\or dup #5 mul exch dup #6 mul exch dup #7 mul exch #8 mul\else #5 #6 #7 #8\fi}} - -\def\dodoPDFregistergrayspotcolor#1#2#3#4#5% name noffractions names p's s - {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}% - {\ifcase#2\or #5 mul\else #5\fi}} - -\def\doregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b - {\ifRGBsupported - \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}% - \else - \edef\@@cl@@r{#5}\edef\@@cl@@g{#6}\edef\@@cl@@b{#7}% - \ifCMYKsupported - \convertRGBtoCMYK\@@cl@@r\@@cl@@g\@@cl@@b - \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k - \else - \convertRGBtoGRAY\@@cl@@r\@@cl@@g\@@cl@@b - \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s - \fi - \fi} - -\def\doregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k - {\ifCMYKsupported - \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% - \else - \edef\@@cl@@c{#5}\edef\@@cl@@m{#6}\edef\@@cl@@y{#7}\edef\@@cl@@k{#8}% - \ifRGBsupported - \convertCMYKtoRGB\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k - \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}\@@cl@@r\@@cl@@g\@@cl@@b - \else - \convertCMYKtoGRAY\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k - \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s - \fi - \fi} - -\def\doregistergrayspotcolor{\dodoPDFregistergrayspotcolor} - -%D New and very experimental. - -\def\doregistercmykindexcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k - {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{CMYK}{0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0}% - {dup #5 mul exch dup #6 mul exch dup #7 mul exch #8 mul}} - -\def\doregisterrgbindexcolor#1#2#3#4#5#6#7% name noffractions names p's r g b - {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{RGB}{0.0 1.0 0.0 1.0 0.0 1.0}% - {dup #5 mul exch dup #6 mul exch #7 mul}} - -\def\doregistergrayindexcolor#1#2#3#4#5% name noffractions names p's s - {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}% - {pop}} - -\let\checkpredefinedcolor\predefineindexcolor % we need an index in order to negate bitmaps - -\def\doregisterfigurecolor#1% always an index color - {\dogetobjectreference{PDFIX}{\internalspotcolorname{#1}}\PDFimagecolorreference} - -\def\doregisterspotcolorname#1#2% no need for escape in luatex - {\bgroup - \let\ascii\empty - \def\docommand##1% - {\edef\ascii{\ascii - \ifx\nexthandledtoken\space - \letterhash20% - \else\ifx\nexthandledtoken\blankspace - \letterhash20% - \else - ##1% - \fi\fi}}% - \expanded{\handletokens#2}\with\docommand - \letgvalue{@@pdf@@scn@@#1}\ascii - \egroup} - -\def\doPDFregistersomespotcolor#1#2#3#4#5#6#7% name fractions names p's space domain function - {\bgroup - \let\spotpops\empty - \ifcase#2\or - %def\PDFspotcolornames{/Separation /#1}% - \edef\PDFspotcolornames{/Separation /\executeifdefined{@@pdf@@scn@@#1}{#1}}% - \def\PDFspotcolordomain{0.0 1.0}% - \else - \dorecurse{#2}{\edef\spotpops{\spotpops pop }}% - \let\PDFspotcolornames \empty - \let\PDFspotcolordomain\empty - \def\dospotcolorcommand##1% - {\edef\PDFspotcolornames {\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}% - \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}% - \processcommacommand[#3]\dospotcolorcommand - \edef\PDFspotcolornames{/DeviceN [\PDFspotcolornames]}% - \fi - \immediate \pdfobj stream attr - {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}% - \immediate \pdfobj - {[\PDFspotcolornames\space /Device#5 \PDFobjref\pdflastobj]}% - \dosetobjectreference{PDFCS}{#1}{\the\pdflastobj}% - \appendtoPDFdocumentcolorspaces{/#1 \PDFobjref\pdflastobj}% - \egroup} - -%D New and very experimental. - -\def\doPDFregistersomeindexcolor#1#2#3#4#5#6#7% name fractions names p's space domain function - {\bgroup - \let\spotpops\empty - \dorecurse{#2}{\edef\spotpops{\spotpops exch pop\space}}% - \let\PDFspotcolornames \empty - \let\PDFspotcolordomain\empty - \def\docommand##1% - {%\edef\PDFspotcolornames {\PDFspotcolornames/##1\space}% - \edef\PDFspotcolornames{\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}% - \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}% - \processcommacommand[#3,None]\docommand - \let\PDFcolorindexvector\empty - \def\docommand##1% - {\scratchdimen##1\points - \scratchdimen\recurselevel\scratchdimen - \scratchcounter\scratchdimen - \divide\scratchcounter \maxcard - \edef\PDFcolorindexvector{\PDFcolorindexvector\uchexnumbers\scratchcounter}}% - %\dostepwiserecurse\zerocount{255}\plusone - \dostepwiserecurse{255}\zerocount\minusone % we need to negate - {\rawprocesscommacommand[#4,1]\docommand - \xdef\PDFcolorindexvector{\PDFcolorindexvector\space}}% - \immediate \pdfobj stream attr - {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}% - \immediate \pdfobj - {[/Indexed - [/DeviceN [\PDFspotcolornames] /Device#5 \the\pdflastobj\space0 R] % - 255 <\PDFcolorindexvector>]}% - \dosetobjectreference{PDFIX}{#1}{\the\pdflastobj}% - \appendtoPDFdocumentcolorspaces{/#1_INDEXED \the\pdflastobj\space0 R}% - \egroup} - -%D \macros -%D {dostarttransparency,dostoptransparency} -%D -%D For transparency, we need to implement a couple of -%D auxiliary macros. If needed, we will generalize them later. - -\def\@@PDT{@PDT@} - -\ifx\PDFcurrenttransparency\undefined - \newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1 -\fi - -\def\assignPDFtransparency#1#2% - {\edef\PDFtransparencyidentifier{/Tr#1}% - \edef\PDFtransparencyreference{\PDFobjref{#2}}} - -\def\presetPDFtransparency#1#2% - {\initializePDFtransparency - \executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}} - -\def\dopresetPDFtransparency#1#2% - {\global\advance\PDFcurrenttransparency \plusone - \immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}% - \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}% - \edef\PDFtransparencyreference {\PDFobjref\pdflastobj}% - \setxvalue{\@@PDT#1:#2}% - {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\pdflastobj}}% - \appendtoPDFdocumentextgstates - {\PDFtransparencyidentifier\space - \PDFtransparencyreference\space}} - -\def\initializePDFtransparency - {\immediate\pdfobj{\PDFtransparancydictionary{1}{1}{/AIS false}}% - \xdef\PDFtransparencyresetidentifier{/Tr0}% - \xdef\PDFtransparencyresetreference{\PDFobjref\pdflastobj}% - \setxvalue{\@@PDT0:0}% - {\noexpand\assignPDFtransparency{0}{\the\pdflastobj}}% - \appendtoPDFdocumentextgstates - {\PDFtransparencyresetidentifier\space - \PDFtransparencyresetreference\space}% - \global\let\initializePDFtransparency\relax} - -%D Transparency support: - -\def\PDFtransparancydictionary#1#2#3% type fraction extras - {<>} - -\def\dodoPDFstarttransparency#1#2% - {\presetPDFtransparency{#1}{#2}% - \PDFcode{\PDFtransparencyidentifier\space gs }} - -\def\dodoPDFstoptransparency - {\PDFcode{/Tr0 gs }} - -\def\dostarttransparency - {\global\let\dostarttransparency\dodoPDFstarttransparency - \global\let\dostoptransparency \dodoPDFstoptransparency - \initializetransparency - \dostarttransparency} - -% This is tricky: because a text stream is handled before -% the page body is built, we can run into stops that will -% match an outer start; however, the stop is needed in case -% of a text color: [text color text] [other color text] on a -% first page combined with color splitting will go wrong if -% we stick to the relaxing method. - -% \def\dostoptransparency -% {\initializetransparency -% \dodoPDFstoptransparency} - -%D These use: + {\pdfliteral{Q}} -\let\initializetransparency\relax +\def\dostartmirroring{\pdfliteral{-1 0 0 1 0 0 cm}} +\def\dostopmirroring {\pdfliteral{-1 0 0 1 0 0 cm}} -\let\PDFtransparencyresetreference \empty -\let\PDFtransparencyresetidentifier\empty - -\let\PDFtransparencyreference \empty -\let\PDFtransparencyidentifier\empty - -%D New trickery: - -\def\dostartgraphicgroup{\PDFcode{q}} -\def\dostopgraphicgroup {\PDFcode{Q}} - -%D \macros -%D {dostartclipping,dostopclipping} -%D -%D Clipping in \PDFTEX\ is rather trivial. We can even hook -%D in \METAPOST\ without problems. - -\def\dostartclipping#1#2#3% +\def\dostartclipping#1#2#3% todo {\PointsToBigPoints{#2}\width \PointsToBigPoints{#3}\height - \grabMPclippath{#1}{1}\width\height - {0 0 m \width\space 0 l \width \height l 0 \height l}% - \pdfliteral % PDFcode ? - {q 0 w \MPclippath\space W n}} + \grabMPclippath{#1}{1}\width\height{0 0 m \width\space 0 l \width \height l 0 \height l}% + \pdfliteral{q 0 w \MPclippath\space W n}} \def\dostopclipping - {\pdfliteral{Q n}} % PDFcode - -%D \macros -%D {dosetupinteraction} -%D -%D Nothing special is needed to enable \PDF\ commands and -%D interaction. We stick with a message. - -\def\dosetupinteraction - {\showmessage\m!interactions{21}{pdftex}} - -%D \macros -%D {doresetgotowhereever, -%D dostartthisisrealpage,dostartthisislocation, -%D dostartgotorealpage,dostartgotolocation,dostartgotoJS} -%D -%D The interactions macros are the core of this module. We -%D support both page destinations and named ones. We don't -%D need the \type{\stop}||alternatives. We also don't need -%D to set the special that sets the real page number. - -%D In the goto specials we took care of secondary references. -%D Here we define the macros used. - -\def\doresetgotowhereever - {\global\let\secondaryPDFreferences\empty} + {\pdfliteral{Q n}} -\doresetgotowhereever % just to be sure +%D The following will move to the backend \LUA\ code: -% we can (in etex) share more by testing on this +\appendtoks \ctxlua{backends.codeinjections.finalizepage ()}\to \everybackendshipout % is immediate +\appendtoks \ctxlua{backends.codeinjections.finalizedocument()}\to \everylastbackendshipout % is immediate -\def\savesecondaryPDFreference#1% - {\@EA\xdef\csname PDF-SR:\the\nofsecondaryreferences\endcsname{#1}} +%D Temporary hack, will be removed or improved. -\def\savesecondaryPDFreference % #1 == \action - {\global\@EA\let\csname PDF-SR:\the\nofsecondaryreferences\endcsname} - -% test should happen in core-ref - -\def\getsecondaryPDFreferences - {\ifcase\nofsecondaryreferences\else - \ifcsname PDF-SR:\the\nofsecondaryreferences\endcsname - \xdef\secondaryPDFreferences{/Next <<\csname PDF-SR:\the\nofsecondaryreferences\endcsname\space\secondaryPDFreferences>>}% - \fi - \global\advance\nofsecondaryreferences \minusone - \expandafter\getsecondaryPDFreferences - \fi} +\def\TransparencyHack{\ctxlua{backends.codeinjections.addtransparencygroup()}} %D \macros -%D {dostartthisislocation} -%D -%D Next we define the macros that deal with hyperreferencing, -%D graphic inclusion and general document features. These are -%D the olderst ones. I won't comment much because one needs -%D knowledge of \PDF\ itself, and explaning \PDF\ is beyond -%D this documentation. - -\def\dostartthisislocation#1% - {\bgroup - \setPDFdestination{#1}% - \ifx\PDFdestination\empty \else - \pdfdest name {\PDFdestination}\PDFpageviewkey - \fi - \egroup} - -\def\locationfilesuffix{pdf} - -\def\dostartgotolocation#1#2#3#4#5#6% - {\bgroup - \doifelsenothing{#3} - {\setPDFdestination{#5}% - \doifelsenothing\PDFdestination - {\let\action\empty} - {\doifelsenothing{#4} - {\let\PDFfile\empty} - {\expanded{\beforesplitstring#4}\at.\to\PDFfile - \doifparentfileelse\PDFfile % {#4} - {\let\PDFfile\empty} - %{\setreferencefilename#4.\locationfilesuffix\to\PDFfile - {\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile - \edef\PDFfile - {R /F (\PDFfile)\ifgotonewwindow\space/NewWindow true \fi}}}% - \edef\action% - {/S /GoTo\PDFfile\space /D (\PDFdestination)}}} - {\doifelsenothing{#4} - {\let\PDFfile\empty - \let\PDFdestination\empty} - {\setreferencefilename/#4\to\PDFfile - \setPDFdestination{#5}% - \doifsomething\PDFdestination - {\edef\PDFdestination{\letterhash\PDFdestination}}}% - \edef\action{/S /URI /URI (#3\PDFfile\PDFdestination)}}% - \ifx\action\empty\else - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \insertpdfaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \fi - \egroup} - -\def\PDFgotonewwindow{\ifgotonewwindow\space/NewWindow true \fi} - -% optimization in tpd driver -% -% \edef\PDFdestination{(page:\the\scratchcounter)}% -% -% ==> -% -% \advance\scratchcounter 1 -% \edef\PDFdestination{[\pdfpageref \PDFobjref\scratchcounter\PDFpageviewwrd]}% -% -% \doPDFgetpagedestination#1#2% pagenumber macro % % fuzzy hack - -\def\dostartgotorealpage#1#2#3#4#5% watch the R append trick - {\bgroup - \doifelsenothing{#3}% #1 = url - {\scratchcounter0#5\relax - \ifnum\scratchcounter>0 - \doifelsenothing{#4} - {\let\PDFfile\empty} - {\expanded{\beforesplitstring#4}\at.\to\PDFfile - \doifparentfileelse\PDFfile % {#4} - {\let\PDFfile\empty} - %{\setreferencefilename#4.\locationfilesuffix\to\PDFfile - {\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile - \edef\PDFfile{R /F (\PDFfile)\PDFgotonewwindow}}}% - \ifx\PDFfile\empty - \ifcase\overcomePDFpage - \or % pdf starts numbering at zero - \advance\scratchcounter \minusone - \edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}% - \or % pdf starts numbering at zero - \advance\scratchcounter \minusone - \edef\PDFdestination{(page:\the\scratchcounter)}% - \or % pdftex starts numbering at one - \edef\PDFdestination{[\pdfpageref\scratchcounter\space0 R \PDFpageviewwrd]}% - \fi - \else % across files it's a page number / pdf starts numbering at zero - \advance\scratchcounter \minusone - \edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}% - \fi - \edef\action{/S /GoTo\PDFfile\space /D \PDFdestination}% - \else - \let\action\empty - \fi} - {\doifelsenothing{#4} - {\let\PDFfile\empty} - {\setreferencefilename/#4\to\PDFfile}% - \edef\action{/S /URI /URI (#3\PDFfile)}}% - \ifx\action\empty\else - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \insertpdfaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \fi - \egroup} - -\let\lastfakedPDFpage\!!zerocount - -\def\fakePDFpagedestination % as in pdf, we start numbering at zero - {\iflocation \ifarrangingpages \ifnum\overcomePDFpage=\plustwo \else - \ifnum\lastfakedPDFpage<\realpageno - \bgroup - \xdef\lastfakedPDFpage{\realfolio}% - \advance\realpageno \minusone % is \expanded needed ? - \normalexpanded{\noexpand\pdfdest name {page:\realfolio}\PDFpageviewkey}% - \egroup - \fi - \fi \fi \fi} - -\def\dostartgotoJS#1#2#3% - {\bgroup - \doPSsanitizeJScode#3\to\sanitizedJScode - \edef\action{/S /JavaScript /JS (\sanitizedJScode)}% - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \insertpdfaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \egroup} - -%D When going to a location, we obey the time and space saving -%D boolean \type{\ifusepagedestination}. Named destinations are -%D stripped and made robust. This all happens in the macros -%D called for. +%D {dostartobject,dostopobject,doinsertobject} -%D \macros -%D {doflushJSpreamble} -%D -%D It does not make sense to duplicate common \JAVASCRIPT\ -%D functions, and therefore they can be predefined and must be -%D output separately. Currently this special is not shared -%D with the \ACROBAT\ one, simply because \DISTILLER\ does not -%D yet support something \type{\pdfnames}. +%D This will change: -% \oneJSpreamblefalse % buggy in acrobat +\newbox\objectbox -\def\doflushJSpreamble#1% +\def\dostartobject#1#2#3#4#5% {\bgroup - \let\compositeJScode\empty - \def\docommand##1% - {\edef\sanitizedJScode{\getJSpreamble{##1}}% - \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode - \immediate\pdfobj {<< /S /JavaScript /JS (\sanitizedJScode) >>}% - \edef\compositeJScode - {\compositeJScode\space (##1) \PDFobjref\pdflastobj}}% - \processcommalist[#1]\docommand - \immediate\pdfobj{<< /Names [ \compositeJScode ] >>}% - \pdfnames{/JavaScript \PDFobjref\pdflastobj}% - \egroup} - -%D \macros -%D {dostarthide,dostophide} -%D -%D Hiding parts of the document for printing is not yet -%D supported by \PDF\ and therefore \PDFTEX. - -\let\dostarthide\donothing -\let\dostophide \donothing - -%D \macros -%D {doPDFsetupscreen,doPDFsetupidentity} -%D -%D Opposite to \DVI\ drivers, \PDF\ ones must know which what -%D page dimensions they are dealing. We also use the -%D opportunity to launch full screen (1) or show bookmarks (2). -%D -%D Setting of the screen boundingbox involves some -%D calculations. Here we also take care of (non) full screen -%D startup. The dimensions are rounded. Because \PDFTEX\ and -%D \ACROBAT\ handle setting the page dimensions in a -%D different way, we do not share this special. - -\def\dosetupscreen{\doPDFsetupscreen\pdfpageheight} - -\let\currentPDFpagemode \empty % document catalog -\let\currentPDFviewerprefs\empty % document catalog + \setbox\objectbox\vbox\bgroup + \def\dodostopobject{\egroup\doregisterobject{#1}{#2}}} -\let\currentPDFcropbox \empty % page attributes -\let\currentPDFbleedbox \empty % page attributes -\let\currentPDFartbox \empty % page attributes -\let\currentPDFtrimbox \empty % page attributes - -\def\doPDFsetupscreen#1#2#3#4#5#6% watch the extra argument - {\bgroup - \xdef\currentPDFpagemode - {\ifnum#6=4 - /PageLayout /TwoColumnRight - \else - /PageMode \ifcase#6 - /UseNone\or/FullScreen\or/UseOutlines\else/UseNone\fi - \fi}% - \xdef\currentPDFviewerprefs % space after #6 needed, else \relax - {\ifcase#6 \or\or\else /ViewerPreferences << /FitWindow true >>\fi}% +\def\dostopobject + {\dodostopobject \egroup} -\def\addPDFdocumentinfo - {\appendtopdfcatalog{\currentPDFpagemode\currentPDFviewerprefs}% - \appendtopdfcatalog{/Version \ifdim\PDFversion00\points>100\points 1.\fi\PDFversion}% - \appendtopdfinfo{/Trapped /False}% - \appendtopdfinfo{/ConTeXt.Version (\contextversion)}% - \appendtopdfinfo{/ConTeXt.Time (\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}% - \appendtopdfinfo{/ConTeXt.Jobname (\jobname)}% - \appendtopdfinfo{/ConTeXt.Url (www.pragma-ade.com)}% - \glet\addPDFdocumentinfo\relax} +\def\doregisterobject#1#2% + {\the\pdfbackendeveryxform + \finalizeobjectbox\objectbox + \immediate\pdfxform resources {\pdfbackendcurrentresources}\objectbox + \dosetobjectreference{#1}{#2}{\the\pdflastxform}} -\def\PDFversion{1.5} +\def\doresetobjects + {} -\appendtoksonce - \def\PDFversion{1.5}% -\to \everyresetspecials +\def\doinsertobject#1#2% + {\begingroup + \doifobjectreferencefoundelse{#1}{#2} + {\dogetobjectreference{#1}{#2}\PDFobjectreference\pdfrefxform\PDFobjectreference}% + \donothing + \endgroup} -\def\doPDFsetupwhateverbox#1#2#3#4#5#6% watch the extra arguments - {\bgroup - \!!widtha \dimexpr#5+#3\relax - \!!heightb\dimexpr#2-#4\relax - \!!heighta\dimexpr\!!heightb-#6\relax - % sometimes whole values give better results - % \PointsToWholeBigPoints{#3}\left - % \PointsToWholeBigPoints\!!heighta\bottom - % \PointsToWholeBigPoints\!!widtha \width - % \PointsToWholeBigPoints\!!heightb\height - % but since pdf/x does not round when checking if - % the boxes fit inside the media box ... - \PointsToBigPoints{#3}\left - \PointsToBigPoints\!!heighta\bottom - \PointsToBigPoints\!!widtha \width - \PointsToBigPoints\!!heightb\height - \xdef#1{[\left\space\bottom\space\width\space\height]}% - \egroup} - -\gdef\currentPDFtrimbox{\currentPDFcropbox} % default, needed for pdf/x - -\def\dosetupartbox {\doPDFsetupwhateverbox\currentPDFartbox \pdfpageheight} -\def\dosetupcropbox {\doPDFsetupwhateverbox\currentPDFcropbox \pdfpageheight} -\def\dosetupbleedbox{\doPDFsetupwhateverbox\currentPDFbleedbox\pdfpageheight} -\def\dosetuptrimbox {\doPDFsetupwhateverbox\currentPDFtrimbox \pdfpageheight} - -\def\flushPDFpageboxes - {\edef\currentPDFtrimbox{\currentPDFtrimbox}% - \ifx\currentPDFartbox \empty\else\appendtopdfpageattributes{/ArtBox \currentPDFartbox }\fi - \ifx\currentPDFcropbox \empty\else\appendtopdfpageattributes{/CropBox \currentPDFcropbox }\fi - \ifx\currentPDFbleedbox\empty\else\appendtopdfpageattributes{/BleedBox \currentPDFbleedbox}\fi - \ifx\currentPDFtrimbox \empty\else\appendtopdfpageattributes{/TrimBox \currentPDFtrimbox }\fi} - -%D \macros -%D {dostartexecutecommand} -%D -%D \PDF\ viewers enable us to navigate using menus and shortcut -%D keys. These navigational tools can also be accessed by using -%D annotations. The next special takes care of inserting them. -%D -%D At the cost of much auxiliary placeholders, we can pretty -%D fast convert the command asked for. This is how the \PDF\ -%D code looks like. - -\def\PDFmoviecode#1#2#3% - {/Movie - /T (\ifcase#1movie \else sound \fi\ifx\argumentA\empty#2\else\argumentA\fi) - /Operation /\ifcase#3Play\or Stop\or Pause\or Resume\fi\space} - -\def\PDFexecutestartmovie {\PDFmoviecode0\currentmovie0} -\def\PDFexecutestopmovie {\PDFmoviecode0\currentmovie1} -\def\PDFexecutepausemovie {\PDFmoviecode0\currentmovie2} -\def\PDFexecuteresumemovie {\PDFmoviecode0\currentmovie3} - -\def\PDFexecutestartsound {\PDFmoviecode1\currentsound0} -\def\PDFexecutestopsound {\PDFmoviecode1\currentsound1} -\def\PDFexecutepausesound {\PDFmoviecode1\currentsound2} -\def\PDFexecuteresumesound {\PDFmoviecode1\currentsound3} - -\def\PDFformcode#1% - {\doiffieldset{#1}{/Field [\dogetfieldset{#1}]}} - -% bit 3 = html -% bit 6 = xml -% bit 4 = get - -\ifx\PDFsubmitfiller\undefined \let\PDFsubmitfiller\empty \fi - -\chardef\PDFformmethod=1 % 0=GET 1=POST - -\def\PDFformflag#1#2{\ifcase\PDFformmethod#1\else#2\fi} - -\def\PDFexecuteimportform {/Named /N /AcroForm:ImportFDF} -\def\PDFexecuteexportform {/Named /N /AcroForm:ExportFDF} -\def\PDFexecuteresetform {/ResetForm \PDFformcode\argumentA} -\def\PDFexecutesubmitform {/SubmitForm \PDFformcode\argumentB - /Flags \ifcase\submitoutputformat\space - \PDFformflag{12} {4} % 0=unknown - \or \PDFformflag{12} {4} % 1=HTML - \or \PDFformflag {8} {0} % 2=FDF - \or \PDFformflag{40}{32} % 3=XML - \else \PDFformflag{12} {4} % ?=unknown - \fi - /F (\argumentA)\PDFsubmitfiller} - -% urifill permits url substitution - -\def\PDFexecutehide {/Hide /T (\argumentA) /H true} -\def\PDFexecuteshow {/Hide /T (\argumentA) /H false} - -\def\PDFexecutefirst {/Named /N /FirstPage} -\def\PDFexecuteprevious {/Named /N /PrevPage} -\def\PDFexecutenext {/Named /N /NextPage} -\def\PDFexecutelast {/Named /N /LastPage} -\def\PDFexecutebackward {/Named /N /GoBack} -\def\PDFexecuteforward {/Named /N /GoForward} -\def\PDFexecuteprint {/Named /N /Print} -\def\PDFexecuteexit {/Named /N /Quit} -\def\PDFexecuteclose {/Named /N /Close} -\def\PDFexecutesave {/Named /N /Save} -\def\PDFexecutesavenamed {/Named /N /SaveAs} -\def\PDFexecuteopennamed {/Named /N /Open} -\def\PDFexecutehelp {/Named /N /HelpUserGuide} -\def\PDFexecutetoggle {/Named /N /FullScreen} -\def\PDFexecutesearch {/Named /N /Find} -\def\PDFexecutesearchagain {/Named /N /FindAgain} -\def\PDFexecutegotopage {/Named /N /GoToPage} -\def\PDFexecutequery {/Named /N /AcroSrch:Query} -\def\PDFexecutequeryagain {/Named /N /AcroSrch:NextHit} -\def\PDFexecutefitwidth {/Named /N /FitWidth} -\def\PDFexecutefitheight {/Named /N /FitHeight} - -\let\PDFobjectclass\empty -\let\PDFobjectname \empty - -\def\dostartexecutecommand#1#2#3#4% - {\doifdefined{PDFexecute#3} - {\bgroup - \edef\argument{#4}% - \ifx\argument\empty - \let\argumentA\empty - \let\argumentB\empty - \else - \@EA\dogetcommalistelement\@EA1\@EA\from#4\to\argumentA - \@EA\dogetcommalistelement\@EA2\@EA\from#4\to\argumentB - \fi - \edef\action% - {/S \getvalue{PDFexecute#3}}% - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences -% \ifx\PDFobjectclass\empty -% \let\next\insertpdfaction -% \else -% \edef\next{\createpdfactionobject{\PDFobjectclass}{\PDFobjectname}}% -% \globalletempty\PDFobjectclass -% \globalletempty\PDFobjectname -% \fi -% \next - \insertpdfaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \egroup}} - -%D \macros -%D {dosetupidentity} -%D -%D Documents can be tagged with an application accessible title -%D and subtitle, the authorname, a date, the creator, keywords -%D etc. For the moment \PDFTEX\ only supports the first three -%D of these. - -\def\dosetupidentity#1#2#3#4#5#6% - {\normalexpanded{\noexpand\appendtopdfinfo - {/Title <\hexifiedPDFstring{#1}> - /Subject <\hexifiedPDFstring{#2}> - /Author <\hexifiedPDFstring{#3}> - /Creator <\hexifiedPDFstring{#4}> - /ModDate (#4) - /ID (\jobname.#5) % needed for pdf/x - /Keywords <\hexifiedPDFstring{#6}>}}} - -%D \macros -%D {dostartrunprogam} -%D -%D We can run a program form within a document, although this -%D feature is rather weak, due to path problems and buggy -%D argument passing. - -\def\dostartrunprogram#1#2#3#4% new: #3 => #3#4 - {\bgroup - %\edef\string{#3}% - %\@EA\beforesplitstring\string\at{ }\to\program - %\@EA\aftersplitstring \string\at{ }\to\parameters - %\edef\action% - % {/S /Launch /F (\program) /P (\parameters) /D (.)}% - \edef\action - {/S /Launch /F (#3) /P (#4) /D (.)}% - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \insertpdfaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \egroup} - -%D \macros -%D {dostartgotoprofile, dostopgotoprofile, -%D dobeginofprofile, doendofprofile} -%D -%D \CONTEXT\ user profiles and version control fall back on -%D \PDF\ article threads. Unfortunately one cannot influence -%D the view yet in an (for me) acceptable way. - -\def\dostartgotoprofile#1#2#3% to be done: file - {\bgroup - \setPDFdestination{#3}% - \doifsomething\PDFdestination - {\edef\action - {/S /Thread /D (\PDFdestination)}% - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \insertpdfaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi}% - \egroup} - -%D Some day, I'll reimplement threading in a useful way. -%D Currently the viewers handle threads rather diffuse. - -\def\dobeginofprofile#1#2#3#4% - {\setPDFdestination{#1}% - \doifsomething\PDFdestination - {\pdfthread - width #2 height #3 - attr {/Title (\PDFdestination)} % can be omitted - name {\PDFdestination}}} - -\def\doendofprofile - {} - -%D \macros -%D {doinsertbookmark} -%D -%D In \PDF\ bookmarks are the building blocks of a viewer -%D provided sort of table of contents. \TEX\ has to provide -%D the entry as well as the number of child entries. Strings -%D need to be sanatized as good as possible to suit the default -%D encoding. In \CONTEXT\ users can overrule this string by -%D supplying an alternative one. Look at the macro called for -%D to see how funny these bookmarks are defined. - -\def\doinsertbookmark#1#2#3#4#5% level sublevels text page open=1 - {\bgroup - \doPDFgetpagereference{#4}\PDFobjectreference - \pdfoutline - user {<>}% - \ifcase#2 \else count \ifcase#5-\fi#2 \fi -% {<\hexifiedPDFstring{#3}>}% goes wrong - {<#3>}% - \egroup} - -%D \macros -%D {dostartobject,dostopobject,doinsertobject} -%D -%D Due to \PDF's object oriented character, we can include and -%D reuse objects. These can be compared with \TEX's boxes. The -%D \TEX\ counterpart is defined in the module \type{spec-dvi}. -%D We don't use the dimensions here. -%D -%D The next solution is not that beautiful. Because objects are -%D containers for whatever kind of content, graphics can be -%D part of this content, and a graphic object can be part of -%D the more general type. In practice this means that an ximage -%D would be embedded in an xform, which in itself is not that -%D big a problem, apart from a few bytes overhead. However, for -%D reasons unknown to me alternative images must be pure -%D ximages |<|indeed, somehow one cannot use a vector graphic -%D as alternative|>| that are not embedded into forms, so this -%D is why the object handler treats them different. This -%D implies knowledge of the calling routines, especially the -%D \type{FIG} trigger, that signals that we just embedded an -%D image. Alternatively I could have introduced a dual object -%D system, but the overhead in duplicate specials is currently -%D not what we want. I'd rather implement a more mature -%D object support system from scratch. - -\let\currentPDFresources\empty -\let\PDFimageattributes \empty -\let\PDFfigurereference \empty -\let\PDFimagereference \empty - -\def\dostartobject#1#2#3#4#5% - {\bgroup - \setbox\nextbox\vbox\bgroup - \def\dodostopobject - {\egroup - \ifx\PDFimagereference\empty - % We also flush page resources, since shared - % resources end up there; otherwise transparencies - % won't work in xforms; some day I will optimize - % this. - \the\everyPDFxform - \finalizeobjectbox\nextbox - \immediate\pdfxform - resources {\currentPDFresources\the\pdfpageresources}% - \nextbox - \global\let\currentPDFresources\empty - \dosetobjectreference{#1}{#2}{\the\pdflastxform}% - \else - \dosetobjectreference{#1}{#2}{-\PDFimagereference}% - \global\let\PDFimagereference\empty - \fi}} - -\def\dostopobject - {\dodostopobject - \egroup} - -\def\doresetobjects - {\global\let\PDFimagereference\empty} - -\def\doinsertobject#1#2% - {\bgroup - \doifobjectreferencefoundelse{#1}{#2} - {\dogetobjectreference{#1}{#2}\PDFobjectreference - \ifnum\PDFobjectreference<0 - \@EA\@EA\@EA\pdfrefximage\@EA\gobbleoneargument\PDFobjectreference - \else - \pdfrefxform\PDFobjectreference - \fi}% - {}% - \egroup} - -\appendtoksonce - \collectPDFresources - \global\let\currentPDFresources\collectedPDFresources -\to \everyPDFxform - -%D \macros -%D {dosetpagetransition} -%D -%D Page transitions only make sence in presentations. They are -%D passed as raw \PDF\ code to the page object. Take a look -%D at the implementation to get an impression of the rubish -%D passed on. -%D -%D This array holds a reasonable selection of transitions -%D (watch out: \type{replace} is not in this list). Most of -%D the transitions look awful anyway. By the way, \CONTEXT\ is -%D able to select transitions randomly. - -\def\pagetransitions - {{split,in,vertical},{split,in,horizontal}, - {split,out,vertical},{split,out,horizontal}, - {blinds,horizontal},{blinds,vertical}, - {box,in},{box,out}, - {wipe,east},{wipe,west},{wipe,north},{wipe,south}, - dissolve, - {glitter,east},{glitter,south}, - {fly,in,east},{fly,in,west},{fly,in,north},{fly,in,south}, - {fly,out,east},{fly,out,west},{fly,out,north},{fly,out,south}, - {push,east},{push,west},{push,north},{push,south}, - {cover,east},{cover,west},{cover,north},{cover,south}, - {uncover,east},{uncover,west},{uncover,north},{uncover,south}, - fade} - -%D Again, we use macros as placeholders for \PDF\ key||value -%D pairs. - -\def\PDFpagesplit {/S /Split } -\def\PDFpageblinds {/S /Blinds } -\def\PDFpagebox {/S /Box } -\def\PDFpagewipe {/S /Wipe } -\def\PDFpagedissolve {/S /Dissolve } -\def\PDFpageglitter {/S /Glitter } -\def\PDFpagereplace {/S /R } - -\def\PDFpagefly {/S /Fly } % 1.5 -\def\PDFpagepush {/S /Push } % 1.5 -\def\PDFpagecover {/S /Cover } % 1.5 -\def\PDFpageuncover {/S /Uncover } % 1.5 -\def\PDFpagefade {/S /Fade } % 1.5 - -\def\PDFpagehorizontal {/Dm /H } -\def\PDFpagevertical {/Dm /V } -\def\PDFpagein {/M /I } -\def\PDFpageout {/M /O } -\def\PDFpageeast {/Di 0 } -\def\PDFpagenorth {/Di 90 } -\def\PDFpagewest {/Di 180 } -\def\PDFpagesouth {/Di 270 } - -\def\dodoPDFsetpagetransition#1% - {\doifdefined{PDFpage#1} - {\edef\PDFpagetransitions{\PDFpagetransitions\getvalue{PDFpage#1}}}} - -\def\dosetpagetransition#1#2% - {\let\PDFpagetransitions\empty - \processcommalist[#1]\dodoPDFsetpagetransition - \appendtopdfpageattributes - %{\ifnum#2>0 /Dur #2 \fi - {\ifnum0<0#2 /Dur #2 \fi - \ifx\PDFpagetransitions\empty\else/Trans <<\PDFpagetransitions>>\fi}} - -%D The expansion is needed because else the \type{\pdfpageattr} -%D token list flushes an unexpanded \type{\csname}. The -%D \type{\global} is needed because the assignment can take -%D place deeply buried (for instance in the \type{\shipout} -%D box. - -%D \macros -%D {doinsertcomment, doflushcomments} -%D -%D Text annotation, or comments, are provided too: - -%D \macros -%D {dopresetlinefield,dopresettextfield, -%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, -%D dopresetpushfield,dopresetcheckfield, -%D dopresetradiofield,dopresetradiorecord} -%D -%D \PDF\ offers extensive field support. The next bunch of -%D definitions map the specials. - -%D \macros -%D {dodefinefieldset,dogetfieldset,doiffieldset} -%D -%D Field sets, needed for reset and submit handling, are -%D taken care of by: - -%D The next section of this module is dedicated to form -%D support. These macros are complicated by the fact that -%D cloning is possible. - -%D \macros -%D {FDFflag...,FDFplus...} -%D -%D The \type{/FT} key determines the type of field: text, -%D button or choice. The latter two come in several disguises, -%D which are set by flipping bits in the \type{/Ff}. Other bits -%D are used to set states. Personally I hate this bitty way of -%D doing things. The next six bit determine the field sub type: - -\def\FDFflagMultiLine {4096} % 13 -\def\FDFflagNoToggleToOff {16384} % 15 -\def\FDFflagRadio {32768} % 16 -\def\FDFflagPushButton {65536} % 17 -\def\FDFflagPopUp {131072} % 18 -\def\FDFflagEdit {262144} % 19 - -% bugged anyway, so we need to drop it: - -\def\FDFflagRadiosInUnison {33554432} % 26 - -%D A few more (pdf 1.4) flags, what the spell check one: for -%D obscure reasons for Adobe downward compatibility means -%D enabling features that harm old applications like testing. - -\def\FDFflagDoNotSpellCheck {4194304} % 23 -\def\FDFflagDoNotScroll {8388608} % 24 - -%D The next bits (watch how strange the bits are organized) -%D take care of the states: - -\def\FDFflagReadOnly {1} % 1 -\def\FDFflagRequired {2} % 2 -\def\FDFflagNoExport {4} % 3 -\def\FDFflagPassword {8192} % 14 -\def\FDFflagSort {524288} % 20 -\def\FDFflagFileSelect {1048576} % 21 - -%D There is a second, again bitset oriented, \type{/F} flag: - -\def\FDFplusInvisible {1} % 1 -\def\FDFplusHidden {2} % 2 -\def\FDFplusPrintable {4} % 3 - -%def\FDFplusNoView {32} % 6 -%def\FDFplusToggleNoView {256} % 9 - -\def\FDFplusAutoView {256} % {288} % 6+9 - -%D \macros -%D {setFDFswitches} -%D -%D The non||type bits are mapped onto user||interface -%D swithes, to be used later on: - -\def\@@FDFflag{FDFflag} -\def\@@FDFplus{FDFplus} - -\letvalue {\@@FDFflag\v!readonly}=\FDFflagReadOnly -\letvalue {\@@FDFflag\v!required}=\FDFflagRequired -\letvalue {\@@FDFflag\v!protected}=\FDFflagPassword -\letvalue {\@@FDFflag\v!sorted}=\FDFflagSort -\letvalue {\@@FDFflag\v!unavailable}=\FDFflagNoExport -\letvalue {\@@FDFflag\v!nocheck}=\FDFflagDoNotSpellCheck -\letvalue {\@@FDFflag\v!fixed}=\FDFflagDoNotScroll -\letvalue {\@@FDFflag\v!file}=\FDFflagFileSelect - -\letvalue {\@@FDFplus\v!hidden}=\FDFplusHidden -\letvalue {\@@FDFplus\v!printable}=\FDFplusPrintable - -\letvalue {\@@FDFplus\v!auto}=\FDFplusAutoView - -%D A set of switches is collected into the flags we mentioned -%D before by the next macro (we don't handle negations yet, -%D but do take care of redundancy): - -\def\FDFflag{0} -\def\FDFplus{0} - -\def\setFDFswitches[#1]% - {\bgroup - \!!counta\zerocount - \!!countb\zerocount - \def\docommand##1% - {\doifsomething{##1} - {\advance\!!counta 0\getvalue{\@@FDFflag##1}% - \setvalue{\@@FDFflag##1}{0}% - \advance\!!countb 0\getvalue{\@@FDFplus##1}% - \setvalue{\@@FDFplus##1}{0}}}% - \processcommacommand[#1]\docommand - \xdef\FDFflag{\the\!!counta}% - \xdef\FDFplus{\the\!!countb}% - \egroup} - -%D \macros -%D {setFDFvalues} -%D -%D Menu items are passed as an array of \type{(string)}'s and -%D the content of this array is build with: - -\let\FDFvalues \empty -\let\FDFfirstvalues \empty -\let\FDFsecondvalues\empty -\let\FDFkidlist \empty -\let\FDFdefaultindex\!!zerocount -\let\FDFdefaultvalue\empty - -% Why do we need to tweak this mechanism each time acrobat updates ... -% it would make sense to have version specific sections in pdf files -% since my guess is that it never will be done right since each year -% new programmers have new ideas about what is supposed to happen with -% kids. So .. best is not to trust this feature esp not for radio -% widgets. (new flags, different interpretation of AS etc etc) - -\def\setFDFvalues[#1][#2]% #1 = list (item=>value) #2 = default - {\let\FDFvalues \empty - %when radio opt works ok - %\let\FDFfirstvalues \empty - %\let\FDFsecondvalues\empty - \let\FDFkidlist \empty - %\let\FDFdefaultindex\!!zerocount - %\let\FDFdefaultvalue\empty - %\scratchcounter\zerocount - \def\dodocommand##1=>##2=>##3\end - {\addtocommalist{##1}\FDFkidlist - %\edef\FDFfirstvalues{\FDFfirstvalues(##1)}% - %\doif{##1}{#2}{\edef\FDFdefaultindex{\the\scratchcounter}}% - %\advance\scratchcounter\plusone - \doifelsenothing{##2} - {\doif{##1}{#2}{\edef\FDFdefaultvalue{##1}}% - %\edef\FDFsecondvalues{\FDFsecondvalues(##1)}% - \edef\FDFvalues{\FDFvalues [(##1)(##1)] }} - {\doif{##1}{#2}{\edef\FDFdefaultvalue{##2}}% - %\edef\FDFsecondvalues{\FDFsecondvalues(##2)}% - \edef\FDFvalues{\FDFvalues [(##2)(##1)] }}}% ! ##1 is shown - \def\docommand##1% - {\dodocommand##1=>=>\end}% - \expanded{\processcommalist[#1]}\docommand} - -%D This macro accepts comma separated \type{visual=>result} -%D pairs. - -%D \macros -%D {setFDFalignment} -%D -%D Text and line fields can be entered and showed in three -%D alternative alingments, indicated by a digit: - -\def\FDFalign{0} - -\def\setFDFalignment[#1]% - {\processaction - [#1] - [ \v!left=>\edef\FDFalign{2}, % raggedleft - \v!middle=>\edef\FDFalign{1}, % raggedcenter - \v!right=>\edef\FDFalign{0}]} % raggedright - -%D \macros -%D {setFDFattributes} -%D -%D The weak part of (at least version 2.1 \PDF) is that only -%D default fonts are handled well. Another restriction is that -%D the encoding vector must be the standard \PDF\ document one. -%D Although the \PDF\ reference explictly states that one could -%D use the normal text operators, leading is not yet handled. -%D -%D For the moment the current \CONTEXT\ font is mapped onto -%D one best suitable default font. The color attribute is -%D less problematic and is directly derived from the \CONTEXT\ -%D color. - -\def\FDFattributes{/Helv 12 Tf 0 g 14.4 TL} - -\def\FDFrm {TiRo} \def\FDFss {Helv} \def\FDFtt {Cour} -\def\FDFrmtf{TiRo} \def\FDFsstf{Helv} \def\FDFtttf{Cour} -\def\FDFrmbf{TiBo} \def\FDFssbf{HeBo} \def\FDFttbf{CoBo} -\def\FDFrmit{TiIt} \def\FDFssit{HeOb} \def\FDFttit{CoOb} -\def\FDFrmsl{TiIt} \def\FDFsssl{HeOb} \def\FDFttsl{CoOb} -\def\FDFrmbi{TiBI} \def\FDFssbi{HeBO} \def\FDFttbi{CoBO} -\def\FDFrmbs{TiBI} \def\FDFssbs{HeBO} \def\FDFttbs{CoBO} - -\let\FDFusedfonts=\FDFsstf - -\def\setFDFattributes[#1,#2,#3,#4]% style, color, backgroundcolor, framecolor - {\bgroup % nog interlinie: n TL - \setbox\scratchbox\hbox - \bgroup - \doconvertfont{#1}{}% - \PointsToBigPoints\bodyfontsize\size % x/xx, so better the actual size - \doifdefinedelse{FDF\fontstyle\fontalternative} - {\xdef\FDFattributes{\getvalue{FDF\fontstyle\fontalternative}}} - {\doifdefinedelse{FDF\fontstyle} - {\xdef\FDFattributes{\getvalue{FDF\fontstyle}}} - {\xdef\FDFattributes{\FDFrm}}}% - \doglobal\addtocommalist\FDFattributes\FDFusedfonts - \xdef\FDFattributes% move up with "x.y Ts" - {/\FDFattributes\space\size\space Tf\space\PDFcolor{#2}}% - \doifelsenothing{#3} - {\global\let\FDFsurroundings\empty} - {\xdef\FDFsurroundings{/BG \FDFcolor{#3}}}% - \doifsomething{#4} - {\xdef\FDFsurroundings{\FDFsurroundings\space /BC \FDFcolor{#4}}}% - \ifx\FDFsurroundings\empty \else - \xdef\FDFsurroundings{/MK << \FDFsurroundings\space>>}% - \fi - \egroup - \egroup} - -%D \macros -%D {setFDFactions} -%D -%D Depending on the type of the field, one can assign -%D \JAVASCRIPT\ code to a mouse event or keystroke. The next -%D preparation macro shows what events are handled. - -\let\FDFactions\empty - -\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,% - {\global\let\FDFactions\empty - \setFDFaction D#1% mousedown - \setFDFaction U#2% mouseup - \setFDFaction E#3% enterregion - \setFDFaction X#4% exitregion - \setFDFaction K#5% afterkeystroke - \setFDFaction F#6% formatresult - \setFDFaction V#7% validateresult - \setFDFaction C#8% calculatewhatever - \setFDFactionsmore} - -\def\setFDFactionsmore#1,#2]% - {\setFDFaction{Fo}#1% focusin - \setFDFaction{Bl}#2% focusout % was I (now pdf ref manual explicitly talks about lowercase l) - \ifx\FDFactions\empty\else - \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited - \fi} - -% todo, when new var scheme is implemented -% -% \setFDFaction{PO}\@@DriverFieldPageOpen -% \setFDFaction{PC}\@@DriverFieldPageClose -% \setFDFaction{PV}\@@DriverFieldPageVisible -% \setFDFaction{PI}\@@DriverFieldPageInVisible - -%D The event handler becomes something: -%D -%D \starttyping -%D /AA << /D << /S ... >> ... /C << /S ... >> -%D /A << /S /JavaScript /JS (...) >> -%D \stoptyping - -\def\setFDFaction#1#2% - {\bgroup - \def\docommand{\xdef\FDFactions{\FDFactions /#1 << \lastPDFaction >> }}% - \@EA\handlereferenceactions\@EA{#2}\docommand % one level expansion - \egroup} - -%D \macros -%D {testFDFactions} -%D -%D This rather confusion prone series of script can be tested -%D with: -%D -%D \starttyping -%D \testFDFactions -%D \stoptyping -%D -%D which simply redefined the previous macro to one that prints -%D a message to the console. - -\def\testFDFactions - {\def\setFDFaction##1##2% - {\doPSsanitizeJScode console.show();console.println("executing:##1"); \to\sanitizedJScode - \edef\FDFactions{\FDFactions /##1 << /S /JavaScript /JS (\sanitizedJScode) >> }}} - -%D \macros -%D {doregistercalculationset} -%D -%D There is at most one calculation order list, which defines -%D the order in which fields are calculated. The calculation -%D order is defined using: - -\let\PDFcalculationset\empty - -\def\doregistercalculationset#1% - {\def\PDFcalculationset{#1}} - -%D \macros -%D {registerFDFobject,everylastshipout} -%D -%D Officially one needs to embed some general datastructures -%D that tell the viewer what fields are present in the file, as -%D well as what resources they use. The next mechanism does that -%D job automatically when one registers the field. - -\def\flushFDFnames - {\ifx\FDFcollection\empty\else - \defineFDFfonts - \createpdfarrayobject{FDF}{local:fields}{\FDFcollection}% - \doPDFgetobjectreference{FDF}{local:fields}\PDFobjectreference - % The /NeedAppearances is pretty important because - % otherwise Acrobat 5 blows up on cloned radio widgets - \createpdfdictionaryobject{FDF}{local:acroform} - {/Fields \PDFobjectreference\space - /NeedAppearances true - \doiffieldset\PDFcalculationset{/CO [\dogetfieldset\PDFcalculationset]} - /DR << /Font << \FDFfonts >> >> - /DA (/Helv 10 Tf 0 g)}% - \doPDFgetobjectreference{FDF}{local:acroform}\PDFobjectreference - \appendtopdfcatalog - {/AcroForm \PDFobjectreference}% - \global\let\FDFcollection\empty - \global\let\flushFDFnames\relax - \fi} - -\let\FDFcollection\empty - -\def\registerFDFobject#1% - {\ifx\flushFDFnames\relax - \writestatus{FDF}{second run needed for field list (#1)}% - \fi - \doPDFgetobjectreference{FDF}{#1}\PDFobjectreference - \xdef\FDFcollection{\FDFcollection\space\PDFobjectreference}} - -\appendtoksonce \flushFDFnames \to \everylastshipout % test \everybye / was \prependtoksonce - -%D \macros -%D {defineFDFfonts} -%D -%D Another datastruture concerns the fonts used. We only -%D define the fonts we use. - -\def\defineFDFfonts - {\let\FDFfonts\empty - \processcommacommand[\FDFusedfonts]\defineFDFfont} - -\def\defineFDFfont#1% - {\createpdfdictionaryobject{FDF}{local:#1} - {/Type /Font - /Subtype /Type1 - /Name /#1 - /BaseFont /\getvalue{FDFname#1}}% - \doPDFgetobjectreference{FDF}{local:#1}\PDFobjectreference - \edef\FDFfonts{\FDFfonts \space/#1 \PDFobjectreference}} - -%D Another list of constants: - -\def\FDFnameTiRo {Times-Roman} -\def\FDFnameTiBo {Times-Bold} -\def\FDFnameTiIt {Times-Italic} -\def\FDFnameTiBI {Times-BoldItalic} -\def\FDFnameHelv {Helvetica} -\def\FDFnameHeBo {Helvetica-Bold} -\def\FDFnameHeOb {Helvetica-Oblique} -\def\FDFnameHeBO {Helvetica-BoldOblique} -\def\FDFnameCour {Courier} -\def\FDFnameCoBo {Courier-Bold} -\def\FDFnameCoOb {Courier-Oblique} -\def\FDFnameCoBO {Courier-BoldOblique} - -%D \macros -%D {currentFDFmode,currentFDFparent,currentFDFkids,currenrFDFroot} -%D -%D There are three more quasi global interfacing variables -%D that need to be set. - -\let\currentFDFmode \fieldlonermode -\let\currentFDFkids \empty -\let\currentFDFparent\empty -\let\currentFDFroot \empty - -%D \macros -%D {dosetfieldstatus} -%D -%D And here comes the special that deals with them. - -\def\dosetfieldstatus#1#2#3#4% - {\chardef\currentFDFmode #1% - \edef\currentFDFparent {#2}% - \edef\currentFDFkids {#3}% - \edef\currentFDFroot {#4}} - -%D We already dealt with the encoding vector. Conversion from -%D \TEX\ \ASCII\ encoding to the other one, is accomplished by -%D the next few macros. Wach out: we don't group here. - -\appendtoksonce - \simplifycommands -\to \everysetfield - -%D \macros -%D {doPDFinsertcomment} -%D -%D An example its use is the next special, one that deals with -%D text annotations. - -\newcounter\nofFDFcomments - -\newif\ifPDFpopupcomments \PDFpopupcommentstrue - -\def\doflushcomments - {\box\PDFsymbolbox} - -\long\def\doinsertcomment#1#2#3#4#5#6#7#8% % \@@DriverCommentLayer set otherwise - {\bgroup % title width height color open symbol collect data - \presetPDFsymbolappearance{#4}{#6}{#2}{#3}\!!zeropoint% sets width/height - \doifelsenothing{#1} - {\let\PDFidentifier\empty} - {\sanitizePDFencoding#1\to\PDFcommenttitle - \def\PDFidentifier{/T <\PDFcommenttitle>}}% - \sanitizePDFencoding#8\to\PDFdata - \setFDFlayer\@@DriverCommentLayer - \startPDFsymbolappearance - \ifPDFpopupcomments - \doglobal\increment\nofFDFcomments - \doifobjectreferencefoundelse{FDF}{c:\nofFDFcomments} - {\doPDFgetobjectreference{FDF}{c:\nofFDFcomments}\PDFobjectreference - \donetrue} - \donefalse - \ifdone - \setbox\scratchbox\hbox - {\createpdfannotationobject{FDF}{c::\nofFDFcomments}{#2}{#3}% text window, size does not work - {/Subtype /Popup - /Parent \PDFobjectreference}}% - \ifcase#7\relax - \vbox to \height{\forgetall\vskip#3\box\scratchbox\vss}% - \else % incredible trial and error hack - % it's quite a mess, the annot width cannot be set, well, it can - % but the appearance and text sizes get mixed up -% \setbox\scratchbox\vbox to \height{\forgetall\vskip#3\box\scratchbox\vss}% -% \global\setbox\PDFsymbolbox\vbox -% {\hsize#2% -% \forgetall -% \vsmash{\box\PDFsymbolbox} -% \box\scratchbox}% - % this may change when acrobat gets less bugged - \setbox\scratchbox\vbox to #3{\forgetall\vss\box\scratchbox}% - \wd\scratchbox#2% - \global\setbox\PDFsymbolbox\vbox - {\startoverlay{\box\PDFsymbolbox}{\box\scratchbox}\stopoverlay}% - \fi - \fi - % generic - \doifobjectreferencefoundelse{FDF}{c::\nofFDFcomments} - {\doPDFgetobjectreference{FDF}{c::\nofFDFcomments}\PDFobjectreference - \donetrue} - \donefalse - \createpdfannotationobject{FDF}{c:\nofFDFcomments}{\width}{\height} - {/Subtype /Text - \ifcase#5 \else/Open true\fi - % pdftex (efficient) - % \ifdone /Popup \PDFobjref\pdflastannot\fi - % generic (less efficient) - \ifdone /Popup \PDFobjectreference\fi - /Contents <\PDFdata> - \PDFidentifier - \FDFlayer - \PDFsymbol - \PDFattributes}% - \else - \insertpdfannotation{#2}{#3} - {/Subtype /Text - \ifcase#5 \else/Open true\fi - /Contents <\PDFdata> - \FDFlayer - \PDFsymbol - \PDFidentifier - \PDFattributes}% - \fi - \stopPDFsymbolappearance - \egroup} - -% symbols with a reasonable default of 18/24 pt - -\newbox\PDFsymbolbox - -\def\PDFsymbolNew {/Insert} -\def\PDFsymbolBalloon {/Comment} -\def\PDFsymbolAddition {/NewParagraph} -\def\PDFsymbolHelp {/Help} -\def\PDFsymbolParagraph {/Paragraph} -\def\PDFsymbolKey {/Key } - -\def\PDFsymbolGraph {/Graph} -\def\PDFsymbolPaperclip {/Paperclip} -\def\PDFsymbolAttachment{/Attachment} -\def\PDFsymbolTag {/Tag} - -\def\startPDFsymbolappearance - {\setbox\scratchbox\vbox to \totalheight \bgroup \vfill} - -\def\stopPDFsymbolappearance - {\egroup - \setbox\scratchbox\hbox{\lower\depth\box\scratchbox}% - \wd\scratchbox\width - \ht\scratchbox\height - \dp\scratchbox\depth - \box\scratchbox} - -\def\presetPDFsymbolappearance#1#2#3#4#5% symbol color width height depth - {\doifelsenothing{#1} - {\let\PDFattributes\empty} - {\def\PDFattributes{/C \FDFcolor{#1}}}% - \scratchdimen#3\edef\width {\the\scratchdimen}% - \scratchdimen#4\edef\height{\the\scratchdimen}% - \scratchdimen#5\edef\depth {\the\scratchdimen}% - \advance\scratchdimen\height\edef\totalheight{\the\scratchdimen}% - \doifelsenothing{#2} - {\let\PDFsymbol\empty} - {\ifundefined{PDFsymbol#2}% - \getfromcommacommand[#2][1]\let\PDFsymbolnormalsymbol\commalistelement - \getfromcommacommand[#2][2]\let\PDFsymboldownsymbol \commalistelement - \doifsymboldefinedelse\PDFsymbolnormalsymbol - {\doifsymboldefinedelse\PDFsymboldownsymbol - {\dopresetPDFsymbolappearance - \PDFsymbolnormalsymbol\PDFsymboldownsymbol} - {\dopresetPDFsymbolappearance - \PDFsymbolnormalsymbol\PDFsymbolnormalsymbol}} - {\doifsymboldefinedelse\PDFsymboldownsymbol - {\dopresetPDFsymbolappearance - \PDFsymboldownsymbol\PDFsymboldownsymbol} - {\let\PDFsymbol\empty}}% - \else - \def\PDFsymbol{/Name \getvalue{PDFsymbol#2} }% - \fi}} - -\def\dopresetPDFsymbolappearance#1#2% - {\dopresetfieldsymbol{#1}% - \dopresetfieldsymbol{#2}% - \setbox\scratchbox\hbox{\symbol[#1]}% - \edef\width {\the\wd\scratchbox}% - \edef\height{\the\ht\scratchbox}% - \edef\depth {\the\dp\scratchbox}% - \scratchdimen\height \advance\scratchdimen\depth - \edef\totalheight{\the\scratchdimen}% - \doPDFgetobjectreference{SYM}{#1}\FDFsymbolNappearance - \doPDFgetobjectreference{SYM}{#2}\FDFsymbolDappearance - \edef\PDFsymbol - {/AP <>}} - -%D Hooked into \CONTEXT, this special supports -%D -%D \starttyping -%D \startcomment -%D hello beautiful\\world -%D \stopcomment -%D -%D \startcomment[hello] -%D de \'e\'erste keer -%D the f\'irst time -%D \stopcommen -%D -%D \startcommentaar[hallo][color=green,width=4cm,height=3cm] -%D first -%D -%D second -%D \stopcommentaar -%D \stoptyping -%D -%D So, special characters, forced linebreaks using \type{\\} -%D and \type{\par} are handled in the appropriate way. - -%D \macros -%D {dosetuppageview} -%D -%D Because this command will seldom be called, we can permit -%D slow action processing. We need three settings, one for -%D direct \PDF\ inclusion, the other as \PDFTEX\ keyword, an -%D a last one for form. All determine in what way the -%D screen is adapted when going to a destination. Watch the -%D space. - -\def\PDFpageviewkey{fit} -\def\PDFpageviewwrd{/Fit} -\def\PDFpageview {/View [\PDFpageviewwrd] } -\def\PDFpagexyzspec{0 0 0} % hack, pdftex does handle this -\let\PDFpagexyzspec\empty % hack, pdftex does not accept spec - -\def\dosetuppageview#1% watch the v-h swapping here - {\processaction - [#1] - [ \v!fit=>\def\PDFpageviewkey {fit}\def\PDFpageviewwrd{/Fit}, - \v!width=>\def\PDFpageviewkey {fith}\def\PDFpageviewwrd{/FitH}, - \v!height=>\def\PDFpageviewkey {fitv}\def\PDFpageviewwrd{/FitV}, - \v!minwidth=>\def\PDFpageviewkey{fitbh}\def\PDFpageviewwrd{/FitBH}, - \v!minheight=>\def\PDFpageviewkey{fitbv}\def\PDFpageviewwrd{/FitBV}, - \v!standard=>\def\PDFpageviewkey{xyz \PDFpagexyzspec}\def\PDFpageviewwrd{/XYZ \PDFpagexyzspec}, - \s!unknown=>\def\PDFpageviewkey {fit}\def\PDFpageviewwrd{/Fit}]% - \edef\PDFpageview{/View [\PDFpageviewwrd]}} - -%D \macros -%D {setFDFkids} -%D -%D Clones as well as radiofields (which themselves can have -%D cloned components) need a list of kids. The next macro -%D builds one. - -\def\setFDFkids[#1][#2]% tag commalist - {\let\FDFkids\empty - \def\docommand##1% - {\doPDFgetobjectreference{FDF}{#1##1}\PDFobjectreference - \edef\FDFkids{\FDFkids\PDFobjectreference\space}}% - \@EA\processcommalist\@EA[#2]\docommand - \ifx\FDFkids\empty\else\edef\FDFkids{/Kids [\FDFkids]}\fi} - -%D \macros -%D {dopresetlinefield,dopresettextfield, -%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, -%D dopresetpushfield,dopresetcheckfield, -%D dopresetfield,dopresetradiorecord} -%D -%D I would say: read the \PDF\ reference manual first and see -%D what happens here next. Lucky us that they have so much in -%D common. - -\def\dopresetlinefield#1#2#3#4#5#6#7#8#9% - {\bgroup - \setFDFlayer\@@DriverFieldLayer - \setFDFswitches[#7]% - \setFDFattributes[#6]% - \setFDFalignment[#8]% - \setFDFactions[#9]% - \edef\FDFtext{\hexifiedPDFstring{#4}}% - \ifcase\currentFDFmode - \createpdfannotationobject{FDF}{#1}{#2}{#3} - {/Subtype /Widget /T (#1) /FT /Tx - /MaxLen \ifcase0#5 1000 \else#5 \fi - %/DV (#4) /V (#4) % value added - /DV <\FDFtext> /V <\FDFtext> - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Q \FDFalign\space - \FDFactions}% - \registerFDFobject{#1}% - \or - \setFDFkids[kids:][\currentFDFkids]% - \createpdfdictionaryobject{FDF}{#1} - {/T (#1) /FT /Tx - /MaxLen \ifcase0#5 1000 \else#5 \fi - \FDFkids\space - %/DV (#4) /V (#4) % value added - /DV <\FDFtext> /V <\FDFtext> - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Q \FDFalign\space - \FDFactions}% - \registerFDFobject{#1}% - \or - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \createpdfannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Q \FDFalign\space - \FDFactions}% - \or - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \createpdfannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference - /F \FDFplus - \FDFactions}% - \fi - \egroup} - -\def\dopresettextfield#1#2#3#4#5#6#7#8#9% - {\dopresetlinefield{#1}{#2}{#3}{#4}{#5}{#6}{MultiLine,#7}{#8}{#9}} - -\def\dopresetchoicefield#1#2#3#4#5#6#7#8% - {\bgroup - \setFDFlayer\@@DriverFieldLayer - \setFDFswitches[#6]% - \setFDFattributes[#5]% - \setFDFvalues[#7][#4]% - \setFDFactions[#8]% - \ifcase\currentFDFmode - \createpdfannotationobject{FDF}{#1}{#2}{#3} - {/Subtype /Widget - /T (#1) /FT /Ch - /DV (#4) /V (#4) - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Opt [\FDFvalues] - \FDFactions}% - \registerFDFobject{#1}% - \or - \setFDFkids[kids:][\currentFDFkids]% - \createpdfdictionaryobject{FDF}{#1} - {/T (#1) /FT /Ch - \FDFkids\space - /DV (#4) /V (#4) - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Opt [\FDFvalues] - \FDFactions}% - \registerFDFobject{#1}% - \or - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \createpdfannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - \FDFactions}% - \or - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \createpdfannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference - /F \FDFplus - \FDFactions}% - \fi - \egroup} - -\def\dopresetpopupfield#1#2#3#4#5#6#7#8% - {\dopresetchoicefield{#1}{#2}{#3}{#4}{#5}{PopUp,#6}{#7}{#8}} - -\def\dopresetcombofield#1#2#3#4#5#6#7#8% - {\dopresetchoicefield{#1}{#2}{#3}{#4}{#5}{PopUp,Edit,#6}{#7}{#8}} - -\newif\ifFDFvalues - -\def\doFDFpresetpushcheckfield#1#2#3#4#5#6#7#8% in acro<5 (\FDFdefault) - {\bgroup % in acro>5 /\FDFdefault - \setFDFlayer\@@DriverFieldLayer - \ifcase#8\relax\FDFvaluesfalse\else\FDFvaluestrue\fi - \setFDFswitches[#5]% - \setFDFactions[#7]% - \doifelse{#4}{1} - {\def\FDFdefault{On}} - {\def\FDFdefault{Off}}% - \ifcase\currentFDFmode - \doFDFappearance{On}{#6}{#8}% - \createpdfannotationobject{FDF}{#1}{#2}{#3} - {/Subtype /Widget /T (#1) /FT /Btn - \ifFDFvalues - /DV /\FDFdefault\space - /V /\FDFdefault\space - /AS /\FDFdefault\space - \fi - \FDFlayer - /Ff \FDFflag\space - /F \FDFplus\space - \FDFlayer\space - \FDFappearance\space -% /IF << /SW /N >> % strange, only works for stupid buttons - \FDFactions}% - \registerFDFobject{#1}% - \or % no appearance and layer ? - \setFDFkids[kids:][\currentFDFkids]% - \createpdfdictionaryobject{FDF}{#1} - {/T (#1) /FT /Btn - \FDFkids\space - \ifFDFvalues - /DV /\FDFdefault\space - /V /\FDFdefault\space - /AS /\FDFdefault\space - \fi - /Ff \FDFflag\space - /F \FDFplus\space - \FDFactions}% - \registerFDFobject{#1}% - \or - \doFDFappearance{On}{#6}{#8}% - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \createpdfannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - \ifFDFvalues - /DV /\FDFdefault\space - /V /\FDFdefault\space - /AS /\FDFdefault\space - \fi - /Ff \FDFflag\space - /F \FDFplus\space - \FDFlayer\space - \FDFappearance\space - \FDFactions}% - \or - \doFDFappearance{On}{#6}{#8}% - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \createpdfannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - /F \FDFplus\space - \ifFDFvalues - /DV /\FDFdefault\space - /V /\FDFdefault\space - /AS /\FDFdefault\space - \fi - \FDFlayer\space - \FDFappearance - \FDFactions}% - \fi - \egroup} - -\def\dopresetpushfield#1#2#3#4#5#6#7% - {\doFDFpresetpushcheckfield{#1}{#2}{#3}{#4}{PushButton,#5}{#6}{#7}{0}} - -\def\dopresetcheckfield#1#2#3#4#5#6#7% - {\doFDFpresetpushcheckfield{#1}{#2}{#3}{#4}{#5}{#6}{#7}{1}} - -\def\dopresetradiofield#1#2#3#4#5#6#7#8% - {\bgroup - \setFDFlayer\@@DriverFieldLayer - \FDFvaluestrue - \setFDFswitches[#5]% - \setFDFactions[#8]% - \doifelsenothing{#4} - {\def\FDFdefault{Off}} - {\def\FDFdefault{#4}}% - \@EA\aftersplitstring\FDFdefault\at=>\to\FDFdefaultvalue - \ifx\FDFdefaultvalue\empty\else\let\FDFdefault\FDFdefaultvalue\fi - \ifcase\currentFDFmode - \doFDFappearance{#1}{#7}{1}% - \doPDFgetobjectreference{FDF}{#6}\PDFobjectreference - \createpdfannotationobject{FDF}{#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - /F \FDFplus\space - /AS /\FDFdefault\space - \FDFlayer\space - \FDFappearance\space - \FDFactions}% - \registerFDFobject{#1}% - \or - \setFDFkids[kids:][\currentFDFkids]% - \doPDFgetobjectreference{FDF}{#6}\PDFobjectreference - \createpdfdictionaryobject{FDF}{#1} - {/Parent \PDFobjectreference\space - \FDFkids\space - /F \FDFplus\space - \FDFactions}% - \registerFDFobject{#1}% - \or - %\doFDFappearance{#1}{#7}{1}% - \doFDFappearance{\currentFDFparent}{#7}{1}% - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue % nb - \createpdfannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - /AS /\FDFdefault\space - /F \FDFplus\space - \FDFlayer\space - \FDFappearance\space - \FDFactions}% - \or - %\doFDFappearance{#1}{#7}{1}% - \doFDFappearance{\currentFDFparent}{#7}{1}% - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \createpdfannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - /AS /\FDFdefault\space - /F \FDFplus\space - \FDFlayer\space - \FDFappearance\space - \FDFactions}% - \fi - \egroup} - -% Beware, RadiosInUnison is really needed in the pre 1.5/6 time this -% was the default but out of a sudden it's no longer the case. Also -% the NoToggleToOff interferes with kids of kids and both it will -% break older documents, i.e. so much for pdf as standard. With -% features like widgets we can probably best wait till adobe tools -% themselves support it because that's probably the moment that -% functionality gets frozen/becomes definitive. Actually, acrobat -% flattens the kids tree, so that's yet another situation. The -% interesting thing is that it worked ok in acrobat 2/3 but got bugged -% in later versions. [The rationale is in html compatibility, which -% seems to be more important than compatibility of documents, which in -% turn renders acrobat useless for forms.] Anyway, synchronization is -% broken or not depending on the combination pdfversion/acrobatversion. - -\def\dopresetradiorecord#1#2#3#4#5% - {\bgroup - % < pdf 1.5 (1.5 was broken) - % \setFDFswitches[Radio,NoToggleToOff,RadiosInUnison,#3]% - % > pdf 1.5 - \setFDFswitches[Radio,RadiosInUnison,#3]% - % older, else fatal error - % \setFDFkids[#4][]% - % newer - \setFDFvalues[#4][#2]% inits kidlist - \expanded{\setFDFkids[][\FDFkidlist]}% - % - \setFDFactions[#5]% - \createpdfdictionaryobject{FDF}{#1} - {%/Subtype /Widget - /FT /Btn /T (#1) /Rect [0 0 0 0] - % used to be this - % /V (#2) - % then this - % /DV (#2) - % since this bomded in 5 - % /V (#2) - % and now finally this works - /H /N - % /opt is buggy in 5.05, only works once, sigh - %\ifx\FDFfirstvalues\FDFsecondvalues - /V /#2 - %\else - % /V /\FDFdefaultindex\space - % /Opt [\FDFsecondvalues] - %\fi - /Ff \FDFflag\space - /F \FDFplus\space - \FDFkids\space - \FDFactions}% - \egroup} - -%D At the cost of some more references, we can save bytes, -%D by sharing appearance dictionaries. This code needs more -%D documentation. Surprise: - -\def\dodoFDFappearance#1#2% - {\ifx#2\empty\else - \dogetcommacommandelement1\from#2\to\commalistelement - \ifx\commalistelement\empty\else - \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference - \edef\N{\ifFDFvalues\N /#1 \fi\PDFobjectreference\space}% - \fi - \dogetcommacommandelement2\from#2\to\commalistelement - \ifx\commalistelement\empty\else - \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference - \edef\R{\ifFDFvalues\R /#1 \fi\PDFobjectreference\space}% - \fi - \dogetcommacommandelement3\from#2\to\commalistelement - \ifx\commalistelement\empty\else - \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference - \edef\D{\ifFDFvalues\D /#1 \fi\PDFobjectreference\space}% - \def\FDFappearance{/H /P }% - \fi - \fi} - -\def\redoFDFappearance#1% - {\ifx#1\empty\else - \dogetcommacommandelement3\from#1\to\commalistelement - \ifx\commalistelement\empty\else - \def\FDFappearance{/H /P }% - \fi - \fi} - -\def\doFDFappearance#1#2#3% - {\ifcase#3\relax % push only field - \edef\yes{#2}% - \let\no\empty - \else % on / off field - \dogetcommacommandelement1\from#2,\to\yes - \dogetcommacommandelement2\from#2,\to\no - \fi - \def\FDFappearance{/H /N}% - \doifobjectfoundelse{FDF}{ap:#1:\yes:\no} - {\redoFDFappearance\yes - \redoFDFappearance\no} - {\presetobject{FDF}{ap:#1:\yes:\no}% funny hack - \let\N\empty\let\R\empty\let\D\empty - \dodoFDFappearance{#1}\yes - \dodoFDFappearance{Off}\no - \createpdfdictionaryobject{FDF}{ap:#1:\yes:\no} - {\ifx\N\empty\else/N \ifFDFvalues<<\N>>\else\N\fi\fi - \ifx\R\empty\else/R \ifFDFvalues<<\R>>\else\R\fi\fi - \ifx\D\empty\else/D \ifFDFvalues<<\D>>\else\D\fi\fi}}% - \doPDFgetobjectreference{FDF}{ap:#1:\yes:\no}\PDFobjectreference - \edef\FDFappearance{\FDFappearance /AP \PDFobjectreference}} - -\def\doFDFdefault#1#2% - {\doifelse{#2}{1}{\def\FDFdefault{On}}{\def\FDFdefault{Off}}} - -%D Layer support: - -\def\setFDFlayer#1% todo : \ifx\PDFobjectreference\noPDFobjectreference ipv found - {\letempty\FDFlayer - \doifsomething{#1}% - {\checkproperty[#1]% == \dodocheckproperty\@@DriverFieldLayer - \doifobjectreferencefoundelse{PDLN}{#1} - {\doPDFgetobjectreference{PDLN}{#1}\!!stringa % we need to avoid a clash with other macros - \edef\FDFlayer{/OC \!!stringa}}% - \donothing}} - -%D The three appearances {\em normal}, \type{roll over} and -%D \type{push down} are passed as comma separated triplets, -%D that is, the second argument can look like: -%D -%D \starttyping -%D {yes,ok,fine},{no,rubish,awful} -%D \stoptyping - -%D \macros -%D {dodefinefieldset,dogetfieldset,doiffieldset} -%D -%D Field sets, the ones we use in submitting and resetting -%D fields, are implemented using the next low level specials: -%D -%D \starttyping -%D \doFDFdefinefieldset{TAG}{name,name,...} -%D \doFDFgetfieldset{TAG} -%D \doiffieldset{TAG}{sequence} -%D \stoptyping - -\def\dodefinefieldset#1#2% tag commalist - {\let\FDFfieldset\empty - \def\docommand##1% - {\doPDFgetobjectreference{FDF}{##1}\PDFobjectreference - \edef\FDFfieldset{\FDFfieldset\PDFobjectreference\space}}% - \processcommacommand[#2]\docommand % nb: command - \setevalue{FDF:set:#1}{\FDFfieldset}} - -\def\dogetfieldset#1% - {\getvalue{FDF:set:#1}} - -\def\doiffieldset#1#2% - {\ifundefined{FDF:set:#1}\else#2\fi} - -%D \macros -%D {defaultobjectreference,doPDFgetobjectreference} -%D -%D Because in \PDFTEX\ we have to construct the object -%D references \type{N 0 R}, we can default to the non existing -%D zero object number. - -\def\defaultobjectreference#1#2% - {0} - -\def\doPDFgetobjectreference#1#2#3% - {\dogetobjectreference{#1}{#2}#3% - \edef#3{\ifx#3\empty null\else\PDFobjref{#3}\fi}} - -\def\doPDFgetobjectnumber#1#2#3% - {\dogetobjectreference{#1}{#2}#3% - \edef#3{\ifx#3\empty 0\else#3\fi}} - -\def\doPDFgetobjectpage#1#2#3% - {\dogetobjectreferencepage{#1}{#2}#3% - \ifx#3\empty\def#3{1}\fi} +\def\doPDFgetobjectpage#1#2#3% + {\dogetobjectreferencepage{#1}{#2}#3% + \ifx#3\empty\def#3{\realfolio}\fi} \def\doPDFgetobjectpagereference#1#2#3% {\dogetobjectreferencepage{#1}{#2}#3% - \ifx#3\empty - \doPDFgetpagereference\realfolio#3% - \else - \doPDFgetpagereference#3#3% we assume that #3 gets expanded - \fi} - -\def\doPDFgetpagereference#1#2% number macro - {\edef#2{\ifnum#1>\zerocount\PDFobjref{\pdfpageref#1}\else null\fi}} - -\def\thePDFpagereference#1#2% number macro - {\ifnum#1>\zerocount\PDFobjref{\pdfpageref#1}\else null\fi} - -%D \macros -%D {initializePDFnegative,initializePDFoverprint} -%D -%D Here follow some rather obscure macros. They will only -%D come into action when one wants negated output. - -\def\initializePDFnegative - {\immediate\pdfobj stream attr {/FunctionType 4 /Range [0 1] /Domain [0 1]} {{1 exch sub}}% - \immediate\pdfobj{<>}% - \appendtoPDFdocumentextgstates{/GSnegative \PDFobjref\pdflastobj}% - \immediate\pdfobj{<>}% - \appendtoPDFdocumentextgstates{/GSpositive \PDFobjref\pdflastobj}% - \global\let\initializePDFnegative\relax} - -\def\initializePDFoverprint - {\immediate\pdfobj{<>}% /op defaults to /OP - \appendtoPDFdocumentextgstates{/GSknockout \PDFobjref\pdflastobj}% - \immediate\pdfobj{<>}% /op defaults to /OP - \edef\PDFobjectreferenceB{\the\pdflastobj}% - \appendtoPDFdocumentextgstates{/GSoverprint \PDFobjref\pdflastobj}% - \global\let\initializePDFoverprint\relax} - -%D File embedding. Storing the stream identifier is needed -%D to get access to the number. When typeset, the user can -%D feed this number to \type {pdftosrc} and filter the -%D file from the \PDF\ file. - -\let\PDFlaststreamobject \s!unknown -%def\PDFlaststreamreference{0 0 R} - -\def\doPDFfilestreamobject#1#2#3#4% - {\immediate\pdfobj stream file{#4}% - \edef\PDFlaststreamobject{\the\pdflastobj}% - \dosetobjectreference{PDFFS}{#2}{\PDFlaststreamobject}% - \createpdfdictionaryobject{#1}{#2}{/Type /Filespec /F (#3) /EF <>}} - -\def\doPDFgetfilestreamreference#1#2% - {\doPDFgetobjectreference{PDFFS}{#1}#2} - -\def\doPDFfilestreamidentifier#1% - {\doifsomething{#1} - {\doPDFgetfilestreamreference{#1}\PDFobjectreference - \@EA\beforesplitstring\PDFobjectreference\at{ }\to\PDFlaststreamobject - \PDFlaststreamobject}} - -% MP ? - - \def\setMPPDFobject#1#2% resources boxnumber - {\the\everyPDFxform - \finalizeobjectbox{#2}% - \immediate\pdfxform resources{#1}#2% - \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}} - - \let\getMPPDFobject\relax - - \def\doinsertMPfile#1% - {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}} - -%D Even newer trickery: - -% resource -> prop -> mc's -> OCG|OCMD (nested) -% ocg: -% /Intent/Design -% ocmd -% /P /AllOn -% kan zelf ocmd bevatten - -\let\PDFtextlayers\empty -\let\PDFpagelayers\empty -\let\PDFhidelayers\empty -\let\PDFvidelayers\empty - -\def\dostartlayer#1{\PDFcode{/OC /#1 BDC}} -\def\dostoplayer {\PDFcode {EMC}} - -\def\dodefineviewerlayer#1#2#3#4#5% tag title visible type printable - {\createpdfdictionaryobject{PDLN}{#1} - {/Type /OCG - \ifcase#4 \or - /Intent /Design % disable layer hiding by user - \fi - \ifnum#5=\zerocount - /Usage << /Print << /PrintState /OFF >> >> % printable or not - \fi - /Name (#2)}% - \doPDFgetobjectreference{PDLN}{#1}\PDFobjectreference - \xdef\PDFtextlayers{\PDFtextlayers\space\PDFobjectreference}% - \doifelse{#3}\v!start - {\xdef\PDFvidelayers{\PDFvidelayers\space\PDFobjectreference}}% - {\xdef\PDFhidelayers{\PDFhidelayers\space\PDFobjectreference}}% - \createpdfdictionaryobject{PDLD}{#1} - {/Type /OCMD - /OCGs [\PDFobjectreference]}% - \doPDFgetobjectreference{PDLD}{#1}\PDFobjectreference - \xdef\PDFpagelayers{\PDFpagelayers\space /#1 \PDFobjectreference}} - -\def\flushPDFtextlayers - {\ifx\PDFtextlayers\empty \else - \driverreferenced \createpdfarrayobject{PDF}{textlayers}{\PDFtextlayers}% - \doPDFgetobjectreference{PDF}{textlayers}\!!stringa - \ifx\PDFvidelayers\empty - \def\!!stringb{[null]}% - \else - \driverreferenced \createpdfarrayobject{PDF}{videlayers}{\PDFvidelayers}% - \doPDFgetobjectreference{PDF}{videlayers}\!!stringb - \fi - \ifx\PDFhidelayers\empty - \def\!!stringc{[null]}% - \else - \driverreferenced \createpdfarrayobject{PDF}{hidelayers}{\PDFhidelayers}% - \doPDFgetobjectreference{PDF}{hidelayers}\!!stringc - \fi - \appendtopdfcatalog - {/OCProperties - << % display in menu - /D << /Order \!!stringa - /ON \!!stringb - /OFF \!!stringc >> - % used properties - /OCGs \!!stringa >>}% - \globallet\flushPDFtextlayers\relax - \fi} - -\def\flushPDFpagelayers - {\ifx\PDFpagelayers\empty \else - \appendtopdfpageresources{/Properties <<\PDFpagelayers>>}% - \fi} - -\def\PDFlayeractionlist{null} - -\def\PDFexecutehidelayer {/SetOCGState /State [/OFF \PDFlayeractionlist]} -\def\PDFexecutevidelayer {/SetOCGState /State [/ON \PDFlayeractionlist]} -\def\PDFexecutetogglelayer {/SetOCGState /State [/Toggle \PDFlayeractionlist]} - -\def\domakeviewerlayerlist#1% - {\bgroup - \globallet\PDFlayeractionlist\empty - \def\docommand##1% - {\doPDFgetobjectreference{PDLN}{##1}\PDFobjectreference - \xdef\PDFlayeractionlist{\PDFlayeractionlist\space\PDFobjectreference}}% - \processcommalist[#1]\docommand - \egroup} - -%D Something rather pdf dependent: - -% #1 => 1=fill 2=stroke 3=strokedfill 4=invisible -% #2 => linewidth -% #3 => spacing (beware, one needs to set the hsize as well) - -\def\dostartfonteffect#1#2#3% - {\ifdim#2>\zeropoint - \PointsToBigPoints{#2}\ascii - \PDFcode{\ascii\space w}% - \fi - \ifdim#3\points=\onepoint\else - \scratchdimen#3\points - \PDFcode{\withoutpt{\the\scratchdimen}\space Tc}% - \fi - \PDFcode{\purenumber#1 Tr}} - -\def\dostopfonteffect - {\PDFcode{1 w 0 Tc 0 Tr}} - -%D Handy for the \METAPOST\ to \PDF\ converter: - -\appendtoksonce - \collectPDFresources - \global\let\currentPDFresources\collectedPDFresources -\to \everyPDFxform - -\let\collectedPDFresources\empty - -\def\collectPDFresources % suboptimal - {\doifobjectreferencefoundelse{FDF}{docushades} % redundant, we have an reserved object now - {\doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference - \xdef\collectedPDFresources{\collectedPDFresources/Shading \PDFobjectreference}}\donothing - \doifobjectreferencefoundelse{FDF}{docuextgstates} - {\doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference - \xdef\collectedPDFresources{\collectedPDFresources/ExtGState \PDFobjectreference}}\donothing - \doifobjectreferencefoundelse{FDF}{colorspaces} - {\doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference - \xdef\collectedPDFresources{\collectedPDFresources/ColorSpace \PDFobjectreference}}\donothing - \global\let\collectPDFresources\relax} - -\appendtoks - \flushPDFpagelayers - \flushJSpreamble - \flushJSpreamble - \checkPDFextgstates - \checkPDFcolorspaces - \checkPDFshades - \checkPDFpageactions - \fakePDFpagedestination - \flushPDFpageboxes - \addPDFdocumentinfo -\to \everybackendshipout - -\appendtoks - \flushPDFtextlayers - \finalflushJSpreamble -\to \everylastbackendshipout - -%D Temporary hack: - -\def\TransparencyHack % png: /CS /DeviceRGB /I true - {\appendtoksonce - \appendtopdfpageattributes{/Group << /S /Transparency /I true /K true>>}% - \to \everyPDFxform - \appendtoksonce - \appendtopdfpageattributes{/Group << /S /Transparency /I true /K true>>}% - \to \everyshipout} + \doPDFgetpagereference{\ifx#3\empty\realfolio\else#3\fi}#3} + +\def\predefinesymbol[#1]% + {\begingroup + \setobject{SYM}{#1}\hbox{\symbol[#1]}% + \dogetobjectreference{SYM}{#1}\lastref + \ctxlua{backends.codeinjections.registersymbol("#1",\lastref)}% + \endgroup} \protect \endinput diff --git a/tex/context/base/bibl-bib.mkiv b/tex/context/base/bibl-bib.mkiv new file mode 100644 index 000000000..51db67ed7 --- /dev/null +++ b/tex/context/base/bibl-bib.mkiv @@ -0,0 +1,29 @@ +%D \module +%D [ file=bibl-bib, +%D version=2007.08.17, +%D title=\CONTEXT\ Bibliography Support, +%D subtitle=Initialization, +%D author=Hans Hagen \& Taco Hoekwater, +%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 Bibliography Support / BibTeX} + +\registerctxluafile{bibl-bib}{1.001} + +\unprotect + +\def\definebibtexsession [#1]{\ctxlua{commands.definebibtexsession("#1")}} +\def\preparebibtexsession [#1]{\ctxlua{commands.preparebibtexsession("#1")}} +\def\registerbibtexfile {\dodoubleargument\doregisterbibtexfile} +\def\doregisterbibtexfile [#1][#2]{\ctxlua{commands.registerbibtexfile("#1","#2")}} % also the fast one +\def\registerbibtexentry {\dodoubleargument\doregisterbibtexentry} +\def\doregisterbibtexentry [#1][#2]{\ctxlua{commands.registerbibtexentry("#1","#2")}} % also the fast one +\def\applytobibtexsession {\dodoubleargument\doapplytobibtexsession} +\def\doapplytobibtexsession[#1][#2]{\xmlprocessregistered{bibtex:#1}{#2}{#2}} + +\protect \endinput diff --git a/tex/context/base/bibl-bib.tex b/tex/context/base/bibl-bib.tex deleted file mode 100644 index 51db67ed7..000000000 --- a/tex/context/base/bibl-bib.tex +++ /dev/null @@ -1,29 +0,0 @@ -%D \module -%D [ file=bibl-bib, -%D version=2007.08.17, -%D title=\CONTEXT\ Bibliography Support, -%D subtitle=Initialization, -%D author=Hans Hagen \& Taco Hoekwater, -%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 Bibliography Support / BibTeX} - -\registerctxluafile{bibl-bib}{1.001} - -\unprotect - -\def\definebibtexsession [#1]{\ctxlua{commands.definebibtexsession("#1")}} -\def\preparebibtexsession [#1]{\ctxlua{commands.preparebibtexsession("#1")}} -\def\registerbibtexfile {\dodoubleargument\doregisterbibtexfile} -\def\doregisterbibtexfile [#1][#2]{\ctxlua{commands.registerbibtexfile("#1","#2")}} % also the fast one -\def\registerbibtexentry {\dodoubleargument\doregisterbibtexentry} -\def\doregisterbibtexentry [#1][#2]{\ctxlua{commands.registerbibtexentry("#1","#2")}} % also the fast one -\def\applytobibtexsession {\dodoubleargument\doapplytobibtexsession} -\def\doapplytobibtexsession[#1][#2]{\xmlprocessregistered{bibtex:#1}{#2}{#2}} - -\protect \endinput diff --git a/tex/context/base/buff-ini.lua b/tex/context/base/buff-ini.lua index 4be320f76..5b13f669a 100644 --- a/tex/context/base/buff-ini.lua +++ b/tex/context/base/buff-ini.lua @@ -31,6 +31,10 @@ local ctxcatcodes = tex.ctxcatcodes local data, commands, flags, hooks, visualizers = buffers.data, buffers.commands, buffers.flags, buffers.hooks, buffers.visualizers +function buffers.raw(name) + return data[name] or { } +end + function buffers.erase(name) data[name] = nil end @@ -484,3 +488,48 @@ function buffers.flush_result(result,nested) texsprint(ctxcatcodes,concat(result,"")) end end + +-- THIS WILL BECOME A FRAMEWORK: the problem with prety printing is that +-- we deal with snippets and therefore we need tolerant parsing + +--~ local type = type + +--~ visualizers = visualizers or { } + +--~ local function fallback(s) return s end + +--~ function visualizers.visualize(visualizer,kind,pattern) +--~ if type(visualizer) == "table" and type(kind) == "string" then +--~ kind = visualizer[kind] or visualizer.default or fallback +--~ else +--~ kind = fallback +--~ end +--~ return (lpeg.C(pattern))/kind +--~ end + +--~ local flusher = texio.write +--~ local format = string.format + +--~ local visualizer = { +--~ word = function(s) return flusher(format("\\bold{%s}",s)) end, +--~ number = function(s) return flusher(format("\\slanted{%s}",s)) end, +--~ default = function(s) return flusher(s) end, +--~ } + +--~ local word = lpeg.R("AZ","az")^1 +--~ local number = lpeg.R("09")^1 +--~ local any = lpeg.P(1) + +--~ local pattern = lpeg.P { "start", +--~ start = ( +--~ visualizers.visualize(visualizer,"word",word) + +--~ visualizers.visualize(visualizer,"number",number) + +--~ visualizers.visualize(visualizer,"default",any) +--~ )^1 +--~ } + +--~ str = [[test 123 test $oeps$]] + +--~ pattern:match(str) + + diff --git a/tex/context/base/buff-ini.mkiv b/tex/context/base/buff-ini.mkiv index c9c1ae052..29ce4687d 100644 --- a/tex/context/base/buff-ini.mkiv +++ b/tex/context/base/buff-ini.mkiv @@ -15,6 +15,41 @@ \registerctxluafile{buff-ini}{1.001} +% todo: +% +% \startluacode +% local locations = { } +% function document.set_number(name) +% locations[name] = { +% line = status.linenumber, +% file = status.filename +% } +% end +% function document.add_number(name) +% local b, l = buffers.raw(name), locations[name] +% if b and l then +% for i=1,#b do +% b[i] = string.gsub(b[i],"# line: ","# line: " .. l.line + 2) +% end +% end +% end +% \stopluacode +% +% \starttext +% +% \ctxlua{document.set_number("oeps")} +% \startbuffer[oeps] +% # line: +% +% test +% test +% \stopbuffer +% \ctxlua{document.add_number("oeps")} +% +% \typebuffer[oeps] +% +% \stoptext + \ifdefined\doinitializeverbatim \else% temp hack \ifdefined\mkinitializeverbatim \let\doinitializeverbatim\mkinitializeverbatim diff --git a/tex/context/base/buff-ver.mkii b/tex/context/base/buff-ver.mkii index c9ad8cbc9..8c2929a4b 100644 --- a/tex/context/base/buff-ver.mkii +++ b/tex/context/base/buff-ver.mkii @@ -60,7 +60,7 @@ \restorecatcodes % also needed when loading during \newpretty \startreadingfile % restore < and > if needed \lowercasestring verb-\prettyidentifier.tex\to\filename - \readsysfile\filename\donothing\donothing + \readsysfile{\filename.mkii}\donothing\donothing \stopreadingfile \stopnointerference}% \doifdefinedelse{setuppretty\prettyidentifier type}% diff --git a/tex/context/base/buff-ver.mkiv b/tex/context/base/buff-ver.mkiv index aed357de8..53ad235fe 100644 --- a/tex/context/base/buff-ver.mkiv +++ b/tex/context/base/buff-ver.mkiv @@ -142,7 +142,6 @@ \def\obs{\obeyedspace}% \ctxlua{buffers.doifelsevisualizer("\prettyidentifier")} {\ctxlua{buffers.setvisualizer("\prettyidentifier")}% - \localcolortrue % tricky, maybe not here \def\bop{\bgroup\beginofpretty}% \def\eop{\endofpretty\egroup}% \def\sop{\endofpretty\egroup\bgroup\beginofpretty}}% @@ -568,14 +567,14 @@ \ctxlua{buffers.typefile("\readfilename")}% #2} -\def\dotypeblockverbatim#1#2% +\unexpanded\def\dotypeblockverbatim#1#2% {\dowithbuffer{_typing_}{#1}{#2} {} {\doinitializeverbatim \beginofverbatimlines \ctxlua{buffers.type("_typing_")}% \endofverbatimlines - \getvalue{\strippedcsname#2}}} + \csname#2\endcsname}} \def\dododostarttyping[#1]% {\typingparameter\c!before @@ -583,7 +582,7 @@ \dosetuptypelinenumbering{#1}% \initializetyping \startverbatimcolor - \expanded{\dotypeblockverbatim{\s!start\currenttyping}{\s!stop\currenttyping}}} + \normalexpanded{\dotypeblockverbatim{\e!start\currenttyping}{\e!stop\currenttyping}}} % was s!start \def\dostoptyping#1% hm, currenttyping {\stopverbatimcolor @@ -753,8 +752,9 @@ \fi\fi} \def\dosetuptypelinenumbering#1% fuzzy - {\doifundefined{\currenttypingclass\currenttyping\c!start} - {\setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!nlines=]}% + {\ifcsname\currenttypingclass\currenttyping\c!start\endcsname \else + \setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!nlines=]% + \fi \setuptyping[\currenttyping][#1]% \doifelse{\typingparameter\c!numbering}\v!file {% kind of special: filters lines ! @@ -804,11 +804,13 @@ \settypingparameter\c!option{\prettyidentifier}}% \initializetyping \startverbatimcolor - \doifundefinedelse{\currenttypingclass#3\v!global\c!start} - {\scratchcounter\zerocount} - {\scratchcounter\getvalue{\currenttypingclass#3\v!global\c!start}}% - \advance\scratchcounter\plusone - \setxvalue{\currenttypingclass#3\v!global\c!start}{\the\scratchcounter}% + \scratchcounter + \ifcsname\currenttypingclass#3\v!global\c!start\endcsname + \numexpr\csname\currenttypingclass#3\v!global\c!start\endcsname+\plusone\relax + \else + \plusone + \fi + \setxvalue{\currenttypingclass#3\v!global\c!start}{\the\scratchcounter}% no direct setxvalue as it defines beforehand \doifelsenothing{\typingparameter\c!start} {#4} {\doif{\typingparameter\c!start}\v!continue diff --git a/tex/context/base/catc-ctx.tex b/tex/context/base/catc-ctx.tex index 028ae496c..83e802e77 100644 --- a/tex/context/base/catc-ctx.tex +++ b/tex/context/base/catc-ctx.tex @@ -205,3 +205,46 @@ \let\xmlcatcodes \xmlcatcodesn \endinput + +% under consideration: +% +% \newcatcodetable\txtcatcodes +% +% \startcatcodetable \txtcatcodes +% \catcode`\^^I = 10 +% \catcode`\^^M = 5 +% \catcode`\^^L = 5 +% \catcode`\ = 10 +% \catcode`\\ = 0 +% \catcode`\{ = 1 +% \catcode`\} = 2 +% \stopcatcodetable +% +% \newcount\relaxedcatcodedepth +% +% \def\startrelaxedcatcodes +% {\global\chardef\relaxedcatcodeparent\catcodetable +% \global\advance\relaxedcatcodedepth\plusone +% \nonknuthmode\setcatcodetable\txtcatcodes} +% +% \def\stoprelaxedcatcodes +% {\ifcase\relaxedcatcodedepth +% % error +% \or +% \setcatcodetable\relaxedcatcodeparent +% \global\relaxedcatcodedepth\zerocount +% \else +% \global\advance\relaxedcatcodedepth\minusone +% \setcatcodetable\txtcatcodes +% \fi} +% +% \starttext +% +% \startrelaxedcatcodes +% \startcomment test \stopcomment +% test $ test 10% whatever|test \mathematics{x^2=1} +% \stoprelaxedcatcodes +% +% $x^2=1$ +% +% \stoptext diff --git a/tex/context/base/catc-sym.tex b/tex/context/base/catc-sym.tex index 49d94815c..da6c9c068 100644 --- a/tex/context/base/catc-sym.tex +++ b/tex/context/base/catc-sym.tex @@ -115,4 +115,73 @@ \egroup +%D (Inspired by a discussion on the \CONTEXT\ mailing list) +%D +%D In \TEX\ each character can have one of 16 catcodes. This way the +%D backslash, dollar, ampersand, hash and some more characters get +%D their special meaning. If you want to process tokens under a +%D certain catcode regime, passing arguments can interfere badly. +%D +%D \startbuffer[a] +%D \def\whatever#1{[#1]} +%D \whatever{whatever \type {\whatever{you want}} $or$ not!} +%D \stopbuffer +%D +%D \typebuffer[a] +%D +%D Here we pass an argument to \type {\whatever} but part of that +%D argument is to be processed under a different catcode regime, i.e.\ +%D all characters that need to be typeset verbatim need to get +%D the catcode that makes it a letter. This is what we get when we typeset +%D the text verbatim: +%D +%D \starttyping +%D whatever \type {\whatever{you want}} $or$ not! +%D \stoptyping +%D +%D However, when passed to \type {\whatever} we get: +%D +%D \getbuffer[a] +%D +%D In \ETEX\ one can use \type {\scantokens} to circumvent this problem. +%D +%D \startbuffer[b] +%D \def\rescan#1{\scantokens{#1}} +%D \def\whatever#1{[\rescan{#1}]} +%D \whatever{whatever \type {\whatever{you want}} $or$ not!} +%D \stopbuffer +%D +%D \getbuffer[b] \typebuffer[b] +%D +%D This time the \type {\whatever} call gives: +%D +%D \getbuffer[b] +%D +%D In this example, two spaces have crept in. The first one, after the +%D macro name, is inserted by \TEX\ and cannot be avoided. The last space +%D is inserted by \type {\scantokens}, and is the consequence of the fact +%D that this macro mimics reading from a file. You can avoid the last +%D space by a slightly different definition: +%D +%D \startbuffer[c] +%D \def\rescan#1{\scantokens{#1\ignorespaces}} +%D \def\whatever#1{[\rescan{#1}]} +%D \whatever{whatever \type {\whatever{you want}} $or$ not!} +%D \stopbuffer +%D +%D \typebuffer[c] +%D +%D Unfortunately we still keep the first space, but at least it's better than +%D a failure: +%D +%D \getbuffer[c] + +\long\def\rescan#1{\scantokens{#1\ignorespaces}} +\long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantokens{#2\ignorespaces}\endgroup} + +\ifx\scantextokens\undefined \else + \long\def\rescan#1{\scantextokens{#1}} + \long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantextokens{#2}\endgroup} +\fi + \protect \endinput diff --git a/tex/context/base/colo-ext.mkiv b/tex/context/base/colo-ext.mkiv index 06facd34e..274086bb6 100644 --- a/tex/context/base/colo-ext.mkiv +++ b/tex/context/base/colo-ext.mkiv @@ -32,7 +32,7 @@ \def\negatecolorbox#1% {\setbox#1\hbox {\dostartnegative - \localstartcolor[white]\vrule\!!height\ht#1\!!depth\dp#1\!!width\wd#1\localstopcolor + \startcolor[white]\vrule\!!height\ht#1\!!depth\dp#1\!!width\wd#1\stopcolor \hskip-\wd#1% \box#1% \dostopnegative}} diff --git a/tex/context/base/colo-hex.mkii b/tex/context/base/colo-hex.mkii index dac2e46d0..7cef6e8a2 100644 --- a/tex/context/base/colo-hex.mkii +++ b/tex/context/base/colo-hex.mkii @@ -38,7 +38,17 @@ \unprotect -\newdimen\hexcolorfraction \hexcolorfraction=\dimexpr(1pt/256) +% \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=`# @@ -49,7 +59,7 @@ \def\hexcolorcomponent#1#2% {\ifnum\dohexstringtonumber#1#2=\zerocount0\else\ifnum\dohexstringtonumber#1#2=\plusone1\else - \expandafter\withoutpt\the\dimexpr(\dohexstringtonumber#1#2\hexcolorfraction)% + \expandafter\withoutpt\the\dimexpr\dohexstringtonumber#1#2\hexcolorfraction\relax \fi\fi} \def\dohexcolorspec#1#2#3#4#5#6#7#8\relax @@ -98,7 +108,7 @@ \def\colorhexcomponent#1% {\ifdim#1\points<.005\points - 00\else\lchexnumbers{\the\dimexpr(255\dimexpr(#1\points)\relax+.5\points)\relax}% + 00\else\lchexnumbers{\the\dimexpr255\dimexpr#1\points\relax+.5\points\relax}% \fi} % the faster one @@ -109,7 +119,7 @@ \def\colorhexcomponent#1% {\ifdim#1\points<\hex@color@a - 00\else\lchexnumbers{\the\dimexpr(#1\points*\hex@color@c+\hex@color@b)\relax}% + 00\else\lchexnumbers{\the\dimexpr#1\points*\hex@color@c+\hex@color@b\relax}% \fi} \protect \endinput diff --git a/tex/context/base/colo-hex.mkiv b/tex/context/base/colo-hex.mkiv index b31321b7e..dd8e03938 100644 --- a/tex/context/base/colo-hex.mkiv +++ b/tex/context/base/colo-hex.mkiv @@ -11,105 +11,16 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D Not yet supported in \MKIV. +%D This is built in. -\endinput - -\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 +% \definecolor[rgbtestcolor] [r=0.87843,g=0.87451,b=0.89020] % RGB(224,223,227) +% \definecolor[hextestcolor] [\letterhash E0DFE3] % or [h=E0DFE3] % -% test \color[thehexcolor]{rood} -% test \color[red]{rood} -% test \color[\testcolor]{rood} -% -% \stoptext - -\unprotect - -\newdimen\hexcolorfraction \hexcolorfraction=\dimexpr1pt/256\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)% - \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} +% \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 -\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\dimexpr(255\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 +\endinput diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua index 4a188eba8..befac2452 100644 --- a/tex/context/base/colo-ini.lua +++ b/tex/context/base/colo-ini.lua @@ -6,26 +6,15 @@ if not modules then modules = { } end modules ['colo-ini'] = { license = "see context related readme files" } --- split_settings -> aux.settings_to_hash - --- for the moment this looks messy but we're waiting for a pdf backend interface --- --- code collected here will move and be adapted --- --- some pdf related code can go away - --- spec-pdf.lua - --- todo: %s -> %f - +local concat = table.concat +local format, gmatch, gsub, lower, match = string.format, string.gmatch, string.gsub, string.lower, string.match local texsprint = tex.sprint -local concat =table.concat -local format, gmatch, gsub, lower = string.format, string.gmatch, string.gsub, string.lower +local ctxcatcodes = tex.ctxcatcodes -ctx = ctx or { } -ctx.aux = ctx.aux or { } +local settings_to_hash_strict = aux.settings_to_hash_strict -local ctxcatcodes = tex.ctxcatcodes +colors = colors or { } +transparencies = transparencies or { } local registrations = backends.registrations @@ -60,7 +49,7 @@ local r_l_t_template = "\\localundefine{(ta:%s)}" .. local r_g_t_template = "\\globalundefine{(ta:%s)}" .. "\\globalundefine{(ts:%s)}" -function ctx.aux.definecolor(name, ca, global) +local function definecolor(name, ca, global) if ca and ca > 0 then if global then texsprint(ctxcatcodes,format(a_g_c_template, name, ca, name, ca)) @@ -75,7 +64,7 @@ function ctx.aux.definecolor(name, ca, global) end end end -function ctx.aux.inheritcolor(name, ca, global) +local function inheritcolor(name, ca, global) if ca and ca ~= "" then if global then texsprint(ctxcatcodes,format(f_g_c_template, name, ca, name, ca)) @@ -90,7 +79,7 @@ function ctx.aux.inheritcolor(name, ca, global) end end end -function ctx.aux.definetransparent(name, ta, global) +local function definetransparent(name, ta, global) if ta and ta > 0 then if global then texsprint(ctxcatcodes,format(a_g_t_template, name, ta, name, ta)) @@ -105,7 +94,7 @@ function ctx.aux.definetransparent(name, ta, global) end end end -function ctx.aux.inherittransparent(name, ta, global) +local function inherittransparent(name, ta, global) if ta and ta ~= "" then if global then texsprint(ctxcatcodes,format(f_g_t_template, name, ta, name, ta)) @@ -139,17 +128,17 @@ local transparent = { -- By coupling we are downward compatible. When we decouple we need to do more tricky -- housekeeping (e.g. persist color independent transparencies when color bound ones --- are nil. +-- are nil.) -ctx.couplecolors = true +colors.couple = true -function ctx.definetransparency(name,n) +function colors.definetransparency(name,n) transparent[name] = n end local registered = { } -local function registerspotcolor(parent,name,parentnumber,e,f,d,p) +local function do_registerspotcolor(parent,name,parentnumber,e,f,d,p) if not registered[parentnumber] then local v = colors.values[parentnumber] if v then @@ -170,7 +159,7 @@ local function registerspotcolor(parent,name,parentnumber,e,f,d,p) end end -local function registermultitonecolor(parent,name,parentnumber,e,f,d,p) -- same as spot but different template +local function do_registermultitonecolor(parent,name,parentnumber,e,f,d,p) -- same as spot but different template if not registered[parentnumber] then local v = colors.values[parentnumber] if v then @@ -188,41 +177,42 @@ local function registermultitonecolor(parent,name,parentnumber,e,f,d,p) -- same end end -function ctx.definesimplegray(name,s) +function colors.definesimplegray(name,s) return colors.register('color',name,'gray',s) -- we still need to get rid of 'color' end -function ctx.defineprocesscolor(name,str,global,freeze) -- still inconsistent color vs transparent - local t = str:split_settings() +function colors.defineprocesscolor(name,str,global,freeze) -- still inconsistent color vs transparent + local r = match(str,"^#(.+)$") -- for old times sake (if we need to feed from xml or so) + local t = (r and { h = r }) or settings_to_hash_strict(str) if t then if t.h then - local r, g, b = (t.h .. "000000"):match("(..)(..)(..)") - ctx.aux.definecolor(name, colors.register('color',name,'rgb',(tonumber(r,16) or 0)/256,(tonumber(g,16) or 0)/256,(tonumber(b,16) or 0)/256 ), global) + local r, g, b = match(t.h .. "000000","(..)(..)(..)") -- watch the 255 + definecolor(name, colors.register('color',name,'rgb',(tonumber(r,16) or 0)/255,(tonumber(g,16) or 0)/255,(tonumber(b,16) or 0)/255 ), global) elseif t.r or t.g or t.b then - ctx.aux.definecolor(name, colors.register('color',name,'rgb', tonumber(t.r) or 0, tonumber(t.g) or 0, tonumber(t.b) or 0 ), global) + definecolor(name, colors.register('color',name,'rgb', tonumber(t.r) or 0, tonumber(t.g) or 0, tonumber(t.b) or 0 ), global) elseif t.c or t.m or t.y or t.k then - ctx.aux.definecolor(name, colors.register('color',name,'cmyk',tonumber(t.c) or 0, tonumber(t.m) or 0, tonumber(t.y) or 0, tonumber(t.k) or 0), global) + definecolor(name, colors.register('color',name,'cmyk',tonumber(t.c) or 0, tonumber(t.m) or 0, tonumber(t.y) or 0, tonumber(t.k) or 0), global) else - ctx.aux.definecolor(name, colors.register('color',name,'gray',tonumber(t.s) or 0), global) + definecolor(name, colors.register('color',name,'gray',tonumber(t.s) or 0), global) end if t.a and t.t then - ctx.aux.definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global) - elseif ctx.couplecolors then - -- ctx.aux.definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up - ctx.aux.definetransparent(name, 0, global) -- can be sped up + definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global) + elseif colors.couple then + -- definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up + definetransparent(name, 0, global) -- can be sped up end elseif freeze then local ca = attributes.list[a_color] [str] local ta = attributes.list[a_transparency][str] if ca then - ctx.aux.definecolor(name, ca, global) + definecolor(name, ca, global) end if ta then - ctx.aux.definetransparent(name, ta, global) + definetransparent(name, ta, global) end else - ctx.aux.inheritcolor(name, str, global) - ctx.aux.inherittransparent(name, str, global) + inheritcolor(name, str, global) + inherittransparent(name, str, global) -- if global and str ~= "" then -- For Peter Rolf who wants access to the numbers in Lua. (Currently only global is supported.) -- attributes.list[a_color] [name] = attributes.list[a_color] [str] or attributes.unsetvalue -- reset -- attributes.list[a_transparency][name] = attributes.list[a_transparency][str] or attributes.unsetvalue @@ -230,28 +220,28 @@ function ctx.defineprocesscolor(name,str,global,freeze) -- still inconsistent co end end -function ctx.isblack(ca) -- maybe commands +function colors.isblack(ca) -- maybe commands local cv = ca > 0 and colors.value(ca) return (cv and cv[2] == 0) or false end -function ctx.definespotcolor(name,parent,str,global) +function colors.definespotcolor(name,parent,str,global) if parent == "" or parent:find("=") then - ctx.registerspotcolor(name, parent) + colors.registerspotcolor(name, parent) elseif name ~= parent then local cp = attributes.list[a_color][parent] if cp then - local t = str:split_settings() + local t = settings_to_hash_strict(str) if t then t.p = tonumber(t.p) or 1 - registerspotcolor(parent, name, cp, t.e, 1, "", t.p) -- p not really needed, only diagnostics + do_registerspotcolor(parent, name, cp, t.e, 1, "", t.p) -- p not really needed, only diagnostics if name and name ~= "" then - ctx.aux.definecolor(name, colors.register('color',name,'spot', parent, 1, "", t.p), true) + definecolor(name, colors.register('color',name,'spot', parent, 1, "", t.p), true) if t.a and t.t then - ctx.aux.definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global) - elseif ctx.couplecolors then - --~ ctx.aux.definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up - ctx.aux.definetransparent(name, 0, global) -- can be sped up + definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global) + elseif colors.couple then + --~ definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up + definetransparent(name, 0, global) -- can be sped up end end end @@ -259,49 +249,49 @@ function ctx.definespotcolor(name,parent,str,global) end end -function ctx.registerspotcolor(parent, str) +function colors.registerspotcolor(parent, str) local cp = attributes.list[a_color][parent] if cp then local e = "" if str then - local t = str:split_settings() + local t = settings_to_hash_strict(str) e = (t and t.e) or "" end - registerspotcolor(parent, "dummy", cp, e, 1, "", 1) -- p not really needed, only diagnostics + do_registerspotcolor(parent, "dummy", cp, e, 1, "", 1) -- p not really needed, only diagnostics end end -function ctx.definemultitonecolor(name,multispec,colorspec,selfspec) +function colors.definemultitonecolor(name,multispec,colorspec,selfspec) local dd, pp, nn = { }, { }, { } for k,v in gmatch(multispec,"(%a+)=([^%,]*)") do dd[#dd+1] = k pp[#pp+1] = v nn[#nn+1] = k - nn[#nn+1] = format("%1.3g",tonumber(v)) + nn[#nn+1] = format("%1.3g",tonumber(v) or 0) -- 0 can't happen end --~ v = tonumber(v) * p local nof = #dd if nof > 0 then dd, pp, nn = concat(dd,','), concat(pp,','), concat(nn,'_') local parent = gsub(lower(nn),"[^%d%a%.]+","_") - ctx.defineprocesscolor(parent,colorspec..","..selfspec,true,true) + colors.defineprocesscolor(parent,colorspec..","..selfspec,true,true) local cp = attributes.list[a_color][parent] if cp then - registerspotcolor (parent, name, cp, "", nof, dd, pp) - registermultitonecolor(parent, name, cp, "", nof, dd, pp) - ctx.aux.definecolor(name, colors.register('color', name, 'spot', parent, nof, dd, pp), true) - local t = selfspec:split_settings() + do_registerspotcolor(parent, name, cp, "", nof, dd, pp) + do_registermultitonecolor(parent, name, cp, "", nof, dd, pp) + definecolor(name, colors.register('color', name, 'spot', parent, nof, dd, pp), true) + local t = settings_to_hash_strict(selfspec) if t and t.a and t.t then - ctx.aux.definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global) - elseif ctx.couplecolors then - -- ctx.aux.definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up - ctx.aux.definetransparent(name, 0, global) -- can be sped up + definetransparent(name, transparencies.register(name,transparent[t.a] or tonumber(t.a) or 1,tonumber(t.t) or 1), global) + elseif colors.couple then + -- definetransparent(name, transparencies.register(nil, 1, 1), global) -- can be sped up + definetransparent(name, 0, global) -- can be sped up end end end end -function ctx.mpcolor(model,ca,ta,default) +function colors.mp(model,ca,ta,default) local cv = colors.value(ca) -- faster when direct colors.values[ca] if cv then local tv = transparencies.value(ta) @@ -335,7 +325,7 @@ function ctx.mpcolor(model,ca,ta,default) end end -function ctx.formatcolor(ca,separator) +function colors.formatcolor(ca,separator) local cv = colors.value(ca) if cv then local c, f, t, model = { }, 13, 13, cv[1] @@ -355,12 +345,12 @@ function ctx.formatcolor(ca,separator) end end -function ctx.formatgray(ca,separator) +function colors.formatgray(ca,separator) local cv = colors.value(ca) return format("%0.3f",(cv and cv[2]) or 0) end -function ctx.colorcomponents(ca) +function colors.colorcomponents(ca) local cv = colors.value(ca) if cv then local model = cv[1] @@ -380,7 +370,7 @@ function ctx.colorcomponents(ca) end end -function ctx.transparencycomponents(ta) +function colors.transparencycomponents(ta) local tv = transparencies.value(ta) if tv then return format("a=%1.3f t=%1.3f",tv[1],tv[2]) @@ -389,153 +379,29 @@ function ctx.transparencycomponents(ta) end end -function ctx.pdfcolor(model,ca,default) -- todo: use gray when no color - local cv = colors.value(ca) - if cv then - if model == 1 then - model = cv[1] - end - if model == 2 then - local s = cv[2] - return format("%s g %s G",s,s) - elseif model == 3 then - local r, g, b = cv[3], cv[4], cv[5] - return format("%s %s %s rg %s %s %s RG",r,g,b,r,g,b) - elseif model == 4 then - local c, m, y, k = cv[6],cv[7],cv[8],cv[9] - return format("%s %s %s %s k %s %s %s %s K",c,m,y,k,c,m,y,k) - else - local n,f,d,p = cv[10],cv[11],cv[12],cv[13] - if type(p) == "string" then - p = gsub(p,","," ") -- brr misuse of spot - end - return format("/%s cs /%s CS %s SCN %s scn",n,n,p,p) - end - else - return format("%s g %s G",default or 0,default or 0) - end -end - -function ctx.pdfcolorvalue(model,ca,default) - local cv = colors.value(ca) - if cv then - if model == 1 then - model = cv[1] - end - if model == 2 then - return format("%s",cv[2]) - elseif model == 3 then - return format("%s %s %s",cv[3],cv[4],cv[5]) - elseif model == 4 then - return format("%s %s %s %s",cv[6],cv[7],cv[8],cv[9]) - else - return format("%s",cv[13]) - end - else - return format("%s",default or 0) - end -end - -function ctx.fdfcolor(model,ca,default) - local cv = colors.value(ca) - if cv then - if model == 1 then - model = cv[1] - end - if model == 2 then - return format("[%s]",cv[2]) - elseif model == 3 then - return format("[%s %s %s]",cv[3],cv[4],cv[5]) - elseif model == 4 then - return format("[%s %s %s %s]",cv[6],cv[7],cv[8],cv[9]) - elseif model == 4 then - return format("[%s]",cv[13]) - end - else - return format("[%s]",default or 0) - end -end - -function ctx.pdfcolorspace(model,ca) - local cv = colors.value(ca) - if cv then - if model == 1 then - model = cv[1] - end - if model == 2 then - return "DeviceGray" - elseif model == 3 then - return "DeviceRGB" - elseif model == 4 then - return "DeviceCMYK" - end +function colors.spotcolorname(ca,default) + local cv, v = colors.value(ca), "unknown" + if cv and cv[1] == 5 then + v = cv[10] end - return "DeviceGRAY" + return tostring(v) end -function ctx.spotcolorname(ca,default) +function colors.spotcolorparent(ca,default) local cv, v = colors.value(ca), "unknown" if cv and cv[1] == 5 then - v = cv[10] + v = cv[12] + if v == "" then + v = cv[10] + end end return tostring(v) end -function ctx.spotcolorvalue(ca,default) +function colors.spotcolorvalue(ca,default) local cv, v = colors.value(ca), 0 if cv and cv[1] == 5 then v = cv[13] end return tostring(v) end - --- unfortunately we have \cs's here but this will go anyway once we have mplib and such - -function ctx.resolvempgraycolor(csa,csb,model,s) - local ca = colors.register('color',nil,'gray',s) - texsprint(ctxcatcodes,format("\\setxvalue{%s}{%s}",csa,ctx.pdfcolorvalue(model,ca))) - texsprint(ctxcatcodes,format("\\setxvalue{%s}{%s}",csb,ctx.pdfcolorspace(model,ca))) -end -function ctx.resolvemprgbcolor(csa,csb,model,r,g,b) - local ca = colors.register('color',nil,'rgb',r,g,b) - texsprint(ctxcatcodes,format("\\setxvalue{%s}{%s}",csa,ctx.pdfcolorvalue(model,ca))) - texsprint(ctxcatcodes,format("\\setxvalue{%s}{%s}",csb,ctx.pdfcolorspace(model,ca))) -end -function ctx.resolvempcmykcolor(csa,csb,model,c,m,y,k) - local ca = colors.register('color',nil,'cmyk',c,m,y,k) - texsprint(ctxcatcodes,format("\\setxvalue{%s}{%s}",csa,ctx.pdfcolorvalue(model,ca))) - texsprint(ctxcatcodes,format("\\setxvalue{%s}{%s}",csb,ctx.pdfcolorspace(model,ca))) -end -function ctx.resolvempspotcolor(csa,csb,model,n,f,d,p) - local ca = colors.register('color',nil,'spot',n,f,d,p) - texsprint(ctxcatcodes,format("\\setxvalue{%s}{%s}",csa,ctx.pdfcolorvalue(model,ca))) - texsprint(ctxcatcodes,format("\\setxvalue{%s}{%s}",csb,ctx.pdfcolorspace(model,ca))) -end - --- literals needed to inject code in the mp stream, we cannot use attributes there --- since literals may have qQ's, much may go away once we have mplib code in place - -local intransparency = false - -function ctx.pdfrgbliteral(model,r,g,b) - texsprint(ctxcatcodes,format("\\pdfliteral{%s}",ctx.pdfcolor(model,colors.register('color',nil,'rgb',r,g,b)))) -end -function ctx.pdfcmykliteral(model,c,m,y,k) - texsprint(ctxcatcodes,format("\\pdfliteral{%s}",ctx.pdfcolor(model,colors.register('color',nil,'cmyk',c,m,y,k)))) -end -function ctx.pdfgrayliteral(model,s) - texsprint(ctxcatcodes,format("\\pdfliteral{%s}",ctx.pdfcolor(model,colors.register('color',nil,'gray',s)))) -end -function ctx.pdfspotliteral(model,n,f,d,p) - texsprint(ctxcatcodes,format("\\pdfliteral{%s}",ctx.pdfcolor(model,colors.register('color',nil,'spot',n,f,d,p)))) -- incorrect -end -function ctx.pdftransparencyliteral(a,t) - intransparency = true - texsprint(ctxcatcodes,format("\\pdfliteral{/Tr%s gs}",transparencies.register(nil,a,t))) -end -function ctx.pdffinishtransparency() - if intransparency then - intransparency = false - texsprint(ctxcatcodes,"\\pdfliteral{/Tr0 gs}") -- we happen to know this -) - end -end diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv index 197a69ba6..197cbcdca 100644 --- a/tex/context/base/colo-ini.mkiv +++ b/tex/context/base/colo-ini.mkiv @@ -20,6 +20,7 @@ %D different approach, this module only implements a few generic mechanisms. \registerctxluafile{colo-ini}{1.000} +\registerctxluafile{lpdf-col}{1.000} \unprotect @@ -80,7 +81,6 @@ \newif\iffreezecolors \freezecolorsfalse \newif\ifincolor % true if colors enabled -\newif\iflocalcolor \let\colorlist \empty \let\currentspotcolor \empty @@ -122,8 +122,6 @@ %D \macros %D {startcolor,stopcolor, %D faststartcolor,faststopcolor, -%D localstartcolor,localstopcolor, -%D localstartraster,localstopraster, %D startraster,stopraster,raster, %D color,graycolor} %D @@ -162,13 +160,7 @@ \def\faststopcolor {} \unexpanded\def\dosetcolorattribute#1#2{\ifcsname#1#2\endcsname\doactivatecolor{\csname#1#2\endcsname}\fi} -\let\localstartcolor \startcolor -\let\localstopcolor \stopcolor -\let\globalstartcolor\startcolor -\let\globalstopcolor \stopcolor -\let\localstartraster\startraster -\let\localstopraster \stopraster -\let\grey \graycolor +\let\grey\graycolor %D \macros %D {startcurrentcolor,stopcurrentcolor} @@ -211,8 +203,8 @@ {\makeshortfilename[\truefilename{\f!colorprefix#1}]% \startreadingfile \readsysfile\shortfilename - {\showmessage\m!colors4\colorstyle} - {\showmessage\m!colors5\colorstyle}% + {\showcolormessage\m!colors4\colorstyle} + {\showcolormessage\m!colors5\colorstyle}% \stopreadingfile} \let\usecolors\setupcolor @@ -262,6 +254,8 @@ \setsystemmode{\v!color\colorsplitsuffix}% \iffilterspotcolor \let\@@clrgb\v!no \fi} +\let\showcolormessage\gobblethreearguments + \def\dosetupcolors[#1]% some no longer make sense in MkIV {\getparameters[\??cl][#1]% \doifelse\@@clspot\v!yes @@ -283,17 +277,17 @@ \weightGRAYfalse \weightGRAYtrue \doifelse\@@clrgb\v!no - {\ifRGBsupported \ifproductionrun\showmessage\m!colors {9}\v!rgb \fi\RGBsupportedfalse \fi} - {\ifRGBsupported \else\ifproductionrun\showmessage\m!colors{10}\v!rgb \fi\RGBsupportedtrue \fi}% + {\ifRGBsupported \showcolormessage\m!colors {9}\v!rgb \RGBsupportedfalse \fi} + {\ifRGBsupported \else\showcolormessage\m!colors{10}\v!rgb \RGBsupportedtrue \fi}% \doifelse\@@clcmyk\v!no - {\ifCMYKsupported \ifproductionrun\showmessage\m!colors {9}\v!cmyk \fi\CMYKsupportedfalse\fi} - {\ifCMYKsupported\else\ifproductionrun\showmessage\m!colors{10}\v!cmyk \fi\CMYKsupportedtrue \fi}% + {\ifCMYKsupported \showcolormessage\m!colors {9}\v!cmyk \CMYKsupportedfalse\fi} + {\ifCMYKsupported\else\showcolormessage\m!colors{10}\v!cmyk \CMYKsupportedtrue \fi}% \doifelse\@@clmpcmyk\v!no - {\ifMPcmykcolors \ifproductionrun\showmessage\m!colors {9}{\v!mp\v!cmyk}\fi\MPcmykcolorsfalse \fi} - {\ifMPcmykcolors \else\ifproductionrun\showmessage\m!colors{10}{\v!mp\v!cmyk}\fi\MPcmykcolorstrue \fi}% + {\ifMPcmykcolors \showcolormessage\m!colors {9}{\v!mp\v!cmyk}\MPcmykcolorsfalse \fi} + {\ifMPcmykcolors \else\showcolormessage\m!colors{10}{\v!mp\v!cmyk}\MPcmykcolorstrue \fi}% \doifelse\@@clmpspot\v!no - {\ifMPspotcolors \ifproductionrun\showmessage\m!colors {9}{\v!mp\v!spot}\fi\MPspotcolorsfalse \fi} - {\ifMPspotcolors \else\ifproductionrun\showmessage\m!colors{10}{\v!mp\v!spot}\fi\MPspotcolorstrue \fi}% + {\ifMPspotcolors \showcolormessage\m!colors {9}{\v!mp\v!spot}\MPspotcolorsfalse \fi} + {\ifMPspotcolors \else\showcolormessage\m!colors{10}{\v!mp\v!spot}\MPspotcolorstrue \fi}% \preferGRAYfalse \processaction [\@@clconversion] @@ -310,23 +304,15 @@ \reduceMPcolorstrue \fi \else - \ifconverttoGRAY\else\showmessage\m!colors{11}\empty\fi + \ifconverttoGRAY\else\showcolormessage\m!colors{11}\empty\fi \converttoGRAYtrue \forcegrayMPcolorstrue \convertMPcolorsfalse \reduceMPcolorsfalse \fi\fi - \processaction - [\@@clstate] - [ \v!global=>\ifincolor\else\showmessage\m!colors1\colorstyle\fi - \incolortrue\localcolorfalse, - \v!local=>\ifincolor\else\showmessage\m!colors2\colorstyle\fi - \incolortrue\localcolortrue, - \v!start=>\ifincolor\else\showmessage\m!colors1\colorstyle\fi - \incolortrue\localcolorfalse - \let\@@clstate\v!global, - \v!stop=>\incolorfalse\localcolorfalse - \forcegrayMPcolorstrue]% + \doifelse\@@clstate\v!stop + {\incolorfalse\forcegrayMPcolorstrue}% + {\ifincolor\else\showcolormessage\m!colors1\colorstyle\fi\incolortrue\let\@@clstate\v!start}% \dosetupcolormodel \initializemaintextcolor} @@ -400,7 +386,7 @@ \def\dodefinepalet[#1][#2]% {\doifassignmentelse{#2} - {%\showmessage\m!colors6{#1}% + {%\showcolormessage\m!colors6{#1}% \letvalue{\??pa#1}\empty \setevalue{\??pa\??pa#1}{#2}% \def\dodododefinepalet[##1=##2]% @@ -448,7 +434,7 @@ \else\ifcsname\??pa\currentpalet\endcsname \edef\currentpalet{#1:}% \else - \showmessage\m!colors7\currentpalet + \showcolormessage\m!colors7\currentpalet \let\currentpalet\empty \fi\fi} @@ -695,11 +681,6 @@ \def\MPcolor#1{(0,0,0)} \fi -%D \macros -%D {PDFcolor,FDFcolor} -%D -%D Similar alternatives are avaliable for \PDF: - %D For the moment we keep the next downward compatibility %D switch, i.e.\ expanded colors. However, predefined colors %D and palets are no longer expanded (which is what I wanted @@ -791,7 +772,7 @@ \ifx\currentcolormodel\undefined \newcount\currentcolormodel \fi \def\setcolormodel#1% - {\showmessage\m!colors1{#1}% + {\showcolormessage\m!colors1{#1}% \currentcolormodel\ctxlua{tex.print(colors.setmodel('colormodel','#1',\ifweightGRAY true\else false\fi))}% \dosetattribute{colormodel}{\the\currentcolormodel}} @@ -859,8 +840,8 @@ \def\deactivatecolor {\let\currentcolorname\s!black - \doresetattribute\s!color - \doresetattribute\s!transparency} + \attribute\colorattribute\attributeunsetvalue + \attribute\transparencyattribute\attributeunsetvalue} \def\dodefinecolorcommand#1#2% {\unexpanded#1{#2}{\doactivatecolor{#2}}} @@ -869,41 +850,41 @@ \setfalse\collectcolorsinlist \def\collectcolorinlist#1{\doglobal\addtocommalist{#1}\colorlist} -\def\doregistercolor#1#2{\ctxlua{ctx.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}} +\def\doregistercolor#1#2{\ctxlua{colors.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}} \def\dodefinecolor[#1][#2]% {\ifconditional\collectcolorsinlist\collectcolorinlist{#1}\fi - \ctxlua{ctx.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}% + \ctxlua{colors.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}% \dodefinecolorcommand\setvalue{#1}} \def\dodefineglobalcolor[#1][#2]% {\ifconditional\collectcolorsinlist\collectcolorinlist{#1}\fi - \ctxlua{ctx.defineprocesscolor("#1","#2",true,\iffreezecolors true\else false\fi)}% + \ctxlua{colors.defineprocesscolor("#1","#2",true,\iffreezecolors true\else false\fi)}% \dodefinecolorcommand\setgvalue{#1}} \def\dodefinenamedcolor[#1][#2]% {\ifconditional\collectcolorsinlist\collectcolorinlist{#1}\fi - \ctxlua{ctx.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}% + \ctxlua{colors.defineprocesscolor("#1","#2",false,\iffreezecolors true\else false\fi)}% \dodefinecolorcommand\setvalue{#1}} \def\dodefinespotcolor[#1][#2][#3]% {\ifconditional\collectcolorsinlist\collectcolorinlist{#1}\fi - \ctxlua{ctx.definespotcolor("#1","#2","#3",true)}% + \ctxlua{colors.definespotcolor("#1","#2","#3",true)}% \dodefinecolorcommand\setxvalue{#1}} \def\dodefinemultitonecolor[#1][#2][#3][#4]% - {\ctxlua{ctx.definemultitonecolor("#1","#2","#3","#4",true)}% + {\ctxlua{colors.definemultitonecolor("#1","#2","#3","#4",true)}% \dodefinecolorcommand\setxvalue{#1}} \def\dodefinetransparency[#1][#2]% - {\ctxlua{ctx.definetransparency("#1",#2)}} + {\ctxlua{colors.definetransparency("#1",#2)}} \def\dosetrastercolor#1% slow, we need a fast one {\edef\@@rastervalue{#1}% \ifx\@@rastervalue\empty \let\@@rastervalue\@@rsscreen \fi - \dosetattribute\s!color{\ctxlua{tex.sprint(ctx.definesimplegray("_raster_",\@@rastervalue))}}} + \dosetattribute\s!color{\ctxlua{tex.sprint(colors.definesimplegray("_raster_",\@@rastervalue))}}} %D \macros %D {doifcolorelse, doifcolor} @@ -936,7 +917,7 @@ %D A bit like \type {\definedfont}: \unexpanded\def\colored[#1]% - {\ctxlua{ctx.defineprocesscolor("@colored@","#1",false,false)}% + {\ctxlua{colors.defineprocesscolor("@colored@","#1",false,false)}% \groupedcommand{\doactivatecolor{@colored@}}{}} %D \macros @@ -965,37 +946,15 @@ %D \stopregistercolor %D \stoptyping +% can be cleaned up + \let\maintextcolor \empty \def\defaulttextcolor {black} \def\@@themaintextcolor{themaintextcolor} -\def\startregistercolor[#1]% - {\doifelsenothing{#1} - {\let\stopregistercolor\relax} - {\edef\stopregistercolor - {\dosetattribute\s!color {\dogetattribute\s!color }% - \dosetattribute\s!transparency{\dogetattribute\s!transparency}}% - \doactivatecolor{#1}}} - -\let\resynccolor \relax % ? -\let\pushcolor \relax -\let\popcolor \relax -\let\popsplitcolor\relax - -\def\restorecolormode - {\ifincolor - \deactivatecolor - \ifx\maintextcolor\empty \else - \doactivatecolor\maintextcolor - \fi - \fi} - -\let\pushpostponedpagecolor\relax -\let\poppostponedpagecolor \relax - -\appendtoks\deactivatecolor\to\everybeforeoutput % maybe we don't need push pop now +\appendtoks\deactivatecolor\to\everybeforeoutput -\def\startregistercolor[#1]% +\def\startregistercolor[#1]% probably obsolete {\doifelsenothing{#1} {\let\stopregistercolor\relax} {\edef\stopregistercolor @@ -1024,10 +983,6 @@ \appendtoks \initializemaintextcolor \to \everyjob -\def\localstarttextcolor{\normalexpanded{\noexpand\startcolor[\ifx\maintextcolor\empty\defaulttextcolor\else\maintextcolor\fi]}} -\let\localstoptextcolor \stopcolor -\let\restoretextcolor \firstofoneargument - \def\dodefinepaletcolor#1#2#3% {\doifassignmentelse{#3}% \definepalet[test][xx={y=.4}] {\definecolor[\??pa#1:#2][#3]% @@ -1071,7 +1026,7 @@ \def\colorformatseparator{ } -\def\MPcolor#1{\ctxlua{tex.sprint(ctx.mpcolor(\number\currentcolormodel,\number\doinheritca{#1},\number\doinheritta{#1}))}} +\def\MPcolor#1{\ctxlua{tex.sprint(colors.mp(\number\currentcolormodel,\number\doinheritca{#1},\number\doinheritta{#1}))}} \let\currentcolorname\s!black % todo \let\outercolorname \s!black % todo @@ -1079,33 +1034,18 @@ \def\thecolorattribute #1{\number\csname(ca:\ifcsname(ca:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ca:#1)\endcsname#1\fi\fi)\endcsname} \def\thetransparencyattribute#1{\number\csname(ta:\ifcsname(ta:\currentpalet#1)\endcsname\currentpalet#1\else\ifcsname(ta:#1)\endcsname#1\fi\fi)\endcsname} -\def\PDFcolor #1{\ctxlua{tex.sprint(ctx.pdfcolor (\number\currentcolormodel, \thecolorattribute{#1}))}} -\def\PDFcolorvalue#1{\ctxlua{tex.sprint(ctx.pdfcolorvalue(\number\currentcolormodel, \thecolorattribute{#1}))}} -\def\FDFcolor #1{\ctxlua{tex.sprint(ctx.fdfcolor (\number\currentcolormodel, \thecolorattribute{#1}))}} - -\def\internalspotcolorname#1{\ctxlua{tex.sprint(ctx.spotcolorname (\thecolorattribute{#1}))}} -\def\internalspotcolorsize#1{\ctxlua{tex.sprint(ctx.spotcolorvalue(\thecolorattribute{#1}))}} - -\def\colorcomponents #1{\ctxlua{tex.sprint(ctx.colorcomponents (\thecolorattribute {#1}))}} -\def\transparencycomponents#1{\ctxlua{tex.sprint(ctx.transparencycomponents(\thetransparencyattribute{#1}))}} - -\def\colorvalue#1{\ctxlua{tex.sprint(ctx.formatcolor(\thecolorattribute{#1},"\colorformatseparator"))}} -\def\grayvalue #1{\ctxlua{tex.sprint(ctx.formatgray (\thecolorattribute{#1},"\colorformatseparator"))}} +\def\internalspotcolorname #1{\ctxlua{tex.sprint(colors.spotcolorname (\thecolorattribute{#1}))}} +\def\internalspotcolorparent#1{\ctxlua{tex.sprint(colors.spotcolorparent(\thecolorattribute{#1}))}} +\def\internalspotcolorsize #1{\ctxlua{tex.sprint(colors.spotcolorvalue (\thecolorattribute{#1}))}} -% \definecolor[foo][black] {\red red {\foo (\doifblackelse{foo}{YES}{NO} \doifdrawingblackelse{YES}{NO}) black} red} -% \definecolor[foo][green] {\red red {\foo (\doifblackelse{foo}{YES}{NO} \doifdrawingblackelse{YES}{NO}) green} red} +\def\colorcomponents #1{\ctxlua{tex.sprint(colors.colorcomponents (\thecolorattribute {#1}))}} +\def\transparencycomponents#1{\ctxlua{tex.sprint(colors.transparencycomponents(\thetransparencyattribute{#1}))}} -\def\doifblackelse #1{\ctxlua{commands.doifelse(ctx.isblack(\thecolorattribute{#1}))}} -\def\doifdrawingblackelse {\ctxlua{commands.doifelse(ctx.isblack(tex.attribute[attributes.numbers['color']]))}} +\def\colorvalue#1{\ctxlua{tex.sprint(colors.formatcolor(\thecolorattribute{#1},"\colorformatseparator"))}} +\def\grayvalue #1{\ctxlua{tex.sprint(colors.formatgray (\thecolorattribute{#1},"\colorformatseparator"))}} -% hack, till we have adapted backend: (move it there) - -\def\presetPDFtransparencybynumber#1#2#3% - {\initializetransparency - \ifcase#1\else - \global\PDFcurrenttransparency\numexpr#1+\minusone\relax - \presetPDFtransparency{#2}{#3}% - \fi} +\def\doifblackelse #1{\ctxlua{commands.doifelse(colors.isblack(\thecolorattribute{#1}))}} +\def\doifdrawingblackelse {\ctxlua{commands.doifelse(colors.isblack(tex.attribute[attributes.numbers['color']]))}} %D \macros %D {forcecolorhack} @@ -1129,21 +1069,6 @@ \unexpanded\def\forcecolorhack{\leaders\hrule\normalhskip\zeropoint} -% \setupcolors[state=start] -% -% \starttext -% \defineglobalcolor[foo][black] {\red red {\foo black} red} -% \ctxlua{tex.print(ctx.aux.colorattribute("foo"))} -% \ctxlua{tex.print(ctx.aux.colorattribute("red"))} -% \ctxlua{tex.print(ctx.aux.colorattribute("green"))} -% \ctxlua{tex.print(ctx.aux.colorattribute("black"))} -% \definecolor[black][green] {\red red {\foo black} red} -% \ctxlua{tex.print(ctx.aux.colorattribute("foo"))} -% \ctxlua{tex.print(ctx.aux.colorattribute("red"))} -% \ctxlua{tex.print(ctx.aux.colorattribute("green"))} -% \ctxlua{tex.print(ctx.aux.colorattribute("black"))} -% \stoptext - %D We default to the colors defined in \module{colo-rgb} and %D support both \cap{RGB} and \cap{CMYK} output. As you can %D see, color support is turned off by default. Reduction of @@ -1170,6 +1095,10 @@ \setupcolors[\c!state=\v!start]% later direct \to \everyjob +\appendtoks + \let\showcolormessage\showmessage +\to \everyjob + \setupcolors [\c!state=\v!stop, % in mkii: \v!stop \c!conversion=\v!yes, diff --git a/tex/context/base/cont-log.tex b/tex/context/base/cont-log.tex index 27f3b1134..a22c1d2c4 100644 --- a/tex/context/base/cont-log.tex +++ b/tex/context/base/cont-log.tex @@ -292,4 +292,18 @@ \let\LUATEX \luaTeX \let\XETEX \XeTeX +\def\MkApproved + {\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}} + \protect \endinput diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index 6af6de4b6..8b5bed657 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -13,4 +13,7 @@ \enablemode[mkii] +\long\def\startluacode#1\stopluacode{} +\long\def\ctxlua #1{} + \endinput diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 9e2ca49c0..35b716ed4 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,19 +11,26 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% 2009-07-15 / vista sp 2 / 2.2G duo dell M90 precision: +% +% \dorecurse{10000}{test \page} % 300 pps +% \dorecurse {2000}{test \page} % 260 pps +% \dorecurse {300}{test \page} % 135 pps + % \ctxlua { fonts.define.method = 2 } % normally 3 \enablemode[mkiv] \setsystemmode{mkiv} -% there is more code here that is wise, but first we need to split -% more modules in mkii/mkiv - % potential new defaults: - +% % \setbreakpoints[compound] \unprotect +% % % % % % needs testing but saves runtime + +\let\checknotes\relax % probably not needed, checking already done + % we need to figure this out (to be discussed) \unexpanded\def\textminus @@ -46,82 +53,6 @@ % \def\pagedir{\expandafter\gobblethreearguments} % \def\bodydir{\expandafter\gobblethreearguments} -% we have to make an mkii/mkiv core-not - -\ifx\definestructurecounter\undefined - -\def\dochecknote % only to be called locally, some bools will become class-ones - {% for the moment no mixed text/endnotes modes, so we use - % \footnoteparameter and not \noteparameter (**) - \setnotedistance - \edef\notelocationasked{\noteparameter\c!location}% can be set - \count\currentnoteins\plusthousand - \expdoifcommonelse{\v!columns,\v!lastcolumn}\notelocationasked - {\chardef\clevernotes\plustwo} - {\expdoifinsetelse\v!firstcolumn\notelocationasked - {\chardef\clevernotes\plusone}% - {\chardef\clevernotes\zerocount}}% - \ifcase\clevernotes\relax - % notes not in column areas - \ifnum\noteparameter\c!n=\zerocount % no ifcase - \settextnotes - \scratchcounter\plusone - \else - \setcolumnnotes - \scratchcounter\noteparameter\c!n\relax - \divide\count\currentnoteins \scratchcounter - \fi - \global\endnotesfalse - \expdoifinsetelse\v!page\notelocationasked - {\expdoifinsetelse\v!high\notelocationasked - {\global\bottomnotesfalse} - {\global\bottomnotestrue}} - {\global\endnotestrue - \global\bottomnotestrue}% not: \postponenotes, else global - \else - % notes in column areas - \ifnum\@@kln=\zerocount % no ifcase / brrr dependency on \??kl - \scratchcounter\plusone - \else - \scratchcounter\footnoteparameter\c!n\relax % ** - \fi - \global\endnotesfalse - \global\bottomnotestrue - \setclevernotes - \fi - \doifsomething{\noteparameter\c!factor} - {\ifnum\noteparameter\c!factor<\zerocount\else - \count\currentnoteins\noteparameter\c!factor - \fi}% - \ifnotelimit - \dimen\currentnoteins\noteparameter\c!height - \multiply\dimen\currentnoteins \scratchcounter - \fi - \ifendnotes - \dimen\currentnoteins\maxdimen - \count\currentnoteins\zerocount - \skip \currentnoteins\zeropoint - \fi} - -\fi - -\ifx\clearmarks\undefined - \def\clearmarks {\begingroup\afterassignment\doclearmarks\scratchcounter} - \def\doclearmarks{\normalmarks\scratchcounter{}\endgroup} -\fi - -\ifx\@@trk\undefined \else - - \def\resetmark#1% we cannot use \normalmarks#1{} - {\global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount - \@EA\clearmarks\csname\@@prk\string#1\endcsname - \global\@EA\let\csname\@@trk\string#1\endcsname\empty - \global\@EA\let\csname\@@frk\string#1\endcsname\empty - \global\@EA\let\csname\@@brk\string#1\endcsname\empty - \global\@EA\let\csname\@@crk\string#1\endcsname\empty} - -\fi - %D Since this can be a showstopper, we report the path at the beginning %D as well as at the end of a run. @@ -169,12 +100,12 @@ % remapper.define('encoding','^qtm','^(.*)$','q-\letterpercent1') % } -\appendtoksonce \loadallXfontmapfiles \to \everyPDFxform -\appendtoksonce \loadallXfontmapfiles \to \everyPDFximage -\appendtoksonce \loadallXfontmapfiles \to \everystarttext -\appendtoksonce \loadallXfontmapfiles \to \everybeforepagebody +% \appendtoksonce \loadallXfontmapfiles \to \pdfbackendeveryximage +% \appendtoksonce \loadallXfontmapfiles \to \pdfbackendeveryxform +% \appendtoksonce \loadallXfontmapfiles \to \everystarttext +% \appendtoksonce \loadallXfontmapfiles \to \everybeforepagebody -\def\loadallXfontmapfiles{\ctxlua{fonts.map.flush("pdftex")}} +% \def\loadallXfontmapfiles{\ctxlua{fonts.map.flush("pdftex")}} % \ctxlua{ % do diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index 378eed523..9c729629c 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2009.06.13 14:03} +\newcontextversion{2009.07.17 13:16} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new @@ -28,8 +28,6 @@ % \font\f=dummyfont \rpcode\f0=500 \hbox{..}\char0 % todo: mp-new % caption: grid=top|bottom in xml defs - -\let\then\relax % \ifnum1>2\then -) \def\fastscale#1% {\begingroup @@ -74,35 +72,6 @@ \fi \relax} -% maybe to be integrated (option=...) - -\def\directexternalfigure - {\dodoubleempty\dodirectexternalfigure} - -\def\dodirectexternalfigure[#1][#2]% - {\bgroup - \getparameters[\??ef][\c!type=\splitofftype,\c!page=1,#2]% - \sanitizefilename#1\to\expandedfigurename - \splitfilename\expandedfigurename - \let\@@DriverImageWidth \!!zeropoint - \let\@@DriverImageHeight \!!zeropoint - \let\@@DriverImageFile \splitofffull - \let\@@DriverImageType \@@eftype - \let\@@DriverImageMethod \@@eftype - \let\@@DriverImageLabel \empty - \let\@@DriverImagePage \@@efpage - \doinsertfile - \egroup} - -% \directexternalfigure[cow.pdf] - -% normally one does not want this to happen nested, maybe there -% is more; non public vars btw, will become conditionals - -\ifx\writetoregisterfalse\undefined \else \appendtoks \writetoregisterfalse \to \everybeforeutilityread \fi -\ifx\writetolistfalse \undefined \else \appendtoks \writetolistfalse \to \everybeforeutilityread \fi -\ifx\notesenabledfalse \undefined \else \appendtoks \notesenabledfalse \to \everybeforeutilityread \fi - % \setuplabeltext[\s!itemcount1={{I(},{)}}] % \def\labeledcountervalue#1{\labeltexts{#1}{\countervalue{#1}}} @@ -213,132 +182,6 @@ % % \shapesynonym{eacute} -% \page[left] -% \definecolumntextarea[intro][left][x=1,y=1,nx=4,ny=20,state=start,background=introlayer] -% \setupcolumntextareatext[intro][left][\setups{intro}] -% \flushcolumntextareas - -\def\flushcolumntextareas - {\initializecolumntextareas - \setvsize} - -%D (Inspired by a discussion on the \CONTEXT\ mailing list) -%D -%D In \TEX\ each character can have one of 16 catcodes. This way the -%D backslash, dollar, ampersand, hash and some more characters get -%D their special meaning. If you want to process tokens under a -%D certain catcode regime, passing arguments can interfere badly. -%D -%D \startbuffer[a] -%D \def\whatever#1{[#1]} -%D \whatever{whatever \type {\whatever{you want}} $or$ not!} -%D \stopbuffer -%D -%D \typebuffer[a] -%D -%D Here we pass an argument to \type {\whatever} but part of that -%D argument is to be processed under a different catcode regime, i.e.\ -%D all characters that need to be typeset verbatim need to get -%D the catcode that makes it a letter. This is what we get when we typeset -%D the text verbatim: -%D -%D \starttyping -%D whatever \type {\whatever{you want}} $or$ not! -%D \stoptyping -%D -%D However, when passed to \type {\whatever} we get: -%D -%D \getbuffer[a] -%D -%D In \ETEX\ one can use \type {\scantokens} to circumvent this problem. -%D -%D \startbuffer[b] -%D \def\rescan#1{\scantokens{#1}} -%D \def\whatever#1{[\rescan{#1}]} -%D \whatever{whatever \type {\whatever{you want}} $or$ not!} -%D \stopbuffer -%D -%D \getbuffer[b] \typebuffer[b] -%D -%D This time the \type {\whatever} call gives: -%D -%D \getbuffer[b] -%D -%D In this example, two spaces have crept in. The first one, after the -%D macro name, is inserted by \TEX\ and cannot be avoided. The last space -%D is inserted by \type {\scantokens}, and is the consequence of the fact -%D that this macro mimics reading from a file. You can avoid the last -%D space by a slightly different definition: -%D -%D \startbuffer[c] -%D \def\rescan#1{\scantokens{#1\ignorespaces}} -%D \def\whatever#1{[\rescan{#1}]} -%D \whatever{whatever \type {\whatever{you want}} $or$ not!} -%D \stopbuffer -%D -%D \typebuffer[c] -%D -%D Unfortunately we still keep the first space, but at least it's better than -%D a failure: -%D -%D \getbuffer[c] - -\long\def\rescan#1{\scantokens{#1\ignorespaces}} -\long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantokens{#2\ignorespaces}\endgroup} - -\ifx\scantextokens\undefined \else - \long\def\rescan#1{\scantextokens{#1}} - \long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantextokens{#2}\endgroup} -\fi - -% In 2005 we will abandon support for font encodings that don't have -% the ascii characters { } $ etc in their normal slot, i.e. latin modern -% instead of computer modern. Then we can also clean up some of the ugly -% xml internals that are a result from the need to deal with funny -% encodings. -% -% a solution: -% -% \defineXMLargument[ctx:c]{\getXMLcharacter} -% \defineXMLargument[ctx:e]{\getXMLentity } -% \defineXMLargument[ctx:u]{\unicodechar } -% -% \bgroup \catcode`\<=\active \catcode`\&=\active -% -% \gdef\dontexpandutf -% {\def\getXMLcharacter##1{##1}% -% \def\getXMLentity ##1{##1}% -% \def\unicodechar ##1{##1}} -% -% \egroup -% -% more generic -% -% IS THIS STILL OK? TO BE CHECKED (UTF AND SUCH) ! ! ! ! - -\def\XMLexpanded#1% - {\bgroup - \honorunexpanded -% \dontexpandencoding -% \dontexpandutf - \chardef\activecharactermode\zerocount - \xdef\@@globalexpanded{#1}% - \egroup - \@@globalexpanded} - -\def\setXMLexpandedmark#1#2% using a tok prevents unwanted expansion in mark - {\XMLexpanded{\scratchtoks{\enableXML#2}}% - \expanded{\normalsetnormalmark{#1}{\the\scratchtoks}}} - -% \separatestring123 456\to\test [\test] - -% \def\separatestring#1\to#2% -% {\let#2\empty -% \def\docommand##1{\edef#2{\ifx#2\empty\else#2,\fi##1}}% -% \processseparatedlist[#1][ ]\docommand} -% -% \processseparatedlist[aap noot][]\ruledhbox - % this will be activated when % \newinsert\thispageinsert % <- installinsertion @@ -509,7 +352,7 @@ \expandafter#1% \fi} -\gdef\collapsespaces% +\gdef\collapsespaces {\prependtoksonce\relax\to\everyeof% \ignorelines% \ignoretabs% @@ -518,165 +361,6 @@ \egroup -% no, wrong! never! -% -% \def\tightlayer[#1]% -% {\begingroup -% \def\currentlayer{#1}% todo: left/right -% \setbox\nextbox\emptybox % hoogte/breedte are \wd\nextbox/\ht\nextbox -% \hsize\layerparameter\c!width % \overlaywidth = \hsize -% \vsize\layerparameter\c!height % \overlaywheight = \vsize -% \hbox to \hsize{\composedlayer{#1}}% -% \endgroup} - -% todo : share symbols - -% \definecolor[rollover:n][red] -% \definecolor[rollover:r][green] -% \definecolor[rollover:d][blue] - -\definepalet - [rollover] - [n=red, - r=green, - d=blue] - -% \newcounter\nofrollovers -% -% \def\dorollbutton[#1][#2]#3[#4]% -% {\dontleavehmode -% \bgroup -% \doglobal\increment\nofrollovers -% \unexpanded\def\dosetlocationbox[##1]##2[##3]% -% {\getparameters[##1][##3]% -% \definecolor[rollover][rollover:##2]% -% \let\next\hbox -% \doif{##2}{n} -% {\doifvalue{##1\c!variant}\v!verborgen{\let\next\phantom}}% -% \next -% {\localframed[##1] -% [\c!framecolor=rollover,\c!backgroundcolor=rollover,\c!color=rollover]% -% {\dolocationattributes{##1}\c!style\c!color{#3}}}}% -% \iffirstargument -% \ifsecondargument -% \def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[#2]}% -% \else -% \doifassignmentelse{#1} -% {\def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[#1]}} -% {\def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[]}}% -% \fi -% \else -% \def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[]}% -% \fi -% % todo: share symbols -% \definesymbol[rsym:\nofrollovers:n][\setlocationbox n]% -% \definesymbol[rsym:\nofrollovers:r][\setlocationbox r]% -% \definesymbol[rsym:\nofrollovers:d][\setlocationbox d]% -% \nextsystemfield -% \setupfield -% [rollbutton] -% [\c!frame=\v!off,\c!offset=\v!overlay,\c!klickoff={#4}]% -% \definefield -% [\currentsystemfield][push][rollbutton] -% [rsym:\nofrollovers:n,% -% rsym:\nofrollovers:r,% -% rsym:\nofrollovers:d]% -% \fitfield[\currentsystemfield]% -% \egroup} - -\newcounter\nofrollovers -\newcounter\nofrollbuttons - -\def\dorollbutton[#1][#2]#3[#4]% - {\dontleavehmode - \bgroup - \doglobal\increment\nofrollovers - \doglobal\increment\nofrollbuttons - \unexpanded\def\dosetlocationbox[##1]##2[##3]% - {\getparameters[##1][##3]% - \definecolor[rollover][rollover:##2]% - \doifelse{##2}{n}{\doifelsevalue{##1\c!alternative}\v!hidden\phantom\hbox}\hbox - {\localframed[##1] - [\c!framecolor=rollover,\c!backgroundcolor=rollover,\c!color=rollover]% - {\dolocationattributes{##1}\c!style\c!color{#3}}}}% - \iffirstargument - \ifsecondargument - \def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[#2]}% - \else - \doifassignmentelse{#1} - {\def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[#1]}} - {\def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[]}}% - \fi - \else - \def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[]}% - \fi - % todo: share symbols, tricky since different dimensions - \definesymbol[rsym:\nofrollovers:n][\setlocationbox n]% - \definesymbol[rsym:\nofrollovers:r][\setlocationbox r]% - \definesymbol[rsym:\nofrollovers:d][\setlocationbox d]% - \setupfield - [rollbutton] - [\c!frame=\v!off, - \c!offset=\v!overlay, - \c!clickout={#4}]% - \definefield - [roll:\nofrollbuttons][push][rollbutton] - [rsym:\nofrollovers:n,% - rsym:\nofrollovers:r,% - rsym:\nofrollovers:d]% - \fitfield[roll:\nofrollbuttons]% - \egroup} - -\unexpanded\def\rollbutton - {\dodoubleempty\dorollbutton} - -% \def\do@@amrob[#1]#2\\% -% {\txt\rollbutton[\currentmenu]{\ignorespaces#2\unskip}[#1]\\}% - -% \appendtoks \let\rob\do@@amrob \to \everysetmenucommands - -\def\menu@rob[#1]#2\\% - {\@@amboxcommand\rollbutton[\currentmenu]{\ignorespaces#2\unskip}[#1]\\}% - -\appendtoks \let\rob\menu@rob \to \everysetmenucommands - -% calls: -% {..} [JS..] -% [left] {..} [JS..] -% [a=b] {..} [JS..] -% [left] [a=b] {..} [JS..] -% -% \setupbuttons[offset=0pt,frame=off] % alternative=hidden -% -% \rollbutton {Manuals} [JS(Goto_File{show-man.pdf})] -% \rollbutton {Articles} [JS(Goto_File{show-art.pdf})] -% \rollbutton {Papers} [JS(Goto_File{show-pap.pdf})] -% \rollbutton {Presentations} [JS(Goto_File{show-pre.pdf})] -% \rollbutton {Resources} [JS(Goto_File{show-res.pdf})] -% -% \rob [JS(...)] bla bla \\ - -\unexpanded\def\overlayrollbutton - {\dodoubleargument\dooverlayrollbutton} - -\def\dooverlayrollbutton[#1][#2]% - {\bgroup - \nextsystemfield - \setupfield - [overlayrollbutton] - [\c!frame=\v!off,\c!offset=\v!overlay,\c!regionin={#1},\c!regionout={#2}]% - \definesymbol - [\currentsystemfield] - [{\framed[\c!frame=\v!off,\c!width=\overlaywidth,\c!height=\overlayheight]{}}]% - \definefield - [\currentsystemfield][push][overlayrollbutton][\currentsystemfield][\currentsystemfield]% - \fitfield[\currentsystemfield]% - \egroup} - -% \defineoverlay -% [ShowMenu] -% [{\overlayrollbutton[VideLayer{navigation}][HideLayer{navigation}]}] - \def\inlinedbox {\bgroup \dowithnextbox @@ -708,19 +392,6 @@ \unexpanded\def\asciistr#1{\dontleavehmode{\defconvertedargument\ascii{#1}\verbatimfont\ascii}} -% messy, will be improved: - -\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]} - \def\shapefill{\vskip\zeropoint\!!plus\lineheight\!!minus\lineheight\relax} \let\normaltype\type @@ -771,10 +442,6 @@ \fi \fi \advance\boislevel\minusone} -\defineblankmethod [\v!synchronize] {\verticalstrut\vskip-2\lineheight\verticalstrut} - -% \vtop{\blank[synchronize]\blank[line]test} - \def\minimalhbox#1#% {\dowithnextbox {\bgroup @@ -784,28 +451,6 @@ \egroup} \hbox} -% manual -% -% externfiguur -> grid =ja|hoogte|diepte|halveregel|passend -> helemaal in details -% stelplaatsblokin -> zijuitlijnen=hoogte|diepte|regel|halveregel|grid -> halveregel in 'details' - -% todo: switch koppelen aan par scheelt pos - -% to be documented: \startspread .. \stopspread - -% to be documented primarydef p crossed d -% to be documented PlainTextArea - -% manual -% -% Sometimes the demands are getting pretty weird: -% -% \startitemize -% \item test -% \item test -% \headsym{xx} test \par test -% \stopitemize - % \def\dodimchoice#1#2#3% % {\ifx#3\relax % #1\@EA\gobbleuntilrelax @@ -853,22 +498,6 @@ \def\showsetupsdefinition[#1]{\showvalue{\??su:#1}} % temp hack for debugging % documentation : \setupregister[alternative=a|b|A|B] - -\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} - \unprotected \def\traceposstring#1#2#3% {\iftracepositions \smashedhbox% @@ -878,144 +507,6 @@ \vrule\!!width4\scratchdimen\!!height\scratchdimen\!!depth\scratchdimen}% \fi} -% It took quite a while to figure this out (using the preliminary 1.5 -% spec). There are still a lot of things to be implemented. This is -% the third alternative. - -% todo: multiple instances, dus indirect - -\let\currentrendering\empty - -\definereference[StartCurrentRendering] [\v!StartRendering {\currentrendering}] -\definereference[StopCurrentRendering] [\v!StopRendering {\currentrendering}] -\definereference[PauseCurrentRendering] [\v!PauseRendering {\currentrendering}] -\definereference[ResumeCurrentRendering][\v!ResumeRendering{\currentrendering}] - -\newcounter\nofexternalrenderings - -\def\useexternalrendering{\doquadrupleempty\douseexternalrendering} -\def\setinternalrendering{\dodoubleempty \dosetinternalrendering} - -\def\douseexternalrendering[#1][#2][#3][#4]% tag mime file options - {\setgvalue{\??rd:#1}{\plusone{#1}{#2}{#3}{#4}}} - -\def\dosetinternalrendering[#1][#2]% tag options {content} - {\bgroup - \dowithnextbox - {\setgvalue{\??rd:#1}{\plustwo{#1}{IRO}{#1}{#2}}% - \let\objectoffset\zeropoint - \setobject{IRO}{#1}\hbox{\box\nextbox}% - \egroup}% - \hbox} - -\def\checkrendering#1% let's hope that \next is not used - {\iflocation - \doifsomething{#1}% - {\doifdefined{\??rd:#1}% - {\expanded{\getvalue{\??rd::\number\renderingtype{#1}}% - {\filterfromvalue{\??rd:#1}52}{\filterfromvalue{\??rd:#1}53}% - {\filterfromvalue{\??rd:#1}54}{\filterfromvalue{\??rd:#1}55}}}}% - \fi} - -\setvalue{\??rd::1}{\doinsertrendering} -\setvalue{\??rd::2}{\doinsertrenderingobject} - -\def\renderingtype #1{\filterfromvalue{\??rd:#1}51} -\def\renderingoptions#1{\filterfromvalue{\??rd:#1}55} - -\setexecutecommandcheck {startrendering} \checkrendering -\setexecutecommandcheck {stoprendering} \checkrendering -\setexecutecommandcheck {pauserendering} \checkrendering -\setexecutecommandcheck {resumerendering} \checkrendering - -% by using a nice trick (used in other places of context as well) we -% can easily overload the default size to match the opbject size - -\def\renderingwidth {8cm} -\def\renderingheight{6cm} - -\def\definerenderingwindow - {\dodoubleempty\dodefinerenderingwindow} - -\def\dodefinerenderingwindow[#1][#2]% - {\presetlocalframed[\??rw#1]% - \getparameters% - [\??rw#1]% - [\c!openpageaction=,\c!closepageaction=,% - \c!width=\renderingwidth,\c!height=\renderingheight,% - #2]} - -\def\setuprenderingwindow - {\dodoubleargument\dosetuprenderingwindow} - -\def\dosetuprenderingwindow[#1]% - {\getparameters[\??rw#1]} - -\def\placerenderingwindow - {\dodoubleempty\doplacerenderingwindow} - -\def\doplacerenderingwindow[#1][#2]% - {\bgroup - \edef\currentrendering{\ifsecondargument#2\else#1\fi}% - \ifcase\renderingtype\currentrendering\or - % a file - \or - % an object - \getobjectdimensions{IRO}\currentrendering - \scratchdimen\objectheight - \advance\scratchdimen\objectdepth - \edef\renderingheight{\the\scratchdimen}% - \edef\renderingwidth{\objectwidth}% - \fi - % create fall back if needed - \doifdefinedelse{\??rw#1\c!width} - {\def\currentrenderingwindow{#1}} - {\let\currentrenderingwindow\s!default - \definerenderingwindow[\currentrenderingwindow]}% - \checkrendering\currentrendering - \handlereferenceactions{\getvalue{\??rw\currentrenderingwindow\c!openpageaction }}\dosetuprenderingopenpageaction - \handlereferenceactions{\getvalue{\??rw\currentrenderingwindow\c!closepageaction}}\dosetuprenderingclosepageaction - \localframed - [\??rw\currentrenderingwindow][\c!offset=\v!overlay]% - {\expanded{\doinsertrenderingwindow - \noexpand\currentrendering\hsize\vsize{\renderingoptions\currentrendering}}}% - \egroup} - -% todo: -% -% \setinternalrendering[example-1][options]{} - -% test file: -% -% \definerenderingwindow -% [example] -% [width=320pt,height=150pt,frame=off, -% background=color,backgroundcolor=gray, -% openpageaction=StartCurrentRendering, -% closepageaction=NextPage]% StopCurrentRendering] -% -% \useexternalrendering[example-1][audio/mpeg] [eldorado.mp3] -% \useexternalrendering[example-2][audio/mpeg] [myst-12.mp3] -% \useexternalrendering[example-3][application/x-shockwave-flash][http://localhost/mb.swf] [auto] -% \useexternalrendering[example-4][application/x-shockwave-flash][celebration.swf] -% \useexternalrendering[example-5][video/quicktime] [p1000726.mov] -% \useexternalrendering[example-6][application/smil] [quadratic_map.smi] -% -% \def\renderingmenu[#1]% -% {\hbox -% {\setupbuttons[width=2.5em]% -% \button{\symbol[StartRendering]} [StartRendering{#1}]\enspace -% \button{\symbol[StopRendering]} [StopRendering{#1}]\enspace -% \button{\symbol[PauseRendering]} [PauseRendering{#1}]\enspace -% \button{\symbol[ResumeRendering]}[ResumeRendering{#1}]}} -% -% \renderingmenu[example-1]\blank -% \renderingmenu[example-2]\blank -% \renderingmenu[example-3]\blank -% \renderingmenu[example-4] \placefigure{A ShockWave}{\placerenderingwindow[example][example-4]} \page -% \renderingmenu[example-5] \placefigure{A Movie}{\placerenderingwindow[example][example-5]} \page -% \renderingmenu[example-6] \placefigure{A Smile}{\placerenderingwindow[example][example-6]} - % will be a MyWay % % \setuplayout[grid=yes] \setupcaption[figure][inbetween=] \useMPlibrary[dum] \setupcolors[state=start] @@ -1118,94 +609,12 @@ {\endgraf\verticalstrut\endgraf\kern-2\lineheight \egroup} -\def\definepushbutton % name optional setup - {\dodoubleempty\dodefinepushbutton} - -\def\dodefinepushbutton[#1][#2]% name setup - {\dododefinepushbutton{#1}{n}{push}% - \dododefinepushbutton{#1}{r}{\symbol[psym:#1:n]}% - \dododefinepushbutton{#1}{d}{\symbol[psym:#1:r]}% - \setvalue{pushbutton:#1}{\dohandlepushbutton{#1}{#2}}} - -\def\dododefinepushbutton#1#2#3% - {\doifsymboldefinedelse{psym:#1:#2}% - \donothing{\definesymbol[psym:#1:#2][{#3}]}} - -\def\definepushsymbol - {\dotripleargument\dodefinepushsymbol} - -\def\dodefinepushsymbol[#1][#2]% [#3] - {\definesymbol[psym:#1:#2]} - -\def\dopushbutton[#1][#2]% - {\executeifdefined{pushbutton:#1}\gobbleoneargument{#2}} - -\def\pushbutton - {\dodoubleargument\dopushbutton} - -\def\dohandlepushbutton#1#2#3% identifier setup script - {\bgroup - \nextsystemfield - \setupfield - [pushbutton] - [\c!frame=\v!overlay, - \c!offset=\v!overlay, - \c!clickout=#3,#2]% - \definefield - [\currentsystemfield] - [push] - [pushbutton] - [psym:#1:n,psym:#1:r,psym:#1:d]% - \fitfield - [\currentsystemfield]% - \egroup} - -% \def\do@@ampsh -% {\dodoubleargument\dodo@@ampsh} -% -% \def\dodo@@ampsh[#1][#2]#3\\% -% {\txt\pushbutton[#1][#2]\\}% -% -%\appendtoks \let\psh\do@@ampsh \to \everysetmenucommands - -\def\@@ampsh{\txt\pushbutton} - -\appendtoks \let\psh\@@ampsh \to \everysetmenucommands - -% \definepushbutton [reset] -% -% \definepushsymbol [reset] [n] [\uniqueMPgraphic{whatever}{color=green}] -% \definepushsymbol [reset] [r] [\uniqueMPgraphic{whatever}{color=white}] -% -% \startinteractionmenu[bottom] -% \psh [reset] [JS(reset_something)] \\ -% \stopinteractionmenu - \def\tabulaterule % to be redone, not correct {\dotabulaterule {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax \doifvalue{\??tt\currenttabulate\c!distance}\v!grid {\kern-\scratchdimen}}} % experimental tm-prikkels -% todo: \setupinterlinespace[\c!regel=\v!vast] => ==\the\baselineskip - -%%%%%%%% todo: \chardef\snapstruts=1 => d=l-h - -\def\useMPvariables - {\dodoubleargument\douseMPvariables} - -\def\douseMPvariables[#1][#2]% - {\def\@@meta{#1:}% - \prepareMPvariables{#2}} - -\def\processlinetableXMLfile#1% - {\bgroup - \let\startlinetable\donothing - \let\stoplinetable \donothing - \startlinetableanalysis\processXMLfile{#1}\stoplinetableanalysis - \startlinetablerun \processXMLfile{#1}\stoplinetablerun - \egroup} - % experimental: \synchronizegrid bla bla bla \newcounter\currentgridsync @@ -1241,13 +650,10 @@ % \message{no grid correction: \the\scratchdimen}\wait \fi} -% needed for extreme +% needed for extreme (will go away) \definesystemvariable{ie} -% \def\definetest[#1]#2% -% {\long\setvalue{\??ie#1}{#2}} - \def\definetest {\dodoubleempty\dodefinetest} @@ -1257,13 +663,13 @@ \processaction [#2] [% first test true, rest depends - \v!next=>\setgvalue{\??ie#1}{\setgvalue{\??ie#1}{#3}\firstoftwoarguments}, + \v!next=>\setgvalue{\??ie#1}{\setgvalue{\??ie#1}{#3}\firstoftwoarguments}, % rest true if first true % \v!first=>\setgvalue{\??ie#1}{#3{\letgvalue{\??ie#1}% - % \firstoftwoarguments\firstoftwoarguments}% - % \secondoftwoarguments}, + % \firstoftwoarguments\firstoftwoarguments}% + % \secondoftwoarguments}, % always true - \v!yes=>\letgvalue{\??ie#1}\firstoftwoarguments, + \v!yes=>\letgvalue{\??ie#1}\firstoftwoarguments, % always false \v!no=>\letgvalue{\??ie#1}\secondoftwoarguments]% \fi} @@ -1296,42 +702,13 @@ % \tableifelse{\doifelse{a}{a}}{\NC Xtest \NC test \NC \NR}{}% % \stoptabulate} -\long \def\tableifelse#1% +\long\def\tableifelse#1% {\TABLEnoalign{#1% {\aftergroup \firstoftwoarguments}% {\aftergroup\secondoftwoarguments}}} -% \long \def\tableif#1% whow, this is real ugly -% {\TABLEnoalign{\let\gnext\gobbleoneargument#1% -% {\let\gnext\firstofoneargument}}\gnext} - \long \def\tableiftextelse#1{\tableifelse{\doiftextelse{#1}}} -\def\expandifnonempty#1% - {\@EA\ifx\csname#1\endcsname\empty - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi - {\csname#1\endcsname}} - -\def\@@sectiekoppeling#1% - {\expandifnonempty{\??ko#1\c!coupling}{#1}} - -\def\@@sectiesectie#1% - {\expandifnonempty{\??ko#1\c!section}{\@@sectiekoppeling{#1}}} - -\def\sectioncountervalue#1% - {\@@sectionvalue{\@@sectiesectie{#1}}} - -% todo namespace \@@meta:#1:... ! ! ! ! ! ! - -\def\presetMPvariable - {\dodoubleargument\dopresetMPvariable} - -\def\dopresetMPvariable[#1][#2=#3]% - {\doifundefined{#1:#2}{\setvalue{#1:#2}{#3}}} - % experiment, not yet to be used \def\displaybreak @@ -1347,30 +724,6 @@ \def\tightvbox{\dowithnextbox{\nextboxdp\zeropoint\flushnextbox}\vbox} \def\tightvtop{\dowithnextbox{\nextboxht\zeropoint\flushnextbox}\vtop} -% \translateMPinput{il2-pl} -% -% \startMPenvironment[global] -% \setupbodyfont[plr] -% \stopMPenvironment -% -% \TeX: -% -% \startMPcode -% draw btex MetaPost: etex scaled 5 ; -% \stopMPcode - -% now in cont-loc.tex, for the sake of testing. -% -% %D When \type {\somecolor} is issued, we can savely assume -% %D grouping. Using \type {\groupedcommand} here (i.e.\ the -% %D definition of \type {\color}) is unsafe because in -% %D interferes with for instance switching attributes. -% -% \def\switchtocolor[#1]% -% {\bgroup\startcolor[#1] -% \aftergroup\stopcolor -% \aftergroup\egroup} - % what is this stupid macro meant for: \def\hyphenationpoint @@ -1502,8 +855,6 @@ \egroup \synchronizehsize} -% todo : hoe komt box er uit - \long\def\startexternalfigure {\dotripleempty\dostartexternalfigure} @@ -1538,6 +889,18 @@ %% \def\changedpage#1% %% {\getvalue{\s!paragraph:p:#1}} +\newcount\nofprofiled + +\def\profilemacro#1% + {\nofprofiled\zerocount + \letvalue{\string#1\string#1}#1% + \appendtoks + \normalwritestatus\m!systems{profile \string#1: \number\nofprofiled}% + \to \everystoptext + \unexpanded\def#1% + {\global\advance\nofprofiled\plusone + \csname\string#1\string#1\endcsname}} + % incomplete, will be a special case of float placement \def\startfixed{\dosingleempty\dostartfixed} @@ -1555,7 +918,7 @@ \processaction [#2] [ \v!high=>\bbox {\flushnextbox}, - \v!low=>\tbox {\flushnextbox}, + \v!low=>\tbox {\flushnextbox}, \v!middle=>\vcenter{\flushnextbox}, \v!lohi=>\vcenter{\flushnextbox}, \s!unknown=>\tbox {\flushnextbox}, @@ -1596,44 +959,29 @@ % % \stopitemize -% still needed for uguide - -\let\placefloatlabel \placefloatcaption -\let\placefloatlabeltext \placefloatcaptiontext -\let\placefloatlabelreference \placefloatcaptionreference - \def\obeyfollowingtoken{{}} % end \cs scanning -\def\gobbleparameters{\doquadrupleempty\dogobbleparameters} -\def\dogobbleparameters[#1][#2][#3][#4]{} - -% documentation - -% \starttable[|||] -% \HL -% \VL test \VS test \VL \FR -% \VL test \VD test \VL \MR -% \VL test \VT test \VL \LR -% \HL -% \stoptable - -%D To be documented, \type {\includemenu[menu]}. -%D To be documented, \type {\emphbf} cum suis. - -%D For Ton. To be documented. - -\def\plaatsexterndocument[#1]% - {\def\doexternaldocument##1##2##3{\readlocfile{##2}\donothing\donothing}% - \getvalue{\v!file:::#1}} - -%D Far from complete. - -\def\startgeheel - {\startlinecorrection - \insidefloattrue} - -\def\stopgeheel - {\stoplinecorrection} +% \def\comparedimension#1#2% +% {\chardef\compresult +% \ifdim#1<#2% +% \zerocount +% \else\ifdim#1<#2% +% \plusone +% \else +% \plustwo +% \fi\fi} +% \newdimen\roundingeps \roundingeps=10sp +% \def\comparedimensioneps#1#2% +% {\chardef\compresult +% \ifdim\dimexpr(#1-#2)<\roudingeps +% \zerocount +% \else\ifdim\dimexpr(#2-#1)<\roudingeps +% \zerocount +% \else\ifdim#1<#2% +% \plusone +% \else +% \plustwo +% \fi\fi\fi} %D Next we load a few local optimizations and new features. They %D live on on my machine and are not distributed, but they may end @@ -1643,6 +991,6 @@ \readsysfile {cont-loc} {} {} % local improvements, patches, new features \readsysfile {cont-exp} {} {} % experimental features (e.g. local speed-ups) -\readsysfile {cont-mtx} {} {} % experimental metatex features +%readsysfile {cont-mtx} {} {} % experimental metatex features \protect \endinput diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index 61650e4fd..24a4d6514 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -15,35 +15,35 @@ %D manipulation macros. The first one loads \PLAIN\ \TEX, as %D minimal as possible. -\loadcorefile{syst-ini.tex} -\loadcorefile{norm-tex.tex} -\loadcorefile{norm-etx.tex} -\loadcorefile{norm-ptx.tex} -\loadcorefile{norm-xtx.tex} -\loadcorefile{norm-ctx.tex} -\loadcorefile{syst-pln.tex} +\loadcorefile{syst-ini} +\loadcorefile{norm-tex} +\loadcorefile{norm-etx} +\loadcorefile{norm-ptx} +\loadcorefile{norm-xtx} +\loadcorefile{norm-ctx} +\loadcorefile{syst-pln} \loadmarkfile{catc-ini} -\loadcorefile{catc-act.tex} -\loadcorefile{catc-def.tex} -\loadcorefile{catc-ctx.tex} -\loadcorefile{catc-sym.tex} - -\loadcorefile{syst-gen.tex} -\loadcorefile{syst-ext.tex} -\loadcorefile{syst-new.tex} +\loadcorefile{catc-act} +\loadcorefile{catc-def} +\loadcorefile{catc-ctx} +\loadcorefile{catc-sym} + +\loadmarkfile{syst-gen} +\loadmarkfile{syst-ext} +\loadmarkfile{syst-new} \loadmarkfile{syst-con} -\loadcorefile{thrd-trg.tex} % based on: David Carlisle +\loadmarkfile{thrd-trg} % based on: David Carlisle \loadmarkfile{syst-fnt} \loadmarkfile{syst-str} \loadmarkfile{syst-rtp} \ifnum\texengine=\xetexengine - \loadcorefile{xetx-ini.tex} - \loadcorefile{xetx-utf.tex} - \loadcorefile{xetx-chr.tex} - \loadcorefile{xetx-cls.tex} + \loadmarkfile{xetx-ini} + \loadmarkfile{xetx-utf} + \loadmarkfile{xetx-chr} + \loadmarkfile{xetx-cls} \fi %D To enable selective loading, we say: @@ -60,36 +60,35 @@ %D modules. \loadmarkfile{mult-ini} -\loadcorefile{mult-fst.tex} -\loadcorefile{mult-sys.tex} -\loadcorefile{mult-def.tex} +\loadcorefile{mult-fst} +\loadcorefile{mult-sys} +\loadcorefile{mult-def} \loadmarkfile{mult-chk} %D Now we're ready for some general support modules. These %D modules implement some basic typesetting functionality. -\loadcorefile{core-var.tex} +\loadmarkfile{core-var} \loadmarkfile{core-env} -\loadcorefile{supp-box.tex} -\loadcorefile{supp-mrk.tex} -\loadcorefile{supp-vis.tex} -\loadcorefile{supp-fun.tex} -%loadcorefile{supp-eps.tex} -\loadcorefile{supp-spe.tex} +\loadcorefile{supp-box} +\loadmarkfile{supp-mrk} +\loadcorefile{supp-vis} +\loadcorefile{supp-fun} +%loadmarkfile{supp-eps} +\loadmarkfile{supp-spe} \loadmarkfile{supp-ran} -%loadcorefile{supp-mps.tex} -\loadmkiifile{supp-mps.tex} -\loadmkiifile{supp-tpi.tex} -\loadcorefile{supp-mat.tex} -\loadcorefile{supp-ali.tex} -\loadcorefile{supp-num.tex} +\loadmarkfile{supp-mps} +\loadmarkfile{supp-tpi} +\loadcorefile{supp-mat} +\loadcorefile{supp-ali} +\loadcorefile{supp-num} %D Verbatim typesetting is implemented in a separate class of %D modules. The pretty typesetting modules are loaded at run %D time. -\loadcorefile{verb-ini.tex} +\loadmarkfile{verb-ini} %D The following modules are not sequentially dependent, %D i.e. they have ugly dependencies, which will be cleaned @@ -99,33 +98,33 @@ %D bit more advanced file handling as well as some general %D variables, and features, so next we load: -\loadcorefile{core-ins.tex} -\loadcorefile{core-fil.tex} +\loadmarkfile{page-ins} +\loadmarkfile{core-fil} \loadmarkfile{core-con} %D We already need some synonyms (patterns). At runtime this %D file will be reloaded. -\loadcorefile{cont-fil.tex} +\loadcorefile{cont-fil} %D \CONTEXT\ does not implement its own table handling. We %D just go for the best there is and load \TABLE. Just to be %D sure we do it here, before we redefine \type{|}. -\loadcorefile{thrd-tab.tex} % based on: Michael Wichura / will be reimplemented +\loadcorefile{thrd-tab} % based on: Michael Wichura / will be reimplemented %D Here comes the last support modules. They take care of %D some language specific things. -\loadcorefile{supp-pat.tex} +\loadmarkfile{supp-pat} %D The next few modules do what their names state. They %D load additional definition modules when needed. \loadmarkfile{regi-ini} -\loadcorefile{regi-syn.tex} +\loadcorefile{regi-syn} \loadmarkfile{enco-ini} -%loadcorefile{filt-ini.tex} +%loadmarkfile{filt-ini} \loadmarkfile{hand-ini} \loadmarkfile{lang-ini} @@ -134,15 +133,15 @@ \loadmarkfile{unic-ini} -\loadcorefile{core-gen.tex} +\loadmarkfile{core-gen} \loadmarkfile{core-uti} \loadmarkfile{core-two} -\loadcorefile{core-stg.tex} +\loadmarkfile{core-stg} -\loadcorefile{spec-ini.tex} -\loadcorefile{spec-mis.tex} -\loadcorefile{spec-def.tex} -\loadcorefile{spec-var.tex} +\loadmarkfile{spec-ini} +\loadmarkfile{spec-mis} +\loadmarkfile{spec-def} +\loadmarkfile{spec-var} \loadmarkfile{colo-ini} \loadmarkfile{colo-ext} @@ -150,29 +149,28 @@ %D For the moment we load a lot of languages. In the future %D we'll have to be more space conservative. -\loadcorefile{lang-mis.tex} +\loadmarkfile{lang-mis} \loadmarkfile{lang-url} -\loadcorefile{lang-ger.tex} -\loadcorefile{lang-ita.tex} -\loadcorefile{lang-sla.tex} -\loadcorefile{lang-alt.tex} -\loadcorefile{lang-ana.tex} -\loadcorefile{lang-art.tex} -\loadcorefile{lang-bal.tex} -\loadcorefile{lang-cel.tex} -\loadcorefile{lang-grk.tex} -\loadcorefile{lang-ind.tex} -\loadcorefile{lang-ura.tex} -\loadcorefile{lang-vn.tex} -\loadcorefile{lang-ara.tex} -\loadcorefile{lang-cyr.tex} +\loadcorefile{lang-ger} +\loadcorefile{lang-ita} +\loadcorefile{lang-sla} +\loadcorefile{lang-alt} +\loadcorefile{lang-ana} +\loadcorefile{lang-art} +\loadcorefile{lang-bal} +\loadcorefile{lang-cel} +\loadcorefile{lang-grk} +\loadcorefile{lang-ind} +\loadcorefile{lang-ura} +\loadcorefile{lang-vn} +\loadcorefile{lang-cyr} \loadmarkfile{typo-ini} %D All kind of symbols are handled in: -\loadcorefile{symb-ini.tex} +\loadmarkfile{symb-ini} %D Sorting: @@ -183,10 +181,9 @@ %D is important, due to dependancies. \loadmarkfile{core-spa} -\loadcorefile{core-grd.tex} +\loadmarkfile{core-grd} \loadmarkfile{strc-mar} \loadmarkfile{anch-pos} -\loadcorefile{core-mak.tex} \loadmarkfile{buff-ver} \loadmarkfile{buff-ini} @@ -194,9 +191,9 @@ \loadmarkfile{pack-rul} \loadmarkfile{trac-vis} \loadmarkfile{strc-num} -\loadcorefile{tabl-pln.tex} -\loadcorefile{tabl-tab.tex} -\loadcorefile{tabl-tsp.tex} +\loadmarkfile{tabl-pln} +\loadmarkfile{tabl-tab} +\loadmarkfile{tabl-tsp} \loadmarkfile{scrn-nav} \loadmarkfile{strc-ref} \loadmarkfile{pack-obj} @@ -209,22 +206,22 @@ \loadmarkfile{page-ini} \loadmarkfile{page-bck} -\loadcorefile{page-not.tex} +\loadmarkfile{page-not} \loadmarkfile{page-one} -\loadcorefile{page-lay.tex} -\loadmkiifile{page-log.tex} +\loadmarkfile{page-lay} +\loadmarkfile{page-log} \loadmarkfile{page-txt} -\loadcorefile{page-sid.tex} +\loadmarkfile{page-sid} \loadmarkfile{strc-flt} -\loadcorefile{page-mis.tex} -\loadcorefile{page-mul.tex} -\loadcorefile{page-set.tex} +\loadmarkfile{page-mis} +\loadmarkfile{page-mul} +\loadmarkfile{page-set} \loadmarkfile{pack-lyr} -\loadcorefile{page-mak.tex} +\loadmarkfile{page-mak} \loadmarkfile{strc-pag} \loadmarkfile{page-lin} -\loadcorefile{page-par.tex} -\loadcorefile{page-mar.tex} +\loadmarkfile{page-par} +\loadmarkfile{page-mar} \loadmarkfile{core-job} % why so late? @@ -234,18 +231,19 @@ \loadmarkfile{strc-swd} \loadmarkfile{strc-blk} -\loadcorefile{page-imp.tex} -\loadcorefile{tabl-tbl.tex} +\loadmarkfile{page-imp} +\loadmarkfile{tabl-tbl} \loadmarkfile{scrn-int} \loadmarkfile{tabl-ntb} -\loadcorefile{tabl-nte.tex} -\loadcorefile{tabl-ltb.tex} +\loadmarkfile{tabl-nte} +\loadmarkfile{tabl-ltb} %D A few more languages, that have specifics using core %D functionality: -\loadcorefile{lang-chi.tex} -\loadcorefile{lang-jap.tex} +%loadmarkfile{lang-ara} % undefined +\loadmarkfile{lang-chi} +\loadmarkfile{lang-jap} %D How about fill||in fields and related stuff? @@ -265,17 +263,17 @@ \loadmarkfile{font-ini} \ifnum\texengine=\xetexengine - \loadcorefile{font-xtx.tex} + \loadmarkfile{font-xtx} \fi \loadmarkfile{font-unk} \loadmarkfile{font-uni} -\loadcorefile{font-bfm.tex} +\loadmarkfile{font-bfm} -\loadcorefile{enco-pfr.tex} +\loadmarkfile{enco-pfr} \loadmarkfile{type-ini} -\loadcorefile{type-def.tex} +\loadcorefile{type-def} %D Properties. Don't ask. @@ -290,20 +288,20 @@ \loadmarkfile{meta-tex} \loadmarkfile{meta-pdf} -\loadcorefile{meta-pag.tex} +\loadmarkfile{meta-pag} %D Special page handling (maybe even later) -\loadcorefile{page-flw.tex} -\loadcorefile{page-spr.tex} -\loadcorefile{page-plg.tex} -\loadcorefile{page-str.tex} +\loadmarkfile{page-flw} +\loadmarkfile{page-spr} +\loadmarkfile{page-plg} +\loadmarkfile{page-str} %D Anchoring graphics: \loadmarkfile{anch-pgr} -\loadcorefile{anch-bar.tex} -\loadcorefile{anch-snc.tex} +\loadcorefile{anch-bar} +\loadcorefile{anch-snc} %D Math. @@ -316,7 +314,7 @@ \loadmarkfile{core-fnt} \loadmarkfile{strc-not} -\loadcorefile{core-lnt.tex} +\loadmarkfile{strc-lnt} \loadmarkfile{core-mis} @@ -324,35 +322,35 @@ \loadmarkfile{grph-inc} \loadmarkfile{grph-fig} -\loadcorefile{core-par.tex} +\loadmarkfile{core-par} \loadmarkfile{pack-box} -\loadcorefile{page-app.tex} +\loadmarkfile{page-app} \loadmarkfile{meta-fig} %D Language specific spacing. -\loadcorefile{lang-spa.tex} +\loadcorefile{lang-spa} %D Only the basic XML parser and remapper are part of the core. %D These macros are loaded last since they overload and|/|or %D extend previously defined ones. -\loadcorefile{xtag-ini.tex} -\loadcorefile{xtag-ext.tex} -\loadcorefile{xtag-exp.tex} -\loadcorefile{xtag-pre.tex} -\loadcorefile{xtag-xsd.tex} -\loadcorefile{xtag-rng.tex} +\loadcorefile{xtag-ini} +\loadcorefile{xtag-ext} +\loadcorefile{xtag-exp} +\loadcorefile{xtag-pre} +\loadcorefile{xtag-xsd} +\loadcorefile{xtag-rng} %D How about this: -\loadcorefile{meta-xml.tex} +\loadcorefile{meta-xml} %D \TEX\ related logo's are always typeset in a special way. %D Here they come: -\loadcorefile{cont-log.tex} +\loadcorefile{cont-log} %D This one overloads af few things: @@ -361,8 +359,7 @@ %D Defaults go here (more will be moved to this module %D later): -\loadcorefile{core-lme.tex} -\loadcorefile{core-ini.tex} +\loadmarkfile{core-ini} \loadmarkfile{core-def} %D Preloaded modules (some need xml support): @@ -383,4 +380,4 @@ % %D Except from english, no hyphenation patterns are loaded % %D yet. Users can specify their needs in the next module: % -% \input cont-usr.tex +% \input cont-usr diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index fc3149f6b..735d1c780 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -18,19 +18,25 @@ %D manipulation macros. The first one loads \PLAIN\ \TEX, as %D minimal as possible. -\loadcorefile{syst-ini.tex} -\loadcorefile{norm-ctx.tex} -\loadcorefile{syst-pln.tex} +\loadcorefile{syst-ini} + +\ifnum\luatexversion<42 + \writestatus{!!!!}{Your luatex binary is way too old, you need at least version 0.42.} + \expandafter\end +\fi + +\loadcorefile{norm-ctx} +\loadcorefile{syst-pln} \loadmarkfile{luat-cod} \loadmarkfile{luat-bas} \loadmarkfile{luat-lib} \loadmarkfile{catc-ini} -\loadcorefile{catc-act.tex} -\loadcorefile{catc-def.tex} -\loadcorefile{catc-ctx.tex} -\loadcorefile{catc-sym.tex} +\loadcorefile{catc-act} +\loadcorefile{catc-def} +\loadcorefile{catc-ctx} +\loadcorefile{catc-sym} \newif\ifCONTEXT \CONTEXTtrue % will disappear @@ -50,10 +56,11 @@ \loadmarkfile{char-act} \loadmarkfile{mult-ini} -\loadcorefile{mult-fst.tex} -\loadcorefile{mult-sys.tex} -\loadcorefile{mult-def.tex} +\loadcorefile{mult-fst} +\loadcorefile{mult-sys} +\loadcorefile{mult-def} \loadmarkfile{mult-chk} +\loadmarkfile{mult-cld} \loadmarkfile{luat-ini} @@ -63,12 +70,11 @@ \loadmarkfile{node-fin} \loadmarkfile{node-par} -\loadcorefile{core-var.tex} - -\loadmarkfile{lpdf-ini} +\loadmarkfile{core-var} \loadmarkfile{back-ini} -\loadmarkfile{back-pdf} +\loadmarkfile{lpdf-ini} % some day back-ini will load this +\loadmarkfile{back-pdf} % some day back-ini will load this \loadmarkfile{attr-ini} @@ -77,71 +83,70 @@ \loadmarkfile{trac-lmx} \loadmarkfile{trac-deb} -\loadcorefile{supp-box.tex} +\loadcorefile{supp-box} -\loadcorefile{supp-vis.tex} -\loadcorefile{supp-fun.tex} +\loadcorefile{supp-vis} +\loadcorefile{supp-fun} \loadmarkfile{supp-ran} -\loadcorefile{supp-mat.tex} -\loadcorefile{supp-ali.tex} -\loadcorefile{supp-num.tex} +\loadcorefile{supp-mat} +\loadcorefile{supp-ali} +\loadcorefile{supp-num} \loadmarkfile{typo-ini} -\loadcorefile{core-ins.tex} -\loadcorefile{core-fil.tex} +\loadmarkfile{page-ins} +\loadmarkfile{core-fil} \loadmarkfile{core-con} -\loadcorefile{cont-fil.tex} +\loadcorefile{cont-fil} \loadmarkfile{regi-ini} -\loadcorefile{regi-syn.tex} +\loadcorefile{regi-syn} \loadmarkfile{enco-ini} \loadmarkfile{hand-ini} \loadmarkfile{lang-ini} -\loadmarkfile{lang-spe} \loadmarkfile{lang-lab} \loadmarkfile{unic-ini} -\loadcorefile{core-gen.tex} +\loadmarkfile{core-gen} \loadmarkfile{core-uti} \loadmarkfile{core-two} -\loadcorefile{core-stg.tex} \loadmarkfile{colo-ini} \loadmarkfile{colo-ext} \loadmarkfile{trac-vis} -\loadcorefile{lang-mis.tex} +\loadmarkfile{lang-mis} \loadmarkfile{lang-url} -\loadcorefile{lang-ger.tex} -\loadcorefile{lang-ita.tex} -\loadcorefile{lang-sla.tex} -\loadcorefile{lang-alt.tex} -\loadcorefile{lang-ana.tex} -\loadcorefile{lang-art.tex} -\loadcorefile{lang-bal.tex} -\loadcorefile{lang-cel.tex} -\loadcorefile{lang-grk.tex} -\loadcorefile{lang-ind.tex} -\loadcorefile{lang-ura.tex} -\loadcorefile{lang-cjk.tex} -\loadcorefile{lang-vn.tex} -\loadcorefile{lang-ara.tex} -\loadcorefile{lang-cyr.tex} - -\loadcorefile{symb-ini.tex} +\loadcorefile{lang-ger} +\loadcorefile{lang-ita} +\loadcorefile{lang-sla} +\loadcorefile{lang-alt} +\loadcorefile{lang-ana} +\loadcorefile{lang-art} +\loadcorefile{lang-bal} +\loadcorefile{lang-cel} +\loadcorefile{lang-grk} +\loadcorefile{lang-ind} +\loadcorefile{lang-ura} +\loadcorefile{lang-vn} +\loadcorefile{lang-cyr} + +\loadmarkfile{lang-ara} +\loadmarkfile{lang-cjk} + +\loadmarkfile{symb-ini} \loadmarkfile{sort-ini} \loadmarkfile{pack-rul} -\loadcorefile{lxml-ini} +\loadmarkfile{lxml-ini} \loadmarkfile{strc-ini} \loadmarkfile{strc-doc} @@ -158,13 +163,12 @@ \loadmarkfile{strc-ref} \loadmarkfile{strc-reg} -\loadcorefile{bibl-bib} +\loadmarkfile{bibl-bib} \loadmarkfile{core-spa} -\loadcorefile{core-grd.tex} +\loadmarkfile{core-grd} \loadmarkfile{anch-pos} -\loadcorefile{core-mak.tex} \loadmarkfile{scrn-nav} \loadmarkfile{pack-obj} @@ -177,23 +181,23 @@ \loadmarkfile{page-ini} \loadmarkfile{page-bck} -\loadcorefile{page-not.tex} +\loadmarkfile{page-not} \loadmarkfile{page-one} -\loadcorefile{page-lay.tex} +\loadmarkfile{page-lay} \loadmarkfile{page-txt} -\loadcorefile{page-sid.tex} +\loadmarkfile{page-sid} \loadmarkfile{strc-flt} -\loadcorefile{page-mis.tex} -\loadcorefile{page-mul.tex} -\loadcorefile{page-set.tex} +\loadmarkfile{page-mis} +\loadmarkfile{page-mul} +\loadmarkfile{page-set} \loadmarkfile{pack-lyr} -\loadcorefile{page-mak.tex} +\loadmarkfile{page-mak} \loadmarkfile{page-lin} -\loadcorefile{page-par.tex} -\loadcorefile{page-mar.tex} +\loadmarkfile{page-par} +\loadmarkfile{page-mar} \loadmarkfile{core-job} % why so late? @@ -202,19 +206,22 @@ \loadmarkfile{strc-blk} -\loadcorefile{page-imp.tex} +\loadmarkfile{page-imp} \loadmarkfile{scrn-int} +\loadmarkfile{scrn-men} +\loadmarkfile{scrn-but} +\loadmarkfile{scrn-bar} \loadmarkfile{strc-bkm} % bookmarks -\loadcorefile{tabl-pln.tex} -\loadcorefile{thrd-tab.tex} -\loadcorefile{tabl-tab.tex} -\loadcorefile{tabl-tbl.tex} +\loadmarkfile{tabl-pln} +\loadcorefile{thrd-tab} +\loadmarkfile{tabl-tab} +\loadmarkfile{tabl-tbl} \loadmarkfile{tabl-ntb} -\loadcorefile{tabl-nte.tex} -\loadcorefile{tabl-ltb.tex} -\loadcorefile{tabl-tsp.tex} +\loadmarkfile{tabl-nte} +\loadmarkfile{tabl-ltb} +\loadmarkfile{tabl-tsp} \loadmarkfile{java-ini} @@ -235,7 +242,7 @@ \loadmarkfile{typo-cap} \loadmarkfile{type-ini} -\loadcorefile{type-def.tex} +\loadcorefile{type-def} \loadmarkfile{scrp-ini} @@ -252,16 +259,16 @@ \loadmarkfile{meta-pdf} \loadmarkfile{meta-fun} -\loadcorefile{meta-pag.tex} +\loadmarkfile{meta-pag} -\loadcorefile{page-flw.tex} -\loadcorefile{page-spr.tex} -\loadcorefile{page-plg.tex} -\loadcorefile{page-str.tex} +\loadmarkfile{page-flw} +\loadmarkfile{page-spr} +\loadmarkfile{page-plg} +\loadmarkfile{page-str} -\loadmarkfile{anch-pgr} -\loadcorefile{anch-bar.tex} -\loadcorefile{anch-snc.tex} +\loadmarkfile{anch-pgr} % overloads tabl-tbl +\loadcorefile{anch-bar} +\loadcorefile{anch-snc} \loadmarkfile{math-pln} \loadmarkfile{math-ini} @@ -284,8 +291,7 @@ \loadmarkfile{core-fnt} \loadmarkfile{strc-not} - -\loadcorefile{core-lnt.tex} +\loadmarkfile{strc-lnt} \loadmarkfile{core-mis} @@ -294,28 +300,28 @@ \loadmarkfile{grph-fig} \loadmarkfile{pack-box} -\loadcorefile{page-app.tex} +\loadmarkfile{pack-bar} +\loadmarkfile{page-app} \loadmarkfile{meta-fig} -\loadcorefile{lang-spa.tex} +\loadcorefile{lang-spa} -\loadcorefile{xtag-ini.tex} % might go away -\loadcorefile{xtag-ext.tex} % might go away -\loadcorefile{xtag-exp.tex} % will go away -\loadcorefile{xtag-pre.tex} % has old encoding code -\loadcorefile{xtag-xsd.tex} % will go away (stub anyway) -\loadcorefile{xtag-rng.tex} % will go away (stub anyway) +\loadcorefile{xtag-ini} % might go away +\loadcorefile{xtag-ext} % might go away +\loadcorefile{xtag-exp} % will go away +\loadcorefile{xtag-pre} % has old encoding code +\loadcorefile{xtag-xsd} % will go away (stub anyway) +\loadcorefile{xtag-rng} % will go away (stub anyway) -\loadcorefile{meta-xml.tex} +\loadcorefile{meta-xml} -\loadcorefile{cont-log.tex} +\loadcorefile{cont-log} \loadmarkfile{task-ini} \loadmarkfile{core-ctx} -\loadcorefile{core-lme.tex} -\loadcorefile{core-ini.tex} +\loadmarkfile{core-ini} \loadmarkfile{core-def} %usemodule[x][res-04] % xml resource libraries diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex index 6316c6156..95c528f32 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2009.06.13 14:03} +\edef\contextversion{2009.07.17 13:16} %D For those who want to use this: diff --git a/tex/context/base/core-def.mkii b/tex/context/base/core-def.mkii index ea2d0ff15..e51cd96d3 100644 --- a/tex/context/base/core-def.mkii +++ b/tex/context/base/core-def.mkii @@ -74,4 +74,11 @@ % \appendtoks\everyjob\expandafter{\the\everyjob\checkpreprocessor}\to\everydump +% normally one does not want this to happen nested, maybe there +% is more; non public vars btw, will become conditionals + +\ifx\writetoregisterfalse\undefined \else \appendtoks \writetoregisterfalse \to \everybeforeutilityread \fi +\ifx\writetolistfalse \undefined \else \appendtoks \writetolistfalse \to \everybeforeutilityread \fi +\ifx\notesenabledfalse \undefined \else \appendtoks \notesenabledfalse \to \everybeforeutilityread \fi + \protect \endinput diff --git a/tex/context/base/core-def.mkiv b/tex/context/base/core-def.mkiv index 380b733bc..782fe3f67 100644 --- a/tex/context/base/core-def.mkiv +++ b/tex/context/base/core-def.mkiv @@ -54,8 +54,6 @@ \appendtoks \ifarrangingpages\poparrangedpages\fi \to \everybye \appendtoks \registerfileinfo[end]\jobname \to \everybye -\prependtoks \resetutilities \to \everystarttext % moved 28-02-2002 - \appendtoks \MPLIBallocate{1000} \to \everydump \prependtoks \resetallattributes \to \everybeforeoutput diff --git a/tex/context/base/core-fil.mkii b/tex/context/base/core-fil.mkii new file mode 100644 index 000000000..fca253a7b --- /dev/null +++ b/tex/context/base/core-fil.mkii @@ -0,0 +1,347 @@ +%D \module +%D [ file=core-fil, +%D version=1997.11.15, +%D title=\CONTEXT\ Core Macros, +%D subtitle=File Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / File Support} + +\unprotect + +%D Files registered as temporary files will be deleted after a +%D run by texexec: + +% \starttext +% \immediate\openout\scratchwrite=oeps.tmp +% \immediate\write\scratchwrite{oeps} +% \immediate\closeout\scratchwrite +% \registertempfile{oeps.tmp} +% \typefile{oeps.tmp} +% \stoptext + +\let\usedtempfile\gobbleoneargument + +\def\registertempfile#1{\immediatewriteutility{f t {#1}}} + +%D \macros +%D {definefilesynonym} +%D +%D One of the problems with loading files is that their names +%D can depend on the interface language. We therefore need a +%D method to define filesynonyms. The actual synonyms are +%D defined elsewhere, but look like: +%D +%D \starttyping +%D \definefilesynonym [chemic] [chemie] +%D \definefilesynonym [einheit] [unit] +%D \definefilesynonym [unit] [unit] +%D \stoptyping +%D +%D So we can say in english: +%D +%D \starttyping +%D \usemodules[pictex,chemic,unit] +%D \stoptyping +%D +%D and in dutch: +%D +%D \starttyping +%D \usemodules[pictex,chemie,unit] +%D \stoptyping + +% will be redone in mkiv + +\def\definefilesynonym + {\dodoubleempty\dodefinefilesynonym} + +\def\dodefinefilesynonym[#1][#2]% + {\ifundefined{\??fs#1}\else + \doifnotvalue{\??fs#1}{#2}{\showmessage\m!files1{#1 (#2),\getvalue{\??fs#1}}}% + \fi + \doifelse{#1}{#2}{\letbeundefined{\??fs#1}{#2}}{\setevalue{\??fs#1}{#2}}} + +%D \macros +%D {definefilefallback} + +\def\definefilefallback + {\dodoubleargument\dodefinefilefallback} + +\def\dodefinefilefallback[#1][#2]% + {\doifnotfile{#1} + {\def\docommand##1{\doiffile{##1}{\definefilesynonym[#1][##1]\quitcommalist}}% + \processcommalist[#2]\docommand}} + +%D \macros +%D {truefilename} +%D +%D At the system level such a filename can be called upon by +%D saying: +%D +%D \starttyping +%D \truefilename{filename/filesynonym} +%D \stoptyping +%D +%D The implementation shows that nesting is supported. + +\def\truefilename#1% + {\ifundefined{\??fs#1}#1\else\truefilename{\csname\??fs#1\endcsname}\fi} + +%D \macros +%D {makeshortfilename} +%D +%D To prevent cross platform problems with filenames, we +%D lowercase them as well as only use the first 8~characters. +%D +%D \starttyping +%D \def\domakeshortfilename[#1#2#3#4#5#6#7#8#9]% +%D {\lowercase{\edef\shortfilename{#1#2#3#4#5#6#7#8.}}% +%D \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename} +%D +%D \def\makeshortfilename[#1]% +%D {\edef\fullfilename{#1.........}% +%D \expanded{\domakeshortfilename[\fullfilename]}} +%D \stoptyping +%D +%D In 2005 there is no need for the 8~character limit any more, so: + +\def\makeshortfilename[#1]% no need for further cleanup and shortening + {\lowercase{\edef\shortfilename{#1.}}% + \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename} + +%D \macros +%D {usemodule} +%D +%D Most of \CONTEXT is preloaded in the format file. Some very +%D domain specific typesetting topics are however dealt with in +%D separate modules, e.g. typesetting of chemical structure +%D formulas. These modules are loaded by: +%D +%D \showsetup{usemodule} +%D +%D More information on the specific modules can be found in +%D their dedicated manuals. We use \type {\next} so that we +%D can \type {\end} in modules. + +\newconditional\moduleisloaded + +\def\dododousemodules#1#2% no \unprotect/\protect when loading, + {\relax % since we need to use ? ! unprotected + \ifconditional\moduleisloaded % sometimes (see xtag-map) + \let\next\relax % or: \expandafter\gobbleoneargument + \else + \makeshortfilename[#1\truefilename{#2}]% beware: *- is not part of syn + \doifelseflagged\shortfilename + {\showmessage\m!systems7{#2 (line \number\inputlineno)}% + \settrue\moduleisloaded + \let\next\relax} + {\doglobal\setflag\shortfilename + \def\next + {\startreadingfile + \readsysfile\shortfilename + {\showmessage\m!systems5{#2}\settrue\moduleisloaded} + {\readsysfile{\shortfilename.\mksuffix} % new + {\showmessage\m!systems5{#2 (\mksuffix)}\settrue\moduleisloaded} + \donothing}% + \stopreadingfile}}% + \fi + \next} + +\def\dodousemodules#1#2% + {\setfalse\moduleisloaded + \doifelsenothing{#1} + {\dododousemodules\f!moduleprefix {#2}% + \dododousemodules\f!privateprefix{#2}% + \dododousemodules\f!styleprefix {#2}% + \dododousemodules\f!xstyleprefix {#2}% + \dododousemodules\f!thirdprefix {#2}% + \dododousemodules\empty {#2}}% new, fall back on raw name + {\dododousemodules{#1-}{#2}}% + \ifconditional\moduleisloaded\else + \showmessage\m!systems6{#2}% + \appendtoks\showmessage\m!systems6{#2}\to\everynotabene + \fi} + +% \def\usemodules +% {\dodoubleempty\dousemodules} +% +% \def\dousemodules[#1][#2]% +% {\ifsecondargument +% \doifelsenothing{#2} +% {\let\next\relax} +% {\def\next{\processcommalist[#2]{\dodousemodules{#1}}}}% +% \else +% \def\next{\usemodules[][#1]}% +% \fi +% \next} +% +% \let\usemodule\usemodules + +\def\usemodules + {\dotripleempty\dousemodules} + +\def\dousemodules[#1][#2][#3]% + {\pushmacro\currentmodule + \pushmacro\currentmoduleparameters + \let\currentmoduleparameters\empty + \ifthirdargument + \doifelsenothing{#2} + {\let\next\relax} + {\def\currentmoduleparameters{#3}% + \def\next{\processcommalist[#2]{\dodousemodules{#1}}}}% + \else\ifsecondargument + \doifelsenothing{#2} + {\let\next\relax} + {\doifassignmentelse{#2} + {\def\currentmoduleparameters{#2}% + \def\next{\processcommalist[#1]{\dodousemodules{}}}} + {\def\next{\processcommalist[#2]{\dodousemodules{#1}}}}}% + \else + \def\next{\processcommalist[#1]{\dodousemodules{}}}% + \fi\fi + \next + \popmacro\currentmoduleparameters + \popmacro\currentmodule} + +\let\currentmoduleparameters\empty +\let\currentmodule \s!unknown + +\def\startmodule + {\doifnextoptionalelse\dostartmodule\nostartmodule} + +\def\nostartmodule #1 % + {\dostartmodule[#1]} + +\def\dostartmodule[#1]% + {\pushmacro\currentmodule + \pushmacro\currentmoduleparameters + \def\currentmodule{#1}} + +\def\stopmodule + {\popmacro\currentmoduleparameters + \popmacro\currentmodule} + +\def\setupmodule + {\dodoubleempty\dosetupmodule} + +\def\dosetupmodule[#1][#2]% + {\scratchtoks\expandafter{\currentmoduleparameters}% + \ifsecondargument + \getparameters[\??md:#1:][#2]% + \expanded{\getparameters[\??md:#1:][\the\scratchtoks]}% + \else + \getparameters[\??md:\currentmodule:][#1]% + \expanded{\getparameters[\??md:\currentmodule:][\the\scratchtoks]}% + \fi + \let\currentmoduleparameters\empty} + +\def\moduleparameter #1#2{\executeifdefined{\??md:#1:#2}\s!empty} +\def\currentmoduleparameter#1{\executeifdefined{\??md:\currentmodule:#1}\s!empty} + +% \usemodule[newmml] +% \usemodule[newmml][a=b] +% \usemodule[x][newmml] +% \usemodule[x][newmml][a=b] +% +% \startmodule [mathml] +% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars will be set afterwards +% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars are now forgotten +% \stopmodule + +% one can introduce test sections with: +% +% \enablemode[newmml:test:\currentmoduleparameter{test}] +% \startmode[newmml:test:yes} ... \stopmode +% +% these will be ignored unless test=yes +% +% however, a better way is: + +\let\stopmoduletestsection\donothing + +\def\startmoduletestsection + {\bgroup + \setupmodule % we need to make sure that the vars are set + \doifelse{\currentmoduleparameter\v!test}\v!yes + {\egroup + \writestatus{\currentmodule}{loading experimental code}} + {\egroup + \writestatus{\currentmodule}{skipping experimental code}% + \gobbleuntil\stopmoduletestsection}} + +%D We also support a singular call, which saves us for +%D frustrations when we do a typo. + +\let\usemodule=\usemodules + +% %D The definition shows that the language specific settings +% %D are activated after loading all the modules specified. + +%D \macros +%D {ifprotectbuffers, bufferprefix, +%D TEXbufferfile, MPgraphicfile} +%D +%D The next switch enables protection of temporary filenames, +%D which is needed when we process more files on one path at +%D the same time. + +\newif\ifprotectbuffers + +\def\bufferprefix{\ifprotectbuffers\jobname-\fi} + +% The following filenames are defined here: + +\def\TEXbufferfile #1{\bufferprefix#1.\f!temporaryextension} +\def\MPgraphicfile {\bufferprefix mp\ifMPrun run\else graph\fi} % not needed in luatex +\def\convertMPcolorfile{\bufferprefix metacmyk.tmp} + +%D To save memory, we implement some seldomly used commands +%D in a lazy way. Nota bene: such runtime definitions are +%D global. +%D +%D \starttyping +%D \fetchruntimecommand\showaccents{\f!encodingprefix ...} +%D \stoptyping + +\def\fetchruntimecommand#1#2% + {\def#1{\dofetchruntimecommand#1{#2}}} + +\def\dofetchruntimecommand#1#2% + {\doifnotflagged{#2} + {\let#1\undefined + \startreadingfile + \startnointerference % \bgroup + \cleanupfeatures % better \setnormalcatcodes / test first + \readfile{#2}\donothing\donothing + \stopnointerference % \egroup + \stopreadingfile + \doglobal\setflag{#2}}% + \ifx#1\undefined + \writestatus\m!systems{command \string#1 not found in file #2}% + \def#1{{\infofont[unknown command \string#1]}}% + \fi + #1} + +%D Experimental: + +\let\checkpreprocessor\relax + +%D To be documented and probably moved + +\def\documentresources{\@@erurl} + +\def\setupexternalresources + {\dodoubleargument\getparameters[\??er]} + +\setupexternalresources + [url=] + +%D This module will be perfected / changed / weeded. + +\protect \endinput diff --git a/tex/context/base/core-fil.mkiv b/tex/context/base/core-fil.mkiv new file mode 100644 index 000000000..14154fca4 --- /dev/null +++ b/tex/context/base/core-fil.mkiv @@ -0,0 +1,317 @@ +%D \module +%D [ file=core-fil, +%D version=1997.11.15, +%D title=\CONTEXT\ Core Macros, +%D subtitle=File Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / File Support} + +\unprotect + +%D \macros +%D {definefilesynonym} +%D +%D One of the problems with loading files is that their names +%D can depend on the interface language. We therefore need a +%D method to define filesynonyms. The actual synonyms are +%D defined elsewhere, but look like: +%D +%D \starttyping +%D \definefilesynonym [chemic] [chemie] +%D \definefilesynonym [einheit] [unit] +%D \definefilesynonym [unit] [unit] +%D \stoptyping +%D +%D So we can say in english: +%D +%D \starttyping +%D \usemodules[pictex,chemic,unit] +%D \stoptyping +%D +%D and in dutch: +%D +%D \starttyping +%D \usemodules[pictex,chemie,unit] +%D \stoptyping + +% will be redone in mkiv + +\def\definefilesynonym + {\dodoubleempty\dodefinefilesynonym} + +\def\dodefinefilesynonym[#1][#2]% + {\ifcsname\??fs#1\endcsname + \doifnotvalue{\??fs#1}{#2}{\showmessage\m!files1{#1 (#2),\getvalue{\??fs#1}}}% + \fi + \doifelse{#1}{#2}{\letbeundefined{\??fs#1}{#2}}{\setevalue{\??fs#1}{#2}}} + +%D \macros +%D {definefilefallback} + +\def\definefilefallback + {\dodoubleargument\dodefinefilefallback} + +\def\dodefinefilefallback[#1][#2]% + {\doifnotfile{#1} + {\def\docommand##1{\doiffile{##1}{\definefilesynonym[#1][##1]\quitcommalist}}% + \processcommalist[#2]\docommand}} + +%D \macros +%D {truefilename} +%D +%D At the system level such a filename can be called upon by +%D saying: +%D +%D \starttyping +%D \truefilename{filename/filesynonym} +%D \stoptyping +%D +%D The implementation shows that nesting is supported. + +\def\truefilename#1% + {\ifcsname\??fs#1\endcsname\expandafter\truefilename\csname\??fs#1\endcsname\else#1\fi} + +%D \macros +%D {makeshortfilename} +%D +%D To prevent cross platform problems with filenames, we +%D lowercase them as well as only use the first 8~characters. +%D +%D \starttyping +%D \def\domakeshortfilename[#1#2#3#4#5#6#7#8#9]% +%D {\lowercase{\edef\shortfilename{#1#2#3#4#5#6#7#8.}}% +%D \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename} +%D +%D \def\makeshortfilename[#1]% +%D {\edef\fullfilename{#1.........}% +%D \expanded{\domakeshortfilename[\fullfilename]}} +%D \stoptyping +%D +%D In 2005 there is no need for the 8~character limit any more, so: + +\def\makeshortfilename[#1]% no need for further cleanup and shortening + {\lowercase{\edef\shortfilename{#1.}}% + \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename} + +%D \macros +%D {usemodule} +%D +%D Most of \CONTEXT is preloaded in the format file. Some very +%D domain specific typesetting topics are however dealt with in +%D separate modules, e.g. typesetting of chemical structure +%D formulas. These modules are loaded by: +%D +%D \showsetup{usemodule} +%D +%D More information on the specific modules can be found in +%D their dedicated manuals. We use \type {\next} so that we +%D can \type {\end} in modules. + +\newconditional\moduleisloaded + +\def\dododousemodules#1#2% no \unprotect/\protect when loading, + {\relax % since we need to use ? ! unprotected + \ifconditional\moduleisloaded % sometimes (see xtag-map) + \let\next\relax % or: \expandafter\gobbleoneargument + \else + \makeshortfilename[#1\truefilename{#2}]% beware: *- is not part of syn + \doifelseflagged\shortfilename + {\showmessage\m!systems7{#2 (line \number\inputlineno)}% + \settrue\moduleisloaded + \let\next\relax} + {\doglobal\setflag\shortfilename + \def\next + {\startreadingfile + \readsysfile\shortfilename + {\showmessage\m!systems5{#2}\settrue\moduleisloaded} + {\readsysfile{\shortfilename.\mksuffix} % new + {\showmessage\m!systems5{#2 (\mksuffix)}\settrue\moduleisloaded} + \donothing}% + \stopreadingfile}}% + \fi + \next} + +\def\dodousemodules#1#2% + {\setfalse\moduleisloaded + \doifelsenothing{#1} + {\dododousemodules\f!moduleprefix {#2}% + \dododousemodules\f!privateprefix{#2}% + \dododousemodules\f!styleprefix {#2}% + \dododousemodules\f!xstyleprefix {#2}% + \dododousemodules\f!thirdprefix {#2}% + \dododousemodules\empty {#2}}% new, fall back on raw name + {\dododousemodules{#1-}{#2}}% + \ifconditional\moduleisloaded\else + \showmessage\m!systems6{#2}% + \appendtoks\showmessage\m!systems6{#2}\to\everynotabene + \fi} + +\def\usemodules + {\dotripleempty\dousemodules} + +\def\dousemodules[#1][#2][#3]% + {\pushmacro\currentmodule + \pushmacro\currentmoduleparameters + \let\currentmoduleparameters\empty + \ifthirdargument + \doifelsenothing{#2} + {\let\next\relax} + {\def\currentmoduleparameters{#3}% + \def\next{\processcommalist[#2]{\dodousemodules{#1}}}}% + \else\ifsecondargument + \doifelsenothing{#2} + {\let\next\relax} + {\doifassignmentelse{#2} + {\def\currentmoduleparameters{#2}% + \def\next{\processcommalist[#1]{\dodousemodules{}}}} + {\def\next{\processcommalist[#2]{\dodousemodules{#1}}}}}% + \else + \def\next{\processcommalist[#1]{\dodousemodules{}}}% + \fi\fi + \next + \popmacro\currentmoduleparameters + \popmacro\currentmodule} + +\let\currentmoduleparameters\empty +\let\currentmodule \s!unknown + +\def\startmodule + {\doifnextoptionalelse\dostartmodule\nostartmodule} + +\def\nostartmodule #1 % + {\dostartmodule[#1]} + +\def\dostartmodule[#1]% + {\pushmacro\currentmodule + \pushmacro\currentmoduleparameters + \def\currentmodule{#1}} + +\def\stopmodule + {\popmacro\currentmoduleparameters + \popmacro\currentmodule} + +\def\setupmodule + {\dodoubleempty\dosetupmodule} + +\def\dosetupmodule[#1][#2]% + {\scratchtoks\expandafter{\currentmoduleparameters}% + \ifsecondargument + \getparameters[\??md:#1:][#2]% + \expanded{\getparameters[\??md:#1:][\the\scratchtoks]}% + \else + \getparameters[\??md:\currentmodule:][#1]% + \expanded{\getparameters[\??md:\currentmodule:][\the\scratchtoks]}% + \fi + \let\currentmoduleparameters\empty} + +\def\moduleparameter #1#2{\executeifdefined{\??md:#1:#2}\s!empty} +\def\currentmoduleparameter#1{\executeifdefined{\??md:\currentmodule:#1}\s!empty} + +% \usemodule[newmml] +% \usemodule[newmml][a=b] +% \usemodule[x][newmml] +% \usemodule[x][newmml][a=b] +% +% \startmodule [mathml] +% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars will be set afterwards +% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars are now forgotten +% \stopmodule + +% one can introduce test sections with: +% +% \enablemode[newmml:test:\currentmoduleparameter{test}] +% \startmode[newmml:test:yes} ... \stopmode +% +% these will be ignored unless test=yes +% +% however, a better way is: + +\let\stopmoduletestsection\donothing + +\def\startmoduletestsection + {\bgroup + \setupmodule % we need to make sure that the vars are set + \doifelse{\currentmoduleparameter\v!test}\v!yes + {\egroup + \writestatus{\currentmodule}{loading experimental code}} + {\egroup + \writestatus{\currentmodule}{skipping experimental code}% + \gobbleuntil\stopmoduletestsection}} + +%D We also support a singular call, which saves us for +%D frustrations when we do a typo. + +\let\usemodule=\usemodules + +% %D The definition shows that the language specific settings +% %D are activated after loading all the modules specified. + +%D \macros +%D {ifprotectbuffers, bufferprefix, +%D TEXbufferfile, MPgraphicfile} +%D +%D The next switch enables protection of temporary filenames, +%D which is needed when we process more files on one path at +%D the same time. + +\newif\ifprotectbuffers + +\def\bufferprefix{\ifprotectbuffers\jobname-\fi} + +% The following filenames are defined here: + +\def\TEXbufferfile #1{\bufferprefix#1.\f!temporaryextension} +\def\MPgraphicfile {\bufferprefix mp\ifMPrun run\else graph\fi} % not needed in luatex +\def\convertMPcolorfile{\bufferprefix metacmyk.tmp} + +%D To save memory, we implement some seldomly used commands +%D in a lazy way. Nota bene: such runtime definitions are +%D global. +%D +%D \starttyping +%D \fetchruntimecommand\showaccents{\f!encodingprefix ...} +%D \stoptyping + +\def\fetchruntimecommand#1#2% + {\def#1{\dofetchruntimecommand#1{#2}}} + +\def\dofetchruntimecommand#1#2% + {\doifnotflagged{#2} + {\let#1\undefined + \startreadingfile + \startnointerference % \bgroup + \cleanupfeatures % better \setnormalcatcodes / test first + \readfile{#2}\donothing\donothing + \stopnointerference % \egroup + \stopreadingfile + \doglobal\setflag{#2}}% + \ifx#1\undefined + \writestatus\m!systems{command \string#1 not found in file #2}% + \def#1{{\infofont[unknown command \string#1]}}% + \fi + #1} + +%D Experimental: + +\let\checkpreprocessor\relax + +%D To be documented and probably moved + +\def\documentresources{\@@erurl} + +\def\setupexternalresources + {\dodoubleargument\getparameters[\??er]} + +\setupexternalresources + [url=] + +%D This module will be perfected / changed / weeded. + +\protect \endinput diff --git a/tex/context/base/core-fil.tex b/tex/context/base/core-fil.tex deleted file mode 100644 index fca253a7b..000000000 --- a/tex/context/base/core-fil.tex +++ /dev/null @@ -1,347 +0,0 @@ -%D \module -%D [ file=core-fil, -%D version=1997.11.15, -%D title=\CONTEXT\ Core Macros, -%D subtitle=File Support, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Core Macros / File Support} - -\unprotect - -%D Files registered as temporary files will be deleted after a -%D run by texexec: - -% \starttext -% \immediate\openout\scratchwrite=oeps.tmp -% \immediate\write\scratchwrite{oeps} -% \immediate\closeout\scratchwrite -% \registertempfile{oeps.tmp} -% \typefile{oeps.tmp} -% \stoptext - -\let\usedtempfile\gobbleoneargument - -\def\registertempfile#1{\immediatewriteutility{f t {#1}}} - -%D \macros -%D {definefilesynonym} -%D -%D One of the problems with loading files is that their names -%D can depend on the interface language. We therefore need a -%D method to define filesynonyms. The actual synonyms are -%D defined elsewhere, but look like: -%D -%D \starttyping -%D \definefilesynonym [chemic] [chemie] -%D \definefilesynonym [einheit] [unit] -%D \definefilesynonym [unit] [unit] -%D \stoptyping -%D -%D So we can say in english: -%D -%D \starttyping -%D \usemodules[pictex,chemic,unit] -%D \stoptyping -%D -%D and in dutch: -%D -%D \starttyping -%D \usemodules[pictex,chemie,unit] -%D \stoptyping - -% will be redone in mkiv - -\def\definefilesynonym - {\dodoubleempty\dodefinefilesynonym} - -\def\dodefinefilesynonym[#1][#2]% - {\ifundefined{\??fs#1}\else - \doifnotvalue{\??fs#1}{#2}{\showmessage\m!files1{#1 (#2),\getvalue{\??fs#1}}}% - \fi - \doifelse{#1}{#2}{\letbeundefined{\??fs#1}{#2}}{\setevalue{\??fs#1}{#2}}} - -%D \macros -%D {definefilefallback} - -\def\definefilefallback - {\dodoubleargument\dodefinefilefallback} - -\def\dodefinefilefallback[#1][#2]% - {\doifnotfile{#1} - {\def\docommand##1{\doiffile{##1}{\definefilesynonym[#1][##1]\quitcommalist}}% - \processcommalist[#2]\docommand}} - -%D \macros -%D {truefilename} -%D -%D At the system level such a filename can be called upon by -%D saying: -%D -%D \starttyping -%D \truefilename{filename/filesynonym} -%D \stoptyping -%D -%D The implementation shows that nesting is supported. - -\def\truefilename#1% - {\ifundefined{\??fs#1}#1\else\truefilename{\csname\??fs#1\endcsname}\fi} - -%D \macros -%D {makeshortfilename} -%D -%D To prevent cross platform problems with filenames, we -%D lowercase them as well as only use the first 8~characters. -%D -%D \starttyping -%D \def\domakeshortfilename[#1#2#3#4#5#6#7#8#9]% -%D {\lowercase{\edef\shortfilename{#1#2#3#4#5#6#7#8.}}% -%D \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename} -%D -%D \def\makeshortfilename[#1]% -%D {\edef\fullfilename{#1.........}% -%D \expanded{\domakeshortfilename[\fullfilename]}} -%D \stoptyping -%D -%D In 2005 there is no need for the 8~character limit any more, so: - -\def\makeshortfilename[#1]% no need for further cleanup and shortening - {\lowercase{\edef\shortfilename{#1.}}% - \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename} - -%D \macros -%D {usemodule} -%D -%D Most of \CONTEXT is preloaded in the format file. Some very -%D domain specific typesetting topics are however dealt with in -%D separate modules, e.g. typesetting of chemical structure -%D formulas. These modules are loaded by: -%D -%D \showsetup{usemodule} -%D -%D More information on the specific modules can be found in -%D their dedicated manuals. We use \type {\next} so that we -%D can \type {\end} in modules. - -\newconditional\moduleisloaded - -\def\dododousemodules#1#2% no \unprotect/\protect when loading, - {\relax % since we need to use ? ! unprotected - \ifconditional\moduleisloaded % sometimes (see xtag-map) - \let\next\relax % or: \expandafter\gobbleoneargument - \else - \makeshortfilename[#1\truefilename{#2}]% beware: *- is not part of syn - \doifelseflagged\shortfilename - {\showmessage\m!systems7{#2 (line \number\inputlineno)}% - \settrue\moduleisloaded - \let\next\relax} - {\doglobal\setflag\shortfilename - \def\next - {\startreadingfile - \readsysfile\shortfilename - {\showmessage\m!systems5{#2}\settrue\moduleisloaded} - {\readsysfile{\shortfilename.\mksuffix} % new - {\showmessage\m!systems5{#2 (\mksuffix)}\settrue\moduleisloaded} - \donothing}% - \stopreadingfile}}% - \fi - \next} - -\def\dodousemodules#1#2% - {\setfalse\moduleisloaded - \doifelsenothing{#1} - {\dododousemodules\f!moduleprefix {#2}% - \dododousemodules\f!privateprefix{#2}% - \dododousemodules\f!styleprefix {#2}% - \dododousemodules\f!xstyleprefix {#2}% - \dododousemodules\f!thirdprefix {#2}% - \dododousemodules\empty {#2}}% new, fall back on raw name - {\dododousemodules{#1-}{#2}}% - \ifconditional\moduleisloaded\else - \showmessage\m!systems6{#2}% - \appendtoks\showmessage\m!systems6{#2}\to\everynotabene - \fi} - -% \def\usemodules -% {\dodoubleempty\dousemodules} -% -% \def\dousemodules[#1][#2]% -% {\ifsecondargument -% \doifelsenothing{#2} -% {\let\next\relax} -% {\def\next{\processcommalist[#2]{\dodousemodules{#1}}}}% -% \else -% \def\next{\usemodules[][#1]}% -% \fi -% \next} -% -% \let\usemodule\usemodules - -\def\usemodules - {\dotripleempty\dousemodules} - -\def\dousemodules[#1][#2][#3]% - {\pushmacro\currentmodule - \pushmacro\currentmoduleparameters - \let\currentmoduleparameters\empty - \ifthirdargument - \doifelsenothing{#2} - {\let\next\relax} - {\def\currentmoduleparameters{#3}% - \def\next{\processcommalist[#2]{\dodousemodules{#1}}}}% - \else\ifsecondargument - \doifelsenothing{#2} - {\let\next\relax} - {\doifassignmentelse{#2} - {\def\currentmoduleparameters{#2}% - \def\next{\processcommalist[#1]{\dodousemodules{}}}} - {\def\next{\processcommalist[#2]{\dodousemodules{#1}}}}}% - \else - \def\next{\processcommalist[#1]{\dodousemodules{}}}% - \fi\fi - \next - \popmacro\currentmoduleparameters - \popmacro\currentmodule} - -\let\currentmoduleparameters\empty -\let\currentmodule \s!unknown - -\def\startmodule - {\doifnextoptionalelse\dostartmodule\nostartmodule} - -\def\nostartmodule #1 % - {\dostartmodule[#1]} - -\def\dostartmodule[#1]% - {\pushmacro\currentmodule - \pushmacro\currentmoduleparameters - \def\currentmodule{#1}} - -\def\stopmodule - {\popmacro\currentmoduleparameters - \popmacro\currentmodule} - -\def\setupmodule - {\dodoubleempty\dosetupmodule} - -\def\dosetupmodule[#1][#2]% - {\scratchtoks\expandafter{\currentmoduleparameters}% - \ifsecondargument - \getparameters[\??md:#1:][#2]% - \expanded{\getparameters[\??md:#1:][\the\scratchtoks]}% - \else - \getparameters[\??md:\currentmodule:][#1]% - \expanded{\getparameters[\??md:\currentmodule:][\the\scratchtoks]}% - \fi - \let\currentmoduleparameters\empty} - -\def\moduleparameter #1#2{\executeifdefined{\??md:#1:#2}\s!empty} -\def\currentmoduleparameter#1{\executeifdefined{\??md:\currentmodule:#1}\s!empty} - -% \usemodule[newmml] -% \usemodule[newmml][a=b] -% \usemodule[x][newmml] -% \usemodule[x][newmml][a=b] -% -% \startmodule [mathml] -% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars will be set afterwards -% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars are now forgotten -% \stopmodule - -% one can introduce test sections with: -% -% \enablemode[newmml:test:\currentmoduleparameter{test}] -% \startmode[newmml:test:yes} ... \stopmode -% -% these will be ignored unless test=yes -% -% however, a better way is: - -\let\stopmoduletestsection\donothing - -\def\startmoduletestsection - {\bgroup - \setupmodule % we need to make sure that the vars are set - \doifelse{\currentmoduleparameter\v!test}\v!yes - {\egroup - \writestatus{\currentmodule}{loading experimental code}} - {\egroup - \writestatus{\currentmodule}{skipping experimental code}% - \gobbleuntil\stopmoduletestsection}} - -%D We also support a singular call, which saves us for -%D frustrations when we do a typo. - -\let\usemodule=\usemodules - -% %D The definition shows that the language specific settings -% %D are activated after loading all the modules specified. - -%D \macros -%D {ifprotectbuffers, bufferprefix, -%D TEXbufferfile, MPgraphicfile} -%D -%D The next switch enables protection of temporary filenames, -%D which is needed when we process more files on one path at -%D the same time. - -\newif\ifprotectbuffers - -\def\bufferprefix{\ifprotectbuffers\jobname-\fi} - -% The following filenames are defined here: - -\def\TEXbufferfile #1{\bufferprefix#1.\f!temporaryextension} -\def\MPgraphicfile {\bufferprefix mp\ifMPrun run\else graph\fi} % not needed in luatex -\def\convertMPcolorfile{\bufferprefix metacmyk.tmp} - -%D To save memory, we implement some seldomly used commands -%D in a lazy way. Nota bene: such runtime definitions are -%D global. -%D -%D \starttyping -%D \fetchruntimecommand\showaccents{\f!encodingprefix ...} -%D \stoptyping - -\def\fetchruntimecommand#1#2% - {\def#1{\dofetchruntimecommand#1{#2}}} - -\def\dofetchruntimecommand#1#2% - {\doifnotflagged{#2} - {\let#1\undefined - \startreadingfile - \startnointerference % \bgroup - \cleanupfeatures % better \setnormalcatcodes / test first - \readfile{#2}\donothing\donothing - \stopnointerference % \egroup - \stopreadingfile - \doglobal\setflag{#2}}% - \ifx#1\undefined - \writestatus\m!systems{command \string#1 not found in file #2}% - \def#1{{\infofont[unknown command \string#1]}}% - \fi - #1} - -%D Experimental: - -\let\checkpreprocessor\relax - -%D To be documented and probably moved - -\def\documentresources{\@@erurl} - -\def\setupexternalresources - {\dodoubleargument\getparameters[\??er]} - -\setupexternalresources - [url=] - -%D This module will be perfected / changed / weeded. - -\protect \endinput diff --git a/tex/context/base/core-gen.mkii b/tex/context/base/core-gen.mkii new file mode 100644 index 000000000..b6ab2a208 --- /dev/null +++ b/tex/context/base/core-gen.mkii @@ -0,0 +1,166 @@ +%D \module +%D [ file=core-gen, +%D version=1995.10.10, +%D title=\CONTEXT\ Core Macros, +%D subtitle=General, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / General} + +\unprotect + +%D \macros +%D {assigndimension,assignalfadimension} +%D +%D Hieronder worden enkele commando's gedefinieerd rond +%D toekenningen. Allereerst een commando om waarden aan +%D een \DIMENSION\ toe te kennen: +%D +%D \starttyping +%D \assigndimension +%D {|klein|middel|groot|-klein|-middel|-groot|geen} +%D {\dimension} +%D {waarde klein} +%D {waarde middel} +%D {waarde groot} +%D \stoptyping +%D +%D Hierbij krijgt de \DIMENSION\ \type{\dimension} een waarde +%D afhankelijk van het meegegeven trefwoord. +%D +%D \startnarrower +%D \startlines +%D \type{(-)klein }\qquad (--) waarde klein +%D \type{(-)middel}\qquad (--) waarde middel +%D \type{(-)groot }\qquad (--) waarde groot +%D \type{geen }\qquad 0pt +%D \type{waarde }\qquad waarde +%D \stoplines +%D \stopnarrower +%D +%D Een trefwoord mag worden voorafgegaan door een \type{-}. +%D Deze macro toont een voorbeeld van het gebruik van +%D \type{\processaction} en constanten. +%D +%D Analoog aan het bovenstaande commando kennen we een +%D commando om waarden toe te kennen aan een macro: +%D +%D \starttyping +%D \assignalfadimension +%D {|klein|middel|groot|geen} +%D {\macro} +%D {waarde klein} +%D {waarde middel} +%D {waarde groot} +%D \stoptyping + +% The third (optimized) version: + +\def\@ad@{@ad@} + +\setvalue{\@ad@ \v!none }{\zeropoint\gobblethreearguments} +\setvalue{\@ad@ \v!big }{\thirdofthreearguments} +\setvalue{\@ad@ \v!medium}{\secondofthreearguments} +\setvalue{\@ad@ \v!small }{\firstofthreearguments} +\setvalue{\@ad@-\v!big }{-\thirdofthreearguments} +\setvalue{\@ad@-\v!medium}{-\secondofthreearguments} +\setvalue{\@ad@-\v!small }{-\firstofthreearguments} + +\def\assigndimension#1#2% #3 #4 #5 + {#2=\ifcsname\@ad@#1\endcsname + \csname\@ad@#1\expandafter\endcsname + \else + #1\expandafter\gobblethreearguments + \fi} + +\def\@aa@{@aa@} + +\setvalue{\@aa@\v!none }{0\gobblethreearguments} +\setvalue{\@aa@\v!big }{\thirdofthreearguments} +\setvalue{\@aa@\v!medium}{\secondofthreearguments} +\setvalue{\@aa@\v!small }{\firstofthreearguments} + +\def\assignalfadimension#1#2#3#4#5% #3#4#5 are single digits + {\edef#2{\ifcsname\@aa@#1\endcsname + \csname\@aa@#1\expandafter\endcsname + \else + #1\expandafter\gobblethreearguments + \fi#3#4#5}} + +%D \macros +%D {assignvalue} +%D +%D Een variant hierop is het commando: +%D +%D \starttyping +%D \assignvalue +%D {|klein|middel|groot} +%D {\macro} +%D {waarde klein } +%D {waarde middel} +%D {waarde groot} +%D \stoptyping +%D +%D Hierbij krijgt \type{\macro} een waarde afhankelijk van +%D het meegegeven trefwoord: +%D +%D \startnarrower +%D \startlines +%D \type{klein }\qquad waarde klein +%D \type{middel}\qquad waarde middel +%D \type{groot }\qquad waarde groot +%D \type{waarde}\qquad waarde +%D \stoplines +%D \stopnarrower +%D +%D Hier doet \type{geen} dus niet mee. + +\def\@av@{@av@} + +\letvalue{\@av@\v!big }\thirdofthreearguments +\letvalue{\@av@\v!medium}\secondofthreearguments +\letvalue{\@av@\v!small }\firstofthreearguments + +\def\assignvalue#1#2#3#4#5% + {\edef#2{\ifcsname\@av@#1\endcsname + \csname\@av@#1\expandafter\endcsname + \else + #1\expandafter\gobblethreearguments + \fi{#3}{#4}{#5}}} + +%D \macros +%D {assignwidth} +%D +%D Een breedte van een opgegeven tekst kan worden berekend en +%D toegekend aan een \DIMENSION\ met: +%D +%D \starttyping +%D \assignwidth +%D {\dimension} +%D {|passend|ruim} +%D {tekst} +%D \stoptyping +%D +%D Dit commando sluit, evenals de bovenstaande +%D \type{\assign}||commando's, aan op de wijze waarop +%D in de andere \CONTEXT||modules toekenningen +%D plaatsvinden. Bij \type{ruim} wordt de gemeten breedte +%D met 1~em vermeerderd. + +\def\assignwidth#1#2#3#4% + {\doifelsenothing{#2} + {\setbox\scratchbox\hbox{#3}% + #1\wd\scratchbox} + {\doifinsetelse{#2}{\v!fit,\v!broad} + {\setbox\scratchbox\hbox{#3}% + #1\wd\scratchbox + \doif{#2}\v!broad{\advance#1 #4}}% + {#1=#2}}}% + +\protect \endinput diff --git a/tex/context/base/core-gen.mkiv b/tex/context/base/core-gen.mkiv new file mode 100644 index 000000000..b6ab2a208 --- /dev/null +++ b/tex/context/base/core-gen.mkiv @@ -0,0 +1,166 @@ +%D \module +%D [ file=core-gen, +%D version=1995.10.10, +%D title=\CONTEXT\ Core Macros, +%D subtitle=General, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / General} + +\unprotect + +%D \macros +%D {assigndimension,assignalfadimension} +%D +%D Hieronder worden enkele commando's gedefinieerd rond +%D toekenningen. Allereerst een commando om waarden aan +%D een \DIMENSION\ toe te kennen: +%D +%D \starttyping +%D \assigndimension +%D {|klein|middel|groot|-klein|-middel|-groot|geen} +%D {\dimension} +%D {waarde klein} +%D {waarde middel} +%D {waarde groot} +%D \stoptyping +%D +%D Hierbij krijgt de \DIMENSION\ \type{\dimension} een waarde +%D afhankelijk van het meegegeven trefwoord. +%D +%D \startnarrower +%D \startlines +%D \type{(-)klein }\qquad (--) waarde klein +%D \type{(-)middel}\qquad (--) waarde middel +%D \type{(-)groot }\qquad (--) waarde groot +%D \type{geen }\qquad 0pt +%D \type{waarde }\qquad waarde +%D \stoplines +%D \stopnarrower +%D +%D Een trefwoord mag worden voorafgegaan door een \type{-}. +%D Deze macro toont een voorbeeld van het gebruik van +%D \type{\processaction} en constanten. +%D +%D Analoog aan het bovenstaande commando kennen we een +%D commando om waarden toe te kennen aan een macro: +%D +%D \starttyping +%D \assignalfadimension +%D {|klein|middel|groot|geen} +%D {\macro} +%D {waarde klein} +%D {waarde middel} +%D {waarde groot} +%D \stoptyping + +% The third (optimized) version: + +\def\@ad@{@ad@} + +\setvalue{\@ad@ \v!none }{\zeropoint\gobblethreearguments} +\setvalue{\@ad@ \v!big }{\thirdofthreearguments} +\setvalue{\@ad@ \v!medium}{\secondofthreearguments} +\setvalue{\@ad@ \v!small }{\firstofthreearguments} +\setvalue{\@ad@-\v!big }{-\thirdofthreearguments} +\setvalue{\@ad@-\v!medium}{-\secondofthreearguments} +\setvalue{\@ad@-\v!small }{-\firstofthreearguments} + +\def\assigndimension#1#2% #3 #4 #5 + {#2=\ifcsname\@ad@#1\endcsname + \csname\@ad@#1\expandafter\endcsname + \else + #1\expandafter\gobblethreearguments + \fi} + +\def\@aa@{@aa@} + +\setvalue{\@aa@\v!none }{0\gobblethreearguments} +\setvalue{\@aa@\v!big }{\thirdofthreearguments} +\setvalue{\@aa@\v!medium}{\secondofthreearguments} +\setvalue{\@aa@\v!small }{\firstofthreearguments} + +\def\assignalfadimension#1#2#3#4#5% #3#4#5 are single digits + {\edef#2{\ifcsname\@aa@#1\endcsname + \csname\@aa@#1\expandafter\endcsname + \else + #1\expandafter\gobblethreearguments + \fi#3#4#5}} + +%D \macros +%D {assignvalue} +%D +%D Een variant hierop is het commando: +%D +%D \starttyping +%D \assignvalue +%D {|klein|middel|groot} +%D {\macro} +%D {waarde klein } +%D {waarde middel} +%D {waarde groot} +%D \stoptyping +%D +%D Hierbij krijgt \type{\macro} een waarde afhankelijk van +%D het meegegeven trefwoord: +%D +%D \startnarrower +%D \startlines +%D \type{klein }\qquad waarde klein +%D \type{middel}\qquad waarde middel +%D \type{groot }\qquad waarde groot +%D \type{waarde}\qquad waarde +%D \stoplines +%D \stopnarrower +%D +%D Hier doet \type{geen} dus niet mee. + +\def\@av@{@av@} + +\letvalue{\@av@\v!big }\thirdofthreearguments +\letvalue{\@av@\v!medium}\secondofthreearguments +\letvalue{\@av@\v!small }\firstofthreearguments + +\def\assignvalue#1#2#3#4#5% + {\edef#2{\ifcsname\@av@#1\endcsname + \csname\@av@#1\expandafter\endcsname + \else + #1\expandafter\gobblethreearguments + \fi{#3}{#4}{#5}}} + +%D \macros +%D {assignwidth} +%D +%D Een breedte van een opgegeven tekst kan worden berekend en +%D toegekend aan een \DIMENSION\ met: +%D +%D \starttyping +%D \assignwidth +%D {\dimension} +%D {|passend|ruim} +%D {tekst} +%D \stoptyping +%D +%D Dit commando sluit, evenals de bovenstaande +%D \type{\assign}||commando's, aan op de wijze waarop +%D in de andere \CONTEXT||modules toekenningen +%D plaatsvinden. Bij \type{ruim} wordt de gemeten breedte +%D met 1~em vermeerderd. + +\def\assignwidth#1#2#3#4% + {\doifelsenothing{#2} + {\setbox\scratchbox\hbox{#3}% + #1\wd\scratchbox} + {\doifinsetelse{#2}{\v!fit,\v!broad} + {\setbox\scratchbox\hbox{#3}% + #1\wd\scratchbox + \doif{#2}\v!broad{\advance#1 #4}}% + {#1=#2}}}% + +\protect \endinput diff --git a/tex/context/base/core-gen.tex b/tex/context/base/core-gen.tex deleted file mode 100644 index b6ab2a208..000000000 --- a/tex/context/base/core-gen.tex +++ /dev/null @@ -1,166 +0,0 @@ -%D \module -%D [ file=core-gen, -%D version=1995.10.10, -%D title=\CONTEXT\ Core Macros, -%D subtitle=General, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Core Macros / General} - -\unprotect - -%D \macros -%D {assigndimension,assignalfadimension} -%D -%D Hieronder worden enkele commando's gedefinieerd rond -%D toekenningen. Allereerst een commando om waarden aan -%D een \DIMENSION\ toe te kennen: -%D -%D \starttyping -%D \assigndimension -%D {|klein|middel|groot|-klein|-middel|-groot|geen} -%D {\dimension} -%D {waarde klein} -%D {waarde middel} -%D {waarde groot} -%D \stoptyping -%D -%D Hierbij krijgt de \DIMENSION\ \type{\dimension} een waarde -%D afhankelijk van het meegegeven trefwoord. -%D -%D \startnarrower -%D \startlines -%D \type{(-)klein }\qquad (--) waarde klein -%D \type{(-)middel}\qquad (--) waarde middel -%D \type{(-)groot }\qquad (--) waarde groot -%D \type{geen }\qquad 0pt -%D \type{waarde }\qquad waarde -%D \stoplines -%D \stopnarrower -%D -%D Een trefwoord mag worden voorafgegaan door een \type{-}. -%D Deze macro toont een voorbeeld van het gebruik van -%D \type{\processaction} en constanten. -%D -%D Analoog aan het bovenstaande commando kennen we een -%D commando om waarden toe te kennen aan een macro: -%D -%D \starttyping -%D \assignalfadimension -%D {|klein|middel|groot|geen} -%D {\macro} -%D {waarde klein} -%D {waarde middel} -%D {waarde groot} -%D \stoptyping - -% The third (optimized) version: - -\def\@ad@{@ad@} - -\setvalue{\@ad@ \v!none }{\zeropoint\gobblethreearguments} -\setvalue{\@ad@ \v!big }{\thirdofthreearguments} -\setvalue{\@ad@ \v!medium}{\secondofthreearguments} -\setvalue{\@ad@ \v!small }{\firstofthreearguments} -\setvalue{\@ad@-\v!big }{-\thirdofthreearguments} -\setvalue{\@ad@-\v!medium}{-\secondofthreearguments} -\setvalue{\@ad@-\v!small }{-\firstofthreearguments} - -\def\assigndimension#1#2% #3 #4 #5 - {#2=\ifcsname\@ad@#1\endcsname - \csname\@ad@#1\expandafter\endcsname - \else - #1\expandafter\gobblethreearguments - \fi} - -\def\@aa@{@aa@} - -\setvalue{\@aa@\v!none }{0\gobblethreearguments} -\setvalue{\@aa@\v!big }{\thirdofthreearguments} -\setvalue{\@aa@\v!medium}{\secondofthreearguments} -\setvalue{\@aa@\v!small }{\firstofthreearguments} - -\def\assignalfadimension#1#2#3#4#5% #3#4#5 are single digits - {\edef#2{\ifcsname\@aa@#1\endcsname - \csname\@aa@#1\expandafter\endcsname - \else - #1\expandafter\gobblethreearguments - \fi#3#4#5}} - -%D \macros -%D {assignvalue} -%D -%D Een variant hierop is het commando: -%D -%D \starttyping -%D \assignvalue -%D {|klein|middel|groot} -%D {\macro} -%D {waarde klein } -%D {waarde middel} -%D {waarde groot} -%D \stoptyping -%D -%D Hierbij krijgt \type{\macro} een waarde afhankelijk van -%D het meegegeven trefwoord: -%D -%D \startnarrower -%D \startlines -%D \type{klein }\qquad waarde klein -%D \type{middel}\qquad waarde middel -%D \type{groot }\qquad waarde groot -%D \type{waarde}\qquad waarde -%D \stoplines -%D \stopnarrower -%D -%D Hier doet \type{geen} dus niet mee. - -\def\@av@{@av@} - -\letvalue{\@av@\v!big }\thirdofthreearguments -\letvalue{\@av@\v!medium}\secondofthreearguments -\letvalue{\@av@\v!small }\firstofthreearguments - -\def\assignvalue#1#2#3#4#5% - {\edef#2{\ifcsname\@av@#1\endcsname - \csname\@av@#1\expandafter\endcsname - \else - #1\expandafter\gobblethreearguments - \fi{#3}{#4}{#5}}} - -%D \macros -%D {assignwidth} -%D -%D Een breedte van een opgegeven tekst kan worden berekend en -%D toegekend aan een \DIMENSION\ met: -%D -%D \starttyping -%D \assignwidth -%D {\dimension} -%D {|passend|ruim} -%D {tekst} -%D \stoptyping -%D -%D Dit commando sluit, evenals de bovenstaande -%D \type{\assign}||commando's, aan op de wijze waarop -%D in de andere \CONTEXT||modules toekenningen -%D plaatsvinden. Bij \type{ruim} wordt de gemeten breedte -%D met 1~em vermeerderd. - -\def\assignwidth#1#2#3#4% - {\doifelsenothing{#2} - {\setbox\scratchbox\hbox{#3}% - #1\wd\scratchbox} - {\doifinsetelse{#2}{\v!fit,\v!broad} - {\setbox\scratchbox\hbox{#3}% - #1\wd\scratchbox - \doif{#2}\v!broad{\advance#1 #4}}% - {#1=#2}}}% - -\protect \endinput diff --git a/tex/context/base/core-grd.mkii b/tex/context/base/core-grd.mkii new file mode 100644 index 000000000..249e2e430 --- /dev/null +++ b/tex/context/base/core-grd.mkii @@ -0,0 +1,1074 @@ +%D \module +%D [ file=core-grd, +%D version=1998.03.10, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Grid Snapping (Experimental), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / Grid Snapping} + +\unprotect + +%D Moved from supp-box: + +%D \macros +%D {startbaselinecorrection,baselinecorrection, +%D showbaselinecorrection,offbaselinecorrection} +%D +%D Spacing around ruled boxes can get pretty messed up. The +%D next macro tries as good as possible to fix this. +%D +%D \startbuffer[1] +%D \startbaselinecorrection +%D \ruledhbox{Rule Brittanica} +%D \stopbaselinecorrection +%D \stopbuffer +%D +%D \typebuffer[1] +%D +%D The macros put some white space around the box: +%D +%D \getbuffer[1] +%D +%D A simple alternative is \type {\baselinecorrection}, which +%D only looks at the previous line. +%D +%D \startbuffer[2] +%D \baselinecorrection +%D \ruledhbox{Rule Brittanica} +%D \baselinecorrection +%D \stopbuffer +%D +%D \typebuffer[2] +%D +%D This time the last preceding line gets a correction,% +%D dependant on the depth. +%D +%D \getbuffer[2] +%D +%D One can make the correction visible by saying \type +%D {\showbaselinecorrection}. Part of the correction is +%D calculated from the dimensions of a~(. One can disble the +%D correction by calling \type {\offbaselinecorrection}. +%D +%D When visualize the first example looks like: +%D +%D {\showbaselinecorrection\getbuffer[1]} +%D +%D and the second one comes out as: +%D +%D {\showbaselinecorrection\getbuffer[2]} + +% \definecolor[GridLineColor][red] +% \definecolor[GridTextColor][blue] + +\definepalet + [grid] + [ one=red, + two=green, + three=blue, + four=gray] + +\def\setbaselinecorrections + {\setbox0\hbox{\setstrut\strut}% + \setbox2\hbox{(}% + \dimen0\ht0\advance\dimen0 -\ht2 + \ifdim\dimen0<\zeropoint\dimen0\zeropoint\fi + \dimen2\dp0\advance\dimen2 -\dp2 + \ifdim\dimen2<\zeropoint\dimen2\zeropoint\fi + \edef\thetopbaselinecorrection {\the\dimen0}\dimen0-\dimen0 + \edef\thebotbaselinecorrection {\the\dimen2}\dimen2-\dimen2 + \edef\thenegtopbaselinecorrection{\the\dimen0}% + \edef\thenegbotbaselinecorrection{\the\dimen2}} + +\def\dotopbaselinecorrection {\kern\thetopbaselinecorrection} +\def\dobotbaselinecorrection {\kern\thebotbaselinecorrection} +\def\donegtopbaselinecorrection{\kern\thenegtopbaselinecorrection} +\def\donegbotbaselinecorrection{\kern\thenegbotbaselinecorrection} + +\def\showbaselinecorrection + {\def\dobaselinecorrection % visualization is not watertight! + {\bgroup +\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi + \setbox0\null + \wd0\hsize + \dp0\strutdp + \nointerlineskip + \forgetall + \ruledvbox{\box0}% + \egroup + \prevdepth\strutdp}% + \def\dotopbaselinecorrection + {\hrule\!!height\thetopbaselinecorrection}% + \def\dobotbaselinecorrection + {\hrule\!!height\thebotbaselinecorrection}} + +\def\dobaselinecorrection + {\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi + \kern\strutdp + \prevdepth\strutdp} + +% \def\baselinecorrection +% {\endgraf +% \ifvmode +% \ifdim\prevdepth<\maxdimen +% \ifdim\prevdepth<\zeropoint \else +% \ifdim\prevdepth<\strutdp +% \dobaselinecorrection +% \fi +% \fi +% \fi +% \fi} + +\def\baselinecorrection + {\endgraf + \ifvmode + \ifdim\prevdepth<\maxdimen + \ifdim\prevdepth<\zeropoint \else + \ifdim\prevdepth<\strutdepth \relax + \pushlastnode + \dobaselinecorrection + \poplastnode + \fi + \fi + \fi + \fi} + +\def\pagebaselinecorrection + {\ifdim\pagegoal<\maxdimen + \ifdim\pagetotal>\lineheight % or \topskip + \scratchdimen\pagetotal + \advance\scratchdimen\lineheight + \ifdim\scratchdimen<\pagegoal + \baselinecorrection + \fi + \fi + \fi} + +% Beware, keep this one as it is, see for instance module +% m-steps.tex, where we apply a \localhsize to the \vbox, in +% order to follow narrower and side floats ! + +% \def\startbaselinecorrection +% {\baselinecorrection +% \ifvmode +% \bgroup +% \setbox\scratchbox\vbox\bgroup +% \ignorespaces +% \let\stopbaselinecorrection\dostopbaselinecorrection +% \else +% \let\stopbaselinecorrection\relax +% \fi} + +% \def\dostopbaselinecorrection % I have to check columns yet. +% {\endgraf +% \egroup +% \topbaselinecorrection +% \box\scratchbox +% \botbaselinecorrection +% \egroup} + +% \let\stopbaselinecorrection=\relax + +\def\startbaselinecorrection + {\bgroup + \let\stopbaselinecorrection\egroup + \ifcase\baselinecorrectionmode + \or % normal + \baselinecorrection + \ifvmode + \setbox\scratchbox\vbox\bgroup\ignorespaces + \let\stopbaselinecorrection\donormalstopbaselinecorrection + \fi + \or % off + \or % force + \baselinecorrection + \ifvmode + \setbox\scratchbox\vbox\bgroup\ignorespaces + \let\stopbaselinecorrection\doforcedstopbaselinecorrection + \fi + \fi} + +\let\stopbaselinecorrection\relax + +\def\donormalstopbaselinecorrection % I have to check columns yet. + {\egroup + \topbaselinecorrection + \box\scratchbox + \botbaselinecorrection + \egroup} + +\def\doforcedstopbaselinecorrection % I have to check columns yet. + {\egroup + \forcedtopbaselinecorrection + \box\scratchbox + \forcedbotbaselinecorrection + \egroup} + +%D We do a bit more checking than needed. The pageborder check +%D is not needed, but I want to look the visualization as good +%D as possible too. + +% \def\offbaselinecorrection % Can be used inside correction. +% {\def\startbaselinecorrection{\bgroup\let\stopbaselinecorrection\egroup}} + +\chardef\baselinecorrectionmode\plusone + +\def\onbaselinecorrection {\chardef\baselinecorrectionmode\plusone } +\def\offbaselinecorrection {\chardef\baselinecorrectionmode\plustwo } +\def\forcebaselinecorrection{\chardef\baselinecorrectionmode\plusthree} + +%D \macros +%D {topbaselinecorrection,botbaselinecorrection} +%D +%D The actual top and bottom corrections are implemented as: + +% \def\topbaselinecorrection +% {\ifvmode \ifdim\pagegoal<\maxdimen +% \bgroup +% \setbaselinecorrections +% \whitespace +% \nointerlineskip +% \dotopbaselinecorrection +% \egroup +% \fi \fi} + + +\def\topbaselinecorrection + {\ifvmode \ifdim\pagegoal<\maxdimen + \forcedtopbaselinecorrection + \fi \fi} + +\def\forcedtopbaselinecorrection + {\ifvmode + \bgroup + \setbaselinecorrections + \whitespace + \nointerlineskip + \dotopbaselinecorrection + \egroup + \fi} + +\def\botbaselinecorrection + {\ifvmode + \bgroup + \setbaselinecorrections + \dobotbaselinecorrection + \allowbreak % new, otherwise problems when many in a row + \prevdepth\strutdp + \egroup + \fi} + +\let\forcedbotbaselinecorrection\botbaselinecorrection + +%D Still very experimental and therefore undocumented. + +\newif\ifgridsnapping % UNDER DEVELOPMENT, USE WITH CARE +\newif\ifforcepresnap \forcepresnaptrue % false in mixed single/double +\newif\ifstrutsnapping \strutsnappingtrue % sometimes handy to be false + +\def\positiveextrasnap {\gdef\extrasnapsign{+}} +\def\negativeextrasnap {\gdef\extrasnapsign{-}} + +\def\extrasnapreset {\global\chardef\@@extrasnap0 + \positiveextrasnap} +\def\extrasnapbefore {\global\chardef\@@extrasnap1 } +\def\extrasnaparound {\global\chardef\@@extrasnap2 } +\def\extrasnapafter {\global\chardef\@@extrasnap3 } + +\def\enablepresnapcorrection {\global\chardef\@@presnap\zerocount} +\def\disablepresnapcorrection {\global\chardef\@@presnap\plusone} + +\extrasnapreset \enablepresnapcorrection + +\newif\iftracegridsnapping +\newif\ifshowgridboxes +\newif\ifshowfuzzyskips + +\let\showgridboxes\showgridboxestrue + +\def\showgridsnapping + {\tracegridsnappingtrue + \showgridboxestrue} + +\chardef\@@alignsnap =0 +\chardef\@@alignsnapbox =0 +\chardef\@@alignsnapmethod=0 + +\let\presnapskip \!!zeropoint \def\presnap {-} +\let\postsnapskip\!!zeropoint \let\postsnap\presnap + +\newcount\currentgridsnap + +\def\tracedsnapping + {\iftracegridsnapping + \llap + {\startlayoutcomponent{gridsnaps}{grid snaps}% + \infofont + \global\advance\currentgridsnap\plusone + \color[grid:three]{\vl\presnapskip + \vl\presnap + \vl\postsnap + \ifcase\@@alignsnapbox\relax + \vl\ifcase\@@extrasnap + 00\or + \extrasnapsign0\or + \extrasnapsign\extrasnapsign\or + 0\extrasnapsign\fi + \fi + \vl\the\currentgridsnap\vl}% + \stoplayoutcomponent}% + \fi} + +\def\snaptogrid% [#1]#2 -> #2 == \hbox|\vbox + {\dosingleempty\dosnaptogrid} + +% \def\dosnaptogrid[#1]% +% {\ifgridsnapping +% \iffirstargument\doifsomething{#1}{\verplaatsopgrid[#1]}\fi +% \expandafter\dodosnaptogrid +% \fi} + +% \def\dosnaptogrid[#1]% +% {\resetlastlinewidth % maybe in more places, otherwise spacing gets messed up +% \ifgridsnapping +% \iffirstargument\doifsomething{#1}{\moveongrid[#1]}\fi +% \expandafter\dodosnaptogrid +% \fi} + +\def\dosnaptogrid[#1]% + {\resetlastlinewidth % maybe in more places, otherwise spacing gets messed up + \doifinsetelse\v!force{#1}% + {\moveongrid[#1]% + \dodosnaptogrid} + {\ifgridsnapping + \doifsomething{#1}{\moveongrid[#1]}% + \expandafter\dodosnaptogrid + \fi}} + +% \def\forcedpresnapcorrection % test this on 'details' +% {\ifforcepresnap +% \ifvmode \else \par \fi % new +% % we don't want top of page space when 'top' option +% %\verticalstrut\nobreak\vskip-\struttotal +% %\verticalstrut\vskip-\struttotal +% % nobreak really needed +% \allowbreak\verticalstrut\nobreak\vskip-\struttotal +% %\ifdim\pagetotal>\topskip \else +% % eigenlijk signal +% %\writestatus{grid}{removing dummy at top of page}% +% %\bgroup +% %\output{\setbox\scratchbox\box255}% +% %\penalty\outputpenalty +% %\egroup +% %\fi +% \fi} + +\def\forcedpresnapcorrection % test this on 'details' + {\ifforcepresnap + \ifvmode \else \par \fi % new + % we don't want top of page space when 'top' option + % \verticalstrut\nobreak\vskip-\struttotal + % \verticalstrut\vskip-\struttotal + % \nobreak really needed + % \dosomebreak\allowbreak % no: spoils heads, so only under know situation, not in snapper + \verticalstrut + \nobreak + \vskip-\struttotal + %\ifdim\pagetotal>\topskip \else + % eigenlijk signal + %\writestatus{grid}{removing dummy at top of page}% + %\bgroup + %\output{\setbox\scratchbox\box255}% + %\penalty\outputpenalty + %\egroup + %\fi + \fi} + +\def\setgridtracebox#1[#2]% % maybe reverse the order + {\setbox\nextbox#1% + {\hbox + {\hbox to \zeropoint + {\startlayoutcomponent{gridsnaps}{grid snaps}% + \color[grid:#2]{\ruledhbox{\fakebox\nextbox}}% + \stoplayoutcomponent + \hss}% + \flushnextbox}}} + +\newif\ifboxedsnapping \boxedsnappingtrue + +\chardef\depthsnapmethod \plusone % downward compatible, minus one line +\chardef\heightsnapmethod\plusone % downward compatible, minus one line + +\def\dodosnaptogrid + {\dowithnextbox + {\bgroup + \ifcase\@@alignsnapmethod \or + % we're dealing with text with a possible big depth/height + \chardef\depthsnapmethod \plustwo + \chardef\heightsnapmethod\plustwo + \fi + \ifdim\nextboxht<\textheight % handle special case (like page fig) + \ifcase\@@alignsnapbox\relax + \ifcase\@@alignsnap\else % 1=top 2=high 3=middle 4=low + \ifshowgridboxes + \setgridtracebox\hbox[two]% + \fi + %\getnoflines{\nextboxht}% + \getnoflines\nextboxht + \setbox\nextbox\vbox to \noflines\lineheight + {\ifnum\@@alignsnap=1 \kern\lineheight\kern-\topskip\fi + \ifnum\@@alignsnap>2 \vfill\fi + \flushnextbox + \ifnum\@@alignsnap<4 \vfill\fi}% + \fi + \ifshowgridboxes + \setgridtracebox\hbox[three]% + \fi + \forgetall + \par + \ifvbox\nextbox + \setbox\nextbox\hbox{\flushnextbox}% don't ask + \fi + \scratchskip\lastskip + \edef\presnapskip{\the\lastskip}% + % mixing single/double columns sometimes goes wrong, + % check 'som' document + \ifinsidecolumns + \forcepresnaptrue + \fi + \forcedpresnapcorrection + \ifdim\nextboxht>\strutht + \scratchdimen\nextboxht + \ifcase\@@presnap\relax + \ifdim\scratchskip>\zeropoint\relax + \scratchcounter\scratchskip + \advance\scratchcounter -\openlineheight + \ifnum\scratchcounter<0 + \scratchcounter-\scratchcounter + \fi + \ifnum\scratchcounter<10 % \lastkip is about \openlineheight + \advance\scratchdimen -\openstrutdepth + \edef\presnapskip{*\presnapskip}% + \else\ifdim\scratchskip>\openlineheight + %<\openlineheight \else + \advance\scratchdimen -\openstrutdepth + \edef\presnapskip{*\presnapskip}% + \fi\fi + \fi + \fi + % \getnoflines\scratchdimen % maybe raw ? + % \advance\noflines -1 + \ifcase\heightsnapmethod + % raw + \or + \advance\scratchdimen-\lineheight % tight (default) + \or + \advance\scratchdimen-\strutheight % fit (text) + \or + \advance\scratchdimen-\strutheight % tolerant + \advance\scratchdimen-\roundingeps + \fi + \getnoflines\scratchdimen + \ifnum\noflines>0 + \scratchdimen\noflines\lineheight + \else + \scratchdimen\zeropoint + \fi + \else + \scratchdimen\zeropoint + \fi + \ifnum\@@extrasnap=1 \advance\scratchdimen \extrasnapsign \lineheight \fi + \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi + \edef\presnap{\the\scratchdimen}% + \ifstrutsnapping + \ifboxedsnapping + \getrawnoflines\scratchdimen + \advance\scratchdimen-\noflines\lineheight + \vskip\scratchdimen % disappears at top of page + \dorecurse\noflines{\verticalstrut\nobreak}% + \else \ifdim\scratchdimen=\zeropoint + % nothing to skip + \else % disappears at top of page + \vskip\scratchdimen + \fi \fi + \fi + \ifdim\nextboxdp>\strutdp + % \getnoflines\nextboxdp + % \advance\noflines \minusone + \scratchdimen\nextboxdp\relax + \ifcase\depthsnapmethod + % raw + \or + \advance\scratchdimen-\lineheight % tight (default) + \or + \advance\scratchdimen-\strutdepth % fit (text) + \or + \advance\scratchdimen-\strutdepth % tolerant + \advance\scratchdimen-\roundingeps + \fi + \getnoflines\scratchdimen + \ifnum\noflines>0 + \scratchdimen\noflines\lineheight + \else + \scratchdimen\zeropoint + \fi + \else + \scratchdimen\zeropoint + \fi + \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi + \ifnum\@@extrasnap=3 \advance\scratchdimen \extrasnapsign \lineheight \fi + \edef\postsnap{\the\scratchdimen}% + \ifstrutsnapping + \nextboxht\strutht + \nextboxdp\strutdp + \else + \scratchdimen\presnap + \advance\scratchdimen \strutht + \nextboxht\scratchdimen + \scratchdimen\postsnap + \advance\scratchdimen \strutdp + \nextboxdp\scratchdimen + \fi + \hbox{\tracedsnapping\flushnextbox}% + \ifstrutsnapping + \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi + \fi + \else + \scratchdimen\nextboxht\relax + \ifcase\@@alignsnapbox + % can't happen here + \or + \getrawnoflines\scratchdimen + \else + \getnoflines \scratchdimen + \fi + \scratchdimen\noflines\lineheight\relax + \advance\scratchdimen-\strutdepth + % spoils the whole game (fit/broad/line) + % \ifnum\pagetotal>\zeropoint \else % disable this as option + % \advance\scratchdimen-\strutheight + % \advance\scratchdimen+\topskip + % \fi + \dimen0=\scratchdimen + \dimen2=\strutdepth + \ifshowgridboxes + \setgridtracebox\hbox[two]% + \fi + \nextboxdp\strutdp + \dimen4=\nextboxht + \dimen6=\nextboxdp + \iftracegridsnapping + \setbox\scratchbox\hbox + {\scratchdimen\@@alignsnapamount\relax + \ifdim\scratchdimen<\zeropoint + \tracedgridamount\zeropoint{-\scratchdimen}% + \else + \tracedgridamount\scratchdimen\zeropoint + \fi}% + \smashbox\scratchbox + \setbox\nextbox\hbox{\box\scratchbox\flushnextbox}% + \fi + \setbox\nextbox\hbox + {\scratchdimen\@@alignsnapamount\relax + \ifcase\@@alignsnapdepth\or + % don't change this ever ! + \ifdim\dimen0<\lineheight + % otherwise it is ok, but ending up inside + % the next paragraph is seldom what we want, + % so we move one line up + \advance\scratchdimen-\lineheight + \advance\scratchdimen\strutheight + \else + % otherwise we can move down to the + % baseline + \advance\scratchdimen\dimen6 % == \strutdepth + \fi + \fi + \lower\scratchdimen\flushnextbox}% + \nextboxht\dimen4 + \nextboxdp\dimen6 + \ifnum\@@alignsnap<4 % 4 = regel + \setbox\nextbox\vbox to \scratchdimen + {\forgetall + \ifnum\@@alignsnap>2 \vfill\fi % 3 4 + \flushnextbox + \nointerlineskip % \offinterlineskip + \ifnum\@@alignsnap<4 \vfill\fi % 2 3 + \kern\zeropoint}% + \fi + \ifshowgridboxes + \setgridtracebox\vbox[three]% + \fi + \scratchdimen\@@alignsnapamount + \edef\presnapskip{\the\scratchdimen}% + \ifnum\@@alignsnap>2 \def\presnap {+}\fi + \ifnum\@@alignsnap<4 \def\postsnap{+}\fi + \setbox\nextbox\hbox{\tracedsnapping\flushnextbox}% + \par + \nextboxht\dimen0 + \nextboxdp\dimen2 + \forcedpresnapcorrection + \nointerlineskip + \flushnextbox + \fi + \else + \setbox\nextbox\vbox to \textheight + {\ifdim\nextboxdp=\zeropoint + \hbox{\lower\strutdepth\flushnextbox} + \else % this branch is yet untested + \vss + \hbox{\lower\nextboxdp\flushnextbox} + \vskip-\strutdepth + \fi}% + \nextboxdp\strutdepth + \flushnextbox + \fi + \extrasnapreset + \enablepresnapcorrection + \global\chardef\@@alignsnap\zerocount + \global\chardef\@@alignsnapbox\zerocount + \egroup}} + +\def\tracedgridamount#1#2% + {\startlayoutcomponent{gridsnaps}{grid snaps}% + \color[grid:four]{\vrule\!!width\nextboxwd\!!height#1\!!depth#2}% + \stoplayoutcomponent} + +\def\snaptomathgrid % probably not working ok, also kind of obsolete + {\ifgridsnapping + \dowithnextbox + {\blank[\v!line]\snaptogrid\vbox{\flushnextbox}\blank[\v!line]} + \vbox\bgroup + \forgetdisplayskips + \@EA\let\@EA\next + \fi} + +\def\topsnaptogrid + {\ifgridsnapping + \dowithnextbox + {\scratchdimen\nextboxht + \advance\scratchdimen -\strutht + \advance\scratchdimen \topskip + \nextboxht\scratchdimen + \nextboxdp\zeropoint + \flushnextbox + \kern\lineheight + \kern-\topskip + \nointerlineskip} + \hbox + \fi} + +% \def\centertogrid % meant for special situations +% {\ifgridsnapping +% \dowithnextboxcontent +% {\ignorespaces} +% {\bgroup +% \par +% \scratchdimen\nextboxht +% \advance\scratchdimen \nextboxdp +% \getnoflines\scratchdimen +% \setbox\nextbox\vbox to \noflines\lineheight +% {\forgetall +% \vskip\zeropoint \!!plus \nextboxht +% \copy\nextbox +% \kern.5\strutdp % VOORLOPIGE WAARDE +% \vskip\zeropoint \!!plus \nextboxdp}% +% \noindent\snaptogrid\vbox{\flushnextbox}% +% \egroup} +% \vbox % was \hbox +% \fi} + +% The next implementation is sub-optimal +% +% \def\centertogrid % usage: see ie pascal / stepcharts +% {\snaptogrid[\v!midden,.5\strutdp]\vbox} + +\def\centertogrid % meant for special situations + {\ifgridsnapping + \dowithnextboxcontent + {\ignorespaces} + {\bgroup + \par + \scratchdimen\nextboxht + \advance\scratchdimen \nextboxdp + \getnoflines\scratchdimen + \setbox\nextbox\vbox to \noflines\lineheight + {\forgetall + \vss + \topbaselinecorrection + \copy\nextbox + \botbaselinecorrection + \vss}% + \setbox\nextbox\hbox{\lower\strutdp\flushnextbox}% + \forgeteverypar % new per 3/4/2008, prevents duplicate pos nodes resulting in extra whitespace + \noindent\snaptogrid\vbox{\flushnextbox}% + \egroup} + \vbox % was \hbox + \fi} + +% testbed for \centertogrid +% +% \strut Bruggetje +% \startlinecorrection +% \startcombination +% {\framed{test}} {} {\framed{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection +% \startcombination[2*2] +% {\framed{test}} {} {\framed{test}} {} +% {\framed{test}} {} {\framed{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection[blank] +% \startcombination +% {\framed{test}} {} {\framed{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection[blank] +% \startcombination[2*2] +% {\framed{test}} {} {\framed{test}} {} +% {\framed{test}} {} {\framed{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection +% \startcombination +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection +% \startcombination[2*2] +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection[blank] +% \startcombination +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection[blank] +% \startcombination[2*2] +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% \stopcombination +% \stoplinecorrection + +\ifx\startbaselinecorrection\undefined \wait \fi % change order + +\let\normalstartbaselinecorrection=\startbaselinecorrection + +\def\startbaselinecorrection + {\ifgridsnapping + \centertogrid\bgroup + \let\stopbaselinecorrection\egroup + \else + \normalstartbaselinecorrection + \fi} + +\chardef\gridboxlinenomode\plusone +\chardef\gridboxlinemode \plusone % 0:nothing 1:all 2:lines 3:frame + +\def\gridboxvbox {\ifcase\gridboxlinemode\vbox\or\ruledvbox\or\vbox\or\ruledvbox\else\ruledvbox\fi} +\def\gridboxwidth{\ifcase\gridboxlinemode0\or.5\or.5\or0\else.5\fi\testrulewidth} + +\def\setgridbox#1#2#3% + {\setbox#1\gridboxvbox to #3 % given size + {\forgetall + \resetteststrut + \offinterlineskip + \hsize#2% + \baselinerulefalse + \gridboxvbox % calculated size + {\getrawnoflines{#3}% \getnoflines{#3}% + \vskip\topskip + \vskip-\strutht + \scratchdimen#2\advance\scratchdimen \lineheight + \dorecurse\noflines + {\strut + \hskip-.5\lineheight + \ifcase\gridboxlinenomode\or + \rlap + {\hskip.2\bodyfontsize\hskip\scratchdimen + \infofont\hbox to 1em{\hss\recurselevel}}% + \or + \llap + {\infofont\hbox to 1em{\hss\recurselevel}% + \hskip.2\bodyfontsize}% + \fi + \vrule + \!!height \gridboxwidth + \!!depth \gridboxwidth + \!!width \scratchdimen + \par}} + \vfill}} + +%D Some intervention macros: + +\def\gridwarning#1{\message{[beware of #1 extra snap]}} + +\global\let\@@alignsnapamount\!!zeropoint +\global\chardef\@@alignsnapdepth0 + +\def\@@unknowngriddisplacement + {\global\chardef\@@alignsnapbox\plusthree + \global\let\@@alignsnapamount\commalistelement} + +\def\domoveongrid[#1]% + {\ifgridsnapping\doifsomething{#1}{\dodomoveongrid[#1]}\fi} + +\def\dodomoveongrid[#1]% some day : speed up + {\global\chardef\@@alignsnap\zerocount + \global\chardef\@@alignsnapbox\zerocount + \global\chardef\@@alignsnapdepth\zerocount + \global\chardef\@@alignsnapmethod\zerocount + \global\let\@@alignsnapamount\!!zeropoint + \donefalse + \expanded{\processallactionsinset[#1]} + [\v!standard=>, + \v!normal=>, % to be sure + \v!yes=>, % to be sure + \v!top=>\gridwarning+\positiveextrasnap\extrasnapbefore, + \v!bottom=>\gridwarning+\positiveextrasnap\extrasnapafter, + \v!both=>\positiveextrasnap\extrasnaparound, + -\v!top=>\gridwarning-\negativeextrasnap\extrasnapbefore, + -\v!bottom=>\gridwarning-\negativeextrasnap\extrasnapafter, + -\v!both=>\negativeextrasnap\extrasnaparound, + \v!text=>\global\chardef\@@alignsnapmethod\plusone, % accurate calculations + \v!page=>\global\chardef\@@alignsnap\plusone, % topskip + \v!high=>\global\chardef\@@alignsnap\plustwo, + \v!middle=>\global\chardef\@@alignsnap\plusthree, + \v!low=>\global\chardef\@@alignsnap\plusfour, + \v!fit=>\global\chardef\@@alignsnapbox\plusone, % new + \v!broad=>\global\chardef\@@alignsnapbox\plustwo, % new + \v!depth=>\global\chardef\@@alignsnapdepth\plusone, % new + \v!line=>\global\chardef\@@alignsnapbox\plusthree +% \global\chardef\@@alignsnapdepth\plusone + \global\chardef\@@alignsnap\plusfour, + \v!reset=>\positiveextrasnap\extrasnapreset, + \v!none=>\global\chardef\@@alignsnap\zerocount + \global\chardef\@@alignsnapbox\zerocount, + \v!force=>, % turns on grid snapping even when not on + \s!default=>, + \s!unknown=>\@@unknowngriddisplacement]} + +\def\moveongrid + {\dosingleempty\domoveongrid} + +\def\doplaceongrid[#1]% + {\domoveongrid[#1]\snaptogrid\vbox} + +\def\placeongrid + {\dosingleempty\doplaceongrid} + +%D Snapping is rather robust as long as we use whole lines. +%D Half lines of white space can however be handled when they +%D come in pairs. The corrections needed when crossing page +%D boundaries in the middle of such a pair, are handled by +%D macros that are (named) sort of fuzzy. This fuzzy mechanism +%D was written as an extension to the grid typesetting needed +%D for typesetting (part of) the \MAPS. +%D +%D \starttyping +%D \setuptyping +%D [before={\blank[halfline]}, +%D after={\blank[halfline]}] +%D \stoptyping + +\newif \iffuzzyvskip +\newif \iffuzzysnapdone +\newif \iffuzzysnapping +\newif \iffuzzysnapped +\chardef \fuzzysnappedleft=0 % ==1 when fuzzybegin still open +\newpersistentmark\fuzzymark % (!) +\newcount \fuzzymarker +\newbox \fuzzysnapbox +\newbox \fuzzysnapsplit + +\def\dosyncfuzzyvskip + {\ifvmode\ifdim\lastskip<\lineheight\ifdim\lastskip>\zeropoint + \bgroup % - added 28/2/2003: check this, there was no - + \endgraf\forgetall\verticalstrut\nobreak\vskip-\struttotal + \egroup + \fi\fi\fi} + +\def\fuzzyvskip#1% + {\iffuzzysnapdone + \dosyncfuzzyvskip % NEWER + \endfuzzysnapping + \vskip#1\relax + \global\fuzzysnapdonefalse + \else + \vskip#1\relax + \beginfuzzysnapping + \global\fuzzysnapdonetrue + \fi} + +\def\setfuzzymark#1#2#3% #1/#2 => error recovery + {\ifgridsnapping + \global\fuzzysnappingtrue + \global\advance\fuzzymarker \ifodd\fuzzymarker#1\else#2\fi + \nobreak + \ifshowfuzzyskips + \hbox{\color[grid:three] + {\llap{\infofont#3\vl\the\fuzzymarker}\nobreak + \vrule\!!width\hsize\!!height.1\lineheight}} + \nobreak + \fi + %[\the\fuzzymarker] + %\expandafter\fuzzymark\expandafter{\the\fuzzymarker}% + \expandafter\rawsetmark\expandafter\fuzzymark\expandafter{\the\fuzzymarker}% + \nobreak + \fi} + +\def\beginfuzzysnapping{\setfuzzymark21\v!start} % odd +\def\endfuzzysnapping {\setfuzzymark12\v!stop } % even + +\def\removelastfuzzyvskip + {\ifgridsnapping + \iffuzzysnapping + \ifdim\lastskip<\openlineheight + \else + \removelastskip + \fi + \else + \removelastskip + \fi + \else + \removelastskip + \fi} + +\def\docheckfuzzysnap#1% + {\bgroup + \dontcomplain + \setbox\fuzzysnapbox\copy#1\relax + \setbox\fuzzysnapsplit\vsplit\fuzzysnapbox to 1\lineheight + \let\topfuzzymark\empty % indeed here ... no real mark + \getsplitmarks\fuzzymark +% \ifcase0\topfuzzymark + \ifcase0\rawgetsplittopmark\fuzzymark + \global\chardef\fuzzysnappedleft\zerocount + \global\fuzzysnappedfalse +% \else\ifodd\topfuzzymark + \else\ifodd\rawgetsplittopmark\fuzzymark + \global\chardef\fuzzysnappedleft\plusone + \global\fuzzysnappedtrue + \else + \global\chardef\fuzzysnappedleft=2 + \global\fuzzysnappedtrue + \fi\fi + \iffuzzysnapped \else + \doloop + {\ifvoid\fuzzysnapbox + \exitloop + \else + \setbox\fuzzysnapsplit=\vsplit\fuzzysnapbox to \lineheight + %\let\topfuzzymark=\empty % ... but not here + \getsplitmarks\fuzzymark +% \ifcase0\topfuzzymark + \ifcase0\rawgetsplittopmark\fuzzymark + % continue +% \else\ifodd\topfuzzymark + \else\ifodd\rawgetsplittopmark\fuzzymark + \exitloop + \else + \global\chardef\fuzzysnappedleft\plusone + \global\fuzzysnappedtrue + \exitloop + \fi\fi + \fi}% + \fi + \egroup} + +\def\getfuzzysnapcorrection#1% + {\global\let\presnapcorrection \relax + \global\let\postsnapcorrection\relax + \ifgridsnapping\iffuzzysnapping + \docheckfuzzysnap{#1}% + \iffuzzysnapped + \iftracegridsnapping + \gdef\presnapcorrection + {\color[grid:four]{\hrule\!!height.5\openlineheight\!!width\hsize}}% + \else + \gdef\presnapcorrection{\kern.5\openlineheight}% + \fi + \gdef\postsnapcorrection{\kern-.5\openlineheight}% get the height ok + \fi + \fi\fi} + +\def\fuzzysnappedbox#1#2% \box \unvbox + {\getfuzzysnapcorrection{#2}% + \presnapcorrection + #1#2% + \postsnapcorrection} + +\def\adaptfuzzypagegoal + {\ifgridsnapping\iffuzzysnapping\ifcase\fuzzysnappedleft\or % see dopagecontents + \scratchdimen\pagegoal + \advance\scratchdimen -.5\openlineheight + \global\pagegoal\scratchdimen + \global\advance\vsize -.5\openlineheight + \global\chardef\fuzzysnappedleft0 + \fi\fi\fi} + +%D New, experimental, used in caption snapping: +%D +%D \starttyping +%D \startcolumnset +%D +%D \setupcaption[figure][style=\tfx\setupinterlinespace,inbetween=,grid=top] +%D +%D \placefigure [lrtb] {\dorecurse{5}{green gras}} +%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} +%D \placefigure [lrtb] {\dorecurse{15}{green gras}} +%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} +%D +%D \setupcaption[figure][style=\tfx\setupinterlinespace,inbetween=,grid=bottom] +%D +%D \placefigure [rltb] {\dorecurse{5}{green gras}} +%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} +%D \placefigure [rltb] {\dorecurse{15}{green gras}} +%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} +%D +%D \input thuan +%D +%D \stopcolumnset +%D \stoptyping + +\def\moveboxontogrid#1#2#3% box method firstlineht % experimental ! ! ! + {\doifsomething{#2} + {\getnoflines{\ht#1}% no depth taken into account, depth preserved + \scratchdimen\noflines\lineheight + \advance\scratchdimen-\strutdp + \bgroup + \advance\scratchdimen-\onepoint % be a bit tolerant + \ifdim\scratchdimen>\ht#1\relax + \egroup + \doif{#2}\v!top {\setbox#1\vbox to \scratchdimen{\vskip-#3\vskip\strutht\box#1\vfill}}% + \doif{#2}\v!bottom{\setbox#1\vbox to \scratchdimen{\vfill\box#1\removedepth}}% + \dp#1\strutdp + \else + \egroup + \ht#1\scratchdimen + \dp#1\strutdp + \fi}} + +%D New: + +\let\checkgridsnapping\relax + +\protect \endinput diff --git a/tex/context/base/core-grd.mkiv b/tex/context/base/core-grd.mkiv new file mode 100644 index 000000000..d6cc93735 --- /dev/null +++ b/tex/context/base/core-grd.mkiv @@ -0,0 +1,1074 @@ +%D \module +%D [ file=core-grd, +%D version=1998.03.10, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Grid Snapping (Experimental), +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / Grid Snapping} + +\unprotect + +%D Moved from supp-box: + +%D \macros +%D {startbaselinecorrection,baselinecorrection, +%D showbaselinecorrection,offbaselinecorrection} +%D +%D Spacing around ruled boxes can get pretty messed up. The +%D next macro tries as good as possible to fix this. +%D +%D \startbuffer[1] +%D \startbaselinecorrection +%D \ruledhbox{Rule Brittanica} +%D \stopbaselinecorrection +%D \stopbuffer +%D +%D \typebuffer[1] +%D +%D The macros put some white space around the box: +%D +%D \getbuffer[1] +%D +%D A simple alternative is \type {\baselinecorrection}, which +%D only looks at the previous line. +%D +%D \startbuffer[2] +%D \baselinecorrection +%D \ruledhbox{Rule Brittanica} +%D \baselinecorrection +%D \stopbuffer +%D +%D \typebuffer[2] +%D +%D This time the last preceding line gets a correction,% +%D dependant on the depth. +%D +%D \getbuffer[2] +%D +%D One can make the correction visible by saying \type +%D {\showbaselinecorrection}. Part of the correction is +%D calculated from the dimensions of a~(. One can disble the +%D correction by calling \type {\offbaselinecorrection}. +%D +%D When visualize the first example looks like: +%D +%D {\showbaselinecorrection\getbuffer[1]} +%D +%D and the second one comes out as: +%D +%D {\showbaselinecorrection\getbuffer[2]} + +% \definecolor[GridLineColor][red] +% \definecolor[GridTextColor][blue] + +\let\thetopbaselinecorrection \!!zeropoint +\let\thebotbaselinecorrection \!!zeropoint +\let\thenegtopbaselinecorrection\!!zeropoint +\let\thenegbotbaselinecorrection\!!zeropoint + +\definepalet + [grid] + [ one=red, + two=green, + three=blue, + four=gray] + +\def\setbaselinecorrections + {\setbox0\hbox{\setstrut\strut}% + \setbox2\hbox{(}% + \dimen0\ht0\advance\dimen0 -\ht2 + \ifdim\dimen0<\zeropoint\dimen0\zeropoint\fi + \dimen2\dp0\advance\dimen2 -\dp2 + \ifdim\dimen2<\zeropoint\dimen2\zeropoint\fi + \edef\thetopbaselinecorrection {\the\dimen0}\dimen0-\dimen0 + \edef\thebotbaselinecorrection {\the\dimen2}\dimen2-\dimen2 + \edef\thenegtopbaselinecorrection{\the\dimen0}% + \edef\thenegbotbaselinecorrection{\the\dimen2}} + +\def\dotopbaselinecorrection {\kern\thetopbaselinecorrection} +\def\dobotbaselinecorrection {\kern\thebotbaselinecorrection} +\def\donegtopbaselinecorrection{\kern\thenegtopbaselinecorrection} +\def\donegbotbaselinecorrection{\kern\thenegbotbaselinecorrection} + +\def\showbaselinecorrection + {\def\dobaselinecorrection % visualization is not watertight! + {\bgroup +\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi + \setbox0\null + \wd0\hsize + \dp0\strutdp + \nointerlineskip + \forgetall + \ruledvbox{\box0}% + \egroup + \prevdepth\strutdp}% + \def\dotopbaselinecorrection + {\hrule\!!height\thetopbaselinecorrection}% + \def\dobotbaselinecorrection + {\hrule\!!height\thebotbaselinecorrection}} + +\def\dobaselinecorrection + {\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi + \kern\strutdp + \prevdepth\strutdp} + +% \def\baselinecorrection +% {\endgraf +% \ifvmode +% \ifdim\prevdepth<\maxdimen +% \ifdim\prevdepth<\zeropoint \else +% \ifdim\prevdepth<\strutdp +% \dobaselinecorrection +% \fi +% \fi +% \fi +% \fi} + +\def\baselinecorrection + {\endgraf + \ifvmode + \ifdim\prevdepth<\maxdimen + \ifdim\prevdepth<\zeropoint \else + \ifdim\prevdepth<\strutdepth \relax + \pushlastnode + \dobaselinecorrection + \poplastnode + \fi + \fi + \fi + \fi} + +\def\pagebaselinecorrection + {\ifdim\pagegoal<\maxdimen + \ifdim\pagetotal>\lineheight % or \topskip + \scratchdimen\pagetotal + \advance\scratchdimen\lineheight + \ifdim\scratchdimen<\pagegoal + \baselinecorrection + \fi + \fi + \fi} + +% Beware, keep this one as it is, see for instance module +% m-steps.tex, where we apply a \localhsize to the \vbox, in +% order to follow narrower and side floats ! + +% \def\startbaselinecorrection +% {\baselinecorrection +% \ifvmode +% \bgroup +% \setbox\scratchbox\vbox\bgroup +% \ignorespaces +% \let\stopbaselinecorrection\dostopbaselinecorrection +% \else +% \let\stopbaselinecorrection\relax +% \fi} + +% \def\dostopbaselinecorrection % I have to check columns yet. +% {\endgraf +% \egroup +% \topbaselinecorrection +% \box\scratchbox +% \botbaselinecorrection +% \egroup} + +% \let\stopbaselinecorrection=\relax + +\def\startbaselinecorrection + {\bgroup + \let\stopbaselinecorrection\egroup + \ifcase\baselinecorrectionmode + \or % normal + \baselinecorrection + \ifvmode + \setbox\scratchbox\vbox\bgroup\ignorespaces + \let\stopbaselinecorrection\donormalstopbaselinecorrection + \fi + \or % off + \or % force + \baselinecorrection + \ifvmode + \setbox\scratchbox\vbox\bgroup\ignorespaces + \let\stopbaselinecorrection\doforcedstopbaselinecorrection + \fi + \fi} + +\let\stopbaselinecorrection\relax + +\def\donormalstopbaselinecorrection % I have to check columns yet. + {\egroup + \topbaselinecorrection + \box\scratchbox + \botbaselinecorrection + \egroup} + +\def\doforcedstopbaselinecorrection % I have to check columns yet. + {\egroup + \forcedtopbaselinecorrection + \box\scratchbox + \forcedbotbaselinecorrection + \egroup} + +%D We do a bit more checking than needed. The pageborder check +%D is not needed, but I want to look the visualization as good +%D as possible too. + +% \def\offbaselinecorrection % Can be used inside correction. +% {\def\startbaselinecorrection{\bgroup\let\stopbaselinecorrection\egroup}} + +\chardef\baselinecorrectionmode\plusone + +\def\onbaselinecorrection {\chardef\baselinecorrectionmode\plusone } +\def\offbaselinecorrection {\chardef\baselinecorrectionmode\plustwo } +\def\forcebaselinecorrection{\chardef\baselinecorrectionmode\plusthree} + +%D \macros +%D {topbaselinecorrection,botbaselinecorrection} +%D +%D The actual top and bottom corrections are implemented as: + +% \def\topbaselinecorrection +% {\ifvmode \ifdim\pagegoal<\maxdimen +% \bgroup +% \setbaselinecorrections +% \whitespace +% \nointerlineskip +% \dotopbaselinecorrection +% \egroup +% \fi \fi} + + +\def\topbaselinecorrection + {\ifvmode \ifdim\pagegoal<\maxdimen + \forcedtopbaselinecorrection + \fi \fi} + +\def\forcedtopbaselinecorrection + {\ifvmode + \bgroup + \setbaselinecorrections + \whitespace + \nointerlineskip + \dotopbaselinecorrection + \egroup + \fi} + +\def\botbaselinecorrection + {\ifvmode + \bgroup + \setbaselinecorrections + \dobotbaselinecorrection + \allowbreak % new, otherwise problems when many in a row + \prevdepth\strutdp + \egroup + \fi} + +\let\forcedbotbaselinecorrection\botbaselinecorrection + +%D Still very experimental and therefore undocumented. + +\newif\ifgridsnapping % UNDER DEVELOPMENT, USE WITH CARE +\newif\ifforcepresnap \forcepresnaptrue % false in mixed single/double +\newif\ifstrutsnapping \strutsnappingtrue % sometimes handy to be false + +\def\positiveextrasnap {\gdef\extrasnapsign{+}} +\def\negativeextrasnap {\gdef\extrasnapsign{-}} + +\def\extrasnapreset {\global\chardef\@@extrasnap0 + \positiveextrasnap} +\def\extrasnapbefore {\global\chardef\@@extrasnap1 } +\def\extrasnaparound {\global\chardef\@@extrasnap2 } +\def\extrasnapafter {\global\chardef\@@extrasnap3 } + +\def\enablepresnapcorrection {\global\chardef\@@presnap\zerocount} +\def\disablepresnapcorrection {\global\chardef\@@presnap\plusone} + +\extrasnapreset \enablepresnapcorrection + +\newif\iftracegridsnapping +\newif\ifshowgridboxes +\newif\ifshowfuzzyskips + +\let\showgridboxes\showgridboxestrue + +\def\showgridsnapping + {\tracegridsnappingtrue + \showgridboxestrue} + +\chardef\@@alignsnap =0 +\chardef\@@alignsnapbox =0 +\chardef\@@alignsnapmethod=0 + +\let\presnapskip \!!zeropoint \def\presnap {-} +\let\postsnapskip\!!zeropoint \let\postsnap\presnap + +\newcount\currentgridsnap + +\def\tracedsnapping + {\iftracegridsnapping + \llap + {\setlayoutcomponentattribute\v!grid\v!test + \hbox \layoutcomponentboxattribute + {\infofont + \global\advance\currentgridsnap\plusone + \color[grid:three] + {\vl\presnapskip + \vl\presnap + \vl\postsnap + \ifcase\@@alignsnapbox\relax\vl\ifcase\@@extrasnap00\or\extrasnapsign0\or\extrasnapsign\extrasnapsign\or0\extrasnapsign\fi\fi + \vl\the\currentgridsnap\vl}}}% + \fi} + +\def\snaptogrid% [#1]#2 -> #2 == \hbox|\vbox + {\dosingleempty\dosnaptogrid} + +% \def\dosnaptogrid[#1]% +% {\ifgridsnapping +% \iffirstargument\doifsomething{#1}{\verplaatsopgrid[#1]}\fi +% \expandafter\dodosnaptogrid +% \fi} + +% \def\dosnaptogrid[#1]% +% {\resetlastlinewidth % maybe in more places, otherwise spacing gets messed up +% \ifgridsnapping +% \iffirstargument\doifsomething{#1}{\moveongrid[#1]}\fi +% \expandafter\dodosnaptogrid +% \fi} + +\def\dosnaptogrid[#1]% + {\resetlastlinewidth % maybe in more places, otherwise spacing gets messed up + \doifinsetelse\v!force{#1}% + {\moveongrid[#1]% + \dodosnaptogrid} + {\ifgridsnapping + \doifsomething{#1}{\moveongrid[#1]}% + \expandafter\dodosnaptogrid + \fi}} + +% \def\forcedpresnapcorrection % test this on 'details' +% {\ifforcepresnap +% \ifvmode \else \par \fi % new +% % we don't want top of page space when 'top' option +% %\verticalstrut\nobreak\vskip-\struttotal +% %\verticalstrut\vskip-\struttotal +% % nobreak really needed +% \allowbreak\verticalstrut\nobreak\vskip-\struttotal +% %\ifdim\pagetotal>\topskip \else +% % eigenlijk signal +% %\writestatus{grid}{removing dummy at top of page}% +% %\bgroup +% %\output{\setbox\scratchbox\box255}% +% %\penalty\outputpenalty +% %\egroup +% %\fi +% \fi} + +\def\forcedpresnapcorrection % test this on 'details' + {\ifforcepresnap + \ifvmode \else \par \fi % new + % we don't want top of page space when 'top' option + % \verticalstrut\nobreak\vskip-\struttotal + % \verticalstrut\vskip-\struttotal + % \nobreak really needed + % \dosomebreak\allowbreak % no: spoils heads, so only under know situation, not in snapper + \verticalstrut + \nobreak + \vskip-\struttotal + %\ifdim\pagetotal>\topskip \else + % eigenlijk signal + %\writestatus{grid}{removing dummy at top of page}% + %\bgroup + %\output{\setbox\scratchbox\box255}% + %\penalty\outputpenalty + %\egroup + %\fi + \fi} + +\def\setgridtracebox#1[#2]% % maybe reverse the order + {\setbox\nextbox#1% + {\hbox + {\hbox to \zeropoint + {\setlayoutcomponentattribute\v!grid\v!test + \color[grid:#2]{\ruledhbox \layoutcomponentboxattribute {\fakebox\nextbox}}% + \hss}% + \flushnextbox}}} + +\newif\ifboxedsnapping \boxedsnappingtrue + +\chardef\depthsnapmethod \plusone % downward compatible, minus one line +\chardef\heightsnapmethod\plusone % downward compatible, minus one line + +\def\dodosnaptogrid + {\dowithnextbox + {\bgroup + \ifcase\@@alignsnapmethod \or + % we're dealing with text with a possible big depth/height + \chardef\depthsnapmethod \plustwo + \chardef\heightsnapmethod\plustwo + \fi + \ifdim\nextboxht<\textheight % handle special case (like page fig) + \ifcase\@@alignsnapbox\relax + \ifcase\@@alignsnap\else % 1=top 2=high 3=middle 4=low + \ifshowgridboxes + \setgridtracebox\hbox[two]% + \fi + %\getnoflines{\nextboxht}% + \getnoflines\nextboxht + \setbox\nextbox\vbox to \noflines\lineheight + {\ifnum\@@alignsnap=1 \kern\lineheight\kern-\topskip\fi + \ifnum\@@alignsnap>2 \vfill\fi + \flushnextbox + \ifnum\@@alignsnap<4 \vfill\fi}% + \fi + \ifshowgridboxes + \setgridtracebox\hbox[three]% + \fi + \forgetall + \par + \ifvbox\nextbox + \setbox\nextbox\hbox{\flushnextbox}% don't ask + \fi + \scratchskip\lastskip + \edef\presnapskip{\the\lastskip}% + % mixing single/double columns sometimes goes wrong, + % check 'som' document + \ifinsidecolumns + \forcepresnaptrue + \fi + \forcedpresnapcorrection + \ifdim\nextboxht>\strutht + \scratchdimen\nextboxht + \ifcase\@@presnap\relax + \ifdim\scratchskip>\zeropoint\relax + \scratchcounter\scratchskip + \advance\scratchcounter -\openlineheight + \ifnum\scratchcounter<0 + \scratchcounter-\scratchcounter + \fi + \ifnum\scratchcounter<10 % \lastkip is about \openlineheight + \advance\scratchdimen -\openstrutdepth + \edef\presnapskip{*\presnapskip}% + \else\ifdim\scratchskip>\openlineheight + %<\openlineheight \else + \advance\scratchdimen -\openstrutdepth + \edef\presnapskip{*\presnapskip}% + \fi\fi + \fi + \fi + % \getnoflines\scratchdimen % maybe raw ? + % \advance\noflines -1 + \ifcase\heightsnapmethod + % raw + \or + \advance\scratchdimen-\lineheight % tight (default) + \or + \advance\scratchdimen-\strutheight % fit (text) + \or + \advance\scratchdimen-\strutheight % tolerant + \advance\scratchdimen-\roundingeps + \fi + \getnoflines\scratchdimen + \ifnum\noflines>0 + \scratchdimen\noflines\lineheight + \else + \scratchdimen\zeropoint + \fi + \else + \scratchdimen\zeropoint + \fi + \ifnum\@@extrasnap=1 \advance\scratchdimen \extrasnapsign \lineheight \fi + \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi + \edef\presnap{\the\scratchdimen}% + \ifstrutsnapping + \ifboxedsnapping + \getrawnoflines\scratchdimen + \advance\scratchdimen-\noflines\lineheight + \vskip\scratchdimen % disappears at top of page + \dorecurse\noflines{\verticalstrut\nobreak}% + \else \ifdim\scratchdimen=\zeropoint + % nothing to skip + \else % disappears at top of page + \vskip\scratchdimen + \fi \fi + \fi + \ifdim\nextboxdp>\strutdp + % \getnoflines\nextboxdp + % \advance\noflines \minusone + \scratchdimen\nextboxdp\relax + \ifcase\depthsnapmethod + % raw + \or + \advance\scratchdimen-\lineheight % tight (default) + \or + \advance\scratchdimen-\strutdepth % fit (text) + \or + \advance\scratchdimen-\strutdepth % tolerant + \advance\scratchdimen-\roundingeps + \fi + \getnoflines\scratchdimen + \ifnum\noflines>0 + \scratchdimen\noflines\lineheight + \else + \scratchdimen\zeropoint + \fi + \else + \scratchdimen\zeropoint + \fi + \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi + \ifnum\@@extrasnap=3 \advance\scratchdimen \extrasnapsign \lineheight \fi + \edef\postsnap{\the\scratchdimen}% + \ifstrutsnapping + \nextboxht\strutht + \nextboxdp\strutdp + \else + \scratchdimen\presnap + \advance\scratchdimen \strutht + \nextboxht\scratchdimen + \scratchdimen\postsnap + \advance\scratchdimen \strutdp + \nextboxdp\scratchdimen + \fi + \hbox{\tracedsnapping\flushnextbox}% + \ifstrutsnapping + \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi + \fi + \else + \scratchdimen\nextboxht\relax + \ifcase\@@alignsnapbox + % can't happen here + \or + \getrawnoflines\scratchdimen + \else + \getnoflines \scratchdimen + \fi + \scratchdimen\noflines\lineheight\relax + \advance\scratchdimen-\strutdepth + % spoils the whole game (fit/broad/line) + % \ifnum\pagetotal>\zeropoint \else % disable this as option + % \advance\scratchdimen-\strutheight + % \advance\scratchdimen+\topskip + % \fi + \dimen0=\scratchdimen + \dimen2=\strutdepth + \ifshowgridboxes + \setgridtracebox\hbox[two]% + \fi + \nextboxdp\strutdp + \dimen4=\nextboxht + \dimen6=\nextboxdp + \iftracegridsnapping + \setbox\scratchbox\hbox + {\scratchdimen\@@alignsnapamount\relax + \ifdim\scratchdimen<\zeropoint + \tracedgridamount\zeropoint{-\scratchdimen}% + \else + \tracedgridamount\scratchdimen\zeropoint + \fi}% + \smashbox\scratchbox + \setbox\nextbox\hbox{\box\scratchbox\flushnextbox}% + \fi + \setbox\nextbox\hbox + {\scratchdimen\@@alignsnapamount\relax + \ifcase\@@alignsnapdepth\or + % don't change this ever ! + \ifdim\dimen0<\lineheight + % otherwise it is ok, but ending up inside + % the next paragraph is seldom what we want, + % so we move one line up + \advance\scratchdimen-\lineheight + \advance\scratchdimen\strutheight + \else + % otherwise we can move down to the + % baseline + \advance\scratchdimen\dimen6 % == \strutdepth + \fi + \fi + \lower\scratchdimen\flushnextbox}% + \nextboxht\dimen4 + \nextboxdp\dimen6 + \ifnum\@@alignsnap<4 % 4 = regel + \setbox\nextbox\vbox to \scratchdimen + {\forgetall + \ifnum\@@alignsnap>2 \vfill\fi % 3 4 + \flushnextbox + \nointerlineskip % \offinterlineskip + \ifnum\@@alignsnap<4 \vfill\fi % 2 3 + \kern\zeropoint}% + \fi + \ifshowgridboxes + \setgridtracebox\vbox[three]% + \fi + \scratchdimen\@@alignsnapamount + \edef\presnapskip{\the\scratchdimen}% + \ifnum\@@alignsnap>2 \def\presnap {+}\fi + \ifnum\@@alignsnap<4 \def\postsnap{+}\fi + \setbox\nextbox\hbox{\tracedsnapping\flushnextbox}% + \par + \nextboxht\dimen0 + \nextboxdp\dimen2 + \forcedpresnapcorrection + \nointerlineskip + \flushnextbox + \fi + \else + \setbox\nextbox\vbox to \textheight + {\ifdim\nextboxdp=\zeropoint + \hbox{\lower\strutdepth\flushnextbox} + \else % this branch is yet untested + \vss + \hbox{\lower\nextboxdp\flushnextbox} + \vskip-\strutdepth + \fi}% + \nextboxdp\strutdepth + \flushnextbox + \fi + \extrasnapreset + \enablepresnapcorrection + \global\chardef\@@alignsnap\zerocount + \global\chardef\@@alignsnapbox\zerocount + \egroup}} + +\def\tracedgridamount#1#2% + {\startcolor[grid:four]% + \setlayoutcomponentattribute\v!grid\v!test + \hbox \layoutcomponentboxattribute{\vrule\!!width\nextboxwd\!!height#1\!!depth#2}% + \stopcolor} + +\def\snaptomathgrid % probably not working ok, also kind of obsolete + {\ifgridsnapping + \dowithnextbox + {\blank[\v!line]\snaptogrid\vbox{\flushnextbox}\blank[\v!line]} + \vbox\bgroup + \forgetdisplayskips + \@EA\let\@EA\next + \fi} + +\def\topsnaptogrid + {\ifgridsnapping + \dowithnextbox + {\scratchdimen\nextboxht + \advance\scratchdimen -\strutht + \advance\scratchdimen \topskip + \nextboxht\scratchdimen + \nextboxdp\zeropoint + \flushnextbox + \kern\lineheight + \kern-\topskip + \nointerlineskip} + \hbox + \fi} + +% \def\centertogrid % meant for special situations +% {\ifgridsnapping +% \dowithnextboxcontent +% {\ignorespaces} +% {\bgroup +% \par +% \scratchdimen\nextboxht +% \advance\scratchdimen \nextboxdp +% \getnoflines\scratchdimen +% \setbox\nextbox\vbox to \noflines\lineheight +% {\forgetall +% \vskip\zeropoint \!!plus \nextboxht +% \copy\nextbox +% \kern.5\strutdp % VOORLOPIGE WAARDE +% \vskip\zeropoint \!!plus \nextboxdp}% +% \noindent\snaptogrid\vbox{\flushnextbox}% +% \egroup} +% \vbox % was \hbox +% \fi} + +% The next implementation is sub-optimal +% +% \def\centertogrid % usage: see ie pascal / stepcharts +% {\snaptogrid[\v!midden,.5\strutdp]\vbox} + +\def\centertogrid % meant for special situations + {\ifgridsnapping + \dowithnextboxcontent + {\ignorespaces} + {\bgroup + \par + \scratchdimen\nextboxht + \advance\scratchdimen \nextboxdp + \getnoflines\scratchdimen + \setbox\nextbox\vbox to \noflines\lineheight + {\forgetall + \vss + \topbaselinecorrection + \copy\nextbox + \botbaselinecorrection + \vss}% + \setbox\nextbox\hbox{\lower\strutdp\flushnextbox}% + \forgeteverypar % new per 3/4/2008, prevents duplicate pos nodes resulting in extra whitespace + \noindent\snaptogrid\vbox{\flushnextbox}% + \egroup} + \vbox % was \hbox + \fi} + +% testbed for \centertogrid +% +% \strut Bruggetje +% \startlinecorrection +% \startcombination +% {\framed{test}} {} {\framed{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection +% \startcombination[2*2] +% {\framed{test}} {} {\framed{test}} {} +% {\framed{test}} {} {\framed{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection[blank] +% \startcombination +% {\framed{test}} {} {\framed{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection[blank] +% \startcombination[2*2] +% {\framed{test}} {} {\framed{test}} {} +% {\framed{test}} {} {\framed{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection +% \startcombination +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection +% \startcombination[2*2] +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection[blank] +% \startcombination +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% \stopcombination +% \stoplinecorrection +% \strut Bruggetje +% \startlinecorrection[blank] +% \startcombination[2*2] +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} +% \stopcombination +% \stoplinecorrection + +\ifx\startbaselinecorrection\undefined \wait \fi % change order + +\let\normalstartbaselinecorrection=\startbaselinecorrection + +\def\startbaselinecorrection + {\ifgridsnapping + \centertogrid\bgroup + \let\stopbaselinecorrection\egroup + \else + \normalstartbaselinecorrection + \fi} + +\chardef\gridboxlinenomode\plusone +\chardef\gridboxlinemode \plusone % 0:nothing 1:all 2:lines 3:frame + +\def\gridboxvbox {\ifcase\gridboxlinemode\vbox\or\ruledvbox\or\vbox\or\ruledvbox\else\ruledvbox\fi} +\def\gridboxwidth{\ifcase\gridboxlinemode0\or.5\or.5\or0\else.5\fi\testrulewidth} + +\def\setgridbox#1#2#3% + {\setbox#1\gridboxvbox to #3 % given size + {\forgetall + \resetteststrut + \offinterlineskip + \hsize#2% + \baselinerulefalse + \gridboxvbox % calculated size + {\getrawnoflines{#3}% \getnoflines{#3}% + \vskip\topskip + \vskip-\strutht + \scratchdimen#2\advance\scratchdimen \lineheight + \dorecurse\noflines + {\strut + \hskip-.5\lineheight + \ifcase\gridboxlinenomode\or + \rlap + {\hskip.2\bodyfontsize\hskip\scratchdimen + \infofont\hbox to 1em{\hss\recurselevel}}% + \or + \llap + {\infofont\hbox to 1em{\hss\recurselevel}% + \hskip.2\bodyfontsize}% + \fi + \vrule + \!!height \gridboxwidth + \!!depth \gridboxwidth + \!!width \scratchdimen + \par}} + \vfill}} + +%D Some intervention macros: + +\def\gridwarning#1{\message{[beware of #1 extra snap]}} + +\global\let\@@alignsnapamount\!!zeropoint +\global\chardef\@@alignsnapdepth0 + +\def\@@unknowngriddisplacement + {\global\chardef\@@alignsnapbox\plusthree + \global\let\@@alignsnapamount\commalistelement} + +\def\domoveongrid[#1]% + {\ifgridsnapping\doifsomething{#1}{\dodomoveongrid[#1]}\fi} + +\def\dodomoveongrid[#1]% some day : speed up + {\global\chardef\@@alignsnap\zerocount + \global\chardef\@@alignsnapbox\zerocount + \global\chardef\@@alignsnapdepth\zerocount + \global\chardef\@@alignsnapmethod\zerocount + \global\let\@@alignsnapamount\!!zeropoint + \donefalse + \expanded{\processallactionsinset[#1]} + [\v!standard=>, + \v!normal=>, % to be sure + \v!yes=>, % to be sure + \v!top=>\gridwarning+\positiveextrasnap\extrasnapbefore, + \v!bottom=>\gridwarning+\positiveextrasnap\extrasnapafter, + \v!both=>\positiveextrasnap\extrasnaparound, + -\v!top=>\gridwarning-\negativeextrasnap\extrasnapbefore, + -\v!bottom=>\gridwarning-\negativeextrasnap\extrasnapafter, + -\v!both=>\negativeextrasnap\extrasnaparound, + \v!text=>\global\chardef\@@alignsnapmethod\plusone, % accurate calculations + \v!page=>\global\chardef\@@alignsnap\plusone, % topskip + \v!high=>\global\chardef\@@alignsnap\plustwo, + \v!middle=>\global\chardef\@@alignsnap\plusthree, + \v!low=>\global\chardef\@@alignsnap\plusfour, + \v!fit=>\global\chardef\@@alignsnapbox\plusone, % new + \v!broad=>\global\chardef\@@alignsnapbox\plustwo, % new + \v!depth=>\global\chardef\@@alignsnapdepth\plusone, % new + \v!line=>\global\chardef\@@alignsnapbox\plusthree +% \global\chardef\@@alignsnapdepth\plusone + \global\chardef\@@alignsnap\plusfour, + \v!reset=>\positiveextrasnap\extrasnapreset, + \v!none=>\global\chardef\@@alignsnap\zerocount + \global\chardef\@@alignsnapbox\zerocount, + \v!force=>, % turns on grid snapping even when not on + \s!default=>, + \s!unknown=>\@@unknowngriddisplacement]} + +\def\moveongrid + {\dosingleempty\domoveongrid} + +\def\doplaceongrid[#1]% + {\domoveongrid[#1]\snaptogrid\vbox} + +\def\placeongrid + {\dosingleempty\doplaceongrid} + +%D Snapping is rather robust as long as we use whole lines. +%D Half lines of white space can however be handled when they +%D come in pairs. The corrections needed when crossing page +%D boundaries in the middle of such a pair, are handled by +%D macros that are (named) sort of fuzzy. This fuzzy mechanism +%D was written as an extension to the grid typesetting needed +%D for typesetting (part of) the \MAPS. +%D +%D \starttyping +%D \setuptyping +%D [before={\blank[halfline]}, +%D after={\blank[halfline]}] +%D \stoptyping + +\newif \iffuzzyvskip +\newif \iffuzzysnapdone +\newif \iffuzzysnapping +\newif \iffuzzysnapped +\chardef \fuzzysnappedleft=0 % ==1 when fuzzybegin still open +\newpersistentmark\fuzzymark % (!) +\newcount \fuzzymarker +\newbox \fuzzysnapbox +\newbox \fuzzysnapsplit + +\def\dosyncfuzzyvskip + {\ifvmode\ifdim\lastskip<\lineheight\ifdim\lastskip>\zeropoint + \bgroup % - added 28/2/2003: check this, there was no - + \endgraf\forgetall\verticalstrut\nobreak\vskip-\struttotal + \egroup + \fi\fi\fi} + +\def\fuzzyvskip#1% + {\iffuzzysnapdone + \dosyncfuzzyvskip % NEWER + \endfuzzysnapping + \vskip#1\relax + \global\fuzzysnapdonefalse + \else + \vskip#1\relax + \beginfuzzysnapping + \global\fuzzysnapdonetrue + \fi} + +\def\setfuzzymark#1#2#3% #1/#2 => error recovery + {\ifgridsnapping + \global\fuzzysnappingtrue + \global\advance\fuzzymarker \ifodd\fuzzymarker#1\else#2\fi + \nobreak + \ifshowfuzzyskips + \hbox{\color[grid:three] + {\llap{\infofont#3\vl\the\fuzzymarker}\nobreak + \vrule\!!width\hsize\!!height.1\lineheight}} + \nobreak + \fi + %[\the\fuzzymarker] + %\expandafter\fuzzymark\expandafter{\the\fuzzymarker}% + \expandafter\rawsetmark\expandafter\fuzzymark\expandafter{\the\fuzzymarker}% + \nobreak + \fi} + +\def\beginfuzzysnapping{\setfuzzymark21\v!start} % odd +\def\endfuzzysnapping {\setfuzzymark12\v!stop } % even + +\def\removelastfuzzyvskip + {\ifgridsnapping + \iffuzzysnapping + \ifdim\lastskip<\openlineheight + \else + \removelastskip + \fi + \else + \removelastskip + \fi + \else + \removelastskip + \fi} + +\def\docheckfuzzysnap#1% + {\bgroup + \dontcomplain + \setbox\fuzzysnapbox\copy#1\relax + \setbox\fuzzysnapsplit\vsplit\fuzzysnapbox to 1\lineheight + \let\topfuzzymark\empty % indeed here ... no real mark + \getsplitmarks\fuzzymark +% \ifcase0\topfuzzymark + \ifcase0\rawgetsplittopmark\fuzzymark + \global\chardef\fuzzysnappedleft\zerocount + \global\fuzzysnappedfalse +% \else\ifodd\topfuzzymark + \else\ifodd\rawgetsplittopmark\fuzzymark + \global\chardef\fuzzysnappedleft\plusone + \global\fuzzysnappedtrue + \else + \global\chardef\fuzzysnappedleft=2 + \global\fuzzysnappedtrue + \fi\fi + \iffuzzysnapped \else + \doloop + {\ifvoid\fuzzysnapbox + \exitloop + \else + \setbox\fuzzysnapsplit=\vsplit\fuzzysnapbox to \lineheight + %\let\topfuzzymark=\empty % ... but not here + \getsplitmarks\fuzzymark +% \ifcase0\topfuzzymark + \ifcase0\rawgetsplittopmark\fuzzymark + % continue +% \else\ifodd\topfuzzymark + \else\ifodd\rawgetsplittopmark\fuzzymark + \exitloop + \else + \global\chardef\fuzzysnappedleft\plusone + \global\fuzzysnappedtrue + \exitloop + \fi\fi + \fi}% + \fi + \egroup} + +\def\getfuzzysnapcorrection#1% + {\global\let\presnapcorrection \relax + \global\let\postsnapcorrection\relax + \ifgridsnapping\iffuzzysnapping + \docheckfuzzysnap{#1}% + \iffuzzysnapped + \iftracegridsnapping + \gdef\presnapcorrection + {\color[grid:four]{\hrule\!!height.5\openlineheight\!!width\hsize}}% + \else + \gdef\presnapcorrection{\kern.5\openlineheight}% + \fi + \gdef\postsnapcorrection{\kern-.5\openlineheight}% get the height ok + \fi + \fi\fi} + +\def\fuzzysnappedbox#1#2% \box \unvbox + {\getfuzzysnapcorrection{#2}% + \presnapcorrection + #1#2% + \postsnapcorrection} + +\def\adaptfuzzypagegoal + {\ifgridsnapping\iffuzzysnapping\ifcase\fuzzysnappedleft\or % see dopagecontents + \scratchdimen\pagegoal + \advance\scratchdimen -.5\openlineheight + \global\pagegoal\scratchdimen + \global\advance\vsize -.5\openlineheight + \global\chardef\fuzzysnappedleft0 + \fi\fi\fi} + +%D New, experimental, used in caption snapping: +%D +%D \starttyping +%D \startcolumnset +%D +%D \setupcaption[figure][style=\tfx\setupinterlinespace,inbetween=,grid=top] +%D +%D \placefigure [lrtb] {\dorecurse{5}{green gras}} +%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} +%D \placefigure [lrtb] {\dorecurse{15}{green gras}} +%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} +%D +%D \setupcaption[figure][style=\tfx\setupinterlinespace,inbetween=,grid=bottom] +%D +%D \placefigure [rltb] {\dorecurse{5}{green gras}} +%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} +%D \placefigure [rltb] {\dorecurse{15}{green gras}} +%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} +%D +%D \input thuan +%D +%D \stopcolumnset +%D \stoptyping + +\def\moveboxontogrid#1#2#3% box method firstlineht % experimental ! ! ! + {\doifsomething{#2} + {\getnoflines{\ht#1}% no depth taken into account, depth preserved + \scratchdimen\noflines\lineheight + \advance\scratchdimen-\strutdp + \bgroup + \advance\scratchdimen-\onepoint % be a bit tolerant + \ifdim\scratchdimen>\ht#1\relax + \egroup + \doif{#2}\v!top {\setbox#1\vbox to \scratchdimen{\vskip-#3\vskip\strutht\box#1\vfill}}% + \doif{#2}\v!bottom{\setbox#1\vbox to \scratchdimen{\vfill\box#1\removedepth}}% + \dp#1\strutdp + \else + \egroup + \ht#1\scratchdimen + \dp#1\strutdp + \fi}} + +%D New: + +\let\checkgridsnapping\relax + +\protect \endinput diff --git a/tex/context/base/core-grd.tex b/tex/context/base/core-grd.tex deleted file mode 100644 index 249e2e430..000000000 --- a/tex/context/base/core-grd.tex +++ /dev/null @@ -1,1074 +0,0 @@ -%D \module -%D [ file=core-grd, -%D version=1998.03.10, -%D title=\CONTEXT\ Core Macros, -%D subtitle=Grid Snapping (Experimental), -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Core Macros / Grid Snapping} - -\unprotect - -%D Moved from supp-box: - -%D \macros -%D {startbaselinecorrection,baselinecorrection, -%D showbaselinecorrection,offbaselinecorrection} -%D -%D Spacing around ruled boxes can get pretty messed up. The -%D next macro tries as good as possible to fix this. -%D -%D \startbuffer[1] -%D \startbaselinecorrection -%D \ruledhbox{Rule Brittanica} -%D \stopbaselinecorrection -%D \stopbuffer -%D -%D \typebuffer[1] -%D -%D The macros put some white space around the box: -%D -%D \getbuffer[1] -%D -%D A simple alternative is \type {\baselinecorrection}, which -%D only looks at the previous line. -%D -%D \startbuffer[2] -%D \baselinecorrection -%D \ruledhbox{Rule Brittanica} -%D \baselinecorrection -%D \stopbuffer -%D -%D \typebuffer[2] -%D -%D This time the last preceding line gets a correction,% -%D dependant on the depth. -%D -%D \getbuffer[2] -%D -%D One can make the correction visible by saying \type -%D {\showbaselinecorrection}. Part of the correction is -%D calculated from the dimensions of a~(. One can disble the -%D correction by calling \type {\offbaselinecorrection}. -%D -%D When visualize the first example looks like: -%D -%D {\showbaselinecorrection\getbuffer[1]} -%D -%D and the second one comes out as: -%D -%D {\showbaselinecorrection\getbuffer[2]} - -% \definecolor[GridLineColor][red] -% \definecolor[GridTextColor][blue] - -\definepalet - [grid] - [ one=red, - two=green, - three=blue, - four=gray] - -\def\setbaselinecorrections - {\setbox0\hbox{\setstrut\strut}% - \setbox2\hbox{(}% - \dimen0\ht0\advance\dimen0 -\ht2 - \ifdim\dimen0<\zeropoint\dimen0\zeropoint\fi - \dimen2\dp0\advance\dimen2 -\dp2 - \ifdim\dimen2<\zeropoint\dimen2\zeropoint\fi - \edef\thetopbaselinecorrection {\the\dimen0}\dimen0-\dimen0 - \edef\thebotbaselinecorrection {\the\dimen2}\dimen2-\dimen2 - \edef\thenegtopbaselinecorrection{\the\dimen0}% - \edef\thenegbotbaselinecorrection{\the\dimen2}} - -\def\dotopbaselinecorrection {\kern\thetopbaselinecorrection} -\def\dobotbaselinecorrection {\kern\thebotbaselinecorrection} -\def\donegtopbaselinecorrection{\kern\thenegtopbaselinecorrection} -\def\donegbotbaselinecorrection{\kern\thenegbotbaselinecorrection} - -\def\showbaselinecorrection - {\def\dobaselinecorrection % visualization is not watertight! - {\bgroup -\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi - \setbox0\null - \wd0\hsize - \dp0\strutdp - \nointerlineskip - \forgetall - \ruledvbox{\box0}% - \egroup - \prevdepth\strutdp}% - \def\dotopbaselinecorrection - {\hrule\!!height\thetopbaselinecorrection}% - \def\dobotbaselinecorrection - {\hrule\!!height\thebotbaselinecorrection}} - -\def\dobaselinecorrection - {\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi - \kern\strutdp - \prevdepth\strutdp} - -% \def\baselinecorrection -% {\endgraf -% \ifvmode -% \ifdim\prevdepth<\maxdimen -% \ifdim\prevdepth<\zeropoint \else -% \ifdim\prevdepth<\strutdp -% \dobaselinecorrection -% \fi -% \fi -% \fi -% \fi} - -\def\baselinecorrection - {\endgraf - \ifvmode - \ifdim\prevdepth<\maxdimen - \ifdim\prevdepth<\zeropoint \else - \ifdim\prevdepth<\strutdepth \relax - \pushlastnode - \dobaselinecorrection - \poplastnode - \fi - \fi - \fi - \fi} - -\def\pagebaselinecorrection - {\ifdim\pagegoal<\maxdimen - \ifdim\pagetotal>\lineheight % or \topskip - \scratchdimen\pagetotal - \advance\scratchdimen\lineheight - \ifdim\scratchdimen<\pagegoal - \baselinecorrection - \fi - \fi - \fi} - -% Beware, keep this one as it is, see for instance module -% m-steps.tex, where we apply a \localhsize to the \vbox, in -% order to follow narrower and side floats ! - -% \def\startbaselinecorrection -% {\baselinecorrection -% \ifvmode -% \bgroup -% \setbox\scratchbox\vbox\bgroup -% \ignorespaces -% \let\stopbaselinecorrection\dostopbaselinecorrection -% \else -% \let\stopbaselinecorrection\relax -% \fi} - -% \def\dostopbaselinecorrection % I have to check columns yet. -% {\endgraf -% \egroup -% \topbaselinecorrection -% \box\scratchbox -% \botbaselinecorrection -% \egroup} - -% \let\stopbaselinecorrection=\relax - -\def\startbaselinecorrection - {\bgroup - \let\stopbaselinecorrection\egroup - \ifcase\baselinecorrectionmode - \or % normal - \baselinecorrection - \ifvmode - \setbox\scratchbox\vbox\bgroup\ignorespaces - \let\stopbaselinecorrection\donormalstopbaselinecorrection - \fi - \or % off - \or % force - \baselinecorrection - \ifvmode - \setbox\scratchbox\vbox\bgroup\ignorespaces - \let\stopbaselinecorrection\doforcedstopbaselinecorrection - \fi - \fi} - -\let\stopbaselinecorrection\relax - -\def\donormalstopbaselinecorrection % I have to check columns yet. - {\egroup - \topbaselinecorrection - \box\scratchbox - \botbaselinecorrection - \egroup} - -\def\doforcedstopbaselinecorrection % I have to check columns yet. - {\egroup - \forcedtopbaselinecorrection - \box\scratchbox - \forcedbotbaselinecorrection - \egroup} - -%D We do a bit more checking than needed. The pageborder check -%D is not needed, but I want to look the visualization as good -%D as possible too. - -% \def\offbaselinecorrection % Can be used inside correction. -% {\def\startbaselinecorrection{\bgroup\let\stopbaselinecorrection\egroup}} - -\chardef\baselinecorrectionmode\plusone - -\def\onbaselinecorrection {\chardef\baselinecorrectionmode\plusone } -\def\offbaselinecorrection {\chardef\baselinecorrectionmode\plustwo } -\def\forcebaselinecorrection{\chardef\baselinecorrectionmode\plusthree} - -%D \macros -%D {topbaselinecorrection,botbaselinecorrection} -%D -%D The actual top and bottom corrections are implemented as: - -% \def\topbaselinecorrection -% {\ifvmode \ifdim\pagegoal<\maxdimen -% \bgroup -% \setbaselinecorrections -% \whitespace -% \nointerlineskip -% \dotopbaselinecorrection -% \egroup -% \fi \fi} - - -\def\topbaselinecorrection - {\ifvmode \ifdim\pagegoal<\maxdimen - \forcedtopbaselinecorrection - \fi \fi} - -\def\forcedtopbaselinecorrection - {\ifvmode - \bgroup - \setbaselinecorrections - \whitespace - \nointerlineskip - \dotopbaselinecorrection - \egroup - \fi} - -\def\botbaselinecorrection - {\ifvmode - \bgroup - \setbaselinecorrections - \dobotbaselinecorrection - \allowbreak % new, otherwise problems when many in a row - \prevdepth\strutdp - \egroup - \fi} - -\let\forcedbotbaselinecorrection\botbaselinecorrection - -%D Still very experimental and therefore undocumented. - -\newif\ifgridsnapping % UNDER DEVELOPMENT, USE WITH CARE -\newif\ifforcepresnap \forcepresnaptrue % false in mixed single/double -\newif\ifstrutsnapping \strutsnappingtrue % sometimes handy to be false - -\def\positiveextrasnap {\gdef\extrasnapsign{+}} -\def\negativeextrasnap {\gdef\extrasnapsign{-}} - -\def\extrasnapreset {\global\chardef\@@extrasnap0 - \positiveextrasnap} -\def\extrasnapbefore {\global\chardef\@@extrasnap1 } -\def\extrasnaparound {\global\chardef\@@extrasnap2 } -\def\extrasnapafter {\global\chardef\@@extrasnap3 } - -\def\enablepresnapcorrection {\global\chardef\@@presnap\zerocount} -\def\disablepresnapcorrection {\global\chardef\@@presnap\plusone} - -\extrasnapreset \enablepresnapcorrection - -\newif\iftracegridsnapping -\newif\ifshowgridboxes -\newif\ifshowfuzzyskips - -\let\showgridboxes\showgridboxestrue - -\def\showgridsnapping - {\tracegridsnappingtrue - \showgridboxestrue} - -\chardef\@@alignsnap =0 -\chardef\@@alignsnapbox =0 -\chardef\@@alignsnapmethod=0 - -\let\presnapskip \!!zeropoint \def\presnap {-} -\let\postsnapskip\!!zeropoint \let\postsnap\presnap - -\newcount\currentgridsnap - -\def\tracedsnapping - {\iftracegridsnapping - \llap - {\startlayoutcomponent{gridsnaps}{grid snaps}% - \infofont - \global\advance\currentgridsnap\plusone - \color[grid:three]{\vl\presnapskip - \vl\presnap - \vl\postsnap - \ifcase\@@alignsnapbox\relax - \vl\ifcase\@@extrasnap - 00\or - \extrasnapsign0\or - \extrasnapsign\extrasnapsign\or - 0\extrasnapsign\fi - \fi - \vl\the\currentgridsnap\vl}% - \stoplayoutcomponent}% - \fi} - -\def\snaptogrid% [#1]#2 -> #2 == \hbox|\vbox - {\dosingleempty\dosnaptogrid} - -% \def\dosnaptogrid[#1]% -% {\ifgridsnapping -% \iffirstargument\doifsomething{#1}{\verplaatsopgrid[#1]}\fi -% \expandafter\dodosnaptogrid -% \fi} - -% \def\dosnaptogrid[#1]% -% {\resetlastlinewidth % maybe in more places, otherwise spacing gets messed up -% \ifgridsnapping -% \iffirstargument\doifsomething{#1}{\moveongrid[#1]}\fi -% \expandafter\dodosnaptogrid -% \fi} - -\def\dosnaptogrid[#1]% - {\resetlastlinewidth % maybe in more places, otherwise spacing gets messed up - \doifinsetelse\v!force{#1}% - {\moveongrid[#1]% - \dodosnaptogrid} - {\ifgridsnapping - \doifsomething{#1}{\moveongrid[#1]}% - \expandafter\dodosnaptogrid - \fi}} - -% \def\forcedpresnapcorrection % test this on 'details' -% {\ifforcepresnap -% \ifvmode \else \par \fi % new -% % we don't want top of page space when 'top' option -% %\verticalstrut\nobreak\vskip-\struttotal -% %\verticalstrut\vskip-\struttotal -% % nobreak really needed -% \allowbreak\verticalstrut\nobreak\vskip-\struttotal -% %\ifdim\pagetotal>\topskip \else -% % eigenlijk signal -% %\writestatus{grid}{removing dummy at top of page}% -% %\bgroup -% %\output{\setbox\scratchbox\box255}% -% %\penalty\outputpenalty -% %\egroup -% %\fi -% \fi} - -\def\forcedpresnapcorrection % test this on 'details' - {\ifforcepresnap - \ifvmode \else \par \fi % new - % we don't want top of page space when 'top' option - % \verticalstrut\nobreak\vskip-\struttotal - % \verticalstrut\vskip-\struttotal - % \nobreak really needed - % \dosomebreak\allowbreak % no: spoils heads, so only under know situation, not in snapper - \verticalstrut - \nobreak - \vskip-\struttotal - %\ifdim\pagetotal>\topskip \else - % eigenlijk signal - %\writestatus{grid}{removing dummy at top of page}% - %\bgroup - %\output{\setbox\scratchbox\box255}% - %\penalty\outputpenalty - %\egroup - %\fi - \fi} - -\def\setgridtracebox#1[#2]% % maybe reverse the order - {\setbox\nextbox#1% - {\hbox - {\hbox to \zeropoint - {\startlayoutcomponent{gridsnaps}{grid snaps}% - \color[grid:#2]{\ruledhbox{\fakebox\nextbox}}% - \stoplayoutcomponent - \hss}% - \flushnextbox}}} - -\newif\ifboxedsnapping \boxedsnappingtrue - -\chardef\depthsnapmethod \plusone % downward compatible, minus one line -\chardef\heightsnapmethod\plusone % downward compatible, minus one line - -\def\dodosnaptogrid - {\dowithnextbox - {\bgroup - \ifcase\@@alignsnapmethod \or - % we're dealing with text with a possible big depth/height - \chardef\depthsnapmethod \plustwo - \chardef\heightsnapmethod\plustwo - \fi - \ifdim\nextboxht<\textheight % handle special case (like page fig) - \ifcase\@@alignsnapbox\relax - \ifcase\@@alignsnap\else % 1=top 2=high 3=middle 4=low - \ifshowgridboxes - \setgridtracebox\hbox[two]% - \fi - %\getnoflines{\nextboxht}% - \getnoflines\nextboxht - \setbox\nextbox\vbox to \noflines\lineheight - {\ifnum\@@alignsnap=1 \kern\lineheight\kern-\topskip\fi - \ifnum\@@alignsnap>2 \vfill\fi - \flushnextbox - \ifnum\@@alignsnap<4 \vfill\fi}% - \fi - \ifshowgridboxes - \setgridtracebox\hbox[three]% - \fi - \forgetall - \par - \ifvbox\nextbox - \setbox\nextbox\hbox{\flushnextbox}% don't ask - \fi - \scratchskip\lastskip - \edef\presnapskip{\the\lastskip}% - % mixing single/double columns sometimes goes wrong, - % check 'som' document - \ifinsidecolumns - \forcepresnaptrue - \fi - \forcedpresnapcorrection - \ifdim\nextboxht>\strutht - \scratchdimen\nextboxht - \ifcase\@@presnap\relax - \ifdim\scratchskip>\zeropoint\relax - \scratchcounter\scratchskip - \advance\scratchcounter -\openlineheight - \ifnum\scratchcounter<0 - \scratchcounter-\scratchcounter - \fi - \ifnum\scratchcounter<10 % \lastkip is about \openlineheight - \advance\scratchdimen -\openstrutdepth - \edef\presnapskip{*\presnapskip}% - \else\ifdim\scratchskip>\openlineheight - %<\openlineheight \else - \advance\scratchdimen -\openstrutdepth - \edef\presnapskip{*\presnapskip}% - \fi\fi - \fi - \fi - % \getnoflines\scratchdimen % maybe raw ? - % \advance\noflines -1 - \ifcase\heightsnapmethod - % raw - \or - \advance\scratchdimen-\lineheight % tight (default) - \or - \advance\scratchdimen-\strutheight % fit (text) - \or - \advance\scratchdimen-\strutheight % tolerant - \advance\scratchdimen-\roundingeps - \fi - \getnoflines\scratchdimen - \ifnum\noflines>0 - \scratchdimen\noflines\lineheight - \else - \scratchdimen\zeropoint - \fi - \else - \scratchdimen\zeropoint - \fi - \ifnum\@@extrasnap=1 \advance\scratchdimen \extrasnapsign \lineheight \fi - \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi - \edef\presnap{\the\scratchdimen}% - \ifstrutsnapping - \ifboxedsnapping - \getrawnoflines\scratchdimen - \advance\scratchdimen-\noflines\lineheight - \vskip\scratchdimen % disappears at top of page - \dorecurse\noflines{\verticalstrut\nobreak}% - \else \ifdim\scratchdimen=\zeropoint - % nothing to skip - \else % disappears at top of page - \vskip\scratchdimen - \fi \fi - \fi - \ifdim\nextboxdp>\strutdp - % \getnoflines\nextboxdp - % \advance\noflines \minusone - \scratchdimen\nextboxdp\relax - \ifcase\depthsnapmethod - % raw - \or - \advance\scratchdimen-\lineheight % tight (default) - \or - \advance\scratchdimen-\strutdepth % fit (text) - \or - \advance\scratchdimen-\strutdepth % tolerant - \advance\scratchdimen-\roundingeps - \fi - \getnoflines\scratchdimen - \ifnum\noflines>0 - \scratchdimen\noflines\lineheight - \else - \scratchdimen\zeropoint - \fi - \else - \scratchdimen\zeropoint - \fi - \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi - \ifnum\@@extrasnap=3 \advance\scratchdimen \extrasnapsign \lineheight \fi - \edef\postsnap{\the\scratchdimen}% - \ifstrutsnapping - \nextboxht\strutht - \nextboxdp\strutdp - \else - \scratchdimen\presnap - \advance\scratchdimen \strutht - \nextboxht\scratchdimen - \scratchdimen\postsnap - \advance\scratchdimen \strutdp - \nextboxdp\scratchdimen - \fi - \hbox{\tracedsnapping\flushnextbox}% - \ifstrutsnapping - \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi - \fi - \else - \scratchdimen\nextboxht\relax - \ifcase\@@alignsnapbox - % can't happen here - \or - \getrawnoflines\scratchdimen - \else - \getnoflines \scratchdimen - \fi - \scratchdimen\noflines\lineheight\relax - \advance\scratchdimen-\strutdepth - % spoils the whole game (fit/broad/line) - % \ifnum\pagetotal>\zeropoint \else % disable this as option - % \advance\scratchdimen-\strutheight - % \advance\scratchdimen+\topskip - % \fi - \dimen0=\scratchdimen - \dimen2=\strutdepth - \ifshowgridboxes - \setgridtracebox\hbox[two]% - \fi - \nextboxdp\strutdp - \dimen4=\nextboxht - \dimen6=\nextboxdp - \iftracegridsnapping - \setbox\scratchbox\hbox - {\scratchdimen\@@alignsnapamount\relax - \ifdim\scratchdimen<\zeropoint - \tracedgridamount\zeropoint{-\scratchdimen}% - \else - \tracedgridamount\scratchdimen\zeropoint - \fi}% - \smashbox\scratchbox - \setbox\nextbox\hbox{\box\scratchbox\flushnextbox}% - \fi - \setbox\nextbox\hbox - {\scratchdimen\@@alignsnapamount\relax - \ifcase\@@alignsnapdepth\or - % don't change this ever ! - \ifdim\dimen0<\lineheight - % otherwise it is ok, but ending up inside - % the next paragraph is seldom what we want, - % so we move one line up - \advance\scratchdimen-\lineheight - \advance\scratchdimen\strutheight - \else - % otherwise we can move down to the - % baseline - \advance\scratchdimen\dimen6 % == \strutdepth - \fi - \fi - \lower\scratchdimen\flushnextbox}% - \nextboxht\dimen4 - \nextboxdp\dimen6 - \ifnum\@@alignsnap<4 % 4 = regel - \setbox\nextbox\vbox to \scratchdimen - {\forgetall - \ifnum\@@alignsnap>2 \vfill\fi % 3 4 - \flushnextbox - \nointerlineskip % \offinterlineskip - \ifnum\@@alignsnap<4 \vfill\fi % 2 3 - \kern\zeropoint}% - \fi - \ifshowgridboxes - \setgridtracebox\vbox[three]% - \fi - \scratchdimen\@@alignsnapamount - \edef\presnapskip{\the\scratchdimen}% - \ifnum\@@alignsnap>2 \def\presnap {+}\fi - \ifnum\@@alignsnap<4 \def\postsnap{+}\fi - \setbox\nextbox\hbox{\tracedsnapping\flushnextbox}% - \par - \nextboxht\dimen0 - \nextboxdp\dimen2 - \forcedpresnapcorrection - \nointerlineskip - \flushnextbox - \fi - \else - \setbox\nextbox\vbox to \textheight - {\ifdim\nextboxdp=\zeropoint - \hbox{\lower\strutdepth\flushnextbox} - \else % this branch is yet untested - \vss - \hbox{\lower\nextboxdp\flushnextbox} - \vskip-\strutdepth - \fi}% - \nextboxdp\strutdepth - \flushnextbox - \fi - \extrasnapreset - \enablepresnapcorrection - \global\chardef\@@alignsnap\zerocount - \global\chardef\@@alignsnapbox\zerocount - \egroup}} - -\def\tracedgridamount#1#2% - {\startlayoutcomponent{gridsnaps}{grid snaps}% - \color[grid:four]{\vrule\!!width\nextboxwd\!!height#1\!!depth#2}% - \stoplayoutcomponent} - -\def\snaptomathgrid % probably not working ok, also kind of obsolete - {\ifgridsnapping - \dowithnextbox - {\blank[\v!line]\snaptogrid\vbox{\flushnextbox}\blank[\v!line]} - \vbox\bgroup - \forgetdisplayskips - \@EA\let\@EA\next - \fi} - -\def\topsnaptogrid - {\ifgridsnapping - \dowithnextbox - {\scratchdimen\nextboxht - \advance\scratchdimen -\strutht - \advance\scratchdimen \topskip - \nextboxht\scratchdimen - \nextboxdp\zeropoint - \flushnextbox - \kern\lineheight - \kern-\topskip - \nointerlineskip} - \hbox - \fi} - -% \def\centertogrid % meant for special situations -% {\ifgridsnapping -% \dowithnextboxcontent -% {\ignorespaces} -% {\bgroup -% \par -% \scratchdimen\nextboxht -% \advance\scratchdimen \nextboxdp -% \getnoflines\scratchdimen -% \setbox\nextbox\vbox to \noflines\lineheight -% {\forgetall -% \vskip\zeropoint \!!plus \nextboxht -% \copy\nextbox -% \kern.5\strutdp % VOORLOPIGE WAARDE -% \vskip\zeropoint \!!plus \nextboxdp}% -% \noindent\snaptogrid\vbox{\flushnextbox}% -% \egroup} -% \vbox % was \hbox -% \fi} - -% The next implementation is sub-optimal -% -% \def\centertogrid % usage: see ie pascal / stepcharts -% {\snaptogrid[\v!midden,.5\strutdp]\vbox} - -\def\centertogrid % meant for special situations - {\ifgridsnapping - \dowithnextboxcontent - {\ignorespaces} - {\bgroup - \par - \scratchdimen\nextboxht - \advance\scratchdimen \nextboxdp - \getnoflines\scratchdimen - \setbox\nextbox\vbox to \noflines\lineheight - {\forgetall - \vss - \topbaselinecorrection - \copy\nextbox - \botbaselinecorrection - \vss}% - \setbox\nextbox\hbox{\lower\strutdp\flushnextbox}% - \forgeteverypar % new per 3/4/2008, prevents duplicate pos nodes resulting in extra whitespace - \noindent\snaptogrid\vbox{\flushnextbox}% - \egroup} - \vbox % was \hbox - \fi} - -% testbed for \centertogrid -% -% \strut Bruggetje -% \startlinecorrection -% \startcombination -% {\framed{test}} {} {\framed{test}} {} -% \stopcombination -% \stoplinecorrection -% \strut Bruggetje -% \startlinecorrection -% \startcombination[2*2] -% {\framed{test}} {} {\framed{test}} {} -% {\framed{test}} {} {\framed{test}} {} -% \stopcombination -% \stoplinecorrection -% \strut Bruggetje -% \startlinecorrection[blank] -% \startcombination -% {\framed{test}} {} {\framed{test}} {} -% \stopcombination -% \stoplinecorrection -% \strut Bruggetje -% \startlinecorrection[blank] -% \startcombination[2*2] -% {\framed{test}} {} {\framed{test}} {} -% {\framed{test}} {} {\framed{test}} {} -% \stopcombination -% \stoplinecorrection -% \strut Bruggetje -% \startlinecorrection -% \startcombination -% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} -% \stopcombination -% \stoplinecorrection -% \strut Bruggetje -% \startlinecorrection -% \startcombination[2*2] -% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} -% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} -% \stopcombination -% \stoplinecorrection -% \strut Bruggetje -% \startlinecorrection[blank] -% \startcombination -% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} -% \stopcombination -% \stoplinecorrection -% \strut Bruggetje -% \startlinecorrection[blank] -% \startcombination[2*2] -% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} -% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {} -% \stopcombination -% \stoplinecorrection - -\ifx\startbaselinecorrection\undefined \wait \fi % change order - -\let\normalstartbaselinecorrection=\startbaselinecorrection - -\def\startbaselinecorrection - {\ifgridsnapping - \centertogrid\bgroup - \let\stopbaselinecorrection\egroup - \else - \normalstartbaselinecorrection - \fi} - -\chardef\gridboxlinenomode\plusone -\chardef\gridboxlinemode \plusone % 0:nothing 1:all 2:lines 3:frame - -\def\gridboxvbox {\ifcase\gridboxlinemode\vbox\or\ruledvbox\or\vbox\or\ruledvbox\else\ruledvbox\fi} -\def\gridboxwidth{\ifcase\gridboxlinemode0\or.5\or.5\or0\else.5\fi\testrulewidth} - -\def\setgridbox#1#2#3% - {\setbox#1\gridboxvbox to #3 % given size - {\forgetall - \resetteststrut - \offinterlineskip - \hsize#2% - \baselinerulefalse - \gridboxvbox % calculated size - {\getrawnoflines{#3}% \getnoflines{#3}% - \vskip\topskip - \vskip-\strutht - \scratchdimen#2\advance\scratchdimen \lineheight - \dorecurse\noflines - {\strut - \hskip-.5\lineheight - \ifcase\gridboxlinenomode\or - \rlap - {\hskip.2\bodyfontsize\hskip\scratchdimen - \infofont\hbox to 1em{\hss\recurselevel}}% - \or - \llap - {\infofont\hbox to 1em{\hss\recurselevel}% - \hskip.2\bodyfontsize}% - \fi - \vrule - \!!height \gridboxwidth - \!!depth \gridboxwidth - \!!width \scratchdimen - \par}} - \vfill}} - -%D Some intervention macros: - -\def\gridwarning#1{\message{[beware of #1 extra snap]}} - -\global\let\@@alignsnapamount\!!zeropoint -\global\chardef\@@alignsnapdepth0 - -\def\@@unknowngriddisplacement - {\global\chardef\@@alignsnapbox\plusthree - \global\let\@@alignsnapamount\commalistelement} - -\def\domoveongrid[#1]% - {\ifgridsnapping\doifsomething{#1}{\dodomoveongrid[#1]}\fi} - -\def\dodomoveongrid[#1]% some day : speed up - {\global\chardef\@@alignsnap\zerocount - \global\chardef\@@alignsnapbox\zerocount - \global\chardef\@@alignsnapdepth\zerocount - \global\chardef\@@alignsnapmethod\zerocount - \global\let\@@alignsnapamount\!!zeropoint - \donefalse - \expanded{\processallactionsinset[#1]} - [\v!standard=>, - \v!normal=>, % to be sure - \v!yes=>, % to be sure - \v!top=>\gridwarning+\positiveextrasnap\extrasnapbefore, - \v!bottom=>\gridwarning+\positiveextrasnap\extrasnapafter, - \v!both=>\positiveextrasnap\extrasnaparound, - -\v!top=>\gridwarning-\negativeextrasnap\extrasnapbefore, - -\v!bottom=>\gridwarning-\negativeextrasnap\extrasnapafter, - -\v!both=>\negativeextrasnap\extrasnaparound, - \v!text=>\global\chardef\@@alignsnapmethod\plusone, % accurate calculations - \v!page=>\global\chardef\@@alignsnap\plusone, % topskip - \v!high=>\global\chardef\@@alignsnap\plustwo, - \v!middle=>\global\chardef\@@alignsnap\plusthree, - \v!low=>\global\chardef\@@alignsnap\plusfour, - \v!fit=>\global\chardef\@@alignsnapbox\plusone, % new - \v!broad=>\global\chardef\@@alignsnapbox\plustwo, % new - \v!depth=>\global\chardef\@@alignsnapdepth\plusone, % new - \v!line=>\global\chardef\@@alignsnapbox\plusthree -% \global\chardef\@@alignsnapdepth\plusone - \global\chardef\@@alignsnap\plusfour, - \v!reset=>\positiveextrasnap\extrasnapreset, - \v!none=>\global\chardef\@@alignsnap\zerocount - \global\chardef\@@alignsnapbox\zerocount, - \v!force=>, % turns on grid snapping even when not on - \s!default=>, - \s!unknown=>\@@unknowngriddisplacement]} - -\def\moveongrid - {\dosingleempty\domoveongrid} - -\def\doplaceongrid[#1]% - {\domoveongrid[#1]\snaptogrid\vbox} - -\def\placeongrid - {\dosingleempty\doplaceongrid} - -%D Snapping is rather robust as long as we use whole lines. -%D Half lines of white space can however be handled when they -%D come in pairs. The corrections needed when crossing page -%D boundaries in the middle of such a pair, are handled by -%D macros that are (named) sort of fuzzy. This fuzzy mechanism -%D was written as an extension to the grid typesetting needed -%D for typesetting (part of) the \MAPS. -%D -%D \starttyping -%D \setuptyping -%D [before={\blank[halfline]}, -%D after={\blank[halfline]}] -%D \stoptyping - -\newif \iffuzzyvskip -\newif \iffuzzysnapdone -\newif \iffuzzysnapping -\newif \iffuzzysnapped -\chardef \fuzzysnappedleft=0 % ==1 when fuzzybegin still open -\newpersistentmark\fuzzymark % (!) -\newcount \fuzzymarker -\newbox \fuzzysnapbox -\newbox \fuzzysnapsplit - -\def\dosyncfuzzyvskip - {\ifvmode\ifdim\lastskip<\lineheight\ifdim\lastskip>\zeropoint - \bgroup % - added 28/2/2003: check this, there was no - - \endgraf\forgetall\verticalstrut\nobreak\vskip-\struttotal - \egroup - \fi\fi\fi} - -\def\fuzzyvskip#1% - {\iffuzzysnapdone - \dosyncfuzzyvskip % NEWER - \endfuzzysnapping - \vskip#1\relax - \global\fuzzysnapdonefalse - \else - \vskip#1\relax - \beginfuzzysnapping - \global\fuzzysnapdonetrue - \fi} - -\def\setfuzzymark#1#2#3% #1/#2 => error recovery - {\ifgridsnapping - \global\fuzzysnappingtrue - \global\advance\fuzzymarker \ifodd\fuzzymarker#1\else#2\fi - \nobreak - \ifshowfuzzyskips - \hbox{\color[grid:three] - {\llap{\infofont#3\vl\the\fuzzymarker}\nobreak - \vrule\!!width\hsize\!!height.1\lineheight}} - \nobreak - \fi - %[\the\fuzzymarker] - %\expandafter\fuzzymark\expandafter{\the\fuzzymarker}% - \expandafter\rawsetmark\expandafter\fuzzymark\expandafter{\the\fuzzymarker}% - \nobreak - \fi} - -\def\beginfuzzysnapping{\setfuzzymark21\v!start} % odd -\def\endfuzzysnapping {\setfuzzymark12\v!stop } % even - -\def\removelastfuzzyvskip - {\ifgridsnapping - \iffuzzysnapping - \ifdim\lastskip<\openlineheight - \else - \removelastskip - \fi - \else - \removelastskip - \fi - \else - \removelastskip - \fi} - -\def\docheckfuzzysnap#1% - {\bgroup - \dontcomplain - \setbox\fuzzysnapbox\copy#1\relax - \setbox\fuzzysnapsplit\vsplit\fuzzysnapbox to 1\lineheight - \let\topfuzzymark\empty % indeed here ... no real mark - \getsplitmarks\fuzzymark -% \ifcase0\topfuzzymark - \ifcase0\rawgetsplittopmark\fuzzymark - \global\chardef\fuzzysnappedleft\zerocount - \global\fuzzysnappedfalse -% \else\ifodd\topfuzzymark - \else\ifodd\rawgetsplittopmark\fuzzymark - \global\chardef\fuzzysnappedleft\plusone - \global\fuzzysnappedtrue - \else - \global\chardef\fuzzysnappedleft=2 - \global\fuzzysnappedtrue - \fi\fi - \iffuzzysnapped \else - \doloop - {\ifvoid\fuzzysnapbox - \exitloop - \else - \setbox\fuzzysnapsplit=\vsplit\fuzzysnapbox to \lineheight - %\let\topfuzzymark=\empty % ... but not here - \getsplitmarks\fuzzymark -% \ifcase0\topfuzzymark - \ifcase0\rawgetsplittopmark\fuzzymark - % continue -% \else\ifodd\topfuzzymark - \else\ifodd\rawgetsplittopmark\fuzzymark - \exitloop - \else - \global\chardef\fuzzysnappedleft\plusone - \global\fuzzysnappedtrue - \exitloop - \fi\fi - \fi}% - \fi - \egroup} - -\def\getfuzzysnapcorrection#1% - {\global\let\presnapcorrection \relax - \global\let\postsnapcorrection\relax - \ifgridsnapping\iffuzzysnapping - \docheckfuzzysnap{#1}% - \iffuzzysnapped - \iftracegridsnapping - \gdef\presnapcorrection - {\color[grid:four]{\hrule\!!height.5\openlineheight\!!width\hsize}}% - \else - \gdef\presnapcorrection{\kern.5\openlineheight}% - \fi - \gdef\postsnapcorrection{\kern-.5\openlineheight}% get the height ok - \fi - \fi\fi} - -\def\fuzzysnappedbox#1#2% \box \unvbox - {\getfuzzysnapcorrection{#2}% - \presnapcorrection - #1#2% - \postsnapcorrection} - -\def\adaptfuzzypagegoal - {\ifgridsnapping\iffuzzysnapping\ifcase\fuzzysnappedleft\or % see dopagecontents - \scratchdimen\pagegoal - \advance\scratchdimen -.5\openlineheight - \global\pagegoal\scratchdimen - \global\advance\vsize -.5\openlineheight - \global\chardef\fuzzysnappedleft0 - \fi\fi\fi} - -%D New, experimental, used in caption snapping: -%D -%D \starttyping -%D \startcolumnset -%D -%D \setupcaption[figure][style=\tfx\setupinterlinespace,inbetween=,grid=top] -%D -%D \placefigure [lrtb] {\dorecurse{5}{green gras}} -%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} -%D \placefigure [lrtb] {\dorecurse{15}{green gras}} -%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} -%D -%D \setupcaption[figure][style=\tfx\setupinterlinespace,inbetween=,grid=bottom] -%D -%D \placefigure [rltb] {\dorecurse{5}{green gras}} -%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} -%D \placefigure [rltb] {\dorecurse{15}{green gras}} -%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]} -%D -%D \input thuan -%D -%D \stopcolumnset -%D \stoptyping - -\def\moveboxontogrid#1#2#3% box method firstlineht % experimental ! ! ! - {\doifsomething{#2} - {\getnoflines{\ht#1}% no depth taken into account, depth preserved - \scratchdimen\noflines\lineheight - \advance\scratchdimen-\strutdp - \bgroup - \advance\scratchdimen-\onepoint % be a bit tolerant - \ifdim\scratchdimen>\ht#1\relax - \egroup - \doif{#2}\v!top {\setbox#1\vbox to \scratchdimen{\vskip-#3\vskip\strutht\box#1\vfill}}% - \doif{#2}\v!bottom{\setbox#1\vbox to \scratchdimen{\vfill\box#1\removedepth}}% - \dp#1\strutdp - \else - \egroup - \ht#1\scratchdimen - \dp#1\strutdp - \fi}} - -%D New: - -\let\checkgridsnapping\relax - -\protect \endinput diff --git a/tex/context/base/core-ini.mkii b/tex/context/base/core-ini.mkii new file mode 100644 index 000000000..69edf9735 --- /dev/null +++ b/tex/context/base/core-ini.mkii @@ -0,0 +1,67 @@ +%D \module +%D [ file=core-ini, +%D version=2003.12.01, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Additional Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / Additional Initialization} + +%D We will move more code to here, so that we become less dependent of the +%D orde in which modules are loaded. + +\unprotect + +\everypar \emptytoks +\neverypar \emptytoks + +\appendtoks \flushnotes \to \everypar +\appendtoks \synchronizesidefloats \to \everypar + +\appendtoks \checkinlinedirection \to \everypar + +\appendtoks \checkindentation \to \everypar +\appendtoks \showparagraphnumber \to \everypar +\appendtoks \flushmargincontents \to \everypar +\appendtoks \flushcommentanchors \to \everypar +\appendtoks \synchronizenotes \to \everypar +\appendtoks \OTRSETshowstatus \to \everypar +\appendtoks \flushpostponedbookmark \to \everypar +\appendtoks \registerparoptions \to \everypar +\appendtoks \flushsyncpositions \to \everypar +\appendtoks \flushpostponednodedata \to \everypar +\appendtoks \dohandlerepeatdelimitedtext \to \everypar +\appendtoks \insertparagraphintro \to \everypar + +\appendtoks \flushpostponedbookmark \to \neverypar +\appendtoks \flushpostponedbookmark \to \everylistentry + +\appendtoks \flushnotes \to \everydisplay +\appendtoks \adjustsidefloatdisplaylines \to \everydisplay + +\appendtoks \flushsyncpositions \to \everyheadstart + +\appendtoks \flushsyncresets \to \everyendoftextbody + +\appendtoks \ignorespaces \to \everybeginofpar + +\appendtoks \removeunwantedspaces \to \everyendofpar +%appendtoks \strut \to \everyendofpar % option ? +\appendtoks \flushsyncresets \to \everyendofpar +\appendtoks \setlastlinewidth \to \everyendofpar % must happen before endgraf +\appendtoks \endgraf \to \everyendofpar + +% Todo: verbatim, xml, tex, move code to here + +\ifx\normalcompound\undefined \let\normalcompound=| \fi + +\appendtoks \catcode`|=\@@active \let|\normalcompound \to \everyTEXinputmode +\appendtoks \catcode`|=\@@letter \to \everyXMLinputmode + +\protect \endinput diff --git a/tex/context/base/core-ini.mkiv b/tex/context/base/core-ini.mkiv new file mode 100644 index 000000000..69edf9735 --- /dev/null +++ b/tex/context/base/core-ini.mkiv @@ -0,0 +1,67 @@ +%D \module +%D [ file=core-ini, +%D version=2003.12.01, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Additional Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / Additional Initialization} + +%D We will move more code to here, so that we become less dependent of the +%D orde in which modules are loaded. + +\unprotect + +\everypar \emptytoks +\neverypar \emptytoks + +\appendtoks \flushnotes \to \everypar +\appendtoks \synchronizesidefloats \to \everypar + +\appendtoks \checkinlinedirection \to \everypar + +\appendtoks \checkindentation \to \everypar +\appendtoks \showparagraphnumber \to \everypar +\appendtoks \flushmargincontents \to \everypar +\appendtoks \flushcommentanchors \to \everypar +\appendtoks \synchronizenotes \to \everypar +\appendtoks \OTRSETshowstatus \to \everypar +\appendtoks \flushpostponedbookmark \to \everypar +\appendtoks \registerparoptions \to \everypar +\appendtoks \flushsyncpositions \to \everypar +\appendtoks \flushpostponednodedata \to \everypar +\appendtoks \dohandlerepeatdelimitedtext \to \everypar +\appendtoks \insertparagraphintro \to \everypar + +\appendtoks \flushpostponedbookmark \to \neverypar +\appendtoks \flushpostponedbookmark \to \everylistentry + +\appendtoks \flushnotes \to \everydisplay +\appendtoks \adjustsidefloatdisplaylines \to \everydisplay + +\appendtoks \flushsyncpositions \to \everyheadstart + +\appendtoks \flushsyncresets \to \everyendoftextbody + +\appendtoks \ignorespaces \to \everybeginofpar + +\appendtoks \removeunwantedspaces \to \everyendofpar +%appendtoks \strut \to \everyendofpar % option ? +\appendtoks \flushsyncresets \to \everyendofpar +\appendtoks \setlastlinewidth \to \everyendofpar % must happen before endgraf +\appendtoks \endgraf \to \everyendofpar + +% Todo: verbatim, xml, tex, move code to here + +\ifx\normalcompound\undefined \let\normalcompound=| \fi + +\appendtoks \catcode`|=\@@active \let|\normalcompound \to \everyTEXinputmode +\appendtoks \catcode`|=\@@letter \to \everyXMLinputmode + +\protect \endinput diff --git a/tex/context/base/core-ini.tex b/tex/context/base/core-ini.tex deleted file mode 100644 index 69edf9735..000000000 --- a/tex/context/base/core-ini.tex +++ /dev/null @@ -1,67 +0,0 @@ -%D \module -%D [ file=core-ini, -%D version=2003.12.01, -%D title=\CONTEXT\ Core Macros, -%D subtitle=Additional Initialization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Core Macros / Additional Initialization} - -%D We will move more code to here, so that we become less dependent of the -%D orde in which modules are loaded. - -\unprotect - -\everypar \emptytoks -\neverypar \emptytoks - -\appendtoks \flushnotes \to \everypar -\appendtoks \synchronizesidefloats \to \everypar - -\appendtoks \checkinlinedirection \to \everypar - -\appendtoks \checkindentation \to \everypar -\appendtoks \showparagraphnumber \to \everypar -\appendtoks \flushmargincontents \to \everypar -\appendtoks \flushcommentanchors \to \everypar -\appendtoks \synchronizenotes \to \everypar -\appendtoks \OTRSETshowstatus \to \everypar -\appendtoks \flushpostponedbookmark \to \everypar -\appendtoks \registerparoptions \to \everypar -\appendtoks \flushsyncpositions \to \everypar -\appendtoks \flushpostponednodedata \to \everypar -\appendtoks \dohandlerepeatdelimitedtext \to \everypar -\appendtoks \insertparagraphintro \to \everypar - -\appendtoks \flushpostponedbookmark \to \neverypar -\appendtoks \flushpostponedbookmark \to \everylistentry - -\appendtoks \flushnotes \to \everydisplay -\appendtoks \adjustsidefloatdisplaylines \to \everydisplay - -\appendtoks \flushsyncpositions \to \everyheadstart - -\appendtoks \flushsyncresets \to \everyendoftextbody - -\appendtoks \ignorespaces \to \everybeginofpar - -\appendtoks \removeunwantedspaces \to \everyendofpar -%appendtoks \strut \to \everyendofpar % option ? -\appendtoks \flushsyncresets \to \everyendofpar -\appendtoks \setlastlinewidth \to \everyendofpar % must happen before endgraf -\appendtoks \endgraf \to \everyendofpar - -% Todo: verbatim, xml, tex, move code to here - -\ifx\normalcompound\undefined \let\normalcompound=| \fi - -\appendtoks \catcode`|=\@@active \let|\normalcompound \to \everyTEXinputmode -\appendtoks \catcode`|=\@@letter \to \everyXMLinputmode - -\protect \endinput diff --git a/tex/context/base/core-ins.tex b/tex/context/base/core-ins.tex deleted file mode 100644 index 069153434..000000000 --- a/tex/context/base/core-ins.tex +++ /dev/null @@ -1,103 +0,0 @@ -%D \module -%D [ file=core-ins, -%D version=2002.04.16, -%D title=\CONTEXT\ Insertion Macros, -%D subtitle=Insertions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Core Macros / Insertions} - -%D Insertions are special data collections that are associated -%D to \TEX's internal page builder. When multiple footnote -%D classes were introduced, I decided to isolate some of the -%D functionality in a module. - -\unprotect - -\newtoks\@@insertionlist - -\def\processinsertions{\the\@@insertionlist} - -\let\doprocessinsert\gobbleoneargument - -%\def\installinsertion#1% -% {\ifx#1\undefined -% \newinsert#1% -% \count#1\plusthousand -% \skip #1\zeropoint -% \dimen#1\maxdimen -% \appendtoks\doprocessinsert#1\to\@@insertionlist -% \fi} - -\def\installinsertion#1% - {\ifx#1\undefined - \let#1\relax - \fi - \ifx#1\relax % permits \csname...\endcsname - \newinsert#1% - \count#1\plusthousand - \skip #1\zeropoint - \dimen#1\maxdimen - \appendtoks\doprocessinsert#1\to\@@insertionlist - \fi} - - -\def\synchronizeinsertions - {\def\doprocessinsert##1{\ifvoid##1\else\insert##1{\unvbox##1}\fi}% - \processinsertions} - -%D For instance, when we postpone footnotes, we need to save -%D some data related to the inserts. The next methods are -%D far from ideal, but better than nothing. We save and -%D restore box content and associated data independently. -%D The box content is only restores when non||void. - -\def\backupinsertion#1% - {\csname\string#1\endcsname} - -\def\installbackupinsertion#1% - {\expandafter\newinsert\csname\string#1\endcsname - \count\backupinsertion#1\zerocount - \skip \backupinsertion#1\zeropoint - \dimen\backupinsertion#1\maxdimen} - -\def\saveinsertionbox#1% - {\ifdim\ht#1>\zeropoint % hm, actually unknown - \global\setbox\backupinsertion#1\box#1% - \else - \global\setbox\backupinsertion#1\emptybox - \fi} - -\def\restoreinsertionbox#1% - {\ifvoid\backupinsertion#1\else % if void, we keep the content - \global\setbox#1\box\backupinsertion#1% - \fi} - -\def\eraseinsertionbackup#1% - {\global\setbox\backupinsertion#1\emptybox} - -\def\saveinsertiondata#1% - {\global\skip \backupinsertion#1\skip #1% - \global\count\backupinsertion#1\count#1% - \global\dimen\backupinsertion#1\dimen#1} - -\def\restoreinsertiondata#1% - {\global\skip #1\skip \backupinsertion#1% - \global\count#1\count\backupinsertion#1% - \global\dimen#1\dimen\backupinsertion#1} - -%D Auxiliary macros: - -\def\addinsertionheight#1\to#2% - {\ifvoid#1\else - \advance#2 1\skip#1\relax - \advance#2 \ht #1\relax - \fi} - -\protect \endinput diff --git a/tex/context/base/core-job.mkiv b/tex/context/base/core-job.mkiv index 84877eb3f..7231ac383 100644 --- a/tex/context/base/core-job.mkiv +++ b/tex/context/base/core-job.mkiv @@ -63,8 +63,7 @@ \def\doloadexamodes [#1]{\ctxlua{commands.loadexamodes("#1")}} \def\registerfileinfo[#1#2]#3% geen \showmessage ? - {\writestatus\m!systems{#1#2 file #3 at line \the\inputlineno}% - \immediatewriteutility{f #1 {#3}}} + {\writestatus\m!systems{#1#2 file #3 at line \the\inputlineno}} \ifx\preloadfonts \undefined \let\preloadfonts \relax \fi \ifx\preloadspecials\undefined \let\preloadspecials\relax \fi @@ -92,19 +91,6 @@ \bgroup\disableXML\loadallsystemfiles\f!errfilename\donothing\egroup \to\everygoodbye}} -%D Loading of \type {cont-usr.tex} (edited by the user) -%D and \type {cont-fmt.tex} (generated by texexec). - -% \def\loaduserspecifications -% {% this used to be the file where users can tune their system, especially patterns -% \readsysfile\f!usrfilename{\showmessage\m!systems2\f!usrfilename}\donothing -% % this one took care of user preferences (fonts, messages) but lm made this obsolete -% \readjobfile\f!fmtfilename{\showmessage\m!systems2\f!fmtfilename}\donothing -% % from now on we preload all patterns (only in mkii) -% \preloadallpatterns} - -\let\loaduserspecifications\relax - %D We don't want multiple jobfiles to interfere. \def\loadoptionfile @@ -189,9 +175,6 @@ \def\donotexecutefile#1% {} -\def\verwerkfile#1 % - {\doexecutefile{#1}} - \def\useenvironment[#1]% maybe commalist {\environment #1 \relax} @@ -300,7 +283,7 @@ % NOT TOEVOEGEN: \the\everytrace -\neverypar=\emptytoks +\neverypar\emptytoks % \appendtoks \flushnotes \to \everypar % \appendtoks \synchronizesidefloats \to \everypar @@ -313,8 +296,6 @@ % \appendtoks \flushnotes \to \everydisplay % \appendtoks \adjustsidefloatdisplaylines \to \everydisplay -% soon, when pdftex 1.22 is out in the field: - \chardef\systemcommandmode\zerocount % 0=unknown 1=disabled 2=enabled \def\checksystemcommandmode @@ -331,22 +312,4 @@ \writestatus\m!systems{system commands are enabled}% \fi} -% \ifx\etexversion\undefined \else \ifnum\etexversion<202 -% \prependtoks -% \writestatus\m!systems{eTeX version \number\etexversion\space -> too old (bugs)}% -% \writeline -% \to \everyjob -% \fi \fi - -% \ifx\pdftexversion\undefined \else \ifnum\number\pdftexversion<120 -% \prependtoks -% \writestatus\m!systems{pdfTeX version \number\pdftexversion\space -> please update}% -% \writeline -% \to \everyjob -% \fi \fi - -% Default-instellingen (verborgen) - -\resetutilities - \protect \endinput diff --git a/tex/context/base/core-lme.tex b/tex/context/base/core-lme.tex deleted file mode 100644 index 69dc3b7b2..000000000 --- a/tex/context/base/core-lme.tex +++ /dev/null @@ -1,55 +0,0 @@ -%D \module -%D [ file=core-lme, -%D version=2006.08.14, -%D title=\CONTEXT\ Core Macros, -%D subtitle=LAst Minute Extensions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Core Macros / Last Minute Extensions} - -%D Things that depend on too much other things. - -\unprotect - -%D Probably obsolete, depends on \type {\checksidefloat}. May disappear. - -\def\checkframedtext - {\ifinsidefloat - \localhsize\hsize - \else\ifdim\sidefloatvsize>\zeropoint % will be proper handle - % \strut % rather clean way to invoke the sidefloat OTR - % \setbox0=\lastbox % and get the widths set, so from now on we - % \setlocalhsize % can have framed texts alongside sidefloats - \checksidefloat - \setlocalhsize - \else - \localhsize\hsize - \fi\fi} - -%D For my eyes only: - -\newcount\nofprofiled - -\def\profilemacro#1% - {\nofprofiled\zerocount - \letvalue{\string#1\string#1}#1% - \appendtoks - \normalwritestatus\m!systems{profile \string#1: \number\nofprofiled}% - \to \everystoptext - \unexpanded\def#1% - {\global\advance\nofprofiled\plusone - \csname\string#1\string#1\endcsname}} - -%D Some plain goodies, they may be moved to \type {m-plain.tex} some day. - -\ifx\hang \undefined \def\hang {\hangindent\parindent} \fi -\ifx\textindent\undefined \def\textindent#1{\indent\llap{#1\enspace}\ignorespaces} \fi -\ifx\narrower \undefined \def\narrower {\advance\leftskip \parindent\advance\rightskip\parindent} \fi - -\protect \endinput diff --git a/tex/context/base/core-lnt.tex b/tex/context/base/core-lnt.tex deleted file mode 100644 index ae3200e7a..000000000 --- a/tex/context/base/core-lnt.tex +++ /dev/null @@ -1,197 +0,0 @@ -%D \module -%D [ file=core-lnt, -%D version=2002.05.10, -%D title=\CONTEXT\ Core Macros, -%D subtitle=Line Notes, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Core Macros / Line Notes} - -%D This module loads on top of the footnote and line numbering macros. - -\unprotect - -\newcounter\linenotecounter -\newtoks \collectedlinenotes -\newif \iftracelinenotes - -\appendtoks - \the\collectedlinenotes -\to \everylinenumber - -\appendtoks - \global\collectedlinenotes\emptytoks -\to \beforeeverylinenumbering - -\def\dohandlelinenote#1#2#3% - {\bgroup - \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber - \ifnum\linenotelinenumber=\linenumber\relax - % todo: \onlyfootnote{#2}{#3}% == configurable - % \setupnote[#1][\c!numbercommand=\gobbleoneargument]% - % \setnotetext[#1]{\rawreference\s!fnt{\s!fnt:f:\number\internalnotereference}{}#2: #3}% - \def\linenotelinenumber##1{#2}% - \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% - \setnote[#1]{#3}% - \fi - \egroup} - -\def\dotracedlinenote#1% - {\iftracelinenotes - \hbox to \zeropoint - {\forgetall - \localcolortrue - \hsize\zeropoint - \hss - \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}% - {\color[blue]{\vl}}% - \vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}% - \hss}% - \prewordbreak - \fi} - -\def\dolinenote#1#2% - {\doglobal\increment\linenotecounter - \doifreferencefoundelse{\??rr:\linenotecounter}% - {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote - {#1}{\currenttextreference}}{#2}\to\collectedlinenotes} - \donothing - \dotracedlinenote\empty - \expanded{\someline[\??rr:\linenotecounter]}} - -\def\dostartlinenote#1[#2]#3% - {\doifreferencefoundelse{\??rr:#2}% - {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote - {#1}{\currenttextreference}}{#3}\to\collectedlinenotes} - \donothing - \dotracedlinenote{#2}% - \startline[\??rr:#2]} - -\def\dostoplinenote#1[#2]% - {\stopline[\??rr:#2]} - -% defining them - -\def\definelinenote - {\dodoubleempty\dodefinelinenote} - -\def\dodefinelinenote[#1][#2]% - {\definenote[#1][#2]% - \setvalue {#1}{\dolinenote {#1}}% - \setvalue{\e!start#1}{\dostartlinenote{#1}}% - \setvalue{\e!stop #1}{\dostoplinenote {#1}}} - -\def\setuplinenote % convenient - {\setupnote} - -% We predefine one, namely \type {\linenote} cum suis. - -\definelinenote[\v!linenote] - -% \startbuffer[test] -% \startlinenumbering[100] -% test \linenote {oeps} test test test test test test -% test \startlinenote [well] {oeps} test test test test test test -% test \linenote {oeps} test test test test test test -% test \linenote {oeps} test test test test test test -% test \linenote {oeps} test test test test test test -% test \linenote {oeps} test test test test test test -% test \stoplinenote [well] test test test test test test -% \stoplinenumbering -% \stopbuffer -% -% \setupnotedefinition[linenote] [location=serried,distance=.5em] -% -% {\typebuffer[test] \getbuffer[test]} \page -% -% \startbuffer[setup] -% \setuplinenumbering -% [align=left] -% \stopbuffer -% -% {\typebuffer[setup] \getbuffer[setup,test]} \page -% -% \startbuffer[setup] -% \setuplinenumbering -% [width=1em, -% align=left] -% \stopbuffer -% -% {\typebuffer[setup] \getbuffer[setup,test]} \page -% -% \startbuffer[setup] -% \setuplinenumbering -% [width=2em, -% distance=.5em, -% align=left] -% \stopbuffer -% -% {\typebuffer[setup] \getbuffer[setup,test]} \page -% -% \startbuffer[setup] -% \setuplinenumbering -% [width=2em, -% align=middle] -% \stopbuffer -% -% {\typebuffer[setup] \getbuffer[setup,test]} \page -% -% \startbuffer[setup] -% \setuplinenumbering -% [conversion=romannumerals, -% start=1, -% step=1, -% location=text, -% style=slanted, -% color=blue, -% width=1.5em] -% \stopbuffer -% -% {\typebuffer[setup] \startnarrower\getbuffer[setup,test]\stopnarrower} \page -% -% \startbuffer[setup] -% \setuplinenumbering -% [width=4em, -% left=--, -% right=--, -% align=middle] -% \stopbuffer -% -% {\typebuffer[setup] \getbuffer[setup,test]} \page -% -% \startbuffer[setup-1] -% \setuplinenumbering -% [style=\bfxx, -% command=\WatchThis] -% \stopbuffer -% -% \startbuffer[setup-2] -% \def\WatchThis#1% -% {\ifodd\linenumber -% \definecolor[linecolor][red]% -% \else -% \definecolor[linecolor][green]% -% \fi -% \inframed -% [offset=1pt,frame=off,background=color,backgroundcolor=linecolor] -% {#1}} -% \stopbuffer -% -% {\typebuffer[setup-1,setup-2] \getbuffer[setup-1,setup-2,test]} \page -% -% \startbuffer[setup-1] -% \setuplinenumbering -% [location=inright, -% style=\bfxx, -% command=\WatchThis] -% \stopbuffer -% -% {\typebuffer[setup-1] \getbuffer[setup-1,setup-2,test]} \page - -\protect \endinput diff --git a/tex/context/base/core-mak.tex b/tex/context/base/core-mak.tex deleted file mode 100644 index 574fb9756..000000000 --- a/tex/context/base/core-mak.tex +++ /dev/null @@ -1,84 +0,0 @@ -%D \module -%D [ file=core-mak, -%D version=1997.10.05, -%D title=\CONTEXT\ Core Macros, -%D subtitle=General Makeup 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. - -\writestatus{loading}{ConTeXt Core Macros / General Makeup Commands} - -\unprotect - -% \definieerplaats[naam][instellingen] -% \stelplaatsin[naam][instellingen] -% \plaats[[instellingen]] -% -% - still undocumented and also not in setupb yet -% - kan ook intern/direct (scheelt duplicatie), zie \framedtext - -\def\dodefineplacement[#1][#2]% - {\getparameters - [\??pl#1] - [\c!left=\hss, - \c!right=\hss, - \c!linecorrection=\v!off, - \c!depthcorrection=\v!off, - \c!margin=\v!standard, - \c!grid=\v!middle, - %\c!before=, - %\c!after=, - #2]% - \setvalue{\e!place#1}{\doplacement[\??pl#1]}} - -\def\defineplacement - {\dodoubleempty\dodefineplacement} - -\def\setupplacement - {\dodoubleempty\dosetupplacement} - -\def\dosetupplacement[#1]% - {\dodoubleempty\getparameters[\??pl#1]} - -\def\doplacement - {\dodoubleempty\dodoplacement} - -\def\dodoplacement[#1][#2]% correctie moet mooier - {\bgroup - \dowithnextboxcontent - {\forgetall} - {\setlocalhsize - \getparameters[#1][#2]% - \getvalue{#1\c!before}% - \begingroup - \positioningparfalse - \setbox\nextbox\hbox to \localhsize - {\getvalue{#1\c!left}% - \flushnextbox - \getvalue{#1\c!right}}% - \ifinsidefloat \else - \addlocalbackgroundtobox\nextbox - \fi - \ifgridsnapping - \doifundefined{#1\c!grid}{\letvalue{#1\c!grid}\v!middle}% - % unchecked - \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent - \snaptogrid[\getvalue{#1\c!grid}]\hbox{\flushnextbox}% - \else - \doifvalue{#1\c!linecorrection}\v!on \startbaselinecorrection - \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent - \flushnextbox - \doifvalue{#1\c!depthcorrection}\v!on\baselinecorrection - \doifvalue{#1\c!linecorrection }\v!on\stopbaselinecorrection - \fi - \endgroup - \getvalue{#1\c!after}% - \egroup} - \vbox} - -\protect \endinput diff --git a/tex/context/base/core-mis.mkii b/tex/context/base/core-mis.mkii index e860a537a..e61adee25 100644 --- a/tex/context/base/core-mis.mkii +++ b/tex/context/base/core-mis.mkii @@ -196,6 +196,72 @@ \c!inbetween={\blank[\v!medium]}, \c!after=\blank] +% \definieerplaats[naam][instellingen] +% \stelplaatsin[naam][instellingen] +% \plaats[[instellingen]] +% +% - still undocumented and also not in setupb yet +% - kan ook intern/direct (scheelt duplicatie), zie \framedtext + +\def\dodefineplacement[#1][#2]% + {\getparameters + [\??pl#1] + [\c!left=\hss, + \c!right=\hss, + \c!linecorrection=\v!off, + \c!depthcorrection=\v!off, + \c!margin=\v!standard, + \c!grid=\v!middle, + %\c!before=, + %\c!after=, + #2]% + \setvalue{\e!place#1}{\doplacement[\??pl#1]}} + +\def\defineplacement + {\dodoubleempty\dodefineplacement} + +\def\setupplacement + {\dodoubleempty\dosetupplacement} + +\def\dosetupplacement[#1]% + {\dodoubleempty\getparameters[\??pl#1]} + +\def\doplacement + {\dodoubleempty\dodoplacement} + +\def\dodoplacement[#1][#2]% correctie moet mooier + {\bgroup + \dowithnextboxcontent + {\forgetall} + {\setlocalhsize + \getparameters[#1][#2]% + \getvalue{#1\c!before}% + \begingroup + \positioningparfalse + \setbox\nextbox\hbox to \localhsize + {\getvalue{#1\c!left}% + \flushnextbox + \getvalue{#1\c!right}}% + \ifinsidefloat \else + \addlocalbackgroundtobox\nextbox + \fi + \ifgridsnapping + \doifundefined{#1\c!grid}{\letvalue{#1\c!grid}\v!middle}% + % unchecked + \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent + \snaptogrid[\getvalue{#1\c!grid}]\hbox{\flushnextbox}% + \else + \doifvalue{#1\c!linecorrection}\v!on \startbaselinecorrection + \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent + \flushnextbox + \doifvalue{#1\c!depthcorrection}\v!on\baselinecorrection + \doifvalue{#1\c!linecorrection }\v!on\stopbaselinecorrection + \fi + \endgroup + \getvalue{#1\c!after}% + \egroup} + \vbox} + % Te zijner tijd [plaats=boven,onder,midden] implementeren, % in dat geval moet eerst de maximale hoogte worden bepaald. % diff --git a/tex/context/base/core-mis.mkiv b/tex/context/base/core-mis.mkiv index 96d3bd2cd..88a027c02 100644 --- a/tex/context/base/core-mis.mkiv +++ b/tex/context/base/core-mis.mkiv @@ -44,16 +44,16 @@ %appendtoks \def\executesynonym#1#2#3#4{#3}\to\simplifiedcommands %appendtoks \def\executesort#1#2#3{#3}\to\simplifiedcommands -\appendtoks \def\ { }\to\simplifiedcommands -\appendtoks \def\type#1{\letterbackslash\strippedcsname#1}\to\simplifiedcommands -\appendtoks \def\tex#1{\letterbackslash#1}\to\simplifiedcommands -\appendtoks \def\TeX{TeX}\to\simplifiedcommands -\appendtoks \def\ConTeXt{ConTeXt}\to\simplifiedcommands -\appendtoks \def\MetaPost{MetaPost}\to\simplifiedcommands -\appendtoks \def\MetaFont{MetaFont}\to\simplifiedcommands -\appendtoks \def\MetaFun{MetaFun}\to\simplifiedcommands -%appendtoks \def||{-}\to\simplifiedcommands -\appendtoks \def|#1|{\ifx#1\empty\empty-\else#1\fi}\to\simplifiedcommands +\appendtoks \def\ { }\to\simplifiedcommands +\appendtoks \def\type#1{\letterbackslash\checkedstrippedcsname#1}\to\simplifiedcommands +\appendtoks \def\tex#1{\letterbackslash#1}\to\simplifiedcommands +\appendtoks \def\TeX{TeX}\to\simplifiedcommands +\appendtoks \def\ConTeXt{ConTeXt}\to\simplifiedcommands +\appendtoks \def\MetaPost{MetaPost}\to\simplifiedcommands +\appendtoks \def\MetaFont{MetaFont}\to\simplifiedcommands +\appendtoks \def\MetaFun{MetaFun}\to\simplifiedcommands +%appendtoks \def||{-}\to\simplifiedcommands +\appendtoks \def|#1|{\ifx#1\empty\empty-\else#1\fi}\to\simplifiedcommands \appendtoks\let\buildtextaccent\secondoftwoarguments\to\simplifiedcommands @@ -196,6 +196,72 @@ \c!inbetween={\blank[\v!medium]}, \c!after=\blank] +% \definieerplaats[naam][instellingen] +% \stelplaatsin[naam][instellingen] +% \plaats[[instellingen]] +% +% - still undocumented and also not in setupb yet +% - kan ook intern/direct (scheelt duplicatie), zie \framedtext + +\def\dodefineplacement[#1][#2]% + {\getparameters + [\??pl#1] + [\c!left=\hss, + \c!right=\hss, + \c!linecorrection=\v!off, + \c!depthcorrection=\v!off, + \c!margin=\v!standard, + \c!grid=\v!middle, + %\c!before=, + %\c!after=, + #2]% + \setvalue{\e!place#1}{\doplacement[\??pl#1]}} + +\def\defineplacement + {\dodoubleempty\dodefineplacement} + +\def\setupplacement + {\dodoubleempty\dosetupplacement} + +\def\dosetupplacement[#1]% + {\dodoubleempty\getparameters[\??pl#1]} + +\def\doplacement + {\dodoubleempty\dodoplacement} + +\def\dodoplacement[#1][#2]% correctie moet mooier + {\bgroup + \dowithnextboxcontent + {\forgetall} + {\setlocalhsize + \getparameters[#1][#2]% + \getvalue{#1\c!before}% + \begingroup + \positioningparfalse + \setbox\nextbox\hbox to \localhsize + {\getvalue{#1\c!left}% + \flushnextbox + \getvalue{#1\c!right}}% + \ifinsidefloat \else + \addlocalbackgroundtobox\nextbox + \fi + \ifgridsnapping + \doifundefined{#1\c!grid}{\letvalue{#1\c!grid}\v!middle}% + % unchecked + \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent + \snaptogrid[\getvalue{#1\c!grid}]\hbox{\flushnextbox}% + \else + \doifvalue{#1\c!linecorrection}\v!on \startbaselinecorrection + \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent + \flushnextbox + \doifvalue{#1\c!depthcorrection}\v!on\baselinecorrection + \doifvalue{#1\c!linecorrection }\v!on\stopbaselinecorrection + \fi + \endgroup + \getvalue{#1\c!after}% + \egroup} + \vbox} + % Te zijner tijd [plaats=boven,onder,midden] implementeren, % in dat geval moet eerst de maximale hoogte worden bepaald. % @@ -1654,13 +1720,11 @@ \def\afterbothpairedboxes {\setbox\secondpairedbox\vbox - {% \localstartcolor[\@@ldcolor]% does not work yet - \ifnum\@@ldn>1 - \rigidcolumnbalance\nextbox - \else - \flushnextbox - \fi - }% \localstopcolor}% + {\ifnum\@@ldn>1 + \rigidcolumnbalance\nextbox + \else + \flushnextbox + \fi}% \ifnum\pairedlocationa<2\hbox\else\vbox\fi\bgroup % hide vsize \forgetall \ifnum\pairedlocationa<2 @@ -1836,101 +1900,9 @@ \afterassignment\next\let\nexttoken=} \hbox} -% stupid version, does not align top stuff when captions, -% keep as example -% -% \def\dodocombination -% {\vbox -% {\forgetall % \setupwhitespace[\v!none]% -% \let\next\vbox -% \ExpandFirstAfter\processallactionsinset -% [\combinationparameter\c!location] -% [ \v!top=>\let\next\tbox, -% \v!middle=>\let\next\halfwaybox]% -% \next{\copy0}% -% \ifdim\ht2>\zeropoint % beter dan \wd2, nu \strut mogelijk -% \combinationparameter\c!inbetween -% %\vtop % wrong code -% % {\nointerlineskip % recently added -% % \hsize\wd0 -% % \setupalign[\combinationparameter\c!align]% % \raggedcenter -% % \begstrut\unhbox2\endstrut}% -% \box2 -% \fi}% -% \ifnum\totcombination>\plusone -% \global\advance\totcombination\minusone -% \global\advance\horcombination\minusone -% \ifnum\horcombination=\zerocount -% \def\next -% {\cr\noalign -% {\forgetall % \setupwhitespace[\v!geen]% no -% \nointerlineskip -% \combinationparameter\c!before -% \combinationparameter\c!after -% \vss -% \nointerlineskip}% -% \global\horcombination\maxhorcombination\relax -% \docombination}% -% \else -% \def\next -% {&&&\hskip\combinationparameter\c!distance&\docombination}% -% \fi -% \else -% \def\next -% {\cr\egroup}% -% \fi -% \next} - -% \def\dodocombination -% {\vbox -% {\forgetall % \setupwhitespace[\v!none]% -% \let\next\vbox -% \ExpandFirstAfter\processallactionsinset -% [\combinationparameter\c!plaats] -% [ \v!top=>\let\next\tbox, -% \v!middle=>\let\next\halfwaybox]% -% \next{\copy0}% -% % we need to save the caption for a next alignment line -% \saveoncombinationstack2}% -% \ifnum\totcombination>\plusone -% \global\advance\totcombination\minusone -% \global\advance\horcombination\minusone -% \ifnum\horcombination=\zerocount -% \def\next -% {\cr -% \flushcombinationstack -% \noalign -% {\forgetall % \setupwhitespace[\v!none]% no -% \global\setbox\combinationstack\emptybox -% \nointerlineskip -% \combinationparameter\c!after -% \combinationparameter\c!before -% \vss -% \nointerlineskip}% -% \global\horcombination\maxhorcombination\relax -% \docombination}% -% \else -% \def\next -% {&&&\hskip\combinationparameter\c!distance&\docombination}% -% \fi -% \else -% \def\next -% {\cr -% \flushcombinationstack -% \egroup}% -% \fi -% \next} - \def\depthonlybox {\dowithnextbox{\vtop{\hsize\wd\nextbox\kern\zeropoint\box\nextbox}}\vbox} -% \def\boxwithstrutheight -% {\dowithnextbox -% {\scratchdimen\strutheight -% \advance\scratchdimen-\nextboxht -% \hbox{\raise\scratchdimen\box\nextbox}}% -% \vbox} - \def\dodocombination {\vbox {\forgetall % \setupwhitespace[\v!none]% @@ -2088,56 +2060,6 @@ \def\placeontopofeachother{\placerelativetoeachother\halign\hss} \def\placesidebyside {\placerelativetoeachother\valign\vss} -% this will be replaced or go away, never used - -\def\douseexternalfiles[#1][#2]% - {\getparameters - [\??fi#1] - [\c!file=, - \c!bodyfont=, - \c!option=, - #2]} - -\def\useexternalfiles - {\dodoubleargument\douseexternalfiles} - -\def\dostelexternefilesin[#1][#2]% - {\doifundefinedelse{\??fi#1\c!file} - {\useexternalfiles[#1][#2]} - {\getparameters[\??fi#1][#2]}} - -\def\stelexternefilesin - {\dodoubleargument\dostelexternefilesin} - -\def\verwerkexternefile#1#2#3% - {\bgroup - \getparameters[\??fi#1][\c!file=,#3]% - \doinputonce{\getvalue{\??fi#1\c!file}}% - \ExpandFirstAfter\switchtobodyfont[\getvalue{\??fi#1\c!bodyfont}]% - \readsysfile{#2} % beter: loc of fix gebied - \donothing - {\showmessage\m!systems{41}{#2,#1}}% - \egroup} - -\def\douseexternalfile[#1][#2][#3][#4]% - {\stelexternefilesin[#1][]% - \doinputonce{\getvalue{\??fi#1\c!file}}% - \doifelsenothing{#2} - {\setvalue{#3}{\verwerkexternefile{#1}{#3}{#4}}} - {\setvalue{#2}{\verwerkexternefile{#1}{#3}{#4}}}} - -\def\useexternalfile - {\doquadrupleargument\douseexternalfile} - -\useexternalfiles - [pictex] - [\c!bodyfont=\v!small, - \c!file=pictex] - -\useexternalfiles - [table] - [\c!file=table] - %D A couple of examples, demonstrating how the depth is %D taken care of: %D diff --git a/tex/context/base/core-par.mkii b/tex/context/base/core-par.mkii new file mode 100644 index 000000000..0b283b294 --- /dev/null +++ b/tex/context/base/core-par.mkii @@ -0,0 +1,300 @@ +%D \module +%D [ file=core-par, +%D version=1997.03.31, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Paragraph Tricks, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / Pararaph Tricks} + +\unprotect + +% \ifprocesspreviousparagraphs +% +% \nofskippedparagraphs +% \paragraphnumber +% \nofparagraphs +% +% \dosetparagraph +% \doresetparagraph +% \dobeforeparagraph +% \doafterparagraph +% \dobeforeskipparagraph +% \doafterskipparagraph +% +% \pushparagraphs\endcommand alle alineas tot \endcommand laden +% \pushmoreparagraphs\endcommand alle alineas tot \endcommand toevoegen +% \popparagraphs alle alineas oproepen +% \popparagraphs[a,b,c] enkele alineas oproepen [geen] +% +% tzt een optionele prefix: +% +% \pushparagraphs[xxx]\endcommand alle alineas tot \endcommand laden +% \popparagraphs[xxx] alle alineas oproepen +% \popparagraphs[xxx][a,b,c] enkele alineas oproepen +% +% \numberparagraphs +% \numberparagraphlines +% \resetparagraphlines + +\newif\ifprocesspreviousparagraphs % public +\newif\ifprocessallparagraphs % private + +\newcounter\totalnofparagraphs % private +\newcounter\globalparagraphnumber % private +\newcounter\discardedparagraphs % private +\newcounter\mostrecentparagraphtotal % public + +\let\dosetparagraph = \relax % public +\let\doresetparagraph = \relax % public +\let\dobeforeparagraph = \relax % public +\let\doafterparagraph = \relax % public +\let\dobeforeskipparagraph = \relax % public +\let\doafterskipparagraph = \relax % public + +\def\paragraphnumber {} % public +\def\nofparagraphs {} % public +\def\nofskippedparagraphs {} % public + +\def\paragraphprefix {paragraph} % private + +% voorlopig, wordt nog class + +\def\resetparagraphlines + {\global\linenumber\plusone} + +\def\numberparagraphs % instelbaar maken en slimmer ivm breedte regelnummer !!!!! + {\processpreviousparagraphstrue + \def\dosetparagraph + {\bgroup + \resetparagraphlines + \EveryPar + {\strut\inleftmargin{\tf{\tx\paragraphnumber}\kern2em}% + \ignorespaces}}% + \def\doresetparagraph + {\resetparagraphlines + \egroup}} + +\def\numberparagraphlines + {\processpreviousparagraphstrue + \def\dosetparagraph + {\resetparagraphlines}% + \def\doresetparagraph + {\resetparagraphlines}% + \def\dobeforeparagraph + {\startlinenumbering[\v!continue]}% + \def\doafterparagraph + {\stoplinenumbering}% + \def\dobeforeskipparagraph + {\stoplinenumbering + \let\paragraphnumber\relax}% + \def\doafterskipparagraph + {\startlinenumbering[\v!continue]}} + +\long\def\directpushparagraph#1% + {\doglobal\increment\totalnofparagraphs + \ifnum\totalnofparagraphs>0\nofskippedparagraphs\relax + \setgvalue{\paragraphprefix\totalnofparagraphs}{#1}% + \else + \setgvalue{\paragraphprefix\totalnofparagraphs}{\skipparagraph#1\par}% + \fi} + +\long\def\directskipparagraph#1% + {\doglobal\increment\totalnofparagraphs + \setgvalue{\paragraphprefix\totalnofparagraphs}{\skipparagraph#1\par}} + +\def\dopushparagraphs#1% + {\global\let\mostrecentparagraphtotal\totalnofparagraphs + \ifx#1\undefined + \let#1\relax + \fi + \defconvertedargument\asciia{#1}% + \defconvertedargument\asciib{ }% % lege regel + \def\dopushparagraph##1\par + {\defconvertedargument\asciic{##1}% + \doifelse\asciic\asciia + {#1} + {\doifsomething\asciic % lege paragraaf + {\doifnot\asciic\asciib + {\directpushparagraph{#1}}}% + \dopushparagraph}}% + \dopushparagraph} + +\def\pushparagraphs + {\doglobal\newcounter\totalnofparagraphs + \dopushparagraphs} + +\def\pushmoreparagraphs + {\dopushparagraphs} + +\def\dododopopparagraph#1% no grouping, i.v.m. sidefloats + {\ifnum#1>\totalnofparagraphs\relax + \else + \let\paragraphnumber\globalparagraphnumber + \decrement(\paragraphnumber,\discardedparagraphs)% + \dobeforeparagraph + \ifhmode\indentation\fi\getvalue{\paragraphprefix#1}\par + \doafterparagraph + \fi} + +\long\def\skipparagraph#1\par + {\doglobal\increment\discardedparagraphs + \ifprocessallparagraphs + \dobeforeskipparagraph + \ifhmode\indentation\fi#1\par + \doafterskipparagraph + \fi} + +\def\dodopopparagraph + {\dododopopparagraph} + +\def\dodoprocessparagraph#1% + {\ifprocesspreviousparagraphs + \bgroup + \setbox0\vbox{\dododopopparagraph{#1}}% + \egroup + \fi} + +\def\processpreviousparagraphs[#1]% process previous ones + {\ifprocesspreviousparagraphs + \bgroup + \getfromcommacommand[#1][1]% tzt snelle \..command.. testen + \let\totalnofparagraphs\commalistelement + \decrement\totalnofparagraphs + \let\dodopopparagraph\dodoprocessparagraph + \popparagraphs + \egroup + \fi} + +\def\dopopparagraphs[#1]% + {\doifnotinset{#1}{\v!none,0} + {\dosetparagraph + \doglobal\newcounter\globalparagraphnumber + \doglobal\newcounter\discardedparagraphs + \doifelse{#1}{} + {\processallparagraphstrue} + {\processallparagraphsfalse}% + \def\dopopparagraph + {\doglobal\increment\globalparagraphnumber + \ifnum\globalparagraphnumber>\totalnofparagraphs\relax + \let\dopopparagraph\relax + \else\ifprocessallparagraphs + \ifnum\globalparagraphnumber>\mostrecentparagraphtotal\relax + \dodopopparagraph\globalparagraphnumber + \else + \dodoprocessparagraph\globalparagraphnumber + \fi + \else + \let\paragraphnumber\globalparagraphnumber + \decrement(\paragraphnumber,\discardedparagraphs)% + \ExpandBothAfter\doifinsetelse{\paragraphnumber}{#1} + {\dodopopparagraph\globalparagraphnumber} + {\dodoprocessparagraph\globalparagraphnumber}% + \fi\fi + \dopopparagraph}% + \dopopparagraph + \doresetparagraph}} + +\def\popparagraphs + {\dosingleempty\dopopparagraphs} + +\def\countparagraphs + {\popparagraphs[\!!maxcard]% + \global\let\nofparagraphs\totalnofparagraphs + \doglobal\decrement(\nofparagraphs,\discardedparagraphs)} + +% \showframe +% +% \numberparagraphlines +% \numberparagraphs +% +% \def\nofskippedparagraphs{1} +% +% \pushparagraphs\ThatsIt +% +% \ruledbaseline eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste +% +% \ruledbaseline eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste eerste eerste eerste +% eerste eerste eerste eerste eerste +% +% \ruledbaseline tweede tweede tweede tweede tweede tweede +% tweede tweede tweede tweede tweede tweede tweede tweede +% tweede tweede tweede tweede tweede tweede tweede tweede +% tweede tweede tweede tweede tweede tweede tweede tweede +% tweede tweede tweede tweede tweede tweede tweede tweede +% tweede tweede tweede tweede tweede tweede tweede tweede +% tweede tweede tweede tweede tweede +% +% \skipparagraph \ruledbaseline skipped skipped skipped +% skipped skipped skipped skipped skipped skipped skipped +% skipped skipped skipped skipped skipped skipped skipped +% skipped skipped +% +% \ruledbaseline derde derde derde derde derde derde derde +% derde derde derde derde derde derde derde derde derde derde +% derde derde derde derde derde derde derde derde derde derde +% derde derde derde derde derde derde derde derde derde derde +% derde derde derde derde derde derde derde derde derde derde +% derde derde derde derde derde derde derde derde derde derde +% +% \skipparagraph \ruledbaseline skipped skipped skipped +% skipped skipped skipped skipped skipped skipped skipped +% skipped skipped skipped skipped skipped skipped skipped +% skipped skipped skipped +% +% \ruledbaseline vierde vierde vierde vierde vierde vierde +% vierde vierde vierde vierde vierde vierde vierde vierde +% vierde vierde vierde vierde vierde vierde vierde vierde +% vierde vierde vierde vierde +% +% \ruledbaseline vijfde vijfde vijfde vijfde vijfde vijfde +% vijfde vijfde vijfde vijfde vijfde vijfde vijfde vijfde +% vijfde vijfde vijfde vijfde vijfde vijfde vijfde vijfde +% vijfde vijfde vijfde vijfde vijfde vijfde vijfde vijfde +% vijfde vijfde vijfde +% +% \skipparagraph \ruledbaseline skipped skipped skipped +% skipped skipped skipped skipped skipped skipped skipped +% skipped skipped skipped skipped skipped skipped skipped +% skipped skipped skipped +% +% \ThatsIt +% +% \popparagraphs +% +% \countparagraphs +% +% \blanko[2*groot] +% +% nofparagraphs:~\nofparagraphs +% +% \pagina +% +% \popparagraphs[1] +% \popparagraphs[2] +% \popparagraphs[3] +% \popparagraphs[4] +% \popparagraphs[5] +% +% \pagina +% +% \ruledvbox{\popparagraphs[1,2,3,4,5]} +% +% \pagina + +\protect \endinput diff --git a/tex/context/base/core-par.tex b/tex/context/base/core-par.tex deleted file mode 100644 index 0b283b294..000000000 --- a/tex/context/base/core-par.tex +++ /dev/null @@ -1,300 +0,0 @@ -%D \module -%D [ file=core-par, -%D version=1997.03.31, -%D title=\CONTEXT\ Core Macros, -%D subtitle=Paragraph Tricks, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Core Macros / Pararaph Tricks} - -\unprotect - -% \ifprocesspreviousparagraphs -% -% \nofskippedparagraphs -% \paragraphnumber -% \nofparagraphs -% -% \dosetparagraph -% \doresetparagraph -% \dobeforeparagraph -% \doafterparagraph -% \dobeforeskipparagraph -% \doafterskipparagraph -% -% \pushparagraphs\endcommand alle alineas tot \endcommand laden -% \pushmoreparagraphs\endcommand alle alineas tot \endcommand toevoegen -% \popparagraphs alle alineas oproepen -% \popparagraphs[a,b,c] enkele alineas oproepen [geen] -% -% tzt een optionele prefix: -% -% \pushparagraphs[xxx]\endcommand alle alineas tot \endcommand laden -% \popparagraphs[xxx] alle alineas oproepen -% \popparagraphs[xxx][a,b,c] enkele alineas oproepen -% -% \numberparagraphs -% \numberparagraphlines -% \resetparagraphlines - -\newif\ifprocesspreviousparagraphs % public -\newif\ifprocessallparagraphs % private - -\newcounter\totalnofparagraphs % private -\newcounter\globalparagraphnumber % private -\newcounter\discardedparagraphs % private -\newcounter\mostrecentparagraphtotal % public - -\let\dosetparagraph = \relax % public -\let\doresetparagraph = \relax % public -\let\dobeforeparagraph = \relax % public -\let\doafterparagraph = \relax % public -\let\dobeforeskipparagraph = \relax % public -\let\doafterskipparagraph = \relax % public - -\def\paragraphnumber {} % public -\def\nofparagraphs {} % public -\def\nofskippedparagraphs {} % public - -\def\paragraphprefix {paragraph} % private - -% voorlopig, wordt nog class - -\def\resetparagraphlines - {\global\linenumber\plusone} - -\def\numberparagraphs % instelbaar maken en slimmer ivm breedte regelnummer !!!!! - {\processpreviousparagraphstrue - \def\dosetparagraph - {\bgroup - \resetparagraphlines - \EveryPar - {\strut\inleftmargin{\tf{\tx\paragraphnumber}\kern2em}% - \ignorespaces}}% - \def\doresetparagraph - {\resetparagraphlines - \egroup}} - -\def\numberparagraphlines - {\processpreviousparagraphstrue - \def\dosetparagraph - {\resetparagraphlines}% - \def\doresetparagraph - {\resetparagraphlines}% - \def\dobeforeparagraph - {\startlinenumbering[\v!continue]}% - \def\doafterparagraph - {\stoplinenumbering}% - \def\dobeforeskipparagraph - {\stoplinenumbering - \let\paragraphnumber\relax}% - \def\doafterskipparagraph - {\startlinenumbering[\v!continue]}} - -\long\def\directpushparagraph#1% - {\doglobal\increment\totalnofparagraphs - \ifnum\totalnofparagraphs>0\nofskippedparagraphs\relax - \setgvalue{\paragraphprefix\totalnofparagraphs}{#1}% - \else - \setgvalue{\paragraphprefix\totalnofparagraphs}{\skipparagraph#1\par}% - \fi} - -\long\def\directskipparagraph#1% - {\doglobal\increment\totalnofparagraphs - \setgvalue{\paragraphprefix\totalnofparagraphs}{\skipparagraph#1\par}} - -\def\dopushparagraphs#1% - {\global\let\mostrecentparagraphtotal\totalnofparagraphs - \ifx#1\undefined - \let#1\relax - \fi - \defconvertedargument\asciia{#1}% - \defconvertedargument\asciib{ }% % lege regel - \def\dopushparagraph##1\par - {\defconvertedargument\asciic{##1}% - \doifelse\asciic\asciia - {#1} - {\doifsomething\asciic % lege paragraaf - {\doifnot\asciic\asciib - {\directpushparagraph{#1}}}% - \dopushparagraph}}% - \dopushparagraph} - -\def\pushparagraphs - {\doglobal\newcounter\totalnofparagraphs - \dopushparagraphs} - -\def\pushmoreparagraphs - {\dopushparagraphs} - -\def\dododopopparagraph#1% no grouping, i.v.m. sidefloats - {\ifnum#1>\totalnofparagraphs\relax - \else - \let\paragraphnumber\globalparagraphnumber - \decrement(\paragraphnumber,\discardedparagraphs)% - \dobeforeparagraph - \ifhmode\indentation\fi\getvalue{\paragraphprefix#1}\par - \doafterparagraph - \fi} - -\long\def\skipparagraph#1\par - {\doglobal\increment\discardedparagraphs - \ifprocessallparagraphs - \dobeforeskipparagraph - \ifhmode\indentation\fi#1\par - \doafterskipparagraph - \fi} - -\def\dodopopparagraph - {\dododopopparagraph} - -\def\dodoprocessparagraph#1% - {\ifprocesspreviousparagraphs - \bgroup - \setbox0\vbox{\dododopopparagraph{#1}}% - \egroup - \fi} - -\def\processpreviousparagraphs[#1]% process previous ones - {\ifprocesspreviousparagraphs - \bgroup - \getfromcommacommand[#1][1]% tzt snelle \..command.. testen - \let\totalnofparagraphs\commalistelement - \decrement\totalnofparagraphs - \let\dodopopparagraph\dodoprocessparagraph - \popparagraphs - \egroup - \fi} - -\def\dopopparagraphs[#1]% - {\doifnotinset{#1}{\v!none,0} - {\dosetparagraph - \doglobal\newcounter\globalparagraphnumber - \doglobal\newcounter\discardedparagraphs - \doifelse{#1}{} - {\processallparagraphstrue} - {\processallparagraphsfalse}% - \def\dopopparagraph - {\doglobal\increment\globalparagraphnumber - \ifnum\globalparagraphnumber>\totalnofparagraphs\relax - \let\dopopparagraph\relax - \else\ifprocessallparagraphs - \ifnum\globalparagraphnumber>\mostrecentparagraphtotal\relax - \dodopopparagraph\globalparagraphnumber - \else - \dodoprocessparagraph\globalparagraphnumber - \fi - \else - \let\paragraphnumber\globalparagraphnumber - \decrement(\paragraphnumber,\discardedparagraphs)% - \ExpandBothAfter\doifinsetelse{\paragraphnumber}{#1} - {\dodopopparagraph\globalparagraphnumber} - {\dodoprocessparagraph\globalparagraphnumber}% - \fi\fi - \dopopparagraph}% - \dopopparagraph - \doresetparagraph}} - -\def\popparagraphs - {\dosingleempty\dopopparagraphs} - -\def\countparagraphs - {\popparagraphs[\!!maxcard]% - \global\let\nofparagraphs\totalnofparagraphs - \doglobal\decrement(\nofparagraphs,\discardedparagraphs)} - -% \showframe -% -% \numberparagraphlines -% \numberparagraphs -% -% \def\nofskippedparagraphs{1} -% -% \pushparagraphs\ThatsIt -% -% \ruledbaseline eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste -% -% \ruledbaseline eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste eerste eerste eerste -% eerste eerste eerste eerste eerste -% -% \ruledbaseline tweede tweede tweede tweede tweede tweede -% tweede tweede tweede tweede tweede tweede tweede tweede -% tweede tweede tweede tweede tweede tweede tweede tweede -% tweede tweede tweede tweede tweede tweede tweede tweede -% tweede tweede tweede tweede tweede tweede tweede tweede -% tweede tweede tweede tweede tweede tweede tweede tweede -% tweede tweede tweede tweede tweede -% -% \skipparagraph \ruledbaseline skipped skipped skipped -% skipped skipped skipped skipped skipped skipped skipped -% skipped skipped skipped skipped skipped skipped skipped -% skipped skipped -% -% \ruledbaseline derde derde derde derde derde derde derde -% derde derde derde derde derde derde derde derde derde derde -% derde derde derde derde derde derde derde derde derde derde -% derde derde derde derde derde derde derde derde derde derde -% derde derde derde derde derde derde derde derde derde derde -% derde derde derde derde derde derde derde derde derde derde -% -% \skipparagraph \ruledbaseline skipped skipped skipped -% skipped skipped skipped skipped skipped skipped skipped -% skipped skipped skipped skipped skipped skipped skipped -% skipped skipped skipped -% -% \ruledbaseline vierde vierde vierde vierde vierde vierde -% vierde vierde vierde vierde vierde vierde vierde vierde -% vierde vierde vierde vierde vierde vierde vierde vierde -% vierde vierde vierde vierde -% -% \ruledbaseline vijfde vijfde vijfde vijfde vijfde vijfde -% vijfde vijfde vijfde vijfde vijfde vijfde vijfde vijfde -% vijfde vijfde vijfde vijfde vijfde vijfde vijfde vijfde -% vijfde vijfde vijfde vijfde vijfde vijfde vijfde vijfde -% vijfde vijfde vijfde -% -% \skipparagraph \ruledbaseline skipped skipped skipped -% skipped skipped skipped skipped skipped skipped skipped -% skipped skipped skipped skipped skipped skipped skipped -% skipped skipped skipped -% -% \ThatsIt -% -% \popparagraphs -% -% \countparagraphs -% -% \blanko[2*groot] -% -% nofparagraphs:~\nofparagraphs -% -% \pagina -% -% \popparagraphs[1] -% \popparagraphs[2] -% \popparagraphs[3] -% \popparagraphs[4] -% \popparagraphs[5] -% -% \pagina -% -% \ruledvbox{\popparagraphs[1,2,3,4,5]} -% -% \pagina - -\protect \endinput diff --git a/tex/context/base/core-spa.lua b/tex/context/base/core-spa.lua index 0f308b19c..0e33bf609 100644 --- a/tex/context/base/core-spa.lua +++ b/tex/context/base/core-spa.lua @@ -25,7 +25,7 @@ local trace_vspacing = false trackers.register("nodes.vspacing", local has_attribute = node.has_attribute local unset_attribute = node.unset_attribute local set_attribute = node.set_attribute -local slide_node_list = node.slide +local find_node_tail = node.tail local free_node = node.free local copy_node = node.copy local traverse_nodes = node.traverse @@ -35,6 +35,7 @@ local remove_node = nodes.remove local make_penalty_node = nodes.penalty local count_nodes = nodes.count local node_ids_to_string = nodes.ids_to_string +local hpack_node = node.hpack local glyph = node.id("glyph") local penalty = node.id("penalty") @@ -42,6 +43,7 @@ local kern = node.id("kern") local glue = node.id('glue') local hlist = node.id('hlist') local vlist = node.id('vlist') +local adjust = node.id('adjust') vspacing = vspacing or { } @@ -550,7 +552,7 @@ local function collapser(head,where,what,trace) -- maybe also pass tail current = current.next end end - local tail = slide_node_list(head) -- still needed, check previous code ? + local tail = find_node_tail(head) -- still needed, check previous code ? if trace then trace_info("stop analyzing",where,what) end --~ if natural_penalty and (not penalty_data or natural_penalty > penalty_data) then --~ penalty_data = natural_penalty @@ -596,7 +598,7 @@ function nodes.handle_page_spacing(where) local newhead = texlists.contrib_head if newhead then statistics.starttiming(vspacing) - local newtail = slide_node_list(newhead) + local newtail = find_node_tail(newhead) local flush = false for n in traverse_nodes(newhead) do local id = n.id @@ -655,7 +657,7 @@ local ignore = table.tohash { function nodes.handle_vbox_spacing(head,where) if head and not ignore[where] and head.next then statistics.starttiming(vspacing) - head = collapser(slide_node_list(head),"vbox",where,trace_vbox_vspacing) + head = collapser(head,"vbox",where,trace_vbox_vspacing) statistics.stoptiming(vspacing) end return head @@ -679,3 +681,54 @@ function vspacing.disable() callback.register('vpack_filter', nil) callback.register('buildpage_filter', nil) end + +-- we will split this module + +local attribute = attributes.private('graphicvadjust') + +--~ local hlist = node.id('hlist') +--~ local vlist = node.id('vlist') + +--~ local remove_node = nodes.remove +--~ local hpack_node = node.hpack +--~ local has_attribute = node.has_attribute + +function nodes.repackage_graphicvadjust(head,groupcode) -- we can make an actionchain for mvl only + if groupcode == "" then -- mvl only + local h, p, done = head, nil, false + while h do + local id = h.id + if id == hlist or id == vlist then + local a = has_attribute(h,attribute) + if a then + if p then + local n + head, h, n = remove_node(head,h) + local pl = p.list + if n.width ~= 0 then + n = hpack_node(n,0,'exactly') + end + if pl then + pl.prev = n + n.next = pl + end + p.list = n + done = true + else + -- can't happen + end + else + p = h + h = h.next + end + else + h = h.next + end + end + return head, done + else + return head, false + end +end + +--~ tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust") diff --git a/tex/context/base/core-spa.mkii b/tex/context/base/core-spa.mkii index 356b2cbe3..7c97bcc9c 100644 --- a/tex/context/base/core-spa.mkii +++ b/tex/context/base/core-spa.mkii @@ -298,32 +298,34 @@ \def\defineblankmethod[#1]#2{\setvalue{\??bo\??bo#1}{#2}} -\defineblankmethod [\v!big] {\addblankskip+\bigskipamount \openlineheight} -\defineblankmethod [-\v!big] {\addblankskip-\bigskipamount \openlineheight} -\defineblankmethod [\v!medium] {\addblankskip+\medskipamount {.5\openlineheight}} -\defineblankmethod [-\v!medium] {\addblankskip-\medskipamount {.5\openlineheight}} -\defineblankmethod [\v!small] {\addblankskip+\smallskipamount{.25\openlineheight}} -\defineblankmethod [-\v!small] {\addblankskip-\smallskipamount{.25\openlineheight}} -\defineblankmethod [\v!white] {\addblankskip+\parskip \openlineheight} -\defineblankmethod [-\v!white] {\addblankskip-\parskip \openlineheight} -\defineblankmethod [\v!line] {\addblankskip+\openlineheight \openlineheight} -\defineblankmethod [-\v!line] {\addblankskip-\openlineheight \openlineheight} - -\defineblankmethod [\v!formula] {\global\advance\blankskip\medskipamount} -\defineblankmethod [\v!nowhite] {\global\blanknowhitetrue} -\defineblankmethod [\v!disable] {\global\blankdisabletrue} -\defineblankmethod [\v!force] {\global\blankforcetrue} -\defineblankmethod [\v!outer] {\ifvmode\ifinner\blankoutertrue\fi\fi} -\defineblankmethod [\v!reset] {\global\blankresettrue} -\defineblankmethod [\v!flexible] {\global\localblankflexibletrue} -\defineblankmethod [\v!fixed] {\global\localblankfixedtrue} -\defineblankmethod [\v!back] {\global\blankgobacktrue} % {\geenblanko} -\defineblankmethod [\v!halfline] {\ifgridsnapping\global\fuzzyvskiptrue\fi - \global\advance\blankskip .5\lineheight} - -\defineblankmethod [\v!none] {\global\blankresettrue} -\defineblankmethod [\v!joinedup] {\ifvmode\nointerlineskip\fi} - +\defineblankmethod [\v!big] {\addblankskip+\bigskipamount \openlineheight} +\defineblankmethod [-\v!big] {\addblankskip-\bigskipamount \openlineheight} +\defineblankmethod [\v!medium] {\addblankskip+\medskipamount {.5\openlineheight}} +\defineblankmethod [-\v!medium] {\addblankskip-\medskipamount {.5\openlineheight}} +\defineblankmethod [\v!small] {\addblankskip+\smallskipamount{.25\openlineheight}} +\defineblankmethod [-\v!small] {\addblankskip-\smallskipamount{.25\openlineheight}} +\defineblankmethod [\v!white] {\addblankskip+\parskip \openlineheight} +\defineblankmethod [-\v!white] {\addblankskip-\parskip \openlineheight} +\defineblankmethod [\v!line] {\addblankskip+\openlineheight \openlineheight} +\defineblankmethod [-\v!line] {\addblankskip-\openlineheight \openlineheight} + +\defineblankmethod [\v!formula] {\global\advance\blankskip\medskipamount} +\defineblankmethod [\v!nowhite] {\global\blanknowhitetrue} +\defineblankmethod [\v!disable] {\global\blankdisabletrue} +\defineblankmethod [\v!force] {\global\blankforcetrue} +\defineblankmethod [\v!outer] {\ifvmode\ifinner\blankoutertrue\fi\fi} +\defineblankmethod [\v!reset] {\global\blankresettrue} +\defineblankmethod [\v!flexible] {\global\localblankflexibletrue} +\defineblankmethod [\v!fixed] {\global\localblankfixedtrue} +\defineblankmethod [\v!back] {\global\blankgobacktrue} % {\geenblanko} +\defineblankmethod [\v!halfline] {\ifgridsnapping\global\fuzzyvskiptrue\fi + \global\advance\blankskip .5\lineheight} +\defineblankmethod [\v!none] {\global\blankresettrue} +\defineblankmethod [\v!joinedup] {\ifvmode\nointerlineskip\fi} +\defineblankmethod[\v!synchronize] {\verticalstrut\vskip-2\lineheight\verticalstrut} + +% \vtop{\blank[synchronize]\blank[line]test} + \defineblankmethod [\v!always] {\redowhitespace} % experimental % happens often, so we speed this up: @@ -4571,10 +4573,9 @@ \gdef\afterfirstobeyedline % tzt two pass, net als opsomming {\gdef\afterfirstobeyedline {\nobreak - \global\let\afterfirstobeyedline\relax}}% + \doifnot\@@rgoption\v!packed{\global\let\afterfirstobeyedline\relax}}}% \def\obeyedline {\par - \afterfirstobeyedline \futurelet\next\dobetweenthelines}% \activatespacehandler\@@rgspace \GotoPar} @@ -4585,10 +4586,13 @@ \@@rgafter} \def\dobetweenthelines - {\doifmeaningelse\next\obeyedline\@@rginbetween\donothing} + {\doifmeaningelse\next\obeyedline + {\@@rginbetween} + {\afterfirstobeyedline}} \setuplines - [\c!before=\blank, + [\c!option=, + \c!before=\blank, \c!after=\blank, \c!inbetween=\blank, \c!indenting=\v!no, diff --git a/tex/context/base/core-spa.mkiv b/tex/context/base/core-spa.mkiv index fbc949349..ad59f7779 100644 --- a/tex/context/base/core-spa.mkiv +++ b/tex/context/base/core-spa.mkiv @@ -30,13 +30,12 @@ \let \baselinecorrection \relax \let \offbaselinecorrection \relax -\appendtoks \spacing 1\to \everybodyfont +\appendtoks \spacing\plusone \to \everybodyfont \appendtoks \presetnormallineheight \to \everybodyfont \appendtoks \setnormalbaselines \to \everybodyfont % check if redundant \appendtoks \setstrut \to \everybodyfont % check if redundant \appendtoks \settopskip \to \everybodyfont \appendtoks \setmaxdepth \to \everybodyfont -%appendtoks \spacing 1\to \everybodyfont \appendtoks \simplesetupindenting \to \everybodyfont \appendtoks \simplesetupblank \to \everybodyfont \appendtoks \simplesetupwhitespace \to \everybodyfont @@ -87,7 +86,7 @@ \global\let\carriedoverpar\relax \def\carryoverpar#1% - {\expanded % \scratchtoks{#1}% + {\normalexpanded % \scratchtoks{#1}% {\noexpand#1% \the\scratchtoks \hangindent\the\hangindent \hangafter \the\hangafter @@ -284,32 +283,34 @@ \def\defineblankmethod[#1]#2{\setvalue{\??bo\??bo#1}{#2}} -\defineblankmethod [\v!big] {\addblankskip+\bigskipamount \openlineheight} -\defineblankmethod [-\v!big] {\addblankskip-\bigskipamount \openlineheight} -\defineblankmethod [\v!medium] {\addblankskip+\medskipamount {.5\openlineheight}} -\defineblankmethod [-\v!medium] {\addblankskip-\medskipamount {.5\openlineheight}} -\defineblankmethod [\v!small] {\addblankskip+\smallskipamount{.25\openlineheight}} -\defineblankmethod [-\v!small] {\addblankskip-\smallskipamount{.25\openlineheight}} -\defineblankmethod [\v!white] {\addblankskip+\parskip \openlineheight} -\defineblankmethod [-\v!white] {\addblankskip-\parskip \openlineheight} -\defineblankmethod [\v!line] {\addblankskip+\openlineheight \openlineheight} -\defineblankmethod [-\v!line] {\addblankskip-\openlineheight \openlineheight} - -\defineblankmethod [\v!formula] {\global\advance\blankskip\medskipamount} -\defineblankmethod [\v!nowhite] {\global\blanknowhitetrue} -\defineblankmethod [\v!disable] {\global\blankdisabletrue} -\defineblankmethod [\v!force] {\global\blankforcetrue} -\defineblankmethod [\v!outer] {\ifvmode\ifinner\blankoutertrue\fi\fi} -\defineblankmethod [\v!reset] {\global\blankresettrue} -\defineblankmethod [\v!flexible] {\global\localblankflexibletrue} -\defineblankmethod [\v!fixed] {\global\localblankfixedtrue} -\defineblankmethod [\v!back] {\global\blankgobacktrue} % {\geenblanko} -\defineblankmethod [\v!halfline] {\ifgridsnapping\global\fuzzyvskiptrue\fi - \global\advance\blankskip .5\lineheight} - -\defineblankmethod [\v!none] {\global\blankresettrue} -\defineblankmethod [\v!joinedup] {\ifvmode\nointerlineskip\fi} - +\defineblankmethod [\v!big] {\addblankskip+\bigskipamount \openlineheight} +\defineblankmethod [-\v!big] {\addblankskip-\bigskipamount \openlineheight} +\defineblankmethod [\v!medium] {\addblankskip+\medskipamount {.5\openlineheight}} +\defineblankmethod [-\v!medium] {\addblankskip-\medskipamount {.5\openlineheight}} +\defineblankmethod [\v!small] {\addblankskip+\smallskipamount{.25\openlineheight}} +\defineblankmethod [-\v!small] {\addblankskip-\smallskipamount{.25\openlineheight}} +\defineblankmethod [\v!white] {\addblankskip+\parskip \openlineheight} +\defineblankmethod [-\v!white] {\addblankskip-\parskip \openlineheight} +\defineblankmethod [\v!line] {\addblankskip+\openlineheight \openlineheight} +\defineblankmethod [-\v!line] {\addblankskip-\openlineheight \openlineheight} + +\defineblankmethod [\v!formula] {\global\advance\blankskip\medskipamount} +\defineblankmethod [\v!nowhite] {\global\blanknowhitetrue} +\defineblankmethod [\v!disable] {\global\blankdisabletrue} +\defineblankmethod [\v!force] {\global\blankforcetrue} +\defineblankmethod [\v!outer] {\ifvmode\ifinner\blankoutertrue\fi\fi} +\defineblankmethod [\v!reset] {\global\blankresettrue} +\defineblankmethod [\v!flexible] {\global\localblankflexibletrue} +\defineblankmethod [\v!fixed] {\global\localblankfixedtrue} +\defineblankmethod [\v!back] {\global\blankgobacktrue} % {\geenblanko} +\defineblankmethod [\v!halfline] {\ifgridsnapping\global\fuzzyvskiptrue\fi + \global\advance\blankskip .5\lineheight} +\defineblankmethod [\v!none] {\global\blankresettrue} +\defineblankmethod [\v!joinedup] {\ifvmode\nointerlineskip\fi} +\defineblankmethod[\v!synchronize] {\verticalstrut\vskip-2\lineheight\verticalstrut} + +% \vtop{\blank[synchronize]\blank[line]test} + \defineblankmethod [\v!always] {\redowhitespace} % experimental % happens often, so we speed this up: @@ -443,7 +444,7 @@ \else\ifcsname\??bo\ascii\endcsname % user def / slow \@EA\rawprocesscommalist\@EA[\csname\??bo\ascii\endcsname]\doblank\relax \else - \expanded{\rawprocesscommalist[#1]}\doblank + \rawprocesscommacommand[#1]\doblank \fi\fi % \relax % to be sure @@ -642,13 +643,11 @@ {\ifgridsnapping \blankflexiblefalse \else - \ExpandFirstAfter\processallactionsinset - [#1] + \normalexpanded{\noexpand\processallactionsinset[#1]} [ \v!flexible=>\blankflexibletrue, \v!fixed=>\blankflexiblefalse]% \fi - \ExpandFirstAfter\processallactionsinset - [#1] + \normalexpanded{\noexpand\processallactionsinset[#1]} [ \v!flexible=>\dosetupblank\appliedblankskip, \v!fixed=>\dosetupblank\appliedblankskip, \v!line=>\edef\appliedblankskip{\linedistance}% @@ -698,17 +697,22 @@ \def\defineblank {\dodoubleargument\dodefineblank} -\def\savecurrentblank - {\edef\restorecurrentblank - {\bigskipamount\the\bigskipamount - \medskipamount\the\medskipamount - \smallskipamount\the\smallskipamount - \noexpand\def\noexpand\currentblank{\currentblank}% - \ifblankflexible - \noexpand\blankflexibletrue - \else - \noexpand\blankflexiblefalse - \fi}} +% \def\savecurrentblank +% {\edef\restorecurrentblank +% {\bigskipamount\the\bigskipamount +% \medskipamount\the\medskipamount +% \smallskipamount\the\smallskipamount +% \noexpand\def\noexpand\currentblank{\currentblank}% +% \ifblankflexible +% \noexpand\blankflexibletrue +% \else +% \noexpand\blankflexiblefalse +% \fi}} + +\def\savecurrentblank {\edef\savedcurrentblank{\currentblank}} +\def\restorecurrentblank{\edef\currentblank{\savedcurrentblank}} + +\def\savedcurrentblank{\currentblank} %D Now. @@ -764,11 +768,12 @@ \toggleindentation}} \def\docomplexsetupindentingA#1% - {\edefconvertedargument\!!stringa{#1}% - \doifundefined{\??in:\!!stringa}% - {\edef\currentindentation{#1}% - \let\normalindentation\currentindentation - \simplesetupindenting}} + {\edefconvertedargument\!!stringa{#1}% can this be doen differently now? + \ifcsname\??in:\!!stringa\endcsname \else + \edef\currentindentation{#1}% + \let\normalindentation\currentindentation + \simplesetupindenting + \fi} \def\docomplexsetupindentingB#1% {\edefconvertedargument\!!stringa{#1}% catch #1=\somedimen @@ -1070,25 +1075,23 @@ \def\fixedspaces {\letcatcodecommand \ctxcatcodes `\~ \fixedspace} -\def\removeunwantedspaces - {\ifhmode % we also need to unskip 0pt skips - \unskip\unskip\unskip\unskip\unskip - \unskip\unskip\unskip\unskip\unskip - \fi} - \appendtoks\let~\space\to\simplifiedcommands -% still not fixed in aleph / luatex -% % \def\removeunwantedspaces -% {\ifhmode \ifnum\lastnodetype=\@@gluenode -% \unskip \@EAEAEA\removeunwantedspaces -% \fi \fi} +% {\ifhmode % we also need to unskip 0pt skips +% \unskip\unskip\unskip\unskip\unskip +% \unskip\unskip\unskip\unskip\unskip +% \fi} -%D For old time sake, will disappear soon. +\def\removeunwantedspaces + {\ifhmode + \expandafter \doremoveunwantedspace + \fi} -\let\hardespatie\fixedspace -\let\geenspatie \nospace +\def\doremoveunwantedspace + {\ifnum\lastnodetype=\@@gluenode + \unskip \expandafter\doremoveunwantedspace + \fi} % \startbuffer % \startlines \tt \fixedspaces @@ -1367,16 +1370,21 @@ \vskip\parskip \fi} -\def\savecurrentwhitespace - {\edef\restorecurrentwhitespace - {\ctxparskip\the\ctxparskip - \parskip\the\parskip - \noexpand\def\noexpand\currentwhitespace{\currentwhitespace}% - \ifconditional\flexiblewhitespace - \noexpand\settrue\flexiblewhitespace - \else - \noexpand\setfalse\flexiblewhitespace - \fi}} +% \def\savecurrentwhitespace +% {\edef\restorecurrentwhitespace +% {\ctxparskip\the\ctxparskip +% \parskip\the\parskip +% \noexpand\def\noexpand\currentwhitespace{\currentwhitespace}% +% \ifconditional\flexiblewhitespace +% \noexpand\settrue\flexiblewhitespace +% \else +% \noexpand\setfalse\flexiblewhitespace +% \fi}} + +\def\savecurrentwhitespace {\edef\savedcurrentwhitespace{\currentwhitespace}} +\def\restorecurrentwhitespace{\edef\currentwhitespace{\savedcurrentwhitespace}} + +\def\savedcurrentwhitespace{\currentwhitespace} % deze variant is nodig binnen \startopelkaar % steeds testen: @@ -1403,6 +1411,37 @@ \def\noblanko {\dosingleempty\nonoblanko} +% I'm not sure if the restore is still needed. Anyway, when we do +% restore, we get a parskip someplace in the output that will push +% the content off page (\vbox to pageheight{skip smashed-box}) so +% we have now disabled this hack. If it is introduced again it needs +% to be more controlled. Test case: +% +% \setupwhitespace[big] +% \starttext +% \startcolumns[n=2]\dorecurse{200}{test\crlf}\stopcolumns +% \stoptext +% +% \def\saveouterspacing +% {\savecurrentblank +% \savecurrentwhitespace +% \def\restoreouterspacing +% {\restorecurrentblank +% \restorecurrentwhitespace}} +% +% \let\restoreouterspacing\relax +% \let\saveouterspacing \relax % mult-ini: i will look into it when needed +% +% let's test this (restore before we restore the global bodyfont): + +\def\saveouterspacing + {\savecurrentblank + \savecurrentwhitespace} + +\def\restoreouterspacing + {\restorecurrentblank + \restorecurrentwhitespace} + % De onderstaande macro handelt ook de situatie dat er geen % tekst tussen \start ... \stop is geplaatst. Daartoe wordt de % laatste skip over de lege tekst heen gehaald. Dit komt goed @@ -1562,7 +1601,7 @@ \def\strutdepth {0pt} \def\strutwidth {0pt} -\def\spacingfactor {1} +\let\spacingfactor \plusone \def\topskipfactor {1.0} \def\maxdepthfactor {0.5} @@ -1653,13 +1692,11 @@ \def\spacing#1% {\ifgridsnapping - \ifdim#1\points=\onepoint\else\showmessage\m!layouts{11}{#1}\fi - \edef\spacingfactor{1}% + %\ifdim#1\points=\onepoint\else\showmessage\m!layouts{11}{\withoutpt\the\dimexpr#1\points\relax}\fi + \let\spacingfactor\plusone \else \edef\spacingfactor{#1}% \fi - %\setspacingfactor\systemtopskipfactor \topskipfactor {#1}% why no \spacingfactor ? - %\setspacingfactor\systemmaxdepthfactor\maxdepthfactor{#1}% why no \spacingfactor ? \edef\systemtopskipfactor {\withoutpt\the\dimexpr#1\dimexpr\topskipfactor \points}% \edef\systemmaxdepthfactor{\withoutpt\the\dimexpr#1\dimexpr\maxdepthfactor\points}% \setnormalbaselines @@ -1697,9 +1734,8 @@ \newbox\strutbox - \setbox\strutbox=\normalhbox{\vrule height8.5pt depth3.5pt width\zeropoint} + \setbox\strutbox\normalhbox{\vrule height8.5pt depth3.5pt width\zeropoint} - %\def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi} \def\strut{\relax\ifmmode\copy\else\unhcopy\fi\strutbox} \fi @@ -1709,39 +1745,50 @@ % The double \hbox construction enables us to \backtrack % boxes. +\let\strutht\undefined \newdimen\strutht +\let\strutdp\undefined \newdimen\strutdp + \unexpanded\def\setstrut - {% height - \edef\strutheight - {\the\dimexpr\spacingfactor\dimexpr - \ifdim\minimumstrutheight>\zeropoint - \minimumstrutheight - \else - \strutheightfactor\dimexpr\normallineheight - \fi}% - % depth - \edef\strutdepth - {\the\dimexpr - \ifgridsnapping - \ifdim\minimumstrutdepth>\zeropoint - \minimumstrutdepth - \else - \normallineheight-\strutheight - \fi - \else - \spacingfactor\dimexpr - \ifdim\minimumstrutdepth>\zeropoint - \minimumstrutdepth - \else - \strutdepthfactor\dimexpr\normallineheight - \fi - \fi}% - % finish + {\ifgridsnapping + \setstrutgridyes + \else + \setstrutgridnop + \fi} + +\unexpanded\def\setstrutgridyes + {\strutht\spacingfactor\dimexpr + \ifdim\minimumstrutheight>\zeropoint + \minimumstrutheight + \else + \strutheightfactor\dimexpr\normallineheight + \fi + \strutdp\dimexpr + \ifdim\minimumstrutdepth>\zeropoint + \minimumstrutdepth + \else + \normallineheight-\strutht + \fi + \dosetstrut} + +\unexpanded\def\setstrutgridnop + {\strutht\spacingfactor\dimexpr + \ifdim\minimumstrutheight>\zeropoint + \minimumstrutheight + \else + \strutheightfactor\dimexpr\normallineheight + \fi + \strutdp\spacingfactor\dimexpr + \ifdim\minimumstrutdepth>\zeropoint + \minimumstrutdepth + \else + \strutdepthfactor\dimexpr\normallineheight + \fi \dosetstrut} \unexpanded\def\setcharstrut#1% {\setbox\strutbox\normalhbox{#1}% - \edef\strutheight{\the\strutht}% - \edef\strutdepth {\the\strutdp}% + \strutht\ht\strutbox + \strutdp\dp\strutbox \dosetstrut} \unexpanded\def\setfontstrut @@ -1771,28 +1818,50 @@ \def\dosetstrut {\let\strut\normalstrut + \edef\strutheight{\the\strutht}% + \edef\strutdepth {\the\strutdp}% \ifdim\strutwidth=\zeropoint - \setbox\strutbox\normalhbox - {\vrule - \!!width \zeropoint - \!!height\strutheight - \!!depth \strutdepth}% + \dosetstruthide \else - \setbox\strutbox\normalhbox - {\normalhbox to \zeropoint - {% \hss % new, will be option - \vrule - \!!width \strutwidth - \!!height\strutheight - \!!depth \strutdepth - \hss}}% + \dosetstrutvide \fi \struttotal\dimexpr\strutht+\strutdp\relax} +\def\dosetstruthide + {\setbox\strutbox\normalhbox + {\vrule + \!!width \zeropoint + \!!height\strutht + \!!depth \strutdp}} + +\def\dosetstrutvide + {\setbox\strutbox\normalhbox + {\normalhbox to \zeropoint + {% \hss % new, will be option + \vrule + \!!width \strutwidth + \!!height\strutht + \!!depth \strutdp + \hss}}} + %D The dimen \type {\struttotal} holds the exact size of the %D strut; occasionally a one scaled point difference can show %D up with the lineheight. +% experiment + +\newbox\emptystrutbox \setbox\emptystrutbox\hbox{} + +\def\dosetstruthide + {\setbox\strutbox\copy\emptystrutbox + \ht\strutbox\strutht + \dp\strutbox\strutdp} + +\def\strut{\relax\dontleavehmode\copy\strutbox} % still callbacks for \hbox{\strut} + + +\let\normalstrut\strut + %D Sometimes a capstrut comes in handy %D %D \starttabulate[|Tl|l|l|] @@ -1828,9 +1897,9 @@ {\begingroup \setbox\scratchbox\copy\strutbox \setstrut - \ifdim\ht\strutbox>\autostrutfactor\ht\scratchbox + \ifdim\strutht>\autostrutfactor\ht\scratchbox \endgroup \setstrut - \else\ifdim\dp\strutbox>\autostrutfactor\dp\scratchbox + \else\ifdim\strutdp>\autostrutfactor\dp\scratchbox \endgroup \setstrut \else \endgroup @@ -1938,15 +2007,21 @@ %D My own one: +\def\dopushinterlineskip + {\edef\oninterlineskip + {\baselineskip\the\baselineskip + \lineskip\the\lineskip + \lineskiplimit\the\lineskiplimit + \let\noexpand\offinterlineskip\noexpand\normaloffinterlineskip}} + +\def\nopushinterlineskip + {\let\oninterlineskip\setnormalbaselines} + \def\offinterlineskip {\ifdim\baselineskip>\zeropoint - \edef\oninterlineskip - {\baselineskip\the\baselineskip - \lineskip\the\lineskip - \lineskiplimit\the\lineskiplimit - \let\noexpand\offinterlineskip\noexpand\normaloffinterlineskip}% + \dopushinterlineskip \else - \let\oninterlineskip\setnormalbaselines + \nopushinterlineskip \fi \normaloffinterlineskip} @@ -2135,6 +2210,20 @@ \let\effectiveleftskip \@@effectiveleftskip \let\effectiverightskip\@@effectiverightskip} +% We will not use bodydir and pagedir so we disable them. That way we get +% normal hyperlink support. + +\let\@@bodydir\normalbodydir +\let\@@pagedir\normalpagedir + +\unexpanded\def\bodydir{\afterassignment\do@@bodydir\@@bodydir} \let\normalbodydir\bodydir +\unexpanded\def\pagedir{\afterassignment\do@@pagedir\@@pagedir} \let\normalpagedir\pagedir + +\def\do@@bodydir{\@@bodydir TLT\relax} +\def\do@@pagedir{\@@pagedir TLT\relax} + +% This will become a more advanced layout controller soon: + \unexpanded\def\lefttoright{\textdir TLT\pardir TLT\relax} \unexpanded\def\righttoleft{\textdir TRT\pardir TRT\relax} @@ -2185,7 +2274,7 @@ \v!center=>\def\raggedbox{\doalignedline\v!middle}]} \def\dosetraggedcommand#1% - {\expanded{\dodosetraggedcommand{#1}}} + {\normalexpanded{\noexpand\dodosetraggedcommand{#1}}} \newtoks\everyraggedcommand @@ -2369,7 +2458,7 @@ \appendtoks \forgetparindent \to \everyforgetall \appendtoks \forgetbothskips \to \everyforgetall \appendtoks \forgetspacing \to \everyforgetall % i.v.m. funny spacing in pagebody -\appendtoks \spacing\!!plusone \to \everyforgetall % new per 10/08/2004, else problems in otr / !! needed +\appendtoks \spacing\plusone \to \everyforgetall % new per 10/08/2004, else problems in otr / !! needed \appendtoks \everypar\emptytoks \to \everyforgetall % indeed! \def\localvbox#1#% @@ -3352,14 +3441,12 @@ \def\dosetuptolerance[#1]% {\doifinsetelse\v!vertical{#1}% - {\ExpandFirstAfter\processallactionsinset - [#1] + {\normalexpanded{\noexpand\processallactionsinset[#1]} [ \v!verystrict=>\def\bottomtolerance{}, \v!strict=>\def\bottomtolerance{.050}, \v!tolerant=>\def\bottomtolerance{.075}, \v!verytolerant=>\def\bottomtolerance{.100}]}% - {\ExpandFirstAfter\processallactionsinset - [#1] + {\normalexpanded{\noexpand\processallactionsinset[#1]} [ \v!stretch=>\emergencystretch\bodyfontsize, \v!space=>\spaceskip.5em\!!plus.25em\!!minus.25em\relax, \v!verystrict=>\tolerance 200, @@ -3884,29 +3971,28 @@ \let\normalvadjust\vadjust -% test this prikkels/pascal margin text before heads (mode -% 1) as well as uitwerkingen (mode 2) - -%chardef\graphicvadjustmode=0 % fake -%chardef\graphicvadjustmode=1 % normal -\chardef\graphicvadjustmode=2 % normal + compensate (== default) - -\def\graphicvadjust % bad, those low level color calls here +% \def\graphicvadjust % bad, those low level color calls here +% {\dowithnextboxcontent +% {\forgetall} +% {\normalvadjust +% {\unvbox\nextbox +% % corrects for one line paragraphs +% \nointerlineskip +% \kern-\struttotal +% \nointerlineskip +% \verticalstrut}}% +% \vbox} + +\def\graphicvadjust % nasty bidi handling {\dowithnextboxcontent {\forgetall} - {\ifcase\graphicvadjustmode \@EA \fakedvadjust \else \@EA\normalvadjust \fi - {\dostartgraphicgroup % don't ask - \localstarttextcolor - \unvbox\nextbox - \localstoptextcolor % don't ask - \dostopgraphicgroup - \ifcase\graphicvadjustmode \or \or - % corrects for one line paragraphs - \nointerlineskip - \kern-\struttotal - \nointerlineskip - \verticalstrut - \fi}}% + {\vadjust{\vbox attr \graphicvadjustattribute \plusone + {\unvbox\nextbox + % corrects for one line paragraphs + \nointerlineskip + \kern-\struttotal + \nointerlineskip + \verticalstrut}}}% \vbox} %D This works only in a properly strutted line, and is meant @@ -4029,10 +4115,9 @@ \gdef\afterfirstobeyedline % tzt two pass, net als opsomming {\gdef\afterfirstobeyedline {\nobreak - \global\let\afterfirstobeyedline\relax}}% + \doifnot\@@rgoption\v!packed{\global\let\afterfirstobeyedline\relax}}}% \def\obeyedline {\par - \afterfirstobeyedline \futurelet\next\dobetweenthelines}% \activatespacehandler\@@rgspace \GotoPar} @@ -4043,10 +4128,13 @@ \@@rgafter} \def\dobetweenthelines - {\doifmeaningelse\next\obeyedline\@@rginbetween\donothing} + {\doifmeaningelse\next\obeyedline + {\@@rginbetween} + {\afterfirstobeyedline}} \setuplines - [\c!before=\blank, + [\c!option=, + \c!before=\blank, \c!after=\blank, \c!inbetween=\blank, \c!indenting=\v!no, diff --git a/tex/context/base/core-stg.mkii b/tex/context/base/core-stg.mkii new file mode 100644 index 000000000..429e1e894 --- /dev/null +++ b/tex/context/base/core-stg.mkii @@ -0,0 +1,72 @@ +%D \module +%D [ file=core-stg, +%D version=2006.08.16, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Strategies, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is a prelude to strategies. It is rather old code +%D used in a project many years ago. Use with care since I +%D will pick up this thread. (moved from cont-new) + +\unprotect + +\def\s!strategy{strategy} + +\def\currentstrategypass {1} +\def\currentstrategyvariable{0} +\def\maximumstrategypass {8} + +\newconditional\strategypassneeded +\newconditional\strategypassforced + +\definetwopasslist{\s!strategy} + +\def\registerstrategypass + {\ifnum\currentstrategypass>\maximumstrategypass \else + \ifconditional\strategypassforced + \doglobal\increment\currentstrategypass + \else%\ifconditional\strategypassneeded + %\doglobal\increment\currentstrategypass + \fi%\fi + \fi + \savecurrentvalue\currentstrategypass{\currentstrategypass}} + +\appendtoks \registerstrategypass \to \everybye % \everylastshipout + +\def\setstrategyvariable#1#2% key value + {%\doifnotstrategyvariable{#1}{\global\settrue\strategypassneeded}% + \doglobal\increment\currentstrategyvariable + \savetaggedtwopassdata{\s!strategy}{\currentstrategyvariable}{#1}{#2}} + +\def\doifstrategyvariableelse#1#2#3% + {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi} + +\def\getstrategyvariable#1% key + {\findtwopassdata{\s!strategy}{#1}% + \setxvalue{\s!strategy:#1}{\twopassdata}} + +\def\retainstrategyvariable#1% key + {\expanded{\setstrategyvariable{#1}{\strategyvariable{#1}}}} + +\def\strategyvariable#1% key + {\csname\s!strategy:#1\endcsname} + +\let\stratvar\strategyvariable + +\def\forcestrategy{\global\settrue \strategypassforced} +\def\abortstrategy{\global\setfalse\strategypassforced} + +\def\doifstrategyvariableelse#1#2#3% + {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi} + +\def\doifstrategyvariable #1#2{\doifstrategyvariableelse{#1}{#2}{}} +\def\doifnotstrategyvariable#1#2{\doifstrategyvariableelse{#1}{}{#2}} + +\protect \endinput diff --git a/tex/context/base/core-stg.tex b/tex/context/base/core-stg.tex deleted file mode 100644 index 429e1e894..000000000 --- a/tex/context/base/core-stg.tex +++ /dev/null @@ -1,72 +0,0 @@ -%D \module -%D [ file=core-stg, -%D version=2006.08.16, -%D title=\CONTEXT\ Core Macros, -%D subtitle=Strategies, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This is a prelude to strategies. It is rather old code -%D used in a project many years ago. Use with care since I -%D will pick up this thread. (moved from cont-new) - -\unprotect - -\def\s!strategy{strategy} - -\def\currentstrategypass {1} -\def\currentstrategyvariable{0} -\def\maximumstrategypass {8} - -\newconditional\strategypassneeded -\newconditional\strategypassforced - -\definetwopasslist{\s!strategy} - -\def\registerstrategypass - {\ifnum\currentstrategypass>\maximumstrategypass \else - \ifconditional\strategypassforced - \doglobal\increment\currentstrategypass - \else%\ifconditional\strategypassneeded - %\doglobal\increment\currentstrategypass - \fi%\fi - \fi - \savecurrentvalue\currentstrategypass{\currentstrategypass}} - -\appendtoks \registerstrategypass \to \everybye % \everylastshipout - -\def\setstrategyvariable#1#2% key value - {%\doifnotstrategyvariable{#1}{\global\settrue\strategypassneeded}% - \doglobal\increment\currentstrategyvariable - \savetaggedtwopassdata{\s!strategy}{\currentstrategyvariable}{#1}{#2}} - -\def\doifstrategyvariableelse#1#2#3% - {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi} - -\def\getstrategyvariable#1% key - {\findtwopassdata{\s!strategy}{#1}% - \setxvalue{\s!strategy:#1}{\twopassdata}} - -\def\retainstrategyvariable#1% key - {\expanded{\setstrategyvariable{#1}{\strategyvariable{#1}}}} - -\def\strategyvariable#1% key - {\csname\s!strategy:#1\endcsname} - -\let\stratvar\strategyvariable - -\def\forcestrategy{\global\settrue \strategypassforced} -\def\abortstrategy{\global\setfalse\strategypassforced} - -\def\doifstrategyvariableelse#1#2#3% - {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi} - -\def\doifstrategyvariable #1#2{\doifstrategyvariableelse{#1}{#2}{}} -\def\doifnotstrategyvariable#1#2{\doifstrategyvariableelse{#1}{}{#2}} - -\protect \endinput diff --git a/tex/context/base/core-sys.mkiv b/tex/context/base/core-sys.mkiv index 073c29b66..28ef1e520 100644 --- a/tex/context/base/core-sys.mkiv +++ b/tex/context/base/core-sys.mkiv @@ -283,6 +283,9 @@ %D processaction alternative on an string of average length. %D Since this feature is used in XML processing, it made sense %D to support this faster alternative. It's installable as well. +%D +%D We keep this around for \MKII\ \XML\ but it's not used in \MKIV\ +%D code as expansion is controlled in another way there. \def\installexpander#1#2#3% changed, no longer \convert..\to... {\setvalue{\s!do\c!expansion#1l}{#2}% @@ -315,12 +318,8 @@ \installexpander\v!strict \defreducedargument \gdefreducedargument \installexpander {utf} \defreducedtoutf \gdefreducedtoutf -%installexpander {xml} {see xtag-ext} - \def\dodefconvertedmeaning#1#2#3% watch the double expansion ! {\bgroup - \honorunexpanded - \convertencodedtokens % can be overloaded \xdef\@@globalexpanded{#3}% \xdef\@@globalexpanded{\@@globalexpanded}% \egroup @@ -337,44 +336,6 @@ \def\defreducedargument {\dodefreducedargument\edef} \def\gdefreducedargument{\dodefreducedargument\xdef} - -% \setupindex[expansion=utf]\index{\eacute} - -\def\dodefreducedtoutf#1#2#3% - {\begingroup - \reducetocoding[uc]% - \let\uchar\uchartoutf - \let\unicodechar\numbertoutf - \edef\ascii{#3}% - \expandafter\endgroup\expandafter#1\expandafter#2\expandafter{\ascii}} - -\def\defreducedtoutf {\dodefreducedtoutf\edef} -\def\gdefreducedtoutf{\dodefreducedtoutf\xdef} - -% old syntax: - -\def\convertmeaning#1\to#2% watch the double expansion ! - {\bgroup - \honorunexpanded - \convertencodedtokens % can be overloaded - \xdef\@@globalexpanded{#1}% - \xdef\@@globalexpanded{\@@globalexpanded}% - \egroup - \defconvertedcommand#2\@@globalexpanded} - -\def\reduceargument#1\to#2% - {\begingroup - \reducetocoding[raw]% - \edef\ascii{#1}% - \expandafter\endgroup\expandafter\edef\expandafter#2\expandafter{\ascii}} - -\def\reducetoutf#1\to#2% - {\begingroup - \reducetocoding[uc]% - \let\uchar\uchartoutf - \let\unicodechar\numbertoutf - \edef\ascii{#1}% - \expandafter\endgroup\expandafter\edef\expandafter#2\expandafter{\ascii}} \startruntimeluacode \ctxlua { diff --git a/tex/context/base/core-two.lua b/tex/context/base/core-two.lua index 5749d406d..50c356f7b 100644 --- a/tex/context/base/core-two.lua +++ b/tex/context/base/core-two.lua @@ -48,6 +48,14 @@ function jobpasses.savetagged(id,tag,str) jti[tag] = str end +function jobpasses.getcollected(id) + return collected[id] or { } +end + +function jobpasses.gettobesaved(id) + return allocate(id) +end + function jobpasses.get(id) local jti = collected[id] if jti and #jti > 0 then diff --git a/tex/context/base/core-two.mkiv b/tex/context/base/core-two.mkiv index f7dbd4c91..98d396d08 100644 --- a/tex/context/base/core-two.mkiv +++ b/tex/context/base/core-two.mkiv @@ -71,9 +71,6 @@ \unprotect -\let\alltwopasslists\empty -\let\twopassentry \empty -\let\twopassentry \gobblethreearguments % permits loading a MK II file \let\twopassdatalist\empty \newif\iftwopassdatafound diff --git a/tex/context/base/core-uti.mkii b/tex/context/base/core-uti.mkii index b348ba358..5b8f66f50 100644 --- a/tex/context/base/core-uti.mkii +++ b/tex/context/base/core-uti.mkii @@ -208,29 +208,32 @@ \fi \to \everybeforeutilityread -\edef\testbytesequence - {\rawcharacter{7}% - \rawcharacter{27}% - %rawcharacter{227}% invalid in xetex, which expects utf - \rawcharacter{195}\rawcharacter{128}} % valid utf code - -\def\thisisbytesequence#1% - {\ifx\testbytesequence\empty\else - \defconvertedcommand\testbytesequence\testbytesequence - \defconvertedargument\ascii{#1}% - \ifx\testbytesequence\ascii \else - \writestatus\m!systems{possible problem with 8 bit output}% - \fi - \fi - \global\let\thisisbytesequence\gobbleoneargument} - -\ifnum\texengine=\xetexengine - \let\testbytesequence\empty -\fi +% \edef\testbytesequence +% {\rawcharacter{7}% +% \rawcharacter{27}% +% %rawcharacter{227}% invalid in xetex, which expects utf +% \rawcharacter{195}\rawcharacter{128}} % valid utf code +% +% \def\thisisbytesequence#1% +% {\ifx\testbytesequence\empty\else +% \defconvertedcommand\testbytesequence\testbytesequence +% \defconvertedargument\ascii{#1}% +% \ifx\testbytesequence\ascii \else +% \writestatus\m!systems{possible problem with 8 bit output}% +% \fi +% \fi +% \global\let\thisisbytesequence\gobbleoneargument} +% +% \ifnum\texengine=\xetexengine +% \let\testbytesequence\empty +% \fi +% +% \appendtoks +% \immediatewriteutilitycommand{\thisisbytesequence{\testbytesequence}}% +% \to \everyopenutilities -\appendtoks - \immediatewriteutilitycommand{\thisisbytesequence{\testbytesequence}}% -\to \everyopenutilities +\let\testbytesequence \empty % keep this +\let\thisisbytesequence\gobbleoneargument % keep this \long\def\doutilities#1#2#3#4#5% % introduceren in utility file {\resetutilities diff --git a/tex/context/base/core-uti.mkiv b/tex/context/base/core-uti.mkiv index 77cf91dd9..29e6342be 100644 --- a/tex/context/base/core-uti.mkiv +++ b/tex/context/base/core-uti.mkiv @@ -11,8 +11,6 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D Most will disappear! - \writestatus{loading}{ConTeXt Core Macros / Utility File Handling} \unprotect @@ -22,23 +20,16 @@ \def\savecurrentvalue#1#2% {\ctxlua{jobvariables.save("\strippedcsname#1","#2")}} -\let\initializevariable\gobbletwoarguments % mkii/mkiv -\let\thisisbytesequence\gobbleoneargument - \appendtoks - \globallet\initializevariable\gobbletwoarguments -\to \everyafterutilityread - -\appendtoks - \ctxlua{storage.dump()}% + \ctxlua{storage.dump()}% will move to lua \to \everydump \appendtoks - \ctxlua{storage.finalize()}% + \ctxlua{storage.finalize()}% will move to lua \to \everyfinalizeluacode \appendtoks - \ctxlua{nodes.cleanup_reserved()}% + \ctxlua{nodes.cleanup_reserved()}% will move to lua \to \everydump \appendtoks @@ -60,37 +51,14 @@ % }% % \to \everystarttext -% keep this for a while - -\newif\ifutilitydone -\newif\ifdoinpututilities -\newif\ifunprotectutilities - -\let\writeutility \gobbleoneargument -\let\writeutilitycommand \gobbleoneargument -\let\immediatewriteutility \gobbleoneargument -\let\immediatewriteutilitycommand\gobbleoneargument -\let\cwriteutility \gobbleoneargument -\let\cwriteutilitycommand \gobbleoneargument -\let\checkedutility \secondoftwoarguments -\let\doutilities \gobblefivearguments -\let\abortutilitygeneration \relax - -\newtoks \everyopenutilities \let\openutilities \relax -\newtoks \everycloseutilities \let\closeutilities\relax -\newtoks \everycheckutilities \let\checkutilities\relax -\newtoks \utilityresetlist - -\def\addutilityreset#1{\@EA\appendtoks\csname\s!reset#1\endcsname\to\utilityresetlist} -\def\resetutilities {\the\utilityresetlist} - -\def\currentutilityfilename{\jobname} - -\prependtoks \resetutilities \to \everyjob +%D Some styles might use these use these commands: -\def\installprogram {\dosingleempty\doinstallprogram} -\def\doinstallprogram[#1]{\gobbleoneargument} -\def\installedprogram[#1]{} -\let\installplugin \gobblethreearguments +\newif \ifutilitydone +\let \checkutilities \relax +\let \currentutilityfilename \jobname +\def \installprogram {\dosingleempty\doinstallprogram} +\def \doinstallprogram [#1]{\gobbleoneargument} +\def \installedprogram [#1]{} +\let \installplugin \gobblethreearguments \protect \endinput diff --git a/tex/context/base/core-var.mkii b/tex/context/base/core-var.mkii new file mode 100644 index 000000000..4de1b8718 --- /dev/null +++ b/tex/context/base/core-var.mkii @@ -0,0 +1,286 @@ +%D \module +%D [ file=core-var, +%D version=1998.02.21, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Variables, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / Variables} + +\unprotect + +%D We introduce a couple of variables that are used all over +%D \CONTEXT. Alternatively we could define them in each module +%D but as they are part of the bigger picture we prefer to do +%D it here. + +%D \macros +%D {every...} +%D +%D A few every's. Some are only used in \MKII\ or \MKIV. + +%D Output routine: + +\newtoks \everybeforeoutput +\newtoks \everyafteroutput + +%D Shipout: + +\newtoks \everyshipout +\newtoks \everybeforeshipout +\newtoks \everyaftershipout +\newtoks \everyfirstshipout +\newtoks \everylastshipout + +%D End of run: + +\newtoks \everybye +\newtoks \everygoodbye +\newtoks \everynotabene + +%D Document + +\newtoks \everysetupdocument +\newtoks \everyendoftextbody + +\newtoks \everystarttext +\newtoks \everystoptext + +%D Purity: + +\newtoks \everyforgetall +\newtoks \everycleanupfeatures + +\def\cleanupfeatures{\the\everycleanupfeatures} +\def\forgetall {\the\everyforgetall} + +%D Page building: + +\newtoks \everybeforepagebody +\newtoks \everyafterpagebody + +\let \everypagebody \everybeforepagebody % backward compatible + +%D Multipass: + +\newtoks \everybeforeutilityread +\newtoks \everyafterutilityread + +%D Floats: + +\newtoks \everyinsidefloat + +%D Sectioning: + +\newtoks \everyheadstart + +%D Par building (experimental, used in xml

..

) + +\newtoks \everybeginofpar +\newtoks \everyendofpar +%newtoks \everyparflush + +\def\bpar{\the\everybeginofpar\ignorespaces} % may interfere with \everypar +\def\epar{\ifhmode\removeunwantedspaces\the\everyendofpar\fi} % test prevents problems with \bpar\epar + +%D Lists: + +\newtoks \everylistentry +\newtoks \everysavesortkeys + +%D Marks: + +\newtoks \everymarking + +%D Fonts: + +\newtoks \everyfont +\newtoks \everyglobalbodyfont +\newtoks \everydefinedfont + +\newevery \everybodyfont \EveryBodyFont +\newevery \everyfontswitch \EveryFontSwitch + +%D Math: + +\newtoks \everybeforedisplayformula +\newtoks \everymathematics + +\prependtoks \the\everymathematics \to \everymath +\prependtoks \the\everymathematics \to \everydisplay + +%D Tables + +\newtoks \everytable + +%D State mess: + +\newtoks \everypushsomestate +\newtoks \everypopsomestate + +\def\pushsomestates{\the\everypushsomestate} +\def\popsomestates {\the\everypopsomestate } + +%D More generic (used to be pushcolor etc) + +\newtoks\everypushproperties +\newtoks\everypopproperties +\newtoks\everypopsplitproperties + +\newtoks\everystarttextproperties +\newtoks\everystoptextproperties + +\def\pushproperties {\the\everypushproperties} +\def\popproperties {\the\everypopproperties} +\def\popsplitproperties {\the\everypopsplitproperties} + +\def\starttextproperties{\the\everystarttextproperties} +\def\stoptextproperties {\the\everystoptextproperties} + +%D This is pretty important (esp since we now ignore shipouts). +%D Actually we should nil all writes, marks, specials. + +\appendtoks \globallet\popproperties \relax \to \everylastshipout +\appendtoks \globallet\popsplitproperties\relax \to \everylastshipout + +%D \macros +%D {defineinputmode,setinputmode} +%D +%D New. Some work needs to be done. + +% not in mkiv + +\def\defineinputmode[#1]{\@EA\newtoks\csname every#1inputmode\endcsname} +\def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks} + +\defineinputmode [TEX] +\defineinputmode [XML] + +\setinputmode [TEX] + +%D \macros +%D {trialtypesetting} +%D +%D We disable trial typesetting in the output routine, +%D just to be sure. + +\newif\iftrialtypesetting + +\prependtoks \trialtypesettingfalse \to \everybeforepagebody + +%D \macros +%D {ifinpagebody,ifinsidecolumns,ifdoublesided,ifsinglesided} + +\newif \ifinpagebody +\newif \ifinsidecolumns +\newif \ifdoublesided \doublesidedfalse +\newif \ifsinglesided \singlesidedtrue +\newif \ifinsidefloat +\newif \ifdoingblocks +\newif \ifgridsnapping + +%D \macros +%D {ifprocessingXML} +%D +%D We need this one even if no \XML\ is supported. + +\newif\ifprocessingXML % old way + +%D \macros +%D {ifproductionrun} +%D +%D This boolean can be used to bypass certain +%D initializations. + +\ifx\protectionlevel\undefined \newcount\protectionlevel \fi + +\newif\ifproductionrun + +\appendtoks \productionruntrue \to \everydump + +\appendtoks \ifcase\protectionlevel\else\reportunprotection\fi \to \everydump + +%D \macros +%D {everyboxedcontent, ifboxedcontent, +%D startboxedcontent, stopboxedcontent} +%D +%D This one is relatively new and will be used as a more +%D robust test for inner situations. + +\newif \ifboxedcontent +\newtoks\everyboxedcontent + +\appendtoks \boxedcontenttrue \to \everyboxedcontent + +\def\startboxedcontent{\bgroup\the\everyboxedcontent} +\let\stopboxedcontent \egroup + +%D \macros +%D {fastmode,silentmode} +%D +%D These commands are obsolete. + +\let\fastmode \relax +\let\silentmode\relax + +%D \macros +%D {defineselector,setupselector} +%D +%D \starttyping +%D \defineselector[caption][max=2,n=2] +%D +%D \start +%D \setupselector[caption][n=1] +%D \placelist[figure][criterium=all] +%D \stop +%D +%D \starttext +%D \placefigure +%D {\select{caption}{zapf}{\input zapf \relax}} +%D {} +%D \stoptext +%D \stoptyping + +\def\defineselector{\dodoubleargument\dodefineselector} +\def\setupselector {\dodoubleargument\dosetupselector} + +\def\dodefineselector[#1][#2]{\getparameters[\??sx#1][\c!max=2,\c!n=1,#2]} +\def\dosetupselector [#1][#2]{\getparameters[\??sx#1][#2]} + +\unexpanded\def\select#1% + {\filterfromnext + {\executeifdefined{\??sx#1\c!max}1} + {\executeifdefined{\??sx#1\c!n }1}} + +%D We store some original meanings, maybe in \type +%D {math-ini}. + +\let\normalat \at +\let\normalin \in +\let\normalfrom \from +%let\normalover \over +\let\normalabout\about + +%D Add-ons: + +\let\startlayoutcomponent\gobbletwoarguments +\let\stoplayoutcomponent \relax + +%D Concepts: + +\chardef\conceptmode\zerocount + +\def\doifconcepttracing + {\ifnum\conceptmode>\plustwo + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\protect \endinput diff --git a/tex/context/base/core-var.mkiv b/tex/context/base/core-var.mkiv new file mode 100644 index 000000000..9a0b190d8 --- /dev/null +++ b/tex/context/base/core-var.mkiv @@ -0,0 +1,275 @@ +%D \module +%D [ file=core-var, +%D version=1998.02.21, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Variables, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / Variables} + +\unprotect + +%D We introduce a couple of variables that are used all over +%D \CONTEXT. Alternatively we could define them in each module +%D but as they are part of the bigger picture we prefer to do +%D it here. + +%D \macros +%D {every...} +%D +%D A few every's. Some are only used in \MKII\ or \MKIV. + +%D Output routine: + +\newtoks \everybeforeoutput +\newtoks \everyafteroutput + +%D Shipout: + +\newtoks \everyshipout +\newtoks \everybeforeshipout +\newtoks \everyaftershipout +\newtoks \everyfirstshipout +\newtoks \everylastshipout + +%D End of run: + +\newtoks \everybye +\newtoks \everygoodbye +\newtoks \everynotabene + +%D Document + +\newtoks \everysetupdocument +\newtoks \everyendoftextbody + +\newtoks \everystarttext +\newtoks \everystoptext + +%D Purity: + +\newtoks \everyforgetall +\newtoks \everycleanupfeatures + +\def\cleanupfeatures{\the\everycleanupfeatures} +\def\forgetall {\the\everyforgetall} + +%D Page building: + +\newtoks \everybeforepagebody +\newtoks \everyafterpagebody + +\let \everypagebody \everybeforepagebody % backward compatible + +%D Multipass: + +\newtoks \everybeforeutilityread +\newtoks \everyafterutilityread + +%D Floats: + +\newtoks \everyinsidefloat + +%D Sectioning: + +\newtoks \everyheadstart + +%D Par building (experimental, used in xml

..

) + +\newtoks \everybeginofpar +\newtoks \everyendofpar +%newtoks \everyparflush + +\def\bpar{\the\everybeginofpar\ignorespaces} % may interfere with \everypar +\def\epar{\ifhmode\removeunwantedspaces\the\everyendofpar\fi} % test prevents problems with \bpar\epar + +%D Lists: + +\newtoks \everylistentry +\newtoks \everysavesortkeys + +%D Marks: + +\newtoks \everymarking + +%D Fonts: + +\newtoks \everyfont +\newtoks \everyglobalbodyfont +\newtoks \everydefinedfont + +\newevery \everybodyfont \EveryBodyFont +\newevery \everyfontswitch \EveryFontSwitch + +%D Math: + +\newtoks \everybeforedisplayformula +\newtoks \everymathematics + +\prependtoks \the\everymathematics \to \everymath +\prependtoks \the\everymathematics \to \everydisplay + +%D Tables + +\newtoks \everytable + +%D State mess: + +\newtoks \everypushsomestate +\newtoks \everypopsomestate + +\def\pushsomestates{\the\everypushsomestate} +\def\popsomestates {\the\everypopsomestate } + +%D More generic (used to be pushcolor etc) + +\newtoks\everystarttextproperties +\newtoks\everystoptextproperties + +\def\starttextproperties{\the\everystarttextproperties} +\def\stoptextproperties {\the\everystoptextproperties} + +%D \macros +%D {defineinputmode,setinputmode} +%D +%D New. Some work needs to be done. + +% not in mkiv + +\def\defineinputmode[#1]{\@EA\newtoks\csname every#1inputmode\endcsname} +\def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks} + +\defineinputmode [TEX] +\defineinputmode [XML] + +\setinputmode [TEX] + +%D \macros +%D {trialtypesetting} +%D +%D We disable trial typesetting in the output routine, +%D just to be sure. + +\newif\iftrialtypesetting + +\prependtoks \trialtypesettingfalse \to \everybeforepagebody + +%D \macros +%D {ifinpagebody,ifinsidecolumns,ifdoublesided,ifsinglesided} + +\newif \ifinpagebody +\newif \ifinsidecolumns +\newif \ifdoublesided \doublesidedfalse +\newif \ifsinglesided \singlesidedtrue +\newif \ifinsidefloat +\newif \ifdoingblocks +\newif \ifgridsnapping + +%D \macros +%D {ifprocessingXML} +%D +%D We need this one even if no \XML\ is supported. + +\newif\ifprocessingXML % old way + +%D \macros +%D {ifproductionrun} +%D +%D This boolean can be used to bypass certain +%D initializations. + +\ifx\protectionlevel\undefined \newcount\protectionlevel \fi + +\newif\ifproductionrun + +\appendtoks \productionruntrue \to \everydump + +\appendtoks \ifcase\protectionlevel\else\reportunprotection\fi \to \everydump + +%D \macros +%D {everyboxedcontent, ifboxedcontent, +%D startboxedcontent, stopboxedcontent} +%D +%D This one is relatively new and will be used as a more +%D robust test for inner situations. + +\newif \ifboxedcontent +\newtoks\everyboxedcontent + +\appendtoks \boxedcontenttrue \to \everyboxedcontent + +\def\startboxedcontent{\bgroup\the\everyboxedcontent} +\let\stopboxedcontent \egroup + +%D \macros +%D {fastmode,silentmode} +%D +%D These commands are obsolete. + +\let\fastmode \relax +\let\silentmode\relax + +%D \macros +%D {defineselector,setupselector} +%D +%D \starttyping +%D \defineselector[caption][max=2,n=2] +%D +%D \start +%D \setupselector[caption][n=1] +%D \placelist[figure][criterium=all] +%D \stop +%D +%D \starttext +%D \placefigure +%D {\select{caption}{zapf}{\input zapf \relax}} +%D {} +%D \stoptext +%D \stoptyping + +\def\defineselector{\dodoubleargument\dodefineselector} +\def\setupselector {\dodoubleargument\dosetupselector} + +\def\dodefineselector[#1][#2]{\getparameters[\??sx#1][\c!max=2,\c!n=1,#2]} +\def\dosetupselector [#1][#2]{\getparameters[\??sx#1][#2]} + +\unexpanded\def\select#1% + {\filterfromnext + {\executeifdefined{\??sx#1\c!max}1} + {\executeifdefined{\??sx#1\c!n }1}} + +%D We store some original meanings, maybe in \type +%D {math-ini}. + +\let\normalat \at +\let\normalin \in +\let\normalfrom \from +%let\normalover \over +\let\normalabout\about + +%D Add-ons: + +\let\startlayoutcomponent \gobbletwoarguments % obsolete +\let\stoplayoutcomponent \relax % obsolete +\let\setlayoutcomponentattribute \gobbletwoarguments +\let\resetlayoutcomponentattribute\relax +\let\layoutcomponentboxattribute \empty + +%D Concepts: + +\chardef\conceptmode\zerocount + +\def\doifconcepttracing + {\ifnum\conceptmode>\plustwo + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\protect \endinput diff --git a/tex/context/base/core-var.tex b/tex/context/base/core-var.tex deleted file mode 100644 index 4de1b8718..000000000 --- a/tex/context/base/core-var.tex +++ /dev/null @@ -1,286 +0,0 @@ -%D \module -%D [ file=core-var, -%D version=1998.02.21, -%D title=\CONTEXT\ Core Macros, -%D subtitle=Variables, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Core Macros / Variables} - -\unprotect - -%D We introduce a couple of variables that are used all over -%D \CONTEXT. Alternatively we could define them in each module -%D but as they are part of the bigger picture we prefer to do -%D it here. - -%D \macros -%D {every...} -%D -%D A few every's. Some are only used in \MKII\ or \MKIV. - -%D Output routine: - -\newtoks \everybeforeoutput -\newtoks \everyafteroutput - -%D Shipout: - -\newtoks \everyshipout -\newtoks \everybeforeshipout -\newtoks \everyaftershipout -\newtoks \everyfirstshipout -\newtoks \everylastshipout - -%D End of run: - -\newtoks \everybye -\newtoks \everygoodbye -\newtoks \everynotabene - -%D Document - -\newtoks \everysetupdocument -\newtoks \everyendoftextbody - -\newtoks \everystarttext -\newtoks \everystoptext - -%D Purity: - -\newtoks \everyforgetall -\newtoks \everycleanupfeatures - -\def\cleanupfeatures{\the\everycleanupfeatures} -\def\forgetall {\the\everyforgetall} - -%D Page building: - -\newtoks \everybeforepagebody -\newtoks \everyafterpagebody - -\let \everypagebody \everybeforepagebody % backward compatible - -%D Multipass: - -\newtoks \everybeforeutilityread -\newtoks \everyafterutilityread - -%D Floats: - -\newtoks \everyinsidefloat - -%D Sectioning: - -\newtoks \everyheadstart - -%D Par building (experimental, used in xml

..

) - -\newtoks \everybeginofpar -\newtoks \everyendofpar -%newtoks \everyparflush - -\def\bpar{\the\everybeginofpar\ignorespaces} % may interfere with \everypar -\def\epar{\ifhmode\removeunwantedspaces\the\everyendofpar\fi} % test prevents problems with \bpar\epar - -%D Lists: - -\newtoks \everylistentry -\newtoks \everysavesortkeys - -%D Marks: - -\newtoks \everymarking - -%D Fonts: - -\newtoks \everyfont -\newtoks \everyglobalbodyfont -\newtoks \everydefinedfont - -\newevery \everybodyfont \EveryBodyFont -\newevery \everyfontswitch \EveryFontSwitch - -%D Math: - -\newtoks \everybeforedisplayformula -\newtoks \everymathematics - -\prependtoks \the\everymathematics \to \everymath -\prependtoks \the\everymathematics \to \everydisplay - -%D Tables - -\newtoks \everytable - -%D State mess: - -\newtoks \everypushsomestate -\newtoks \everypopsomestate - -\def\pushsomestates{\the\everypushsomestate} -\def\popsomestates {\the\everypopsomestate } - -%D More generic (used to be pushcolor etc) - -\newtoks\everypushproperties -\newtoks\everypopproperties -\newtoks\everypopsplitproperties - -\newtoks\everystarttextproperties -\newtoks\everystoptextproperties - -\def\pushproperties {\the\everypushproperties} -\def\popproperties {\the\everypopproperties} -\def\popsplitproperties {\the\everypopsplitproperties} - -\def\starttextproperties{\the\everystarttextproperties} -\def\stoptextproperties {\the\everystoptextproperties} - -%D This is pretty important (esp since we now ignore shipouts). -%D Actually we should nil all writes, marks, specials. - -\appendtoks \globallet\popproperties \relax \to \everylastshipout -\appendtoks \globallet\popsplitproperties\relax \to \everylastshipout - -%D \macros -%D {defineinputmode,setinputmode} -%D -%D New. Some work needs to be done. - -% not in mkiv - -\def\defineinputmode[#1]{\@EA\newtoks\csname every#1inputmode\endcsname} -\def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks} - -\defineinputmode [TEX] -\defineinputmode [XML] - -\setinputmode [TEX] - -%D \macros -%D {trialtypesetting} -%D -%D We disable trial typesetting in the output routine, -%D just to be sure. - -\newif\iftrialtypesetting - -\prependtoks \trialtypesettingfalse \to \everybeforepagebody - -%D \macros -%D {ifinpagebody,ifinsidecolumns,ifdoublesided,ifsinglesided} - -\newif \ifinpagebody -\newif \ifinsidecolumns -\newif \ifdoublesided \doublesidedfalse -\newif \ifsinglesided \singlesidedtrue -\newif \ifinsidefloat -\newif \ifdoingblocks -\newif \ifgridsnapping - -%D \macros -%D {ifprocessingXML} -%D -%D We need this one even if no \XML\ is supported. - -\newif\ifprocessingXML % old way - -%D \macros -%D {ifproductionrun} -%D -%D This boolean can be used to bypass certain -%D initializations. - -\ifx\protectionlevel\undefined \newcount\protectionlevel \fi - -\newif\ifproductionrun - -\appendtoks \productionruntrue \to \everydump - -\appendtoks \ifcase\protectionlevel\else\reportunprotection\fi \to \everydump - -%D \macros -%D {everyboxedcontent, ifboxedcontent, -%D startboxedcontent, stopboxedcontent} -%D -%D This one is relatively new and will be used as a more -%D robust test for inner situations. - -\newif \ifboxedcontent -\newtoks\everyboxedcontent - -\appendtoks \boxedcontenttrue \to \everyboxedcontent - -\def\startboxedcontent{\bgroup\the\everyboxedcontent} -\let\stopboxedcontent \egroup - -%D \macros -%D {fastmode,silentmode} -%D -%D These commands are obsolete. - -\let\fastmode \relax -\let\silentmode\relax - -%D \macros -%D {defineselector,setupselector} -%D -%D \starttyping -%D \defineselector[caption][max=2,n=2] -%D -%D \start -%D \setupselector[caption][n=1] -%D \placelist[figure][criterium=all] -%D \stop -%D -%D \starttext -%D \placefigure -%D {\select{caption}{zapf}{\input zapf \relax}} -%D {} -%D \stoptext -%D \stoptyping - -\def\defineselector{\dodoubleargument\dodefineselector} -\def\setupselector {\dodoubleargument\dosetupselector} - -\def\dodefineselector[#1][#2]{\getparameters[\??sx#1][\c!max=2,\c!n=1,#2]} -\def\dosetupselector [#1][#2]{\getparameters[\??sx#1][#2]} - -\unexpanded\def\select#1% - {\filterfromnext - {\executeifdefined{\??sx#1\c!max}1} - {\executeifdefined{\??sx#1\c!n }1}} - -%D We store some original meanings, maybe in \type -%D {math-ini}. - -\let\normalat \at -\let\normalin \in -\let\normalfrom \from -%let\normalover \over -\let\normalabout\about - -%D Add-ons: - -\let\startlayoutcomponent\gobbletwoarguments -\let\stoplayoutcomponent \relax - -%D Concepts: - -\chardef\conceptmode\zerocount - -\def\doifconcepttracing - {\ifnum\conceptmode>\plustwo - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\protect \endinput diff --git a/tex/context/base/enco-032.mkii b/tex/context/base/enco-032.mkii new file mode 100644 index 000000000..d7e15126c --- /dev/null +++ b/tex/context/base/enco-032.mkii @@ -0,0 +1,82 @@ +%D \module +%D [ file=enco-032, +%D version=2006.03.30, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Unicode Goodies, +%D author={Taco Hoekwater}, +%D date=\currentdate, +%D copyright=PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +% unicode table 32 (= hex 20) + +\startencoding [default] + + \definecommand unic@threeperemspace {\hskip .33333em } + \definecommand unic@fourperemspace {\hskip .25em } + \definecommand unic@sixperemspace {\hskip .16667em } + \definecommand unic@figurespace {\hphantom{0}} + \definecommand unic@punctuationspace {\hphantom{,}} + \definecommand unic@hairspace {\hskip .08333em } + \definecommand unic@zerowidthspace {\hskip 0em plus 1sp } + \definecommand unic@zerowidthjoiner {\kern 0em } + \definecommand unic@zerowidthnonjoiner {\hskip 0em } + + \definecommand unic@quotedblleftreversed {\mirror{\quotedblright}} + \definecommand unic@quoteleftreversed {\mirror{\quoteright}} + + \definecommand unic@onedotleader {{\periods[1]}} + \definecommand unic@twodotleader {{\periods[2]}} + \definecommand unic@hyphenationpoint {.\allowbreak } + + \definecommand unic@doubleexclamationmark {!!} + \definecommand unic@exclamationquestionmark {!?} + \definecommand unic@questionexclamationmark {?!} + \definecommand unic@doublequestionmark {??} + + \definecommand unic@reversedpilcrowsign {\mirror{\P}} + \definecommand unic@reversedsemicolon {\mirror{;}} + + \definecommand unic@superscriptzero {\high{0}} + \definecommand unic@superscripti {\high{i}} + \definecommand unic@superscriptfour {\high{4}} + \definecommand unic@superscriptfive {\high{5}} + \definecommand unic@superscriptsix {\high{6}} + \definecommand unic@superscriptseven {\high{7}} + \definecommand unic@superscripteight {\high{8}} + \definecommand unic@superscriptnine {\high{9}} + \definecommand unic@superscriptplus {\high{+}} + \definecommand unic@superscriptminus {\high{\textminus}} + \definecommand unic@superscriptequals {\high{=}} + \definecommand unic@superscriptleft {\high{(}} + \definecommand unic@superscriptright {\high{)}} + \definecommand unic@superscriptn {\high{n}} + \definecommand unic@subscriptzero {\low{0}} + \definecommand unic@subscriptone {\low{1}} + \definecommand unic@subscripttwo {\low{2}} + \definecommand unic@subscriptthree {\low{3}} + \definecommand unic@subscriptfour {\low{4}} + \definecommand unic@subscriptfive {\low{5}} + \definecommand unic@subscriptsix {\low{6}} + \definecommand unic@subscriptseven {\low{7}} + \definecommand unic@subscripteight {\low{8}} + \definecommand unic@subscriptnine {\low{9}} + \definecommand unic@subscriptplus {\low{+}} + \definecommand unic@subscriptminus {\low{\textminus}} + \definecommand unic@subscriptequals {\low{=}} + \definecommand unic@subscriptleft {\low{(}} + \definecommand unic@subscriptright {\low{)}} + \definecommand unic@subscripta {\low{a}} + \definecommand unic@subscripte {\low{e}} + \definecommand unic@subscripto {\low{o}} + \definecommand unic@subscriptx {\low{x}} + \definecommand unic@subscriptschwa {\low{\schwa}} + +\stopencoding + +\protect \endinput diff --git a/tex/context/base/enco-032.tex b/tex/context/base/enco-032.tex deleted file mode 100644 index d7e15126c..000000000 --- a/tex/context/base/enco-032.tex +++ /dev/null @@ -1,82 +0,0 @@ -%D \module -%D [ file=enco-032, -%D version=2006.03.30, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Unicode Goodies, -%D author={Taco Hoekwater}, -%D date=\currentdate, -%D copyright=PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -% unicode table 32 (= hex 20) - -\startencoding [default] - - \definecommand unic@threeperemspace {\hskip .33333em } - \definecommand unic@fourperemspace {\hskip .25em } - \definecommand unic@sixperemspace {\hskip .16667em } - \definecommand unic@figurespace {\hphantom{0}} - \definecommand unic@punctuationspace {\hphantom{,}} - \definecommand unic@hairspace {\hskip .08333em } - \definecommand unic@zerowidthspace {\hskip 0em plus 1sp } - \definecommand unic@zerowidthjoiner {\kern 0em } - \definecommand unic@zerowidthnonjoiner {\hskip 0em } - - \definecommand unic@quotedblleftreversed {\mirror{\quotedblright}} - \definecommand unic@quoteleftreversed {\mirror{\quoteright}} - - \definecommand unic@onedotleader {{\periods[1]}} - \definecommand unic@twodotleader {{\periods[2]}} - \definecommand unic@hyphenationpoint {.\allowbreak } - - \definecommand unic@doubleexclamationmark {!!} - \definecommand unic@exclamationquestionmark {!?} - \definecommand unic@questionexclamationmark {?!} - \definecommand unic@doublequestionmark {??} - - \definecommand unic@reversedpilcrowsign {\mirror{\P}} - \definecommand unic@reversedsemicolon {\mirror{;}} - - \definecommand unic@superscriptzero {\high{0}} - \definecommand unic@superscripti {\high{i}} - \definecommand unic@superscriptfour {\high{4}} - \definecommand unic@superscriptfive {\high{5}} - \definecommand unic@superscriptsix {\high{6}} - \definecommand unic@superscriptseven {\high{7}} - \definecommand unic@superscripteight {\high{8}} - \definecommand unic@superscriptnine {\high{9}} - \definecommand unic@superscriptplus {\high{+}} - \definecommand unic@superscriptminus {\high{\textminus}} - \definecommand unic@superscriptequals {\high{=}} - \definecommand unic@superscriptleft {\high{(}} - \definecommand unic@superscriptright {\high{)}} - \definecommand unic@superscriptn {\high{n}} - \definecommand unic@subscriptzero {\low{0}} - \definecommand unic@subscriptone {\low{1}} - \definecommand unic@subscripttwo {\low{2}} - \definecommand unic@subscriptthree {\low{3}} - \definecommand unic@subscriptfour {\low{4}} - \definecommand unic@subscriptfive {\low{5}} - \definecommand unic@subscriptsix {\low{6}} - \definecommand unic@subscriptseven {\low{7}} - \definecommand unic@subscripteight {\low{8}} - \definecommand unic@subscriptnine {\low{9}} - \definecommand unic@subscriptplus {\low{+}} - \definecommand unic@subscriptminus {\low{\textminus}} - \definecommand unic@subscriptequals {\low{=}} - \definecommand unic@subscriptleft {\low{(}} - \definecommand unic@subscriptright {\low{)}} - \definecommand unic@subscripta {\low{a}} - \definecommand unic@subscripte {\low{e}} - \definecommand unic@subscripto {\low{o}} - \definecommand unic@subscriptx {\low{x}} - \definecommand unic@subscriptschwa {\low{\schwa}} - -\stopencoding - -\protect \endinput diff --git a/tex/context/base/enco-037.mkii b/tex/context/base/enco-037.mkii new file mode 100644 index 000000000..d9fc653b2 --- /dev/null +++ b/tex/context/base/enco-037.mkii @@ -0,0 +1,276 @@ +%D \module +%D [ file=enco-037, +%D version=2006.02.13, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Encoding for vector 37, +%D author=Luigi Scarso, +%D date=\currentdate, +%D copyright={PRAGMA}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startencoding[default] + +\definecharacter UnicodeLightHorizontal {\uchar{37}{000}} %%BOX DRAWINGS LIGHT HORIZONTAL +\definecharacter UnicodeHeavyHorizontal {\uchar{37}{001}} %%BOX DRAWINGS HEAVY HORIZONTAL +\definecharacter UnicodeLightVertical {\uchar{37}{002}} %%BOX DRAWINGS LIGHT VERTICAL +\definecharacter UnicodeHeavyVertical {\uchar{37}{003}} %%BOX DRAWINGS HEAVY VERTICAL +\definecharacter UnicodeLightTripleDashHorizontal {\uchar{37}{004}} %%BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL +\definecharacter UnicodeHeavyTripleDashHorizontal {\uchar{37}{005}} %%BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL +\definecharacter UnicodeLightTripleDashVertical {\uchar{37}{006}} %%BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL +\definecharacter UnicodeHeavyTripleDashVertical {\uchar{37}{007}} %%BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL +\definecharacter UnicodeLightQuadrupleDashHorizontal {\uchar{37}{008}} %%BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL +\definecharacter UnicodeHeavyQuadrupleDashHorizontal {\uchar{37}{009}} %%BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL +\definecharacter UnicodeLightQuadrupleDashVertical {\uchar{37}{010}} %%BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL +\definecharacter UnicodeHeavyQuadrupleDashVertical {\uchar{37}{011}} %%BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL +\definecharacter UnicodeLightDownAndRight {\uchar{37}{012}} %%BOX DRAWINGS LIGHT DOWN AND RIGHT +\definecharacter UnicodeDownLightAndRightHeavy {\uchar{37}{013}} %%BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY +\definecharacter UnicodeDownHeavyAndRightLight {\uchar{37}{014}} %%BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT +\definecharacter UnicodeHeavyDownAndRight {\uchar{37}{015}} %%BOX DRAWINGS HEAVY DOWN AND RIGHT +\definecharacter UnicodeLightDownAndLeft {\uchar{37}{016}} %%BOX DRAWINGS LIGHT DOWN AND LEFT +\definecharacter UnicodeDownLightAndLeftHeavy {\uchar{37}{017}} %%BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY +\definecharacter UnicodeDownHeavyAndLeftLight {\uchar{37}{018}} %%BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT +\definecharacter UnicodeHeavyDownAndLeft {\uchar{37}{019}} %%BOX DRAWINGS HEAVY DOWN AND LEFT +\definecharacter UnicodeLightUpAndRight {\uchar{37}{020}} %%BOX DRAWINGS LIGHT UP AND RIGHT +\definecharacter UnicodeUpLightAndRightHeavy {\uchar{37}{021}} %%BOX DRAWINGS UP LIGHT AND RIGHT HEAVY +\definecharacter UnicodeUpHeavyAndRightLight {\uchar{37}{022}} %%BOX DRAWINGS UP HEAVY AND RIGHT LIGHT +\definecharacter UnicodeHeavyUpAndRight {\uchar{37}{023}} %%BOX DRAWINGS HEAVY UP AND RIGHT +\definecharacter UnicodeLightUpAndLeft {\uchar{37}{024}} %%BOX DRAWINGS LIGHT UP AND LEFT +\definecharacter UnicodeUpLightAndLeftHeavy {\uchar{37}{025}} %%BOX DRAWINGS UP LIGHT AND LEFT HEAVY +\definecharacter UnicodeUpHeavyAndLeftLight {\uchar{37}{026}} %%BOX DRAWINGS UP HEAVY AND LEFT LIGHT +\definecharacter UnicodeHeavyUpAndLeft {\uchar{37}{027}} %%BOX DRAWINGS HEAVY UP AND LEFT +\definecharacter UnicodeLightVerticalAndRight {\uchar{37}{028}} %%BOX DRAWINGS LIGHT VERTICAL AND RIGHT +\definecharacter UnicodeVerticalLightAndRightHeavy {\uchar{37}{029}} %%BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY +\definecharacter UnicodeUpHeavyAndRightDownLight {\uchar{37}{030}} %%BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT +\definecharacter UnicodeDownHeavyAndRightUpLight {\uchar{37}{031}} %%BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT +\definecharacter UnicodeVerticalHeavyAndRightLight {\uchar{37}{032}} %%BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT +\definecharacter UnicodeDownLightAndRightUpHeavy {\uchar{37}{033}} %%BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY +\definecharacter UnicodeUpLightAndRightDownHeavy {\uchar{37}{034}} %%BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY +\definecharacter UnicodeHeavyVerticalAndRight {\uchar{37}{035}} %%BOX DRAWINGS HEAVY VERTICAL AND RIGHT +\definecharacter UnicodeLightVerticalAndLeft {\uchar{37}{036}} %%BOX DRAWINGS LIGHT VERTICAL AND LEFT +\definecharacter UnicodeVerticalLightAndLeftHeavy {\uchar{37}{037}} %%BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY +\definecharacter UnicodeUpHeavyAndLeftDownLight {\uchar{37}{038}} %%BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT +\definecharacter UnicodeDownHeavyAndLeftUpLight {\uchar{37}{039}} %%BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT +\definecharacter UnicodeVerticalHeavyAndLeftLight {\uchar{37}{040}} %%BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT +\definecharacter UnicodeDownLightAndLeftUpHeavy {\uchar{37}{041}} %%BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY +\definecharacter UnicodeUpLightAndLeftDownHeavy {\uchar{37}{042}} %%BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY +\definecharacter UnicodeHeavyVerticalAndLeft {\uchar{37}{043}} %%BOX DRAWINGS HEAVY VERTICAL AND LEFT +\definecharacter UnicodeLightDownAndHorizontal {\uchar{37}{044}} %%BOX DRAWINGS LIGHT DOWN AND HORIZONTAL +\definecharacter UnicodeLeftHeavyAndRightDownLight {\uchar{37}{045}} %%BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT +\definecharacter UnicodeRightHeavyAndLeftDownLight {\uchar{37}{046}} %%BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT +\definecharacter UnicodeDownLightAndHorizontalHeavy {\uchar{37}{047}} %%BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY +\definecharacter UnicodeDownHeavyAndHorizontalLight {\uchar{37}{048}} %%BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT +\definecharacter UnicodeRightLightAndLeftDownHeavy {\uchar{37}{049}} %%BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY +\definecharacter UnicodeLeftLightAndRightDownHeavy {\uchar{37}{050}} %%BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY +\definecharacter UnicodeHeavyDownAndHorizontal {\uchar{37}{051}} %%BOX DRAWINGS HEAVY DOWN AND HORIZONTAL +\definecharacter UnicodeLightUpAndHorizontal {\uchar{37}{052}} %%BOX DRAWINGS LIGHT UP AND HORIZONTAL +\definecharacter UnicodeLeftHeavyAndRightUpLight {\uchar{37}{053}} %%BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT +\definecharacter UnicodeRightHeavyAndLeftUpLight {\uchar{37}{054}} %%BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT +\definecharacter UnicodeUpLightAndHorizontalHeavy {\uchar{37}{055}} %%BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY +\definecharacter UnicodeUpHeavyAndHorizontalLight {\uchar{37}{056}} %%BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT +\definecharacter UnicodeRightLightAndLeftUpHeavy {\uchar{37}{057}} %%BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY +\definecharacter UnicodeLeftLightAndRightUpHeavy {\uchar{37}{058}} %%BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY +\definecharacter UnicodeHeavyUpAndHorizontal {\uchar{37}{059}} %%BOX DRAWINGS HEAVY UP AND HORIZONTAL +\definecharacter UnicodeLightVerticalAndHorizontal {\uchar{37}{060}} %%BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL +\definecharacter UnicodeLeftHeavyAndRightVerticalLight {\uchar{37}{061}} %%BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT +\definecharacter UnicodeRightHeavyAndLeftVerticalLight {\uchar{37}{062}} %%BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT +\definecharacter UnicodeVerticalLightAndHorizontalHeavy {\uchar{37}{063}} %%BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY +\definecharacter UnicodeUpHeavyAndDownHorizontalLight {\uchar{37}{064}} %%BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT +\definecharacter UnicodeDownHeavyAndUpHorizontalLight {\uchar{37}{065}} %%BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT +\definecharacter UnicodeVerticalHeavyAndHorizontalLight {\uchar{37}{066}} %%BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT +\definecharacter UnicodeLeftUpHeavyAndRightDownLight {\uchar{37}{067}} %%BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT +\definecharacter UnicodeRightUpHeavyAndLeftDownLight {\uchar{37}{068}} %%BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT +\definecharacter UnicodeLeftDownHeavyAndRightUpLight {\uchar{37}{069}} %%BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT +\definecharacter UnicodeRightDownHeavyAndLeftUpLight {\uchar{37}{070}} %%BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT +\definecharacter UnicodeDownLightAndUpHorizontalHeavy {\uchar{37}{071}} %%BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY +\definecharacter UnicodeUpLightAndDownHorizontalHeavy {\uchar{37}{072}} %%BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY +\definecharacter UnicodeRightLightAndLeftVerticalHeavy {\uchar{37}{073}} %%BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY +\definecharacter UnicodeLeftLightAndRightVerticalHeavy {\uchar{37}{074}} %%BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY +\definecharacter UnicodeHeavyVerticalAndHorizontal {\uchar{37}{075}} %%BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL +\definecharacter UnicodeLightDoubleDashHorizontal {\uchar{37}{076}} %%BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL +\definecharacter UnicodeHeavyDoubleDashHorizontal {\uchar{37}{077}} %%BOX DRAWINGS HEAVY DOUBLE DASH HORIZONTAL +\definecharacter UnicodeLightDoubleDashVertical {\uchar{37}{078}} %%BOX DRAWINGS LIGHT DOUBLE DASH VERTICAL +\definecharacter UnicodeHeavyDoubleDashVertical {\uchar{37}{079}} %%BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL +\definecharacter UnicodeDoubleHorizontal {\uchar{37}{080}} %%BOX DRAWINGS DOUBLE HORIZONTAL +\definecharacter UnicodeDoubleVertical {\uchar{37}{081}} %%BOX DRAWINGS DOUBLE VERTICAL +\definecharacter UnicodeDownSingleAndRightDouble {\uchar{37}{082}} %%BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE +\definecharacter UnicodeDownDoubleAndRightSingle {\uchar{37}{083}} %%BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE +\definecharacter UnicodeDoubleDownAndRight {\uchar{37}{084}} %%BOX DRAWINGS DOUBLE DOWN AND RIGHT +\definecharacter UnicodeDownSingleAndLeftDouble {\uchar{37}{085}} %%BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE +\definecharacter UnicodeDownDoubleAndLeftSingle {\uchar{37}{086}} %%BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE +\definecharacter UnicodeDoubleDownAndLeft {\uchar{37}{087}} %%BOX DRAWINGS DOUBLE DOWN AND LEFT +\definecharacter UnicodeUpSingleAndRightDouble {\uchar{37}{088}} %%BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE +\definecharacter UnicodeUpDoubleAndRightSingle {\uchar{37}{089}} %%BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE +\definecharacter UnicodeDoubleUpAndRight {\uchar{37}{090}} %%BOX DRAWINGS DOUBLE UP AND RIGHT +\definecharacter UnicodeUpSingleAndLeftDouble {\uchar{37}{091}} %%BOX DRAWINGS UP SINGLE AND LEFT DOUBLE +\definecharacter UnicodeUpDoubleAndLeftSingle {\uchar{37}{092}} %%BOX DRAWINGS UP DOUBLE AND LEFT SINGLE +\definecharacter UnicodeDoubleUpAndLeft {\uchar{37}{093}} %%BOX DRAWINGS DOUBLE UP AND LEFT +\definecharacter UnicodeVerticalSingleAndRightDouble {\uchar{37}{094}} %%BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE +\definecharacter UnicodeVerticalDoubleAndRightSingle {\uchar{37}{095}} %%BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE +\definecharacter UnicodeDoubleVerticalAndRight {\uchar{37}{096}} %%BOX DRAWINGS DOUBLE VERTICAL AND RIGHT +\definecharacter UnicodeVerticalSingleAndLeftDouble {\uchar{37}{097}} %%BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE +\definecharacter UnicodeVerticalDoubleAndLeftSingle {\uchar{37}{098}} %%BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE +\definecharacter UnicodeDoubleVerticalAndLeft {\uchar{37}{099}} %%BOX DRAWINGS DOUBLE VERTICAL AND LEFT +\definecharacter UnicodeDownSingleAndHorizontalDouble {\uchar{37}{100}} %%BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE +\definecharacter UnicodeDownDoubleAndHorizontalSingle {\uchar{37}{101}} %%BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE +\definecharacter UnicodeDoubleDownAndHorizontal {\uchar{37}{102}} %%BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL +\definecharacter UnicodeUpSingleAndHorizontalDouble {\uchar{37}{103}} %%BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE +\definecharacter UnicodeUpDoubleAndHorizontalSingle {\uchar{37}{104}} %%BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE +\definecharacter UnicodeDoubleUpAndHorizontal {\uchar{37}{105}} %%BOX DRAWINGS DOUBLE UP AND HORIZONTAL +\definecharacter UnicodeVerticalSingleAndHorizontalDouble {\uchar{37}{106}} %%BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE +\definecharacter UnicodeVerticalDoubleAndHorizontalSingle {\uchar{37}{107}} %%BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE +\definecharacter UnicodeDoubleVerticalAndHorizontal {\uchar{37}{108}} %%BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL +\definecharacter UnicodeLightArcDownAndRight {\uchar{37}{109}} %%BOX DRAWINGS LIGHT ARC DOWN AND RIGHT +\definecharacter UnicodeLightArcDownAndLeft {\uchar{37}{110}} %%BOX DRAWINGS LIGHT ARC DOWN AND LEFT +\definecharacter UnicodeLightArcUpAndLeft {\uchar{37}{111}} %%BOX DRAWINGS LIGHT ARC UP AND LEFT +\definecharacter UnicodeLightArcUpAndRight {\uchar{37}{112}} %%BOX DRAWINGS LIGHT ARC UP AND RIGHT +\definecharacter UnicodeLightDiagonalUpperRightToLowerLeft {\uchar{37}{113}} %%BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT +\definecharacter UnicodeLightDiagonalUpperLeftToLowerRight {\uchar{37}{114}} %%BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT +\definecharacter UnicodeLightDiagonalCross {\uchar{37}{115}} %%BOX DRAWINGS LIGHT DIAGONAL CROSS +\definecharacter UnicodeLightLeft {\uchar{37}{116}} %%BOX DRAWINGS LIGHT LEFT +\definecharacter UnicodeLightUp {\uchar{37}{117}} %%BOX DRAWINGS LIGHT UP +\definecharacter UnicodeLightRight {\uchar{37}{118}} %%BOX DRAWINGS LIGHT RIGHT +\definecharacter UnicodeLightDown {\uchar{37}{119}} %%BOX DRAWINGS LIGHT DOWN +\definecharacter UnicodeHeavyLeft {\uchar{37}{120}} %%BOX DRAWINGS HEAVY LEFT +\definecharacter UnicodeHeavyUp {\uchar{37}{121}} %%BOX DRAWINGS HEAVY UP +\definecharacter UnicodeHeavyRight {\uchar{37}{122}} %%BOX DRAWINGS HEAVY RIGHT +\definecharacter UnicodeHeavyDown {\uchar{37}{123}} %%BOX DRAWINGS HEAVY DOWN +\definecharacter UnicodeLightLeftAndHeavyRight {\uchar{37}{124}} %%BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT +\definecharacter UnicodeLightUpAndHeavyDown {\uchar{37}{125}} %%BOX DRAWINGS LIGHT UP AND HEAVY DOWN +\definecharacter UnicodeHeavyLeftAndLightRight {\uchar{37}{126}} %%BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT +\definecharacter UnicodeHeavyUpAndLightDown {\uchar{37}{127}} %%BOX DRAWINGS HEAVY UP AND LIGHT DOWN +\definecharacter UnicodeUpperHalfBlock {\uchar{37}{128}} %%UPPER HALF BLOCK +\definecharacter UnicodeLowerOneEighthBlock {\uchar{37}{129}} %%LOWER ONE EIGHTH BLOCK +\definecharacter UnicodeLowerOneQuarterBlock {\uchar{37}{130}} %%LOWER ONE QUARTER BLOCK +\definecharacter UnicodeLowerThreeEighthsBlock {\uchar{37}{131}} %%LOWER THREE EIGHTHS BLOCK +\definecharacter UnicodeLowerHalfBlock {\uchar{37}{132}} %%LOWER HALF BLOCK +\definecharacter UnicodeLowerFiveEighthsBlock {\uchar{37}{133}} %%LOWER FIVE EIGHTHS BLOCK +\definecharacter UnicodeLowerThreeQuartersBlock {\uchar{37}{134}} %%LOWER THREE QUARTERS BLOCK +\definecharacter UnicodeLowerSevenEighthsBlock {\uchar{37}{135}} %%LOWER SEVEN EIGHTHS BLOCK +\definecharacter UnicodeFullBlock {\uchar{37}{136}} %%FULL BLOCK +\definecharacter UnicodeLeftSevenEighthsBlock {\uchar{37}{137}} %%LEFT SEVEN EIGHTHS BLOCK +\definecharacter UnicodeLeftThreeQuartersBlock {\uchar{37}{138}} %%LEFT THREE QUARTERS BLOCK +\definecharacter UnicodeLeftFiveEighthsBlock {\uchar{37}{139}} %%LEFT FIVE EIGHTHS BLOCK +\definecharacter UnicodeLeftHalfBlock {\uchar{37}{140}} %%LEFT HALF BLOCK +\definecharacter UnicodeLeftThreeEighthsBlock {\uchar{37}{141}} %%LEFT THREE EIGHTHS BLOCK +\definecharacter UnicodeLeftOneQuarterBlock {\uchar{37}{142}} %%LEFT ONE QUARTER BLOCK +\definecharacter UnicodeLeftOneEighthBlock {\uchar{37}{143}} %%LEFT ONE EIGHTH BLOCK +\definecharacter UnicodeRightHalfBlock {\uchar{37}{144}} %%RIGHT HALF BLOCK +\definecharacter UnicodeLightShade {\uchar{37}{145}} %%LIGHT SHADE +\definecharacter UnicodeMediumShade {\uchar{37}{146}} %%MEDIUM SHADE +\definecharacter UnicodeDarkShade {\uchar{37}{147}} %%DARK SHADE +\definecharacter UnicodeUpperOneEighthBlock {\uchar{37}{148}} %%UPPER ONE EIGHTH BLOCK +\definecharacter UnicodeRightOneEighthBlock {\uchar{37}{149}} %%RIGHT ONE EIGHTH BLOCK +\definecharacter UnicodeQuadrantLowerLeft {\uchar{37}{150}} %%[Unassigned U+2596] +\definecharacter UnicodeQuadrantLowerRight {\uchar{37}{151}} %%[Unassigned U+2597] +\definecharacter UnicodeQuadrantUpperLeft {\uchar{37}{152}} %%[Unassigned U+2598] +\definecharacter UnicodeQuadrantUpperLeftAndLowerLeftAndLowerRight {\uchar{37}{153}} %%[Unassigned U+2599] +\definecharacter UnicodeQuadrantUpperLeftAndLowerRight {\uchar{37}{154}} %%[Unassigned U+259A] +\definecharacter UnicodeQuadrantUpperLeftAndUpperRightandLowerLeft {\uchar{37}{155}} %%[Unassigned U+259B] +\definecharacter UnicodeQuadrantUpperLeftAndUpperRightAndLowerRight {\uchar{37}{156}} %%[Unassigned U+259C] +\definecharacter UnicodeQuadrantUpperRight {\uchar{37}{157}} %%[Unassigned U+259D] +\definecharacter UnicodeQuadrantUpperRightAndLowerLeft {\uchar{37}{158}} %%[Unassigned U+259E] +\definecharacter UnicodeQuadrantUpperRightAndLowerLeftAndLowerRight {\uchar{37}{159}} %%[Unassigned U+259F] +\definecharacter UnicodeBlackSquare {\uchar{37}{160}} %%BLACK SQUARE +\definecharacter UnicodeWhiteSquare {\uchar{37}{161}} %%WHITE SQUARE +\definecharacter UnicodeWhiteSquareWithRoundedCorners {\uchar{37}{162}} %%WHITE SQUARE WITH ROUNDED CORNERS +\definecharacter UnicodeWhiteSquareContainingBlackSmallSquare {\uchar{37}{163}} %%WHITE SQUARE CONTAINING BLACK SMALL SQUARE +\definecharacter UnicodeSquareWithHorizontalFill {\uchar{37}{164}} %%SQUARE WITH HORIZONTAL FILL +\definecharacter UnicodeSquareWithVerticalFill {\uchar{37}{165}} %%SQUARE WITH VERTICAL FILL +\definecharacter UnicodeSquareWithOrthogonalCrosshatchFill {\uchar{37}{166}} %%SQUARE WITH ORTHOGONAL CROSSHATCH FILL +\definecharacter UnicodeSquareWithUpperLeftToLowerRightFill {\uchar{37}{167}} %%SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL +\definecharacter UnicodeSquareWithUpperRightToLowerLeftFill {\uchar{37}{168}} %%SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL +\definecharacter UnicodeSquareWithDiagonalCrosshatchFill {\uchar{37}{169}} %%SQUARE WITH DIAGONAL CROSSHATCH FILL +\definecharacter UnicodeBlackSmallSquare {\uchar{37}{170}} %%BLACK SMALL SQUARE +\definecharacter UnicodeWhiteSmallSquare {\uchar{37}{171}} %%WHITE SMALL SQUARE +\definecharacter UnicodeBlackRectangle {\uchar{37}{172}} %%BLACK RECTANGLE +\definecharacter UnicodeWhiteRectangle {\uchar{37}{173}} %%WHITE RECTANGLE +\definecharacter UnicodeBlackVerticalRectangle {\uchar{37}{174}} %%BLACK VERTICAL RECTANGLE +\definecharacter UnicodeWhiteVerticalRectangle {\uchar{37}{175}} %%WHITE VERTICAL RECTANGLE +\definecharacter UnicodeBlackParallelogram {\uchar{37}{176}} %%BLACK PARALLELOGRAM +\definecharacter UnicodeWhiteParallelogram {\uchar{37}{177}} %%WHITE PARALLELOGRAM +\definecharacter UnicodeBlackUpPointingTriangle {\uchar{37}{178}} %%BLACK UP-POINTING TRIANGLE +\definecharacter UnicodeWhiteUpPointingTriangle {\uchar{37}{179}} %%WHITE UP-POINTING TRIANGLE +\definecharacter UnicodeBlackUpPointingSmallTriangle {\uchar{37}{180}} %%BLACK UP-POINTING SMALL TRIANGLE +\definecharacter UnicodeWhiteUpPointingSmallTriangle {\uchar{37}{181}} %%WHITE UP-POINTING SMALL TRIANGLE +\definecharacter UnicodeBlackRightPointingTriangle {\uchar{37}{182}} %%BLACK RIGHT-POINTING TRIANGLE +\definecharacter UnicodeWhiteRightPointingTriangle {\uchar{37}{183}} %%WHITE RIGHT-POINTING TRIANGLE +\definecharacter UnicodeBlackRightPointingSmallTriangle {\uchar{37}{184}} %%BLACK RIGHT-POINTING SMALL TRIANGLE +\definecharacter UnicodeWhiteRightPointingSmallTriangle {\uchar{37}{185}} %%WHITE RIGHT-POINTING SMALL TRIANGLE +\definecharacter UnicodeBlackRightPointingPointer {\uchar{37}{186}} %%BLACK RIGHT-POINTING POINTER +\definecharacter UnicodeWhiteRightPointingPointer {\uchar{37}{187}} %%WHITE RIGHT-POINTING POINTER +\definecharacter UnicodeBlackDownPointingTriangle {\uchar{37}{188}} %%BLACK DOWN-POINTING TRIANGLE +\definecharacter UnicodeWhiteDownPointingTriangle {\uchar{37}{189}} %%WHITE DOWN-POINTING TRIANGLE +\definecharacter UnicodeBlackDownPointingSmallTriangle {\uchar{37}{190}} %%BLACK DOWN-POINTING SMALL TRIANGLE +\definecharacter UnicodeWhiteDownPointingSmallTriangle {\uchar{37}{191}} %%WHITE DOWN-POINTING SMALL TRIANGLE +\definecharacter UnicodeBlackLeftPointingTriangle {\uchar{37}{192}} %%BLACK LEFT-POINTING TRIANGLE +\definecharacter UnicodeWhiteLeftPointingTriangle {\uchar{37}{193}} %%WHITE LEFT-POINTING TRIANGLE +\definecharacter UnicodeBlackLeftPointingSmallTriangle {\uchar{37}{194}} %%BLACK LEFT-POINTING SMALL TRIANGLE +\definecharacter UnicodeWhiteLeftPointingSmallTriangle {\uchar{37}{195}} %%WHITE LEFT-POINTING SMALL TRIANGLE +\definecharacter UnicodeBlackLeftPointingPointer {\uchar{37}{196}} %%BLACK LEFT-POINTING POINTER +\definecharacter UnicodeWhiteLeftPointingPointer {\uchar{37}{197}} %%WHITE LEFT-POINTING POINTER +\definecharacter UnicodeBlackDiamond {\uchar{37}{198}} %%BLACK DIAMOND +\definecharacter UnicodeWhiteDiamond {\uchar{37}{199}} %%WHITE DIAMOND +\definecharacter UnicodeWhiteDiamondContainingBlackSmallDiamond {\uchar{37}{200}} %%WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND +\definecharacter UnicodeFisheye {\uchar{37}{201}} %%FISHEYE +\definecharacter UnicodeLozenge {\uchar{37}{202}} %%LOZENGE +\definecharacter UnicodeWhiteCircle {\uchar{37}{203}} %%WHITE CIRCLE +\definecharacter UnicodeDottedCircle {\uchar{37}{204}} %%DOTTED CIRCLE +\definecharacter UnicodeCircleWithVerticalFill {\uchar{37}{205}} %%CIRCLE WITH VERTICAL FILL +\definecharacter UnicodeBullseye {\uchar{37}{206}} %%BULLSEYE +\definecharacter UnicodeBlackCircle {\uchar{37}{207}} %%BLACK CIRCLE +\definecharacter UnicodeCircleWithLeftHalfBlack {\uchar{37}{208}} %%CIRCLE WITH LEFT HALF BLACK +\definecharacter UnicodeCircleWithRightHalfBlack {\uchar{37}{209}} %%CIRCLE WITH RIGHT HALF BLACK +\definecharacter UnicodeCircleWithLowerHalfBlack {\uchar{37}{210}} %%CIRCLE WITH LOWER HALF BLACK +\definecharacter UnicodeCircleWithUpperHalfBlack {\uchar{37}{211}} %%CIRCLE WITH UPPER HALF BLACK +\definecharacter UnicodeCircleWithUpperRightQuadrantBlack {\uchar{37}{212}} %%CIRCLE WITH UPPER RIGHT QUADRANT BLACK +\definecharacter UnicodeCircleWithAllButUpperLeftQuadrantBlack {\uchar{37}{213}} %%CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK +\definecharacter UnicodeLeftHalfBlackCircle {\uchar{37}{214}} %%LEFT HALF BLACK CIRCLE +\definecharacter UnicodeRightHalfBlackCircle {\uchar{37}{215}} %%RIGHT HALF BLACK CIRCLE +\definecharacter UnicodeInverseBullet {\uchar{37}{216}} %%INVERSE BULLET +\definecharacter UnicodeInverseWhiteCircle {\uchar{37}{217}} %%INVERSE WHITE CIRCLE +\definecharacter UnicodeUpperHalfInverseWhiteCircle {\uchar{37}{218}} %%UPPER HALF INVERSE WHITE CIRCLE +\definecharacter UnicodeLowerHalfInverseWhiteCircle {\uchar{37}{219}} %%LOWER HALF INVERSE WHITE CIRCLE +\definecharacter UnicodeUpperLeftQuadrantCircularArc {\uchar{37}{220}} %%UPPER LEFT QUADRANT CIRCULAR ARC +\definecharacter UnicodeUpperRightQuadrantCircularArc {\uchar{37}{221}} %%UPPER RIGHT QUADRANT CIRCULAR ARC +\definecharacter UnicodeLowerRightQuadrantCircularArc {\uchar{37}{222}} %%LOWER RIGHT QUADRANT CIRCULAR ARC +\definecharacter UnicodeLowerLeftQuadrantCircularArc {\uchar{37}{223}} %%LOWER LEFT QUADRANT CIRCULAR ARC +\definecharacter UnicodeUpperHalfCircle {\uchar{37}{224}} %%UPPER HALF CIRCLE +\definecharacter UnicodeLowerHalfCircle {\uchar{37}{225}} %%LOWER HALF CIRCLE +\definecharacter UnicodeBlackLowerRightTriangle {\uchar{37}{226}} %%BLACK LOWER RIGHT TRIANGLE +\definecharacter UnicodeBlackLowerLeftTriangle {\uchar{37}{227}} %%BLACK LOWER LEFT TRIANGLE +\definecharacter UnicodeBlackUpperLeftTriangle {\uchar{37}{228}} %%BLACK UPPER LEFT TRIANGLE +\definecharacter UnicodeBlackUpperRightTriangle {\uchar{37}{229}} %%BLACK UPPER RIGHT TRIANGLE +\definecharacter UnicodeWhiteBullet {\uchar{37}{230}} %%WHITE BULLET +\definecharacter UnicodeSquareWithLeftHalfBlack {\uchar{37}{231}} %%SQUARE WITH LEFT HALF BLACK +\definecharacter UnicodeSquareWithRightHalfBlack {\uchar{37}{232}} %%SQUARE WITH RIGHT HALF BLACK +\definecharacter UnicodeSquareWithUpperLeftDiagonalHalfBlack {\uchar{37}{233}} %%SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK +\definecharacter UnicodeSquareWithLowerRightDiagonalHalfBlack {\uchar{37}{234}} %%SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK +\definecharacter UnicodeWhiteSquareWithVerticalBisectingLine {\uchar{37}{235}} %%WHITE SQUARE WITH VERTICAL BISECTING LINE +\definecharacter UnicodeWhiteUpPointingTriangleWithDot {\uchar{37}{236}} %%WHITE UP-POINTING TRIANGLE WITH DOT +\definecharacter UnicodeUpPointingTriangleWithLeftHalfBlack {\uchar{37}{237}} %%UP-POINTING TRIANGLE WITH LEFT HALF BLACK +\definecharacter UnicodeUpPointingTriangleWithRightHalfBlack {\uchar{37}{238}} %%UP-POINTING TRIANGLE WITH RIGHT HALF BLACK +\definecharacter UnicodeLargeCircle {\uchar{37}{239}} %%LARGE CIRCLE +\definecharacter UnicodeWhiteSquareWithUpperLeftQuadrant {\uchar{37}{240}} %%WHITE SQUARE WITH UPPER LEFT QUADRANT +\definecharacter UnicodeWhiteSquareWithLowerLeftQuadrant {\uchar{37}{241}} %%WHITE SQUARE WITH LOWER LEFT QUADRANT +\definecharacter UnicodeWhiteSquareWithLowerRightQuadrant {\uchar{37}{242}} %%WHITE SQUARE WITH LOWER RIGHT QUADRANT +\definecharacter UnicodeWhiteSquareWithUpperRightQuadrant {\uchar{37}{243}} %%WHITE SQUARE WITH UPPER RIGHT QUADRANT +\definecharacter UnicodeWhiteCircleWithUpperLeftQuadrant {\uchar{37}{244}} %%WHITE CIRCLE WITH UPPER LEFT QUADRANT +\definecharacter UnicodeWhiteCircleWithLowerLeftQuadrant {\uchar{37}{245}} %%WHITE CIRCLE WITH LOWER LEFT QUADRANT +\definecharacter UnicodeWhiteCircleWithLowerRightQuadrant {\uchar{37}{246}} %%WHITE CIRCLE WITH LOWER RIGHT QUADRANT +\definecharacter UnicodeWhiteCircleWithUpperRightQuadrant {\uchar{37}{247}} %%WHITE CIRCLE WITH UPPER RIGHT QUADRANT +\definecharacter UnicodeUpperLeftTriangle {\uchar{37}{248}} %%[Unassigned U+25F8] +\definecharacter UnicodeUpperRightTriangle {\uchar{37}{249}} %%[Unassigned U+25F9] +\definecharacter UnicodeLowerLeftTriangle {\uchar{37}{250}} %%[Unassigned U+25FA] +\definecharacter UnicodeWhiteMediumSquare {\uchar{37}{251}} %%[Unassigned U+25FB] +\definecharacter UnicodeBlackMediumSquare {\uchar{37}{252}} %%[Unassigned U+25FC] +\definecharacter UnicodeWhiteMediumSmallSquare {\uchar{37}{253}} %%[Unassigned U+25FD] +\definecharacter UnicodeBlackMediumSmallSquare {\uchar{37}{254}} %%[Unassigned U+25FE] +\definecharacter UnicodeLowerRightTriangle {\uchar{37}{255}} %%[Unassigned U+25FF] + +\stopencoding + +\endinput + diff --git a/tex/context/base/enco-037.tex b/tex/context/base/enco-037.tex deleted file mode 100644 index d9fc653b2..000000000 --- a/tex/context/base/enco-037.tex +++ /dev/null @@ -1,276 +0,0 @@ -%D \module -%D [ file=enco-037, -%D version=2006.02.13, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Encoding for vector 37, -%D author=Luigi Scarso, -%D date=\currentdate, -%D copyright={PRAGMA}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startencoding[default] - -\definecharacter UnicodeLightHorizontal {\uchar{37}{000}} %%BOX DRAWINGS LIGHT HORIZONTAL -\definecharacter UnicodeHeavyHorizontal {\uchar{37}{001}} %%BOX DRAWINGS HEAVY HORIZONTAL -\definecharacter UnicodeLightVertical {\uchar{37}{002}} %%BOX DRAWINGS LIGHT VERTICAL -\definecharacter UnicodeHeavyVertical {\uchar{37}{003}} %%BOX DRAWINGS HEAVY VERTICAL -\definecharacter UnicodeLightTripleDashHorizontal {\uchar{37}{004}} %%BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL -\definecharacter UnicodeHeavyTripleDashHorizontal {\uchar{37}{005}} %%BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL -\definecharacter UnicodeLightTripleDashVertical {\uchar{37}{006}} %%BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL -\definecharacter UnicodeHeavyTripleDashVertical {\uchar{37}{007}} %%BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL -\definecharacter UnicodeLightQuadrupleDashHorizontal {\uchar{37}{008}} %%BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL -\definecharacter UnicodeHeavyQuadrupleDashHorizontal {\uchar{37}{009}} %%BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL -\definecharacter UnicodeLightQuadrupleDashVertical {\uchar{37}{010}} %%BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL -\definecharacter UnicodeHeavyQuadrupleDashVertical {\uchar{37}{011}} %%BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL -\definecharacter UnicodeLightDownAndRight {\uchar{37}{012}} %%BOX DRAWINGS LIGHT DOWN AND RIGHT -\definecharacter UnicodeDownLightAndRightHeavy {\uchar{37}{013}} %%BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY -\definecharacter UnicodeDownHeavyAndRightLight {\uchar{37}{014}} %%BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT -\definecharacter UnicodeHeavyDownAndRight {\uchar{37}{015}} %%BOX DRAWINGS HEAVY DOWN AND RIGHT -\definecharacter UnicodeLightDownAndLeft {\uchar{37}{016}} %%BOX DRAWINGS LIGHT DOWN AND LEFT -\definecharacter UnicodeDownLightAndLeftHeavy {\uchar{37}{017}} %%BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY -\definecharacter UnicodeDownHeavyAndLeftLight {\uchar{37}{018}} %%BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT -\definecharacter UnicodeHeavyDownAndLeft {\uchar{37}{019}} %%BOX DRAWINGS HEAVY DOWN AND LEFT -\definecharacter UnicodeLightUpAndRight {\uchar{37}{020}} %%BOX DRAWINGS LIGHT UP AND RIGHT -\definecharacter UnicodeUpLightAndRightHeavy {\uchar{37}{021}} %%BOX DRAWINGS UP LIGHT AND RIGHT HEAVY -\definecharacter UnicodeUpHeavyAndRightLight {\uchar{37}{022}} %%BOX DRAWINGS UP HEAVY AND RIGHT LIGHT -\definecharacter UnicodeHeavyUpAndRight {\uchar{37}{023}} %%BOX DRAWINGS HEAVY UP AND RIGHT -\definecharacter UnicodeLightUpAndLeft {\uchar{37}{024}} %%BOX DRAWINGS LIGHT UP AND LEFT -\definecharacter UnicodeUpLightAndLeftHeavy {\uchar{37}{025}} %%BOX DRAWINGS UP LIGHT AND LEFT HEAVY -\definecharacter UnicodeUpHeavyAndLeftLight {\uchar{37}{026}} %%BOX DRAWINGS UP HEAVY AND LEFT LIGHT -\definecharacter UnicodeHeavyUpAndLeft {\uchar{37}{027}} %%BOX DRAWINGS HEAVY UP AND LEFT -\definecharacter UnicodeLightVerticalAndRight {\uchar{37}{028}} %%BOX DRAWINGS LIGHT VERTICAL AND RIGHT -\definecharacter UnicodeVerticalLightAndRightHeavy {\uchar{37}{029}} %%BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY -\definecharacter UnicodeUpHeavyAndRightDownLight {\uchar{37}{030}} %%BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT -\definecharacter UnicodeDownHeavyAndRightUpLight {\uchar{37}{031}} %%BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT -\definecharacter UnicodeVerticalHeavyAndRightLight {\uchar{37}{032}} %%BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT -\definecharacter UnicodeDownLightAndRightUpHeavy {\uchar{37}{033}} %%BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY -\definecharacter UnicodeUpLightAndRightDownHeavy {\uchar{37}{034}} %%BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY -\definecharacter UnicodeHeavyVerticalAndRight {\uchar{37}{035}} %%BOX DRAWINGS HEAVY VERTICAL AND RIGHT -\definecharacter UnicodeLightVerticalAndLeft {\uchar{37}{036}} %%BOX DRAWINGS LIGHT VERTICAL AND LEFT -\definecharacter UnicodeVerticalLightAndLeftHeavy {\uchar{37}{037}} %%BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY -\definecharacter UnicodeUpHeavyAndLeftDownLight {\uchar{37}{038}} %%BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT -\definecharacter UnicodeDownHeavyAndLeftUpLight {\uchar{37}{039}} %%BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT -\definecharacter UnicodeVerticalHeavyAndLeftLight {\uchar{37}{040}} %%BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT -\definecharacter UnicodeDownLightAndLeftUpHeavy {\uchar{37}{041}} %%BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY -\definecharacter UnicodeUpLightAndLeftDownHeavy {\uchar{37}{042}} %%BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY -\definecharacter UnicodeHeavyVerticalAndLeft {\uchar{37}{043}} %%BOX DRAWINGS HEAVY VERTICAL AND LEFT -\definecharacter UnicodeLightDownAndHorizontal {\uchar{37}{044}} %%BOX DRAWINGS LIGHT DOWN AND HORIZONTAL -\definecharacter UnicodeLeftHeavyAndRightDownLight {\uchar{37}{045}} %%BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT -\definecharacter UnicodeRightHeavyAndLeftDownLight {\uchar{37}{046}} %%BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT -\definecharacter UnicodeDownLightAndHorizontalHeavy {\uchar{37}{047}} %%BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY -\definecharacter UnicodeDownHeavyAndHorizontalLight {\uchar{37}{048}} %%BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT -\definecharacter UnicodeRightLightAndLeftDownHeavy {\uchar{37}{049}} %%BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY -\definecharacter UnicodeLeftLightAndRightDownHeavy {\uchar{37}{050}} %%BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY -\definecharacter UnicodeHeavyDownAndHorizontal {\uchar{37}{051}} %%BOX DRAWINGS HEAVY DOWN AND HORIZONTAL -\definecharacter UnicodeLightUpAndHorizontal {\uchar{37}{052}} %%BOX DRAWINGS LIGHT UP AND HORIZONTAL -\definecharacter UnicodeLeftHeavyAndRightUpLight {\uchar{37}{053}} %%BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT -\definecharacter UnicodeRightHeavyAndLeftUpLight {\uchar{37}{054}} %%BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT -\definecharacter UnicodeUpLightAndHorizontalHeavy {\uchar{37}{055}} %%BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY -\definecharacter UnicodeUpHeavyAndHorizontalLight {\uchar{37}{056}} %%BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT -\definecharacter UnicodeRightLightAndLeftUpHeavy {\uchar{37}{057}} %%BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY -\definecharacter UnicodeLeftLightAndRightUpHeavy {\uchar{37}{058}} %%BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY -\definecharacter UnicodeHeavyUpAndHorizontal {\uchar{37}{059}} %%BOX DRAWINGS HEAVY UP AND HORIZONTAL -\definecharacter UnicodeLightVerticalAndHorizontal {\uchar{37}{060}} %%BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL -\definecharacter UnicodeLeftHeavyAndRightVerticalLight {\uchar{37}{061}} %%BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT -\definecharacter UnicodeRightHeavyAndLeftVerticalLight {\uchar{37}{062}} %%BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT -\definecharacter UnicodeVerticalLightAndHorizontalHeavy {\uchar{37}{063}} %%BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY -\definecharacter UnicodeUpHeavyAndDownHorizontalLight {\uchar{37}{064}} %%BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT -\definecharacter UnicodeDownHeavyAndUpHorizontalLight {\uchar{37}{065}} %%BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT -\definecharacter UnicodeVerticalHeavyAndHorizontalLight {\uchar{37}{066}} %%BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT -\definecharacter UnicodeLeftUpHeavyAndRightDownLight {\uchar{37}{067}} %%BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT -\definecharacter UnicodeRightUpHeavyAndLeftDownLight {\uchar{37}{068}} %%BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT -\definecharacter UnicodeLeftDownHeavyAndRightUpLight {\uchar{37}{069}} %%BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT -\definecharacter UnicodeRightDownHeavyAndLeftUpLight {\uchar{37}{070}} %%BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT -\definecharacter UnicodeDownLightAndUpHorizontalHeavy {\uchar{37}{071}} %%BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY -\definecharacter UnicodeUpLightAndDownHorizontalHeavy {\uchar{37}{072}} %%BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY -\definecharacter UnicodeRightLightAndLeftVerticalHeavy {\uchar{37}{073}} %%BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY -\definecharacter UnicodeLeftLightAndRightVerticalHeavy {\uchar{37}{074}} %%BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY -\definecharacter UnicodeHeavyVerticalAndHorizontal {\uchar{37}{075}} %%BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL -\definecharacter UnicodeLightDoubleDashHorizontal {\uchar{37}{076}} %%BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL -\definecharacter UnicodeHeavyDoubleDashHorizontal {\uchar{37}{077}} %%BOX DRAWINGS HEAVY DOUBLE DASH HORIZONTAL -\definecharacter UnicodeLightDoubleDashVertical {\uchar{37}{078}} %%BOX DRAWINGS LIGHT DOUBLE DASH VERTICAL -\definecharacter UnicodeHeavyDoubleDashVertical {\uchar{37}{079}} %%BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL -\definecharacter UnicodeDoubleHorizontal {\uchar{37}{080}} %%BOX DRAWINGS DOUBLE HORIZONTAL -\definecharacter UnicodeDoubleVertical {\uchar{37}{081}} %%BOX DRAWINGS DOUBLE VERTICAL -\definecharacter UnicodeDownSingleAndRightDouble {\uchar{37}{082}} %%BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE -\definecharacter UnicodeDownDoubleAndRightSingle {\uchar{37}{083}} %%BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE -\definecharacter UnicodeDoubleDownAndRight {\uchar{37}{084}} %%BOX DRAWINGS DOUBLE DOWN AND RIGHT -\definecharacter UnicodeDownSingleAndLeftDouble {\uchar{37}{085}} %%BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE -\definecharacter UnicodeDownDoubleAndLeftSingle {\uchar{37}{086}} %%BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE -\definecharacter UnicodeDoubleDownAndLeft {\uchar{37}{087}} %%BOX DRAWINGS DOUBLE DOWN AND LEFT -\definecharacter UnicodeUpSingleAndRightDouble {\uchar{37}{088}} %%BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE -\definecharacter UnicodeUpDoubleAndRightSingle {\uchar{37}{089}} %%BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE -\definecharacter UnicodeDoubleUpAndRight {\uchar{37}{090}} %%BOX DRAWINGS DOUBLE UP AND RIGHT -\definecharacter UnicodeUpSingleAndLeftDouble {\uchar{37}{091}} %%BOX DRAWINGS UP SINGLE AND LEFT DOUBLE -\definecharacter UnicodeUpDoubleAndLeftSingle {\uchar{37}{092}} %%BOX DRAWINGS UP DOUBLE AND LEFT SINGLE -\definecharacter UnicodeDoubleUpAndLeft {\uchar{37}{093}} %%BOX DRAWINGS DOUBLE UP AND LEFT -\definecharacter UnicodeVerticalSingleAndRightDouble {\uchar{37}{094}} %%BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE -\definecharacter UnicodeVerticalDoubleAndRightSingle {\uchar{37}{095}} %%BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE -\definecharacter UnicodeDoubleVerticalAndRight {\uchar{37}{096}} %%BOX DRAWINGS DOUBLE VERTICAL AND RIGHT -\definecharacter UnicodeVerticalSingleAndLeftDouble {\uchar{37}{097}} %%BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE -\definecharacter UnicodeVerticalDoubleAndLeftSingle {\uchar{37}{098}} %%BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE -\definecharacter UnicodeDoubleVerticalAndLeft {\uchar{37}{099}} %%BOX DRAWINGS DOUBLE VERTICAL AND LEFT -\definecharacter UnicodeDownSingleAndHorizontalDouble {\uchar{37}{100}} %%BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE -\definecharacter UnicodeDownDoubleAndHorizontalSingle {\uchar{37}{101}} %%BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE -\definecharacter UnicodeDoubleDownAndHorizontal {\uchar{37}{102}} %%BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL -\definecharacter UnicodeUpSingleAndHorizontalDouble {\uchar{37}{103}} %%BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE -\definecharacter UnicodeUpDoubleAndHorizontalSingle {\uchar{37}{104}} %%BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE -\definecharacter UnicodeDoubleUpAndHorizontal {\uchar{37}{105}} %%BOX DRAWINGS DOUBLE UP AND HORIZONTAL -\definecharacter UnicodeVerticalSingleAndHorizontalDouble {\uchar{37}{106}} %%BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE -\definecharacter UnicodeVerticalDoubleAndHorizontalSingle {\uchar{37}{107}} %%BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE -\definecharacter UnicodeDoubleVerticalAndHorizontal {\uchar{37}{108}} %%BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL -\definecharacter UnicodeLightArcDownAndRight {\uchar{37}{109}} %%BOX DRAWINGS LIGHT ARC DOWN AND RIGHT -\definecharacter UnicodeLightArcDownAndLeft {\uchar{37}{110}} %%BOX DRAWINGS LIGHT ARC DOWN AND LEFT -\definecharacter UnicodeLightArcUpAndLeft {\uchar{37}{111}} %%BOX DRAWINGS LIGHT ARC UP AND LEFT -\definecharacter UnicodeLightArcUpAndRight {\uchar{37}{112}} %%BOX DRAWINGS LIGHT ARC UP AND RIGHT -\definecharacter UnicodeLightDiagonalUpperRightToLowerLeft {\uchar{37}{113}} %%BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT -\definecharacter UnicodeLightDiagonalUpperLeftToLowerRight {\uchar{37}{114}} %%BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT -\definecharacter UnicodeLightDiagonalCross {\uchar{37}{115}} %%BOX DRAWINGS LIGHT DIAGONAL CROSS -\definecharacter UnicodeLightLeft {\uchar{37}{116}} %%BOX DRAWINGS LIGHT LEFT -\definecharacter UnicodeLightUp {\uchar{37}{117}} %%BOX DRAWINGS LIGHT UP -\definecharacter UnicodeLightRight {\uchar{37}{118}} %%BOX DRAWINGS LIGHT RIGHT -\definecharacter UnicodeLightDown {\uchar{37}{119}} %%BOX DRAWINGS LIGHT DOWN -\definecharacter UnicodeHeavyLeft {\uchar{37}{120}} %%BOX DRAWINGS HEAVY LEFT -\definecharacter UnicodeHeavyUp {\uchar{37}{121}} %%BOX DRAWINGS HEAVY UP -\definecharacter UnicodeHeavyRight {\uchar{37}{122}} %%BOX DRAWINGS HEAVY RIGHT -\definecharacter UnicodeHeavyDown {\uchar{37}{123}} %%BOX DRAWINGS HEAVY DOWN -\definecharacter UnicodeLightLeftAndHeavyRight {\uchar{37}{124}} %%BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT -\definecharacter UnicodeLightUpAndHeavyDown {\uchar{37}{125}} %%BOX DRAWINGS LIGHT UP AND HEAVY DOWN -\definecharacter UnicodeHeavyLeftAndLightRight {\uchar{37}{126}} %%BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT -\definecharacter UnicodeHeavyUpAndLightDown {\uchar{37}{127}} %%BOX DRAWINGS HEAVY UP AND LIGHT DOWN -\definecharacter UnicodeUpperHalfBlock {\uchar{37}{128}} %%UPPER HALF BLOCK -\definecharacter UnicodeLowerOneEighthBlock {\uchar{37}{129}} %%LOWER ONE EIGHTH BLOCK -\definecharacter UnicodeLowerOneQuarterBlock {\uchar{37}{130}} %%LOWER ONE QUARTER BLOCK -\definecharacter UnicodeLowerThreeEighthsBlock {\uchar{37}{131}} %%LOWER THREE EIGHTHS BLOCK -\definecharacter UnicodeLowerHalfBlock {\uchar{37}{132}} %%LOWER HALF BLOCK -\definecharacter UnicodeLowerFiveEighthsBlock {\uchar{37}{133}} %%LOWER FIVE EIGHTHS BLOCK -\definecharacter UnicodeLowerThreeQuartersBlock {\uchar{37}{134}} %%LOWER THREE QUARTERS BLOCK -\definecharacter UnicodeLowerSevenEighthsBlock {\uchar{37}{135}} %%LOWER SEVEN EIGHTHS BLOCK -\definecharacter UnicodeFullBlock {\uchar{37}{136}} %%FULL BLOCK -\definecharacter UnicodeLeftSevenEighthsBlock {\uchar{37}{137}} %%LEFT SEVEN EIGHTHS BLOCK -\definecharacter UnicodeLeftThreeQuartersBlock {\uchar{37}{138}} %%LEFT THREE QUARTERS BLOCK -\definecharacter UnicodeLeftFiveEighthsBlock {\uchar{37}{139}} %%LEFT FIVE EIGHTHS BLOCK -\definecharacter UnicodeLeftHalfBlock {\uchar{37}{140}} %%LEFT HALF BLOCK -\definecharacter UnicodeLeftThreeEighthsBlock {\uchar{37}{141}} %%LEFT THREE EIGHTHS BLOCK -\definecharacter UnicodeLeftOneQuarterBlock {\uchar{37}{142}} %%LEFT ONE QUARTER BLOCK -\definecharacter UnicodeLeftOneEighthBlock {\uchar{37}{143}} %%LEFT ONE EIGHTH BLOCK -\definecharacter UnicodeRightHalfBlock {\uchar{37}{144}} %%RIGHT HALF BLOCK -\definecharacter UnicodeLightShade {\uchar{37}{145}} %%LIGHT SHADE -\definecharacter UnicodeMediumShade {\uchar{37}{146}} %%MEDIUM SHADE -\definecharacter UnicodeDarkShade {\uchar{37}{147}} %%DARK SHADE -\definecharacter UnicodeUpperOneEighthBlock {\uchar{37}{148}} %%UPPER ONE EIGHTH BLOCK -\definecharacter UnicodeRightOneEighthBlock {\uchar{37}{149}} %%RIGHT ONE EIGHTH BLOCK -\definecharacter UnicodeQuadrantLowerLeft {\uchar{37}{150}} %%[Unassigned U+2596] -\definecharacter UnicodeQuadrantLowerRight {\uchar{37}{151}} %%[Unassigned U+2597] -\definecharacter UnicodeQuadrantUpperLeft {\uchar{37}{152}} %%[Unassigned U+2598] -\definecharacter UnicodeQuadrantUpperLeftAndLowerLeftAndLowerRight {\uchar{37}{153}} %%[Unassigned U+2599] -\definecharacter UnicodeQuadrantUpperLeftAndLowerRight {\uchar{37}{154}} %%[Unassigned U+259A] -\definecharacter UnicodeQuadrantUpperLeftAndUpperRightandLowerLeft {\uchar{37}{155}} %%[Unassigned U+259B] -\definecharacter UnicodeQuadrantUpperLeftAndUpperRightAndLowerRight {\uchar{37}{156}} %%[Unassigned U+259C] -\definecharacter UnicodeQuadrantUpperRight {\uchar{37}{157}} %%[Unassigned U+259D] -\definecharacter UnicodeQuadrantUpperRightAndLowerLeft {\uchar{37}{158}} %%[Unassigned U+259E] -\definecharacter UnicodeQuadrantUpperRightAndLowerLeftAndLowerRight {\uchar{37}{159}} %%[Unassigned U+259F] -\definecharacter UnicodeBlackSquare {\uchar{37}{160}} %%BLACK SQUARE -\definecharacter UnicodeWhiteSquare {\uchar{37}{161}} %%WHITE SQUARE -\definecharacter UnicodeWhiteSquareWithRoundedCorners {\uchar{37}{162}} %%WHITE SQUARE WITH ROUNDED CORNERS -\definecharacter UnicodeWhiteSquareContainingBlackSmallSquare {\uchar{37}{163}} %%WHITE SQUARE CONTAINING BLACK SMALL SQUARE -\definecharacter UnicodeSquareWithHorizontalFill {\uchar{37}{164}} %%SQUARE WITH HORIZONTAL FILL -\definecharacter UnicodeSquareWithVerticalFill {\uchar{37}{165}} %%SQUARE WITH VERTICAL FILL -\definecharacter UnicodeSquareWithOrthogonalCrosshatchFill {\uchar{37}{166}} %%SQUARE WITH ORTHOGONAL CROSSHATCH FILL -\definecharacter UnicodeSquareWithUpperLeftToLowerRightFill {\uchar{37}{167}} %%SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL -\definecharacter UnicodeSquareWithUpperRightToLowerLeftFill {\uchar{37}{168}} %%SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL -\definecharacter UnicodeSquareWithDiagonalCrosshatchFill {\uchar{37}{169}} %%SQUARE WITH DIAGONAL CROSSHATCH FILL -\definecharacter UnicodeBlackSmallSquare {\uchar{37}{170}} %%BLACK SMALL SQUARE -\definecharacter UnicodeWhiteSmallSquare {\uchar{37}{171}} %%WHITE SMALL SQUARE -\definecharacter UnicodeBlackRectangle {\uchar{37}{172}} %%BLACK RECTANGLE -\definecharacter UnicodeWhiteRectangle {\uchar{37}{173}} %%WHITE RECTANGLE -\definecharacter UnicodeBlackVerticalRectangle {\uchar{37}{174}} %%BLACK VERTICAL RECTANGLE -\definecharacter UnicodeWhiteVerticalRectangle {\uchar{37}{175}} %%WHITE VERTICAL RECTANGLE -\definecharacter UnicodeBlackParallelogram {\uchar{37}{176}} %%BLACK PARALLELOGRAM -\definecharacter UnicodeWhiteParallelogram {\uchar{37}{177}} %%WHITE PARALLELOGRAM -\definecharacter UnicodeBlackUpPointingTriangle {\uchar{37}{178}} %%BLACK UP-POINTING TRIANGLE -\definecharacter UnicodeWhiteUpPointingTriangle {\uchar{37}{179}} %%WHITE UP-POINTING TRIANGLE -\definecharacter UnicodeBlackUpPointingSmallTriangle {\uchar{37}{180}} %%BLACK UP-POINTING SMALL TRIANGLE -\definecharacter UnicodeWhiteUpPointingSmallTriangle {\uchar{37}{181}} %%WHITE UP-POINTING SMALL TRIANGLE -\definecharacter UnicodeBlackRightPointingTriangle {\uchar{37}{182}} %%BLACK RIGHT-POINTING TRIANGLE -\definecharacter UnicodeWhiteRightPointingTriangle {\uchar{37}{183}} %%WHITE RIGHT-POINTING TRIANGLE -\definecharacter UnicodeBlackRightPointingSmallTriangle {\uchar{37}{184}} %%BLACK RIGHT-POINTING SMALL TRIANGLE -\definecharacter UnicodeWhiteRightPointingSmallTriangle {\uchar{37}{185}} %%WHITE RIGHT-POINTING SMALL TRIANGLE -\definecharacter UnicodeBlackRightPointingPointer {\uchar{37}{186}} %%BLACK RIGHT-POINTING POINTER -\definecharacter UnicodeWhiteRightPointingPointer {\uchar{37}{187}} %%WHITE RIGHT-POINTING POINTER -\definecharacter UnicodeBlackDownPointingTriangle {\uchar{37}{188}} %%BLACK DOWN-POINTING TRIANGLE -\definecharacter UnicodeWhiteDownPointingTriangle {\uchar{37}{189}} %%WHITE DOWN-POINTING TRIANGLE -\definecharacter UnicodeBlackDownPointingSmallTriangle {\uchar{37}{190}} %%BLACK DOWN-POINTING SMALL TRIANGLE -\definecharacter UnicodeWhiteDownPointingSmallTriangle {\uchar{37}{191}} %%WHITE DOWN-POINTING SMALL TRIANGLE -\definecharacter UnicodeBlackLeftPointingTriangle {\uchar{37}{192}} %%BLACK LEFT-POINTING TRIANGLE -\definecharacter UnicodeWhiteLeftPointingTriangle {\uchar{37}{193}} %%WHITE LEFT-POINTING TRIANGLE -\definecharacter UnicodeBlackLeftPointingSmallTriangle {\uchar{37}{194}} %%BLACK LEFT-POINTING SMALL TRIANGLE -\definecharacter UnicodeWhiteLeftPointingSmallTriangle {\uchar{37}{195}} %%WHITE LEFT-POINTING SMALL TRIANGLE -\definecharacter UnicodeBlackLeftPointingPointer {\uchar{37}{196}} %%BLACK LEFT-POINTING POINTER -\definecharacter UnicodeWhiteLeftPointingPointer {\uchar{37}{197}} %%WHITE LEFT-POINTING POINTER -\definecharacter UnicodeBlackDiamond {\uchar{37}{198}} %%BLACK DIAMOND -\definecharacter UnicodeWhiteDiamond {\uchar{37}{199}} %%WHITE DIAMOND -\definecharacter UnicodeWhiteDiamondContainingBlackSmallDiamond {\uchar{37}{200}} %%WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND -\definecharacter UnicodeFisheye {\uchar{37}{201}} %%FISHEYE -\definecharacter UnicodeLozenge {\uchar{37}{202}} %%LOZENGE -\definecharacter UnicodeWhiteCircle {\uchar{37}{203}} %%WHITE CIRCLE -\definecharacter UnicodeDottedCircle {\uchar{37}{204}} %%DOTTED CIRCLE -\definecharacter UnicodeCircleWithVerticalFill {\uchar{37}{205}} %%CIRCLE WITH VERTICAL FILL -\definecharacter UnicodeBullseye {\uchar{37}{206}} %%BULLSEYE -\definecharacter UnicodeBlackCircle {\uchar{37}{207}} %%BLACK CIRCLE -\definecharacter UnicodeCircleWithLeftHalfBlack {\uchar{37}{208}} %%CIRCLE WITH LEFT HALF BLACK -\definecharacter UnicodeCircleWithRightHalfBlack {\uchar{37}{209}} %%CIRCLE WITH RIGHT HALF BLACK -\definecharacter UnicodeCircleWithLowerHalfBlack {\uchar{37}{210}} %%CIRCLE WITH LOWER HALF BLACK -\definecharacter UnicodeCircleWithUpperHalfBlack {\uchar{37}{211}} %%CIRCLE WITH UPPER HALF BLACK -\definecharacter UnicodeCircleWithUpperRightQuadrantBlack {\uchar{37}{212}} %%CIRCLE WITH UPPER RIGHT QUADRANT BLACK -\definecharacter UnicodeCircleWithAllButUpperLeftQuadrantBlack {\uchar{37}{213}} %%CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK -\definecharacter UnicodeLeftHalfBlackCircle {\uchar{37}{214}} %%LEFT HALF BLACK CIRCLE -\definecharacter UnicodeRightHalfBlackCircle {\uchar{37}{215}} %%RIGHT HALF BLACK CIRCLE -\definecharacter UnicodeInverseBullet {\uchar{37}{216}} %%INVERSE BULLET -\definecharacter UnicodeInverseWhiteCircle {\uchar{37}{217}} %%INVERSE WHITE CIRCLE -\definecharacter UnicodeUpperHalfInverseWhiteCircle {\uchar{37}{218}} %%UPPER HALF INVERSE WHITE CIRCLE -\definecharacter UnicodeLowerHalfInverseWhiteCircle {\uchar{37}{219}} %%LOWER HALF INVERSE WHITE CIRCLE -\definecharacter UnicodeUpperLeftQuadrantCircularArc {\uchar{37}{220}} %%UPPER LEFT QUADRANT CIRCULAR ARC -\definecharacter UnicodeUpperRightQuadrantCircularArc {\uchar{37}{221}} %%UPPER RIGHT QUADRANT CIRCULAR ARC -\definecharacter UnicodeLowerRightQuadrantCircularArc {\uchar{37}{222}} %%LOWER RIGHT QUADRANT CIRCULAR ARC -\definecharacter UnicodeLowerLeftQuadrantCircularArc {\uchar{37}{223}} %%LOWER LEFT QUADRANT CIRCULAR ARC -\definecharacter UnicodeUpperHalfCircle {\uchar{37}{224}} %%UPPER HALF CIRCLE -\definecharacter UnicodeLowerHalfCircle {\uchar{37}{225}} %%LOWER HALF CIRCLE -\definecharacter UnicodeBlackLowerRightTriangle {\uchar{37}{226}} %%BLACK LOWER RIGHT TRIANGLE -\definecharacter UnicodeBlackLowerLeftTriangle {\uchar{37}{227}} %%BLACK LOWER LEFT TRIANGLE -\definecharacter UnicodeBlackUpperLeftTriangle {\uchar{37}{228}} %%BLACK UPPER LEFT TRIANGLE -\definecharacter UnicodeBlackUpperRightTriangle {\uchar{37}{229}} %%BLACK UPPER RIGHT TRIANGLE -\definecharacter UnicodeWhiteBullet {\uchar{37}{230}} %%WHITE BULLET -\definecharacter UnicodeSquareWithLeftHalfBlack {\uchar{37}{231}} %%SQUARE WITH LEFT HALF BLACK -\definecharacter UnicodeSquareWithRightHalfBlack {\uchar{37}{232}} %%SQUARE WITH RIGHT HALF BLACK -\definecharacter UnicodeSquareWithUpperLeftDiagonalHalfBlack {\uchar{37}{233}} %%SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK -\definecharacter UnicodeSquareWithLowerRightDiagonalHalfBlack {\uchar{37}{234}} %%SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK -\definecharacter UnicodeWhiteSquareWithVerticalBisectingLine {\uchar{37}{235}} %%WHITE SQUARE WITH VERTICAL BISECTING LINE -\definecharacter UnicodeWhiteUpPointingTriangleWithDot {\uchar{37}{236}} %%WHITE UP-POINTING TRIANGLE WITH DOT -\definecharacter UnicodeUpPointingTriangleWithLeftHalfBlack {\uchar{37}{237}} %%UP-POINTING TRIANGLE WITH LEFT HALF BLACK -\definecharacter UnicodeUpPointingTriangleWithRightHalfBlack {\uchar{37}{238}} %%UP-POINTING TRIANGLE WITH RIGHT HALF BLACK -\definecharacter UnicodeLargeCircle {\uchar{37}{239}} %%LARGE CIRCLE -\definecharacter UnicodeWhiteSquareWithUpperLeftQuadrant {\uchar{37}{240}} %%WHITE SQUARE WITH UPPER LEFT QUADRANT -\definecharacter UnicodeWhiteSquareWithLowerLeftQuadrant {\uchar{37}{241}} %%WHITE SQUARE WITH LOWER LEFT QUADRANT -\definecharacter UnicodeWhiteSquareWithLowerRightQuadrant {\uchar{37}{242}} %%WHITE SQUARE WITH LOWER RIGHT QUADRANT -\definecharacter UnicodeWhiteSquareWithUpperRightQuadrant {\uchar{37}{243}} %%WHITE SQUARE WITH UPPER RIGHT QUADRANT -\definecharacter UnicodeWhiteCircleWithUpperLeftQuadrant {\uchar{37}{244}} %%WHITE CIRCLE WITH UPPER LEFT QUADRANT -\definecharacter UnicodeWhiteCircleWithLowerLeftQuadrant {\uchar{37}{245}} %%WHITE CIRCLE WITH LOWER LEFT QUADRANT -\definecharacter UnicodeWhiteCircleWithLowerRightQuadrant {\uchar{37}{246}} %%WHITE CIRCLE WITH LOWER RIGHT QUADRANT -\definecharacter UnicodeWhiteCircleWithUpperRightQuadrant {\uchar{37}{247}} %%WHITE CIRCLE WITH UPPER RIGHT QUADRANT -\definecharacter UnicodeUpperLeftTriangle {\uchar{37}{248}} %%[Unassigned U+25F8] -\definecharacter UnicodeUpperRightTriangle {\uchar{37}{249}} %%[Unassigned U+25F9] -\definecharacter UnicodeLowerLeftTriangle {\uchar{37}{250}} %%[Unassigned U+25FA] -\definecharacter UnicodeWhiteMediumSquare {\uchar{37}{251}} %%[Unassigned U+25FB] -\definecharacter UnicodeBlackMediumSquare {\uchar{37}{252}} %%[Unassigned U+25FC] -\definecharacter UnicodeWhiteMediumSmallSquare {\uchar{37}{253}} %%[Unassigned U+25FD] -\definecharacter UnicodeBlackMediumSmallSquare {\uchar{37}{254}} %%[Unassigned U+25FE] -\definecharacter UnicodeLowerRightTriangle {\uchar{37}{255}} %%[Unassigned U+25FF] - -\stopencoding - -\endinput - diff --git a/tex/context/base/enco-acc.mkii b/tex/context/base/enco-acc.mkii new file mode 100644 index 000000000..e02536be6 --- /dev/null +++ b/tex/context/base/enco-acc.mkii @@ -0,0 +1,139 @@ +%D \module +%D [ file=enco-acc, +%D version=2000.20.12, % split from base file +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Composed Characters Commands, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=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 Although it is technically possible to redefine the commands +%D that are responsible for building composed characters, this +%D is seldom needed, since they map onto named glyphs. The +%D meaning of these names glyphs may change, although their +%D visual appearance seldom will. + +\startencoding[default] + +\defineaccent ^ A {\Acircumflex} \defineaccent ^ a {\acircumflex} +\defineaccent ^ C {\Ccircumflex} \defineaccent ^ c {\ccircumflex} +\defineaccent ^ E {\Ecircumflex} \defineaccent ^ e {\ecircumflex} +\defineaccent ^ G {\Gcircumflex} \defineaccent ^ g {\gcircumflex} +\defineaccent ^ H {\Hcircumflex} \defineaccent ^ h {\hcircumflex} +\defineaccent ^ I {\Icircumflex} \defineaccent ^ i {\icircumflex} \defineaccent ^ {\i} {\icircumflex} +\defineaccent ^ J {\Jcircumflex} \defineaccent ^ j {\jcircumflex} \defineaccent ^ {\j} {\jcircumflex} +\defineaccent ^ O {\Ocircumflex} \defineaccent ^ o {\ocircumflex} +\defineaccent ^ S {\Scircumflex} \defineaccent ^ s {\scircumflex} +\defineaccent ^ U {\Ucircumflex} \defineaccent ^ u {\ucircumflex} +\defineaccent ^ W {\Wcircumflex} \defineaccent ^ w {\wcircumflex} +\defineaccent ^ Y {\Ycircumflex} \defineaccent ^ y {\ycircumflex} + +\defineaccent ` A {\Agrave} \defineaccent ` a {\agrave} +\defineaccent ` E {\Egrave} \defineaccent ` e {\egrave} +\defineaccent ` I {\Igrave} \defineaccent ` i {\igrave} \defineaccent ` {\i} {\igrave} +\defineaccent ` O {\Ograve} \defineaccent ` o {\ograve} +\defineaccent ` U {\Ugrave} \defineaccent ` u {\ugrave} +\defineaccent ` Y {\Ygrave} \defineaccent ` y {\ygrave} + +\defineaccent ~ A {\Atilde} \defineaccent ~ a {\atilde} +\defineaccent ~ I {\Itilde} \defineaccent ~ i {\itilde} \defineaccent ~ {\i} {\itilde} +\defineaccent ~ O {\Otilde} \defineaccent ~ o {\otilde} +\defineaccent ~ U {\Utilde} \defineaccent ~ u {\utilde} + +\defineaccent " A {\Adiaeresis} \defineaccent " a {\adiaeresis} +\defineaccent " E {\Ediaeresis} \defineaccent " e {\ediaeresis} +\defineaccent " I {\Idiaeresis} \defineaccent " i {\idiaeresis} \defineaccent " {\i} {\idiaeresis} +\defineaccent " O {\Odiaeresis} \defineaccent " o {\odiaeresis} +\defineaccent " U {\Udiaeresis} \defineaccent " u {\udiaeresis} +\defineaccent " Y {\Ydiaeresis} \defineaccent " y {\ydiaeresis} + +\defineaccent ' A {\Aacute} \defineaccent ' a {\aacute} +\defineaccent ' C {\Cacute} \defineaccent ' c {\cacute} +\defineaccent ' E {\Eacute} \defineaccent ' e {\eacute} +\defineaccent ' I {\Iacute} \defineaccent ' i {\iacute} \defineaccent ' {\i} {\iacute} +\defineaccent ' L {\Lacute} \defineaccent ' l {\lacute} +\defineaccent ' N {\Nacute} \defineaccent ' n {\nacute} +\defineaccent ' O {\Oacute} \defineaccent ' o {\oacute} +\defineaccent ' R {\Racute} \defineaccent ' r {\racute} +\defineaccent ' S {\Sacute} \defineaccent ' s {\sacute} +\defineaccent ' U {\Uacute} \defineaccent ' u {\uacute} +\defineaccent ' Y {\Yacute} \defineaccent ' y {\yacute} +\defineaccent ' Z {\Zacute} \defineaccent ' z {\zacute} + +\defineaccent . C {\Cdotaccent} \defineaccent . c {\cdotaccent} +\defineaccent . E {\Edotaccent} \defineaccent . e {\edotaccent} +\defineaccent . G {\Gdotaccent} \defineaccent . g {\gdotaccent} +\defineaccent . I {\Idotaccent} \defineaccent . i {\idotaccent} \defineaccent . {\i} {\idotaccent} +\defineaccent . Z {\Zdotaccent} \defineaccent . z {\zdotaccent} + +\defineaccent = A {\Amacron} \defineaccent = a {\amacron} +\defineaccent = E {\Emacron} \defineaccent = e {\emacron} +\defineaccent = I {\Imacron} \defineaccent = i {\imacron} \defineaccent = {\i} {\imacron} +\defineaccent = O {\Omacron} \defineaccent = o {\omacron} +\defineaccent = U {\Umacron} \defineaccent = u {\umacron} + +\defineaccent c C {\Ccedilla} \defineaccent c c {\ccedilla} +\defineaccent c K {\Kcedilla} \defineaccent c k {\kcedilla} +\defineaccent c L {\Lcedilla} \defineaccent c l {\lcedilla} +\defineaccent c N {\Ncedilla} \defineaccent c n {\ncedilla} +\defineaccent c R {\Rcedilla} \defineaccent c r {\rcedilla} +\defineaccent c S {\Scedilla} \defineaccent c s {\scedilla} +\defineaccent c T {\Tcedilla} \defineaccent c t {\tcedilla} + +\defineaccent H O {\Ohungarumlaut} \defineaccent H o {\ohungarumlaut} +\defineaccent H u {\uhungarumlaut} \defineaccent H U {\Uhungarumlaut} + +\defineaccent k A {\Aogonek} \defineaccent k a {\aogonek} +\defineaccent k E {\Eogonek} \defineaccent k e {\eogonek} +\defineaccent k I {\Iogonek} \defineaccent k i {\iogonek} +\defineaccent k U {\Uogonek} \defineaccent k u {\uogonek} + +\defineaccent r A {\Aring} \defineaccent r a {\aring} +\defineaccent r U {\Uring} \defineaccent r u {\uring} + +\defineaccent u A {\Abreve} \defineaccent u a {\abreve} +\defineaccent u E {\Ebreve} \defineaccent u e {\ebreve} +\defineaccent u G {\Gbreve} \defineaccent u g {\gbreve} +\defineaccent u I {\Ibreve} \defineaccent u i {\ibreve} \defineaccent u {\i} {\ibreve} +\defineaccent u O {\Obreve} \defineaccent u o {\obreve} +\defineaccent u U {\Ubreve} \defineaccent u u {\ubreve} + +\defineaccent v C {\Ccaron} \defineaccent v c {\ccaron} +\defineaccent v D {\Dcaron} \defineaccent v d {\dcaron} +\defineaccent v E {\Ecaron} \defineaccent v e {\ecaron} +\defineaccent v L {\Lcaron} \defineaccent v l {\lcaron} +\defineaccent v N {\Ncaron} \defineaccent v n {\ncaron} +\defineaccent v R {\Rcaron} \defineaccent v r {\rcaron} +\defineaccent v S {\Scaron} \defineaccent v s {\scaron} +\defineaccent v T {\Tcaron} \defineaccent v t {\tcaron} +\defineaccent v Z {\Zcaron} \defineaccent v z {\zcaron} + +\stopencoding + +\startencoding[default] + +% vietnamese: if needed, \useencoding[enco-vna] + +\stopencoding + +% For Tobias Burnus, who wants: +% +% \starttypen +% \setupinteraction[state=start] +% \setupinteractionscreen[option=bookmark] +% \placebookmarks[chapter] +% +% \starttext \chapter{F\"ur Na\"ive und Na\"\i ve} \stoptext +% \stoptypen + +\startencoding[default] + + \defineaccent " {\i} {\idiaeresis} + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-acc.tex b/tex/context/base/enco-acc.tex deleted file mode 100644 index e02536be6..000000000 --- a/tex/context/base/enco-acc.tex +++ /dev/null @@ -1,139 +0,0 @@ -%D \module -%D [ file=enco-acc, -%D version=2000.20.12, % split from base file -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Composed Characters Commands, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=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 Although it is technically possible to redefine the commands -%D that are responsible for building composed characters, this -%D is seldom needed, since they map onto named glyphs. The -%D meaning of these names glyphs may change, although their -%D visual appearance seldom will. - -\startencoding[default] - -\defineaccent ^ A {\Acircumflex} \defineaccent ^ a {\acircumflex} -\defineaccent ^ C {\Ccircumflex} \defineaccent ^ c {\ccircumflex} -\defineaccent ^ E {\Ecircumflex} \defineaccent ^ e {\ecircumflex} -\defineaccent ^ G {\Gcircumflex} \defineaccent ^ g {\gcircumflex} -\defineaccent ^ H {\Hcircumflex} \defineaccent ^ h {\hcircumflex} -\defineaccent ^ I {\Icircumflex} \defineaccent ^ i {\icircumflex} \defineaccent ^ {\i} {\icircumflex} -\defineaccent ^ J {\Jcircumflex} \defineaccent ^ j {\jcircumflex} \defineaccent ^ {\j} {\jcircumflex} -\defineaccent ^ O {\Ocircumflex} \defineaccent ^ o {\ocircumflex} -\defineaccent ^ S {\Scircumflex} \defineaccent ^ s {\scircumflex} -\defineaccent ^ U {\Ucircumflex} \defineaccent ^ u {\ucircumflex} -\defineaccent ^ W {\Wcircumflex} \defineaccent ^ w {\wcircumflex} -\defineaccent ^ Y {\Ycircumflex} \defineaccent ^ y {\ycircumflex} - -\defineaccent ` A {\Agrave} \defineaccent ` a {\agrave} -\defineaccent ` E {\Egrave} \defineaccent ` e {\egrave} -\defineaccent ` I {\Igrave} \defineaccent ` i {\igrave} \defineaccent ` {\i} {\igrave} -\defineaccent ` O {\Ograve} \defineaccent ` o {\ograve} -\defineaccent ` U {\Ugrave} \defineaccent ` u {\ugrave} -\defineaccent ` Y {\Ygrave} \defineaccent ` y {\ygrave} - -\defineaccent ~ A {\Atilde} \defineaccent ~ a {\atilde} -\defineaccent ~ I {\Itilde} \defineaccent ~ i {\itilde} \defineaccent ~ {\i} {\itilde} -\defineaccent ~ O {\Otilde} \defineaccent ~ o {\otilde} -\defineaccent ~ U {\Utilde} \defineaccent ~ u {\utilde} - -\defineaccent " A {\Adiaeresis} \defineaccent " a {\adiaeresis} -\defineaccent " E {\Ediaeresis} \defineaccent " e {\ediaeresis} -\defineaccent " I {\Idiaeresis} \defineaccent " i {\idiaeresis} \defineaccent " {\i} {\idiaeresis} -\defineaccent " O {\Odiaeresis} \defineaccent " o {\odiaeresis} -\defineaccent " U {\Udiaeresis} \defineaccent " u {\udiaeresis} -\defineaccent " Y {\Ydiaeresis} \defineaccent " y {\ydiaeresis} - -\defineaccent ' A {\Aacute} \defineaccent ' a {\aacute} -\defineaccent ' C {\Cacute} \defineaccent ' c {\cacute} -\defineaccent ' E {\Eacute} \defineaccent ' e {\eacute} -\defineaccent ' I {\Iacute} \defineaccent ' i {\iacute} \defineaccent ' {\i} {\iacute} -\defineaccent ' L {\Lacute} \defineaccent ' l {\lacute} -\defineaccent ' N {\Nacute} \defineaccent ' n {\nacute} -\defineaccent ' O {\Oacute} \defineaccent ' o {\oacute} -\defineaccent ' R {\Racute} \defineaccent ' r {\racute} -\defineaccent ' S {\Sacute} \defineaccent ' s {\sacute} -\defineaccent ' U {\Uacute} \defineaccent ' u {\uacute} -\defineaccent ' Y {\Yacute} \defineaccent ' y {\yacute} -\defineaccent ' Z {\Zacute} \defineaccent ' z {\zacute} - -\defineaccent . C {\Cdotaccent} \defineaccent . c {\cdotaccent} -\defineaccent . E {\Edotaccent} \defineaccent . e {\edotaccent} -\defineaccent . G {\Gdotaccent} \defineaccent . g {\gdotaccent} -\defineaccent . I {\Idotaccent} \defineaccent . i {\idotaccent} \defineaccent . {\i} {\idotaccent} -\defineaccent . Z {\Zdotaccent} \defineaccent . z {\zdotaccent} - -\defineaccent = A {\Amacron} \defineaccent = a {\amacron} -\defineaccent = E {\Emacron} \defineaccent = e {\emacron} -\defineaccent = I {\Imacron} \defineaccent = i {\imacron} \defineaccent = {\i} {\imacron} -\defineaccent = O {\Omacron} \defineaccent = o {\omacron} -\defineaccent = U {\Umacron} \defineaccent = u {\umacron} - -\defineaccent c C {\Ccedilla} \defineaccent c c {\ccedilla} -\defineaccent c K {\Kcedilla} \defineaccent c k {\kcedilla} -\defineaccent c L {\Lcedilla} \defineaccent c l {\lcedilla} -\defineaccent c N {\Ncedilla} \defineaccent c n {\ncedilla} -\defineaccent c R {\Rcedilla} \defineaccent c r {\rcedilla} -\defineaccent c S {\Scedilla} \defineaccent c s {\scedilla} -\defineaccent c T {\Tcedilla} \defineaccent c t {\tcedilla} - -\defineaccent H O {\Ohungarumlaut} \defineaccent H o {\ohungarumlaut} -\defineaccent H u {\uhungarumlaut} \defineaccent H U {\Uhungarumlaut} - -\defineaccent k A {\Aogonek} \defineaccent k a {\aogonek} -\defineaccent k E {\Eogonek} \defineaccent k e {\eogonek} -\defineaccent k I {\Iogonek} \defineaccent k i {\iogonek} -\defineaccent k U {\Uogonek} \defineaccent k u {\uogonek} - -\defineaccent r A {\Aring} \defineaccent r a {\aring} -\defineaccent r U {\Uring} \defineaccent r u {\uring} - -\defineaccent u A {\Abreve} \defineaccent u a {\abreve} -\defineaccent u E {\Ebreve} \defineaccent u e {\ebreve} -\defineaccent u G {\Gbreve} \defineaccent u g {\gbreve} -\defineaccent u I {\Ibreve} \defineaccent u i {\ibreve} \defineaccent u {\i} {\ibreve} -\defineaccent u O {\Obreve} \defineaccent u o {\obreve} -\defineaccent u U {\Ubreve} \defineaccent u u {\ubreve} - -\defineaccent v C {\Ccaron} \defineaccent v c {\ccaron} -\defineaccent v D {\Dcaron} \defineaccent v d {\dcaron} -\defineaccent v E {\Ecaron} \defineaccent v e {\ecaron} -\defineaccent v L {\Lcaron} \defineaccent v l {\lcaron} -\defineaccent v N {\Ncaron} \defineaccent v n {\ncaron} -\defineaccent v R {\Rcaron} \defineaccent v r {\rcaron} -\defineaccent v S {\Scaron} \defineaccent v s {\scaron} -\defineaccent v T {\Tcaron} \defineaccent v t {\tcaron} -\defineaccent v Z {\Zcaron} \defineaccent v z {\zcaron} - -\stopencoding - -\startencoding[default] - -% vietnamese: if needed, \useencoding[enco-vna] - -\stopencoding - -% For Tobias Burnus, who wants: -% -% \starttypen -% \setupinteraction[state=start] -% \setupinteractionscreen[option=bookmark] -% \placebookmarks[chapter] -% -% \starttext \chapter{F\"ur Na\"ive und Na\"\i ve} \stoptext -% \stoptypen - -\startencoding[default] - - \defineaccent " {\i} {\idiaeresis} - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-agr.mkii b/tex/context/base/enco-agr.mkii new file mode 100644 index 000000000..cfd86dfd3 --- /dev/null +++ b/tex/context/base/enco-agr.mkii @@ -0,0 +1,364 @@ +%D \module +%D [ file=enco-agr, +%D version=2005.02.20, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Ancient Greek, +%D author=Thomas A. Schmitz, +%D date=\currentdate] + +\startmapping[agr] + + \definecasemaps 13 to 64 lc 0 uc 0 + \definecasemaps 65 to 66 lc +32 uc 0 + \definecasemaps 67 to 67 lc 0 uc 0 + \definecasemaps 68 to 85 lc +32 uc 0 + \definecasemaps 86 to 86 lc 0 uc 0 + \definecasemaps 87 to 90 lc +32 uc 0 + \definecasemaps 91 to 255 lc 0 uc 0 + +\stopmapping + +\startencoding[agr] + +\definecharacter greeksigmalunate 1 +\definecharacter endash 2 +\definecharacter emdash 3 +\definecharacter apostrophe 4 +\definecharacter greekaltbeta 5 +\definecharacter epih 6 + +\definecharacter textbraceleft 8 +\definecharacter textbraceright 9 +\definecharacter textbreve 10 + +\definecharacter greekSigmalunate 13 +\definecharacter greekIotadialytika 14 +\definecharacter greekUpsilondialytika 15 + +\definecharacter greekepsilonperispomeni 18 +\definecharacter greekomicronperispomeni 19 +\definecharacter greekepsilondasiaperispomeni 20 +\definecharacter greekomicrondasiaperispomeni 21 +\definecharacter greekepsilonpsiliperispomeni 22 +\definecharacter greekomicronpsiliperispomeni 23 +\definecharacter greekiotadialytikaperispomeni 24 +\definecharacter greekupsilondialytikaperispomeni 25 +\definecharacter greekdialytikaperispomeni 26 + +\definecharacter textbottomdot 33 +\definecharacter greeksampi 34 +\definecharacter greekdigamma 35 +\definecharacter greekstigma 36 +\definecharacter greeknumkoppa 37 +\definecharacter greekkoppa 38 +\definecharacter guilsingleright 39 + +\definecharacter textdag 43 + +\definecharacter greekoxia 47 + +\definecharacter greekanoteleia 59 +\definecharacter greekdasia 60 + +\definecharacter greekpsili 62 +\definecharacter greekquestionmark 63 +\definecharacter dialytika 64 +\definecharacter greekAlpha 65 +\definecharacter greekBeta 66 +\definecharacter greekomegaiotasub 67 +\definecharacter greekDelta 68 +\definecharacter greekEpsilon 69 +\definecharacter greekPhi 70 +\definecharacter greekGamma 71 +\definecharacter greekEta 72 +\definecharacter greekIota 73 +\definecharacter greekTheta 74 +\definecharacter greekKappa 75 +\definecharacter greekLambda 76 +\definecharacter greekMu 77 +\definecharacter greekNu 78 +\definecharacter greekOmicron 79 +\definecharacter greekPi 80 +\definecharacter greekChi 81 +\definecharacter greekRho 82 +\definecharacter greekSigma 83 +\definecharacter greekTau 84 +\definecharacter greekUpsilon 85 +\definecharacter greeketaiotasub 86 +\definecharacter greekOmega 87 +\definecharacter greekXi 88 +\definecharacter greekPsi 89 +\definecharacter greekZeta 90 +\definecharacter bracketleft 91 +\definecharacter greekvaria 92 +\definecharacter bracketright 93 +\definecharacter greekperispomeni 94 + +\definecharacter guilsingleleft 96 + +% the above is a quote character +\definecharacter greekalpha 97 +\definecharacter greekbeta 98 +\definecharacter greekfinalsigma 99 +\definecharacter greekdelta 100 +\definecharacter greekepsilon 101 +\definecharacter greekphi 102 +\definecharacter greekgamma 103 +\definecharacter greeketa 104 +\definecharacter greekiota 105 +\definecharacter greektheta 106 +\definecharacter greekkappa 107 +\definecharacter greeklambda 108 +\definecharacter greekmu 109 +\definecharacter greeknu 110 +\definecharacter greekomicron 111 +\definecharacter greekpi 112 +\definecharacter greekchi 113 +\definecharacter greekrho 114 +\definecharacter greeksigma 115 +\definecharacter greektau 116 +\definecharacter greekupsilon 117 +\definecharacter greekalphaiotasub 118 +\definecharacter greekomega 119 +\definecharacter greekxi 120 +\definecharacter greekpsi 121 +\definecharacter greekzeta 122 +\definecharacter floorleft 123 +\definecharacter textbar 124 +\definecharacter floorright 125 +\definecharacter greekperispomeni 126 + +\definecharacter quotedblleft 128 +\definecharacter quotedblright 129 +\definecharacter exclam 130 +\definecharacter greekiotadasia 131 +\definecharacter greekiotapsili 132 +\definecharacter greekiotaoxia 133 +\definecharacter greekiotadasiatonos 134 +\definecharacter greekiotapsilitonos 135 +\definecharacter greekiotavaria 136 +\definecharacter greekiotadasiavaria 137 +\definecharacter greekiotapsilivaria 138 +\definecharacter greekiotaperispomeni 139 +\definecharacter greekiotadasiaperispomeni 140 +\definecharacter greekiotapsiliperispomeni 141 +\definecharacter greekiotadialytika 142 +\definecharacter greekiotadialytikatonos 143 +\definecharacter greekiotadialytikavaria 144 +\definecharacter greekdasiaperispomeni 145 +\definecharacter greekpsiliperispomeni 146 +\definecharacter greekdasiatonos 147 +\definecharacter greekpsilitonos 148 +\definecharacter greekdasiavaria 149 +\definecharacter greekpsilivaria 150 +\definecharacter greekdialytikatonos 151 +\definecharacter greekepsilondasia 152 +\definecharacter greekepsilonpsili 153 +\definecharacter greekepsilonoxia 154 +\definecharacter greekepsilondasiatonos 155 +\definecharacter greekepsilonpsilitonos 156 +\definecharacter greekepsilonvaria 157 +\definecharacter greekepsilondasiavaria 158 +\definecharacter greekepsilonpsilivaria 159 +\definecharacter greekdialytikavaria 160 +\definecharacter greekalphadasia 161 +\definecharacter greekalphapsili 162 +\definecharacter greekalphaoxia 163 +\definecharacter greekalphadasiatonos 164 +\definecharacter greekalphapsilitonos 165 +\definecharacter greekalphavaria 166 +\definecharacter greekalphadasiavaria 167 +\definecharacter greekalphapsilivaria 168 +\definecharacter greekalphaperispomeni 169 +\definecharacter greekalphadasiaperispomeni 170 +\definecharacter greekalphapsiliperispomeni 171 +\definecharacter greekalphaiotasubdasia 172 +\definecharacter greekalphaiotasubpsili 173 +\definecharacter greekalphaiotasubtonos 174 +\definecharacter greekalphaiotasubdasiatonos 175 +\definecharacter greekalphaiotasubpsilitonos 176 +\definecharacter greekalphaiotasubvaria 177 +\definecharacter greekalphaiotasubdasiavaria 178 +\definecharacter greekalphaiotasubpsilivaria 179 +\definecharacter greekalphaiotasubperispomeni 180 +\definecharacter greekalphaiotasubdasiaperispomeni 181 +\definecharacter greekalphaiotasubpsiliperispomeni 182 +\definecharacter greekrhodasia 183 +\definecharacter greekrhopsili 184 +\definecharacter greeketadasia 185 +\definecharacter greeketapsili 186 +\definecharacter greeketaoxia 187 +\definecharacter greeketadasiatonos 188 +\definecharacter greeketapsilitonos 189 +\definecharacter greeketavaria 190 +\definecharacter greeketadasiavaria 191 +\definecharacter greeketapsilivaria 192 +\definecharacter greeketaperispomeni 193 +\definecharacter greeketadasiaperispomeni 194 +\definecharacter greeketapsiliperispomeni 195 +\definecharacter textslash 196 +\definecharacter greeketaiotasubdasia 197 +\definecharacter greeketaiotasubpsili 198 +\definecharacter greeketaiotasubtonos 199 +\definecharacter greeketaiotasubdasiatonos 200 +\definecharacter greeketaiotasubpsilitonos 201 +\definecharacter greeketaiotasubvaria 202 +\definecharacter greeketaiotasubdasiavaria 203 +\definecharacter greeketaiotasubpsilivaria 204 +\definecharacter greeketaiotasubperispomeni 205 +\definecharacter greeketaiotasubdasiaperispomeni 206 +\definecharacter greeketaiotasubpsiliperispomeni 207 +\definecharacter greekomicrondasia 208 +\definecharacter greekomicronpsili 209 +\definecharacter greekomicronoxia 210 +\definecharacter greekomicrondasiatonos 211 +\definecharacter greekomicronpsilitonos 212 +\definecharacter greekomicronvaria 213 +\definecharacter greekomicrondasiavaria 214 +\definecharacter greekomicronpsilivaria 215 +\definecharacter greekupsilondasia 216 +\definecharacter greekupsilonpsili 217 +\definecharacter greekupsilonoxia 218 +\definecharacter greekupsilondasiatonos 219 +\definecharacter greekupsilonpsilitonos 220 +\definecharacter greekupsilonvaria 221 +\definecharacter greekupsilondasiavaria 222 +\definecharacter greekupsilonpsilivaria 223 +\definecharacter greekupsilonperispomeni 224 +\definecharacter greekupsilondasiaperispomeni 225 +\definecharacter greekupsilonpsiliperispomeni 226 +\definecharacter greekupsilondiaeresis 227 +\definecharacter greekupsilondialytikatonos 228 +\definecharacter greekupsilondialytikavaria 229 +\definecharacter greekomegadasia 230 +\definecharacter greekomegapsili 231 +\definecharacter greekomegaoxia 232 +\definecharacter greekomegadasiatonos 233 +\definecharacter greekomegapsilitonos 234 +\definecharacter greekomegavaria 235 +\definecharacter greekomegadasiavaria 236 +\definecharacter greekomegapsilivaria 237 +\definecharacter greekomegaperispomeni 238 +\definecharacter greekomegadasiaperispomeni 239 +\definecharacter greekomegapsiliperispomeni 240 +\definecharacter greekomegaiotasubdasia 241 +\definecharacter greekomegaiotasubpsili 242 +\definecharacter greekomegaiotasubtonos 243 +\definecharacter greekomegaiotasubdasiatonos 244 +\definecharacter greekomegaiotasubpsilitonos 245 +\definecharacter greekomegaiotasubvaria 246 +\definecharacter greekomegaiotasubdasiavaria 247 +\definecharacter greekomegaiotasubpsilivaria 248 +\definecharacter greekomegaiotasubperispomeni 249 +\definecharacter greekomegaiotasubdasiaperispomeni 250 +\definecharacter greekomegaiotasubpsiliperispomeni 251 +\definecharacter greeknumeralsign 254 +\definecharacter greeknumeralsignlower 255 + +\stopencoding + +\startencoding[default] + +\definecharacter greekAlphapsili {\greekpsili \greekAlpha} +\definecharacter greekAlphadasia {\greekdasia \greekAlpha} +\definecharacter greekAlphapsilivaria {\greekpsilivaria \greekAlpha} +\definecharacter greekAlphadasiavaria {\greekdasiavaria \greekAlpha} +\definecharacter greekAlphapsilitonos {\greekpsilitonos \greekAlpha} +\definecharacter greekAlphadasiatonos {\greekdasiatonos \greekAlpha} +\definecharacter greekAlphapsiliperispomeni {\greekpsiliperispomeni \greekAlpha} +\definecharacter greekAlphadasiaperispomeni {\greekdasiaperispomeni \greekAlpha} +\definecharacter greekEpsilonpsili {\greekpsili \greekEpsilon} +\definecharacter greekEpsilondasia {\greekdasia \greekEpsilon} +\definecharacter greekEpsilonpsilivaria {\greekpsilivaria \greekEpsilon} +\definecharacter greekEpsilondasiavaria {\greekdasiavaria \greekEpsilon} +\definecharacter greekEpsilonpsilitonos {\greekpsilitonos \greekEpsilon} +\definecharacter greekEpsilondasiatonos {\greekdasiatonos \greekEpsilon} +\definecharacter greekEtapsili {\greekpsili \greekEta} +\definecharacter greekEtadasia {\greekdasia \greekEta} +\definecharacter greekEtapsilivaria {\greekpsilivaria \greekEta} +\definecharacter greekEtadasiavaria {\greekdasiavaria \greekEta} +\definecharacter greekEtapsilitonos {\greekpsilitonos \greekEta} +\definecharacter greekEtadasiatonos {\greekdasiatonos \greekEta} +\definecharacter greekEtapsiliperispomeni {\greekpsiliperispomeni \greekEta} +\definecharacter greekEtadasiaperispomeni {\greekdasiaperispomeni \greekEta} +\definecharacter greekIotapsili {\greekpsili \greekIota} +\definecharacter greekIotadasia {\greekdasia \greekIota} +\definecharacter greekIotapsilivaria {\greekpsilivaria \greekIota} +\definecharacter greekIotadasiavaria {\greekdasiavaria \greekIota} +\definecharacter greekIotapsilitonos {\greekpsilitonos \greekIota} +\definecharacter greekIotadasiatonos {\greekdasiatonos \greekIota} +\definecharacter greekIotapsiliperispomeni {\greekpsiliperispomeni \greekIota} +\definecharacter greekIotadasiaperispomeni {\greekdasiaperispomeni \greekIota} +\definecharacter greekOmicronpsili {\greekpsili \greekOmicron} +\definecharacter greekOmicrondasia {\greekdasia \greekOmicron} +\definecharacter greekOmicronpsilivaria {\greekpsilivaria \greekOmicron} +\definecharacter greekOmicrondasiavaria {\greekdasiavaria \greekOmicron} +\definecharacter greekOmicronpsilitonos {\greekpsilitonos \greekOmicron} +\definecharacter greekOmicrondasiatonos {\greekdasiatonos \greekOmicron} +\definecharacter greekUpsilondasia {\greekdasia \greekUpsilon} +\definecharacter greekUpsilondasiavaria {\greekdasiavaria \greekUpsilon} +\definecharacter greekUpsilondasiatonos {\greekdasiatonos \greekUpsilon} +\definecharacter greekUpsilondasiaperispomeni {\greekdasiaperispomeni \greekUpsilon} +\definecharacter greekOmegapsili {\greekpsili \greekOmega} +\definecharacter greekOmegadasia {\greekdasia \greekOmega} +\definecharacter greekOmegapsilivaria {\greekpsilivaria \greekOmega} +\definecharacter greekOmegadasiavaria {\greekdasiavaria \greekOmega} +\definecharacter greekOmegapsilitonos {\greekpsilitonos \greekOmega} +\definecharacter greekOmegadasiatonos {\greekdasiatonos \greekOmega} +\definecharacter greekOmegapsiliperispomeni {\greekpsiliperispomeni \greekOmega} +\definecharacter greekOmegadasiaperispomeni {\greekdasiaperispomeni \greekOmega} +\definecharacter greekAlphaiotasubpsili {\greekpsili \greekAlpha \greekiota} +\definecharacter greekAlphaiotasubdasia {\greekdasia \greekAlpha \greekiota} +\definecharacter greekAlphaiotasubpsilivaria {\greekpsilivaria \greekAlpha \greekiota} +\definecharacter greekAlphaiotasubdasiavaria {\greekdasiavaria \greekAlpha \greekiota} +\definecharacter greekAlphaiotasubpsilitonos {\greekpsilitonos \greekAlpha \greekiota} +\definecharacter greekAlphaiotasubdasiatonos {\greekdasiatonos \greekAlpha \greekiota} +\definecharacter greekAlphaiotasubpsiliperispomeni {\greekpsiliperispomeni \greekAlpha \greekiota} +\definecharacter greekAlphaiotasubdasiaperispomeni {\greekdasiaperispomeni \greekAlpha \greekiota} +\definecharacter greekEtaiotasubpsili {\greekpsili \greekEta \greekiota} +\definecharacter greekEtaiotasubdasia {\greekdasia \greekEta \greekiota} +\definecharacter greekEtaiotasubpsilivaria {\greekpsilivaria \greekEta \greekiota} +\definecharacter greekEtaiotasubdasiavaria {\greekdasiavaria \greekEta \greekiota} +\definecharacter greekEtaiotasubpsilitonos {\greekpsilitonos \greekEta \greekiota} +\definecharacter greekEtaiotasubdasiatonos {\greekdasiatonos \greekEta \greekiota} +\definecharacter greekEtaiotasubpsiliperispomeni {\greekpsiliperispomeni \greekEta \greekiota} +\definecharacter greekEtaiotasubdasiaperispomeni {\greekdasiaperispomeni \greekEta \greekiota} +\definecharacter greekOmegaiotasubpsili {\greekpsili \greekOmega \greekiota} +\definecharacter greekOmegaiotasubdasia {\greekdasia \greekOmega \greekiota} +\definecharacter greekOmegaiotasubpsilivaria {\greekpsilivaria \greekOmega \greekiota} +\definecharacter greekOmegaiotasubdasiavaria {\greekdasiavaria \greekOmega \greekiota} +\definecharacter greekOmegaiotasubpsilitonos {\greekpsilitonos \greekOmega \greekiota} +\definecharacter greekOmegaiotasubdasiatonos {\greekdasiatonos \greekOmega \greekiota} +\definecharacter greekOmegaiotasubpsiliperispomeni {\greekpsiliperispomeni \greekOmega \greekiota} +\definecharacter greekOmegaiotasubdasiaperispomeni {\greekdasiaperispomeni \greekOmega \greekiota} +\definecharacter greekAlphavaria {\greekvaria \greekAlpha} +\definecharacter greekAlphaoxia {\greekoxia \greekAlpha} +\definecharacter greekAlphaiotasub {\greekAlpha \greekiota} +\definecharacter greekEpsilonvaria {\greekvaria \greekEpsilon} +\definecharacter greekEpsilonoxia {\greekoxia \greekEpsilon} +\definecharacter greekEtavaria {\greekvaria \greekEta} +\definecharacter greekEtaoxia {\greekoxia \greekEta} +\definecharacter greekEtaiotasub {\greekEta \greekiota} +\definecharacter greekIotavaria {\greekvaria \greekIota} +\definecharacter greekIotaoxia {\greekoxia \greekIota} +\definecharacter greekUpsilonvaria {\greekvaria \greekUpsilon} +\definecharacter greekUpsilonoxia {\greekoxia \greekUpsilon} +\definecharacter greekOmicronvaria {\greekvaria \greekOmicron} +\definecharacter greekOmicronoxia {\greekoxia \greekOmicron} +\definecharacter greekOmegavaria {\greekvaria \greekOmega} +\definecharacter greekOmegaoxia {\greekoxia \greekOmega} +\definecharacter greekOmegaiotasub {\greekOmega \greekiota} +\definecharacter greekRhodasia {\greekdasia \greekRho} +\definecharacter digamma {\greekdigamma} +\definecharacter sampi {\greeksampi} +\definecharacter stigma {\greekstigma} +\definecharacter koppa {\greeknumkoppa} +\definecharacter lunars {\greeksigmalunate} +\definecharacter lunarS {\greekSigmalunate} +\definecharacter halfbraceleft {\floorleft} +\definecharacter halfbraceright {\floorright} +\definecharacter crux {\textdag} + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-agr.tex b/tex/context/base/enco-agr.tex deleted file mode 100644 index cfd86dfd3..000000000 --- a/tex/context/base/enco-agr.tex +++ /dev/null @@ -1,364 +0,0 @@ -%D \module -%D [ file=enco-agr, -%D version=2005.02.20, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Ancient Greek, -%D author=Thomas A. Schmitz, -%D date=\currentdate] - -\startmapping[agr] - - \definecasemaps 13 to 64 lc 0 uc 0 - \definecasemaps 65 to 66 lc +32 uc 0 - \definecasemaps 67 to 67 lc 0 uc 0 - \definecasemaps 68 to 85 lc +32 uc 0 - \definecasemaps 86 to 86 lc 0 uc 0 - \definecasemaps 87 to 90 lc +32 uc 0 - \definecasemaps 91 to 255 lc 0 uc 0 - -\stopmapping - -\startencoding[agr] - -\definecharacter greeksigmalunate 1 -\definecharacter endash 2 -\definecharacter emdash 3 -\definecharacter apostrophe 4 -\definecharacter greekaltbeta 5 -\definecharacter epih 6 - -\definecharacter textbraceleft 8 -\definecharacter textbraceright 9 -\definecharacter textbreve 10 - -\definecharacter greekSigmalunate 13 -\definecharacter greekIotadialytika 14 -\definecharacter greekUpsilondialytika 15 - -\definecharacter greekepsilonperispomeni 18 -\definecharacter greekomicronperispomeni 19 -\definecharacter greekepsilondasiaperispomeni 20 -\definecharacter greekomicrondasiaperispomeni 21 -\definecharacter greekepsilonpsiliperispomeni 22 -\definecharacter greekomicronpsiliperispomeni 23 -\definecharacter greekiotadialytikaperispomeni 24 -\definecharacter greekupsilondialytikaperispomeni 25 -\definecharacter greekdialytikaperispomeni 26 - -\definecharacter textbottomdot 33 -\definecharacter greeksampi 34 -\definecharacter greekdigamma 35 -\definecharacter greekstigma 36 -\definecharacter greeknumkoppa 37 -\definecharacter greekkoppa 38 -\definecharacter guilsingleright 39 - -\definecharacter textdag 43 - -\definecharacter greekoxia 47 - -\definecharacter greekanoteleia 59 -\definecharacter greekdasia 60 - -\definecharacter greekpsili 62 -\definecharacter greekquestionmark 63 -\definecharacter dialytika 64 -\definecharacter greekAlpha 65 -\definecharacter greekBeta 66 -\definecharacter greekomegaiotasub 67 -\definecharacter greekDelta 68 -\definecharacter greekEpsilon 69 -\definecharacter greekPhi 70 -\definecharacter greekGamma 71 -\definecharacter greekEta 72 -\definecharacter greekIota 73 -\definecharacter greekTheta 74 -\definecharacter greekKappa 75 -\definecharacter greekLambda 76 -\definecharacter greekMu 77 -\definecharacter greekNu 78 -\definecharacter greekOmicron 79 -\definecharacter greekPi 80 -\definecharacter greekChi 81 -\definecharacter greekRho 82 -\definecharacter greekSigma 83 -\definecharacter greekTau 84 -\definecharacter greekUpsilon 85 -\definecharacter greeketaiotasub 86 -\definecharacter greekOmega 87 -\definecharacter greekXi 88 -\definecharacter greekPsi 89 -\definecharacter greekZeta 90 -\definecharacter bracketleft 91 -\definecharacter greekvaria 92 -\definecharacter bracketright 93 -\definecharacter greekperispomeni 94 - -\definecharacter guilsingleleft 96 - -% the above is a quote character -\definecharacter greekalpha 97 -\definecharacter greekbeta 98 -\definecharacter greekfinalsigma 99 -\definecharacter greekdelta 100 -\definecharacter greekepsilon 101 -\definecharacter greekphi 102 -\definecharacter greekgamma 103 -\definecharacter greeketa 104 -\definecharacter greekiota 105 -\definecharacter greektheta 106 -\definecharacter greekkappa 107 -\definecharacter greeklambda 108 -\definecharacter greekmu 109 -\definecharacter greeknu 110 -\definecharacter greekomicron 111 -\definecharacter greekpi 112 -\definecharacter greekchi 113 -\definecharacter greekrho 114 -\definecharacter greeksigma 115 -\definecharacter greektau 116 -\definecharacter greekupsilon 117 -\definecharacter greekalphaiotasub 118 -\definecharacter greekomega 119 -\definecharacter greekxi 120 -\definecharacter greekpsi 121 -\definecharacter greekzeta 122 -\definecharacter floorleft 123 -\definecharacter textbar 124 -\definecharacter floorright 125 -\definecharacter greekperispomeni 126 - -\definecharacter quotedblleft 128 -\definecharacter quotedblright 129 -\definecharacter exclam 130 -\definecharacter greekiotadasia 131 -\definecharacter greekiotapsili 132 -\definecharacter greekiotaoxia 133 -\definecharacter greekiotadasiatonos 134 -\definecharacter greekiotapsilitonos 135 -\definecharacter greekiotavaria 136 -\definecharacter greekiotadasiavaria 137 -\definecharacter greekiotapsilivaria 138 -\definecharacter greekiotaperispomeni 139 -\definecharacter greekiotadasiaperispomeni 140 -\definecharacter greekiotapsiliperispomeni 141 -\definecharacter greekiotadialytika 142 -\definecharacter greekiotadialytikatonos 143 -\definecharacter greekiotadialytikavaria 144 -\definecharacter greekdasiaperispomeni 145 -\definecharacter greekpsiliperispomeni 146 -\definecharacter greekdasiatonos 147 -\definecharacter greekpsilitonos 148 -\definecharacter greekdasiavaria 149 -\definecharacter greekpsilivaria 150 -\definecharacter greekdialytikatonos 151 -\definecharacter greekepsilondasia 152 -\definecharacter greekepsilonpsili 153 -\definecharacter greekepsilonoxia 154 -\definecharacter greekepsilondasiatonos 155 -\definecharacter greekepsilonpsilitonos 156 -\definecharacter greekepsilonvaria 157 -\definecharacter greekepsilondasiavaria 158 -\definecharacter greekepsilonpsilivaria 159 -\definecharacter greekdialytikavaria 160 -\definecharacter greekalphadasia 161 -\definecharacter greekalphapsili 162 -\definecharacter greekalphaoxia 163 -\definecharacter greekalphadasiatonos 164 -\definecharacter greekalphapsilitonos 165 -\definecharacter greekalphavaria 166 -\definecharacter greekalphadasiavaria 167 -\definecharacter greekalphapsilivaria 168 -\definecharacter greekalphaperispomeni 169 -\definecharacter greekalphadasiaperispomeni 170 -\definecharacter greekalphapsiliperispomeni 171 -\definecharacter greekalphaiotasubdasia 172 -\definecharacter greekalphaiotasubpsili 173 -\definecharacter greekalphaiotasubtonos 174 -\definecharacter greekalphaiotasubdasiatonos 175 -\definecharacter greekalphaiotasubpsilitonos 176 -\definecharacter greekalphaiotasubvaria 177 -\definecharacter greekalphaiotasubdasiavaria 178 -\definecharacter greekalphaiotasubpsilivaria 179 -\definecharacter greekalphaiotasubperispomeni 180 -\definecharacter greekalphaiotasubdasiaperispomeni 181 -\definecharacter greekalphaiotasubpsiliperispomeni 182 -\definecharacter greekrhodasia 183 -\definecharacter greekrhopsili 184 -\definecharacter greeketadasia 185 -\definecharacter greeketapsili 186 -\definecharacter greeketaoxia 187 -\definecharacter greeketadasiatonos 188 -\definecharacter greeketapsilitonos 189 -\definecharacter greeketavaria 190 -\definecharacter greeketadasiavaria 191 -\definecharacter greeketapsilivaria 192 -\definecharacter greeketaperispomeni 193 -\definecharacter greeketadasiaperispomeni 194 -\definecharacter greeketapsiliperispomeni 195 -\definecharacter textslash 196 -\definecharacter greeketaiotasubdasia 197 -\definecharacter greeketaiotasubpsili 198 -\definecharacter greeketaiotasubtonos 199 -\definecharacter greeketaiotasubdasiatonos 200 -\definecharacter greeketaiotasubpsilitonos 201 -\definecharacter greeketaiotasubvaria 202 -\definecharacter greeketaiotasubdasiavaria 203 -\definecharacter greeketaiotasubpsilivaria 204 -\definecharacter greeketaiotasubperispomeni 205 -\definecharacter greeketaiotasubdasiaperispomeni 206 -\definecharacter greeketaiotasubpsiliperispomeni 207 -\definecharacter greekomicrondasia 208 -\definecharacter greekomicronpsili 209 -\definecharacter greekomicronoxia 210 -\definecharacter greekomicrondasiatonos 211 -\definecharacter greekomicronpsilitonos 212 -\definecharacter greekomicronvaria 213 -\definecharacter greekomicrondasiavaria 214 -\definecharacter greekomicronpsilivaria 215 -\definecharacter greekupsilondasia 216 -\definecharacter greekupsilonpsili 217 -\definecharacter greekupsilonoxia 218 -\definecharacter greekupsilondasiatonos 219 -\definecharacter greekupsilonpsilitonos 220 -\definecharacter greekupsilonvaria 221 -\definecharacter greekupsilondasiavaria 222 -\definecharacter greekupsilonpsilivaria 223 -\definecharacter greekupsilonperispomeni 224 -\definecharacter greekupsilondasiaperispomeni 225 -\definecharacter greekupsilonpsiliperispomeni 226 -\definecharacter greekupsilondiaeresis 227 -\definecharacter greekupsilondialytikatonos 228 -\definecharacter greekupsilondialytikavaria 229 -\definecharacter greekomegadasia 230 -\definecharacter greekomegapsili 231 -\definecharacter greekomegaoxia 232 -\definecharacter greekomegadasiatonos 233 -\definecharacter greekomegapsilitonos 234 -\definecharacter greekomegavaria 235 -\definecharacter greekomegadasiavaria 236 -\definecharacter greekomegapsilivaria 237 -\definecharacter greekomegaperispomeni 238 -\definecharacter greekomegadasiaperispomeni 239 -\definecharacter greekomegapsiliperispomeni 240 -\definecharacter greekomegaiotasubdasia 241 -\definecharacter greekomegaiotasubpsili 242 -\definecharacter greekomegaiotasubtonos 243 -\definecharacter greekomegaiotasubdasiatonos 244 -\definecharacter greekomegaiotasubpsilitonos 245 -\definecharacter greekomegaiotasubvaria 246 -\definecharacter greekomegaiotasubdasiavaria 247 -\definecharacter greekomegaiotasubpsilivaria 248 -\definecharacter greekomegaiotasubperispomeni 249 -\definecharacter greekomegaiotasubdasiaperispomeni 250 -\definecharacter greekomegaiotasubpsiliperispomeni 251 -\definecharacter greeknumeralsign 254 -\definecharacter greeknumeralsignlower 255 - -\stopencoding - -\startencoding[default] - -\definecharacter greekAlphapsili {\greekpsili \greekAlpha} -\definecharacter greekAlphadasia {\greekdasia \greekAlpha} -\definecharacter greekAlphapsilivaria {\greekpsilivaria \greekAlpha} -\definecharacter greekAlphadasiavaria {\greekdasiavaria \greekAlpha} -\definecharacter greekAlphapsilitonos {\greekpsilitonos \greekAlpha} -\definecharacter greekAlphadasiatonos {\greekdasiatonos \greekAlpha} -\definecharacter greekAlphapsiliperispomeni {\greekpsiliperispomeni \greekAlpha} -\definecharacter greekAlphadasiaperispomeni {\greekdasiaperispomeni \greekAlpha} -\definecharacter greekEpsilonpsili {\greekpsili \greekEpsilon} -\definecharacter greekEpsilondasia {\greekdasia \greekEpsilon} -\definecharacter greekEpsilonpsilivaria {\greekpsilivaria \greekEpsilon} -\definecharacter greekEpsilondasiavaria {\greekdasiavaria \greekEpsilon} -\definecharacter greekEpsilonpsilitonos {\greekpsilitonos \greekEpsilon} -\definecharacter greekEpsilondasiatonos {\greekdasiatonos \greekEpsilon} -\definecharacter greekEtapsili {\greekpsili \greekEta} -\definecharacter greekEtadasia {\greekdasia \greekEta} -\definecharacter greekEtapsilivaria {\greekpsilivaria \greekEta} -\definecharacter greekEtadasiavaria {\greekdasiavaria \greekEta} -\definecharacter greekEtapsilitonos {\greekpsilitonos \greekEta} -\definecharacter greekEtadasiatonos {\greekdasiatonos \greekEta} -\definecharacter greekEtapsiliperispomeni {\greekpsiliperispomeni \greekEta} -\definecharacter greekEtadasiaperispomeni {\greekdasiaperispomeni \greekEta} -\definecharacter greekIotapsili {\greekpsili \greekIota} -\definecharacter greekIotadasia {\greekdasia \greekIota} -\definecharacter greekIotapsilivaria {\greekpsilivaria \greekIota} -\definecharacter greekIotadasiavaria {\greekdasiavaria \greekIota} -\definecharacter greekIotapsilitonos {\greekpsilitonos \greekIota} -\definecharacter greekIotadasiatonos {\greekdasiatonos \greekIota} -\definecharacter greekIotapsiliperispomeni {\greekpsiliperispomeni \greekIota} -\definecharacter greekIotadasiaperispomeni {\greekdasiaperispomeni \greekIota} -\definecharacter greekOmicronpsili {\greekpsili \greekOmicron} -\definecharacter greekOmicrondasia {\greekdasia \greekOmicron} -\definecharacter greekOmicronpsilivaria {\greekpsilivaria \greekOmicron} -\definecharacter greekOmicrondasiavaria {\greekdasiavaria \greekOmicron} -\definecharacter greekOmicronpsilitonos {\greekpsilitonos \greekOmicron} -\definecharacter greekOmicrondasiatonos {\greekdasiatonos \greekOmicron} -\definecharacter greekUpsilondasia {\greekdasia \greekUpsilon} -\definecharacter greekUpsilondasiavaria {\greekdasiavaria \greekUpsilon} -\definecharacter greekUpsilondasiatonos {\greekdasiatonos \greekUpsilon} -\definecharacter greekUpsilondasiaperispomeni {\greekdasiaperispomeni \greekUpsilon} -\definecharacter greekOmegapsili {\greekpsili \greekOmega} -\definecharacter greekOmegadasia {\greekdasia \greekOmega} -\definecharacter greekOmegapsilivaria {\greekpsilivaria \greekOmega} -\definecharacter greekOmegadasiavaria {\greekdasiavaria \greekOmega} -\definecharacter greekOmegapsilitonos {\greekpsilitonos \greekOmega} -\definecharacter greekOmegadasiatonos {\greekdasiatonos \greekOmega} -\definecharacter greekOmegapsiliperispomeni {\greekpsiliperispomeni \greekOmega} -\definecharacter greekOmegadasiaperispomeni {\greekdasiaperispomeni \greekOmega} -\definecharacter greekAlphaiotasubpsili {\greekpsili \greekAlpha \greekiota} -\definecharacter greekAlphaiotasubdasia {\greekdasia \greekAlpha \greekiota} -\definecharacter greekAlphaiotasubpsilivaria {\greekpsilivaria \greekAlpha \greekiota} -\definecharacter greekAlphaiotasubdasiavaria {\greekdasiavaria \greekAlpha \greekiota} -\definecharacter greekAlphaiotasubpsilitonos {\greekpsilitonos \greekAlpha \greekiota} -\definecharacter greekAlphaiotasubdasiatonos {\greekdasiatonos \greekAlpha \greekiota} -\definecharacter greekAlphaiotasubpsiliperispomeni {\greekpsiliperispomeni \greekAlpha \greekiota} -\definecharacter greekAlphaiotasubdasiaperispomeni {\greekdasiaperispomeni \greekAlpha \greekiota} -\definecharacter greekEtaiotasubpsili {\greekpsili \greekEta \greekiota} -\definecharacter greekEtaiotasubdasia {\greekdasia \greekEta \greekiota} -\definecharacter greekEtaiotasubpsilivaria {\greekpsilivaria \greekEta \greekiota} -\definecharacter greekEtaiotasubdasiavaria {\greekdasiavaria \greekEta \greekiota} -\definecharacter greekEtaiotasubpsilitonos {\greekpsilitonos \greekEta \greekiota} -\definecharacter greekEtaiotasubdasiatonos {\greekdasiatonos \greekEta \greekiota} -\definecharacter greekEtaiotasubpsiliperispomeni {\greekpsiliperispomeni \greekEta \greekiota} -\definecharacter greekEtaiotasubdasiaperispomeni {\greekdasiaperispomeni \greekEta \greekiota} -\definecharacter greekOmegaiotasubpsili {\greekpsili \greekOmega \greekiota} -\definecharacter greekOmegaiotasubdasia {\greekdasia \greekOmega \greekiota} -\definecharacter greekOmegaiotasubpsilivaria {\greekpsilivaria \greekOmega \greekiota} -\definecharacter greekOmegaiotasubdasiavaria {\greekdasiavaria \greekOmega \greekiota} -\definecharacter greekOmegaiotasubpsilitonos {\greekpsilitonos \greekOmega \greekiota} -\definecharacter greekOmegaiotasubdasiatonos {\greekdasiatonos \greekOmega \greekiota} -\definecharacter greekOmegaiotasubpsiliperispomeni {\greekpsiliperispomeni \greekOmega \greekiota} -\definecharacter greekOmegaiotasubdasiaperispomeni {\greekdasiaperispomeni \greekOmega \greekiota} -\definecharacter greekAlphavaria {\greekvaria \greekAlpha} -\definecharacter greekAlphaoxia {\greekoxia \greekAlpha} -\definecharacter greekAlphaiotasub {\greekAlpha \greekiota} -\definecharacter greekEpsilonvaria {\greekvaria \greekEpsilon} -\definecharacter greekEpsilonoxia {\greekoxia \greekEpsilon} -\definecharacter greekEtavaria {\greekvaria \greekEta} -\definecharacter greekEtaoxia {\greekoxia \greekEta} -\definecharacter greekEtaiotasub {\greekEta \greekiota} -\definecharacter greekIotavaria {\greekvaria \greekIota} -\definecharacter greekIotaoxia {\greekoxia \greekIota} -\definecharacter greekUpsilonvaria {\greekvaria \greekUpsilon} -\definecharacter greekUpsilonoxia {\greekoxia \greekUpsilon} -\definecharacter greekOmicronvaria {\greekvaria \greekOmicron} -\definecharacter greekOmicronoxia {\greekoxia \greekOmicron} -\definecharacter greekOmegavaria {\greekvaria \greekOmega} -\definecharacter greekOmegaoxia {\greekoxia \greekOmega} -\definecharacter greekOmegaiotasub {\greekOmega \greekiota} -\definecharacter greekRhodasia {\greekdasia \greekRho} -\definecharacter digamma {\greekdigamma} -\definecharacter sampi {\greeksampi} -\definecharacter stigma {\greekstigma} -\definecharacter koppa {\greeknumkoppa} -\definecharacter lunars {\greeksigmalunate} -\definecharacter lunarS {\greekSigmalunate} -\definecharacter halfbraceleft {\floorleft} -\definecharacter halfbraceright {\floorright} -\definecharacter crux {\textdag} - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-ans.mkii b/tex/context/base/enco-ans.mkii new file mode 100644 index 000000000..7a48b5b55 --- /dev/null +++ b/tex/context/base/enco-ans.mkii @@ -0,0 +1,237 @@ +%D \module +%D [ file=enco-ans, +%D version=2000.05.07, % 1995.01.01, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=\YandY\ texnansi Encoding, +%D author={Patrick Gundlach, Hans Hagen}, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is \YandY's texnansi encoding vector, which combines +%D the best of the ansi encoding vector (prebuilt accented +%D characters etc.) and some of \TEX's vectors. + +\startmapping[texnansi] + +\resetcaserange 128 to 158 +\resetcaserange 160 to 191 +\resetcaserange 215 to 215 +\resetcaserange 247 to 247 + +\definecasemaps 192 to 214 lc +32 uc 0 +\definecasemaps 224 to 246 lc 0 uc -32 +\definecasemaps 216 to 222 lc +32 uc 0 +\definecasemaps 248 to 254 lc 0 uc -32 + +\definecaseself 223 +\definecaseswap 156 140 +\definecaseswap 255 159 + +% needed by some patterns: + +% \definecaseself 34 % quotedbl +% \definecaseself 132 % quotedblbase +% \definecaseself 147 % quotedblleft +% \definecaseself 148 % quotedblright +% \definecaseself 129 % quotesingle +% \definecaseself 130 % quotesinglebase +% \definecaseself 145 % quoteleft +% \definecaseself 146 % quoteright + +\stopmapping + +\startencoding[texnansi] + +\definecharacter textacute 19 +\definecharacter textbreve 21 +\definecharacter textcaron 20 +\definecharacter textcedilla 184 +\definecharacter textcircumflex 94 % 136 +\definecharacter textdiaeresis 168 +\definecharacter textdotaccent 5 +\definecharacter textgrave 18 +\definecharacter texthungarumlaut 6 +\definecharacter textmacron 175 +\definecharacter textogonek 7 +\definecharacter textring 23 +\definecharacter texttilde 152 + +\definecharacter dotlessi 16 % 105 +\definecharacter dotlessj 17 + +\definecharacter endash 150 % lig +\definecharacter emdash 151 % lig + +\definecharacter aeligature 230 +\definecharacter AEligature 198 +\definecharacter oeligature 156 +\definecharacter OEligature 140 + +\definecharacter ssharp 223 + +\definecharacter thorn 254 +\definecharacter Thorn 222 + +\definecharacter Dstroke 208 % also Eth, mapped in enco-def +\definecharacter eth 240 + +\definecharacter exclamdown 161 +\definecharacter questiondown 191 + +\definecharacter copyright 169 +\definecharacter registered 174 +\definecharacter trademark 153 + +\definecharacter sectionmark 167 +\definecharacter paragraphmark 182 + +\definecharacter onequarter 188 +\definecharacter onehalf 189 +\definecharacter threequarter 190 + +\definecharacter onesuperior 185 +\definecharacter twosuperior 178 +\definecharacter threesuperior 179 + +\definecharacter textcent 162 % ? +\definecharacter textcurrency 164 +\definecharacter texteuro 1 +\definecharacter textflorin 131 +\definecharacter textsterling 163 +\definecharacter textyen 165 + +\definecharacter percent 37 +\definecharacter perthousand 137 + +\definecharacter softhyphen 45 +\definecharacter periodcentered 183 + +\definecharacter textasciicircum 142 +\definecharacter textasciitilde 158 +\definecharacter textbackslash 92 +\definecharacter textbraceleft 123 +\definecharacter textbar 124 +\definecharacter textbraceright 125 +\definecharacter textunderscore 95 + +\definecharacter textbrokenbar 166 +\definecharacter textbullet 149 +\definecharacter textdag 134 +\definecharacter textddag 135 +\definecharacter textdegree 176 +\definecharacter textdiv 247 +\definecharacter textellipsis 133 +\definecharacter textfraction 4 +\definecharacter textlognot 172 +\definecharacter textminus 143 +\definecharacter textmu 181 +\definecharacter textmultiply 215 +\definecharacter textpm 177 + +\definecharacter quotedbl 34 +\definecharacter quotedblbase 132 +\definecharacter quotedblleft 147 +\definecharacter quotedblright 148 + +\definecharacter quotesingle 129 +\definecharacter quotesinglebase 130 + +\definecharacter quoteleft 145 +\definecharacter quoteright 146 + +\definecharacter guilsingleleft 139 +\definecharacter guilsingleright 155 +\definecharacter leftguillemot 171 +\definecharacter rightguillemot 187 + +\definecharacter aacute 225 +\definecharacter Aacute 193 +\definecharacter eacute 233 +\definecharacter Eacute 201 +\definecharacter iacute 237 +\definecharacter Iacute 205 +\definecharacter oacute 243 +\definecharacter Oacute 211 +\definecharacter uacute 250 +\definecharacter Uacute 218 +\definecharacter yacute 253 +\definecharacter Yacute 221 + +\definecharacter scaron 154 +\definecharacter Scaron 138 +\definecharacter zcaron 157 +\definecharacter Zcaron 141 + +\definecharacter ccedilla 231 +\definecharacter Ccedilla 199 + +\definecharacter acircumflex 226 +\definecharacter Acircumflex 194 +\definecharacter ecircumflex 234 +\definecharacter Ecircumflex 202 +\definecharacter icircumflex 238 +\definecharacter Icircumflex 206 +\definecharacter ocircumflex 244 +\definecharacter Ocircumflex 212 +\definecharacter ucircumflex 251 +\definecharacter Ucircumflex 219 + +\definecharacter adiaeresis 228 +\definecharacter Adiaeresis 196 +\definecharacter ediaeresis 235 +\definecharacter Ediaeresis 203 +\definecharacter idiaeresis 239 +\definecharacter Idiaeresis 207 +\definecharacter odiaeresis 246 +\definecharacter Odiaeresis 214 +\definecharacter udiaeresis 252 +\definecharacter Udiaeresis 220 +\definecharacter ydiaeresis 255 +\definecharacter Ydiaeresis 159 + +\definecharacter agrave 224 +\definecharacter Agrave 192 +\definecharacter egrave 232 +\definecharacter Egrave 200 +\definecharacter igrave 236 +\definecharacter Igrave 204 +\definecharacter ograve 242 +\definecharacter Ograve 210 +\definecharacter ugrave 249 +\definecharacter Ugrave 217 + +\definecharacter aring 229 +\definecharacter Aring 197 + +\definecharacter Lstroke 128 +\definecharacter lstroke 144 +\definecharacter ostroke 248 +\definecharacter Ostoke 216 + +\definecharacter atilde 227 +\definecharacter Atilde 195 +\definecharacter ntilde 241 +\definecharacter Ntilde 209 +\definecharacter otilde 245 +\definecharacter Otilde 213 + +\stopencoding + +% will be replaced by math collection, fails anyway + +\startencoding[texnansi] + +\definecharacter mathgrave "7060 +\definecharacter mathacute "70B4 +\definecharacter mathhat "7088 +\definecharacter mathtilde "7098 +\definecharacter mathddot "70A8 +\definecharacter mathbar "70AF + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-ans.tex b/tex/context/base/enco-ans.tex deleted file mode 100644 index 7a48b5b55..000000000 --- a/tex/context/base/enco-ans.tex +++ /dev/null @@ -1,237 +0,0 @@ -%D \module -%D [ file=enco-ans, -%D version=2000.05.07, % 1995.01.01, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=\YandY\ texnansi Encoding, -%D author={Patrick Gundlach, Hans Hagen}, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This is \YandY's texnansi encoding vector, which combines -%D the best of the ansi encoding vector (prebuilt accented -%D characters etc.) and some of \TEX's vectors. - -\startmapping[texnansi] - -\resetcaserange 128 to 158 -\resetcaserange 160 to 191 -\resetcaserange 215 to 215 -\resetcaserange 247 to 247 - -\definecasemaps 192 to 214 lc +32 uc 0 -\definecasemaps 224 to 246 lc 0 uc -32 -\definecasemaps 216 to 222 lc +32 uc 0 -\definecasemaps 248 to 254 lc 0 uc -32 - -\definecaseself 223 -\definecaseswap 156 140 -\definecaseswap 255 159 - -% needed by some patterns: - -% \definecaseself 34 % quotedbl -% \definecaseself 132 % quotedblbase -% \definecaseself 147 % quotedblleft -% \definecaseself 148 % quotedblright -% \definecaseself 129 % quotesingle -% \definecaseself 130 % quotesinglebase -% \definecaseself 145 % quoteleft -% \definecaseself 146 % quoteright - -\stopmapping - -\startencoding[texnansi] - -\definecharacter textacute 19 -\definecharacter textbreve 21 -\definecharacter textcaron 20 -\definecharacter textcedilla 184 -\definecharacter textcircumflex 94 % 136 -\definecharacter textdiaeresis 168 -\definecharacter textdotaccent 5 -\definecharacter textgrave 18 -\definecharacter texthungarumlaut 6 -\definecharacter textmacron 175 -\definecharacter textogonek 7 -\definecharacter textring 23 -\definecharacter texttilde 152 - -\definecharacter dotlessi 16 % 105 -\definecharacter dotlessj 17 - -\definecharacter endash 150 % lig -\definecharacter emdash 151 % lig - -\definecharacter aeligature 230 -\definecharacter AEligature 198 -\definecharacter oeligature 156 -\definecharacter OEligature 140 - -\definecharacter ssharp 223 - -\definecharacter thorn 254 -\definecharacter Thorn 222 - -\definecharacter Dstroke 208 % also Eth, mapped in enco-def -\definecharacter eth 240 - -\definecharacter exclamdown 161 -\definecharacter questiondown 191 - -\definecharacter copyright 169 -\definecharacter registered 174 -\definecharacter trademark 153 - -\definecharacter sectionmark 167 -\definecharacter paragraphmark 182 - -\definecharacter onequarter 188 -\definecharacter onehalf 189 -\definecharacter threequarter 190 - -\definecharacter onesuperior 185 -\definecharacter twosuperior 178 -\definecharacter threesuperior 179 - -\definecharacter textcent 162 % ? -\definecharacter textcurrency 164 -\definecharacter texteuro 1 -\definecharacter textflorin 131 -\definecharacter textsterling 163 -\definecharacter textyen 165 - -\definecharacter percent 37 -\definecharacter perthousand 137 - -\definecharacter softhyphen 45 -\definecharacter periodcentered 183 - -\definecharacter textasciicircum 142 -\definecharacter textasciitilde 158 -\definecharacter textbackslash 92 -\definecharacter textbraceleft 123 -\definecharacter textbar 124 -\definecharacter textbraceright 125 -\definecharacter textunderscore 95 - -\definecharacter textbrokenbar 166 -\definecharacter textbullet 149 -\definecharacter textdag 134 -\definecharacter textddag 135 -\definecharacter textdegree 176 -\definecharacter textdiv 247 -\definecharacter textellipsis 133 -\definecharacter textfraction 4 -\definecharacter textlognot 172 -\definecharacter textminus 143 -\definecharacter textmu 181 -\definecharacter textmultiply 215 -\definecharacter textpm 177 - -\definecharacter quotedbl 34 -\definecharacter quotedblbase 132 -\definecharacter quotedblleft 147 -\definecharacter quotedblright 148 - -\definecharacter quotesingle 129 -\definecharacter quotesinglebase 130 - -\definecharacter quoteleft 145 -\definecharacter quoteright 146 - -\definecharacter guilsingleleft 139 -\definecharacter guilsingleright 155 -\definecharacter leftguillemot 171 -\definecharacter rightguillemot 187 - -\definecharacter aacute 225 -\definecharacter Aacute 193 -\definecharacter eacute 233 -\definecharacter Eacute 201 -\definecharacter iacute 237 -\definecharacter Iacute 205 -\definecharacter oacute 243 -\definecharacter Oacute 211 -\definecharacter uacute 250 -\definecharacter Uacute 218 -\definecharacter yacute 253 -\definecharacter Yacute 221 - -\definecharacter scaron 154 -\definecharacter Scaron 138 -\definecharacter zcaron 157 -\definecharacter Zcaron 141 - -\definecharacter ccedilla 231 -\definecharacter Ccedilla 199 - -\definecharacter acircumflex 226 -\definecharacter Acircumflex 194 -\definecharacter ecircumflex 234 -\definecharacter Ecircumflex 202 -\definecharacter icircumflex 238 -\definecharacter Icircumflex 206 -\definecharacter ocircumflex 244 -\definecharacter Ocircumflex 212 -\definecharacter ucircumflex 251 -\definecharacter Ucircumflex 219 - -\definecharacter adiaeresis 228 -\definecharacter Adiaeresis 196 -\definecharacter ediaeresis 235 -\definecharacter Ediaeresis 203 -\definecharacter idiaeresis 239 -\definecharacter Idiaeresis 207 -\definecharacter odiaeresis 246 -\definecharacter Odiaeresis 214 -\definecharacter udiaeresis 252 -\definecharacter Udiaeresis 220 -\definecharacter ydiaeresis 255 -\definecharacter Ydiaeresis 159 - -\definecharacter agrave 224 -\definecharacter Agrave 192 -\definecharacter egrave 232 -\definecharacter Egrave 200 -\definecharacter igrave 236 -\definecharacter Igrave 204 -\definecharacter ograve 242 -\definecharacter Ograve 210 -\definecharacter ugrave 249 -\definecharacter Ugrave 217 - -\definecharacter aring 229 -\definecharacter Aring 197 - -\definecharacter Lstroke 128 -\definecharacter lstroke 144 -\definecharacter ostroke 248 -\definecharacter Ostoke 216 - -\definecharacter atilde 227 -\definecharacter Atilde 195 -\definecharacter ntilde 241 -\definecharacter Ntilde 209 -\definecharacter otilde 245 -\definecharacter Otilde 213 - -\stopencoding - -% will be replaced by math collection, fails anyway - -\startencoding[texnansi] - -\definecharacter mathgrave "7060 -\definecharacter mathacute "70B4 -\definecharacter mathhat "7088 -\definecharacter mathtilde "7098 -\definecharacter mathddot "70A8 -\definecharacter mathbar "70AF - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-cas.mkii b/tex/context/base/enco-cas.mkii new file mode 100644 index 000000000..38d12f9fa --- /dev/null +++ b/tex/context/base/enco-cas.mkii @@ -0,0 +1,143 @@ +%D \module +%D [ file=enco-cas, +%D version=2005.08.23, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Named Glyph Case Mapping, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D For quite some years \CONTEXT\ used a rather compact way of +%D defining encoded characters as well as case maps. When late +%D 2000 more advanced remapping features were needed (like pdf +%D unicode remapping), named glyphs were introduced to keep the +%D coding tables more readable. At the same time, we introduced +%D named glyph case mapping. + +\defineULcharacter Acircumflex acircumflex +\defineULcharacter Ccircumflex ccircumflex +\defineULcharacter Ecircumflex ecircumflex +\defineULcharacter Gcircumflex gcircumflex +\defineULcharacter Hcircumflex hcircumflex +\defineULcharacter Icircumflex icircumflex +\defineULcharacter Jcircumflex jcircumflex +\defineULcharacter Ocircumflex ocircumflex +\defineULcharacter Scircumflex scircumflex +\defineULcharacter Ucircumflex ucircumflex +\defineULcharacter Wcircumflex wcircumflex +\defineULcharacter Ycircumflex ycircumflex + +\defineULcharacter Agrave agrave +\defineULcharacter Egrave egrave +\defineULcharacter Igrave igrave +\defineULcharacter Ograve ograve +\defineULcharacter Ugrave ugrave +\defineULcharacter Ygrave ygrave + +\defineULcharacter Atilde atilde +\defineULcharacter Itilde itilde +\defineULcharacter Otilde otilde +\defineULcharacter Ntilde ntilde +\defineULcharacter Utilde utilde + +\defineULcharacter Adiaeresis adiaeresis +\defineULcharacter Ediaeresis ediaeresis +\defineULcharacter Idiaeresis idiaeresis +\defineULcharacter Odiaeresis odiaeresis +\defineULcharacter Udiaeresis udiaeresis +\defineULcharacter Ydiaeresis ydiaeresis + +\defineULcharacter Aacute aacute +\defineULcharacter Cacute cacute +\defineULcharacter Eacute eacute +\defineULcharacter Iacute iacute +\defineULcharacter Lacute lacute +\defineULcharacter Nacute nacute +\defineULcharacter Oacute oacute +\defineULcharacter Racute racute +\defineULcharacter Sacute sacute +\defineULcharacter Uacute uacute +\defineULcharacter Yacute yacute +\defineULcharacter Zacute zacute + +\defineULcharacter Dstroke dstroke +\defineULcharacter Hstroke hstroke +\defineULcharacter Lstroke lstroke +\defineULcharacter Lslash lslash +\defineULcharacter Ostroke ostroke +\defineULcharacter Tstroke tstroke + +\defineULcharacter Cdotaccent cdotaccent +\defineULcharacter Edotaccent edotaccent +\defineULcharacter Gdotaccent gdotaccent +\defineULcharacter Idotaccent idotaccent +\defineULcharacter Zdotaccent zdotaccent + +\defineULcharacter Amacron amacron +\defineULcharacter Emacron emacron +\defineULcharacter Imacron imacron +\defineULcharacter Omacron omacron +\defineULcharacter Umacron umacron + +\defineULcharacter Ccedilla ccedilla +\defineULcharacter Gcedilla gcedilla +\defineULcharacter Kcedilla kcedilla +\defineULcharacter Lcedilla lcedilla +\defineULcharacter Ncedilla ncedilla +\defineULcharacter Rcedilla rcedilla +\defineULcharacter Scedilla scedilla +\defineULcharacter Tcedilla tcedilla + +\defineULcharacter Ccommaaccent ccommaaccent +\defineULcharacter Gcommaaccent gcommaaccent +\defineULcharacter Kcommaaccent kcommaaccent +\defineULcharacter Lcommaaccent lcommaaccent +\defineULcharacter Ncommaaccent ncommaaccent +\defineULcharacter Rcommaaccent rcommaaccent +\defineULcharacter Scommaaccent scommaaccent +\defineULcharacter Tcommaaccent tcommaaccent + +\defineULcharacter Ohungarumlaut ohungarumlaut +\defineULcharacter Uhungarumlaut uhungarumlaut + +\defineULcharacter Aogonek aogonek +\defineULcharacter Eogonek eogonek +\defineULcharacter Iogonek iogonek +\defineULcharacter Uogonek uogonek + +\defineULcharacter Aring aring +\defineULcharacter Uring uring + +\defineULcharacter Abreve abreve +\defineULcharacter Ebreve ebreve +\defineULcharacter Gbreve gbreve +\defineULcharacter Ibreve ibreve +\defineULcharacter Obreve obreve +\defineULcharacter Ubreve ubreve + +\defineULcharacter Ccaron ccaron +\defineULcharacter Dcaron dcaron +\defineULcharacter Ecaron ecaron +\defineULcharacter Lcaron lcaron +\defineULcharacter Ncaron ncaron +\defineULcharacter Rcaron rcaron +\defineULcharacter Scaron scaron +\defineULcharacter Tcaron tcaron +\defineULcharacter Zcaron zcaron + +\defineULcharacter dotlessI dotlessi +\defineULcharacter dotlessJ dotlessj + +\defineULcharacter AEligature aeligature +\defineULcharacter OEligature oeligature +\defineULcharacter Ssharp ssharp +\defineULcharacter IJligature ijligature + +\defineULcharacter Eth eth +\defineULcharacter Thorn thorn + +\endinput diff --git a/tex/context/base/enco-cas.tex b/tex/context/base/enco-cas.tex deleted file mode 100644 index 38d12f9fa..000000000 --- a/tex/context/base/enco-cas.tex +++ /dev/null @@ -1,143 +0,0 @@ -%D \module -%D [ file=enco-cas, -%D version=2005.08.23, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Named Glyph Case Mapping, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D For quite some years \CONTEXT\ used a rather compact way of -%D defining encoded characters as well as case maps. When late -%D 2000 more advanced remapping features were needed (like pdf -%D unicode remapping), named glyphs were introduced to keep the -%D coding tables more readable. At the same time, we introduced -%D named glyph case mapping. - -\defineULcharacter Acircumflex acircumflex -\defineULcharacter Ccircumflex ccircumflex -\defineULcharacter Ecircumflex ecircumflex -\defineULcharacter Gcircumflex gcircumflex -\defineULcharacter Hcircumflex hcircumflex -\defineULcharacter Icircumflex icircumflex -\defineULcharacter Jcircumflex jcircumflex -\defineULcharacter Ocircumflex ocircumflex -\defineULcharacter Scircumflex scircumflex -\defineULcharacter Ucircumflex ucircumflex -\defineULcharacter Wcircumflex wcircumflex -\defineULcharacter Ycircumflex ycircumflex - -\defineULcharacter Agrave agrave -\defineULcharacter Egrave egrave -\defineULcharacter Igrave igrave -\defineULcharacter Ograve ograve -\defineULcharacter Ugrave ugrave -\defineULcharacter Ygrave ygrave - -\defineULcharacter Atilde atilde -\defineULcharacter Itilde itilde -\defineULcharacter Otilde otilde -\defineULcharacter Ntilde ntilde -\defineULcharacter Utilde utilde - -\defineULcharacter Adiaeresis adiaeresis -\defineULcharacter Ediaeresis ediaeresis -\defineULcharacter Idiaeresis idiaeresis -\defineULcharacter Odiaeresis odiaeresis -\defineULcharacter Udiaeresis udiaeresis -\defineULcharacter Ydiaeresis ydiaeresis - -\defineULcharacter Aacute aacute -\defineULcharacter Cacute cacute -\defineULcharacter Eacute eacute -\defineULcharacter Iacute iacute -\defineULcharacter Lacute lacute -\defineULcharacter Nacute nacute -\defineULcharacter Oacute oacute -\defineULcharacter Racute racute -\defineULcharacter Sacute sacute -\defineULcharacter Uacute uacute -\defineULcharacter Yacute yacute -\defineULcharacter Zacute zacute - -\defineULcharacter Dstroke dstroke -\defineULcharacter Hstroke hstroke -\defineULcharacter Lstroke lstroke -\defineULcharacter Lslash lslash -\defineULcharacter Ostroke ostroke -\defineULcharacter Tstroke tstroke - -\defineULcharacter Cdotaccent cdotaccent -\defineULcharacter Edotaccent edotaccent -\defineULcharacter Gdotaccent gdotaccent -\defineULcharacter Idotaccent idotaccent -\defineULcharacter Zdotaccent zdotaccent - -\defineULcharacter Amacron amacron -\defineULcharacter Emacron emacron -\defineULcharacter Imacron imacron -\defineULcharacter Omacron omacron -\defineULcharacter Umacron umacron - -\defineULcharacter Ccedilla ccedilla -\defineULcharacter Gcedilla gcedilla -\defineULcharacter Kcedilla kcedilla -\defineULcharacter Lcedilla lcedilla -\defineULcharacter Ncedilla ncedilla -\defineULcharacter Rcedilla rcedilla -\defineULcharacter Scedilla scedilla -\defineULcharacter Tcedilla tcedilla - -\defineULcharacter Ccommaaccent ccommaaccent -\defineULcharacter Gcommaaccent gcommaaccent -\defineULcharacter Kcommaaccent kcommaaccent -\defineULcharacter Lcommaaccent lcommaaccent -\defineULcharacter Ncommaaccent ncommaaccent -\defineULcharacter Rcommaaccent rcommaaccent -\defineULcharacter Scommaaccent scommaaccent -\defineULcharacter Tcommaaccent tcommaaccent - -\defineULcharacter Ohungarumlaut ohungarumlaut -\defineULcharacter Uhungarumlaut uhungarumlaut - -\defineULcharacter Aogonek aogonek -\defineULcharacter Eogonek eogonek -\defineULcharacter Iogonek iogonek -\defineULcharacter Uogonek uogonek - -\defineULcharacter Aring aring -\defineULcharacter Uring uring - -\defineULcharacter Abreve abreve -\defineULcharacter Ebreve ebreve -\defineULcharacter Gbreve gbreve -\defineULcharacter Ibreve ibreve -\defineULcharacter Obreve obreve -\defineULcharacter Ubreve ubreve - -\defineULcharacter Ccaron ccaron -\defineULcharacter Dcaron dcaron -\defineULcharacter Ecaron ecaron -\defineULcharacter Lcaron lcaron -\defineULcharacter Ncaron ncaron -\defineULcharacter Rcaron rcaron -\defineULcharacter Scaron scaron -\defineULcharacter Tcaron tcaron -\defineULcharacter Zcaron zcaron - -\defineULcharacter dotlessI dotlessi -\defineULcharacter dotlessJ dotlessj - -\defineULcharacter AEligature aeligature -\defineULcharacter OEligature oeligature -\defineULcharacter Ssharp ssharp -\defineULcharacter IJligature ijligature - -\defineULcharacter Eth eth -\defineULcharacter Thorn thorn - -\endinput diff --git a/tex/context/base/enco-chi.mkii b/tex/context/base/enco-chi.mkii new file mode 100644 index 000000000..9d77893a0 --- /dev/null +++ b/tex/context/base/enco-chi.mkii @@ -0,0 +1,371 @@ +%D \module +%D [ file=enco-chi, +%D version=1999.12.02, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Traditional and Simplified Chinese, +%D author={Wang Lei \& Hans Hagen}, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% actually this is also a filter -> enco-fcn.tex + +%D This is an experimental definition. Since we are dealing +%D with unicode's, the registered values are not saved, so +%D actually we're dealing with an pseudo encoding. The digits +%D on the other hand are encoding specific. + +% chinese classes: left=1|right=2|center=3 + +% untested, probably wrong + +\startencoding[cjk-uni] + +\defineuclass 1 32 24 +\defineuclass 1 32 28 +\defineuclass 1 48 20 +\defineuclass 1 48 8 +\defineuclass 1 48 10 +\defineuclass 1 48 12 +\defineuclass 1 48 14 +\defineuclass 1 48 22 +\defineuclass 1 48 16 +\defineuclass 1 255 8 +\defineuclass 1 255 59 +\defineuclass 1 255 64 +\defineuclass 1 255 91 + +\defineuclass 3 0 183 +\defineuclass 3 0 168 +\defineuclass 3 32 38 +\defineuclass 3 255 30 + +\defineuclass 2 48 1 +\defineuclass 2 48 2 +\defineuclass 2 32 20 +\defineuclass 2 255 94 +\defineuclass 2 32 25 +\defineuclass 2 32 29 +\defineuclass 2 48 21 +\defineuclass 2 48 9 +\defineuclass 2 48 11 +\defineuclass 2 48 13 +\defineuclass 2 48 15 +\defineuclass 2 48 23 +\defineuclass 2 48 17 +\defineuclass 2 34 55 +\defineuclass 2 0 176 +\defineuclass 2 32 50 +\defineuclass 2 32 51 +\defineuclass 2 255 1 +\defineuclass 2 255 2 +\defineuclass 2 255 7 +\defineuclass 2 255 9 +\defineuclass 2 255 12 +\defineuclass 2 255 14 +\defineuclass 2 255 26 +\defineuclass 2 255 27 +\defineuclass 2 255 31 +\defineuclass 2 255 61 +\defineuclass 2 255 93 + +\defineudigit 0 37 203 +\defineudigit 1 78 0 +\defineudigit 2 78 140 +\defineudigit 3 78 9 +\defineudigit 4 86 219 +\defineudigit 5 78 148 +\defineudigit 6 81 109 +\defineudigit 7 78 3 +\defineudigit 8 81 107 +\defineudigit 9 78 93 +\defineudigit 10 83 65 +\defineudigit 100 118 126 +\defineudigit 1000 83 67 +\defineudigit 10000 78 7 +\defineudigit 100000000 78 191 + +\defineudigit 0* 150 246 +\defineudigit 1* 88 249 +\defineudigit 2* 141 48 +\defineudigit 3* 83 193 +\defineudigit 4* 128 134 +\defineudigit 5* 79 13 +\defineudigit 6* 150 70 +\defineudigit 7* 103 210 +\defineudigit 8* 99 76 +\defineudigit 9* 115 150 +\defineudigit 10* 98 254 +\defineudigit 100* 79 112 +\defineudigit 1000* 78 223 +\defineudigit 10000* 132 44 +\defineudigit 100000000* 78 191 + +\defineudigit 20 94 255 +\defineudigit 21 78 0 +\defineudigit 22 78 140 +\defineudigit 23 78 9 +\defineudigit 24 86 219 +\defineudigit 25 78 148 +\defineudigit 26 81 109 +\defineudigit 27 78 3 +\defineudigit 28 81 107 +\defineudigit 29 78 93 + +\defineudigit 30 83 69 +\defineudigit 31 78 0 +\defineudigit 32 78 140 +\defineudigit 33 78 9 +\defineudigit 34 86 219 +\defineudigit 35 78 148 +\defineudigit 36 81 109 +\defineudigit 37 78 3 +\defineudigit 38 81 107 +\defineudigit 39 78 93 + +\stopencoding + +% \doif \currentregime {utf} \endinput + +\startencoding[big5] + +\defineuclass 1 161 93 +\defineuclass 1 161 95 +\defineuclass 1 161 97 +\defineuclass 1 161 99 +\defineuclass 1 161 101 +\defineuclass 1 161 103 +\defineuclass 1 161 105 +\defineuclass 1 161 107 +\defineuclass 1 161 111 +\defineuclass 1 161 111 +\defineuclass 1 161 113 +\defineuclass 1 161 115 +\defineuclass 1 161 117 +\defineuclass 1 161 119 +\defineuclass 1 161 121 +\defineuclass 1 161 123 +\defineuclass 1 161 125 +\defineuclass 1 161 161 +\defineuclass 1 161 163 +\defineuclass 1 161 165 +\defineuclass 1 161 167 +\defineuclass 1 161 169 +\defineuclass 1 161 171 + +\defineuclass 3 161 69 +\defineuclass 3 161 75 +\defineuclass 3 161 76 + +\defineuclass 2 161 65 +\defineuclass 2 161 66 +\defineuclass 2 161 67 +\defineuclass 2 161 68 +\defineuclass 2 161 70 +\defineuclass 2 161 71 +\defineuclass 2 161 72 +\defineuclass 2 161 73 +\defineuclass 2 161 74 +\defineuclass 2 161 77 +\defineuclass 2 161 78 +\defineuclass 2 161 79 +\defineuclass 2 161 80 +\defineuclass 2 161 81 +\defineuclass 2 161 82 +\defineuclass 2 161 83 +\defineuclass 2 161 84 +\defineuclass 2 161 88 +\defineuclass 2 161 94 +\defineuclass 2 161 96 +\defineuclass 2 161 98 +\defineuclass 2 161 100 +\defineuclass 2 161 102 +\defineuclass 2 161 104 +\defineuclass 2 161 106 +\defineuclass 2 161 108 +\defineuclass 2 161 110 +\defineuclass 2 161 112 +\defineuclass 2 161 114 +\defineuclass 2 161 116 +\defineuclass 2 161 118 +\defineuclass 2 161 120 +\defineuclass 2 161 122 +\defineuclass 2 161 124 +\defineuclass 2 161 126 +\defineuclass 2 161 162 +\defineuclass 2 161 164 +\defineuclass 2 161 166 +\defineuclass 2 161 168 +\defineuclass 2 161 170 +\defineuclass 2 161 172 +\defineuclass 2 161 196 +\defineuclass 2 161 227 +\defineuclass 2 162 88 +\defineuclass 2 163 223 + +\defineudigit 0 162 179 +\defineudigit 1 164 64 +\defineudigit 2 164 71 +\defineudigit 3 164 84 +\defineudigit 4 165 124 +\defineudigit 5 164 173 +\defineudigit 6 164 187 +\defineudigit 7 164 67 +\defineudigit 8 164 75 +\defineudigit 9 164 69 +\defineudigit 10 164 81 +\defineudigit 100 166 202 +\defineudigit 1000 164 100 +\defineudigit 10000 201 69 +\defineudigit 100000000 187 245 + +\defineudigit 0* 185 115 +\defineudigit 1* 179 252 +\defineudigit 2* 182 76 +\defineudigit 3* 176 209 +\defineudigit 4* 184 118 +\defineudigit 5* 165 238 +\defineudigit 6* 179 176 +\defineudigit 7* 172 110 +\defineudigit 8* 174 195 +\defineudigit 9* 168 104 +\defineudigit 10* 172 66 +\defineudigit 100* 168 213 +\defineudigit 1000* 165 97 +\defineudigit 10000* 184 85 +\defineudigit 100000000* 187 245 + +\defineudigit 20 164 220 +\defineudigit 21 164 64 +\defineudigit 22 164 71 +\defineudigit 23 164 84 +\defineudigit 24 165 124 +\defineudigit 25 164 173 +\defineudigit 26 164 187 +\defineudigit 27 164 67 +\defineudigit 28 164 75 +\defineudigit 29 164 69 + +\defineudigit 30 164 202 +\defineudigit 31 164 64 +\defineudigit 32 164 71 +\defineudigit 33 164 84 +\defineudigit 34 165 124 +\defineudigit 35 164 173 +\defineudigit 36 164 187 +\defineudigit 37 164 67 +\defineudigit 38 164 75 +\defineudigit 39 164 69 + +\stopencoding + +\startencoding[gbk] + +\defineuclass 1 161 174 +\defineuclass 1 161 176 +\defineuclass 1 161 178 +\defineuclass 1 161 180 +\defineuclass 1 161 182 +\defineuclass 1 161 184 +\defineuclass 1 161 186 +\defineuclass 1 161 188 +\defineuclass 1 161 190 +\defineuclass 1 163 168 +\defineuclass 1 163 219 +\defineuclass 1 163 224 +\defineuclass 1 163 251 + +\defineuclass 3 161 164 +\defineuclass 3 161 167 +\defineuclass 3 161 173 +\defineuclass 3 163 190 + +\defineuclass 2 161 162 +\defineuclass 2 161 163 +\defineuclass 2 161 170 +\defineuclass 2 161 171 +\defineuclass 2 161 175 +\defineuclass 2 161 177 +\defineuclass 2 161 179 +\defineuclass 2 161 181 +\defineuclass 2 161 183 +\defineuclass 2 161 185 +\defineuclass 2 161 187 +\defineuclass 2 161 189 +\defineuclass 2 161 191 +\defineuclass 2 161 203 +\defineuclass 2 161 227 +\defineuclass 2 161 228 +\defineuclass 2 161 229 +\defineuclass 2 163 161 +\defineuclass 2 163 162 +\defineuclass 2 163 167 +\defineuclass 2 163 169 +\defineuclass 2 163 172 +\defineuclass 2 163 174 +\defineuclass 2 163 186 +\defineuclass 2 163 187 +\defineuclass 2 163 191 +\defineuclass 2 163 221 +\defineuclass 2 163 253 + +\defineudigit 0 161 240 +\defineudigit 1 210 187 +\defineudigit 2 182 254 +\defineudigit 3 200 253 +\defineudigit 4 203 196 +\defineudigit 5 206 229 +\defineudigit 6 193 249 +\defineudigit 7 198 223 +\defineudigit 8 176 203 +\defineudigit 9 190 197 +\defineudigit 10 202 174 +\defineudigit 100 176 217 +\defineudigit 1000 199 167 +\defineudigit 10000 205 242 +\defineudigit 100000000 210 218 + +\defineudigit 0* 193 227 +\defineudigit 1* 210 188 +\defineudigit 2* 183 161 +\defineudigit 3* 200 254 +\defineudigit 4* 203 193 +\defineudigit 5* 206 233 +\defineudigit 6* 194 189 +\defineudigit 7* 198 226 +\defineudigit 8* 176 198 +\defineudigit 9* 190 193 +\defineudigit 10* 202 176 +\defineudigit 100* 176 219 +\defineudigit 1000* 199 170 +\defineudigit 10000* 200 102 +\defineudigit 100000000* 210 218 + +\defineudigit 20 216 165 +\defineudigit 21 210 187 +\defineudigit 22 182 254 +\defineudigit 23 200 253 +\defineudigit 24 203 196 +\defineudigit 25 206 229 +\defineudigit 26 193 249 +\defineudigit 27 198 223 +\defineudigit 28 176 203 +\defineudigit 29 190 197 + +\defineudigit 30 216 166 +\defineudigit 31 210 187 +\defineudigit 32 182 254 +\defineudigit 33 200 253 +\defineudigit 34 203 196 +\defineudigit 35 206 229 +\defineudigit 36 193 249 +\defineudigit 37 198 223 +\defineudigit 38 176 203 +\defineudigit 39 190 197 + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-chi.tex b/tex/context/base/enco-chi.tex deleted file mode 100644 index 9d77893a0..000000000 --- a/tex/context/base/enco-chi.tex +++ /dev/null @@ -1,371 +0,0 @@ -%D \module -%D [ file=enco-chi, -%D version=1999.12.02, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Traditional and Simplified Chinese, -%D author={Wang Lei \& Hans Hagen}, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% actually this is also a filter -> enco-fcn.tex - -%D This is an experimental definition. Since we are dealing -%D with unicode's, the registered values are not saved, so -%D actually we're dealing with an pseudo encoding. The digits -%D on the other hand are encoding specific. - -% chinese classes: left=1|right=2|center=3 - -% untested, probably wrong - -\startencoding[cjk-uni] - -\defineuclass 1 32 24 -\defineuclass 1 32 28 -\defineuclass 1 48 20 -\defineuclass 1 48 8 -\defineuclass 1 48 10 -\defineuclass 1 48 12 -\defineuclass 1 48 14 -\defineuclass 1 48 22 -\defineuclass 1 48 16 -\defineuclass 1 255 8 -\defineuclass 1 255 59 -\defineuclass 1 255 64 -\defineuclass 1 255 91 - -\defineuclass 3 0 183 -\defineuclass 3 0 168 -\defineuclass 3 32 38 -\defineuclass 3 255 30 - -\defineuclass 2 48 1 -\defineuclass 2 48 2 -\defineuclass 2 32 20 -\defineuclass 2 255 94 -\defineuclass 2 32 25 -\defineuclass 2 32 29 -\defineuclass 2 48 21 -\defineuclass 2 48 9 -\defineuclass 2 48 11 -\defineuclass 2 48 13 -\defineuclass 2 48 15 -\defineuclass 2 48 23 -\defineuclass 2 48 17 -\defineuclass 2 34 55 -\defineuclass 2 0 176 -\defineuclass 2 32 50 -\defineuclass 2 32 51 -\defineuclass 2 255 1 -\defineuclass 2 255 2 -\defineuclass 2 255 7 -\defineuclass 2 255 9 -\defineuclass 2 255 12 -\defineuclass 2 255 14 -\defineuclass 2 255 26 -\defineuclass 2 255 27 -\defineuclass 2 255 31 -\defineuclass 2 255 61 -\defineuclass 2 255 93 - -\defineudigit 0 37 203 -\defineudigit 1 78 0 -\defineudigit 2 78 140 -\defineudigit 3 78 9 -\defineudigit 4 86 219 -\defineudigit 5 78 148 -\defineudigit 6 81 109 -\defineudigit 7 78 3 -\defineudigit 8 81 107 -\defineudigit 9 78 93 -\defineudigit 10 83 65 -\defineudigit 100 118 126 -\defineudigit 1000 83 67 -\defineudigit 10000 78 7 -\defineudigit 100000000 78 191 - -\defineudigit 0* 150 246 -\defineudigit 1* 88 249 -\defineudigit 2* 141 48 -\defineudigit 3* 83 193 -\defineudigit 4* 128 134 -\defineudigit 5* 79 13 -\defineudigit 6* 150 70 -\defineudigit 7* 103 210 -\defineudigit 8* 99 76 -\defineudigit 9* 115 150 -\defineudigit 10* 98 254 -\defineudigit 100* 79 112 -\defineudigit 1000* 78 223 -\defineudigit 10000* 132 44 -\defineudigit 100000000* 78 191 - -\defineudigit 20 94 255 -\defineudigit 21 78 0 -\defineudigit 22 78 140 -\defineudigit 23 78 9 -\defineudigit 24 86 219 -\defineudigit 25 78 148 -\defineudigit 26 81 109 -\defineudigit 27 78 3 -\defineudigit 28 81 107 -\defineudigit 29 78 93 - -\defineudigit 30 83 69 -\defineudigit 31 78 0 -\defineudigit 32 78 140 -\defineudigit 33 78 9 -\defineudigit 34 86 219 -\defineudigit 35 78 148 -\defineudigit 36 81 109 -\defineudigit 37 78 3 -\defineudigit 38 81 107 -\defineudigit 39 78 93 - -\stopencoding - -% \doif \currentregime {utf} \endinput - -\startencoding[big5] - -\defineuclass 1 161 93 -\defineuclass 1 161 95 -\defineuclass 1 161 97 -\defineuclass 1 161 99 -\defineuclass 1 161 101 -\defineuclass 1 161 103 -\defineuclass 1 161 105 -\defineuclass 1 161 107 -\defineuclass 1 161 111 -\defineuclass 1 161 111 -\defineuclass 1 161 113 -\defineuclass 1 161 115 -\defineuclass 1 161 117 -\defineuclass 1 161 119 -\defineuclass 1 161 121 -\defineuclass 1 161 123 -\defineuclass 1 161 125 -\defineuclass 1 161 161 -\defineuclass 1 161 163 -\defineuclass 1 161 165 -\defineuclass 1 161 167 -\defineuclass 1 161 169 -\defineuclass 1 161 171 - -\defineuclass 3 161 69 -\defineuclass 3 161 75 -\defineuclass 3 161 76 - -\defineuclass 2 161 65 -\defineuclass 2 161 66 -\defineuclass 2 161 67 -\defineuclass 2 161 68 -\defineuclass 2 161 70 -\defineuclass 2 161 71 -\defineuclass 2 161 72 -\defineuclass 2 161 73 -\defineuclass 2 161 74 -\defineuclass 2 161 77 -\defineuclass 2 161 78 -\defineuclass 2 161 79 -\defineuclass 2 161 80 -\defineuclass 2 161 81 -\defineuclass 2 161 82 -\defineuclass 2 161 83 -\defineuclass 2 161 84 -\defineuclass 2 161 88 -\defineuclass 2 161 94 -\defineuclass 2 161 96 -\defineuclass 2 161 98 -\defineuclass 2 161 100 -\defineuclass 2 161 102 -\defineuclass 2 161 104 -\defineuclass 2 161 106 -\defineuclass 2 161 108 -\defineuclass 2 161 110 -\defineuclass 2 161 112 -\defineuclass 2 161 114 -\defineuclass 2 161 116 -\defineuclass 2 161 118 -\defineuclass 2 161 120 -\defineuclass 2 161 122 -\defineuclass 2 161 124 -\defineuclass 2 161 126 -\defineuclass 2 161 162 -\defineuclass 2 161 164 -\defineuclass 2 161 166 -\defineuclass 2 161 168 -\defineuclass 2 161 170 -\defineuclass 2 161 172 -\defineuclass 2 161 196 -\defineuclass 2 161 227 -\defineuclass 2 162 88 -\defineuclass 2 163 223 - -\defineudigit 0 162 179 -\defineudigit 1 164 64 -\defineudigit 2 164 71 -\defineudigit 3 164 84 -\defineudigit 4 165 124 -\defineudigit 5 164 173 -\defineudigit 6 164 187 -\defineudigit 7 164 67 -\defineudigit 8 164 75 -\defineudigit 9 164 69 -\defineudigit 10 164 81 -\defineudigit 100 166 202 -\defineudigit 1000 164 100 -\defineudigit 10000 201 69 -\defineudigit 100000000 187 245 - -\defineudigit 0* 185 115 -\defineudigit 1* 179 252 -\defineudigit 2* 182 76 -\defineudigit 3* 176 209 -\defineudigit 4* 184 118 -\defineudigit 5* 165 238 -\defineudigit 6* 179 176 -\defineudigit 7* 172 110 -\defineudigit 8* 174 195 -\defineudigit 9* 168 104 -\defineudigit 10* 172 66 -\defineudigit 100* 168 213 -\defineudigit 1000* 165 97 -\defineudigit 10000* 184 85 -\defineudigit 100000000* 187 245 - -\defineudigit 20 164 220 -\defineudigit 21 164 64 -\defineudigit 22 164 71 -\defineudigit 23 164 84 -\defineudigit 24 165 124 -\defineudigit 25 164 173 -\defineudigit 26 164 187 -\defineudigit 27 164 67 -\defineudigit 28 164 75 -\defineudigit 29 164 69 - -\defineudigit 30 164 202 -\defineudigit 31 164 64 -\defineudigit 32 164 71 -\defineudigit 33 164 84 -\defineudigit 34 165 124 -\defineudigit 35 164 173 -\defineudigit 36 164 187 -\defineudigit 37 164 67 -\defineudigit 38 164 75 -\defineudigit 39 164 69 - -\stopencoding - -\startencoding[gbk] - -\defineuclass 1 161 174 -\defineuclass 1 161 176 -\defineuclass 1 161 178 -\defineuclass 1 161 180 -\defineuclass 1 161 182 -\defineuclass 1 161 184 -\defineuclass 1 161 186 -\defineuclass 1 161 188 -\defineuclass 1 161 190 -\defineuclass 1 163 168 -\defineuclass 1 163 219 -\defineuclass 1 163 224 -\defineuclass 1 163 251 - -\defineuclass 3 161 164 -\defineuclass 3 161 167 -\defineuclass 3 161 173 -\defineuclass 3 163 190 - -\defineuclass 2 161 162 -\defineuclass 2 161 163 -\defineuclass 2 161 170 -\defineuclass 2 161 171 -\defineuclass 2 161 175 -\defineuclass 2 161 177 -\defineuclass 2 161 179 -\defineuclass 2 161 181 -\defineuclass 2 161 183 -\defineuclass 2 161 185 -\defineuclass 2 161 187 -\defineuclass 2 161 189 -\defineuclass 2 161 191 -\defineuclass 2 161 203 -\defineuclass 2 161 227 -\defineuclass 2 161 228 -\defineuclass 2 161 229 -\defineuclass 2 163 161 -\defineuclass 2 163 162 -\defineuclass 2 163 167 -\defineuclass 2 163 169 -\defineuclass 2 163 172 -\defineuclass 2 163 174 -\defineuclass 2 163 186 -\defineuclass 2 163 187 -\defineuclass 2 163 191 -\defineuclass 2 163 221 -\defineuclass 2 163 253 - -\defineudigit 0 161 240 -\defineudigit 1 210 187 -\defineudigit 2 182 254 -\defineudigit 3 200 253 -\defineudigit 4 203 196 -\defineudigit 5 206 229 -\defineudigit 6 193 249 -\defineudigit 7 198 223 -\defineudigit 8 176 203 -\defineudigit 9 190 197 -\defineudigit 10 202 174 -\defineudigit 100 176 217 -\defineudigit 1000 199 167 -\defineudigit 10000 205 242 -\defineudigit 100000000 210 218 - -\defineudigit 0* 193 227 -\defineudigit 1* 210 188 -\defineudigit 2* 183 161 -\defineudigit 3* 200 254 -\defineudigit 4* 203 193 -\defineudigit 5* 206 233 -\defineudigit 6* 194 189 -\defineudigit 7* 198 226 -\defineudigit 8* 176 198 -\defineudigit 9* 190 193 -\defineudigit 10* 202 176 -\defineudigit 100* 176 219 -\defineudigit 1000* 199 170 -\defineudigit 10000* 200 102 -\defineudigit 100000000* 210 218 - -\defineudigit 20 216 165 -\defineudigit 21 210 187 -\defineudigit 22 182 254 -\defineudigit 23 200 253 -\defineudigit 24 203 196 -\defineudigit 25 206 229 -\defineudigit 26 193 249 -\defineudigit 27 198 223 -\defineudigit 28 176 203 -\defineudigit 29 190 197 - -\defineudigit 30 216 166 -\defineudigit 31 210 187 -\defineudigit 32 182 254 -\defineudigit 33 200 253 -\defineudigit 34 203 196 -\defineudigit 35 206 229 -\defineudigit 36 193 249 -\defineudigit 37 198 223 -\defineudigit 38 176 203 -\defineudigit 39 190 197 - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-com.mkii b/tex/context/base/enco-com.mkii new file mode 100644 index 000000000..42d0d4774 --- /dev/null +++ b/tex/context/base/enco-com.mkii @@ -0,0 +1,37 @@ +%D \module +%D [ file=enco-com, +%D version=2000.20.12, % split from base file +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Composed Characters Commands, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=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 Here we map some \quote {short} names onto the more +%D verbose glyph names. + +\def\AA{\Aring} +\def\aa{\aring} +\def\AE{\AEligature} +\def\ae{\aeligature} +\def\CC{\Ccedilla} +\def\cc{\ccedilla} +\def \L{\Lstroke} +\def \l{\lstroke} +\def \O{\Ostroke} +\def \o{\ostroke} +\def\OE{\OEligature} +\def\oe{\oeligature} +\def\SZ{\Ssharp} +\def\sz{\ssharp} +\def\SS{\ssharp} +\def\IJ{\IJligature} +\def\ij{\ijligature} +\def \i{\dotlessi} +\def \j{\dotlessj} + +\endinput diff --git a/tex/context/base/enco-com.tex b/tex/context/base/enco-com.tex deleted file mode 100644 index 42d0d4774..000000000 --- a/tex/context/base/enco-com.tex +++ /dev/null @@ -1,37 +0,0 @@ -%D \module -%D [ file=enco-com, -%D version=2000.20.12, % split from base file -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Composed Characters Commands, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=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 Here we map some \quote {short} names onto the more -%D verbose glyph names. - -\def\AA{\Aring} -\def\aa{\aring} -\def\AE{\AEligature} -\def\ae{\aeligature} -\def\CC{\Ccedilla} -\def\cc{\ccedilla} -\def \L{\Lstroke} -\def \l{\lstroke} -\def \O{\Ostroke} -\def \o{\ostroke} -\def\OE{\OEligature} -\def\oe{\oeligature} -\def\SZ{\Ssharp} -\def\sz{\ssharp} -\def\SS{\ssharp} -\def\IJ{\IJligature} -\def\ij{\ijligature} -\def \i{\dotlessi} -\def \j{\dotlessj} - -\endinput diff --git a/tex/context/base/enco-cyr.mkii b/tex/context/base/enco-cyr.mkii new file mode 100644 index 000000000..36bca82b5 --- /dev/null +++ b/tex/context/base/enco-cyr.mkii @@ -0,0 +1,1037 @@ +%D \module +%D [ file=enco-cyr, +%D version=2003.01.24, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Cyrillic, +%D author=..., +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D The following kerning test is inspired by a test file +%D provided by Victor Figurnov. I hope he still recognizes +%D some bit and pieces. +%D +%D \starttyping +%D \setupoutput[pdftex] +%D +%D \startMPenvironment[global] +%D \useregime[cyr] +%D \useencoding[cyr] +%D \mainlanguage[ru] +%D \enableregime[cp1251] +%D \setupbodyfont[cyr] +%D \stopMPenvironment +%D +%D \startbuffer +%D \starttabulate[|l|l|l|] +%D \NC \ruledhbox{} \NC \ruledhbox{AV} \NC with kerning \NC \NR +%D \NC \ruledhbox{{}{}} \NC \ruledhbox{A{}V} \NC without kerning \NC \NR +%D \NC \ruledhbox{\tfd } \NC \ruledhbox{\tfd AV} \NC with kerning \NC \NR +%D \NC \ruledhbox{\tfd {}{}} \NC \ruledhbox{\tfd A{}V} \NC without kerning \NC \NR +%D \stoptabulate +%D +%D \showkerning{ } +%D \stopbuffer +%D +%D \starttext +%D +%D \title{Kerning test} +%D +%D \typebuffer +%D +%D \rm \subject{Serif font} \getbuffer +%D \ss \subject{SansSerif font} \getbuffer +%D \tt \subject{MonoSpacec font} \getbuffer +%D +%D \stoptext +%D \stoptyping + +%D We start with a fallback, define by HH, who assumes that +%D this is phonetic. + +\startmapping[t2a] + +\resetcaserange 128 to 255 + +\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian) +\definecasemaps 224 to 255 lc 0 uc -32 + +\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav) +\definecasemaps 160 to 188 lc 0 uc -32 + +\definecasemap 73 105 73 \definecasemap 105 105 73 % cyrillicII +\definecasemap 74 106 74 \definecasemap 106 106 74 % cyrillicJE +\definecasemap 81 113 81 \definecasemap 113 113 81 % cyrillicQ +\definecasemap 87 119 87 \definecasemap 119 119 87 % cyrillicW + +\stopmapping + +\startencoding[t2a] + +\definecharacter textgrave 0 +\definecharacter textacute 1 +\definecharacter textcircumflex 2 +\definecharacter texttilde 3 +\definecharacter textdiaeresis 4 +\definecharacter texthungarumlaut 5 +\definecharacter textring 6 +\definecharacter textcaron 7 +\definecharacter textbreve 8 +\definecharacter textmacron 9 +\definecharacter textdotaccent 10 +\definecharacter textcedilla 11 +\definecharacter textogonek 12 + +\definecharacter textcyrillicflex 18 +\definecharacter textdblgrave 19 +\definecharacter textcyrillicbreve 20 + +\definecharacter endash 21 +\definecharacter emdash 22 + +\definecharacter textcompwordmark 23 +\definecharacter textbackslash 92 +\definecharacter textasciicircum 94 +\definecharacter textunderscore 95 +\definecharacter textbraceleft 123 +\definecharacter textbraceright 125 +\definecharacter textasciitilde 126 +\definecharacter textnumero 157 +\definecharacter textcurrency 158 +\definecharacter sectionmark 159 + +\definecharacter quotedbl 34 +\definecharacter quoteleft 96 +\definecharacter upperleftsingleninequote 39 +\definecharacter quotedblleft 16 +\definecharacter quotedblright 17 +\definecharacter lowerleftdoubleninequote 189 +\definecharacter upperrightdoublesixquote 16 +\definecharacter upperrightdoubleninequote 17 +\definecharacter quotedblbase 189 + +\definecharacter cyrillicpalochka 13 +\definecharacter cyrilliclangle 14 +\definecharacter cyrillicrangle 15 + +\definecharacter leftguillemot 190 +\definecharacter rightguillemot 191 +\definecharacter dotlessi 25 + +\definecharacter cyrillicA 192 +\definecharacter cyrillica 224 +\definecharacter cyrillicB 193 +\definecharacter cyrillicb 225 +\definecharacter cyrillicV 194 +\definecharacter cyrillicv 226 +\definecharacter cyrillicG 195 +\definecharacter cyrillicg 227 +\definecharacter cyrillicD 196 +\definecharacter cyrillicd 228 +\definecharacter cyrillicE 197 +\definecharacter cyrillice 229 +\definecharacter cyrillicZH 198 +\definecharacter cyrilliczh 230 +\definecharacter cyrillicZ 199 +\definecharacter cyrillicz 231 +\definecharacter cyrillicI 200 +\definecharacter cyrillici 232 +\definecharacter cyrillicISHRT 201 +\definecharacter cyrillicishrt 233 +\definecharacter cyrillicK 202 +\definecharacter cyrillick 234 +\definecharacter cyrillicL 203 +\definecharacter cyrillicl 235 +\definecharacter cyrillicM 204 +\definecharacter cyrillicm 236 +\definecharacter cyrillicN 205 +\definecharacter cyrillicn 237 +\definecharacter cyrillicO 206 +\definecharacter cyrillico 238 +\definecharacter cyrillicP 207 +\definecharacter cyrillicp 239 +\definecharacter cyrillicR 208 +\definecharacter cyrillicr 240 +\definecharacter cyrillicS 209 +\definecharacter cyrillics 241 +\definecharacter cyrillicT 210 +\definecharacter cyrillict 242 +\definecharacter cyrillicU 211 +\definecharacter cyrillicu 243 +\definecharacter cyrillicF 212 +\definecharacter cyrillicf 244 +\definecharacter cyrillicH 213 +\definecharacter cyrillich 245 +\definecharacter cyrillicC 214 +\definecharacter cyrillicc 246 +\definecharacter cyrillicCH 215 +\definecharacter cyrillicch 247 +\definecharacter cyrillicSH 216 +\definecharacter cyrillicsh 248 +\definecharacter cyrillicSHCH 217 +\definecharacter cyrillicshch 249 +\definecharacter cyrillicHRDSN 218 +\definecharacter cyrillichrdsn 250 +\definecharacter cyrillicERY 219 +\definecharacter cyrillicery 251 +\definecharacter cyrillicSFTSN 220 +\definecharacter cyrillicsftsn 252 +\definecharacter cyrillicEREV 221 +\definecharacter cyrillicerev 253 +\definecharacter cyrillicYU 222 +\definecharacter cyrillicyu 254 +\definecharacter cyrillicYA 223 +\definecharacter cyrillicya 255 +\definecharacter cyrillicGUP 128 +\definecharacter cyrillicgup 160 +\definecharacter cyrillicGHCRS 129 +\definecharacter cyrillicghcrs 161 +\definecharacter cyrillicDJE 130 +\definecharacter cyrillicdje 162 +\definecharacter cyrillicTSHE 131 +\definecharacter cyrillictshe 163 +\definecharacter cyrillicSHHA 132 +\definecharacter cyrillicshha 164 +\definecharacter cyrillicZHDSC 133 +\definecharacter cyrilliczhdsc 165 +\definecharacter cyrillicZDSC 134 +\definecharacter cyrilliczdsc 166 +\definecharacter cyrillicLJE 135 +\definecharacter cyrilliclje 167 +\definecharacter cyrillicYI 136 +\definecharacter cyrillicyi 168 +\definecharacter cyrillicKDSC 137 +\definecharacter cyrillickdsc 169 +\definecharacter cyrillicKBEAK 138 +\definecharacter cyrillickbeak 170 +\definecharacter cyrillicKVCRS 139 +\definecharacter cyrillickvcrs 171 +\definecharacter cyrillicAE 140 +\definecharacter cyrillicae 172 +\definecharacter cyrillicNDSC 141 +\definecharacter cyrillicndsc 173 +\definecharacter cyrillicNG 142 +\definecharacter cyrillicng 174 +\definecharacter cyrillicDZE 143 +\definecharacter cyrillicdze 175 +\definecharacter cyrillicOTLD 144 +\definecharacter cyrillicotld 176 +\definecharacter cyrillicSDSC 145 +\definecharacter cyrillicsdsc 177 +\definecharacter cyrillicUSHRT 146 +\definecharacter cyrillicushrt 178 +\definecharacter cyrillicY 147 +\definecharacter cyrillicy 179 +\definecharacter cyrillicYHCRS 148 +\definecharacter cyrillicyhcrs 180 +\definecharacter cyrillicHDSC 149 +\definecharacter cyrillichdsc 181 +\definecharacter cyrillicDZHE 150 +\definecharacter cyrillicdzhe 182 +\definecharacter cyrillicCHVCRS 151 +\definecharacter cyrillicchvcrs 183 +\definecharacter cyrillicCHRDSC 152 +\definecharacter cyrillicchrdsc 184 +\definecharacter cyrillicIE 153 +\definecharacter cyrillicie 185 +\definecharacter cyrillicSCHWA 154 +\definecharacter cyrillicschwa 186 +\definecharacter cyrillicNJE 155 +\definecharacter cyrillicnje 187 +\definecharacter cyrillicYO 156 +\definecharacter cyrillicyo 188 +\definecharacter cyrillicII 73 +\definecharacter cyrillicii 105 +\definecharacter cyrillicJE 74 +\definecharacter cyrillicje 106 +\definecharacter cyrillicQ 81 +\definecharacter cyrillicq 113 +\definecharacter cyrillicW 87 +\definecharacter cyrillicw 119 + +% \definecharacter textperthousand {\%\char 24 } +% \definecharacter textpertenthousand {\%\char 24\char 24 } + +\definecharacter cyrillicgheupturn 160 % to satisfy the patterns + +\stopencoding + +\startmapping[t2b] + +\resetcaserange 128 to 255 + +\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian) +\definecasemaps 224 to 255 lc 0 uc -32 + +\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav) +\definecasemaps 160 to 188 lc 0 uc -32 + +\definecasemap 73 105 73 \definecasemap 105 105 73 % cyrillicII +\definecasemap 74 106 74 \definecasemap 106 106 74 % cyrillicJE +\definecasemap 81 113 81 \definecasemap 113 113 81 % cyrillicQ +\definecasemap 83 115 83 \definecasemap 115 115 83 % cyrillicDZE +\definecasemap 87 119 87 \definecasemap 119 119 87 % cyrillicW + +\stopmapping + +\startencoding[t2b] + +\definecharacter textgrave 0 +\definecharacter textacute 1 +\definecharacter textcircumflex 2 +\definecharacter texttilde 3 +\definecharacter textdiaeresis 4 +\definecharacter texthungarumlaut 5 +\definecharacter textring 6 +\definecharacter textcaron 7 +\definecharacter textbreve 8 +\definecharacter textmacron 9 +\definecharacter textdotaccent 10 +\definecharacter textcedilla 11 +\definecharacter textogonek 12 + +\definecharacter textcyrillicflex 18 +\definecharacter textdblgrave 19 +\definecharacter textcyrillicbreve 20 + +\definecharacter endash 21 +\definecharacter emdash 22 + +\definecharacter textcompwordmark 23 +\definecharacter textbackslash 92 +\definecharacter textasciicircum 94 +\definecharacter textunderscore 95 +\definecharacter textbraceleft 123 +\definecharacter textbraceright 125 +\definecharacter textasciitilde 126 +\definecharacter textnumero 157 +\definecharacter textcurrency 158 +\definecharacter sectionmark 159 +\definecharacter quotedbl 34 +\definecharacter quoteleft 96 +\definecharacter upperleftsingleninequote 39 +\definecharacter quotedblleft 16 +\definecharacter quotedblright 17 +\definecharacter lowerleftdoubleninequote 189 + +\definecharacter upperrightdoublesixquote 16 +\definecharacter upperrightdoubleninequote 17 +\definecharacter quotedblbase 189 + +\definecharacter cyrillicpalochka 13 +\definecharacter cyrilliclangle 14 +\definecharacter cyrillicrangle 15 + +\definecharacter leftguillemot 190 +\definecharacter rightguillemot 191 +\definecharacter dotlessi 25 + +\definecharacter cyrillicA 192 +\definecharacter cyrillica 224 +\definecharacter cyrillicB 193 +\definecharacter cyrillicb 225 +\definecharacter cyrillicV 194 +\definecharacter cyrillicv 226 +\definecharacter cyrillicG 195 +\definecharacter cyrillicg 227 +\definecharacter cyrillicD 196 +\definecharacter cyrillicd 228 +\definecharacter cyrillicE 197 +\definecharacter cyrillice 229 +\definecharacter cyrillicZH 198 +\definecharacter cyrilliczh 230 +\definecharacter cyrillicZ 199 +\definecharacter cyrillicz 231 +\definecharacter cyrillicI 200 +\definecharacter cyrillici 232 +\definecharacter cyrillicISHRT 201 +\definecharacter cyrillicishrt 233 +\definecharacter cyrillicK 202 +\definecharacter cyrillick 234 +\definecharacter cyrillicL 203 +\definecharacter cyrillicl 235 +\definecharacter cyrillicM 204 +\definecharacter cyrillicm 236 +\definecharacter cyrillicN 205 +\definecharacter cyrillicn 237 +\definecharacter cyrillicO 206 +\definecharacter cyrillico 238 +\definecharacter cyrillicP 207 +\definecharacter cyrillicp 239 +\definecharacter cyrillicR 208 +\definecharacter cyrillicr 240 +\definecharacter cyrillicS 209 +\definecharacter cyrillics 241 +\definecharacter cyrillicT 210 +\definecharacter cyrillict 242 +\definecharacter cyrillicU 211 +\definecharacter cyrillicu 243 +\definecharacter cyrillicF 212 +\definecharacter cyrillicf 244 +\definecharacter cyrillicH 213 +\definecharacter cyrillich 245 +\definecharacter cyrillicC 214 +\definecharacter cyrillicc 246 +\definecharacter cyrillicCH 215 +\definecharacter cyrillicch 247 +\definecharacter cyrillicSH 216 +\definecharacter cyrillicsh 248 +\definecharacter cyrillicSHCH 217 +\definecharacter cyrillicshch 249 +\definecharacter cyrillicHRDSN 218 +\definecharacter cyrillichrdsn 250 +\definecharacter cyrillicERY 219 +\definecharacter cyrillicery 251 +\definecharacter cyrillicSFTSN 220 +\definecharacter cyrillicsftsn 252 +\definecharacter cyrillicEREV 221 +\definecharacter cyrillicerev 253 +\definecharacter cyrillicYU 222 +\definecharacter cyrillicyu 254 +\definecharacter cyrillicYA 223 +\definecharacter cyrillicya 255 +\definecharacter cyrillicGDSCHCRS 128 +\definecharacter cyrillicgdschcrs 160 +\definecharacter cyrillicGHCRS 129 +\definecharacter cyrillicghcrs 161 +\definecharacter cyrillicGDSC 130 +\definecharacter cyrillicgdsc 162 +\definecharacter cyrillicGHK 131 +\definecharacter cyrillicghk 163 +\definecharacter cyrillicSHHA 132 +\definecharacter cyrillicshha 164 +\definecharacter cyrillicZHDSC 133 +\definecharacter cyrilliczhdsc 165 +\definecharacter cyrillicDELTA 134 +\definecharacter cyrillicdelta 166 +\definecharacter cyrillicABHDZE 135 +\definecharacter cyrillicabhdze 167 +\definecharacter cyrillicLJE 136 +\definecharacter cyrilliclje 168 +\definecharacter cyrillicKDSC 137 +\definecharacter cyrillickdsc 169 +\definecharacter cyrillicLDSC 138 +\definecharacter cyrillicldsc 170 +\definecharacter cyrillicKHK 139 +\definecharacter cyrillickhk 171 +\definecharacter cyrillicLHK 140 +\definecharacter cyrilliclhk 172 +\definecharacter cyrillicNDSC 141 +\definecharacter cyrillicndsc 173 +\definecharacter cyrillicNG 142 +\definecharacter cyrillicng 174 +\definecharacter cyrillicNHK 143 +\definecharacter cyrillicnhk 175 +\definecharacter cyrillicOTLD 144 +\definecharacter cyrillicotld 176 +\definecharacter cyrillicSACRS 145 +\definecharacter cyrillicsacrs 177 +\definecharacter cyrillicUSHRT 146 +\definecharacter cyrillicushrt 178 +\definecharacter cyrillicY 147 +\definecharacter cyrillicy 179 +\definecharacter cyrillicHHCRS 148 +\definecharacter cyrillichhcrs 180 +\definecharacter cyrillicHDSC 149 +\definecharacter cyrillichdsc 181 +\definecharacter cyrillicHHK 150 +\definecharacter cyrillichhk 182 +\definecharacter cyrillicCHLDSC 151 +\definecharacter cyrillicchldsc 183 +\definecharacter cyrillicCHRDSC 152 +\definecharacter cyrillicchrdsc 184 +\definecharacter cyrillicNJE 153 +\definecharacter cyrillicnje 185 +\definecharacter cyrillicSCHWA 154 +\definecharacter cyrillicschwa 186 +\definecharacter cyrillicEPS 155 +\definecharacter cyrilliceps 187 +\definecharacter cyrillicYO 156 +\definecharacter cyrillicyo 188 +\definecharacter cyrillicII 73 +\definecharacter cyrillicii 105 +\definecharacter cyrillicJE 74 +\definecharacter cyrillicje 106 +\definecharacter cyrillicQ 81 +\definecharacter cyrillicq 113 +\definecharacter cyrillicDZE 83 +\definecharacter cyrillicdze 115 +\definecharacter cyrillicW 87 +\definecharacter cyrillicw 119 + +\stopencoding + +\startmapping[t2c] + +\resetcaserange 128 to 255 + +\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian) +\definecasemaps 224 to 255 lc 0 uc -32 + +\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav) +\definecasemaps 160 to 188 lc 0 uc -32 + +\definecasemap 73 105 73 \definecasemap 105 105 73 % cyrillicII +\definecasemap 74 106 74 \definecasemap 106 106 74 % cyrillicJE +\definecasemap 81 113 81 \definecasemap 113 113 81 % cyrillicQ +\definecasemap 83 115 83 \definecasemap 115 115 83 % cyrillicDZE +\definecasemap 87 119 87 \definecasemap 119 119 87 % cyrillicW + +\stopmapping + +\startencoding[t2c] + +\definecharacter textgrave 0 +\definecharacter textacute 1 +\definecharacter textcircumflex 2 +\definecharacter texttilde 3 +\definecharacter textdiaeresis 4 +\definecharacter texthungarumlaut 5 +\definecharacter textring 6 +\definecharacter textcaron 7 +\definecharacter textbreve 8 +\definecharacter textmacron 9 +\definecharacter textdotaccent 10 +\definecharacter textcedilla 11 +\definecharacter textogonek 12 + +\definecharacter textcyrillicflex 18 +\definecharacter textdblgrave 19 +\definecharacter textcyrillicbreve 20 + +\definecharacter endash 21 +\definecharacter emdash 22 + +\definecharacter textcompwordmark 23 +\definecharacter textbackslash 92 +\definecharacter textasciicircum 94 +\definecharacter textunderscore 95 +\definecharacter textbraceleft 123 +\definecharacter textbraceright 125 +\definecharacter textasciitilde 126 +\definecharacter textnumero 157 +\definecharacter textcurrency 158 +\definecharacter sectionmark 159 +\definecharacter quotedbl 34 +\definecharacter quoteleft 96 +\definecharacter upperleftsingleninequote 39 +\definecharacter quotedblleft 16 +\definecharacter quotedblright 17 +\definecharacter lowerleftdoubleninequote 189 +\definecharacter upperrightdoublesixquote 16 +\definecharacter upperrightdoubleninequote 17 +\definecharacter quotedblbase 189 + +\definecharacter cyrillicpalochka 13 +\definecharacter cyrilliclangle 14 +\definecharacter cyrillicrangle 15 + +\definecharacter leftguillemot 190 +\definecharacter rightguillemot 191 + +\definecharacter dotlessi 25 + +\definecharacter cyrillicA 192 +\definecharacter cyrillica 224 +\definecharacter cyrillicB 193 +\definecharacter cyrillicb 225 +\definecharacter cyrillicV 194 +\definecharacter cyrillicv 226 +\definecharacter cyrillicG 195 +\definecharacter cyrillicg 227 +\definecharacter cyrillicD 196 +\definecharacter cyrillicd 228 +\definecharacter cyrillicE 197 +\definecharacter cyrillice 229 +\definecharacter cyrillicZH 198 +\definecharacter cyrilliczh 230 +\definecharacter cyrillicZ 199 +\definecharacter cyrillicz 231 +\definecharacter cyrillicI 200 +\definecharacter cyrillici 232 +\definecharacter cyrillicISHRT 201 +\definecharacter cyrillicishrt 233 +\definecharacter cyrillicK 202 +\definecharacter cyrillick 234 +\definecharacter cyrillicL 203 +\definecharacter cyrillicl 235 +\definecharacter cyrillicM 204 +\definecharacter cyrillicm 236 +\definecharacter cyrillicN 205 +\definecharacter cyrillicn 237 +\definecharacter cyrillicO 206 +\definecharacter cyrillico 238 +\definecharacter cyrillicP 207 +\definecharacter cyrillicp 239 +\definecharacter cyrillicR 208 +\definecharacter cyrillicr 240 +\definecharacter cyrillicS 209 +\definecharacter cyrillics 241 +\definecharacter cyrillicT 210 +\definecharacter cyrillict 242 +\definecharacter cyrillicU 211 +\definecharacter cyrillicu 243 +\definecharacter cyrillicF 212 +\definecharacter cyrillicf 244 +\definecharacter cyrillicH 213 +\definecharacter cyrillich 245 +\definecharacter cyrillicC 214 +\definecharacter cyrillicc 246 +\definecharacter cyrillicCH 215 +\definecharacter cyrillicch 247 +\definecharacter cyrillicSH 216 +\definecharacter cyrillicsh 248 +\definecharacter cyrillicSHCH 217 +\definecharacter cyrillicshch 249 +\definecharacter cyrillicHRDSN 218 +\definecharacter cyrillichrdsn 250 +\definecharacter cyrillicERY 219 +\definecharacter cyrillicery 251 +\definecharacter cyrillicSFTSN 220 +\definecharacter cyrillicsftsn 252 +\definecharacter cyrillicEREV 221 +\definecharacter cyrillicerev 253 +\definecharacter cyrillicYU 222 +\definecharacter cyrillicyu 254 +\definecharacter cyrillicYA 223 +\definecharacter cyrillicya 255 +\definecharacter cyrillicPHK 128 +\definecharacter cyrillicphk 160 +\definecharacter cyrillicTETSE 129 +\definecharacter cyrillictetse 161 +\definecharacter cyrillicTDSC 130 +\definecharacter cyrillictdsc 162 +\definecharacter cyrillicGHK 131 +\definecharacter cyrillicghk 163 +\definecharacter cyrillicSHHA 132 +\definecharacter cyrillicshha 164 +\definecharacter cyrillicRDSC 133 +\definecharacter cyrillicrdsc 165 +\definecharacter cyrillicRTICK 134 +\definecharacter cyrillicrtick 166 +\definecharacter cyrillicABHDZE 135 +\definecharacter cyrillicabhdze 167 +\definecharacter cyrillicMDSC 136 +\definecharacter cyrillicmdsc 168 +\definecharacter cyrillicKDSC 137 +\definecharacter cyrillickdsc 169 +\definecharacter cyrillicLDSC 138 +\definecharacter cyrillicldsc 170 +\definecharacter cyrillicKHCRS 139 +\definecharacter cyrillickhcrs 171 +\definecharacter cyrillicLHK 140 +\definecharacter cyrilliclhk 172 +\definecharacter cyrillicNDSC 141 +\definecharacter cyrillicndsc 173 +\definecharacter cyrillicMHK 142 +\definecharacter cyrillicmhk 174 +\definecharacter cyrillicNHK 143 +\definecharacter cyrillicnhk 175 +\definecharacter cyrillicOTLD 144 +\definecharacter cyrillicotld 176 +\definecharacter cyrillicABHCH 145 +\definecharacter cyrillicabhch 177 +\definecharacter cyrillicABHCHDSC 146 +\definecharacter cyrillicabhchdsc 178 +\definecharacter cyrillicSEMISFTSN 147 +\definecharacter cyrillicsemisftsn 179 +\definecharacter cyrillicISHRTDSC 148 +\definecharacter cyrillicishrtdsc 180 +\definecharacter cyrillicHDSC 149 +\definecharacter cyrillichdsc 181 +\definecharacter cyrillicDZHE 150 +\definecharacter cyrillicdzhe 182 +\definecharacter cyrillicABHHA 151 +\definecharacter cyrillicabhha 183 +\definecharacter cyrillicCHRDSC 152 +\definecharacter cyrillicchrdsc 184 +\definecharacter cyrillicNLHK 153 +\definecharacter cyrillicnlhk 185 +\definecharacter cyrillicSCHWA 154 +\definecharacter cyrillicschwa 186 +\definecharacter cyrillicRHK 155 +\definecharacter cyrillicrhk 187 +\definecharacter cyrillicYO 156 +\definecharacter cyrillicyo 188 +\definecharacter cyrillicII 73 +\definecharacter cyrillicii 105 +\definecharacter cyrillicJE 74 +\definecharacter cyrillicje 106 +\definecharacter cyrillicQ 81 +\definecharacter cyrillicq 113 +\definecharacter cyrillicDZE 83 +\definecharacter cyrillicdze 115 +\definecharacter cyrillicW 87 +\definecharacter cyrillicw 119 + +\stopencoding + +\startmapping[x2] + +\resetcaserange 128 to 255 + +\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian) +\definecasemaps 224 to 255 lc 0 uc -32 + +\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav) +\definecasemaps 160 to 188 lc 0 uc -32 + +\definecasemaps 65 to 90 lc +32 uc 0 % more extra letters (cyrillic and old-slav) +\definecasemaps 97 to 122 lc 0 uc -32 + +\definecasemap 28 29 28 \definecasemap 29 29 28 % cyrillicNLHK +\definecasemap 30 31 30 \definecasemap 31 31 30 % cyrillicDELTA + +\stopmapping + +\startencoding[x2] + +\definecharacter textgrave 0 +\definecharacter textacute 1 +\definecharacter textcircumflex 2 +\definecharacter texttilde 3 +\definecharacter textdiaeresis 4 +\definecharacter texthungarumlaut 5 +\definecharacter textring 6 +\definecharacter textcaron 7 +\definecharacter textbreve 8 +\definecharacter textmacron 9 +\definecharacter textdotaccent 10 +\definecharacter textcedilla 11 +\definecharacter textogonek 12 + +\definecharacter endash 21 +\definecharacter emdash 22 + +\definecharacter textcompwordmark 23 +\definecharacter textvisiblespace 32 +\definecharacter textdollar 36 +\definecharacter textless 60 +\definecharacter textgreater 62 +\definecharacter textbackslash 92 +\definecharacter textasciicircum 94 +\definecharacter textunderscore 95 +\definecharacter textbraceleft 123 +\definecharacter textbar 124 +\definecharacter textbraceright 125 +\definecharacter textasciitilde 126 +\definecharacter textnumero 157 +\definecharacter textcurrency 158 +\definecharacter textsection 159 +\definecharacter sectionmark 159 +\definecharacter textquotedbl 34 + +\definecharacter cyrillicpalochka 13 +\definecharacter cyrilliclangle 14 +\definecharacter cyrillicrangle 15 + +\definecharacter leftguillemot 190 +\definecharacter rightguillemot 191 + +\definecharacter upperleftsinglesixquote 96 +\definecharacter upperleftsingleninequote 39 +\definecharacter upperleftdoublesixquote 16 +\definecharacter upperleftdoubleninequote 17 +\definecharacter lowerleftdoubleninequote 189 + +\definecharacter upperrightsinglesixquote 96 +\definecharacter upperrightsingleninequote 39 +\definecharacter upperrightdoublesixquote 16 +\definecharacter upperrightdoubleninequote 17 +\definecharacter lowerrightdoubleninequote 189 + +\definecharacter cyrillicA 192 +\definecharacter cyrillica 224 +\definecharacter cyrillicB 193 +\definecharacter cyrillicb 225 +\definecharacter cyrillicV 194 +\definecharacter cyrillicv 226 +\definecharacter cyrillicG 195 +\definecharacter cyrillicg 227 +\definecharacter cyrillicD 196 +\definecharacter cyrillicd 228 +\definecharacter cyrillicE 197 +\definecharacter cyrillice 229 +\definecharacter cyrillicZH 198 +\definecharacter cyrilliczh 230 +\definecharacter cyrillicZ 199 +\definecharacter cyrillicz 231 +\definecharacter cyrillicI 200 +\definecharacter cyrillici 232 +\definecharacter cyrillicISHRT 201 +\definecharacter cyrillicishrt 233 +\definecharacter cyrillicK 202 +\definecharacter cyrillick 234 +\definecharacter cyrillicL 203 +\definecharacter cyrillicl 235 +\definecharacter cyrillicM 204 +\definecharacter cyrillicm 236 +\definecharacter cyrillicN 205 +\definecharacter cyrillicn 237 +\definecharacter cyrillicO 206 +\definecharacter cyrillico 238 +\definecharacter cyrillicP 207 +\definecharacter cyrillicp 239 +\definecharacter cyrillicR 208 +\definecharacter cyrillicr 240 +\definecharacter cyrillicS 209 +\definecharacter cyrillics 241 +\definecharacter cyrillicT 210 +\definecharacter cyrillict 242 +\definecharacter cyrillicU 211 +\definecharacter cyrillicu 243 +\definecharacter cyrillicF 212 +\definecharacter cyrillicf 244 +\definecharacter cyrillicH 213 +\definecharacter cyrillich 245 +\definecharacter cyrillicC 214 +\definecharacter cyrillicc 246 +\definecharacter cyrillicCH 215 +\definecharacter cyrillicch 247 +\definecharacter cyrillicSH 216 +\definecharacter cyrillicsh 248 +\definecharacter cyrillicSHCH 217 +\definecharacter cyrillicshch 249 +\definecharacter cyrillicHRDSN 218 +\definecharacter cyrillichrdsn 250 +\definecharacter cyrillicERY 219 +\definecharacter cyrillicery 251 +\definecharacter cyrillicSFTSN 220 +\definecharacter cyrillicsftsn 252 +\definecharacter cyrillicEREV 221 +\definecharacter cyrillicerev 253 +\definecharacter cyrillicYU 222 +\definecharacter cyrillicyu 254 +\definecharacter cyrillicYA 223 +\definecharacter cyrillicya 255 +\definecharacter cyrillicGUP 128 +\definecharacter cyrillicgup 160 +\definecharacter cyrillicGHCRS 129 +\definecharacter cyrillicghcrs 161 +\definecharacter cyrillicGDSC 130 +\definecharacter cyrillicgdsc 162 +\definecharacter cyrillicGHK 131 +\definecharacter cyrillicghk 163 +\definecharacter cyrillicSHHA 132 +\definecharacter cyrillicshha 164 +\definecharacter cyrillicZHDSC 133 +\definecharacter cyrilliczhdsc 165 +\definecharacter cyrillicZDSC 134 +\definecharacter cyrilliczdsc 166 +\definecharacter cyrillicABHDZE 135 +\definecharacter cyrillicabhdze 167 +\definecharacter cyrillicYI 136 +\definecharacter cyrillicyi 168 +\definecharacter cyrillicKDSC 137 +\definecharacter cyrillickdsc 169 +\definecharacter cyrillicKBEAK 138 +\definecharacter cyrillickbeak 170 +\definecharacter cyrillicKHK 139 +\definecharacter cyrillickhk 171 +\definecharacter cyrillicLHK 140 +\definecharacter cyrilliclhk 172 +\definecharacter cyrillicNDSC 141 +\definecharacter cyrillicndsc 173 +\definecharacter cyrillicNG 142 +\definecharacter cyrillicng 174 +\definecharacter cyrillicNHK 143 +\definecharacter cyrillicnhk 175 +\definecharacter cyrillicOTLD 144 +\definecharacter cyrillicotld 176 +\definecharacter cyrillicSDSC 145 +\definecharacter cyrillicsdsc 177 +\definecharacter cyrillicUSHRT 146 +\definecharacter cyrillicushrt 178 +\definecharacter cyrillicY 147 +\definecharacter cyrillicy 179 +\definecharacter cyrillicYHCRS 148 +\definecharacter cyrillicyhcrs 180 +\definecharacter cyrillicHDSC 149 +\definecharacter cyrillichdsc 181 +\definecharacter cyrillicHHK 150 +\definecharacter cyrillichhk 182 +\definecharacter cyrillicCHLDSC 151 +\definecharacter cyrillicchldsc 183 +\definecharacter cyrillicCHRDSC 152 +\definecharacter cyrillicchrdsc 184 +\definecharacter cyrillicIE 153 +\definecharacter cyrillicie 185 +\definecharacter cyrillicSCHWA 154 +\definecharacter cyrillicschwa 186 +\definecharacter cyrillicEPS 155 +\definecharacter cyrilliceps 187 +\definecharacter cyrillicYO 156 +\definecharacter cyrillicyo 188 +\definecharacter cyrillicAE 65 +\definecharacter cyrillicae 97 +\definecharacter cyrillicDJE 66 +\definecharacter cyrillicdje 98 +\definecharacter cyrillicTSHE 67 +\definecharacter cyrillictshe 99 +\definecharacter cyrillicABHCH 68 +\definecharacter cyrillicabhch 100 +\definecharacter cyrillicABHCHDSC 69 +\definecharacter cyrillicabhchdsc 101 +\definecharacter cyrillicKVCRS 70 +\definecharacter cyrillickvcrs 102 +\definecharacter cyrillicKHCRS 71 +\definecharacter cyrillickhcrs 103 +\definecharacter cyrillicLDSC 72 +\definecharacter cyrillicldsc 104 +\definecharacter cyrillicII 73 +\definecharacter cyrillicii 105 +\definecharacter cyrillicJE 74 +\definecharacter cyrillicje 106 +\definecharacter cyrillicLJE 75 +\definecharacter cyrilliclje 107 +\definecharacter cyrillicMDSC 76 +\definecharacter cyrillicmdsc 108 +\definecharacter cyrillicNJE 77 +\definecharacter cyrillicnje 109 +\definecharacter cyrillicABHHA 78 +\definecharacter cyrillicabhha 110 +\definecharacter cyrillicPHK 79 +\definecharacter cyrillicphk 111 +\definecharacter cyrillicRDSC 80 +\definecharacter cyrillicrdsc 112 +\definecharacter cyrillicQ 81 +\definecharacter cyrillicq 113 +\definecharacter cyrillicTDSC 82 +\definecharacter cyrillictdsc 114 +\definecharacter cyrillicDZE 83 +\definecharacter cyrillicdze 115 +\definecharacter cyrillicTETSE 84 +\definecharacter cyrillictetse 116 +\definecharacter cyrillicDZHE 85 +\definecharacter cyrillicdzhe 117 +\definecharacter cyrillicCHVCRS 86 +\definecharacter cyrillicchvcrs 118 +\definecharacter cyrillicW 87 +\definecharacter cyrillicw 119 +\definecharacter cyrillicYAT 88 +\definecharacter cyrillicyat 120 +\definecharacter cyrillicBYUS 89 +\definecharacter cyrillicbyus 121 +\definecharacter cyrillicIZH 90 +\definecharacter cyrillicizh 122 +\definecharacter cyrillicNLHK 28 +\definecharacter cyrillicnlhk 29 +\definecharacter cyrillicDELTA 30 +\definecharacter cyrillicdelta 31 + +\stopencoding + +\startmapping[lcy] + +\resetcaserange 128 to 255 + +\definecasemaps 128 to 143 lc +32 uc 0 +\definecasemaps 160 to 175 lc 0 uc -32 + +\definecasemaps 144 to 159 lc +80 uc 0 +\definecasemaps 224 to 239 lc 0 uc -80 + +\definecasemap 240 241 240 \definecasemap 241 241 240 % cyrillicYO +\definecasemap 242 243 242 \definecasemap 243 243 242 % cyrillicGUP +\definecasemap 244 245 244 \definecasemap 245 245 244 % cyrillicIE +\definecasemap 244 247 244 \definecasemap 247 247 244 % cyrillicII +\definecasemap 248 249 248 \definecasemap 249 249 248 % cyrillicYI +\definecasemap 250 251 240 \definecasemap 241 241 240 % cyrillicUSHRT + +\stopmapping + +\startencoding[lcy] + +%D Characters 0 to 127 are as in normal cmr slots + +\definecharacter cyrillicA 128 +\definecharacter cyrillicB 129 +\definecharacter cyrillicV 130 +\definecharacter cyrillicG 131 +\definecharacter cyrillicD 132 +\definecharacter cyrillicE 133 +\definecharacter cyrillicZH 134 +\definecharacter cyrillicZ 135 +\definecharacter cyrillicI 136 +\definecharacter cyrillicISHRT 137 +\definecharacter cyrillicK 138 +\definecharacter cyrillicL 139 +\definecharacter cyrillicM 140 +\definecharacter cyrillicN 141 +\definecharacter cyrillicO 142 +\definecharacter cyrillicP 143 +\definecharacter cyrillicR 144 +\definecharacter cyrillicS 145 +\definecharacter cyrillicT 146 +\definecharacter cyrillicU 147 +\definecharacter cyrillicF 148 +\definecharacter cyrillicH 149 +\definecharacter cyrillicC 150 +\definecharacter cyrillicCH 151 +\definecharacter cyrillicSH 152 +\definecharacter cyrillicSHCH 153 +\definecharacter cyrillicHRDSN 154 +\definecharacter cyrillicERY 155 +\definecharacter cyrillicSFTSN 156 +\definecharacter cyrillicEREV 157 +\definecharacter cyrillicYU 158 +\definecharacter cyrillicYA 159 +\definecharacter cyrillica 160 +\definecharacter cyrillicb 161 +\definecharacter cyrillicv 162 +\definecharacter cyrillicg 163 +\definecharacter cyrillicd 164 +\definecharacter cyrillice 165 +\definecharacter cyrilliczh 166 +\definecharacter cyrillicz 167 +\definecharacter cyrillici 168 +\definecharacter cyrillicishrt 169 +\definecharacter cyrillick 170 +\definecharacter cyrillicl 171 +\definecharacter cyrillicm 172 +\definecharacter cyrillicn 173 +\definecharacter cyrillico 174 +\definecharacter cyrillicp 175 +\definecharacter cyrillicr 224 +\definecharacter cyrillics 225 +\definecharacter cyrillict 226 +\definecharacter cyrillicu 227 +\definecharacter cyrillicf 228 +\definecharacter cyrillich 229 +\definecharacter cyrillicc 230 +\definecharacter cyrillicch 231 +\definecharacter cyrillicsh 232 +\definecharacter cyrillicshch 233 +\definecharacter cyrillichrdsn 234 +\definecharacter cyrillicery 235 +\definecharacter cyrillicsftsn 236 +\definecharacter cyrillicerev 237 +\definecharacter cyrillicyu 238 +\definecharacter cyrillicya 239 +\definecharacter cyrillicYO 240 +\definecharacter cyrillicyo 241 +\definecharacter cyrillicGUP 242 +\definecharacter cyrillicgup 243 +\definecharacter cyrillicIE 244 +\definecharacter cyrillicie 245 +\definecharacter cyrillicII 246 +\definecharacter cyrillicii 247 +\definecharacter cyrillicYI 248 +\definecharacter cyrillicyi 249 +\definecharacter cyrillicUSHRT 250 +\definecharacter cyrillicushrt 251 + +\definecharacter emdash 196 +\definecharacter textcurrency 197 +\definecharacter textnumero 252 +\definecharacter leftguillemot 253 +\definecharacter rightguillemot 254 +\definecharacter quotedblbase 255 + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-cyr.tex b/tex/context/base/enco-cyr.tex deleted file mode 100644 index 36bca82b5..000000000 --- a/tex/context/base/enco-cyr.tex +++ /dev/null @@ -1,1037 +0,0 @@ -%D \module -%D [ file=enco-cyr, -%D version=2003.01.24, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Cyrillic, -%D author=..., -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D The following kerning test is inspired by a test file -%D provided by Victor Figurnov. I hope he still recognizes -%D some bit and pieces. -%D -%D \starttyping -%D \setupoutput[pdftex] -%D -%D \startMPenvironment[global] -%D \useregime[cyr] -%D \useencoding[cyr] -%D \mainlanguage[ru] -%D \enableregime[cp1251] -%D \setupbodyfont[cyr] -%D \stopMPenvironment -%D -%D \startbuffer -%D \starttabulate[|l|l|l|] -%D \NC \ruledhbox{} \NC \ruledhbox{AV} \NC with kerning \NC \NR -%D \NC \ruledhbox{{}{}} \NC \ruledhbox{A{}V} \NC without kerning \NC \NR -%D \NC \ruledhbox{\tfd } \NC \ruledhbox{\tfd AV} \NC with kerning \NC \NR -%D \NC \ruledhbox{\tfd {}{}} \NC \ruledhbox{\tfd A{}V} \NC without kerning \NC \NR -%D \stoptabulate -%D -%D \showkerning{ } -%D \stopbuffer -%D -%D \starttext -%D -%D \title{Kerning test} -%D -%D \typebuffer -%D -%D \rm \subject{Serif font} \getbuffer -%D \ss \subject{SansSerif font} \getbuffer -%D \tt \subject{MonoSpacec font} \getbuffer -%D -%D \stoptext -%D \stoptyping - -%D We start with a fallback, define by HH, who assumes that -%D this is phonetic. - -\startmapping[t2a] - -\resetcaserange 128 to 255 - -\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian) -\definecasemaps 224 to 255 lc 0 uc -32 - -\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav) -\definecasemaps 160 to 188 lc 0 uc -32 - -\definecasemap 73 105 73 \definecasemap 105 105 73 % cyrillicII -\definecasemap 74 106 74 \definecasemap 106 106 74 % cyrillicJE -\definecasemap 81 113 81 \definecasemap 113 113 81 % cyrillicQ -\definecasemap 87 119 87 \definecasemap 119 119 87 % cyrillicW - -\stopmapping - -\startencoding[t2a] - -\definecharacter textgrave 0 -\definecharacter textacute 1 -\definecharacter textcircumflex 2 -\definecharacter texttilde 3 -\definecharacter textdiaeresis 4 -\definecharacter texthungarumlaut 5 -\definecharacter textring 6 -\definecharacter textcaron 7 -\definecharacter textbreve 8 -\definecharacter textmacron 9 -\definecharacter textdotaccent 10 -\definecharacter textcedilla 11 -\definecharacter textogonek 12 - -\definecharacter textcyrillicflex 18 -\definecharacter textdblgrave 19 -\definecharacter textcyrillicbreve 20 - -\definecharacter endash 21 -\definecharacter emdash 22 - -\definecharacter textcompwordmark 23 -\definecharacter textbackslash 92 -\definecharacter textasciicircum 94 -\definecharacter textunderscore 95 -\definecharacter textbraceleft 123 -\definecharacter textbraceright 125 -\definecharacter textasciitilde 126 -\definecharacter textnumero 157 -\definecharacter textcurrency 158 -\definecharacter sectionmark 159 - -\definecharacter quotedbl 34 -\definecharacter quoteleft 96 -\definecharacter upperleftsingleninequote 39 -\definecharacter quotedblleft 16 -\definecharacter quotedblright 17 -\definecharacter lowerleftdoubleninequote 189 -\definecharacter upperrightdoublesixquote 16 -\definecharacter upperrightdoubleninequote 17 -\definecharacter quotedblbase 189 - -\definecharacter cyrillicpalochka 13 -\definecharacter cyrilliclangle 14 -\definecharacter cyrillicrangle 15 - -\definecharacter leftguillemot 190 -\definecharacter rightguillemot 191 -\definecharacter dotlessi 25 - -\definecharacter cyrillicA 192 -\definecharacter cyrillica 224 -\definecharacter cyrillicB 193 -\definecharacter cyrillicb 225 -\definecharacter cyrillicV 194 -\definecharacter cyrillicv 226 -\definecharacter cyrillicG 195 -\definecharacter cyrillicg 227 -\definecharacter cyrillicD 196 -\definecharacter cyrillicd 228 -\definecharacter cyrillicE 197 -\definecharacter cyrillice 229 -\definecharacter cyrillicZH 198 -\definecharacter cyrilliczh 230 -\definecharacter cyrillicZ 199 -\definecharacter cyrillicz 231 -\definecharacter cyrillicI 200 -\definecharacter cyrillici 232 -\definecharacter cyrillicISHRT 201 -\definecharacter cyrillicishrt 233 -\definecharacter cyrillicK 202 -\definecharacter cyrillick 234 -\definecharacter cyrillicL 203 -\definecharacter cyrillicl 235 -\definecharacter cyrillicM 204 -\definecharacter cyrillicm 236 -\definecharacter cyrillicN 205 -\definecharacter cyrillicn 237 -\definecharacter cyrillicO 206 -\definecharacter cyrillico 238 -\definecharacter cyrillicP 207 -\definecharacter cyrillicp 239 -\definecharacter cyrillicR 208 -\definecharacter cyrillicr 240 -\definecharacter cyrillicS 209 -\definecharacter cyrillics 241 -\definecharacter cyrillicT 210 -\definecharacter cyrillict 242 -\definecharacter cyrillicU 211 -\definecharacter cyrillicu 243 -\definecharacter cyrillicF 212 -\definecharacter cyrillicf 244 -\definecharacter cyrillicH 213 -\definecharacter cyrillich 245 -\definecharacter cyrillicC 214 -\definecharacter cyrillicc 246 -\definecharacter cyrillicCH 215 -\definecharacter cyrillicch 247 -\definecharacter cyrillicSH 216 -\definecharacter cyrillicsh 248 -\definecharacter cyrillicSHCH 217 -\definecharacter cyrillicshch 249 -\definecharacter cyrillicHRDSN 218 -\definecharacter cyrillichrdsn 250 -\definecharacter cyrillicERY 219 -\definecharacter cyrillicery 251 -\definecharacter cyrillicSFTSN 220 -\definecharacter cyrillicsftsn 252 -\definecharacter cyrillicEREV 221 -\definecharacter cyrillicerev 253 -\definecharacter cyrillicYU 222 -\definecharacter cyrillicyu 254 -\definecharacter cyrillicYA 223 -\definecharacter cyrillicya 255 -\definecharacter cyrillicGUP 128 -\definecharacter cyrillicgup 160 -\definecharacter cyrillicGHCRS 129 -\definecharacter cyrillicghcrs 161 -\definecharacter cyrillicDJE 130 -\definecharacter cyrillicdje 162 -\definecharacter cyrillicTSHE 131 -\definecharacter cyrillictshe 163 -\definecharacter cyrillicSHHA 132 -\definecharacter cyrillicshha 164 -\definecharacter cyrillicZHDSC 133 -\definecharacter cyrilliczhdsc 165 -\definecharacter cyrillicZDSC 134 -\definecharacter cyrilliczdsc 166 -\definecharacter cyrillicLJE 135 -\definecharacter cyrilliclje 167 -\definecharacter cyrillicYI 136 -\definecharacter cyrillicyi 168 -\definecharacter cyrillicKDSC 137 -\definecharacter cyrillickdsc 169 -\definecharacter cyrillicKBEAK 138 -\definecharacter cyrillickbeak 170 -\definecharacter cyrillicKVCRS 139 -\definecharacter cyrillickvcrs 171 -\definecharacter cyrillicAE 140 -\definecharacter cyrillicae 172 -\definecharacter cyrillicNDSC 141 -\definecharacter cyrillicndsc 173 -\definecharacter cyrillicNG 142 -\definecharacter cyrillicng 174 -\definecharacter cyrillicDZE 143 -\definecharacter cyrillicdze 175 -\definecharacter cyrillicOTLD 144 -\definecharacter cyrillicotld 176 -\definecharacter cyrillicSDSC 145 -\definecharacter cyrillicsdsc 177 -\definecharacter cyrillicUSHRT 146 -\definecharacter cyrillicushrt 178 -\definecharacter cyrillicY 147 -\definecharacter cyrillicy 179 -\definecharacter cyrillicYHCRS 148 -\definecharacter cyrillicyhcrs 180 -\definecharacter cyrillicHDSC 149 -\definecharacter cyrillichdsc 181 -\definecharacter cyrillicDZHE 150 -\definecharacter cyrillicdzhe 182 -\definecharacter cyrillicCHVCRS 151 -\definecharacter cyrillicchvcrs 183 -\definecharacter cyrillicCHRDSC 152 -\definecharacter cyrillicchrdsc 184 -\definecharacter cyrillicIE 153 -\definecharacter cyrillicie 185 -\definecharacter cyrillicSCHWA 154 -\definecharacter cyrillicschwa 186 -\definecharacter cyrillicNJE 155 -\definecharacter cyrillicnje 187 -\definecharacter cyrillicYO 156 -\definecharacter cyrillicyo 188 -\definecharacter cyrillicII 73 -\definecharacter cyrillicii 105 -\definecharacter cyrillicJE 74 -\definecharacter cyrillicje 106 -\definecharacter cyrillicQ 81 -\definecharacter cyrillicq 113 -\definecharacter cyrillicW 87 -\definecharacter cyrillicw 119 - -% \definecharacter textperthousand {\%\char 24 } -% \definecharacter textpertenthousand {\%\char 24\char 24 } - -\definecharacter cyrillicgheupturn 160 % to satisfy the patterns - -\stopencoding - -\startmapping[t2b] - -\resetcaserange 128 to 255 - -\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian) -\definecasemaps 224 to 255 lc 0 uc -32 - -\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav) -\definecasemaps 160 to 188 lc 0 uc -32 - -\definecasemap 73 105 73 \definecasemap 105 105 73 % cyrillicII -\definecasemap 74 106 74 \definecasemap 106 106 74 % cyrillicJE -\definecasemap 81 113 81 \definecasemap 113 113 81 % cyrillicQ -\definecasemap 83 115 83 \definecasemap 115 115 83 % cyrillicDZE -\definecasemap 87 119 87 \definecasemap 119 119 87 % cyrillicW - -\stopmapping - -\startencoding[t2b] - -\definecharacter textgrave 0 -\definecharacter textacute 1 -\definecharacter textcircumflex 2 -\definecharacter texttilde 3 -\definecharacter textdiaeresis 4 -\definecharacter texthungarumlaut 5 -\definecharacter textring 6 -\definecharacter textcaron 7 -\definecharacter textbreve 8 -\definecharacter textmacron 9 -\definecharacter textdotaccent 10 -\definecharacter textcedilla 11 -\definecharacter textogonek 12 - -\definecharacter textcyrillicflex 18 -\definecharacter textdblgrave 19 -\definecharacter textcyrillicbreve 20 - -\definecharacter endash 21 -\definecharacter emdash 22 - -\definecharacter textcompwordmark 23 -\definecharacter textbackslash 92 -\definecharacter textasciicircum 94 -\definecharacter textunderscore 95 -\definecharacter textbraceleft 123 -\definecharacter textbraceright 125 -\definecharacter textasciitilde 126 -\definecharacter textnumero 157 -\definecharacter textcurrency 158 -\definecharacter sectionmark 159 -\definecharacter quotedbl 34 -\definecharacter quoteleft 96 -\definecharacter upperleftsingleninequote 39 -\definecharacter quotedblleft 16 -\definecharacter quotedblright 17 -\definecharacter lowerleftdoubleninequote 189 - -\definecharacter upperrightdoublesixquote 16 -\definecharacter upperrightdoubleninequote 17 -\definecharacter quotedblbase 189 - -\definecharacter cyrillicpalochka 13 -\definecharacter cyrilliclangle 14 -\definecharacter cyrillicrangle 15 - -\definecharacter leftguillemot 190 -\definecharacter rightguillemot 191 -\definecharacter dotlessi 25 - -\definecharacter cyrillicA 192 -\definecharacter cyrillica 224 -\definecharacter cyrillicB 193 -\definecharacter cyrillicb 225 -\definecharacter cyrillicV 194 -\definecharacter cyrillicv 226 -\definecharacter cyrillicG 195 -\definecharacter cyrillicg 227 -\definecharacter cyrillicD 196 -\definecharacter cyrillicd 228 -\definecharacter cyrillicE 197 -\definecharacter cyrillice 229 -\definecharacter cyrillicZH 198 -\definecharacter cyrilliczh 230 -\definecharacter cyrillicZ 199 -\definecharacter cyrillicz 231 -\definecharacter cyrillicI 200 -\definecharacter cyrillici 232 -\definecharacter cyrillicISHRT 201 -\definecharacter cyrillicishrt 233 -\definecharacter cyrillicK 202 -\definecharacter cyrillick 234 -\definecharacter cyrillicL 203 -\definecharacter cyrillicl 235 -\definecharacter cyrillicM 204 -\definecharacter cyrillicm 236 -\definecharacter cyrillicN 205 -\definecharacter cyrillicn 237 -\definecharacter cyrillicO 206 -\definecharacter cyrillico 238 -\definecharacter cyrillicP 207 -\definecharacter cyrillicp 239 -\definecharacter cyrillicR 208 -\definecharacter cyrillicr 240 -\definecharacter cyrillicS 209 -\definecharacter cyrillics 241 -\definecharacter cyrillicT 210 -\definecharacter cyrillict 242 -\definecharacter cyrillicU 211 -\definecharacter cyrillicu 243 -\definecharacter cyrillicF 212 -\definecharacter cyrillicf 244 -\definecharacter cyrillicH 213 -\definecharacter cyrillich 245 -\definecharacter cyrillicC 214 -\definecharacter cyrillicc 246 -\definecharacter cyrillicCH 215 -\definecharacter cyrillicch 247 -\definecharacter cyrillicSH 216 -\definecharacter cyrillicsh 248 -\definecharacter cyrillicSHCH 217 -\definecharacter cyrillicshch 249 -\definecharacter cyrillicHRDSN 218 -\definecharacter cyrillichrdsn 250 -\definecharacter cyrillicERY 219 -\definecharacter cyrillicery 251 -\definecharacter cyrillicSFTSN 220 -\definecharacter cyrillicsftsn 252 -\definecharacter cyrillicEREV 221 -\definecharacter cyrillicerev 253 -\definecharacter cyrillicYU 222 -\definecharacter cyrillicyu 254 -\definecharacter cyrillicYA 223 -\definecharacter cyrillicya 255 -\definecharacter cyrillicGDSCHCRS 128 -\definecharacter cyrillicgdschcrs 160 -\definecharacter cyrillicGHCRS 129 -\definecharacter cyrillicghcrs 161 -\definecharacter cyrillicGDSC 130 -\definecharacter cyrillicgdsc 162 -\definecharacter cyrillicGHK 131 -\definecharacter cyrillicghk 163 -\definecharacter cyrillicSHHA 132 -\definecharacter cyrillicshha 164 -\definecharacter cyrillicZHDSC 133 -\definecharacter cyrilliczhdsc 165 -\definecharacter cyrillicDELTA 134 -\definecharacter cyrillicdelta 166 -\definecharacter cyrillicABHDZE 135 -\definecharacter cyrillicabhdze 167 -\definecharacter cyrillicLJE 136 -\definecharacter cyrilliclje 168 -\definecharacter cyrillicKDSC 137 -\definecharacter cyrillickdsc 169 -\definecharacter cyrillicLDSC 138 -\definecharacter cyrillicldsc 170 -\definecharacter cyrillicKHK 139 -\definecharacter cyrillickhk 171 -\definecharacter cyrillicLHK 140 -\definecharacter cyrilliclhk 172 -\definecharacter cyrillicNDSC 141 -\definecharacter cyrillicndsc 173 -\definecharacter cyrillicNG 142 -\definecharacter cyrillicng 174 -\definecharacter cyrillicNHK 143 -\definecharacter cyrillicnhk 175 -\definecharacter cyrillicOTLD 144 -\definecharacter cyrillicotld 176 -\definecharacter cyrillicSACRS 145 -\definecharacter cyrillicsacrs 177 -\definecharacter cyrillicUSHRT 146 -\definecharacter cyrillicushrt 178 -\definecharacter cyrillicY 147 -\definecharacter cyrillicy 179 -\definecharacter cyrillicHHCRS 148 -\definecharacter cyrillichhcrs 180 -\definecharacter cyrillicHDSC 149 -\definecharacter cyrillichdsc 181 -\definecharacter cyrillicHHK 150 -\definecharacter cyrillichhk 182 -\definecharacter cyrillicCHLDSC 151 -\definecharacter cyrillicchldsc 183 -\definecharacter cyrillicCHRDSC 152 -\definecharacter cyrillicchrdsc 184 -\definecharacter cyrillicNJE 153 -\definecharacter cyrillicnje 185 -\definecharacter cyrillicSCHWA 154 -\definecharacter cyrillicschwa 186 -\definecharacter cyrillicEPS 155 -\definecharacter cyrilliceps 187 -\definecharacter cyrillicYO 156 -\definecharacter cyrillicyo 188 -\definecharacter cyrillicII 73 -\definecharacter cyrillicii 105 -\definecharacter cyrillicJE 74 -\definecharacter cyrillicje 106 -\definecharacter cyrillicQ 81 -\definecharacter cyrillicq 113 -\definecharacter cyrillicDZE 83 -\definecharacter cyrillicdze 115 -\definecharacter cyrillicW 87 -\definecharacter cyrillicw 119 - -\stopencoding - -\startmapping[t2c] - -\resetcaserange 128 to 255 - -\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian) -\definecasemaps 224 to 255 lc 0 uc -32 - -\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav) -\definecasemaps 160 to 188 lc 0 uc -32 - -\definecasemap 73 105 73 \definecasemap 105 105 73 % cyrillicII -\definecasemap 74 106 74 \definecasemap 106 106 74 % cyrillicJE -\definecasemap 81 113 81 \definecasemap 113 113 81 % cyrillicQ -\definecasemap 83 115 83 \definecasemap 115 115 83 % cyrillicDZE -\definecasemap 87 119 87 \definecasemap 119 119 87 % cyrillicW - -\stopmapping - -\startencoding[t2c] - -\definecharacter textgrave 0 -\definecharacter textacute 1 -\definecharacter textcircumflex 2 -\definecharacter texttilde 3 -\definecharacter textdiaeresis 4 -\definecharacter texthungarumlaut 5 -\definecharacter textring 6 -\definecharacter textcaron 7 -\definecharacter textbreve 8 -\definecharacter textmacron 9 -\definecharacter textdotaccent 10 -\definecharacter textcedilla 11 -\definecharacter textogonek 12 - -\definecharacter textcyrillicflex 18 -\definecharacter textdblgrave 19 -\definecharacter textcyrillicbreve 20 - -\definecharacter endash 21 -\definecharacter emdash 22 - -\definecharacter textcompwordmark 23 -\definecharacter textbackslash 92 -\definecharacter textasciicircum 94 -\definecharacter textunderscore 95 -\definecharacter textbraceleft 123 -\definecharacter textbraceright 125 -\definecharacter textasciitilde 126 -\definecharacter textnumero 157 -\definecharacter textcurrency 158 -\definecharacter sectionmark 159 -\definecharacter quotedbl 34 -\definecharacter quoteleft 96 -\definecharacter upperleftsingleninequote 39 -\definecharacter quotedblleft 16 -\definecharacter quotedblright 17 -\definecharacter lowerleftdoubleninequote 189 -\definecharacter upperrightdoublesixquote 16 -\definecharacter upperrightdoubleninequote 17 -\definecharacter quotedblbase 189 - -\definecharacter cyrillicpalochka 13 -\definecharacter cyrilliclangle 14 -\definecharacter cyrillicrangle 15 - -\definecharacter leftguillemot 190 -\definecharacter rightguillemot 191 - -\definecharacter dotlessi 25 - -\definecharacter cyrillicA 192 -\definecharacter cyrillica 224 -\definecharacter cyrillicB 193 -\definecharacter cyrillicb 225 -\definecharacter cyrillicV 194 -\definecharacter cyrillicv 226 -\definecharacter cyrillicG 195 -\definecharacter cyrillicg 227 -\definecharacter cyrillicD 196 -\definecharacter cyrillicd 228 -\definecharacter cyrillicE 197 -\definecharacter cyrillice 229 -\definecharacter cyrillicZH 198 -\definecharacter cyrilliczh 230 -\definecharacter cyrillicZ 199 -\definecharacter cyrillicz 231 -\definecharacter cyrillicI 200 -\definecharacter cyrillici 232 -\definecharacter cyrillicISHRT 201 -\definecharacter cyrillicishrt 233 -\definecharacter cyrillicK 202 -\definecharacter cyrillick 234 -\definecharacter cyrillicL 203 -\definecharacter cyrillicl 235 -\definecharacter cyrillicM 204 -\definecharacter cyrillicm 236 -\definecharacter cyrillicN 205 -\definecharacter cyrillicn 237 -\definecharacter cyrillicO 206 -\definecharacter cyrillico 238 -\definecharacter cyrillicP 207 -\definecharacter cyrillicp 239 -\definecharacter cyrillicR 208 -\definecharacter cyrillicr 240 -\definecharacter cyrillicS 209 -\definecharacter cyrillics 241 -\definecharacter cyrillicT 210 -\definecharacter cyrillict 242 -\definecharacter cyrillicU 211 -\definecharacter cyrillicu 243 -\definecharacter cyrillicF 212 -\definecharacter cyrillicf 244 -\definecharacter cyrillicH 213 -\definecharacter cyrillich 245 -\definecharacter cyrillicC 214 -\definecharacter cyrillicc 246 -\definecharacter cyrillicCH 215 -\definecharacter cyrillicch 247 -\definecharacter cyrillicSH 216 -\definecharacter cyrillicsh 248 -\definecharacter cyrillicSHCH 217 -\definecharacter cyrillicshch 249 -\definecharacter cyrillicHRDSN 218 -\definecharacter cyrillichrdsn 250 -\definecharacter cyrillicERY 219 -\definecharacter cyrillicery 251 -\definecharacter cyrillicSFTSN 220 -\definecharacter cyrillicsftsn 252 -\definecharacter cyrillicEREV 221 -\definecharacter cyrillicerev 253 -\definecharacter cyrillicYU 222 -\definecharacter cyrillicyu 254 -\definecharacter cyrillicYA 223 -\definecharacter cyrillicya 255 -\definecharacter cyrillicPHK 128 -\definecharacter cyrillicphk 160 -\definecharacter cyrillicTETSE 129 -\definecharacter cyrillictetse 161 -\definecharacter cyrillicTDSC 130 -\definecharacter cyrillictdsc 162 -\definecharacter cyrillicGHK 131 -\definecharacter cyrillicghk 163 -\definecharacter cyrillicSHHA 132 -\definecharacter cyrillicshha 164 -\definecharacter cyrillicRDSC 133 -\definecharacter cyrillicrdsc 165 -\definecharacter cyrillicRTICK 134 -\definecharacter cyrillicrtick 166 -\definecharacter cyrillicABHDZE 135 -\definecharacter cyrillicabhdze 167 -\definecharacter cyrillicMDSC 136 -\definecharacter cyrillicmdsc 168 -\definecharacter cyrillicKDSC 137 -\definecharacter cyrillickdsc 169 -\definecharacter cyrillicLDSC 138 -\definecharacter cyrillicldsc 170 -\definecharacter cyrillicKHCRS 139 -\definecharacter cyrillickhcrs 171 -\definecharacter cyrillicLHK 140 -\definecharacter cyrilliclhk 172 -\definecharacter cyrillicNDSC 141 -\definecharacter cyrillicndsc 173 -\definecharacter cyrillicMHK 142 -\definecharacter cyrillicmhk 174 -\definecharacter cyrillicNHK 143 -\definecharacter cyrillicnhk 175 -\definecharacter cyrillicOTLD 144 -\definecharacter cyrillicotld 176 -\definecharacter cyrillicABHCH 145 -\definecharacter cyrillicabhch 177 -\definecharacter cyrillicABHCHDSC 146 -\definecharacter cyrillicabhchdsc 178 -\definecharacter cyrillicSEMISFTSN 147 -\definecharacter cyrillicsemisftsn 179 -\definecharacter cyrillicISHRTDSC 148 -\definecharacter cyrillicishrtdsc 180 -\definecharacter cyrillicHDSC 149 -\definecharacter cyrillichdsc 181 -\definecharacter cyrillicDZHE 150 -\definecharacter cyrillicdzhe 182 -\definecharacter cyrillicABHHA 151 -\definecharacter cyrillicabhha 183 -\definecharacter cyrillicCHRDSC 152 -\definecharacter cyrillicchrdsc 184 -\definecharacter cyrillicNLHK 153 -\definecharacter cyrillicnlhk 185 -\definecharacter cyrillicSCHWA 154 -\definecharacter cyrillicschwa 186 -\definecharacter cyrillicRHK 155 -\definecharacter cyrillicrhk 187 -\definecharacter cyrillicYO 156 -\definecharacter cyrillicyo 188 -\definecharacter cyrillicII 73 -\definecharacter cyrillicii 105 -\definecharacter cyrillicJE 74 -\definecharacter cyrillicje 106 -\definecharacter cyrillicQ 81 -\definecharacter cyrillicq 113 -\definecharacter cyrillicDZE 83 -\definecharacter cyrillicdze 115 -\definecharacter cyrillicW 87 -\definecharacter cyrillicw 119 - -\stopencoding - -\startmapping[x2] - -\resetcaserange 128 to 255 - -\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian) -\definecasemaps 224 to 255 lc 0 uc -32 - -\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav) -\definecasemaps 160 to 188 lc 0 uc -32 - -\definecasemaps 65 to 90 lc +32 uc 0 % more extra letters (cyrillic and old-slav) -\definecasemaps 97 to 122 lc 0 uc -32 - -\definecasemap 28 29 28 \definecasemap 29 29 28 % cyrillicNLHK -\definecasemap 30 31 30 \definecasemap 31 31 30 % cyrillicDELTA - -\stopmapping - -\startencoding[x2] - -\definecharacter textgrave 0 -\definecharacter textacute 1 -\definecharacter textcircumflex 2 -\definecharacter texttilde 3 -\definecharacter textdiaeresis 4 -\definecharacter texthungarumlaut 5 -\definecharacter textring 6 -\definecharacter textcaron 7 -\definecharacter textbreve 8 -\definecharacter textmacron 9 -\definecharacter textdotaccent 10 -\definecharacter textcedilla 11 -\definecharacter textogonek 12 - -\definecharacter endash 21 -\definecharacter emdash 22 - -\definecharacter textcompwordmark 23 -\definecharacter textvisiblespace 32 -\definecharacter textdollar 36 -\definecharacter textless 60 -\definecharacter textgreater 62 -\definecharacter textbackslash 92 -\definecharacter textasciicircum 94 -\definecharacter textunderscore 95 -\definecharacter textbraceleft 123 -\definecharacter textbar 124 -\definecharacter textbraceright 125 -\definecharacter textasciitilde 126 -\definecharacter textnumero 157 -\definecharacter textcurrency 158 -\definecharacter textsection 159 -\definecharacter sectionmark 159 -\definecharacter textquotedbl 34 - -\definecharacter cyrillicpalochka 13 -\definecharacter cyrilliclangle 14 -\definecharacter cyrillicrangle 15 - -\definecharacter leftguillemot 190 -\definecharacter rightguillemot 191 - -\definecharacter upperleftsinglesixquote 96 -\definecharacter upperleftsingleninequote 39 -\definecharacter upperleftdoublesixquote 16 -\definecharacter upperleftdoubleninequote 17 -\definecharacter lowerleftdoubleninequote 189 - -\definecharacter upperrightsinglesixquote 96 -\definecharacter upperrightsingleninequote 39 -\definecharacter upperrightdoublesixquote 16 -\definecharacter upperrightdoubleninequote 17 -\definecharacter lowerrightdoubleninequote 189 - -\definecharacter cyrillicA 192 -\definecharacter cyrillica 224 -\definecharacter cyrillicB 193 -\definecharacter cyrillicb 225 -\definecharacter cyrillicV 194 -\definecharacter cyrillicv 226 -\definecharacter cyrillicG 195 -\definecharacter cyrillicg 227 -\definecharacter cyrillicD 196 -\definecharacter cyrillicd 228 -\definecharacter cyrillicE 197 -\definecharacter cyrillice 229 -\definecharacter cyrillicZH 198 -\definecharacter cyrilliczh 230 -\definecharacter cyrillicZ 199 -\definecharacter cyrillicz 231 -\definecharacter cyrillicI 200 -\definecharacter cyrillici 232 -\definecharacter cyrillicISHRT 201 -\definecharacter cyrillicishrt 233 -\definecharacter cyrillicK 202 -\definecharacter cyrillick 234 -\definecharacter cyrillicL 203 -\definecharacter cyrillicl 235 -\definecharacter cyrillicM 204 -\definecharacter cyrillicm 236 -\definecharacter cyrillicN 205 -\definecharacter cyrillicn 237 -\definecharacter cyrillicO 206 -\definecharacter cyrillico 238 -\definecharacter cyrillicP 207 -\definecharacter cyrillicp 239 -\definecharacter cyrillicR 208 -\definecharacter cyrillicr 240 -\definecharacter cyrillicS 209 -\definecharacter cyrillics 241 -\definecharacter cyrillicT 210 -\definecharacter cyrillict 242 -\definecharacter cyrillicU 211 -\definecharacter cyrillicu 243 -\definecharacter cyrillicF 212 -\definecharacter cyrillicf 244 -\definecharacter cyrillicH 213 -\definecharacter cyrillich 245 -\definecharacter cyrillicC 214 -\definecharacter cyrillicc 246 -\definecharacter cyrillicCH 215 -\definecharacter cyrillicch 247 -\definecharacter cyrillicSH 216 -\definecharacter cyrillicsh 248 -\definecharacter cyrillicSHCH 217 -\definecharacter cyrillicshch 249 -\definecharacter cyrillicHRDSN 218 -\definecharacter cyrillichrdsn 250 -\definecharacter cyrillicERY 219 -\definecharacter cyrillicery 251 -\definecharacter cyrillicSFTSN 220 -\definecharacter cyrillicsftsn 252 -\definecharacter cyrillicEREV 221 -\definecharacter cyrillicerev 253 -\definecharacter cyrillicYU 222 -\definecharacter cyrillicyu 254 -\definecharacter cyrillicYA 223 -\definecharacter cyrillicya 255 -\definecharacter cyrillicGUP 128 -\definecharacter cyrillicgup 160 -\definecharacter cyrillicGHCRS 129 -\definecharacter cyrillicghcrs 161 -\definecharacter cyrillicGDSC 130 -\definecharacter cyrillicgdsc 162 -\definecharacter cyrillicGHK 131 -\definecharacter cyrillicghk 163 -\definecharacter cyrillicSHHA 132 -\definecharacter cyrillicshha 164 -\definecharacter cyrillicZHDSC 133 -\definecharacter cyrilliczhdsc 165 -\definecharacter cyrillicZDSC 134 -\definecharacter cyrilliczdsc 166 -\definecharacter cyrillicABHDZE 135 -\definecharacter cyrillicabhdze 167 -\definecharacter cyrillicYI 136 -\definecharacter cyrillicyi 168 -\definecharacter cyrillicKDSC 137 -\definecharacter cyrillickdsc 169 -\definecharacter cyrillicKBEAK 138 -\definecharacter cyrillickbeak 170 -\definecharacter cyrillicKHK 139 -\definecharacter cyrillickhk 171 -\definecharacter cyrillicLHK 140 -\definecharacter cyrilliclhk 172 -\definecharacter cyrillicNDSC 141 -\definecharacter cyrillicndsc 173 -\definecharacter cyrillicNG 142 -\definecharacter cyrillicng 174 -\definecharacter cyrillicNHK 143 -\definecharacter cyrillicnhk 175 -\definecharacter cyrillicOTLD 144 -\definecharacter cyrillicotld 176 -\definecharacter cyrillicSDSC 145 -\definecharacter cyrillicsdsc 177 -\definecharacter cyrillicUSHRT 146 -\definecharacter cyrillicushrt 178 -\definecharacter cyrillicY 147 -\definecharacter cyrillicy 179 -\definecharacter cyrillicYHCRS 148 -\definecharacter cyrillicyhcrs 180 -\definecharacter cyrillicHDSC 149 -\definecharacter cyrillichdsc 181 -\definecharacter cyrillicHHK 150 -\definecharacter cyrillichhk 182 -\definecharacter cyrillicCHLDSC 151 -\definecharacter cyrillicchldsc 183 -\definecharacter cyrillicCHRDSC 152 -\definecharacter cyrillicchrdsc 184 -\definecharacter cyrillicIE 153 -\definecharacter cyrillicie 185 -\definecharacter cyrillicSCHWA 154 -\definecharacter cyrillicschwa 186 -\definecharacter cyrillicEPS 155 -\definecharacter cyrilliceps 187 -\definecharacter cyrillicYO 156 -\definecharacter cyrillicyo 188 -\definecharacter cyrillicAE 65 -\definecharacter cyrillicae 97 -\definecharacter cyrillicDJE 66 -\definecharacter cyrillicdje 98 -\definecharacter cyrillicTSHE 67 -\definecharacter cyrillictshe 99 -\definecharacter cyrillicABHCH 68 -\definecharacter cyrillicabhch 100 -\definecharacter cyrillicABHCHDSC 69 -\definecharacter cyrillicabhchdsc 101 -\definecharacter cyrillicKVCRS 70 -\definecharacter cyrillickvcrs 102 -\definecharacter cyrillicKHCRS 71 -\definecharacter cyrillickhcrs 103 -\definecharacter cyrillicLDSC 72 -\definecharacter cyrillicldsc 104 -\definecharacter cyrillicII 73 -\definecharacter cyrillicii 105 -\definecharacter cyrillicJE 74 -\definecharacter cyrillicje 106 -\definecharacter cyrillicLJE 75 -\definecharacter cyrilliclje 107 -\definecharacter cyrillicMDSC 76 -\definecharacter cyrillicmdsc 108 -\definecharacter cyrillicNJE 77 -\definecharacter cyrillicnje 109 -\definecharacter cyrillicABHHA 78 -\definecharacter cyrillicabhha 110 -\definecharacter cyrillicPHK 79 -\definecharacter cyrillicphk 111 -\definecharacter cyrillicRDSC 80 -\definecharacter cyrillicrdsc 112 -\definecharacter cyrillicQ 81 -\definecharacter cyrillicq 113 -\definecharacter cyrillicTDSC 82 -\definecharacter cyrillictdsc 114 -\definecharacter cyrillicDZE 83 -\definecharacter cyrillicdze 115 -\definecharacter cyrillicTETSE 84 -\definecharacter cyrillictetse 116 -\definecharacter cyrillicDZHE 85 -\definecharacter cyrillicdzhe 117 -\definecharacter cyrillicCHVCRS 86 -\definecharacter cyrillicchvcrs 118 -\definecharacter cyrillicW 87 -\definecharacter cyrillicw 119 -\definecharacter cyrillicYAT 88 -\definecharacter cyrillicyat 120 -\definecharacter cyrillicBYUS 89 -\definecharacter cyrillicbyus 121 -\definecharacter cyrillicIZH 90 -\definecharacter cyrillicizh 122 -\definecharacter cyrillicNLHK 28 -\definecharacter cyrillicnlhk 29 -\definecharacter cyrillicDELTA 30 -\definecharacter cyrillicdelta 31 - -\stopencoding - -\startmapping[lcy] - -\resetcaserange 128 to 255 - -\definecasemaps 128 to 143 lc +32 uc 0 -\definecasemaps 160 to 175 lc 0 uc -32 - -\definecasemaps 144 to 159 lc +80 uc 0 -\definecasemaps 224 to 239 lc 0 uc -80 - -\definecasemap 240 241 240 \definecasemap 241 241 240 % cyrillicYO -\definecasemap 242 243 242 \definecasemap 243 243 242 % cyrillicGUP -\definecasemap 244 245 244 \definecasemap 245 245 244 % cyrillicIE -\definecasemap 244 247 244 \definecasemap 247 247 244 % cyrillicII -\definecasemap 248 249 248 \definecasemap 249 249 248 % cyrillicYI -\definecasemap 250 251 240 \definecasemap 241 241 240 % cyrillicUSHRT - -\stopmapping - -\startencoding[lcy] - -%D Characters 0 to 127 are as in normal cmr slots - -\definecharacter cyrillicA 128 -\definecharacter cyrillicB 129 -\definecharacter cyrillicV 130 -\definecharacter cyrillicG 131 -\definecharacter cyrillicD 132 -\definecharacter cyrillicE 133 -\definecharacter cyrillicZH 134 -\definecharacter cyrillicZ 135 -\definecharacter cyrillicI 136 -\definecharacter cyrillicISHRT 137 -\definecharacter cyrillicK 138 -\definecharacter cyrillicL 139 -\definecharacter cyrillicM 140 -\definecharacter cyrillicN 141 -\definecharacter cyrillicO 142 -\definecharacter cyrillicP 143 -\definecharacter cyrillicR 144 -\definecharacter cyrillicS 145 -\definecharacter cyrillicT 146 -\definecharacter cyrillicU 147 -\definecharacter cyrillicF 148 -\definecharacter cyrillicH 149 -\definecharacter cyrillicC 150 -\definecharacter cyrillicCH 151 -\definecharacter cyrillicSH 152 -\definecharacter cyrillicSHCH 153 -\definecharacter cyrillicHRDSN 154 -\definecharacter cyrillicERY 155 -\definecharacter cyrillicSFTSN 156 -\definecharacter cyrillicEREV 157 -\definecharacter cyrillicYU 158 -\definecharacter cyrillicYA 159 -\definecharacter cyrillica 160 -\definecharacter cyrillicb 161 -\definecharacter cyrillicv 162 -\definecharacter cyrillicg 163 -\definecharacter cyrillicd 164 -\definecharacter cyrillice 165 -\definecharacter cyrilliczh 166 -\definecharacter cyrillicz 167 -\definecharacter cyrillici 168 -\definecharacter cyrillicishrt 169 -\definecharacter cyrillick 170 -\definecharacter cyrillicl 171 -\definecharacter cyrillicm 172 -\definecharacter cyrillicn 173 -\definecharacter cyrillico 174 -\definecharacter cyrillicp 175 -\definecharacter cyrillicr 224 -\definecharacter cyrillics 225 -\definecharacter cyrillict 226 -\definecharacter cyrillicu 227 -\definecharacter cyrillicf 228 -\definecharacter cyrillich 229 -\definecharacter cyrillicc 230 -\definecharacter cyrillicch 231 -\definecharacter cyrillicsh 232 -\definecharacter cyrillicshch 233 -\definecharacter cyrillichrdsn 234 -\definecharacter cyrillicery 235 -\definecharacter cyrillicsftsn 236 -\definecharacter cyrillicerev 237 -\definecharacter cyrillicyu 238 -\definecharacter cyrillicya 239 -\definecharacter cyrillicYO 240 -\definecharacter cyrillicyo 241 -\definecharacter cyrillicGUP 242 -\definecharacter cyrillicgup 243 -\definecharacter cyrillicIE 244 -\definecharacter cyrillicie 245 -\definecharacter cyrillicII 246 -\definecharacter cyrillicii 247 -\definecharacter cyrillicYI 248 -\definecharacter cyrillicyi 249 -\definecharacter cyrillicUSHRT 250 -\definecharacter cyrillicushrt 251 - -\definecharacter emdash 196 -\definecharacter textcurrency 197 -\definecharacter textnumero 252 -\definecharacter leftguillemot 253 -\definecharacter rightguillemot 254 -\definecharacter quotedblbase 255 - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-def.mkii b/tex/context/base/enco-def.mkii new file mode 100644 index 000000000..b6d66bb6c --- /dev/null +++ b/tex/context/base/enco-def.mkii @@ -0,0 +1,920 @@ +%D \module +%D [ file=enco-def, +%D version=2000.05.07, % 2000.20.12, % split from less verbose base file +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Default Character Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Instead of overloading plain \TEX\ macros (and keeping them +%D available as an escape), we now use the more verbose +%D definitions in this file. Since memory is less a problem +%D these days, this verbosity has only a small price, but we +%D gain readability. The following definitions are based on +%D usage of the the original \TEX\ fonts, where composed +%D characters were not part of the design. So, occasionally +%D we have to revert to hacks. Thanks to all those users who +%D helped me to fill in the details. + +\startencoding[default] + +\definecharacter textcomma , +\definecharacter textperiod . + +\definecharacter textacute 19 +\definecharacter textbottomdot 46 +\definecharacter textbreve 21 +\definecharacter textcaron 20 +\definecharacter textcedilla 24 +\definecharacter textcircumflex 94 +\definecharacter textdiaeresis 127 +\definecharacter textdotaccent 95 +\definecharacter textgrave 18 +\definecharacter texthungarumlaut 125 +\definecharacter textmacron 22 +\definecharacter textogonek 24 % fake +\definecharacter textring 23 +\definecharacter texttilde 126 + +\definecharacter textbottomcomma {\hbox{\lower.35ex\hbox{\tx,}}} % for mojca + +\definecharacter dotlessi {\char"10 } +\definecharacter dotlessj {\char"11 } +\definecharacter dotlessI {I} +\definecharacter dotlessJ {J} + +\definecharacter endash 123 +\definecharacter emdash 124 + +\definecharacter aeligature {\char26 } % "1A +\definecharacter AEligature {\char29 } % "1D +\definecharacter ijligature {ij} +\definecharacter IJligature {IJ} +\definecharacter oeligature {\char27 } % "1B +\definecharacter OEligature {\char30 } % "1E + +\definecharacter ssharp {\char25 } % "19 +\definecharacter Ssharp {SS} + +\definecharacter thorn {\unknownchar} +\definecharacter Thorn {\unknownchar} + +\definecharacter eth {\unknownchar} % mojca prefers this (was \dstroke) +%definecharacter Eth {\unknownchar} +\definecharacter Eth {\Dstroke} % mojca prefers this too + +\definecharacter exclamdown 60 +\definecharacter questiondown 62 + +\definecharacter copyright {\encircled{\txx C}} +\definecharacter registered {\encircled{\txx R}} +\definecharacter trademark {\high{\txx TM}} + +\definecharacter sectionmark {\mathematics{\mathhexbox278}} +\definecharacter paragraphmark {\mathematics{\mathhexbox27B}} + +\definecharacter onequarter {\vulgarfraction{1}{4}} +\definecharacter onehalf {\vulgarfraction{1}{2}} +\definecharacter threequarter {\vulgarfraction{3}{4}} + +\definecharacter onesuperior {\high{1}} +\definecharacter twosuperior {\high{2}} +\definecharacter threesuperior {\high{3}} + +\definecharacter textcent {c} +\definecharacter textcurrency {\unknownchar} +\definecharacter textdollar {\fakedollar} +\definecharacter texteuro {E} +\definecharacter textflorin {\fakeflorin} +\definecharacter textsterling {\fakesterling} +\definecharacter textyen {Y} + +\definecharacter ordfeminine {\high{\txx a}} +\definecharacter ordmasculine {\high{\txx o}} + +\definecharacter percent {\fakepercent} +\definecharacter perthousand {\fakeperthousand} + +\definecharacter softhyphen 45 +\definecharacter periodcentered {\hbox{\mathematics\cdot}} +\definecharacter compoundwordmark 23 + +\definecharacter textasciicircum 94 +\definecharacter textasciitilde 126 +\definecharacter textslash 47 +\definecharacter textbackslash {\tex{}} % todo +\definecharacter textbraceleft {\mathematics\{} +\definecharacter textbraceright {\mathematics\}} +\definecharacter textunderscore {\fakeunderscore} +\definecharacter textvisiblespace {\fakevisiblespace} + +\definecharacter textbrokenbar {\mathematics\vert} +\definecharacter textbullet {\mathematics\bullet} +\definecharacter textdag {\mathematics\dag} +\definecharacter textddag {\mathematics\ddag} +\definecharacter textdegree {\mathematics{{}^{\circ}}} +\definecharacter textdiv {\mathematics\div} +\definecharacter textellipsis {\mathematics\cdots} +\definecharacter textfraction {\mathematics/} +\definecharacter textlognot {\mathematics\neg} +\definecharacter textminus {\mathematics-} +\definecharacter textmu {\mathematics\mu} +\definecharacter textmultiply {\mathematics\times} +\definecharacter textpm {\mathematics\pm} + +\definecharacter quotedbl {"} +\definecharacter quotedblbase {,,} +\definecharacter quotedblleft {``} +\definecharacter quotedblright {''} + +\definecharacter quotesingle {`} +\definecharacter quotesinglebase {,} + +\definecharacter quoteleft {`} +\definecharacter quoteright {'} + +\definecharacter guilsingleleft {\fakeleftsubguillemot } +\definecharacter guilsingleright {\fakerightsubguillemot} + +\definecharacter leftguillemot {\fakeleftguillemot } +\definecharacter rightguillemot {\fakerightguillemot} + +\definecharacter Acircumflex {\buildtextaccent\textcircumflex A} +\definecharacter acircumflex {\buildtextaccent\textcircumflex a} +\definecharacter Ccircumflex {\buildtextaccent\textcircumflex C} +\definecharacter ccircumflex {\buildtextaccent\textcircumflex c} +\definecharacter Ecircumflex {\buildtextaccent\textcircumflex E} +\definecharacter ecircumflex {\buildtextaccent\textcircumflex e} +\definecharacter Gcircumflex {\buildtextaccent\textcircumflex G} +\definecharacter gcircumflex {\buildtextaccent\textcircumflex g} +\definecharacter Hcircumflex {\buildtextaccent\textcircumflex H} +\definecharacter hcircumflex {\buildtextaccent\textcircumflex h} +\definecharacter Icircumflex {\buildtextaccent\textcircumflex \dotlessI} +\definecharacter icircumflex {\buildtextaccent\textcircumflex \dotlessi} +\definecharacter Jcircumflex {\buildtextaccent\textcircumflex \dotlessJ} +\definecharacter jcircumflex {\buildtextaccent\textcircumflex \dotlessj} +\definecharacter Ocircumflex {\buildtextaccent\textcircumflex O} +\definecharacter ocircumflex {\buildtextaccent\textcircumflex o} +\definecharacter Scircumflex {\buildtextaccent\textcircumflex S} +\definecharacter scircumflex {\buildtextaccent\textcircumflex s} +\definecharacter Ucircumflex {\buildtextaccent\textcircumflex U} +\definecharacter ucircumflex {\buildtextaccent\textcircumflex u} +\definecharacter Wcircumflex {\buildtextaccent\textcircumflex W} +\definecharacter wcircumflex {\buildtextaccent\textcircumflex w} +\definecharacter Ycircumflex {\buildtextaccent\textcircumflex Y} +\definecharacter ycircumflex {\buildtextaccent\textcircumflex y} + +\definecharacter Agrave {\buildtextaccent\textgrave A} +\definecharacter agrave {\buildtextaccent\textgrave a} +\definecharacter Egrave {\buildtextaccent\textgrave E} +\definecharacter egrave {\buildtextaccent\textgrave e} +\definecharacter Igrave {\buildtextaccent\textgrave \dotlessI} +\definecharacter igrave {\buildtextaccent\textgrave \dotlessi} +\definecharacter Ograve {\buildtextaccent\textgrave O} +\definecharacter ograve {\buildtextaccent\textgrave o} +\definecharacter Ugrave {\buildtextaccent\textgrave U} +\definecharacter ugrave {\buildtextaccent\textgrave u} +\definecharacter Ygrave {\buildtextaccent\textgrave Y} +\definecharacter ygrave {\buildtextaccent\textgrave y} + +\definecharacter Atilde {\buildtextaccent\texttilde A} +\definecharacter atilde {\buildtextaccent\texttilde a} +\definecharacter Itilde {\buildtextaccent\texttilde \dotlessI} +\definecharacter itilde {\buildtextaccent\texttilde \dotlessi} +\definecharacter Ntilde {\buildtextaccent\texttilde N} +\definecharacter ntilde {\buildtextaccent\texttilde n} +\definecharacter Otilde {\buildtextaccent\texttilde O} +\definecharacter otilde {\buildtextaccent\texttilde o} +\definecharacter Utilde {\buildtextaccent\texttilde U} +\definecharacter utilde {\buildtextaccent\texttilde u} +\definecharacter Ytilde {\buildtextaccent\texttilde Y} +\definecharacter ytilde {\buildtextaccent\texttilde y} + +\definecharacter Adiaeresis {\buildtextaccent\textdiaeresis A} +\definecharacter adiaeresis {\buildtextaccent\textdiaeresis a} +\definecharacter Ediaeresis {\buildtextaccent\textdiaeresis E} +\definecharacter ediaeresis {\buildtextaccent\textdiaeresis e} +\definecharacter Idiaeresis {\buildtextaccent\textdiaeresis \dotlessI} +\definecharacter idiaeresis {\buildtextaccent\textdiaeresis \dotlessi} +\definecharacter Odiaeresis {\buildtextaccent\textdiaeresis O} +\definecharacter odiaeresis {\buildtextaccent\textdiaeresis o} +\definecharacter Udiaeresis {\buildtextaccent\textdiaeresis U} +\definecharacter udiaeresis {\buildtextaccent\textdiaeresis u} +\definecharacter Ydiaeresis {\buildtextaccent\textdiaeresis Y} +\definecharacter ydiaeresis {\buildtextaccent\textdiaeresis y} + +\definecharacter Aacute {\buildtextaccent\textacute A} +\definecharacter aacute {\buildtextaccent\textacute a} +\definecharacter Cacute {\buildtextaccent\textacute C} +\definecharacter cacute {\buildtextaccent\textacute c} +\definecharacter Eacute {\buildtextaccent\textacute E} +\definecharacter eacute {\buildtextaccent\textacute e} +\definecharacter Iacute {\buildtextaccent\textacute \dotlessI} +\definecharacter iacute {\buildtextaccent\textacute \dotlessi} +\definecharacter Lacute {\buildtextaccent\textacute L} +\definecharacter lacute {\buildtextaccent\textacute l} +\definecharacter Nacute {\buildtextaccent\textacute N} +\definecharacter nacute {\buildtextaccent\textacute n} +\definecharacter Oacute {\buildtextaccent\textacute O} +\definecharacter oacute {\buildtextaccent\textacute o} +\definecharacter Racute {\buildtextaccent\textacute R} +\definecharacter racute {\buildtextaccent\textacute r} +\definecharacter Sacute {\buildtextaccent\textacute S} +\definecharacter sacute {\buildtextaccent\textacute s} +\definecharacter Uacute {\buildtextaccent\textacute U} +\definecharacter uacute {\buildtextaccent\textacute u} +\definecharacter Yacute {\buildtextaccent\textacute Y} +\definecharacter yacute {\buildtextaccent\textacute y} +\definecharacter Zacute {\buildtextaccent\textacute Z} +\definecharacter zacute {\buildtextaccent\textacute z} + +%definecharacter Dstroke {D} +%definecharacter dstroke {d} + +\definecharacter dstroke {\pseudoencodeddj} +\definecharacter Dstroke {\pseudoencodedDJ} +\definecharacter Hstroke {H} +\definecharacter hstroke {h} +\definecharacter Tstroke {T} +\definecharacter tstroke {t} + +\definecharacter Cdotaccent {\buildtextaccent\textdotaccent C} +\definecharacter cdotaccent {\buildtextaccent\textdotaccent c} +\definecharacter Edotaccent {\buildtextaccent\textdotaccent E} +\definecharacter edotaccent {\buildtextaccent\textdotaccent e} +\definecharacter Gdotaccent {\buildtextaccent\textdotaccent G} +\definecharacter gdotaccent {\buildtextaccent\textdotaccent g} +\definecharacter Idotaccent {\buildtextaccent\textdotaccent \dotlessI} +\definecharacter idotaccent {\buildtextaccent\textdotaccent \dotlessi} +\definecharacter Zdotaccent {\buildtextaccent\textdotaccent Z} +\definecharacter zdotaccent {\buildtextaccent\textdotaccent z} + +\definecharacter Amacron {\buildtextaccent\textmacron A} +\definecharacter amacron {\buildtextaccent\textmacron a} +\definecharacter Emacron {\buildtextaccent\textmacron E} +\definecharacter emacron {\buildtextaccent\textmacron e} +\definecharacter Imacron {\buildtextaccent\textmacron \dotlessI} +\definecharacter imacron {\buildtextaccent\textmacron \dotlessi} +\definecharacter Omacron {\buildtextaccent\textmacron O} +\definecharacter omacron {\buildtextaccent\textmacron o} +\definecharacter Umacron {\buildtextaccent\textmacron U} +\definecharacter umacron {\buildtextaccent\textmacron u} + +\definecharacter Ccedilla {\buildtextcedilla C} +\definecharacter ccedilla {\buildtextcedilla c} +\definecharacter Kcedilla {\buildtextcedilla K} +\definecharacter kcedilla {\buildtextcedilla k} +\definecharacter Lcedilla {\buildtextcedilla L} +\definecharacter lcedilla {\buildtextcedilla l} +\definecharacter Ncedilla {\buildtextcedilla N} +\definecharacter ncedilla {\buildtextcedilla n} +\definecharacter Rcedilla {\buildtextcedilla R} +\definecharacter rcedilla {\buildtextcedilla r} +\definecharacter Scedilla {\buildtextcedilla S} +\definecharacter scedilla {\buildtextcedilla s} +\definecharacter Tcedilla {\buildtextcedilla T} +\definecharacter tcedilla {\buildtextcedilla t} + +\definecharacter Ohungarumlaut {\buildtextaccent\texthungarumlaut O} +\definecharacter ohungarumlaut {\buildtextaccent\texthungarumlaut o} +\definecharacter Uhungarumlaut {\buildtextaccent\texthungarumlaut U} +\definecharacter uhungarumlaut {\buildtextaccent\texthungarumlaut u} + +\definecharacter Aogonek {\buildtextogonek A} +\definecharacter aogonek {\buildtextogonek a} +\definecharacter Eogonek {\buildtextogonek E} +\definecharacter eogonek {\buildtextogonek e} +\definecharacter Iogonek {\buildtextogonek I} +\definecharacter iogonek {\buildtextogonek i} +\definecharacter Uogonek {\buildtextogonek U} +\definecharacter uogonek {\buildtextogonek u} + +\definecharacter Aring {\buildtextaccent\textring A} +\definecharacter aring {\buildtextaccent\textring a} +\definecharacter Uring {\buildtextaccent\textring U} +\definecharacter uring {\buildtextaccent\textring u} + +\definecharacter Abreve {\buildtextaccent\textbreve A} +\definecharacter abreve {\buildtextaccent\textbreve a} +\definecharacter Ebreve {\buildtextaccent\textbreve E} +\definecharacter ebreve {\buildtextaccent\textbreve e} +\definecharacter Gbreve {\buildtextaccent\textbreve G} +\definecharacter gbreve {\buildtextaccent\textbreve g} +\definecharacter Ibreve {\buildtextaccent\textbreve \dotlessI} +\definecharacter ibreve {\buildtextaccent\textbreve \dotlessi} +\definecharacter Obreve {\buildtextaccent\textbreve O} +\definecharacter obreve {\buildtextaccent\textbreve o} +\definecharacter Ubreve {\buildtextaccent\textbreve U} +\definecharacter ubreve {\buildtextaccent\textbreve u} + +\definecharacter Ccaron {\buildtextaccent\textcaron C} +\definecharacter ccaron {\buildtextaccent\textcaron c} +\definecharacter Dcaron {\buildtextaccent\textcaron D} +\definecharacter dcaron {\buildtextaccent\textcaron d} +\definecharacter Ecaron {\buildtextaccent\textcaron E} +\definecharacter ecaron {\buildtextaccent\textcaron e} +\definecharacter Lcaron {\buildtextaccent\textcaron L} +\definecharacter lcaron {\buildtextaccent\textcaron l} +\definecharacter Ncaron {\buildtextaccent\textcaron N} +\definecharacter ncaron {\buildtextaccent\textcaron n} +\definecharacter Rcaron {\buildtextaccent\textcaron R} +\definecharacter rcaron {\buildtextaccent\textcaron r} +\definecharacter Scaron {\buildtextaccent\textcaron S} +\definecharacter scaron {\buildtextaccent\textcaron s} +\definecharacter Tcaron {\buildtextaccent\textcaron T} +\definecharacter tcaron {\buildtextaccent\textcaron t} +\definecharacter Ycaron {\buildtextaccent\textcaron Y} +\definecharacter ycaron {\buildtextaccent\textcaron y} +\definecharacter Zcaron {\buildtextaccent\textcaron Z} +\definecharacter zcaron {\buildtextaccent\textcaron z} + +\definecharacter Lstroke {\hsmash{\char32}L} +\definecharacter lstroke {\hsmash{\char32}l} +\definecharacter Ostroke {\char31 } % "1F +\definecharacter ostroke {\char28 } % "1C + +\definecharacter aumlaut {\moveaccent{-.1ex}\adiaeresis} +\definecharacter eumlaut {\moveaccent{-.1ex}\ediaeresis} +\definecharacter iumlaut {\moveaccent{-.1ex}\idiaeresis} +\definecharacter oumlaut {\moveaccent{-.1ex}\odiaeresis} +\definecharacter uumlaut {\moveaccent{-.1ex}\udiaeresis} + +\definecharacter Aumlaut {\smashaccent\Adiaeresis} +\definecharacter Eumlaut {\smashaccent\Ediaeresis} +\definecharacter Iumlaut {\smashaccent\Idiaeresis} +\definecharacter Oumlaut {\smashaccent\Odiaeresis} +\definecharacter Uumlaut {\smashaccent\Udiaeresis} + +\definecharacter scommaaccent {\buildtextbottomcomma s} +\definecharacter Scommaaccent {\buildtextbottomcomma S} +\definecharacter tcommaaccent {\buildtextbottomcomma t} +\definecharacter Tcommaaccent {\buildtextbottomcomma T} +\definecharacter lcommaaccent {\buildtextbottomcomma l} +\definecharacter Lcommaaccent {\buildtextbottomcomma L} + +\definecharacter Etilde {\buildtextaccent\texttilde E} +\definecharacter etilde {\buildtextaccent\texttilde e} + +\definecharacter Ahook {A} +\definecharacter ahook {a} +\definecharacter Ehook {E} +\definecharacter ehook {e} +\definecharacter Ihook {I} +\definecharacter ihook {i} +\definecharacter Ohook {O} +\definecharacter ohook {o} +\definecharacter Uhook {U} +\definecharacter uhook {u} +\definecharacter Yhook {Y} +\definecharacter yhook {y} + +\definecharacter Acircumflexgrave {\Acircumflex} +\definecharacter Acircumflexacute {\Acircumflex} +\definecharacter Acircumflextilde {\Acircumflex} +\definecharacter Acircumflexhook {\Acircumflex} +\definecharacter acircumflexgrave {\acircumflex} +\definecharacter acircumflexacute {\acircumflex} +\definecharacter acircumflextilde {\acircumflex} +\definecharacter acircumflexhook {\acircumflex} +\definecharacter Ecircumflexgrave {\Ecircumflex} +\definecharacter Ecircumflexacute {\Ecircumflex} +\definecharacter Ecircumflextilde {\Ecircumflex} +\definecharacter Ecircumflexhook {\Ecircumflex} +\definecharacter ecircumflexgrave {\ecircumflex} +\definecharacter ecircumflexacute {\ecircumflex} +\definecharacter ecircumflextilde {\ecircumflex} +\definecharacter ecircumflexhook {\ecircumflex} +\definecharacter Ocircumflexgrave {\Ocircumflex} +\definecharacter Ocircumflexacute {\Ocircumflex} +\definecharacter Ocircumflextilde {\Ocircumflex} +\definecharacter Ocircumflexhook {\Ocircumflex} +\definecharacter ocircumflexgrave {\ocircumflex} +\definecharacter ocircumflexacute {\ocircumflex} +\definecharacter ocircumflextilde {\ocircumflex} +\definecharacter ocircumflexhook {\ocircumflex} + +\definecharacter Abrevegrave {\Abreve} +\definecharacter Abreveacute {\Abreve} +\definecharacter Abrevetilde {\Abreve} +\definecharacter Abrevehook {\Abreve} +\definecharacter abrevegrave {\abreve} +\definecharacter abreveacute {\abreve} +\definecharacter abrevetilde {\abreve} +\definecharacter abrevehook {\abreve} + +\definecharacter Adotbelow {\buildtextbottomdot A} +\definecharacter adotbelow {\buildtextbottomdot a} +\definecharacter Edotbelow {\buildtextbottomdot E} +\definecharacter edotbelow {\buildtextbottomdot e} +\definecharacter Idotbelow {\buildtextbottomdot I} +\definecharacter idotbelow {\buildtextbottomdot i} +\definecharacter Odotbelow {\buildtextbottomdot O} +\definecharacter odotbelow {\buildtextbottomdot o} +\definecharacter Udotbelow {\buildtextbottomdot U} +\definecharacter udotbelow {\buildtextbottomdot u} +\definecharacter Ydotbelow {\buildtextbottomdot Y} +\definecharacter ydotbelow {\buildtextbottomdot y} + +\definecharacter Ohorndotbelow {\buildtextbottomdot\Ohorn} +\definecharacter ohorndotbelow {\buildtextbottomdot\ohorn} +\definecharacter Uhorndotbelow {\buildtextbottomdot\Uhorn} +\definecharacter uhorndotbelow {\buildtextbottomdot\uhorn} + +\definecharacter Acircumflexdotbelow {\buildtextbottomdot\Acircumflex} +\definecharacter acircumflexdotbelow {\buildtextbottomdot\acircumflex} +\definecharacter Ecircumflexdotbelow {\buildtextbottomdot\Ecircumflex} +\definecharacter ecircumflexdotbelow {\buildtextbottomdot\ecircumflex} +\definecharacter Ocircumflexdotbelow {\buildtextbottomdot\Ocircumflex} +\definecharacter ocircumflexdotbelow {\buildtextbottomdot\ocircumflex} +\definecharacter Abrevedotbelow {\buildtextbottomdot\Abreve} +\definecharacter abrevedotbelow {\buildtextbottomdot\abreve} + +\definecharacter Ohorn {O} +\definecharacter Ohorngrave {\Ograve} +\definecharacter Ohornacute {\Oacute} +\definecharacter Ohorntilde {\Otilde} +\definecharacter Ohornhook {O} +\definecharacter ohorn {o} +\definecharacter ohorngrave {\ograve} +\definecharacter ohornacute {\oacute} +\definecharacter ohorntilde {\otilde} +\definecharacter ohornhook {o} +\definecharacter Uhorn {U} +\definecharacter Uhorngrave {\Ugrave} +\definecharacter Uhornacute {\Uacute} +\definecharacter Uhorntilde {\Utilde} +\definecharacter Uhornhook {U} +\definecharacter uhorn {u} +\definecharacter uhorngrave {\ugrave} +\definecharacter uhornacute {\uacute} +\definecharacter uhorntilde {\utilde} +\definecharacter uhornhook {u} + +\stopencoding + +%D Needed for transliterated chinese (provided by Tobias Burnus). + +\startencoding[default] + +\definecharacter acaron {\buildtextaccent\textcaron a} % U+01CE +\definecharacter icaron {\buildtextaccent\textcaron \dotlessi} % U+01D0 +\definecharacter ocaron {\buildtextaccent\textcaron o} % U+01D2 +\definecharacter ucaron {\buildtextaccent\textcaron u} % U+01D4 + +\stopencoding + +%D Greek (moved to here): + +\startencoding[default] + +% Uppercase Greek letters + +\definecharacter greekAlpha {\Alpha} +\definecharacter greekBeta {\Beta} +\definecharacter greekGamma {\Gamma} +\definecharacter greekDelta {\Delta} +\definecharacter greekEpsilon {\Epsilon} +\definecharacter greekZeta {\Zeta} +\definecharacter greekEta {\Eta} +\definecharacter greekTheta {\Theta} +\definecharacter greekIota {\Iota} +\definecharacter greekKappa {\Kappa} +\definecharacter greekLambda {\Lambda} +\definecharacter greekMu {\Mu} +\definecharacter greekNu {\Nu} +\definecharacter greekXi {\Xi} +\definecharacter greekOmicron {\Omicron} +\definecharacter greekPi {\Pi} +\definecharacter greekRho {\Rho} +\definecharacter greekSigma {\Sigma} +\definecharacter greekTau {\Tau} +\definecharacter greekUpsilon {\Upsilon} +\definecharacter greekPhi {\Phi} +\definecharacter greekChi {\Chi} +\definecharacter greekPsi {\Psi} +\definecharacter greekOmega {\Omega} + +% Lowercase Greek letters + +\definecharacter greekalpha {\alpha} +\definecharacter greekbeta {\beta} +\definecharacter greekgamma {\gamma} +\definecharacter greekdelta {\delta} +\definecharacter greekepsilon {\varepsilon} +\definecharacter greekepsilonalt {\epsilon} +\definecharacter greekzeta {\zeta} +\definecharacter greeketa {\eta} +\definecharacter greektheta {\theta} +\definecharacter greekthetaalt {\vartheta} +\definecharacter greekiota {\iota} +\definecharacter greekkappa {\kappa} +\definecharacter greeklambda {\lambda} +\definecharacter greekmu {\mu} +\definecharacter greeknu {\nu} +\definecharacter greekxi {\xi} +\definecharacter greekomicron {\omicron} +\definecharacter greekpi {\pi} +\definecharacter greekrho {\rho} +\definecharacter greeksigma {\sigma} +\definecharacter greekfinalsigma {\varsigma} +\definecharacter greektau {\tau} +\definecharacter greekupsilon {\upsilon} +\definecharacter greekphi {\varphi} +\definecharacter greekphialt {\phi} +\definecharacter greekchi {\chi} +\definecharacter greekpsi {\psi} +\definecharacter greekomega {\omega} + +% Accented Uppercase Greek letters + +\definecharacter greekAlphatonos {'A} +\definecharacter greekEpsilontonos {'E} +\definecharacter greekEtatonos {'H} +\definecharacter greekIotatonos {'I} +\definecharacter greekOmicrontonos {'O} +\definecharacter greekUpsilontonos {'U} +\definecharacter greekOmegatonos {'W} +\definecharacter greekIotadialytika {"I} +\definecharacter greekUpsilondialytika {"U} + +% Accented Lowercase Greek letters + +\definecharacter greekalphatonos {'a} +\definecharacter greekepsilontonos {'e} +\definecharacter greeketatonos {'h} +\definecharacter greekiotatonos {'i} +\definecharacter greekomicrontonos {'o} +\definecharacter greekupsilontonos {'u} +\definecharacter greekomegatonos {'w} +\definecharacter greekiotadialytika {"i} +\definecharacter greekupsilondialytika {"u} +\definecharacter greekiotadialytikatonos {'"i} +\definecharacter greekupsilondialytikatonos {'"u} + +% Miscellaneous Greek symbols + +\definecharacter greekleftquot {((} +\definecharacter greekrightquot {))} +\definecharacter greektonos {'} +\definecharacter greekdialytikatonos {'"} +\definecharacter greekapostrophos {''} + +\stopencoding + +%D Cyrillic (moved to here): + +\startencoding[default] + +\definecharacter cyrillicA {A} +\definecharacter cyrillicB {B} +\definecharacter cyrillicV {V} +\definecharacter cyrillicG {G} +\definecharacter cyrillicD {D} +\definecharacter cyrillicE {E} +\definecharacter cyrillicZH {ZH} +\definecharacter cyrillicZ {Z} +\definecharacter cyrillicI {I} +\definecharacter cyrillicISHRT {ISHRT} +\definecharacter cyrillicK {K} +\definecharacter cyrillicL {L} +\definecharacter cyrillicM {M} +\definecharacter cyrillicN {N} +\definecharacter cyrillicO {O} +\definecharacter cyrillicP {P} +\definecharacter cyrillicR {R} +\definecharacter cyrillicS {S} +\definecharacter cyrillicT {T} +\definecharacter cyrillicU {U} +\definecharacter cyrillicF {F} +\definecharacter cyrillicH {H} +\definecharacter cyrillicC {C} +\definecharacter cyrillicCH {CH} +\definecharacter cyrillicSH {SH} +\definecharacter cyrillicSHCH {SHCH} +\definecharacter cyrillicHRDSN {HRDSN} +\definecharacter cyrillicERY {ERY} +\definecharacter cyrillicSFTSN {SFTSN} +\definecharacter cyrillicEREV {EREV} +\definecharacter cyrillicYU {YU} +\definecharacter cyrillicYA {YA} +\definecharacter cyrillicGUP {GUP} +\definecharacter cyrillicGHCRS {GHCRS} +\definecharacter cyrillicDJE {DJE} +\definecharacter cyrillicTSHE {TSHE} +\definecharacter cyrillicSHHA {SHHA} +\definecharacter cyrillicZHDSC {ZHDSC} +\definecharacter cyrillicZDSC {ZDSC} +\definecharacter cyrillicLJE {LJE} +\definecharacter cyrillicYI {YI} +\definecharacter cyrillicKDSC {KDSC} +\definecharacter cyrillicKBEAK {KBEAK} +\definecharacter cyrillicKVCRS {KVCRS} +\definecharacter cyrillicAE {AE} +\definecharacter cyrillicNDSC {NDSC} +\definecharacter cyrillicNG {NG} +\definecharacter cyrillicDZE {DZE} +\definecharacter cyrillicOTLD {OTLD} +\definecharacter cyrillicSDSC {SDSC} +\definecharacter cyrillicUSHRT {USHRT} +\definecharacter cyrillicY {Y} +\definecharacter cyrillicYHCRS {YHCRS} +\definecharacter cyrillicHDSC {HDSC} +\definecharacter cyrillicDZHE {DZHE} +\definecharacter cyrillicCHVCRS {CHVCRS} +\definecharacter cyrillicCHRDSC {CHRDSC} +\definecharacter cyrillicIE {IE} +\definecharacter cyrillicSCHWA {SCHWA} +\definecharacter cyrillicNJE {NJE} +\definecharacter cyrillicYO {YO} +\definecharacter cyrillicII {II} +\definecharacter cyrillicJE {JE} +\definecharacter cyrillicQ {Q} +\definecharacter cyrillicW {W} + +\definecharacter cyrillica {a} +\definecharacter cyrillicb {b} +\definecharacter cyrillicv {v} +\definecharacter cyrillicg {g} +\definecharacter cyrillicd {d} +\definecharacter cyrillice {e} +\definecharacter cyrilliczh {zh} +\definecharacter cyrillicz {z} +\definecharacter cyrillici {i} +\definecharacter cyrillicishrt {ishrt} +\definecharacter cyrillick {k} +\definecharacter cyrillicl {l} +\definecharacter cyrillicm {m} +\definecharacter cyrillicn {n} +\definecharacter cyrillico {o} +\definecharacter cyrillicp {p} +\definecharacter cyrillicr {r} +\definecharacter cyrillics {s} +\definecharacter cyrillict {t} +\definecharacter cyrillicu {u} +\definecharacter cyrillicf {f} +\definecharacter cyrillich {h} +\definecharacter cyrillicc {c} +\definecharacter cyrillicch {ch} +\definecharacter cyrillicsh {sh} +\definecharacter cyrillicshch {shch} +\definecharacter cyrillichrdsn {hrdsn} +\definecharacter cyrillicery {ery} +\definecharacter cyrillicsftsn {sftsn} +\definecharacter cyrillicerev {erev} +\definecharacter cyrillicyu {yu} +\definecharacter cyrillicya {ya} +\definecharacter cyrillicgup {gup} +\definecharacter cyrillicghcrs {ghcrs} +\definecharacter cyrillicdje {dje} +\definecharacter cyrillictshe {tshe} +\definecharacter cyrillicshha {shha} +\definecharacter cyrilliczhdsc {zhdsc} +\definecharacter cyrilliczdsc {zdsc} +\definecharacter cyrilliclje {lje} +\definecharacter cyrillicyi {yi} +\definecharacter cyrillickdsc {kdsc} +\definecharacter cyrillickbeak {kbeak} +\definecharacter cyrillickvcrs {kvcrs} +\definecharacter cyrillicae {ae} +\definecharacter cyrillicndsc {ndsc} +\definecharacter cyrillicng {ng} +\definecharacter cyrillicdze {dze} +\definecharacter cyrillicotld {otld} +\definecharacter cyrillicsdsc {sdsc} +\definecharacter cyrillicushrt {ushrt} +\definecharacter cyrillicy {y} +\definecharacter cyrillicyhcrs {yhcrs} +\definecharacter cyrillichdsc {hdsc} +\definecharacter cyrillicdzhe {dzhe} +\definecharacter cyrillicchvcrs {chvcrs} +\definecharacter cyrillicchrdsc {chrdsc} +\definecharacter cyrillicie {ie} +\definecharacter cyrillicschwa {schwa} +\definecharacter cyrillicnje {nje} +\definecharacter cyrillicyo {yo} +\definecharacter cyrillicii {ii} +\definecharacter cyrillicje {je} +\definecharacter cyrillicq {q} +\definecharacter cyrillicw {w} + +\definecharacter cyrillicGJE {\'\cyrillicG} +\definecharacter cyrillicgje {\'\cyrillicg} +\definecharacter cyrillicKJE {\'\cyrillicK} +\definecharacter cyrillickje {\'\cyrillick} + +\stopencoding + +\def\cyrillicio{\cyrillicyo} +\def\cyrillicIO{\cyrillicYO} + +%D Hebrew: + +\startencoding[default] + +\definecharacter hebrewAlef {'} +\definecharacter hebrewBet {b} +\definecharacter hebrewGimel {g} +\definecharacter hebrewDalet {d} +\definecharacter hebrewHe {h} +\definecharacter hebrewVav {w} +\definecharacter hebrewZayin {z} +\definecharacter hebrewHet {\hstroke} +\definecharacter hebrewTet {\tcedilla} +\definecharacter hebrewYod {y} +\definecharacter hebrewKaffinal {k} +\definecharacter hebrewKaf {k} +\definecharacter hebrewLamed {l} +\definecharacter hebrewMemfinal {m} +\definecharacter hebrewMem {m} +\definecharacter hebrewNunfinal {n} +\definecharacter hebrewNun {n} +\definecharacter hebrewSamekh {s} +\definecharacter hebrewAyin {\gdotaccent} +\definecharacter hebrewPefinal {p} +\definecharacter hebrewPe {p} +\definecharacter hebrewTsadifinal {\scedilla} +\definecharacter hebrewTsadi {\scedilla} +\definecharacter hebrewQof {q} +\definecharacter hebrewResh {r} +\definecharacter hebrewShin {\scaron} +\definecharacter hebrewTav {th} + +\stopencoding + +%D A few goodies: + +\def\eszett{\ssharp} +\def\Eszett{\Ssharp} + +\def\lslash{\lstroke} +\def\Lslash{\Lstroke} +\def\dslash{\dstroke} +\def\Dslash{\Dstroke} +\def\oslash{\ostroke} +\def\Oslash{\Ostroke} + +\def\dcroat{\dstroke} +\def\Dcroat{\Dstroke} + +% \startencoding [default] +% +% \definecharacter scommaaccent {\scedilla} +% \definecharacter Scommaaccent {\Scedilla} +% \definecharacter tcommaaccent {\tcedilla} +% \definecharacter Tcommaaccent {\Tcedilla} +% +% \stopencoding + +% for plain tex's sake + +\def\S {\sectionmark } +\def\P {\paragraphmark} + +% for latex users sake + +\def\textS {\sectionmark } +\def\textP {\paragraphmark} + +% for old times sake + +\def\florin {\textflorin } \def\florijn{\textflorin} +\def\dollar {\textdollar } +\def\pound {\textsterling} +\def\sterling{\textsterling} + +% idem + +\def\promille{\perthousand} +\def\permille{\perthousand} +\def\procent {\percent } +\def\permine {\fakepermine} + +% some more + +\def\hyphen {\softhyphen} +\def\cwm {\compoundwordmark} +\def\nonbreakinghyphen {\hyphen} +\def\breakinghyphen {\hyphen\prewordbreak} + +% quotes + +\def\lowerleftsingleninequote {\quotesinglebase} +\def\lowerleftdoubleninequote {\quotedblbase} +\def\lowerrightsingleninequote {\quotesinglebase} +\def\lowerrightdoubleninequote {\quotedblbase} + +\def\upperleftsingleninequote {\quoteright} +\def\upperleftdoubleninequote {\quotedblright} +\def\upperrightsingleninequote {\quoteright} +\def\upperrightdoubleninequote {\quotedblright} + +\def\upperleftsinglesixquote {\quoteleft} +\def\upperleftdoublesixquote {\quotedblleft} +\def\upperrightsinglesixquote {\quoteleft} +\def\upperrightdoublesixquote {\quotedblleft} + +\def\leftsubguillemot {\guilsingleleft} +\def\rightsubguillemot {\guilsingleright} + +%D A couple of fallbacks suggestion by users, slightly +%D adapted and obscured by memory saving hacks. + +\unprotect + +\startencoding[default] + +\definecharacter textcent {c\rlap{\hskip-.2\s!em + \vrule\!!width.2\s!pt\!!height1.2\s!ex\!!depth.2\s!ex}} + +\definecharacter texteuro {C\rlap{\hskip-.75\s!em + \vrule\!!width.4\s!em\!!height.85\s!ex\!!depth-.8\s!ex}} + +\definecharacter textblacksquare {\dontleavehmode\hbox{% + \vrule\!!width.3\s!em\!!height.4\s!em\!!depth-.1\s!em}} + +\definecharacter textbrokenbar {\dontleavehmode\hbox{\kern.05\s!em + \vrule\!!width.4\s!pt\!!height1.8\s!ex\!!depth-.85\s!ex + \llap{% + \vrule\!!width.4\s!pt\!!height.35\s!ex\!!depth.6\s!ex}% + \kern.05\s!em}} + +\stopencoding + +\protect + +%D We also use symbolic names for math accents. + +\startencoding[default] + +\definecharacter mathacute "7013 +\definecharacter mathgrave "7012 +\definecharacter mathddot "707F +\definecharacter mathtilde "707E +\definecharacter mathbar "7016 +\definecharacter mathbreve "7015 +\definecharacter mathcheck "7014 +\definecharacter mathhat "705E +\definecharacter mathvec "017E +\definecharacter mathdot "705F +\definecharacter mathwidetilde "0365 +\definecharacter mathwidehat "0362 + +\stopencoding + +% \startencoding [default] + +% \definecommand prime {\mathematics{'}} +% \definecommand doubleprime {\mathematics{''}} +% \definecommand tripleprime {\mathematics{'''}} + +% \stopencoding + +\ifx\zdot\undefined \def\zdot{\zdotaccent} \fi +\ifx\Zdot\undefined \def\Zdot{\Zdotaccent} \fi + +\ifx\greeklamda\undefined \def\greeklamda{\greeklambda} \fi +\ifx\greekLamda\undefined \def\greekLamda{\greekLambda} \fi + +\ifx\leftguillemet \undefined \def\leftguillemet {\leftguillemot } \fi +\ifx\rightguillemet\undefined \def\rightguillemet{\rightguillemot} \fi + +%D New: + +\startencoding[\s!default] + +\definecharacter schwa {\hbox{\rotate[\c!rotation=180,\c!location=\v!high]{\hbox{e}}}} +\definecharacter schwagrave {\buildtextgrave\schwa} + +\stopencoding + +%D Also new, from Taco, for Mojca, who wanted another 8~regimes. + +\startencoding[\s!default] + +\definecharacter texthorizontalbar {{\endash\kern\zeropoint\endash}} +\definecharacter textdong {\underbar{\dstroke}} + +\stopencoding + +%D Goodie (makes more sense): + +\def\normalcontrolspace + {\getglyph{ComputerModernMono}{\char32}} + +\def\fakedcontrolspace % can be virtual in luatex + {\dontleavehmode\hbox + {\scratchdimen.1ex% + \kern\scratchdimen + \vrule \!!width\scratchdimen \!!height5.5\scratchdimen \!!depth3\scratchdimen + \vrule \!!width\dimexpr.5em-4\scratchdimen\relax \!!height-2\scratchdimen \!!depth3\scratchdimen + \vrule \!!width\scratchdimen \!!height5.5\scratchdimen \!!depth3\scratchdimen + \kern\scratchdimen}} + +\def\fakecontrolspace{\let\normalcontrolspace\fakedcontrolspace} + +\endinput diff --git a/tex/context/base/enco-def.tex b/tex/context/base/enco-def.tex deleted file mode 100644 index b6d66bb6c..000000000 --- a/tex/context/base/enco-def.tex +++ /dev/null @@ -1,920 +0,0 @@ -%D \module -%D [ file=enco-def, -%D version=2000.05.07, % 2000.20.12, % split from less verbose base file -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Default Character Definitions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Instead of overloading plain \TEX\ macros (and keeping them -%D available as an escape), we now use the more verbose -%D definitions in this file. Since memory is less a problem -%D these days, this verbosity has only a small price, but we -%D gain readability. The following definitions are based on -%D usage of the the original \TEX\ fonts, where composed -%D characters were not part of the design. So, occasionally -%D we have to revert to hacks. Thanks to all those users who -%D helped me to fill in the details. - -\startencoding[default] - -\definecharacter textcomma , -\definecharacter textperiod . - -\definecharacter textacute 19 -\definecharacter textbottomdot 46 -\definecharacter textbreve 21 -\definecharacter textcaron 20 -\definecharacter textcedilla 24 -\definecharacter textcircumflex 94 -\definecharacter textdiaeresis 127 -\definecharacter textdotaccent 95 -\definecharacter textgrave 18 -\definecharacter texthungarumlaut 125 -\definecharacter textmacron 22 -\definecharacter textogonek 24 % fake -\definecharacter textring 23 -\definecharacter texttilde 126 - -\definecharacter textbottomcomma {\hbox{\lower.35ex\hbox{\tx,}}} % for mojca - -\definecharacter dotlessi {\char"10 } -\definecharacter dotlessj {\char"11 } -\definecharacter dotlessI {I} -\definecharacter dotlessJ {J} - -\definecharacter endash 123 -\definecharacter emdash 124 - -\definecharacter aeligature {\char26 } % "1A -\definecharacter AEligature {\char29 } % "1D -\definecharacter ijligature {ij} -\definecharacter IJligature {IJ} -\definecharacter oeligature {\char27 } % "1B -\definecharacter OEligature {\char30 } % "1E - -\definecharacter ssharp {\char25 } % "19 -\definecharacter Ssharp {SS} - -\definecharacter thorn {\unknownchar} -\definecharacter Thorn {\unknownchar} - -\definecharacter eth {\unknownchar} % mojca prefers this (was \dstroke) -%definecharacter Eth {\unknownchar} -\definecharacter Eth {\Dstroke} % mojca prefers this too - -\definecharacter exclamdown 60 -\definecharacter questiondown 62 - -\definecharacter copyright {\encircled{\txx C}} -\definecharacter registered {\encircled{\txx R}} -\definecharacter trademark {\high{\txx TM}} - -\definecharacter sectionmark {\mathematics{\mathhexbox278}} -\definecharacter paragraphmark {\mathematics{\mathhexbox27B}} - -\definecharacter onequarter {\vulgarfraction{1}{4}} -\definecharacter onehalf {\vulgarfraction{1}{2}} -\definecharacter threequarter {\vulgarfraction{3}{4}} - -\definecharacter onesuperior {\high{1}} -\definecharacter twosuperior {\high{2}} -\definecharacter threesuperior {\high{3}} - -\definecharacter textcent {c} -\definecharacter textcurrency {\unknownchar} -\definecharacter textdollar {\fakedollar} -\definecharacter texteuro {E} -\definecharacter textflorin {\fakeflorin} -\definecharacter textsterling {\fakesterling} -\definecharacter textyen {Y} - -\definecharacter ordfeminine {\high{\txx a}} -\definecharacter ordmasculine {\high{\txx o}} - -\definecharacter percent {\fakepercent} -\definecharacter perthousand {\fakeperthousand} - -\definecharacter softhyphen 45 -\definecharacter periodcentered {\hbox{\mathematics\cdot}} -\definecharacter compoundwordmark 23 - -\definecharacter textasciicircum 94 -\definecharacter textasciitilde 126 -\definecharacter textslash 47 -\definecharacter textbackslash {\tex{}} % todo -\definecharacter textbraceleft {\mathematics\{} -\definecharacter textbraceright {\mathematics\}} -\definecharacter textunderscore {\fakeunderscore} -\definecharacter textvisiblespace {\fakevisiblespace} - -\definecharacter textbrokenbar {\mathematics\vert} -\definecharacter textbullet {\mathematics\bullet} -\definecharacter textdag {\mathematics\dag} -\definecharacter textddag {\mathematics\ddag} -\definecharacter textdegree {\mathematics{{}^{\circ}}} -\definecharacter textdiv {\mathematics\div} -\definecharacter textellipsis {\mathematics\cdots} -\definecharacter textfraction {\mathematics/} -\definecharacter textlognot {\mathematics\neg} -\definecharacter textminus {\mathematics-} -\definecharacter textmu {\mathematics\mu} -\definecharacter textmultiply {\mathematics\times} -\definecharacter textpm {\mathematics\pm} - -\definecharacter quotedbl {"} -\definecharacter quotedblbase {,,} -\definecharacter quotedblleft {``} -\definecharacter quotedblright {''} - -\definecharacter quotesingle {`} -\definecharacter quotesinglebase {,} - -\definecharacter quoteleft {`} -\definecharacter quoteright {'} - -\definecharacter guilsingleleft {\fakeleftsubguillemot } -\definecharacter guilsingleright {\fakerightsubguillemot} - -\definecharacter leftguillemot {\fakeleftguillemot } -\definecharacter rightguillemot {\fakerightguillemot} - -\definecharacter Acircumflex {\buildtextaccent\textcircumflex A} -\definecharacter acircumflex {\buildtextaccent\textcircumflex a} -\definecharacter Ccircumflex {\buildtextaccent\textcircumflex C} -\definecharacter ccircumflex {\buildtextaccent\textcircumflex c} -\definecharacter Ecircumflex {\buildtextaccent\textcircumflex E} -\definecharacter ecircumflex {\buildtextaccent\textcircumflex e} -\definecharacter Gcircumflex {\buildtextaccent\textcircumflex G} -\definecharacter gcircumflex {\buildtextaccent\textcircumflex g} -\definecharacter Hcircumflex {\buildtextaccent\textcircumflex H} -\definecharacter hcircumflex {\buildtextaccent\textcircumflex h} -\definecharacter Icircumflex {\buildtextaccent\textcircumflex \dotlessI} -\definecharacter icircumflex {\buildtextaccent\textcircumflex \dotlessi} -\definecharacter Jcircumflex {\buildtextaccent\textcircumflex \dotlessJ} -\definecharacter jcircumflex {\buildtextaccent\textcircumflex \dotlessj} -\definecharacter Ocircumflex {\buildtextaccent\textcircumflex O} -\definecharacter ocircumflex {\buildtextaccent\textcircumflex o} -\definecharacter Scircumflex {\buildtextaccent\textcircumflex S} -\definecharacter scircumflex {\buildtextaccent\textcircumflex s} -\definecharacter Ucircumflex {\buildtextaccent\textcircumflex U} -\definecharacter ucircumflex {\buildtextaccent\textcircumflex u} -\definecharacter Wcircumflex {\buildtextaccent\textcircumflex W} -\definecharacter wcircumflex {\buildtextaccent\textcircumflex w} -\definecharacter Ycircumflex {\buildtextaccent\textcircumflex Y} -\definecharacter ycircumflex {\buildtextaccent\textcircumflex y} - -\definecharacter Agrave {\buildtextaccent\textgrave A} -\definecharacter agrave {\buildtextaccent\textgrave a} -\definecharacter Egrave {\buildtextaccent\textgrave E} -\definecharacter egrave {\buildtextaccent\textgrave e} -\definecharacter Igrave {\buildtextaccent\textgrave \dotlessI} -\definecharacter igrave {\buildtextaccent\textgrave \dotlessi} -\definecharacter Ograve {\buildtextaccent\textgrave O} -\definecharacter ograve {\buildtextaccent\textgrave o} -\definecharacter Ugrave {\buildtextaccent\textgrave U} -\definecharacter ugrave {\buildtextaccent\textgrave u} -\definecharacter Ygrave {\buildtextaccent\textgrave Y} -\definecharacter ygrave {\buildtextaccent\textgrave y} - -\definecharacter Atilde {\buildtextaccent\texttilde A} -\definecharacter atilde {\buildtextaccent\texttilde a} -\definecharacter Itilde {\buildtextaccent\texttilde \dotlessI} -\definecharacter itilde {\buildtextaccent\texttilde \dotlessi} -\definecharacter Ntilde {\buildtextaccent\texttilde N} -\definecharacter ntilde {\buildtextaccent\texttilde n} -\definecharacter Otilde {\buildtextaccent\texttilde O} -\definecharacter otilde {\buildtextaccent\texttilde o} -\definecharacter Utilde {\buildtextaccent\texttilde U} -\definecharacter utilde {\buildtextaccent\texttilde u} -\definecharacter Ytilde {\buildtextaccent\texttilde Y} -\definecharacter ytilde {\buildtextaccent\texttilde y} - -\definecharacter Adiaeresis {\buildtextaccent\textdiaeresis A} -\definecharacter adiaeresis {\buildtextaccent\textdiaeresis a} -\definecharacter Ediaeresis {\buildtextaccent\textdiaeresis E} -\definecharacter ediaeresis {\buildtextaccent\textdiaeresis e} -\definecharacter Idiaeresis {\buildtextaccent\textdiaeresis \dotlessI} -\definecharacter idiaeresis {\buildtextaccent\textdiaeresis \dotlessi} -\definecharacter Odiaeresis {\buildtextaccent\textdiaeresis O} -\definecharacter odiaeresis {\buildtextaccent\textdiaeresis o} -\definecharacter Udiaeresis {\buildtextaccent\textdiaeresis U} -\definecharacter udiaeresis {\buildtextaccent\textdiaeresis u} -\definecharacter Ydiaeresis {\buildtextaccent\textdiaeresis Y} -\definecharacter ydiaeresis {\buildtextaccent\textdiaeresis y} - -\definecharacter Aacute {\buildtextaccent\textacute A} -\definecharacter aacute {\buildtextaccent\textacute a} -\definecharacter Cacute {\buildtextaccent\textacute C} -\definecharacter cacute {\buildtextaccent\textacute c} -\definecharacter Eacute {\buildtextaccent\textacute E} -\definecharacter eacute {\buildtextaccent\textacute e} -\definecharacter Iacute {\buildtextaccent\textacute \dotlessI} -\definecharacter iacute {\buildtextaccent\textacute \dotlessi} -\definecharacter Lacute {\buildtextaccent\textacute L} -\definecharacter lacute {\buildtextaccent\textacute l} -\definecharacter Nacute {\buildtextaccent\textacute N} -\definecharacter nacute {\buildtextaccent\textacute n} -\definecharacter Oacute {\buildtextaccent\textacute O} -\definecharacter oacute {\buildtextaccent\textacute o} -\definecharacter Racute {\buildtextaccent\textacute R} -\definecharacter racute {\buildtextaccent\textacute r} -\definecharacter Sacute {\buildtextaccent\textacute S} -\definecharacter sacute {\buildtextaccent\textacute s} -\definecharacter Uacute {\buildtextaccent\textacute U} -\definecharacter uacute {\buildtextaccent\textacute u} -\definecharacter Yacute {\buildtextaccent\textacute Y} -\definecharacter yacute {\buildtextaccent\textacute y} -\definecharacter Zacute {\buildtextaccent\textacute Z} -\definecharacter zacute {\buildtextaccent\textacute z} - -%definecharacter Dstroke {D} -%definecharacter dstroke {d} - -\definecharacter dstroke {\pseudoencodeddj} -\definecharacter Dstroke {\pseudoencodedDJ} -\definecharacter Hstroke {H} -\definecharacter hstroke {h} -\definecharacter Tstroke {T} -\definecharacter tstroke {t} - -\definecharacter Cdotaccent {\buildtextaccent\textdotaccent C} -\definecharacter cdotaccent {\buildtextaccent\textdotaccent c} -\definecharacter Edotaccent {\buildtextaccent\textdotaccent E} -\definecharacter edotaccent {\buildtextaccent\textdotaccent e} -\definecharacter Gdotaccent {\buildtextaccent\textdotaccent G} -\definecharacter gdotaccent {\buildtextaccent\textdotaccent g} -\definecharacter Idotaccent {\buildtextaccent\textdotaccent \dotlessI} -\definecharacter idotaccent {\buildtextaccent\textdotaccent \dotlessi} -\definecharacter Zdotaccent {\buildtextaccent\textdotaccent Z} -\definecharacter zdotaccent {\buildtextaccent\textdotaccent z} - -\definecharacter Amacron {\buildtextaccent\textmacron A} -\definecharacter amacron {\buildtextaccent\textmacron a} -\definecharacter Emacron {\buildtextaccent\textmacron E} -\definecharacter emacron {\buildtextaccent\textmacron e} -\definecharacter Imacron {\buildtextaccent\textmacron \dotlessI} -\definecharacter imacron {\buildtextaccent\textmacron \dotlessi} -\definecharacter Omacron {\buildtextaccent\textmacron O} -\definecharacter omacron {\buildtextaccent\textmacron o} -\definecharacter Umacron {\buildtextaccent\textmacron U} -\definecharacter umacron {\buildtextaccent\textmacron u} - -\definecharacter Ccedilla {\buildtextcedilla C} -\definecharacter ccedilla {\buildtextcedilla c} -\definecharacter Kcedilla {\buildtextcedilla K} -\definecharacter kcedilla {\buildtextcedilla k} -\definecharacter Lcedilla {\buildtextcedilla L} -\definecharacter lcedilla {\buildtextcedilla l} -\definecharacter Ncedilla {\buildtextcedilla N} -\definecharacter ncedilla {\buildtextcedilla n} -\definecharacter Rcedilla {\buildtextcedilla R} -\definecharacter rcedilla {\buildtextcedilla r} -\definecharacter Scedilla {\buildtextcedilla S} -\definecharacter scedilla {\buildtextcedilla s} -\definecharacter Tcedilla {\buildtextcedilla T} -\definecharacter tcedilla {\buildtextcedilla t} - -\definecharacter Ohungarumlaut {\buildtextaccent\texthungarumlaut O} -\definecharacter ohungarumlaut {\buildtextaccent\texthungarumlaut o} -\definecharacter Uhungarumlaut {\buildtextaccent\texthungarumlaut U} -\definecharacter uhungarumlaut {\buildtextaccent\texthungarumlaut u} - -\definecharacter Aogonek {\buildtextogonek A} -\definecharacter aogonek {\buildtextogonek a} -\definecharacter Eogonek {\buildtextogonek E} -\definecharacter eogonek {\buildtextogonek e} -\definecharacter Iogonek {\buildtextogonek I} -\definecharacter iogonek {\buildtextogonek i} -\definecharacter Uogonek {\buildtextogonek U} -\definecharacter uogonek {\buildtextogonek u} - -\definecharacter Aring {\buildtextaccent\textring A} -\definecharacter aring {\buildtextaccent\textring a} -\definecharacter Uring {\buildtextaccent\textring U} -\definecharacter uring {\buildtextaccent\textring u} - -\definecharacter Abreve {\buildtextaccent\textbreve A} -\definecharacter abreve {\buildtextaccent\textbreve a} -\definecharacter Ebreve {\buildtextaccent\textbreve E} -\definecharacter ebreve {\buildtextaccent\textbreve e} -\definecharacter Gbreve {\buildtextaccent\textbreve G} -\definecharacter gbreve {\buildtextaccent\textbreve g} -\definecharacter Ibreve {\buildtextaccent\textbreve \dotlessI} -\definecharacter ibreve {\buildtextaccent\textbreve \dotlessi} -\definecharacter Obreve {\buildtextaccent\textbreve O} -\definecharacter obreve {\buildtextaccent\textbreve o} -\definecharacter Ubreve {\buildtextaccent\textbreve U} -\definecharacter ubreve {\buildtextaccent\textbreve u} - -\definecharacter Ccaron {\buildtextaccent\textcaron C} -\definecharacter ccaron {\buildtextaccent\textcaron c} -\definecharacter Dcaron {\buildtextaccent\textcaron D} -\definecharacter dcaron {\buildtextaccent\textcaron d} -\definecharacter Ecaron {\buildtextaccent\textcaron E} -\definecharacter ecaron {\buildtextaccent\textcaron e} -\definecharacter Lcaron {\buildtextaccent\textcaron L} -\definecharacter lcaron {\buildtextaccent\textcaron l} -\definecharacter Ncaron {\buildtextaccent\textcaron N} -\definecharacter ncaron {\buildtextaccent\textcaron n} -\definecharacter Rcaron {\buildtextaccent\textcaron R} -\definecharacter rcaron {\buildtextaccent\textcaron r} -\definecharacter Scaron {\buildtextaccent\textcaron S} -\definecharacter scaron {\buildtextaccent\textcaron s} -\definecharacter Tcaron {\buildtextaccent\textcaron T} -\definecharacter tcaron {\buildtextaccent\textcaron t} -\definecharacter Ycaron {\buildtextaccent\textcaron Y} -\definecharacter ycaron {\buildtextaccent\textcaron y} -\definecharacter Zcaron {\buildtextaccent\textcaron Z} -\definecharacter zcaron {\buildtextaccent\textcaron z} - -\definecharacter Lstroke {\hsmash{\char32}L} -\definecharacter lstroke {\hsmash{\char32}l} -\definecharacter Ostroke {\char31 } % "1F -\definecharacter ostroke {\char28 } % "1C - -\definecharacter aumlaut {\moveaccent{-.1ex}\adiaeresis} -\definecharacter eumlaut {\moveaccent{-.1ex}\ediaeresis} -\definecharacter iumlaut {\moveaccent{-.1ex}\idiaeresis} -\definecharacter oumlaut {\moveaccent{-.1ex}\odiaeresis} -\definecharacter uumlaut {\moveaccent{-.1ex}\udiaeresis} - -\definecharacter Aumlaut {\smashaccent\Adiaeresis} -\definecharacter Eumlaut {\smashaccent\Ediaeresis} -\definecharacter Iumlaut {\smashaccent\Idiaeresis} -\definecharacter Oumlaut {\smashaccent\Odiaeresis} -\definecharacter Uumlaut {\smashaccent\Udiaeresis} - -\definecharacter scommaaccent {\buildtextbottomcomma s} -\definecharacter Scommaaccent {\buildtextbottomcomma S} -\definecharacter tcommaaccent {\buildtextbottomcomma t} -\definecharacter Tcommaaccent {\buildtextbottomcomma T} -\definecharacter lcommaaccent {\buildtextbottomcomma l} -\definecharacter Lcommaaccent {\buildtextbottomcomma L} - -\definecharacter Etilde {\buildtextaccent\texttilde E} -\definecharacter etilde {\buildtextaccent\texttilde e} - -\definecharacter Ahook {A} -\definecharacter ahook {a} -\definecharacter Ehook {E} -\definecharacter ehook {e} -\definecharacter Ihook {I} -\definecharacter ihook {i} -\definecharacter Ohook {O} -\definecharacter ohook {o} -\definecharacter Uhook {U} -\definecharacter uhook {u} -\definecharacter Yhook {Y} -\definecharacter yhook {y} - -\definecharacter Acircumflexgrave {\Acircumflex} -\definecharacter Acircumflexacute {\Acircumflex} -\definecharacter Acircumflextilde {\Acircumflex} -\definecharacter Acircumflexhook {\Acircumflex} -\definecharacter acircumflexgrave {\acircumflex} -\definecharacter acircumflexacute {\acircumflex} -\definecharacter acircumflextilde {\acircumflex} -\definecharacter acircumflexhook {\acircumflex} -\definecharacter Ecircumflexgrave {\Ecircumflex} -\definecharacter Ecircumflexacute {\Ecircumflex} -\definecharacter Ecircumflextilde {\Ecircumflex} -\definecharacter Ecircumflexhook {\Ecircumflex} -\definecharacter ecircumflexgrave {\ecircumflex} -\definecharacter ecircumflexacute {\ecircumflex} -\definecharacter ecircumflextilde {\ecircumflex} -\definecharacter ecircumflexhook {\ecircumflex} -\definecharacter Ocircumflexgrave {\Ocircumflex} -\definecharacter Ocircumflexacute {\Ocircumflex} -\definecharacter Ocircumflextilde {\Ocircumflex} -\definecharacter Ocircumflexhook {\Ocircumflex} -\definecharacter ocircumflexgrave {\ocircumflex} -\definecharacter ocircumflexacute {\ocircumflex} -\definecharacter ocircumflextilde {\ocircumflex} -\definecharacter ocircumflexhook {\ocircumflex} - -\definecharacter Abrevegrave {\Abreve} -\definecharacter Abreveacute {\Abreve} -\definecharacter Abrevetilde {\Abreve} -\definecharacter Abrevehook {\Abreve} -\definecharacter abrevegrave {\abreve} -\definecharacter abreveacute {\abreve} -\definecharacter abrevetilde {\abreve} -\definecharacter abrevehook {\abreve} - -\definecharacter Adotbelow {\buildtextbottomdot A} -\definecharacter adotbelow {\buildtextbottomdot a} -\definecharacter Edotbelow {\buildtextbottomdot E} -\definecharacter edotbelow {\buildtextbottomdot e} -\definecharacter Idotbelow {\buildtextbottomdot I} -\definecharacter idotbelow {\buildtextbottomdot i} -\definecharacter Odotbelow {\buildtextbottomdot O} -\definecharacter odotbelow {\buildtextbottomdot o} -\definecharacter Udotbelow {\buildtextbottomdot U} -\definecharacter udotbelow {\buildtextbottomdot u} -\definecharacter Ydotbelow {\buildtextbottomdot Y} -\definecharacter ydotbelow {\buildtextbottomdot y} - -\definecharacter Ohorndotbelow {\buildtextbottomdot\Ohorn} -\definecharacter ohorndotbelow {\buildtextbottomdot\ohorn} -\definecharacter Uhorndotbelow {\buildtextbottomdot\Uhorn} -\definecharacter uhorndotbelow {\buildtextbottomdot\uhorn} - -\definecharacter Acircumflexdotbelow {\buildtextbottomdot\Acircumflex} -\definecharacter acircumflexdotbelow {\buildtextbottomdot\acircumflex} -\definecharacter Ecircumflexdotbelow {\buildtextbottomdot\Ecircumflex} -\definecharacter ecircumflexdotbelow {\buildtextbottomdot\ecircumflex} -\definecharacter Ocircumflexdotbelow {\buildtextbottomdot\Ocircumflex} -\definecharacter ocircumflexdotbelow {\buildtextbottomdot\ocircumflex} -\definecharacter Abrevedotbelow {\buildtextbottomdot\Abreve} -\definecharacter abrevedotbelow {\buildtextbottomdot\abreve} - -\definecharacter Ohorn {O} -\definecharacter Ohorngrave {\Ograve} -\definecharacter Ohornacute {\Oacute} -\definecharacter Ohorntilde {\Otilde} -\definecharacter Ohornhook {O} -\definecharacter ohorn {o} -\definecharacter ohorngrave {\ograve} -\definecharacter ohornacute {\oacute} -\definecharacter ohorntilde {\otilde} -\definecharacter ohornhook {o} -\definecharacter Uhorn {U} -\definecharacter Uhorngrave {\Ugrave} -\definecharacter Uhornacute {\Uacute} -\definecharacter Uhorntilde {\Utilde} -\definecharacter Uhornhook {U} -\definecharacter uhorn {u} -\definecharacter uhorngrave {\ugrave} -\definecharacter uhornacute {\uacute} -\definecharacter uhorntilde {\utilde} -\definecharacter uhornhook {u} - -\stopencoding - -%D Needed for transliterated chinese (provided by Tobias Burnus). - -\startencoding[default] - -\definecharacter acaron {\buildtextaccent\textcaron a} % U+01CE -\definecharacter icaron {\buildtextaccent\textcaron \dotlessi} % U+01D0 -\definecharacter ocaron {\buildtextaccent\textcaron o} % U+01D2 -\definecharacter ucaron {\buildtextaccent\textcaron u} % U+01D4 - -\stopencoding - -%D Greek (moved to here): - -\startencoding[default] - -% Uppercase Greek letters - -\definecharacter greekAlpha {\Alpha} -\definecharacter greekBeta {\Beta} -\definecharacter greekGamma {\Gamma} -\definecharacter greekDelta {\Delta} -\definecharacter greekEpsilon {\Epsilon} -\definecharacter greekZeta {\Zeta} -\definecharacter greekEta {\Eta} -\definecharacter greekTheta {\Theta} -\definecharacter greekIota {\Iota} -\definecharacter greekKappa {\Kappa} -\definecharacter greekLambda {\Lambda} -\definecharacter greekMu {\Mu} -\definecharacter greekNu {\Nu} -\definecharacter greekXi {\Xi} -\definecharacter greekOmicron {\Omicron} -\definecharacter greekPi {\Pi} -\definecharacter greekRho {\Rho} -\definecharacter greekSigma {\Sigma} -\definecharacter greekTau {\Tau} -\definecharacter greekUpsilon {\Upsilon} -\definecharacter greekPhi {\Phi} -\definecharacter greekChi {\Chi} -\definecharacter greekPsi {\Psi} -\definecharacter greekOmega {\Omega} - -% Lowercase Greek letters - -\definecharacter greekalpha {\alpha} -\definecharacter greekbeta {\beta} -\definecharacter greekgamma {\gamma} -\definecharacter greekdelta {\delta} -\definecharacter greekepsilon {\varepsilon} -\definecharacter greekepsilonalt {\epsilon} -\definecharacter greekzeta {\zeta} -\definecharacter greeketa {\eta} -\definecharacter greektheta {\theta} -\definecharacter greekthetaalt {\vartheta} -\definecharacter greekiota {\iota} -\definecharacter greekkappa {\kappa} -\definecharacter greeklambda {\lambda} -\definecharacter greekmu {\mu} -\definecharacter greeknu {\nu} -\definecharacter greekxi {\xi} -\definecharacter greekomicron {\omicron} -\definecharacter greekpi {\pi} -\definecharacter greekrho {\rho} -\definecharacter greeksigma {\sigma} -\definecharacter greekfinalsigma {\varsigma} -\definecharacter greektau {\tau} -\definecharacter greekupsilon {\upsilon} -\definecharacter greekphi {\varphi} -\definecharacter greekphialt {\phi} -\definecharacter greekchi {\chi} -\definecharacter greekpsi {\psi} -\definecharacter greekomega {\omega} - -% Accented Uppercase Greek letters - -\definecharacter greekAlphatonos {'A} -\definecharacter greekEpsilontonos {'E} -\definecharacter greekEtatonos {'H} -\definecharacter greekIotatonos {'I} -\definecharacter greekOmicrontonos {'O} -\definecharacter greekUpsilontonos {'U} -\definecharacter greekOmegatonos {'W} -\definecharacter greekIotadialytika {"I} -\definecharacter greekUpsilondialytika {"U} - -% Accented Lowercase Greek letters - -\definecharacter greekalphatonos {'a} -\definecharacter greekepsilontonos {'e} -\definecharacter greeketatonos {'h} -\definecharacter greekiotatonos {'i} -\definecharacter greekomicrontonos {'o} -\definecharacter greekupsilontonos {'u} -\definecharacter greekomegatonos {'w} -\definecharacter greekiotadialytika {"i} -\definecharacter greekupsilondialytika {"u} -\definecharacter greekiotadialytikatonos {'"i} -\definecharacter greekupsilondialytikatonos {'"u} - -% Miscellaneous Greek symbols - -\definecharacter greekleftquot {((} -\definecharacter greekrightquot {))} -\definecharacter greektonos {'} -\definecharacter greekdialytikatonos {'"} -\definecharacter greekapostrophos {''} - -\stopencoding - -%D Cyrillic (moved to here): - -\startencoding[default] - -\definecharacter cyrillicA {A} -\definecharacter cyrillicB {B} -\definecharacter cyrillicV {V} -\definecharacter cyrillicG {G} -\definecharacter cyrillicD {D} -\definecharacter cyrillicE {E} -\definecharacter cyrillicZH {ZH} -\definecharacter cyrillicZ {Z} -\definecharacter cyrillicI {I} -\definecharacter cyrillicISHRT {ISHRT} -\definecharacter cyrillicK {K} -\definecharacter cyrillicL {L} -\definecharacter cyrillicM {M} -\definecharacter cyrillicN {N} -\definecharacter cyrillicO {O} -\definecharacter cyrillicP {P} -\definecharacter cyrillicR {R} -\definecharacter cyrillicS {S} -\definecharacter cyrillicT {T} -\definecharacter cyrillicU {U} -\definecharacter cyrillicF {F} -\definecharacter cyrillicH {H} -\definecharacter cyrillicC {C} -\definecharacter cyrillicCH {CH} -\definecharacter cyrillicSH {SH} -\definecharacter cyrillicSHCH {SHCH} -\definecharacter cyrillicHRDSN {HRDSN} -\definecharacter cyrillicERY {ERY} -\definecharacter cyrillicSFTSN {SFTSN} -\definecharacter cyrillicEREV {EREV} -\definecharacter cyrillicYU {YU} -\definecharacter cyrillicYA {YA} -\definecharacter cyrillicGUP {GUP} -\definecharacter cyrillicGHCRS {GHCRS} -\definecharacter cyrillicDJE {DJE} -\definecharacter cyrillicTSHE {TSHE} -\definecharacter cyrillicSHHA {SHHA} -\definecharacter cyrillicZHDSC {ZHDSC} -\definecharacter cyrillicZDSC {ZDSC} -\definecharacter cyrillicLJE {LJE} -\definecharacter cyrillicYI {YI} -\definecharacter cyrillicKDSC {KDSC} -\definecharacter cyrillicKBEAK {KBEAK} -\definecharacter cyrillicKVCRS {KVCRS} -\definecharacter cyrillicAE {AE} -\definecharacter cyrillicNDSC {NDSC} -\definecharacter cyrillicNG {NG} -\definecharacter cyrillicDZE {DZE} -\definecharacter cyrillicOTLD {OTLD} -\definecharacter cyrillicSDSC {SDSC} -\definecharacter cyrillicUSHRT {USHRT} -\definecharacter cyrillicY {Y} -\definecharacter cyrillicYHCRS {YHCRS} -\definecharacter cyrillicHDSC {HDSC} -\definecharacter cyrillicDZHE {DZHE} -\definecharacter cyrillicCHVCRS {CHVCRS} -\definecharacter cyrillicCHRDSC {CHRDSC} -\definecharacter cyrillicIE {IE} -\definecharacter cyrillicSCHWA {SCHWA} -\definecharacter cyrillicNJE {NJE} -\definecharacter cyrillicYO {YO} -\definecharacter cyrillicII {II} -\definecharacter cyrillicJE {JE} -\definecharacter cyrillicQ {Q} -\definecharacter cyrillicW {W} - -\definecharacter cyrillica {a} -\definecharacter cyrillicb {b} -\definecharacter cyrillicv {v} -\definecharacter cyrillicg {g} -\definecharacter cyrillicd {d} -\definecharacter cyrillice {e} -\definecharacter cyrilliczh {zh} -\definecharacter cyrillicz {z} -\definecharacter cyrillici {i} -\definecharacter cyrillicishrt {ishrt} -\definecharacter cyrillick {k} -\definecharacter cyrillicl {l} -\definecharacter cyrillicm {m} -\definecharacter cyrillicn {n} -\definecharacter cyrillico {o} -\definecharacter cyrillicp {p} -\definecharacter cyrillicr {r} -\definecharacter cyrillics {s} -\definecharacter cyrillict {t} -\definecharacter cyrillicu {u} -\definecharacter cyrillicf {f} -\definecharacter cyrillich {h} -\definecharacter cyrillicc {c} -\definecharacter cyrillicch {ch} -\definecharacter cyrillicsh {sh} -\definecharacter cyrillicshch {shch} -\definecharacter cyrillichrdsn {hrdsn} -\definecharacter cyrillicery {ery} -\definecharacter cyrillicsftsn {sftsn} -\definecharacter cyrillicerev {erev} -\definecharacter cyrillicyu {yu} -\definecharacter cyrillicya {ya} -\definecharacter cyrillicgup {gup} -\definecharacter cyrillicghcrs {ghcrs} -\definecharacter cyrillicdje {dje} -\definecharacter cyrillictshe {tshe} -\definecharacter cyrillicshha {shha} -\definecharacter cyrilliczhdsc {zhdsc} -\definecharacter cyrilliczdsc {zdsc} -\definecharacter cyrilliclje {lje} -\definecharacter cyrillicyi {yi} -\definecharacter cyrillickdsc {kdsc} -\definecharacter cyrillickbeak {kbeak} -\definecharacter cyrillickvcrs {kvcrs} -\definecharacter cyrillicae {ae} -\definecharacter cyrillicndsc {ndsc} -\definecharacter cyrillicng {ng} -\definecharacter cyrillicdze {dze} -\definecharacter cyrillicotld {otld} -\definecharacter cyrillicsdsc {sdsc} -\definecharacter cyrillicushrt {ushrt} -\definecharacter cyrillicy {y} -\definecharacter cyrillicyhcrs {yhcrs} -\definecharacter cyrillichdsc {hdsc} -\definecharacter cyrillicdzhe {dzhe} -\definecharacter cyrillicchvcrs {chvcrs} -\definecharacter cyrillicchrdsc {chrdsc} -\definecharacter cyrillicie {ie} -\definecharacter cyrillicschwa {schwa} -\definecharacter cyrillicnje {nje} -\definecharacter cyrillicyo {yo} -\definecharacter cyrillicii {ii} -\definecharacter cyrillicje {je} -\definecharacter cyrillicq {q} -\definecharacter cyrillicw {w} - -\definecharacter cyrillicGJE {\'\cyrillicG} -\definecharacter cyrillicgje {\'\cyrillicg} -\definecharacter cyrillicKJE {\'\cyrillicK} -\definecharacter cyrillickje {\'\cyrillick} - -\stopencoding - -\def\cyrillicio{\cyrillicyo} -\def\cyrillicIO{\cyrillicYO} - -%D Hebrew: - -\startencoding[default] - -\definecharacter hebrewAlef {'} -\definecharacter hebrewBet {b} -\definecharacter hebrewGimel {g} -\definecharacter hebrewDalet {d} -\definecharacter hebrewHe {h} -\definecharacter hebrewVav {w} -\definecharacter hebrewZayin {z} -\definecharacter hebrewHet {\hstroke} -\definecharacter hebrewTet {\tcedilla} -\definecharacter hebrewYod {y} -\definecharacter hebrewKaffinal {k} -\definecharacter hebrewKaf {k} -\definecharacter hebrewLamed {l} -\definecharacter hebrewMemfinal {m} -\definecharacter hebrewMem {m} -\definecharacter hebrewNunfinal {n} -\definecharacter hebrewNun {n} -\definecharacter hebrewSamekh {s} -\definecharacter hebrewAyin {\gdotaccent} -\definecharacter hebrewPefinal {p} -\definecharacter hebrewPe {p} -\definecharacter hebrewTsadifinal {\scedilla} -\definecharacter hebrewTsadi {\scedilla} -\definecharacter hebrewQof {q} -\definecharacter hebrewResh {r} -\definecharacter hebrewShin {\scaron} -\definecharacter hebrewTav {th} - -\stopencoding - -%D A few goodies: - -\def\eszett{\ssharp} -\def\Eszett{\Ssharp} - -\def\lslash{\lstroke} -\def\Lslash{\Lstroke} -\def\dslash{\dstroke} -\def\Dslash{\Dstroke} -\def\oslash{\ostroke} -\def\Oslash{\Ostroke} - -\def\dcroat{\dstroke} -\def\Dcroat{\Dstroke} - -% \startencoding [default] -% -% \definecharacter scommaaccent {\scedilla} -% \definecharacter Scommaaccent {\Scedilla} -% \definecharacter tcommaaccent {\tcedilla} -% \definecharacter Tcommaaccent {\Tcedilla} -% -% \stopencoding - -% for plain tex's sake - -\def\S {\sectionmark } -\def\P {\paragraphmark} - -% for latex users sake - -\def\textS {\sectionmark } -\def\textP {\paragraphmark} - -% for old times sake - -\def\florin {\textflorin } \def\florijn{\textflorin} -\def\dollar {\textdollar } -\def\pound {\textsterling} -\def\sterling{\textsterling} - -% idem - -\def\promille{\perthousand} -\def\permille{\perthousand} -\def\procent {\percent } -\def\permine {\fakepermine} - -% some more - -\def\hyphen {\softhyphen} -\def\cwm {\compoundwordmark} -\def\nonbreakinghyphen {\hyphen} -\def\breakinghyphen {\hyphen\prewordbreak} - -% quotes - -\def\lowerleftsingleninequote {\quotesinglebase} -\def\lowerleftdoubleninequote {\quotedblbase} -\def\lowerrightsingleninequote {\quotesinglebase} -\def\lowerrightdoubleninequote {\quotedblbase} - -\def\upperleftsingleninequote {\quoteright} -\def\upperleftdoubleninequote {\quotedblright} -\def\upperrightsingleninequote {\quoteright} -\def\upperrightdoubleninequote {\quotedblright} - -\def\upperleftsinglesixquote {\quoteleft} -\def\upperleftdoublesixquote {\quotedblleft} -\def\upperrightsinglesixquote {\quoteleft} -\def\upperrightdoublesixquote {\quotedblleft} - -\def\leftsubguillemot {\guilsingleleft} -\def\rightsubguillemot {\guilsingleright} - -%D A couple of fallbacks suggestion by users, slightly -%D adapted and obscured by memory saving hacks. - -\unprotect - -\startencoding[default] - -\definecharacter textcent {c\rlap{\hskip-.2\s!em - \vrule\!!width.2\s!pt\!!height1.2\s!ex\!!depth.2\s!ex}} - -\definecharacter texteuro {C\rlap{\hskip-.75\s!em - \vrule\!!width.4\s!em\!!height.85\s!ex\!!depth-.8\s!ex}} - -\definecharacter textblacksquare {\dontleavehmode\hbox{% - \vrule\!!width.3\s!em\!!height.4\s!em\!!depth-.1\s!em}} - -\definecharacter textbrokenbar {\dontleavehmode\hbox{\kern.05\s!em - \vrule\!!width.4\s!pt\!!height1.8\s!ex\!!depth-.85\s!ex - \llap{% - \vrule\!!width.4\s!pt\!!height.35\s!ex\!!depth.6\s!ex}% - \kern.05\s!em}} - -\stopencoding - -\protect - -%D We also use symbolic names for math accents. - -\startencoding[default] - -\definecharacter mathacute "7013 -\definecharacter mathgrave "7012 -\definecharacter mathddot "707F -\definecharacter mathtilde "707E -\definecharacter mathbar "7016 -\definecharacter mathbreve "7015 -\definecharacter mathcheck "7014 -\definecharacter mathhat "705E -\definecharacter mathvec "017E -\definecharacter mathdot "705F -\definecharacter mathwidetilde "0365 -\definecharacter mathwidehat "0362 - -\stopencoding - -% \startencoding [default] - -% \definecommand prime {\mathematics{'}} -% \definecommand doubleprime {\mathematics{''}} -% \definecommand tripleprime {\mathematics{'''}} - -% \stopencoding - -\ifx\zdot\undefined \def\zdot{\zdotaccent} \fi -\ifx\Zdot\undefined \def\Zdot{\Zdotaccent} \fi - -\ifx\greeklamda\undefined \def\greeklamda{\greeklambda} \fi -\ifx\greekLamda\undefined \def\greekLamda{\greekLambda} \fi - -\ifx\leftguillemet \undefined \def\leftguillemet {\leftguillemot } \fi -\ifx\rightguillemet\undefined \def\rightguillemet{\rightguillemot} \fi - -%D New: - -\startencoding[\s!default] - -\definecharacter schwa {\hbox{\rotate[\c!rotation=180,\c!location=\v!high]{\hbox{e}}}} -\definecharacter schwagrave {\buildtextgrave\schwa} - -\stopencoding - -%D Also new, from Taco, for Mojca, who wanted another 8~regimes. - -\startencoding[\s!default] - -\definecharacter texthorizontalbar {{\endash\kern\zeropoint\endash}} -\definecharacter textdong {\underbar{\dstroke}} - -\stopencoding - -%D Goodie (makes more sense): - -\def\normalcontrolspace - {\getglyph{ComputerModernMono}{\char32}} - -\def\fakedcontrolspace % can be virtual in luatex - {\dontleavehmode\hbox - {\scratchdimen.1ex% - \kern\scratchdimen - \vrule \!!width\scratchdimen \!!height5.5\scratchdimen \!!depth3\scratchdimen - \vrule \!!width\dimexpr.5em-4\scratchdimen\relax \!!height-2\scratchdimen \!!depth3\scratchdimen - \vrule \!!width\scratchdimen \!!height5.5\scratchdimen \!!depth3\scratchdimen - \kern\scratchdimen}} - -\def\fakecontrolspace{\let\normalcontrolspace\fakedcontrolspace} - -\endinput diff --git a/tex/context/base/enco-ec.mkii b/tex/context/base/enco-ec.mkii new file mode 100644 index 000000000..1ac41cadf --- /dev/null +++ b/tex/context/base/enco-ec.mkii @@ -0,0 +1,295 @@ +%D \module +%D [ file=enco-ec, +%D version=2000.05.07, % 1999.16.07, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=\LATEX\ EC Encoding, +%D author={Patrick Gundlach, Hans Hagen, Taco Hoekwater, Mojca Miklavec}, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is \LATEX2e's T1 encoding vector. All standard \LATEX\ +%D accents will work, including \type{\k}. The only accent that +%D does not work is \type{\t} (there is no tie in T1 encoding). +%D +%D Annoyingly, most \POSTSCRIPT\ fonts do not have \type +%D {\dotlessj}, and T1 encoding does not make the various +%D prebuilts with \type {j} available. When this is the case: +%D +%D \starttyping +%D \startencoding[ec] +%D \definecharacter dotlessj {j} +%D \stopencoding +%D \stoptyping +%D +%D is a way out. + +%D There is hardly a point in supporting TS1 encoding. + +\startmapping[ec] + +% a problem is that the uppercase of dstroke (158) and eth (240) +% is the same glyph (208) so we cannot do lowercase mapping there + +\definecasemaps 128 to 156 lc +32 uc 0 +\definecasemap 157 `i 157 % Idotaccent i +\definecasemap 158 158 208 % dstroke Eth +\definecasemap 159 159 159 % sectionmark +\definecasemaps 160 to 187 lc 0 uc -32 +\resetcaserange 189 to 191 % exclamdown, questiondown, textsterling +\definecasemaps 192 to 223 lc +32 uc 0 +\definecasemaps 224 to 254 lc 0 uc -32 +\definecaseswap 255 223 % ssharp (else patterns fail) +\definecaseswap 25 `I % dotless i + +% 156 vs. 188 IJligature + +%D Some languages need this: + +% \definecaseself 34 % quotedbl +% \definecaseself 18 % quotedblbase +% \definecaseself 16 % quotedblleft +% \definecaseself 17 % quotedblright +% \definecaseself 39 % quotesingle +% \definecaseself 13 % quotesinglebase +% \definecaseself 96 % quoteleft +% \definecaseself 39 % quoteright + +%D So far for the mapping. + +%D The following characters are kind of dangerous, +%D that is, they are normally not part of fonts, unless +%D explicitly constructed. +%D +%D \startitemize[columns,two] +%D \item \type{\dotlessj} - but then it may not be defined!!!! +%D \item \type{\IJligature} +%D \item \type{\ijligature} +%D \item \type{\Ssharp} +%D \item \type{\perthousand} +%D \item \type{\compoundwordmark} +% \item \type{\textvisiblespace} +%D \stopitemize + +%D So, for the moment we nil them; we can always create +%D another vector if needed. + +\stopmapping + +\startencoding[ec][ec] % second arg defines auto regime, needed here ? + +\definecharacter textgrave 0 +\definecharacter textacute 1 +\definecharacter textcircumflex 2 +\definecharacter texttilde 3 +\definecharacter textdiaeresis 4 +\definecharacter texthungarumlaut 5 +\definecharacter textring 6 +\definecharacter textcaron 7 +\definecharacter textbreve 8 +\definecharacter textmacron 9 +\definecharacter textdotaccent 10 +\definecharacter textcedilla 11 +\definecharacter textogonek 12 +\definecharacter quotesinglebase 13 +\definecharacter guilsingleleft 14 +\definecharacter guilsingleright 15 +\definecharacter quotedblleft 16 +\definecharacter quotedblright 17 +\definecharacter quotedblbase 18 +\definecharacter leftguillemot 19 +\definecharacter rightguillemot 20 +\definecharacter endash 21 +\definecharacter emdash 22 +%definecharacter compoundwordmark 23 +%definecharacter perthousand 24 +\definecharacter dotlessi 25 % or when missing: {j} +\definecharacter dotlessj 26 +% ff 27 +% fi 28 +% fl 29 +% ffi 30 +% ffl 31 +%definecharacter textvisiblespace 32 +% exclam ! 33 +\definecharacter quotedbl 34 +% numbersign # 35 +% dollar $ 36 +\definecharacter percent 37 +% ampersand & 38 +%definecharacter quotesingle 39 % fake 'm TODO:enco-def!!!! +\definecharacter quoteright 39 +% parenleft ( 40 +% parenright ) 41 +% asterisk * 42 +% plus + 43 +% comma , 44 +\definecharacter softhyphen 45 +% period . 46 +% slash / 47 +% 0-9 48-57 +% colon : 58 +% semicolon ; 59 +% less < 60 +% equal = 61 +% greater > 62 +% question ? 63 +% at @ 64 +% A-Z 65-90 +% bracketleft [ 91 +\definecharacter textbackslash 92 +% bracketright ] 93 +\definecharacter textasciicircum 94 +\definecharacter textunderscore 95 +\definecharacter quoteleft 96 +% a-z 97-122 +\definecharacter textbraceleft 123 +\definecharacter textbraceright 125 +\definecharacter textasciitilde 126 +%definecharacter softhyphen 127 % -> 45 (127 often undefined) +\definecharacter Abreve 128 % abreve 160 +\definecharacter Aogonek 129 % aogonek 161 +\definecharacter Cacute 130 % cacute 162 +\definecharacter Ccaron 131 % ccaron 163 +\definecharacter Dcaron 132 % dcaron 164 +\definecharacter Ecaron 133 % ecaron 165 +\definecharacter Eogonek 134 % eogonek 166 +\definecharacter Gbreve 135 % gbreve 167 +\definecharacter Lacute 136 % lacute 168 +\definecharacter Lcaron 137 % lcaron 169 +\definecharacter Lstroke 138 % lstroke 170 +\definecharacter Nacute 139 % nacute 171 +\definecharacter Ncaron 140 % ncaron 172 +\definecharacter Eng 141 % eng 173 +\definecharacter Neng 141 % Neng 173 +\definecharacter Ohungarumlaut 142 % ohungarumlaut 174 +\definecharacter Racute 143 % racute 175 +\definecharacter Rcaron 144 % rcaron 176 +\definecharacter Sacute 145 % sacute 177 +\definecharacter Scaron 146 % scaron 178 +\definecharacter Scedilla 147 % scedilla 179 +\definecharacter Tcaron 148 % tcaron 180 +\definecharacter Tcedilla 149 % tcedilla 181 +\definecharacter Uhungarumlaut 150 % uhungarumlaut 182 +\definecharacter Uring 151 % uring 183 +\definecharacter Ydiaeresis 152 % ydiaeresis 184 +\definecharacter Zacute 153 % zacute 185 +\definecharacter Zcaron 154 % zcaron 186 +\definecharacter Zdotaccent 155 % zdotaccent 187 +\definecharacter IJligature 156 % ijligature 188 +\definecharacter Idotaccent 157 +\definecharacter dstroke 158 % Dstroke 208 +\definecharacter sectionmark 159 +\definecharacter abreve 160 % Abreve 128 +\definecharacter aogonek 161 % Aogonek 129 +\definecharacter cacute 162 % Cacute 130 +\definecharacter ccaron 163 % Ccaron 131 +\definecharacter dcaron 164 % Dcaron 132 +\definecharacter ecaron 165 % Ecaron 133 +\definecharacter eogonek 166 % Eogonek 134 +\definecharacter gbreve 167 % Gbreve 135 +\definecharacter lacute 168 % Lacute 136 +\definecharacter lcaron 169 % Lcaron 137 +\definecharacter lstroke 170 % Lstroke 138 +\definecharacter nacute 171 % Nacute 139 +\definecharacter ncaron 172 % Ncaron 140 +\definecharacter eng 173 % Eng 141 +\definecharacter ohungarumlaut 174 % Ohungarumlaut 142 +\definecharacter racute 175 % Racute 143 +\definecharacter rcaron 176 % Rcaron 144 +\definecharacter sacute 177 % Sacute 145 +\definecharacter scaron 178 % Scaron 146 +\definecharacter scedilla 179 % Scedilla 147 +\definecharacter tcaron 180 % Tcaron 148 +\definecharacter tcedilla 181 % Tcedilla 149 +\definecharacter uhungarumlaut 182 % Uhungarumlaut 150 +\definecharacter uring 183 % Uring 151 +\definecharacter ydiaeresis 184 % Ydiaeresis 152 +\definecharacter zacute 185 % Zacute 153 +\definecharacter zcaron 186 % Zcaron 154 +\definecharacter zdotaccent 187 % Zdotaccent 155 +\definecharacter ijligature 188 % IJligature 156 +\definecharacter exclamdown 189 +\definecharacter questiondown 190 +\definecharacter textsterling 191 +\definecharacter Agrave 192 % agrave 224 +\definecharacter Aacute 193 % aacute 225 +\definecharacter Acircumflex 194 % acircumflex 226 +\definecharacter Atilde 195 % atilde 227 +\definecharacter Adiaeresis 196 % adiaeresis 228 +\definecharacter Aring 197 % aring 229 +\definecharacter AEligature 198 % aeligature 230 +\definecharacter Ccedilla 199 % ccedilla 231 +\definecharacter Egrave 200 % egrave 232 +\definecharacter Eacute 201 % eacute 233 +\definecharacter Ecircumflex 202 % ecircumflex 234 +\definecharacter Ediaeresis 203 % ediaeresis 235 +\definecharacter Igrave 204 % igrave 236 +\definecharacter Iacute 205 % iacute 237 +\definecharacter Icircumflex 206 % icircumflex 238 +\definecharacter Idiaeresis 207 % idiaeresis 239 +\definecharacter Eth 208 % eth 240 +\definecharacter Dstroke 208 % dstroke 158 +\definecharacter Ntilde 209 % ntilde 241 +\definecharacter Ograve 210 % ograve 242 +\definecharacter Oacute 211 % oacute 243 +\definecharacter Ocircumflex 212 % ocircumflex 244 +\definecharacter Otilde 213 % otilde 245 +\definecharacter Odiaeresis 214 % odiaeresis 246 +\definecharacter OEligature 215 % oeligature 247 +\definecharacter Ostroke 216 % ostroke 248 +\definecharacter Ugrave 217 % ugrave 249 +\definecharacter Uacute 218 % uacute 250 +\definecharacter Ucircumflex 219 % ucircumflex 251 +\definecharacter Udiaeresis 220 % udiaeresis 252 +\definecharacter Yacute 221 % yacute 253 +\definecharacter Thorn 222 % thorn 254 +\definecharacter Ssharp 223 % ssharp 255 +\definecharacter agrave 224 % Agrave 192 +\definecharacter aacute 225 % Aacute 193 +\definecharacter acircumflex 226 % Acircumflex 194 +\definecharacter atilde 227 % Atilde 195 +\definecharacter adiaeresis 228 % Adiaeresis 196 +\definecharacter aring 229 % Aring 197 +\definecharacter aeligature 230 % AEligature 198 +\definecharacter ccedilla 231 % Ccedilla 199 +\definecharacter egrave 232 % Egrave 200 +\definecharacter eacute 233 % Eacute 201 +\definecharacter ecircumflex 234 % Ecircumflex 202 +\definecharacter ediaeresis 235 % Ediaeresis 203 +\definecharacter igrave 236 % Igrave 204 +\definecharacter iacute 237 % Iacute 205 +\definecharacter icircumflex 238 % Icircumflex 206 +\definecharacter idiaeresis 239 % Idiaeresis 207 +\definecharacter eth 240 % Eth 208 +\definecharacter ntilde 241 % Ntilde 209 +\definecharacter ograve 242 % Ograve 210 +\definecharacter oacute 243 % Oacute 211 +\definecharacter ocircumflex 244 % Ocircumflex 212 +\definecharacter otilde 245 % Otilde 213 +\definecharacter odiaeresis 246 % Odiaeresis 214 +\definecharacter oeligature 247 % OEligature 215 +\definecharacter ostroke 248 % Ostroke 216 +\definecharacter ugrave 249 % Ugrave 217 +\definecharacter uacute 250 % Uacute 218 +\definecharacter ucircumflex 251 % Ucircumflex 219 +\definecharacter udiaeresis 252 % Udiaeresis 220 +\definecharacter yacute 253 % Yacute 221 +\definecharacter thorn 254 % Thorn 222 +\definecharacter ssharp 255 % Ssharp 223 + +\stopencoding + +\startencoding[ec] + +\definecharacter Scommaaccent {\Scedilla} +\definecharacter scommaaccent {\scedilla} +\definecharacter Tcommaaccent {\Tcedilla} +\definecharacter tcommaaccent {\tcedilla} + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-ec.tex b/tex/context/base/enco-ec.tex deleted file mode 100644 index 1ac41cadf..000000000 --- a/tex/context/base/enco-ec.tex +++ /dev/null @@ -1,295 +0,0 @@ -%D \module -%D [ file=enco-ec, -%D version=2000.05.07, % 1999.16.07, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=\LATEX\ EC Encoding, -%D author={Patrick Gundlach, Hans Hagen, Taco Hoekwater, Mojca Miklavec}, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This is \LATEX2e's T1 encoding vector. All standard \LATEX\ -%D accents will work, including \type{\k}. The only accent that -%D does not work is \type{\t} (there is no tie in T1 encoding). -%D -%D Annoyingly, most \POSTSCRIPT\ fonts do not have \type -%D {\dotlessj}, and T1 encoding does not make the various -%D prebuilts with \type {j} available. When this is the case: -%D -%D \starttyping -%D \startencoding[ec] -%D \definecharacter dotlessj {j} -%D \stopencoding -%D \stoptyping -%D -%D is a way out. - -%D There is hardly a point in supporting TS1 encoding. - -\startmapping[ec] - -% a problem is that the uppercase of dstroke (158) and eth (240) -% is the same glyph (208) so we cannot do lowercase mapping there - -\definecasemaps 128 to 156 lc +32 uc 0 -\definecasemap 157 `i 157 % Idotaccent i -\definecasemap 158 158 208 % dstroke Eth -\definecasemap 159 159 159 % sectionmark -\definecasemaps 160 to 187 lc 0 uc -32 -\resetcaserange 189 to 191 % exclamdown, questiondown, textsterling -\definecasemaps 192 to 223 lc +32 uc 0 -\definecasemaps 224 to 254 lc 0 uc -32 -\definecaseswap 255 223 % ssharp (else patterns fail) -\definecaseswap 25 `I % dotless i - -% 156 vs. 188 IJligature - -%D Some languages need this: - -% \definecaseself 34 % quotedbl -% \definecaseself 18 % quotedblbase -% \definecaseself 16 % quotedblleft -% \definecaseself 17 % quotedblright -% \definecaseself 39 % quotesingle -% \definecaseself 13 % quotesinglebase -% \definecaseself 96 % quoteleft -% \definecaseself 39 % quoteright - -%D So far for the mapping. - -%D The following characters are kind of dangerous, -%D that is, they are normally not part of fonts, unless -%D explicitly constructed. -%D -%D \startitemize[columns,two] -%D \item \type{\dotlessj} - but then it may not be defined!!!! -%D \item \type{\IJligature} -%D \item \type{\ijligature} -%D \item \type{\Ssharp} -%D \item \type{\perthousand} -%D \item \type{\compoundwordmark} -% \item \type{\textvisiblespace} -%D \stopitemize - -%D So, for the moment we nil them; we can always create -%D another vector if needed. - -\stopmapping - -\startencoding[ec][ec] % second arg defines auto regime, needed here ? - -\definecharacter textgrave 0 -\definecharacter textacute 1 -\definecharacter textcircumflex 2 -\definecharacter texttilde 3 -\definecharacter textdiaeresis 4 -\definecharacter texthungarumlaut 5 -\definecharacter textring 6 -\definecharacter textcaron 7 -\definecharacter textbreve 8 -\definecharacter textmacron 9 -\definecharacter textdotaccent 10 -\definecharacter textcedilla 11 -\definecharacter textogonek 12 -\definecharacter quotesinglebase 13 -\definecharacter guilsingleleft 14 -\definecharacter guilsingleright 15 -\definecharacter quotedblleft 16 -\definecharacter quotedblright 17 -\definecharacter quotedblbase 18 -\definecharacter leftguillemot 19 -\definecharacter rightguillemot 20 -\definecharacter endash 21 -\definecharacter emdash 22 -%definecharacter compoundwordmark 23 -%definecharacter perthousand 24 -\definecharacter dotlessi 25 % or when missing: {j} -\definecharacter dotlessj 26 -% ff 27 -% fi 28 -% fl 29 -% ffi 30 -% ffl 31 -%definecharacter textvisiblespace 32 -% exclam ! 33 -\definecharacter quotedbl 34 -% numbersign # 35 -% dollar $ 36 -\definecharacter percent 37 -% ampersand & 38 -%definecharacter quotesingle 39 % fake 'm TODO:enco-def!!!! -\definecharacter quoteright 39 -% parenleft ( 40 -% parenright ) 41 -% asterisk * 42 -% plus + 43 -% comma , 44 -\definecharacter softhyphen 45 -% period . 46 -% slash / 47 -% 0-9 48-57 -% colon : 58 -% semicolon ; 59 -% less < 60 -% equal = 61 -% greater > 62 -% question ? 63 -% at @ 64 -% A-Z 65-90 -% bracketleft [ 91 -\definecharacter textbackslash 92 -% bracketright ] 93 -\definecharacter textasciicircum 94 -\definecharacter textunderscore 95 -\definecharacter quoteleft 96 -% a-z 97-122 -\definecharacter textbraceleft 123 -\definecharacter textbraceright 125 -\definecharacter textasciitilde 126 -%definecharacter softhyphen 127 % -> 45 (127 often undefined) -\definecharacter Abreve 128 % abreve 160 -\definecharacter Aogonek 129 % aogonek 161 -\definecharacter Cacute 130 % cacute 162 -\definecharacter Ccaron 131 % ccaron 163 -\definecharacter Dcaron 132 % dcaron 164 -\definecharacter Ecaron 133 % ecaron 165 -\definecharacter Eogonek 134 % eogonek 166 -\definecharacter Gbreve 135 % gbreve 167 -\definecharacter Lacute 136 % lacute 168 -\definecharacter Lcaron 137 % lcaron 169 -\definecharacter Lstroke 138 % lstroke 170 -\definecharacter Nacute 139 % nacute 171 -\definecharacter Ncaron 140 % ncaron 172 -\definecharacter Eng 141 % eng 173 -\definecharacter Neng 141 % Neng 173 -\definecharacter Ohungarumlaut 142 % ohungarumlaut 174 -\definecharacter Racute 143 % racute 175 -\definecharacter Rcaron 144 % rcaron 176 -\definecharacter Sacute 145 % sacute 177 -\definecharacter Scaron 146 % scaron 178 -\definecharacter Scedilla 147 % scedilla 179 -\definecharacter Tcaron 148 % tcaron 180 -\definecharacter Tcedilla 149 % tcedilla 181 -\definecharacter Uhungarumlaut 150 % uhungarumlaut 182 -\definecharacter Uring 151 % uring 183 -\definecharacter Ydiaeresis 152 % ydiaeresis 184 -\definecharacter Zacute 153 % zacute 185 -\definecharacter Zcaron 154 % zcaron 186 -\definecharacter Zdotaccent 155 % zdotaccent 187 -\definecharacter IJligature 156 % ijligature 188 -\definecharacter Idotaccent 157 -\definecharacter dstroke 158 % Dstroke 208 -\definecharacter sectionmark 159 -\definecharacter abreve 160 % Abreve 128 -\definecharacter aogonek 161 % Aogonek 129 -\definecharacter cacute 162 % Cacute 130 -\definecharacter ccaron 163 % Ccaron 131 -\definecharacter dcaron 164 % Dcaron 132 -\definecharacter ecaron 165 % Ecaron 133 -\definecharacter eogonek 166 % Eogonek 134 -\definecharacter gbreve 167 % Gbreve 135 -\definecharacter lacute 168 % Lacute 136 -\definecharacter lcaron 169 % Lcaron 137 -\definecharacter lstroke 170 % Lstroke 138 -\definecharacter nacute 171 % Nacute 139 -\definecharacter ncaron 172 % Ncaron 140 -\definecharacter eng 173 % Eng 141 -\definecharacter ohungarumlaut 174 % Ohungarumlaut 142 -\definecharacter racute 175 % Racute 143 -\definecharacter rcaron 176 % Rcaron 144 -\definecharacter sacute 177 % Sacute 145 -\definecharacter scaron 178 % Scaron 146 -\definecharacter scedilla 179 % Scedilla 147 -\definecharacter tcaron 180 % Tcaron 148 -\definecharacter tcedilla 181 % Tcedilla 149 -\definecharacter uhungarumlaut 182 % Uhungarumlaut 150 -\definecharacter uring 183 % Uring 151 -\definecharacter ydiaeresis 184 % Ydiaeresis 152 -\definecharacter zacute 185 % Zacute 153 -\definecharacter zcaron 186 % Zcaron 154 -\definecharacter zdotaccent 187 % Zdotaccent 155 -\definecharacter ijligature 188 % IJligature 156 -\definecharacter exclamdown 189 -\definecharacter questiondown 190 -\definecharacter textsterling 191 -\definecharacter Agrave 192 % agrave 224 -\definecharacter Aacute 193 % aacute 225 -\definecharacter Acircumflex 194 % acircumflex 226 -\definecharacter Atilde 195 % atilde 227 -\definecharacter Adiaeresis 196 % adiaeresis 228 -\definecharacter Aring 197 % aring 229 -\definecharacter AEligature 198 % aeligature 230 -\definecharacter Ccedilla 199 % ccedilla 231 -\definecharacter Egrave 200 % egrave 232 -\definecharacter Eacute 201 % eacute 233 -\definecharacter Ecircumflex 202 % ecircumflex 234 -\definecharacter Ediaeresis 203 % ediaeresis 235 -\definecharacter Igrave 204 % igrave 236 -\definecharacter Iacute 205 % iacute 237 -\definecharacter Icircumflex 206 % icircumflex 238 -\definecharacter Idiaeresis 207 % idiaeresis 239 -\definecharacter Eth 208 % eth 240 -\definecharacter Dstroke 208 % dstroke 158 -\definecharacter Ntilde 209 % ntilde 241 -\definecharacter Ograve 210 % ograve 242 -\definecharacter Oacute 211 % oacute 243 -\definecharacter Ocircumflex 212 % ocircumflex 244 -\definecharacter Otilde 213 % otilde 245 -\definecharacter Odiaeresis 214 % odiaeresis 246 -\definecharacter OEligature 215 % oeligature 247 -\definecharacter Ostroke 216 % ostroke 248 -\definecharacter Ugrave 217 % ugrave 249 -\definecharacter Uacute 218 % uacute 250 -\definecharacter Ucircumflex 219 % ucircumflex 251 -\definecharacter Udiaeresis 220 % udiaeresis 252 -\definecharacter Yacute 221 % yacute 253 -\definecharacter Thorn 222 % thorn 254 -\definecharacter Ssharp 223 % ssharp 255 -\definecharacter agrave 224 % Agrave 192 -\definecharacter aacute 225 % Aacute 193 -\definecharacter acircumflex 226 % Acircumflex 194 -\definecharacter atilde 227 % Atilde 195 -\definecharacter adiaeresis 228 % Adiaeresis 196 -\definecharacter aring 229 % Aring 197 -\definecharacter aeligature 230 % AEligature 198 -\definecharacter ccedilla 231 % Ccedilla 199 -\definecharacter egrave 232 % Egrave 200 -\definecharacter eacute 233 % Eacute 201 -\definecharacter ecircumflex 234 % Ecircumflex 202 -\definecharacter ediaeresis 235 % Ediaeresis 203 -\definecharacter igrave 236 % Igrave 204 -\definecharacter iacute 237 % Iacute 205 -\definecharacter icircumflex 238 % Icircumflex 206 -\definecharacter idiaeresis 239 % Idiaeresis 207 -\definecharacter eth 240 % Eth 208 -\definecharacter ntilde 241 % Ntilde 209 -\definecharacter ograve 242 % Ograve 210 -\definecharacter oacute 243 % Oacute 211 -\definecharacter ocircumflex 244 % Ocircumflex 212 -\definecharacter otilde 245 % Otilde 213 -\definecharacter odiaeresis 246 % Odiaeresis 214 -\definecharacter oeligature 247 % OEligature 215 -\definecharacter ostroke 248 % Ostroke 216 -\definecharacter ugrave 249 % Ugrave 217 -\definecharacter uacute 250 % Uacute 218 -\definecharacter ucircumflex 251 % Ucircumflex 219 -\definecharacter udiaeresis 252 % Udiaeresis 220 -\definecharacter yacute 253 % Yacute 221 -\definecharacter thorn 254 % Thorn 222 -\definecharacter ssharp 255 % Ssharp 223 - -\stopencoding - -\startencoding[ec] - -\definecharacter Scommaaccent {\Scedilla} -\definecharacter scommaaccent {\scedilla} -\definecharacter Tcommaaccent {\Tcedilla} -\definecharacter tcommaaccent {\tcedilla} - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-ecm.mkii b/tex/context/base/enco-ecm.mkii new file mode 100644 index 000000000..b74473960 --- /dev/null +++ b/tex/context/base/enco-ecm.mkii @@ -0,0 +1,33 @@ +%D \module +%D [ file=enco-ec, +%D version=2000.05.07, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Glyphs that may not be present in EC, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D The next typescript removes a few problematic characters +%D from the ec encoding vector. So, in case of troubles, say +%D +%D \starttyping +%D \useencoding[ecm] % ec minus +%D \stoptyping + +\startencoding[ec][ec] + +\definecharacter ijligature {ij} +\definecharacter IJligature {IJ} +\definecharacter Ssharp {SS} +\definecharacter tcaron {\buildtextaccent\textcaron t} +\definecharacter Tcedilla {\buildtextcedilla T} +\definecharacter tcedilla {\buildtextcedilla t} +\definecharacter ydiaeresis {\buildtextaccent\textdiaeresis y} + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-ecm.tex b/tex/context/base/enco-ecm.tex deleted file mode 100644 index b74473960..000000000 --- a/tex/context/base/enco-ecm.tex +++ /dev/null @@ -1,33 +0,0 @@ -%D \module -%D [ file=enco-ec, -%D version=2000.05.07, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Glyphs that may not be present in EC, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D The next typescript removes a few problematic characters -%D from the ec encoding vector. So, in case of troubles, say -%D -%D \starttyping -%D \useencoding[ecm] % ec minus -%D \stoptyping - -\startencoding[ec][ec] - -\definecharacter ijligature {ij} -\definecharacter IJligature {IJ} -\definecharacter Ssharp {SS} -\definecharacter tcaron {\buildtextaccent\textcaron t} -\definecharacter Tcedilla {\buildtextcedilla T} -\definecharacter tcedilla {\buildtextcedilla t} -\definecharacter ydiaeresis {\buildtextaccent\textdiaeresis y} - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-el.mkii b/tex/context/base/enco-el.mkii new file mode 100644 index 000000000..24729967b --- /dev/null +++ b/tex/context/base/enco-el.mkii @@ -0,0 +1,272 @@ +%D \module +%D [ file=enco-el, +%D version=2005.08.24, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=EuroLetter, +%D author={Several Users}, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This EuroLetter encoding vector, also known as Dense Encoding is +%D the result of discussion among users, most noticably Adam Lindsay, +%D Mojka Miklavec, Patrick Gundlach, Taco Hoekwater and \unknown. +%D It was a follow up of a thread started long ago where we +%D discussed an encoding without the weird, never used symbols, but +%D with as many characters as possible in order to support the utf-8 +%D input regime. + +\startencoding[el] + +\definecasemaps 1 to 15 lc +16 uc 0 +\definecasemaps 17 to 31 lc 0 uc -16 + +\definecasemaps 128 to 159 lc +32 uc 0 +\definecasemaps 160 to 191 lc 0 uc -32 + +\definecasemaps 192 to 223 lc +32 uc 0 +\definecasemaps 224 to 255 lc 0 uc -32 + +\definecasemap 92 92 124 +\definecasemap 92 124 92 + +\definecharacter dotlessi 160 +\definecharacter endash 32 +\definecharacter emdash 16 + +\definecharacter aeligature 230 +\definecharacter AEligature 198 +\definecharacter oeligature 247 +\definecharacter OEligature 215 + +\definecharacter ssharp 38 + +\definecharacter thorn 254 +\definecharacter Thorn 222 + +\definecharacter eth 240 +\definecharacter Eth 208 + +\definecharacter exclamdown 42 +\definecharacter questiondown 43 + +\definecharacter quotedbl 35 +\definecharacter quotedblbase 36 +\definecharacter quotedblleft 34 +\definecharacter quotedblright 35 + +\definecharacter quotesingle 39 +\definecharacter quotesinglebase 0 + +\definecharacter quoteleft 96 +\definecharacter quoteright 39 + +\definecharacter guilsingleleft 60 +\definecharacter guilsingleright 62 + +\definecharacter leftguillemot 123 +\definecharacter rightguillemot 125 + +\definecharacter Acircumflex 194 +\definecharacter acircumflex 226 +%definecharacter Ccircumflex {\buildtextaccent\textcircumflex C} +%definecharacter ccircumflex {\buildtextaccent\textcircumflex c} +\definecharacter Ecircumflex 202 +\definecharacter ecircumflex 234 +%definecharacter Gcircumflex {\buildtextaccent\textcircumflex G} +%definecharacter gcircumflex {\buildtextaccent\textcircumflex g} +%definecharacter Hcircumflex {\buildtextaccent\textcircumflex H} +%definecharacter hcircumflex {\buildtextaccent\textcircumflex h} +\definecharacter Icircumflex 206 +\definecharacter icircumflex 238 +%definecharacter Jcircumflex {\buildtextaccent\textcircumflex \dotlessJ} +%definecharacter jcircumflex {\buildtextaccent\textcircumflex \dotlessj} +\definecharacter Ocircumflex 212 +\definecharacter ocircumflex 244 +%definecharacter Scircumflex {\buildtextaccent\textcircumflex S} +%definecharacter scircumflex {\buildtextaccent\textcircumflex s} +\definecharacter Ucircumflex 219 +\definecharacter ucircumflex 251 +\definecharacter Wcircumflex 154 +\definecharacter wcircumflex 186 +\definecharacter Ycircumflex 156 +\definecharacter ycircumflex 188 + +\definecharacter Agrave 192 +\definecharacter agrave 224 +\definecharacter Egrave 200 +\definecharacter egrave 232 +\definecharacter Igrave 204 +\definecharacter igrave 236 +\definecharacter Ograve 210 +\definecharacter ograve 242 +\definecharacter Ugrave 217 +\definecharacter ugrave 249 +\definecharacter Ygrave 155 +\definecharacter ygrave 187 + +\definecharacter Atilde 195 +\definecharacter atilde 227 +%definecharacter Itilde {\buildtextaccent\texttilde \dotlessI} +%definecharacter itilde {\buildtextaccent\texttilde \dotlessi} +\definecharacter Ntilde 209 +\definecharacter ntilde 241 +\definecharacter Otilde 213 +\definecharacter otilde 245 +%definecharacter Utilde {\buildtextaccent\texttilde U} +%definecharacter utilde {\buildtextaccent\texttilde u} +%definecharacter Ytilde {\buildtextaccent\texttilde Y} +%definecharacter ytilde {\buildtextaccent\texttilde y} + +\definecharacter Adiaeresis 196 +\definecharacter adiaeresis 228 +\definecharacter Ediaeresis 203 +\definecharacter ediaeresis 235 +\definecharacter Idiaeresis 207 +\definecharacter idiaeresis 239 +\definecharacter Odiaeresis 214 +\definecharacter odiaeresis 246 +\definecharacter Udiaeresis 220 +\definecharacter udiaeresis 252 +\definecharacter Ydiaeresis 223 +\definecharacter ydiaeresis 255 + +\definecharacter Aacute 193 +\definecharacter aacute 225 +\definecharacter Cacute 4 +\definecharacter cacute 20 +\definecharacter Eacute 201 +\definecharacter eacute 233 +\definecharacter Iacute 205 +\definecharacter iacute 237 +\definecharacter Lacute 132 +\definecharacter lacute 164 +\definecharacter Nacute 136 +\definecharacter nacute 168 +\definecharacter Oacute 211 +\definecharacter oacute 243 +\definecharacter Racute 141 +\definecharacter racute 173 +\definecharacter Sacute 144 +\definecharacter sacute 176 +\definecharacter Uacute 218 +\definecharacter uacute 250 +\definecharacter Yacute 221 +\definecharacter yacute 253 +\definecharacter Zacute 157 +\definecharacter zacute 189 + +\definecharacter Dstroke 8 +\definecharacter dstroke 24 +\definecharacter Hstroke 92 +\definecharacter hstroke 124 +%definecharacter Tstroke {T} +%definecharacter tstroke {t} + +\definecharacter Cdotaccent 6 +\definecharacter cdotaccent 22 +\definecharacter Edotaccent 10 +\definecharacter edotaccent 26 +\definecharacter Gdotaccent 15 +\definecharacter gdotaccent 31 +\definecharacter Idotaccent 128 +%definecharacter idotaccent {\buildtextaccent\textdotaccent \dotlessi} +\definecharacter Zdotaccent 159 +\definecharacter zdotaccent 191 + +\definecharacter Amacron 2 +\definecharacter amacron 18 +\definecharacter Emacron 11 +\definecharacter emacron 27 +\definecharacter Imacron 129 +\definecharacter imacron 161 +\definecharacter Omacron 140 +\definecharacter omacron 172 +\definecharacter Umacron 152 +\definecharacter umacron 184 + +\definecharacter Ccedilla 199 +\definecharacter ccedilla 231 +\definecharacter Scedilla 146 +\definecharacter scedilla 178 + +\definecharacter Gcommaaccent 14 +\definecharacter gcommaaccent 30 +\definecharacter Kcommaaccent 131 +\definecharacter kcommaaccent 163 +\definecharacter Lcommaaccent 135 +\definecharacter lcommaaccent 167 +\definecharacter Ncommaaccent 138 +\definecharacter ncommaaccent 170 +\definecharacter Rcommaaccent 143 +\definecharacter rcommaaccent 175 +%definecharacter Tcedilla 149 % there is no tcedilla in encoding +%definecharacter tcedilla 181 + +\definecharacter Scommaaccent 147 +\definecharacter scommaaccent 179 +\definecharacter Tcommaaccent 149 +\definecharacter tcommaaccent 181 + +\definecharacter Ohungarumlaut 139 +\definecharacter ohungarumlaut 171 +\definecharacter Uhungarumlaut 150 +\definecharacter uhungarumlaut 182 + +\definecharacter Aogonek 3 +\definecharacter aogonek 19 +\definecharacter Eogonek 12 +\definecharacter eogonek 28 +\definecharacter Iogonek 130 +\definecharacter iogonek 162 +\definecharacter Uogonek 153 +\definecharacter uogonek 185 + +\definecharacter Aring 197 +\definecharacter aring 229 +\definecharacter Uring 151 +\definecharacter uring 183 + +\definecharacter Abreve 1 +\definecharacter abreve 17 +%definecharacter Ebreve {\buildtextaccent\textbreve E} +%definecharacter ebreve {\buildtextaccent\textbreve e} +\definecharacter Gbreve 13 +\definecharacter gbreve 29 +%definecharacter Ibreve {\buildtextaccent\textbreve \dotlessI} +%definecharacter ibreve {\buildtextaccent\textbreve \dotlessi} +%definecharacter Obreve {\buildtextaccent\textbreve O} +%definecharacter obreve {\buildtextaccent\textbreve o} +%definecharacter Ubreve {\buildtextaccent\textbreve U} +%definecharacter ubreve {\buildtextaccent\textbreve u} + +\definecharacter Ccaron 5 +\definecharacter ccaron 21 +\definecharacter Dcaron 7 +\definecharacter dcaron 23 +\definecharacter Ecaron 9 +\definecharacter ecaron 25 +\definecharacter Lcaron 133 +\definecharacter lcaron 165 +\definecharacter Ncaron 137 +\definecharacter ncaron 169 +\definecharacter Rcaron 142 +\definecharacter rcaron 174 +\definecharacter Scaron 145 +\definecharacter scaron 177 +\definecharacter Tcaron 148 +\definecharacter tcaron 180 +%definecharacter Ycaron {\buildtextaccent\textcaron Y} +%definecharacter ycaron {\buildtextaccent\textcaron y} +\definecharacter Zcaron 158 +\definecharacter zcaron 190 + +\definecharacter Lstroke 134 +\definecharacter lstroke 166 +\definecharacter Ostroke 216 +\definecharacter ostroke 248 + +\stopencoding diff --git a/tex/context/base/enco-el.tex b/tex/context/base/enco-el.tex deleted file mode 100644 index 24729967b..000000000 --- a/tex/context/base/enco-el.tex +++ /dev/null @@ -1,272 +0,0 @@ -%D \module -%D [ file=enco-el, -%D version=2005.08.24, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=EuroLetter, -%D author={Several Users}, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This EuroLetter encoding vector, also known as Dense Encoding is -%D the result of discussion among users, most noticably Adam Lindsay, -%D Mojka Miklavec, Patrick Gundlach, Taco Hoekwater and \unknown. -%D It was a follow up of a thread started long ago where we -%D discussed an encoding without the weird, never used symbols, but -%D with as many characters as possible in order to support the utf-8 -%D input regime. - -\startencoding[el] - -\definecasemaps 1 to 15 lc +16 uc 0 -\definecasemaps 17 to 31 lc 0 uc -16 - -\definecasemaps 128 to 159 lc +32 uc 0 -\definecasemaps 160 to 191 lc 0 uc -32 - -\definecasemaps 192 to 223 lc +32 uc 0 -\definecasemaps 224 to 255 lc 0 uc -32 - -\definecasemap 92 92 124 -\definecasemap 92 124 92 - -\definecharacter dotlessi 160 -\definecharacter endash 32 -\definecharacter emdash 16 - -\definecharacter aeligature 230 -\definecharacter AEligature 198 -\definecharacter oeligature 247 -\definecharacter OEligature 215 - -\definecharacter ssharp 38 - -\definecharacter thorn 254 -\definecharacter Thorn 222 - -\definecharacter eth 240 -\definecharacter Eth 208 - -\definecharacter exclamdown 42 -\definecharacter questiondown 43 - -\definecharacter quotedbl 35 -\definecharacter quotedblbase 36 -\definecharacter quotedblleft 34 -\definecharacter quotedblright 35 - -\definecharacter quotesingle 39 -\definecharacter quotesinglebase 0 - -\definecharacter quoteleft 96 -\definecharacter quoteright 39 - -\definecharacter guilsingleleft 60 -\definecharacter guilsingleright 62 - -\definecharacter leftguillemot 123 -\definecharacter rightguillemot 125 - -\definecharacter Acircumflex 194 -\definecharacter acircumflex 226 -%definecharacter Ccircumflex {\buildtextaccent\textcircumflex C} -%definecharacter ccircumflex {\buildtextaccent\textcircumflex c} -\definecharacter Ecircumflex 202 -\definecharacter ecircumflex 234 -%definecharacter Gcircumflex {\buildtextaccent\textcircumflex G} -%definecharacter gcircumflex {\buildtextaccent\textcircumflex g} -%definecharacter Hcircumflex {\buildtextaccent\textcircumflex H} -%definecharacter hcircumflex {\buildtextaccent\textcircumflex h} -\definecharacter Icircumflex 206 -\definecharacter icircumflex 238 -%definecharacter Jcircumflex {\buildtextaccent\textcircumflex \dotlessJ} -%definecharacter jcircumflex {\buildtextaccent\textcircumflex \dotlessj} -\definecharacter Ocircumflex 212 -\definecharacter ocircumflex 244 -%definecharacter Scircumflex {\buildtextaccent\textcircumflex S} -%definecharacter scircumflex {\buildtextaccent\textcircumflex s} -\definecharacter Ucircumflex 219 -\definecharacter ucircumflex 251 -\definecharacter Wcircumflex 154 -\definecharacter wcircumflex 186 -\definecharacter Ycircumflex 156 -\definecharacter ycircumflex 188 - -\definecharacter Agrave 192 -\definecharacter agrave 224 -\definecharacter Egrave 200 -\definecharacter egrave 232 -\definecharacter Igrave 204 -\definecharacter igrave 236 -\definecharacter Ograve 210 -\definecharacter ograve 242 -\definecharacter Ugrave 217 -\definecharacter ugrave 249 -\definecharacter Ygrave 155 -\definecharacter ygrave 187 - -\definecharacter Atilde 195 -\definecharacter atilde 227 -%definecharacter Itilde {\buildtextaccent\texttilde \dotlessI} -%definecharacter itilde {\buildtextaccent\texttilde \dotlessi} -\definecharacter Ntilde 209 -\definecharacter ntilde 241 -\definecharacter Otilde 213 -\definecharacter otilde 245 -%definecharacter Utilde {\buildtextaccent\texttilde U} -%definecharacter utilde {\buildtextaccent\texttilde u} -%definecharacter Ytilde {\buildtextaccent\texttilde Y} -%definecharacter ytilde {\buildtextaccent\texttilde y} - -\definecharacter Adiaeresis 196 -\definecharacter adiaeresis 228 -\definecharacter Ediaeresis 203 -\definecharacter ediaeresis 235 -\definecharacter Idiaeresis 207 -\definecharacter idiaeresis 239 -\definecharacter Odiaeresis 214 -\definecharacter odiaeresis 246 -\definecharacter Udiaeresis 220 -\definecharacter udiaeresis 252 -\definecharacter Ydiaeresis 223 -\definecharacter ydiaeresis 255 - -\definecharacter Aacute 193 -\definecharacter aacute 225 -\definecharacter Cacute 4 -\definecharacter cacute 20 -\definecharacter Eacute 201 -\definecharacter eacute 233 -\definecharacter Iacute 205 -\definecharacter iacute 237 -\definecharacter Lacute 132 -\definecharacter lacute 164 -\definecharacter Nacute 136 -\definecharacter nacute 168 -\definecharacter Oacute 211 -\definecharacter oacute 243 -\definecharacter Racute 141 -\definecharacter racute 173 -\definecharacter Sacute 144 -\definecharacter sacute 176 -\definecharacter Uacute 218 -\definecharacter uacute 250 -\definecharacter Yacute 221 -\definecharacter yacute 253 -\definecharacter Zacute 157 -\definecharacter zacute 189 - -\definecharacter Dstroke 8 -\definecharacter dstroke 24 -\definecharacter Hstroke 92 -\definecharacter hstroke 124 -%definecharacter Tstroke {T} -%definecharacter tstroke {t} - -\definecharacter Cdotaccent 6 -\definecharacter cdotaccent 22 -\definecharacter Edotaccent 10 -\definecharacter edotaccent 26 -\definecharacter Gdotaccent 15 -\definecharacter gdotaccent 31 -\definecharacter Idotaccent 128 -%definecharacter idotaccent {\buildtextaccent\textdotaccent \dotlessi} -\definecharacter Zdotaccent 159 -\definecharacter zdotaccent 191 - -\definecharacter Amacron 2 -\definecharacter amacron 18 -\definecharacter Emacron 11 -\definecharacter emacron 27 -\definecharacter Imacron 129 -\definecharacter imacron 161 -\definecharacter Omacron 140 -\definecharacter omacron 172 -\definecharacter Umacron 152 -\definecharacter umacron 184 - -\definecharacter Ccedilla 199 -\definecharacter ccedilla 231 -\definecharacter Scedilla 146 -\definecharacter scedilla 178 - -\definecharacter Gcommaaccent 14 -\definecharacter gcommaaccent 30 -\definecharacter Kcommaaccent 131 -\definecharacter kcommaaccent 163 -\definecharacter Lcommaaccent 135 -\definecharacter lcommaaccent 167 -\definecharacter Ncommaaccent 138 -\definecharacter ncommaaccent 170 -\definecharacter Rcommaaccent 143 -\definecharacter rcommaaccent 175 -%definecharacter Tcedilla 149 % there is no tcedilla in encoding -%definecharacter tcedilla 181 - -\definecharacter Scommaaccent 147 -\definecharacter scommaaccent 179 -\definecharacter Tcommaaccent 149 -\definecharacter tcommaaccent 181 - -\definecharacter Ohungarumlaut 139 -\definecharacter ohungarumlaut 171 -\definecharacter Uhungarumlaut 150 -\definecharacter uhungarumlaut 182 - -\definecharacter Aogonek 3 -\definecharacter aogonek 19 -\definecharacter Eogonek 12 -\definecharacter eogonek 28 -\definecharacter Iogonek 130 -\definecharacter iogonek 162 -\definecharacter Uogonek 153 -\definecharacter uogonek 185 - -\definecharacter Aring 197 -\definecharacter aring 229 -\definecharacter Uring 151 -\definecharacter uring 183 - -\definecharacter Abreve 1 -\definecharacter abreve 17 -%definecharacter Ebreve {\buildtextaccent\textbreve E} -%definecharacter ebreve {\buildtextaccent\textbreve e} -\definecharacter Gbreve 13 -\definecharacter gbreve 29 -%definecharacter Ibreve {\buildtextaccent\textbreve \dotlessI} -%definecharacter ibreve {\buildtextaccent\textbreve \dotlessi} -%definecharacter Obreve {\buildtextaccent\textbreve O} -%definecharacter obreve {\buildtextaccent\textbreve o} -%definecharacter Ubreve {\buildtextaccent\textbreve U} -%definecharacter ubreve {\buildtextaccent\textbreve u} - -\definecharacter Ccaron 5 -\definecharacter ccaron 21 -\definecharacter Dcaron 7 -\definecharacter dcaron 23 -\definecharacter Ecaron 9 -\definecharacter ecaron 25 -\definecharacter Lcaron 133 -\definecharacter lcaron 165 -\definecharacter Ncaron 137 -\definecharacter ncaron 169 -\definecharacter Rcaron 142 -\definecharacter rcaron 174 -\definecharacter Scaron 145 -\definecharacter scaron 177 -\definecharacter Tcaron 148 -\definecharacter tcaron 180 -%definecharacter Ycaron {\buildtextaccent\textcaron Y} -%definecharacter ycaron {\buildtextaccent\textcaron y} -\definecharacter Zcaron 158 -\definecharacter zcaron 190 - -\definecharacter Lstroke 134 -\definecharacter lstroke 166 -\definecharacter Ostroke 216 -\definecharacter ostroke 248 - -\stopencoding diff --git a/tex/context/base/enco-fde.mkii b/tex/context/base/enco-fde.mkii new file mode 100644 index 000000000..a7c11abfc --- /dev/null +++ b/tex/context/base/enco-fde.mkii @@ -0,0 +1,128 @@ +%D \module +%D [ file=enco-fde, +%D version=2000.08.20, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=German Input Filter, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\doifmode{mkiv}{\endinput} + +\unprotect + +\installactivecharacter " + +\startlanguagespecifics[\s!de] + + \installcompoundcharacter "a {\aumlaut\midworddiscretionary} + \installcompoundcharacter "e {\eumlaut\midworddiscretionary} + \installcompoundcharacter "i {\iumlaut\midworddiscretionary} + \installcompoundcharacter "o {\oumlaut\midworddiscretionary} + \installcompoundcharacter "u {\uumlaut\midworddiscretionary} + \installcompoundcharacter "s {\ssharp} + \installcompoundcharacter "z {\ssharp} + + \installcompoundcharacter "A {\Aumlaut} + \installcompoundcharacter "E {\Eumlaut} + \installcompoundcharacter "I {\Iumlaut} + \installcompoundcharacter "O {\Oumlaut} + \installcompoundcharacter "U {\Uumlaut} + \installcompoundcharacter "Z {SZ} + \installcompoundcharacter "S {SS} + +\stoplanguagespecifics + +\startlanguagespecifics[\s!de] + + \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}} + \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} + \installcompoundcharacter "ll {\discretionary{ll-}{l}{ll}} + \installcompoundcharacter "mm {\discretionary{mm-}{m}{mm}} + \installcompoundcharacter "nn {\discretionary{nn-}{n}{nn}} + \installcompoundcharacter "pp {\discretionary{pp-}{p}{pp}} + \installcompoundcharacter "rr {\discretionary{rr-}{r}{rr}} + \installcompoundcharacter "tt {\discretionary{tt-}{t}{tt}} + + \installcompoundcharacter "CK {\discretionary {K-}{K}{CK}} + \installcompoundcharacter "FF {\discretionary{FF-}{F}{FF}} + \installcompoundcharacter "LL {\discretionary{LL-}{L}{LL}} + \installcompoundcharacter "MM {\discretionary{MM-}{M}{MM}} + \installcompoundcharacter "NN {\discretionary{NN-}{N}{NN}} + \installcompoundcharacter "PP {\discretionary{PP-}{P}{PP}} + \installcompoundcharacter "RR {\discretionary{RR-}{R}{RR}} + \installcompoundcharacter "TT {\discretionary{TT-}{T}{TT}} + +\stoplanguagespecifics + +\startlanguagespecifics[\s!de] + + \installcompoundcharacter "` {\startdelimitedtext[\v!quotation]} + \installcompoundcharacter "' {\stopdelimitedtext} + \installcompoundcharacter ". {\kern.1em\ignorespaces} + + %installcompoundcharacter "` {\languageparameter\c!leftquotation } + %installcompoundcharacter "' {\languageparameter\c!rightquotation} + + \def\setupDElanguage + {\setuplanguage + [\s!de] + [\c!leftsentence=\leftguillemot, + \c!rightsentence=\rightguillemot, + \c!leftsubsentence=\leftsubguillemot, + \c!rightsubsentence=\rightsubguillemot]} + + \installcompoundcharacter "< {{\setupDElanguage|<|}} + \installcompoundcharacter "> {{\setupDElanguage|>|}} + \installcompoundcharacter "| {|*|} + +\stoplanguagespecifics + +% \hyphenatedword{hinauff|*|liegen} +% \hyphenatedword{hinauff"|liegen} + +%D An experimental hack: + +% no {\simplifiedcompoundcharacter"} + +% \startencoding[pdfdoc] +% \startlanguagespecifics[\s!de]% hm, a % is needed +% \defineactivecharacter " {\"} +% \stoplanguagespecifics +% \stopencoding + +\startencoding[ec] + \startlanguagespecifics[\s!de]% + \installcompoundcharacter "a {\adiaeresis} + \installcompoundcharacter "e {\ediaeresis} + \installcompoundcharacter "i {\idiaeresis} + \installcompoundcharacter "o {\odiaeresis} + \installcompoundcharacter "u {\udiaeresis} + \installcompoundcharacter "A {\Adiaeresis} + \installcompoundcharacter "E {\Ediaeresis} + \installcompoundcharacter "I {\Idiaeresis} + \installcompoundcharacter "O {\Odiaeresis} + \installcompoundcharacter "U {\Udiaeresis} + \stoplanguagespecifics +\stopencoding + +\startencoding[texnansi] + \startlanguagespecifics[\s!de]% + \installcompoundcharacter "a {\adiaeresis} + \installcompoundcharacter "e {\ediaeresis} + \installcompoundcharacter "i {\idiaeresis} + \installcompoundcharacter "o {\odiaeresis} + \installcompoundcharacter "u {\udiaeresis} + \installcompoundcharacter "A {\Adiaeresis} + \installcompoundcharacter "E {\Ediaeresis} + \installcompoundcharacter "I {\Idiaeresis} + \installcompoundcharacter "O {\Odiaeresis} + \installcompoundcharacter "U {\Udiaeresis} + \stoplanguagespecifics +\stopencoding + +\protect \endinput diff --git a/tex/context/base/enco-fde.tex b/tex/context/base/enco-fde.tex deleted file mode 100644 index a7c11abfc..000000000 --- a/tex/context/base/enco-fde.tex +++ /dev/null @@ -1,128 +0,0 @@ -%D \module -%D [ file=enco-fde, -%D version=2000.08.20, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=German Input Filter, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\doifmode{mkiv}{\endinput} - -\unprotect - -\installactivecharacter " - -\startlanguagespecifics[\s!de] - - \installcompoundcharacter "a {\aumlaut\midworddiscretionary} - \installcompoundcharacter "e {\eumlaut\midworddiscretionary} - \installcompoundcharacter "i {\iumlaut\midworddiscretionary} - \installcompoundcharacter "o {\oumlaut\midworddiscretionary} - \installcompoundcharacter "u {\uumlaut\midworddiscretionary} - \installcompoundcharacter "s {\ssharp} - \installcompoundcharacter "z {\ssharp} - - \installcompoundcharacter "A {\Aumlaut} - \installcompoundcharacter "E {\Eumlaut} - \installcompoundcharacter "I {\Iumlaut} - \installcompoundcharacter "O {\Oumlaut} - \installcompoundcharacter "U {\Uumlaut} - \installcompoundcharacter "Z {SZ} - \installcompoundcharacter "S {SS} - -\stoplanguagespecifics - -\startlanguagespecifics[\s!de] - - \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}} - \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} - \installcompoundcharacter "ll {\discretionary{ll-}{l}{ll}} - \installcompoundcharacter "mm {\discretionary{mm-}{m}{mm}} - \installcompoundcharacter "nn {\discretionary{nn-}{n}{nn}} - \installcompoundcharacter "pp {\discretionary{pp-}{p}{pp}} - \installcompoundcharacter "rr {\discretionary{rr-}{r}{rr}} - \installcompoundcharacter "tt {\discretionary{tt-}{t}{tt}} - - \installcompoundcharacter "CK {\discretionary {K-}{K}{CK}} - \installcompoundcharacter "FF {\discretionary{FF-}{F}{FF}} - \installcompoundcharacter "LL {\discretionary{LL-}{L}{LL}} - \installcompoundcharacter "MM {\discretionary{MM-}{M}{MM}} - \installcompoundcharacter "NN {\discretionary{NN-}{N}{NN}} - \installcompoundcharacter "PP {\discretionary{PP-}{P}{PP}} - \installcompoundcharacter "RR {\discretionary{RR-}{R}{RR}} - \installcompoundcharacter "TT {\discretionary{TT-}{T}{TT}} - -\stoplanguagespecifics - -\startlanguagespecifics[\s!de] - - \installcompoundcharacter "` {\startdelimitedtext[\v!quotation]} - \installcompoundcharacter "' {\stopdelimitedtext} - \installcompoundcharacter ". {\kern.1em\ignorespaces} - - %installcompoundcharacter "` {\languageparameter\c!leftquotation } - %installcompoundcharacter "' {\languageparameter\c!rightquotation} - - \def\setupDElanguage - {\setuplanguage - [\s!de] - [\c!leftsentence=\leftguillemot, - \c!rightsentence=\rightguillemot, - \c!leftsubsentence=\leftsubguillemot, - \c!rightsubsentence=\rightsubguillemot]} - - \installcompoundcharacter "< {{\setupDElanguage|<|}} - \installcompoundcharacter "> {{\setupDElanguage|>|}} - \installcompoundcharacter "| {|*|} - -\stoplanguagespecifics - -% \hyphenatedword{hinauff|*|liegen} -% \hyphenatedword{hinauff"|liegen} - -%D An experimental hack: - -% no {\simplifiedcompoundcharacter"} - -% \startencoding[pdfdoc] -% \startlanguagespecifics[\s!de]% hm, a % is needed -% \defineactivecharacter " {\"} -% \stoplanguagespecifics -% \stopencoding - -\startencoding[ec] - \startlanguagespecifics[\s!de]% - \installcompoundcharacter "a {\adiaeresis} - \installcompoundcharacter "e {\ediaeresis} - \installcompoundcharacter "i {\idiaeresis} - \installcompoundcharacter "o {\odiaeresis} - \installcompoundcharacter "u {\udiaeresis} - \installcompoundcharacter "A {\Adiaeresis} - \installcompoundcharacter "E {\Ediaeresis} - \installcompoundcharacter "I {\Idiaeresis} - \installcompoundcharacter "O {\Odiaeresis} - \installcompoundcharacter "U {\Udiaeresis} - \stoplanguagespecifics -\stopencoding - -\startencoding[texnansi] - \startlanguagespecifics[\s!de]% - \installcompoundcharacter "a {\adiaeresis} - \installcompoundcharacter "e {\ediaeresis} - \installcompoundcharacter "i {\idiaeresis} - \installcompoundcharacter "o {\odiaeresis} - \installcompoundcharacter "u {\udiaeresis} - \installcompoundcharacter "A {\Adiaeresis} - \installcompoundcharacter "E {\Ediaeresis} - \installcompoundcharacter "I {\Idiaeresis} - \installcompoundcharacter "O {\Odiaeresis} - \installcompoundcharacter "U {\Udiaeresis} - \stoplanguagespecifics -\stopencoding - -\protect \endinput diff --git a/tex/context/base/enco-ffr.mkii b/tex/context/base/enco-ffr.mkii new file mode 100644 index 000000000..c321153e8 --- /dev/null +++ b/tex/context/base/enco-ffr.mkii @@ -0,0 +1,53 @@ +%D \module +%D [ file=enco-ffr, +%D version=2002.05.07, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=French Input Filter, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\doifmode{mkiv}{\endinput} + +% \definehspace[fr][:][.25em] +% \definehspace[fr][;][.25em] +% \definehspace[fr][!][.25em] +% \definehspace[fr][?][.25em] + +\enablemode[activecolon] \usemodule[tryout] % for the moment + +\installactivecharacter : +\installactivecharacter ; +\installactivecharacter ? +\installactivecharacter ! + +\unprotect + +\startlanguagespecifics[\s!fr] + \definetextmodediscretionary : {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{:}:} + \definetextmodediscretionary ; {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{;};} + \definetextmodediscretionary ? {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{?}?} + \definetextmodediscretionary ! {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{!}!} +\stoplanguagespecifics + +\startlanguagespecifics[\s!fr] + \defineactivecharacter : {\mathortext{:}{\directdiscretionary{:}}} + \defineactivecharacter ; {\mathortext{;}{\directdiscretionary{;}}} + \defineactivecharacter ! {\mathortext{!}{\directdiscretionary{!}}} + \defineactivecharacter ? {\mathortext{?}{\directdiscretionary{?}}} +\stoplanguagespecifics + +% maybe tricky due to possible name clashes: +% +% \def\ieme {\highordinalstr{e}} +% \def\iemes{\highordinalstr{es}} +% \def\ier {\highordinalstr{er}} +% \def\iers {\highordinalstr{ers}} +% \def\iere {\highordinalstr{re}} +% \def\ieres{\highordinalstr{res}} + +\protect \endinput diff --git a/tex/context/base/enco-ffr.tex b/tex/context/base/enco-ffr.tex deleted file mode 100644 index c321153e8..000000000 --- a/tex/context/base/enco-ffr.tex +++ /dev/null @@ -1,53 +0,0 @@ -%D \module -%D [ file=enco-ffr, -%D version=2002.05.07, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=French Input Filter, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\doifmode{mkiv}{\endinput} - -% \definehspace[fr][:][.25em] -% \definehspace[fr][;][.25em] -% \definehspace[fr][!][.25em] -% \definehspace[fr][?][.25em] - -\enablemode[activecolon] \usemodule[tryout] % for the moment - -\installactivecharacter : -\installactivecharacter ; -\installactivecharacter ? -\installactivecharacter ! - -\unprotect - -\startlanguagespecifics[\s!fr] - \definetextmodediscretionary : {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{:}:} - \definetextmodediscretionary ; {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{;};} - \definetextmodediscretionary ? {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{?}?} - \definetextmodediscretionary ! {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{!}!} -\stoplanguagespecifics - -\startlanguagespecifics[\s!fr] - \defineactivecharacter : {\mathortext{:}{\directdiscretionary{:}}} - \defineactivecharacter ; {\mathortext{;}{\directdiscretionary{;}}} - \defineactivecharacter ! {\mathortext{!}{\directdiscretionary{!}}} - \defineactivecharacter ? {\mathortext{?}{\directdiscretionary{?}}} -\stoplanguagespecifics - -% maybe tricky due to possible name clashes: -% -% \def\ieme {\highordinalstr{e}} -% \def\iemes{\highordinalstr{es}} -% \def\ier {\highordinalstr{er}} -% \def\iers {\highordinalstr{ers}} -% \def\iere {\highordinalstr{re}} -% \def\ieres{\highordinalstr{res}} - -\protect \endinput diff --git a/tex/context/base/enco-fpl.mkii b/tex/context/base/enco-fpl.mkii new file mode 100644 index 000000000..14d102ff1 --- /dev/null +++ b/tex/context/base/enco-fpl.mkii @@ -0,0 +1,98 @@ +%D \module +%D [ file=enco-fpl, +%D version=2000.08.20, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Polish Input Filter, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D These definitions used to be part of lang-sla.tex. + +\unprotect + +% todo : named glyphs + +\installactivecharacter / + +\startlanguagespecifics[\s!pl] + +% \appendtoks \makecharacteractive / \to \everynormalcatcodes % obsolete + + \installcompoundcharacter /a {\aogonek} + \installcompoundcharacter /c {\cacute} + \installcompoundcharacter /e {\eogonek} + \installcompoundcharacter /l {\lstroke} + \installcompoundcharacter /n {\nacute} + \installcompoundcharacter /o {\oacute} + \installcompoundcharacter /s {\sacute} + \installcompoundcharacter /x {\zacute} + \installcompoundcharacter /z {\zdotaccent} + \installcompoundcharacter /A {\Aogonek} + \installcompoundcharacter /C {\Cacute} + \installcompoundcharacter /E {\Eogonek} + \installcompoundcharacter /L {\Lstroke} + \installcompoundcharacter /N {\Nacute} + \installcompoundcharacter /O {\Oacute} + \installcompoundcharacter /S {\Sacute} + \installcompoundcharacter /X {\Zacute} + \installcompoundcharacter /Z {\Zdotaccent} + +\stoplanguagespecifics + +\startlanguagespecifics[\s!pl] + + \installcompoundcharacter /, {\handlequotation\c!leftquotation} + \installcompoundcharacter /' {\handlequotation\c!rightquotation} + + \def\setupPLlanguage% + {\setuplanguage + [\s!pl] + [\c!leftsentence=\leftguillemot, + \c!rightsentence=\rightguillemot, + \c!leftsubsentence=\leftsubguillemot, + \c!rightsubsentence=\rightsubguillemot]} + + \installcompoundcharacter /< {{\setupPLlanguage|<|}} + \installcompoundcharacter /> {{\setupPLlanguage|>|}} + + \installcompoundcharacter /- {|-|} + +\stoplanguagespecifics + +% obsolete +% +% \startlanguagespecifics[\s!pl] +% +% \definesortkey {/a}{a}{a}{\k a} +% \definesortkey {/A}{a}{a}{\k a} +% \definesortkey {/c}{c}{a}{\'c} +% \definesortkey {/C}{c}{a}{\'c} +% \definesortkey {/e}{e}{a}{\k e} +% \definesortkey {/E}{e}{a}{\k e} +% \definesortkey {/l}{l}{a}{\l } +% \definesortkey {/L}{l}{a}{\l } +% \definesortkey {/n}{n}{a}{\'n} +% \definesortkey {/N}{n}{a}{\'n} +% \definesortkey {/o}{o}{a}{\'o} +% \definesortkey {/O}{o}{a}{\'o} +% \definesortkey {/s}{s}{a}{\'s} +% \definesortkey {/S}{s}{a}{\'s} +% \definesortkey {/x}{z}{a}{\'x} +% \definesortkey {/X}{z}{a}{\'x} +% \definesortkey {/z}{z}{b}{\.z} +% \definesortkey {/Z}{z}{b}{\.z} +% +% \stoplanguagespecifics + +\startencoding[pdfdoc] + \startlanguagespecifics[pl]% hm + \defineactivecharacter / {\simplifiedcompoundcharacter/} + \stoplanguagespecifics +\stopencoding + +\protect \endinput diff --git a/tex/context/base/enco-fpl.tex b/tex/context/base/enco-fpl.tex deleted file mode 100644 index 14d102ff1..000000000 --- a/tex/context/base/enco-fpl.tex +++ /dev/null @@ -1,98 +0,0 @@ -%D \module -%D [ file=enco-fpl, -%D version=2000.08.20, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Polish Input Filter, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D These definitions used to be part of lang-sla.tex. - -\unprotect - -% todo : named glyphs - -\installactivecharacter / - -\startlanguagespecifics[\s!pl] - -% \appendtoks \makecharacteractive / \to \everynormalcatcodes % obsolete - - \installcompoundcharacter /a {\aogonek} - \installcompoundcharacter /c {\cacute} - \installcompoundcharacter /e {\eogonek} - \installcompoundcharacter /l {\lstroke} - \installcompoundcharacter /n {\nacute} - \installcompoundcharacter /o {\oacute} - \installcompoundcharacter /s {\sacute} - \installcompoundcharacter /x {\zacute} - \installcompoundcharacter /z {\zdotaccent} - \installcompoundcharacter /A {\Aogonek} - \installcompoundcharacter /C {\Cacute} - \installcompoundcharacter /E {\Eogonek} - \installcompoundcharacter /L {\Lstroke} - \installcompoundcharacter /N {\Nacute} - \installcompoundcharacter /O {\Oacute} - \installcompoundcharacter /S {\Sacute} - \installcompoundcharacter /X {\Zacute} - \installcompoundcharacter /Z {\Zdotaccent} - -\stoplanguagespecifics - -\startlanguagespecifics[\s!pl] - - \installcompoundcharacter /, {\handlequotation\c!leftquotation} - \installcompoundcharacter /' {\handlequotation\c!rightquotation} - - \def\setupPLlanguage% - {\setuplanguage - [\s!pl] - [\c!leftsentence=\leftguillemot, - \c!rightsentence=\rightguillemot, - \c!leftsubsentence=\leftsubguillemot, - \c!rightsubsentence=\rightsubguillemot]} - - \installcompoundcharacter /< {{\setupPLlanguage|<|}} - \installcompoundcharacter /> {{\setupPLlanguage|>|}} - - \installcompoundcharacter /- {|-|} - -\stoplanguagespecifics - -% obsolete -% -% \startlanguagespecifics[\s!pl] -% -% \definesortkey {/a}{a}{a}{\k a} -% \definesortkey {/A}{a}{a}{\k a} -% \definesortkey {/c}{c}{a}{\'c} -% \definesortkey {/C}{c}{a}{\'c} -% \definesortkey {/e}{e}{a}{\k e} -% \definesortkey {/E}{e}{a}{\k e} -% \definesortkey {/l}{l}{a}{\l } -% \definesortkey {/L}{l}{a}{\l } -% \definesortkey {/n}{n}{a}{\'n} -% \definesortkey {/N}{n}{a}{\'n} -% \definesortkey {/o}{o}{a}{\'o} -% \definesortkey {/O}{o}{a}{\'o} -% \definesortkey {/s}{s}{a}{\'s} -% \definesortkey {/S}{s}{a}{\'s} -% \definesortkey {/x}{z}{a}{\'x} -% \definesortkey {/X}{z}{a}{\'x} -% \definesortkey {/z}{z}{b}{\.z} -% \definesortkey {/Z}{z}{b}{\.z} -% -% \stoplanguagespecifics - -\startencoding[pdfdoc] - \startlanguagespecifics[pl]% hm - \defineactivecharacter / {\simplifiedcompoundcharacter/} - \stoplanguagespecifics -\stopencoding - -\protect \endinput diff --git a/tex/context/base/enco-fro.mkii b/tex/context/base/enco-fro.mkii new file mode 100644 index 000000000..e5f5e1257 --- /dev/null +++ b/tex/context/base/enco-fro.mkii @@ -0,0 +1,35 @@ +%D \module +%D [ file=enco-fro, +%D version=2000.08.20, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Romanian Input Filter, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D These definitions used to be part of lang-ita.tex. + +\unprotect + +\installactivecharacter " + +\startlanguagespecifics[\s!ro] + + \installcompoundcharacter "a {\acircumflex} + \installcompoundcharacter "i {\icircumflex} + \installcompoundcharacter "s {\scedilla} + \installcompoundcharacter "t {\tcedilla} + \installcompoundcharacter "A {\Acircumflex} + \installcompoundcharacter "I {\Icircumflex} + \installcompoundcharacter "S {\Scedilla} + \installcompoundcharacter "T {\Tcedilla} + \installcompoundcharacter "` {\startdelimitedtext[\v!quotation]} + \installcompoundcharacter "' {\stopdelimitedtext} + +\stoplanguagespecifics + +\protect \endinput diff --git a/tex/context/base/enco-fro.tex b/tex/context/base/enco-fro.tex deleted file mode 100644 index e5f5e1257..000000000 --- a/tex/context/base/enco-fro.tex +++ /dev/null @@ -1,35 +0,0 @@ -%D \module -%D [ file=enco-fro, -%D version=2000.08.20, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Romanian Input Filter, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D These definitions used to be part of lang-ita.tex. - -\unprotect - -\installactivecharacter " - -\startlanguagespecifics[\s!ro] - - \installcompoundcharacter "a {\acircumflex} - \installcompoundcharacter "i {\icircumflex} - \installcompoundcharacter "s {\scedilla} - \installcompoundcharacter "t {\tcedilla} - \installcompoundcharacter "A {\Acircumflex} - \installcompoundcharacter "I {\Icircumflex} - \installcompoundcharacter "S {\Scedilla} - \installcompoundcharacter "T {\Tcedilla} - \installcompoundcharacter "` {\startdelimitedtext[\v!quotation]} - \installcompoundcharacter "' {\stopdelimitedtext} - -\stoplanguagespecifics - -\protect \endinput diff --git a/tex/context/base/enco-fsl.mkii b/tex/context/base/enco-fsl.mkii new file mode 100644 index 000000000..86a41c88a --- /dev/null +++ b/tex/context/base/enco-fsl.mkii @@ -0,0 +1,32 @@ +%D \module +%D [ file=enco-fsl, +%D version=2005.08.17, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Slovenian Specialities, +%D author={Hans Hagen, Mojka Miklavec}, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Usage: +%D +%D \starttyping +%D \useencoding[fsl] +%D +%D \starttext +%D \dstroke \language[sl] \dstroke +%D \stoptext +%D \stoptyping + +\unprotect + +\startlanguagespecifics[\s!sl] + \startencoding[\s!default] + \definecharacter dstroke {d\zcaron} % hm, expects a space delimiter + \stopencoding +\stoplanguagespecifics + +\protect \endinput diff --git a/tex/context/base/enco-fsl.tex b/tex/context/base/enco-fsl.tex deleted file mode 100644 index 86a41c88a..000000000 --- a/tex/context/base/enco-fsl.tex +++ /dev/null @@ -1,32 +0,0 @@ -%D \module -%D [ file=enco-fsl, -%D version=2005.08.17, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Slovenian Specialities, -%D author={Hans Hagen, Mojka Miklavec}, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Usage: -%D -%D \starttyping -%D \useencoding[fsl] -%D -%D \starttext -%D \dstroke \language[sl] \dstroke -%D \stoptext -%D \stoptyping - -\unprotect - -\startlanguagespecifics[\s!sl] - \startencoding[\s!default] - \definecharacter dstroke {d\zcaron} % hm, expects a space delimiter - \stopencoding -\stoplanguagespecifics - -\protect \endinput diff --git a/tex/context/base/enco-grk.mkii b/tex/context/base/enco-grk.mkii new file mode 100644 index 000000000..882a3c9b0 --- /dev/null +++ b/tex/context/base/enco-grk.mkii @@ -0,0 +1,190 @@ +%D \module +%D [ file=enco-grk, +%D version=2003.03.01, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Greek, +%D author=Apostolos Syropoulos, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startmapping[iso-8859-7] + +% Uppercase Greek letters + +\definecasemap 193 193 225 % greekAlpha +\definecasemap 194 194 226 % greekBeta +\definecasemap 195 195 227 % greekGamma +\definecasemap 196 196 228 % greekDelta +\definecasemap 197 197 229 % greekEpsilon +\definecasemap 198 198 230 % greekZeta +\definecasemap 199 199 213 % greekEta +\definecasemap 200 200 232 % greekTheta +\definecasemap 201 201 233 % greekIota +\definecasemap 202 202 234 % greekKappa +\definecasemap 203 203 235 % greekLambda +\definecasemap 204 204 236 % greekMu +\definecasemap 205 205 237 % greekNu +\definecasemap 206 206 238 % greekXi +\definecasemap 207 207 239 % greekOmicron +\definecasemap 208 208 240 % greekPi +\definecasemap 209 209 241 % greekRho +\definecasemap 211 211 243 % greekSigma +\definecasemap 212 212 244 % greekTau +\definecasemap 213 213 245 % greekUpsilon +\definecasemap 214 214 246 % greekPhi +\definecasemap 215 215 247 % greekChi +\definecasemap 216 216 248 % greekPsi +\definecasemap 217 217 249 % greekOmega + +% Lowercase Greek letters + +\definecasemap 225 193 225 % greekalpha +\definecasemap 226 194 226 % greekbeta +\definecasemap 227 195 227 % greekgamma +\definecasemap 228 196 228 % greekdelta +\definecasemap 229 197 229 % greekepsilon +\definecasemap 230 198 230 % greekzeta +\definecasemap 213 199 213 % greeketa +\definecasemap 232 200 232 % greektheta +\definecasemap 233 201 233 % greekiota +\definecasemap 234 202 234 % greekkappa +\definecasemap 235 203 235 % greeklambda +\definecasemap 236 204 236 % greekmu +\definecasemap 237 205 237 % greeknu +\definecasemap 238 206 238 % greekxi +\definecasemap 239 207 239 % greekomicron +\definecasemap 240 208 240 % greekpi +\definecasemap 241 209 241 % greekrho +\definecasemap 242 211 242 % greekfinalsigma +\definecasemap 243 211 243 % greekSigma +\definecasemap 244 212 244 % greekTau +\definecasemap 245 213 245 % greekUpsilon +\definecasemap 246 214 246 % greekPhi +\definecasemap 247 215 247 % greekChi +\definecasemap 248 216 248 % greekPsi +\definecasemap 249 217 249 % greekOmega + +% Accented Uppercase Greek letters + +\definecasemap 182 193 220 % greekAlphatonos +\definecasemap 184 197 221 % greekEpsilontonos +\definecasemap 185 199 222 % greekEtatonos +\definecasemap 186 201 223 % greekIotatonos +\definecasemap 188 207 252 % greekOmicrontonos +\definecasemap 190 213 253 % greekUpsilontonos +\definecasemap 191 217 254 % greekOmegatonos +\definecasemap 218 218 250 % greekIotadialytika +\definecasemap 219 219 251 % greekUpsilondialytika + +% Accented Lowercase Greek letters + +\definecasemap 220 193 220 % greekalphatonos +\definecasemap 221 197 221 % greekepsilontonos +\definecasemap 222 199 222 % greeketatonos +\definecasemap 223 201 223 % greekiotatonos +\definecasemap 252 207 252 % greekomicrontonos +\definecasemap 253 213 253 % greekupsilontonos +\definecasemap 254 217 254 % greekomegatonos +\definecasemap 250 218 250 % greekiotadialytika +\definecasemap 251 219 251 % greekupsilondialytika +\definecasemap 192 218 192 % greekiotadialytikatonos +\definecasemap 224 219 224 % greekupsilondialytikatonos + +\stopmapping + +\startencoding[iso-8859-7] + +% Uppercase Greek letters + +\definecharacter greekAlpha 193 +\definecharacter greekBeta 194 +\definecharacter greekGamma 195 +\definecharacter greekDelta 196 +\definecharacter greekEpsilon 197 +\definecharacter greekZeta 198 +\definecharacter greekEta 199 +\definecharacter greekTheta 200 +\definecharacter greekIota 201 +\definecharacter greekKappa 202 +\definecharacter greekLambda 203 +\definecharacter greekMu 204 +\definecharacter greekNu 205 +\definecharacter greekXi 206 +\definecharacter greekOmicron 207 +\definecharacter greekPi 208 +\definecharacter greekRho 209 +\definecharacter greekSigma 211 +\definecharacter greekTau 212 +\definecharacter greekUpsilon 213 +\definecharacter greekPhi 214 +\definecharacter greekChi 215 +\definecharacter greekPsi 216 +\definecharacter greekOmega 217 + +% Lowercase Greek letters + +\definecharacter greekalpha 225 +\definecharacter greekbeta 226 +\definecharacter greekgamma 227 +\definecharacter greekdelta 228 +\definecharacter greekepsilon 229 +\definecharacter greekzeta 230 +\definecharacter greeketa 231 +\definecharacter greektheta 232 +\definecharacter greekiota 233 +\definecharacter greekkappa 234 +\definecharacter greeklambda 235 +\definecharacter greekmu 236 +\definecharacter greeknu 237 +\definecharacter greekxi 238 +\definecharacter greekomicron 239 +\definecharacter greekpi 240 +\definecharacter greekrho 241 +\definecharacter greekfinalsigma 242 +\definecharacter greeksigma 243 +\definecharacter greektau 244 +\definecharacter greekupsilon 245 +\definecharacter greekphi 246 +\definecharacter greekchi 247 +\definecharacter greekpsi 248 +\definecharacter greekomega 249 + +% Accented Uppercase Greek letters + +\definecharacter greekAlphatonos 182 +\definecharacter greekEpsilontonos 184 +\definecharacter greekEtatonos 185 +\definecharacter greekIotatonos 186 +\definecharacter greekOmicrontonos 188 +\definecharacter greekUpsilontonos 190 +\definecharacter greekOmegatonos 191 +\definecharacter greekIotadialytika 218 +\definecharacter greekUpsilondialytika 219 + +% Accented Lowercase Greek letters + +\definecharacter greekalphatonos 220 +\definecharacter greekepsilontonos 221 +\definecharacter greeketatonos 222 +\definecharacter greekiotatonos 223 +\definecharacter greekomicrontonos 252 +\definecharacter greekupsilontonos 253 +\definecharacter greekomegatonos 254 +\definecharacter greekiotadialytika 250 +\definecharacter greekupsilondialytika 251 +\definecharacter greekiotadialytikatonos 192 +\definecharacter greekupsilondialytikatonos 224 + +% Miscellaneous Greek symbols + +\definecharacter greekleftquot 171 +\definecharacter greekrightquot 187 +\definecharacter greektonos 180 +\definecharacter greekdialytikatonos 181 +\definecharacter greekapostrophos 162 + +\stopencoding diff --git a/tex/context/base/enco-grk.tex b/tex/context/base/enco-grk.tex deleted file mode 100644 index 882a3c9b0..000000000 --- a/tex/context/base/enco-grk.tex +++ /dev/null @@ -1,190 +0,0 @@ -%D \module -%D [ file=enco-grk, -%D version=2003.03.01, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Greek, -%D author=Apostolos Syropoulos, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startmapping[iso-8859-7] - -% Uppercase Greek letters - -\definecasemap 193 193 225 % greekAlpha -\definecasemap 194 194 226 % greekBeta -\definecasemap 195 195 227 % greekGamma -\definecasemap 196 196 228 % greekDelta -\definecasemap 197 197 229 % greekEpsilon -\definecasemap 198 198 230 % greekZeta -\definecasemap 199 199 213 % greekEta -\definecasemap 200 200 232 % greekTheta -\definecasemap 201 201 233 % greekIota -\definecasemap 202 202 234 % greekKappa -\definecasemap 203 203 235 % greekLambda -\definecasemap 204 204 236 % greekMu -\definecasemap 205 205 237 % greekNu -\definecasemap 206 206 238 % greekXi -\definecasemap 207 207 239 % greekOmicron -\definecasemap 208 208 240 % greekPi -\definecasemap 209 209 241 % greekRho -\definecasemap 211 211 243 % greekSigma -\definecasemap 212 212 244 % greekTau -\definecasemap 213 213 245 % greekUpsilon -\definecasemap 214 214 246 % greekPhi -\definecasemap 215 215 247 % greekChi -\definecasemap 216 216 248 % greekPsi -\definecasemap 217 217 249 % greekOmega - -% Lowercase Greek letters - -\definecasemap 225 193 225 % greekalpha -\definecasemap 226 194 226 % greekbeta -\definecasemap 227 195 227 % greekgamma -\definecasemap 228 196 228 % greekdelta -\definecasemap 229 197 229 % greekepsilon -\definecasemap 230 198 230 % greekzeta -\definecasemap 213 199 213 % greeketa -\definecasemap 232 200 232 % greektheta -\definecasemap 233 201 233 % greekiota -\definecasemap 234 202 234 % greekkappa -\definecasemap 235 203 235 % greeklambda -\definecasemap 236 204 236 % greekmu -\definecasemap 237 205 237 % greeknu -\definecasemap 238 206 238 % greekxi -\definecasemap 239 207 239 % greekomicron -\definecasemap 240 208 240 % greekpi -\definecasemap 241 209 241 % greekrho -\definecasemap 242 211 242 % greekfinalsigma -\definecasemap 243 211 243 % greekSigma -\definecasemap 244 212 244 % greekTau -\definecasemap 245 213 245 % greekUpsilon -\definecasemap 246 214 246 % greekPhi -\definecasemap 247 215 247 % greekChi -\definecasemap 248 216 248 % greekPsi -\definecasemap 249 217 249 % greekOmega - -% Accented Uppercase Greek letters - -\definecasemap 182 193 220 % greekAlphatonos -\definecasemap 184 197 221 % greekEpsilontonos -\definecasemap 185 199 222 % greekEtatonos -\definecasemap 186 201 223 % greekIotatonos -\definecasemap 188 207 252 % greekOmicrontonos -\definecasemap 190 213 253 % greekUpsilontonos -\definecasemap 191 217 254 % greekOmegatonos -\definecasemap 218 218 250 % greekIotadialytika -\definecasemap 219 219 251 % greekUpsilondialytika - -% Accented Lowercase Greek letters - -\definecasemap 220 193 220 % greekalphatonos -\definecasemap 221 197 221 % greekepsilontonos -\definecasemap 222 199 222 % greeketatonos -\definecasemap 223 201 223 % greekiotatonos -\definecasemap 252 207 252 % greekomicrontonos -\definecasemap 253 213 253 % greekupsilontonos -\definecasemap 254 217 254 % greekomegatonos -\definecasemap 250 218 250 % greekiotadialytika -\definecasemap 251 219 251 % greekupsilondialytika -\definecasemap 192 218 192 % greekiotadialytikatonos -\definecasemap 224 219 224 % greekupsilondialytikatonos - -\stopmapping - -\startencoding[iso-8859-7] - -% Uppercase Greek letters - -\definecharacter greekAlpha 193 -\definecharacter greekBeta 194 -\definecharacter greekGamma 195 -\definecharacter greekDelta 196 -\definecharacter greekEpsilon 197 -\definecharacter greekZeta 198 -\definecharacter greekEta 199 -\definecharacter greekTheta 200 -\definecharacter greekIota 201 -\definecharacter greekKappa 202 -\definecharacter greekLambda 203 -\definecharacter greekMu 204 -\definecharacter greekNu 205 -\definecharacter greekXi 206 -\definecharacter greekOmicron 207 -\definecharacter greekPi 208 -\definecharacter greekRho 209 -\definecharacter greekSigma 211 -\definecharacter greekTau 212 -\definecharacter greekUpsilon 213 -\definecharacter greekPhi 214 -\definecharacter greekChi 215 -\definecharacter greekPsi 216 -\definecharacter greekOmega 217 - -% Lowercase Greek letters - -\definecharacter greekalpha 225 -\definecharacter greekbeta 226 -\definecharacter greekgamma 227 -\definecharacter greekdelta 228 -\definecharacter greekepsilon 229 -\definecharacter greekzeta 230 -\definecharacter greeketa 231 -\definecharacter greektheta 232 -\definecharacter greekiota 233 -\definecharacter greekkappa 234 -\definecharacter greeklambda 235 -\definecharacter greekmu 236 -\definecharacter greeknu 237 -\definecharacter greekxi 238 -\definecharacter greekomicron 239 -\definecharacter greekpi 240 -\definecharacter greekrho 241 -\definecharacter greekfinalsigma 242 -\definecharacter greeksigma 243 -\definecharacter greektau 244 -\definecharacter greekupsilon 245 -\definecharacter greekphi 246 -\definecharacter greekchi 247 -\definecharacter greekpsi 248 -\definecharacter greekomega 249 - -% Accented Uppercase Greek letters - -\definecharacter greekAlphatonos 182 -\definecharacter greekEpsilontonos 184 -\definecharacter greekEtatonos 185 -\definecharacter greekIotatonos 186 -\definecharacter greekOmicrontonos 188 -\definecharacter greekUpsilontonos 190 -\definecharacter greekOmegatonos 191 -\definecharacter greekIotadialytika 218 -\definecharacter greekUpsilondialytika 219 - -% Accented Lowercase Greek letters - -\definecharacter greekalphatonos 220 -\definecharacter greekepsilontonos 221 -\definecharacter greeketatonos 222 -\definecharacter greekiotatonos 223 -\definecharacter greekomicrontonos 252 -\definecharacter greekupsilontonos 253 -\definecharacter greekomegatonos 254 -\definecharacter greekiotadialytika 250 -\definecharacter greekupsilondialytika 251 -\definecharacter greekiotadialytikatonos 192 -\definecharacter greekupsilondialytikatonos 224 - -% Miscellaneous Greek symbols - -\definecharacter greekleftquot 171 -\definecharacter greekrightquot 187 -\definecharacter greektonos 180 -\definecharacter greekdialytikatonos 181 -\definecharacter greekapostrophos 162 - -\stopencoding diff --git a/tex/context/base/enco-heb.mkii b/tex/context/base/enco-heb.mkii new file mode 100644 index 000000000..443745752 --- /dev/null +++ b/tex/context/base/enco-heb.mkii @@ -0,0 +1,16 @@ +%D \module +%D [ file=enco-heb, +%D version=2005.01.27, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Hebrew, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D To be done. + +\endinput diff --git a/tex/context/base/enco-heb.tex b/tex/context/base/enco-heb.tex deleted file mode 100644 index 443745752..000000000 --- a/tex/context/base/enco-heb.tex +++ /dev/null @@ -1,16 +0,0 @@ -%D \module -%D [ file=enco-heb, -%D version=2005.01.27, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Hebrew, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D To be done. - -\endinput diff --git a/tex/context/base/enco-ibm.mkii b/tex/context/base/enco-ibm.mkii new file mode 100644 index 000000000..48695ca52 --- /dev/null +++ b/tex/context/base/enco-ibm.mkii @@ -0,0 +1,7 @@ +% temporary module, needed for downward compatibility + +%\input regi-ibm.tex + +\enableregime[ibm] + +\endinput diff --git a/tex/context/base/enco-ibm.tex b/tex/context/base/enco-ibm.tex deleted file mode 100644 index 48695ca52..000000000 --- a/tex/context/base/enco-ibm.tex +++ /dev/null @@ -1,7 +0,0 @@ -% temporary module, needed for downward compatibility - -%\input regi-ibm.tex - -\enableregime[ibm] - -\endinput diff --git a/tex/context/base/enco-il2.mkii b/tex/context/base/enco-il2.mkii new file mode 100644 index 000000000..9fb87b2fd --- /dev/null +++ b/tex/context/base/enco-il2.mkii @@ -0,0 +1,157 @@ +%D \module +%D [ file=enco-il2, +%D version=2000.05.07, % 1998.12.01, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Czech and Slovak ISO Latin 2 Encoding, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% This encoding will go but the regime will remain. + +%D This Czech/Slovak encoding is dedicated to Han The Thanh. +%D The numbers are derived from some files he sent me. This +%D definition file is (still) sort of beta. + +\startmapping[il2] + +\resetcaserange 127 to 255 % we map them all to themselves + +\definecaseswap 184 152 +\definecaseswap 181 165 +\definecaseswap 185 169 +\definecaseswap 187 171 +\definecaseswap 190 174 +\definecaseswap 224 192 +\definecaseswap 225 193 +\definecaseswap 228 196 +\definecaseswap 229 197 +\definecaseswap 232 200 +\definecaseswap 233 201 +\definecaseswap 236 204 +\definecaseswap 237 205 +\definecaseswap 239 207 +\definecaseswap 242 210 +\definecaseswap 243 211 +\definecaseswap 244 212 +\definecaseswap 246 214 +\definecaseswap 248 216 +\definecaseswap 249 217 +\definecaseswap 250 218 +\definecaseswap 252 220 +\definecaseswap 253 221 + +\stopmapping + +\startencoding[il2][il2] + +\definecharacter textgrave 18 +\definecharacter textacute 19 +\definecharacter textcaron 20 +\definecharacter textbreve 21 +\definecharacter textmacron 22 +\definecharacter textring 23 +\definecharacter textcedilla 24 +\definecharacter textcircumflex 94 +\definecharacter textdotaccent 95 +\definecharacter texthungarumlaut 125 +\definecharacter texttilde 126 +\definecharacter textdiaeresis 127 + +\definecharacter dotlessi 16 +\definecharacter dotlessj 17 + +\definecharacter aeligature 26 +\definecharacter AEligature 29 +\definecharacter oeligature 27 +\definecharacter OEligature 30 + +\definecharacter ssharp 25 + +\definecharacter Racute 192 +\definecharacter Aacute 193 +\definecharacter Lacute 197 +\definecharacter Eacute 201 +\definecharacter Iacute 205 +\definecharacter Oacute 211 +\definecharacter Uacute 218 +\definecharacter Yacute 221 +\definecharacter racute 224 +\definecharacter aacute 225 +\definecharacter lacute 229 +\definecharacter eacute 233 +\definecharacter iacute 237 +\definecharacter oacute 243 +\definecharacter uacute 250 +\definecharacter yacute 253 + +\definecharacter Lcaron 165 +\definecharacter Scaron 169 +\definecharacter Tcaron 171 +\definecharacter Zcaron 174 +\definecharacter lcaron 181 +\definecharacter scaron 185 +\definecharacter tcaron 187 +\definecharacter zcaron 190 +\definecharacter Ccaron 200 +\definecharacter Ecaron 204 +\definecharacter Dcaron 207 +\definecharacter Ncaron 210 +\definecharacter Rcaron 216 +\definecharacter ccaron 232 +\definecharacter ecaron 236 +\definecharacter dcaron 239 +\definecharacter ncaron 242 +\definecharacter rcaron 248 + +\definecharacter Ocircumflex 212 +\definecharacter ocircumflex 244 + +\definecharacter Adiaeresis 196 +\definecharacter Odiaeresis 214 +\definecharacter Udiaeresis 220 +\definecharacter adiaeresis 228 +\definecharacter odiaeresis 246 +\definecharacter udiaeresis 252 + +\definecharacter Agrave 152 +\definecharacter agrave 184 + +\definecharacter Ohungarumlaut 213 +\definecharacter Uhungarumlaut 219 +\definecharacter ohungarumlaut 245 +\definecharacter uhungarumlaut 251 + +\definecharacter Uring 217 +\definecharacter uring 249 +\definecharacter Aring {\ilencodedrA} + +\definecharacter ostroke 28 +\definecharacter Ostroke 31 +\definecharacter Lstroke {\ilencodedL} +\definecharacter lstroke {\ilencodedl} + +\def\ilencodedrA + {\dontleavehmode\hbox\bgroup + \setbox0\hbox{h}% + \dimen0=\ht0 + \advance\dimen0 by -1ex + \rlap{\raise.67\dimen0\hbox{\char'27}}A% + \egroup} + +\def\ilencodedl + {\dontleavehmode{\char32l}} + +\def\ilencodedL + {\dontleavehmode\hbox\bgroup + \setbox0\hbox{L}% + \hbox to\wd0{\hss\char32L}% + \egroup} + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-il2.tex b/tex/context/base/enco-il2.tex deleted file mode 100644 index 9fb87b2fd..000000000 --- a/tex/context/base/enco-il2.tex +++ /dev/null @@ -1,157 +0,0 @@ -%D \module -%D [ file=enco-il2, -%D version=2000.05.07, % 1998.12.01, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Czech and Slovak ISO Latin 2 Encoding, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% This encoding will go but the regime will remain. - -%D This Czech/Slovak encoding is dedicated to Han The Thanh. -%D The numbers are derived from some files he sent me. This -%D definition file is (still) sort of beta. - -\startmapping[il2] - -\resetcaserange 127 to 255 % we map them all to themselves - -\definecaseswap 184 152 -\definecaseswap 181 165 -\definecaseswap 185 169 -\definecaseswap 187 171 -\definecaseswap 190 174 -\definecaseswap 224 192 -\definecaseswap 225 193 -\definecaseswap 228 196 -\definecaseswap 229 197 -\definecaseswap 232 200 -\definecaseswap 233 201 -\definecaseswap 236 204 -\definecaseswap 237 205 -\definecaseswap 239 207 -\definecaseswap 242 210 -\definecaseswap 243 211 -\definecaseswap 244 212 -\definecaseswap 246 214 -\definecaseswap 248 216 -\definecaseswap 249 217 -\definecaseswap 250 218 -\definecaseswap 252 220 -\definecaseswap 253 221 - -\stopmapping - -\startencoding[il2][il2] - -\definecharacter textgrave 18 -\definecharacter textacute 19 -\definecharacter textcaron 20 -\definecharacter textbreve 21 -\definecharacter textmacron 22 -\definecharacter textring 23 -\definecharacter textcedilla 24 -\definecharacter textcircumflex 94 -\definecharacter textdotaccent 95 -\definecharacter texthungarumlaut 125 -\definecharacter texttilde 126 -\definecharacter textdiaeresis 127 - -\definecharacter dotlessi 16 -\definecharacter dotlessj 17 - -\definecharacter aeligature 26 -\definecharacter AEligature 29 -\definecharacter oeligature 27 -\definecharacter OEligature 30 - -\definecharacter ssharp 25 - -\definecharacter Racute 192 -\definecharacter Aacute 193 -\definecharacter Lacute 197 -\definecharacter Eacute 201 -\definecharacter Iacute 205 -\definecharacter Oacute 211 -\definecharacter Uacute 218 -\definecharacter Yacute 221 -\definecharacter racute 224 -\definecharacter aacute 225 -\definecharacter lacute 229 -\definecharacter eacute 233 -\definecharacter iacute 237 -\definecharacter oacute 243 -\definecharacter uacute 250 -\definecharacter yacute 253 - -\definecharacter Lcaron 165 -\definecharacter Scaron 169 -\definecharacter Tcaron 171 -\definecharacter Zcaron 174 -\definecharacter lcaron 181 -\definecharacter scaron 185 -\definecharacter tcaron 187 -\definecharacter zcaron 190 -\definecharacter Ccaron 200 -\definecharacter Ecaron 204 -\definecharacter Dcaron 207 -\definecharacter Ncaron 210 -\definecharacter Rcaron 216 -\definecharacter ccaron 232 -\definecharacter ecaron 236 -\definecharacter dcaron 239 -\definecharacter ncaron 242 -\definecharacter rcaron 248 - -\definecharacter Ocircumflex 212 -\definecharacter ocircumflex 244 - -\definecharacter Adiaeresis 196 -\definecharacter Odiaeresis 214 -\definecharacter Udiaeresis 220 -\definecharacter adiaeresis 228 -\definecharacter odiaeresis 246 -\definecharacter udiaeresis 252 - -\definecharacter Agrave 152 -\definecharacter agrave 184 - -\definecharacter Ohungarumlaut 213 -\definecharacter Uhungarumlaut 219 -\definecharacter ohungarumlaut 245 -\definecharacter uhungarumlaut 251 - -\definecharacter Uring 217 -\definecharacter uring 249 -\definecharacter Aring {\ilencodedrA} - -\definecharacter ostroke 28 -\definecharacter Ostroke 31 -\definecharacter Lstroke {\ilencodedL} -\definecharacter lstroke {\ilencodedl} - -\def\ilencodedrA - {\dontleavehmode\hbox\bgroup - \setbox0\hbox{h}% - \dimen0=\ht0 - \advance\dimen0 by -1ex - \rlap{\raise.67\dimen0\hbox{\char'27}}A% - \egroup} - -\def\ilencodedl - {\dontleavehmode{\char32l}} - -\def\ilencodedL - {\dontleavehmode\hbox\bgroup - \setbox0\hbox{L}% - \hbox to\wd0{\hss\char32L}% - \egroup} - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-ini.mkii b/tex/context/base/enco-ini.mkii index 9379c3a7f..1ac491e62 100644 --- a/tex/context/base/enco-ini.mkii +++ b/tex/context/base/enco-ini.mkii @@ -93,7 +93,7 @@ {\letvalue{\c!file\f!encodingprefix#1}\empty \makeshortfilename[\truefilename{\f!encodingprefix#1}]% \startreadingfile - \readsysfile\shortfilename + \readsysfile{\shortfilename.mkii} {\showmessage\m!encodings2{#1}} {\showmessage\m!encodings3{#1}}% \stopreadingfile}} @@ -747,11 +747,11 @@ %D can be used to check the correct loading of hyphenation %D patterns. -\fetchruntimecommand \showaccents {\f!encodingprefix\s!run} -\fetchruntimecommand \showcharacters {\f!encodingprefix\s!run} -\fetchruntimecommand \showcharacterbounds {\f!encodingprefix\s!run} -\fetchruntimecommand \showhyphenations {\f!encodingprefix\s!run} -\fetchruntimecommand \showmapping {\f!encodingprefix\s!run} +\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} %D \macros %D {everyuppercase, EveryUppercase, diff --git a/tex/context/base/enco-ini.mkiv b/tex/context/base/enco-ini.mkiv index 5fd3d9cef..112c5596a 100644 --- a/tex/context/base/enco-ini.mkiv +++ b/tex/context/base/enco-ini.mkiv @@ -11,12 +11,12 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D This is s stripped down version of th eoriginal enco-ini.tex +%D This is stripped down version of th eoriginal enco-ini.tex %D file. For more details you might want to study the \MKII\ file %D but since \LUATEX\ is unicode inside we need less code. -% When dealing with characters we have four cases to take into account when moving -% from mkii to mkiv: +% When dealing with characters we have four cases to take into account +% when moving from mkii to mkiv: % 1. => ref to slot 200 in current font % 2. \char 200 => ref to slot 200 in current font @@ -36,36 +36,19 @@ \unprotect -%D Quite some commands are now obsolete. These nillers will disappear soon. - -\def\currentencoding {utf} -\def\currentmapping {utf} - -\let\defaultencoding \s!default -\let\characterencoding \s!default -\let\nocharacterencoding\s!default - -\def\setupencoding [#1]{} -\def\startmapping [#1]{\gobbleuntil\stopmapping} -\def\startencoding [#1]{} -\let\stopencoding \relax -\let\startcoding \startencoding -\let\stopcoding \relax -\def\optimizemapping [#1]{} -\def\enablemapping [#1]{} -\def\enableencoding [#1]{} -\def\enablecoding [#1]{} -\def\fastenableencoding #1{} -\def\enablelanguagespecifics[#1]{} -\def\useencoding [#1]{} - -\let\dontexpandencoding \relax -\let\keepencodedtokens \relax -\let\literateencodedtokens \relax -\let\stringifyencodedtokens \relax -\let\dontexpandencodedtokens\relax -\let\convertencodedtokens \relax -\let\ignoreencoding \relax +%D Quite some commands are now obsolete. We keep only a few commands +%D around, just in case they are used in styles (and in for instance +%D symb and xtag files). + +\def\startencoding [#1]{} % used in symb +\let\stopencoding \relax +\def\setupencoding [#1]{} +\def\enablemapping [#1]{} +\def\enableencoding[#1]{} + +\def\currentencoding{utf} +\def\currentmapping {utf} +\let\defaultencoding\s!default % todo: @@ -78,14 +61,12 @@ %D \macros %D {defineaccent, definecharacter, definecommand} -\def\accentprefix{@acc@} - \def\defineaccent#1 #2 #3 % {\setevalue{\string#1}{\noexpand\dohandleaccent{\string#1}}% - \setvalue{\accentprefix\string#1\string#2}{#3}} + \setvalue{\??ac\string#1\string#2}{#3}} \def\dohandleaccent#1#2% - {\csname\accentprefix\string#1\string#2\endcsname} + {\csname\??ac\string#1\string#2\endcsname} \def\definecharacter#1 #2 % {\doifnumberelse{\string#2} @@ -102,7 +83,7 @@ \newevery \everyuppercase \EveryUppercase \newevery \everylowercase \EveryLowercase -\newevery \everysanitize \EverySanitize +\newevery \everysanitize \EverySanitize %D Some saved meanings (not really needed): @@ -371,21 +352,6 @@ \vrule \!!width\scratchdimen \!!height5.5\scratchdimen\!!depth3\scratchdimen \kern\scratchdimen}} -% what to do with these: -% -% \definecharacter mathacute "7013 -% \definecharacter mathgrave "7012 -% \definecharacter mathddot "707F -% \definecharacter mathtilde "707E -% \definecharacter mathbar "7016 -% \definecharacter mathbreve "7015 -% \definecharacter mathcheck "7014 -% \definecharacter mathhat "705E -% \definecharacter mathvec "017E -% \definecharacter mathdot "705F -% \definecharacter mathwidetilde "0365 -% \definecharacter mathwidehat "0362 - % from enco-acc: \defineaccent ^ A {\Acircumflex} \defineaccent ^ a {\acircumflex} @@ -412,6 +378,7 @@ \defineaccent ~ I {\Itilde} \defineaccent ~ i {\itilde} \defineaccent ~ {\i} {\itilde} \defineaccent ~ O {\Otilde} \defineaccent ~ o {\otilde} \defineaccent ~ U {\Utilde} \defineaccent ~ u {\utilde} +\defineaccent ~ N {\Ntilde} \defineaccent ~ n {\ntilde} \defineaccent " A {\Adiaeresis} \defineaccent " a {\adiaeresis} \defineaccent " E {\Ediaeresis} \defineaccent " e {\ediaeresis} @@ -512,7 +479,6 @@ \!!width \wd\scratchbox \!!height\zeropoint}} - \def\fakeunderscores{\let\_\fakeunderscore} \def\textunderscores{\let\_\textunderscore} diff --git a/tex/context/base/enco-lat.mkii b/tex/context/base/enco-lat.mkii new file mode 100644 index 000000000..2623aae8d --- /dev/null +++ b/tex/context/base/enco-lat.mkii @@ -0,0 +1,7 @@ +% temporary module, needed for downward compatibility + +\input regi-lat.tex + +\enableregime[latin2] + +\endinput diff --git a/tex/context/base/enco-lat.tex b/tex/context/base/enco-lat.tex deleted file mode 100644 index 2623aae8d..000000000 --- a/tex/context/base/enco-lat.tex +++ /dev/null @@ -1,7 +0,0 @@ -% temporary module, needed for downward compatibility - -\input regi-lat.tex - -\enableregime[latin2] - -\endinput diff --git a/tex/context/base/enco-mis.mkii b/tex/context/base/enco-mis.mkii new file mode 100644 index 000000000..92dc61b3f --- /dev/null +++ b/tex/context/base/enco-mis.mkii @@ -0,0 +1,188 @@ +%D \module +%D [ file=enco-mis, +%D version=2000.05.07, % 1999.11.11, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Missing Glyphs, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D In this file we collect some definitions that construct +%D pseudo characters. Some day we will move some definitions +%D from \type {plain.tex} to this file. Some definitions are +%D derived from definitions in the \LATEX\ distribution, +%D especially Johannes Braams' Babel system. + +\startmapping[\s!default] + +\defineuppercasecom \dj \DJ +\defineuppercasecom \Dj \dj +\defineuppercasecom \DJ \dj + +\definecharacter dstroke {\pseudoencodeddj} +\definecharacter Dstroke {\pseudoencodedDJ} + +\stopmapping + +%D We need proper names like in enco-com.tex! + +\definecharacter dj {\dstroke} % {\pseudoencodeddj} +\definecharacter Dj {\Dstroke} % {\pseudoencodedDJ} +\definecharacter DJ {\Dstroke} % {\pseudoencodedDJ} + +\unprotect + +\def\pseudoencodeddj % like in babel, but safer + {\dontleavehmode\hbox\bgroup + \setbox\scratchbox\hbox{d}% + \scratchdimen\ht\scratchbox + \advance\scratchdimen 1ex + \scratchdimen.45\scratchdimen + \dimen2=\withoutpt\the\slantperpoint\dimen0 + \advance\dimen2 .5ex + \hbox to \wd\scratchbox + {\box\scratchbox\hss + \raise\scratchdimen\hbox{\kern\dimen2\vbox{\hrule\!!height0.1ex\!!width0.3em}}}% + \egroup} + +\def\pseudoencodedDJ % design: taco; quality assurance: mojca; cleanup: hans + {\dontleavehmode + \hbox\bgroup + \setbox\scratchbox\hbox{D}% + \dimen2=1.1ex + \dimen2=\withoutpt\the\slantperpoint\dimen2 + \hbox to \wd\scratchbox + {\rlap + {\raise.52\ht\scratchbox + \hbox + {\kern\dimen2 + \vbox{\hrule\!!height.04ex\!!depth.04ex\!!width.4\wd\scratchbox}}}% + \box\scratchbox}% + \egroup} + +% currency + +\def\fakedollar % pretty cmr dependent + {\bgroup + \ifnum\fam=\itfam + \sl + \else\ifnum\fam=\bifam + \bs + \fi\fi + \$% + \egroup} + +\def\fakesterling % pretty cmr dependent + {\bgroup + \ifnum\fam=\bffam + \bi + \else\ifnum\fam=\bifam + \bi + \else\ifnum\fam=\bsfam + \bi + \else + \it + \fi\fi\fi + \$% + \egroup} + +\def\fakeflorin + {\bgroup + \ifnum\fam=\bffam + \bi + \else\ifnum\fam=\bifam + \bi + \else\ifnum\fam=\bsfam + \bi + \else + \it + \fi\fi\fi + f% + \egroup} + +% perthings + +\def\fakepercent + {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle0}}} + +\def\fakeperthousand + {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle00}}} + +\def\fakepermine + {\dontleavehmode + \bgroup + \setbox\scratchbox\hbox + {\mathematics{+}}% + \hbox to \wd\scratchbox + {\hss + \mathematics{^{\scriptscriptstyle-}\kern-.4em/\kern-.3em_{\scriptscriptstyle-}}% + \hss}% + \egroup} + +% guillemots + +%D Yes I know, they are ugly: + +\def\fakeleftguillemot + {\dontleavehmode\hbox{\raise.25ex\hbox{$\scriptscriptstyle\ll$}}} + +\def\fakerightguillemot + {\hbox{\raise.25ex\hbox{$\scriptscriptstyle\gg$}}} + +\def\fakeleftsubguillemot + {\dontleavehmode\hbox{\raise.25ex\hbox{$\scriptscriptstyle<$}}} + +\def\fakerightsubguillemot + {\hbox{\raise.25ex\hbox{$\scriptscriptstyle>$}}} + +%D Needed: + +\def\fakevisiblespace + {\leavevmode\hbox + {\setbox\scratchbox\hbox{(}% + \scratchdimen.1\dp\scratchbox + \setbox\scratchbox\hbox{\space}% + \hbox to \wd\scratchbox + {\vrule + \!!depth 5\scratchdimen + \!!width \scratchdimen + \!!height \zeropoint + \hss + \vrule + \!!depth 5\scratchdimen + \!!width \wd\scratchbox + \!!height-4\scratchdimen + \hss + \vrule + \!!depth 5\scratchdimen + \!!width \scratchdimen + \!!height \zeropoint}}} + +%\def\fakeunderscore{\leavevmode\kern.06em\vbox{\hrule\!!width.3em}} + +\def\fakeunderscore + {\leavevmode\hbox + {\setbox\scratchbox\hbox{(}% + \scratchdimen.2\dp\scratchbox + \setbox\scratchbox\hbox{\space}% + \vrule + \!!depth \scratchdimen + \!!width \wd\scratchbox + \!!height\zeropoint}} + +\ifx\mathunderscore\undefined \let\mathunderscore\fakeunderscore \fi +\ifx\textunderscore\undefined \let\textunderscore\fakeunderscore \fi + +\unexpanded\def\normalunderscore{\ifmmode\mathunderscore\else\textunderscore\fi} + +\let\_\normalunderscore + +% Handy but obsolete, replaced by \unknownchar: +% +% \def\missingglyph{\ruledhbox{?}} + +\protect \endinput diff --git a/tex/context/base/enco-mis.tex b/tex/context/base/enco-mis.tex deleted file mode 100644 index 92dc61b3f..000000000 --- a/tex/context/base/enco-mis.tex +++ /dev/null @@ -1,188 +0,0 @@ -%D \module -%D [ file=enco-mis, -%D version=2000.05.07, % 1999.11.11, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Missing Glyphs, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D In this file we collect some definitions that construct -%D pseudo characters. Some day we will move some definitions -%D from \type {plain.tex} to this file. Some definitions are -%D derived from definitions in the \LATEX\ distribution, -%D especially Johannes Braams' Babel system. - -\startmapping[\s!default] - -\defineuppercasecom \dj \DJ -\defineuppercasecom \Dj \dj -\defineuppercasecom \DJ \dj - -\definecharacter dstroke {\pseudoencodeddj} -\definecharacter Dstroke {\pseudoencodedDJ} - -\stopmapping - -%D We need proper names like in enco-com.tex! - -\definecharacter dj {\dstroke} % {\pseudoencodeddj} -\definecharacter Dj {\Dstroke} % {\pseudoencodedDJ} -\definecharacter DJ {\Dstroke} % {\pseudoencodedDJ} - -\unprotect - -\def\pseudoencodeddj % like in babel, but safer - {\dontleavehmode\hbox\bgroup - \setbox\scratchbox\hbox{d}% - \scratchdimen\ht\scratchbox - \advance\scratchdimen 1ex - \scratchdimen.45\scratchdimen - \dimen2=\withoutpt\the\slantperpoint\dimen0 - \advance\dimen2 .5ex - \hbox to \wd\scratchbox - {\box\scratchbox\hss - \raise\scratchdimen\hbox{\kern\dimen2\vbox{\hrule\!!height0.1ex\!!width0.3em}}}% - \egroup} - -\def\pseudoencodedDJ % design: taco; quality assurance: mojca; cleanup: hans - {\dontleavehmode - \hbox\bgroup - \setbox\scratchbox\hbox{D}% - \dimen2=1.1ex - \dimen2=\withoutpt\the\slantperpoint\dimen2 - \hbox to \wd\scratchbox - {\rlap - {\raise.52\ht\scratchbox - \hbox - {\kern\dimen2 - \vbox{\hrule\!!height.04ex\!!depth.04ex\!!width.4\wd\scratchbox}}}% - \box\scratchbox}% - \egroup} - -% currency - -\def\fakedollar % pretty cmr dependent - {\bgroup - \ifnum\fam=\itfam - \sl - \else\ifnum\fam=\bifam - \bs - \fi\fi - \$% - \egroup} - -\def\fakesterling % pretty cmr dependent - {\bgroup - \ifnum\fam=\bffam - \bi - \else\ifnum\fam=\bifam - \bi - \else\ifnum\fam=\bsfam - \bi - \else - \it - \fi\fi\fi - \$% - \egroup} - -\def\fakeflorin - {\bgroup - \ifnum\fam=\bffam - \bi - \else\ifnum\fam=\bifam - \bi - \else\ifnum\fam=\bsfam - \bi - \else - \it - \fi\fi\fi - f% - \egroup} - -% perthings - -\def\fakepercent - {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle0}}} - -\def\fakeperthousand - {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle00}}} - -\def\fakepermine - {\dontleavehmode - \bgroup - \setbox\scratchbox\hbox - {\mathematics{+}}% - \hbox to \wd\scratchbox - {\hss - \mathematics{^{\scriptscriptstyle-}\kern-.4em/\kern-.3em_{\scriptscriptstyle-}}% - \hss}% - \egroup} - -% guillemots - -%D Yes I know, they are ugly: - -\def\fakeleftguillemot - {\dontleavehmode\hbox{\raise.25ex\hbox{$\scriptscriptstyle\ll$}}} - -\def\fakerightguillemot - {\hbox{\raise.25ex\hbox{$\scriptscriptstyle\gg$}}} - -\def\fakeleftsubguillemot - {\dontleavehmode\hbox{\raise.25ex\hbox{$\scriptscriptstyle<$}}} - -\def\fakerightsubguillemot - {\hbox{\raise.25ex\hbox{$\scriptscriptstyle>$}}} - -%D Needed: - -\def\fakevisiblespace - {\leavevmode\hbox - {\setbox\scratchbox\hbox{(}% - \scratchdimen.1\dp\scratchbox - \setbox\scratchbox\hbox{\space}% - \hbox to \wd\scratchbox - {\vrule - \!!depth 5\scratchdimen - \!!width \scratchdimen - \!!height \zeropoint - \hss - \vrule - \!!depth 5\scratchdimen - \!!width \wd\scratchbox - \!!height-4\scratchdimen - \hss - \vrule - \!!depth 5\scratchdimen - \!!width \scratchdimen - \!!height \zeropoint}}} - -%\def\fakeunderscore{\leavevmode\kern.06em\vbox{\hrule\!!width.3em}} - -\def\fakeunderscore - {\leavevmode\hbox - {\setbox\scratchbox\hbox{(}% - \scratchdimen.2\dp\scratchbox - \setbox\scratchbox\hbox{\space}% - \vrule - \!!depth \scratchdimen - \!!width \wd\scratchbox - \!!height\zeropoint}} - -\ifx\mathunderscore\undefined \let\mathunderscore\fakeunderscore \fi -\ifx\textunderscore\undefined \let\textunderscore\fakeunderscore \fi - -\unexpanded\def\normalunderscore{\ifmmode\mathunderscore\else\textunderscore\fi} - -\let\_\normalunderscore - -% Handy but obsolete, replaced by \unknownchar: -% -% \def\missingglyph{\ruledhbox{?}} - -\protect \endinput diff --git a/tex/context/base/enco-pdf.mkii b/tex/context/base/enco-pdf.mkii new file mode 100644 index 000000000..a03e81df2 --- /dev/null +++ b/tex/context/base/enco-pdf.mkii @@ -0,0 +1,278 @@ +%D \module +%D [ file=enco-pdf, +%D version=1995.01.01, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=\YandY\ texnansi Encoding, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is the \PDF\ document encoding. + +\startencoding[pdfdoc] % \rawcharacter{number} + +\definecharacter oeligature ^^9c + +\definecharacter leftguillemot ^^ab +\definecharacter rightguillemot ^^bb + +\definecharacter Agrave ^^c0 +\definecharacter Aacute ^^c1 +\definecharacter Acircumflex ^^c2 +\definecharacter Atilde ^^c3 +\definecharacter Adiaeresis ^^c4 +\definecharacter OAligature ^^c5 +\definecharacter AEligature ^^c6 +\definecharacter Ccedilla ^^c7 +\definecharacter Egrave ^^c8 +\definecharacter Eacute ^^c9 +\definecharacter Ecircumflex ^^ca +\definecharacter Ediaeresis ^^cb +\definecharacter Igrave ^^cc +\definecharacter Iacute ^^cd +\definecharacter Icircumflex ^^ce +\definecharacter Idiaeresis ^^cf + +\definecharacter Ntilde ^^d1 +\definecharacter Ograve ^^d2 +\definecharacter Oacute ^^d3 +\definecharacter Ocircumflex ^^d4 +\definecharacter Otilde ^^d5 +\definecharacter Odiaeresis ^^d6 + +\definecharacter Ugrave ^^d9 +\definecharacter Uacute ^^da +\definecharacter Ucircumflex ^^db +\definecharacter Udiaeresis ^^dc +\definecharacter Yacute ^^dd + +\definecharacter ssharp ^^df +\definecharacter agrave ^^e0 +\definecharacter aacute ^^e1 +\definecharacter acircumflex ^^e2 +\definecharacter atilde ^^e3 +\definecharacter adiaeresis ^^e4 +\definecharacter oaligature ^^e5 +\definecharacter aeligature ^^e6 +\definecharacter ccedilla ^^e7 +\definecharacter egrave ^^e8 +\definecharacter eacute ^^e9 +\definecharacter ecircumflex ^^ea +\definecharacter ediaeresis ^^eb +\definecharacter igrave ^^ec +\definecharacter iacute ^^ed +\definecharacter icircumflex ^^ee +\definecharacter idiaeresis ^^ef + +\definecharacter ntilde ^^f1 +\definecharacter ograve ^^f2 +\definecharacter oacute ^^f3 +\definecharacter ocircumflex ^^f4 +\definecharacter otilde ^^f5 +\definecharacter odiaeresis ^^f6 + +\definecharacter ugrave ^^f9 +\definecharacter uacute ^^fa +\definecharacter ucircumflex ^^fb +\definecharacter udiaeresis ^^fc +\definecharacter yacute ^^fd + +\definecharacter ydiaeresis ^^ff + +\definecharacter leftsubguillemot {\leftguillemot} +\definecharacter rightsubguillemot {\rightguillemot} + +\definecharacter Uhungarumlaut {\Ucircumflex} +\definecharacter uhungarumlaut {\ucircumflex} +\definecharacter Ohungarumlaut {\Ocircumflex} +\definecharacter ohungarumlaut {\ocircumflex} + +\definecharacter Aogonek {A} +\definecharacter aogonek {a} +\definecharacter Eogonek {E} +\definecharacter eogonek {e} +\definecharacter Iogonek {I} +\definecharacter iogonek {i} +\definecharacter Uogonek {U} +\definecharacter uogonek {u} + +\definecharacter Aring {A} +\definecharacter aring {a} +\definecharacter Uring {U} +\definecharacter uring {u} + +\definecharacter Abreve {A} +\definecharacter abreve {a} +\definecharacter Ebreve {E} +\definecharacter ebreve {e} +\definecharacter Gbreve {G} +\definecharacter gbreve {g} +\definecharacter Ibreve {I} +\definecharacter ibreve {i} +\definecharacter Obreve {O} +\definecharacter obreve {o} +\definecharacter Ubreve {U} +\definecharacter ubreve {u} + +\definecharacter Ccaron {C} +\definecharacter ccaron {c} +\definecharacter Dcaron {D} +\definecharacter dcaron {d} +\definecharacter Ecaron {E} +\definecharacter ecaron {e} +\definecharacter Lcaron {L} +\definecharacter lcaron {l} +\definecharacter Ncaron {N} +\definecharacter ncaron {n} +\definecharacter Rcaron {R} +\definecharacter rcaron {r} +\definecharacter Scaron {S} +\definecharacter scaron {s} +\definecharacter Tcaron {T} +\definecharacter tcaron {t} +\definecharacter Ycaron {Y} +\definecharacter ycaron {y} +\definecharacter Zcaron {Z} +\definecharacter zcaron {z} + +\definecharacter Lstroke {L} +\definecharacter lstroke {l} +\definecharacter Ostroke {O} +\definecharacter ostroke {o} + +\definecharacter aumlaut {\adiaeresis} +\definecharacter eumlaut {\ediaeresis} +\definecharacter iumlaut {\idiaeresis} +\definecharacter oumlaut {\odiaeresis} +\definecharacter uumlaut {\udiaeresis} + +\definecharacter Aumlaut {\Adiaeresis} +\definecharacter Eumlaut {\Ediaeresis} +\definecharacter Iumlaut {\Idiaeresis} +\definecharacter Oumlaut {\Odiaeresis} +\definecharacter Uumlaut {\Udiaeresis} + +\definecharacter scommaaccent {s} +\definecharacter Scommaaccent {S} +\definecharacter tcommaaccent {t} +\definecharacter Tcommaaccent {T} + +\definecharacter Etilde {E} +\definecharacter etilde {e} + +\definecharacter Ahook {A} +\definecharacter ahook {a} +\definecharacter Ehook {E} +\definecharacter ehook {e} +\definecharacter Ihook {I} +\definecharacter ihook {i} +\definecharacter Ohook {O} +\definecharacter ohook {o} +\definecharacter Uhook {U} +\definecharacter uhook {u} +\definecharacter Yhook {Y} +\definecharacter yhook {y} + +\definecharacter Acircumflexgrave {\Acircumflex} +\definecharacter Acircumflexacute {\Acircumflex} +\definecharacter Acircumflextilde {\Acircumflex} +\definecharacter Acircumflexhook {\Acircumflex} +\definecharacter acircumflexgrave {\acircumflex} +\definecharacter acircumflexacute {\acircumflex} +\definecharacter acircumflextilde {\acircumflex} +\definecharacter acircumflexhook {\acircumflex} +\definecharacter Ecircumflexgrave {\Ecircumflex} +\definecharacter Ecircumflexacute {\Ecircumflex} +\definecharacter Ecircumflextilde {\Ecircumflex} +\definecharacter Ecircumflexhook {\Ecircumflex} +\definecharacter ecircumflexgrave {\ecircumflex} +\definecharacter ecircumflexacute {\ecircumflex} +\definecharacter ecircumflextilde {\ecircumflex} +\definecharacter ecircumflexhook {\ecircumflex} +\definecharacter Ocircumflexgrave {\Ocircumflex} +\definecharacter Ocircumflexacute {\Ocircumflex} +\definecharacter Ocircumflextilde {\Ocircumflex} +\definecharacter Ocircumflexhook {\Ocircumflex} +\definecharacter ocircumflexgrave {\ocircumflex} +\definecharacter ocircumflexacute {\ocircumflex} +\definecharacter ocircumflextilde {\ocircumflex} +\definecharacter ocircumflexhook {\ocircumflex} + +\definecharacter Abrevegrave {A} +\definecharacter Abreveacute {A} +\definecharacter Abrevetilde {A} +\definecharacter Abrevehook {A} +\definecharacter abrevegrave {a} +\definecharacter abreveacute {a} +\definecharacter abrevetilde {a} +\definecharacter abrevehook {a} + +\definecharacter Adotbelow {A} +\definecharacter adotbelow {a} +\definecharacter Edotbelow {E} +\definecharacter edotbelow {e} +\definecharacter Idotbelow {I} +\definecharacter idotbelow {i} +\definecharacter Odotbelow {O} +\definecharacter odotbelow {o} +\definecharacter Udotbelow {U} +\definecharacter udotbelow {u} +\definecharacter Ydotbelow {Y} +\definecharacter ydotbelow {y} +\definecharacter Ohorndotbelow {O} +\definecharacter ohorndotbelow {o} +\definecharacter Uhorndotbelow {U} +\definecharacter uhorndotbelow {u} + +\definecharacter Acircumflexdotbelow {\Acircumflex} +\definecharacter acircumflexdotbelow {\acircumflex} +\definecharacter Ecircumflexdotbelow {\Ecircumflex} +\definecharacter ecircumflexdotbelow {\ecircumflex} +\definecharacter Ocircumflexdotbelow {\Ocircumflex} +\definecharacter ocircumflexdotbelow {\ocircumflex} +\definecharacter Abrevedotbelow {\Abreve} +\definecharacter abrevedotbelow {\abreve} + +\definecharacter Ohorn {O} +\definecharacter Ohorngrave {O} +\definecharacter Ohornacute {O} +\definecharacter Ohorntilde {O} +\definecharacter Ohornhook {O} + +\definecharacter ohorn {o} +\definecharacter ohorngrave {o} +\definecharacter ohornacute {o} +\definecharacter ohorntilde {o} +\definecharacter ohornhook {o} + +\definecharacter Uhorn {U} +\definecharacter Uhorngrave {U} +\definecharacter Uhornacute {U} +\definecharacter Uhorntilde {U} +\definecharacter Uhornhook {U} + +\definecharacter uhorn {u} +\definecharacter uhorngrave {u} +\definecharacter uhornacute {u} +\definecharacter uhorntilde {u} +\definecharacter uhornhook {u} + +\definecharacter Utilde {U} +\definecharacter utilde {u} +\definecharacter Itilde {I} +\definecharacter itilde {i} +\definecharacter Ygrave {Y} +\definecharacter ygrave {y} +\definecharacter Ytilde {Y} +\definecharacter ytilde {y} + +\definecharacter dstroke {d} +\definecharacter Dstroke {D} + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-pdf.tex b/tex/context/base/enco-pdf.tex deleted file mode 100644 index a03e81df2..000000000 --- a/tex/context/base/enco-pdf.tex +++ /dev/null @@ -1,278 +0,0 @@ -%D \module -%D [ file=enco-pdf, -%D version=1995.01.01, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=\YandY\ texnansi Encoding, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This is the \PDF\ document encoding. - -\startencoding[pdfdoc] % \rawcharacter{number} - -\definecharacter oeligature ^^9c - -\definecharacter leftguillemot ^^ab -\definecharacter rightguillemot ^^bb - -\definecharacter Agrave ^^c0 -\definecharacter Aacute ^^c1 -\definecharacter Acircumflex ^^c2 -\definecharacter Atilde ^^c3 -\definecharacter Adiaeresis ^^c4 -\definecharacter OAligature ^^c5 -\definecharacter AEligature ^^c6 -\definecharacter Ccedilla ^^c7 -\definecharacter Egrave ^^c8 -\definecharacter Eacute ^^c9 -\definecharacter Ecircumflex ^^ca -\definecharacter Ediaeresis ^^cb -\definecharacter Igrave ^^cc -\definecharacter Iacute ^^cd -\definecharacter Icircumflex ^^ce -\definecharacter Idiaeresis ^^cf - -\definecharacter Ntilde ^^d1 -\definecharacter Ograve ^^d2 -\definecharacter Oacute ^^d3 -\definecharacter Ocircumflex ^^d4 -\definecharacter Otilde ^^d5 -\definecharacter Odiaeresis ^^d6 - -\definecharacter Ugrave ^^d9 -\definecharacter Uacute ^^da -\definecharacter Ucircumflex ^^db -\definecharacter Udiaeresis ^^dc -\definecharacter Yacute ^^dd - -\definecharacter ssharp ^^df -\definecharacter agrave ^^e0 -\definecharacter aacute ^^e1 -\definecharacter acircumflex ^^e2 -\definecharacter atilde ^^e3 -\definecharacter adiaeresis ^^e4 -\definecharacter oaligature ^^e5 -\definecharacter aeligature ^^e6 -\definecharacter ccedilla ^^e7 -\definecharacter egrave ^^e8 -\definecharacter eacute ^^e9 -\definecharacter ecircumflex ^^ea -\definecharacter ediaeresis ^^eb -\definecharacter igrave ^^ec -\definecharacter iacute ^^ed -\definecharacter icircumflex ^^ee -\definecharacter idiaeresis ^^ef - -\definecharacter ntilde ^^f1 -\definecharacter ograve ^^f2 -\definecharacter oacute ^^f3 -\definecharacter ocircumflex ^^f4 -\definecharacter otilde ^^f5 -\definecharacter odiaeresis ^^f6 - -\definecharacter ugrave ^^f9 -\definecharacter uacute ^^fa -\definecharacter ucircumflex ^^fb -\definecharacter udiaeresis ^^fc -\definecharacter yacute ^^fd - -\definecharacter ydiaeresis ^^ff - -\definecharacter leftsubguillemot {\leftguillemot} -\definecharacter rightsubguillemot {\rightguillemot} - -\definecharacter Uhungarumlaut {\Ucircumflex} -\definecharacter uhungarumlaut {\ucircumflex} -\definecharacter Ohungarumlaut {\Ocircumflex} -\definecharacter ohungarumlaut {\ocircumflex} - -\definecharacter Aogonek {A} -\definecharacter aogonek {a} -\definecharacter Eogonek {E} -\definecharacter eogonek {e} -\definecharacter Iogonek {I} -\definecharacter iogonek {i} -\definecharacter Uogonek {U} -\definecharacter uogonek {u} - -\definecharacter Aring {A} -\definecharacter aring {a} -\definecharacter Uring {U} -\definecharacter uring {u} - -\definecharacter Abreve {A} -\definecharacter abreve {a} -\definecharacter Ebreve {E} -\definecharacter ebreve {e} -\definecharacter Gbreve {G} -\definecharacter gbreve {g} -\definecharacter Ibreve {I} -\definecharacter ibreve {i} -\definecharacter Obreve {O} -\definecharacter obreve {o} -\definecharacter Ubreve {U} -\definecharacter ubreve {u} - -\definecharacter Ccaron {C} -\definecharacter ccaron {c} -\definecharacter Dcaron {D} -\definecharacter dcaron {d} -\definecharacter Ecaron {E} -\definecharacter ecaron {e} -\definecharacter Lcaron {L} -\definecharacter lcaron {l} -\definecharacter Ncaron {N} -\definecharacter ncaron {n} -\definecharacter Rcaron {R} -\definecharacter rcaron {r} -\definecharacter Scaron {S} -\definecharacter scaron {s} -\definecharacter Tcaron {T} -\definecharacter tcaron {t} -\definecharacter Ycaron {Y} -\definecharacter ycaron {y} -\definecharacter Zcaron {Z} -\definecharacter zcaron {z} - -\definecharacter Lstroke {L} -\definecharacter lstroke {l} -\definecharacter Ostroke {O} -\definecharacter ostroke {o} - -\definecharacter aumlaut {\adiaeresis} -\definecharacter eumlaut {\ediaeresis} -\definecharacter iumlaut {\idiaeresis} -\definecharacter oumlaut {\odiaeresis} -\definecharacter uumlaut {\udiaeresis} - -\definecharacter Aumlaut {\Adiaeresis} -\definecharacter Eumlaut {\Ediaeresis} -\definecharacter Iumlaut {\Idiaeresis} -\definecharacter Oumlaut {\Odiaeresis} -\definecharacter Uumlaut {\Udiaeresis} - -\definecharacter scommaaccent {s} -\definecharacter Scommaaccent {S} -\definecharacter tcommaaccent {t} -\definecharacter Tcommaaccent {T} - -\definecharacter Etilde {E} -\definecharacter etilde {e} - -\definecharacter Ahook {A} -\definecharacter ahook {a} -\definecharacter Ehook {E} -\definecharacter ehook {e} -\definecharacter Ihook {I} -\definecharacter ihook {i} -\definecharacter Ohook {O} -\definecharacter ohook {o} -\definecharacter Uhook {U} -\definecharacter uhook {u} -\definecharacter Yhook {Y} -\definecharacter yhook {y} - -\definecharacter Acircumflexgrave {\Acircumflex} -\definecharacter Acircumflexacute {\Acircumflex} -\definecharacter Acircumflextilde {\Acircumflex} -\definecharacter Acircumflexhook {\Acircumflex} -\definecharacter acircumflexgrave {\acircumflex} -\definecharacter acircumflexacute {\acircumflex} -\definecharacter acircumflextilde {\acircumflex} -\definecharacter acircumflexhook {\acircumflex} -\definecharacter Ecircumflexgrave {\Ecircumflex} -\definecharacter Ecircumflexacute {\Ecircumflex} -\definecharacter Ecircumflextilde {\Ecircumflex} -\definecharacter Ecircumflexhook {\Ecircumflex} -\definecharacter ecircumflexgrave {\ecircumflex} -\definecharacter ecircumflexacute {\ecircumflex} -\definecharacter ecircumflextilde {\ecircumflex} -\definecharacter ecircumflexhook {\ecircumflex} -\definecharacter Ocircumflexgrave {\Ocircumflex} -\definecharacter Ocircumflexacute {\Ocircumflex} -\definecharacter Ocircumflextilde {\Ocircumflex} -\definecharacter Ocircumflexhook {\Ocircumflex} -\definecharacter ocircumflexgrave {\ocircumflex} -\definecharacter ocircumflexacute {\ocircumflex} -\definecharacter ocircumflextilde {\ocircumflex} -\definecharacter ocircumflexhook {\ocircumflex} - -\definecharacter Abrevegrave {A} -\definecharacter Abreveacute {A} -\definecharacter Abrevetilde {A} -\definecharacter Abrevehook {A} -\definecharacter abrevegrave {a} -\definecharacter abreveacute {a} -\definecharacter abrevetilde {a} -\definecharacter abrevehook {a} - -\definecharacter Adotbelow {A} -\definecharacter adotbelow {a} -\definecharacter Edotbelow {E} -\definecharacter edotbelow {e} -\definecharacter Idotbelow {I} -\definecharacter idotbelow {i} -\definecharacter Odotbelow {O} -\definecharacter odotbelow {o} -\definecharacter Udotbelow {U} -\definecharacter udotbelow {u} -\definecharacter Ydotbelow {Y} -\definecharacter ydotbelow {y} -\definecharacter Ohorndotbelow {O} -\definecharacter ohorndotbelow {o} -\definecharacter Uhorndotbelow {U} -\definecharacter uhorndotbelow {u} - -\definecharacter Acircumflexdotbelow {\Acircumflex} -\definecharacter acircumflexdotbelow {\acircumflex} -\definecharacter Ecircumflexdotbelow {\Ecircumflex} -\definecharacter ecircumflexdotbelow {\ecircumflex} -\definecharacter Ocircumflexdotbelow {\Ocircumflex} -\definecharacter ocircumflexdotbelow {\ocircumflex} -\definecharacter Abrevedotbelow {\Abreve} -\definecharacter abrevedotbelow {\abreve} - -\definecharacter Ohorn {O} -\definecharacter Ohorngrave {O} -\definecharacter Ohornacute {O} -\definecharacter Ohorntilde {O} -\definecharacter Ohornhook {O} - -\definecharacter ohorn {o} -\definecharacter ohorngrave {o} -\definecharacter ohornacute {o} -\definecharacter ohorntilde {o} -\definecharacter ohornhook {o} - -\definecharacter Uhorn {U} -\definecharacter Uhorngrave {U} -\definecharacter Uhornacute {U} -\definecharacter Uhorntilde {U} -\definecharacter Uhornhook {U} - -\definecharacter uhorn {u} -\definecharacter uhorngrave {u} -\definecharacter uhornacute {u} -\definecharacter uhorntilde {u} -\definecharacter uhornhook {u} - -\definecharacter Utilde {U} -\definecharacter utilde {u} -\definecharacter Itilde {I} -\definecharacter itilde {i} -\definecharacter Ygrave {Y} -\definecharacter ygrave {y} -\definecharacter Ytilde {Y} -\definecharacter ytilde {y} - -\definecharacter dstroke {d} -\definecharacter Dstroke {D} - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-pfr.mkii b/tex/context/base/enco-pfr.mkii new file mode 100644 index 000000000..b279e40aa --- /dev/null +++ b/tex/context/base/enco-pfr.mkii @@ -0,0 +1,305 @@ +%D \module +%D [ file=enco-pfr, +%D version=2000.12.10, % adapted 2005.08.14 to more delayed loading +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=PDF Resources, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +\ifnum\texengine>\pdftexengine + \expandafter \endinput +\fi + +\ifdefined\pdffontresource \else + \expandafter \endinput +\fi + +\writestatus{loading}{ConTeXt Encoding Macros / PDF Resources} + +%D This is an experimental module in which we implement +%D font resource inclusion in \PDF. One reason to include +%D font resources is that it enables a search engine to +%D perform a search (I'm told). This feature ws requested by +%D Petr Ferdus from Czech. + +%D A simple test file may look like this (watch how we first +%D load the encoding and then the font; previous font +%D definitions are left untouched.) +%D +%D \starttyping +%D % output=pdftex interface=en +%D +%D \useencoding[pfr] +%D \setupbodyfont[csr] +%D +%D \starttext +%D test \`z \'z \bf test \sl test \bs quite funny \`z \page +%D test \`z \'z \bf test \sl test \bs quite funny \`z \page +%D \stoptext +%D \stoptyping +%D +%D We do our best to include a (often large) font resources +%D only once. The current implementation is not that +%D general which is also due to the fact that \type +%D {\pdffontattr} is expanded instantly and persistent. A +%D more versatile (but also slower) approach is to keep track +%D of the fonts and either flush the information at shipout +%D time, or at the end of the document. + +%D \macros +%D {ifincludepdffontresources} +%D +%D You can turn of this feature using the following switch. + +\newif\ifincludepdffontresources \includepdffontresourcestrue + +\ifx\pdfglyphtounicode\undefined \else + \appendtoks + \doif\jobsuffix{pdf}{\readfile{pdfr-def.mkii}\donothing\donothing}% + \to \everystarttext +\fi + +% somehow we cannot preload this beast; also, it's mk dependent +% +% \appendtoks +% \doifelse{\jobsuffix}{pdf}{\loadmkiifile{pdfr-def.mkii}}% +% \to \everystarttext + +% ugly, this should go to the driver spec-tpd + +\ifx\pdfgentounicode\undefined \else + \ifcase\pdfgentounicode \else + \expandafter \expandafter \expandafter \endinput + \fi +\fi + +\unprotect + +% a problem is that there is always an ec vector added even when +% we switch to texnansi early; this has to do with the fact that +% we need to setup fonts at startup; this a pain when we have +% textless documents, so we should have a way around, i.e. an +% extension to pdftex where we can tag numbers inside user specs +% and attributes. +% +% currently we need to use immediate so we end up with entries + +%D The name of the resource is stored in a macro, as is its +%D object reference. A resource is only processed once. When +%D done, the resource name is erased, and we use this fact to +%D prevent redefinition as well as well as reloading. So, a +%D macro defined with \type {\pdffontfileresource} can have +%D three states: +%D +%D \startitemize[packed] +%D \item undefined: not yet loaded, and not yet included +%D \item some value: loaded, but not yet included +%D \item empty: loaded, and already included +%D \stopitemize + +\def\pdffontresource {pdfr:\currentencoding} +\def\pdffontfileresource{pdff:\pdffontresource} + +%D A resource is defined in a file prefixed by \type {pdfr-}. +%D The following \PDF\ code is composed by Ondrej Koala Vacha (I +%D probably mispelled this name). +%D +%D \starttyping +%D \startpdffontresource[il2] +%D /CIDInit /ProcSet findresource begin +%D 12 dict begin +%D begincmap +%D /CIDSystemInfo +%D << /Registry (Adobe) +%D /Ordering (T1UV) +%D /Supplement 0 +%D >> def +%D /CMapName /Adobe-Identity-UCS def +%D /CMapType 1 def +%D 1 begincodespacerange +%D <00> +%D endcodespacerange +%D %%FontSpecificEncoding +%D 191 beginbfrange +%D <20> <20> <0020> % space dec: 32 oct:040 hex:20 +%D .... .... ...... . ........ .... .. ....... ...... +%D <00ff> % dotaccent dec:255 oct:377 hex:ff +%D endbfrange +%D endcmap +%D CMapName currentdict /CMap defineresource pop end +%D end +%D \stoppdffontresource +%D \stoptyping +%D +%D We don't preload such huge definitions, and process them +%D run||time to save memory. Therefore, in the encoding +%D vector, we only add an entry like: +%D +%D \starttyping +%D \startencoding [il2] +%D \usepdffontresource il2 +%D \stopencoding +%D \stoptyping +%D +%D This macro is defined as follows. + +\def\usepdffontresource #1 % + {\doifundefinedelse\pdffontfileresource % okay, undefined, so either + {\setxvalue\pdffontfileresource{#1}} % brand new, or not yet loaded + {\doifvaluesomething\pdffontfileresource % only if not loaded in which + {\setxvalue\pdffontfileresource{#1}}}} % case it's made empty + +%D Watch how we check for duplicated loading. The resource +%D itself, when asked for, is included immediately, after which +%D we save its reference. Normally a document will have one +%D such a resource. + +% \long\def\startpdffontresource[#1]#2\stoppdffontresource +% {\doif{#1}\currentencoding +% {\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}} + +% alternatively we can use object references + +% fails when we switch back and forward between dvi/pdf mode +% +% \long\def\startpdffontresource[#1]#2\stoppdffontresource +% {\doif{#1}\currentencoding{\doifdefined\pdffontresource +% {\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}}} + +\long\def\startpdffontresource[#1]#2\stoppdffontresource + {\doif{#1}\currentencoding{\doifdefined\pdffontresource + {\expanded{\doshipoutpdffontresource{\getvalue{\pdffontresource}}{#2}}}}} + +\def\doshipoutpdffontresource#1#2% + {\ifnum\realpageno<\plustwo + \doglobal\appendtoks + \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi + \to\everyfirstshipout + \else + \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi + \fi} + +% cleaner but not better: +% +% \newtoks \collectedpdffontresources +% +% \def\doshipoutpdffontresource#1#2% +% {\doglobal\appendtoks +% \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi +% \to \collectedpdffontresources} +% +% \def\dofluspdffontresources +% {\the\collectedpdffontresources +% \global\collectedpdffontresources\emptytoks} +% +% \appendtoks \dofluspdffontresources \to \everybeforeshipout + +%D The reference to such a vector is to be handled at font +%D definition time, which is why we hook it into the font +%D loading routine. A little bit of indirectness speeds up +%D the process when this feature is disabled and keeps the +%D macros readable. + +% \newevery \everyfont \relax + +\appendtoksonce \includepdffontresource \to \everyfont + +% \def\includepdffontresource +% {\ifincludepdffontresources +% \ifx\pdffontattr\undefined +% % we're not using (a recent version of) pdftex +% \else\ifcase\pdfoutput +% % we're not in pdf mode +% \else +% \doincludepdffontresource +% \fi\fi +% \fi} + +\def\includepdffontresource + {\ifx\pdfgentounicode\undefined + \expandafter\ifx\the\font\nullfont \else + \ifx\pdffontattr\undefined + % we're not using (a recent version of) pdftex + \else\ifcase\pdfoutput + % we're not in pdf mode + \else + \doincludepdffontresource + \fi\fi + \fi + \else\ifcase\pdfgentounicode + \ifincludepdffontresources + \expandafter\ifx\the\font\nullfont \else + \ifx\pdffontattr\undefined + % we're not using (a recent version of) pdftex + \else\ifcase\pdfoutput + % we're not in pdf mode + \else + \doincludepdffontresource + \fi\fi + \fi + \fi + \or + \global\let\includepdffontresource\relax % automatic, built in + \fi\fi} + +\def\dododoincludepdffontresource#1% encoding + {\bgroup + \edef\currentencoding{#1}% + \doifvaluesomething\pdffontfileresource + {\startreadingfile + \ignorelines % just in case \par is redefined; this thing can get called anywhere + \readsysfile{pdfr-\getvalue\pdffontfileresource.mkii}\donothing\donothing + \stopreadingfile + \letgvalue\pdffontfileresource\empty}% + \egroup} + +\def\doincludepdffontresource + {\ifcsname\s!ucmap\fontfile\endcsname\else + \dodoincludepdffontresource + \fi} + +\def\dodoincludepdffontresource + {% does this font has an encoding specified vector + \doifsomething\currentencoding % no \ifx + {% is there a pdf font encoding resource file defined + \ifcsname\pdffontresource\endcsname + % (fake) object defined + \else\ifcsname\pdffontfileresource\endcsname + % is there a resource already included + \doifsomething\pdffontfileresource + {\pdfobj reserveobjnum {}% + \setxvalue\pdffontresource{\the\pdflastobj}% + \flushatshipout{\dododoincludepdffontresource{\currentencoding}}}% +% \doglobal\appendetoks +% \noexpand\dododoincludepdffontresource{\currentencoding}% +% \to \everybeforeshipout}% prevent multiple loading + \fi\fi + \ifcsname\pdffontresource\endcsname + \expanded{\pdffontattr\font{/ToUnicode \csname\pdffontresource\endcsname\space0 R}}% + % do it only once for each font + \letgvalue{\s!ucmap\fontfile}\empty + \fi}} + +%D For the moment, we keep this definition here, if only +%D because \type {\usepdffontencoding} is not defined in the +%D core. In the end, this will go to \type {enco-*.tex}. +%D +%D Test: +%D +%D \starttyping +%D \useencoding[pfr] \usetypescript[palatino][ec] \setupbodyfont[palatino] +%D +%D \starttext +%D fi ff ffi +%D \stoptext +%D \stoptyping + +\startencoding [il2] \usepdffontresource il2 \stopencoding +\startencoding [ec] \usepdffontresource ec \stopencoding + +\protect \endinput diff --git a/tex/context/base/enco-pfr.tex b/tex/context/base/enco-pfr.tex deleted file mode 100644 index a90c62352..000000000 --- a/tex/context/base/enco-pfr.tex +++ /dev/null @@ -1,303 +0,0 @@ -%D \module -%D [ file=enco-pfr, -%D version=2000.12.10, % adapted 2005.08.14 to more delayed loading -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=PDF Resources, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -\ifnum\texengine>\pdftexengine - \endinput -\fi - -\ifx\pdffontresource\undefined\else\endinput\fi - -\writestatus{loading}{ConTeXt Encoding Macros / PDF Resources} - -%D This is an experimental module in which we implement -%D font resource inclusion in \PDF. One reason to include -%D font resources is that it enables a search engine to -%D perform a search (I'm told). This feature ws requested by -%D Petr Ferdus from Czech. - -%D A simple test file may look like this (watch how we first -%D load the encoding and then the font; previous font -%D definitions are left untouched.) -%D -%D \starttyping -%D % output=pdftex interface=en -%D -%D \useencoding[pfr] -%D \setupbodyfont[csr] -%D -%D \starttext -%D test \`z \'z \bf test \sl test \bs quite funny \`z \page -%D test \`z \'z \bf test \sl test \bs quite funny \`z \page -%D \stoptext -%D \stoptyping -%D -%D We do our best to include a (often large) font resources -%D only once. The current implementation is not that -%D general which is also due to the fact that \type -%D {\pdffontattr} is expanded instantly and persistent. A -%D more versatile (but also slower) approach is to keep track -%D of the fonts and either flush the information at shipout -%D time, or at the end of the document. - -%D \macros -%D {ifincludepdffontresources} -%D -%D You can turn of this feature using the following switch. - -\newif\ifincludepdffontresources \includepdffontresourcestrue - -\ifx\pdfglyphtounicode\undefined \else - \appendtoks - \doif\jobsuffix{pdf}{\readfile{pdfr-def.tex}\donothing\donothing}% - \to \everystarttext -\fi - -% somehow we cannot preload this beast; also, it's mk dependent -% -% \appendtoks -% \doifelse{\jobsuffix}{pdf}{\loadmkiifile{pdfr-def.tex}}% -% \to \everystarttext - -% ugly, this should go to the driver spec-tpd - -\ifx\pdfgentounicode\undefined \else - \ifcase\pdfgentounicode \else - \expandafter \expandafter \expandafter \endinput - \fi -\fi - -\unprotect - -% a problem is that there is always an ec vector added even when -% we switch to texnansi early; this has to do with the fact that -% we need to setup fonts at startup; this a pain when we have -% textless documents, so we should have a way around, i.e. an -% extension to pdftex where we can tag numbers inside user specs -% and attributes. -% -% currently we need to use immediate so we end up with entries - -%D The name of the resource is stored in a macro, as is its -%D object reference. A resource is only processed once. When -%D done, the resource name is erased, and we use this fact to -%D prevent redefinition as well as well as reloading. So, a -%D macro defined with \type {\pdffontfileresource} can have -%D three states: -%D -%D \startitemize[packed] -%D \item undefined: not yet loaded, and not yet included -%D \item some value: loaded, but not yet included -%D \item empty: loaded, and already included -%D \stopitemize - -\def\pdffontresource {pdfr:\currentencoding} -\def\pdffontfileresource{pdff:\pdffontresource} - -%D A resource is defined in a file prefixed by \type {pdfr-}. -%D The following \PDF\ code is composed by Ondrej Koala Vacha (I -%D probably mispelled this name). -%D -%D \starttyping -%D \startpdffontresource[il2] -%D /CIDInit /ProcSet findresource begin -%D 12 dict begin -%D begincmap -%D /CIDSystemInfo -%D << /Registry (Adobe) -%D /Ordering (T1UV) -%D /Supplement 0 -%D >> def -%D /CMapName /Adobe-Identity-UCS def -%D /CMapType 1 def -%D 1 begincodespacerange -%D <00> -%D endcodespacerange -%D %%FontSpecificEncoding -%D 191 beginbfrange -%D <20> <20> <0020> % space dec: 32 oct:040 hex:20 -%D .... .... ...... . ........ .... .. ....... ...... -%D <00ff> % dotaccent dec:255 oct:377 hex:ff -%D endbfrange -%D endcmap -%D CMapName currentdict /CMap defineresource pop end -%D end -%D \stoppdffontresource -%D \stoptyping -%D -%D We don't preload such huge definitions, and process them -%D run||time to save memory. Therefore, in the encoding -%D vector, we only add an entry like: -%D -%D \starttyping -%D \startencoding [il2] -%D \usepdffontresource il2 -%D \stopencoding -%D \stoptyping -%D -%D This macro is defined as follows. - -\def\usepdffontresource #1 % - {\doifundefinedelse\pdffontfileresource % okay, undefined, so either - {\setxvalue\pdffontfileresource{#1}} % brand new, or not yet loaded - {\doifvaluesomething\pdffontfileresource % only if not loaded in which - {\setxvalue\pdffontfileresource{#1}}}} % case it's made empty - -%D Watch how we check for duplicated loading. The resource -%D itself, when asked for, is included immediately, after which -%D we save its reference. Normally a document will have one -%D such a resource. - -% \long\def\startpdffontresource[#1]#2\stoppdffontresource -% {\doif{#1}\currentencoding -% {\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}} - -% alternatively we can use object references - -% fails when we switch back and forward between dvi/pdf mode -% -% \long\def\startpdffontresource[#1]#2\stoppdffontresource -% {\doif{#1}\currentencoding{\doifdefined\pdffontresource -% {\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}}} - -\long\def\startpdffontresource[#1]#2\stoppdffontresource - {\doif{#1}\currentencoding{\doifdefined\pdffontresource - {\expanded{\doshipoutpdffontresource{\getvalue{\pdffontresource}}{#2}}}}} - -\def\doshipoutpdffontresource#1#2% - {\ifnum\realpageno<\plustwo - \doglobal\appendtoks - \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi - \to\everyfirstshipout - \else - \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi - \fi} - -% cleaner but not better: -% -% \newtoks \collectedpdffontresources -% -% \def\doshipoutpdffontresource#1#2% -% {\doglobal\appendtoks -% \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi -% \to \collectedpdffontresources} -% -% \def\dofluspdffontresources -% {\the\collectedpdffontresources -% \global\collectedpdffontresources\emptytoks} -% -% \appendtoks \dofluspdffontresources \to \everybeforeshipout - -%D The reference to such a vector is to be handled at font -%D definition time, which is why we hook it into the font -%D loading routine. A little bit of indirectness speeds up -%D the process when this feature is disabled and keeps the -%D macros readable. - -% \newevery \everyfont \relax - -\appendtoksonce \includepdffontresource \to \everyfont - -% \def\includepdffontresource -% {\ifincludepdffontresources -% \ifx\pdffontattr\undefined -% % we're not using (a recent version of) pdftex -% \else\ifcase\pdfoutput -% % we're not in pdf mode -% \else -% \doincludepdffontresource -% \fi\fi -% \fi} - -\def\includepdffontresource - {\ifx\pdfgentounicode\undefined - \expandafter\ifx\the\font\nullfont \else - \ifx\pdffontattr\undefined - % we're not using (a recent version of) pdftex - \else\ifcase\pdfoutput - % we're not in pdf mode - \else - \doincludepdffontresource - \fi\fi - \fi - \else\ifcase\pdfgentounicode - \ifincludepdffontresources - \expandafter\ifx\the\font\nullfont \else - \ifx\pdffontattr\undefined - % we're not using (a recent version of) pdftex - \else\ifcase\pdfoutput - % we're not in pdf mode - \else - \doincludepdffontresource - \fi\fi - \fi - \fi - \or - \global\let\includepdffontresource\relax % automatic, built in - \fi\fi} - -\def\dododoincludepdffontresource#1% encoding - {\bgroup - \edef\currentencoding{#1}% - \doifvaluesomething\pdffontfileresource - {\startreadingfile - \ignorelines % just in case \par is redefined; this thing can get called anywhere - \readsysfile{pdfr-\getvalue\pdffontfileresource}\donothing\donothing - \stopreadingfile - \letgvalue\pdffontfileresource\empty}% - \egroup} - -\def\doincludepdffontresource - {\ifcsname\s!ucmap\fontfile\endcsname\else - \dodoincludepdffontresource - \fi} - -\def\dodoincludepdffontresource - {% does this font has an encoding specified vector - \doifsomething\currentencoding % no \ifx - {% is there a pdf font encoding resource file defined - \ifcsname\pdffontresource\endcsname - % (fake) object defined - \else\ifcsname\pdffontfileresource\endcsname - % is there a resource already included - \doifsomething\pdffontfileresource - {\pdfobj reserveobjnum {}% - \setxvalue\pdffontresource{\the\pdflastobj}% - \flushatshipout{\dododoincludepdffontresource{\currentencoding}}}% -% \doglobal\appendetoks -% \noexpand\dododoincludepdffontresource{\currentencoding}% -% \to \everybeforeshipout}% prevent multiple loading - \fi\fi - \ifcsname\pdffontresource\endcsname - \expanded{\pdffontattr\font{/ToUnicode \csname\pdffontresource\endcsname\space0 R}}% - % do it only once for each font - \letgvalue{\s!ucmap\fontfile}\empty - \fi}} - -%D For the moment, we keep this definition here, if only -%D because \type {\usepdffontencoding} is not defined in the -%D core. In the end, this will go to \type {enco-*.tex}. -%D -%D Test: -%D -%D \starttyping -%D \useencoding[pfr] \usetypescript[palatino][ec] \setupbodyfont[palatino] -%D -%D \starttext -%D fi ff ffi -%D \stoptext -%D \stoptyping - -\startencoding [il2] \usepdffontresource il2 \stopencoding -\startencoding [ec] \usepdffontresource ec \stopencoding - -\protect \endinput diff --git a/tex/context/base/enco-pol.mkii b/tex/context/base/enco-pol.mkii new file mode 100644 index 000000000..a012f0370 --- /dev/null +++ b/tex/context/base/enco-pol.mkii @@ -0,0 +1,276 @@ +%D \module +%D [ file=enco-pol, +%D version=2000.05.07, % 1999.28.8, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Polish Mixed Encoding, +%D author={Taco Hoekwater \& Hans Hagen}, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% This encoding will go but the regime will remain. + +%D Polish native encoding; normally polish users will use +%D translate=cp1250pl in combination with ec encoding. + +\startmapping[pl0] + +\resetcaserange 128 to 255 + +\definecaseswap 161 129 % a ogonek +\definecaseswap 162 130 % c acute +\definecaseswap 166 134 % e ogonek +\definecaseswap 170 138 % l crossed +\definecaseswap 171 139 % n acute +\definecaseswap 177 145 % s acute +\definecaseswap 185 153 % z acute +\definecaseswap 187 155 % z dotaccent +\definecaseswap 243 211 % o acute + +% \definecasemap 161 161 129 % a ogonek +% \definecasemap 162 162 130 % c acute +% \definecasemap 166 166 134 % e ogonek +% \definecasemap 170 170 138 % l crossed +% \definecasemap 171 171 139 % n acute +% \definecasemap 177 177 145 % s acute +% \definecasemap 185 185 153 % z acute +% \definecasemap 187 187 155 % z dotaccent +% \definecasemap 243 243 211 % o acute + +% \definecasemap 129 161 129 % A ogonek +% \definecasemap 130 162 130 % C acute +% \definecasemap 134 166 134 % E ogonek +% \definecasemap 138 170 138 % L crossed +% \definecasemap 139 171 139 % N acute +% \definecasemap 145 177 145 % S acute +% \definecasemap 153 185 153 % Z acute +% \definecasemap 155 187 155 % Z dotaccent +% \definecasemap 211 243 211 % O acute + +\stopmapping + +\startmapping[pl0] + +\definespacemap 129 999 % A ogonek +\definespacemap 130 999 % C acute +\definespacemap 134 999 % E ogonek +\definespacemap 138 999 % L crossed +\definespacemap 139 999 % N acute +\definespacemap 211 999 % O acute +\definespacemap 145 999 % S acute +\definespacemap 153 999 % Z acute +\definespacemap 155 999 % Z dot + +\stopmapping + +\startencoding[pl0][pl0] + +\definecharacter Aogonek 129 +\definecharacter Cacute 130 +\definecharacter Eogonek 134 +\definecharacter Lstroke 138 +\definecharacter Nacute 139 +\definecharacter Sacute 145 +\definecharacter Zacute 153 +\definecharacter Zdotaccent 155 +\definecharacter aogonek 161 +\definecharacter cacute 162 +\definecharacter eogonek 166 +\definecharacter lstroke 170 +\definecharacter nacute 171 +\definecharacter sacute 177 +\definecharacter zacute 185 +\definecharacter zdotaccent 187 +\definecharacter Oacute 211 +\definecharacter oacute 243 + +\stopencoding + +\startencoding[pl0][pl0] + +\definecharacter leftguillemot 174 +\definecharacter rightguillemot 175 +\definecharacter guilsingleleft 174 +\definecharacter guilsingleright 175 + +\stopencoding + +% obsolete +% +% \startencoding[pl0] +% +% \definesortkey {161} {a}{a}{\k a} \definesortkey {129} {a}{a}{\k a} +% \definesortkey {162} {c}{a}{\'c} \definesortkey {130} {c}{a}{\'c} +% \definesortkey {166} {e}{a}{\k e} \definesortkey {134} {e}{a}{\k e} +% \definesortkey {170} {l}{a}{\l } \definesortkey {138} {l}{a}{\l } +% \definesortkey {171} {n}{a}{\'n} \definesortkey {139} {n}{a}{\'n} +% \definesortkey {177} {s}{a}{\'s} \definesortkey {145} {s}{a}{\'s} +% \definesortkey {185} {z}{a}{\'z} \definesortkey {153} {z}{a}{\'z} +% \definesortkey {187} {z}{b}{\.z} \definesortkey {155} {z}{b}{\.z} +% \definesortkey {243} {o}{a}{\'o} \definesortkey {211} {o}{a}{\'o} +% +% \definesortkey {\'c} {c}{a}{\'c} \definesortkey {\'C} {c}{a}{\'c} +% \definesortkey {\'n} {n}{a}{\'n} \definesortkey {\'N} {n}{a}{\'n} +% \definesortkey {\'o} {o}{a}{\'o} \definesortkey {\'O} {o}{a}{\'o} +% \definesortkey {\'s} {s}{a}{\'s} \definesortkey {\'S} {s}{a}{\'s} +% \definesortkey {\'z} {z}{a}{\'z} \definesortkey {\'Z} {z}{a}{\'z} +% \definesortkey {\.z} {z}{b}{\.z} \definesortkey {\.Z} {z}{b}{\.z} +% \definesortkey {\k a}{a}{a}{\k a} \definesortkey {\k A}{a}{a}{\k a} +% \definesortkey {\k e}{e}{a}{\k e} \definesortkey {\k E}{e}{a}{\k e} +% \definesortkey {\l } {l}{a}{\l} \definesortkey {\L } {l}{a}{\l} +% +% \stopencoding + +%D Polish CP-1250 encoding. + +% \startmapping[pl1] +% +% +% \resetcaserange 128 to 255 +% +% \definecasemap 185 185 165 % a ogonek +% \definecasemap 230 230 198 % c acute +% \definecasemap 234 234 202 % e ogonek +% \definecasemap 179 179 163 % l crossed +% \definecasemap 241 241 209 % n acute +% \definecasemap 243 243 211 % o acute +% \definecasemap 156 156 140 % s acute +% \definecasemap 159 159 143 % z acute +% \definecasemap 191 191 175 % z dot +% +% \definecasemap 165 165 185 % A ogonek +% \definecasemap 198 198 230 % C acute +% \definecasemap 202 202 234 % E ogonek +% \definecasemap 163 163 179 % L crossed +% \definecasemap 209 209 241 % N acute +% \definecasemap 211 211 243 % O acute +% \definecasemap 140 140 156 % S acute +% \definecasemap 143 143 159 % Z acute +% \definecasemap 175 175 191 % Z dot +% +% \stopmapping +% +% \startmapping[pl1] +% +% \definespacemap 165 999 % A ogonek +% \definespacemap 198 999 % C acute +% \definespacemap 202 999 % E ogonek +% \definespacemap 163 999 % L crossed +% \definespacemap 209 999 % N acute +% \definespacemap 211 999 % O acute +% \definespacemap 140 999 % S acute +% \definespacemap 143 999 % Z acute +% \definespacemap 175 999 % Z dot +% +% \stopmapping +% +% \startencoding[pl1] +% +% \definecharacter Sacute 140 +% \definecharacter Zacute 143 +% \definecharacter sacute 156 +% \definecharacter zacute 159 +% \definecharacter Lstroke 163 +% \definecharacter Aogonek 165 +% \definecharacter Zdotaccent 175 +% \definecharacter lstroke 179 +% \definecharacter aogonek 185 +% \definecharacter zdotaccent 191 +% \definecharacter Cacute 198 +% \definecharacter Eogonek 202 +% \definecharacter Nacute 209 +% \definecharacter Oacute 211 +% \definecharacter cacute 230 +% \definecharacter eogonek 234 +% \definecharacter nacute 241 +% \definecharacter oacute 243 +% +% \stopencoding +% +% \startencoding[pl1] +% +% \definecharacter leftguillemot 174 +% \definecharacter rightguillemot 175 +% \definecharacter guilsingleleft 174 +% \definecharacter guilsingleright 175 +% +% \stopencoding + +%D Polish ISO-8859-2 encoding. + +% \startmapping[pl2] +% +% \resetcaserange 128 to 255 +% +% \definecasemap 177 177 161 % a ogonek +% \definecasemap 230 230 198 % c acute +% \definecasemap 234 234 202 % e ogonek +% \definecasemap 179 179 163 % l crossed +% \definecasemap 241 241 209 % n acute +% \definecasemap 243 243 211 % o acute +% \definecasemap 182 182 166 % s acute +% \definecasemap 188 188 172 % z acute +% \definecasemap 191 191 175 % z dotaccent +% +% \definecasemap 161 161 177 % A ogonek +% \definecasemap 198 198 230 % C acute +% \definecasemap 202 202 234 % E ogonek +% \definecasemap 163 163 179 % L crossed +% \definecasemap 209 209 241 % N acute +% \definecasemap 211 211 243 % O acute +% \definecasemap 166 166 182 % S acute +% \definecasemap 172 172 188 % Z acute +% \definecasemap 175 175 191 % Z dotaccent +% +% \stopmapping +% +% \startmapping[pl2] +% +% \definespacemap 161 999 % A ogonek +% \definespacemap 198 999 % C acute +% \definespacemap 202 999 % E ogonek +% \definespacemap 163 999 % L crossed +% \definespacemap 209 999 % N acute +% \definespacemap 211 999 % O acute +% \definespacemap 166 999 % S acute +% \definespacemap 172 999 % Z acute +% \definespacemap 175 999 % Z dot +% +% \stopmapping +% +% \startencoding[pl2] +% +% \definecharacter Aogonek 161 +% \definecharacter Lstroke 163 +% \definecharacter Sacute 166 +% \definecharacter Zacute 172 +% \definecharacter Zdotaccent 175 +% \definecharacter aogonek 177 +% \definecharacter lstroke 179 +% \definecharacter sacute 182 +% \definecharacter zacute 188 +% \definecharacter zdotaccent 191 +% \definecharacter Cacute 198 +% \definecharacter Eogonek 202 +% \definecharacter Nacute 209 +% \definecharacter Oacute 211 +% \definecharacter cacute 230 +% \definecharacter eogonek 234 +% \definecharacter nacute 241 +% \definecharacter oacute 243 +% +% \stopencoding +% +% \startencoding[pl2] +% +% \definecharacter leftguillemot 174 +% \definecharacter rightguillemot 175 +% \definecharacter guilsingleleft 174 +% \definecharacter guilsingleright 175 +% +% \stopencoding + +\endinput diff --git a/tex/context/base/enco-pol.tex b/tex/context/base/enco-pol.tex deleted file mode 100644 index a012f0370..000000000 --- a/tex/context/base/enco-pol.tex +++ /dev/null @@ -1,276 +0,0 @@ -%D \module -%D [ file=enco-pol, -%D version=2000.05.07, % 1999.28.8, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Polish Mixed Encoding, -%D author={Taco Hoekwater \& Hans Hagen}, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% This encoding will go but the regime will remain. - -%D Polish native encoding; normally polish users will use -%D translate=cp1250pl in combination with ec encoding. - -\startmapping[pl0] - -\resetcaserange 128 to 255 - -\definecaseswap 161 129 % a ogonek -\definecaseswap 162 130 % c acute -\definecaseswap 166 134 % e ogonek -\definecaseswap 170 138 % l crossed -\definecaseswap 171 139 % n acute -\definecaseswap 177 145 % s acute -\definecaseswap 185 153 % z acute -\definecaseswap 187 155 % z dotaccent -\definecaseswap 243 211 % o acute - -% \definecasemap 161 161 129 % a ogonek -% \definecasemap 162 162 130 % c acute -% \definecasemap 166 166 134 % e ogonek -% \definecasemap 170 170 138 % l crossed -% \definecasemap 171 171 139 % n acute -% \definecasemap 177 177 145 % s acute -% \definecasemap 185 185 153 % z acute -% \definecasemap 187 187 155 % z dotaccent -% \definecasemap 243 243 211 % o acute - -% \definecasemap 129 161 129 % A ogonek -% \definecasemap 130 162 130 % C acute -% \definecasemap 134 166 134 % E ogonek -% \definecasemap 138 170 138 % L crossed -% \definecasemap 139 171 139 % N acute -% \definecasemap 145 177 145 % S acute -% \definecasemap 153 185 153 % Z acute -% \definecasemap 155 187 155 % Z dotaccent -% \definecasemap 211 243 211 % O acute - -\stopmapping - -\startmapping[pl0] - -\definespacemap 129 999 % A ogonek -\definespacemap 130 999 % C acute -\definespacemap 134 999 % E ogonek -\definespacemap 138 999 % L crossed -\definespacemap 139 999 % N acute -\definespacemap 211 999 % O acute -\definespacemap 145 999 % S acute -\definespacemap 153 999 % Z acute -\definespacemap 155 999 % Z dot - -\stopmapping - -\startencoding[pl0][pl0] - -\definecharacter Aogonek 129 -\definecharacter Cacute 130 -\definecharacter Eogonek 134 -\definecharacter Lstroke 138 -\definecharacter Nacute 139 -\definecharacter Sacute 145 -\definecharacter Zacute 153 -\definecharacter Zdotaccent 155 -\definecharacter aogonek 161 -\definecharacter cacute 162 -\definecharacter eogonek 166 -\definecharacter lstroke 170 -\definecharacter nacute 171 -\definecharacter sacute 177 -\definecharacter zacute 185 -\definecharacter zdotaccent 187 -\definecharacter Oacute 211 -\definecharacter oacute 243 - -\stopencoding - -\startencoding[pl0][pl0] - -\definecharacter leftguillemot 174 -\definecharacter rightguillemot 175 -\definecharacter guilsingleleft 174 -\definecharacter guilsingleright 175 - -\stopencoding - -% obsolete -% -% \startencoding[pl0] -% -% \definesortkey {161} {a}{a}{\k a} \definesortkey {129} {a}{a}{\k a} -% \definesortkey {162} {c}{a}{\'c} \definesortkey {130} {c}{a}{\'c} -% \definesortkey {166} {e}{a}{\k e} \definesortkey {134} {e}{a}{\k e} -% \definesortkey {170} {l}{a}{\l } \definesortkey {138} {l}{a}{\l } -% \definesortkey {171} {n}{a}{\'n} \definesortkey {139} {n}{a}{\'n} -% \definesortkey {177} {s}{a}{\'s} \definesortkey {145} {s}{a}{\'s} -% \definesortkey {185} {z}{a}{\'z} \definesortkey {153} {z}{a}{\'z} -% \definesortkey {187} {z}{b}{\.z} \definesortkey {155} {z}{b}{\.z} -% \definesortkey {243} {o}{a}{\'o} \definesortkey {211} {o}{a}{\'o} -% -% \definesortkey {\'c} {c}{a}{\'c} \definesortkey {\'C} {c}{a}{\'c} -% \definesortkey {\'n} {n}{a}{\'n} \definesortkey {\'N} {n}{a}{\'n} -% \definesortkey {\'o} {o}{a}{\'o} \definesortkey {\'O} {o}{a}{\'o} -% \definesortkey {\'s} {s}{a}{\'s} \definesortkey {\'S} {s}{a}{\'s} -% \definesortkey {\'z} {z}{a}{\'z} \definesortkey {\'Z} {z}{a}{\'z} -% \definesortkey {\.z} {z}{b}{\.z} \definesortkey {\.Z} {z}{b}{\.z} -% \definesortkey {\k a}{a}{a}{\k a} \definesortkey {\k A}{a}{a}{\k a} -% \definesortkey {\k e}{e}{a}{\k e} \definesortkey {\k E}{e}{a}{\k e} -% \definesortkey {\l } {l}{a}{\l} \definesortkey {\L } {l}{a}{\l} -% -% \stopencoding - -%D Polish CP-1250 encoding. - -% \startmapping[pl1] -% -% -% \resetcaserange 128 to 255 -% -% \definecasemap 185 185 165 % a ogonek -% \definecasemap 230 230 198 % c acute -% \definecasemap 234 234 202 % e ogonek -% \definecasemap 179 179 163 % l crossed -% \definecasemap 241 241 209 % n acute -% \definecasemap 243 243 211 % o acute -% \definecasemap 156 156 140 % s acute -% \definecasemap 159 159 143 % z acute -% \definecasemap 191 191 175 % z dot -% -% \definecasemap 165 165 185 % A ogonek -% \definecasemap 198 198 230 % C acute -% \definecasemap 202 202 234 % E ogonek -% \definecasemap 163 163 179 % L crossed -% \definecasemap 209 209 241 % N acute -% \definecasemap 211 211 243 % O acute -% \definecasemap 140 140 156 % S acute -% \definecasemap 143 143 159 % Z acute -% \definecasemap 175 175 191 % Z dot -% -% \stopmapping -% -% \startmapping[pl1] -% -% \definespacemap 165 999 % A ogonek -% \definespacemap 198 999 % C acute -% \definespacemap 202 999 % E ogonek -% \definespacemap 163 999 % L crossed -% \definespacemap 209 999 % N acute -% \definespacemap 211 999 % O acute -% \definespacemap 140 999 % S acute -% \definespacemap 143 999 % Z acute -% \definespacemap 175 999 % Z dot -% -% \stopmapping -% -% \startencoding[pl1] -% -% \definecharacter Sacute 140 -% \definecharacter Zacute 143 -% \definecharacter sacute 156 -% \definecharacter zacute 159 -% \definecharacter Lstroke 163 -% \definecharacter Aogonek 165 -% \definecharacter Zdotaccent 175 -% \definecharacter lstroke 179 -% \definecharacter aogonek 185 -% \definecharacter zdotaccent 191 -% \definecharacter Cacute 198 -% \definecharacter Eogonek 202 -% \definecharacter Nacute 209 -% \definecharacter Oacute 211 -% \definecharacter cacute 230 -% \definecharacter eogonek 234 -% \definecharacter nacute 241 -% \definecharacter oacute 243 -% -% \stopencoding -% -% \startencoding[pl1] -% -% \definecharacter leftguillemot 174 -% \definecharacter rightguillemot 175 -% \definecharacter guilsingleleft 174 -% \definecharacter guilsingleright 175 -% -% \stopencoding - -%D Polish ISO-8859-2 encoding. - -% \startmapping[pl2] -% -% \resetcaserange 128 to 255 -% -% \definecasemap 177 177 161 % a ogonek -% \definecasemap 230 230 198 % c acute -% \definecasemap 234 234 202 % e ogonek -% \definecasemap 179 179 163 % l crossed -% \definecasemap 241 241 209 % n acute -% \definecasemap 243 243 211 % o acute -% \definecasemap 182 182 166 % s acute -% \definecasemap 188 188 172 % z acute -% \definecasemap 191 191 175 % z dotaccent -% -% \definecasemap 161 161 177 % A ogonek -% \definecasemap 198 198 230 % C acute -% \definecasemap 202 202 234 % E ogonek -% \definecasemap 163 163 179 % L crossed -% \definecasemap 209 209 241 % N acute -% \definecasemap 211 211 243 % O acute -% \definecasemap 166 166 182 % S acute -% \definecasemap 172 172 188 % Z acute -% \definecasemap 175 175 191 % Z dotaccent -% -% \stopmapping -% -% \startmapping[pl2] -% -% \definespacemap 161 999 % A ogonek -% \definespacemap 198 999 % C acute -% \definespacemap 202 999 % E ogonek -% \definespacemap 163 999 % L crossed -% \definespacemap 209 999 % N acute -% \definespacemap 211 999 % O acute -% \definespacemap 166 999 % S acute -% \definespacemap 172 999 % Z acute -% \definespacemap 175 999 % Z dot -% -% \stopmapping -% -% \startencoding[pl2] -% -% \definecharacter Aogonek 161 -% \definecharacter Lstroke 163 -% \definecharacter Sacute 166 -% \definecharacter Zacute 172 -% \definecharacter Zdotaccent 175 -% \definecharacter aogonek 177 -% \definecharacter lstroke 179 -% \definecharacter sacute 182 -% \definecharacter zacute 188 -% \definecharacter zdotaccent 191 -% \definecharacter Cacute 198 -% \definecharacter Eogonek 202 -% \definecharacter Nacute 209 -% \definecharacter Oacute 211 -% \definecharacter cacute 230 -% \definecharacter eogonek 234 -% \definecharacter nacute 241 -% \definecharacter oacute 243 -% -% \stopencoding -% -% \startencoding[pl2] -% -% \definecharacter leftguillemot 174 -% \definecharacter rightguillemot 175 -% \definecharacter guilsingleleft 174 -% \definecharacter guilsingleright 175 -% -% \stopencoding - -\endinput diff --git a/tex/context/base/enco-qx.mkii b/tex/context/base/enco-qx.mkii new file mode 100644 index 000000000..407d60bd7 --- /dev/null +++ b/tex/context/base/enco-qx.mkii @@ -0,0 +1,266 @@ +%D \module +%D [ file=enco-qx, +%D version=2004.04.03, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Polish QX Encoding, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% to be done + +% 35 numbersign +% 95 dotaccent +% 132 greaterequal +% 133 approxequal +% 137 lessequal +% 142 ell +% 156 IJ +% 173 infinity +% 182 threequartersemdash +% 188 ij +% 247 anglearc +% 248 diameter + +\startmapping[qx] % to be done + +\resetcaserange 128 to 128 +\resetcaserange 131 to 133 +\resetcaserange 136 to 137 +\resetcaserange 140 to 144 +\resetcaserange 148 to 148 +\resetcaserange 150 to 150 +\resetcaserange 157 to 160 +\resetcaserange 163 to 165 +\resetcaserange 168 to 169 +\resetcaserange 172 to 176 +\resetcaserange 180 to 180 +\resetcaserange 182 to 182 +\resetcaserange 189 to 191 +\resetcaserange 198 to 198 +\resetcaserange 215 to 216 +\resetcaserange 223 to 223 +\resetcaserange 230 to 230 +\resetcaserange 247 to 248 +\resetcaserange 255 to 255 + +\definecaseswap 161 129 +\definecaseswap 162 130 + +\definecaseswap 166 134 +\definecaseswap 167 135 + +\definecaseswap 170 138 +\definecaseswap 171 139 + +\definecaseswap 177 145 +\definecaseswap 178 146 +\definecaseswap 179 147 + +\definecaseswap 181 149 + +\definecasemaps 151 to 156 lc +32 uc 0 +\definecasemaps 183 to 188 lc 0 uc -32 + +\definecasemaps 192 to 197 lc +32 uc 0 +\definecasemaps 224 to 229 lc 0 uc -32 + +\definecasemaps 199 to 214 lc +32 uc 0 +\definecasemaps 231 to 246 lc 0 uc -32 + +\definecasemaps 217 to 222 lc +32 uc 0 +\definecasemaps 249 to 254 lc 0 uc -32 + +\stopmapping + +\startencoding[qx] + +\definecharacter textacute 19 +\definecharacter textbreve 21 +\definecharacter textcaron 20 +\definecharacter textcedilla 24 +\definecharacter textcircumflex 94 +\definecharacter textdiaeresis 127 +\definecharacter textdotaccent 94 +\definecharacter textgrave 18 +\definecharacter texthungarumlaut 125 +\definecharacter textmacron 22 +\definecharacter textogonek 150 +\definecharacter textring 23 +\definecharacter texttilde 126 + +\definecharacter dotlessi 16 +\definecharacter dotlessj 17 + +\definecharacter endash 123 +\definecharacter emdash 124 + +\definecharacter aeligature 26 +\definecharacter AEligature 29 +\definecharacter oeligature 27 +\definecharacter OEligature 30 + +\definecharacter ssharp 25 +%definecharacter Ssharp 25 + +\definecharacter thorn 254 +\definecharacter Thorn 222 + +\definecharacter Dstroke 208 % also Eth, mapped into enco-def +\definecharacter eth 240 + +\definecharacter exclamdown 60 +\definecharacter questiondown 62 + +\definecharacter sectionmark 159 + +\definecharacter percent 37 +\definecharacter perthousand 216 + +\definecharacter textasciicircum 141 +\definecharacter textasciitilde 140 +\definecharacter textbackslash 198 +\definecharacter textbraceleft 157 +\definecharacter textbraceright 158 +\definecharacter textunderscore 230 + +\definecharacter textcurrency 215 +\definecharacter textdollar 36 +\definecharacter texteuro 128 + +\definecharacter periodcentered 189 +\definecharacter textdag 143 +\definecharacter textddag 144 +\definecharacter textdegree 148 +\definecharacter textbullet 180 + +\definecharacter paragraphmark 176 + +\definecharacter copyright 164 +\definecharacter registered 163 + +\definecharacter textbrokenbar 223 +\definecharacter textellipsis 8 +\definecharacter textslash 47 +\definecharacter textpm 172 +\definecharacter textdiv 165 +\definecharacter textminus 168 +\definecharacter textmultiply 169 +\definecharacter textmu 7 + +\definecharacter quotedbl 190 +\definecharacter quotedblbase 255 +\definecharacter quotedblleft 92 +\definecharacter quotedblright 34 + +\definecharacter quotesingle 191 + +\definecharacter quoteleft 96 +\definecharacter quoteright 39 + +\definecharacter leftguillemot 174 +\definecharacter rightguillemot 175 + +\definecharacter aacute 225 +\definecharacter Aacute 193 +\definecharacter cacute 162 +\definecharacter Cacute 130 +\definecharacter eacute 233 +\definecharacter Eacute 201 +\definecharacter iacute 237 +\definecharacter Iacute 205 +\definecharacter Nacute 139 +\definecharacter Oacute 211 +\definecharacter nacute 171 +\definecharacter oacute 243 +\definecharacter sacute 177 +\definecharacter Sacute 145 +\definecharacter uacute 250 +\definecharacter Uacute 218 +\definecharacter yacute 253 +\definecharacter Yacute 221 +\definecharacter zacute 185 +\definecharacter Zacute 153 + +\definecharacter scaron 178 +\definecharacter Scaron 146 +\definecharacter zcaron 186 +\definecharacter Zcaron 154 + +\definecharacter ccedilla 231 +\definecharacter Ccedilla 199 + +\definecharacter acircumflex 226 +\definecharacter Acircumflex 194 +\definecharacter ecircumflex 234 +\definecharacter Ecircumflex 202 +\definecharacter icircumflex 238 +\definecharacter Icircumflex 206 +\definecharacter ocircumflex 244 +\definecharacter Ocircumflex 212 +\definecharacter ucircumflex 251 +\definecharacter Ucircumflex 219 + +\definecharacter adiaeresis 228 +\definecharacter Adiaeresis 196 +\definecharacter ediaeresis 235 +\definecharacter Ediaeresis 203 +\definecharacter idiaeresis 239 +\definecharacter Idiaeresis 207 +\definecharacter odiaeresis 246 +\definecharacter Odiaeresis 214 +\definecharacter udiaeresis 252 +\definecharacter Udiaeresis 220 +\definecharacter ydiaeresis 184 +\definecharacter Ydiaeresis 152 + +\definecharacter zdotaccent 187 +\definecharacter Zdotaccent 155 + +\definecharacter agrave 224 +\definecharacter Agrave 192 +\definecharacter egrave 232 +\definecharacter Egrave 200 +\definecharacter igrave 236 +\definecharacter Igrave 204 +\definecharacter ograve 242 +\definecharacter Ograve 210 +\definecharacter ugrave 249 +\definecharacter Ugrave 217 + +\definecharacter aogonek 161 +\definecharacter Aogonek 129 +\definecharacter eogonek 166 +\definecharacter Eogonek 134 +\definecharacter iogonek 167 +\definecharacter Iogonek 135 +\definecharacter uogonek 183 +\definecharacter Uogonek 151 + +\definecharacter aring 229 +\definecharacter Aring 197 + +\definecharacter lstroke 170 +\definecharacter Lstroke 138 +\definecharacter ostroke 28 +\definecharacter Ostroke 31 + +\definecharacter atilde 227 +\definecharacter Atilde 195 +\definecharacter ntilde 241 +\definecharacter Ntilde 209 +\definecharacter otilde 245 +\definecharacter Otilde 213 + +\definecharacter scommaaccent 179 +\definecharacter Scommaaccent 147 +\definecharacter tcommaaccent 181 +\definecharacter Tcommaaccent 149 + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-qx.tex b/tex/context/base/enco-qx.tex deleted file mode 100644 index 407d60bd7..000000000 --- a/tex/context/base/enco-qx.tex +++ /dev/null @@ -1,266 +0,0 @@ -%D \module -%D [ file=enco-qx, -%D version=2004.04.03, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Polish QX Encoding, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% to be done - -% 35 numbersign -% 95 dotaccent -% 132 greaterequal -% 133 approxequal -% 137 lessequal -% 142 ell -% 156 IJ -% 173 infinity -% 182 threequartersemdash -% 188 ij -% 247 anglearc -% 248 diameter - -\startmapping[qx] % to be done - -\resetcaserange 128 to 128 -\resetcaserange 131 to 133 -\resetcaserange 136 to 137 -\resetcaserange 140 to 144 -\resetcaserange 148 to 148 -\resetcaserange 150 to 150 -\resetcaserange 157 to 160 -\resetcaserange 163 to 165 -\resetcaserange 168 to 169 -\resetcaserange 172 to 176 -\resetcaserange 180 to 180 -\resetcaserange 182 to 182 -\resetcaserange 189 to 191 -\resetcaserange 198 to 198 -\resetcaserange 215 to 216 -\resetcaserange 223 to 223 -\resetcaserange 230 to 230 -\resetcaserange 247 to 248 -\resetcaserange 255 to 255 - -\definecaseswap 161 129 -\definecaseswap 162 130 - -\definecaseswap 166 134 -\definecaseswap 167 135 - -\definecaseswap 170 138 -\definecaseswap 171 139 - -\definecaseswap 177 145 -\definecaseswap 178 146 -\definecaseswap 179 147 - -\definecaseswap 181 149 - -\definecasemaps 151 to 156 lc +32 uc 0 -\definecasemaps 183 to 188 lc 0 uc -32 - -\definecasemaps 192 to 197 lc +32 uc 0 -\definecasemaps 224 to 229 lc 0 uc -32 - -\definecasemaps 199 to 214 lc +32 uc 0 -\definecasemaps 231 to 246 lc 0 uc -32 - -\definecasemaps 217 to 222 lc +32 uc 0 -\definecasemaps 249 to 254 lc 0 uc -32 - -\stopmapping - -\startencoding[qx] - -\definecharacter textacute 19 -\definecharacter textbreve 21 -\definecharacter textcaron 20 -\definecharacter textcedilla 24 -\definecharacter textcircumflex 94 -\definecharacter textdiaeresis 127 -\definecharacter textdotaccent 94 -\definecharacter textgrave 18 -\definecharacter texthungarumlaut 125 -\definecharacter textmacron 22 -\definecharacter textogonek 150 -\definecharacter textring 23 -\definecharacter texttilde 126 - -\definecharacter dotlessi 16 -\definecharacter dotlessj 17 - -\definecharacter endash 123 -\definecharacter emdash 124 - -\definecharacter aeligature 26 -\definecharacter AEligature 29 -\definecharacter oeligature 27 -\definecharacter OEligature 30 - -\definecharacter ssharp 25 -%definecharacter Ssharp 25 - -\definecharacter thorn 254 -\definecharacter Thorn 222 - -\definecharacter Dstroke 208 % also Eth, mapped into enco-def -\definecharacter eth 240 - -\definecharacter exclamdown 60 -\definecharacter questiondown 62 - -\definecharacter sectionmark 159 - -\definecharacter percent 37 -\definecharacter perthousand 216 - -\definecharacter textasciicircum 141 -\definecharacter textasciitilde 140 -\definecharacter textbackslash 198 -\definecharacter textbraceleft 157 -\definecharacter textbraceright 158 -\definecharacter textunderscore 230 - -\definecharacter textcurrency 215 -\definecharacter textdollar 36 -\definecharacter texteuro 128 - -\definecharacter periodcentered 189 -\definecharacter textdag 143 -\definecharacter textddag 144 -\definecharacter textdegree 148 -\definecharacter textbullet 180 - -\definecharacter paragraphmark 176 - -\definecharacter copyright 164 -\definecharacter registered 163 - -\definecharacter textbrokenbar 223 -\definecharacter textellipsis 8 -\definecharacter textslash 47 -\definecharacter textpm 172 -\definecharacter textdiv 165 -\definecharacter textminus 168 -\definecharacter textmultiply 169 -\definecharacter textmu 7 - -\definecharacter quotedbl 190 -\definecharacter quotedblbase 255 -\definecharacter quotedblleft 92 -\definecharacter quotedblright 34 - -\definecharacter quotesingle 191 - -\definecharacter quoteleft 96 -\definecharacter quoteright 39 - -\definecharacter leftguillemot 174 -\definecharacter rightguillemot 175 - -\definecharacter aacute 225 -\definecharacter Aacute 193 -\definecharacter cacute 162 -\definecharacter Cacute 130 -\definecharacter eacute 233 -\definecharacter Eacute 201 -\definecharacter iacute 237 -\definecharacter Iacute 205 -\definecharacter Nacute 139 -\definecharacter Oacute 211 -\definecharacter nacute 171 -\definecharacter oacute 243 -\definecharacter sacute 177 -\definecharacter Sacute 145 -\definecharacter uacute 250 -\definecharacter Uacute 218 -\definecharacter yacute 253 -\definecharacter Yacute 221 -\definecharacter zacute 185 -\definecharacter Zacute 153 - -\definecharacter scaron 178 -\definecharacter Scaron 146 -\definecharacter zcaron 186 -\definecharacter Zcaron 154 - -\definecharacter ccedilla 231 -\definecharacter Ccedilla 199 - -\definecharacter acircumflex 226 -\definecharacter Acircumflex 194 -\definecharacter ecircumflex 234 -\definecharacter Ecircumflex 202 -\definecharacter icircumflex 238 -\definecharacter Icircumflex 206 -\definecharacter ocircumflex 244 -\definecharacter Ocircumflex 212 -\definecharacter ucircumflex 251 -\definecharacter Ucircumflex 219 - -\definecharacter adiaeresis 228 -\definecharacter Adiaeresis 196 -\definecharacter ediaeresis 235 -\definecharacter Ediaeresis 203 -\definecharacter idiaeresis 239 -\definecharacter Idiaeresis 207 -\definecharacter odiaeresis 246 -\definecharacter Odiaeresis 214 -\definecharacter udiaeresis 252 -\definecharacter Udiaeresis 220 -\definecharacter ydiaeresis 184 -\definecharacter Ydiaeresis 152 - -\definecharacter zdotaccent 187 -\definecharacter Zdotaccent 155 - -\definecharacter agrave 224 -\definecharacter Agrave 192 -\definecharacter egrave 232 -\definecharacter Egrave 200 -\definecharacter igrave 236 -\definecharacter Igrave 204 -\definecharacter ograve 242 -\definecharacter Ograve 210 -\definecharacter ugrave 249 -\definecharacter Ugrave 217 - -\definecharacter aogonek 161 -\definecharacter Aogonek 129 -\definecharacter eogonek 166 -\definecharacter Eogonek 134 -\definecharacter iogonek 167 -\definecharacter Iogonek 135 -\definecharacter uogonek 183 -\definecharacter Uogonek 151 - -\definecharacter aring 229 -\definecharacter Aring 197 - -\definecharacter lstroke 170 -\definecharacter Lstroke 138 -\definecharacter ostroke 28 -\definecharacter Ostroke 31 - -\definecharacter atilde 227 -\definecharacter Atilde 195 -\definecharacter ntilde 241 -\definecharacter Ntilde 209 -\definecharacter otilde 245 -\definecharacter Otilde 213 - -\definecharacter scommaaccent 179 -\definecharacter Scommaaccent 147 -\definecharacter tcommaaccent 181 -\definecharacter Tcommaaccent 149 - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-raw.mkii b/tex/context/base/enco-raw.mkii new file mode 100644 index 000000000..e3a46e3d7 --- /dev/null +++ b/tex/context/base/enco-raw.mkii @@ -0,0 +1,119 @@ +% default instelbaar maken: \enableencoding[main][fallback] + +\startencoding[raw] + +\definecharacter Acircumflex {A} \definecharacter acircumflex {a} +\definecharacter Ccircumflex {C} \definecharacter ccircumflex {c} +\definecharacter Ecircumflex {E} \definecharacter ecircumflex {e} +\definecharacter Gcircumflex {G} \definecharacter gcircumflex {g} +\definecharacter Hcircumflex {H} \definecharacter hcircumflex {h} +\definecharacter Icircumflex {I} \definecharacter icircumflex {i} +\definecharacter Jcircumflex {J} \definecharacter jcircumflex {j} +\definecharacter Ocircumflex {O} \definecharacter ocircumflex {o} +\definecharacter Scircumflex {S} \definecharacter scircumflex {s} +\definecharacter Ucircumflex {U} \definecharacter ucircumflex {u} +\definecharacter Wcircumflex {W} \definecharacter wcircumflex {w} +\definecharacter Ycircumflex {Y} \definecharacter ycircumflex {y} + +\definecharacter Agrave {A} \definecharacter agrave {a} +\definecharacter Egrave {E} \definecharacter egrave {e} +\definecharacter Igrave {I} \definecharacter igrave {i} +\definecharacter Ograve {O} \definecharacter ograve {o} +\definecharacter Ugrave {U} \definecharacter ugrave {u} +\definecharacter Ygrave {Y} \definecharacter ygrave {y} + +\definecharacter Atilde {A} \definecharacter atilde {a} +\definecharacter Itilde {I} \definecharacter itilde {i} +\definecharacter Otilde {O} \definecharacter otilde {o} +\definecharacter Utilde {U} \definecharacter utilde {u} +\definecharacter Utilde {N} \definecharacter utilde {n} + +\definecharacter Adiaeresis {A} \definecharacter adiaeresis {a} +\definecharacter Ediaeresis {E} \definecharacter ediaeresis {e} +\definecharacter Idiaeresis {I} \definecharacter idiaeresis {i} +\definecharacter Odiaeresis {O} \definecharacter odiaeresis {o} +\definecharacter Udiaeresis {U} \definecharacter udiaeresis {u} +\definecharacter Ydiaeresis {Y} \definecharacter ydiaeresis {y} + +\definecharacter Aacute {A} \definecharacter aacute {a} +\definecharacter Cacute {C} \definecharacter cacute {c} +\definecharacter Eacute {E} \definecharacter eacute {e} +\definecharacter Iacute {I} \definecharacter iacute {i} +\definecharacter Lacute {L} \definecharacter lacute {l} +\definecharacter Nacute {N} \definecharacter nacute {n} +\definecharacter Oacute {O} \definecharacter oacute {o} +\definecharacter Racute {R} \definecharacter racute {r} +\definecharacter Sacute {S} \definecharacter sacute {s} +\definecharacter Uacute {U} \definecharacter uacute {u} +\definecharacter Yacute {Y} \definecharacter yacute {y} +\definecharacter Zacute {Z} \definecharacter zacute {z} + +\definecharacter Dstroke {D} \definecharacter dstroke {d} +\definecharacter Hstroke {H} \definecharacter hstroke {h} +\definecharacter Tstroke {T} \definecharacter tstroke {t} + +\definecharacter Cdotaccent {C} \definecharacter cdotaccent {c} +\definecharacter Edotaccent {E} \definecharacter edotaccent {e} +\definecharacter Gdotaccent {G} \definecharacter gdotaccent {g} +\definecharacter Idotaccent {I} \definecharacter idotaccent {i} +\definecharacter Zdotaccent {Z} \definecharacter zdotaccent {z} + +\definecharacter Amacron {A} \definecharacter amacron {a} +\definecharacter Emacron {E} \definecharacter emacron {e} +\definecharacter Imacron {I} \definecharacter imacron {i} +\definecharacter Omacron {O} \definecharacter omacron {o} +\definecharacter Umacron {U} \definecharacter umacron {u} + +\definecharacter Ccedilla {C} \definecharacter ccedilla {c} +\definecharacter Kcedilla {K} \definecharacter kcedilla {k} +\definecharacter Lcedilla {L} \definecharacter lcedilla {l} +\definecharacter Ncedilla {N} \definecharacter ncedilla {n} +\definecharacter Rcedilla {R} \definecharacter rcedilla {r} +\definecharacter Scedilla {S} \definecharacter scedilla {s} +\definecharacter Tcedilla {T} \definecharacter tcedilla {t} + +\definecharacter Ohungarumlaut {O} \definecharacter ohungarumlaut {o} +\definecharacter Uhungarumlaut {U} \definecharacter uhungarumlaut {u} + +\definecharacter Aogonek {A} \definecharacter aogonek {a} +\definecharacter Eogonek {E} \definecharacter eogonek {e} +\definecharacter Iogonek {I} \definecharacter iogonek {i} +\definecharacter Uogonek {U} \definecharacter uogonek {u} + +\definecharacter Aring {A} \definecharacter aring {a} +\definecharacter Uring {U} \definecharacter uring {u} + +\definecharacter Abreve {A} \definecharacter abreve {a} +\definecharacter Ebreve {E} \definecharacter ebreve {e} +\definecharacter Gbreve {G} \definecharacter gbreve {g} +\definecharacter Ibreve {I} \definecharacter ibreve {i} +\definecharacter Obreve {O} \definecharacter obreve {o} +\definecharacter Ubreve {U} \definecharacter ubreve {u} + +\definecharacter Ccaron {C} \definecharacter ccaron {c} +\definecharacter Dcaron {D} \definecharacter dcaron {d} +\definecharacter Ecaron {E} \definecharacter ecaron {e} +\definecharacter Lcaron {L} \definecharacter lcaron {l} +\definecharacter Ncaron {N} \definecharacter ncaron {n} +\definecharacter Rcaron {R} \definecharacter rcaron {r} +\definecharacter Scaron {S} \definecharacter scaron {s} +\definecharacter Tcaron {T} \definecharacter tcaron {t} +\definecharacter Zcaron {Z} \definecharacter zcaron {z} + +\definecharacter dotlessI {I} \definecharacter dotlessi {i} +\definecharacter dotlessJ {J} \definecharacter dotlessj {j} + +\definecharacter AEligature {AE} \definecharacter aeligature {ae} +\definecharacter Lstroke {L} \definecharacter lstroke {l} +\definecharacter Ostroke {O} \definecharacter ostroke {o} +\definecharacter OEligature {OE} \definecharacter oeligature {oe} +\definecharacter Ssharp {SS} \definecharacter ssharp {ss} +\definecharacter IJligature {IJ} \definecharacter ijligature {ij} + +\definecharacter Aumlaut {A} \definecharacter aumlaut {a} +\definecharacter Eumlaut {E} \definecharacter eumlaut {e} +\definecharacter Iumlaut {I} \definecharacter iumlaut {i} +\definecharacter Oumlaut {O} \definecharacter oumlaut {o} +\definecharacter Uumlaut {U} \definecharacter uumlaut {u} + +\stopencoding diff --git a/tex/context/base/enco-raw.tex b/tex/context/base/enco-raw.tex deleted file mode 100644 index e3a46e3d7..000000000 --- a/tex/context/base/enco-raw.tex +++ /dev/null @@ -1,119 +0,0 @@ -% default instelbaar maken: \enableencoding[main][fallback] - -\startencoding[raw] - -\definecharacter Acircumflex {A} \definecharacter acircumflex {a} -\definecharacter Ccircumflex {C} \definecharacter ccircumflex {c} -\definecharacter Ecircumflex {E} \definecharacter ecircumflex {e} -\definecharacter Gcircumflex {G} \definecharacter gcircumflex {g} -\definecharacter Hcircumflex {H} \definecharacter hcircumflex {h} -\definecharacter Icircumflex {I} \definecharacter icircumflex {i} -\definecharacter Jcircumflex {J} \definecharacter jcircumflex {j} -\definecharacter Ocircumflex {O} \definecharacter ocircumflex {o} -\definecharacter Scircumflex {S} \definecharacter scircumflex {s} -\definecharacter Ucircumflex {U} \definecharacter ucircumflex {u} -\definecharacter Wcircumflex {W} \definecharacter wcircumflex {w} -\definecharacter Ycircumflex {Y} \definecharacter ycircumflex {y} - -\definecharacter Agrave {A} \definecharacter agrave {a} -\definecharacter Egrave {E} \definecharacter egrave {e} -\definecharacter Igrave {I} \definecharacter igrave {i} -\definecharacter Ograve {O} \definecharacter ograve {o} -\definecharacter Ugrave {U} \definecharacter ugrave {u} -\definecharacter Ygrave {Y} \definecharacter ygrave {y} - -\definecharacter Atilde {A} \definecharacter atilde {a} -\definecharacter Itilde {I} \definecharacter itilde {i} -\definecharacter Otilde {O} \definecharacter otilde {o} -\definecharacter Utilde {U} \definecharacter utilde {u} -\definecharacter Utilde {N} \definecharacter utilde {n} - -\definecharacter Adiaeresis {A} \definecharacter adiaeresis {a} -\definecharacter Ediaeresis {E} \definecharacter ediaeresis {e} -\definecharacter Idiaeresis {I} \definecharacter idiaeresis {i} -\definecharacter Odiaeresis {O} \definecharacter odiaeresis {o} -\definecharacter Udiaeresis {U} \definecharacter udiaeresis {u} -\definecharacter Ydiaeresis {Y} \definecharacter ydiaeresis {y} - -\definecharacter Aacute {A} \definecharacter aacute {a} -\definecharacter Cacute {C} \definecharacter cacute {c} -\definecharacter Eacute {E} \definecharacter eacute {e} -\definecharacter Iacute {I} \definecharacter iacute {i} -\definecharacter Lacute {L} \definecharacter lacute {l} -\definecharacter Nacute {N} \definecharacter nacute {n} -\definecharacter Oacute {O} \definecharacter oacute {o} -\definecharacter Racute {R} \definecharacter racute {r} -\definecharacter Sacute {S} \definecharacter sacute {s} -\definecharacter Uacute {U} \definecharacter uacute {u} -\definecharacter Yacute {Y} \definecharacter yacute {y} -\definecharacter Zacute {Z} \definecharacter zacute {z} - -\definecharacter Dstroke {D} \definecharacter dstroke {d} -\definecharacter Hstroke {H} \definecharacter hstroke {h} -\definecharacter Tstroke {T} \definecharacter tstroke {t} - -\definecharacter Cdotaccent {C} \definecharacter cdotaccent {c} -\definecharacter Edotaccent {E} \definecharacter edotaccent {e} -\definecharacter Gdotaccent {G} \definecharacter gdotaccent {g} -\definecharacter Idotaccent {I} \definecharacter idotaccent {i} -\definecharacter Zdotaccent {Z} \definecharacter zdotaccent {z} - -\definecharacter Amacron {A} \definecharacter amacron {a} -\definecharacter Emacron {E} \definecharacter emacron {e} -\definecharacter Imacron {I} \definecharacter imacron {i} -\definecharacter Omacron {O} \definecharacter omacron {o} -\definecharacter Umacron {U} \definecharacter umacron {u} - -\definecharacter Ccedilla {C} \definecharacter ccedilla {c} -\definecharacter Kcedilla {K} \definecharacter kcedilla {k} -\definecharacter Lcedilla {L} \definecharacter lcedilla {l} -\definecharacter Ncedilla {N} \definecharacter ncedilla {n} -\definecharacter Rcedilla {R} \definecharacter rcedilla {r} -\definecharacter Scedilla {S} \definecharacter scedilla {s} -\definecharacter Tcedilla {T} \definecharacter tcedilla {t} - -\definecharacter Ohungarumlaut {O} \definecharacter ohungarumlaut {o} -\definecharacter Uhungarumlaut {U} \definecharacter uhungarumlaut {u} - -\definecharacter Aogonek {A} \definecharacter aogonek {a} -\definecharacter Eogonek {E} \definecharacter eogonek {e} -\definecharacter Iogonek {I} \definecharacter iogonek {i} -\definecharacter Uogonek {U} \definecharacter uogonek {u} - -\definecharacter Aring {A} \definecharacter aring {a} -\definecharacter Uring {U} \definecharacter uring {u} - -\definecharacter Abreve {A} \definecharacter abreve {a} -\definecharacter Ebreve {E} \definecharacter ebreve {e} -\definecharacter Gbreve {G} \definecharacter gbreve {g} -\definecharacter Ibreve {I} \definecharacter ibreve {i} -\definecharacter Obreve {O} \definecharacter obreve {o} -\definecharacter Ubreve {U} \definecharacter ubreve {u} - -\definecharacter Ccaron {C} \definecharacter ccaron {c} -\definecharacter Dcaron {D} \definecharacter dcaron {d} -\definecharacter Ecaron {E} \definecharacter ecaron {e} -\definecharacter Lcaron {L} \definecharacter lcaron {l} -\definecharacter Ncaron {N} \definecharacter ncaron {n} -\definecharacter Rcaron {R} \definecharacter rcaron {r} -\definecharacter Scaron {S} \definecharacter scaron {s} -\definecharacter Tcaron {T} \definecharacter tcaron {t} -\definecharacter Zcaron {Z} \definecharacter zcaron {z} - -\definecharacter dotlessI {I} \definecharacter dotlessi {i} -\definecharacter dotlessJ {J} \definecharacter dotlessj {j} - -\definecharacter AEligature {AE} \definecharacter aeligature {ae} -\definecharacter Lstroke {L} \definecharacter lstroke {l} -\definecharacter Ostroke {O} \definecharacter ostroke {o} -\definecharacter OEligature {OE} \definecharacter oeligature {oe} -\definecharacter Ssharp {SS} \definecharacter ssharp {ss} -\definecharacter IJligature {IJ} \definecharacter ijligature {ij} - -\definecharacter Aumlaut {A} \definecharacter aumlaut {a} -\definecharacter Eumlaut {E} \definecharacter eumlaut {e} -\definecharacter Iumlaut {I} \definecharacter iumlaut {i} -\definecharacter Oumlaut {O} \definecharacter oumlaut {o} -\definecharacter Uumlaut {U} \definecharacter uumlaut {u} - -\stopencoding diff --git a/tex/context/base/enco-run.mkii b/tex/context/base/enco-run.mkii new file mode 100644 index 000000000..50fb52e15 --- /dev/null +++ b/tex/context/base/enco-run.mkii @@ -0,0 +1,149 @@ +%D \module +%D [ file=enco-run, +%D version=2000.27.12, % moved to runtime module +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen \& Ton Otten] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\gdef\visualizecharacters% {}'s needed + {\def\uchar##1##2{\hbox to 2.5em + {\ifcase##1\relax\red\or\blue\else\green\fi##1\hss##2}}% + \let\normalbuildtextaccent\buildtextaccent + \let\normalbottomaccent \bottomaccent + %\def\char{\green\normalchar}% + \def\char % can be used in \oalign + {\bgroup\def\char{\green\normalchar\scratchcounter\egroup}% + \afterassignment\char\scratchcounter}% + \def\buildtextaccent{\let\green\empty\blue\normalbuildtextaccent}% + \def\bottomaccent{\let\green\empty\red\normalbottomaccent}} + +\unexpanded\gdef\visualizecharacterslegend + {\hbox + {\edef\banner{\currentencoding\space\fontname\font}% + \tttf\banner:\space + {\blue composed}\space{\red bottom}\space{\green char}\space raw}} + +\gdef\showaccents + {\bgroup + \savefont + \setuptextrules[\c!bodyfont=,\c!style=] + \starttextrule{\visualizecharacterslegend} + \whitespace + \restorefont\setupinterlinespace + \visualizecharacters + \def\do##1% + {{\def\dodo####1% + {\hss\hbox to 1em{\hss\expanded{##1####1\recurselevel}\hss}}% + \hbox to \hsize + {\strut + \localcolortrue + \hbox to 2em{\tttf\string##1\hss}% + \dorecurse{26}{\dodo\character}}% + \hbox to \hsize + {\strut + \localcolortrue + \hskip2em + \dorecurse{26}{\dodo\Character}}}% + \par} + \do\'\do\`\do\^\do\~\do\" + \do\H\do\r\do\v\do\u\do\= + \do\.\do\b\do\d\do\k\do\c + \stoptextrule + \egroup} + +\gdef\showcharacters + {\bgroup + \savefont + \setuptextrules[\c!bodyfont=,\c!style=] + \starttextrule{\visualizecharacterslegend} + \whitespace + \dontcomplain + \forgetall + \def\startencoding[##1]{} + \def\stopencoding{\endinput} + \dimen0=\zeropoint + \dimen2=\zeropoint + \def\definecharacter ##1 ##2 % + {\setbox0=\hbox spread 1em{\getvalue{##1}}% + \ifdim\wd0>\dimen0 \dimen0=\wd0 \fi + \setbox2=\hbox spread 1em{\box0 \tttf##1} + \ifdim\wd2>\dimen2 \dimen2=\wd2 \fi}% + \readsysfile{\f!encodingprefix def}{}{} + \edef\encwidth{\the\dimen0} + \dimen0=\hsize + \advance\dimen0 2em + \advance\dimen2 2em + \divide \dimen0 by \dimen2 \advance\dimen0 1sp + \edef\enccols{\number\dimen0} + \visualizecharacters + \startcolumns[\c!n=\enccols,\c!distance=2em] + \restorefont\setupinterlinespace + \def\definecharacter ##1 ##2 % + {\setbox0=\hbox to \hsize{\localcolortrue\hbox to \encwidth{\getvalue{##1}\hss}\tttf##1}% + \ht0\strutheight \dp0\strutdepth \box0 \allowbreak} + \readsysfile{\f!encodingprefix def}{}{} + \stopcolumns + \stoptextrule + \egroup} + +% \hbox +% {\font\test=uplr8t \test \ruledhbox{t} +% \font\test=uplr8r \test \ruledhbox{t}} + +\ifnum\texengine=\pdftexengine + + \gdef\showhyphenations#1% + {\starttabulate[|le|l|] + \NC language \NC \currentlanguage\ (internal code:\the\normallanguage) \NC \NR + \NC font \NC \fontname\font \NC \NR + \NC encoding \NC \ifx\@@fontencoding\empty not set\else\@@fontencoding\fi \NC \NR + \NC mapping \NC \ifx\@@fontmapping \empty not set\else\@@fontmapping \fi \NC \NR + \NC handling \NC \ifx\@@fonthandling\empty not set\else\@@fonthandling\fi \NC \NR + \NC sample \NC \hyphenatedword{#1} \NC \NR + \stoptabulate} + + \gdef\showmapping + {\dostepwiserecurse{128}{255}{1} + {\hbox\bgroup + \hbox to 2em{\hss\recurselevel}% + \hbox to 2em{\hss\char\recurselevel\hss}% + \hbox to 3em{\hss\ifcase\lccode\recurselevel\else\the \lccode\recurselevel\fi}% + \hbox to 2em{\hss\ifcase\lccode\recurselevel\else\char\lccode\recurselevel\fi\hss}% + \hbox to 3em{\hss\ifcase\lccode\recurselevel\else\the \uccode\recurselevel\fi}% + \hbox to 2em{\hss\ifcase\uccode\recurselevel\else\char\uccode\recurselevel\fi\hss}% + \egroup + \endgraf}} + + \gdef\showcharacterbounds + {\bgroup + \localcolortrue + \dorecurse{255} + {\ifdim\fontcharwd\font\recurselevel>\zeropoint + \noindent\ruledhbox{\darkgray\char\recurselevel}\space + \fi}\unskip + \egroup} + +\else + + \gdef\showhyphenations#1% + {\starttabulate[|le|l|] + \NC language \NC \currentlanguage\ (internal code:\the\normallanguage) \NC \NR + \NC font \NC \fontname\font \NC \NR + \NC sample \NC \hyphenatedword{#1} \NC \NR + \stoptabulate} + + \globallet\showmapping\relax + + \globallet\showcharacterbounds\relax + +\fi + +\protect \endinput diff --git a/tex/context/base/enco-run.tex b/tex/context/base/enco-run.tex deleted file mode 100644 index 50fb52e15..000000000 --- a/tex/context/base/enco-run.tex +++ /dev/null @@ -1,149 +0,0 @@ -%D \module -%D [ file=enco-run, -%D version=2000.27.12, % moved to runtime module -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Runtime Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen \& Ton Otten] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\gdef\visualizecharacters% {}'s needed - {\def\uchar##1##2{\hbox to 2.5em - {\ifcase##1\relax\red\or\blue\else\green\fi##1\hss##2}}% - \let\normalbuildtextaccent\buildtextaccent - \let\normalbottomaccent \bottomaccent - %\def\char{\green\normalchar}% - \def\char % can be used in \oalign - {\bgroup\def\char{\green\normalchar\scratchcounter\egroup}% - \afterassignment\char\scratchcounter}% - \def\buildtextaccent{\let\green\empty\blue\normalbuildtextaccent}% - \def\bottomaccent{\let\green\empty\red\normalbottomaccent}} - -\unexpanded\gdef\visualizecharacterslegend - {\hbox - {\edef\banner{\currentencoding\space\fontname\font}% - \tttf\banner:\space - {\blue composed}\space{\red bottom}\space{\green char}\space raw}} - -\gdef\showaccents - {\bgroup - \savefont - \setuptextrules[\c!bodyfont=,\c!style=] - \starttextrule{\visualizecharacterslegend} - \whitespace - \restorefont\setupinterlinespace - \visualizecharacters - \def\do##1% - {{\def\dodo####1% - {\hss\hbox to 1em{\hss\expanded{##1####1\recurselevel}\hss}}% - \hbox to \hsize - {\strut - \localcolortrue - \hbox to 2em{\tttf\string##1\hss}% - \dorecurse{26}{\dodo\character}}% - \hbox to \hsize - {\strut - \localcolortrue - \hskip2em - \dorecurse{26}{\dodo\Character}}}% - \par} - \do\'\do\`\do\^\do\~\do\" - \do\H\do\r\do\v\do\u\do\= - \do\.\do\b\do\d\do\k\do\c - \stoptextrule - \egroup} - -\gdef\showcharacters - {\bgroup - \savefont - \setuptextrules[\c!bodyfont=,\c!style=] - \starttextrule{\visualizecharacterslegend} - \whitespace - \dontcomplain - \forgetall - \def\startencoding[##1]{} - \def\stopencoding{\endinput} - \dimen0=\zeropoint - \dimen2=\zeropoint - \def\definecharacter ##1 ##2 % - {\setbox0=\hbox spread 1em{\getvalue{##1}}% - \ifdim\wd0>\dimen0 \dimen0=\wd0 \fi - \setbox2=\hbox spread 1em{\box0 \tttf##1} - \ifdim\wd2>\dimen2 \dimen2=\wd2 \fi}% - \readsysfile{\f!encodingprefix def}{}{} - \edef\encwidth{\the\dimen0} - \dimen0=\hsize - \advance\dimen0 2em - \advance\dimen2 2em - \divide \dimen0 by \dimen2 \advance\dimen0 1sp - \edef\enccols{\number\dimen0} - \visualizecharacters - \startcolumns[\c!n=\enccols,\c!distance=2em] - \restorefont\setupinterlinespace - \def\definecharacter ##1 ##2 % - {\setbox0=\hbox to \hsize{\localcolortrue\hbox to \encwidth{\getvalue{##1}\hss}\tttf##1}% - \ht0\strutheight \dp0\strutdepth \box0 \allowbreak} - \readsysfile{\f!encodingprefix def}{}{} - \stopcolumns - \stoptextrule - \egroup} - -% \hbox -% {\font\test=uplr8t \test \ruledhbox{t} -% \font\test=uplr8r \test \ruledhbox{t}} - -\ifnum\texengine=\pdftexengine - - \gdef\showhyphenations#1% - {\starttabulate[|le|l|] - \NC language \NC \currentlanguage\ (internal code:\the\normallanguage) \NC \NR - \NC font \NC \fontname\font \NC \NR - \NC encoding \NC \ifx\@@fontencoding\empty not set\else\@@fontencoding\fi \NC \NR - \NC mapping \NC \ifx\@@fontmapping \empty not set\else\@@fontmapping \fi \NC \NR - \NC handling \NC \ifx\@@fonthandling\empty not set\else\@@fonthandling\fi \NC \NR - \NC sample \NC \hyphenatedword{#1} \NC \NR - \stoptabulate} - - \gdef\showmapping - {\dostepwiserecurse{128}{255}{1} - {\hbox\bgroup - \hbox to 2em{\hss\recurselevel}% - \hbox to 2em{\hss\char\recurselevel\hss}% - \hbox to 3em{\hss\ifcase\lccode\recurselevel\else\the \lccode\recurselevel\fi}% - \hbox to 2em{\hss\ifcase\lccode\recurselevel\else\char\lccode\recurselevel\fi\hss}% - \hbox to 3em{\hss\ifcase\lccode\recurselevel\else\the \uccode\recurselevel\fi}% - \hbox to 2em{\hss\ifcase\uccode\recurselevel\else\char\uccode\recurselevel\fi\hss}% - \egroup - \endgraf}} - - \gdef\showcharacterbounds - {\bgroup - \localcolortrue - \dorecurse{255} - {\ifdim\fontcharwd\font\recurselevel>\zeropoint - \noindent\ruledhbox{\darkgray\char\recurselevel}\space - \fi}\unskip - \egroup} - -\else - - \gdef\showhyphenations#1% - {\starttabulate[|le|l|] - \NC language \NC \currentlanguage\ (internal code:\the\normallanguage) \NC \NR - \NC font \NC \fontname\font \NC \NR - \NC sample \NC \hyphenatedword{#1} \NC \NR - \stoptabulate} - - \globallet\showmapping\relax - - \globallet\showcharacterbounds\relax - -\fi - -\protect \endinput diff --git a/tex/context/base/enco-t5.mkii b/tex/context/base/enco-t5.mkii new file mode 100644 index 000000000..251c68765 --- /dev/null +++ b/tex/context/base/enco-t5.mkii @@ -0,0 +1,244 @@ +%D \module +%D [ file=enco-t5, +%D version=2004.11.16, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=New Vietnamese Encoding, +%D author=Hans Hagen \& Adam Lindsay, +%D date=\currentdate, +%D copyright=PRAGMA \& Adam Lindsay] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module is derived from the enco-x5 encoding, but now +%D approaches the world with named glyphs. + +\startencoding[t5] + +\definecasemaps 128 to 159 lc +32 uc 0 + +\definecasemaps 160 to 191 lc 0 uc -32 + +\definecasemaps 192 to 223 lc +32 uc 0 + +\definecasemaps 224 to 225 lc 0 uc -32 + +\definecasemap 26 26 27 \definecasemap 27 26 27 +\definecasemap 28 28 29 \definecasemap 29 28 29 +\definecasemap 30 30 31 \definecasemap 31 30 31 + +\definecharacter textgrave 0 +\definecharacter textacute 1 +\definecharacter textcircumflex 2 +\definecharacter texttilde 3 +\definecharacter textdiaeresis 4 +\definecharacter textbottomdot 5 +\definecharacter textring 6 +\definecharacter textcaron 7 +\definecharacter textbreve 8 +\definecharacter textmacron 9 +\definecharacter textdotaccent 10 +\definecharacter textcedilla 11 +\definecharacter texthookabove 12 +\definecharacter textogonek {} + +\definecharacter quotesinglebase 13 +\definecharacter guilsingleleft 14 +\definecharacter guilsingleright 15 +\definecharacter quotedblleft 16 +\definecharacter quotedblright 17 +\definecharacter quotedblbase 18 +\definecharacter leftguillemot 19 +\definecharacter rightguillemot 20 +\definecharacter endash 21 +\definecharacter emdash 22 + +\definecharacter cwm 23 +\definecharacter zeroinferior 24 +\definecharacter Yhook 26 +\definecharacter yhook 27 +\definecharacter Ydotbelow 28 +\definecharacter ydotbelow 29 +\definecharacter Dstroke 30 +\definecharacter dstroke 31 +\definecharacter textvisiblespace 32 + +\definecharacter dotlessi 25 +%definecharacter DJ 30 +%definecharacter dj 31 +\definecharacter Agrave 128 +\definecharacter Aacute 129 +\definecharacter Atilde 130 +\definecharacter Ahook 131 +\definecharacter Adotbelow 132 +\definecharacter Acircumflex 133 +\definecharacter Acircumflexgrave 134 +\definecharacter Acircumflexacute 135 +\definecharacter Acircumflextilde 136 +\definecharacter Acircumflexhook 137 +\definecharacter Acircumflexdotbelow 138 +\definecharacter Abreve 139 +\definecharacter Abrevegrave 140 +\definecharacter Abreveacute 141 +\definecharacter Abrevetilde 142 +\definecharacter Abrevehook 143 +\definecharacter Abrevedotbelow 144 +\definecharacter Egrave 145 +\definecharacter Eacute 146 +\definecharacter Etilde 147 +\definecharacter Ehook 148 +\definecharacter Edotbelow 149 +\definecharacter Ecircumflex 150 +\definecharacter Ecircumflexgrave 151 +\definecharacter Ecircumflexacute 152 +\definecharacter Ecircumflextilde 153 +\definecharacter Ecircumflexhook 154 +\definecharacter Ecircumflexdotbelow 155 +\definecharacter Igrave 156 +\definecharacter Iacute 157 +\definecharacter Itilde 158 +\definecharacter Ihook 159 +\definecharacter agrave 160 +\definecharacter aacute 161 +\definecharacter atilde 162 +\definecharacter ahook 163 +\definecharacter adotbelow 164 +\definecharacter acircumflex 165 +\definecharacter acircumflexgrave 166 +\definecharacter acircumflexacute 167 +\definecharacter acircumflextilde 168 +\definecharacter acircumflexhook 169 +\definecharacter acircumflexdotbelow 170 +\definecharacter abreve 171 +\definecharacter abrevegrave 172 +\definecharacter abreveacute 173 +\definecharacter abrevetilde 174 +\definecharacter abrevehook 175 +\definecharacter abrevedotbelow 176 +\definecharacter egrave 177 +\definecharacter eacute 178 +\definecharacter etilde 179 +\definecharacter ehook 180 +\definecharacter edotbelow 181 +\definecharacter ecircumflex 182 +\definecharacter ecircumflexgrave 183 +\definecharacter ecircumflexacute 184 +\definecharacter ecircumflextilde 185 +\definecharacter ecircumflexhook 186 +\definecharacter ecircumflexdotbelow 187 +\definecharacter igrave 188 +\definecharacter iacute 189 +\definecharacter itilde 190 +\definecharacter ihook 191 +\definecharacter Idotbelow 192 +\definecharacter Ograve 193 +\definecharacter Oacute 194 +\definecharacter Otilde 195 +\definecharacter Ohook 196 +\definecharacter Odotbelow 197 +\definecharacter Ocircumflex 198 +\definecharacter Ocircumflexgrave 199 +\definecharacter Ocircumflexacute 200 +\definecharacter Ocircumflextilde 201 +\definecharacter Ocircumflexhook 202 +\definecharacter Ocircumflexdotbelow 203 +\definecharacter Ohorn 204 +\definecharacter Ohorngrave 205 +\definecharacter Ohornacute 206 +\definecharacter Ohorntilde 207 +\definecharacter Ohornhook 208 +\definecharacter Ohorndotbelow 209 +\definecharacter Ugrave 210 +\definecharacter Uacute 211 +\definecharacter Utilde 212 +\definecharacter Uhook 213 +\definecharacter Udotbelow 214 +\definecharacter Uhorn 215 +\definecharacter Uhorngrave 216 +\definecharacter Uhornacute 217 +\definecharacter Uhorntilde 218 +\definecharacter Uhornhook 219 +\definecharacter Uhorndotbelow 220 +\definecharacter Ytilde 223 +\definecharacter idotbelow 224 +\definecharacter ograve 225 +\definecharacter oacute 226 +\definecharacter otilde 227 +\definecharacter ohook 228 +\definecharacter odotbelow 229 +\definecharacter ocircumflex 230 +\definecharacter ocircumflexgrave 231 +\definecharacter ocircumflexacute 232 +\definecharacter ocircumflextilde 233 +\definecharacter ocircumflexhook 234 +\definecharacter ocircumflexdotbelow 235 +\definecharacter ohorn 236 +\definecharacter ohorngrave 237 +\definecharacter ohornacute 238 +\definecharacter ohorntilde 239 +\definecharacter ohornhook 240 +\definecharacter ohorndotbelow 241 +\definecharacter ugrave 242 +\definecharacter uacute 243 +\definecharacter utilde 244 +\definecharacter uhook 245 +\definecharacter udotbelow 246 +\definecharacter uhorn 247 +\definecharacter uhorngrave 248 +\definecharacter uhornacute 249 +\definecharacter uhorntilde 250 +\definecharacter uhornhook 251 +\definecharacter uhorndotbelow 252 +\definecharacter ygrave 253 +\definecharacter yacute 254 +\definecharacter ytilde 255 + +\stopencoding + +\endinput + +% \startencoding [x5] +% +% \definecharacter aa {\xfiveencodedaa} +% \definecharacter AA {\xfiveencodedAA} +% +% \stopencoding +% +% \def\xfiveencodedaa% +% {\accent23a} +% +% \def\xfiveencodedAA% +% {\leavevmode +% \setbox\zerocount\hbox{h}% +% \dimen@\ht\zerocount +% \advance\dimen@ -1ex +% \rlap{\raise.67\dimen@\hbox{\char23}}A} + +% \quotesinglbase 13 +% \guilsinglleft 14 +% \guilsinglright 15 +% \textquotedblleft 16 +% \textquotedblright 17 +% \quotedblbase 18 +% \guillemotleft 19 +% \guillemotright 20 +% \textendash 21 +% \textemdash 22 +% \textcompwordmark 23 +% \textperthousand \% \char 24 +% \textpertenthousand \%\char 24\char 24 +% \textvisiblespace 32 +% \textquotedbl `\" +% \textdollar `\$ +% \textquoteright `\' +% \textless `\< +% \textgreater `\> +% \textbackslash `\ +% \textasciicircum `\^ +% \textunderscore 95 +% \textquoteleft `\` +% \textbraceleft `\{ +% \textbar `\| +% \textbraceright `\} +% \textasciitilde `\~ diff --git a/tex/context/base/enco-t5.tex b/tex/context/base/enco-t5.tex deleted file mode 100644 index 251c68765..000000000 --- a/tex/context/base/enco-t5.tex +++ /dev/null @@ -1,244 +0,0 @@ -%D \module -%D [ file=enco-t5, -%D version=2004.11.16, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=New Vietnamese Encoding, -%D author=Hans Hagen \& Adam Lindsay, -%D date=\currentdate, -%D copyright=PRAGMA \& Adam Lindsay] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module is derived from the enco-x5 encoding, but now -%D approaches the world with named glyphs. - -\startencoding[t5] - -\definecasemaps 128 to 159 lc +32 uc 0 - -\definecasemaps 160 to 191 lc 0 uc -32 - -\definecasemaps 192 to 223 lc +32 uc 0 - -\definecasemaps 224 to 225 lc 0 uc -32 - -\definecasemap 26 26 27 \definecasemap 27 26 27 -\definecasemap 28 28 29 \definecasemap 29 28 29 -\definecasemap 30 30 31 \definecasemap 31 30 31 - -\definecharacter textgrave 0 -\definecharacter textacute 1 -\definecharacter textcircumflex 2 -\definecharacter texttilde 3 -\definecharacter textdiaeresis 4 -\definecharacter textbottomdot 5 -\definecharacter textring 6 -\definecharacter textcaron 7 -\definecharacter textbreve 8 -\definecharacter textmacron 9 -\definecharacter textdotaccent 10 -\definecharacter textcedilla 11 -\definecharacter texthookabove 12 -\definecharacter textogonek {} - -\definecharacter quotesinglebase 13 -\definecharacter guilsingleleft 14 -\definecharacter guilsingleright 15 -\definecharacter quotedblleft 16 -\definecharacter quotedblright 17 -\definecharacter quotedblbase 18 -\definecharacter leftguillemot 19 -\definecharacter rightguillemot 20 -\definecharacter endash 21 -\definecharacter emdash 22 - -\definecharacter cwm 23 -\definecharacter zeroinferior 24 -\definecharacter Yhook 26 -\definecharacter yhook 27 -\definecharacter Ydotbelow 28 -\definecharacter ydotbelow 29 -\definecharacter Dstroke 30 -\definecharacter dstroke 31 -\definecharacter textvisiblespace 32 - -\definecharacter dotlessi 25 -%definecharacter DJ 30 -%definecharacter dj 31 -\definecharacter Agrave 128 -\definecharacter Aacute 129 -\definecharacter Atilde 130 -\definecharacter Ahook 131 -\definecharacter Adotbelow 132 -\definecharacter Acircumflex 133 -\definecharacter Acircumflexgrave 134 -\definecharacter Acircumflexacute 135 -\definecharacter Acircumflextilde 136 -\definecharacter Acircumflexhook 137 -\definecharacter Acircumflexdotbelow 138 -\definecharacter Abreve 139 -\definecharacter Abrevegrave 140 -\definecharacter Abreveacute 141 -\definecharacter Abrevetilde 142 -\definecharacter Abrevehook 143 -\definecharacter Abrevedotbelow 144 -\definecharacter Egrave 145 -\definecharacter Eacute 146 -\definecharacter Etilde 147 -\definecharacter Ehook 148 -\definecharacter Edotbelow 149 -\definecharacter Ecircumflex 150 -\definecharacter Ecircumflexgrave 151 -\definecharacter Ecircumflexacute 152 -\definecharacter Ecircumflextilde 153 -\definecharacter Ecircumflexhook 154 -\definecharacter Ecircumflexdotbelow 155 -\definecharacter Igrave 156 -\definecharacter Iacute 157 -\definecharacter Itilde 158 -\definecharacter Ihook 159 -\definecharacter agrave 160 -\definecharacter aacute 161 -\definecharacter atilde 162 -\definecharacter ahook 163 -\definecharacter adotbelow 164 -\definecharacter acircumflex 165 -\definecharacter acircumflexgrave 166 -\definecharacter acircumflexacute 167 -\definecharacter acircumflextilde 168 -\definecharacter acircumflexhook 169 -\definecharacter acircumflexdotbelow 170 -\definecharacter abreve 171 -\definecharacter abrevegrave 172 -\definecharacter abreveacute 173 -\definecharacter abrevetilde 174 -\definecharacter abrevehook 175 -\definecharacter abrevedotbelow 176 -\definecharacter egrave 177 -\definecharacter eacute 178 -\definecharacter etilde 179 -\definecharacter ehook 180 -\definecharacter edotbelow 181 -\definecharacter ecircumflex 182 -\definecharacter ecircumflexgrave 183 -\definecharacter ecircumflexacute 184 -\definecharacter ecircumflextilde 185 -\definecharacter ecircumflexhook 186 -\definecharacter ecircumflexdotbelow 187 -\definecharacter igrave 188 -\definecharacter iacute 189 -\definecharacter itilde 190 -\definecharacter ihook 191 -\definecharacter Idotbelow 192 -\definecharacter Ograve 193 -\definecharacter Oacute 194 -\definecharacter Otilde 195 -\definecharacter Ohook 196 -\definecharacter Odotbelow 197 -\definecharacter Ocircumflex 198 -\definecharacter Ocircumflexgrave 199 -\definecharacter Ocircumflexacute 200 -\definecharacter Ocircumflextilde 201 -\definecharacter Ocircumflexhook 202 -\definecharacter Ocircumflexdotbelow 203 -\definecharacter Ohorn 204 -\definecharacter Ohorngrave 205 -\definecharacter Ohornacute 206 -\definecharacter Ohorntilde 207 -\definecharacter Ohornhook 208 -\definecharacter Ohorndotbelow 209 -\definecharacter Ugrave 210 -\definecharacter Uacute 211 -\definecharacter Utilde 212 -\definecharacter Uhook 213 -\definecharacter Udotbelow 214 -\definecharacter Uhorn 215 -\definecharacter Uhorngrave 216 -\definecharacter Uhornacute 217 -\definecharacter Uhorntilde 218 -\definecharacter Uhornhook 219 -\definecharacter Uhorndotbelow 220 -\definecharacter Ytilde 223 -\definecharacter idotbelow 224 -\definecharacter ograve 225 -\definecharacter oacute 226 -\definecharacter otilde 227 -\definecharacter ohook 228 -\definecharacter odotbelow 229 -\definecharacter ocircumflex 230 -\definecharacter ocircumflexgrave 231 -\definecharacter ocircumflexacute 232 -\definecharacter ocircumflextilde 233 -\definecharacter ocircumflexhook 234 -\definecharacter ocircumflexdotbelow 235 -\definecharacter ohorn 236 -\definecharacter ohorngrave 237 -\definecharacter ohornacute 238 -\definecharacter ohorntilde 239 -\definecharacter ohornhook 240 -\definecharacter ohorndotbelow 241 -\definecharacter ugrave 242 -\definecharacter uacute 243 -\definecharacter utilde 244 -\definecharacter uhook 245 -\definecharacter udotbelow 246 -\definecharacter uhorn 247 -\definecharacter uhorngrave 248 -\definecharacter uhornacute 249 -\definecharacter uhorntilde 250 -\definecharacter uhornhook 251 -\definecharacter uhorndotbelow 252 -\definecharacter ygrave 253 -\definecharacter yacute 254 -\definecharacter ytilde 255 - -\stopencoding - -\endinput - -% \startencoding [x5] -% -% \definecharacter aa {\xfiveencodedaa} -% \definecharacter AA {\xfiveencodedAA} -% -% \stopencoding -% -% \def\xfiveencodedaa% -% {\accent23a} -% -% \def\xfiveencodedAA% -% {\leavevmode -% \setbox\zerocount\hbox{h}% -% \dimen@\ht\zerocount -% \advance\dimen@ -1ex -% \rlap{\raise.67\dimen@\hbox{\char23}}A} - -% \quotesinglbase 13 -% \guilsinglleft 14 -% \guilsinglright 15 -% \textquotedblleft 16 -% \textquotedblright 17 -% \quotedblbase 18 -% \guillemotleft 19 -% \guillemotright 20 -% \textendash 21 -% \textemdash 22 -% \textcompwordmark 23 -% \textperthousand \% \char 24 -% \textpertenthousand \%\char 24\char 24 -% \textvisiblespace 32 -% \textquotedbl `\" -% \textdollar `\$ -% \textquoteright `\' -% \textless `\< -% \textgreater `\> -% \textbackslash `\ -% \textasciicircum `\^ -% \textunderscore 95 -% \textquoteleft `\` -% \textbraceleft `\{ -% \textbar `\| -% \textbraceright `\} -% \textasciitilde `\~ diff --git a/tex/context/base/enco-tbo.mkii b/tex/context/base/enco-tbo.mkii new file mode 100644 index 000000000..475be4602 --- /dev/null +++ b/tex/context/base/enco-tbo.mkii @@ -0,0 +1,222 @@ +%D \module +%D [ file=enco-tbo, +%D version=2000.05.07, % 2001.8.4, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=TeXBaseOne Encoding, +%D author={Patrick Gundlach, Hans Hagen}, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startmapping[8r] + +\resetcaserange 128 to 255 + +\definecasemap 228 228 196 \definecasemap 196 228 196 +\definecasemap 235 235 203 \definecasemap 203 235 203 +\definecasemap 239 239 207 \definecasemap 207 239 207 +\definecasemap 246 246 214 \definecasemap 214 246 214 +\definecasemap 252 252 220 \definecasemap 220 252 220 +\definecasemap 255 255 159 \definecasemap 159 255 159 + +\definecasemap 225 225 193 \definecasemap 193 225 193 +\definecasemap 233 233 201 \definecasemap 201 233 201 +\definecasemap 237 237 205 \definecasemap 205 237 205 +\definecasemap 243 243 211 \definecasemap 211 243 211 +\definecasemap 250 250 218 \definecasemap 218 250 218 +\definecasemap 253 253 221 \definecasemap 221 253 221 + +\definecasemap 224 224 192 \definecasemap 192 224 192 +\definecasemap 232 232 200 \definecasemap 200 232 200 +\definecasemap 236 236 204 \definecasemap 204 236 204 +\definecasemap 242 242 210 \definecasemap 210 242 210 +\definecasemap 249 249 217 \definecasemap 217 249 217 + +\definecasemap 226 226 194 \definecasemap 194 226 194 +\definecasemap 234 234 202 \definecasemap 202 234 202 +\definecasemap 238 238 206 \definecasemap 206 238 206 +\definecasemap 244 244 212 \definecasemap 212 244 212 +\definecasemap 251 251 219 \definecasemap 219 251 219 + +\definecasemap 227 227 195 \definecasemap 195 227 195 +\definecasemap 241 241 209 \definecasemap 209 241 209 +\definecasemap 245 245 213 \definecasemap 213 245 213 + +\stopmapping + +\startencoding[8r] + +\definecharacter textacute 180 +\definecharacter textbreve 11 +\definecharacter textcaron 16 +\definecharacter textcedilla 184 +\definecharacter textcircumflex 136 +\definecharacter textdiaeresis 168 +\definecharacter textdotaccent 1 +\definecharacter textgrave 30 +\definecharacter texthungarumlaut 5 +\definecharacter textmacron 175 +\definecharacter textogonek 8 +\definecharacter textring 9 +\definecharacter texttilde 152 + +\definecharacter dotlessi 17 +%definecharacter dotlessj 18 + +\definecharacter endash 150 +\definecharacter emdash 151 + +\definecharacter oeligature 156 +\definecharacter OEligature 140 +\definecharacter aeligature 230 +\definecharacter AEligature 198 + +\definecharacter ssharp 223 + +\definecharacter thorn 254 +\definecharacter Thorn 222 + +\definecharacter exclamdown 161 +\definecharacter questiondown 191 + +\definecharacter copyright 169 +\definecharacter registered 174 +\definecharacter trademark 153 + +\definecharacter sectionmark 167 +\definecharacter paragraphmark 182 + +\definecharacter onequarter 188 +\definecharacter onehalf 189 +\definecharacter threequarter 190 +\definecharacter onesuperior 185 +\definecharacter twosuperior 178 +\definecharacter threesuperior 179 + +\definecharacter textcent 162 +\definecharacter textcurrency 164 +\definecharacter texteuro 128 +\definecharacter textflorin 131 +\definecharacter textsterling 163 +\definecharacter textyen 165 + +\definecharacter percent 37 +\definecharacter perthousand 137 + +\definecharacter periodcentered 183 +\definecharacter softhyphen 173 + +\definecharacter textasciicircum 94 +\definecharacter textasciitilde 126 +\definecharacter textslash 47 +\definecharacter textbackslash 92 +\definecharacter textbraceleft 123 +\definecharacter textbraceright 125 +\definecharacter textunderscore 95 + +\definecharacter textbrokenbar 166 +\definecharacter textbullet 149 +\definecharacter textdag 134 +\definecharacter textddag 135 +\definecharacter textdegree 176 +\definecharacter textdiv 247 +\definecharacter textellipsis 133 +\definecharacter textfraction 4 +\definecharacter textlognot 172 +\definecharacter textminus 12 +\definecharacter textmu 181 +\definecharacter textmultiply 215 +\definecharacter textpm 177 + +\definecharacter quotedbl 34 +\definecharacter quotedblbase 132 +\definecharacter quotedblleft 147 +\definecharacter quotedblright 148 + +\definecharacter quotesingle 31 +\definecharacter quotesinglebase 130 + +\definecharacter quoteleft 96 +\definecharacter quoteright 39 + +\definecharacter guilsingleleft 139 +\definecharacter guilsingleright 155 +\definecharacter leftguillemot 171 +\definecharacter rightguillemot 187 + +\definecharacter aacute 225 +\definecharacter Aacute 193 +\definecharacter eacute 233 +\definecharacter Eacute 201 +\definecharacter iacute 237 +\definecharacter Iacute 205 +\definecharacter oacute 243 +\definecharacter Oacute 211 +\definecharacter uacute 250 +\definecharacter Uacute 218 +\definecharacter Yacute 221 +\definecharacter yacute 253 + +\definecharacter scaron 154 +\definecharacter Scaron 138 +%definecharacter Zcaron 141 + +\definecharacter ccedilla 231 +\definecharacter Ccedilla 199 + +\definecharacter acircumflex 226 +\definecharacter Acircumflex 194 +\definecharacter ecircumflex 234 +\definecharacter Ecircumflex 202 +\definecharacter icircumflex 238 +\definecharacter Icircumflex 206 +\definecharacter ocircumflex 244 +\definecharacter Ocircumflex 212 +\definecharacter ucircumflex 251 +\definecharacter Ucircumflex 219 + +\definecharacter adiaeresis 228 +\definecharacter Adiaeresis 196 +\definecharacter ediaeresis 235 +\definecharacter Ediaeresis 203 +\definecharacter idiaeresis 239 +\definecharacter Idiaeresis 207 +\definecharacter odiaeresis 246 +\definecharacter Odiaeresis 214 +\definecharacter udiaeresis 252 +\definecharacter Udiaeresis 220 +\definecharacter ydiaeresis 255 +\definecharacter Ydiaeresis 159 + +\definecharacter agrave 224 +\definecharacter Agrave 192 +\definecharacter egrave 232 +\definecharacter Egrave 200 +\definecharacter igrave 236 +\definecharacter Igrave 204 +\definecharacter ograve 242 +\definecharacter Ograve 210 +\definecharacter ugrave 249 +\definecharacter Ugrave 217 + +\definecharacter aring 229 +\definecharacter Aring 197 + +\definecharacter lstroke 7 +\definecharacter Lstroke 6 +\definecharacter ostroke 248 +\definecharacter Ostroke 216 + +\definecharacter atilde 227 +\definecharacter Atilde 195 +\definecharacter ntilde 241 +\definecharacter Ntilde 209 +\definecharacter otilde 245 +\definecharacter Otilde 213 + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-tbo.tex b/tex/context/base/enco-tbo.tex deleted file mode 100644 index 475be4602..000000000 --- a/tex/context/base/enco-tbo.tex +++ /dev/null @@ -1,222 +0,0 @@ -%D \module -%D [ file=enco-tbo, -%D version=2000.05.07, % 2001.8.4, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=TeXBaseOne Encoding, -%D author={Patrick Gundlach, Hans Hagen}, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startmapping[8r] - -\resetcaserange 128 to 255 - -\definecasemap 228 228 196 \definecasemap 196 228 196 -\definecasemap 235 235 203 \definecasemap 203 235 203 -\definecasemap 239 239 207 \definecasemap 207 239 207 -\definecasemap 246 246 214 \definecasemap 214 246 214 -\definecasemap 252 252 220 \definecasemap 220 252 220 -\definecasemap 255 255 159 \definecasemap 159 255 159 - -\definecasemap 225 225 193 \definecasemap 193 225 193 -\definecasemap 233 233 201 \definecasemap 201 233 201 -\definecasemap 237 237 205 \definecasemap 205 237 205 -\definecasemap 243 243 211 \definecasemap 211 243 211 -\definecasemap 250 250 218 \definecasemap 218 250 218 -\definecasemap 253 253 221 \definecasemap 221 253 221 - -\definecasemap 224 224 192 \definecasemap 192 224 192 -\definecasemap 232 232 200 \definecasemap 200 232 200 -\definecasemap 236 236 204 \definecasemap 204 236 204 -\definecasemap 242 242 210 \definecasemap 210 242 210 -\definecasemap 249 249 217 \definecasemap 217 249 217 - -\definecasemap 226 226 194 \definecasemap 194 226 194 -\definecasemap 234 234 202 \definecasemap 202 234 202 -\definecasemap 238 238 206 \definecasemap 206 238 206 -\definecasemap 244 244 212 \definecasemap 212 244 212 -\definecasemap 251 251 219 \definecasemap 219 251 219 - -\definecasemap 227 227 195 \definecasemap 195 227 195 -\definecasemap 241 241 209 \definecasemap 209 241 209 -\definecasemap 245 245 213 \definecasemap 213 245 213 - -\stopmapping - -\startencoding[8r] - -\definecharacter textacute 180 -\definecharacter textbreve 11 -\definecharacter textcaron 16 -\definecharacter textcedilla 184 -\definecharacter textcircumflex 136 -\definecharacter textdiaeresis 168 -\definecharacter textdotaccent 1 -\definecharacter textgrave 30 -\definecharacter texthungarumlaut 5 -\definecharacter textmacron 175 -\definecharacter textogonek 8 -\definecharacter textring 9 -\definecharacter texttilde 152 - -\definecharacter dotlessi 17 -%definecharacter dotlessj 18 - -\definecharacter endash 150 -\definecharacter emdash 151 - -\definecharacter oeligature 156 -\definecharacter OEligature 140 -\definecharacter aeligature 230 -\definecharacter AEligature 198 - -\definecharacter ssharp 223 - -\definecharacter thorn 254 -\definecharacter Thorn 222 - -\definecharacter exclamdown 161 -\definecharacter questiondown 191 - -\definecharacter copyright 169 -\definecharacter registered 174 -\definecharacter trademark 153 - -\definecharacter sectionmark 167 -\definecharacter paragraphmark 182 - -\definecharacter onequarter 188 -\definecharacter onehalf 189 -\definecharacter threequarter 190 -\definecharacter onesuperior 185 -\definecharacter twosuperior 178 -\definecharacter threesuperior 179 - -\definecharacter textcent 162 -\definecharacter textcurrency 164 -\definecharacter texteuro 128 -\definecharacter textflorin 131 -\definecharacter textsterling 163 -\definecharacter textyen 165 - -\definecharacter percent 37 -\definecharacter perthousand 137 - -\definecharacter periodcentered 183 -\definecharacter softhyphen 173 - -\definecharacter textasciicircum 94 -\definecharacter textasciitilde 126 -\definecharacter textslash 47 -\definecharacter textbackslash 92 -\definecharacter textbraceleft 123 -\definecharacter textbraceright 125 -\definecharacter textunderscore 95 - -\definecharacter textbrokenbar 166 -\definecharacter textbullet 149 -\definecharacter textdag 134 -\definecharacter textddag 135 -\definecharacter textdegree 176 -\definecharacter textdiv 247 -\definecharacter textellipsis 133 -\definecharacter textfraction 4 -\definecharacter textlognot 172 -\definecharacter textminus 12 -\definecharacter textmu 181 -\definecharacter textmultiply 215 -\definecharacter textpm 177 - -\definecharacter quotedbl 34 -\definecharacter quotedblbase 132 -\definecharacter quotedblleft 147 -\definecharacter quotedblright 148 - -\definecharacter quotesingle 31 -\definecharacter quotesinglebase 130 - -\definecharacter quoteleft 96 -\definecharacter quoteright 39 - -\definecharacter guilsingleleft 139 -\definecharacter guilsingleright 155 -\definecharacter leftguillemot 171 -\definecharacter rightguillemot 187 - -\definecharacter aacute 225 -\definecharacter Aacute 193 -\definecharacter eacute 233 -\definecharacter Eacute 201 -\definecharacter iacute 237 -\definecharacter Iacute 205 -\definecharacter oacute 243 -\definecharacter Oacute 211 -\definecharacter uacute 250 -\definecharacter Uacute 218 -\definecharacter Yacute 221 -\definecharacter yacute 253 - -\definecharacter scaron 154 -\definecharacter Scaron 138 -%definecharacter Zcaron 141 - -\definecharacter ccedilla 231 -\definecharacter Ccedilla 199 - -\definecharacter acircumflex 226 -\definecharacter Acircumflex 194 -\definecharacter ecircumflex 234 -\definecharacter Ecircumflex 202 -\definecharacter icircumflex 238 -\definecharacter Icircumflex 206 -\definecharacter ocircumflex 244 -\definecharacter Ocircumflex 212 -\definecharacter ucircumflex 251 -\definecharacter Ucircumflex 219 - -\definecharacter adiaeresis 228 -\definecharacter Adiaeresis 196 -\definecharacter ediaeresis 235 -\definecharacter Ediaeresis 203 -\definecharacter idiaeresis 239 -\definecharacter Idiaeresis 207 -\definecharacter odiaeresis 246 -\definecharacter Odiaeresis 214 -\definecharacter udiaeresis 252 -\definecharacter Udiaeresis 220 -\definecharacter ydiaeresis 255 -\definecharacter Ydiaeresis 159 - -\definecharacter agrave 224 -\definecharacter Agrave 192 -\definecharacter egrave 232 -\definecharacter Egrave 200 -\definecharacter igrave 236 -\definecharacter Igrave 204 -\definecharacter ograve 242 -\definecharacter Ograve 210 -\definecharacter ugrave 249 -\definecharacter Ugrave 217 - -\definecharacter aring 229 -\definecharacter Aring 197 - -\definecharacter lstroke 7 -\definecharacter Lstroke 6 -\definecharacter ostroke 248 -\definecharacter Ostroke 216 - -\definecharacter atilde 227 -\definecharacter Atilde 195 -\definecharacter ntilde 241 -\definecharacter Ntilde 209 -\definecharacter otilde 245 -\definecharacter Otilde 213 - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-uc.mkii b/tex/context/base/enco-uc.mkii new file mode 100644 index 000000000..981eb6ae4 --- /dev/null +++ b/tex/context/base/enco-uc.mkii @@ -0,0 +1,1091 @@ +%D \module +%D [ file=enco-uc, +%D version=2000.xx.xx, % and later +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Unicode (backwards mapping), +%D author={Adam Lindsay \& Hans Hagen}, +%D date=\currentdate, +%D copyright=PRAGMA ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D An alternative approach would be to misuse the utf vectors, but they +%D don't carry enough info around. + +% todo : \defineucharacter hebrewAlef 5 "D0 + +\startencoding[uc] + +\definecharacter Agrave {\uchar0{192}} +\definecharacter Aacute {\uchar0{193}} +\definecharacter Acircumflex {\uchar0{194}} +\definecharacter Atilde {\uchar0{195}} +\definecharacter Adiaeresis {\uchar0{196}} +\definecharacter Aring {\uchar0{197}} +\definecharacter AEligature {\uchar0{198}} +\definecharacter Ccedilla {\uchar0{199}} +\definecharacter Egrave {\uchar0{200}} +\definecharacter Eacute {\uchar0{201}} +\definecharacter Ediaeresis {\uchar0{203}} +\definecharacter Igrave {\uchar0{204}} +\definecharacter Iacute {\uchar0{205}} +\definecharacter Icircumflex {\uchar0{206}} +\definecharacter Idiaeresis {\uchar0{207}} +\definecharacter Eth {\uchar0{208}} +\definecharacter Ntilde {\uchar0{209}} +\definecharacter Ograve {\uchar0{210}} +\definecharacter Oacute {\uchar0{211}} +\definecharacter Ocircumflex {\uchar0{212}} +\definecharacter Otilde {\uchar0{213}} +\definecharacter Odiaeresis {\uchar0{214}} + +\definecharacter Ostroke {\uchar0{216}} +\definecharacter Ugrave {\uchar0{217}} +\definecharacter Uacute {\uchar0{218}} +\definecharacter Uhungarumlaut {\uchar0{219}} +\definecharacter Udiaeresis {\uchar0{220}} +\definecharacter Yacute {\uchar0{221}} +\definecharacter Thorn {\uchar0{222}} +\definecharacter ssharp {\uchar0{223}} +\definecharacter agrave {\uchar0{224}} +\definecharacter aacute {\uchar0{225}} +\definecharacter acircumflex {\uchar0{226}} +\definecharacter atilde {\uchar0{227}} +\definecharacter adiaeresis {\uchar0{228}} +\definecharacter aring {\uchar0{229}} +\definecharacter aeligature {\uchar0{230}} +\definecharacter ccedilla {\uchar0{231}} +\definecharacter egrave {\uchar0{232}} +\definecharacter eacute {\uchar0{233}} +\definecharacter ecircumflex {\uchar0{234}} +\definecharacter ediaeresis {\uchar0{235}} +\definecharacter igrave {\uchar0{236}} +\definecharacter iacute {\uchar0{237}} +\definecharacter icircumflex {\uchar0{238}} +\definecharacter idiaeresis {\uchar0{239}} +\definecharacter eth {\uchar0{240}} +\definecharacter ntilde {\uchar0{241}} +\definecharacter ograve {\uchar0{242}} +\definecharacter oacute {\uchar0{243}} +\definecharacter ocircumflex {\uchar0{244}} +\definecharacter otilde {\uchar0{245}} +\definecharacter odiaeresis {\uchar0{246}} + +\definecharacter ostroke {\uchar0{248}} +\definecharacter ugrave {\uchar0{249}} +\definecharacter uacute {\uchar0{250}} +\definecharacter ucircumflex {\uchar0{251}} +\definecharacter udiaeresis {\uchar0{252}} +\definecharacter yacute {\uchar0{253}} +\definecharacter thorn {\uchar0{254}} +\definecharacter ydiaeresis {\uchar0{255}} + +\definecharacter Amacron {\uchar1{0}} +\definecharacter amacron {\uchar1{1}} +\definecharacter Abreve {\uchar1{2}} +\definecharacter abreve {\uchar1{3}} +\definecharacter Aogonek {\uchar1{4}} +\definecharacter aogonek {\uchar1{5}} +\definecharacter Cacute {\uchar1{6}} +\definecharacter cacute {\uchar1{7}} +\definecharacter Ccircumflex {\uchar1{8}} +\definecharacter ccircumflex {\uchar1{9}} +\definecharacter Cdotaccent {\uchar1{10}} +\definecharacter cdotaccent {\uchar1{11}} +\definecharacter Ccaron {\uchar1{12}} +\definecharacter ccaron {\uchar1{13}} +\definecharacter Dcaron {\uchar1{14}} +\definecharacter dcaron {\uchar1{15}} +\definecharacter Dstroke {\uchar1{16}} +\definecharacter dstroke {\uchar1{17}} +\definecharacter Emacron {\uchar1{18}} +\definecharacter emacron {\uchar1{19}} +\definecharacter Ebreve {\uchar1{20}} +\definecharacter ebreve {\uchar1{21}} +\definecharacter Edotaccent {\uchar1{22}} +\definecharacter edotaccent {\uchar1{23}} +\definecharacter Eogonek {\uchar1{24}} +\definecharacter eogonek {\uchar1{25}} +\definecharacter Ecaron {\uchar1{26}} +\definecharacter ecaron {\uchar1{27}} +\definecharacter Gcircumflex {\uchar1{28}} +\definecharacter gcircumflex {\uchar1{29}} +\definecharacter Gbreve {\uchar1{30}} +\definecharacter gbreve {\uchar1{31}} +\definecharacter Gdotaccent {\uchar1{32}} +\definecharacter gdotaccent {\uchar1{33}} +\definecharacter Gcommaaccent {\uchar1{34}} +\definecharacter gcommaaccent {\uchar1{35}} +\definecharacter Hcircumflex {\uchar1{36}} +\definecharacter hcircumflex {\uchar1{37}} +\definecharacter Hstroke {\uchar1{38}} +\definecharacter hstroke {\uchar1{39}} +\definecharacter Itilde {\uchar1{40}} +\definecharacter itilde {\uchar1{41}} +\definecharacter Imacron {\uchar1{42}} +\definecharacter imacron {\uchar1{43}} +\definecharacter Ibreve {\uchar1{44}} +\definecharacter ibreve {\uchar1{45}} +\definecharacter Iogonek {\uchar1{46}} +\definecharacter iogonek {\uchar1{47}} +\definecharacter Idotaccent {\uchar1{48}} +\definecharacter dotlessi {\uchar1{49}} +\definecharacter IJligature {\uchar1{50}} +\definecharacter ijligature {\uchar1{51}} +\definecharacter Jcircumflex {\uchar1{52}} +\definecharacter jcircumflex {\uchar1{53}} +\definecharacter Kcommaaccent {\uchar1{54}} +\definecharacter kcommaaccent {\uchar1{55}} +\definecharacter kkra {\uchar1{56}} +\definecharacter Lacute {\uchar1{57}} +\definecharacter lacute {\uchar1{58}} +\definecharacter Lcommaaccent {\uchar1{59}} +\definecharacter lcommaaccent {\uchar1{60}} +\definecharacter Lcaron {\uchar1{61}} +\definecharacter lcaron {\uchar1{62}} +\definecharacter Ldotmiddle {\uchar1{63}} +\definecharacter ldotmiddle {\uchar1{64}} +\definecharacter Lstroke {\uchar1{65}} +\definecharacter lstroke {\uchar1{66}} +\definecharacter Nacute {\uchar1{67}} +\definecharacter nacute {\uchar1{68}} +\definecharacter Ncommaaccent {\uchar1{69}} +\definecharacter ncommaaccent {\uchar1{70}} +\definecharacter Ncaron {\uchar1{71}} +\definecharacter ncaron {\uchar1{72}} +\definecharacter napostrophe {\uchar1{73}} +\definecharacter Neng {\uchar1{74}} +\definecharacter neng {\uchar1{75}} +\definecharacter Omacron {\uchar1{76}} +\definecharacter omacron {\uchar1{77}} +\definecharacter Obreve {\uchar1{78}} +\definecharacter obreve {\uchar1{79}} +\definecharacter Ohungarumlaut {\uchar1{80}} +\definecharacter ohungarumlaut {\uchar1{81}} +\definecharacter OEligature {\uchar1{82}} +\definecharacter oeligature {\uchar1{83}} +\definecharacter Racute {\uchar1{84}} +\definecharacter racute {\uchar1{85}} +\definecharacter Rcommaaccent {\uchar1{86}} +\definecharacter rcommaaccent {\uchar1{87}} +\definecharacter Rcaron {\uchar1{88}} +\definecharacter rcaron {\uchar1{89}} +\definecharacter Sacute {\uchar1{90}} +\definecharacter sacute {\uchar1{91}} +\definecharacter Scircumflex {\uchar1{92}} +\definecharacter scircumflex {\uchar1{93}} +\definecharacter Scedilla {\uchar1{94}} +\definecharacter scedilla {\uchar1{95}} +\definecharacter Scaron {\uchar1{96}} +\definecharacter scaron {\uchar1{97}} +\definecharacter Tcedilla {\uchar1{98}} +\definecharacter tcedilla {\uchar1{99}} +\definecharacter Tcaron {\uchar1{100}} +\definecharacter tcaron {\uchar1{101}} +\definecharacter Tstroke {\uchar1{102}} +\definecharacter tstroke {\uchar1{103}} +\definecharacter Utilde {\uchar1{104}} +\definecharacter utilde {\uchar1{105}} +\definecharacter Umacron {\uchar1{106}} +\definecharacter umacron {\uchar1{107}} +\definecharacter Ubreve {\uchar1{108}} +\definecharacter ubreve {\uchar1{109}} +\definecharacter Uring {\uchar1{110}} +\definecharacter uring {\uchar1{111}} +\definecharacter Uhungarumlaut {\uchar1{112}} +\definecharacter uhungarumlaut {\uchar1{113}} +\definecharacter Uogonek {\uchar1{114}} +\definecharacter uogonek {\uchar1{115}} +\definecharacter Wcircumflex {\uchar1{116}} +\definecharacter wcircumflex {\uchar1{117}} +\definecharacter Ycircumflex {\uchar1{118}} +\definecharacter ycircumflex {\uchar1{119}} +\definecharacter Ydiaeresis {\uchar1{120}} +\definecharacter Zacute {\uchar1{121}} +\definecharacter zacute {\uchar1{122}} +\definecharacter Zdotaccent {\uchar1{123}} +\definecharacter zdotaccent {\uchar1{124}} +\definecharacter Zcaron {\uchar1{125}} +\definecharacter zcaron {\uchar1{126}} +\definecharacter slong {\uchar1{127}} + +\stopencoding + +\startencoding[uc] + +\definecharacter endash {\uchar{32}{19}} +\definecharacter emdash {\uchar{32}{20}} +\definecharacter quoteleft {\uchar{32}{24}} +\definecharacter quoteright {\uchar{32}{25}} +\definecharacter quotesinglebase {\uchar{32}{26}} + +\definecharacter quotedblleft {\uchar{32}{28}} +\definecharacter quotedblright {\uchar{32}{29}} +\definecharacter quotedblbase {\uchar{32}{30}} + +\definecharacter leftguillemot {\uchar0{171}} +\definecharacter rightguillemot {\uchar0{187}} + +\definecharacter guilsingleleft {\uchar{32}{57}} +\definecharacter guilsingleright {\uchar{32}{58}} + +\stopencoding + +%D Adam Lindsay's additions + +\startencoding[uc] + +\definecharacter exclamdown {\uchar0{161}} +\definecharacter textcent {\uchar0{162}} +\definecharacter textsterling {\uchar0{163}} +\definecharacter textcurrency {\uchar0{164}} +\definecharacter textyen {\uchar0{165}} +\definecharacter textbrokenbar {\uchar0{166}} +\definecharacter sectionmark {\uchar0{167}} +\definecharacter textdiaresis {\uchar0{168}} +\definecharacter copyright {\uchar0{169}} + +\definecharacter textlognot {\uchar0{172}} +\definecharacter softhyphen {\uchar0{173}} +\definecharacter registered {\uchar0{174}} +\definecharacter textmacron {\uchar0{175}} +\definecharacter textdegree {\uchar0{176}} +\definecharacter textpm {\uchar0{177}} +\definecharacter twosuperior {\uchar0{178}} +\definecharacter threesuperior {\uchar0{179}} +\definecharacter textacute {\uchar0{180}} +\definecharacter textmu {\uchar0{181}} +\definecharacter paragraphmark {\uchar0{182}} +\definecharacter periodcentered {\uchar0{183}} +\definecharacter textcedilla {\uchar0{184}} +\definecharacter onesuperior {\uchar0{185}} + +\definecharacter textgrave {\uchar3{0}} +\definecharacter textacute {\uchar3{1}} +\definecharacter textcircumflex {\uchar3{2}} +\definecharacter texttilde {\uchar3{3}} +\definecharacter textmacron {\uchar3{4}} +\definecharacter textbreve {\uchar3{6}} +\definecharacter textdotaccent {\uchar3{7}} +\definecharacter textdiaeresis {\uchar3{8}} +\definecharacter textring {\uchar3{10}} +\definecharacter texthungarumlaut {\uchar3{11}} +\definecharacter textcaron {\uchar3{12}} +\definecharacter textogonek {\uchar3{40}} + +\definecharacter percent {\uchar0{37}} +\definecharacter textunderscore {\uchar0{95}} + +\definecharacter ordfeminine {\uchar0{170}} +\definecharacter ordmasculine {\uchar0{186}} +\definecharacter onequarter {\uchar0{188}} +\definecharacter onehalf {\uchar0{189}} +\definecharacter threequarter {\uchar0{190}} +\definecharacter questiondown {\uchar0{191}} + +\definecharacter textmultiply {\uchar0{215}} +\definecharacter textdiv {\uchar0{247}} + +\definecharacter textminus {\uchar{32}{18}} +\definecharacter textdag {\uchar{32}{32}} +\definecharacter textddag {\uchar{32}{33}} +\definecharacter textbullet {\uchar{32}{34}} +\definecharacter textellipsis {\uchar{32}{38}} +\definecharacter perthousand {\uchar{32}{48}} + +%new: +\definecharacter Scommaaccent {\uchar2{24}} +\definecharacter scommaaccent {\uchar2{25}} +\definecharacter Tcommaaccent {\uchar2{26}} +\definecharacter tcommaaccent {\uchar2{27}} + +\stopencoding + +%D Mojca's and Taco's additions: + +\startencoding[uc] + +\definecharacter textasciicircum {\uchar{0}{94}} % 5e +\definecharacter textgrave {\uchar{0}{96}} % 60 +\definecharacter textdiaeresis {\uchar{0}{168}} % a8 +%definecharacter textmacron {\uchar{0}{175}} % af +%definecharacter textacute {\uchar{0}{180}} % b4 +%definecharacter textcedilla {\uchar{0}{184}} % b8 +\definecharacter textcircumflex {\uchar{2}{198}} % c6 +\definecharacter textcaron {\uchar{2}{199}} % c7 +\definecharacter textbreve {\uchar{2}{216}} % d8 +\definecharacter textdotaccent {\uchar{2}{217}} % d9 +\definecharacter textring {\uchar{2}{218}} % da +\definecharacter textogonek {\uchar{2}{219}} % db +\definecharacter texttilde {\uchar{2}{220}} % dc +\definecharacter texthungarumlaut {\uchar{2}{221}} % dd + +\stopencoding + +%D Vietnamese: + +\startencoding[uc] + +\definecharacter Ohorn {\uchar1{160}} +\definecharacter ohorn {\uchar1{161}} +\definecharacter Uhorn {\uchar1{175}} +\definecharacter uhorn {\uchar1{176}} + +\definecharacter Yhook {\uchar{30}{246}} +\definecharacter yhook {\uchar{30}{247}} +\definecharacter Ydotbelow {\uchar{30}{244}} +\definecharacter ydotbelow {\uchar{30}{245}} +\definecharacter Ahook {\uchar{30}{162}} +\definecharacter Adotbelow {\uchar{30}{160}} +\definecharacter Acircumflexgrave {\uchar{30}{166}} +\definecharacter Acircumflexacute {\uchar{30}{164}} +\definecharacter Acircumflextilde {\uchar{30}{170}} +\definecharacter Acircumflexhook {\uchar{30}{168}} +\definecharacter Acircumflexdotbelow {\uchar{30}{172}} +\definecharacter Abrevegrave {\uchar{30}{176}} +\definecharacter Abreveacute {\uchar{30}{174}} +\definecharacter Abrevetilde {\uchar{30}{180}} +\definecharacter Abrevehook {\uchar{30}{178}} +\definecharacter Abrevedotbelow {\uchar{30}{182}} +\definecharacter Ehook {\uchar{30}{186}} +\definecharacter Edotbelow {\uchar{30}{184}} +\definecharacter Ecircumflexgrave {\uchar{30}{192}} +\definecharacter Ecircumflexacute {\uchar{30}{190}} +\definecharacter Ecircumflextilde {\uchar{30}{196}} +\definecharacter Ecircumflexhook {\uchar{30}{194}} +\definecharacter Ecircumflexdotbelow {\uchar{30}{198}} +\definecharacter Ihook {\uchar{30}{200}} +\definecharacter ahook {\uchar{30}{163}} +\definecharacter adotbelow {\uchar{30}{161}} +\definecharacter acircumflexgrave {\uchar{30}{167}} +\definecharacter acircumflexacute {\uchar{30}{165}} +\definecharacter acircumflextilde {\uchar{30}{171}} +\definecharacter acircumflexhook {\uchar{30}{169}} +\definecharacter acircumflexdotbelow {\uchar{30}{173}} +\definecharacter abrevegrave {\uchar{30}{177}} +\definecharacter abreveacute {\uchar{30}{175}} +\definecharacter abrevetilde {\uchar{30}{181}} +\definecharacter abrevehook {\uchar{30}{179}} +\definecharacter abrevedotbelow {\uchar{30}{183}} +\definecharacter ehook {\uchar{30}{187}} +\definecharacter edotbelow {\uchar{30}{185}} +\definecharacter ecircumflexgrave {\uchar{30}{193}} +\definecharacter ecircumflexacute {\uchar{30}{191}} +\definecharacter ecircumflextilde {\uchar{30}{197}} +\definecharacter ecircumflexhook {\uchar{30}{195}} +\definecharacter ecircumflexdotbelow {\uchar{30}{199}} +\definecharacter ihook {\uchar{30}{201}} +\definecharacter Idotbelow {\uchar{30}{202}} +\definecharacter Ohook {\uchar{30}{206}} +\definecharacter Odotbelow {\uchar{30}{204}} +\definecharacter Ocircumflexgrave {\uchar{30}{210}} +\definecharacter Ocircumflexacute {\uchar{30}{208}} +\definecharacter Ocircumflextilde {\uchar{30}{214}} +\definecharacter Ocircumflexhook {\uchar{30}{212}} +\definecharacter Ocircumflexdotbelow {\uchar{30}{216}} +\definecharacter Ohorngrave {\uchar{30}{220}} +\definecharacter Ohornacute {\uchar{30}{218}} +\definecharacter Ohorntilde {\uchar{30}{224}} +\definecharacter Ohornhook {\uchar{30}{222}} +\definecharacter Ohorndotbelow {\uchar{30}{226}} +\definecharacter Uhook {\uchar{30}{230}} +\definecharacter Udotbelow {\uchar{30}{228}} +\definecharacter Uhorngrave {\uchar{30}{234}} +\definecharacter Uhornacute {\uchar{30}{232}} +\definecharacter Uhorntilde {\uchar{30}{238}} +\definecharacter Uhornhook {\uchar{30}{236}} +\definecharacter Uhorndotbelow {\uchar{30}{240}} +\definecharacter Ytilde {\uchar{30}{248}} +\definecharacter idotbelow {\uchar{30}{203}} +\definecharacter ohook {\uchar{30}{207}} +\definecharacter odotbelow {\uchar{30}{205}} +\definecharacter ocircumflexgrave {\uchar{30}{211}} +\definecharacter ocircumflexacute {\uchar{30}{209}} +\definecharacter ocircumflextilde {\uchar{30}{215}} +\definecharacter ocircumflexhook {\uchar{30}{213}} +\definecharacter ocircumflexdotbelow {\uchar{30}{217}} +\definecharacter ohorngrave {\uchar{30}{221}} +\definecharacter ohornacute {\uchar{30}{219}} +\definecharacter ohorntilde {\uchar{30}{225}} +\definecharacter ohornhook {\uchar{30}{223}} +\definecharacter ohorndotbelow {\uchar{30}{227}} +\definecharacter uhook {\uchar{30}{231}} +\definecharacter udotbelow {\uchar{30}{229}} +\definecharacter uhorngrave {\uchar{30}{235}} +\definecharacter uhornacute {\uchar{30}{233}} +\definecharacter uhorntilde {\uchar{30}{239}} +\definecharacter uhornhook {\uchar{30}{237}} +\definecharacter uhorndotbelow {\uchar{30}{241}} +\definecharacter ytilde {\uchar{30}{249}} + +\definecharacter Etilde {\uchar{30}{188}} +\definecharacter etilde {\uchar{30}{189}} +\definecharacter Ygrave {\uchar{30}{242}} +\definecharacter ygrave {\uchar{30}{243}} + +\stopencoding + +% Greek: + +\startencoding[uc] + +\definecharacter greekAlphatonos {\uchar3{134}} +\definecharacter greekEpsilontonos {\uchar3{136}} +\definecharacter greekEtatonos {\uchar3{137}} +\definecharacter greekIotatonos {\uchar3{138}} +\definecharacter greekOmicrontonos {\uchar3{140}} +\definecharacter greekUpsilontonos {\uchar3{142}} +\definecharacter greekOmegatonos {\uchar3{143}} +\definecharacter greekiotadialytikatonos {\uchar3{144}} +\definecharacter greekAlpha {\uchar3{145}} +\definecharacter greekBeta {\uchar3{146}} +\definecharacter greekGamma {\uchar3{147}} +\definecharacter greekDelta {\uchar3{148}} +\definecharacter greekEpsilon {\uchar3{149}} +\definecharacter greekZeta {\uchar3{150}} +\definecharacter greekEta {\uchar3{151}} +\definecharacter greekTheta {\uchar3{152}} +\definecharacter greekIota {\uchar3{153}} +\definecharacter greekKappa {\uchar3{154}} +\definecharacter greekLambda {\uchar3{155}} +\definecharacter greekMu {\uchar3{156}} +\definecharacter greekNu {\uchar3{157}} +\definecharacter greekXi {\uchar3{158}} +\definecharacter greekOmicron {\uchar3{159}} +\definecharacter greekPi {\uchar3{160}} +\definecharacter greekRho {\uchar3{161}} +\definecharacter greekSigma {\uchar3{163}} +\definecharacter greekTau {\uchar3{164}} +\definecharacter greekUpsilon {\uchar3{165}} +\definecharacter greekPhi {\uchar3{166}} +\definecharacter greekChi {\uchar3{167}} +\definecharacter greekPsi {\uchar3{168}} +\definecharacter greekOmega {\uchar3{169}} + +\definecharacter greekalpha {\uchar3{177}} +\definecharacter greekbeta {\uchar3{178}} +\definecharacter greekgamma {\uchar3{179}} +\definecharacter greekdelta {\uchar3{180}} +\definecharacter greekepsilon {\uchar3{181}} +\definecharacter greekzeta {\uchar3{182}} +\definecharacter greeketa {\uchar3{183}} +\definecharacter greektheta {\uchar3{184}} +\definecharacter greekiota {\uchar3{185}} +\definecharacter greekkappa {\uchar3{186}} +\definecharacter greeklambda {\uchar3{187}} +\definecharacter greekmu {\uchar3{188}} +\definecharacter greeknu {\uchar3{189}} +\definecharacter greekxi {\uchar3{190}} +\definecharacter greekomicron {\uchar3{191}} +\definecharacter greekpi {\uchar3{192}} +\definecharacter greekrho {\uchar3{193}} +\definecharacter greekfinalsigma {\uchar3{194}} +\definecharacter greeksigma {\uchar3{195}} +\definecharacter greektau {\uchar3{196}} +\definecharacter greekupsilon {\uchar3{197}} +\definecharacter greekphi {\uchar3{198}} +\definecharacter greekchi {\uchar3{199}} +\definecharacter greekpsi {\uchar3{200}} +\definecharacter greekomega {\uchar3{201}} +\definecharacter greekiotadialytika {\uchar3{202}} +\definecharacter greekupsilondialytika {\uchar3{203}} +\definecharacter greekomicrontonos {\uchar3{204}} +\definecharacter greekupsilontonos {\uchar3{205}} +\definecharacter greekomegatonos {\uchar3{206}} + +\definecharacter greekIotadialytika {\uchar3{170}} +\definecharacter greekUpsilondialytika {\uchar3{171}} + +\definecharacter greekalphatonos {\uchar3{172}} +\definecharacter greekepsilontonos {\uchar3{173}} +\definecharacter greeketatonos {\uchar3{174}} +\definecharacter greekiotatonos {\uchar3{175}} +\definecharacter greekupsilondialytikatonos {\uchar3{176}} + +% new: +\definecharacter greekthetaalt {\uchar3{209}} +\definecharacter greekphialt {\uchar3{213}} +\definecharacter greekpialt {\uchar3{214}} +\definecharacter greekrhoalt {\uchar3{241}} +\definecharacter greekepsilonalt {\uchar3{245}} + +\stopencoding + +% Cyrillic: + +\startencoding[uc] + +\definecharacter cyrillicA {\uchar4{16}} +\definecharacter cyrillicB {\uchar4{17}} +\definecharacter cyrillicV {\uchar4{18}} +\definecharacter cyrillicG {\uchar4{19}} +\definecharacter cyrillicD {\uchar4{20}} +\definecharacter cyrillicE {\uchar4{21}} +\definecharacter cyrillicZH {\uchar4{22}} +\definecharacter cyrillicZ {\uchar4{23}} +\definecharacter cyrillicI {\uchar4{24}} +\definecharacter cyrillicISHRT {\uchar4{25}} +\definecharacter cyrillicK {\uchar4{26}} +\definecharacter cyrillicL {\uchar4{27}} +\definecharacter cyrillicM {\uchar4{28}} +\definecharacter cyrillicN {\uchar4{29}} +\definecharacter cyrillicO {\uchar4{30}} +\definecharacter cyrillicP {\uchar4{31}} +\definecharacter cyrillicR {\uchar4{32}} +\definecharacter cyrillicS {\uchar4{33}} +\definecharacter cyrillicT {\uchar4{34}} +\definecharacter cyrillicU {\uchar4{35}} +\definecharacter cyrillicF {\uchar4{36}} +\definecharacter cyrillicH {\uchar4{37}} +\definecharacter cyrillicC {\uchar4{38}} +\definecharacter cyrillicCH {\uchar4{39}} +\definecharacter cyrillicSH {\uchar4{40}} +\definecharacter cyrillicSHCH {\uchar4{41}} +\definecharacter cyrillicHRDSN {\uchar4{42}} +\definecharacter cyrillicERY {\uchar4{43}} +\definecharacter cyrillicSFTSN {\uchar4{44}} +\definecharacter cyrillicEREV {\uchar4{45}} +\definecharacter cyrillicYU {\uchar4{46}} +\definecharacter cyrillicYA {\uchar4{47}} + +\definecharacter cyrillica {\uchar4{48}} +\definecharacter cyrillicb {\uchar4{49}} +\definecharacter cyrillicv {\uchar4{50}} +\definecharacter cyrillicg {\uchar4{51}} +\definecharacter cyrillicd {\uchar4{52}} +\definecharacter cyrillice {\uchar4{53}} +\definecharacter cyrilliczh {\uchar4{54}} +\definecharacter cyrillicz {\uchar4{55}} +\definecharacter cyrillici {\uchar4{56}} +\definecharacter cyrillicishrt {\uchar4{57}} +\definecharacter cyrillick {\uchar4{58}} +\definecharacter cyrillicl {\uchar4{59}} +\definecharacter cyrillicm {\uchar4{60}} +\definecharacter cyrillicn {\uchar4{61}} +\definecharacter cyrillico {\uchar4{62}} +\definecharacter cyrillicp {\uchar4{63}} +\definecharacter cyrillicr {\uchar4{64}} +\definecharacter cyrillics {\uchar4{65}} +\definecharacter cyrillict {\uchar4{66}} +\definecharacter cyrillicu {\uchar4{67}} +\definecharacter cyrillicf {\uchar4{68}} +\definecharacter cyrillich {\uchar4{69}} +\definecharacter cyrillicc {\uchar4{70}} +\definecharacter cyrillicch {\uchar4{71}} +\definecharacter cyrillicsh {\uchar4{72}} +\definecharacter cyrillicshch {\uchar4{73}} +\definecharacter cyrillichrdsn {\uchar4{74}} +\definecharacter cyrillicery {\uchar4{75}} +\definecharacter cyrillicsftsn {\uchar4{76}} +\definecharacter cyrillicerev {\uchar4{77}} +\definecharacter cyrillicyu {\uchar4{78}} +\definecharacter cyrillicya {\uchar4{79}} + +%D I tried to figure out what these were, but the unicode +%D tables suggested they were the same as cyrillici, which was +%D already defined! So, a temporary definition: + +% \def\cyrillicII{\cyrillicI} +% \def\cyrillicii{\cyrillici} + +%D a guess derived from looking at enco-cyr suggests that this is +%D identical to the Roman I/i pair. To me, that sounds like +%D CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I in the UC tables! + +\definecharacter cyrillicII {\uchar4{6}} +\definecharacter cyrillicii {\uchar4{86}} + +%D Guessing that tlir6a corresponds with t2a encoding as advertised, +%D here are some more, cos I had some spare time: (AL) + +\definecharacter cyrillicDJE {\uchar4{2}} +\definecharacter cyrillicTSHE {\uchar4{11}} +%definecharacter cyrillicSHHA 132 +%definecharacter cyrillicZHDSC 133 +\definecharacter cyrillicZDSC {\uchar4{152}} +\definecharacter cyrillicLJE {\uchar4{9}} +\definecharacter cyrillicYI {\uchar4{7}} +\definecharacter cyrillicAE {\uchar4{212}} +%definecharacter cyrillicNDSC 141 +%definecharacter cyrillicNG 142 +\definecharacter cyrillicDZE {\uchar4{5}} +%definecharacter cyrillicOTLD 144 +\definecharacter cyrillicSDSC {\uchar4{170}} +\definecharacter cyrillicUSHRT {\uchar4{14}} +%definecharacter cyrillicY 147 +%definecharacter cyrillicYHCRS 148 +%definecharacter cyrillicHDSC 149 +\definecharacter cyrillicDZHE {\uchar4{15}} +\definecharacter cyrillicIE {\uchar4{4}} +\definecharacter cyrillicNJE {\uchar4{10}} +\definecharacter cyrillicYO {\uchar4{1}} + +\definecharacter cyrillicdje {\uchar4{82}} +\definecharacter cyrillictshe {\uchar4{91}} +%definecharacter cyrillicshha 164 +%definecharacter cyrilliczhdsc 165 +\definecharacter cyrilliczdsc {\uchar4{153}} +\definecharacter cyrilliclje {\uchar4{89}} +\definecharacter cyrillicyi {\uchar4{87}} +\definecharacter cyrillicae {\uchar4{213}} +%definecharacter cyrillicndsc 173 +%definecharacter cyrillicng 174 +\definecharacter cyrillicdze {\uchar4{85}} +%definecharacter cyrillicotld 176 +\definecharacter cyrillicsdsc {\uchar4{171}} +\definecharacter cyrillicushrt {\uchar4{94}} +%definecharacter cyrillicy 179 +%definecharacter cyrillicyhcrs 180 +%definecharacter cyrillichdsc 181 +\definecharacter cyrillicdzhe {\uchar4{95}} +\definecharacter cyrillicie {\uchar4{84}} +\definecharacter cyrillicnje {\uchar4{90}} +\definecharacter cyrillicyo {\uchar4{81}} + +% is there overlap with the above definitions + +\definecharacter cyrillicEgrave {\uchar4{0}} +\definecharacter cyrillicGJE {\uchar4{3}} +\definecharacter cyrillicJE {\uchar4{8}} +\definecharacter cyrillicKJE {\uchar4{12}} +\definecharacter cyrillicIgrave {\uchar4{13}} +\definecharacter cyrillicegrave {\uchar4{80}} +\definecharacter cyrillicgje {\uchar4{83}} +\definecharacter cyrillicje {\uchar4{88}} +\definecharacter cyrillickje {\uchar4{92}} +\definecharacter cyrillicigrave {\uchar4{93}} +\definecharacter cyrillicOMEGA {\uchar4{96}} +\definecharacter cyrillicomega {\uchar4{97}} +\definecharacter cyrillicYAT {\uchar4{98}} +\definecharacter cyrillicyat {\uchar4{99}} +\definecharacter cyrillicEiotified {\uchar4{100}} +\definecharacter cyrilliceiotified {\uchar4{101}} +\definecharacter cyrillicLITTLEYUS {\uchar4{102}} +\definecharacter cyrilliclittleyus {\uchar4{103}} +\definecharacter cyrillicLITTLEYUSiotified {\uchar4{104}} +\definecharacter cyrilliclittleyusiotified {\uchar4{105}} +\definecharacter cyrillicBIGYUS {\uchar4{106}} +\definecharacter cyrillicbigyus {\uchar4{107}} +\definecharacter cyrillicBIGYUSiotified {\uchar4{108}} +\definecharacter cyrillicbigyusiotified {\uchar4{109}} +\definecharacter cyrillicKSI {\uchar4{110}} +\definecharacter cyrillicksi {\uchar4{111}} +\definecharacter cyrillicPSI {\uchar4{112}} +\definecharacter cyrillicpsi {\uchar4{113}} +\definecharacter cyrillicFITA {\uchar4{114}} +\definecharacter cyrillicfita {\uchar4{115}} +\definecharacter cyrillicIZHITSA {\uchar4{116}} +\definecharacter cyrillicizhitsa {\uchar4{117}} +\definecharacter cyrillicIZHITSAdoublegrave {\uchar4{118}} +\definecharacter cyrillicizhitsadoublegrave {\uchar4{119}} +\definecharacter cyrillicUK {\uchar4{120}} +\definecharacter cyrillicuk {\uchar4{121}} +\definecharacter cyrillicOMEGAround {\uchar4{122}} +\definecharacter cyrillicomegaround {\uchar4{123}} +\definecharacter cyrillicOMEGAtitlo {\uchar4{124}} +\definecharacter cyrillicomegatitlo {\uchar4{125}} +\definecharacter cyrillicOT {\uchar4{126}} +\definecharacter cyrillicot {\uchar4{127}} +\definecharacter cyrillicKOPPA {\uchar4{128}} +\definecharacter cyrillickoppa {\uchar4{129}} +\definecharacter cyrillicTITLO {\uchar4{131}} +\definecharacter cyrillicPALATALIZATION {\uchar4{132}} +\definecharacter cyrillicDASIAPNEUMATA {\uchar4{133}} +\definecharacter cyrillicPSILIPNEUMATA {\uchar4{134}} +\definecharacter cyrillicISHRTtail {\uchar4{138}} +\definecharacter cyrillicishrttail {\uchar4{139}} +\definecharacter cyrillicSEMISOFT {\uchar4{140}} +\definecharacter cyrillicsemisoft {\uchar4{141}} +\definecharacter cyrillicERtick {\uchar4{142}} +\definecharacter cyrillicertick {\uchar4{143}} +\definecharacter cyrillicGHEupturn {\uchar4{144}} +\definecharacter cyrillicgheupturn {\uchar4{145}} +\definecharacter cyrillicGHEstroke {\uchar4{146}} +\definecharacter cyrillicghestroke {\uchar4{147}} +\definecharacter cyrillicGHEmidhook {\uchar4{148}} +\definecharacter cyrillicghemidhook {\uchar4{149}} +\definecharacter cyrillicZHEdescender {\uchar4{150}} +\definecharacter cyrilliczhedescender {\uchar4{151}} +\definecharacter cyrillicZDSC {\uchar4{152}} +\definecharacter cyrilliczdsc {\uchar4{153}} +\definecharacter cyrillicKADC {\uchar4{154}} +\definecharacter cyrillickadc {\uchar4{155}} +\definecharacter cyrillicKAvertstroke {\uchar4{156}} +\definecharacter cyrillickavertstroke {\uchar4{157}} +\definecharacter cyrillicKAstroke {\uchar4{158}} +\definecharacter cyrillickastroke {\uchar4{159}} +\definecharacter cyrillicKAbashkir {\uchar4{160}} +\definecharacter cyrillickabashkir {\uchar4{161}} +\definecharacter cyrillicENDC {\uchar4{162}} +\definecharacter cyrillicendc {\uchar4{163}} +\definecharacter cyrillicENGHE {\uchar4{164}} +\definecharacter cyrillicenghe {\uchar4{165}} +\definecharacter cyrillicPEmidhook {\uchar4{166}} +\definecharacter cyrillicpemidhook {\uchar4{167}} +\definecharacter cyrillicHA {\uchar4{168}} +\definecharacter cyrillicha {\uchar4{169}} +%definecharacter cyrillicSDSC {\uchar4{170}} % already defined +%definecharacter cyrilliccdsc {\uchar4{171}} % already defined +\definecharacter cyrillicTEDC {\uchar4{172}} +\definecharacter cyrillictedc {\uchar4{173}} +\definecharacter cyrillicYstr {\uchar4{174}} +\definecharacter cyrillicystr {\uchar4{175}} +\definecharacter cyrillicYstrstroke {\uchar4{176}} +\definecharacter cyrillicystrstroke {\uchar4{177}} +\definecharacter cyrillicHADC {\uchar4{178}} +\definecharacter cyrillichadc {\uchar4{179}} +\definecharacter cyrillicTETSE {\uchar4{180}} +\definecharacter cyrillictetse {\uchar4{181}} +\definecharacter cyrillicCHEDC {\uchar4{182}} +\definecharacter cyrillicchedc {\uchar4{183}} +\definecharacter cyrillicCHEvertstroke {\uchar4{184}} +\definecharacter cyrillicchevertstroke {\uchar4{185}} +\definecharacter cyrillicSHHA {\uchar4{186}} +\definecharacter cyrillicshha {\uchar4{187}} +\definecharacter cyrillicCHEabkhasian {\uchar4{188}} +\definecharacter cyrilliccheabkhasian {\uchar4{189}} +\definecharacter cyrillicCHEDCabkhasian {\uchar4{190}} +\definecharacter cyrillicchedcabkhasian {\uchar4{191}} +\definecharacter cyrillicPALOCHKA {\uchar4{192}} +\definecharacter cyrillicZHEbreve {\uchar4{193}} +\definecharacter cyrilliczhebreve {\uchar4{194}} +\definecharacter cyrillicKAhook {\uchar4{195}} +\definecharacter cyrillickahook {\uchar4{196}} +\definecharacter cyrillicELtail {\uchar4{197}} +\definecharacter cyrilliceltail {\uchar4{198}} +\definecharacter cyrillicENhook {\uchar4{199}} +\definecharacter cyrillicenhook {\uchar4{200}} +\definecharacter cyrillicENtail {\uchar4{201}} +\definecharacter cyrillicentail {\uchar4{202}} +\definecharacter cyrillicCHEkhakassian {\uchar4{203}} +\definecharacter cyrillicchekhakassian {\uchar4{204}} +\definecharacter cyrillicEMtail {\uchar4{205}} +\definecharacter cyrillicemtail {\uchar4{206}} +\definecharacter cyrillicAbreve {\uchar4{208}} +\definecharacter cyrillicabreve {\uchar4{209}} +\definecharacter cyrillicAdiaeresis {\uchar4{210}} +\definecharacter cyrillicadiaeresis {\uchar4{211}} +%definecharacter cyrillicAE {\uchar4{212}} % already defined +%definecharacter cyrillicae {\uchar4{213}} % already defined +\definecharacter cyrillicEbreve {\uchar4{214}} +\definecharacter cyrillicebreve {\uchar4{215}} +\definecharacter cyrillicSCHWA {\uchar4{216}} +\definecharacter cyrillicschwa {\uchar4{217}} +\definecharacter cyrillicSCHWAdiaeresis {\uchar4{218}} +\definecharacter cyrillicschwadiaeresis {\uchar4{219}} +\definecharacter cyrillicZHEdiaeresis {\uchar4{220}} +\definecharacter cyrilliczhediaeresis {\uchar4{221}} +\definecharacter cyrillicZEdiaeresis {\uchar4{222}} +\definecharacter cyrilliczediaeresis {\uchar4{223}} +\definecharacter cyrillicDZEabkhasian {\uchar4{224}} +\definecharacter cyrillicdzeabkhasian {\uchar4{225}} +\definecharacter cyrillicImacron {\uchar4{226}} +\definecharacter cyrillicimacron {\uchar4{227}} +\definecharacter cyrillicIdiaeresis {\uchar4{228}} +\definecharacter cyrillicidiaeresis {\uchar4{229}} +\definecharacter cyrillicOdiaeresis {\uchar4{230}} +\definecharacter cyrillicodiaeresis {\uchar4{231}} +\definecharacter cyrillicObarred {\uchar4{232}} +\definecharacter cyrillicobarred {\uchar4{233}} +\definecharacter cyrillicObarreddiaeresis {\uchar4{234}} +\definecharacter cyrillicobarreddiaeresis {\uchar4{235}} +\definecharacter cyrillicEdiaeresis {\uchar4{236}} +\definecharacter cyrillicediaeresis {\uchar4{237}} +\definecharacter cyrillicUmacron {\uchar4{238}} +\definecharacter cyrillicumacron {\uchar4{239}} +\definecharacter cyrillicUdiaeresis {\uchar4{240}} +\definecharacter cyrillicudiaeresis {\uchar4{241}} +\definecharacter cyrillicUdoubleacute {\uchar4{242}} +\definecharacter cyrillicudoubleacute {\uchar4{243}} +\definecharacter cyrillicCHEdiaeresis {\uchar4{244}} +\definecharacter cyrillicchediaeresis {\uchar4{245}} +\definecharacter cyrillicYERUdiaeresis {\uchar4{248}} +\definecharacter cyrillicyerudiaeresis {\uchar4{249}} + +\stopencoding + +% Greek Extended + +\startencoding[uc] + +\definecharacter greekalphapsili {\uchar{31}{0}} +\definecharacter greekalphadasia {\uchar{31}{1}} +\definecharacter greekalphapsilivaria {\uchar{31}{2}} +\definecharacter greekalphadasiavaria {\uchar{31}{3}} +\definecharacter greekalphapsilitonos {\uchar{31}{4}} +\definecharacter greekalphadasiatonos {\uchar{31}{5}} +\definecharacter greekalphapsiliperispomeni {\uchar{31}{6}} +\definecharacter greekalphadasiaperispomeni {\uchar{31}{7}} +\definecharacter greekAlphapsili {\uchar{31}{8}} +\definecharacter greekAlphadasia {\uchar{31}{9}} +\definecharacter greekAlphapsilivaria {\uchar{31}{10}} +\definecharacter greekAlphadasiavaria {\uchar{31}{11}} +\definecharacter greekAlphapsilitonos {\uchar{31}{12}} +\definecharacter greekAlphadasiatonos {\uchar{31}{13}} +\definecharacter greekAlphapsiliperispomeni {\uchar{31}{14}} +\definecharacter greekAlphadasiaperispomeni {\uchar{31}{15}} +\definecharacter greekepsilonpsili {\uchar{31}{16}} % 1f10 +\definecharacter greekepsilondasia {\uchar{31}{17}} +\definecharacter greekepsilonpsilivaria {\uchar{31}{18}} +\definecharacter greekepsilondasiavaria {\uchar{31}{19}} +\definecharacter greekepsilonpsilitonos {\uchar{31}{20}} +\definecharacter greekepsilondasiatonos {\uchar{31}{21}} +\definecharacter greekEpsilonpsili {\uchar{31}{24}} +\definecharacter greekEpsilondasia {\uchar{31}{25}} +\definecharacter greekEpsilonpsilivaria {\uchar{31}{26}} +\definecharacter greekEpsilondasiavaria {\uchar{31}{27}} +\definecharacter greekEpsilonpsilitonos {\uchar{31}{28}} +\definecharacter greekEpsilondasiatonos {\uchar{31}{29}} +\definecharacter greeketapsili {\uchar{31}{32}} % 1f20 +\definecharacter greeketadasia {\uchar{31}{33}} +\definecharacter greeketapsilivaria {\uchar{31}{34}} +\definecharacter greeketadasiavaria {\uchar{31}{35}} +\definecharacter greeketapsilitonos {\uchar{31}{36}} +\definecharacter greeketadasiatonos {\uchar{31}{37}} +\definecharacter greeketapsiliperispomeni {\uchar{31}{38}} +\definecharacter greeketadasiaperispomeni {\uchar{31}{39}} +\definecharacter greekEtapsili {\uchar{31}{40}} +\definecharacter greekEtadasia {\uchar{31}{41}} +\definecharacter greekEtapsilivaria {\uchar{31}{42}} +\definecharacter greekEtadasiavaria {\uchar{31}{43}} +\definecharacter greekEtapsilitonos {\uchar{31}{44}} +\definecharacter greekEtadasiatonos {\uchar{31}{45}} +\definecharacter greekEtapsiliperispomeni {\uchar{31}{46}} +\definecharacter greekEtadasiaperispomeni {\uchar{31}{47}} +\definecharacter greekiotapsili {\uchar{31}{48}} % 1f30 +\definecharacter greekiotadasia {\uchar{31}{49}} +\definecharacter greekiotapsilivaria {\uchar{31}{50}} +\definecharacter greekiotadasiavaria {\uchar{31}{51}} +\definecharacter greekiotapsilitonos {\uchar{31}{52}} +\definecharacter greekiotadasiatonos {\uchar{31}{53}} +\definecharacter greekiotapsiliperispomeni {\uchar{31}{54}} +\definecharacter greekiotadasiaperispomeni {\uchar{31}{55}} +\definecharacter greekIotapsili {\uchar{31}{56}} +\definecharacter greekIotadasia {\uchar{31}{57}} +\definecharacter greekIotapsilivaria {\uchar{31}{58}} +\definecharacter greekIotadasiavaria {\uchar{31}{59}} +\definecharacter greekIotapsilitonos {\uchar{31}{60}} +\definecharacter greekIotadasiatonos {\uchar{31}{61}} +\definecharacter greekIotapsiliperispomeni {\uchar{31}{62}} +\definecharacter greekIotadasiaperispomeni {\uchar{31}{63}} +\definecharacter greekomicronpsili {\uchar{31}{64}} % 1f40 +\definecharacter greekomicrondasia {\uchar{31}{65}} +\definecharacter greekomicronpsilivaria {\uchar{31}{66}} +\definecharacter greekomicrondasiavaria {\uchar{31}{67}} +\definecharacter greekomicronpsilitonos {\uchar{31}{68}} +\definecharacter greekomicrondasiatonos {\uchar{31}{69}} +\definecharacter greekOmicronpsili {\uchar{31}{72}} +\definecharacter greekOmicrondasia {\uchar{31}{73}} +\definecharacter greekOmicronpsilivaria {\uchar{31}{74}} +\definecharacter greekOmicrondasiavaria {\uchar{31}{75}} +\definecharacter greekOmicronpsilitonos {\uchar{31}{76}} +\definecharacter greekOmicrondasiatonos {\uchar{31}{77}} +\definecharacter greekupsilonpsili {\uchar{31}{80}} % 1f50 +\definecharacter greekupsilondasia {\uchar{31}{81}} +\definecharacter greekupsilonpsilivaria {\uchar{31}{82}} +\definecharacter greekupsilondasiavaria {\uchar{31}{83}} +\definecharacter greekupsilonpsilitonos {\uchar{31}{84}} +\definecharacter greekupsilondasiatonos {\uchar{31}{85}} +\definecharacter greekupsilonpsiliperispomeni {\uchar{31}{86}} +\definecharacter greekupsilondasiaperispomeni {\uchar{31}{87}} +\definecharacter greekUpsilondasia {\uchar{31}{89}} +\definecharacter greekUpsilondasiavaria {\uchar{31}{91}} +\definecharacter greekUpsilondasiatonos {\uchar{31}{93}} +\definecharacter greekUpsilondasiaperispomeni {\uchar{31}{95}} +\definecharacter greekomegapsili {\uchar{31}{96}} % 1f60 +\definecharacter greekomegadasia {\uchar{31}{97}} +\definecharacter greekomegapsilivaria {\uchar{31}{98}} +\definecharacter greekomegadasiavaria {\uchar{31}{99}} +\definecharacter greekomegapsilitonos {\uchar{31}{100}} +\definecharacter greekomegadasiatonos {\uchar{31}{101}} +\definecharacter greekomegapsiliperispomeni {\uchar{31}{102}} +\definecharacter greekomegadasiaperispomeni {\uchar{31}{103}} +\definecharacter greekOmegapsili {\uchar{31}{104}} +\definecharacter greekOmegadasia {\uchar{31}{105}} +\definecharacter greekOmegapsilivaria {\uchar{31}{106}} +\definecharacter greekOmegadasiavaria {\uchar{31}{107}} +\definecharacter greekOmegapsilitonos {\uchar{31}{108}} +\definecharacter greekOmegadasiatonos {\uchar{31}{109}} +\definecharacter greekOmegapsiliperispomeni {\uchar{31}{110}} +\definecharacter greekOmegadasiaperispomeni {\uchar{31}{111}} +\definecharacter greekalphavaria {\uchar{31}{112}} % 1f70 +\definecharacter greekalphaoxia {\uchar{31}{113}} +\definecharacter greekepsilonvaria {\uchar{31}{114}} +\definecharacter greekepsilonoxia {\uchar{31}{115}} +\definecharacter greeketavaria {\uchar{31}{116}} +\definecharacter greeketaoxia {\uchar{31}{117}} +\definecharacter greekiotavaria {\uchar{31}{118}} +\definecharacter greekiotaoxia {\uchar{31}{119}} +\definecharacter greekomicronvaria {\uchar{31}{120}} +\definecharacter greekomicronoxia {\uchar{31}{121}} +\definecharacter greekupsilonvaria {\uchar{31}{122}} +\definecharacter greekupsilonoxia {\uchar{31}{123}} +\definecharacter greekomegavaria {\uchar{31}{124}} +\definecharacter greekomegaoxia {\uchar{31}{125}} +\definecharacter greekalphaiotasubpsili {\uchar{31}{128}} % 1f80 +\definecharacter greekalphaiotasubdasia {\uchar{31}{129}} +\definecharacter greekalphaiotasubpsilivaria {\uchar{31}{130}} +\definecharacter greekalphaiotasubdasiavaria {\uchar{31}{131}} +\definecharacter greekalphaiotasubpsilitonos {\uchar{31}{132}} +\definecharacter greekalphaiotasubdasiatonos {\uchar{31}{133}} +\definecharacter greekalphaiotasubpsiliperispomeni {\uchar{31}{134}} +\definecharacter greekalphaiotasubdasiaperispomeni {\uchar{31}{135}} +\definecharacter greekAlphaiotasubpsili {\uchar{31}{136}} +\definecharacter greekAlphaiotasubdasia {\uchar{31}{137}} +\definecharacter greekAlphaiotasubpsilivaria {\uchar{31}{138}} +\definecharacter greekAlphaiotasubdasiavaria {\uchar{31}{139}} +\definecharacter greekAlphaiotasubpsilitonos {\uchar{31}{140}} +\definecharacter greekAlphaiotasubdasiatonos {\uchar{31}{141}} +\definecharacter greekAlphaiotasubpsiliperispomeni {\uchar{31}{142}} +\definecharacter greekAlphaiotasubdasiaperispomeni {\uchar{31}{143}} +\definecharacter greeketaiotasubpsili {\uchar{31}{144}} % 1f90 +\definecharacter greeketaiotasubdasia {\uchar{31}{145}} +\definecharacter greeketaiotasubpsilivaria {\uchar{31}{146}} +\definecharacter greeketaiotasubdasiavaria {\uchar{31}{147}} +\definecharacter greeketaiotasubpsilitonos {\uchar{31}{148}} +\definecharacter greeketaiotasubdasiatonos {\uchar{31}{149}} +\definecharacter greeketaiotasubpsiliperispomeni {\uchar{31}{150}} +\definecharacter greeketaiotasubdasiaperispomeni {\uchar{31}{151}} +\definecharacter greekEtaiotasubpsili {\uchar{31}{152}} +\definecharacter greekEtaiotasubdasia {\uchar{31}{153}} +\definecharacter greekEtaiotasubpsilivaria {\uchar{31}{154}} +\definecharacter greekEtaiotasubdasiavaria {\uchar{31}{155}} +\definecharacter greekEtaiotasubpsilitonos {\uchar{31}{156}} +\definecharacter greekEtaiotasubdasiatonos {\uchar{31}{157}} +\definecharacter greekEtaiotasubpsiliperispomeni {\uchar{31}{158}} +\definecharacter greekEtaiotasubdasiaperispomeni {\uchar{31}{159}} +\definecharacter greekomegaiotasubpsili {\uchar{31}{160}} % 1fa0 +\definecharacter greekomegaiotasubdasia {\uchar{31}{161}} +\definecharacter greekomegaiotasubpsilivaria {\uchar{31}{162}} +\definecharacter greekomegaiotasubdasiavaria {\uchar{31}{163}} +\definecharacter greekomegaiotasubpsilitonos {\uchar{31}{164}} +\definecharacter greekomegaiotasubdasiatonos {\uchar{31}{165}} +\definecharacter greekomegaiotasubpsiliperispomeni {\uchar{31}{166}} +\definecharacter greekomegaiotasubdasiaperispomeni {\uchar{31}{167}} +\definecharacter greekOmegaiotasubpsili {\uchar{31}{168}} +\definecharacter greekOmegaiotasubdasia {\uchar{31}{169}} +\definecharacter greekOmegaiotasubpsilivaria {\uchar{31}{170}} +\definecharacter greekOmegaiotasubdasiavaria {\uchar{31}{171}} +\definecharacter greekOmegaiotasubpsilitonos {\uchar{31}{172}} +\definecharacter greekOmegaiotasubdasiatonos {\uchar{31}{173}} +\definecharacter greekOmegaiotasubpsiliperispomeni {\uchar{31}{174}} +\definecharacter greekOmegaiotasubdasiaperispomeni {\uchar{31}{175}} +\definecharacter greekalphavrachy {\uchar{31}{176}} % 1fb0 +\definecharacter greekalphamacron {\uchar{31}{177}} +\definecharacter greekalphaiotasubvaria {\uchar{31}{178}} +\definecharacter greekalphaiotasub {\uchar{31}{179}} +\definecharacter greekalphaiotasubtonos {\uchar{31}{180}} +\definecharacter greekalphaperispomeni {\uchar{31}{182}} +\definecharacter greekalphaiotasubperispomeni {\uchar{31}{183}} +\definecharacter greekAlphavrachy {\uchar{31}{184}} +\definecharacter greekAlphamacron {\uchar{31}{185}} +\definecharacter greekAlphavaria {\uchar{31}{186}} +\definecharacter greekAlphatonos {\uchar{31}{187}} +\definecharacter greekAlphaiotasub {\uchar{31}{188}} +\definecharacter greekCoronis {\uchar{31}{189}} +\definecharacter greekprosgegrammeni {\uchar{31}{190}} +\definecharacter greekpsili {\uchar{31}{191}} +\definecharacter greekperispomeni {\uchar{31}{192}} % 1fc0 +\definecharacter greekdialytikaperispomeni {\uchar{31}{193}} +\definecharacter greeketaiotasubvaria {\uchar{31}{194}} +\definecharacter greeketaiotasub {\uchar{31}{195}} +\definecharacter greeketaiotasubtonos {\uchar{31}{196}} +\definecharacter greeketaperispomeni {\uchar{31}{198}} +\definecharacter greeketaiotasubperispomeni {\uchar{31}{199}} +\definecharacter greekEpsilonvaria {\uchar{31}{200}} +\definecharacter greekEpsilontonos {\uchar{31}{201}} +\definecharacter greekEtavaria {\uchar{31}{202}} +\definecharacter greekEtatonos {\uchar{31}{203}} +\definecharacter greekEtaiotasub {\uchar{31}{204}} +\definecharacter greekpsilivaria {\uchar{31}{205}} +\definecharacter greekpsilitonos {\uchar{31}{206}} +\definecharacter greekpsiliperispomeni {\uchar{31}{207}} +\definecharacter greekiotavrachy {\uchar{31}{208}} % 1fd0 +\definecharacter greekiotamacron {\uchar{31}{209}} +\definecharacter greekiotadialytikavaria {\uchar{31}{210}} +\definecharacter greekiotadialytikatonos {\uchar{31}{211}} +\definecharacter greekiotaperispomeni {\uchar{31}{214}} +\definecharacter greekiotadialytikaperispomeni {\uchar{31}{215}} +\definecharacter greekIotavrachy {\uchar{31}{216}} +\definecharacter greekIotamacron {\uchar{31}{217}} +\definecharacter greekIotavaria {\uchar{31}{218}} +\definecharacter greekIotatonos {\uchar{31}{219}} +\definecharacter greekdasiavaria {\uchar{31}{221}} +\definecharacter greekdasiatonos {\uchar{31}{222}} +\definecharacter greekdasiaperispomeni {\uchar{31}{223}} +\definecharacter greekupsilonvrachy {\uchar{31}{224}} % 1fe0 +\definecharacter greekupsilonmacron {\uchar{31}{225}} +\definecharacter greekupsilondialytikavaria {\uchar{31}{226}} +\definecharacter greekupsilondialytikatonos {\uchar{31}{227}} +\definecharacter greekrhopsili {\uchar{31}{228}} +\definecharacter greekrhodasia {\uchar{31}{229}} +\definecharacter greekupsilonperispomeni {\uchar{31}{230}} +\definecharacter greekupsilondialytikaperispomeni {\uchar{31}{231}} +\definecharacter greekUpsilonvrachy {\uchar{31}{232}} +\definecharacter greekUpsilonmacron {\uchar{31}{233}} +\definecharacter greekUpsilonvaria {\uchar{31}{234}} +\definecharacter greekUpsilontonos {\uchar{31}{235}} +\definecharacter greekRhodasia {\uchar{31}{236}} +\definecharacter greekdialytikavaria {\uchar{31}{237}} +\definecharacter greekdialytikatonos {\uchar{31}{238}} +\definecharacter greekvaria {\uchar{31}{239}} +\definecharacter greekomegaiotasubvaria {\uchar{31}{242}} +\definecharacter greekomegaiotasub {\uchar{31}{243}} +\definecharacter greekomegaiotasubtonos {\uchar{31}{244}} +\definecharacter greekomegaperispomeni {\uchar{31}{246}} +\definecharacter greekomegaiotasubperispomeni {\uchar{31}{247}} +\definecharacter greekOmicronvaria {\uchar{31}{248}} +\definecharacter greekOmicrontonos {\uchar{31}{249}} +\definecharacter greekOmegavaria {\uchar{31}{250}} +\definecharacter greekOmegatonos {\uchar{31}{251}} +\definecharacter greekOmegaiotasub {\uchar{31}{252}} +\definecharacter greekoxia {\uchar{31}{253}} +\definecharacter greekdasia {\uchar{31}{254}} +\definecharacter greeksigmalunate {\uchar3{242}} +\definecharacter greekSigmalunate {\uchar3{249}} +\definecharacter greeksampi {\uchar3{225}} +\definecharacter greekdigamma {\uchar3{221}} +\definecharacter greekstigma {\uchar3{219}} +\definecharacter greeknumkoppa {\uchar3{223}} +\definecharacter greekkoppa {\uchar3{217}} +\definecharacter greekupsilondiaeresis {\uchar3{203}} + +\stopencoding + +% Hebrew: + +\startencoding[uc] + +\definecharacter hebrewAlef {\uchar5{208}} % 05D0 +\definecharacter hebrewBet {\uchar5{209}} +\definecharacter hebrewGimel {\uchar5{210}} +\definecharacter hebrewDalet {\uchar5{211}} +\definecharacter hebrewHe {\uchar5{212}} +\definecharacter hebrewVav {\uchar5{213}} +\definecharacter hebrewZayin {\uchar5{214}} +\definecharacter hebrewHet {\uchar5{215}} +\definecharacter hebrewTet {\uchar5{216}} +\definecharacter hebrewYod {\uchar5{217}} +\definecharacter hebrewKaffinal {\uchar5{218}} +\definecharacter hebrewKaf {\uchar5{219}} +\definecharacter hebrewLamed {\uchar5{220}} +\definecharacter hebrewMemfinal {\uchar5{221}} +\definecharacter hebrewMem {\uchar5{222}} +\definecharacter hebrewNunfinal {\uchar5{223}} +\definecharacter hebrewNun {\uchar5{224}} +\definecharacter hebrewSamekh {\uchar5{225}} +\definecharacter hebrewAyin {\uchar5{226}} +\definecharacter hebrewPefinal {\uchar5{227}} +\definecharacter hebrewPe {\uchar5{228}} +\definecharacter hebrewTsadifinal {\uchar5{229}} +\definecharacter hebrewTsadi {\uchar5{230}} +\definecharacter hebrewQof {\uchar5{231}} +\definecharacter hebrewResh {\uchar5{232}} +\definecharacter hebrewShin {\uchar5{233}} +\definecharacter hebrewTav {\uchar5{234}} % 05EA + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-uc.tex b/tex/context/base/enco-uc.tex deleted file mode 100644 index 981eb6ae4..000000000 --- a/tex/context/base/enco-uc.tex +++ /dev/null @@ -1,1091 +0,0 @@ -%D \module -%D [ file=enco-uc, -%D version=2000.xx.xx, % and later -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Unicode (backwards mapping), -%D author={Adam Lindsay \& Hans Hagen}, -%D date=\currentdate, -%D copyright=PRAGMA ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D An alternative approach would be to misuse the utf vectors, but they -%D don't carry enough info around. - -% todo : \defineucharacter hebrewAlef 5 "D0 - -\startencoding[uc] - -\definecharacter Agrave {\uchar0{192}} -\definecharacter Aacute {\uchar0{193}} -\definecharacter Acircumflex {\uchar0{194}} -\definecharacter Atilde {\uchar0{195}} -\definecharacter Adiaeresis {\uchar0{196}} -\definecharacter Aring {\uchar0{197}} -\definecharacter AEligature {\uchar0{198}} -\definecharacter Ccedilla {\uchar0{199}} -\definecharacter Egrave {\uchar0{200}} -\definecharacter Eacute {\uchar0{201}} -\definecharacter Ediaeresis {\uchar0{203}} -\definecharacter Igrave {\uchar0{204}} -\definecharacter Iacute {\uchar0{205}} -\definecharacter Icircumflex {\uchar0{206}} -\definecharacter Idiaeresis {\uchar0{207}} -\definecharacter Eth {\uchar0{208}} -\definecharacter Ntilde {\uchar0{209}} -\definecharacter Ograve {\uchar0{210}} -\definecharacter Oacute {\uchar0{211}} -\definecharacter Ocircumflex {\uchar0{212}} -\definecharacter Otilde {\uchar0{213}} -\definecharacter Odiaeresis {\uchar0{214}} - -\definecharacter Ostroke {\uchar0{216}} -\definecharacter Ugrave {\uchar0{217}} -\definecharacter Uacute {\uchar0{218}} -\definecharacter Uhungarumlaut {\uchar0{219}} -\definecharacter Udiaeresis {\uchar0{220}} -\definecharacter Yacute {\uchar0{221}} -\definecharacter Thorn {\uchar0{222}} -\definecharacter ssharp {\uchar0{223}} -\definecharacter agrave {\uchar0{224}} -\definecharacter aacute {\uchar0{225}} -\definecharacter acircumflex {\uchar0{226}} -\definecharacter atilde {\uchar0{227}} -\definecharacter adiaeresis {\uchar0{228}} -\definecharacter aring {\uchar0{229}} -\definecharacter aeligature {\uchar0{230}} -\definecharacter ccedilla {\uchar0{231}} -\definecharacter egrave {\uchar0{232}} -\definecharacter eacute {\uchar0{233}} -\definecharacter ecircumflex {\uchar0{234}} -\definecharacter ediaeresis {\uchar0{235}} -\definecharacter igrave {\uchar0{236}} -\definecharacter iacute {\uchar0{237}} -\definecharacter icircumflex {\uchar0{238}} -\definecharacter idiaeresis {\uchar0{239}} -\definecharacter eth {\uchar0{240}} -\definecharacter ntilde {\uchar0{241}} -\definecharacter ograve {\uchar0{242}} -\definecharacter oacute {\uchar0{243}} -\definecharacter ocircumflex {\uchar0{244}} -\definecharacter otilde {\uchar0{245}} -\definecharacter odiaeresis {\uchar0{246}} - -\definecharacter ostroke {\uchar0{248}} -\definecharacter ugrave {\uchar0{249}} -\definecharacter uacute {\uchar0{250}} -\definecharacter ucircumflex {\uchar0{251}} -\definecharacter udiaeresis {\uchar0{252}} -\definecharacter yacute {\uchar0{253}} -\definecharacter thorn {\uchar0{254}} -\definecharacter ydiaeresis {\uchar0{255}} - -\definecharacter Amacron {\uchar1{0}} -\definecharacter amacron {\uchar1{1}} -\definecharacter Abreve {\uchar1{2}} -\definecharacter abreve {\uchar1{3}} -\definecharacter Aogonek {\uchar1{4}} -\definecharacter aogonek {\uchar1{5}} -\definecharacter Cacute {\uchar1{6}} -\definecharacter cacute {\uchar1{7}} -\definecharacter Ccircumflex {\uchar1{8}} -\definecharacter ccircumflex {\uchar1{9}} -\definecharacter Cdotaccent {\uchar1{10}} -\definecharacter cdotaccent {\uchar1{11}} -\definecharacter Ccaron {\uchar1{12}} -\definecharacter ccaron {\uchar1{13}} -\definecharacter Dcaron {\uchar1{14}} -\definecharacter dcaron {\uchar1{15}} -\definecharacter Dstroke {\uchar1{16}} -\definecharacter dstroke {\uchar1{17}} -\definecharacter Emacron {\uchar1{18}} -\definecharacter emacron {\uchar1{19}} -\definecharacter Ebreve {\uchar1{20}} -\definecharacter ebreve {\uchar1{21}} -\definecharacter Edotaccent {\uchar1{22}} -\definecharacter edotaccent {\uchar1{23}} -\definecharacter Eogonek {\uchar1{24}} -\definecharacter eogonek {\uchar1{25}} -\definecharacter Ecaron {\uchar1{26}} -\definecharacter ecaron {\uchar1{27}} -\definecharacter Gcircumflex {\uchar1{28}} -\definecharacter gcircumflex {\uchar1{29}} -\definecharacter Gbreve {\uchar1{30}} -\definecharacter gbreve {\uchar1{31}} -\definecharacter Gdotaccent {\uchar1{32}} -\definecharacter gdotaccent {\uchar1{33}} -\definecharacter Gcommaaccent {\uchar1{34}} -\definecharacter gcommaaccent {\uchar1{35}} -\definecharacter Hcircumflex {\uchar1{36}} -\definecharacter hcircumflex {\uchar1{37}} -\definecharacter Hstroke {\uchar1{38}} -\definecharacter hstroke {\uchar1{39}} -\definecharacter Itilde {\uchar1{40}} -\definecharacter itilde {\uchar1{41}} -\definecharacter Imacron {\uchar1{42}} -\definecharacter imacron {\uchar1{43}} -\definecharacter Ibreve {\uchar1{44}} -\definecharacter ibreve {\uchar1{45}} -\definecharacter Iogonek {\uchar1{46}} -\definecharacter iogonek {\uchar1{47}} -\definecharacter Idotaccent {\uchar1{48}} -\definecharacter dotlessi {\uchar1{49}} -\definecharacter IJligature {\uchar1{50}} -\definecharacter ijligature {\uchar1{51}} -\definecharacter Jcircumflex {\uchar1{52}} -\definecharacter jcircumflex {\uchar1{53}} -\definecharacter Kcommaaccent {\uchar1{54}} -\definecharacter kcommaaccent {\uchar1{55}} -\definecharacter kkra {\uchar1{56}} -\definecharacter Lacute {\uchar1{57}} -\definecharacter lacute {\uchar1{58}} -\definecharacter Lcommaaccent {\uchar1{59}} -\definecharacter lcommaaccent {\uchar1{60}} -\definecharacter Lcaron {\uchar1{61}} -\definecharacter lcaron {\uchar1{62}} -\definecharacter Ldotmiddle {\uchar1{63}} -\definecharacter ldotmiddle {\uchar1{64}} -\definecharacter Lstroke {\uchar1{65}} -\definecharacter lstroke {\uchar1{66}} -\definecharacter Nacute {\uchar1{67}} -\definecharacter nacute {\uchar1{68}} -\definecharacter Ncommaaccent {\uchar1{69}} -\definecharacter ncommaaccent {\uchar1{70}} -\definecharacter Ncaron {\uchar1{71}} -\definecharacter ncaron {\uchar1{72}} -\definecharacter napostrophe {\uchar1{73}} -\definecharacter Neng {\uchar1{74}} -\definecharacter neng {\uchar1{75}} -\definecharacter Omacron {\uchar1{76}} -\definecharacter omacron {\uchar1{77}} -\definecharacter Obreve {\uchar1{78}} -\definecharacter obreve {\uchar1{79}} -\definecharacter Ohungarumlaut {\uchar1{80}} -\definecharacter ohungarumlaut {\uchar1{81}} -\definecharacter OEligature {\uchar1{82}} -\definecharacter oeligature {\uchar1{83}} -\definecharacter Racute {\uchar1{84}} -\definecharacter racute {\uchar1{85}} -\definecharacter Rcommaaccent {\uchar1{86}} -\definecharacter rcommaaccent {\uchar1{87}} -\definecharacter Rcaron {\uchar1{88}} -\definecharacter rcaron {\uchar1{89}} -\definecharacter Sacute {\uchar1{90}} -\definecharacter sacute {\uchar1{91}} -\definecharacter Scircumflex {\uchar1{92}} -\definecharacter scircumflex {\uchar1{93}} -\definecharacter Scedilla {\uchar1{94}} -\definecharacter scedilla {\uchar1{95}} -\definecharacter Scaron {\uchar1{96}} -\definecharacter scaron {\uchar1{97}} -\definecharacter Tcedilla {\uchar1{98}} -\definecharacter tcedilla {\uchar1{99}} -\definecharacter Tcaron {\uchar1{100}} -\definecharacter tcaron {\uchar1{101}} -\definecharacter Tstroke {\uchar1{102}} -\definecharacter tstroke {\uchar1{103}} -\definecharacter Utilde {\uchar1{104}} -\definecharacter utilde {\uchar1{105}} -\definecharacter Umacron {\uchar1{106}} -\definecharacter umacron {\uchar1{107}} -\definecharacter Ubreve {\uchar1{108}} -\definecharacter ubreve {\uchar1{109}} -\definecharacter Uring {\uchar1{110}} -\definecharacter uring {\uchar1{111}} -\definecharacter Uhungarumlaut {\uchar1{112}} -\definecharacter uhungarumlaut {\uchar1{113}} -\definecharacter Uogonek {\uchar1{114}} -\definecharacter uogonek {\uchar1{115}} -\definecharacter Wcircumflex {\uchar1{116}} -\definecharacter wcircumflex {\uchar1{117}} -\definecharacter Ycircumflex {\uchar1{118}} -\definecharacter ycircumflex {\uchar1{119}} -\definecharacter Ydiaeresis {\uchar1{120}} -\definecharacter Zacute {\uchar1{121}} -\definecharacter zacute {\uchar1{122}} -\definecharacter Zdotaccent {\uchar1{123}} -\definecharacter zdotaccent {\uchar1{124}} -\definecharacter Zcaron {\uchar1{125}} -\definecharacter zcaron {\uchar1{126}} -\definecharacter slong {\uchar1{127}} - -\stopencoding - -\startencoding[uc] - -\definecharacter endash {\uchar{32}{19}} -\definecharacter emdash {\uchar{32}{20}} -\definecharacter quoteleft {\uchar{32}{24}} -\definecharacter quoteright {\uchar{32}{25}} -\definecharacter quotesinglebase {\uchar{32}{26}} - -\definecharacter quotedblleft {\uchar{32}{28}} -\definecharacter quotedblright {\uchar{32}{29}} -\definecharacter quotedblbase {\uchar{32}{30}} - -\definecharacter leftguillemot {\uchar0{171}} -\definecharacter rightguillemot {\uchar0{187}} - -\definecharacter guilsingleleft {\uchar{32}{57}} -\definecharacter guilsingleright {\uchar{32}{58}} - -\stopencoding - -%D Adam Lindsay's additions - -\startencoding[uc] - -\definecharacter exclamdown {\uchar0{161}} -\definecharacter textcent {\uchar0{162}} -\definecharacter textsterling {\uchar0{163}} -\definecharacter textcurrency {\uchar0{164}} -\definecharacter textyen {\uchar0{165}} -\definecharacter textbrokenbar {\uchar0{166}} -\definecharacter sectionmark {\uchar0{167}} -\definecharacter textdiaresis {\uchar0{168}} -\definecharacter copyright {\uchar0{169}} - -\definecharacter textlognot {\uchar0{172}} -\definecharacter softhyphen {\uchar0{173}} -\definecharacter registered {\uchar0{174}} -\definecharacter textmacron {\uchar0{175}} -\definecharacter textdegree {\uchar0{176}} -\definecharacter textpm {\uchar0{177}} -\definecharacter twosuperior {\uchar0{178}} -\definecharacter threesuperior {\uchar0{179}} -\definecharacter textacute {\uchar0{180}} -\definecharacter textmu {\uchar0{181}} -\definecharacter paragraphmark {\uchar0{182}} -\definecharacter periodcentered {\uchar0{183}} -\definecharacter textcedilla {\uchar0{184}} -\definecharacter onesuperior {\uchar0{185}} - -\definecharacter textgrave {\uchar3{0}} -\definecharacter textacute {\uchar3{1}} -\definecharacter textcircumflex {\uchar3{2}} -\definecharacter texttilde {\uchar3{3}} -\definecharacter textmacron {\uchar3{4}} -\definecharacter textbreve {\uchar3{6}} -\definecharacter textdotaccent {\uchar3{7}} -\definecharacter textdiaeresis {\uchar3{8}} -\definecharacter textring {\uchar3{10}} -\definecharacter texthungarumlaut {\uchar3{11}} -\definecharacter textcaron {\uchar3{12}} -\definecharacter textogonek {\uchar3{40}} - -\definecharacter percent {\uchar0{37}} -\definecharacter textunderscore {\uchar0{95}} - -\definecharacter ordfeminine {\uchar0{170}} -\definecharacter ordmasculine {\uchar0{186}} -\definecharacter onequarter {\uchar0{188}} -\definecharacter onehalf {\uchar0{189}} -\definecharacter threequarter {\uchar0{190}} -\definecharacter questiondown {\uchar0{191}} - -\definecharacter textmultiply {\uchar0{215}} -\definecharacter textdiv {\uchar0{247}} - -\definecharacter textminus {\uchar{32}{18}} -\definecharacter textdag {\uchar{32}{32}} -\definecharacter textddag {\uchar{32}{33}} -\definecharacter textbullet {\uchar{32}{34}} -\definecharacter textellipsis {\uchar{32}{38}} -\definecharacter perthousand {\uchar{32}{48}} - -%new: -\definecharacter Scommaaccent {\uchar2{24}} -\definecharacter scommaaccent {\uchar2{25}} -\definecharacter Tcommaaccent {\uchar2{26}} -\definecharacter tcommaaccent {\uchar2{27}} - -\stopencoding - -%D Mojca's and Taco's additions: - -\startencoding[uc] - -\definecharacter textasciicircum {\uchar{0}{94}} % 5e -\definecharacter textgrave {\uchar{0}{96}} % 60 -\definecharacter textdiaeresis {\uchar{0}{168}} % a8 -%definecharacter textmacron {\uchar{0}{175}} % af -%definecharacter textacute {\uchar{0}{180}} % b4 -%definecharacter textcedilla {\uchar{0}{184}} % b8 -\definecharacter textcircumflex {\uchar{2}{198}} % c6 -\definecharacter textcaron {\uchar{2}{199}} % c7 -\definecharacter textbreve {\uchar{2}{216}} % d8 -\definecharacter textdotaccent {\uchar{2}{217}} % d9 -\definecharacter textring {\uchar{2}{218}} % da -\definecharacter textogonek {\uchar{2}{219}} % db -\definecharacter texttilde {\uchar{2}{220}} % dc -\definecharacter texthungarumlaut {\uchar{2}{221}} % dd - -\stopencoding - -%D Vietnamese: - -\startencoding[uc] - -\definecharacter Ohorn {\uchar1{160}} -\definecharacter ohorn {\uchar1{161}} -\definecharacter Uhorn {\uchar1{175}} -\definecharacter uhorn {\uchar1{176}} - -\definecharacter Yhook {\uchar{30}{246}} -\definecharacter yhook {\uchar{30}{247}} -\definecharacter Ydotbelow {\uchar{30}{244}} -\definecharacter ydotbelow {\uchar{30}{245}} -\definecharacter Ahook {\uchar{30}{162}} -\definecharacter Adotbelow {\uchar{30}{160}} -\definecharacter Acircumflexgrave {\uchar{30}{166}} -\definecharacter Acircumflexacute {\uchar{30}{164}} -\definecharacter Acircumflextilde {\uchar{30}{170}} -\definecharacter Acircumflexhook {\uchar{30}{168}} -\definecharacter Acircumflexdotbelow {\uchar{30}{172}} -\definecharacter Abrevegrave {\uchar{30}{176}} -\definecharacter Abreveacute {\uchar{30}{174}} -\definecharacter Abrevetilde {\uchar{30}{180}} -\definecharacter Abrevehook {\uchar{30}{178}} -\definecharacter Abrevedotbelow {\uchar{30}{182}} -\definecharacter Ehook {\uchar{30}{186}} -\definecharacter Edotbelow {\uchar{30}{184}} -\definecharacter Ecircumflexgrave {\uchar{30}{192}} -\definecharacter Ecircumflexacute {\uchar{30}{190}} -\definecharacter Ecircumflextilde {\uchar{30}{196}} -\definecharacter Ecircumflexhook {\uchar{30}{194}} -\definecharacter Ecircumflexdotbelow {\uchar{30}{198}} -\definecharacter Ihook {\uchar{30}{200}} -\definecharacter ahook {\uchar{30}{163}} -\definecharacter adotbelow {\uchar{30}{161}} -\definecharacter acircumflexgrave {\uchar{30}{167}} -\definecharacter acircumflexacute {\uchar{30}{165}} -\definecharacter acircumflextilde {\uchar{30}{171}} -\definecharacter acircumflexhook {\uchar{30}{169}} -\definecharacter acircumflexdotbelow {\uchar{30}{173}} -\definecharacter abrevegrave {\uchar{30}{177}} -\definecharacter abreveacute {\uchar{30}{175}} -\definecharacter abrevetilde {\uchar{30}{181}} -\definecharacter abrevehook {\uchar{30}{179}} -\definecharacter abrevedotbelow {\uchar{30}{183}} -\definecharacter ehook {\uchar{30}{187}} -\definecharacter edotbelow {\uchar{30}{185}} -\definecharacter ecircumflexgrave {\uchar{30}{193}} -\definecharacter ecircumflexacute {\uchar{30}{191}} -\definecharacter ecircumflextilde {\uchar{30}{197}} -\definecharacter ecircumflexhook {\uchar{30}{195}} -\definecharacter ecircumflexdotbelow {\uchar{30}{199}} -\definecharacter ihook {\uchar{30}{201}} -\definecharacter Idotbelow {\uchar{30}{202}} -\definecharacter Ohook {\uchar{30}{206}} -\definecharacter Odotbelow {\uchar{30}{204}} -\definecharacter Ocircumflexgrave {\uchar{30}{210}} -\definecharacter Ocircumflexacute {\uchar{30}{208}} -\definecharacter Ocircumflextilde {\uchar{30}{214}} -\definecharacter Ocircumflexhook {\uchar{30}{212}} -\definecharacter Ocircumflexdotbelow {\uchar{30}{216}} -\definecharacter Ohorngrave {\uchar{30}{220}} -\definecharacter Ohornacute {\uchar{30}{218}} -\definecharacter Ohorntilde {\uchar{30}{224}} -\definecharacter Ohornhook {\uchar{30}{222}} -\definecharacter Ohorndotbelow {\uchar{30}{226}} -\definecharacter Uhook {\uchar{30}{230}} -\definecharacter Udotbelow {\uchar{30}{228}} -\definecharacter Uhorngrave {\uchar{30}{234}} -\definecharacter Uhornacute {\uchar{30}{232}} -\definecharacter Uhorntilde {\uchar{30}{238}} -\definecharacter Uhornhook {\uchar{30}{236}} -\definecharacter Uhorndotbelow {\uchar{30}{240}} -\definecharacter Ytilde {\uchar{30}{248}} -\definecharacter idotbelow {\uchar{30}{203}} -\definecharacter ohook {\uchar{30}{207}} -\definecharacter odotbelow {\uchar{30}{205}} -\definecharacter ocircumflexgrave {\uchar{30}{211}} -\definecharacter ocircumflexacute {\uchar{30}{209}} -\definecharacter ocircumflextilde {\uchar{30}{215}} -\definecharacter ocircumflexhook {\uchar{30}{213}} -\definecharacter ocircumflexdotbelow {\uchar{30}{217}} -\definecharacter ohorngrave {\uchar{30}{221}} -\definecharacter ohornacute {\uchar{30}{219}} -\definecharacter ohorntilde {\uchar{30}{225}} -\definecharacter ohornhook {\uchar{30}{223}} -\definecharacter ohorndotbelow {\uchar{30}{227}} -\definecharacter uhook {\uchar{30}{231}} -\definecharacter udotbelow {\uchar{30}{229}} -\definecharacter uhorngrave {\uchar{30}{235}} -\definecharacter uhornacute {\uchar{30}{233}} -\definecharacter uhorntilde {\uchar{30}{239}} -\definecharacter uhornhook {\uchar{30}{237}} -\definecharacter uhorndotbelow {\uchar{30}{241}} -\definecharacter ytilde {\uchar{30}{249}} - -\definecharacter Etilde {\uchar{30}{188}} -\definecharacter etilde {\uchar{30}{189}} -\definecharacter Ygrave {\uchar{30}{242}} -\definecharacter ygrave {\uchar{30}{243}} - -\stopencoding - -% Greek: - -\startencoding[uc] - -\definecharacter greekAlphatonos {\uchar3{134}} -\definecharacter greekEpsilontonos {\uchar3{136}} -\definecharacter greekEtatonos {\uchar3{137}} -\definecharacter greekIotatonos {\uchar3{138}} -\definecharacter greekOmicrontonos {\uchar3{140}} -\definecharacter greekUpsilontonos {\uchar3{142}} -\definecharacter greekOmegatonos {\uchar3{143}} -\definecharacter greekiotadialytikatonos {\uchar3{144}} -\definecharacter greekAlpha {\uchar3{145}} -\definecharacter greekBeta {\uchar3{146}} -\definecharacter greekGamma {\uchar3{147}} -\definecharacter greekDelta {\uchar3{148}} -\definecharacter greekEpsilon {\uchar3{149}} -\definecharacter greekZeta {\uchar3{150}} -\definecharacter greekEta {\uchar3{151}} -\definecharacter greekTheta {\uchar3{152}} -\definecharacter greekIota {\uchar3{153}} -\definecharacter greekKappa {\uchar3{154}} -\definecharacter greekLambda {\uchar3{155}} -\definecharacter greekMu {\uchar3{156}} -\definecharacter greekNu {\uchar3{157}} -\definecharacter greekXi {\uchar3{158}} -\definecharacter greekOmicron {\uchar3{159}} -\definecharacter greekPi {\uchar3{160}} -\definecharacter greekRho {\uchar3{161}} -\definecharacter greekSigma {\uchar3{163}} -\definecharacter greekTau {\uchar3{164}} -\definecharacter greekUpsilon {\uchar3{165}} -\definecharacter greekPhi {\uchar3{166}} -\definecharacter greekChi {\uchar3{167}} -\definecharacter greekPsi {\uchar3{168}} -\definecharacter greekOmega {\uchar3{169}} - -\definecharacter greekalpha {\uchar3{177}} -\definecharacter greekbeta {\uchar3{178}} -\definecharacter greekgamma {\uchar3{179}} -\definecharacter greekdelta {\uchar3{180}} -\definecharacter greekepsilon {\uchar3{181}} -\definecharacter greekzeta {\uchar3{182}} -\definecharacter greeketa {\uchar3{183}} -\definecharacter greektheta {\uchar3{184}} -\definecharacter greekiota {\uchar3{185}} -\definecharacter greekkappa {\uchar3{186}} -\definecharacter greeklambda {\uchar3{187}} -\definecharacter greekmu {\uchar3{188}} -\definecharacter greeknu {\uchar3{189}} -\definecharacter greekxi {\uchar3{190}} -\definecharacter greekomicron {\uchar3{191}} -\definecharacter greekpi {\uchar3{192}} -\definecharacter greekrho {\uchar3{193}} -\definecharacter greekfinalsigma {\uchar3{194}} -\definecharacter greeksigma {\uchar3{195}} -\definecharacter greektau {\uchar3{196}} -\definecharacter greekupsilon {\uchar3{197}} -\definecharacter greekphi {\uchar3{198}} -\definecharacter greekchi {\uchar3{199}} -\definecharacter greekpsi {\uchar3{200}} -\definecharacter greekomega {\uchar3{201}} -\definecharacter greekiotadialytika {\uchar3{202}} -\definecharacter greekupsilondialytika {\uchar3{203}} -\definecharacter greekomicrontonos {\uchar3{204}} -\definecharacter greekupsilontonos {\uchar3{205}} -\definecharacter greekomegatonos {\uchar3{206}} - -\definecharacter greekIotadialytika {\uchar3{170}} -\definecharacter greekUpsilondialytika {\uchar3{171}} - -\definecharacter greekalphatonos {\uchar3{172}} -\definecharacter greekepsilontonos {\uchar3{173}} -\definecharacter greeketatonos {\uchar3{174}} -\definecharacter greekiotatonos {\uchar3{175}} -\definecharacter greekupsilondialytikatonos {\uchar3{176}} - -% new: -\definecharacter greekthetaalt {\uchar3{209}} -\definecharacter greekphialt {\uchar3{213}} -\definecharacter greekpialt {\uchar3{214}} -\definecharacter greekrhoalt {\uchar3{241}} -\definecharacter greekepsilonalt {\uchar3{245}} - -\stopencoding - -% Cyrillic: - -\startencoding[uc] - -\definecharacter cyrillicA {\uchar4{16}} -\definecharacter cyrillicB {\uchar4{17}} -\definecharacter cyrillicV {\uchar4{18}} -\definecharacter cyrillicG {\uchar4{19}} -\definecharacter cyrillicD {\uchar4{20}} -\definecharacter cyrillicE {\uchar4{21}} -\definecharacter cyrillicZH {\uchar4{22}} -\definecharacter cyrillicZ {\uchar4{23}} -\definecharacter cyrillicI {\uchar4{24}} -\definecharacter cyrillicISHRT {\uchar4{25}} -\definecharacter cyrillicK {\uchar4{26}} -\definecharacter cyrillicL {\uchar4{27}} -\definecharacter cyrillicM {\uchar4{28}} -\definecharacter cyrillicN {\uchar4{29}} -\definecharacter cyrillicO {\uchar4{30}} -\definecharacter cyrillicP {\uchar4{31}} -\definecharacter cyrillicR {\uchar4{32}} -\definecharacter cyrillicS {\uchar4{33}} -\definecharacter cyrillicT {\uchar4{34}} -\definecharacter cyrillicU {\uchar4{35}} -\definecharacter cyrillicF {\uchar4{36}} -\definecharacter cyrillicH {\uchar4{37}} -\definecharacter cyrillicC {\uchar4{38}} -\definecharacter cyrillicCH {\uchar4{39}} -\definecharacter cyrillicSH {\uchar4{40}} -\definecharacter cyrillicSHCH {\uchar4{41}} -\definecharacter cyrillicHRDSN {\uchar4{42}} -\definecharacter cyrillicERY {\uchar4{43}} -\definecharacter cyrillicSFTSN {\uchar4{44}} -\definecharacter cyrillicEREV {\uchar4{45}} -\definecharacter cyrillicYU {\uchar4{46}} -\definecharacter cyrillicYA {\uchar4{47}} - -\definecharacter cyrillica {\uchar4{48}} -\definecharacter cyrillicb {\uchar4{49}} -\definecharacter cyrillicv {\uchar4{50}} -\definecharacter cyrillicg {\uchar4{51}} -\definecharacter cyrillicd {\uchar4{52}} -\definecharacter cyrillice {\uchar4{53}} -\definecharacter cyrilliczh {\uchar4{54}} -\definecharacter cyrillicz {\uchar4{55}} -\definecharacter cyrillici {\uchar4{56}} -\definecharacter cyrillicishrt {\uchar4{57}} -\definecharacter cyrillick {\uchar4{58}} -\definecharacter cyrillicl {\uchar4{59}} -\definecharacter cyrillicm {\uchar4{60}} -\definecharacter cyrillicn {\uchar4{61}} -\definecharacter cyrillico {\uchar4{62}} -\definecharacter cyrillicp {\uchar4{63}} -\definecharacter cyrillicr {\uchar4{64}} -\definecharacter cyrillics {\uchar4{65}} -\definecharacter cyrillict {\uchar4{66}} -\definecharacter cyrillicu {\uchar4{67}} -\definecharacter cyrillicf {\uchar4{68}} -\definecharacter cyrillich {\uchar4{69}} -\definecharacter cyrillicc {\uchar4{70}} -\definecharacter cyrillicch {\uchar4{71}} -\definecharacter cyrillicsh {\uchar4{72}} -\definecharacter cyrillicshch {\uchar4{73}} -\definecharacter cyrillichrdsn {\uchar4{74}} -\definecharacter cyrillicery {\uchar4{75}} -\definecharacter cyrillicsftsn {\uchar4{76}} -\definecharacter cyrillicerev {\uchar4{77}} -\definecharacter cyrillicyu {\uchar4{78}} -\definecharacter cyrillicya {\uchar4{79}} - -%D I tried to figure out what these were, but the unicode -%D tables suggested they were the same as cyrillici, which was -%D already defined! So, a temporary definition: - -% \def\cyrillicII{\cyrillicI} -% \def\cyrillicii{\cyrillici} - -%D a guess derived from looking at enco-cyr suggests that this is -%D identical to the Roman I/i pair. To me, that sounds like -%D CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I in the UC tables! - -\definecharacter cyrillicII {\uchar4{6}} -\definecharacter cyrillicii {\uchar4{86}} - -%D Guessing that tlir6a corresponds with t2a encoding as advertised, -%D here are some more, cos I had some spare time: (AL) - -\definecharacter cyrillicDJE {\uchar4{2}} -\definecharacter cyrillicTSHE {\uchar4{11}} -%definecharacter cyrillicSHHA 132 -%definecharacter cyrillicZHDSC 133 -\definecharacter cyrillicZDSC {\uchar4{152}} -\definecharacter cyrillicLJE {\uchar4{9}} -\definecharacter cyrillicYI {\uchar4{7}} -\definecharacter cyrillicAE {\uchar4{212}} -%definecharacter cyrillicNDSC 141 -%definecharacter cyrillicNG 142 -\definecharacter cyrillicDZE {\uchar4{5}} -%definecharacter cyrillicOTLD 144 -\definecharacter cyrillicSDSC {\uchar4{170}} -\definecharacter cyrillicUSHRT {\uchar4{14}} -%definecharacter cyrillicY 147 -%definecharacter cyrillicYHCRS 148 -%definecharacter cyrillicHDSC 149 -\definecharacter cyrillicDZHE {\uchar4{15}} -\definecharacter cyrillicIE {\uchar4{4}} -\definecharacter cyrillicNJE {\uchar4{10}} -\definecharacter cyrillicYO {\uchar4{1}} - -\definecharacter cyrillicdje {\uchar4{82}} -\definecharacter cyrillictshe {\uchar4{91}} -%definecharacter cyrillicshha 164 -%definecharacter cyrilliczhdsc 165 -\definecharacter cyrilliczdsc {\uchar4{153}} -\definecharacter cyrilliclje {\uchar4{89}} -\definecharacter cyrillicyi {\uchar4{87}} -\definecharacter cyrillicae {\uchar4{213}} -%definecharacter cyrillicndsc 173 -%definecharacter cyrillicng 174 -\definecharacter cyrillicdze {\uchar4{85}} -%definecharacter cyrillicotld 176 -\definecharacter cyrillicsdsc {\uchar4{171}} -\definecharacter cyrillicushrt {\uchar4{94}} -%definecharacter cyrillicy 179 -%definecharacter cyrillicyhcrs 180 -%definecharacter cyrillichdsc 181 -\definecharacter cyrillicdzhe {\uchar4{95}} -\definecharacter cyrillicie {\uchar4{84}} -\definecharacter cyrillicnje {\uchar4{90}} -\definecharacter cyrillicyo {\uchar4{81}} - -% is there overlap with the above definitions - -\definecharacter cyrillicEgrave {\uchar4{0}} -\definecharacter cyrillicGJE {\uchar4{3}} -\definecharacter cyrillicJE {\uchar4{8}} -\definecharacter cyrillicKJE {\uchar4{12}} -\definecharacter cyrillicIgrave {\uchar4{13}} -\definecharacter cyrillicegrave {\uchar4{80}} -\definecharacter cyrillicgje {\uchar4{83}} -\definecharacter cyrillicje {\uchar4{88}} -\definecharacter cyrillickje {\uchar4{92}} -\definecharacter cyrillicigrave {\uchar4{93}} -\definecharacter cyrillicOMEGA {\uchar4{96}} -\definecharacter cyrillicomega {\uchar4{97}} -\definecharacter cyrillicYAT {\uchar4{98}} -\definecharacter cyrillicyat {\uchar4{99}} -\definecharacter cyrillicEiotified {\uchar4{100}} -\definecharacter cyrilliceiotified {\uchar4{101}} -\definecharacter cyrillicLITTLEYUS {\uchar4{102}} -\definecharacter cyrilliclittleyus {\uchar4{103}} -\definecharacter cyrillicLITTLEYUSiotified {\uchar4{104}} -\definecharacter cyrilliclittleyusiotified {\uchar4{105}} -\definecharacter cyrillicBIGYUS {\uchar4{106}} -\definecharacter cyrillicbigyus {\uchar4{107}} -\definecharacter cyrillicBIGYUSiotified {\uchar4{108}} -\definecharacter cyrillicbigyusiotified {\uchar4{109}} -\definecharacter cyrillicKSI {\uchar4{110}} -\definecharacter cyrillicksi {\uchar4{111}} -\definecharacter cyrillicPSI {\uchar4{112}} -\definecharacter cyrillicpsi {\uchar4{113}} -\definecharacter cyrillicFITA {\uchar4{114}} -\definecharacter cyrillicfita {\uchar4{115}} -\definecharacter cyrillicIZHITSA {\uchar4{116}} -\definecharacter cyrillicizhitsa {\uchar4{117}} -\definecharacter cyrillicIZHITSAdoublegrave {\uchar4{118}} -\definecharacter cyrillicizhitsadoublegrave {\uchar4{119}} -\definecharacter cyrillicUK {\uchar4{120}} -\definecharacter cyrillicuk {\uchar4{121}} -\definecharacter cyrillicOMEGAround {\uchar4{122}} -\definecharacter cyrillicomegaround {\uchar4{123}} -\definecharacter cyrillicOMEGAtitlo {\uchar4{124}} -\definecharacter cyrillicomegatitlo {\uchar4{125}} -\definecharacter cyrillicOT {\uchar4{126}} -\definecharacter cyrillicot {\uchar4{127}} -\definecharacter cyrillicKOPPA {\uchar4{128}} -\definecharacter cyrillickoppa {\uchar4{129}} -\definecharacter cyrillicTITLO {\uchar4{131}} -\definecharacter cyrillicPALATALIZATION {\uchar4{132}} -\definecharacter cyrillicDASIAPNEUMATA {\uchar4{133}} -\definecharacter cyrillicPSILIPNEUMATA {\uchar4{134}} -\definecharacter cyrillicISHRTtail {\uchar4{138}} -\definecharacter cyrillicishrttail {\uchar4{139}} -\definecharacter cyrillicSEMISOFT {\uchar4{140}} -\definecharacter cyrillicsemisoft {\uchar4{141}} -\definecharacter cyrillicERtick {\uchar4{142}} -\definecharacter cyrillicertick {\uchar4{143}} -\definecharacter cyrillicGHEupturn {\uchar4{144}} -\definecharacter cyrillicgheupturn {\uchar4{145}} -\definecharacter cyrillicGHEstroke {\uchar4{146}} -\definecharacter cyrillicghestroke {\uchar4{147}} -\definecharacter cyrillicGHEmidhook {\uchar4{148}} -\definecharacter cyrillicghemidhook {\uchar4{149}} -\definecharacter cyrillicZHEdescender {\uchar4{150}} -\definecharacter cyrilliczhedescender {\uchar4{151}} -\definecharacter cyrillicZDSC {\uchar4{152}} -\definecharacter cyrilliczdsc {\uchar4{153}} -\definecharacter cyrillicKADC {\uchar4{154}} -\definecharacter cyrillickadc {\uchar4{155}} -\definecharacter cyrillicKAvertstroke {\uchar4{156}} -\definecharacter cyrillickavertstroke {\uchar4{157}} -\definecharacter cyrillicKAstroke {\uchar4{158}} -\definecharacter cyrillickastroke {\uchar4{159}} -\definecharacter cyrillicKAbashkir {\uchar4{160}} -\definecharacter cyrillickabashkir {\uchar4{161}} -\definecharacter cyrillicENDC {\uchar4{162}} -\definecharacter cyrillicendc {\uchar4{163}} -\definecharacter cyrillicENGHE {\uchar4{164}} -\definecharacter cyrillicenghe {\uchar4{165}} -\definecharacter cyrillicPEmidhook {\uchar4{166}} -\definecharacter cyrillicpemidhook {\uchar4{167}} -\definecharacter cyrillicHA {\uchar4{168}} -\definecharacter cyrillicha {\uchar4{169}} -%definecharacter cyrillicSDSC {\uchar4{170}} % already defined -%definecharacter cyrilliccdsc {\uchar4{171}} % already defined -\definecharacter cyrillicTEDC {\uchar4{172}} -\definecharacter cyrillictedc {\uchar4{173}} -\definecharacter cyrillicYstr {\uchar4{174}} -\definecharacter cyrillicystr {\uchar4{175}} -\definecharacter cyrillicYstrstroke {\uchar4{176}} -\definecharacter cyrillicystrstroke {\uchar4{177}} -\definecharacter cyrillicHADC {\uchar4{178}} -\definecharacter cyrillichadc {\uchar4{179}} -\definecharacter cyrillicTETSE {\uchar4{180}} -\definecharacter cyrillictetse {\uchar4{181}} -\definecharacter cyrillicCHEDC {\uchar4{182}} -\definecharacter cyrillicchedc {\uchar4{183}} -\definecharacter cyrillicCHEvertstroke {\uchar4{184}} -\definecharacter cyrillicchevertstroke {\uchar4{185}} -\definecharacter cyrillicSHHA {\uchar4{186}} -\definecharacter cyrillicshha {\uchar4{187}} -\definecharacter cyrillicCHEabkhasian {\uchar4{188}} -\definecharacter cyrilliccheabkhasian {\uchar4{189}} -\definecharacter cyrillicCHEDCabkhasian {\uchar4{190}} -\definecharacter cyrillicchedcabkhasian {\uchar4{191}} -\definecharacter cyrillicPALOCHKA {\uchar4{192}} -\definecharacter cyrillicZHEbreve {\uchar4{193}} -\definecharacter cyrilliczhebreve {\uchar4{194}} -\definecharacter cyrillicKAhook {\uchar4{195}} -\definecharacter cyrillickahook {\uchar4{196}} -\definecharacter cyrillicELtail {\uchar4{197}} -\definecharacter cyrilliceltail {\uchar4{198}} -\definecharacter cyrillicENhook {\uchar4{199}} -\definecharacter cyrillicenhook {\uchar4{200}} -\definecharacter cyrillicENtail {\uchar4{201}} -\definecharacter cyrillicentail {\uchar4{202}} -\definecharacter cyrillicCHEkhakassian {\uchar4{203}} -\definecharacter cyrillicchekhakassian {\uchar4{204}} -\definecharacter cyrillicEMtail {\uchar4{205}} -\definecharacter cyrillicemtail {\uchar4{206}} -\definecharacter cyrillicAbreve {\uchar4{208}} -\definecharacter cyrillicabreve {\uchar4{209}} -\definecharacter cyrillicAdiaeresis {\uchar4{210}} -\definecharacter cyrillicadiaeresis {\uchar4{211}} -%definecharacter cyrillicAE {\uchar4{212}} % already defined -%definecharacter cyrillicae {\uchar4{213}} % already defined -\definecharacter cyrillicEbreve {\uchar4{214}} -\definecharacter cyrillicebreve {\uchar4{215}} -\definecharacter cyrillicSCHWA {\uchar4{216}} -\definecharacter cyrillicschwa {\uchar4{217}} -\definecharacter cyrillicSCHWAdiaeresis {\uchar4{218}} -\definecharacter cyrillicschwadiaeresis {\uchar4{219}} -\definecharacter cyrillicZHEdiaeresis {\uchar4{220}} -\definecharacter cyrilliczhediaeresis {\uchar4{221}} -\definecharacter cyrillicZEdiaeresis {\uchar4{222}} -\definecharacter cyrilliczediaeresis {\uchar4{223}} -\definecharacter cyrillicDZEabkhasian {\uchar4{224}} -\definecharacter cyrillicdzeabkhasian {\uchar4{225}} -\definecharacter cyrillicImacron {\uchar4{226}} -\definecharacter cyrillicimacron {\uchar4{227}} -\definecharacter cyrillicIdiaeresis {\uchar4{228}} -\definecharacter cyrillicidiaeresis {\uchar4{229}} -\definecharacter cyrillicOdiaeresis {\uchar4{230}} -\definecharacter cyrillicodiaeresis {\uchar4{231}} -\definecharacter cyrillicObarred {\uchar4{232}} -\definecharacter cyrillicobarred {\uchar4{233}} -\definecharacter cyrillicObarreddiaeresis {\uchar4{234}} -\definecharacter cyrillicobarreddiaeresis {\uchar4{235}} -\definecharacter cyrillicEdiaeresis {\uchar4{236}} -\definecharacter cyrillicediaeresis {\uchar4{237}} -\definecharacter cyrillicUmacron {\uchar4{238}} -\definecharacter cyrillicumacron {\uchar4{239}} -\definecharacter cyrillicUdiaeresis {\uchar4{240}} -\definecharacter cyrillicudiaeresis {\uchar4{241}} -\definecharacter cyrillicUdoubleacute {\uchar4{242}} -\definecharacter cyrillicudoubleacute {\uchar4{243}} -\definecharacter cyrillicCHEdiaeresis {\uchar4{244}} -\definecharacter cyrillicchediaeresis {\uchar4{245}} -\definecharacter cyrillicYERUdiaeresis {\uchar4{248}} -\definecharacter cyrillicyerudiaeresis {\uchar4{249}} - -\stopencoding - -% Greek Extended - -\startencoding[uc] - -\definecharacter greekalphapsili {\uchar{31}{0}} -\definecharacter greekalphadasia {\uchar{31}{1}} -\definecharacter greekalphapsilivaria {\uchar{31}{2}} -\definecharacter greekalphadasiavaria {\uchar{31}{3}} -\definecharacter greekalphapsilitonos {\uchar{31}{4}} -\definecharacter greekalphadasiatonos {\uchar{31}{5}} -\definecharacter greekalphapsiliperispomeni {\uchar{31}{6}} -\definecharacter greekalphadasiaperispomeni {\uchar{31}{7}} -\definecharacter greekAlphapsili {\uchar{31}{8}} -\definecharacter greekAlphadasia {\uchar{31}{9}} -\definecharacter greekAlphapsilivaria {\uchar{31}{10}} -\definecharacter greekAlphadasiavaria {\uchar{31}{11}} -\definecharacter greekAlphapsilitonos {\uchar{31}{12}} -\definecharacter greekAlphadasiatonos {\uchar{31}{13}} -\definecharacter greekAlphapsiliperispomeni {\uchar{31}{14}} -\definecharacter greekAlphadasiaperispomeni {\uchar{31}{15}} -\definecharacter greekepsilonpsili {\uchar{31}{16}} % 1f10 -\definecharacter greekepsilondasia {\uchar{31}{17}} -\definecharacter greekepsilonpsilivaria {\uchar{31}{18}} -\definecharacter greekepsilondasiavaria {\uchar{31}{19}} -\definecharacter greekepsilonpsilitonos {\uchar{31}{20}} -\definecharacter greekepsilondasiatonos {\uchar{31}{21}} -\definecharacter greekEpsilonpsili {\uchar{31}{24}} -\definecharacter greekEpsilondasia {\uchar{31}{25}} -\definecharacter greekEpsilonpsilivaria {\uchar{31}{26}} -\definecharacter greekEpsilondasiavaria {\uchar{31}{27}} -\definecharacter greekEpsilonpsilitonos {\uchar{31}{28}} -\definecharacter greekEpsilondasiatonos {\uchar{31}{29}} -\definecharacter greeketapsili {\uchar{31}{32}} % 1f20 -\definecharacter greeketadasia {\uchar{31}{33}} -\definecharacter greeketapsilivaria {\uchar{31}{34}} -\definecharacter greeketadasiavaria {\uchar{31}{35}} -\definecharacter greeketapsilitonos {\uchar{31}{36}} -\definecharacter greeketadasiatonos {\uchar{31}{37}} -\definecharacter greeketapsiliperispomeni {\uchar{31}{38}} -\definecharacter greeketadasiaperispomeni {\uchar{31}{39}} -\definecharacter greekEtapsili {\uchar{31}{40}} -\definecharacter greekEtadasia {\uchar{31}{41}} -\definecharacter greekEtapsilivaria {\uchar{31}{42}} -\definecharacter greekEtadasiavaria {\uchar{31}{43}} -\definecharacter greekEtapsilitonos {\uchar{31}{44}} -\definecharacter greekEtadasiatonos {\uchar{31}{45}} -\definecharacter greekEtapsiliperispomeni {\uchar{31}{46}} -\definecharacter greekEtadasiaperispomeni {\uchar{31}{47}} -\definecharacter greekiotapsili {\uchar{31}{48}} % 1f30 -\definecharacter greekiotadasia {\uchar{31}{49}} -\definecharacter greekiotapsilivaria {\uchar{31}{50}} -\definecharacter greekiotadasiavaria {\uchar{31}{51}} -\definecharacter greekiotapsilitonos {\uchar{31}{52}} -\definecharacter greekiotadasiatonos {\uchar{31}{53}} -\definecharacter greekiotapsiliperispomeni {\uchar{31}{54}} -\definecharacter greekiotadasiaperispomeni {\uchar{31}{55}} -\definecharacter greekIotapsili {\uchar{31}{56}} -\definecharacter greekIotadasia {\uchar{31}{57}} -\definecharacter greekIotapsilivaria {\uchar{31}{58}} -\definecharacter greekIotadasiavaria {\uchar{31}{59}} -\definecharacter greekIotapsilitonos {\uchar{31}{60}} -\definecharacter greekIotadasiatonos {\uchar{31}{61}} -\definecharacter greekIotapsiliperispomeni {\uchar{31}{62}} -\definecharacter greekIotadasiaperispomeni {\uchar{31}{63}} -\definecharacter greekomicronpsili {\uchar{31}{64}} % 1f40 -\definecharacter greekomicrondasia {\uchar{31}{65}} -\definecharacter greekomicronpsilivaria {\uchar{31}{66}} -\definecharacter greekomicrondasiavaria {\uchar{31}{67}} -\definecharacter greekomicronpsilitonos {\uchar{31}{68}} -\definecharacter greekomicrondasiatonos {\uchar{31}{69}} -\definecharacter greekOmicronpsili {\uchar{31}{72}} -\definecharacter greekOmicrondasia {\uchar{31}{73}} -\definecharacter greekOmicronpsilivaria {\uchar{31}{74}} -\definecharacter greekOmicrondasiavaria {\uchar{31}{75}} -\definecharacter greekOmicronpsilitonos {\uchar{31}{76}} -\definecharacter greekOmicrondasiatonos {\uchar{31}{77}} -\definecharacter greekupsilonpsili {\uchar{31}{80}} % 1f50 -\definecharacter greekupsilondasia {\uchar{31}{81}} -\definecharacter greekupsilonpsilivaria {\uchar{31}{82}} -\definecharacter greekupsilondasiavaria {\uchar{31}{83}} -\definecharacter greekupsilonpsilitonos {\uchar{31}{84}} -\definecharacter greekupsilondasiatonos {\uchar{31}{85}} -\definecharacter greekupsilonpsiliperispomeni {\uchar{31}{86}} -\definecharacter greekupsilondasiaperispomeni {\uchar{31}{87}} -\definecharacter greekUpsilondasia {\uchar{31}{89}} -\definecharacter greekUpsilondasiavaria {\uchar{31}{91}} -\definecharacter greekUpsilondasiatonos {\uchar{31}{93}} -\definecharacter greekUpsilondasiaperispomeni {\uchar{31}{95}} -\definecharacter greekomegapsili {\uchar{31}{96}} % 1f60 -\definecharacter greekomegadasia {\uchar{31}{97}} -\definecharacter greekomegapsilivaria {\uchar{31}{98}} -\definecharacter greekomegadasiavaria {\uchar{31}{99}} -\definecharacter greekomegapsilitonos {\uchar{31}{100}} -\definecharacter greekomegadasiatonos {\uchar{31}{101}} -\definecharacter greekomegapsiliperispomeni {\uchar{31}{102}} -\definecharacter greekomegadasiaperispomeni {\uchar{31}{103}} -\definecharacter greekOmegapsili {\uchar{31}{104}} -\definecharacter greekOmegadasia {\uchar{31}{105}} -\definecharacter greekOmegapsilivaria {\uchar{31}{106}} -\definecharacter greekOmegadasiavaria {\uchar{31}{107}} -\definecharacter greekOmegapsilitonos {\uchar{31}{108}} -\definecharacter greekOmegadasiatonos {\uchar{31}{109}} -\definecharacter greekOmegapsiliperispomeni {\uchar{31}{110}} -\definecharacter greekOmegadasiaperispomeni {\uchar{31}{111}} -\definecharacter greekalphavaria {\uchar{31}{112}} % 1f70 -\definecharacter greekalphaoxia {\uchar{31}{113}} -\definecharacter greekepsilonvaria {\uchar{31}{114}} -\definecharacter greekepsilonoxia {\uchar{31}{115}} -\definecharacter greeketavaria {\uchar{31}{116}} -\definecharacter greeketaoxia {\uchar{31}{117}} -\definecharacter greekiotavaria {\uchar{31}{118}} -\definecharacter greekiotaoxia {\uchar{31}{119}} -\definecharacter greekomicronvaria {\uchar{31}{120}} -\definecharacter greekomicronoxia {\uchar{31}{121}} -\definecharacter greekupsilonvaria {\uchar{31}{122}} -\definecharacter greekupsilonoxia {\uchar{31}{123}} -\definecharacter greekomegavaria {\uchar{31}{124}} -\definecharacter greekomegaoxia {\uchar{31}{125}} -\definecharacter greekalphaiotasubpsili {\uchar{31}{128}} % 1f80 -\definecharacter greekalphaiotasubdasia {\uchar{31}{129}} -\definecharacter greekalphaiotasubpsilivaria {\uchar{31}{130}} -\definecharacter greekalphaiotasubdasiavaria {\uchar{31}{131}} -\definecharacter greekalphaiotasubpsilitonos {\uchar{31}{132}} -\definecharacter greekalphaiotasubdasiatonos {\uchar{31}{133}} -\definecharacter greekalphaiotasubpsiliperispomeni {\uchar{31}{134}} -\definecharacter greekalphaiotasubdasiaperispomeni {\uchar{31}{135}} -\definecharacter greekAlphaiotasubpsili {\uchar{31}{136}} -\definecharacter greekAlphaiotasubdasia {\uchar{31}{137}} -\definecharacter greekAlphaiotasubpsilivaria {\uchar{31}{138}} -\definecharacter greekAlphaiotasubdasiavaria {\uchar{31}{139}} -\definecharacter greekAlphaiotasubpsilitonos {\uchar{31}{140}} -\definecharacter greekAlphaiotasubdasiatonos {\uchar{31}{141}} -\definecharacter greekAlphaiotasubpsiliperispomeni {\uchar{31}{142}} -\definecharacter greekAlphaiotasubdasiaperispomeni {\uchar{31}{143}} -\definecharacter greeketaiotasubpsili {\uchar{31}{144}} % 1f90 -\definecharacter greeketaiotasubdasia {\uchar{31}{145}} -\definecharacter greeketaiotasubpsilivaria {\uchar{31}{146}} -\definecharacter greeketaiotasubdasiavaria {\uchar{31}{147}} -\definecharacter greeketaiotasubpsilitonos {\uchar{31}{148}} -\definecharacter greeketaiotasubdasiatonos {\uchar{31}{149}} -\definecharacter greeketaiotasubpsiliperispomeni {\uchar{31}{150}} -\definecharacter greeketaiotasubdasiaperispomeni {\uchar{31}{151}} -\definecharacter greekEtaiotasubpsili {\uchar{31}{152}} -\definecharacter greekEtaiotasubdasia {\uchar{31}{153}} -\definecharacter greekEtaiotasubpsilivaria {\uchar{31}{154}} -\definecharacter greekEtaiotasubdasiavaria {\uchar{31}{155}} -\definecharacter greekEtaiotasubpsilitonos {\uchar{31}{156}} -\definecharacter greekEtaiotasubdasiatonos {\uchar{31}{157}} -\definecharacter greekEtaiotasubpsiliperispomeni {\uchar{31}{158}} -\definecharacter greekEtaiotasubdasiaperispomeni {\uchar{31}{159}} -\definecharacter greekomegaiotasubpsili {\uchar{31}{160}} % 1fa0 -\definecharacter greekomegaiotasubdasia {\uchar{31}{161}} -\definecharacter greekomegaiotasubpsilivaria {\uchar{31}{162}} -\definecharacter greekomegaiotasubdasiavaria {\uchar{31}{163}} -\definecharacter greekomegaiotasubpsilitonos {\uchar{31}{164}} -\definecharacter greekomegaiotasubdasiatonos {\uchar{31}{165}} -\definecharacter greekomegaiotasubpsiliperispomeni {\uchar{31}{166}} -\definecharacter greekomegaiotasubdasiaperispomeni {\uchar{31}{167}} -\definecharacter greekOmegaiotasubpsili {\uchar{31}{168}} -\definecharacter greekOmegaiotasubdasia {\uchar{31}{169}} -\definecharacter greekOmegaiotasubpsilivaria {\uchar{31}{170}} -\definecharacter greekOmegaiotasubdasiavaria {\uchar{31}{171}} -\definecharacter greekOmegaiotasubpsilitonos {\uchar{31}{172}} -\definecharacter greekOmegaiotasubdasiatonos {\uchar{31}{173}} -\definecharacter greekOmegaiotasubpsiliperispomeni {\uchar{31}{174}} -\definecharacter greekOmegaiotasubdasiaperispomeni {\uchar{31}{175}} -\definecharacter greekalphavrachy {\uchar{31}{176}} % 1fb0 -\definecharacter greekalphamacron {\uchar{31}{177}} -\definecharacter greekalphaiotasubvaria {\uchar{31}{178}} -\definecharacter greekalphaiotasub {\uchar{31}{179}} -\definecharacter greekalphaiotasubtonos {\uchar{31}{180}} -\definecharacter greekalphaperispomeni {\uchar{31}{182}} -\definecharacter greekalphaiotasubperispomeni {\uchar{31}{183}} -\definecharacter greekAlphavrachy {\uchar{31}{184}} -\definecharacter greekAlphamacron {\uchar{31}{185}} -\definecharacter greekAlphavaria {\uchar{31}{186}} -\definecharacter greekAlphatonos {\uchar{31}{187}} -\definecharacter greekAlphaiotasub {\uchar{31}{188}} -\definecharacter greekCoronis {\uchar{31}{189}} -\definecharacter greekprosgegrammeni {\uchar{31}{190}} -\definecharacter greekpsili {\uchar{31}{191}} -\definecharacter greekperispomeni {\uchar{31}{192}} % 1fc0 -\definecharacter greekdialytikaperispomeni {\uchar{31}{193}} -\definecharacter greeketaiotasubvaria {\uchar{31}{194}} -\definecharacter greeketaiotasub {\uchar{31}{195}} -\definecharacter greeketaiotasubtonos {\uchar{31}{196}} -\definecharacter greeketaperispomeni {\uchar{31}{198}} -\definecharacter greeketaiotasubperispomeni {\uchar{31}{199}} -\definecharacter greekEpsilonvaria {\uchar{31}{200}} -\definecharacter greekEpsilontonos {\uchar{31}{201}} -\definecharacter greekEtavaria {\uchar{31}{202}} -\definecharacter greekEtatonos {\uchar{31}{203}} -\definecharacter greekEtaiotasub {\uchar{31}{204}} -\definecharacter greekpsilivaria {\uchar{31}{205}} -\definecharacter greekpsilitonos {\uchar{31}{206}} -\definecharacter greekpsiliperispomeni {\uchar{31}{207}} -\definecharacter greekiotavrachy {\uchar{31}{208}} % 1fd0 -\definecharacter greekiotamacron {\uchar{31}{209}} -\definecharacter greekiotadialytikavaria {\uchar{31}{210}} -\definecharacter greekiotadialytikatonos {\uchar{31}{211}} -\definecharacter greekiotaperispomeni {\uchar{31}{214}} -\definecharacter greekiotadialytikaperispomeni {\uchar{31}{215}} -\definecharacter greekIotavrachy {\uchar{31}{216}} -\definecharacter greekIotamacron {\uchar{31}{217}} -\definecharacter greekIotavaria {\uchar{31}{218}} -\definecharacter greekIotatonos {\uchar{31}{219}} -\definecharacter greekdasiavaria {\uchar{31}{221}} -\definecharacter greekdasiatonos {\uchar{31}{222}} -\definecharacter greekdasiaperispomeni {\uchar{31}{223}} -\definecharacter greekupsilonvrachy {\uchar{31}{224}} % 1fe0 -\definecharacter greekupsilonmacron {\uchar{31}{225}} -\definecharacter greekupsilondialytikavaria {\uchar{31}{226}} -\definecharacter greekupsilondialytikatonos {\uchar{31}{227}} -\definecharacter greekrhopsili {\uchar{31}{228}} -\definecharacter greekrhodasia {\uchar{31}{229}} -\definecharacter greekupsilonperispomeni {\uchar{31}{230}} -\definecharacter greekupsilondialytikaperispomeni {\uchar{31}{231}} -\definecharacter greekUpsilonvrachy {\uchar{31}{232}} -\definecharacter greekUpsilonmacron {\uchar{31}{233}} -\definecharacter greekUpsilonvaria {\uchar{31}{234}} -\definecharacter greekUpsilontonos {\uchar{31}{235}} -\definecharacter greekRhodasia {\uchar{31}{236}} -\definecharacter greekdialytikavaria {\uchar{31}{237}} -\definecharacter greekdialytikatonos {\uchar{31}{238}} -\definecharacter greekvaria {\uchar{31}{239}} -\definecharacter greekomegaiotasubvaria {\uchar{31}{242}} -\definecharacter greekomegaiotasub {\uchar{31}{243}} -\definecharacter greekomegaiotasubtonos {\uchar{31}{244}} -\definecharacter greekomegaperispomeni {\uchar{31}{246}} -\definecharacter greekomegaiotasubperispomeni {\uchar{31}{247}} -\definecharacter greekOmicronvaria {\uchar{31}{248}} -\definecharacter greekOmicrontonos {\uchar{31}{249}} -\definecharacter greekOmegavaria {\uchar{31}{250}} -\definecharacter greekOmegatonos {\uchar{31}{251}} -\definecharacter greekOmegaiotasub {\uchar{31}{252}} -\definecharacter greekoxia {\uchar{31}{253}} -\definecharacter greekdasia {\uchar{31}{254}} -\definecharacter greeksigmalunate {\uchar3{242}} -\definecharacter greekSigmalunate {\uchar3{249}} -\definecharacter greeksampi {\uchar3{225}} -\definecharacter greekdigamma {\uchar3{221}} -\definecharacter greekstigma {\uchar3{219}} -\definecharacter greeknumkoppa {\uchar3{223}} -\definecharacter greekkoppa {\uchar3{217}} -\definecharacter greekupsilondiaeresis {\uchar3{203}} - -\stopencoding - -% Hebrew: - -\startencoding[uc] - -\definecharacter hebrewAlef {\uchar5{208}} % 05D0 -\definecharacter hebrewBet {\uchar5{209}} -\definecharacter hebrewGimel {\uchar5{210}} -\definecharacter hebrewDalet {\uchar5{211}} -\definecharacter hebrewHe {\uchar5{212}} -\definecharacter hebrewVav {\uchar5{213}} -\definecharacter hebrewZayin {\uchar5{214}} -\definecharacter hebrewHet {\uchar5{215}} -\definecharacter hebrewTet {\uchar5{216}} -\definecharacter hebrewYod {\uchar5{217}} -\definecharacter hebrewKaffinal {\uchar5{218}} -\definecharacter hebrewKaf {\uchar5{219}} -\definecharacter hebrewLamed {\uchar5{220}} -\definecharacter hebrewMemfinal {\uchar5{221}} -\definecharacter hebrewMem {\uchar5{222}} -\definecharacter hebrewNunfinal {\uchar5{223}} -\definecharacter hebrewNun {\uchar5{224}} -\definecharacter hebrewSamekh {\uchar5{225}} -\definecharacter hebrewAyin {\uchar5{226}} -\definecharacter hebrewPefinal {\uchar5{227}} -\definecharacter hebrewPe {\uchar5{228}} -\definecharacter hebrewTsadifinal {\uchar5{229}} -\definecharacter hebrewTsadi {\uchar5{230}} -\definecharacter hebrewQof {\uchar5{231}} -\definecharacter hebrewResh {\uchar5{232}} -\definecharacter hebrewShin {\uchar5{233}} -\definecharacter hebrewTav {\uchar5{234}} % 05EA - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-vis.mkii b/tex/context/base/enco-vis.mkii new file mode 100644 index 000000000..3c1fd7765 --- /dev/null +++ b/tex/context/base/enco-vis.mkii @@ -0,0 +1,3 @@ +% temporary module, needed for downward compatibility + +\input regi-vis.tex \enableregime[viscii] \endinput diff --git a/tex/context/base/enco-vis.tex b/tex/context/base/enco-vis.tex deleted file mode 100644 index 3c1fd7765..000000000 --- a/tex/context/base/enco-vis.tex +++ /dev/null @@ -1,3 +0,0 @@ -% temporary module, needed for downward compatibility - -\input regi-vis.tex \enableregime[viscii] \endinput diff --git a/tex/context/base/enco-vna.mkii b/tex/context/base/enco-vna.mkii new file mode 100644 index 000000000..05753f37b --- /dev/null +++ b/tex/context/base/enco-vna.mkii @@ -0,0 +1,145 @@ +%D \module +%D [ file=enco-vna, +%D version=1999.12.12, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Vietnamese Accents, +%D author=Han The Thanh & Adam Lindsay & Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module is originally derived from the some files Han The Thanh +%D prepared for \LATEX. The dual accent support is still preliminary, +%D but works ok. It's now adapted to named glyphs, and is activated by +%D \type {\useencoding[thisfile]}. + +%D This was apparently buggy from the start: there is nothing to +%D disambiguate \type {\ohorn} from \type {\ohook}. Both are entered +%D with \type {\h{o}} (AL)! + +%D Once stable, this code will move to \type {enco-acc.tex}. + +\startencoding[default] + +\defineaccent h A {\Ahook} +\defineaccent d A {\Adotbelow} +\defineaccent ` ^A {\Acircumflexgrave} +\defineaccent ' ^A {\Acircumflexacute} +\defineaccent ~ ^A {\Acircumflextilde} +\defineaccent h ^A {\Acircumflexhook} +\defineaccent d ^A {\Acircumflexdotbelow} +\defineaccent ` uA {\Abrevegrave} +\defineaccent ' uA {\Abreveacute} +\defineaccent ~ uA {\Abrevetilde} +\defineaccent h uA {\Abrevehook} +\defineaccent d uA {\Abrevedotbelow} +\defineaccent h E {\Ehook} +\defineaccent d E {\Edotbelow} +\defineaccent ` ^E {\Ecircumflexgrave} +\defineaccent ' ^E {\Ecircumflexacute} +\defineaccent ~ ^E {\Ecircumflextilde} +\defineaccent h ^E {\Ecircumflexhook} +\defineaccent d ^E {\Ecircumflexdotbelow} +\defineaccent h I {\Ihook} +\defineaccent d I {\Idotbelow} +\defineaccent h O {\Ohook} +\defineaccent d O {\Odotbelow} +\defineaccent ` ^O {\Ocircumflexgrave} +\defineaccent ' ^O {\Ocircumflexacute} +\defineaccent ~ ^O {\Ocircumflextilde} +\defineaccent h ^O {\Ocircumflexhook} +\defineaccent d ^O {\Ocircumflexdotbelow} +%defineaccent h O {\Ohorn} % !!! conflict with \Ohook! +\defineaccent ` hO {\Ohorngrave} +\defineaccent ` {\Ohorn} {\Ohorngrave} +\defineaccent ' hO {\Ohornacute} +\defineaccent ' {\Ohorn} {\Ohornacute} +\defineaccent ~ hO {\Ohorntilde} +\defineaccent ~ {\Ohorn} {\Ohorntilde} +\defineaccent h hO {\Ohornhook} +\defineaccent h {\Ohorn} {\Ohornhook} +\defineaccent d hO {\Ohorndotbelow} +\defineaccent d {\Ohorn} {\Ohorndotbelow} +\defineaccent h U {\Uhook} +\defineaccent d U {\Udotbelow} +%defineaccent h U {\Uhorn} % !!! conflict with \Uhook! honestly, people! +\defineaccent ` hU {\Uhorngrave} +\defineaccent ` {\Uhorn} {\Uhorngrave} +\defineaccent ' hU {\Uhornacute} +\defineaccent ' {\Uhorn} {\Uhornacute} +\defineaccent ~ hU {\Uhorntilde} +\defineaccent ~ {\Uhorn} {\Uhorntilde} +\defineaccent h hU {\Uhornhook} +\defineaccent h {\Uhorn} {\Uhornhook} +\defineaccent d hU {\Uhorndotbelow} +\defineaccent d {\Uhorn} {\Uhorndotbelow} +\defineaccent ` Y {\Ygrave} +\defineaccent ' Y {\Yacute} +\defineaccent ~ Y {\Ytilde} +\defineaccent h Y {\Yhook} +\defineaccent d Y {\Ydotbelow} +\defineaccent h a {\ahook} +\defineaccent d a {\adotbelow} +\defineaccent ` ^a {\acircumflexgrave} +\defineaccent ' ^a {\acircumflexacute} +\defineaccent ~ ^a {\acircumflextilde} +\defineaccent h ^a {\acircumflexhook} +\defineaccent d ^a {\acircumflexdotbelow} +\defineaccent ` ua {\abrevegrave} +\defineaccent ' ua {\abreveacute} +\defineaccent ~ ua {\abrevetilde} +\defineaccent h ua {\abrevehook} +\defineaccent d ua {\abrevedotbelow} +\defineaccent h e {\ehook} +\defineaccent d e {\edotbelow} +\defineaccent ` ^e {\ecircumflexgrave} +\defineaccent ' ^e {\ecircumflexacute} +\defineaccent ~ ^e {\ecircumflextilde} +\defineaccent h ^e {\ecircumflexhook} +\defineaccent d ^e {\ecircumflexdotbelow} +\defineaccent h i {\ihook} +\defineaccent d i {\idotbelow} +\defineaccent h o {\ohook} +\defineaccent d o {\odotbelow} +\defineaccent ^ o {\ocircumflex} +\defineaccent ` ^o {\ocircumflexgrave} +\defineaccent ' ^o {\ocircumflexacute} +\defineaccent ~ ^o {\ocircumflextilde} +\defineaccent h ^o {\ocircumflexhook} +\defineaccent d ^o {\ocircumflexdotbelow} +%defineaccent h o {\ohorn} % !!! +\defineaccent ` ho {\ohorngrave} +\defineaccent ' ho {\ohornacute} +\defineaccent ~ ho {\ohorntilde} +\defineaccent h ho {\ohornhook} +\defineaccent d ho {\ohorndotbelow} +\defineaccent ` {\ohorn} {\ohorngrave} +\defineaccent ' {\ohorn} {\ohornacute} +\defineaccent ~ {\ohorn} {\ohorntilde} +\defineaccent h {\ohorn} {\ohornhook} +\defineaccent d {\ohorn} {\ohorndotbelow} +\defineaccent h u {\uhook} +\defineaccent d u {\udotbelow} +%defineaccent h u {\uhorn} % !!! +\defineaccent ` hu {\uhorngrave} +\defineaccent ' hu {\uhornacute} +\defineaccent ~ hu {\uhorntilde} +\defineaccent h hu {\uhornhook} +\defineaccent d hu {\uhorndotbelow} +\defineaccent ` {\uhorn} {\uhorngrave} +\defineaccent ' {\uhorn} {\uhornacute} +\defineaccent ~ {\uhorn} {\uhorntilde} +\defineaccent h {\uhorn} {\uhornhook} +\defineaccent d {\uhorn} {\uhorndotbelow} +\defineaccent ` y {\ygrave} +\defineaccent ' y {\yacute} +\defineaccent ~ y {\ytilde} +\defineaccent h y {\yhook} +\defineaccent d y {\ydotbelow} + +\stopencoding + +\endinput diff --git a/tex/context/base/enco-vna.tex b/tex/context/base/enco-vna.tex deleted file mode 100644 index 05753f37b..000000000 --- a/tex/context/base/enco-vna.tex +++ /dev/null @@ -1,145 +0,0 @@ -%D \module -%D [ file=enco-vna, -%D version=1999.12.12, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Vietnamese Accents, -%D author=Han The Thanh & Adam Lindsay & Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module is originally derived from the some files Han The Thanh -%D prepared for \LATEX. The dual accent support is still preliminary, -%D but works ok. It's now adapted to named glyphs, and is activated by -%D \type {\useencoding[thisfile]}. - -%D This was apparently buggy from the start: there is nothing to -%D disambiguate \type {\ohorn} from \type {\ohook}. Both are entered -%D with \type {\h{o}} (AL)! - -%D Once stable, this code will move to \type {enco-acc.tex}. - -\startencoding[default] - -\defineaccent h A {\Ahook} -\defineaccent d A {\Adotbelow} -\defineaccent ` ^A {\Acircumflexgrave} -\defineaccent ' ^A {\Acircumflexacute} -\defineaccent ~ ^A {\Acircumflextilde} -\defineaccent h ^A {\Acircumflexhook} -\defineaccent d ^A {\Acircumflexdotbelow} -\defineaccent ` uA {\Abrevegrave} -\defineaccent ' uA {\Abreveacute} -\defineaccent ~ uA {\Abrevetilde} -\defineaccent h uA {\Abrevehook} -\defineaccent d uA {\Abrevedotbelow} -\defineaccent h E {\Ehook} -\defineaccent d E {\Edotbelow} -\defineaccent ` ^E {\Ecircumflexgrave} -\defineaccent ' ^E {\Ecircumflexacute} -\defineaccent ~ ^E {\Ecircumflextilde} -\defineaccent h ^E {\Ecircumflexhook} -\defineaccent d ^E {\Ecircumflexdotbelow} -\defineaccent h I {\Ihook} -\defineaccent d I {\Idotbelow} -\defineaccent h O {\Ohook} -\defineaccent d O {\Odotbelow} -\defineaccent ` ^O {\Ocircumflexgrave} -\defineaccent ' ^O {\Ocircumflexacute} -\defineaccent ~ ^O {\Ocircumflextilde} -\defineaccent h ^O {\Ocircumflexhook} -\defineaccent d ^O {\Ocircumflexdotbelow} -%defineaccent h O {\Ohorn} % !!! conflict with \Ohook! -\defineaccent ` hO {\Ohorngrave} -\defineaccent ` {\Ohorn} {\Ohorngrave} -\defineaccent ' hO {\Ohornacute} -\defineaccent ' {\Ohorn} {\Ohornacute} -\defineaccent ~ hO {\Ohorntilde} -\defineaccent ~ {\Ohorn} {\Ohorntilde} -\defineaccent h hO {\Ohornhook} -\defineaccent h {\Ohorn} {\Ohornhook} -\defineaccent d hO {\Ohorndotbelow} -\defineaccent d {\Ohorn} {\Ohorndotbelow} -\defineaccent h U {\Uhook} -\defineaccent d U {\Udotbelow} -%defineaccent h U {\Uhorn} % !!! conflict with \Uhook! honestly, people! -\defineaccent ` hU {\Uhorngrave} -\defineaccent ` {\Uhorn} {\Uhorngrave} -\defineaccent ' hU {\Uhornacute} -\defineaccent ' {\Uhorn} {\Uhornacute} -\defineaccent ~ hU {\Uhorntilde} -\defineaccent ~ {\Uhorn} {\Uhorntilde} -\defineaccent h hU {\Uhornhook} -\defineaccent h {\Uhorn} {\Uhornhook} -\defineaccent d hU {\Uhorndotbelow} -\defineaccent d {\Uhorn} {\Uhorndotbelow} -\defineaccent ` Y {\Ygrave} -\defineaccent ' Y {\Yacute} -\defineaccent ~ Y {\Ytilde} -\defineaccent h Y {\Yhook} -\defineaccent d Y {\Ydotbelow} -\defineaccent h a {\ahook} -\defineaccent d a {\adotbelow} -\defineaccent ` ^a {\acircumflexgrave} -\defineaccent ' ^a {\acircumflexacute} -\defineaccent ~ ^a {\acircumflextilde} -\defineaccent h ^a {\acircumflexhook} -\defineaccent d ^a {\acircumflexdotbelow} -\defineaccent ` ua {\abrevegrave} -\defineaccent ' ua {\abreveacute} -\defineaccent ~ ua {\abrevetilde} -\defineaccent h ua {\abrevehook} -\defineaccent d ua {\abrevedotbelow} -\defineaccent h e {\ehook} -\defineaccent d e {\edotbelow} -\defineaccent ` ^e {\ecircumflexgrave} -\defineaccent ' ^e {\ecircumflexacute} -\defineaccent ~ ^e {\ecircumflextilde} -\defineaccent h ^e {\ecircumflexhook} -\defineaccent d ^e {\ecircumflexdotbelow} -\defineaccent h i {\ihook} -\defineaccent d i {\idotbelow} -\defineaccent h o {\ohook} -\defineaccent d o {\odotbelow} -\defineaccent ^ o {\ocircumflex} -\defineaccent ` ^o {\ocircumflexgrave} -\defineaccent ' ^o {\ocircumflexacute} -\defineaccent ~ ^o {\ocircumflextilde} -\defineaccent h ^o {\ocircumflexhook} -\defineaccent d ^o {\ocircumflexdotbelow} -%defineaccent h o {\ohorn} % !!! -\defineaccent ` ho {\ohorngrave} -\defineaccent ' ho {\ohornacute} -\defineaccent ~ ho {\ohorntilde} -\defineaccent h ho {\ohornhook} -\defineaccent d ho {\ohorndotbelow} -\defineaccent ` {\ohorn} {\ohorngrave} -\defineaccent ' {\ohorn} {\ohornacute} -\defineaccent ~ {\ohorn} {\ohorntilde} -\defineaccent h {\ohorn} {\ohornhook} -\defineaccent d {\ohorn} {\ohorndotbelow} -\defineaccent h u {\uhook} -\defineaccent d u {\udotbelow} -%defineaccent h u {\uhorn} % !!! -\defineaccent ` hu {\uhorngrave} -\defineaccent ' hu {\uhornacute} -\defineaccent ~ hu {\uhorntilde} -\defineaccent h hu {\uhornhook} -\defineaccent d hu {\uhorndotbelow} -\defineaccent ` {\uhorn} {\uhorngrave} -\defineaccent ' {\uhorn} {\uhornacute} -\defineaccent ~ {\uhorn} {\uhorntilde} -\defineaccent h {\uhorn} {\uhornhook} -\defineaccent d {\uhorn} {\uhorndotbelow} -\defineaccent ` y {\ygrave} -\defineaccent ' y {\yacute} -\defineaccent ~ y {\ytilde} -\defineaccent h y {\yhook} -\defineaccent d y {\ydotbelow} - -\stopencoding - -\endinput diff --git a/tex/context/base/enco-win.mkii b/tex/context/base/enco-win.mkii new file mode 100644 index 000000000..826371d8a --- /dev/null +++ b/tex/context/base/enco-win.mkii @@ -0,0 +1,7 @@ +% temporary module, needed for downward compatibility + +%\input regi-win.tex + +\enableregime[windows] + +\endinput diff --git a/tex/context/base/enco-win.tex b/tex/context/base/enco-win.tex deleted file mode 100644 index 826371d8a..000000000 --- a/tex/context/base/enco-win.tex +++ /dev/null @@ -1,7 +0,0 @@ -% temporary module, needed for downward compatibility - -%\input regi-win.tex - -\enableregime[windows] - -\endinput diff --git a/tex/context/base/enco-x5.mkii b/tex/context/base/enco-x5.mkii new file mode 100644 index 000000000..f82ec6c5c --- /dev/null +++ b/tex/context/base/enco-x5.mkii @@ -0,0 +1,218 @@ +%D \module +%D [ file=enco-x5, +%D version=1999.12.12, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Vietnamese Encoding, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module is derived from the some files Han The Thanh +%D prepared for \LATEX. The dual accent support is still +%D preliminary, but works ok. + +\startencoding[x5] + +\definecharacter textgrave 0 +\definecharacter textacute 1 +\definecharacter textcircumflex 2 +\definecharacter texttilde 3 +\definecharacter textdiaeresis 4 +\definecharacter texthungarumlaut 5 +\definecharacter textring 6 +\definecharacter textcaron 7 +\definecharacter textbreve 8 +\definecharacter textmacron 9 +\definecharacter textdotaccent 10 +\definecharacter textcedilla 11 +\definecharacter textogonek 12 + +\definecharacter dotlessi 25 +\definecharacter DJ 30 +\definecharacter dj 31 + +\defineaccent ` A 128 +\defineaccent ' A 129 +\defineaccent ~ A 130 +\defineaccent h A 131 +\defineaccent d A 132 +\defineaccent ^ A 133 +\defineaccent ` ^A 134 +\defineaccent ' ^A 135 +\defineaccent ~ ^A 136 +\defineaccent h ^A 137 +\defineaccent d ^A 138 +\defineaccent u A 139 +\defineaccent ` uA 140 +\defineaccent ' uA 141 +\defineaccent ~ uA 142 +\defineaccent h uA 143 +\defineaccent d uA 144 +\defineaccent ` E 145 +\defineaccent ' E 146 +\defineaccent ~ E 147 +\defineaccent h E 148 +\defineaccent d E 149 +\defineaccent ^ E 150 +\defineaccent ` ^E 151 +\defineaccent ' ^E 152 +\defineaccent ~ ^E 153 +\defineaccent h ^E 154 +\defineaccent d ^E 155 +\defineaccent ` I 156 +\defineaccent ' I 157 +\defineaccent ~ I 158 +\defineaccent h I 159 +\defineaccent d I 192 +\defineaccent ` O 193 +\defineaccent ' O 194 +\defineaccent ~ O 195 +\defineaccent h O 196 +\defineaccent d O 197 +\defineaccent ^ O 198 +\defineaccent ` ^O 199 +\defineaccent ' ^O 200 +\defineaccent ~ ^O 201 +\defineaccent h ^O 202 +\defineaccent d ^O 203 +\defineaccent h O 204 +\defineaccent ` hO 205 +\defineaccent ' hO 206 +\defineaccent ~ hO 207 +\defineaccent h hO 208 +\defineaccent d hO 209 +\defineaccent ` U 210 +\defineaccent ' U 211 +\defineaccent ~ U 212 +\defineaccent h U 213 +\defineaccent d U 214 +\defineaccent h U 215 +\defineaccent ` hU 216 +\defineaccent ' hU 217 +\defineaccent ~ hU 218 +\defineaccent h hU 219 +\defineaccent d hU 220 +\defineaccent ` Y 221 +\defineaccent ' Y 222 +\defineaccent ~ Y 223 +\defineaccent h Y 26 +\defineaccent d Y 28 +\defineaccent ` a 160 +\defineaccent ' a 161 +\defineaccent ~ a 162 +\defineaccent h a 163 +\defineaccent d a 164 +\defineaccent ^ a 165 +\defineaccent ` ^a 166 +\defineaccent ' ^a 167 +\defineaccent ~ ^a 168 +\defineaccent h ^a 169 +\defineaccent d ^a 170 +\defineaccent u a 171 +\defineaccent ` ua 172 +\defineaccent ' ua 173 +\defineaccent ~ ua 174 +\defineaccent h ua 175 +\defineaccent d ua 176 +\defineaccent ` e 177 +\defineaccent ' e 178 +\defineaccent ~ e 179 +\defineaccent h e 180 +\defineaccent d e 181 +\defineaccent ^ e 182 +\defineaccent ` ^e 183 +\defineaccent ' ^e 184 +\defineaccent ~ ^e 185 +\defineaccent h ^e 186 +\defineaccent d ^e 187 +\defineaccent ` i 188 +\defineaccent ' i 189 +\defineaccent ~ i 190 +\defineaccent h i 191 +\defineaccent d i 224 +\defineaccent ` o 225 +\defineaccent ' o 226 +\defineaccent ~ o 227 +\defineaccent h o 228 +\defineaccent d o 229 +\defineaccent ^ o 230 +\defineaccent ` ^o 231 +\defineaccent ' ^o 232 +\defineaccent ~ ^o 233 +\defineaccent h ^o 234 +\defineaccent d ^o 235 +\defineaccent h o 236 +\defineaccent ` ho 237 +\defineaccent ' ho 238 +\defineaccent ~ ho 239 +\defineaccent h ho 240 +\defineaccent d ho 241 +\defineaccent ` u 242 +\defineaccent ' u 243 +\defineaccent ~ u 244 +\defineaccent h u 245 +\defineaccent d u 246 +\defineaccent h u 247 +\defineaccent ` hu 248 +\defineaccent ' hu 249 +\defineaccent ~ hu 250 +\defineaccent h hu 251 +\defineaccent d hu 252 +\defineaccent ` y 253 +\defineaccent ' y 254 +\defineaccent ~ y 255 +\defineaccent h y 27 +\defineaccent d y 29 + +\stopencoding + +\endinput + +% \startencoding [x5] +% +% \definecharacter aa {\xfiveencodedaa} +% \definecharacter AA {\xfiveencodedAA} +% +% \stopencoding +% +% \def\xfiveencodedaa% +% {\accent23a} +% +% \def\xfiveencodedAA% +% {\leavevmode +% \setbox\zerocount\hbox{h}% +% \dimen@\ht\zerocount +% \advance\dimen@ -1ex +% \rlap{\raise.67\dimen@\hbox{\char23}}A} + +% \quotesinglbase 13 +% \guilsinglleft 14 +% \guilsinglright 15 +% \textquotedblleft 16 +% \textquotedblright 17 +% \quotedblbase 18 +% \guillemotleft 19 +% \guillemotright 20 +% \textendash 21 +% \textemdash 22 +% \textcompwordmark 23 +% \textperthousand \% \char 24 +% \textpertenthousand \%\char 24\char 24 +% \textvisiblespace 32 +% \textquotedbl `\" +% \textdollar `\$ +% \textquoteright `\' +% \textless `\< +% \textgreater `\> +% \textbackslash `\ +% \textasciicircum `\^ +% \textunderscore 95 +% \textquoteleft `\` +% \textbraceleft `\{ +% \textbar `\| +% \textbraceright `\} +% \textasciitilde `\~ diff --git a/tex/context/base/enco-x5.tex b/tex/context/base/enco-x5.tex deleted file mode 100644 index f82ec6c5c..000000000 --- a/tex/context/base/enco-x5.tex +++ /dev/null @@ -1,218 +0,0 @@ -%D \module -%D [ file=enco-x5, -%D version=1999.12.12, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Vietnamese Encoding, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module is derived from the some files Han The Thanh -%D prepared for \LATEX. The dual accent support is still -%D preliminary, but works ok. - -\startencoding[x5] - -\definecharacter textgrave 0 -\definecharacter textacute 1 -\definecharacter textcircumflex 2 -\definecharacter texttilde 3 -\definecharacter textdiaeresis 4 -\definecharacter texthungarumlaut 5 -\definecharacter textring 6 -\definecharacter textcaron 7 -\definecharacter textbreve 8 -\definecharacter textmacron 9 -\definecharacter textdotaccent 10 -\definecharacter textcedilla 11 -\definecharacter textogonek 12 - -\definecharacter dotlessi 25 -\definecharacter DJ 30 -\definecharacter dj 31 - -\defineaccent ` A 128 -\defineaccent ' A 129 -\defineaccent ~ A 130 -\defineaccent h A 131 -\defineaccent d A 132 -\defineaccent ^ A 133 -\defineaccent ` ^A 134 -\defineaccent ' ^A 135 -\defineaccent ~ ^A 136 -\defineaccent h ^A 137 -\defineaccent d ^A 138 -\defineaccent u A 139 -\defineaccent ` uA 140 -\defineaccent ' uA 141 -\defineaccent ~ uA 142 -\defineaccent h uA 143 -\defineaccent d uA 144 -\defineaccent ` E 145 -\defineaccent ' E 146 -\defineaccent ~ E 147 -\defineaccent h E 148 -\defineaccent d E 149 -\defineaccent ^ E 150 -\defineaccent ` ^E 151 -\defineaccent ' ^E 152 -\defineaccent ~ ^E 153 -\defineaccent h ^E 154 -\defineaccent d ^E 155 -\defineaccent ` I 156 -\defineaccent ' I 157 -\defineaccent ~ I 158 -\defineaccent h I 159 -\defineaccent d I 192 -\defineaccent ` O 193 -\defineaccent ' O 194 -\defineaccent ~ O 195 -\defineaccent h O 196 -\defineaccent d O 197 -\defineaccent ^ O 198 -\defineaccent ` ^O 199 -\defineaccent ' ^O 200 -\defineaccent ~ ^O 201 -\defineaccent h ^O 202 -\defineaccent d ^O 203 -\defineaccent h O 204 -\defineaccent ` hO 205 -\defineaccent ' hO 206 -\defineaccent ~ hO 207 -\defineaccent h hO 208 -\defineaccent d hO 209 -\defineaccent ` U 210 -\defineaccent ' U 211 -\defineaccent ~ U 212 -\defineaccent h U 213 -\defineaccent d U 214 -\defineaccent h U 215 -\defineaccent ` hU 216 -\defineaccent ' hU 217 -\defineaccent ~ hU 218 -\defineaccent h hU 219 -\defineaccent d hU 220 -\defineaccent ` Y 221 -\defineaccent ' Y 222 -\defineaccent ~ Y 223 -\defineaccent h Y 26 -\defineaccent d Y 28 -\defineaccent ` a 160 -\defineaccent ' a 161 -\defineaccent ~ a 162 -\defineaccent h a 163 -\defineaccent d a 164 -\defineaccent ^ a 165 -\defineaccent ` ^a 166 -\defineaccent ' ^a 167 -\defineaccent ~ ^a 168 -\defineaccent h ^a 169 -\defineaccent d ^a 170 -\defineaccent u a 171 -\defineaccent ` ua 172 -\defineaccent ' ua 173 -\defineaccent ~ ua 174 -\defineaccent h ua 175 -\defineaccent d ua 176 -\defineaccent ` e 177 -\defineaccent ' e 178 -\defineaccent ~ e 179 -\defineaccent h e 180 -\defineaccent d e 181 -\defineaccent ^ e 182 -\defineaccent ` ^e 183 -\defineaccent ' ^e 184 -\defineaccent ~ ^e 185 -\defineaccent h ^e 186 -\defineaccent d ^e 187 -\defineaccent ` i 188 -\defineaccent ' i 189 -\defineaccent ~ i 190 -\defineaccent h i 191 -\defineaccent d i 224 -\defineaccent ` o 225 -\defineaccent ' o 226 -\defineaccent ~ o 227 -\defineaccent h o 228 -\defineaccent d o 229 -\defineaccent ^ o 230 -\defineaccent ` ^o 231 -\defineaccent ' ^o 232 -\defineaccent ~ ^o 233 -\defineaccent h ^o 234 -\defineaccent d ^o 235 -\defineaccent h o 236 -\defineaccent ` ho 237 -\defineaccent ' ho 238 -\defineaccent ~ ho 239 -\defineaccent h ho 240 -\defineaccent d ho 241 -\defineaccent ` u 242 -\defineaccent ' u 243 -\defineaccent ~ u 244 -\defineaccent h u 245 -\defineaccent d u 246 -\defineaccent h u 247 -\defineaccent ` hu 248 -\defineaccent ' hu 249 -\defineaccent ~ hu 250 -\defineaccent h hu 251 -\defineaccent d hu 252 -\defineaccent ` y 253 -\defineaccent ' y 254 -\defineaccent ~ y 255 -\defineaccent h y 27 -\defineaccent d y 29 - -\stopencoding - -\endinput - -% \startencoding [x5] -% -% \definecharacter aa {\xfiveencodedaa} -% \definecharacter AA {\xfiveencodedAA} -% -% \stopencoding -% -% \def\xfiveencodedaa% -% {\accent23a} -% -% \def\xfiveencodedAA% -% {\leavevmode -% \setbox\zerocount\hbox{h}% -% \dimen@\ht\zerocount -% \advance\dimen@ -1ex -% \rlap{\raise.67\dimen@\hbox{\char23}}A} - -% \quotesinglbase 13 -% \guilsinglleft 14 -% \guilsinglright 15 -% \textquotedblleft 16 -% \textquotedblright 17 -% \quotedblbase 18 -% \guillemotleft 19 -% \guillemotright 20 -% \textendash 21 -% \textemdash 22 -% \textcompwordmark 23 -% \textperthousand \% \char 24 -% \textpertenthousand \%\char 24\char 24 -% \textvisiblespace 32 -% \textquotedbl `\" -% \textdollar `\$ -% \textquoteright `\' -% \textless `\< -% \textgreater `\> -% \textbackslash `\ -% \textasciicircum `\^ -% \textunderscore 95 -% \textquoteleft `\` -% \textbraceleft `\{ -% \textbar `\| -% \textbraceright `\} -% \textasciitilde `\~ diff --git a/tex/context/base/filt-bas.mkii b/tex/context/base/filt-bas.mkii new file mode 100644 index 000000000..ca3bc3d70 --- /dev/null +++ b/tex/context/base/filt-bas.mkii @@ -0,0 +1,63 @@ +%D \module +%D [ file=filt-bas, +%D version=2000.09.19, +%D title=\CONTEXT\ Filter Macros, +%D subtitle=A Base Collection, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% BEWARE: THIS IS A TEST MODULE, NAMES MAY CHANGE! + +\definefiltersynonym [utf8 to unicode16] [inutf8] + +\definefiltersynonym [persian fix] [FarsiToArabic] +\definefiltersynonym [arabic analysis] [uni2cuni] +\definefiltersynonym [arabic glyphs] [cuni2oar] + +\definefiltersequence + [farsi] + [utf8 to unicode16, + persian fix, + arabic analysis, + arabic glyphs] + +\definefiltersynonym [basic context analysis step1] [bcaa-1] +\definefiltersynonym [basic context analysis step2] [bcaa-2] +\definefiltersynonym [basic context analysis step3] [bcaa-3] +\definefiltersynonym [farsi processing for uomarab] [uomarab-farsi] + +\definefiltersynonym [basic presentation forms to sf] [bpftosf] + +\definefiltersynonym [omega persian fix] [FarsiToArabic] +\definefiltersynonym [omega arabic analysis] [uni2cuni] +\definefiltersynonym [omega arabic glyphs] [cuni2oar] + +\definefiltersequence + [farsi-1] + [utf8 to unicode16, + omega persian fix, + omega arabic analysis, + omega arabic glyphs] + +\definefiltersequence + [farsi-2] + [utf8 to unicode16, + basic context analysis step1, + basic context analysis step2, + basic context analysis step3, + farsi processing for uomarab] + +\definefiltersequence + [farsi-3] + [utf8 to unicode16, + basic context analysis step1, + basic context analysis step2, + basic context analysis step3, + basic presentation forms to sf] + +\endinput diff --git a/tex/context/base/filt-bas.tex b/tex/context/base/filt-bas.tex deleted file mode 100644 index ca3bc3d70..000000000 --- a/tex/context/base/filt-bas.tex +++ /dev/null @@ -1,63 +0,0 @@ -%D \module -%D [ file=filt-bas, -%D version=2000.09.19, -%D title=\CONTEXT\ Filter Macros, -%D subtitle=A Base Collection, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% BEWARE: THIS IS A TEST MODULE, NAMES MAY CHANGE! - -\definefiltersynonym [utf8 to unicode16] [inutf8] - -\definefiltersynonym [persian fix] [FarsiToArabic] -\definefiltersynonym [arabic analysis] [uni2cuni] -\definefiltersynonym [arabic glyphs] [cuni2oar] - -\definefiltersequence - [farsi] - [utf8 to unicode16, - persian fix, - arabic analysis, - arabic glyphs] - -\definefiltersynonym [basic context analysis step1] [bcaa-1] -\definefiltersynonym [basic context analysis step2] [bcaa-2] -\definefiltersynonym [basic context analysis step3] [bcaa-3] -\definefiltersynonym [farsi processing for uomarab] [uomarab-farsi] - -\definefiltersynonym [basic presentation forms to sf] [bpftosf] - -\definefiltersynonym [omega persian fix] [FarsiToArabic] -\definefiltersynonym [omega arabic analysis] [uni2cuni] -\definefiltersynonym [omega arabic glyphs] [cuni2oar] - -\definefiltersequence - [farsi-1] - [utf8 to unicode16, - omega persian fix, - omega arabic analysis, - omega arabic glyphs] - -\definefiltersequence - [farsi-2] - [utf8 to unicode16, - basic context analysis step1, - basic context analysis step2, - basic context analysis step3, - farsi processing for uomarab] - -\definefiltersequence - [farsi-3] - [utf8 to unicode16, - basic context analysis step1, - basic context analysis step2, - basic context analysis step3, - basic presentation forms to sf] - -\endinput diff --git a/tex/context/base/filt-ini.mkii b/tex/context/base/filt-ini.mkii new file mode 100644 index 000000000..6e1a16e9a --- /dev/null +++ b/tex/context/base/filt-ini.mkii @@ -0,0 +1,121 @@ +%D \module +%D [ file=filt-ini, +%D version=2000.09.19, +%D title=\CONTEXT\ Filter Macros, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Filter Macros / Initialization} + +% \ifx\OmegaVersion\undefined + +% \let\definefiltersynonym \gobbledoubleempty +% \let\definefiltersequence \gobbledoubleempty +% \unexpanded\def\usefiltersequence {\gobblesingleempty} +% \let\usefilter \gobblesingleempty +% \let\truefiltername \gobbleoneargument + +% \expandafter \endinput +% \fi + +\unprotect + +%D The real work starts here. + +% We need the {\??ot::#1} check because otherwise aleph will crash. Taco's +% torture test: +% +% \ocp\ArabicContext = contextual +% +% \dorecurse {5000} { +% \message{[\recurselevel]} +% \ocplist\Arabic=\addbeforeocplist 1 \ArabicContext \nullocplist +% } + +%D \macros +%D {definefiltersynonym} + +\def\definefiltersynonym + {\dodoubleargument\dodefinefiltersynonym} + +\def\dodefinefiltersynonym[#1][#2]% + {\setvalue{\??or#1}{#2}} + +%D \macros +%D {truefiltername} + +\def\truefiltername#1% + {\ifundefined{\??or#1}#1\else\truefiltername{\getvalue{\??or#1}}\fi} + +%D \macros +%D {definefiltersequence} + +\def\definefiltersequence + {\dodoubleargument\dodefinefiltersequence} + +% \def\dodefinefiltersequence[#1][#2]% +% {\setvalue{\??ot#1}{#2}} + +\def\dodefinefiltersequence[#1][#2]% + {\setxvalue{\??ot#1}{#2}% + \letgvalue{\??ot::#1}\v!stop} + +%D \macros +%D {usefiltersequence} +%D + +\def\magicocpnumber{1} + +% one can do: +% +% \definefiltersequence +% [farsi] +% [utf8 to unicode16=>5, +% persian fix, +% arabic analysis=>3, +% arabic glyphs] +% +% so, => is used to signal a priority + +\def\dodousefiltersequence#1% + {\expandafter\ocp\csname\??or:#1\endcsname=\truefiltername{#1}\relax + \splitstring#1\at=>\to\!!stringa\and\!!stringb + \edef\!!stringb{\number\ifx\!!stringb\empty\magicocpnumber\else\!!stringb\fi}% + \appendetoks + \noexpand\addbeforeocplist + \!!stringb\space + \expandafter\noexpand\csname\??or:\!!stringa\endcsname + \to \scratchtoks} + +\unexpanded\def\usefiltersequence[#1]% + {\doifdefined{\??ot::#1}% + {\doifvalue{\??ot::#1}\v!stop + {\scratchtoks\emptytoks + \expanded{\processcommalist[\getvalue{\??ot#1}]}\dodousefiltersequence + \expanded{\global\ocplist\csname\??ot:#1\endcsname=\the\scratchtoks}\nullocplist + \letgvalue{\??ot::#1}\v!start}% + \expanded{\pushocplist\csname\??ot:#1\endcsname}\relax}} + +%D \macros +%D {usefilter} + +\def\dousefilter#1% + {\doifundefined{\c!file\f!filterprefix#1}% + {\letvalue{\c!file\f!filterprefix#1}\empty + \makeshortfilename[\truefilename{\f!filterprefix#1}]% + \startreadingfile + \readsysfile{\shortfilename.mkii} + {\showmessage\m!filters1{#1}} + {\showmessage\m!filters2{#1}}% + \stopreadingfile}} + +\def\usefilter[#1]% + {\processcommalist[#1]\dousefilter} + +\protect \endinput diff --git a/tex/context/base/filt-ini.tex b/tex/context/base/filt-ini.tex deleted file mode 100644 index 49b32bdd8..000000000 --- a/tex/context/base/filt-ini.tex +++ /dev/null @@ -1,133 +0,0 @@ -%D \module -%D [ file=filt-ini, -%D version=2000.09.19, -%D title=\CONTEXT\ Filter Macros, -%D subtitle=Initialization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Filter Macros / Initialization} - -% \ifx\OmegaVersion\undefined - -% \let\definefiltersynonym \gobbledoubleempty -% \let\definefiltersequence \gobbledoubleempty -% \unexpanded\def\usefiltersequence {\gobblesingleempty} -% \let\usefilter \gobblesingleempty -% \let\truefiltername \gobbleoneargument - -% \expandafter \endinput -% \fi - -\unprotect - -%D The real work starts here. - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% We need the {\??ot::#1} check because otherwise aleph will crash. Taco's -% torture test: -% -% \ocp\ArabicContext = contextual -% -% \dorecurse {5000} { -% \message{[\recurselevel]} -% \ocplist\Arabic=\addbeforeocplist 1 \ArabicContext \nullocplist -% } - -%D \macros -%D {definefiltersynonym} - -\def\definefiltersynonym - {\dodoubleargument\dodefinefiltersynonym} - -\def\dodefinefiltersynonym[#1][#2]% - {\setvalue{\??or#1}{#2}} - -%D \macros -%D {truefiltername} - -\def\truefiltername#1% - {\ifundefined{\??or#1}#1\else\truefiltername{\getvalue{\??or#1}}\fi} - -%D \macros -%D {definefiltersequence} - -\def\definefiltersequence - {\dodoubleargument\dodefinefiltersequence} - -% \def\dodefinefiltersequence[#1][#2]% -% {\setvalue{\??ot#1}{#2}} - -\def\dodefinefiltersequence[#1][#2]% - {\setxvalue{\??ot#1}{#2}% - \letgvalue{\??ot::#1}\v!stop} - -%D \macros -%D {usefiltersequence} -%D - -\def\magicocpnumber{1} - -% one can do: -% -% \definefiltersequence -% [farsi] -% [utf8 to unicode16=>5, -% persian fix, -% arabic analysis=>3, -% arabic glyphs] -% -% so, => is used to signal a priority - -\def\dodousefiltersequence#1% - {\expandafter\ocp\csname\??or:#1\endcsname=\truefiltername{#1}\relax - \splitstring#1\at=>\to\!!stringa\and\!!stringb - \edef\!!stringb{\number\ifx\!!stringb\empty\magicocpnumber\else\!!stringb\fi}% - \appendetoks - \noexpand\addbeforeocplist - \!!stringb\space - \expandafter\noexpand\csname\??or:\!!stringa\endcsname - \to \scratchtoks} - -\unexpanded\def\usefiltersequence[#1]% - {\doifdefined{\??ot::#1}% - {\doifvalue{\??ot::#1}\v!stop - {\scratchtoks\emptytoks - \expanded{\processcommalist[\getvalue{\??ot#1}]}\dodousefiltersequence - \expanded{\global\ocplist\csname\??ot:#1\endcsname=\the\scratchtoks}\nullocplist - \letgvalue{\??ot::#1}\v!start}% - \expanded{\pushocplist\csname\??ot:#1\endcsname}\relax}} - -%D \macros -%D {usefilter} - -\def\dousefilter#1% - {\doifundefined{\c!file\f!filterprefix#1}% - {\letvalue{\c!file\f!filterprefix#1}\empty - \makeshortfilename[\truefilename{\f!filterprefix#1}]% - \startreadingfile - \readsysfile\shortfilename - {\showmessage\m!filters1{#1}} - {\showmessage\m!filters2{#1}}% - \stopreadingfile}} - -\def\usefilter[#1]% - {\processcommalist[#1]\dousefilter} - -\protect \endinput diff --git a/tex/context/base/font-arb.mkii b/tex/context/base/font-arb.mkii new file mode 100644 index 000000000..3ec0395f3 --- /dev/null +++ b/tex/context/base/font-arb.mkii @@ -0,0 +1,5 @@ +\unprotected \writestatus\m!systems{load ARABTEX as a module instead} + +\usemodule[arabtex] + +\endinput diff --git a/tex/context/base/font-arb.tex b/tex/context/base/font-arb.tex deleted file mode 100644 index 3ec0395f3..000000000 --- a/tex/context/base/font-arb.tex +++ /dev/null @@ -1,5 +0,0 @@ -\unprotected \writestatus\m!systems{load ARABTEX as a module instead} - -\usemodule[arabtex] - -\endinput diff --git a/tex/context/base/font-bfm.mkii b/tex/context/base/font-bfm.mkii new file mode 100644 index 000000000..23e3176c4 --- /dev/null +++ b/tex/context/base/font-bfm.mkii @@ -0,0 +1,196 @@ +%D \module +%D [ file=font-bfm, +%D version=2003.11.25, +%D title=\CONTEXT\ Font Macros, +%D subtitle=Mixed Normal and Bold Math, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Font Macros / Mixed Bold Math Support} + +%D The following example demonstrates how to use normal, bold, and mixed +%D normal|/|bold math. Since not everyone has the Lucida on his|/|her +%D machine we don't show the result. +%D +%D \starttyping +%D \setupformulas +%D [method=bold] +%D +%D \definetypeface [mainface] [rm] [serif] [lucida] [default] [encoding=texnansi] +%D \definetypeface [mainface] [tt] [mono] [lucida] [default] [encoding=texnansi] +%D \definetypeface [mainface] [ss] [sans] [lucida] [default] [encoding=texnansi] +%D \definetypeface [mainface] [mm] [math] [lucida] [default] [encoding=texnansi] +%D \definetypeface [mainface] [mm] [bfmath] [lucida] [default] [encoding=texnansi] +%D +%D \definetypeface [boldmath] [rm] [serif] [lucida] [default] [encoding=texnansi] +%D \definetypeface [boldmath] [tt] [mono] [lucida] [default] [encoding=texnansi] +%D \definetypeface [boldmath] [ss] [sans] [lucida] [default] [encoding=texnansi] +%D \definetypeface [boldmath] [mm] [boldmath] [lucida] [default] [encoding=texnansi] +%D +%D \switchtobodyfont[mainface] +%D +%D \startlines +%D $\mainface x=10 \Gamma \Delta \alpha \delta \zeta$ +%D $\boldmath x=10 \Gamma \Delta \alpha \delta \zeta$ +%D \stoplines +%D +%D \startformula +%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta +%D \stopformula +%D +%D \startformula[mainface] +%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta +%D \stopformula +%D +%D \startformula[boldmath] +%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta +%D \stopformula +%D +%D \startformula[boldmath,8pt] +%D x=8=\fontbody \Gamma \Delta \alpha \delta \zeta +%D \stopformula +%D +%D \startformula[boldmath,12pt,small] +%D x=12s=\fontbody \Gamma \Delta \alpha \delta \zeta +%D \stopformula +%D +%D \startformula[boldmath,small] +%D x=s=\fontbody \Gamma \Delta \alpha \delta \zeta +%D \stopformula +%D +%D \startformula[boldmath,10pt] +%D x=10=\fontbody \Gamma \Delta \alpha \delta \zeta +%D \stopformula +%D +%D \startformula[boldmath,11pt,small] +%D x=11s=\fontbody \Gamma \Delta \alpha \delta \zeta +%D \stopformula +%D +%D \startformula[boldmath,9pt] +%D x=9=\fontbody \Gamma \Delta \alpha \delta \zeta +%D \stopformula +%D +%D \startlines +%D \formula{1=2x} +%D \formula[boldmath]{1=2x} +%D \formula[mainface]{1=2x} +%D \formula[mainface]{1 \theta \Gamma = \bfm 1 \beta \hbox{\sl test}\Gamma \alpha ' x x} +%D \formula[mainface]{1 \theta \Gamma = {\bfm 1 \beta \hbox{\sl test}\Gamma \alpha ' x} x} +%D \stoplines +%D \stoptyping + +\unprotect + +%D \TEX\ has some hard wired expectations about where to look for +%D certain characters. This means that we cannot overload the families +%D 0 upto~3. Also, since we use C upto~F for math as well, we are left +%D with the range 4 upto~B. + +\chardef\mrbffam\itfam \edef\c!mrbf{\c!mr\c!bf} \let\hexmrbffam\hexitfam % 4 it +\chardef\exbffam\slfam \edef\c!exbf{\c!ex\c!bf} \let\hexexbffam\hexslfam % 5 sl +\chardef\mibffam\bffam \edef\c!mibf{\c!mi\c!bf} \let\hexmibffam\hexbffam % 6 bf +\chardef\sybffam\nnfam \edef\c!sybf{\c!sy\c!bf} \let\hexsybffam\hexnnfam % 7 nn +\chardef\mabffam\bsfam \edef\c!mabf{\c!ma\c!bf} \let\hexmabffam\hexbsfam % 8 bs +\chardef\mbbffam\bifam \edef\c!mbbf{\c!mb\c!bf} \let\hexmbbffam\hexbifam % 9 bi +\chardef\mcbffam\scfam \edef\c!mcbf{\c!mc\c!bf} \let\hexmcbffam\hexscfam % A sc +\chardef\mdbffam\scfam \edef\c!mdbf{\c!mc\c!bf} \let\hexmdbffam\hexscfam % B tf % tricky + +%D The next bunch of code looks horrible and tricky but one has to keep in +%D mind that because \TEX\ makes several passes over the math list we need to +%D make sure that grouping is handled well. Later assignments to a family +%D overload previous ones, the last one counts. + +\newtoks \boldmathstrategies +\newtoks \boldsymbstrategies + +\appendtoks + \dosetmathfamily\mrbffam\textface\scriptface\scriptscriptface\c!mrbf\mrfallback + \dosetmathfamily\mibffam\textface\scriptface\scriptscriptface\c!mibf\empty + \dosetmathfamily\sybffam\textface\scriptface\scriptscriptface\c!sybf\empty + \dosetmathfamily\exbffam\textface\textface \textface \c!exbf\empty + \dosetmathfamily\mabffam\textface\scriptface\scriptscriptface\c!mabf\empty + \dosetmathfamily\mbbffam\textface\scriptface\scriptscriptface\c!mbbf\empty + \dosetmathfamily\mcbffam\textface\scriptface\scriptscriptface\c!mcbf\empty +\to \boldmathstrategies + +\appendtoks + \dosetskewchar\mifam\defaultskewcharmi + \dosetskewchar\syfam\defaultskewcharsy +\to \boldmathstrategies + +\appendtoks + \dosetsymbfamily\mrbffam\textface\scriptface\scriptscriptface\c!mrbf + \dosetsymbfamily\mibffam\textface\scriptface\scriptscriptface\c!mibf + \dosetsymbfamily\sybffam\textface\scriptface\scriptscriptface\c!sybf + \dosetsymbfamily\exbffam\textface\textface \textface \c!exbf + \dosetsymbfamily\mabffam\textface\scriptface\scriptscriptface\c!mabf + \dosetsymbfamily\mbbffam\textface\scriptface\scriptscriptface\c!mbbf + \dosetsymbfamily\mcbffam\textface\scriptface\scriptscriptface\c!mcbf +\to \boldsymbstrategies + +%D Here comes the real mess (due to semi||global settings en multiple +%D passes over the math list once the input is expanded. + +\newevery \everyboldfacemath \relax +\chardef \boldfacemathmethod \zerocount + +\appendtoks + \ifcase\boldfacemathmethod \else \the\boldmathstrategies \fi +\to \mathstrategies + +\appendtoks + \ifcase\boldfacemathmethod \else \the\boldsymbstrategies \fi +\to \symbstrategies + +\appendtoks + \let\mrfam\mrbffam \let\c!mr\c!mrbf \let\hexmrfam\hexmrbffam + \let\mifam\mibffam \let\c!mi\c!mibf \let\hexmifam\hexmibffam + \let\syfam\sybffam \let\c!sy\c!sybf \let\hexsyfam\hexsybffam + \let\exfam\exbffam \let\c!ex\c!exbf \let\hexexfam\hexexbffam + \let\mafam\mabffam \let\c!ma\c!mabf \let\hexmafam\hexmabffam + \let\mbfam\mbbffam \let\c!mb\c!mbbf \let\hexmbfam\hexmbbffam + \let\mcfam\mcbffam \let\c!mc\c!mcbf \let\hexmcfam\hexmcbffam +\to \everyboldfacemath + +\appendtoks + \let\mathsubfamily\c!bf +\to \everyboldfacemath + +\appendtoks + \synchronizemath \aftergroup\synchronizemath +\to \everyboldfacemath + +%D \macros +%D {boldfacemath, bfm, autoboldfacemath} +%D +%D These are the user commands, with \type {\bfm} being the most comfortable. + +\def\boldfacemath {\ifcase\boldfacemathmethod\else\the\everyboldfacemath\fi} +\def\bfm {\boldfacemath} % no \let, so that we can redefine +\def\autoboldfacemath{\appendtoks\ifcase\boldfacemathmethod\else\let\bf\boldfacemath\fi\to\everymathematics} + +%D We hook this feature into the formula mechanism. + +\setupformulas + [\c!method=\v!normal] + +\appendtoks + \doifelse{\formulaparameter\c!method}\v!bold + {\chardef\boldfacemathmethod\plusone} + {\chardef\boldfacemathmethod\zerocount}% +\to \everysetupformulas + +%D Of course this only works when bfmath fonts are set up (see example at +%D the top of this file) and bold math is enabled: +%D +%D \starttyping +%D \setupformulas +%D [method=bold] +%D \stoptyping + +\protect \endinput diff --git a/tex/context/base/font-bfm.tex b/tex/context/base/font-bfm.tex deleted file mode 100644 index 23e3176c4..000000000 --- a/tex/context/base/font-bfm.tex +++ /dev/null @@ -1,196 +0,0 @@ -%D \module -%D [ file=font-bfm, -%D version=2003.11.25, -%D title=\CONTEXT\ Font Macros, -%D subtitle=Mixed Normal and Bold Math, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Font Macros / Mixed Bold Math Support} - -%D The following example demonstrates how to use normal, bold, and mixed -%D normal|/|bold math. Since not everyone has the Lucida on his|/|her -%D machine we don't show the result. -%D -%D \starttyping -%D \setupformulas -%D [method=bold] -%D -%D \definetypeface [mainface] [rm] [serif] [lucida] [default] [encoding=texnansi] -%D \definetypeface [mainface] [tt] [mono] [lucida] [default] [encoding=texnansi] -%D \definetypeface [mainface] [ss] [sans] [lucida] [default] [encoding=texnansi] -%D \definetypeface [mainface] [mm] [math] [lucida] [default] [encoding=texnansi] -%D \definetypeface [mainface] [mm] [bfmath] [lucida] [default] [encoding=texnansi] -%D -%D \definetypeface [boldmath] [rm] [serif] [lucida] [default] [encoding=texnansi] -%D \definetypeface [boldmath] [tt] [mono] [lucida] [default] [encoding=texnansi] -%D \definetypeface [boldmath] [ss] [sans] [lucida] [default] [encoding=texnansi] -%D \definetypeface [boldmath] [mm] [boldmath] [lucida] [default] [encoding=texnansi] -%D -%D \switchtobodyfont[mainface] -%D -%D \startlines -%D $\mainface x=10 \Gamma \Delta \alpha \delta \zeta$ -%D $\boldmath x=10 \Gamma \Delta \alpha \delta \zeta$ -%D \stoplines -%D -%D \startformula -%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta -%D \stopformula -%D -%D \startformula[mainface] -%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta -%D \stopformula -%D -%D \startformula[boldmath] -%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta -%D \stopformula -%D -%D \startformula[boldmath,8pt] -%D x=8=\fontbody \Gamma \Delta \alpha \delta \zeta -%D \stopformula -%D -%D \startformula[boldmath,12pt,small] -%D x=12s=\fontbody \Gamma \Delta \alpha \delta \zeta -%D \stopformula -%D -%D \startformula[boldmath,small] -%D x=s=\fontbody \Gamma \Delta \alpha \delta \zeta -%D \stopformula -%D -%D \startformula[boldmath,10pt] -%D x=10=\fontbody \Gamma \Delta \alpha \delta \zeta -%D \stopformula -%D -%D \startformula[boldmath,11pt,small] -%D x=11s=\fontbody \Gamma \Delta \alpha \delta \zeta -%D \stopformula -%D -%D \startformula[boldmath,9pt] -%D x=9=\fontbody \Gamma \Delta \alpha \delta \zeta -%D \stopformula -%D -%D \startlines -%D \formula{1=2x} -%D \formula[boldmath]{1=2x} -%D \formula[mainface]{1=2x} -%D \formula[mainface]{1 \theta \Gamma = \bfm 1 \beta \hbox{\sl test}\Gamma \alpha ' x x} -%D \formula[mainface]{1 \theta \Gamma = {\bfm 1 \beta \hbox{\sl test}\Gamma \alpha ' x} x} -%D \stoplines -%D \stoptyping - -\unprotect - -%D \TEX\ has some hard wired expectations about where to look for -%D certain characters. This means that we cannot overload the families -%D 0 upto~3. Also, since we use C upto~F for math as well, we are left -%D with the range 4 upto~B. - -\chardef\mrbffam\itfam \edef\c!mrbf{\c!mr\c!bf} \let\hexmrbffam\hexitfam % 4 it -\chardef\exbffam\slfam \edef\c!exbf{\c!ex\c!bf} \let\hexexbffam\hexslfam % 5 sl -\chardef\mibffam\bffam \edef\c!mibf{\c!mi\c!bf} \let\hexmibffam\hexbffam % 6 bf -\chardef\sybffam\nnfam \edef\c!sybf{\c!sy\c!bf} \let\hexsybffam\hexnnfam % 7 nn -\chardef\mabffam\bsfam \edef\c!mabf{\c!ma\c!bf} \let\hexmabffam\hexbsfam % 8 bs -\chardef\mbbffam\bifam \edef\c!mbbf{\c!mb\c!bf} \let\hexmbbffam\hexbifam % 9 bi -\chardef\mcbffam\scfam \edef\c!mcbf{\c!mc\c!bf} \let\hexmcbffam\hexscfam % A sc -\chardef\mdbffam\scfam \edef\c!mdbf{\c!mc\c!bf} \let\hexmdbffam\hexscfam % B tf % tricky - -%D The next bunch of code looks horrible and tricky but one has to keep in -%D mind that because \TEX\ makes several passes over the math list we need to -%D make sure that grouping is handled well. Later assignments to a family -%D overload previous ones, the last one counts. - -\newtoks \boldmathstrategies -\newtoks \boldsymbstrategies - -\appendtoks - \dosetmathfamily\mrbffam\textface\scriptface\scriptscriptface\c!mrbf\mrfallback - \dosetmathfamily\mibffam\textface\scriptface\scriptscriptface\c!mibf\empty - \dosetmathfamily\sybffam\textface\scriptface\scriptscriptface\c!sybf\empty - \dosetmathfamily\exbffam\textface\textface \textface \c!exbf\empty - \dosetmathfamily\mabffam\textface\scriptface\scriptscriptface\c!mabf\empty - \dosetmathfamily\mbbffam\textface\scriptface\scriptscriptface\c!mbbf\empty - \dosetmathfamily\mcbffam\textface\scriptface\scriptscriptface\c!mcbf\empty -\to \boldmathstrategies - -\appendtoks - \dosetskewchar\mifam\defaultskewcharmi - \dosetskewchar\syfam\defaultskewcharsy -\to \boldmathstrategies - -\appendtoks - \dosetsymbfamily\mrbffam\textface\scriptface\scriptscriptface\c!mrbf - \dosetsymbfamily\mibffam\textface\scriptface\scriptscriptface\c!mibf - \dosetsymbfamily\sybffam\textface\scriptface\scriptscriptface\c!sybf - \dosetsymbfamily\exbffam\textface\textface \textface \c!exbf - \dosetsymbfamily\mabffam\textface\scriptface\scriptscriptface\c!mabf - \dosetsymbfamily\mbbffam\textface\scriptface\scriptscriptface\c!mbbf - \dosetsymbfamily\mcbffam\textface\scriptface\scriptscriptface\c!mcbf -\to \boldsymbstrategies - -%D Here comes the real mess (due to semi||global settings en multiple -%D passes over the math list once the input is expanded. - -\newevery \everyboldfacemath \relax -\chardef \boldfacemathmethod \zerocount - -\appendtoks - \ifcase\boldfacemathmethod \else \the\boldmathstrategies \fi -\to \mathstrategies - -\appendtoks - \ifcase\boldfacemathmethod \else \the\boldsymbstrategies \fi -\to \symbstrategies - -\appendtoks - \let\mrfam\mrbffam \let\c!mr\c!mrbf \let\hexmrfam\hexmrbffam - \let\mifam\mibffam \let\c!mi\c!mibf \let\hexmifam\hexmibffam - \let\syfam\sybffam \let\c!sy\c!sybf \let\hexsyfam\hexsybffam - \let\exfam\exbffam \let\c!ex\c!exbf \let\hexexfam\hexexbffam - \let\mafam\mabffam \let\c!ma\c!mabf \let\hexmafam\hexmabffam - \let\mbfam\mbbffam \let\c!mb\c!mbbf \let\hexmbfam\hexmbbffam - \let\mcfam\mcbffam \let\c!mc\c!mcbf \let\hexmcfam\hexmcbffam -\to \everyboldfacemath - -\appendtoks - \let\mathsubfamily\c!bf -\to \everyboldfacemath - -\appendtoks - \synchronizemath \aftergroup\synchronizemath -\to \everyboldfacemath - -%D \macros -%D {boldfacemath, bfm, autoboldfacemath} -%D -%D These are the user commands, with \type {\bfm} being the most comfortable. - -\def\boldfacemath {\ifcase\boldfacemathmethod\else\the\everyboldfacemath\fi} -\def\bfm {\boldfacemath} % no \let, so that we can redefine -\def\autoboldfacemath{\appendtoks\ifcase\boldfacemathmethod\else\let\bf\boldfacemath\fi\to\everymathematics} - -%D We hook this feature into the formula mechanism. - -\setupformulas - [\c!method=\v!normal] - -\appendtoks - \doifelse{\formulaparameter\c!method}\v!bold - {\chardef\boldfacemathmethod\plusone} - {\chardef\boldfacemathmethod\zerocount}% -\to \everysetupformulas - -%D Of course this only works when bfmath fonts are set up (see example at -%D the top of this file) and bold math is enabled: -%D -%D \starttyping -%D \setupformulas -%D [method=bold] -%D \stoptyping - -\protect \endinput diff --git a/tex/context/base/font-chi.mkii b/tex/context/base/font-chi.mkii new file mode 100644 index 000000000..0acf710d5 --- /dev/null +++ b/tex/context/base/font-chi.mkii @@ -0,0 +1,1156 @@ +%D \module +%D [ file=font-chi, +%D version=1999.10.10, +%D title=\CONTEXT\ Font Macros, +%D subtitle=Chinese, +%D author=Hans Hagen, +%D date=\currentdate, +%D suggestions=Wang Lei, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifx\handlechineseunicodeglyph\undefined \else \endinput \fi + +% NOT YET ADAPTED TO THE NEW FONT MACROS + +%D The first implementation (most of which is here) is based on +%D the specific font layout. This is because not all glyphs are +%D available in uniciode, which means that we cannot use +%D unicode codepoints (yet); if it were possible we could use +%D just one table per input encoding. + +\writestatus{loading}{ConTeXt Font Macros / Chinese} + +% much will to typo-chi.tex + +%D Still to be implemented: +%D +%D \startitemize +%D \item columns left right touch +%D \item distance = (hsize-n*bodyfontsize)/(n-1) +%D \item char grids +%D \item char tables +%D \item all kind of rotated combinations +%D \item hanging puctuation +%D \item a few more encodings +%D \item rotation list +%D \stopitemize + +%M \setupbodyfont[chi] +%M +%M \def\WangLei{\purechinese{\uchar{205}{245}\uchar{192}{218}}} + +\useencoding[chi] + +%D When \WangLei\ sent me a mail asking if \CONTEXT\ was able +%D to support Chinese, I wasn't sure if the answer could be +%D yes. I knew that those languages, rich of glyphs, were +%D typeset by \TEX, so in principle it should be possible. I +%D asked or some more input and was told that there were +%D \LATEX\ styles regarding those languages. When I unzipped +%D the accompanying files, it became clear that I had to +%D implement support for Chinese from scratch. There was a +%D multitude of font, with rather unfamiliar encodings, a +%D large collection of files with |<|at least for me|>| +%D unknown purposes, and worse, the documentation was mainly +%D in Chinese. +%D +%D So, \WangLei\ and I started exchanging some emails and it +%D soon became clear that supporting Chinese was not that +%D complicated at all. It mostly came to dealing with handling +%D \UNICODE\ fonts. It also became clear that everything +%D Chinese took place in the upper region of the eight bit +%D character set. I wrote some macros that could process the +%D small \type {Hello World} file \WangLei\ had send me, and +%D after some bug fixes real Chinese came out. I started to +%D like the look and fel of Chinese glyphs, so on we went. +%D +%D The first comments concerned spacing. The mix of English +%D and Chinese demands some rather deliberate handling of +%D spacing. Breaking lines was not so much a problem, and +%D could be solved by adding some glue between Chinese glyphs. +%D +%D In the meantime had asked \WangLei\ for some language bound +%D labels and texts, and implementing these was rather +%D straightforward. But, there were still some issues to deal +%D with: conversion of numbers, date handling and index +%D sorting. +%D +%D I consider(ed) writing Chinese support to be a nice puzzle, +%D since I have to act on chinese \CONTEXT\ code, where I only +%D understand the \CONTEXT\ part. The drawings \WangLei\ made +%D me (in drawing packages) were of great help. Since I write +%D these modules from scratch, although I fall back on some +%D basic encoding and font modules, I consider them to be +%D rather clean. This cannot be said of all \CONTEXT\ font +%D modules \type {-)}. + +\unprotect + +%D Because Chinese glyphs have more height than the average +%D Latin glyph, and at the same time don't have much depth, +%D we adapt the scale. +%D +%D Before and after the glyph we have to deal with Chinese +%D spacing. Special attention is given to punctuation. +%D +%D \starttyping +%D [some short nice chinese text with () and english] +%D \stoptyping +%D +%D We insert a bit of stretch and introduce a signal to +%D keep track of previous characters. We use a similar +%D method in the units module, which may be a nice +%D introduction to using signals. + +%D \macros +%D {chineseunicodescale, chineseinterglyphskip, +%D chineseunicodeheight, chineseunicodedepth, chinesespace} +%D +%D There are a few variables, that can be (re|)|set +%D depending on the current font. They default to: + +% hm, why don't we use the normal unicodestrut mechanism? + +\def\chineseunicodescale {1.00} % not smaller than .85 +\def\chineseunicodeheight {1.00} +\def\chineseunicodedepth {1.00} +\def\chineseinterglyphskip{0pt \!!plus .05em \!!minus .01em} +\def\chinesesurroundskip {.25em \!!plus .15em \!!minus .05em} + +%D We define a few signals. As said, another example of +%D using signals can be found in the module \type {m-units}. + +\newsignal\chineseLsignal % left boundary character +\newsignal\chineseRsignal % right boundary character +\newsignal\chineseSsignal % any other character (symbol) + +\chardef\chineseBstatus=0 % 0=unknown 1=left 2=right 3=chinese 4=nospace +\chardef\chineseAstatus=0 % 0=unknown 1=left 2=right 3=space +\chardef\chineseSstatus=0 % 0=unknown 1=left 2=right + +\sfcode`(=2000 % a temporary hack + +\def\chinesenobreak + {\relax + \iftracechinese + \nobreak + \kern-.5pt\color[red]{\vrule\!!width1pt}\kern-.5pt + \nobreak + \else + \nobreak + \fi} + +\newif\ifcorrectchineseboundarychars + +\def\chineseunskip + {\unskip\unskip\unskip\unskip} + +\def\insertchineseglyph + {\iftracechinese\tracedchineseglyph\else\insertunicodeglyph\fi} + +\newif\ifverticalchinese + +\def\handlechineseunicodeglyph + {\ifinpagebody + \horizontalchineseunicodeglyph + \else\ifverticalchinese + \verticalchineseunicodeglyph + \else + \horizontalchineseunicodeglyph + \fi\fi} + +% chinese classes: left=1|right=2|center=3 + +\chardef\plusfour=4 + +\def\analyzechineseunicodeglyph % beware, no zerocount ! + {\chardef\chineseSstatus0\getvalue{uc\number\unicodeposition}\relax} + +\def\analyzechineseunicodeenviroment + {% left + \ifx (\nextutoken \chardef\chineseAstatus\plusone \else + \ifx [\nextutoken \chardef\chineseAstatus\plusone \else + % right + \ifx ,\nextutoken \chardef\chineseAstatus\plustwo \else + \ifx .\nextutoken \chardef\chineseAstatus\plustwo \else + \ifx ?\nextutoken \chardef\chineseAstatus\plustwo \else + \ifx ;\nextutoken \chardef\chineseAstatus\plustwo \else + \ifx :\nextutoken \chardef\chineseAstatus\plustwo \else + \ifx !\nextutoken \chardef\chineseAstatus\plustwo \else + \ifx )\nextutoken \chardef\chineseAstatus\plustwo \else + \ifx ]\nextutoken \chardef\chineseAstatus\plustwo \else + % space + \ifx\nextutoken\blankspace \chardef\chineseAstatus\plusthree \else + \ifx\nextutoken\space \chardef\chineseAstatus\plusthree \else + \chardef\chineseAstatus\zerocount + % unknown + \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi + % maybe save the last skip? + \chardef\chineseBstatus\ifdim\lastskip=\zeropoint\plusfour\else\zerocount\fi + \ifdim\lastskip=\chineseLsignal \chardef\chineseBstatus\plusone \else + \ifdim\lastskip=\chineseRsignal \chardef\chineseBstatus\plustwo \else + \ifdim\lastskip=\chineseSsignal \chardef\chineseBstatus\plusthree \else + \scratchskip=\lastskip \unskip + \ifdim\lastskip=\chineseLsignal \chardef\chineseBstatus\plusone \else + \ifdim\lastskip=\chineseRsignal \chardef\chineseBstatus\plustwo \else + \ifdim\lastskip=\chineseSsignal \chardef\chineseBstatus\plusthree \else + \space\scratchskip=\lastskip \unskip + \setbox\scratchbox=\hbox\bgroup + (\space + \ifdim\lastskip=\scratchskip + \egroup \chardef\chineseBstatus\plusone + \else + \egroup + \ifdim\scratchskip=\zeropoint \chardef\chineseBstatus\plusfour \fi + \fi + \fi\fi\fi + \fi\fi\fi} + +\def\horizontalchineseunicodeglyph + {\relax + \ifhmode\else\dontleavehmode\fi % added + \setunicodescale\chineseunicodescale % redundant + \setunicodestrut\chineseunicodeheight\chineseunicodedepth % redundant + \ifprocessingverbatim + \iftracechinese + \ruledhbox{\insertunicodeglyph}% + \else + \insertunicodeglyph + \fi + \else\ifx\nextutoken\relax + \insertunicodeglyph + \else + \analyzechineseunicodeglyph + \analyzechineseunicodeenviroment + \ifcase\chineseSstatus\relax + \ifcase\chineseBstatus\relax + \chineseunskip + \hskip\chinesesurroundskip % unknown + \or + \chineseunskip + \chinesenobreak % left + \or + \ifcorrectchineseboundarychars\else\chineseunskip\fi + \hskip\chineseinterglyphskip % right + \or + \chineseunskip + \hskip\chineseinterglyphskip % chinese + \or + % whatever + \fi + \insertchineseglyph + \ifcase\chineseAstatus\relax + \hskip\chineseinterglyphskip % unknown + \hskip\chinesesurroundskip + \ifcase\chineseSstatus + \hskip\chineseSsignal + \or + \hskip\chineseLsignal + \else + \hskip\chineseRsignal + \fi + \or + \hskip\chineseinterglyphskip % left + \chinesenobreak + \hskip\chineseLsignal + \or + \chinesenobreak % right + \hskip\chineseinterglyphskip + \chinesenobreak + \hskip\chineseRsignal + \or + \hskip\chineseinterglyphskip % space + \hskip\chinesesurroundskip + \hskip\chineseSsignal + \fi + \or % left + \ifcorrectchineseboundarychars + \let\unicodecharcommand\chineseleftcharcommand + \fi + \chineseunskip + \insertchineseglyph + \chinesenobreak + \hskip\chineseLsignal + \or % right + \ifcorrectchineseboundarychars + \let\unicodecharcommand\chineserightcharcommand + \fi + \chineseunskip + \chinesenobreak + \insertchineseglyph + \hskip\chineseRsignal + \else % center + \chineseunskip + \chinesenobreak + \insertchineseglyph + \hskip\chineseinterglyphskip + \hskip\chineseRsignal + \fi\fi + \aftergroup\ignorespaces % watch this + \fi} + +\def\verticalchineseunicodeglyph + {\relax + \ifprocessingverbatim % to do + \horizontalchineseunicodeglyph + \else + \setunicodescale\chineseunicodescale % redundant + \setunicodestrut\chineseunicodeheight\chineseunicodedepth % redundant + \ifx\nextutoken\relax + \insertchineseglyph + \ifvmode % catches \hbox{...}, actually \hbox should be \vbox -) + \nointerlineskip + \fi + \allowbreak + \else + \analyzechineseunicodeglyph + \setbox\scratchbox\hbox to \hsize + {\hss + \ifcase\chineseSstatus\relax + \insertchineseglyph + \else % left / right + \setbox\scratchbox\hbox{\insertchineseglyph}% + \rotate[\c!rotation=270]{\box\scratchbox}% + \fi + \hss}% + \ht\scratchbox\unicodeheight\strutht + \dp\scratchbox\unicodedepth \strutdp + \ifvmode % catches \hbox{...}, actually \hbox should be \vbox -) + \nointerlineskip + \fi + \ifcase\prevchineseSstatus\relax + \ifnum\chineseSstatus=\plustwo \par\nobreak\else\allowbreak\fi + \or % left + \par\nobreak + \or % right + \ifnum\chineseSstatus=\plustwo \par\nobreak\else\allowbreak\fi + \fi + \global\chardef\prevchineseSstatus\chineseSstatus % pagebody ... + \box\scratchbox\par + \fi + \aftergroup\ignorespaces % watch this + \fi} + +%D \macros +%D {setupchinese,startvertical,nochinese} +%D +%D The previous macros implement horizontal as well as +%D vertical typesetting. Vertical typesetting is implemented +%D on top of the multi||column routines. + +\def\setupchinese + {\dodoubleargument\getparameters[\??vt]} + +\def\startvertical + {\dosingleempty\dostartvertical} + +\def\dostartvertical[#1]% + {\bgroup + \def\maxnofcolumns{25}% + \verticalchinesetrue + \global\chardef\prevchineseSstatus\zerocount + \let\nochinese\nochineseinvertical + \doif\@@vtn\v!fit + {\dimen0=\textwidth \advance\dimen0 \@@vtdistance + \dimen2=\bodyfontsize \advance\dimen2 \@@vtdistance + \divide\dimen0 \number\dimen2 + \edef\@@vtn{\number\dimen0}}% + \startcolumns + [\c!direction=\@@vtdirection, + \c!balance=\@@vtbalance, + \c!distance=\@@vtdistance, + \c!n=\@@vtn, + #1]} + +\def\stopvertical + {\stopcolumns + \egroup} + +\setupchinese + [\c!direction=\v!left, + \c!balance=\v!no, + \c!n=\v!fit, + \c!distance=1.5\bodyfontsize] + +%D We can set up vertical typesetting with \type +%D {\setupchinese}. + +%D \macros +%D {nochineseinvertical} +%D +%D English (non chinese) text is typeset rotated: + +\def\nochineseinvertical#1% + {\par + \setbox\scratchbox\hbox{\strut#1} + \getnoflines{\wd\scratchbox} + \setbox\scratchbox\hbox to \noflines\openlineheight + {\hss\box\scratchbox\hss} + \hbox to \hsize + {\hss + \rotate + [\c!rotation=270] + {\vbox to \ht\scratchbox{\vss\box\scratchbox\vss}}% + \hss} + \par} + +%D \macros +%D {correctchineseboundarychars} +%D +%D Careful reading of the previous macro learns that we +%D treat left and right glyphs differently. When we say +%D +%D \starttyping +%D \correctchineseboundarycharstrue +%D \stoptyping +%D +%D For the moment correction in on by default. + +\correctchineseboundarycharstrue + +\def\chineserightcharcommand#1% + {\iftracechinese\ruledhbox\else\hbox\fi \!!to .5em{#1\hss}% + \hskip.25em\!!plus .25em\relax}% + +\def\chineseleftcharcommand#1% + {\ifnum\chineseBstatus<4 \hskip.25em \!!plus .25em\relax\fi + \iftracechinese\ruledhbox\else\hbox\fi \!!to .5em{\hss#1}}% + +% \def\chineserightcharcommand#1% +% {\setbox\scratchbox=\hbox{#1}% +% \scratchdimen=.5em +% \ifdim\wd\scratchbox>\scratchdimen +% \iftracechinese\ruledhbox\else\hbox\fi \!!to \scratchdimen +% {\box\scratchbox\hss}% +% \hskip.5\scratchdimen\!!plus.5\scratchdimen\relax +% \else +% \box\scratchbox +% \fi} + +% \def\chineseleftcharcommand#1% +% {\setbox\scratchbox=\hbox{#1}% +% \scratchdimen=.5em +% \ifdim\wd\scratchbox>\scratchdimen +% \ifnum\chineseBstatus<4 +% \hskip.5\scratchdimen\!!plus.5\scratchdimen\relax +% \fi +% \iftracechinese\ruledhbox\else\hbox\fi \!!to \scratchdimen +% {\hss\box\scratchbox}% +% \else +% \box\scratchbox +% \fi} + +%D The long list of numbers in the previous macro identify the +%D characters where special care is needed for breaking lines. +%D A linebreak is not permitted before: +%D +%D \def\DoIt #1 #2 % +%D {\hbox{\hbox to 2em{\uchar{#1}{#2}\hss}#1 #2}\par} +%D +%D \startcolumns[n=5] +%D \DoIt 161 162 \DoIt 161 163 \DoIt 161 164 \DoIt 161 167 \DoIt 161 173 +%D \DoIt 161 175 \DoIt 161 177 \DoIt 161 179 \DoIt 161 181 \DoIt 161 183 +%D \DoIt 161 185 \DoIt 161 187 \DoIt 161 189 \DoIt 161 191 \DoIt 161 227 +%D \DoIt 161 228 \DoIt 161 229 \DoIt 163 161 \DoIt 163 162 \DoIt 163 167 +%D \DoIt 163 169 \DoIt 163 172 \DoIt 163 174 \DoIt 163 186 \DoIt 163 187 +%D \DoIt 163 190 \DoIt 163 191 \DoIt 163 221 \DoIt 163 253 +%D \stopcolumns +%D +%D A linebreak is not permitted after the following glyphs: +%D +%D \startcolumns[n=5] +%D \DoIt 161 174 \DoIt 161 176 \DoIt 161 178 \DoIt 161 180 \DoIt 161 182 +%D \DoIt 161 184 \DoIt 161 186 \DoIt 161 188 \DoIt 161 190 \DoIt 163 168 +%D \DoIt 163 219 \DoIt 163 224 \DoIt 163 251 +%D \stopcolumns + +%D \macros +%D {tracechinesetrue, showchinesetracelegend} +%D +%D When we say \type {\tracechinesetrue}, we get some +%D insight in the way \CONTEXT\ handles the Chinese glyphs. +%D The symbols and color used represent: +%D +%D \showchinesetracelegend + +\newif\iftracechinese + +\def\showchinesetracelegend + {\definetabulate[\s!dummy][|c|l|l|l|]% + \startdummy + \HL + \NC \bf key \NC \bf meaning \NC \bf glyph \NC \bf keys \NC\NR + \HL + \NC u \NC unknown character type \NC \color[green]{current} \NC u l r \NC\NR + \NC l \NC left boundary character \NC \color[red]{previous} \NC u l r c n \NC\NR + \NC r \NC right boundary character \NC \color[blue]{next} \NC u l r s \NC\NR + \NC c \NC chinese character \NC \NC \NC\NR + \NC s \NC following space \NC \NC \NC\NR + \NC n \NC no preceding space \NC \NC \NC\NR + \HL + \stopdummy} + +\def\tracedchineseglyph + {\dontleavehmode + \ruledhbox + {\setbox\scratchbox\hbox{\insertunicodeglyph}% + \hbox to \wd\scratchbox + {\localcolortrue + \copy\scratchbox + \infofont + \hskip-\wd\scratchbox + \hbox to \wd\scratchbox + {\hss + \color[green]{\ifcase\chineseSstatus\relax u\or l\or r\fi}% + \hss}% + \hskip-\wd\scratchbox + \lower\dp\scratchbox\hbox to \wd\scratchbox + {\hss + \color[red]{\ifcase\chineseBstatus\relax u\or l\or r\or c\or n\fi}% + \hss + \color[blue]{\ifcase\chineseAstatus\relax u\or l\or r\or s\fi}% + \hss}}}} + +%D The following example shows how tracing works. +%D +%D \start \tracechinesetrue +%D һθǽܶĵ֧֡ĵ +%D ѯ \nochinese{\CONTEXT} ǷܴʱѾԹ +%D еĺ꼯ûеõζŶĵֻ֧û +%D ʵ֡ +%D +%D һ(θ) () ܶĵ֧֡ĵ, +%D ѯ\nochinese{\CONTEXT}ǷܴʱѾ +%D Թеĺ꼯ûеõζŶĵ֧ +%D ûʵ֡. +%D \stop + +%D Because fonts are defined each time a \UNICODE\ is +%D encountered |<|which is less inefficient than one would +%D imagine, because \TEX\ is optimized quite well in this +%D repect|>| we can define macros like this to take care of +%D font switches. When available, one can add definitions +%D for italic, slanted, bold fonts and combinations of these. + +%D \macros +%D {chinesenumber} +%D +%D The chinese numbering systems rather straightforward. First +%D there are the digits: +%D +%D \starttabulate[|c|c|c|c|c|c|c|c|c|c|] +%D \NC 0 \NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NC 6 \NC 7 \NC 8 \NC 9 \NC\NR +%D \NC \chinesenumber{0} \NC \chinesenumber{1} \NC \chinesenumber{2} +%D \NC \chinesenumber{3} \NC \chinesenumber{4} \NC \chinesenumber{5} +%D \NC \chinesenumber{6} \NC \chinesenumber{7} \NC \chinesenumber{8} +%D \NC \chinesenumber{9} \NC\NR +%D \stoptabulate +%D +%D Apart from these numbers, we have dedicated representations +%D of some powers of~$10$. +%D +%D \starttabulate[|c|c|c|c|c|] +%D \NC 10 \NC 100 \NC 1000 \NC 10000 \NC 100000000 \NC\NR +%D \NC \chinesenumber{10} \NC \chinesenumber{100} +%D \NC \chinesenumber{1000} \NC \chinesenumber{10000} +%D \NC \chinesenumber{100000000} \NC\NR +%D \stoptabulate +%D +%D The number~12 is a combination of $1\times10+2$, or: +%D \chinesenumber {12}, while~22 becomes \chinesenumber {22}. +%D The numbers below 20 are treated a bit different, just like +%D numbers with series of $0$'s. So $2\times10$ comes out as +%D two glyphs, but $1\times10$ as one, because in the latter +%D case the~$1$ is redundant. The same is true for the powers +%D of~10. +%D +%D \starttabulate[|r|r|r|r|r|r|] +%D \NC 1 \NC \chinesenumber {1} \NC +%D 9 \NC \chinesenumber {9} \NC +%D 4 \NC \chinesenumber {4} \NC\NR +%D \NC 11 \NC \chinesenumber {11} \NC +%D 99 \NC \chinesenumber {99} \NC +%D 16 \NC \chinesenumber {16} \NC\NR +%D \NC 111 \NC \chinesenumber {111} \NC +%D 999 \NC \chinesenumber {999} \NC +%D 256 \NC \chinesenumber {256} \NC\NR +%D \NC 1111 \NC \chinesenumber {1111} \NC +%D 9999 \NC \chinesenumber {9999} \NC +%D 65536 \NC \chinesenumber {65536} \NC\NR +%D \stoptabulate +%D +%D The implementation is rather simple. For internal purposes, +%D we let zero expand to~0. The digits $0-9$ and numbers $10$, +%D $100$, $1000$, $10000$ and $100000000$ are hard coded. + +% This was the first implementation, before \WangLei\ asked +% me to look into Big Five encoding, so, like everthing in +% \TEX, things become a bit more complicated, but also more +% versatile. +% +% \starttypen +% \def\chinesedigit#1% +% {\ifnum #1=100000000 \uchar{210}{218}% 100000000 +% \else\ifnum #1=10000 \uchar{205}{242}% 10000 +% \else\ifnum #1=1000 \uchar{199}{167}% 1000 +% \else\ifnum #1=100 \uchar{176}{217}% 100 +% \else\ifnum #1=10 \uchar{202}{174}% 10 +% \else\ifcase#1 \uchar{193}{227}% 0 +% \or \uchar{210}{187}% 1 +% \or \uchar{182}{254}% 2 +% \or \uchar{200}{253}% 3 +% \or \uchar{203}{196}% 4 +% \or \uchar{206}{229}% 5 +% \or \uchar{193}{249}% 6 +% \or \uchar{198}{223}% 7 +% \or \uchar{176}{203}% 8 +% \or \uchar{190}{197}% 9 +% \fi\fi\fi\fi\fi\fi} +% \stoptypen + +%D We will implement four methods, the one described earlier, +%D a derived one with capitalized characters, an extended +%D version of the first method, and a rather Arabic method. +%D +%D \starttabulate[|l|l|] +%D \HL +%D \NC \bf command \NC \bf number 39 \NC\NR +%D \HL +%D \NC \type{\normalchinesenumber} \NC \normalchinesenumber {39} \NC\NR +%D \NC \type{\capitalizedchinesenumber} \NC \capitalizedchinesenumber{39} \NC\NR +%D \NC \type{\arabicchinesenumber} \NC \arabicchinesenumber {39} \NC\NR +%D \NC \type{\extendedchinesenumber} \NC \extendedchinesenumber {39} \NC\NR +%D \HL +%D \stoptabulate +%D +%D We use a dirty trick to enable Chinese Capital Digits. In +%D the encoding vectors, we define these by appending a suffix +%D \type {*} to the digit, which in the following macro is +%D appended or not (by passing \type {\empty}). + +\def\chinesedigit#1#2% #2: suffix, here * or \empty + {\udigit{\chineseencoding}{\number#1#2}} + +% Normal Chinese Number + +\def\normalchinesenumber#1% + {\expandafter\dochinesenumber\number#1\relax\empty} + +\def\dochinesenumber#1#2\relax#3% + {\ifnum#1#2<10 % 1-10 + \chinesedigit{#1}#3% + \else\ifnum#1#2<20 % 11-99 + \chinesedigit{10}#3% + \dodochinesenumberA#2\relax#3% + \else + \dodochinesenumber#1#2\relax#3% + \fi\fi} + +\def\dodochinesenumber#1#2\relax#3% + {\ifnum#1=0 + \chinesedigit{0}#3% + \dododochinesenumber0#2\relax#3% + \else\ifnum#1#2<10 % 1-10 + \chinesedigit{#1#2}#3% + \dodochinesenumberA#2\relax#3% + \else\ifnum#1#2<100 % 11-99 + \dodochinesenumber#1\relax#3% + \chinesedigit{10}#3% + \dodochinesenumberA#2\relax#3% + \else\ifnum#1#2<1000 % 100-999 + \dodochinesenumber#1\relax#3% + \chinesedigit{100}#3% + \dodochinesenumberA#2\relax#3% + \else\ifnum#1#2<10000 % 1000-9999 + \dodochinesenumber#1\relax#3% + \chinesedigit{1000}#3% + \dodochinesenumberA#2\relax#3% + \else\ifnum#1#2<100000 % 10000-99999 + \dodochinesenumber#1\relax#3% + \chinesedigit{10000}#3% + \dodochinesenumberA#2\relax#3% + \else\ifnum#1#2<1000000 % 100000-999999 + \dodochinesenumberB#1#2\relax#3% + \else\ifnum#1#2<10000000 % 1000000-9999999 + \dodochinesenumberC#1#2\relax#3% + \else\ifnum#1#2<100000000 % 10000000-99999999 + \dodochinesenumberD#1#2\relax#3% + \else\ifnum#1#2<1000000000 % 10000000-99999999 + \dochinesenumber#1\relax#3% + \chinesedigit{100000000}#3% + \dododochinesenumber#2\relax#3% + \else + \dodochinesenumberE#1#2\relax#3% + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +\def\dododochinesenumber#1#2\relax#3% + {\ifnum#1=0 + \ifnum0#2>0 \dododochinesenumber#2\relax#3\fi + \else + \dodochinesenumber#1#2\relax#3% + \fi} + +\def\dodochinesenumberA#1\relax#2% + {\ifcase0#1 \else\dodochinesenumber#1\relax#2\fi} + +\def\dodochinesenumberB#1#2#3\relax#4% + {\dochinesenumber#1#2\relax#4% + \chinesedigit{10000}#4% + \dododochinesenumber#3\relax#4} + +\def\dodochinesenumberC#1#2#3#4\relax#5% + {\dochinesenumber#1#2#3\relax#5% + \chinesedigit{10000}#5% + \dododochinesenumber#4\relax#5} + +\def\dodochinesenumberD#1#2#3#4#5\relax#6% + {\dochinesenumber#1#2#3#4\relax#6% + \chinesedigit{10000}#6% + \dododochinesenumber#5\relax#6} + +\def\dodochinesenumberE#1#2#3\relax#4% + {\dochinesenumber#1#2\relax#4% + \chinesedigit{100000000}#4% + \dododochinesenumber#3\relax#4} + +% Capitalized Chinese Number + +\def\capitalizedchinesenumber#1% + {\expandafter\dochinesenumber\number#1\relax*} + +% Extended Chinese Number + +\def\extendedchinesenumber#1% + {\expandafter\doextendedchinesenumber\number#1\relax} + +\def\doextendedchinesenumber#1#2\relax% + {\ifnum #1#2<20 % 0-19 + \dochinesenumber#1#2\relax\empty + \else\ifnum#1#2<30 % 20-29 + \chinesedigit{20}\empty + \ifcase#2\else\chinesedigit{2#2}\fi + \else\ifnum#1#2<40 % 30-39 + \chinesedigit{30}\empty + \ifcase#2\else\chinesedigit{3#2}\fi + \else + \dochinesenumber#1#2\relax\empty + \fi\fi\fi} + +% Arabic Chinese Number + +\def\arabicchinesenumber#1% + {\expandafter\doarabicchinesenumber\number#1@\relax} + +\def\doarabicchinesenumber#1#2\relax + {\if#1@\else + \chinesedigit{#1}\empty + \doarabicchinesenumber#2\relax + \fi} + +% The short call: + +\def\chinesenumber{\normalchinesenumber} + +% \dorecurse{40} +% {\hbox +% {\processingverbatimtrue +% \hbox to 1cm{\hss\recurselevel}\quad +% \hbox to 3cm{\hss\strut\normalchinesenumber {\recurselevel}}\quad +% \hbox to 3cm{\hss\strut\capitalizedchinesenumber{\recurselevel}}\quad +% \hbox to 3cm{\hss\strut\arabicchinesenumber {\recurselevel}}\quad +% \hbox to 3cm{\hss\strut\extendedchinesenumber {\recurselevel}}\crlf}} + +%D The next table demonstates the correctness of the +%D conversion macro. +%D +%D \startbuffer +%D \starttable[|l|l|l|l|l|l|] +%D \HL +%D \NC number \NC converter \NC hard coded \NC +%D number \NC converter \NC hard coded\NC \SR +%D \HL +%D \NC 1 \NC \chinesenumber{1} \NC һ \NC +%D 0 \NC \chinesenumber{0} \NC \NC\FR +%D \NC 11 \NC \chinesenumber{11} \NC ʮһ \NC +%D 10 \NC \chinesenumber{10} \NC ʮ \NC\MR +%D \NC 111 \NC \chinesenumber{111} \NC һһʮһ \NC +%D 100 \NC \chinesenumber{100} \NC һ \NC\MR +%D \NC 101 \NC \chinesenumber{101} \NC һһ \NC +%D 120 \NC \chinesenumber{120} \NC һٶʮ \NC\MR +%D \NC 1111 \NC \chinesenumber{1111} \NC һǧһһʮһ \NC +%D 1000 \NC \chinesenumber{1000} \NC һǧ \NC\MR +%D \NC 1001 \NC \chinesenumber{1001} \NC һǧһ \NC +%D 1020 \NC \chinesenumber{1020} \NC һǧʮ \NC\MR +%D \NC 11111 \NC \chinesenumber{11111} \NC һһǧһһʮһ \NC +%D 10000 \NC \chinesenumber{10000} \NC һ \NC\MR +%D \NC 10001 \NC \chinesenumber{10001} \NC һһ \NC +%D 10200 \NC \chinesenumber{10200} \NC һ \NC\LR +%D \HL +%D \NC 111111 \NC \chinesenumber{111111} \NC ʮһһǧһһʮһ \NC +%D 100000 \NC \chinesenumber{100000} \NC ʮ \NC\FR +%D \NC 1111111 \NC \chinesenumber{1111111} \NC һһʮһһǧһһʮһ \NC +%D 1000000 \NC \chinesenumber{1000000} \NC һ \NC\MR +%D \NC 11111111 \NC \chinesenumber{11111111} \NC һǧһһʮһһǧһһʮһ \NC +%D 10000000 \NC \chinesenumber{10000000} \NC һǧ \NC\MR +%D \NC 111111111 \NC \chinesenumber{111111111} \NC һһǧһһʮһһǧһһʮһ \NC +%D 100000000 \NC \chinesenumber{100000000} \NC һ \NC\MR +%D \NC 1111111111 \NC \chinesenumber{1111111111} \NC ʮһһǧһһʮһһǧһһʮһ \NC +%D 1000000000 \NC \chinesenumber{1000000000} \NC ʮ \NC\LR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \placetable{Some Chinese number examples.}{\getbuffer} + +%D Although the conversion can be hooked into most commands +%D that deal with numbers |<|those familiar with \TEX\ macro +%D programming will notice that the macro if fully +%D expandable|>| in many cases Chinese documents use western +%D digits. So, in practice, the change that the next example +%D shows up, is minimal. +%D +%D \starttabulate[|r|r|c|] +%D \NC 2546 \NC \chinesenumber {2546} \NC \NC\NR +%D \NC 9258 \NC \chinesenumber {9258} \NC $+$ \NC\NR +%D \HL +%D \NC 11804 \NC \chinesenumber {11804} \NC \NC\NR +%D \stoptabulate +%D +%D While in arabic arithmics addition leads to more digits, in +%D Chinese the number of glyphs can (temporary) decrease. +%D Given that the number of people dealing with Chinese is +%D considerably larger than the number of latin speaking +%D people, a successor of \TEX\ definitely must provide a +%D \type {\chinesenumeral} primitive. + +\defineconversion [c] [\normalchinesenumber] +\defineconversion [chinese] [\normalchinesenumber] +\defineconversion [nc] [\normalchinesenumber] +\defineconversion [normalchinese] [\normalchinesenumber] +\defineconversion [cc] [\capitalizedchinesenumber] +\defineconversion [capitalizedchinese] [\capitalizedchinesenumber] +\defineconversion [ec] [\extendedchinesenumber] +\defineconversion [extendedchinese] [\extendedchinesenumber] +\defineconversion [ac] [\arabicchinesenumber] +\defineconversion [arabicchinese] [\arabicchinesenumber] + +%D Date conversion: + +\defineconversion [cn] [\v!day] [\chinesenumber] +\defineconversion [cn] [\v!month] [\chinesenumber] +\defineconversion [cn] [\v!year] [\chinesenumber] + +%D \macros +%D {SimChi, TraChi} +%D +%D These components enable us to construct dedicated Chinese +%D font switches, like: + +\setupunicodefont + [chinese] + [ \c!scale=\chineseunicodescale, + \c!height=\chineseunicodeheight, + \c!depth=\chineseunicodedepth, + \c!strut=\v!yes, + \c!interlinespace=\v!yes, + \c!conversion=\chinesenumber, + \c!commands=\setchineseencoding, % needed for digits + \c!command=\handlechineseunicodeglyph] + +%D For the moment, this encoding is implemented rather ugly. The +%D trick is to move the encoding value from the current font +%D definition to the \type {\chineseencoding} macro. + +\let\chineseencoding\empty + +\def\setchineseencoding % normally SomeChineseRegular + {\getfontfileparameters\unicodestyle + \ifx\currentfontfileencoding\undefined \else + \let\chineseencoding\currentfontfileencoding + \fi} + +%D We could have said: +%D +%D \starttyping +%D \defineunicodefont +%D [SimChi] +%D [SimplifiedChinese] +%D [\c!scale=\chineseunicodescale, +%D \c!height=\chineseunicodeheight, +%D \c!depth=\chineseunicodedepth, +%D \c!conversion=\chinesenumber, +%D \c!commands=\setchineseencoding, % needed for digits +%D \c!command=\handlechineseunicodeglyph] +%D \stoptyping +%D +%D However, the former definitions is more general. Next we +%D map a few fonts: + +\definefontsynonym [SimplifiedChineseRegular] [gbsong] [encoding=gbk] +\definefontsynonym [SimplifiedChineseSlanted] [gbsongsl] [encoding=gbk] +\definefontsynonym [SimplifiedChineseItalic] [gbsongsl] [encoding=gbk] +\definefontsynonym [SimplifiedChineseBold] [gbhei] [encoding=gbk] +\definefontsynonym [SimplifiedChineseBoldSlanted] [gbheisl] [encoding=gbk] +\definefontsynonym [SimplifiedChineseBoldItalic] [gbheisl] [encoding=gbk] + +\definefontsynonym [TraditionalChineseRegular] [b5song] [encoding=big5] +\definefontsynonym [TraditionalChineseSlanted] [b5songsl] [encoding=big5] +\definefontsynonym [TraditionalChineseItalic] [b5songsl] [encoding=big5] +\definefontsynonym [TraditionalChineseBold] [b5hei] [encoding=big5] +\definefontsynonym [TraditionalChineseBoldSlanted] [b5heisl] [encoding=big5] +\definefontsynonym [TraditionalChineseBoldItalic] [b5heisl] [encoding=big5] + +% we need to move this to typescripts + +\doifelse \currentregime {utf} { + + \definefontsynonym [SimplifiedChineseRegular] [ChineseRegular] + \definefontsynonym [SimplifiedChineseSlanted] [ChineseSlanted] + \definefontsynonym [SimplifiedChineseItalic] [ChineseItalic] + \definefontsynonym [SimplifiedChineseBold] [ChineseBold] + \definefontsynonym [SimplifiedChineseBoldSlanted] [ChineseBoldSlanted] + \definefontsynonym [SimplifiedChineseBoldItalic] [ChineseBoldItalic] + + \definefontsynonym [TraditionalChineseRegular] [ChineseRegular] + \definefontsynonym [TraditionalChineseSlanted] [ChineseSlanted] + \definefontsynonym [TraditionalChineseItalic] [ChineseItalic] + \definefontsynonym [TraditionalChineseBold] [ChineseBold] + \definefontsynonym [TraditionalChineseBoldSlanted][ChineseBoldSlanted] + \definefontsynonym [TraditionalChineseBoldItalic] [ChineseBoldItalic] + + \definefontsynonym [ChineseRegular] [uni-htsong-][encoding=cjk-uni] + \definefontsynonym [ChineseSlanted] [uni-htsong-][encoding=cjk-uni] + \definefontsynonym [ChineseItalic] [uni-htsong-][encoding=cjk-uni] + \definefontsynonym [ChineseBold] [uni-hthei-] [encoding=cjk-uni] + \definefontsynonym [ChineseBoldSlanted][uni-hthei-] [encoding=cjk-uni] + \definefontsynonym [ChineseBoldItalic] [uni-hthei-] [encoding=cjk-uni] + + \loadmapfile[uni-htsong.map] + \loadmapfile[uni-htfs.map] + \loadmapfile[uni-hthei.map] + \loadmapfile[uni-htkai.map] + +} { + + \loadmapfile[gbk] + +} + +\defineunicodefont [SimChi] [SimplifiedChinese] [chinese] +\defineunicodefont [TraChi] [TraditionalChinese] [chinese] + +%D We default to these so called Simplified Chinese fonts. + +\SimChi + +%D In addition to these fonts, we (pre|)|define some commonly +%D used fonts: + +\definefontsynonym [SimplifiedChineseSongTiRegular] [gbsong] [encoding=gbk] +\definefontsynonym [SimplifiedChineseSongTiSlanted] [gbsongsl] [encoding=gbk] +\definefontsynonym [SimplifiedChineseSongTiBold] [gbsong] [encoding=gbk] +\definefontsynonym [SimplifiedChineseSongTiBoldSlanted] [gbsongsl] [encoding=gbk] + +\definefontsynonym [TraditionalChineseSongTiRegular] [b5song] [encoding=big5] +\definefontsynonym [TraditionalChineseSongTiSlanted] [b5songsl] [encoding=big5] +\definefontsynonym [TraditionalChineseSongTiBold] [b5song] [encoding=big5] +\definefontsynonym [TraditionalChineseSongTiBoldSlanted] [b5songsl] [encoding=big5] + +\definefontsynonym [SimplifiedChineseHeiTiRegular] [gbhei] [encoding=gbk] +\definefontsynonym [SimplifiedChineseHeiTiSlanted] [gbheisl] [encoding=gbk] +\definefontsynonym [SimplifiedChineseHeiTiBold] [gbhei] [encoding=gbk] +\definefontsynonym [SimplifiedChineseHeiTiBoldSlanted] [gbheisl] [encoding=gbk] + +\definefontsynonym [TraditionalChineseHeiTiRegular] [b5hei] [encoding=big5] +\definefontsynonym [TraditionalChineseHeiTiSlanted] [b5heisl] [encoding=big5] +\definefontsynonym [TraditionalChineseHeiTiBold] [b5hei] [encoding=big5] +\definefontsynonym [TraditionalChineseHeiTiBoldSlanted] [b5heisl] [encoding=big5] + +\definefontsynonym [SimplifiedChineseKaiTiRegular] [gbkai] [encoding=gbk] +\definefontsynonym [SimplifiedChineseKaiTiSlanted] [gbkaisl] [encoding=gbk] +\definefontsynonym [SimplifiedChineseKaiTiBold] [gbkai] [encoding=gbk] +\definefontsynonym [SimplifiedChineseKaiTiBoldSlanted] [gbkaisl] [encoding=gbk] + +\definefontsynonym [TraditionalChineseKaiTiRegular] [b5kai] [encoding=big5] +\definefontsynonym [TraditionalChineseKaiTiSlanted] [b5kaisl] [encoding=big5] +\definefontsynonym [TraditionalChineseKaiTiBold] [b5kai] [encoding=big5] +\definefontsynonym [TraditionalChineseKaiTiBoldSlanted] [b5kaisl] [encoding=big5] + +\definefontsynonym [SimplifiedChineseFangSongRegular] [gbfs] [encoding=gbk] +\definefontsynonym [SimplifiedChineseFangSongSlanted] [gbfssl] [encoding=gbk] +\definefontsynonym [SimplifiedChineseFangSongBold] [gbfs] [encoding=gbk] +\definefontsynonym [SimplifiedChineseFangSongBoldSlanted] [gbfssl] [encoding=gbk] + +\definefontsynonym [TraditionalChineseFangSongRegular] [b5fs] [encoding=big5] +\definefontsynonym [TraditionalChineseFangSongSlanted] [b5fssl] [encoding=big5] +\definefontsynonym [TraditionalChineseFangSongBold] [b5fs] [encoding=big5] +\definefontsynonym [TraditionalChineseFangSongBoldSlanted] [b5fssl] [encoding=big5] + +\definefontsynonym [SimplifiedChineseLiShuRegular] [gbli] [encoding=gbk] +\definefontsynonym [SimplifiedChineseLiShuSlanted] [gblisl] [encoding=gbk] +\definefontsynonym [SimplifiedChineseLiShuBold] [gbli] [encoding=gbk] +\definefontsynonym [SimplifiedChineseLiShuBoldSlanted] [gblisl] [encoding=gbk] + +\definefontsynonym [TraditionalChineseLiShuRegular] [b5li] [encoding=big5] +\definefontsynonym [TraditionalChineseLiShuSlanted] [b5lisl] [encoding=big5] +\definefontsynonym [TraditionalChineseLiShuBold] [b5li] [encoding=big5] +\definefontsynonym [TraditionalChineseLiShuBoldSlanted] [b5lisl] [encoding=big5] + +%D The following definitions provide us the commands to switch +%D to these fonts. + +\defineunicodefont [SimSongTi] [SimplifiedChineseSongTi] [chinese] +\defineunicodefont [TraSongTi] [TraditionalChineseSongTi] [chinese] + +\defineunicodefont [SimHeiTi] [SimplifiedChineseHeiTi] [chinese] +\defineunicodefont [TraHeiTi] [TraditionalChineseHeiTi] [chinese] + +\defineunicodefont [SimKaiTi] [SimplifiedChineseKaiTi] [chinese] +\defineunicodefont [TraKaiTi] [TraditionalChineseKaiTi] [chinese] + +\defineunicodefont [SimFangSong] [SimplifiedChineseFangSong] [chinese] +\defineunicodefont [TraFangSong] [TraditionalChineseFangSong] [chinese] + +\defineunicodefont [SimLiShu] [SimplifiedChineseLiShu] [chinese] +\defineunicodefont [TraLiShu] [TraditionalChineseLiShu] [chinese] + +% \definealternativestyle [ChineseTitleFont] [\bfd\SimKaiTi] [] + +%D \macros +%D {purechinese} +%D +%D Use this macro to suppress spacing around Chinese text. + +\def\purechinese#1% evt geen rek + {\hskip\chineseSsignal\relax + #1\unskip\unskip\unskip + \hskip\chineseSsignal\relax} + +%D \macros +%D {stillchinese} +%D +%D Use the next macro when you want the next item to be put +%D tight to the previous chinese character. + +\def\stillchinese + {\hskip\chineseSsignal\relax} + +%D \macros +%D {nochinese} +%D +%D When we want to be sure of non||Chinese inline text, +%D we can package the for instance english text in \type +%D {\nochinese}. + +\def\nochinese#1% + {\unskip\unskip\unskip + \hskip\chinesesurroundskip + \hskip\chineseinterglyphskip\relax + #1% + \hskip\chineseinterglyphskip\relax + \hskip\chinesesurroundskip + \ignorespaces} + +%D \macros +%D {chisize} +%D +%D Chinese font sizes are specified in a different way, +%D using positive and negative numbers: + +\def\chisize#1% + {\ifnum#11<0 % a trick to catch -0 + \ifcase#1\space36\or24\or18\or15\or12\or9\or\else6.5\fi + \else + \ifcase#1\space42\or26\or22\or16\or14\or10.5\or7.5\or5.5\else5\fi + \fi pt} + +%D So: +%D +%D \startbuffer +%D [\chisize{-1}] [\chisize{7}] [\chisize{+4}] +%D \stopbuffer +%D +%D \typebuffer +%D +%D gives: +%D +%D \getbuffer +%D +%D The full range of sizes is: +%D +%D \starttabulate[|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|] +%D \NC 8 \NC 7 \NC -6 \NC 6 \NC +%D -5 \NC 5 \NC -4 \NC 4 \NC +%D -3 \NC 3 \NC -2 \NC 2 \NC +%D -1 \NC 1 \NC -0 \NC 0 \NC\NR +%D \NC\chisize {8}\NC\chisize{7}\NC\chisize{-6}\NC\chisize{6}\NC +%D \chisize{-5}\NC\chisize{5}\NC\chisize{-4}\NC\chisize{4}\NC +%D \chisize{-3}\NC\chisize{3}\NC\chisize{-2}\NC\chisize{2}\NC +%D \chisize{-1}\NC\chisize{1}\NC\chisize{-0}\NC\chisize{0}\NC\NR +%D \stoptabulate + +%D Now it's time for some real Chinese. This example +%D also shows that font switching is supported. +%D +%D \startnarrower +%D \midaligned{\tfd ˮͷ} +%D \blank +%D \midaligned{\tfb ﵩƪ滳ɡ} +%D \blank +%D \midaligned{\tfb } +%D \blank +%D ¼ʱУѾ졣֪ϹڣϦǺꣿ˷ȥ +%D ֿ¥ߴʤŪӰ˼䣿 +%D \blank +%D ת󣬵ͻߡӦкޣƫʱԲбϣ +%D Բȱ¹ȫԸ˳ãǧﹲ濾ꡣ +%D \stopnarrower +%D +%D The english translation is: +%D +%D \startnarrower +%D \midaligned{\tfd Tune: Prelude to the Melody of Water} +%D \blank +%D \midaligned{\tfb On the night of the Mid||Autumn Festival of +%D 1076, I drank happily till dawn and wrote this in my cups +%D while thinking of Zi||you.} +%D \blank +%D \midaligned{\tfb Su Shi} +%D \blank +%D How long will the bright moon appear? Wine||cup in hand, I +%D ask the sky. I do not know waht time of year it would be +%D tonight in the palace on high. Riding the wind, there I +%D would fly, yet I fear the crystal palace would be far too +%D high and cold for me. I rise and dance, with my shadow I +%D play. On high as on earth, would it be as gay? +%D \blank +%D The moon goes round the mansion red though gauze||draped +%D windows soft to shed her light upon the sleepless bed. +%D Against man she should have no spite. Why then when people +%D part is she oft full and bright? Men have sorrow and joy, +%D they part or meet again; The moon may be bright or dim, she +%D may wax or wane. There has been nothing perfect since the +%D olden days. So let us wish that man will live long as he +%D can! Though miles apart, we'll share the beauty she +%D displays. +%D \stopnarrower + +%D This package is written in the city of Hasselt, a pretty +%D small town in the |<|compared to China real small|>| +%D Netherlands. Like most dutch cities, even this small one +%D has a chinese restaurant, run by chinese, speaking chinese, +%D and |<|indeed|>| writing chinese. Eating there will never +%D be the same, since now I can at least pretend to know the +%D glyphs all around the place. The numbers should pose me no +%D problems, but I fear I will never manage to recognize those +%D scribles they draw on their pads when thay take your order. + +%D To make our lives more easy, we put it here (too): + +\setuptyping[\c!tab=\v!no] + +\protect \endinput diff --git a/tex/context/base/font-chi.tex b/tex/context/base/font-chi.tex deleted file mode 100644 index 0acf710d5..000000000 --- a/tex/context/base/font-chi.tex +++ /dev/null @@ -1,1156 +0,0 @@ -%D \module -%D [ file=font-chi, -%D version=1999.10.10, -%D title=\CONTEXT\ Font Macros, -%D subtitle=Chinese, -%D author=Hans Hagen, -%D date=\currentdate, -%D suggestions=Wang Lei, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifx\handlechineseunicodeglyph\undefined \else \endinput \fi - -% NOT YET ADAPTED TO THE NEW FONT MACROS - -%D The first implementation (most of which is here) is based on -%D the specific font layout. This is because not all glyphs are -%D available in uniciode, which means that we cannot use -%D unicode codepoints (yet); if it were possible we could use -%D just one table per input encoding. - -\writestatus{loading}{ConTeXt Font Macros / Chinese} - -% much will to typo-chi.tex - -%D Still to be implemented: -%D -%D \startitemize -%D \item columns left right touch -%D \item distance = (hsize-n*bodyfontsize)/(n-1) -%D \item char grids -%D \item char tables -%D \item all kind of rotated combinations -%D \item hanging puctuation -%D \item a few more encodings -%D \item rotation list -%D \stopitemize - -%M \setupbodyfont[chi] -%M -%M \def\WangLei{\purechinese{\uchar{205}{245}\uchar{192}{218}}} - -\useencoding[chi] - -%D When \WangLei\ sent me a mail asking if \CONTEXT\ was able -%D to support Chinese, I wasn't sure if the answer could be -%D yes. I knew that those languages, rich of glyphs, were -%D typeset by \TEX, so in principle it should be possible. I -%D asked or some more input and was told that there were -%D \LATEX\ styles regarding those languages. When I unzipped -%D the accompanying files, it became clear that I had to -%D implement support for Chinese from scratch. There was a -%D multitude of font, with rather unfamiliar encodings, a -%D large collection of files with |<|at least for me|>| -%D unknown purposes, and worse, the documentation was mainly -%D in Chinese. -%D -%D So, \WangLei\ and I started exchanging some emails and it -%D soon became clear that supporting Chinese was not that -%D complicated at all. It mostly came to dealing with handling -%D \UNICODE\ fonts. It also became clear that everything -%D Chinese took place in the upper region of the eight bit -%D character set. I wrote some macros that could process the -%D small \type {Hello World} file \WangLei\ had send me, and -%D after some bug fixes real Chinese came out. I started to -%D like the look and fel of Chinese glyphs, so on we went. -%D -%D The first comments concerned spacing. The mix of English -%D and Chinese demands some rather deliberate handling of -%D spacing. Breaking lines was not so much a problem, and -%D could be solved by adding some glue between Chinese glyphs. -%D -%D In the meantime had asked \WangLei\ for some language bound -%D labels and texts, and implementing these was rather -%D straightforward. But, there were still some issues to deal -%D with: conversion of numbers, date handling and index -%D sorting. -%D -%D I consider(ed) writing Chinese support to be a nice puzzle, -%D since I have to act on chinese \CONTEXT\ code, where I only -%D understand the \CONTEXT\ part. The drawings \WangLei\ made -%D me (in drawing packages) were of great help. Since I write -%D these modules from scratch, although I fall back on some -%D basic encoding and font modules, I consider them to be -%D rather clean. This cannot be said of all \CONTEXT\ font -%D modules \type {-)}. - -\unprotect - -%D Because Chinese glyphs have more height than the average -%D Latin glyph, and at the same time don't have much depth, -%D we adapt the scale. -%D -%D Before and after the glyph we have to deal with Chinese -%D spacing. Special attention is given to punctuation. -%D -%D \starttyping -%D [some short nice chinese text with () and english] -%D \stoptyping -%D -%D We insert a bit of stretch and introduce a signal to -%D keep track of previous characters. We use a similar -%D method in the units module, which may be a nice -%D introduction to using signals. - -%D \macros -%D {chineseunicodescale, chineseinterglyphskip, -%D chineseunicodeheight, chineseunicodedepth, chinesespace} -%D -%D There are a few variables, that can be (re|)|set -%D depending on the current font. They default to: - -% hm, why don't we use the normal unicodestrut mechanism? - -\def\chineseunicodescale {1.00} % not smaller than .85 -\def\chineseunicodeheight {1.00} -\def\chineseunicodedepth {1.00} -\def\chineseinterglyphskip{0pt \!!plus .05em \!!minus .01em} -\def\chinesesurroundskip {.25em \!!plus .15em \!!minus .05em} - -%D We define a few signals. As said, another example of -%D using signals can be found in the module \type {m-units}. - -\newsignal\chineseLsignal % left boundary character -\newsignal\chineseRsignal % right boundary character -\newsignal\chineseSsignal % any other character (symbol) - -\chardef\chineseBstatus=0 % 0=unknown 1=left 2=right 3=chinese 4=nospace -\chardef\chineseAstatus=0 % 0=unknown 1=left 2=right 3=space -\chardef\chineseSstatus=0 % 0=unknown 1=left 2=right - -\sfcode`(=2000 % a temporary hack - -\def\chinesenobreak - {\relax - \iftracechinese - \nobreak - \kern-.5pt\color[red]{\vrule\!!width1pt}\kern-.5pt - \nobreak - \else - \nobreak - \fi} - -\newif\ifcorrectchineseboundarychars - -\def\chineseunskip - {\unskip\unskip\unskip\unskip} - -\def\insertchineseglyph - {\iftracechinese\tracedchineseglyph\else\insertunicodeglyph\fi} - -\newif\ifverticalchinese - -\def\handlechineseunicodeglyph - {\ifinpagebody - \horizontalchineseunicodeglyph - \else\ifverticalchinese - \verticalchineseunicodeglyph - \else - \horizontalchineseunicodeglyph - \fi\fi} - -% chinese classes: left=1|right=2|center=3 - -\chardef\plusfour=4 - -\def\analyzechineseunicodeglyph % beware, no zerocount ! - {\chardef\chineseSstatus0\getvalue{uc\number\unicodeposition}\relax} - -\def\analyzechineseunicodeenviroment - {% left - \ifx (\nextutoken \chardef\chineseAstatus\plusone \else - \ifx [\nextutoken \chardef\chineseAstatus\plusone \else - % right - \ifx ,\nextutoken \chardef\chineseAstatus\plustwo \else - \ifx .\nextutoken \chardef\chineseAstatus\plustwo \else - \ifx ?\nextutoken \chardef\chineseAstatus\plustwo \else - \ifx ;\nextutoken \chardef\chineseAstatus\plustwo \else - \ifx :\nextutoken \chardef\chineseAstatus\plustwo \else - \ifx !\nextutoken \chardef\chineseAstatus\plustwo \else - \ifx )\nextutoken \chardef\chineseAstatus\plustwo \else - \ifx ]\nextutoken \chardef\chineseAstatus\plustwo \else - % space - \ifx\nextutoken\blankspace \chardef\chineseAstatus\plusthree \else - \ifx\nextutoken\space \chardef\chineseAstatus\plusthree \else - \chardef\chineseAstatus\zerocount - % unknown - \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi - % maybe save the last skip? - \chardef\chineseBstatus\ifdim\lastskip=\zeropoint\plusfour\else\zerocount\fi - \ifdim\lastskip=\chineseLsignal \chardef\chineseBstatus\plusone \else - \ifdim\lastskip=\chineseRsignal \chardef\chineseBstatus\plustwo \else - \ifdim\lastskip=\chineseSsignal \chardef\chineseBstatus\plusthree \else - \scratchskip=\lastskip \unskip - \ifdim\lastskip=\chineseLsignal \chardef\chineseBstatus\plusone \else - \ifdim\lastskip=\chineseRsignal \chardef\chineseBstatus\plustwo \else - \ifdim\lastskip=\chineseSsignal \chardef\chineseBstatus\plusthree \else - \space\scratchskip=\lastskip \unskip - \setbox\scratchbox=\hbox\bgroup - (\space - \ifdim\lastskip=\scratchskip - \egroup \chardef\chineseBstatus\plusone - \else - \egroup - \ifdim\scratchskip=\zeropoint \chardef\chineseBstatus\plusfour \fi - \fi - \fi\fi\fi - \fi\fi\fi} - -\def\horizontalchineseunicodeglyph - {\relax - \ifhmode\else\dontleavehmode\fi % added - \setunicodescale\chineseunicodescale % redundant - \setunicodestrut\chineseunicodeheight\chineseunicodedepth % redundant - \ifprocessingverbatim - \iftracechinese - \ruledhbox{\insertunicodeglyph}% - \else - \insertunicodeglyph - \fi - \else\ifx\nextutoken\relax - \insertunicodeglyph - \else - \analyzechineseunicodeglyph - \analyzechineseunicodeenviroment - \ifcase\chineseSstatus\relax - \ifcase\chineseBstatus\relax - \chineseunskip - \hskip\chinesesurroundskip % unknown - \or - \chineseunskip - \chinesenobreak % left - \or - \ifcorrectchineseboundarychars\else\chineseunskip\fi - \hskip\chineseinterglyphskip % right - \or - \chineseunskip - \hskip\chineseinterglyphskip % chinese - \or - % whatever - \fi - \insertchineseglyph - \ifcase\chineseAstatus\relax - \hskip\chineseinterglyphskip % unknown - \hskip\chinesesurroundskip - \ifcase\chineseSstatus - \hskip\chineseSsignal - \or - \hskip\chineseLsignal - \else - \hskip\chineseRsignal - \fi - \or - \hskip\chineseinterglyphskip % left - \chinesenobreak - \hskip\chineseLsignal - \or - \chinesenobreak % right - \hskip\chineseinterglyphskip - \chinesenobreak - \hskip\chineseRsignal - \or - \hskip\chineseinterglyphskip % space - \hskip\chinesesurroundskip - \hskip\chineseSsignal - \fi - \or % left - \ifcorrectchineseboundarychars - \let\unicodecharcommand\chineseleftcharcommand - \fi - \chineseunskip - \insertchineseglyph - \chinesenobreak - \hskip\chineseLsignal - \or % right - \ifcorrectchineseboundarychars - \let\unicodecharcommand\chineserightcharcommand - \fi - \chineseunskip - \chinesenobreak - \insertchineseglyph - \hskip\chineseRsignal - \else % center - \chineseunskip - \chinesenobreak - \insertchineseglyph - \hskip\chineseinterglyphskip - \hskip\chineseRsignal - \fi\fi - \aftergroup\ignorespaces % watch this - \fi} - -\def\verticalchineseunicodeglyph - {\relax - \ifprocessingverbatim % to do - \horizontalchineseunicodeglyph - \else - \setunicodescale\chineseunicodescale % redundant - \setunicodestrut\chineseunicodeheight\chineseunicodedepth % redundant - \ifx\nextutoken\relax - \insertchineseglyph - \ifvmode % catches \hbox{...}, actually \hbox should be \vbox -) - \nointerlineskip - \fi - \allowbreak - \else - \analyzechineseunicodeglyph - \setbox\scratchbox\hbox to \hsize - {\hss - \ifcase\chineseSstatus\relax - \insertchineseglyph - \else % left / right - \setbox\scratchbox\hbox{\insertchineseglyph}% - \rotate[\c!rotation=270]{\box\scratchbox}% - \fi - \hss}% - \ht\scratchbox\unicodeheight\strutht - \dp\scratchbox\unicodedepth \strutdp - \ifvmode % catches \hbox{...}, actually \hbox should be \vbox -) - \nointerlineskip - \fi - \ifcase\prevchineseSstatus\relax - \ifnum\chineseSstatus=\plustwo \par\nobreak\else\allowbreak\fi - \or % left - \par\nobreak - \or % right - \ifnum\chineseSstatus=\plustwo \par\nobreak\else\allowbreak\fi - \fi - \global\chardef\prevchineseSstatus\chineseSstatus % pagebody ... - \box\scratchbox\par - \fi - \aftergroup\ignorespaces % watch this - \fi} - -%D \macros -%D {setupchinese,startvertical,nochinese} -%D -%D The previous macros implement horizontal as well as -%D vertical typesetting. Vertical typesetting is implemented -%D on top of the multi||column routines. - -\def\setupchinese - {\dodoubleargument\getparameters[\??vt]} - -\def\startvertical - {\dosingleempty\dostartvertical} - -\def\dostartvertical[#1]% - {\bgroup - \def\maxnofcolumns{25}% - \verticalchinesetrue - \global\chardef\prevchineseSstatus\zerocount - \let\nochinese\nochineseinvertical - \doif\@@vtn\v!fit - {\dimen0=\textwidth \advance\dimen0 \@@vtdistance - \dimen2=\bodyfontsize \advance\dimen2 \@@vtdistance - \divide\dimen0 \number\dimen2 - \edef\@@vtn{\number\dimen0}}% - \startcolumns - [\c!direction=\@@vtdirection, - \c!balance=\@@vtbalance, - \c!distance=\@@vtdistance, - \c!n=\@@vtn, - #1]} - -\def\stopvertical - {\stopcolumns - \egroup} - -\setupchinese - [\c!direction=\v!left, - \c!balance=\v!no, - \c!n=\v!fit, - \c!distance=1.5\bodyfontsize] - -%D We can set up vertical typesetting with \type -%D {\setupchinese}. - -%D \macros -%D {nochineseinvertical} -%D -%D English (non chinese) text is typeset rotated: - -\def\nochineseinvertical#1% - {\par - \setbox\scratchbox\hbox{\strut#1} - \getnoflines{\wd\scratchbox} - \setbox\scratchbox\hbox to \noflines\openlineheight - {\hss\box\scratchbox\hss} - \hbox to \hsize - {\hss - \rotate - [\c!rotation=270] - {\vbox to \ht\scratchbox{\vss\box\scratchbox\vss}}% - \hss} - \par} - -%D \macros -%D {correctchineseboundarychars} -%D -%D Careful reading of the previous macro learns that we -%D treat left and right glyphs differently. When we say -%D -%D \starttyping -%D \correctchineseboundarycharstrue -%D \stoptyping -%D -%D For the moment correction in on by default. - -\correctchineseboundarycharstrue - -\def\chineserightcharcommand#1% - {\iftracechinese\ruledhbox\else\hbox\fi \!!to .5em{#1\hss}% - \hskip.25em\!!plus .25em\relax}% - -\def\chineseleftcharcommand#1% - {\ifnum\chineseBstatus<4 \hskip.25em \!!plus .25em\relax\fi - \iftracechinese\ruledhbox\else\hbox\fi \!!to .5em{\hss#1}}% - -% \def\chineserightcharcommand#1% -% {\setbox\scratchbox=\hbox{#1}% -% \scratchdimen=.5em -% \ifdim\wd\scratchbox>\scratchdimen -% \iftracechinese\ruledhbox\else\hbox\fi \!!to \scratchdimen -% {\box\scratchbox\hss}% -% \hskip.5\scratchdimen\!!plus.5\scratchdimen\relax -% \else -% \box\scratchbox -% \fi} - -% \def\chineseleftcharcommand#1% -% {\setbox\scratchbox=\hbox{#1}% -% \scratchdimen=.5em -% \ifdim\wd\scratchbox>\scratchdimen -% \ifnum\chineseBstatus<4 -% \hskip.5\scratchdimen\!!plus.5\scratchdimen\relax -% \fi -% \iftracechinese\ruledhbox\else\hbox\fi \!!to \scratchdimen -% {\hss\box\scratchbox}% -% \else -% \box\scratchbox -% \fi} - -%D The long list of numbers in the previous macro identify the -%D characters where special care is needed for breaking lines. -%D A linebreak is not permitted before: -%D -%D \def\DoIt #1 #2 % -%D {\hbox{\hbox to 2em{\uchar{#1}{#2}\hss}#1 #2}\par} -%D -%D \startcolumns[n=5] -%D \DoIt 161 162 \DoIt 161 163 \DoIt 161 164 \DoIt 161 167 \DoIt 161 173 -%D \DoIt 161 175 \DoIt 161 177 \DoIt 161 179 \DoIt 161 181 \DoIt 161 183 -%D \DoIt 161 185 \DoIt 161 187 \DoIt 161 189 \DoIt 161 191 \DoIt 161 227 -%D \DoIt 161 228 \DoIt 161 229 \DoIt 163 161 \DoIt 163 162 \DoIt 163 167 -%D \DoIt 163 169 \DoIt 163 172 \DoIt 163 174 \DoIt 163 186 \DoIt 163 187 -%D \DoIt 163 190 \DoIt 163 191 \DoIt 163 221 \DoIt 163 253 -%D \stopcolumns -%D -%D A linebreak is not permitted after the following glyphs: -%D -%D \startcolumns[n=5] -%D \DoIt 161 174 \DoIt 161 176 \DoIt 161 178 \DoIt 161 180 \DoIt 161 182 -%D \DoIt 161 184 \DoIt 161 186 \DoIt 161 188 \DoIt 161 190 \DoIt 163 168 -%D \DoIt 163 219 \DoIt 163 224 \DoIt 163 251 -%D \stopcolumns - -%D \macros -%D {tracechinesetrue, showchinesetracelegend} -%D -%D When we say \type {\tracechinesetrue}, we get some -%D insight in the way \CONTEXT\ handles the Chinese glyphs. -%D The symbols and color used represent: -%D -%D \showchinesetracelegend - -\newif\iftracechinese - -\def\showchinesetracelegend - {\definetabulate[\s!dummy][|c|l|l|l|]% - \startdummy - \HL - \NC \bf key \NC \bf meaning \NC \bf glyph \NC \bf keys \NC\NR - \HL - \NC u \NC unknown character type \NC \color[green]{current} \NC u l r \NC\NR - \NC l \NC left boundary character \NC \color[red]{previous} \NC u l r c n \NC\NR - \NC r \NC right boundary character \NC \color[blue]{next} \NC u l r s \NC\NR - \NC c \NC chinese character \NC \NC \NC\NR - \NC s \NC following space \NC \NC \NC\NR - \NC n \NC no preceding space \NC \NC \NC\NR - \HL - \stopdummy} - -\def\tracedchineseglyph - {\dontleavehmode - \ruledhbox - {\setbox\scratchbox\hbox{\insertunicodeglyph}% - \hbox to \wd\scratchbox - {\localcolortrue - \copy\scratchbox - \infofont - \hskip-\wd\scratchbox - \hbox to \wd\scratchbox - {\hss - \color[green]{\ifcase\chineseSstatus\relax u\or l\or r\fi}% - \hss}% - \hskip-\wd\scratchbox - \lower\dp\scratchbox\hbox to \wd\scratchbox - {\hss - \color[red]{\ifcase\chineseBstatus\relax u\or l\or r\or c\or n\fi}% - \hss - \color[blue]{\ifcase\chineseAstatus\relax u\or l\or r\or s\fi}% - \hss}}}} - -%D The following example shows how tracing works. -%D -%D \start \tracechinesetrue -%D һθǽܶĵ֧֡ĵ -%D ѯ \nochinese{\CONTEXT} ǷܴʱѾԹ -%D еĺ꼯ûеõζŶĵֻ֧û -%D ʵ֡ -%D -%D һ(θ) () ܶĵ֧֡ĵ, -%D ѯ\nochinese{\CONTEXT}ǷܴʱѾ -%D Թеĺ꼯ûеõζŶĵ֧ -%D ûʵ֡. -%D \stop - -%D Because fonts are defined each time a \UNICODE\ is -%D encountered |<|which is less inefficient than one would -%D imagine, because \TEX\ is optimized quite well in this -%D repect|>| we can define macros like this to take care of -%D font switches. When available, one can add definitions -%D for italic, slanted, bold fonts and combinations of these. - -%D \macros -%D {chinesenumber} -%D -%D The chinese numbering systems rather straightforward. First -%D there are the digits: -%D -%D \starttabulate[|c|c|c|c|c|c|c|c|c|c|] -%D \NC 0 \NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NC 6 \NC 7 \NC 8 \NC 9 \NC\NR -%D \NC \chinesenumber{0} \NC \chinesenumber{1} \NC \chinesenumber{2} -%D \NC \chinesenumber{3} \NC \chinesenumber{4} \NC \chinesenumber{5} -%D \NC \chinesenumber{6} \NC \chinesenumber{7} \NC \chinesenumber{8} -%D \NC \chinesenumber{9} \NC\NR -%D \stoptabulate -%D -%D Apart from these numbers, we have dedicated representations -%D of some powers of~$10$. -%D -%D \starttabulate[|c|c|c|c|c|] -%D \NC 10 \NC 100 \NC 1000 \NC 10000 \NC 100000000 \NC\NR -%D \NC \chinesenumber{10} \NC \chinesenumber{100} -%D \NC \chinesenumber{1000} \NC \chinesenumber{10000} -%D \NC \chinesenumber{100000000} \NC\NR -%D \stoptabulate -%D -%D The number~12 is a combination of $1\times10+2$, or: -%D \chinesenumber {12}, while~22 becomes \chinesenumber {22}. -%D The numbers below 20 are treated a bit different, just like -%D numbers with series of $0$'s. So $2\times10$ comes out as -%D two glyphs, but $1\times10$ as one, because in the latter -%D case the~$1$ is redundant. The same is true for the powers -%D of~10. -%D -%D \starttabulate[|r|r|r|r|r|r|] -%D \NC 1 \NC \chinesenumber {1} \NC -%D 9 \NC \chinesenumber {9} \NC -%D 4 \NC \chinesenumber {4} \NC\NR -%D \NC 11 \NC \chinesenumber {11} \NC -%D 99 \NC \chinesenumber {99} \NC -%D 16 \NC \chinesenumber {16} \NC\NR -%D \NC 111 \NC \chinesenumber {111} \NC -%D 999 \NC \chinesenumber {999} \NC -%D 256 \NC \chinesenumber {256} \NC\NR -%D \NC 1111 \NC \chinesenumber {1111} \NC -%D 9999 \NC \chinesenumber {9999} \NC -%D 65536 \NC \chinesenumber {65536} \NC\NR -%D \stoptabulate -%D -%D The implementation is rather simple. For internal purposes, -%D we let zero expand to~0. The digits $0-9$ and numbers $10$, -%D $100$, $1000$, $10000$ and $100000000$ are hard coded. - -% This was the first implementation, before \WangLei\ asked -% me to look into Big Five encoding, so, like everthing in -% \TEX, things become a bit more complicated, but also more -% versatile. -% -% \starttypen -% \def\chinesedigit#1% -% {\ifnum #1=100000000 \uchar{210}{218}% 100000000 -% \else\ifnum #1=10000 \uchar{205}{242}% 10000 -% \else\ifnum #1=1000 \uchar{199}{167}% 1000 -% \else\ifnum #1=100 \uchar{176}{217}% 100 -% \else\ifnum #1=10 \uchar{202}{174}% 10 -% \else\ifcase#1 \uchar{193}{227}% 0 -% \or \uchar{210}{187}% 1 -% \or \uchar{182}{254}% 2 -% \or \uchar{200}{253}% 3 -% \or \uchar{203}{196}% 4 -% \or \uchar{206}{229}% 5 -% \or \uchar{193}{249}% 6 -% \or \uchar{198}{223}% 7 -% \or \uchar{176}{203}% 8 -% \or \uchar{190}{197}% 9 -% \fi\fi\fi\fi\fi\fi} -% \stoptypen - -%D We will implement four methods, the one described earlier, -%D a derived one with capitalized characters, an extended -%D version of the first method, and a rather Arabic method. -%D -%D \starttabulate[|l|l|] -%D \HL -%D \NC \bf command \NC \bf number 39 \NC\NR -%D \HL -%D \NC \type{\normalchinesenumber} \NC \normalchinesenumber {39} \NC\NR -%D \NC \type{\capitalizedchinesenumber} \NC \capitalizedchinesenumber{39} \NC\NR -%D \NC \type{\arabicchinesenumber} \NC \arabicchinesenumber {39} \NC\NR -%D \NC \type{\extendedchinesenumber} \NC \extendedchinesenumber {39} \NC\NR -%D \HL -%D \stoptabulate -%D -%D We use a dirty trick to enable Chinese Capital Digits. In -%D the encoding vectors, we define these by appending a suffix -%D \type {*} to the digit, which in the following macro is -%D appended or not (by passing \type {\empty}). - -\def\chinesedigit#1#2% #2: suffix, here * or \empty - {\udigit{\chineseencoding}{\number#1#2}} - -% Normal Chinese Number - -\def\normalchinesenumber#1% - {\expandafter\dochinesenumber\number#1\relax\empty} - -\def\dochinesenumber#1#2\relax#3% - {\ifnum#1#2<10 % 1-10 - \chinesedigit{#1}#3% - \else\ifnum#1#2<20 % 11-99 - \chinesedigit{10}#3% - \dodochinesenumberA#2\relax#3% - \else - \dodochinesenumber#1#2\relax#3% - \fi\fi} - -\def\dodochinesenumber#1#2\relax#3% - {\ifnum#1=0 - \chinesedigit{0}#3% - \dododochinesenumber0#2\relax#3% - \else\ifnum#1#2<10 % 1-10 - \chinesedigit{#1#2}#3% - \dodochinesenumberA#2\relax#3% - \else\ifnum#1#2<100 % 11-99 - \dodochinesenumber#1\relax#3% - \chinesedigit{10}#3% - \dodochinesenumberA#2\relax#3% - \else\ifnum#1#2<1000 % 100-999 - \dodochinesenumber#1\relax#3% - \chinesedigit{100}#3% - \dodochinesenumberA#2\relax#3% - \else\ifnum#1#2<10000 % 1000-9999 - \dodochinesenumber#1\relax#3% - \chinesedigit{1000}#3% - \dodochinesenumberA#2\relax#3% - \else\ifnum#1#2<100000 % 10000-99999 - \dodochinesenumber#1\relax#3% - \chinesedigit{10000}#3% - \dodochinesenumberA#2\relax#3% - \else\ifnum#1#2<1000000 % 100000-999999 - \dodochinesenumberB#1#2\relax#3% - \else\ifnum#1#2<10000000 % 1000000-9999999 - \dodochinesenumberC#1#2\relax#3% - \else\ifnum#1#2<100000000 % 10000000-99999999 - \dodochinesenumberD#1#2\relax#3% - \else\ifnum#1#2<1000000000 % 10000000-99999999 - \dochinesenumber#1\relax#3% - \chinesedigit{100000000}#3% - \dododochinesenumber#2\relax#3% - \else - \dodochinesenumberE#1#2\relax#3% - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} - -\def\dododochinesenumber#1#2\relax#3% - {\ifnum#1=0 - \ifnum0#2>0 \dododochinesenumber#2\relax#3\fi - \else - \dodochinesenumber#1#2\relax#3% - \fi} - -\def\dodochinesenumberA#1\relax#2% - {\ifcase0#1 \else\dodochinesenumber#1\relax#2\fi} - -\def\dodochinesenumberB#1#2#3\relax#4% - {\dochinesenumber#1#2\relax#4% - \chinesedigit{10000}#4% - \dododochinesenumber#3\relax#4} - -\def\dodochinesenumberC#1#2#3#4\relax#5% - {\dochinesenumber#1#2#3\relax#5% - \chinesedigit{10000}#5% - \dododochinesenumber#4\relax#5} - -\def\dodochinesenumberD#1#2#3#4#5\relax#6% - {\dochinesenumber#1#2#3#4\relax#6% - \chinesedigit{10000}#6% - \dododochinesenumber#5\relax#6} - -\def\dodochinesenumberE#1#2#3\relax#4% - {\dochinesenumber#1#2\relax#4% - \chinesedigit{100000000}#4% - \dododochinesenumber#3\relax#4} - -% Capitalized Chinese Number - -\def\capitalizedchinesenumber#1% - {\expandafter\dochinesenumber\number#1\relax*} - -% Extended Chinese Number - -\def\extendedchinesenumber#1% - {\expandafter\doextendedchinesenumber\number#1\relax} - -\def\doextendedchinesenumber#1#2\relax% - {\ifnum #1#2<20 % 0-19 - \dochinesenumber#1#2\relax\empty - \else\ifnum#1#2<30 % 20-29 - \chinesedigit{20}\empty - \ifcase#2\else\chinesedigit{2#2}\fi - \else\ifnum#1#2<40 % 30-39 - \chinesedigit{30}\empty - \ifcase#2\else\chinesedigit{3#2}\fi - \else - \dochinesenumber#1#2\relax\empty - \fi\fi\fi} - -% Arabic Chinese Number - -\def\arabicchinesenumber#1% - {\expandafter\doarabicchinesenumber\number#1@\relax} - -\def\doarabicchinesenumber#1#2\relax - {\if#1@\else - \chinesedigit{#1}\empty - \doarabicchinesenumber#2\relax - \fi} - -% The short call: - -\def\chinesenumber{\normalchinesenumber} - -% \dorecurse{40} -% {\hbox -% {\processingverbatimtrue -% \hbox to 1cm{\hss\recurselevel}\quad -% \hbox to 3cm{\hss\strut\normalchinesenumber {\recurselevel}}\quad -% \hbox to 3cm{\hss\strut\capitalizedchinesenumber{\recurselevel}}\quad -% \hbox to 3cm{\hss\strut\arabicchinesenumber {\recurselevel}}\quad -% \hbox to 3cm{\hss\strut\extendedchinesenumber {\recurselevel}}\crlf}} - -%D The next table demonstates the correctness of the -%D conversion macro. -%D -%D \startbuffer -%D \starttable[|l|l|l|l|l|l|] -%D \HL -%D \NC number \NC converter \NC hard coded \NC -%D number \NC converter \NC hard coded\NC \SR -%D \HL -%D \NC 1 \NC \chinesenumber{1} \NC һ \NC -%D 0 \NC \chinesenumber{0} \NC \NC\FR -%D \NC 11 \NC \chinesenumber{11} \NC ʮһ \NC -%D 10 \NC \chinesenumber{10} \NC ʮ \NC\MR -%D \NC 111 \NC \chinesenumber{111} \NC һһʮһ \NC -%D 100 \NC \chinesenumber{100} \NC һ \NC\MR -%D \NC 101 \NC \chinesenumber{101} \NC һһ \NC -%D 120 \NC \chinesenumber{120} \NC һٶʮ \NC\MR -%D \NC 1111 \NC \chinesenumber{1111} \NC һǧһһʮһ \NC -%D 1000 \NC \chinesenumber{1000} \NC һǧ \NC\MR -%D \NC 1001 \NC \chinesenumber{1001} \NC һǧһ \NC -%D 1020 \NC \chinesenumber{1020} \NC һǧʮ \NC\MR -%D \NC 11111 \NC \chinesenumber{11111} \NC һһǧһһʮһ \NC -%D 10000 \NC \chinesenumber{10000} \NC һ \NC\MR -%D \NC 10001 \NC \chinesenumber{10001} \NC һһ \NC -%D 10200 \NC \chinesenumber{10200} \NC һ \NC\LR -%D \HL -%D \NC 111111 \NC \chinesenumber{111111} \NC ʮһһǧһһʮһ \NC -%D 100000 \NC \chinesenumber{100000} \NC ʮ \NC\FR -%D \NC 1111111 \NC \chinesenumber{1111111} \NC һһʮһһǧһһʮһ \NC -%D 1000000 \NC \chinesenumber{1000000} \NC һ \NC\MR -%D \NC 11111111 \NC \chinesenumber{11111111} \NC һǧһһʮһһǧһһʮһ \NC -%D 10000000 \NC \chinesenumber{10000000} \NC һǧ \NC\MR -%D \NC 111111111 \NC \chinesenumber{111111111} \NC һһǧһһʮһһǧһһʮһ \NC -%D 100000000 \NC \chinesenumber{100000000} \NC һ \NC\MR -%D \NC 1111111111 \NC \chinesenumber{1111111111} \NC ʮһһǧһһʮһһǧһһʮһ \NC -%D 1000000000 \NC \chinesenumber{1000000000} \NC ʮ \NC\LR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \placetable{Some Chinese number examples.}{\getbuffer} - -%D Although the conversion can be hooked into most commands -%D that deal with numbers |<|those familiar with \TEX\ macro -%D programming will notice that the macro if fully -%D expandable|>| in many cases Chinese documents use western -%D digits. So, in practice, the change that the next example -%D shows up, is minimal. -%D -%D \starttabulate[|r|r|c|] -%D \NC 2546 \NC \chinesenumber {2546} \NC \NC\NR -%D \NC 9258 \NC \chinesenumber {9258} \NC $+$ \NC\NR -%D \HL -%D \NC 11804 \NC \chinesenumber {11804} \NC \NC\NR -%D \stoptabulate -%D -%D While in arabic arithmics addition leads to more digits, in -%D Chinese the number of glyphs can (temporary) decrease. -%D Given that the number of people dealing with Chinese is -%D considerably larger than the number of latin speaking -%D people, a successor of \TEX\ definitely must provide a -%D \type {\chinesenumeral} primitive. - -\defineconversion [c] [\normalchinesenumber] -\defineconversion [chinese] [\normalchinesenumber] -\defineconversion [nc] [\normalchinesenumber] -\defineconversion [normalchinese] [\normalchinesenumber] -\defineconversion [cc] [\capitalizedchinesenumber] -\defineconversion [capitalizedchinese] [\capitalizedchinesenumber] -\defineconversion [ec] [\extendedchinesenumber] -\defineconversion [extendedchinese] [\extendedchinesenumber] -\defineconversion [ac] [\arabicchinesenumber] -\defineconversion [arabicchinese] [\arabicchinesenumber] - -%D Date conversion: - -\defineconversion [cn] [\v!day] [\chinesenumber] -\defineconversion [cn] [\v!month] [\chinesenumber] -\defineconversion [cn] [\v!year] [\chinesenumber] - -%D \macros -%D {SimChi, TraChi} -%D -%D These components enable us to construct dedicated Chinese -%D font switches, like: - -\setupunicodefont - [chinese] - [ \c!scale=\chineseunicodescale, - \c!height=\chineseunicodeheight, - \c!depth=\chineseunicodedepth, - \c!strut=\v!yes, - \c!interlinespace=\v!yes, - \c!conversion=\chinesenumber, - \c!commands=\setchineseencoding, % needed for digits - \c!command=\handlechineseunicodeglyph] - -%D For the moment, this encoding is implemented rather ugly. The -%D trick is to move the encoding value from the current font -%D definition to the \type {\chineseencoding} macro. - -\let\chineseencoding\empty - -\def\setchineseencoding % normally SomeChineseRegular - {\getfontfileparameters\unicodestyle - \ifx\currentfontfileencoding\undefined \else - \let\chineseencoding\currentfontfileencoding - \fi} - -%D We could have said: -%D -%D \starttyping -%D \defineunicodefont -%D [SimChi] -%D [SimplifiedChinese] -%D [\c!scale=\chineseunicodescale, -%D \c!height=\chineseunicodeheight, -%D \c!depth=\chineseunicodedepth, -%D \c!conversion=\chinesenumber, -%D \c!commands=\setchineseencoding, % needed for digits -%D \c!command=\handlechineseunicodeglyph] -%D \stoptyping -%D -%D However, the former definitions is more general. Next we -%D map a few fonts: - -\definefontsynonym [SimplifiedChineseRegular] [gbsong] [encoding=gbk] -\definefontsynonym [SimplifiedChineseSlanted] [gbsongsl] [encoding=gbk] -\definefontsynonym [SimplifiedChineseItalic] [gbsongsl] [encoding=gbk] -\definefontsynonym [SimplifiedChineseBold] [gbhei] [encoding=gbk] -\definefontsynonym [SimplifiedChineseBoldSlanted] [gbheisl] [encoding=gbk] -\definefontsynonym [SimplifiedChineseBoldItalic] [gbheisl] [encoding=gbk] - -\definefontsynonym [TraditionalChineseRegular] [b5song] [encoding=big5] -\definefontsynonym [TraditionalChineseSlanted] [b5songsl] [encoding=big5] -\definefontsynonym [TraditionalChineseItalic] [b5songsl] [encoding=big5] -\definefontsynonym [TraditionalChineseBold] [b5hei] [encoding=big5] -\definefontsynonym [TraditionalChineseBoldSlanted] [b5heisl] [encoding=big5] -\definefontsynonym [TraditionalChineseBoldItalic] [b5heisl] [encoding=big5] - -% we need to move this to typescripts - -\doifelse \currentregime {utf} { - - \definefontsynonym [SimplifiedChineseRegular] [ChineseRegular] - \definefontsynonym [SimplifiedChineseSlanted] [ChineseSlanted] - \definefontsynonym [SimplifiedChineseItalic] [ChineseItalic] - \definefontsynonym [SimplifiedChineseBold] [ChineseBold] - \definefontsynonym [SimplifiedChineseBoldSlanted] [ChineseBoldSlanted] - \definefontsynonym [SimplifiedChineseBoldItalic] [ChineseBoldItalic] - - \definefontsynonym [TraditionalChineseRegular] [ChineseRegular] - \definefontsynonym [TraditionalChineseSlanted] [ChineseSlanted] - \definefontsynonym [TraditionalChineseItalic] [ChineseItalic] - \definefontsynonym [TraditionalChineseBold] [ChineseBold] - \definefontsynonym [TraditionalChineseBoldSlanted][ChineseBoldSlanted] - \definefontsynonym [TraditionalChineseBoldItalic] [ChineseBoldItalic] - - \definefontsynonym [ChineseRegular] [uni-htsong-][encoding=cjk-uni] - \definefontsynonym [ChineseSlanted] [uni-htsong-][encoding=cjk-uni] - \definefontsynonym [ChineseItalic] [uni-htsong-][encoding=cjk-uni] - \definefontsynonym [ChineseBold] [uni-hthei-] [encoding=cjk-uni] - \definefontsynonym [ChineseBoldSlanted][uni-hthei-] [encoding=cjk-uni] - \definefontsynonym [ChineseBoldItalic] [uni-hthei-] [encoding=cjk-uni] - - \loadmapfile[uni-htsong.map] - \loadmapfile[uni-htfs.map] - \loadmapfile[uni-hthei.map] - \loadmapfile[uni-htkai.map] - -} { - - \loadmapfile[gbk] - -} - -\defineunicodefont [SimChi] [SimplifiedChinese] [chinese] -\defineunicodefont [TraChi] [TraditionalChinese] [chinese] - -%D We default to these so called Simplified Chinese fonts. - -\SimChi - -%D In addition to these fonts, we (pre|)|define some commonly -%D used fonts: - -\definefontsynonym [SimplifiedChineseSongTiRegular] [gbsong] [encoding=gbk] -\definefontsynonym [SimplifiedChineseSongTiSlanted] [gbsongsl] [encoding=gbk] -\definefontsynonym [SimplifiedChineseSongTiBold] [gbsong] [encoding=gbk] -\definefontsynonym [SimplifiedChineseSongTiBoldSlanted] [gbsongsl] [encoding=gbk] - -\definefontsynonym [TraditionalChineseSongTiRegular] [b5song] [encoding=big5] -\definefontsynonym [TraditionalChineseSongTiSlanted] [b5songsl] [encoding=big5] -\definefontsynonym [TraditionalChineseSongTiBold] [b5song] [encoding=big5] -\definefontsynonym [TraditionalChineseSongTiBoldSlanted] [b5songsl] [encoding=big5] - -\definefontsynonym [SimplifiedChineseHeiTiRegular] [gbhei] [encoding=gbk] -\definefontsynonym [SimplifiedChineseHeiTiSlanted] [gbheisl] [encoding=gbk] -\definefontsynonym [SimplifiedChineseHeiTiBold] [gbhei] [encoding=gbk] -\definefontsynonym [SimplifiedChineseHeiTiBoldSlanted] [gbheisl] [encoding=gbk] - -\definefontsynonym [TraditionalChineseHeiTiRegular] [b5hei] [encoding=big5] -\definefontsynonym [TraditionalChineseHeiTiSlanted] [b5heisl] [encoding=big5] -\definefontsynonym [TraditionalChineseHeiTiBold] [b5hei] [encoding=big5] -\definefontsynonym [TraditionalChineseHeiTiBoldSlanted] [b5heisl] [encoding=big5] - -\definefontsynonym [SimplifiedChineseKaiTiRegular] [gbkai] [encoding=gbk] -\definefontsynonym [SimplifiedChineseKaiTiSlanted] [gbkaisl] [encoding=gbk] -\definefontsynonym [SimplifiedChineseKaiTiBold] [gbkai] [encoding=gbk] -\definefontsynonym [SimplifiedChineseKaiTiBoldSlanted] [gbkaisl] [encoding=gbk] - -\definefontsynonym [TraditionalChineseKaiTiRegular] [b5kai] [encoding=big5] -\definefontsynonym [TraditionalChineseKaiTiSlanted] [b5kaisl] [encoding=big5] -\definefontsynonym [TraditionalChineseKaiTiBold] [b5kai] [encoding=big5] -\definefontsynonym [TraditionalChineseKaiTiBoldSlanted] [b5kaisl] [encoding=big5] - -\definefontsynonym [SimplifiedChineseFangSongRegular] [gbfs] [encoding=gbk] -\definefontsynonym [SimplifiedChineseFangSongSlanted] [gbfssl] [encoding=gbk] -\definefontsynonym [SimplifiedChineseFangSongBold] [gbfs] [encoding=gbk] -\definefontsynonym [SimplifiedChineseFangSongBoldSlanted] [gbfssl] [encoding=gbk] - -\definefontsynonym [TraditionalChineseFangSongRegular] [b5fs] [encoding=big5] -\definefontsynonym [TraditionalChineseFangSongSlanted] [b5fssl] [encoding=big5] -\definefontsynonym [TraditionalChineseFangSongBold] [b5fs] [encoding=big5] -\definefontsynonym [TraditionalChineseFangSongBoldSlanted] [b5fssl] [encoding=big5] - -\definefontsynonym [SimplifiedChineseLiShuRegular] [gbli] [encoding=gbk] -\definefontsynonym [SimplifiedChineseLiShuSlanted] [gblisl] [encoding=gbk] -\definefontsynonym [SimplifiedChineseLiShuBold] [gbli] [encoding=gbk] -\definefontsynonym [SimplifiedChineseLiShuBoldSlanted] [gblisl] [encoding=gbk] - -\definefontsynonym [TraditionalChineseLiShuRegular] [b5li] [encoding=big5] -\definefontsynonym [TraditionalChineseLiShuSlanted] [b5lisl] [encoding=big5] -\definefontsynonym [TraditionalChineseLiShuBold] [b5li] [encoding=big5] -\definefontsynonym [TraditionalChineseLiShuBoldSlanted] [b5lisl] [encoding=big5] - -%D The following definitions provide us the commands to switch -%D to these fonts. - -\defineunicodefont [SimSongTi] [SimplifiedChineseSongTi] [chinese] -\defineunicodefont [TraSongTi] [TraditionalChineseSongTi] [chinese] - -\defineunicodefont [SimHeiTi] [SimplifiedChineseHeiTi] [chinese] -\defineunicodefont [TraHeiTi] [TraditionalChineseHeiTi] [chinese] - -\defineunicodefont [SimKaiTi] [SimplifiedChineseKaiTi] [chinese] -\defineunicodefont [TraKaiTi] [TraditionalChineseKaiTi] [chinese] - -\defineunicodefont [SimFangSong] [SimplifiedChineseFangSong] [chinese] -\defineunicodefont [TraFangSong] [TraditionalChineseFangSong] [chinese] - -\defineunicodefont [SimLiShu] [SimplifiedChineseLiShu] [chinese] -\defineunicodefont [TraLiShu] [TraditionalChineseLiShu] [chinese] - -% \definealternativestyle [ChineseTitleFont] [\bfd\SimKaiTi] [] - -%D \macros -%D {purechinese} -%D -%D Use this macro to suppress spacing around Chinese text. - -\def\purechinese#1% evt geen rek - {\hskip\chineseSsignal\relax - #1\unskip\unskip\unskip - \hskip\chineseSsignal\relax} - -%D \macros -%D {stillchinese} -%D -%D Use the next macro when you want the next item to be put -%D tight to the previous chinese character. - -\def\stillchinese - {\hskip\chineseSsignal\relax} - -%D \macros -%D {nochinese} -%D -%D When we want to be sure of non||Chinese inline text, -%D we can package the for instance english text in \type -%D {\nochinese}. - -\def\nochinese#1% - {\unskip\unskip\unskip - \hskip\chinesesurroundskip - \hskip\chineseinterglyphskip\relax - #1% - \hskip\chineseinterglyphskip\relax - \hskip\chinesesurroundskip - \ignorespaces} - -%D \macros -%D {chisize} -%D -%D Chinese font sizes are specified in a different way, -%D using positive and negative numbers: - -\def\chisize#1% - {\ifnum#11<0 % a trick to catch -0 - \ifcase#1\space36\or24\or18\or15\or12\or9\or\else6.5\fi - \else - \ifcase#1\space42\or26\or22\or16\or14\or10.5\or7.5\or5.5\else5\fi - \fi pt} - -%D So: -%D -%D \startbuffer -%D [\chisize{-1}] [\chisize{7}] [\chisize{+4}] -%D \stopbuffer -%D -%D \typebuffer -%D -%D gives: -%D -%D \getbuffer -%D -%D The full range of sizes is: -%D -%D \starttabulate[|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|] -%D \NC 8 \NC 7 \NC -6 \NC 6 \NC -%D -5 \NC 5 \NC -4 \NC 4 \NC -%D -3 \NC 3 \NC -2 \NC 2 \NC -%D -1 \NC 1 \NC -0 \NC 0 \NC\NR -%D \NC\chisize {8}\NC\chisize{7}\NC\chisize{-6}\NC\chisize{6}\NC -%D \chisize{-5}\NC\chisize{5}\NC\chisize{-4}\NC\chisize{4}\NC -%D \chisize{-3}\NC\chisize{3}\NC\chisize{-2}\NC\chisize{2}\NC -%D \chisize{-1}\NC\chisize{1}\NC\chisize{-0}\NC\chisize{0}\NC\NR -%D \stoptabulate - -%D Now it's time for some real Chinese. This example -%D also shows that font switching is supported. -%D -%D \startnarrower -%D \midaligned{\tfd ˮͷ} -%D \blank -%D \midaligned{\tfb ﵩƪ滳ɡ} -%D \blank -%D \midaligned{\tfb } -%D \blank -%D ¼ʱУѾ졣֪ϹڣϦǺꣿ˷ȥ -%D ֿ¥ߴʤŪӰ˼䣿 -%D \blank -%D ת󣬵ͻߡӦкޣƫʱԲбϣ -%D Բȱ¹ȫԸ˳ãǧﹲ濾ꡣ -%D \stopnarrower -%D -%D The english translation is: -%D -%D \startnarrower -%D \midaligned{\tfd Tune: Prelude to the Melody of Water} -%D \blank -%D \midaligned{\tfb On the night of the Mid||Autumn Festival of -%D 1076, I drank happily till dawn and wrote this in my cups -%D while thinking of Zi||you.} -%D \blank -%D \midaligned{\tfb Su Shi} -%D \blank -%D How long will the bright moon appear? Wine||cup in hand, I -%D ask the sky. I do not know waht time of year it would be -%D tonight in the palace on high. Riding the wind, there I -%D would fly, yet I fear the crystal palace would be far too -%D high and cold for me. I rise and dance, with my shadow I -%D play. On high as on earth, would it be as gay? -%D \blank -%D The moon goes round the mansion red though gauze||draped -%D windows soft to shed her light upon the sleepless bed. -%D Against man she should have no spite. Why then when people -%D part is she oft full and bright? Men have sorrow and joy, -%D they part or meet again; The moon may be bright or dim, she -%D may wax or wane. There has been nothing perfect since the -%D olden days. So let us wish that man will live long as he -%D can! Though miles apart, we'll share the beauty she -%D displays. -%D \stopnarrower - -%D This package is written in the city of Hasselt, a pretty -%D small town in the |<|compared to China real small|>| -%D Netherlands. Like most dutch cities, even this small one -%D has a chinese restaurant, run by chinese, speaking chinese, -%D and |<|indeed|>| writing chinese. Eating there will never -%D be the same, since now I can at least pretend to know the -%D glyphs all around the place. The numbers should pose me no -%D problems, but I fear I will never manage to recognize those -%D scribles they draw on their pads when thay take your order. - -%D To make our lives more easy, we put it here (too): - -\setuptyping[\c!tab=\v!no] - -\protect \endinput diff --git a/tex/context/base/font-chk.lua b/tex/context/base/font-chk.lua index 61f3f8ab5..382f671d8 100644 --- a/tex/context/base/font-chk.lua +++ b/tex/context/base/font-chk.lua @@ -18,6 +18,7 @@ local chardata = characters.data local glyph = node.id('glyph') local traverse_id = node.traverse_id +local remove_node = nodes.remove -- maybe in fonts namespace -- deletion can be option @@ -44,7 +45,7 @@ function fonts.register_message(font,char,message) end end -function checkers.missing(head,tail) +function checkers.missing(head) if checkers.enabled then local lastfont, characters, found = nil, nil, nil for n in traverse_id(glyph,head) do @@ -67,14 +68,9 @@ function checkers.missing(head,tail) end if found and checkers.delete then for i=1,#found do - local n = found[i] - if n == tail then - head, tail = nodes.remove(head,n,true) - else - head, _ = nodes.remove(head,n,true) - end + head = remove_node(head,found[i],true) end end end - return head, tail, false + return head, false end diff --git a/tex/context/base/font-cid.lua b/tex/context/base/font-cid.lua index b8dfc4294..13e9cce89 100644 --- a/tex/context/base/font-cid.lua +++ b/tex/context/base/font-cid.lua @@ -93,6 +93,7 @@ local function locate(registry,ordering,supplement) logs.report("load otf","using cidmap file %s",filename) end fonts.cid.map[filename] = cidmap + cidmap.usedname = file.basename(filename) return cidmap end end diff --git a/tex/context/base/font-col.lua b/tex/context/base/font-col.lua index 5d089fef2..f2ee3f1ae 100644 --- a/tex/context/base/font-col.lua +++ b/tex/context/base/font-col.lua @@ -187,7 +187,7 @@ function collections.message(message) end end -function collections.process(head,tail) +function collections.process(head) if active then local done = false for n in traverse_id(glyph,head) do @@ -211,5 +211,5 @@ function collections.process(head,tail) end end end - return head, tail, done + return head, done end diff --git a/tex/context/base/font-heb.mkii b/tex/context/base/font-heb.mkii new file mode 100644 index 000000000..3ec0395f3 --- /dev/null +++ b/tex/context/base/font-heb.mkii @@ -0,0 +1,5 @@ +\unprotected \writestatus\m!systems{load ARABTEX as a module instead} + +\usemodule[arabtex] + +\endinput diff --git a/tex/context/base/font-heb.tex b/tex/context/base/font-heb.tex deleted file mode 100644 index 3ec0395f3..000000000 --- a/tex/context/base/font-heb.tex +++ /dev/null @@ -1,5 +0,0 @@ -\unprotected \writestatus\m!systems{load ARABTEX as a module instead} - -\usemodule[arabtex] - -\endinput diff --git a/tex/context/base/font-ini.mkii b/tex/context/base/font-ini.mkii index 658d06f70..f614a07cd 100644 --- a/tex/context/base/font-ini.mkii +++ b/tex/context/base/font-ini.mkii @@ -2457,7 +2457,7 @@ \fi \makeshortfilename[\truefilename{\f!fontprefix#2}]% \startreadingfile - \readsysfile\shortfilename + \readsysfile{\shortfilename.mkii} {\showmessage\m!fonts2{#2}} {\showmessage\m!fonts3{#2}}% \stopreadingfile}} @@ -3778,7 +3778,7 @@ %D The implementation is rather straightforward in using %D \type{\halign}. -\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run} +\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run.mkii} %D \macros %D {showfontstrip, testminimalbaseline, showminimalbaseline} @@ -3789,9 +3789,9 @@ %D %D \showfontstrip \blank \showminimalbaseline -\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run} -\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run} -\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run} +\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run.mkii} +\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run.mkii} +\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run.mkii} %D \macros %D {showkerning} @@ -3800,7 +3800,7 @@ %D %D \showkerning{Can you guess what kerning is?} -\fetchruntimecommand \showkerning {\f!fontprefix\s!run} +\fetchruntimecommand \showkerning {\f!fontprefix\s!run.mkii} %D \macros %D {showbodyfontenvironment} @@ -3813,7 +3813,7 @@ %D %D \showsetup{showbodyfontenvironment} -\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run} +\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run.mkii} %D \macros %D {showfont,showfontstyle,showligatures} @@ -3834,11 +3834,11 @@ % to be internationalized -\fetchruntimecommand \showfont {\f!fontprefix\s!run} -\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run} -\fetchruntimecommand \showligature {\f!fontprefix\s!run} -\fetchruntimecommand \showligatures {\f!fontprefix\s!run} -\fetchruntimecommand \showcharratio {\f!fontprefix\s!run} +\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} %D \macros %D {getglyph, symbolicfont} diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv index 5ce6248ea..339e521a9 100644 --- a/tex/context/base/font-ini.mkiv +++ b/tex/context/base/font-ini.mkiv @@ -405,7 +405,7 @@ %D defining it here, we have at least an safeguard for utility %D file reading. -\ifx\uchar\undefined \unexpanded\def\uchar#1#2{[#1,#2]} \fi +\ifdefined\uchar\else \unexpanded\def\uchar#1#2{[#1,#2]} \fi %D We define some (very private) constants to improve speed, %D memory usage and consistency. @@ -459,7 +459,10 @@ %D tests but it does not help us when no math is defined. \chardef\mrfam\zerocount % math regular -\chardef\mbfam\zerocount % math bold +\chardef\mbfam\plusone % math bold + +\unexpanded\def\mr{\ifmmode\fam\zerocount\else\setcurrentfontalternative\c!mr\fi} % \fam\csname\c!mr fam\endcsname +\unexpanded\def\mb{\ifmmode\fam\plusone \else\setcurrentfontalternative\c!mb\fi} % \fam\csname\c!mb fam\endcsname \def\mathtextsuffix {-text} \def\mathscriptsuffix {-script} @@ -508,7 +511,17 @@ \appendtoks \dosetmathfamily\mrfam\c!mr - %\dosetmathfamily\mbfam\c!mb % some day, only when defined, else equivalent to 0 +\to \mathstrategies + +% not official ! + +\chardef\boldmathmode\zerocount % might change ... maybe \mathfontsupport 1 (normal) 2 (bold too) + +\def\enableboldmath {\chardef\boldmathmode\plusone } % todo: \setupbodyfont[boldmath,...] +\def\disableboldmath{\chardef\boldmathmode\zerocount} + +\appendtoks + \ifcase\boldmathmode\or\dosetmathfamily\mbfam\c!mb\fi \to \mathstrategies %D All used styles, like rm, ss and tt, are saved in a comma @@ -825,7 +838,6 @@ \def \defaultfontfile{\truefontname{Normal}} % was cmtt10, but that one is gone \edef\nullfontname {\fontname\nullfont} -\edef\dummyfontname {font\strippedcsname\\} %D \macros %D {everyfont,everyfontswitch} @@ -1082,12 +1094,6 @@ \let\oldrawfontidentifier\rawfontidentifier \let\oldnewfontidentifier\newfontidentifier -% best we can add the style as well because otherwise we get math encoding mixups -% -% \setupbodyfont [8pt] [\currentencoding/\ccaron\scaron\zcaron] -% \blank -% \switchtobodyfont[7pt] [\currentencoding/\ccaron\scaron\zcaron] - \def\newfontidentifier{*\fontclass\lastfontidentifier\fontstyle\fontsize*} \def\dododefinefont#1#2% @@ -1176,7 +1182,7 @@ \let\fontalternativelist\empty \let\fontstylelist \empty -\def\checkfontnamecombinations +\def\checkfontnamecombinations % we need to split math and text here ... todo (math only has mr and mb) {\def\docommand##1% {\def\dodocommand####1% {\def\dododocommand########1{\checkbodyfont{########1}{####1}{##1}}% @@ -1508,7 +1514,7 @@ \doifnumberelse{#1} {\doifassignmentelse{#3} {% [12pt] [style] [settings] - \doifundefined{#2}{\normalexpanded{\noexpand\definefontstyle[#2][#2]}}% new + \ifcsname#2\endcsname\else\normalexpanded{\noexpand\definefontstyle[#2][#2]}\fi % new \processcommalist[#1]{\dododefinebodyfont{#2}{#3}}} {% [12pt] [style] [identifier] \dodefinedefaultbodyfont[#1][#2][#3]}} % body style identifier @@ -1517,10 +1523,14 @@ \else\ifsecondargument \definebodyfont[#1][\c!rm][#2]% \else - \doifundefined{\@size@#1} % Maybe there are default dependancies - {\defineunknownfont{#1}}% defined which we can use ([unknown]) - \doifundefined{\@size@#1} % and if not, then we have at least to - {\definebodyfont[#1][\c!rm][]}% make sure some basics are set up. + % Maybe there are default dependencies defined which we can use ([unknown]) and + % if not, then we have at least to make sure some basics are set up. + \ifcsname\@size@#1\endcsname \else + \defineunknownfont{#1}% + \fi + \ifcsname\@size@#1\endcsname \else + \definebodyfont[#1][\c!rm][]% + \fi \fi\fi} \def\xdodefinebodyfont[#1][#2][#3]% body|identifier style defs|identifier @@ -1588,18 +1598,19 @@ \normalprotected\@EA\fcxdef\csname\fontclass#2#1#3#4#53\endcsname{\noexpand\xxdododefinefont{\number\relativefontsize}{#2}{#2#1#3#4#53}{\normalunexpanded{#6}}}} \def\checkbodyfont#1% tests for ttsl mmbf - {\def\c!!mm{#1}% + {\edef\c!!mm{#1}% \ifx\c!!mm\c!mm % prevents \max and alike (re)defs \expandafter\checkmathbodyfont \else \expandafter\checktextbodyfont \fi{#1}} % no \c!!mm, not expanded later on +% some day we can do an auto-fam if needed + \def\checkmathbodyfont#1#2#3% style alt size / gdef % #3 can be empty {%\message{!m #1 #2 #3!}% % #1 #2 #3 = signal - %unexpanded\setgvalue {#1#2#3}{\setcurrentfontstylealternativesize{#1}{#2}{#3}}% \mmsla - \unexpanded\setgvalue {#2}{\setcurrentfontalternative {#2}}% \sl + %unexpanded\setgvalue {#2}{\setcurrentfontalternative {#2}}% \mr \mb \unexpanded\setgvalue {#1}{\setcurrentfontstyle {#1}}}% \mm \def\checktextbodyfont#1#2#3% style alt size / gdef % #3 can be empty @@ -1619,9 +1630,10 @@ {\def\dododefinedefaultbodyfont##1% {\def\dodododefinedefaultbodyfont####1% {\def\dododododefinedefaultbodyfont########1% - {\doifdefined{\s!default########1####1} - {% [12pt] [style] [identifier] - \getvalue{\s!default########1####1}{##1}{####1}}}% + {\ifcsname\s!default########1####1\endcsname + % [12pt] [style] [identifier] + \csname\s!default########1####1\endcsname{##1}{####1}% + \fi}% \processcommalist[#3]\dododododefinedefaultbodyfont}% \processcommalist[#2]\dodododefinedefaultbodyfont}% \processcommalist[#1]\dododefinedefaultbodyfont} @@ -1643,14 +1655,14 @@ \def\dodefineunknownbodyfont#1#2% see *** {\ifcsname\s!default\s!default#2\endcsname % somehow related to */* \donetrue - \getvalue{\s!default\s!default#2}{#1}{#2}% + \csname\s!default\s!default#2\endcsname{#1}{#2}% \fi} \def\dodefineunknownsubfont#1#2% - {\ifcsname\@size@\getvalue{\??ft#1#2}\endcsname + {\ifcsname\@size@\csname\??ft#1#2\endcsname\endcsname \else \donetrue - \defineunknownfont{\getvalue{\??ft#1#2}}% + \defineunknownfont{\csname\??ft#1#2\endcsname}% \fi} \def\defineunknownfont#1% @@ -1832,27 +1844,32 @@ % can be made faster (only used internally now) \def\doswitchpoints[#1]% - {\normalexpanded{\noexpand\dodoswitchpoints{#1}}} + {\normalexpanded{\dodoswitchpoints{#1}}} -\def\dodoswitchpoints#1% - {\doifundefined{\@size@#1} - {\defineunknownfont{#1}}% +\unexpanded \def\dodoswitchpoints#1% + {\ifcsname\@size@#1\endcsname \else + \defineunknownfont{#1}% + \fi% %\defineunknownfontstyles{#1}% - \doifdefinedelse{\@size@#1} - {\getvalue{\@size@#1}% - \localbodyfontsize#1\relax - \normalizebodyfontsize\localbodyfontsize\to\normalizedbodyfontsize -% \edef\fontbody{\fontbody}% to be tested but we can clean up mkiv further - \checkbodyfontenvironment[\normalizedbodyfontsize]} - {\showmessage\m!fonts4{#1}}} - -\unprotected \def\doswitchstyle[#1]% - {\doifdefinedelse{\@style@#1} - {\getvalue{\@style@#1}% - \edef\fontstyle{#1}% - \ifmmode\mr\fi % in order to be compatible with \rm in math mode - }% \the\everybodyfont} % cleaner, in setting size as well as style - {\showmessage\m!fonts5{#1}}} + \ifcsname\@size@#1\endcsname + \csname\@size@#1\endcsname + \localbodyfontsize#1\relax + \normalizebodyfontsize\localbodyfontsize\to\normalizedbodyfontsize + % \edef\fontbody{\fontbody}% to be tested but we can clean up mkiv further + \checkbodyfontenvironment[\normalizedbodyfontsize]% + \else + \showmessage\m!fonts4{#1}% + \fi} + +\unexpanded \def\doswitchstyle[#1]% + {\ifcsname\@style@#1\endcsname + \csname\@style@#1\endcsname + \edef\fontstyle{#1}% + \ifmmode\mr\fi % in order to be compatible with \rm in math mode + % \the\everybodyfont % cleaner, in setting size as well as style + \else + \showmessage\m!fonts5{#1}% + \fi} %D \TEX\ loads font metric files like \type{cmr10.tfm} and %D \type{tir.tfm} only once. In \PLAIN\ \TEX\ some font files @@ -2450,9 +2467,11 @@ \unexpanded\def\switchtobodyfont[#1]% {\doifsomething{#1} - {\doifdefinedelse{\??ft\normalizedbodyfontsize\interfaced{#1}} - {\setbodyfontstep{#1}} % so we have a fast [small] switch - {\dosetfont0{#1}}% + {\ifcsname\??ft\normalizedbodyfontsize\interfaced{#1}\endcsname + \setbodyfontstep{#1}% so we have a fast [small] switch + \else + \dosetfont0{#1}% + \fi \the\everybodyfont}} % indeed needed in case nothing is executed %D The following alternative is meant for math||to||text @@ -2513,6 +2532,10 @@ [%mode=node,% liga=yes,kern=yes,tlig=yes,trep=yes,onum=yes] % texligatures=yes,texquotes=yes +\definefontfeature % can be used for type1 fonts + [complete] + [liga=yes,kern=yes,compose=yes,tlig=yes,trep=yes] + \definefontfeature [arabic] [mode=node,language=dflt,script=arab,ccmp=yes, @@ -2633,10 +2656,10 @@ \definecomplexorsimple\switchstyleonly \def\simpleswitchstyleonly#1% stupid version - {\complexswitchstyleonly[\strippedcsname#1]} + {\complexswitchstyleonly[\checkedstrippedcsname#1]} \def\complexswitchstyleonly[#1]% todo : check - {\setcurrentfontstyle{\getvalue{\@shortstyle@#1}}% + {\setcurrentfontstyle{\csname\@shortstyle@#1\endcsname}% \the\everybodyfont} % needed ? %D \macros @@ -2814,7 +2837,7 @@ \def\dodefinealternativestyle[#1][#2][#3]% {\def\docommand##1% - {\doifundefined{##1}{\setvalue{##1}{\groupedcommand{#2}{}}}% + {\ifcsname##1\endcsname\else\setvalue{##1}{\groupedcommand{#2}{}}\fi \setvalue{\@letter@ ##1}{#2}% \setvalue{\@noletter@##1}{#3}}% \processcommalist[#1]\docommand} @@ -2947,37 +2970,37 @@ %D or even better: -\def\doemphasistypeface#1#2% slow - {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!slanted - {#1}% - {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!italic - {#2}% - {\doifelsevaluenothing{\??ft\fontclass\normalizedbodyfontsize\c!em} - {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v!slanted - {#1}% - {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v!italic - {#2}% - {\getvalue{\??ft\normalizedbodyfontsize\c!em}}}} - {\getvalue{\??ft\fontclass\normalizedbodyfontsize\c!em}}}}} - -% \def\doemphasistypeface#1#2% -% {\edef\emphasizedtypeface{\csname\??ft\fontclass\normalizedbodyfontsize\c!em\endcsname}% -% \ifx\emphasizedtypeface\v!slanted -% #1% -% \else\ifx\emphasizedtypeface\v!italic -% #2% -% \else\ifx\emphasizedtypeface\v!empty -% \edef\emphasizedtypeface{\csname\??ft\normalizedbodyfontsize\c!em\endcsname}% -% \ifx\emphasizedtypeface\v!slanted -% #1% -% \else\ifx\emphasizedtypeface\v!italic -% #2% -% \else -% \getvalue\emphasizedtypeface -% \fi\fi -% \else -% \getvalue\emphasizedtypeface -% \fi\fi\fi} +% \def\doemphasistypeface#1#2% slow +% {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!slanted +% {#1}% +% {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!italic +% {#2}% +% {\doifelsevaluenothing{\??ft\fontclass\normalizedbodyfontsize\c!em} +% {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v!slanted +% {#1}% +% {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v!italic +% {#2}% +% {\getvalue{\??ft\normalizedbodyfontsize\c!em}}}} +% {\getvalue{\??ft\fontclass\normalizedbodyfontsize\c!em}}}}} + +\def\doemphasistypeface#1#2% + {\edef\emphasizedtypeface{\csname\??ft\fontclass\normalizedbodyfontsize\c!em\endcsname}% + \ifx\emphasizedtypeface\v!slanted + #1% + \else\ifx\emphasizedtypeface\v!italic + #2% + \else\ifx\emphasizedtypeface\v!empty + \edef\emphasizedtypeface{\csname\??ft\normalizedbodyfontsize\c!em\endcsname}% + \ifx\emphasizedtypeface\v!slanted + #1% + \else\ifx\emphasizedtypeface\v!italic + #2% + \else + \getvalue\emphasizedtypeface + \fi\fi + \else + \getvalue\emphasizedtypeface + \fi\fi\fi} \def\emphasistypeface{\doemphasistypeface\sl\it} \def\emphasisboldface{\doemphasistypeface\bs\bi} @@ -3182,7 +3205,7 @@ %D The implementation is rather straightforward in using %D \type{\halign}. -\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run} +\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run.mkii} %D \macros %D {showfontstrip, testminimalbaseline, showminimalbaseline} @@ -3193,9 +3216,9 @@ %D %D \showfontstrip \blank \showminimalbaseline -\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run} -\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run} -\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run} +\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run.mkii} +\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run.mkii} +\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run.mkii} %D \macros %D {showkerning} @@ -3204,7 +3227,7 @@ %D %D \showkerning{Can you guess what kerning is?} -\fetchruntimecommand \showkerning {\f!fontprefix\s!run} +\fetchruntimecommand \showkerning {\f!fontprefix\s!run.mkii} %D \macros %D {showbodyfontenvironment} @@ -3217,7 +3240,7 @@ %D %D \showsetup{showbodyfontenvironment} -\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run} +\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run.mkii} %D \macros %D {showfont,showfontstyle,showligatures} @@ -3233,11 +3256,11 @@ % to be internationalized -\fetchruntimecommand \showfont {\f!fontprefix\s!run} -\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run} -\fetchruntimecommand \showligature {\f!fontprefix\s!run} -\fetchruntimecommand \showligatures {\f!fontprefix\s!run} -\fetchruntimecommand \showcharratio {\f!fontprefix\s!run} +\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} %D \macros %D {getglyph, symbolicfont} @@ -3746,7 +3769,7 @@ \def\dodefinestyleinstance[#1][#2][#3][#4]% [name] [rm|ss|tt|..] [sl|bf|...] [whatever] {\iffirstargument - \doifundefined{#1}{\definestylecollection[#1]}% + \ifcsname#1\endcsname\else\definestylecollection[#1]\fi \fi \iffourthargument \setvalue{\??sx#1:#2:#3}{#4}% @@ -3756,7 +3779,7 @@ \letvalue{\??sx#1::#2}\empty \fi\fi\fi} -\unexpanded\def\styleinstance[#1]% will be faster +\unexpanded\def\styleinstance[#1]% will be made faster {%\begingroup\normalexpanded{\noexpand\infofont[#1:\fontstyle:\fontalternative]}\endgroup \executeifdefined{\??sx#1:\fontstyle:\fontalternative}% {\executeifdefined{\??sx#1:\fontstyle:\s!default}% diff --git a/tex/context/base/font-jap.mkii b/tex/context/base/font-jap.mkii new file mode 100644 index 000000000..42480df43 --- /dev/null +++ b/tex/context/base/font-jap.mkii @@ -0,0 +1,83 @@ +%D \module +%D [ file=font-jap, +%D version=2006.01.13, +%D title=\CONTEXT\ Font Macros, +%D subtitle=Japanese, +%D author=Hans Hagen, +%D date=\currentdate, +%D suggestions=Wang Lei, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifx\handlejapaneseunicodeglyph\undefined \else \endinput \fi +\ifx\handlechineseunicodeglyph \undefined \input font-chi.tex \fi + +\writestatus{loading}{ConTeXt Font Macros / Japanese} + +\unprotect + +\newif\iftracejapanese + +\let\japaneseencoding\empty + +\def\setjapaneseencoding + {\getfontfileparameters\unicodestyle + \ifx\currentfontfileencoding\undefined \else + \let\japaneseencoding\currentfontfileencoding + \fi} + +\def\japaneseunicodescale {\chineseunicodescale } +\def\japaneseunicodeheight {\chineseunicodeheight } +\def\japaneseunicodedepth {\chineseunicodedepth } +\def\japaneseinterglyphskip{\chineseinterglyphskip} +\def\japanesesurroundskip {\chinesesurroundskip } + +\setupunicodefont + [japanese] + [ \c!scale=\japaneseunicodescale, + \c!height=\japaneseunicodeheight, + \c!depth=\japaneseunicodedepth, + \c!strut=\v!yes, + \c!interlinespace=\v!yes, + \c!conversion=\japanesenumber, + \c!commands=\setjapaneseencoding, % needed for digits + \c!command=\handlejapaneseunicodeglyph] + +\def\japanesenumber{\numbers} + +\def\handlejapaneseunicodeglyph + {\begingroup +% \let\chineseunicodescale \japaneseunicodescale +% \let\chineseunicodeheight \japaneseunicodeheight +% \let\chineseunicodedepth \japaneseunicodedepth +% \let\chineseinterglyphskip\japaneseinterglyphskip +% \let\chinesesurroundskip \japanesesurroundskip + \iftracejapanese\tracechinesetrue\else\tracechinesefalse\fi + \handlechineseunicodeglyph + \endgroup} + +\doifelse \currentregime {utf} { + + % todo: typescripts + + \definefontsynonym [JapaneseRegular] [uni-cybercjk-][encoding=cjk-uni] + \definefontsynonym [JapaneseSlanted] [uni-cybercjk-][encoding=cjk-uni] + \definefontsynonym [JapaneseItalic] [uni-cybercjk-][encoding=cjk-uni] + \definefontsynonym [JapaneseBold] [uni-cybercjk-][encoding=cjk-uni] + \definefontsynonym [JapaneseBoldSlanted][uni-cybercjk-][encoding=cjk-uni] + \definefontsynonym [JapaneseBoldItalic] [uni-cybercjk-][encoding=cjk-uni] + + \loadmapfile[uni-cybercjk.map] + + \defineunicodefont [Japanese] [Japanese] [japanese] + +} { + \writestatus{Japanese}{No fonts defined} +} + +\Japanese + +\protect \endinput diff --git a/tex/context/base/font-jap.tex b/tex/context/base/font-jap.tex deleted file mode 100644 index 42480df43..000000000 --- a/tex/context/base/font-jap.tex +++ /dev/null @@ -1,83 +0,0 @@ -%D \module -%D [ file=font-jap, -%D version=2006.01.13, -%D title=\CONTEXT\ Font Macros, -%D subtitle=Japanese, -%D author=Hans Hagen, -%D date=\currentdate, -%D suggestions=Wang Lei, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifx\handlejapaneseunicodeglyph\undefined \else \endinput \fi -\ifx\handlechineseunicodeglyph \undefined \input font-chi.tex \fi - -\writestatus{loading}{ConTeXt Font Macros / Japanese} - -\unprotect - -\newif\iftracejapanese - -\let\japaneseencoding\empty - -\def\setjapaneseencoding - {\getfontfileparameters\unicodestyle - \ifx\currentfontfileencoding\undefined \else - \let\japaneseencoding\currentfontfileencoding - \fi} - -\def\japaneseunicodescale {\chineseunicodescale } -\def\japaneseunicodeheight {\chineseunicodeheight } -\def\japaneseunicodedepth {\chineseunicodedepth } -\def\japaneseinterglyphskip{\chineseinterglyphskip} -\def\japanesesurroundskip {\chinesesurroundskip } - -\setupunicodefont - [japanese] - [ \c!scale=\japaneseunicodescale, - \c!height=\japaneseunicodeheight, - \c!depth=\japaneseunicodedepth, - \c!strut=\v!yes, - \c!interlinespace=\v!yes, - \c!conversion=\japanesenumber, - \c!commands=\setjapaneseencoding, % needed for digits - \c!command=\handlejapaneseunicodeglyph] - -\def\japanesenumber{\numbers} - -\def\handlejapaneseunicodeglyph - {\begingroup -% \let\chineseunicodescale \japaneseunicodescale -% \let\chineseunicodeheight \japaneseunicodeheight -% \let\chineseunicodedepth \japaneseunicodedepth -% \let\chineseinterglyphskip\japaneseinterglyphskip -% \let\chinesesurroundskip \japanesesurroundskip - \iftracejapanese\tracechinesetrue\else\tracechinesefalse\fi - \handlechineseunicodeglyph - \endgroup} - -\doifelse \currentregime {utf} { - - % todo: typescripts - - \definefontsynonym [JapaneseRegular] [uni-cybercjk-][encoding=cjk-uni] - \definefontsynonym [JapaneseSlanted] [uni-cybercjk-][encoding=cjk-uni] - \definefontsynonym [JapaneseItalic] [uni-cybercjk-][encoding=cjk-uni] - \definefontsynonym [JapaneseBold] [uni-cybercjk-][encoding=cjk-uni] - \definefontsynonym [JapaneseBoldSlanted][uni-cybercjk-][encoding=cjk-uni] - \definefontsynonym [JapaneseBoldItalic] [uni-cybercjk-][encoding=cjk-uni] - - \loadmapfile[uni-cybercjk.map] - - \defineunicodefont [Japanese] [Japanese] [japanese] - -} { - \writestatus{Japanese}{No fonts defined} -} - -\Japanese - -\protect \endinput diff --git a/tex/context/base/font-map.lua b/tex/context/base/font-map.lua index 35cfaf32f..c597d4855 100644 --- a/tex/context/base/font-map.lua +++ b/tex/context/base/font-map.lua @@ -6,13 +6,16 @@ if not modules then modules = { } end modules ['font-map'] = { license = "see context related readme files" } -local match, format, find = string.match, string.format, string.find +local match, format, find, concat = string.match, string.format, string.find, table.concat + +local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end) local ctxcatcodes = tex.ctxcatcodes --[[ldx--

Eventually this code will disappear because map files are kind of obsolete. Some code may move to runtime or auxiliary modules.

+

The name to unciode related code will stay of course.

--ldx]]-- fonts = fonts or { } @@ -123,3 +126,93 @@ function fonts.map.load_file(filename, entries, encodings) end return entries, encodings end + +function fonts.map.load_lum_table(filename) + local lumname = file.replacesuffix(file.basename(filename),"lum") + local lumfile = resolvers.find_file(lumname,"map") or "" + if lumfile ~= "" and lfs.isfile(lumfile) then + if trace_loading or trace_unimapping then + logs.report("load otf","enhance: loading %s ",lumfile) + end + lumunic = dofile(lumfile) + return lumunic, lumfile + end +end + +local hex = lpeg.R("AF","09") +local hexfour = (hex*hex*hex*hex) / function(s) return tonumber(s,16) end +local dec = (lpeg.R("09")^1) / tonumber +local period = lpeg.P(".") + +local unicode = lpeg.P("uni") * (hexfour * (period + lpeg.P(-1)) * lpeg.Cc(false) + lpeg.Ct(hexfour^1) * lpeg.Cc(true)) +local index = lpeg.P("index") * dec * lpeg.Cc(false) + +local parser = unicode + index + +local parsers = { } + +function fonts.map.make_name_parser(str) + if not str or str == "" then + return parser + else + local p = parsers[str] + if not p then + p = lpeg.P(str) * period * dec * lpeg.Cc(false) + parsers[str] = p + end + return p + end +end + +--~ local parser = fonts.map.make_name_parser("Japan1") +--~ local function test(str) +--~ local b, a = parser:match(str) +--~ print((a and table.serialize(b)) or b) +--~ end +--~ test("uni1234") +--~ test("uni1234.xx") +--~ test("uni12349876") +--~ test("index1234") +--~ test("Japan1.123") + +function fonts.map.tounicode16(unicode) + if unicode < 0x10000 then + return format("%04X",unicode) + else + return format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) + end +end + +function fonts.map.tounicode16sequence(unicodes) + local t = { } + for l=1,#unicodes do + local unicode = unicodes[l] + if unicode < 0x10000 then + t[l] = format("%04X",unicode) + else + t[l] = format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) + end + end + return concat(t) +end + +--~ This is quite a bit faster but at the cost of some memory but if we +--~ do this we will also use it elsewhere so let's not follow this route +--~ now. I might use this method in the plain variant (no caching there) +--~ but then I need a flag that distinguishes between code branches. +--~ +--~ local cache = { } +--~ +--~ function fonts.map.tounicode16(unicode) +--~ local s = cache[unicode] +--~ if not s then +--~ if unicode < 0x10000 then +--~ s = format("%04X",unicode) +--~ else +--~ s = format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) +--~ end +--~ cache[unicode] = s +--~ end +--~ return s +--~ end + diff --git a/tex/context/base/font-mis.lua b/tex/context/base/font-mis.lua index 520f9e7a6..cc20b9711 100644 --- a/tex/context/base/font-mis.lua +++ b/tex/context/base/font-mis.lua @@ -11,7 +11,7 @@ local lower, strip = string.lower, string.strip fonts.otf = fonts.otf or { } -fonts.otf.version = fonts.otf.version or 2.626 +fonts.otf.version = fonts.otf.version or 2.628 fonts.otf.pack = true fonts.otf.cache = containers.define("fonts", "otf", fonts.otf.version, true) diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index 00ac596cc..f3b3f5481 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -12,12 +12,13 @@ local concat, getn, utfbyte = table.concat, table.getn, utf.byte local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip local type, next, tonumber, tostring = type, next, tonumber, tostring -local trace_private = false trackers.register("otf.private", function(v) trace_private = v end) -local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end) -local trace_features = false trackers.register("otf.features", function(v) trace_features = v end) -local trace_dynamics = false trackers.register("otf.dynamics", function(v) trace_dynamics = v end) -local trace_sequences = false trackers.register("otf.sequences", function(v) trace_sequences = v end) -local trace_math = false trackers.register("otf.math", function(v) trace_math = v end) +local trace_private = false trackers.register("otf.private", function(v) trace_private = v end) +local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end) +local trace_features = false trackers.register("otf.features", function(v) trace_features = v end) +local trace_dynamics = false trackers.register("otf.dynamics", function(v) trace_dynamics = v end) +local trace_sequences = false trackers.register("otf.sequences", function(v) trace_sequences = v end) +local trace_math = false trackers.register("otf.math", function(v) trace_math = v end) +local trace_unimapping = false trackers.register("otf.unimapping", function(v) trace_unimapping = v end) --~ trackers.enable("otf.loading") @@ -81,7 +82,7 @@ otf.features.default = otf.features.default or { } otf.enhancers = otf.enhancers or { } otf.glists = { "gsub", "gpos" } -otf.version = 2.626 -- beware: also sync font-mis.lua +otf.version = 2.628 -- beware: also sync font-mis.lua otf.pack = true -- beware: also sync font-mis.lua otf.syncspace = true otf.notdef = false @@ -464,15 +465,18 @@ otf.enhancers["analyse marks"] = function(data,filename) end end -local other = lpeg.C((1 - lpeg.S("_."))^0) -local ligsplitter = lpeg.Ct(other * (lpeg.P("_") * other)^0) +local separator = lpeg.S("_.") +local other = lpeg.C((1 - separator)^1) +local ligsplitter = lpeg.Ct(other * (separator * other)^0) ---~ print(splitter:match("this")) ---~ print(splitter:match("this.that")) ---~ print(splitter:match("such_so_more")) ---~ print(splitter:match("such_so_more.that")) +--~ print(table.serialize(ligsplitter:match("this"))) +--~ print(table.serialize(ligsplitter:match("this.that"))) +--~ print(table.serialize(ligsplitter:match("japan1.123"))) +--~ print(table.serialize(ligsplitter:match("such_so_more"))) +--~ print(table.serialize(ligsplitter:match("such_so_more.that"))) otf.enhancers["analyse unicodes"] = function(data,filename) + local tounicode16, tounicode16sequence = fonts.map.tounicode16, fonts.map.tounicode16sequence local unicodes = data.luatex.unicodes -- we need to move this code unicodes['space'] = unicodes['space'] or 32 -- handly later on @@ -482,53 +486,113 @@ otf.enhancers["analyse unicodes"] = function(data,filename) -- the tounicode mapping is sparse and only needed for alternatives local tounicode, originals, ns, nl, private, unknown = { }, { }, 0, 0, fonts.private, format("%04X",utfbyte("?")) data.luatex.tounicode, data.luatex.originals = tounicode, originals + local lumunic, uparser, oparser + if false then -- will become an option + lumunic = fonts.map.load_lum_table(filename) + lumunic = lumunic and lumunic.tounicode + end + local cidinfo, cidnames, cidcodes = data.cidinfo + local usedmap = cidinfo and cidinfo.usedname + usedmap = usedmap and fonts.cid.map[usedmap] + if usedmap then + oparser = usedmap and fonts.map.make_name_parser(cidinfo.ordering) + cidnames = usedmap.names + cidcodes = usedmap.unicodes + end + uparser = fonts.map.make_name_parser() for index, glyph in next, data.glyphs do local name, unic = glyph.name, glyph.unicode or -1 -- play safe if unic == -1 or unic >= private or (unic >= 0xE000 and unic <= 0xF8FF) or unic == 0xFFFE or unic == 0xFFFF then - -- a.whatever or a_b_c.whatever or a_b_c - local split = ligsplitter:match(name) - if #split == 0 then - -- skip - elseif #split == 1 then - local u = unicodes[split[1]] - if u then - if type(u) == "table" then - u = u[1] - end - if u < 0x10000 then - originals[index], tounicode[index] = u, format("%04X",u) - else - originals[index], tounicode[index] = u, format("%04X%04X",u/1024+0xD800,u%1024+0xDC00) + local unicode = lumunic and lumunic[name] + if unicode then + originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1 + end + -- cidmap heuristics, beware, there is no guarantee for a match unless + -- the chain resolves + if not unicode and usedmap then + local foundindex = oparser:match(name) + if foundindex then + unicode = cidcodes[foundindex] -- name to number + if not unicode then + local reference = cidnames[foundindex] -- number to name + if reference then + local foundindex = oparser:match(reference) + if foundindex then + unicode = cidcodes[foundindex] + if unicode then + originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1 + end + end + if not unicode then + local foundcodes, multiple = uparser:match(reference) + if foundcodes then + if multiple then + originals[index], tounicode[index], nl, unicode = foundcodes, tounicode16sequence(foundcodes), nl + 1, true + else + originals[index], tounicode[index], ns, unicode = foundcodes, tounicode16(foundcodes), ns + 1, foundcodes + end + end + end + end end - ns = ns + 1 - else - originals[index], tounicode[index] = 0xFFFD, "FFFD" end - else - local as = { } - for l=1,#split do - local u = unicodes[split[l]] - if not u then - as[l], split[l] = 0xFFFD, "FFFD" - else - if type(u) == "table" then - u = u[1] + end + -- a.whatever or a_b_c.whatever or a_b_c (no numbers) + if not unicode then + local split = ligsplitter:match(name) + local nplit = (split and #split) or 0 + if nplit == 0 then + -- skip + elseif nplit == 1 then + unicode = unicodes[split[1]] + if unicode then + if type(unicode) == "table" then + unicode = unicode[1] end - if u < 0x10000 then - as[l], split[l] = u, format("%04X",u) + originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1 + end + else + local done = true + for l=1,nplit do + local u = unicodes[split[l]] + if not u then + done = false + break + elseif type(u) == "table" then + split[l] = u[1] else - as[l], split[l] = u, format("%04X%04X",u/1024+0xD800,u%1024+0xDC00) + split[l] = u end end + if done then + originals[index], tounicode[index], nl, unicode = split, tounicode16sequence(split), nl + 1, true + end end - split = concat(split) - if split ~= "" then - originals[index], tounicode[index] = as, split - nl = nl + 1 - else - originals[index], tounicode[index] = 0xFFFD, "FFFD" + end + -- last resort + if not unicode then + local foundcodes, multiple = uparser:match(name) + if foundcodes then + if multiple then + originals[index], tounicode[index], nl, unicode = foundcodes, tounicode16sequence(foundcodes), nl + 1, true + else + originals[index], tounicode[index], ns, unicode = foundcodes, tounicode16(foundcodes), ns + 1, foundcodes + end end end + if not unicode then + originals[index], tounicode[index] = 0xFFFD, "FFFD" + end + end + end + if trace_unimapping then + for index, glyph in table.sortedpairs(data.glyphs) do + local toun, name, unic = tounicode[index], glyph.name, glyph.unicode or -1 -- play safe + if toun then + logs.report("load otf","internal: 0x%05X, name: %s, unicode: 0x%05X, tounicode: %s",index,name,unic,toun) + else + logs.report("load otf","internal: 0x%05X, name: %s, unicode: 0x%05X",index,name,unic) + end end end if trace_loading and (ns > 0 or nl > 0) then @@ -546,16 +610,14 @@ otf.enhancers["analyse subtables"] = function(data,filename) for _, g in next, { data.gsub, data.gpos } do for k=1,#g do local gk = g[k] - -local typ = gk.type -if typ == "gsub_contextchain" or typ == "gpos_contextchain" then - gk.chain = 1 -elseif typ == "gsub_reversecontextchain" or typ == "gpos_reversecontextchain" then - gk.chain = -1 -else - gk.chain = 0 -end - + local typ = gk.type + if typ == "gsub_contextchain" or typ == "gpos_contextchain" then + gk.chain = 1 + elseif typ == "gsub_reversecontextchain" or typ == "gpos_reversecontextchain" then + gk.chain = -1 + else + gk.chain = 0 + end local features = gk.features if features then sequences[#sequences+1] = gk @@ -610,8 +672,9 @@ otf.enhancers["merge cid fonts"] = function(data,filename) local cidinfo = data.cidinfo local verbose = fonts.verbose if cidinfo.registry then - local cidmap = fonts.cid.getmap and fonts.cid.getmap(cidinfo.registry,cidinfo.ordering,cidinfo.supplement) + local cidmap, cidname = fonts.cid.getmap(cidinfo.registry,cidinfo.ordering,cidinfo.supplement) if cidmap then + cidinfo.usedname = cidmap.usedname local glyphs, uni_to_int, int_to_uni, nofnames, nofunicodes = { }, { }, { }, 0, 0 local unicodes, names = cidmap.unicodes, cidmap.names for n, subfont in next, data.subfonts do @@ -1343,7 +1406,7 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th } -- indices maps from unicodes to indices for u, i in next, indices do - characters[u] = { } -- we need this because for instance we add protruding info + characters[u] = { } -- we need this because for instance we add protruding info and loop over characters descriptions[u] = glyphs[i] end -- math diff --git a/tex/context/base/font-otn.lua b/tex/context/base/font-otn.lua index 719c0ca80..3c11b84f1 100644 --- a/tex/context/base/font-otn.lua +++ b/tex/context/base/font-otn.lua @@ -150,7 +150,7 @@ trackers.register("*otf.sample","otf.steps,otf.actions,otf.analyzing") local insert_node_after = node.insert_after local delete_node = nodes.delete local copy_node = node.copy -local slide_node_list = node.slide +local find_node_tail = node.tail or node.slide local set_attribute = node.set_attribute local has_attribute = node.has_attribute @@ -1905,7 +1905,7 @@ function fonts.methods.node.otf.features(head,font,attr) local handler = handlers[typ] local thecache = featuredata[typ] or { } -- we need to get rid of this slide ! - start = slide_node_list(head) -- slow (we can store tail because there's always a skip at the end): todo + start = find_node_tail(head) -- slow (we can store tail because there's always a skip at the end): todo while start do local id = start.id if id == glyph then diff --git a/tex/context/base/font-run.mkii b/tex/context/base/font-run.mkii new file mode 100644 index 000000000..0a0ddd057 --- /dev/null +++ b/tex/context/base/font-run.mkii @@ -0,0 +1,326 @@ +%D \module +%D [ file=font-run, +%D version=1998.09.11, % (second) +%D version=2001.02.20, % (third) +%D title=\CONTEXT\ Font Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 code is hooked into the core macros and saves some +%D format space.] + +\unprotect + +\gdef\@@onlyenglish#1% + {\blank{\tttf \type {#1} is only available in the english interface}\blank} + +\gdef\dosetshowfonttitle#1% + {\tabskip\zeropoint + \parindent\zeropoint + \setlocalhsize + \doifelsenothing{#1} + {\def\title{[\the\bodyfontsize]}} + {\switchtobodyfont[#1]\def\title{[#1]}} + \doifsomething\fontclass + {\doifnot{[\fontclass]}\title + {\edef\title{[\fontclass]\space\title}}}} + +\gdef\showbodyfont + {\dosingleempty\doshowbodyfont} + +\gdef\doshowbodyfont[#1]% + {\ifinsidefloat\else\startbaselinecorrection\fi + \vbox + {\dosetshowfonttitle{#1}% + \def\bigstrut##1##2% + {\hbox{\vrule + \!!height##1\strutht + \!!depth ##2\strutdp + \!!width \zeropoint}} + \def\next##1##2##3% + {&&##1&&##2\tf##3&&##2\sc##3% + &&##2\sl##3&&##2\it##3&&##2\bf##3&&##2\bs##3&&##2\bi##3% + &&##2\tfx##3&&##2\tfxx##3% + &&##2\tfa##3&&##2\tfb##3&&##2\tfc##3&&##2\tfd##3&\cr}% + \halign to \localhsize + {\bigstrut{1.5}{2}##&\vrule## + \tabskip=\!!zeropoint \!!plus 1fill + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule + \tabskip=\!!zeropoint\cr + \noalign{\hrule} + &\multispan{29}{\vrule\hfil\tttf\strut\title\hfil + \llap{\string\mr\hbox to 1em{\hss:\hss}$\mr \languageparameter\c!text$\quad}\vrule}\cr + \noalign{\hrule}\next{}{\tt\string}{} + \noalign{\hrule}\next{\tt\string\rm}\rm{\languageparameter\c!text} + \noalign{\hrule}\next{\tt\string\ss}\ss{\languageparameter\c!text} + \noalign{\hrule}\next{\tt\string\tt}\tt{\languageparameter\c!text} + \noalign{\hrule}}} + \ifinsidefloat\else\stopbaselinecorrection\fi} + +\gdef\showbodyfontenvironment + {\dosingleempty\doshowbodyfontenvironment} + +\gdef\doshowbodyfontenvironment[#1]% + {\ifinsidefloat\else\startbaselinecorrection\fi + \vbox + {\dosetshowfonttitle{#1}% + \def\next##1% + {&&\getvalue{\bodyfontvariable{##1\s!text}}% + &&\getvalue{\bodyfontvariable{##1\s!script}}% + &&\getvalue{\bodyfontvariable{##1\s!scriptscript}}% + &&\getvalue{\bodyfontvariable{##1\c!x}}% + &&\getvalue{\bodyfontvariable{##1\c!xx}}% + &&\getvalue{\bodyfontvariable{##1\interfaced\v!small}}% + &&\getvalue{\bodyfontvariable{##1\interfaced\v!big}}% + &&\edef\next{\getvalue{\bodyfontvariable{##1\c!interlinespace}}}\ifx\next\empty not set\else\next\fi&\cr + \noalign{\hrule}} + \halign to \localhsize + {##&\vrule##\strut + \tabskip=\!!zeropoint \!!plus 1fill + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule + \tabskip\zeropoint\cr + \noalign{\hrule} + &\multispan{17}{\vrule\hfil\tttf\strut\title\hfil}\vrule\cr + \noalign{\hrule} + &&\tttf\tx\s!text&&\tttf\tx\s!script&&\tttf\tx\s!scriptscript + &&\tttf\tx\c!x&&\tttf\tx\c!xx&&\tttf\tx\v!small&&\tttf\tx\v!big + &&\tttf\tx\c!interlinespace&\cr + \noalign{\hrule} + \@EA\globalprocesscommalist\@EA[\bodyfontenvironmentlist]\next}} + \ifinsidefloat\else\stopbaselinecorrection\fi} + +\gdef\showfont + {\dodoubleempty\doshowfont} + +\gdef\doshowfont[#1][#2]% + {\bgroup + \boxrulewidth=.1pt + \setupcolors[\c!state=\v!local]% + \iffirstargument + \definefont[\s!dummy][#1]\dummy + \else\ifdim2.5em>.05\hsize \tx + \ifdim2.5em>.05\hsize \txx + \fi\fi\fi + \ifinsidefloat\else\startbaselinecorrection\fi + \vbox\bgroup + \forgetall + \startoverlay + {\vbox + {\tf \setstrut \dummy + \localcolortrue \offinterlineskip + \dostepwiserecurse{0}{15}{1} + {\let\row\recurselevel + \hbox + {\red + \dostepwiserecurse{0}{15}{1} + {\let\col\recurselevel + \@EA\scratchcounter\normaldblquote\hexnumber\row\hexnumber\col\relax + \edef\rowcol{\the\scratchcounter}% + \iffontchar\font\scratchcounter + \setbox\scratchbox\ruledhbox{\black\char\scratchcounter}% + \ifdim\wd\scratchbox>\zeropoint + \donetrue \else \donefalse + \fi + \else + \setbox\scratchbox\hbox{\gray\vrule\!!width1ex\!!height.5ex\!!depth.5ex}% + \fi + \startoverlay + {\tf\vbox to 2.5em + {\vss + \hbox to 2.5em + {\dummy\ifdim\interwordspace=\zeropoint + \setbox\scratchbox\hbox + {\raise.5\dp\scratchbox\hbox + {\lower.5\ht\scratchbox\copy\scratchbox}}% + \ht\scratchbox\zeropoint + \dp\scratchbox\zeropoint + \else + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \strut + \fi + \hss\copy\scratchbox\hss} + \vss}} + {\tf\vbox to 2.3em + {\ifdone + \hsize2.4em + \blue + \edef\theshowfontspecs + {\ifnum\hyphenchar\font=\rowcol hyph\else + \ifnum\skewchar \font=\rowcol skew\fi\fi}% + \tinyfont % after \edef, else wrong font analyzed + \doifnot\v!unknown{#2}{{\red\theshowfontspecs}}\hfill\number\rowcol + \vfill + \octnumber\rowcol\hfill\lchexnumbers\rowcol + \par + \fi}} + \stopoverlay}}} + \par}} + {\tf\basegrid[\c!nx=16,\c!ny=16,\c!dx=2.5,\c!dy=2.5,\c!unit=em]} + \stopoverlay + \nointerlineskip + \vskip2pt + % the \noexpand before \blank is needed for non etex + \edef\ascii{name: {\noexpand\black\fontname\font}} + \def\do##1##2{\ifx##1\undefined\else\ifx##1\empty\else##2\fi\fi}% + \doifelse\v!unknown{#2} + {\edef\theshowfontspecs + {name: {\noexpand\black\fontname\font}}} + {\edef\theshowfontspecs + {name: {\noexpand\black\fontname\font}\noexpand\quad + \do\currentencoding{encoding: {\noexpand\black\currentencoding\noexpand\quad}}% + \do\currentmapping {mapping: {\noexpand\black\currentmapping \noexpand\quad}}% + \do\fonthandling {handling: {\noexpand\black\fonthandling }}}}% + \tf % also sets em + \hbox to 40em{\blue\hfill\tinyfont\setstrut\strut\theshowfontspecs} + \egroup + \ifinsidefloat\else\stopbaselinecorrection\fi + \egroup} + +\gdef\showfontstyle + {\dotripleempty\doshowfontstyle} + +\gdef\doshowfontstyle[#1][#2][#3]% + {\ifthirdargument + \bgroup + \raggedright + \switchtobodyfont[#1] + \def\dodocommand##1##2% + {\starttextrule{\tttf #1 ##1 ##2} + \nobreak \getvalue{##2}% + \dorecurse{255} + {\iffontchar\font\recurselevel\relax + \char\recurselevel\relax\space + \fi} + \par \nobreak + \stoptextrule} + \def\docommand##1% + {\getvalue{##1}\processcommacommand[#3]{\dodocommand{##1}}} + \processcommalist[#2]\docommand + \egroup + \else\ifsecondargument + \showfontstyle[#1][#2][\fontalternativelist]% math is gone + \else + \showfontstyle[#1][\c!rm]\showfontstyle[#1][\c!ss] + \showfontstyle[#1][\c!tt]\showfontstyle[#1][\c!mm] + \fi\fi} + +\gdef\showligature#1% + {\hbox{\type{#1}\enspace\red\ruledhbox{\black#1}}} + +\gdef\showligatures[#1]% + {\ifx\starttabulate\undefined + \@@onlyenglish\showligatures + \else + \bgroup + \setupcolors[\c!state=\v!local]% + \def\show##1{\hbox{\red\ruledhbox{\black##1}}}% + \definefont[\s!dummy][#1]\dummy + \starttabulate[|*{9}{c|}] + \NC\type{ff}\NC\type{fi}\NC\type{fl}\NC\type{ffi}\NC\type{ffl}\NC + \type{``}\NC\type{''}\NC\type{--}\NC\type{---}\NC\NR + \NC\show{ff}\NC\show{fi}\NC\show{fl}\NC\show{ffi}\NC\show{ffl}\NC + \show{``}\NC\show{''}\NC\show{--}\NC\show{---}\NC\NR + \stoptabulate + \egroup + \fi} + +\gdef\showfontstrip + {\dosingleempty\doshowfontstrip} + +\gdef\doshowfontstrip[#1]% + {\ifx\starttabulate\undefined + \@@onlyenglish\showfontstrip + \else + \bgroup + \def\dofontstripa##1##2% + {\tttf\string##1} + \def\dofontstripb##1##2% + {\ruledhbox{\switchtobodyfont[#1]##1{##2}}} + \def\dofontstripc##1##2% + {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}% + \tt\tfx\the\ht\scratchbox}% + \def\dofontstripd##1##2% + {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}% + \tt\tfx\the\wd\scratchbox}% + \def\fontstrip##1##2##3% + {\NC##2\rm{##3}\NC + ##2\ss{##3}\NC + ##2\tt{##3}\NC + ##2\mathematics{##3}\NC + \tttf##1\NR} + \starttabulate[|c|c|c|c|c|] + \fontstrip\relax\dofontstripa\empty + \TB + \fontstrip\relax\dofontstripb{xxxx} + \fontstrip\relax\dofontstripb{12345} + \fontstrip\relax\dofontstripb{(Agw)} + \TB + \fontstrip{(x height)}\dofontstripc{x} + \fontstrip{(m width)}\dofontstripd{m} + \stoptabulate + \egroup + \fi} + +\ifx\databox\undefined \newbox\databox \fi + +\gdef\testminimalbaseline#1% + {\setbox\databox\ruledhbox{#1}% + \scratchdimen\ht\databox + \advance\scratchdimen\dp\databox + \scratchtoks{#1}% + \expanded + {\NC \ruledhbox{\the\scratchtoks} + \noexpand \NC -> + \noexpand \NC \the\scratchdimen + \noexpand \NC = + \noexpand \NC \the\ht\databox + \noexpand \NC + + \noexpand \NC \the\dp\databox + \noexpand \NC \ifdim\scratchdimen<\baselineskip < + \else\ifdim\scratchdimen=\baselineskip = + \else > \fi\fi + \noexpand \NC \the\baselineskip + \noexpand \NC (\ifdim\scratchdimen>\baselineskip not \fi ok) + \noexpand \NC \noexpand \NR }} + +\gdef\showminimalbaseline + {\ifx\starttabulate\undefined + \@@onlyenglish\showminimalbaseline + \else + \starttabulate[||T|T|T|T|T|T|T|T|T|] + \testminimalbaseline{\hbox to 1em{\hss\showstruts\strut\hss}}% + \testminimalbaseline{(/)}% + \testminimalbaseline{$\frac{1}{2}x^2_3$} + \stoptabulate + \fi} + +\gdef\showkerning#1% + {\bgroup + \let\MPfshowcommand\ruledhbox + \setMPtext\s!dummy{#1}% + \startMPcode draw textext(\MPstring\s!dummy);\stopMPcode + \egroup} + +\gdef\showcharratio + {\dowithnextboxcontent + {\switchtobodyfont[10pt]}% + {(\expanded{\withoutpt\the\nextboxht},% + \expanded{\withoutpt\the\nextboxdp})}% + \hbox} + +\protect \endinput diff --git a/tex/context/base/font-run.mkiv b/tex/context/base/font-run.mkiv new file mode 100644 index 000000000..5dd8d6086 --- /dev/null +++ b/tex/context/base/font-run.mkiv @@ -0,0 +1,326 @@ +%D \module +%D [ file=font-run, +%D version=1998.09.11, % (second) +%D version=2001.02.20, % (third) +%D title=\CONTEXT\ Font Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 code is hooked into the core macros and saves some +%D format space.] + +\unprotect + +\gdef\@@onlyenglish#1% + {\blank{\tttf \type {#1} is only available in the english interface}\blank} + +\gdef\dosetshowfonttitle#1% + {\tabskip\zeropoint + \parindent\zeropoint + \setlocalhsize + \doifelsenothing{#1} + {\def\title{[\the\bodyfontsize]}} + {\switchtobodyfont[#1]\def\title{[#1]}} + \doifsomething\fontclass + {\doifnot{[\fontclass]}\title + {\edef\title{[\fontclass]\space\title}}}} + +\gdef\showbodyfont + {\dosingleempty\doshowbodyfont} + +\gdef\doshowbodyfont[#1]% + {\ifinsidefloat\else\startbaselinecorrection\fi + \vbox + {\dosetshowfonttitle{#1}% + \def\bigstrut##1##2% + {\hbox{\vrule + \!!height##1\strutht + \!!depth ##2\strutdp + \!!width \zeropoint}} + \def\next##1##2##3% + {&&##1&&##2\tf##3&&##2\sc##3% + &&##2\sl##3&&##2\it##3&&##2\bf##3&&##2\bs##3&&##2\bi##3% + &&##2\tfx##3&&##2\tfxx##3% + &&##2\tfa##3&&##2\tfb##3&&##2\tfc##3&&##2\tfd##3&\cr}% + \halign to \localhsize + {\bigstrut{1.5}{2}##&\vrule## + \tabskip=\!!zeropoint \!!plus 1fill + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule + \tabskip=\!!zeropoint\cr + \noalign{\hrule} + &\multispan{29}{\vrule\hfil\tttf\strut\title\hfil + \llap{\string\mr\hbox to 1em{\hss:\hss}$\mr \languageparameter\c!text$\quad}\vrule}\cr + \noalign{\hrule}\next{}{\tt\string}{} + \noalign{\hrule}\next{\tt\string\rm}\rm{\languageparameter\c!text} + \noalign{\hrule}\next{\tt\string\ss}\ss{\languageparameter\c!text} + \noalign{\hrule}\next{\tt\string\tt}\tt{\languageparameter\c!text} + \noalign{\hrule}}} + \ifinsidefloat\else\stopbaselinecorrection\fi} + +\gdef\showbodyfontenvironment + {\dosingleempty\doshowbodyfontenvironment} + +\gdef\doshowbodyfontenvironment[#1]% + {\ifinsidefloat\else\startbaselinecorrection\fi + \vbox + {\dosetshowfonttitle{#1}% + \def\next##1% + {&&\getvalue{\bodyfontvariable{##1\s!text}}% + &&\getvalue{\bodyfontvariable{##1\s!script}}% + &&\getvalue{\bodyfontvariable{##1\s!scriptscript}}% + &&\getvalue{\bodyfontvariable{##1\c!x}}% + &&\getvalue{\bodyfontvariable{##1\c!xx}}% + &&\getvalue{\bodyfontvariable{##1\interfaced\v!small}}% + &&\getvalue{\bodyfontvariable{##1\interfaced\v!big}}% + &&\edef\next{\getvalue{\bodyfontvariable{##1\c!interlinespace}}}\ifx\next\empty not set\else\next\fi&\cr + \noalign{\hrule}} + \halign to \localhsize + {##&\vrule##\strut + \tabskip=\!!zeropoint \!!plus 1fill + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## + &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule + \tabskip\zeropoint\cr + \noalign{\hrule} + &\multispan{17}{\vrule\hfil\tttf\strut\title\hfil}\vrule\cr + \noalign{\hrule} + &&\tttf\tx\s!text&&\tttf\tx\s!script&&\tttf\tx\s!scriptscript + &&\tttf\tx\c!x&&\tttf\tx\c!xx&&\tttf\tx\v!small&&\tttf\tx\v!big + &&\tttf\tx\c!interlinespace&\cr + \noalign{\hrule} + \@EA\globalprocesscommalist\@EA[\bodyfontenvironmentlist]\next}} + \ifinsidefloat\else\stopbaselinecorrection\fi} + +\gdef\showfont + {\dodoubleempty\doshowfont} + +\gdef\doshowfont[#1][#2]% + {\bgroup + \boxrulewidth=.1pt + \setupcolors[\c!state=\v!local]% + \iffirstargument + \definefont[\s!dummy][#1]\dummy + \else\ifdim2.5em>.05\hsize \tx + \ifdim2.5em>.05\hsize \txx + \fi\fi\fi + \ifinsidefloat\else\startbaselinecorrection\fi + \vbox\bgroup + \forgetall + \startoverlay + {\vbox + {\tf \setstrut \dummy + \offinterlineskip + \dostepwiserecurse{0}{15}{1} + {\let\row\recurselevel + \hbox + {\red + \dostepwiserecurse{0}{15}{1} + {\let\col\recurselevel + \@EA\scratchcounter\normaldblquote\hexnumber\row\hexnumber\col\relax + \edef\rowcol{\the\scratchcounter}% + \iffontchar\font\scratchcounter + \setbox\scratchbox\ruledhbox{\black\char\scratchcounter}% + \ifdim\wd\scratchbox>\zeropoint + \donetrue \else \donefalse + \fi + \else + \setbox\scratchbox\hbox{\gray\vrule\!!width1ex\!!height.5ex\!!depth.5ex}% + \fi + \startoverlay + {\tf\vbox to 2.5em + {\vss + \hbox to 2.5em + {\dummy\ifdim\interwordspace=\zeropoint + \setbox\scratchbox\hbox + {\raise.5\dp\scratchbox\hbox + {\lower.5\ht\scratchbox\copy\scratchbox}}% + \ht\scratchbox\zeropoint + \dp\scratchbox\zeropoint + \else + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \strut + \fi + \hss\copy\scratchbox\hss} + \vss}} + {\tf\vbox to 2.3em + {\ifdone + \hsize2.4em + \blue + \edef\theshowfontspecs + {\ifnum\hyphenchar\font=\rowcol hyph\else + \ifnum\skewchar \font=\rowcol skew\fi\fi}% + \tinyfont % after \edef, else wrong font analyzed + \doifnot\v!unknown{#2}{{\red\theshowfontspecs}}\hfill\number\rowcol + \vfill + \octnumber\rowcol\hfill\lchexnumbers\rowcol + \par + \fi}} + \stopoverlay}}} + \par}} + {\tf\basegrid[\c!nx=16,\c!ny=16,\c!dx=2.5,\c!dy=2.5,\c!unit=em]} + \stopoverlay + \nointerlineskip + \vskip2pt + % the \noexpand before \blank is needed for non etex + \edef\ascii{name: {\noexpand\black\fontname\font}} + \def\do##1##2{\ifx##1\undefined\else\ifx##1\empty\else##2\fi\fi}% + \doifelse\v!unknown{#2} + {\edef\theshowfontspecs + {name: {\noexpand\black\fontname\font}}} + {\edef\theshowfontspecs + {name: {\noexpand\black\fontname\font}\noexpand\quad + \do\currentencoding{encoding: {\noexpand\black\currentencoding\noexpand\quad}}% + \do\currentmapping {mapping: {\noexpand\black\currentmapping \noexpand\quad}}% + \do\fonthandling {handling: {\noexpand\black\fonthandling }}}}% + \tf % also sets em + \hbox to 40em{\blue\hfill\tinyfont\setstrut\strut\theshowfontspecs} + \egroup + \ifinsidefloat\else\stopbaselinecorrection\fi + \egroup} + +\gdef\showfontstyle + {\dotripleempty\doshowfontstyle} + +\gdef\doshowfontstyle[#1][#2][#3]% + {\ifthirdargument + \bgroup + \raggedright + \switchtobodyfont[#1] + \def\dodocommand##1##2% + {\starttextrule{\tttf #1 ##1 ##2} + \nobreak \getvalue{##2}% + \dorecurse{255} + {\iffontchar\font\recurselevel\relax + \char\recurselevel\relax\space + \fi} + \par \nobreak + \stoptextrule} + \def\docommand##1% + {\getvalue{##1}\processcommacommand[#3]{\dodocommand{##1}}} + \processcommalist[#2]\docommand + \egroup + \else\ifsecondargument + \showfontstyle[#1][#2][\fontalternativelist]% math is gone + \else + \showfontstyle[#1][\c!rm]\showfontstyle[#1][\c!ss] + \showfontstyle[#1][\c!tt]\showfontstyle[#1][\c!mm] + \fi\fi} + +\gdef\showligature#1% + {\hbox{\type{#1}\enspace\red\ruledhbox{\black#1}}} + +\gdef\showligatures[#1]% + {\ifx\starttabulate\undefined + \@@onlyenglish\showligatures + \else + \bgroup + \setupcolors[\c!state=\v!local]% + \def\show##1{\hbox{\red\ruledhbox{\black##1}}}% + \definefont[\s!dummy][#1]\dummy + \starttabulate[|*{9}{c|}] + \NC\type{ff}\NC\type{fi}\NC\type{fl}\NC\type{ffi}\NC\type{ffl}\NC + \type{``}\NC\type{''}\NC\type{--}\NC\type{---}\NC\NR + \NC\show{ff}\NC\show{fi}\NC\show{fl}\NC\show{ffi}\NC\show{ffl}\NC + \show{``}\NC\show{''}\NC\show{--}\NC\show{---}\NC\NR + \stoptabulate + \egroup + \fi} + +\gdef\showfontstrip + {\dosingleempty\doshowfontstrip} + +\gdef\doshowfontstrip[#1]% + {\ifx\starttabulate\undefined + \@@onlyenglish\showfontstrip + \else + \bgroup + \def\dofontstripa##1##2% + {\tttf\string##1} + \def\dofontstripb##1##2% + {\ruledhbox{\switchtobodyfont[#1]##1{##2}}} + \def\dofontstripc##1##2% + {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}% + \tt\tfx\the\ht\scratchbox}% + \def\dofontstripd##1##2% + {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}% + \tt\tfx\the\wd\scratchbox}% + \def\fontstrip##1##2##3% + {\NC##2\rm{##3}\NC + ##2\ss{##3}\NC + ##2\tt{##3}\NC + ##2\mathematics{##3}\NC + \tttf##1\NR} + \starttabulate[|c|c|c|c|c|] + \fontstrip\relax\dofontstripa\empty + \TB + \fontstrip\relax\dofontstripb{xxxx} + \fontstrip\relax\dofontstripb{12345} + \fontstrip\relax\dofontstripb{(Agw)} + \TB + \fontstrip{(x height)}\dofontstripc{x} + \fontstrip{(m width)}\dofontstripd{m} + \stoptabulate + \egroup + \fi} + +\ifx\databox\undefined \newbox\databox \fi + +\gdef\testminimalbaseline#1% + {\setbox\databox\ruledhbox{#1}% + \scratchdimen\ht\databox + \advance\scratchdimen\dp\databox + \scratchtoks{#1}% + \expanded + {\NC \ruledhbox{\the\scratchtoks} + \noexpand \NC -> + \noexpand \NC \the\scratchdimen + \noexpand \NC = + \noexpand \NC \the\ht\databox + \noexpand \NC + + \noexpand \NC \the\dp\databox + \noexpand \NC \ifdim\scratchdimen<\baselineskip < + \else\ifdim\scratchdimen=\baselineskip = + \else > \fi\fi + \noexpand \NC \the\baselineskip + \noexpand \NC (\ifdim\scratchdimen>\baselineskip not \fi ok) + \noexpand \NC \noexpand \NR }} + +\gdef\showminimalbaseline + {\ifx\starttabulate\undefined + \@@onlyenglish\showminimalbaseline + \else + \starttabulate[||T|T|T|T|T|T|T|T|T|] + \testminimalbaseline{\hbox to 1em{\hss\showstruts\strut\hss}}% + \testminimalbaseline{(/)}% + \testminimalbaseline{$\frac{1}{2}x^2_3$} + \stoptabulate + \fi} + +\gdef\showkerning#1% + {\bgroup + \let\MPfshowcommand\ruledhbox + \setMPtext\s!dummy{#1}% + \startMPcode draw textext(\MPstring\s!dummy);\stopMPcode + \egroup} + +\gdef\showcharratio + {\dowithnextboxcontent + {\switchtobodyfont[10pt]}% + {(\expanded{\withoutpt\the\nextboxht},% + \expanded{\withoutpt\the\nextboxdp})}% + \hbox} + +\protect \endinput diff --git a/tex/context/base/font-run.tex b/tex/context/base/font-run.tex deleted file mode 100644 index 0a0ddd057..000000000 --- a/tex/context/base/font-run.tex +++ /dev/null @@ -1,326 +0,0 @@ -%D \module -%D [ file=font-run, -%D version=1998.09.11, % (second) -%D version=2001.02.20, % (third) -%D title=\CONTEXT\ Font Macros, -%D subtitle=Runtime Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 code is hooked into the core macros and saves some -%D format space.] - -\unprotect - -\gdef\@@onlyenglish#1% - {\blank{\tttf \type {#1} is only available in the english interface}\blank} - -\gdef\dosetshowfonttitle#1% - {\tabskip\zeropoint - \parindent\zeropoint - \setlocalhsize - \doifelsenothing{#1} - {\def\title{[\the\bodyfontsize]}} - {\switchtobodyfont[#1]\def\title{[#1]}} - \doifsomething\fontclass - {\doifnot{[\fontclass]}\title - {\edef\title{[\fontclass]\space\title}}}} - -\gdef\showbodyfont - {\dosingleempty\doshowbodyfont} - -\gdef\doshowbodyfont[#1]% - {\ifinsidefloat\else\startbaselinecorrection\fi - \vbox - {\dosetshowfonttitle{#1}% - \def\bigstrut##1##2% - {\hbox{\vrule - \!!height##1\strutht - \!!depth ##2\strutdp - \!!width \zeropoint}} - \def\next##1##2##3% - {&&##1&&##2\tf##3&&##2\sc##3% - &&##2\sl##3&&##2\it##3&&##2\bf##3&&##2\bs##3&&##2\bi##3% - &&##2\tfx##3&&##2\tfxx##3% - &&##2\tfa##3&&##2\tfb##3&&##2\tfc##3&&##2\tfd##3&\cr}% - \halign to \localhsize - {\bigstrut{1.5}{2}##&\vrule## - \tabskip=\!!zeropoint \!!plus 1fill - &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## - &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## - &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## - &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## - &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## - &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## - &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule - \tabskip=\!!zeropoint\cr - \noalign{\hrule} - &\multispan{29}{\vrule\hfil\tttf\strut\title\hfil - \llap{\string\mr\hbox to 1em{\hss:\hss}$\mr \languageparameter\c!text$\quad}\vrule}\cr - \noalign{\hrule}\next{}{\tt\string}{} - \noalign{\hrule}\next{\tt\string\rm}\rm{\languageparameter\c!text} - \noalign{\hrule}\next{\tt\string\ss}\ss{\languageparameter\c!text} - \noalign{\hrule}\next{\tt\string\tt}\tt{\languageparameter\c!text} - \noalign{\hrule}}} - \ifinsidefloat\else\stopbaselinecorrection\fi} - -\gdef\showbodyfontenvironment - {\dosingleempty\doshowbodyfontenvironment} - -\gdef\doshowbodyfontenvironment[#1]% - {\ifinsidefloat\else\startbaselinecorrection\fi - \vbox - {\dosetshowfonttitle{#1}% - \def\next##1% - {&&\getvalue{\bodyfontvariable{##1\s!text}}% - &&\getvalue{\bodyfontvariable{##1\s!script}}% - &&\getvalue{\bodyfontvariable{##1\s!scriptscript}}% - &&\getvalue{\bodyfontvariable{##1\c!x}}% - &&\getvalue{\bodyfontvariable{##1\c!xx}}% - &&\getvalue{\bodyfontvariable{##1\interfaced\v!small}}% - &&\getvalue{\bodyfontvariable{##1\interfaced\v!big}}% - &&\edef\next{\getvalue{\bodyfontvariable{##1\c!interlinespace}}}\ifx\next\empty not set\else\next\fi&\cr - \noalign{\hrule}} - \halign to \localhsize - {##&\vrule##\strut - \tabskip=\!!zeropoint \!!plus 1fill - &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## - &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule## - &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule - \tabskip\zeropoint\cr - \noalign{\hrule} - &\multispan{17}{\vrule\hfil\tttf\strut\title\hfil}\vrule\cr - \noalign{\hrule} - &&\tttf\tx\s!text&&\tttf\tx\s!script&&\tttf\tx\s!scriptscript - &&\tttf\tx\c!x&&\tttf\tx\c!xx&&\tttf\tx\v!small&&\tttf\tx\v!big - &&\tttf\tx\c!interlinespace&\cr - \noalign{\hrule} - \@EA\globalprocesscommalist\@EA[\bodyfontenvironmentlist]\next}} - \ifinsidefloat\else\stopbaselinecorrection\fi} - -\gdef\showfont - {\dodoubleempty\doshowfont} - -\gdef\doshowfont[#1][#2]% - {\bgroup - \boxrulewidth=.1pt - \setupcolors[\c!state=\v!local]% - \iffirstargument - \definefont[\s!dummy][#1]\dummy - \else\ifdim2.5em>.05\hsize \tx - \ifdim2.5em>.05\hsize \txx - \fi\fi\fi - \ifinsidefloat\else\startbaselinecorrection\fi - \vbox\bgroup - \forgetall - \startoverlay - {\vbox - {\tf \setstrut \dummy - \localcolortrue \offinterlineskip - \dostepwiserecurse{0}{15}{1} - {\let\row\recurselevel - \hbox - {\red - \dostepwiserecurse{0}{15}{1} - {\let\col\recurselevel - \@EA\scratchcounter\normaldblquote\hexnumber\row\hexnumber\col\relax - \edef\rowcol{\the\scratchcounter}% - \iffontchar\font\scratchcounter - \setbox\scratchbox\ruledhbox{\black\char\scratchcounter}% - \ifdim\wd\scratchbox>\zeropoint - \donetrue \else \donefalse - \fi - \else - \setbox\scratchbox\hbox{\gray\vrule\!!width1ex\!!height.5ex\!!depth.5ex}% - \fi - \startoverlay - {\tf\vbox to 2.5em - {\vss - \hbox to 2.5em - {\dummy\ifdim\interwordspace=\zeropoint - \setbox\scratchbox\hbox - {\raise.5\dp\scratchbox\hbox - {\lower.5\ht\scratchbox\copy\scratchbox}}% - \ht\scratchbox\zeropoint - \dp\scratchbox\zeropoint - \else - \ht\scratchbox\strutht - \dp\scratchbox\strutdp - \strut - \fi - \hss\copy\scratchbox\hss} - \vss}} - {\tf\vbox to 2.3em - {\ifdone - \hsize2.4em - \blue - \edef\theshowfontspecs - {\ifnum\hyphenchar\font=\rowcol hyph\else - \ifnum\skewchar \font=\rowcol skew\fi\fi}% - \tinyfont % after \edef, else wrong font analyzed - \doifnot\v!unknown{#2}{{\red\theshowfontspecs}}\hfill\number\rowcol - \vfill - \octnumber\rowcol\hfill\lchexnumbers\rowcol - \par - \fi}} - \stopoverlay}}} - \par}} - {\tf\basegrid[\c!nx=16,\c!ny=16,\c!dx=2.5,\c!dy=2.5,\c!unit=em]} - \stopoverlay - \nointerlineskip - \vskip2pt - % the \noexpand before \blank is needed for non etex - \edef\ascii{name: {\noexpand\black\fontname\font}} - \def\do##1##2{\ifx##1\undefined\else\ifx##1\empty\else##2\fi\fi}% - \doifelse\v!unknown{#2} - {\edef\theshowfontspecs - {name: {\noexpand\black\fontname\font}}} - {\edef\theshowfontspecs - {name: {\noexpand\black\fontname\font}\noexpand\quad - \do\currentencoding{encoding: {\noexpand\black\currentencoding\noexpand\quad}}% - \do\currentmapping {mapping: {\noexpand\black\currentmapping \noexpand\quad}}% - \do\fonthandling {handling: {\noexpand\black\fonthandling }}}}% - \tf % also sets em - \hbox to 40em{\blue\hfill\tinyfont\setstrut\strut\theshowfontspecs} - \egroup - \ifinsidefloat\else\stopbaselinecorrection\fi - \egroup} - -\gdef\showfontstyle - {\dotripleempty\doshowfontstyle} - -\gdef\doshowfontstyle[#1][#2][#3]% - {\ifthirdargument - \bgroup - \raggedright - \switchtobodyfont[#1] - \def\dodocommand##1##2% - {\starttextrule{\tttf #1 ##1 ##2} - \nobreak \getvalue{##2}% - \dorecurse{255} - {\iffontchar\font\recurselevel\relax - \char\recurselevel\relax\space - \fi} - \par \nobreak - \stoptextrule} - \def\docommand##1% - {\getvalue{##1}\processcommacommand[#3]{\dodocommand{##1}}} - \processcommalist[#2]\docommand - \egroup - \else\ifsecondargument - \showfontstyle[#1][#2][\fontalternativelist]% math is gone - \else - \showfontstyle[#1][\c!rm]\showfontstyle[#1][\c!ss] - \showfontstyle[#1][\c!tt]\showfontstyle[#1][\c!mm] - \fi\fi} - -\gdef\showligature#1% - {\hbox{\type{#1}\enspace\red\ruledhbox{\black#1}}} - -\gdef\showligatures[#1]% - {\ifx\starttabulate\undefined - \@@onlyenglish\showligatures - \else - \bgroup - \setupcolors[\c!state=\v!local]% - \def\show##1{\hbox{\red\ruledhbox{\black##1}}}% - \definefont[\s!dummy][#1]\dummy - \starttabulate[|*{9}{c|}] - \NC\type{ff}\NC\type{fi}\NC\type{fl}\NC\type{ffi}\NC\type{ffl}\NC - \type{``}\NC\type{''}\NC\type{--}\NC\type{---}\NC\NR - \NC\show{ff}\NC\show{fi}\NC\show{fl}\NC\show{ffi}\NC\show{ffl}\NC - \show{``}\NC\show{''}\NC\show{--}\NC\show{---}\NC\NR - \stoptabulate - \egroup - \fi} - -\gdef\showfontstrip - {\dosingleempty\doshowfontstrip} - -\gdef\doshowfontstrip[#1]% - {\ifx\starttabulate\undefined - \@@onlyenglish\showfontstrip - \else - \bgroup - \def\dofontstripa##1##2% - {\tttf\string##1} - \def\dofontstripb##1##2% - {\ruledhbox{\switchtobodyfont[#1]##1{##2}}} - \def\dofontstripc##1##2% - {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}% - \tt\tfx\the\ht\scratchbox}% - \def\dofontstripd##1##2% - {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}% - \tt\tfx\the\wd\scratchbox}% - \def\fontstrip##1##2##3% - {\NC##2\rm{##3}\NC - ##2\ss{##3}\NC - ##2\tt{##3}\NC - ##2\mathematics{##3}\NC - \tttf##1\NR} - \starttabulate[|c|c|c|c|c|] - \fontstrip\relax\dofontstripa\empty - \TB - \fontstrip\relax\dofontstripb{xxxx} - \fontstrip\relax\dofontstripb{12345} - \fontstrip\relax\dofontstripb{(Agw)} - \TB - \fontstrip{(x height)}\dofontstripc{x} - \fontstrip{(m width)}\dofontstripd{m} - \stoptabulate - \egroup - \fi} - -\ifx\databox\undefined \newbox\databox \fi - -\gdef\testminimalbaseline#1% - {\setbox\databox\ruledhbox{#1}% - \scratchdimen\ht\databox - \advance\scratchdimen\dp\databox - \scratchtoks{#1}% - \expanded - {\NC \ruledhbox{\the\scratchtoks} - \noexpand \NC -> - \noexpand \NC \the\scratchdimen - \noexpand \NC = - \noexpand \NC \the\ht\databox - \noexpand \NC + - \noexpand \NC \the\dp\databox - \noexpand \NC \ifdim\scratchdimen<\baselineskip < - \else\ifdim\scratchdimen=\baselineskip = - \else > \fi\fi - \noexpand \NC \the\baselineskip - \noexpand \NC (\ifdim\scratchdimen>\baselineskip not \fi ok) - \noexpand \NC \noexpand \NR }} - -\gdef\showminimalbaseline - {\ifx\starttabulate\undefined - \@@onlyenglish\showminimalbaseline - \else - \starttabulate[||T|T|T|T|T|T|T|T|T|] - \testminimalbaseline{\hbox to 1em{\hss\showstruts\strut\hss}}% - \testminimalbaseline{(/)}% - \testminimalbaseline{$\frac{1}{2}x^2_3$} - \stoptabulate - \fi} - -\gdef\showkerning#1% - {\bgroup - \let\MPfshowcommand\ruledhbox - \setMPtext\s!dummy{#1}% - \startMPcode draw textext(\MPstring\s!dummy);\stopMPcode - \egroup} - -\gdef\showcharratio - {\dowithnextboxcontent - {\switchtobodyfont[10pt]}% - {(\expanded{\withoutpt\the\nextboxht},% - \expanded{\withoutpt\the\nextboxdp})}% - \hbox} - -\protect \endinput diff --git a/tex/context/base/font-tfm.lua b/tex/context/base/font-tfm.lua index 472f69c8c..8b799df5a 100644 --- a/tex/context/base/font-tfm.lua +++ b/tex/context/base/font-tfm.lua @@ -245,7 +245,7 @@ function tfm.do_scale(tfmtable, scaledpoints) end -- status local isvirtual = tfmtable.type == "virtual" or tfmtable.virtualized - local hasmath = tfmtable.math_parameters ~= nil or tfmtable.MathConstants ~= nil + local hasmath = (tfmtable.math_parameters ~= nil and next(tfmtable.math_parameters) ~= nil) or (tfmtable.MathConstants ~= nil and next(tfmtable.MathConstants) ~= nil) local nodemode = tfmtable.mode == "node" local hasquality = tfmtable.auto_expand or tfmtable.auto_protrude local hasitalic = tfmtable.has_italic @@ -293,6 +293,7 @@ function tfm.do_scale(tfmtable, scaledpoints) local scaledheight = defaultheight * delta local scaleddepth = defaultdepth * delta local stackmath = tfmtable.ignore_stack_math ~= true +local private = fonts.private for k,v in next, characters do local chr, description, index if ischanged then @@ -355,7 +356,7 @@ function tfm.do_scale(tfmtable, scaledpoints) -- logs.report("define font","t=%s, u=%s, i=%s, n=%s c=%s",k,chr.tounicode or k,description.index,description.name or '-',description.class or '-') -- end if tounicode then - local tu = tounicode[index] + local tu = tounicode[index] -- nb: index! if tu then chr.tounicode = tu end @@ -528,6 +529,7 @@ function tfm.do_scale(tfmtable, scaledpoints) end -- needed for \high cum suis local tpx = tp.x_height +if hasmath then if not tp[13] then tp[13] = .86*tpx end -- mathsupdisplay if not tp[14] then tp[14] = .86*tpx end -- mathsupnormal if not tp[15] then tp[15] = .86*tpx end -- mathsupcramped @@ -535,11 +537,22 @@ function tfm.do_scale(tfmtable, scaledpoints) if not tp[17] then tp[17] = .48*tpx end -- mathsubcombined if not tp[22] then tp[22] = 0 end -- mathaxisheight if t.MathConstants then t.MathConstants.AccentBaseHeight = nil end -- safeguard +end t.tounicode = 1 t.cidinfo = tfmtable.cidinfo -- we have t.name=metricfile and t.fullname=RealName and t.filename=diskfilename -- when collapsing fonts, luatex looks as both t.name and t.fullname as ttc files -- can have multiple subfonts + if hasmath then + if trace_defining then + logs.report("define font","math enabled for: %s %s %s",t.name or "noname",t.fullname or "nofullname",t.filename or "nofilename") + end + else + if trace_defining then + logs.report("define font","math disabled for: %s %s %s",t.name or "noname",t.fullname or "nofullname",t.filename or "nofilename") + end + t.nomath, t.MathConstants = true, nil + end return t, delta end @@ -714,7 +727,7 @@ function tfm.set_features(tfmdata) local value = features[f] if value and fi.tfm[f] then -- brr if tfm.trace_features then - logs.report("define tfm","initializing feature %s to %s for mode %s for font %s",f,tostring(value),mode or 'unknown',tfmdata.name or 'unknown') + logs.report("define font","initializing feature %s to %s for mode %s for font %s",f,tostring(value),mode or 'unknown',tfmdata.name or 'unknown') end fi.tfm[f](tfmdata,value) mode = tfmdata.mode or fonts.mode diff --git a/tex/context/base/font-uni.mkii b/tex/context/base/font-uni.mkii index 1b8ce8e43..02ab6ce2c 100644 --- a/tex/context/base/font-uni.mkii +++ b/tex/context/base/font-uni.mkii @@ -19,7 +19,7 @@ \ifnum\texengine=\xetexengine \unexpanded\def\uchar#1#2{\char\numexpr#2+#1*\pluscclvi\relax} \let\uc\uchar - \endinput + \expandafter \endinput \fi %D Now comes the more traditional 8 bit \TEX\ hackery. diff --git a/tex/context/base/font-xtx.mkii b/tex/context/base/font-xtx.mkii new file mode 100644 index 000000000..5f4b85879 --- /dev/null +++ b/tex/context/base/font-xtx.mkii @@ -0,0 +1,357 @@ +%D \module +%D [ file=font-xtx, +%D version=2004.09.11, +%D title=\CONTEXT\ Font Macros, +%D subtitle=\XETEX\ Hacks, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifnum\texengine=\xetexengine + \writestatus{loading}{ConTeXt Font Macros / XeTeX Hacks} +\else + \endinput +\fi + +\unprotect + +%D Loading: + +%D for some reason xetex does not support [filename] for tfm files and +%D quotes also behave kind of strange " vs ' vs [ vs ... +%D +%D \starttyping +%D \font\myfont = msam7 % ok +%D \font\myfont = "msam7" % also ok +%D \font\myfont = "msam7" at 8pt % error +%D \stoptyping + +\newconditional\tracexetexfonts + +%D Because \XETEX\ is not that fast on locating fonts we cache lookups so +%D that we minimize the test. It saves a little bit of runtime, depending +%D on the number of fonts loaded (which is normally not that much). + +\def\doiffoundXTXfontelse#1#2% + {\ifcsname xtx@fnt@#2\somefontspec\endcsname + \ifconditional\tracexetexfonts + \writestatus\m!fonts{already checked #1: #2\somefontspec\space (state: \number\csname xtx@fnt@#2\somefontspec\endcsname)}% + \fi + \else + \suppressfontnotfounderror\plusone + \font\xetextempfont=#2\somefontspec\relax + \suppressfontnotfounderror\zerocount + \edef\xetextempfont{\fontname\xetextempfont}% + \global\expandafter\chardef\csname xtx@fnt@#2\somefontspec\endcsname + \ifx\xetextempfont\nullfontname + \zerocount \ifconditional\tracexetexfonts + \writestatus\m!fonts{not found #1: #2\somefontspec}% + \fi + \else + \plusone \ifconditional\tracexetexfonts + \writestatus\m!fonts{found #1: #2\somefontspec}% + \fi + \fi + \fi + \ifcase\csname xtx@fnt@#2\somefontspec\endcsname + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + +\def\docheckfontfilenameprefix#1:#2:#3#4\relax + {\edef\!!stringa{#1}% + \edef\!!stringb{#2}% + \ifx\!!stringb\empty + % no prefix + \let\checkedfontfile\!!stringa + \doiffoundXTXfontelse{1a}{\checkedfontfile\checkedfontfeatures} + {\edef\checkedfontfile{\checkedfontfile\checkedfontfeatures}} + {\doiffoundXTXfontelse{1b}{"\checkedfontfile\checkedfontfeatures"} + {\edef\checkedfontfile{"\checkedfontfile\checkedfontfeatures"}} + {\doiffoundXTXfontelse{1c}{"[\checkedfontfile]\checkedfontfeatures"} + {\edef\checkedfontfile{"[\checkedfontfile]\checkedfontfeatures"}} + {}}}% + \else\ifx\!!stringa\v!file + % force file, only file check when no spaces + \let\checkedfontfile\!!stringb + \doiffoundXTXfontelse{2a}{"[\checkedfontfile]\checkedfontfeatures"} + {\edef\checkedfontfile{"[\checkedfontfile]\checkedfontfeatures"}} + {\doiffoundXTXfontelse{2b}{"\checkedfontfile\checkedfontfeatures"} + {\edef\checkedfontfile{"\checkedfontfile\checkedfontfeatures"}} + {}}% + \else\ifx\!!stringa\v!name + % force name, always lookup by xetex itself, "" forces otf/ttf/type1 + \edef\checkedfontfile{"\!!stringb\checkedfontfeatures"}% + \ifconditional\tracexetexfonts + \writestatus\m!fonts{no checking 3a: \checkedfontfile}% + \fi + \else + % whatever, maybe even xetex spec, forget about features + \edef\checkedfontfile{"\!!stringa\!!stringb"}% + \ifconditional\tracexetexfonts + \writestatus\m!fonts{no checking 3b: \checkedfontfile}% + \fi + \fi\fi\fi} + +\def\checkfontfilename% -- todo: integrate so that we call do.. directly + {\expandafter\docheckfontfilename\fontfile*\empty*\relax} + +\def\docheckfontfilename#1*#2#3*#4\relax % class overrules file + {\edef\checkedfontfeatures + {\expandafter\ifx\csname\fontclass\s!features\endcsname\empty + \ifx\@@fontfeatures\empty\ifx#2\empty\else#2#3\fi\else\@@fontfeatures\fi + \else\expandafter\ifx\csname\fontclass\s!features\endcsname\relax % redundant, will go away + \ifx\@@fontfeatures\empty\ifx#2\empty\else#2#3\fi\else\@@fontfeatures\fi + \else + \csname\fontclass\s!features\endcsname + \fi\fi}% + \ifx\checkedfontfeatures\empty + % done + \else + \edef\checkedfontfeatures{\executeifdefined{\??fa\checkedfontfeatures}\empty}% + \ifx\checkedfontfeatures\empty + % done + \else + \let\convertedfontfeatures\empty + \processcommacommand[\checkedfontfeatures]\doconvertfontfeatures % raw + \ifx\convertedfontfeatures\empty + \let\checkedfontfeatures\empty + \else + \edef\checkedfontfeatures{:\convertedfontfeatures}% + \fi + \fi + \fi + \docheckfontfilenameprefix#1:\empty:\empty\relax + \doshowcheckedfontfeatures} + +\def\dodoconvertfontfeatures#1=#2#3=#4\relax + {\ifx#2\empty + % invalid feature + \else\ifcsname @xtx@#1@#2#3\endcsname + \expandafter\ifx\csname @xtx@#1@#2#3\endcsname\empty\else + \edef\convertedfontfeatures{\convertedfontfeatures\csname @xtx@#1@#2#3\endcsname;}% + \fi + \else + \edef\!!stringa{#1}% + \edef\!!stringb{#2#3}% + \edef\convertedfontfeatures + {\convertedfontfeatures + \ifx\!!stringb\v!yes + +\!!stringa + \else\ifx\!!stringb\v!no + -\!!stringa + \else + \!!stringa=\!!stringb + \fi\fi;}% + \fi\fi} + +\def\doconvertfontfeatures#1% + {\dodoconvertfontfeatures#1=\empty=\relax} + +\def\remapfontfeature #1 #2 #3 {\setevalue{@xtx@#1@#2}{#3}} + +% this may move to another file, maybe font-xtx + +\remapfontfeature tlig yes mapping=tlig +%remapfontfeature tlig no mapping= +\remapfontfeature trep yes {} +\remapfontfeature trep no {} +\remapfontfeature texligatures yes mapping=tlig +%remapfontfeature texligatures no mapping= +%remapfontfeature texquotes yes mapping=tex-text +%remapfontfeature texquotes no mapping= + +%D Variants: + +\unexpanded\def\variant[#1]% + {\dosetscaledfont + \font\variantfont\truefontname{\fontstringA\fontstylesuffix\fontvariant\fontstringA{#1}} at \scaledfont + \variantfont} + +%D Possible optimizations: + +% \def\updatefontparameters +% {\edef\@@fontfeatures{\truefontdata\fontfile\s!features}% +% \edef\@@fontskewchar{\truefontdata\fontfile\s!skewchar}} + +% \def\setfontcharacteristics +% {\updatefontparameters % redundant, will go away, faster too +% \the\everyfont} + +% \let\synchronizepatternswithfont\relax + +%D Names: + +% We need to move the feature into the filename else it may be +% overloaded by another reference. For instance the definition of +% a regular and caps variant can use the same font. + +% We could use an indirect method ... store in 'array' and refer to +% slot. + +\def\definefontsynonym[#1]#2[#3]% + {\edef\@@fontname{#1}% + \edef\@@fontfile{#3}% + \doifnextoptionalelse\dodefinefontsynonym\nodefinefontsynonym} + +\def\nodefinefontsynonym + {\@EA\let\csname\??ff\fontclass\@@fontname\endcsname\@@fontfile} + +\def\dodefinefontsynonym[#1]% + {\edef\@@fontdata{#1}% + \ifx\@@fontdata\empty + \nodefinefontsynonym + \else + \ifx\fontclass\empty + \getfontparameters + \else + \getglobalfontparameters + \fi + \ifcsname\??ff\@@fontfile\s!features\endcsname + \@EA\edef\csname\??ff\fontclass\@@fontname\endcsname{\@@fontfile*\csname\??ff\@@fontfile\s!features\endcsname}% + \@EA\let\csname\??ff\@@fontfile\s!features\endcsname\undefined + \else + \nodefinefontsynonym + \fi + \fi} + +\let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater + +% simple version +% +% \def\truefontname#1% +% {\@EA\dotruefontname#1*\relax} +% +% \def\dotruefontname#1*#2\relax +% {\ifcsname\??ff\fontclass#1\endcsname +% \@EA\truefontname\csname\??ff\fontclass#1\endcsname +% \else\ifcsname\??ff#1\endcsname +% \@EA\truefontname\csname\??ff#1\endcsname +% \else +% #1% +% \fi\fi} +% +% last counts +% +% \def\truefontname#1% +% {\@EA\dotruefontname#1*\empty*\relax} +% +% \def\dotruefontname#1*#2#3*#4\relax +% {\ifcsname\??ff\fontclass#1\endcsname +% \ifx#2\empty +% \@EA\truefontname\csname\??ff\fontclass#1\endcsname +% \else +% \@EA\truefontname\csname\??ff\fontclass#1\endcsname*#2#3% +% \fi +% \else\ifcsname\??ff#1\endcsname +% \ifx#2\empty +% \@EA\truefontname\csname\??ff#1\endcsname +% \else +% \@EA\truefontname\csname\??ff#1\endcsname*#2#3% +% \fi +% \else +% \ifx#2\empty +% #1% +% \else +% #1*#2#3% +% \fi +% \fi\fi} +% +% first counts + +\def\truefontname#1% + {\@EA\dotruefontname#1*\empty*\relax} + +\def\dotruefontname#1*#2#3*#4\relax + {\ifcsname\??ff\fontclass#1\endcsname + \ifx#2\empty + \@EA\truefontname\csname\??ff\fontclass#1\endcsname + \else + \@EA\redotruefontname\csname\??ff\fontclass#1\endcsname*#2#3% + \fi + \else\ifcsname\??ff#1\endcsname + \ifx#2\empty + \@EA\truefontname\csname\??ff#1\endcsname + \else + \@EA\redotruefontname\csname\??ff#1\endcsname*#2#3% + \fi + \else + #1\ifx#2\empty\else*#2#3\fi + \fi\fi} + +\def\redotruefontname#1% + {\@EA\dodotruefontname#1*\relax} + +\def\dodotruefontname#1*#2\relax + {\ifcsname\??ff\fontclass#1\endcsname + \@EA\redotruefontname\csname\??ff\fontclass#1\endcsname + \else\ifcsname\??ff#1\endcsname + \@EA\redotruefontname\csname\??ff#1\endcsname + \else + #1% + \fi\fi} + +%D Default: + +\def\defaultfontfile{file:lmmono10-regular} + +%D Maybe: + +% \def\updatefontparameters +% {\edef\@@fontfeatures{\truefontdata\fontfile \s!features}% +% \edef\@@fontskewchar{\truefontdata\fontfile \s!skewchar}} + +% \def\setfontcharacteristics +% {%\updatefontparameters % redundant, will go away, faster too +% \the\everyfont +% \synchronizepatternswithfont} + +\protect \endinput + +% \starttypescript[serif] [myzhfont] +% \definefontsynonym [Serif] [file:SimSun] +% \definefontsynonym [SerifBold] [file:SimSun] +% \definefontsynonym [SerifItalic] [file:SimSun] +% \definefontsynonym [SerifBoldItalic] [file:SimSun] +% \stoptypescript +% \starttypescript[sans] [myzhfont] +% \definefontsynonym [Sans] [file:SimSun] +% \definefontsynonym [SansBold] [file:SimSun] +% \definefontsynonym [SansItalic] [file:SimSun] +% \definefontsynonym [SansBoldItalic] [file:SimSun] +% \stoptypescript +% \starttypescript[mono] [myzhfont] +% \definefontsynonym [Mono] [file:SimSun] +% \definefontsynonym [MonoBold] [file:SimSun] +% \definefontsynonym [MonoItalic] [file:SimSun] +% \definefontsynonym [MonoBoldItalic] [file:SimSun] +% \stoptypescript +% \definetypeface [myzhfont] [rm] [serif][myzhfont] [default] +% \definetypeface [myzhfont] [ss] [sans] [myzhfont] [default] +% \definetypeface [myzhfont] [tt] [mono] [myzhfont] [default] + +% \starttext +% % on windows: make sure fonts.conf has no cache mentioned +% % +% % 64 sec xetex, 11 sec luatex (56 sec xetex when \nobigmath) +% % +% \setupbodyfont[myzhfont] \dorecurse{10000}{{hello {\switchtobodyfont[myzhfont] 你好}}\par} +% % +% % 67 sec xetex, 11.5 sec luatex +% % +% % \dorecurse{10000}{{hello {\switchtobodyfont[myzhfont] 你好}}\par} +% % +% % 5 sec xetex, 7 sec luatex +% % +% % \setupbodyfont[myzhfont] \dorecurse{10000}{{hello {你好}}\par} +% % +% % 5 sec xetex, 7 sec luatex +% % +% % \setupbodyfont[myzhfont] \dorecurse{10000}{{\bf hello {你好}}\par} +% \stoptext + diff --git a/tex/context/base/font-xtx.tex b/tex/context/base/font-xtx.tex deleted file mode 100644 index 5f4b85879..000000000 --- a/tex/context/base/font-xtx.tex +++ /dev/null @@ -1,357 +0,0 @@ -%D \module -%D [ file=font-xtx, -%D version=2004.09.11, -%D title=\CONTEXT\ Font Macros, -%D subtitle=\XETEX\ Hacks, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifnum\texengine=\xetexengine - \writestatus{loading}{ConTeXt Font Macros / XeTeX Hacks} -\else - \endinput -\fi - -\unprotect - -%D Loading: - -%D for some reason xetex does not support [filename] for tfm files and -%D quotes also behave kind of strange " vs ' vs [ vs ... -%D -%D \starttyping -%D \font\myfont = msam7 % ok -%D \font\myfont = "msam7" % also ok -%D \font\myfont = "msam7" at 8pt % error -%D \stoptyping - -\newconditional\tracexetexfonts - -%D Because \XETEX\ is not that fast on locating fonts we cache lookups so -%D that we minimize the test. It saves a little bit of runtime, depending -%D on the number of fonts loaded (which is normally not that much). - -\def\doiffoundXTXfontelse#1#2% - {\ifcsname xtx@fnt@#2\somefontspec\endcsname - \ifconditional\tracexetexfonts - \writestatus\m!fonts{already checked #1: #2\somefontspec\space (state: \number\csname xtx@fnt@#2\somefontspec\endcsname)}% - \fi - \else - \suppressfontnotfounderror\plusone - \font\xetextempfont=#2\somefontspec\relax - \suppressfontnotfounderror\zerocount - \edef\xetextempfont{\fontname\xetextempfont}% - \global\expandafter\chardef\csname xtx@fnt@#2\somefontspec\endcsname - \ifx\xetextempfont\nullfontname - \zerocount \ifconditional\tracexetexfonts - \writestatus\m!fonts{not found #1: #2\somefontspec}% - \fi - \else - \plusone \ifconditional\tracexetexfonts - \writestatus\m!fonts{found #1: #2\somefontspec}% - \fi - \fi - \fi - \ifcase\csname xtx@fnt@#2\somefontspec\endcsname - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} - -\def\docheckfontfilenameprefix#1:#2:#3#4\relax - {\edef\!!stringa{#1}% - \edef\!!stringb{#2}% - \ifx\!!stringb\empty - % no prefix - \let\checkedfontfile\!!stringa - \doiffoundXTXfontelse{1a}{\checkedfontfile\checkedfontfeatures} - {\edef\checkedfontfile{\checkedfontfile\checkedfontfeatures}} - {\doiffoundXTXfontelse{1b}{"\checkedfontfile\checkedfontfeatures"} - {\edef\checkedfontfile{"\checkedfontfile\checkedfontfeatures"}} - {\doiffoundXTXfontelse{1c}{"[\checkedfontfile]\checkedfontfeatures"} - {\edef\checkedfontfile{"[\checkedfontfile]\checkedfontfeatures"}} - {}}}% - \else\ifx\!!stringa\v!file - % force file, only file check when no spaces - \let\checkedfontfile\!!stringb - \doiffoundXTXfontelse{2a}{"[\checkedfontfile]\checkedfontfeatures"} - {\edef\checkedfontfile{"[\checkedfontfile]\checkedfontfeatures"}} - {\doiffoundXTXfontelse{2b}{"\checkedfontfile\checkedfontfeatures"} - {\edef\checkedfontfile{"\checkedfontfile\checkedfontfeatures"}} - {}}% - \else\ifx\!!stringa\v!name - % force name, always lookup by xetex itself, "" forces otf/ttf/type1 - \edef\checkedfontfile{"\!!stringb\checkedfontfeatures"}% - \ifconditional\tracexetexfonts - \writestatus\m!fonts{no checking 3a: \checkedfontfile}% - \fi - \else - % whatever, maybe even xetex spec, forget about features - \edef\checkedfontfile{"\!!stringa\!!stringb"}% - \ifconditional\tracexetexfonts - \writestatus\m!fonts{no checking 3b: \checkedfontfile}% - \fi - \fi\fi\fi} - -\def\checkfontfilename% -- todo: integrate so that we call do.. directly - {\expandafter\docheckfontfilename\fontfile*\empty*\relax} - -\def\docheckfontfilename#1*#2#3*#4\relax % class overrules file - {\edef\checkedfontfeatures - {\expandafter\ifx\csname\fontclass\s!features\endcsname\empty - \ifx\@@fontfeatures\empty\ifx#2\empty\else#2#3\fi\else\@@fontfeatures\fi - \else\expandafter\ifx\csname\fontclass\s!features\endcsname\relax % redundant, will go away - \ifx\@@fontfeatures\empty\ifx#2\empty\else#2#3\fi\else\@@fontfeatures\fi - \else - \csname\fontclass\s!features\endcsname - \fi\fi}% - \ifx\checkedfontfeatures\empty - % done - \else - \edef\checkedfontfeatures{\executeifdefined{\??fa\checkedfontfeatures}\empty}% - \ifx\checkedfontfeatures\empty - % done - \else - \let\convertedfontfeatures\empty - \processcommacommand[\checkedfontfeatures]\doconvertfontfeatures % raw - \ifx\convertedfontfeatures\empty - \let\checkedfontfeatures\empty - \else - \edef\checkedfontfeatures{:\convertedfontfeatures}% - \fi - \fi - \fi - \docheckfontfilenameprefix#1:\empty:\empty\relax - \doshowcheckedfontfeatures} - -\def\dodoconvertfontfeatures#1=#2#3=#4\relax - {\ifx#2\empty - % invalid feature - \else\ifcsname @xtx@#1@#2#3\endcsname - \expandafter\ifx\csname @xtx@#1@#2#3\endcsname\empty\else - \edef\convertedfontfeatures{\convertedfontfeatures\csname @xtx@#1@#2#3\endcsname;}% - \fi - \else - \edef\!!stringa{#1}% - \edef\!!stringb{#2#3}% - \edef\convertedfontfeatures - {\convertedfontfeatures - \ifx\!!stringb\v!yes - +\!!stringa - \else\ifx\!!stringb\v!no - -\!!stringa - \else - \!!stringa=\!!stringb - \fi\fi;}% - \fi\fi} - -\def\doconvertfontfeatures#1% - {\dodoconvertfontfeatures#1=\empty=\relax} - -\def\remapfontfeature #1 #2 #3 {\setevalue{@xtx@#1@#2}{#3}} - -% this may move to another file, maybe font-xtx - -\remapfontfeature tlig yes mapping=tlig -%remapfontfeature tlig no mapping= -\remapfontfeature trep yes {} -\remapfontfeature trep no {} -\remapfontfeature texligatures yes mapping=tlig -%remapfontfeature texligatures no mapping= -%remapfontfeature texquotes yes mapping=tex-text -%remapfontfeature texquotes no mapping= - -%D Variants: - -\unexpanded\def\variant[#1]% - {\dosetscaledfont - \font\variantfont\truefontname{\fontstringA\fontstylesuffix\fontvariant\fontstringA{#1}} at \scaledfont - \variantfont} - -%D Possible optimizations: - -% \def\updatefontparameters -% {\edef\@@fontfeatures{\truefontdata\fontfile\s!features}% -% \edef\@@fontskewchar{\truefontdata\fontfile\s!skewchar}} - -% \def\setfontcharacteristics -% {\updatefontparameters % redundant, will go away, faster too -% \the\everyfont} - -% \let\synchronizepatternswithfont\relax - -%D Names: - -% We need to move the feature into the filename else it may be -% overloaded by another reference. For instance the definition of -% a regular and caps variant can use the same font. - -% We could use an indirect method ... store in 'array' and refer to -% slot. - -\def\definefontsynonym[#1]#2[#3]% - {\edef\@@fontname{#1}% - \edef\@@fontfile{#3}% - \doifnextoptionalelse\dodefinefontsynonym\nodefinefontsynonym} - -\def\nodefinefontsynonym - {\@EA\let\csname\??ff\fontclass\@@fontname\endcsname\@@fontfile} - -\def\dodefinefontsynonym[#1]% - {\edef\@@fontdata{#1}% - \ifx\@@fontdata\empty - \nodefinefontsynonym - \else - \ifx\fontclass\empty - \getfontparameters - \else - \getglobalfontparameters - \fi - \ifcsname\??ff\@@fontfile\s!features\endcsname - \@EA\edef\csname\??ff\fontclass\@@fontname\endcsname{\@@fontfile*\csname\??ff\@@fontfile\s!features\endcsname}% - \@EA\let\csname\??ff\@@fontfile\s!features\endcsname\undefined - \else - \nodefinefontsynonym - \fi - \fi} - -\let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater - -% simple version -% -% \def\truefontname#1% -% {\@EA\dotruefontname#1*\relax} -% -% \def\dotruefontname#1*#2\relax -% {\ifcsname\??ff\fontclass#1\endcsname -% \@EA\truefontname\csname\??ff\fontclass#1\endcsname -% \else\ifcsname\??ff#1\endcsname -% \@EA\truefontname\csname\??ff#1\endcsname -% \else -% #1% -% \fi\fi} -% -% last counts -% -% \def\truefontname#1% -% {\@EA\dotruefontname#1*\empty*\relax} -% -% \def\dotruefontname#1*#2#3*#4\relax -% {\ifcsname\??ff\fontclass#1\endcsname -% \ifx#2\empty -% \@EA\truefontname\csname\??ff\fontclass#1\endcsname -% \else -% \@EA\truefontname\csname\??ff\fontclass#1\endcsname*#2#3% -% \fi -% \else\ifcsname\??ff#1\endcsname -% \ifx#2\empty -% \@EA\truefontname\csname\??ff#1\endcsname -% \else -% \@EA\truefontname\csname\??ff#1\endcsname*#2#3% -% \fi -% \else -% \ifx#2\empty -% #1% -% \else -% #1*#2#3% -% \fi -% \fi\fi} -% -% first counts - -\def\truefontname#1% - {\@EA\dotruefontname#1*\empty*\relax} - -\def\dotruefontname#1*#2#3*#4\relax - {\ifcsname\??ff\fontclass#1\endcsname - \ifx#2\empty - \@EA\truefontname\csname\??ff\fontclass#1\endcsname - \else - \@EA\redotruefontname\csname\??ff\fontclass#1\endcsname*#2#3% - \fi - \else\ifcsname\??ff#1\endcsname - \ifx#2\empty - \@EA\truefontname\csname\??ff#1\endcsname - \else - \@EA\redotruefontname\csname\??ff#1\endcsname*#2#3% - \fi - \else - #1\ifx#2\empty\else*#2#3\fi - \fi\fi} - -\def\redotruefontname#1% - {\@EA\dodotruefontname#1*\relax} - -\def\dodotruefontname#1*#2\relax - {\ifcsname\??ff\fontclass#1\endcsname - \@EA\redotruefontname\csname\??ff\fontclass#1\endcsname - \else\ifcsname\??ff#1\endcsname - \@EA\redotruefontname\csname\??ff#1\endcsname - \else - #1% - \fi\fi} - -%D Default: - -\def\defaultfontfile{file:lmmono10-regular} - -%D Maybe: - -% \def\updatefontparameters -% {\edef\@@fontfeatures{\truefontdata\fontfile \s!features}% -% \edef\@@fontskewchar{\truefontdata\fontfile \s!skewchar}} - -% \def\setfontcharacteristics -% {%\updatefontparameters % redundant, will go away, faster too -% \the\everyfont -% \synchronizepatternswithfont} - -\protect \endinput - -% \starttypescript[serif] [myzhfont] -% \definefontsynonym [Serif] [file:SimSun] -% \definefontsynonym [SerifBold] [file:SimSun] -% \definefontsynonym [SerifItalic] [file:SimSun] -% \definefontsynonym [SerifBoldItalic] [file:SimSun] -% \stoptypescript -% \starttypescript[sans] [myzhfont] -% \definefontsynonym [Sans] [file:SimSun] -% \definefontsynonym [SansBold] [file:SimSun] -% \definefontsynonym [SansItalic] [file:SimSun] -% \definefontsynonym [SansBoldItalic] [file:SimSun] -% \stoptypescript -% \starttypescript[mono] [myzhfont] -% \definefontsynonym [Mono] [file:SimSun] -% \definefontsynonym [MonoBold] [file:SimSun] -% \definefontsynonym [MonoItalic] [file:SimSun] -% \definefontsynonym [MonoBoldItalic] [file:SimSun] -% \stoptypescript -% \definetypeface [myzhfont] [rm] [serif][myzhfont] [default] -% \definetypeface [myzhfont] [ss] [sans] [myzhfont] [default] -% \definetypeface [myzhfont] [tt] [mono] [myzhfont] [default] - -% \starttext -% % on windows: make sure fonts.conf has no cache mentioned -% % -% % 64 sec xetex, 11 sec luatex (56 sec xetex when \nobigmath) -% % -% \setupbodyfont[myzhfont] \dorecurse{10000}{{hello {\switchtobodyfont[myzhfont] 你好}}\par} -% % -% % 67 sec xetex, 11.5 sec luatex -% % -% % \dorecurse{10000}{{hello {\switchtobodyfont[myzhfont] 你好}}\par} -% % -% % 5 sec xetex, 7 sec luatex -% % -% % \setupbodyfont[myzhfont] \dorecurse{10000}{{hello {你好}}\par} -% % -% % 5 sec xetex, 7 sec luatex -% % -% % \setupbodyfont[myzhfont] \dorecurse{10000}{{\bf hello {你好}}\par} -% \stoptext - diff --git a/tex/context/base/grph-fig.mkiv b/tex/context/base/grph-fig.mkiv index 61f78f09e..415a2aa76 100644 --- a/tex/context/base/grph-fig.mkiv +++ b/tex/context/base/grph-fig.mkiv @@ -43,8 +43,7 @@ {\bgroup \pushmacro\textunderscore \edef\textunderscore{\string_}% brrr, temp hack, still needed? - \calculateexternalfigure [][#1][#2][#3][#4][#5]% [] is dummy dwcomp - \calculateexternalscreenfigure[][#1][#2][#3][#4][#5]% [] is dummy dwcomp + \calculateexternalfigure[][#1][#2][#3][#4][#5]% [] is dummy dwcomp \popmacro\textunderscore \box\foundexternalfigure \egroup} @@ -56,14 +55,16 @@ [\??ef] [\c!width=\figurewidth, \c!height=\figureheight, - \c!background=\v!screen, - \c!backgroundscreen=.8, + \c!background=\v!color, + \c!backgroundcolor=missingfigurecolor, \c!frame=\@@efframe]}% {\tt\tfxx \nohyphens name: \expanded{\verbatimstring{#1}}\\% file: \expanded{\verbatimstring{#2}}\\% state: \expanded{\verbatimstring{#3}}}} +\definecolor[missingfigurecolor][s=.8] + \def\externalfigureplaceholder#1#2#3% {\localframed [\??ef] @@ -186,89 +187,91 @@ %D Still undocumented! No one uses it I think, better be done with layers. -\newcount\efreference -\newdimen\efxsteps -\newdimen\efysteps - -\def\calculateefsteps - {\ifnum0\@@exxmax=\zerocount - \ifnum0\@@exymax=\zerocount - \def\@@exymax{24}% - \fi - \efysteps\figureheight \divide\efysteps \@@exymax - \efxsteps\efysteps - \dimen0=\figurewidth - \advance\dimen0 \efysteps - \divide \dimen0 \efysteps - \edef\@@exxmax{\number\dimen0}% - \else - \efxsteps\figurewidth \divide\efxsteps \@@exxmax - \efysteps\figureheight \divide\efysteps \@@exymax - \fi} - -\def\efcomment#1(#2,#3)#4(#5,#6)% {kader}(x,y)(h,b)[...]{tekst} - {\def\complexefdocomment[##1]##2% - {\position(#2,#3)% - {\setnostrut - \framed - [\c!width=#5\efxsteps, - \c!height=#6\exysteps, - \c!offset=\v!none, - \c!frame=#1, - ##1]% - {##2}}}% - \complexorsimpleempty\efdocomment} - -\def\efnocomment(#1,#2)#3(#4,#5)% (x,y)(h,b)[...]{tekst} - {\def\complexefdonocomment[##1]##2{}% - \complexorsimpleempty\efdonocomment} - -\def\efdomarker(#1,#2)#3#4% (h,b){kader}{tekst} - {\framed - [\c!width=#1\efxsteps, - \c!height=#2\efysteps, - \c!offset=\v!none, - \c!frame=#3]% - {#4}} - -\def\effigure#1% - {\position(0,0){\getvalue{#1}}} - -\def\efdoarea(#1,#2)#3#4% (h,b){kader}{tekst} - {\bgroup - \setnostrut - \framed - [\c!width=#1\efxsteps, - \c!height=#2\efysteps, - \c!offset=\!!zeropoint, - \c!frame=#3] - {#4}% - \egroup} - -\def\efgoto(#1,#2)#3[#4]% (h,b)kader[ref] - {\setbox0=\vbox{\efdoarea(#1,#2)#3{}}% - \gotobox{\copy0}[#4]} - -\def\efmark(#1,#2)#3(#4,#5)#6[#7]% - {\advance\efreference \plusone - \position(#1,#2) - {\hbox{\the\efreference}}% - \position(#1,#2) - {\gotosomeinternal\s!vwb{#7}\realfolio - {\efdomarker(#4,#5)\v!on{\thisissomeinternal\s!vwa{#7}}}}} - -\def\eftext#1(#2,#3)#4(#5,#6)#7[#8]% - {\advance\efreference \plusone - \hbox - {\quad - \thisissomeinternal\s!vwb{#8}% - \gotosomeinternal \s!vwa{#8}\realfolio - {\hbox to 1.5em{\the\efreference\presetgoto\hfill}}% - \quad#1 (#2,#3) (#5,#6) [#8]\hfill}% - \endgraf} - -\def\efthisis(#1,#2)#3[#4]% - {\efdoarea(#1,#2){#3}{\pagereference[#4]}} +% when there is need for this i'll reimplement it +% +% \newcount\efreference +% \newdimen\efxsteps +% \newdimen\efysteps +% +% \def\calculateefsteps +% {\ifnum0\@@exxmax=\zerocount +% \ifnum0\@@exymax=\zerocount +% \def\@@exymax{24}% +% \fi +% \efysteps\figureheight \divide\efysteps \@@exymax +% \efxsteps\efysteps +% \dimen0=\figurewidth +% \advance\dimen0 \efysteps +% \divide \dimen0 \efysteps +% \edef\@@exxmax{\number\dimen0}% +% \else +% \efxsteps\figurewidth \divide\efxsteps \@@exxmax +% \efysteps\figureheight \divide\efysteps \@@exymax +% \fi} +% +% \def\efcomment#1(#2,#3)#4(#5,#6)% {kader}(x,y)(h,b)[...]{tekst} +% {\def\complexefdocomment[##1]##2% +% {\position(#2,#3)% +% {\setnostrut +% \framed +% [\c!width=#5\efxsteps, +% \c!height=#6\exysteps, +% \c!offset=\v!none, +% \c!frame=#1, +% ##1]% +% {##2}}}% +% \complexorsimpleempty\efdocomment} +% +% \def\efnocomment(#1,#2)#3(#4,#5)% (x,y)(h,b)[...]{tekst} +% {\def\complexefdonocomment[##1]##2{}% +% \complexorsimpleempty\efdonocomment} +% +% \def\efdomarker(#1,#2)#3#4% (h,b){kader}{tekst} +% {\framed +% [\c!width=#1\efxsteps, +% \c!height=#2\efysteps, +% \c!offset=\v!none, +% \c!frame=#3]% +% {#4}} +% +% \def\effigure#1% +% {\position(0,0){\getvalue{#1}}} +% +% \def\efdoarea(#1,#2)#3#4% (h,b){kader}{tekst} +% {\bgroup +% \setnostrut +% \framed +% [\c!width=#1\efxsteps, +% \c!height=#2\efysteps, +% \c!offset=\!!zeropoint, +% \c!frame=#3] +% {#4}% +% \egroup} +% +% \def\efgoto(#1,#2)#3[#4]% (h,b)kader[ref] +% {\setbox0=\vbox{\efdoarea(#1,#2)#3{}}% +% \gotobox{\copy0}[#4]} +% +% \def\efmark(#1,#2)#3(#4,#5)#6[#7]% +% {\advance\efreference \plusone +% \position(#1,#2) +% {\hbox{\the\efreference}}% +% \position(#1,#2) +% {\gotosomeinternal\s!vwb{#7}\realfolio +% {\efdomarker(#4,#5)\v!on{\thisissomeinternal\s!vwa{#7}}}}} +% +% \def\eftext#1(#2,#3)#4(#5,#6)#7[#8]% +% {\advance\efreference \plusone +% \hbox +% {\quad +% \thisissomeinternal\s!vwb{#8}% +% \gotosomeinternal \s!vwa{#8}\realfolio +% {\hbox to 1.5em{\the\efreference\presetgoto\hfill}}% +% \quad#1 (#2,#3) (#5,#6) [#8]\hfill}% +% \endgraf} +% +% \def\efthisis(#1,#2)#3[#4]% +% {\efdoarea(#1,#2){#3}{\pagereference[#4]}} \newbox\colorbarbox @@ -402,41 +405,6 @@ \def\startfigure {\grabuntil{\e!stop\v!figure}\dostartfigure} -%D defining sound tracks: -%D -%D \starttyping -%D \useexternalsoundtrack[label][file] -%D \stoptyping -%D -%D associated actions: StartSound StopSound PauseSound ResumeSound -%D -%D Todo: like external figures, also search on path, -%D although, they need to be present ar viewing time, so ... - -\def\useexternalsoundtrack - {\dodoubleargument\douseexternalsoundtrack} - -\def\douseexternalsoundtrack[#1][#2]% - {\setgvalue{\??sd:#1}{#2}} - -\def\checksoundtrack#1% - {\iflocation - \doifdefined{\??sd:#1}{\doifvaluesomething{\??sd:#1} - {\doinsertsoundtrack{\getvalue{\??sd:#1}}{#1}\@@sdoption - % brr, \..empty not really needed and maybe even wrong; - % also, not here but in driver - % well, no: sounds need to be reinitialize each time (i.e., be on page), so no - }}% \letgvalueempty{\??sd:#1}}}% - \fi} - -\setexecutecommandcheck {startsound} \checksoundtrack - -\def\setupexternalsoundtracks - {\dodoubleargument\getparameters[\??sd]} - -\setupexternalsoundtracks - [\c!option=] - %D NEW: used in styledesign manual % \setbuffer[typeset-b]\endbuffer diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua index 5b3bff36c..3dfcee739 100644 --- a/tex/context/base/grph-inc.lua +++ b/tex/context/base/grph-inc.lua @@ -36,6 +36,7 @@ run TeX code from within Lua. Some more functionality will move to Lua. local texsprint, format, lower, find, match = tex.sprint, string.format, string.lower, string.find, string.match local ctxcatcodes = tex.ctxcatcodes +local variables = interfaces.variables local trace_figures = false trackers.register("figures.locating",function(v) trace_figures = v end) @@ -107,16 +108,16 @@ figures.order = { } figures.formats = { - ["pdf"] = { }, - ["mps"] = { patterns = { "%d+" } }, + ["pdf"] = { list = { "pdf" } }, + ["mps"] = { patterns = { "mps", "%d+" } }, ["jpg"] = { list = { "jpg", "jpeg" } }, - ["png"] = { } , + ["png"] = { list = { "png" } }, ["jbig"] = { list = { "jbig", "jbig2", "jb2" } }, ["svg"] = { list = { "svg", "svgz" } }, ["eps"] = { list = { "eps", "ai" } }, ["mov"] = { list = { "mov", "avi" } }, ["buffer"] = { list = { "tmp", "buffer", "buf" } }, - ["tex"] = { }, + ["tex"] = { list = { "tex" } }, } function figures.setlookups() @@ -142,16 +143,19 @@ end figures.setlookups() local function register(tag,target,what) - local data = figures.formats[target] - if data then - local d = data[tag] - if d and not table.contains(d,what) then - d[#d+1] = what - else - data[tag] = { what } - end + local data = figures.formats[target] -- resolver etc + if not data then + data = { } + figures.formats[target] = data + end + local d = data[tag] -- list or pattern + if d and not table.contains(d,what) then + d[#d+1] = what -- suffix or patternspec else - figures.formats[target] = { } + data[tag] = { what } + end + if not table.contains(figures.order,target) then + figures.order[#figures.order+1] = target end figures.setlookups() end @@ -208,7 +212,7 @@ end --~ end function figures.hash(data) - return tostring(data.status.private) -- the + return data.status.hash or tostring(data.status.private) -- the -- return data.status.fullname .. "+".. (data.status.page or data.request.page or 1) -- img is still not perfect end @@ -267,9 +271,9 @@ do --~ local w, h = tonumber(request.width), tonumber(request.height) request.page = math.max(tonumber(request.page) or 1,1) request.size = img.check_size(request.size) - request.object = iv[request.object] == "yes" - request["repeat"] = iv[request["repeat"]] == "yes" - request.preview = iv[request.preview] == "yes" + request.object = iv[request.object] == variables.yes + request["repeat"] = iv[request["repeat"]] == variables.yes + request.preview = iv[request.preview] == variables.yes request.cache = request.cache ~= "" and request.cache request.prefix = request.prefix ~= "" and request.prefix request.format = request.format ~= "" and request.format @@ -603,12 +607,15 @@ function figures.existers.generic(askedname) end function figures.checkers.generic(data) local dr, du, ds = data.request, data.used, data.status - local name, page, size = du.fullname or "unknown generic", du.page or dr.page, dr.size or "crop" - local hash = name .. "->" .. page .. "->" .. size + local name, page, size, color = du.fullname or "unknown generic", du.page or dr.page, dr.size or "crop", dr.color or "natural" + local hash = name .. "->" .. page .. "->" .. size .. "->" .. color local figure = figures.loaded[hash] if figure == nil then figure = img.new { filename = name, page = page, pagebox = dr.size } + backends.codeinjections.setfigurecolorspace(data,figure) figure = (figure and img.scan(figure)) or false + local f, d = backends.codeinjections.setfigurealternative(data,figure) + figure, data = f or figure, d or data figures.loaded[hash] = figure end if figure then @@ -616,6 +623,7 @@ function figures.checkers.generic(data) du.height = figure.height du.pages = figure.pages ds.private = figure + ds.hash = hash end return data end @@ -629,7 +637,6 @@ function figures.includers.generic(data) if figure == nil then figure = ds.private if figure then ---~ figure.page = dr.page or '1' figure = img.copy(figure) figure = (figure and img.clone(figure,data.request)) or false end diff --git a/tex/context/base/grph-inc.mkii b/tex/context/base/grph-inc.mkii index 231ce902e..acb5ae7e9 100644 --- a/tex/context/base/grph-inc.mkii +++ b/tex/context/base/grph-inc.mkii @@ -1212,4 +1212,28 @@ \setanalyzedfiguredimensions\plustwo \fi} +%D This is \MKII\ only and comes from cont-new (maybe used in a project). + +% maybe to be integrated (option=...) + +\def\directexternalfigure + {\dodoubleempty\dodirectexternalfigure} + +\def\dodirectexternalfigure[#1][#2]% + {\bgroup + \getparameters[\??ef][\c!type=\splitofftype,\c!page=1,#2]% + \sanitizefilename#1\to\expandedfigurename + \splitfilename\expandedfigurename + \let\@@DriverImageWidth \!!zeropoint + \let\@@DriverImageHeight \!!zeropoint + \let\@@DriverImageFile \splitofffull + \let\@@DriverImageType \@@eftype + \let\@@DriverImageMethod \@@eftype + \let\@@DriverImageLabel \empty + \let\@@DriverImagePage \@@efpage + \doinsertfile + \egroup} + +% \directexternalfigure[cow.pdf] + \protect \endinput diff --git a/tex/context/base/grph-inc.mkiv b/tex/context/base/grph-inc.mkiv index 96ea2d74a..d5151c521 100644 --- a/tex/context/base/grph-inc.mkiv +++ b/tex/context/base/grph-inc.mkiv @@ -21,6 +21,7 @@ %D - a few more obscure things \registerctxluafile{grph-inc}{1.001} +\registerctxluafile{grph-u3d}{1.001} % this will change \unprotect @@ -198,12 +199,7 @@ % a transparent color is used \doifsomething\@@efforegroundcolor {\def\@@efbackground{\v!foreground,\v!color}% - \def\@@efbackgroundcolor{\@@efforegroundcolor}}% - \doifsomething\@@efcolor - {\doifcolorelse\@@efcolor - {\checkpredefinedcolor[\@@efcolor]% - \doregisterfigurecolor\@@efcolor}}% - \donothing} + \def\@@efbackgroundcolor{\@@efforegroundcolor}}} \appendtoks \checkfigureusersettings @@ -237,6 +233,9 @@ \resetfigurevariables \dosetefparameters{#4}{#5}{#6}% \checkfigurevariables +% \begingroup +% \color[\@@efcolor]{\xdef\globcolorattr{\internalspotcolorname}} +% \endgroup \ctxlua{figures.push { name="#3", label="#2", % todo: \@eflabel @@ -250,6 +249,7 @@ controls="\@@efcontrols", preview="\@@efpreview", display="\@@efdisplay", + color="\internalspotcolorparent\@@efcolor", % hack is needed ["repeat"]="\@@efrepeat", width="\@@efwidth", % can be crap height="\@@efheight", % can be crap @@ -361,25 +361,6 @@ \let\feedbackexternalfigure\relax % \gobblefourarguments \let\dowithfigure \relax -% \let\lastfigureobjectname\empty - -\def\calculateexternalscreenfigure[#1][#2][#3][#4][#5][#6]% - {\ifx\@@efdisplay\empty\else -% \doifnot\@@efobject\v!no -% {\doifobjectssupportedelse -% {\doifspecialavailableelse\doregisterfigure -% {\doshowfigurestate{screen alternative : start}% -% \bgroup -% \dosetefparameters{#4}{#5}{#6}% -% \doregisterfigure{FIG}{\lastfigureobjectname}% -% \let\@@ef@@scherm\@@efdisplay -% \calculateexternalfigure[#1][\@@ef@@scherm][\@@ef@@scherm][#4,\c!display=][#5][#6]% -% \doshowfigurestate{screen alternative : stop}% -% \egroup} -% {}} -% {}}% - \fi} - \def\getfiguredimensions {\dodoubleempty\dogetfiguredimensions} @@ -416,3 +397,49 @@ {\ctxlua{figures.bases.use("#1")}} \protect \endinput + +% \startbuffer +% \definecolor [blue] [c=1,m=.38,y=0,k=.64] +% \definecolor [yellow] [c=0,m=.28,y=1,k=.06] +% +% \definespotcolor [blue-100] [blue] [p=1] +% \definespotcolor [yellow-100] [yellow] [p=1] +% +% \definemultitonecolor [combicolor] [blue=.12,yellow=.28] [c=.1,m=.1,y=.3,k=.1] +% +% \definemultitonecolor [combicolor-b] [blue=1] [c=1,m=.38,y=0,k=.64] % force multitone +% \definemultitonecolor [combicolor-y] [yellow=1] [c=0,m=.28,y=1,k=.06] % force multitone +% +% \useexternalfigure[demo-a][mill.png] [object=no,width=.2\textwidth] +% \useexternalfigure[demo-b][hacker-bw.jpg][object=no,width=.2\textwidth] +% +% \startbaselinecorrection \startcombination[4*1] +% {\externalfigure[demo-a]} {no color} +% {\externalfigure[demo-a][color=combicolor]} {indexed duotone} +% {\externalfigure[demo-a][color=combicolor-b]} {spot color} +% {\externalfigure[demo-a][color=combicolor-y]} {spot color} +% \stopcombination \stopbaselinecorrection +% +% \startbaselinecorrection \startcombination[4*1] +% {\externalfigure[demo-b]} {no color} +% {\externalfigure[demo-b][color=combicolor]} {indexed duotone} +% {\externalfigure[demo-b][color=combicolor-b]} {spot color} +% {\externalfigure[demo-b][color=combicolor-y]} {spot color} +% \stopcombination \stopbaselinecorrection +% +% \startbaselinecorrection \startcombination[4*1] +% {\externalfigure[demo-a]} {no color} +% {\externalfigure[demo-a][color=combicolor]} {indexed duotone} +% {\externalfigure[demo-a][color=blue-100]} {spot color} +% {\externalfigure[demo-a][color=yellow-100]} {spot color} +% \stopcombination \stopbaselinecorrection +% +% \startbaselinecorrection \startcombination[4*1] +% {\externalfigure[demo-b]} {no color} +% {\externalfigure[demo-b][color=combicolor]} {indexed duotone} +% {\externalfigure[demo-b][color=blue-100]} {spot color} +% {\externalfigure[demo-b][color=yellow-100]} {spot color} +% \stopcombination \stopbaselinecorrection +% \stopbuffer +% +% \getbuffer \typebuffer diff --git a/tex/context/base/grph-u3d.lua b/tex/context/base/grph-u3d.lua new file mode 100644 index 000000000..e5944691c --- /dev/null +++ b/tex/context/base/grph-u3d.lua @@ -0,0 +1,45 @@ +if not modules then modules = { } end modules ['grph-u3d'] = { + version = 1.001, + comment = "companion to grph-inc.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- see lpdf-u3d.lua for comment + +local format = string.format + +local texsprint = tex.sprint +local ctxcatcodes = tex.ctxcatcodes + +function figures.checkers.u3d(data) + local dr, du, ds = data.request, data.used, data.status + local width = (dr.width or figures.defaultwidth):todimen() + local height = (dr.height or figures.defaultheight):todimen() + local foundname = du.fullname + dr.width, dr.height = width, height + du.width, du.height, du.foundname = width, height, foundname + texsprint(ctxcatcodes,format("\\startfoundexternalfigure{%ssp}{%ssp}",width,height)) + local annot, preview, ref = backends.pdf.helpers.insert3d { + foundname = foundname, + width = width, + height = height, + factor = number.dimenfactors.bp, + display = dr.display, + controls = dr.controls, + label = dr.label, + } + -- node.write(nodes.pdfannot(width,-height,0,annot())) + texsprint(ctxcatcodes,format("\\pdfannot width %ssp height %ssp {%s}",width,height,annot())) -- brrrr +--~ if ref then -- wrong ! a direct ref should work +--~ texsprint(ctxcatcodes,format("\\smash{\\pdfrefximage%s\\relax}",ref)) -- brrrr +--~ end + texsprint(ctxcatcodes,"\\stopfoundexternalfigure") + return data +end + +figures.includers.u3d = figures.includers.nongeneric + +figures.registersuffix("u3d","u3d") +figures.registersuffix("prc","u3d") diff --git a/tex/context/base/hand-def.mkii b/tex/context/base/hand-def.mkii new file mode 100644 index 000000000..0a19ce270 --- /dev/null +++ b/tex/context/base/hand-def.mkii @@ -0,0 +1,577 @@ +%D \module +%D [ file=hand-def, % was enco-pro +%D version=2000.29.09, +%D title=\CONTEXT\ Handling Macros, +%D subtitle=Default Protruding Factors, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=Hans Hagen] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is an experimental definition file. The protruding +%D values we use here are those found from \THANH's thesis. + +\startfonthandling [pure] + + \defineprotrudefactor , 0 1 + \defineprotrudefactor . 0 1 + \defineprotrudefactor : 0 1 + \defineprotrudefactor ; 0 1 + \defineprotrudefactor - 0 1 + + \defineprotrudefactor hyphen 0 1 + \defineprotrudefactor endash 0 .5 + \defineprotrudefactor emdash 0 .33 % .5 + +\stopfonthandling + +\startfonthandling [punctuation] + + \defineprotrudefactor ! 0 .2 + \defineprotrudefactor ' 0 .7 + \defineprotrudefactor ` .7 0 + \defineprotrudefactor ( .05 0 + \defineprotrudefactor ) 0 .05 + \defineprotrudefactor [ .05 0 + \defineprotrudefactor ] 0 .05 + \defineprotrudefactor , 0 .7 + \defineprotrudefactor - 0 .7 + \defineprotrudefactor . 0 .7 + \defineprotrudefactor : 0 .5 + \defineprotrudefactor ; 0 .5 + + \defineprotrudefactor rightupperninequote 0 .5 + \defineprotrudefactor leftupperninequote .5 0 + \defineprotrudefactor endash 0 .3 + \defineprotrudefactor emdash 0 .2 + + \defineprotrudefactor hyphen 0 .7 + +\stopfonthandling + +\startfonthandling [alpha] + + \defineprotrudefactor A .05 .05 + \defineprotrudefactor F 0 .05 + \defineprotrudefactor J .05 0 + \defineprotrudefactor K 0 .05 + \defineprotrudefactor L 0 .05 + \defineprotrudefactor T .05 .05 + \defineprotrudefactor V .05 .05 + \defineprotrudefactor W .05 .05 + \defineprotrudefactor X .05 .05 + \defineprotrudefactor Y .05 .05 + + \defineprotrudefactor k 0 .05 + \defineprotrudefactor r 0 .05 + \defineprotrudefactor t 0 .05 + \defineprotrudefactor v .05 .05 + \defineprotrudefactor w .05 .05 + \defineprotrudefactor x .05 .05 + \defineprotrudefactor y .05 .05 + +\stopfonthandling + +% ogoneks may need another treatment + +\startfonthandling [extended] + + \inherithandling Acircumflex A + \inherithandling acircumflex a + \inherithandling Ccircumflex C + \inherithandling ccircumflex c + \inherithandling Ecircumflex E + \inherithandling ecircumflex e + \inherithandling Gcircumflex G + \inherithandling gcircumflex g + \inherithandling Hcircumflex H + \inherithandling hcircumflex h + \inherithandling Icircumflex I + \inherithandling icircumflex i + \inherithandling Jcircumflex J + \inherithandling jcircumflex j + \inherithandling Ocircumflex O + \inherithandling ocircumflex o + \inherithandling Scircumflex S + \inherithandling scircumflex s + \inherithandling Ucircumflex U + \inherithandling ucircumflex u + \inherithandling Wcircumflex W + \inherithandling wcircumflex w + \inherithandling Ycircumflex Y + \inherithandling ycircumflex y + + \inherithandling Agrave A + \inherithandling agrave a + \inherithandling Egrave E + \inherithandling egrave e + \inherithandling Igrave I + \inherithandling igrave i + \inherithandling Ograve O + \inherithandling ograve o + \inherithandling Ugrave U + \inherithandling ugrave u + \inherithandling Ygrave Y + \inherithandling ygrave y + + \inherithandling Atilde A + \inherithandling atilde a + \inherithandling Itilde I + \inherithandling itilde i + \inherithandling Ntilde N + \inherithandling ntilde n + \inherithandling Otilde O + \inherithandling otilde o + \inherithandling Utilde U + \inherithandling utilde u + + \inherithandling Adiaeresis A + \inherithandling adiaeresis a + \inherithandling Ediaeresis E + \inherithandling ediaeresis e + \inherithandling Idiaeresis I + \inherithandling idiaeresis i + \inherithandling Odiaeresis O + \inherithandling odiaeresis o + \inherithandling Udiaeresis U + \inherithandling udiaeresis u + \inherithandling Ydiaeresis Y + \inherithandling ydiaeresis y + + \inherithandling Aacute A + \inherithandling aacute a + \inherithandling Cacute C + \inherithandling cacute c + \inherithandling Eacute E + \inherithandling eacute e + \inherithandling Iacute I + \inherithandling iacute i + \inherithandling Lacute L + \inherithandling lacute l + \inherithandling Nacute N + \inherithandling nacute n + \inherithandling Oacute O + \inherithandling oacute o + \inherithandling Racute R + \inherithandling racute r + \inherithandling Sacute s + \inherithandling sacute s + \inherithandling Uacute U + \inherithandling uacute u + \inherithandling Yacute Y + \inherithandling yacute y + \inherithandling Zacute Z + \inherithandling zacute z + + \inherithandling Dstroke D + \inherithandling dstroke d + \inherithandling Hstroke H + \inherithandling hstroke h + \inherithandling Tstroke T + \inherithandling tstroke t + + \inherithandling Cdotaccent C + \inherithandling cdotaccent c + \inherithandling Edotaccent E + \inherithandling edotaccent e + \inherithandling Gdotaccent G + \inherithandling gdotaccent g + \inherithandling Idotaccent I + \inherithandling idotaccent i + \inherithandling Zdotaccent Z + \inherithandling zdotaccent z + + \inherithandling Amacron A + \inherithandling amacron a + \inherithandling Emacron E + \inherithandling emacron e + \inherithandling Imacron I + \inherithandling imacron i + \inherithandling Omacron O + \inherithandling omacron o + \inherithandling Umacron U + \inherithandling umacron u + + \inherithandling Ccedilla C + \inherithandling ccedilla c + \inherithandling Kcedilla K + \inherithandling kcedilla k + \inherithandling Lcedilla L + \inherithandling lcedilla l + \inherithandling Ncedilla N + \inherithandling ncedilla n + \inherithandling Rcedilla R + \inherithandling rcedilla r + \inherithandling Scedilla S + \inherithandling scedilla s + \inherithandling Tcedilla T + \inherithandling tcedilla t + + \inherithandling Ohungarumlaut O + \inherithandling ohungarumlaut o + \inherithandling Uhungarumlaut U + \inherithandling uhungarumlaut u + + \inherithandling Aogonek A + \inherithandling aogonek a + \inherithandling Eogonek E + \inherithandling eogonek e + \inherithandling Iogonek I + \inherithandling iogonek i + \inherithandling Uogonek U + \inherithandling uogonek u + + \inherithandling Aring A + \inherithandling aring a + \inherithandling Uring U + \inherithandling uring u + + \inherithandling Abreve A + \inherithandling abreve a + \inherithandling Ebreve E + \inherithandling ebreve e + \inherithandling Gbreve G + \inherithandling gbreve g + \inherithandling Ibreve I + \inherithandling ibreve i + \inherithandling Obreve O + \inherithandling obreve o + \inherithandling Ubreve U + \inherithandling ubreve u + + \inherithandling Ccaron C + \inherithandling ccaron c + \inherithandling Dcaron D + \inherithandling dcaron d + \inherithandling Ecaron E + \inherithandling ecaron e + \inherithandling Lcaron L + \inherithandling lcaron l + \inherithandling Ncaron N + \inherithandling ncaron n + \inherithandling Rcaron R + \inherithandling rcaron r + \inherithandling Scaron S + \inherithandling scaron s + \inherithandling Tcaron T + \inherithandling tcaron t + \inherithandling Ycaron Y + \inherithandling ycaron y + \inherithandling Zcaron Z + \inherithandling zcaron z + + \inherithandling AEligature E + \inherithandling aeligature e + \inherithandling Lstroke I + \inherithandling lstroke o + \inherithandling Ostroke O + \inherithandling ostroke o + \inherithandling OEligature O + \inherithandling oeligature o + + \inherithandling Ssharp S + \inherithandling ssharp s + \inherithandling IJligature J + \inherithandling ijligature j + + \inherithandling aumlaut a + \inherithandling eumlaut e + \inherithandling iumlaut i + \inherithandling oumlaut o + \inherithandling uumlaut u + + \inherithandling Aumlaut A + \inherithandling Eumlaut E + \inherithandling Iumlaut I + \inherithandling Oumlaut O + \inherithandling Uumlaut U + + \inherithandling Lslash L + \inherithandling lslash l + \inherithandling Dslash D + \inherithandling dslash d + \inherithandling Oslash O + \inherithandling oslash o + + \inherithandling Eszett S + \inherithandling eszett s + + \inherithandling Thorn P + \inherithandling thorn p + + % vietnamese + + \inherithandling Ahook A + \inherithandling ahook a + \inherithandling Ehook E + \inherithandling ehook e + \inherithandling Ihook I + \inherithandling ihook i + \inherithandling Ohook O + \inherithandling ohook o + \inherithandling Uhook U + \inherithandling uhook u + \inherithandling Yhook Y + \inherithandling yhook y + + \inherithandling Acircumflexgrave A + \inherithandling Acircumflexacute A + \inherithandling Acircumflextilde A + \inherithandling Acircumflexhook A + \inherithandling acircumflexgrave a + \inherithandling acircumflexacute a + \inherithandling acircumflextilde a + \inherithandling acircumflexhook a + \inherithandling Ecircumflexgrave E + \inherithandling Ecircumflexacute E + \inherithandling Ecircumflextilde E + \inherithandling Ecircumflexhook E + \inherithandling ecircumflexgrave e + \inherithandling ecircumflexacute e + \inherithandling ecircumflextilde e + \inherithandling ecircumflexhook e + \inherithandling Ocircumflexgrave O + \inherithandling Ocircumflexacute O + \inherithandling Ocircumflextilde O + \inherithandling Ocircumflexhook O + \inherithandling ocircumflexgrave o + \inherithandling ocircumflexacute o + \inherithandling ocircumflextilde o + \inherithandling ocircumflexhook o + + \inherithandling Abrevegrave A + \inherithandling Abreveacute A + \inherithandling Abrevetilde A + \inherithandling Abrevehook A + \inherithandling abrevegrave a + \inherithandling abreveacute a + \inherithandling abrevetilde a + \inherithandling abrevehook a + + \inherithandling Adotbelow A + \inherithandling adotbelow a + \inherithandling Edotbelow E + \inherithandling edotbelow e + \inherithandling Idotbelow I + \inherithandling idotbelow i + \inherithandling Odotbelow O + \inherithandling odotbelow o + \inherithandling Udotbelow U + \inherithandling udotbelow u + \inherithandling Ydotbelow Y + \inherithandling ydotbelow y + + \inherithandling Ohorndotbelow O + \inherithandling ohorndotbelow o + \inherithandling Uhorndotbelow U + \inherithandling uhorndotbelow u + + \inherithandling Acircumflexdotbelow A + \inherithandling acircumflexdotbelow a + \inherithandling Ecircumflexdotbelow E + \inherithandling ecircumflexdotbelow e + \inherithandling Ocircumflexdotbelow O + \inherithandling ocircumflexdotbelow o + + \inherithandling Abrevedotbelow A + \inherithandling abrevedotbelow a + + \inherithandling Ohorn O + \inherithandling Ohorngrave O + \inherithandling Ohornacute O + \inherithandling Ohorntilde O + \inherithandling Ohornhook O + \inherithandling ohorn o + \inherithandling ohorngrave o + \inherithandling ohornacute o + \inherithandling ohorntilde o + \inherithandling ohornhook o + \inherithandling Uhorn U + \inherithandling Uhorngrave U + \inherithandling Uhornacute U + \inherithandling Uhorntilde U + \inherithandling Uhornhook U + \inherithandling uhorn u + \inherithandling uhorngrave u + \inherithandling uhornacute u + \inherithandling uhorntilde u + \inherithandling uhornhook u + + \inherithandling Ytilde Y + \inherithandling ytilde y + \inherithandling Etilde E + \inherithandling etilde e + +\stopfonthandling + +\startfonthandling [hz] + + \defineadjustfactor A .5 + \defineadjustfactor B .7 + \defineadjustfactor C .7 + \defineadjustfactor D .5 + \defineadjustfactor E .7 + \defineadjustfactor F .7 + \defineadjustfactor G .5 + \defineadjustfactor H .7 + \defineadjustfactor K .7 + \defineadjustfactor M .7 + \defineadjustfactor N .7 + \defineadjustfactor O .5 + \defineadjustfactor P .7 + \defineadjustfactor Q .5 + \defineadjustfactor R .7 + \defineadjustfactor S .7 + \defineadjustfactor U .7 + \defineadjustfactor W .7 + \defineadjustfactor Z .7 + + \defineadjustfactor a .7 + \defineadjustfactor b .7 + \defineadjustfactor c .7 + \defineadjustfactor d .7 + \defineadjustfactor e .7 + \defineadjustfactor g .7 + \defineadjustfactor h .7 + \defineadjustfactor k .7 + \defineadjustfactor m .7 + \defineadjustfactor n .7 + \defineadjustfactor o .7 + \defineadjustfactor p .7 + \defineadjustfactor q .7 + \defineadjustfactor s .7 + \defineadjustfactor u .7 + \defineadjustfactor w .7 + \defineadjustfactor z .7 + + \defineadjustfactor 2 .7 + \defineadjustfactor 3 .7 + \defineadjustfactor 6 .7 + \defineadjustfactor 8 .7 + \defineadjustfactor 9 .7 + +% \defineadjustfactor hyphen ? +% \defineadjustfactor endash ? +% \defineadjustfactor emdash ? + +\stopfonthandling + +% no ligs other than fi fl etc, no --- and '' + +\startfonthandling[noligs] + + \settagcode - {\notagcode} + \settagcode ' {\notagcode} + \settagcode ` {\notagcode} + \settagcode ? {\notagcode} + \settagcode ! {\notagcode} + +\stopfonthandling + +% \startfonthandling[noligs] +% \dostepwiserecurse{0}{255}{1}{\expanded{\settagcode \recurselevel\space\notagcode\space}} +% \stopfonthandling + +% \definefonthandling [noligs] [noligs] [type=tag] + % \setupfontsynonym[Serif][handling=noligs] +% \definefont[test][Serif at 12.34pt] +% +% {``fi--ffl---ffi'' \test ``fi--ffl---ffi''} + +\unprotect + +% beware: extended extends the preceding vector (both protruding and +% adjusting) but as long as the normal ascii characters are not set +% beforehand, they default to normal + +% protruding variants -- slanted/italic is yet incomplete + +\definefonthandling [pure] [pure] [\c!type=\v!hanging] +\definefonthandling [purebold] [pure] [\c!type=\v!hanging] +\definefonthandling [pureslanted] [pure] [\c!type=\v!hanging,\c!right=1.5] +\definefonthandling [pureitalic] [pure] [\c!type=\v!hanging,\c!right=1.5] +\definefonthandling [pureboldslanted] [pure] [\c!type=\v!hanging,\c!right=1.5] +\definefonthandling [purebolditalic] [pure] [\c!type=\v!hanging,\c!right=1.5] + +\definefonthandling [normal] [punctuation,alpha,extended] [\c!type=\v!hanging] +\definefonthandling [normalbold] [punctuation,alpha,extended] [\c!type=\v!hanging] +\definefonthandling [normalslanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] +\definefonthandling [normalitalic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] +\definefonthandling [normalboldslanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] +\definefonthandling [normalbolditalic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] + +% for old times sake + +\definefonthandling [bold] [punctuation,alpha,extended] [\c!type=\v!hanging] +\definefonthandling [slanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] +\definefonthandling [italic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] +\definefonthandling [boldslanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] +\definefonthandling [bolditalic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] + +% hz variants + +\definefonthandling [hz] [hz,extended] [\c!type=\v!hz] % min=20 max=20 step=5 + +% combined variants + +\definefonthandling [quality] [hz,pure] +\definefonthandling [highquality] [hz,normal] + +% noligs (xml) : \definefonthandling [default] [noligs] + +\definefonthandling [noligs] [noligs] [\c!type=tag] + +% experimental values ! +% +% \definefontsynonym[myfont][Serif][handling=prespacing] +% \definefont[whatever][myfont sa 1] +% \setupalign[spacing] +% +% \whatever look at this: we now have a proper spacing feature and, hurray, +% get rid of active punctuation! + +\startfonthandling [flexspacing] + + \definespacefactor : 0 1.25 .25 .25 + + \definespacefactor , 0 1 .25 .25 + \inheritspacefactor ; , + + \definespacefactor . 0 1.5 .25 .25 + \inheritspacefactor ! . + \inheritspacefactor ? . + +\stopfonthandling + +\definefonthandling[flexspacing][flexspacing][\c!type=\v!spacing] + +\startfonthandling [prespacing] % better name needed + + \definespacefactor : .25 .25 0 0 + \inheritspacefactor ; : + \inheritspacefactor ! : + \inheritspacefactor ? : + +\stopfonthandling + +\definefonthandling[prespacing][prespacing][\c!type=\v!spacing] % factor=.5 + +% A special case of guillemots, beware: when used ungrouped, +% it overloads all successive (current) encoding vector +% instances! Will be obsolete soon. + +\startfonthandling [glm] + + \overloadcharacter guilsingleleft {\defaultcharacter\guilsingleleft } + \overloadcharacter guilsingleright {\defaultcharacter\guilsingleright} + \overloadcharacter leftguillemot {\defaultcharacter\leftguillemot } + \overloadcharacter rightguillemot {\defaultcharacter\rightguillemot } + +\stopfonthandling + +\definefonthandling [glm] [glm] + +\protect \endinput diff --git a/tex/context/base/hand-def.tex b/tex/context/base/hand-def.tex deleted file mode 100644 index 0a19ce270..000000000 --- a/tex/context/base/hand-def.tex +++ /dev/null @@ -1,577 +0,0 @@ -%D \module -%D [ file=hand-def, % was enco-pro -%D version=2000.29.09, -%D title=\CONTEXT\ Handling Macros, -%D subtitle=Default Protruding Factors, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This is an experimental definition file. The protruding -%D values we use here are those found from \THANH's thesis. - -\startfonthandling [pure] - - \defineprotrudefactor , 0 1 - \defineprotrudefactor . 0 1 - \defineprotrudefactor : 0 1 - \defineprotrudefactor ; 0 1 - \defineprotrudefactor - 0 1 - - \defineprotrudefactor hyphen 0 1 - \defineprotrudefactor endash 0 .5 - \defineprotrudefactor emdash 0 .33 % .5 - -\stopfonthandling - -\startfonthandling [punctuation] - - \defineprotrudefactor ! 0 .2 - \defineprotrudefactor ' 0 .7 - \defineprotrudefactor ` .7 0 - \defineprotrudefactor ( .05 0 - \defineprotrudefactor ) 0 .05 - \defineprotrudefactor [ .05 0 - \defineprotrudefactor ] 0 .05 - \defineprotrudefactor , 0 .7 - \defineprotrudefactor - 0 .7 - \defineprotrudefactor . 0 .7 - \defineprotrudefactor : 0 .5 - \defineprotrudefactor ; 0 .5 - - \defineprotrudefactor rightupperninequote 0 .5 - \defineprotrudefactor leftupperninequote .5 0 - \defineprotrudefactor endash 0 .3 - \defineprotrudefactor emdash 0 .2 - - \defineprotrudefactor hyphen 0 .7 - -\stopfonthandling - -\startfonthandling [alpha] - - \defineprotrudefactor A .05 .05 - \defineprotrudefactor F 0 .05 - \defineprotrudefactor J .05 0 - \defineprotrudefactor K 0 .05 - \defineprotrudefactor L 0 .05 - \defineprotrudefactor T .05 .05 - \defineprotrudefactor V .05 .05 - \defineprotrudefactor W .05 .05 - \defineprotrudefactor X .05 .05 - \defineprotrudefactor Y .05 .05 - - \defineprotrudefactor k 0 .05 - \defineprotrudefactor r 0 .05 - \defineprotrudefactor t 0 .05 - \defineprotrudefactor v .05 .05 - \defineprotrudefactor w .05 .05 - \defineprotrudefactor x .05 .05 - \defineprotrudefactor y .05 .05 - -\stopfonthandling - -% ogoneks may need another treatment - -\startfonthandling [extended] - - \inherithandling Acircumflex A - \inherithandling acircumflex a - \inherithandling Ccircumflex C - \inherithandling ccircumflex c - \inherithandling Ecircumflex E - \inherithandling ecircumflex e - \inherithandling Gcircumflex G - \inherithandling gcircumflex g - \inherithandling Hcircumflex H - \inherithandling hcircumflex h - \inherithandling Icircumflex I - \inherithandling icircumflex i - \inherithandling Jcircumflex J - \inherithandling jcircumflex j - \inherithandling Ocircumflex O - \inherithandling ocircumflex o - \inherithandling Scircumflex S - \inherithandling scircumflex s - \inherithandling Ucircumflex U - \inherithandling ucircumflex u - \inherithandling Wcircumflex W - \inherithandling wcircumflex w - \inherithandling Ycircumflex Y - \inherithandling ycircumflex y - - \inherithandling Agrave A - \inherithandling agrave a - \inherithandling Egrave E - \inherithandling egrave e - \inherithandling Igrave I - \inherithandling igrave i - \inherithandling Ograve O - \inherithandling ograve o - \inherithandling Ugrave U - \inherithandling ugrave u - \inherithandling Ygrave Y - \inherithandling ygrave y - - \inherithandling Atilde A - \inherithandling atilde a - \inherithandling Itilde I - \inherithandling itilde i - \inherithandling Ntilde N - \inherithandling ntilde n - \inherithandling Otilde O - \inherithandling otilde o - \inherithandling Utilde U - \inherithandling utilde u - - \inherithandling Adiaeresis A - \inherithandling adiaeresis a - \inherithandling Ediaeresis E - \inherithandling ediaeresis e - \inherithandling Idiaeresis I - \inherithandling idiaeresis i - \inherithandling Odiaeresis O - \inherithandling odiaeresis o - \inherithandling Udiaeresis U - \inherithandling udiaeresis u - \inherithandling Ydiaeresis Y - \inherithandling ydiaeresis y - - \inherithandling Aacute A - \inherithandling aacute a - \inherithandling Cacute C - \inherithandling cacute c - \inherithandling Eacute E - \inherithandling eacute e - \inherithandling Iacute I - \inherithandling iacute i - \inherithandling Lacute L - \inherithandling lacute l - \inherithandling Nacute N - \inherithandling nacute n - \inherithandling Oacute O - \inherithandling oacute o - \inherithandling Racute R - \inherithandling racute r - \inherithandling Sacute s - \inherithandling sacute s - \inherithandling Uacute U - \inherithandling uacute u - \inherithandling Yacute Y - \inherithandling yacute y - \inherithandling Zacute Z - \inherithandling zacute z - - \inherithandling Dstroke D - \inherithandling dstroke d - \inherithandling Hstroke H - \inherithandling hstroke h - \inherithandling Tstroke T - \inherithandling tstroke t - - \inherithandling Cdotaccent C - \inherithandling cdotaccent c - \inherithandling Edotaccent E - \inherithandling edotaccent e - \inherithandling Gdotaccent G - \inherithandling gdotaccent g - \inherithandling Idotaccent I - \inherithandling idotaccent i - \inherithandling Zdotaccent Z - \inherithandling zdotaccent z - - \inherithandling Amacron A - \inherithandling amacron a - \inherithandling Emacron E - \inherithandling emacron e - \inherithandling Imacron I - \inherithandling imacron i - \inherithandling Omacron O - \inherithandling omacron o - \inherithandling Umacron U - \inherithandling umacron u - - \inherithandling Ccedilla C - \inherithandling ccedilla c - \inherithandling Kcedilla K - \inherithandling kcedilla k - \inherithandling Lcedilla L - \inherithandling lcedilla l - \inherithandling Ncedilla N - \inherithandling ncedilla n - \inherithandling Rcedilla R - \inherithandling rcedilla r - \inherithandling Scedilla S - \inherithandling scedilla s - \inherithandling Tcedilla T - \inherithandling tcedilla t - - \inherithandling Ohungarumlaut O - \inherithandling ohungarumlaut o - \inherithandling Uhungarumlaut U - \inherithandling uhungarumlaut u - - \inherithandling Aogonek A - \inherithandling aogonek a - \inherithandling Eogonek E - \inherithandling eogonek e - \inherithandling Iogonek I - \inherithandling iogonek i - \inherithandling Uogonek U - \inherithandling uogonek u - - \inherithandling Aring A - \inherithandling aring a - \inherithandling Uring U - \inherithandling uring u - - \inherithandling Abreve A - \inherithandling abreve a - \inherithandling Ebreve E - \inherithandling ebreve e - \inherithandling Gbreve G - \inherithandling gbreve g - \inherithandling Ibreve I - \inherithandling ibreve i - \inherithandling Obreve O - \inherithandling obreve o - \inherithandling Ubreve U - \inherithandling ubreve u - - \inherithandling Ccaron C - \inherithandling ccaron c - \inherithandling Dcaron D - \inherithandling dcaron d - \inherithandling Ecaron E - \inherithandling ecaron e - \inherithandling Lcaron L - \inherithandling lcaron l - \inherithandling Ncaron N - \inherithandling ncaron n - \inherithandling Rcaron R - \inherithandling rcaron r - \inherithandling Scaron S - \inherithandling scaron s - \inherithandling Tcaron T - \inherithandling tcaron t - \inherithandling Ycaron Y - \inherithandling ycaron y - \inherithandling Zcaron Z - \inherithandling zcaron z - - \inherithandling AEligature E - \inherithandling aeligature e - \inherithandling Lstroke I - \inherithandling lstroke o - \inherithandling Ostroke O - \inherithandling ostroke o - \inherithandling OEligature O - \inherithandling oeligature o - - \inherithandling Ssharp S - \inherithandling ssharp s - \inherithandling IJligature J - \inherithandling ijligature j - - \inherithandling aumlaut a - \inherithandling eumlaut e - \inherithandling iumlaut i - \inherithandling oumlaut o - \inherithandling uumlaut u - - \inherithandling Aumlaut A - \inherithandling Eumlaut E - \inherithandling Iumlaut I - \inherithandling Oumlaut O - \inherithandling Uumlaut U - - \inherithandling Lslash L - \inherithandling lslash l - \inherithandling Dslash D - \inherithandling dslash d - \inherithandling Oslash O - \inherithandling oslash o - - \inherithandling Eszett S - \inherithandling eszett s - - \inherithandling Thorn P - \inherithandling thorn p - - % vietnamese - - \inherithandling Ahook A - \inherithandling ahook a - \inherithandling Ehook E - \inherithandling ehook e - \inherithandling Ihook I - \inherithandling ihook i - \inherithandling Ohook O - \inherithandling ohook o - \inherithandling Uhook U - \inherithandling uhook u - \inherithandling Yhook Y - \inherithandling yhook y - - \inherithandling Acircumflexgrave A - \inherithandling Acircumflexacute A - \inherithandling Acircumflextilde A - \inherithandling Acircumflexhook A - \inherithandling acircumflexgrave a - \inherithandling acircumflexacute a - \inherithandling acircumflextilde a - \inherithandling acircumflexhook a - \inherithandling Ecircumflexgrave E - \inherithandling Ecircumflexacute E - \inherithandling Ecircumflextilde E - \inherithandling Ecircumflexhook E - \inherithandling ecircumflexgrave e - \inherithandling ecircumflexacute e - \inherithandling ecircumflextilde e - \inherithandling ecircumflexhook e - \inherithandling Ocircumflexgrave O - \inherithandling Ocircumflexacute O - \inherithandling Ocircumflextilde O - \inherithandling Ocircumflexhook O - \inherithandling ocircumflexgrave o - \inherithandling ocircumflexacute o - \inherithandling ocircumflextilde o - \inherithandling ocircumflexhook o - - \inherithandling Abrevegrave A - \inherithandling Abreveacute A - \inherithandling Abrevetilde A - \inherithandling Abrevehook A - \inherithandling abrevegrave a - \inherithandling abreveacute a - \inherithandling abrevetilde a - \inherithandling abrevehook a - - \inherithandling Adotbelow A - \inherithandling adotbelow a - \inherithandling Edotbelow E - \inherithandling edotbelow e - \inherithandling Idotbelow I - \inherithandling idotbelow i - \inherithandling Odotbelow O - \inherithandling odotbelow o - \inherithandling Udotbelow U - \inherithandling udotbelow u - \inherithandling Ydotbelow Y - \inherithandling ydotbelow y - - \inherithandling Ohorndotbelow O - \inherithandling ohorndotbelow o - \inherithandling Uhorndotbelow U - \inherithandling uhorndotbelow u - - \inherithandling Acircumflexdotbelow A - \inherithandling acircumflexdotbelow a - \inherithandling Ecircumflexdotbelow E - \inherithandling ecircumflexdotbelow e - \inherithandling Ocircumflexdotbelow O - \inherithandling ocircumflexdotbelow o - - \inherithandling Abrevedotbelow A - \inherithandling abrevedotbelow a - - \inherithandling Ohorn O - \inherithandling Ohorngrave O - \inherithandling Ohornacute O - \inherithandling Ohorntilde O - \inherithandling Ohornhook O - \inherithandling ohorn o - \inherithandling ohorngrave o - \inherithandling ohornacute o - \inherithandling ohorntilde o - \inherithandling ohornhook o - \inherithandling Uhorn U - \inherithandling Uhorngrave U - \inherithandling Uhornacute U - \inherithandling Uhorntilde U - \inherithandling Uhornhook U - \inherithandling uhorn u - \inherithandling uhorngrave u - \inherithandling uhornacute u - \inherithandling uhorntilde u - \inherithandling uhornhook u - - \inherithandling Ytilde Y - \inherithandling ytilde y - \inherithandling Etilde E - \inherithandling etilde e - -\stopfonthandling - -\startfonthandling [hz] - - \defineadjustfactor A .5 - \defineadjustfactor B .7 - \defineadjustfactor C .7 - \defineadjustfactor D .5 - \defineadjustfactor E .7 - \defineadjustfactor F .7 - \defineadjustfactor G .5 - \defineadjustfactor H .7 - \defineadjustfactor K .7 - \defineadjustfactor M .7 - \defineadjustfactor N .7 - \defineadjustfactor O .5 - \defineadjustfactor P .7 - \defineadjustfactor Q .5 - \defineadjustfactor R .7 - \defineadjustfactor S .7 - \defineadjustfactor U .7 - \defineadjustfactor W .7 - \defineadjustfactor Z .7 - - \defineadjustfactor a .7 - \defineadjustfactor b .7 - \defineadjustfactor c .7 - \defineadjustfactor d .7 - \defineadjustfactor e .7 - \defineadjustfactor g .7 - \defineadjustfactor h .7 - \defineadjustfactor k .7 - \defineadjustfactor m .7 - \defineadjustfactor n .7 - \defineadjustfactor o .7 - \defineadjustfactor p .7 - \defineadjustfactor q .7 - \defineadjustfactor s .7 - \defineadjustfactor u .7 - \defineadjustfactor w .7 - \defineadjustfactor z .7 - - \defineadjustfactor 2 .7 - \defineadjustfactor 3 .7 - \defineadjustfactor 6 .7 - \defineadjustfactor 8 .7 - \defineadjustfactor 9 .7 - -% \defineadjustfactor hyphen ? -% \defineadjustfactor endash ? -% \defineadjustfactor emdash ? - -\stopfonthandling - -% no ligs other than fi fl etc, no --- and '' - -\startfonthandling[noligs] - - \settagcode - {\notagcode} - \settagcode ' {\notagcode} - \settagcode ` {\notagcode} - \settagcode ? {\notagcode} - \settagcode ! {\notagcode} - -\stopfonthandling - -% \startfonthandling[noligs] -% \dostepwiserecurse{0}{255}{1}{\expanded{\settagcode \recurselevel\space\notagcode\space}} -% \stopfonthandling - -% \definefonthandling [noligs] [noligs] [type=tag] - % \setupfontsynonym[Serif][handling=noligs] -% \definefont[test][Serif at 12.34pt] -% -% {``fi--ffl---ffi'' \test ``fi--ffl---ffi''} - -\unprotect - -% beware: extended extends the preceding vector (both protruding and -% adjusting) but as long as the normal ascii characters are not set -% beforehand, they default to normal - -% protruding variants -- slanted/italic is yet incomplete - -\definefonthandling [pure] [pure] [\c!type=\v!hanging] -\definefonthandling [purebold] [pure] [\c!type=\v!hanging] -\definefonthandling [pureslanted] [pure] [\c!type=\v!hanging,\c!right=1.5] -\definefonthandling [pureitalic] [pure] [\c!type=\v!hanging,\c!right=1.5] -\definefonthandling [pureboldslanted] [pure] [\c!type=\v!hanging,\c!right=1.5] -\definefonthandling [purebolditalic] [pure] [\c!type=\v!hanging,\c!right=1.5] - -\definefonthandling [normal] [punctuation,alpha,extended] [\c!type=\v!hanging] -\definefonthandling [normalbold] [punctuation,alpha,extended] [\c!type=\v!hanging] -\definefonthandling [normalslanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] -\definefonthandling [normalitalic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] -\definefonthandling [normalboldslanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] -\definefonthandling [normalbolditalic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] - -% for old times sake - -\definefonthandling [bold] [punctuation,alpha,extended] [\c!type=\v!hanging] -\definefonthandling [slanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] -\definefonthandling [italic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] -\definefonthandling [boldslanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] -\definefonthandling [bolditalic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5] - -% hz variants - -\definefonthandling [hz] [hz,extended] [\c!type=\v!hz] % min=20 max=20 step=5 - -% combined variants - -\definefonthandling [quality] [hz,pure] -\definefonthandling [highquality] [hz,normal] - -% noligs (xml) : \definefonthandling [default] [noligs] - -\definefonthandling [noligs] [noligs] [\c!type=tag] - -% experimental values ! -% -% \definefontsynonym[myfont][Serif][handling=prespacing] -% \definefont[whatever][myfont sa 1] -% \setupalign[spacing] -% -% \whatever look at this: we now have a proper spacing feature and, hurray, -% get rid of active punctuation! - -\startfonthandling [flexspacing] - - \definespacefactor : 0 1.25 .25 .25 - - \definespacefactor , 0 1 .25 .25 - \inheritspacefactor ; , - - \definespacefactor . 0 1.5 .25 .25 - \inheritspacefactor ! . - \inheritspacefactor ? . - -\stopfonthandling - -\definefonthandling[flexspacing][flexspacing][\c!type=\v!spacing] - -\startfonthandling [prespacing] % better name needed - - \definespacefactor : .25 .25 0 0 - \inheritspacefactor ; : - \inheritspacefactor ! : - \inheritspacefactor ? : - -\stopfonthandling - -\definefonthandling[prespacing][prespacing][\c!type=\v!spacing] % factor=.5 - -% A special case of guillemots, beware: when used ungrouped, -% it overloads all successive (current) encoding vector -% instances! Will be obsolete soon. - -\startfonthandling [glm] - - \overloadcharacter guilsingleleft {\defaultcharacter\guilsingleleft } - \overloadcharacter guilsingleright {\defaultcharacter\guilsingleright} - \overloadcharacter leftguillemot {\defaultcharacter\leftguillemot } - \overloadcharacter rightguillemot {\defaultcharacter\rightguillemot } - -\stopfonthandling - -\definefonthandling [glm] [glm] - -\protect \endinput diff --git a/tex/context/base/hand-ini.mkii b/tex/context/base/hand-ini.mkii index 42d248df6..ac8a94696 100644 --- a/tex/context/base/hand-ini.mkii +++ b/tex/context/base/hand-ini.mkii @@ -16,22 +16,6 @@ \unprotect -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - \newif\iftracefonthandling % \tracefonthandlingtrue \newif\ifskiphandlingdef \skiphandlingdeffalse @@ -452,7 +436,7 @@ {\letvalueempty{\c!file\f!handlingprefix#1}% \makeshortfilename[\truefilename{\f!handlingprefix#1}]% \startreadingfile - \readsysfile\shortfilename + \readsysfile{\shortfilename.mkii} {\showmessage\m!handlings2{#1}} {\showmessage\m!handlings3{#1}}% \stopreadingfile}} diff --git a/tex/context/base/java-fld.tex b/tex/context/base/java-fld.tex index e6e5ee03a..4fdf41ce4 100644 --- a/tex/context/base/java-fld.tex +++ b/tex/context/base/java-fld.tex @@ -19,15 +19,7 @@ function Sanitized_TeX_String (value) { var v = value ; - % v = v.replace(/\\\\\\/L/g,"\\225") ; % problematic - % v = v.replace( /\\\\OE/g,"\\226") ; % problematic - % v = v.replace( /\\\\vS/g,"\\227") ; % problematic - % v = v.replace( /\\\\"Y/g,"\\230") ; % problematic - % v = v.replace( /\\\\vZ/g,"\\231") ; % problematic - % v = v.replace(/\\\\\\/l/g,"\\233") ; % problematic v = v.replace( /\\\\oe/g,"\\234") ; - % v = v.replace( /\\\\vs/g,"\\235") ; % problematic - % v = v.replace( /\\\\vz/g,"\\236") ; % problematic v = v.replace( /\\\\<>/g,"\\273") ; v = v.replace( /\\\\`A/g,"\\300") ; @@ -52,7 +44,6 @@ v = v.replace( /\\\\^O/g,"\\324") ; v = v.replace( /\\\\~O/g,"\\325") ; v = v.replace( /\\\\"O/g,"\\326") ; - % v = v.replace(/\\\\\\/O/g,"\\330") ; % problematic v = v.replace( /\\\\`U/g,"\\331") ; v = v.replace( /\\\\'U/g,"\\332") ; v = v.replace( /\\\\^U/g,"\\333") ; @@ -81,7 +72,6 @@ v = v.replace( /\\\\^o/g,"\\364") ; v = v.replace( /\\\\~o/g,"\\365") ; v = v.replace( /\\\\"o/g,"\\366") ; - % v = v.replace(/\\\\\\/o/g,"\\370") ; % problematic v = v.replace( /\\\\`u/g,"\\371") ; v = v.replace( /\\\\'u/g,"\\372") ; v = v.replace( /\\\\^u/g,"\\373") ; @@ -129,7 +119,7 @@ \startJSpreamble fields_1 used now -var visible_field = new Array() ; % no garbage collection ! +var visible_field = new Array() ; var visible_fields = 0 ; function PresetFields ( ) @@ -140,13 +130,11 @@ function Preset_Fields ( ) function Hide_When_Down ( ) { event.target.hidden = true } -% { event.target.display = display.hidden } function Hide_Field ( Name ) { var v = this.getField(Name) ; if (v) { v.hidden = true ; - % { v.display = display.hidden ; v.readonly = true ; this.dirty = false } } @@ -173,11 +161,11 @@ function Hide_Fields () { Hide_Field(visible_field[visible_fields]) ; --visible_fields } } -function Vide_Fields ( Name ) % show only one field +function Vide_Fields ( Name ) { Hide_Fields () ; Vide_Field ( Name) } -function Vide_Hide_Fields ( Name ) % show only one field +function Vide_Hide_Fields ( Name ) { Hide_Fields () ; Vide_Hide_Field ( Name) } @@ -185,10 +173,6 @@ function Toggle_Hide ( Name ) { var v = this.getField(Name) ; if (v) { v.hidden = !v.hidden ; - % if v.display == display.hidden - % { v.display = display.visible } - % else - % { v.display = display.hidden } this.dirty = false } } function Field_On ( Name ) @@ -218,10 +202,6 @@ function Flip_Fields ( Name ) { v = this.getField(Names[i]) ; if (v) { v.hidden = !v.hidden ; - % if v.display == display.hidden - % { v.display = display.visible } - % else - % { v.display = display.hidden } v.value = "On" } } } function Forget_Changes () @@ -229,7 +209,6 @@ function Forget_Changes () function ForgetChanges () { this.dirty = false } - \stopJSpreamble %\startJScode{Hide_When_Down} Hide_When_Down() \stopJScode diff --git a/tex/context/base/java-ini.lua b/tex/context/base/java-ini.lua new file mode 100644 index 000000000..0fe7d3d29 --- /dev/null +++ b/tex/context/base/java-ini.lua @@ -0,0 +1,112 @@ +if not modules then modules = { } end modules ['java-ini'] = { + version = 1.001, + comment = "companion to java-ini.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +javascripts = javascripts or { } +javascripts.codes = javascripts.codes or { } +javascripts.preambles = javascripts.preambles or { } +javascripts.functions = javascripts.functions or { } + +local codes, preambles, functions = javascripts.codes, javascripts.preambles, javascripts.functions + +local preambled = { } + +local function storefunction(s) + functions[s] = true +end + +local uses = lpeg.P("uses") +local used = lpeg.P("used") +local left = lpeg.P("{") +local right = lpeg.P("}") +local space = lpeg.S(" \r\n") +local spaces = space^0 +local braced = left * lpeg.C((1-right-space)^1) * right +local unbraced = lpeg.C((1-space)^1) +local name = spaces * (braced + unbraced) * spaces +local any = lpeg.P(1) +local script = lpeg.C(any^1) +local funct = lpeg.P("function") +local leftp = lpeg.P("(") +local rightp = lpeg.P(")") +local fname = spaces * funct * spaces * (((1-space-left)^1)/storefunction) * spaces * leftp + +local parsecode = name * ((uses * name) + lpeg.Cc("")) * spaces * script +local parsepreamble = name * ((used * name) + lpeg.Cc("")) * spaces * script +local parsefunctions = (fname + any)^0 + +function javascripts.storecode(str) + local name, uses, script = parsecode:match(str) + if name and name ~= "" then + javascripts.codes[name] = { uses, script } + end +end + +function javascripts.storepreamble(str) -- now later + local name, used, script = parsepreamble:match(str) + if name and name ~= "" then + preambles[#preambles+1] = { name, used, script } + preambled[name] = #preambles + parsefunctions:match(script) + end +end + +function javascripts.setpreamble(name,script) -- now later + if name and name ~= "" then + preambles[#preambles+1] = { name, "now", script } + preambled[name] = #preambles + parsefunctions:match(script) + end +end + +function javascripts.addtopreamble(name,script) -- now later + if name and name ~= "" then + local p = preambled[name] + if p then + preambles[p] = { "now", preambles[p] .. " ;\n" .. script } + else + preambles[#preambles+1] = { name, "now", script } + preambled[name] = #preambles + parsefunctions:match(script) + end + end +end + +function javascripts.usepreamblenow(name) -- now later + if name and name ~= "" and preambled[name] then + preambles[preambled[name]][2] = "now" + end +end + +function javascripts.code(name,arguments) + local c = codes[name] + if c then + local u, code = c[1], c[2] + if u ~= "" then + local p = preambled[u] + if p then + preambles[p][1] = "now" + end + end + return code + end + local f = functions[name] + if f then + return string.format("%s(%s)",name,arguments or "") + end +end + +function javascripts.flushpreambles() + local t = { } + for i=1,#preambles do + local preamble = preambles[i] + if preamble[2] == "now" then + t[#t+1] = { preamble[1], preamble[3] } + end + end + return t +end diff --git a/tex/context/base/java-ini.mkiv b/tex/context/base/java-ini.mkiv index 53c36d65f..6536ced48 100644 --- a/tex/context/base/java-ini.mkiv +++ b/tex/context/base/java-ini.mkiv @@ -13,47 +13,10 @@ \writestatus{loading}{ConTeXt JavaScript Macros / Initialization} -% BUG: preamble zonder used/used en split - -% todo: lua sanitizer - -% JavaScript support is under development. In the near future -% a slightly different model will be used. The JScode stuff -% will probably become just auto function inclusion and the -% JS_* things will disappear. First I have to find a way to -% deal with global variables so the 'uses' thing will remain. - -% ook p{ref} -% documentation should be corrected to JS( - -% Also, obeylines will be supported. +\registerctxluafile{java-ini}{1.001} \unprotect -%D \JAVA\ support is not implemented as a generic support -%D module. The main reason for this is that passing system -%D variables to a \JAVASCRIPT\ is closely related to other core -%D macros. First some messages: - -%D \TEX\ is not the right tool to check the \JAVA\ code; the -%D most we can do is reporting some passed variables: - -\newif\iftraceJScode \traceJScodefalse - -\let\traceJScode\traceJScodetrue - -%D A bit out of place, but not dangerous: - -\bgroup -\catcode127=\@@letter -\gdef\delcharacter{^^7f} -\egroup - -%D The number of passed variables is minimalized by setting the -%D next switch. - -\newif\ifminimalizeJScode \minimalizeJScodetrue - %D \macros %D {JS*} %D @@ -74,50 +37,7 @@ %D \starttyping %D \goto{calculate total}[Sum(1.5,2.3)] %D \stoptyping -%D -%D References are passed by using the \type{R{}} classifier. -%D -%D \starttyping -%D \goto{calculate total}[Sum(1.5,2.3,R{overflow})] -%D \stoptyping -%D -%D The last call calls the script \type{Sum} and passes the -%D next set of variables: -%D -%D \starttyping -%D JS_S_1="1.5"; -%D JS_S_2="2.3"; -%D JS_R_3="overflow"; -%D JS_P_3=3; -%D \stoptyping -%D -%D The first two parameters are just strings, the third one -%D however is treated as a reference and results in passing the -%D reference (if needed this references is prefixed) and the -%D (real) page number. The alternative: -%D -%D \starttyping -%D \goto{calculate total}[JS(Sum{V{1.5},V{2.3},R{overflow}})] -%D \stoptyping -%D -%D does a verbose passing: -%D -%D \starttyping -%D JS_V_1=1.5; -%D JS_V_2=2.3; -%D JS_R_3="overflow"; -%D JS_P_3=3; -%D \stoptyping -% %D -% %D Finally we have a counter that tells\JAVA\ how many -% %D arguments were passed, -% %D -% %D \starttyping -% %D JS_N -% %D \stoptyping -%D We will also support direct function calls. In that case -%D no intermediate variables are used. %D \macros %D {startJScode} @@ -125,32 +45,12 @@ %D A piece of \JAVASCRIPT\ code is defined by saying: %D %D \starttyping -%D \startJScode{SomeScript} -%D var Item=this.getField("item"); -%D N=Item.getArray(); -%D Total=this.getField("total"); -%D Total.value=0; -%D for (j=0; j0) && (JS_R_1!="")) -%D { gotoNamedDest(JS_R_1) }; -%D \stopJScode -%D \stoptyping -%D -%D Such a piece of code is closely related to the interpreter -%D used. Watch the last two lines, here the script adapts -%D itself to the presence of a reference. -%D -%D While -%D -%D \starttyping %D \startJScode{name} %D name = 4 ; %D \stopJScode %D \stoptyping %D -%D assumes uses no preamble or presumes that the preamble is +%D This assumes uses no preamble or presumes that the preamble is %D always loaded, the next definition also tells \CONTEXT\ to %D actually include the preamble needed. %D @@ -159,109 +59,9 @@ %D uses = 6 ; %D \stopJScode %D \stoptyping - -\long\def\startJScode#1 #2 - {\doifelse{#2}{uses} - {\dostartJScodeA{#1}} - {\dostartJScodeB{#1} #2 }} - -\long\def\dostartJScodeA#1#2 #3\stopJScode - {\long\setgvalue{\r!java#1}{\do{#2}{#3}}} - -\long\def\dostartJScodeB#1#2\stopJScode - {\long\setgvalue{\r!java#1}{\do{}{#2}}} - -\let\stopJScode\relax - -%D \macros -%D {presetJScode} -%D -%D The code can be retrieved by saying -%D -%D \starttyping -%D \presetJScode{SomeScript}{template} -%D \stoptyping %D -%D Such a template is a comma separated list, where -%D individual entries can optionally be transformed by -%D \type{R{}} and \type{V{}}. -%D -%D After this call, the code is available in \type{\JScode}. - -\newif\ifdirectJScode - -\def\presetJScode#1#2% #1=operation #2=arguments - {\setverbosecscharacters - \def\par{\delcharacter}% was: { } - \scratchcounter\zerocount - \globallet\JScode\empty - \def\do##1##2% - {\doifelse{##2}{!}\directJScodetrue\directJScodefalse}% - \getvalue{\r!java#1}% - \edef\!!stringa{#2}% - \ifx\!!stringa\empty \else - \processcommacommand[\!!stringa]\dopresetJSvariables - \fi - \def\docommand##1% - {\doifundefinedelse{\r!java\r!java##1} - {\showmessage\m!javascript2{##1}} - {\useJSpreamblenow{##1}}}% -% {\doglobal\increment\currentJSpreamble -% \doglobal\addtocommalist{##1}\allJSpreambles}}% - \def\do##1##2% - {\xdef\JScode{\ifdirectJScode#1(\JScode)\else\JScode##2\fi}% - %\xdef\JScode{JS\string_N=\the\scratchcounter;\JScode}% - \processcommalist[##1]\docommand}% - \getvalue{\r!java#1}} - -\def\dopresetJSvariables#1% - {\advance\scratchcounter \plusone - \donefalse - \dodopresetJSvariables#1\end}% - -\def\dodopresetJSvariables - {\doifnextcharelse R\dodopresetJSrefvariables - {\doifnextcharelse V\dodopresetJSvervariables - {\doifnextcharelse S\dodopresetJSstrvariables - \dodopresetJSrawvariables}}} - -\def\dodopresetJSrefvariables R#1\end - {\doifreferencefoundelse{#1} - {\donetrue \dododopresetJSvariables R{\referenceprefix#1}% - \donefalse\dododopresetJSvariables P{\currentrealreference}} - {\unknownreference{#1}}% - \ifminimalizeJScode \else - \donetrue\dododopresetJSvariables S{#1}% - \fi} - -\def\dodopresetJSvervariables V#1\end - {\donefalse\dododopresetJSvariables V{#1}% - \ifminimalizeJScode \else - \donetrue\dododopresetJSvariables S{#1}% - \fi} - -\def\dodopresetJSstrvariables S#1\end - {\donetrue\dododopresetJSvariables S{#1}} - -\def\dodopresetJSrawvariables #1\end - {\donetrue\dododopresetJSvariables S{#1}} - -\def\JSprefix#1% - {JS\string_#1\string_\the\scratchcounter} - -\def\dododopresetJSvariables#1#2% - {\iftraceJScode - \writestatus{JavaScript}{\JSprefix#1=#2} - \xdef\JScode{\JScode console.println("\JSprefix#1=#2"); }% - \fi - \ifdirectJScode - \xdef\JScode{\ifx\JScode\empty\else\JScode,\fi\ifdone"#2"\else#2\fi}% - \else - \xdef\JScode{\JScode\JSprefix#1=\ifdone"#2"\else#2\fi; }% - \fi} - %D \macros -%D {startJSpreamble, flushJSpreamble} +%D {startJSpreamble} %D %D One can define insert \JAVASCRIPT\ code at the document level %D by using: @@ -291,365 +91,40 @@ %D %D This command may be used more that once, but always before %D the first page is shipped out. - -\newif\ifoneJSpreamble \oneJSpreamblefalse - -\let\allJSpreambles\empty -\newcounter\nofJSpreambles -\newcounter\currentJSpreamble - -\long\def\startJSpreamble#1 #2 % - {\bgroup % we need to restore the catcodes - \restoreendofline % just in case it happens while reading lists - \doifelse{#2}{used} - {\dostartJSpreamble#1 } - {\dostartJSpreamble#1 now #2 }} - -\long\def\dostartJSpreamble#1 #2 % - {\processaction - [#2] - [ later=>\chardef\JSstatus\zerocount,% - now=>\chardef\JSstatus\plusone ,% - \s!default=>\chardef\JSstatus\plustwo ,% - \s!unknown=>\chardef\JSstatus\plustwo ]% - \ifaddJSlinebreaks - \obeylines \let\obeyedline \normalpar - \obeyspaces \let\obeyedspace\normalspace - \fi - \dodostartJSpreamble{#1}} - -\long\def\dodostartJSpreamble#1#2\stopJSpreamble - {\presetJSfunctions #2function ()\end - \long\setgvalue{\r!java\r!java#1}{#2}% - \ifcase\JSstatus \else - \useJSpreamblenow{#1}% - \fi - \egroup} - +%D %D \macros %D {setJSpreamble, addtoJSpreamble} %D %D In addition to the previous preamble definitions, we can %D set a preamble \quote {in||line} and add tokens to a %D preamble. - -\def\setJSpreamble#1#2% - {\doifundefined{\r!java\r!java#1} - {\setgvalue{\r!java\r!java#1}{#2;}% - \doglobal\increment\currentJSpreamble - \doglobal\addtocommalist{#1}\allJSpreambles}} - -\def\addtoJSpreamble#1#2% - {\doifdefinedelse{\r!java\r!java#1} - {\edef\!!stringa{\r!java\r!java#1}% - \edef\!!stringb{\csname\!!stringa\endcsname}% - \@EA\setgvalue\@EA\!!stringa\@EA{\!!stringb #2;}} - {\setJSpreamble{#1}{#2}}} - +%D %D \macros %D {useJSpreamblenow} %D -%D The next macro can be used to force inclusion of postponed +%D This macro can be used to force inclusion of postponed %D \JAVASCRIPT\ preambles. -\def\useJSpreamblenow#1% - {\doglobal\increment\currentJSpreamble - \doglobal\addtocommalist{#1}\allJSpreambles} - -%D Because we want to check for valid calls, we preload the -%D functions. This means that we can call them directly as -%D well as indirectly when defined by \type {\startJScode} etc. - -% \long\def\presetJSfunctions#1function #2(#3)% -% {\doifelsenothing{#2} -% {\long\def\presetJSfunctions##1\end{}} -% {\stripspaces\from#2\to\ascii -% \doifundefined{\r!java\ascii}{\setgvalue{\r!java\ascii}{\do{}{!}}}}% -% \presetJSfunctions} - -\long\def\presetJSfunctions#1function#2(#3)% - {\doifelse{#2}\space - {\long\def\presetJSfunctions##1\end{}} - {\stripspaces\from#2\to\ascii - \doifundefined{\r!java\ascii}{\setgvalue{\r!java\ascii}{\do{}{!}}}}% - \presetJSfunctions} - -\def\getJSpreamble#1% - {\getvalue{\r!java\r!java#1}} +\unexpanded\def\startJScode + {\begingroup\obeylualines\obeyluatokens\dostartJScode} -\def\presetJSpreamble - {\ifx\allJSpreambles\empty\else - \bgroup - \setverbosecscharacters - \obeyspaces \let\obeyedspace\normalspace - \def\par{\delcharacter}% was: { } - \globallet\JSpreamble\empty - \def\@@collectedJSpreamble{\r!java\r!java collected}% - \letvalue{\@@collectedJSpreamble}=\empty - \def\docommand##1% - {\xdef\JScode{\getvalue{\r!java\r!java##1}}% - \ifoneJSpreamble % \global\letcdcsname - \@EA\setxvalue\@EA\@@collectedJSpreamble\@EA - {\csname\@@collectedJSpreamble\endcsname\JScode}% - \else - \setxvalue{\r!java\r!java##1}{\JScode}% - \fi}% - \processcommacommand[\allJSpreambles]\docommand - \ifoneJSpreamble - \gdef\allJSpreambles{collected}% - \fi - \globallet\presetJSpreamble\relax - \egroup - \fi} +\long\def\dostartJScode#1\stopJScode + {\normalexpanded{\endgroup\ctxlua{javascripts.storecode(\!!bs#1\!!es)}}} -\def\flushJSpreamble - {\iflocation\ifx\allJSpreambles\empty\else - \ifcase\nofJSpreambles\else\ifnum\nofJSpreambles=\currentJSpreamble - \bgroup - \presetJSpreamble - \expanded{\doflushJSpreamble{\allJSpreambles}}% - \globallet\flushJSpreamble\relax - \globallet\allJSpreambles\empty - \egroup - \fi\fi - \fi\fi} - -\def\finalflushJSpreamble - {\iflocation - \flushJSpreamble - \ifcase\currentJSpreamble\relax\else - \savecurrentvalue\nofJSpreambles\currentJSpreamble - \globallet\currentJSpreamble\nofJSpreambles - \fi - \fi} - -%D \macros -%D {doPSsanitizeJScode} -%D -%D Before the code can be passed to the (\POSTSCRIPT\ or \PDF) -%D output file, some precautions must be made concerning the -%D use of \type{(} and~\type{)}. Here we use a beautiful -%D \type{\aftergroup} trick I discovered in the \TABLE\ format. - -\def\doPSsanitizeJScode#1\to#2% - {\begingroup - \scratchcounter\zerocount % \aftergroup counter - \aftergroup\xdef - \aftergroup#2% - \aftergroup{% - \expanded{\defconvertedargument\noexpand\JScode{#1}}% - \expandafter\handletokens\JScode\with\dodoPSsanitizeJScode - \aftergroup}% - \endgroup - \iftraceJScode - \writestatus{JS trace}{#2}% - \fi} - -%D I started with: -%D -%D \starttyping -%D \def\dodoPSsanitizeJScode#1% -%D {\aftergroup\string -%D \if#1(% -%D \expandafter\aftergroup\csname#1\endcsname -%D \else\if#1)% -%D \expandafter\aftergroup\csname#1\endcsname -%D \else\if#1;% -%D \aftergroup;\aftergroup\string\expandafter\aftergroup\ -%D \else -%D \expandafter\aftergroup#1% -%D \fi\fi\fi -%D \advance\scratchcounter by 1 -%D \ifnum\scratchcounter=500 -%D \expandafter\dododoPSsanitizeJScode -%D \fi} -%D \stoptyping -%D -%D For pretty printing purposes, we need some way to signal -%D \TEX\ macros. Therefore we introduce a special keyword -%D \type{TEX}. When followed by a space, this keyword is -%D ignored, that is, filtered from the stream. Now we have: - -\chardef\JSisTEX \zerocount -\chardef\JScomment\zerocount - -\newif\ifaddJSlinebreaks \addJSlinebreakstrue - -\def\flushJSisTEX - {\ifcase\JSisTEX - \or \aftergroup T% - \or \aftergroup T\aftergroup E% - \or \aftergroup T\aftergroup E\aftergroup X% - \fi - \chardef\JSisTEX\zerocount} - -% \def\doJSlinebreak -% {\ifaddJSlinebreaks -% \aftergroup\string\aftergroup\n% -% \fi} -% -% \def\dodoPSsanitizeJScode#1% % input stack>500 & TEX check -% {\if#1/% -% \ifnum\JScomment=0 -% \chardef\JScomment\plusone -% \else\ifnum\JScomment=1 -% \chardef\JScomment\plustwo -% \fi\fi -% \else -% \ifnum\JScomment=1 -% \aftergroup/% -% \chardef\JScomment\zerocount -% \fi -% \ifnum\JScomment=2 -% \if#1\delcharacter -% \chardef\JScomment\zerocount -% \fi -% \else -% \if#1\delcharacter -% \flushJSisTEX\doJSlinebreak -% \else\if#1(% -% \flushJSisTEX\aftergroup\string\expandafter\aftergroup\csname#1\endcsname -% \else\if#1)% -% \flushJSisTEX\aftergroup\string\expandafter\aftergroup\csname#1\endcsname -% \else\if#1;% -% \flushJSisTEX\aftergroup;\doJSlinebreak -% \else\if#1T% -% \ifnum\JSisTEX=0 \chardef\JSisTEX\plusone \else\flushJSisTEX\aftergroup T\fi -% \else\if#1E% -% \ifnum\JSisTEX=1 \chardef\JSisTEX\plustwo \else\flushJSisTEX\aftergroup E\fi -% \else\if#1X% -% \ifnum\JSisTEX=2 \chardef\JSisTEX\plusthree \else\flushJSisTEX\aftergroup X\fi -% \else\if#1\normalspace -% \ifnum\JSisTEX=3 \chardef\JSisTEX\zerocount \else\flushJSisTEX\aftergroup#1\fi -% \else -% \flushJSisTEX\aftergroup\string\expandafter\aftergroup#1% -% \fi\fi\fi\fi\fi\fi\fi\fi -% \fi -% \fi -% \dododoPSsanitizeJScode} - -% todo: "http:\\" -> simple. maar wel \" afvangen -% -% use new pdftex escape mechanism or make fully expandable version, not used that often btw - -\chardef\JSstring\zerocount - -\def\doJSlinebreak - {\chardef\JScomment\zerocount - \chardef\JSstring\zerocount - \ifaddJSlinebreaks - \aftergroup\string\aftergroup\n% - \fi} - -\def\dodoPSsanitizeJScode#1% % input stack>500 & TEX check - {\if#1/% - \ifnum\JSstring=0 - \ifnum\JScomment=0 - \chardef\JScomment\plusone - \else\ifnum\JScomment=1 - \chardef\JScomment\plustwo - \fi\fi - \else - \aftergroup/% - \fi - \else - \ifnum\JScomment=1 - \aftergroup/% - \chardef\JScomment\zerocount - \fi - % is the delchar trick still needed? - \ifnum\JScomment=2 - \ifnum`#1=13 % brrr - \doJSlinebreak - \else\if#1\par - \doJSlinebreak - \else\if#1\delcharacter - \doJSlinebreak - \fi\fi\fi - \else - \ifnum`#1=13 % brrr - \flushJSisTEX\doJSlinebreak - \else\if#1\par - \flushJSisTEX\doJSlinebreak - \else\if#1\delcharacter - \flushJSisTEX\doJSlinebreak - \else\if#1(% - \flushJSisTEX\aftergroup\string\expandafter\aftergroup\csname#1\endcsname - \else\if#1)% - \flushJSisTEX\aftergroup\string\expandafter\aftergroup\csname#1\endcsname - %\else\if#1;% - % \flushJSisTEX\aftergroup;\doJSlinebreak - \else\if#1T% - \ifnum\JSisTEX=0 \chardef\JSisTEX\plusone \else\flushJSisTEX\aftergroup T\fi - \else\if#1E% - \ifnum\JSisTEX=1 \chardef\JSisTEX\plustwo \else\flushJSisTEX\aftergroup E\fi - \else\if#1X% - \ifnum\JSisTEX=2 \chardef\JSisTEX\plusthree \else\flushJSisTEX\aftergroup X\fi - \else\if#1\normalspace - \ifnum\JSisTEX=3 \chardef\JSisTEX\zerocount \else\flushJSisTEX\aftergroup#1\fi - \else - % todo: "test\"test" - \if#1"% - \ifcase\JSstring - \chardef\JSstring\plusone - \else - \chardef\JSstring\zerocount - \fi - \fi - \flushJSisTEX\aftergroup\string\expandafter\aftergroup#1% - \fi\fi\fi\fi\fi\fi\fi\fi\fi % \fi - \fi - \fi - \dododoPSsanitizeJScode} - -%D Close reading learns that one line comments (\type{// ...}) -%D are removed from the stream. This permits switching in -%D pretty printing \JAVASCRIPT\ sources as well as saves -%D some bytes. - -%D The magic 500 in the next hack prevents the input stack from -%D overflowing when large scripts are sanitized. - -\def\dododoPSsanitizeJScode - {\ifcase\JSisTEX\ifcase\JScomment - \advance\scratchcounter \plusone - \fi\fi - \ifnum\scratchcounter=500 - \expandafter\dodododoPSsanitizeJScode - \fi} - -\def\dodododoPSsanitizeJScode - {\let\next={% - \aftergroup}% - \endgroup - \begingroup - \aftergroup\xdef - \aftergroup\sanitizedJScode - \aftergroup{% - \aftergroup\sanitizedJScode - \let\next=}} +\let\stopJScode\relax -%D The macro \type{\doPSsanitizeJScode} converts its argument -%D into the macro \type{\sanitizedJScode}, thereby prefixing -%D each \type{(} and \type{)} by a slash. +\unexpanded\def\startJSpreamble + {\begingroup\obeylualines\obeyluatokens\dostartJSpreamble} -%D Hooking this mechanism into the general \CONTEXT\ reference -%D mechanism does not take much effort: +\long\def\dostartJSpreamble#1\stopJSpreamble + {\normalexpanded{\endgroup\ctxlua{javascripts.storepreamble(\!!bs#1\!!es)}}} -\definespecialtest{JS}% - {\doifdefinedelse{\r!java\currentreferenceoperation}} +\let\stopJSpreamble\relax -\def\gotojavascriptspecial#1#2#3#4% special operation arguments data - {\begingroup - \iflocation - \bgroup - \presetJScode{#2}{#3}% - \egroup - \dohandlegoto{#4}{\dostartgotoJS\buttonwidth\buttonheight\JScode}{\dostopgotoJS}% - \else - #4% - \fi - \endgroup} +\def\setJSpreamble #1#2{\ctxlua{javascripts.storepreamble ("#1",\!!bs#2\!!es)}} +\def\addtoJSpreamble #1#2{\ctxlua{javascripts.addtopreamble ("#1",\!!bs#2\!!es)}} +\def\useJSpreamblenow #1{\ctxlua{javascripts.usepreamblenow("#1")}} +\def\finalflushJSpreamble{\iflocation\ctxlua{javascripts.flushpreambles()}\fi} %D \macros %D {useJSscripts} @@ -669,14 +144,15 @@ \def\dodouseJSscripts#1% {\doifelse{#1}\v!reset {\let\allJSpreambles\empty} - {\doifundefined{\c!file\f!javascriptprefix#1} - {\startnointerference - \letgvalueempty{\c!file\f!javascriptprefix#1}% - \makeshortfilename[\f!javascriptprefix#1]% - \startreadingfile - \readsysfile\shortfilename{\showmessage\m!javascript1{#1}}\donothing - \stopreadingfile - \stopnointerference}}} + {\ifcsname\c!file\f!javascriptprefix#1\endcsname \else + \startnointerference + \letgvalueempty{\c!file\f!javascriptprefix#1}% + \makeshortfilename[\f!javascriptprefix#1]% + \startreadingfile + \readsysfile\shortfilename{\showmessage\m!javascript1{#1}}\donothing + \stopreadingfile + \stopnointerference + \fi}} \def\douseJSscripts[#1][#2]% {\processcommalist[#1]\dodouseJSscripts diff --git a/tex/context/base/java-stp.tex b/tex/context/base/java-stp.tex index fcb9d4f22..df4fbcc2f 100644 --- a/tex/context/base/java-stp.tex +++ b/tex/context/base/java-stp.tex @@ -11,13 +11,13 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\startJSpreamble Steps used now +% we define ocglist global, otherwise we quickly run into a memory hog (even +% out of memory in a 512 Meg machine) - % 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) - % 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" ; @@ -26,9 +26,6 @@ var doc_visited = new Array() ; var doc_busy = new Array() ; - % for some reason, this function is not seen in time (funny initialization - % order again?) ... - function SetupStepper ( layername, laststep ) { doc_stepname = layername ; doc_maxstep = laststep ; @@ -38,8 +35,6 @@ } } - % so, we do it the ugly way - for (var i=0; i<=this.numPages; i++) { doc_visited[i] = 0 ; doc_busy[i] = 0 ; @@ -96,7 +91,6 @@ function InvokeStepper ( ) { try { -% console.println("INVOKE "+doc_currentstep+" "+doc_busy[this.pageNum]) ; if (doc_currentstep do - function copy(old,tables) + local function copy(old,tables) if old then tables = tables or { } local new = { } diff --git a/tex/context/base/lang-ara.mkiv b/tex/context/base/lang-ara.mkiv new file mode 100644 index 000000000..3c4d3c522 --- /dev/null +++ b/tex/context/base/lang-ara.mkiv @@ -0,0 +1,150 @@ +%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 + +\setupheadtext [\s!ar] [\v!content=المحتويات] +\setupheadtext [\s!ar] [\v!tables=الجداول] +\setupheadtext [\s!ar] [\v!figures=الأشكال] +\setupheadtext [\s!ar] [\v!graphics=الرسوم] +\setupheadtext [\s!ar] [\v!intermezzi=فسح] +\setupheadtext [\s!ar] [\v!index=الفهرس] +\setupheadtext [\s!ar] [\v!abbreviations=الاختصارات] +\setupheadtext [\s!ar] [\v!logos=الشعارات] +\setupheadtext [\s!ar] [\v!units=الوحدات] +\setuplabeltext [\s!ar] [\v!table=جدول ] +\setuplabeltext [\s!ar] [\v!figure=شكل ] +\setuplabeltext [\s!ar] [\v!intermezzo=فسحة ] +\setuplabeltext [\s!ar] [\v!graphic=رسم ] + +%D We don't set these here. One can do that in a style. + +\setuplabeltext [\s!ar] [\v!chapter=] % باب +\setuplabeltext [\s!ar] [\v!section=] % فصل or قسم +\setuplabeltext [\s!ar] [\v!subsection=] % فصل أدنى +\setuplabeltext [\s!ar] [\v!subsubsection=] % فصل أ دنى أدنى +\setuplabeltext [\s!ar] [\v!subsubsubsection=] % فصل أدنى أدنى أدنى +\setuplabeltext [\s!ar] [\v!appendix=] % ملحق +\setuplabeltext [\s!ar] [\v!part=جزء ] +\setuplabeltext [\s!ar] [\v!line=سطر ] +\setuplabeltext [\s!ar] [\v!lines=السطور ] + +\setuplabeltext [\s!ar] [\v!january=يناير] +\setuplabeltext [\s!ar] [\v!february=فبراير] +\setuplabeltext [\s!ar] [\v!march=مارس] +\setuplabeltext [\s!ar] [\v!april=أبريل] +\setuplabeltext [\s!ar] [\v!may=مايو] +\setuplabeltext [\s!ar] [\v!june=يونيو] +\setuplabeltext [\s!ar] [\v!july=يوليو] +\setuplabeltext [\s!ar] [\v!august=أغسطس] +\setuplabeltext [\s!ar] [\v!september=سبتمبر] +\setuplabeltext [\s!ar] [\v!october=أكتوبر] +\setuplabeltext [\s!ar] [\v!november=نوفمبر] +\setuplabeltext [\s!ar] [\v!december=ديسمبر] + +\setuplabeltext [\s!ar-sy] [\v!january=كانون الثاني] +\setuplabeltext [\s!ar-sy] [\v!february=شباط] +\setuplabeltext [\s!ar-sy] [\v!march=آذار] +\setuplabeltext [\s!ar-sy] [\v!april=نيسان] +\setuplabeltext [\s!ar-sy] [\v!may=أيار] +\setuplabeltext [\s!ar-sy] [\v!june=حزيران] +\setuplabeltext [\s!ar-sy] [\v!july=تموز] +\setuplabeltext [\s!ar-sy] [\v!august=آب] +\setuplabeltext [\s!ar-sy] [\v!september=أيلول] +\setuplabeltext [\s!ar-sy] [\v!october=تشرين الأول] +\setuplabeltext [\s!ar-sy] [\v!november=تشرين الثاني] +\setuplabeltext [\s!ar-sy] [\v!december=كانون الأول] + +\setuplabeltext [\s!ar-ma] [\v!may=ماي] +\setuplabeltext [\s!ar-ma] [\v!july=يوليوز] +\setuplabeltext [\s!ar-ma] [\v!august=غشت] +\setuplabeltext [\s!ar-ma] [\v!september=شتنبر] +\setuplabeltext [\s!ar-ma] [\v!november=نونبر] +\setuplabeltext [\s!ar-ma] [\v!december=دجنبر] + +\setuplabeltext [\s!ar-dz] [\v!january=جانفي] +\setuplabeltext [\s!ar-dz] [\v!february=فيفري] +\setuplabeltext [\s!ar-dz] [\v!april=أفريل] +\setuplabeltext [\s!ar-dz] [\v!may=ماي] +\setuplabeltext [\s!ar-dz] [\v!june=جوان] +\setuplabeltext [\s!ar-dz] [\v!july=جويلة] +\setuplabeltext [\s!ar-dz] [\v!august=أوت] + +\setuplabeltext [\s!ar] [\v!sunday=الأحد] +\setuplabeltext [\s!ar] [\v!monday=الاثنين] +\setuplabeltext [\s!ar] [\v!tuesday=الثلاثاء] +\setuplabeltext [\s!ar] [\v!wednesday=الأربعاء] +\setuplabeltext [\s!ar] [\v!thursday=الخميس] +\setuplabeltext [\s!ar] [\v!friday=الجمعة] +\setuplabeltext [\s!ar] [\v!saturday=السبت] + +%D Rather new ... + +\setuplabeltext [\s!ar] [\v!page=صفحة ] +\setuplabeltext [\s!ar] [\v!atpage=في صفحة ] +\setuplabeltext [\s!ar] [\v!hencefore=كما وضحنا سابقا] +\setuplabeltext [\s!ar] [\v!hereafter=كما نوضح لاحقا] +\setuplabeltext [\s!ar] [\v!see=انظر ] + +%D ... and to be completed! + +%D \ShowAllLanguageValues [\s!ar] [arabic] {Arabic} {horn} % engelse humor + +\protect \endinput diff --git a/tex/context/base/lang-ara.tex b/tex/context/base/lang-ara.tex deleted file mode 100644 index 3c4d3c522..000000000 --- a/tex/context/base/lang-ara.tex +++ /dev/null @@ -1,150 +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 - -\setupheadtext [\s!ar] [\v!content=المحتويات] -\setupheadtext [\s!ar] [\v!tables=الجداول] -\setupheadtext [\s!ar] [\v!figures=الأشكال] -\setupheadtext [\s!ar] [\v!graphics=الرسوم] -\setupheadtext [\s!ar] [\v!intermezzi=فسح] -\setupheadtext [\s!ar] [\v!index=الفهرس] -\setupheadtext [\s!ar] [\v!abbreviations=الاختصارات] -\setupheadtext [\s!ar] [\v!logos=الشعارات] -\setupheadtext [\s!ar] [\v!units=الوحدات] -\setuplabeltext [\s!ar] [\v!table=جدول ] -\setuplabeltext [\s!ar] [\v!figure=شكل ] -\setuplabeltext [\s!ar] [\v!intermezzo=فسحة ] -\setuplabeltext [\s!ar] [\v!graphic=رسم ] - -%D We don't set these here. One can do that in a style. - -\setuplabeltext [\s!ar] [\v!chapter=] % باب -\setuplabeltext [\s!ar] [\v!section=] % فصل or قسم -\setuplabeltext [\s!ar] [\v!subsection=] % فصل أدنى -\setuplabeltext [\s!ar] [\v!subsubsection=] % فصل أ دنى أدنى -\setuplabeltext [\s!ar] [\v!subsubsubsection=] % فصل أدنى أدنى أدنى -\setuplabeltext [\s!ar] [\v!appendix=] % ملحق -\setuplabeltext [\s!ar] [\v!part=جزء ] -\setuplabeltext [\s!ar] [\v!line=سطر ] -\setuplabeltext [\s!ar] [\v!lines=السطور ] - -\setuplabeltext [\s!ar] [\v!january=يناير] -\setuplabeltext [\s!ar] [\v!february=فبراير] -\setuplabeltext [\s!ar] [\v!march=مارس] -\setuplabeltext [\s!ar] [\v!april=أبريل] -\setuplabeltext [\s!ar] [\v!may=مايو] -\setuplabeltext [\s!ar] [\v!june=يونيو] -\setuplabeltext [\s!ar] [\v!july=يوليو] -\setuplabeltext [\s!ar] [\v!august=أغسطس] -\setuplabeltext [\s!ar] [\v!september=سبتمبر] -\setuplabeltext [\s!ar] [\v!october=أكتوبر] -\setuplabeltext [\s!ar] [\v!november=نوفمبر] -\setuplabeltext [\s!ar] [\v!december=ديسمبر] - -\setuplabeltext [\s!ar-sy] [\v!january=كانون الثاني] -\setuplabeltext [\s!ar-sy] [\v!february=شباط] -\setuplabeltext [\s!ar-sy] [\v!march=آذار] -\setuplabeltext [\s!ar-sy] [\v!april=نيسان] -\setuplabeltext [\s!ar-sy] [\v!may=أيار] -\setuplabeltext [\s!ar-sy] [\v!june=حزيران] -\setuplabeltext [\s!ar-sy] [\v!july=تموز] -\setuplabeltext [\s!ar-sy] [\v!august=آب] -\setuplabeltext [\s!ar-sy] [\v!september=أيلول] -\setuplabeltext [\s!ar-sy] [\v!october=تشرين الأول] -\setuplabeltext [\s!ar-sy] [\v!november=تشرين الثاني] -\setuplabeltext [\s!ar-sy] [\v!december=كانون الأول] - -\setuplabeltext [\s!ar-ma] [\v!may=ماي] -\setuplabeltext [\s!ar-ma] [\v!july=يوليوز] -\setuplabeltext [\s!ar-ma] [\v!august=غشت] -\setuplabeltext [\s!ar-ma] [\v!september=شتنبر] -\setuplabeltext [\s!ar-ma] [\v!november=نونبر] -\setuplabeltext [\s!ar-ma] [\v!december=دجنبر] - -\setuplabeltext [\s!ar-dz] [\v!january=جانفي] -\setuplabeltext [\s!ar-dz] [\v!february=فيفري] -\setuplabeltext [\s!ar-dz] [\v!april=أفريل] -\setuplabeltext [\s!ar-dz] [\v!may=ماي] -\setuplabeltext [\s!ar-dz] [\v!june=جوان] -\setuplabeltext [\s!ar-dz] [\v!july=جويلة] -\setuplabeltext [\s!ar-dz] [\v!august=أوت] - -\setuplabeltext [\s!ar] [\v!sunday=الأحد] -\setuplabeltext [\s!ar] [\v!monday=الاثنين] -\setuplabeltext [\s!ar] [\v!tuesday=الثلاثاء] -\setuplabeltext [\s!ar] [\v!wednesday=الأربعاء] -\setuplabeltext [\s!ar] [\v!thursday=الخميس] -\setuplabeltext [\s!ar] [\v!friday=الجمعة] -\setuplabeltext [\s!ar] [\v!saturday=السبت] - -%D Rather new ... - -\setuplabeltext [\s!ar] [\v!page=صفحة ] -\setuplabeltext [\s!ar] [\v!atpage=في صفحة ] -\setuplabeltext [\s!ar] [\v!hencefore=كما وضحنا سابقا] -\setuplabeltext [\s!ar] [\v!hereafter=كما نوضح لاحقا] -\setuplabeltext [\s!ar] [\v!see=انظر ] - -%D ... and to be completed! - -%D \ShowAllLanguageValues [\s!ar] [arabic] {Arabic} {horn} % engelse humor - -\protect \endinput diff --git a/tex/context/base/lang-chi.mkii b/tex/context/base/lang-chi.mkii new file mode 100644 index 000000000..278e10745 --- /dev/null +++ b/tex/context/base/lang-chi.mkii @@ -0,0 +1,305 @@ +%D \module +%D [ file=lang-chi, +%D version=2002.06.25, % 1998.10.10, +%D title=\CONTEXT\ Language Macros, +%D subtitle=Chinese, +%D author={Hans Hagen \& Wang Lei}, +%D date=\currentdate, +%D copyright={PRAGMA / 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 / Chinese} + +%D This module is coded using the \UNICODE\ support built in +%D \CONTEXT. Therefore, \type {\uchar} is used instead of latin +%D characters. + +\unprotect + +\definesystemconstant {chinese} \definesystemconstant {cn} + +\installlanguage + [\s!cn] + [\c!leftsentence=\cnencoding\cnleftsentence, + \c!rightsentence=\cnencoding\cnrightsentence, + \c!leftsubsentence=\cnencoding\cnleftsubsentence, + \c!rightsubsentence=\cnencoding\cnrightsubsentence, + \c!leftquote=\cnencoding\cnupperleftsinglequote, + \c!rightquote=\cnencoding\cnupperrightsinglequote, + \c!leftquotation=\cnencoding\cnupperleftdoublequote, + \c!rightquotation=\cnencoding\cnupperrightdoublequote, + \c!date={\v!year,\cnyear,\ ,\v!month,\v!day,\cnday}] + +\setupheadtext [\s!cn] [\v!content={\cnencoding\cnencodedcontents}] +\setupheadtext [\s!cn] [\v!tables={\cnencoding\cnencodedtables}] +\setupheadtext [\s!cn] [\v!figures={\cnencoding\cnencodedfigures}] +\setupheadtext [\s!cn] [\v!graphics={\cnencoding\cnencodedgraphics}]% RG & XJF +\setupheadtext [\s!cn] [\v!intermezzi={\cnencoding\cnencodedintermezzo}]% RG & XJF +\setupheadtext [\s!cn] [\v!index={\cnencoding\cnencodedindex}] +\setupheadtext [\s!cn] [\v!abbreviations={\cnencoding\cnencodedabbreviations}] +\setupheadtext [\s!cn] [\v!logos={\cnencoding\cnencodedlogos}] +\setupheadtext [\s!cn] [\v!units={\cnencoding\cnencodedunits}] + +\setuplabeltext [\s!cn] [\v!table={\cnencoding\cnencodedtable}] +\setuplabeltext [\s!cn] [\v!figure={\cnencoding\cnencodedfigure}] +\setuplabeltext [\s!cn] [\v!intermezzo={\cnencoding\cnencodedintermezzo}]% RG & XJF +\setuplabeltext [\s!cn] [\v!graphic={\cnencoding\cnencodedillustration}]% RG & XJF +\setuplabeltext [\s!cn] [\v!appendix={\cnencoding\cnencodedappendix}]% RG +\setuplabeltext [\s!cn] [\v!part={\cnencoding\cnencodedintro,\cnencoding\cnencodedpart}] +\setuplabeltext [\s!cn] [\v!chapter={\cnencoding\cnencodedintro,\cnencoding\cnencodedchapter}] +\setuplabeltext [\s!cn] [\v!section={\cnencoding\cnencodedintro,\cnencoding\cnencodedsection}] +\setuplabeltext [\s!cn] [\v!line={\cnencoding\cnencodedline}]% RG & XJF +\setuplabeltext [\s!cn] [\v!lines={\cnencoding\cnencodedline}]% RG & XJF + +\setuplabeltext [\s!cn] [\v!subsection=] +\setuplabeltext [\s!cn] [\v!subsubsection=] +\setuplabeltext [\s!cn] [\v!subsubsubsection=] + +%D From this definition one can deduce that language, input +%D encoding, font encoding, and glyph meaning form a pretty +%D complex four dimensional space. + +\startlanguagespecifics[\s!cn] + +\setuplabeltext [\s!cn] [\v!january=\cnencoding\cnencodedjanuary ] +\setuplabeltext [\s!cn] [\v!february=\cnencoding\cnencodedfebrary ] +\setuplabeltext [\s!cn] [\v!march=\cnencoding\cnencodedmarch ] +\setuplabeltext [\s!cn] [\v!april=\cnencoding\cnencodedapril ] +\setuplabeltext [\s!cn] [\v!may=\cnencoding\cnencodedmay ] +\setuplabeltext [\s!cn] [\v!june=\cnencoding\cnencodedjune ] +\setuplabeltext [\s!cn] [\v!july=\cnencoding\cnencodedjuly ] +\setuplabeltext [\s!cn] [\v!august=\cnencoding\cnencodedaugust ] +\setuplabeltext [\s!cn] [\v!september=\cnencoding\cnencodedseptember] +\setuplabeltext [\s!cn] [\v!october=\cnencoding\cnencodedoctober ] +\setuplabeltext [\s!cn] [\v!november=\cnencoding\cnencodednovember ] +\setuplabeltext [\s!cn] [\v!december=\cnencoding\cnencodeddecember ] + +\setuplabeltext [\s!cn] [\v!sunday=\cnencoding\cnencodedsunday ] +\setuplabeltext [\s!cn] [\v!monday=\cnencoding\cnencodedmonday ] +\setuplabeltext [\s!cn] [\v!tuesday=\cnencoding\cnencodedtuesday ] +\setuplabeltext [\s!cn] [\v!wednesday=\cnencoding\cnencodedwednesday] +\setuplabeltext [\s!cn] [\v!thursday=\cnencoding\cnencodedthursday ] +\setuplabeltext [\s!cn] [\v!friday=\cnencoding\cnencodedfriday ] +\setuplabeltext [\s!cn] [\v!saturday=\cnencoding\cnencodedsaturday ] + +\stoplanguagespecifics + +%D One can specify a split labeltext, as demonstrated in +%D the definition of the \type {part} label. Unfortunately +%D the glyphs of both part depend on the encoding. Therefore, +%D we have an encoding section here. + +\unexpanded\def\cnencoding{\enableencoding[\chineseencoding]} % ugly and temporary + +\startencoding[cjk-uni] + \definecommand cnleftsentence {\uchar{32}{20}\uchar{32}{20}} + \definecommand cnrightsentence {\uchar{32}{20}\uchar{32}{20}} + \definecommand cnleftsubsentence {\uchar{32}{20}\uchar{32}{20}} + \definecommand cnrightsubsentence {\uchar{32}{20}\uchar{32}{20}} + \definecommand cnupperleftsinglequote {\uchar{32}{24}} + \definecommand cnupperrightsinglequote {\uchar{32}{25}} + \definecommand cnupperleftdoublequote {\uchar{32}{28}} + \definecommand cnupperrightdoublequote {\uchar{32}{29}} + \definecommand cnupperleftsinglequote-v {\uchar{48}{12}} + \definecommand cnupperrightsinglequote-v {\uchar{48}{13}} + \definecommand cnupperleftdoublequote-v {\uchar{48}{14}} + \definecommand cnupperrightdoublequote-v {\uchar{48}{15}} + \definecommand cnencodedcontents {\uchar{118}{238}\uchar{95}{85}} + \definecommand cnencodedtables {\uchar{136}{104}\uchar{104}{60}} + \definecommand cnencodedfigures {\uchar{86}{254}\uchar{95}{98}} + \definecommand cnencodedindex {\uchar{125}{34}\uchar{95}{21}} + \definecommand cnencodedabbreviations {\uchar{127}{41}\uchar{117}{101}\uchar{139}{237}} + \definecommand cnencodedlogos {\uchar{95}{189}\uchar{141}{44}} + \definecommand cnencodedunits {\uchar{139}{161}\uchar{145}{207}\uchar{83}{85}\uchar{79}{77}} + \definecommand cnencodedtable {\uchar{136}{104}} + \definecommand cnencodedfigure {\uchar{86}{254}} + \definecommand cnencodedintro {\uchar{123}{44}} + \definecommand cnencodedpart {\uchar{144}{232}\uchar{82}{6}} + \definecommand cnencodedchapter {\uchar{122}{224}} + \definecommand cnencodedsection {\uchar{130}{130}} + \definecommand cnencodedjanuary {\uchar{78}{0}\uchar{103}{8}} + \definecommand cnencodedfebrary {\uchar{78}{140}\uchar{103}{8}} + \definecommand cnencodedmarch {\uchar{78}{9}\uchar{103}{8}} + \definecommand cnencodedapril {\uchar{86}{219}\uchar{103}{8}} + \definecommand cnencodedmay {\uchar{78}{148}\uchar{103}{8}} + \definecommand cnencodedjune {\uchar{81}{109}\uchar{103}{8}} + \definecommand cnencodedjuly {\uchar{78}{3}\uchar{103}{8}} + \definecommand cnencodedaugust {\uchar{81}{107}\uchar{103}{8}} + \definecommand cnencodedseptember {\uchar{78}{93}\uchar{103}{8}} + \definecommand cnencodedoctober {\uchar{83}{65}\uchar{103}{8}} + \definecommand cnencodednovember {\uchar{83}{65}\uchar{78}{0}\uchar{103}{8}} + \definecommand cnencodeddecember {\uchar{83}{65}\uchar{78}{140}\uchar{103}{8}} + \definecommand cnencodedsunday {\uchar{102}{31}\uchar{103}{31}\uchar{101}{229}} + \definecommand cnencodedmonday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{0}} + \definecommand cnencodedtuesday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{140}} + \definecommand cnencodedwednesday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{9}} + \definecommand cnencodedthursday {\uchar{102}{31}\uchar{103}{31}\uchar{86}{219}} + \definecommand cnencodedfriday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{148}} + \definecommand cnencodedsaturday {\uchar{102}{31}\uchar{103}{31}\uchar{81}{109}} + % RG & XJF + \definecommand cnencodedgraphics {\uchar{86}{254}} + \definecommand cnencodedintermezzo {\uchar{210}{99}\uchar{242}{102}} + \definecommand cnencodedillustration {\uchar{99}{210}\uchar{86}{254}} + \definecommand cnencodedappendix {\uchar{150}{68}\uchar{95}{85}} + \definecommand cnencodedline {\uchar{136}{76}} + % Tobias Burnus & XJF + \definecommand cnyear {\uchar{94}{116}} + \definecommand cnmonth {\uchar{103}{8}} + \definecommand cnday {\uchar{101}{229}} +\stopencoding + +\startencoding[gbk] + \definecommand cnleftsentence {\uchar{161}{170}\uchar{161}{170}} + \definecommand cnrightsentence {\uchar{161}{170}\uchar{161}{170}} + \definecommand cnleftsubsentence {\uchar{161}{170}\uchar{161}{170}} + \definecommand cnrightsubsentence {\uchar{161}{170}\uchar{161}{170}} + \definecommand cnupperleftsinglequote {\uchar{161}{174}} + \definecommand cnupperrightsinglequote {\uchar{161}{175}} + \definecommand cnupperleftdoublequote {\uchar{161}{176}} + \definecommand cnupperrightdoublequote {\uchar{161}{177}} + \definecommand cnupperleftsinglequote-v {\uchar{161}{184}} + \definecommand cnupperrightsinglequote-v {\uchar{161}{185}} + \definecommand cnupperleftdoublequote-v {\uchar{161}{186}} + \definecommand cnupperrightdoublequote-v {\uchar{161}{187}} + \definecommand cnencodedcontents {\uchar{196}{191}\uchar{194}{188}} + \definecommand cnencodedtables {\uchar{177}{237}\uchar{184}{241}} + \definecommand cnencodedfigures {\uchar{205}{188}\uchar{208}{206}} + \definecommand cnencodedindex {\uchar{203}{247}\uchar{210}{253}} + \definecommand cnencodedabbreviations {\uchar{203}{245}\uchar{194}{212}\uchar{211}{239}} + \definecommand cnencodedlogos {\uchar{187}{213}\uchar{177}{225}} + \definecommand cnencodedunits {\uchar{188}{198}\uchar{193}{191}\uchar{181}{165}\uchar{206}{187}} + \definecommand cnencodedtable {\uchar{177}{237}} + \definecommand cnencodedfigure {\uchar{205}{188}} + \definecommand cnencodedintro {\uchar{181}{218}} + \definecommand cnencodedpart {\uchar{178}{191}\uchar{183}{214}} + \definecommand cnencodedchapter {\uchar{213}{194}} + \definecommand cnencodedsection {\uchar{189}{218}} + \definecommand cnencodedjanuary {\uchar{210}{187}\uchar{212}{194}} + \definecommand cnencodedfebrary {\uchar{182}{254}\uchar{212}{194}} + \definecommand cnencodedmarch {\uchar{200}{253}\uchar{212}{194}} + \definecommand cnencodedapril {\uchar{203}{196}\uchar{212}{194}} + \definecommand cnencodedmay {\uchar{206}{229}\uchar{212}{194}} + \definecommand cnencodedjune {\uchar{193}{249}\uchar{212}{194}} + \definecommand cnencodedjuly {\uchar{198}{223}\uchar{212}{194}} + \definecommand cnencodedaugust {\uchar{176}{203}\uchar{212}{194}} + \definecommand cnencodedseptember {\uchar{190}{197}\uchar{212}{194}} + \definecommand cnencodedoctober {\uchar{202}{174}\uchar{212}{194}} + \definecommand cnencodednovember {\uchar{202}{174}\uchar{210}{187}\uchar{212}{194}} + \definecommand cnencodeddecember {\uchar{202}{174}\uchar{182}{254}\uchar{212}{194}} + \definecommand cnencodedsunday {\uchar{208}{199}\uchar{198}{218}\uchar{200}{213}} + \definecommand cnencodedmonday {\uchar{208}{199}\uchar{198}{218}\uchar{210}{187}} + \definecommand cnencodedtuesday {\uchar{208}{199}\uchar{198}{218}\uchar{182}{254}} + \definecommand cnencodedwednesday {\uchar{208}{199}\uchar{198}{218}\uchar{200}{253}} + \definecommand cnencodedthursday {\uchar{208}{199}\uchar{198}{218}\uchar{203}{196}} + \definecommand cnencodedfriday {\uchar{208}{199}\uchar{198}{218}\uchar{206}{229}} + \definecommand cnencodedsaturday {\uchar{208}{199}\uchar{198}{218}\uchar{193}{249}} + % RG & XJF + \definecommand cnencodedgraphics {\uchar{205}{188}} + \definecommand cnencodedintermezzo {\uchar{178}{229}\uchar{199}{250}} + \definecommand cnencodedillustration {\uchar{178}{229}\uchar{205}{188}} + \definecommand cnencodedappendix {\uchar{184}{189}\uchar{194}{188}} + \definecommand cnencodedline {\uchar{208}{208}} + % Tobias Burnus & XJF + \definecommand cnyear {\uchar{196}{234}} + \definecommand cnmonth {\uchar{212}{194}} + \definecommand cnday {\uchar{200}{213}} +\stopencoding + +\startencoding[big5] + \definecommand cnleftsentence {\uchar{162}{119}\uchar{162}{119}} + \definecommand cnrightsentence {\uchar{162}{119}\uchar{162}{119}} + \definecommand cnleftsubsentence {\uchar{162}{119}\uchar{162}{119}} + \definecommand cnrightsubsentence {\uchar{162}{119}\uchar{162}{119}} + \definecommand cnupperleftsinglequote {\uchar{161}{165}} + \definecommand cnupperrightsinglequote {\uchar{161}{166}} + \definecommand cnupperleftdoublequote {\uchar{161}{167}} + \definecommand cnupperrightdoublequote {\uchar{161}{168}} + \definecommand cnupperleftsinglequote-v {\uchar{161}{117}} + \definecommand cnupperrightsinglequote-v {\uchar{161}{118}} + \definecommand cnupperleftdoublequote-v {\uchar{161}{121}} + \definecommand cnupperrightdoublequote-v {\uchar{161}{122}} + \definecommand cnencodecontents {\uchar{165}{216}\uchar{191}{253}} + \definecommand cnencodetables {\uchar{170}{237}\uchar{174}{230}} + \definecommand cnencodefigures {\uchar{185}{207}\uchar{167}{206}} + \definecommand cnencodeindex {\uchar{175}{193}\uchar{174}{222}} + \definecommand cnencodeabbreviations {\uchar{191}{89}\uchar{178}{164}\uchar{187}{121}} + \definecommand cnencodelogos {\uchar{192}{178}\uchar{188}{208}} + \definecommand cnencodeunits {\uchar{173}{112}\uchar{182}{113}\uchar{179}{230}\uchar{166}{236}} + \definecommand cnencodetable {\uchar{170}{237}} + \definecommand cnencodefigure {\uchar{185}{207}} + \definecommand cnencodedintro {\uchar{178}{196}} + \definecommand cnencodedpart {\uchar{179}{161}\uchar{164}{192}} + \definecommand cnencodedchapter {\uchar{179}{185}} + \definecommand cnencodedsection {\uchar{184} {96}} + \definecommand cnencodedjanuary {\uchar{164} {64}\uchar{164}{235}} + \definecommand cnencodedfebrary {\uchar{164} {71}\uchar{164}{235}} + \definecommand cnencodedmarch {\uchar{164} {84}\uchar{164}{235}} + \definecommand cnencodedapril {\uchar{165}{124}\uchar{164}{235}} + \definecommand cnencodedmay {\uchar{164}{173}\uchar{164}{235}} + \definecommand cnencodedjune {\uchar{164}{187}\uchar{164}{235}} + \definecommand cnencodedjuly {\uchar{164} {67}\uchar{164}{235}} + \definecommand cnencodedaugust {\uchar{164} {75}\uchar{164}{235}} + \definecommand cnencodedseptember {\uchar{164} {69}\uchar{164}{235}} + \definecommand cnencodedoctober {\uchar{164} {81}\uchar{164}{235}} + \definecommand cnencodednovember {\uchar{164} {81}\uchar{164} {64}\uchar{164}{235}} + \definecommand cnencodeddecember {\uchar{164} {81}\uchar{164} {71}\uchar{164}{235}} + \definecommand cnencodedsunday {\uchar{172} {80}\uchar{180}{193}\uchar{164}{233}} + \definecommand cnencodedmonday {\uchar{172} {80}\uchar{180}{193}\uchar{164} {64}} + \definecommand cnencodedtuesday {\uchar{172} {80}\uchar{180}{193}\uchar{164} {71}} + \definecommand cnencodedwednesday {\uchar{172} {80}\uchar{180}{193}\uchar{164} {84}} + \definecommand cnencodedthursday {\uchar{172} {80}\uchar{180}{193}\uchar{165}{124}} + \definecommand cnencodedfriday {\uchar{172} {80}\uchar{180}{193}\uchar{164}{173}} + \definecommand cnencodedsaturday {\uchar{172} {80}\uchar{180}{193}\uchar{164}{187}} + % Tobias Burnus &\XJF + \definecommand cnyear {\uchar{166}{126}} + \definecommand cnmonth {\uchar{164}{235}} + \definecommand cnday {\uchar{164}{233}} + +% Traditional Chinese characters (only where they differ to the +% simplified ones) for lang-chi.tex and font-chi.tex. + +% \startencoding[cjk-uni] +% \defineudigit 10000 132 44 +% \defineudigit 100000000 81 4 + +% \definecommand cnencodedsection {\uchar{123}{192}} +% \definecommand cnencodedfigure {\uchar{87}{22}} +% \definecommand cnencodedunits {\uchar{138}{8}\uchar{145}{207}\uchar{85}{174}\uchar{79}{77}} +% \definecommand cnencodedlogos {\uchar{95}{189}\uchar{140}{182}} +% \definecommand cnencodedabbreviations {\uchar{126}{46}\uchar{117}{101}\uchar{138}{158}} +% \definecommand cnencodedfigures {\uchar{87}{22}\uchar{95}{98}} +% \definecommand cnencodedcontents {\uchar{118}{238}\uchar{147}{4}} +% \stopencoding + +% \startencoding[gbk] +% \defineudigit 10000 200 102 +% \defineudigit 100000000 131 124 + +% \definecommand cnencodedsection {\uchar{185}{157}} +% \definecommand cnencodedfigure {\uchar{136}{68}} +% \definecommand cnencodedunits {\uchar{211}{139}\uchar{193}{191}\uchar{134}{206}\uchar{206}{187}} +% \definecommand cnencodedlogos {\uchar{187}{213}\uchar{217}{72} +% \definecommand cnencodedabbreviations {\uchar{191}{115}\uchar{194}{212}\uchar{213}{90}} +% \definecommand cnencodedfigures {\uchar{136}{68}\uchar{208}{206}} +% \definecommand cnencodedcontents {\uchar{196}{191}\uchar{228}{155}} +% \stopencoding + +% \startencoding[big5] +% \defineudigit 10000 184 85 +% \defineudigit 100000000 187 245 + +% \definecommand cnencodedsection {\uchar{184}{96}} +% \definecommand cnencodedfigure {\uchar{185}{207}} +% \definecommand cnencodedunits {\uchar{173}{112}\uchar{182}{113}\uchar{179}{230}\uchar{166}{236}} +% \definecommand cnencodedlogos {\uchar{192}{178}\uchar{182}{83}} +% \definecommand cnencodedabbreviations {\uchar{193}{89}\uchar{178}{164}\uchar{187}{121}} +% \definecommand cnencodedfigures {\uchar{185}{207}\uchar{167}{206}} +% \definecommand cnencodedcontents {\uchar{165}{216}\uchar{191}{253}} +% \stopencoding + +\stopencoding + +\protect \endinput diff --git a/tex/context/base/lang-chi.tex b/tex/context/base/lang-chi.tex deleted file mode 100644 index 278e10745..000000000 --- a/tex/context/base/lang-chi.tex +++ /dev/null @@ -1,305 +0,0 @@ -%D \module -%D [ file=lang-chi, -%D version=2002.06.25, % 1998.10.10, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Chinese, -%D author={Hans Hagen \& Wang Lei}, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Chinese} - -%D This module is coded using the \UNICODE\ support built in -%D \CONTEXT. Therefore, \type {\uchar} is used instead of latin -%D characters. - -\unprotect - -\definesystemconstant {chinese} \definesystemconstant {cn} - -\installlanguage - [\s!cn] - [\c!leftsentence=\cnencoding\cnleftsentence, - \c!rightsentence=\cnencoding\cnrightsentence, - \c!leftsubsentence=\cnencoding\cnleftsubsentence, - \c!rightsubsentence=\cnencoding\cnrightsubsentence, - \c!leftquote=\cnencoding\cnupperleftsinglequote, - \c!rightquote=\cnencoding\cnupperrightsinglequote, - \c!leftquotation=\cnencoding\cnupperleftdoublequote, - \c!rightquotation=\cnencoding\cnupperrightdoublequote, - \c!date={\v!year,\cnyear,\ ,\v!month,\v!day,\cnday}] - -\setupheadtext [\s!cn] [\v!content={\cnencoding\cnencodedcontents}] -\setupheadtext [\s!cn] [\v!tables={\cnencoding\cnencodedtables}] -\setupheadtext [\s!cn] [\v!figures={\cnencoding\cnencodedfigures}] -\setupheadtext [\s!cn] [\v!graphics={\cnencoding\cnencodedgraphics}]% RG & XJF -\setupheadtext [\s!cn] [\v!intermezzi={\cnencoding\cnencodedintermezzo}]% RG & XJF -\setupheadtext [\s!cn] [\v!index={\cnencoding\cnencodedindex}] -\setupheadtext [\s!cn] [\v!abbreviations={\cnencoding\cnencodedabbreviations}] -\setupheadtext [\s!cn] [\v!logos={\cnencoding\cnencodedlogos}] -\setupheadtext [\s!cn] [\v!units={\cnencoding\cnencodedunits}] - -\setuplabeltext [\s!cn] [\v!table={\cnencoding\cnencodedtable}] -\setuplabeltext [\s!cn] [\v!figure={\cnencoding\cnencodedfigure}] -\setuplabeltext [\s!cn] [\v!intermezzo={\cnencoding\cnencodedintermezzo}]% RG & XJF -\setuplabeltext [\s!cn] [\v!graphic={\cnencoding\cnencodedillustration}]% RG & XJF -\setuplabeltext [\s!cn] [\v!appendix={\cnencoding\cnencodedappendix}]% RG -\setuplabeltext [\s!cn] [\v!part={\cnencoding\cnencodedintro,\cnencoding\cnencodedpart}] -\setuplabeltext [\s!cn] [\v!chapter={\cnencoding\cnencodedintro,\cnencoding\cnencodedchapter}] -\setuplabeltext [\s!cn] [\v!section={\cnencoding\cnencodedintro,\cnencoding\cnencodedsection}] -\setuplabeltext [\s!cn] [\v!line={\cnencoding\cnencodedline}]% RG & XJF -\setuplabeltext [\s!cn] [\v!lines={\cnencoding\cnencodedline}]% RG & XJF - -\setuplabeltext [\s!cn] [\v!subsection=] -\setuplabeltext [\s!cn] [\v!subsubsection=] -\setuplabeltext [\s!cn] [\v!subsubsubsection=] - -%D From this definition one can deduce that language, input -%D encoding, font encoding, and glyph meaning form a pretty -%D complex four dimensional space. - -\startlanguagespecifics[\s!cn] - -\setuplabeltext [\s!cn] [\v!january=\cnencoding\cnencodedjanuary ] -\setuplabeltext [\s!cn] [\v!february=\cnencoding\cnencodedfebrary ] -\setuplabeltext [\s!cn] [\v!march=\cnencoding\cnencodedmarch ] -\setuplabeltext [\s!cn] [\v!april=\cnencoding\cnencodedapril ] -\setuplabeltext [\s!cn] [\v!may=\cnencoding\cnencodedmay ] -\setuplabeltext [\s!cn] [\v!june=\cnencoding\cnencodedjune ] -\setuplabeltext [\s!cn] [\v!july=\cnencoding\cnencodedjuly ] -\setuplabeltext [\s!cn] [\v!august=\cnencoding\cnencodedaugust ] -\setuplabeltext [\s!cn] [\v!september=\cnencoding\cnencodedseptember] -\setuplabeltext [\s!cn] [\v!october=\cnencoding\cnencodedoctober ] -\setuplabeltext [\s!cn] [\v!november=\cnencoding\cnencodednovember ] -\setuplabeltext [\s!cn] [\v!december=\cnencoding\cnencodeddecember ] - -\setuplabeltext [\s!cn] [\v!sunday=\cnencoding\cnencodedsunday ] -\setuplabeltext [\s!cn] [\v!monday=\cnencoding\cnencodedmonday ] -\setuplabeltext [\s!cn] [\v!tuesday=\cnencoding\cnencodedtuesday ] -\setuplabeltext [\s!cn] [\v!wednesday=\cnencoding\cnencodedwednesday] -\setuplabeltext [\s!cn] [\v!thursday=\cnencoding\cnencodedthursday ] -\setuplabeltext [\s!cn] [\v!friday=\cnencoding\cnencodedfriday ] -\setuplabeltext [\s!cn] [\v!saturday=\cnencoding\cnencodedsaturday ] - -\stoplanguagespecifics - -%D One can specify a split labeltext, as demonstrated in -%D the definition of the \type {part} label. Unfortunately -%D the glyphs of both part depend on the encoding. Therefore, -%D we have an encoding section here. - -\unexpanded\def\cnencoding{\enableencoding[\chineseencoding]} % ugly and temporary - -\startencoding[cjk-uni] - \definecommand cnleftsentence {\uchar{32}{20}\uchar{32}{20}} - \definecommand cnrightsentence {\uchar{32}{20}\uchar{32}{20}} - \definecommand cnleftsubsentence {\uchar{32}{20}\uchar{32}{20}} - \definecommand cnrightsubsentence {\uchar{32}{20}\uchar{32}{20}} - \definecommand cnupperleftsinglequote {\uchar{32}{24}} - \definecommand cnupperrightsinglequote {\uchar{32}{25}} - \definecommand cnupperleftdoublequote {\uchar{32}{28}} - \definecommand cnupperrightdoublequote {\uchar{32}{29}} - \definecommand cnupperleftsinglequote-v {\uchar{48}{12}} - \definecommand cnupperrightsinglequote-v {\uchar{48}{13}} - \definecommand cnupperleftdoublequote-v {\uchar{48}{14}} - \definecommand cnupperrightdoublequote-v {\uchar{48}{15}} - \definecommand cnencodedcontents {\uchar{118}{238}\uchar{95}{85}} - \definecommand cnencodedtables {\uchar{136}{104}\uchar{104}{60}} - \definecommand cnencodedfigures {\uchar{86}{254}\uchar{95}{98}} - \definecommand cnencodedindex {\uchar{125}{34}\uchar{95}{21}} - \definecommand cnencodedabbreviations {\uchar{127}{41}\uchar{117}{101}\uchar{139}{237}} - \definecommand cnencodedlogos {\uchar{95}{189}\uchar{141}{44}} - \definecommand cnencodedunits {\uchar{139}{161}\uchar{145}{207}\uchar{83}{85}\uchar{79}{77}} - \definecommand cnencodedtable {\uchar{136}{104}} - \definecommand cnencodedfigure {\uchar{86}{254}} - \definecommand cnencodedintro {\uchar{123}{44}} - \definecommand cnencodedpart {\uchar{144}{232}\uchar{82}{6}} - \definecommand cnencodedchapter {\uchar{122}{224}} - \definecommand cnencodedsection {\uchar{130}{130}} - \definecommand cnencodedjanuary {\uchar{78}{0}\uchar{103}{8}} - \definecommand cnencodedfebrary {\uchar{78}{140}\uchar{103}{8}} - \definecommand cnencodedmarch {\uchar{78}{9}\uchar{103}{8}} - \definecommand cnencodedapril {\uchar{86}{219}\uchar{103}{8}} - \definecommand cnencodedmay {\uchar{78}{148}\uchar{103}{8}} - \definecommand cnencodedjune {\uchar{81}{109}\uchar{103}{8}} - \definecommand cnencodedjuly {\uchar{78}{3}\uchar{103}{8}} - \definecommand cnencodedaugust {\uchar{81}{107}\uchar{103}{8}} - \definecommand cnencodedseptember {\uchar{78}{93}\uchar{103}{8}} - \definecommand cnencodedoctober {\uchar{83}{65}\uchar{103}{8}} - \definecommand cnencodednovember {\uchar{83}{65}\uchar{78}{0}\uchar{103}{8}} - \definecommand cnencodeddecember {\uchar{83}{65}\uchar{78}{140}\uchar{103}{8}} - \definecommand cnencodedsunday {\uchar{102}{31}\uchar{103}{31}\uchar{101}{229}} - \definecommand cnencodedmonday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{0}} - \definecommand cnencodedtuesday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{140}} - \definecommand cnencodedwednesday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{9}} - \definecommand cnencodedthursday {\uchar{102}{31}\uchar{103}{31}\uchar{86}{219}} - \definecommand cnencodedfriday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{148}} - \definecommand cnencodedsaturday {\uchar{102}{31}\uchar{103}{31}\uchar{81}{109}} - % RG & XJF - \definecommand cnencodedgraphics {\uchar{86}{254}} - \definecommand cnencodedintermezzo {\uchar{210}{99}\uchar{242}{102}} - \definecommand cnencodedillustration {\uchar{99}{210}\uchar{86}{254}} - \definecommand cnencodedappendix {\uchar{150}{68}\uchar{95}{85}} - \definecommand cnencodedline {\uchar{136}{76}} - % Tobias Burnus & XJF - \definecommand cnyear {\uchar{94}{116}} - \definecommand cnmonth {\uchar{103}{8}} - \definecommand cnday {\uchar{101}{229}} -\stopencoding - -\startencoding[gbk] - \definecommand cnleftsentence {\uchar{161}{170}\uchar{161}{170}} - \definecommand cnrightsentence {\uchar{161}{170}\uchar{161}{170}} - \definecommand cnleftsubsentence {\uchar{161}{170}\uchar{161}{170}} - \definecommand cnrightsubsentence {\uchar{161}{170}\uchar{161}{170}} - \definecommand cnupperleftsinglequote {\uchar{161}{174}} - \definecommand cnupperrightsinglequote {\uchar{161}{175}} - \definecommand cnupperleftdoublequote {\uchar{161}{176}} - \definecommand cnupperrightdoublequote {\uchar{161}{177}} - \definecommand cnupperleftsinglequote-v {\uchar{161}{184}} - \definecommand cnupperrightsinglequote-v {\uchar{161}{185}} - \definecommand cnupperleftdoublequote-v {\uchar{161}{186}} - \definecommand cnupperrightdoublequote-v {\uchar{161}{187}} - \definecommand cnencodedcontents {\uchar{196}{191}\uchar{194}{188}} - \definecommand cnencodedtables {\uchar{177}{237}\uchar{184}{241}} - \definecommand cnencodedfigures {\uchar{205}{188}\uchar{208}{206}} - \definecommand cnencodedindex {\uchar{203}{247}\uchar{210}{253}} - \definecommand cnencodedabbreviations {\uchar{203}{245}\uchar{194}{212}\uchar{211}{239}} - \definecommand cnencodedlogos {\uchar{187}{213}\uchar{177}{225}} - \definecommand cnencodedunits {\uchar{188}{198}\uchar{193}{191}\uchar{181}{165}\uchar{206}{187}} - \definecommand cnencodedtable {\uchar{177}{237}} - \definecommand cnencodedfigure {\uchar{205}{188}} - \definecommand cnencodedintro {\uchar{181}{218}} - \definecommand cnencodedpart {\uchar{178}{191}\uchar{183}{214}} - \definecommand cnencodedchapter {\uchar{213}{194}} - \definecommand cnencodedsection {\uchar{189}{218}} - \definecommand cnencodedjanuary {\uchar{210}{187}\uchar{212}{194}} - \definecommand cnencodedfebrary {\uchar{182}{254}\uchar{212}{194}} - \definecommand cnencodedmarch {\uchar{200}{253}\uchar{212}{194}} - \definecommand cnencodedapril {\uchar{203}{196}\uchar{212}{194}} - \definecommand cnencodedmay {\uchar{206}{229}\uchar{212}{194}} - \definecommand cnencodedjune {\uchar{193}{249}\uchar{212}{194}} - \definecommand cnencodedjuly {\uchar{198}{223}\uchar{212}{194}} - \definecommand cnencodedaugust {\uchar{176}{203}\uchar{212}{194}} - \definecommand cnencodedseptember {\uchar{190}{197}\uchar{212}{194}} - \definecommand cnencodedoctober {\uchar{202}{174}\uchar{212}{194}} - \definecommand cnencodednovember {\uchar{202}{174}\uchar{210}{187}\uchar{212}{194}} - \definecommand cnencodeddecember {\uchar{202}{174}\uchar{182}{254}\uchar{212}{194}} - \definecommand cnencodedsunday {\uchar{208}{199}\uchar{198}{218}\uchar{200}{213}} - \definecommand cnencodedmonday {\uchar{208}{199}\uchar{198}{218}\uchar{210}{187}} - \definecommand cnencodedtuesday {\uchar{208}{199}\uchar{198}{218}\uchar{182}{254}} - \definecommand cnencodedwednesday {\uchar{208}{199}\uchar{198}{218}\uchar{200}{253}} - \definecommand cnencodedthursday {\uchar{208}{199}\uchar{198}{218}\uchar{203}{196}} - \definecommand cnencodedfriday {\uchar{208}{199}\uchar{198}{218}\uchar{206}{229}} - \definecommand cnencodedsaturday {\uchar{208}{199}\uchar{198}{218}\uchar{193}{249}} - % RG & XJF - \definecommand cnencodedgraphics {\uchar{205}{188}} - \definecommand cnencodedintermezzo {\uchar{178}{229}\uchar{199}{250}} - \definecommand cnencodedillustration {\uchar{178}{229}\uchar{205}{188}} - \definecommand cnencodedappendix {\uchar{184}{189}\uchar{194}{188}} - \definecommand cnencodedline {\uchar{208}{208}} - % Tobias Burnus & XJF - \definecommand cnyear {\uchar{196}{234}} - \definecommand cnmonth {\uchar{212}{194}} - \definecommand cnday {\uchar{200}{213}} -\stopencoding - -\startencoding[big5] - \definecommand cnleftsentence {\uchar{162}{119}\uchar{162}{119}} - \definecommand cnrightsentence {\uchar{162}{119}\uchar{162}{119}} - \definecommand cnleftsubsentence {\uchar{162}{119}\uchar{162}{119}} - \definecommand cnrightsubsentence {\uchar{162}{119}\uchar{162}{119}} - \definecommand cnupperleftsinglequote {\uchar{161}{165}} - \definecommand cnupperrightsinglequote {\uchar{161}{166}} - \definecommand cnupperleftdoublequote {\uchar{161}{167}} - \definecommand cnupperrightdoublequote {\uchar{161}{168}} - \definecommand cnupperleftsinglequote-v {\uchar{161}{117}} - \definecommand cnupperrightsinglequote-v {\uchar{161}{118}} - \definecommand cnupperleftdoublequote-v {\uchar{161}{121}} - \definecommand cnupperrightdoublequote-v {\uchar{161}{122}} - \definecommand cnencodecontents {\uchar{165}{216}\uchar{191}{253}} - \definecommand cnencodetables {\uchar{170}{237}\uchar{174}{230}} - \definecommand cnencodefigures {\uchar{185}{207}\uchar{167}{206}} - \definecommand cnencodeindex {\uchar{175}{193}\uchar{174}{222}} - \definecommand cnencodeabbreviations {\uchar{191}{89}\uchar{178}{164}\uchar{187}{121}} - \definecommand cnencodelogos {\uchar{192}{178}\uchar{188}{208}} - \definecommand cnencodeunits {\uchar{173}{112}\uchar{182}{113}\uchar{179}{230}\uchar{166}{236}} - \definecommand cnencodetable {\uchar{170}{237}} - \definecommand cnencodefigure {\uchar{185}{207}} - \definecommand cnencodedintro {\uchar{178}{196}} - \definecommand cnencodedpart {\uchar{179}{161}\uchar{164}{192}} - \definecommand cnencodedchapter {\uchar{179}{185}} - \definecommand cnencodedsection {\uchar{184} {96}} - \definecommand cnencodedjanuary {\uchar{164} {64}\uchar{164}{235}} - \definecommand cnencodedfebrary {\uchar{164} {71}\uchar{164}{235}} - \definecommand cnencodedmarch {\uchar{164} {84}\uchar{164}{235}} - \definecommand cnencodedapril {\uchar{165}{124}\uchar{164}{235}} - \definecommand cnencodedmay {\uchar{164}{173}\uchar{164}{235}} - \definecommand cnencodedjune {\uchar{164}{187}\uchar{164}{235}} - \definecommand cnencodedjuly {\uchar{164} {67}\uchar{164}{235}} - \definecommand cnencodedaugust {\uchar{164} {75}\uchar{164}{235}} - \definecommand cnencodedseptember {\uchar{164} {69}\uchar{164}{235}} - \definecommand cnencodedoctober {\uchar{164} {81}\uchar{164}{235}} - \definecommand cnencodednovember {\uchar{164} {81}\uchar{164} {64}\uchar{164}{235}} - \definecommand cnencodeddecember {\uchar{164} {81}\uchar{164} {71}\uchar{164}{235}} - \definecommand cnencodedsunday {\uchar{172} {80}\uchar{180}{193}\uchar{164}{233}} - \definecommand cnencodedmonday {\uchar{172} {80}\uchar{180}{193}\uchar{164} {64}} - \definecommand cnencodedtuesday {\uchar{172} {80}\uchar{180}{193}\uchar{164} {71}} - \definecommand cnencodedwednesday {\uchar{172} {80}\uchar{180}{193}\uchar{164} {84}} - \definecommand cnencodedthursday {\uchar{172} {80}\uchar{180}{193}\uchar{165}{124}} - \definecommand cnencodedfriday {\uchar{172} {80}\uchar{180}{193}\uchar{164}{173}} - \definecommand cnencodedsaturday {\uchar{172} {80}\uchar{180}{193}\uchar{164}{187}} - % Tobias Burnus &\XJF - \definecommand cnyear {\uchar{166}{126}} - \definecommand cnmonth {\uchar{164}{235}} - \definecommand cnday {\uchar{164}{233}} - -% Traditional Chinese characters (only where they differ to the -% simplified ones) for lang-chi.tex and font-chi.tex. - -% \startencoding[cjk-uni] -% \defineudigit 10000 132 44 -% \defineudigit 100000000 81 4 - -% \definecommand cnencodedsection {\uchar{123}{192}} -% \definecommand cnencodedfigure {\uchar{87}{22}} -% \definecommand cnencodedunits {\uchar{138}{8}\uchar{145}{207}\uchar{85}{174}\uchar{79}{77}} -% \definecommand cnencodedlogos {\uchar{95}{189}\uchar{140}{182}} -% \definecommand cnencodedabbreviations {\uchar{126}{46}\uchar{117}{101}\uchar{138}{158}} -% \definecommand cnencodedfigures {\uchar{87}{22}\uchar{95}{98}} -% \definecommand cnencodedcontents {\uchar{118}{238}\uchar{147}{4}} -% \stopencoding - -% \startencoding[gbk] -% \defineudigit 10000 200 102 -% \defineudigit 100000000 131 124 - -% \definecommand cnencodedsection {\uchar{185}{157}} -% \definecommand cnencodedfigure {\uchar{136}{68}} -% \definecommand cnencodedunits {\uchar{211}{139}\uchar{193}{191}\uchar{134}{206}\uchar{206}{187}} -% \definecommand cnencodedlogos {\uchar{187}{213}\uchar{217}{72} -% \definecommand cnencodedabbreviations {\uchar{191}{115}\uchar{194}{212}\uchar{213}{90}} -% \definecommand cnencodedfigures {\uchar{136}{68}\uchar{208}{206}} -% \definecommand cnencodedcontents {\uchar{196}{191}\uchar{228}{155}} -% \stopencoding - -% \startencoding[big5] -% \defineudigit 10000 184 85 -% \defineudigit 100000000 187 245 - -% \definecommand cnencodedsection {\uchar{184}{96}} -% \definecommand cnencodedfigure {\uchar{185}{207}} -% \definecommand cnencodedunits {\uchar{173}{112}\uchar{182}{113}\uchar{179}{230}\uchar{166}{236}} -% \definecommand cnencodedlogos {\uchar{192}{178}\uchar{182}{83}} -% \definecommand cnencodedabbreviations {\uchar{193}{89}\uchar{178}{164}\uchar{187}{121}} -% \definecommand cnencodedfigures {\uchar{185}{207}\uchar{167}{206}} -% \definecommand cnencodedcontents {\uchar{165}{216}\uchar{191}{253}} -% \stopencoding - -\stopencoding - -\protect \endinput diff --git a/tex/context/base/lang-cjk.mkiv b/tex/context/base/lang-cjk.mkiv new file mode 100644 index 000000000..138f6d263 --- /dev/null +++ b/tex/context/base/lang-cjk.mkiv @@ -0,0 +1,328 @@ +%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 + +% Chinese + +\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,日}] + +\setupheadtext [\s!cn] [\v!content=目录] +\setupheadtext [\s!cn] [\v!tables=表格] +\setupheadtext [\s!cn] [\v!figures=图形] +\setupheadtext [\s!cn] [\v!graphics=图] +\setupheadtext [\s!cn] [\v!intermezzi=퉣] +\setupheadtext [\s!cn] [\v!index=索引] +\setupheadtext [\s!cn] [\v!abbreviations=缩略语] +\setupheadtext [\s!cn] [\v!logos=徽贬] +\setupheadtext [\s!cn] [\v!units=计量单位] + +\setuplabeltext [\s!cn] [\v!table=表] +\setuplabeltext [\s!cn] [\v!figure=图] +\setuplabeltext [\s!cn] [\v!intermezzo=퉣] +\setuplabeltext [\s!cn] [\v!graphic=插图] +\setuplabeltext [\s!cn] [\v!appendix=附录] +\setuplabeltext [\s!cn] [\v!part={第,部分}] +\setuplabeltext [\s!cn] [\v!chapter={第,章}] +\setuplabeltext [\s!cn] [\v!section={第,节}] +\setuplabeltext [\s!cn] [\v!line=行] +\setuplabeltext [\s!cn] [\v!lines=行] + +\setuplabeltext [\s!cn] [\v!subsection=] +\setuplabeltext [\s!cn] [\v!subsubsection=] +\setuplabeltext [\s!cn] [\v!subsubsubsection=] + +\setuplabeltext [\s!cn] [\v!january=一月] +\setuplabeltext [\s!cn] [\v!february=二月] +\setuplabeltext [\s!cn] [\v!march=三月] +\setuplabeltext [\s!cn] [\v!april=四月] +\setuplabeltext [\s!cn] [\v!may=五月] +\setuplabeltext [\s!cn] [\v!june=六月] +\setuplabeltext [\s!cn] [\v!july=七月] +\setuplabeltext [\s!cn] [\v!august=八月] +\setuplabeltext [\s!cn] [\v!september=九月] +\setuplabeltext [\s!cn] [\v!october=十月] +\setuplabeltext [\s!cn] [\v!november=十一月] +\setuplabeltext [\s!cn] [\v!december=十二月] + +\setuplabeltext [\s!cn] [\v!sunday=星期日] +\setuplabeltext [\s!cn] [\v!monday=星期一] +\setuplabeltext [\s!cn] [\v!tuesday=星期二] +\setuplabeltext [\s!cn] [\v!wednesday=星期三] +\setuplabeltext [\s!cn] [\v!thursday=星期四] +\setuplabeltext [\s!cn] [\v!friday=星期五] +\setuplabeltext [\s!cn] [\v!saturday=星期六] + +%D Japanese + +\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,日}] + +\setupheadtext [\s!ja] [\v!content=目次] +\setupheadtext [\s!ja] [\v!tables=机] +\setupheadtext [\s!ja] [\v!figures=図] +\setupheadtext [\s!ja] [\v!graphics=グラフ] +\setupheadtext [\s!ja] [\v!intermezzi=間奏曲] +\setupheadtext [\s!ja] [\v!index=目次] +\setupheadtext [\s!ja] [\v!abbreviations=略語] +\setupheadtext [\s!ja] [\v!logos=理性] +\setupheadtext [\s!ja] [\v!units=ユニッツ] + +\setuplabeltext [\s!ja] [\v!table=表] +\setuplabeltext [\s!ja] [\v!figure=図] +\setuplabeltext [\s!ja] [\v!intermezzo=間奏曲] +\setuplabeltext [\s!ja] [\v!graphic=イラスト] +\setuplabeltext [\s!ja] [\v!appendix=付録] +\setuplabeltext [\s!ja] [\v!part={第,パート}] +\setuplabeltext [\s!ja] [\v!chapter={第,章}] +\setuplabeltext [\s!ja] [\v!section={第,項}] +\setuplabeltext [\s!ja] [\v!line=線] +\setuplabeltext [\s!ja] [\v!lines=線] + +\setuplabeltext [\s!ja] [\v!subsection=] +\setuplabeltext [\s!ja] [\v!subsubsection=] +\setuplabeltext [\s!ja] [\v!subsubsubsection=] + +\setuplabeltext [\s!ja] [\v!january=1] +\setuplabeltext [\s!ja] [\v!february=2] +\setuplabeltext [\s!ja] [\v!march=3] +\setuplabeltext [\s!ja] [\v!april=4] +\setuplabeltext [\s!ja] [\v!may=5] +\setuplabeltext [\s!ja] [\v!june=6] +\setuplabeltext [\s!ja] [\v!july=7] +\setuplabeltext [\s!ja] [\v!august=8] +\setuplabeltext [\s!ja] [\v!september=9] +\setuplabeltext [\s!ja] [\v!october=10] +\setuplabeltext [\s!ja] [\v!november=11] +\setuplabeltext [\s!ja] [\v!december=12] + +\setuplabeltext [\s!ja] [\v!sunday=月曜日] +\setuplabeltext [\s!ja] [\v!monday=火曜日] +\setuplabeltext [\s!ja] [\v!tuesday=水曜日] +\setuplabeltext [\s!ja] [\v!wednesday=木曜日] +\setuplabeltext [\s!ja] [\v!thursday=金曜日] +\setuplabeltext [\s!ja] [\v!friday=土曜日] +\setuplabeltext [\s!ja] [\v!saturday=日曜日] + +%D Korean + +% todo + +\protect \endinput + +cn={ + ["abbreviations"]="缩略语", + ["appendix"]="附录", + ["april"]="四月", + ["august"]="八月", + ["chapter"]="章", + ["contents"]="目录", + ["day"]="日", + ["december"]="十二月", + ["febrary"]="二月", + ["figure"]="图", + ["figures"]="图形", + ["friday"]="星期五", + ["graphics"]="图", + ["illustration"]="插图", + ["index"]="索引", + ["intermezzo"]="퉣", + ["intro"]="第", + ["january"]="一月", + ["july"]="七月", + ["june"]="六月", + ["leftsentence"]="——", + ["leftsubsentence"]="——", + ["line"]="行", + ["logos"]="徽贬", + ["march"]="三月", + ["may"]="五月", + ["monday"]="星期一", + ["month"]="月", + ["november"]="十一月", + ["october"]="十月", + ["part"]="部分", + ["rightsentence"]="——", + ["rightsubsentence"]="——", + ["saturday"]="星期六", + ["section"]="节", + ["september"]="九月", + ["sunday"]="星期日", + ["table"]="表", + ["tables"]="表格", + ["thursday"]="星期四", + ["tuesday"]="星期二", + ["units"]="计量单位", + ["upperleftdoublequote"]="“", + ["upperleftdoublequote-v"]="『", + ["upperleftsinglequote"]="‘", + ["upperleftsinglequote-v"]="「", + ["upperrightdoublequote"]="”", + ["upperrightdoublequote-v"]="』", + ["upperrightsinglequote"]="’", + ["upperrightsinglequote-v"]="」", + ["wednesday"]="星期三", + ["year"]="年", +} + +ja={ + ["abbreviations"]="略語", + ["abstract"]="概要", + ["and"]="、", + ["answer"]="答:", + ["appendix"]="付録", + ["april"]="四月", + ["article"]="項目", + ["august"]="八月", + ["bibliography"]="参考文献", + ["book"]="ブック", + ["bridgehead"]="項", + ["bullet"]="●", + ["by"]=":", + ["caution"]="注意", + ["chapter"]="章", + ["christiandate"]="西暦", + ["colophon"]="奥付", + ["copyright"]="製作著作", + ["day"]="日", + ["december"]="十二月", + ["dedication"]="謝辞", + ["edited"]="編者", + ["editedby"]="編者:", + ["edition"]="編集", + ["endquote"]="」", + ["equation"]="式", + ["example"]="例", + ["february"]="二月", + ["figure"]="図", + ["figures"]="図", + ["friday"]="土曜日", + ["glossary"]="用語集", + ["glosssee"]="参照", + ["glossseealso"]="参照", + ["graphics"]="グラフ", + ["illustration"]="イラスト", + ["important"]="重要項目", + ["index"]="目次", + ["indexsymbols"]="シンボル", + ["intermezzo"]="間奏曲", + ["intermezzos"]="間奏曲", + ["intro"]="第", + ["january"]="一月", + ["july"]="七月", + ["june"]="六月", + ["leftsentence"]="——", + ["leftsubsentence"]="——", + ["line"]="線", + ["lines"]="線", + ["listofequations"]="式目次", + ["listofexamples"]="例目次", + ["listoffigures"]="図目次", + ["listoftables"]="表目次", + ["listofunknown"]="不明目次", + ["logos"]="理性", + ["march"]="三月", + ["may"]="五月", + ["monday"]="火曜日", + ["month"]="月", + ["msgaud"]="対象者", + ["msglevel"]="レベル", + ["msgorig"]="発信元", + ["navhome"]="ホーム", + ["navnext"]="次のページ", + ["navnextsibling"]="早送り", + ["navprev"]="前のページ", + ["navprevsibling"]="巻戻し", + ["navup"]="上に戻る", + ["nestedendquote"]="』", + ["nestedstartquote"]="『", + ["nonexistantelement"]="要素が存在しません", + ["note"]="注意", + ["notes"]="注意", + ["november"]="十一月", + ["october"]="十月", + ["pages"]="偧献", + ["part"]="パート", + ["preface"]="序文", + ["procedure"]="手順", + ["procedureformal"]="手順", + ["productionset"]="プロダクション", + ["productionsetformal"]="プロダクション", + ["published"]="発行", + ["qandadiv"]="問:、答:", + ["qandaentry"]="問:", + ["question"]="問:", + ["reference"]="参照", + ["refname"]="名前", + ["refsection"]="項", + ["refsynopsisdiv"]="概要", + ["revhistory"]="改訂履歴", + ["revision"]="改訂", + ["rightsentence"]="——", + ["rightsubsentence"]="——", + ["saturday"]="日曜日", + ["section"]="項", + ["see"]="参照", + ["seealso"]="参照", + ["separator"]="、", + ["september"]="九月", + ["set"]="設定", + ["setindex"]="目次設定", + ["sidebar"]="サイドバー", + ["simplesect"]="項", + ["singleendquote"]="’", + ["singlestartquote"]="‘", + ["startquote"]="「", + ["step"]="ステップ", + ["sunday"]="月曜日", + ["table"]="表", + ["tablenotes"]="注意", + ["tableofcontents"]="目次", + ["tables"]="机", + ["thursday"]="金曜日", + ["tip"]="ティップ", + ["tuesday"]="水曜日", + ["unexpectedelementname"]="不明な要素名", + ["units"]="ユニッツ", + ["unsupported"]="サポートしません", + ["warning"]="警告", + ["wednesday"]="木曜日", + ["year"]="年", +} diff --git a/tex/context/base/lang-cjk.tex b/tex/context/base/lang-cjk.tex deleted file mode 100644 index 138f6d263..000000000 --- a/tex/context/base/lang-cjk.tex +++ /dev/null @@ -1,328 +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 - -% Chinese - -\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,日}] - -\setupheadtext [\s!cn] [\v!content=目录] -\setupheadtext [\s!cn] [\v!tables=表格] -\setupheadtext [\s!cn] [\v!figures=图形] -\setupheadtext [\s!cn] [\v!graphics=图] -\setupheadtext [\s!cn] [\v!intermezzi=퉣] -\setupheadtext [\s!cn] [\v!index=索引] -\setupheadtext [\s!cn] [\v!abbreviations=缩略语] -\setupheadtext [\s!cn] [\v!logos=徽贬] -\setupheadtext [\s!cn] [\v!units=计量单位] - -\setuplabeltext [\s!cn] [\v!table=表] -\setuplabeltext [\s!cn] [\v!figure=图] -\setuplabeltext [\s!cn] [\v!intermezzo=퉣] -\setuplabeltext [\s!cn] [\v!graphic=插图] -\setuplabeltext [\s!cn] [\v!appendix=附录] -\setuplabeltext [\s!cn] [\v!part={第,部分}] -\setuplabeltext [\s!cn] [\v!chapter={第,章}] -\setuplabeltext [\s!cn] [\v!section={第,节}] -\setuplabeltext [\s!cn] [\v!line=行] -\setuplabeltext [\s!cn] [\v!lines=行] - -\setuplabeltext [\s!cn] [\v!subsection=] -\setuplabeltext [\s!cn] [\v!subsubsection=] -\setuplabeltext [\s!cn] [\v!subsubsubsection=] - -\setuplabeltext [\s!cn] [\v!january=一月] -\setuplabeltext [\s!cn] [\v!february=二月] -\setuplabeltext [\s!cn] [\v!march=三月] -\setuplabeltext [\s!cn] [\v!april=四月] -\setuplabeltext [\s!cn] [\v!may=五月] -\setuplabeltext [\s!cn] [\v!june=六月] -\setuplabeltext [\s!cn] [\v!july=七月] -\setuplabeltext [\s!cn] [\v!august=八月] -\setuplabeltext [\s!cn] [\v!september=九月] -\setuplabeltext [\s!cn] [\v!october=十月] -\setuplabeltext [\s!cn] [\v!november=十一月] -\setuplabeltext [\s!cn] [\v!december=十二月] - -\setuplabeltext [\s!cn] [\v!sunday=星期日] -\setuplabeltext [\s!cn] [\v!monday=星期一] -\setuplabeltext [\s!cn] [\v!tuesday=星期二] -\setuplabeltext [\s!cn] [\v!wednesday=星期三] -\setuplabeltext [\s!cn] [\v!thursday=星期四] -\setuplabeltext [\s!cn] [\v!friday=星期五] -\setuplabeltext [\s!cn] [\v!saturday=星期六] - -%D Japanese - -\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,日}] - -\setupheadtext [\s!ja] [\v!content=目次] -\setupheadtext [\s!ja] [\v!tables=机] -\setupheadtext [\s!ja] [\v!figures=図] -\setupheadtext [\s!ja] [\v!graphics=グラフ] -\setupheadtext [\s!ja] [\v!intermezzi=間奏曲] -\setupheadtext [\s!ja] [\v!index=目次] -\setupheadtext [\s!ja] [\v!abbreviations=略語] -\setupheadtext [\s!ja] [\v!logos=理性] -\setupheadtext [\s!ja] [\v!units=ユニッツ] - -\setuplabeltext [\s!ja] [\v!table=表] -\setuplabeltext [\s!ja] [\v!figure=図] -\setuplabeltext [\s!ja] [\v!intermezzo=間奏曲] -\setuplabeltext [\s!ja] [\v!graphic=イラスト] -\setuplabeltext [\s!ja] [\v!appendix=付録] -\setuplabeltext [\s!ja] [\v!part={第,パート}] -\setuplabeltext [\s!ja] [\v!chapter={第,章}] -\setuplabeltext [\s!ja] [\v!section={第,項}] -\setuplabeltext [\s!ja] [\v!line=線] -\setuplabeltext [\s!ja] [\v!lines=線] - -\setuplabeltext [\s!ja] [\v!subsection=] -\setuplabeltext [\s!ja] [\v!subsubsection=] -\setuplabeltext [\s!ja] [\v!subsubsubsection=] - -\setuplabeltext [\s!ja] [\v!january=1] -\setuplabeltext [\s!ja] [\v!february=2] -\setuplabeltext [\s!ja] [\v!march=3] -\setuplabeltext [\s!ja] [\v!april=4] -\setuplabeltext [\s!ja] [\v!may=5] -\setuplabeltext [\s!ja] [\v!june=6] -\setuplabeltext [\s!ja] [\v!july=7] -\setuplabeltext [\s!ja] [\v!august=8] -\setuplabeltext [\s!ja] [\v!september=9] -\setuplabeltext [\s!ja] [\v!october=10] -\setuplabeltext [\s!ja] [\v!november=11] -\setuplabeltext [\s!ja] [\v!december=12] - -\setuplabeltext [\s!ja] [\v!sunday=月曜日] -\setuplabeltext [\s!ja] [\v!monday=火曜日] -\setuplabeltext [\s!ja] [\v!tuesday=水曜日] -\setuplabeltext [\s!ja] [\v!wednesday=木曜日] -\setuplabeltext [\s!ja] [\v!thursday=金曜日] -\setuplabeltext [\s!ja] [\v!friday=土曜日] -\setuplabeltext [\s!ja] [\v!saturday=日曜日] - -%D Korean - -% todo - -\protect \endinput - -cn={ - ["abbreviations"]="缩略语", - ["appendix"]="附录", - ["april"]="四月", - ["august"]="八月", - ["chapter"]="章", - ["contents"]="目录", - ["day"]="日", - ["december"]="十二月", - ["febrary"]="二月", - ["figure"]="图", - ["figures"]="图形", - ["friday"]="星期五", - ["graphics"]="图", - ["illustration"]="插图", - ["index"]="索引", - ["intermezzo"]="퉣", - ["intro"]="第", - ["january"]="一月", - ["july"]="七月", - ["june"]="六月", - ["leftsentence"]="——", - ["leftsubsentence"]="——", - ["line"]="行", - ["logos"]="徽贬", - ["march"]="三月", - ["may"]="五月", - ["monday"]="星期一", - ["month"]="月", - ["november"]="十一月", - ["october"]="十月", - ["part"]="部分", - ["rightsentence"]="——", - ["rightsubsentence"]="——", - ["saturday"]="星期六", - ["section"]="节", - ["september"]="九月", - ["sunday"]="星期日", - ["table"]="表", - ["tables"]="表格", - ["thursday"]="星期四", - ["tuesday"]="星期二", - ["units"]="计量单位", - ["upperleftdoublequote"]="“", - ["upperleftdoublequote-v"]="『", - ["upperleftsinglequote"]="‘", - ["upperleftsinglequote-v"]="「", - ["upperrightdoublequote"]="”", - ["upperrightdoublequote-v"]="』", - ["upperrightsinglequote"]="’", - ["upperrightsinglequote-v"]="」", - ["wednesday"]="星期三", - ["year"]="年", -} - -ja={ - ["abbreviations"]="略語", - ["abstract"]="概要", - ["and"]="、", - ["answer"]="答:", - ["appendix"]="付録", - ["april"]="四月", - ["article"]="項目", - ["august"]="八月", - ["bibliography"]="参考文献", - ["book"]="ブック", - ["bridgehead"]="項", - ["bullet"]="●", - ["by"]=":", - ["caution"]="注意", - ["chapter"]="章", - ["christiandate"]="西暦", - ["colophon"]="奥付", - ["copyright"]="製作著作", - ["day"]="日", - ["december"]="十二月", - ["dedication"]="謝辞", - ["edited"]="編者", - ["editedby"]="編者:", - ["edition"]="編集", - ["endquote"]="」", - ["equation"]="式", - ["example"]="例", - ["february"]="二月", - ["figure"]="図", - ["figures"]="図", - ["friday"]="土曜日", - ["glossary"]="用語集", - ["glosssee"]="参照", - ["glossseealso"]="参照", - ["graphics"]="グラフ", - ["illustration"]="イラスト", - ["important"]="重要項目", - ["index"]="目次", - ["indexsymbols"]="シンボル", - ["intermezzo"]="間奏曲", - ["intermezzos"]="間奏曲", - ["intro"]="第", - ["january"]="一月", - ["july"]="七月", - ["june"]="六月", - ["leftsentence"]="——", - ["leftsubsentence"]="——", - ["line"]="線", - ["lines"]="線", - ["listofequations"]="式目次", - ["listofexamples"]="例目次", - ["listoffigures"]="図目次", - ["listoftables"]="表目次", - ["listofunknown"]="不明目次", - ["logos"]="理性", - ["march"]="三月", - ["may"]="五月", - ["monday"]="火曜日", - ["month"]="月", - ["msgaud"]="対象者", - ["msglevel"]="レベル", - ["msgorig"]="発信元", - ["navhome"]="ホーム", - ["navnext"]="次のページ", - ["navnextsibling"]="早送り", - ["navprev"]="前のページ", - ["navprevsibling"]="巻戻し", - ["navup"]="上に戻る", - ["nestedendquote"]="』", - ["nestedstartquote"]="『", - ["nonexistantelement"]="要素が存在しません", - ["note"]="注意", - ["notes"]="注意", - ["november"]="十一月", - ["october"]="十月", - ["pages"]="偧献", - ["part"]="パート", - ["preface"]="序文", - ["procedure"]="手順", - ["procedureformal"]="手順", - ["productionset"]="プロダクション", - ["productionsetformal"]="プロダクション", - ["published"]="発行", - ["qandadiv"]="問:、答:", - ["qandaentry"]="問:", - ["question"]="問:", - ["reference"]="参照", - ["refname"]="名前", - ["refsection"]="項", - ["refsynopsisdiv"]="概要", - ["revhistory"]="改訂履歴", - ["revision"]="改訂", - ["rightsentence"]="——", - ["rightsubsentence"]="——", - ["saturday"]="日曜日", - ["section"]="項", - ["see"]="参照", - ["seealso"]="参照", - ["separator"]="、", - ["september"]="九月", - ["set"]="設定", - ["setindex"]="目次設定", - ["sidebar"]="サイドバー", - ["simplesect"]="項", - ["singleendquote"]="’", - ["singlestartquote"]="‘", - ["startquote"]="「", - ["step"]="ステップ", - ["sunday"]="月曜日", - ["table"]="表", - ["tablenotes"]="注意", - ["tableofcontents"]="目次", - ["tables"]="机", - ["thursday"]="金曜日", - ["tip"]="ティップ", - ["tuesday"]="水曜日", - ["unexpectedelementname"]="不明な要素名", - ["units"]="ユニッツ", - ["unsupported"]="サポートしません", - ["warning"]="警告", - ["wednesday"]="木曜日", - ["year"]="年", -} diff --git a/tex/context/base/lang-ctx.mkii b/tex/context/base/lang-ctx.mkii new file mode 100644 index 000000000..09f28dda1 --- /dev/null +++ b/tex/context/base/lang-ctx.mkii @@ -0,0 +1,53 @@ +%D \module +%D [ file=lang-ctx, +%D version=2005.02.12, +%D title=\CONTEXT\ Language Macros, +%D subtitle=Generic Patterns, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 / Generic Patterns} + +\unprotect + +%D The \CONTEXT\ specific patterns are more generic and +%D are more or less encoding independent. They are generated +%D from the ones shipped with distributions using: +%D +%D \starttyping +%D ctxtools --pattern --all +%D \stoptyping + +%D In order to get 8 bit characters hyphenated, we need to load +%D patterns under the right circumstances. In some countries, more +%D than one font encoding is in use. I can add more defaults here +%D if users let me know what encoding they use. + +% \installlanguage [\s!nl] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] +% \installlanguage [\s!fr] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] +% \installlanguage [\s!de] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] +% \installlanguage [\s!it] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] +% \installlanguage [\s!pt] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] +% \installlanguage [\s!hr] [\s!mapping=ec,\s!encoding=ec] % no il2, misses cacute characters +% \installlanguage [\s!pl] [\s!mapping={pl0,ec,qx},\s!encoding={pl0,ec,qx}] % pl0 may go +% \installlanguage [\s!cs] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go +% \installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go +% \installlanguage [\s!sl] [\s!mapping=ec,\s!encoding=ec] % il2 has gone +% \installlanguage [\s!vi] [\s!mapping=t5,\s!encoding=t5] +% \installlanguage [\s!ru] [\s!mapping=t2a,\s!encoding=t2a] + +% beware, don't use \setuplanguage here + +% \installlanguage[\s!gb][\s!lefthyphenmin=3,\s!righthyphenmin=3] % patterns can only handle this +% \installlanguage[\s!us][\s!lefthyphenmin=2,\s!righthyphenmin=3] % patterns can only handle this + +% greek + +% \installlanguage[\s!agr][\s!mapping=\s!agr,\s!encoding=\s!agr] + +\protect \endinput diff --git a/tex/context/base/lang-ctx.tex b/tex/context/base/lang-ctx.tex deleted file mode 100644 index 09f28dda1..000000000 --- a/tex/context/base/lang-ctx.tex +++ /dev/null @@ -1,53 +0,0 @@ -%D \module -%D [ file=lang-ctx, -%D version=2005.02.12, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Generic Patterns, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Generic Patterns} - -\unprotect - -%D The \CONTEXT\ specific patterns are more generic and -%D are more or less encoding independent. They are generated -%D from the ones shipped with distributions using: -%D -%D \starttyping -%D ctxtools --pattern --all -%D \stoptyping - -%D In order to get 8 bit characters hyphenated, we need to load -%D patterns under the right circumstances. In some countries, more -%D than one font encoding is in use. I can add more defaults here -%D if users let me know what encoding they use. - -% \installlanguage [\s!nl] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] -% \installlanguage [\s!fr] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] -% \installlanguage [\s!de] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] -% \installlanguage [\s!it] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] -% \installlanguage [\s!pt] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}] -% \installlanguage [\s!hr] [\s!mapping=ec,\s!encoding=ec] % no il2, misses cacute characters -% \installlanguage [\s!pl] [\s!mapping={pl0,ec,qx},\s!encoding={pl0,ec,qx}] % pl0 may go -% \installlanguage [\s!cs] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go -% \installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go -% \installlanguage [\s!sl] [\s!mapping=ec,\s!encoding=ec] % il2 has gone -% \installlanguage [\s!vi] [\s!mapping=t5,\s!encoding=t5] -% \installlanguage [\s!ru] [\s!mapping=t2a,\s!encoding=t2a] - -% beware, don't use \setuplanguage here - -% \installlanguage[\s!gb][\s!lefthyphenmin=3,\s!righthyphenmin=3] % patterns can only handle this -% \installlanguage[\s!us][\s!lefthyphenmin=2,\s!righthyphenmin=3] % patterns can only handle this - -% greek - -% \installlanguage[\s!agr][\s!mapping=\s!agr,\s!encoding=\s!agr] - -\protect \endinput diff --git a/tex/context/base/lang-dis.mkii b/tex/context/base/lang-dis.mkii new file mode 100644 index 000000000..f081bf4a9 --- /dev/null +++ b/tex/context/base/lang-dis.mkii @@ -0,0 +1,59 @@ +%D \module +%D [ file=lang-dis, +%D version=2005.02.12, +%D title=\CONTEXT\ Language Macros, +%D subtitle=Distribution Patterns, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 code used to be part of cont-usr.tex but now that we +%D use more generic pattern files, we decided to isolate these +%D mappings. + +\writestatus{loading}{ConTeXt Language Macros / Distribution Patterns} + +%D Hyphenation patterns are normally sought in filed named +%D \type {lang-xx.pat}. When present on the system, those +%D patterns take precedence. This list will be adapted to +%D the actual situation, given that it's noticed. + +%D The us/uk hyph 1/2 files will go + +\unprotect + +% \definefilefallback [lang-ca.pat] [cahyph.tex] +% \definefilefallback [lang-da.pat] [dkhyph.tex] +% \definefilefallback [lang-de.pat] [dehyphn.tex] +% \definefilefallback [lang-es.pat] [eshyph.tex] +% \definefilefallback [lang-fi.pat] [fihyph.tex] +% \definefilefallback [lang-fr.pat] [frhyph.tex] +% \definefilefallback [lang-hr.pat] [hrhyph.tex] +% \definefilefallback [lang-hu.pat] [huhyph.tex] +% \definefilefallback [lang-it.pat] [ithyph.tex] +% \definefilefallback [lang-la.pat] [lahyph7.tex] +% \definefilefallback [lang-no.pat] [nohyph.tex] +% \definefilefallback [lang-pl.pat] [plhyph.tex] +% \definefilefallback [lang-pt.pat] [pthyph.tex] +% \definefilefallback [lang-ro.pat] [rohyph.tex] +% \definefilefallback [lang-ru.pat] [ruenhyph.tex] +% \definefilefallback [lang-sl.pat] [sihyph.tex,slhyph.tex] +% \definefilefallback [lang-sv.pat] [svhyph.tex,sehyph.tex] +% \definefilefallback [lang-tr.pat] [tkhyph.tex,trhyph.tex] +% \definefilefallback [lang-ua.pat] [ukrenhyp.tex] +% \definefilefallback [lang-uk.pat] [ukhyphen.tex,ukhyph.tex] +% \definefilefallback [lang-us.pat] [ushyphmax.tex,ushyph.tex,ushyph1.tex,ushyph2.tex,hyphen.tex] +% \definefilefallback [lang-nl.pat] [nehyph96.tex,dutch96.pat,nehyph.tex] +% \definefilefallback [lang-cz.pat] [czhyphen.tex,czhyph.pat] +% \definefilefallback [lang-sk.pat] [skhyphen.tex,skhyph.pat] +% \definefilefallback [lang-deo.pat] [dehypht.tex] + +% \definefilesynonym [lang-af.pat] [lang-nl.pat] +% \definefilesynonym [lang-en.pat] [lang-us.pat] +% \definefilesynonym [lang-en.hyp] [lang-us.hyp] + +\protect \endinput diff --git a/tex/context/base/lang-dis.tex b/tex/context/base/lang-dis.tex deleted file mode 100644 index f081bf4a9..000000000 --- a/tex/context/base/lang-dis.tex +++ /dev/null @@ -1,59 +0,0 @@ -%D \module -%D [ file=lang-dis, -%D version=2005.02.12, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Distribution Patterns, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 code used to be part of cont-usr.tex but now that we -%D use more generic pattern files, we decided to isolate these -%D mappings. - -\writestatus{loading}{ConTeXt Language Macros / Distribution Patterns} - -%D Hyphenation patterns are normally sought in filed named -%D \type {lang-xx.pat}. When present on the system, those -%D patterns take precedence. This list will be adapted to -%D the actual situation, given that it's noticed. - -%D The us/uk hyph 1/2 files will go - -\unprotect - -% \definefilefallback [lang-ca.pat] [cahyph.tex] -% \definefilefallback [lang-da.pat] [dkhyph.tex] -% \definefilefallback [lang-de.pat] [dehyphn.tex] -% \definefilefallback [lang-es.pat] [eshyph.tex] -% \definefilefallback [lang-fi.pat] [fihyph.tex] -% \definefilefallback [lang-fr.pat] [frhyph.tex] -% \definefilefallback [lang-hr.pat] [hrhyph.tex] -% \definefilefallback [lang-hu.pat] [huhyph.tex] -% \definefilefallback [lang-it.pat] [ithyph.tex] -% \definefilefallback [lang-la.pat] [lahyph7.tex] -% \definefilefallback [lang-no.pat] [nohyph.tex] -% \definefilefallback [lang-pl.pat] [plhyph.tex] -% \definefilefallback [lang-pt.pat] [pthyph.tex] -% \definefilefallback [lang-ro.pat] [rohyph.tex] -% \definefilefallback [lang-ru.pat] [ruenhyph.tex] -% \definefilefallback [lang-sl.pat] [sihyph.tex,slhyph.tex] -% \definefilefallback [lang-sv.pat] [svhyph.tex,sehyph.tex] -% \definefilefallback [lang-tr.pat] [tkhyph.tex,trhyph.tex] -% \definefilefallback [lang-ua.pat] [ukrenhyp.tex] -% \definefilefallback [lang-uk.pat] [ukhyphen.tex,ukhyph.tex] -% \definefilefallback [lang-us.pat] [ushyphmax.tex,ushyph.tex,ushyph1.tex,ushyph2.tex,hyphen.tex] -% \definefilefallback [lang-nl.pat] [nehyph96.tex,dutch96.pat,nehyph.tex] -% \definefilefallback [lang-cz.pat] [czhyphen.tex,czhyph.pat] -% \definefilefallback [lang-sk.pat] [skhyphen.tex,skhyph.pat] -% \definefilefallback [lang-deo.pat] [dehypht.tex] - -% \definefilesynonym [lang-af.pat] [lang-nl.pat] -% \definefilesynonym [lang-en.pat] [lang-us.pat] -% \definefilesynonym [lang-en.hyp] [lang-us.hyp] - -\protect \endinput diff --git a/tex/context/base/lang-ini.mkii b/tex/context/base/lang-ini.mkii index e5759bc84..a55748a78 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} +\fetchruntimecommand \showpatterns {\f!languageprefix\s!run.mkii} %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-ini.mkiv b/tex/context/base/lang-ini.mkiv index 7cb945ef9..f88281a60 100644 --- a/tex/context/base/lang-ini.mkiv +++ b/tex/context/base/lang-ini.mkiv @@ -76,14 +76,18 @@ \def\setupcurrentlanguage[#1]{\setcurrentlanguage\currentmainlanguage{#1}} \def\setcurrentlanguage#1#2% sets modes: **id (currentmain) *id (current) - {\doifsomething{#1} - {\ifx\currentmainlanguage\empty\else\resetsystemmode{\systemmodeprefix\currentmainlanguage}\fi - \edef\currentmainlanguage{#1}% - \setsystemmode{\systemmodeprefix\currentmainlanguage}}% - \doifsomething{#2} - {\ifx\currentlanguage\empty\else\resetsystemmode\currentlanguage\fi - \edef\currentlanguage{#2}% - \setsystemmode\currentlanguage}} + {\edef\xaskedlanguage{#1}% otherwise clash with \askedlanguage + \ifx\xaskedlanguage\empty \else + \ifx\currentmainlanguage\empty\else\resetsystemmode{\systemmodeprefix\currentmainlanguage}\fi + \let\currentmainlanguage\xaskedlanguage + \setsystemmode{\systemmodeprefix\currentmainlanguage}% + \fi + \edef\xaskedlanguage{#2}% + \ifx\xaskedlanguage\empty \else + \ifx\currentlanguage\empty\else\resetsystemmode\currentlanguage\fi + \let\currentlanguage\xaskedlanguage + \setsystemmode\currentlanguage + \fi} %D The internal macros will be defined later. @@ -120,9 +124,9 @@ %D preloaded format). \def\dodoinstalllanguage#1#2% #2 added - {\doifundefined{#1}{\setvalue{#1}{\complexlanguage[#2]}}% - \expanded{\noexpand\uppercase{\noexpand\edef\noexpand\ascii{#1}}}% - \doifundefined\ascii{\setvalue\ascii{\complexlanguage[#2]}}} + {\expanded{\noexpand\uppercase{\noexpand\edef\noexpand\ascii{#1}}}% + \ifcsname #1\endcsname\else\setvalue {#1}{\complexlanguage[#2]}\fi + \ifcsname\ascii\endcsname\else\setvalue\ascii{\complexlanguage[#2]}\fi} %D \macros %D {preloadlanguages} @@ -145,11 +149,6 @@ "\truefilename{\f!languageprefix#2.\f!hyphensextension }") }} -% \def\doloadlanguagefiles#1% -% {\doifelsevaluenothing{\??la#1\s!patterns} -% {\doloadpatterns{#1}{#1}} -% {\doloadpatterns{#1}{\getvalue{\??la#1\s!patterns}}}} - \def\doloadlanguagefiles#1% {\edef\languagesuffix{\specificlanguageparameter{#1}\s!patterns}% \ifx\languagesuffix\empty @@ -318,9 +317,6 @@ \newtoks \everylanguage -\def\disablelanguagespecifics - {\ignorecompoundcharacter} - \def\sethyphenationvariables {\lefthyphenmin 0\languageparameter\s!lefthyphenmin \relax \righthyphenmin0\languageparameter\s!righthyphenmin\relax @@ -331,21 +327,14 @@ {\edef\currentdefaultlanguage{\defaultlanguage\currentlanguage}% \setnormallanguage\currentlanguage\currentdefaultlanguage \the\everylanguage - \enablelanguagespecifics[\currentlanguage]% \sethyphenationvariables \relax % will be definable and move to core-spa ! \doifelse{\languageparameter\c!spacing}\v!broad\nonfrenchspacing\frenchspacing} -\ifx\enablelanguagespecifics\undefined \def\enablelanguagespecifics[#1]{} \fi - % The following may be a solution for the fact that one cannot % change catcodes of characters like : and ; inside an environment. -\appendtoks - \enablelanguagespecifics[\currentlanguage]% -\to \everystarttext - \def\complexlanguage[#1]% {\edef\askedlanguage{#1}% \ifx\askedlanguage\empty \else @@ -586,4 +575,6 @@ \uchyph=1 +\exhyphenchar=45 % to permit breaking at explicit hyphens + \protect \endinput diff --git a/tex/context/base/lang-ita.tex b/tex/context/base/lang-ita.tex index ae3b7a514..c714be775 100644 --- a/tex/context/base/lang-ita.tex +++ b/tex/context/base/lang-ita.tex @@ -478,12 +478,18 @@ %D Rather new \unknown -\setuplabeltext [\s!it] [\v!page=pagina ] -\setuplabeltext [\s!it] [\v!atpage=a pagina ] +\setuplabeltext [\s!it] [\v!page=pagina ] +\setuplabeltext [\s!it] [\v!atpage=a pagina ] \setuplabeltext [\s!it] [\v!hencefore=come mostrato sopra] \setuplabeltext [\s!it] [\v!hereafter=come mostrato sotto] \setuplabeltext [\s!it] [\v!see=cf. ] +\setuplabeltext [\s!fr] [\v!page=page ] +\setuplabeltext [\s!fr] [\v!atpage=à la page ] +\setuplabeltext [\s!fr] [\v!hencefore=ci-dessus] +\setuplabeltext [\s!fr] [\v!hereafter=ci-dessous] +\setuplabeltext [\s!fr] [\v!see=cf. ] + %D Ordinal converters: \def\frordinaldaynumber#1% date is masculine diff --git a/tex/context/base/lang-jap.mkii b/tex/context/base/lang-jap.mkii new file mode 100644 index 000000000..05c9b1d41 --- /dev/null +++ b/tex/context/base/lang-jap.mkii @@ -0,0 +1,234 @@ +%D \module +%D [ file=lang-jap, +%D version=2006.01.13, +%D title=\CONTEXT\ Language Macros, +%D subtitle=Japanese, +%D author={Richard Gabriel}, +%D date=\currentdate, +%D copyright={PRAGMA / RG}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% rgabriel@kerio.com + +\writestatus{loading}{ConTeXt Language Macros / Japanese} + +\unprotect + +\definesystemconstant {japanese} \definesystemconstant {ja} + +\installlanguage + [\s!ja] + [\c!leftsentence=\jaencoding\jaleftsentence, + \c!rightsentence=\jaencoding\jarightsentence, + \c!leftsubsentence=\jaencoding\jaleftsubsentence, + \c!rightsubsentence=\jaencoding\jarightsubsentence, + \c!leftquote=\jaencoding\jaencodedsinglestartquote, + \c!rightquote=\jaencoding\jaencodedsingleendquote, + \c!leftquotation=\jaencoding\jaencodedstartquote, + \c!rightquotation=\jaencoding\jaencodedendquote, + \c!date={\jaencodedchristiandate,\v!year,\jaencodedyear,\v!month,\jaencodedmonth,\v!day,\jaencodedday}] + +\setupheadtext [\s!ja] [\v!content={\jaencoding\jaencodedtableofcontents}] +\setupheadtext [\s!ja] [\v!tables={\jaencoding\jaencodedtables}] +\setupheadtext [\s!ja] [\v!figures={\jaencoding\jaencodedfigures}] +\setupheadtext [\s!ja] [\v!graphics={\jaencoding\jaencodedgraphics}] +\setupheadtext [\s!ja] [\v!intermezzi={\jaencoding\jaencodedintermezzos}] +\setupheadtext [\s!ja] [\v!index={\jaencoding\jaencodedindex}] +\setupheadtext [\s!ja] [\v!abbreviations={\jaencoding\jaencodedabbreviations}] +\setupheadtext [\s!ja] [\v!logos={\jaencoding\jaencodedlogos}] +\setupheadtext [\s!ja] [\v!units={\jaencoding\jaencodedunits}] + +\setuplabeltext [\s!ja] [\v!table={\jaencoding\jaencodedtable}] +\setuplabeltext [\s!ja] [\v!figure={\jaencoding\jaencodedfigure}] +\setuplabeltext [\s!ja] [\v!intermezzo={\jaencoding\jaencodedintermezzo}] +\setuplabeltext [\s!ja] [\v!graphic={\jaencoding\jaencodedillustration}] +\setuplabeltext [\s!ja] [\v!appendix={\jaencoding\jaencodedappendix}] +\setuplabeltext [\s!ja] [\v!part={\jaencoding\jaencodedintro,\jaencoding\jaencodedpart}] +\setuplabeltext [\s!ja] [\v!chapter={\jaencoding\jaencodedintro,\jaencoding\jaencodedchapter}] +\setuplabeltext [\s!ja] [\v!section={\jaencoding\jaencodedintro,\jaencoding\jaencodedsection}] +\setuplabeltext [\s!ja] [\v!line={\jaencoding\jaencodedline}] +\setuplabeltext [\s!ja] [\v!lines={\jaencoding\jaencodedline}] + +\setuplabeltext [\s!ja] [\v!subsection=] +\setuplabeltext [\s!ja] [\v!subsubsection=] +\setuplabeltext [\s!ja] [\v!subsubsubsection=] + +%D Why are these languagespecifics ? + +\setuplabeltext [\s!ja] [\v!january=1] +\setuplabeltext [\s!ja] [\v!february=2] +\setuplabeltext [\s!ja] [\v!march=3] +\setuplabeltext [\s!ja] [\v!april=4] +\setuplabeltext [\s!ja] [\v!may=5] +\setuplabeltext [\s!ja] [\v!june=6] +\setuplabeltext [\s!ja] [\v!july=7] +\setuplabeltext [\s!ja] [\v!august=8] +\setuplabeltext [\s!ja] [\v!september=9] +\setuplabeltext [\s!ja] [\v!october=10] +\setuplabeltext [\s!ja] [\v!november=11] +\setuplabeltext [\s!ja] [\v!december=12] + +\setuplabeltext [\s!ja] [\v!sunday=\jaencoding\jaencodedsunday ] +\setuplabeltext [\s!ja] [\v!monday=\jaencoding\jaencodedmonday ] +\setuplabeltext [\s!ja] [\v!tuesday=\jaencoding\jaencodedtuesday ] +\setuplabeltext [\s!ja] [\v!wednesday=\jaencoding\jaencodedwednesday] +\setuplabeltext [\s!ja] [\v!thursday=\jaencoding\jaencodedthursday ] +\setuplabeltext [\s!ja] [\v!friday=\jaencoding\jaencodedfriday ] +\setuplabeltext [\s!ja] [\v!saturday=\jaencoding\jaencodedsaturday ] + +% Hardcoded - \japaneseencoding should be defined similarly to \chineseencoding + +\unexpanded\def\jaencoding{\enableencoding[cjk-uni]} + +%D This list is taken from DocBook XSL stylesheets (http://docbook.sourceforge.net/). + +\startencoding[cjk-uni] + + \definecommand jaencodedabstract {\uchar{105}{130}\uchar{137}{129}} + \definecommand jaencodedand {\uchar{48}{1}} + \definecommand jaencodedanswer {\uchar{123}{84}\uchar{255}{26}} + \definecommand jaencodedappendix {\uchar{78}{216}\uchar{147}{50}} + \definecommand jaencodedarticle {\uchar{152}{5}\uchar{118}{238}} + \definecommand jaencodedbibliography {\uchar{83}{194}\uchar{128}{3}\uchar{101}{135}\uchar{115}{46}} + \definecommand jaencodedbook {\uchar{48}{214}\uchar{48}{195}\uchar{48}{175}} + \definecommand jaencodedbridgehead {\uchar{152}{5}} + \definecommand jaencodedbullet {\uchar{37}{207}} + \definecommand jaencodedby {\uchar{255}{26}} + \definecommand jaencodedcaution {\uchar{108}{232}\uchar{97}{15}} + \definecommand jaencodedcolophon {\uchar{89}{101}\uchar{78}{216}} + \definecommand jaencodedcopyright {\uchar{136}{253}\uchar{79}{92}\uchar{132}{87}\uchar{79}{92}} + \definecommand jaencodeddedication {\uchar{139}{29}\uchar{143}{158}} + \definecommand jaencodededited {\uchar{125}{232}\uchar{128}{5}} + \definecommand jaencodededitedby {\uchar{125}{232}\uchar{128}{5}\uchar{255}{26}} + \definecommand jaencodededition {\uchar{125}{232}\uchar{150}{198}} + \definecommand jaencodedendquote {\uchar{48}{13}} + \definecommand jaencodedequation {\uchar{95}{15}} + \definecommand jaencodedexample {\uchar{79}{139}} + \definecommand jaencodedfigure {\uchar{86}{243}} + \definecommand jaencodedglossary {\uchar{117}{40}\uchar{138}{158}\uchar{150}{198}} + \definecommand jaencodedglosssee {\uchar{83}{194}\uchar{113}{103}} + \definecommand jaencodedglossseealso {\uchar{83}{194}\uchar{113}{103}} + \definecommand jaencodedchapter {\uchar{122}{224}} + \definecommand jaencodedimportant {\uchar{145}{205}\uchar{137}{129}\uchar{152}{5}\uchar{118}{238}} + \definecommand jaencodedindex {\uchar{118}{238}\uchar{107}{33}} + \definecommand jaencodedindexsymbols {\uchar{48}{183}\uchar{48}{243}\uchar{48}{220}\uchar{48}{235}} + \definecommand jaencodedintro {\uchar{123}{44}} + \definecommand jaencodedlistofequations {\uchar{95}{15}\uchar{118}{238}\uchar{107}{33}} + \definecommand jaencodedlistofexamples {\uchar{79}{139}\uchar{118}{238}\uchar{107}{33}} + \definecommand jaencodedlistoffigures {\uchar{86}{243}\uchar{118}{238}\uchar{107}{33}} + \definecommand jaencodedlistoftables {\uchar{136}{104}\uchar{118}{238}\uchar{107}{33}} + \definecommand jaencodedlistofunknown {\uchar{78}{13}\uchar{102}{14}\uchar{118}{238}\uchar{107}{33}} + \definecommand jaencodedmsgaud {\uchar{91}{254}\uchar{140}{97}\uchar{128}{5}} + \definecommand jaencodedmsglevel {\uchar{48}{236}\uchar{48}{217}\uchar{48}{235}} + \definecommand jaencodedmsgorig {\uchar{118}{122}\uchar{79}{225}\uchar{81}{67}} + \definecommand jaencodednavhome {\uchar{48}{219}\uchar{48}{252}\uchar{48}{224}} + \definecommand jaencodednavnext {\uchar{107}{33}\uchar{48}{110}\uchar{48}{218}\uchar{48}{252}\uchar{48}{184}} + \definecommand jaencodednavnextsibling {\uchar{101}{233}\uchar{144}{1}\uchar{48}{138}} + \definecommand jaencodednavprev {\uchar{82}{77}\uchar{48}{110}\uchar{48}{218}\uchar{48}{252}\uchar{48}{184}} + \definecommand jaencodednavprevsibling {\uchar{93}{251}\uchar{98}{59}\uchar{48}{87}} + \definecommand jaencodednavup {\uchar{78}{10}\uchar{48}{107}\uchar{98}{59}\uchar{48}{139}} + \definecommand jaencodednestedendquote {\uchar{48}{15}} + \definecommand jaencodednestedstartquote {\uchar{48}{14}} + \definecommand jaencodednonexistantelement {\uchar{137}{129}\uchar{125}{32}\uchar{48}{76}\uchar{91}{88}\uchar{87}{40}\uchar{48}{87}\uchar{48}{126}\uchar{48}{91}\uchar{48}{147}} + \definecommand jaencodednote {\uchar{108}{232}\uchar{97}{15}} + \definecommand jaencodednotes {\uchar{108}{232}\uchar{97}{15}} + \definecommand jaencodedpages {\uchar{80}{103}\uchar{115}{46}} + \definecommand jaencodedpart {\uchar{48}{209}\uchar{48}{252}\uchar{48}{200}} + \definecommand jaencodedpreface {\uchar{94}{143}\uchar{101}{135}} + \definecommand jaencodedprocedure {\uchar{98}{75}\uchar{152}{6}} + \definecommand jaencodedprocedureformal {\uchar{98}{75}\uchar{152}{6}} + \definecommand jaencodedproductionset {\uchar{48}{215}\uchar{48}{237}\uchar{48}{192}\uchar{48}{175}\uchar{48}{183}\uchar{48}{231}\uchar{48}{243}} + \definecommand jaencodedproductionsetformal {\uchar{48}{215}\uchar{48}{237}\uchar{48}{192}\uchar{48}{175}\uchar{48}{183}\uchar{48}{231}\uchar{48}{243}} + \definecommand jaencodedpublished {\uchar{118}{122}\uchar{136}{76}} + \definecommand jaencodedqandadiv {\uchar{85}{79}\uchar{255}{26}\uchar{48}{1}\uchar{123}{84}\uchar{255}{26}} + \definecommand jaencodedqandaentry {\uchar{85}{79}\uchar{255}{26}} + \definecommand jaencodedquestion {\uchar{85}{79}\uchar{255}{26}} + \definecommand jaencodedreference {\uchar{83}{194}\uchar{113}{103}} + \definecommand jaencodedrefname {\uchar{84}{13}\uchar{82}{77}} + \definecommand jaencodedrefsection {\uchar{152}{5}} + \definecommand jaencodedrefsynopsisdiv {\uchar{105}{130}\uchar{137}{129}} + \definecommand jaencodedrevhistory {\uchar{101}{57}\uchar{138}{2}\uchar{92}{101}\uchar{107}{116}} + \definecommand jaencodedrevision {\uchar{101}{57}\uchar{138}{2}} + \definecommand jaencodedsection {\uchar{152}{5}} + \definecommand jaencodedsee {\uchar{83}{194}\uchar{113}{103}} + \definecommand jaencodedseealso {\uchar{83}{194}\uchar{113}{103}} + \definecommand jaencodedseparator {\uchar{48}{1}} + \definecommand jaencodedset {\uchar{138}{45}\uchar{91}{154}} + \definecommand jaencodedsetindex {\uchar{118}{238}\uchar{107}{33}\uchar{138}{45}\uchar{91}{154}} + \definecommand jaencodedsidebar {\uchar{48}{181}\uchar{48}{164}\uchar{48}{201}\uchar{48}{208}\uchar{48}{252}} + \definecommand jaencodedsimplesect {\uchar{152}{5}} + \definecommand jaencodedsingleendquote {\uchar{32}{25}} + \definecommand jaencodedsinglestartquote {\uchar{32}{24}} + \definecommand jaencodedstartquote {\uchar{48}{12}} + \definecommand jaencodedstep {\uchar{48}{185}\uchar{48}{198}\uchar{48}{195}\uchar{48}{215}} + \definecommand jaencodedtable {\uchar{136}{104}} + \definecommand jaencodedtablenotes {\uchar{108}{232}\uchar{97}{15}} + \definecommand jaencodedtableofcontents {\uchar{118}{238}\uchar{107}{33}} + \definecommand jaencodedtip {\uchar{48}{198}\uchar{48}{163}\uchar{48}{195}\uchar{48}{215}} + \definecommand jaencodedunexpectedelementname {\uchar{78}{13}\uchar{102}{14}\uchar{48}{106}\uchar{137}{129}\uchar{125}{32}\uchar{84}{13}} + \definecommand jaencodedunsupported {\uchar{48}{181}\uchar{48}{221}\uchar{48}{252}\uchar{48}{200}\uchar{48}{87}\uchar{48}{126}\uchar{48}{91}\uchar{48}{147}} + \definecommand jaencodedwarning {\uchar{139}{102}\uchar{84}{74}} + + \definecommand jaencodedyear {\uchar{94}{116}} + \definecommand jaencodedmonth {\uchar{103}{8}} + \definecommand jaencodedday {\uchar{101}{229}} + +\stopencoding + +%D Taken from Chinese (will be investigated yet...) + +\startencoding[cjk-uni] + + \definecommand jaencodedleftsentence {\uchar{32}{20}\uchar{32}{20}} + \definecommand jaencodedrightsentence {\uchar{32}{20}\uchar{32}{20}} + \definecommand jaencodedleftsubsentence {\uchar{32}{20}\uchar{32}{20}} + \definecommand jaencodedrightsubsentence {\uchar{32}{20}\uchar{32}{20}} + +\stopencoding + +%D Special thanxx to Eizo Tsuchihashi (eizo@arcbrain.jp) for the following stuff + +\startencoding[cjk-uni] + + \definecommand jaencodedchristiandate {\uchar{137}{127}\uchar{102}{166}} + + \definecommand jaencodedtables {\uchar{103}{58}} + \definecommand jaencodedfigures {\uchar{86}{243}} + \definecommand jaencodedabbreviations {\uchar{117}{101}\uchar{138}{158}} + \definecommand jaencodedlogos {\uchar{116}{6}\uchar{96}{39}} + \definecommand jaencodedunits {\uchar{48}{230}\uchar{48}{203}\uchar{48}{195}\uchar{48}{196}} + + \definecommand jaencodedgraphics {\uchar{48}{176}\uchar{48}{233}\uchar{48}{213}} + \definecommand jaencodedintermezzo {\uchar{149}{147}\uchar{89}{79}\uchar{102}{242}} + \definecommand jaencodedintermezzos {\uchar{149}{147}\uchar{89}{79}\uchar{102}{242}} + \definecommand jaencodedillustration {\uchar{48}{164}\uchar{48}{233}\uchar{48}{185}\uchar{48}{200}} + \definecommand jaencodedline {\uchar{125}{218}} + \definecommand jaencodedlines {\uchar{125}{218}} + + \definecommand jaencodedjanuary {\uchar{78}{0}\uchar{103}{8}} + \definecommand jaencodedfebruary {\uchar{78}{140}\uchar{103}{8}} + \definecommand jaencodedmarch {\uchar{78}{9}\uchar{103}{8}} + \definecommand jaencodedapril {\uchar{86}{219}\uchar{103}{8}} + \definecommand jaencodedmay {\uchar{78}{148}\uchar{103}{8}} + \definecommand jaencodedjune {\uchar{81}{109}\uchar{103}{8}} + \definecommand jaencodedjuly {\uchar{78}{3}\uchar{103}{8}} + \definecommand jaencodedaugust {\uchar{81}{107}\uchar{103}{8}} + \definecommand jaencodedseptember {\uchar{78}{93}\uchar{103}{8}} + \definecommand jaencodedoctober {\uchar{83}{65}\uchar{103}{8}} + \definecommand jaencodednovember {\uchar{83}{65}\uchar{78}{0}\uchar{103}{8}} + \definecommand jaencodeddecember {\uchar{83}{65}\uchar{78}{140}\uchar{103}{8}} + + \definecommand jaencodedsunday {\uchar{103}{8}\uchar{102}{220}\uchar{101}{229}} + \definecommand jaencodedmonday {\uchar{112}{107}\uchar{102}{220}\uchar{101}{229}} + \definecommand jaencodedtuesday {\uchar{108}{52}\uchar{102}{220}\uchar{101}{229}} + \definecommand jaencodedwednesday {\uchar{103}{40}\uchar{102}{220}\uchar{101}{229}} + \definecommand jaencodedthursday {\uchar{145}{209}\uchar{102}{220}\uchar{101}{229}} + \definecommand jaencodedfriday {\uchar{87}{31}\uchar{102}{220}\uchar{101}{229}} + \definecommand jaencodedsaturday {\uchar{101}{229}\uchar{102}{220}\uchar{101}{229}} + +\stopencoding + +\protect \endinput diff --git a/tex/context/base/lang-jap.tex b/tex/context/base/lang-jap.tex deleted file mode 100644 index 05c9b1d41..000000000 --- a/tex/context/base/lang-jap.tex +++ /dev/null @@ -1,234 +0,0 @@ -%D \module -%D [ file=lang-jap, -%D version=2006.01.13, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Japanese, -%D author={Richard Gabriel}, -%D date=\currentdate, -%D copyright={PRAGMA / RG}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% rgabriel@kerio.com - -\writestatus{loading}{ConTeXt Language Macros / Japanese} - -\unprotect - -\definesystemconstant {japanese} \definesystemconstant {ja} - -\installlanguage - [\s!ja] - [\c!leftsentence=\jaencoding\jaleftsentence, - \c!rightsentence=\jaencoding\jarightsentence, - \c!leftsubsentence=\jaencoding\jaleftsubsentence, - \c!rightsubsentence=\jaencoding\jarightsubsentence, - \c!leftquote=\jaencoding\jaencodedsinglestartquote, - \c!rightquote=\jaencoding\jaencodedsingleendquote, - \c!leftquotation=\jaencoding\jaencodedstartquote, - \c!rightquotation=\jaencoding\jaencodedendquote, - \c!date={\jaencodedchristiandate,\v!year,\jaencodedyear,\v!month,\jaencodedmonth,\v!day,\jaencodedday}] - -\setupheadtext [\s!ja] [\v!content={\jaencoding\jaencodedtableofcontents}] -\setupheadtext [\s!ja] [\v!tables={\jaencoding\jaencodedtables}] -\setupheadtext [\s!ja] [\v!figures={\jaencoding\jaencodedfigures}] -\setupheadtext [\s!ja] [\v!graphics={\jaencoding\jaencodedgraphics}] -\setupheadtext [\s!ja] [\v!intermezzi={\jaencoding\jaencodedintermezzos}] -\setupheadtext [\s!ja] [\v!index={\jaencoding\jaencodedindex}] -\setupheadtext [\s!ja] [\v!abbreviations={\jaencoding\jaencodedabbreviations}] -\setupheadtext [\s!ja] [\v!logos={\jaencoding\jaencodedlogos}] -\setupheadtext [\s!ja] [\v!units={\jaencoding\jaencodedunits}] - -\setuplabeltext [\s!ja] [\v!table={\jaencoding\jaencodedtable}] -\setuplabeltext [\s!ja] [\v!figure={\jaencoding\jaencodedfigure}] -\setuplabeltext [\s!ja] [\v!intermezzo={\jaencoding\jaencodedintermezzo}] -\setuplabeltext [\s!ja] [\v!graphic={\jaencoding\jaencodedillustration}] -\setuplabeltext [\s!ja] [\v!appendix={\jaencoding\jaencodedappendix}] -\setuplabeltext [\s!ja] [\v!part={\jaencoding\jaencodedintro,\jaencoding\jaencodedpart}] -\setuplabeltext [\s!ja] [\v!chapter={\jaencoding\jaencodedintro,\jaencoding\jaencodedchapter}] -\setuplabeltext [\s!ja] [\v!section={\jaencoding\jaencodedintro,\jaencoding\jaencodedsection}] -\setuplabeltext [\s!ja] [\v!line={\jaencoding\jaencodedline}] -\setuplabeltext [\s!ja] [\v!lines={\jaencoding\jaencodedline}] - -\setuplabeltext [\s!ja] [\v!subsection=] -\setuplabeltext [\s!ja] [\v!subsubsection=] -\setuplabeltext [\s!ja] [\v!subsubsubsection=] - -%D Why are these languagespecifics ? - -\setuplabeltext [\s!ja] [\v!january=1] -\setuplabeltext [\s!ja] [\v!february=2] -\setuplabeltext [\s!ja] [\v!march=3] -\setuplabeltext [\s!ja] [\v!april=4] -\setuplabeltext [\s!ja] [\v!may=5] -\setuplabeltext [\s!ja] [\v!june=6] -\setuplabeltext [\s!ja] [\v!july=7] -\setuplabeltext [\s!ja] [\v!august=8] -\setuplabeltext [\s!ja] [\v!september=9] -\setuplabeltext [\s!ja] [\v!october=10] -\setuplabeltext [\s!ja] [\v!november=11] -\setuplabeltext [\s!ja] [\v!december=12] - -\setuplabeltext [\s!ja] [\v!sunday=\jaencoding\jaencodedsunday ] -\setuplabeltext [\s!ja] [\v!monday=\jaencoding\jaencodedmonday ] -\setuplabeltext [\s!ja] [\v!tuesday=\jaencoding\jaencodedtuesday ] -\setuplabeltext [\s!ja] [\v!wednesday=\jaencoding\jaencodedwednesday] -\setuplabeltext [\s!ja] [\v!thursday=\jaencoding\jaencodedthursday ] -\setuplabeltext [\s!ja] [\v!friday=\jaencoding\jaencodedfriday ] -\setuplabeltext [\s!ja] [\v!saturday=\jaencoding\jaencodedsaturday ] - -% Hardcoded - \japaneseencoding should be defined similarly to \chineseencoding - -\unexpanded\def\jaencoding{\enableencoding[cjk-uni]} - -%D This list is taken from DocBook XSL stylesheets (http://docbook.sourceforge.net/). - -\startencoding[cjk-uni] - - \definecommand jaencodedabstract {\uchar{105}{130}\uchar{137}{129}} - \definecommand jaencodedand {\uchar{48}{1}} - \definecommand jaencodedanswer {\uchar{123}{84}\uchar{255}{26}} - \definecommand jaencodedappendix {\uchar{78}{216}\uchar{147}{50}} - \definecommand jaencodedarticle {\uchar{152}{5}\uchar{118}{238}} - \definecommand jaencodedbibliography {\uchar{83}{194}\uchar{128}{3}\uchar{101}{135}\uchar{115}{46}} - \definecommand jaencodedbook {\uchar{48}{214}\uchar{48}{195}\uchar{48}{175}} - \definecommand jaencodedbridgehead {\uchar{152}{5}} - \definecommand jaencodedbullet {\uchar{37}{207}} - \definecommand jaencodedby {\uchar{255}{26}} - \definecommand jaencodedcaution {\uchar{108}{232}\uchar{97}{15}} - \definecommand jaencodedcolophon {\uchar{89}{101}\uchar{78}{216}} - \definecommand jaencodedcopyright {\uchar{136}{253}\uchar{79}{92}\uchar{132}{87}\uchar{79}{92}} - \definecommand jaencodeddedication {\uchar{139}{29}\uchar{143}{158}} - \definecommand jaencodededited {\uchar{125}{232}\uchar{128}{5}} - \definecommand jaencodededitedby {\uchar{125}{232}\uchar{128}{5}\uchar{255}{26}} - \definecommand jaencodededition {\uchar{125}{232}\uchar{150}{198}} - \definecommand jaencodedendquote {\uchar{48}{13}} - \definecommand jaencodedequation {\uchar{95}{15}} - \definecommand jaencodedexample {\uchar{79}{139}} - \definecommand jaencodedfigure {\uchar{86}{243}} - \definecommand jaencodedglossary {\uchar{117}{40}\uchar{138}{158}\uchar{150}{198}} - \definecommand jaencodedglosssee {\uchar{83}{194}\uchar{113}{103}} - \definecommand jaencodedglossseealso {\uchar{83}{194}\uchar{113}{103}} - \definecommand jaencodedchapter {\uchar{122}{224}} - \definecommand jaencodedimportant {\uchar{145}{205}\uchar{137}{129}\uchar{152}{5}\uchar{118}{238}} - \definecommand jaencodedindex {\uchar{118}{238}\uchar{107}{33}} - \definecommand jaencodedindexsymbols {\uchar{48}{183}\uchar{48}{243}\uchar{48}{220}\uchar{48}{235}} - \definecommand jaencodedintro {\uchar{123}{44}} - \definecommand jaencodedlistofequations {\uchar{95}{15}\uchar{118}{238}\uchar{107}{33}} - \definecommand jaencodedlistofexamples {\uchar{79}{139}\uchar{118}{238}\uchar{107}{33}} - \definecommand jaencodedlistoffigures {\uchar{86}{243}\uchar{118}{238}\uchar{107}{33}} - \definecommand jaencodedlistoftables {\uchar{136}{104}\uchar{118}{238}\uchar{107}{33}} - \definecommand jaencodedlistofunknown {\uchar{78}{13}\uchar{102}{14}\uchar{118}{238}\uchar{107}{33}} - \definecommand jaencodedmsgaud {\uchar{91}{254}\uchar{140}{97}\uchar{128}{5}} - \definecommand jaencodedmsglevel {\uchar{48}{236}\uchar{48}{217}\uchar{48}{235}} - \definecommand jaencodedmsgorig {\uchar{118}{122}\uchar{79}{225}\uchar{81}{67}} - \definecommand jaencodednavhome {\uchar{48}{219}\uchar{48}{252}\uchar{48}{224}} - \definecommand jaencodednavnext {\uchar{107}{33}\uchar{48}{110}\uchar{48}{218}\uchar{48}{252}\uchar{48}{184}} - \definecommand jaencodednavnextsibling {\uchar{101}{233}\uchar{144}{1}\uchar{48}{138}} - \definecommand jaencodednavprev {\uchar{82}{77}\uchar{48}{110}\uchar{48}{218}\uchar{48}{252}\uchar{48}{184}} - \definecommand jaencodednavprevsibling {\uchar{93}{251}\uchar{98}{59}\uchar{48}{87}} - \definecommand jaencodednavup {\uchar{78}{10}\uchar{48}{107}\uchar{98}{59}\uchar{48}{139}} - \definecommand jaencodednestedendquote {\uchar{48}{15}} - \definecommand jaencodednestedstartquote {\uchar{48}{14}} - \definecommand jaencodednonexistantelement {\uchar{137}{129}\uchar{125}{32}\uchar{48}{76}\uchar{91}{88}\uchar{87}{40}\uchar{48}{87}\uchar{48}{126}\uchar{48}{91}\uchar{48}{147}} - \definecommand jaencodednote {\uchar{108}{232}\uchar{97}{15}} - \definecommand jaencodednotes {\uchar{108}{232}\uchar{97}{15}} - \definecommand jaencodedpages {\uchar{80}{103}\uchar{115}{46}} - \definecommand jaencodedpart {\uchar{48}{209}\uchar{48}{252}\uchar{48}{200}} - \definecommand jaencodedpreface {\uchar{94}{143}\uchar{101}{135}} - \definecommand jaencodedprocedure {\uchar{98}{75}\uchar{152}{6}} - \definecommand jaencodedprocedureformal {\uchar{98}{75}\uchar{152}{6}} - \definecommand jaencodedproductionset {\uchar{48}{215}\uchar{48}{237}\uchar{48}{192}\uchar{48}{175}\uchar{48}{183}\uchar{48}{231}\uchar{48}{243}} - \definecommand jaencodedproductionsetformal {\uchar{48}{215}\uchar{48}{237}\uchar{48}{192}\uchar{48}{175}\uchar{48}{183}\uchar{48}{231}\uchar{48}{243}} - \definecommand jaencodedpublished {\uchar{118}{122}\uchar{136}{76}} - \definecommand jaencodedqandadiv {\uchar{85}{79}\uchar{255}{26}\uchar{48}{1}\uchar{123}{84}\uchar{255}{26}} - \definecommand jaencodedqandaentry {\uchar{85}{79}\uchar{255}{26}} - \definecommand jaencodedquestion {\uchar{85}{79}\uchar{255}{26}} - \definecommand jaencodedreference {\uchar{83}{194}\uchar{113}{103}} - \definecommand jaencodedrefname {\uchar{84}{13}\uchar{82}{77}} - \definecommand jaencodedrefsection {\uchar{152}{5}} - \definecommand jaencodedrefsynopsisdiv {\uchar{105}{130}\uchar{137}{129}} - \definecommand jaencodedrevhistory {\uchar{101}{57}\uchar{138}{2}\uchar{92}{101}\uchar{107}{116}} - \definecommand jaencodedrevision {\uchar{101}{57}\uchar{138}{2}} - \definecommand jaencodedsection {\uchar{152}{5}} - \definecommand jaencodedsee {\uchar{83}{194}\uchar{113}{103}} - \definecommand jaencodedseealso {\uchar{83}{194}\uchar{113}{103}} - \definecommand jaencodedseparator {\uchar{48}{1}} - \definecommand jaencodedset {\uchar{138}{45}\uchar{91}{154}} - \definecommand jaencodedsetindex {\uchar{118}{238}\uchar{107}{33}\uchar{138}{45}\uchar{91}{154}} - \definecommand jaencodedsidebar {\uchar{48}{181}\uchar{48}{164}\uchar{48}{201}\uchar{48}{208}\uchar{48}{252}} - \definecommand jaencodedsimplesect {\uchar{152}{5}} - \definecommand jaencodedsingleendquote {\uchar{32}{25}} - \definecommand jaencodedsinglestartquote {\uchar{32}{24}} - \definecommand jaencodedstartquote {\uchar{48}{12}} - \definecommand jaencodedstep {\uchar{48}{185}\uchar{48}{198}\uchar{48}{195}\uchar{48}{215}} - \definecommand jaencodedtable {\uchar{136}{104}} - \definecommand jaencodedtablenotes {\uchar{108}{232}\uchar{97}{15}} - \definecommand jaencodedtableofcontents {\uchar{118}{238}\uchar{107}{33}} - \definecommand jaencodedtip {\uchar{48}{198}\uchar{48}{163}\uchar{48}{195}\uchar{48}{215}} - \definecommand jaencodedunexpectedelementname {\uchar{78}{13}\uchar{102}{14}\uchar{48}{106}\uchar{137}{129}\uchar{125}{32}\uchar{84}{13}} - \definecommand jaencodedunsupported {\uchar{48}{181}\uchar{48}{221}\uchar{48}{252}\uchar{48}{200}\uchar{48}{87}\uchar{48}{126}\uchar{48}{91}\uchar{48}{147}} - \definecommand jaencodedwarning {\uchar{139}{102}\uchar{84}{74}} - - \definecommand jaencodedyear {\uchar{94}{116}} - \definecommand jaencodedmonth {\uchar{103}{8}} - \definecommand jaencodedday {\uchar{101}{229}} - -\stopencoding - -%D Taken from Chinese (will be investigated yet...) - -\startencoding[cjk-uni] - - \definecommand jaencodedleftsentence {\uchar{32}{20}\uchar{32}{20}} - \definecommand jaencodedrightsentence {\uchar{32}{20}\uchar{32}{20}} - \definecommand jaencodedleftsubsentence {\uchar{32}{20}\uchar{32}{20}} - \definecommand jaencodedrightsubsentence {\uchar{32}{20}\uchar{32}{20}} - -\stopencoding - -%D Special thanxx to Eizo Tsuchihashi (eizo@arcbrain.jp) for the following stuff - -\startencoding[cjk-uni] - - \definecommand jaencodedchristiandate {\uchar{137}{127}\uchar{102}{166}} - - \definecommand jaencodedtables {\uchar{103}{58}} - \definecommand jaencodedfigures {\uchar{86}{243}} - \definecommand jaencodedabbreviations {\uchar{117}{101}\uchar{138}{158}} - \definecommand jaencodedlogos {\uchar{116}{6}\uchar{96}{39}} - \definecommand jaencodedunits {\uchar{48}{230}\uchar{48}{203}\uchar{48}{195}\uchar{48}{196}} - - \definecommand jaencodedgraphics {\uchar{48}{176}\uchar{48}{233}\uchar{48}{213}} - \definecommand jaencodedintermezzo {\uchar{149}{147}\uchar{89}{79}\uchar{102}{242}} - \definecommand jaencodedintermezzos {\uchar{149}{147}\uchar{89}{79}\uchar{102}{242}} - \definecommand jaencodedillustration {\uchar{48}{164}\uchar{48}{233}\uchar{48}{185}\uchar{48}{200}} - \definecommand jaencodedline {\uchar{125}{218}} - \definecommand jaencodedlines {\uchar{125}{218}} - - \definecommand jaencodedjanuary {\uchar{78}{0}\uchar{103}{8}} - \definecommand jaencodedfebruary {\uchar{78}{140}\uchar{103}{8}} - \definecommand jaencodedmarch {\uchar{78}{9}\uchar{103}{8}} - \definecommand jaencodedapril {\uchar{86}{219}\uchar{103}{8}} - \definecommand jaencodedmay {\uchar{78}{148}\uchar{103}{8}} - \definecommand jaencodedjune {\uchar{81}{109}\uchar{103}{8}} - \definecommand jaencodedjuly {\uchar{78}{3}\uchar{103}{8}} - \definecommand jaencodedaugust {\uchar{81}{107}\uchar{103}{8}} - \definecommand jaencodedseptember {\uchar{78}{93}\uchar{103}{8}} - \definecommand jaencodedoctober {\uchar{83}{65}\uchar{103}{8}} - \definecommand jaencodednovember {\uchar{83}{65}\uchar{78}{0}\uchar{103}{8}} - \definecommand jaencodeddecember {\uchar{83}{65}\uchar{78}{140}\uchar{103}{8}} - - \definecommand jaencodedsunday {\uchar{103}{8}\uchar{102}{220}\uchar{101}{229}} - \definecommand jaencodedmonday {\uchar{112}{107}\uchar{102}{220}\uchar{101}{229}} - \definecommand jaencodedtuesday {\uchar{108}{52}\uchar{102}{220}\uchar{101}{229}} - \definecommand jaencodedwednesday {\uchar{103}{40}\uchar{102}{220}\uchar{101}{229}} - \definecommand jaencodedthursday {\uchar{145}{209}\uchar{102}{220}\uchar{101}{229}} - \definecommand jaencodedfriday {\uchar{87}{31}\uchar{102}{220}\uchar{101}{229}} - \definecommand jaencodedsaturday {\uchar{101}{229}\uchar{102}{220}\uchar{101}{229}} - -\stopencoding - -\protect \endinput diff --git a/tex/context/base/lang-lab.mkiv b/tex/context/base/lang-lab.mkiv index 60408f787..0be27b4ca 100644 --- a/tex/context/base/lang-lab.mkiv +++ b/tex/context/base/lang-lab.mkiv @@ -37,41 +37,65 @@ %D \showsetup{setupheadtext} %D \showsetup{setuplabeltext} %D -%D In a few paragraphs we'll show quite a lot of examples -%D of its use. +%D A regular \CONTEXT\ stores some 1500 labels at most. \let\handletextprefix\relax -\def\setupheadtext {\dosetupsometextprefix[\c!title]} -\def\setuplabeltext{\dosetupsometextprefix[\c!label]} - -\def\dosetupsometextprefix - {\let\dodocommand\xdosetupsometextprefix - \dotripleempty\dodosetupsometextprefix} - -% \def\dodosetupsometextprefix[#1][#2][#3]% -% {\ifthirdargument -% \def\docommand##1{\dodocommand[#1#2][##1]}% -% \processcommalist[#3]\docommand -% \else -% \def\docommand##1{\dodocommand[#1\currentmainlanguage][##1]}% -% \processcommalist[#2]\docommand -% \fi} - -\def\dodosetupsometextprefix[#1][#2][#3]% - {\ifthirdargument - \def\docommand##1{\expanded{\dodocommand[#1\reallanguagetag{#2}]}[##1]}% - \processcommalist[#3]\docommand +\newconditional\protecttextprefixes + +\let\currenttextprefixtag \s!unknown +\let\currenttextprefixclass\s!unknown + +\def\setupheadtext {\setfalse\protecttextprefixes\let\currenttextprefixclass\??mh\dodoubleempty\dosetupsometextprefix} +\def\setuplabeltext{\setfalse\protecttextprefixes\let\currenttextprefixclass\??ml\dodoubleempty\dosetupsometextprefix} + +\def\dosetupsometextprefix[#1][#2]% + {\ifsecondargument + \edef\currenttextprefixtag{\reallanguagetag{#1}}% + \processcommalist[#2]\dodosetupsometextprefix \else - \def\docommand##1{\expanded{\dodocommand[#1\reallanguagetag\currentmainlanguage]}[##1]}% - \processcommalist[#2]\docommand + \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% + \processcommalist[#1]\dodosetupsometextprefix \fi} -\def\doassignsometextprefix[#1][#2,#3,#4]% - {\setvalue{#1}{\handletextprefix{#2}{#3}}} +\def\dodosetupsometextprefix#1% + {\dododosetupsometextprefix[#1]} -\def\xdosetupsometextprefix[#1][#2=#3]% - {\doassignsometextprefix[#1#2][#3,,]} +\def\dododosetupsometextprefix[#1=#2]% + {\doassignsometextprefix{#1}[#2,,]} + +\def\doassignsometextprefix#1% + {\ifconditional\protecttextprefixes + \ifcsname\currenttextprefixclass\currenttextprefixtag#1\endcsname + \expandafter\expandafter\expandafter\doassignsometextprefixnop + \else + \expandafter\expandafter\expandafter\doassignsometextprefixyes + \fi + \else + \expandafter\doassignsometextprefixyes + \fi{#1}} + +\ifdefined\Word\else \let\Word\relax \fi + +% Checking saves some 8K in the compressed format and getting rid of the embedded +% \handletextprefix was good for another 6K. In the end the new solution is not +% even that inefficient. And the checking is done at format generation time anyway. + +\def\doassignsometextprefixyes#1[#2,#3,#4]% + {\edef\!!stringa{#2}% + \edef\!!stringb{#3}% + \ifx\!!stringb\empty + \ifx\!!stringa\empty + \expandafter\def\csname\currenttextprefixclass\currenttextprefixtag#1\endcsname{\empty\empty}% + \else + \expandafter\def\csname\currenttextprefixclass\currenttextprefixtag#1\endcsname{{#2}\empty}% + \fi + \else + \expandafter\def\csname\currenttextprefixclass\currenttextprefixtag#1\endcsname{{#2}{#3}}% + \fi} + +\def\doassignsometextprefixnop[#1][#2]% + {} %D By changing the meaning of \type {\handletextprefix} we %D can filter the left and right labeltext as well as convert @@ -100,86 +124,61 @@ %D %D The latter one has an upcased alternative \type{\LABELTEXT}. -% \def\labellanguage{\currentmainlanguage} -% \def\headlanguage {\currentmainlanguage} - -% \def\labellanguage{\defaultlanguage\currentmainlanguage} -% \def\headlanguage {\defaultlanguage\currentmainlanguage} - \def\labellanguage{\reallanguagetag{\defaultlanguage\currentmainlanguage}} \def\headlanguage {\reallanguagetag{\defaultlanguage\currentmainlanguage}} \appendtoks \let\labellanguage\currentlanguage \to \everycurrentdate -\unexpanded\def\headtext - {\let\handletextprefix\firstoftwoarguments - \let\reporttextprefixerror\doreporttextprefixerror - \global\labeltextdonetrue - \dogetupsometextprefix\headlanguage\c!title} - -\unexpanded\def\leftlabeltext - {\let\handletextprefix\firstoftwoarguments - \let\reporttextprefixerror\doreporttextprefixerror - \global\labeltextdonetrue - \dogetupsometextprefix\labellanguage\c!label} - -\unexpanded\def\rightlabeltext - {\let\handletextprefix\secondoftwoarguments - \let\reporttextprefixerror\doreporttextprefixerror - \global\labeltextdonetrue - \dogetupsometextprefix\labellanguage\c!label} - -\unexpanded\def\LEFTLABELTEXT - {\def\handletextprefix##1##2{\uppercase{##1}}\DOLABELTEXT} - -\unexpanded\def\RIGHTLABELTEXT - {\def\handletextprefix##1##2{\uppercase{##2}}\DOLABELTEXT} - -\def\DOLABELTEXT#1% - {\bgroup - \the\everyuppercase - \let\reporttextprefixerror\doreporttextprefixerror - \global\labeltextdonetrue - \dogetupsometextprefix\labellanguage\c!label{#1}% not \labeltext (see \MONTH) - \egroup} - -\let\labeltext \leftlabeltext -\let\LABELTEXT \LEFTLABELTEXT - -\unexpanded\def\labeltexts#1#2{\leftlabeltext{#1}#2\rightlabeltext{#1}} -\unexpanded\def\LABELTEXTS#1#2{\LEFTLABELTEXT{#1}#2\RIGHTLABELTEXT{#1}} - -\newif\iflabeltextdone % needs to be reset elsewhere -\newif\iftracelabels % shows missing labels - -\def\doreporttextprefixerror#1#2#3% - {\iftracelabels{\tttf[#2:~#3/#1]~}\fi} - -\def\dosetexpandedheadlabeltext#1#2#3% - {\bgroup - \let\handletextprefix\firstoftwoarguments - \let\reporttextprefixerror\gobblethreearguments - \keepencodedtokens % test on multilingual pascal, ok in stretched - %\dontexpandencodedtokens % not usable in token handler - \expanded - {\egroup\noexpand\def\noexpand#2% watch out, no \edef - {\dogetupsometextprefix{\headlanguage}{#1}{#3}}}} - -\def\setexpandedheadtext {\dosetexpandedheadlabeltext\c!title} -\def\setexpandedlabeltext{\dosetexpandedheadlabeltext\c!label} - -\def\dogetupsometextprefix#1#2#3% must be expandable ! #1 == language - {\ifcsname#2#1#3\endcsname - \csname#2#1#3\endcsname - \else\ifcsname\??la#1\s!default\endcsname - \expandafter\dogetupsometextprefix\csname\??la#1\s!default\endcsname{#2}{#3}% - \else\ifcsname#2#3\endcsname - \csname#2#3\endcsname - \else\ifcsname#1\s!en#3\endcsname - \csname#2\s!en#3\endcsname +\def\dummytextprefix{\empty\empty} + +\def\dogetupsomelabeltext#1% + {\ifcsname\??ml\labellanguage#1\endcsname + \expandafter\let\expandafter\thetextprefix\csname\??ml\labellanguage#1\endcsname + \else\ifcsname\??la\labellanguage\s!default\endcsname + \expandafter\dogetupsometextprefix\csname\??la\labellanguage\s!default\endcsname\??ml#1% + \else\ifcsname\??ml#1\endcsname + \expandafter\let\expandafter\thetextprefix\csname\??ml#1\endcsname + \else\ifcsname\??ml\s!en#1\endcsname + \expandafter\let\expandafter\thetextprefix\csname\??ml\s!en#1\endcsname \else - % \doreporttextprefixerror{#1}{#2}{#3}% + \let\thetextprefix\dummytextprefix \fi\fi\fi\fi} + +\def\dogetupsomeheadtext#1% + {\ifcsname\??mh\headlanguage#1\endcsname + \expandafter\let\expandafter\thetextprefix\csname\??mh\headlanguage#1\endcsname + \else\ifcsname\??la\headlanguage\s!default\endcsname + \expandafter\dogetupsometextprefix\csname\??la\headlanguage\s!default\endcsname\??mh#1% + \else\ifcsname\??mh#1\endcsname + \expandafter\let\expandafter\thetextprefix\csname\??mh#1\endcsname + \else\ifcsname\??mh\s!en#1\endcsname + \expandafter\let\expandafter\thetextprefix\csname\??mh\s!en#1\endcsname + \else + \let\thetextprefix\dummytextprefix + \fi\fi\fi\fi} + +% The WORD variants are a bit inefficient when #1/#2 are empty but they are +% seldom used (one can better set the style). + +\let\flushleftlabeltext \firstoftwoarguments +\let\flushrightlabeltext\secondoftwoarguments + +\def\flushleftlabelWORD #1#2{\WORD{#1}} +\def\flushrightlabelWORD#1#2{\WORD{#2}} + +\def\flushbothlabeltexts#1#2#3{#1#3#2} +\def\flushbothlabelTEXTS#1#2#3{\WORD{#1}#3\WORD{#2}} + +\unexpanded\def\headtext #1{\dogetupsomeheadtext {#1}\expandafter\flushleftlabeltext \thetextprefix} +\unexpanded\def\leftlabeltext #1{\dogetupsomelabeltext{#1}\expandafter\flushleftlabeltext \thetextprefix} +\unexpanded\def\rightlabeltext#1{\dogetupsomelabeltext{#1}\expandafter\flushrightlabeltext\thetextprefix} +\unexpanded\def\LEFTLABELTEXT #1{\dogetupsomelabeltext{#1}\expandafter\flushleftlabelWORD \thetextprefix} +\unexpanded\def\RIGHTLABELTEXT#1{\dogetupsomelabeltext{#1}\expandafter\flushrightlabelWORD\thetextprefix} +\unexpanded\def\labeltexts #1{\dogetupsomelabeltext{#1}\expandafter\flushbothlabeltexts\thetextprefix} % #2 +\unexpanded\def\LABELTEXTS #1{\dogetupsomelabeltext{#1}\expandafter\flushbothlabelTEXTS\thetextprefix} % #2 + +\let\labeltext\leftlabeltext +\let\LABELTEXT\LEFTLABELTEXT \ifx\simplifiedcommands\undefined \newtoks\simplifiedcommands \fi @@ -201,15 +200,8 @@ %D head and label texts without replacing predefined ones. %D These are internal macros. -\def\xdopresetsometextprefix[#1][#2=#3]% - {\ifundefined{#1#2}\doassignsometextprefix[#1\reallanguagetag{#2}][#3,,]\fi} - -\def\dopresetsometextprefix - {\let\dodocommand\xdopresetsometextprefix - \dotripleempty\dodosetupsometextprefix} - -\def\presetheadtext {\dopresetsometextprefix[\c!title]} -\def\presetlabeltext{\dopresetsometextprefix[\c!label]} +\def\presetheadtext {\settrue\protecttextprefixes\let\currenttextprefixclass\??mh\dodoubleempty\dosetupsometextprefix} +\def\presetlabeltext{\settrue\protecttextprefixes\let\currenttextprefixclass\??ml\dodoubleempty\dosetupsometextprefix} %D \macros %D {translate} diff --git a/tex/context/base/lang-mis.mkii b/tex/context/base/lang-mis.mkii new file mode 100644 index 000000000..eb7bb1a04 --- /dev/null +++ b/tex/context/base/lang-mis.mkii @@ -0,0 +1,683 @@ +%D \module +%D [ file=lang-mis, +%D version=1997.03.20, % used to be supp-lan.tex +%D title=\CONTEXT\ Language Macros, +%D subtitle=Compounds, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Language Macros / Compounds} + +%D \gdef\starttest +%D {\blank +%D \noindent +%D \halign\bgroup\tt##\hskip2em&##\hskip2em&##\cr} +%D +%D \gdef\stoptest +%D {\egroup +%D \blank} +%D +%D \gdef\test#1% +%D {\defconvertedargument\ascii{#1}\ascii&\hyphenatedword{#1}\cr} + +\unprotect + +%D One of \TEX's strong points in building paragraphs is the way +%D hyphenations are handled. Although for real good hyphenation +%D of non||english languages some extensions to the program are +%D needed, fairly good results can be reached with the standard +%D mechanisms and an additional macro, at least in Dutch. + +%D \CONTEXT\ originates in the wish to typeset educational +%D materials, especially in a technical environment. In +%D production oriented environments, a lot of compound words +%D are used. Because the Dutch language poses no limits on +%D combining words, we often favor putting dashes between those +%D words, because it facilitates reading, at least for those +%D who are not that accustomed to it. +%D +%D In \TEX\ compound words, separated by a hyphen, are not +%D hyphenated at all. In spite of the multiple pass paragraph +%D typesetting this can lead to parts of words sticking into +%D the margin. The solution lays in saying \type +%D {spoelwater||terugwinunit} instead of \type +%D {spoelwater-terugwinunit}. By using a one character command +%D like \type {|}, delimited by the same character \type {|}, +%D we get ourselves both a decent visualization (in \TEXEDIT\ +%D and colored verbatim we color these commands yellow) and an +%D efficient way of combining words. +%D +%D The sequence \type{||} simply leads to two words connected by +%D a hyphen. Because we want to distinguish such a hyphen from +%D the one inserted when \TEX\ hyphenates a word, we use a bit +%D longer one. +%D +%D \hyphenation {spoel-wa-ter te-rug-win-unit} +%D +%D \starttest +%D \test {spoelwater||terugwinunit} +%D \stoptest +%D +%D As we already said, the \type{|} is a command. This commands +%D accepts an optional argument before it's delimiter, which is +%D also a \type{|}. +%D +%D \hyphenation {po-ly-meer che-mie} +%D +%D \starttest +%D \test {polymeer|*|chemie} +%D \stoptest +%D +%D Arguments like \type{*} are not interpreted and inserted +%D directly, in contrary to arguments like: +%D +%D \starttest +%D \test {polymeer|~|chemie} +%D \test {|(|polymeer|)|chemie} +%D \test {polymeer|(|chemie|)| } +%D \stoptest +%D +%D Although such situations seldom occur |<|we typeset thousands +%D of pages before we encountered one that forced us to enhance +%D this mechanism|>| we also have to take care of comma's. +%D +%D \hyphenation {uit-stel-len} +%D +%D \starttest +%D \test {op||, in|| en uitstellen} +%D \stoptest +%D +%D The next special case (concerning quotes) was brought to my +%D attention by Piet Tutelaers, one of the driving forces +%D behind rebuilding hyphenation patterns for the dutch +%D language.\footnote{In 1996 the spelling of the dutch +%D language has been slightly reformed which made this topic +%D actual again.} We'll also take care of this case. +%D +%D \starttest +%D \test {AOW|'|er} +%D \test {cd|'|tje} +%D \test {ex|-|PTT|'|er} +%D \test {rock|-|'n|-|roller} +%D \stoptest +%D +%D Tobias Burnus pointed out that I should also support +%D something like +%D +%D \starttest +%D \test {well|_|known} +%D \stoptest +%D +%D to stress the compoundness of hyphenated words. +%D +%D Of course we also have to take care of the special case: +%D +%D \starttest +%D \test {text||color and ||font} +%D \stoptest + +%D \macros +%D {installdiscretionaries} +%D +%D The mechanism described here is one of the older inner parts +%D of \CONTEXT. The most recent extensions concerns some +%D special cases as well as the possibility to install other +%D characters as delimiters. The prefered way of specifying +%D compound words is using \type{||}, which is installed by: +%D +%D \starttyping +%D \installdiscretionaries || - +%D \stoptyping +%D +%D Some alternative definitions are: +%D +%D \startbuffer +%D \installdiscretionaries ** - +%D \installdiscretionaries ++ - +%D \installdiscretionaries // - +%D \installdiscretionaries ~~ - +%D \stopbuffer +%D +%D \typebuffer +%D +%D after which we can say: +%D +%D \bgroup +%D \getbuffer +%D \starttest +%D \test {test**test**test} +%D \test {test++test++test} +%D \test {test//test//test} +%D \test {test~~test~~test} +%D \stoptest +%D \egroup + +%D \macros +%D {compoundhyphen, +%D beginofsubsentence,endofsubsentence} +%D +%D Now let's go to the macros. First we define some variables. +%D In the main \CONTEXT\ modules these can be tuned by a setup +%D command. Watch the (maybe) better looking compound hyphen. + +\ifx\compoundhyphen \undefined \def\compoundhyphen{\hbox{-\kern-.25ex-}} \fi + +\ifx\beginofsubsentence \undefined \def\beginofsubsentence{\hbox{---}} \fi +\ifx\endofsubsentence \undefined \def\endofsubsentence {\hbox{---}} \fi + +%D The last two variables are needed for subsentences +%D |<|like this one|>| which we did not yet mention. +%D +%D We want to enable breaking but at the same time don't want +%D compound characters like |-| or || to be separated from the +%D words. \TEX\ hackers will recognise the next two macro's: + +\ifx\prewordbreak \undefined \def\prewordbreak {\penalty\plustenthousand\hskip\zeropoint\relax} \fi +%ifx\postwordbreak \undefined \def\postwordbreak{\penalty\zerocount \prewordbreak } \fi +\ifx\postwordbreak \undefined \def\postwordbreak{\penalty\zerocount \hskip\zeropoint\relax} \fi + +\ifx\hspaceamount \undefined \def\hspaceamount#1#2{.16667em} \fi % language specific + +%D \macros +%D {beginofsubsentencespacing,endofsubsentencespacing} +%D +%D In the previous macros we provided two hooks which can be +%D used to support nested sub||sentences. In \CONTEXT\ these +%D hooks are used to insert a small space when needed. + +\ifx\beginofsubsentencespacing\undefined \let\beginofsubsentencespacing\relax \fi +\ifx\endofsubsentencespacing \undefined \let\endofsubsentencespacing \relax \fi + +%D The following piece of code is a torture test compound +%D hndling. The \type {\relax} before the \type {\ifmmode} is +%D needed because of the alignment scanner (in \ETEX\ this +%D problem is not present because there a protected macro is +%D not expanded. Thanks to Tobias Burnus for providing this +%D example. +%D +%D \startformula +%D \left|f(x_n)-{1\over2}\right| = +%D {\cases{|{1\over2}-x_n| &for $0\le x_n < {1\over2}$\cr +%D |x_n-{1\over2}| &for ${1\over2}\zeropoint + (\prewordbreak + \else + \prewordbreak\discretionary{}{(-}{(}\prewordbreak + \fi} + +\definetextmodediscretionary ~ + {\prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak} + +\definetextmodediscretionary ' + {\prewordbreak\discretionary{-}{}{'}\postwordbreak} + +\definetextmodediscretionary ^ + {\prewordbreak\discretionary{\hbox{$|$}}{}{\hbox{$|$}}% + \allowbreak\postwordbreak} % bugged + +\definetextmodediscretionary < + {\beginofsubsentence\prewordbreak\beginofsubsentencespacing} + +\definetextmodediscretionary > + {\endofsubsentencespacing\prewordbreak\endofsubsentence} + +\definetextmodediscretionary = + {\prewordbreak\midsentence\prewordbreak} % {\prewordbreak\compoundhyphen} + +% french + +\definetextmodediscretionary : {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{:}:} +\definetextmodediscretionary ; {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{;};} +\definetextmodediscretionary ? {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{?}?} +\definetextmodediscretionary ! {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{!}!} + +\definetextmodediscretionary * + {\prewordbreak\discretionary{-}{}{\kern.05em}\prewordbreak} + +% spanish + +\definetextmodediscretionary ?? {\prewordbreak\questiondown} +\definetextmodediscretionary !! {\prewordbreak\exclamdown} + +% \ifx\normalcompound\undefined \let\normalcompound=| \fi + +%D \installdiscretionary | + +%D \installdiscretionary + = + +\def\defaultdiscretionaryhyphen{\compoundhyphen} + +\installdiscretionary | \defaultdiscretionaryhyphen % installs in ctx and prt will fall back on it + +%D \macros +%D {fakecompoundhyphen} +%D +%D In headers and footers as well as in active pieces of text +%D we need a dirty hack. Try to imagine what is needed to +%D savely break the next text across a line and at the same +%D time make the words interactive. +%D +%D \starttyping +%D \goto{Some||Long||Word} +%D \stoptyping + +\def\fakecompoundhyphen + {\def\|{\mathortext\vert\dofakecompoundhyphen}} + +\def\dofakecompoundhyphen + {\def##1|% + {\doifelsenothing{##1}\compoundhyphen{##1}% + \kern\compoundbreakpoint\allowbreak}} + +%D \macros +%D {midworddiscretionary} +%D +%D If needed, one can add a discretionary hyphen using \type +%D {\midworddiscretionary}. This macro does the same as +%D \PLAIN\ \TEX's \type {\-}, but, like the ones implemented +%D earlier, this one also looks ahead for spaces and grouping +%D tokens. + +\def\midworddiscretionary + {\futurelet\next\domidworddiscretionary} + +\def\domidworddiscretionary + {\ifx\next\blankspace\else + \ifx\next\bgroup \else + \ifx\next\egroup \else + \discretionary{-}{}{}% + \fi\fi\fi} + +%D \macros +%D {installcompoundcharacter} +%D +%D When Tobias Burnus started translating the dutch manual of +%D \PPCHTEX\ into german, he suggested to let \CONTEXT\ support +%D the \type{german.sty} method of handling compound +%D characters, especially the umlaut. This package is meant for +%D use with \PLAIN\ \TEX\ as well as \LATEX. +%D +%D I decided to implement compound character support as +%D versatile as possible. As a result one can define his own +%D compound character support, like: +%D +%D \starttyping +%D \installcompoundcharacter "a {\"a} +%D \installcompoundcharacter "e {\"e} +%D \installcompoundcharacter "i {\"i} +%D \installcompoundcharacter "u {\"u} +%D \installcompoundcharacter "o {\"o} +%D \installcompoundcharacter "s {\SS} +%D \stoptyping +%D +%D or even +%D +%D \starttyping +%D \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}} +%D \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} +%D \stoptyping +%D +%D The support is not limited to alphabetic characters, so the +%D next definition is also valid. +%D +%D \starttyping +%D \installcompoundcharacter ". {.\doifnextcharelse{\spacetoken}{}{\kern.125em}} +%D \stoptyping +%D +%D The implementation looks familiar and uses the same tricks as +%D mentioned earlier in this module. We take care of two +%D arguments, which complicates things a bit. + +\def\@nc@{@nc@} % normal character +\def\@cc@{@cc@} % compound character +\def\@cs@{@cs@} % compound characters +\def\@cx@{@cx@} % compound definition + +%D When we started working on MK IV code, we needed a different +%D approach for defining the active character itself. In MK II as +%D well as in MK IV we now use the catcode vectors. + +\chardef\compoundcharactermode\plusone + +\def\installcompoundcharacter #1#2#3 #4% {#4} no grouping + {\ifcase\compoundcharactermode + % ignore mode + \else + \chardef\thecompoundcharacter`#1% + \@EA\chardef\csname\@nc@\string#1\endcsname\thecompoundcharacter + \def\!!stringa{#3}% + \@EA\def\csname\ifx\!!stringa\empty\@cc@\else\@cs@\fi\detokenize{#1#2#3}\endcsname{#4}% + \setevalue{\@cx@\detokenize{#1}}{\noexpand\handlecompoundcharacter{\detokenize{#1}}}% beter nr's +% \@EA\letcatcodecommand\@EA\prtcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname +% \@EA\letcatcodecommand\@EA\texcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname + \@EA\letcatcodecommand\@EA\ctxcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname + \fi} + +%D In order to serve the language specific well, we will introduce +%D a namespace: + +% \ifx\currentlanguage\undefined + \let\compoundcharacterclass\empty +% \else +% \def\compoundcharacterclass{\currentlanguage} +% \fi + +\def\@cc@{@cc@\compoundcharacterclass} % compound character +\def\@cs@{@cs@\compoundcharacterclass} % compound characters + +%D We can also ignore definitions (needed in for instance \XML). Beware, +%D this macro is supposed to be used grouped! + +\def\ignorecompoundcharacter + {\chardef\compoundcharactermode\zerocount} + +\let\restorecompoundcharacter \gobbleoneargument % obsolete +\let\enableactivediscretionaries\relax % obsolete + +%D In handling the compound characters we have to take care of +%D \type{\bgroup} and \type{\egroup} tokens, so we end up with +%D a multi||step interpretation macro. We look ahead for a +%D \type{\bgroup}, \type{\egroup} or \type{\blankspace}. Being +%D no user of this mechanism, the credits for testing them goes +%D to Tobias Burnus, the first german user of \CONTEXT. +%D +%D We define these macros as \type{\long} because we can +%D expect \type{\par} tokens. We need to look into the future +%D with \type{\futurelet} to prevent spaces from +%D disappearing. + +\def\handlecompoundcharacter#1% + {\def\xhandlecompoundcharacter{\dohandlecompoundcharacter{#1}}% + \futurelet\next\xhandlecompoundcharacter} + +\def\dohandlecompoundcharacter + {\ifx\next\bgroup + %\@EA\dodohandlecompoundcharacter % handle "{ee} -> \"ee + %\@EA\gobbleoneargument % forget "{ee} -> ee + \@EA\handlecompoundcharacterone % ignore "{ee} -> "ee + \else\ifx\next\egroup + \@EAEAEA\donohandlecompoundcharacter + \else\ifx\next\blankspace + \@EA\@EAEAEA\@EA\donohandlecompoundcharacter + \else + \@EA\@EAEAEA\@EA\dodohandlecompoundcharacter + \fi\fi\fi} + +\def\donohandlecompoundcharacter#1{\csname\@nc@\string#1\endcsname} + +\def\dododohandlecompoundcharacter + {\ifx\next\bgroup + \@EA\handlecompoundcharacterone + \else\ifx\next\egroup + \@EAEAEA\handlecompoundcharacterone + \else\ifx\next\blankspace + \@EA\@EAEAEA\@EA\handlecompoundcharacterone + \else + \@EA\@EAEAEA\@EA\handlecompoundcharactertwo + \fi\fi\fi} + +\def\dodohandlecompoundcharacter#1#2% preserve space + {\def\xdodohandlecompoundcharacter{\dododohandlecompoundcharacter#1#2}% + \futurelet\next\xdodohandlecompoundcharacter} + +%D Besides taken care of the grouping and space tokens, we have +%D to deal with three situations. First we look if the next +%D character equals the first one, if so, then we just insert +%D the original. Next we look if indeed a compound character is +%D defined. We either execute the compound character or just +%D insert the first. So we have +%D +%D \starttyping +%D +%D \stoptyping +%D +%D In later modules we will see how these commands are used. + +\long\def\handlecompoundcharacterone#1#2% + {\if\string#1\string#2% was: \ifx#1#2% + \def\next{\csname\@nc@\string#1\endcsname}% + \else\ifcsname\@cc@\string#1\string#2\endcsname + \def\next{\csname\@cc@\string#1\string#2\endcsname}% + \else + \def\next{\csname\@nc@\string#1\endcsname#2}% + \fi\fi + \next} + +\long\def\handlecompoundcharactertwo#1#2#3% + {\if\string#1\string#2% + \def\next{\csname\@nc@\string#1\endcsname#3}% + \else\ifcsname\@cs@\string#1\string#2\string#3\endcsname + \def\next{\csname\@cs@\string#1\string#2\string#3\endcsname}% + \else\ifcsname\@cc@\string#1\string#2\endcsname + \def\next{\csname\@cc@\string#1\string#2\endcsname#3}% + \else + \def\next{\csname\@nc@\string#1\endcsname#2#3}% + \fi\fi\fi + \next} + +%D For very obscure applications (see for an application \type +%D {lang-sla.tex}) we provide: + +\def\simplifiedcompoundcharacter#1#2% + {\ifcsname\@cc@\string#1\string#2\endcsname + \@EA\@EA\@EA\firstofoneargument\csname\@cc@\string#1\string#2\endcsname + \else + #2% + \fi} + +%D \macros +%D {disablediscretionaries,disablecompoundcharacter} +%D +%D Occasionally we need to disable this mechanism. For the +%D moment we assume that \type {|} is used. + +\let\disablediscretionaries \ignorediscretionaries +\let\disablecompoundcharacters\ignorecompoundcharacter + +%D \macros +%D {normalcompound} +%D +%D Handy in for instance XML. (Kind of obsolete) + +\ifx\normalcompound\undefined \let\normalcompound=| \fi + +\protect \endinput diff --git a/tex/context/base/lang-mis.mkiv b/tex/context/base/lang-mis.mkiv new file mode 100644 index 000000000..eb7bb1a04 --- /dev/null +++ b/tex/context/base/lang-mis.mkiv @@ -0,0 +1,683 @@ +%D \module +%D [ file=lang-mis, +%D version=1997.03.20, % used to be supp-lan.tex +%D title=\CONTEXT\ Language Macros, +%D subtitle=Compounds, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Language Macros / Compounds} + +%D \gdef\starttest +%D {\blank +%D \noindent +%D \halign\bgroup\tt##\hskip2em&##\hskip2em&##\cr} +%D +%D \gdef\stoptest +%D {\egroup +%D \blank} +%D +%D \gdef\test#1% +%D {\defconvertedargument\ascii{#1}\ascii&\hyphenatedword{#1}\cr} + +\unprotect + +%D One of \TEX's strong points in building paragraphs is the way +%D hyphenations are handled. Although for real good hyphenation +%D of non||english languages some extensions to the program are +%D needed, fairly good results can be reached with the standard +%D mechanisms and an additional macro, at least in Dutch. + +%D \CONTEXT\ originates in the wish to typeset educational +%D materials, especially in a technical environment. In +%D production oriented environments, a lot of compound words +%D are used. Because the Dutch language poses no limits on +%D combining words, we often favor putting dashes between those +%D words, because it facilitates reading, at least for those +%D who are not that accustomed to it. +%D +%D In \TEX\ compound words, separated by a hyphen, are not +%D hyphenated at all. In spite of the multiple pass paragraph +%D typesetting this can lead to parts of words sticking into +%D the margin. The solution lays in saying \type +%D {spoelwater||terugwinunit} instead of \type +%D {spoelwater-terugwinunit}. By using a one character command +%D like \type {|}, delimited by the same character \type {|}, +%D we get ourselves both a decent visualization (in \TEXEDIT\ +%D and colored verbatim we color these commands yellow) and an +%D efficient way of combining words. +%D +%D The sequence \type{||} simply leads to two words connected by +%D a hyphen. Because we want to distinguish such a hyphen from +%D the one inserted when \TEX\ hyphenates a word, we use a bit +%D longer one. +%D +%D \hyphenation {spoel-wa-ter te-rug-win-unit} +%D +%D \starttest +%D \test {spoelwater||terugwinunit} +%D \stoptest +%D +%D As we already said, the \type{|} is a command. This commands +%D accepts an optional argument before it's delimiter, which is +%D also a \type{|}. +%D +%D \hyphenation {po-ly-meer che-mie} +%D +%D \starttest +%D \test {polymeer|*|chemie} +%D \stoptest +%D +%D Arguments like \type{*} are not interpreted and inserted +%D directly, in contrary to arguments like: +%D +%D \starttest +%D \test {polymeer|~|chemie} +%D \test {|(|polymeer|)|chemie} +%D \test {polymeer|(|chemie|)| } +%D \stoptest +%D +%D Although such situations seldom occur |<|we typeset thousands +%D of pages before we encountered one that forced us to enhance +%D this mechanism|>| we also have to take care of comma's. +%D +%D \hyphenation {uit-stel-len} +%D +%D \starttest +%D \test {op||, in|| en uitstellen} +%D \stoptest +%D +%D The next special case (concerning quotes) was brought to my +%D attention by Piet Tutelaers, one of the driving forces +%D behind rebuilding hyphenation patterns for the dutch +%D language.\footnote{In 1996 the spelling of the dutch +%D language has been slightly reformed which made this topic +%D actual again.} We'll also take care of this case. +%D +%D \starttest +%D \test {AOW|'|er} +%D \test {cd|'|tje} +%D \test {ex|-|PTT|'|er} +%D \test {rock|-|'n|-|roller} +%D \stoptest +%D +%D Tobias Burnus pointed out that I should also support +%D something like +%D +%D \starttest +%D \test {well|_|known} +%D \stoptest +%D +%D to stress the compoundness of hyphenated words. +%D +%D Of course we also have to take care of the special case: +%D +%D \starttest +%D \test {text||color and ||font} +%D \stoptest + +%D \macros +%D {installdiscretionaries} +%D +%D The mechanism described here is one of the older inner parts +%D of \CONTEXT. The most recent extensions concerns some +%D special cases as well as the possibility to install other +%D characters as delimiters. The prefered way of specifying +%D compound words is using \type{||}, which is installed by: +%D +%D \starttyping +%D \installdiscretionaries || - +%D \stoptyping +%D +%D Some alternative definitions are: +%D +%D \startbuffer +%D \installdiscretionaries ** - +%D \installdiscretionaries ++ - +%D \installdiscretionaries // - +%D \installdiscretionaries ~~ - +%D \stopbuffer +%D +%D \typebuffer +%D +%D after which we can say: +%D +%D \bgroup +%D \getbuffer +%D \starttest +%D \test {test**test**test} +%D \test {test++test++test} +%D \test {test//test//test} +%D \test {test~~test~~test} +%D \stoptest +%D \egroup + +%D \macros +%D {compoundhyphen, +%D beginofsubsentence,endofsubsentence} +%D +%D Now let's go to the macros. First we define some variables. +%D In the main \CONTEXT\ modules these can be tuned by a setup +%D command. Watch the (maybe) better looking compound hyphen. + +\ifx\compoundhyphen \undefined \def\compoundhyphen{\hbox{-\kern-.25ex-}} \fi + +\ifx\beginofsubsentence \undefined \def\beginofsubsentence{\hbox{---}} \fi +\ifx\endofsubsentence \undefined \def\endofsubsentence {\hbox{---}} \fi + +%D The last two variables are needed for subsentences +%D |<|like this one|>| which we did not yet mention. +%D +%D We want to enable breaking but at the same time don't want +%D compound characters like |-| or || to be separated from the +%D words. \TEX\ hackers will recognise the next two macro's: + +\ifx\prewordbreak \undefined \def\prewordbreak {\penalty\plustenthousand\hskip\zeropoint\relax} \fi +%ifx\postwordbreak \undefined \def\postwordbreak{\penalty\zerocount \prewordbreak } \fi +\ifx\postwordbreak \undefined \def\postwordbreak{\penalty\zerocount \hskip\zeropoint\relax} \fi + +\ifx\hspaceamount \undefined \def\hspaceamount#1#2{.16667em} \fi % language specific + +%D \macros +%D {beginofsubsentencespacing,endofsubsentencespacing} +%D +%D In the previous macros we provided two hooks which can be +%D used to support nested sub||sentences. In \CONTEXT\ these +%D hooks are used to insert a small space when needed. + +\ifx\beginofsubsentencespacing\undefined \let\beginofsubsentencespacing\relax \fi +\ifx\endofsubsentencespacing \undefined \let\endofsubsentencespacing \relax \fi + +%D The following piece of code is a torture test compound +%D hndling. The \type {\relax} before the \type {\ifmmode} is +%D needed because of the alignment scanner (in \ETEX\ this +%D problem is not present because there a protected macro is +%D not expanded. Thanks to Tobias Burnus for providing this +%D example. +%D +%D \startformula +%D \left|f(x_n)-{1\over2}\right| = +%D {\cases{|{1\over2}-x_n| &for $0\le x_n < {1\over2}$\cr +%D |x_n-{1\over2}| &for ${1\over2}\zeropoint + (\prewordbreak + \else + \prewordbreak\discretionary{}{(-}{(}\prewordbreak + \fi} + +\definetextmodediscretionary ~ + {\prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak} + +\definetextmodediscretionary ' + {\prewordbreak\discretionary{-}{}{'}\postwordbreak} + +\definetextmodediscretionary ^ + {\prewordbreak\discretionary{\hbox{$|$}}{}{\hbox{$|$}}% + \allowbreak\postwordbreak} % bugged + +\definetextmodediscretionary < + {\beginofsubsentence\prewordbreak\beginofsubsentencespacing} + +\definetextmodediscretionary > + {\endofsubsentencespacing\prewordbreak\endofsubsentence} + +\definetextmodediscretionary = + {\prewordbreak\midsentence\prewordbreak} % {\prewordbreak\compoundhyphen} + +% french + +\definetextmodediscretionary : {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{:}:} +\definetextmodediscretionary ; {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{;};} +\definetextmodediscretionary ? {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{?}?} +\definetextmodediscretionary ! {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{!}!} + +\definetextmodediscretionary * + {\prewordbreak\discretionary{-}{}{\kern.05em}\prewordbreak} + +% spanish + +\definetextmodediscretionary ?? {\prewordbreak\questiondown} +\definetextmodediscretionary !! {\prewordbreak\exclamdown} + +% \ifx\normalcompound\undefined \let\normalcompound=| \fi + +%D \installdiscretionary | + +%D \installdiscretionary + = + +\def\defaultdiscretionaryhyphen{\compoundhyphen} + +\installdiscretionary | \defaultdiscretionaryhyphen % installs in ctx and prt will fall back on it + +%D \macros +%D {fakecompoundhyphen} +%D +%D In headers and footers as well as in active pieces of text +%D we need a dirty hack. Try to imagine what is needed to +%D savely break the next text across a line and at the same +%D time make the words interactive. +%D +%D \starttyping +%D \goto{Some||Long||Word} +%D \stoptyping + +\def\fakecompoundhyphen + {\def\|{\mathortext\vert\dofakecompoundhyphen}} + +\def\dofakecompoundhyphen + {\def##1|% + {\doifelsenothing{##1}\compoundhyphen{##1}% + \kern\compoundbreakpoint\allowbreak}} + +%D \macros +%D {midworddiscretionary} +%D +%D If needed, one can add a discretionary hyphen using \type +%D {\midworddiscretionary}. This macro does the same as +%D \PLAIN\ \TEX's \type {\-}, but, like the ones implemented +%D earlier, this one also looks ahead for spaces and grouping +%D tokens. + +\def\midworddiscretionary + {\futurelet\next\domidworddiscretionary} + +\def\domidworddiscretionary + {\ifx\next\blankspace\else + \ifx\next\bgroup \else + \ifx\next\egroup \else + \discretionary{-}{}{}% + \fi\fi\fi} + +%D \macros +%D {installcompoundcharacter} +%D +%D When Tobias Burnus started translating the dutch manual of +%D \PPCHTEX\ into german, he suggested to let \CONTEXT\ support +%D the \type{german.sty} method of handling compound +%D characters, especially the umlaut. This package is meant for +%D use with \PLAIN\ \TEX\ as well as \LATEX. +%D +%D I decided to implement compound character support as +%D versatile as possible. As a result one can define his own +%D compound character support, like: +%D +%D \starttyping +%D \installcompoundcharacter "a {\"a} +%D \installcompoundcharacter "e {\"e} +%D \installcompoundcharacter "i {\"i} +%D \installcompoundcharacter "u {\"u} +%D \installcompoundcharacter "o {\"o} +%D \installcompoundcharacter "s {\SS} +%D \stoptyping +%D +%D or even +%D +%D \starttyping +%D \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}} +%D \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} +%D \stoptyping +%D +%D The support is not limited to alphabetic characters, so the +%D next definition is also valid. +%D +%D \starttyping +%D \installcompoundcharacter ". {.\doifnextcharelse{\spacetoken}{}{\kern.125em}} +%D \stoptyping +%D +%D The implementation looks familiar and uses the same tricks as +%D mentioned earlier in this module. We take care of two +%D arguments, which complicates things a bit. + +\def\@nc@{@nc@} % normal character +\def\@cc@{@cc@} % compound character +\def\@cs@{@cs@} % compound characters +\def\@cx@{@cx@} % compound definition + +%D When we started working on MK IV code, we needed a different +%D approach for defining the active character itself. In MK II as +%D well as in MK IV we now use the catcode vectors. + +\chardef\compoundcharactermode\plusone + +\def\installcompoundcharacter #1#2#3 #4% {#4} no grouping + {\ifcase\compoundcharactermode + % ignore mode + \else + \chardef\thecompoundcharacter`#1% + \@EA\chardef\csname\@nc@\string#1\endcsname\thecompoundcharacter + \def\!!stringa{#3}% + \@EA\def\csname\ifx\!!stringa\empty\@cc@\else\@cs@\fi\detokenize{#1#2#3}\endcsname{#4}% + \setevalue{\@cx@\detokenize{#1}}{\noexpand\handlecompoundcharacter{\detokenize{#1}}}% beter nr's +% \@EA\letcatcodecommand\@EA\prtcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname +% \@EA\letcatcodecommand\@EA\texcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname + \@EA\letcatcodecommand\@EA\ctxcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname + \fi} + +%D In order to serve the language specific well, we will introduce +%D a namespace: + +% \ifx\currentlanguage\undefined + \let\compoundcharacterclass\empty +% \else +% \def\compoundcharacterclass{\currentlanguage} +% \fi + +\def\@cc@{@cc@\compoundcharacterclass} % compound character +\def\@cs@{@cs@\compoundcharacterclass} % compound characters + +%D We can also ignore definitions (needed in for instance \XML). Beware, +%D this macro is supposed to be used grouped! + +\def\ignorecompoundcharacter + {\chardef\compoundcharactermode\zerocount} + +\let\restorecompoundcharacter \gobbleoneargument % obsolete +\let\enableactivediscretionaries\relax % obsolete + +%D In handling the compound characters we have to take care of +%D \type{\bgroup} and \type{\egroup} tokens, so we end up with +%D a multi||step interpretation macro. We look ahead for a +%D \type{\bgroup}, \type{\egroup} or \type{\blankspace}. Being +%D no user of this mechanism, the credits for testing them goes +%D to Tobias Burnus, the first german user of \CONTEXT. +%D +%D We define these macros as \type{\long} because we can +%D expect \type{\par} tokens. We need to look into the future +%D with \type{\futurelet} to prevent spaces from +%D disappearing. + +\def\handlecompoundcharacter#1% + {\def\xhandlecompoundcharacter{\dohandlecompoundcharacter{#1}}% + \futurelet\next\xhandlecompoundcharacter} + +\def\dohandlecompoundcharacter + {\ifx\next\bgroup + %\@EA\dodohandlecompoundcharacter % handle "{ee} -> \"ee + %\@EA\gobbleoneargument % forget "{ee} -> ee + \@EA\handlecompoundcharacterone % ignore "{ee} -> "ee + \else\ifx\next\egroup + \@EAEAEA\donohandlecompoundcharacter + \else\ifx\next\blankspace + \@EA\@EAEAEA\@EA\donohandlecompoundcharacter + \else + \@EA\@EAEAEA\@EA\dodohandlecompoundcharacter + \fi\fi\fi} + +\def\donohandlecompoundcharacter#1{\csname\@nc@\string#1\endcsname} + +\def\dododohandlecompoundcharacter + {\ifx\next\bgroup + \@EA\handlecompoundcharacterone + \else\ifx\next\egroup + \@EAEAEA\handlecompoundcharacterone + \else\ifx\next\blankspace + \@EA\@EAEAEA\@EA\handlecompoundcharacterone + \else + \@EA\@EAEAEA\@EA\handlecompoundcharactertwo + \fi\fi\fi} + +\def\dodohandlecompoundcharacter#1#2% preserve space + {\def\xdodohandlecompoundcharacter{\dododohandlecompoundcharacter#1#2}% + \futurelet\next\xdodohandlecompoundcharacter} + +%D Besides taken care of the grouping and space tokens, we have +%D to deal with three situations. First we look if the next +%D character equals the first one, if so, then we just insert +%D the original. Next we look if indeed a compound character is +%D defined. We either execute the compound character or just +%D insert the first. So we have +%D +%D \starttyping +%D +%D \stoptyping +%D +%D In later modules we will see how these commands are used. + +\long\def\handlecompoundcharacterone#1#2% + {\if\string#1\string#2% was: \ifx#1#2% + \def\next{\csname\@nc@\string#1\endcsname}% + \else\ifcsname\@cc@\string#1\string#2\endcsname + \def\next{\csname\@cc@\string#1\string#2\endcsname}% + \else + \def\next{\csname\@nc@\string#1\endcsname#2}% + \fi\fi + \next} + +\long\def\handlecompoundcharactertwo#1#2#3% + {\if\string#1\string#2% + \def\next{\csname\@nc@\string#1\endcsname#3}% + \else\ifcsname\@cs@\string#1\string#2\string#3\endcsname + \def\next{\csname\@cs@\string#1\string#2\string#3\endcsname}% + \else\ifcsname\@cc@\string#1\string#2\endcsname + \def\next{\csname\@cc@\string#1\string#2\endcsname#3}% + \else + \def\next{\csname\@nc@\string#1\endcsname#2#3}% + \fi\fi\fi + \next} + +%D For very obscure applications (see for an application \type +%D {lang-sla.tex}) we provide: + +\def\simplifiedcompoundcharacter#1#2% + {\ifcsname\@cc@\string#1\string#2\endcsname + \@EA\@EA\@EA\firstofoneargument\csname\@cc@\string#1\string#2\endcsname + \else + #2% + \fi} + +%D \macros +%D {disablediscretionaries,disablecompoundcharacter} +%D +%D Occasionally we need to disable this mechanism. For the +%D moment we assume that \type {|} is used. + +\let\disablediscretionaries \ignorediscretionaries +\let\disablecompoundcharacters\ignorecompoundcharacter + +%D \macros +%D {normalcompound} +%D +%D Handy in for instance XML. (Kind of obsolete) + +\ifx\normalcompound\undefined \let\normalcompound=| \fi + +\protect \endinput diff --git a/tex/context/base/lang-mis.tex b/tex/context/base/lang-mis.tex deleted file mode 100644 index eb7bb1a04..000000000 --- a/tex/context/base/lang-mis.tex +++ /dev/null @@ -1,683 +0,0 @@ -%D \module -%D [ file=lang-mis, -%D version=1997.03.20, % used to be supp-lan.tex -%D title=\CONTEXT\ Language Macros, -%D subtitle=Compounds, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Language Macros / Compounds} - -%D \gdef\starttest -%D {\blank -%D \noindent -%D \halign\bgroup\tt##\hskip2em&##\hskip2em&##\cr} -%D -%D \gdef\stoptest -%D {\egroup -%D \blank} -%D -%D \gdef\test#1% -%D {\defconvertedargument\ascii{#1}\ascii&\hyphenatedword{#1}\cr} - -\unprotect - -%D One of \TEX's strong points in building paragraphs is the way -%D hyphenations are handled. Although for real good hyphenation -%D of non||english languages some extensions to the program are -%D needed, fairly good results can be reached with the standard -%D mechanisms and an additional macro, at least in Dutch. - -%D \CONTEXT\ originates in the wish to typeset educational -%D materials, especially in a technical environment. In -%D production oriented environments, a lot of compound words -%D are used. Because the Dutch language poses no limits on -%D combining words, we often favor putting dashes between those -%D words, because it facilitates reading, at least for those -%D who are not that accustomed to it. -%D -%D In \TEX\ compound words, separated by a hyphen, are not -%D hyphenated at all. In spite of the multiple pass paragraph -%D typesetting this can lead to parts of words sticking into -%D the margin. The solution lays in saying \type -%D {spoelwater||terugwinunit} instead of \type -%D {spoelwater-terugwinunit}. By using a one character command -%D like \type {|}, delimited by the same character \type {|}, -%D we get ourselves both a decent visualization (in \TEXEDIT\ -%D and colored verbatim we color these commands yellow) and an -%D efficient way of combining words. -%D -%D The sequence \type{||} simply leads to two words connected by -%D a hyphen. Because we want to distinguish such a hyphen from -%D the one inserted when \TEX\ hyphenates a word, we use a bit -%D longer one. -%D -%D \hyphenation {spoel-wa-ter te-rug-win-unit} -%D -%D \starttest -%D \test {spoelwater||terugwinunit} -%D \stoptest -%D -%D As we already said, the \type{|} is a command. This commands -%D accepts an optional argument before it's delimiter, which is -%D also a \type{|}. -%D -%D \hyphenation {po-ly-meer che-mie} -%D -%D \starttest -%D \test {polymeer|*|chemie} -%D \stoptest -%D -%D Arguments like \type{*} are not interpreted and inserted -%D directly, in contrary to arguments like: -%D -%D \starttest -%D \test {polymeer|~|chemie} -%D \test {|(|polymeer|)|chemie} -%D \test {polymeer|(|chemie|)| } -%D \stoptest -%D -%D Although such situations seldom occur |<|we typeset thousands -%D of pages before we encountered one that forced us to enhance -%D this mechanism|>| we also have to take care of comma's. -%D -%D \hyphenation {uit-stel-len} -%D -%D \starttest -%D \test {op||, in|| en uitstellen} -%D \stoptest -%D -%D The next special case (concerning quotes) was brought to my -%D attention by Piet Tutelaers, one of the driving forces -%D behind rebuilding hyphenation patterns for the dutch -%D language.\footnote{In 1996 the spelling of the dutch -%D language has been slightly reformed which made this topic -%D actual again.} We'll also take care of this case. -%D -%D \starttest -%D \test {AOW|'|er} -%D \test {cd|'|tje} -%D \test {ex|-|PTT|'|er} -%D \test {rock|-|'n|-|roller} -%D \stoptest -%D -%D Tobias Burnus pointed out that I should also support -%D something like -%D -%D \starttest -%D \test {well|_|known} -%D \stoptest -%D -%D to stress the compoundness of hyphenated words. -%D -%D Of course we also have to take care of the special case: -%D -%D \starttest -%D \test {text||color and ||font} -%D \stoptest - -%D \macros -%D {installdiscretionaries} -%D -%D The mechanism described here is one of the older inner parts -%D of \CONTEXT. The most recent extensions concerns some -%D special cases as well as the possibility to install other -%D characters as delimiters. The prefered way of specifying -%D compound words is using \type{||}, which is installed by: -%D -%D \starttyping -%D \installdiscretionaries || - -%D \stoptyping -%D -%D Some alternative definitions are: -%D -%D \startbuffer -%D \installdiscretionaries ** - -%D \installdiscretionaries ++ - -%D \installdiscretionaries // - -%D \installdiscretionaries ~~ - -%D \stopbuffer -%D -%D \typebuffer -%D -%D after which we can say: -%D -%D \bgroup -%D \getbuffer -%D \starttest -%D \test {test**test**test} -%D \test {test++test++test} -%D \test {test//test//test} -%D \test {test~~test~~test} -%D \stoptest -%D \egroup - -%D \macros -%D {compoundhyphen, -%D beginofsubsentence,endofsubsentence} -%D -%D Now let's go to the macros. First we define some variables. -%D In the main \CONTEXT\ modules these can be tuned by a setup -%D command. Watch the (maybe) better looking compound hyphen. - -\ifx\compoundhyphen \undefined \def\compoundhyphen{\hbox{-\kern-.25ex-}} \fi - -\ifx\beginofsubsentence \undefined \def\beginofsubsentence{\hbox{---}} \fi -\ifx\endofsubsentence \undefined \def\endofsubsentence {\hbox{---}} \fi - -%D The last two variables are needed for subsentences -%D |<|like this one|>| which we did not yet mention. -%D -%D We want to enable breaking but at the same time don't want -%D compound characters like |-| or || to be separated from the -%D words. \TEX\ hackers will recognise the next two macro's: - -\ifx\prewordbreak \undefined \def\prewordbreak {\penalty\plustenthousand\hskip\zeropoint\relax} \fi -%ifx\postwordbreak \undefined \def\postwordbreak{\penalty\zerocount \prewordbreak } \fi -\ifx\postwordbreak \undefined \def\postwordbreak{\penalty\zerocount \hskip\zeropoint\relax} \fi - -\ifx\hspaceamount \undefined \def\hspaceamount#1#2{.16667em} \fi % language specific - -%D \macros -%D {beginofsubsentencespacing,endofsubsentencespacing} -%D -%D In the previous macros we provided two hooks which can be -%D used to support nested sub||sentences. In \CONTEXT\ these -%D hooks are used to insert a small space when needed. - -\ifx\beginofsubsentencespacing\undefined \let\beginofsubsentencespacing\relax \fi -\ifx\endofsubsentencespacing \undefined \let\endofsubsentencespacing \relax \fi - -%D The following piece of code is a torture test compound -%D hndling. The \type {\relax} before the \type {\ifmmode} is -%D needed because of the alignment scanner (in \ETEX\ this -%D problem is not present because there a protected macro is -%D not expanded. Thanks to Tobias Burnus for providing this -%D example. -%D -%D \startformula -%D \left|f(x_n)-{1\over2}\right| = -%D {\cases{|{1\over2}-x_n| &for $0\le x_n < {1\over2}$\cr -%D |x_n-{1\over2}| &for ${1\over2}\zeropoint - (\prewordbreak - \else - \prewordbreak\discretionary{}{(-}{(}\prewordbreak - \fi} - -\definetextmodediscretionary ~ - {\prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak} - -\definetextmodediscretionary ' - {\prewordbreak\discretionary{-}{}{'}\postwordbreak} - -\definetextmodediscretionary ^ - {\prewordbreak\discretionary{\hbox{$|$}}{}{\hbox{$|$}}% - \allowbreak\postwordbreak} % bugged - -\definetextmodediscretionary < - {\beginofsubsentence\prewordbreak\beginofsubsentencespacing} - -\definetextmodediscretionary > - {\endofsubsentencespacing\prewordbreak\endofsubsentence} - -\definetextmodediscretionary = - {\prewordbreak\midsentence\prewordbreak} % {\prewordbreak\compoundhyphen} - -% french - -\definetextmodediscretionary : {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{:}:} -\definetextmodediscretionary ; {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{;};} -\definetextmodediscretionary ? {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{?}?} -\definetextmodediscretionary ! {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{!}!} - -\definetextmodediscretionary * - {\prewordbreak\discretionary{-}{}{\kern.05em}\prewordbreak} - -% spanish - -\definetextmodediscretionary ?? {\prewordbreak\questiondown} -\definetextmodediscretionary !! {\prewordbreak\exclamdown} - -% \ifx\normalcompound\undefined \let\normalcompound=| \fi - -%D \installdiscretionary | + -%D \installdiscretionary + = - -\def\defaultdiscretionaryhyphen{\compoundhyphen} - -\installdiscretionary | \defaultdiscretionaryhyphen % installs in ctx and prt will fall back on it - -%D \macros -%D {fakecompoundhyphen} -%D -%D In headers and footers as well as in active pieces of text -%D we need a dirty hack. Try to imagine what is needed to -%D savely break the next text across a line and at the same -%D time make the words interactive. -%D -%D \starttyping -%D \goto{Some||Long||Word} -%D \stoptyping - -\def\fakecompoundhyphen - {\def\|{\mathortext\vert\dofakecompoundhyphen}} - -\def\dofakecompoundhyphen - {\def##1|% - {\doifelsenothing{##1}\compoundhyphen{##1}% - \kern\compoundbreakpoint\allowbreak}} - -%D \macros -%D {midworddiscretionary} -%D -%D If needed, one can add a discretionary hyphen using \type -%D {\midworddiscretionary}. This macro does the same as -%D \PLAIN\ \TEX's \type {\-}, but, like the ones implemented -%D earlier, this one also looks ahead for spaces and grouping -%D tokens. - -\def\midworddiscretionary - {\futurelet\next\domidworddiscretionary} - -\def\domidworddiscretionary - {\ifx\next\blankspace\else - \ifx\next\bgroup \else - \ifx\next\egroup \else - \discretionary{-}{}{}% - \fi\fi\fi} - -%D \macros -%D {installcompoundcharacter} -%D -%D When Tobias Burnus started translating the dutch manual of -%D \PPCHTEX\ into german, he suggested to let \CONTEXT\ support -%D the \type{german.sty} method of handling compound -%D characters, especially the umlaut. This package is meant for -%D use with \PLAIN\ \TEX\ as well as \LATEX. -%D -%D I decided to implement compound character support as -%D versatile as possible. As a result one can define his own -%D compound character support, like: -%D -%D \starttyping -%D \installcompoundcharacter "a {\"a} -%D \installcompoundcharacter "e {\"e} -%D \installcompoundcharacter "i {\"i} -%D \installcompoundcharacter "u {\"u} -%D \installcompoundcharacter "o {\"o} -%D \installcompoundcharacter "s {\SS} -%D \stoptyping -%D -%D or even -%D -%D \starttyping -%D \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}} -%D \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} -%D \stoptyping -%D -%D The support is not limited to alphabetic characters, so the -%D next definition is also valid. -%D -%D \starttyping -%D \installcompoundcharacter ". {.\doifnextcharelse{\spacetoken}{}{\kern.125em}} -%D \stoptyping -%D -%D The implementation looks familiar and uses the same tricks as -%D mentioned earlier in this module. We take care of two -%D arguments, which complicates things a bit. - -\def\@nc@{@nc@} % normal character -\def\@cc@{@cc@} % compound character -\def\@cs@{@cs@} % compound characters -\def\@cx@{@cx@} % compound definition - -%D When we started working on MK IV code, we needed a different -%D approach for defining the active character itself. In MK II as -%D well as in MK IV we now use the catcode vectors. - -\chardef\compoundcharactermode\plusone - -\def\installcompoundcharacter #1#2#3 #4% {#4} no grouping - {\ifcase\compoundcharactermode - % ignore mode - \else - \chardef\thecompoundcharacter`#1% - \@EA\chardef\csname\@nc@\string#1\endcsname\thecompoundcharacter - \def\!!stringa{#3}% - \@EA\def\csname\ifx\!!stringa\empty\@cc@\else\@cs@\fi\detokenize{#1#2#3}\endcsname{#4}% - \setevalue{\@cx@\detokenize{#1}}{\noexpand\handlecompoundcharacter{\detokenize{#1}}}% beter nr's -% \@EA\letcatcodecommand\@EA\prtcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname -% \@EA\letcatcodecommand\@EA\texcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname - \@EA\letcatcodecommand\@EA\ctxcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname - \fi} - -%D In order to serve the language specific well, we will introduce -%D a namespace: - -% \ifx\currentlanguage\undefined - \let\compoundcharacterclass\empty -% \else -% \def\compoundcharacterclass{\currentlanguage} -% \fi - -\def\@cc@{@cc@\compoundcharacterclass} % compound character -\def\@cs@{@cs@\compoundcharacterclass} % compound characters - -%D We can also ignore definitions (needed in for instance \XML). Beware, -%D this macro is supposed to be used grouped! - -\def\ignorecompoundcharacter - {\chardef\compoundcharactermode\zerocount} - -\let\restorecompoundcharacter \gobbleoneargument % obsolete -\let\enableactivediscretionaries\relax % obsolete - -%D In handling the compound characters we have to take care of -%D \type{\bgroup} and \type{\egroup} tokens, so we end up with -%D a multi||step interpretation macro. We look ahead for a -%D \type{\bgroup}, \type{\egroup} or \type{\blankspace}. Being -%D no user of this mechanism, the credits for testing them goes -%D to Tobias Burnus, the first german user of \CONTEXT. -%D -%D We define these macros as \type{\long} because we can -%D expect \type{\par} tokens. We need to look into the future -%D with \type{\futurelet} to prevent spaces from -%D disappearing. - -\def\handlecompoundcharacter#1% - {\def\xhandlecompoundcharacter{\dohandlecompoundcharacter{#1}}% - \futurelet\next\xhandlecompoundcharacter} - -\def\dohandlecompoundcharacter - {\ifx\next\bgroup - %\@EA\dodohandlecompoundcharacter % handle "{ee} -> \"ee - %\@EA\gobbleoneargument % forget "{ee} -> ee - \@EA\handlecompoundcharacterone % ignore "{ee} -> "ee - \else\ifx\next\egroup - \@EAEAEA\donohandlecompoundcharacter - \else\ifx\next\blankspace - \@EA\@EAEAEA\@EA\donohandlecompoundcharacter - \else - \@EA\@EAEAEA\@EA\dodohandlecompoundcharacter - \fi\fi\fi} - -\def\donohandlecompoundcharacter#1{\csname\@nc@\string#1\endcsname} - -\def\dododohandlecompoundcharacter - {\ifx\next\bgroup - \@EA\handlecompoundcharacterone - \else\ifx\next\egroup - \@EAEAEA\handlecompoundcharacterone - \else\ifx\next\blankspace - \@EA\@EAEAEA\@EA\handlecompoundcharacterone - \else - \@EA\@EAEAEA\@EA\handlecompoundcharactertwo - \fi\fi\fi} - -\def\dodohandlecompoundcharacter#1#2% preserve space - {\def\xdodohandlecompoundcharacter{\dododohandlecompoundcharacter#1#2}% - \futurelet\next\xdodohandlecompoundcharacter} - -%D Besides taken care of the grouping and space tokens, we have -%D to deal with three situations. First we look if the next -%D character equals the first one, if so, then we just insert -%D the original. Next we look if indeed a compound character is -%D defined. We either execute the compound character or just -%D insert the first. So we have -%D -%D \starttyping -%D -%D \stoptyping -%D -%D In later modules we will see how these commands are used. - -\long\def\handlecompoundcharacterone#1#2% - {\if\string#1\string#2% was: \ifx#1#2% - \def\next{\csname\@nc@\string#1\endcsname}% - \else\ifcsname\@cc@\string#1\string#2\endcsname - \def\next{\csname\@cc@\string#1\string#2\endcsname}% - \else - \def\next{\csname\@nc@\string#1\endcsname#2}% - \fi\fi - \next} - -\long\def\handlecompoundcharactertwo#1#2#3% - {\if\string#1\string#2% - \def\next{\csname\@nc@\string#1\endcsname#3}% - \else\ifcsname\@cs@\string#1\string#2\string#3\endcsname - \def\next{\csname\@cs@\string#1\string#2\string#3\endcsname}% - \else\ifcsname\@cc@\string#1\string#2\endcsname - \def\next{\csname\@cc@\string#1\string#2\endcsname#3}% - \else - \def\next{\csname\@nc@\string#1\endcsname#2#3}% - \fi\fi\fi - \next} - -%D For very obscure applications (see for an application \type -%D {lang-sla.tex}) we provide: - -\def\simplifiedcompoundcharacter#1#2% - {\ifcsname\@cc@\string#1\string#2\endcsname - \@EA\@EA\@EA\firstofoneargument\csname\@cc@\string#1\string#2\endcsname - \else - #2% - \fi} - -%D \macros -%D {disablediscretionaries,disablecompoundcharacter} -%D -%D Occasionally we need to disable this mechanism. For the -%D moment we assume that \type {|} is used. - -\let\disablediscretionaries \ignorediscretionaries -\let\disablecompoundcharacters\ignorecompoundcharacter - -%D \macros -%D {normalcompound} -%D -%D Handy in for instance XML. (Kind of obsolete) - -\ifx\normalcompound\undefined \let\normalcompound=| \fi - -\protect \endinput diff --git a/tex/context/base/lang-run.mkii b/tex/context/base/lang-run.mkii new file mode 100644 index 000000000..4b332cfb9 --- /dev/null +++ b/tex/context/base/lang-run.mkii @@ -0,0 +1,36 @@ +%D \module +%D [ file=lang-run, +%D version=2005.09.08, +%D title=\CONTEXT\ Language Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 code is hooked into the core macros and saves some +%D format space.] + +\unprotect + +\gdef\showpatterns + {\bgroup + \def\doshowpatterns##1##2##3##4% language number encoding mapping + {\NC##1\NC##3\NC##4\NC##2\NC + \specificlanguageparameter{##1}\s!lefthyphenmin \NC + \specificlanguageparameter{##1}\s!righthyphenmin\NC\NR}% + \starttabulate[|c|c|c|c|c|c|] + \HL + \NC \bf language \NC \bf encoding \NC \bf mapping \NC \bf number \NC + \bf left\low{min} \NC + \bf right\low{min} \NC \NR + \HL + \preloadedpmessage + \HL + \stoptabulate + \egroup} + +\protect \endinput diff --git a/tex/context/base/lang-run.tex b/tex/context/base/lang-run.tex deleted file mode 100644 index 4b332cfb9..000000000 --- a/tex/context/base/lang-run.tex +++ /dev/null @@ -1,36 +0,0 @@ -%D \module -%D [ file=lang-run, -%D version=2005.09.08, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Runtime Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 code is hooked into the core macros and saves some -%D format space.] - -\unprotect - -\gdef\showpatterns - {\bgroup - \def\doshowpatterns##1##2##3##4% language number encoding mapping - {\NC##1\NC##3\NC##4\NC##2\NC - \specificlanguageparameter{##1}\s!lefthyphenmin \NC - \specificlanguageparameter{##1}\s!righthyphenmin\NC\NR}% - \starttabulate[|c|c|c|c|c|c|] - \HL - \NC \bf language \NC \bf encoding \NC \bf mapping \NC \bf number \NC - \bf left\low{min} \NC - \bf right\low{min} \NC \NR - \HL - \preloadedpmessage - \HL - \stoptabulate - \egroup} - -\protect \endinput diff --git a/tex/context/base/lang-sla.tex b/tex/context/base/lang-sla.tex index 0832e3f46..cd3c75b61 100644 --- a/tex/context/base/lang-sla.tex +++ b/tex/context/base/lang-sla.tex @@ -184,28 +184,6 @@ \installlanguage [cz] [\s!cs] -% If this is really needed we should make an enco-fhr. -% -% \startlanguagespecifics[\s!hr] -% -% %\installcompoundcharacter /, {\handlequotation\c!leftquotation} -% %\installcompoundcharacter /' {\handlequotation\c!rightquotation} -% -% \def\setupHRlanguage% -% {\setuplanguage -% [\s!hr] -% [\c!leftsentence=\leftguillemot, -% \c!rightsentence=\rightguillemot, -% \c!leftsubsentence=\leftsubguillemot, -% \c!rightsubsentence=\rightsubguillemot]} -% -% \installcompoundcharacter /< {{\setupHRlanguage|<|}} -% \installcompoundcharacter /> {{\setupHRlanguage|>|}} -% -% \installcompoundcharacter /- {|-|} -% -% \stoplanguagespecifics - % labels \setupheadtext [\s!pl] [\v!content=Spis tre\sacute ci] diff --git a/tex/context/base/lang-spe.mkiv b/tex/context/base/lang-spe.mkiv deleted file mode 100644 index 6f32888e6..000000000 --- a/tex/context/base/lang-spe.mkiv +++ /dev/null @@ -1,111 +0,0 @@ -%D \module -%D [ file=lang-spe, -%D version=2002.05.07, % 1996.01.25, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Specifics, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Specifics} - -%D In \MKIV\ we will get away from this feature. See \MKII\ file -%D for comments. So, consider this a temporary feature. - -\unprotect - -%D \macros -%D {everyresetlanguagespecifics,resetlanguagespecifics} -%D -%D Cleanup macros. - -\newevery \everyresetlanguagespecifics \relax - -\def\resetlanguagespecifics - {\ifcase\protectionlevel - \the\everyresetlanguagespecifics - \fi} - -\appendtoks - \resetlanguagespecifics -\to \everycleanupfeatures - -%D \macros -%D {startlanguagespecifics,enablelanguagespecifics} - -\def\startlanguagespecifics - {\bgroup - \catcode`\^^I=\@@ignore - \catcode`\^^M=\@@ignore - \catcode`\^^L=\@@ignore - \dodoubleempty\dostartlanguagespecifics} % get rid of spaces - -\long\def\dostartlanguagespecifics[#1][#2]#3\stoplanguagespecifics - {\egroup - \processcommalist[#1]{\dosetlanguagespecifics{#3}}} - -\long\def\dosetlanguagespecifics#1#2% specifics language - {\ifcsname\??la#2\??la\endcsname \else - \expandafter\newtoks\csname\??la#2\??la\endcsname - \fi - \csname\??la#2\??la\endcsname\@EA{\the\csname\??la#2\??la\endcsname#1}% - \bgroup - \setbox\scratchbox\hbox{\enablelanguagespecifics[#2]}% - \ifdim\wd\scratchbox>\zeropoint - \showmessage\m!linguals7{#2,\the\wd\scratchbox\space}\wait - \else - \showmessage\m!linguals8{#2}% - \fi - \egroup - \doif{#2}\currentmainlanguage{\enablelanguagespecifics[#2]}} - -\def\forgetlanguagespecifics[#1]% - {\ifcsname\??la#1\??la\endcsname - \csname\??la#1\??la\endcsname\emptytoks - \fi} - -% \def\enablelanguagespecifics[#1]% no default language fallback (yet) -% {\ifcsname\??la#1\??la\endcsname -% \the\csname\??la#1\??la\endcsname\relax -% \fi} - -\def\enablelanguagespecifics[#1]% - {\edef\askedlanguagespecificslanguage{\defaultlanguage{#1}}% - \ifcsname\??la\askedlanguagespecificslanguage\??la\endcsname - \the\csname\??la\askedlanguagespecificslanguage\??la\endcsname - \fi} - -%D \macros -%D {ordinaldaynumber, highordinalstr, ordinalstr} -%D -%D Efficient general ordinal number converters are sometimes -%D difficult to implement. Fortunately dates never exceed the -%D number~31. - -\ifx\high \undefined \let\high \firstofoneargument \fi % todo -\ifx\notsmallcapped\undefined \let\notsmallcapped\firstofoneargument \fi % todo - -\def\highordinalstr#1{\high{\notsmallcapped{#1}}} -\def\ordinalstr #1{\notsmallcapped{#1}} - -\def\ordinaldaynumber#1% \strippedcsname\ordinaldaynumber - {\expanded{\executeifdefined{\currentlanguage ordinaldaynumber}% - \noexpand\firstofoneargument{\number#1}}} - -%D Language specific converters have definitions like: -%D -%D \starttyping -%D \def\enordinaldaynumber#1{...} -%D \stoptyping -%D -%D Examples can be found in the other \type {lang} modules. - -\appendtoks - \ifprocessingXML \else \resetlanguagespecifics \fi -\to \everylanguage - -\protect \endinput diff --git a/tex/context/base/lpdf-ano.lua b/tex/context/base/lpdf-ano.lua new file mode 100644 index 000000000..4f136ad79 --- /dev/null +++ b/tex/context/base/lpdf-ano.lua @@ -0,0 +1,573 @@ +if not modules then modules = { } end modules ['lpdf-ano'] = { + version = 1.001, + comment = "companion to lpdf-ini.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local tostring, format, rep = tostring, string.rep, string.format +local texcount = tex.count + +local trace_references = false trackers.register("references.references", function(v) trace_references = v end) +local trace_destinations = false trackers.register("references.destinations", function(v) trace_destinations = v end) +local trace_bookmarks = false trackers.register("references.bookmarks", function(v) trace_bookmarks = v end) + +local variables = interfaces.variables +local constants = interfaces.constants + +local nodeinjections = backends.pdf.nodeinjections +local codeinjections = backends.pdf.codeinjections +local registrations = backends.pdf.registrations + +jobreferences = jobreferences or { } +jobreferences.runners = jobreferences.runners or { } +jobreferences.specials = jobreferences.specials or { } +jobreferences.handlers = jobreferences.handlers or { } +jobreferences.executers = jobreferences.executers or { } + +local runners = jobreferences.runners +local specials = jobreferences.specials +local handlers = jobreferences.handlers +local executers = jobreferences.executers + +local pdfdictionary = lpdf.dictionary +local pdfarray = lpdf.array +local pdfreference = lpdf.reference +local pdfunicode = lpdf.unicode +local pdfconstant = lpdf.constant + +local pdfreserveobj = pdf.reserveobj +local pdfimmediateobj = pdf.immediateobj +local pdfpageref = tex.pdfpageref + +local pdfannot = nodes.pdfannot +local pdfdest = nodes.pdfdest + +local pdf_uri = pdfconstant("URI") +local pdf_gotor = pdfconstant("GoToR") +local pdf_goto = pdfconstant("GoTo") +local pdf_launch = pdfconstant("Launch") +local pdf_javascript = pdfconstant("JavaScript") +local pdf_link = pdfconstant("Link") +local pdf_n = pdfconstant("N") +local pdf_t = pdfconstant("T") +local pdf_border = pdfarray { 0, 0, 0 } + +local cache = { } + +local function pagedest(n) + local pd = cache[n] + if not pd then + local a = pdfarray { + pdfreference(pdfpageref(n)), + pdfconstant("Fit") + } + pd = pdfreference(pdfimmediateobj(tostring(a))) + cache[n] = pd + end + return pd +end + +lpdf.pagedest = pagedest + +local function link(url,filename,destination,page,actions) + if filename and filename ~= "" then + if file.basename(filename) == tex.jobname then + return false + else + filename = file.addsuffix(filename,"pdf") + end + end + if url and url ~= "" then + if filename and filename ~= "" then + if destination and destination ~= "" then + url = file.join(url,filename).."#"..destination + else + url = file.join(url,filename) + end + end + return pdfdictionary { + S = pdf_uri, + URI = url, + } + elseif filename and filename ~= "" then + return pdfdictionary { + S = pdf_gotor, + F = pdffile, + D = destination and destination ~= "" and destination, + NewWindow = (actions.newwindow and true) or nil, + } + elseif destination and destination ~= "" then + local realpage, p = texcount.realpageno, tonumber(page) + if not p then + -- sorry + elseif p > realpage then + texcount.referencepagestate = 3 + elseif p < realpage then + texcount.referencepagestate = 2 + else + texcount.referencepagestate = 1 + end + return pdfdictionary { + S = pdf_goto, + D = destination, + } + elseif page and page ~= "" then + local realpage, p = texcount.realpageno, tonumber(page) + if p then + if p > realpage then + texcount.referencepagestate = 3 + elseif p < realpage then + texcount.referencepagestate = 2 + else + texcount.referencepagestate = 1 + end + return pdfdictionary { + S = pdf_goto, + D = pagedest(p), + } + else + commands.writestatus("references","invalid page reference: %s",page or "?") + end + end + return false +end + +lpdf.link = link + +function lpdf.launch(program,parameters) + if program and program ~= "" then + local d = pdfdictionary { + S = pdf_launch, + F = program, + D = ".", + } + if parameters and parameters ~= "" then + d.P = parameters + end + return d + end +end + +function lpdf.javascript(name,arguments) + local script = javascripts.code(name,arguments) -- make into object (hash) + if script then + return pdfdictionary { + S = pdf_javascript, + JS = script, + } + end +end + +local function pdfaction(actions) + local nofactions = #actions + texcount.referencepagestate = 0 -- goodie, as we do all in the backend, we need to set it here too + if nofactions > 0 then + local a = actions[1] + local action = runners[a.kind] + if action then + action = action(a,actions) + end + if action then + local first = action + for i=2,nofactions do + local a = actions[i] + local what = runners[a.kind] + if what then + what = what(a,actions) + end + if what then + action.next = what + action = what + else + -- error + return nil + end + end + return first + end + end +end + +lpdf.pdfaction = pdfaction + +function codeinjections.prerollreference(actions) + local main = actions and pdfaction(actions) + if main then + main = pdfdictionary { + Subtype = pdf_link, + Border = pdf_border, + H = (not actions.highlight and pdf_n) or nil, + A = main, + -- does not work at all in spite of specification + -- OC = (actions.layer and lpdf.layerreferences[actions.layer]) or nil, + -- OC = backends.pdf.layerreference(actions.layer), + } + return main("A") -- todo: cache this, maybe weak + end +end + +-- local cache = { } -- no real gain in thsi +-- +-- function codeinjections.prerollreference(actions) +-- local main = actions and pdfaction(actions) +-- if main then +-- main = pdfdictionary { +-- Subtype = pdf_link, +-- Border = pdf_border, +-- H = (not actions.highlight and pdf_n) or nil, +-- A = main, +-- } +-- local cm = cache[main] +-- if not cm then +-- cm = "/A ".. tostring(pdfreference(pdfimmediateobj(tostring(main)))) +-- cache[main] = cm +-- end +-- return cm +-- end +-- end + +function nodeinjections.reference(width,height,depth,prerolled) + if prerolled then + if swapdir then + width = - width + end + if trace_references then + logs.report("references","w=%s, h=%s, d=%s, a=%s",width,height,depth,prerolled) + end + return pdfannot(width,height,depth,prerolled) + end +end + +function nodeinjections.destination(width,height,depth,name,view) + if swapdir then + width = - width + end + if trace_destinations then + logs.report("destinations","w=%s, h=%s, d=%s, n=%s, v=%s",width,height,depth,name,view or "no view") + end + return pdfdest(width,height,depth,name,view) +end + +-- runners and specials + +local method = "internal" + +runners["inner"] = function(var,actions) + if method == "internal" then + local vir = var.i.references + local internal = vir and vir.internal + if internal then + var.inner = "aut:"..internal + end + end + return link(nil,nil,var.inner,var.r,actions) +end + +runners["inner with arguments"] = function(var,actions) + return false +end + +runners["outer"] = function(var,actions) + return link(nil,var.o,nil,nil,actions) -- var.o ? +end + +runners["outer with inner"] = function(var,actions) + -- todo: resolve url/file name + return link(nil,var.f,var.inner,var.r,actions) +end + +runners["special outer with operation"] = function(var,actions) + return false +end + +runners["special outer"] = function(var,actions) + return false +end + +runners["special"] = function(var,actions) + local handler = specials[var.special] + return handler and handler(var,actions) +end + +runners["outer with inner with arguments"] = function(var,actions) + return false +end + +runners["outer with special and operation and arguments"] = function(var,actions) + return false +end + +runners["outer with special"] = function(var,actions) + return false +end + +runners["outer with special and operation"] = function(var,actions) + return false +end + +runners["special operation"] = runners["special"] +runners["special operation with arguments"] = runners["special"] + +function specials.internal(var,actions) + local i = tonumber(var.operation) + local v = jobreferences.internals[i] + if not v then + -- error + elseif method == "internal" then + -- named + return link(nil,nil,"aut:"..i,v.references.realpage,actions) + else + -- page + return link(nil,nil,nil,v.references.realpage,actions) + end +end + +specials.i = specials.internal + +function specials.page(var,actions) + local p = jobreferences.pages[var.operation] + if type(p) == "function" then + p = p() + end + return link(nil,nil,nil,p or var.operation,actions) +end + +function specials.url(var,actions) + local url = var.operation + if url then + local u = urls[url] + if u then + local u, f = u[1], u[2] + if f and f ~= "" then + url = u .. "/" .. f + else + url = u + end + end + end + return link(url,nil,var.arguments,nil,actions) +end + +function specials.file(var,actions) + local file = var.operation + if file then + local f = files[file] + if f then + file = f[1] + end + end + return link(nil,file,var.arguments,nil,actions) +end + +function specials.program(var,content) + local program = var.operation + if program then + local p = programs[program] + if p then + program = p[1] + end + end + return lpdf.launch(program,var.arguments) +end + +function specials.javascript(var) + return lpdf.javascript(var.operation,var.arguments) +end + +specials.JS = specials.javascript + +local pdf_named = pdfconstant("Named") + +executers.importform = pdfdictionary { S = pdf_named, N = pdfconstant("AcroForm:ImportFDF") } +executers.exportform = pdfdictionary { S = pdf_named, N = pdfconstant("AcroForm:ExportFDF") } +executers.first = pdfdictionary { S = pdf_named, N = pdfconstant("FirstPage") } +executers.previous = pdfdictionary { S = pdf_named, N = pdfconstant("PrevPage") } +executers.next = pdfdictionary { S = pdf_named, N = pdfconstant("NextPage") } +executers.last = pdfdictionary { S = pdf_named, N = pdfconstant("LastPage") } +executers.backward = pdfdictionary { S = pdf_named, N = pdfconstant("GoBack") } +executers.forward = pdfdictionary { S = pdf_named, N = pdfconstant("GoForward") } +executers.print = pdfdictionary { S = pdf_named, N = pdfconstant("Print") } +executers.exit = pdfdictionary { S = pdf_named, N = pdfconstant("Quit") } +executers.close = pdfdictionary { S = pdf_named, N = pdfconstant("Close") } +executers.save = pdfdictionary { S = pdf_named, N = pdfconstant("Save") } +executers.savenamed = pdfdictionary { S = pdf_named, N = pdfconstant("SaveAs") } +executers.opennamed = pdfdictionary { S = pdf_named, N = pdfconstant("Open") } +executers.help = pdfdictionary { S = pdf_named, N = pdfconstant("HelpUserGuide") } +executers.toggle = pdfdictionary { S = pdf_named, N = pdfconstant("FullScreen") } +executers.search = pdfdictionary { S = pdf_named, N = pdfconstant("Find") } +executers.searchagain = pdfdictionary { S = pdf_named, N = pdfconstant("FindAgain") } +executers.gotopage = pdfdictionary { S = pdf_named, N = pdfconstant("GoToPage") } +executers.query = pdfdictionary { S = pdf_named, N = pdfconstant("AcroSrch:Query") } +executers.queryagain = pdfdictionary { S = pdf_named, N = pdfconstant("AcroSrch:NextHit") } +executers.fitwidth = pdfdictionary { S = pdf_named, N = pdfconstant("FitWidth") } +executers.fitheight = pdfdictionary { S = pdf_named, N = pdfconstant("FitHeight") } + +local function fieldset(arguments) + -- [\dogetfieldset{#1}] + return nil +end + +function executers.resetform(arguments) + arguments = (type(arguments) == "table" and arguments) or aux.settings_to_array(arguments) + return pdfdictionary { + S = pdfconstant("ResetForm"), + Field = fieldset(arguments[1]) + } +end + +local formmethod = "post" -- "get" "post" +local formformat = "xml" -- "xml" "html" "fdf" + +-- bit 3 = html bit 6 = xml bit 4 = get + +local flags = { + get = { + html = 12, fdf = 8, xml = 40, + }, + post = { + html = 4, fdf = 0, xml = 32, + } +} + +function executers.submitform(arguments) + arguments = (type(arguments) == "table" and arguments) or aux.settings_to_array(arguments) + local flag = flags[formmethod] or flags.post + flag = (flag and (flag[formformat] or flag.xml)) or 32 -- default: post, xml + return pdfdictionary { + S = pdfconstant("ResetForm"), + F = fieldset(arguments[1]), + Field = fieldset(arguments[2]), + Flags = flag, + -- \PDFsubmitfiller + } +end + +function executers.hide(arguments) + return pdfdictionary { + S = pdfconstant("Hide"), + H = true, + T = arguments, + } +end + +function executers.show(arguments) + return pdfdictionary { + S = pdfconstant("Hide"), + H = false, + T = arguments, + } +end + +local pdf_movie = pdfconstant("Movie") +local pdf_start = pdfconstant("Start") +local pdf_stop = pdfconstant("Stop") +local pdf_resume = pdfconstant("Resume") +local pdf_pause = pdfconstant("Pause") + +local function movie_or_sound(operation,arguments) + arguments = (type(arguments) == "table" and arguments) or aux.settings_to_array(arguments) + return pdfdictionary { + S = pdf_movie, + T = format("movie %s",arguments[1] or "noname"), + Operation = operation, + } +end + +function executers.startmovie (arguments) return movie_or_sound(pdf_start ,arguments) end +function executers.stopmovie (arguments) return movie_or_sound(pdf_stop ,arguments) end +function executers.resumemovie(arguments) return movie_or_sound(pdf_resume,arguments) end +function executers.pausemovie (arguments) return movie_or_sound(pdf_pause ,arguments) end + +function executers.startsound (arguments) return movie_or_sound(pdf_start ,arguments) end +function executers.stopsound (arguments) return movie_or_sound(pdf_stop ,arguments) end +function executers.resumesound(arguments) return movie_or_sound(pdf_resume,arguments) end +function executers.pausesound (arguments) return movie_or_sound(pdf_pause ,arguments) end + +function specials.action(var) + local operation = var.operation + if var.operation and operation ~= "" then + local e = executers[operation] + if type(e) == "table" then + return e + elseif type(e) == "function" then + return e(var.arguments) + end + end +end + +--~ entry.A = pdfdictionary { +--~ S = pdfconstant("GoTo"), +--~ D = .... +--~ } + +local function build(levels,start,parent,method) + local startlevel = levels[start][1] + local i, n = start, 0 + local child, entry, m, prev, first, last, f, l +-- to be tested: i can be nil + while i and i <= #levels do + local li = levels[i] + local level, title, reference, open = li[1], li[2], li[3], li[4] + if level == startlevel then + if trace_bookmarks then + logs.report("bookmark","%3i %s%s %s",realpage,rep(" ",level-1),(open and "+") or "-",title) + end + local prev = child + child = pdfreserveobj() + if entry then + entry.Next = child and pdfreference(child) + pdfimmediateobj(prev,tostring(entry)) + end + entry = pdfdictionary { + Title = pdfunicode(title), + Parent = parent, + Prev = prev and pdfreference(prev), + } + if method == "internal" then + entry.Dest = "aut:" .. reference.internal + else -- if method == "page" then + entry.Dest = pagedest(reference.realpage) + end + if not first then first, last = child, child end + prev = child + last = prev + n = n + 1 + i = i + 1 + elseif level < startlevel then + pdfimmediateobj(child,tostring(entry)) + return i, n, first, last + elseif i < #levels and level > startlevel then + i, m, f, l = build(levels,i,pdfreference(child),method) + entry.Count = (open and m) or -m + if m > 0 then + entry.First, entry.Last = pdfreference(f), pdfreference(l) + end + else + -- missing intermediate level but ok + i, m, f, l = build(levels,i,pdfreference(child),method) + entry.Count = (open and m) or -m + if m > 0 then + entry.First, entry.Last = pdfreference(f), pdfreference(l) + end + pdfimmediateobj(child,tostring(entry)) + return i, n, first, last + end + end + pdfimmediateobj(child,tostring(entry)) + return _, n, first, last +end + +function codeinjections.addbookmarks(levels,method) + local parent = pdfreserveobj() + local _, m, first, last = build(levels,1,pdfreference(parent),method or "internal") + local dict = pdfdictionary { + Type = pdfconstant("Outlines"), + First = pdfreference(first), + Last = pdfreference(last), + Count = m, + } + pdfimmediateobj(parent,tostring(dict)) + lpdf.addtocatalog("Outlines",lpdf.reference(parent)) +end diff --git a/tex/context/base/lpdf-col.lua b/tex/context/base/lpdf-col.lua new file mode 100644 index 000000000..219188369 --- /dev/null +++ b/tex/context/base/lpdf-col.lua @@ -0,0 +1,150 @@ +if not modules then modules = { } end modules ['lpdf-mis'] = { + version = 1.001, + comment = "companion to back-pdf.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local type = type +local format, gsub = string.format, string.gsub + +-- colors = colors or { } +-- transparencies = transparencies or { } + +local registercolor = colors.register +local registertransparancy = transparencies.register +local colorsvalue = colors.value +local transparenciesvalue = transparencies.value + +-- Literals needed to inject code in the mp stream, we cannot use attributes there +-- since literals may have qQ's, much may go away once we have mplib code in place. +-- +-- This module assumes that some functions are defined in the colors namespace +-- which mostlikely will be loaded later. + +function lpdf.color(model,ca,default) -- todo: use gray when no color + local cv = colorsvalue(ca) + if cv then + if model == 1 then + model = cv[1] + end + if model == 2 then + local s = cv[2] + return format("%s g %s G",s,s) + elseif model == 3 then + local r, g, b = cv[3], cv[4], cv[5] + return format("%s %s %s rg %s %s %s RG",r,g,b,r,g,b) + elseif model == 4 then + local c, m, y, k = cv[6],cv[7],cv[8],cv[9] + return format("%s %s %s %s k %s %s %s %s K",c,m,y,k,c,m,y,k) + else + local n,f,d,p = cv[10],cv[11],cv[12],cv[13] + if type(p) == "string" then + p = gsub(p,","," ") -- brr misuse of spot + end + return format("/%s cs /%s CS %s SCN %s scn",n,n,p,p) + end + else + return format("%s g %s G",default or 0,default or 0) + end +end + +function lpdf.transparency(ct,default) + -- beware, we need this hack because normally transparencies are not + -- yet registered and therefore the number is not not known ... we + -- might use the attribute number itself in the future + local ct = transparenciesvalue(ct) + if ct then + return format("/Tr%s gs",registertransparancy(nil,ct[1],ct[2])) + else + return "/Tr0 gs" + end +end + +function lpdf.colorvalue(model,ca,default) + local cv = colorsvalue(ca) + if cv then + if model == 1 then + model = cv[1] + end + if model == 2 then + return format("%s",cv[2]) + elseif model == 3 then + return format("%s %s %s",cv[3],cv[4],cv[5]) + elseif model == 4 then + return format("%s %s %s %s",cv[6],cv[7],cv[8],cv[9]) + else + return format("%s",cv[13]) + end + else + return format("%s",default or 0) + end +end + +function lpdf.fdfcolor(model,ca,default) + local cv = colorsvalue(ca) + if cv then + if model == 1 then + model = cv[1] + end + if model == 2 then + return format("[%s]",cv[2]) + elseif model == 3 then + return format("[%s %s %s]",cv[3],cv[4],cv[5]) + elseif model == 4 then + return format("[%s %s %s %s]",cv[6],cv[7],cv[8],cv[9]) + elseif model == 4 then + return format("[%s]",cv[13]) + end + else + return format("[%s]",default or 0) + end +end + +function lpdf.colorspace(model,ca) + local cv = colorsvalue(ca) + if cv then + if model == 1 then + model = cv[1] + end + if model == 2 then + return "DeviceGray" + elseif model == 3 then + return "DeviceRGB" + elseif model == 4 then + return "DeviceCMYK" + end + end + return "DeviceGRAY" +end + +-- by registering we getconversion for free (ok, at the cost of overhead) + +local intransparency = false +local pdfcolor = lpdf.color + +function lpdf.rgbcode(model,r,g,b) + return pdfcolor(model,registercolor('color',nil,'rgb',r,g,b)) +end +function lpdf.cmykcode(model,c,m,y,k) + return pdfcolor(model,registercolor('color',nil,'cmyk',c,m,y,k)) +end +function lpdf.graycode(model,s) + return pdfcolor(model,registercolor('color',nil,'gray',s)) +end +function lpdf.spotcode(model,n,f,d,p) + return pdfcolor(model,registercolor('color',nil,'spot',n,f,d,p)) -- incorrect +end +function lpdf.transparencycode(a,t) + intransparency = true + return format("/Tr%s gs",registertransparancy(nil,a,t)) +end +function lpdf.finishtransparencycode() + if intransparency then + intransparency = false + return "/Tr0 gs" -- we happen to know this -) + else + return "" + end +end diff --git a/tex/context/base/lpdf-fld.lua b/tex/context/base/lpdf-fld.lua new file mode 100644 index 000000000..b9c63347f --- /dev/null +++ b/tex/context/base/lpdf-fld.lua @@ -0,0 +1,747 @@ +if not modules then modules = { } end modules ['lpdf-fld'] = { + version = 1.001, + comment = "companion to lpdf-ini.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- cleaned up, e.g. no longer older viewers +-- always kids so no longer explicit main / clone / copy +-- some optimizations removed (will come bakc if needed) + +local gmatch, lower, format = string.gmatch, string.lower, string.format + +local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes + +local variables = interfaces.variables + +local nodeinjections = backends.pdf.nodeinjections +local codeinjections = backends.pdf.codeinjections +local registrations = backends.pdf.registrations + +local registeredsymbol = codeinjections.registeredsymbol + +local pdfstream = lpdf.stream +local pdfdictionary = lpdf.dictionary +local pdfarray = lpdf.array +local pdfreference = lpdf.reference +local pdfunicode = lpdf.unicode +local pdfstring = lpdf.string +local pdfconstant = lpdf.constant +local pdftoeight = lpdf.toeight + +local pdfimmediateobj = pdf.immediateobj +local pdfreserveobj = pdf.reserveobj + +local submitoutputformat = 0 -- 0=unknown 1=HTML 2=FDF 3=XML => not yet used, needs to be checked + +local splitter = lpeg.splitat("=>") + +local formats = { + html = 1, fdf = 2, xml = 3, +} + +function codeinjections.setformsmethod(name) + submitoutputformat = formats[lower(name)] or 3 +end + +local flag = { + MultiLine = 4096, -- 13 + NoToggleToOff = 16384, -- 15 + Radio = 32768, -- 16 + PushButton = 65536, -- 17 + PopUp = 131072, -- 18 + Edit = 262144, -- 19 + RadiosInUnison = 33554432, -- 26 + DoNotSpellCheck = 4194304, -- 23 + DoNotScroll = 8388608, -- 24 + ReadOnly = 1, -- 1 + Required = 2, -- 2 + NoExport = 4, -- 3 + Password = 8192, -- 14 + Sort = 524288, -- 20 + FileSelect = 1048576, -- 21 +} + +local plus = { + Invisible = 1, -- 1 + Hidden = 2, -- 2 + Printable = 4, -- 3 + NoView = 32, -- 6 + ToggleNoView = 256, -- 9 + AutoView = 256, -- 288 (6+9) +} + +flag.readonly = flag.ReadOnly +flag.required = flag.Required +flag.protected = flag.Password +flag.sorted = flag.Sort +flag.unavailable = flag.NoExport +flag.nocheck = flag.DoNotSpellCheck +flag.fixed = flag.DoNotScroll +flag.file = flag.FileSelect + +plus.hidden = plus.Hidden +plus.printable = plus.Printable +plus.auto = plus.AutoView + +-- some day .. lpeg with function + +local function fieldflag(specification) + local o, n = specification.options, 0 + if o and o ~= "" then + for f in gmatch(o,"[^, ]+") do + n = n + (flag[f] or 0) + end + end + return n +end + +local function fieldplus(specification) + local o, n = specification.options, 0 + if o and o ~= "" then + for p in gmatch(o,"[^, ]") do + n = n + (plus[p] or 0) + end + end + return n +end + + +local function checked(what) + if what and what ~= "" then + local set, bug = jobreferences.identify("",what) + return not bug and #set > 0 and lpdf.pdfaction(set) + end +end + +local function fieldactions(specification) -- share actions + local d, a = { }, nil + a = specification.mousedown if a and a ~= "" then d.D = checked(a) end + a = specification.mouseup if a and a ~= "" then d.U = checked(a) end + a = specification.enterregion if a and a ~= "" then d.E = checked(a) end + a = specification.exitregion if a and a ~= "" then d.X = checked(a) end + a = specification.afterkeystroke if a and a ~= "" then d.K = checked(a) end + a = specification.formatresult if a and a ~= "" then d.F = checked(a) end + a = specification.validateresult if a and a ~= "" then d.V = checked(a) end + a = specification.calculatewhatever if a and a ~= "" then d.C = checked(a) end + a = specification.focusin if a and a ~= "" then d.Fo = checked(a) end + a = specification.focusout if a and a ~= "" then d.Bl = checked(a) end + -- a = specification.openpage if a and a ~= "" then d.PO = checked(a) end + -- a = specification.closepage if a and a ~= "" then d.PC = checked(a) end + -- a = specification.visiblepage if a and a ~= "" then d.PV = checked(a) end + -- a = specification.invisiblepage if a and a ~= "" then d.PI = checked(a) end + return next(d) and pdfdictionary(d) +end + +-- fonts and color + +local fontnames = { + rmtf = "Times-Roman", rmbf = "Times-Bold", + rmit = "Times-Italic", rmsl = "Times-Italic", + rmbi = "Times-BoldItalic", rmbs = "Times-BoldItalic", + sstf = "Helvetica", ssbf = "Helvetica-Bold", + ssit = "Helvetica-Oblique", sssl = "Helvetica-Oblique", + ssbi = "Helvetica-BoldOblique", ssbs = "Helvetica-BoldOblique", + tttf = "Courier", ttbf = "Courier-Bold", + ttit = "Courier-Oblique", ttsl = "Courier-Oblique", + ttbi = "Courier-BoldOblique", ttbs = "Courier-BoldOblique", +} + +local usedfonts = { } + +local function fieldsurrounding(specification) + local tag = (specification.fontstyle or "tt") .. (specification.fontalternative or "tf") + if not fontnames[tag] then + tag = "tttf" + end + local size = specification.fontsize + local stream = pdfstream { + pdfconstant(tag), + format("%s Tf",(size and (number.dimenfactors.bp * size)) or 12), + } + usedfonts[tag] = true + -- add color to stream: 0 g + -- move up with "x.y Ts" + return tostring(stream) +end + +local function registerfonts() + if next(usedfonts) then + local d = pdfdictionary() + for tag, _ in next, usedfonts do + local f = pdfdictionary { + Type = pdfconstant("Font"), + Subtype = pdfconstant("Type1"), -- todo + Name = pdfconstant(tag), + BaseFont = pdfconstant(fontnames[tag]), + } + d[tag] = pdfreference(pdfimmediateobj(tostring(f))) + end + return d + end +end + +-- cache + +local function fieldattributes(specification) +--~ return pdfarray { +--~ -- BG = -- backgroundcolor +--~ -- BC = -- framecolor +--~ } + return nil +end + +-- symbols + +local function fieldappearances(specification) + -- todo: caching + local values = specification.values + local default = specification.default + if not values then + -- error + return + end + local v = aux.settings_to_array(values) + local n, r, d + if #v == 1 then + n, r, d = v[1], v[1], v[1] + elseif #v == 2 then + n, r, d = v[1], v[1], v[2] + else + n, r, d = v[1], v[2], v[3] + end + local appearance = pdfdictionary { -- cache this one + N = registeredsymbol(n), R = registeredsymbol(r), D = registeredsymbol(d), + } + return lpdf.sharedobj(tostring(appearance)) +end + +local function fieldstates(specification) + -- splitter not needed, wil go + -- todo: caching + local values, default = specification.values, specification.default + if not values then + -- error + return + end + local v = aux.settings_to_array(values) + local yes, off + if #v == 1 then + yes, off = v[1], v[1] + else + yes, off = v[1], v[2] + end + local yesshown, yesvalue = splitter:match(yes) + if not (yesshown and yesvalue) then + yesshown = yes, yes + end + yes = aux.settings_to_array(yesshown) + local offshown, offvalue = splitter:match(off) + if not (offshown and offvalue) then + offshown = off, off + end + off = aux.settings_to_array(offshown) + if #yes == 1 then + yesn, yesr, yesd = yes[1], yes[1], yes[1] + elseif #yes == 2 then + yesn, yesr, yesd = yes[1], yes[1], yes[2] + else + yesn, yesr, yesd = yes[1], yes[2], yes[3] + end + if #off == 1 then + offn, offr, offd = off[1], off[1], off[1] + elseif #off == 2 then + offn, offr, offd = off[1], off[1], off[2] + else + offn, offr, offd = off[1], off[2], off[3] + end + if not yesvalue then + yesvalue = yesn + end + if not offvalue then + offvalue = offn + end + if default == yesn then + default = pdfconstant(yesn) + else + default = pdfconstant("Off") + end + local appearance = pdfdictionary { -- mayeb also cache components + N = pdfdictionary { [yesn] = registeredsymbol(yesn), Off = registeredsymbol(offn) }, + R = pdfdictionary { [yesr] = registeredsymbol(yesr), Off = registeredsymbol(offr) }, + D = pdfdictionary { [yesd] = registeredsymbol(yesd), Off = registeredsymbol(offd) } + } + local appearanceref = lpdf.sharedobj(tostring(appearance)) + return appearanceref, default +end + +local function fieldoptions(specification) + local values = specification.values + local default = specification.default + if values then + local v = aux.settings_to_array(values) + for i=1,#v do + local vi = v[i] + local shown, value = splitter:match(vi) + if shown and value then + v[i] = pdfarray { pdfunicode(value), shown } + else + v[i] = pdfunicode(v[i]) + end + end + return pdfarray(v) + end +end + +local function radiodefault(parent,field) + local default, values = parent.default, parent.values + if not default or default == "" then + values = aux.settings_to_array(values) + default = values[1] + end + local name = field.name + local fieldvalues = aux.settings_to_array(field.values) + local yes, off = fieldvalues[1], fieldvalues[2] or fieldvalues[1] + if not default then + return pdfconstant(yes) + elseif default == name then + return pdfconstant(default) + else + return pdfconstant("Off") + end +end + +-- layers + +local function fieldlayer(specification) -- we can move this in line + local layer = specification.layer + return (layer and lpdf.layerreferences[layer]) or nil +end + +-- defining + +local fields, radios, fieldsets, calculationset = { }, { }, { }, nil + +function codeinjections.definefieldset(tag,list) + fieldsets[tag] = list +end + +function codeinjections.getfieldset(tag) + return fieldsets[tag] +end + +local function fieldsetlist(tag) + if tag then + local ft = fieldsets[tag] + if ft then + local a = pdfarray() + for name in gmatch(list,"[^, ]+") do + local f = field[name] + if f and f.pobj then + a[#a+1] = pdfreference(f.pobj) + end + end + return a + end + end +end + +function codeinjections.setfieldcalculationset(tag) + calculationset = tag +end + +local function predefinesymbols(specification) + local values = specification.values + if values then + local a, b = splitter:match(values) + codeinjections.presetsymbollist(a or values) + end +end + +function codeinjections.getdefaultfieldvalue(name) + local f = fields[name] + if f then + local values = f.values + local default = f.default + if not default or default == "" then + local a, b = splitter:match(values) + values = a or values + for name in gmatch(list,"[^, ]+") do + default = name + break + end + end + if default then + tex.sprint(ctxcatcodes,default) + end + end +end + + +function codeinjections.definefield(specification) + local n = specification.name + local f = fields[n] + if not f then + local kind = specification.kind + if not kind then + -- name and kind are mandate + elseif kind == "radio" then + local values = specification.values + if values and values ~= "" then + values = aux.settings_to_array(values) + for v=1,#values do + radios[values[v]] = { parent = n } + end + fields[n] = specification + else + -- invalid radio specification + end + elseif kind == "sub" then + -- not in main field list ! + local radio = radios[n] + if radio then + -- merge specification + for key, value in next, specification do + radio[key] = value + end + end + predefinesymbols(specification) + else + fields[n] = specification + predefinesymbols(specification) + end + else + -- already done + end +end + +function codeinjections.clonefield(specification) + local p = specification.parent + local c = specification.children + if not p or not c then + -- parent and children are mandate + else + for n in gmatch(c,"[^, ]+") do + local f = fields[n] + if f and not f.done then + -- already done + else + fields[n] = specification + end + end + end +end + +function codeinjections.getfieldgroup(name) + local f = fields[name] + if f and f.group then + texsprint(ctxcatcodes,f.group) + end +end + +-- + +function codeinjections.doiffieldset(tag) + commands.testcase(fieldsets[tag]) +end + +function codeinjections.doiffieldelse(name) + commands.testcase(fields[name]) +end + +-- + +local alignments = { + flushleft = 0, right = 0, + center = 1, middle = 1, + flushright = 2, left = 2, +} + +local function fieldalignment(specification) + return alignments[specification.align] or 0 +end + +local function enhance(specification,option) + local so = specification.options + if so and so ~= "" then + specification.options = so .. "," .. option + else + specification.options = option + end + return specification +end + +-- finish + +local collected = pdfarray() + +function codeinjections.finishfields() + for name, field in next, fields do + local kids = field.kids + if kids then + pdfimmediateobj(field.kobj,tostring(kids)) + end + local pobj = field.pobj + end + for name, field in next, radios do + local kids = field.kids + if kids then + pdfimmediateobj(field.kobj,tostring(kids)) + end + end + if #collected > 0 then + local acroform = pdfdictionary { + NeedAppearances = true, + Fields = pdfreference(pdfimmediateobj(tostring(collected))), + DR = pdfdictionary { Font = registerfonts() }, + CO = fieldsetlist(calculationset), + DA = "/tttf 12 Tf 0 g", + } + lpdf.addtocatalog("AcroForm",pdfreference(pdfimmediateobj(tostring(acroform)))) + end + lpdf.finishfields = function() end +end + +local pdf_widget = pdfconstant("Widget") +local pdf_tx = pdfconstant("Tx") +local pdf_ch = pdfconstant("Ch") +local pdf_btn = pdfconstant("Btn") +local pdf_yes = pdfconstant("Yes") +local pdf_p = pdfconstant("P") -- None Invert Outline Push +local pdf_n = pdfconstant("N") -- None Invert Outline Push +-- +local pdf_no_rect = pdfarray { 0, 0, 0, 0 } + +local methods = { } + +function codeinjections.typesetfield(name,specification) + local field = fields[name] or radios[name] + if not field then + tex.write("error: " .. name) + -- unknown field + return + end + local method = methods[field.kind] + if method then + method(name,specification) + end +end + +-- can be optional multipass optimization (share objects) + +local function save_parent(field,specification,d) + local kn = pdfreserveobj() + d.Kids = pdfreference(kn) + field.kobj = kn + field.kids = pdfarray() + local pn = pdfimmediateobj(tostring(d)) + field.pobj = pn + collected[#collected+1] = pdfreference(pn) +end + +local function save_kid(field,specification,d) + local kn = pdfreserveobj() + field.kids[#field.kids+1] = pdfreference(kn) + node.write(nodes.pdfannot(specification.width,specification.height,0,d(),kn)) +end + +function methods.line(name,specification,extras) + local field = fields[name] + local kind = field.kind + if not field.pobj then + if extras then + enhance(specification,extras) + end + local text = pdfunicode(specification.default) + local d = pdfdictionary { + Subtype = pdf_widget, + T = pdfunicode(specification.title), + F = fieldplus(specification), + Ff = fieldflag(specification), + OC = fieldlayer(specification), + MK = fieldsurrounding(specification), + AA = fieldactions(specification), + FT = pdf_tx, + Q = fieldalignment(specification), + MaxLen = (specification.length == 0 and 1000) or specification.length, + DV = text, + V = text, + } + save_parent(field,specification,d) + field.specification = specification + end + specification = field.specification or { } -- todo: radio spec + local d = pdfdictionary { + Subtype = pdf_widget, + Parent = pdfreference(field.pobj), + F = fieldplus(specification), + DA = fieldattributes(specification), + OC = fieldlayer(specification), + MK = fieldsurrounding(specification), + AA = fieldactions(specification), + Q = fieldalignment(specification) + } + save_kid(field,specification,d) +end + +function methods.text(name,specification) + methods.line(name,specification,"MultiLine") +end + +function methods.choice(name,specification,extras) + local field = fields[name] + local kind = field.kind + local d + if not field.pobj then + if extras then + enhance(specification,extras) + end + local d = pdfdictionary { + Subtype = pdf_widget, + T = pdfunicode(specification.title), + F = fieldplus(specification), + Ff = fieldflag(specification), + OC = fieldlayer(specification), + AA = fieldactions(specification), + FT = pdf_ch, + Opt = fieldoptions(field), + } + save_parent(field,specification,d) + field.specification = specification + end + specification = field.specification or { } + local d = pdfdictionary { + Subtype = pdf_widget, + Parent = pdfreference(field.pobj), + F = fieldplus(specification), + DA = fieldattributes(specification), + OC = fieldlayer(specification), + AA = fieldactions(specification), + } + save_kid(field,specification,d) +end + +function methods.popup(name,specification) + methods.choice(name,specification,"PopUp") +end +function methods.combo(name,specification) + methods.choice(name,specification,"PopUp,Edit") +end + +-- probably no default appearance needed for first kid + +function methods.check(name,specification) + -- no /Opt because (1) it's messy - see pdf spec, (2) it discouples kids and + -- contrary to radio there is no way to associate then + local field = fields[name] + local kind = field.kind + local appearance, default = fieldstates(field) + if not field.pobj then + local d = pdfdictionary { + Subtype = pdf_widget, + T = pdfunicode(specification.title), + F = fieldplus(specification), + Ff = fieldflag(specification), + OC = fieldlayer(specification), + AA = fieldactions(specification), + FT = pdf_btn, + DV = default, + V = default, + AS = default, + AP = appearance, + H = pdf_n, + } + save_parent(field,specification,d) + field.specification = specification + end + specification = field.specification or { } -- todo: radio spec + local d = pdfdictionary { + Subtype = pdf_widget, + Parent = pdfreference(field.pobj), + F = fieldplus(specification), + DA = fieldattributes(specification), + OC = fieldlayer(specification), + AA = fieldactions(specification), + DV = default, + V = default, + AS = default, + AP = appearance, + H = pdf_n, + } + save_kid(field,specification,d) +end + +function methods.push(name,specification) + local field = fields[name] + local kind = field.kind + if not field.pobj then + enhance(specification,"PushButton") + local d = pdfdictionary { + Subtype = pdf_widget, + T = pdfunicode(specification.title), + F = fieldplus(specification), + Ff = fieldflag(specification), + OC = fieldlayer(specification), + AA = fieldactions(specification), + FT = pdf_btn, + AP = fieldappearances(field), + H = pdf_p, + } + save_parent(field,specification,d) + field.specification = specification + end + specification = field.specification or { } -- todo: radio spec + local d = pdfdictionary { + Subtype = pdf_widget, + Parent = pdfreference(field.pobj), + F = fieldplus(specification), + DA = fieldattributes(specification), + OC = fieldlayer(specification), + AA = fieldactions(specification), + AP = fieldappearances(field), + H = pdf_p, + } + save_kid(field,specification,d) +end + +function methods.sub(name,specification) + local field = radios[name] + if not field then + return + end + local parent = fields[field.parent] + if not parent then + return + end + if not parent.pobj then + local specification = parent.specification or { } + enhance(specification,"Radio,RadiosInUnison") + local d = pdfdictionary { + T = parent.name, + FT = pdf_btn, + Rect = pdf_no_rect, + F = fieldplus(specification), + Ff = fieldflag(specification), + H = pdf_n, + } + save_parent(parent,specification,d) + end + local appearance = fieldstates(field) + local default = radiodefault(parent,field) + local d = pdfdictionary { + Subtype = pdf_widget, + Parent = pdfreference(parent.pobj), + F = fieldplus(specification), + DA = fieldattributes(specification), + OC = fieldlayer(specification), + AA = fieldactions(specification), + DV = default, + V = default, + AS = default, + AP = appearance, + H = pdf_n, + } + save_kid(parent,specification,d) +end diff --git a/tex/context/base/lpdf-grp.lua b/tex/context/base/lpdf-grp.lua new file mode 100644 index 000000000..119d25ee4 --- /dev/null +++ b/tex/context/base/lpdf-grp.lua @@ -0,0 +1,70 @@ +if not modules then modules = { } end modules ['lpdf-grp'] = { + version = 1.001, + comment = "companion to lpdf-ini.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local format = string.format + +local nodeinjections = backends.pdf.nodeinjections +local codeinjections = backends.pdf.codeinjections +local registrations = backends.pdf.registrations + +local pdfdictionary = lpdf.dictionary +local pdfarray = lpdf.array +local pdfconstant = lpdf.constant +local pdfreference = lpdf.reference + +local pdfreserveobj = pdf.reserveobj +local pdfimmediateobj = pdf.immediateobj + +local function shade(stype,name,domain,color_a,color_b,n,colorspace,coordinates) + local f = pdfdictionary { + FunctionType = 2, + Domain = pdfarray(domain), -- domain is actually a string + C0 = pdfarray(color_a), + C1 = pdfarray(color_b), + N = tonumber(n), + } + local s = pdfdictionary { + ShadingType = stype, + ColorSpace = pdfconstant(colorspace), + Function = pdfreference(pdfimmediateobj(tostring(f))), + Coords = pdfarray(coordinates), + Extend = pdfarray { true, true }, + } + lpdf.adddocumentshade(name,pdfreference(pdfimmediateobj(tostring(s)))) +end + +function lpdf.circularshade(name,domain,color_a,color_b,n,colorspace,coordinates) + shade(3,name,domain,color_a,color_b,n,colorspace,coordinates) +end + +function lpdf.linearshade(name,domain,color_a,color_b,n,colorspace,coordinates) + shade(2,name,domain,color_a,color_b,n,colorspace,coordinates) +end + +function lpdf.colorspec(model,ca,default) + if ca and ca > 0 then + local cv = colors.value(ca) + if cv then + if model == 1 then + model = cv[1] + end + if model == 2 then + return pdfarray { cv[2] } + elseif model == 3 then + return pdfarray { cv[3],cv[4],cv[5] } + elseif model == 4 then + return pdfarray { cv[6],cv[7],cv[8],cv[9] } + elseif model == 5 then + return pdfarray { cv[13] } + end + end + end + if default then + return default + end +end diff --git a/tex/context/base/lpdf-ini.lua b/tex/context/base/lpdf-ini.lua index 92207d728..bc89c4872 100644 --- a/tex/context/base/lpdf-ini.lua +++ b/tex/context/base/lpdf-ini.lua @@ -8,9 +8,11 @@ if not modules then modules = { } end modules ['back-pdf'] = { -- This code is very experimental ! -local setmetatable, getmetatable, type, next, tostring, tonumber = setmetatable, getmetatable, type, next, tostring, tonumber +local setmetatable, getmetatable, type, next, tostring, tonumber, rawset = setmetatable, getmetatable, type, next, tostring, tonumber, rawset local char, byte, format, gsub, concat = string.char, string.byte, string.format, string.gsub, table.concat local utfvalues = string.utfvalues +local texwrite = tex.write +local sind, cosd = math.sind, math.cosd lpdf = lpdf or { } @@ -31,6 +33,47 @@ local function tosixteen(str) end end +lpdf.tosixteen = tosixteen + +-- lpeg is some 5 times faster than gsub (in test) on escaping + +local escapes = { + ["\\"] = "\\\\", + ["/"] = "\\/", ["#"] = "\\#", + ["<"] = "\\<", [">"] = "\\>", + ["["] = "\\[", ["]"] = "\\]", + ["("] = "\\(", [")"] = "\\)", +} + +local escaped = lpeg.Cs(lpeg.Cc("(") * (lpeg.S("\\/#<>[]()")/escapes + lpeg.P(1))^0 * lpeg.Cc(")")) + +local function toeight(str) + -- if not str or str == "" then + -- return "()" + -- else + -- return escaped:match(str) + -- end + -- + -- no need for escaping .. just use unicode instead + return "(" .. str .. ")" +end + +lpdf.toeight = toeight + +local escapes = "-" + +local escaped = lpeg.Cs(lpeg.Cc("(") * (lpeg.S("\\/#<>[]()")/escapes + lpeg.P(1))^0 * lpeg.Cc(")")) + +local function cleaned(str) + if not str or str == "" then + return "()" + else + return escaped:match(str) + end +end + +lpdf.cleaned = cleaned + local function merge_t(a,b) local t = { } for k,v in next, a do t[k] = v end @@ -40,14 +83,20 @@ end local tostring_a, tostring_d -tostring_d = function(t) +tostring_d = function(t,contentonly,key) if not next(t) then - return "<< >>" + if contentonly then + return "" + else + return "<< >>" + end else - local r = { "<<" } + local r = { } for k, v in next, t do local tv = type(v) if tv == "string" then + r[#r+1] = format("/%s %s",k,toeight(v)) + elseif tv == "unicode" then r[#r+1] = format("/%s %s",k,tosixteen(v)) elseif tv == "table" then local mv = getmetatable(v) @@ -62,19 +111,30 @@ tostring_d = function(t) r[#r+1] = format("/%s %s",k,tostring(v)) end end - r[#r+1] = ">>" - return concat(r, " ") + if contentonly then + return concat(r, " ") + elseif key then + return format("/%s << %s >>", key, concat(r, " ")) + else + return format("<< %s >>", concat(r, " ")) + end end end -tostring_a = function(t) +tostring_a = function(t,contentonly,key) if #t == 0 then - return "[ ]" + if contentonly then + return "" + else + return "[ ]" + end else - local r = { "[" } + local r = { } for k, v in next, t do local tv = type(v) if tv == "string" then + r[#r+1] = toeight(v) + elseif tv == "unicode" then r[#r+1] = tosixteen(v) elseif tv == "table" then local mv = getmetatable(v) @@ -89,54 +149,82 @@ tostring_a = function(t) r[#r+1] = tostring(v) end end - r[#r+1] = "]" - return concat(r, " ") + if contentonly then + return concat(r, " ") + elseif key then + return format("/%s [ %s ]", key, concat(r, " ")) + else + return format("[ %s ]", concat(r, " ")) + end end end -local tostring_s = function(t) return tosixteen(t[1]) end +local tostring_x = function(t) return concat(t, " ") end +local tostring_s = function(t) return toeight(t[1]) end +local tostring_u = function(t) return tosixteen(t[1]) end local tostring_n = function(t) return tostring(t[1]) end -- tostring not needed local tostring_c = function(t) return t[1] end -- already prefixed (hashed) local tostring_z = function() return "null" end local tostring_t = function() return "true" end local tostring_f = function() return "false" end - -local function value_s(t) return t[1] end -- the call is experimental -local function value_n(t) return t[1] end -- the call is experimental -local function value_c(t) return sub(t[1],2) end -- the call is experimental -local function value_d(t) return t end -- the call is experimental -local function value_a(t) return t end -- the call is experimental -local function value_z() return nil end -- the call is experimental -local function value_t() return true end -- the call is experimental -local function value_b() return false end -- the call is experimental - +local tostring_r = function(t) return t[1] .. " 0 R" end +local tostring_v = function(t) return concat(t, "") end + +local function value_x(t) return t end -- the call is experimental +local function value_s(t,key) return t[1] end -- the call is experimental +local function value_u(t,key) return t[1] end -- the call is experimental +local function value_n(t,key) return t[1] end -- the call is experimental +local function value_c(t) return sub(t[1],2) end -- the call is experimental +local function value_d(t) return tostring_d(t,true,key) end -- the call is experimental +local function value_a(t) return tostring_a(t,true,key) end -- the call is experimental +local function value_z() return nil end -- the call is experimental +local function value_t() return true end -- the call is experimental +local function value_b() return false end -- the call is experimental +local function value_r() return t[1] end -- the call is experimental +local function value_v() return t end -- the call is experimental + +local function add_x(t,k,v) rawset(t,k,tostring(v)) end + +local mt_x = { __lpdftype = "stream", __tostring = tostring_x, __call = value_x, __newindex = add_x } local mt_d = { __lpdftype = "dictionary", __tostring = tostring_d, __call = value_d } local mt_a = { __lpdftype = "array", __tostring = tostring_a, __call = value_a } +local mt_u = { __lpdftype = "unicode", __tostring = tostring_u, __call = value_u } local mt_s = { __lpdftype = "string", __tostring = tostring_s, __call = value_s } local mt_n = { __lpdftype = "number", __tostring = tostring_n, __call = value_n } local mt_c = { __lpdftype = "constant", __tostring = tostring_c, __call = value_c } local mt_z = { __lpdftype = "null", __tostring = tostring_z, __call = value_z } local mt_t = { __lpdftype = "true", __tostring = tostring_t, __call = value_t } local mt_f = { __lpdftype = "false", __tostring = tostring_f, __call = value_f } +local mt_r = { __lpdftype = "reference", __tostring = tostring_r, __call = value_r } +local mt_v = { __lpdftype = "verbose", __tostring = tostring_v, __call = value_v } + +function lpdf.stream(t) + if t then + for i=1,#t do + t[i] = tostring(t[i]) + end + end + return setmetatable(t or { },mt_x) +end function lpdf.dictionary(t) return setmetatable(t or { },mt_d) end function lpdf.array(t) - return setmetatable(t or { },mt_a) + if type(t) == "string"then + return setmetatable({ t },mt_a) + else + return setmetatable(t or { },mt_a) + end end -local cache = { } -- can be weak - function lpdf.string(str,default) - str = str or default or "" - local c = cache[str] - if not c then - c = setmetatable({ str },mt_s) - cache[str] = c - end - return c + return setmetatable({ str or default or "" },mt_s) +end + +function lpdf.unicode(str,default) + return setmetatable({ str or default or "" },mt_u) end local cache = { } -- can be weak @@ -181,6 +269,14 @@ function lpdf.boolean(b,default) end end +function lpdf.reference(r) + return setmetatable({ r or 0 },mt_r) +end + +function lpdf.verbose(t) + return setmetatable(t or { },mt_v) +end + --~ local d = lpdf.dictionary() --~ local e = lpdf.dictionary { ["e"] = "abc" } --~ local f = lpdf.dictionary { ["f"] = "ABC" } @@ -266,3 +362,157 @@ function lpdf.limited(n,min,max,default) end end end + +-- there will be more of this + +local pdfreference = lpdf.reference +local pdfdictionary = lpdf.dictionary +local pdfreserveobj = pdf.reserveobj +local pdfimmediateobj = pdf.immediateobj + +local texset, texsprint, ctxcatcodes = tex.set, tex.sprint, tex.ctxcatcodes + +local pdfobjcache = { } + +function lpdf.sharedobj(content) + local r = pdfobjcache[content] + if not r then + r = pdfreference(pdfimmediateobj(content)) + pdfobjcache[content] = r + end + return r +end + +-- saves definitions later on + +backends = backends or { } +backends.pdf = backends.pdf or { + comment = "backend for directly generating pdf output", + nodeinjections = { }, + codeinjections = { }, + registrations = { }, + helpers = { }, +} + +-- + +local pagefinalizers, documentfinalizers = { }, { } + +local pageresources, pageattributes, pagesattributes + +local function resetpageproperties() + pageresources = pdfdictionary() + pageattributes = pdfdictionary() + pagesattributes = pdfdictionary() +end + +local function setpageproperties() + texset("global", "pdfpageresources", pageresources ()) + texset("global", "pdfpageattr", pageattributes ()) + texset("global", "pdfpagesattr", pagesattributes()) +end + +function lpdf.addtopageresources (k,v) pageresources [k] = v end +function lpdf.addtopageattributes (k,v) pageattributes [k] = v end +function lpdf.addtopagesattributes(k,v) pagesattributes[k] = v end + +local function set(where, f) + where[#where+1] = f +end + +local function run(where) + for i=1,#where do + where[i]() + end +end + +function lpdf.registerpagefinalizer(f) + set(pagefinalizers,f) +end + +function lpdf.registerdocumentfinalizer(f) + set(documentfinalizers,f) +end + +function lpdf.finalizepage() + if not environment.initex then + resetpageproperties() + run(pagefinalizers) + setpageproperties() + end +end + +function lpdf.finalizedocument() + if not environment.initex then + run(documentfinalizers) + end +end + +local c_template = "\\normalpdfcatalog{/%s %s}" +local i_template = "\\normalpdfinfo{/%s %s}" +local n_template = "\\normalpdfnames{/%s %s}" + +function lpdf.addtocatalog(k,v) if not environment.initex then texsprint(ctxcatcodes,format(c_template,k,tostring(v))) end end +function lpdf.addtoinfo (k,v) if not environment.initex then texsprint(ctxcatcodes,format(i_template,k,tostring(v))) end end +function lpdf.addtonames (k,v) if not environment.initex then texsprint(ctxcatcodes,format(n_template,k,tostring(v))) end end + +local r_extgstates, d_extgstates = pdfreserveobj(), pdfdictionary() local p_extgstates = pdfreference(r_extgstates) +local r_colorspaces, d_colorspaces = pdfreserveobj(), pdfdictionary() local p_colorspaces = pdfreference(r_colorspaces) +local r_patterns, d_patterns = pdfreserveobj(), pdfdictionary() local p_patterns = pdfreference(r_patterns) +local r_shades, d_shades = pdfreserveobj(), pdfdictionary() local p_shades = pdfreference(r_shades) + +local function checkextgstates () if next(d_extgstates ) then lpdf.addtopageresources("ExtGState", p_extgstates ) end end +local function checkcolorspaces() if next(d_colorspaces) then lpdf.addtopageresources("ColorSpace",p_colorspaces) end end +local function checkpatterns () if next(d_patterns ) then lpdf.addtopageresources("Pattern", p_patterns ) end end +local function checkshades () if next(d_shades ) then lpdf.addtopageresources("Shading", p_shades ) end end + +local function flushextgstates () pdfimmediateobj(r_extgstates, tostring(d_extgstates )) end +local function flushcolorspaces() pdfimmediateobj(r_colorspaces,tostring(d_colorspaces)) end +local function flushpatterns () pdfimmediateobj(r_patterns, tostring(d_patterns )) end +local function flushshades () pdfimmediateobj(r_shades, tostring(d_shades )) end + +--~ function lpdf.collectedresources() +--~ local collected = pdfdictionary { +--~ ExtGState = (next(d_extgstates) and p_extgstates ) or nil, +--~ ColorSpace = (next(d_colorspaces) and p_colorspaces) or nil, +--~ Pattern = (next(d_patterns) and p_patterns ) or nil, +--~ Shading = (next(d_shades) and p_shades ) or nil, +--~ } +--~ if next(collected) then +--~ tex.sprint(tex.ctxcatcodes,collected()) +--~ end +--~ end + +local collected = pdfdictionary { + ExtGState = p_extgstates, + ColorSpace = p_colorspaces, + Pattern = p_patterns, + Shading = p_shades, +} ; collected = collected() + +function lpdf.collectedresources() + tex.sprint(tex.ctxcatcodes,collected) +end + +function lpdf.adddocumentextgstate (k,v) d_extgstates [k] = v end +function lpdf.adddocumentcolorspace(k,v) d_colorspaces[k] = v end +function lpdf.adddocumentpattern (k,v) d_patterns [k] = v end +function lpdf.adddocumentshade (k,v) d_shades [k] = v end + +lpdf.registerdocumentfinalizer(flushextgstates) +lpdf.registerdocumentfinalizer(flushcolorspaces) +lpdf.registerdocumentfinalizer(flushpatterns) +lpdf.registerdocumentfinalizer(flushshades) + +lpdf.registerpagefinalizer(checkextgstates) +lpdf.registerpagefinalizer(checkcolorspaces) +lpdf.registerpagefinalizer(checkpatterns) +lpdf.registerpagefinalizer(checkshades) + +-- + +function lpdf.rotationcm(a) + local s, c = sind(a), cosd(a) + texwrite(format("%s %s %s %s 0 0 cm",c,s,-s,c)) +end + diff --git a/tex/context/base/lpdf-ini.mkiv b/tex/context/base/lpdf-ini.mkiv index 23a81cfec..52ed6c383 100644 --- a/tex/context/base/lpdf-ini.mkiv +++ b/tex/context/base/lpdf-ini.mkiv @@ -14,5 +14,246 @@ \writestatus{loading}{ConTeXt Backend Macros / PDF} \registerctxluafile{lpdf-ini}{1.001} +\registerctxluafile{lpdf-nod}{1.001} +%registerctxluafile{lpdf-col}{1.001} % will be loaded later +\registerctxluafile{lpdf-mis}{1.001} +\registerctxluafile{lpdf-ano}{1.001} +\registerctxluafile{lpdf-ren}{1.001} +\registerctxluafile{lpdf-grp}{1.001} +\registerctxluafile{lpdf-wid}{1.001} +\registerctxluafile{lpdf-fld}{1.001} +\registerctxluafile{lpdf-u3d}{1.001} -\endinput +\unprotect + +% for the moment here + +%D \macros +%D {doovalbox} +%D +%D Drawing frames with round corners is inherited from the +%D main module. +%D +%D For drawing ovals we use quite raw \PDF\ code. The next +%D implementation does not differ that much from the one +%D implemented in the \POSTSCRIPT\ driver. + +\def\doPDFovalcalc#1#2#3% + {\PointsToBigPoints{\dimexpr#1+#2\relax}#3} + +\def\doovalbox#1#2#3#4#5#6#7#8% todo: \scratchdimen/\scatchbox + {\forcecolorhack + \bgroup + \dimen0=#4\divide\dimen0 \plustwo + \doPDFovalcalc{0pt}{+\dimen0}\xmin + \doPDFovalcalc{#1}{-\dimen0}\xmax + \doPDFovalcalc{#2}{-\dimen0}\ymax + \doPDFovalcalc{-#3}{+\dimen0}\ymin + \advance\dimen0 by #5% + \doPDFovalcalc{0pt}{+\dimen0}\xxmin + \doPDFovalcalc{#1}{-\dimen0}\xxmax + \doPDFovalcalc{#2}{-\dimen0}\yymax + \doPDFovalcalc{-#3}{+\dimen0}\yymin + \doPDFovalcalc{#4}{\zeropoint}\stroke + \doPDFovalcalc{#5}{\zeropoint}\radius + \edef\dostroke{#6}% + \edef\dofill{#7}% + \edef\mode{\number#8 \space}% + % no \ifcase, else \relax in pdfcode + \setbox\scratchbox\hbox + {\ifnum\dostroke\dofill>\zerocount + \pdfliteral + {q + \stroke\space w + \ifcase\mode + \xxmin\space \ymin \space m + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax\space \ymax \space y + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + h + \or % 1 + \xxmin\space \ymin \space m + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \ymax \space l + \xmin \space \ymax \space l + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + h + \or % 2 + \xxmin\space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \ymax \space l + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + h + \or % 3 + \xmin \space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax\space \ymax \space y + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \ymin \space l + h + \or % 4 + \xmin \space \ymin \space m + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax\space \ymax \space y + \xmin \space \ymax \space l + \xmin \space \ymin\space l + h + \or % 5 + \xmin \space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax\space \ymax \space y + \xmin \space \ymax \space l + \xmin \space \ymin \space l + h + \or % 6 + \xmin \space \ymin \space m + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \ymax \space l + \xmin \space \ymax \space l + \xmin \space \ymin \space l + h + \or + \xxmin\space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \ymax \space l + \xmin \space \ymax \space l + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + h + \or + \xmin \space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \ymax \space l + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \ymin \space l + h + \or % 9 top open + \xmin \space \ymax \space m + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \ymax \space l + \or % 10 right open + \xmax \space \ymax \space m + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + \xmax\space \ymin \space l + \or % 11 bottom open + \xmax \space \ymin \space m + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax \space \ymax\space y + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \ymin \space l + \or % 12 left open + \xmin \space \ymax \space m + \xxmax\space \ymax \space l + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmax \space \yymin\space l + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xmin \space \ymin \space l + \or % 13 + \xmin \space \ymax \space m + \xxmax\space \ymax \space l + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmax\space \ymin \space l + \or % 14 + \xmax \space \ymax \space m + \xmax \space \yymin\space l + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xmin \space \ymin \space l + \or % 15 + \xmax \space \ymin \space m + \xxmin\space \ymin \space l + \xmin \space \ymin \space \xmin \space \yymin\space y + \xmin \space \ymax \space l + \or % 16 + \xmin \space \ymin \space m + \xmin \space \yymax\space l + \xmin \space \ymax \space \xxmin\space \ymax \space y + \xmax \space \ymax \space l + \or % 17 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \or % 18 + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \or % 19 + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \or % 20 + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 21 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 22 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \or % 23 + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \or % 24 + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 25 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 26 + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 27 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \or % 28 + \fi + \ifnum\mode>8 + S + \else + \ifnum\dostroke=\plusone S \fi + \ifnum\dofill =\plusone f \fi + \fi + Q}% + \fi}% + \wd\scratchbox#1\ht\scratchbox#2\dp\scratchbox#3\box\scratchbox + \egroup} + +\protect \endinput diff --git a/tex/context/base/lpdf-mis.lua b/tex/context/base/lpdf-mis.lua new file mode 100644 index 000000000..4a8a097ff --- /dev/null +++ b/tex/context/base/lpdf-mis.lua @@ -0,0 +1,230 @@ +if not modules then modules = { } end modules ['lpdf-mis'] = { + version = 1.001, + comment = "companion to back-pdf.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- Although we moved most pdf handling to the lua end, we didn't change +-- the overall approach. For instance we share all resources i.e. we +-- don't make subsets for each xform or page. The current approach is +-- quite efficient. A big difference between MkII and MkIV is that we +-- now use forward references. In this respect the MkII code shows that +-- it evolved over a long period, when backends didn't provide forward +-- referencing and references had to be tracked in multiple passes. Of +-- course there are a couple of more changes. + +local next, tostring = next, tostring +local format = string.format +local texsprint, texset = tex.sprint, tex.set +local ctxcatcodes = tex.ctxcatcodes + +local nodeinjections = backends.pdf.nodeinjections +local codeinjections = backends.pdf.codeinjections +local registrations = backends.pdf.registrations + +local pdfdictionary = lpdf.dictionary +local pdfarray = lpdf.array +local pdfboolean = lpdf.boolean +local pdfconstant = lpdf.constant +local pdfreference = lpdf.reference +local pdfunicode = lpdf.unicode +local pdfstring = lpdf.string + +local pdfreserveobj = pdf.reserveobj +local pdfimmediateobj = pdf.immediateobj + +local tobasepoints = number.tobasepoints + +lpdf.addtoinfo ("Trapped", pdfboolean(false)) +lpdf.addtocatalog("Version", pdfconstant(format("1.%s",tex.pdfminorversion))) + +-- we could do this selectively + +local function initializenegative() + local a = pdfarray { 0, 1 } + local g = pdfconstant("ExtGState") + local d = pdfdictionary { + FunctionType = 4, + Range = a, + Domain = a, + } + local negative = pdfdictionary { Type = g, TR = pdfreference(pdf.immediateobj("stream","1 exch sub",d())) } + local positive = pdfdictionary { Type = g, TR = pdfconstant("Identity") } + lpdf.adddocumentextgstate("GSnegative", pdfreference(pdfimmediateobj(tostring(negative)))) + lpdf.adddocumentextgstate("GSPositive", pdfreference(pdfimmediateobj(tostring(positive)))) +end + +local function initializeoverprint() + local g = pdfconstant("ExtGState") + local knockout = pdfdictionary { Type = g, OP = false, OPM = 0 } + local overprint = pdfdictionary { Type = g, OP = true, OPM = 1 } + lpdf.adddocumentextgstate("GSknockout", pdfreference(pdfimmediateobj(tostring(knockout )))) + lpdf.adddocumentextgstate("GSoverprint", pdfreference(pdfimmediateobj(tostring(overprint)))) +end + +lpdf.registerdocumentfinalizer(initializenegative) +lpdf.registerdocumentfinalizer(initializeoverprint) + +function codeinjections.addtransparencygroup() + -- png: /CS /DeviceRGB /I true + local d = tostring ( pdfdictionary { + S = pdfconstant("Transparency"), + I = true, + K = true, + } ) + lpdf.registerpagefinalizer(function() lpdf.addtopageattributes("Group",d) end) +end + +-- actions (todo: store and update when changed) + +local openpage, closepage, opendocument, closedocument + +function codeinjections.flushdocumentactions(open,close) + opendocument, closedocument = open, close +end + +function codeinjections.flushpageactions(open,close) + openpage, closepage = open, close +end + +local function flushdocumentactions() + if opendocument then + lpdf.addtocatalog("OpenAction",lpdf.pdfaction(opendocument)) + end + if closedocument then + lpdf.addtocatalog("CloseAction",lpdf.pdfaction(closedocument)) + end +end + +local function flushpageactions() + if openpage or closepage then + local d = pdfdictionary() + if openpage then + d.O = lpdf.pdfaction(openpage) + end + if closepage then + d.C = lpdf.pdfaction(closepage) + end + lpdf.addtopageattributes("AA",d) + end +end + +lpdf.registerpagefinalizer(flushpageactions) +lpdf.registerdocumentfinalizer(flushdocumentactions) + +--- info + +function codeinjections.setupidentity(specification) + local title = specification.title or "" if title ~= "" then + lpdf.addtoinfo("Title", pdfunicode(title)) + end + local subject = specification.subject or "" if subject ~= "" then + lpdf.addtoinfo("Subject", pdfunicode(subject)) + end + local author = specification.author or "" if author ~= "" then + lpdf.addtoinfo("Author", pdfunicode(author)) + end + local creator = specification.creator or "" if creator ~= "" then + lpdf.addtoinfo("Creator", pdfunicode(creator)) + end + local date = specification.date or "" if date ~= "" then + lpdf.addtoinfo("ModDate", pdfstring(date)) + end + local keywords = specification.keywords or "" if keywords ~= "" then + keywords = string.gsub("[%s,]+", " ") + lpdf.addtoinfo("Keywords",pdfunicode(keywords)) + end + lpdf.addtoinfo("ID", pdfstring(format("%s.%s",tex.jobname,os.date("%Y%m%d.%H%M")))) -- needed for pdf/x +end + +local function flushjavascripts() + local t = javascripts.flushpreambles() + local a = pdfarray() + local pdf_javascript = pdfconstant("JavaScript") + for i=1,#t do + local name, script = t[i][1], t[i][2] + local j = pdfdictionary { + S = pdf_javascript, + JS = pdfreference(pdfimmediateobj("stream",script)), + } + a[#a+1] = pdfstring(name) + a[#a+1] = pdfreference(pdfimmediateobj(tostring(j))) + end + lpdf.addtonames("JavaScript",pdfreference(pdfimmediateobj(tostring(pdfdictionary{ Names = a })))) +end + +lpdf.registerdocumentfinalizer(flushjavascripts) + +-- -- -- + +local pagespecs = { + max = { "FullScreen", false, false }, + bookmark = { "UseOutlines", false, false }, + fit = { "UseNone", false, true }, + doublesided = { "UseNone", "TwoColumnRight", true }, + default = { "UseNone", "auto", false }, +} + +local pagespec, topoffset, leftoffset, height, width, doublesided = "default", 0, 0, 0, 0, false + +function codeinjections.setupcanvas(specification) + local paperheight = specification.paperheight + local paperwidth = specification.paperwidth + local paperdouble = specification.doublesided + if paperheight then + texset('global','pdfpageheight',paperheight) + end + if paperwidth then + texset('global','pdfpagewidth',paperwidth) + end + pagespec = specification.mode or pagespec + topoffset = specification.topoffset or 0 + leftoffset = specification.leftoffset or 0 + height = specification.height or tex.pdfpageheight + width = specification.width or tex.pdfpagewidth + if paperdouble ~= nil then + doublesided = paperdouble + end +end + +local function documentspecification() + local spec = pagespecs[pagespec] or pagespecs.default + local mode, layout, fit = spec[1], spec[2], spec[3] + if layout == "auto" and doublesided then + spec = pagespecs.doublesided + mode, layout, fit = spec[1], spec[2], spec[3] + end + mode = mode and pdfconstant(mode) + layout = layout and pdfconstant(layout) + fit = fit and pdfdictionary { FitWindow = true } + if layout then + lpdf.addtocatalog("PageLayout",layout) + end + if mode then + lpdf.addtocatalog("PageMode",mode) + end + if fit then + lpdf.addtocatalog("ViewerPreferences",fit) + end +end + +local factor = number.dimenfactors.bp + +local function pagespecification() + local pageheight = tex.pdfpageheight + local box = pdfarray { -- can be cached + factor * (leftoffset), + factor * (pageheight-topoffset-height), + factor * (width-leftoffset), + factor * (pageheight-topoffset), + } + lpdf.addtopageattributes("CropBox",box) -- mandate for rendering + lpdf.addtopageattributes("TrimBox",box) -- mandate for pdf/x + -- lpdf.addtopageattributes("BleedBox",box) + -- lpdf.addtopageattributes("ArtBox",box) +end + +lpdf.registerpagefinalizer(pagespecification) +lpdf.registerdocumentfinalizer(documentspecification) diff --git a/tex/context/base/lpdf-nod.lua b/tex/context/base/lpdf-nod.lua new file mode 100644 index 000000000..f40039b94 --- /dev/null +++ b/tex/context/base/lpdf-nod.lua @@ -0,0 +1,53 @@ +if not modules then modules = { } end modules ['lpdf-nod'] = { + version = 1.001, + comment = "companion to lpdf-ini.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local copy_node, new_node = node.copy, node.new + +local pdfliteral = nodes.register(new_node("whatsit", 8)) pdfliteral.mode = 1 +local pdfdest = nodes.register(new_node("whatsit",19)) pdfdest.named_id = 1 -- xyz_zoom untouched +local pdfannot = nodes.register(new_node("whatsit",15)) + +local variables = interfaces.variables + +local views = { -- beware, we do support the pdf keys but this is *not* official + xyz = 0, [variables.standard] = 0, + fit = 1, [variables.fit] = 1, + fith = 2, [variables.width] = 2, + fitv = 3, [variables.height] = 3, + fitb = 4, + fitbh = 5, [variables.minheight] = 5, + fitbv = 6, [variables.minheight] = 6, + fitr = 7, +} + +function nodes.pdfliteral(str) + local t = copy_node(pdfliteral) + t.data = str + return t +end + +function nodes.pdfannot(w,h,d,data,n) + local t = copy_node(pdfannot) + if w and w ~= 0 then t.width = w end + if h and h ~= 0 then t.height = h end + if d and d ~= 0 then t.depth = d end + if n then t.objnum = n end + if data and data ~= "" then t.data = data end + return t +end + +function nodes.pdfdest(w,h,d,name,view,n) + local t = copy_node(pdfdest) + if w and w ~= 0 then t.width = w end + if h and h ~= 0 then t.height = h end + if d and d ~= 0 then t.depth = d end + if n then t.objnum = n end + t.dest_id = name + t.dest_type = views[view] or view or 1 -- fit is default + return t +end diff --git a/tex/context/base/lpdf-ren.lua b/tex/context/base/lpdf-ren.lua new file mode 100644 index 000000000..05a6658e7 --- /dev/null +++ b/tex/context/base/lpdf-ren.lua @@ -0,0 +1,210 @@ +if not modules then modules = { } end modules ['lpdf-ren'] = { + version = 1.001, + comment = "companion to lpdf-ini.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- rendering + +local tostring, tonumber, next = tostring, tonumber, next +local format = string.format +local texsprint, ctxcatcodes = tex.sprint, tex.ctxcatcodes + +local nodeinjections = backends.pdf.nodeinjections +local codeinjections = backends.pdf.codeinjections +local registrations = backends.pdf.registrations + +jobreferences = jobreferences or { } +--~ jobreferences.runners = jobreferences.runners or { } +--~ jobreferences.specials = jobreferences.specials or { } +--~ jobreferences.handlers = jobreferences.handlers or { } +jobreferences.executers = jobreferences.executers or { } + +--~ local runners = jobreferences.runners +--~ local specials = jobreferences.specials +--~ local handlers = jobreferences.handlers +local executers = jobreferences.executers + +local variables = interfaces.variables + +local pdfconstant = lpdf.constant +local pdfdictionary = lpdf.dictionary +local pdfarray = lpdf.array +local pdfreference = lpdf.reference + +local pdfreserveobj = pdf.reserveobj +local pdfimmediateobj = pdf.immediateobj + +local pdf_ocg = pdfconstant("OCG") +local pdf_ocmd = pdfconstant("OCMD") +local pdf_off = pdfconstant("OFF") +local pdf_on = pdfconstant("ON") +local pdf_toggle = pdfconstant("Toggle") +local pdf_setocgstate = pdfconstant("SetOCGState") + +local lpdf_usage = pdfdictionary { Print = pdfdictionary { PrintState = pdfconstant("OFF") } } + +local pdfln, pdfld = { }, { } +local textlayers, hidelayers, videlayers = pdfarray(), pdfarray(), pdfarray() +local pagelayers = pdfdictionary() + +lpdf.layerreferences = pdfln + +function backends.pdf.layerreference(name) + return pdfln[name] +end + + +function codeinjections.defineviewerlayer(specification) + if textlayers then + local tag = specification.tag + -- todo: reserve + local n = pdfdictionary { + Type = pdf_ocg, + Name = specification.title or "unknown", + Intent = ((specification.kind > 0) and pdf_design) or nil, -- disable layer hiding by user + Usage = ((specification.printable == variables.no) and lpdf_usage) or nil , -- printable or not + } + local nr = pdfreference(pdfimmediateobj(tostring(n))) + pdfln[tag] = nr -- was n + local d = pdfdictionary { + Type = pdf_ocmd, + OCGs = pdfarray { nr }, + } + local dr = pdfreference(pdfimmediateobj(tostring(d))) + pdfld[tag] = dr + textlayers[#textlayers+1] = nr + if specification.visible == variables.start then + videlayers[#videlayers+1] = nr + else + hidelayers[#hidelayers+1] = nr + end + pagelayers[tag] = dr -- check + end +end + +local function flushtextlayers() + if textlayers and #textlayers > 0 then + local d = pdfdictionary { + OCGs = textlayers, + D = pdfdictionary { + Order = textlayers, + ON = videlayers, + OFF = hidelayers, + }, + } + lpdf.addtocatalog("OCProperties",d) + textlayers = nil + end +end + +local function flushpagelayers() + if next(pagelayers) then + lpdf.addtopageresources("Properties",pagelayers) + end +end + +lpdf.registerpagefinalizer (flushpagelayers) +lpdf.registerdocumentfinalizer(flushtextlayers) + +local function setlayer(what,arguments) + -- maybe just a gmatch of even better, earlier in lpeg + arguments = (type(arguments) == "table" and arguments) or aux.settings_to_array(arguments) + local state = pdfarray { what } + for i=1,#arguments do + local p = pdfln[arguments[i]] + if p then + state[#state+1] = p + end + end + return pdfdictionary { + S = pdf_setocgstate, + State = state, + } +end + +function executers.hidelayer (arguments) setlayer(pdf_off, arguments) end +function executers.videlayer (arguments) setlayer(pdf_on, arguments) end +function executers.togglelayer(arguments) setlayer(pdf_toggle,arguments) end + +-- transitions + +local pagetransitions = { + {"split","in","vertical"}, {"split","in","horizontal"}, + {"split","out","vertical"}, {"split","out","horizontal"}, + {"blinds","horizontal"}, {"blinds","vertical"}, + {"box","in"}, {"box","out"}, + {"wipe","east"}, {"wipe","west"}, {"wipe","north"}, {"wipe","south"}, + {"dissolve"}, + {"glitter","east"}, {"glitter","south"}, + {"fly","in","east"}, {"fly","in","west"}, {"fly","in","north"}, {"fly","in","south"}, + {"fly","out","east"}, {"fly","out","west"}, {"fly","out","north"}, {"fly","out","south"}, + {"push","east"}, {"push","west"}, {"push","north"}, {"push","south"}, + {"cover","east"}, {"cover","west"}, {"cover","north"}, {"cover","south"}, + {"uncover","east"}, {"uncover","west"}, {"uncover","north"}, {"uncover","south"}, + {"fade"}, +} + +local mapping = { + split = { "S" , pdfconstant("Split") }, + blinds = { "S" , pdfconstant("Blinds") }, + box = { "S" , pdfconstant("Box") }, + wipe = { "S" , pdfconstant("Wipe") }, + dissolve = { "S" , pdfconstant("Dissolve") }, + glitter = { "S" , pdfconstant("Glitter") }, + replace = { "S" , pdfconstant("R") }, + fly = { "S" , pdfconstant("Fly") }, + push = { "S" , pdfconstant("Push") }, + cover = { "S" , pdfconstant("Cover") }, + uncover = { "S" , pdfconstant("Uncover") }, + fade = { "S" , pdfconstant("Fade") }, + horizontal = { "Dm" , pdfconstant("H") }, + vertical = { "Dm" , pdfconstant("V") }, + ["in"] = { "M" , pdfconstant("I") }, + out = { "M" , pdfconstant("O") }, + east = { "Di" , 0 }, + north = { "Di" , 90 }, + west = { "Di" , 180 }, + south = { "Di" , 270 }, +} + +local last = 0 + +-- n: number, "stop", "reset", "random", "a,b,c" delay: number, "none" + +function codeinjections.setpagetransition(specification) + local n, delay = specification.n, specification.delay + if n == variables.auto then + if last >= #pagetransitions then + last = 0 + end + n = last + 1 + elseif n == variables.stop then + return + elseif n == variables.reset then + last = 0 + return + elseif n == variables.random then + n = math.random(1,#pagetransitions) + else + n = tonumber(n) + end + local t = n and pagetransitions[n] or pagetransitions[1] + if not t then + t = aux.settings_to_array(n) + end + if t and #t > 0 then + local d = pdfdictionary() + for i=1,#t do + local m = mapping[t[i]] + d[m[1]] = m[2] + end + delay = tonumber(delay) + if delay and delay > 0 then + lpdf.addtopageattributes("Dur",delay) + end + lpdf.addtopageattributes("Trans",d) + end +end diff --git a/tex/context/base/lpdf-u3d.lua b/tex/context/base/lpdf-u3d.lua new file mode 100644 index 000000000..5f7a770b1 --- /dev/null +++ b/tex/context/base/lpdf-u3d.lua @@ -0,0 +1,427 @@ +if not modules then modules = { } end modules ['lpdf-u3d'] = { + version = 1.001, + comment = "companion to lpdf-ini.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- The following code is based on a working prototype provided +-- by Michael Vidiassov. It is rewritten using the lpdf library +-- and different checking is used. The macro calls are adapted +-- (and will eventually be removed). The user interface needs +-- an overhaul. There are some messy leftovers that will be +-- removed in future versions. + +local format = string.format +local cos, sin, sqrt, pi, atan2, abs = math.cos, math.sin, math.sqrt, math.pi, math.atan2, math.abs + +local pdfconstant = lpdf.constant +local pdfboolean = lpdf.boolean +local pdfunicode = lpdf.unicode +local pdfdictionary = lpdf.dictionary +local pdfarray = lpdf.array +local pdfnull = lpdf.null +local pdfreference = lpdf.reference + +local checkedkey = lpdf.checkedkey +local limited = lpdf.limited + +local schemes = table.tohash { + "Artwork", "None", "White", "Day", "Night", "Hard", + "Primary", "Blue", "Red", "Cube", "CAD", "Headlamp", +} + +local modes = table.tohash { + "Solid", "SolidWireframe", "Transparent", "TransparentWireframe", "BoundingBox", + "TransparentBoundingBox", "TransparentBoundingBoxOutline", "Wireframe", + "ShadedWireframe", "HiddenWireframe", "Vertices", "ShadedVertices", "Illustration", + "SolidOutline", "ShadedIllustration", +} + +local function normalize(x, y, z) + local modulo = sqrt(x*x + y*y + z*z); + if modulo ~= 0 then + return x/modulo, y/modulo, z/modulo + else + return x, y, z + end +end + +local function rotate(vect_x,vect_y,vect_z, tet, axis_x,axis_y,axis_z) + -- rotate vect by tet about axis counterclockwise + local c, s = cos(tet*pi/180), sin(tet*pi/180) + local r = 1 - c + local n = sqrt(axis_x*axis_x+axis_y*axis_y+axis_z*axis_z) + axis_x, axis_y, axis_z = axis_x/n, axis_y/n, axis_z/n + return + (axis_x*axis_x*r+c )*vect_x + (axis_x*axis_y*r-axis_z*s)*vect_y + (axis_x*axis_z*r+axis_y*s)*vect_z, + (axis_x*axis_y*r+axis_z*s)*vect_x + (axis_y*axis_y*r+c )*vect_y + (axis_y*axis_z*r-axis_x*s)*vect_z, + (axis_x*axis_z*r-axis_y*s)*vect_x + (axis_y*axis_z*r+axis_x*s)*vect_y + (axis_z*axis_z*r+c )*vect_z +end + +local function make3dview(view) + + local name = viewname + local name = pdfunicode((view.name ~= "" and name) or "unknown view") + + local viewdict = pdfdictionary { + Type = pdfconstant("3DView"), + XN = name, + IN = name, + } + + local bg = checkedkey(view,"bg","table") + if bg then + viewdict.BG = pdfdictionary { + Type = pdfconstant("3DBG"), + C = pdfarray { limited(bg[1],1,1,1), limited(bg[2],1,1,1), limited(bg[3],1,1,1) }, + } + end + + local lights = checkedkey(view,"lights","string") + if lights and schemes[lights] then + viewdict.LS = pdfdictionary { + Type = pdfconstant("3DLightingScheme"), + Subtype = pdfconstant(lights), + } + end + + -- camera position is taken from 3d model + + local u3dview = checkedkey(view, "u3dview", "string") + if u3dview then + viewdict.MS = pdfconstant("U3D") + viewdict.U3DPath = u3dview + end + + -- position the camera as given + + local c2c = checkedkey(view, "c2c", "table") + local coo = checkedkey(view, "coo", "table") + local roo = checkedkey(view, "roo", "number") + local azimuth = checkedkey(view, "azimuth", "number") + local altitude = checkedkey(view, "altitude", "number") + + if c2c or coo or roo or azimuth or altitude then + + local pos = checkedkey(view, "pos", "table") + local dir = checkedkey(view, "dir", "table") + local upv = checkedkey(view, "upv", "table") + local roll = checkedkey(view, "roll", "table") + + local coo_x, coo_y, coo_z = 0, 0, 0 + local dir_x, dir_y, dir_z = 0, 0, 0 + local trans_x, trans_y, trans_z = 0, 0, 0 + local left_x, left_y, left_z = 0, 0, 0 + local up_x, up_y, up_z = 0, 0, 0 + + -- point camera is aimed at + + if coo then + coo_x, coo_y, coo_z = tonumber(coo[1]) or 0, tonumber(coo[2]) or 0, tonumber(coo[3]) or 0 + end + + -- distance from camera to target + + if roo then + roo = abs(roo) + end + if not roo or roo == 0 then + roo = 0.000000000000000001 + end + + -- set it via camera position + + if pos then + dir_x = coo_x - (tonumber(pos[1]) or 0) + dir_y = coo_y - (tonumber(pos[2]) or 0) + dir_z = coo_z - (tonumber(pos[3]) or 0) + if not roo then + roo = sqrt(dir_x*dir_x + dir_y*dir_y + dir_z*dir_z) + end + if dir_x == 0 and dir_y == 0 and dir_z == 0 then dir_y = 1 end + dir_x, dir_y, dir_z = normalize(dir_x,dir_y,dir_z) + end + + -- set it directly + + if dir then + dir_x, dir_y, dir_z = tonumber(dir[1] or 0), tonumber(dir[2] or 0), tonumber(dir[3] or 0) + if dir_x == 0 and dir_y == 0 and dir_z == 0 then dir_y = 1 end + dir_x, dir_y, dir_z = normalize(dir_x,dir_y,dir_z) + end + + -- set it movie15 style with vector from target to camera + + if c2c then + dir_x, dir_y, dir_z = - tonumber(c2c[1] or 0), - tonumber(c2c[2] or 0), - tonumber(c2c[3] or 0) + if dir_x == 0 and dir_y == 0 and dir_z == 0 then dir_y = 1 end + dir_x, dir_y, dir_z = normalize(dir_x,dir_y,dir_z) + end + + -- set it with azimuth and altitutde + + if altitude or azimuth then + dir_x, dir_y, dir_z = -1, 0, 0 + if altitude then dir_x, dir_y, dir_z = rotate(dir_x,dir_y,dir_z, -altitude, 0,1,0) end + if azimuth then dir_x, dir_y, dir_z = rotate(dir_x,dir_y,dir_z, azimuth, 0,0,1) end + end + + -- set it with rotation like in MathGL + + if rot then + if dir_x == 0 and dir_y == 0 and dir_z == 0 then dir_z = -1 end + dir_x,dir_y,dir_z = rotate(dir_x,dir_y,dir_z, tonumber(rot[1]) or 0, 1,0,0) + dir_x,dir_y,dir_z = rotate(dir_x,dir_y,dir_z, tonumber(rot[2]) or 0, 0,1,0) + dir_x,dir_y,dir_z = rotate(dir_x,dir_y,dir_z, tonumber(rot[3]) or 0, 0,0,1) + end + + -- set it with default movie15 orientation looking up y axis + + if dir_x == 0 and dir_y == 0 and dir_z == 0 then dir_y = 1 end + + -- left-vector + -- up-vector + + if upv then + up_x, up_y, up_z = tonumber(upv[1]) or 0, tonumber(upv[2]) or 0, tonumber(upv[3]) or 0 + else + -- set default up-vector + if abs(dir_x) == 0 and abs(dir_y) == 0 then + if dir_z < 0 then + up_y = 1 -- top view + else + up_y = -1 -- bottom view + end + else + -- other camera positions than top and bottom, up-vector = up_world - (up_world dot dir) dir + up_x, up_y, up_z = - dir_z*dir_x, - dir_z*dir_y, - dir_z*dir_z + 1 + end + end + + -- normalize up-vector + + up_x, up_y, up_z = normalize(up_x,up_y,up_z) + + -- left vector = up x dir + + left_x, left_y, left_z = dir_z*up_y - dir_y*up_z, dir_x*up_z - dir_z*up_x, dir_y*up_x - dir_x*up_y + + -- normalize left vector + + left_x, left_y, left_z = normalize(left_x,left_y,left_z) + + -- apply camera roll + + if roll then + local sinroll = sin((roll/180.0)*pi) + local cosroll = cos((roll/180.0)*pi) + left_x = left_x*cosroll + up_x*sinroll + left_y = left_y*cosroll + up_y*sinroll + left_z = left_z*cosroll + up_z*sinroll + up_x = up_x*cosroll + left_x*sinroll + up_y = up_y*cosroll + left_y*sinroll + up_z = up_z*cosroll + left_z*sinroll + end + + -- translation vector + + trans_x, trans_y, trans_z = coo_x - roo*dir_x, coo_y - roo*dir_y, coo_z - roo*dir_z + + viewdict.MS = pdfconstant("M") + viewdict.CO = roo + viewdict.C2W = pdfarray { + left_x, left_y, left_z, + up_x, up_y, up_z, + dir_x, dir_y, dir_z, + trans_x, trans_y, trans_z, + } + + end + + local aac = tonumber(view.aac) -- perspective projection + local mag = tonumber(view.mag) -- ortho projection + + if aac and aac > 0 and aac < 180 then + viewdict.P = pdfdictionary { + Subtype = pdfconstant("P"), + PS = pdfconstant("Min"), + FOV = aac, + } + elseif mag and mag > 0 then + viewdict.P = pdfdictionary { + Subtype = pdfconstant("O"), + OS = mag, + } + end + + local mode = modes[view.rendermode] + if mode then + pdfdictionary { + Type = pdfconstant("3DRenderMode"), + Subtype = pdfconstant(mode), + } + end + + -- crosssection + + local crosssection = checkedkey(view,"crosssection","table") + if crosssection then + local crossdict = pdfdictionary { + Type = pdfconstant("3DCrossSection") + } + + local c = checkedkey(crosssection,"point","table") or checkedkey(crosssection,"center","table") + if c then + crossdict.C = pdfarray { tonumber(c[1]) or 0, tonumber(c[2]) or 0, tonumber(c[3]) or 0 } + end + + local normal = checkedkey(crosssection,"normal","table") + if normal then + local x, y, z = tonumber(normal[1] or 0), tonumber(normal[2] or 0), tonumber(normal[3] or 0) + if sqrt(x*x + y*y + z*z) == 0 then + x, y, z = 1, 0, 0 + end + crossdict.O = pdfarray { + pdfnull, + atan2(-z,sqrt(x*x + y*y))*180/pi, + atan2(y,x)*180/pi, + } + end + + local orient = checkedkey(crosssection,"orient","table") + if orient then + crossdict.O = pdfarray { + tonumber(orient[1]) or 1, + tonumber(orient[2]) or 0, + tonumber(orient[3]) or 0, + } + end + + crossdict.IV = cross.intersection or false + crossdict.ST = cross.transparent or false + + viewdict.SA = next(crossdict) and pdfarray { crossdict } -- maybe test if # > 1 + end + + local nodes = checkedkey(view,"nodes","table") + if nodes then + local nodelist = pdfarray() + for i=1,#nodes do + local node = checkedkey(nodes,i,"table") + if node then + local position = checkedkey(node,"position","table") + position = position and #position == 12 and pdfarray(position) + if position then + nodelist[#nodelist+1] = pdfdictionary { + Type = pdfconstant("3DNode"), + N = node.name or ("node_" .. i), -- pdfunicode ? + V = node.visible or true, + O = node.opacity or 0, + RM = pdfdictionary { + Type = pdfconstant("3DRenderMode"), + Subtype = pdfconstant(node.rendermode or "Solid"), + }, + M = position, + } + end + end + end + viewdict.NR = true + viewdict.NA = nodelist + end + + return viewdict + +end + +local stored_js, stored_3d, stored_pr, streams = { }, { }, { }, { } + +function backends.pdf.helpers.insert3d(spec) -- width, height, factor, display, controls, label, foundname + + local width, height, factor = spec.width, spec.height, spec.factor or number.dimenfactors.bp + local display, controls, label, foundname = spec.display, spec.controls, spec.label, spec.foundname + + local param = (display and parametersets[display]) or { } + local streamparam = (controls and parametersets[controls]) or { } + local name = "3D Artwork " .. (param.name or label or "Unknown") + + local activationdict = pdfdictionary { + TB = pdfboolean(param.toolbar,true), + NP = pdfboolean(param.tree,true), + } + + local stream = streams[label] + if not stream then + local attr = pdfdictionary { + Type = pdfconstant("3D"), + Subtype = pdfconstant("U3D"), + } + local streamviews = checkedkey(streamparam, "views", "table") + if streamviews then + local list = pdfarray() + for i=1,#streamviews do + local v = checkedkey(streamviews, i, "table") + if v then + list[#list+1] = make3dview(v) + end + end + attr.VA = list + end + if checkedkey(streamparam, "view", "table") then + attr.DV = make3dview(streamparam.view) + elseif checkedkey(streamparam, "view", "string") then + attr.DV = streamparam.view + end + local js = checkedkey(streamparam, "js", "string") + if js then + local jsref = stored_js[js] + if not jsref then + jsref = pdf.immediateobj("streamfile",js) + stored_js[js] = jsref + end + attr.OnInstantiate = pdfreference(jsref) + end + stored_3d[label] = pdf.immediateobj("streamfile",foundname,attr()) + stream = 1 + else + stream = stream + 1 + end + streams[label] = stream + + local name = pdfunicode(name) + + local annot = pdfdictionary { + Subtype = pdfconstant("3D"), + T = name, + Contents = name, + NM = name, + ["3DD"] = pdfreference(stored_3d[label]), + ["3DA"] = activationdict, + } + if checkedkey(param,"view","table") then + annot["3DV"] = make3dview(param.view) + elseif checkedkey(param,"view","string") then + annot["3DV"] = param.view + end + + local preview = checkedkey(param,"preview","string") + if preview then + activationdict.A = pdfconstant("XA") + local tag = format("%s:%s:%s",label,stream,preview) + local ref = stored_pr[tag] + if not ref then + -- weird, has to be a /Form and not an /Image so we need a wrap = true key + -- local figure = img.immediatewrite { filename = preview, width = width, height = height } + local figure = img.immediatewrite { stream = ".5 .75 .75 rg 0 0 20 10 re f", bbox = {0,0,20,10 } } + ref = figure.objnum + stored_pr[tag] = ref + end + annot.AP = ref and pdfdictionary { N = pdfreference(ref) } + return annot, figure, ref + else + activationdict.A = pdfconstant("PV") + return annot, nil, nil + end +end diff --git a/tex/context/base/lpdf-wid.lua b/tex/context/base/lpdf-wid.lua new file mode 100644 index 000000000..cc61a4f96 --- /dev/null +++ b/tex/context/base/lpdf-wid.lua @@ -0,0 +1,328 @@ +if not modules then modules = { } end modules ['lpdf-wid'] = { + version = 1.001, + comment = "companion to lpdf-ini.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local format, gmatch, gsub, find = string.format, string.gmatch, string.gsub, string.find +local texsprint, ctxcatcodes, texbox, texcount = tex.sprint, tex.ctxcatcodes, tex.box, tex.count + +local nodeinjections = backends.pdf.nodeinjections +local codeinjections = backends.pdf.codeinjections +local registrations = backends.pdf.registrations + +local executers = jobreferences.executers +local variables = interfaces.variables + +local pdfconstant = lpdf.constant +local pdfdictionary = lpdf.dictionary +local pdfarray = lpdf.array +local pdfreference = lpdf.reference +local pdfunicode = lpdf.unicode +local pdfcolorspec = lpdf.colorspec + +local pdfreserveobj = pdf.reserveobj +local pdfimmediateobj = pdf.immediateobj + +-- symbols + +local presets = { } -- xforms + +function codeinjections.registersymbol(name,n) + presets[name] = pdfreference(n) +end + +function codeinjections.registeredsymbol(name) + return presets[name] +end + +function codeinjections.presetsymbollist(list) + if list then + for s in gmatch(list,"[^, ]+") do + if not presets[s] then + texsprint(ctxcatcodes,format("\\predefinesymbol[%s]",s)) + end + end + end +end + +-- comments + +local symbols = { + New = pdfconstant("Insert"), + Insert = pdfconstant("Insert"), + Balloon = pdfconstant("Comment"), + Comment = pdfconstant("Comment"), + Text = pdfconstant("Note"), + Addition = pdfconstant("NewParagraph"), + NewParagraph = pdfconstant("NewParagraph"), + Help = pdfconstant("Help"), + Paragraph = pdfconstant("Paragraph"), + Key = pdfconstant("Key"), + Graph = pdfconstant("Graph"), + Paperclip = pdfconstant("Paperclip"), + Attachment = pdfconstant("Attachment"), + Tag = pdfconstant("Tag"), +} + +symbols[variables.normal] = pdfconstant("Note") + +local nofcomments, usepopupcomments, stripleading = 0, true, true + +local function analyzesymbol(symbol) + if not symbol or symbol == "" then + return symbols.normal, nil + elseif symbols[symbol] then + return symbols[symbol], nil + else + local set = aux.settings_to_array(symbol) + local normal, down = set[1], set[2] + if normal then + normal = codeinjections.registeredsymbol(down or normal) + end + if down then + down = codeinjections.registeredsymbol(normal) + end + if down or normal then + return nil, pdfdictionary { + N = normal, + D = down, + } + end + end +end + +local function analyzelayer(layer) + -- todo: (specification.layer ~= "" and pdfreference(specification.layer)) or nil, -- todo: ref to layer +end + +function codeinjections.registercomment(specification) + nofcomments = nofcomments + 1 + local text = buffers.collect(specification.buffer) + if stripleading then + text = gsub(text,"[\n\r] *","\n") + end + local name, appearance = analyzesymbol(specification.symbol) + local d = pdfdictionary { + Subtype = pdfconstant("Text"), + Open = specification.open, + Contents = pdfunicode(text), + T = (specification.title ~= "" and pdfunicode(specification.title)) or nil, + C = pdfcolorspec(specification.colormodel,specification.colorvalue), + OC = analyzelayer(specification.layer), + Name = name, + AP = appearance, + } + -- watch the nice feed back to tex hack + if usepopupcomments then + local nd = pdfreserveobj() + local nc = pdfreserveobj() + local c = pdfdictionary { + Subtype = pdfconstant("Popup"), + Parent = pdfreference(nd), + } + d.Popup = pdfreference(nc) + texbox["commentboxone"] = node.hpack(nodes.pdfannot(0,0,0,d(),nd)) + texbox["commentboxtwo"] = node.hpack(nodes.pdfannot(specification.width,specification.height,0,c(),nc)) + else + texbox["commentboxone"] = node.hpack(nodes.pdfannot(0,0,0,d())) + texbox["commentboxtwo"] = nil + end +end + +-- + +local nofattachments, attachments, filestreams = 0, { }, { } + +function codeinjections.attachfile(specification) + local attachment = interactions.attachment(specification.label) + if not attachment then + -- todo: message + return + end + local filename = attachment.filename + if not filename or filename == "" then + -- todo: message + return + end + nofattachments = nofattachments + 1 + local label = attachment.label or "" + local title = attachment.title or "" + local newname = attachment.newname or "" + if label == "" then label = filename end + if title == "" then title = label end + if newname == "" then newname = filename end + local aref = attachments[label] + if not aref then + if not lfs.isfile(filename) then + interfaces.showmessage("interactions",5,filename) + return -- todo: message + else + local f = pdf.immediateobj("streamfile",filename) + filestreams[filename] = f + local d = pdfdictionary { + Type = pdfconstant("Filespec"), + F = newname, + EF = pdfdictionary { F = pdfreference(d) }, + } + aref = pdfreference(pdfimmediateobj(tostring(d))) + attachments[label] = aref + end + end + local name, appearance = analyzesymbol(specification.symbol) + local d = pdfdictionary { + Subtype = pdfconstant("FileAttachment"), + FS = aref, + Contents = pdfunicode(title), + Name = name, + AP = appearance, + OC = analyzelayer(specification.layer), + C = pdfcolorspec(specification.colormodel,specification.colorvalue), + } + local width = specification.width or 0 + local height = specification.height or 0 + local depth = specification.depth or 0 + node.write(nodes.pdfannot(width,height,depth,d())) +end + +function codeinjections.attachmentid(filename) + return filestreams[filename] +end + +-- rendering stuff +-- +-- object_1 -> <> >> +-- object_2 -> <> >> +-- rendering -> <> +-- +-- we only work foreward here +-- annotation is to be packed at the tex end + +-- aiff audio/aiff +-- au audio/basic +-- avi video/avi +-- mid audio/midi +-- mov video/quicktime +-- mp3 audio/x-mp3 (mpeg) +-- mp4 audio/mp4 +-- mp4 video/mp4 +-- mpeg video/mpeg +-- smil application/smil +-- swf application/x-shockwave-flash + +local ms, mu, mf = { }, { }, { } + +local delayed = { } + +local function insertrenderingwindow(label,width,height,specification) + if options == variables.auto then + if openpageaction then + -- \handlereferenceactions{\v!StartRendering{#2}} + end + if closepageaction then + -- \handlereferenceactions{\v!StopRendering {#2}} + end + end + local actions = nil + if openpage or closepage then + actions = pdfdictionary { + PO = (openpage and lpdf.pdfaction(openpage )) or nil, + PC = (closepage and lpdf.pdfaction(closepage)) or nil, + } + end + local page = tonumber(specification.page) or texcount.realpageno + local d = pdfdictionary { + Subtype = pdfconstant("Screen"), + P = pdfreference(tex.pdfpageref(page)), + A = mf[label], + Border = pdfarray { 0, 0, 0 } , + AA = actions, + } + local r = pdfreserveobj("annot") + node.write(nodes.pdfannot(label,width,height,d(),r)) -- save ref + return pdfreference(r) +end + +local function insertrendering(specification) + local label = specification.label + if not mf[label] then + local filename = specification.filename + local isurl = find(filename,"://") + local d = pdfdictionary { + Type = pdfconstant("Rendition"), + S = pdfconstant("MR"), + C = pdfdictionary { + Type = pdfconstant("MediaClip"), + S = pdfconstant("MCD"), + N = label, + CT = specification.mime, + Alt = pdfarray { + "", "file not found", -- language id + message + }, + D = pdfdictionary { + Type = pdfconstant("Filespec"), + F = filename, + FS = (isurl and pdfconstant("URL")) or nil, + } + } + } + mf[label] = pdfreference(pdfimmediateobj(tostring(d))) + if not ms[label] then + mu[label] = insertrenderingwindow(label,0,0,specification.options) + end + end +end + +local function insertrenderingobject(specification) + local label = specification.label + if not mf[label] then + local d = pdfdictionary { + Type = pdfconstant("Rendition"), + S = pdfconstant("MR"), + C = pdfdictionary { + Type = pdfconstant("MediaClip"), + S = pdfconstant("MCD"), + N = label, + D = pdfreference(unknown), -- not label but objectname, hm + } + } + mf[label] = pdfreference(pdfimmediateobj(tostring(d))) + if ms[label] then + insertrenderingwindow(label,0,0,specification) + end + end +end + +function codeinjections.insertrenderingwindow(specification) + local label = specification.label + codeinjections.processrendering(label) -- was check at tex end + ms[label] = insertrenderingwindow(label,specification.width,specification.height,specification) +end + +function codeinjections.processrendering(label) + local specification = interactions.rendering(label) + if specification then + if specification.kind == "external" then + insertrendering(specification) + else + insertrenderingobject(specification) + end + end +end + +local function set(operation,arguments) + codeinjections.processrendering(arguments) -- was check at the tex end + return pdfdictionary { + S = pdfconstant("Rendition"), + OP = operation, + R = mf[arguments], + AN = ms[arguments] or mu[arguments], + } +end + +function executers.startrendering (arguments) return set(0,arguments) end +function executers.stoprendering (arguments) return set(1,arguments) end +function executers.pauserendering (arguments) return set(2,arguments) end +function executers.resumerendering(arguments) return set(3,arguments) end diff --git a/tex/context/base/luat-bas.mkiv b/tex/context/base/luat-bas.mkiv index a78455173..581a5d95a 100644 --- a/tex/context/base/luat-bas.mkiv +++ b/tex/context/base/luat-bas.mkiv @@ -51,6 +51,7 @@ \registerctxluafile{l-dimen} {1.001} \registerctxluafile{l-url} {1.001} \registerctxluafile{l-set} {1.001} +\registerctxluafile{l-dimen} {1.001} % \registerctxluafile{socket.lua}{} % \registerctxluafile{ltn12.lua} {} diff --git a/tex/context/base/luat-cod.mkiv b/tex/context/base/luat-cod.mkiv index 07db36483..001cc2aa9 100644 --- a/tex/context/base/luat-cod.mkiv +++ b/tex/context/base/luat-cod.mkiv @@ -60,7 +60,7 @@ %D Here we operate in the \TEX\ catcode regime as we haven't yet defined %D catcode regimes. A chicken or egg problem. -\long\def\startruntimeluacode#1\stopruntimeluacode % only simple code (load +init) +\normalprotected\long\def\startruntimeluacode#1\stopruntimeluacode % only simple code (load +init) {\ifproductionrun \global\let\startruntimeluacode\relax \global\let\stopruntimeluacode \relax @@ -69,7 +69,7 @@ \fi #1} % maybe no interference -\long\def\startruntimectxluacode#1\stopruntimectxluacode +\normalprotected\long\def\startruntimectxluacode#1\stopruntimectxluacode {\startruntimeluacode\ctxlua{#1}\stopruntimeluacode} %D Next we load the initialization code. @@ -133,7 +133,7 @@ \def\ctxluabyteload#1#2% registers and compiles chunk {\global\advance\luabytecodecounter \plusone - \expanded{\startruntimectxluacode + \normalexpanded{\startruntimectxluacode lua.bytedata[\the\luabytecodecounter] = { "#1", "#2" } \stopruntimectxluacode}% \ctxlua { diff --git a/tex/context/base/luat-ini.mkiv b/tex/context/base/luat-ini.mkiv index 2a132c38e..84214ea73 100644 --- a/tex/context/base/luat-ini.mkiv +++ b/tex/context/base/luat-ini.mkiv @@ -134,24 +134,12 @@ \obeyluatokens \csname dodostartnamed#1\v!code\endcsname} -\ifdefined\closelua - - \def\definenamedlua[#1]#2[#3]% no optional arg handling here yet - {\expanded{\long\def\csname dodostartnamed#1\v!code\endcsname####1\csname\e!stop#1\v!code\endcsname}% - {\normalexpanded{\endgroup\noexpand\directlua\!!name{#3}\zerocount{protect("#1\s!data")##1}}}% - \long\expandafter\def\csname\e!start#1\v!code\endcsname {\dostartnamedluacode{#1}}% - \long\expandafter\def\csname #1\v!code\endcsname##1{\directlua\!!name{#3}\zerocount{protect("#1\s!data")##1}}} - -\else - - \def\definenamedlua[#1]#2[#3]% no optional arg handling here yet - {\scratchcounter\ctxlua{lua.registername("#1","#3")}% - \expanded{\long\edef\csname dodostartnamed#1\v!code\endcsname####1\csname\e!stop#1\v!code\endcsname}% - {\endgroup\noexpand\directlua\the\scratchcounter{protect("#1\s!data")##1}}% - \long\expandafter\def \csname\e!start#1\v!code\endcsname {\dostartnamedluacode{#1}}% - \long\expandafter\edef\csname #1\v!code\endcsname##1{\noexpand\directlua\the\scratchcounter{protect("#1\s!data")##1}}} - -\fi +\def\definenamedlua[#1]#2[#3]% no optional arg handling here yet + {\scratchcounter\ctxlua{lua.registername("#1","#3")}% + \normalexpanded{\long\edef\csname dodostartnamed#1\v!code\endcsname##1\csname\e!stop#1\v!code\endcsname}% + {\endgroup\noexpand\directlua\the\scratchcounter{protect("#1\s!data")##1}}% + \long\expandafter\def \csname\e!start#1\v!code\endcsname {\dostartnamedluacode{#1}}% + \long\expandafter\edef\csname #1\v!code\endcsname##1{\noexpand\directlua\the\scratchcounter{protect("#1\s!data")##1}}} %D We predefine a few. @@ -244,4 +232,8 @@ % % options=\luaparameterset{u3d:myset:display:1}{toolbar=false,tree=true} +%D A Handy helper: + +\def\luaconditional#1{\ifcase#1tru\else fals\fi e} + \protect \endinput diff --git a/tex/context/base/luat-lib.mkiv b/tex/context/base/luat-lib.mkiv index 1905ee67d..f8f71dd0a 100644 --- a/tex/context/base/luat-lib.mkiv +++ b/tex/context/base/luat-lib.mkiv @@ -42,7 +42,7 @@ \registerctxluafile{luat-ini} {1.001} \registerctxluafile{luat-env} {1.001} -\registerctxluafile{l-xml} {1.001} % we want tracking +\registerctxluafile{l-xml} {1.001} % we need to load lxml-tab earlier so this will change ! \startruntimeluacode \edef\asciia{\ctxlua{tex.sprint(logs.mode)}} diff --git a/tex/context/base/lxml-ini.mkiv b/tex/context/base/lxml-ini.mkiv new file mode 100644 index 000000000..494e4f0b7 --- /dev/null +++ b/tex/context/base/lxml-ini.mkiv @@ -0,0 +1,408 @@ +%D \module +%D [ file=lxml-ini, +%D version=2007.08.17, +%D title=\CONTEXT\ \XML\ Support, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Support / Initialization} + +\registerctxluafile{lxml-tab}{1.001} +\registerctxluafile{lxml-pth}{1.001} +\registerctxluafile{lxml-ent}{1.001} +\registerctxluafile{lxml-mis}{1.001} +\registerctxluafile{lxml-ini}{1.001} + +\unprotect + +\def\xmlmain #1{\ctxlua{lxml.main("#1")}} +\def\xmlall #1#2{\ctxlua{lxml.all("#1","#2")}} +\def\xmlatt #1#2{\ctxlua{lxml.attribute("#1","/","#2")}} +\def\xmlattdef #1#2#3{\ctxlua{lxml.attribute("#1","/","#2","#3")}} +\def\xmlattribute #1#2#3{\ctxlua{lxml.attribute("#1","#2","#3")}} +\def\xmlattributedef #1#2#3#4{\ctxlua{lxml.attribute("#1","#2","#3","#4")}} +\def\xmlcommand #1#2#3{\ctxlua{lxml.command("#1","#2","#3")}} +\def\xmlconcat #1#2#3{\ctxlua{lxml.concat("#1","#2",[[\detokenize{#3}]])}} +\def\xmlconcatrange#1#2#3#4#5{\ctxlua{lxml.concatrange("#1","#2","#3","#4",[[\detokenize{#5}]])}} +\def\xmlcount #1#2{\ctxlua{lxml.count("#1","#2")}} +\def\xmldelete #1#2{\ctxlua{xml.delete(lxml.id("#1"),"#2")}} +\def\xmldirectives #1{\ctxlua{lxml.directives.setup("#1")}} +\def\xmldirectivesbefore #1{\ctxlua{lxml.directives.before("#1")}} +\def\xmldirectivesafter #1{\ctxlua{lxml.directives.after("#1")}} +\def\xmlfilter #1#2{\ctxlua{lxml.filter("#1",\!!bs#2\!!es)}} +\def\xmlfirst #1#2{\ctxlua{lxml.first("#1","#2")}} +\def\xmlflush #1{\ctxlua{lxml.flush("#1")}} +% \def\xmlcontent #1{\ctxlua{lxml.content("#1")}} +% \def\xmlstrip #1{\ctxlua{lxml.strip("#1")}} +% \def\xmlflushstripped #1{\ctxlua{lxml.strip("#1",true)}} +\def\xmldirect #1{\ctxlua{lxml.direct("#1")}} % in loops, not dt but root +\def\xmlidx #1#2#3{\ctxlua{lxml.idx("#1","#2",\number#3)}} +\def\xmlinclude #1#2#3{\ctxlua{lxml.include("#1","#2","#3",true)}} +\def\xmlindex #1#2#3{\ctxlua{lxml.index("#1","#2",\number#3)}} +\def\xmlinfo #1{\hbox{\ttxx[\ctxlua{lxml.info("#1")}]}} +\def\xmlshow #1{\startpacked\ttx\xmlverbatim{#1}\stoppacked} +\def\xmllast #1#2{\ctxlua{lxml.last("#1","#2")}} +\def\xmlload #1#2{\ctxlua{lxml.load("#1","#2")}} +\def\xmlloadbuffer #1#2{\ctxlua{lxml.loadbuffer("#1","#2")}} +\def\xmlloaddata #1#2{\ctxlua{lxml.loaddata("#1",\!!bs#2\!!es)}} +\def\xmlloadregistered #1#2{\ctxlua{lxml.loadregistered("#1")}} +\def\xmlloaddirectives #1{\ctxlua{lxml.directives.load("#1")}} +\def\xmlname #1{\ctxlua{lxml.name("#1")}} +\def\xmlnamespace #1{\ctxlua{lxml.namespace("#1")}} +\def\xmlnonspace #1#2{\ctxlua{lxml.nonspace("#1","#2")}} +\def\xmlraw #1#2{\ctxlua{lxml.raw("#1","#2")}} +\def\xmlsnippet #1#2{\ctxlua{lxml.snippet("#1",#2)}} +\def\xmlelement #1#2{\ctxlua{lxml.element("#1",#2)}} +\def\xmlnofelements #1{\ctxlua{lxml.nofelements("#1")}} +\def\xmlregisterns #1#2{\ctxlua{xml.registerns("#1","#2")}} % document +\def\xmlremapname #1#2#3#4{\ctxlua{xml.remapname(lxml.id("#1"),"#2","#3","#4")}} % element +\def\xmlremapnamespace #1#2#3{\ctxlua{xml.rename_space(lxml.id("#1"),"#2","#3")}} % document +\def\xmlchecknamespace #1#2#3{\ctxlua{xml.check_namespace(lxml.id("#1"),"#2","#3")}} % element +\def\xmlsetfunction #1#2#3{\ctxlua{lxml.setaction("#1","#2",#3)}} +\def\xmlsetsetup #1#2#3{\ctxlua{lxml.setsetup("#1","#2","#3")}} +\def\xmlstrip #1#2{\ctxlua{lxml.strip("#1","#2")}} +\def\xmlstripped #1#2{\ctxlua{lxml.stripped("#1","#2")}} +\def\xmlstripnolines #1#2{\ctxlua{lxml.strip("#1","#2",true)}} +\def\xmlstrippednolines #1#2{\ctxlua{lxml.stripped("#1","#2",true)}} +\def\xmltag #1{\ctxlua{lxml.tag("#1")}} +\def\xmltext #1#2{\ctxlua{lxml.text("#1","#2")}} +\def\xmltags #1#2{\ctxlua{lxml.tags("#1","#2")}} +\def\xmlutfize #1{\ctxlua{lxml.utfize("#1")}} +\def\xmlverbatim #1{\ctxlua{lxml.verbatim("#1")}} +\def\xmldisplayverbatim #1{\ctxlua{lxml.displayverbatim("#1")}} +\def\xmlinlineverbatim #1{\ctxlua{lxml.inlineverbatim("#1")}} + +%def\xmldoifelse #1#2{\ctxlua{cs.testcase(xml.found(lxml.id("#1"),"#2",false))}} +%def\xmldoifelsetext #1#2{\ctxlua{cs.testcase(xml.found(lxml.id("#1"),"#2",true ))}} + +% kind of special: + +\def\xmlstartraw{\ctxlua{lxml.startraw()}} +\def\xmlstopraw {\ctxlua{lxml.stopraw()}} + +% todo: \xmldoifelseattribute + +\def\xmldoif #1#2{\ctxlua{lxml.doif("#1","#2")}} +\def\xmldoifnot #1#2{\ctxlua{lxml.doifnot("#1","#2")}} +\def\xmldoifelse #1#2{\ctxlua{lxml.doifelse("#1","#2")}} +\def\xmldoiftext #1#2{\ctxlua{lxml.doiftext("#1","#2")}} +\def\xmldoifnottext #1#2{\ctxlua{lxml.doifnottext("#1","#2")}} +\def\xmldoifelsetext #1#2{\ctxlua{lxml.doifelsetext("#1","#2")}} +\def\xmldoifelseempty #1#2{\ctxlua{lxml.doifelseempty("#1","#2")}} % #2, "*" or "" == self not yet implemented +\def\xmldoifelseselfempty #1{\ctxlua{lxml.doifelseempty("#1")}} + +\def\xmldefaulttotext #1{\ifcase\xmlprocessingmode\or\or \ctxlua{lxml.set_command_to_text("#1")}\fi} +\def\xmldefaulttonone #1{\ifcase\xmlprocessingmode\or\or\or\ctxlua{lxml.set_command_to_none("#1")}\fi} + +% \startxmlsetups xml:include +% \xmlinclude{main}{include}{filename|href} +% \stopxmlsetups +% +% \xmlprependsetup{xml:include} + +\let\xmlgrab\xmlsetsetup + +\def\xmlsetup#1#2% % we pass the reference so that we have access to the frozen number + {\def\xmlself{#1}% % by using #1 inside a setup + \setupwithargument{#2}{#1}} + +\newtoks \registeredxmlsetups + +% todo: 1:xml:whatever alwas before 3:xml:something + +\def\xmlprependsetup #1{\ctxlua{lxml.installsetup(1,"*","#1")}} +\def\xmlappendsetup #1{\ctxlua{lxml.installsetup(2,"*","#1")}} +\def\xmlbeforesetup #1#2{\ctxlua{lxml.installsetup(3,"*","#1","#2"))}} +\def\xmlaftersetup #1#2{\ctxlua{lxml.installsetup(4,"*","#1","#2"))}} + +\def\xmlprependdocumentsetup #1#2{\ctxlua{lxml.installsetup(1,"#1","#2")}} +\def\xmlappenddocumentsetup #1#2{\ctxlua{lxml.installsetup(2,"#1","#2")}} +\def\xmlbeforedocumentsetup#1#2#3{\ctxlua{lxml.installsetup(3,"#1","#2","#3"))}} +\def\xmlafterdocumentsetup #1#2#3{\ctxlua{lxml.installsetup(4,"#1","#2","#3"))}} + +\def\xmlremovesetup #1{\ctxlua{lxml.removesetup("*","#1")}} +\def\xmlremovedocumentsetup #1#2{\ctxlua{lxml.removesetup("#1","#2")}} + +\def\xmlflushdocumentsetups #1{\ctxlua{lxml.flushsetups("*","#1")}} +\def\xmlresetdocumentsetups #1{\ctxlua{lxml.resetsetups("#1")}} + +\let\xmlregistersetup \xmlappendsetup +\let\xmlregisterdocumentsetup\xmlappenddocumentsetup + +\def\xmldocument{main} + +\def\xmlregisteredsetups + {\xmlstarttiming + \xmlflushsetups + \xmldefaulttotext\xmldocument % after include + \xmlstoptiming} + +\def\xmlregistereddocumentsetups#1% + {\xmlstarttiming + % todo: test for duplicates ! + \xmlflushdocumentsetups{#1}% + \xmldefaulttotext{#1}% after include + \xmlstoptiming} + +\def\xmlstarttiming{\ctxlua{statistics.starttiming(lxml)}} +\def\xmlstoptiming {\ctxlua{statistics.stoptiming (lxml)}} + +\def\doxmlprocess#1#2#3#4% + {\begingroup + \edef\xmldocument{#2}% #2 can be \xmldocument and set as such + #1{#2}{#3}% + \ifcase\xmlprocessingmode + \enableXML + \else + \setcatcodetable\notcatcodes + \fi + \doifelsenothing{#4} + {\directsetup{xml:process}} + {\directsetup{#4}}% + \endgroup} + +\def\xmlprocessfile {\doxmlprocess\xmlload} +\def\xmlprocessdata {\doxmlprocess\xmlloaddata} +\def\xmlprocessbuffer {\doxmlprocess\xmlloadbuffer} +\def\xmlprocessregistered{\doxmlprocess\xmlloadregistered} +\let\xmlprocess \xmlprocessfile + +% beware: \xmlmain takes the real root, so also processing +% instructions preceding the root element; well, in some +% sense that is the root + +\startsetups xml:process + \xmlregistereddocumentsetups\xmldocument + \xmlmain\xmldocument +\stopsetups + +\long\def\xmlloop#1#2#3% + {\def\xmli##1##2{\xmlidx{#1}{#2/##1}{##2}}% + \dorecurse{\xmlcount{#1}{#2}}{#3}} + +\long\def\xmlconnect#1#2#3% inefficient + {\scratchcounter\xmlcount{#1}{#2}\relax + \ifcase\scratchcounter \or + \xmlall{#1}{#2}% + \else + \dorecurse \scratchcounter { + \ifnum\recurselevel>\plusone#3\fi + \xmlidx{#1}{#2}{\recurselevel} + } + \fi} + +\def\xmlcdataobeyedline {\obeyedline} +\def\xmlcdataobeyedspace{\strut\obeyedspace} +\def\xmlcdatabefore {\bgroup\tt} +\def\xmlcdataafter {\egroup} + +% verbatim (dodo:pre/post whitespace, maybe splot verbatim and +% cdata commands), experimental: +% +% \xmlsetfunction{main}{verbatim}{lxml.displayverbatim} +% \xmlsetfunction{main}{verb} {lxml.inlineverbatim} + +% \def\startxmldisplayverbatim[#1]{} +% \def\stopxmldisplayverbatim {} +% \def\startxmlinlineverbatim [#1]{} +% \def\stopxmlinlineverbatim {} + +% we use an xml: namespace so one has to define a suitable verbatim, say +% +% \definetyping[xml:verbatim][typing] +% +% this is experimental! + +\def\startxmldisplayverbatim[#1]% + {\startpacked % \begingroup + \let\currenttypingclass\??tp + \edef\currenttyping{xml:#1}% + \def\stopxmldisplayverbatim + {\endofverbatimlines + \stoppacked} % \endgroup + \mkinitializeverbatim + \beginofverbatimlines} + +\def\startxmlinlineverbatim[#1]% + {\begingroup + \let\currenttypingclass\??ty + \edef\currenttyping{xml:#1}% + \let\stopxmldisplayverbatim\endgroup + \mkinitializeverbatim} + +% will move but is developed for xml + +\newtoks \collectingtoks + +\def\startcollect#1\stopcollect + {\collectingtoks\@EA{\the\collectingtoks#1}} + +\def\startexpandedcollect#1\stopexpandedcollect + {\expanded{\collectingtoks{\the\collectingtoks#1}}} + +\def\startcollecting{\collectingtoks\emptytoks} +\def\stopcollecting {\the\collectingtoks} + +\def\inlinemessage #1{\dontleavehmode{\tttf#1}} +\def\displaymessage#1{\blank\inlinemessage{#1}\blank} + +\def\xmltraceentities + {\ctxlua{xml.set_text_cleanup(lxml.trace_text_entities)}% + \appendtoks\ctxlua{lxml.show_text_entities()}\to\everygoodbye} + +% processing instructions + +\def\xmlcontextdirective#1% kind class key value + {\executeifdefined{xml#1directive}\gobblethreearguments} + +% setting up xml: +% +% \setupxml[\c!method=mkii] % mixed mkiv and mkii +% \setupxml[\c!method=mkiv,\c!default=] % mkiv only +% \setupxml[\c!method=mkiv,\c!default=\v!none] % mkiv only, undefined -> hidden +% \setupxml[\c!method=mkiv,\c!default=\v!text] % mkiv only, undefined -> text + +% \def\xmlctxdirective#1#2#3{\doif{#1}{clue}{\doif{#2}{page}}{\page[#3]}} + +\chardef\xmlprocessingmode=0 % 0=mixed, 1=mkivonly, 2=mkivonly-default-text, 3=mkivonly-default-none + +% \setupxml[method=mkiv,strip=yes,entities=yes,default=text] + +\newtoks\everysetupxml + +\def\setupxml[#1]{\getparameters[\??xm][#1]\the\everysetupxml} + +\def\c!entities{entities} % to be internationalized +\def\s!mkiv {mkiv} +\def\s!mkii {mkii} + +% entities + +\newif\ifautoXMLentities + +\def\xmlkeepentities{\ctxlua{lxml.reset_entityhandler()}} +\def\xmlmkiientities{\ctxlua{lxml.set_mkii_entityhandler()}\autoXMLentitiestrue} +\def\xmlmkiventities{\ctxlua{lxml.set_mkiv_entityhandler()}} + +\let\xmlresolveentities\xmlmkiventities % will become \xmlmkiventities + +\letvalue{\??xm:1:\s!mkii }\zerocount +\letvalue{\??xm:1:\s!mkiv }\plusone + +\letvalue{\??xm:2:\v!none }\plusone +\letvalue{\??xm:2:\v!text }\plustwo +\letvalue{\??xm:2:\v!hidden}\plusthree + +\letvalue{\??xm:ii:\v!yes }\xmlresolveentities +\letvalue{\??xm:ii:\v!no }\xmlkeepentities +\letvalue{\??xm:ii:\s!mkii}\xmlmkiientities +\letvalue{\??xm:ii:\s!mkiv}\xmlmkiventities + +\letvalue{\??xm:iv:\v!yes }\xmlresolveentities +\letvalue{\??xm:iv:\v!no }\xmlkeepentities +\letvalue{\??xm:iv:\s!mkii}\xmlmkiventities +\letvalue{\??xm:iv:\s!mkiv}\xmlmkiventities + +\appendtoks + \chardef\xmlprocessingmode\executeifdefined{\??xm:1:\@@xmmethod}\zerocount + \ifcase\xmlprocessingmode + % mkii, permits both methods + \executeifdefined{\??xm:ii:\@@xmentities}\xmlkeepentities + \or + % mkiv, mkiv exclusively + \chardef\xmlprocessingmode\executeifdefined{\??xm:2:\@@xmdefault}\plusone + \executeifdefined{\??xm:iv:\@@xmentities}\xmlresolveentities + \else + % unset + \fi + \ifcase\xmlprocessingmode + \ctxlua{characters.setmkiientities()}% + \else + \ctxlua{characters.setmkiventities()}% + \fi + \doifelse\@@xmcompress\v!yes % this key may change, maybe compress=yes|no + {\ctxlua{xml.strip_cm_and_dt=true}} + {\ctxlua{xml.strip_cm_and_dt=false}}% +\to \everysetupxml + +\def\xmlinitialize{\the\everysetupxml} + +\newcount\charactersactiveoffset \charactersactiveoffset="10000 + +\startextendcatcodetable\ctxcatcodes + \catcode\numexpr\charactersactiveoffset+`<\relax=13 + \catcode\numexpr\charactersactiveoffset+`&\relax=13 + \catcode\numexpr\charactersactiveoffset+`>\relax=13 +\stopextendcatcodetable +\startextendcatcodetable\xmlcatcodes + \catcode\numexpr\charactersactiveoffset+`<\relax=13 + \catcode\numexpr\charactersactiveoffset+`&\relax=13 + \catcode\numexpr\charactersactiveoffset+`>\relax=13 +\stopextendcatcodetable + +\ctxlua { % entities are remembered in the format + characters.remapentity("<",characters.active_offset + utf.byte("<")) + characters.remapentity("&",characters.active_offset + utf.byte("&")) + characters.remapentity(">",characters.active_offset + utf.byte(">")) +} + +\setupxml + [\c!method=mkii, % mixed mode + \c!default=\v!hidden, % ignore elements that are not defined + \c!compress=\v!no, % strip comment + \c!entities=\v!yes] % replace entities + +% \defineXMLenvironment[y]{(}{)} +% +% \startxmlsetups x +% /\xmlflush{#1}/ +% \stopxmlsetups +% +% \startxmlsetups xx +% \xmlsetsetup{main}{x}{*} +% \stopxmlsetups +% +% \xmlregistersetup{xx} +% +% \startbuffer +% a <&>{b} c +% \stopbuffer +% +% mkii: [\processXMLbuffer]\quad mkiv: [\xmlprocessbuffer{main}{}{}] + +% some mkii commands, but mkiv-ified + +\def\xmlmapvalue#1#2#3{\setvalue{\??xm:v:#1:#2}{#3}} % keep #3 to grab spaces +\def\xmlvalue #1#2#3{\executeifdefined{\??xm:v:#1:#2}{#3}} + +\let\xmlmapval\xmlmapvalue +\let\xmlval \xmlvalue + +% brrrr, give this at the top of a style that needs to stub mkiv loading + +\def\remapXMLtoMKIV + {\ifx\xmldocument\undefined\def\xmldocument{main}\fi + \def\processXMLfile ##1{\xmlprocessfile \xmldocument{##1}{}}% + \def\processXMLfilegrouped ##1{\xmlprocessfile \xmldocument{##1}{}}% maybe still grouped? + \def\processXMLbuffer {\dosingleempty\doprocessXMLbuffer}% + \def\doprocessXMLbuffer [##1]{\xmlprocessbuffer\xmldocument{##1}{}}% + \def\XMLdata ##1{\xmlprocessdata \xmldocument{##1}{}}% + \def\startXMLdata##1\stopXMLdata{\xmlprocessdata \xmldocument{##1}{}}} + +\let\normalprocessXMLfilegrouped\processXMLfilegrouped + +\def\processXMLfileMKIV % one-shot, will become obsolete, personal hack + {\dosingleempty\doprocessXMLfileMKIV} + +\def\doprocessXMLfileMKIV[#1]% + {\def\processXMLfilegrouped##1% + {\let\processXMLfilegrouped\normalprocessXMLfilegrouped + \doifelsenothing{#1}{\xmlprocess{main}{##1}{}}{\xmlprocess{#1}{##1}{}}}} + +\protect \endinput diff --git a/tex/context/base/lxml-ini.tex b/tex/context/base/lxml-ini.tex deleted file mode 100644 index 494e4f0b7..000000000 --- a/tex/context/base/lxml-ini.tex +++ /dev/null @@ -1,408 +0,0 @@ -%D \module -%D [ file=lxml-ini, -%D version=2007.08.17, -%D title=\CONTEXT\ \XML\ Support, -%D subtitle=Initialization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Support / Initialization} - -\registerctxluafile{lxml-tab}{1.001} -\registerctxluafile{lxml-pth}{1.001} -\registerctxluafile{lxml-ent}{1.001} -\registerctxluafile{lxml-mis}{1.001} -\registerctxluafile{lxml-ini}{1.001} - -\unprotect - -\def\xmlmain #1{\ctxlua{lxml.main("#1")}} -\def\xmlall #1#2{\ctxlua{lxml.all("#1","#2")}} -\def\xmlatt #1#2{\ctxlua{lxml.attribute("#1","/","#2")}} -\def\xmlattdef #1#2#3{\ctxlua{lxml.attribute("#1","/","#2","#3")}} -\def\xmlattribute #1#2#3{\ctxlua{lxml.attribute("#1","#2","#3")}} -\def\xmlattributedef #1#2#3#4{\ctxlua{lxml.attribute("#1","#2","#3","#4")}} -\def\xmlcommand #1#2#3{\ctxlua{lxml.command("#1","#2","#3")}} -\def\xmlconcat #1#2#3{\ctxlua{lxml.concat("#1","#2",[[\detokenize{#3}]])}} -\def\xmlconcatrange#1#2#3#4#5{\ctxlua{lxml.concatrange("#1","#2","#3","#4",[[\detokenize{#5}]])}} -\def\xmlcount #1#2{\ctxlua{lxml.count("#1","#2")}} -\def\xmldelete #1#2{\ctxlua{xml.delete(lxml.id("#1"),"#2")}} -\def\xmldirectives #1{\ctxlua{lxml.directives.setup("#1")}} -\def\xmldirectivesbefore #1{\ctxlua{lxml.directives.before("#1")}} -\def\xmldirectivesafter #1{\ctxlua{lxml.directives.after("#1")}} -\def\xmlfilter #1#2{\ctxlua{lxml.filter("#1",\!!bs#2\!!es)}} -\def\xmlfirst #1#2{\ctxlua{lxml.first("#1","#2")}} -\def\xmlflush #1{\ctxlua{lxml.flush("#1")}} -% \def\xmlcontent #1{\ctxlua{lxml.content("#1")}} -% \def\xmlstrip #1{\ctxlua{lxml.strip("#1")}} -% \def\xmlflushstripped #1{\ctxlua{lxml.strip("#1",true)}} -\def\xmldirect #1{\ctxlua{lxml.direct("#1")}} % in loops, not dt but root -\def\xmlidx #1#2#3{\ctxlua{lxml.idx("#1","#2",\number#3)}} -\def\xmlinclude #1#2#3{\ctxlua{lxml.include("#1","#2","#3",true)}} -\def\xmlindex #1#2#3{\ctxlua{lxml.index("#1","#2",\number#3)}} -\def\xmlinfo #1{\hbox{\ttxx[\ctxlua{lxml.info("#1")}]}} -\def\xmlshow #1{\startpacked\ttx\xmlverbatim{#1}\stoppacked} -\def\xmllast #1#2{\ctxlua{lxml.last("#1","#2")}} -\def\xmlload #1#2{\ctxlua{lxml.load("#1","#2")}} -\def\xmlloadbuffer #1#2{\ctxlua{lxml.loadbuffer("#1","#2")}} -\def\xmlloaddata #1#2{\ctxlua{lxml.loaddata("#1",\!!bs#2\!!es)}} -\def\xmlloadregistered #1#2{\ctxlua{lxml.loadregistered("#1")}} -\def\xmlloaddirectives #1{\ctxlua{lxml.directives.load("#1")}} -\def\xmlname #1{\ctxlua{lxml.name("#1")}} -\def\xmlnamespace #1{\ctxlua{lxml.namespace("#1")}} -\def\xmlnonspace #1#2{\ctxlua{lxml.nonspace("#1","#2")}} -\def\xmlraw #1#2{\ctxlua{lxml.raw("#1","#2")}} -\def\xmlsnippet #1#2{\ctxlua{lxml.snippet("#1",#2)}} -\def\xmlelement #1#2{\ctxlua{lxml.element("#1",#2)}} -\def\xmlnofelements #1{\ctxlua{lxml.nofelements("#1")}} -\def\xmlregisterns #1#2{\ctxlua{xml.registerns("#1","#2")}} % document -\def\xmlremapname #1#2#3#4{\ctxlua{xml.remapname(lxml.id("#1"),"#2","#3","#4")}} % element -\def\xmlremapnamespace #1#2#3{\ctxlua{xml.rename_space(lxml.id("#1"),"#2","#3")}} % document -\def\xmlchecknamespace #1#2#3{\ctxlua{xml.check_namespace(lxml.id("#1"),"#2","#3")}} % element -\def\xmlsetfunction #1#2#3{\ctxlua{lxml.setaction("#1","#2",#3)}} -\def\xmlsetsetup #1#2#3{\ctxlua{lxml.setsetup("#1","#2","#3")}} -\def\xmlstrip #1#2{\ctxlua{lxml.strip("#1","#2")}} -\def\xmlstripped #1#2{\ctxlua{lxml.stripped("#1","#2")}} -\def\xmlstripnolines #1#2{\ctxlua{lxml.strip("#1","#2",true)}} -\def\xmlstrippednolines #1#2{\ctxlua{lxml.stripped("#1","#2",true)}} -\def\xmltag #1{\ctxlua{lxml.tag("#1")}} -\def\xmltext #1#2{\ctxlua{lxml.text("#1","#2")}} -\def\xmltags #1#2{\ctxlua{lxml.tags("#1","#2")}} -\def\xmlutfize #1{\ctxlua{lxml.utfize("#1")}} -\def\xmlverbatim #1{\ctxlua{lxml.verbatim("#1")}} -\def\xmldisplayverbatim #1{\ctxlua{lxml.displayverbatim("#1")}} -\def\xmlinlineverbatim #1{\ctxlua{lxml.inlineverbatim("#1")}} - -%def\xmldoifelse #1#2{\ctxlua{cs.testcase(xml.found(lxml.id("#1"),"#2",false))}} -%def\xmldoifelsetext #1#2{\ctxlua{cs.testcase(xml.found(lxml.id("#1"),"#2",true ))}} - -% kind of special: - -\def\xmlstartraw{\ctxlua{lxml.startraw()}} -\def\xmlstopraw {\ctxlua{lxml.stopraw()}} - -% todo: \xmldoifelseattribute - -\def\xmldoif #1#2{\ctxlua{lxml.doif("#1","#2")}} -\def\xmldoifnot #1#2{\ctxlua{lxml.doifnot("#1","#2")}} -\def\xmldoifelse #1#2{\ctxlua{lxml.doifelse("#1","#2")}} -\def\xmldoiftext #1#2{\ctxlua{lxml.doiftext("#1","#2")}} -\def\xmldoifnottext #1#2{\ctxlua{lxml.doifnottext("#1","#2")}} -\def\xmldoifelsetext #1#2{\ctxlua{lxml.doifelsetext("#1","#2")}} -\def\xmldoifelseempty #1#2{\ctxlua{lxml.doifelseempty("#1","#2")}} % #2, "*" or "" == self not yet implemented -\def\xmldoifelseselfempty #1{\ctxlua{lxml.doifelseempty("#1")}} - -\def\xmldefaulttotext #1{\ifcase\xmlprocessingmode\or\or \ctxlua{lxml.set_command_to_text("#1")}\fi} -\def\xmldefaulttonone #1{\ifcase\xmlprocessingmode\or\or\or\ctxlua{lxml.set_command_to_none("#1")}\fi} - -% \startxmlsetups xml:include -% \xmlinclude{main}{include}{filename|href} -% \stopxmlsetups -% -% \xmlprependsetup{xml:include} - -\let\xmlgrab\xmlsetsetup - -\def\xmlsetup#1#2% % we pass the reference so that we have access to the frozen number - {\def\xmlself{#1}% % by using #1 inside a setup - \setupwithargument{#2}{#1}} - -\newtoks \registeredxmlsetups - -% todo: 1:xml:whatever alwas before 3:xml:something - -\def\xmlprependsetup #1{\ctxlua{lxml.installsetup(1,"*","#1")}} -\def\xmlappendsetup #1{\ctxlua{lxml.installsetup(2,"*","#1")}} -\def\xmlbeforesetup #1#2{\ctxlua{lxml.installsetup(3,"*","#1","#2"))}} -\def\xmlaftersetup #1#2{\ctxlua{lxml.installsetup(4,"*","#1","#2"))}} - -\def\xmlprependdocumentsetup #1#2{\ctxlua{lxml.installsetup(1,"#1","#2")}} -\def\xmlappenddocumentsetup #1#2{\ctxlua{lxml.installsetup(2,"#1","#2")}} -\def\xmlbeforedocumentsetup#1#2#3{\ctxlua{lxml.installsetup(3,"#1","#2","#3"))}} -\def\xmlafterdocumentsetup #1#2#3{\ctxlua{lxml.installsetup(4,"#1","#2","#3"))}} - -\def\xmlremovesetup #1{\ctxlua{lxml.removesetup("*","#1")}} -\def\xmlremovedocumentsetup #1#2{\ctxlua{lxml.removesetup("#1","#2")}} - -\def\xmlflushdocumentsetups #1{\ctxlua{lxml.flushsetups("*","#1")}} -\def\xmlresetdocumentsetups #1{\ctxlua{lxml.resetsetups("#1")}} - -\let\xmlregistersetup \xmlappendsetup -\let\xmlregisterdocumentsetup\xmlappenddocumentsetup - -\def\xmldocument{main} - -\def\xmlregisteredsetups - {\xmlstarttiming - \xmlflushsetups - \xmldefaulttotext\xmldocument % after include - \xmlstoptiming} - -\def\xmlregistereddocumentsetups#1% - {\xmlstarttiming - % todo: test for duplicates ! - \xmlflushdocumentsetups{#1}% - \xmldefaulttotext{#1}% after include - \xmlstoptiming} - -\def\xmlstarttiming{\ctxlua{statistics.starttiming(lxml)}} -\def\xmlstoptiming {\ctxlua{statistics.stoptiming (lxml)}} - -\def\doxmlprocess#1#2#3#4% - {\begingroup - \edef\xmldocument{#2}% #2 can be \xmldocument and set as such - #1{#2}{#3}% - \ifcase\xmlprocessingmode - \enableXML - \else - \setcatcodetable\notcatcodes - \fi - \doifelsenothing{#4} - {\directsetup{xml:process}} - {\directsetup{#4}}% - \endgroup} - -\def\xmlprocessfile {\doxmlprocess\xmlload} -\def\xmlprocessdata {\doxmlprocess\xmlloaddata} -\def\xmlprocessbuffer {\doxmlprocess\xmlloadbuffer} -\def\xmlprocessregistered{\doxmlprocess\xmlloadregistered} -\let\xmlprocess \xmlprocessfile - -% beware: \xmlmain takes the real root, so also processing -% instructions preceding the root element; well, in some -% sense that is the root - -\startsetups xml:process - \xmlregistereddocumentsetups\xmldocument - \xmlmain\xmldocument -\stopsetups - -\long\def\xmlloop#1#2#3% - {\def\xmli##1##2{\xmlidx{#1}{#2/##1}{##2}}% - \dorecurse{\xmlcount{#1}{#2}}{#3}} - -\long\def\xmlconnect#1#2#3% inefficient - {\scratchcounter\xmlcount{#1}{#2}\relax - \ifcase\scratchcounter \or - \xmlall{#1}{#2}% - \else - \dorecurse \scratchcounter { - \ifnum\recurselevel>\plusone#3\fi - \xmlidx{#1}{#2}{\recurselevel} - } - \fi} - -\def\xmlcdataobeyedline {\obeyedline} -\def\xmlcdataobeyedspace{\strut\obeyedspace} -\def\xmlcdatabefore {\bgroup\tt} -\def\xmlcdataafter {\egroup} - -% verbatim (dodo:pre/post whitespace, maybe splot verbatim and -% cdata commands), experimental: -% -% \xmlsetfunction{main}{verbatim}{lxml.displayverbatim} -% \xmlsetfunction{main}{verb} {lxml.inlineverbatim} - -% \def\startxmldisplayverbatim[#1]{} -% \def\stopxmldisplayverbatim {} -% \def\startxmlinlineverbatim [#1]{} -% \def\stopxmlinlineverbatim {} - -% we use an xml: namespace so one has to define a suitable verbatim, say -% -% \definetyping[xml:verbatim][typing] -% -% this is experimental! - -\def\startxmldisplayverbatim[#1]% - {\startpacked % \begingroup - \let\currenttypingclass\??tp - \edef\currenttyping{xml:#1}% - \def\stopxmldisplayverbatim - {\endofverbatimlines - \stoppacked} % \endgroup - \mkinitializeverbatim - \beginofverbatimlines} - -\def\startxmlinlineverbatim[#1]% - {\begingroup - \let\currenttypingclass\??ty - \edef\currenttyping{xml:#1}% - \let\stopxmldisplayverbatim\endgroup - \mkinitializeverbatim} - -% will move but is developed for xml - -\newtoks \collectingtoks - -\def\startcollect#1\stopcollect - {\collectingtoks\@EA{\the\collectingtoks#1}} - -\def\startexpandedcollect#1\stopexpandedcollect - {\expanded{\collectingtoks{\the\collectingtoks#1}}} - -\def\startcollecting{\collectingtoks\emptytoks} -\def\stopcollecting {\the\collectingtoks} - -\def\inlinemessage #1{\dontleavehmode{\tttf#1}} -\def\displaymessage#1{\blank\inlinemessage{#1}\blank} - -\def\xmltraceentities - {\ctxlua{xml.set_text_cleanup(lxml.trace_text_entities)}% - \appendtoks\ctxlua{lxml.show_text_entities()}\to\everygoodbye} - -% processing instructions - -\def\xmlcontextdirective#1% kind class key value - {\executeifdefined{xml#1directive}\gobblethreearguments} - -% setting up xml: -% -% \setupxml[\c!method=mkii] % mixed mkiv and mkii -% \setupxml[\c!method=mkiv,\c!default=] % mkiv only -% \setupxml[\c!method=mkiv,\c!default=\v!none] % mkiv only, undefined -> hidden -% \setupxml[\c!method=mkiv,\c!default=\v!text] % mkiv only, undefined -> text - -% \def\xmlctxdirective#1#2#3{\doif{#1}{clue}{\doif{#2}{page}}{\page[#3]}} - -\chardef\xmlprocessingmode=0 % 0=mixed, 1=mkivonly, 2=mkivonly-default-text, 3=mkivonly-default-none - -% \setupxml[method=mkiv,strip=yes,entities=yes,default=text] - -\newtoks\everysetupxml - -\def\setupxml[#1]{\getparameters[\??xm][#1]\the\everysetupxml} - -\def\c!entities{entities} % to be internationalized -\def\s!mkiv {mkiv} -\def\s!mkii {mkii} - -% entities - -\newif\ifautoXMLentities - -\def\xmlkeepentities{\ctxlua{lxml.reset_entityhandler()}} -\def\xmlmkiientities{\ctxlua{lxml.set_mkii_entityhandler()}\autoXMLentitiestrue} -\def\xmlmkiventities{\ctxlua{lxml.set_mkiv_entityhandler()}} - -\let\xmlresolveentities\xmlmkiventities % will become \xmlmkiventities - -\letvalue{\??xm:1:\s!mkii }\zerocount -\letvalue{\??xm:1:\s!mkiv }\plusone - -\letvalue{\??xm:2:\v!none }\plusone -\letvalue{\??xm:2:\v!text }\plustwo -\letvalue{\??xm:2:\v!hidden}\plusthree - -\letvalue{\??xm:ii:\v!yes }\xmlresolveentities -\letvalue{\??xm:ii:\v!no }\xmlkeepentities -\letvalue{\??xm:ii:\s!mkii}\xmlmkiientities -\letvalue{\??xm:ii:\s!mkiv}\xmlmkiventities - -\letvalue{\??xm:iv:\v!yes }\xmlresolveentities -\letvalue{\??xm:iv:\v!no }\xmlkeepentities -\letvalue{\??xm:iv:\s!mkii}\xmlmkiventities -\letvalue{\??xm:iv:\s!mkiv}\xmlmkiventities - -\appendtoks - \chardef\xmlprocessingmode\executeifdefined{\??xm:1:\@@xmmethod}\zerocount - \ifcase\xmlprocessingmode - % mkii, permits both methods - \executeifdefined{\??xm:ii:\@@xmentities}\xmlkeepentities - \or - % mkiv, mkiv exclusively - \chardef\xmlprocessingmode\executeifdefined{\??xm:2:\@@xmdefault}\plusone - \executeifdefined{\??xm:iv:\@@xmentities}\xmlresolveentities - \else - % unset - \fi - \ifcase\xmlprocessingmode - \ctxlua{characters.setmkiientities()}% - \else - \ctxlua{characters.setmkiventities()}% - \fi - \doifelse\@@xmcompress\v!yes % this key may change, maybe compress=yes|no - {\ctxlua{xml.strip_cm_and_dt=true}} - {\ctxlua{xml.strip_cm_and_dt=false}}% -\to \everysetupxml - -\def\xmlinitialize{\the\everysetupxml} - -\newcount\charactersactiveoffset \charactersactiveoffset="10000 - -\startextendcatcodetable\ctxcatcodes - \catcode\numexpr\charactersactiveoffset+`<\relax=13 - \catcode\numexpr\charactersactiveoffset+`&\relax=13 - \catcode\numexpr\charactersactiveoffset+`>\relax=13 -\stopextendcatcodetable -\startextendcatcodetable\xmlcatcodes - \catcode\numexpr\charactersactiveoffset+`<\relax=13 - \catcode\numexpr\charactersactiveoffset+`&\relax=13 - \catcode\numexpr\charactersactiveoffset+`>\relax=13 -\stopextendcatcodetable - -\ctxlua { % entities are remembered in the format - characters.remapentity("<",characters.active_offset + utf.byte("<")) - characters.remapentity("&",characters.active_offset + utf.byte("&")) - characters.remapentity(">",characters.active_offset + utf.byte(">")) -} - -\setupxml - [\c!method=mkii, % mixed mode - \c!default=\v!hidden, % ignore elements that are not defined - \c!compress=\v!no, % strip comment - \c!entities=\v!yes] % replace entities - -% \defineXMLenvironment[y]{(}{)} -% -% \startxmlsetups x -% /\xmlflush{#1}/ -% \stopxmlsetups -% -% \startxmlsetups xx -% \xmlsetsetup{main}{x}{*} -% \stopxmlsetups -% -% \xmlregistersetup{xx} -% -% \startbuffer -% a <&>{b} c -% \stopbuffer -% -% mkii: [\processXMLbuffer]\quad mkiv: [\xmlprocessbuffer{main}{}{}] - -% some mkii commands, but mkiv-ified - -\def\xmlmapvalue#1#2#3{\setvalue{\??xm:v:#1:#2}{#3}} % keep #3 to grab spaces -\def\xmlvalue #1#2#3{\executeifdefined{\??xm:v:#1:#2}{#3}} - -\let\xmlmapval\xmlmapvalue -\let\xmlval \xmlvalue - -% brrrr, give this at the top of a style that needs to stub mkiv loading - -\def\remapXMLtoMKIV - {\ifx\xmldocument\undefined\def\xmldocument{main}\fi - \def\processXMLfile ##1{\xmlprocessfile \xmldocument{##1}{}}% - \def\processXMLfilegrouped ##1{\xmlprocessfile \xmldocument{##1}{}}% maybe still grouped? - \def\processXMLbuffer {\dosingleempty\doprocessXMLbuffer}% - \def\doprocessXMLbuffer [##1]{\xmlprocessbuffer\xmldocument{##1}{}}% - \def\XMLdata ##1{\xmlprocessdata \xmldocument{##1}{}}% - \def\startXMLdata##1\stopXMLdata{\xmlprocessdata \xmldocument{##1}{}}} - -\let\normalprocessXMLfilegrouped\processXMLfilegrouped - -\def\processXMLfileMKIV % one-shot, will become obsolete, personal hack - {\dosingleempty\doprocessXMLfileMKIV} - -\def\doprocessXMLfileMKIV[#1]% - {\def\processXMLfilegrouped##1% - {\let\processXMLfilegrouped\normalprocessXMLfilegrouped - \doifelsenothing{#1}{\xmlprocess{main}{##1}{}}{\xmlprocess{#1}{##1}{}}}} - -\protect \endinput diff --git a/tex/context/base/lxml-tab.lua b/tex/context/base/lxml-tab.lua index 6ceadb678..77c28f8d3 100644 --- a/tex/context/base/lxml-tab.lua +++ b/tex/context/base/lxml-tab.lua @@ -445,7 +445,7 @@ generic table copier. Since we know what we're dealing with we can speed up things a bit. The second argument is not to be used!

--ldx]]-- -function copy(old,tables) +local function copy(old,tables) if old then tables = tables or { } local new = { } diff --git a/tex/context/base/m-format.tex b/tex/context/base/m-format.tex new file mode 100644 index 000000000..0f274b236 --- /dev/null +++ b/tex/context/base/m-format.tex @@ -0,0 +1,409 @@ +%D \module +%D [ file=m-formay, +%D version=ancient, +%D title=\CONTEXT\ Modules, +%D subtitle=Ancient Formatting Code, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Here is some code that I had laying around and had forgotten +%D about. Let's make it a module and see if there is interest in +%D such things. + +% \defineformatblock [poem] +% \defineformatsegment [verse] % [poem] +% \defineformatline [line] % [verse] +% +% \startpoem [title] [author] +% \startverse [ref] +% \startline [ref] +% +% block : voor na tussen *tekstletter *tekstkleur +% +% segment : voor na tussen *tekstletter *tekstkleur +% : links rechts linkeroffset rechteroffset +% : ?marge *evenmarge *onevenmarge breedte +% : nummer *nummercommando *conversie +% : nummerletter nummerkleur *label +% +% line : voor na tussen *tekstletter *tekstkleur +% : nummer *nummercommando *conversie +% : nummerletter nummerkleur *label +% +% * = todo + +\unprotect + +\definesystemvariable {fx} % format block +\definesystemvariable {fy} % format segment +\definesystemvariable {fz} % format line + +\def\defineformatblock + {\dodoubleempty\dodefineformatblock} + +\def\dodefineformatblock[#1][#2]% + {\setupformatblock + [#1] + [\c!before=\blank,\c!after=\blank,\c!inbetween=\blank, + \c!textstyle=,\c!textcolor=,#2]% + \setvalue{\e!start#1}{\startformatblock[#1]}% + \setvalue{\e!stop #1}{\stopformatblock}} + +\def\setupformatblock + {\dodoubleempty\dosetupformatblock} + +\def\setupformatblock[#1]% + {\getparameters[\??fx#1]} + +\def\startformatblock[#1]% + {\dotriplegroupempty\dostartformatblock{#1}} + +\def\dostartformatblock#1#2#3 + {\bgroup + \getvalue{\??fx#1\c!before} + \doglobal\newcounter\formatsegmentcounter + \doglobal\newcounter\formatlinecounter + \doglobal\newcounter\formatlinesubcounter + \doglobal\newcounter\formatlinemaxcounter + \doifsomething{#2}{\leftaligned{#2}\getvalue{\??fx#1\c!inbetween}} + \def\stopformatblock% + {\doifsomething{#3}{\getvalue{\??fx#1\c!inbetween}\leftaligned{#3}} + \getvalue{\??fx#1\c!after} + \egroup}} + +\def\defineformatsegment + {\dodoubleempty\dodefineformatsegment} + +\def\dodefineformatsegment[#1][#2]% + {\setupformatsegment + [#1] + [\c!before=\blank,\c!after=\blank,\c!inbetween=\blank, + \c!textstyle=,\c!textcolor=,\c!left=,\c!right=, + \c!leftoffset=\!!zeropoint,\c!rightoffset=\!!zeropoint, + %\c!margin=\!!zeropoint,\c!evenmargin=\!!zeropoint,\c!oddmargin=\hsize, + \c!width=\hsize,\c!numberstyle=,\c!numbercolor=,\c!number=\v!no, + \c!numbercommand=,\c!conversion=,\c!label=, + #2]% + \setvalue{\e!start#1}{\startformatsegment[#1]}% + \setvalue{\e!stop #1}{\stopformatsegment}} + +\def\setupformatsegment + {\dodoubleempty\dosetupformatsegment} + +\def\setupformatsegment[#1]% + {\getparameters[\??fy#1]} + +\def\placeformatsegmentcounter + {\formatsegmentcounter\quad\hphantom{\placeformatlinecounter}} + +\def\placeformatlinecounter + {\formatlinecounter} + +\def\startformatsegment[#1]% + {\bgroup + \doifelsevalue{\??fy#1\c!number}\v!yes + {\def\doplaceformatsegmentcounter + {\inleftmargin + {\doattributes{\??fy#1}\c!numberstyle\c!numbercolor + {\placeformatsegmentcounter}}}} + {\let\doplaceformatsegmentcounter\relax}% + \getvalue{\??fy#1\c!before} + \doglobal\increment\formatsegmentcounter + \def\formatrightoffset{\getvalue{\??fy#1\c!rightoffset}} + \def\formatleftoffset {\getvalue{\??fy#1\c!leftoffset}} + \def\formatminwidth {\getvalue{\??fy#1\c!minwidth}} + \def\formatwidth {\getvalue{\??fy#1\c!width}} + %\def\formatmargin {\getvalue{\??fy#1\c!margin}} + \def\formatbefore {\getvalue{\??fy#1\c!before}} + \def\formatinbetween {\getvalue{\??fy#1\c!inbetween}} + \def\formatafter {\getvalue{\??fy#1\c!after}} + \def\formatleft {\getvalue{\??fy#1\c!left}} + \def\formatright {\getvalue{\??fy#1\c!right}} + \@@segmentvarianta + \getvalue{@@segmentvariant\getvalue{\??fy#1\c!alternative}} + \def\stopformatsegment + {\getvalue{\??fy#1\c!after} + \egroup}} + +\newif\iftraceformatblock + +\def\@@segmentvarianta % ragged right, symbols + {\let\formatraggedness\raggedright + \let\dostartformatline\dostartformatlineab + \let\formatleftfirst\relax \let\formatrightfirst\hfill + \let\formatleftnext \hfill \let\formatrightnext \relax} + +\def\@@segmentvariantb % ragged right, equal parts, symbols + {\let\formatraggedness\raggedcenter + \let\dostartformatline\dostartformatlineab + \let\formatleftfirst\relax \let\formatrightfirst\hfill + \let\formatleftnext \hfill \let\formatrightnext \relax} + +\def\@@segmentvariantc % ragged right + {\let\formatraggedness\veryraggedright + \let\dostartformatline\dostartformatlinecde + \let\formatleftnext\relax \let\formatrightnext\hfill} + +\def\@@segmentvariantd % ragged center + {\let\formatraggedness\veryraggedcenter + \let\dostartformatline\dostartformatlinecde + \let\formatleftnext\hfill \let\formatrightnext\hfill} + +\def\@@segmentvariante % ragged left + {\let\formatraggedness\veryraggedleft + \let\dostartformatline\dostartformatlinecde + \let\formatleftnext\hfill \let\formatrightnext\relax} + +\def\defineformatline + {\dodoubleempty\dodefineformatline} + +\def\dodefineformatline[#1][#2]% + {\setupformatline + [#1] + [\c!before=\blank,\c!after=\blank,\c!inbetween=\blank, + \c!textstyle=,\c!textcolor=, + \c!number=\v!no,\c!numbercommand=,\c!conversion=, + \c!numberstyle=,\c!numbercolor=,\c!label=, + #2]% + \setvalue{\e!start#1}{\startformatline[#1]}% + \setvalue{\e!stop #1}{\stopformatline}} + +\def\setupformatline + {\dodoubleempty\dosetupformatline} + +\def\setupformatline[#1]% + {\getparameters[\??fz#1]} + +\newconditional\formatforcedbreak + +\def\startformatline[#1]% + {\bgroup + \doifelsevalue{\??fz#1\c!number}\v!yes + {\def\doplaceformatlinecounter + {\inleftmargin + {\doattributes{\??fz#1}\c!numberstyle\c!numbercolor + {\placeformatlinecounter}}}} + {\let\doplaceformatlinecounter\relax}% + \global\setfalse\formatforcedbreak + \def\\{\break\global\settrue\formatforcedbreak}% + \hsize\formatwidth + \doglobal\increment\formatlinecounter + \par + \nobreak + \def\stopformatline + {\unskip\unskip\unskip\unskip\unskip\egroup + \let\doplaceformatsegmentcounter\relax} + \postponenotes + \dowithnextbox{\dostartformatline}\hbox\bgroup\ignorespaces} + +\def\dostartformatlineab + {%\dosetleftskipadaption\formatmargin + %\advance\hsize-\leftskipadaption\relax + \ifdim\nextboxwd>\hsize + \beginofshapebox + \forgetall + \hangafter\plusone + \hangindent\formatleftoffset + \formatraggedness + \hskip\formatrightoffset + \unhbox\nextbox\par + \endofshapebox + %\advance\hsize \leftskipadaption + \doglobal\newcounter\formatlinesubcounter + \reshapebox + {\doglobal\increment\formatlinesubcounter} + \global\let\formatlinemaxcounter\formatlinesubcounter + \reshapebox + {\doglobal\decrement\formatlinesubcounter + \ifnum\formatlinesubcounter=\zerocount + \doplaceformatsegmentcounter + \doplaceformatlinecounter + \hskip-\formatrightoffset + %\hskip\leftskipadaption + \formatleftfirst + \unhbox\shapebox + \ifnum\formatlinemaxcounter>\plusone + \ifx\formatright\empty\else + \shapedhbox to \zeropoint{\formatright\hss}% + \fi + \fi + \formatrightfirst + \iftraceformatblock + \ruledhskip\formatrightoffset\hskip-\formatrightoffset + \fi + \else + %\hskip\leftskipadaption + \iftraceformatblock + \ruledhskip\formatleftoffset\hskip-\formatleftoffset + \fi + \formatleftnext + \ifx\formatleft\empty\else + \shapedhbox to \zeropoint{\hss\formatleft}% + \fi + \unhbox\shapebox + \formatrightnext + \fi} + \flushshapebox + \else + \dontleavehmode\hbox + {\doplaceformatsegmentcounter + \doplaceformatlinecounter + %\hskip\leftskipadaption + \formatleftfirst + \unhbox\nextbox + \formatrightfirst} + \fi + \par + \egroup} + +\def\dostartformatlinecde + {%\dosetleftskipadaption\formatmargin + %\advance\hsize -\leftskipadaption\relax + \dimen0=\hsize + \ifconditional\formatforcedbreak\else + \ifdim\formatminwidth>\zeropoint\relax + \ifdim\nextboxwd>\hsize + \doloop + {\global\dimen1=\dimen0 + \beginofshapebox + \hsize\dimen0 + \forgetall + \formatraggedness + \unhcopy\nextbox\par + \endofshapebox + \reshapebox + {\setbox\scratchbox=\hbox{\unhbox\shapebox}% + \ifdim\wd\scratchbox<\dimen1 + \global\dimen1=\wd\scratchbox + \fi} + \ifdim\dimen1<\formatminwidth\relax + \advance\dimen0 by -.25em + \else + \exitloop + \fi + \ifdim\dimen0<10em + \dimen0=\hsize + \exitloop + \fi} + \fi + \fi + \fi + \beginofshapebox + \hsize\dimen0 + \forgetall + \formatraggedness + \unhcopy\nextbox\par + \endofshapebox + %\advance\hsize \leftskipadaption + \doglobal\newcounter\formatlinesubcounter + \reshapebox + {\doglobal\increment\formatlinesubcounter}% + \global\let\formatlinemaxcounter\formatlinesubcounter + \reshapebox + {\doglobal\decrement\formatlinesubcounter + \ifnum\formatlinesubcounter=\zerocount + \doplaceformatsegmentcounter + \doplaceformatlinecounter + \fi + %\hskip\leftskipadaption + \formatleftnext + \unhbox\shapebox + \formatrightnext\strut}% strut prevents unskip + \flushshapebox + \par + \egroup} + +\defineformatblock[poem] + [\c!before=\blank, + \c!inbetween={\blank[\v!medium]}, + \c!after=\blank] + +\defineformatsegment[verse] + [\c!alternative=\v!left, + \c!width=\hsize, + %\c!margin=\!!zeropoint, + \c!before={\blank[\v!medium]}, + \c!after={\blank[\v!medium]}, + \c!inbetween={\blank[\v!medium]}, + \c!leftoffset=3em, + \c!rightoffset=2em, + \c!minwidth=5em, + \c!left={$[$\enspace}, + \c!right={\enspace$]$}] + +\defineformatline[line] + [] + +\protect \doifnotmode{demo} {\endinput} + +% evt defineblank[formatbefore,formatinbetween,formatafter] + +%\showframe \traceformatblocktrue + +\usemodule[visual] + +\setuplayout[height=middle,topspace=1cm,header=0pt,footer=0pt] +\setupbodyfont[10pt] + +% All interfaces supported, but testing with english; todo: +% more options, more alternatives, inheritance and mixed +% definitions, and so. + +\starttext + +\startbuffer +\startbuffer[poem] +\startpoem{A Random Poem}{Hans Hagen} + \startverse + \startline \fakewords{4}{8} \stopline + \startline \fakewords{4}{8} \stopline + \startline \fakewords{4}{8} \stopline + \startline \fakewords{4}{8} \stopline + \stopverse + \startverse + \startline \fakewords{4}{8} \stopline + \startline \fakewords{4}{8} \stopline + \startline \fakewords{4}{8} \stopline + \startline \fakewords{4}{8} \stopline + \stopverse +\stoppoem +\stopbuffer + +\setupformatsegment[verse][width=.4\hsize,number=yes,numberstyle=slanted] +\setupformatline [line] [number=yes,numberstyle=smallslanted] + +\startbuffer[x] +\setupformatsegment[verse][leftoffset=0pt,rightoffset=0pt,left=,right=] +\stopbuffer + +\section{Alternative A} + +\setupformatsegment[verse][alternative=a] {\getbuffer[poem]} +\setupformatsegment[verse][alternative=a] {\getbuffer[x,poem]} + +\section{Alternative B} + +\setupformatsegment[verse][alternative=b] {\getbuffer[poem]} +\setupformatsegment[verse][alternative=b] {\getbuffer[x,poem]} + +\section{Alternative C} + +\setupformatsegment[verse][alternative=c] {\getbuffer[poem]} + +\section{Alternative D} + +\setupformatsegment[verse][alternative=d] {\getbuffer[poem]} + +\section{Alternative E} + +\setupformatsegment[verse][alternative=e] {\getbuffer[poem]} +\stopbuffer + +\typebuffer \getbuffer + +\stoptext diff --git a/tex/context/base/math-ams.mkii b/tex/context/base/math-ams.mkii new file mode 100644 index 000000000..83070d01a --- /dev/null +++ b/tex/context/base/math-ams.mkii @@ -0,0 +1,336 @@ +%D \module +%D [ file=math-ams, +%D version=2001.04.12, +%D title=\CONTEXT\ Math Macros, +%D subtitle=AMS Specials, +%D author={Hans Hagen \& Taco Hoekwater}, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +% maybe we should just include these into the default tex one + +\definefamilysynonym [default] [blackboard] [mb] + +\startmathcollection [default] + +\definemathsymbol [varGamma] [ord] [letters] ["00] +\definemathsymbol [varDelta] [ord] [letters] ["01] +\definemathsymbol [varTheta] [ord] [letters] ["02] +\definemathsymbol [varLambda] [ord] [letters] ["03] +\definemathsymbol [varXi] [ord] [letters] ["04] +\definemathsymbol [varPi] [ord] [letters] ["05] +\definemathsymbol [varSigma] [ord] [letters] ["06] +\definemathsymbol [varUpsilon] [ord] [letters] ["07] +\definemathsymbol [varPhi] [ord] [letters] ["08] +\definemathsymbol [varPsi] [ord] [letters] ["09] +\definemathsymbol [varOmega] [ord] [letters] ["0A] + +\stopmathcollection + +\startmathcollection[default] + +\definemathsymbol [internalAnd] [rel] [operators] ["26] + +\stopmathcollection + +\startmathcollection [default] + +\definemathsymbol [boxdot] [bin] [ma] ["00] +\definemathsymbol [boxplus] [bin] [ma] ["01] +\definemathsymbol [boxtimes] [bin] [ma] ["02] +\definemathsymbol [square] [ord] [ma] ["03] +\definemathsymbol [Box] [ord] [ma] ["03] % square +\definemathsymbol [blacksquare] [ord] [ma] ["04] +\definemathsymbol [centerdot] [bin] [ma] ["05] +\definemathsymbol [Diamond] [ord] [ma] ["06] +\definemathsymbol [lozenge] [ord] [ma] ["06] % Diamond +\definemathsymbol [blacklozenge] [ord] [ma] ["07] +\definemathsymbol [circlearrowright] [rel] [ma] ["08] +\definemathsymbol [circlearrowleft] [rel] [ma] ["09] +\definemathsymbol [rightleftharpoons] [rel] [ma] ["0A] +\definemathsymbol [leftrightharpoons] [rel] [ma] ["0B] +\definemathsymbol [boxminus] [bin] [ma] ["0C] +\definemathsymbol [Vdash] [rel] [ma] ["0D] +\definemathsymbol [Vvdash] [rel] [ma] ["0E] +\definemathsymbol [vDash] [rel] [ma] ["0F] +\definemathsymbol [twoheadrightarrow] [rel] [ma] ["10] +\definemathsymbol [twoheadleftarrow] [rel] [ma] ["11] +\definemathsymbol [leftleftarrows] [rel] [ma] ["12] +\definemathsymbol [rightrightarrows] [rel] [ma] ["13] +\definemathsymbol [upuparrows] [rel] [ma] ["14] +\definemathsymbol [downdownarrows] [rel] [ma] ["15] +\definemathsymbol [upharpoonright] [rel] [ma] ["16] +\definemathsymbol [restriction] [rel] [ma] ["16] +\definemathsymbol [downharpoonright] [rel] [ma] ["17] +\definemathsymbol [upharpoonleft] [rel] [ma] ["18] +\definemathsymbol [downharpoonleft] [rel] [ma] ["19] +\definemathsymbol [rightarrowtail] [rel] [ma] ["1A] +\definemathsymbol [leftarrowtail] [rel] [ma] ["1B] +\definemathsymbol [leftrightarrows] [rel] [ma] ["1C] +\definemathsymbol [rightleftarrows] [rel] [ma] ["1D] +\definemathsymbol [Lsh] [rel] [ma] ["1E] +\definemathsymbol [Rsh] [rel] [ma] ["1F] +\definemathsymbol [rightsquigarrow] [rel] [ma] ["20] +\definemathsymbol [leadsto] [rel] [ma] ["20] % rightsquigarrow +\definemathsymbol [leftrightsquigarrow] [rel] [ma] ["21] +\definemathsymbol [looparrowleft] [rel] [ma] ["22] +\definemathsymbol [looparrowright] [rel] [ma] ["23] +\definemathsymbol [circeq] [rel] [ma] ["24] +\definemathsymbol [succsim] [rel] [ma] ["25] +\definemathsymbol [gtrsim] [rel] [ma] ["26] +\definemathsymbol [gtrapprox] [rel] [ma] ["27] +\definemathsymbol [multimap] [rel] [ma] ["28] +\definemathsymbol [therefore] [rel] [ma] ["29] +\definemathsymbol [because] [rel] [ma] ["2A] +\definemathsymbol [doteqdot] [rel] [ma] ["2B] +\definemathsymbol [Doteq] [rel] [ma] ["2B] % doteqdot +\definemathsymbol [triangleq] [rel] [ma] ["2C] +\definemathsymbol [precsim] [rel] [ma] ["2D] +\definemathsymbol [lesssim] [rel] [ma] ["2E] +\definemathsymbol [lessapprox] [rel] [ma] ["2F] +\definemathsymbol [eqslantless] [rel] [ma] ["30] +\definemathsymbol [eqslantgtr] [rel] [ma] ["31] +\definemathsymbol [curlyeqprec] [rel] [ma] ["32] +\definemathsymbol [curlyeqsucc] [rel] [ma] ["33] +\definemathsymbol [preccurlyeq] [rel] [ma] ["34] +\definemathsymbol [leqq] [rel] [ma] ["35] +\definemathsymbol [leqslant] [rel] [ma] ["36] +\definemathsymbol [lessgtr] [rel] [ma] ["37] +\definemathsymbol [backprime] [ord] [ma] ["38] +\definemathsymbol [dabar@] [ord] [ma] ["39] % @ +\definemathsymbol [risingdotseq] [rel] [ma] ["3A] +\definemathsymbol [fallingdotseq] [rel] [ma] ["3B] +\definemathsymbol [succcurlyeq] [rel] [ma] ["3C] +\definemathsymbol [geqq] [rel] [ma] ["3D] +\definemathsymbol [geqslant] [rel] [ma] ["3E] +\definemathsymbol [gtrless] [rel] [ma] ["3F] +\definemathsymbol [sqsubset] [rel] [ma] ["40] +\definemathsymbol [sqsupset] [rel] [ma] ["41] +\definemathsymbol [vartriangleright] [rel] [ma] ["42] +\definemathsymbol [rhd] [bin] [ma] ["42] +\definemathsymbol [lhd] [bin] [ma] ["43] +\definemathsymbol [vartriangleleft] [rel] [ma] ["43] +\definemathsymbol [trianglerighteq] [rel] [ma] ["44] +\definemathsymbol [unrhd] [bin] [ma] ["44] % trianglerighteq +\definemathsymbol [trianglelefteq] [rel] [ma] ["45] +\definemathsymbol [unlhd] [bin] [ma] ["45] % trianglelefteq +\definemathsymbol [bigstar] [ord] [ma] ["46] +\definemathsymbol [between] [rel] [ma] ["47] +\definemathsymbol [blacktriangledown] [ord] [ma] ["48] +\definemathsymbol [blacktriangleright] [rel] [ma] ["49] +\definemathsymbol [blacktriangleleft] [rel] [ma] ["4A] +\definemathsymbol [vartriangle] [rel] [ma] ["4D] +\definemathsymbol [triangleup] [ord] [ma] ["4D] % vartriangle +\definemathsymbol [blacktriangle] [ord] [ma] ["4E] +\definemathsymbol [triangledown] [ord] [ma] ["4F] +\definemathsymbol [eqcirc] [rel] [ma] ["50] +\definemathsymbol [lesseqgtr] [rel] [ma] ["51] +\definemathsymbol [gtreqless] [rel] [ma] ["52] +\definemathsymbol [lesseqqgtr] [rel] [ma] ["53] +\definemathsymbol [gtreqqless] [rel] [ma] ["54] +\definemathsymbol [Rrightarrow] [rel] [ma] ["56] +\definemathsymbol [Lleftarrow] [rel] [ma] ["57] +\definemathsymbol [veebar] [bin] [ma] ["59] +\definemathsymbol [barwedge] [bin] [ma] ["5A] +\definemathsymbol [doublebarwedge] [bin] [ma] ["5B] +\definemathsymbol [angle] [ord] [ma] ["5C] +\definemathsymbol [measuredangle] [ord] [ma] ["5D] +\definemathsymbol [sphericalangle] [ord] [ma] ["5E] +\definemathsymbol [varpropto] [rel] [ma] ["5F] +\definemathsymbol [smallsmile] [rel] [ma] ["60] +\definemathsymbol [smallfrown] [rel] [ma] ["61] +\definemathsymbol [Subset] [rel] [ma] ["62] +\definemathsymbol [Supset] [rel] [ma] ["63] +\definemathsymbol [Cup] [bin] [ma] ["64] +\definemathsymbol [doublecup] [bin] [ma] ["64] % Cup +\definemathsymbol [Cap] [bin] [ma] ["65] +\definemathsymbol [doublecap] [bin] [ma] ["65] +\definemathsymbol [curlywedge] [bin] [ma] ["66] +\definemathsymbol [curlyvee] [bin] [ma] ["67] +\definemathsymbol [leftthreetimes] [bin] [ma] ["68] +\definemathsymbol [rightthreetimes] [bin] [ma] ["69] +\definemathsymbol [subseteqq] [rel] [ma] ["6A] +\definemathsymbol [supseteqq] [rel] [ma] ["6B] +\definemathsymbol [bumpeq] [rel] [ma] ["6C] +\definemathsymbol [Bumpeq] [rel] [ma] ["6D] +\definemathsymbol [llless] [rel] [ma] ["6E] +\definemathsymbol [lll] [rel] [ma] ["6E] % llless +\definemathsymbol [gggtr] [rel] [ma] ["6F] +\definemathsymbol [ggg] [rel] [ma] ["6F] % gggtr +\definemathsymbol [ulcorner] [open] [ma] ["70] [ma] ["70] +\definemathsymbol [urcorner] [close] [ma] ["71] [ma] ["71] +\definemathsymbol [circledS] [ord] [ma] ["73] +\definemathsymbol [pitchfork] [rel] [ma] ["74] +\definemathsymbol [dotplus] [bin] [ma] ["75] +\definemathsymbol [backsim] [rel] [ma] ["76] +\definemathsymbol [backsimeq] [rel] [ma] ["77] +\definemathsymbol [llcorner] [open] [ma] ["78] [ma] ["78] +\definemathsymbol [lrcorner] [close] [ma] ["79] [ma] ["79] +\definemathsymbol [complement] [ord] [ma] ["7B] +\definemathsymbol [intercal] [bin] [ma] ["7C] +\definemathsymbol [circledcirc] [bin] [ma] ["7D] +\definemathsymbol [circledast] [bin] [ma] ["7E] +\definemathsymbol [circleddash] [bin] [ma] ["7F] + +\stopmathcollection + +\startmathcollection [default] + +\definemathcommand [integers] {\blackboard{Z}} +\definemathcommand [reals] {\blackboard{R}} +\definemathcommand [rationals] {\blackboard{Q}} +\definemathcommand [naturalnumbers] {\blackboard{N}} +\definemathcommand [complexes] {\blackboard{C}} +\definemathcommand [primes] {\blackboard{P}} + +\stopmathcollection + +\startmathcollection [default] + +\definemathsymbol [lvertneqq] [rel] [mb] ["00] +\definemathsymbol [gvertneqq] [rel] [mb] ["01] +\definemathsymbol [nleq] [rel] [mb] ["02] +\definemathsymbol [ngeq] [rel] [mb] ["03] +\definemathsymbol [nless] [rel] [mb] ["04] +\definemathsymbol [ngtr] [rel] [mb] ["05] +\definemathsymbol [nprec] [rel] [mb] ["06] +\definemathsymbol [nsucc] [rel] [mb] ["07] +\definemathsymbol [lneqq] [rel] [mb] ["08] +\definemathsymbol [gneqq] [rel] [mb] ["09] +\definemathsymbol [nleqslant] [rel] [mb] ["0A] +\definemathsymbol [ngeqslant] [rel] [mb] ["0B] +\definemathsymbol [lneq] [rel] [mb] ["0C] +\definemathsymbol [gneq] [rel] [mb] ["0D] +\definemathsymbol [npreceq] [rel] [mb] ["0E] +\definemathsymbol [nsucceq] [rel] [mb] ["0F] +\definemathsymbol [precnsim] [rel] [mb] ["10] +\definemathsymbol [succnsim] [rel] [mb] ["11] +\definemathsymbol [lnsim] [rel] [mb] ["12] +\definemathsymbol [gnsim] [rel] [mb] ["13] +\definemathsymbol [nleqq] [rel] [mb] ["14] +\definemathsymbol [ngeqq] [rel] [mb] ["15] +\definemathsymbol [precneqq] [rel] [mb] ["16] +\definemathsymbol [succneqq] [rel] [mb] ["17] +\definemathsymbol [precnapprox] [rel] [mb] ["18] +\definemathsymbol [succnapprox] [rel] [mb] ["19] +\definemathsymbol [lnapprox] [rel] [mb] ["1A] +\definemathsymbol [gnapprox] [rel] [mb] ["1B] +\definemathsymbol [nsim] [rel] [mb] ["1C] +\definemathsymbol [ncong] [rel] [mb] ["1D] +\definemathsymbol [diagup] [ord] [mb] ["1E] +\definemathsymbol [diagdown] [ord] [mb] ["1F] +\definemathsymbol [varsubsetneq] [rel] [mb] ["20] +\definemathsymbol [varsupsetneq] [rel] [mb] ["21] +\definemathsymbol [nsubseteqq] [rel] [mb] ["22] +\definemathsymbol [nsupseteqq] [rel] [mb] ["23] +\definemathsymbol [subsetneqq] [rel] [mb] ["24] +\definemathsymbol [supsetneqq] [rel] [mb] ["25] +\definemathsymbol [varsubsetneqq] [rel] [mb] ["26] +\definemathsymbol [varsupsetneqq] [rel] [mb] ["27] +\definemathsymbol [subsetneq] [rel] [mb] ["28] +\definemathsymbol [supsetneq] [rel] [mb] ["29] +\definemathsymbol [nsubseteq] [rel] [mb] ["2A] +\definemathsymbol [nsupseteq] [rel] [mb] ["2B] +\definemathsymbol [nparallel] [rel] [mb] ["2C] +\definemathsymbol [nmid] [rel] [mb] ["2D] +\definemathsymbol [nshortmid] [rel] [mb] ["2E] +\definemathsymbol [nshortparallel] [rel] [mb] ["2F] +\definemathsymbol [nvdash] [rel] [mb] ["30] +\definemathsymbol [nVdash] [rel] [mb] ["31] +\definemathsymbol [nvDash] [rel] [mb] ["32] +\definemathsymbol [nVDash] [rel] [mb] ["33] +\definemathsymbol [ntrianglerighteq] [rel] [mb] ["34] +\definemathsymbol [ntrianglelefteq] [rel] [mb] ["35] +\definemathsymbol [ntriangleleft] [rel] [mb] ["36] +\definemathsymbol [ntriangleright] [rel] [mb] ["37] +\definemathsymbol [nleftarrow] [rel] [mb] ["38] +\definemathsymbol [nrightarrow] [rel] [mb] ["39] +\definemathsymbol [nLeftarrow] [rel] [mb] ["3A] +\definemathsymbol [nRightarrow] [rel] [mb] ["3B] +\definemathsymbol [nLeftrightarrow] [rel] [mb] ["3C] +\definemathsymbol [nleftrightarrow] [rel] [mb] ["3D] +\definemathsymbol [divideontimes] [bin] [mb] ["3E] +\definemathsymbol [varnothing] [ord] [mb] ["3F] +\definemathsymbol [nexists] [ord] [mb] ["40] +\definemathsymbol [Finv] [ord] [mb] ["60] +\definemathsymbol [Game] [ord] [mb] ["61] +\definemathsymbol [mho] [ord] [mb] ["66] +\definemathsymbol [eth] [ord] [mb] ["67] +\definemathsymbol [eqsim] [rel] [mb] ["68] +\definemathsymbol [beth] [ord] [mb] ["69] +\definemathsymbol [gimel] [ord] [mb] ["6A] +\definemathsymbol [daleth] [ord] [mb] ["6B] +\definemathsymbol [lessdot] [bin] [mb] ["6C] +\definemathsymbol [gtrdot] [bin] [mb] ["6D] +\definemathsymbol [ltimes] [bin] [mb] ["6E] +\definemathsymbol [rtimes] [bin] [mb] ["6F] +\definemathsymbol [shortmid] [rel] [mb] ["70] +\definemathsymbol [shortparallel] [rel] [mb] ["71] +\definemathsymbol [smallsetminus] [bin] [mb] ["72] +\definemathsymbol [thicksim] [rel] [mb] ["73] +\definemathsymbol [thickapprox] [rel] [mb] ["74] +\definemathsymbol [approxeq] [rel] [mb] ["75] +\definemathsymbol [succapprox] [rel] [mb] ["76] +\definemathsymbol [precapprox] [rel] [mb] ["77] +\definemathsymbol [curvearrowleft] [rel] [mb] ["78] +\definemathsymbol [curvearrowright] [rel] [mb] ["79] +\definemathsymbol [digamma] [ord] [mb] ["7A] +\definemathsymbol [varkappa] [ord] [mb] ["7B] +\definemathsymbol [Bbbk] [ord] [mb] ["7C] +\definemathsymbol [hslash] [ord] [mb] ["7D] +\definemathsymbol [hbar] [ord] [mb] ["7E] +\definemathsymbol [backepsilon] [rel] [mb] ["7F] + +\stopmathcollection + +\startmathcollection [default] + +\definemathcommand [yen] [nothing] {\mathhexbox{\hexmafam}55} +\definemathcommand [checkmark] [nothing] {\mathhexbox{\hexmafam}58} +\definemathcommand [circledR] [nothing] {\mathhexbox{\hexmafam}72} +\definemathcommand [maltese] [nothing] {\mathhexbox{\hexmafam}7A} + +\stopmathcollection + +\startmathcollection [default] + +\definemathcommand [dashrightarrow] [rel] {\dabar@\dabar@ \mathchar"0C4B} +\definemathcommand [dashleftarrow] [rel] {\mathchar"0C4C\dabar@ \dabar@} +\definemathcommand [dasharrow] [rel] {\dabar@\dabar@ \mathchar"0C4B} +\definemathcommand [Join] [rel] {\mathchar"0D6F\mkern-13.8mu\mathchar"0D6E} +\definemathcommand [implies] [rel] {\;\Longrightarrow\;} +\definemathcommand [impliedby] [rel] {\;\Longleftarrow\;} +\definemathcommand [And] [rel] {\;\internalAnd\;} + +\stopmathcollection + +\def\AMSwidehat#1% + {\setbox\scratchbox\hbox{$\mathsurround\zeropoint#1$}% + \ifdim\wd\scratchbox>2em + \mathaccent"0\purefamilyhex{mb}5B{#1}% + \else + \mathaccent"0\purefamilyhex{ex}62{#1}% + \fi} + +\def\AMSwidetilde#1% + {\setbox\scratchbox\hbox{$\mathsurround\zeropoint#1$}% + \ifdim\wd\scratchbox>2em + \mathaccent"0\purefamilyhex{mb}5D{#1}% + \else + \mathaccent"0\purefamilyhex{ex}65{#1}% + \fi} + +\startmathcollection [default] + +\definemathcommand [widehat] {\AMSwidehat} +\definemathcommand [widetilde] {\AMSwidetilde} + +\stopmathcollection + +\protect \endinput diff --git a/tex/context/base/math-ams.tex b/tex/context/base/math-ams.tex deleted file mode 100644 index 83070d01a..000000000 --- a/tex/context/base/math-ams.tex +++ /dev/null @@ -1,336 +0,0 @@ -%D \module -%D [ file=math-ams, -%D version=2001.04.12, -%D title=\CONTEXT\ Math Macros, -%D subtitle=AMS Specials, -%D author={Hans Hagen \& Taco Hoekwater}, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -% maybe we should just include these into the default tex one - -\definefamilysynonym [default] [blackboard] [mb] - -\startmathcollection [default] - -\definemathsymbol [varGamma] [ord] [letters] ["00] -\definemathsymbol [varDelta] [ord] [letters] ["01] -\definemathsymbol [varTheta] [ord] [letters] ["02] -\definemathsymbol [varLambda] [ord] [letters] ["03] -\definemathsymbol [varXi] [ord] [letters] ["04] -\definemathsymbol [varPi] [ord] [letters] ["05] -\definemathsymbol [varSigma] [ord] [letters] ["06] -\definemathsymbol [varUpsilon] [ord] [letters] ["07] -\definemathsymbol [varPhi] [ord] [letters] ["08] -\definemathsymbol [varPsi] [ord] [letters] ["09] -\definemathsymbol [varOmega] [ord] [letters] ["0A] - -\stopmathcollection - -\startmathcollection[default] - -\definemathsymbol [internalAnd] [rel] [operators] ["26] - -\stopmathcollection - -\startmathcollection [default] - -\definemathsymbol [boxdot] [bin] [ma] ["00] -\definemathsymbol [boxplus] [bin] [ma] ["01] -\definemathsymbol [boxtimes] [bin] [ma] ["02] -\definemathsymbol [square] [ord] [ma] ["03] -\definemathsymbol [Box] [ord] [ma] ["03] % square -\definemathsymbol [blacksquare] [ord] [ma] ["04] -\definemathsymbol [centerdot] [bin] [ma] ["05] -\definemathsymbol [Diamond] [ord] [ma] ["06] -\definemathsymbol [lozenge] [ord] [ma] ["06] % Diamond -\definemathsymbol [blacklozenge] [ord] [ma] ["07] -\definemathsymbol [circlearrowright] [rel] [ma] ["08] -\definemathsymbol [circlearrowleft] [rel] [ma] ["09] -\definemathsymbol [rightleftharpoons] [rel] [ma] ["0A] -\definemathsymbol [leftrightharpoons] [rel] [ma] ["0B] -\definemathsymbol [boxminus] [bin] [ma] ["0C] -\definemathsymbol [Vdash] [rel] [ma] ["0D] -\definemathsymbol [Vvdash] [rel] [ma] ["0E] -\definemathsymbol [vDash] [rel] [ma] ["0F] -\definemathsymbol [twoheadrightarrow] [rel] [ma] ["10] -\definemathsymbol [twoheadleftarrow] [rel] [ma] ["11] -\definemathsymbol [leftleftarrows] [rel] [ma] ["12] -\definemathsymbol [rightrightarrows] [rel] [ma] ["13] -\definemathsymbol [upuparrows] [rel] [ma] ["14] -\definemathsymbol [downdownarrows] [rel] [ma] ["15] -\definemathsymbol [upharpoonright] [rel] [ma] ["16] -\definemathsymbol [restriction] [rel] [ma] ["16] -\definemathsymbol [downharpoonright] [rel] [ma] ["17] -\definemathsymbol [upharpoonleft] [rel] [ma] ["18] -\definemathsymbol [downharpoonleft] [rel] [ma] ["19] -\definemathsymbol [rightarrowtail] [rel] [ma] ["1A] -\definemathsymbol [leftarrowtail] [rel] [ma] ["1B] -\definemathsymbol [leftrightarrows] [rel] [ma] ["1C] -\definemathsymbol [rightleftarrows] [rel] [ma] ["1D] -\definemathsymbol [Lsh] [rel] [ma] ["1E] -\definemathsymbol [Rsh] [rel] [ma] ["1F] -\definemathsymbol [rightsquigarrow] [rel] [ma] ["20] -\definemathsymbol [leadsto] [rel] [ma] ["20] % rightsquigarrow -\definemathsymbol [leftrightsquigarrow] [rel] [ma] ["21] -\definemathsymbol [looparrowleft] [rel] [ma] ["22] -\definemathsymbol [looparrowright] [rel] [ma] ["23] -\definemathsymbol [circeq] [rel] [ma] ["24] -\definemathsymbol [succsim] [rel] [ma] ["25] -\definemathsymbol [gtrsim] [rel] [ma] ["26] -\definemathsymbol [gtrapprox] [rel] [ma] ["27] -\definemathsymbol [multimap] [rel] [ma] ["28] -\definemathsymbol [therefore] [rel] [ma] ["29] -\definemathsymbol [because] [rel] [ma] ["2A] -\definemathsymbol [doteqdot] [rel] [ma] ["2B] -\definemathsymbol [Doteq] [rel] [ma] ["2B] % doteqdot -\definemathsymbol [triangleq] [rel] [ma] ["2C] -\definemathsymbol [precsim] [rel] [ma] ["2D] -\definemathsymbol [lesssim] [rel] [ma] ["2E] -\definemathsymbol [lessapprox] [rel] [ma] ["2F] -\definemathsymbol [eqslantless] [rel] [ma] ["30] -\definemathsymbol [eqslantgtr] [rel] [ma] ["31] -\definemathsymbol [curlyeqprec] [rel] [ma] ["32] -\definemathsymbol [curlyeqsucc] [rel] [ma] ["33] -\definemathsymbol [preccurlyeq] [rel] [ma] ["34] -\definemathsymbol [leqq] [rel] [ma] ["35] -\definemathsymbol [leqslant] [rel] [ma] ["36] -\definemathsymbol [lessgtr] [rel] [ma] ["37] -\definemathsymbol [backprime] [ord] [ma] ["38] -\definemathsymbol [dabar@] [ord] [ma] ["39] % @ -\definemathsymbol [risingdotseq] [rel] [ma] ["3A] -\definemathsymbol [fallingdotseq] [rel] [ma] ["3B] -\definemathsymbol [succcurlyeq] [rel] [ma] ["3C] -\definemathsymbol [geqq] [rel] [ma] ["3D] -\definemathsymbol [geqslant] [rel] [ma] ["3E] -\definemathsymbol [gtrless] [rel] [ma] ["3F] -\definemathsymbol [sqsubset] [rel] [ma] ["40] -\definemathsymbol [sqsupset] [rel] [ma] ["41] -\definemathsymbol [vartriangleright] [rel] [ma] ["42] -\definemathsymbol [rhd] [bin] [ma] ["42] -\definemathsymbol [lhd] [bin] [ma] ["43] -\definemathsymbol [vartriangleleft] [rel] [ma] ["43] -\definemathsymbol [trianglerighteq] [rel] [ma] ["44] -\definemathsymbol [unrhd] [bin] [ma] ["44] % trianglerighteq -\definemathsymbol [trianglelefteq] [rel] [ma] ["45] -\definemathsymbol [unlhd] [bin] [ma] ["45] % trianglelefteq -\definemathsymbol [bigstar] [ord] [ma] ["46] -\definemathsymbol [between] [rel] [ma] ["47] -\definemathsymbol [blacktriangledown] [ord] [ma] ["48] -\definemathsymbol [blacktriangleright] [rel] [ma] ["49] -\definemathsymbol [blacktriangleleft] [rel] [ma] ["4A] -\definemathsymbol [vartriangle] [rel] [ma] ["4D] -\definemathsymbol [triangleup] [ord] [ma] ["4D] % vartriangle -\definemathsymbol [blacktriangle] [ord] [ma] ["4E] -\definemathsymbol [triangledown] [ord] [ma] ["4F] -\definemathsymbol [eqcirc] [rel] [ma] ["50] -\definemathsymbol [lesseqgtr] [rel] [ma] ["51] -\definemathsymbol [gtreqless] [rel] [ma] ["52] -\definemathsymbol [lesseqqgtr] [rel] [ma] ["53] -\definemathsymbol [gtreqqless] [rel] [ma] ["54] -\definemathsymbol [Rrightarrow] [rel] [ma] ["56] -\definemathsymbol [Lleftarrow] [rel] [ma] ["57] -\definemathsymbol [veebar] [bin] [ma] ["59] -\definemathsymbol [barwedge] [bin] [ma] ["5A] -\definemathsymbol [doublebarwedge] [bin] [ma] ["5B] -\definemathsymbol [angle] [ord] [ma] ["5C] -\definemathsymbol [measuredangle] [ord] [ma] ["5D] -\definemathsymbol [sphericalangle] [ord] [ma] ["5E] -\definemathsymbol [varpropto] [rel] [ma] ["5F] -\definemathsymbol [smallsmile] [rel] [ma] ["60] -\definemathsymbol [smallfrown] [rel] [ma] ["61] -\definemathsymbol [Subset] [rel] [ma] ["62] -\definemathsymbol [Supset] [rel] [ma] ["63] -\definemathsymbol [Cup] [bin] [ma] ["64] -\definemathsymbol [doublecup] [bin] [ma] ["64] % Cup -\definemathsymbol [Cap] [bin] [ma] ["65] -\definemathsymbol [doublecap] [bin] [ma] ["65] -\definemathsymbol [curlywedge] [bin] [ma] ["66] -\definemathsymbol [curlyvee] [bin] [ma] ["67] -\definemathsymbol [leftthreetimes] [bin] [ma] ["68] -\definemathsymbol [rightthreetimes] [bin] [ma] ["69] -\definemathsymbol [subseteqq] [rel] [ma] ["6A] -\definemathsymbol [supseteqq] [rel] [ma] ["6B] -\definemathsymbol [bumpeq] [rel] [ma] ["6C] -\definemathsymbol [Bumpeq] [rel] [ma] ["6D] -\definemathsymbol [llless] [rel] [ma] ["6E] -\definemathsymbol [lll] [rel] [ma] ["6E] % llless -\definemathsymbol [gggtr] [rel] [ma] ["6F] -\definemathsymbol [ggg] [rel] [ma] ["6F] % gggtr -\definemathsymbol [ulcorner] [open] [ma] ["70] [ma] ["70] -\definemathsymbol [urcorner] [close] [ma] ["71] [ma] ["71] -\definemathsymbol [circledS] [ord] [ma] ["73] -\definemathsymbol [pitchfork] [rel] [ma] ["74] -\definemathsymbol [dotplus] [bin] [ma] ["75] -\definemathsymbol [backsim] [rel] [ma] ["76] -\definemathsymbol [backsimeq] [rel] [ma] ["77] -\definemathsymbol [llcorner] [open] [ma] ["78] [ma] ["78] -\definemathsymbol [lrcorner] [close] [ma] ["79] [ma] ["79] -\definemathsymbol [complement] [ord] [ma] ["7B] -\definemathsymbol [intercal] [bin] [ma] ["7C] -\definemathsymbol [circledcirc] [bin] [ma] ["7D] -\definemathsymbol [circledast] [bin] [ma] ["7E] -\definemathsymbol [circleddash] [bin] [ma] ["7F] - -\stopmathcollection - -\startmathcollection [default] - -\definemathcommand [integers] {\blackboard{Z}} -\definemathcommand [reals] {\blackboard{R}} -\definemathcommand [rationals] {\blackboard{Q}} -\definemathcommand [naturalnumbers] {\blackboard{N}} -\definemathcommand [complexes] {\blackboard{C}} -\definemathcommand [primes] {\blackboard{P}} - -\stopmathcollection - -\startmathcollection [default] - -\definemathsymbol [lvertneqq] [rel] [mb] ["00] -\definemathsymbol [gvertneqq] [rel] [mb] ["01] -\definemathsymbol [nleq] [rel] [mb] ["02] -\definemathsymbol [ngeq] [rel] [mb] ["03] -\definemathsymbol [nless] [rel] [mb] ["04] -\definemathsymbol [ngtr] [rel] [mb] ["05] -\definemathsymbol [nprec] [rel] [mb] ["06] -\definemathsymbol [nsucc] [rel] [mb] ["07] -\definemathsymbol [lneqq] [rel] [mb] ["08] -\definemathsymbol [gneqq] [rel] [mb] ["09] -\definemathsymbol [nleqslant] [rel] [mb] ["0A] -\definemathsymbol [ngeqslant] [rel] [mb] ["0B] -\definemathsymbol [lneq] [rel] [mb] ["0C] -\definemathsymbol [gneq] [rel] [mb] ["0D] -\definemathsymbol [npreceq] [rel] [mb] ["0E] -\definemathsymbol [nsucceq] [rel] [mb] ["0F] -\definemathsymbol [precnsim] [rel] [mb] ["10] -\definemathsymbol [succnsim] [rel] [mb] ["11] -\definemathsymbol [lnsim] [rel] [mb] ["12] -\definemathsymbol [gnsim] [rel] [mb] ["13] -\definemathsymbol [nleqq] [rel] [mb] ["14] -\definemathsymbol [ngeqq] [rel] [mb] ["15] -\definemathsymbol [precneqq] [rel] [mb] ["16] -\definemathsymbol [succneqq] [rel] [mb] ["17] -\definemathsymbol [precnapprox] [rel] [mb] ["18] -\definemathsymbol [succnapprox] [rel] [mb] ["19] -\definemathsymbol [lnapprox] [rel] [mb] ["1A] -\definemathsymbol [gnapprox] [rel] [mb] ["1B] -\definemathsymbol [nsim] [rel] [mb] ["1C] -\definemathsymbol [ncong] [rel] [mb] ["1D] -\definemathsymbol [diagup] [ord] [mb] ["1E] -\definemathsymbol [diagdown] [ord] [mb] ["1F] -\definemathsymbol [varsubsetneq] [rel] [mb] ["20] -\definemathsymbol [varsupsetneq] [rel] [mb] ["21] -\definemathsymbol [nsubseteqq] [rel] [mb] ["22] -\definemathsymbol [nsupseteqq] [rel] [mb] ["23] -\definemathsymbol [subsetneqq] [rel] [mb] ["24] -\definemathsymbol [supsetneqq] [rel] [mb] ["25] -\definemathsymbol [varsubsetneqq] [rel] [mb] ["26] -\definemathsymbol [varsupsetneqq] [rel] [mb] ["27] -\definemathsymbol [subsetneq] [rel] [mb] ["28] -\definemathsymbol [supsetneq] [rel] [mb] ["29] -\definemathsymbol [nsubseteq] [rel] [mb] ["2A] -\definemathsymbol [nsupseteq] [rel] [mb] ["2B] -\definemathsymbol [nparallel] [rel] [mb] ["2C] -\definemathsymbol [nmid] [rel] [mb] ["2D] -\definemathsymbol [nshortmid] [rel] [mb] ["2E] -\definemathsymbol [nshortparallel] [rel] [mb] ["2F] -\definemathsymbol [nvdash] [rel] [mb] ["30] -\definemathsymbol [nVdash] [rel] [mb] ["31] -\definemathsymbol [nvDash] [rel] [mb] ["32] -\definemathsymbol [nVDash] [rel] [mb] ["33] -\definemathsymbol [ntrianglerighteq] [rel] [mb] ["34] -\definemathsymbol [ntrianglelefteq] [rel] [mb] ["35] -\definemathsymbol [ntriangleleft] [rel] [mb] ["36] -\definemathsymbol [ntriangleright] [rel] [mb] ["37] -\definemathsymbol [nleftarrow] [rel] [mb] ["38] -\definemathsymbol [nrightarrow] [rel] [mb] ["39] -\definemathsymbol [nLeftarrow] [rel] [mb] ["3A] -\definemathsymbol [nRightarrow] [rel] [mb] ["3B] -\definemathsymbol [nLeftrightarrow] [rel] [mb] ["3C] -\definemathsymbol [nleftrightarrow] [rel] [mb] ["3D] -\definemathsymbol [divideontimes] [bin] [mb] ["3E] -\definemathsymbol [varnothing] [ord] [mb] ["3F] -\definemathsymbol [nexists] [ord] [mb] ["40] -\definemathsymbol [Finv] [ord] [mb] ["60] -\definemathsymbol [Game] [ord] [mb] ["61] -\definemathsymbol [mho] [ord] [mb] ["66] -\definemathsymbol [eth] [ord] [mb] ["67] -\definemathsymbol [eqsim] [rel] [mb] ["68] -\definemathsymbol [beth] [ord] [mb] ["69] -\definemathsymbol [gimel] [ord] [mb] ["6A] -\definemathsymbol [daleth] [ord] [mb] ["6B] -\definemathsymbol [lessdot] [bin] [mb] ["6C] -\definemathsymbol [gtrdot] [bin] [mb] ["6D] -\definemathsymbol [ltimes] [bin] [mb] ["6E] -\definemathsymbol [rtimes] [bin] [mb] ["6F] -\definemathsymbol [shortmid] [rel] [mb] ["70] -\definemathsymbol [shortparallel] [rel] [mb] ["71] -\definemathsymbol [smallsetminus] [bin] [mb] ["72] -\definemathsymbol [thicksim] [rel] [mb] ["73] -\definemathsymbol [thickapprox] [rel] [mb] ["74] -\definemathsymbol [approxeq] [rel] [mb] ["75] -\definemathsymbol [succapprox] [rel] [mb] ["76] -\definemathsymbol [precapprox] [rel] [mb] ["77] -\definemathsymbol [curvearrowleft] [rel] [mb] ["78] -\definemathsymbol [curvearrowright] [rel] [mb] ["79] -\definemathsymbol [digamma] [ord] [mb] ["7A] -\definemathsymbol [varkappa] [ord] [mb] ["7B] -\definemathsymbol [Bbbk] [ord] [mb] ["7C] -\definemathsymbol [hslash] [ord] [mb] ["7D] -\definemathsymbol [hbar] [ord] [mb] ["7E] -\definemathsymbol [backepsilon] [rel] [mb] ["7F] - -\stopmathcollection - -\startmathcollection [default] - -\definemathcommand [yen] [nothing] {\mathhexbox{\hexmafam}55} -\definemathcommand [checkmark] [nothing] {\mathhexbox{\hexmafam}58} -\definemathcommand [circledR] [nothing] {\mathhexbox{\hexmafam}72} -\definemathcommand [maltese] [nothing] {\mathhexbox{\hexmafam}7A} - -\stopmathcollection - -\startmathcollection [default] - -\definemathcommand [dashrightarrow] [rel] {\dabar@\dabar@ \mathchar"0C4B} -\definemathcommand [dashleftarrow] [rel] {\mathchar"0C4C\dabar@ \dabar@} -\definemathcommand [dasharrow] [rel] {\dabar@\dabar@ \mathchar"0C4B} -\definemathcommand [Join] [rel] {\mathchar"0D6F\mkern-13.8mu\mathchar"0D6E} -\definemathcommand [implies] [rel] {\;\Longrightarrow\;} -\definemathcommand [impliedby] [rel] {\;\Longleftarrow\;} -\definemathcommand [And] [rel] {\;\internalAnd\;} - -\stopmathcollection - -\def\AMSwidehat#1% - {\setbox\scratchbox\hbox{$\mathsurround\zeropoint#1$}% - \ifdim\wd\scratchbox>2em - \mathaccent"0\purefamilyhex{mb}5B{#1}% - \else - \mathaccent"0\purefamilyhex{ex}62{#1}% - \fi} - -\def\AMSwidetilde#1% - {\setbox\scratchbox\hbox{$\mathsurround\zeropoint#1$}% - \ifdim\wd\scratchbox>2em - \mathaccent"0\purefamilyhex{mb}5D{#1}% - \else - \mathaccent"0\purefamilyhex{ex}65{#1}% - \fi} - -\startmathcollection [default] - -\definemathcommand [widehat] {\AMSwidehat} -\definemathcommand [widetilde] {\AMSwidetilde} - -\stopmathcollection - -\protect \endinput diff --git a/tex/context/base/math-cow.mkii b/tex/context/base/math-cow.mkii new file mode 100644 index 000000000..f0fc811c8 --- /dev/null +++ b/tex/context/base/math-cow.mkii @@ -0,0 +1,31 @@ +%D \module +%D [ file=math-cow, +%D version=2006.06.23, +%D title=\CONTEXT\ Math Macros, +%D subtitle=Cow Math, +%D author={Hans Hagen \& Taco Hoekwater}, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\def\COWsqrt {\mthsqrt{\char"7A}{\char"7B}} +\def\COWfrac {\mthfrac{\char"7C}{\char"7A}{\char"7B}} +\def\COWarrowfill{\mtharrowfill 1001} + +\startmathcollection [cow] + % todo +\stopmathcollection + +\startrawmathcollection[cow] + \definemathcommand [frac] {\COWfrac} + \definemathcommand [sqrt] {\COWsqrt} + %definemathcommand [r@@t] {\COWroot} + %definemathcommand [matrix] {\COWmatrix} +\stoprawmathcollection + +\protect \endinput diff --git a/tex/context/base/math-cow.tex b/tex/context/base/math-cow.tex deleted file mode 100644 index f0fc811c8..000000000 --- a/tex/context/base/math-cow.tex +++ /dev/null @@ -1,31 +0,0 @@ -%D \module -%D [ file=math-cow, -%D version=2006.06.23, -%D title=\CONTEXT\ Math Macros, -%D subtitle=Cow Math, -%D author={Hans Hagen \& Taco Hoekwater}, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\def\COWsqrt {\mthsqrt{\char"7A}{\char"7B}} -\def\COWfrac {\mthfrac{\char"7C}{\char"7A}{\char"7B}} -\def\COWarrowfill{\mtharrowfill 1001} - -\startmathcollection [cow] - % todo -\stopmathcollection - -\startrawmathcollection[cow] - \definemathcommand [frac] {\COWfrac} - \definemathcommand [sqrt] {\COWsqrt} - %definemathcommand [r@@t] {\COWroot} - %definemathcommand [matrix] {\COWmatrix} -\stoprawmathcollection - -\protect \endinput diff --git a/tex/context/base/math-def.mkiv b/tex/context/base/math-def.mkiv index 9e6ad28c1..0438777fa 100644 --- a/tex/context/base/math-def.mkiv +++ b/tex/context/base/math-def.mkiv @@ -132,7 +132,7 @@ \def\setoperatorlimits#1#2% operator limits {\savenormalmeaning{#1}% - \def#1{\getvalue{normal\strippedcsname#1}#2}} + \def#1{\csname normal\strippedcsname#1\endcsname#2}} \setoperatorlimits\int \intlimits \setoperatorlimits\iint \intlimits diff --git a/tex/context/base/math-eul.mkii b/tex/context/base/math-eul.mkii new file mode 100644 index 000000000..7552957a8 --- /dev/null +++ b/tex/context/base/math-eul.mkii @@ -0,0 +1,277 @@ +%D \module +%D [ file=math-eul, +%D version=2003.02.03, +%D title=\CONTEXT\ Math Macros, +%D subtitle=Virtual Euler Specials, +%D author={Hans Hagen \& Taco Hoekwater \& Adam Lindsay}, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. Further modified by Adam Lindsay. + +\unprotect + +%D We follow the following mappings from type-eul: +%D +%D mr [MathRoman] [Euler-Roman] [zeurm10] + +%D mi [MathItalic] [Euler-Italic] [eufm10] + +%D ex [MathExtension] [Euler-Extension] [zeuex10] +%D sy [MathSymbol] [Euler-Symbol] [zeusm10] + +%D mb [MathBeta] [Charter-Roman] [bchr8r] XXX +%D mc [MathGamma] [Euler-Fraktur] [eufm10] XXX +%D +%D The inclusion of Bitstream Charter was originally for the text accents. +%D Obviously, it's not a proper ``MathBeta'' font. + +%D The varrho and varsigma characters don't exist in eulervm, +%D so we point at the normal types. + +\definefamilysynonym [eul] [calligraphic] [sy] +\definefamilysynonym [eul] [oldstyle] [mi] +\definefamilysynonym [eul] [gothic] [mi] +\definefamilysynonym [eul] [fraktur] [mi] + +\definefamilysynonym [eul] [lcgreek] [mr] +\definefamilysynonym [eul] [ucgreek] [mr] +\definefamilysynonym [eul] [vargreek] [mr] + +%% Well, you don't know until you try! +%\definefamilysynonym [eul] [accents] [Serif] + +\startmathcollection [eul] + +\definemathsymbol [varrho] [nothing] [vargreek] ["1A] +\definemathsymbol [varsigma] [nothing] [vargreek] ["1B] + +%D Changes necessitated by collapsing mr \& mi into one: +\definemathsymbol [imath] [nothing] [mr] ["7B] +\definemathsymbol [jmath] [nothing] [mr] ["7C] +\definemathsymbol [ell] [nothing] [mr] ["60] +\definemathsymbol [wp] [nothing] [mr] ["7D] +\definemathsymbol [partial] [nothing] [mr] ["40] + +\definemathsymbol [flat] [ord] [mr] ["5B] +\definemathsymbol [natural] [ord] [mr] ["5C] +\definemathsymbol [sharp] [ord] [mr] ["5D] + +\definemathsymbol [triangleleft] [bin] [mr] ["2F] +\definemathsymbol [triangleright][bin] [mr] ["2E] + +\definemathsymbol [star] [bin] [mr] ["3F] + +\definemathsymbol [smile] [rel] [mr] ["5E] +\definemathsymbol [frown] [rel] [mr] ["5F] +\definemathsymbol [leftharpoonup] [rel] [mr] ["28] +\definemathsymbol [leftharpoondown] [rel] [mr] ["29] +\definemathsymbol [rightharpoonup] [rel] [mr] ["2A] +\definemathsymbol [rightharpoondown] [rel] [mr] ["2B] +\definemathsymbol [lhook] [rel] [mr] ["2C] +\definemathsymbol [rhook] [rel] [mr] ["2D] + +\definemathsymbol [mathperiod] [ord] [mr] ["3A] +\definemathsymbol [textperiod] [punct] [mr] ["3A] + +\definemathsymbol [mathcomma] [ord] [mr] ["3B] +\definemathsymbol [textcomma] [punct] [mr] ["3B] + +\definemathsymbol [ldotp] [punct] [mr] ["3A] + +% extras from AMS: +\definemathsymbol [hslash] [ord] [mr] ["80] %beauty over truth + +\stopmathcollection + +\startmathcollection [eul] +% Ugh. no way around this to keep it compact in the font defs. + +\definemathcharacter [a] [alpha] [mr] ["61] +\definemathcharacter [b] [alpha] [mr] ["62] +\definemathcharacter [c] [alpha] [mr] ["63] +\definemathcharacter [d] [alpha] [mr] ["64] +\definemathcharacter [e] [alpha] [mr] ["65] +\definemathcharacter [f] [alpha] [mr] ["66] +\definemathcharacter [g] [alpha] [mr] ["67] +\definemathcharacter [h] [alpha] [mr] ["68] +\definemathcharacter [i] [alpha] [mr] ["69] +\definemathcharacter [j] [alpha] [mr] ["6A] +\definemathcharacter [k] [alpha] [mr] ["6B] +\definemathcharacter [l] [alpha] [mr] ["6C] +\definemathcharacter [m] [alpha] [mr] ["6D] +\definemathcharacter [n] [alpha] [mr] ["6E] +\definemathcharacter [o] [alpha] [mr] ["6F] +\definemathcharacter [p] [alpha] [mr] ["70] +\definemathcharacter [q] [alpha] [mr] ["71] +\definemathcharacter [r] [alpha] [mr] ["72] +\definemathcharacter [s] [alpha] [mr] ["73] +\definemathcharacter [t] [alpha] [mr] ["74] +\definemathcharacter [u] [alpha] [mr] ["75] +\definemathcharacter [v] [alpha] [mr] ["76] +\definemathcharacter [w] [alpha] [mr] ["77] +\definemathcharacter [x] [alpha] [mr] ["78] +\definemathcharacter [y] [alpha] [mr] ["79] +\definemathcharacter [z] [alpha] [mr] ["7A] + +\definemathcharacter [A] [alpha] [mr] ["41] +\definemathcharacter [B] [alpha] [mr] ["42] +\definemathcharacter [C] [alpha] [mr] ["43] +\definemathcharacter [D] [alpha] [mr] ["44] +\definemathcharacter [E] [alpha] [mr] ["45] +\definemathcharacter [F] [alpha] [mr] ["46] +\definemathcharacter [G] [alpha] [mr] ["47] +\definemathcharacter [H] [alpha] [mr] ["48] +\definemathcharacter [I] [alpha] [mr] ["49] +\definemathcharacter [J] [alpha] [mr] ["4A] +\definemathcharacter [K] [alpha] [mr] ["4B] +\definemathcharacter [L] [alpha] [mr] ["4C] +\definemathcharacter [M] [alpha] [mr] ["4D] +\definemathcharacter [N] [alpha] [mr] ["4E] +\definemathcharacter [O] [alpha] [mr] ["4F] +\definemathcharacter [P] [alpha] [mr] ["50] +\definemathcharacter [Q] [alpha] [mr] ["51] +\definemathcharacter [R] [alpha] [mr] ["52] +\definemathcharacter [S] [alpha] [mr] ["53] +\definemathcharacter [T] [alpha] [mr] ["54] +\definemathcharacter [U] [alpha] [mr] ["55] +\definemathcharacter [V] [alpha] [mr] ["56] +\definemathcharacter [W] [alpha] [mr] ["57] +\definemathcharacter [X] [alpha] [mr] ["58] +\definemathcharacter [Y] [alpha] [mr] ["59] +\definemathcharacter [Z] [alpha] [mr] ["5A] + +\stopmathcollection + +\startmathcollection [eul] + +\definemathcharacter [!] [close] [sy] ["A1] +\definemathcharacter [(] [open] [sy] ["A8] +\definemathcharacter [)] [close] [sy] ["A9] +\definemathcharacter [+] [bin] [sy] ["AB] +\definemathcharacter [:] [rel] [sy] ["BA] +\definemathcharacter [;] [punct] [sy] ["BB] +\definemathcharacter [=] [rel] [sy] ["BD] +\definemathcharacter [?] [close] [sy] ["BF] +\definemathcharacter [91] [open] [sy] ["DB] % [ +\definemathcharacter [93] [close] [sy] ["DD] % ] + +\definemathcharacter [,] [punct] [mr] ["3B] +\definemathcharacter [.] [ord] [mr] ["3A] +\definemathcharacter [/] [ord] [mr] ["3D] +\definemathcharacter [<] [rel] [mr] ["3C] +\definemathcharacter [>] [rel] [mr] ["3E] + +\stopmathcollection + +\startmathcollection [eul] + +\definemathcharacter [(] [nothing] [sy] ["A8] [ex] ["00] +\definemathcharacter [)] [nothing] [sy] ["A9] [ex] ["01] +\definemathcharacter [91] [nothing] [sy] ["DB] [ex] ["02] % [ +\definemathcharacter [93] [nothing] [sy] ["DD] [ex] ["03] % ] +\definemathcharacter [/] [nothing] [mr] ["3D] [ex] ["0E] + +\stopmathcollection + +\startmathcollection [eul] + +\definemathsymbol [hbar] [nothing] [mr] ["80] + +\stopmathcollection + +\startmathcollection [eul] + +\definemathsymbol [ddagger] [bin] [sy] ["7A] +\definemathsymbol [dagger] [bin] [sy] ["79] + +\stopmathcollection + +\startmathcollection [eul] + +\definemathsymbol [colon] [punct] [sy] ["BA] + +\stopmathcollection + +%D This used to be very hackish; it brought in text +%D accents from the well-matched Bitstream Charter. + +%D But now, these characters don't exist. I would prefer to pull +%D them from the text font, but I don't know how. +%D Instead, I'm just pointing to null characters! + +\startmathcollection [eul] + +\definemathsymbol [acute] [accent] [mr] ["90] +\definemathsymbol [grave] [accent] [mr] ["91] +\definemathsymbol [ddot] [accent] [mr] ["92] +\definemathsymbol [tilde] [accent] [mr] ["93] +\definemathsymbol [bar] [accent] [mr] ["94] +\definemathsymbol [breve] [accent] [mr] ["95] +\definemathsymbol [check] [accent] [mr] ["96] +\definemathsymbol [hat] [accent] [mr] ["97] +\definemathsymbol [dot] [accent] [mr] ["98] +%\definemathsymbol [acute] [accent] [accents] ["B4] +%\definemathsymbol [grave] [accent] [accents] ["1E] +%\definemathsymbol [ddot] [accent] [accents] ["A8] +%\definemathsymbol [tilde] [accent] [accents] ["98] +%\definemathsymbol [bar] [accent] [accents] ["AF] +%\definemathsymbol [breve] [accent] [accents] ["0B] +%\definemathsymbol [check] [accent] [accents] ["10] +%\definemathsymbol [hat] [accent] [accents] ["5E] +%\definemathsymbol [dot] [accent] [accents] ["01] + +\definemathsymbol [vec] [accent] [mr] ["7E] % [ord] +\definemathsymbol [hat] [accent] [sy] ["DE] + +\stopmathcollection + +\startmathcollection [eul] + +\definemathsymbol [lgroup] [open] [sy] ["A8] [ex] ["3A] % ? +\definemathsymbol [rgroup] [close] [sy] ["A9] [ex] ["3B] % ? + +\stopmathcollection + +\startmathcollection [eul] + +\definemathsymbol [dag] [box] [sy] ["79] +\definemathsymbol [ddag] [box] [sy] ["7A] +\definemathsymbol [S] [box] [sy] ["78] +\definemathsymbol [P] [box] [sy] ["7B] + +\stopmathcollection + +%D Aditya's additionl definitions: + +\startmathcollection[eul:texnansi] + \definemathsymbol [acute] [accent] [tf] ["13] + \definemathsymbol [grave] [accent] [tf] ["12] + \definemathsymbol [ddot] [accent] [tf] ["A8] + \definemathsymbol [tilde] [accent] [tf] ["98] + \definemathsymbol [bar] [accent] [tf] ["16] + \definemathsymbol [breve] [accent] [tf] ["15] + \definemathsymbol [check] [accent] [tf] ["14] + \definemathsymbol [hat] [accent] [tf] ["88] + \definemathsymbol [dot] [accent] [tf] ["5] + % Why is mathring not defined?? + \definemathsymbol [mathring] [accent] [tf] ["17] +\stopmathcollection + +\startmathcollection[eul:ec] + \definemathsymbol [acute] [accent] [tf] ["1] + \definemathsymbol [grave] [accent] [tf] ["0] + \definemathsymbol [ddot] [accent] [tf] ["4] + \definemathsymbol [tilde] [accent] [tf] ["3] + \definemathsymbol [bar] [accent] [tf] ["9] + \definemathsymbol [breve] [accent] [tf] ["8] + \definemathsymbol [check] [accent] [tf] ["7] + \definemathsymbol [hat] [accent] [tf] ["2] + \definemathsymbol [dot] [accent] [tf] ["A] + % Why is mathring not defined?? + \definemathsymbol [mathring] [accent] [tf] ["6] +\stopmathcollection + +\protect \endinput diff --git a/tex/context/base/math-eul.tex b/tex/context/base/math-eul.tex deleted file mode 100644 index 7552957a8..000000000 --- a/tex/context/base/math-eul.tex +++ /dev/null @@ -1,277 +0,0 @@ -%D \module -%D [ file=math-eul, -%D version=2003.02.03, -%D title=\CONTEXT\ Math Macros, -%D subtitle=Virtual Euler Specials, -%D author={Hans Hagen \& Taco Hoekwater \& Adam Lindsay}, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. Further modified by Adam Lindsay. - -\unprotect - -%D We follow the following mappings from type-eul: -%D -%D mr [MathRoman] [Euler-Roman] [zeurm10] - -%D mi [MathItalic] [Euler-Italic] [eufm10] - -%D ex [MathExtension] [Euler-Extension] [zeuex10] -%D sy [MathSymbol] [Euler-Symbol] [zeusm10] - -%D mb [MathBeta] [Charter-Roman] [bchr8r] XXX -%D mc [MathGamma] [Euler-Fraktur] [eufm10] XXX -%D -%D The inclusion of Bitstream Charter was originally for the text accents. -%D Obviously, it's not a proper ``MathBeta'' font. - -%D The varrho and varsigma characters don't exist in eulervm, -%D so we point at the normal types. - -\definefamilysynonym [eul] [calligraphic] [sy] -\definefamilysynonym [eul] [oldstyle] [mi] -\definefamilysynonym [eul] [gothic] [mi] -\definefamilysynonym [eul] [fraktur] [mi] - -\definefamilysynonym [eul] [lcgreek] [mr] -\definefamilysynonym [eul] [ucgreek] [mr] -\definefamilysynonym [eul] [vargreek] [mr] - -%% Well, you don't know until you try! -%\definefamilysynonym [eul] [accents] [Serif] - -\startmathcollection [eul] - -\definemathsymbol [varrho] [nothing] [vargreek] ["1A] -\definemathsymbol [varsigma] [nothing] [vargreek] ["1B] - -%D Changes necessitated by collapsing mr \& mi into one: -\definemathsymbol [imath] [nothing] [mr] ["7B] -\definemathsymbol [jmath] [nothing] [mr] ["7C] -\definemathsymbol [ell] [nothing] [mr] ["60] -\definemathsymbol [wp] [nothing] [mr] ["7D] -\definemathsymbol [partial] [nothing] [mr] ["40] - -\definemathsymbol [flat] [ord] [mr] ["5B] -\definemathsymbol [natural] [ord] [mr] ["5C] -\definemathsymbol [sharp] [ord] [mr] ["5D] - -\definemathsymbol [triangleleft] [bin] [mr] ["2F] -\definemathsymbol [triangleright][bin] [mr] ["2E] - -\definemathsymbol [star] [bin] [mr] ["3F] - -\definemathsymbol [smile] [rel] [mr] ["5E] -\definemathsymbol [frown] [rel] [mr] ["5F] -\definemathsymbol [leftharpoonup] [rel] [mr] ["28] -\definemathsymbol [leftharpoondown] [rel] [mr] ["29] -\definemathsymbol [rightharpoonup] [rel] [mr] ["2A] -\definemathsymbol [rightharpoondown] [rel] [mr] ["2B] -\definemathsymbol [lhook] [rel] [mr] ["2C] -\definemathsymbol [rhook] [rel] [mr] ["2D] - -\definemathsymbol [mathperiod] [ord] [mr] ["3A] -\definemathsymbol [textperiod] [punct] [mr] ["3A] - -\definemathsymbol [mathcomma] [ord] [mr] ["3B] -\definemathsymbol [textcomma] [punct] [mr] ["3B] - -\definemathsymbol [ldotp] [punct] [mr] ["3A] - -% extras from AMS: -\definemathsymbol [hslash] [ord] [mr] ["80] %beauty over truth - -\stopmathcollection - -\startmathcollection [eul] -% Ugh. no way around this to keep it compact in the font defs. - -\definemathcharacter [a] [alpha] [mr] ["61] -\definemathcharacter [b] [alpha] [mr] ["62] -\definemathcharacter [c] [alpha] [mr] ["63] -\definemathcharacter [d] [alpha] [mr] ["64] -\definemathcharacter [e] [alpha] [mr] ["65] -\definemathcharacter [f] [alpha] [mr] ["66] -\definemathcharacter [g] [alpha] [mr] ["67] -\definemathcharacter [h] [alpha] [mr] ["68] -\definemathcharacter [i] [alpha] [mr] ["69] -\definemathcharacter [j] [alpha] [mr] ["6A] -\definemathcharacter [k] [alpha] [mr] ["6B] -\definemathcharacter [l] [alpha] [mr] ["6C] -\definemathcharacter [m] [alpha] [mr] ["6D] -\definemathcharacter [n] [alpha] [mr] ["6E] -\definemathcharacter [o] [alpha] [mr] ["6F] -\definemathcharacter [p] [alpha] [mr] ["70] -\definemathcharacter [q] [alpha] [mr] ["71] -\definemathcharacter [r] [alpha] [mr] ["72] -\definemathcharacter [s] [alpha] [mr] ["73] -\definemathcharacter [t] [alpha] [mr] ["74] -\definemathcharacter [u] [alpha] [mr] ["75] -\definemathcharacter [v] [alpha] [mr] ["76] -\definemathcharacter [w] [alpha] [mr] ["77] -\definemathcharacter [x] [alpha] [mr] ["78] -\definemathcharacter [y] [alpha] [mr] ["79] -\definemathcharacter [z] [alpha] [mr] ["7A] - -\definemathcharacter [A] [alpha] [mr] ["41] -\definemathcharacter [B] [alpha] [mr] ["42] -\definemathcharacter [C] [alpha] [mr] ["43] -\definemathcharacter [D] [alpha] [mr] ["44] -\definemathcharacter [E] [alpha] [mr] ["45] -\definemathcharacter [F] [alpha] [mr] ["46] -\definemathcharacter [G] [alpha] [mr] ["47] -\definemathcharacter [H] [alpha] [mr] ["48] -\definemathcharacter [I] [alpha] [mr] ["49] -\definemathcharacter [J] [alpha] [mr] ["4A] -\definemathcharacter [K] [alpha] [mr] ["4B] -\definemathcharacter [L] [alpha] [mr] ["4C] -\definemathcharacter [M] [alpha] [mr] ["4D] -\definemathcharacter [N] [alpha] [mr] ["4E] -\definemathcharacter [O] [alpha] [mr] ["4F] -\definemathcharacter [P] [alpha] [mr] ["50] -\definemathcharacter [Q] [alpha] [mr] ["51] -\definemathcharacter [R] [alpha] [mr] ["52] -\definemathcharacter [S] [alpha] [mr] ["53] -\definemathcharacter [T] [alpha] [mr] ["54] -\definemathcharacter [U] [alpha] [mr] ["55] -\definemathcharacter [V] [alpha] [mr] ["56] -\definemathcharacter [W] [alpha] [mr] ["57] -\definemathcharacter [X] [alpha] [mr] ["58] -\definemathcharacter [Y] [alpha] [mr] ["59] -\definemathcharacter [Z] [alpha] [mr] ["5A] - -\stopmathcollection - -\startmathcollection [eul] - -\definemathcharacter [!] [close] [sy] ["A1] -\definemathcharacter [(] [open] [sy] ["A8] -\definemathcharacter [)] [close] [sy] ["A9] -\definemathcharacter [+] [bin] [sy] ["AB] -\definemathcharacter [:] [rel] [sy] ["BA] -\definemathcharacter [;] [punct] [sy] ["BB] -\definemathcharacter [=] [rel] [sy] ["BD] -\definemathcharacter [?] [close] [sy] ["BF] -\definemathcharacter [91] [open] [sy] ["DB] % [ -\definemathcharacter [93] [close] [sy] ["DD] % ] - -\definemathcharacter [,] [punct] [mr] ["3B] -\definemathcharacter [.] [ord] [mr] ["3A] -\definemathcharacter [/] [ord] [mr] ["3D] -\definemathcharacter [<] [rel] [mr] ["3C] -\definemathcharacter [>] [rel] [mr] ["3E] - -\stopmathcollection - -\startmathcollection [eul] - -\definemathcharacter [(] [nothing] [sy] ["A8] [ex] ["00] -\definemathcharacter [)] [nothing] [sy] ["A9] [ex] ["01] -\definemathcharacter [91] [nothing] [sy] ["DB] [ex] ["02] % [ -\definemathcharacter [93] [nothing] [sy] ["DD] [ex] ["03] % ] -\definemathcharacter [/] [nothing] [mr] ["3D] [ex] ["0E] - -\stopmathcollection - -\startmathcollection [eul] - -\definemathsymbol [hbar] [nothing] [mr] ["80] - -\stopmathcollection - -\startmathcollection [eul] - -\definemathsymbol [ddagger] [bin] [sy] ["7A] -\definemathsymbol [dagger] [bin] [sy] ["79] - -\stopmathcollection - -\startmathcollection [eul] - -\definemathsymbol [colon] [punct] [sy] ["BA] - -\stopmathcollection - -%D This used to be very hackish; it brought in text -%D accents from the well-matched Bitstream Charter. - -%D But now, these characters don't exist. I would prefer to pull -%D them from the text font, but I don't know how. -%D Instead, I'm just pointing to null characters! - -\startmathcollection [eul] - -\definemathsymbol [acute] [accent] [mr] ["90] -\definemathsymbol [grave] [accent] [mr] ["91] -\definemathsymbol [ddot] [accent] [mr] ["92] -\definemathsymbol [tilde] [accent] [mr] ["93] -\definemathsymbol [bar] [accent] [mr] ["94] -\definemathsymbol [breve] [accent] [mr] ["95] -\definemathsymbol [check] [accent] [mr] ["96] -\definemathsymbol [hat] [accent] [mr] ["97] -\definemathsymbol [dot] [accent] [mr] ["98] -%\definemathsymbol [acute] [accent] [accents] ["B4] -%\definemathsymbol [grave] [accent] [accents] ["1E] -%\definemathsymbol [ddot] [accent] [accents] ["A8] -%\definemathsymbol [tilde] [accent] [accents] ["98] -%\definemathsymbol [bar] [accent] [accents] ["AF] -%\definemathsymbol [breve] [accent] [accents] ["0B] -%\definemathsymbol [check] [accent] [accents] ["10] -%\definemathsymbol [hat] [accent] [accents] ["5E] -%\definemathsymbol [dot] [accent] [accents] ["01] - -\definemathsymbol [vec] [accent] [mr] ["7E] % [ord] -\definemathsymbol [hat] [accent] [sy] ["DE] - -\stopmathcollection - -\startmathcollection [eul] - -\definemathsymbol [lgroup] [open] [sy] ["A8] [ex] ["3A] % ? -\definemathsymbol [rgroup] [close] [sy] ["A9] [ex] ["3B] % ? - -\stopmathcollection - -\startmathcollection [eul] - -\definemathsymbol [dag] [box] [sy] ["79] -\definemathsymbol [ddag] [box] [sy] ["7A] -\definemathsymbol [S] [box] [sy] ["78] -\definemathsymbol [P] [box] [sy] ["7B] - -\stopmathcollection - -%D Aditya's additionl definitions: - -\startmathcollection[eul:texnansi] - \definemathsymbol [acute] [accent] [tf] ["13] - \definemathsymbol [grave] [accent] [tf] ["12] - \definemathsymbol [ddot] [accent] [tf] ["A8] - \definemathsymbol [tilde] [accent] [tf] ["98] - \definemathsymbol [bar] [accent] [tf] ["16] - \definemathsymbol [breve] [accent] [tf] ["15] - \definemathsymbol [check] [accent] [tf] ["14] - \definemathsymbol [hat] [accent] [tf] ["88] - \definemathsymbol [dot] [accent] [tf] ["5] - % Why is mathring not defined?? - \definemathsymbol [mathring] [accent] [tf] ["17] -\stopmathcollection - -\startmathcollection[eul:ec] - \definemathsymbol [acute] [accent] [tf] ["1] - \definemathsymbol [grave] [accent] [tf] ["0] - \definemathsymbol [ddot] [accent] [tf] ["4] - \definemathsymbol [tilde] [accent] [tf] ["3] - \definemathsymbol [bar] [accent] [tf] ["9] - \definemathsymbol [breve] [accent] [tf] ["8] - \definemathsymbol [check] [accent] [tf] ["7] - \definemathsymbol [hat] [accent] [tf] ["2] - \definemathsymbol [dot] [accent] [tf] ["A] - % Why is mathring not defined?? - \definemathsymbol [mathring] [accent] [tf] ["6] -\stopmathcollection - -\protect \endinput diff --git a/tex/context/base/math-fou.mkii b/tex/context/base/math-fou.mkii new file mode 100644 index 000000000..8a72f1288 --- /dev/null +++ b/tex/context/base/math-fou.mkii @@ -0,0 +1,196 @@ +%D \module +%D [ file=math-fou, +%D version=2001.04.12, +%D title=\CONTEXT\ Math Macros, +%D subtitle=Fourier Specials, +%D author={Michel Biovani \& Hans Hagen}, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% see end of file for todo + +\unprotect + +\startmathcollection [fou] + + \definemathsymbol [Gamma] [alpha] [mi] ["00] + \definemathsymbol [Delta] [alpha] [mi] ["01] + \definemathsymbol [Theta] [alpha] [mi] ["02] + \definemathsymbol [Lambda] [alpha] [mi] ["03] + \definemathsymbol [Xi] [alpha] [mi] ["04] + \definemathsymbol [Pi] [alpha] [mi] ["05] + \definemathsymbol [Sigma] [alpha] [mi] ["06] + \definemathsymbol [Upsilon] [alpha] [mi] ["07] + \definemathsymbol [Phi] [alpha] [mi] ["08] + \definemathsymbol [Psi] [alpha] [mi] ["09] + \definemathsymbol [Omega] [alpha] [mi] ["0A] + +\stopmathcollection + +\startmathcollection [fou] + + \definemathcharacter [+] [bin] [sy] ["80] + \definemathcharacter [=] [rel] [sy] ["81] + \definemathcharacter [<] [rel] [sy] ["82] + \definemathcharacter [>] [rel] [sy] ["83] + +\stopmathcollection + +\startmathcollection [fou] + + \definemathsymbol [leqslant] [rel] [sy] ["84] + \definemathsymbol [geqslant] [rel] [sy] ["85] + \definemathsymbol [parallelslant] [rel] [sy] ["86] + \definemathsymbol [thething] [ord] [sy] ["87] + \definemathsymbol [vDash] [rel] [sy] ["88] + \definemathsymbol [blacktriangleleft] [rel] [sy] ["89] + \definemathsymbol [blacktriangleright] [rel] [sy] ["8A] + \definemathsymbol [nleqslant] [rel] [sy] ["8B] + \definemathsymbol [ngeqslant] [rel] [sy] ["8C] + \definemathsymbol [parallel] [rel] [sy] ["8D] + \definemathsymbol [nparallel] [rel] [sy] ["8E] + \definemathsymbol [nparallelslant] [rel] [sy] ["8F] + \definemathsymbol [nvDash] [rel] [sy] ["90] + \definemathsymbol [intercal] [bin] [sy] ["91] + \definemathsymbol [hslash] [ord] [sy] ["92] + \definemathsymbol [nexists] [ord] [sy] ["93] + \definemathsymbol [varsubsetneq] [rel] [sy] ["93] + +\stopmathcollection + +\startmathcollection [fou] + + \definemathcharacter [(] [nothing] [mr] ["28] [ex] ["A1] + \definemathcharacter [)] [nothing] [mr] ["29] [ex] ["A2] + \definemathcharacter [91] [nothing] [mr] ["5B] [ex] ["A3] % [ + \definemathcharacter [93] [nothing] [mr] ["5D] [ex] ["A4] % ] + \definemathcharacter [/] [nothing] [mr] ["2F] [ex] ["B1] + + \definemathcharacter [124] [nothing] [sy] ["6A] [ex] ["AF] % | + \definemathcharacter [92] [nothing] [sy] ["6E] [ex] ["B2] % \ + +\stopmathcollection + +\startmathcollection [fou] + + \definemathsymbol [Vert] [nothing] [sy] ["6B] [ex] ["B0] + \definemathsymbol [vert] [nothing] [sy] ["6A] [ex] ["AF] + \definemathsymbol [VERT] [nothing] [sy] ["98] [ex] ["93] + \definemathsymbol [Downarrow] [rel] [sy] ["2B] [ex] ["C4] + \definemathsymbol [backslash] [nothing] [sy] ["6E] [ex] ["B2] + \definemathsymbol [rangle] [close] [sy] ["69] [ex] ["AE] + \definemathsymbol [langle] [open] [sy] ["68] [ex] ["AD] + \definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["AA] + \definemathsymbol [lbrace] [open] [sy] ["66] [ex] ["A9] + \definemathsymbol [rceil] [close] [sy] ["65] [ex] ["A8] + \definemathsymbol [lceil] [open] [sy] ["64] [ex] ["A7] + \definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["A6] + \definemathsymbol [lfloor] [open] [sy] ["62] [ex] ["A5] + \definemathsymbol [dblbrackleft] [open] [sy] ["99] [ex] ["85] + \definemathsymbol [dblbrackright] [close] [sy] ["9A] [ex] ["86] + +\stopmathcollection + +\startmathcollection [fou] + + \definemathsymbol [varkappa] [ord] [mi] ["80] % check this + \definemathsymbol [varvarrho] [ord] [mi] ["81] % check this + \definemathsymbol [xswordsup] [ord] [sy] ["96] + \definemathsymbol [xswordsdown] [ord] [sy] ["97] + \definemathsymbol [notowns] [rel] [sy] ["9C] + \definemathsymbol [hbar] [ord] [sy] ["9D] + \definemathsymbol [smallsetminus] [bin] [sy] ["9E] + +\stopmathcollection + +\startmathcollection [fou] + + \definemathsymbol [notin] [rel] [sy] ["9B] + +\stopmathcollection + +\startmathcollection [fou] + + \definemathsymbol [iintop] [op] [ex] ["CE] + \definemathsymbol [iiintop] [op] [ex] ["D0] + \definemathsymbol [oiintop] [op] [ex] ["D2] + \definemathsymbol [oiiintop] [op] [ex] ["D4] + \definemathsymbol [slashintop] [op] [ex] ["D6] + +\stopmathcollection + +\startmathcollection [fou] + + \definemathcommand [iint] {\iintop \nolimits} + \definemathcommand [iiint] {\iiintop \nolimits} + \definemathcommand [oiint] {\oiintop \nolimits} + \definemathcommand [oiiint] {\oiiintop \nolimits} + \definemathcommand [slashint] {\slashintop\nolimits} + +\stopmathcollection + +\startmathcollection [fou] + + \definemathsymbol [acute] [accent] [mr] ["1] + \definemathsymbol [grave] [accent] [mr] ["0] + \definemathsymbol [ddot] [accent] [mr] ["4] + \definemathsymbol [tilde] [accent] [mr] ["3] + \definemathsymbol [bar] [accent] [mr] ["9] + \definemathsymbol [breve] [accent] [mr] ["8] + \definemathsymbol [check] [accent] [mr] ["7] + \definemathsymbol [hat] [accent] [mr] ["2] + \definemathsymbol [dot] [accent] [mr] ["A] + \definemathsymbol [mathring] [accent] [mr] ["6] + +\stopmathcollection + +\startmathcollection [fou] + + \definemathsymbol [otheralpha] [ord] [mi] ["0B] + \definemathsymbol [otherbeta] [ord] [mi] ["0C] + \definemathsymbol [othergamma] [ord] [mi] ["0D] + \definemathsymbol [otherdelta] [ord] [mi] ["0E] + \definemathsymbol [otherepsilon] [ord] [mi] ["0F] + \definemathsymbol [otherzeta] [ord] [mi] ["10] + +\stopmathcollection + +\protect \endinput + +% from a mail of Michel B / todo + +% \definemathsymbol [acute] [accent] [operators] ["1] +% \definemathsymbol [grave] [accent] [operators] ["0] +% \definemathsymbol [ddot] [accent] [operators] ["4] +% \definemathsymbol [tilde] [accent] [operators] ["3] +% \definemathsymbol [bar] [accent] [operators] ["9] +% \definemathsymbol [breve] [accent] [operators] ["8] +% \definemathsymbol [check] [accent] [operators] ["7] +% \definemathsymbol [hat] [accent] [operators] ["2] +% \definemathsymbol [dot] [accent] [operators] ["A] +% \definemathsymbol [mathring] [accent] [operators] ["6] + +% \definemathsymbol [wideparen] [ord] [largesymbols] ["94] +% \definemathsymbol [widearc] [accent] [largesymbols] ["D8] + +% check for definition of \overset (ams) + +% \def\FOUwidering#1% +% {\overset{\smash{\vbox to .2ex{\hbox{$\mathring{}$}}}}{\wideparen{#1}}} + +% \startmathcollection [default] % [ams] +% +% \definemathcommand [widering] {\FOUwidering} +% +% \stopmathcollection + +% \definemathsymbol [otheralpha] [ord] [otherletters] ["0B] +% \definemathsymbol [otherbeta] [ord] [otherletters] ["0C] +% \definemathsymbol [othergamma] [ord] [otherletters] ["0D] +% \definemathsymbol [otherdelta] [ord] [otherletters] ["0E] +% \definemathsymbol [otherepsilon] [ord] [otherletters] ["0F] +% \definemathsymbol [otherzeta] [ord] [otherletters] ["10] diff --git a/tex/context/base/math-fou.tex b/tex/context/base/math-fou.tex deleted file mode 100644 index 8a72f1288..000000000 --- a/tex/context/base/math-fou.tex +++ /dev/null @@ -1,196 +0,0 @@ -%D \module -%D [ file=math-fou, -%D version=2001.04.12, -%D title=\CONTEXT\ Math Macros, -%D subtitle=Fourier Specials, -%D author={Michel Biovani \& Hans Hagen}, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% see end of file for todo - -\unprotect - -\startmathcollection [fou] - - \definemathsymbol [Gamma] [alpha] [mi] ["00] - \definemathsymbol [Delta] [alpha] [mi] ["01] - \definemathsymbol [Theta] [alpha] [mi] ["02] - \definemathsymbol [Lambda] [alpha] [mi] ["03] - \definemathsymbol [Xi] [alpha] [mi] ["04] - \definemathsymbol [Pi] [alpha] [mi] ["05] - \definemathsymbol [Sigma] [alpha] [mi] ["06] - \definemathsymbol [Upsilon] [alpha] [mi] ["07] - \definemathsymbol [Phi] [alpha] [mi] ["08] - \definemathsymbol [Psi] [alpha] [mi] ["09] - \definemathsymbol [Omega] [alpha] [mi] ["0A] - -\stopmathcollection - -\startmathcollection [fou] - - \definemathcharacter [+] [bin] [sy] ["80] - \definemathcharacter [=] [rel] [sy] ["81] - \definemathcharacter [<] [rel] [sy] ["82] - \definemathcharacter [>] [rel] [sy] ["83] - -\stopmathcollection - -\startmathcollection [fou] - - \definemathsymbol [leqslant] [rel] [sy] ["84] - \definemathsymbol [geqslant] [rel] [sy] ["85] - \definemathsymbol [parallelslant] [rel] [sy] ["86] - \definemathsymbol [thething] [ord] [sy] ["87] - \definemathsymbol [vDash] [rel] [sy] ["88] - \definemathsymbol [blacktriangleleft] [rel] [sy] ["89] - \definemathsymbol [blacktriangleright] [rel] [sy] ["8A] - \definemathsymbol [nleqslant] [rel] [sy] ["8B] - \definemathsymbol [ngeqslant] [rel] [sy] ["8C] - \definemathsymbol [parallel] [rel] [sy] ["8D] - \definemathsymbol [nparallel] [rel] [sy] ["8E] - \definemathsymbol [nparallelslant] [rel] [sy] ["8F] - \definemathsymbol [nvDash] [rel] [sy] ["90] - \definemathsymbol [intercal] [bin] [sy] ["91] - \definemathsymbol [hslash] [ord] [sy] ["92] - \definemathsymbol [nexists] [ord] [sy] ["93] - \definemathsymbol [varsubsetneq] [rel] [sy] ["93] - -\stopmathcollection - -\startmathcollection [fou] - - \definemathcharacter [(] [nothing] [mr] ["28] [ex] ["A1] - \definemathcharacter [)] [nothing] [mr] ["29] [ex] ["A2] - \definemathcharacter [91] [nothing] [mr] ["5B] [ex] ["A3] % [ - \definemathcharacter [93] [nothing] [mr] ["5D] [ex] ["A4] % ] - \definemathcharacter [/] [nothing] [mr] ["2F] [ex] ["B1] - - \definemathcharacter [124] [nothing] [sy] ["6A] [ex] ["AF] % | - \definemathcharacter [92] [nothing] [sy] ["6E] [ex] ["B2] % \ - -\stopmathcollection - -\startmathcollection [fou] - - \definemathsymbol [Vert] [nothing] [sy] ["6B] [ex] ["B0] - \definemathsymbol [vert] [nothing] [sy] ["6A] [ex] ["AF] - \definemathsymbol [VERT] [nothing] [sy] ["98] [ex] ["93] - \definemathsymbol [Downarrow] [rel] [sy] ["2B] [ex] ["C4] - \definemathsymbol [backslash] [nothing] [sy] ["6E] [ex] ["B2] - \definemathsymbol [rangle] [close] [sy] ["69] [ex] ["AE] - \definemathsymbol [langle] [open] [sy] ["68] [ex] ["AD] - \definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["AA] - \definemathsymbol [lbrace] [open] [sy] ["66] [ex] ["A9] - \definemathsymbol [rceil] [close] [sy] ["65] [ex] ["A8] - \definemathsymbol [lceil] [open] [sy] ["64] [ex] ["A7] - \definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["A6] - \definemathsymbol [lfloor] [open] [sy] ["62] [ex] ["A5] - \definemathsymbol [dblbrackleft] [open] [sy] ["99] [ex] ["85] - \definemathsymbol [dblbrackright] [close] [sy] ["9A] [ex] ["86] - -\stopmathcollection - -\startmathcollection [fou] - - \definemathsymbol [varkappa] [ord] [mi] ["80] % check this - \definemathsymbol [varvarrho] [ord] [mi] ["81] % check this - \definemathsymbol [xswordsup] [ord] [sy] ["96] - \definemathsymbol [xswordsdown] [ord] [sy] ["97] - \definemathsymbol [notowns] [rel] [sy] ["9C] - \definemathsymbol [hbar] [ord] [sy] ["9D] - \definemathsymbol [smallsetminus] [bin] [sy] ["9E] - -\stopmathcollection - -\startmathcollection [fou] - - \definemathsymbol [notin] [rel] [sy] ["9B] - -\stopmathcollection - -\startmathcollection [fou] - - \definemathsymbol [iintop] [op] [ex] ["CE] - \definemathsymbol [iiintop] [op] [ex] ["D0] - \definemathsymbol [oiintop] [op] [ex] ["D2] - \definemathsymbol [oiiintop] [op] [ex] ["D4] - \definemathsymbol [slashintop] [op] [ex] ["D6] - -\stopmathcollection - -\startmathcollection [fou] - - \definemathcommand [iint] {\iintop \nolimits} - \definemathcommand [iiint] {\iiintop \nolimits} - \definemathcommand [oiint] {\oiintop \nolimits} - \definemathcommand [oiiint] {\oiiintop \nolimits} - \definemathcommand [slashint] {\slashintop\nolimits} - -\stopmathcollection - -\startmathcollection [fou] - - \definemathsymbol [acute] [accent] [mr] ["1] - \definemathsymbol [grave] [accent] [mr] ["0] - \definemathsymbol [ddot] [accent] [mr] ["4] - \definemathsymbol [tilde] [accent] [mr] ["3] - \definemathsymbol [bar] [accent] [mr] ["9] - \definemathsymbol [breve] [accent] [mr] ["8] - \definemathsymbol [check] [accent] [mr] ["7] - \definemathsymbol [hat] [accent] [mr] ["2] - \definemathsymbol [dot] [accent] [mr] ["A] - \definemathsymbol [mathring] [accent] [mr] ["6] - -\stopmathcollection - -\startmathcollection [fou] - - \definemathsymbol [otheralpha] [ord] [mi] ["0B] - \definemathsymbol [otherbeta] [ord] [mi] ["0C] - \definemathsymbol [othergamma] [ord] [mi] ["0D] - \definemathsymbol [otherdelta] [ord] [mi] ["0E] - \definemathsymbol [otherepsilon] [ord] [mi] ["0F] - \definemathsymbol [otherzeta] [ord] [mi] ["10] - -\stopmathcollection - -\protect \endinput - -% from a mail of Michel B / todo - -% \definemathsymbol [acute] [accent] [operators] ["1] -% \definemathsymbol [grave] [accent] [operators] ["0] -% \definemathsymbol [ddot] [accent] [operators] ["4] -% \definemathsymbol [tilde] [accent] [operators] ["3] -% \definemathsymbol [bar] [accent] [operators] ["9] -% \definemathsymbol [breve] [accent] [operators] ["8] -% \definemathsymbol [check] [accent] [operators] ["7] -% \definemathsymbol [hat] [accent] [operators] ["2] -% \definemathsymbol [dot] [accent] [operators] ["A] -% \definemathsymbol [mathring] [accent] [operators] ["6] - -% \definemathsymbol [wideparen] [ord] [largesymbols] ["94] -% \definemathsymbol [widearc] [accent] [largesymbols] ["D8] - -% check for definition of \overset (ams) - -% \def\FOUwidering#1% -% {\overset{\smash{\vbox to .2ex{\hbox{$\mathring{}$}}}}{\wideparen{#1}}} - -% \startmathcollection [default] % [ams] -% -% \definemathcommand [widering] {\FOUwidering} -% -% \stopmathcollection - -% \definemathsymbol [otheralpha] [ord] [otherletters] ["0B] -% \definemathsymbol [otherbeta] [ord] [otherletters] ["0C] -% \definemathsymbol [othergamma] [ord] [otherletters] ["0D] -% \definemathsymbol [otherdelta] [ord] [otherletters] ["0E] -% \definemathsymbol [otherepsilon] [ord] [otherletters] ["0F] -% \definemathsymbol [otherzeta] [ord] [otherletters] ["10] diff --git a/tex/context/base/math-frc.mkiv b/tex/context/base/math-frc.mkiv index d40306199..2305cec30 100644 --- a/tex/context/base/math-frc.mkiv +++ b/tex/context/base/math-frc.mkiv @@ -126,21 +126,21 @@ % let's see who complains ... \mathstyle is now a primitive % % \unexpanded\def\ch#1% -% {\ifundefined\@@chemicalletter -% \mathstyle{\rm#1}% -% \else +% {\ifdefined\@@chemicalletter % \dosetsubscripts % \mathstyle{\@@chemicalletter{#1}}% % \doresetsubscripts +% \else +% \mathstyle{\rm#1}% % \fi} % \unexpanded\def\ch#1% -% {\ifundefined\@@chemicalletter -% \mathematics{\rm#1}% -% \else +% {\ifdefined\@@chemicalletter % \dosetsubscripts % \mathematics{\@@chemicalletter{#1}}% % \doresetsubscripts +% \else +% \mathematics{\rm#1}% % \fi} %D \macros diff --git a/tex/context/base/math-ini.mkii b/tex/context/base/math-ini.mkii index 7d87fb365..6713987f7 100644 --- a/tex/context/base/math-ini.mkii +++ b/tex/context/base/math-ini.mkii @@ -386,7 +386,7 @@ \else \edef\mathclass{#1}% \fi - \doinputonce{\truefilename{\f!mathprefix\mathclass}}% + \doinputonce{\truefilename{\f!mathprefix\mathclass}.mkii}% \doifsomething\fontclass{\setevalue{\@mc@\fontclass\@mc@}{\mathclass}}% \popmacro\mathclass \popmacro\fontclass} @@ -410,7 +410,7 @@ \def\resetmathcollection[#1]% {\def\mathcollection{#1}% - \forgetdoingonce{\f!mathprefix\mathcollection}% + \forgetdoingonce{\f!mathprefix\mathcollection.mkii}% \setmathtoks \ifx\mathtoks\relax\else\mathtoks\emptytoks\fi} diff --git a/tex/context/base/math-inl.mkiv b/tex/context/base/math-inl.mkiv index acbf02de7..93168b885 100644 --- a/tex/context/base/math-inl.mkiv +++ b/tex/context/base/math-inl.mkiv @@ -94,8 +94,7 @@ \setbox\nextbox\hbox{$#2$}% \iftracegridsnapping \setbox\nextbox\ruledhbox - {\incolortrue\localcolortrue - \backgroundline[gray]{\showstruts\strut\flushnextbox}}% + {\backgroundline[gray]{\showstruts\strut\flushnextbox}}% \fi \def\docommand##1% {\doif{##1}-{\settrue \halfcrazymathlines}% @@ -187,9 +186,7 @@ \forgetall \crazymathindent \iftracegridsnapping - \setbox\scratchbox\hbox - {\incolortrue\localcolortrue\green - \ruledhbox{\box\scratchbox}}% + \setbox\scratchbox\hbox{\green\ruledhbox{\box\scratchbox}}% \fi \box\scratchbox \endgraf @@ -240,8 +237,7 @@ {\forgetall \crazymathindent \iftracegridsnapping - \setbox\scratchbox\hbox - {\incolortrue\localcolortrue\color[blue]{\ruledhbox{\box\scratchbox}}}% + \setbox\scratchbox\hbox{\blue\ruledhbox{\box\scratchbox}}% \fi \box\scratchbox \endgraf diff --git a/tex/context/base/math-lbr.mkii b/tex/context/base/math-lbr.mkii new file mode 100644 index 000000000..7ac7c3aff --- /dev/null +++ b/tex/context/base/math-lbr.mkii @@ -0,0 +1,450 @@ +%D \module +%D [ file=math-lbr, +%D version=2001.04.12, +%D title=\CONTEXT\ Math Macros, +%D subtitle=Lucida Specials, +%D author={Hans Hagen \& Taco Hoekwater}, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\definefamilysynonym [lbr] [calligrapahy] [sy] +\definefamilysynonym [lbr] [oldstyle] [mi] + +\definefamilysynonym [lbr] [blackboard] [ma] +\definefamilysynonym [lbr] [ucgreek] [mb] +\definefamilysynonym [lbr] [vargreek] [mi] + +\startmathcollection[lbr] + +\definemathsymbol [boxdot] [bin] [sy] ["ED] +\definemathsymbol [boxplus] [bin] [sy] ["EA] +\definemathsymbol [boxtimes] [bin] [sy] ["EC] +\definemathsymbol [square] [ord] [ma] ["02] +\definemathsymbol [Box] [ord] [ma] ["02] % square +\definemathsymbol [blacksquare] [ord] [ma] ["03] +\definemathsymbol [centerdot] [bin] [ma] ["E1] % [sy] ["01] +\definemathsymbol [Diamond] [ord] [sy] ["05] +\definemathsymbol [lozenge] [ord] [sy] ["05] % Diamond +\definemathsymbol [blacklozenge] [ord] [ma] ["09] +\definemathsymbol [circlearrowright] [rel] [ma] ["8C] +\definemathsymbol [circlearrowleft] [rel] [ma] ["8B] +\definemathsymbol [rightleftharpoons] [rel] [sy] ["8E] +\definemathsymbol [leftrightharpoons] [rel] [sy] ["8D] +\definemathsymbol [boxminus] [bin] [sy] ["EB] +\definemathsymbol [Vdash] [rel] [sy] ["F0] +\definemathsymbol [Vvdash] [rel] [mb] ["D3] +\definemathsymbol [vDash] [rel] [mb] ["D6] +\definemathsymbol [twoheadrightarrow] [rel] [ma] ["25] +\definemathsymbol [twoheadleftarrow] [rel] [ma] ["23] +\definemathsymbol [leftleftarrows] [rel] [ma] ["71] +\definemathsymbol [rightrightarrows] [rel] [ma] ["73] +\definemathsymbol [upuparrows] [rel] [ma] ["72] +\definemathsymbol [downdownarrows] [rel] [ma] ["74] +\definemathsymbol [upharpoonright] [rel] [ma] ["75] +\definemathsymbol [restriction] [rel] [ma] ["77] +\definemathsymbol [downharpoonright] [rel] [ma] ["77] +\definemathsymbol [upharpoonleft] [rel] [ma] ["76] +\definemathsymbol [downharpoonleft] [rel] [ma] ["78] +\definemathsymbol [rightarrowtail] [rel] [ma] ["29] +\definemathsymbol [leftarrowtail] [rel] [ma] ["28] +\definemathsymbol [leftrightarrows] [rel] [ma] ["6E] +\definemathsymbol [rightleftarrows] [rel] [ma] ["6D] +\definemathsymbol [Lsh] [rel] [ma] ["7B] +\definemathsymbol [Rsh] [rel] [ma] ["7D] +\definemathsymbol [rightsquigarrow] [rel] [ma] ["8E] +\definemathsymbol [leadsto] [rel] [ma] ["8E] % rightsquigarrow +\definemathsymbol [leftrightsquigarrow] [rel] [ma] ["91] +\definemathsymbol [looparrowleft] [rel] [ma] ["3F] +\definemathsymbol [looparrowright] [rel] [ma] ["40] +\definemathsymbol [circeq] [rel] [sy] ["D0] +\definemathsymbol [succsim] [rel] [sy] ["E1] +\definemathsymbol [gtrsim] [rel] [sy] ["DD] +\definemathsymbol [gtrapprox] [rel] [mb] ["DB] +\definemathsymbol [multimap] [rel] [mb] ["C7] +\definemathsymbol [therefore] [rel] [sy] ["90] +\definemathsymbol [because] [rel] [sy] ["91] +\definemathsymbol [doteqdot] [rel] [sy] ["CA] +\definemathsymbol [Doteq] [rel] [sy] ["CA] % doteqdot +\definemathsymbol [triangleq] [rel] [sy] ["D5] +\definemathsymbol [precsim] [rel] [sy] ["E0] +\definemathsymbol [lesssim] [rel] [sy] ["DC] +\definemathsymbol [lessapprox] [rel] [mb] ["DA] +\definemathsymbol [eqslantless] [rel] [mb] ["E2] +\definemathsymbol [eqslantgtr] [rel] [mb] ["E3] +\definemathsymbol [curlyeqprec] [rel] [mb] ["E6] +\definemathsymbol [curlyeqsucc] [rel] [mb] ["E7] +\definemathsymbol [preccurlyeq] [rel] [mb] ["E4] +\definemathsymbol [leqq] [rel] [sy] ["DA] +\definemathsymbol [leqslant] [rel] [mb] ["E0] +\definemathsymbol [lessgtr] [rel] [sy] ["DE] +\definemathsymbol [backprime] [ord] [mb] ["C8] +\definemathsymbol [dabar@] [ord] [ma] ["03] % !! @ +\definemathsymbol [risingdotseq] [rel] [sy] ["CC] +\definemathsymbol [fallingdotseq] [rel] [sy] ["CB] +\definemathsymbol [succcurlyeq] [rel] [mb] ["E5] +\definemathsymbol [geqq] [rel] [sy] ["DB] +\definemathsymbol [geqslant] [rel] [mb] ["E1] +\definemathsymbol [gtrless] [rel] [sy] ["DF] +\definemathsymbol [sqsubset] [rel] [sy] ["E4] +\definemathsymbol [sqsupset] [rel] [sy] ["E5] +\definemathsymbol [vartriangleright] [rel] [mb] ["2E] +\definemathsymbol [rhd] [bin] [mb] ["2E] +\definemathsymbol [lhd] [bin] [mb] ["2F] +\definemathsymbol [vartriangleleft] [rel] [mb] ["2F] +\definemathsymbol [trianglerighteq] [rel] [sy] ["F5] +\definemathsymbol [unrhd] [bin] [sy] ["F5] % trianglerighteq +\definemathsymbol [trianglelefteq] [rel] [sy] ["F4] +\definemathsymbol [unlhd] [bin] [sy] ["F4] % trianglelefteq +\definemathsymbol [bigstar] [ord] [ma] ["AB] +\definemathsymbol [between] [rel] [mb] ["F2] +\definemathsymbol [blacktriangledown] [ord] [ma] ["07] +\definemathsymbol [blacktriangleright] [rel] [mb] ["F1] +\definemathsymbol [blacktriangleleft] [rel] [mb] ["F0] +\definemathsymbol [vartriangle] [rel] [ma] ["04] +\definemathsymbol [triangleup] [ord] [ma] ["04] % vartriangle +\definemathsymbol [blacktriangle] [ord] [ma] ["05] +\definemathsymbol [triangledown] [ord] [ma] ["06] +\definemathsymbol [eqcirc] [rel] [sy] ["CF] +\definemathsymbol [lesseqgtr] [rel] [mb] ["E8] +\definemathsymbol [gtreqless] [rel] [mb] ["E9] +\definemathsymbol [lesseqqgtr] [rel] [mb] ["EA] +\definemathsymbol [gtreqqless] [rel] [mb] ["EB] +\definemathsymbol [Rrightarrow] [rel] [ma] ["6C] +\definemathsymbol [Lleftarrow] [rel] [ma] ["6A] +\definemathsymbol [veebar] [bin] [mb] ["D2] +\definemathsymbol [barwedge] [bin] [sy] ["F6] +\definemathsymbol [doublebarwedge] [bin] [sy] ["D4] +\definemathsymbol [angle] [ord] [sy] ["8B] +\definemathsymbol [measuredangle] [ord] [sy] ["8C] +\definemathsymbol [sphericalangle] [ord] [sy] ["8D] +\definemathsymbol [varpropto] [rel] [sy] ["2F] +\definemathsymbol [smallsmile] [rel] [mb] ["5E] +\definemathsymbol [smallfrown] [rel] [mb] ["5F] +\definemathsymbol [Subset] [rel] [sy] ["F8] +\definemathsymbol [Supset] [rel] [sy] ["F9] +\definemathsymbol [Cup] [bin] [sy] ["FA] +\definemathsymbol [doublecup] [bin] [sy] ["FA] % Cup +\definemathsymbol [Cap] [bin] [sy] ["FB] +\definemathsymbol [doublecap] [bin] [sy] ["FB] +\definemathsymbol [curlywedge] [bin] [sy] ["84] +\definemathsymbol [curlyvee] [bin] [sy] ["85] +\definemathsymbol [leftthreetimes] [bin] [mb] ["D0] +\definemathsymbol [rightthreetimes] [bin] [mb] ["D1] +\definemathsymbol [subseteqq] [rel] [mb] ["EE] +\definemathsymbol [supseteqq] [rel] [mb] ["EF] +\definemathsymbol [bumpeq] [rel] [sy] ["C8] +\definemathsymbol [Bumpeq] [rel] [sy] ["C7] +\definemathsymbol [llless] [rel] [mb] ["DE] +\definemathsymbol [lll] [rel] [mb] ["DE] % llless +\definemathsymbol [gggtr] [rel] [mb] ["DF] +\definemathsymbol [ggg] [rel] [mb] ["DF] % gggtr +\definemathsymbol [ulcorner] [open] [ma] ["5B] [ma] ["5B] +\definemathsymbol [urcorner] [close] [ma] ["5C] [ma] ["5C] +\definemathsymbol [circledS] [ord] [mb] ["CA] +\definemathsymbol [pitchfork] [rel] [ma] ["F3] +\definemathsymbol [dotplus] [bin] [sy] ["89] +\definemathsymbol [backsim] [rel] [sy] ["24] +\definemathsymbol [backsimeq] [rel] [sy] ["27] +\definemathsymbol [llcorner] [open] [ma] ["5D] [ma] ["5D] +\definemathsymbol [lrcorner] [close] [ma] ["5E] [ma] ["5E] +\definemathsymbol [complement] [ord] [mb] ["94] +\definemathsymbol [intercal] [bin] [ma] ["03] % !! +\definemathsymbol [circledcirc] [bin] [sy] ["E6] +\definemathsymbol [circledast] [bin] [sy] ["E7] +\definemathsymbol [circleddash] [bin] [mb] ["CC] + +\stopmathcollection + +\startmathcollection [lbr] + +\definemathsymbol [lvertneqq] [rel] [ma] ["DE] +\definemathsymbol [gvertneqq] [rel] [ma] ["DE] +\definemathsymbol [nleq] [rel] [ma] ["9C] +\definemathsymbol [ngeq] [rel] [ma] ["9D] +\definemathsymbol [nless] [rel] [ma] ["9A] +\definemathsymbol [ngtr] [rel] [ma] ["9B] +\definemathsymbol [nprec] [rel] [ma] ["E5] +\definemathsymbol [nsucc] [rel] [ma] ["E6] +\definemathsymbol [lneqq] [rel] [ma] ["DC] +\definemathsymbol [gneqq] [rel] [ma] ["DE] +\definemathsymbol [nleqslant] [rel] [ma] ["D6] +\definemathsymbol [ngeqslant] [rel] [ma] ["D7] +\definemathsymbol [lneq] [rel] [ma] ["DA] +\definemathsymbol [gneq] [rel] [ma] ["DB] +\definemathsymbol [npreceq] [rel] [ma] ["E7] +\definemathsymbol [nsucceq] [rel] [ma] ["E8] +\definemathsymbol [precnsim] [rel] [ma] ["EB] +\definemathsymbol [succnsim] [rel] [ma] ["EC] +\definemathsymbol [lnsim] [rel] [ma] ["E0] +\definemathsymbol [gnsim] [rel] [ma] ["E2] +\definemathsymbol [nleqq] [rel] [ma] ["D8] +\definemathsymbol [ngeqq] [rel] [ma] ["D9] +\definemathsymbol [precneqq] [rel] [ma] ["E9] +\definemathsymbol [succneqq] [rel] [ma] ["EA] +\definemathsymbol [precnapprox] [rel] [ma] ["ED] +\definemathsymbol [succnapprox] [rel] [ma] ["EE] +\definemathsymbol [lnapprox] [rel] [ma] ["E4] +\definemathsymbol [gnapprox] [rel] [ma] ["E3] +\definemathsymbol [nsim] [rel] [ma] ["96] +\definemathsymbol [ncong] [rel] [ma] ["99] +\definemathsymbol [diagup] [ord] [mb] ["CD] +\definemathsymbol [diagdown] [ord] [mb] ["D8] +\definemathsymbol [varsubsetneq] [rel] [ma] ["D0] +\definemathsymbol [varsupsetneq] [rel] [ma] ["D1] +\definemathsymbol [nsubseteqq] [rel] [ma] ["CA] +\definemathsymbol [nsupseteqq] [rel] [ma] ["CB] +\definemathsymbol [subsetneqq] [rel] [ma] ["CE] +\definemathsymbol [supsetneqq] [rel] [ma] ["CF] +\definemathsymbol [varsubsetneqq] [rel] [ma] ["D2] +\definemathsymbol [varsupsetneqq] [rel] [ma] ["D3] +\definemathsymbol [subsetneq] [rel] [ma] ["CC] +\definemathsymbol [supsetneq] [rel] [ma] ["CD] +\definemathsymbol [nsubseteq] [rel] [ma] ["C8] +\definemathsymbol [nsupseteq] [rel] [ma] ["C9] +\definemathsymbol [nparallel] [rel] [ma] ["F7] +\definemathsymbol [nmid] [rel] [ma] ["F6] +\definemathsymbol [nshortmid] [rel] [ma] ["F4] +\definemathsymbol [nshortparallel] [rel] [ma] ["F5] +\definemathsymbol [nvdash] [rel] [ma] ["F8] +\definemathsymbol [nVdash] [rel] [ma] ["F9] +\definemathsymbol [nvDash] [rel] [ma] ["FA] +\definemathsymbol [nVDash] [rel] [ma] ["FB] +\definemathsymbol [ntrianglerighteq] [rel] [ma] ["F2] +\definemathsymbol [ntrianglelefteq] [rel] [ma] ["F1] +\definemathsymbol [ntriangleleft] [rel] [ma] ["EF] +\definemathsymbol [ntriangleright] [rel] [ma] ["F0] +\definemathsymbol [nleftarrow] [rel] [ma] ["32] +\definemathsymbol [nrightarrow] [rel] [ma] ["33] +\definemathsymbol [nLeftarrow] [rel] [ma] ["66] +\definemathsymbol [nRightarrow] [rel] [ma] ["68] +\definemathsymbol [nLeftrightarrow] [rel] [ma] ["67] +\definemathsymbol [nleftrightarrow] [rel] [ma] ["34] +\definemathsymbol [divideontimes] [bin] [mb] ["F7] +\definemathsymbol [varnothing] [ord] [sy] ["53] +\definemathsymbol [nexists] [ord] [ma] ["20] +\definemathsymbol [Finv] [ord] [mb] ["90] +\definemathsymbol [Game] [ord] [mb] ["91] +\definemathsymbol [mho] [ord] [mb] ["92] +\definemathsymbol [eth] [ord] [ma] ["03] % !! +\definemathsymbol [eqsim] [rel] [sy] ["99] +\definemathsymbol [beth] [ord] [mb] ["95] +\definemathsymbol [gimel] [ord] [mb] ["96] +\definemathsymbol [daleth] [ord] [mb] ["97] +\definemathsymbol [lessdot] [bin] [mb] ["DC] +\definemathsymbol [gtrdot] [bin] [mb] ["DD] +\definemathsymbol [ltimes] [bin] [mb] ["CF] +\definemathsymbol [rtimes] [bin] [mb] ["CE] +\definemathsymbol [shortmid] [rel] [mb] ["F4] +\definemathsymbol [shortparallel] [rel] [mb] ["F5] +\definemathsymbol [smallsetminus] [bin] [mb] ["D8] +\definemathsymbol [thicksim] [rel] [sy] ["18] % not that thick +\definemathsymbol [thickapprox] [rel] [sy] ["19] % not that thick +\definemathsymbol [approxeq] [rel] [sy] ["9D] +\definemathsymbol [succapprox] [rel] [mb] ["ED] +\definemathsymbol [precapprox] [rel] [mb] ["EC] +\definemathsymbol [curvearrowleft] [rel] [ma] ["87] +\definemathsymbol [curvearrowright] [rel] [ma] ["88] +\definemathsymbol [digamma] [ord] [ma] ["03] % !! +\definemathsymbol [varkappa] [ord] [mb] ["9B] +\definemathsymbol [Bbbk] [ord] [ma] ["6B] +\definemathsymbol [hslash] [ord] [mb] ["9D] +\definemathsymbol [hbar] [ord] [ma] ["1B] +\definemathsymbol [backepsilon] [rel] [ma] ["03] % !! + +\stopmathcollection + +\startmathcollection [lbr] + +\definemathsymbol [yen] [nothing] [ma] ["03] % !! +\definemathsymbol [checkmark] [nothing] [ma] ["AC] +\definemathsymbol [circledR] [nothing] [mb] ["C9] +\definemathsymbol [maltese] [nothing] [mb] ["CB] + +\stopmathcollection + +\startmathcollection [lbr] + +\definemathsymbol [dashrightarrow] [rel] [ma] ["3A] +\definemathsymbol [dashleftarrow] [rel] [ma] ["38] +\definemathcommand [dasharrow] [rel] {\dashleftarrow\mkern-15.8mu\dashrightarrow} +%definemathcommand [Join] [rel] {\mathchar"0D6F\mkern-15.8mu\mathchar"0D6E} % !! + +\stopmathcollection + +\startmathcollection[lbr] + +\definemathcharacter [91] [open] [mi] ["86] +\definemathcharacter [93] [close] [mi] ["87] +\definemathcharacter [(] [open] [mi] ["84] +\definemathcharacter [)] [close] [mi] ["85] +\definemathcharacter [/] [nothing] [mi] ["3D] +\definemathcharacter [=] [rel] [sy] ["83] +\definemathcharacter [+] [bin] [sy] ["82] + +\definemathcharacter [91] [nothing] [mi] ["86] [ex] ["02] +\definemathcharacter [93] [nothing] [mi] ["87] [ex] ["03] +\definemathcharacter [(] [nothing] [mi] ["84] [ex] ["00] +\definemathcharacter [)] [nothing] [mi] ["85] [ex] ["01] +\definemathcharacter [/] [nothing] [mi] ["3D] [ex] ["0E] + +\stopmathcollection + +% \startmathcollection[lbr] +% +% \definemathcharacter [:] [punct] [tf] ["3A] % unbelievable +% \definemathcharacter [;] [punct] [tf] ["3B] % unbelievable +% +% \stopmathcollection + +\startmathcollection[lbr] + +\definemathsymbol [ldbrack] [open] [mi] ["82] [ex] ["82] +\definemathsymbol [rdbrack] [close] [mi] ["83] [ex] ["83] +\definemathsymbol [surfintop] [op] [ex] ["90] +\definemathsymbol [midintop] [op] [ex] ["92] +\definemathsymbol [midointop] [op] [ex] ["93] +\definemathsymbol [midsurfintop] [op] [ex] ["94] +\definemathsymbol [largeint] [op] [ex] ["5A] [ex] ["95] + +% \definemathcommand [surfint] [nolop] {\surfintop} +% \definemathcommand [midint] [nolop] {\midintop} +% \definemathcommand [midoint] [nolop] {\midointop} +% \definemathcommand [midsurfint] [nolop] {\midsurfintop} + +\definemathsymbol [surfint] [nolop] [ex] ["90] +\definemathsymbol [midint] [nolop] [ex] ["92] +\definemathsymbol [midoint] [nolop] [ex] ["93] +\definemathsymbol [midsurfint] [nolop] [ex] ["94] + +\definemathsymbol [dblint] [ord] [mi] ["88] +\definemathsymbol [trplint] [ord] [mi] ["89] +\definemathsymbol [contint] [ord] [mi] ["8A] +\definemathsymbol [surfint] [ord] [mi] ["8B] +\definemathsymbol [volint] [ord] [mi] ["8C] +\definemathsymbol [clwint] [ord] [mi] ["8D] +\definemathsymbol [cclwcint] [ord] [mi] ["8E] +\definemathsymbol [clwcint] [ord] [mi] ["8F] +\definemathsymbol [bowtie] [rel] [mi] ["F6] +\definemathsymbol [models] [rel] [sy] ["EE] +\definemathsymbol [doteq] [rel] [sy] ["C9] +\definemathsymbol [cong] [rel] [sy] ["9B] +\definemathsymbol [hbar] [ord] [mi] ["9D] +\definemathsymbol [neq] [rel] [ma] ["94] +\definemathsymbol [rightleftharpoons] [rel] [ma] ["7A] +\definemathsymbol [leftrightharpoons] [rel] [ma] ["79] +\definemathsymbol [hookleftarrow] [rel] [ma] ["3C] +\definemathsymbol [hookrightarrow] [rel] [ma] ["3E] +\definemathsymbol [mapsto] [rel] [ma] ["2C] + +\definemathcommand [longmapsto] {\mapstochar\longrightarrow} + +\stopmathcollection + +\startmathcollection[lbr] + +\definemathsymbol [Gamma] [alpha] [ucgreek] ["00] +\definemathsymbol [Delta] [alpha] [ucgreek] ["01] +\definemathsymbol [Theta] [alpha] [ucgreek] ["02] +\definemathsymbol [Lambda] [alpha] [ucgreek] ["03] +\definemathsymbol [Xi] [alpha] [ucgreek] ["04] +\definemathsymbol [Pi] [alpha] [ucgreek] ["05] +\definemathsymbol [Sigma] [alpha] [ucgreek] ["06] +\definemathsymbol [Upsilon] [alpha] [ucgreek] ["07] +\definemathsymbol [Phi] [alpha] [ucgreek] ["08] +\definemathsymbol [Psi] [alpha] [ucgreek] ["09] +\definemathsymbol [Omega] [alpha] [ucgreek] ["0A] + +\definemathsymbol [varGamma] [ord] [vargreek] ["00] +\definemathsymbol [varDelta] [ord] [vargreek] ["01] +\definemathsymbol [varTheta] [ord] [vargreek] ["02] +\definemathsymbol [varLambda] [ord] [vargreek] ["03] +\definemathsymbol [varXi] [ord] [vargreek] ["04] +\definemathsymbol [varPi] [ord] [vargreek] ["05] +\definemathsymbol [varSigma] [ord] [vargreek] ["06] +\definemathsymbol [varUpsilon] [ord] [vargreek] ["07] +\definemathsymbol [varPhi] [ord] [vargreek] ["08] +\definemathsymbol [varPsi] [ord] [vargreek] ["09] +\definemathsymbol [varOmega] [ord] [vargreek] ["0A] + +\stopmathcollection + +% we define the whole lot, although only a few differ (esp dot) + +\startmathcollection[lbr] + +\definemathsymbol [acute] [accent] [tf] ["13] % mr -> tf +\definemathsymbol [grave] [accent] [tf] ["12] % mr -> tf +\definemathsymbol [ddot] [accent] [tf] ["7F] % mr -> tf +\definemathsymbol [tilde] [accent] [tf] ["7E] % mr -> tf +\definemathsymbol [bar] [accent] [tf] ["16] % mr -> tf +\definemathsymbol [breve] [accent] [tf] ["15] % mr -> tf +\definemathsymbol [check] [accent] [tf] ["14] % mr -> tf +\definemathsymbol [hat] [accent] [tf] ["5E] % mr -> tf +\definemathsymbol [vec] [accent] [mi] ["7E] % [ord] +\definemathsymbol [dot] [accent] [tf] ["05] % mr -> tf, 5F -> 05 +\definemathsymbol [widetilde] [accent] [ex] ["65] % [ord] +\definemathsymbol [widehat] [accent] [ex] ["62] % [ord] + +\stopmathcollection + +\def\LBRroot#1#2% + {\setbox\zerocount\hbox{$\mathsurround\zeropoint#1\sqrt{#2}$} + \dimen@\ht\zerocount \advance\dimen@-\dp\zerocount + \mkern5mu\raise.6\dimen@\copy\rootbox \mkern-7.5mu \box\zerocount} + +\def\LBRmatrix#1% + {\null\,\vcenter{\normalbaselines\mathsurround\zeropoint + \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr + \mathstrut\crcr\noalign{\kern-0.9\baselineskip} + #1\crcr\mathstrut\crcr\noalign{\kern-0.9\baselineskip}}}\,} + +\startrawmathcollection[lbr] + +\definemathcommand [mathstrut] {\vphantom{f}} +\definemathcommand [joinrel] {\mathrel{\mkern-4mu}} +\definemathcommand [r@@t] {\LBRroot} +\definemathcommand [matrix] {\LBRmatrix} + +\stoprawmathcollection + +\def\LBRbig {\@@dobig{8.20}} +\def\LBRBig {\@@dobig{10.80}} +\def\LBRbigg {\@@dobig{13.42}} +\def\LBRBigg {\@@dobig{16.03}} +\def\LBRbiggg{\@@dobig{17.72}} +\def\LBRBiggg{\@@dobig{21.25}} + +% \def\LBRbig {\@@dobig{0.820}} +% \def\LBRBig {\@@dobig{1.080}} +% \def\LBRbigg {\@@dobig{1.342}} +% \def\LBRBigg {\@@dobig{1.603}} +% \def\LBRbiggg{\@@dobig{1.772}} +% \def\LBRBiggg{\@@dobig{2.125}} + +\startrawmathcollection[lbr] + +\definemathcommand [big] {\LBRbig} +\definemathcommand [Big] {\LBRBig} +\definemathcommand [bigg] {\LBRbigg} +\definemathcommand [Bigg] {\LBRBigg} +\definemathcommand [biggg] {\LBRbiggg} +\definemathcommand [Biggg] {\LBRBiggg} + +\stoprawmathcollection + +\startrawmathcollection[lbr] + +\definemathcommand [bigggl] [open] {\biggg} +\definemathcommand [bigggr] [close] {\biggg} +\definemathcommand [Bigggl] [open] {\Biggg} +\definemathcommand [Bigggr] [close] {\Biggg} + +\stoprawmathcollection + +\protect \endinput diff --git a/tex/context/base/math-lbr.tex b/tex/context/base/math-lbr.tex deleted file mode 100644 index 7ac7c3aff..000000000 --- a/tex/context/base/math-lbr.tex +++ /dev/null @@ -1,450 +0,0 @@ -%D \module -%D [ file=math-lbr, -%D version=2001.04.12, -%D title=\CONTEXT\ Math Macros, -%D subtitle=Lucida Specials, -%D author={Hans Hagen \& Taco Hoekwater}, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\definefamilysynonym [lbr] [calligrapahy] [sy] -\definefamilysynonym [lbr] [oldstyle] [mi] - -\definefamilysynonym [lbr] [blackboard] [ma] -\definefamilysynonym [lbr] [ucgreek] [mb] -\definefamilysynonym [lbr] [vargreek] [mi] - -\startmathcollection[lbr] - -\definemathsymbol [boxdot] [bin] [sy] ["ED] -\definemathsymbol [boxplus] [bin] [sy] ["EA] -\definemathsymbol [boxtimes] [bin] [sy] ["EC] -\definemathsymbol [square] [ord] [ma] ["02] -\definemathsymbol [Box] [ord] [ma] ["02] % square -\definemathsymbol [blacksquare] [ord] [ma] ["03] -\definemathsymbol [centerdot] [bin] [ma] ["E1] % [sy] ["01] -\definemathsymbol [Diamond] [ord] [sy] ["05] -\definemathsymbol [lozenge] [ord] [sy] ["05] % Diamond -\definemathsymbol [blacklozenge] [ord] [ma] ["09] -\definemathsymbol [circlearrowright] [rel] [ma] ["8C] -\definemathsymbol [circlearrowleft] [rel] [ma] ["8B] -\definemathsymbol [rightleftharpoons] [rel] [sy] ["8E] -\definemathsymbol [leftrightharpoons] [rel] [sy] ["8D] -\definemathsymbol [boxminus] [bin] [sy] ["EB] -\definemathsymbol [Vdash] [rel] [sy] ["F0] -\definemathsymbol [Vvdash] [rel] [mb] ["D3] -\definemathsymbol [vDash] [rel] [mb] ["D6] -\definemathsymbol [twoheadrightarrow] [rel] [ma] ["25] -\definemathsymbol [twoheadleftarrow] [rel] [ma] ["23] -\definemathsymbol [leftleftarrows] [rel] [ma] ["71] -\definemathsymbol [rightrightarrows] [rel] [ma] ["73] -\definemathsymbol [upuparrows] [rel] [ma] ["72] -\definemathsymbol [downdownarrows] [rel] [ma] ["74] -\definemathsymbol [upharpoonright] [rel] [ma] ["75] -\definemathsymbol [restriction] [rel] [ma] ["77] -\definemathsymbol [downharpoonright] [rel] [ma] ["77] -\definemathsymbol [upharpoonleft] [rel] [ma] ["76] -\definemathsymbol [downharpoonleft] [rel] [ma] ["78] -\definemathsymbol [rightarrowtail] [rel] [ma] ["29] -\definemathsymbol [leftarrowtail] [rel] [ma] ["28] -\definemathsymbol [leftrightarrows] [rel] [ma] ["6E] -\definemathsymbol [rightleftarrows] [rel] [ma] ["6D] -\definemathsymbol [Lsh] [rel] [ma] ["7B] -\definemathsymbol [Rsh] [rel] [ma] ["7D] -\definemathsymbol [rightsquigarrow] [rel] [ma] ["8E] -\definemathsymbol [leadsto] [rel] [ma] ["8E] % rightsquigarrow -\definemathsymbol [leftrightsquigarrow] [rel] [ma] ["91] -\definemathsymbol [looparrowleft] [rel] [ma] ["3F] -\definemathsymbol [looparrowright] [rel] [ma] ["40] -\definemathsymbol [circeq] [rel] [sy] ["D0] -\definemathsymbol [succsim] [rel] [sy] ["E1] -\definemathsymbol [gtrsim] [rel] [sy] ["DD] -\definemathsymbol [gtrapprox] [rel] [mb] ["DB] -\definemathsymbol [multimap] [rel] [mb] ["C7] -\definemathsymbol [therefore] [rel] [sy] ["90] -\definemathsymbol [because] [rel] [sy] ["91] -\definemathsymbol [doteqdot] [rel] [sy] ["CA] -\definemathsymbol [Doteq] [rel] [sy] ["CA] % doteqdot -\definemathsymbol [triangleq] [rel] [sy] ["D5] -\definemathsymbol [precsim] [rel] [sy] ["E0] -\definemathsymbol [lesssim] [rel] [sy] ["DC] -\definemathsymbol [lessapprox] [rel] [mb] ["DA] -\definemathsymbol [eqslantless] [rel] [mb] ["E2] -\definemathsymbol [eqslantgtr] [rel] [mb] ["E3] -\definemathsymbol [curlyeqprec] [rel] [mb] ["E6] -\definemathsymbol [curlyeqsucc] [rel] [mb] ["E7] -\definemathsymbol [preccurlyeq] [rel] [mb] ["E4] -\definemathsymbol [leqq] [rel] [sy] ["DA] -\definemathsymbol [leqslant] [rel] [mb] ["E0] -\definemathsymbol [lessgtr] [rel] [sy] ["DE] -\definemathsymbol [backprime] [ord] [mb] ["C8] -\definemathsymbol [dabar@] [ord] [ma] ["03] % !! @ -\definemathsymbol [risingdotseq] [rel] [sy] ["CC] -\definemathsymbol [fallingdotseq] [rel] [sy] ["CB] -\definemathsymbol [succcurlyeq] [rel] [mb] ["E5] -\definemathsymbol [geqq] [rel] [sy] ["DB] -\definemathsymbol [geqslant] [rel] [mb] ["E1] -\definemathsymbol [gtrless] [rel] [sy] ["DF] -\definemathsymbol [sqsubset] [rel] [sy] ["E4] -\definemathsymbol [sqsupset] [rel] [sy] ["E5] -\definemathsymbol [vartriangleright] [rel] [mb] ["2E] -\definemathsymbol [rhd] [bin] [mb] ["2E] -\definemathsymbol [lhd] [bin] [mb] ["2F] -\definemathsymbol [vartriangleleft] [rel] [mb] ["2F] -\definemathsymbol [trianglerighteq] [rel] [sy] ["F5] -\definemathsymbol [unrhd] [bin] [sy] ["F5] % trianglerighteq -\definemathsymbol [trianglelefteq] [rel] [sy] ["F4] -\definemathsymbol [unlhd] [bin] [sy] ["F4] % trianglelefteq -\definemathsymbol [bigstar] [ord] [ma] ["AB] -\definemathsymbol [between] [rel] [mb] ["F2] -\definemathsymbol [blacktriangledown] [ord] [ma] ["07] -\definemathsymbol [blacktriangleright] [rel] [mb] ["F1] -\definemathsymbol [blacktriangleleft] [rel] [mb] ["F0] -\definemathsymbol [vartriangle] [rel] [ma] ["04] -\definemathsymbol [triangleup] [ord] [ma] ["04] % vartriangle -\definemathsymbol [blacktriangle] [ord] [ma] ["05] -\definemathsymbol [triangledown] [ord] [ma] ["06] -\definemathsymbol [eqcirc] [rel] [sy] ["CF] -\definemathsymbol [lesseqgtr] [rel] [mb] ["E8] -\definemathsymbol [gtreqless] [rel] [mb] ["E9] -\definemathsymbol [lesseqqgtr] [rel] [mb] ["EA] -\definemathsymbol [gtreqqless] [rel] [mb] ["EB] -\definemathsymbol [Rrightarrow] [rel] [ma] ["6C] -\definemathsymbol [Lleftarrow] [rel] [ma] ["6A] -\definemathsymbol [veebar] [bin] [mb] ["D2] -\definemathsymbol [barwedge] [bin] [sy] ["F6] -\definemathsymbol [doublebarwedge] [bin] [sy] ["D4] -\definemathsymbol [angle] [ord] [sy] ["8B] -\definemathsymbol [measuredangle] [ord] [sy] ["8C] -\definemathsymbol [sphericalangle] [ord] [sy] ["8D] -\definemathsymbol [varpropto] [rel] [sy] ["2F] -\definemathsymbol [smallsmile] [rel] [mb] ["5E] -\definemathsymbol [smallfrown] [rel] [mb] ["5F] -\definemathsymbol [Subset] [rel] [sy] ["F8] -\definemathsymbol [Supset] [rel] [sy] ["F9] -\definemathsymbol [Cup] [bin] [sy] ["FA] -\definemathsymbol [doublecup] [bin] [sy] ["FA] % Cup -\definemathsymbol [Cap] [bin] [sy] ["FB] -\definemathsymbol [doublecap] [bin] [sy] ["FB] -\definemathsymbol [curlywedge] [bin] [sy] ["84] -\definemathsymbol [curlyvee] [bin] [sy] ["85] -\definemathsymbol [leftthreetimes] [bin] [mb] ["D0] -\definemathsymbol [rightthreetimes] [bin] [mb] ["D1] -\definemathsymbol [subseteqq] [rel] [mb] ["EE] -\definemathsymbol [supseteqq] [rel] [mb] ["EF] -\definemathsymbol [bumpeq] [rel] [sy] ["C8] -\definemathsymbol [Bumpeq] [rel] [sy] ["C7] -\definemathsymbol [llless] [rel] [mb] ["DE] -\definemathsymbol [lll] [rel] [mb] ["DE] % llless -\definemathsymbol [gggtr] [rel] [mb] ["DF] -\definemathsymbol [ggg] [rel] [mb] ["DF] % gggtr -\definemathsymbol [ulcorner] [open] [ma] ["5B] [ma] ["5B] -\definemathsymbol [urcorner] [close] [ma] ["5C] [ma] ["5C] -\definemathsymbol [circledS] [ord] [mb] ["CA] -\definemathsymbol [pitchfork] [rel] [ma] ["F3] -\definemathsymbol [dotplus] [bin] [sy] ["89] -\definemathsymbol [backsim] [rel] [sy] ["24] -\definemathsymbol [backsimeq] [rel] [sy] ["27] -\definemathsymbol [llcorner] [open] [ma] ["5D] [ma] ["5D] -\definemathsymbol [lrcorner] [close] [ma] ["5E] [ma] ["5E] -\definemathsymbol [complement] [ord] [mb] ["94] -\definemathsymbol [intercal] [bin] [ma] ["03] % !! -\definemathsymbol [circledcirc] [bin] [sy] ["E6] -\definemathsymbol [circledast] [bin] [sy] ["E7] -\definemathsymbol [circleddash] [bin] [mb] ["CC] - -\stopmathcollection - -\startmathcollection [lbr] - -\definemathsymbol [lvertneqq] [rel] [ma] ["DE] -\definemathsymbol [gvertneqq] [rel] [ma] ["DE] -\definemathsymbol [nleq] [rel] [ma] ["9C] -\definemathsymbol [ngeq] [rel] [ma] ["9D] -\definemathsymbol [nless] [rel] [ma] ["9A] -\definemathsymbol [ngtr] [rel] [ma] ["9B] -\definemathsymbol [nprec] [rel] [ma] ["E5] -\definemathsymbol [nsucc] [rel] [ma] ["E6] -\definemathsymbol [lneqq] [rel] [ma] ["DC] -\definemathsymbol [gneqq] [rel] [ma] ["DE] -\definemathsymbol [nleqslant] [rel] [ma] ["D6] -\definemathsymbol [ngeqslant] [rel] [ma] ["D7] -\definemathsymbol [lneq] [rel] [ma] ["DA] -\definemathsymbol [gneq] [rel] [ma] ["DB] -\definemathsymbol [npreceq] [rel] [ma] ["E7] -\definemathsymbol [nsucceq] [rel] [ma] ["E8] -\definemathsymbol [precnsim] [rel] [ma] ["EB] -\definemathsymbol [succnsim] [rel] [ma] ["EC] -\definemathsymbol [lnsim] [rel] [ma] ["E0] -\definemathsymbol [gnsim] [rel] [ma] ["E2] -\definemathsymbol [nleqq] [rel] [ma] ["D8] -\definemathsymbol [ngeqq] [rel] [ma] ["D9] -\definemathsymbol [precneqq] [rel] [ma] ["E9] -\definemathsymbol [succneqq] [rel] [ma] ["EA] -\definemathsymbol [precnapprox] [rel] [ma] ["ED] -\definemathsymbol [succnapprox] [rel] [ma] ["EE] -\definemathsymbol [lnapprox] [rel] [ma] ["E4] -\definemathsymbol [gnapprox] [rel] [ma] ["E3] -\definemathsymbol [nsim] [rel] [ma] ["96] -\definemathsymbol [ncong] [rel] [ma] ["99] -\definemathsymbol [diagup] [ord] [mb] ["CD] -\definemathsymbol [diagdown] [ord] [mb] ["D8] -\definemathsymbol [varsubsetneq] [rel] [ma] ["D0] -\definemathsymbol [varsupsetneq] [rel] [ma] ["D1] -\definemathsymbol [nsubseteqq] [rel] [ma] ["CA] -\definemathsymbol [nsupseteqq] [rel] [ma] ["CB] -\definemathsymbol [subsetneqq] [rel] [ma] ["CE] -\definemathsymbol [supsetneqq] [rel] [ma] ["CF] -\definemathsymbol [varsubsetneqq] [rel] [ma] ["D2] -\definemathsymbol [varsupsetneqq] [rel] [ma] ["D3] -\definemathsymbol [subsetneq] [rel] [ma] ["CC] -\definemathsymbol [supsetneq] [rel] [ma] ["CD] -\definemathsymbol [nsubseteq] [rel] [ma] ["C8] -\definemathsymbol [nsupseteq] [rel] [ma] ["C9] -\definemathsymbol [nparallel] [rel] [ma] ["F7] -\definemathsymbol [nmid] [rel] [ma] ["F6] -\definemathsymbol [nshortmid] [rel] [ma] ["F4] -\definemathsymbol [nshortparallel] [rel] [ma] ["F5] -\definemathsymbol [nvdash] [rel] [ma] ["F8] -\definemathsymbol [nVdash] [rel] [ma] ["F9] -\definemathsymbol [nvDash] [rel] [ma] ["FA] -\definemathsymbol [nVDash] [rel] [ma] ["FB] -\definemathsymbol [ntrianglerighteq] [rel] [ma] ["F2] -\definemathsymbol [ntrianglelefteq] [rel] [ma] ["F1] -\definemathsymbol [ntriangleleft] [rel] [ma] ["EF] -\definemathsymbol [ntriangleright] [rel] [ma] ["F0] -\definemathsymbol [nleftarrow] [rel] [ma] ["32] -\definemathsymbol [nrightarrow] [rel] [ma] ["33] -\definemathsymbol [nLeftarrow] [rel] [ma] ["66] -\definemathsymbol [nRightarrow] [rel] [ma] ["68] -\definemathsymbol [nLeftrightarrow] [rel] [ma] ["67] -\definemathsymbol [nleftrightarrow] [rel] [ma] ["34] -\definemathsymbol [divideontimes] [bin] [mb] ["F7] -\definemathsymbol [varnothing] [ord] [sy] ["53] -\definemathsymbol [nexists] [ord] [ma] ["20] -\definemathsymbol [Finv] [ord] [mb] ["90] -\definemathsymbol [Game] [ord] [mb] ["91] -\definemathsymbol [mho] [ord] [mb] ["92] -\definemathsymbol [eth] [ord] [ma] ["03] % !! -\definemathsymbol [eqsim] [rel] [sy] ["99] -\definemathsymbol [beth] [ord] [mb] ["95] -\definemathsymbol [gimel] [ord] [mb] ["96] -\definemathsymbol [daleth] [ord] [mb] ["97] -\definemathsymbol [lessdot] [bin] [mb] ["DC] -\definemathsymbol [gtrdot] [bin] [mb] ["DD] -\definemathsymbol [ltimes] [bin] [mb] ["CF] -\definemathsymbol [rtimes] [bin] [mb] ["CE] -\definemathsymbol [shortmid] [rel] [mb] ["F4] -\definemathsymbol [shortparallel] [rel] [mb] ["F5] -\definemathsymbol [smallsetminus] [bin] [mb] ["D8] -\definemathsymbol [thicksim] [rel] [sy] ["18] % not that thick -\definemathsymbol [thickapprox] [rel] [sy] ["19] % not that thick -\definemathsymbol [approxeq] [rel] [sy] ["9D] -\definemathsymbol [succapprox] [rel] [mb] ["ED] -\definemathsymbol [precapprox] [rel] [mb] ["EC] -\definemathsymbol [curvearrowleft] [rel] [ma] ["87] -\definemathsymbol [curvearrowright] [rel] [ma] ["88] -\definemathsymbol [digamma] [ord] [ma] ["03] % !! -\definemathsymbol [varkappa] [ord] [mb] ["9B] -\definemathsymbol [Bbbk] [ord] [ma] ["6B] -\definemathsymbol [hslash] [ord] [mb] ["9D] -\definemathsymbol [hbar] [ord] [ma] ["1B] -\definemathsymbol [backepsilon] [rel] [ma] ["03] % !! - -\stopmathcollection - -\startmathcollection [lbr] - -\definemathsymbol [yen] [nothing] [ma] ["03] % !! -\definemathsymbol [checkmark] [nothing] [ma] ["AC] -\definemathsymbol [circledR] [nothing] [mb] ["C9] -\definemathsymbol [maltese] [nothing] [mb] ["CB] - -\stopmathcollection - -\startmathcollection [lbr] - -\definemathsymbol [dashrightarrow] [rel] [ma] ["3A] -\definemathsymbol [dashleftarrow] [rel] [ma] ["38] -\definemathcommand [dasharrow] [rel] {\dashleftarrow\mkern-15.8mu\dashrightarrow} -%definemathcommand [Join] [rel] {\mathchar"0D6F\mkern-15.8mu\mathchar"0D6E} % !! - -\stopmathcollection - -\startmathcollection[lbr] - -\definemathcharacter [91] [open] [mi] ["86] -\definemathcharacter [93] [close] [mi] ["87] -\definemathcharacter [(] [open] [mi] ["84] -\definemathcharacter [)] [close] [mi] ["85] -\definemathcharacter [/] [nothing] [mi] ["3D] -\definemathcharacter [=] [rel] [sy] ["83] -\definemathcharacter [+] [bin] [sy] ["82] - -\definemathcharacter [91] [nothing] [mi] ["86] [ex] ["02] -\definemathcharacter [93] [nothing] [mi] ["87] [ex] ["03] -\definemathcharacter [(] [nothing] [mi] ["84] [ex] ["00] -\definemathcharacter [)] [nothing] [mi] ["85] [ex] ["01] -\definemathcharacter [/] [nothing] [mi] ["3D] [ex] ["0E] - -\stopmathcollection - -% \startmathcollection[lbr] -% -% \definemathcharacter [:] [punct] [tf] ["3A] % unbelievable -% \definemathcharacter [;] [punct] [tf] ["3B] % unbelievable -% -% \stopmathcollection - -\startmathcollection[lbr] - -\definemathsymbol [ldbrack] [open] [mi] ["82] [ex] ["82] -\definemathsymbol [rdbrack] [close] [mi] ["83] [ex] ["83] -\definemathsymbol [surfintop] [op] [ex] ["90] -\definemathsymbol [midintop] [op] [ex] ["92] -\definemathsymbol [midointop] [op] [ex] ["93] -\definemathsymbol [midsurfintop] [op] [ex] ["94] -\definemathsymbol [largeint] [op] [ex] ["5A] [ex] ["95] - -% \definemathcommand [surfint] [nolop] {\surfintop} -% \definemathcommand [midint] [nolop] {\midintop} -% \definemathcommand [midoint] [nolop] {\midointop} -% \definemathcommand [midsurfint] [nolop] {\midsurfintop} - -\definemathsymbol [surfint] [nolop] [ex] ["90] -\definemathsymbol [midint] [nolop] [ex] ["92] -\definemathsymbol [midoint] [nolop] [ex] ["93] -\definemathsymbol [midsurfint] [nolop] [ex] ["94] - -\definemathsymbol [dblint] [ord] [mi] ["88] -\definemathsymbol [trplint] [ord] [mi] ["89] -\definemathsymbol [contint] [ord] [mi] ["8A] -\definemathsymbol [surfint] [ord] [mi] ["8B] -\definemathsymbol [volint] [ord] [mi] ["8C] -\definemathsymbol [clwint] [ord] [mi] ["8D] -\definemathsymbol [cclwcint] [ord] [mi] ["8E] -\definemathsymbol [clwcint] [ord] [mi] ["8F] -\definemathsymbol [bowtie] [rel] [mi] ["F6] -\definemathsymbol [models] [rel] [sy] ["EE] -\definemathsymbol [doteq] [rel] [sy] ["C9] -\definemathsymbol [cong] [rel] [sy] ["9B] -\definemathsymbol [hbar] [ord] [mi] ["9D] -\definemathsymbol [neq] [rel] [ma] ["94] -\definemathsymbol [rightleftharpoons] [rel] [ma] ["7A] -\definemathsymbol [leftrightharpoons] [rel] [ma] ["79] -\definemathsymbol [hookleftarrow] [rel] [ma] ["3C] -\definemathsymbol [hookrightarrow] [rel] [ma] ["3E] -\definemathsymbol [mapsto] [rel] [ma] ["2C] - -\definemathcommand [longmapsto] {\mapstochar\longrightarrow} - -\stopmathcollection - -\startmathcollection[lbr] - -\definemathsymbol [Gamma] [alpha] [ucgreek] ["00] -\definemathsymbol [Delta] [alpha] [ucgreek] ["01] -\definemathsymbol [Theta] [alpha] [ucgreek] ["02] -\definemathsymbol [Lambda] [alpha] [ucgreek] ["03] -\definemathsymbol [Xi] [alpha] [ucgreek] ["04] -\definemathsymbol [Pi] [alpha] [ucgreek] ["05] -\definemathsymbol [Sigma] [alpha] [ucgreek] ["06] -\definemathsymbol [Upsilon] [alpha] [ucgreek] ["07] -\definemathsymbol [Phi] [alpha] [ucgreek] ["08] -\definemathsymbol [Psi] [alpha] [ucgreek] ["09] -\definemathsymbol [Omega] [alpha] [ucgreek] ["0A] - -\definemathsymbol [varGamma] [ord] [vargreek] ["00] -\definemathsymbol [varDelta] [ord] [vargreek] ["01] -\definemathsymbol [varTheta] [ord] [vargreek] ["02] -\definemathsymbol [varLambda] [ord] [vargreek] ["03] -\definemathsymbol [varXi] [ord] [vargreek] ["04] -\definemathsymbol [varPi] [ord] [vargreek] ["05] -\definemathsymbol [varSigma] [ord] [vargreek] ["06] -\definemathsymbol [varUpsilon] [ord] [vargreek] ["07] -\definemathsymbol [varPhi] [ord] [vargreek] ["08] -\definemathsymbol [varPsi] [ord] [vargreek] ["09] -\definemathsymbol [varOmega] [ord] [vargreek] ["0A] - -\stopmathcollection - -% we define the whole lot, although only a few differ (esp dot) - -\startmathcollection[lbr] - -\definemathsymbol [acute] [accent] [tf] ["13] % mr -> tf -\definemathsymbol [grave] [accent] [tf] ["12] % mr -> tf -\definemathsymbol [ddot] [accent] [tf] ["7F] % mr -> tf -\definemathsymbol [tilde] [accent] [tf] ["7E] % mr -> tf -\definemathsymbol [bar] [accent] [tf] ["16] % mr -> tf -\definemathsymbol [breve] [accent] [tf] ["15] % mr -> tf -\definemathsymbol [check] [accent] [tf] ["14] % mr -> tf -\definemathsymbol [hat] [accent] [tf] ["5E] % mr -> tf -\definemathsymbol [vec] [accent] [mi] ["7E] % [ord] -\definemathsymbol [dot] [accent] [tf] ["05] % mr -> tf, 5F -> 05 -\definemathsymbol [widetilde] [accent] [ex] ["65] % [ord] -\definemathsymbol [widehat] [accent] [ex] ["62] % [ord] - -\stopmathcollection - -\def\LBRroot#1#2% - {\setbox\zerocount\hbox{$\mathsurround\zeropoint#1\sqrt{#2}$} - \dimen@\ht\zerocount \advance\dimen@-\dp\zerocount - \mkern5mu\raise.6\dimen@\copy\rootbox \mkern-7.5mu \box\zerocount} - -\def\LBRmatrix#1% - {\null\,\vcenter{\normalbaselines\mathsurround\zeropoint - \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr - \mathstrut\crcr\noalign{\kern-0.9\baselineskip} - #1\crcr\mathstrut\crcr\noalign{\kern-0.9\baselineskip}}}\,} - -\startrawmathcollection[lbr] - -\definemathcommand [mathstrut] {\vphantom{f}} -\definemathcommand [joinrel] {\mathrel{\mkern-4mu}} -\definemathcommand [r@@t] {\LBRroot} -\definemathcommand [matrix] {\LBRmatrix} - -\stoprawmathcollection - -\def\LBRbig {\@@dobig{8.20}} -\def\LBRBig {\@@dobig{10.80}} -\def\LBRbigg {\@@dobig{13.42}} -\def\LBRBigg {\@@dobig{16.03}} -\def\LBRbiggg{\@@dobig{17.72}} -\def\LBRBiggg{\@@dobig{21.25}} - -% \def\LBRbig {\@@dobig{0.820}} -% \def\LBRBig {\@@dobig{1.080}} -% \def\LBRbigg {\@@dobig{1.342}} -% \def\LBRBigg {\@@dobig{1.603}} -% \def\LBRbiggg{\@@dobig{1.772}} -% \def\LBRBiggg{\@@dobig{2.125}} - -\startrawmathcollection[lbr] - -\definemathcommand [big] {\LBRbig} -\definemathcommand [Big] {\LBRBig} -\definemathcommand [bigg] {\LBRbigg} -\definemathcommand [Bigg] {\LBRBigg} -\definemathcommand [biggg] {\LBRbiggg} -\definemathcommand [Biggg] {\LBRBiggg} - -\stoprawmathcollection - -\startrawmathcollection[lbr] - -\definemathcommand [bigggl] [open] {\biggg} -\definemathcommand [bigggr] [close] {\biggg} -\definemathcommand [Bigggl] [open] {\Biggg} -\definemathcommand [Bigggr] [close] {\Biggg} - -\stoprawmathcollection - -\protect \endinput diff --git a/tex/context/base/math-noa.lua b/tex/context/base/math-noa.lua index bbbd5285e..7985834f2 100644 --- a/tex/context/base/math-noa.lua +++ b/tex/context/base/math-noa.lua @@ -192,7 +192,7 @@ noads.processors.relocate[math_delim] = function(pointer) end end -function noads.relocate_characters(head,tail,style,penalties) +function noads.relocate_characters(head,style,penalties) process(head,noads.processors.relocate) return true end @@ -227,7 +227,7 @@ noads.processors.resize[math_fence] = function(pointer) end end -function noads.resize_characters(head,tail,style,penalties) +function noads.resize_characters(head,style,penalties) process(head,noads.processors.resize) return true end @@ -290,14 +290,14 @@ noads.processors.respace[math_noad] = function(pointer) end -function noads.respace_characters(head,tail,style,penalties) +function noads.respace_characters(head,style,penalties) noads.process(head,noads.processors.respace) return true end -- the normal builder -function noads.mlist_to_hlist(head,tail,style,penalties) +function noads.mlist_to_hlist(head,style,penalties) return mlist_to_hlist(head,style,penalties), true end @@ -309,12 +309,7 @@ tasks.new ( } ) ---~ tasks.appendaction("math", "normalizers", "noads.relocate_characters", nil, "nohead") ---~ tasks.appendaction("math", "normalizers", "noads.resize_characters", nil, "nohead") ---~ tasks.appendaction("math", "normalizers", "noads.respace_characters", nil, "nohead") ---~ tasks.appendaction("math", "builders", "noads.mlist_to_hlist", nil, "notail") - -local actions = tasks.actions("math",2) -- head, tail, style, penalties +local actions = tasks.actions("math",2) -- head, style, penalties local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming diff --git a/tex/context/base/math-tex.mkii b/tex/context/base/math-tex.mkii new file mode 100644 index 000000000..c833db956 --- /dev/null +++ b/tex/context/base/math-tex.mkii @@ -0,0 +1,718 @@ +%D \module +%D [ file=math-tex, +%D version=2001.04.12, +%D subtitle=Plain Specials, +%D author={Hans Hagen, Taco Hoekwater \& Aditya Mahajan}, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% beware: in mkiv we will do it differently + +\unprotect + +\mathcode`\ ="8000 \mathcode`\_="8000 \mathcode`\'="8000 + +\definefamilysynonym [default] [calligraphic] [sy] +\definefamilysynonym [default] [oldstyle] [mi] +\definefamilysynonym [default] [blackboard] [mr] +\definefamilysynonym [default] [gothic] [mr] +\definefamilysynonym [default] [fraktur] [mr] + +\definefamilysynonym [default] [lcgreek] [mi] +\definefamilysynonym [default] [ucgreek] [mr] +\definefamilysynonym [default] [vargreek] [mi] + + +%D \macros +%D {\setupmathematics} +%D +%D Configuration for integrals. (If needed we can speed this up and make it +%D installable; no processaction is needed then). + +\chardef\intlimitcode\zerocount % 0 nolimits 1 displaylimits 2 limits + +\def\intlimits + {\ifcase\intlimitcode \nolimits \or \displaylimits \or \limits \fi} + +\def\setupmathematics + {\dosingleargument\dosetupmathematics} + +\def\dosetupmathematics[#1]% + {\getparameters[\??mo][#1] + \processaction[\@@mointegral] + [ nolimits=>\chardef\intlimitcode\zerocount, + displaylimits=>\chardef\intlimitcode\plusone, + limits=>\chardef\intlimitcode\plustwo]} + +%D \startbuffer +%D $\int_a^b f(x) dx$ and also +%D $\iint_a^b f(x,y) dxdy$, $\iiint_a^b f(x,y) dxdy$, +%D $\iiiint_a^b f(x) dx$ +%D \startformula +%D \int_a^b f(x) dx \quad +%D \iint_a^b f(x) dx \quad +%D \iiint_a^b f(x) dx \quad +%D \iiiint_a^b f(x) dx \quad +%D \stopformula +%D \stopbuffer +%D +%D Default: \getbuffer +%D +%D Displaylimits: \setupmathematics[integral=displaylimits] \getbuffer +%D +%D Limits: \setupmathematics[integral=limits] \getbuffer + +\startmathcollection [default] + +\definemathsymbol [alpha] [nothing] [lcgreek] ["0B] +\definemathsymbol [beta] [nothing] [lcgreek] ["0C] +\definemathsymbol [gamma] [nothing] [lcgreek] ["0D] +\definemathsymbol [delta] [nothing] [lcgreek] ["0E] +\definemathsymbol [epsilon] [nothing] [lcgreek] ["0F] +\definemathsymbol [zeta] [nothing] [lcgreek] ["10] +\definemathsymbol [eta] [nothing] [lcgreek] ["11] +\definemathsymbol [theta] [nothing] [lcgreek] ["12] +\definemathsymbol [iota] [nothing] [lcgreek] ["13] +\definemathsymbol [kappa] [nothing] [lcgreek] ["14] +\definemathsymbol [lambda] [nothing] [lcgreek] ["15] +\definemathsymbol [mu] [nothing] [lcgreek] ["16] +\definemathsymbol [nu] [nothing] [lcgreek] ["17] +\definemathsymbol [xi] [nothing] [lcgreek] ["18] +\definemathsymbol [omicron] [nothing] [lcgreek] ["6F] +\definemathsymbol [pi] [nothing] [lcgreek] ["19] +\definemathsymbol [rho] [nothing] [lcgreek] ["1A] +\definemathsymbol [sigma] [nothing] [lcgreek] ["1B] +\definemathsymbol [tau] [nothing] [lcgreek] ["1C] +\definemathsymbol [upsilon] [nothing] [lcgreek] ["1D] +\definemathsymbol [phi] [nothing] [lcgreek] ["1E] +\definemathsymbol [chi] [nothing] [lcgreek] ["1F] +\definemathsymbol [psi] [nothing] [lcgreek] ["20] +\definemathsymbol [omega] [nothing] [lcgreek] ["21] + +\stopmathcollection + +\startmathcollection [default] + +\definemathsymbol [varepsilon] [nothing] [vargreek] ["22] +\definemathsymbol [vartheta] [nothing] [vargreek] ["23] +\definemathsymbol [varpi] [nothing] [vargreek] ["24] +\definemathsymbol [varrho] [nothing] [vargreek] ["25] +\definemathsymbol [varsigma] [nothing] [vargreek] ["26] +\definemathsymbol [varphi] [nothing] [vargreek] ["27] + +\stopmathcollection + +\startmathcollection [default] + +\definemathsymbol [Alpha] [alpha] [ucgreek] ["41] % A +\definemathsymbol [Beta] [alpha] [ucgreek] ["42] % B +\definemathsymbol [Gamma] [alpha] [ucgreek] ["00] +\definemathsymbol [Delta] [alpha] [ucgreek] ["01] +\definemathsymbol [Epsilon] [alpha] [ucgreek] ["45] % E +\definemathsymbol [Zeta] [alpha] [ucgreek] ["5A] % Z +\definemathsymbol [Eta] [alpha] [ucgreek] ["48] % H +\definemathsymbol [Theta] [alpha] [ucgreek] ["02] +\definemathsymbol [Iota] [alpha] [ucgreek] ["49] % I +\definemathsymbol [Kappa] [alpha] [ucgreek] ["4B] % K +\definemathsymbol [Lambda] [alpha] [ucgreek] ["03] +\definemathsymbol [Mu] [alpha] [ucgreek] ["4D] % M +\definemathsymbol [Nu] [alpha] [ucgreek] ["4E] % N +\definemathsymbol [Xi] [alpha] [ucgreek] ["04] +\definemathsymbol [Omicron] [alpha] [ucgreek] ["4F] % O +\definemathsymbol [Pi] [alpha] [ucgreek] ["05] +\definemathsymbol [Rho] [alpha] [ucgreek] ["52] % R +\definemathsymbol [Sigma] [alpha] [ucgreek] ["06] +\definemathsymbol [Tau] [alpha] [ucgreek] ["54] % T +\definemathsymbol [Upsilon] [alpha] [ucgreek] ["07] +\definemathsymbol [Phi] [alpha] [ucgreek] ["08] +\definemathsymbol [Chi] [alpha] [ucgreek] ["58] % X +\definemathsymbol [Psi] [alpha] [ucgreek] ["09] +\definemathsymbol [Omega] [alpha] [ucgreek] ["0A] + +\stopmathcollection + +% The \mfunction macro is an alternative for \hbox with a +% controlable font switch. + +\startmathcollection[default] + +\definemathcommand [arccos] [nolop] {\mfunction{arccos}} +\definemathcommand [arcsin] [nolop] {\mfunction{arcsin}} +\definemathcommand [arctan] [nolop] {\mfunction{arctan}} +\definemathcommand [arg] [nolop] {\mfunction{arg}} +\definemathcommand [cosh] [nolop] {\mfunction{cosh}} +\definemathcommand [cos] [nolop] {\mfunction{cos}} +\definemathcommand [coth] [nolop] {\mfunction{coth}} +\definemathcommand [cot] [nolop] {\mfunction{cot}} +\definemathcommand [csc] [nolop] {\mfunction{csc}} +\definemathcommand [deg] [nolop] {\mfunction{deg}} +\definemathcommand [det] [limop] {\mfunction{det}} +\definemathcommand [dim] [nolop] {\mfunction{dim}} +\definemathcommand [exp] [nolop] {\mfunction{exp}} +\definemathcommand [gcd] [limop] {\mfunction{gcd}} +\definemathcommand [hom] [nolop] {\mfunction{hom}} +\definemathcommand [inf] [limop] {\mfunction{inf}} +\definemathcommand [injlim] [limop] {\mfunction{inj\,lim}} +\definemathcommand [ker] [nolop] {\mfunction{ker}} +\definemathcommand [lg] [nolop] {\mfunction{lg}} +\definemathcommand [liminf] [limop] {\mfunction{lim\,inf}} +\definemathcommand [limsup] [limop] {\mfunction{lim\,sup}} +\definemathcommand [lim] [limop] {\mfunction{lim}} +\definemathcommand [ln] [nolop] {\mfunction{ln}} +\definemathcommand [log] [nolop] {\mfunction{log}} +\definemathcommand [median] [limop] {\mfunction{median}} +\definemathcommand [max] [limop] {\mfunction{max}} +\definemathcommand [min] [limop] {\mfunction{min}} +\definemathcommand [mod] [limop] {\mfunction{mod}} +\definemathcommand [div] [limop] {\mfunction{div}} +\definemathcommand [projlim] [limop] {\mfunction{proj\,lim}} +\definemathcommand [Pr] [limop] {\mfunction{Pr}} +\definemathcommand [sec] [nolop] {\mfunction{sec}} +\definemathcommand [sinh] [nolop] {\mfunction{sinh}} +\definemathcommand [sin] [nolop] {\mfunction{sin}} +\definemathcommand [sup] [limop] {\mfunction{sup}} +\definemathcommand [tanh] [nolop] {\mfunction{tanh}} +\definemathcommand [tan] [nolop] {\mfunction{tan}} + +\stopmathcollection + +\startmathcollection[default] + +\definemathcommand [integers] {\mfunction{Z}} +\definemathcommand [reals] {\mfunction{R}} +\definemathcommand [rationals] {\mfunction{Q}} +\definemathcommand [naturalnumbers] {\mfunction{N}} +\definemathcommand [complexes] {\mfunction{C}} +\definemathcommand [primes] {\mfunction{P}} + +\stopmathcollection + +\startmathcollection[default] + +\definemathcharacter [!] [close] [mr] ["21] +\definemathcharacter [(] [open] [mr] ["28] +\definemathcharacter [)] [close] [mr] ["29] +\definemathcharacter [*] [bin] [sy] ["03] +\definemathcharacter [+] [bin] [mr] ["2B] +\definemathcharacter [,] [punct] [mi] ["3B] +\definemathcharacter [-] [bin] [sy] ["00] +\definemathcharacter [.] [ord] [mi] ["3A] +\definemathcharacter [/] [ord] [mi] ["3D] +\definemathcharacter [:] [rel] [mr] ["3A] +\definemathcharacter [;] [punct] [mr] ["3B] +\definemathcharacter [<] [rel] [mi] ["3C] +\definemathcharacter [=] [rel] [mr] ["3D] +\definemathcharacter [>] [rel] [mi] ["3E] +\definemathcharacter [?] [close] [mr] ["3F] +\definemathcharacter [91] [open] [mr] ["5B] % [ +\definemathcharacter [92] [ord] [sy] ["6E] % \ +\definemathcharacter [93] [close] [mr] ["5D] % ] +\definemathcharacter [123] [open] [sy] ["66] % { +\definemathcharacter [124] [ord] [sy] ["6A] % | +\definemathcharacter [125] [close] [sy] ["67] % } + +\stopmathcollection + +\startmathcollection[default] + +\definemathcharacter [(] [nothing] [mr] ["28] [ex] ["00] +\definemathcharacter [)] [nothing] [mr] ["29] [ex] ["01] +\definemathcharacter [91] [nothing] [mr] ["5B] [ex] ["02] % [ +\definemathcharacter [93] [nothing] [mr] ["5D] [ex] ["03] % ] +\definemathcharacter [<] [nothing] [sy] ["68] [ex] ["0A] +\definemathcharacter [>] [nothing] [sy] ["69] [ex] ["0B] +\definemathcharacter [/] [nothing] [mr] ["2F] [ex] ["0E] +\definemathcharacter [124] [nothing] [sy] ["6A] [ex] ["0C] % | +\definemathcharacter [92] [nothing] [sy] ["6E] [ex] ["0F] % \ + +\stopmathcollection + +\def\PLAINangle + {{\vbox{\ialign{$\mathsurround\zeropoint\scriptstyle##$\crcr + \not\mathrel{\mkern14mu}\crcr + \noalign{\nointerlineskip} + \mkern2.5mu\leaders\hrule height.34pt\hfill\mkern2.5mu\crcr}}}} + +\startmathcollection[default] + +\definemathsymbol [aleph] [nothing] [sy] ["40] +\definemathsymbol [imath] [nothing] [mi] ["7B] +\definemathsymbol [jmath] [nothing] [mi] ["7C] +\definemathsymbol [ell] [nothing] [mi] ["60] +\definemathsymbol [wp] [nothing] [mi] ["7D] +\definemathsymbol [Re] [nothing] [sy] ["3C] +\definemathsymbol [Im] [nothing] [sy] ["3D] +\definemathsymbol [partial] [nothing] [mi] ["40] +\definemathsymbol [infty] [nothing] [sy] ["31] +\definemathsymbol [prime] [nothing] [sy] ["30] +\definemathsymbol [emptyset] [nothing] [sy] ["3B] +\definemathsymbol [nabla] [nothing] [sy] ["72] +\definemathsymbol [top] [nothing] [sy] ["3E] +\definemathsymbol [bot] [nothing] [sy] ["3F] + +\definemathcommand [hbar] {{\mathchar'26\mkern-9muh}} +\definemathcommand [surd] {{\mathchar"1270}} % ? +\definemathcommand [angle] {\PLAINangle} + +\stopmathcollection + +\startmathcollection[default] + +\definemathsymbol [triangle] [ord] [sy] ["34] +\definemathsymbol [forall] [ord] [sy] ["38] +\definemathsymbol [exists] [ord] [sy] ["39] +\definemathsymbol [neg] [ord] [sy] ["3A] +\definemathsymbol [flat] [ord] [mi] ["5B] +\definemathsymbol [natural] [ord] [mi] ["5C] +\definemathsymbol [sharp] [ord] [mi] ["5D] +\definemathsymbol [clubsuit] [ord] [sy] ["7C] +\definemathsymbol [diamondsuit] [ord] [sy] ["7D] +\definemathsymbol [heartsuit] [ord] [sy] ["7E] +\definemathsymbol [spadesuit] [ord] [sy] ["7F] + +\stopmathcollection + +\startmathcollection[default] + +\definemathcommand [square] {\hbox{\hsmash{$\sqcup$}$\sqcap$}} + +\stopmathcollection + +\startmathcollection[default] + +\definemathsymbol [coprod] [op] [ex] ["60] +\definemathsymbol [bigvee] [op] [ex] ["57] +\definemathsymbol [bigwedge] [op] [ex] ["56] +\definemathsymbol [biguplus] [op] [ex] ["55] +\definemathsymbol [bigcap] [op] [ex] ["54] +\definemathsymbol [bigcup] [op] [ex] ["53] +\definemathsymbol [intop] [op] [ex] ["52] +\definemathsymbol [prod] [op] [ex] ["51] +\definemathsymbol [sum] [op] [ex] ["50] +\definemathsymbol [bigotimes] [op] [ex] ["4E] +\definemathsymbol [bigoplus] [op] [ex] ["4C] +\definemathsymbol [bigodot] [op] [ex] ["4A] +\definemathsymbol [ointop] [op] [ex] ["48] +\definemathsymbol [bigsqcup] [op] [ex] ["46] +\definemathsymbol [smallint] [op] [sy] ["73] + +\stopmathcollection + +\startmathcollection[default] + +\definemathsymbol [triangleleft] [bin] [mi] ["2F] +\definemathsymbol [triangleright] [bin] [mi] ["2E] +\definemathsymbol [bigtriangleup] [bin] [sy] ["34] +\definemathsymbol [bigtriangledown] [bin] [sy] ["35] +\definemathsymbol [wedge] [bin] [sy] ["5E] +\definemathsymbol [vee] [bin] [sy] ["5F] +\definemathsymbol [cap] [bin] [sy] ["5C] +\definemathsymbol [cup] [bin] [sy] ["5B] +\definemathsymbol [ddagger] [bin] [sy] ["7A] +\definemathsymbol [dagger] [bin] [sy] ["79] +\definemathsymbol [sqcap] [bin] [sy] ["75] +\definemathsymbol [sqcup] [bin] [sy] ["74] +\definemathsymbol [uplus] [bin] [sy] ["5D] +\definemathsymbol [amalg] [bin] [sy] ["71] +\definemathsymbol [diamond] [bin] [sy] ["05] +\definemathsymbol [bullet] [bin] [sy] ["0F] +\definemathsymbol [wr] [bin] [sy] ["6F] +\definemathsymbol [div] [bin] [sy] ["04] +\definemathsymbol [odot] [bin] [sy] ["0C] +\definemathsymbol [oslash] [bin] [sy] ["0B] +\definemathsymbol [otimes] [bin] [sy] ["0A] +\definemathsymbol [ominus] [bin] [sy] ["09] +\definemathsymbol [oplus] [bin] [sy] ["08] +\definemathsymbol [mp] [bin] [sy] ["07] +\definemathsymbol [pm] [bin] [sy] ["06] +\definemathsymbol [circ] [bin] [sy] ["0E] +\definemathsymbol [bigcirc] [bin] [sy] ["0D] +\definemathsymbol [setminus] [bin] [sy] ["6E] +\definemathsymbol [cdot] [bin] [sy] ["01] +\definemathsymbol [ast] [bin] [sy] ["03] +\definemathsymbol [times] [bin] [sy] ["02] +\definemathsymbol [star] [bin] [mi] ["3F] + +\stopmathcollection + +\startmathcollection[default] + +\definemathsymbol [propto] [rel] [sy] ["2F] +\definemathsymbol [sqsubseteq] [rel] [sy] ["76] +\definemathsymbol [sqsupseteq] [rel] [sy] ["77] +\definemathsymbol [parallel] [rel] [sy] ["6B] +\definemathsymbol [mid] [rel] [sy] ["6A] +\definemathsymbol [dashv] [rel] [sy] ["61] +\definemathsymbol [vdash] [rel] [sy] ["60] +\definemathsymbol [nearrow] [rel] [sy] ["25] +\definemathsymbol [searrow] [rel] [sy] ["26] +\definemathsymbol [nwarrow] [rel] [sy] ["2D] +\definemathsymbol [swarrow] [rel] [sy] ["2E] +\definemathsymbol [Leftrightarrow] [rel] [sy] ["2C] +\definemathsymbol [Leftarrow] [rel] [sy] ["28] +\definemathsymbol [Rightarrow] [rel] [sy] ["29] + +\stopmathcollection + +\startmathcollection[default] + +\definemathcommand [lnot] {\neg} +\definemathcommand [int] {\intop \intlimits} +\definemathcommand [oint] {\ointop\intlimits} +\definemathcommand [land] {\wedge} +\definemathcommand [lor] {\vee} +\definemathcommand [neq] {\not=} +\definemathcommand [ne] {\neq} +\definemathcommand [le] {\leq} +\definemathcommand [ge] {\geq} +\definemathcommand [eq] {=} +\definemathcommand [gt] {>} +\definemathcommand [lt] {<} +\definemathcommand [gets] {\leftarrow} +\definemathcommand [owns] {\ni} +\definemathcommand [to] {\rightarrow} +\definemathcommand [mapsto] {\mapstochar\rightarrow} + +\stopmathcollection + +\startmathcollection[default] + +\definemathsymbol [leq] [rel] [sy] ["14] +\definemathsymbol [geq] [rel] [sy] ["15] +\definemathsymbol [succ] [rel] [sy] ["1F] +\definemathsymbol [prec] [rel] [sy] ["1E] +\definemathsymbol [approx] [rel] [sy] ["19] +\definemathsymbol [succeq] [rel] [sy] ["17] +\definemathsymbol [preceq] [rel] [sy] ["16] +\definemathsymbol [supset] [rel] [sy] ["1B] +\definemathsymbol [subset] [rel] [sy] ["1A] +\definemathsymbol [supseteq] [rel] [sy] ["13] +\definemathsymbol [subseteq] [rel] [sy] ["12] +\definemathsymbol [in] [rel] [sy] ["32] +\definemathsymbol [ni] [rel] [sy] ["33] +\definemathsymbol [gg] [rel] [sy] ["1D] +\definemathsymbol [ll] [rel] [sy] ["1C] +\definemathsymbol [not] [rel] [sy] ["36] +\definemathsymbol [leftrightarrow] [rel] [sy] ["24] +\definemathsymbol [leftarrow] [rel] [sy] ["20] +\definemathsymbol [rightarrow] [rel] [sy] ["21] +\definemathsymbol [mapstochar] [rel] [sy] ["37] +\definemathsymbol [sim] [rel] [sy] ["18] +\definemathsymbol [simeq] [rel] [sy] ["27] +\definemathsymbol [perp] [rel] [sy] ["3F] +\definemathsymbol [equiv] [rel] [sy] ["11] +\definemathsymbol [asymp] [rel] [sy] ["10] +\definemathsymbol [smile] [rel] [mi] ["5E] +\definemathsymbol [frown] [rel] [mi] ["5F] +\definemathsymbol [leftharpoonup] [rel] [mi] ["28] +\definemathsymbol [leftharpoondown] [rel] [mi] ["29] +\definemathsymbol [rightharpoonup] [rel] [mi] ["2A] +\definemathsymbol [rightharpoondown] [rel] [mi] ["2B] +\definemathsymbol [lhook] [rel] [mi] ["2C] +\definemathsymbol [rhook] [rel] [mi] ["2D] + +\stopmathcollection + +\def\PLAINldots + {\ldotp\ldotp\ldotp} + +\def\PLAINcdots + {\cdotp\cdotp\cdotp} + +\def\PLAINvdots + {\vbox{\baselineskip.4\bodyfontsize\lineskiplimit\zeropoint + \kern.6\bodyfontsize\hbox{.}\hbox{.}\hbox{.}}} + +\def\PLAINddots + {\mkern1mu\raise.7\bodyfontsize\vbox{\kern.7\bodyfontsize\hbox{.}}\mkern2mu + \raise.4\bodyfontsize\hbox{.}\mkern2mu\raise.1\bodyfontsize\hbox{.}\mkern1mu} + +\startmathcollection[default] + +\definemathcommand [hookrightarrow] {\lhook\joinrel\rightarrow} +\definemathcommand [hookleftarrow] {\leftarrow\joinrel\rhook} +\definemathcommand [bowtie] {\mathrel\triangleright\joinrel\mathrel\triangleleft} +\definemathcommand [models] {\mathrel|\joinrel=} +\definemathcommand [iff] {\;\Longleftrightarrow\;} + +\definemathsymbol [ldotp] [punct] [mi] ["3A] +\definemathsymbol [cdotp] [punct] [sy] ["01] +\definemathsymbol [colon] [punct] [mr] ["3A] + +\definemathcommand [ldots] [inner] {\PLAINldots} +\definemathcommand [cdots] [inner] {\PLAINcdots} +\definemathcommand [vdots] [nothing] {\PLAINvdots} +\definemathcommand [ddots] [inner] {\PLAINddots} + +\stopmathcollection + +\startmathcollection[default] + +\definemathsymbol [acute] [accent] [mr] ["13] +\definemathsymbol [grave] [accent] [mr] ["12] +\definemathsymbol [ddot] [accent] [mr] ["7F] +\definemathsymbol [tilde] [accent] [mr] ["7E] +\definemathsymbol [mathring] [accent] [mr] ["17] +\definemathsymbol [bar] [accent] [mr] ["16] +\definemathsymbol [breve] [accent] [mr] ["15] +\definemathsymbol [check] [accent] [mr] ["14] +\definemathsymbol [hat] [accent] [mr] ["5E] +\definemathsymbol [vec] [accent] [mi] ["7E] % [ord] +\definemathsymbol [dot] [accent] [mr] ["5F] +\definemathsymbol [widetilde] [accent] [ex] ["65] % [ord] +\definemathsymbol [widehat] [accent] [ex] ["62] % [ord] + +\stopmathcollection + +\startmathcollection[default] + +\definemathsymbol [lmoustache] [open] [ex] ["7A] [ex] ["40] +\definemathsymbol [rmoustache] [close] [ex] ["7B] [ex] ["41] +\definemathsymbol [lgroup] [open] [mr] ["28] [ex] ["3A] % ? +\definemathsymbol [rgroup] [close] [mr] ["29] [ex] ["3B] % ? +\definemathsymbol [arrowvert] [nothing] [sy] ["6A] [ex] ["3C] +\definemathsymbol [Arrowvert] [nothing] [sy] ["6B] [ex] ["3D] +\definemathsymbol [bracevert] [nothing] [ex] ["3E] % ? +\definemathsymbol [Vert] [nothing] [sy] ["6B] [ex] ["0D] +\definemathsymbol [vert] [nothing] [sy] ["6A] [ex] ["0C] +\definemathsymbol [uparrow] [rel] [sy] ["22] [ex] ["78] +\definemathsymbol [downarrow] [rel] [sy] ["23] [ex] ["79] +\definemathsymbol [updownarrow] [rel] [sy] ["6C] [ex] ["3F] +\definemathsymbol [Uparrow] [rel] [sy] ["2A] [ex] ["7E] +\definemathsymbol [Downarrow] [rel] [sy] ["2B] [ex] ["7F] +\definemathsymbol [Updownarrow] [rel] [sy] ["6D] [ex] ["77] +\definemathsymbol [backslash] [nothing] [sy] ["6E] [ex] ["0F] +\definemathsymbol [langle] [open] [sy] ["68] [ex] ["0A] +\definemathsymbol [rangle] [close] [sy] ["69] [ex] ["0B] +\definemathsymbol [lbrace] [open] [sy] ["66] [ex] ["08] +\definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["09] +\definemathsymbol [lceil] [open] [sy] ["64] [ex] ["06] +\definemathsymbol [rceil] [close] [sy] ["65] [ex] ["07] +\definemathsymbol [lfloor] [open] [sy] ["62] [ex] ["04] +\definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["05] + +\definemathsymbol [sqrt] [radical] [sy] ["70] [ex] ["70] + +\stopmathcollection + +%D By request: + +\startmathcollection[default] + +\definemathsymbol [lvert] [open] [sy] ["6A] [ex] ["0C] +\definemathsymbol [rvert] [close] [sy] ["6A] [ex] ["0C] + +\definemathsymbol [lVert] [open] [sy] ["6B] [ex] ["0D] +\definemathsymbol [rVert] [close] [sy] ["6B] [ex] ["0D] + +\stopmathcollection + +%D For brooks: +%D +%D \starttyping +%D $\sqrt[3]{10}$ +%D \stoptyping + +\ifx\normalsqrt\undefined \let\normalsqrt\sqrt \fi % just set to: \dohandlemathtoken {sqrt} + +\def\notsosqrt[#1]{\root#1\of} + +\unexpanded\def\sqrt{\doifnextoptionalelse\notsosqrt\normalsqrt} + +\def\PLAINbig {\@@dobig{0.85}} +\def\PLAINBig {\@@dobig{1.15}} +\def\PLAINbigg{\@@dobig{1.45}} +\def\PLAINBigg{\@@dobig{1.75}} + +\startrawmathcollection [default] + +\definemathcommand [bigl] [open] [one] {\big} +\definemathcommand [bigm] [rel] [one] {\big} +\definemathcommand [bigr] [close] [one] {\big} +\definemathcommand [Bigl] [open] [one] {\Big} +\definemathcommand [Bigm] [rel] [one] {\Big} +\definemathcommand [Bigr] [close] [one] {\Big} +\definemathcommand [biggl] [open] [one] {\bigg} +\definemathcommand [biggm] [rel] [one] {\bigg} +\definemathcommand [biggr] [close] [one] {\bigg} +\definemathcommand [Biggl] [open] [one] {\Bigg} +\definemathcommand [Biggm] [rel] [one] {\Bigg} +\definemathcommand [Biggr] [close] [one] {\Bigg} + +\definemathcommand [big] {\PLAINbig} +\definemathcommand [Big] {\PLAINBig} +\definemathcommand [bigg] {\PLAINbigg} +\definemathcommand [Bigg] {\PLAINBigg} + +\stoprawmathcollection + +\startmathcollection[default] + +\definemathsymbol [dag] [box] [sy] ["79] +\definemathsymbol [ddag] [box] [sy] ["7A] +\definemathsymbol [S] [box] [sy] ["78] +\definemathsymbol [P] [box] [sy] ["7B] +\definemathsymbol [Orb] [box] [sy] ["0D] + +\stopmathcollection + +\def\PLAINroot#1#2% + {\setbox\zerocount\hbox{$\mathsurround\zeropoint#1\sqrt{#2}$}\dimen@\ht\zerocount + \advance\dimen@-\dp\zerocount + \mkern5mu\raise.6\dimen@\copy\rootbox \mkern-10mu\box\zerocount} + +\def\PLAINmatrix#1% + {\null\,\vcenter{\normalbaselines\mathsurround\zeropoint + \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr + \mathstrut\crcr\noalign{\kern-\baselineskip} + #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,} + +\startrawmathcollection[default] + +\definemathcommand [mathstrut] {\vphantom{(}} +\definemathcommand [joinrel] {\mathrel{\mkern-3mu}} +\definemathcommand [r@@t] {\PLAINroot} +\definemathcommand [matrix] {\PLAINmatrix} + +\definemathcommand [over] {\normalover} % hack, to do + +\stoprawmathcollection + +\def\{{\lbrace} +\def\}{\rbrace} + +%def\bbd{\fam\purefamily{blackboard}} +%def\cal{\fam\purefamily{calfamily}} + +\def\mit{\fam\purefamily{mitfamily}} + +\def\Bbb{\blackboard} % conforming amstex + +\startmathcollection[default] + + \definemathsymbol [mathperiod] [ord] [mi] ["3A] + \definemathsymbol [textperiod] [punct] [mi] ["3A] + + \definemathsymbol [mathcomma] [ord] [mi] ["3B] + \definemathsymbol [textcomma] [punct] [mi] ["3B] + +\stopmathcollection + +\definemathpunctuation . mathperiod textperiod +\definemathpunctuation , mathcomma textcomma + +%D The following colon related definitions are provided by Aditya +%D Mahajan who derived them from \type {mathtools.sty} and \type +%D {colonequals.sty}. + +%D \macros +%D {centercolon, colonminus, minuscolon, colonequals, equalscolon, +%D colonapprox, approxcolon, colonsim, simcolon, coloncolon, +%D coloncolonminus, minuscoloncolon, coloncolonequals, +%D equalscoloncolon, coloncolonapprox, approxcoloncolon, +%D colonsim, simcoloncolon} +%D +%D In $a := b$ the colon is not vertically centered with the equal +%D to. Also the distance between colon and equal to is a bit large. +%D So, we define a vertically centered colon \tex {centercolon} and +%D a few macros for colon and double colon relation symbols. +%D +%D \startlines +%D \formula {A \centercolon B} +%D \formula {A \colonminus B} +%D \formula {A \minuscolon B} +%D \formula {A \colonequals B} +%D \formula {A \equalscolon B} +%D \formula {A \colonapprox B} +%D \formula {A \approxcolon B} +%D \formula {A \colonsim B} +%D \formula {A \simcolon B} +%D \formula {A \coloncolon B} +%D \formula {A \coloncolonminus B} +%D \formula {A \minuscoloncolon B} +%D \formula {A \coloncolonequals B} +%D \formula {A \equalscoloncolon B} +%D \formula {A \coloncolonapprox B} +%D \formula {A \approxcoloncolon B} +%D \formula {A \colonsim B} +%D \formula {A \simcoloncolon B} +%D \stoplines + +%D The next macros take care of the space between the colon and the +%D relation symbol. + +\definemathcommand [colonsep] {\mkern-1.2mu} +\definemathcommand [doublecolonsep] {\mkern-0.9mu} + +%D The next macro vertically centeres its contents. + +\def\@center@math#1% + {\vcenter{\hbox{$\mathsurround\zeropoint#1$}}} + +\def\@center@colon + {\mathpalette\@center@math{\colon}} + +%D Now we define all the colon relations. + +\definemathcommand [centercolon] [rel] {\@center@colon} +\definemathcommand [colonminus] [rel] {\centercolon\colonsep\mathrel{-}} +\definemathcommand [minuscolon] [rel] {\mathrel{-}\colonsep\centercolon} +\definemathcommand [colonequals] [rel] {\centercolon\colonsep=} +\definemathcommand [equalscolon] [rel] {=\centercolon\colonsep} +\definemathcommand [colonapprox] [rel] {\centercolon\colonsep\approx} +\definemathcommand [approxcolon] [rel] {\approx\centercolon\colonsep} +\definemathcommand [colonsim] [rel] {\centercolon\colonsep\sim} +\definemathcommand [simcolon] [rel] {\sim\centercolon\colonsep} + +\definemathcommand [coloncolon] [rel] {\centercolon\doublecolonsep\centercolon} +\definemathcommand [coloncolonminus] [rel] {\coloncolon\colonsep\mathrel{-}} +\definemathcommand [minuscoloncolon] [rel] {\mathrel{-}\colonsep\coloncolon} +\definemathcommand [coloncolonequals] [rel] {\coloncolon\colonsep=} +\definemathcommand [equalscoloncolon] [rel] {=\coloncolon\colonsep} +\definemathcommand [coloncolonapprox] [rel] {\coloncolon\colonsep\approx} +\definemathcommand [approxcoloncolon] [rel] {\approx\coloncolon\colonsep} +\definemathcommand [colonsim] [rel] {\coloncolon\colonsep\sim} +\definemathcommand [simcoloncolon] [rel] {\sim\coloncolon\colonsep} + +%D More integrals (AM): + +\def\dointkern{\mkern-6mu\mathchoice{\mkern-3mu}{}{}{}} + +\definemathcommand [iint] {\repeatintegral\plusone } +\definemathcommand [iiint] {\repeatintegral\plustwo } +\definemathcommand [iiiint] {\repeatintegral\plusthree} + +\def\repeatintegral#1% + {\scratchtoks\emptytoks + \let\dointlimits\donothing + \let\dodointlimits\intlimits + \dorecurse{#1}{\appendtoks \intop \dointkern \to \scratchtoks} + \appendtoks \intop \dointlimits \dodointlimits \to \scratchtoks + \edef\dodorepeatintegral{\the\scratchtoks}% + \futurelet\next\dorepeatintegral} + +%D If the \type{\limits} option is used after \type{\iint}, use +%D \type{\mathop} and fudge the left hand space a bit to make the +%D subscript visually centered. + +\def\dorepeatintegral + {\ifx\next\limits \dointlimitcorrection \else + \ifx\next\displaylimits \dointlimitcorrection \else + \ifx\next\nolimits \donothing \else + \ifcase\intlimitcode\else \dointlimitcorrection \fi\fi\fi\fi + \dodorepeatintegral} + +\def\dointlimitcorrection + {\mkern-7mu\mathchoice{\mkern-2mu}{}{}{}% + \mathop\bgroup + \mkern7mu\mathchoice{\mkern2mu}{}{}{}% + \let\dointlimits\egroup} + +\setupmathematics + [integral=nolimits] + +\protect \endinput diff --git a/tex/context/base/math-tex.tex b/tex/context/base/math-tex.tex deleted file mode 100644 index c833db956..000000000 --- a/tex/context/base/math-tex.tex +++ /dev/null @@ -1,718 +0,0 @@ -%D \module -%D [ file=math-tex, -%D version=2001.04.12, -%D subtitle=Plain Specials, -%D author={Hans Hagen, Taco Hoekwater \& Aditya Mahajan}, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% beware: in mkiv we will do it differently - -\unprotect - -\mathcode`\ ="8000 \mathcode`\_="8000 \mathcode`\'="8000 - -\definefamilysynonym [default] [calligraphic] [sy] -\definefamilysynonym [default] [oldstyle] [mi] -\definefamilysynonym [default] [blackboard] [mr] -\definefamilysynonym [default] [gothic] [mr] -\definefamilysynonym [default] [fraktur] [mr] - -\definefamilysynonym [default] [lcgreek] [mi] -\definefamilysynonym [default] [ucgreek] [mr] -\definefamilysynonym [default] [vargreek] [mi] - - -%D \macros -%D {\setupmathematics} -%D -%D Configuration for integrals. (If needed we can speed this up and make it -%D installable; no processaction is needed then). - -\chardef\intlimitcode\zerocount % 0 nolimits 1 displaylimits 2 limits - -\def\intlimits - {\ifcase\intlimitcode \nolimits \or \displaylimits \or \limits \fi} - -\def\setupmathematics - {\dosingleargument\dosetupmathematics} - -\def\dosetupmathematics[#1]% - {\getparameters[\??mo][#1] - \processaction[\@@mointegral] - [ nolimits=>\chardef\intlimitcode\zerocount, - displaylimits=>\chardef\intlimitcode\plusone, - limits=>\chardef\intlimitcode\plustwo]} - -%D \startbuffer -%D $\int_a^b f(x) dx$ and also -%D $\iint_a^b f(x,y) dxdy$, $\iiint_a^b f(x,y) dxdy$, -%D $\iiiint_a^b f(x) dx$ -%D \startformula -%D \int_a^b f(x) dx \quad -%D \iint_a^b f(x) dx \quad -%D \iiint_a^b f(x) dx \quad -%D \iiiint_a^b f(x) dx \quad -%D \stopformula -%D \stopbuffer -%D -%D Default: \getbuffer -%D -%D Displaylimits: \setupmathematics[integral=displaylimits] \getbuffer -%D -%D Limits: \setupmathematics[integral=limits] \getbuffer - -\startmathcollection [default] - -\definemathsymbol [alpha] [nothing] [lcgreek] ["0B] -\definemathsymbol [beta] [nothing] [lcgreek] ["0C] -\definemathsymbol [gamma] [nothing] [lcgreek] ["0D] -\definemathsymbol [delta] [nothing] [lcgreek] ["0E] -\definemathsymbol [epsilon] [nothing] [lcgreek] ["0F] -\definemathsymbol [zeta] [nothing] [lcgreek] ["10] -\definemathsymbol [eta] [nothing] [lcgreek] ["11] -\definemathsymbol [theta] [nothing] [lcgreek] ["12] -\definemathsymbol [iota] [nothing] [lcgreek] ["13] -\definemathsymbol [kappa] [nothing] [lcgreek] ["14] -\definemathsymbol [lambda] [nothing] [lcgreek] ["15] -\definemathsymbol [mu] [nothing] [lcgreek] ["16] -\definemathsymbol [nu] [nothing] [lcgreek] ["17] -\definemathsymbol [xi] [nothing] [lcgreek] ["18] -\definemathsymbol [omicron] [nothing] [lcgreek] ["6F] -\definemathsymbol [pi] [nothing] [lcgreek] ["19] -\definemathsymbol [rho] [nothing] [lcgreek] ["1A] -\definemathsymbol [sigma] [nothing] [lcgreek] ["1B] -\definemathsymbol [tau] [nothing] [lcgreek] ["1C] -\definemathsymbol [upsilon] [nothing] [lcgreek] ["1D] -\definemathsymbol [phi] [nothing] [lcgreek] ["1E] -\definemathsymbol [chi] [nothing] [lcgreek] ["1F] -\definemathsymbol [psi] [nothing] [lcgreek] ["20] -\definemathsymbol [omega] [nothing] [lcgreek] ["21] - -\stopmathcollection - -\startmathcollection [default] - -\definemathsymbol [varepsilon] [nothing] [vargreek] ["22] -\definemathsymbol [vartheta] [nothing] [vargreek] ["23] -\definemathsymbol [varpi] [nothing] [vargreek] ["24] -\definemathsymbol [varrho] [nothing] [vargreek] ["25] -\definemathsymbol [varsigma] [nothing] [vargreek] ["26] -\definemathsymbol [varphi] [nothing] [vargreek] ["27] - -\stopmathcollection - -\startmathcollection [default] - -\definemathsymbol [Alpha] [alpha] [ucgreek] ["41] % A -\definemathsymbol [Beta] [alpha] [ucgreek] ["42] % B -\definemathsymbol [Gamma] [alpha] [ucgreek] ["00] -\definemathsymbol [Delta] [alpha] [ucgreek] ["01] -\definemathsymbol [Epsilon] [alpha] [ucgreek] ["45] % E -\definemathsymbol [Zeta] [alpha] [ucgreek] ["5A] % Z -\definemathsymbol [Eta] [alpha] [ucgreek] ["48] % H -\definemathsymbol [Theta] [alpha] [ucgreek] ["02] -\definemathsymbol [Iota] [alpha] [ucgreek] ["49] % I -\definemathsymbol [Kappa] [alpha] [ucgreek] ["4B] % K -\definemathsymbol [Lambda] [alpha] [ucgreek] ["03] -\definemathsymbol [Mu] [alpha] [ucgreek] ["4D] % M -\definemathsymbol [Nu] [alpha] [ucgreek] ["4E] % N -\definemathsymbol [Xi] [alpha] [ucgreek] ["04] -\definemathsymbol [Omicron] [alpha] [ucgreek] ["4F] % O -\definemathsymbol [Pi] [alpha] [ucgreek] ["05] -\definemathsymbol [Rho] [alpha] [ucgreek] ["52] % R -\definemathsymbol [Sigma] [alpha] [ucgreek] ["06] -\definemathsymbol [Tau] [alpha] [ucgreek] ["54] % T -\definemathsymbol [Upsilon] [alpha] [ucgreek] ["07] -\definemathsymbol [Phi] [alpha] [ucgreek] ["08] -\definemathsymbol [Chi] [alpha] [ucgreek] ["58] % X -\definemathsymbol [Psi] [alpha] [ucgreek] ["09] -\definemathsymbol [Omega] [alpha] [ucgreek] ["0A] - -\stopmathcollection - -% The \mfunction macro is an alternative for \hbox with a -% controlable font switch. - -\startmathcollection[default] - -\definemathcommand [arccos] [nolop] {\mfunction{arccos}} -\definemathcommand [arcsin] [nolop] {\mfunction{arcsin}} -\definemathcommand [arctan] [nolop] {\mfunction{arctan}} -\definemathcommand [arg] [nolop] {\mfunction{arg}} -\definemathcommand [cosh] [nolop] {\mfunction{cosh}} -\definemathcommand [cos] [nolop] {\mfunction{cos}} -\definemathcommand [coth] [nolop] {\mfunction{coth}} -\definemathcommand [cot] [nolop] {\mfunction{cot}} -\definemathcommand [csc] [nolop] {\mfunction{csc}} -\definemathcommand [deg] [nolop] {\mfunction{deg}} -\definemathcommand [det] [limop] {\mfunction{det}} -\definemathcommand [dim] [nolop] {\mfunction{dim}} -\definemathcommand [exp] [nolop] {\mfunction{exp}} -\definemathcommand [gcd] [limop] {\mfunction{gcd}} -\definemathcommand [hom] [nolop] {\mfunction{hom}} -\definemathcommand [inf] [limop] {\mfunction{inf}} -\definemathcommand [injlim] [limop] {\mfunction{inj\,lim}} -\definemathcommand [ker] [nolop] {\mfunction{ker}} -\definemathcommand [lg] [nolop] {\mfunction{lg}} -\definemathcommand [liminf] [limop] {\mfunction{lim\,inf}} -\definemathcommand [limsup] [limop] {\mfunction{lim\,sup}} -\definemathcommand [lim] [limop] {\mfunction{lim}} -\definemathcommand [ln] [nolop] {\mfunction{ln}} -\definemathcommand [log] [nolop] {\mfunction{log}} -\definemathcommand [median] [limop] {\mfunction{median}} -\definemathcommand [max] [limop] {\mfunction{max}} -\definemathcommand [min] [limop] {\mfunction{min}} -\definemathcommand [mod] [limop] {\mfunction{mod}} -\definemathcommand [div] [limop] {\mfunction{div}} -\definemathcommand [projlim] [limop] {\mfunction{proj\,lim}} -\definemathcommand [Pr] [limop] {\mfunction{Pr}} -\definemathcommand [sec] [nolop] {\mfunction{sec}} -\definemathcommand [sinh] [nolop] {\mfunction{sinh}} -\definemathcommand [sin] [nolop] {\mfunction{sin}} -\definemathcommand [sup] [limop] {\mfunction{sup}} -\definemathcommand [tanh] [nolop] {\mfunction{tanh}} -\definemathcommand [tan] [nolop] {\mfunction{tan}} - -\stopmathcollection - -\startmathcollection[default] - -\definemathcommand [integers] {\mfunction{Z}} -\definemathcommand [reals] {\mfunction{R}} -\definemathcommand [rationals] {\mfunction{Q}} -\definemathcommand [naturalnumbers] {\mfunction{N}} -\definemathcommand [complexes] {\mfunction{C}} -\definemathcommand [primes] {\mfunction{P}} - -\stopmathcollection - -\startmathcollection[default] - -\definemathcharacter [!] [close] [mr] ["21] -\definemathcharacter [(] [open] [mr] ["28] -\definemathcharacter [)] [close] [mr] ["29] -\definemathcharacter [*] [bin] [sy] ["03] -\definemathcharacter [+] [bin] [mr] ["2B] -\definemathcharacter [,] [punct] [mi] ["3B] -\definemathcharacter [-] [bin] [sy] ["00] -\definemathcharacter [.] [ord] [mi] ["3A] -\definemathcharacter [/] [ord] [mi] ["3D] -\definemathcharacter [:] [rel] [mr] ["3A] -\definemathcharacter [;] [punct] [mr] ["3B] -\definemathcharacter [<] [rel] [mi] ["3C] -\definemathcharacter [=] [rel] [mr] ["3D] -\definemathcharacter [>] [rel] [mi] ["3E] -\definemathcharacter [?] [close] [mr] ["3F] -\definemathcharacter [91] [open] [mr] ["5B] % [ -\definemathcharacter [92] [ord] [sy] ["6E] % \ -\definemathcharacter [93] [close] [mr] ["5D] % ] -\definemathcharacter [123] [open] [sy] ["66] % { -\definemathcharacter [124] [ord] [sy] ["6A] % | -\definemathcharacter [125] [close] [sy] ["67] % } - -\stopmathcollection - -\startmathcollection[default] - -\definemathcharacter [(] [nothing] [mr] ["28] [ex] ["00] -\definemathcharacter [)] [nothing] [mr] ["29] [ex] ["01] -\definemathcharacter [91] [nothing] [mr] ["5B] [ex] ["02] % [ -\definemathcharacter [93] [nothing] [mr] ["5D] [ex] ["03] % ] -\definemathcharacter [<] [nothing] [sy] ["68] [ex] ["0A] -\definemathcharacter [>] [nothing] [sy] ["69] [ex] ["0B] -\definemathcharacter [/] [nothing] [mr] ["2F] [ex] ["0E] -\definemathcharacter [124] [nothing] [sy] ["6A] [ex] ["0C] % | -\definemathcharacter [92] [nothing] [sy] ["6E] [ex] ["0F] % \ - -\stopmathcollection - -\def\PLAINangle - {{\vbox{\ialign{$\mathsurround\zeropoint\scriptstyle##$\crcr - \not\mathrel{\mkern14mu}\crcr - \noalign{\nointerlineskip} - \mkern2.5mu\leaders\hrule height.34pt\hfill\mkern2.5mu\crcr}}}} - -\startmathcollection[default] - -\definemathsymbol [aleph] [nothing] [sy] ["40] -\definemathsymbol [imath] [nothing] [mi] ["7B] -\definemathsymbol [jmath] [nothing] [mi] ["7C] -\definemathsymbol [ell] [nothing] [mi] ["60] -\definemathsymbol [wp] [nothing] [mi] ["7D] -\definemathsymbol [Re] [nothing] [sy] ["3C] -\definemathsymbol [Im] [nothing] [sy] ["3D] -\definemathsymbol [partial] [nothing] [mi] ["40] -\definemathsymbol [infty] [nothing] [sy] ["31] -\definemathsymbol [prime] [nothing] [sy] ["30] -\definemathsymbol [emptyset] [nothing] [sy] ["3B] -\definemathsymbol [nabla] [nothing] [sy] ["72] -\definemathsymbol [top] [nothing] [sy] ["3E] -\definemathsymbol [bot] [nothing] [sy] ["3F] - -\definemathcommand [hbar] {{\mathchar'26\mkern-9muh}} -\definemathcommand [surd] {{\mathchar"1270}} % ? -\definemathcommand [angle] {\PLAINangle} - -\stopmathcollection - -\startmathcollection[default] - -\definemathsymbol [triangle] [ord] [sy] ["34] -\definemathsymbol [forall] [ord] [sy] ["38] -\definemathsymbol [exists] [ord] [sy] ["39] -\definemathsymbol [neg] [ord] [sy] ["3A] -\definemathsymbol [flat] [ord] [mi] ["5B] -\definemathsymbol [natural] [ord] [mi] ["5C] -\definemathsymbol [sharp] [ord] [mi] ["5D] -\definemathsymbol [clubsuit] [ord] [sy] ["7C] -\definemathsymbol [diamondsuit] [ord] [sy] ["7D] -\definemathsymbol [heartsuit] [ord] [sy] ["7E] -\definemathsymbol [spadesuit] [ord] [sy] ["7F] - -\stopmathcollection - -\startmathcollection[default] - -\definemathcommand [square] {\hbox{\hsmash{$\sqcup$}$\sqcap$}} - -\stopmathcollection - -\startmathcollection[default] - -\definemathsymbol [coprod] [op] [ex] ["60] -\definemathsymbol [bigvee] [op] [ex] ["57] -\definemathsymbol [bigwedge] [op] [ex] ["56] -\definemathsymbol [biguplus] [op] [ex] ["55] -\definemathsymbol [bigcap] [op] [ex] ["54] -\definemathsymbol [bigcup] [op] [ex] ["53] -\definemathsymbol [intop] [op] [ex] ["52] -\definemathsymbol [prod] [op] [ex] ["51] -\definemathsymbol [sum] [op] [ex] ["50] -\definemathsymbol [bigotimes] [op] [ex] ["4E] -\definemathsymbol [bigoplus] [op] [ex] ["4C] -\definemathsymbol [bigodot] [op] [ex] ["4A] -\definemathsymbol [ointop] [op] [ex] ["48] -\definemathsymbol [bigsqcup] [op] [ex] ["46] -\definemathsymbol [smallint] [op] [sy] ["73] - -\stopmathcollection - -\startmathcollection[default] - -\definemathsymbol [triangleleft] [bin] [mi] ["2F] -\definemathsymbol [triangleright] [bin] [mi] ["2E] -\definemathsymbol [bigtriangleup] [bin] [sy] ["34] -\definemathsymbol [bigtriangledown] [bin] [sy] ["35] -\definemathsymbol [wedge] [bin] [sy] ["5E] -\definemathsymbol [vee] [bin] [sy] ["5F] -\definemathsymbol [cap] [bin] [sy] ["5C] -\definemathsymbol [cup] [bin] [sy] ["5B] -\definemathsymbol [ddagger] [bin] [sy] ["7A] -\definemathsymbol [dagger] [bin] [sy] ["79] -\definemathsymbol [sqcap] [bin] [sy] ["75] -\definemathsymbol [sqcup] [bin] [sy] ["74] -\definemathsymbol [uplus] [bin] [sy] ["5D] -\definemathsymbol [amalg] [bin] [sy] ["71] -\definemathsymbol [diamond] [bin] [sy] ["05] -\definemathsymbol [bullet] [bin] [sy] ["0F] -\definemathsymbol [wr] [bin] [sy] ["6F] -\definemathsymbol [div] [bin] [sy] ["04] -\definemathsymbol [odot] [bin] [sy] ["0C] -\definemathsymbol [oslash] [bin] [sy] ["0B] -\definemathsymbol [otimes] [bin] [sy] ["0A] -\definemathsymbol [ominus] [bin] [sy] ["09] -\definemathsymbol [oplus] [bin] [sy] ["08] -\definemathsymbol [mp] [bin] [sy] ["07] -\definemathsymbol [pm] [bin] [sy] ["06] -\definemathsymbol [circ] [bin] [sy] ["0E] -\definemathsymbol [bigcirc] [bin] [sy] ["0D] -\definemathsymbol [setminus] [bin] [sy] ["6E] -\definemathsymbol [cdot] [bin] [sy] ["01] -\definemathsymbol [ast] [bin] [sy] ["03] -\definemathsymbol [times] [bin] [sy] ["02] -\definemathsymbol [star] [bin] [mi] ["3F] - -\stopmathcollection - -\startmathcollection[default] - -\definemathsymbol [propto] [rel] [sy] ["2F] -\definemathsymbol [sqsubseteq] [rel] [sy] ["76] -\definemathsymbol [sqsupseteq] [rel] [sy] ["77] -\definemathsymbol [parallel] [rel] [sy] ["6B] -\definemathsymbol [mid] [rel] [sy] ["6A] -\definemathsymbol [dashv] [rel] [sy] ["61] -\definemathsymbol [vdash] [rel] [sy] ["60] -\definemathsymbol [nearrow] [rel] [sy] ["25] -\definemathsymbol [searrow] [rel] [sy] ["26] -\definemathsymbol [nwarrow] [rel] [sy] ["2D] -\definemathsymbol [swarrow] [rel] [sy] ["2E] -\definemathsymbol [Leftrightarrow] [rel] [sy] ["2C] -\definemathsymbol [Leftarrow] [rel] [sy] ["28] -\definemathsymbol [Rightarrow] [rel] [sy] ["29] - -\stopmathcollection - -\startmathcollection[default] - -\definemathcommand [lnot] {\neg} -\definemathcommand [int] {\intop \intlimits} -\definemathcommand [oint] {\ointop\intlimits} -\definemathcommand [land] {\wedge} -\definemathcommand [lor] {\vee} -\definemathcommand [neq] {\not=} -\definemathcommand [ne] {\neq} -\definemathcommand [le] {\leq} -\definemathcommand [ge] {\geq} -\definemathcommand [eq] {=} -\definemathcommand [gt] {>} -\definemathcommand [lt] {<} -\definemathcommand [gets] {\leftarrow} -\definemathcommand [owns] {\ni} -\definemathcommand [to] {\rightarrow} -\definemathcommand [mapsto] {\mapstochar\rightarrow} - -\stopmathcollection - -\startmathcollection[default] - -\definemathsymbol [leq] [rel] [sy] ["14] -\definemathsymbol [geq] [rel] [sy] ["15] -\definemathsymbol [succ] [rel] [sy] ["1F] -\definemathsymbol [prec] [rel] [sy] ["1E] -\definemathsymbol [approx] [rel] [sy] ["19] -\definemathsymbol [succeq] [rel] [sy] ["17] -\definemathsymbol [preceq] [rel] [sy] ["16] -\definemathsymbol [supset] [rel] [sy] ["1B] -\definemathsymbol [subset] [rel] [sy] ["1A] -\definemathsymbol [supseteq] [rel] [sy] ["13] -\definemathsymbol [subseteq] [rel] [sy] ["12] -\definemathsymbol [in] [rel] [sy] ["32] -\definemathsymbol [ni] [rel] [sy] ["33] -\definemathsymbol [gg] [rel] [sy] ["1D] -\definemathsymbol [ll] [rel] [sy] ["1C] -\definemathsymbol [not] [rel] [sy] ["36] -\definemathsymbol [leftrightarrow] [rel] [sy] ["24] -\definemathsymbol [leftarrow] [rel] [sy] ["20] -\definemathsymbol [rightarrow] [rel] [sy] ["21] -\definemathsymbol [mapstochar] [rel] [sy] ["37] -\definemathsymbol [sim] [rel] [sy] ["18] -\definemathsymbol [simeq] [rel] [sy] ["27] -\definemathsymbol [perp] [rel] [sy] ["3F] -\definemathsymbol [equiv] [rel] [sy] ["11] -\definemathsymbol [asymp] [rel] [sy] ["10] -\definemathsymbol [smile] [rel] [mi] ["5E] -\definemathsymbol [frown] [rel] [mi] ["5F] -\definemathsymbol [leftharpoonup] [rel] [mi] ["28] -\definemathsymbol [leftharpoondown] [rel] [mi] ["29] -\definemathsymbol [rightharpoonup] [rel] [mi] ["2A] -\definemathsymbol [rightharpoondown] [rel] [mi] ["2B] -\definemathsymbol [lhook] [rel] [mi] ["2C] -\definemathsymbol [rhook] [rel] [mi] ["2D] - -\stopmathcollection - -\def\PLAINldots - {\ldotp\ldotp\ldotp} - -\def\PLAINcdots - {\cdotp\cdotp\cdotp} - -\def\PLAINvdots - {\vbox{\baselineskip.4\bodyfontsize\lineskiplimit\zeropoint - \kern.6\bodyfontsize\hbox{.}\hbox{.}\hbox{.}}} - -\def\PLAINddots - {\mkern1mu\raise.7\bodyfontsize\vbox{\kern.7\bodyfontsize\hbox{.}}\mkern2mu - \raise.4\bodyfontsize\hbox{.}\mkern2mu\raise.1\bodyfontsize\hbox{.}\mkern1mu} - -\startmathcollection[default] - -\definemathcommand [hookrightarrow] {\lhook\joinrel\rightarrow} -\definemathcommand [hookleftarrow] {\leftarrow\joinrel\rhook} -\definemathcommand [bowtie] {\mathrel\triangleright\joinrel\mathrel\triangleleft} -\definemathcommand [models] {\mathrel|\joinrel=} -\definemathcommand [iff] {\;\Longleftrightarrow\;} - -\definemathsymbol [ldotp] [punct] [mi] ["3A] -\definemathsymbol [cdotp] [punct] [sy] ["01] -\definemathsymbol [colon] [punct] [mr] ["3A] - -\definemathcommand [ldots] [inner] {\PLAINldots} -\definemathcommand [cdots] [inner] {\PLAINcdots} -\definemathcommand [vdots] [nothing] {\PLAINvdots} -\definemathcommand [ddots] [inner] {\PLAINddots} - -\stopmathcollection - -\startmathcollection[default] - -\definemathsymbol [acute] [accent] [mr] ["13] -\definemathsymbol [grave] [accent] [mr] ["12] -\definemathsymbol [ddot] [accent] [mr] ["7F] -\definemathsymbol [tilde] [accent] [mr] ["7E] -\definemathsymbol [mathring] [accent] [mr] ["17] -\definemathsymbol [bar] [accent] [mr] ["16] -\definemathsymbol [breve] [accent] [mr] ["15] -\definemathsymbol [check] [accent] [mr] ["14] -\definemathsymbol [hat] [accent] [mr] ["5E] -\definemathsymbol [vec] [accent] [mi] ["7E] % [ord] -\definemathsymbol [dot] [accent] [mr] ["5F] -\definemathsymbol [widetilde] [accent] [ex] ["65] % [ord] -\definemathsymbol [widehat] [accent] [ex] ["62] % [ord] - -\stopmathcollection - -\startmathcollection[default] - -\definemathsymbol [lmoustache] [open] [ex] ["7A] [ex] ["40] -\definemathsymbol [rmoustache] [close] [ex] ["7B] [ex] ["41] -\definemathsymbol [lgroup] [open] [mr] ["28] [ex] ["3A] % ? -\definemathsymbol [rgroup] [close] [mr] ["29] [ex] ["3B] % ? -\definemathsymbol [arrowvert] [nothing] [sy] ["6A] [ex] ["3C] -\definemathsymbol [Arrowvert] [nothing] [sy] ["6B] [ex] ["3D] -\definemathsymbol [bracevert] [nothing] [ex] ["3E] % ? -\definemathsymbol [Vert] [nothing] [sy] ["6B] [ex] ["0D] -\definemathsymbol [vert] [nothing] [sy] ["6A] [ex] ["0C] -\definemathsymbol [uparrow] [rel] [sy] ["22] [ex] ["78] -\definemathsymbol [downarrow] [rel] [sy] ["23] [ex] ["79] -\definemathsymbol [updownarrow] [rel] [sy] ["6C] [ex] ["3F] -\definemathsymbol [Uparrow] [rel] [sy] ["2A] [ex] ["7E] -\definemathsymbol [Downarrow] [rel] [sy] ["2B] [ex] ["7F] -\definemathsymbol [Updownarrow] [rel] [sy] ["6D] [ex] ["77] -\definemathsymbol [backslash] [nothing] [sy] ["6E] [ex] ["0F] -\definemathsymbol [langle] [open] [sy] ["68] [ex] ["0A] -\definemathsymbol [rangle] [close] [sy] ["69] [ex] ["0B] -\definemathsymbol [lbrace] [open] [sy] ["66] [ex] ["08] -\definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["09] -\definemathsymbol [lceil] [open] [sy] ["64] [ex] ["06] -\definemathsymbol [rceil] [close] [sy] ["65] [ex] ["07] -\definemathsymbol [lfloor] [open] [sy] ["62] [ex] ["04] -\definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["05] - -\definemathsymbol [sqrt] [radical] [sy] ["70] [ex] ["70] - -\stopmathcollection - -%D By request: - -\startmathcollection[default] - -\definemathsymbol [lvert] [open] [sy] ["6A] [ex] ["0C] -\definemathsymbol [rvert] [close] [sy] ["6A] [ex] ["0C] - -\definemathsymbol [lVert] [open] [sy] ["6B] [ex] ["0D] -\definemathsymbol [rVert] [close] [sy] ["6B] [ex] ["0D] - -\stopmathcollection - -%D For brooks: -%D -%D \starttyping -%D $\sqrt[3]{10}$ -%D \stoptyping - -\ifx\normalsqrt\undefined \let\normalsqrt\sqrt \fi % just set to: \dohandlemathtoken {sqrt} - -\def\notsosqrt[#1]{\root#1\of} - -\unexpanded\def\sqrt{\doifnextoptionalelse\notsosqrt\normalsqrt} - -\def\PLAINbig {\@@dobig{0.85}} -\def\PLAINBig {\@@dobig{1.15}} -\def\PLAINbigg{\@@dobig{1.45}} -\def\PLAINBigg{\@@dobig{1.75}} - -\startrawmathcollection [default] - -\definemathcommand [bigl] [open] [one] {\big} -\definemathcommand [bigm] [rel] [one] {\big} -\definemathcommand [bigr] [close] [one] {\big} -\definemathcommand [Bigl] [open] [one] {\Big} -\definemathcommand [Bigm] [rel] [one] {\Big} -\definemathcommand [Bigr] [close] [one] {\Big} -\definemathcommand [biggl] [open] [one] {\bigg} -\definemathcommand [biggm] [rel] [one] {\bigg} -\definemathcommand [biggr] [close] [one] {\bigg} -\definemathcommand [Biggl] [open] [one] {\Bigg} -\definemathcommand [Biggm] [rel] [one] {\Bigg} -\definemathcommand [Biggr] [close] [one] {\Bigg} - -\definemathcommand [big] {\PLAINbig} -\definemathcommand [Big] {\PLAINBig} -\definemathcommand [bigg] {\PLAINbigg} -\definemathcommand [Bigg] {\PLAINBigg} - -\stoprawmathcollection - -\startmathcollection[default] - -\definemathsymbol [dag] [box] [sy] ["79] -\definemathsymbol [ddag] [box] [sy] ["7A] -\definemathsymbol [S] [box] [sy] ["78] -\definemathsymbol [P] [box] [sy] ["7B] -\definemathsymbol [Orb] [box] [sy] ["0D] - -\stopmathcollection - -\def\PLAINroot#1#2% - {\setbox\zerocount\hbox{$\mathsurround\zeropoint#1\sqrt{#2}$}\dimen@\ht\zerocount - \advance\dimen@-\dp\zerocount - \mkern5mu\raise.6\dimen@\copy\rootbox \mkern-10mu\box\zerocount} - -\def\PLAINmatrix#1% - {\null\,\vcenter{\normalbaselines\mathsurround\zeropoint - \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr - \mathstrut\crcr\noalign{\kern-\baselineskip} - #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,} - -\startrawmathcollection[default] - -\definemathcommand [mathstrut] {\vphantom{(}} -\definemathcommand [joinrel] {\mathrel{\mkern-3mu}} -\definemathcommand [r@@t] {\PLAINroot} -\definemathcommand [matrix] {\PLAINmatrix} - -\definemathcommand [over] {\normalover} % hack, to do - -\stoprawmathcollection - -\def\{{\lbrace} -\def\}{\rbrace} - -%def\bbd{\fam\purefamily{blackboard}} -%def\cal{\fam\purefamily{calfamily}} - -\def\mit{\fam\purefamily{mitfamily}} - -\def\Bbb{\blackboard} % conforming amstex - -\startmathcollection[default] - - \definemathsymbol [mathperiod] [ord] [mi] ["3A] - \definemathsymbol [textperiod] [punct] [mi] ["3A] - - \definemathsymbol [mathcomma] [ord] [mi] ["3B] - \definemathsymbol [textcomma] [punct] [mi] ["3B] - -\stopmathcollection - -\definemathpunctuation . mathperiod textperiod -\definemathpunctuation , mathcomma textcomma - -%D The following colon related definitions are provided by Aditya -%D Mahajan who derived them from \type {mathtools.sty} and \type -%D {colonequals.sty}. - -%D \macros -%D {centercolon, colonminus, minuscolon, colonequals, equalscolon, -%D colonapprox, approxcolon, colonsim, simcolon, coloncolon, -%D coloncolonminus, minuscoloncolon, coloncolonequals, -%D equalscoloncolon, coloncolonapprox, approxcoloncolon, -%D colonsim, simcoloncolon} -%D -%D In $a := b$ the colon is not vertically centered with the equal -%D to. Also the distance between colon and equal to is a bit large. -%D So, we define a vertically centered colon \tex {centercolon} and -%D a few macros for colon and double colon relation symbols. -%D -%D \startlines -%D \formula {A \centercolon B} -%D \formula {A \colonminus B} -%D \formula {A \minuscolon B} -%D \formula {A \colonequals B} -%D \formula {A \equalscolon B} -%D \formula {A \colonapprox B} -%D \formula {A \approxcolon B} -%D \formula {A \colonsim B} -%D \formula {A \simcolon B} -%D \formula {A \coloncolon B} -%D \formula {A \coloncolonminus B} -%D \formula {A \minuscoloncolon B} -%D \formula {A \coloncolonequals B} -%D \formula {A \equalscoloncolon B} -%D \formula {A \coloncolonapprox B} -%D \formula {A \approxcoloncolon B} -%D \formula {A \colonsim B} -%D \formula {A \simcoloncolon B} -%D \stoplines - -%D The next macros take care of the space between the colon and the -%D relation symbol. - -\definemathcommand [colonsep] {\mkern-1.2mu} -\definemathcommand [doublecolonsep] {\mkern-0.9mu} - -%D The next macro vertically centeres its contents. - -\def\@center@math#1% - {\vcenter{\hbox{$\mathsurround\zeropoint#1$}}} - -\def\@center@colon - {\mathpalette\@center@math{\colon}} - -%D Now we define all the colon relations. - -\definemathcommand [centercolon] [rel] {\@center@colon} -\definemathcommand [colonminus] [rel] {\centercolon\colonsep\mathrel{-}} -\definemathcommand [minuscolon] [rel] {\mathrel{-}\colonsep\centercolon} -\definemathcommand [colonequals] [rel] {\centercolon\colonsep=} -\definemathcommand [equalscolon] [rel] {=\centercolon\colonsep} -\definemathcommand [colonapprox] [rel] {\centercolon\colonsep\approx} -\definemathcommand [approxcolon] [rel] {\approx\centercolon\colonsep} -\definemathcommand [colonsim] [rel] {\centercolon\colonsep\sim} -\definemathcommand [simcolon] [rel] {\sim\centercolon\colonsep} - -\definemathcommand [coloncolon] [rel] {\centercolon\doublecolonsep\centercolon} -\definemathcommand [coloncolonminus] [rel] {\coloncolon\colonsep\mathrel{-}} -\definemathcommand [minuscoloncolon] [rel] {\mathrel{-}\colonsep\coloncolon} -\definemathcommand [coloncolonequals] [rel] {\coloncolon\colonsep=} -\definemathcommand [equalscoloncolon] [rel] {=\coloncolon\colonsep} -\definemathcommand [coloncolonapprox] [rel] {\coloncolon\colonsep\approx} -\definemathcommand [approxcoloncolon] [rel] {\approx\coloncolon\colonsep} -\definemathcommand [colonsim] [rel] {\coloncolon\colonsep\sim} -\definemathcommand [simcoloncolon] [rel] {\sim\coloncolon\colonsep} - -%D More integrals (AM): - -\def\dointkern{\mkern-6mu\mathchoice{\mkern-3mu}{}{}{}} - -\definemathcommand [iint] {\repeatintegral\plusone } -\definemathcommand [iiint] {\repeatintegral\plustwo } -\definemathcommand [iiiint] {\repeatintegral\plusthree} - -\def\repeatintegral#1% - {\scratchtoks\emptytoks - \let\dointlimits\donothing - \let\dodointlimits\intlimits - \dorecurse{#1}{\appendtoks \intop \dointkern \to \scratchtoks} - \appendtoks \intop \dointlimits \dodointlimits \to \scratchtoks - \edef\dodorepeatintegral{\the\scratchtoks}% - \futurelet\next\dorepeatintegral} - -%D If the \type{\limits} option is used after \type{\iint}, use -%D \type{\mathop} and fudge the left hand space a bit to make the -%D subscript visually centered. - -\def\dorepeatintegral - {\ifx\next\limits \dointlimitcorrection \else - \ifx\next\displaylimits \dointlimitcorrection \else - \ifx\next\nolimits \donothing \else - \ifcase\intlimitcode\else \dointlimitcorrection \fi\fi\fi\fi - \dodorepeatintegral} - -\def\dointlimitcorrection - {\mkern-7mu\mathchoice{\mkern-2mu}{}{}{}% - \mathop\bgroup - \mkern7mu\mathchoice{\mkern2mu}{}{}{}% - \let\dointlimits\egroup} - -\setupmathematics - [integral=nolimits] - -\protect \endinput diff --git a/tex/context/base/math-tim.mkii b/tex/context/base/math-tim.mkii new file mode 100644 index 000000000..3b9aea103 --- /dev/null +++ b/tex/context/base/math-tim.mkii @@ -0,0 +1,371 @@ +%D \module +%D [ file=math-tim, +%D version=2001.04.12, +%D title=\CONTEXT\ Math Macros, +%D subtitle=Mathtime Specials, +%D author={Hans Hagen \& Taco Hoekwater}, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\endinput % i will clean this up after taco has gone over it + +%D With thanks to Berthold Horn from YandY for providing me +%D evaluation copies of the MathTimePlus fonts. + +% version 0 : Michael Spivak +% version 1 : Taco Hoekwater +% version 2 : Hans Hagen +% version 3 : etc etc etc + +\unprotect + +%D We use the predefined spare families \type {\mcfam} and +%D \type {\mdfam}. + +\let\cafam\mcfam \let\hexcafam\hexmcfam +\let\gbfam\mdfam \let\hexgbfam\hexmdfam +\let\gkfam\mdfam \let\hexgkfam\hexmdfam + +% Why is this needed? + +% \font\tenmd =mtgu at 10pt +% \font\sevenmd=mtgu at 7.6pt +% \font\fivemd =mtgu at 6pt +% \font\tenmc =mtms at 10pt +% \font\sevenmc=mtms at 7.6pt +% \font\fivemc =mtms at 6pt +% +% \textfont \mcfam\tenmc \textfont \mdfam\tenmd +% \scriptfont \mcfam\sevenmc \scriptfont \mdfam\sevenmd +% \scriptscriptfont\mcfam\fivemc \scriptscriptfont\mdfam\fivemd + +% \addtocommalist{gk}\familylist +% \addtocommalist{gb}\familylist +% +% \defineinterfaceconstant {ca} {ca} % boohoo! +% \defineinterfaceconstant {gk} {gk} % boohoo! +% \defineinterfaceconstant {gb} {gb} % boohoo! + +% \definealternativestyle[script] [\ca][\ca] +% \definealternativestyle[greek] [\gk][\gk] +% \definealternativestyle[boldgreek][\gb][\gb] + +% \definebodyfont +% [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt] [rm] +% [ca=mtms sa 1, +% gk=mtgu sa 1, +% gb=mtgub sa 1] + +%D Since a font size is a rather fuzzy thing, it will be no +%D surprise that the Math Times fonts have different specs +%D than the Computer Modern Roman fonts. +%D +%D \starttabulate[|Bl|c|c|c|c|c|c|c|c|c|c|] +%D \NC Computer Modern\NC +%D 5 \NC6 \NC7 \NC8 \NC9 \NC10 \NC11 \NC12 \NC14 \NC18\NC\NR +%D \NC Math Times \NC +%D 6.0\NC6.8\NC7.6\NC8.4\NC9.2\NC10.0\NC10.8\NC11.6\NC13.2\NC--\NC\NR +%D \stoptabulate +%D +%D The following definitions presume the existence of \type +%D {tio} and \type {tibio} font alternatives. Definitions for +%D \type {\tf.} etc and \type {\sc} are left as they are. + +%D moved code + +%D The next lines set up coding dependant versions of math +%D accents (for \type {texnansi} of course). These are needed +%D in commands like \type {\bf} and \type {\it} (which use the +%D text font encoding) a opposed to \type {_no spec_} and +%D \type {mi} that use the math font encoding. This stuff +%D should be made more general! + +% \daghex, \ddaghex and \dothex were wrong in my version of mtmacs + +\def\daghex {86} % to do +\def\ddaghex {87} +\def\Shex {A7} +\def\Phex {B6} +\def\barhex {16} +\def\gravehex{12} +\def\acutehex{13} +\def\checkhex{14} +\def\brevehex{15} +\def\hathex {5E} +\def\dothex {05} +\def\tildehex{7E} +\def\ddothex {7F} + +%D The \type {mtex} fonts need a recalculation of \type +%D {\p@renwd}, which in \CONTEXT\ is done automatically. + +%D The following definitions are mostly copied from the file +%D \type {mtmacs.tex}, which banner said: +%D +%D \starttyping +%D MTMACS.TEX VERSION 1.1.1 (1996 Dec 8) +%D COPYRIGHT (C) 1992, 1993, 1996 BY THE TEXPLORATORS CORPORATION +%D ALL RIGHTS RESERVED +%D \stoptyping +%D +%D We reformatted the macros and changed a few bits and +%D pieces. A further cleanup with regards to the scratch +%D registers will be done later. + +\mathchardef\Gamma = "0130 +\mathchardef\Delta = "0131 +\mathchardef\Theta = "0132 +\mathchardef\Lambda = "0133 +\mathchardef\Xi = "0134 +\mathchardef\Pi = "0135 +\mathchardef\Sigma = "0136 +\mathchardef\Upsilon = "0137 +\mathchardef\Phi = "0138 +\mathchardef\Psi = "0139 +\mathchardef\Omega = "017F +\mathchardef\varGamma = "0100 +\mathchardef\varDelta = "0101 +\mathchardef\varTheta = "0102 +\mathchardef\varLambda = "0103 +\mathchardef\varXi = "0104 +\mathchardef\varPi = "0105 +\mathchardef\varSigma = "0106 +\mathchardef\varUpsilon = "0107 +\mathchardef\varPhi = "0108 +\mathchardef\varPsi = "0109 +\mathchardef\varOmega = "010A +\mathchardef\varkappa = "017E + +\mathchardef\ldotp = "613A + +\mathchardef\triangleleft = "2247 +\mathchardef\triangleright = "2246 +\mathchardef\comp = "2242 + +\mathchardef\Relbar = "3248 +\mathchardef\dagger = "20\daghex % to do +\mathchardef\ddagger = "20\ddaghex % to do +\mathchardef\dotacc = "0250 + +\mathcode`\( = "412E +\mathcode`\) = "512F +\mathcode`\. = "013A +\mathcode`\, = "613B +\mathcode`\+ = "2243 +\mathcode`\= = "3244 +\mathcode`\; = "6249 + +\delcode `\( = "12E300 +\delcode `\) = "12F301 + +\let\mit=\undefined % to do + +\def\vec{\mathaccent"0245 } +\def\t#1{{\edef\next{\the\font}\the\textfont2\accent"41\next#1}} + +% fam equals -1 unless the user has said something +% like \rm (cf. the texbook page 290) + +\def\ifdefaultfamelse#1#2% + {\ifnum\fam=\minusone\mathaccent#1\else\mathaccent#2\fi} + +\let\noaccents@\relax + +\def\grave {\ifdefaultfamelse{"024A}{"70\gravehex}} +\def\acute {\ifdefaultfamelse{"024B}{"70\acutehex}} +\def\check {\ifdefaultfamelse{"024C}{"70\checkhex}} +\def\breve {\ifdefaultfamelse{"024D}{"70\brevehex}} +\def\bar {\ifdefaultfamelse{"024E}{"70\barhex }} +\def\hat {\ifdefaultfamelse{"024F}{"70\hathex }} +\def\dot {\ifdefaultfamelse{"0250}{"70\dothex }} +\def\tilde {\ifdefaultfamelse{"0251}{"70\tildehex}} +\def\ddot {\ifdefaultfamelse{"0252}{"70\ddothex }} + +\def\widebar{\mathaccent"0253 } + +\def\mathhexbox@#1#2#3% + {\relax + \ifmmode + \mathpalette{}{\mathsurround\zeropoint\rm\mathchar"#1#2#3}% + \else + \leavevmode + \hbox{$\mathsurround\zeropoint\rm\mathchar"#1#2#3$}% + \fi} + +\def\dag {\edef\next@{0\daghex }\expandafter\mathhexbox@\next@} +\def\ddag{\edef\next@{0\ddaghex}\expandafter\mathhexbox@\next@} + +\def\S{\edef\next@{0\Shex}\expandafter\mathhexbox@\next@} +\def\P{\edef\next@{0\Phex}\expandafter\mathhexbox@\next@} + +\def\vdots% + {\vbox + {\baselineskip4\points + \lineskiplimit\zeropoint + \kern6\points\hbox{$\mathsurround\zeropoint.$}\hbox{$\mathsurround\zeropoint.$}\hbox{$\mathsurround\zeropoint.$}}} + +\def\ddots% + {\mathinner + {\mkern1mu + \raise7\points\vbox{\kern 7\points\hbox{$\mathsurround\zeropoint.$}}\mkern2mu + \raise4\points\hbox{$\mathsurround\zeropoint.$}\mkern2mu + \raise \points\hbox{$\mathsurround\zeropoint.$}\mkern1mu}} + +\def\hbar + {{\mathchoice + {\hbox{\lower.07em \hbox{$\mathchar"\barhex$}}} + {\hbox{\lower.07em \hbox{$\mathchar"\barhex$}}} + {\hbox{\lower.049em\hbox{$\scriptstyle\mathchar"\barhex$}}} + {\hbox{\lower.035em\hbox{$\scriptscriptstyle\mathchar"\barhex$}}}% + \mkern-6.3muh}} + +\def\angle% + {{\vbox{\ialign{$\mathsurround\zeropoint\scriptstyle##$\crcr + \not\mathrel{\mkern14mu}\crcr + \noalign{\nointerlineskip} + \mkern2.5mu\leaders\hrule height.48\points\hfill\mkern2.5mu\crcr}}}} + +\newdimen\amstexex + +\amstexex = .2326ex + +\def\varinjlim% + {\mathop{\vtop{\ialign{##\crcr + \hfil\the\textfont\zerocount lim\hfil\crcr + \noalign{\nointerlineskip}\rightarrowfill\crcr + \noalign{\nointerlineskip\kern-\amstexex}\crcr}}}} + +\def\varprojlim% + {\mathop{\vtop{\ialign{##\crcr + \hfil\the\textfont\zerocount lim\hfil\crcr + \noalign{\nointerlineskip}\leftarrowfill\crcr + \noalign{\nointerlineskip\kern-\amstexex}\crcr}}}} + +\def\varliminf{\mathop{\underbar {lim}}} % context-ified +\def\varlimsup{\mathop{\overstrike{lim}}} % context-ified + +\def\spdot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount .}}}} +\def\spddot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount ..}}}} +\def\spdddot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount ...}}}} +\def\spddddot{^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount....}}}} + +%D Here some code is merged in order to save strings. + +\def\domultidot#1#2% + {\setbox0\hbox{$#1#2$}% + \setbox2\hbox{$#1\infty$}% + \dimen0\ht2 + \ifdim\ht0<\dimen0 \dimen0\ht0 \fi + \setbox2\hbox{$#1#2\mathchar"012D$}% + \dimen2\wd2 + \advance\dimen2-\wd0 + \setbox0\hbox{$#1\rhook$}% + \advance\dimen2-\wd0 + \vbox + {\offinterlineskip + \ialign{\hfil$#1##$\hfil\cr + \kern\dimen2\dotacc\mkern-2.5mu\dotacc\mkern-2.5mu\dotacc\thirddot\cr + \noalign{\vskip-\dimen0}% + #2\cr}}} + +\def\dddot% + {\def\thirddot{}% + \mathpalette\domultidot} + +\def\ddddot% + {\def\thirddot{\mkern-2.5mu\dotacc}% + \mathpalette\domultidot} + +\newcount\uproot@ +\newcount\leftroot@ + +\def\nonmatherr#1% + {\errmessage{\noexpand#1allowed only in math mode}} + +\def\uproot#1% + {\relax + \ifmmode + \uproot@#1\relax + \else + \nonmatherr\uproot + \fi} + +\def\leftroot#1% + {\relax + \ifmmode + \leftroot@#1\relax + \else + \nonmatherr\leftroot + \fi} + +\def\root#1\of#2% + {\setbox\rootbox=\hbox{$\mathsurround\zeropoint\scriptscriptstyle{#1}$}% + \mathpalette\r@@t{#2}} + +\def\r@@t#1#2% + {\setbox\zerocount\hbox{$\uproot@\zerocount\leftroot\zerocount\mathsurround\zeropoint#1\sqrt{#2}$}% + \dimen@\ht\zerocount\advance\dimen@-\dp\zerocount + \dimen@ii\dimen@ + \ifdim\dimen@>30\points \advance\dimen@ii-16\points \else + \ifdim\dimen@>24\points \advance\dimen@ii -8\points \else + \ifdim\dimen@>18\points \advance\dimen@ii -6\points \else + \ifdim\dimen@>12\points \advance\dimen@ii -4\points \else + \ifdim\dimen@>10\points \advance\dimen@ii -2\points \fi\fi\fi\fi\fi + \setbox\plustwo=\hbox{$\mathsurround\zeropoint#1\mskip\uproot@ mu$}% + \advance\dimen@ii by1.667\wd\plustwo + \mkern-\leftroot@ mu\mkern5mu\raise.6\dimen@ii\copy\rootbox + \mkern-8mu\mkern\leftroot@ mu\box\zerocount\leftroot\zerocount\uproot\zerocount} + +\def\space@.{\futurelet\space@\relax} \space@. % really needed ? + +\def\jadjust% + {\mkern-\plustwo mu} + +%D For the moment the following code is left unchanged. It is +%D not used anyway. + +\newif\ifsubscriptcorrection \subscriptcorrectionfalse + +\ifsubscriptcorrection + + \expandafter\let\csname subscript character \string_\endcsname_ + + \catcode`\_=\active + + \def_% + {\ifmmode + \expandafter\sb@ + \else + \expandafter\csname subscript character \string_\endcsname + \fi} + + \let\sb_ + + \ifnum\catcode`\^^A=8 \catcode`\^^A\active\let^^A_\fi + + \def\sb@#1% + {\csname subscript character \string_\endcsname + {\futurelet\next\sb@@#1}} + + \def\sb@@% + {\ifx\next\space@ + \def\next@. % + {\futurelet\next\sb@@}% + \else + \def\next@.% + {\ifx\next j% + \mkern-\plustwo mu\else + \ifx\next f% + \mkern-\plustwo mu\else + \ifx\next p% + \mkern-\plusone mu\fi\fi\fi}% + \fi + \next@.} + +\fi + +\protect diff --git a/tex/context/base/math-tim.tex b/tex/context/base/math-tim.tex deleted file mode 100644 index 3b9aea103..000000000 --- a/tex/context/base/math-tim.tex +++ /dev/null @@ -1,371 +0,0 @@ -%D \module -%D [ file=math-tim, -%D version=2001.04.12, -%D title=\CONTEXT\ Math Macros, -%D subtitle=Mathtime Specials, -%D author={Hans Hagen \& Taco Hoekwater}, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\endinput % i will clean this up after taco has gone over it - -%D With thanks to Berthold Horn from YandY for providing me -%D evaluation copies of the MathTimePlus fonts. - -% version 0 : Michael Spivak -% version 1 : Taco Hoekwater -% version 2 : Hans Hagen -% version 3 : etc etc etc - -\unprotect - -%D We use the predefined spare families \type {\mcfam} and -%D \type {\mdfam}. - -\let\cafam\mcfam \let\hexcafam\hexmcfam -\let\gbfam\mdfam \let\hexgbfam\hexmdfam -\let\gkfam\mdfam \let\hexgkfam\hexmdfam - -% Why is this needed? - -% \font\tenmd =mtgu at 10pt -% \font\sevenmd=mtgu at 7.6pt -% \font\fivemd =mtgu at 6pt -% \font\tenmc =mtms at 10pt -% \font\sevenmc=mtms at 7.6pt -% \font\fivemc =mtms at 6pt -% -% \textfont \mcfam\tenmc \textfont \mdfam\tenmd -% \scriptfont \mcfam\sevenmc \scriptfont \mdfam\sevenmd -% \scriptscriptfont\mcfam\fivemc \scriptscriptfont\mdfam\fivemd - -% \addtocommalist{gk}\familylist -% \addtocommalist{gb}\familylist -% -% \defineinterfaceconstant {ca} {ca} % boohoo! -% \defineinterfaceconstant {gk} {gk} % boohoo! -% \defineinterfaceconstant {gb} {gb} % boohoo! - -% \definealternativestyle[script] [\ca][\ca] -% \definealternativestyle[greek] [\gk][\gk] -% \definealternativestyle[boldgreek][\gb][\gb] - -% \definebodyfont -% [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt] [rm] -% [ca=mtms sa 1, -% gk=mtgu sa 1, -% gb=mtgub sa 1] - -%D Since a font size is a rather fuzzy thing, it will be no -%D surprise that the Math Times fonts have different specs -%D than the Computer Modern Roman fonts. -%D -%D \starttabulate[|Bl|c|c|c|c|c|c|c|c|c|c|] -%D \NC Computer Modern\NC -%D 5 \NC6 \NC7 \NC8 \NC9 \NC10 \NC11 \NC12 \NC14 \NC18\NC\NR -%D \NC Math Times \NC -%D 6.0\NC6.8\NC7.6\NC8.4\NC9.2\NC10.0\NC10.8\NC11.6\NC13.2\NC--\NC\NR -%D \stoptabulate -%D -%D The following definitions presume the existence of \type -%D {tio} and \type {tibio} font alternatives. Definitions for -%D \type {\tf.} etc and \type {\sc} are left as they are. - -%D moved code - -%D The next lines set up coding dependant versions of math -%D accents (for \type {texnansi} of course). These are needed -%D in commands like \type {\bf} and \type {\it} (which use the -%D text font encoding) a opposed to \type {_no spec_} and -%D \type {mi} that use the math font encoding. This stuff -%D should be made more general! - -% \daghex, \ddaghex and \dothex were wrong in my version of mtmacs - -\def\daghex {86} % to do -\def\ddaghex {87} -\def\Shex {A7} -\def\Phex {B6} -\def\barhex {16} -\def\gravehex{12} -\def\acutehex{13} -\def\checkhex{14} -\def\brevehex{15} -\def\hathex {5E} -\def\dothex {05} -\def\tildehex{7E} -\def\ddothex {7F} - -%D The \type {mtex} fonts need a recalculation of \type -%D {\p@renwd}, which in \CONTEXT\ is done automatically. - -%D The following definitions are mostly copied from the file -%D \type {mtmacs.tex}, which banner said: -%D -%D \starttyping -%D MTMACS.TEX VERSION 1.1.1 (1996 Dec 8) -%D COPYRIGHT (C) 1992, 1993, 1996 BY THE TEXPLORATORS CORPORATION -%D ALL RIGHTS RESERVED -%D \stoptyping -%D -%D We reformatted the macros and changed a few bits and -%D pieces. A further cleanup with regards to the scratch -%D registers will be done later. - -\mathchardef\Gamma = "0130 -\mathchardef\Delta = "0131 -\mathchardef\Theta = "0132 -\mathchardef\Lambda = "0133 -\mathchardef\Xi = "0134 -\mathchardef\Pi = "0135 -\mathchardef\Sigma = "0136 -\mathchardef\Upsilon = "0137 -\mathchardef\Phi = "0138 -\mathchardef\Psi = "0139 -\mathchardef\Omega = "017F -\mathchardef\varGamma = "0100 -\mathchardef\varDelta = "0101 -\mathchardef\varTheta = "0102 -\mathchardef\varLambda = "0103 -\mathchardef\varXi = "0104 -\mathchardef\varPi = "0105 -\mathchardef\varSigma = "0106 -\mathchardef\varUpsilon = "0107 -\mathchardef\varPhi = "0108 -\mathchardef\varPsi = "0109 -\mathchardef\varOmega = "010A -\mathchardef\varkappa = "017E - -\mathchardef\ldotp = "613A - -\mathchardef\triangleleft = "2247 -\mathchardef\triangleright = "2246 -\mathchardef\comp = "2242 - -\mathchardef\Relbar = "3248 -\mathchardef\dagger = "20\daghex % to do -\mathchardef\ddagger = "20\ddaghex % to do -\mathchardef\dotacc = "0250 - -\mathcode`\( = "412E -\mathcode`\) = "512F -\mathcode`\. = "013A -\mathcode`\, = "613B -\mathcode`\+ = "2243 -\mathcode`\= = "3244 -\mathcode`\; = "6249 - -\delcode `\( = "12E300 -\delcode `\) = "12F301 - -\let\mit=\undefined % to do - -\def\vec{\mathaccent"0245 } -\def\t#1{{\edef\next{\the\font}\the\textfont2\accent"41\next#1}} - -% fam equals -1 unless the user has said something -% like \rm (cf. the texbook page 290) - -\def\ifdefaultfamelse#1#2% - {\ifnum\fam=\minusone\mathaccent#1\else\mathaccent#2\fi} - -\let\noaccents@\relax - -\def\grave {\ifdefaultfamelse{"024A}{"70\gravehex}} -\def\acute {\ifdefaultfamelse{"024B}{"70\acutehex}} -\def\check {\ifdefaultfamelse{"024C}{"70\checkhex}} -\def\breve {\ifdefaultfamelse{"024D}{"70\brevehex}} -\def\bar {\ifdefaultfamelse{"024E}{"70\barhex }} -\def\hat {\ifdefaultfamelse{"024F}{"70\hathex }} -\def\dot {\ifdefaultfamelse{"0250}{"70\dothex }} -\def\tilde {\ifdefaultfamelse{"0251}{"70\tildehex}} -\def\ddot {\ifdefaultfamelse{"0252}{"70\ddothex }} - -\def\widebar{\mathaccent"0253 } - -\def\mathhexbox@#1#2#3% - {\relax - \ifmmode - \mathpalette{}{\mathsurround\zeropoint\rm\mathchar"#1#2#3}% - \else - \leavevmode - \hbox{$\mathsurround\zeropoint\rm\mathchar"#1#2#3$}% - \fi} - -\def\dag {\edef\next@{0\daghex }\expandafter\mathhexbox@\next@} -\def\ddag{\edef\next@{0\ddaghex}\expandafter\mathhexbox@\next@} - -\def\S{\edef\next@{0\Shex}\expandafter\mathhexbox@\next@} -\def\P{\edef\next@{0\Phex}\expandafter\mathhexbox@\next@} - -\def\vdots% - {\vbox - {\baselineskip4\points - \lineskiplimit\zeropoint - \kern6\points\hbox{$\mathsurround\zeropoint.$}\hbox{$\mathsurround\zeropoint.$}\hbox{$\mathsurround\zeropoint.$}}} - -\def\ddots% - {\mathinner - {\mkern1mu - \raise7\points\vbox{\kern 7\points\hbox{$\mathsurround\zeropoint.$}}\mkern2mu - \raise4\points\hbox{$\mathsurround\zeropoint.$}\mkern2mu - \raise \points\hbox{$\mathsurround\zeropoint.$}\mkern1mu}} - -\def\hbar - {{\mathchoice - {\hbox{\lower.07em \hbox{$\mathchar"\barhex$}}} - {\hbox{\lower.07em \hbox{$\mathchar"\barhex$}}} - {\hbox{\lower.049em\hbox{$\scriptstyle\mathchar"\barhex$}}} - {\hbox{\lower.035em\hbox{$\scriptscriptstyle\mathchar"\barhex$}}}% - \mkern-6.3muh}} - -\def\angle% - {{\vbox{\ialign{$\mathsurround\zeropoint\scriptstyle##$\crcr - \not\mathrel{\mkern14mu}\crcr - \noalign{\nointerlineskip} - \mkern2.5mu\leaders\hrule height.48\points\hfill\mkern2.5mu\crcr}}}} - -\newdimen\amstexex - -\amstexex = .2326ex - -\def\varinjlim% - {\mathop{\vtop{\ialign{##\crcr - \hfil\the\textfont\zerocount lim\hfil\crcr - \noalign{\nointerlineskip}\rightarrowfill\crcr - \noalign{\nointerlineskip\kern-\amstexex}\crcr}}}} - -\def\varprojlim% - {\mathop{\vtop{\ialign{##\crcr - \hfil\the\textfont\zerocount lim\hfil\crcr - \noalign{\nointerlineskip}\leftarrowfill\crcr - \noalign{\nointerlineskip\kern-\amstexex}\crcr}}}} - -\def\varliminf{\mathop{\underbar {lim}}} % context-ified -\def\varlimsup{\mathop{\overstrike{lim}}} % context-ified - -\def\spdot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount .}}}} -\def\spddot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount ..}}}} -\def\spdddot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount ...}}}} -\def\spddddot{^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount....}}}} - -%D Here some code is merged in order to save strings. - -\def\domultidot#1#2% - {\setbox0\hbox{$#1#2$}% - \setbox2\hbox{$#1\infty$}% - \dimen0\ht2 - \ifdim\ht0<\dimen0 \dimen0\ht0 \fi - \setbox2\hbox{$#1#2\mathchar"012D$}% - \dimen2\wd2 - \advance\dimen2-\wd0 - \setbox0\hbox{$#1\rhook$}% - \advance\dimen2-\wd0 - \vbox - {\offinterlineskip - \ialign{\hfil$#1##$\hfil\cr - \kern\dimen2\dotacc\mkern-2.5mu\dotacc\mkern-2.5mu\dotacc\thirddot\cr - \noalign{\vskip-\dimen0}% - #2\cr}}} - -\def\dddot% - {\def\thirddot{}% - \mathpalette\domultidot} - -\def\ddddot% - {\def\thirddot{\mkern-2.5mu\dotacc}% - \mathpalette\domultidot} - -\newcount\uproot@ -\newcount\leftroot@ - -\def\nonmatherr#1% - {\errmessage{\noexpand#1allowed only in math mode}} - -\def\uproot#1% - {\relax - \ifmmode - \uproot@#1\relax - \else - \nonmatherr\uproot - \fi} - -\def\leftroot#1% - {\relax - \ifmmode - \leftroot@#1\relax - \else - \nonmatherr\leftroot - \fi} - -\def\root#1\of#2% - {\setbox\rootbox=\hbox{$\mathsurround\zeropoint\scriptscriptstyle{#1}$}% - \mathpalette\r@@t{#2}} - -\def\r@@t#1#2% - {\setbox\zerocount\hbox{$\uproot@\zerocount\leftroot\zerocount\mathsurround\zeropoint#1\sqrt{#2}$}% - \dimen@\ht\zerocount\advance\dimen@-\dp\zerocount - \dimen@ii\dimen@ - \ifdim\dimen@>30\points \advance\dimen@ii-16\points \else - \ifdim\dimen@>24\points \advance\dimen@ii -8\points \else - \ifdim\dimen@>18\points \advance\dimen@ii -6\points \else - \ifdim\dimen@>12\points \advance\dimen@ii -4\points \else - \ifdim\dimen@>10\points \advance\dimen@ii -2\points \fi\fi\fi\fi\fi - \setbox\plustwo=\hbox{$\mathsurround\zeropoint#1\mskip\uproot@ mu$}% - \advance\dimen@ii by1.667\wd\plustwo - \mkern-\leftroot@ mu\mkern5mu\raise.6\dimen@ii\copy\rootbox - \mkern-8mu\mkern\leftroot@ mu\box\zerocount\leftroot\zerocount\uproot\zerocount} - -\def\space@.{\futurelet\space@\relax} \space@. % really needed ? - -\def\jadjust% - {\mkern-\plustwo mu} - -%D For the moment the following code is left unchanged. It is -%D not used anyway. - -\newif\ifsubscriptcorrection \subscriptcorrectionfalse - -\ifsubscriptcorrection - - \expandafter\let\csname subscript character \string_\endcsname_ - - \catcode`\_=\active - - \def_% - {\ifmmode - \expandafter\sb@ - \else - \expandafter\csname subscript character \string_\endcsname - \fi} - - \let\sb_ - - \ifnum\catcode`\^^A=8 \catcode`\^^A\active\let^^A_\fi - - \def\sb@#1% - {\csname subscript character \string_\endcsname - {\futurelet\next\sb@@#1}} - - \def\sb@@% - {\ifx\next\space@ - \def\next@. % - {\futurelet\next\sb@@}% - \else - \def\next@.% - {\ifx\next j% - \mkern-\plustwo mu\else - \ifx\next f% - \mkern-\plustwo mu\else - \ifx\next p% - \mkern-\plusone mu\fi\fi\fi}% - \fi - \next@.} - -\fi - -\protect diff --git a/tex/context/base/math-uni.mkii b/tex/context/base/math-uni.mkii new file mode 100644 index 000000000..e8fd3f05d --- /dev/null +++ b/tex/context/base/math-uni.mkii @@ -0,0 +1,237 @@ +%D \module +%D [ file=math-uni, +%D version=2005.06.11, +%D title=\CONTEXT\ Math Macros, +%D subtitle=unicode support, +%D author={Nikolai Weibull \& Taco Hoekwater}, +%D date=\currentdate, +%D copyright=PRAGMA] + +\unprotect + +% needed for unic-032 % TH + +\startmathcollection[default] + + \definemathcommand [unic@doubleverticalline] {\mathord{\parallel}} + \definemathcommand [unic@doublelowline] {\underline{\textunderscore}} + + \definemathcommand [unic@doubleprime] {''} + \definemathcommand [unic@tripleprime] {'''} + + \definemathcommand [unic@reverseddoubleprime] {\mathord{\backprime\backprime}} + \definemathcommand [unic@reversedtripleprime] {\mathord{\backprime\backprime\backprime}} + + \definemathcommand [unic@fractionslash] {\vulgarfraction{}{}} + \definemathcommand [unic@lowasterisk] {\mathord{\lower-.2em\hbox{$\ast$}}} + + \definemathcommand [unic@functionapplication] {\mathop{}} + \definemathcommand [unic@invisibletimes] {\mathbin{}} + \definemathcommand [unic@invisibleseparator] {\mathpunct{}} + +\stopmathcollection + +% needed for unic-033 % TH + +\def\unic@vulgarfraction#1#2% + {\hbox + {\high{{\tfx\it #1}\kern -.2em}% + \symbol[vulgarfraction]% + \kern -.2em\low{{\tfx\it #2}}}} + +\startmathcollection[default] + + \definemathcommand [unic@accountof] {\unic@vulgarfraction{a}{c}} + \definemathcommand [unic@addressedtothesubject] {\unic@vulgarfraction{a}{s}} + \definemathcommand [unic@doublestruckC] {{\Bbb C}} + \definemathcommand [unic@degreecelsius] {{\textdegree \tf C}} + \definemathcommand [unic@centrelinesymbol] {\unknownchar} + \definemathcommand [unic@careof] {\unic@vulgarfraction{c}{o}} + \definemathcommand [unic@cadauna] {\unic@vulgarfraction{c}{u}} + \definemathcommand [unic@eulerconstant] {{\rm e}} + \definemathcommand [unic@scruple] {\unknownchar} + \definemathcommand [unic@degreefahrenheit] {{\textdegree \tf F}} + \definemathcommand [unic@scriptg] {\unknownchar} + \definemathcommand [unic@scriptH] {{\cal H}} + \definemathcommand [unic@blackletterH] {{\fraktur H}} + \definemathcommand [unic@doublestruckH] {{\Bbb H}} + \definemathcommand [unic@planckconstant] {h} + \definemathcommand [unic@planckconstantovertwopi] {\hslash} + \definemathcommand [unic@scriptI] {{\cal I}} + \definemathcommand [unic@blackletterI] {{\fraktur I}} + \definemathcommand [unic@scriptL] {{\cal L}} + \definemathcommand [unic@scriptl] {\ell} + \definemathcommand [unic@lbbarsymbol] {\unknownchar} + \definemathcommand [unic@doublestruckN] {{\Bbb N}} + \definemathcommand [unic@numerosign] {\hbox{\symbol[numero]}} + \definemathcommand [unic@soundrecordingcopyright] {\encircled{{\tfx P}}} + \definemathcommand [unic@scriptP] {{\cal P}} + \definemathcommand [unic@doublestruckP] {{\Bbb P}} + \definemathcommand [unic@doublestruckQ] {{\Bbb Q}} + \definemathcommand [unic@scriptR] {{\cal R}} + \definemathcommand [unic@blackletterR] {{\fraktur R}} + \definemathcommand [unic@doublestruckR] {{\Bbb R}} + \definemathcommand [unic@prescriptiontake] {\unknownchar} + \definemathcommand [unic@response] {\unknownchar} + \definemathcommand [unic@servicemark] {\high{\txx SM}} + \definemathcommand [unic@telephonesign] {\high{\txx TEL}} + \definemathcommand [unic@trademarksign] {\trademark} + \definemathcommand [unic@versickle] {\unknownchar} + \definemathcommand [unic@doublestruckZ] {{\Bbb Z}} + \definemathcommand [unic@ouncesign] {\unknownchar} + \definemathcommand [unic@ohmsign] {\Omega} + \definemathcommand [unic@invertedohmsign] {\rotate[\c!rotation=180]{\Omega}} + \definemathcommand [unic@blackletterZ] {{\fraktur Z}} + \definemathcommand [unic@turnedgreekletteriota] {\rotate[\c!rotation=180]{\iota}} + \definemathcommand [unic@kelvinsign] {{\tf K}} + \definemathcommand [unic@angstromsign] {\Angstrom} + \definemathcommand [unic@scriptB] {{\cal B}} + \definemathcommand [unic@blackletterC] {{\fraktur C}} + \definemathcommand [unic@estimatedsymbol] {\unknownchar} + \definemathcommand [unic@scripte] {\unknownchar} + \definemathcommand [unic@scriptE] {{\cal E}} + \definemathcommand [unic@scriptF] {{\cal F}} + \definemathcommand [unic@turnedF] {\rotate[\c!rotation=180]{{\tf F}}} + \definemathcommand [unic@scriptM] {{\cal M}} + \definemathcommand [unic@scripto] {\unknownchar} + + \definemathcommand [unic@informationsource] {{\bf i}} + \definemathcommand [unic@rotatedQ] {\rotate[\c!rotation=90]{{\tf Q}}} + \definemathcommand [unic@facsimilesign] {\unknownchar} + \definemathcommand [unic@doublestruckpi] {\pi}%{\unknownchar} + \definemathcommand [unic@doublestruckgamma] {\gamma}%{\unknownchar} + \definemathcommand [unic@doublestruckGamma] {\Gamma}%{\unknownchar} + \definemathcommand [unic@doublestruckPi] {\Pi}%{\unknownchar} + \definemathcommand [unic@doublestrucknarysummation] {\unknownchar} + \definemathcommand [unic@turnedsansserifG] {\rotate[\c!rotation=180]{{\ss G}}} + \definemathcommand [unic@turnedsansserifL] {\rotate[\c!rotation=180]{{\ss L}}} + \definemathcommand [unic@reversedsansserifL] {\mirror{{\ss L}}} + \definemathcommand [unic@turnedsansserifY] {\rotate[\c!rotation=180]{{\ss Y}}} + \definemathcommand [unic@doublestruckitalicD] {D}%{\unknownchar} + \definemathcommand [unic@doublestruckitalicd] {d}%{\unknownchar} + \definemathcommand [unic@doublestruckitalice] {e}%{\unknownchar} + \definemathcommand [unic@doublestruckitalici] {i}%{\unknownchar} + \definemathcommand [unic@doublestruckitalicj] {j}%{\unknownchar} + \definemathcommand [unic@propertyline] {\unknownchar} + \definemathcommand [unic@turnedampersand] {\rotate[\c!rotation=180]{\&}} + \definemathcommand [unic@persign] {\unknownchar} + + \definemathcommand [unic@fractiononethird] {\vulgarfraction{1}{3}} + \definemathcommand [unic@fractiontwothirds] {\vulgarfraction{2}{3}} + \definemathcommand [unic@fractiononefifth] {\vulgarfraction{1}{5}} + \definemathcommand [unic@fractiontwofifths] {\vulgarfraction{2}{5}} + \definemathcommand [unic@fractionthreefifths] {\vulgarfraction{3}{5}} + \definemathcommand [unic@fractionfourfifths] {\vulgarfraction{4}{5}} + \definemathcommand [unic@fractiononesixth] {\vulgarfraction{1}{6}} + \definemathcommand [unic@fractionfivesixths] {\vulgarfraction{5}{6}} + \definemathcommand [unic@fractiononeeighth] {\vulgarfraction{1}{8}} + \definemathcommand [unic@fractionthreeeighths] {\vulgarfraction{3}{8}} + \definemathcommand [unic@fractionfiveeighths] {\vulgarfraction{5}{8}} + \definemathcommand [unic@fractionseveneighths] {\vulgarfraction{7}{8}} + \definemathcommand [unic@fractionnumeratorone] {\vulgarfraction{1}{}} + \definemathcommand [unic@romannumeralOne] {{\tf I}} + \definemathcommand [unic@romannumeralTwo] {{\tf II}} + \definemathcommand [unic@romannumeralThree] {{\tf III}} + \definemathcommand [unic@romannumeralFour] {{\tf IV}} + \definemathcommand [unic@romannumeralFive] {{\tf V}} + \definemathcommand [unic@romannumeralSix] {{\tf VI}} + \definemathcommand [unic@romannumeralSeven] {{\tf VII}} + \definemathcommand [unic@romannumeralEight] {{\tf VIII}} + \definemathcommand [unic@romannumeralNine] {{\tf IX}} + \definemathcommand [unic@romannumeralTen] {{\tf X}} + \definemathcommand [unic@romannumeralEleven] {{\tf XI}} + \definemathcommand [unic@romannumeralTwelve] {{\tf XII}} + \definemathcommand [unic@romannumeralFifty] {{\tf L}} + \definemathcommand [unic@romannumeralOnehundred] {{\tf C}} + \definemathcommand [unic@romannumeralFivehundred] {{\tf D}} + \definemathcommand [unic@romannumeralOnethousand] {{\tf M}} + \definemathcommand [unic@romannumeralone] {{\tf i}} + \definemathcommand [unic@romannumeraltwo] {{\tf ii}} + \definemathcommand [unic@romannumeralthree] {{\tf iii}} + \definemathcommand [unic@romannumeralfour] {{\tf iv}} + \definemathcommand [unic@romannumeralfive] {{\tf v}} + \definemathcommand [unic@romannumeralsix] {{\tf vi}} + \definemathcommand [unic@romannumeralseven] {{\tf vii}} + \definemathcommand [unic@romannumeraleight] {{\tf viii}} + \definemathcommand [unic@romannumeralnine] {{\tf ix}} + \definemathcommand [unic@romannumeralten] {{\tf x}} + \definemathcommand [unic@romannumeraleleven] {{\tf xi}} + \definemathcommand [unic@romannumeraltwelve] {{\tf xii}} + \definemathcommand [unic@romannumeralfifty] {{\tf l}} + \definemathcommand [unic@romannumeralonehundred] {{\tf c}} + \definemathcommand [unic@romannumeralfivehundred] {{\tf d}} + \definemathcommand [unic@romannumeralonethousand] {{\tf m}} + \definemathcommand [unic@romannumeralonethousandCD] {\unknownchar} + \definemathcommand [unic@romannumeralfivethousand] {\unknownchar} + \definemathcommand [unic@romannumeraltenthousand] {\unknownchar} + \definemathcommand [unic@romannumeralreversedonehundred] {\mirror{C}} + +\stopmathcollection + +% needed for unic-033 % NW + +\startmathcollection[default] + + \definemathcommand [unic@leftarrowtobar] {\mapstochar\leftarrow} + +\stopmathcollection + +% needed for unic-034 % NW + +\startmathcollection[default] + + \definemathcommand [unic@in] {\in} + \definemathcommand [unic@nin] {\not\in} + \definemathcommand [unic@nni] {\not\ni} + \definemathcommand [unic@minus] {-} + \definemathcommand [unic@divisionslash] {/} + \definemathcommand [unic@sqrt] {\sqrt{}} + \definemathcommand [unic@cubesqrt] {\root 3 \of {}} + \definemathcommand [unic@fourthsqrt] {\root 4 \of {}} + \definemathcommand [unic@divides] [op] {|} % TODO + \definemathcommand [unic@ndivides] [rel] {\mathop{\not|}} % TODO: horrible + \definemathcommand [unic@cap] {\cap} + \definemathcommand [unic@dblint] {\int\!\!\!\int} + \definemathcommand [unic@triint] {\int\!\!\!\int\!\!\!\int} + \definemathcommand [unic@ratio] [rel] {:} + \definemathcommand [unic@proportion] [rel] {::} + \definemathcommand [unic@excess] [op] {-\!\!:} + \definemathcommand [unic@geomprop] [op] {:\!\!\!-\!\!\!:} + \definemathcommand [unic@homothetic] [op] {\sim\!\!\!:} + \definemathcommand [unic@nsimeq] {\not\simeq} + \definemathcommand [unic@cong] {\cong} + \definemathcommand [unic@napproxeq] {\not\approxeq} + \definemathcommand [unic@napprox] {\not\approx} + \definemathcommand [unic@doteq] {\doteq} + \definemathcommand [unic@correspondsto] {\buildrel \frown \over =} + \definemathcommand [unic@estimates] {\buildrel \wedge \over =} + \definemathcommand [unic@equiangularto] {\buildrel \vee \over =} + \definemathcommand [unic@stareq] {\buildrel \star \over =} + \definemathcommand [unic@eqbydef] {\buildrel \rm def \over =} + \definemathcommand [unic@measuredby] {\buildrel \rm m \over =} + \definemathcommand [unic@questionedeq] {\buildrel \rm ? \over =} + \definemathcommand [unic@nequiv] {\not\equiv} + \definemathcommand [unic@nasymp] {\not\asymp} + \definemathcommand [unic@nlesssim] {\not\lesssim} + \definemathcommand [unic@ngtrsim] {\not\gtrsim} + \definemathcommand [unic@nlessgtr] {\not\lessgtr} + \definemathcommand [unic@ngtrless] {\not\gtrless} + \definemathcommand [unic@nsubset] {\not\subset} + \definemathcommand [unic@nsupset] {\not\supset} + \definemathcommand [unic@nsqsubseteq] {\not\sqsubseteq} + \definemathcommand [unic@nsqsupseteq] {\not\sqsupseteq} + +\stopmathcollection + +% needed for unic-039 % NW + +\startmathcollection[default] + + \definemathcommand [unic@Lbracket] [open] {[\![} + \definemathcommand [unic@Rbracket] [close] {]\!]} + \definemathcommand [unic@Langle] [open] {\langle\!\langle} + \definemathcommand [unic@Rangle] [close] {\rangle\!\rangle} + +\stopmathcollection + +\protect \endinput diff --git a/tex/context/base/math-uni.tex b/tex/context/base/math-uni.tex deleted file mode 100644 index e8fd3f05d..000000000 --- a/tex/context/base/math-uni.tex +++ /dev/null @@ -1,237 +0,0 @@ -%D \module -%D [ file=math-uni, -%D version=2005.06.11, -%D title=\CONTEXT\ Math Macros, -%D subtitle=unicode support, -%D author={Nikolai Weibull \& Taco Hoekwater}, -%D date=\currentdate, -%D copyright=PRAGMA] - -\unprotect - -% needed for unic-032 % TH - -\startmathcollection[default] - - \definemathcommand [unic@doubleverticalline] {\mathord{\parallel}} - \definemathcommand [unic@doublelowline] {\underline{\textunderscore}} - - \definemathcommand [unic@doubleprime] {''} - \definemathcommand [unic@tripleprime] {'''} - - \definemathcommand [unic@reverseddoubleprime] {\mathord{\backprime\backprime}} - \definemathcommand [unic@reversedtripleprime] {\mathord{\backprime\backprime\backprime}} - - \definemathcommand [unic@fractionslash] {\vulgarfraction{}{}} - \definemathcommand [unic@lowasterisk] {\mathord{\lower-.2em\hbox{$\ast$}}} - - \definemathcommand [unic@functionapplication] {\mathop{}} - \definemathcommand [unic@invisibletimes] {\mathbin{}} - \definemathcommand [unic@invisibleseparator] {\mathpunct{}} - -\stopmathcollection - -% needed for unic-033 % TH - -\def\unic@vulgarfraction#1#2% - {\hbox - {\high{{\tfx\it #1}\kern -.2em}% - \symbol[vulgarfraction]% - \kern -.2em\low{{\tfx\it #2}}}} - -\startmathcollection[default] - - \definemathcommand [unic@accountof] {\unic@vulgarfraction{a}{c}} - \definemathcommand [unic@addressedtothesubject] {\unic@vulgarfraction{a}{s}} - \definemathcommand [unic@doublestruckC] {{\Bbb C}} - \definemathcommand [unic@degreecelsius] {{\textdegree \tf C}} - \definemathcommand [unic@centrelinesymbol] {\unknownchar} - \definemathcommand [unic@careof] {\unic@vulgarfraction{c}{o}} - \definemathcommand [unic@cadauna] {\unic@vulgarfraction{c}{u}} - \definemathcommand [unic@eulerconstant] {{\rm e}} - \definemathcommand [unic@scruple] {\unknownchar} - \definemathcommand [unic@degreefahrenheit] {{\textdegree \tf F}} - \definemathcommand [unic@scriptg] {\unknownchar} - \definemathcommand [unic@scriptH] {{\cal H}} - \definemathcommand [unic@blackletterH] {{\fraktur H}} - \definemathcommand [unic@doublestruckH] {{\Bbb H}} - \definemathcommand [unic@planckconstant] {h} - \definemathcommand [unic@planckconstantovertwopi] {\hslash} - \definemathcommand [unic@scriptI] {{\cal I}} - \definemathcommand [unic@blackletterI] {{\fraktur I}} - \definemathcommand [unic@scriptL] {{\cal L}} - \definemathcommand [unic@scriptl] {\ell} - \definemathcommand [unic@lbbarsymbol] {\unknownchar} - \definemathcommand [unic@doublestruckN] {{\Bbb N}} - \definemathcommand [unic@numerosign] {\hbox{\symbol[numero]}} - \definemathcommand [unic@soundrecordingcopyright] {\encircled{{\tfx P}}} - \definemathcommand [unic@scriptP] {{\cal P}} - \definemathcommand [unic@doublestruckP] {{\Bbb P}} - \definemathcommand [unic@doublestruckQ] {{\Bbb Q}} - \definemathcommand [unic@scriptR] {{\cal R}} - \definemathcommand [unic@blackletterR] {{\fraktur R}} - \definemathcommand [unic@doublestruckR] {{\Bbb R}} - \definemathcommand [unic@prescriptiontake] {\unknownchar} - \definemathcommand [unic@response] {\unknownchar} - \definemathcommand [unic@servicemark] {\high{\txx SM}} - \definemathcommand [unic@telephonesign] {\high{\txx TEL}} - \definemathcommand [unic@trademarksign] {\trademark} - \definemathcommand [unic@versickle] {\unknownchar} - \definemathcommand [unic@doublestruckZ] {{\Bbb Z}} - \definemathcommand [unic@ouncesign] {\unknownchar} - \definemathcommand [unic@ohmsign] {\Omega} - \definemathcommand [unic@invertedohmsign] {\rotate[\c!rotation=180]{\Omega}} - \definemathcommand [unic@blackletterZ] {{\fraktur Z}} - \definemathcommand [unic@turnedgreekletteriota] {\rotate[\c!rotation=180]{\iota}} - \definemathcommand [unic@kelvinsign] {{\tf K}} - \definemathcommand [unic@angstromsign] {\Angstrom} - \definemathcommand [unic@scriptB] {{\cal B}} - \definemathcommand [unic@blackletterC] {{\fraktur C}} - \definemathcommand [unic@estimatedsymbol] {\unknownchar} - \definemathcommand [unic@scripte] {\unknownchar} - \definemathcommand [unic@scriptE] {{\cal E}} - \definemathcommand [unic@scriptF] {{\cal F}} - \definemathcommand [unic@turnedF] {\rotate[\c!rotation=180]{{\tf F}}} - \definemathcommand [unic@scriptM] {{\cal M}} - \definemathcommand [unic@scripto] {\unknownchar} - - \definemathcommand [unic@informationsource] {{\bf i}} - \definemathcommand [unic@rotatedQ] {\rotate[\c!rotation=90]{{\tf Q}}} - \definemathcommand [unic@facsimilesign] {\unknownchar} - \definemathcommand [unic@doublestruckpi] {\pi}%{\unknownchar} - \definemathcommand [unic@doublestruckgamma] {\gamma}%{\unknownchar} - \definemathcommand [unic@doublestruckGamma] {\Gamma}%{\unknownchar} - \definemathcommand [unic@doublestruckPi] {\Pi}%{\unknownchar} - \definemathcommand [unic@doublestrucknarysummation] {\unknownchar} - \definemathcommand [unic@turnedsansserifG] {\rotate[\c!rotation=180]{{\ss G}}} - \definemathcommand [unic@turnedsansserifL] {\rotate[\c!rotation=180]{{\ss L}}} - \definemathcommand [unic@reversedsansserifL] {\mirror{{\ss L}}} - \definemathcommand [unic@turnedsansserifY] {\rotate[\c!rotation=180]{{\ss Y}}} - \definemathcommand [unic@doublestruckitalicD] {D}%{\unknownchar} - \definemathcommand [unic@doublestruckitalicd] {d}%{\unknownchar} - \definemathcommand [unic@doublestruckitalice] {e}%{\unknownchar} - \definemathcommand [unic@doublestruckitalici] {i}%{\unknownchar} - \definemathcommand [unic@doublestruckitalicj] {j}%{\unknownchar} - \definemathcommand [unic@propertyline] {\unknownchar} - \definemathcommand [unic@turnedampersand] {\rotate[\c!rotation=180]{\&}} - \definemathcommand [unic@persign] {\unknownchar} - - \definemathcommand [unic@fractiononethird] {\vulgarfraction{1}{3}} - \definemathcommand [unic@fractiontwothirds] {\vulgarfraction{2}{3}} - \definemathcommand [unic@fractiononefifth] {\vulgarfraction{1}{5}} - \definemathcommand [unic@fractiontwofifths] {\vulgarfraction{2}{5}} - \definemathcommand [unic@fractionthreefifths] {\vulgarfraction{3}{5}} - \definemathcommand [unic@fractionfourfifths] {\vulgarfraction{4}{5}} - \definemathcommand [unic@fractiononesixth] {\vulgarfraction{1}{6}} - \definemathcommand [unic@fractionfivesixths] {\vulgarfraction{5}{6}} - \definemathcommand [unic@fractiononeeighth] {\vulgarfraction{1}{8}} - \definemathcommand [unic@fractionthreeeighths] {\vulgarfraction{3}{8}} - \definemathcommand [unic@fractionfiveeighths] {\vulgarfraction{5}{8}} - \definemathcommand [unic@fractionseveneighths] {\vulgarfraction{7}{8}} - \definemathcommand [unic@fractionnumeratorone] {\vulgarfraction{1}{}} - \definemathcommand [unic@romannumeralOne] {{\tf I}} - \definemathcommand [unic@romannumeralTwo] {{\tf II}} - \definemathcommand [unic@romannumeralThree] {{\tf III}} - \definemathcommand [unic@romannumeralFour] {{\tf IV}} - \definemathcommand [unic@romannumeralFive] {{\tf V}} - \definemathcommand [unic@romannumeralSix] {{\tf VI}} - \definemathcommand [unic@romannumeralSeven] {{\tf VII}} - \definemathcommand [unic@romannumeralEight] {{\tf VIII}} - \definemathcommand [unic@romannumeralNine] {{\tf IX}} - \definemathcommand [unic@romannumeralTen] {{\tf X}} - \definemathcommand [unic@romannumeralEleven] {{\tf XI}} - \definemathcommand [unic@romannumeralTwelve] {{\tf XII}} - \definemathcommand [unic@romannumeralFifty] {{\tf L}} - \definemathcommand [unic@romannumeralOnehundred] {{\tf C}} - \definemathcommand [unic@romannumeralFivehundred] {{\tf D}} - \definemathcommand [unic@romannumeralOnethousand] {{\tf M}} - \definemathcommand [unic@romannumeralone] {{\tf i}} - \definemathcommand [unic@romannumeraltwo] {{\tf ii}} - \definemathcommand [unic@romannumeralthree] {{\tf iii}} - \definemathcommand [unic@romannumeralfour] {{\tf iv}} - \definemathcommand [unic@romannumeralfive] {{\tf v}} - \definemathcommand [unic@romannumeralsix] {{\tf vi}} - \definemathcommand [unic@romannumeralseven] {{\tf vii}} - \definemathcommand [unic@romannumeraleight] {{\tf viii}} - \definemathcommand [unic@romannumeralnine] {{\tf ix}} - \definemathcommand [unic@romannumeralten] {{\tf x}} - \definemathcommand [unic@romannumeraleleven] {{\tf xi}} - \definemathcommand [unic@romannumeraltwelve] {{\tf xii}} - \definemathcommand [unic@romannumeralfifty] {{\tf l}} - \definemathcommand [unic@romannumeralonehundred] {{\tf c}} - \definemathcommand [unic@romannumeralfivehundred] {{\tf d}} - \definemathcommand [unic@romannumeralonethousand] {{\tf m}} - \definemathcommand [unic@romannumeralonethousandCD] {\unknownchar} - \definemathcommand [unic@romannumeralfivethousand] {\unknownchar} - \definemathcommand [unic@romannumeraltenthousand] {\unknownchar} - \definemathcommand [unic@romannumeralreversedonehundred] {\mirror{C}} - -\stopmathcollection - -% needed for unic-033 % NW - -\startmathcollection[default] - - \definemathcommand [unic@leftarrowtobar] {\mapstochar\leftarrow} - -\stopmathcollection - -% needed for unic-034 % NW - -\startmathcollection[default] - - \definemathcommand [unic@in] {\in} - \definemathcommand [unic@nin] {\not\in} - \definemathcommand [unic@nni] {\not\ni} - \definemathcommand [unic@minus] {-} - \definemathcommand [unic@divisionslash] {/} - \definemathcommand [unic@sqrt] {\sqrt{}} - \definemathcommand [unic@cubesqrt] {\root 3 \of {}} - \definemathcommand [unic@fourthsqrt] {\root 4 \of {}} - \definemathcommand [unic@divides] [op] {|} % TODO - \definemathcommand [unic@ndivides] [rel] {\mathop{\not|}} % TODO: horrible - \definemathcommand [unic@cap] {\cap} - \definemathcommand [unic@dblint] {\int\!\!\!\int} - \definemathcommand [unic@triint] {\int\!\!\!\int\!\!\!\int} - \definemathcommand [unic@ratio] [rel] {:} - \definemathcommand [unic@proportion] [rel] {::} - \definemathcommand [unic@excess] [op] {-\!\!:} - \definemathcommand [unic@geomprop] [op] {:\!\!\!-\!\!\!:} - \definemathcommand [unic@homothetic] [op] {\sim\!\!\!:} - \definemathcommand [unic@nsimeq] {\not\simeq} - \definemathcommand [unic@cong] {\cong} - \definemathcommand [unic@napproxeq] {\not\approxeq} - \definemathcommand [unic@napprox] {\not\approx} - \definemathcommand [unic@doteq] {\doteq} - \definemathcommand [unic@correspondsto] {\buildrel \frown \over =} - \definemathcommand [unic@estimates] {\buildrel \wedge \over =} - \definemathcommand [unic@equiangularto] {\buildrel \vee \over =} - \definemathcommand [unic@stareq] {\buildrel \star \over =} - \definemathcommand [unic@eqbydef] {\buildrel \rm def \over =} - \definemathcommand [unic@measuredby] {\buildrel \rm m \over =} - \definemathcommand [unic@questionedeq] {\buildrel \rm ? \over =} - \definemathcommand [unic@nequiv] {\not\equiv} - \definemathcommand [unic@nasymp] {\not\asymp} - \definemathcommand [unic@nlesssim] {\not\lesssim} - \definemathcommand [unic@ngtrsim] {\not\gtrsim} - \definemathcommand [unic@nlessgtr] {\not\lessgtr} - \definemathcommand [unic@ngtrless] {\not\gtrless} - \definemathcommand [unic@nsubset] {\not\subset} - \definemathcommand [unic@nsupset] {\not\supset} - \definemathcommand [unic@nsqsubseteq] {\not\sqsubseteq} - \definemathcommand [unic@nsqsupseteq] {\not\sqsupseteq} - -\stopmathcollection - -% needed for unic-039 % NW - -\startmathcollection[default] - - \definemathcommand [unic@Lbracket] [open] {[\![} - \definemathcommand [unic@Rbracket] [close] {]\!]} - \definemathcommand [unic@Langle] [open] {\langle\!\langle} - \definemathcommand [unic@Rangle] [close] {\rangle\!\rangle} - -\stopmathcollection - -\protect \endinput diff --git a/tex/context/base/math-vfu.lua b/tex/context/base/math-vfu.lua index 35d18d77a..0e06d3757 100644 --- a/tex/context/base/math-vfu.lua +++ b/tex/context/base/math-vfu.lua @@ -240,6 +240,8 @@ function fonts.basecopy(tfmtable) return t end +local reported = { } + function fonts.vf.math.define(specification,set) if not reverse then reverse = { } @@ -335,9 +337,16 @@ function fonts.vf.math.define(specification,set) for unicode, index in next, vector do local fci = fc[index] if not fci then - -- if trace_virtual then - logs.report("math virtual", "unicode point U+%04X has no index %04X in %s",unicode,index,vectorname) - -- end + local fontname = fs.name + local rf = reported[fontname] + if not rf then rf = { } reported[fontname] = rf end + local rv = rf[vectorname] + if not rv then rv = { } rf[vectorname] = rv end + local ru = rv[unicode] + if not ru then + logs.report("math virtual", "unicode point U+%05X has no index %04X in vector %s for font %s",unicode,index,vectorname,fontname) + rv[unicode] = true + end else local ref = si[index] if not ref then @@ -503,6 +512,7 @@ function fonts.vf.math.define(specification,set) main.has_italic = true main.type = "virtual" -- not needed mathematics.scaleparameters(main,main,1) +main.nomath = false return main end @@ -1327,8 +1337,8 @@ mathematics.make_font ( "lmroman6-math", { { name = "lmmib5.tfm", vector = "tex-bi", skewchar=0x7F } , { name = "lmsans8-regular.otf", vector = "tex-ss", optional=true }, { name = "lmmono8-regular.otf", vector = "tex-tt", optional=true }, - { name = "eufm6.tfm", vector = "tex-fraktur", optional=true }, - { name = "eufb6.tfm", vector = "tex-fraktur-bold", optional=true }, + { name = "eufm5.tfm", vector = "tex-fraktur", optional=true }, + { name = "eufb5.tfm", vector = "tex-fraktur-bold", optional=true }, } ) -- rm-lmr7 : LMMathRoman7-Regular @@ -1373,8 +1383,8 @@ mathematics.make_font ( "lmroman8-math", { { name = "lmmib7.tfm", vector = "tex-bi", skewchar=0x7F } , { name = "lmsans8-regular.otf", vector = "tex-ss", optional=true }, { name = "lmmono8-regular.otf", vector = "tex-tt", optional=true }, - { name = "eufm8.tfm", vector = "tex-fraktur", optional=true }, - { name = "eufb8.tfm", vector = "tex-fraktur-bold", optional=true }, + { name = "eufm7.tfm", vector = "tex-fraktur", optional=true }, + { name = "eufb7.tfm", vector = "tex-fraktur-bold", optional=true }, } ) -- rm-lmr9 : LMMathRoman9-Regular @@ -1395,8 +1405,8 @@ mathematics.make_font ( "lmroman9-math", { { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } , { name = "lmsans9-regular.otf", vector = "tex-ss", optional=true }, { name = "lmmono9-regular.otf", vector = "tex-tt", optional=true }, - { name = "eufm9.tfm", vector = "tex-fraktur", optional=true }, - { name = "eufb9.tfm", vector = "tex-fraktur-bold", optional=true }, + { name = "eufm10.tfm", vector = "tex-fraktur", optional=true }, + { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true }, } ) -- rm-lmr10 : LMMathRoman10-Regular @@ -1424,6 +1434,24 @@ mathematics.make_font ( "lmroman10-math", { { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true }, } ) +mathematics.make_font ( "lmroman10-boldmath", { + { name = "lmroman10-bold.otf", features = "virtualmath", main = true }, + -- { name = "rm-lmr10.tfm", vector = "tex-mr" } , + { name = "lmmib10.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "lmbsy10.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } , + { name = "lmex10.tfm", vector = "tex-ex", extension = true } , +-- copied from roman: + { name = "msam10.tfm", vector = "tex-ma" }, + { name = "msbm10.tfm", vector = "tex-mb" }, + -- { name = "rm-lmbx10.tfm", vector = "tex-bf" } , + { name = "lmroman10-bold.otf", "tex-bf" } , + { name = "lmmib10.tfm", vector = "tex-bi", skewchar=0x7F } , + { name = "lmsans10-regular.otf", vector = "tex-ss", optional=true }, + { name = "lmmono10-regular.otf", vector = "tex-tt", optional=true }, + { name = "eufm10.tfm", vector = "tex-fraktur", optional=true }, + { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional=true }, +} ) + -- rm-lmr12 : LMMathRoman12-Regular -- rm-lmbx12 : LMMathRoman12-Bold -- lmmi12 : LMMathItalic12-Italic @@ -1468,8 +1496,8 @@ mathematics.make_font ( "lmroman17-math", { mathematics.make_font ( "px-math", { { name = "texgyrepagella-regular.otf", features = "virtualmath", main = true }, - { name = "pxr.tfm", vector = "tex-mr" } , - { name = "pxmi.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "rpxr.tfm", vector = "tex-mr" } , + { name = "rpxmi.tfm", vector = "tex-mi", skewchar=0x7F }, { name = "pxsy.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } , { name = "pxex.tfm", vector = "tex-ex", extension = true } , { name = "pxsya.tfm", vector = "tex-ma" }, @@ -1478,8 +1506,8 @@ mathematics.make_font ( "px-math", { mathematics.make_font ( "tx-math", { { name = "texgyretermes-regular.otf", features = "virtualmath", main = true }, - { name = "txr.tfm", vector = "tex-mr" } , - { name = "txmi.tfm", vector = "tex-mi", skewchar=0x7F }, + { name = "rtxr.tfm", vector = "tex-mr" } , + { name = "rtxmi.tfm", vector = "tex-mi", skewchar=0x7F }, { name = "txsy.tfm", vector = "tex-sy", skewchar=0x30, parameters = true } , { name = "txex.tfm", vector = "tex-ex", extension = true } , { name = "txsya.tfm", vector = "tex-ma" }, diff --git a/tex/context/base/meta-ini.mkii b/tex/context/base/meta-ini.mkii index ee7e8a38b..f9d097049 100644 --- a/tex/context/base/meta-ini.mkii +++ b/tex/context/base/meta-ini.mkii @@ -20,22 +20,6 @@ \unprotect -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - %D This module extends the functionality of the support module %D \type {supp-mps}, the module that is responsible for %D \METAPOST\ inclusion in \CONTEXT. Some basic macros will be @@ -151,6 +135,19 @@ \def\MPrawvar#1#2{\csname#1:#2\endcsname} +\def\presetMPvariable + {\dodoubleargument\dopresetMPvariable} + +\def\dopresetMPvariable[#1][#2=#3]% + {\doifundefined{#1:#2}{\setvalue{#1:#2}{#3}}} + +\def\useMPvariables + {\dodoubleargument\douseMPvariables} + +\def\douseMPvariables[#1][#2]% + {\def\@@meta{#1:}% + \prepareMPvariables{#2}} + %D \macros %D {startuniqueMPgraphic, uniqueMPgraphic} %D diff --git a/tex/context/base/meta-ini.mkiv b/tex/context/base/meta-ini.mkiv index 0e0adc54f..042f7247e 100644 --- a/tex/context/base/meta-ini.mkiv +++ b/tex/context/base/meta-ini.mkiv @@ -74,10 +74,6 @@ {\doifnot{#1}{+}{\global\MPuserinclusions\emptytoks}% \global\MPuserinclusions\expandafter{\the\MPuserinclusions#2}} -% \ifx \overlaywidth \undefined \def \overlaywidth {4cm} \fi -% \ifx \overlayheight \undefined \def \overlayheight {3cm} \fi -% \ifx \overlaylinewidth \undefined \def \overlaylinewidth {0pt} \fi - \def\presetMPdefinitions {\edef\overlaywidth {\overlaywidth \space}% \edef\overlayheight {\overlayheight \space}% @@ -87,53 +83,6 @@ \def\currentMPformat{metafun} -% todo: -% -% \splitMPgraphicname[a::b] (\currentMPgraphicformat,\currentMPgraphicname) -% \splitMPgraphicname[a] (\currentMPgraphicformat,\currentMPgraphicname) -% \splitMPgraphicname[a::b::c] (\currentMPgraphicformat,\currentMPgraphicname) -% -% \resetMPformat[extrafun] -% -% MPinclusions etc only for metafun, randomseed for all -% -% todo: \resetMPformat[instance] -> unload and nil -% todo: geen page stats -% todo: textext in plain mp - -% \startMPdefinitions{metafun} -% color MyColor ; MyColor = red ; -% \stopMPdefinitions -% \startuseMPgraphic{test1} -% fill fullcircle scaled 1cm withcolor MyColor ; -% \stopuseMPgraphic -% \startuseMPgraphic{test2} -% color MyColor ; MyColor = green ; -% fill fullcircle scaled 1cm withcolor MyColor ; -% \stopuseMPgraphic -% \startuseMPgraphic{test3} -% fill fullcircle scaled 1cm withcolor MyColor ; -% \stopuseMPgraphic -% \startuseMPgraphic{test4} -% color MyColor ; MyColor = blue ; -% \stopuseMPgraphic -% -% \useMPgraphic{metafun::test1} -% \useMPgraphic{metafun::test2} -% \useMPgraphic{metafun::test3} -% \useMPgraphic{extrafun::test4} -% \useMPgraphic{extrafun::test3} -% \useMPgraphic{metafun::test3} -% \useMPgraphic{nofun::test4} -% \useMPgraphic{nofun::test3} -% -% \startMPcode -% fill fullsquare scaled 1cm ; -% \stopMPcode -% \startMPcode{metafun} -% fill fullsquare scaled 1cm withcolor MyColor ; -% \stopMPcode - \def\@@MPF{@MPF@} \def\MPinstancetoks{\csname\@@MPF::\currentMPgraphicinstance\endcsname} @@ -180,40 +129,13 @@ \def\endMPgraphicgroup {\endgroup} -% - \newconditional \METAFUNinitialized \def\MPaskedfigure{false} -% maybe we need to force black, i.e. fake nodes - -\long\def\processMPgraphic#1% todo: extensions and inclusions outside beginfig - {\begingroup - \enableincludeMPgraphics - \the\everyMPgraphic - \presetMPdefinitions - \setMPrandomseed % this has to change - % we need to preexpand the token lists - \setbox\MPgraphicbox\hbox\bgroup - \ctxlua{metapost.graphic("\currentMPformat", "\currentMPformat", - \@EA\!!bs\the\MPinitializations;\theMPrandomseed;#1;\!!es, % code - \@EA\@EA\@EA\!!bs\@EA\the\@EA\MPextensions\@EA;\the\MPuserinclusions;\!!es, % optional preamble - \MPaskedfigure - )}% - \global\settrue\METAFUNinitialized - \global\MPextensions\emptytoks - \global\MPuserinclusions\emptytoks - \egroup - \placeMPgraphic - \endgroup} - -% ! ! ! ! begin temporary ! ! ! ! - -\let\normalprocessMPgraphic\processMPgraphic - \long\def\processMPgraphic#1% todo: extensions and inclusions outside beginfig {\begingroup % needed? +\forgetall \enableincludeMPgraphics \the\everyMPgraphic \presetMPdefinitions @@ -223,7 +145,7 @@ {\settrue\includeMPextensions\letgvalue{\@@MPF\currentMPgraphicinstance\s!extensions}\v!no} {\setfalse\includeMPextensions}% \doifelsevalue{\@@MPF\currentMPgraphicinstance\s!initializations}\v!yes - {\settrue\includeMPinitializations}% \letgvalue{\@@MPF\currentMPgraphicinstance\s!initializations}\v!no} + {\settrue\includeMPinitializations }% {\setfalse\includeMPinitializations}% \setbox\MPgraphicbox\hbox\bgroup \normalexpanded{\noexpand\ctxlua{metapost.graphic("\currentMPgraphicinstance", "\currentMPgraphicformat", @@ -234,18 +156,9 @@ \egroup \global\MPinstancetoks\emptytoks \global\settrue\METAFUNinitialized % becomes obsolete - %\global\MPextensions\emptytoks % multipls instances - %\global\MPuserinclusions\emptytoks % multipls instances \placeMPgraphic \endgroup} -\let\extendedprocessMPgraphic\processMPgraphic - -% \let\processMPgraphic\normalprocessMPgraphic -\let\processMPgraphic\extendedprocessMPgraphic - -% ! ! ! ! end temporary ! ! ! ! - \newif\ifsetMPrandomseed \setMPrandomseedtrue % false by default \def\setMPrandomseed @@ -286,25 +199,6 @@ \def\getMPdrawing{\dosinglegroupempty\dogetMPdrawing} -% \def\nodogetMPdrawing#1% -% {\ifMPdrawingdone -% \expandafter\processMPgraphic\expandafter{\MPdrawingdata}% -% \fi} -% -% \def\dostartMPcode -% {\iffirstargument -% \expandafter\dodogetMPdrawing -% \else -% \expandafter\nodogetMPdrawing -% \fi} -% -% \def\dodogetMPdrawing#1% -% {\ifMPdrawingdone -% \beginMPgraphicgroup{#1::\s!dummy}% name does not matter -% \expandafter\processMPgraphic\expandafter{\MPdrawingdata}% -% \endMPgraphicgroup -% \fi} - \def\startMPdrawing {\dosingleempty\dostartMPdrawing} @@ -395,14 +289,6 @@ defaultfont:="rm-lmtt10"; \stopMPinitializations -%D In order to support fancy text features (like outline -%D fonts), we set: - -% \startMPextensions -% graphictextformat:="context"; -% graphictextdirective "\the\everyMPTEXgraphic"; -% \stopMPextensions - %D A signal that we're in combines \CONTEXT||\METAFUN mode: \startMPextensions @@ -423,16 +309,6 @@ \prependtoks \MPstaticgraphictrue \to \everyoverlay \prependtoks \MPstaticgraphictrue \to \everypagebody -% %D We save the number of graphics for the sake of \TEXEXEC. -% -% \newcounter\totalnofMPgraphics -% -% \def\thenofMPgraphics{\the\nofMPgraphics} % from supp-mps -% -% \appendtoks -% \savecurrentvalue\totalnofMPgraphics\thenofMPgraphics -% \to \everybye - %D \macros %D {setupMPvariables} %D @@ -472,6 +348,19 @@ \def\MPrawvar#1#2{\csname#1:#2\endcsname} +\def\presetMPvariable + {\dodoubleargument\dopresetMPvariable} + +\def\dopresetMPvariable[#1][#2=#3]% + {\ifcsname#1:#2\endcsname\else\setvalue{#1:#2}{#3}\fi} + +\def\useMPvariables + {\dodoubleargument\douseMPvariables} + +\def\douseMPvariables[#1][#2]% + {\def\@@meta{#1:}% + \prepareMPvariables{#2}} + %D \macros %D {startuniqueMPgraphic, uniqueMPgraphic} %D @@ -510,7 +399,6 @@ \newcount\MPobjectcounter \newbox \MPgraphicbox -%newif \ifMPshiftdrawing \MPshiftdrawingfalse \chardef\MPboxmode\zerocount @@ -555,7 +443,7 @@ \extendMPoverlaystamp{#2}% incl prepare \ifcsname\@@MPG\overlaystamp:#1\endcsname\else \enableincludeMPgraphics - \forgetall +% \forgetall \global\advance\MPobjectcounter\plusone \setobject{MP}{\number\MPobjectcounter}\hbox{\processMPgraphic{#3}}% was vbox, graphic must end up as hbox \setxvalue{\@@MPG\overlaystamp:#1}{\noexpand\reuseMPbox{\number\MPobjectcounter}{\MPllx}{\MPlly}{\MPurx}{\MPury}}% @@ -582,7 +470,7 @@ \long\def\handleuseMPgraphic#1#2#3% {\begingroup - \forgetall % check this +% \forgetall % check this \def\@@meta{#1:}% \prepareMPvariables{#2}% \enableincludeMPgraphics @@ -810,25 +698,6 @@ %D A more general way of passing environments is: -% \def\startMPenvironment % second arg gobbles spaces, so that reset gives \emptytoks -% {\bgroup -% \catcode`\^^M=\@@space -% \dodoubleempty\dostartMPenvironment} - -% \long\def\dostartMPenvironment[#1][#2]#3\stopMPenvironment -% {\egroup -% \doif{#1}\s!reset\resetMPenvironment % reset mp toks -% \doif{#1}\v!global{#3}% % use in main doc too -% \doif{#1}+{#3}% % use in main doc too -% \defconvertedargument\ascii{#3}% -% \expandafter\appendtoks\ascii\to\everyMPTEXgraphic} - -% \def\resetMPenvironment -% {\everyMPTEXgraphic\emptytoks % = is really needed ! -% \startMPenvironment -% \global\loadfontfileoncetrue -% \stopMPenvironment} - \def\startMPenvironment % second arg gobbles spaces, so that reset gives \emptytoks {\dodoubleempty\dostartMPenvironment} @@ -846,8 +715,6 @@ \def\useMPenvironmentbuffer[#1]% {\ctxlua{metapost.tex.set(buffers.content("#1"))}} -% \useMPenvironmentbuffer[mp] % hm, what is this? - %D This command takes \type {[reset]} as optional %D argument. %D @@ -892,20 +759,6 @@ \let\MPruninstance\defaultMPgraphicinstance -% \def\useMPrun#1#2% name n -% {\begingroup -% \def\MPaskedfigure{#2}% -% \doifelsenothing{#1} -% {\useMPgraphic{\MPruninstance::mprun}}% -% {\useMPgraphic{\MPruninstance::#1}}% -% \endgroup} -% \def\startMPrun -% {\dosinglegroupempty\dostartMPrun} -% \long\def\dostartMPrun#1#2\stopMPrun -% {\edef\MPruninstance{\iffirstargument#1\else\defaultMPgraphicinstance\fi}% -% \startuseMPgraphic{mprun}#2\stopuseMPgraphic} - - \def\useMPrun#1#2% name n {\begingroup \def\MPaskedfigure{#2}% @@ -1087,22 +940,11 @@ \let \} \letterclosebrace \to \everyMPgraphic -%D Alas, the prologue settings differ per driver. - -\ifx\undefined\MPprologues \def\MPprologues{0} \fi - -% hm, not needed more than once so can be extensions - \startMPinitializations - prologues:=\MPprologues; + prologues:=0; mpprocset:=1; \stopMPinitializations -\appendtoks - \def\MPprologues{0}% - \def\MPOSTdriver{dvips}% -\to \everyresetspecials - %D \macros %D {PDFMPformoffset} %D @@ -1112,63 +954,68 @@ \def\PDFMPformoffset{\objectoffset} -%D \macros -%D {insertMPfile} -%D -%D Bypassing the special driver and figure mechanism is not -%D that nice but saves upto 5\% time in embedding \METAPOST\ -%D graphics by using the low level \PDF\ converter directly, -%D given of course that we use \PDFTEX. As a result we need to -%D fool around with the object trigger. +% %D \macros +% %D {insertMPfile} +% %D +% %D Bypassing the special driver and figure mechanism is not +% %D that nice but saves upto 5\% time in embedding \METAPOST\ +% %D graphics by using the low level \PDF\ converter directly, +% %D given of course that we use \PDFTEX. As a result we need to +% %D fool around with the object trigger. \newtoks\everyinsertMPfile -\let\insertMPfileARG\insertMPfile - -\def\insertMPfile#1#2% in context #2 is empty - {\doifelsenothing{#2}{\doinsertMPfile{#1}}{\insertMPfileARG{#1}{#2}}} - -\def\includeMPasEPS#1% untested !! - {\bgroup - \message{[MP as EPS #1]}% - \the\everyinsertMPfile - \dogetEPSboundingbox{#1}\!!widtha\!!heighta\!!widthb\!!heightb - \setbox\scratchbox\vbox to \!!heightb - {\vfill - \let \@@DriverImageType \c!mps - \def \@@DriverImageFile {#1}% - \edef\@@DriverImageWidth {\the\!!widthb }% - \edef\@@DriverImageHeight{\the\!!heightb}% - \doinsertfile}% - \wd\scratchbox\!!widthb - \dp\scratchbox\zeropoint - \box\scratchbox - \egroup} - -\def\includeMPasPDF#1% - {\bgroup - \the\everyinsertMPfile - \ifinobject \else \chardef\makeMPintoPDFobject\plustwo \fi % when needed - \convertMPtoPDF{#1}{1}{1}% no \plusone ! - \egroup} - -%D So, using a low level approach (thereby avoiding the slower -%D figure analysis macros) pays off. This kind of -%D optimizations are a bit tricky since we must make sure that -%D special resources end up in the (PDF) files. Because the -%D \METAPOST\ to \PDF\ can handle objects itself, it is not -%D that complicated. - -%D We hook a couple of initializations into the graphic -%D macros. - -\appendtoks - \let\figuretypes\c!mps - \runutilityfilefalse - \consultutilityfilefalse -\to \everyinsertMPfile - -%D One more: (still needed?) +% removed in backend: +% +% \def\doinsertMPfile#1% +% {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}} +% +% \let\insertMPfileARG\insertMPfile +% +% \def\insertMPfile#1#2% in context #2 is empty +% {\doifelsenothing{#2}{\doinsertMPfile{#1}}{\insertMPfileARG{#1}{#2}}} +% +% \def\includeMPasEPS#1% untested !! +% {\bgroup +% \message{[MP as EPS #1]}% +% \the\everyinsertMPfile +% \dogetEPSboundingbox{#1}\!!widtha\!!heighta\!!widthb\!!heightb +% \setbox\scratchbox\vbox to \!!heightb +% {\vfill +% \let \@@DriverImageType \c!mps +% \def \@@DriverImageFile {#1}% +% \edef\@@DriverImageWidth {\the\!!widthb }% +% \edef\@@DriverImageHeight{\the\!!heightb}% +% \doinsertfile}% +% \wd\scratchbox\!!widthb +% \dp\scratchbox\zeropoint +% \box\scratchbox +% \egroup} +% +% \def\includeMPasPDF#1% +% {\bgroup +% \the\everyinsertMPfile +% \ifinobject \else \chardef\makeMPintoPDFobject\plustwo \fi % when needed +% \convertMPtoPDF{#1}{1}{1}% no \plusone ! +% \egroup} +% +% %D So, using a low level approach (thereby avoiding the slower +% %D figure analysis macros) pays off. This kind of +% %D optimizations are a bit tricky since we must make sure that +% %D special resources end up in the (PDF) files. Because the +% %D \METAPOST\ to \PDF\ can handle objects itself, it is not +% %D that complicated. +% +% %D We hook a couple of initializations into the graphic +% %D macros. +% +% \appendtoks +% \let\figuretypes\c!mps +% \runutilityfilefalse +% \consultutilityfilefalse +% \to \everyinsertMPfile +% +% %D One more: (still needed?) \startMPextensions def initialize_form_numbers = @@ -1343,12 +1190,6 @@ _special_div_ := 1000\ifconditional\manyMPspecials0\fi ; \to \MPextensions -%D Needed (will become default): - -\prependtoks - \resetlanguagespecifics -\to \everyMPgraphic - %D Needed too. \let\initializeMPgraphics\relax @@ -1395,8 +1236,11 @@ \chardef\MPcolormethod\zerocount +% can be faster, just + \appendtoks - \ctxlua{metapost.set_outer_color(\number\MPcolormethod,"\PDFcolor{\currentcolorname}","")}% +% \ctxlua{metapost.set_outer_color(\number\MPcolormethod,"\PDFcolor{\currentcolorname}","")}% + \ctxlua{metapost.set_outer_color(\number\MPcolormethod,\number\currentcolormodel,\number\dogetattribute{color},\number\dogetattribute{transparency})}% \to \everyMPgraphic \startMPinitializations diff --git a/tex/context/base/meta-pag.mkii b/tex/context/base/meta-pag.mkii new file mode 100644 index 000000000..000e56a2e --- /dev/null +++ b/tex/context/base/meta-pag.mkii @@ -0,0 +1,226 @@ +%D \module +%D [ file=meta-pag, +%D version=1999.07.10, +%D title=\METAPOST\ Graphics, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 These definitions used to be part of the old \type +%D {core-mps} file, later changed into \type {meta-ini}, but +%D keeping them separate is cleaner. + +\writestatus{loading}{MetaPost Graphics / Page Data Management} + +\unprotect + +\startMPextensions + if unknown context_page: input mp-page; fi; +\stopMPextensions + +%D The next few macros tell \METAPOST\ how the \CONTEXT\ +%D pagebody looks. + +\startMPextensions + boolean PageStateAvailable,OnRightPage,InPageBody; + PageStateAvailable:=true; +\stopMPextensions + +\startMPinitializations + OnRightPage:=true; + InPageBody:=\ifinpagebody true \else false \fi; +\stopMPinitializations + +\startMPinitializations + def LoadPageState = + OnRightPage:=\MPonrightpage; + OnOddPage:=\MPonoddpage; + RealPageNumber:=\the\realpageno; + PageNumber:=\the\pageno; + NOfPages:=\lastpage; + PaperHeight:=\the\paperheight; + PaperWidth:=\the\paperwidth; + PrintPaperHeight:=\the\printpaperheight; + PrintPaperWidth:=\the\printpaperwidth; + TopSpace:=\the\topspace; + BottomSpace:=\the\bottomspace; + BackSpace:=\the\backspace; + CutSpace:=\the\cutspace; + MakeupHeight:=\the\makeupheight; + MakeupWidth:=\the\makeupwidth; + TopHeight:=\the\topheight; + TopDistance:=\the\topdistance; + HeaderHeight:=\the\headerheight; + HeaderDistance:=\the\headerdistance; + TextHeight:=\the\textheight; + FooterDistance:=\the\footerdistance; + FooterHeight:=\the\footerheight; + BottomDistance:=\the\bottomdistance; + BottomHeight:=\the\bottomheight; + LeftEdgeWidth:=\the\leftedgewidth; + LeftEdgeDistance:=\the\leftedgedistance; + LeftMarginWidth:=\the\leftmarginwidth; + LeftMarginDistance:=\the\leftmargindistance; + TextWidth:=\the\textwidth ; + RightMarginDistance:=\the\rightmargindistance; + RightMarginWidth:=\the\rightmarginwidth; + RightEdgeDistance:=\the\rightedgedistance; + RightEdgeWidth:=\the\rightedgewidth; + InnerMarginDistance:=\the\innermargindistance; + InnerMarginWidth:=\the\innermarginwidth; + OuterMarginDistance:=\the\outermargindistance; + OuterMarginWidth:=\the\outermarginwidth; + InnerEdgeDistance:=\the\inneredgedistance; + InnerEdgeWidth:=\the\inneredgewidth; + OuterEdgeDistance:=\the\outeredgedistance; + OuterEdgeWidth:=\the\outeredgewidth; + PageOffset:=\the\pageoffset; + PageDepth:=\the\pagedepth; + LayoutColumns:=\the\layoutcolumns; + LayoutColumnDistance:=\the\layoutcolumndistance; + LayoutColumnWidth:=\the\layoutcolumnwidth; + enddef; +\stopMPinitializations + +\def\MPonrightpage{true} +\def\MPonoddpage {true} + +\def\freezeMPpagelayout + {\doifbothsides + {\def\MPonrightpage{true}} + {\def\MPonrightpage{true}} + {\def\MPonrightpage{false}}% + \edef\MPonoddpage{\doifoddpageelse{true}{false}}} + +\let\freezeMPlayout\relax % obsolete + +%D We need to freeze the pagelayout before the backgrounds +%D are build, because the overlay will temporarily become +%D zero (overlay). + +\appendtoks + \freezeMPpagelayout +\to \everybeforepagebody + +%D By freezing these value every graphic, we can use layout +%D variables that change halfways a page, whatever use that +%D has. + +\prependtoks + \calculatereducedvsizes % this is really needed + \freezeMPpagelayout + \freezeMPlayout % to be used grouped +\to \everyMPgraphic + +%D The next feature provides information about for instance +%D column positions. This is an experimental feature, +%D introduced when we needed backgrounds in columns (fill||in +%D questions as implemented in a private module). +%D +%D See \type {mp-page.mp} for the definition of the macros: +%D +%D \starttabulate[|tl|l|p|] +%D \NC ResetTextAreas \NC no arguments \NC +%D reset areas on page \NC \NR +%D \NC RegisterTextArea \NC x, y, w, h \NC +%D adds area to the list \NC \NR +%D \NC TextAreaX,Y,W,H,XY,WH \NC x and/or y \NC +%D reports offsets and dimensions \NC \NR +%D \stoptabulate +%D +%D The \type {TextArea*} macros can be used to determine +%D overlap. + +\newcount\currentMPtextareadata + +\newtoks\MPsavedtextareadata +\newtoks\MPtextareadata +\newtoks\MPlocaltextareadata + +% optimaliseren voor herhaling + +\def\registerMPtextarea#1% + {\ifpositioning + \bgroup + \global\advance\currentMPtextareadata\plusone + %\hpos{gbd:\the\currentMPtextareadata}{#1}% + \hpos{gbd:\the\currentMPtextareadata}% + {\iftracetextareas\boxrulewidth1.5pt\ruledhbox\fi{#1}}% + \edef\!!stringa{gbd:\the\currentMPtextareadata}% + \edef\!!stringa{RegisterTextArea(% + \MPx\!!stringa,\MPy\!!stringa,% + \MPw\!!stringa,\MPh\!!stringa,\MPd\!!stringa);}% + \@EA \doglobal \@EA \appendtoks \!!stringa \to \MPtextareadata + \egroup + \else + \hbox{#1}% + \fi} + +\def\registerMPlocaltextarea#1% + {\ifpositioning + \bgroup + \global\advance\currentMPtextareadata\plusone + %\hpos{gbd:\the\currentMPtextareadata}{#1}% + \hpos{gbd:\the\currentMPtextareadata}% + {\iftracetextareas\boxrulewidth3pt\ruledhbox\fi{#1}}% + \edef\!!stringa{gbd:\the\currentMPtextareadata}% + \edef\!!stringa{RegisterLocalTextArea(% + \MPx\!!stringa,\MPy\!!stringa,% + \MPw\!!stringa,\MPh\!!stringa,\MPd\!!stringa);}% + \global\MPlocaltextareadata\@EA{\!!stringa}% + \egroup + \else + \hbox{#1}% + \fi} + +% better, so that we can force a key and share with e.g. renumbering +% +% \let\namedtextarea\empty +% +% \def\registerMPlocaltextarea#1% +% {\ifpositioning +% \bgroup +% \ifx\namedtextarea\empty +% \global\advance\currentMPtextareadata\plusone +% \edef\namedtextarea{gbd:\the\currentMPtextareadata}% +% \fi +% \hpos\namedtextarea{\iftracetextareas\boxrulewidth3pt\ruledhbox\fi{#1}}% +% \edef\ascii{RegisterLocalTextArea(% +% \MPx\namedtextarea,\MPy\namedtextarea,% +% \MPw\namedtextarea,\MPh\namedtextarea,\MPd\namedtextarea);}% +% \global\MPlocaltextareadata\@EA{\ascii}% +% \egroup +% \else +% \hbox{#1}% +% \fi} + +\def\resetMPlocaltextarea + {\global\MPlocaltextareadata\emptytoks} + +\startMPextensions + path PlainTextArea; +\stopMPextensions + +\startMPinitializations + ResetTextAreas; + \the\MPsavedtextareadata; + SaveTextAreas; + ResetTextAreas; + \the\MPtextareadata; + \the\MPlocaltextareadata; + PlainTextArea:=boundingbox(\MPxy{text:\realfolio}--\MPxy{text:\realfolio} + shifted (\MPw{text:\realfolio},\MPh{text:\realfolio})); +\stopMPinitializations + +\appendtoks + \global\MPsavedtextareadata\MPtextareadata + \global\MPtextareadata \emptytoks + \global\MPlocaltextareadata\emptytoks +\to \everyshipout + +\protect \endinput diff --git a/tex/context/base/meta-pag.mkiv b/tex/context/base/meta-pag.mkiv new file mode 100644 index 000000000..ef3817721 --- /dev/null +++ b/tex/context/base/meta-pag.mkiv @@ -0,0 +1,223 @@ +%D \module +%D [ file=meta-pag, +%D version=1999.07.10, +%D title=\METAPOST\ Graphics, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 These definitions used to be part of the old \type +%D {core-mps} file, later changed into \type {meta-ini}, but +%D keeping them separate is cleaner. + +\writestatus{loading}{MetaPost Graphics / Page Data Management} + +\unprotect + +\startMPextensions + if unknown context_page: input mp-page; fi; +\stopMPextensions + +%D The next few macros tell \METAPOST\ how the \CONTEXT\ +%D pagebody looks. + +\startMPextensions + boolean PageStateAvailable,OnRightPage,InPageBody; + PageStateAvailable:=true; +\stopMPextensions + +\startMPinitializations + OnRightPage:=true; + InPageBody:=\ifinpagebody true \else false \fi; +\stopMPinitializations + +\startMPinitializations + def LoadPageState = + OnRightPage:=\MPonrightpage; + OnOddPage:=\MPonoddpage; + RealPageNumber:=\the\realpageno; + PageNumber:=\the\pageno; + NOfPages:=\lastpage; + PaperHeight:=\the\paperheight; + PaperWidth:=\the\paperwidth; + PrintPaperHeight:=\the\printpaperheight; + PrintPaperWidth:=\the\printpaperwidth; + TopSpace:=\the\topspace; + BottomSpace:=\the\bottomspace; + BackSpace:=\the\backspace; + CutSpace:=\the\cutspace; + MakeupHeight:=\the\makeupheight; + MakeupWidth:=\the\makeupwidth; + TopHeight:=\the\topheight; + TopDistance:=\the\topdistance; + HeaderHeight:=\the\headerheight; + HeaderDistance:=\the\headerdistance; + TextHeight:=\the\textheight; + FooterDistance:=\the\footerdistance; + FooterHeight:=\the\footerheight; + BottomDistance:=\the\bottomdistance; + BottomHeight:=\the\bottomheight; + LeftEdgeWidth:=\the\leftedgewidth; + LeftEdgeDistance:=\the\leftedgedistance; + LeftMarginWidth:=\the\leftmarginwidth; + LeftMarginDistance:=\the\leftmargindistance; + TextWidth:=\the\textwidth ; + RightMarginDistance:=\the\rightmargindistance; + RightMarginWidth:=\the\rightmarginwidth; + RightEdgeDistance:=\the\rightedgedistance; + RightEdgeWidth:=\the\rightedgewidth; + InnerMarginDistance:=\the\innermargindistance; + InnerMarginWidth:=\the\innermarginwidth; + OuterMarginDistance:=\the\outermargindistance; + OuterMarginWidth:=\the\outermarginwidth; + InnerEdgeDistance:=\the\inneredgedistance; + InnerEdgeWidth:=\the\inneredgewidth; + OuterEdgeDistance:=\the\outeredgedistance; + OuterEdgeWidth:=\the\outeredgewidth; + PageOffset:=\the\pageoffset; + PageDepth:=\the\pagedepth; + LayoutColumns:=\the\layoutcolumns; + LayoutColumnDistance:=\the\layoutcolumndistance; + LayoutColumnWidth:=\the\layoutcolumnwidth; + enddef; +\stopMPinitializations + +\def\MPonrightpage{true} +\def\MPonoddpage {true} + +\def\freezeMPpagelayout + {\edef\MPonrightpage{\doifbothsides {tru}{tru}{fals}e}% + \edef\MPonoddpage {\doifoddpageelse {tru}{fals}e}} + +\let\freezeMPlayout\relax % obsolete + +%D We need to freeze the pagelayout before the backgrounds +%D are build, because the overlay will temporarily become +%D zero (overlay). + +\appendtoks + \freezeMPpagelayout +\to \everybeforepagebody + +%D By freezing these value every graphic, we can use layout +%D variables that change halfways a page, whatever use that +%D has. + +\prependtoks + \calculatereducedvsizes % this is really needed + \freezeMPpagelayout + \freezeMPlayout % to be used grouped +\to \everyMPgraphic + +%D The next feature provides information about for instance +%D column positions. This is an experimental feature, +%D introduced when we needed backgrounds in columns (fill||in +%D questions as implemented in a private module). +%D +%D See \type {mp-page.mp} for the definition of the macros: +%D +%D \starttabulate[|tl|l|p|] +%D \NC ResetTextAreas \NC no arguments \NC +%D reset areas on page \NC \NR +%D \NC RegisterTextArea \NC x, y, w, h \NC +%D adds area to the list \NC \NR +%D \NC TextAreaX,Y,W,H,XY,WH \NC x and/or y \NC +%D reports offsets and dimensions \NC \NR +%D \stoptabulate +%D +%D The \type {TextArea*} macros can be used to determine +%D overlap. + +\newcount\currentMPtextareadata + +\newtoks\MPsavedtextareadata +\newtoks\MPtextareadata +\newtoks\MPlocaltextareadata + +% optimaliseren voor herhaling + +\def\registerMPtextarea#1% + {\ifpositioning + \bgroup + \global\advance\currentMPtextareadata\plusone + %\hpos{gbd:\the\currentMPtextareadata}{#1}% + \hpos{gbd:\the\currentMPtextareadata}% + {\iftracetextareas\boxrulewidth1.5pt\ruledhbox\fi{#1}}% + \edef\!!stringa{gbd:\the\currentMPtextareadata}% + \edef\!!stringa{RegisterTextArea(% + \MPx\!!stringa,\MPy\!!stringa,% + \MPw\!!stringa,\MPh\!!stringa,\MPd\!!stringa);}% + \@EA \doglobal \@EA \appendtoks \!!stringa \to \MPtextareadata + \egroup + \else + \hbox{#1}% + \fi} + +\def\registerMPlocaltextarea#1% + {\ifpositioning + \bgroup + \global\advance\currentMPtextareadata\plusone + %\hpos{gbd:\the\currentMPtextareadata}{#1}% + \hpos{gbd:\the\currentMPtextareadata}% + {\iftracetextareas\boxrulewidth3pt\ruledhbox\fi{#1}}% + \edef\!!stringa{gbd:\the\currentMPtextareadata}% + \edef\!!stringa{RegisterLocalTextArea(% + \MPx\!!stringa,\MPy\!!stringa,% + \MPw\!!stringa,\MPh\!!stringa,\MPd\!!stringa);}% + \global\MPlocaltextareadata\@EA{\!!stringa}% + \egroup + \else + \hbox{#1}% + \fi} + +% better, so that we can force a key and share with e.g. renumbering +% +% \let\namedtextarea\empty +% +% \def\registerMPlocaltextarea#1% +% {\ifpositioning +% \bgroup +% \ifx\namedtextarea\empty +% \global\advance\currentMPtextareadata\plusone +% \edef\namedtextarea{gbd:\the\currentMPtextareadata}% +% \fi +% \hpos\namedtextarea{\iftracetextareas\boxrulewidth3pt\ruledhbox\fi{#1}}% +% \edef\ascii{RegisterLocalTextArea(% +% \MPx\namedtextarea,\MPy\namedtextarea,% +% \MPw\namedtextarea,\MPh\namedtextarea,\MPd\namedtextarea);}% +% \global\MPlocaltextareadata\@EA{\ascii}% +% \egroup +% \else +% \hbox{#1}% +% \fi} + +\def\resetMPlocaltextarea + {\global\MPlocaltextareadata\emptytoks} + +\startMPextensions + path PlainTextArea; +\stopMPextensions + +\startMPinitializations + ResetTextAreas; + \the\MPsavedtextareadata; + SaveTextAreas; + ResetTextAreas; + \the\MPtextareadata; + \the\MPlocaltextareadata; + PlainTextArea:=boundingbox(\MPxy{text:\realfolio}--\MPxy{text:\realfolio} + shifted (\MPw{text:\realfolio},\MPh{text:\realfolio})); +\stopMPinitializations + +\appendtoks + \global\MPsavedtextareadata\MPtextareadata + \global\MPtextareadata \emptytoks + \global\MPlocaltextareadata\emptytoks +\to \everyshipout + +\protect \endinput diff --git a/tex/context/base/meta-pag.tex b/tex/context/base/meta-pag.tex deleted file mode 100644 index 000e56a2e..000000000 --- a/tex/context/base/meta-pag.tex +++ /dev/null @@ -1,226 +0,0 @@ -%D \module -%D [ file=meta-pag, -%D version=1999.07.10, -%D title=\METAPOST\ Graphics, -%D subtitle=Initialization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 These definitions used to be part of the old \type -%D {core-mps} file, later changed into \type {meta-ini}, but -%D keeping them separate is cleaner. - -\writestatus{loading}{MetaPost Graphics / Page Data Management} - -\unprotect - -\startMPextensions - if unknown context_page: input mp-page; fi; -\stopMPextensions - -%D The next few macros tell \METAPOST\ how the \CONTEXT\ -%D pagebody looks. - -\startMPextensions - boolean PageStateAvailable,OnRightPage,InPageBody; - PageStateAvailable:=true; -\stopMPextensions - -\startMPinitializations - OnRightPage:=true; - InPageBody:=\ifinpagebody true \else false \fi; -\stopMPinitializations - -\startMPinitializations - def LoadPageState = - OnRightPage:=\MPonrightpage; - OnOddPage:=\MPonoddpage; - RealPageNumber:=\the\realpageno; - PageNumber:=\the\pageno; - NOfPages:=\lastpage; - PaperHeight:=\the\paperheight; - PaperWidth:=\the\paperwidth; - PrintPaperHeight:=\the\printpaperheight; - PrintPaperWidth:=\the\printpaperwidth; - TopSpace:=\the\topspace; - BottomSpace:=\the\bottomspace; - BackSpace:=\the\backspace; - CutSpace:=\the\cutspace; - MakeupHeight:=\the\makeupheight; - MakeupWidth:=\the\makeupwidth; - TopHeight:=\the\topheight; - TopDistance:=\the\topdistance; - HeaderHeight:=\the\headerheight; - HeaderDistance:=\the\headerdistance; - TextHeight:=\the\textheight; - FooterDistance:=\the\footerdistance; - FooterHeight:=\the\footerheight; - BottomDistance:=\the\bottomdistance; - BottomHeight:=\the\bottomheight; - LeftEdgeWidth:=\the\leftedgewidth; - LeftEdgeDistance:=\the\leftedgedistance; - LeftMarginWidth:=\the\leftmarginwidth; - LeftMarginDistance:=\the\leftmargindistance; - TextWidth:=\the\textwidth ; - RightMarginDistance:=\the\rightmargindistance; - RightMarginWidth:=\the\rightmarginwidth; - RightEdgeDistance:=\the\rightedgedistance; - RightEdgeWidth:=\the\rightedgewidth; - InnerMarginDistance:=\the\innermargindistance; - InnerMarginWidth:=\the\innermarginwidth; - OuterMarginDistance:=\the\outermargindistance; - OuterMarginWidth:=\the\outermarginwidth; - InnerEdgeDistance:=\the\inneredgedistance; - InnerEdgeWidth:=\the\inneredgewidth; - OuterEdgeDistance:=\the\outeredgedistance; - OuterEdgeWidth:=\the\outeredgewidth; - PageOffset:=\the\pageoffset; - PageDepth:=\the\pagedepth; - LayoutColumns:=\the\layoutcolumns; - LayoutColumnDistance:=\the\layoutcolumndistance; - LayoutColumnWidth:=\the\layoutcolumnwidth; - enddef; -\stopMPinitializations - -\def\MPonrightpage{true} -\def\MPonoddpage {true} - -\def\freezeMPpagelayout - {\doifbothsides - {\def\MPonrightpage{true}} - {\def\MPonrightpage{true}} - {\def\MPonrightpage{false}}% - \edef\MPonoddpage{\doifoddpageelse{true}{false}}} - -\let\freezeMPlayout\relax % obsolete - -%D We need to freeze the pagelayout before the backgrounds -%D are build, because the overlay will temporarily become -%D zero (overlay). - -\appendtoks - \freezeMPpagelayout -\to \everybeforepagebody - -%D By freezing these value every graphic, we can use layout -%D variables that change halfways a page, whatever use that -%D has. - -\prependtoks - \calculatereducedvsizes % this is really needed - \freezeMPpagelayout - \freezeMPlayout % to be used grouped -\to \everyMPgraphic - -%D The next feature provides information about for instance -%D column positions. This is an experimental feature, -%D introduced when we needed backgrounds in columns (fill||in -%D questions as implemented in a private module). -%D -%D See \type {mp-page.mp} for the definition of the macros: -%D -%D \starttabulate[|tl|l|p|] -%D \NC ResetTextAreas \NC no arguments \NC -%D reset areas on page \NC \NR -%D \NC RegisterTextArea \NC x, y, w, h \NC -%D adds area to the list \NC \NR -%D \NC TextAreaX,Y,W,H,XY,WH \NC x and/or y \NC -%D reports offsets and dimensions \NC \NR -%D \stoptabulate -%D -%D The \type {TextArea*} macros can be used to determine -%D overlap. - -\newcount\currentMPtextareadata - -\newtoks\MPsavedtextareadata -\newtoks\MPtextareadata -\newtoks\MPlocaltextareadata - -% optimaliseren voor herhaling - -\def\registerMPtextarea#1% - {\ifpositioning - \bgroup - \global\advance\currentMPtextareadata\plusone - %\hpos{gbd:\the\currentMPtextareadata}{#1}% - \hpos{gbd:\the\currentMPtextareadata}% - {\iftracetextareas\boxrulewidth1.5pt\ruledhbox\fi{#1}}% - \edef\!!stringa{gbd:\the\currentMPtextareadata}% - \edef\!!stringa{RegisterTextArea(% - \MPx\!!stringa,\MPy\!!stringa,% - \MPw\!!stringa,\MPh\!!stringa,\MPd\!!stringa);}% - \@EA \doglobal \@EA \appendtoks \!!stringa \to \MPtextareadata - \egroup - \else - \hbox{#1}% - \fi} - -\def\registerMPlocaltextarea#1% - {\ifpositioning - \bgroup - \global\advance\currentMPtextareadata\plusone - %\hpos{gbd:\the\currentMPtextareadata}{#1}% - \hpos{gbd:\the\currentMPtextareadata}% - {\iftracetextareas\boxrulewidth3pt\ruledhbox\fi{#1}}% - \edef\!!stringa{gbd:\the\currentMPtextareadata}% - \edef\!!stringa{RegisterLocalTextArea(% - \MPx\!!stringa,\MPy\!!stringa,% - \MPw\!!stringa,\MPh\!!stringa,\MPd\!!stringa);}% - \global\MPlocaltextareadata\@EA{\!!stringa}% - \egroup - \else - \hbox{#1}% - \fi} - -% better, so that we can force a key and share with e.g. renumbering -% -% \let\namedtextarea\empty -% -% \def\registerMPlocaltextarea#1% -% {\ifpositioning -% \bgroup -% \ifx\namedtextarea\empty -% \global\advance\currentMPtextareadata\plusone -% \edef\namedtextarea{gbd:\the\currentMPtextareadata}% -% \fi -% \hpos\namedtextarea{\iftracetextareas\boxrulewidth3pt\ruledhbox\fi{#1}}% -% \edef\ascii{RegisterLocalTextArea(% -% \MPx\namedtextarea,\MPy\namedtextarea,% -% \MPw\namedtextarea,\MPh\namedtextarea,\MPd\namedtextarea);}% -% \global\MPlocaltextareadata\@EA{\ascii}% -% \egroup -% \else -% \hbox{#1}% -% \fi} - -\def\resetMPlocaltextarea - {\global\MPlocaltextareadata\emptytoks} - -\startMPextensions - path PlainTextArea; -\stopMPextensions - -\startMPinitializations - ResetTextAreas; - \the\MPsavedtextareadata; - SaveTextAreas; - ResetTextAreas; - \the\MPtextareadata; - \the\MPlocaltextareadata; - PlainTextArea:=boundingbox(\MPxy{text:\realfolio}--\MPxy{text:\realfolio} - shifted (\MPw{text:\realfolio},\MPh{text:\realfolio})); -\stopMPinitializations - -\appendtoks - \global\MPsavedtextareadata\MPtextareadata - \global\MPtextareadata \emptytoks - \global\MPlocaltextareadata\emptytoks -\to \everyshipout - -\protect \endinput diff --git a/tex/context/base/meta-pdf.lua b/tex/context/base/meta-pdf.lua index 240778bfa..056d1052f 100644 --- a/tex/context/base/meta-pdf.lua +++ b/tex/context/base/meta-pdf.lua @@ -7,55 +7,77 @@ if not modules then modules = { } end modules ['meta-pdf'] = { } -- Finally we used an optimized version. The test code can be found in --- meta-pdh.lua but since we no longer want to overload functione we --- use more locals now. +-- meta-pdh.lua but since we no longer want to overload functione we use +-- more locals now. This module keeps changing as it is also a testbed. local concat, format, gsub, find = table.concat, string.format, string.gsub, string.find -local byte = string.byte +local byte, round = string.byte, math.round local texsprint = tex.sprint - local ctxcatcodes = tex.ctxcatcodes +local pdfrgbcode = lpdf.rgbcode +local pdfcmykcode = lpdf.cmykcode +local pdfgraycode = lpdf.graycode +local pdfspotcode = lpdf.spotcode +local pdftransparencycode = lpdf.transparencycode +local pdffinishtransparencycode = lpdf.finishtransparencycode + mptopdf = { } mptopdf.n = 0 local m_path, m_stack, m_texts, m_version, m_date, m_shortcuts = { }, { }, { }, 0, 0, false local m_stack_close, m_stack_path, m_stack_concat = false, { }, nil +local extra_path_code, ignore_path = nil, false +local specials = { } local function resetpath() - m_stack_close = false - m_stack_path = { } - m_stack_concat = nil + m_stack_close, m_stack_path, m_stack_concat = false, { }, nil end local function resetall() m_path, m_stack, m_texts, m_version, m_shortcuts = { }, { }, { }, 0, false + extra_path_code, ignore_path = nil, false + specials = { } resetpath() end resetall() --- code injection, todo: collect and flush packed using node injection +-- todo: collect and flush packed using pdfliteral node injection but we're +-- in no hurry as this kind of conversion does not happen that often in mkiv -local function pdfcode(str) -- not used - texsprint(ctxcatcodes,"\\MPScode{",str,"}") +local function pdfcode(str) + texsprint(ctxcatcodes,"\\pdfliteral{" .. str .. "}") end + local function texcode(str) texsprint(ctxcatcodes,str) end +function mpscode(str) + if ignore_path then + pdfcode("h W n") + if extra_path_code then + pdfcode(extra_path_code) + extra_path_code = nil + end + ignore_path = false + else + pdfcode(str) + end +end + -- auxiliary functions local function flushconcat() if m_stack_concat then - texsprint(ctxcatcodes,"\\MPScode{",concat(m_stack_concat," ")," cm}") + mpscode(concat(m_stack_concat," ") .. " cm") m_stack_concat = nil end end local function flushpath(cmd) - -- faster: no local function if #m_stack_path > 0 then local path = { } if m_stack_concat then @@ -63,9 +85,6 @@ local function flushpath(cmd) local rx, ry = m_stack_concat[2], m_stack_concat[3] local tx, ty = m_stack_concat[5], m_stack_concat[6] local d = (sx*sy) - (rx*ry) - -- local function mpconcat(px, py) -- move this inline - -- return (sy*(px-tx)-ry*(py-ty))/d, (sx*(py-ty)-rx*(px-tx))/d - -- end for k=1,#m_stack_path do local v = m_stack_path[k] local px, py = v[1], v[2] ; v[1], v[2] = (sy*(px-tx)-ry*(py-ty))/d, (sx*(py-ty)-rx*(px-tx))/d -- mpconcat(v[1],v[2]) @@ -81,11 +100,11 @@ local function flushpath(cmd) end end flushconcat() - texcode("\\MPSpath{" .. concat(path," ") .. "}") + pdfcode(concat(path," ")) if m_stack_close then - texcode("\\MPScode{h " .. cmd .. "}") + mpscode("h " .. cmd) else - texcode("\\MPScode{" .. cmd .."}") + mpscode(cmd) end end resetpath() @@ -132,7 +151,7 @@ function mps.rlineto(x,y) end function mps.translate(tx,ty) - texsprint(ctxcatcodes,"\\MPScode{1 0 0 0 1 ",tx," ",ty," cm}") + mpscode("1 0 0 0 1 " .. tx .. " " .. ty .. " cm") end function mps.scale(sx,sy) @@ -144,36 +163,36 @@ function mps.concat(sx, rx, ry, sy, tx, ty) end function mps.setlinejoin(d) - texsprint(ctxcatcodes,"\\MPScode{",d," j}") + mpscode(d .. " j") end function mps.setlinecap(d) - texsprint(ctxcatcodes,"\\MPScode{",d," J}") + mpscode(d .. " J") end function mps.setmiterlimit(d) - texsprint(ctxcatcodes,"\\MPScode{",d," M}") + mpscode(d .. " M") end function mps.gsave() - texsprint(ctxcatcodes,"\\MPScode{q}") + mpscode("q") end function mps.grestore() - texsprint(ctxcatcodes,"\\MPScode{Q}") + mpscode("Q") end function mps.setdash(...) -- can be made faster, operate on t = { ... } local n = select("#",...) - texsprint(ctxcatcodes,"\\MPScode{","[",concat({...}," ",1,n-1),"] ",select(n,...)," d}") + mpscode("[" .. concat({...}," ",1,n-1) .. "] " .. select(n,...) .. " d") end function mps.resetdash() - texsprint(ctxcatcodes,"\\MPScode{[ ] 0 d}") + mpscode("[ ] 0 d") end function mps.setlinewidth(d) - texsprint(ctxcatcodes,"\\MPScode{",d," w}") + mpscode(d .. " w") end function mps.closepath() @@ -206,31 +225,136 @@ function mps.textext(font, scale, str) -- old parser resetpath() end +local handlers = { } + +handlers[1] = function(s) + pdfcode(pdffinishtransparencycode()) + pdfcode(pdfcmykcode(mps.colormodel,s[3],s[4],s[5],s[6])) +end +handlers[2] = function(s) + pdfcode(pdffinishtransparencycode()) + pdfcode(pdfspotcode(mps.colormodel,s[3],s[4],s[5],s[6])) +end +handlers[3] = function(s) + pdfcode(pdfrgbcode(mps.colormodel,s[4],s[5],s[6])) + pdfcode(pdftransparencycode(s[2],s[3])) +end +handlers[4] = function(s) + pdfcode(pdfcmykcode(mps.colormodel,s[4],s[5],s[6],s[7])) + pdfcode(pdftransparencycode(s[2],s[3])) +end +handlers[5] = function(s) + pdfcode(pdfspotcode(mps.colormodel,s[4],s[5],s[6],s[7])) + pdfcode(pdftransparencycode(s[2],s[3])) +end + +-- todo: color conversion + +local nofshades, tn = 0, tonumber + +local function linearshade(colorspace,domain,ca,cb,coordinates) + pdfcode(pdffinishtransparencycode()) + nofshades = nofshades + 1 + local name = format("MpsSh%s",nofshades) + lpdf.linearshade(name,domain,ca,cb,1,colorspace,coordinates) + extra_path_code, ignore_path = format("/%s sh Q",name), true + pdfcode("q /Pattern cs") +end + +local function circularshade(colorspace,domain,ca,cb,coordinates) + pdfcode(pdffinishtransparencycode()) + nofshades = nofshades + 1 + local name = format("MpsSh%s",nofshades) + lpdf.circularshade(name,domain,ca,cb,1,colorspace,coordinates) + extra_path_code, ignore_path = format("/%s sh Q",name), true + pdfcode("q /Pattern cs") +end + +handlers[30] = function(s) + linearshade("DeviceRGB", { tn(s[ 2]), tn(s[ 3]) }, + { tn(s[ 5]), tn(s[ 6]), tn(s[ 7]) }, { tn(s[10]), tn(s[11]), tn(s[12]) }, + { tn(s[ 8]), tn(s[ 9]), tn(s[13]), tn(s[14]) } ) +end + +handlers[31] = function(s) + circularshade("DeviceRGB", { tn(s[ 2]), tn(s[ 3]) }, + { tn(s[ 5]), tn(s[ 6]), tn(s[ 7]) }, { tn(s[11]), tn(s[12]), tn(s[13]) }, + { tn(s[ 8]), tn(s[ 9]), tn(s[10]), tn(s[14]), tn(s[15]), tn(s[16]) } ) +end + +handlers[32] = function(s) + linearshade("DeviceCMYK", { tn(s[ 2]), tn(s[ 3]) }, + { tn(s[ 5]), tn(s[ 6]), tn(s[ 7]), tn(s[ 8]) }, { tn(s[11]), tn(s[12]), tn(s[13]), tn(s[14]) }, + { tn(s[ 9]), tn(s[10]), tn(s[15]), tn(s[16]) } ) +end + +handlers[33] = function(s) + circularshade("DeviceCMYK", { tn(s[ 2]), tn(s[ 3]) }, + { tn(s[ 5]), tn(s[ 6]), tn(s[ 7]), tn(s[ 8]) }, { tn(s[12]), tn(s[13]), tn(s[14]), tn(s[15]) }, + { tn(s[ 9]), tn(s[10]), tn(s[11]), tn(s[16]), tn(s[17]), tn(s[18]) } ) +end + +handlers[34] = function(s) -- todo (after further cleanup) + linearshade("DeviceGray", { tn(s[ 2]), tn(s[ 3]) }, { 0 }, { 1 }, { tn(s[9]), tn(s[10]), tn(s[15]), tn(s[16]) } ) +end + +handlers[35] = function(s) -- todo (after further cleanup) + circularshade("DeviceGray", { tn(s[ 2]), tn(s[ 3]) }, { 0 }, { 1 }, { tn(s[9]), tn(s[10]), tn(s[15]), tn(s[16]) } ) +end + +-- not supported in mkiv , use mplib instead + +handlers[10] = function() logs.report("mptopdf","skipping special %s",10) end +handlers[20] = function() logs.report("mptopdf","skipping special %s",20) end +handlers[50] = function() logs.report("mptopdf","skipping special %s",50) end + +--end of not supported + function mps.setrgbcolor(r,g,b) -- extra check r, g = tonumber(r), tonumber(g) -- needed when we use lpeg if r == 0.0123 and g < 0.1 then - texcode("\\MPSspecial{" .. g*10000 .. "}{" .. b*10000 .. "}") + g, b = round(g*10000), round(b*10000) + local s = specials[b] + local h = round(s[#s]) + local handler = handlers[h] + if handler then + handler(s) + else + logs.report("mptopdf","unknown special handler %s (1)",h) + end elseif r == 0.123 and g < 0.1 then - texcode("\\MPSspecial{" .. g* 1000 .. "}{" .. b* 1000 .. "}") + g, b = round(g*1000), round(b*1000) + local s = specials[b] + local h = round(s[#s]) + local handler = handlers[h] + if handler then + handler(s) + else + logs.report("mptopdf","unknown special handler %s (2)",h) + end else - texcode("\\MPSrgb{" .. r .. "}{" .. g .. "}{" .. b .. "}") + pdfcode(pdffinishtransparencycode()) + pdfcode(pdfrgbcode(mps.colormodel,r,g,b)) end end function mps.setcmykcolor(c,m,y,k) - texcode("\\MPScmyk{" .. c .. "}{" .. m .. "}{" .. y .. "}{" .. k .. "}") + pdfcode(pdffinishtransparencycode()) + pdfcode(pdfcmykcode(mps.colormodel,c,m,y,k)) end function mps.setgray(s) - texcode("\\MPSgray{" .. s .. "}") + pdfcode(pdffinishtransparencycode()) + pdfcode(pdfgrayliteral(mps.colormodel,s)) end function mps.specials(version,signal,factor) -- 2.0 123 1000 end function mps.special(...) -- 7 1 0.5 1 0 0 1 3 - local n = select("#",...) - texcode("\\MPSbegin\\MPSset{" .. concat({...},"}\\MPSset{",2,n) .. "}\\MPSend") + local t = { ... } + local n = tonumber(t[#t-1]) + specials[n] = t end function mps.begindata() @@ -242,10 +366,6 @@ end function mps.showpage() end -function mps.attribute(id,value) - texcode("\\attribute " .. id .. "=" .. value .. " ") -end - -- lpeg parser -- The lpeg based parser is rather optimized for the kind of output @@ -350,9 +470,6 @@ local t = (lpegP("[") * (cnumber * sp^0)^6 * lpegP("]") * sp * lpegP("t") ) / -- experimental -local attribute = ((cnumber * sp)^2 * lpegP("attribute")) / mps.attribute -local A = ((cnumber * sp)^2 * lpegP("A")) / mps.attribute - local preamble = ( prolog + setup + boundingbox + highresboundingbox + specials + special + @@ -362,7 +479,6 @@ local preamble = ( local procset = ( lj + ml + lc + c + l + m + n + p + r + - A + R + C + G + S + F + B + W + vlw + hlw + @@ -376,7 +492,6 @@ local procset = ( local verbose = ( curveto + lineto + moveto + newpath + closepath + rlineto + setrgbcolor + setcmykcolor + setgray + - attribute + setlinejoin + setmiterlimit + setlinecap + stroke + fill + clip + both + setlinewidth_x + setlinewidth_y + @@ -390,7 +505,8 @@ local verbose = ( -- order matters in terms of speed / we could check for procset first local captures_old = ( space + verbose + preamble )^0 -local captures_new = ( space + procset + preamble + verbose )^0 +--~ local captures_new = ( space + procset + preamble + verbose )^0 +local captures_new = ( space + verbose + procset + preamble )^0 local function parse(m_data) if find(m_data,"%%%%BeginResource: procset mpost") then @@ -402,17 +518,25 @@ end -- main converter +local a_colorspace = attributes.private('colormodel') + function mptopdf.convertmpstopdf(name) resetall() local ok, m_data, n = resolvers.loadbinfile(name, 'tex') -- we need a binary load ! if ok then + mps.colormodel = tex.attribute[a_colorspace] statistics.starttiming(mptopdf) mptopdf.n = mptopdf.n + 1 + pdfcode(format("\\letterpercent\\space mptopdf begin: n=%s, file=%s",mptopdf.n,file.basename(name))) + pdfcode("q 1 0 0 1 0 0 cm") parse(m_data) + pdfcode(pdffinishtransparencycode()) + pdfcode("Q") + pdfcode("\\letterpercent\\space mptopdf end") resetall() statistics.stoptiming(mptopdf) else - tex.print("file " .. name .. " not found") + commands.writestatus("mptopdf","file '%s' not found",name) end end diff --git a/tex/context/base/meta-pdf.mkiv b/tex/context/base/meta-pdf.mkiv index 906633802..fa9627fbe 100644 --- a/tex/context/base/meta-pdf.mkiv +++ b/tex/context/base/meta-pdf.mkiv @@ -11,17 +11,6 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D Formerly known as supp-pdf.tex and supp-mpe.tex. - -% \useMPgraphic{1} -% \testfeatureonce{250}{\setbox0\hbox{\convertMPtoPDF{test-mps-mpgraph.1}{1}{1}}} -% -% 8.4 : mkii, direct parsing by tex -% 11.8 : mkiv, dirty conversion (10.8 with dirty tricks) -% 14.5 : mkiv, clean conversion -% 7.4 : mkiv, simulated clean direct lua from mp -% 0.3 : time taken by tex to handle converted code - \registerctxluafile{meta-pdf}{1.003} %D We will clean up the color mess later. @@ -30,13 +19,6 @@ \unprotect -\ifx\PDFcode \undefined \let\PDFcode \gobbleoneargument \fi -\ifx\PDFcomment\undefined \def\PDFcomment#1{\PDFcode{\letterpercent\space#1}} \fi - -%D First we define a handy constant: - -\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup - %D \macros %D {convertMPtoPDF} %D @@ -57,67 +39,25 @@ %D \convertMPtoPDF{mp-pra-1.eps}{.5}{.5} %D \stoptyping -%D \macros -%D {makeMPintoPDFobject,lastPDFMPobject} -%D -%D For experts there are a few more options. When attributes -%D are to be added, the code must be embedded in an object -%D accompanied with the appropriate directives. One can -%D influence this process with \type {\makeMPintoPDFobject}. -%D -%D This option defaults to~0, because \CONTEXT\ takes care -%D of objects at another level, which saves some bytes. -%D -%D \starttabulate[|l|l|p|] -%D \NC 0 \NC never \NC don't use an object \NC\NR -%D \NC 1 \NC always \NC always use an object \NC\NR -%D \NC 2 \NC optional \NC use object when needed \NC\NR -%D \stoptabulate -%D -%D The last object number used is avaliable in the macro -%D \type {\lastPDFMPobject}. - -\ifx\makeMPintoPDFobject \undefined \chardef\makeMPintoPDFobject \zerocount \fi -\ifx\blackoutMPgraphic \undefined \chardef\blackoutMPgraphic \plusone \fi -\ifx\everyMPtoPDFconversion\undefined \newtoks\everyMPtoPDFconversion \fi - -\let\lastPDFMPobject \!!zerocount -\let\currentPDFresources\empty -\let\setMPextensions \relax - \def\PDFMPformoffset - {\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi} - -\def\resetMPvariables#1#2#3% - {\global\let\MPwidth \!!zeropoint - \global\let\MPheight\!!zeropoint - \global\let\MPllx \!!zerocount - \global\let\MPlly \!!zerocount - \global\let\MPurx \!!zerocount - \global\let\MPury \!!zerocount - \xdef\MPxscale {#2}\ifx\MPxscale\empty\let\MPxscale\!!plusone\fi - \xdef\MPyscale {#3}\ifx\MPyscale\empty\let\MPyscale\!!plusone\fi - \xdef\MPfilename {#1}} + {\ifdefined\objectoffset\objectoffset\else\zeropoint\fi} %D The main macro: -\def\convertMPtoPDF#1#2#3% watch the transparency reset - {\resetMPvariables{#1}{#2}{#3}% - \vbox\bgroup +\def\convertMPtoPDF#1#2#3% scaling no longer supported at this level (so #2 & #3 ignored) + {\vbox\bgroup + \message{[MP to PDF]}% + \xdef\MPfilename{#1}% + \glet\MPwidth \!!zeropoint + \glet\MPheight\!!zeropoint + \glet\MPllx \!!zerocount + \glet\MPlly \!!zerocount + \glet\MPurx \!!zerocount + \glet\MPury \!!zerocount \forgetall \offinterlineskip - %\ifcase\blackoutMPgraphic\or\PDFcode{0 g 0 G}\fi % fixed in mp \setbox\scratchbox\vbox\bgroup - \setnormalcatcodes % we can be in verbatim or so - \message{[MP to PDF]}% - \startMPresources - \PDFcomment{mps begin}% - \PDFcode{q 1 0 0 1 0 0 cm}% - \ctxlua{mptopdf.convertmpstopdf("\MPfilename")}\removeunwantedspaces - \dohandleMPresettransparency % a bit messy here, should be a toks - \PDFcode{Q}% - \PDFcomment{mps end}% - \stopMPresources + \ctxlua{mptopdf.convertmpstopdf("\MPfilename")}\removeunwantedspaces \egroup \setbox\scratchbox\hbox\bgroup \hskip-\MPllx\onebasepoint @@ -135,53 +75,33 @@ \dopackageMPgraphic\scratchbox \egroup} -\let\processMPtoPDFfile\convertMPtoPDF - -%D A common hook. - -\let\MPfshowcommand\empty - -%D Objects. - -\def\dopackageMPgraphic#1% #1 = boxregister - {\ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else - % an existing value of 2 signals object support (set elsewhere) - \chardef\makeMPintoPDFobject\plusone - \fi\fi - \ifcase\makeMPintoPDFobject - \box#1% - \or - \scratchdimen\PDFMPformoffset\relax - \ifdim\scratchdimen>\zeropoint % compensate for error - \setbox#1\vbox spread 2\scratchdimen - {\forgetall\vss\hbox spread 2\scratchdimen{\hss\box#1\hss}\vss}% - \fi - \setMPPDFobject{\currentPDFresources}{#1}% - \ifdim\scratchdimen>\zeropoint % compensate for error - \vbox to \MPheight - {\forgetall\vss\hbox to \MPwidth{\hss\getMPPDFobject\hss}\vss}% - \else - \getMPPDFobject - \fi - \global\let\currentPDFresources\empty - \else - \box#1% - \fi} +%D Objects (move all to backend) + +% \def\dopackageMPgraphic#1% #1 = boxregister +% {\scratchdimen\PDFMPformoffset\relax +% \ifdim\scratchdimen>\zeropoint % compensate for error +% \setbox#1\vbox spread 2\scratchdimen +% {\forgetall\vss\hbox spread 2\scratchdimen{\hss\box#1\hss}\vss}% +% \fi +% \setMPPDFobject{#1}% +% \ifdim\scratchdimen>\zeropoint % compensate for error +% \vbox to \MPheight +% {\forgetall\vss\hbox to \MPwidth{\hss\getMPPDFobject\hss}\vss}% +% \else +% \getMPPDFobject +% \fi} +% +% \def\setMPPDFobject#1% boxnumber +% {\the\pdfbackendeveryxform +% \finalizeobjectbox{#1}% +% \immediate\pdfxform resources{\pdfcurrentresources}#1% +% \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}} +% +% \let\getMPPDFobject\relax -\def\setMPPDFobject#1#2% resources boxnumber - {\ifx\pdfxform\undefined - \def\getMPPDFobject{\box#2}% - \else\ifx\pdftexversion\undefined - \def\getMPPDFobject{\box#2}% - \else\ifnum\pdftexversion<14 - \def\getMPPDFobject{\box#2}% - \else - \ifx\everyPDFxform\undefined\else\the\everyPDFxform\fi - \immediate\pdfxform resources{#1}#2% - \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}% - \fi\fi\fi} +% we don't need to package as each page has all resources anyway -\let\getMPPDFobject\relax +\let\dopackageMPgraphic\box %D \macros %D {deleteMPgraphic, @@ -243,32 +163,6 @@ \newconditional\manyMPspecials \settrue\manyMPspecials -%D In case of \PDF, we need to prepare resourcs. - -\newtoks\MPstartresources -\newtoks\MPstopresources - -\def\startMPresources - {\the\MPstartresources} - -\def\stopMPresources - {\the\MPstopresources} - -%D Some day we may consider collecting local resources. - -\appendtoks - \global\let\currentPDFresources\empty % kind of redundant -\to \MPstartresources - -% \appendtoks -% \collectPDFresources -% \global\let\currentPDFresources\collectedPDFresources -% \to \MPstopresources - -\appendtoksonce - \the\everyPDFxform -\to \MPstopresources - %D Since colors are not subjected to transformations, we can %D only use colors as signal. In our case, we use a dummy colored %D path with a red color component of \type {0.n}, so \type @@ -278,25 +172,11 @@ \newif\ifMPcmykcolors \newif\ifMPspotcolors -\def\dohandleMPrgb #1#2#3{\revokeMPtransparencyspecial\execcolorR #1:#2:#3:0:0\od} -\def\dohandleMPcmyk#1#2#3#4{\revokeMPtransparencyspecial\execcolorC#1:#2:#3:#4:0:0\od} -\def\dohandleMPgray #1{\revokeMPtransparencyspecial\execcolorS #1:0:0\od} -\def\dohandleMPspot#1#2#3#4{\revokeMPtransparencyspecial\execcolorP#1:#2:#3:#4:0:0\od} - -%D Specials: - -\settrue \manyMPspecials \newcount\nofMParguments \let\extraMPpathcode\empty - -\def\@@MP {@@MP} -\def\@@MPSK{@MPSK@} - -\def\MPspecial{\@@MPSK\@@MPSK\gMPs\nofMParguments} - -\def\defineMPspecial#1#2% - {\setvalue{\@@MPSK\@@MPSK#1}{#2}} - -%D Special number~1 is dedicated to \CMYK\ support. If you -%D want to know why: look at this: +%D We support specials but assume that the files are somewhat simple +%D ones wo we have dropped a few. The reason is that runtime \METAPOST\ +%D processing now uses \MPLIB\ so we only need to deal with the +%D conversion here. See meta-pdh.mkiv (and older files) for more +%D details. Here we just give a few examples. %D %D \startbuffer[mp] %D fill fullcircle xyscaled (3cm,1cm) withcolor \MPcolor{test} ; @@ -326,38 +206,11 @@ %D no conversion to \RGB, %D support in \METAPOST} %D {\setupcolors[cmyk=ja,state=start]\getbuffer[cmyk]} - -\defineMPspecial{1} - {\ifMPcmykcolors - \setxvalue{\@@MPSK\gMPs6}{\noexpand\dohandleMPcmykcolor{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}}% - \fi} - -\defineMPspecial{2} - {\ifMPspotcolors - \setxvalue{\@@MPSK\gMPs6}{\noexpand\dohandleMPspotcolor{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}}% -% \checkMPspot{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}% - \fi} - -% \def\checkMPspot#1#2#3#4% -% {\normalexpanded{\noexpand\resolveMPspotcolor#1 #2 #3 #4}\end -% \ifx\MPspotspace\MPresolvedspace -% \edef\MPspotspacespec{/\MPspotspace\space}% -% \doifinstringelse\MPspotspacespec\currentMPcolorspaces -% \donothing\registerMPcolorspace -% \fi} - -\let\revokeMPtransparencyspecial\relax - -\def\dohandleMPrgbcolor #1#2#3{\revokeMPtransparencyspecial\execcolorR #1:#2:#3:0:0\od} -\def\dohandleMPcmykcolor#1#2#3#4{\revokeMPtransparencyspecial\execcolorC#1:#2:#3:#4:0:0\od} -\def\dohandleMPgraycolor #1{\revokeMPtransparencyspecial\execcolorS #1:0:0\od} -\def\dohandleMPspotcolor#1#2#3#4{\revokeMPtransparencyspecial\execcolorP#1:#2:#3:#4:0:0\od} - +%D %D Transparency support used specials 60 (rgb) and 61 %D (cmyk). %D -%D \startbufferFshade - +%D \startbuffer %D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0); %D %D fill p rotated 90 withcolor transparent(1,.5,yellow) ; @@ -390,28 +243,6 @@ %D %D \startlinecorrection \processMPbuffer \stoplinecorrection %D -%D We save all the three components needed in one macro, -%D just to save hash space. - -\def\dohandleMPrgbtransparency #1#2#3#4#5{\execcolorR #1:#2:#3:#4:#5\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial} -\def\dohandleMPcmyktransparency#1#2#3#4#5#6{\execcolorC#1:#2:#3:#4:#5:#6\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial} -\def\dohandleMPgraytransparency #1#2#3{\execcolorS #1:#2:#3\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial} -\def\dohandleMPspottransparency#1#2#3#4#5#6{\execcolorP#1:#2:#3:#4:#5:#6\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial} - -\def\dorevokeMPtransparencyspecial - {\PDFcode{\PDFtransparencyresetidentifier\space gs}% - \let\revokeMPtransparencyspecial\relax} - -\defineMPspecial{3} % rgb - {\setxvalue{\@@MPSK\gMPs6}{\noexpand\dohandleMPrgbtransparency{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs1}{\gMPs2}}} - -\defineMPspecial{4} % cmyk - {\setxvalue{\@@MPSK\gMPs7}{\noexpand\dohandleMPcmyktransparency{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs1}{\gMPs2}}} - -\defineMPspecial{5} % spot - {\setxvalue{\@@MPSK\gMPs7}{\noexpand\dohandleMPspottransparency{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs1}{\gMPs2}}% - }%\checkMPspot{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}} - %D Shading is an example of a more advanced graphic feature, %D but users will seldom encounter those complications. Here %D we only show a few simple examples, but many other @@ -448,9 +279,7 @@ %D \stopuniqueMPgraphic %D \stopbuffer %D -%D \typebuffer -%D -%D \getbuffer +%D \typebuffer \getbuffer %D %D These graphics can be hooked into the overlay mechanism, %D which is available in many commands. @@ -461,9 +290,7 @@ %D \defineoverlay[demo 3][\uniqueMPgraphic {DuotoneShade}] %D \stopbuffer %D -%D \typebuffer -%D -%D \getbuffer +%D \typebuffer \getbuffer %D %D These backgrounds can for instance be applied to \type %D {\framed}: @@ -506,8 +333,6 @@ %D \stopcombination %D \stoplinecorrection %D -%D \blank -%D %D \startlinecorrection %D \startcombination[5*1] %D {\SomeShade{20}{circular}{0}{.9green}{.3green}} {circular 0} @@ -518,8 +343,6 @@ %D \stopcombination %D \stoplinecorrection %D -%D \blank -%D %D \startlinecorrection %D \startcombination[4*1] %D {\SomeShade{30}{linear}{0}{.3red}{.9red}} {linear 0} @@ -545,96 +368,7 @@ %D \NC /C1 \NC outer shade \NC \NR %D \NC /N \NC smaller values, bigger inner circles \NC \NR %D \stoptabulate - -\newcount\currentPDFshade % 0 % global (document wide) counter - -\def\dosetMPsomePDFshade#1#2% - {\immediate\pdfobj - {<>}% - \immediate\pdfobj - {<>}% - \global\advance\currentPDFshade \plusone - \appendtoPDFdocumentshades{/Sh\the\currentPDFshade\space\the\pdflastobj\space0 R }% - \setxvalue{\@@MPSK#2}{\noexpand\dohandleMPshade{\the\currentPDFshade}}} - -\def\dosetMPlinearshade {\dosetMPsomePDFshade2}% #1 -\def\dosetMPcircularshade{\dosetMPsomePDFshade3}% #1 - -\defineMPspecial{30} - {\normalexpanded{\noexpand\resolveMPrgbcolor{\gMPs4}{\gMPs5}{\gMPs6}}\to\MPshadeA - \normalexpanded{\noexpand\resolveMPrgbcolor{\gMPs{9}}{\gMPs{10}}{\gMPs{11}}}\to\MPshadeB - \edef\MPshadeC{\gMPs7 \gMPs8 \gMPs{12} \gMPs{13}}% - \dosetMPlinearshade{\gMPs{14}}} - -\defineMPspecial{31} - {\normalexpanded{\noexpand\resolveMPrgbcolor{\gMPs4}{\gMPs5}{\gMPs6}}\to\MPshadeA - \normalexpanded{\noexpand\resolveMPrgbcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}}\to\MPshadeB - \edef\MPshadeC{\gMPs7 \gMPs8 \gMPs9 \gMPs{13} \gMPs{14} \gMPs{15}}% - \dosetMPcircularshade{\gMPs{16}}} - -\defineMPspecial{32} - {\normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA - \normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}}\to\MPshadeB - \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{14} \gMPs{15}}% - \dosetMPlinearshade{\gMPs{16}}} - -\defineMPspecial{33} - {\normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA - \normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}{\gMPs{14}}}\to\MPshadeB - \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{10} \gMPs{15} \gMPs{16} \gMPs{17}}% - \dosetMPcircularshade{\gMPs{18}}} - -\defineMPspecial{34} - {\normalexpanded{\noexpand\resolveMPspotcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA - \normalexpanded{\noexpand\resolveMPspotcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}}\to\MPshadeB - \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{14} \gMPs{15}}% - \dosetMPlinearshade{\gMPs{16}}} - -\defineMPspecial{35} - {\normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA - \normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}{\gMPs{14}}}\to\MPshadeB - \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{10} \gMPs{15} \gMPs{16} \gMPs{17}}% - \dosetMPcircularshade{\gMPs{18}}} - -\newconditional\ignoreMPpath - -\def\dohandleMPshade#1% - {\revokeMPtransparencyspecial - \settrue\ignoreMPpath - \def\extraMPpathcode{/Sh#1 sh Q}% - \chardef\finiMPpath\zerocount - \PDFcode{q /Pattern cs}} - -\defineMPspecial{10} - {\setxvalue{\@@MPSK\gMPs8}% - {\noexpand\handleMPfigurespecial{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}{\gMPs8}}} - -\def\handleMPfigurespecial#1#2#3#4#5#6#7#8% todo : combine with ext fig - {\global\letvalue{\@@MPSK#8}\empty - \vbox to \zeropoint - {\vss - \hbox to \zeropoint - {\ifcase\pdfoutput\or % will be hooked into the special driver - \doiffileelse{#7} - {\doifundefinedelse{mps:x:#7} - {\immediate\pdfximage\!!width\onebasepoint\!!height\onebasepoint{#7}% - \setxvalue{mps:x:#7}{\pdfrefximage\the\pdflastximage}}% - {\message{[reusing figure #7]}}% - \PDFcode{q #1 #2 #3 #4 #5 #6 cm}% - \rlap{\getvalue{mps:x:#7}}% - \PDFcode{Q}} - {\message{[unknown figure #7]}}% - \fi - \hss}}} - +%D %D An example of using both special features is the %D following. %D @@ -653,294 +387,88 @@ %D \stopMPpage %D \stoptyping -\defineMPspecial{20} - {\setxvalue{\@@MPSK\gMPs6}% - {\noexpand\handleMPhyperlink{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}}} - -\def\handleMPhyperlink#1#2#3#4#5#6% - {\global\letvalue{\@@MPSK#6}\empty - \setbox\scratchbox\hbox - {\setbox\scratchbox\null - \wd\scratchbox\dimexpr-#1\onebasepoint+#3\onebasepoint\relax - \ht\scratchbox\dimexpr-#2\onebasepoint+#4\onebasepoint\relax - \incolorfalse - \gotobox{\box\scratchbox}[#5]}% - \setbox\scratchbox\hbox - {\hskip\dimexpr\MPxoffset\onebasepoint+#1\onebasepoint\relax - \raise\dimexpr\MPyoffset\onebasepoint+#2\onebasepoint\relax - \box\scratchbox}% - \smashbox\scratchbox - \box\scratchbox} - -%D This special (number 50) passes positions to a tex file. -%D This method uses a two||pass approach an (mis|)|used the -%D context positioning macros. In \type {core-pos} we will -%D implement the low level submacro needed. -%D -%D \startbuffer -%D \definelayer[test] -%D -%D \setlayer -%D [test] -%D [x=\MPx{somepos-1},y=\MPy{somepos-1}] -%D {Whatever we want here!} -%D -%D \setlayer -%D [test] -%D [x=\MPx{somepos-2},y=\MPy{somepos-2}] -%D {Whatever we need there!} -%D -%D \startuseMPgraphic{oeps} -%D draw fullcircle scaled 6cm withcolor red ; -%D register ("somepos-1",1cm,2cm,center currentpicture) ; -%D register ("somepos-2",4cm,3cm,(-1cm,-2cm)) ; -%D \stopuseMPgraphic -%D -%D \framed[background=test,offset=overlay]{\useMPgraphic{oeps}} -%D \stopbuffer -%D -%D \typebuffer -%D -%D Here the width and height are not realy used, but one can -%D imagine situations where tex has to work with values -%D calculated by \METAPOST. -%D -%D \startlinecorrection -%D \getbuffer -%D \stoplinecorrection -%D -%D Later we will implement a more convenient macro: -%D -%D \starttyping -%D \setMPlayer [test] [somepos-1] {Whatever we want here!} -%D \setMPlayer [test] [somepos-2] {Whatever we need there!} -%D \stoptyping - -\defineMPspecial{50} % x y width height label - {\dosavepositionwhd - {\gMPs5}% - {0}% - {\the\dimexpr-\MPllx\onebasepoint+\gMPs1\onebasepoint\relax} - {\the\dimexpr\gMPs2\onebasepoint-\scratchdimen+\MPury\onebasepoint\relax}% scratchdimen ? - {\the\dimexpr\gMPs3\onebasepoint\relax}% - {\the\dimexpr\gMPs4\onebasepoint\relax}% - {0pt}} - -%D A few auxiliary macros. This will move to colo-ini. - -\def\MPgrayspace{DeviceGray} -\def\MPrgbspace {DeviceRGB} -\def\MPcmykspace{DeviceCMYK} -\let\MPspotspace\MPgrayspace - -\def\MPcmykBlack{0 0 0 0} -\def\MPcmykWhite{0 0 0 1} - -\def\startMPcolorresolve - {\bgroup - \def\dostartgraycolormode##1% - {\global\let\MPresolvedspace\MPgrayspace - \xdef\MPresolvedcolor{##1}}% - \def\dostartrgbcolormode ##1##2##3% - {\global\let\MPresolvedspace\MPrgbspace - \xdef\MPresolvedcolor{##1 ##2 ##3}}% - \def\dostartcmykcolormode##1##2##3##4% - {\global\let\MPresolvedspace\MPcmykspace - \xdef\MPresolvedcolor{##1 ##2 ##3 ##4}}% - \def\dostartspotcolormode##1##2% - {\global\let\MPspotspace\empty % left over ? - \xdef\MPresolvedspace{##1}% - \xdef\MPresolvedcolor{##2}% - \global\let\MPspotspace\MPresolvedspace}% signal - \dostartgraycolormode\!!zerocount} % kind of hackery initialization - -\let\stopMPcolorresolve\egroup - -\def\resolveMPrgbcolor#1#2#3\to#4% - {\startMPcolorresolve - \execcolorR#1:#2:#3:0:0\od - \stopMPcolorresolve - \let#4\MPresolvedcolor} - -\def\resolveMPcmykcolor#1#2#3#4\to#5% - {\startMPcolorresolve - \execcolorC#1:#2:#3:#4:0:0\od - \stopMPcolorresolve - \let#5\MPresolvedcolor} - -\def\resolveMPgraycolor#1\end\to#2% - {\startMPcolorresolve - \execcolorS#1:0:0\od - \stopMPcolorresolve - \let#2\MPresolvedcolor} - -\def\resolveMPspotcolor#1#2#3#4\end\to#5% - {\startMPcolorresolve - \ifnum#2>\plusone - \checkmultitonecolor{#1}% - \fi - \execcolorP#1:#2:#3:#4:0:0\od - \stopMPcolorresolve - \let#5\MPresolvedcolor} - \startMPinitializations mp_shade_version := 2 ; \stopMPinitializations -% will be done better - -\def\MPStextext#1#2#3#4#5% if we clean up this plugin model, we can - {\def\MPtextdata{#3}% % delegate the splitter to lua + redesign - \def\MPtextsize{#2}% - \def\lastMPmoveX{#4}% - \def\lastMPmoveY{#5}% - \defconvertedcommand\MPtextdata\MPtextdata % no edef - \splitstring\MPtextdata\at::::\to\MPtexttag\and\MPtextnumber - \executeifdefined{handleMPtext\MPtexttag} - {\setbox\scratchbox\hbox - {\font\temp=#1\space at #2\onebasepoint - \let\c\char - \temp - \MPfshowcommand{#3}}% - \setbox\scratchbox\hbox - {\hskip#4\onebasepoint - \raise#5\onebasepoint - \box\scratchbox}% - \smashbox\scratchbox - \box\scratchbox}} - -%D We save the special variables on a stack. It's not that -%D fast, but it make implementing the special more convenient. - -\def\MPSbegin - {\nofMParguments\zerocount} - -\def\MPSend - {\csname\MPspecial\endcsname} - -\def\MPSset - {\advance\nofMParguments\plusone - \expandafter\def\csname\@@MP\number\nofMParguments\endcsname} +%D This is done much cleaner in \MPLIB. -\def\gMPs#1{\csname\@@MP\number#1\endcsname} +% %D A common hook. +% +% \let\MPfshowcommand\empty +% +% \def\MPStextext#1#2#3#4#5% if we clean up this plugin model, we can +% {\def\MPtextdata{#3}% % delegate the splitter to lua + redesign +% \def\MPtextsize{#2}% +% \def\lastMPmoveX{#4}% +% \def\lastMPmoveY{#5}% +% \defconvertedcommand\MPtextdata\MPtextdata % no edef +% \splitstring\MPtextdata\at::::\to\MPtexttag\and\MPtextnumber +% \executeifdefined{handleMPtext\MPtexttag} +% {\setbox\scratchbox\hbox +% {\font\temp=#1\space at #2\onebasepoint +% \let\c\char +% \temp +% \MPfshowcommand{#3}}% +% \setbox\scratchbox\hbox +% {\hskip#4\onebasepoint +% \raise#5\onebasepoint +% \box\scratchbox}% +% \smashbox\scratchbox +% \box\scratchbox}} + +\unexpanded\def\MPStextext#1#2#3#4#5% if we clean up this plugin model, we can + {\setbox\scratchbox\hbox + {\font\temp=#1\space at #2\onebasepoint \let\c\char \temp #3}% + \setbox\scratchbox\hbox + {\hskip#4\onebasepoint \raise#5\onebasepoint \box\scratchbox}% + \smashbox\scratchbox + \box\scratchbox} %D The boundingbox. \def\MPSboundingbox#1#2#3#4% - {\xdef\MPllx{#1}% - \xdef\MPlly{#2}% - \xdef\MPurx{#3}% - \xdef\MPury{#4}% + {\xdef\MPllx{#1}\xdef\MPlly{#2}\xdef\MPurx{#3}\xdef\MPury{#4}% \xdef\MPwidth {\the\dimexpr#3\onebasepoint-#1\onebasepoint\relax}% \xdef\MPheight{\the\dimexpr#4\onebasepoint-#2\onebasepoint\relax}} \MPSboundingbox0000 -\def\MPSspecial#1#2% - {\csname\@@MPSK#2\endcsname} - -%D A path is (in most cases) just a sequence of \PDF\ commands. - -% \newcontitional\ignoreMPpath - -\def\MPSpath - {\PDFcode} - -\def\MPScode % hack, will be improved - {\ifconditional\ignoreMPpath - \PDFcode{h W n}% - \ifx\extraMPpathcode\empty\else - \PDFcode{\extraMPpathcode}% - \let\extraMPpathcode\empty - \fi - \setfalse\ignoreMPpath - \expandafter\gobbleoneargument - \else - \expandafter\PDFcode - \fi} - -\let\MPSrgb \dohandleMPrgb -\let\MPScmyk\dohandleMPcmyk -\let\MPSgray\dohandleMPgray -\let\MPSspot\dohandleMPspot - %D Test code: - -% \startMPcode -% fill fullcircle scaled 3cm withcolor red ; -% fill fullcircle scaled 2cm withcolor green ; -% fill fullcircle scaled 1cm withcolor blue ; -% currentpicture := currentpicture shifted (-4cm,0) ; -% fill fullcircle scaled 3cm withcolor cmyk(0,0,1,0) ; -% fill fullcircle scaled 2cm withcolor cmyk(0,1,0,0) ; -% fill fullcircle scaled 1cm withcolor cmyk(0,0,1,0) ; -% currentpicture := currentpicture shifted (-4cm,0) ; -% draw fullcircle scaled 3cm dashed evenly ; -% draw fullcircle scaled 2cm dashed withdots ; -% draw origin withpen pencircle scaled 3mm; -% currentpicture := currentpicture shifted (-4cm,0) ; -% fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red); -% fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red); -% fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green); -% fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5)); -% currentpicture := currentpicture shifted (12cm,-4cm) ; -% draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ; -% currentpicture := currentpicture shifted (-4cm,0) ; -% % bug: shift -% draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ; -% draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ; -% filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ; -% currentpicture := currentpicture shifted (-4cm,0) ; -% % shade cannot handle shift -% circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ; -% circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ; -% filldraw boundingbox currentpicture enlarged -3cm withpen pencircle scaled 1pt withcolor .5white ; -% \stopMPcode - -% We cannot use attributes for switching colors in mp literals because -% grouping (qQ) interferes. - -\ifx\colorversion\undefined \else \ifnum\colorversion>\plusone - - \def\dohandleMPgraycolor #1{\ctxlua{ctx.pdffinishtransparency() - ctx.pdfgrayliteral(\the\currentcolormodel,#1)}} - \def\dohandleMPrgbcolor #1#2#3{\ctxlua{ctx.pdffinishtransparency() - ctx.pdfrgbliteral (\the\currentcolormodel,#1,#2,#3)}} - \def\dohandleMPcmykcolor#1#2#3#4{\ctxlua{ctx.pdffinishtransparency() - ctx.pdfcmykliteral(\the\currentcolormodel,#1,#2,#3,#4)}} - \def\dohandleMPspotcolor#1#2#3#4{\ctxlua{ctx.pdffinishtransparency() - ctx.pdfspotliteral(\the\currentcolormodel,"#1",#2,"#3","#4")}} - - % we can combine the next calls - - \def\dohandleMPgraytransparency #1#2#3{\ctxlua{ctx.pdfgrayliteral(\the\currentcolormodel,#1) - ctx.pdftransparencyliteral(#2,#3)}} - \def\dohandleMPrgbtransparency #1#2#3#4#5{\ctxlua{ctx.pdfrgbliteral (\the\currentcolormodel,#1,#2,#3) - ctx.pdftransparencyliteral(#4,#5)}} - \def\dohandleMPcmyktransparency#1#2#3#4#5#6{\ctxlua{ctx.pdfcmykliteral(\the\currentcolormodel,#1,#2,#3,#4) - ctx.pdftransparencyliteral(#5,#6)}} - \def\dohandleMPspottransparency#1#2#3#4#5#6{\ctxlua{ctx.pdfspotliteral(\the\currentcolormodel,"#1",#2,"#3","#4") - ctx.pdftransparencyliteral(#5,#6)}} - - \def\dohandleMPresettransparency {\ctxlua{ctx.pdffinishtransparency()}} - - \def\resolveMPgraycolor #1\to#2{\ctxlua{ctx.resolvempgraycolor("\strippedcsname#2","MPresolvedspace",\number\currentcolormodel,#1)}} - \def\resolveMPrgbcolor #1#2#3\to#4{\ctxlua{ctx.resolvemprgbcolor ("\strippedcsname#4","MPresolvedspace",\number\currentcolormodel,#1,#2,#3)}} - \def\resolveMPcmykcolor#1#2#3#4\to#5{\ctxlua{ctx.resolvempcmykcolor("\strippedcsname#5","MPresolvedspace",\number\currentcolormodel,#1,#2,#3,#4)}} - - \def\resolveMPspotcolor#1#2#3#4\to#5% unchecked - {\ctxlua{ctx.resolvempspotcolor("\strippedcsname#5","MPresolvedspace",\number\currentcolormodel,"#1",#2,"#3","#4")}% - \xdef\MPresolvedspace{#1}% - \xdef\MPresolvedcolor{#4}% - \global\let\MPspotspace\MPresolvedspace} - - % used as callers - - \let\MPSgray\dohandleMPgraycolor - \let\MPSrgb \dohandleMPrgbcolor - \let\MPScmyk\dohandleMPcmykcolor - \let\MPspot \dohandleMPspotcolor - -\fi \fi +%D +%D \startbuffer +%D \startMPcode +%D fill fullcircle scaled 3cm withcolor red ; +%D fill fullcircle scaled 2cm withcolor green ; +%D fill fullcircle scaled 1cm withcolor blue ; +%D currentpicture := currentpicture shifted (-4cm,0) ; +%D fill fullcircle scaled 3cm withcolor cmyk(0,0,1,0) ; +%D fill fullcircle scaled 2cm withcolor cmyk(0,1,0,0) ; +%D fill fullcircle scaled 1cm withcolor cmyk(0,0,1,0) ; +%D currentpicture := currentpicture shifted (-4cm,0) ; +%D draw fullcircle scaled 3cm dashed evenly ; +%D draw fullcircle scaled 2cm dashed withdots ; +%D draw origin withpen pencircle scaled 3mm; +%D currentpicture := currentpicture shifted (-4cm,0) ; +%D fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red); +%D fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red); +%D fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green); +%D fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5)); +%D currentpicture := currentpicture shifted (12cm,-4cm) ; +%D draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ; +%D currentpicture := currentpicture shifted (-4cm,0) ; +%D % bug: shift +%D draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ; +%D draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ; +%D filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ; +%D currentpicture := currentpicture shifted (-4cm,0) ; +%D % shade cannot handle shift +%D circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ; +%D circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ; +%D filldraw boundingbox currentpicture enlarged -3cm withpen pencircle scaled 1pt withcolor .5white ; +%D \stopMPcode +%D \stopbuffer +%D +%D \typebuffer \startlinecorrection \getbuffer \stoplinecorrection \protect \endinput diff --git a/tex/context/base/meta-pdh.lua b/tex/context/base/meta-pdh.lua index e05529cc8..ef15c6a11 100644 --- a/tex/context/base/meta-pdh.lua +++ b/tex/context/base/meta-pdh.lua @@ -24,6 +24,7 @@ if not modules then modules = { } end modules ['meta-pdf'] = { local concat, format = table.concat, string.format +local texsprint = tex.sprint local ctxcatcodes = tex.ctxcatcodes mptopdf = { } @@ -148,11 +149,11 @@ end -- from lua to tex function mptopdf.pdfcode(str) - tex.sprint(ctxcatcodes,"\\PDFcode{" .. str .. "}") -- \\MPScode + texsprint(ctxcatcodes,"\\pdfliteral{" .. str .. "}") -- \\MPScode end function mptopdf.texcode(str) - tex.sprint(ctxcatcodes,str) + texsprint(ctxcatcodes,str) end -- auxiliary functions @@ -350,52 +351,23 @@ end --~ end --~ end -if false and ctx and ctx.aux and ctx.aux.definecolor then - - logs.report("mptopdf", "using attribute based mps colors") - - -- does not work due to Q-q mess-up - - function mps.setrgbcolor(r,g,b) -- extra check - r, g, b = tonumber(r), tonumber(g), tonumber(b) -- needed when we use lpeg - if r == 0.0123 and g < 0.1 then -- g is extra check - mptopdf.texcode("\\doresetattribute{transparency}\\MPSspecial{" .. g*10000 .. "}{" .. b*10000 .. "}") - elseif r == 0.123 and g < 0.1 then -- g is extra check - mptopdf.texcode("\\doresetattribute{transparency}\\MPSspecial{" .. g* 1000 .. "}{" .. b* 1000 .. "}") - else - mptopdf.texcode("\\doresetattribute{transparency}\\dosetattribute{color}{" .. colors.register('color',nil,'rgb',r,g,b) .. "}") - end - end - - function mps.setcmykcolor(c,m,y,k) - mptopdf.texcode("\\doresetattribute{transparency}\\dosetattribute{color}{" .. colors.register('color',nil,'cmyk',tonumber(c),tonumber(m),tonumber(y),tonumber(k)) .. "}") - end - - function mps.setgray(s) - mptopdf.texcode("\\doresetattribute{transparency}\\dosetattribute{color}{" .. colors.register('color',nil,'gray',tonumber(s)) .. "}") - end - -else - - function mps.setrgbcolor(r,g,b) -- extra check - r, g = tonumber(r), tonumber(g) -- needed when we use lpeg - if r == 0.0123 and g < 0.1 then - mptopdf.texcode("\\MPSspecial{" .. g*10000 .. "}{" .. b*10000 .. "}") - elseif r == 0.123 and g < 0.1 then - mptopdf.texcode("\\MPSspecial{" .. g* 1000 .. "}{" .. b* 1000 .. "}") - else - mptopdf.texcode("\\MPSrgb{" .. r .. "}{" .. g .. "}{" .. b .. "}") - end - end - - function mps.setcmykcolor(c,m,y,k) - mptopdf.texcode("\\MPScmyk{" .. c .. "}{" .. m .. "}{" .. y .. "}{" .. k .. "}") +function mps.setrgbcolor(r,g,b) -- extra check + r, g = tonumber(r), tonumber(g) -- needed when we use lpeg + if r == 0.0123 and g < 0.1 then + mptopdf.texcode("\\MPSspecial{" .. g*10000 .. "}{" .. b*10000 .. "}") + elseif r == 0.123 and g < 0.1 then + mptopdf.texcode("\\MPSspecial{" .. g* 1000 .. "}{" .. b* 1000 .. "}") + else + mptopdf.texcode("\\MPSrgb{" .. r .. "}{" .. g .. "}{" .. b .. "}") end +end - function mps.setgray(s) - mptopdf.texcode("\\MPSgray{" .. s .. "}") - end +function mps.setcmykcolor(c,m,y,k) + mptopdf.texcode("\\MPScmyk{" .. c .. "}{" .. m .. "}{" .. y .. "}{" .. k .. "}") +end +function mps.setgray(s) + mptopdf.texcode("\\MPSgray{" .. s .. "}") end function mps.specials(version,signal,factor) -- 2.0 123 1000 diff --git a/tex/context/base/meta-pdh.mkiv b/tex/context/base/meta-pdh.mkiv new file mode 100644 index 000000000..0736598cf --- /dev/null +++ b/tex/context/base/meta-pdh.mkiv @@ -0,0 +1,780 @@ +%D \module +%D [ file=meta-pdf, +%D version=2006.06.07, +%D title=\METAPOST\ Graphics, +%D subtitle=Conversion to \PDF, +%D author=Hans Hagen \& others (see text), +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Formerly known as supp-pdf.tex and supp-mpe.tex and meta-pdf.mkiv. +%D +%D Beware: this file is not used but kept for historic purposed! + +% \useMPgraphic{1} +% \testfeatureonce{250}{\setbox0\hbox{\convertMPtoPDF{test-mps-mpgraph.1}{1}{1}}} +% +% 8.4 : mkii, direct parsing by tex +% 11.8 : mkiv, dirty conversion (10.8 with dirty tricks) +% 14.5 : mkiv, clean conversion +% 7.4 : mkiv, simulated clean direct lua from mp +% 0.3 : time taken by tex to handle converted code +% +% timings may differ now that we revamped the backend + +\registerctxluafile{meta-pdf}{1.003} + +%D We will clean up the color mess later. + +\writestatus{loading}{MetaPost Graphics / MPS to PDF} + +\unprotect + +%D First we define a handy constant: + +\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup + +%D \macros +%D {convertMPtoPDF} +%D +%D The next set of macros implements \METAPOST\ to \PDF\ +%D conversion. The traditional method is in the MkII file. +%D +%D The main conversion command is: +%D +%D \starttyping +%D \convertMPtoPDF {filename} {x scale} {y scale} +%D \stoptyping +%D +%D The dimensions are derived from the bounding box. So we +%D only have to say: +%D +%D \starttyping +%D \convertMPtoPDF{mp-pra-1.eps}{1}{1} +%D \convertMPtoPDF{mp-pra-1.eps}{.5}{.5} +%D \stoptyping + +%D \macros +%D {makeMPintoPDFobject,lastPDFMPobject} +%D +%D For experts there are a few more options. When attributes +%D are to be added, the code must be embedded in an object +%D accompanied with the appropriate directives. One can +%D influence this process with \type {\makeMPintoPDFobject}. +%D +%D This option defaults to~0, because \CONTEXT\ takes care +%D of objects at another level, which saves some bytes. +%D +%D \starttabulate[|l|l|p|] +%D \NC 0 \NC never \NC don't use an object \NC\NR +%D \NC 1 \NC always \NC always use an object \NC\NR +%D \NC 2 \NC optional \NC use object when needed \NC\NR +%D \stoptabulate +%D +%D The last object number used is avaliable in the macro +%D \type {\lastPDFMPobject}. + +\ifx\makeMPintoPDFobject \undefined \chardef\makeMPintoPDFobject \zerocount \fi +\ifx\everyMPtoPDFconversion\undefined \newtoks\everyMPtoPDFconversion \fi + +\let\lastPDFMPobject \!!zerocount +\let\currentPDFresources\empty +\let\setMPextensions \relax + +\def\PDFMPformoffset + {\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi} + +\def\resetMPvariables#1#2#3% + {\global\let\MPwidth \!!zeropoint + \global\let\MPheight\!!zeropoint + \global\let\MPllx \!!zerocount + \global\let\MPlly \!!zerocount + \global\let\MPurx \!!zerocount + \global\let\MPury \!!zerocount + \xdef\MPxscale {#2}\ifx\MPxscale\empty\let\MPxscale\!!plusone\fi + \xdef\MPyscale {#3}\ifx\MPyscale\empty\let\MPyscale\!!plusone\fi + \xdef\MPfilename {#1}} + +%D The main macro: + +\def\convertMPtoPDF#1#2#3% watch the transparency reset + {\resetMPvariables{#1}{#2}{#3}% + \vbox\bgroup + \forgetall + \offinterlineskip + \setbox\scratchbox\vbox\bgroup + \setnormalcatcodes % we can be in verbatim or so + \message{[MP to PDF]}% + \startMPresources + \pdfliteral{\letterpercent\space mps begin}% + \pdfliteral{q 1 0 0 1 0 0 cm}% + \ctxlua{mptopdf.convertmpstopdf("\MPfilename")}\removeunwantedspaces + \pdfliteral{Q}% + \pdfliteral{\letterpercent\space mps end}% + \stopMPresources + \egroup + \setbox\scratchbox\hbox\bgroup + \hskip-\MPllx\onebasepoint + \raise-\MPlly\onebasepoint + \box\scratchbox + \egroup + \setbox\scratchbox\vbox to \MPheight\bgroup + \vfill + \hsize\MPwidth + \smashbox\scratchbox + \box\scratchbox + \egroup + \wd\scratchbox\MPwidth + \ht\scratchbox\MPheight + \dopackageMPgraphic\scratchbox + \egroup} + +\let\processMPtoPDFfile\convertMPtoPDF + +%D A common hook. + +\let\MPfshowcommand\empty + +%D Objects. + +\def\dopackageMPgraphic#1% #1 = boxregister + {\ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else + % an existing value of 2 signals object support (set elsewhere) + \chardef\makeMPintoPDFobject\plusone + \fi\fi + \ifcase\makeMPintoPDFobject + \box#1% + \or + \scratchdimen\PDFMPformoffset\relax + \ifdim\scratchdimen>\zeropoint % compensate for error + \setbox#1\vbox spread 2\scratchdimen + {\forgetall\vss\hbox spread 2\scratchdimen{\hss\box#1\hss}\vss}% + \fi + \setMPPDFobject{\currentPDFresources}{#1}% + \ifdim\scratchdimen>\zeropoint % compensate for error + \vbox to \MPheight + {\forgetall\vss\hbox to \MPwidth{\hss\getMPPDFobject\hss}\vss}% + \else + \getMPPDFobject + \fi + \global\let\currentPDFresources\empty + \else + \box#1% + \fi} + +\def\setMPPDFobject#1#2% resources boxnumber + {\ifx\everyPDFxform\undefined\else\the\everyPDFxform\fi + \immediate\pdfxform resources{#1}#2% + \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}} + +\let\getMPPDFobject\relax + +%D \macros +%D {deleteMPgraphic, +%D startMPresources, +%D stopMPresources} + +\ifx\deleteMPgraphic\undefined + \def\deleteMPgraphic#1{} +\fi + +\ifx\startMPresources\undefined + \let\startMPresources\relax + \let\stopMPresources\relax +\fi + +%D We implement extensions by using the \METAPOST\ special +%D mechanism. Opposite to \TEX's specials, the \METAPOST\ ones +%D are flushed before or after the graphic data, but thereby +%D are no longer connected to a position. +%D +%D We implement specials by overloading the \type {fill} +%D operator. By counting the fills, we can let the converter +%D treat the appropriate fill in a special way. The +%D specification of the speciality can have two forms, +%D determined by the setting of a boolean variable: +%D +%D \starttyping +%D _inline_specials_ := false ; % comment like code (default) +%D _inline_specials_ := true ; % command like code +%D \stoptyping +%D +%D When the specification is embedded as comment, it looks +%D like: +%D +%D \starttyping +%D %%MetaPostSpecial +%D \stoptyping +%D +%D The in||line alternative is more tuned for \POSTSCRIPT, +%D since it permits us to define a macro \type {special}. +%D +%D \starttyping +%D inline : special +%D \stoptyping +%D +%D The \type {identifier} determines what to do, and the data +%D can be used to accomplish this. A type~2 shading function +%D has identifier~2. Alltogether, the number of parameters is +%D specified in \type {size}. The \type {number} is the number +%D of the fill that needs the special treatment. For a type~2 +%D and~3 shaded fill, the datablock contains the following + +%D data: +%D +%D \starttyping +%D from to n inner_r g b x y outer_r g b x y +%D from to n inner_r g b x y radius outer_r g b x y radius +%D \stoptyping + +\newconditional\manyMPspecials \settrue\manyMPspecials + +%D In case of \PDF, we need to prepare resourcs. + +\newtoks\MPstartresources +\newtoks\MPstopresources + +\def\startMPresources + {\the\MPstartresources} + +\def\stopMPresources + {\the\MPstopresources} + +%D Some day we may consider collecting local resources. + +\appendtoks + \global\let\currentPDFresources\empty % kind of redundant +\to \MPstartresources + +% \appendtoks +% \collectPDFresources +% \global\let\currentPDFresources\collectedPDFresources +% \to \MPstopresources + +\appendtoksonce + \the\everyPDFxform +\to \MPstopresources + +%D Since colors are not subjected to transformations, we can +%D only use colors as signal. In our case, we use a dummy colored +%D path with a red color component of \type {0.n}, so \type +%D {0.001} is the first path and \type {0.010} the tenth. Since +%D \METAPOST strips trailing zeros, we have to padd the string. + +\newif\ifMPcmykcolors +\newif\ifMPspotcolors + +%D Specials: + +% \settrue \manyMPspecials \newcount\nofMParguments \let\extraMPpathcode\empty +% +% \def\@@MP {@@MP} +% \def\@@MPSK{@MPSK@} +% +% \def\MPspecial{\@@MPSK\@@MPSK\gMPs\nofMParguments} +% +% \def\defineMPspecial#1#2% +% {\setvalue{\@@MPSK\@@MPSK#1}{#2}} + +%D Special number~1 is dedicated to \CMYK\ support. If you +%D want to know why: look at this: +%D +%D \startbuffer[mp] +%D fill fullcircle xyscaled (3cm,1cm) withcolor \MPcolor{test} ; +%D \stopbuffer +%D +%D \startbuffer[cmyk] +%D \startcombination[4*1] +%D {\definecolor[test][c=1,y=.3,k=.3] \processMPbuffer[mp]} {c=1 y=.3 k=.3} +%D {\definecolor[test][c=.9,y=.15] \processMPbuffer[mp]} {c=.9 y=.15} +%D {\definecolor[test][c=.25,y=.8] \processMPbuffer[mp]} {c=.25 y=.8} +%D {\definecolor[test][c=.45,y=.1] \processMPbuffer[mp]} {c=.45 y=.1} +%D \stopcombination +%D \stopbuffer +%D +%D \placefigure +%D {\CMYK\ support disabled, +%D conversion to \RGB.} +%D {\setupcolors[cmyk=nee,state=start]\getbuffer[cmyk]} +%D +%D \placefigure +%D {\CMYK\ support enabled, +%D no support in \METAPOST.} +%D {\setupcolors[cmyk=ja,mpcmyk=nee,state=start]\getbuffer[cmyk]} +%D +%D \placefigure +%D {\CMYK\ support enabled, +%D no conversion to \RGB, +%D support in \METAPOST} +%D {\setupcolors[cmyk=ja,state=start]\getbuffer[cmyk]} + +% \let\revokeMPtransparencyspecial\relax + +%D Transparency support used specials 60 (rgb) and 61 +%D (cmyk). +%D +%D \startbuffer +%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0); +%D +%D fill p rotated 90 withcolor transparent(1,.5,yellow) ; +%D fill p rotated 210 withcolor transparent(1,.5,green) ; +%D fill p rotated 330 withcolor transparent(1,.5,blue) ; +%D \stopbuffer +%D +%D \typebuffer +%D +%D \startlinecorrection \processMPbuffer \stoplinecorrection +%D +%D One can also communicate colors between \CONTEXT\ and +%D \METAPOST: +%D +%D \startbuffer +%D \definecolor[tcyan] [c=1,k=.2,t=.5] +%D \definecolor[tmagenta][m=1,k=.2,t=.5] +%D \definecolor[tyellow] [y=1,k=.2,t=.5] +%D \stopbuffer +%D +%D \typebuffer \getbuffer +%D +%D \startbuffer +%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0); +%D +%D fill p rotated 90 withcolor \MPcolor{tcyan} ; +%D fill p rotated 210 withcolor \MPcolor{tmagenta} ; +%D fill p rotated 330 withcolor \MPcolor{tyellow} ; +%D \stopbuffer +%D +%D \startlinecorrection \processMPbuffer \stoplinecorrection + +%D Shading is an example of a more advanced graphic feature, +%D but users will seldom encounter those complications. Here +%D we only show a few simple examples, but many other +%D alternatives are possible by setting up the functions built +%D in \PDF\ in the appropriate way. +%D +%D Shading has to do with interpolation between two or more +%D points or user supplied ranges. In \PDF, the specifications +%D of a shade has to be encapsulated in objects and passed on +%D as resources. This is a \PDF\ level 1.3. feature. One can +%D simulate three dimensional shades as well and define simple +%D functions using a limited set of \POSTSCRIPT\ primitives. +%D Given the power of \METAPOST\ and these \PDF\ features, we +%D can achieve superb graphic effects. +%D +%D Since everything is hidden in \TEX\ and \METAPOST\ graphics, +%D we can stick to high level \CONTEXT\ command, as shown in +%D the following exmples. +%D +%D \startbuffer +%D \startuniqueMPgraphic{CircularShade} +%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; +%D circular_shade(p,0,.2red,.9red) ; +%D \stopuniqueMPgraphic +%D +%D \startuniqueMPgraphic{LinearShade} +%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; +%D linear_shade(p,0,.2blue,.9blue) ; +%D \stopuniqueMPgraphic +%D +%D \startuniqueMPgraphic{DuotoneShade} +%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; +%D linear_shade(p,2,.5green,.5red) ; +%D \stopuniqueMPgraphic +%D \stopbuffer +%D +%D \typebuffer +%D +%D \getbuffer +%D +%D These graphics can be hooked into the overlay mechanism, +%D which is available in many commands. +%D +%D \startbuffer +%D \defineoverlay[demo 1][\uniqueMPgraphic{CircularShade}] +%D \defineoverlay[demo 2][\uniqueMPgraphic {LinearShade}] +%D \defineoverlay[demo 3][\uniqueMPgraphic {DuotoneShade}] +%D \stopbuffer +%D +%D \typebuffer +%D +%D \getbuffer +%D +%D These backgrounds can for instance be applied to \type +%D {\framed}: +%D +%D \startbuffer +%D \setupframed[width=3cm,height=2cm,frame=off] +%D \startcombination[3*1] +%D {\framed[backgroundachtergrond=demo 1]{\bfd \white Demo 1}} {} +%D {\framed[backgroundachtergrond=demo 2]{\bfd \white Demo 2}} {} +%D {\framed[backgroundachtergrond=demo 3]{\bfd \white Demo 3}} {} +%D \stopcombination +%D \stopbuffer +%D +%D \typebuffer +%D +%D \startlinecorrection +%D \getbuffer +%D \stoplinecorrection +%D +%D There are a few more alternatives, determined by the second +%D parameter passed to \type {circular_shade} and alike. +%D +%D \def\SomeShade#1#2#3#4#5% +%D {\startuniqueMPgraphic{Shade-#1} +%D width := \overlaywidth ; +%D height := \overlayheight ; +%D path p ; p := unitsquare xscaled width yscaled height ; +%D #2_shade(p,#3,#4,#5) ; +%D \stopuniqueMPgraphic +%D \defineoverlay[Shade-#1][\uniqueMPgraphic{Shade-#1}]% +%D \framed[backgroundachtergrond=Shade-#1,width=2cm,height=2cm,frame=off]{}} +%D +%D \startlinecorrection +%D \startcombination[5*1] +%D {\SomeShade{10}{circular}{0}{.3blue}{.9blue}} {circular 0} +%D {\SomeShade{11}{circular}{1}{.3blue}{.9blue}} {circular 1} +%D {\SomeShade{12}{circular}{2}{.3blue}{.9blue}} {circular 2} +%D {\SomeShade{13}{circular}{3}{.3blue}{.9blue}} {circular 3} +%D {\SomeShade{14}{circular}{4}{.3blue}{.9blue}} {circular 4} +%D \stopcombination +%D \stoplinecorrection +%D +%D \blank +%D +%D \startlinecorrection +%D \startcombination[5*1] +%D {\SomeShade{20}{circular}{0}{.9green}{.3green}} {circular 0} +%D {\SomeShade{21}{circular}{1}{.9green}{.3green}} {circular 1} +%D {\SomeShade{22}{circular}{2}{.9green}{.3green}} {circular 2} +%D {\SomeShade{23}{circular}{3}{.9green}{.3green}} {circular 3} +%D {\SomeShade{24}{circular}{4}{.9green}{.3green}} {circular 4} +%D \stopcombination +%D \stoplinecorrection +%D +%D \blank +%D +%D \startlinecorrection +%D \startcombination[4*1] +%D {\SomeShade{30}{linear}{0}{.3red}{.9red}} {linear 0} +%D {\SomeShade{31}{linear}{1}{.3red}{.9red}} {linear 1} +%D {\SomeShade{32}{linear}{2}{.3red}{.9red}} {linear 2} +%D {\SomeShade{33}{linear}{3}{.3red}{.9red}} {linear 3} +%D \stopcombination +%D \stoplinecorrection +%D +%D These macros closely cooperate with the \METAPOST\ module +%D \type {mp-spec.mp}, which is part of the \CONTEXT\ +%D distribution. +%D +%D The low level (\PDF) implementation is based on the \TEX\ +%D based \METAPOST\ to \PDF\ converter. Shading is supported +%D by overloading the \type {fill} operator as implemented +%D earlier. In \PDF\ type~2 and~3 shading functions are +%D specified in terms of: +%D +%D \starttabulate[|Tl|l|] +%D \NC /Domain \NC sort of meeting range \NC \NR +%D \NC /C0 \NC inner shade \NC \NR +%D \NC /C1 \NC outer shade \NC \NR +%D \NC /N \NC smaller values, bigger inner circles \NC \NR +%D \stoptabulate + +% \newcount\currentPDFshade % 0 % global (document wide) counter +% +% \def\dosetMPsomePDFshade#1#2% +% {\immediate\pdfobj +% {<>}% +% \immediate\pdfobj +% {<>}% +% \global\advance\currentPDFshade \plusone +% \ctxlua{lpdf.adddocumentshade("Sh\the\currentPDFshade",lpdf.reference(\the\pdflastobj))}% +% \setxvalue{\@@MPSK#2}{\noexpand\dohandleMPshade{\the\currentPDFshade}}} +% +% \def\dosetMPlinearshade {\dosetMPsomePDFshade2}% #1 +% \def\dosetMPcircularshade{\dosetMPsomePDFshade3}% #1 +% +% \defineMPspecial{30} +% {\normalexpanded{\noexpand\resolveMPrgbcolor{\gMPs4}{\gMPs5}{\gMPs6}}\to\MPshadeA +% \normalexpanded{\noexpand\resolveMPrgbcolor{\gMPs{9}}{\gMPs{10}}{\gMPs{11}}}\to\MPshadeB +% \edef\MPshadeC{\gMPs7 \gMPs8 \gMPs{12} \gMPs{13}}% +% \dosetMPlinearshade{\gMPs{14}}} +% +% \defineMPspecial{31} +% {\normalexpanded{\noexpand\resolveMPrgbcolor{\gMPs4}{\gMPs5}{\gMPs6}}\to\MPshadeA +% \normalexpanded{\noexpand\resolveMPrgbcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}}\to\MPshadeB +% \edef\MPshadeC{\gMPs7 \gMPs8 \gMPs9 \gMPs{13} \gMPs{14} \gMPs{15}}% +% \dosetMPcircularshade{\gMPs{16}}} +% +% \defineMPspecial{32} +% {\normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA +% \normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}}\to\MPshadeB +% \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{14} \gMPs{15}}% +% \dosetMPlinearshade{\gMPs{16}}} +% +% \defineMPspecial{33} +% {\normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA +% \normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}{\gMPs{14}}}\to\MPshadeB +% \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{10} \gMPs{15} \gMPs{16} \gMPs{17}}% +% \dosetMPcircularshade{\gMPs{18}}} +% +% \defineMPspecial{34} +% {\normalexpanded{\noexpand\resolveMPspotcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA +% \normalexpanded{\noexpand\resolveMPspotcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}}\to\MPshadeB +% \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{14} \gMPs{15}}% +% \dosetMPlinearshade{\gMPs{16}}} +% +% \defineMPspecial{35} +% {\normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA +% \normalexpanded{\noexpand\resolveMPcmykcolor{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}{\gMPs{14}}}\to\MPshadeB +% \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{10} \gMPs{15} \gMPs{16} \gMPs{17}}% +% \dosetMPcircularshade{\gMPs{18}}} +% +% \newconditional\ignoreMPpath +% +% \def\dohandleMPshade#1% +% {\revokeMPtransparencyspecial +% \settrue\ignoreMPpath +% \def\extraMPpathcode{/Sh#1 sh Q}% +% \pdfliteral{q /Pattern cs}} +% +% \defineMPspecial{10} +% {\setxvalue{\@@MPSK\gMPs8}% +% {\noexpand\handleMPfigurespecial{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}{\gMPs8}}} +% +% \def\handleMPfigurespecial#1#2#3#4#5#6#7#8% todo : combine with ext fig +% {\global\letvalue{\@@MPSK#8}\empty +% \vbox to \zeropoint +% {\vss +% \hbox to \zeropoint +% {\ifcase\pdfoutput\or % will be hooked into the special driver +% \doiffileelse{#7} +% {\doifundefinedelse{mps:x:#7} +% {\immediate\pdfximage\!!width\onebasepoint\!!height\onebasepoint{#7}% +% \setxvalue{mps:x:#7}{\pdfrefximage\the\pdflastximage}}% +% {\message{[reusing figure #7]}}% +% \pdfliteral{q #1 #2 #3 #4 #5 #6 cm}% +% \rlap{\getvalue{mps:x:#7}}% +% \pdfliteral{Q}} +% {\message{[unknown figure #7]}}% +% \fi +% \hss}}} + +%D An example of using both special features is the +%D following. +%D +%D \starttyping +%D \startMPpage +%D externalfigure "hakker1b.png" scaled 22cm rotated 10 shifted (-2cm,0cm); +%D externalfigure "hakker1b.png" scaled 10cm rotated -10 ; +%D externalfigure "hakker1b.png" scaled 7cm rotated 45 shifted (8cm,12cm) ; +%D path p ; p := unitcircle xscaled 15cm yscaled 20cm; +%D path q ; q := p rotatedaround(center p,90) ; +%D path r ; r := buildcycle(p,q) ; clip currentpicture to r ; +%D path s ; s := boundingbox currentpicture enlarged 5mm ; +%D picture c ; c := currentpicture ; currentpicture := nullpicture ; +%D circular_shade(s,0,.2red,.9red) ; +%D addto currentpicture also c ; +%D \stopMPpage +%D \stoptyping + +% \defineMPspecial{20} +% {\setxvalue{\@@MPSK\gMPs6}% +% {\noexpand\handleMPhyperlink{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}}} +% +% \def\handleMPhyperlink#1#2#3#4#5#6% +% {\global\letvalue{\@@MPSK#6}\empty +% \setbox\scratchbox\hbox +% {\setbox\scratchbox\null +% \wd\scratchbox\dimexpr-#1\onebasepoint+#3\onebasepoint\relax +% \ht\scratchbox\dimexpr-#2\onebasepoint+#4\onebasepoint\relax +% \gotobox{\box\scratchbox}[#5]}% +% \setbox\scratchbox\hbox +% {\hskip\dimexpr\MPxoffset\onebasepoint+#1\onebasepoint\relax +% \raise\dimexpr\MPyoffset\onebasepoint+#2\onebasepoint\relax +% \box\scratchbox}% +% \smashbox\scratchbox +% \box\scratchbox} + +%D This special (number 50) passes positions to a tex file. +%D This method uses a two||pass approach an (mis|)|used the +%D context positioning macros. In \type {core-pos} we will +%D implement the low level submacro needed. +%D +%D \startbuffer +%D \definelayer[test] +%D +%D \setlayer +%D [test] +%D [x=\MPx{somepos-1},y=\MPy{somepos-1}] +%D {Whatever we want here!} +%D +%D \setlayer +%D [test] +%D [x=\MPx{somepos-2},y=\MPy{somepos-2}] +%D {Whatever we need there!} +%D +%D \startuseMPgraphic{oeps} +%D draw fullcircle scaled 6cm withcolor red ; +%D register ("somepos-1",1cm,2cm,center currentpicture) ; +%D register ("somepos-2",4cm,3cm,(-1cm,-2cm)) ; +%D \stopuseMPgraphic +%D +%D \framed[background=test,offset=overlay]{\useMPgraphic{oeps}} +%D \stopbuffer +%D +%D \typebuffer +%D +%D Here the width and height are not realy used, but one can +%D imagine situations where tex has to work with values +%D calculated by \METAPOST. +%D +%D \startlinecorrection +%D \getbuffer +%D \stoplinecorrection +%D +%D Later we will implement a more convenient macro: +%D +%D \starttyping +%D \setMPlayer [test] [somepos-1] {Whatever we want here!} +%D \setMPlayer [test] [somepos-2] {Whatever we need there!} +%D \stoptyping + +% \defineMPspecial{50} % x y width height label +% {\dosavepositionwhd +% {\gMPs5}% +% {0}% +% {\the\dimexpr-\MPllx\onebasepoint+\gMPs1\onebasepoint\relax} +% {\the\dimexpr\gMPs2\onebasepoint-\scratchdimen+\MPury\onebasepoint\relax}% scratchdimen ? +% {\the\dimexpr\gMPs3\onebasepoint\relax}% +% {\the\dimexpr\gMPs4\onebasepoint\relax}% +% {0pt}} + +\startMPinitializations + mp_shade_version := 2 ; +\stopMPinitializations + +%D This is done much cleaner in \MPLIB. + +\def\MPStextext#1#2#3#4#5% if we clean up this plugin model, we can + {\def\MPtextdata{#3}% % delegate the splitter to lua + redesign + \def\MPtextsize{#2}% + \def\lastMPmoveX{#4}% + \def\lastMPmoveY{#5}% + \defconvertedcommand\MPtextdata\MPtextdata % no edef + \splitstring\MPtextdata\at::::\to\MPtexttag\and\MPtextnumber + \executeifdefined{handleMPtext\MPtexttag} + {\setbox\scratchbox\hbox + {\font\temp=#1\space at #2\onebasepoint + \let\c\char + \temp + \MPfshowcommand{#3}}% + \setbox\scratchbox\hbox + {\hskip#4\onebasepoint + \raise#5\onebasepoint + \box\scratchbox}% + \smashbox\scratchbox + \box\scratchbox}} + +%D We save the special variables on a stack. It's not that +%D fast, but it make implementing the special more convenient. + +% \def\MPSbegin +% {\nofMParguments\zerocount} +% +% \def\MPSend +% {\csname\MPspecial\endcsname} +% +% \def\MPSset +% {\advance\nofMParguments\plusone +% \expandafter\def\csname\@@MP\number\nofMParguments\endcsname} +% +% \def\gMPs#1{\csname\@@MP\number#1\endcsname} + +%D The boundingbox. + +\def\MPSboundingbox#1#2#3#4% + {\xdef\MPllx{#1}\xdef\MPlly{#2}\xdef\MPurx{#3}\xdef\MPury{#4}% + \xdef\MPwidth {\the\dimexpr#3\onebasepoint-#1\onebasepoint\relax}% + \xdef\MPheight{\the\dimexpr#4\onebasepoint-#2\onebasepoint\relax}} + +\MPSboundingbox0000 + +% \def\MPSspecial#1#2% +% {\csname\@@MPSK#2\endcsname} + +%D A path is (in most cases) just a sequence of \PDF\ commands. + +% \newconditional\ignoreMPpath + +% \def\MPSpath +% {\pdfliteral} + +% \def\MPScode % hack, will be improved +% {\ifconditional\ignoreMPpath +% \pdfliteral{h W n}% +% \ifx\extraMPpathcode\empty\else +% \pdfliteral{\extraMPpathcode}% +% \let\extraMPpathcode\empty +% \fi +% \setfalse\ignoreMPpath +% \expandafter\gobbleoneargument +% \else +% \expandafter\pdfliteral +% \fi} + +%D Test code: + +% \startMPcode +% fill fullcircle scaled 3cm withcolor red ; +% fill fullcircle scaled 2cm withcolor green ; +% fill fullcircle scaled 1cm withcolor blue ; +% currentpicture := currentpicture shifted (-4cm,0) ; +% fill fullcircle scaled 3cm withcolor cmyk(0,0,1,0) ; +% fill fullcircle scaled 2cm withcolor cmyk(0,1,0,0) ; +% fill fullcircle scaled 1cm withcolor cmyk(0,0,1,0) ; +% currentpicture := currentpicture shifted (-4cm,0) ; +% draw fullcircle scaled 3cm dashed evenly ; +% draw fullcircle scaled 2cm dashed withdots ; +% draw origin withpen pencircle scaled 3mm; +% currentpicture := currentpicture shifted (-4cm,0) ; +% fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red); +% fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red); +% fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green); +% fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5)); +% currentpicture := currentpicture shifted (12cm,-4cm) ; +% draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ; +% currentpicture := currentpicture shifted (-4cm,0) ; +% % bug: shift +% draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ; +% draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ; +% filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ; +% currentpicture := currentpicture shifted (-4cm,0) ; +% % shade cannot handle shift +% circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ; +% circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ; +% filldraw boundingbox currentpicture enlarged -3cm withpen pencircle scaled 1pt withcolor .5white ; +% \stopMPcode + +% We cannot use attributes for switching colors in mp literals because +% grouping (qQ) interferes. + +% \def\dohandleMPshade#1% +% {\revokeMPtransparencyspecial +% \settrue\ignoreMPpath +% \def\extraMPpathcode{/#1 sh Q}% +% \pdfliteral{q /Pattern cs}} + +\protect \endinput diff --git a/tex/context/base/metatex.tex b/tex/context/base/metatex.tex index c7ceb005d..df674c11a 100644 --- a/tex/context/base/metatex.tex +++ b/tex/context/base/metatex.tex @@ -37,12 +37,12 @@ \def\loadcorefile#1{\normalinput#1\relax} -\loadcorefile{syst-ini.tex} % some basic commands and allocations that are expected down the line -\loadcorefile{syst-pln.tex} % plain tex initializations of internal registers (no further code) +\loadcorefile{syst-ini} % some basic commands and allocations that are expected down the line +\loadcorefile{syst-pln} % plain tex initializations of internal registers (no further code) -\loadcorefile{luat-cod.tex} % -\loadcorefile{luat-bas.tex} % -\loadcorefile{luat-lib.tex} % +\loadmarkfile{luat-cod} % +\loadmarkfile{luat-bas} % +\loadmarkfile{luat-lib} % % needs stripping: @@ -54,12 +54,12 @@ % helpers, maybe less -\loadcorefile{syst-aux.tex} % a whole lot of auxiliary macros -%loadcorefile{syst-lua.tex} % some helpers using lua instead -%loadcorefile{syst-con.mkiv} % some rather basic conversions -%loadcorefile{syst-fnt.mkiv} -%loadcorefile{syst-str.mkiv} -%loadcorefile{syst-rtp.mkiv} +\loadmarkfile{syst-aux} % a whole lot of auxiliary macros +%loadmarkfile{syst-lua} % some helpers using lua instead +%loadmarkfile{syst-con} % some rather basic conversions +%loadmarkfile{syst-fnt} +%loadmarkfile{syst-str} +%loadmarkfile{syst-rtp} % not needed @@ -68,24 +68,24 @@ % characters -\loadcorefile{char-utf.tex} -\loadcorefile{char-ini.tex} -\loadcorefile{char-enc.tex} % \registerctxluafile{char-enc}{1.001} +\loadmarkfile{char-utf} +\loadmarkfile{char-ini} +\loadmarkfile{char-enc} % \registerctxluafile{char-enc}{1.001} % nodes -\loadcorefile{node-ini.tex} -%loadcorefile{node-fin.tex} -%loadcorefile{node-par.tex} +\loadmarkfile{node-ini} +%loadmarkfile{node-fin} +%loadmarkfile{node-par} % attributes, not needed: -%loadcorefile{attr-ini.tex} +%loadmarkfile{attr-ini} % regimes -% \loadcorefile{regi-ini.mkiv} -% \loadcorefile{regi-syn.tex} +% \loadmarkfile{regi-ini} +% \loadcorefile{regi-syn} % languages @@ -132,10 +132,6 @@ %registerctxluafile{l-xml}{1.001} % needed for font database -% plain - -%loadcorefile{syst-stp.tex} % stripped plain - % why not ... \pdfoutput\plusone diff --git a/tex/context/base/mlib-ctx.lua b/tex/context/base/mlib-ctx.lua index 4d4e25a3d..2b16af28e 100644 --- a/tex/context/base/mlib-ctx.lua +++ b/tex/context/base/mlib-ctx.lua @@ -41,8 +41,15 @@ end statistics.register("metapost processing time", function() local n = metapost.n if n > 0 then - return format("%s seconds, loading: %s seconds, execution: %s seconds, n: %s", - statistics.elapsedtime(metapost), statistics.elapsedtime(mplib), statistics.elapsedtime(metapost.exectime),n) + local e = metapost.externals.n + local str = format("%s seconds, loading: %s seconds, execution: %s seconds, n: %s", + statistics.elapsedtime(metapost), statistics.elapsedtime(mplib), + statistics.elapsedtime(metapost.exectime), n) + if e > 0 then + return format("%s, external: %s seconds (%s calls)", str, statistics.elapsedtime(metapost.externals), e) + else + return str + end else return nil end diff --git a/tex/context/base/mlib-pdf.lua b/tex/context/base/mlib-pdf.lua index 8dfa5e552..b0b4bfe4f 100644 --- a/tex/context/base/mlib-pdf.lua +++ b/tex/context/base/mlib-pdf.lua @@ -293,7 +293,6 @@ function metapost.flush(result,flusher,askedfig) -- pdf flusher, table en dan co prescript = object.prescript, postscript = object.postscript, } - --~ print(table.serialize(currentobject)) -- local before, inbetween, after = nil, nil, nil -- @@ -457,34 +456,32 @@ function metapost.parse(result,askedfig) end end -do +-- tracing: - -- just tracing +local t = { } - local t = { } - - local flusher = { - startfigure = function() - t = { } - texsprint(ctxcatcodes,"\\startnointerference") - end, - flushfigure = function(literals) - for i=1, #literals do - t[#t+1] = literals[i] - end - end, - stopfigure = function() - texsprint(ctxcatcodes,"\\stopnointerference") +local flusher = { + startfigure = function() + t = { } + texsprint(ctxcatcodes,"\\startnointerference") + end, + flushfigure = function(literals) + for i=1, #literals do + t[#t+1] = literals[i] end - } - - function metapost.pdfliterals(result) - metapost.flush(result,flusher) - return t + end, + stopfigure = function() + texsprint(ctxcatcodes,"\\stopnointerference") end +} +function metapost.pdfliterals(result) + metapost.flush(result,flusher) + return t end +-- so far + function metapost.totable(result) local figure = result and result.fig and result.fig[1] if figure then @@ -510,6 +507,8 @@ function metapost.totable(result) end end +-- will be overloaded later + function metapost.colorconverter() return function(cr) local n = #cr diff --git a/tex/context/base/mlib-pdf.mkiv b/tex/context/base/mlib-pdf.mkiv index 92fcb28ae..2681b0810 100644 --- a/tex/context/base/mlib-pdf.mkiv +++ b/tex/context/base/mlib-pdf.mkiv @@ -15,8 +15,6 @@ \registerctxluafile{mlib-pdf}{1.001} -% \let\MPLIBtoPDF\pdfliteral - \def\MPLIBtoPDF#1{\ctxlua{metapost.flush_literal(#1)}} \def\MPLIBboundingbox#1#2#3#4% @@ -31,7 +29,7 @@ {\naturalhbox\bgroup \doactivatecolor\s!black\forcecolorhack \MPLIBboundingbox{#1}{#2}{#3}{#4}% - \forgetall + %\forgetall % done already elsewhere \setbox\scratchbox\vbox\bgroup \noindent % this is really needed in order to force tex into proper cm's \startMPresources} @@ -81,7 +79,7 @@ {\font\temp=#1\space at #2\onebasepoint \let\c\char \temp - \MPfshowcommand{#3}}% + #3}% \setbox\scratchbox\hbox {\hskip#4\onebasepoint \raise#5\onebasepoint diff --git a/tex/context/base/mlib-pps.lua b/tex/context/base/mlib-pps.lua index 04a9ba230..d5ce9e869 100644 --- a/tex/context/base/mlib-pps.lua +++ b/tex/context/base/mlib-pps.lua @@ -27,6 +27,7 @@ local cmyktogray = colors.cmyktogray or function() return 0 end metapost = metapost or { } metapost.specials = metapost.specials or { } metapost.specials.data = metapost.specials.data or { } +metapost.externals = metapost.externals or { n = 0 } local data = metapost.specials.data @@ -40,21 +41,25 @@ local colordata = { {}, {}, {}, {}, {} } --~ => rest : r=123 g=n>10 b=whatever local nooutercolor = "0 g 0 G" -local nooutertransparency = "/Tr0 gs" +local nooutertransparency = "/Tr0 gs" -- only when set local outercolormode = 0 local outercolor = nooutercolor local outertransparency = nooutertransparency local innercolor = nooutercolor local innertransparency = nooutertransparency -function metapost.set_outer_color(mode,color,transparency) +local pdfcolor, pdftransparency = lpdf.color, lpdf.transparency +local registercolor, registerspotcolor = colors.register, colors.registerspotcolor +local registertransparencies = transparencies.register + +function metapost.set_outer_color(mode,colormodel,colorattribute,transparencyattribute) -- has always to be called before conversion -- todo: transparency (not in the mood now) outercolormode = mode if mode == 1 or mode == 3 then - -- inherit from outer - outercolor = color or nooutercolor - outertransparency = transparency or nooutertransparency + -- inherit from outer (registered color) + outercolor = pdfcolor(colormodel,colorattribute) or nooutercolor + outertransparency = pdftransparency(transparencyattribute) or nooutertransparency elseif mode == 2 then -- stand alone outercolor = "" @@ -63,8 +68,8 @@ function metapost.set_outer_color(mode,color,transparency) outercolor = nooutercolor outertransparency = nooutertransparency end - innercolor = outercolor - innertransparency = outertransparency + innercolor = outercolor + innertransparency = outertransparency -- not yet used end local function checked_color_pair(color) @@ -117,7 +122,12 @@ function metapost.specials.register(str) -- only colors --~ end end -function metapost.colorhandler(cs, object, result, colorconverter) +local function spotcolorconverter(parent, n, d, p) + registerspotcolor(parent) + return pdfcolor(colors.model,registercolor('color',nil,'spot',parent,n,d,p)) +end + +function metapost.colorhandler(cs, object, result, colorconverter) -- handles specials local cr = outercolor local what = round(cs[2]*10000) local data = colordata[what] @@ -129,16 +139,14 @@ function metapost.colorhandler(cs, object, result, colorconverter) elseif what == 1 then result[#result+1], cr = colorconverter({ data[2], data[3], data[4], data[5] }) elseif what == 2 then - ctx.registerspotcolor(data[2]) - result[#result+1] = ctx.pdfcolor(colors.model,colors.register('color',nil,'spot',data[2],data[3],data[4],data[5])) + result[#result+1] = spotcolorconverter(data[2],data[3],data[4],data[5]) else if what == 3 then result[#result+1], cr = colorconverter({ data[3], data[4], data[5]}) elseif what == 4 then result[#result+1], cr = colorconverter({ data[3], data[4], data[5], data[6]}) elseif what == 5 then - ctx.registerspotcolor(data[3]) - result[#result+1] = ctx.pdfcolor(colors.model,colors.register('color',nil,'spot',data[3],data[4],data[5],data[6])) + result[#result+1] = spotcolorconverter(data[3],data[4],data[5],data[6]) end object.prescript = "tr" object.postscript = data[1] .. "," .. data[2] @@ -147,30 +155,28 @@ function metapost.colorhandler(cs, object, result, colorconverter) return object, cr end -function metapost.colorspec(cs) +function metapost.colorspec(cs) -- used for shades ... returns table (for checking) or string (spot) local what = round(cs[2]*10000) local data = colordata[what][round(cs[3]*10000)] if not data then return { 0 } elseif what == 1 then - return { data[2], data[3], data[4], data[5] } + return { tonumber(data[2]), tonumber(data[3]), tonumber(data[4]), tonumber(data[5]) } elseif what == 2 then - ctx.registerspotcolor(data[2]) - return ctx.pdfcolor(colors.model,colors.register('color',nil,'spot',data[2],data[3],data[4],data[5])) + return spotcolorconverter(data[2],data[3],data[4],data[5]) elseif what == 3 then - return { data[3], data[4], data[5] } + return { tonumber(data[3]), tonumber(data[4]), tonumber(data[5]) } elseif what == 4 then - return { data[3], data[4], data[5], data[6] } + return { tonumber(data[3]), tonumber(data[4]), tonumber(data[5]), tonumber(data[6]) } elseif what == 5 then - ctx.registerspotcolor(data[3]) - return ctx.pdfcolor(colors.model,colors.register('color',nil,'spot',data[3],data[4],data[5],data[6])) + return spotcolorconverter(data[3],data[4],data[5],data[6]) end end function metapost.specials.tr(specification,object,result) local a, t = match(specification,"^(.+),(.+)$") local before = a and t and function() - result[#result+1] = format("/Tr%s gs",transparencies.register('mp',a,t)) + result[#result+1] = format("/Tr%s gs",registertransparencies('mp',a,t)) return object, result end local after = before and function() @@ -182,6 +188,7 @@ end local specificationsplitter = lpeg.Ct(lpeg.splitat(" ")) local colorsplitter = lpeg.Ct(lpeg.splitat(":")) +local colorsplitter = lpeg.Ct(lpeg.splitter(":",tonumber)) -- Unfortunately we cannot use cmyk colors natively because there is no -- generic color allocation primitive ... it's just an rgbcolor color.. This @@ -273,20 +280,12 @@ function metapost.specials.cs(specification,object,result,flusher) -- spot color local cb = colorsplitter:match(t[8]) if round(ca[1]*10000) == 123 then ca = metapost.colorspec(ca) end if round(cb[1]*10000) == 123 then cb = metapost.colorspec(cb) end + local name = format("MplSh%s",nofshades) + local domain = { tonumber(t[1]), tonumber(t[2]) } + local coordinates = { tonumber(t[5]), tonumber(t[6]), tonumber(t[7]), tonumber(t[9]), tonumber(t[10]), tonumber(t[11]) } if type(ca) == "string" then - -- spot color, not supported, maybe at some point use the fallbacks - sprint(ctxcatcodes,format("\\MPLIBcircularshade{%s}{%s %s}{%.3f}{%.3f}{%s}{%s}{%s %s %s %s %s %s}", - nofshades, - t[1], t[2], 0, 1, 1, "DeviceGray", - t[5], t[6], t[7], t[9], t[10], t[11])) --- terrible hack, somehow does not work ---~ local a = ca:match("^([^ ]+)") ---~ local b = cb:match("^([^ ]+)") ---~ sprint(ctxcatcodes,format("\\xMPLIBcircularshade{%s}{%s %s}{%s}{%s}{%s}{%s}{%s %s %s %s %s %s}", ---~ nofshades, ---~ --~ t[1], t[2], a, b, 1, "DeviceN", ---~ 0, 1, a, b, 1, "DeviceN", ---~ t[5], t[6], t[7], t[9], t[10], t[11])) + -- backend specific (will be renamed) + lpdf.circularshade(name,domain,{ 0 },{ 1 },1,"DeviceGray",coordinates) else if #ca > #cb then normalize(ca,cb) @@ -307,10 +306,8 @@ function metapost.specials.cs(specification,object,result,flusher) -- spot color ca[1], ca[2], ca[3] = a, a, a cb[1], cb[2], cb[3] = b, b, b end - sprint(ctxcatcodes,format("\\MPLIBcircularshade{%s}{%s %s}{%.3f %.3f %.3f}{%.3f %.3f %.3f}{%s}{%s}{%s %s %s %s %s %s}", - nofshades, - t[1], t[2], ca[1], ca[2], ca[3], cb[1], cb[2], cb[3], 1, "DeviceRGB", - t[5], t[6], t[7], t[9], t[10], t[11])) + -- backend specific (will be renamed) + lpdf.circularshade(name,domain,ca,cb,1,"DeviceRGB",coordinates) elseif model == "cmyk" then if #ca == 3 then ca[1], ca[2], ca[3], ca[4] = rgbtocmyk(ca[1],ca[2],ca[3]) @@ -319,10 +316,8 @@ function metapost.specials.cs(specification,object,result,flusher) -- spot color ca[1], ca[2], ca[3], ca[4] = 0, 0, 0, ca[1] cb[1], cb[2], cb[3], ca[4] = 0, 0, 0, ca[1] end - sprint(ctxcatcodes,format("\\MPLIBcircularshade{%s}{%s %s}{%.3f %.3f %.3f %.3f}{%.3f %.3f %.3f %.3f}{%s}{%s}{%s %s %s %s %s %s}", - nofshades, - t[1], t[2], ca[1], ca[2], ca[3], ca[4], cb[1], cb[2], cb[3], cb[4], 1, "DeviceCMYK", - t[5], t[6], t[7], t[9], t[10], t[11])) + -- backend specific (will be renamed) + lpdf.circularshade(name,domain,ca,cb,1,"DeviceCMYK",coordinates) else if #ca == 4 then ca[1] = cmyktogray(ca[1],ca[2],ca[3],ca[4]) @@ -331,10 +326,8 @@ function metapost.specials.cs(specification,object,result,flusher) -- spot color ca[1] = rgbtogray(ca[1],ca[2],ca[3]) cb[1] = rgbtogray(cb[1],cb[2],cb[3]) end - sprint(ctxcatcodes,format("\\MPLIBcircularshade{%s}{%s %s}{%.3f}{%.3f}{%s}{%s}{%s %s %s %s %s %s}", - nofshades, - t[1], t[2], ca[1], cb[1], 1, "DeviceGray", - t[5], t[6], t[7], t[9], t[10], t[11])) + -- backend specific (will be renamed) + lpdf.circularshade(name,domain,ca,cb,1,"DeviceGRAY",coordinates) end end local before = function() @@ -342,7 +335,7 @@ function metapost.specials.cs(specification,object,result,flusher) -- spot color return object, result end local after = function() - result[#result+1] = format("W n /MpSh%s sh Q", nofshades) + result[#result+1] = format("W n /%s sh Q", name) return object, result end object.color, object.type = nil, nil @@ -359,12 +352,12 @@ function metapost.specials.ls(specification,object,result,flusher) local cb = colorsplitter:match(t[7]) if round(ca[1]*10000) == 123 then ca = metapost.colorspec(ca) end if round(cb[1]*10000) == 123 then cb = metapost.colorspec(cb) end + local name = format("MpSh%s",nofshades) + local domain = { tonumber(t[1]), tonumber(t[2]) } + local coordinates = { tonumber(t[5]), tonumber(t[6]), tonumber(t[7]), tonumber(t[9]) } if type(ca) == "string" then - -- spot color, not supported, maybe at some point use the fallbacks - sprint(ctxcatcodes,format("\\MPLIBlinearshade{%s}{%s %s}{%.3f}{%.3f}{%s}{%s}{%s %s %s %s}", - nofshades, - t[1], t[2], 0, 1, 1, "DeviceGray", - t[5], t[6], t[8], t[9])) + -- backend specific (will be renamed) + lpdf.linearshade(name,domain,{ 0 },{ 1 },1,"DeviceGray",coordinates) else if #ca > #cb then normalize(ca,cb) @@ -384,10 +377,8 @@ function metapost.specials.ls(specification,object,result,flusher) ca[1], ca[2], ca[3] = a, a, a cb[1], cb[2], cb[3] = b, b, b end - sprint(ctxcatcodes,format("\\MPLIBlinearshade{%s}{%s %s}{%.3f %.3f %.3f}{%.3f %.3f %.3f}{%s}{%s}{%s %s %s %s}", - nofshades, - t[1], t[2], ca[1], ca[2], ca[3], cb[1], cb[2], cb[3], 1, "DeviceRGB", - t[5], t[6], t[8], t[9])) + -- backend specific (will be renamed) + lpdf.linearshade(name,domain,ca,cb,1,"DeviceRGB",coordinates) elseif model == "cmyk" then if #ca == 3 then ca[1], ca[2], ca[3], ca[4] = rgbtocmyk(ca[1],ca[2],ca[3]) @@ -396,10 +387,8 @@ function metapost.specials.ls(specification,object,result,flusher) ca[1], ca[2], ca[3], ca[4] = 0, 0, 0, ca[1] cb[1], cb[2], cb[3], ca[4] = 0, 0, 0, ca[1] end - sprint(ctxcatcodes,format("\\MPLIBlinearshade{%s}{%s %s}{%.3f %.3f %.3f %.3f}{%.3f %.3f %.3f %.3f}{%s}{%s}{%s %s %s %s}", - nofshades, - t[1], t[2], ca[1], ca[2], ca[3], ca[4], cb[1], cb[2], cb[3], cb[4], 1, "DeviceCMYK", - t[5], t[6], t[8], t[9])) + -- backend specific (will be renamed) + lpdf.linearshade(name,domain,ca,cb,1,"DeviceCMYK",coordinates) else if #ca == 4 then ca[1] = cmyktogray(ca[1],ca[2],ca[3],ca[4]) @@ -408,10 +397,8 @@ function metapost.specials.ls(specification,object,result,flusher) ca[1] = rgbtogray(ca[1],ca[2],ca[3]) cb[1] = rgbtogray(cb[1],cb[2],cb[3]) end - sprint(ctxcatcodes,format("\\MPLIBlinearshade{%s}{%s %s}{%.3f}{%.3f}{%s}{%s}{%s %s %s %s}", - nofshades, - t[1], t[2], ca[1], cb[1], 1, "DeviceGray", - t[5], t[6], t[8], t[9])) + -- backend specific (will be renamed) + lpdf.linearshade(name,domain,ca,cb,1,"DeviceGRAY",coordinates) end end local before = function() @@ -419,7 +406,7 @@ function metapost.specials.ls(specification,object,result,flusher) return object, result end local after = function() - result[#result+1] = format("W n /MpSh%s sh Q", nofshades) + result[#result+1] = format("W n /%s sh Q", name) return object, result end object.color, object.type = nil, nil @@ -500,145 +487,146 @@ function metapost.specials.ts(specification,object,result,flusher) end end +-- rather generic pdf, so use this elsewhere too it no longer pays +-- off to distinguish between outline and fill (we now have both +-- too, e.g. in arrows) + metapost.reducetogray = true +local models = { } -function metapost.colorconverter() -- rather generic pdf, so use this elsewhere too - -- it no longer pays off to distinguish between outline and fill - -- (we now have both too, e.g. in arrows) - local model = colors.model - local reduce = metapost.reducetogray - if model == "all" then - return function(cr) - local n = #cr - if n == 0 then - return checked_color_pair() - elseif reduce then - if n == 1 then - local s = cr[1] - return checked_color_pair(format("%.3f g %.3f G",s,s)) - elseif n == 3 then - local r, g, b = cr[1], cr[2], cr[3] - if r == g and g == b then - return checked_color_pair(format("%.3f g %.3f G",r,r)) - else - return checked_color_pair(format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b)) - end - else - local c, m, y, k = cr[1], cr[2], cr[3], cr[4] - if c == m and m == y and y == 0 then - k = 1 - k - return checked_color_pair(format("%.3f g %.3f G",k,k)) - else - return checked_color_pair(format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k)) - end - end - elseif n == 1 then - local s = cr[1] - return checked_color_pair(format("%.3f g %.3f G",s,s)) - elseif n == 3 then - local r, g, b = cr[1], cr[2], cr[3] +function models.all(cr) + local n = #cr + if n == 0 then + return checked_color_pair() + elseif metapost.reducetogray then + if n == 1 then + local s = cr[1] + return checked_color_pair(format("%.3f g %.3f G",s,s)) + elseif n == 3 then + local r, g, b = cr[1], cr[2], cr[3] + if r == g and g == b then + return checked_color_pair(format("%.3f g %.3f G",r,r)) + else return checked_color_pair(format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b)) + end + else + local c, m, y, k = cr[1], cr[2], cr[3], cr[4] + if c == m and m == y and y == 0 then + k = 1 - k + return checked_color_pair(format("%.3f g %.3f G",k,k)) else - local c, m, y, k = cr[1], cr[2], cr[3], cr[4] return checked_color_pair(format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k)) end end - elseif model == "rgb" then - return function(cr) - local n = #cr - if n == 0 then - return checked_color_pair() - elseif reduce then - if n == 1 then - local s = cr[1] - checked_color_pair(format("%.3f g %.3f G",s,s)) - elseif n == 3 then - local r, g, b = cr[1], cr[2], cr[3] - if r == g and g == b then - return checked_color_pair(format("%.3f g %.3f G",r,r)) - else - return checked_color_pair(format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b)) - end - else - local c, m, y, k = cr[1], cr[2], cr[3], cr[4] - if c == m and m == y and y == 0 then - k = 1 - k - return checked_color_pair(format("%.3f g %.3f G",k,k)) - else - local r, g, b = cmyktorgb(c,m,y,k) - return checked_color_pair(format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b)) - end - end - elseif n == 1 then - local s = cr[1] - return checked_color_pair(format("%.3f g %.3f G",s,s)) + elseif n == 1 then + local s = cr[1] + return checked_color_pair(format("%.3f g %.3f G",s,s)) + elseif n == 3 then + local r, g, b = cr[1], cr[2], cr[3] + return checked_color_pair(format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b)) + else + local c, m, y, k = cr[1], cr[2], cr[3], cr[4] + return checked_color_pair(format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k)) + end +end + +function models.rgb(cr) + local n = #cr + if n == 0 then + return checked_color_pair() + elseif metapost.reducetogray then + if n == 1 then + local s = cr[1] + checked_color_pair(format("%.3f g %.3f G",s,s)) + elseif n == 3 then + local r, g, b = cr[1], cr[2], cr[3] + if r == g and g == b then + return checked_color_pair(format("%.3f g %.3f G",r,r)) else - local r, g, b - if n == 3 then - r, g, b = cmyktorgb(cr[1],cr[2],cr[3],cr[4]) - else - r, g, b = cr[1], cr[2], cr[3] - end return checked_color_pair(format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b)) end - end - elseif model == "cmyk" then - return function(cr) - local n = #cr - if n == 0 then - return checked_color_pair() - elseif reduce then - if n == 1 then - local s = cr[1] - return checked_color_pair(format("%.3f g %.3f G",s,s)) - elseif n == 3 then - local r, g, b = cr[1], cr[2], cr[3] - if r == g and g == b then - return checked_color_pair(format("%.3f g %.3f G",r,r)) - else - local c, m, y, k = rgbtocmyk(r,g,b) - return checked_color_pair(format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k)) - end - else - local c, m, y, k = cr[1], cr[2], cr[3], cr[4] - if c == m and m == y and y == 0 then - k = 1 - k - return checked_color_pair(format("%.3f g %.3f G",k,k)) - else - return checked_color_pair(format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k)) - end - end - elseif n == 1 then - local s = cr[1] - return checked_color_pair(format("%.3f g %.3f G",s,s)) + else + local c, m, y, k = cr[1], cr[2], cr[3], cr[4] + if c == m and m == y and y == 0 then + k = 1 - k + return checked_color_pair(format("%.3f g %.3f G",k,k)) else - local c, m, y, k - if n == 3 then - c, m, y, k = rgbtocmyk(cr[1],cr[2],cr[3]) - else - c, m, y, k = cr[1], cr[2], cr[3], cr[4] - end - return checked_color_pair(format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k)) + local r, g, b = cmyktorgb(c,m,y,k) + return checked_color_pair(format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b)) end end + elseif n == 1 then + local s = cr[1] + return checked_color_pair(format("%.3f g %.3f G",s,s)) else - return function(cr) - local n, s = #cr, 0 - if n == 0 then - return checked_color_pair() - elseif n == 4 then - s = cmyktogray(cr[1],cr[2],cr[3],cr[4]) - elseif n == 3 then - s = rgbtogray(cr[1],cr[2],cr[3]) + local r, g, b + if n == 3 then + r, g, b = cmyktorgb(cr[1],cr[2],cr[3],cr[4]) + else + r, g, b = cr[1], cr[2], cr[3] + end + return checked_color_pair(format("%.3f %.3f %.3f rg %.3f %.3f %.3f RG",r,g,b,r,g,b)) + end +end + +function models.cmyk(cr) + local n = #cr + if n == 0 then + return checked_color_pair() + elseif metapost.reducetogray then + if n == 1 then + local s = cr[1] + return checked_color_pair(format("%.3f g %.3f G",s,s)) + elseif n == 3 then + local r, g, b = cr[1], cr[2], cr[3] + if r == g and g == b then + return checked_color_pair(format("%.3f g %.3f G",r,r)) else - s = cr[1] + local c, m, y, k = rgbtocmyk(r,g,b) + return checked_color_pair(format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k)) end - return checked_color_pair(format("%.3f g %.3f G",s,s)) + else + local c, m, y, k = cr[1], cr[2], cr[3], cr[4] + if c == m and m == y and y == 0 then + k = 1 - k + return checked_color_pair(format("%.3f g %.3f G",k,k)) + else + return checked_color_pair(format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k)) + end + end + elseif n == 1 then + local s = cr[1] + return checked_color_pair(format("%.3f g %.3f G",s,s)) + else + local c, m, y, k + if n == 3 then + c, m, y, k = rgbtocmyk(cr[1],cr[2],cr[3]) + else + c, m, y, k = cr[1], cr[2], cr[3], cr[4] end + return checked_color_pair(format("%.3f %.3f %.3f %.3f k %.3f %.3f %.3f %.3f K",c,m,y,k,c,m,y,k)) end end +function models.gray(cr) + local n, s = #cr, 0 + if n == 0 then + return checked_color_pair() + elseif n == 4 then + s = cmyktogray(cr[1],cr[2],cr[3],cr[4]) + elseif n == 3 then + s = rgbtogray(cr[1],cr[2],cr[3]) + else + s = cr[1] + end + return checked_color_pair(format("%.3f g %.3f G",s,s)) +end + +function metapost.colorconverter() + return models[colors.model] or gray +end + do local P, S, V, Cs = lpeg.P, lpeg.S, lpeg.V, lpeg.Cs @@ -829,6 +817,9 @@ end function metapost.intermediate.actions.makempy() if #graphics > 0 then + local externals = metapost.externals + externals.n = externals.n + 1 + statistics.starttiming(externals) local mpofile = tex.jobname .. "-mpgraph" local mpyfile = file.replacesuffix(mpofile,"mpy") local pdffile = file.replacesuffix(mpofile,"pdf") @@ -846,6 +837,7 @@ function metapost.intermediate.actions.makempy() io.savedata(mpyfile,concat(result,"")) end end - graphics = { } + statistics.stoptiming(externals) + graphics = { } -- ? end end diff --git a/tex/context/base/mlib-pps.mkiv b/tex/context/base/mlib-pps.mkiv index beaef044e..83880994b 100644 --- a/tex/context/base/mlib-pps.mkiv +++ b/tex/context/base/mlib-pps.mkiv @@ -15,15 +15,7 @@ \registerctxluafile{mlib-pps}{1.001} -\def\MPLIBcircularshade#1#2#3#4#5#6#7% nr domain color-a color-b ? colorspace oordinates - {\immediate\pdfobj{<>}% - \immediate\pdfobj{<>}% - \appendtoPDFdocumentshades{/MpSh#1 \the\pdflastobj\space0 R }} - -\def\MPLIBlinearshade#1#2#3#4#5#6#7% nr domain color-a color-b ? colorspace oordinates - {\immediate\pdfobj{<>}% - \immediate\pdfobj{<>}% - \appendtoPDFdocumentshades{/MpSh#1 \the\pdflastobj\space0 R }} +% this will move ! \def\MPLIBfigure#1#2#3#4#5#6#7% todo: move Q q to lua {\setbox\scratchbox\hbox{\externalfigure[#7]}% @@ -38,13 +30,7 @@ \def\MPLIBfreetext#1% {\global\setbox#1\emptybox} -% \def\MPLIBgettext#1#2#3#4#5#6#7% we can also use this for the figure and pass sx/sy -% {\ctxlua{metapost.edefsxsy(\number\wd#7,\number\ht#7,\number\dp#7)}% -% \pdfliteral{q #1 #2 #3 #4 #5 #6 cm}% -% \vbox to \zeropoint{\vss\hbox to \zeropoint{\scale[sx=\sx,sy=\sy]{\raise\dp#7\box#7}\hss}}% -% \pdfliteral{Q}} - -\def\MPLIBgettextscaled#1#2#3% +\def\MPLIBgettextscaled#1#2#3% why a copy {\vbox to \zeropoint{\vss\hbox to \zeropoint{\black\scale[sx=#2,sy=#3]{\raise\dp#1\copy#1}\hss}}} \def\MPLIBallocate#1% diff --git a/tex/context/base/mlib-run.lua b/tex/context/base/mlib-run.lua index d22e0d742..b155dd344 100644 --- a/tex/context/base/mlib-run.lua +++ b/tex/context/base/mlib-run.lua @@ -116,7 +116,7 @@ function metapost.load(name) ini_version = false, mem_name = file.replacesuffix(name,"mem"), find_file = finder, ---~ job_name = "mplib", + -- job_name = "mplib", } ) ) local result diff --git a/tex/context/base/mult-chk.lua b/tex/context/base/mult-chk.lua index 1c74d2e38..2c1ab3c78 100644 --- a/tex/context/base/mult-chk.lua +++ b/tex/context/base/mult-chk.lua @@ -53,7 +53,7 @@ local function set(key,value) end end -local pattern = aux.make_settings_to_hash_pattern(set,true) +local pattern = aux.make_settings_to_hash_pattern(set,"tolerant") function commands.getcheckedparameters(k,p,s) if s and s ~= "" then diff --git a/tex/context/base/mult-chk.mkii b/tex/context/base/mult-chk.mkii index 6299d0cda..60f568a1e 100644 --- a/tex/context/base/mult-chk.mkii +++ b/tex/context/base/mult-chk.mkii @@ -15,6 +15,9 @@ %D No checking in \MKII. +\def\gobbleparameters{\doquadrupleempty\dogobbleparameters} % todo: 1,2,3,4 case +\def\dogobbleparameters[#1][#2][#3][#4]{} + \def\setvalidparameterkeys{\gobbleparameters} % forward reference, so no \let \def\addvalidparameterkeys{\gobbleparameters} % forward reference, so no \let diff --git a/tex/context/base/mult-cld.lua b/tex/context/base/mult-cld.lua new file mode 100644 index 000000000..c9e922afe --- /dev/null +++ b/tex/context/base/mult-cld.lua @@ -0,0 +1,174 @@ +if not modules then modules = { } end modules ['mult-cld'] = { + version = 1.001, + comment = "companion to mult-cld.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- This is an experiment: generating context code at the lua end. After all +-- it is surprisingly simple to implement due to metatables. I was wondering +-- if there was a more natural way to deal with commands at the lua end. +-- Of course it's a bit slower but often more readable when mixed with lua +-- code. It can also be handy when generating documents from databases or +-- when constructing large tables or so. +-- +-- Todo: optional checking against interface! + +context = context or { } + +local format, concat = string.format, table.concat +local next, type = next, type +local texsprint, texiowrite = tex.sprint, texio.write + +local flush = texsprint +local cache + +local function cached_flush(c,...) + local tt = { ... } + for i=1,#tt do + cache[#cache+1] = tt[i] + end +end + +local function writer(k,...) + flush(ctxcatcodes,k) + local t = { ... } + if next(t) then + for i=1,#t do + local ti = t[i] + local typ, force = type(ti), nil + while typ == "function" do + local saved_flush = flush + cache = { } + flush = cached_flush + ti, force = ti() + if force then + typ = false -- force special cases + elseif typ == "nil" then + typ = "string" + ti = concat(cache) + elseif typ == "string" then + ti = concat(cache) + end + flush = saved_flush + end + if ti == nil then + -- next + elseif typ == "string" or typ == "number" then + flush(ctxcatcodes,"{",ti,"}") + elseif typ == "table" then + flush(ctxcatcodes,"[") + local c = concat(ti,",") + if c ~= "" then + flush(ctxcatcodes,c) + else + local done = false + for k, v in next, ti do + if done then + flush(ctxcatcodes,",",k,'=',v) + else + flush(ctxcatcodes,k,'=',v) + done = true + end + end + end + flush(ctxcatcodes,"]") + -- elseif typ == "boolean" then + -- flush(ctxcatcodes,"\n") + elseif ti == true then + flush(ctxcatcodes,"\n") + elseif typ == false then + if force == "direct" then + flush(ctxcatcodes,tostring(ti)) + end + else + logs.report("interfaces","error: %s gets a weird argument %s",k,tostring(ti)) + end + end + end +end + +local function indexer(t,k) + local f = function(...) return writer("\\"..k.." ",...) end -- building the cs here saves time + t[k] = f + return f +end + +local function caller(t,f,...) + if f then + flush(ctxcatcodes,format(f,...)) + else + flush(ctxcatcodes,"\n") + end +end + +setmetatable(context, { __index = indexer, __call = caller } ) + +-- the only non macro: + +local trace_cld = false + +function context.runfile(filename) + filename = resolvers.findtexfile(filename) or "" + if filename ~= "" then + local ok = dofile(filename) + if ok then + if trace_cld then + commands.writestatus("cld","begin of file '%s'",filename) + end + ok() + if trace_cld then + commands.writestatus("cld","end of file '%s'",filename) + end + else + commands.writestatus("cld","invalid file '%s'",filename) + end + else + commands.writestatus("cld","unknown file '%s'",filename) + end +end + +-- tracking is using the regular mechanism; we need to define +-- these 'macro' functions explictly as otherwise they are are +-- delayed (as all commands print back to tex, so that tracing +-- would be enabled afterwards) + +trackers.register("cld.print", function(v) + trace_cld = v + if v then + flush = function(c,...) + texiowrite(...) + texsprint(c,...) + end + else + flush = texsprint + end +end) + +function context.enabletrackers (str) trackers.enable (str) end +function context.disabletrackers(str) trackers.disable(str) end + +-- see demo-lud.lud for an example + +-- context.starttext(true) +-- context.chapter({ "label" }, "title", true) +-- context.chapter(function() return { "label" } end, "title", true) +-- +-- context.startchapter({ title = "test" }, { more = "oeps" }, true) +-- +-- context.bTABLE(true) +-- for i=1,10 do +-- context.bTR() +-- for i=1,10 do +-- context.bTD() +-- context("%#2i",math.random(99)) +-- context.eTD() +-- end +-- context.eTR(true) +-- end +-- context.eTABLE(true) +-- +-- context.stopchapter(true) +-- +-- context.stoptext(true) diff --git a/tex/context/base/mult-cld.mkiv b/tex/context/base/mult-cld.mkiv new file mode 100644 index 000000000..050928658 --- /dev/null +++ b/tex/context/base/mult-cld.mkiv @@ -0,0 +1,20 @@ +%D \module +%D [ file=mult-ini, +%D version=2008.10.22, % 1996.06.01, +%D title=\CONTEXT\ Multilingual Macros, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This is just an idea, maybe a bad one. + +\writestatus{loading}{ConTeXt Multilingual Macros / Lua} + +\registerctxluafile{mult-cld}{1.001} + +\endinput diff --git a/tex/context/base/mult-de.tex b/tex/context/base/mult-de.tex index c73223658..3213fa7de 100644 --- a/tex/context/base/mult-de.tex +++ b/tex/context/base/mult-de.tex @@ -233,6 +233,7 @@ \setinterfacevariable{lastpage}{letzteseite} \setinterfacevariable{lastpagenumber}{lastpagenumber} \setinterfacevariable{lastsubpage}{letzteunterseite} +\setinterfacevariable{layer}{layer} \setinterfacevariable{left}{links} \setinterfacevariable{leftedge}{linkekante} \setinterfacevariable{lefthanging}{lefthanging} @@ -843,6 +844,7 @@ \setinterfaceconstant{sectionconversion}{sectionconversion} \setinterfaceconstant{sectionconversionset}{sectionconversionset} \setinterfaceconstant{sectionnumber}{abschnittsnummer} +\setinterfaceconstant{sectionresetset}{sectionresetset} \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua index dff747db1..2fea7dfe7 100644 --- a/tex/context/base/mult-def.lua +++ b/tex/context/base/mult-def.lua @@ -9766,6 +9766,9 @@ return { ["pe"]="شماره‌بخش", ["ro"]="numarsectiune", }, + ["sectionresetset"]={ + ["en"]="sectionresetset", + }, ["sectionsegments"]={ ["en"]="sectionsegments", }, @@ -13352,6 +13355,16 @@ return { ["pe"]="زیرصفحه‌آخر", ["ro"]="ultimasubpagina", }, + ["layer"]={ + ["cs"]="layer", + ["de"]="layer", + ["en"]="layer", + ["fr"]="layer", + ["it"]="layer", + ["nl"]="layer", + ["pe"]="layer", + ["ro"]="layer", + }, ["left"]={ ["cs"]="vlevo", ["de"]="links", diff --git a/tex/context/base/mult-en.tex b/tex/context/base/mult-en.tex index d9ece5dfd..50997b1d8 100644 --- a/tex/context/base/mult-en.tex +++ b/tex/context/base/mult-en.tex @@ -233,6 +233,7 @@ \setinterfacevariable{lastpage}{lastpage} \setinterfacevariable{lastpagenumber}{lastpagenumber} \setinterfacevariable{lastsubpage}{lastsubpage} +\setinterfacevariable{layer}{layer} \setinterfacevariable{left}{left} \setinterfacevariable{leftedge}{leftedge} \setinterfacevariable{lefthanging}{lefthanging} @@ -843,6 +844,7 @@ \setinterfaceconstant{sectionconversion}{sectionconversion} \setinterfaceconstant{sectionconversionset}{sectionconversionset} \setinterfaceconstant{sectionnumber}{sectionnumber} +\setinterfaceconstant{sectionresetset}{sectionresetset} \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} diff --git a/tex/context/base/mult-fr.tex b/tex/context/base/mult-fr.tex index cfc56cb5c..16f22ec7f 100644 --- a/tex/context/base/mult-fr.tex +++ b/tex/context/base/mult-fr.tex @@ -233,6 +233,7 @@ \setinterfacevariable{lastpage}{dernierepage} \setinterfacevariable{lastpagenumber}{derniernumeropage} \setinterfacevariable{lastsubpage}{dernieresouspage} +\setinterfacevariable{layer}{layer} \setinterfacevariable{left}{gauche} \setinterfacevariable{leftedge}{bordgauche} \setinterfacevariable{lefthanging}{lefthanging} @@ -843,6 +844,7 @@ \setinterfaceconstant{sectionconversion}{sectionconversion} \setinterfaceconstant{sectionconversionset}{sectionconversionset} \setinterfaceconstant{sectionnumber}{numerosection} +\setinterfaceconstant{sectionresetset}{sectionresetset} \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} diff --git a/tex/context/base/mult-his.tex b/tex/context/base/mult-his.tex deleted file mode 100644 index fe87d4bcf..000000000 --- a/tex/context/base/mult-his.tex +++ /dev/null @@ -1,1155 +0,0 @@ -%D \module -%D [ file=mult-ini, -%D version=1996.06.01, -%D title=\CONTEXT\ Multilingual Macros, -%D subtitle=Initialization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module implements the multi||lingual interface to -%D \CONTEXT. These capabilities concern messages, commands and -%D parameters. Currently the following interfaces are -%D supported: -%D -%D \starttabulate[|l|l|c|c|] -%D \NC\bf language\NC\bf translator \NC\bf messages\NC \bf interface\NC\NR -%D \NC dutch \NC Hans Hagen \NC yes \NC yes \NC\NR -%D \NC english \NC Hans Hagen \& SPQR \NC yes \NC yes \NC\NR -%D \NC german \NC Tobias Burnus \NC yes \NC yes \NC\NR -%D \NC czech \NC Tom Hudec \NC yes \NC yes \NC\NR -%D \NC italian \NC Giuseppe Bilotta \NC yes \NC yes \NC\NR -%D \NC french \NC Renaud Aubin \NC yes \NC yes \NC\NR -%D \NC romanian \NC .... \NC yes \NC yes \NC\NR -%D \NC norwegian \NC Hans Fredrik Nordhaug \NC yes \NC no \NC\NR -%D \stoptabulate - -%D to be translated: -%D -%D message : floatblocks/13 -%D variables : sorttype compress autohang - -\writestatus{loading}{ConTeXt Multilingual Macros / Initialization} - -\unprotect - -%D \macros -%D [constanten,variabelen,commands] -%D {v!,c!,k!,s!,e!,m!,l!,r!,f!,p!,x!,y!} -%D -%D In the system modules we introduced some prefixed constants, -%D variables (both macros) and registers. Apart from a -%D tremendous saving in terms of memory and a gain in speed we -%D use from now on prefixes when possible for just another -%D reason: consistency and multi||linguality. Systematically -%D using prefixed macros enables us to implement a -%D multi||lingual user interface. Redefining these next set of -%D prefixes therefore can have desastrous results. -%D -%D \startlinecorrection -%D \starttable[|c|c|c|] -%D \HL -%D \NC \bf prefix \NC \bf meaning \NC \bf application \NC\SR -%D \HL -%D \NC \type{\c!prefix!} \NC c! \NC constant (direct) \NC\FR -%D \NC \type{\e!prefix!} \NC e! \NC element \NC\MR -%D \NC \type{\f!prefix!} \NC f! \NC file \NC\MR -%D \NC \type{\k!prefix!} \NC k! \NC constant (indirect) \NC\MR -%D \NC \type{\l!prefix!} \NC l! \NC language \NC\MR -%D \NC \type{\m!prefix!} \NC m! \NC message \NC\MR -%D \NC \type{\p!prefix!} \NC p! \NC procedure \NC\MR -%D \NC \type{\r!prefix!} \NC r! \NC reference \NC\MR -%D \NC \type{\s!prefix!} \NC s! \NC system \NC\MR -%D \NC \type{\v!prefix!} \NC v! \NC variable \NC\MR -%D \NC \type{\x!prefix!} \NC x! \NC setup constant \NC\MR -%D \NC \type{\y!prefix!} \NC y! \NC setup variable \NC\LR -%D \HL -%D \stoptable -%D \stoplinecorrection -%D -%D In the single||lingual version we used \type{!}, \type{!!}, -%D \type{!!!} and \type{!!!!}. - -\def\c!prefix!{c!} \def\e!prefix!{e!} \def\f!prefix!{f!} -\def\k!prefix!{k!} \def\l!prefix!{l!} \def\m!prefix!{m!} -\def\p!prefix!{p!} \def\r!prefix!{r!} \def\s!prefix!{s!} -\def\v!prefix!{v!} \def\t!prefix!{t!} - -% \def\x!prefix!{x!} % obsolete -% \def\y!prefix!{y!} % obsolete - -%D \macros -%D [constants,variables,commands] -%D {@@,??} -%D -%D Variables generated by the system can be recognized on their -%D prefix \type{@@}. They are composed of a command (class) -%D specific tag, which can be recognized on \type{??}, and a -%D system constant, which has the prefix \type{c!}. We'll se -%D some more of this. - -\def\??prefix {??} -\def\@@prefix {@@} - -%D Just to be complete we repeat some of the already defined -%D system constants here. Maybe their prefix \type{\s!} now -%D falls into place. - -\def\s!next {next} \def\s!default {default} -\def\s!dummy {dummy} \def\s!unknown {unknown} - -\def\s!do {do} \def\s!dodo {dodo} - -\def\s!complex {complex} \def\s!start {start} -\def\s!simple {simple} \def\s!stop {stop} - -%D The word \type{height} takes 6~token memory cells. The -%D control sequence \type{\height} on the other hand uses only -%D one. Knowing this, we can improve the performance of \TEX, -%D both is terms of speed and memory usage, by using control -%D sequences instead of the words written in full. -%D -%D Where in the \ASCII\ file the second lines takes nine extra -%D characters, \TEX\ saves us 13~tokens. -%D -%D \starttyping -%D \hrule width 10pt height 2pt depth 1pt -%D \hrule \!!width 10pt \!!height 2pt \!!depth 1pt -%D \stoptyping -%D -%D One condition is that we have defined \type{\!!height}, -%D \type{\!!width} and \type{\!!depth} as respectively -%D \type{height}, \type{width} and \type{depth}. Using this -%D scheme therefore only makes sense when a token sequence is -%D used more than once. Savings like this should of course be -%D implemented in english, just because \TEX\ is english. - -\def\!!width {width} -\def\!!height {height} -\def\!!depth {depth} -\def\!!plus {plus} -\def\!!minus {minus} -\def\!!fill {fill} -\def\!!to {to} - -%D \macros -%D {defineinterfaceconstant, -%D defineinterfacevariable, -%D defineinterfaceelement, -%D definesystemvariable, -%D definesystemconstant, -%D definemessageconstant, -%D definereferenceconstant, -%D definefileconstant} -%D -%D The first part of this module is dedicated to dealing with -%D multi||lingual constants and variables. When \CONTEXT\ grew -%D bigger and bigger in terms of bytes and used string space, -%D we switched to predefined constants. At the cost of more -%D hash table entries, the macros not only becase more compact, -%D they became much faster too. Maybe an even bigger advantage -%D was that mispelling could no longer lead to problems. Even a -%D multi||lingual interface became possible. -%D -%D Constants --- we'll introduce the concept of variables later -%D on --- are preceded by a type specific prefix, followed by a -%D \type{!}. To force consistency, we provide a few commands -%D for defining such constants. -%D -%D \starttyping -%D \defineinterfaceconstant {name} {meaning} -%D \defineinterfacevariable {name} {meaning} -%D \defineinterfaceelement {name} {meaning} -%D \stoptyping -%D -%D Which is the same as: -%D -%D \starttyping -%D \def\c!name{meaning} -%D \def\v!name{meaning} -%D \def\e!name{meaning} -%D \stoptyping - -\def\defineinterfaceconstant #1#2{\setvalue{\c!prefix!#1}{#2}} -\def\defineinterfacevariable #1#2{\setvalue{\v!prefix!#1}{#2}} -\def\defineinterfaceelement #1#2{\setvalue{\e!prefix!#1}{#2}} - -%D Next come some interface independant constants: -%D -%D \starttyping -%D \definereferenceconstant {name} {meaning} -%D \definefileconstant {name} {meaning} -%D \stoptyping - -\def\definereferenceconstant #1#2{\setvalue{\r!prefix!#1}{#2}} -\def\definefileconstant #1#2{\setvalue{\f!prefix!#1}{#2}} - -%D A new one: - -\def\definetypescriptconstant#1#2{\setvalue{\t!prefix!#1}{#2}} - -%D And finaly we have the one argument, space saving constants -%D -%D \starttyping -%D \definesystemconstant {name} -%D \definemessageconstant {name} -%D \stoptyping - -\def\definesystemconstant #1{\setvalue{\s!prefix!#1}{#1}} -\def\definemessageconstant #1{\setvalue{\m!prefix!#1}{#1}} - -%D In a parameter driven system, some parameters are shared -%D by more system components. In \CONTEXT\ we can distinguish -%D parameters by a unique prefix. Such a prefix is defined -%D with: -%D -%D \starttyping -%D \definesystemvariable {name} -%D \stoptyping - -\def\definesystemvariable#1{\setevalue{\??prefix#1}{\@@prefix#1}} - -\definesystemvariable{ms} - -%D \macros -%D {selectinterface, -%D defaultinterface, currentinterface, currentresponses} -%D -%D With \type{\selectinterface} we specify the language we are -%D going to use. The system asks for the language wanted, and -%D defaults to \type{\currentinterface} when we just give -%D \type{enter}. By default the message system uses the -%D current interface language, but \type{\currentresponses} -%D can specify another language too. -%D -%D Because we want to generate formats directly too, we do -%D not ask for interface specifications when these are already -%D defined (like in cont-nl.tex and alike). - -\ifx\undefined\scratchwrite \newwrite\scratchwrite \fi -\ifx\undefined\scratchread \newwrite\scratchread \fi - -\immediate\openin\scratchread=mult-def.tex % may overload the defaults - -\ifeof\scratchread % no high level commands yet - \immediate\closein\scratchread -\else - \immediate\closein\scratchread \input mult-def.tex -\fi - -\ifx\defaultinterface\undefined - - \def\defaultinterface{english} - - \def\selectinterface - {\def\docommand##1##2% - {\bgroup - \endlinechar\minusone - \global\read16 to ##1 - \egroup - \doifnothing\currentinterface{\let##1=##2}% - \doifundefined{\s!prefix!##1}{\let##1=##2}}% - \docommand\currentinterface\defaultinterface - \writestatus{interface}{defining \currentinterface\space interface}% - \writeline - \docommand\currentresponses\currentinterface - \writestatus{interface}{using \currentresponses\space messages}% - \writeline - \let\selectinterface\relax} - -\else - - \def\selectinterface - {\writestatus{interface}{defining \currentinterface\space interface}% - \writeline - \writestatus{interface}{using \currentresponses\space messages}% - \writeline - \let\selectinterface\relax} - -\fi - -\ifx\currentinterface\undefined \let\currentinterface=\defaultinterface \fi -\ifx\currentresponses\undefined \let\currentresponses=\defaultinterface \fi - -%D \macros -%D {startinterface} -%D -%D Sometimes we want to define things only for specific -%D interface languages. This can be done by means of the -%D selector: -%D -%D \starttyping -%D \startinterface language -%D -%D language specific definitions & commands -%D -%D \stopinterface -%D \stoptyping - -\def\startinterface #1 - {\doifnotinset\currentinterface{#1}{\gobbleuntil\stopinterface}} - -\let\stopinterface\relax - -%D \macros -%D {startmessages, -%D getmessage, -%D showmessage, -%D makemessage} -%D -%D A package as large as \CONTEXT\ can hardly function without -%D a decent message mechanism. Due to its multi||lingual -%D interface, the message subsystem has to be multi||lingual -%D too. A major drawback of this feature is that we have to -%D code messages. As a result, the source becomes less self -%D documented. On the other hand, consistency will improve. -%D -%D Because the overhead in terms of entries in the (already -%D exhausted) hash table has to be minimal, messages are packed -%D in libraries. We can extract a message from such a library -%D in three ways: -%D -%D \starttyping -%D \getmessage {library} {tag} -%D \showmessage {library} {tag} {data} -%D \makemessage {library} {tag} {data} -%D \stoptyping -%D -%D The first command gets the message \type{tag} from the -%D \type{library} specified. The other commands take an extra -%D argument: a list of items to be inserted in the message -%D text. While \type{\showmessage} shows the message at the -%D terminal, the other commands generate the message as text. -%D Before we explain the \type{data} argument, we give an -%D example of a library. -%D -%D \starttyping -%D % messages moved -%D \stoptyping -%D -%D The first message is a simple one and can be shown with: -%D -%D \starttyping -%D \showmessage {alfa} {1} {} -%D \stoptyping -%D -%D The second message on the other hand needs some extra data: -%D -%D \starttyping -%D \showmessage {alfa} {2} {and last,to you} -%D \stoptyping -%D -%D This message is shown as: -%D -%D \starttyping -%D something : second (and last) message to you -%D \stoptyping -%D -%D As we can see, the title entry is shown with the message. -%D The data fields are comma separated and are specified in the -%D message text by \type{--}. -%D -%D It is not required to define all messages in a library at -%D once. We can add messages to a library in the following way: -%D -%D \starttyping -%D % messages moved -%D \stoptyping -%D -%D Because such definitions can take place in different -%D modules, the system gives a warning when a tag occurs more -%D than once. The first occurrence takes preference over later -%D ones, so we had better use a save offset, as shown in the -%D example. As we can see, the title field is specified only -%D the first time! -%D -%D Because we want to check for duplicate tags, the macros -%D are a bit more complicated than neccessary. The \NEWLINE\ -%D token is used as message separator. -%D -%D For internal purposes one can use \type {\setmessagetext}, -%D which puts the message text asked for in \type -%D {\currentmessagetext}. - -\loadmarkfile{mult-ini} - -%D \macros -%D {ifshowwarnings, ifshowmessages} -%D -%D Sometimes displaying message can slow down processing -%D considerably. We therefore introduce warnings. Users can -%D turn of warnings and messages by saying: -%D -%D \starttyping -%D \showwarningstrue -%D \showmessagestrue -%D \stoptyping -%D -%D Turning off messages also turns off warnings, which is -%D quote logical because they are less important. - -% not yet mkiv - -\newif\ifshowwarnings \showwarningstrue -\newif\ifshowmessages \showmessagestrue - -\let\normalshowmessage\showmessage - -\def\showwarning - {\ifshowwarnings - \expandafter\showmessage - \else - \expandafter\gobblethreearguments - \fi} - -\def\showmessage - {\ifshowmessages - \expandafter\normalshowmessage - \else - \expandafter\gobblethreearguments - \fi} - -%D \macros -%D {dosetvalue,dosetevalue,dosetgvalue,dosetxvalue,docopyvalue,doresetvalue} % dogetvalue -%D -%D We already defined these auxiliary macros in the system -%D modules. Starting with this module however, we have to take -%D multi||linguality a bit more serious. -%D -%D First we show a well||defined (simplified) alternative: -%D -%D \starttyping -%D \def\dosetvalue#1#2#3% -%D {\doifdefinedelse{\c!prefix!#2} -%D {\setvalue{#1\getvalue{\c!prefix!#2}}{#3}} -%D {\setvalue{#1#2}{#3}}} -%D -%D \def\docopyvalue#1#2#3% -%D {\doifdefinedelse{\c!prefix!#3} -%D {\setvalue{#1\getvalue{\c!prefix!#3}}% -%D {\getvalue{#2\getvalue{\c!prefix!#3}}}} -%D {\setvalue{#1#3}% -%D {\getvalue{#2#3}}}} -%D \stoptyping -%D -%D These macros are called upon quite often and so we optimized -%D them a bit. -%D -%D \starttyping -%D \def\dosetvalue#1#2#3% -%D {\let\c!internal!\c!internal!n -%D \p!doifundefined{\k!prefix!#2}% -%D \let\c!internal!\c!internal!y -%D \let\donottest\doprocesstest -%D \@EA\def\csname#1#2\endcsname{#3}% -%D \else -%D \let\c!internal!\c!internal!y -%D \let\donottest\doprocesstest -%D \@EA\def\csname#1\csname\k!prefix!#2\endcsname\endcsname{#3}% -%D \fi} -%D -%D \def\dosetevalue#1#2#3% -%D {\let\c!internal!\c!internal!n -%D \p!doifundefined{\k!prefix!#2}% -%D \let\c!internal!\c!internal!y -%D \let\donottest\doprocesstest -%D \@EA\edef\csname#1#2\endcsname{#3}% -%D \else -%D \let\c!internal!\c!internal!y -%D \let\donottest\doprocesstest -%D \@EA\edef\csname#1\csname\k!prefix!#2\endcsname\endcsname{#3}% -%D \fi} -%D -%D \def\dosetgvalue#1#2#3% -%D {\let\c!internal!\c!internal!n -%D \p!doifundefined{\k!prefix!#2}% -%D \let\c!internal!\c!internal!y -%D \let\donottest\doprocesstest -%D \@EA\gdef\csname#1#2\endcsname{#3}% -%D \else -%D \let\c!internal!\c!internal!y -%D \let\donottest\doprocesstest -%D \@EA\gdef\csname#1\csname\k!prefix!#2\endcsname\endcsname{#3}% -%D \fi} -%D -%D \def\docopyvalue#1#2#3% -%D {\let\c!internal!\c!internal!n -%D \p!doifundefined{\k!prefix!#3}% -%D \let\c!internal!\c!internal!y -%D \let\donottest\doprocesstest % still needed ? -%D \@EA\def\csname#1#3\endcsname% -%D {\csname#2#3\endcsname}% -%D \else -%D \let\c!internal!\c!internal!y -%D \let\donottest\doprocesstest % still needed ? -%D \@EA\def\csname#1\csname\k!prefix!#3\endcsname\endcsname% -%D {\csname#2\csname\k!prefix!#3\endcsname\endcsname}% -%D \fi} -%D \stoptyping - -\def\doresetvalue#1#2% - {\dosetvalue{#1}{#2}{}} - -\def\doignorevalue#1#2#3% - {\dosetvalue{#1}{#2}{}} - -% \def\dogetvalue#1#2% -% {\csname#1\csname\k!prefix!#2\endcsname\endcsname} - -%D Although maybe not clearly visible, there is a -%D considerable profit in further optimization. By expanding -%D the embedded \type {\csname} we can reduce the format file -%D by about 5\% (60~KB out of 1.9~MB). -%D -%D \starttyping -%D \def\docopyvalue#1#2#3% c -> k -%D {\p!doifundefined{\k!prefix!#3}% -%D \let\donottest\doprocesstest -%D \@EAEAEA\def\@EA -%D \csname\@EA#1\@EA#3\@EA -%D \endcsname\@EA{\csname#2#3\endcsname}% -%D \else -%D \let\donottest\doprocesstest -%D \@EAEAEA\def\@EA -%D \csname\@EA#1\@EA\csname\@EA\k!prefix!\@EA#3\@EA\endcsname\@EA -%D \endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}% -%D \fi} -%D \stoptyping -%D -%D The next alternatives are slightly faster. - -\def\dosetvalue#1#2% - {\let\c!internal!\c!internal!n - \ifcsname\k!prefix!#2\endcsname - \let\c!internal!\c!internal!y - \@EA\def\csname#1\csname\k!prefix!#2\endcsname%\endcsname - \else - \let\c!internal!\c!internal!y - \@EA\def\csname#1#2%\endcsname - \fi\endcsname} - -\def\dosetevalue#1#2% - {\let\c!internal!\c!internal!n - \ifcsname\k!prefix!#2\endcsname - \let\c!internal!\c!internal!y - \@EA\edef\csname#1\csname\k!prefix!#2\endcsname%\endcsname - \else - \let\c!internal!\c!internal!y - \@EA\edef\csname#1#2%\endcsname - \fi\endcsname} - -\def\dosetgvalue#1#2% - {\let\c!internal!\c!internal!n - \ifcsname\k!prefix!#2\endcsname - \let\c!internal!\c!internal!y - \@EA\gdef\csname#1\csname\k!prefix!#2\endcsname%\endcsname - \else - \let\c!internal!\c!internal!y - \@EA\gdef\csname#1#2%\endcsname - \fi\endcsname} - -\def\dosetxvalue#1#2% - {\let\c!internal!\c!internal!n - \ifcsname\k!prefix!#2\endcsname - \let\c!internal!\c!internal!y - \@EA\xdef\csname#1\csname\k!prefix!#2\endcsname%\endcsname - \else - \let\c!internal!\c!internal!y - \@EA\xdef\csname#1#2%\endcsname - \fi\endcsname} - -\def\docopyvalue#1#2#3% real tricky expansion, quite unreadable - {\let\c!internal!\c!internal!n - \ifcsname\k!prefix!#3\endcsname - \let\c!internal!\c!internal!y - \@EA\def\csname#1\csname\k!prefix!#3\endcsname - \@EA\endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}% - \else - \let\c!internal!\c!internal!y - \@EA\def\csname#1#3\@EA\endcsname\@EA{\csname#2#3\endcsname}% - \fi} - -%D We can now redefine some messages that will be -%D introduced in the multi||lingual system module. - -\def\showassignerror #1#2{\showmessage\m!check1{#1,#2}\waitonfatalerror} -\def\showargumenterror#1#2{\showmessage\m!check2{#1,#2}\waitonfatalerror} -\def\showdefinederror #1#2{\showmessage\m!check3{#1,#2}\waitonfatalerror} - -%D \CONTEXT\ is a parameter driven package. This means that -%D users instruct the system by means of variables, values and -%D keywords. These instructions take the form: -%D -%D \starttyping -%D \setupsomething[some variable=some value, another one=a keyword] -%D \stoptyping -%D -%D or by keyword only: -%D -%D \starttyping -%D \dosomething[this way,that way,no way] -%D \stoptyping -%D -%D Because the same variables can occur in more than one setup -%D command, we have to be able to distinguish them. This is -%D achieved by assigning them a unique prefix. -%D -%D Imagine a setup command for boxed text, that enables us to -%D specify the height and width of the box. Behide the scenes -%D the command -%D -%D \starttyping -%D \setupbox [width=12cm, height=3cm] -%D \stoptyping -%D -%D results in something like -%D -%D \starttyping -%D \ {12cm} -%D \ {3cm} -%D \stoptyping -%D -%D while a similar command for specifying the page dimensions -%D of an \cap{A4} page results in: -%D -%D \starttyping -%D \ {21.0cm} -%D \ {27.9cm} -%D \stoptyping -%D -%D The prefixes \type{} and \type{} are hidden from -%D users and can therefore be language independant. Variables -%D on the other hand, differ for each language: -%D -%D \starttyping -%D \ {} -%D \ {} -%D \ {} -%D \stoptyping -%D -%D In this example we can see that the assigned values or -%D keywords are language dependant too. This will be a -%D complication when defining multi||lingual setup files. -%D -%D A third phenomena is that variables and values can have a -%D similar meaning. -%D -%D \starttyping -%D \ {} -%D \ {12cm} -%D \stoptyping -%D -%D A (minor) complication is that where in english we use -%D \type{}, in dutch we find both \type{} and -%D \type{}. This means that when we use some sort of -%D translation table, we have to distinguish between the -%D variables at the left side and the fixed values at the -%D right. -%D -%D The same goes for commands that are composed of different -%D user supplied and/or language specific elements. In english -%D we can use: -%D -%D \starttyping -%D \
-%D \ -%D \stoptyping -%D -%D But in dutch we have the following: -%D -%D \starttyping -%D \ -%D \ -%D \stoptyping -%D -%D These subtle differences automatically lead to a solution -%D where variables, values, elements and other components have -%D a similar logical name (used in macro's) but a different -%D meaning (supplied by the user). -%D -%D Our solution is one in which the whole system is programmed -%D in terms of identifiers with language specific meanings. In -%D such an implementation, each fixed variable is available as: -%D -%D \starttyping -%D \ -%D \stoptyping -%D -%D This means that for instance: -%D -%D \starttyping -%D \setupbox[width=12cm] -%D \stoptyping -%D -%D expands to something like: -%D -%D \starttyping -%D \def\boxwidth{12cm} -%D \stoptyping -%D -%D because we don't want to recode the source, a setup command -%D in another language has to expand to this variable, so: -%D -%D \starttyping -%D \setupblock[width=12cm] -%D \stoptyping -%D -%D has to result in the definition of \type{\boxwidth} too. -%D This method enables us to build compact, fast and readable -%D code. -%D -%D An alternative method, which we considered using, uses a -%D more indirect way. In this case, both calls generate a -%D different variable: -%D -%D \starttyping -%D \def\boxwidth {12cm} -%D \def\boxbreedte {12cm} -%D \stoptyping -%D -%D And because we don't want to recode those megabytes of -%D already developed code, this variable has to be called with -%D something like: -%D -%D \starttyping -%D \valueof\box\width -%D \stoptyping -%D -%D where \type{\valueof} takes care of the translation of -%D \type{width} or \type{breedte} to \type{width} and -%D combining this with \type{box} to \type{\boxwidth}. -%D -%D One advantage of this other scheme is that, within certain -%D limits, we can implement an interface that can be switched -%D to another language at will, while the current approach -%D fixes the interface at startup. There are, by the way, -%D other reasons too for not choosing this scheme. Switching -%D user generated commands is for instance impossible and a -%D dual interface would therefore give a strange mix of -%D languages. -%D -%D Now let's work out the first scheme. Although the left hand -%D of the assignment is a variable from the users point of -%D view, it is a constant in terms of the system. Both -%D \type{width} and \type{breedte} expand to \type{width} -%D because in the source we only encounter \type{width}. Such -%D system constants are presented as -%D -%D \starttyping -%D \c!width -%D \stoptyping -%D -%D This constant is always equivalent to \type{width}. As we -%D can see, we use \type{c!} to mark this one as constant. Its -%D dutch counterpart is: -%D -%D \starttyping -%D breedte -%D \stoptyping -%D -%D When we interpret a setup command each variable is -%D translated to it's \type{c!} counterpart. This means that -%D \type{breedte} and \type{width} expand to \type{breedte} -%D and \type{\c!width} which both expand to \type{width}. That -%D way user variables become system constants. -%D -%D The interpretation is done by means of a general setup -%D command \type{\getparameters} that we introduced in the -%D system module. Let us define some simple setup command: -%D -%D \starttyping -%D \def\setupbox[#1]% -%D {\getparameters[\??bx][#1]} -%D \stoptyping -%D -%D This command can be used as: -%D -%D \starttyping -%D \setupbox [width=3cm, height=1cm] -%D \stoptyping -%D -%D Afterwards we have two variables \type{\@@bxwidth} and -%D \type{\@@bxheight} which have the values \type{3cm} and -%D \type{1cm} assigned. These variables are a combinatiom of -%D the setup prefix \type{\??bx}, which expands to \type{@@bx} -%D and the translated user supplied variables \type{width} and -%D \type{height} or \type{breedte} and \type{hoogte}, -%D depending on the actual language. In dutch we just say: -%D -%D \starttyping -%D \setupblock [width=3cm, height=1cm] -%D \stoptyping -%D -%D and get ourselves \type{\@@bxwidth} and \type{\@@bxheight} -%D too. In the source of \CONTEXT, we can recognize constants -%D and variables on their leading \type{c!}, \type{v!} etc., -%D prefixes on \type{??} and composed variables on \type{@@}. -%D -%D We already saw that user supplied keywords need some -%D special treatment too. This time we don't translate the -%D keyword, but instead use in the source a variable which -%D meaning depends on the interface language. -%D -%D \starttyping -%D \v!left -%D \stoptyping -%D -%D Which can be used in macro's like: -%D -%D \starttyping -%D \processaction -%D [\@@bxlocation] -%D [ \v!left=>\dosomethingontheleft, -%D \v!middle=>\dosomthinginthemiddle, -%D \v!right=>\dosomethingontheright] -%D \stoptyping -%D -%D Because variables like \type{\@@bxlocation} can have a lot -%D of meanings, including tricky expandable tokens, we cannot -%D translate this meaning when we compare. This means that -%D \type{\@@bxlocation} can be \type{left} of \type{links} of -%D whatever meaning suits the language. But because -%D \type{\v!left} also has a meaning that suits the language, -%D we are able to compare. -%D -%D Although we know it sounds confusing we want to state two -%D important characteristics of the interface as described: -%D -%D \startnarrower \em -%D user variables become system constants -%D \stopnarrower -%D -%D and -%D -%D \startnarrower \em -%D user constants (keywords) become system variables -%D \stopnarrower -%D - -%D \macros -%D {startconstants,startvariables} -%D -%D It's time to introduce the macro's that are responsible for -%D this translations process, but first we show how constants -%D and variables are defined. We only show two languages and -%D a few words. -%D -%D \starttyping -%D \startconstants english dutch -%D -%D width: width breedte -%D height: height hoogte -%D -%D \stopconstants -%D \stoptyping -%D -%D Keep in mind that what users see as variables, are constants -%D for the system. -%D -%D \starttyping -%D \startvariables english dutch -%D -%D location: left links -%D text: text tekst -%D -%D \stopvariables -%D \stoptyping -%D -%D The macro's responsible for interpreting these setups are -%D shared. They take care of empty lines and permit a more or -%D less free format. All setups accept the keyword \type{all} -%D which equals every language. - -%D The next few macros come into action when we generate -%D interface log files: - -\newif\iflogginginterface - -\def\flushinterfaceelementline - {\iflogginginterface - \immediate\write\scratchwrite{\interfaceelementline}% - \let\interfaceelementline\empty - \fi} - -\def\saveinterfaceelementline#1% - {\iflogginginterface - \edef\interfaceelementline{\interfaceelementline#1\space}% - \fi} - -\def\startlogginginterface #1 % - {\logginginterfacetrue - \let\interfaceelementline\empty - \immediate\openout\scratchwrite=./#1\relax} - -\def\stoplogginginterface - {\flushinterfaceelementline - \immediate\closeout\scratchwrite - \logginginterfacefalse} - -%D By default we don't log at all. - -\def\startlogginginterface #1 {} -\def\stoplogginginterface {} - -%D These logging commands are used in the next macros. - -\def\nointerfaceobject{-} - -\def\startinterfaceobjects#1#2% - {\!!counta\plusone - \let\dogetinterfaceobject\dogetinterfacetemplate - \let\dowithinterfaceelement#1% - \def\dodogetinterfaceobjects - {\ifx\next#2% - \flushinterfaceelementline - \flushinterfaceelementline - \def\next####1{#2}% was: \let\next\gobbleoneargument - \else\ifx\next\par - \long\def\next####1{\dogetinterfaceobjects}% - \else\ifx\next\empty - \def\next####1{\dogetinterfaceobjects}% - \else - \def\next####1 {\dogetinterfaceobject[####1:\relax]\dogetinterfaceobjects}% - \fi\fi\fi - \next}% - \def\dogetinterfaceobjects{\futurelet\next\dodogetinterfaceobjects}% - \dogetinterfaceobjects} - -\def\dogetinterfacetemplate[#1:#2]% - {\saveinterfaceelementline{#1}% - \doifinsetelse{#1}{\currentinterface,all} - {\let\dogetinterfaceobject\doskipinterfaceobject} - {\advance\!!counta\plusone}} - -\def\doskipinterfaceobject[#1:#2#3]% - {\if#2:% - \let\dogetinterfaceobject\dogetinterfaceelement - \dogetinterfaceobject[#1:#2#3]% - \else - \saveinterfaceelementline{#1}% - \fi} - -\let\interfaceelementline\empty - -\def\dogetinterfaceelement[#1:#2#3]% - {\ifx#2:% - \!!countb\zerocount - \def\!!stringa{#1}% - \flushinterfaceelementline - \else - \advance\!!countb\plusone - \saveinterfaceelementline{#1}% - \ifnum\!!countb=\!!counta - \@EA\dowithinterfaceelement\@EA{\!!stringa}{#1}% - \let\dogetinterfaceobject\doskipinterfaceobject - \fi - \fi} - -%D The constants and variables are defined as described. When -%D \type {\interfacetranslation} is \type{true}, we also -%D generate a reverse translation. Because we don't want to put -%D too big a burden on \TEX's hash table, this is no default -%D behavior. Reverse translation is used in the commands that -%D generate the quick reference cards. We are going to define -%D the real \CONTEXT\ commands in an abstract way and generate -%D those reference cards for each language without further -%D interference. (Part of this (the translation stuff) is gone -%D now that we've moved to \XML\ completely and have separate -%D key mapping files. - -%D Anno 2003 I've forgotten why the \type {\c!internal} is -%D still in there; it's probably a left over from an experiment. - -%D Once we're gone XML we can drop some of the extra mappings. - -\let\c!internal!y \string -\def\c!internal!n {-} -\let\c!internal! \c!internal!y - -% temporary mkiv hack - -\ifx\dowithinterfaceconstant\undefined \let\dowithinterfaceconstant\gobbletwoarguments \fi -\ifx\dowithinterfacevariable\undefined \let\dowithinterfacevariable\gobbletwoarguments \fi - -\def\setinterfaceconstant#1#2% - {\dowithinterfaceconstant{#1}{#2}% - \setvalue{\c!prefix!#1}{\c!internal!#1}% - \doifelse{#2}\nointerfaceobject % ? - {\debuggerinfo{constant}{#1 defined as #1 by default}}% - {\debuggerinfo{constant}{#1 defined as #2}% - \checksetvalue{\k!prefix!#2}{#1}% - \setvalue{\k!prefix!#2}{#1}}} - -\def\setinterfacevariable#1#2% - {\dowithinterfacevariable{#1}{#2}% - \doifelse{#2}\nointerfaceobject - {\debuggerinfo{variable}{#1 defined as #1 by default}% - \checksetvalue{\v!prefix!#1}{#1}% - \setvalue{\v!prefix!#1}{#1}} - {\debuggerinfo{variable}{#1 defined as #2}% - \checksetvalue{\v!prefix!#1}{#2}% - \setvalue{\v!prefix!#1}{#2}}} - -\def\checksetvalue#1#2% - {\doifdefined{#1}{\doifvaluesomething{#1}{\doifnotvalue{#1}{#2} - {\writestatus{problems}{set #1 to #2 overloads \getvalue{#1}}}}}} - -\def\startvariables{\startinterfaceobjects\setinterfacevariable\stopvariables} -\def\startconstants{\startinterfaceobjects\setinterfaceconstant\stopconstants} - -\let\stopvariables\relax -\let\stopconstants\relax - -%D \macros -%D {defineinterfaceconstant} -%D -%D Next we redefine a previously defined macro to take care of -%D interface translation too. It's a bit redundant, because -%D in these situations we could use the c||version, but for -%D documentation purposes the x||alternative comes in handy. - -\def\defineinterfaceconstant#1#2% - {\setvalue{\c!prefix!#1}{#2}} - -%D \macros -%D {startelements} -%D -%D Due to the object oriented nature of \CONTEXT, we also need -%D to define the elements that are used to build commands: -%D -%D \starttyping -%D \startelements english dutch -%D -%D beginvan: begin beginvan -%D eindvan: end eindvan -%D start: start start -%D stop: stop stop -%D -%D \stopelements -%D \stoptyping -%D -%D Such elements sometimes are the same in diferent -%D languages, but mostly they differ. Things can get even -%D confusing when we look at for instance the setup commands. -%D In english we say \type{\setup}, but in dutch we -%D have: \type{\stelin}. Such split elements are no -%D problem, because we just define two elements. When no second -%D part is needed, we use a \type{-}: -%D -%D \starttyping -%D \startelements english dutch -%D -%D setupa: setup stel -%D setupb: - in -%D -%D \stopelements -%D \stoptyping -%D -%D Element translation is realized by means of: - -\def\setinterfaceelement#1#2% - {\doifelse{#2}\nointerfaceobject - {\debuggerinfo{element}{#1 defined as }% - \resetvalue{\e!prefix!#1}} - {\doifdefinedelse{\e!prefix!#1} - {\doifnotvalue{\e!prefix!#1}{#2} - {\debuggerinfo{element}{#1 redefined as #2}% - \setvalue{\e!prefix!#1}{#2}}} - {\debuggerinfo{element}{#1 defined as #2}% - \setvalue{\e!prefix!#1}{#2}}}} - -\def\startelements{\startinterfaceobjects\setinterfaceelement\stopelements} - -\let\stopelements\relax - -%D \macros -%D {startcommands} -%D -%D The last setup has to do with the commands themselve. -%D Commands are defined as: -%D -%D \starttyping -%D \startcommands english dutch -%D -%D starttekst: starttext starttekst -%D stoptekst: stoptext stoptekst -%D omlijnd: framed omlijnd -%D margewoord: marginword margewoord -%D -%D \stopcommands -%D \stoptyping - -\def\setinterfacecommand#1#2% - {\doifelse{#2}\nointerfaceobject - {\debuggerinfo{command}{no link to #1}} - {\doifelse{#1}{#2} - {\debuggerinfo{command}{#1 remains #1}} - {\doifdefinedelse{#2} - {\debuggerinfo{command}{core command #2 redefined as #1}}% - {\debuggerinfo{command}{#2 defined as #1}}% - \@EA\def\csname#2\@EA\endcsname\@EA{\csname#1\endcsname}}}} - -\def\startcommands{\startinterfaceobjects\setinterfacecommand\stopcommands} - -\let\stopcommands\relax - -%D \macros -%D {interfaced} -%D -%D The setup commands translate the constants automatically. -%D When we want to translate 'by hand' we can use the simple -%D but effective command: -%D -%D \starttyping -%D \interfaced {something} -%D \stoptyping -%D -%D Giving \type{\interfaced{breedte}} results in \type{width} -%D or, when not defined, in \type{breedte} itself. This -%D macro is used in the font switching mechanism. - -\def\interfaced#1% - {\ifcsname\k!prefix!#1\endcsname - \csname\k!prefix!#1\endcsname - \else - #1% - \fi} - -%D So much for the basic multi||lingual interface commands. The -%D macro's can be enhanced with more testing facilities, but -%D for the moment they suffice. - -%D Out of convenience we define the banners here. - -\def\contextbanner - {ConTeXt \space - ver: \contextversion \space \contextmark \space \space - fmt: \formatversion \space \space - int: \currentinterface/\currentresponses} - -\def\showcontextbanner - {\writeline\writebanner{\contextbanner}\writeline} - -\edef\formatversion - {\the\normalyear.\the\normalmonth.\the\normalday} - -\ifx\contextversion\undefined - \def\contextversion {unknown} - \def\contextversionnumber{0} -\else - \def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#2<10 0\fi#2\ifnum#3<10 0\fi#3 #4:#5} - \edef\contextversionnumber{\expandafter\contextversionnumber\contextversion\relax\space\contextmark} -\fi - -\ifx\undefined\everydump - \newtoks\everydump - \def\dump{\the\everydump\normaldump} -\fi - -\appendtoks \showcontextbanner \to \everydump - -\protect \endinput diff --git a/tex/context/base/mult-ini.lua b/tex/context/base/mult-ini.lua index 1eee9a656..06707adf8 100644 --- a/tex/context/base/mult-ini.lua +++ b/tex/context/base/mult-ini.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['mult-ini'] = { license = "see context related readme files" } -local format, gmatch = string.format, string.gmatch +local format, gmatch, gsub = string.format, string.gmatch, string.gsub interfaces = interfaces or { } interfaces.messages = interfaces.messages or { } @@ -17,32 +17,34 @@ storage.register("interfaces/messages", interfaces.messages, "interfaces.messa storage.register("interfaces/constants", interfaces.constants, "interfaces.constants") storage.register("interfaces/variables", interfaces.variables, "interfaces.variables") +local messages, constants, variables = interfaces.messages, interfaces.constants, interfaces.variables + function interfaces.setmessages(category,str) - local m = interfaces.messages[category] or { } + local m = messages[category] or { } for k, v in gmatch(str,"(%S+) *: *(.-) *[\n\r]") do - m[k] = v:gsub("%-%-","%%s") + m[k] = gsub(v,"%-%-","%%s") end - interfaces.messages[category] = m + messages[category] = m end function interfaces.setmessage(category,tag,message) - local m = interfaces.messages[category] + local m = messages[category] if not m then m = { } - interfaces.messages[category] = m + messages[category] = m end m[tag] = message:gsub("%-%-","%%s") end function interfaces.getmessage(category,tag) - local m = interfaces.messages[category] + local m = messages[category] return (m and m[tag]) or "unknown message" end local messagesplitter = lpeg.splitat(",") function interfaces.makemessage(category,tag,arguments) - local m = interfaces.messages[category] + local m = messages[category] m = (m and m[tag] ) or format("unknown message, category '%s', tag '%s'",category,tag) if not m then return m .. " " .. tag @@ -54,14 +56,15 @@ function interfaces.makemessage(category,tag,arguments) end function interfaces.showmessage(category,tag,arguments) - local m = interfaces.messages[category] + local m = messages[category] commands.writestatus((m and m.title) or "unknown title",interfaces.makemessage(category,tag,arguments)) end function interfaces.setvariable(variable,given) - interfaces.variables[given] = variable +--~ variables[given] = variable + variables[variable] = given end function interfaces.setconstant(constant,given) - interfaces.constants[given] = constant + constants[given] = constant end diff --git a/tex/context/base/mult-ini.mkiv b/tex/context/base/mult-ini.mkiv index 2d1e2cc0e..5033a5233 100644 --- a/tex/context/base/mult-ini.mkiv +++ b/tex/context/base/mult-ini.mkiv @@ -86,6 +86,9 @@ \def\s!complex {complex} \def\s!start {start} \def\s!simple {simple} \def\s!stop {stop} +\def\s!true {true} +\def\s!false {false} + %D The word \type{height} takes 6~token memory cells. The %D control sequence \type{\height} on the other hand uses only %D one. Knowing this, we can improve the performance of \TEX, diff --git a/tex/context/base/mult-it.tex b/tex/context/base/mult-it.tex index f5d009b32..530a49152 100644 --- a/tex/context/base/mult-it.tex +++ b/tex/context/base/mult-it.tex @@ -233,6 +233,7 @@ \setinterfacevariable{lastpage}{ultimapagina} \setinterfacevariable{lastpagenumber}{lastpagenumber} \setinterfacevariable{lastsubpage}{ultimasottopagina} +\setinterfacevariable{layer}{layer} \setinterfacevariable{left}{sinistra} \setinterfacevariable{leftedge}{bordosinistro} \setinterfacevariable{lefthanging}{lefthanging} @@ -843,6 +844,7 @@ \setinterfaceconstant{sectionconversion}{sectionconversion} \setinterfaceconstant{sectionconversionset}{sectionconversionset} \setinterfaceconstant{sectionnumber}{numerosezione} +\setinterfaceconstant{sectionresetset}{sectionresetset} \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} diff --git a/tex/context/base/mult-nl.tex b/tex/context/base/mult-nl.tex index d84512ae7..492220961 100644 --- a/tex/context/base/mult-nl.tex +++ b/tex/context/base/mult-nl.tex @@ -233,6 +233,7 @@ \setinterfacevariable{lastpage}{laatstepagina} \setinterfacevariable{lastpagenumber}{laatstepaginanummer} \setinterfacevariable{lastsubpage}{laatstesubpagina} +\setinterfacevariable{layer}{layer} \setinterfacevariable{left}{links} \setinterfacevariable{leftedge}{linkerrand} \setinterfacevariable{lefthanging}{linkshangend} @@ -843,6 +844,7 @@ \setinterfaceconstant{sectionconversion}{sectionconversion} \setinterfaceconstant{sectionconversionset}{sectionconversionset} \setinterfaceconstant{sectionnumber}{sectienummer} +\setinterfaceconstant{sectionresetset}{sectionresetset} \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} diff --git a/tex/context/base/mult-ro.tex b/tex/context/base/mult-ro.tex index bcb4d5256..ece67fead 100644 --- a/tex/context/base/mult-ro.tex +++ b/tex/context/base/mult-ro.tex @@ -233,6 +233,7 @@ \setinterfacevariable{lastpage}{ultimapagina} \setinterfacevariable{lastpagenumber}{lastpagenumber} \setinterfacevariable{lastsubpage}{ultimasubpagina} +\setinterfacevariable{layer}{layer} \setinterfacevariable{left}{stanga} \setinterfacevariable{leftedge}{bordurastanga} \setinterfacevariable{lefthanging}{lefthanging} @@ -843,6 +844,7 @@ \setinterfaceconstant{sectionconversion}{sectionconversion} \setinterfaceconstant{sectionconversionset}{sectionconversionset} \setinterfaceconstant{sectionnumber}{numarsectiune} +\setinterfaceconstant{sectionresetset}{sectionresetset} \setinterfaceconstant{sectionsegments}{sectionsegments} \setinterfaceconstant{sectionseparatorset}{sectionseparatorset} \setinterfaceconstant{sectionset}{sectionset} diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex index b24c11d58..e5f9f1c1a 100644 --- a/tex/context/base/mult-sys.tex +++ b/tex/context/base/mult-sys.tex @@ -99,6 +99,7 @@ \definemessageconstant {encodings} \definemessageconstant {regimes} \definemessageconstant {figures} +\definemessageconstant {fields} \definemessageconstant {files} \definemessageconstant {floatblocks} \definemessageconstant {fonts} @@ -383,11 +384,13 @@ % vervallen : hd hr hm vt vr vm tr tn te br bm bo on om or \definesystemvariable {ab} % AlignedBoxes +\definesystemvariable {ac} % ACcent \definesystemvariable {ag} % AchterGrond \definesystemvariable {al} % ALinea's \definesystemvariable {am} % interActieMenu \definesystemvariable {an} % ANchor \definesystemvariable {as} % AlignmentSwitch +\definesystemvariable {at} % ATtachments \definesystemvariable {ba} % synchronisatieBAlk \definesystemvariable {be} % startstop (BeginEnd) \definesystemvariable {bj} % BlokJe @@ -501,7 +504,9 @@ \definesystemvariable {mb} % MargeBlokken \definesystemvariable {md} % MoDule \definesystemvariable {mg} % Metapost paGe +\definesystemvariable {mh} % MultilingualHead \definesystemvariable {mk} % MarKering +\definesystemvariable {ml} % MultilingualLabel \definesystemvariable {mt} % inline MaTh \definesystemvariable {mo} % Math Options \definesystemvariable {mp} % MetaPost @@ -686,7 +691,7 @@ \definefileconstant {filfilename} {cont-fil} \definefileconstant {modfilename} {cont-mod} -%D Handy for typescripts: +%D Handy for typescripts (we could use s! instead: \definetypescriptconstant {name} {name} \definetypescriptconstant {default} {default} @@ -797,31 +802,6 @@ \selectinterface -%D And only after this selection is done, we can define -%D messages, otherwise the default language is in use. - -% \ifinterfacetranslation \else % interfacetranslation is obsolete - -% messages moved - -% messages moved - -% 1: to be adapted - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% \fi - %D Ok, here are some more, because we've got ouselves some %D extensions to \CONTEXT. diff --git a/tex/context/base/node-dum.lua b/tex/context/base/node-dum.lua index 274e0cdd6..b210d0adb 100644 --- a/tex/context/base/node-dum.lua +++ b/tex/context/base/node-dum.lua @@ -9,16 +9,16 @@ if not modules then modules = { } end modules ['node-dum'] = { nodes = nodes or { } function nodes.simple_font_dummy(head,tail) - return tail + -- ligaturing, kerning + return head, tail end function nodes.simple_font_handler(head) - local tail = node.slide(head) --- lang.hyphenate(head,tail) - head = nodes.process_characters(head,tail) +-- lang.hyphenate(head) + head = nodes.process_characters(head) nodes.inject_kerns(head) nodes.protect_glyphs(head) - tail = node.ligaturing(head,tail) - tail = node.kerning(head,tail) + head = node.ligaturing(head) + head = node.kerning(head) return head end diff --git a/tex/context/base/node-fin.lua b/tex/context/base/node-fin.lua index 3810b7a85..a801e9acb 100644 --- a/tex/context/base/node-fin.lua +++ b/tex/context/base/node-fin.lua @@ -41,31 +41,32 @@ function states.disabletriggering() triggering = false end +-- the following code is no longer needed due to the new backend +-- but we keep it around for a while as an example -- - -states.collected = states.collected or { } - -storage.register("states/collected", states.collected, "states.collected") - -local collected = states.collected - -function states.collect(str) - collected[#collected+1] = str -end - -function states.flush() - if #collected > 0 then - for i=1,#collected do - texsprint(ctxcatcodes,collected[i]) -- we're in context mode anyway - end - collected = { } - states.collected = collected - end -end - -function states.check() - texio.write_nl(concat(collected,"\n")) -end +-- states.collected = states.collected or { } +-- +-- storage.register("states/collected", states.collected, "states.collected") +-- +-- local collected = states.collected +-- +-- function states.collect(str) +-- collected[#collected+1] = str +-- end +-- +-- function states.flush() +-- if #collected > 0 then +-- for i=1,#collected do +-- texsprint(ctxcatcodes,collected[i]) -- we're in context mode anyway +-- end +-- collected = { } +-- states.collected = collected +-- end +-- end +-- +-- function states.check() +-- texio.write_nl(concat(collected,"\n")) +-- end -- we used to do the main processor loop here and call processor for each node -- but eventually this was too much a slow down (1 sec on 23 for 120 pages mk) @@ -82,7 +83,7 @@ local function process_attribute(head,plugin) -- head,attribute,enabled,initiali if processor then local initializer = plugin.initializer local resolver = plugin.resolver - local inheritance = (resolver and resolver()) or -0x7FFFFFFF -- we can best use nil and skip ! + local inheritance = (resolver and resolver()) or nil -- -0x7FFFFFFF -- we can best use nil and skip ! if initializer then initializer(namespace,attribute,head) end @@ -94,8 +95,7 @@ local function process_attribute(head,plugin) -- head,attribute,enabled,initiali if used then local flusher = plugin.flusher if flusher then - local h, d = flusher(namespace,attribute,head,used) - head = h + head = flusher(namespace,attribute,head,used) end end end @@ -115,76 +115,54 @@ function nodes.install_attribute_handler(plugin) end end --- a few handlers +-- the injectors -local current, current_selector, used, done = 0, 0, { }, false +local insert_node_before = node.insert_before +local insert_node_after = node.insert_after -local function insert(n,stack,previous,head) -- there is a helper, we need previous because we are not slided - if n then - if type(n) == "function" then - n = n() - end - if n then - n = copy_node(n) - n.next = stack - if previous then - previous.next = n - else - head = n - end - previous = n -- ? - else - -- weird - end - end - return stack, head -end +local nsdata, nsdone, nsforced, nsselector, nstrigger +local current, current_selector, done = 0, 0, false -- nb, stack has a local current ! -function states.initialize(what, attribute, stack) - current, current_selector, used, done = 0, 0, { }, false +function states.initialize(namespace,attribute,head) + nsdata, nsnone = namespace.data, namespace.none + nsforced, nsselector = namespace.forced, namespace.selector + nstrigger = triggering and namespace.triggering and trigger + current, current_selector, done = 0, 0, false -- todo: done cleanup end function states.finalize(namespace,attribute,head) -- is this one ok? - if current > 0 then - local nn = namespace.none - if nn then - local id = head.id - if id == hlist or id == vlist then - local list = head.list - if list then - local _, h = insert(nn,list,nil,list) - head.list = h - end - else - stack, head = insert(nn,head,nil,head) + if current > 0 and nsnone then + local id = head.id + if id == hlist or id == vlist then + local list = head.list + if list then + head.list = insert_node_before(list,list,copy_node(nsnone)) end - return head, true, true + else + head = insert_node_before(head,head,copy_node(nsnone)) end + return head, true, true end return head, false, false end local function process(namespace,attribute,head,inheritance,default) -- one attribute - local trigger = triggering and namespace.triggering and trigger - local stack, previous, done = head, nil, false - local nsdata, nsreviver, nsnone = namespace.data, namespace.reviver, namespace.none + local stack, done = head, false while stack do local id = stack.id -- we need to deal with literals too (reset as well as oval) ---~ if id == glyph or (id == whatsit and stack.subtype == 8) or (id == rule and stack.width ~= 0) or (id == glue and stack.leader) then -- or disc + -- if id == glyph or (id == whatsit and stack.subtype == 8) or (id == rule and stack.width ~= 0) or (id == glue and stack.leader) then -- or disc if id == glyph or (id == rule and stack.width ~= 0) or (id == glue and stack.leader) then -- or disc local c = has_attribute(stack,attribute) if c then if default and c == inheritance then if current ~= default then - local data = nsdata[default] or nsreviver(default) - stack, head = insert(data,stack,previous,head) - current, done, used[default] = default, true, true + head = insert_node_before(head,stack,copy_node(nsdata[default])) + current, done = default, true end elseif current ~= c then - local data = nsdata[c] or nsreviver(c) - stack, head = insert(data,stack,previous,head) - current, done, used[c] = c, true, true + head = insert_node_before(head,stack,copy_node(nsdata[c])) + current, done = c, true end -- here ? compare selective if id == glue then --leader @@ -200,7 +178,7 @@ local function process(namespace,attribute,head,inheritance,default) -- one attr current = 0 end local ok = false - if trigger and has_attribute(stack,trigger) then + if nstrigger and has_attribute(stack,nstrigger) then local outer = has_attribute(stack,attribute) if outer ~= inheritance then stack.leader, ok = process(namespace,attribute,content,inheritance,outer) @@ -216,19 +194,18 @@ local function process(namespace,attribute,head,inheritance,default) -- one attr end elseif default and inheritance then if current ~= default then - local data = nsdata[default] or nsreviver(default) - stack, head = insert(data,stack,previous,head) - current, done, used[default] = default, true, true + head = insert_node_before(head,stack,copy_node(nsdata[default])) + current, done = default, true end elseif current > 0 then - stack, head = insert(nsnone,stack,previous,head) - current, done, used[0] = 0, true, true + head = insert_node_before(head,stack,copy_node(nsnone)) + current, done = 0, true end elseif id == hlist or id == vlist then local content = stack.list if content then local ok = false - if trigger and has_attribute(stack,trigger) then + if nstrigger and has_attribute(stack,nstrigger) then local outer = has_attribute(stack,attribute) if outer ~= inheritance then stack.list, ok = process(namespace,attribute,content,inheritance,outer) @@ -241,15 +218,8 @@ local function process(namespace,attribute,head,inheritance,default) -- one attr done = done or ok end end - previous = stack stack = stack.next end - -- we need to play safe --- i need a proper test set for this, maybe controlled per feature ---~ if current > 0 then ---~ stack, head = insert(nsnone,stack,previous,head) ---~ current, current_selector, done, used[0] = 0, 0, true, true ---~ end return head, done end @@ -262,40 +232,37 @@ states.process = process -- each other with the same color but different color spaces e.g. \showcolor) local function selective(namespace,attribute,head,inheritance,default) -- two attributes - local trigger = triggering and namespace.triggering and trigger - local stack, previous, done = head, nil, false - local nsforced, nsselector = namespace.forced, namespace.selector - local nsdata, nsreviver, nsnone = namespace.data, namespace.reviver, namespace.none + local stack, done = head, false while stack do local id = stack.id -- we need to deal with literals too (reset as well as oval) ---~ if id == glyph or (id == whatsit and stack.subtype == 8) or (id == rule and stack.width ~= 0) or (id == glue and stack.leader) then -- or disc + -- if id == glyph or (id == whatsit and stack.subtype == 8) or (id == rule and stack.width ~= 0) or (id == glue and stack.leader) then -- or disc if id == glyph or (id == rule and stack.width ~= 0) or (id == glue and stack.leader) then -- or disc local c = has_attribute(stack,attribute) if c then if default and c == inheritance then if current ~= default then - local data = nsdata[default] or nsreviver(default) - stack, head = insert(data[nsforced or has_attribute(stack,nsselector) or nsselector],stack,previous,head) - current, done, used[default] = default, true, true + local data = nsdata[default] + head = insert_node_before(head,stack,copy_node(data[nsforced or has_attribute(stack,nsselector) or nsselector])) + current, done = default, true end else local s = has_attribute(stack,nsselector) if current ~= c or current_selector ~= s then - local data = nsdata[c] or nsreviver(c) - stack, head = insert(data[nsforced or has_attribute(stack,nsselector) or nsselector],stack,previous,head) - current, current_selector, done, used[c] = c, s, true, true + local data = nsdata[c] + head = insert_node_before(head,stack,copy_node(data[nsforced or has_attribute(stack,nsselector) or nsselector])) + current, current_selector, done = c, s, true end end elseif default and inheritance then if current ~= default then - local data = nsdata[default] or nsreviver(default) - stack, head = insert(data[nsforced or has_attribute(stack,nsselector) or nsselector],stack,previous,head) - current, done, used[default] = default, true, true + local data = nsdata[default] + head = insert_node_before(head,stack,copy_node(data[nsforced or has_attribute(stack,nsselector) or nsselector])) + current, done = default, true end elseif current > 0 then - stack, head = insert(nsnone,stack,previous,head) - current, current_selector, done, used[0] = 0, 0, true, true + head = insert_node_before(head,stack,copy_node(nsnone)) + current, current_selector, done = 0, 0, true end if id == glue then -- leader -- same as *list @@ -310,7 +277,7 @@ local function selective(namespace,attribute,head,inheritance,default) -- two at current = 0 end local ok = false - if trigger and has_attribute(stack,trigger) then + if nstrigger and has_attribute(stack,nstrigger) then local outer = has_attribute(stack,attribute) if outer ~= inheritance then stack.leader, ok = selective(namespace,attribute,content,inheritance,outer) @@ -328,7 +295,7 @@ local function selective(namespace,attribute,head,inheritance,default) -- two at local content = stack.list if content then local ok = false - if trigger and has_attribute(stack,trigger) then + if nstrigger and has_attribute(stack,nstrigger) then local outer = has_attribute(stack,attribute) if outer ~= inheritance then stack.list, ok = selective(namespace,attribute,content,inheritance,outer) @@ -341,21 +308,75 @@ local function selective(namespace,attribute,head,inheritance,default) -- two at done = done or ok end end - previous = stack stack = stack.next end - -- we need to play safe, this is subptimal since now we end each box - -- even if it's not needed --- i need a proper test set for this, maybe controlled per feature ---~ if current > 0 then ---~ stack, head = insert(nsnone,stack,previous,head) ---~ current, current_selector, done, used[0] = 0, 0, true, true ---~ end return head, done end states.selective = selective +-- todo: each line now gets the (e.g. layer) property, hard to avoid (and not needed too) + +local function stacked(namespace,attribute,head,default) -- no triggering, no inheritance, but list-wise + local stack, done = head, false +--~ local current, depth = 0, 0 +local current, depth = default or 0, 0 + while stack do + local id = stack.id + if id == glyph or (id == rule and stack.width ~= 0) or (id == glue and stack.leader) then -- or disc + local c = has_attribute(stack,attribute) + if c then + if current ~= c then + head = insert_node_before(head,stack,copy_node(nsdata[c])) + depth = depth + 1 + current, done = c, true + end + if id == glue then + local content = stack.leader + if content then -- unchecked + local ok = false + stack.leader, ok = stacked(namespace,attribute,content,current) + done = done or ok + end + end + elseif default then + -- + elseif current > 0 then + head = insert_node_before(head,stack,copy_node(nsnone)) + depth = depth - 1 + current, done = 0, true + end + elseif id == hlist or id == vlist then + local content = stack.list + if content then + local c = has_attribute(stack,attribute) + if c and current ~= c then + local p = current + current, done = c, true + head = insert_node_before(head,stack,copy_node(nsdata[c])) + stack.list = stacked(namespace,attribute,content,current) + head, stack = insert_node_after(head,stack,copy_node(nsnone)) + current = p + else + local ok = false + stack.list, ok = stacked(namespace,attribute,content,current) + done = done or ok + end + end + end + stack = stack.next + end + while depth > 0 do + head = insert_node_after(head,stack,copy_node(nsnone)) + depth = depth -1 + end + return head, done +end + +states.stacked = stacked + +-- -- -- + statistics.register("attribute processing time", function() if statistics.elapsedindeed(attributes) then return format("%s seconds",statistics.elapsedtime(attributes)) diff --git a/tex/context/base/node-fin.mkiv b/tex/context/base/node-fin.mkiv index 787706ff2..8c15eb57d 100644 --- a/tex/context/base/node-fin.mkiv +++ b/tex/context/base/node-fin.mkiv @@ -22,14 +22,8 @@ \definesystemattribute[trigger] % feature inheritance -\newbox\finalizedshipoutbox - -\def\finalizeobjectbox#1{\ctxlua{nodes.process_page(tex.box[\number#1])}} - -\def\finalizeshipoutbox#1% % hack till we have access to pdf backend - {\global\setbox\finalizedshipoutbox\hbox{#1}% - \finalizeobjectbox\finalizedshipoutbox - \hbox{\ctxlua{states.flush()}\box\finalizedshipoutbox}} +\def\finalizeobjectbox #1{\ctxlua{nodes.process_page(tex.box[\number#1])}} +\def\finalizeshipoutbox#1{\ctxlua{nodes.process_page(tex.box[\number#1])}} % tricky stuff: diff --git a/tex/context/base/node-ini.lua b/tex/context/base/node-ini.lua index 8185e3033..3ff73c62f 100644 --- a/tex/context/base/node-ini.lua +++ b/tex/context/base/node-ini.lua @@ -110,7 +110,6 @@ local whatsit = node.id('whatsit') local traverse_id = node.traverse_id local traverse = node.traverse -local slide_nodes = node.slide local free_node = node.free local remove_node = node.remove @@ -132,10 +131,10 @@ function nodes.delete(head,current) return nodes.remove(head,current,true) end -nodes.before = node.insert_before -- broken +nodes.before = node.insert_before nodes.after = node.insert_after --- we need to test this, as it might be fixed +-- we need to test this, as it might be fixed now function nodes.before(h,c,n) if c then diff --git a/tex/context/base/node-inj.lua b/tex/context/base/node-inj.lua index 2e8b5ae81..dc676a412 100644 --- a/tex/context/base/node-inj.lua +++ b/tex/context/base/node-inj.lua @@ -114,7 +114,7 @@ end function nodes.trace_injection(head) local function dir(n) - return (n<0 and "r-to-l") or (n>0 and "l-to-r") or ("unset") + return (n and n<0 and "r-to-l") or (n and n>0 and "l-to-r") or ("unset") end local function report(...) logs.report("nodes finisher",...) @@ -132,9 +132,9 @@ function nodes.trace_injection(head) if kp then local k = kerns[kp] if k[3] then - report(" pairkern: dir=%s, x=%s, y=%s, w=%s, h=%s",dir(k[1]),k[2],k[3],k[4],k[5]) + report(" pairkern: dir=%s, x=%s, y=%s, w=%s, h=%s",dir(k[1]),k[2] or "?",k[3] or "?",k[4] or "?",k[5] or "?") else - report(" kern: dir=%s, dx=%s",dir(k[1]),k[2]) + report(" kern: dir=%s, dx=%s",dir(k[1]),k[2] or "?") end end if mb then @@ -145,13 +145,13 @@ function nodes.trace_injection(head) if mb then local m = m[mb] if m then - report(" markmark: bound=%s, index=%s, dx=%s, dy=%s",mm,j,m[1],m[2]) + report(" markmark: bound=%s, index=%s, dx=%s, dy=%s",mm,md or "?",m[1] or "?",m[2] or "?") else report(" markmark: bound=%s, missing index",mm) end else m = m[1] - report(" markmark: bound=%s, dx=%s, dy=%s",mm,m[1],m[2]) + report(" markmark: bound=%s, dx=%s, dy=%s",mm,m[1] or "?",m[2] or "?") end end if cb then @@ -159,7 +159,7 @@ function nodes.trace_injection(head) end if cc then local c = cursives[cc] - report(" curscurs: bound=%s, dir=%s, dx=%s, dy=%s",cc,dir(c[1]),c[2],c[3]) + report(" curscurs: bound=%s, dir=%s, dx=%s, dy=%s",cc,dir(c[1]),c[2] or "?",c[3] or "?") end end end @@ -168,18 +168,24 @@ end -- todo: reuse tables (i.e. no collection), but will be extra fields anyway -function nodes.inject_kerns(head,tail,where,keep) - if trace_injections then - nodes.trace_injection(head) - end +function nodes.inject_kerns(head,where,keep) local has_marks, has_cursives, has_kerns = next(marks), next(cursives), next(kerns) if has_marks or has_cursives then + if trace_injections then + nodes.trace_injection(head) + end -- in the future variant we will not copy items but refs to tables - local done, ky, rl, valid, cx, wx = false, { }, { }, { }, { }, { } + local done, ky, rl, valid, cx, wx, mk = false, { }, { }, { }, { }, { }, { } if has_kerns then -- move outside loop + local nf, tm = nil, nil for n in traverse_id(glyph,head) do if n.subtype < 256 then valid[#valid+1] = n + if n.font ~= nf then + nf = n.font + tm = fontdata[nf].marks + end + mk[n] = tm[n.char] local k = has_attribute(n,kernpair) if k then local kk = kerns[k] @@ -198,9 +204,15 @@ function nodes.inject_kerns(head,tail,where,keep) end end else + local nf, tm = nil, nil for n in traverse_id(glyph,head) do if n.subtype < 256 then valid[#valid+1] = n + if n.font ~= nf then + nf = n.font + tm = fontdata[nf].marks + end + mk[n] = tm[n.char] end end end @@ -214,22 +226,15 @@ function nodes.inject_kerns(head,tail,where,keep) end -- todo: reuse t and use maxt if has_cursives then - local n_cursbase, n_curscurs, p_cursbase, n, p, nf, tm = nil, nil, nil, nil, nil, nil, nil + local p_cursbase, p = nil, nil -- since we need valid[n+1] we can also use a "while true do" local t, d, maxt = { }, { }, 0 for i=1,#valid do -- valid == glyphs - n = valid[i] - if n.font ~= nf then - nf = n.font ---~ print(n.font,nf,fontdata[nf]) - tm = fontdata[nf].marks - -- maybe flush - maxt = 0 - end - if not tm[n.char] then - n_cursbase = has_attribute(n,cursbase) - n_curscurs = has_attribute(n,curscurs) + local n = valid[i] + if not mk[n] then + local n_cursbase = has_attribute(n,cursbase) if p_cursbase then + local n_curscurs = has_attribute(n,curscurs) if p_cursbase == n_curscurs then local c = cursives[n_curscurs] if c then @@ -257,7 +262,8 @@ function nodes.inject_kerns(head,tail,where,keep) local ny = n.yoffset for i=maxt,1,-1 do ny = ny + d[i] - t[i].yoffset = t[i].yoffset + ny + local ti = t[i] + ti.yoffset = ti.yoffset + ny end maxt = 0 end @@ -265,7 +271,8 @@ function nodes.inject_kerns(head,tail,where,keep) local ny = n.yoffset for i=maxt,1,-1 do ny = ny + d[i] - t[i].yoffset = ny + local ti = t[i] + ti.yoffset = ny end maxt = 0 end @@ -276,7 +283,8 @@ function nodes.inject_kerns(head,tail,where,keep) local ny = n.yoffset for i=maxt,1,-1 do ny = ny + d[i] - t[i].yoffset = ny + local ti = t[i] + ti.yoffset = ny end maxt = 0 end @@ -285,14 +293,13 @@ function nodes.inject_kerns(head,tail,where,keep) end end if has_marks then - local p_markbase, n_markmark = nil, nil for i=1,#valid do local p = valid[i] - p_markbase = has_attribute(p,markbase) + local p_markbase = has_attribute(p,markbase) if p_markbase then local mrks = marks[p_markbase] for n in traverse_id(glyph,p.next) do - n_markmark = has_attribute(n,markmark) + local n_markmark = has_attribute(n,markmark) if p_markbase == n_markmark then local index = has_attribute(n,markdone) or 1 local d = mrks[index] @@ -301,9 +308,17 @@ function nodes.inject_kerns(head,tail,where,keep) -- if rlmode and rlmode < 0 then -- n.xoffset = p.xoffset + d[1] -- else - n.xoffset = p.xoffset - d[1] + n.xoffset = p.xoffset - d[1] +--~ local k = wx[p] +--~ if k then +--~ wx[n] = k +--~ end -- end - n.yoffset = p.yoffset + d[2] + if mk[p] then + n.yoffset = p.yoffset + d[2] + else + n.yoffset = n.yoffset + p.yoffset + d[2] + end end else break @@ -358,224 +373,9 @@ function nodes.inject_kerns(head,tail,where,keep) kerns, cursives, marks = { }, { }, { } end elseif has_kerns then - -- we assume done is true because there are kerns - for n in traverse_id(glyph,head) do - local k = has_attribute(n,kernpair) - if k then - local kk = kerns[k] - if kk then - -- only w can be nil, can be sped up when w == nil - local rl, x, y, w = kk[1], kk[2] or 0, kk[3] or 0, kk[4] or 0 - if y ~= 0 then - n.yoffset = y -- todo: h ? - end - local wx = w - x - if rl < 0 then - if wx ~= 0 then - insert_node_before(head,n,newkern(wx)) - end - if x ~= 0 then - insert_node_after (head,n,newkern(x)) - end - else - -- if wx ~= 0 then - -- insert_node_after(head,n,newkern(wx)) - -- end - if x ~= 0 then - insert_node_before(head,n,newkern(x)) - end - end - end - end + if trace_injections then + nodes.trace_injection(head) end - if not keep then - kerns = { } - end - return head, true - end - return head, false -end - --- -- -- KEEP OLD ONE, THE NEXT IS JUST OPTIMIZED -- -- -- - -function nodes.XXXXXXXxinject_kerns(head,tail,keep) - if trace_injections then - nodes.trace_injection(head) - end - local has_marks, has_cursives, has_kerns = next(marks), next(cursives), next(kerns) - if has_marks or has_cursives then - -- in the future variant we will not copy items but refs to tables - local done, ky, valid, cx, wx = false, { }, { }, { }, { } - for n in traverse_id(glyph,head) do - if n.subtype < 256 then - valid[#valid+1] = n - if has_kerns then -- move outside loop - local k = has_attribute(n,kernpair) - if k then - local kk = kerns[k] - if kk then - local x, y, w, h = kk[2], kk[3], kk[4], kk[5] - local dy = y - h - if dy ~= 0 then - ky[n] = dy - end - if w ~= 0 or x ~= 0 then - wx[n] = kk - end - end - end - end - end - end - if #valid > 0 then - -- we can assume done == true because we have cursives and marks - local cx = { } - if has_kerns and next(ky) then - for n, k in next, ky do - n.yoffset = k - end - end - -- todo: reuse t and use maxt - if has_cursives then - local n_cursbase, n_curscurs, p_cursbase, n, p, nf, tm = nil, nil, nil, nil, nil, nil, nil - -- since we need valid[n+1] we can also use a "while true do" - local t, d, maxt = { }, { }, 0 - for i=1,#valid do -- valid == glyphs - n = valid[i] - if n.font ~= nf then - nf = n.font - tm = fontdata[nf].marks - -- maybe flush - maxt = 0 - end - if not tm[n.char] then - n_cursbase = has_attribute(n,cursbase) - n_curscurs = has_attribute(n,curscurs) - if p_cursbase then - if p_cursbase == n_curscurs then - local c = cursives[n_curscurs] - if c then - local rlmode, dx, dy, ws, wn = c[1], c[2], c[3], c[4], c[5] - if rlmode >= 0 then - dx = dx - ws - else - dx = dx + wn - end - if dx ~= 0 then -if rlmode < 0 then - cx[n] = -dx -else - cx[n] = dx -end - end - -- if rlmode and rlmode < 0 then - dy = -dy - -- end - maxt = maxt + 1 - t[maxt] = p - d[maxt] = dy - else - maxt = 0 - end - end - elseif maxt > 0 then - local ny = n.yoffset - for i=maxt,1,-1 do - ny = ny + d[i] - t[i].yoffset = t[i].yoffset + ny - end - maxt = 0 - end - if not n_cursbase and maxt > 0 then - local ny = n.yoffset - for i=maxt,1,-1 do - ny = ny + d[i] - t[i].yoffset = ny - end - maxt = 0 - end - p_cursbase, p = n_cursbase, n - end - end - if maxt > 0 then - local ny = n.yoffset - for i=maxt,1,-1 do - ny = ny + d[i] - t[i].yoffset = ny - end - maxt = 0 - end - if not keep then - cursives = { } - end - end - if has_marks then - local p_markbase, n_markmark = nil, nil - for i=1,#valid do - local p = valid[i] - p_markbase = has_attribute(p,markbase) - if p_markbase then - local mrks = marks[p_markbase] - for n in traverse_id(glyph,p.next) do - n_markmark = has_attribute(n,markmark) - if p_markbase == n_markmark then - local index = has_attribute(n,markdone) or 1 - local d = mrks[index] - if d then - local d1, d2 = d[1], d[2] - if d1 ~= 0 then - n.xoffset = p.xoffset - d[1] - end - if d2 ~= 0 then - n.yoffset = p.yoffset + d[2] - end - end - else - break - end - end - end - end - if not keep then - marks = { } - end - end - -- todo : combine - if next(wx) then - for n, k in next, wx do - -- only w can be nil, can be sped up when w == nil - local rl, x, w = k[1], k[2] or 0, k[4] or 0 - local wx = w - x - if rl < 0 then - if wx ~= 0 then - insert_node_before(head,n,newkern(wx)) - end - if x ~= 0 then - insert_node_after (head,n,newkern(x)) - end - else - -- if wx ~= 0 then - -- insert_node_after(head,n,newkern(wx)) - -- end - if x ~= 0 then - insert_node_before(head,n,newkern(x)) - end - end - end - end - if next(cx) then - for n, k in next, cx do - insert_node_before(head,n,newkern(k)) - end - end - if not keep then - kerns = { } - end - return head, true - elseif not keep then - kerns, cursives, marks = { }, { }, { } - end - elseif has_kerns then -- we assume done is true because there are kerns for n in traverse_id(glyph,head) do local k = has_attribute(n,kernpair) @@ -610,6 +410,8 @@ end kerns = { } end return head, true + else + -- no tracing needed end return head, false end diff --git a/tex/context/base/node-pro.lua b/tex/context/base/node-pro.lua index 708237838..acc3f1676 100644 --- a/tex/context/base/node-pro.lua +++ b/tex/context/base/node-pro.lua @@ -11,13 +11,8 @@ local format, concat = string.format, table.concat local trace_callbacks = false trackers.register("nodes.callbacks", function(v) trace_callbacks = v end) -local hlist = node.id('hlist') -local vlist = node.id('vlist') local glyph = node.id('glyph') -local disc = node.id('disc') -local mark = node.id('mark') -local slide_nodes = node.slide local free_node = node.free local first_character = node.first_character @@ -30,7 +25,7 @@ lists = lists or { } chars = chars or { } words = words or { } -- not used yet -local actions = tasks.actions("processors",2) -- head, tail, where, boolean +local actions = tasks.actions("processors",2) -- head, where, boolean local n = 0 @@ -65,12 +60,12 @@ end nodes.processors.enabled = true -- thsi will become a proper state (like trackers) -function nodes.processors.pre_linebreak_filter(head,groupcode) -- todo: tail +function nodes.processors.pre_linebreak_filter(head,groupcode) local first, found = first_character(head) if found then if trace_callbacks then local before = nodes.count(head,true) - local head, tail, done = actions(head,slide_nodes(head),groupcode) + local head, done = actions(head,groupcode) local after = nodes.count(head,true) if done then tracer("pre_linebreak","changed",head,groupcode,before,after,true) @@ -79,7 +74,7 @@ function nodes.processors.pre_linebreak_filter(head,groupcode) -- todo: tail end return (done and head) or true else - local head, tail, done = actions(head,slide_nodes(head),groupcode) + local head, done = actions(head,groupcode) return (done and head) or true end elseif trace_callbacks then @@ -89,12 +84,12 @@ function nodes.processors.pre_linebreak_filter(head,groupcode) -- todo: tail return true end -function nodes.processors.hpack_filter(head,groupcode) -- todo: tail +function nodes.processors.hpack_filter(head,groupcode) local first, found = first_character(head) if found then if trace_callbacks then local before = nodes.count(head,true) - local head, tail, done = actions(head,slide_nodes(head),groupcode) + local head, done = actions(head,groupcode) local after = nodes.count(head,true) if done then tracer("hpack","changed",head,groupcode,before,after,true) @@ -103,7 +98,7 @@ function nodes.processors.hpack_filter(head,groupcode) -- todo: tail end return (done and head) or true else - local head, tail, done = actions(head,slide_nodes(head),groupcode) + local head, done = actions(head,groupcode) return (done and head) or true end elseif trace_callbacks then @@ -116,17 +111,19 @@ end callback.register('pre_linebreak_filter', nodes.processors.pre_linebreak_filter) callback.register('hpack_filter' , nodes.processors.hpack_filter) -local actions = tasks.actions("finalizers",2) -- head, tail, where, boolean +local actions = tasks.actions("finalizers",2) -- head, where, boolean -- beware, these are packaged boxes so no first_character test -- maybe some day a hash with valid groupcodes +-- +-- beware, much can pass twice, for instance vadjust passes two times -function nodes.processors.post_linebreak_filter(head,groupcode) -- todo: tail +function nodes.processors.post_linebreak_filter(head,groupcode) --~ local first, found = first_character(head) --~ if found then if trace_callbacks then local before = nodes.count(head,true) - local head, tail, done = actions(head,slide_nodes(head),groupcode) + local head, done = actions(head,groupcode) local after = nodes.count(head,true) if done then tracer("finalizer","changed",head,groupcode,before,after,true) @@ -135,7 +132,7 @@ function nodes.processors.post_linebreak_filter(head,groupcode) -- todo: tail end return (done and head) or true else - local head, tail, done = actions(head,slide_nodes(head),groupcode) + local head, done = actions(head,groupcode) return (done and head) or true end --~ elseif trace_callbacks then diff --git a/tex/context/base/node-ref.lua b/tex/context/base/node-ref.lua new file mode 100644 index 000000000..571ba3dd7 --- /dev/null +++ b/tex/context/base/node-ref.lua @@ -0,0 +1,496 @@ +if not modules then modules = { } end modules ['node-bck'] = { + version = 1.001, + comment = "companion to node-bck.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- We supported pdf right from the start and in mkii this has resulted in +-- extensive control over the links. Nowadays pdftex provides a lot more +-- control over margins but as mkii supports multiple backends we stuck to +-- our own mechanisms. In mkiv again we implement our own handling. Eventually +-- we will even disable the pdf primitives. + +-- helper, will end up in luatex + +local cleanupreferences, cleanupdestinations = false, true + +local nodeinjections = backends.nodeinjections +local codeinjections = backends.codeinjections + +local hpack_list = node.hpack +local copy_list = node.copy_list +local flush_list = node.flush_list + +local function dimensions(parent,start,stop) -- so we need parent for glue_set info + local n = stop.next + stop.next = nil + local p = hpack_list(copy_list(start)) + stop.next = n + local w, h, d = p.width, p.height, p.depth + flush_list(p) + return w, h, d +end + +-- current.glue_set current.glue_sign + +local trace_backend = false trackers.register("nodes.backend", function(v) trace_backend = v end) +local trace_references = false trackers.register("nodes.references", function(v) trace_references = v end) +local trace_destinations = false trackers.register("nodes.destinations", function(v) trace_destinations = v end) + +local hlist = node.id("hlist") +local vlist = node.id("vlist") +local glue = node.id("glue") +local whatsit = node.id("whatsit") + +local new_kern = nodes.kern + +local has_attribute = node.has_attribute +local traverse = node.traverse +local find_node_tail = node.tail or node.slide +local tosequence = nodes.tosequence + +local function inject_range(head,first,last,reference,make,stack,parent,pardir,txtdir) + local width, height, depth = dimensions(parent,first,last) + if pardir == "TRT" or txtdir == "+TRT" then + width = - width + end + local result, resolved = make(width,height,depth,reference) + if result and resolved then + if head == first then + if trace_backend then + logs.report("backend","head: %04i %s %s %s => w=%s, h=%s, d=%s, c=%s",reference,pardir or "---",txtdir or "----",tosequence(first,last,true),width,height,depth,resolved) + end + result.next = first + first.prev = result + return result, last + else + if trace_backend then + logs.report("backend","middle: %04i %s %s => w=%s, h=%s, d=%s, c=%s",reference,pardir or "---",txtdir or "----",tosequence(first,last,true),width,height,depth,resolved) + end + local prev = first.prev + if prev then + result.next = first + result.prev = prev + prev.next = result + first.prev = result + else + result.next = first + first.prev = result + end + if first == head.next then + head.next = result -- hm, weird + end + return head, last + end + else + return head, last + end +end + +local function inject_list(id,current,reference,make,stack,pardir,txtdir) + local width, height, depth, correction = current.width, current.height, current.depth, 0 + local moveright = false + local first = current.list + if id == hlist then + -- can be either an explicit hbox or a line and there is no way + -- to recognize this; anyway only if ht/dp (then inline) + local sr = stack[reference] + if first then + if sr and sr[2] then + local last = find_node_tail(first) + if last.id == glue and last.subtype == 9 then + local prev = last.prev + moveright = first.id == glue and first.subtype == 8 + if prev.id == glue and prev.subtype == 15 then + width = dimensions(current,first,prev.prev) -- maybe not current as we already take care of it + else + if moveright and first.spec then + width = width - first.spec.stretch*current.glue_set * current.glue_sign + end + if last.spec then + width = width - last.spec.stretch*current.glue_set * current.glue_sign + end + end + end + else + -- also weird + end + else + -- ok + end + correction = width + else + correction = height + depth + height, depth = depth, height -- ugly hack, needed because pdftex backend does something funny + end + if pardir == "TRT" then + width = - width + end + local result, resolved = make(width,height,depth,reference) + if result and resolved then + if trace_backend then + logs.report("backend","box: %04i %s %s: w=%s, h=%s, d=%s, c=%s",reference,pardir or "---",txtdir or "----",width,height,depth,resolved) + end + if not first then + current.list = result + elseif moveright then -- brr no prevs done + -- result after first + local n = first.next + result.next = n + first.next = result + result.prev = first + if n then n.prev = result end + else + -- first after result + result.next = first + first.prev = result + current.list = result + end + end +end + +local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,txtdir) -- main + if head then + local current, first, last, firstdir, reference = head, nil, nil, nil, nil + pardir = pardir or "===" + txtdir = txtdir or "===" + while current do + local id = current.id + local r = has_attribute(current,attribute) + if id == whatsit then + local subtype = current.subtype + if subtype == 6 then + pardir = current.dir + elseif subtype == 7 then + txtdir = current.dir + end + elseif id == hlist or id == vlist then + if r and (not skip or r > skip) then + inject_list(id,current,r,make,stack,pardir,txtdir) + done[r] = true + end + local list = current.list + if list then + local pd + current.list, _, pardir, txtdir = inject_areas(list,attribute,make,stack,done,r or skip or 0,current,pardir,txtdir) + end + elseif not r then + -- just go on, can be kerns + elseif not reference then + reference, first, last, firstdir = r, current, current, txtdir + elseif r == reference then + last = current + elseif not done[reference] then + if not skip or r > skip then + head, current = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) + reference, first, last, firstdir = nil, nil, nil, nil + end + else + reference, first, last, firstdir = r, current, current, txtdir + end + current = current.next + end + if reference and not done[reference] then + head = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) + end + end + return head, true, pardir, txtdir +end + +local function inject_area(head,attribute,make,stack,done,pardir,txtdir) -- singular ! + if head then + pardir = pardir or "===" + txtdir = txtdir or "===" + local current = head + while current do + local id = current.id + local r = has_attribute(current,attribute) + if id == whatsit then + local subtype = current.subtype + if subtype == 6 then + pardir = current.dir + elseif subtype == 7 then + txtdir = current.dir + end + elseif id == hlist or id == vlist then + if r and not done[r] then + done[r] = true + inject_list(id,current,r,make,stack,pardir,txtdir) + end + current.list = inject_area(current.list,attribute,make,stack,done,pardir,txtdir) + elseif r and not done[r] then + done[r] = true + head, current = inject_range(head,current,current,r,make,stack,pardir,txtdir) + end + current = current.next + end + end + return head, true +end + +-- tracing + +local new_rule = nodes.rule +local new_kern = nodes.kern +local set_attribute = node.set_attribute +local register_color = colors.register + +local a_colormodel = attributes.private('colormodel') +local a_color = attributes.private('color') +local a_transparency = attributes.private('transparency') +local u_transparency = nil +local u_colors = { } +local force_gray = true + +local function colorize(width,height,depth,n) + if force_gray then n = 0 end + u_transparency = u_transparency or transparencies.register(nil,2,.65) + local ucolor = u_colors[n] + if not ucolor then + if n == 1 then + u_color = register_color('color',nil,'rgb',.75,0,0) + elseif n == 2 then + u_color = register_color('color',nil,'rgb',0,.75,0) + elseif n == 3 then + u_color = register_color('color',nil,'rgb',0,0,.75) + else + n = 0 + u_color = register_color('color',nil,'gray',.5) + end + u_colors[n] = u_color + end + local rule = new_rule(width,height,depth) + set_attribute(rule,a_colormodel,1) -- gray color model + set_attribute(rule,a_color,u_color) + set_attribute(rule,a_transparency,u_transparency) + if width < 0 then + local kern = new_kern(width) + rule.width = -width + kern.next = rule + rule.prev = kern + return kern + else + return rule + end +end + +local new_kern = nodes.kern +local texattribute = tex.attribute +local texcount = tex.count + +-- references: + +nodes.references = { + attribute = attributes.private('reference'), + stack = { }, + done = { }, +} + +local stack, done, attribute = nodes.references.stack, nodes.references.done, nodes.references.attribute + +local nofreferences, topofstack = 0, 0 + +local function setreference(n,h,d,r) -- n is just a number, can be used for tracing + topofstack = topofstack + 1 + stack[topofstack] = { n, h, d, codeinjections.prerollreference(r) } -- the preroll permits us to determine samepage (but delayed also has some advantages) +--~ texattribute[attribute] = topofstack -- todo -> at tex end + texcount.lastreferenceattribute = topofstack +end + +nodes.setreference = setreference + +local function makereference(width,height,depth,reference) + local sr = stack[reference] + if sr then + local resolved, ht, dp, set = sr[1], sr[2], sr[3], sr[4] + if ht then + if height < ht then height = ht end + if depth < dp then depth = dp end + end + local annot = nodeinjections.reference(width,height,depth,set) + if annot then + nofreferences = nofreferences + 1 + local result, current + if trace_references then + local step = 65536 + result = hpack_list(colorize(width,height-step,depth-step,2)) -- step subtracted so that we can see seperate links + result.width = 0 + current = result + end + if current then + current.next = annot + else + result = annot + end + result = hpack_list(result,0) + result.width, result.height, result.depth = 0, 0, 0 + if cleanupreferences then stack[reference] = nil end + return result, resolved + else + logs.report("backends","unable to resolve reference annotation %s",reference) + end + else + logs.report("backends","unable to resolve reference attribute %s",reference) + end +end + +function nodes.add_references(head) + if topofstack > 0 then + return inject_areas(head,attribute,makereference,stack,done) + else + return head, false + end +end + +-- destinations (we can clean up once set!) + +nodes.destinations = { + attribute = attributes.private('destination'), + stack = { }, + done = { }, +} + +local stack, done, attribute = nodes.destinations.stack, nodes.destinations.done, nodes.destinations.attribute + +local nofdestinations, topofstack = 0, 0 + +local function setdestination(n,h,d,name,view) -- n = grouplevel, name == table + topofstack = topofstack + 1 + stack[topofstack] = { n, h, d, name, view } + return topofstack +end + +nodes.setdestination = setdestination + +local function makedestination(width,height,depth,reference) + local sr = stack[reference] + if sr then + local resolved, ht, dp, name, view = sr[1], sr[2], sr[3], sr[4], sr[5] + if ht then + if height < ht then height = ht end + if depth < dp then depth = dp end + end + local result, current + if trace_destinations then + local step = 0 + if width == 0 then + step = 4*65536 + width, height, depth = 5*step, 5*step, 0 + end + for n=1,#name do + local rule = hpack_list(colorize(width,height,depth,3)) + rule.width = 0 + if not result then + result, current = rule, rule + else + current.next = rule + rule.prev = current + current = rule + end + width, height = width - step, height - step + end + end + nofdestinations = nofdestinations + 1 + for n=1,#name do + local annot = nodeinjections.destination(width,height,depth,name[n],view) + if not result then + result, current = annot, annot + else + current.next = annot + annot.prev = current + current = annot + end + end + result = hpack_list(result,0) + result.width, result.height, result.depth = 0, 0, 0 + if cleanupdestinations then stack[reference] = nil end + return result, resolved + else + logs.report("backends","unable to resolve destination attribute %s",reference) + end +end + +function nodes.add_destinations(head) + if topofstack > 0 then + return inject_area(head,attribute,makedestination,stack,done) -- singular + else + return head, false + end +end + +-- will move + +function jobreferences.mark(reference,h,d,view) + return setdestination(tex.currentgrouplevel,h,d,reference,view) +end + +function jobreferences.inject(prefix,reference,h,d,highlight,newwindow,layer) -- todo: use currentreference is possible + local set, bug = jobreferences.identify(prefix,reference) + if bug or #set == 0 then + -- unknown ref, just don't set it and issue an error + else + -- check + set.highlight, set.newwindow,set.layer = highlight, newwindow, layer + setreference(tex.currentgrouplevel,h,d,set) -- sets attribute / todo: for set[*].error + end +end + +function jobreferences.injectcurrentset(h,d) -- used inside doifelse + local currentset = jobreferences.currentset + if currentset then + setreference(tex.currentgrouplevel,h,d,currentset) -- sets attribute / todo: for set[*].error + end +end + +-- + +local function checkboth(open,close) + if open and open ~= "" then + local set, bug = jobreferences.identify("",open) + open = not bug and #set > 0 and set + end + if close and close ~= "" then + local set, bug = jobreferences.identify("",close) + close = not bug and #set > 0 and set + end + return open, close +end + +-- expansion is temp hack + +local opendocument, closedocument, openpage, closepage + +local function check(what) + if what and what ~= "" then + local set, bug = jobreferences.identify("",what) + return not bug and #set > 0 and set + end +end + +function jobreferences.checkopendocumentactions (open) opendocument = check(open) end +function jobreferences.checkclosedocumentactions(close) closedocument = check(close) end +function jobreferences.checkopenpageactions (open) openpage = check(open) end +function jobreferences.checkclosepageactions (close) closepage = check(close) end + +function jobreferences.flushdocumentactions() + if opendocument or closedocument then + backends.codeinjections.flushdocumentactions(opendocument,closedocument) -- backend + end +end +function jobreferences.flushpageactions() + if openpage or closepage then + backends.codeinjections.flushpageactions(openpage,closepage) -- backend + end +end + +-- end temp hack + +statistics.register("interactive elements", function() + if nofreferences > 0 or nofdestinations > 0 then + return string.format("%s references, %s destinations",nofreferences,nofdestinations) + else + return nil + end +end) diff --git a/tex/context/base/node-res.lua b/tex/context/base/node-res.lua index b84e5b105..4f2cf5a05 100644 --- a/tex/context/base/node-res.lua +++ b/tex/context/base/node-res.lua @@ -7,7 +7,7 @@ if not modules then modules = { } end modules ['node-res'] = { } local gmatch, format = string.gmatch, string.format -local copy_node, free_node, new_node = node.copy, node.free, node.new +local copy_node, free_node, free_list, new_node = node.copy, node.free, node.flush_list, node.new --[[ldx--

The next function is not that much needed but in we use @@ -51,7 +51,6 @@ function nodes.usage() return t end -local pdfliteral = nodes.register(new_node("whatsit",8)) pdfliteral.mode = 1 local disc = nodes.register(new_node("disc")) local kern = nodes.register(new_node("kern",1)) local penalty = nodes.register(new_node("penalty")) @@ -60,6 +59,7 @@ local glue_spec = nodes.register(new_node("glue_spec")) local glyph = nodes.register(new_node("glyph",0)) local textdir = nodes.register(new_node("whatsit",7)) local rule = nodes.register(new_node("rule")) +local latelua = nodes.register(new_node("whatsit",35)) function nodes.glyph(fnt,chr) local n = copy_node(glyph) @@ -91,11 +91,6 @@ end function nodes.disc() return copy_node(disc) end -function nodes.pdfliteral(str) - local t = copy_node(pdfliteral) - t.data = str - return t -end function nodes.textdir(dir) local t = copy_node(textdir) t.dir = dir @@ -108,6 +103,11 @@ function nodes.rule(w,h,d) if d then n.depth = d end return n end +function nodes.latelua(code) + local n = copy_node(latelua) + n.data = code + return n +end statistics.register("cleaned up reserved nodes", function() return format("%s nodes, %s lists of %s", nodes.cleanup_reserved(tex.count["lastallocatedbox"])) diff --git a/tex/context/base/node-seq.lua b/tex/context/base/node-seq.lua index b8c432223..43ca8a99b 100644 --- a/tex/context/base/node-seq.lua +++ b/tex/context/base/node-seq.lua @@ -115,12 +115,18 @@ function sequencer.tostring(t,n) -- n not done return format(template,concat(vars,"\n"),concat(calls,"\n")) end +-- we used to deal with tail as well but now that the lists are always +-- double linked and the kernel function no longer expect tail as +-- argument we stick to head and done (done can probably also go +-- as luatex deals with return values efficiently now .. in the +-- past there was some copying involved, but no longer) + local template = [[ %s -return function(head,tail%s) +return function(head%s) local ok, done = false, false %s - return head, tail, done + return head, done end]] function sequencer.nodeprocessor(t,n) @@ -142,11 +148,9 @@ function sequencer.nodeprocessor(t,n) local localized = localize(action) vars[#vars+1] = format("local %s = %s",localized,action) if kind[action] == "nohead" then - calls[#calls+1] = format(" ok = %s(head,tail%s) done = done or ok -- %s %i",localized,args,group,i) - elseif kind[action] == "notail" then - calls[#calls+1] = format(" head, ok = %s(head,tail%s) done = done or ok -- %s %i",localized,args,group,i) + calls[#calls+1] = format(" ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i) else - calls[#calls+1] = format(" head, tail, ok = %s(head,tail%s) done = done or ok -- %s %i",localized,args,group,i) + calls[#calls+1] = format(" head, ok = %s(head%s) done = done or ok -- %s %i",localized,args,group,i) end end end @@ -177,7 +181,7 @@ end --~ sequencer.prependaction(t,"taco","taco.j") --~ sequencer.removeaction(t,"hans","hans.x") ---~ sequencer.setkind(t,"hans.b","notail") +--~ sequencer.setkind(t,"hans.b") --~ sequencer.setkind(t,"taco.j","nohead") --~ print(sequencer.tostring(t)) diff --git a/tex/context/base/node-shp.lua b/tex/context/base/node-shp.lua index 48dd8c5c7..22b97ca6e 100644 --- a/tex/context/base/node-shp.lua +++ b/tex/context/base/node-shp.lua @@ -62,5 +62,5 @@ end local actions = tasks.actions("shipouts",0) -- no extra arguments function nodes.process_page(head) -- problem, attr loaded before node, todo ... - return actions(head) -- no tail + return actions(head) end diff --git a/tex/context/base/node-tex.lua b/tex/context/base/node-tex.lua index 563e6a397..1995f4aa2 100644 --- a/tex/context/base/node-tex.lua +++ b/tex/context/base/node-tex.lua @@ -13,40 +13,25 @@ kernel = kernel or { } local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming local hyphenate, ligaturing, kerning = lang.hyphenate, node.ligaturing, node.kerning -function kernel.hyphenation(head,tail) -- lang.hyphenate returns done - if head == tail then - return head, tail, false - else +function kernel.hyphenation(head) -- starttiming(kernel) - -- local done = hyphenate(head,tail) + local done = hyphenate(head) -- stoptiming(kernel) - -- return head, tail, done - return head, tail, hyphenate(head,tail) - end + return head, done end -function kernel.ligaturing(head,tail) -- node.ligaturing returns head,tail,done - if head == tail then - return head, tail, false - else +function kernel.ligaturing(head) -- starttiming(kernel) - -- local head, tail, done = ligaturing(head,tail) + local head, tail, done = ligaturing(head) -- todo: check what is returned -- stoptiming(kernel) - -- return head, tail, done - return ligaturing(head,tail) - end + return head, done end -function kernel.kerning(head,tail) -- node.kerning returns head,tail,done - if head == tail then - return head, tail, false - else +function kernel.kerning(head) -- starttiming(kernel) - -- local head, tail, done = kerning(head,tail) + local head, tail, done = kerning(head) -- todo: check what is returned -- stoptiming(kernel) - -- return head, tail, done - return kerning(head,tail) - end + return head, done end callback.register('hyphenate' , false) diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua index 50f8287ee..aeaa6769e 100644 --- a/tex/context/base/node-tra.lua +++ b/tex/context/base/node-tra.lua @@ -388,9 +388,9 @@ function nodes.pack_list(head) return t end -function nodes.ids_to_string(head) +function nodes.ids_to_string(head,tail) local t, last_id, last_n = { }, nil, 0 - for n in traverse_nodes(head) do + for n in traverse_nodes(head,tail) do local id = n.id if not last_id then last_id, last_n = id, 1 diff --git a/tex/context/base/node-tsk.lua b/tex/context/base/node-tsk.lua index bfa9f1196..d2ac57d6b 100644 --- a/tex/context/base/node-tsk.lua +++ b/tex/context/base/node-tsk.lua @@ -76,7 +76,7 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no .. local data = tasks.data[name] if data then if n == 0 then - return function(head,tail) + return function(head) local runner = data.runner total = total + 1 -- will go away if not runner then @@ -87,10 +87,10 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no .. runner = sequencer.compile(data.list,sequencer.nodeprocessor,0) data.runner = runner end - return runner(head,tail) + return runner(head) end elseif n == 1 then - return function(head,tail,one) + return function(head,one) total = total + 1 -- will go away local runner = data.runner if not runner then @@ -101,10 +101,10 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no .. runner = sequencer.compile(data.list,sequencer.nodeprocessor,1) data.runner = runner end - return runner(head,tail,one) + return runner(head,one) end elseif n == 2 then - return function(head,tail,one,two) + return function(head,one,two) total = total + 1 -- will go away local runner = data.runner if not runner then @@ -115,10 +115,10 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no .. runner = sequencer.compile(data.list,sequencer.nodeprocessor,2) data.runner = runner end - return runner(head,tail,one,two) + return runner(head,one,two) end else - return function(head,tail,...) + return function(head,...) total = total + 1 -- will go away local runner = data.runner if not runner then @@ -129,7 +129,7 @@ function tasks.actions(name,n) -- we optimize for the number or arguments (no .. runner = sequencer.compile(data.list,sequencer.nodeprocessor,3) data.runner = runner end - return runner(head,tail,...) + return runner(head,...) end end else diff --git a/tex/context/base/node-tst.lua b/tex/context/base/node-tst.lua index e8b1146f8..4fb6b4bca 100644 --- a/tex/context/base/node-tst.lua +++ b/tex/context/base/node-tst.lua @@ -6,6 +6,17 @@ if not modules then modules = { } end modules ['node-tst'] = { license = "see context related readme files" } +local glue = node.id("glue") +local penalty = node.id("penalty") +local kern = node.id("kern") +local glyph = node.id("glyph") +local whatsit = node.id("whatsit") +local hlist = node.id("hlist") + +local find_node_tail = node.tail or node.slide + +local chardata = characters.data + function nodes.leftskip(n) while n do local id = n.id @@ -28,7 +39,7 @@ end function nodes.rightskip(n) if n then - n = slide_nodes(n) + n = find_node_tail(n) while n do local id = n.id if id == glue then diff --git a/tex/context/base/pack-bar.mkiv b/tex/context/base/pack-bar.mkiv new file mode 100644 index 000000000..05afd32d0 --- /dev/null +++ b/tex/context/base/pack-bar.mkiv @@ -0,0 +1,67 @@ +%D \module +%D [ file=pack-bar, +%D version=2009.06.26, +%D title=\CONTEXT\ Packaging Macros, +%D subtitle=Bars, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Packaging Macros / Bars} + +%D This code has been moved from scrn-int to here (was some old +%D experimental code). It could be in scrn-bar but it's static. + +\unprotect + +%D \startbuffer +%D \dorecurse{10} +%D {\horizontalpositionbar +%D \pos\recurselevel \min1 \max10 +%D \token\framed{\recurselevel}% +%D \\} +%D +%D \hbox to 15em +%D {\hss +%D \dorecurse{10} +%D {\verticalpositionbar\pos\recurselevel\min1\max10\token\blackrule\\ +%D \hss}} +%D \stopbuffer + +\def\horizontalpositionbar\pos#1\min#2\max#3\token#4\\% + {\hbox to \hsize + {\hskip\zeropoint\!!plus #1\!!fill + \hskip\zeropoint\!!plus-#2\!!fill + #4\relax + \hskip\zeropoint\!!plus #3\!!fill + \hskip\zeropoint\!!plus-#1\!!fill}} + +\def\verticalpositionbar\pos#1\min#2\max#3\token#4\\% + {\vbox to \vsize + {\vskip\zeropoint\!!plus #1\!!fill + \vskip\zeropoint\!!plus-#2\!!fill + \hbox{#4}\relax + \vskip\zeropoint\!!plus #3\!!fill + \vskip\zeropoint\!!plus-#1\!!fill}} + +\def\horizontalgrowingbar\pos#1\min#2\max#3\height#4\depth#5\\% + {\hbox to \hsize + {\scratchcounter\numexpr#1-#2+\plusone\relax + \leaders\vrule\hskip\zeropoint\!!plus \scratchcounter\!!fill + \vrule\!!width\zeropoint\!!height#4\!!depth#5% + \hskip\zeropoint\!!plus #3\!!fill + \hskip\zeropoint\!!plus-#1\!!fill}} + +\def\verticalgrowingbar\pos#1\min#2\max#3\width#4\\% + {\vbox to \vsize + {\scratchcounter\numexpr#1-#2+\plusone\relax + \leaders\hrule\vskip\zeropoint\!!plus\scratchcounter\!!fill + \hrule\!!width#4\!!height\zeropoint\!!depth\zeropoint + \vskip\zeropoint\!!plus #3\!!fill + \vskip\zeropoint\!!plus-#1\!!fill}} + +\protect \endinput diff --git a/tex/context/base/pack-box.mkiv b/tex/context/base/pack-box.mkiv index 1be840552..a12ab0263 100644 --- a/tex/context/base/pack-box.mkiv +++ b/tex/context/base/pack-box.mkiv @@ -60,10 +60,10 @@ {\dosingleargument\doanchor} \def\doanchor[#1]% - {\ifundefined{\??an#1}\@EA\dodoanchor\else\@EA\nonoanchor\fi[#1]} + {\ifcsname\??an#1\endcsname\@EA\nonoanchor\else\@EA\dodoanchor\fi[#1]} \def\nonoanchor[#1]% - {\getvalue{\??an#1}} + {} \def\dodoanchor[#1]% {\dotripleempty\dododoanchor[#1]} @@ -127,7 +127,7 @@ {\dodoubleargument\dodefinecollector} \def\dodefinecollector[#1][#2]% - {\ifundefined{\@@collectorbox#1}% + {\ifcsname\@@collectorbox#1\endcsname \else \expandafter\newbox\csname\@@collectorbox#1\endcsname \fi \resetcollector[#1]% @@ -154,10 +154,10 @@ \forgetall \dontcomplain \dowithnextbox - {\ifundefined{\@@collectorbox#1}% - \writestatus{collector}{unknown layer #1}% - \else + {\ifcsname\@@collectorbox#1\endcsname \dodosetcollector[#1][#2]% + \else + \writestatus{collector}{unknown layer #1}% \fi \egroup} \hbox} @@ -188,12 +188,12 @@ \ifdim\@@layerysiz>\zeropoint \advance\@@layerypos.5\@@layerysiz \fi}% - {\ExpandBothAfter\doifinset\v!bottom{\collectorparameter\c!corner} + {\normalexpanded{\noexpand\doifinset{\v!bottom}{\collectorparameter\c!corner}} {\ifdim\@@layerysiz>\zeropoint \advance\@@layerypos-\@@layerysiz \@@layerypos-\@@layerypos \fi}% - \ExpandBothAfter\doifinset\v!right{\collectorparameter\c!corner} + \normalexpanded{\noexpand\doifinset{\v!right}{\collectorparameter\c!corner}} {\ifdim\@@layerxsiz>\zeropoint \advance\@@layerxpos-\@@layerxsiz \@@layerxpos-\@@layerxpos @@ -238,9 +238,7 @@ \fi} \def\flushcollector[#1]% - {\ifundefined{\@@collectorbox#1}% - \writestatus{collector}{unknown collector #1}% - \else + {\ifcsname\@@collectorbox#1\endcsname \doifnotvalue{\??cb#1\c!state}\v!stop {\vbox {\hbox @@ -248,12 +246,14 @@ {\let\next\copy}{\let\next\box}% \raise\dp\csname\@@collectorbox#1\endcsname \next\csname\@@collectorbox#1\endcsname}}}% + \else + \writestatus{collector}{unknown collector #1}% \fi} \def\composedcollector#1{\flushcollector[#1]} \def\resetcollector[#1]% - {\ifundefined{\@@collectorbox#1}\else + {\ifcsname\@@collectorbox#1\endcsname \global\setbox\csname\@@collectorbox#1\endcsname\emptybox \fi} @@ -264,8 +264,7 @@ {\bgroup \def\currentcollector{#1}% \mathchardef\collectorbox\csname\@@collectorbox#1\endcsname - \getparameters - [\??cb#1][\c!voffset=\zeropoint,\c!hoffset=\zeropoint,#2]% + \getparameters[\??cb#1][\c!voffset=\zeropoint,\c!hoffset=\zeropoint,#2]% \scratchdimen\wd\collectorbox \advance\scratchdimen\collectorparameter\c!hoffset \global\wd\collectorbox\scratchdimen @@ -574,13 +573,9 @@ \hbox\framed[#3]} \def\dosetlayerframedS[#1][#2][#3]% - {\dowithnextbox - {\setlayer - [#1] - [\c!width=\nextboxwd,\c!height=\nextboxht, - \c!offset=\!!zeropoint,#2] - {\flushnextbox}}% - \hbox\framed[\c!location=\v!normal,#2]} + {\dowithnextbox % we could use a local setlayer command (no doif..empty) which also saves a nextbox + {\setlayer[#1][\c!width=\nextboxwd,\c!height=\nextboxht,\c!offset=\!!zeropoint,#2]{\flushnextbox}}% + \hbox\framed[\c!location=\v!normal,#2]} \def\setlayertext {\dotripleempty\dosetlayertext} diff --git a/tex/context/base/pack-lyr.mkiv b/tex/context/base/pack-lyr.mkiv index 768b1e0c9..5bb89fccf 100644 --- a/tex/context/base/pack-lyr.mkiv +++ b/tex/context/base/pack-lyr.mkiv @@ -13,8 +13,6 @@ \writestatus{loading}{ConTeXt Packaging Macros / Layers} -%D This module is now etex dependent. - % todo : first / last / next / +... => page key % test on left/right box when no doublesided option given % use \ifcsname instead of doifvalue @@ -36,8 +34,6 @@ %D will go in. This means that we can move an overlay from one %D background to the other using the dimensions of the parent. -%D ! ! ! ! to be documented ! ! ! ! - \ifx\undefined\defineoverlay \message{loaded to early} \wait \fi \def\defineoverlay @@ -45,7 +41,7 @@ \def\dodefineoverlay[#1][#2][#3]% overlay [layer] content {\ifthirdargument - \writestatus{BEWARE}{This (overlay definition) has changed!}% temp + %\writestatus{BEWARE}{This (overlay definition) has changed!}% temp \def\docommand##1{\setvalue{\??ov##1}{\setlayer[#2]{\executedefinedoverlay{##1}{#3}}}} \else \def\docommand##1{\setvalue{\??ov##1}{\executedefinedoverlay{##1}{#2}}}% @@ -95,10 +91,10 @@ \defineoverlay[#1][\composedlayer{#1}]} \def\dopresetlayerbox#1% - {\ifundefined{\@@layerbox#1}% - \expandafter\newbox\csname\@@layerbox#1\endcsname - \else + {\ifcsname\@@layerbox#1\endcsname \resetlayer[#1]% + \else + \expandafter\newbox\csname\@@layerbox#1\endcsname \fi} %D \macros @@ -155,36 +151,35 @@ \def\dodosetlayer[#1][#2][#3]% #2 = links/rechts {\bgroup - \recalculatebackgrounds - \recalculatelogos + \recalculatebackgrounds % brrr \global\advance\currentlayerdata\plusone \forgetall \dontcomplain \doifvalue{\??ll#1\c!option}\v!test\tracelayerstrue \iftracelayers\traceboxplacementtrue\fi - \dowithnextbox % sneller als aparte macro - {\ifcsname\@@layerbox#1\endcsname % nb: odd/even discard, left/right not - \edef\@@layerloc{#2}% - \ifx\@@layerloc\v!even - \ifodd\realpageno - % discard nextbox - \else - \dododosetlayer[#1][\v!left][#3]% - \fi - \else\ifx\@@layerloc\v!odd - \ifodd\realpageno - \dododosetlayer[#1][\v!right][#3]% - %\else - % discard nextbox - \fi - \else - \dododosetlayer[#1][#2][#3]% - \fi\fi - \else - \writestatus{layer}{unknown layer #1}% - \fi - \egroup}% - \hbox} + \dowithnextbox{\dodosetlayerindeed{#1}{#2}{#3}\egroup}\hbox} + +\def\dodosetlayerindeed#1#2#3% #2 = links/rechts + {\ifcsname\@@layerbox#1\endcsname % nb: odd/even discard, left/right not + \edef\@@layerloc{#2}% + \ifx\@@layerloc\v!even + \ifodd\realpageno + % discard nextbox + \else + \dododosetlayer[#1][\v!left][#3]% + \fi + \else\ifx\@@layerloc\v!odd + \ifodd\realpageno + \dododosetlayer[#1][\v!right][#3]% + %\else + % discard nextbox + \fi + \else + \dododosetlayer[#1][#2][#3]% + \fi\fi + \else + \writestatus{layer}{unknown layer #1}% + \fi} \newbox\layerbox @@ -219,7 +214,7 @@ \def\dodefinelayerpreset[#1][#2]% {\doifassignmentelse{#2} {\setvalue{\??ll\??ll#1}{\dopresetlayer{#2}}} - {\setvalue{\??ll\??ll#1}{\getvalue{\??ll\??ll#2}}}} + {\setvalue{\??ll\??ll#1}{\csname\??ll\??ll#2\endcsname}}} \def\dopresetlayer#1#2#3% #1=list #2=tag #3=list {\getparameters[\??ll#2][#1,#3]} @@ -242,34 +237,24 @@ \layerheight\@@layerysiz % preroll \getparameters[\??ll\currentlayer][#3]% - % presets and real roll -% maybe todo: -% \doif{\layerparameter\c!method}\v!fit -% {\@@layerxsiz\thelayerwidth \currentlayer -% \@@layerysiz\thelayerheight\currentlayer -% \layerwidth \@@layerxsiz -% \layerheight\@@layerysiz -% }% - % etc - \executeifdefined{\??ll\??ll\layerparameter\c!preset}\gobbletwoarguments\currentlayer{#3}% - % that was real slow + % + % \executeifdefined{\??ll\??ll\layerparameter\c!preset}\gobbletwoarguments\currentlayer{#3}% + % + \edef\@@currentlayerpreset{\layerparameter\c!preset}% + \ifcsname\??ll\??ll\@@currentlayerpreset\endcsname\csname\??ll\??ll\@@currentlayerpreset\endcsname\currentlayer{#3}\fi + % \doif{\layerparameter\c!position}\v!overlay % slow, use \dosetvalue instead {\getparameters[\??ll\currentlayer][\c!width=\zeropoint,\c!height=\zeropoint,\c!position=\v!yes]}% - \doifsomething{\layerparameter\c!rotation} - {\setbox\nextbox\hbox - {\rotate % to be checked with new rotation - [\c!location=\v!high,\c!rotation=\layerparameter\c!rotation] - {\flushnextbox}}}% + \doifsomething{\layerparameter\c!rotation}% todo: use direct lowlevel call + {\setbox\nextbox\hbox{\rotate[\c!location=\v!high,\c!rotation=\layerparameter\c!rotation]{\flushnextbox}}}% % no, not local % \@@layerxsiz\layerparameter\c!width % \@@layerysiz\layerparameter\c!height % never change that \@@layerxpos\layerparameter\c!x \@@layerypos\layerparameter\c!y - \doifelse{\layerparameter\c!hoffset}\v!max - {\@@layerxoff\@@layerxsiz}{\@@layerxoff\layerparameter\c!hoffset}% - \doifelse{\layerparameter\c!voffset}\v!max - {\@@layeryoff\@@layerysiz}{\@@layeryoff\layerparameter\c!voffset}% + \doifelse{\layerparameter\c!hoffset}\v!max{\@@layerxoff\@@layerxsiz}{\@@layerxoff\layerparameter\c!hoffset}% + \doifelse{\layerparameter\c!voffset}\v!max{\@@layeryoff\@@layerysiz}{\@@layeryoff\layerparameter\c!voffset}% % dx/dy are internal context ones and can be used in preset \advance\@@layerxoff\dimexpr\layerparameter\c!offset+\layerparameter\c!dx\relax \advance\@@layeryoff\dimexpr\layerparameter\c!offset+\layerparameter\c!dy\relax @@ -277,47 +262,30 @@ \@@layerypos\layerparameter\c!sy\@@layerypos \@@layerxoff\layerparameter\c!sx\@@layerxoff \@@layeryoff\layerparameter\c!sy\@@layeryoff - \doifelse{\layerparameter\c!position}\v!yes % combine ^ - {\setlastlayerpos{#2\currentlayer}% todo l/r %%%%%%%%%%%% - \@@layerxpos\lastlayerxpos - \@@layerypos\lastlayerypos - \letgvalue{\??ll\currentlayer\layerpage\c!position}\v!yes - \letgvalue{\??ll\currentlayer\c!state}\v!start % needed ? - \setbox\layerbox\vbox to \@@layerysiz - {\hbox to \@@layerxsiz{\xypos{lyr:\the\currentlayerdata}\hss}\vss}} - {\setbox\layerbox\emptybox - \globallet\lastlayerxpos\!!zeropoint - \globallet\lastlayerypos\!!zeropoint - \ExpandBothAfter\doifinset\v!bottom{\layerparameter\c!corner} - {\ifnum\layerparameter\c!line=\zerocount\else % can be < 0 - \setevalue{\??ll\currentlayer\c!line}% - {\the\numexpr-\layerparameter\c!line+\layoutlines+\plusone\relax}% - \fi - \ifdim\@@layerysiz>\zeropoint - \advance\@@layerypos-\@@layerysiz - \@@layerypos-\@@layerypos - \@@layeryoff-\@@layeryoff - \fi}% - \ExpandBothAfter\doifinset\v!right{\layerparameter\c!corner} - {\ifnum\layerparameter\c!column=\zerocount\else % can be < 0 - \setevalue{\??ll\currentlayer\c!column}% - {\the\numexpr-\layerparameter\c!column+\layoutcolumns+\plusone\relax}% - \fi - \ifdim\@@layerxsiz>\zeropoint - \advance\@@layerxpos-\@@layerxsiz - \@@layerxpos-\@@layerxpos - \@@layerxoff-\@@layerxoff - \fi}% - \ExpandBothAfter\doif\v!middle{\layerparameter\c!corner} - {\ifdim\@@layerxsiz>\zeropoint \advance\@@layerxpos.5\@@layerxsiz \fi - \ifdim\@@layerysiz>\zeropoint \advance\@@layerypos.5\@@layerysiz \fi}% - \edef\layerpage{\layerparameter\c!page}}% - \doifsomething\layerpage - {\edef\layerpage{:\layerpage}% - \doifundefined{\@@layerbox#2\currentlayer\layerpage} - {\global\expandafter\newbox\csname\@@layerbox#2\currentlayer\layerpage\endcsname}}% - \dontcomplain % more comfortable - \mathchardef\layerpagebox\csname\@@layerbox#2\currentlayer\layerpage\endcsname + \edef\@@currentlayerposition{\layerparameter\c!position}% + \ifx\@@currentlayerposition\v!yes % combine ^ + \setlastlayerpos{#2\currentlayer}% sets \layerpage; todo l/r %%%%%%%%%%%% + \@@layerxpos\lastlayerxpos + \@@layerypos\lastlayerypos + \letgvalue{\??ll\currentlayer\layerpage\c!position}\v!yes + \letgvalue{\??ll\currentlayer\c!state}\v!start % needed ? + \setbox\layerbox\vbox to \@@layerysiz{\hbox to \@@layerxsiz{\xypos{lyr:\the\currentlayerdata}\hss}\vss}% + \else + \setbox\layerbox\emptybox + \globallet\lastlayerxpos\!!zeropoint + \globallet\lastlayerypos\!!zeropoint + \normalexpanded{\noexpand\doifinset{\v!bottom}{\layerparameter\c!corner}}\dosetlayerbottompositions + \normalexpanded{\noexpand\doifinset{\v!right }{\layerparameter\c!corner}}\dosetlayerrightpositions + \normalexpanded{\noexpand\doifinset{\v!middle}{\layerparameter\c!corner}}\dosetlayermiddlepositions + \edef\layerpage{\layerparameter\c!page}% + \fi + \ifx\layerpage\empty \else % is expanded + \edef\layerpage{:\layerpage}% + \ifcsname\@@layerbox#2\currentlayer\layerpage\endcsname \else + \expandafter\newbox\csname\@@layerbox#2\currentlayer\layerpage\endcsname + \fi + \fi + \chardef\layerpagebox\csname\@@layerbox#2\currentlayer\layerpage\endcsname \ifvoid\layerpagebox \gsetboxllx\layerpagebox\zeropoint \gsetboxlly\layerpagebox\zeropoint @@ -368,8 +336,7 @@ \advance\scratchdimen\nextboxwd \nextboxwd\ifdim\scratchdimen>\lastlayerwidth \scratchdimen \else \lastlayerwidth \fi \fi - \scratchdimen\@@layerypos - \advance\scratchdimen\@@layeryoff + \scratchdimen\dimexpr\@@layerypos+\@@layeryoff\relax \ifdim\scratchdimen<\getboxlly\layerpagebox \gsetboxlly\layerpagebox\scratchdimen \fi @@ -398,6 +365,30 @@ % to be placed; never change this ! \ifvoid\layerbox\else\box\layerbox\fi} +\def\dosetlayerbottompositions + {\ifnum\layerparameter\c!line=\zerocount\else % can be < 0 + \setevalue{\??ll\currentlayer\c!line}{\the\numexpr-\layerparameter\c!line+\layoutlines+\plusone\relax}% + \fi + \ifdim\@@layerysiz>\zeropoint + \advance\@@layerypos-\@@layerysiz + \@@layerypos-\@@layerypos + \@@layeryoff-\@@layeryoff + \fi} + +\def\dosetlayerrightpositions + {\ifnum\layerparameter\c!column=\zerocount\else % can be < 0 + \setevalue{\??ll\currentlayer\c!column}{\the\numexpr-\layerparameter\c!column+\layoutcolumns+\plusone\relax}% + \fi + \ifdim\@@layerxsiz>\zeropoint + \advance\@@layerxpos-\@@layerxsiz + \@@layerxpos-\@@layerxpos + \@@layerxoff-\@@layerxoff + \fi} + +\def\dosetlayermiddlepositions + {\ifdim\@@layerxsiz>\zeropoint \advance\@@layerxpos.5\@@layerxsiz \fi + \ifdim\@@layerysiz>\zeropoint \advance\@@layerypos.5\@@layerysiz \fi} + %D Given the task to be accomplished, the previous macro is %D not even that complicated. It mainly comes down to skipping %D to the right place and placing a box on top of or below the @@ -406,16 +397,17 @@ %D \macros %D {doifelselayerdata} -%D \def\doifelselayerdata#1% - {\ifundefined{\@@layerbox#1}% - \@EA\secondoftwoarguments - \else\ifvoid\csname\@@layerbox#1\endcsname - \@EAEAEA\secondoftwoarguments + {\ifcsname\@@layerbox#1\endcsname + \ifvoid\csname\@@layerbox#1\endcsname + \@EAEAEA\secondoftwoarguments + \else + \@EAEAEA\firstoftwoarguments + \fi \else - \@EAEAEA\firstoftwoarguments - \fi\fi} + \@EA\secondoftwoarguments + \fi} %D \macros %D {flushlayer} @@ -427,95 +419,127 @@ % todo: setups before flush, handy hook -\unexpanded\def\flushlayer[#1]% - {\doifelsevalue{\??ll#1\c!state}\v!next - {\global\letvalue{\??ll#1\c!state}\v!start} % dangerous, stack-built-up - {\doifelsevalue{\??ll#1\c!state}\v!continue - {\global\letvalue{\??ll#1\c!state}\v!repeat} % dangerous, stack-built-up - {\doifelsevalue{\??ll#1\c!doublesided}\v!yes - {\doifundefinedelse{\@@layerbox#1}% - {\dodoflushlayerA[#1]} - {\doifbothsidesoverruled - {\dodoflushlayerB\v!left [#1]}% left - {\dodoflushlayerB\v!right[#1]}% right - {\dodoflushlayerB\v!left [#1]}}}% left - {\dodoflushlayerA[#1]}}}} - -\def\dodoflushlayerA[#1]% - {\doifnotvalue{\??ll#1\c!state}\v!stop - {\startoverlay - {\dodoflushlayer1{#1}{#1}} - {\dodoflushlayer0{#1}{#1:\realfolio}} - \stopoverlay}} - -\def\dodoflushlayerB#1[#2]% - {\doifnotvalue{\??ll#2\c!state}\v!stop - {\startoverlay - {\dodoflushlayer1{#2}{#2}} - {\dodoflushlayer0{#2}{#2:\realfolio}} - {\dodoflushlayer1{#2}{#1#2}} - {\dodoflushlayer0{#2}{#1#2:\realfolio}} - \stopoverlay}} - -\def\dodoflushlayer#1#2#3% - {\ifundefined{\@@layerbox#3}% - \ifcase#1\else\writestatus{layer}{unknown layer #3}\fi +% \unexpanded\def\flushlayer[#1]% +% {\doifelsevalue{\??ll#1\c!state}\v!next +% {\global\letvalue{\??ll#1\c!state}\v!start} % dangerous, stack-built-up +% {\doifelsevalue{\??ll#1\c!state}\v!continue +% {\global\letvalue{\??ll#1\c!state}\v!repeat} % dangerous, stack-built-up +% {\doifelsevalue{\??ll#1\c!doublesided}\v!yes +% {\doifundefinedelse{\@@layerbox#1}% +% {\dodoflushlayerA[#1]} +% {\doifbothsidesoverruled +% {\dodoflushlayerB\v!left [#1]}% left +% {\dodoflushlayerB\v!right[#1]}% right +% {\dodoflushlayerB\v!left [#1]}}}% left +% {\dodoflushlayerA[#1]}}}} + +\unexpanded\def\flushlayer[#1]% quite core, so optimized + {\begingroup + \forgetall + \edef\currentlayer{#1}% + \edef\@@currentlayerstate{\csname\??ll\currentlayer\c!state\endcsname}% + \ifx\@@currentlayerstate\v!stop + % nothing + \else\ifx\@@currentlayerstate\v!next + \global\expandafter\let\csname\??ll\currentlayer\c!state\endcsname\v!start % dangerous, stack-built-up + \else\ifx\@@currentlayerstate\v!continue + \global\expandafter\let\csname\??ll\currentlayer\c!state\endcsname\v!repeat % dangerous, stack-built-up \else - \bgroup - \forgetall - \offinterlineskip - % needed because we need to handle method - \executeifdefined{\??ll\??ll\getvalue{\??ll#2\c!preset}}\gobbletwoarguments{#2}{}% - % - \doifvalue{\??ll#2\c!option}\v!test\tracelayerstrue - \iftracelayers\traceboxplacementtrue\fi - \!!doneafalse - \!!donebfalse - \doifvalue{\??ll#2\c!method}\v!overlay\!!doneatrue - \doifvalue{\??ll#2\c!method}\v!fit\!!donebtrue - \!!donectrue - \ifcase#1\else - \doifnotvalue{\??ll#2\c!position}\v!yes - {\doifvalue{\??ll#2\c!repeat}\v!yes\!!donecfalse - \doifvalue{\??ll#2\c!state}\v!repeat\!!donecfalse}% - \fi - \mathchardef\layerbox\csname\@@layerbox#3\endcsname - % we need to copy in order to retain the negative offsets for a next - % stage of additions, i.e. llx/lly accumulate in repeat mode and the - % compensation may differ each flush depending on added content - \setbox\nextbox \if!!doneb -% \vbox -% {\scratchdimen\getboxlly\layerbox -% \vskip-\scratchdimen -% \scratchdimen\getboxllx\layerbox -% \hskip-\scratchdimen -% \advance\scratchdimen-\wd\layerbox -% \hsize-\scratchdimen -% \if!!donec\box\else\copy\fi\layerbox}% - \vbox - {\vskip-\getboxlly\layerbox - \hskip-\getboxllx\layerbox - \hsize-\dimexpr\getboxllx\layerbox-\wd\layerbox\relax - \if!!donec\box\else\copy\fi\layerbox}% + \edef\@@currentlayerdoublesided{\csname\??ll\currentlayer\c!doublesided\endcsname}% + \ifx\@@currentlayerdoublesided\v!yes + \ifcsname\@@layerbox#1\endcsname + % we can make a dedicated one for this + \doifbothsidesoverruled{\dodoflushlayerB\v!left}{\dodoflushlayerB\v!right}{\dodoflushlayerB\v!left}% + \else + \dodoflushlayerA + \fi \else - \if!!donec\box\else\copy\fi\layerbox % sorry for the delay due to copying + \dodoflushlayerA \fi - % todo: method=offset => overlayoffset right/down (handy for backgrounds with offset) - \iftracelayers \ruledvbox \else \vbox \fi \if!!donea to \overlayheight \fi - {\hbox \if!!donea to \overlaywidth \fi - {% klopt dit? #3 en niet #2 ? - \doifvalue{\??ll#3\realfolio\c!position}\v!yes{\xypos{lyr:#3:\realfolio}}% - \doifoverlayelse{#3} - {\box\nextbox} - {\startlayoutcomponent{l:#3}{layer #3}\box\nextbox\stoplayoutcomponent}% - \hss}% - \vss}% - \if!!donec - \gsetboxllx\layerbox\zeropoint - \gsetboxlly\layerbox\zeropoint + \fi\fi\fi + \endgroup} + +% \ifcase#1\else\writestatus{layer}{unknown layer #3}\fi + +\def\dodoflushlayerA + {\startoverlay + {\ifcsname\@@layerbox\currentlayer \endcsname\dodoflushlayer\plusone \currentlayer \fi}% + {\ifcsname\@@layerbox\currentlayer:\realfolio\endcsname\dodoflushlayer\zerocount{\currentlayer:\realfolio}\fi}% + \stopoverlay} + +\def\dodoflushlayerB#1% + {\startoverlay + {\ifcsname\@@layerbox \currentlayer \endcsname\dodoflushlayer\plusone \currentlayer \fi}% + {\ifcsname\@@layerbox \currentlayer:\realfolio\endcsname\dodoflushlayer\zerocount {\currentlayer:\realfolio}\fi}% + {\ifcsname\@@layerbox#1\currentlayer \endcsname\dodoflushlayer\plusone {#1\currentlayer }\fi}% + {\ifcsname\@@layerbox#1\currentlayer:\realfolio\endcsname\dodoflushlayer\zerocount{#1\currentlayer:\realfolio}\fi}% + \stopoverlay} + +\def\dodoflushlayer#1#2% quite core, so optimized + {\begingroup % already grouped + \offinterlineskip + \edef\@@currentlayermethod{\csname\??ll\currentlayer\c!method\endcsname}% + \edef\@@currentlayeroption{\csname\??ll\currentlayer\c!option\endcsname}% + % needed because we need to handle method but we should find a way to + % speed this up + \edef\@@currentlayerpreset{\csname\??ll\currentlayer\c!preset\endcsname}% + \ifcsname\??ll\??ll\@@currentlayerpreset\endcsname\csname\??ll\??ll\@@currentlayerpreset\endcsname\currentlayer{}\fi + % + \ifx\@@currentlayeroption\v!test + \tracelayerstrue + \fi + \iftracelayers + \traceboxplacementtrue + \fi + \!!doneafalse + \!!donebfalse + \ifx\@@currentlayermethod\v!overlay\!!doneatrue\fi + \ifx\@@currentlayermethod\v!fit \!!donebtrue\fi + \!!donectrue + \ifcase#1\else + \edef\@@currentlayerposition{\csname\??ll\currentlayer\c!position\endcsname}% + \ifx\@@currentlayerposition\v!yes + \edef\@@currentlayerrepeat{\csname\??ll\currentlayer\c!repeat\endcsname}% + % \edef\@@currentlayerstate {\csname\??ll\currentlayer\c!state\endcsname}% actually this is already set + \ifx\@@currentlayerrepeat\v!yes + \!!donecfalse + \else\ifx\@@currentlayerstate\v!repeat + \!!donecfalse + \fi\fi \fi - \egroup - \fi} + \fi + \chardef\layerbox\csname\@@layerbox#2\endcsname % mathchardef no longer needed can be chardef or just let +% \chardef\layerbox\csname\@@layerbox\currentlayer\endcsname % mathchardef no longer needed can be chardef or just let + % we need to copy in order to retain the negative offsets for a next + % stage of additions, i.e. llx/lly accumulate in repeat mode and the + % compensation may differ each flush depending on added content + \setbox\nextbox + \if!!doneb + \therepositionededlayerbox + \else + \if!!donec\box\else\copy\fi\layerbox % sorry for the delay due to copying + \fi + % todo: method=offset => overlayoffset right/down (handy for backgrounds with offset) + \doifoverlayelse{#2}{\setlayoutcomponentattribute\v!layer{#2}}\resetlayoutcomponentattribute + \iftracelayers \ruledvbox \else \vbox \fi \if!!donea to \overlayheight \fi \layoutcomponentboxattribute + {\hbox \if!!donea to \overlaywidth \fi + {\edef\@@currentlayerpageposition{\csname\??ll#2\realfolio\c!position\endcsname}% + \ifx\@@currentlayerpageposition\v!yes\xypos{lyr:#2:\realfolio}\fi + \box\nextbox + \hss}% + \vss}% + \if!!donec + \gsetboxllx\layerbox\zeropoint + \gsetboxlly\layerbox\zeropoint + \fi + \endgroup} + +\def\therepositionededlayerbox % assumes that \if!!donec is set (todo: use dedicated flags) + {\vbox + {\vskip-\getboxlly\layerbox + \hskip-\getboxllx\layerbox + \hsize-\dimexpr\getboxllx\layerbox-\wd\layerbox\relax + \if!!donec\box\else\copy\fi\layerbox}} % \definelayer[test][method=fit] \setupcolors[state=start] \tracelayerstrue % @@ -550,7 +574,7 @@ %D needed as well). \def\doresetlayer#1% - {\ifundefined{\@@layerbox#1}\else + {\ifcsname\@@layerbox#1\endcsname \global\setbox\csname\@@layerbox#1\endcsname\emptybox \fi} @@ -599,8 +623,7 @@ \def\MPlayerheight{\vsize} \def\dosetMPlayer[#1][#2][#3]% - {\checkpositions % new, else only support after \starttext - \edef\MPlayerwidth {\MPw{#2}}% + {\edef\MPlayerwidth {\MPw{#2}}% \edef\MPlayerheight{\MPh{#2}}% \setlayer[#1][\c!x=\MPx{#2},\c!y=\MPy{#2},\c!position=\v!no,#3]} @@ -613,12 +636,12 @@ \c!frame=\v!off, \c!offset=\v!overlay,#2]} -% Some day this (old) mechanism will be combined/integrated -% in overlays +% The next mechanism is obsolete and will be removed in \MKIV\ (or move to +% the compatibility module. -\newskip\xposition \newskip\yposition -\newskip\xdimension \newskip\ydimension -\newskip\xoffset \newskip\yoffset +% \newskip\xposition \newskip\yposition +% \newskip\xdimension \newskip\ydimension +% \newskip\xoffset \newskip\yoffset % already defined \newbox\positionbox diff --git a/tex/context/base/pack-obj.lua b/tex/context/base/pack-obj.lua index 3256b3702..ce1c520ce 100644 --- a/tex/context/base/pack-obj.lua +++ b/tex/context/base/pack-obj.lua @@ -11,7 +11,7 @@ if not modules then modules = { } end modules ['pack-obj'] = { reusable components.

--ldx]]-- -local texsprint = tex.sprint +local texsprint, texcount = tex.sprint, tex.count jobobjects = jobobjects or { } jobobjects.collected = jobobjects.collected or { } diff --git a/tex/context/base/pack-obj.mkiv b/tex/context/base/pack-obj.mkiv index 6c1e54758..562b15e94 100644 --- a/tex/context/base/pack-obj.mkiv +++ b/tex/context/base/pack-obj.mkiv @@ -19,6 +19,170 @@ \registerctxluafile{pack-obj}{1.001} +% \startluacode +% local texbox, texdimen, texcount, texwrite = tex.box, tex.dimen, tex.count, tex.write +% local pdfxform, pdfrefxform = pdf.xform, pdf.refxform +% +% function pdf.xform (l) texbox["objectbox"] = nil return l end +% function pdf.refxform(l) return node.copy_list(l) end +% +% backends.codeinjections.register = pdf.xform +% backends.codeinjections.restore = pdf.refxform +% +% local codeinjections = backends.codeinjections +% +% objects = objects or { } +% +% local data = { } +% +% objects.data = data +% objects.n = 0 +% +% function objects.register(name) +% objects.n = objects.n + 1 +% local list = texbox.objectbox +% nodes.process_page(list) +% data[name] = { +% codeinjections.restore(list), +% texdimen.objectwd, +% texdimen.objectht, +% texdimen.objectdp, +% texdimen.objectoff, +% } +% end +% +% function objects.restore(name) +% local d = data[name] +% if d then +% texbox .objectbox = codeinjections.restore(d[1]) +% texdimen.objectwd = d[2] +% texdimen.objectht = d[3] +% texdimen.objectdp = d[4] +% texdimen.objectoff = d[5] +% else +% texbox .objectbox = nil +% texdimen.objectwd = 0 +% texdimen.objectht = 0 +% texdimen.objectdp = 0 +% texdimen.objectoff = 0 +% end +% end +% +% function objects.reference(name) +% local d = data[name] +% texwrite((d and d[1]) or 0) +% end +% +% function objects.enhance(name) +% local d = data[name] +% if d then +% d[6] = texcount.realpageno +% end +% end +% +% function objects.page(name) +% local d = data[name] +% texwrite((d and d[6]) or texcount.realpageno) +% end +% +% function objects.doifelse(name) +% commands.testcase(data[name]) +% end +% \stopluacode +% +% \newbox \objectbox +% \newtoks \everyobject +% \newif \ifinobject +% +% \newdimen\objectoff \def\objectmargin{\the\objectoff} +% \newdimen\objectwd \def\objectwidth {\the\objectwd } +% \newdimen\objectht \def\objectheight{\the\objectht } +% \newdimen\objectdp \def\objectdepth {\the\objectdp } +% +% \def\objectoffset{1cm} +% +% \everyobject{\the\everyPDFxform} +% +% \let\doresetobjects\relax +% +% \def\setobject #1#2{\begingroup\objectoff\objectoffset\inobjecttrue\the\everyobject\dowithnextbox{\dosetobject{#1}{#2}}} +% \def\settightobject#1#2{\begingroup\objectoff\zeropoint \inobjecttrue\the\everyobject\dowithnextbox{\dosetobject{#1}{#2}}} +% +% \let\objectsetvbox\vbox %\def\objectsetvbox{\ruledvbox} +% \let\objectgetvbox\vbox %\def\objectgetvbox{\ruledvbox} +% \let\objectsethbox\hbox %\def\objectsethbox{\ruledhbox} +% \let\objectgethbox\hbox %\def\objectgethbox{\ruledhbox} +% +% \def\dosetobject#1#2% +% {\objectwd\wd\nextbox +% \objectht\ht\nextbox +% \objectdp\dp\nextbox +% \ifdim\objectoff=\zeropoint\relax +% \setbox\objectbox\box\nextbox +% \else +% \setbox\objectbox\objectsetvbox spread 2\objectoff{\vss\objectsethbox spread 2\objectoff{\hss\flushnextbox\hss}\vss}% +% \fi +% \ctxlua{objects.register("#1::#2")}% +% \endgroup} +% +% \def\getobject#1#2% +% {\begingroup +% \ctxlua{objects.restore("#1::#2")}% +% \ifdim\objectoff=\zeropoint\relax \else +% \setbox\objectbox\objectgetvbox to \dimexpr\objectht+\objectdp\relax +% {\vss\objectgethbox to \objectwd{\hss\box\objectbox\hss}\vss}% +% \wd\objectbox\objectwd +% \ht\objectbox\objectht +% \dp\objectbox\objectdp +% \fi +% \box\objectbox +% \endgroup} +% +% \def\getpageobject#1#2% +% {\begingroup +% \ctxlua{objects.restore("#1::#2")}% +% \ifdim\objectoff=\zeropoint\relax +% \setbox\objectbox\objectgethbox{\ctxlatelua{objects.enhance("#1::#2")}\box\objectbox} +% \else +% \setbox\objectbox\objectgetvbox to \dimexpr\objectht+\objectdp\relax +% {\vss\objectgethbox to \objectwd{\ctxlatelua{objects.enhance("#1::#2")}\hss\box\objectbox\hss}\vss}% +% \wd\objectbox\objectwd +% \ht\objectbox\objectht +% \dp\objectbox\objectdp +% \fi +% \box\objectbox +% \endgroup} +% +% \def\setobjectdirectly #1#2{\ctxlua{objects.register("#1::#2")}} +% \def\getobjectdirectly #1#2{\ctxlua{objects.restore ("#1::#2")}} +% \def\getobjectdimensions #1#2{\ctxlua{objects.restore ("#1::#2")}} +% \def\doifobjectfoundelse #1#2{\ctxlua{objects.doifelse("#1::#2")}} +% \def\doifobjectreferencefoundelse#1#2{\ctxlua{objects.doifelse("#1::#2")}} +% +% \let\objectreferenced\relax +% \let\driverreferenced\relax +% +% \def\doregisterobjectreference{\writestatus{objects}{obsolete: register object reference}\gobblethreearguments} +% \def\dooverloadobjectreference{\writestatus{objects}{obsolete: overload object reference}\gobblethreearguments} +% \def\dosetobjectreference {\writestatus{objects}{obsolete: set object reference}\gobblethreearguments} +% \def\dosetdriverreference {\writestatus{objects}{obsolete: set driver reference}\gobblethreearguments} +% +% \def\defaultobjectreference{0} +% \def\defaultobjectpage {\realfolio} +% +% \def\dogetobjectreference #1#2#3{\xdef#3{\ctxlua{objects.reference("#1::#2)}}} +% \def\dogetobjectreferencepage#1#2#3{\xdef#3{\ctxlua{objects.page("#1::#2))}}} +% +% \protect +% +% \starttext +% test \setobject{a}{b}\ruledhbox{xxx}\getobject{a}{b} test +% \vskip3cm +% test \settightobject{a}{b}\ruledhbox{xxx}\getobject{a}{b} test +% test \settightobject{a}{c}\ruledhbox{xxx}\getobject{a}{c} test +% \dorecurse{5000}{test \setobject{a}{b}\ruledhbox{xxx}\getobject{a}{b} test } +% \stoptext + %D \macros %D {setobject,getobject,ifinobject} %D @@ -63,7 +227,7 @@ \fi} \def\dosetobject#1#2#3% \initializepaper this will move to \everyshipout - {\initializepaper + {% \initializepaper \ifcsname\r!object#2::#3\endcsname \expandafter\gobblefivearguments \else % tzt, overload internal referenced objects to save entries @@ -125,7 +289,7 @@ \csname\r!object#1::#2\endcsname} \def\dogetobject#1#2#3#4#5#6#7% don't change this, should work for dvi & pdf - {\initializepaper + {% \initializepaper \forgetall \dontshowcomposition \setbox\scratchbox\vbox diff --git a/tex/context/base/pack-rul.lua b/tex/context/base/pack-rul.lua index 11995bfed..6bbd3c856 100644 --- a/tex/context/base/pack-rul.lua +++ b/tex/context/base/pack-rul.lua @@ -7,36 +7,47 @@ if not modules then modules = { } end modules ['pack-rul'] = { } --[[ldx-- -

An explanation is given in mk.pdf.

+

An explanation is given in the history document mk.

--ldx]]-- +local texdimen, texcount, texbox, texwd = tex.dimen, tex.count, tex.box, tex.wd +local hpack, free, copy, traverse_id = node.hpack, node.free, node.copy_list, node.traverse_id + function commands.doreshapeframedbox(n) local noflines, lastlinelength = 0, 0 - if tex.wd[n] ~= 0 then - local hpack, free, copy = node.hpack, node.free, node.copy_list - local noflines, width, done = 0, 0, false - local list = tex.box[n].list - for h in node.traverse_id('hlist',list) do - done = true - local p = hpack(copy(h.list)) - lastlinelength = p.width - if lastlinelength > width then - width = lastlinelength + if texwd[n] ~= 0 then + local list = texbox[n].list + if list then + local width, done = 0, false + for h in traverse_id('hlist',list) do + local l = h.list + if l then + done = true + local p = hpack(copy(l)) + lastlinelength = p.width + if lastlinelength > width then + width = lastlinelength + end + free(p) + end end - free(p) - end - if done then - if width ~= 0 then - for h in node.traverse_id('hlist',list) do - if h.width ~= width then - h.list = hpack(h.list,width,'exactly') - h.width = width + if done then + if width ~= 0 then + for h in traverse_id('hlist',list) do + local l = h.list + if l then + -- if h.width ~= width then -- else no display math handling (uses shift) + h.list = hpack(l,width,'exactly') + h.shift = 0 -- needed for display math + h.width = width + -- end + end end end + texwd[n] = width end - tex.wd[n] = width end end - tex.dimen["framedlastlength"] = lastlinelength - tex.count["framednoflines"] = noflines + texdimen["framedlastlength"] = lastlinelength + texcount["framednoflines"] = noflines end diff --git a/tex/context/base/pack-rul.mkii b/tex/context/base/pack-rul.mkii index 042e8805d..055094547 100644 --- a/tex/context/base/pack-rul.mkii +++ b/tex/context/base/pack-rul.mkii @@ -2777,6 +2777,19 @@ \setfalse\framedtextlocationnone +\def\checkframedtext % messy dependency + {\ifinsidefloat + \localhsize\hsize + \else\ifdim\sidefloatvsize>\zeropoint % will be proper handle + % \strut % rather clean way to invoke the sidefloat OTR + % \setbox0=\lastbox % and get the widths set, so from now on we + % \setlocalhsize % can have framed texts alongside sidefloats + \checksidefloat + \setlocalhsize + \else + \localhsize\hsize + \fi\fi} + \def\dododostartframedtext[#1][#2][#3]% #3 only passed to framed, not to framedtext {\doifsomething{#2}{\setvalue{\??kd#1\c!location}{#2}}% does not listen to #3 \setfalse\framedtextlocationnone diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv index 574175dde..26fdaadea 100644 --- a/tex/context/base/pack-rul.mkiv +++ b/tex/context/base/pack-rul.mkiv @@ -26,7 +26,12 @@ \unprotect %D We have removed the rather old and out dated raster methods. They -%D have not been used for ages. +%D have not been used for ages. You can still find the old code in +%D the \MKII\ counterpart of this module. + +%D This module is rather optimized so sometimes readability has been +%D sacrisfied for speed. This is because the framing mechanism is used +%D all over the place. %D \macros %D {linewidth, setuplinewidth} @@ -58,81 +63,6 @@ \newdimen\ruledlinewidth \newif\ifinheritruledlinewidth -% %D \TEX\ lacks support for color and even gray scales. The next -% %D macros can provide a sort of poor mans gray scales as well -% %D as give access to more suitable methods of rendering. Such a -% %D method looks like: -% %D -% %D \starttyping -% %D \def\methodegraybox#1#2#3#4#5#6% -% %D { ... } -% %D \stoptyping -% %D -% %D The string \type{graybox} is a common element in the name, -% %D so we can have for instance \type {\postscriptgraybox} or -% %D \type {\texgraybox}. The first three arguments take a -% %D dimension, the fourth one takes a number between~0 and~1, -% %D and the last argument specifies a radius of the box when -% %D rounded corners are used, so: -% %D -% %D \startbuffer -% %D \dotgraybox{.5\hsize}{1cm}{0cm}{.85}{\v!no}{0pt} -% %D \stopbuffer -% %D -% %D \typebuffer -% %D -% %D becomes: -% %D -% %D %\startlinecorrection -% %D % \vbox to 1cm{\getbuffer} -% %D %\stoplinecorrection -% %D -% %D \startlinecorrection -% %D \unprotect -% %D \vbox to 1cm{\dotgraybox{.5\hsize}{1cm}{0cm}{.85}{\v!no}{0pt}} -% %D \protect -% %D \stoplinecorrection -% %D -% %D There are two predefined methodes, one uses periods and the -% %D other uses small rules. The second method is less -% %D efficient, but sometimes give better results. The dimensions -% %D of the resullting box are set to zero. -% -% \setvalue{\v!dot graybox}{\processraster\symbol\rasterdot} -% \setvalue{\v!rule graybox}{\processraster\symbol\rasterbox} -% -% \def\rasterdot{\rasterfont.} -% \def\rasterbox{\hss\vrule\!!width.4pt\!!height.4pt\!!depth\zeropoint} -% -% %D Now of course we need: -% -% \ifx\rasterfont\undefined \def\rasterfont{\fivepoint} \fi -% -% %D We implement two pure \TEX\ based generators, that use -% %D \type{\leaders} to quickly gerenate the gray pattern. One -% %D should beware of \DIMENSION\ conflicts, so we use some -% %D registers above~8. These macros are memory hungry and byte -% %D spoiling. -% -% \def\processraster#1#2#3#4#5#6#7% -% {\bgroup -% \forgetall -% \dontcomplain -% \dimen10=\onepoint -% \dimen10=\@@rsfactor\dimen10 -% \dimen10=#5\dimen10 -% \setbox2\hbox to #2 -% {\cleaders\hbox to 2\dimen10{#1\hss}\hss}% -% \dimen12=#3% -% \advance\dimen12 #4% -% % \setbox0\vbox to \dimen12 -% {\cleaders\vbox to 2\dimen10{\box2\vss}\vss}% -% \setbox0\hbox -% {\hskip-.5\dimen10\lower0.5\dimen10\copy0 -% \hskip-\wd0\hskip\dimen10\lower1.5\dimen10\box0}% -% \box0 -% \egroup} - %D \macros %D {setupscreens} %D @@ -144,25 +74,6 @@ \def\setupscreens {\dodoubleargument\getparameters[\??rs]} -% %D The most appropriate way to call for this feature is -% %D using \type{\graybox}, which is defined as: -% -% \def\graybox{\getvalue{\@@rsmethod graybox}} -% -% %D We just introduced two pure \TEX\ methods for generating -% %D rasters. However, it's far more efficient and comfortable in -% %D terms of speed, memory usage and file size, to use a driver -% %D supported method. -% -% \setvalue{\v!external graybox}{\setgraybox} -% -% %D For compatibility reasons we also define the original one: -% -% \setvalue{\v!postscript graybox}{\getvalue{\v!external graybox}} -% -% %D A quite valid way of letting drivers do the job, is giving -% %D a solid rule a gray texture. - %D We will communicate through module specific variables, current %D framed parameters and some reserved dimension registers. @@ -176,13 +87,14 @@ \def\dofilledbox {\bgroup - \doifelse{\framedparameter\c!backgroundcorner}\v!rectangular - {\dofilledlinedbox} - {\ifzeropt\dimexpr\framedparameter\c!backgroundradius\relax % just in case of .x\bodyfontsize - \dofilledlinedbox - \else - \dofilledroundbox - \fi}% + \edef\@@framedfilledmod{\framedparameter\c!backgroundcorner}% + \ifx\@@framedfilledmod\v!rectangular + \dofilledlinedbox + \else\ifzeropt\dimexpr\framedparameter\c!backgroundradius\relax % just in case of .x\bodyfontsize + \dofilledlinedbox + \else + \dofilledroundbox + \fi\fi \egroup} \def\dophantombox @@ -197,7 +109,11 @@ \def\dodostrokedroundbox {\bgroup \edef\ovalmod{\framedparameter\c!framecorner}% - \doifelse\ovalmod\v!round{\let\ovalmod\!!zerocount}{\edef\ovalmod{\number\ovalmod}}% + \ifx\ovalmod\v!round + \let\ovalmod\!!zerocount + \else + \edef\ovalmod{\number\ovalmod}% + \fi \edef\ovalwid{\the\frameddimenwd}% \edef\ovalhei{\the\frameddimenht}% \edef\ovaldep{\the\frameddimendp}% @@ -212,7 +128,11 @@ \def\dofilledroundbox {\bgroup \edef\ovalmod{\framedparameter\c!backgroundcorner}% - \doifelse\ovalmod\v!round{\let\ovalmod\!!zerocount}{\edef\ovalmod{\number\ovalmod}}% + \ifx\ovalmod\v!round + \let\ovalmod\!!zerocount + \else + \edef\ovalmod{\number\ovalmod}% + \fi \edef\ovalwid{\the\frameddimenwd}% \edef\ovalhei{\the\frameddimenht}% \edef\ovaldep{\the\frameddimendp}% @@ -387,6 +307,7 @@ \long\def\executedefinedoverlay#1#2% {\bgroup + \setlayoutcomponentattribute\v!overlay{#1}% \edef\overlaywidth {\the\frameddimenwd\space}% \edef\overlayheight{\the\dimexpr\frameddimenht+\frameddimendp\relax\space}% \edef\overlaydepth {\the\frameddimendp\space}% @@ -395,16 +316,14 @@ %\edef\overlayradius{\framedparameter\c!backgroundradius}% \let\overlayoffset\backgroundoffset % we steal this one \setbox\scratchbox\hbox{\lower\overlaydepth\hbox{\the\everyoverlay#2}}% - \setbox\scratchbox\hbox + \setbox\scratchbox\hbox \layoutcomponentboxattribute {\hskip-.5\dimexpr\wd\scratchbox-\overlaywidth \relax \raise-.5\dimexpr\ht\scratchbox-\frameddimenht\relax % not overlayheight ! \box\scratchbox}% - \wd\scratchbox\overlaywidth - \ht\scratchbox\overlayheight - \dp\scratchbox\overlaydepth - \startlayoutcomponent{o:#1}{overlay #1}% - \box\scratchbox - \stoplayoutcomponent + \wd\scratchbox\frameddimenwd + \ht\scratchbox\frameddimenht + \dp\scratchbox\frameddimendp + \box\scratchbox \egroup} %D The empty case is: @@ -414,7 +333,11 @@ %D For testing we provide: \def\doifoverlayelse#1% - {\doifdefinedelse{\??ov#1}} + {\ifcsname\??ov#1\endcsname + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} %D We predefine two already familiar backgrounds: @@ -447,31 +370,6 @@ \let\currentbackground\empty -% \def\dodobackgroundbox#1% also less passing, we can get rid of the old method -% {\bgroup -% \def\currentbackground{#1}% -% \the\everybackgroundbox -% \setbox\extraframebox\hbox -% {\vbox{\moveleft\backgroundoffset\hbox{\executeifdefined{\??ov\currentbackground}\donothing}}}% -% \wd\extraframebox\zeropoint % \backgroundwidth -% \ht\extraframebox\backgroundheight -% \dp\extraframebox\backgrounddepth -% \box\extraframebox % \hskip-\backgroundwidth -% \egroup} - -% \def\dodobackgroundbox#1% also less passing, we can get rid of the old method -% {\bgroup -% \def\currentbackground{#1}% -% \ifcsname\??ov\currentbackground\endcsname -% \the\everybackgroundbox -% \setbox\extraframebox\hbox{\vbox{\moveleft\backgroundoffset\hbox{\csname\??ov\currentbackground\endcsname}}}% -% \wd\extraframebox\zeropoint % \backgroundwidth -% \ht\extraframebox\backgroundheight -% \dp\extraframebox\backgrounddepth -% \box\extraframebox % \hskip-\backgroundwidth -% \fi -% \egroup} - \def\dodobackgroundbox {\bgroup \ifcsname\??ov\currentbackground\endcsname @@ -486,7 +384,7 @@ \def\dododobackgroundbox#1,#2% #2 gobbles spaces {\edef\currentbackground{#1}% - \ifx\currentbackground\s!unknown\else + \ifx\currentbackground\s!unknown\else % use $ instead of s!unknown \dodobackgroundbox\expandafter\dododobackgroundbox \fi#2} @@ -495,60 +393,30 @@ \def\backgroundwidth {\the\hsize} \def\backgroundheight{\the\vsize} -% todo: also \def\theforegroundbox{#1} - -% \def\dobackgroundbox#1% -% {\setbox\framebox\vbox -% {\forgetall -% \boxmaxdepth\maxdimen -% \scratchdimen \framedparameter{#1}\relax -% \frameddimenwd\dimexpr\wd\framebox+2\scratchdimen\relax -% \frameddimenht\dimexpr\ht\framebox+ \scratchdimen\relax -% \frameddimendp\dimexpr\dp\framebox+ \scratchdimen+\framedparameter\c!backgrounddepth\relax -% \edef\backgroundoffset{\the\scratchdimen}% -% \edef\backgroundwidth {\the\wd\framebox}% -% \edef\backgroundheight{\the\ht\framebox}% -% \edef\backgrounddepth {\the\dp\framebox}% -% %\edef\foregroundbox{\box#1}% -% \def\foregroundbox% fuzzy but needed hack, this \vss, otherwise -% {\vbox to \backgroundheight{\vss\box\framebox\vss}}% vertical shift -% \edef\component{\framedparameter\c!component}% -% \hbox to \backgroundwidth % in case 'foreground' is used as overlay -% {\ifx\component\empty -% \rawprocesscommalist[\framedbackground]\dodobackgroundbox -% \else -% \startlayoutcomponent{b:\component}{\s!background\space\component}% -% \rawprocesscommalist[\framedbackground]\dodobackgroundbox -% \stoplayoutcomponent -% \fi -% \box\framebox\hss}}} - \def\normalforegroundbox% fuzzy but needed hack, this \vss, otherwise {\vbox to \backgroundheight{\vss\box\framebox\vss}}% vertical shift -\def\dobackgroundbox#1% +\def\dobackedbox {\setbox\framebox\vbox - {\forgetall + {\framedforgetall \boxmaxdepth\maxdimen - \scratchdimen \framedparameter{#1}\relax - \frameddimenwd\dimexpr\wd\framebox+2\scratchdimen\relax - \frameddimenht\dimexpr\ht\framebox+ \scratchdimen\relax - \frameddimendp\dimexpr\dp\framebox+ \scratchdimen+\framedparameter\c!backgrounddepth\relax - \edef\backgroundoffset{\the\scratchdimen}% + \frameddimenwd\dimexpr\wd\framebox+2\!!framedbackgroundoffset\relax + \frameddimenht\dimexpr\ht\framebox+ \!!framedbackgroundoffset\relax + \frameddimendp\dimexpr\dp\framebox+ \!!framedbackgroundoffset+\framedparameter\c!backgrounddepth\relax + \edef\backgroundoffset{\the\!!framedbackgroundoffset}% \edef\backgroundwidth {\the\wd\framebox}% \edef\backgroundheight{\the\ht\framebox}% \edef\backgrounddepth {\the\dp\framebox}% %\edef\foregroundbox{\box#1}% \edef\component{\framedparameter\c!component}% + \ifx\component\empty + \resetlayoutcomponentattribute + \else + \setlayoutcomponentattribute\v!background\component + \fi \let\foregroundbox\normalforegroundbox - \hbox to \backgroundwidth % in case 'foreground' is used as overlay - {\ifx\component\empty - \normalexpanded{\noexpand\dododobackgroundbox\framedparameter\c!background},\s!unknown,\relax - \else - \startlayoutcomponent{b:\component}{background \component}% - \normalexpanded{\noexpand\dododobackgroundbox\framedparameter\c!background},\s!unknown,\relax - \stoplayoutcomponent - \fi + \hbox to \backgroundwidth \layoutcomponentboxattribute % width in case 'foreground' is used as overlay + {\expandafter\dododobackgroundbox\framedbackground,\s!unknown,\relax % hm, messy .. look into it \box\framebox\hss}}} %D One can explictly insert the foreground box. For that @@ -565,14 +433,11 @@ %D by \TEX\ itself, the latter one depends on the driver. This %D macro also support a negative offset. -\ifx\scratchoffset\undefined \newdimen\scratchoffset \fi - \def\dooutlinebox % we needed to move the color command in order to apply attributes properly {\setbox\framebox\vbox % rules on top of box - {\scratchoffset \framedparameter\c!frameoffset\relax - \frameddimenwd\dimexpr\wd\framebox+2\scratchoffset\relax - \frameddimenht\dimexpr\ht\framebox+ \scratchoffset\relax - \frameddimendp\dimexpr\dp\framebox+ \scratchoffset+\framedparameter\c!framedepth\relax + {\frameddimenwd\dimexpr\wd\framebox+2\!!framedframeoffset\relax + \frameddimenht\dimexpr\ht\framebox+ \!!framedframeoffset\relax + \frameddimendp\dimexpr\dp\framebox+ \!!framedframeoffset+\framedparameter\c!framedepth\relax \ifdim\frameddimendp<\zeropoint \advance\frameddimenht \frameddimendp \scratchdimen-\frameddimendp @@ -584,7 +449,7 @@ {\doifsomething{\framedparameter\c!framecolor}{\color[\framedparameter\c!framecolor]}{\dostrokedbox}}% \setbox\extraframebox\hbox {\raise\scratchdimen\vbox - {\moveleft\scratchoffset + {\moveleft\!!framedframeoffset \box\extraframebox}}% \wd\extraframebox\wd\framebox \ht\extraframebox\ht\framebox @@ -592,13 +457,14 @@ \hbox{\box\framebox\hskip-\wd\extraframebox\box\extraframebox}}} \def\dostrokedbox - {\doifelse{\framedparameter\c!framecorner}\v!rectangular - {\dostrokedlinedbox} - {\ifzeropt\dimexpr\framedparameter\c!frameradius\relax % just in case of .x\bodyfontsize - \dostrokedlinedbox - \else - \dostrokedroundbox - \fi}} + {\edef\@@framedcornermod{\framedparameter\c!framecorner}% + \ifx\@@framedcornermod\v!rectangular + \dostrokedlinedbox + \else\ifzeropt\dimexpr\framedparameter\c!frameradius\relax % just in case of .x\bodyfontsize + \dostrokedlinedbox + \else + \dostrokedroundbox + \fi\fi} \def\dostrokedlinedbox {\setbox\scratchbox\null @@ -746,16 +612,12 @@ \presetlocalframed[\??ol] -% \unexpanded\def\framed -% {\bgroup -% \dodoubleempty\startlocalframed[\??ol]} - \newcount\framednesting \unexpanded\def\framed {\bgroup \advance\framednesting\plusone - \letvalue{\??ol:\the\framednesting\s!parent}\??ol + \expandafter\let\csname\??ol:\the\framednesting\s!parent\endcsname\??ol \dodoubleempty\startlocalframed[\??ol:\the\framednesting]} \def\setupframed @@ -820,19 +682,19 @@ {\bgroup \inframedtrue \edef\@@framed{#1}% - % some hackery (no \dimexpr) - \scratchdimen\framedparameter\c!frameoffset - \setevalue{\@@framed\c!frameoffset}{\the\scratchdimen}% - \doifnot{\framedparameter\c!backgroundoffset}\v!frame - {\scratchdimen\framedparameter\c!backgroundoffset - \setevalue{\@@framed\c!backgroundoffset}{\the\scratchdimen}}% - % so far \setbox\framebox\hbox{#4}% \getparameters[\@@framed][#3]% no \expanded ! + \!!framedframeoffset\framedparameter\c!frameoffset + \edef\@@framedbackgroundoffset{\framedparameter\c!backgroundoffset}% + \ifx\@@framedbackgroundoffset\v!frame + \!!framedbackgroundoffset\!!framedframeoffset + \else + \!!framedbackgroundoffset\@@framedbackgroundoffset + \fi % not here, in calling macro: setups \removeframedboxdepth - \edef\framedforegroundcolor{\framedparameter\c!foregroundcolor}% - \ifx\framedforegroundcolor\empty\else\docolorframebox\fi +% \edef\framedforegroundcolor{\framedparameter\c!foregroundcolor}% +% \ifx\framedforegroundcolor\empty\else\docolorframebox\fi \edef\overlaylinecolor{\framedparameter\c!framecolor}% \edef\overlaylinewidth{\the\ruledlinewidth}% \edef\@@localframing {\framedparameter\c!frame}% @@ -850,6 +712,44 @@ \box\framebox \egroup} +%D Here is another fast one: + +\def\localbackgroundframed#1#2#3#4% tag box wd ht + {\setbox#2\vbox\bgroup + \inframedtrue + \edef\@@framed{\??ma#1}% + \expandafter\def\csname\??ma#1\c!component\endcsname{#1}% + \expandafter\def\csname\??ma#1\c!width \endcsname{#3}% + \expandafter\def\csname\??ma#1\c!height \endcsname{#4}% + \!!framedframeoffset\framedparameter\c!frameoffset + \edef\@@framedbackgroundoffset{\framedparameter\c!backgroundoffset}% + \ifx\@@framedbackgroundoffset\v!frame + \!!framedbackgroundoffset\!!framedframeoffset + \else + \!!framedbackgroundoffset\@@framedbackgroundoffset + \fi + \setbox\framebox\box#2% + \dp\framebox\zeropoint +% \removeframedboxdepth +% \edef\framedforegroundcolor{\framedparameter\c!foregroundcolor}% +% \ifx\framedforegroundcolor\empty\else\docolorframebox\fi + \edef\overlaylinecolor{\framedparameter\c!framecolor}% + \edef\overlaylinewidth{\the\ruledlinewidth}% + \edef\@@localframing {\framedparameter\c!frame}% + \ifx\@@localframing\v!overlay \else \ifx\@@localframing\v!none \else + \edef\framedrulethickness{\framedparameter\c!rulethickness}% + \ifx\framedrulethickness\empty\else + \ruledlinewidth\framedrulethickness\relax + \ifinheritruledlinewidth\linewidth\ruledlinewidth\fi + \fi + \dooutlinebox % real or invisible frame + \fi \fi + \edef\framedbackground{\framedparameter\c!background}% + \ifx\framedbackground\empty\else\dobackedbox\fi +% \restoreframedboxdepth + \box\framebox + \egroup} + %D Before we go into details, we present (and implement) the %D main framing routine. I saw no real reason for splitting the %D next two macros into smaller pieces. The content will be @@ -907,15 +807,15 @@ \c!radius=.5\bodyfontsize, \c!rulethickness=\linewidth, \c!corner=\v!rectangular, - \c!depth=\!!zeropoint, + \c!depth=\zeropoint, %\c!foregroundcolor=, %\c!foregroundstyle=, %\c!background=, %\c!backgroundscreen=, %\c!backgroundcolor=, - \c!backgroundoffset=\!!zeropoint, + \c!backgroundoffset=\zeropoint, %\c!framecolor=, - \c!frameoffset=\!!zeropoint, + \c!frameoffset=\zeropoint, \c!backgroundcorner=\framedparameter\c!corner, \c!backgroundradius=\framedparameter\c!radius, \c!backgrounddepth=\framedparameter\c!depth, @@ -943,8 +843,8 @@ \c!radius=.5\bodyfontsize, \c!rulethickness=\linewidth, \c!corner=\v!rectangular, - \c!backgroundoffset=\!!zeropoint, - \c!frameoffset=\!!zeropoint, + \c!backgroundoffset=\zeropoint, + \c!frameoffset=\zeropoint, \c!backgroundcorner=\framedparameter\c!corner, \c!backgroundradius=\framedparameter\c!radius, \c!backgrounddepth=\framedparameter\c!depth, @@ -958,29 +858,33 @@ \newdimen\!!framedwidth \newdimen\!!framedheight \newdimen\!!framedscratch % so that users can use \scratchdimen +\newdimen\!!framedframeoffset +\newdimen\!!framedbackgroundoffset \let\setextraframedoffsets \relax \let\applyextraframedoffsets\relax +% todo: protect local \framednames + \def\startlocalframed[#1][#2]% {\bgroup \inframedtrue \edef\@@framed{#1}% - % this piece of pre expansion is needed (sometimes used circular) - \!!framedscratch\framedparameter\c!frameoffset - \setevalue{\@@framed\c!frameoffset}{\the\!!framedscratch}% - \doifnot{\framedparameter\c!backgroundoffset}\v!frame - {\!!framedscratch\framedparameter\c!backgroundoffset - \setevalue{\@@framed\c!backgroundoffset}{\the\!!framedscratch}}% - % to prevent deadlock in case of self refering \ifsecondargument % faster \getparameters[\@@framed][#2]% here ! \fi + \!!framedframeoffset\framedparameter\c!frameoffset + \edef\@@framedbackgroundoffset{\framedparameter\c!backgroundoffset}% + \ifx\@@framedbackgroundoffset\v!frame + \!!framedbackgroundoffset\!!framedframeoffset + \else + \!!framedbackgroundoffset\@@framedbackgroundoffset + \fi % new, experimental dirty hook \framedparameter\c!extras % to get the right spacing - \doifsomething{\framedparameter\c!foregroundstyle} - {\@EA\doconvertfont\csname\@@framed\c!foregroundstyle\endcsname\empty}% + \edef\fontattributehash{\framedparameterhash\c!foregroundstyle}% + \ifx\fontattributehash\empty\else\dosetfontattribute \fontattributehash\c!foregroundstyle\fi % beware, both the frame and background offset can be overruled % \edef\doframedsetups{\framedparameter\c!setups}% @@ -1043,7 +947,7 @@ \boxisoverlaidfalse \ifx\localoffset\v!default % new per 2-6-2000 \let\localoffset\defaultframeoffset - \letvalue{\@@framed\c!offset}\defaultframeoffset + \expandafter\let\csname\@@framed\c!offset\endcsname\defaultframeoffset \else \let\defaultframeoffset\localoffset \fi @@ -1087,12 +991,14 @@ \ifboxhasheight % obey user set height, also downward compatible \else - \doifsomething{\framedparameter\c!lines} - {\ifcase\framedparameter\c!lines\else - \!!framedheight\framedparameter\c!lines\lineheight + \edef\@@framedlines{\framedparameter\c!lines}% + \ifx\@@framedlines\empty\else + \ifcase\@@framedlines\else + \!!framedheight\@@framedlines\lineheight \edef\localheight{\the\!!framedheight}% \boxhasheighttrue - \fi}% + \fi + \fi \fi % this is now an option: width=local % @@ -1173,24 +1079,15 @@ \fi \fi \setextraframedoffsets - \edef\framedwidth % a new feature, visible for user - {\ifdim\!!framedwidth >\zeropoint\the\!!framedwidth \else\zeropoint\fi}% - \edef\framedheight% a new feature, visible for user - {\ifdim\!!framedheight>\zeropoint\the\!!framedheight\else\zeropoint\fi}% - % we need to register the (outer) color - \startregistercolor[\framedparameter\c!foregroundcolor]% - % first alternative - %\def\dowithframedbox% - % {\let\postprocessframebox\relax %new - % \aftergroup\stoplocalframed}% - % \afterassignment\dowithframedbox - % \setbox\framebox=\next} - % second alternative - %\dowithnextbox - % {\setbox\framebox\flushnextbox - % \let\postprocessframebox\relax %new - % \stoplocalframed} - % \next} + \edef\framedbackground{\framedparameter\c!background}% + \ifx\framedbackground\empty + \let\framedforgetall\forgetall + \else + \let\framedforgetall\relax + \forgetall + \fi + \edef\framedwidth {\ifdim\!!framedwidth >\zeropoint\the\!!framedwidth \else\!!zeropoint\fi}% a new feature, visible for user + \edef\framedheight{\ifdim\!!framedheight>\zeropoint\the\!!framedheight\else\!!zeropoint\fi}% a new feature, visible for user \@@startframedorientation \afterassignment\dodowithframebox \setbox\framebox\next} @@ -1240,7 +1137,6 @@ \def\stoplocalframed {\dontshowcomposition \@@stopframedorientation % hm, wrong place ! should rotate the result (after reshape) - \stopregistercolor \handleframedlocator\c!before\@@locallocation \ifboxhasformat \ifx\@@localautowidth\v!force @@ -1258,9 +1154,9 @@ \resetshapeframebox \fi\fi \fi -\ifconditional\boxcontentneedsprocessing - \mkdoprocessboxcontents\framebox -\fi + \ifconditional\boxcontentneedsprocessing + \mkdoprocessboxcontents\framebox + \fi \else \resetshapeframebox \fi @@ -1270,14 +1166,7 @@ \ifboxhasheight \ht\framebox\!!framedheight \fi - \doif{\framedparameter\c!empty}\v!yes - {\setbox\scratchbox\null - \wd\scratchbox\wd\framebox - \ht\scratchbox\ht\framebox - \dp\scratchbox\dp\framebox - \setbox\framebox\box\scratchbox}% - \edef\framedforegroundcolor{\framedparameter\c!foregroundcolor}% - \ifx\framedforegroundcolor\empty\else\docolorframebox\fi + \doif{\framedparameter\c!empty}\v!yes\dosetfakedframebox \ifboxhasextraoffset \applyextraframedoffsets \fi @@ -1297,19 +1186,35 @@ \ifboxhasframe % real or invisible frame \dooutlinebox \fi - \edef\framedbackground{\framedparameter\c!background}% \ifx\framedbackground\empty\else\dobackedbox\fi \handleframedlocator\c!after\@@locallocation \box\framebox \egroup \egroup} +\def\dosetfakedframebox + {\setbox\scratchbox\null + \wd\scratchbox\wd\framebox + \ht\scratchbox\ht\framebox + \dp\scratchbox\dp\framebox + \setbox\framebox\box\scratchbox} + +% test: (saves one forgetall) +% +% \edef\framedbackground{\framedparameter\c!background}% +% \ifx\framedbackground\empty +% \let\framedforgetall\forgetall +% \else +% \let\framedforgetall\relax +% \forgetall +% \fi + \def\installframedlocator#1#2#3% {\setvalue{\??oi:\c!location:\c!before:#1}{#2}% \setvalue{\??oi:\c!location:\c!after :#1}{#3}} \def\handleframedlocator#1#2% - {\getvalue{\??oi:\c!location:#1:#2}} + {\csname\??oi:\c!location:#1:#2\endcsname} \def\doprelocframedbox#1% {\scratchdimen\dimexpr#1+\ruledlinewidth\relax @@ -1688,14 +1593,6 @@ %D additional offset capabilities. The lot of calls to other %D macros makes this mechanism not that easy to comprehend. -%D Getting the backgrounds right takes less code. Again we -%D have to take care of additional offsets. - -\def\dobackedbox - {\doifelsevalue{\@@framed\c!backgroundoffset}\v!frame % new - {\dobackgroundbox\c!frameoffset} - {\dobackgroundbox\c!backgroundoffset}} - %D We handle left, right or middle alignment as well as fixed %D or free widths and heights. Each combination gets its own %D macro. @@ -1728,11 +1625,18 @@ %D The handlers: +\def\framedforgetall{\forgetall} + +\def\setframedforegroundcolor + {\edef\colorattributehash{\framedparameterhash\c!foregroundcolor}% + \ifx\colorattributehash\empty\else\dosetcolorattribute\colorattributehash\c!foregroundcolor\fi} + \def\doformatboxSomeFormat {\vbox to \!!framedheight \bgroup \let\postprocessframebox\relax - \forgetall + \framedforgetall + \setframedforegroundcolor \oninterlineskip \hsize\!!framedwidth \vsize\!!framedheight @@ -1750,7 +1654,8 @@ {\vbox to \!!framedheight \bgroup \let\postprocessframebox\relax - \forgetall + \framedforgetall + \setframedforegroundcolor \oninterlineskip \hsize\!!framedwidth \vsize\!!framedheight @@ -1768,7 +1673,8 @@ {\vbox to \!!framedheight \bgroup \let\postprocessframebox\relax - \forgetall + \framedforgetall + \setframedforegroundcolor \oninterlineskip \doframedsetups \raggedcommand @@ -1784,7 +1690,8 @@ {\vbox \bgroup \let\postprocessframebox\relax - \forgetall + \framedforgetall + \setframedforegroundcolor \oninterlineskip \hsize\!!framedwidth \doframedsetups @@ -1801,7 +1708,8 @@ {\vbox to \!!framedheight \bgroup \let\postprocessframebox\relax - \forgetall + \framedforgetall + \setframedforegroundcolor \vsize\!!framedheight \doframedsetups \vss @@ -1818,7 +1726,8 @@ {\hbox to \!!framedwidth \bgroup \let\postprocessframebox\relax - \forgetall + \framedforgetall + \setframedforegroundcolor \doframedsetups \hss \localstrut @@ -1830,6 +1739,7 @@ \def\doformatboxNoSize {\hbox \bgroup + \setframedforegroundcolor \let\postprocessframebox\relax \doframedsetups \localstrut @@ -1895,10 +1805,6 @@ %D of a centered box automatically (\type {fit}). When %D doing so, we need to reshape the box: -% The next implementation is frozen! It preserves the depth, -% otherwise we get problems with framed display math and auto -% width. - \newcount\framednoflines \newdimen\framedlastlength @@ -1910,15 +1816,6 @@ \let\framedboxheight\!!zeropoint \let\framedboxdepth \!!zeropoint -\chardef\reshapeframeboxmethod\plusone % 0=no flush, 1=old method 2=no depth messing - -% \newbox\luashapebox -% -% \def\doreshapeframedbox -% {\setbox\luashapebox\box\framebox -% \ctxlua{commands.doreshapeframedbox(\number\luashapebox)}% -% \setbox\framebox\box\luashapebox} - \def\doreshapeframedbox{\ifvbox\framebox\ctxlua{commands.doreshapeframedbox(\number\framebox)}\fi} %D The two variables \type {\framednoflines} and \type @@ -2164,23 +2061,24 @@ %D %D \showsetup{blackrule} -\def\doblackrule[#1]% - {\hbox\bgroup - \getparameters[\??bj][#1]% - \setstrut - \doif\@@bjwidth \v!max{\def\@@bjwidth {1em}}% - \doif\@@bjheight\v!max{\def\@@bjheight{\strutht}}% - \doif\@@bjdepth \v!max{\def\@@bjdepth {\strutdp}}% - \localstartcolor[\@@bjcolor]% +\def\complexblackrule[#1]% + {\hbox\bgroup\getparameters[\??bj][#1]\domakeblackrule\egroup} + +\def\simpleblackrule + {\hbox\bgroup\domakeblackrule\egroup} + +\def\domakeblackrule + {\doif\@@bjwidth \v!max{\def\@@bjwidth {1em}}% + \doif\@@bjheight\v!max{\setstrut\let\setstrut\relax\def\@@bjheight{\strutht}}% + \doif\@@bjdepth \v!max{\setstrut\def\@@bjdepth {\strutdp}}% + \startcolor[\@@bjcolor]% can be made faster, just direct attr \vrule \!!width \@@bjwidth \!!height\@@bjheight \!!depth \@@bjdepth - \localstopcolor - \egroup} + \stopcolor} -\unexpanded\def\blackrule - {\dosingleempty\doblackrule} +\definecomplexorsimple\blackrule %D \macros %D {blackrules} @@ -2225,7 +2123,7 @@ \advance\!!widtha -\scratchcounter\!!widthb \divide \!!widtha \@@bjn \fi}% - \localstartcolor[\@@bjcolor]% + \startcolor[\@@bjcolor]% \dorecurse\@@bjn {\vrule \!!width \!!widtha @@ -2233,7 +2131,7 @@ \!!depth \@@bjdepth \hskip\!!widthb}% \unskip - \localstopcolor + \stopcolor \egroup} \unexpanded\def\blackrules @@ -2774,6 +2672,19 @@ \setfalse\framedtextlocationnone +\def\checkframedtext % messy dependency + {\ifinsidefloat + \localhsize\hsize + \else\ifdim\sidefloatvsize>\zeropoint % will be proper handle + % \strut % rather clean way to invoke the sidefloat OTR + % \setbox0=\lastbox % and get the widths set, so from now on we + % \setlocalhsize % can have framed texts alongside sidefloats + \checksidefloat + \setlocalhsize + \else + \localhsize\hsize + \fi\fi} + \def\dododostartframedtext[#1][#2][#3]% #3 only passed to framed, not to framedtext {\doifsomething{#2}{\setvalue{\??kd#1\c!location}{#2}}% does not listen to #3 \setfalse\framedtextlocationnone @@ -2829,7 +2740,7 @@ \vskip-\struttotal \verticalstrut \egroup - \forgetall + \forgetall % brrr too often \vskip-\lineheight % will be an option, not default % \setbaselinecorrections @@ -3322,7 +3233,6 @@ \fi \setbox2\vbox \ifcase\backgroundsplit\or to \textheight \fi % max split {\vskip\@@agtopoffset - \popsplitproperties \unvcopy2 \prevdepth\dp2 \obeydepth @@ -3430,14 +3340,15 @@ \def\startframedcontent[#1]% {\bgroup - \let\stopframedcontent\egroup - \doifnot{#1}\v!off - {\doifdefined{\??fc#1\c!frame} - {\def\stopframedcontent{\dostopframedcontent{#1}}% - \dostartframedcontent{#1}}}} + \doifelse{#1}\v!off + {\let\stopframedcontent\egroup} + {\ifcsname\??fc#1\c!frame\endcsname + \dostartframedcontent{#1}% + \fi}} \def\dostartframedcontent#1% - {\setbox\framebox\hbox\bgroup + {\def\stopframedcontent{\dostopframedcontent{#1}}% + \setbox\framebox\hbox\bgroup \setlocalhsize \hsize\localhsize \advance\hsize\dimexpr-\getvalue{\??fc#1\c!leftoffset}-\getvalue{\??fc#1\c!rightoffset} \relax @@ -3487,8 +3398,7 @@ \def\dobackgroundline#1% {\dowithnextbox {\hbox - {\localcolortrue - \startcolor[#1]% + {\startcolor[#1]% \vrule \!!width \nextboxwd \!!height\nextboxht @@ -3525,15 +3435,15 @@ \c!radius=.5\bodyfontsize, \c!rulethickness=\linewidth, \c!corner=\v!rectangular, - \c!depth=\!!zeropoint, + \c!depth=\zeropoint, \c!foregroundcolor=, \c!foregroundstyle=, \c!background=, \c!backgroundscreen=\@@rsscreen, \c!backgroundcolor=, - \c!backgroundoffset=\!!zeropoint, + \c!backgroundoffset=\zeropoint, \c!framecolor=, - \c!frameoffset=\!!zeropoint, + \c!frameoffset=\zeropoint, \c!backgroundcorner=\framedparameter\c!corner, \c!backgroundradius=\framedparameter\c!radius, \c!backgrounddepth=\framedparameter\c!depth, diff --git a/tex/context/base/page-app.mkii b/tex/context/base/page-app.mkii new file mode 100644 index 000000000..e5c149aa0 --- /dev/null +++ b/tex/context/base/page-app.mkii @@ -0,0 +1,225 @@ +%D \module +%D [ file=page-app, % from meta-fig +%D version=1998.01.15, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Independent page building, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Applications} + +%D The fitting page code is moved from \type {meta-fig} to +%D here. + +\unprotect + +\definepapersize + [\??fp\s!dummy] + [\c!width=\fittingwd, + \c!height=\fittinght] + +\definelayout + [\??fp\s!dummy] + [\c!width=\fittingwd,\c!height=\fittinght,\c!location=\v!middle, + \c!topspace=\!!zeropoint,\c!backspace=\!!zeropoint, + \c!cutspace=\!!zeropoint,\c!bottomspace=\!!zeropoint, + \c!textdistance=\!!zeropoint,\c!lines=0,\c!grid=\v!no, + \c!top=\!!zeropoint,\c!bottom=\!!zeropoint, + \c!margin=\!!zeropoint,\c!edge=\!!zeropoint, + \c!leftmargin=\!!zeropoint,\c!leftedge=\!!zeropoint, + \c!rightmargin=\!!zeropoint,\c!rightedge=\!!zeropoint, + \c!header=\!!zeropoint,\c!footer=\!!zeropoint] + + +\def\dostartfittingpage[#1][#2]% + {\page % this is kind of tricky! there can be preceding page refs + \autostarttext + \bgroup % resulting in a zero height page; test fig-make ! + \def\currentfittingpage{#1}% + \dontcomplain + % runs under current page regime, i.e. page variables passed to mp + \getparameters[\currentfittingpage][\c!paper=,#2]% auto or size or nothing + \setbox\scratchbox\hbox + \bgroup + % needed later \getparameters[\currentfittingpage][\c!paper=,#2]% auto or size or nothing + \doifvalue{\currentfittingpage\c!margin}\v!page % undocumented + {\offsetbox + [\c!leftoffset=\backspace, + \c!rightoffset=\cutspace, + \c!topoffset=\topspace, + \c!bottomoffset=\bottomspace]\hbox}% + \bgroup + \scale[\c!scale=\getvalue{\currentfittingpage\c!scale}]% + \bgroup\localframed[\currentfittingpage]% + \bgroup} + +\def\dostopfittingpage + {\egroup % localframed + \egroup % scale + \egroup % offsetbox + \egroup % scratchbox + \edef\fittingwd{\the\wd\scratchbox}% + \edef\fittinght{\the\ht\scratchbox}% + \startlocallayout + \ifdim\fittinght<\lineheight + % write status : too small + \setbox\scratchbox\vbox to \lineheight{\vss\box\scratchbox\vss}% + \edef\fittinght{\the\lineheight}% + \fi + \let\checkcurrentlayout\relax % else interference with odd/even layout + \processaction + [\getvalue{\currentfittingpage\c!paper}] + [ \v!auto=>\let\fittingpapersize\printpapersize, + \s!unknown=>\let\fittingpapersize\commalistelement, + \s!default=>\def\fittingpapersize{\??fp\s!dummy}]% + \expanded{\setuppapersize[\??fp\s!dummy][\fittingpapersize]}% + \definelayout + [\v!page]% + [\c!location=\v!middle, + \c!width=\fittingwd, + \c!height=\fittinght]% + \setuplayout + [\v!page]% + \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!page=]% + \centerbox{\box\scratchbox}% + \stopmakeup + \stoplocallayout + \egroup + \autostoptext} + +%D \TEX\ pages (for \METAPOST\ pages, see \type {meta-fig}): + +\presetlocalframed[\??tg] + +\def\setupTEXpage + {\dodoubleargument\getparameters[\??tg]} + +\def\startTEXpage + {\dosingleempty\dostartTEXpage} + +\def\dostartTEXpage[#1]% + {\dostartfittingpage[\??tg][#1]\gobblespacetokens} + +\def\stopTEXpage + {\removelastspace + \dostopfittingpage} + +\setupTEXpage + [\c!scale=1000, + \c!strut=\v!no, + \c!align=\v!normal, % needed, else problems ! + \c!offset=\v!overlay, + \c!width=\v!fit, + \c!height=\v!fit, + \c!frame=\v!off] + +%D For Mojca: +%D +%D \starttyping +%D \startTEXstream \chapter{Bla} Hello world!\crlf Hello world! \stopTEXstream +%D \startTEXpage \chapter{Bla} Hello world!\crlf Hello world! \stopTEXpage +%D \stoptyping +%D +%D maybe I should support stream=yes in framed. + +\def\startTEXstream + {\dosingleempty\dostartTEXstream} + +\def\dostartTEXstream[#1]% + {\page + \defineoutputstream[tex]% + \enableoutputstream[tex]% + \def\stopTEXstream + {\disableoutputstream + \startTEXpage + \outputstreamunvbox[tex]% + \stopTEXpage}} + +%D Application pages (for an example, see \type {m-pstric}): + +\def\@@texapp{texapp} +\def\@@texdim{texdim} + +\def\saveTEXapplication#1#2% + {\immediate\openout\scratchwrite=\bufferprefix\@@texdim.tmp + \immediate\write\scratchwrite{\dimen#1=\the\ht\scratchbox}% + \immediate\write\scratchwrite{\dimen#2=\the\wd\scratchbox}% + \immediate\closeout\scratchwrite} + +\def\restoreTEXapplication + {\readlocfile{\bufferprefix\@@texdim.tmp}\donothing\donothing} + +\def\startTEXapplication + {\dosingleempty\dostartTEXapplication} + +\long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication + {\bgroup + \bgroup + \let\f!temporaryextension\c!tex + \setbuffer[\@@texapp]% + \starttext + #2% preamble + \startTEXpage[#1]% + \topskip\zeropoint + \setbox\scratchbox\hbox{#3}% + \saveTEXapplication02% dimensions + \box\scratchbox + \stopTEXpage + \stoptext + \endbuffer + \egroup + \doifelse\jobsuffix{dvi}\donetrue\donefalse + \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}% + \ifdone % eps + \executesystemcommand{dvips -E* -o \@@texapp.eps \@@texapp}% + \else % pdf + \executesystemcommand{dvips \bufferprefix\@@texapp}% + \executesystemcommand{ps2pdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}% +% \executesystemcommand{texmfstart pstopdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}% + \fi + \restoreTEXapplication % dimensions + \doifelse\jobsuffix{dvi}\donetrue\donefalse + \setbox\scratchbox\hbox + {\expanded{\externalfigure + [\bufferprefix\@@texapp.\ifdone eps\else pdf\fi] + [\c!object=\v!no]}}% + \setbox\scratchbox\hbox + {\lower\ht\scratchbox\hbox{\raise\dimen2\box\scratchbox}}% + \wd\scratchbox\dimen0 + \ht\scratchbox\dimen2 + \dp\scratchbox\zeropoint + \box\scratchbox + \egroup} + +%D \macros +%D {startpagefigure} +%D +%D \starttyping +%D \starttext \pagefigure[two.1] \stoptext +%D \stoptyping + +\def\startpagefigure + {\dodoubleempty\dostartpagefigure} + +\def\dostartpagefigure[#1][#2]% + {\bgroup + \getparameters[\??ex][\c!offset=\v!overlay,#2]% + \startTEXpage[\c!offset=\@@exoffset]% + \externalfigure[#1][#2]\ignorespaces} % so we can put some text below the graphic + +\def\stoppagefigure + {\stopTEXpage + \egroup} + +\def\pagefigure + {\dodoubleempty\dopagefigure} + +\def\dopagefigure[#1][#2]% + {\dostartpagefigure[#1][#2]\stoppagefigure} + +\protect \endinput diff --git a/tex/context/base/page-app.mkiv b/tex/context/base/page-app.mkiv new file mode 100644 index 000000000..e5c149aa0 --- /dev/null +++ b/tex/context/base/page-app.mkiv @@ -0,0 +1,225 @@ +%D \module +%D [ file=page-app, % from meta-fig +%D version=1998.01.15, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Independent page building, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Applications} + +%D The fitting page code is moved from \type {meta-fig} to +%D here. + +\unprotect + +\definepapersize + [\??fp\s!dummy] + [\c!width=\fittingwd, + \c!height=\fittinght] + +\definelayout + [\??fp\s!dummy] + [\c!width=\fittingwd,\c!height=\fittinght,\c!location=\v!middle, + \c!topspace=\!!zeropoint,\c!backspace=\!!zeropoint, + \c!cutspace=\!!zeropoint,\c!bottomspace=\!!zeropoint, + \c!textdistance=\!!zeropoint,\c!lines=0,\c!grid=\v!no, + \c!top=\!!zeropoint,\c!bottom=\!!zeropoint, + \c!margin=\!!zeropoint,\c!edge=\!!zeropoint, + \c!leftmargin=\!!zeropoint,\c!leftedge=\!!zeropoint, + \c!rightmargin=\!!zeropoint,\c!rightedge=\!!zeropoint, + \c!header=\!!zeropoint,\c!footer=\!!zeropoint] + + +\def\dostartfittingpage[#1][#2]% + {\page % this is kind of tricky! there can be preceding page refs + \autostarttext + \bgroup % resulting in a zero height page; test fig-make ! + \def\currentfittingpage{#1}% + \dontcomplain + % runs under current page regime, i.e. page variables passed to mp + \getparameters[\currentfittingpage][\c!paper=,#2]% auto or size or nothing + \setbox\scratchbox\hbox + \bgroup + % needed later \getparameters[\currentfittingpage][\c!paper=,#2]% auto or size or nothing + \doifvalue{\currentfittingpage\c!margin}\v!page % undocumented + {\offsetbox + [\c!leftoffset=\backspace, + \c!rightoffset=\cutspace, + \c!topoffset=\topspace, + \c!bottomoffset=\bottomspace]\hbox}% + \bgroup + \scale[\c!scale=\getvalue{\currentfittingpage\c!scale}]% + \bgroup\localframed[\currentfittingpage]% + \bgroup} + +\def\dostopfittingpage + {\egroup % localframed + \egroup % scale + \egroup % offsetbox + \egroup % scratchbox + \edef\fittingwd{\the\wd\scratchbox}% + \edef\fittinght{\the\ht\scratchbox}% + \startlocallayout + \ifdim\fittinght<\lineheight + % write status : too small + \setbox\scratchbox\vbox to \lineheight{\vss\box\scratchbox\vss}% + \edef\fittinght{\the\lineheight}% + \fi + \let\checkcurrentlayout\relax % else interference with odd/even layout + \processaction + [\getvalue{\currentfittingpage\c!paper}] + [ \v!auto=>\let\fittingpapersize\printpapersize, + \s!unknown=>\let\fittingpapersize\commalistelement, + \s!default=>\def\fittingpapersize{\??fp\s!dummy}]% + \expanded{\setuppapersize[\??fp\s!dummy][\fittingpapersize]}% + \definelayout + [\v!page]% + [\c!location=\v!middle, + \c!width=\fittingwd, + \c!height=\fittinght]% + \setuplayout + [\v!page]% + \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!page=]% + \centerbox{\box\scratchbox}% + \stopmakeup + \stoplocallayout + \egroup + \autostoptext} + +%D \TEX\ pages (for \METAPOST\ pages, see \type {meta-fig}): + +\presetlocalframed[\??tg] + +\def\setupTEXpage + {\dodoubleargument\getparameters[\??tg]} + +\def\startTEXpage + {\dosingleempty\dostartTEXpage} + +\def\dostartTEXpage[#1]% + {\dostartfittingpage[\??tg][#1]\gobblespacetokens} + +\def\stopTEXpage + {\removelastspace + \dostopfittingpage} + +\setupTEXpage + [\c!scale=1000, + \c!strut=\v!no, + \c!align=\v!normal, % needed, else problems ! + \c!offset=\v!overlay, + \c!width=\v!fit, + \c!height=\v!fit, + \c!frame=\v!off] + +%D For Mojca: +%D +%D \starttyping +%D \startTEXstream \chapter{Bla} Hello world!\crlf Hello world! \stopTEXstream +%D \startTEXpage \chapter{Bla} Hello world!\crlf Hello world! \stopTEXpage +%D \stoptyping +%D +%D maybe I should support stream=yes in framed. + +\def\startTEXstream + {\dosingleempty\dostartTEXstream} + +\def\dostartTEXstream[#1]% + {\page + \defineoutputstream[tex]% + \enableoutputstream[tex]% + \def\stopTEXstream + {\disableoutputstream + \startTEXpage + \outputstreamunvbox[tex]% + \stopTEXpage}} + +%D Application pages (for an example, see \type {m-pstric}): + +\def\@@texapp{texapp} +\def\@@texdim{texdim} + +\def\saveTEXapplication#1#2% + {\immediate\openout\scratchwrite=\bufferprefix\@@texdim.tmp + \immediate\write\scratchwrite{\dimen#1=\the\ht\scratchbox}% + \immediate\write\scratchwrite{\dimen#2=\the\wd\scratchbox}% + \immediate\closeout\scratchwrite} + +\def\restoreTEXapplication + {\readlocfile{\bufferprefix\@@texdim.tmp}\donothing\donothing} + +\def\startTEXapplication + {\dosingleempty\dostartTEXapplication} + +\long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication + {\bgroup + \bgroup + \let\f!temporaryextension\c!tex + \setbuffer[\@@texapp]% + \starttext + #2% preamble + \startTEXpage[#1]% + \topskip\zeropoint + \setbox\scratchbox\hbox{#3}% + \saveTEXapplication02% dimensions + \box\scratchbox + \stopTEXpage + \stoptext + \endbuffer + \egroup + \doifelse\jobsuffix{dvi}\donetrue\donefalse + \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}% + \ifdone % eps + \executesystemcommand{dvips -E* -o \@@texapp.eps \@@texapp}% + \else % pdf + \executesystemcommand{dvips \bufferprefix\@@texapp}% + \executesystemcommand{ps2pdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}% +% \executesystemcommand{texmfstart pstopdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}% + \fi + \restoreTEXapplication % dimensions + \doifelse\jobsuffix{dvi}\donetrue\donefalse + \setbox\scratchbox\hbox + {\expanded{\externalfigure + [\bufferprefix\@@texapp.\ifdone eps\else pdf\fi] + [\c!object=\v!no]}}% + \setbox\scratchbox\hbox + {\lower\ht\scratchbox\hbox{\raise\dimen2\box\scratchbox}}% + \wd\scratchbox\dimen0 + \ht\scratchbox\dimen2 + \dp\scratchbox\zeropoint + \box\scratchbox + \egroup} + +%D \macros +%D {startpagefigure} +%D +%D \starttyping +%D \starttext \pagefigure[two.1] \stoptext +%D \stoptyping + +\def\startpagefigure + {\dodoubleempty\dostartpagefigure} + +\def\dostartpagefigure[#1][#2]% + {\bgroup + \getparameters[\??ex][\c!offset=\v!overlay,#2]% + \startTEXpage[\c!offset=\@@exoffset]% + \externalfigure[#1][#2]\ignorespaces} % so we can put some text below the graphic + +\def\stoppagefigure + {\stopTEXpage + \egroup} + +\def\pagefigure + {\dodoubleempty\dopagefigure} + +\def\dopagefigure[#1][#2]% + {\dostartpagefigure[#1][#2]\stoppagefigure} + +\protect \endinput diff --git a/tex/context/base/page-app.tex b/tex/context/base/page-app.tex deleted file mode 100644 index e5c149aa0..000000000 --- a/tex/context/base/page-app.tex +++ /dev/null @@ -1,225 +0,0 @@ -%D \module -%D [ file=page-app, % from meta-fig -%D version=1998.01.15, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Independent page building, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Applications} - -%D The fitting page code is moved from \type {meta-fig} to -%D here. - -\unprotect - -\definepapersize - [\??fp\s!dummy] - [\c!width=\fittingwd, - \c!height=\fittinght] - -\definelayout - [\??fp\s!dummy] - [\c!width=\fittingwd,\c!height=\fittinght,\c!location=\v!middle, - \c!topspace=\!!zeropoint,\c!backspace=\!!zeropoint, - \c!cutspace=\!!zeropoint,\c!bottomspace=\!!zeropoint, - \c!textdistance=\!!zeropoint,\c!lines=0,\c!grid=\v!no, - \c!top=\!!zeropoint,\c!bottom=\!!zeropoint, - \c!margin=\!!zeropoint,\c!edge=\!!zeropoint, - \c!leftmargin=\!!zeropoint,\c!leftedge=\!!zeropoint, - \c!rightmargin=\!!zeropoint,\c!rightedge=\!!zeropoint, - \c!header=\!!zeropoint,\c!footer=\!!zeropoint] - - -\def\dostartfittingpage[#1][#2]% - {\page % this is kind of tricky! there can be preceding page refs - \autostarttext - \bgroup % resulting in a zero height page; test fig-make ! - \def\currentfittingpage{#1}% - \dontcomplain - % runs under current page regime, i.e. page variables passed to mp - \getparameters[\currentfittingpage][\c!paper=,#2]% auto or size or nothing - \setbox\scratchbox\hbox - \bgroup - % needed later \getparameters[\currentfittingpage][\c!paper=,#2]% auto or size or nothing - \doifvalue{\currentfittingpage\c!margin}\v!page % undocumented - {\offsetbox - [\c!leftoffset=\backspace, - \c!rightoffset=\cutspace, - \c!topoffset=\topspace, - \c!bottomoffset=\bottomspace]\hbox}% - \bgroup - \scale[\c!scale=\getvalue{\currentfittingpage\c!scale}]% - \bgroup\localframed[\currentfittingpage]% - \bgroup} - -\def\dostopfittingpage - {\egroup % localframed - \egroup % scale - \egroup % offsetbox - \egroup % scratchbox - \edef\fittingwd{\the\wd\scratchbox}% - \edef\fittinght{\the\ht\scratchbox}% - \startlocallayout - \ifdim\fittinght<\lineheight - % write status : too small - \setbox\scratchbox\vbox to \lineheight{\vss\box\scratchbox\vss}% - \edef\fittinght{\the\lineheight}% - \fi - \let\checkcurrentlayout\relax % else interference with odd/even layout - \processaction - [\getvalue{\currentfittingpage\c!paper}] - [ \v!auto=>\let\fittingpapersize\printpapersize, - \s!unknown=>\let\fittingpapersize\commalistelement, - \s!default=>\def\fittingpapersize{\??fp\s!dummy}]% - \expanded{\setuppapersize[\??fp\s!dummy][\fittingpapersize]}% - \definelayout - [\v!page]% - [\c!location=\v!middle, - \c!width=\fittingwd, - \c!height=\fittinght]% - \setuplayout - [\v!page]% - \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!page=]% - \centerbox{\box\scratchbox}% - \stopmakeup - \stoplocallayout - \egroup - \autostoptext} - -%D \TEX\ pages (for \METAPOST\ pages, see \type {meta-fig}): - -\presetlocalframed[\??tg] - -\def\setupTEXpage - {\dodoubleargument\getparameters[\??tg]} - -\def\startTEXpage - {\dosingleempty\dostartTEXpage} - -\def\dostartTEXpage[#1]% - {\dostartfittingpage[\??tg][#1]\gobblespacetokens} - -\def\stopTEXpage - {\removelastspace - \dostopfittingpage} - -\setupTEXpage - [\c!scale=1000, - \c!strut=\v!no, - \c!align=\v!normal, % needed, else problems ! - \c!offset=\v!overlay, - \c!width=\v!fit, - \c!height=\v!fit, - \c!frame=\v!off] - -%D For Mojca: -%D -%D \starttyping -%D \startTEXstream \chapter{Bla} Hello world!\crlf Hello world! \stopTEXstream -%D \startTEXpage \chapter{Bla} Hello world!\crlf Hello world! \stopTEXpage -%D \stoptyping -%D -%D maybe I should support stream=yes in framed. - -\def\startTEXstream - {\dosingleempty\dostartTEXstream} - -\def\dostartTEXstream[#1]% - {\page - \defineoutputstream[tex]% - \enableoutputstream[tex]% - \def\stopTEXstream - {\disableoutputstream - \startTEXpage - \outputstreamunvbox[tex]% - \stopTEXpage}} - -%D Application pages (for an example, see \type {m-pstric}): - -\def\@@texapp{texapp} -\def\@@texdim{texdim} - -\def\saveTEXapplication#1#2% - {\immediate\openout\scratchwrite=\bufferprefix\@@texdim.tmp - \immediate\write\scratchwrite{\dimen#1=\the\ht\scratchbox}% - \immediate\write\scratchwrite{\dimen#2=\the\wd\scratchbox}% - \immediate\closeout\scratchwrite} - -\def\restoreTEXapplication - {\readlocfile{\bufferprefix\@@texdim.tmp}\donothing\donothing} - -\def\startTEXapplication - {\dosingleempty\dostartTEXapplication} - -\long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication - {\bgroup - \bgroup - \let\f!temporaryextension\c!tex - \setbuffer[\@@texapp]% - \starttext - #2% preamble - \startTEXpage[#1]% - \topskip\zeropoint - \setbox\scratchbox\hbox{#3}% - \saveTEXapplication02% dimensions - \box\scratchbox - \stopTEXpage - \stoptext - \endbuffer - \egroup - \doifelse\jobsuffix{dvi}\donetrue\donefalse - \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}% - \ifdone % eps - \executesystemcommand{dvips -E* -o \@@texapp.eps \@@texapp}% - \else % pdf - \executesystemcommand{dvips \bufferprefix\@@texapp}% - \executesystemcommand{ps2pdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}% -% \executesystemcommand{texmfstart pstopdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}% - \fi - \restoreTEXapplication % dimensions - \doifelse\jobsuffix{dvi}\donetrue\donefalse - \setbox\scratchbox\hbox - {\expanded{\externalfigure - [\bufferprefix\@@texapp.\ifdone eps\else pdf\fi] - [\c!object=\v!no]}}% - \setbox\scratchbox\hbox - {\lower\ht\scratchbox\hbox{\raise\dimen2\box\scratchbox}}% - \wd\scratchbox\dimen0 - \ht\scratchbox\dimen2 - \dp\scratchbox\zeropoint - \box\scratchbox - \egroup} - -%D \macros -%D {startpagefigure} -%D -%D \starttyping -%D \starttext \pagefigure[two.1] \stoptext -%D \stoptyping - -\def\startpagefigure - {\dodoubleempty\dostartpagefigure} - -\def\dostartpagefigure[#1][#2]% - {\bgroup - \getparameters[\??ex][\c!offset=\v!overlay,#2]% - \startTEXpage[\c!offset=\@@exoffset]% - \externalfigure[#1][#2]\ignorespaces} % so we can put some text below the graphic - -\def\stoppagefigure - {\stopTEXpage - \egroup} - -\def\pagefigure - {\dodoubleempty\dopagefigure} - -\def\dopagefigure[#1][#2]% - {\dostartpagefigure[#1][#2]\stoppagefigure} - -\protect \endinput diff --git a/tex/context/base/page-bck.mkiv b/tex/context/base/page-bck.mkiv index 2522c882d..fae091c6a 100644 --- a/tex/context/base/page-bck.mkiv +++ b/tex/context/base/page-bck.mkiv @@ -15,6 +15,8 @@ % \chardef\kindofpagetextareas=1 will isolate graphics from backgrounds +% todo \fastlocalframed -> \localbackgroundframed + \unprotect %D \macros @@ -70,6 +72,45 @@ %D (On the 824 pages maps bibliography runtime went down from %D 309 to 299 seconds.) +% \let\currentotrbackground\empty +% +% \def\@@docheckbackground#1#2% +% {\ifcsname\currentotrbackground#1\endcsname +% \edef\!!stringa{\csname\currentotrbackground#1\endcsname}\ifx\!!stringa#2\!!doneatrue\fi +% \fi} +% +% \def\@@nocheckbackground#1#2% +% {\ifcsname\currentotrbackground#1\endcsname +% \edef\!!stringa{\csname\currentotrbackground#1\endcsname}\ifx\!!stringa#2\else\!!doneatrue\fi +% \fi} +% +% \def\checkbackground#1% +% {\edef\currentotrbackground{\??ma#1}% +% \begingroup +% \!!doneafalse +% \if!!donea\else\@@nocheckbackground\c!background \empty +% \if!!donea\else\@@docheckbackground\c!frame \v!on +% \if!!donea\else\@@nocheckbackground\c!foregroundcolor\empty +% \if!!donea\else\@@docheckbackground\c!leftframe \v!on +% \if!!donea\else\@@docheckbackground\c!rightframe \v!on +% \if!!donea\else\@@docheckbackground\c!topframe \v!on +% \if!!donea\else\@@docheckbackground\c!bottomframe \v!on \fi\fi\fi\fi\fi\fi\fi +% \if!!donea +% \endgroup\setusage \currentotrbackground +% \else +% \endgroup\resetusage\currentotrbackground +% \fi} +% +% \def\ifsomebackgroundfound#1% +% {\ifusage{\??ma#1}} +% +% \def\doifsomebackgroundelse#1% +% {\ifusage{\??ma#1}% +% \expandafter\firstoftwoarguments +% \else +% \expandafter\secondoftwoarguments +% \fi} + \let\currentotrbackground\empty \def\@@docheckbackground#1#2% @@ -82,7 +123,7 @@ \edef\!!stringa{\csname\currentotrbackground#1\endcsname}\ifx\!!stringa#2\else\!!doneatrue\fi \fi} -\def\checkbackground#1% +\def\checkbackground#1% here we need an \ifempty primitive {\edef\currentotrbackground{\??ma#1}% \begingroup \!!doneafalse @@ -94,34 +135,49 @@ \if!!donea\else\@@docheckbackground\c!topframe \v!on \if!!donea\else\@@docheckbackground\c!bottomframe \v!on \fi\fi\fi\fi\fi\fi\fi \if!!donea - \endgroup\setusage \currentotrbackground + \endgroup\expandafter\let\csname\currentotrbackground\endcsname\relax \else - \endgroup\resetusage\currentotrbackground + \endgroup\expandafter\let\csname\currentotrbackground\endcsname\undefined \fi} \def\ifsomebackgroundfound#1% - {\ifusage{\??ma#1}} + {\ifcsname\??ma#1\endcsname} \def\doifsomebackgroundelse#1% - {\ifusage{\??ma#1}% + {\ifcsname\??ma#1\endcsname \expandafter\firstoftwoarguments \else \expandafter\secondoftwoarguments \fi} +\def\doifsomebackground#1% + {\ifcsname\??ma#1\endcsname + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + %D The background mechanism falls back on the \type {\framed} %D macro. This means that all normal frame and overlay %D features can be used. +% \def\addsomebackground#1#2#3#4% area box width height / zero test added +% {\ifsomebackgroundfound#1\ifdim#3>\zeropoint\ifdim#4>\zeropoint +% \ifcsname\??ma#1\c!setups\endcsname % to be done +% \doifvaluesomething{\??ma#1\c!setups}{\setups[\csname\??ma#1\c!setups\endcsname]}% should not produce funny spaces ! +% \fi +% \setbox#2\vbox\fastlocalframed % maybe \superfastlocalframed{tag}{w}{h} +% [\??ma#1]% +% [\c!component=#1,\c!width=#3,\c!height=#4]% are width and height used? +% {\dp#2\zeropoint\box#2}% +% \fi\fi\fi} + \def\addsomebackground#1#2#3#4% area box width height / zero test added {\ifsomebackgroundfound#1\ifdim#3>\zeropoint\ifdim#4>\zeropoint \ifcsname\??ma#1\c!setups\endcsname % to be done - \doifvaluesomething{\??ma#1\c!setups}{\setups[\getvalue{\??ma#1\c!setups}]}% should not produce funny spaces ! + \doifvaluesomething{\??ma#1\c!setups}{\setups[\csname\??ma#1\c!setups\endcsname]}% should not produce funny spaces ! \fi - \setbox#2\vbox\fastlocalframed - [\??ma#1] - [\c!component=#1,\c!width=#3,\c!height=#4]% are width and height used? - {\dp#2\zeropoint\box#2}% + \localbackgroundframed{#1}{#2}{#3}{#4}% \fi\fi\fi} %D There are quite some backgrounds. At the bottom layer, @@ -179,10 +235,6 @@ \newdimen\pageoffset % bleed \newdimen\pagedepth -\let\pagebackgroundhoffset\!!zeropoint -\let\pagebackgroundvoffset\!!zeropoint -\let\pagebackgrounddepth \!!zeropoint - % \def\setbackgroundboxes % {\showmessage\m!layouts8\empty % \setbackgroundbox\leftbackground\relax @@ -204,30 +256,36 @@ \def\setbackgroundboxes {\ifnewbackground - \global\chardef\newrightbackground\plusone - \global\chardef\newleftbackground\plusone - \global\setbox\leftbackground\emptybox - \global\setbox\rightbackground\emptybox + \dosetbackgroundboxesr \fi - \doifbothsides - {\ifcase\newleftbackground \else - % \showmessage\m!layouts8\empty - \setbackgroundbox\leftbackground\relax - \global\chardef\newleftbackground\zerocount - \global\chardef\newrightbackground\zerocount - \fi} - {\ifcase\newleftbackground \else - % \showmessage\m!layouts8\empty - \setbackgroundbox\leftbackground\relax - \global\chardef\newleftbackground\zerocount - \fi} - {\ifcase\newrightbackground \else - % \showmessage\m!layouts8\empty - \setbackgroundbox\rightbackground\doswapmargins - \global\chardef\newrightbackground\zerocount - \fi}% + \doifbothsides\dosetbackgroundboxesa\dosetbackgroundboxesb\dosetbackgroundboxesc \ifx\@@mastate\v!repeat\else\global\newbackgroundfalse\fi} +\def\dosetbackgroundboxesr + {\global\chardef\newrightbackground\plusone + \global\chardef\newleftbackground\plusone + \global\setbox\leftbackground\emptybox + \global\setbox\rightbackground\emptybox} +\def\dosetbackgroundboxesa + {\ifcase\newleftbackground \else + % \showmessage\m!layouts8\empty + \setbackgroundbox\leftbackground\relax + \global\chardef\newleftbackground\zerocount + \global\chardef\newrightbackground\zerocount + \fi} +\def\dosetbackgroundboxesb + {\ifcase\newleftbackground \else + % \showmessage\m!layouts8\empty + \setbackgroundbox\leftbackground\relax + \global\chardef\newleftbackground\zerocount + \fi} +\def\dosetbackgroundboxesc + {\ifcase\newrightbackground \else + % \showmessage\m!layouts8\empty + \setbackgroundbox\rightbackground\doswapmargins + \global\chardef\newrightbackground\zerocount + \fi} + \def\addmainbackground#1% todo: dimension spec {\ifsomebackground \setbackgroundboxes @@ -237,25 +295,29 @@ \box#1}% \fi} -\def\setbackgroundoffsets +\newdimen\pagebackgroundhoffset +\newdimen\pagebackgroundvoffset +\newdimen\pagebackgrounddepth +\newdimen\pagebackgroundoffset + +\def\setbackgroundoffsets % used in menus (we can use ifcsname's here) {\ifsomebackground \ifnewbackground - \global\let\pagebackgroundhoffset\!!zeropoint - \global\let\pagebackgroundvoffset\!!zeropoint - \global\let\pagebackgrounddepth \!!zeropoint + \global\pagebackgroundhoffset\zeropoint + \global\pagebackgroundvoffset\zeropoint + \global\pagebackgrounddepth \zeropoint \doifsomebackgroundelse{\v!text\v!text}\donetrue\donefalse \ifdone\else\doifsomebackgroundelse\v!text\donetrue\donothing\fi \ifdone - \bgroup - \scratchdimen\getvalue{\??ma\v!page\c!offset}% + \begingroup + \scratchdimen\csname\??ma\v!page\c!offset\endcsname \doifsomebackgroundelse{\v!top\v!text}\donothing {\doifsomebackgroundelse{\v!bottom\v!text}\donothing - {\xdef\pagebackgroundhoffset{\the\scratchdimen}}}% + {\global\pagebackgroundhoffset\scratchdimen}}% \doifsomebackgroundelse{\v!text\v!rightedge}\donothing {\doifsomebackgroundelse{\v!text\v!leftedge}\donothing - {\xdef\pagebackgroundvoffset{\the\scratchdimen}% - \scratchdimen\getvalue{\??ma\v!page\c!depth}% - \xdef\pagebackgrounddepth{\the\scratchdimen}}}% - \egroup + {\global\pagebackgroundvoffset\scratchdimen + \global\pagebackgrounddepth\csname\??ma\v!page\c!depth\endcsname}}% + \endgroup \fi \fi \fi} @@ -288,7 +350,7 @@ \vfilll}% \smashbox#1} -\def\dodopagebodybackground#1#2% +\def\dodopagebodybackground#1#2% maybe helper {\ifdim#2>\zeropoint % added, faster \setbox\scratchbox\vbox to #2 \bgroup\hbox\bgroup @@ -308,17 +370,17 @@ \box\scratchbox\relax \fi} -\def\dododopagebodybackground#1#2#3#4% width height pos pos +\def\dododopagebodybackground#1#2#3#4% width height pos pos % maybe helper {\ifsomebackgroundfound{#3#4}% \ifdim#2>\zeropoint\relax \ifdim#1>\zeropoint\relax \ifcsname\??ma#3#4\c!setups\endcsname % to be done - \doifvaluesomething{\??ma#3#4\c!setups}{\setups[\getvalue{\??ma#3#4\c!setups}]}% should not produce funny spaces ! + \doifvaluesomething{\??ma#3#4\c!setups}{\setups[\csname\??ma#3#4\c!setups\endcsname]}% should not produce funny spaces ! \fi \fastlocalframed - [\??ma#3#4] - [\c!component=#3-#4] - {\vbox to #2{\vss\hbox to#1{\hss\getvalue{\??ma#3#4\c!command}\hss}\vss}}% + [\??ma#3#4]% + [\c!component=#3-#4]% + {\vbox to #2{\vss\hbox to#1{\hss\csname\??ma#3#4\c!command\endcsname\hss}\vss}}% \else \hskip#1% \fi @@ -371,17 +433,14 @@ \fi\fi\fi \doifelsevalue{\??ma\v!page\c!offset}\v!overlay {\global\pageoffset\zeropoint} - {\global\pageoffset\getvalue{\??ma\v!page\c!offset}}% - \global\pagedepth\getvalue{\??ma\v!page\c!depth}% - \xdef\pagebackgroundoffset{\the\pageoffset}% - \xdef\pagebackgrounddepth {\the\pagedepth }% + {\global\pageoffset\csname\??ma\v!page\c!offset\endcsname}% + \global\pagedepth\csname\??ma\v!page\c!depth\endcsname + \global\pagebackgroundoffset\pageoffset + \global\pagebackgrounddepth\pagedepth \doifelse\@@mastate\v!stop {\global\newbackgroundfalse} {\global\newbackgroundtrue }} -\let\pagebackgroundoffset\!!zeropoint -\let\pagebackgrounddepth \!!zeropoint - %D Each areas (currently there are $1+3+25+1=30$ of them) %D has its own low level framed object associated. @@ -426,8 +485,8 @@ \getparameters [\??ma\v!page] - [\c!offset=\!!zeropoint, % hm, so we need to force overlay elsewhere - \c!depth=\!!zeropoint] + [\c!offset=\zeropoint, % hm, so we need to force overlay elsewhere + \c!depth=\zeropoint] %D General setup: @@ -502,20 +561,3 @@ \somebackgroundfalse \protect \endinput - -%D Removed \quote {features}: -%D -%D \starttyping -%D \startinteraction -%D \doifmarginswapelse -%D {\copy\leftbackground} -%D {\copy\rightbackground}% -%D \stopinteraction -%D \stoptyping -%D -%D \starttyping -%D \edef\setpagebackgrounddepth% -%D {\dp#2=\the\dp#2}% -%D \setbox#2=\vbox\localframed[\??ma#1]{...} -%D \setpagebackgrounddepth -%D \stoptyping diff --git a/tex/context/base/page-flw.mkii b/tex/context/base/page-flw.mkii new file mode 100644 index 000000000..3eb867a78 --- /dev/null +++ b/tex/context/base/page-flw.mkii @@ -0,0 +1,107 @@ +%D \module +%D [ file=page-flw, +%D version=2003.04.19, % from test-002 (1997) profile experiment +%D title=\CONTEXT\ Page Macros, +%D subtitle=Text Flows, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Text Flows} + +%D This is high experimental and especially flushing may change (proper +%D spacing is the driving force here). + +\unprotect + +\def\definetextflow + {\dodoubleempty\dodefinetextflow} + +\def\dodefinetextflow[#1][#2]% flow settings + {\iffirstargument + \doiftextflowcollectorelse{#1} + {\setbox\textflowcollector{#1}\emptybox} + {\@EA\newbox\csname\??tx:c:#1\endcsname}% + \getparameters[\??tx:p:#1] + [\c!width=\hsize,\c!style=,#2]% + \fi} + +\def\textflowparameter#1#2{\csname\??tx:p:#1#2\endcsname} +\def\textflowcollector #1{\csname\??tx:c:#1\endcsname} + +\def\doiftextflowcollectorelse#1{\doifdefinedelse{\??tx:c:#1}} + +\def\doiftextflowelse#1% + {\doiftextflowcollectorelse{#1} + {\ifvoid\textflowcollector{#1}% + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + {\secondoftwoarguments}} + +\def\doiftextflow#1% + {\doiftextflowelse{#1}\firstofoneargument\gobbleoneargument} + +\def\starttextflow[#1]% + {\doiftextflowcollectorelse{#1} + {\global\setbox\textflowcollector{#1}\vbox + \bgroup + \unvbox\textflowcollector{#1}% + \hsize\textflowparameter{#1}\c!width + \doifsomething{\textflowparameter{#1}\c!style}% + {\doconvertfont{\textflowparameter{#1}\c!style}}% + \def\stoptextflow{\endgraf\egroup}} + {\let\stoptextflow\relax}} + +\def\flushtextflow#1% + {\doiftextflow{#1} + {\ifdim\ht\textflowcollector{#1}>\vsize + \setbox\scratchbox\vsplit\textflowcollector{#1} to \vsize + \unvbox\scratchbox + \else + \unvbox\textflowcollector{#1}% + \fi}} + +\protect \endinput + +% Example (dutch) +% +% \stelpapierformaatin [S6] +% \steltolerantiein [soepel,rek] +% \stelkleurenin [status=start] +% \stelvoetin [strut=nee] +% \stelwitruimtein [groot] +% +% \stellayoutin +% [rechterrand=5cm,breedte=passend,marge=0pt,randafstand=1cm, +% voet=4cm,voetafstand=1cm,hoofd=0cm] +% +% \stelteksttekstenin[rand][][\vbox{\flushtextflow{alpha}}] +% \stelvoettekstenin [rand][][\vbox{\flushtextflow{beta}}] +% \stelvoettekstenin [\vbox{\flushtextflow{gamma}}][] +% +% \definetextflow [alfa] [breedte=\rechterrandbreedte] +% \definetextflow [beta] [breedte=\rechterrandbreedte] +% \definetextflow [gamma] [breedte=\voethoogte] +% +% \starttekst +% +% \dorecurse{50} +% {\getrandomnumber{\funny}{0}{8} +% \ifcase\funny \starttextflow[alfa] \input tufte.tex \stoptextflow +% \or \starttextflow[beta] \input knuth.tex \stoptextflow +% \or \starttextflow[gamma] \input materie.tex \stoptextflow +% \or {\bf TUFTE}\quad \input tufte \par +% \or {\bf TUFTE}\quad \input tufte \par +% \or {\bf KNUTH}\quad \input knuth \par +% \or {\bf KNUTH}\quad \input knuth \par +% \or {\bf MATERIE}\quad \input materie \par +% \else {\bf MATERIE}\quad \input materie \par +% \fi} +% +% \stoptekst diff --git a/tex/context/base/page-flw.mkiv b/tex/context/base/page-flw.mkiv new file mode 100644 index 000000000..3eb867a78 --- /dev/null +++ b/tex/context/base/page-flw.mkiv @@ -0,0 +1,107 @@ +%D \module +%D [ file=page-flw, +%D version=2003.04.19, % from test-002 (1997) profile experiment +%D title=\CONTEXT\ Page Macros, +%D subtitle=Text Flows, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Text Flows} + +%D This is high experimental and especially flushing may change (proper +%D spacing is the driving force here). + +\unprotect + +\def\definetextflow + {\dodoubleempty\dodefinetextflow} + +\def\dodefinetextflow[#1][#2]% flow settings + {\iffirstargument + \doiftextflowcollectorelse{#1} + {\setbox\textflowcollector{#1}\emptybox} + {\@EA\newbox\csname\??tx:c:#1\endcsname}% + \getparameters[\??tx:p:#1] + [\c!width=\hsize,\c!style=,#2]% + \fi} + +\def\textflowparameter#1#2{\csname\??tx:p:#1#2\endcsname} +\def\textflowcollector #1{\csname\??tx:c:#1\endcsname} + +\def\doiftextflowcollectorelse#1{\doifdefinedelse{\??tx:c:#1}} + +\def\doiftextflowelse#1% + {\doiftextflowcollectorelse{#1} + {\ifvoid\textflowcollector{#1}% + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + {\secondoftwoarguments}} + +\def\doiftextflow#1% + {\doiftextflowelse{#1}\firstofoneargument\gobbleoneargument} + +\def\starttextflow[#1]% + {\doiftextflowcollectorelse{#1} + {\global\setbox\textflowcollector{#1}\vbox + \bgroup + \unvbox\textflowcollector{#1}% + \hsize\textflowparameter{#1}\c!width + \doifsomething{\textflowparameter{#1}\c!style}% + {\doconvertfont{\textflowparameter{#1}\c!style}}% + \def\stoptextflow{\endgraf\egroup}} + {\let\stoptextflow\relax}} + +\def\flushtextflow#1% + {\doiftextflow{#1} + {\ifdim\ht\textflowcollector{#1}>\vsize + \setbox\scratchbox\vsplit\textflowcollector{#1} to \vsize + \unvbox\scratchbox + \else + \unvbox\textflowcollector{#1}% + \fi}} + +\protect \endinput + +% Example (dutch) +% +% \stelpapierformaatin [S6] +% \steltolerantiein [soepel,rek] +% \stelkleurenin [status=start] +% \stelvoetin [strut=nee] +% \stelwitruimtein [groot] +% +% \stellayoutin +% [rechterrand=5cm,breedte=passend,marge=0pt,randafstand=1cm, +% voet=4cm,voetafstand=1cm,hoofd=0cm] +% +% \stelteksttekstenin[rand][][\vbox{\flushtextflow{alpha}}] +% \stelvoettekstenin [rand][][\vbox{\flushtextflow{beta}}] +% \stelvoettekstenin [\vbox{\flushtextflow{gamma}}][] +% +% \definetextflow [alfa] [breedte=\rechterrandbreedte] +% \definetextflow [beta] [breedte=\rechterrandbreedte] +% \definetextflow [gamma] [breedte=\voethoogte] +% +% \starttekst +% +% \dorecurse{50} +% {\getrandomnumber{\funny}{0}{8} +% \ifcase\funny \starttextflow[alfa] \input tufte.tex \stoptextflow +% \or \starttextflow[beta] \input knuth.tex \stoptextflow +% \or \starttextflow[gamma] \input materie.tex \stoptextflow +% \or {\bf TUFTE}\quad \input tufte \par +% \or {\bf TUFTE}\quad \input tufte \par +% \or {\bf KNUTH}\quad \input knuth \par +% \or {\bf KNUTH}\quad \input knuth \par +% \or {\bf MATERIE}\quad \input materie \par +% \else {\bf MATERIE}\quad \input materie \par +% \fi} +% +% \stoptekst diff --git a/tex/context/base/page-flw.tex b/tex/context/base/page-flw.tex deleted file mode 100644 index 3eb867a78..000000000 --- a/tex/context/base/page-flw.tex +++ /dev/null @@ -1,107 +0,0 @@ -%D \module -%D [ file=page-flw, -%D version=2003.04.19, % from test-002 (1997) profile experiment -%D title=\CONTEXT\ Page Macros, -%D subtitle=Text Flows, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Text Flows} - -%D This is high experimental and especially flushing may change (proper -%D spacing is the driving force here). - -\unprotect - -\def\definetextflow - {\dodoubleempty\dodefinetextflow} - -\def\dodefinetextflow[#1][#2]% flow settings - {\iffirstargument - \doiftextflowcollectorelse{#1} - {\setbox\textflowcollector{#1}\emptybox} - {\@EA\newbox\csname\??tx:c:#1\endcsname}% - \getparameters[\??tx:p:#1] - [\c!width=\hsize,\c!style=,#2]% - \fi} - -\def\textflowparameter#1#2{\csname\??tx:p:#1#2\endcsname} -\def\textflowcollector #1{\csname\??tx:c:#1\endcsname} - -\def\doiftextflowcollectorelse#1{\doifdefinedelse{\??tx:c:#1}} - -\def\doiftextflowelse#1% - {\doiftextflowcollectorelse{#1} - {\ifvoid\textflowcollector{#1}% - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} - {\secondoftwoarguments}} - -\def\doiftextflow#1% - {\doiftextflowelse{#1}\firstofoneargument\gobbleoneargument} - -\def\starttextflow[#1]% - {\doiftextflowcollectorelse{#1} - {\global\setbox\textflowcollector{#1}\vbox - \bgroup - \unvbox\textflowcollector{#1}% - \hsize\textflowparameter{#1}\c!width - \doifsomething{\textflowparameter{#1}\c!style}% - {\doconvertfont{\textflowparameter{#1}\c!style}}% - \def\stoptextflow{\endgraf\egroup}} - {\let\stoptextflow\relax}} - -\def\flushtextflow#1% - {\doiftextflow{#1} - {\ifdim\ht\textflowcollector{#1}>\vsize - \setbox\scratchbox\vsplit\textflowcollector{#1} to \vsize - \unvbox\scratchbox - \else - \unvbox\textflowcollector{#1}% - \fi}} - -\protect \endinput - -% Example (dutch) -% -% \stelpapierformaatin [S6] -% \steltolerantiein [soepel,rek] -% \stelkleurenin [status=start] -% \stelvoetin [strut=nee] -% \stelwitruimtein [groot] -% -% \stellayoutin -% [rechterrand=5cm,breedte=passend,marge=0pt,randafstand=1cm, -% voet=4cm,voetafstand=1cm,hoofd=0cm] -% -% \stelteksttekstenin[rand][][\vbox{\flushtextflow{alpha}}] -% \stelvoettekstenin [rand][][\vbox{\flushtextflow{beta}}] -% \stelvoettekstenin [\vbox{\flushtextflow{gamma}}][] -% -% \definetextflow [alfa] [breedte=\rechterrandbreedte] -% \definetextflow [beta] [breedte=\rechterrandbreedte] -% \definetextflow [gamma] [breedte=\voethoogte] -% -% \starttekst -% -% \dorecurse{50} -% {\getrandomnumber{\funny}{0}{8} -% \ifcase\funny \starttextflow[alfa] \input tufte.tex \stoptextflow -% \or \starttextflow[beta] \input knuth.tex \stoptextflow -% \or \starttextflow[gamma] \input materie.tex \stoptextflow -% \or {\bf TUFTE}\quad \input tufte \par -% \or {\bf TUFTE}\quad \input tufte \par -% \or {\bf KNUTH}\quad \input knuth \par -% \or {\bf KNUTH}\quad \input knuth \par -% \or {\bf MATERIE}\quad \input materie \par -% \else {\bf MATERIE}\quad \input materie \par -% \fi} -% -% \stoptekst diff --git a/tex/context/base/page-imp.mkii b/tex/context/base/page-imp.mkii new file mode 100644 index 000000000..e4ece04a6 --- /dev/null +++ b/tex/context/base/page-imp.mkii @@ -0,0 +1,1314 @@ +%D \module +%D [ file=page-imp, % was: core-pag, +%D version=1998.01.15, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Pagebody Building (Imposition), +%D author=Hans Hagen, +%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. + +% much of this can more to run time loading ! + +\writestatus{loading}{ConTeXt Page Macros / Pagebody Building} + +\unprotect + +% sizing bug: +% +% \setuppapersize[A4][A4,landscape] \setuparranging[2UP] \showframe +% +% \starttext \dorecurse{10}{\input tufte \par} \stoptext + +% to be moved code: + +\newif\ifclipprintbox \clipprintboxtrue +%newif\ifclippagebox \clippageboxtrue + +\def\clippedprintbox#1#2% can be made more efficient, see other clipper + {\ifclipprintbox + \!!widthc \pagebackgroundoffset + \!!widtha \dimexpr\paperwidth + \!!widthc\relax + \!!heighta\dimexpr\paperheight+2\!!widthc\relax + \setbox#2\vbox to \paperheight{\vfill\box#2}% + \ht#2\paperheight + \wd#2\paperwidth + \setbox#2\vbox + {\framed + [\c!offset=\!!widthc,\c!strut=\v!no,\c!frame=\v!off] + {\box#2}}% + \setbox#2\hbox to \paperwidth + {\ifcase#1\relax + \!!widthb\zeropoint + \hskip-\!!widthc + \else + \!!widthb\!!widthc + \fi + \lower\!!widthc\hbox + {\clip + [\c!width=\!!widtha,\c!height=\!!heighta, + \c!hoffset=\!!widthb,\c!voffset=\zeropoint] + {\box#2}}}% + \wd#2\paperwidth + \ht#2\paperheight + \fi + \box#2\relax} + +\let\clippagebox \gobbleoneargument +\let\clipprintbox\gobbleoneargument + +% \setuppagenumbering[alternative=doublesided] +% \setupcolors[state=start] +% \setuppapersize[A4][A4,oversized] +% \setuplayout[location=middle,clipoffset=5mm] +% \setupbackgrounds +% [page] +% [frame=on,rulethickness=1mm, +% backgroundoffset=10mm,background=color,backgroundcolor=red] +% \starttext \dorecurse{10}{\input tufte \par} \stoptext + +\def\clippagebox#1% + {\ifdim\@@lyclipoffset>\zeropoint + \!!widtha \wd#1% + \!!heighta\ht#1% + \!!deptha \dp#1% + \setbox#1\hbox + {\!!widthb \@@lyclipoffset + \advance\!!heighta\dimexpr\!!deptha+2\!!widthb\relax + \advance\!!widtha \!!widthb + \doifbothsides + {\advance\!!widtha\!!widthb \!!widthc-\!!widthb \hskip\!!widthc}% + {\!!widthc\zeropoint} + {\!!widthc-\!!widthb \hskip\!!widthc}% + \lower\!!widthb\hbox + {\clip + [\c!hoffset=\!!widthc, + \c!voffset=-\!!widthb, + \c!width=\!!widtha, + \c!height=\!!heighta]% + {\box#1}}}% + \wd#1\!!widtha + \ht#1\!!heighta + \dp#1\!!deptha + \fi} + +%D \macros +%D {starttextdata} +%D +%D This is a user macro (appending to every last shipout is not +%D really user friendly. + +\newtoks \collectedtextdata + +\long\def\starttextdata#1\stoptextdata + {\doglobal\appendtoks#1\to\collectedtextdata} + +\def\flushtextdata + {\vsmashed{\the\collectedtextdata}% all dimensions zero + \global\collectedtextdata\emptytoks + \globallet\flushtextdata\donothing} + +\prependtoks \flushtextdata \to \everylastshipout + +% moved code: + +% \def\myshipout#1% +% {\beforeshipout % voor de pagebody dus ! +% \dontshowcomposition +% \ifarrangingpages\@EA\actualarrange\else\@EA\actualshipout\fi +% {\thisisrealpage\realfolio#1}% +% \gotonextrealpage +% \aftershipout} + +\def\installpagehandler#1#2% % a handler takes one argument: something to be boxed + {\setvalue{\??pp:\c!method:#1}{#2}} % and shipped out (don't depend on the exact package) + +\installpagehandler\v!normal + {\ifarrangingpages\expandafter\actualarrange\else\expandafter\actualshipout\fi} + +\def\myshipout#1% + {\beforeshipout % voor de pagebody dus ! + \dontshowcomposition + \executeifdefined{\??pp:\c!method:\@@ppmethod}\gobbleoneargument{\thisisrealpage\realfolio#1}% + \gotonextrealpage + \aftershipout} + +\newbox\postponedcontent + +% \def\flushatshipout +% {\dowithnextbox +% {\global\setbox\postponedcontent\hbox to \zeropoint +% {%\hskip-\maxdimen % niet hier, gaat mis in acrobat (clipt) +% \box\postponedcontent\flushnextbox}% +% \global\ht\postponedcontent\zeropoint +% \global\dp\postponedcontent\zeropoint +% \global\wd\postponedcontent\zeropoint}% +% \hbox} + +\def\flushatshipout + {\dowithnextbox + {\global\setbox\postponedcontent\hbox to \zeropoint + {%\hskip-\maxdimen % niet hier, gaat mis in acrobat (clipt) + \unhbox\postponedcontent\unhbox\nextbox}% + \global\ht\postponedcontent\zeropoint + \global\dp\postponedcontent\zeropoint + \global\wd\postponedcontent\zeropoint}% + \hbox} + +% \starttypen +% \def\pagestoshipout{1,3,5} +% \stoptypen + +\newcount\shippedoutpages + +\let\pagestoshipout\empty % {1,3,6} +\chardef\whichpagetoshipout=0 % 0=all 1=odd 2=even + +\ifx\finalizeshipoutbox\undefined \let\finalizeshipoutbox\firstofoneargument \fi + +\def\actualshipout#1% + {\global\advance\shippedoutpages\plusone + % this is not resource safe! + \ifx\pagestoshipout\empty + \ifcase\whichpagetoshipout\relax + \donetrue + \or % 1 + \ifodd\shippedoutpages\relax\donetrue\else\donefalse\fi + \or % 2 + \ifodd\shippedoutpages\relax\donefalse\else\donetrue\fi + \else + \donetrue + \fi + \else % testen, aangepast / expanded nodig ? + \expanded{\doifinsetelse{\the\shippedoutpages}{\pagestoshipout}}% + \donetrue\donefalse + \fi + \ifdone + \shipout\vbox + {\forgetall + \offinterlineskip + \dontcomplain + \scratchdimen-1in + \vskip\scratchdimen + \hskip\scratchdimen + \hbox % \setbox0=\box.. is nicer + {\setbox0\hbox{\finalizeshipoutbox{#1}}% just in case there are objects there, hook for testing + \setbox\scratchbox\hbox + {% before the main one ! + \ifcase\realfolio \or + \the\everyfirstshipout + \global\everyfirstshipout\emptytoks + \fi + % the main one + \the\everyshipout\relax + % always last (and after the main one) + \ifnum\realpageno=\lastpage\relax + \the\everylastshipout + \global\everylastshipout\emptytoks + \fi}% + \smashbox\scratchbox + \box\scratchbox + \box\postponedcontent % evt ver naar links ! + \box0}}% + \else + \message + {[\ifarrangingpages arranged \fi page + \ifarrangingpages\the\arrangeno\else\the\realpageno\fi\normalspace + not flushed]}% + \setbox0\hbox{#1}% + \deadcycles\zerocount + \fi} + +\def\actualarrange#1% + {\setbox0\hbox{\thisisrealpage{\realfolio}#1}% + \pusharrangedpage0% + \deadcycles\zerocount} + +%D We need a couple of boxes for duplex printing \unknown + +\newbox\arrangedpageA \newbox\arrangedpageB + +%D \unknown\ and some for simulating big sheets. + +\newbox\arrangedpageC \newbox\arrangedpageD +\newbox\arrangedpageE \newbox\arrangedpageF +\newbox\arrangedpageG \newbox\arrangedpageH + +\newif\ifswaparranged +\newif\ifnegatearranged +\newif\ifmirrorarranged +\newif\ifdoublearranged + +\newif\ifarrangingdisabled + +\def\arrangedrotationO{0} +\def\arrangedrotationE{0} + +\newcounter\arrangedpageN +\newcounter\arrangedpageM + +\chardef\arrangedpageT=1 +\chardef\arrangedpageX=1 +\chardef\arrangedpageY=1 + +\def\calculatepaperoffsets#1% + {\scratchdimen\getvalue{\??pp#1\c!offset}% + \divide\scratchdimen \arrangedpageX + \global\advance\paperwidth -2\scratchdimen + \scratchdimen\getvalue{\??pp#1\c!offset}% + \divide\scratchdimen \arrangedpageY + \global\advance\paperheight-2\scratchdimen} + +\newconditional\arrangedbackgroundokay % more ifs -> conditionals + +\def\setuparranging[#1]% + {\ifarrangingdisabled \else + \doifelse{#1}\v!disable + {\global\arrangingdisabledtrue} + {\global\arrangingdisabledfalse}% + \global\arrangingpagestrue + \global\negatearrangedfalse + \global\mirrorarrangedfalse + \global\doublearrangedfalse + \gdef\arrangedrotationO{0}% + \gdef\arrangedrotationE{180}% + \processallactionsinset + [#1] + [ \v!mirrored=>\global\mirrorarrangedtrue, + \v!doublesided=>\global\doublearrangedtrue, + \v!negative=>\global\negatearrangedtrue, + \v!rotated=>\gdef\arrangedrotationO {90}\gdef\arrangedrotationE{270}, + 90=>\gdef\arrangedrotationO {90}\gdef\arrangedrotationE{270}, + 180=>\gdef\arrangedrotationO{180}\gdef\arrangedrotationE{0}, + 270=>\gdef\arrangedrotationO{270}\gdef\arrangedrotationE{90}, + \s!reset=>\global\arrangingpagesfalse, + \v!background=>\global\settrue\arrangedbackgroundokay, + \s!unknown=>\checkinstalledpagearrangement\commalistelement]% + % no \s!default=> we can have aaa,,bbb + \ifx\handlearrangedpage\undefined + \global\arrangingpagesfalse + \fi + \doifcommonelse{#1}{90,270,\v!rotated} + {\swapmacros\horizontalcutmarks\verticalcutmarks}{}% ugly solution + \setuppapersize + \ifarrangingpages + \abortutilitygeneration + \fi + \fi} + +\def\installpagearrangement #1 % + {\setgvalue{\??pp\??pp#1}} + +\def\checkinstalledpagearrangement#1% can be empty: aaa,,bbb + {\executeifdefined{\??pp\??pp#1}\donothing} + +\def\dosetuparrangement#1#2#3#4#5#6#7#8% + {\global\chardef\arrangedpageX #1% + \global\chardef\arrangedpageY #2% + \global\chardef\arrangedpageT #3% + \global\chardef\horizontalcutmarks#4% + \global\chardef\verticalcutmarks #5% + \global\let \pusharrangedpage #6% + \global\let \poparrangedpages #7% + \global\let \handlearrangedpage#8} + +\installpagearrangement {\v!normal} + {\global\arrangingpagesfalse} + +\installpagearrangement 2*16 + {\dosetuparrangement{4}{4}{16}{5}{5}% + \pusharrangedpageTHIRTYTWO\poparrangedpagesAB\relax} + +\installpagearrangement 2*8 + {\dosetuparrangement{4}{2}{8}{5}{3}% + \pusharrangedpageSIXTEEN\poparrangedpagesAB\relax} + +\installpagearrangement 2*4 + {\dosetuparrangement{2}{2}{4}{3}{3}% + \pusharrangedpageEIGHT\poparrangedpagesAB\relax} + +\installpagearrangement 2*2 + {\dosetuparrangement{2}{1}{2}{3}{2}% + \pusharrangedpageFOURA\poparrangedpagesAB\relax} + +\installpagearrangement 2**2 + {\dosetuparrangement{2}{1}{2}{3}{2}% + \pusharrangedpageFOURB\poparrangedpagesAB\relax} + +\installpagearrangement 2SIDE + {\dosetuparrangement{2}{1}{2}{3}{2}% + \pusharrangedpageSIDETOP\poparrangedpagesTWO\handlearrangedpageSIDE} + +\installpagearrangement 2TOP + {\dosetuparrangement{1}{2}{2}{2}{3}% + \pusharrangedpageSIDETOP\poparrangedpagesTWO\handlearrangedpageTOP} + +\installpagearrangement 2UP + {\dosetuparrangement{2}{1}{4}{3}{2}% + \pusharrangedpageTWO\poparrangedpagesTWO\handlearrangedpageTWOUP} + +\installpagearrangement 2DOWN + {\dosetuparrangement{1}{2}{4}{2}{3}% + \pusharrangedpageTWO\poparrangedpagesTWO\handlearrangedpageTWODOWN} + +\installpagearrangement 2*4*2 % one defined by Willy Egger: + {\dosetuparrangement{2}{2}{4}{3}{2}% + \pusharrangedpageSIXTEENTWO\poparrangedpagesAtoD\relax} + +\installpagearrangement 2*2*4 % onother one of Willy Egger + {\dosetuparrangement{2}{1}{8}{3}{2}% + \pusharrangedpageSIXTEENFOUR\poparrangedpagesAtoH\relax} + +\installpagearrangement 2TOPSIDE + {\dosetuparrangement{1}{2}{4}{2}{3}% + \pusharrangedpageTWOTOPSIDE\poparrangedpagesTWOTOPSIDE\handlearrangedpageTOP} + +% \def\filluparrangedpages % beware: \realpageno is 1 ahead +% {\ifarrangingpages +% \scratchcounter-\realpageno +% \divide\scratchcounter \arrangedpageT +% \multiply\scratchcounter \arrangedpageT +% \advance\scratchcounter \realpageno +% \advance\scratchcounter \minusone +% \dorecurse\scratchcounter{\noheaderandfooterlines\ejectdummypage}% +% \fi} + +\def\filluparrangedpages % beware: \realpageno is 1 ahead + {\ifarrangingpages + \scratchcounter\numexpr\realpageno-\plusone\relax + \dosetmodulo\scratchcounter\arrangedpageT\scratchcounter + \ifcase\scratchcounter\else + \advance\scratchcounter \plusone + \dostepwiserecurse\scratchcounter\arrangedpageT\plusone + {\noheaderandfooterlines\ejectdummypage}% + \fi + \fi} + +\def\handlearrangedpageXandY#1#2#3#4#5% + {\global\setbox#5\hbox to \arrangedpageX\paperwidth + {\setbox\scratchbox\vbox to \arrangedpageY\paperheight + {\forgetall + \offinterlineskip + \dontcomplain + \vskip#4\paperheight + \hskip#3\paperwidth + \dorotatebox{\ifcase#2 0\else180\fi}\hbox{\box#1}% + \vfill}% + \wd\scratchbox\zeropoint + \box\scratchbox\box#5\hss}} + +\def\gotonextarrangepage + {\global\advance\arrangeno \plusone + \def\pagecutmarksymbol{\the\arrangeno}} + +\def\outputarrangedbox#1% + {\bgroup + \gotonextarrangepage + \ifnum\arrangedrotationO\arrangedrotationE>\zerocount + \setbox#1\vbox + {\ifdoublearranged + \ifodd\arrangeno + \dorotatebox\arrangedrotationO\hbox{\box#1}% + \else + \dorotatebox\arrangedrotationE\hbox{\box#1}% + \fi + \else + \dorotatebox\arrangedrotationO\hbox{\box#1}% + \fi}% + \fi + \ifmirrorarranged + \setbox#1\vbox{\domirrorbox\vbox{\box#1}}% + \fi + \ifnegatearranged + \negatecolorbox{#1}% + \fi + \finishpagebox#1% + \ifconditional\arrangedbackgroundokay\addprintbackground#1\fi + \actualshipout{\box#1}% + \egroup} + +%D The format file can be 16K smaller when we postpone the +%D real arrangments. Some day ... + +% TOP + +% 32/16/8/4/SIDE + +\def\poparrangedpagesAB + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \paperwidth\arrangedpageX\paperwidth + \paperheight\arrangedpageY\paperheight + \outputarrangedbox\arrangedpageA + \outputarrangedbox\arrangedpageB + \doglobal\newcounter\arrangedpageN + \fi} + +\def\pusharrangedpageTHIRTYTWO#1% taco's challenge + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}033\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}003\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}100\arrangedpageB % 3 + \or \handlearrangedpageXandY{#1}130\arrangedpageA % 4 + \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5 + \or \handlearrangedpageXandY{#1}130\arrangedpageB % 6 + \or \handlearrangedpageXandY{#1}033\arrangedpageB % 7 + \or \handlearrangedpageXandY{#1}003\arrangedpageA % 8 + \or \handlearrangedpageXandY{#1}102\arrangedpageA % 9 + \or \handlearrangedpageXandY{#1}132\arrangedpageB % 10 + \or \handlearrangedpageXandY{#1}031\arrangedpageB % 11 + \or \handlearrangedpageXandY{#1}001\arrangedpageA % 12 + \or \handlearrangedpageXandY{#1}031\arrangedpageA % 13 + \or \handlearrangedpageXandY{#1}001\arrangedpageB % 14 + \or \handlearrangedpageXandY{#1}102\arrangedpageB % 15 + \or \handlearrangedpageXandY{#1}132\arrangedpageA % 16 + \or \handlearrangedpageXandY{#1}122\arrangedpageA % 17 + \or \handlearrangedpageXandY{#1}112\arrangedpageB % 18 + \or \handlearrangedpageXandY{#1}011\arrangedpageB % 19 + \or \handlearrangedpageXandY{#1}021\arrangedpageA % 20 + \or \handlearrangedpageXandY{#1}011\arrangedpageA % 21 + \or \handlearrangedpageXandY{#1}021\arrangedpageB % 22 + \or \handlearrangedpageXandY{#1}122\arrangedpageB % 23 + \or \handlearrangedpageXandY{#1}112\arrangedpageA % 24 + \or \handlearrangedpageXandY{#1}013\arrangedpageA % 25 + \or \handlearrangedpageXandY{#1}023\arrangedpageB % 26 + \or \handlearrangedpageXandY{#1}120\arrangedpageB % 27 + \or \handlearrangedpageXandY{#1}110\arrangedpageA % 28 + \or \handlearrangedpageXandY{#1}120\arrangedpageA % 29 + \or \handlearrangedpageXandY{#1}110\arrangedpageB % 30 + \or \handlearrangedpageXandY{#1}013\arrangedpageB % 31 + \or \handlearrangedpageXandY{#1}023\arrangedpageA % 32 + \poparrangedpages + \fi} + +\def\pusharrangedpageSIXTEEN#1% changed to match the official way of doing + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}031\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}031\arrangedpageB % 3 + \or \handlearrangedpageXandY{#1}001\arrangedpageA % 4 + \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5 + \or \handlearrangedpageXandY{#1}130\arrangedpageB % 6 + \or \handlearrangedpageXandY{#1}100\arrangedpageB % 7 + \or \handlearrangedpageXandY{#1}130\arrangedpageA % 8 + \or \handlearrangedpageXandY{#1}120\arrangedpageA % 9 + \or \handlearrangedpageXandY{#1}110\arrangedpageB % 10 + \or \handlearrangedpageXandY{#1}120\arrangedpageB % 11 + \or \handlearrangedpageXandY{#1}110\arrangedpageA % 12 + \or \handlearrangedpageXandY{#1}011\arrangedpageA % 13 + \or \handlearrangedpageXandY{#1}021\arrangedpageB % 14 + \or \handlearrangedpageXandY{#1}011\arrangedpageB % 15 + \or \handlearrangedpageXandY{#1}021\arrangedpageA % 16 + \poparrangedpages + \fi} + +\def\pusharrangedpageEIGHT#1% changed to match the official way of doing + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}011\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}100\arrangedpageB % 3 + \or \handlearrangedpageXandY{#1}110\arrangedpageA % 4 + \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5 + \or \handlearrangedpageXandY{#1}110\arrangedpageB % 6 + \or \handlearrangedpageXandY{#1}011\arrangedpageB % 7 + \or \handlearrangedpageXandY{#1}001\arrangedpageA % 8 + \poparrangedpages + \fi} + +\def\pusharrangedpageFOURA{\pusharrangedpageFOURdo01} +\def\pusharrangedpageFOURB{\pusharrangedpageFOURdo10} + +\def\pusharrangedpageFOURdo#1#2#3% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#3}010\arrangedpageA % 1 + \or \handlearrangedpageXandY{#3}0{#1}0\arrangedpageB % 2/3 not {1} + \or \handlearrangedpageXandY{#3}0{#2}0\arrangedpageB % 3/2 not {1} + \or \handlearrangedpageXandY{#3}000\arrangedpageA % 4 + \poparrangedpages + \fi} + +\def\pusharrangedpageSIDETOP#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2 + \poparrangedpages + \fi} + +\def\handlearrangedpageSIDE + {\global\wd\arrangedpageA\paperwidth + \global\wd\arrangedpageB\paperwidth + \global\setbox\arrangedpageA\hbox + {\box\arrangedpageA\box\arrangedpageB}% + \global\ht\arrangedpageA\paperheight} + +\def\handlearrangedpageTOP + {\global\ht\arrangedpageA\paperheight + \global\ht\arrangedpageB\paperheight + \global\setbox\arrangedpageA\vbox + {\forgetall\offinterlineskip\vskip\paperheight + \box\arrangedpageA\box\arrangedpageB}% + \global\setbox\arrangedpageB\box\scratchbox} % ? + +% 2UP/2DOWN / 1pt prevents overflow + +\def\splitoffarrangedpagesTWO + {\splittopskip\zeropoint + \global\setbox\arrangedpageA\vsplit\arrangedpageB to \onepoint + \scratchdimen\dimexpr\ht\arrangedpageB-\onepoint\relax + \ifdim\scratchdimen>\onepoint + \setbox\scratchbox\vsplit\arrangedpageB to \scratchdimen + \fi} + +\def\handlearrangedpageTWOUP + {\splitoffarrangedpagesTWO + \ifswaparranged + \global\setbox\arrangedpageA\hbox + {\clippedprintbox0\arrangedpageA + \clippedprintbox1\arrangedpageB}% + \swaparrangedfalse + \else + \global\setbox\arrangedpageA\hbox + {\clippedprintbox0\arrangedpageB + \clippedprintbox1\arrangedpageA}% + \swaparrangedtrue + \fi + \global\ht\arrangedpageA\paperheight + \global\setbox\arrangedpageB\box\scratchbox} + +\def\handlearrangedpageTWODOWN + {\splitoffarrangedpagesTWO + \global\ht\arrangedpageA\paperheight + \global\ht\arrangedpageB\paperheight + \ifswaparranged + \global\setbox\arrangedpageA\vbox + {\forgetall\offinterlineskip\vskip\paperheight + \box\arrangedpageA\box\arrangedpageB}% + \swaparrangedfalse + \else + \global\setbox\arrangedpageA\vbox + {\forgetall\offinterlineskip\vskip\paperheight + \box\arrangedpageB\box\arrangedpageA}% + \swaparrangedtrue + \fi + \global\setbox\arrangedpageB\box\scratchbox} + +\def\poparrangedpagesTWO + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \swaparrangedfalse + \doloop + {\handlearrangedpage + \bgroup + \paperwidth\arrangedpageX\paperwidth + \paperheight\arrangedpageY\paperheight + \ht\arrangedpageA\paperheight + \wd\arrangedpageA\paperwidth + \outputarrangedbox\arrangedpageA + \egroup + \ifdim\ht\arrangedpageB=\zeropoint + \exitloop + \fi}% + \doglobal\newcounter\arrangedpageN + \fi} + +\def\pusharrangedpageTWO#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \global\setbox\arrangedpageB\vbox + {\forgetall + \offinterlineskip + \unvbox\arrangedpageB + \allowbreak + \ht#1\onepoint + \dp#1\zeropoint + \vbox{\box#1}}} + +\def\poparrangedpagesTWOTOPSIDE + {\ifnum\arrangedpageN>\zerocount + \bgroup + \gdef\arrangedpageN{2}\poparrangedpagesTWO + \let\arrangedpageA\arrangedpageC + \let\arrangedpageB\arrangedpageD + \gdef\arrangedpageN{2}\poparrangedpagesTWO + \doglobal\newcounter\arrangedpageN + \egroup + \fi} + +\def\pusharrangedpageTWOTOPSIDE#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}000\arrangedpageC % 2 + \or \handlearrangedpageXandY{#1}000\arrangedpageB % 1 + \or \handlearrangedpageXandY{#1}000\arrangedpageD % 2 + \poparrangedpages + \fi} + +%D Willy Egger's sheet simulations: + +\def\poparrangedpagesAtoH + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \paperwidth\arrangedpageX\paperwidth + \paperheight\arrangedpageY\paperheight + \outputarrangedbox\arrangedpageA + \outputarrangedbox\arrangedpageB + \outputarrangedbox\arrangedpageC + \outputarrangedbox\arrangedpageD + \outputarrangedbox\arrangedpageE + \outputarrangedbox\arrangedpageF + \outputarrangedbox\arrangedpageG + \outputarrangedbox\arrangedpageH + \doglobal\newcounter\arrangedpageN + \fi} + +% to arrange 16 pages on 2 sheets to form one booklet + +\def\poparrangedpagesAtoD + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \paperwidth\arrangedpageX\paperwidth + \paperheight\arrangedpageY\paperheight + \outputarrangedbox\arrangedpageA + \outputarrangedbox\arrangedpageB + \outputarrangedbox\arrangedpageC + \outputarrangedbox\arrangedpageD + \doglobal\newcounter\arrangedpageN + \fi} + +% to arrange 16 pages on 4 sheets to form one booklet + +\def\pusharrangedpageSIXTEENFOUR#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}010\arrangedpageC % 3 + \or \handlearrangedpageXandY{#1}000\arrangedpageD % 4 + \or \handlearrangedpageXandY{#1}010\arrangedpageE % 5 + \or \handlearrangedpageXandY{#1}000\arrangedpageF % 6 + \or \handlearrangedpageXandY{#1}010\arrangedpageG % 7 + \or \handlearrangedpageXandY{#1}000\arrangedpageH % 8 + \or \handlearrangedpageXandY{#1}010\arrangedpageH % 9 + \or \handlearrangedpageXandY{#1}000\arrangedpageG % 10 + \or \handlearrangedpageXandY{#1}010\arrangedpageF % 11 + \or \handlearrangedpageXandY{#1}000\arrangedpageE % 12 + \or \handlearrangedpageXandY{#1}010\arrangedpageD % 13 + \or \handlearrangedpageXandY{#1}000\arrangedpageC % 14 + \or \handlearrangedpageXandY{#1}010\arrangedpageB % 15 + \or \handlearrangedpageXandY{#1}000\arrangedpageA % 16 + \poparrangedpages + \fi} + +% to arrange 16 pages on 2 sheets to form one booklet + +\def\pusharrangedpageSIXTEENTWO#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}011\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}011\arrangedpageC % 3 + \or \handlearrangedpageXandY{#1}001\arrangedpageD % 4 + \or \handlearrangedpageXandY{#1}100\arrangedpageD % 5 + \or \handlearrangedpageXandY{#1}110\arrangedpageC % 6 + \or \handlearrangedpageXandY{#1}100\arrangedpageB % 7 + \or \handlearrangedpageXandY{#1}110\arrangedpageA % 8 + \or \handlearrangedpageXandY{#1}100\arrangedpageA % 9 + \or \handlearrangedpageXandY{#1}110\arrangedpageB % 10 + \or \handlearrangedpageXandY{#1}100\arrangedpageC % 11 + \or \handlearrangedpageXandY{#1}110\arrangedpageD % 12 + \or \handlearrangedpageXandY{#1}011\arrangedpageD % 13 + \or \handlearrangedpageXandY{#1}001\arrangedpageC % 14 + \or \handlearrangedpageXandY{#1}011\arrangedpageB % 15 + \or \handlearrangedpageXandY{#1}001\arrangedpageA % 16 + \poparrangedpages + \fi} + +% % handy for stickers etc, this way we can treat them as page +% +% \setuppapersize [XY][A4] +% \setuppaper [topspace=5mm,backspace=5mm,dx=1mm,dy=1mm,nx=2,ny=6] +% \setuplayout [page] [topspace=5mm,backspace=5mm] +% \setuplayout [page] +% \setuplayout [location=middle] +% \setuparranging [XY] +% \showframe +% +% \starttext \dorecurse{30}{test \recurselevel \page} \stoptext + +\def\pusharrangedpageXY#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \doglobal\increment\arrangedpageM + \global\setbox\arrangedpageB\hbox + \ifdim\@@ppwidth>\zeropoint to \@@ppwidth \fi + {\ifvoid\arrangedpageB\else + \unhbox\arrangedpageB + \ifdim\@@ppdx>\zeropoint \else \hss\fi + \hskip\@@ppdx + \ifdim\@@ppdx>\zeropoint \else \hss\fi + \fi + \box#1}% + \ifnum\arrangedpageM<\arrangedpageX\else + \global\setbox\arrangedpageA\vbox + \ifdim\@@ppheight>\zeropoint to \@@ppheight \fi + {\offinterlineskip + \ifvoid\arrangedpageA\else + \unvbox\arrangedpageA + \ifdim\@@ppdy>\zeropoint \else \vss\fi + \vskip\@@ppdy + \ifdim\@@ppdy>\zeropoint \else \vss\fi + \fi + \box\arrangedpageB}% + \doglobal\newcounter\arrangedpageM + \fi + \ifnum\arrangedpageN<\arrangedpageT\else + \poparrangedpages + \fi} + +\def\poparrangedpagesXY + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \paperwidth\arrangedpageX\paperwidth + \paperheight \arrangedpageY\paperheight + \outputarrangedbox\arrangedpageA + \doglobal\newcounter\arrangedpageN + \doglobal\newcounter\arrangedpageM + \fi} + +\installpagearrangement XY + {\dosetuparrangement\@@ppnx\@@ppny\@@ppxy\!!zerocount\!!zerocount + \pusharrangedpageXY\poparrangedpagesXY\relax} + +%D A crazy definition, don't guess who pushed me for the landscape option. + +\definepapersize + [XY] + [\c!height=\dimexpr\dimexpr\@@ppheight-\numexpr\@@ppny-1\relax\dimexpr\@@ppdy\relax\relax/\@@ppny\relax, + \c!width =\dimexpr\dimexpr\@@ppwidth -\numexpr\@@ppnx-1\relax\dimexpr\@@ppdx\relax\relax/\@@ppnx\relax] + +\setuppaper + [\c!width =\dimexpr\printpaperwidth -2\dimexpr\@@ppbackspace\relax\relax, + \c!height=\dimexpr\printpaperheight-2\dimexpr\@@pptopspace \relax\relax] + +% \definepageshift[test][horizontal][10pt,20pt,30pt,40pt,50pt] +% \definepageshift[test][vertical] [10pt,20pt,30pt,40pt,50pt] +% +% \setuppageshift[test] +% \setuppageshift[test][test] +% \setuppageshift[test][none] +% \setuppageshift[none][test] +% \setuppageshift[paper][test][test] % arrange only +% \setuppageshift[paper][test] % arrange only +% \setuppageshift[print][test][test] +% +% \showframe \dorecurse{100}{\input tufte \par} + +% #1=name #2=horizontal|vertical #3=shiftlist + +\def\definepageshift + {\dotripleargument\dodefinepageshift} + +\def\dodefinepageshift[#1][#2][#3]% + {\setvalue{\??pt#2:#1}{#3}} + +\letempty \hpageshifts \newcounter\nofhpageshifts +\letempty \vpageshifts \newcounter\nofvpageshifts + +% \let\shiftprintpagebox\gobbleoneargument +% \let\shiftpaperpagebox\gobbleoneargument + +\def\dogetpageshift#1#2#3% #1=\dimenx #2=\xpageshifts #3=\nofxpageshifts + {\ifx#2\empty + #1\zeropoint + \else + \doglobal\increment#3% + \getfromcommacommand[#2][#3]% + \ifx\commalistelement\empty + \globallet#3\!!plusone + \getfromcommacommand[#2][#3]% + \fi + \ifx\commalistelement\empty + #1\zeropoint + \else + #1=\commalistelement + \donetrue + \fi + \fi} + +\def\shiftpagebox#1% + {\donefalse + \dogetpageshift{\dimen0}\hpageshifts\nofhpageshifts + \dogetpageshift{\dimen2}\vpageshifts\nofvpageshifts + \ifdone % see also layout offsets, maybe \movebox + \edef\next{\wd#1\the\wd#1\ht#1\the\ht#1\dp#1\the\dp#1}% + \setbox#1\vbox % \forgetall already done + {\offinterlineskip\vskip\dimen2\hskip\dimen0\box#1}% + \next + \fi} + +\def\setuppageshift + {\dotripleempty\dosetuppageshift} + +\def\dosetuppageshift[#1][#2][#3]% page|paper horizontal vertical + {\ifthirdargument % paper=arrange + \let\hpageshifts\empty + \let\vpageshifts\empty + \let\shiftprintpagebox\gobbleoneargument + \let\shiftpaperpagebox\gobbleoneargument + \doifdefined{\??pt\v!horizontal:#2} + {\edef\hpageshifts{\getvalue{\??pt\v!horizontal:#2}}}% + \doifdefined{\??pt\v!vertical :#3} + {\edef\vpageshifts{\getvalue{\??pt\v!vertical :#3}}}% + \doif{#1}\v!page{\let\shiftprintpagebox\shiftpagebox}% + \doif{#1}\v!paper{\let\shiftpaperpagebox\shiftpagebox}% + \else\ifsecondargument + \doifinsetelse{#1}{\v!page,\v!paper} + {\setuppageshift[#1][#2][#2]} + {\setuppageshift[\v!page][#1][#2]}% + \else\iffirstargument + \setuppageshift[\v!page][#1][#1]% + \fi\fi\fi} + +%D One can (mis)use this mechanism, in close cooperation +%D with \PDFTEX\ to arrange pages of already produced files. +%D +%D \starttyping +%D \insertpages[file.pdf][1,3][n=30,width=18cm] +%D \stoptyping +%D +%D The pages are inserted in the text area, and even pages +%D are repositioned according to the width. In this example +%D empty pages are added after page 1 and 3. +%D +%D Selecting pages can be accomplished by: +%D +%D \starttyping +%D \filterpages[file.pdf][1,3,5][n=30,width=18cm] +%D \stoptyping +%D +%D One may pass \type {odd} or \type {even} instead of a +%D comma separated list. A third alternative is: +%D +%D \starttyping +%D \copypages[file.pdf][n=30,scale=950] +%D \stoptyping +%D +%D This macros inserts the page, according to the settings +%D provided. + +\def\insertpages + {\dotripleempty\doinsertpages} + +\def\doinsertpages[#1][#2][#3]% + {\doifassignmentelse{#2} + {\dodoinsertpages[#1][][#2]} + {\dodoinsertpages[#1][#2][#3]}} + +\def\dodoinsertpages[#1][#2][#3]% + {\bgroup + \dontcomplain + \getfiguredimensions[#1]% + \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]% + \doifinset0{#2}{\null\page}% + \dorecurse\@@ipn + {\dofilterpage{#1}\recurselevel + \doifinset\recurselevel{#2}{\null\page}}% + \egroup} + +\def\filterpages + {\dotripleempty\dofilterpages} + +\def\dofilterpages[#1][#2][#3]% % \noffigurepages not yet supported + {\bgroup + \dontcomplain + \getfiguredimensions[#1]% + \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]% + \doifelse{#2}\v!even + {\dorecurse\@@ipn + {\ifodd\recurselevel\relax\else\dofilterpage{#1}\recurselevel\fi}} + {\doifelse{#2}\v!odd + {\dorecurse\@@ipn + {\ifodd\recurselevel\relax\dofilterpage{#1}\recurselevel\fi}} + {\def\dodocommand##1% + {\ifnum##1>\@@ipn\else\dofilterpage{#1}{##1}\fi}% + \def\docommand##1% + {\dowithrange{##1}\dodocommand}% + \processcommalist[#2]\docommand}}% + \egroup} + +\def\dofilterpage#1#2% + {\hbox to \textwidth + {\ifdoublesided\ifdim\@@ipwidth>\zeropoint\relax\ifodd\realpageno\else + \hfill + \def\dowithfigure{\hskip-\@@ipwidth}% + \fi\fi\fi + \setbox0\hbox + {\externalfigure[#1][\c!page=#2,\c!height=\textheight]}% + \wd0\zeropoint + \box0} + \page} + +\def\copypages + {\dodoubleempty\docopypages} + +\def\docopypages[#1][#2]% + {\bgroup + \getfiguredimensions[#1]% + \getparameters[\??ip] + [\c!n=\noffigurepages, + \c!marking=\v!off, + \c!scale=\!!thousand, + \c!offset=\!!zeropoint, + #2]% + \dorecurse\@@ipn + {\vbox to \textheight + {\hsize\textwidth + \scratchdimen\@@ipoffset + \centeredbox + {\doifelse\@@ipmarking\v!on\cuthbox\hbox + {\ifdim\scratchdimen>\zeropoint\relax + \advance\vsize -2\scratchdimen + \advance\hsize -2\scratchdimen + \externalfigure[#1][\c!page=\recurselevel,#2,\c!scale=,\c!factor=\v!max,\c!offset=\v!overlay]% + \else + \externalfigure[#1][\c!page=\recurselevel,#2,\c!offset=\v!overlay]% + \fi}}} + \page} + \egroup} + +%D \macros +%D {combinepages} +%D +%D Yet another way of postprocessing is handles by \type +%D {\combinepages}. This macro builds a matrix of pages from a +%D file, for example: +%D +%D \starttyping +%D \setuppapersize +%D [A4][A4] % or [A4,landscape][A4,landscape] +%D +%D \setuplayout +%D [header=0pt,footer=1cm, +%D backspace=1cm,topspace=1cm, +%D width=middle,height=middle] +%D +%D \setupfootertexts +%D [presentation---\currentdate\space---\space\pagenumber] +%D +%D \starttext +%D \combinepages[slides][nx=2,ny=3,frame=on] +%D \stoptext +%D \stoptyping +%D +%D One can influence the way the pages are combined. (This +%D will be explained some time.) + +\def\combinepages + {\dodoubleempty\docombinepages} + +\def\docombinepages[#1][#2]% a=perpag b=free + {\bgroup + \dontcomplain + \getfiguredimensions[#1]% + \getparameters + [\??ip] + [\c!alternative=\v!a, + \c!n=\noffigurepages,\c!nx=2,\c!ny=2,\c!start=1,\c!stop=\!!maxcard, + \c!distance=\bodyfontsize, + \c!bottom=\vfill,\c!top=\vss, + \c!left=\hss,\c!right=\hss, + \c!before=\page,\c!after=\page,\c!inbetween=\blank, + \c!frame=,\c!background=,\c!backgroundcolor=, + #2]% + \def\@@ipname{#1}% + \@@ipbefore + \executeifdefined{\strippedcsname\docombinepages\@@ipalternative}\docombinepagesb + \@@ipafter + \egroup} + +\def\docombinepagesa + {\globallet\combinedpagescounter\@@ipstart + \doloop + {\vbox to \textheight + {\hsize\textwidth % ? ? + \scratchdimen\@@ipdistance + \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax + \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax + \dorecurse\@@ipny + {\hbox to \hsize + {\dorecurse\@@ipnx + {\vbox to \!!heighta + {\hsize\!!widtha + \vsize\!!heighta + \@@iptop + \hbox to \hsize + {\@@ipleft + \ifnum\combinedpagescounter>\@@ipstop\relax + \globallet\@@ipn\!!zerocount + \else\ifnum\combinedpagescounter>\@@ipn \else + \externalfigure[\@@ipname] + [\c!object=\v!no, + \c!page=\combinedpagescounter, + \c!factor=\v!max, + \c!background=\@@ipbackground, + \c!backgroundcolor=\@@ipbackgroundcolor, + \c!frame=\@@ipframe]% + \fi\fi + \@@ipright} + \@@ipbottom}% + \doglobal\increment\combinedpagescounter + \hfil}% + \hfilneg} + \vfil}% + \vfilneg}% + \page + \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}} + +\def\docombinepagesc + {\globallet\combinedpagescounter\@@ipstart + \doloop + {\vbox to \textheight + {\hsize\textwidth % ? ? + \scratchdimen\@@ipdistance + \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax + \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax + \hbox to \hsize + {\dorecurse\@@ipnx + {\@@ipleft + \vbox to \textheight + {\hsize\!!widtha + {\dorecurse\@@ipny + {\@@iptop + \hbox to \hsize + {\vbox to \!!heighta + {\hsize\!!widtha + \vsize\!!heighta + \ifnum\combinedpagescounter>\@@ipstop\relax + \globallet\@@ipn\!!zerocount + \else\ifnum\combinedpagescounter>\@@ipn \else + \externalfigure[\@@ipname] + [\c!object=\v!no, + \c!page=\combinedpagescounter, + \c!factor=\v!max, + \c!background=\@@ipbackground, + \c!backgroundcolor=\@@ipbackgroundcolor, + \c!frame=\@@ipframe]% + \fi\fi}} + \doglobal\increment\combinedpagescounter + \@@ipbottom}% + \vfil}% + \vfilneg} + \hfil}% + \hfilneg}} + \page + \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}} + +\let\docombinepageshorizontal\docombinepagesa +\let\docombinepagesvertical \docombinepagesc + +\def\docombinepagesb + {\globallet\combinedpagescounter\@@ipstart + \doloop + {\startbaselinecorrection + \scratchdimen\@@ipdistance + \!!widtha\dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax + \hbox to \hsize + {\dorecurse\@@ipnx + {\doglobal\increment\combinedpagescounter + \ifnum\combinedpagescounter>\@@ipn \else + \expanded{\externalfigure[\@@ipname] + [\c!page=\combinedpagescounter, + \c!width=\the\!!widtha,% todo \freezedimenmacro + \c!background=\@@ipbackground, + \c!backgroundcolor=\@@ipbackgroundcolor, + \c!frame=\@@ipframe]}% + \hfill + \fi}\hfillneg}% + \stopbaselinecorrection + \ifnum\combinedpagescounter<\@@ipn\relax + \@@ipinbetween + \else + \exitloop + \fi}} + +%D \macros +%D {setuppagecomment,startpagecomment} +%D +%D This command is not yet documented. Usage: +%D +%D \starttyping +%D \setuppagecomment[state=start,location=right] +%D +%D \startpagecomment +%D \input knuth +%D \stoppagecomment +%D \stoptyping + +\def\setuppagecomment + {\dosingleempty\dosetuppagecomment} + +\def\dosetuppagecomment[#1]% + {\getparameters[\??pc][#1]% + \doifelse\@@pcstate\v!start + {\doifinsetelse\@@pclocation{\v!bottom,\v!top} + {\setuppapersize[\c!left=\hskip\@@pcoffset]% + \edef\@@pcpaperheight{\the\dimexpr\paperheight+\@@pcoffset+\@@pcoffset+\@@pcdistance+\@@pcheight\relax}% + \edef\@@pcpaperwidth {\the\dimexpr\paperwidth+\@@pcoffset+\@@pcoffset\relax}% + \defineoverlay[\v!pagecomment][\placepagecommentTB]} + {\setuppapersize[\c!top=\vskip\@@pcoffset]% + \edef\@@pcpaperheight{\the\dimexpr\paperheight+\@@pcoffset+\@@pcoffset\relax}% + \edef\@@pcpaperwidth {\the\dimexpr\paperwidth+\@@pcoffset+\@@pcoffset+\@@pcdistance+\@@pcwidth\relax}% + \defineoverlay[\v!pagecomment][\placepagecommentLR]}% + \processaction + [\@@pclocation] + [ \v!bottom=>{\setuppapersize[\c!bottom =\vss,\c!top =\vskip\@@pcoffset]}, + \v!top=>{\setuppapersize[\c!top =\vss,\c!bottom =\vskip\@@pcoffset]}, + \v!left=>{\setuppapersize[\c!left =\hss,\c!right=\hskip\@@pcoffset]}, + \v!right=>{\setuppapersize[\c!right=\hss,\c!left =\hskip\@@pcoffset]}]% + \definepapersize + [\v!pagecomment] + [\c!height=\@@pcpaperheight, + \c!width=\@@pcpaperwidth]% + \let\@@pcprintpapersize\printpapersize + \setuppapersize[\papersize][\v!pagecomment]% + \setupbackgrounds[\v!paper][\c!background=\v!pagecomment]} + {\doif\@@pcstate\v!stop % else initialization invokes backgrounds + {% this should be tested first + % \expanded{\setuppapersize[\papersize][\@@pcprintpapersize]}% + \setupbackgrounds[\v!paper][\c!background=]}}} + +\def\@@pcprintpapersize{\printpapersize} + +\def\placepagecommentTB + {\vbox to \printpaperheight + {\forgetall + \hsize\printpaperwidth + \vskip\@@pcoffset + \doifelse\@@pclocation\v!bottom{\vskip\dimexpr\paperheight+\@@pcdistance\relax}\vss + \hskip\@@pcoffset + \vbox to \@@pcheight + {\forgetall + \hsize\paperwidth + \ifpagecomment + \getbuffer[\v!pagecomment]% + \global\pagecommentfalse + \fi}% + \hfill + \doifelse\@@pclocation\v!bottom\vss{\vskip\dimexpr\paperheight+\@@pcdistance\relax}% + \vskip\@@pcoffset}} + +\def\placepagecommentLR + {\hbox to \printpaperwidth + {\hskip\@@pcoffset + \doifelse\@@pclocation\v!right{\hskip\paperwidth\hskip\@@pcdistance}\hss + \vbox to \printpaperheight + {\forgetall + \vskip\@@pcoffset + \hsize\@@pcwidth + \ifpagecomment + \getbuffer[\v!pagecomment]% + \global\pagecommentfalse + \fi + \vss}% + \doifelse\@@pclocation\v!right\hss{\hskip\paperwidth\hskip\@@pcdistance}% + \hskip\@@pcoffset}} + +\newif\ifpagecomment + +\setvalue{\e!start\v!pagecomment}% + {\global\pagecommenttrue + \dostartbuffer[\v!pagecomment][\e!start\v!pagecomment][\e!stop\v!pagecomment]} + +\setuppagecomment + [\c!state=, % \v!stop would invoke background calculation + \c!location=\v!bottom, + \c!offset=.5cm, + \c!distance=.5cm, + \c!height=5cm, + \c!width=10cm] + +% This macro cuts a page into n parts that can be pasted +% together. + +\def\slicepages + {\dotripleempty\doslicepages} + +\def\doslicepages[#1][#2][#3]% + {\ifthirdargument + \dodoslicepages[#1][#2][#3]% + \else + \dodoslicepages[#1][#2][#2]% + \fi} + +\newcounter\slicedpagenumber + +\def\dodoslicepages[#1][#2][#3]% + {\bgroup + \dontcomplain + \globallet\slicedpagenumber\!!zerocount + \getfiguredimensions[#1] + \getparameters + [\??ip] + [\c!n=1, + \c!offset=\!!zeropoint, + \c!hoffset=\!!zeropoint,\c!voffset=\!!zeropoint, + \c!width=\figurewidth,\c!height=\figureheight,#2] + \ifnum\@@ipn>\zerocount + \definepapersize + [\s!dummy][\c!height=\@@ipheight,\c!width=\@@ipwidth] + \setuppapersize + [\s!dummy][\s!dummy] + \setuplayout + [\c!backspace=\!!zeropoint,\c!topspace=\!!zeropoint, + \c!height=\v!middle,\c!width=\v!middle, + \c!textdistance=\!!zeropoint, + \c!header=\!!zeropoint,\c!footer=\!!zeropoint] + \fi + \dorecurse\noffigurepages + {\global\let\slicedpagenumber\recurselevel + \ifnum\@@ipn>\plusone + \dorecurse\@@ipn + {\let\xslice\recurselevel + \dorecurse\@@ipn + {\let\yslice\recurselevel + \clip + [\c!nx=\@@ipn,\c!ny=\@@ipn,\c!x=\xslice,\c!y=\yslice] + {\scale + [\c!scale=\@@ipn000] + {\externalfigure[#1][\c!page=\slicedpagenumber]}} + \page}} + \else + \ifodd\slicedpagenumber\relax + \getparameters[\??ip][#2] + \else + \getparameters[\??ip][#3] + \fi + \hskip\@@ipoffset + \clip + [\c!hoffset=\@@iphoffset,\c!voffset=\@@ipvoffset, + \c!height=\@@ipheight,\c!width=\@@ipwidth] + {\externalfigure[#1][\c!page=\slicedpagenumber]} + \page + \fi} + \egroup} + +% \starttext \slicepages[slice1.pdf][n=3] \stoptext + +\protect \endinput diff --git a/tex/context/base/page-imp.mkiv b/tex/context/base/page-imp.mkiv new file mode 100644 index 000000000..fd0482585 --- /dev/null +++ b/tex/context/base/page-imp.mkiv @@ -0,0 +1,1298 @@ +%D \module +%D [ file=page-imp, % was: core-pag, +%D version=1998.01.15, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Pagebody Building (Imposition), +%D author=Hans Hagen, +%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. + +% much of this can more to run time loading ! + +\writestatus{loading}{ConTeXt Page Macros / Pagebody Building} + +\unprotect + +% sizing bug: +% +% \setuppapersize[A4][A4,landscape] \setuparranging[2UP] \showframe +% +% \starttext \dorecurse{10}{\input tufte \par} \stoptext + +% to be moved code: + +\newif\ifclipprintbox \clipprintboxtrue +%newif\ifclippagebox \clippageboxtrue + +\def\clippedprintbox#1#2% can be made more efficient, see other clipper + {\ifclipprintbox + \!!widthc \pagebackgroundoffset + \!!widtha \dimexpr\paperwidth + \!!widthc\relax + \!!heighta\dimexpr\paperheight+2\!!widthc\relax + \setbox#2\vbox to \paperheight{\vfill\box#2}% + \ht#2\paperheight + \wd#2\paperwidth + \setbox#2\vbox + {\framed + [\c!offset=\!!widthc,\c!strut=\v!no,\c!frame=\v!off] + {\box#2}}% + \setbox#2\hbox to \paperwidth + {\ifcase#1\relax + \!!widthb\zeropoint + \hskip-\!!widthc + \else + \!!widthb\!!widthc + \fi + \lower\!!widthc\hbox + {\clip + [\c!width=\!!widtha,\c!height=\!!heighta, + \c!hoffset=\!!widthb,\c!voffset=\zeropoint] + {\box#2}}}% + \wd#2\paperwidth + \ht#2\paperheight + \fi + \box#2\relax} + +\let\clippagebox \gobbleoneargument +\let\clipprintbox\gobbleoneargument + +% \setuppagenumbering[alternative=doublesided] +% \setupcolors[state=start] +% \setuppapersize[A4][A4,oversized] +% \setuplayout[location=middle,clipoffset=5mm] +% \setupbackgrounds +% [page] +% [frame=on,rulethickness=1mm, +% backgroundoffset=10mm,background=color,backgroundcolor=red] +% \starttext \dorecurse{10}{\input tufte \par} \stoptext + +\def\clippagebox % skip fast over false + {\ifdim\@@lyclipoffset>\zeropoint + \expandafter\doclippagebox + \else + \expandafter\gobbleoneargument + \fi} + +\def\doclippagebox#1% + {\!!widtha \wd#1% + \!!heighta\ht#1% + \!!deptha \dp#1% + \setbox#1\hbox + {\!!widthb \@@lyclipoffset + \advance\!!heighta\dimexpr\!!deptha+2\!!widthb\relax + \advance\!!widtha \!!widthb + \doifbothsides + {\advance\!!widtha\!!widthb \!!widthc-\!!widthb \hskip\!!widthc}% + {\!!widthc\zeropoint} + {\!!widthc-\!!widthb \hskip\!!widthc}% + \lower\!!widthb\hbox + {\clip + [\c!hoffset=\!!widthc, + \c!voffset=-\!!widthb, + \c!width=\!!widtha, + \c!height=\!!heighta]% + {\box#1}}}% + \wd#1\!!widtha + \ht#1\!!heighta + \dp#1\!!deptha} + +%D \macros +%D {starttextdata} +%D +%D This is a user macro (appending to every last shipout is not +%D really user friendly. + +\newtoks \collectedtextdata + +\long\def\starttextdata#1\stoptextdata + {\doglobal\appendtoks#1\to\collectedtextdata} + +\def\flushtextdata + {\vsmashed{\the\collectedtextdata}% all dimensions zero + \global\collectedtextdata\emptytoks + \globallet\flushtextdata\donothing} + +\prependtoks \flushtextdata \to \everylastshipout + +\def\installpagehandler#1#2% % a handler takes one argument: something to be boxed + {\setgvalue{\??pp:\c!method:#1}##1{#2{##1}}} % and shipped out (don't depend on the exact package) + +\installpagehandler\v!normal + {\ifarrangingpages\expandafter\actualarrange\else\expandafter\actualshipout\fi} + +\def\myshipout#1% + {\beforeshipout % voor de pagebody dus ! + \dontshowcomposition + \executeifdefined{\??pp:\c!method:\@@ppmethod}\gobbleoneargument{#1}% + \setnextrealpageno + \aftershipout} + +\newbox\postponedcontent + +\def\flushatshipout + {\dowithnextbox + {\global\setbox\postponedcontent\hbox to \zeropoint + {%\hskip-\maxdimen % niet hier, gaat mis in acrobat (clipt) + \unhbox\postponedcontent\unhbox\nextbox}% was \box + \global\ht\postponedcontent\zeropoint + \global\dp\postponedcontent\zeropoint + \global\wd\postponedcontent\zeropoint}% + \hbox} + +% \starttypen +% \def\pagestoshipout{1,3,5} +% \stoptypen + +\newcount\shippedoutpages + +\let\pagestoshipout\empty % {1,3,6} +\chardef\whichpagetoshipout=0 % 0=all 1=odd 2=even + +\def\actualshipout#1% + {\global\advance\shippedoutpages\plusone + % this is not resource safe! + \ifx\pagestoshipout\empty + \ifcase\whichpagetoshipout\relax + \donetrue + \or % 1 + \ifodd\shippedoutpages\relax\donetrue\else\donefalse\fi + \or % 2 + \ifodd\shippedoutpages\relax\donefalse\else\donetrue\fi + \else + \donetrue + \fi + \else % testen, aangepast / expanded nodig ? + \normalexpanded{\noexpand\doifinsetelse{\the\shippedoutpages}{\pagestoshipout}}% + \donetrue\donefalse + \fi + \ifdone + \shipout\vbox + {%\forgetall + \offinterlineskip + \dontcomplain + \scratchdimen-1in + \vskip\scratchdimen + \hskip\scratchdimen + \setbox0\hbox{#1}% just in case there are objects there, hook for testing + \finalizeshipoutbox0% + \setbox\scratchbox\hbox + {% before the main one ! + \ifcase\realfolio \or + \the\everyfirstshipout + \global\everyfirstshipout\emptytoks + \fi + % the main one + \the\everyshipout\relax + % always last (and after the main one) + \ifnum\realpageno=\lastpage\relax + \the\everylastshipout + \global\everylastshipout\emptytoks + \fi}% + \smashbox\scratchbox + \hbox % \setbox0=\box.. is nicer + {\box\scratchbox + \ifvoid\postponedcontent\else\box\postponedcontent\fi % evt ver naar links ! + \box0}}% + \else + \message + {[\ifarrangingpages arranged \fi page + \ifarrangingpages\the\arrangeno\else\the\realpageno\fi\normalspace + not flushed]}% + \setbox0\hbox{#1}% + \deadcycles\zerocount + \fi} + +\def\actualarrange#1% + {\setbox0\hbox{#1}% + \pusharrangedpage0% + \deadcycles\zerocount} + +%D We need a couple of boxes for duplex printing \unknown + +\newbox\arrangedpageA \newbox\arrangedpageB + +%D \unknown\ and some for simulating big sheets. + +\newbox\arrangedpageC \newbox\arrangedpageD +\newbox\arrangedpageE \newbox\arrangedpageF +\newbox\arrangedpageG \newbox\arrangedpageH + +\newif\ifswaparranged +\newif\ifnegatearranged +\newif\ifmirrorarranged +\newif\ifdoublearranged + +\newif\ifarrangingdisabled + +\def\arrangedrotationO{0} +\def\arrangedrotationE{0} + +\newcounter\arrangedpageN +\newcounter\arrangedpageM + +\chardef\arrangedpageT=1 +\chardef\arrangedpageX=1 +\chardef\arrangedpageY=1 + +\def\calculatepaperoffsets#1% + {\scratchdimen\getvalue{\??pp#1\c!offset}% + \divide\scratchdimen \arrangedpageX + \global\advance\paperwidth -2\scratchdimen + \scratchdimen\getvalue{\??pp#1\c!offset}% + \divide\scratchdimen \arrangedpageY + \global\advance\paperheight-2\scratchdimen} + +\newconditional\arrangedbackgroundokay % more ifs -> conditionals + +\def\setuparranging[#1]% + {\ifarrangingdisabled \else + \doifelse{#1}\v!disable + {\global\arrangingdisabledtrue} + {\global\arrangingdisabledfalse}% + \global\arrangingpagestrue + \global\negatearrangedfalse + \global\mirrorarrangedfalse + \global\doublearrangedfalse + \gdef\arrangedrotationO{0}% + \gdef\arrangedrotationE{180}% + \processallactionsinset + [#1] + [ \v!mirrored=>\global\mirrorarrangedtrue, + \v!doublesided=>\global\doublearrangedtrue, + \v!negative=>\global\negatearrangedtrue, + \v!rotated=>\gdef\arrangedrotationO {90}\gdef\arrangedrotationE{270}, + 90=>\gdef\arrangedrotationO {90}\gdef\arrangedrotationE{270}, + 180=>\gdef\arrangedrotationO{180}\gdef\arrangedrotationE{0}, + 270=>\gdef\arrangedrotationO{270}\gdef\arrangedrotationE{90}, + \s!reset=>\global\arrangingpagesfalse, + \v!background=>\global\settrue\arrangedbackgroundokay, + \s!unknown=>\checkinstalledpagearrangement\commalistelement]% + % no \s!default=> we can have aaa,,bbb + \ifx\handlearrangedpage\undefined + \global\arrangingpagesfalse + \fi + \doifcommonelse{#1}{90,270,\v!rotated} + {\swapmacros\horizontalcutmarks\verticalcutmarks}{}% ugly solution + \setuppapersize + \fi} + +\def\installpagearrangement #1 % + {\setgvalue{\??pp\??pp#1}} + +\def\checkinstalledpagearrangement#1% can be empty: aaa,,bbb + {\executeifdefined{\??pp\??pp#1}\donothing} + +\def\dosetuparrangement#1#2#3#4#5#6#7#8% + {\global\chardef\arrangedpageX #1% + \global\chardef\arrangedpageY #2% + \global\chardef\arrangedpageT #3% + \global\chardef\horizontalcutmarks#4% + \global\chardef\verticalcutmarks #5% + \global\let \pusharrangedpage #6% + \global\let \poparrangedpages #7% + \global\let \handlearrangedpage#8} + +\installpagearrangement {\v!normal} + {\global\arrangingpagesfalse} + +\installpagearrangement 2*16 + {\dosetuparrangement{4}{4}{16}{5}{5}% + \pusharrangedpageTHIRTYTWO\poparrangedpagesAB\relax} + +\installpagearrangement 2*8 + {\dosetuparrangement{4}{2}{8}{5}{3}% + \pusharrangedpageSIXTEEN\poparrangedpagesAB\relax} + +\installpagearrangement 2*4 + {\dosetuparrangement{2}{2}{4}{3}{3}% + \pusharrangedpageEIGHT\poparrangedpagesAB\relax} + +\installpagearrangement 2*2 + {\dosetuparrangement{2}{1}{2}{3}{2}% + \pusharrangedpageFOURA\poparrangedpagesAB\relax} + +\installpagearrangement 2**2 + {\dosetuparrangement{2}{1}{2}{3}{2}% + \pusharrangedpageFOURB\poparrangedpagesAB\relax} + +\installpagearrangement 2SIDE + {\dosetuparrangement{2}{1}{2}{3}{2}% + \pusharrangedpageSIDETOP\poparrangedpagesTWO\handlearrangedpageSIDE} + +\installpagearrangement 2TOP + {\dosetuparrangement{1}{2}{2}{2}{3}% + \pusharrangedpageSIDETOP\poparrangedpagesTWO\handlearrangedpageTOP} + +\installpagearrangement 2UP + {\dosetuparrangement{2}{1}{4}{3}{2}% + \pusharrangedpageTWO\poparrangedpagesTWO\handlearrangedpageTWOUP} + +\installpagearrangement 2DOWN + {\dosetuparrangement{1}{2}{4}{2}{3}% + \pusharrangedpageTWO\poparrangedpagesTWO\handlearrangedpageTWODOWN} + +\installpagearrangement 2*4*2 % one defined by Willy Egger: + {\dosetuparrangement{2}{2}{4}{3}{2}% + \pusharrangedpageSIXTEENTWO\poparrangedpagesAtoD\relax} + +\installpagearrangement 2*2*4 % onother one of Willy Egger + {\dosetuparrangement{2}{1}{8}{3}{2}% + \pusharrangedpageSIXTEENFOUR\poparrangedpagesAtoH\relax} + +\installpagearrangement 2TOPSIDE + {\dosetuparrangement{1}{2}{4}{2}{3}% + \pusharrangedpageTWOTOPSIDE\poparrangedpagesTWOTOPSIDE\handlearrangedpageTOP} + +% \def\filluparrangedpages % beware: \realpageno is 1 ahead +% {\ifarrangingpages +% \scratchcounter-\realpageno +% \divide\scratchcounter \arrangedpageT +% \multiply\scratchcounter \arrangedpageT +% \advance\scratchcounter \realpageno +% \advance\scratchcounter \minusone +% \dorecurse\scratchcounter{\noheaderandfooterlines\ejectdummypage}% +% \fi} + +\def\filluparrangedpages % beware: \realpageno is 1 ahead + {\ifarrangingpages + \scratchcounter\numexpr\realpageno-\plusone\relax + \dosetmodulo\scratchcounter\arrangedpageT\scratchcounter + \ifcase\scratchcounter\else + \advance\scratchcounter \plusone + \dostepwiserecurse\scratchcounter\arrangedpageT\plusone + {\noheaderandfooterlines\ejectdummypage}% + \fi + \fi} + +\def\handlearrangedpageXandY#1#2#3#4#5% + {\global\setbox#5\hbox to \arrangedpageX\paperwidth + {\setbox\scratchbox\vbox to \arrangedpageY\paperheight + {%\forgetall + \offinterlineskip + \dontcomplain + \vskip#4\paperheight + \hskip#3\paperwidth + \dorotatebox{\ifcase#2 0\else180\fi}\hbox{\box#1}% + \vfill}% + \wd\scratchbox\zeropoint + \box\scratchbox\box#5\hss}} + +\def\gotonextarrangepage + {\global\advance\arrangeno \plusone + \def\pagecutmarksymbol{\the\arrangeno}} + +\def\outputarrangedbox#1% + {\bgroup + \gotonextarrangepage + \ifnum\arrangedrotationO\arrangedrotationE>\zerocount + \setbox#1\vbox + {\ifdoublearranged + \ifodd\arrangeno + \dorotatebox\arrangedrotationO\hbox{\box#1}% + \else + \dorotatebox\arrangedrotationE\hbox{\box#1}% + \fi + \else + \dorotatebox\arrangedrotationO\hbox{\box#1}% + \fi}% + \fi + \ifmirrorarranged + \setbox#1\vbox{\domirrorbox\vbox{\box#1}}% + \fi + \ifnegatearranged + \negatecolorbox{#1}% + \fi + \finishpagebox#1% + \ifconditional\arrangedbackgroundokay\addprintbackground#1\fi + \actualshipout{\box#1}% + \egroup} + +%D The format file can be 16K smaller when we postpone the +%D real arrangments. Some day ... + +% TOP + +% 32/16/8/4/SIDE + +\def\poparrangedpagesAB + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \paperwidth\arrangedpageX\paperwidth + \paperheight\arrangedpageY\paperheight + \outputarrangedbox\arrangedpageA + \outputarrangedbox\arrangedpageB + \doglobal\newcounter\arrangedpageN + \fi} + +\def\pusharrangedpageTHIRTYTWO#1% taco's challenge + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}033\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}003\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}100\arrangedpageB % 3 + \or \handlearrangedpageXandY{#1}130\arrangedpageA % 4 + \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5 + \or \handlearrangedpageXandY{#1}130\arrangedpageB % 6 + \or \handlearrangedpageXandY{#1}033\arrangedpageB % 7 + \or \handlearrangedpageXandY{#1}003\arrangedpageA % 8 + \or \handlearrangedpageXandY{#1}102\arrangedpageA % 9 + \or \handlearrangedpageXandY{#1}132\arrangedpageB % 10 + \or \handlearrangedpageXandY{#1}031\arrangedpageB % 11 + \or \handlearrangedpageXandY{#1}001\arrangedpageA % 12 + \or \handlearrangedpageXandY{#1}031\arrangedpageA % 13 + \or \handlearrangedpageXandY{#1}001\arrangedpageB % 14 + \or \handlearrangedpageXandY{#1}102\arrangedpageB % 15 + \or \handlearrangedpageXandY{#1}132\arrangedpageA % 16 + \or \handlearrangedpageXandY{#1}122\arrangedpageA % 17 + \or \handlearrangedpageXandY{#1}112\arrangedpageB % 18 + \or \handlearrangedpageXandY{#1}011\arrangedpageB % 19 + \or \handlearrangedpageXandY{#1}021\arrangedpageA % 20 + \or \handlearrangedpageXandY{#1}011\arrangedpageA % 21 + \or \handlearrangedpageXandY{#1}021\arrangedpageB % 22 + \or \handlearrangedpageXandY{#1}122\arrangedpageB % 23 + \or \handlearrangedpageXandY{#1}112\arrangedpageA % 24 + \or \handlearrangedpageXandY{#1}013\arrangedpageA % 25 + \or \handlearrangedpageXandY{#1}023\arrangedpageB % 26 + \or \handlearrangedpageXandY{#1}120\arrangedpageB % 27 + \or \handlearrangedpageXandY{#1}110\arrangedpageA % 28 + \or \handlearrangedpageXandY{#1}120\arrangedpageA % 29 + \or \handlearrangedpageXandY{#1}110\arrangedpageB % 30 + \or \handlearrangedpageXandY{#1}013\arrangedpageB % 31 + \or \handlearrangedpageXandY{#1}023\arrangedpageA % 32 + \poparrangedpages + \fi} + +\def\pusharrangedpageSIXTEEN#1% changed to match the official way of doing + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}031\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}031\arrangedpageB % 3 + \or \handlearrangedpageXandY{#1}001\arrangedpageA % 4 + \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5 + \or \handlearrangedpageXandY{#1}130\arrangedpageB % 6 + \or \handlearrangedpageXandY{#1}100\arrangedpageB % 7 + \or \handlearrangedpageXandY{#1}130\arrangedpageA % 8 + \or \handlearrangedpageXandY{#1}120\arrangedpageA % 9 + \or \handlearrangedpageXandY{#1}110\arrangedpageB % 10 + \or \handlearrangedpageXandY{#1}120\arrangedpageB % 11 + \or \handlearrangedpageXandY{#1}110\arrangedpageA % 12 + \or \handlearrangedpageXandY{#1}011\arrangedpageA % 13 + \or \handlearrangedpageXandY{#1}021\arrangedpageB % 14 + \or \handlearrangedpageXandY{#1}011\arrangedpageB % 15 + \or \handlearrangedpageXandY{#1}021\arrangedpageA % 16 + \poparrangedpages + \fi} + +\def\pusharrangedpageEIGHT#1% changed to match the official way of doing + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}011\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}100\arrangedpageB % 3 + \or \handlearrangedpageXandY{#1}110\arrangedpageA % 4 + \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5 + \or \handlearrangedpageXandY{#1}110\arrangedpageB % 6 + \or \handlearrangedpageXandY{#1}011\arrangedpageB % 7 + \or \handlearrangedpageXandY{#1}001\arrangedpageA % 8 + \poparrangedpages + \fi} + +\def\pusharrangedpageFOURA{\pusharrangedpageFOURdo01} +\def\pusharrangedpageFOURB{\pusharrangedpageFOURdo10} + +\def\pusharrangedpageFOURdo#1#2#3% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#3}010\arrangedpageA % 1 + \or \handlearrangedpageXandY{#3}0{#1}0\arrangedpageB % 2/3 not {1} + \or \handlearrangedpageXandY{#3}0{#2}0\arrangedpageB % 3/2 not {1} + \or \handlearrangedpageXandY{#3}000\arrangedpageA % 4 + \poparrangedpages + \fi} + +\def\pusharrangedpageSIDETOP#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2 + \poparrangedpages + \fi} + +\def\handlearrangedpageSIDE + {\global\wd\arrangedpageA\paperwidth + \global\wd\arrangedpageB\paperwidth + \global\setbox\arrangedpageA\hbox + {\box\arrangedpageA\box\arrangedpageB}% + \global\ht\arrangedpageA\paperheight} + +\def\handlearrangedpageTOP + {\global\ht\arrangedpageA\paperheight + \global\ht\arrangedpageB\paperheight + \global\setbox\arrangedpageA\vbox + {%\forgetall + \offinterlineskip\vskip\paperheight + \box\arrangedpageA\box\arrangedpageB}% + \global\setbox\arrangedpageB\box\scratchbox} % ? + +% 2UP/2DOWN / 1pt prevents overflow + +\def\splitoffarrangedpagesTWO + {\splittopskip\zeropoint + \global\setbox\arrangedpageA\vsplit\arrangedpageB to \onepoint + \scratchdimen\dimexpr\ht\arrangedpageB-\onepoint\relax + \ifdim\scratchdimen>\onepoint + \setbox\scratchbox\vsplit\arrangedpageB to \scratchdimen + \fi} + +\def\handlearrangedpageTWOUP + {\splitoffarrangedpagesTWO + \ifswaparranged + \global\setbox\arrangedpageA\hbox + {\clippedprintbox0\arrangedpageA + \clippedprintbox1\arrangedpageB}% + \swaparrangedfalse + \else + \global\setbox\arrangedpageA\hbox + {\clippedprintbox0\arrangedpageB + \clippedprintbox1\arrangedpageA}% + \swaparrangedtrue + \fi + \global\ht\arrangedpageA\paperheight + \global\setbox\arrangedpageB\box\scratchbox} + +\def\handlearrangedpageTWODOWN + {\splitoffarrangedpagesTWO + \global\ht\arrangedpageA\paperheight + \global\ht\arrangedpageB\paperheight + \ifswaparranged + \global\setbox\arrangedpageA\vbox + {%\forgetall + \offinterlineskip\vskip\paperheight + \box\arrangedpageA\box\arrangedpageB}% + \swaparrangedfalse + \else + \global\setbox\arrangedpageA\vbox + {%\forgetall + \offinterlineskip\vskip\paperheight + \box\arrangedpageB\box\arrangedpageA}% + \swaparrangedtrue + \fi + \global\setbox\arrangedpageB\box\scratchbox} + +\def\poparrangedpagesTWO + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \swaparrangedfalse + \doloop + {\handlearrangedpage + \bgroup + \paperwidth\arrangedpageX\paperwidth + \paperheight\arrangedpageY\paperheight + \ht\arrangedpageA\paperheight + \wd\arrangedpageA\paperwidth + \outputarrangedbox\arrangedpageA + \egroup + \ifdim\ht\arrangedpageB=\zeropoint + \exitloop + \fi}% + \doglobal\newcounter\arrangedpageN + \fi} + +\def\pusharrangedpageTWO#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \global\setbox\arrangedpageB\vbox + {%\forgetall + \offinterlineskip + \unvbox\arrangedpageB + \allowbreak + \ht#1\onepoint + \dp#1\zeropoint + \vbox{\box#1}}} + +\def\poparrangedpagesTWOTOPSIDE + {\ifnum\arrangedpageN>\zerocount + \bgroup + \gdef\arrangedpageN{2}\poparrangedpagesTWO + \let\arrangedpageA\arrangedpageC + \let\arrangedpageB\arrangedpageD + \gdef\arrangedpageN{2}\poparrangedpagesTWO + \doglobal\newcounter\arrangedpageN + \egroup + \fi} + +\def\pusharrangedpageTWOTOPSIDE#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}000\arrangedpageC % 2 + \or \handlearrangedpageXandY{#1}000\arrangedpageB % 1 + \or \handlearrangedpageXandY{#1}000\arrangedpageD % 2 + \poparrangedpages + \fi} + +%D Willy Egger's sheet simulations: + +\def\poparrangedpagesAtoH + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \paperwidth\arrangedpageX\paperwidth + \paperheight\arrangedpageY\paperheight + \outputarrangedbox\arrangedpageA + \outputarrangedbox\arrangedpageB + \outputarrangedbox\arrangedpageC + \outputarrangedbox\arrangedpageD + \outputarrangedbox\arrangedpageE + \outputarrangedbox\arrangedpageF + \outputarrangedbox\arrangedpageG + \outputarrangedbox\arrangedpageH + \doglobal\newcounter\arrangedpageN + \fi} + +% to arrange 16 pages on 2 sheets to form one booklet + +\def\poparrangedpagesAtoD + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \paperwidth\arrangedpageX\paperwidth + \paperheight\arrangedpageY\paperheight + \outputarrangedbox\arrangedpageA + \outputarrangedbox\arrangedpageB + \outputarrangedbox\arrangedpageC + \outputarrangedbox\arrangedpageD + \doglobal\newcounter\arrangedpageN + \fi} + +% to arrange 16 pages on 4 sheets to form one booklet + +\def\pusharrangedpageSIXTEENFOUR#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}010\arrangedpageC % 3 + \or \handlearrangedpageXandY{#1}000\arrangedpageD % 4 + \or \handlearrangedpageXandY{#1}010\arrangedpageE % 5 + \or \handlearrangedpageXandY{#1}000\arrangedpageF % 6 + \or \handlearrangedpageXandY{#1}010\arrangedpageG % 7 + \or \handlearrangedpageXandY{#1}000\arrangedpageH % 8 + \or \handlearrangedpageXandY{#1}010\arrangedpageH % 9 + \or \handlearrangedpageXandY{#1}000\arrangedpageG % 10 + \or \handlearrangedpageXandY{#1}010\arrangedpageF % 11 + \or \handlearrangedpageXandY{#1}000\arrangedpageE % 12 + \or \handlearrangedpageXandY{#1}010\arrangedpageD % 13 + \or \handlearrangedpageXandY{#1}000\arrangedpageC % 14 + \or \handlearrangedpageXandY{#1}010\arrangedpageB % 15 + \or \handlearrangedpageXandY{#1}000\arrangedpageA % 16 + \poparrangedpages + \fi} + +% to arrange 16 pages on 2 sheets to form one booklet + +\def\pusharrangedpageSIXTEENTWO#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \ifcase\arrangedpageN + \or \handlearrangedpageXandY{#1}011\arrangedpageA % 1 + \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2 + \or \handlearrangedpageXandY{#1}011\arrangedpageC % 3 + \or \handlearrangedpageXandY{#1}001\arrangedpageD % 4 + \or \handlearrangedpageXandY{#1}100\arrangedpageD % 5 + \or \handlearrangedpageXandY{#1}110\arrangedpageC % 6 + \or \handlearrangedpageXandY{#1}100\arrangedpageB % 7 + \or \handlearrangedpageXandY{#1}110\arrangedpageA % 8 + \or \handlearrangedpageXandY{#1}100\arrangedpageA % 9 + \or \handlearrangedpageXandY{#1}110\arrangedpageB % 10 + \or \handlearrangedpageXandY{#1}100\arrangedpageC % 11 + \or \handlearrangedpageXandY{#1}110\arrangedpageD % 12 + \or \handlearrangedpageXandY{#1}011\arrangedpageD % 13 + \or \handlearrangedpageXandY{#1}001\arrangedpageC % 14 + \or \handlearrangedpageXandY{#1}011\arrangedpageB % 15 + \or \handlearrangedpageXandY{#1}001\arrangedpageA % 16 + \poparrangedpages + \fi} + +% % handy for stickers etc, this way we can treat them as page +% +% \setuppapersize [XY][A4] +% \setuppaper [topspace=5mm,backspace=5mm,dx=1mm,dy=1mm,nx=2,ny=6] +% \setuplayout [page] [topspace=5mm,backspace=5mm] +% \setuplayout [page] +% \setuplayout [location=middle] +% \setuparranging [XY] +% \showframe +% +% \starttext \dorecurse{30}{test \recurselevel \page} \stoptext + +\def\pusharrangedpageXY#1% + {\doglobal\increment\arrangedpageN + \reportarrangedpage\arrangedpageN + \doglobal\increment\arrangedpageM + \global\setbox\arrangedpageB\hbox + \ifdim\@@ppwidth>\zeropoint to \@@ppwidth \fi + {\ifvoid\arrangedpageB\else + \unhbox\arrangedpageB + \ifdim\@@ppdx>\zeropoint \else \hss\fi + \hskip\@@ppdx + \ifdim\@@ppdx>\zeropoint \else \hss\fi + \fi + \box#1}% + \ifnum\arrangedpageM<\arrangedpageX\else + \global\setbox\arrangedpageA\vbox + \ifdim\@@ppheight>\zeropoint to \@@ppheight \fi + {\offinterlineskip + \ifvoid\arrangedpageA\else + \unvbox\arrangedpageA + \ifdim\@@ppdy>\zeropoint \else \vss\fi + \vskip\@@ppdy + \ifdim\@@ppdy>\zeropoint \else \vss\fi + \fi + \box\arrangedpageB}% + \doglobal\newcounter\arrangedpageM + \fi + \ifnum\arrangedpageN<\arrangedpageT\else + \poparrangedpages + \fi} + +\def\poparrangedpagesXY + {\ifnum\arrangedpageN>\zerocount + \dontcomplain + \paperwidth\arrangedpageX\paperwidth + \paperheight \arrangedpageY\paperheight + \outputarrangedbox\arrangedpageA + \doglobal\newcounter\arrangedpageN + \doglobal\newcounter\arrangedpageM + \fi} + +\installpagearrangement XY + {\dosetuparrangement\@@ppnx\@@ppny\@@ppxy\!!zerocount\!!zerocount + \pusharrangedpageXY\poparrangedpagesXY\relax} + +%D A crazy definition, don't guess who pushed me for the landscape option. + +\definepapersize + [XY] + [\c!height=\dimexpr\dimexpr\@@ppheight-\numexpr\@@ppny-1\relax\dimexpr\@@ppdy\relax\relax/\@@ppny\relax, + \c!width =\dimexpr\dimexpr\@@ppwidth -\numexpr\@@ppnx-1\relax\dimexpr\@@ppdx\relax\relax/\@@ppnx\relax] + +\setuppaper + [\c!width =\dimexpr\printpaperwidth -2\dimexpr\@@ppbackspace\relax\relax, + \c!height=\dimexpr\printpaperheight-2\dimexpr\@@pptopspace \relax\relax] + +% \definepageshift[test][horizontal][10pt,20pt,30pt,40pt,50pt] +% \definepageshift[test][vertical] [10pt,20pt,30pt,40pt,50pt] +% +% \setuppageshift[test] +% \setuppageshift[test][test] +% \setuppageshift[test][none] +% \setuppageshift[none][test] +% \setuppageshift[paper][test][test] % arrange only +% \setuppageshift[paper][test] % arrange only +% \setuppageshift[print][test][test] +% +% \showframe \dorecurse{100}{\input tufte \par} + +% #1=name #2=horizontal|vertical #3=shiftlist + +\def\definepageshift + {\dotripleargument\dodefinepageshift} + +\def\dodefinepageshift[#1][#2][#3]% + {\setvalue{\??pt#2:#1}{#3}} + +\letempty \hpageshifts \newcounter\nofhpageshifts +\letempty \vpageshifts \newcounter\nofvpageshifts + +% \let\shiftprintpagebox\gobbleoneargument +% \let\shiftpaperpagebox\gobbleoneargument + +\def\dogetpageshift#1#2#3% #1=\dimenx #2=\xpageshifts #3=\nofxpageshifts + {\ifx#2\empty + #1\zeropoint + \else + \doglobal\increment#3% + \getfromcommacommand[#2][#3]% + \ifx\commalistelement\empty + \globallet#3\!!plusone + \getfromcommacommand[#2][#3]% + \fi + \ifx\commalistelement\empty + #1\zeropoint + \else + #1=\commalistelement + \donetrue + \fi + \fi} + +\def\shiftpagebox#1% + {\donefalse + \dogetpageshift{\dimen0}\hpageshifts\nofhpageshifts + \dogetpageshift{\dimen2}\vpageshifts\nofvpageshifts + \ifdone % see also layout offsets, maybe \movebox + \edef\next{\wd#1\the\wd#1\ht#1\the\ht#1\dp#1\the\dp#1}% + \setbox#1\vbox + {\offinterlineskip\vskip\dimen2\hskip\dimen0\box#1}% + \next + \fi} + +\def\setuppageshift + {\dotripleempty\dosetuppageshift} + +\def\dosetuppageshift[#1][#2][#3]% page|paper horizontal vertical + {\ifthirdargument % paper=arrange + \let\hpageshifts\empty + \let\vpageshifts\empty + \let\shiftprintpagebox\gobbleoneargument + \let\shiftpaperpagebox\gobbleoneargument + \doifdefined{\??pt\v!horizontal:#2} + {\edef\hpageshifts{\getvalue{\??pt\v!horizontal:#2}}}% + \doifdefined{\??pt\v!vertical :#3} + {\edef\vpageshifts{\getvalue{\??pt\v!vertical :#3}}}% + \doif{#1}\v!page{\let\shiftprintpagebox\shiftpagebox}% + \doif{#1}\v!paper{\let\shiftpaperpagebox\shiftpagebox}% + \else\ifsecondargument + \doifinsetelse{#1}{\v!page,\v!paper} + {\setuppageshift[#1][#2][#2]} + {\setuppageshift[\v!page][#1][#2]}% + \else\iffirstargument + \setuppageshift[\v!page][#1][#1]% + \fi\fi\fi} + +%D One can (mis)use this mechanism, in close cooperation +%D with \PDFTEX\ to arrange pages of already produced files. +%D +%D \starttyping +%D \insertpages[file.pdf][1,3][n=30,width=18cm] +%D \stoptyping +%D +%D The pages are inserted in the text area, and even pages +%D are repositioned according to the width. In this example +%D empty pages are added after page 1 and 3. +%D +%D Selecting pages can be accomplished by: +%D +%D \starttyping +%D \filterpages[file.pdf][1,3,5][n=30,width=18cm] +%D \stoptyping +%D +%D One may pass \type {odd} or \type {even} instead of a +%D comma separated list. A third alternative is: +%D +%D \starttyping +%D \copypages[file.pdf][n=30,scale=950] +%D \stoptyping +%D +%D This macros inserts the page, according to the settings +%D provided. + +\def\insertpages + {\dotripleempty\doinsertpages} + +\def\doinsertpages[#1][#2][#3]% + {\doifassignmentelse{#2} + {\dodoinsertpages[#1][][#2]} + {\dodoinsertpages[#1][#2][#3]}} + +\def\dodoinsertpages[#1][#2][#3]% + {\bgroup + \dontcomplain + \getfiguredimensions[#1]% + \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]% + \doifinset0{#2}{\null\page}% + \dorecurse\@@ipn + {\dofilterpage{#1}\recurselevel + \doifinset\recurselevel{#2}{\null\page}}% + \egroup} + +\def\filterpages + {\dotripleempty\dofilterpages} + +\def\dofilterpages[#1][#2][#3]% % \noffigurepages not yet supported + {\bgroup + \dontcomplain + \getfiguredimensions[#1]% + \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]% + \doifelse{#2}\v!even + {\dorecurse\@@ipn + {\ifodd\recurselevel\relax\else\dofilterpage{#1}\recurselevel\fi}} + {\doifelse{#2}\v!odd + {\dorecurse\@@ipn + {\ifodd\recurselevel\relax\dofilterpage{#1}\recurselevel\fi}} + {\def\dodocommand##1% + {\ifnum##1>\@@ipn\else\dofilterpage{#1}{##1}\fi}% + \def\docommand##1% + {\dowithrange{##1}\dodocommand}% + \processcommalist[#2]\docommand}}% + \egroup} + +\def\dofilterpage#1#2% + {\hbox to \textwidth + {\ifdoublesided\ifdim\@@ipwidth>\zeropoint\relax\ifodd\realpageno\else + \hfill + \def\dowithfigure{\hskip-\@@ipwidth}% + \fi\fi\fi + \setbox0\hbox + {\externalfigure[#1][\c!page=#2,\c!height=\textheight]}% + \wd0\zeropoint + \box0} + \page} + +\def\copypages + {\dodoubleempty\docopypages} + +\def\docopypages[#1][#2]% + {\bgroup + \getfiguredimensions[#1]% + \getparameters[\??ip] + [\c!n=\noffigurepages, + \c!marking=\v!off, + \c!scale=\!!thousand, + \c!offset=\!!zeropoint, + #2]% + \dorecurse\@@ipn + {\vbox to \textheight + {\hsize\textwidth + \scratchdimen\@@ipoffset + \centeredbox + {\doifelse\@@ipmarking\v!on\cuthbox\hbox + {\ifdim\scratchdimen>\zeropoint\relax + \advance\vsize -2\scratchdimen + \advance\hsize -2\scratchdimen + \externalfigure[#1][\c!page=\recurselevel,#2,\c!scale=,\c!factor=\v!max,\c!offset=\v!overlay]% + \else + \externalfigure[#1][\c!page=\recurselevel,#2,\c!offset=\v!overlay]% + \fi}}} + \page} + \egroup} + +%D \macros +%D {combinepages} +%D +%D Yet another way of postprocessing is handles by \type +%D {\combinepages}. This macro builds a matrix of pages from a +%D file, for example: +%D +%D \starttyping +%D \setuppapersize +%D [A4][A4] % or [A4,landscape][A4,landscape] +%D +%D \setuplayout +%D [header=0pt,footer=1cm, +%D backspace=1cm,topspace=1cm, +%D width=middle,height=middle] +%D +%D \setupfootertexts +%D [presentation---\currentdate\space---\space\pagenumber] +%D +%D \starttext +%D \combinepages[slides][nx=2,ny=3,frame=on] +%D \stoptext +%D \stoptyping +%D +%D One can influence the way the pages are combined. (This +%D will be explained some time.) + +\def\combinepages + {\dodoubleempty\docombinepages} + +\def\docombinepages[#1][#2]% a=perpag b=free + {\bgroup + \dontcomplain + \getfiguredimensions[#1]% + \getparameters + [\??ip] + [\c!alternative=\v!a, + \c!n=\noffigurepages,\c!nx=2,\c!ny=2,\c!start=1,\c!stop=\!!maxcard, + \c!distance=\bodyfontsize, + \c!bottom=\vfill,\c!top=\vss, + \c!left=\hss,\c!right=\hss, + \c!before=\page,\c!after=\page,\c!inbetween=\blank, + \c!frame=,\c!background=,\c!backgroundcolor=, + #2]% + \def\@@ipname{#1}% + \@@ipbefore + \expandcheckedcsname{\??ip::\c!alternative:}\@@ipalternative\v!b + \@@ipafter + \egroup} + +\setvalue{\??ip::\c!alternative:\v!a}% + {\globallet\combinedpagescounter\@@ipstart + \doloop + {\vbox to \textheight + {\hsize\textwidth % ? ? + \scratchdimen\@@ipdistance + \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax + \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax + \dorecurse\@@ipny + {\hbox to \hsize + {\dorecurse\@@ipnx + {\vbox to \!!heighta + {\hsize\!!widtha + \vsize\!!heighta + \@@iptop + \hbox to \hsize + {\@@ipleft + \ifnum\combinedpagescounter>\@@ipstop\relax + \globallet\@@ipn\!!zerocount + \else\ifnum\combinedpagescounter>\@@ipn \else + \externalfigure[\@@ipname] + [\c!object=\v!no, + \c!page=\combinedpagescounter, + \c!factor=\v!max, + \c!background=\@@ipbackground, + \c!backgroundcolor=\@@ipbackgroundcolor, + \c!frame=\@@ipframe]% + \fi\fi + \@@ipright} + \@@ipbottom}% + \doglobal\increment\combinedpagescounter + \hfil}% + \hfilneg} + \vfil}% + \vfilneg}% + \page + \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}} + +\setvalue{\??ip::\c!alternative:\v!c}% + {\globallet\combinedpagescounter\@@ipstart + \doloop + {\vbox to \textheight + {\hsize\textwidth % ? ? + \scratchdimen\@@ipdistance + \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax + \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax + \hbox to \hsize + {\dorecurse\@@ipnx + {\@@ipleft + \vbox to \textheight + {\hsize\!!widtha + {\dorecurse\@@ipny + {\@@iptop + \hbox to \hsize + {\vbox to \!!heighta + {\hsize\!!widtha + \vsize\!!heighta + \ifnum\combinedpagescounter>\@@ipstop\relax + \globallet\@@ipn\!!zerocount + \else\ifnum\combinedpagescounter>\@@ipn \else + \externalfigure[\@@ipname] + [\c!object=\v!no, + \c!page=\combinedpagescounter, + \c!factor=\v!max, + \c!background=\@@ipbackground, + \c!backgroundcolor=\@@ipbackgroundcolor, + \c!frame=\@@ipframe]% + \fi\fi}} + \doglobal\increment\combinedpagescounter + \@@ipbottom}% + \vfil}% + \vfilneg} + \hfil}% + \hfilneg}} + \page + \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}} + +\setvalue{\??ip::\c!alternative:\v!horizontal}{\getvalue{\??ip::\c!alternative:\v!a}} +\setvalue{\??ip::\c!alternative:\v!vertical }{\getvalue{\??ip::\c!alternative:\v!c}} + +\setvalue{\??ip::\c!alternative:\v!b}% + {\globallet\combinedpagescounter\@@ipstart + \doloop + {\startbaselinecorrection + \scratchdimen\@@ipdistance + \!!widtha\dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax + \hbox to \hsize + {\dorecurse\@@ipnx + {\doglobal\increment\combinedpagescounter + \ifnum\combinedpagescounter>\@@ipn \else + \normalexpanded{\noexpand\externalfigure[\@@ipname] + [\c!page=\combinedpagescounter, + \c!width=\the\!!widtha,% todo \freezedimenmacro + \c!background=\@@ipbackground, + \c!backgroundcolor=\@@ipbackgroundcolor, + \c!frame=\@@ipframe]}% + \hfill + \fi}\hfillneg}% + \stopbaselinecorrection + \ifnum\combinedpagescounter<\@@ipn\relax + \@@ipinbetween + \else + \exitloop + \fi}} + +%D \macros +%D {setuppagecomment,startpagecomment} +%D +%D This command is not yet documented. Usage: +%D +%D \starttyping +%D \setuppagecomment[state=start,location=right] +%D +%D \startpagecomment +%D \input knuth +%D \stoppagecomment +%D \stoptyping + +\def\setuppagecomment + {\dosingleempty\dosetuppagecomment} + +\def\dosetuppagecomment[#1]% + {\getparameters[\??pc][#1]% + \doifelse\@@pcstate\v!start + {\doifinsetelse\@@pclocation{\v!bottom,\v!top} + {\setuppapersize[\c!left=\hskip\@@pcoffset]% + \edef\@@pcpaperheight{\the\dimexpr\paperheight+\@@pcoffset+\@@pcoffset+\@@pcdistance+\@@pcheight\relax}% + \edef\@@pcpaperwidth {\the\dimexpr\paperwidth+\@@pcoffset+\@@pcoffset\relax}% + \defineoverlay[\v!pagecomment][\placepagecommentTB]} + {\setuppapersize[\c!top=\vskip\@@pcoffset]% + \edef\@@pcpaperheight{\the\dimexpr\paperheight+\@@pcoffset+\@@pcoffset\relax}% + \edef\@@pcpaperwidth {\the\dimexpr\paperwidth+\@@pcoffset+\@@pcoffset+\@@pcdistance+\@@pcwidth\relax}% + \defineoverlay[\v!pagecomment][\placepagecommentLR]}% + \processaction + [\@@pclocation] + [ \v!bottom=>{\setuppapersize[\c!bottom =\vss,\c!top =\vskip\@@pcoffset]}, + \v!top=>{\setuppapersize[\c!top =\vss,\c!bottom =\vskip\@@pcoffset]}, + \v!left=>{\setuppapersize[\c!left =\hss,\c!right=\hskip\@@pcoffset]}, + \v!right=>{\setuppapersize[\c!right=\hss,\c!left =\hskip\@@pcoffset]}]% + \definepapersize + [\v!pagecomment] + [\c!height=\@@pcpaperheight, + \c!width=\@@pcpaperwidth]% + \let\@@pcprintpapersize\printpapersize + \setuppapersize[\papersize][\v!pagecomment]% + \setupbackgrounds[\v!paper][\c!background=\v!pagecomment]} + {\doif\@@pcstate\v!stop % else initialization invokes backgrounds + {% this should be tested first + % \normalexpanded{\noexpand\setuppapersize[\papersize][\@@pcprintpapersize]}% + \setupbackgrounds[\v!paper][\c!background=]}}} + +\def\@@pcprintpapersize{\printpapersize} + +\def\placepagecommentTB + {\vbox to \printpaperheight + {%\forgetall + \hsize\printpaperwidth + \vskip\@@pcoffset + \doifelse\@@pclocation\v!bottom{\vskip\dimexpr\paperheight+\@@pcdistance\relax}\vss + \hskip\@@pcoffset + \vbox to \@@pcheight + {%\forgetall + \hsize\paperwidth + \ifpagecomment + \getbuffer[\v!pagecomment]% + \global\pagecommentfalse + \fi}% + \hfill + \doifelse\@@pclocation\v!bottom\vss{\vskip\dimexpr\paperheight+\@@pcdistance\relax}% + \vskip\@@pcoffset}} + +\def\placepagecommentLR + {\hbox to \printpaperwidth + {\hskip\@@pcoffset + \doifelse\@@pclocation\v!right{\hskip\paperwidth\hskip\@@pcdistance}\hss + \vbox to \printpaperheight + {%\forgetall + \vskip\@@pcoffset + \hsize\@@pcwidth + \ifpagecomment + \getbuffer[\v!pagecomment]% + \global\pagecommentfalse + \fi + \vss}% + \doifelse\@@pclocation\v!right\hss{\hskip\paperwidth\hskip\@@pcdistance}% + \hskip\@@pcoffset}} + +\newif\ifpagecomment + +\setvalue{\e!start\v!pagecomment}% + {\global\pagecommenttrue + \dostartbuffer[\v!pagecomment][\e!start\v!pagecomment][\e!stop\v!pagecomment]} + +\setuppagecomment + [\c!state=, % \v!stop would invoke background calculation + \c!location=\v!bottom, + \c!offset=.5cm, + \c!distance=.5cm, + \c!height=5cm, + \c!width=10cm] + +% This macro cuts a page into n parts that can be pasted +% together. + +\def\slicepages + {\dotripleempty\doslicepages} + +\def\doslicepages[#1][#2][#3]% + {\ifthirdargument + \dodoslicepages[#1][#2][#3]% + \else + \dodoslicepages[#1][#2][#2]% + \fi} + +\newcounter\slicedpagenumber + +\def\dodoslicepages[#1][#2][#3]% + {\bgroup + \dontcomplain + \globallet\slicedpagenumber\!!zerocount + \getfiguredimensions[#1] + \getparameters + [\??ip] + [\c!n=1, + \c!offset=\!!zeropoint, + \c!hoffset=\!!zeropoint,\c!voffset=\!!zeropoint, + \c!width=\figurewidth,\c!height=\figureheight,#2] + \ifnum\@@ipn>\zerocount + \definepapersize + [\s!dummy][\c!height=\@@ipheight,\c!width=\@@ipwidth] + \setuppapersize + [\s!dummy][\s!dummy] + \setuplayout + [\c!backspace=\!!zeropoint,\c!topspace=\!!zeropoint, + \c!height=\v!middle,\c!width=\v!middle, + \c!textdistance=\!!zeropoint, + \c!header=\!!zeropoint,\c!footer=\!!zeropoint] + \fi + \dorecurse\noffigurepages + {\global\let\slicedpagenumber\recurselevel + \ifnum\@@ipn>\plusone + \dorecurse\@@ipn + {\let\xslice\recurselevel + \dorecurse\@@ipn + {\let\yslice\recurselevel + \clip + [\c!nx=\@@ipn,\c!ny=\@@ipn,\c!x=\xslice,\c!y=\yslice] + {\scale + [\c!scale=\@@ipn000] + {\externalfigure[#1][\c!page=\slicedpagenumber]}} + \page}} + \else + \ifodd\slicedpagenumber\relax + \getparameters[\??ip][#2] + \else + \getparameters[\??ip][#3] + \fi + \hskip\@@ipoffset + \clip + [\c!hoffset=\@@iphoffset,\c!voffset=\@@ipvoffset, + \c!height=\@@ipheight,\c!width=\@@ipwidth] + {\externalfigure[#1][\c!page=\slicedpagenumber]} + \page + \fi} + \egroup} + +% \starttext \slicepages[slice1.pdf][n=3] \stoptext + +\protect \endinput diff --git a/tex/context/base/page-imp.tex b/tex/context/base/page-imp.tex deleted file mode 100644 index e4ece04a6..000000000 --- a/tex/context/base/page-imp.tex +++ /dev/null @@ -1,1314 +0,0 @@ -%D \module -%D [ file=page-imp, % was: core-pag, -%D version=1998.01.15, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Pagebody Building (Imposition), -%D author=Hans Hagen, -%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. - -% much of this can more to run time loading ! - -\writestatus{loading}{ConTeXt Page Macros / Pagebody Building} - -\unprotect - -% sizing bug: -% -% \setuppapersize[A4][A4,landscape] \setuparranging[2UP] \showframe -% -% \starttext \dorecurse{10}{\input tufte \par} \stoptext - -% to be moved code: - -\newif\ifclipprintbox \clipprintboxtrue -%newif\ifclippagebox \clippageboxtrue - -\def\clippedprintbox#1#2% can be made more efficient, see other clipper - {\ifclipprintbox - \!!widthc \pagebackgroundoffset - \!!widtha \dimexpr\paperwidth + \!!widthc\relax - \!!heighta\dimexpr\paperheight+2\!!widthc\relax - \setbox#2\vbox to \paperheight{\vfill\box#2}% - \ht#2\paperheight - \wd#2\paperwidth - \setbox#2\vbox - {\framed - [\c!offset=\!!widthc,\c!strut=\v!no,\c!frame=\v!off] - {\box#2}}% - \setbox#2\hbox to \paperwidth - {\ifcase#1\relax - \!!widthb\zeropoint - \hskip-\!!widthc - \else - \!!widthb\!!widthc - \fi - \lower\!!widthc\hbox - {\clip - [\c!width=\!!widtha,\c!height=\!!heighta, - \c!hoffset=\!!widthb,\c!voffset=\zeropoint] - {\box#2}}}% - \wd#2\paperwidth - \ht#2\paperheight - \fi - \box#2\relax} - -\let\clippagebox \gobbleoneargument -\let\clipprintbox\gobbleoneargument - -% \setuppagenumbering[alternative=doublesided] -% \setupcolors[state=start] -% \setuppapersize[A4][A4,oversized] -% \setuplayout[location=middle,clipoffset=5mm] -% \setupbackgrounds -% [page] -% [frame=on,rulethickness=1mm, -% backgroundoffset=10mm,background=color,backgroundcolor=red] -% \starttext \dorecurse{10}{\input tufte \par} \stoptext - -\def\clippagebox#1% - {\ifdim\@@lyclipoffset>\zeropoint - \!!widtha \wd#1% - \!!heighta\ht#1% - \!!deptha \dp#1% - \setbox#1\hbox - {\!!widthb \@@lyclipoffset - \advance\!!heighta\dimexpr\!!deptha+2\!!widthb\relax - \advance\!!widtha \!!widthb - \doifbothsides - {\advance\!!widtha\!!widthb \!!widthc-\!!widthb \hskip\!!widthc}% - {\!!widthc\zeropoint} - {\!!widthc-\!!widthb \hskip\!!widthc}% - \lower\!!widthb\hbox - {\clip - [\c!hoffset=\!!widthc, - \c!voffset=-\!!widthb, - \c!width=\!!widtha, - \c!height=\!!heighta]% - {\box#1}}}% - \wd#1\!!widtha - \ht#1\!!heighta - \dp#1\!!deptha - \fi} - -%D \macros -%D {starttextdata} -%D -%D This is a user macro (appending to every last shipout is not -%D really user friendly. - -\newtoks \collectedtextdata - -\long\def\starttextdata#1\stoptextdata - {\doglobal\appendtoks#1\to\collectedtextdata} - -\def\flushtextdata - {\vsmashed{\the\collectedtextdata}% all dimensions zero - \global\collectedtextdata\emptytoks - \globallet\flushtextdata\donothing} - -\prependtoks \flushtextdata \to \everylastshipout - -% moved code: - -% \def\myshipout#1% -% {\beforeshipout % voor de pagebody dus ! -% \dontshowcomposition -% \ifarrangingpages\@EA\actualarrange\else\@EA\actualshipout\fi -% {\thisisrealpage\realfolio#1}% -% \gotonextrealpage -% \aftershipout} - -\def\installpagehandler#1#2% % a handler takes one argument: something to be boxed - {\setvalue{\??pp:\c!method:#1}{#2}} % and shipped out (don't depend on the exact package) - -\installpagehandler\v!normal - {\ifarrangingpages\expandafter\actualarrange\else\expandafter\actualshipout\fi} - -\def\myshipout#1% - {\beforeshipout % voor de pagebody dus ! - \dontshowcomposition - \executeifdefined{\??pp:\c!method:\@@ppmethod}\gobbleoneargument{\thisisrealpage\realfolio#1}% - \gotonextrealpage - \aftershipout} - -\newbox\postponedcontent - -% \def\flushatshipout -% {\dowithnextbox -% {\global\setbox\postponedcontent\hbox to \zeropoint -% {%\hskip-\maxdimen % niet hier, gaat mis in acrobat (clipt) -% \box\postponedcontent\flushnextbox}% -% \global\ht\postponedcontent\zeropoint -% \global\dp\postponedcontent\zeropoint -% \global\wd\postponedcontent\zeropoint}% -% \hbox} - -\def\flushatshipout - {\dowithnextbox - {\global\setbox\postponedcontent\hbox to \zeropoint - {%\hskip-\maxdimen % niet hier, gaat mis in acrobat (clipt) - \unhbox\postponedcontent\unhbox\nextbox}% - \global\ht\postponedcontent\zeropoint - \global\dp\postponedcontent\zeropoint - \global\wd\postponedcontent\zeropoint}% - \hbox} - -% \starttypen -% \def\pagestoshipout{1,3,5} -% \stoptypen - -\newcount\shippedoutpages - -\let\pagestoshipout\empty % {1,3,6} -\chardef\whichpagetoshipout=0 % 0=all 1=odd 2=even - -\ifx\finalizeshipoutbox\undefined \let\finalizeshipoutbox\firstofoneargument \fi - -\def\actualshipout#1% - {\global\advance\shippedoutpages\plusone - % this is not resource safe! - \ifx\pagestoshipout\empty - \ifcase\whichpagetoshipout\relax - \donetrue - \or % 1 - \ifodd\shippedoutpages\relax\donetrue\else\donefalse\fi - \or % 2 - \ifodd\shippedoutpages\relax\donefalse\else\donetrue\fi - \else - \donetrue - \fi - \else % testen, aangepast / expanded nodig ? - \expanded{\doifinsetelse{\the\shippedoutpages}{\pagestoshipout}}% - \donetrue\donefalse - \fi - \ifdone - \shipout\vbox - {\forgetall - \offinterlineskip - \dontcomplain - \scratchdimen-1in - \vskip\scratchdimen - \hskip\scratchdimen - \hbox % \setbox0=\box.. is nicer - {\setbox0\hbox{\finalizeshipoutbox{#1}}% just in case there are objects there, hook for testing - \setbox\scratchbox\hbox - {% before the main one ! - \ifcase\realfolio \or - \the\everyfirstshipout - \global\everyfirstshipout\emptytoks - \fi - % the main one - \the\everyshipout\relax - % always last (and after the main one) - \ifnum\realpageno=\lastpage\relax - \the\everylastshipout - \global\everylastshipout\emptytoks - \fi}% - \smashbox\scratchbox - \box\scratchbox - \box\postponedcontent % evt ver naar links ! - \box0}}% - \else - \message - {[\ifarrangingpages arranged \fi page - \ifarrangingpages\the\arrangeno\else\the\realpageno\fi\normalspace - not flushed]}% - \setbox0\hbox{#1}% - \deadcycles\zerocount - \fi} - -\def\actualarrange#1% - {\setbox0\hbox{\thisisrealpage{\realfolio}#1}% - \pusharrangedpage0% - \deadcycles\zerocount} - -%D We need a couple of boxes for duplex printing \unknown - -\newbox\arrangedpageA \newbox\arrangedpageB - -%D \unknown\ and some for simulating big sheets. - -\newbox\arrangedpageC \newbox\arrangedpageD -\newbox\arrangedpageE \newbox\arrangedpageF -\newbox\arrangedpageG \newbox\arrangedpageH - -\newif\ifswaparranged -\newif\ifnegatearranged -\newif\ifmirrorarranged -\newif\ifdoublearranged - -\newif\ifarrangingdisabled - -\def\arrangedrotationO{0} -\def\arrangedrotationE{0} - -\newcounter\arrangedpageN -\newcounter\arrangedpageM - -\chardef\arrangedpageT=1 -\chardef\arrangedpageX=1 -\chardef\arrangedpageY=1 - -\def\calculatepaperoffsets#1% - {\scratchdimen\getvalue{\??pp#1\c!offset}% - \divide\scratchdimen \arrangedpageX - \global\advance\paperwidth -2\scratchdimen - \scratchdimen\getvalue{\??pp#1\c!offset}% - \divide\scratchdimen \arrangedpageY - \global\advance\paperheight-2\scratchdimen} - -\newconditional\arrangedbackgroundokay % more ifs -> conditionals - -\def\setuparranging[#1]% - {\ifarrangingdisabled \else - \doifelse{#1}\v!disable - {\global\arrangingdisabledtrue} - {\global\arrangingdisabledfalse}% - \global\arrangingpagestrue - \global\negatearrangedfalse - \global\mirrorarrangedfalse - \global\doublearrangedfalse - \gdef\arrangedrotationO{0}% - \gdef\arrangedrotationE{180}% - \processallactionsinset - [#1] - [ \v!mirrored=>\global\mirrorarrangedtrue, - \v!doublesided=>\global\doublearrangedtrue, - \v!negative=>\global\negatearrangedtrue, - \v!rotated=>\gdef\arrangedrotationO {90}\gdef\arrangedrotationE{270}, - 90=>\gdef\arrangedrotationO {90}\gdef\arrangedrotationE{270}, - 180=>\gdef\arrangedrotationO{180}\gdef\arrangedrotationE{0}, - 270=>\gdef\arrangedrotationO{270}\gdef\arrangedrotationE{90}, - \s!reset=>\global\arrangingpagesfalse, - \v!background=>\global\settrue\arrangedbackgroundokay, - \s!unknown=>\checkinstalledpagearrangement\commalistelement]% - % no \s!default=> we can have aaa,,bbb - \ifx\handlearrangedpage\undefined - \global\arrangingpagesfalse - \fi - \doifcommonelse{#1}{90,270,\v!rotated} - {\swapmacros\horizontalcutmarks\verticalcutmarks}{}% ugly solution - \setuppapersize - \ifarrangingpages - \abortutilitygeneration - \fi - \fi} - -\def\installpagearrangement #1 % - {\setgvalue{\??pp\??pp#1}} - -\def\checkinstalledpagearrangement#1% can be empty: aaa,,bbb - {\executeifdefined{\??pp\??pp#1}\donothing} - -\def\dosetuparrangement#1#2#3#4#5#6#7#8% - {\global\chardef\arrangedpageX #1% - \global\chardef\arrangedpageY #2% - \global\chardef\arrangedpageT #3% - \global\chardef\horizontalcutmarks#4% - \global\chardef\verticalcutmarks #5% - \global\let \pusharrangedpage #6% - \global\let \poparrangedpages #7% - \global\let \handlearrangedpage#8} - -\installpagearrangement {\v!normal} - {\global\arrangingpagesfalse} - -\installpagearrangement 2*16 - {\dosetuparrangement{4}{4}{16}{5}{5}% - \pusharrangedpageTHIRTYTWO\poparrangedpagesAB\relax} - -\installpagearrangement 2*8 - {\dosetuparrangement{4}{2}{8}{5}{3}% - \pusharrangedpageSIXTEEN\poparrangedpagesAB\relax} - -\installpagearrangement 2*4 - {\dosetuparrangement{2}{2}{4}{3}{3}% - \pusharrangedpageEIGHT\poparrangedpagesAB\relax} - -\installpagearrangement 2*2 - {\dosetuparrangement{2}{1}{2}{3}{2}% - \pusharrangedpageFOURA\poparrangedpagesAB\relax} - -\installpagearrangement 2**2 - {\dosetuparrangement{2}{1}{2}{3}{2}% - \pusharrangedpageFOURB\poparrangedpagesAB\relax} - -\installpagearrangement 2SIDE - {\dosetuparrangement{2}{1}{2}{3}{2}% - \pusharrangedpageSIDETOP\poparrangedpagesTWO\handlearrangedpageSIDE} - -\installpagearrangement 2TOP - {\dosetuparrangement{1}{2}{2}{2}{3}% - \pusharrangedpageSIDETOP\poparrangedpagesTWO\handlearrangedpageTOP} - -\installpagearrangement 2UP - {\dosetuparrangement{2}{1}{4}{3}{2}% - \pusharrangedpageTWO\poparrangedpagesTWO\handlearrangedpageTWOUP} - -\installpagearrangement 2DOWN - {\dosetuparrangement{1}{2}{4}{2}{3}% - \pusharrangedpageTWO\poparrangedpagesTWO\handlearrangedpageTWODOWN} - -\installpagearrangement 2*4*2 % one defined by Willy Egger: - {\dosetuparrangement{2}{2}{4}{3}{2}% - \pusharrangedpageSIXTEENTWO\poparrangedpagesAtoD\relax} - -\installpagearrangement 2*2*4 % onother one of Willy Egger - {\dosetuparrangement{2}{1}{8}{3}{2}% - \pusharrangedpageSIXTEENFOUR\poparrangedpagesAtoH\relax} - -\installpagearrangement 2TOPSIDE - {\dosetuparrangement{1}{2}{4}{2}{3}% - \pusharrangedpageTWOTOPSIDE\poparrangedpagesTWOTOPSIDE\handlearrangedpageTOP} - -% \def\filluparrangedpages % beware: \realpageno is 1 ahead -% {\ifarrangingpages -% \scratchcounter-\realpageno -% \divide\scratchcounter \arrangedpageT -% \multiply\scratchcounter \arrangedpageT -% \advance\scratchcounter \realpageno -% \advance\scratchcounter \minusone -% \dorecurse\scratchcounter{\noheaderandfooterlines\ejectdummypage}% -% \fi} - -\def\filluparrangedpages % beware: \realpageno is 1 ahead - {\ifarrangingpages - \scratchcounter\numexpr\realpageno-\plusone\relax - \dosetmodulo\scratchcounter\arrangedpageT\scratchcounter - \ifcase\scratchcounter\else - \advance\scratchcounter \plusone - \dostepwiserecurse\scratchcounter\arrangedpageT\plusone - {\noheaderandfooterlines\ejectdummypage}% - \fi - \fi} - -\def\handlearrangedpageXandY#1#2#3#4#5% - {\global\setbox#5\hbox to \arrangedpageX\paperwidth - {\setbox\scratchbox\vbox to \arrangedpageY\paperheight - {\forgetall - \offinterlineskip - \dontcomplain - \vskip#4\paperheight - \hskip#3\paperwidth - \dorotatebox{\ifcase#2 0\else180\fi}\hbox{\box#1}% - \vfill}% - \wd\scratchbox\zeropoint - \box\scratchbox\box#5\hss}} - -\def\gotonextarrangepage - {\global\advance\arrangeno \plusone - \def\pagecutmarksymbol{\the\arrangeno}} - -\def\outputarrangedbox#1% - {\bgroup - \gotonextarrangepage - \ifnum\arrangedrotationO\arrangedrotationE>\zerocount - \setbox#1\vbox - {\ifdoublearranged - \ifodd\arrangeno - \dorotatebox\arrangedrotationO\hbox{\box#1}% - \else - \dorotatebox\arrangedrotationE\hbox{\box#1}% - \fi - \else - \dorotatebox\arrangedrotationO\hbox{\box#1}% - \fi}% - \fi - \ifmirrorarranged - \setbox#1\vbox{\domirrorbox\vbox{\box#1}}% - \fi - \ifnegatearranged - \negatecolorbox{#1}% - \fi - \finishpagebox#1% - \ifconditional\arrangedbackgroundokay\addprintbackground#1\fi - \actualshipout{\box#1}% - \egroup} - -%D The format file can be 16K smaller when we postpone the -%D real arrangments. Some day ... - -% TOP - -% 32/16/8/4/SIDE - -\def\poparrangedpagesAB - {\ifnum\arrangedpageN>\zerocount - \dontcomplain - \paperwidth\arrangedpageX\paperwidth - \paperheight\arrangedpageY\paperheight - \outputarrangedbox\arrangedpageA - \outputarrangedbox\arrangedpageB - \doglobal\newcounter\arrangedpageN - \fi} - -\def\pusharrangedpageTHIRTYTWO#1% taco's challenge - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \ifcase\arrangedpageN - \or \handlearrangedpageXandY{#1}033\arrangedpageA % 1 - \or \handlearrangedpageXandY{#1}003\arrangedpageB % 2 - \or \handlearrangedpageXandY{#1}100\arrangedpageB % 3 - \or \handlearrangedpageXandY{#1}130\arrangedpageA % 4 - \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5 - \or \handlearrangedpageXandY{#1}130\arrangedpageB % 6 - \or \handlearrangedpageXandY{#1}033\arrangedpageB % 7 - \or \handlearrangedpageXandY{#1}003\arrangedpageA % 8 - \or \handlearrangedpageXandY{#1}102\arrangedpageA % 9 - \or \handlearrangedpageXandY{#1}132\arrangedpageB % 10 - \or \handlearrangedpageXandY{#1}031\arrangedpageB % 11 - \or \handlearrangedpageXandY{#1}001\arrangedpageA % 12 - \or \handlearrangedpageXandY{#1}031\arrangedpageA % 13 - \or \handlearrangedpageXandY{#1}001\arrangedpageB % 14 - \or \handlearrangedpageXandY{#1}102\arrangedpageB % 15 - \or \handlearrangedpageXandY{#1}132\arrangedpageA % 16 - \or \handlearrangedpageXandY{#1}122\arrangedpageA % 17 - \or \handlearrangedpageXandY{#1}112\arrangedpageB % 18 - \or \handlearrangedpageXandY{#1}011\arrangedpageB % 19 - \or \handlearrangedpageXandY{#1}021\arrangedpageA % 20 - \or \handlearrangedpageXandY{#1}011\arrangedpageA % 21 - \or \handlearrangedpageXandY{#1}021\arrangedpageB % 22 - \or \handlearrangedpageXandY{#1}122\arrangedpageB % 23 - \or \handlearrangedpageXandY{#1}112\arrangedpageA % 24 - \or \handlearrangedpageXandY{#1}013\arrangedpageA % 25 - \or \handlearrangedpageXandY{#1}023\arrangedpageB % 26 - \or \handlearrangedpageXandY{#1}120\arrangedpageB % 27 - \or \handlearrangedpageXandY{#1}110\arrangedpageA % 28 - \or \handlearrangedpageXandY{#1}120\arrangedpageA % 29 - \or \handlearrangedpageXandY{#1}110\arrangedpageB % 30 - \or \handlearrangedpageXandY{#1}013\arrangedpageB % 31 - \or \handlearrangedpageXandY{#1}023\arrangedpageA % 32 - \poparrangedpages - \fi} - -\def\pusharrangedpageSIXTEEN#1% changed to match the official way of doing - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \ifcase\arrangedpageN - \or \handlearrangedpageXandY{#1}031\arrangedpageA % 1 - \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2 - \or \handlearrangedpageXandY{#1}031\arrangedpageB % 3 - \or \handlearrangedpageXandY{#1}001\arrangedpageA % 4 - \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5 - \or \handlearrangedpageXandY{#1}130\arrangedpageB % 6 - \or \handlearrangedpageXandY{#1}100\arrangedpageB % 7 - \or \handlearrangedpageXandY{#1}130\arrangedpageA % 8 - \or \handlearrangedpageXandY{#1}120\arrangedpageA % 9 - \or \handlearrangedpageXandY{#1}110\arrangedpageB % 10 - \or \handlearrangedpageXandY{#1}120\arrangedpageB % 11 - \or \handlearrangedpageXandY{#1}110\arrangedpageA % 12 - \or \handlearrangedpageXandY{#1}011\arrangedpageA % 13 - \or \handlearrangedpageXandY{#1}021\arrangedpageB % 14 - \or \handlearrangedpageXandY{#1}011\arrangedpageB % 15 - \or \handlearrangedpageXandY{#1}021\arrangedpageA % 16 - \poparrangedpages - \fi} - -\def\pusharrangedpageEIGHT#1% changed to match the official way of doing - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \ifcase\arrangedpageN - \or \handlearrangedpageXandY{#1}011\arrangedpageA % 1 - \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2 - \or \handlearrangedpageXandY{#1}100\arrangedpageB % 3 - \or \handlearrangedpageXandY{#1}110\arrangedpageA % 4 - \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5 - \or \handlearrangedpageXandY{#1}110\arrangedpageB % 6 - \or \handlearrangedpageXandY{#1}011\arrangedpageB % 7 - \or \handlearrangedpageXandY{#1}001\arrangedpageA % 8 - \poparrangedpages - \fi} - -\def\pusharrangedpageFOURA{\pusharrangedpageFOURdo01} -\def\pusharrangedpageFOURB{\pusharrangedpageFOURdo10} - -\def\pusharrangedpageFOURdo#1#2#3% - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \ifcase\arrangedpageN - \or \handlearrangedpageXandY{#3}010\arrangedpageA % 1 - \or \handlearrangedpageXandY{#3}0{#1}0\arrangedpageB % 2/3 not {1} - \or \handlearrangedpageXandY{#3}0{#2}0\arrangedpageB % 3/2 not {1} - \or \handlearrangedpageXandY{#3}000\arrangedpageA % 4 - \poparrangedpages - \fi} - -\def\pusharrangedpageSIDETOP#1% - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \ifcase\arrangedpageN - \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 - \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2 - \poparrangedpages - \fi} - -\def\handlearrangedpageSIDE - {\global\wd\arrangedpageA\paperwidth - \global\wd\arrangedpageB\paperwidth - \global\setbox\arrangedpageA\hbox - {\box\arrangedpageA\box\arrangedpageB}% - \global\ht\arrangedpageA\paperheight} - -\def\handlearrangedpageTOP - {\global\ht\arrangedpageA\paperheight - \global\ht\arrangedpageB\paperheight - \global\setbox\arrangedpageA\vbox - {\forgetall\offinterlineskip\vskip\paperheight - \box\arrangedpageA\box\arrangedpageB}% - \global\setbox\arrangedpageB\box\scratchbox} % ? - -% 2UP/2DOWN / 1pt prevents overflow - -\def\splitoffarrangedpagesTWO - {\splittopskip\zeropoint - \global\setbox\arrangedpageA\vsplit\arrangedpageB to \onepoint - \scratchdimen\dimexpr\ht\arrangedpageB-\onepoint\relax - \ifdim\scratchdimen>\onepoint - \setbox\scratchbox\vsplit\arrangedpageB to \scratchdimen - \fi} - -\def\handlearrangedpageTWOUP - {\splitoffarrangedpagesTWO - \ifswaparranged - \global\setbox\arrangedpageA\hbox - {\clippedprintbox0\arrangedpageA - \clippedprintbox1\arrangedpageB}% - \swaparrangedfalse - \else - \global\setbox\arrangedpageA\hbox - {\clippedprintbox0\arrangedpageB - \clippedprintbox1\arrangedpageA}% - \swaparrangedtrue - \fi - \global\ht\arrangedpageA\paperheight - \global\setbox\arrangedpageB\box\scratchbox} - -\def\handlearrangedpageTWODOWN - {\splitoffarrangedpagesTWO - \global\ht\arrangedpageA\paperheight - \global\ht\arrangedpageB\paperheight - \ifswaparranged - \global\setbox\arrangedpageA\vbox - {\forgetall\offinterlineskip\vskip\paperheight - \box\arrangedpageA\box\arrangedpageB}% - \swaparrangedfalse - \else - \global\setbox\arrangedpageA\vbox - {\forgetall\offinterlineskip\vskip\paperheight - \box\arrangedpageB\box\arrangedpageA}% - \swaparrangedtrue - \fi - \global\setbox\arrangedpageB\box\scratchbox} - -\def\poparrangedpagesTWO - {\ifnum\arrangedpageN>\zerocount - \dontcomplain - \swaparrangedfalse - \doloop - {\handlearrangedpage - \bgroup - \paperwidth\arrangedpageX\paperwidth - \paperheight\arrangedpageY\paperheight - \ht\arrangedpageA\paperheight - \wd\arrangedpageA\paperwidth - \outputarrangedbox\arrangedpageA - \egroup - \ifdim\ht\arrangedpageB=\zeropoint - \exitloop - \fi}% - \doglobal\newcounter\arrangedpageN - \fi} - -\def\pusharrangedpageTWO#1% - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \global\setbox\arrangedpageB\vbox - {\forgetall - \offinterlineskip - \unvbox\arrangedpageB - \allowbreak - \ht#1\onepoint - \dp#1\zeropoint - \vbox{\box#1}}} - -\def\poparrangedpagesTWOTOPSIDE - {\ifnum\arrangedpageN>\zerocount - \bgroup - \gdef\arrangedpageN{2}\poparrangedpagesTWO - \let\arrangedpageA\arrangedpageC - \let\arrangedpageB\arrangedpageD - \gdef\arrangedpageN{2}\poparrangedpagesTWO - \doglobal\newcounter\arrangedpageN - \egroup - \fi} - -\def\pusharrangedpageTWOTOPSIDE#1% - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \ifcase\arrangedpageN - \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 - \or \handlearrangedpageXandY{#1}000\arrangedpageC % 2 - \or \handlearrangedpageXandY{#1}000\arrangedpageB % 1 - \or \handlearrangedpageXandY{#1}000\arrangedpageD % 2 - \poparrangedpages - \fi} - -%D Willy Egger's sheet simulations: - -\def\poparrangedpagesAtoH - {\ifnum\arrangedpageN>\zerocount - \dontcomplain - \paperwidth\arrangedpageX\paperwidth - \paperheight\arrangedpageY\paperheight - \outputarrangedbox\arrangedpageA - \outputarrangedbox\arrangedpageB - \outputarrangedbox\arrangedpageC - \outputarrangedbox\arrangedpageD - \outputarrangedbox\arrangedpageE - \outputarrangedbox\arrangedpageF - \outputarrangedbox\arrangedpageG - \outputarrangedbox\arrangedpageH - \doglobal\newcounter\arrangedpageN - \fi} - -% to arrange 16 pages on 2 sheets to form one booklet - -\def\poparrangedpagesAtoD - {\ifnum\arrangedpageN>\zerocount - \dontcomplain - \paperwidth\arrangedpageX\paperwidth - \paperheight\arrangedpageY\paperheight - \outputarrangedbox\arrangedpageA - \outputarrangedbox\arrangedpageB - \outputarrangedbox\arrangedpageC - \outputarrangedbox\arrangedpageD - \doglobal\newcounter\arrangedpageN - \fi} - -% to arrange 16 pages on 4 sheets to form one booklet - -\def\pusharrangedpageSIXTEENFOUR#1% - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \ifcase\arrangedpageN - \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1 - \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2 - \or \handlearrangedpageXandY{#1}010\arrangedpageC % 3 - \or \handlearrangedpageXandY{#1}000\arrangedpageD % 4 - \or \handlearrangedpageXandY{#1}010\arrangedpageE % 5 - \or \handlearrangedpageXandY{#1}000\arrangedpageF % 6 - \or \handlearrangedpageXandY{#1}010\arrangedpageG % 7 - \or \handlearrangedpageXandY{#1}000\arrangedpageH % 8 - \or \handlearrangedpageXandY{#1}010\arrangedpageH % 9 - \or \handlearrangedpageXandY{#1}000\arrangedpageG % 10 - \or \handlearrangedpageXandY{#1}010\arrangedpageF % 11 - \or \handlearrangedpageXandY{#1}000\arrangedpageE % 12 - \or \handlearrangedpageXandY{#1}010\arrangedpageD % 13 - \or \handlearrangedpageXandY{#1}000\arrangedpageC % 14 - \or \handlearrangedpageXandY{#1}010\arrangedpageB % 15 - \or \handlearrangedpageXandY{#1}000\arrangedpageA % 16 - \poparrangedpages - \fi} - -% to arrange 16 pages on 2 sheets to form one booklet - -\def\pusharrangedpageSIXTEENTWO#1% - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \ifcase\arrangedpageN - \or \handlearrangedpageXandY{#1}011\arrangedpageA % 1 - \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2 - \or \handlearrangedpageXandY{#1}011\arrangedpageC % 3 - \or \handlearrangedpageXandY{#1}001\arrangedpageD % 4 - \or \handlearrangedpageXandY{#1}100\arrangedpageD % 5 - \or \handlearrangedpageXandY{#1}110\arrangedpageC % 6 - \or \handlearrangedpageXandY{#1}100\arrangedpageB % 7 - \or \handlearrangedpageXandY{#1}110\arrangedpageA % 8 - \or \handlearrangedpageXandY{#1}100\arrangedpageA % 9 - \or \handlearrangedpageXandY{#1}110\arrangedpageB % 10 - \or \handlearrangedpageXandY{#1}100\arrangedpageC % 11 - \or \handlearrangedpageXandY{#1}110\arrangedpageD % 12 - \or \handlearrangedpageXandY{#1}011\arrangedpageD % 13 - \or \handlearrangedpageXandY{#1}001\arrangedpageC % 14 - \or \handlearrangedpageXandY{#1}011\arrangedpageB % 15 - \or \handlearrangedpageXandY{#1}001\arrangedpageA % 16 - \poparrangedpages - \fi} - -% % handy for stickers etc, this way we can treat them as page -% -% \setuppapersize [XY][A4] -% \setuppaper [topspace=5mm,backspace=5mm,dx=1mm,dy=1mm,nx=2,ny=6] -% \setuplayout [page] [topspace=5mm,backspace=5mm] -% \setuplayout [page] -% \setuplayout [location=middle] -% \setuparranging [XY] -% \showframe -% -% \starttext \dorecurse{30}{test \recurselevel \page} \stoptext - -\def\pusharrangedpageXY#1% - {\doglobal\increment\arrangedpageN - \reportarrangedpage\arrangedpageN - \doglobal\increment\arrangedpageM - \global\setbox\arrangedpageB\hbox - \ifdim\@@ppwidth>\zeropoint to \@@ppwidth \fi - {\ifvoid\arrangedpageB\else - \unhbox\arrangedpageB - \ifdim\@@ppdx>\zeropoint \else \hss\fi - \hskip\@@ppdx - \ifdim\@@ppdx>\zeropoint \else \hss\fi - \fi - \box#1}% - \ifnum\arrangedpageM<\arrangedpageX\else - \global\setbox\arrangedpageA\vbox - \ifdim\@@ppheight>\zeropoint to \@@ppheight \fi - {\offinterlineskip - \ifvoid\arrangedpageA\else - \unvbox\arrangedpageA - \ifdim\@@ppdy>\zeropoint \else \vss\fi - \vskip\@@ppdy - \ifdim\@@ppdy>\zeropoint \else \vss\fi - \fi - \box\arrangedpageB}% - \doglobal\newcounter\arrangedpageM - \fi - \ifnum\arrangedpageN<\arrangedpageT\else - \poparrangedpages - \fi} - -\def\poparrangedpagesXY - {\ifnum\arrangedpageN>\zerocount - \dontcomplain - \paperwidth\arrangedpageX\paperwidth - \paperheight \arrangedpageY\paperheight - \outputarrangedbox\arrangedpageA - \doglobal\newcounter\arrangedpageN - \doglobal\newcounter\arrangedpageM - \fi} - -\installpagearrangement XY - {\dosetuparrangement\@@ppnx\@@ppny\@@ppxy\!!zerocount\!!zerocount - \pusharrangedpageXY\poparrangedpagesXY\relax} - -%D A crazy definition, don't guess who pushed me for the landscape option. - -\definepapersize - [XY] - [\c!height=\dimexpr\dimexpr\@@ppheight-\numexpr\@@ppny-1\relax\dimexpr\@@ppdy\relax\relax/\@@ppny\relax, - \c!width =\dimexpr\dimexpr\@@ppwidth -\numexpr\@@ppnx-1\relax\dimexpr\@@ppdx\relax\relax/\@@ppnx\relax] - -\setuppaper - [\c!width =\dimexpr\printpaperwidth -2\dimexpr\@@ppbackspace\relax\relax, - \c!height=\dimexpr\printpaperheight-2\dimexpr\@@pptopspace \relax\relax] - -% \definepageshift[test][horizontal][10pt,20pt,30pt,40pt,50pt] -% \definepageshift[test][vertical] [10pt,20pt,30pt,40pt,50pt] -% -% \setuppageshift[test] -% \setuppageshift[test][test] -% \setuppageshift[test][none] -% \setuppageshift[none][test] -% \setuppageshift[paper][test][test] % arrange only -% \setuppageshift[paper][test] % arrange only -% \setuppageshift[print][test][test] -% -% \showframe \dorecurse{100}{\input tufte \par} - -% #1=name #2=horizontal|vertical #3=shiftlist - -\def\definepageshift - {\dotripleargument\dodefinepageshift} - -\def\dodefinepageshift[#1][#2][#3]% - {\setvalue{\??pt#2:#1}{#3}} - -\letempty \hpageshifts \newcounter\nofhpageshifts -\letempty \vpageshifts \newcounter\nofvpageshifts - -% \let\shiftprintpagebox\gobbleoneargument -% \let\shiftpaperpagebox\gobbleoneargument - -\def\dogetpageshift#1#2#3% #1=\dimenx #2=\xpageshifts #3=\nofxpageshifts - {\ifx#2\empty - #1\zeropoint - \else - \doglobal\increment#3% - \getfromcommacommand[#2][#3]% - \ifx\commalistelement\empty - \globallet#3\!!plusone - \getfromcommacommand[#2][#3]% - \fi - \ifx\commalistelement\empty - #1\zeropoint - \else - #1=\commalistelement - \donetrue - \fi - \fi} - -\def\shiftpagebox#1% - {\donefalse - \dogetpageshift{\dimen0}\hpageshifts\nofhpageshifts - \dogetpageshift{\dimen2}\vpageshifts\nofvpageshifts - \ifdone % see also layout offsets, maybe \movebox - \edef\next{\wd#1\the\wd#1\ht#1\the\ht#1\dp#1\the\dp#1}% - \setbox#1\vbox % \forgetall already done - {\offinterlineskip\vskip\dimen2\hskip\dimen0\box#1}% - \next - \fi} - -\def\setuppageshift - {\dotripleempty\dosetuppageshift} - -\def\dosetuppageshift[#1][#2][#3]% page|paper horizontal vertical - {\ifthirdargument % paper=arrange - \let\hpageshifts\empty - \let\vpageshifts\empty - \let\shiftprintpagebox\gobbleoneargument - \let\shiftpaperpagebox\gobbleoneargument - \doifdefined{\??pt\v!horizontal:#2} - {\edef\hpageshifts{\getvalue{\??pt\v!horizontal:#2}}}% - \doifdefined{\??pt\v!vertical :#3} - {\edef\vpageshifts{\getvalue{\??pt\v!vertical :#3}}}% - \doif{#1}\v!page{\let\shiftprintpagebox\shiftpagebox}% - \doif{#1}\v!paper{\let\shiftpaperpagebox\shiftpagebox}% - \else\ifsecondargument - \doifinsetelse{#1}{\v!page,\v!paper} - {\setuppageshift[#1][#2][#2]} - {\setuppageshift[\v!page][#1][#2]}% - \else\iffirstargument - \setuppageshift[\v!page][#1][#1]% - \fi\fi\fi} - -%D One can (mis)use this mechanism, in close cooperation -%D with \PDFTEX\ to arrange pages of already produced files. -%D -%D \starttyping -%D \insertpages[file.pdf][1,3][n=30,width=18cm] -%D \stoptyping -%D -%D The pages are inserted in the text area, and even pages -%D are repositioned according to the width. In this example -%D empty pages are added after page 1 and 3. -%D -%D Selecting pages can be accomplished by: -%D -%D \starttyping -%D \filterpages[file.pdf][1,3,5][n=30,width=18cm] -%D \stoptyping -%D -%D One may pass \type {odd} or \type {even} instead of a -%D comma separated list. A third alternative is: -%D -%D \starttyping -%D \copypages[file.pdf][n=30,scale=950] -%D \stoptyping -%D -%D This macros inserts the page, according to the settings -%D provided. - -\def\insertpages - {\dotripleempty\doinsertpages} - -\def\doinsertpages[#1][#2][#3]% - {\doifassignmentelse{#2} - {\dodoinsertpages[#1][][#2]} - {\dodoinsertpages[#1][#2][#3]}} - -\def\dodoinsertpages[#1][#2][#3]% - {\bgroup - \dontcomplain - \getfiguredimensions[#1]% - \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]% - \doifinset0{#2}{\null\page}% - \dorecurse\@@ipn - {\dofilterpage{#1}\recurselevel - \doifinset\recurselevel{#2}{\null\page}}% - \egroup} - -\def\filterpages - {\dotripleempty\dofilterpages} - -\def\dofilterpages[#1][#2][#3]% % \noffigurepages not yet supported - {\bgroup - \dontcomplain - \getfiguredimensions[#1]% - \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]% - \doifelse{#2}\v!even - {\dorecurse\@@ipn - {\ifodd\recurselevel\relax\else\dofilterpage{#1}\recurselevel\fi}} - {\doifelse{#2}\v!odd - {\dorecurse\@@ipn - {\ifodd\recurselevel\relax\dofilterpage{#1}\recurselevel\fi}} - {\def\dodocommand##1% - {\ifnum##1>\@@ipn\else\dofilterpage{#1}{##1}\fi}% - \def\docommand##1% - {\dowithrange{##1}\dodocommand}% - \processcommalist[#2]\docommand}}% - \egroup} - -\def\dofilterpage#1#2% - {\hbox to \textwidth - {\ifdoublesided\ifdim\@@ipwidth>\zeropoint\relax\ifodd\realpageno\else - \hfill - \def\dowithfigure{\hskip-\@@ipwidth}% - \fi\fi\fi - \setbox0\hbox - {\externalfigure[#1][\c!page=#2,\c!height=\textheight]}% - \wd0\zeropoint - \box0} - \page} - -\def\copypages - {\dodoubleempty\docopypages} - -\def\docopypages[#1][#2]% - {\bgroup - \getfiguredimensions[#1]% - \getparameters[\??ip] - [\c!n=\noffigurepages, - \c!marking=\v!off, - \c!scale=\!!thousand, - \c!offset=\!!zeropoint, - #2]% - \dorecurse\@@ipn - {\vbox to \textheight - {\hsize\textwidth - \scratchdimen\@@ipoffset - \centeredbox - {\doifelse\@@ipmarking\v!on\cuthbox\hbox - {\ifdim\scratchdimen>\zeropoint\relax - \advance\vsize -2\scratchdimen - \advance\hsize -2\scratchdimen - \externalfigure[#1][\c!page=\recurselevel,#2,\c!scale=,\c!factor=\v!max,\c!offset=\v!overlay]% - \else - \externalfigure[#1][\c!page=\recurselevel,#2,\c!offset=\v!overlay]% - \fi}}} - \page} - \egroup} - -%D \macros -%D {combinepages} -%D -%D Yet another way of postprocessing is handles by \type -%D {\combinepages}. This macro builds a matrix of pages from a -%D file, for example: -%D -%D \starttyping -%D \setuppapersize -%D [A4][A4] % or [A4,landscape][A4,landscape] -%D -%D \setuplayout -%D [header=0pt,footer=1cm, -%D backspace=1cm,topspace=1cm, -%D width=middle,height=middle] -%D -%D \setupfootertexts -%D [presentation---\currentdate\space---\space\pagenumber] -%D -%D \starttext -%D \combinepages[slides][nx=2,ny=3,frame=on] -%D \stoptext -%D \stoptyping -%D -%D One can influence the way the pages are combined. (This -%D will be explained some time.) - -\def\combinepages - {\dodoubleempty\docombinepages} - -\def\docombinepages[#1][#2]% a=perpag b=free - {\bgroup - \dontcomplain - \getfiguredimensions[#1]% - \getparameters - [\??ip] - [\c!alternative=\v!a, - \c!n=\noffigurepages,\c!nx=2,\c!ny=2,\c!start=1,\c!stop=\!!maxcard, - \c!distance=\bodyfontsize, - \c!bottom=\vfill,\c!top=\vss, - \c!left=\hss,\c!right=\hss, - \c!before=\page,\c!after=\page,\c!inbetween=\blank, - \c!frame=,\c!background=,\c!backgroundcolor=, - #2]% - \def\@@ipname{#1}% - \@@ipbefore - \executeifdefined{\strippedcsname\docombinepages\@@ipalternative}\docombinepagesb - \@@ipafter - \egroup} - -\def\docombinepagesa - {\globallet\combinedpagescounter\@@ipstart - \doloop - {\vbox to \textheight - {\hsize\textwidth % ? ? - \scratchdimen\@@ipdistance - \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax - \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax - \dorecurse\@@ipny - {\hbox to \hsize - {\dorecurse\@@ipnx - {\vbox to \!!heighta - {\hsize\!!widtha - \vsize\!!heighta - \@@iptop - \hbox to \hsize - {\@@ipleft - \ifnum\combinedpagescounter>\@@ipstop\relax - \globallet\@@ipn\!!zerocount - \else\ifnum\combinedpagescounter>\@@ipn \else - \externalfigure[\@@ipname] - [\c!object=\v!no, - \c!page=\combinedpagescounter, - \c!factor=\v!max, - \c!background=\@@ipbackground, - \c!backgroundcolor=\@@ipbackgroundcolor, - \c!frame=\@@ipframe]% - \fi\fi - \@@ipright} - \@@ipbottom}% - \doglobal\increment\combinedpagescounter - \hfil}% - \hfilneg} - \vfil}% - \vfilneg}% - \page - \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}} - -\def\docombinepagesc - {\globallet\combinedpagescounter\@@ipstart - \doloop - {\vbox to \textheight - {\hsize\textwidth % ? ? - \scratchdimen\@@ipdistance - \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax - \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax - \hbox to \hsize - {\dorecurse\@@ipnx - {\@@ipleft - \vbox to \textheight - {\hsize\!!widtha - {\dorecurse\@@ipny - {\@@iptop - \hbox to \hsize - {\vbox to \!!heighta - {\hsize\!!widtha - \vsize\!!heighta - \ifnum\combinedpagescounter>\@@ipstop\relax - \globallet\@@ipn\!!zerocount - \else\ifnum\combinedpagescounter>\@@ipn \else - \externalfigure[\@@ipname] - [\c!object=\v!no, - \c!page=\combinedpagescounter, - \c!factor=\v!max, - \c!background=\@@ipbackground, - \c!backgroundcolor=\@@ipbackgroundcolor, - \c!frame=\@@ipframe]% - \fi\fi}} - \doglobal\increment\combinedpagescounter - \@@ipbottom}% - \vfil}% - \vfilneg} - \hfil}% - \hfilneg}} - \page - \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}} - -\let\docombinepageshorizontal\docombinepagesa -\let\docombinepagesvertical \docombinepagesc - -\def\docombinepagesb - {\globallet\combinedpagescounter\@@ipstart - \doloop - {\startbaselinecorrection - \scratchdimen\@@ipdistance - \!!widtha\dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax - \hbox to \hsize - {\dorecurse\@@ipnx - {\doglobal\increment\combinedpagescounter - \ifnum\combinedpagescounter>\@@ipn \else - \expanded{\externalfigure[\@@ipname] - [\c!page=\combinedpagescounter, - \c!width=\the\!!widtha,% todo \freezedimenmacro - \c!background=\@@ipbackground, - \c!backgroundcolor=\@@ipbackgroundcolor, - \c!frame=\@@ipframe]}% - \hfill - \fi}\hfillneg}% - \stopbaselinecorrection - \ifnum\combinedpagescounter<\@@ipn\relax - \@@ipinbetween - \else - \exitloop - \fi}} - -%D \macros -%D {setuppagecomment,startpagecomment} -%D -%D This command is not yet documented. Usage: -%D -%D \starttyping -%D \setuppagecomment[state=start,location=right] -%D -%D \startpagecomment -%D \input knuth -%D \stoppagecomment -%D \stoptyping - -\def\setuppagecomment - {\dosingleempty\dosetuppagecomment} - -\def\dosetuppagecomment[#1]% - {\getparameters[\??pc][#1]% - \doifelse\@@pcstate\v!start - {\doifinsetelse\@@pclocation{\v!bottom,\v!top} - {\setuppapersize[\c!left=\hskip\@@pcoffset]% - \edef\@@pcpaperheight{\the\dimexpr\paperheight+\@@pcoffset+\@@pcoffset+\@@pcdistance+\@@pcheight\relax}% - \edef\@@pcpaperwidth {\the\dimexpr\paperwidth+\@@pcoffset+\@@pcoffset\relax}% - \defineoverlay[\v!pagecomment][\placepagecommentTB]} - {\setuppapersize[\c!top=\vskip\@@pcoffset]% - \edef\@@pcpaperheight{\the\dimexpr\paperheight+\@@pcoffset+\@@pcoffset\relax}% - \edef\@@pcpaperwidth {\the\dimexpr\paperwidth+\@@pcoffset+\@@pcoffset+\@@pcdistance+\@@pcwidth\relax}% - \defineoverlay[\v!pagecomment][\placepagecommentLR]}% - \processaction - [\@@pclocation] - [ \v!bottom=>{\setuppapersize[\c!bottom =\vss,\c!top =\vskip\@@pcoffset]}, - \v!top=>{\setuppapersize[\c!top =\vss,\c!bottom =\vskip\@@pcoffset]}, - \v!left=>{\setuppapersize[\c!left =\hss,\c!right=\hskip\@@pcoffset]}, - \v!right=>{\setuppapersize[\c!right=\hss,\c!left =\hskip\@@pcoffset]}]% - \definepapersize - [\v!pagecomment] - [\c!height=\@@pcpaperheight, - \c!width=\@@pcpaperwidth]% - \let\@@pcprintpapersize\printpapersize - \setuppapersize[\papersize][\v!pagecomment]% - \setupbackgrounds[\v!paper][\c!background=\v!pagecomment]} - {\doif\@@pcstate\v!stop % else initialization invokes backgrounds - {% this should be tested first - % \expanded{\setuppapersize[\papersize][\@@pcprintpapersize]}% - \setupbackgrounds[\v!paper][\c!background=]}}} - -\def\@@pcprintpapersize{\printpapersize} - -\def\placepagecommentTB - {\vbox to \printpaperheight - {\forgetall - \hsize\printpaperwidth - \vskip\@@pcoffset - \doifelse\@@pclocation\v!bottom{\vskip\dimexpr\paperheight+\@@pcdistance\relax}\vss - \hskip\@@pcoffset - \vbox to \@@pcheight - {\forgetall - \hsize\paperwidth - \ifpagecomment - \getbuffer[\v!pagecomment]% - \global\pagecommentfalse - \fi}% - \hfill - \doifelse\@@pclocation\v!bottom\vss{\vskip\dimexpr\paperheight+\@@pcdistance\relax}% - \vskip\@@pcoffset}} - -\def\placepagecommentLR - {\hbox to \printpaperwidth - {\hskip\@@pcoffset - \doifelse\@@pclocation\v!right{\hskip\paperwidth\hskip\@@pcdistance}\hss - \vbox to \printpaperheight - {\forgetall - \vskip\@@pcoffset - \hsize\@@pcwidth - \ifpagecomment - \getbuffer[\v!pagecomment]% - \global\pagecommentfalse - \fi - \vss}% - \doifelse\@@pclocation\v!right\hss{\hskip\paperwidth\hskip\@@pcdistance}% - \hskip\@@pcoffset}} - -\newif\ifpagecomment - -\setvalue{\e!start\v!pagecomment}% - {\global\pagecommenttrue - \dostartbuffer[\v!pagecomment][\e!start\v!pagecomment][\e!stop\v!pagecomment]} - -\setuppagecomment - [\c!state=, % \v!stop would invoke background calculation - \c!location=\v!bottom, - \c!offset=.5cm, - \c!distance=.5cm, - \c!height=5cm, - \c!width=10cm] - -% This macro cuts a page into n parts that can be pasted -% together. - -\def\slicepages - {\dotripleempty\doslicepages} - -\def\doslicepages[#1][#2][#3]% - {\ifthirdargument - \dodoslicepages[#1][#2][#3]% - \else - \dodoslicepages[#1][#2][#2]% - \fi} - -\newcounter\slicedpagenumber - -\def\dodoslicepages[#1][#2][#3]% - {\bgroup - \dontcomplain - \globallet\slicedpagenumber\!!zerocount - \getfiguredimensions[#1] - \getparameters - [\??ip] - [\c!n=1, - \c!offset=\!!zeropoint, - \c!hoffset=\!!zeropoint,\c!voffset=\!!zeropoint, - \c!width=\figurewidth,\c!height=\figureheight,#2] - \ifnum\@@ipn>\zerocount - \definepapersize - [\s!dummy][\c!height=\@@ipheight,\c!width=\@@ipwidth] - \setuppapersize - [\s!dummy][\s!dummy] - \setuplayout - [\c!backspace=\!!zeropoint,\c!topspace=\!!zeropoint, - \c!height=\v!middle,\c!width=\v!middle, - \c!textdistance=\!!zeropoint, - \c!header=\!!zeropoint,\c!footer=\!!zeropoint] - \fi - \dorecurse\noffigurepages - {\global\let\slicedpagenumber\recurselevel - \ifnum\@@ipn>\plusone - \dorecurse\@@ipn - {\let\xslice\recurselevel - \dorecurse\@@ipn - {\let\yslice\recurselevel - \clip - [\c!nx=\@@ipn,\c!ny=\@@ipn,\c!x=\xslice,\c!y=\yslice] - {\scale - [\c!scale=\@@ipn000] - {\externalfigure[#1][\c!page=\slicedpagenumber]}} - \page}} - \else - \ifodd\slicedpagenumber\relax - \getparameters[\??ip][#2] - \else - \getparameters[\??ip][#3] - \fi - \hskip\@@ipoffset - \clip - [\c!hoffset=\@@iphoffset,\c!voffset=\@@ipvoffset, - \c!height=\@@ipheight,\c!width=\@@ipwidth] - {\externalfigure[#1][\c!page=\slicedpagenumber]} - \page - \fi} - \egroup} - -% \starttext \slicepages[slice1.pdf][n=3] \stoptext - -\protect \endinput diff --git a/tex/context/base/page-ini.mkiv b/tex/context/base/page-ini.mkiv index 4c230c1fd..249b6eca6 100644 --- a/tex/context/base/page-ini.mkiv +++ b/tex/context/base/page-ini.mkiv @@ -38,13 +38,6 @@ \fi -\ifx\recalculatelogos\undefined - - \let \recalculatelogos \relax - \let \addlogobackground \gobbleoneargument % - -\fi - \ifx\recalculatebackgrounds\undefined \let \recalculatebackgrounds \relax @@ -132,22 +125,6 @@ % floats: % % tricky in balancing mode, a la huidige multi columns - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved \ifx\dosetuplayout\undefined % overloaded in page-lay ! @@ -455,17 +432,9 @@ \ifx\bye\undefined \def\bye{\par\vfill\supereject\end} \fi % plain tex command % floats -% -% \def\ejectinsert -% {\flushnotes -% \bgroup -% \noftopfloats\plusthousand -% \nofbotfloats\zerocount -% \doflushfloats -% \egroup} \def\ejectinsert - {\flushnotes + {%\flushnotes already done \bgroup \noftopfloats\plusthousand \nofbotfloats\zerocount @@ -481,7 +450,7 @@ \def\ejectdummypage {\endgraf \ifvmode \ejectinsert - \hardespatie % will be different + \fixedspace \vfill \gotonextpage \fi} @@ -490,7 +459,7 @@ {} \def\afterfinaloutput - {\forgetall + {%\forgetall \vskip\zeropoint\relax \ifvoid\normalpagebox \else \unvbox\normalpagebox @@ -507,36 +476,32 @@ \adaptfuzzypagegoal} % watch this hack! \def\dofinaloutput#1#2% \vbox: prevents spurious spaces in every..pagebody - {\beforefinaloutput + {\forgetall + \beforefinaloutput \the\everybeforeshipout % brrr not in shipout \the\pageboundsettings - \myshipout{\hbox{\vbox{\dopagebody#1#2\setpagecounters}}}% + \myshipout{\hbox{\vbox{\dopagebody#1#2}}}% is this hbox needed \the\everyaftershipout - \afterfinaloutput - \popproperties} % ... and here ... + \afterfinaloutput} \def\donofinaloutput#1#2% - {\beforefinaloutput + {\forgetall + \beforefinaloutput \the\everybeforeshipout \setpagecounters \message{[-\the\realpageno]}% - \setbox\scratchbox\hbox - {%\the\everyshipout % still needed here ? - \dopagebody#1#2}% + \setbox\scratchbox\hbox{\dopagebody#1#2}% \deadcycles\zerocount - \gotonextrealpage + \setnextrealpageno \the\everyaftershipout - \afterfinaloutput - \popproperties} % ... and here + \afterfinaloutput} % beware: \ifprocessingpages is in use -\ifx\checkpageversion\undefined \let\checkpageversion\relax \fi % todo: hook into \everybeforeshipout -\ifx\doflushspread \undefined \let\doflushspread \relax \fi % todo +\ifdefined\doflushspread\else \let\doflushspread\relax \fi % todo \def\finaloutput#1#2% - {\checkpageversion - \ifprocessingpages + {\ifprocessingpages \ifpageselected \@EAEAEA\dofinaloutput \else @@ -624,9 +589,8 @@ \offinterlineskip \vskip\topspace \hsize\paperwidth - \hfill\hbox{\placetestinfo\hskip.5cm}\vss + %\hfill\hbox{\placetestinfo\hskip.5cm}\vss % obsolete \settexthoffset\hskip\texthoffset % brrrr - %\tlap{\placeversioninfo}\vskip.5cm \vbox to 1cm{\vss\placeversioninfo\vss}}} \def\dotestinfo#1#2#3% @@ -651,44 +615,6 @@ \fi \fi\fi} -% this will be inserts some day - -% \installinsertion\referenceinfobox -% \installinsertion\registerinfobox -% \installinsertion\floatinfobox - -\newbox\referenceinfobox -\newbox\registerinfobox -\newbox\floatinfobox - -\def\referenceinfo{\dotestinfo\referenceinfobox} -\def\registerinfo {\dotestinfo\registerinfobox} -\def\floatinfo {\dotestinfo\floatinfobox} - -\def\placetestinfo - {\vbox to \makeupheight - {\forgetall - \infofont - \hsize10em - \ifvoid\floatinfobox\else - \strut \getmessage\m!systems{24}% - \vskip\!!sixpoint - \unvbox\floatinfobox - \vskip\!!twelvepoint - \fi - \ifvoid\referenceinfobox\else - \strut \getmessage\m!systems{25}% - \vskip\!!sixpoint - \unvbox\referenceinfobox - \vskip\!!twelvepoint - \fi - \ifvoid\registerinfobox\else - \strut \getmessage\m!systems{26}% - \vskip\!!sixpoint - \unvbox\registerinfobox - \fi - \vss}} - \version[\v!final] % bewaren tvb documentatie @@ -803,7 +729,7 @@ {\ifsavepagebody\global\setbox\savedpagebody\fi \vbox {\beginrestorecatcodes - \forgetall % igv problemen, check: \boxmaxdepth\maxdimen +% \forgetall % igv problemen, check: \boxmaxdepth\maxdimen \boxmaxdepth\maxdimen % new \dontcomplain % the following plugin uses and sets pagebox; beware: this @@ -854,7 +780,6 @@ \getmainbox#1#2}% including footnotes \ifcase\pageornamentstate \addmainbackground \pagebox - \addlogobackground \pagebox \fi \buildpagebox \pagebox \addstatusinfo \pagebox} @@ -870,8 +795,9 @@ \negateprintbox #1% \fi} +\appendtoks \restoreouterspacing \to \everybeforepagebody \appendtoks \restoreglobalbodyfont \to \everybeforepagebody -\appendtoks \restorecolumnsettings \to \everybeforepagebody +%appendtoks \restoreouterspacing \to \everybeforepagebody \ifx\nestednewbox\undefined \newbox\nestednextbox \fi @@ -881,14 +807,14 @@ {%\getallmarks % now in following token register \the\everybeforepagebody \starttextproperties - \gotonextsubpage % nog eens: als in pagina (tbv standaard opmaak) - \dontshowboxes % dan hier blokkeren en verderop resetten + \setnextsubpageno % nog eens: als in pagina (tbv standaard opmaak) + \dontshowboxes % dan hier blokkeren en verderop resetten % \shipoutfacingpage \checkmargeblokken \the\beforeeverypage - \flushtoks\beforepage + \normalexpanded{\global\beforepage\emptytoks\the\beforepage}% \scratchtoks\beforepage\global\beforepage\emptytoks\the\scratchtoks % was \flushtoks\beforepage \inpagebodytrue\buildpagebody#1#2% - \flushtoks\afterpage + \normalexpanded{\global\afterpage \emptytoks\the\afterpage }% \scratchtoks\afterpage \global\afterpage \emptytoks\the\scratchtoks % was \flushtoks\afterpage \the\aftereverypage \resetpagebreak %updatelistreferences % now in aftereverypage @@ -898,65 +824,12 @@ \newtoks\pageboundsettings -\prependtoks \initializepaper \to \pageboundsettings +% \prependtoks \initializepaper \to \pageboundsettings % not here \newif\ifpagebreakdisabled \pagebreakdisabledfalse -% \chardef\testpagemethod=0 % todo: \testnewpage[method=,lines=,voffset=] -% -% \def\testpage {\dotripleempty\dotestpage[\plusone]} -% \def\testpageonly{\dotripleempty\dotestpage[\plustwo]} -% -% \def\dotestpage[#1][#2][#3]% -% {%\relax % needed before \if -% \endgraf -% \ifpagebreakdisabled -% % do nothing -% \else -% %ifnum#1=\plusone\synchronizeoutput\fi -% \ifdim\pagegoal<\maxdimen \relax -% \ifdim\pagetotal<\pagegoal \relax -% \scratchdimen\lineheight -% \multiply\scratchdimen#2\relax -% \advance\scratchdimen \pagetotal -% \ifdim\lastskip<\parskip -% \advance\scratchdimen \parskip -% \fi -% \ifthirdargument -% \advance\scratchdimen#3\relax -% \fi -% \ifcase\testpagemethod -% \ifdim\scratchdimen>.99\pagegoal -% \vfill\eject % \penalty-\!!tenthousand\relax -% \fi -% \or -% \advance\scratchdimen-\pagegoal -% \ifdim\scratchdimen>-\lineheight -% \vfill\eject % \penalty-\!!tenthousand\relax -% \fi -% \or -% \getnoflines\pagegoal -% \advance\scratchdimen-\noflines\lineheight \relax -% \ifdim\scratchdimen>-\lineheight -% \vfill\eject % \penalty-\!!tenthousand\relax -% \fi -% \or % same as 0 but more accurate -% \advance\scratchdimen-10\s!sp\relax -% \ifdim\scratchdimen>\pagegoal -% \vfill\eject % \penalty-\!!tenthousand\relax -% \fi -% \fi -% \else -% % force page break / new -% % \vfill\eject % \penalty-\!!tenthousand\relax -% \fi -% \else -% \ifnum#1=\plusone\goodbreak\fi -% \fi -% \fi} - \chardef\testpagemethod \zerocount % todo: \testnewpage[method=,lines=,voffset=] \chardef\testpagetrigger\zerocount @@ -1075,38 +948,32 @@ \def\executepagebreakhandler#1% {\edef\@@pagespecification{#1}% - \doifdefinedelse{\??pe:\@@pagespecification} - {\getvalue{\??pe:\@@pagespecification}} - {\doifdefinedelse{\??pe::\@@pagespecification} - {\executepagebreakhandlers{\getvalue{\??pe::\@@pagespecification}}} - {\getvalue{\??pe:\s!unknown}}}} + \ifcsname\??pe:\@@pagespecification\endcsname + \csname\??pe:\@@pagespecification\endcsname + \else\ifcsname\??pe::\@@pagespecification\endcsname + \executepagebreakhandlers{\csname\??pe::\@@pagespecification\endcsname}% + \else + \csname\??pe:\s!unknown\endcsname + \fi\fi} \long\def\installpagebreakhandler#1#2% {\long\setvalue{\??pe:#1}{#2}} -% \definecomplexorsimple\pagebreak - -% \def\simplepagebreak -% {\executepagebreakhandler\v!ja} - -% \def\complexpagebreak[#1]% if empty, do nothing and avoid processing, -% {\flushnotes % see head's; watch how we group -% \doifsomething{#1}{\bgroup\executepagebreakhandlers{#1}\egroup}} - \unexpanded\def\pagebreak {\dosingleempty\dopagebreak} \def\dopagebreak[#1]% so, page ornaments are reset after a pagebreak command, unless set {\bgroup + \flushnotes \edef\prevrealpageno{\the\realpageno}% \ifcase\pageornamentstate \or % disable reset after shipout \global\chardef\pageornamentstate\plustwo \fi \iffirstargument % or if empty i.e. [] - \flushnotes\executepagebreakhandlers{#1}% + \executepagebreakhandlers{#1}% \else % so, no pagebreak when \pagebreak[] ! ! ! - \flushnotes\executepagebreakhandler\v!yes + \executepagebreakhandler\v!yes \fi \ifnum\prevrealpageno<\realpageno \global\chardef\pageornamentstate\zerocount @@ -1375,7 +1242,7 @@ \def\dodobeforeshipout#1% {\global\let\beforeshipout\relax - \getvalue{\??pg#1\c!before}} + \csname\??pg#1\c!before\endcsname} \def\dobeforeshipout {\doifsomething\currentpageselection @@ -1384,7 +1251,7 @@ \def\dododoaftershipout#1% {\global\let\aftershipout\relax \global\let\currentpageselection\empty - \getvalue{\??pg#1\c!after}} + \csname\??pg#1\c!after\endcsname} \def\dodoaftershipout#1% {\doifelsevalue{\??pg#1\c!option}\v!doublesided diff --git a/tex/context/base/page-ins.mkii b/tex/context/base/page-ins.mkii new file mode 100644 index 000000000..069153434 --- /dev/null +++ b/tex/context/base/page-ins.mkii @@ -0,0 +1,103 @@ +%D \module +%D [ file=core-ins, +%D version=2002.04.16, +%D title=\CONTEXT\ Insertion Macros, +%D subtitle=Insertions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / Insertions} + +%D Insertions are special data collections that are associated +%D to \TEX's internal page builder. When multiple footnote +%D classes were introduced, I decided to isolate some of the +%D functionality in a module. + +\unprotect + +\newtoks\@@insertionlist + +\def\processinsertions{\the\@@insertionlist} + +\let\doprocessinsert\gobbleoneargument + +%\def\installinsertion#1% +% {\ifx#1\undefined +% \newinsert#1% +% \count#1\plusthousand +% \skip #1\zeropoint +% \dimen#1\maxdimen +% \appendtoks\doprocessinsert#1\to\@@insertionlist +% \fi} + +\def\installinsertion#1% + {\ifx#1\undefined + \let#1\relax + \fi + \ifx#1\relax % permits \csname...\endcsname + \newinsert#1% + \count#1\plusthousand + \skip #1\zeropoint + \dimen#1\maxdimen + \appendtoks\doprocessinsert#1\to\@@insertionlist + \fi} + + +\def\synchronizeinsertions + {\def\doprocessinsert##1{\ifvoid##1\else\insert##1{\unvbox##1}\fi}% + \processinsertions} + +%D For instance, when we postpone footnotes, we need to save +%D some data related to the inserts. The next methods are +%D far from ideal, but better than nothing. We save and +%D restore box content and associated data independently. +%D The box content is only restores when non||void. + +\def\backupinsertion#1% + {\csname\string#1\endcsname} + +\def\installbackupinsertion#1% + {\expandafter\newinsert\csname\string#1\endcsname + \count\backupinsertion#1\zerocount + \skip \backupinsertion#1\zeropoint + \dimen\backupinsertion#1\maxdimen} + +\def\saveinsertionbox#1% + {\ifdim\ht#1>\zeropoint % hm, actually unknown + \global\setbox\backupinsertion#1\box#1% + \else + \global\setbox\backupinsertion#1\emptybox + \fi} + +\def\restoreinsertionbox#1% + {\ifvoid\backupinsertion#1\else % if void, we keep the content + \global\setbox#1\box\backupinsertion#1% + \fi} + +\def\eraseinsertionbackup#1% + {\global\setbox\backupinsertion#1\emptybox} + +\def\saveinsertiondata#1% + {\global\skip \backupinsertion#1\skip #1% + \global\count\backupinsertion#1\count#1% + \global\dimen\backupinsertion#1\dimen#1} + +\def\restoreinsertiondata#1% + {\global\skip #1\skip \backupinsertion#1% + \global\count#1\count\backupinsertion#1% + \global\dimen#1\dimen\backupinsertion#1} + +%D Auxiliary macros: + +\def\addinsertionheight#1\to#2% + {\ifvoid#1\else + \advance#2 1\skip#1\relax + \advance#2 \ht #1\relax + \fi} + +\protect \endinput diff --git a/tex/context/base/page-ins.mkiv b/tex/context/base/page-ins.mkiv new file mode 100644 index 000000000..3e12bfcf0 --- /dev/null +++ b/tex/context/base/page-ins.mkiv @@ -0,0 +1,94 @@ +%D \module +%D [ file=core-ins, +%D version=2002.04.16, +%D title=\CONTEXT\ Insertion Macros, +%D subtitle=Insertions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Core Macros / Insertions} + +%D Insertions are special data collections that are associated +%D to \TEX's internal page builder. When multiple footnote +%D classes were introduced, I decided to isolate some of the +%D functionality in a module. + +\unprotect + +\newtoks\@@insertionlist + +\def\processinsertions{\the\@@insertionlist} + +\let\doprocessinsert\gobbleoneargument + +\def\installinsertion#1% + {\ifdefined#1\else + \let#1\relax + \fi + \ifx#1\relax % permits \csname...\endcsname + \newinsert#1% + \count#1\plusthousand + \skip #1\zeropoint + \dimen#1\maxdimen + \appendtoks\doprocessinsert#1\to\@@insertionlist + \fi} + + +\def\synchronizeinsertions + {\def\doprocessinsert##1{\ifvoid##1\else\insert##1{\unvbox##1}\fi}% + \processinsertions} + +%D For instance, when we postpone footnotes, we need to save +%D some data related to the inserts. The next methods are +%D far from ideal, but better than nothing. We save and +%D restore box content and associated data independently. +%D The box content is only restores when non||void. + +\def\backupinsertion#1% + {\csname\string#1\endcsname} + +\def\installbackupinsertion#1% + {\expandafter\newinsert\csname\string#1\endcsname + \count\backupinsertion#1\zerocount + \skip \backupinsertion#1\zeropoint + \dimen\backupinsertion#1\maxdimen} + +\def\saveinsertionbox#1% + {\ifdim\ht#1>\zeropoint % hm, actually unknown + \global\setbox\backupinsertion#1\box#1% + \else + \global\setbox\backupinsertion#1\emptybox + \fi} + +\def\restoreinsertionbox#1% + {\ifvoid\backupinsertion#1\else % if void, we keep the content + \global\setbox#1\box\backupinsertion#1% + \fi} + +\def\eraseinsertionbackup#1% + {\global\setbox\backupinsertion#1\emptybox} + +\def\saveinsertiondata#1% + {\global\skip \backupinsertion#1\skip #1% + \global\count\backupinsertion#1\count#1% + \global\dimen\backupinsertion#1\dimen#1} + +\def\restoreinsertiondata#1% + {\global\skip #1\skip \backupinsertion#1% + \global\count#1\count\backupinsertion#1% + \global\dimen#1\dimen\backupinsertion#1} + +%D Auxiliary macros: + +\def\addinsertionheight#1\to#2% + {\ifvoid#1\else + \advance#2 1\skip#1\relax + \advance#2 \ht #1\relax + \fi} + +\protect \endinput diff --git a/tex/context/base/page-lay.mkii b/tex/context/base/page-lay.mkii new file mode 100644 index 000000000..de1194c2a --- /dev/null +++ b/tex/context/base/page-lay.mkii @@ -0,0 +1,1429 @@ +%D \module +%D [ file=page-lay, +%D version=2000.10.20, % copied from main-001 +%D title=\CONTEXT\ Page Macros, +%D subtitle=Layout Specification, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Layout Specification} + +%D This module is now etex dependent. + +% to be translated into english + +% hoofdhoogte wordt bij status=hoog niet aangepast op outer +% level, wel binnen bepaalde berekeningen + +%D Before you start wondering why some of the page related +%D modules skip upward or left in order to place elements, you +%D must realize that the reference point is the top left +%D corner of the main typesetting area. One reason for this +%D choice is that it suited some viewers that displayed page +%D areas. Another reason is that margins, edges and top and +%D bottom areas are kind of virtual, while the header, text +%D and footer areas normally determine the text flow. + +\unprotect + +%D First we get rid of the funny \TEX\ offset defaults of one +%D inch by setting them to zero. + +\voffset = 0pt % setting this to -1in let's go metapost crazy +\hoffset = 0pt % setting this to -1in let's go metapost crazy + +%D The dimensions related to layout areas are represented by +%D real dimensions. + +\newdimen\paperheight \paperheight = 297mm +\newdimen\paperwidth \paperwidth = 210mm + +\newdimen\printpaperheight \printpaperheight = \paperheight +\newdimen\printpaperwidth \printpaperwidth = \paperwidth + +\newdimen\makeupheight % calculated +\newdimen\makeupwidth % calculated + +\newdimen\textheight % calculated +\newdimen\textwidth % calculated + +\newdimen\topspace \topspace = 2cm +\newdimen\backspace \backspace = \topspace +\newdimen\cutspace \cutspace = 0pt +\newdimen\bottomspace \bottomspace = 0pt + +\newdimen\headerheight \headerheight = 2cm +\newdimen\footerheight \footerheight = \headerheight + +\newdimen\topoffset \topoffset = 0pt +\newdimen\backoffset \backoffset = \topoffset + +\newdimen\leftmarginwidth \leftmarginwidth = 3cm +\newdimen\rightmarginwidth \rightmarginwidth = \leftmarginwidth + +\newdimen\leftedgewidth \leftedgewidth = 3cm +\newdimen\rightedgewidth \rightedgewidth = \leftedgewidth + +\newdimen\topheight \topheight = 0cm +\newdimen\bottomheight \bottomheight = \topheight + +\newcount\layoutlines \layoutlines = 0 +\newcount\layoutcolumns \layoutcolumns = 0 +\newdimen\layoutcolumndistance \layoutcolumndistance = 0pt +\newdimen\layoutcolumnwidth \layoutcolumnwidth = 0pt + +%D We can save some tokens and fuzzy parameters by using a +%D symbolic name for the current set of layout parameters. + +\let\currentlayout\empty + +\def\layoutparameter#1% + {\csname\??ly\ifcsname + \??ly\currentlayout#1\endcsname\currentlayout + \fi#1\endcsname} + +\def\namedlayoutparameter#1#2% + {\csname\??ly\ifcsname\??ly #1#2\endcsname#1\else + \ifcsname\??ly\currentlayout#2\endcsname\currentlayout + \fi\fi#2\endcsname} + +%D Beause normal \TEX\ has at most 256 dimensions (of which a +%D substantial part is already in use), we provide a way to +%D generate a format with macro based alternatives. For a long +%D time, this used to be the default case. Beware: only fixed +%D dimensions can be used in calculations! By the way, the +%D gain in speed can hardly be called impressive and is roughly +%D 1 second on a 35 second run of 850 empty pages with a +%D couple of backgrounds only (which is far less than one +%D percent on a normal document). + +%D The next series of dimensions are complemented by left +%D and rights ones. + +\newdimen \margindistance +\newdimen \edgedistance +\newdimen \marginwidth +\newdimen \edgewidth + +%D Because a distance does not really makes sense when there +%D is no area, we use a zero distance in case there is no +%D area. + +\def\layoutdistance#1#2% + {\ifdim\zeropoint<#1\layoutparameter#2\else\zeropoint\fi} + +%D The horizontal distances are: + +\newdimen \leftedgedistance +\newdimen \rightedgedistance +\newdimen \leftmargindistance +\newdimen \rightmargindistance + +%D The vertical distances are: + +\newdimen \topdistance +\newdimen \headerdistance +\newdimen \footerdistance +\newdimen \bottomdistance + +%D We need to calculate the extra distances: + +\def\setlayoutdimensions + {\global\marginwidth \layoutparameter\c!margin + \global\edgewidth \layoutparameter\c!edge + \global\margindistance \layoutparameter\c!margindistance + \global\edgedistance \layoutparameter\c!edgedistance + \global\leftedgedistance \layoutdistance \leftedgewidth \c!leftedgedistance + \global\rightedgedistance \layoutdistance \rightedgewidth \c!rightedgedistance + \global\leftmargindistance \layoutdistance \leftmarginwidth \c!leftmargindistance + \global\rightmargindistance\layoutdistance \rightmarginwidth \c!rightmargindistance + \global\topdistance \layoutdistance \topheight \c!topdistance + \global\headerdistance \layoutdistance \headerheight \c!headerdistance + \global\footerdistance \layoutdistance \footerheight \c!footerdistance + \global\bottomdistance \layoutdistance \bottomheight \c!bottomdistance} + +\def\setlayoutdistances % local in \setreducedvsize + {\headerdistance\layoutdistance\headerheight\c!headerdistance + \footerdistance\layoutdistance\footerheight\c!footerdistance} + +% these are wrong in the running text, assumes some swapping, needs a cleanup + +\def\outermarginwidth {\rightorleftpageaction\rightmarginwidth \leftmarginwidth } +\def\innermarginwidth {\rightorleftpageaction\leftmarginwidth \rightmarginwidth} +\def\outermargindistance{\rightorleftpageaction\rightmargindistance\leftmargindistance } +\def\innermargindistance{\rightorleftpageaction\leftmargindistance \rightmargindistance} + +\def\outeredgewidth {\rightorleftpageaction\rightedgewidth \leftedgewidth } +\def\inneredgewidth {\rightorleftpageaction\leftedgewidth \rightedgewidth} +\def\outeredgedistance {\rightorleftpageaction\rightedgedistance\leftedgedistance } +\def\inneredgedistance {\rightorleftpageaction\leftedgedistance \rightedgedistance} + +\def\outerspacewidth {\rightorleftpageaction\cutspace\backspace} +\def\innerspacewidth {\rightorleftpageaction\backspace\cutspace} + +\newtoks\extralayoutcalculations \def\calculatelayoutextras{\the\extralayoutcalculations} + +% \appendtoks +% non etex calculations used to go here +% \to \extralayoutcalculations + +\newtoks\everyswapmargins % watch the order ! + +\appendtoks + \swapdimens\leftmargindistance\rightmargindistance + \swapdimens\leftedgedistance \rightedgedistance + \swapdimens\leftmarginwidth \rightmarginwidth + \swapdimens\leftedgewidth \rightedgewidth +\to \everyswapmargins + +\appendtoks + \swapmacros\leftmargintotal \rightmargintotal + \swapmacros\leftedgetotal \rightedgetotal + \swapmacros\leftsidetotal \rightsidetotal + \swapmacros\leftcombitotal \rightcombitotal + \swapmacros\innermargintotal\outermargintotal + \swapmacros\inneredgetotal \outeredgetotal + \swapmacros\innercombitotal \outercombitotal + \swapmacros\innersidetotal \outersidetotal +\to \everyswapmargins + +%D \macros +%D {definepapersize} +%D +%D Before we start calculating layout dimensions, we will +%D first take care of paper sizes. The first argument can be +%D either an assignment (for defaults) or an identifier, in +%D which case the second argument is an assignment. +%D +%D \showsetup{definepapersize} + +\def\definepapersize + {\dodoubleempty\dodefinepapersize} + +\def\definepapersize + {\dotripleempty\dodefinepapersize} + +\def\dodefinepapersize[#1][#2][#3]% + {\ifsecondargument + \doifsomething{#1} % to be sure + {\doifassignmentelse{#2} + {\getparameters + [\??pp#1] % geen \c!scale, scheelt hash ruimte + [\c!width=\@@ppwidth,\c!height=\@@ppheight,\c!offset=\@@ppoffset,#2]} + {\setvalue{\??pp:1:#1}{#2}% + \setvalue{\??pp:2:#1}{#3}}}% + \else + \getparameters[\??pp][#1]% + \setuppapersize % hm. this will freeze ! + \fi} + +%D For the moment we need to fake this macro. + +\ifx\setuppapersize\undefined + \let\setuppapersize\relax +\fi + +%D We set the defaults to the dimensions of an A4 sheet of +%D paper. + +\definepapersize + [\c!width=210mm,\c!height=297mm,\c!offset=\!!zeropoint] + +%D Yet undocumented, let's see if it gets noticed. +%D +%D \starttyping +%D \definepapersize[main] [A4] [A4] +%D \definepapersize[extra][A4,landscape][A4,landscape] +%D +%D \starttext +%D \setuppapersize[main] +%D Page 1. \page +%D Page 2. \page +%D \setuppapersize[extra] +%D Page 2 \page +%D \setuppapersize[main] +%D Page 3. \page +%D Page 4. \page +%D \adaptpapersize[extra] +%D Page 5. \page +%D Page 6. \page +%D \stoptext +%D \stoptyping + +%D \macros +%D {setuppaper,setuppapersize} +%D +%D When setting up the papersize on which to typeset and +%D print, we can also determine some more characteristics. +%D +%D \showsetup{setuppapersize} +%D +%D We keep track of these features with the following +%D variables. + +\chardef\papermirror =0 \chardef\printmirror =0 +\chardef\paperorientation=0 \chardef\printorientation=0 % beware: later no chardef +\chardef\paperreverse =0 \chardef\printreverse =0 +\chardef\paperlandscape =0 \chardef\printlandscape =0 + +\let\papersize\empty \let\printpapersize\empty + +\def\paperscale{1} \newif\ifnegateprintbox + +\def\setuppaper[#1]% + {\getparameters[\??pp][\c!paper=,\c!page=,#1]% + \edef\@@ppxy{\the\numexpr\@@ppnx*\@@ppny\relax}% + \doifelsenothing\@@pppage + {\doifelsenothing\@@pppaper + {} % {\setuppapersize} % added, removed, no need for, too tricky, mag-01 (fixed by freezing pp's) + {\dodosetuppapersize[\papersize][\@@pppaper]}} + {\doifelsenothing\@@pppaper + {\dodosetuppapersize[\@@pppage][\printpapersize]} + {\dodosetuppapersize[\@@pppage][\@@pppaper]}}} + +\def\setuppapersize + {\dodoubleempty\dosetuppapersize} + +\def\dosetuppapersize[#1][#2]% + {\doifassignmentelse{#1} + {\setuppaper[#1]} + {\doifelsenothing{#2} + {\expanded{\dodosetuppapersize + [\executeifdefined{\??pp:1:#1}{#1}]% + [\executeifdefined{\??pp:2:#1}{}]}} + {\doifassignmentelse{#2} + {\getparameters[\??pp\executeifdefined{\??pp:1:#1}{#1}][#2]} + {\expanded{\dodosetuppapersize + [\executeifdefined{\??pp:1:#1}{#1}]% + [\executeifdefined{\??pp:1:#2}{#2}]}}}}} + +\let\reinstatepapersize\relax + +\def\adaptpapersize + {\global\let\reinstatepapersize\restorepapersize + \setuppapersize} + +\appendtoks + \reinstatepapersize + \global\let\reinstatepapersize\relax +\to \everyaftershipout + +\def\dodosetuppapersize[#1][#2]% + {\ifsecondargument + \expanded{\dododosetuppapersize[#1][#2]}% + \calculatehsizes + \calculatevsizes + \recalculatelogos + \recalculatebackgrounds + \recalculatelayout + \else\iffirstargument + \setuppapersize[#1][#2]% + \else\ifx\papersize\undefined\else + \restorepapersize + \fi\fi\fi} + +% dimen freeze is a bit tricky, but catches local redundant calls +% with values where e.g width is defined in terms of \paperwidth + +\def\dododosetuppapersize[#1][#2]% + {\xdef\restorepapersize{\noexpand\setuppapersize[#1][#2]}% + \dosetuppaperorientation{#1}\paperlandscape\paperorientation\paperreverse\papermirror + \dosetuppaperorientation{#2}\printlandscape\printorientation\printreverse\printmirror + \def\docommand##1% + {\doifsomething{##1}{\doifdefined{\??pp##1\c!width} + {\global\paperwidth \getvalue{\??pp##1\c!width}% + \global\paperheight\getvalue{\??pp##1\c!height}% +\ifinpagebody + \setevalue{\??pp##1\c!height}{\the\paperheight}% + \setevalue{\??pp##1\c!width }{\the\paperwidth }% +\fi + \calculatepaperoffsets{##1}% + \xdef\papersize{##1}}}}% + \processcommacommand[#1]\docommand + \doifdefinedelse{\??pp#1\c!scale} + {\edef\paperscale{\getvalue{\??pp#1\c!scale}}} + {\edef\paperscale{1}}% + \def\docommand##1% + {\doifsomething{##1}{\doifdefined{\??pp##1\c!width} + {\global\printpaperwidth \getvalue{\??pp##1\c!width}% + \global\printpaperheight\getvalue{\??pp##1\c!height}% +\ifinpagebody + \setevalue{\??pp##1\c!height}{\the\printpaperheight}% + \setevalue{\??pp##1\c!width }{\the\printpaperwidth}% +\fi + \xdef\printpapersize{##1}}}}% + \processcommacommand[#2]\docommand + \global\setdimentoatleast\paperwidth \onepoint + \global\setdimentoatleast\paperheight \onepoint + \global\setdimentoatleast\printpaperwidth \onepoint + \global\setdimentoatleast\printpaperheight\onepoint + \ifcase\paperlandscape\else + \doglobal\swapdimens\paperwidth\paperheight + \fi + \ifcase\printlandscape\else + \doglobal\swapdimens\printpaperwidth\printpaperheight + \fi + % this check can be confusing, so we've added the possibility + % to bypass this test: \setuppapersize[option=fit] + \doif\@@ppoption\v!max % \v!fit is + {\bgroup + % we need to pre-swap else we get the wrong paper size + \ifcase\paperorientation\else + \doifinset\paperorientation{90,270}{\swapdimens\paperwidth\paperheight}% + \fi + \ifcase\printorientation\else + \doifinset\printorientation{90,270}{\swapdimens\printpaperwidth\printpaperheight}% + \fi + \ifdim\paperheight>\printpaperheight + \global\printpaperheight\paperheight + \writestatus\m!systems{print height forced to paper height}% + \fi + \ifdim\paperwidth>\printpaperwidth + \global\printpaperwidth\paperwidth + \writestatus\m!systems{print width forced to paper width}% + \fi + \egroup}} + +\def\dosetuppaperorientation#1#2#3#4#5% + {\global\chardef#2\zerocount + \global\chardef#5\zerocount + \globallet#3\!!zerocount + \globallet#4\!!zerocount + \global\negateprintboxfalse + \processallactionsinset + [#1] + [ \v!landscape=>\global\chardef#2\plusone, + \v!mirrored=>\global\chardef#5\plusone, + \v!rotated=>\gdef#3{90}\gdef#4{270}, + \v!negative=>\global\negateprintboxtrue, + 90=>\gdef#3{90}\gdef#4{270}, + 180=>\gdef#3{180}\gdef#4{0}, + 270=>\gdef#3{270}\gdef#4{90}]} + +\ifx\calculatepaperoffsets\undefined + + \def\calculatepaperoffsets#1% + {\scratchdimen\getvalue{\??pp#1\c!offset}% + \global\advance\paperwidth -2\scratchdimen + \global\advance\paperheight-2\scratchdimen} + +\fi + +\let\restorepapersize\relax + +\def\checkforems[#1]% + {\def\docommand##1% + {\beforesplitstring##1\at em\to\asciia + \doifnot\asciia{##1} + {\aftersplitstring\asciia\at=\to\asciia + \doifsomething\asciia + {\showmessage\m!systems{10}{##1}}}}% + \processcommalist[#1]\docommand} + +\ifx\setups\undefined \def\setups[#1]{\setdefaultpenalties} \fi + +% \newtoks \everybeforelayout \relax +% \newtoks \everyafterlayout \relax + +\def\recalculatelayout + {\doifsomething{\layoutparameter\c!page\layoutparameter\c!paper} + {\expanded{\dododosetuppapersize[\layoutparameter\c!page][\layoutparameter\c!paper]}}% + \dorecalculatelayout} + +\def\dorecalculatelayout + {%\the\everybeforelayout + \setups[\layoutparameter\c!preset]% + \global\leftmarginwidth \layoutparameter\c!leftmargin + \global\rightmarginwidth\layoutparameter\c!rightmargin + \global\leftedgewidth \layoutparameter\c!leftedge + \global\rightedgewidth \layoutparameter\c!rightedge + \global\headerheight \layoutparameter\c!header + \global\footerheight \layoutparameter\c!footer + \global\bottomheight \layoutparameter\c!bottom + \global\topheight \layoutparameter\c!top + \global\backspace \layoutparameter\c!backspace + \global\topspace \layoutparameter\c!topspace + \setlayoutdimensions % the rest of the `dimensions' + \doifelse\@@lygrid\v!yes\gridsnappingtrue\gridsnappingfalse + \ifgridsnapping + \setsystemmode\v!grid + \else + \resetsystemmode\v!grid + \fi + \setups[\layoutparameter\c!setups]% depends on gridsnapping ! + \simplesetupwhitespace + \simplesetupblank + \global\cutspace\layoutparameter\c!cutspace + \relax + \doifelse{\layoutparameter\c!width}\v!middle + {\ifdim\cutspace=\zeropoint + \global\cutspace\backspace + \fi + \global\makeupwidth\dimexpr\paperwidth-\backspace-\cutspace\relax} + {\doifelse{\layoutparameter\c!width}\v!fit + {\ifdim\cutspace=\zeropoint + \global\cutspace\backspace + \fi + \global\makeupwidth\dimexpr\paperwidth-\cutspace\relax + \scratchdimen\dimexpr\backspace + -\leftedgewidth -\leftedgedistance + -\leftmarginwidth-\leftmargindistance\relax + \ifdim\scratchdimen<\zeropoint + \scratchdimen\zeropoint + \fi + \global\advance\makeupwidth\dimexpr + -\rightmargindistance-\rightmarginwidth + -\rightedgedistance -\rightedgewidth + -\scratchdimen\relax} + {\global\makeupwidth\layoutparameter\c!width\relax + \ifdim\cutspace=\zeropoint + \global\cutspace\dimexpr\paperwidth-\makeupwidth-\backspace\relax + % \else + % A kind of inconsistent specification, but used + % in for instance s-pre-19.tex; the cutspace is + % used only for determining some kind of right + % margin; don't use this in doublesided mode + \fi}}% + \scratchdimen\layoutparameter\c!bottomspace\relax + %\ifdim\scratchdimen=\zeropoint + % \scratchdimen\topspace + %\fi + \global\bottomspace\layoutparameter\c!bottomspace\relax + \global\layoutlines0\number\layoutparameter\c!lines\relax % may be empty + \ifcase\layoutlines + \doifelse{\layoutparameter\c!height}\v!middle + {\ifdim\bottomspace=\zeropoint + \global\bottomspace\topspace + \fi + \global\makeupheight\dimexpr\paperheight-\topspace-\bottomspace\relax} + {\doifelse{\layoutparameter\c!height}\v!fit + {\ifdim\bottomspace=\zeropoint + \global\bottomspace\topspace + \fi + \global\makeupheight\dimexpr\paperheight-\bottomspace\relax + \scratchdimen\dimexpr\topspace-\topheight-\topdistance\relax + \ifdim\scratchdimen<\zeropoint + \scratchdimen\zeropoint + \fi + \global\advance\makeupheight\dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax} + {\global\makeupheight\layoutparameter\c!height\relax + \ifdim\bottomspace=\zeropoint + \global\bottomspace\dimexpr\paperheight-\makeupheight-\topspace\relax + \else + % inconsistent specification + \fi}}% + \else + % beware, when the bodyfont changes (switched) this will change as well; implementing + % a global lineheight is tricky: should we take the bodyfont interlinespace or the one set + % independent of the bodyfont (before or after a layout spec); way too fuzzy, so we + % stick to the current method (after a night of experimenting ...2003/10/13) + \global\makeupheight\dimexpr + \layoutparameter\c!lines\lineheight-\strutheight+\topskip+ + \headerdistance+\headerheight+\footerdistance+\footerheight\relax + \fi + \backoffset\layoutparameter\c!horoffset + \topoffset \layoutparameter\c!veroffset + \global\setdimentoatleast\makeupwidth\onepoint + \global\setdimentoatleast\makeupheight \onepoint + % \checkcurrentlayout % here ? + % \the\everyafterlayout + \calculatelayoutextras + \calculatehsizes + \calculatevsizes + \calculatepseudocolumns + \checkgridsnapping + \recalculatelogos + \recalculatebackgrounds} + +\def\calculatepseudocolumns + {\global\layoutcolumns\layoutparameter\c!columns + \global\layoutcolumndistance\layoutparameter\c!columndistance + \global\layoutcolumnwidth\dimexpr\makeupwidth-\layoutcolumns\layoutcolumndistance+\layoutcolumndistance\relax + \global\divide\layoutcolumnwidth\layoutcolumns + \dorecurse\layoutcolumns + {\setxvalue{\??ly:c:\recurselevel}% + {\the\numexpr\recurselevel-\plusone\relax\dimexpr\layoutcolumnwidth+\layoutcolumndistance\relax}}} + +%\dorecurse\layoutcolumns +% {\setxvalue{\??ly:c:\recurselevel}{\the\dimexpr +% (\numexpr(\recurselevel-1)\dimexpr(\layoutcolumnwidth+\layoutcolumndistance))}} + +\def\layoutcolumnoffset#1% + {\executeifdefined{\??ly:c:#1}\!!zeropoint} + +\def\checklayout + {\ifdim\makeupheight=\layoutlines\lineheight \else \recalculatelayout \fi} + +\appendtoks \checklayout \to \everystarttext + +% document: +% +% \setuplayout[odd][state=stop] \setuplayout[even][state=stop] \setuplayout[page] +% +% \startstandardmakeup[page=blank] ... \stopstandardmakeup + +\def\changetolayout#1% + {%\writestatus\m!layouts{changing to layout #1}% + \xdef\currentlayout{#1}\recalculatelayout} + +\def\checkcurrentoddlayout + {\ifcsname\??ly\v!odd\c!state\endcsname + \doifvalue{\??ly\v!odd\c!state}\v!start{\changetolayout\v!odd}% + \fi} + +\def\checkcurrentevenlayout + {\ifcsname\??ly\v!even\c!state\endcsname + \doifvalue{\??ly\v!even\c!state}\v!start{\changetolayout\v!even}% + \fi} + +\ifx\lastpage\undefined \def\lastpage{1} \fi + +\def\reverserealfolio + {\ifnum\lastpage>\plusone + \ifnum\lastpage=\realfolio + \v!last + \else\ifnum\plusone=\realfolio + \v!first + \else + \the\numexpr\realfolio-\lastpage\relax + \fi\fi + \else + \!!zerocount + \fi} + +\def\checkcurrentlayout % public and used in naw, so keep this name + {\ifcsname\??ly\realfolio\c!state\endcsname + \doifvalue{\??ly\realfolio\c!state}\v!start{\changetolayout\realfolio}% + \else\ifcsname\??ly\reverserealfolio\c!state\endcsname + \doifvalue{\??ly\reverserealfolio\c!state}\v!start{\changetolayout\reverserealfolio}% + \else\ifcsname\??ly\v!current\c!state\endcsname + \changetolayout\v!current % no start test ? + \else + \doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout + \fi\fi\fi} + +% testcase +% +% \setuppagenumbering[alternative=doublesided] +% +% \setuplayout [width=11cm] +% \definelayout [odd] [backspace=1cm] +% \definelayout [even] [backspace=4cm] +% \definelayout [5] [backspace=5cm] +% \definelayout [6] [backspace=5cm] +% \definelayout [-2] [backspace=0cm,cutspace=0cm] +% \definelayout [last] [backspace=0cm,cutspace=0cm] +% +% \checkcurrentlayout \showframe +% +% \starttext +% \dorecurse{20} {\input knuth \endgraf \input tufte \endgraf} +% \stoptext + +%appendtoks \checkcurrentlayout \to \everyaftershipout % no +\appendtoks \checkcurrentlayout \to \everystarttext + +\appendtoks + \dochecknextlayout +\to \everyaftershipout + +% \def\dochecknextlayout +% {\ifx\currentlayout\v!current +% % prevent redundant calculations +% \else +% \globallet\currentlayout\empty +% \global\letbeundefined{\??ly\v!current\c!state}% +% \checkcurrentlayout +% \fi} +% +% this breaks after a standardmakeup + +\def\dochecknextlayout{\checkcurrentlayout} + +\newif\ifdoublesidedprint + +\def\presetcenterpagebox % in \setuplayout !!!!!!!!!!!!!!!! + {\doublesidedprintfalse + \ExpandFirstAfter\processallactionsinset + [\@@lylocation] + [ \v!middle=>{\setuppapersize[\c!left=\hss,\c!right=\hss,\c!top=\vss,\c!bottom=\vss]}, + \v!left=>{\setuppapersize[\c!left=,\c!right=\hss]}, + \v!right=>{\setuppapersize[\c!left=\hss,\c!right=]}, + \v!bottom=>{\setuppapersize[\c!top=\vss,\c!bottom=]}, + \v!top=>{\setuppapersize[\c!top=,\c!bottom=\vss]},% + \v!doublesided=>\doublesidedprinttrue, + \v!singlesided=>\doublesidedprintfalse]} + +\def\definelayout + {\dodoubleargument\dodefinelayout} + +\def\dodefinelayout[#1][#2]% + {\getparameters[\??ly#1][\c!state=\v!start,#2]} + +\def\dodosetuplayout[#1][#2]% + {\ConvertToConstant\doifnot{#2}\v!reset % #2 ? + {\getparameters[\??ly#1][#2]% + \checkforems[#2]}} + +% global needed for non-doublesided standardmakeup + +\def\dosetuplayout[#1][#2]% + {\globallet\currentlayout\empty % new, global + \ifsecondargument + \dodosetuplayout[#1][#2]% + \else\iffirstargument + \doifassignmentelse{#1} + {\dodosetuplayout[][#1]} + {\doifnot{#1}\v!reset{\xdef\currentlayout{#1}}}% new, global + \fi\fi + \recalculatelayout + \checkcurrentlayout % here ? + \presetcenterpagebox} + +\def\setuplayout + {\dodoubleempty\dosetuplayout} + +\let\@@zaheight=\!!zeropoint + +\def\dopushpagedimensions + {\xdef\oldtextheight {\the\textheight }% + \xdef\oldfooterheight{\the\footerheight}% + \global\let\@@zaheight\@@zaheight} + +\def\dopoppagedimensions + {\global\textheight \oldtextheight + \global\footerheight\oldfooterheight + \recalculatelayout + \global\let\pushpagedimensions\dopushpagedimensions + \global\let\poppagedimensions\relax} + +\let\poppagedimensions = \relax +\let\pushpagedimensions = \dopushpagedimensions + +% Elke \csname ... \endcsname wordt ook aangemaakt, dus ook +% in een test met \doifdefined. Bij veel bladzijden kan dit +% te veel macro's kosten. Vandaar de set \adaptedpages. Het +% kost tijd, maar scheelt macro's. + +\let\adaptedpages\empty + +\def\adaptpagedimensions + {\ifx\adaptedpages\empty\else + \rawdoifinsetelse\realfolio\adaptedpages + {\getvalue{\??za\realfolio}% + \letbeundefined{\??za\realfolio}} + \donothing + \fi} + +\def\checkpagedimensions + {\poppagedimensions + \adaptpagedimensions} + +\def\reportpagedimensions + {\ifx\poppagedimensions\relax \else + \space\the\dimexpr\@@zaheight\relax\space-\space + \fi + \realfolio} + +\def\dodoadaptlayout[#1]% + {\getparameters[\??za][\c!height=,\c!lines=0,#1]% + \pushpagedimensions + \ifcase\@@zalines\relax + \showmessage\m!layouts1{\@@zaheight,\realfolio}% + \else + \showmessage\m!layouts1{\@@zalines\space\v!lines,\realfolio}% + \def\@@zaheight{\@@zalines\openlineheight}% + \fi + \doifelse\@@zaheight\v!max + {\balancedimensions\textheight\footerheight\footerheight} + {\balancedimensions\textheight\footerheight\@@zaheight}% + \ifdim\footerheight<\zeropoint + \global\advance\textheight \footerheight + \global\footerheight\zeropoint + \global\xdef\@@zaheight{\layoutparameter\c!footer\space(\v!max)}% + \fi + \setvsize + \global\pagegoal\vsize % nog corrigeren voor insertions ? + \recalculatelogos + \recalculatebackgrounds + \global\let\pushpagedimensions\relax + \global\let\poppagedimensions\dopoppagedimensions} + +\def\doadaptlayout[#1][#2]% + {\doifelsenothing{#2} + {\dodoadaptlayout[#1]} + {\def\docommand##1% + {\addtocommalist{##1}\adaptedpages + \setgvalue{\??za##1}{\dodoadaptlayout[#2]}}% + \processcommalist[#1]\docommand + \adaptpagedimensions}} + +\def\adaptlayout + {\dodoubleempty\doadaptlayout} + +% describe interface + +%D Centering the paper area on the print area is determined +%D by the \type {top}, \type {bottom}, \type {left} and \type +%D {right} parameters. + +\def\centerpagebox#1% + {\printpaperwidth \paperscale\printpaperwidth + \printpaperheight\paperscale\printpaperheight + \setbox#1\vbox to \printpaperheight + {\@@pptop + \hbox to \printpaperwidth + {\ifdoublesidedprint + \doifbothsides + {\@@ppleft \box#1\@@ppright} + {\@@ppleft \box#1\@@ppright} + {\@@ppright\box#1\@@ppleft }% + \else + \@@ppleft \box#1\@@ppright + \fi}% + \par + \@@ppbottom}} + +\def\offsetprintbox#1% + {\ifdim\topoffset=\zeropoint % \relax + \ifdim\backoffset=\zeropoint + \donefalse + \else + \donetrue + \fi + \else + \donetrue + \fi + \ifdone + \edef\next{\wd#1\the\wd#1\ht#1\the\ht#1\dp#1\the\dp#1}% + \setbox#1\vbox + {%\forgetall + \offinterlineskip + \vskip\topoffset + \doifbothsides{\hskip\backoffset}{\hskip\backoffset}{\hskip-\backoffset}% + \box#1}% + \next + \fi} + +\def\replicatepagebox#1% + {\ifnum\@@lynx>\plusone + \donetrue + \else\ifnum\@@lyny>\plusone + \donetrue + \else + \donefalse + \fi\fi + \ifdone + \setbox#1\vbox + {%\forgetall + \offinterlineskip + \dorecurse\@@lyny + {\hbox{\dorecurse\@@lynx{\copy#1\hskip\@@lydx}\unskip}% + \vskip\@@lydy} + \unskip}% + \fi} + +\def\orientpagebodybox#1#2#3% + {\ifnum#2#3>\zerocount + \setbox#1\vbox + {\edef\somerotation{\ifdoublesided\ifodd\realpageno#2\else#3\fi\else#2\fi}% + \dorotatebox\somerotation\hbox{\box#1}}% + \fi} + +\def\orientpaperbox#1% + {\orientpagebodybox{#1}\paperorientation\paperreverse} + +\def\orientprintbox#1% + {\orientpagebodybox{#1}\printorientation\printreverse} + +\def\mirrorpagebodybox#1#2% + {\ifcase#2\or + \setbox#1\vbox + {\domirrorbox\vbox{\box#1}}% + \fi} + +\def\mirrorpaperbox#1% + {\mirrorpagebodybox{#1}\papermirror} + +\def\mirrorprintbox#1% + {\mirrorpagebodybox{#1}\printmirror} + +\def\scalepagebox#1% + {\ifdim\@@lyscale\points=\onepoint \else + \setbox#1\vbox + {\scale[\c!sx=\@@lyscale,\c!sy=\@@lyscale]{\box#1}}% + \paperwidth\@@lyscale\paperwidth + \paperheight \@@lyscale\paperheight + \fi} + +\def\negateprintbox#1% + {\ifnegateprintbox + \negatecolorbox{#1}% + \fi} + +\def\pagecutmarksymbol {\the\realpageno} +\def\pagecutmarklength {.5cm} +\let\pagecutmarktoptext \empty +\let\pagecutmarkbottomtext \empty + +\def\extrapagecutmarkbottomtext + {\rlap{\jobname}\hfill\currentdate\space-\space\currenttime\hfill\llap{\realfolio}} + +\def\makepagecutbox % #1 + {\let\cutmarksymbol \pagecutmarksymbol + \let\cutmarklength \pagecutmarklength + \let\cutmarktoptext \pagecutmarktoptext + \let\cutmarkbottomtext\pagecutmarkbottomtext + \makecutbox} + +\setvalue{\??ly:n:\c!marking:\v!on}% + {\makepagecutbox} + +\setvalue{\??ly:n:\c!marking:\v!page}% only at outer when nx/ny > 0 + {\makepagecutbox} + +\setvalue{\??ly:n:\c!marking:\v!empty}% + {\let\pagecutmarksymbol\empty + \let\pagecutmarktoptext\empty + \let\pagecutmarkbottomtext\empty + \makepagecutbox} + +\setvalue{\??ly:n:\c!marking:\v!text}% + {\let\pagecutmarksymbol\empty + \let\pagecutmarkbottomtext\extrapagecutmarkbottomtext + \makepagecutbox} + +\setvalue{\??ly:c:\c!marking:\v!color}% + {\doaddpagecolormarks\colormarkbox} + +\setvalue{\??ly:c:\c!marking:\v!screen}% + {\doaddpagecolormarks\rastermarkbox} + +\def\addpagecutmarks % #1 + {\executeifdefined{\??ly:n:\c!marking:\@@lymarking}\gobbleoneargument} + +\def\addpagecolormarks % #1 + {\executeifdefined{\??ly:c:\c!marking:\@@lymarking}\gobbleoneargument} + +\def\doaddpagecolormarks#1#2% + {\makepagecutbox{#2}% + \ifnum\horizontalcutmarks>2 \chardef\colormarkoffset4 \fi + \ifnum\verticalcutmarks >2 \chardef\colormarkoffset4 \fi + #1{#2}} + +% NOG EENS NAGAAN WANNEER NU GLOBAL EN WANNEER NIET + +\ifx\doifelselayoutsomeline\undefined % defined in page-txt + \let\doifelselayoutsomeline\secondofthreearguments +\fi + +\def\calculatevsizes % global needed in \recalculatelayoutregel + {\redoglobal\textheight\makeupheight + \doifelselayoutsomeline \v!header + {\redoglobal\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}% + \donothing + \doifelselayoutsomeline \v!footer + {\redoglobal\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}% + \donothing + \ifzeropt\headerheight + \resetsystemmode\v!header + \else + \setsystemmode\v!header + \fi + \ifzeropt\footerheight + \resetsystemmode\v!footer + \else + \setsystemmode\v!footer + \fi + \resetglobal + \setvsize} + +\def\calculatereducedvsizes + {\textheight\makeupheight + \doifelselayoutsomeline \v!header + {\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}% + {\headerheight\zeropoint + \setlayoutdistances}% + \doifelselayoutsomeline \v!footer + {\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}% + {\footerheight\zeropoint + \setlayoutdistances}} + +\newdimen\innermakeupwidth % special purpose +\newdimen\innermakeupmargin % special purpose + +\chardef\innermakeupcompensation\plusone + +\def\compensatedinnermakeupmargin + {\dimexpr\ifnum\innermakeupcompensation=\plusone+\innermakeupmargin\else\zeropoint\fi\relax} + +\def\freezetextwidth % \makeupwidth may be set to \textwidth + {\textwidth\makeupwidth % which is a tricky but valid value + \doifsomething{\layoutparameter\c!textwidth} + {\textwidth\layoutparameter\c!textwidth}% % local + \global\innermakeupwidth\textwidth + \doifelsenothing{\layoutparameter\c!textmargin} + {\global\innermakeupmargin\zeropoint} + {\global\innermakeupmargin\layoutparameter\c!textmargin}% + \global\advance\innermakeupwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax + \advance\textwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax} % local + +\def\calculatehsizes + {\freezetextwidth + \sethsize} + +% De onderstaande macro voert commando's uit, afhankelijk van +% het karakter van het paginanummer. +% +% \doifoddpageelse{then-commando}{else-commando} + +%D When we start at an even page, we need to swap the layout +%D differently. We cannot adapt the real page number, since +%D it is used in cross referencing. The next switch is set +%D when we start at an even page. + +\newif\ifshiftedrealpageno + +% \def\doifoddpageelse#1#2% +% {\ifshiftedrealpageno +% \ifodd\realpageno#2\else#1\fi +% \else +% \ifodd\realpageno#1\else#2\fi +% \fi} + +\def\doifoddpageelse + {\ifshiftedrealpageno + \ifodd\realpageno + \@EAEAEA\secondoftwoarguments + \else + \@EAEAEA\firstoftwoarguments + \fi + \else + \ifodd\realpageno + \@EAEAEA\firstoftwoarguments + \else + \@EAEAEA\secondoftwoarguments + \fi + \fi} + +\let\doifonevenpaginaelse\doifoddpageelse + +% what are those \relax'es doing there? + +% \def\doifbothsidesoverruled#1#2#3% +% {\ifdoublesided +% \doifoddpageelse{#2}{#3}\relax +% \else +% #1\relax +% \fi} + +% \def\doifbothsides#1#2#3% +% {\ifdoublesided +% \ifsinglesided +% #1\relax +% \else +% \doifoddpageelse{#2}{#3}\relax +% \fi +% \else +% #1\relax +% \fi} + +\def\redoifoddpageelse#1{\doifoddpageelse} + +\def\doifbothsidesoverruled + {\ifdoublesided + \@EA\redoifoddpageelse + \else + \@EA\firstofthreearguments + \fi} + +\def\doifbothsides + {\ifdoublesided + \ifsinglesided + \@EAEAEA\firstofthreearguments + \else + \@EAEAEA\redoifoddpageelse + \fi + \else + \@EA\firstofthreearguments + \fi} + +\newdimen\texthoffset + +\def\settexthoffset + {\doifbothsides + {\texthoffset\backspace} + {\texthoffset\backspace} + {\texthoffset\dimexpr\paperwidth-\backspace-\makeupwidth\relax}} + +\def\goleftonpage + {\hskip-\dimexpr\leftmargindistance+\leftmarginwidth+\leftedgedistance+\leftedgewidth\relax} + +\def\doifmarginswapelse#1#2% + {\doifbothsides{#1}{#1}{#2}} + +\def\swapmargins + {\doifmarginswapelse\relax\doswapmargins} + +\def\doswapmargins + {\let\swapmargins \relax % to prevent local swapping + \let\doswapmargins\relax % to prevent local swapping + \the\everyswapmargins} + +\def\rightorleftpageaction + {\ifdoublesided + \ifsinglesided + \@EAEAEA\firstoftwoarguments + \else + \@EAEAEA\doifoddpageelse + \fi + \else + \@EA\firstoftwoarguments + \fi} + +\def\outermarginwidth {\rightorleftpageaction\rightmarginwidth \leftmarginwidth } +\def\innermarginwidth {\rightorleftpageaction\leftmarginwidth \rightmarginwidth} +\def\outermargindistance{\rightorleftpageaction\rightmargindistance\leftmargindistance } +\def\innermargindistance{\rightorleftpageaction\leftmargindistance \rightmargindistance} + +\def\outeredgewidth {\rightorleftpageaction\rightedgewidth \leftedgewidth } +\def\inneredgewidth {\rightorleftpageaction\leftedgewidth \rightedgewidth} +\def\outeredgedistance {\rightorleftpageaction\rightedgedistance\leftedgedistance } +\def\inneredgedistance {\rightorleftpageaction\leftedgedistance \rightedgedistance} + +\def\outerspacewidth {\rightorleftpageaction\cutspace \backspace } +\def\innerspacewidth {\rightorleftpageaction\backspace\cutspace} + +\def\leftmargintotal {\dimexpr\leftmarginwidth +\leftmargindistance \relax} +\def\rightmargintotal {\dimexpr\rightmarginwidth+\rightmargindistance\relax} +\def\leftedgetotal {\dimexpr\leftedgewidth +\leftedgedistance \relax} +\def\rightedgetotal {\dimexpr\rightedgewidth +\rightedgedistance \relax} + +\def\leftsidetotal {\dimexpr\leftmarginwidth +\leftedgetotal \relax} +\def\rightsidetotal {\dimexpr\rightmarginwidth+\rightedgetotal\relax} +\def\leftcombitotal {\dimexpr\leftmargintotal +\leftedgetotal \relax} +\def\rightcombitotal {\dimexpr\rightmargintotal+\rightedgetotal\relax} + +\def\innermargintotal {\dimexpr\innermarginwidth+\innermargindistance\relax} +\def\outermargintotal {\dimexpr\outermarginwidth+\outermargindistance\relax} +\def\inneredgetotal {\dimexpr\inneredgewidth +\inneredgedistance \relax} +\def\outeredgetotal {\dimexpr\outeredgewidth +\outeredgedistance \relax} + +\def\innercombitotal {\dimexpr\innermargintotal+\inneredgetotal\relax} +\def\outercombitotal {\dimexpr\outermargintotal+\outeredgetotal\relax} +\def\innersidetotal {\dimexpr\innermarginwidth+\inneredgetotal\relax} +\def\outersidetotal {\dimexpr\outermarginwidth+\outeredgetotal\relax} + +%D \macros +%D {startlocallayout} +%D +%D These macros should be used with care. They permit local +%D layouts (as used in fitting pages, see \type {page-app.tex}). + +%D This is kind of obsolete now that we have \type +%D {\definelayout}, so this hack will disappear in future +%D versions. + +\def\startlocallayout + {\globalpushmacro\restorepapersize + \globalpushmacro\currentlayout} + +\def\stoplocallayout + {\globalpopmacro\currentlayout + \globalpopmacro\restorepapersize + \restorepapersize + \setuplayout} + +%D \macros +%D {showprint, showframe, showlayout, showsetups} +%D +%D We predefine a couple of tracing macros. +%D +%D \showsetup{showprint} +%D \showsetup{showframe} +%D \showsetup{showlayout} +%D \showsetup{showsetups} +%D %showsetup{showmargins} + +\fetchruntimecommand \showprint {page-run.mkii} +\fetchruntimecommand \showframe {page-run.mkii} +\fetchruntimecommand \showlayout {page-run.mkii} +\fetchruntimecommand \showsetups {page-run.mkii} +\fetchruntimecommand \showmargins {page-run.mkii} + +%D The default dimensions are quite old and will not change. +%D The funny fractions were introduced when we went from fixed +%D dimensions to relative ones. Since \CONTEXT\ is a dutch +%D package, the dimensions are based on the metric system. The +%D asymmetrical layout is kind of handy for short +%D quick||and||dirty stapled documents. +%D +%D Although valid, it is not a real good idea to use +%D dimensions based on the \type {em} unit. First of all, +%D since there are no fonts loaded yet, this dimension makes +%D no sense, and second, you would loose track of values, +%D since they could change while going to a new page, +%D depending on the current font setting. + +\setuplayout + [ \c!topspace=.08417508418\paperheight, % 2.5cm + \c!top=\!!zeropoint, + \c!topdistance=\!!zeropoint, + \c!header=.06734006734\paperheight, % 2.0cm + \c!headerdistance=\!!zeropoint, + \c!height=.84175084175\paperheight, % 25.0cm + \c!footerdistance=\layoutparameter\c!headerdistance, + \c!footer=.06734006734\paperheight, % 2.0cm + \c!bottomdistance=\layoutparameter\c!topdistance, + \c!bottom=\!!zeropoint, + \c!backspace=.11904761905\paperwidth, % 2.5cm + \c!edge=\!!zeropoint, + \c!edgedistance=\layoutparameter\c!margindistance, + \c!margin=.12649983170\paperwidth, % snijwit-2*afstand + \c!margindistance=.02008341748\paperwidth, % 12.0pt + \c!leftedge=\layoutparameter\c!edge, + \c!leftedgedistance=\layoutparameter\c!edgedistance, + \c!leftmargin=\layoutparameter\c!margin, + \c!leftmargindistance=\layoutparameter\c!margindistance, + \c!width=.71428571429\paperwidth, % 15.0cm + \c!rightmargindistance=\layoutparameter\c!margindistance, + \c!rightmargin=\layoutparameter\c!margin, + \c!rightedgedistance=\layoutparameter\c!edgedistance, + \c!rightedge=\layoutparameter\c!edge, + \c!veroffset=\!!zeropoint, + \c!bottomspace=\!!zeropoint, + \c!horoffset=\!!zeropoint, + \c!cutspace=\!!zeropoint, + \c!textwidth=, % dangerous option -> centered / local + \c!textmargin=, % dangerous option -> both sides + \c!textdistance=\!!zeropoint, % shift down on grid + \c!style=, + \c!color=, + \c!marking=\v!off, + \c!location=, % \v!singlesided, but empty is signal + \c!scale=1, + \c!nx=1, + \c!ny=1, + \c!dx=\!!zeropoint, + \c!dy=\!!zeropoint, + \c!grid=\v!no, + \c!preset=, + \c!setups=\systemsetupsprefix\s!default, + \c!clipoffset=\!!zeropoint, + \c!lines=0, + \c!paper=, % for foxet + \c!page=, % for foxet + \c!columns=1, + \c!columndistance=\!!zeropoint] + +%D First we define a whole range of (DIN) papersizes, +%D of which the A-series makes most sense. We enable checking. + +%D We also set some of the parameters that will be used when +%D positioning the typeset paper onto the print paper. + +\setuppaper % (size) % only used in XY imposition + [\c!width=\zeropoint, + \c!height=\zeropoint, + \c!topspace=\zeropoint, + \c!backspace=\zeropoint, + \c!dx=\zeropoint, + \c!dy=\zeropoint, + \c!nx=1, + \c!ny=1, + \c!method=\v!normal] + +\setuppapersize + [\c!option=\v!max, + \c!top=, + \c!bottom=\vss, + \c!left=, + \c!right=\hss] + +\definepapersize [A0] [\c!width=841mm,\c!height=1189mm] +\definepapersize [A1] [\c!width=594mm,\c!height=841mm] +\definepapersize [A2] [\c!width=420mm,\c!height=594mm] +\definepapersize [A3] [\c!width=297mm,\c!height=420mm] +\definepapersize [A4] [\c!width=210mm,\c!height=297mm] +\definepapersize [A5] [\c!width=148mm,\c!height=210mm] +\definepapersize [A6] [\c!width=105mm,\c!height=148mm] +\definepapersize [A7] [\c!width=74mm,\c!height=105mm] +\definepapersize [A8] [\c!width=52mm,\c!height=74mm] +\definepapersize [A9] [\c!width=37mm,\c!height=52mm] +\definepapersize [A10] [\c!width=26mm,\c!height=37mm] + +\definepapersize [B0] [\c!width=1000mm,\c!height=1414mm] +\definepapersize [B1] [\c!width=707mm,\c!height=1000mm] +\definepapersize [B2] [\c!width=500mm,\c!height=707mm] +\definepapersize [B3] [\c!width=353mm,\c!height=500mm] % [\c!width=354mm,\c!height=500mm] +\definepapersize [B4] [\c!width=250mm,\c!height=353mm] % [\c!width=250mm,\c!height=354mm] +\definepapersize [B5] [\c!width=176mm,\c!height=250mm] % [\c!width=177mm,\c!height=250mm] +\definepapersize [B6] [\c!width=125mm,\c!height=176mm] % [\c!width=125mm,\c!height=177mm] +\definepapersize [B7] [\c!width=88mm,\c!height=125mm] +\definepapersize [B8] [\c!width=62mm,\c!height=88mm] % [\c!width=63mm,\c!height=88mm] +\definepapersize [B9] [\c!width=44mm,\c!height=62mm] % [\c!width=44mm,\c!height=63mm] +\definepapersize [B10] [\c!width=31mm,\c!height=44mm] + +\definepapersize [C0] [\c!width=917mm,\c!height=1297mm] +\definepapersize [C1] [\c!width=648mm,\c!height=917mm] % [\c!width=649mm,\c!height=917mm] +\definepapersize [C2] [\c!width=458mm,\c!height=648mm] % [\c!width=459mm,\c!height=649mm] +\definepapersize [C3] [\c!width=324mm,\c!height=458mm] % [\c!width=324mm,\c!height=459mm] +\definepapersize [C4] [\c!width=229mm,\c!height=324mm] +\definepapersize [C5] [\c!width=162mm,\c!height=229mm] +\definepapersize [C6] [\c!width=114mm,\c!height=162mm] % [\c!width=115mm,\c!height=162mm] +\definepapersize [C7] [\c!width=81mm,\c!height=114mm] % [\c!width=81mm,\c!height=115mm] +\definepapersize [C8] [\c!width=57mm,\c!height=81mm] +\definepapersize [C9] [\c!width=40mm,\c!height=57mm] +\definepapersize [C10] [\c!width=28mm,\c!height=40mm] + +%D Per August 2004 the rounding of some (seldom used) sizes +%D were corrected top the latest DIN specifications. Peter +%D Rolf came up with these and a few more missing sizes. +%D Watch out: spaces and slashes! + +\definepapersize [4 A0] [\c!width=1682mm,\c!height=2378mm] +\definepapersize [2 A0] [\c!width=1189mm,\c!height=1682mm] +\definepapersize [C6/C5] [\c!width=114mm,\c!height=229mm] + +%D Because there are no standardized screen sizes, we define +%D a bunch of sizes with $4:3$ ratios. The \type {S6} size is +%D nearly as wide as a sheet of \type {A4} paper. + +\definepapersize [S3] [\c!width=300pt,\c!height=225pt] +\definepapersize [S4] [\c!width=400pt,\c!height=300pt] +\definepapersize [S5] [\c!width=500pt,\c!height=375pt] +\definepapersize [S6] [\c!width=600pt,\c!height=450pt] +\definepapersize [S8] [\c!width=800pt,\c!height=600pt] +\definepapersize [SW] [\c!width=800pt,\c!height=450pt] +\definepapersize [SM] [\c!width=720pt,\c!height=450pt] + +%D These are handy too: + +\definepapersize [S33] [\c!width=300pt,\c!height=300pt] +\definepapersize [S44] [\c!width=400pt,\c!height=400pt] +\definepapersize [S55] [\c!width=500pt,\c!height=500pt] +\definepapersize [S66] [\c!width=600pt,\c!height=600pt] + +%D One may wonder if \TEX\ should be used for typesetting +%D \CDROM\ covers, but it does not hurt to have the paper size +%D ready. + +\definepapersize [CD] [\c!width=120mm,\c!height=120mm] + +%D The next series is for our English speaking friends who +%D decided to stick to non metric values. Thanks to Nelson +%D Beebe for completing the inch based list. + +\definepapersize [letter] [\c!width=8.5in,\c!height=11in] +\definepapersize [ledger] [\c!width=11in,\c!height=17in] +\definepapersize [tabloid] [\c!width=17in,\c!height=11in] + +\definepapersize [legal] [\c!width=8.5in,\c!height=14in] +\definepapersize [folio] [\c!width=8.5in,\c!height=13in] +\definepapersize [executive] [\c!width=7.25in,\c!height=10.5in] + +\definepapersize [A] [\c!width=8.5in,\c!height=11in] % 1 sheet +\definepapersize [B] [\c!width=11in,\c!height=17in] % 2 sheets +\definepapersize [C] [\c!width=17in,\c!height=22in] % 4 sheets + +%D The next set is for Tobias Burnus, who gave me the sizes. + +\definepapersize [envelope 9] [\c!width=8.88in,\c!height=3.88in] +\definepapersize [envelope 10] [\c!width=9.5in,\c!height=4.13in] +\definepapersize [envelope 11] [\c!width=10.38in,\c!height=4.5in] +\definepapersize [envelope 12] [\c!width=11.0in,\c!height=4.75in] +\definepapersize [envelope 14] [\c!width=11.5in,\c!height=5.0in] +\definepapersize [monarch] [\c!width=7.5in,\c!height=3.88in] +\definepapersize [check] [\c!width=8.58in,\c!height=3.88in] +\definepapersize [DL] [\c!width=110mm,\c!height=220mm] % [\c!width=220mm,\c!height=110mm] +\definepapersize [E4] [\c!width=280mm,\c!height=400mm] + +%D The next three sets are supplied by Taco: + +\definepapersize [RA0] [\c!width=860mm,\c!height=1220mm] +\definepapersize [RA1] [\c!width=610mm,\c!height=860mm] +\definepapersize [RA2] [\c!width=430mm,\c!height=610mm] +\definepapersize [RA3] [\c!width=305mm,\c!height=430mm] +\definepapersize [RA4] [\c!width=215mm,\c!height=305mm] + +%D ISO SRA (supplementary raw A) sizes: + +\definepapersize [SRA0] [\c!width=900mm,\c!height=1280mm] +\definepapersize [SRA1] [\c!width=640mm,\c!height=900mm] +\definepapersize [SRA2] [\c!width=450mm,\c!height=640mm] +\definepapersize [SRA3] [\c!width=320mm,\c!height=450mm] +\definepapersize [SRA4] [\c!width=225mm,\c!height=320mm] + +%D Swedish thesis formats: + +\definepapersize [G5] [\c!width=169mm,\c!height=239mm] +\definepapersize [E5] [\c!width=155mm,\c!height=220mm] + +%D Industry invention: + +\definepapersize [A3plus] [\c!width=329mm,\c!height=483mm] + +%D We can now default to a reasonable size. We match the print +%D paper size with the typeset paper size. This setting should +%D come after the first layout specification (already done). + +\setuppapersize + [A4][A4] + +%D A few goodies: + +\definepapersize + [oversized] + [ \c!width=\dimexpr\paperwidth +1.5cm\relax, + \c!height=\dimexpr\paperheight+1.5cm\relax] + +\definepapersize + [doublesized] + [ \c!width=\dimexpr \paperwidth \relax, + \c!height=\dimexpr2\paperheight\relax] + +\definepapersize + [doubleoversized] + [ \c!width=\dimexpr \paperheight+1.5cm\relax, + \c!height=\dimexpr2\paperwidth +1.5cm\relax] + +%D For orthogonality: + +\definepapersize + [undersized] + [ \c!width=\dimexpr\paperwidth -1.5cm\relax, + \c!height=\dimexpr\paperheight-1.5cm\relax] + +\definelayout + [\v!page] + [\c!backspace=\zeropoint, + \c!cutspace=\zeropoint, + \c!topspace=\zeropoint, + \c!bottomspace=\zeropoint, + \c!margin=\zeropoint, + \c!edge=\zeropoint, + \c!header=\zeropoint, + \c!footer=\zeropoint, + \c!top=\zeropoint, + \c!bottom=\zeropoint, + \c!leftmargin=\zeropoint, + \c!rightmargin=\zeropoint, + \c!leftedge=\zeropoint, + \c!rightedge=\zeropoint, + \c!textdistance=\zeropoint, + \c!width=\v!middle, + \c!height=\v!middle, + \c!lines=0, + \c!grid=\v!no] + +\definelayout + [\v!middle] + [\c!width=\v!middle, + \c!height=\v!middle] + +\protect \endinput diff --git a/tex/context/base/page-lay.mkiv b/tex/context/base/page-lay.mkiv new file mode 100644 index 000000000..5d0b06418 --- /dev/null +++ b/tex/context/base/page-lay.mkiv @@ -0,0 +1,1404 @@ +%D \module +%D [ file=page-lay, +%D version=2000.10.20, % copied from main-001 +%D title=\CONTEXT\ Page Macros, +%D subtitle=Layout Specification, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Layout Specification} + +%D This module is now etex dependent. + +% to be translated into english + +% hoofdhoogte wordt bij status=hoog niet aangepast op outer +% level, wel binnen bepaalde berekeningen + +%D Before you start wondering why some of the page related +%D modules skip upward or left in order to place elements, you +%D must realize that the reference point is the top left +%D corner of the main typesetting area. One reason for this +%D choice is that it suited some viewers that displayed page +%D areas. Another reason is that margins, edges and top and +%D bottom areas are kind of virtual, while the header, text +%D and footer areas normally determine the text flow. + +\unprotect + +%D First we get rid of the funny \TEX\ offset defaults of one +%D inch by setting them to zero. + +\voffset = 0pt % setting this to -1in let's go metapost crazy +\hoffset = 0pt % setting this to -1in let's go metapost crazy + +%D The dimensions related to layout areas are represented by +%D real dimensions. + +\newdimen\paperheight \paperheight = 297mm +\newdimen\paperwidth \paperwidth = 210mm + +\newdimen\printpaperheight \printpaperheight = \paperheight +\newdimen\printpaperwidth \printpaperwidth = \paperwidth + +\newdimen\makeupheight % calculated +\newdimen\makeupwidth % calculated + +\newdimen\textheight % calculated +\newdimen\textwidth % calculated + +\newdimen\topspace \topspace = 2cm +\newdimen\backspace \backspace = \topspace +\newdimen\cutspace \cutspace = 0pt +\newdimen\bottomspace \bottomspace = 0pt + +\newdimen\headerheight \headerheight = 2cm +\newdimen\footerheight \footerheight = \headerheight + +\newdimen\topoffset \topoffset = 0pt +\newdimen\backoffset \backoffset = \topoffset + +\newdimen\leftmarginwidth \leftmarginwidth = 3cm +\newdimen\rightmarginwidth \rightmarginwidth = \leftmarginwidth + +\newdimen\leftedgewidth \leftedgewidth = 3cm +\newdimen\rightedgewidth \rightedgewidth = \leftedgewidth + +\newdimen\topheight \topheight = 0cm +\newdimen\bottomheight \bottomheight = \topheight + +\newcount\layoutlines \layoutlines = 0 +\newcount\layoutcolumns \layoutcolumns = 0 +\newdimen\layoutcolumndistance \layoutcolumndistance = 0pt +\newdimen\layoutcolumnwidth \layoutcolumnwidth = 0pt + +%D We can save some tokens and fuzzy parameters by using a +%D symbolic name for the current set of layout parameters. + +\let\currentlayout\empty + +\def\layoutparameter#1% + {\csname\??ly\ifcsname + \??ly\currentlayout#1\endcsname\currentlayout + \fi#1\endcsname} + +\def\namedlayoutparameter#1#2% + {\csname\??ly\ifcsname\??ly #1#2\endcsname#1\else + \ifcsname\??ly\currentlayout#2\endcsname\currentlayout + \fi\fi#2\endcsname} + +%D Beause normal \TEX\ has at most 256 dimensions (of which a +%D substantial part is already in use), we provide a way to +%D generate a format with macro based alternatives. For a long +%D time, this used to be the default case. Beware: only fixed +%D dimensions can be used in calculations! By the way, the +%D gain in speed can hardly be called impressive and is roughly +%D 1 second on a 35 second run of 850 empty pages with a +%D couple of backgrounds only (which is far less than one +%D percent on a normal document). + +%D The next series of dimensions are complemented by left +%D and rights ones. + +\newdimen \margindistance +\newdimen \edgedistance +\newdimen \marginwidth +\newdimen \edgewidth + +%D Because a distance does not really makes sense when there +%D is no area, we use a zero distance in case there is no +%D area. + +\def\layoutdistance#1#2% + {\ifdim\zeropoint<#1\layoutparameter#2\else\zeropoint\fi} + +%D The horizontal distances are: + +\newdimen \leftedgedistance +\newdimen \rightedgedistance +\newdimen \leftmargindistance +\newdimen \rightmargindistance + +%D The vertical distances are: + +\newdimen \topdistance +\newdimen \headerdistance +\newdimen \footerdistance +\newdimen \bottomdistance + +%D We need to calculate the extra distances: + +\def\setlayoutdimensions + {\global\marginwidth \layoutparameter\c!margin + \global\edgewidth \layoutparameter\c!edge + \global\margindistance \layoutparameter\c!margindistance + \global\edgedistance \layoutparameter\c!edgedistance + \global\leftedgedistance \layoutdistance \leftedgewidth \c!leftedgedistance + \global\rightedgedistance \layoutdistance \rightedgewidth \c!rightedgedistance + \global\leftmargindistance \layoutdistance \leftmarginwidth \c!leftmargindistance + \global\rightmargindistance\layoutdistance \rightmarginwidth \c!rightmargindistance + \global\topdistance \layoutdistance \topheight \c!topdistance + \global\headerdistance \layoutdistance \headerheight \c!headerdistance + \global\footerdistance \layoutdistance \footerheight \c!footerdistance + \global\bottomdistance \layoutdistance \bottomheight \c!bottomdistance} + +\def\setlayoutdistances % local in \setreducedvsize + {\headerdistance\layoutdistance\headerheight\c!headerdistance + \footerdistance\layoutdistance\footerheight\c!footerdistance} + +% these are wrong in the running text, assumes some swapping, needs a cleanup + +\def\outermarginwidth {\rightorleftpageaction\rightmarginwidth \leftmarginwidth } +\def\innermarginwidth {\rightorleftpageaction\leftmarginwidth \rightmarginwidth} +\def\outermargindistance{\rightorleftpageaction\rightmargindistance\leftmargindistance } +\def\innermargindistance{\rightorleftpageaction\leftmargindistance \rightmargindistance} + +\def\outeredgewidth {\rightorleftpageaction\rightedgewidth \leftedgewidth } +\def\inneredgewidth {\rightorleftpageaction\leftedgewidth \rightedgewidth} +\def\outeredgedistance {\rightorleftpageaction\rightedgedistance\leftedgedistance } +\def\inneredgedistance {\rightorleftpageaction\leftedgedistance \rightedgedistance} + +\def\outerspacewidth {\rightorleftpageaction\cutspace\backspace} +\def\innerspacewidth {\rightorleftpageaction\backspace\cutspace} + +\newtoks\extralayoutcalculations \def\calculatelayoutextras{\the\extralayoutcalculations} + +% \appendtoks +% non etex calculations used to go here +% \to \extralayoutcalculations + +\newtoks\everyswapmargins % watch the order ! + +\appendtoks + \swapdimens\leftmargindistance\rightmargindistance + \swapdimens\leftedgedistance \rightedgedistance + \swapdimens\leftmarginwidth \rightmarginwidth + \swapdimens\leftedgewidth \rightedgewidth +\to \everyswapmargins + +\appendtoks + \swapmacros\leftmargintotal \rightmargintotal + \swapmacros\leftedgetotal \rightedgetotal + \swapmacros\leftsidetotal \rightsidetotal + \swapmacros\leftcombitotal \rightcombitotal + \swapmacros\innermargintotal\outermargintotal + \swapmacros\inneredgetotal \outeredgetotal + \swapmacros\innercombitotal \outercombitotal + \swapmacros\innersidetotal \outersidetotal +\to \everyswapmargins + +%D \macros +%D {definepapersize} +%D +%D Before we start calculating layout dimensions, we will +%D first take care of paper sizes. The first argument can be +%D either an assignment (for defaults) or an identifier, in +%D which case the second argument is an assignment. +%D +%D \showsetup{definepapersize} + +\def\definepapersize + {\dodoubleempty\dodefinepapersize} + +\def\definepapersize + {\dotripleempty\dodefinepapersize} + +\def\dodefinepapersize[#1][#2][#3]% + {\ifsecondargument + \doifsomething{#1} % to be sure + {\doifassignmentelse{#2} + {\getparameters + [\??pp#1] % geen \c!scale, scheelt hash ruimte + [\c!width=\@@ppwidth,\c!height=\@@ppheight,\c!offset=\@@ppoffset,#2]} + {\setvalue{\??pp:1:#1}{#2}% + \setvalue{\??pp:2:#1}{#3}}}% + \else + \getparameters[\??pp][#1]% + \setuppapersize % hm. this will freeze ! + \fi} + +%D For the moment we need to fake this macro. + +\ifx\setuppapersize\undefined + \let\setuppapersize\relax +\fi + +%D We set the defaults to the dimensions of an A4 sheet of +%D paper. + +\definepapersize + [\c!width=210mm,\c!height=297mm,\c!offset=\zeropoint] + +%D Yet undocumented, let's see if it gets noticed. +%D +%D \starttyping +%D \definepapersize[main] [A4] [A4] +%D \definepapersize[extra][A4,landscape][A4,landscape] +%D +%D \starttext +%D \setuppapersize[main] +%D Page 1. \page +%D Page 2. \page +%D \setuppapersize[extra] +%D Page 2 \page +%D \setuppapersize[main] +%D Page 3. \page +%D Page 4. \page +%D \adaptpapersize[extra] +%D Page 5. \page +%D Page 6. \page +%D \stoptext +%D \stoptyping + +%D \macros +%D {setuppaper,setuppapersize} +%D +%D When setting up the papersize on which to typeset and +%D print, we can also determine some more characteristics. +%D +%D \showsetup{setuppapersize} +%D +%D We keep track of these features with the following +%D variables. + +\chardef\papermirror =0 \chardef\printmirror =0 +\chardef\paperorientation=0 \chardef\printorientation=0 % beware: later no chardef +\chardef\paperreverse =0 \chardef\printreverse =0 +\chardef\paperlandscape =0 \chardef\printlandscape =0 + +\let\papersize\empty \let\printpapersize\empty + +\def\paperscale{1} \newif\ifnegateprintbox + +\def\setuppaper[#1]% + {\getparameters[\??pp][\c!paper=,\c!page=,#1]% + \edef\@@ppxy{\the\numexpr\@@ppnx*\@@ppny\relax}% + \doifelsenothing\@@pppage + {\doifelsenothing\@@pppaper + {} % {\setuppapersize} % added, removed, no need for, too tricky, mag-01 (fixed by freezing pp's) + {\dodosetuppapersize[\papersize][\@@pppaper]}} + {\doifelsenothing\@@pppaper + {\dodosetuppapersize[\@@pppage][\printpapersize]} + {\dodosetuppapersize[\@@pppage][\@@pppaper]}}} + +\def\setuppapersize + {\dodoubleempty\dosetuppapersize} + +\def\dosetuppapersize[#1][#2]% + {\doifassignmentelse{#1} + {\setuppaper[#1]} + {\doifelsenothing{#2} + {\expanded{\dodosetuppapersize + [\executeifdefined{\??pp:1:#1}{#1}]% + [\executeifdefined{\??pp:2:#1}{}]}} + {\doifassignmentelse{#2} + {\getparameters[\??pp\executeifdefined{\??pp:1:#1}{#1}][#2]} + {\expanded{\dodosetuppapersize + [\executeifdefined{\??pp:1:#1}{#1}]% + [\executeifdefined{\??pp:1:#2}{#2}]}}}}} + +\let\reinstatepapersize\relax + +\def\adaptpapersize + {\global\let\reinstatepapersize\restorepapersize + \setuppapersize} + +\appendtoks + \reinstatepapersize + \global\let\reinstatepapersize\relax +\to \everyaftershipout + +\def\dodosetuppapersize[#1][#2]% + {\ifsecondargument + \expanded{\dododosetuppapersize[#1][#2]}% + \calculatehsizes + \calculatevsizes + \recalculatebackgrounds + \recalculatelayout + \else\iffirstargument + \setuppapersize[#1][#2]% + \else\ifx\papersize\undefined\else + \restorepapersize + \fi\fi\fi} + +% dimen freeze is a bit tricky, but catches local redundant calls +% with values where e.g width is defined in terms of \paperwidth + +\def\dododosetuppapersize[#1][#2]% + {\xdef\restorepapersize{\noexpand\setuppapersize[#1][#2]}% + \dosetuppaperorientation{#1}\paperlandscape\paperorientation\paperreverse\papermirror + \dosetuppaperorientation{#2}\printlandscape\printorientation\printreverse\printmirror + \def\docommand##1% + {\doifsomething{##1}{\doifdefined{\??pp##1\c!width} + {\global\paperwidth \getvalue{\??pp##1\c!width}% + \global\paperheight\getvalue{\??pp##1\c!height}% + \ifinpagebody + \setevalue{\??pp##1\c!height}{\the\paperheight}% + \setevalue{\??pp##1\c!width }{\the\paperwidth }% + \fi + \calculatepaperoffsets{##1}% + \xdef\papersize{##1}}}}% + \processcommacommand[#1]\docommand + \doifdefinedelse{\??pp#1\c!scale} + {\edef\paperscale{\getvalue{\??pp#1\c!scale}}} + {\edef\paperscale{1}}% + \def\docommand##1% + {\doifsomething{##1}{\doifdefined{\??pp##1\c!width} + {\global\printpaperwidth \getvalue{\??pp##1\c!width}% + \global\printpaperheight\getvalue{\??pp##1\c!height}% + \ifinpagebody + \setevalue{\??pp##1\c!height}{\the\printpaperheight}% + \setevalue{\??pp##1\c!width }{\the\printpaperwidth}% + \fi + \xdef\printpapersize{##1}}}}% + \processcommacommand[#2]\docommand + \global\setdimentoatleast\paperwidth \onepoint + \global\setdimentoatleast\paperheight \onepoint + \global\setdimentoatleast\printpaperwidth \onepoint + \global\setdimentoatleast\printpaperheight\onepoint + \ifcase\paperlandscape\else + \doglobal\swapdimens\paperwidth\paperheight + \fi + \ifcase\printlandscape\else + \doglobal\swapdimens\printpaperwidth\printpaperheight + \fi + % this check can be confusing, so we've added the possibility + % to bypass this test: \setuppapersize[option=fit] + \doif\@@ppoption\v!max % \v!fit is + {\bgroup + % we need to pre-swap else we get the wrong paper size + \ifcase\paperorientation\else + \doifinset\paperorientation{90,270}{\swapdimens\paperwidth\paperheight}% + \fi + \ifcase\printorientation\else + \doifinset\printorientation{90,270}{\swapdimens\printpaperwidth\printpaperheight}% + \fi + \ifdim\paperheight>\printpaperheight + \global\printpaperheight\paperheight + \writestatus\m!systems{print height forced to paper height}% + \fi + \ifdim\paperwidth>\printpaperwidth + \global\printpaperwidth\paperwidth + \writestatus\m!systems{print width forced to paper width}% + \fi + \egroup}} + +\def\dosetuppaperorientation#1#2#3#4#5% + {\global\chardef#2\zerocount + \global\chardef#5\zerocount + \globallet#3\!!zerocount + \globallet#4\!!zerocount + \global\negateprintboxfalse + \processallactionsinset + [#1] + [ \v!landscape=>\global\chardef#2\plusone, + \v!mirrored=>\global\chardef#5\plusone, + \v!rotated=>\gdef#3{90}\gdef#4{270}, + \v!negative=>\global\negateprintboxtrue, + 90=>\gdef#3{90}\gdef#4{270}, + 180=>\gdef#3{180}\gdef#4{0}, + 270=>\gdef#3{270}\gdef#4{90}]} + +\ifx\calculatepaperoffsets\undefined + + \def\calculatepaperoffsets#1% + {\scratchdimen\getvalue{\??pp#1\c!offset}% + \global\advance\paperwidth -2\scratchdimen + \global\advance\paperheight-2\scratchdimen} + +\fi + +\let\restorepapersize\relax + +% \def\docheckforems#1% +% {\beforesplitstring#1\at em\to\asciia +% \doifnot\asciia{#1} +% {\aftersplitstring\asciia\at=\to\asciia +% \doifsomething\asciia{\showmessage\m!systems{10}{#1}}}} +% +% \def\checkforems[#1]% +% {\processcommalist[#1]\docheckforems} + +\ifx\setups\undefined \def\setups[#1]{\setdefaultpenalties} \fi + +% \newtoks \everybeforelayout \relax +% \newtoks \everyafterlayout \relax + +\def\recalculatelayout + {\doifsomething{\layoutparameter\c!page\layoutparameter\c!paper} + {\expanded{\dododosetuppapersize[\layoutparameter\c!page][\layoutparameter\c!paper]}}% + \dorecalculatelayout} + +\def\dorecalculatelayout + {%\the\everybeforelayout + \setups[\layoutparameter\c!preset]% + \global\leftmarginwidth \layoutparameter\c!leftmargin + \global\rightmarginwidth\layoutparameter\c!rightmargin + \global\leftedgewidth \layoutparameter\c!leftedge + \global\rightedgewidth \layoutparameter\c!rightedge + \global\headerheight \layoutparameter\c!header + \global\footerheight \layoutparameter\c!footer + \global\bottomheight \layoutparameter\c!bottom + \global\topheight \layoutparameter\c!top + \global\backspace \layoutparameter\c!backspace + \global\topspace \layoutparameter\c!topspace + \setlayoutdimensions % the rest of the `dimensions' + \doifelse\@@lygrid\v!yes\gridsnappingtrue\gridsnappingfalse + \ifgridsnapping + \setsystemmode\v!grid + \else + \resetsystemmode\v!grid + \fi + \setups[\layoutparameter\c!setups]% depends on gridsnapping ! + \simplesetupwhitespace + \simplesetupblank + \global\cutspace\layoutparameter\c!cutspace + \relax + \doifelse{\layoutparameter\c!width}\v!middle + {\ifdim\cutspace=\zeropoint + \global\cutspace\backspace + \fi + \global\makeupwidth\dimexpr\paperwidth-\backspace-\cutspace\relax} + {\doifelse{\layoutparameter\c!width}\v!fit + {\ifdim\cutspace=\zeropoint + \global\cutspace\backspace + \fi + \global\makeupwidth\dimexpr\paperwidth-\cutspace\relax + \scratchdimen\dimexpr\backspace + -\leftedgewidth -\leftedgedistance + -\leftmarginwidth-\leftmargindistance\relax + \ifdim\scratchdimen<\zeropoint + \scratchdimen\zeropoint + \fi + \global\advance\makeupwidth\dimexpr + -\rightmargindistance-\rightmarginwidth + -\rightedgedistance -\rightedgewidth + -\scratchdimen\relax} + {\global\makeupwidth\layoutparameter\c!width\relax + \ifdim\cutspace=\zeropoint + \global\cutspace\dimexpr\paperwidth-\makeupwidth-\backspace\relax + % \else + % A kind of inconsistent specification, but used + % in for instance s-pre-19.tex; the cutspace is + % used only for determining some kind of right + % margin; don't use this in doublesided mode + \fi}}% + \scratchdimen\layoutparameter\c!bottomspace\relax + %\ifdim\scratchdimen=\zeropoint + % \scratchdimen\topspace + %\fi + \global\bottomspace\layoutparameter\c!bottomspace\relax + \global\layoutlines0\number\layoutparameter\c!lines\relax % may be empty + \ifcase\layoutlines + \doifelse{\layoutparameter\c!height}\v!middle + {\ifdim\bottomspace=\zeropoint + \global\bottomspace\topspace + \fi + \global\makeupheight\dimexpr\paperheight-\topspace-\bottomspace\relax} + {\doifelse{\layoutparameter\c!height}\v!fit + {\ifdim\bottomspace=\zeropoint + \global\bottomspace\topspace + \fi + \global\makeupheight\dimexpr\paperheight-\bottomspace\relax + \scratchdimen\dimexpr\topspace-\topheight-\topdistance\relax + \ifdim\scratchdimen<\zeropoint + \scratchdimen\zeropoint + \fi + \global\advance\makeupheight\dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax} + {\global\makeupheight\layoutparameter\c!height\relax + \ifdim\bottomspace=\zeropoint + \global\bottomspace\dimexpr\paperheight-\makeupheight-\topspace\relax + \else + % inconsistent specification + \fi}}% + \else + % beware, when the bodyfont changes (switched) this will change as well; implementing + % a global lineheight is tricky: should we take the bodyfont interlinespace or the one set + % independent of the bodyfont (before or after a layout spec); way too fuzzy, so we + % stick to the current method (after a night of experimenting ...2003/10/13) + \global\makeupheight\dimexpr + \layoutparameter\c!lines\lineheight-\strutheight+\topskip+ + \headerdistance+\headerheight+\footerdistance+\footerheight\relax + \fi + \backoffset\layoutparameter\c!horoffset + \topoffset \layoutparameter\c!veroffset + \global\setdimentoatleast\makeupwidth\onepoint + \global\setdimentoatleast\makeupheight \onepoint + % \checkcurrentlayout % here ? + % \the\everyafterlayout + \calculatelayoutextras + \calculatehsizes + \calculatevsizes + \calculatepseudocolumns + \checkgridsnapping + \recalculatebackgrounds} + +\def\calculatepseudocolumns + {\global\layoutcolumns\layoutparameter\c!columns + \global\layoutcolumndistance\layoutparameter\c!columndistance + \global\layoutcolumnwidth\dimexpr\makeupwidth-\layoutcolumns\layoutcolumndistance+\layoutcolumndistance\relax + \global\divide\layoutcolumnwidth\layoutcolumns + \dorecurse\layoutcolumns + {\setxvalue{\??ly:c:\recurselevel}% + {\the\numexpr\recurselevel-\plusone\relax\dimexpr\layoutcolumnwidth+\layoutcolumndistance\relax}}} + +%\dorecurse\layoutcolumns +% {\setxvalue{\??ly:c:\recurselevel}{\the\dimexpr +% (\numexpr(\recurselevel-1)\dimexpr(\layoutcolumnwidth+\layoutcolumndistance))}} + +\def\layoutcolumnoffset#1% + {\executeifdefined{\??ly:c:#1}\zeropoint} + +\def\checklayout + {\ifdim\makeupheight=\layoutlines\lineheight \else \recalculatelayout \fi} + +\appendtoks \checklayout \to \everystarttext + +% document: +% +% \setuplayout[odd][state=stop] \setuplayout[even][state=stop] \setuplayout[page] +% +% \startstandardmakeup[page=blank] ... \stopstandardmakeup + +\def\changetolayout#1% + {%\writestatus\m!layouts{changing to layout #1}% + \xdef\currentlayout{#1}\recalculatelayout} + +\def\checkcurrentoddlayout + {\ifcsname\??ly\v!odd\c!state\endcsname + \doifvalue{\??ly\v!odd\c!state}\v!start{\changetolayout\v!odd}% + \fi} + +\def\checkcurrentevenlayout + {\ifcsname\??ly\v!even\c!state\endcsname + \doifvalue{\??ly\v!even\c!state}\v!start{\changetolayout\v!even}% + \fi} + +\ifx\lastpage\undefined \def\lastpage{1} \fi + +\def\reverserealfolio + {\ifnum\lastpage>\plusone + \ifnum\lastpage=\realfolio + \v!last + \else\ifnum\plusone=\realfolio + \v!first + \else + \the\numexpr\realfolio-\lastpage\relax + \fi\fi + \else + \!!zerocount + \fi} + +\def\checkcurrentlayout % public and used in naw, so keep this name + {\ifcsname\??ly\realfolio\c!state\endcsname + \doifvalue{\??ly\realfolio\c!state}\v!start{\changetolayout\realfolio}% + \else\ifcsname\??ly\reverserealfolio\c!state\endcsname + \doifvalue{\??ly\reverserealfolio\c!state}\v!start{\changetolayout\reverserealfolio}% + \else\ifcsname\??ly\v!current\c!state\endcsname + \changetolayout\v!current % no start test ? + \else + \doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout + \fi\fi\fi} + +% testcase +% +% \setuppagenumbering[alternative=doublesided] +% +% \setuplayout [width=11cm] +% \definelayout [odd] [backspace=1cm] +% \definelayout [even] [backspace=4cm] +% \definelayout [5] [backspace=5cm] +% \definelayout [6] [backspace=5cm] +% \definelayout [-2] [backspace=0cm,cutspace=0cm] +% \definelayout [last] [backspace=0cm,cutspace=0cm] +% +% \checkcurrentlayout \showframe +% +% \starttext +% \dorecurse{20} {\input knuth \endgraf \input tufte \endgraf} +% \stoptext + +%appendtoks \checkcurrentlayout \to \everyaftershipout % no +\appendtoks \checkcurrentlayout \to \everystarttext + +\appendtoks + \dochecknextlayout +\to \everyaftershipout + +% \def\dochecknextlayout +% {\ifx\currentlayout\v!current +% % prevent redundant calculations +% \else +% \globallet\currentlayout\empty +% \global\letbeundefined{\??ly\v!current\c!state}% +% \checkcurrentlayout +% \fi} +% +% this breaks after a standardmakeup + +\def\dochecknextlayout{\checkcurrentlayout} + +\newif\ifdoublesidedprint + +\def\presetcenterpagebox % in \setuplayout !!!!!!!!!!!!!!!! + {\doublesidedprintfalse + \normalexpanded{\noexpand\processallactionsinset[\@@lylocation]} + [ \v!middle=>{\setuppapersize[\c!left=\hss,\c!right=\hss,\c!top=\vss,\c!bottom=\vss]}, + \v!left=>{\setuppapersize[\c!left=,\c!right=\hss]}, + \v!right=>{\setuppapersize[\c!left=\hss,\c!right=]}, + \v!bottom=>{\setuppapersize[\c!top=\vss,\c!bottom=]}, + \v!top=>{\setuppapersize[\c!top=,\c!bottom=\vss]},% + \v!doublesided=>\doublesidedprinttrue, + \v!singlesided=>\doublesidedprintfalse]} + +\def\definelayout + {\dodoubleargument\dodefinelayout} + +\def\dodefinelayout[#1][#2]% + {\getparameters[\??ly#1][\c!state=\v!start,#2]} + +% \def\dodosetuplayout[#1][#2]% +% {\ConvertToConstant\doifnot{#2}\v!reset % #2 ? +% {\getparameters[\??ly#1][#2]% +% \checkforems[#2]}} + +\def\dodosetuplayout[#1][#2]% + {\doifnot{#2}\v!reset{\getparameters[\??ly#1][#2]}} + +% global needed for non-doublesided standardmakeup + +\def\dosetuplayout[#1][#2]% + {\globallet\currentlayout\empty % new, global + \ifsecondargument + \dodosetuplayout[#1][#2]% + \else\iffirstargument + \doifassignmentelse{#1} + {\dodosetuplayout[][#1]} + {\doifnot{#1}\v!reset{\xdef\currentlayout{#1}}}% new, global + \fi\fi + \recalculatelayout + \checkcurrentlayout % here ? + \presetcenterpagebox} + +\def\setuplayout + {\dodoubleempty\dosetuplayout} + +\let\@@zaheight\!!zeropoint + +\def\dopushpagedimensions + {\xdef\oldtextheight {\the\textheight }% + \xdef\oldfooterheight{\the\footerheight}% + \global\let\@@zaheight\@@zaheight} + +\def\dopoppagedimensions + {\global\textheight \oldtextheight + \global\footerheight\oldfooterheight + \recalculatelayout + \global\let\pushpagedimensions\dopushpagedimensions + \global\let\poppagedimensions\relax} + +\let\poppagedimensions \relax +\let\pushpagedimensions\dopushpagedimensions + +% Elke \csname ... \endcsname wordt ook aangemaakt, dus ook +% in een test met \doifdefined. Bij veel bladzijden kan dit +% te veel macro's kosten. Vandaar de set \adaptedpages. Het +% kost tijd, maar scheelt macro's. + +\let\adaptedpages\empty + +\def\adaptpagedimensions + {\ifx\adaptedpages\empty\else + \adaptpagedimensionsindeed + \fi} + +\def\adaptpagedimensionsindeed + {\rawdoifinsetelse\realfolio\adaptedpages + {\removefromcommalist\realfolio\adaptedpages + \getvalue{\??za\realfolio}% + \letbeundefined{\??za\realfolio}}} + +\def\checkpagedimensions + {\poppagedimensions + \adaptpagedimensions} + +\def\reportpagedimensions + {\ifx\poppagedimensions\relax \else + \space\the\dimexpr\@@zaheight\relax\space-\space + \fi + \realfolio} + +\def\dodoadaptlayout[#1]% + {\getparameters[\??za][\c!height=,\c!lines=0,#1]% + \pushpagedimensions + \ifcase\@@zalines\relax + \showmessage\m!layouts1{\@@zaheight,\realfolio}% + \else + \showmessage\m!layouts1{\@@zalines\space\v!lines,\realfolio}% + \def\@@zaheight{\@@zalines\openlineheight}% + \fi + \doifelse\@@zaheight\v!max + {\balancedimensions\textheight\footerheight\footerheight} + {\balancedimensions\textheight\footerheight\@@zaheight}% + \ifdim\footerheight<\zeropoint + \global\advance\textheight \footerheight + \global\footerheight\zeropoint + \global\xdef\@@zaheight{\layoutparameter\c!footer\space(\v!max)}% + \fi + \setvsize + \global\pagegoal\vsize % nog corrigeren voor insertions ? + \recalculatebackgrounds + \global\let\pushpagedimensions\relax + \global\let\poppagedimensions\dopoppagedimensions} + +\def\doadaptlayout[#1][#2]% + {\doifelsenothing{#2} + {\dodoadaptlayout[#1]} + {\def\docommand##1% + {\addtocommalist{##1}\adaptedpages + \setgvalue{\??za##1}{\dodoadaptlayout[#2]}}% + \processcommalist[#1]\docommand + \adaptpagedimensions}} + +\def\adaptlayout + {\dodoubleempty\doadaptlayout} + +% describe interface + +%D Centering the paper area on the print area is determined +%D by the \type {top}, \type {bottom}, \type {left} and \type +%D {right} parameters. + +\def\centerpagebox#1% + {\printpaperwidth \paperscale\printpaperwidth + \printpaperheight\paperscale\printpaperheight + \setbox#1\vbox to \printpaperheight + {\@@pptop + \hbox to \printpaperwidth + {\ifdoublesidedprint + \doifbothsides + {\@@ppleft \box#1\@@ppright} + {\@@ppleft \box#1\@@ppright} + {\@@ppright\box#1\@@ppleft }% + \else + \@@ppleft \box#1\@@ppright + \fi}% + \par + \@@ppbottom}} + +\def\offsetprintbox#1% + {\ifdim\topoffset=\zeropoint % \relax + \ifdim\backoffset=\zeropoint + \donefalse + \else + \donetrue + \fi + \else + \donetrue + \fi + \ifdone + \edef\next{\wd#1\the\wd#1\ht#1\the\ht#1\dp#1\the\dp#1}% + \setbox#1\vbox + {\offinterlineskip + \vskip\topoffset + \hskip\doifbothsides\backoffset\backoffset{-\backoffset}% + \box#1}% + \next + \fi} + +\def\replicatepagebox#1% + {\ifnum\@@lynx>\plusone + \donetrue + \else\ifnum\@@lyny>\plusone + \donetrue + \else + \donefalse + \fi\fi + \ifdone + \setbox#1\vbox + {\offinterlineskip + \dorecurse\@@lyny + {\hbox{\dorecurse\@@lynx{\copy#1\hskip\@@lydx}\unskip}% + \vskip\@@lydy} + \unskip}% + \fi} + +\def\orientpagebodybox#1#2#3% + {\ifnum#2#3>\zerocount + \setbox#1\vbox + {\edef\somerotation{\ifdoublesided\ifodd\realpageno#2\else#3\fi\else#2\fi}% + \dorotatebox\somerotation\hbox{\box#1}}% + \fi} + +\def\orientpaperbox#1% + {\orientpagebodybox{#1}\paperorientation\paperreverse} + +\def\orientprintbox#1% + {\orientpagebodybox{#1}\printorientation\printreverse} + +\def\mirrorpagebodybox#1#2% + {\ifcase#2\or + \setbox#1\vbox{\domirrorbox\vbox{\box#1}}% + \fi} + +\def\mirrorpaperbox#1% + {\mirrorpagebodybox{#1}\papermirror} + +\def\mirrorprintbox#1% + {\mirrorpagebodybox{#1}\printmirror} + +\def\scalepagebox#1% + {\ifdim\@@lyscale\points=\onepoint \else + \setbox#1\vbox{\scale[\c!sx=\@@lyscale,\c!sy=\@@lyscale]{\box#1}}% + \paperwidth \@@lyscale\paperwidth + \paperheight\@@lyscale\paperheight + \fi} + +\def\negateprintbox#1% + {\ifnegateprintbox + \negatecolorbox{#1}% + \fi} + +\def\pagecutmarksymbol {\the\realpageno} +\def\pagecutmarklength {.5cm} +\let\pagecutmarktoptext \empty +\let\pagecutmarkbottomtext \empty + +\def\extrapagecutmarkbottomtext + {\rlap{\jobname}\hfill\currentdate\space-\space\currenttime\hfill\llap{\realfolio}} + +\def\makepagecutbox % #1 + {\let\cutmarksymbol \pagecutmarksymbol + \let\cutmarklength \pagecutmarklength + \let\cutmarktoptext \pagecutmarktoptext + \let\cutmarkbottomtext\pagecutmarkbottomtext + \makecutbox} + +\setvalue{\??ly:n:\c!marking:\v!on}% + {\makepagecutbox} + +\setvalue{\??ly:n:\c!marking:\v!page}% only at outer when nx/ny > 0 + {\makepagecutbox} + +\setvalue{\??ly:n:\c!marking:\v!empty}% + {\let\pagecutmarksymbol\empty + \let\pagecutmarktoptext\empty + \let\pagecutmarkbottomtext\empty + \makepagecutbox} + +\setvalue{\??ly:n:\c!marking:\v!text}% + {\let\pagecutmarksymbol\empty + \let\pagecutmarkbottomtext\extrapagecutmarkbottomtext + \makepagecutbox} + +\setvalue{\??ly:c:\c!marking:\v!color}% + {\doaddpagecolormarks\colormarkbox} + +\setvalue{\??ly:c:\c!marking:\v!screen}% + {\doaddpagecolormarks\rastermarkbox} + +\letvalue{\??ly:c:\c!marking:\v!unknown}\gobbleoneargument +\letvalue{\??ly:n:\c!marking:\v!unknown}\gobbleoneargument + +% \def\addpagecutmarks {\executeifdefined{\??ly:n:\c!marking:\@@lymarking}\gobbleoneargument} +% \def\addpagecolormarks{\executeifdefined{\??ly:c:\c!marking:\@@lymarking}\gobbleoneargument} + +\def\addpagecutmarks {\expandcheckedcsname{\??ly:n:\c!marking:}\@@lymarking\s!unknown} +\def\addpagecolormarks{\expandcheckedcsname{\??ly:c:\c!marking:}\@@lymarking\s!unknown} + +\def\doaddpagecolormarks#1#2% + {\makepagecutbox{#2}% + \ifnum\horizontalcutmarks>\plustwo \chardef\colormarkoffset\plusfour \fi + \ifnum\verticalcutmarks >\plustwo \chardef\colormarkoffset\plusfour \fi + #1{#2}} + +% NOG EENS NAGAAN WANNEER NU GLOBAL EN WANNEER NIET + +\ifx\doifelselayoutsomeline\undefined % defined in page-txt + \let\doifelselayoutsomeline\secondofthreearguments +\fi + +\def\compensatevsizeheader {\advance\textheight-\dimexpr\headerheight+\headerdistance\relax} +\def\compensatevsizefooter {\advance\textheight-\dimexpr\footerheight+\footerdistance\relax} +\def\globalcompensatevsizeheader{\global\advance\textheight-\dimexpr\headerheight+\headerdistance\relax} +\def\globalcompensatevsizefooter{\global\advance\textheight-\dimexpr\footerheight+\footerdistance\relax} + +\def\compensatevsizeheaderzero{\headerheight\zeropoint\setlayoutdistances} +\def\compensatevsizefooterzero{\footerheight\zeropoint\setlayoutdistances} + +\def\calculatevsizes + {\textheight\makeupheight + \doifelselayoutsomeline\v!header\compensatevsizeheader\donothing + \doifelselayoutsomeline\v!footer\compensatevsizefooter\donothing + \setvsizemodes + \resetglobal + \setvsize} + +\def\calculateglobalvsizes + {\global\textheight\makeupheight + \doifelselayoutsomeline\v!header\globalcompensatevsizeheader\donothing + \doifelselayoutsomeline\v!footer\globalcompensatevsizefooter\donothing + \setvsizemodes + \setvsize} + +\def\setvsizemodes + {\ifzeropt\headerheight + \resetsystemmode\v!header + \else + \setsystemmode\v!header + \fi + \ifzeropt\footerheight + \resetsystemmode\v!footer + \else + \setsystemmode\v!footer + \fi} + +\def\calculatereducedvsizes + {\textheight\makeupheight + \doifelselayoutsomeline\v!header\compensatevsizeheader\compensatevsizeheaderzero + \doifelselayoutsomeline\v!footer\compensatevsizefooter\compensatevsizefooterzero} + +\newdimen\innermakeupwidth % special purpose +\newdimen\innermakeupmargin % special purpose + +\chardef\innermakeupcompensation\plusone + +\def\compensatedinnermakeupmargin + {\dimexpr\ifnum\innermakeupcompensation=\plusone+\innermakeupmargin\else\zeropoint\fi\relax} + +\def\freezetextwidth % \makeupwidth may be set to \textwidth + {\textwidth\makeupwidth % which is a tricky but valid value + \doifsomething{\layoutparameter\c!textwidth} + {\textwidth\layoutparameter\c!textwidth}% % local + \global\innermakeupwidth\textwidth + \doifelsenothing{\layoutparameter\c!textmargin} + {\global\innermakeupmargin\zeropoint} + {\global\innermakeupmargin\layoutparameter\c!textmargin}% + \global\advance\innermakeupwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax + \advance\textwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax} % local + +\def\calculatehsizes + {\freezetextwidth + \sethsize} + +% De onderstaande macro voert commando's uit, afhankelijk van +% het karakter van het paginanummer. +% +% \doifoddpageelse{then-commando}{else-commando} + +%D When we start at an even page, we need to swap the layout +%D differently. We cannot adapt the real page number, since +%D it is used in cross referencing. The next switch is set +%D when we start at an even page. + +\newif\ifshiftedrealpageno + +% We could use nested if here plu ssone \@EAEAEA's but but the +% next variant has less expansion which is nicer in tracing. + +\def\doifoddpageelse {\ifshiftedrealpageno\expandafter\doifoddpageelseyes\else\expandafter\doifoddpageelsenop\fi} +\def\doifoddpageelseyes{\ifodd\realpageno\expandafter\secondoftwoarguments\else\expandafter\firstoftwoarguments\fi} +\def\doifoddpageelsenop{\ifodd\realpageno\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi} + +\let\doifonevenpaginaelse\doifoddpageelse + +\def\redoifoddpageelse#1{\doifoddpageelse} + +\def\doifbothsidesoverruled + {\ifdoublesided + \expandafter\redoifoddpageelse + \else + \expandafter\firstofthreearguments + \fi} + +\def\doifbothsides% #1 #2 #3 + {\ifdoublesided + \expandafter\doifbothsidesindeed + \else + \expandafter\firstofthreearguments + \fi} + +\def\doifbothsidesindeed + {\ifsinglesided + \expandafter\firstofthreearguments + \else + \expandafter\redoifoddpageelse + \fi} + +\def\settexthoffset + {\texthoffset\doifbothsides\backspace\backspace{\dimexpr\paperwidth-\backspace-\makeupwidth\relax}} + +\def\goleftonpage + {\hskip-\dimexpr\leftmargindistance+\leftmarginwidth+\leftedgedistance+\leftedgewidth\relax} + +\def\doifmarginswapelse#1#2% + {\doifbothsides{#1}{#1}{#2}} + +\def\swapmargins + {\doifmarginswapelse\relax\doswapmargins} + +\def\doswapmargins + {\let\swapmargins \relax % to prevent local swapping + \let\doswapmargins\relax % to prevent local swapping + \the\everyswapmargins} + +\def\rightorleftpageaction + {\ifdoublesided + \expandafter\rightorleftpageactionindeed + \else + \expandafter\firstoftwoarguments + \fi} + +\def\rightorleftpageactionindeed + {\ifsinglesided + \expandafter\firstoftwoarguments + \else + \expandafter\doifoddpageelse + \fi} + +\def\outermarginwidth {\rightorleftpageaction\rightmarginwidth \leftmarginwidth } +\def\innermarginwidth {\rightorleftpageaction\leftmarginwidth \rightmarginwidth} +\def\outermargindistance{\rightorleftpageaction\rightmargindistance\leftmargindistance } +\def\innermargindistance{\rightorleftpageaction\leftmargindistance \rightmargindistance} + +\def\outeredgewidth {\rightorleftpageaction\rightedgewidth \leftedgewidth } +\def\inneredgewidth {\rightorleftpageaction\leftedgewidth \rightedgewidth} +\def\outeredgedistance {\rightorleftpageaction\rightedgedistance\leftedgedistance } +\def\inneredgedistance {\rightorleftpageaction\leftedgedistance \rightedgedistance} + +\def\outerspacewidth {\rightorleftpageaction\cutspace \backspace} +\def\innerspacewidth {\rightorleftpageaction\backspace\cutspace } + +\def\leftmargintotal {\dimexpr\leftmarginwidth +\leftmargindistance \relax} +\def\rightmargintotal {\dimexpr\rightmarginwidth+\rightmargindistance\relax} +\def\leftedgetotal {\dimexpr\leftedgewidth +\leftedgedistance \relax} +\def\rightedgetotal {\dimexpr\rightedgewidth +\rightedgedistance \relax} + +\def\leftsidetotal {\dimexpr\leftmarginwidth +\leftedgetotal \relax} +\def\rightsidetotal {\dimexpr\rightmarginwidth+\rightedgetotal\relax} +\def\leftcombitotal {\dimexpr\leftmargintotal +\leftedgetotal \relax} +\def\rightcombitotal {\dimexpr\rightmargintotal+\rightedgetotal\relax} + +\def\innermargintotal {\dimexpr\innermarginwidth+\innermargindistance\relax} +\def\outermargintotal {\dimexpr\outermarginwidth+\outermargindistance\relax} +\def\inneredgetotal {\dimexpr\inneredgewidth +\inneredgedistance \relax} +\def\outeredgetotal {\dimexpr\outeredgewidth +\outeredgedistance \relax} + +\def\innercombitotal {\dimexpr\innermargintotal+\inneredgetotal\relax} +\def\outercombitotal {\dimexpr\outermargintotal+\outeredgetotal\relax} +\def\innersidetotal {\dimexpr\innermarginwidth+\inneredgetotal\relax} +\def\outersidetotal {\dimexpr\outermarginwidth+\outeredgetotal\relax} + +%D \macros +%D {startlocallayout} +%D +%D These macros should be used with care. They permit local +%D layouts (as used in fitting pages, see \type {page-app.tex}). + +%D This is kind of obsolete now that we have \type +%D {\definelayout}, so this hack will disappear in future +%D versions. + +\def\startlocallayout + {\globalpushmacro\restorepapersize + \globalpushmacro\currentlayout} + +\def\stoplocallayout + {\globalpopmacro\currentlayout + \globalpopmacro\restorepapersize + \restorepapersize + \setuplayout} + +%D \macros +%D {showprint, showframe, showlayout, showsetups} +%D +%D We predefine a couple of tracing macros. +%D +%D \showsetup{showprint} +%D \showsetup{showframe} +%D \showsetup{showlayout} +%D \showsetup{showsetups} +%D %showsetup{showmargins} + +\fetchruntimecommand \showprint {page-run.mkii} +\fetchruntimecommand \showframe {page-run.mkii} +\fetchruntimecommand \showlayout {page-run.mkii} +\fetchruntimecommand \showsetups {page-run.mkii} +\fetchruntimecommand \showmargins {page-run.mkii} + +%D The default dimensions are quite old and will not change. +%D The funny fractions were introduced when we went from fixed +%D dimensions to relative ones. Since \CONTEXT\ is a dutch +%D package, the dimensions are based on the metric system. The +%D asymmetrical layout is kind of handy for short +%D quick||and||dirty stapled documents. +%D +%D Although valid, it is not a real good idea to use +%D dimensions based on the \type {em} unit. First of all, +%D since there are no fonts loaded yet, this dimension makes +%D no sense, and second, you would loose track of values, +%D since they could change while going to a new page, +%D depending on the current font setting. + +\setuplayout + [ \c!topspace=.08417508418\paperheight, % 2.5cm + \c!top=\zeropoint, + \c!topdistance=\zeropoint, + \c!header=.06734006734\paperheight, % 2.0cm + \c!headerdistance=\zeropoint, + \c!height=.84175084175\paperheight, % 25.0cm + \c!footerdistance=\layoutparameter\c!headerdistance, + \c!footer=.06734006734\paperheight, % 2.0cm + \c!bottomdistance=\layoutparameter\c!topdistance, + \c!bottom=\zeropoint, + \c!backspace=.11904761905\paperwidth, % 2.5cm + \c!edge=\zeropoint, + \c!edgedistance=\layoutparameter\c!margindistance, + \c!margin=.12649983170\paperwidth, % snijwit-2*afstand + \c!margindistance=.02008341748\paperwidth, % 12.0pt + \c!leftedge=\layoutparameter\c!edge, + \c!leftedgedistance=\layoutparameter\c!edgedistance, + \c!leftmargin=\layoutparameter\c!margin, + \c!leftmargindistance=\layoutparameter\c!margindistance, + \c!width=.71428571429\paperwidth, % 15.0cm + \c!rightmargindistance=\layoutparameter\c!margindistance, + \c!rightmargin=\layoutparameter\c!margin, + \c!rightedgedistance=\layoutparameter\c!edgedistance, + \c!rightedge=\layoutparameter\c!edge, + \c!veroffset=\zeropoint, + \c!bottomspace=\zeropoint, + \c!horoffset=\zeropoint, + \c!cutspace=\zeropoint, + \c!textwidth=, % dangerous option -> centered / local + \c!textmargin=, % dangerous option -> both sides + \c!textdistance=\zeropoint, % shift down on grid + \c!style=, + \c!color=, + \c!marking=\v!off, + \c!location=, % \v!singlesided, but empty is signal + \c!scale=1, + \c!nx=1, + \c!ny=1, + \c!dx=\zeropoint, + \c!dy=\zeropoint, + \c!grid=\v!no, + \c!preset=, + \c!setups=\systemsetupsprefix\s!default, + \c!clipoffset=\zeropoint, + \c!lines=0, + \c!paper=, % for foxet + \c!page=, % for foxet + \c!columns=1, + \c!columndistance=\zeropoint] + +%D First we define a whole range of (DIN) papersizes, +%D of which the A-series makes most sense. We enable checking. + +%D We also set some of the parameters that will be used when +%D positioning the typeset paper onto the print paper. + +\setuppaper % (size) % only used in XY imposition + [\c!width=\zeropoint, + \c!height=\zeropoint, + \c!topspace=\zeropoint, + \c!backspace=\zeropoint, + \c!dx=\zeropoint, + \c!dy=\zeropoint, + \c!nx=1, + \c!ny=1, + \c!method=\v!normal] + +\setuppapersize + [\c!option=\v!max, + \c!top=, + \c!bottom=\vss, + \c!left=, + \c!right=\hss] + +\definepapersize [A0] [\c!width=841mm,\c!height=1189mm] +\definepapersize [A1] [\c!width=594mm,\c!height=841mm] +\definepapersize [A2] [\c!width=420mm,\c!height=594mm] +\definepapersize [A3] [\c!width=297mm,\c!height=420mm] +\definepapersize [A4] [\c!width=210mm,\c!height=297mm] +\definepapersize [A5] [\c!width=148mm,\c!height=210mm] +\definepapersize [A6] [\c!width=105mm,\c!height=148mm] +\definepapersize [A7] [\c!width=74mm,\c!height=105mm] +\definepapersize [A8] [\c!width=52mm,\c!height=74mm] +\definepapersize [A9] [\c!width=37mm,\c!height=52mm] +\definepapersize [A10] [\c!width=26mm,\c!height=37mm] + +\definepapersize [B0] [\c!width=1000mm,\c!height=1414mm] +\definepapersize [B1] [\c!width=707mm,\c!height=1000mm] +\definepapersize [B2] [\c!width=500mm,\c!height=707mm] +\definepapersize [B3] [\c!width=353mm,\c!height=500mm] % [\c!width=354mm,\c!height=500mm] +\definepapersize [B4] [\c!width=250mm,\c!height=353mm] % [\c!width=250mm,\c!height=354mm] +\definepapersize [B5] [\c!width=176mm,\c!height=250mm] % [\c!width=177mm,\c!height=250mm] +\definepapersize [B6] [\c!width=125mm,\c!height=176mm] % [\c!width=125mm,\c!height=177mm] +\definepapersize [B7] [\c!width=88mm,\c!height=125mm] +\definepapersize [B8] [\c!width=62mm,\c!height=88mm] % [\c!width=63mm,\c!height=88mm] +\definepapersize [B9] [\c!width=44mm,\c!height=62mm] % [\c!width=44mm,\c!height=63mm] +\definepapersize [B10] [\c!width=31mm,\c!height=44mm] + +\definepapersize [C0] [\c!width=917mm,\c!height=1297mm] +\definepapersize [C1] [\c!width=648mm,\c!height=917mm] % [\c!width=649mm,\c!height=917mm] +\definepapersize [C2] [\c!width=458mm,\c!height=648mm] % [\c!width=459mm,\c!height=649mm] +\definepapersize [C3] [\c!width=324mm,\c!height=458mm] % [\c!width=324mm,\c!height=459mm] +\definepapersize [C4] [\c!width=229mm,\c!height=324mm] +\definepapersize [C5] [\c!width=162mm,\c!height=229mm] +\definepapersize [C6] [\c!width=114mm,\c!height=162mm] % [\c!width=115mm,\c!height=162mm] +\definepapersize [C7] [\c!width=81mm,\c!height=114mm] % [\c!width=81mm,\c!height=115mm] +\definepapersize [C8] [\c!width=57mm,\c!height=81mm] +\definepapersize [C9] [\c!width=40mm,\c!height=57mm] +\definepapersize [C10] [\c!width=28mm,\c!height=40mm] + +%D Per August 2004 the rounding of some (seldom used) sizes +%D were corrected top the latest DIN specifications. Peter +%D Rolf came up with these and a few more missing sizes. +%D Watch out: spaces and slashes! + +\definepapersize [4 A0] [\c!width=1682mm,\c!height=2378mm] +\definepapersize [2 A0] [\c!width=1189mm,\c!height=1682mm] +\definepapersize [C6/C5] [\c!width=114mm,\c!height=229mm] + +%D Because there are no standardized screen sizes, we define +%D a bunch of sizes with $4:3$ ratios. The \type {S6} size is +%D nearly as wide as a sheet of \type {A4} paper. + +\definepapersize [S3] [\c!width=300pt,\c!height=225pt] +\definepapersize [S4] [\c!width=400pt,\c!height=300pt] +\definepapersize [S5] [\c!width=500pt,\c!height=375pt] +\definepapersize [S6] [\c!width=600pt,\c!height=450pt] +\definepapersize [S8] [\c!width=800pt,\c!height=600pt] +\definepapersize [SW] [\c!width=800pt,\c!height=450pt] +\definepapersize [SM] [\c!width=720pt,\c!height=450pt] + +%D These are handy too: + +\definepapersize [S33] [\c!width=300pt,\c!height=300pt] +\definepapersize [S44] [\c!width=400pt,\c!height=400pt] +\definepapersize [S55] [\c!width=500pt,\c!height=500pt] +\definepapersize [S66] [\c!width=600pt,\c!height=600pt] + +%D One may wonder if \TEX\ should be used for typesetting +%D \CDROM\ covers, but it does not hurt to have the paper size +%D ready. + +\definepapersize [CD] [\c!width=120mm,\c!height=120mm] + +%D The next series is for our English speaking friends who +%D decided to stick to non metric values. Thanks to Nelson +%D Beebe for completing the inch based list. + +\definepapersize [letter] [\c!width=8.5in,\c!height=11in] +\definepapersize [ledger] [\c!width=11in,\c!height=17in] +\definepapersize [tabloid] [\c!width=17in,\c!height=11in] + +\definepapersize [legal] [\c!width=8.5in,\c!height=14in] +\definepapersize [folio] [\c!width=8.5in,\c!height=13in] +\definepapersize [executive] [\c!width=7.25in,\c!height=10.5in] + +\definepapersize [A] [\c!width=8.5in,\c!height=11in] % 1 sheet +\definepapersize [B] [\c!width=11in,\c!height=17in] % 2 sheets +\definepapersize [C] [\c!width=17in,\c!height=22in] % 4 sheets + +%D The next set is for Tobias Burnus, who gave me the sizes. + +\definepapersize [envelope 9] [\c!width=8.88in,\c!height=3.88in] +\definepapersize [envelope 10] [\c!width=9.5in,\c!height=4.13in] +\definepapersize [envelope 11] [\c!width=10.38in,\c!height=4.5in] +\definepapersize [envelope 12] [\c!width=11.0in,\c!height=4.75in] +\definepapersize [envelope 14] [\c!width=11.5in,\c!height=5.0in] +\definepapersize [monarch] [\c!width=7.5in,\c!height=3.88in] +\definepapersize [check] [\c!width=8.58in,\c!height=3.88in] +\definepapersize [DL] [\c!width=110mm,\c!height=220mm] % [\c!width=220mm,\c!height=110mm] +\definepapersize [E4] [\c!width=280mm,\c!height=400mm] + +%D The next three sets are supplied by Taco: + +\definepapersize [RA0] [\c!width=860mm,\c!height=1220mm] +\definepapersize [RA1] [\c!width=610mm,\c!height=860mm] +\definepapersize [RA2] [\c!width=430mm,\c!height=610mm] +\definepapersize [RA3] [\c!width=305mm,\c!height=430mm] +\definepapersize [RA4] [\c!width=215mm,\c!height=305mm] + +%D ISO SRA (supplementary raw A) sizes: + +\definepapersize [SRA0] [\c!width=900mm,\c!height=1280mm] +\definepapersize [SRA1] [\c!width=640mm,\c!height=900mm] +\definepapersize [SRA2] [\c!width=450mm,\c!height=640mm] +\definepapersize [SRA3] [\c!width=320mm,\c!height=450mm] +\definepapersize [SRA4] [\c!width=225mm,\c!height=320mm] + +%D Swedish thesis formats: + +\definepapersize [G5] [\c!width=169mm,\c!height=239mm] +\definepapersize [E5] [\c!width=155mm,\c!height=220mm] + +%D Industry invention: + +\definepapersize [A3plus] [\c!width=329mm,\c!height=483mm] + +%D We can now default to a reasonable size. We match the print +%D paper size with the typeset paper size. This setting should +%D come after the first layout specification (already done). + +\setuppapersize + [A4][A4] + +%D A few goodies: + +\definepapersize + [oversized] + [ \c!width=\dimexpr\paperwidth +1.5cm\relax, + \c!height=\dimexpr\paperheight+1.5cm\relax] + +\definepapersize + [doublesized] + [ \c!width=\dimexpr \paperwidth \relax, + \c!height=\dimexpr2\paperheight\relax] + +\definepapersize + [doubleoversized] + [ \c!width=\dimexpr \paperheight+1.5cm\relax, + \c!height=\dimexpr2\paperwidth +1.5cm\relax] + +%D For orthogonality: + +\definepapersize + [undersized] + [ \c!width=\dimexpr\paperwidth -1.5cm\relax, + \c!height=\dimexpr\paperheight-1.5cm\relax] + +\definelayout + [\v!page] + [\c!backspace=\zeropoint, + \c!cutspace=\zeropoint, + \c!topspace=\zeropoint, + \c!bottomspace=\zeropoint, + \c!margin=\zeropoint, + \c!edge=\zeropoint, + \c!header=\zeropoint, + \c!footer=\zeropoint, + \c!top=\zeropoint, + \c!bottom=\zeropoint, + \c!leftmargin=\zeropoint, + \c!rightmargin=\zeropoint, + \c!leftedge=\zeropoint, + \c!rightedge=\zeropoint, + \c!textdistance=\zeropoint, + \c!width=\v!middle, + \c!height=\v!middle, + \c!lines=0, + \c!grid=\v!no] + +\definelayout + [\v!middle] + [\c!width=\v!middle, + \c!height=\v!middle] + +\protect \endinput diff --git a/tex/context/base/page-lay.tex b/tex/context/base/page-lay.tex deleted file mode 100644 index c8525643f..000000000 --- a/tex/context/base/page-lay.tex +++ /dev/null @@ -1,1429 +0,0 @@ -%D \module -%D [ file=page-lay, -%D version=2000.10.20, % copied from main-001 -%D title=\CONTEXT\ Page Macros, -%D subtitle=Layout Specification, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Layout Specification} - -%D This module is now etex dependent. - -% to be translated into english - -% hoofdhoogte wordt bij status=hoog niet aangepast op outer -% level, wel binnen bepaalde berekeningen - -%D Before you start wondering why some of the page related -%D modules skip upward or left in order to place elements, you -%D must realize that the reference point is the top left -%D corner of the main typesetting area. One reason for this -%D choice is that it suited some viewers that displayed page -%D areas. Another reason is that margins, edges and top and -%D bottom areas are kind of virtual, while the header, text -%D and footer areas normally determine the text flow. - -\unprotect - -%D First we get rid of the funny \TEX\ offset defaults of one -%D inch by setting them to zero. - -\voffset = 0pt % setting this to -1in let's go metapost crazy -\hoffset = 0pt % setting this to -1in let's go metapost crazy - -%D The dimensions related to layout areas are represented by -%D real dimensions. - -\newdimen\paperheight \paperheight = 297mm -\newdimen\paperwidth \paperwidth = 210mm - -\newdimen\printpaperheight \printpaperheight = \paperheight -\newdimen\printpaperwidth \printpaperwidth = \paperwidth - -\newdimen\makeupheight % calculated -\newdimen\makeupwidth % calculated - -\newdimen\textheight % calculated -\newdimen\textwidth % calculated - -\newdimen\topspace \topspace = 2cm -\newdimen\backspace \backspace = \topspace -\newdimen\cutspace \cutspace = 0pt -\newdimen\bottomspace \bottomspace = 0pt - -\newdimen\headerheight \headerheight = 2cm -\newdimen\footerheight \footerheight = \headerheight - -\newdimen\topoffset \topoffset = 0pt -\newdimen\backoffset \backoffset = \topoffset - -\newdimen\leftmarginwidth \leftmarginwidth = 3cm -\newdimen\rightmarginwidth \rightmarginwidth = \leftmarginwidth - -\newdimen\leftedgewidth \leftedgewidth = 3cm -\newdimen\rightedgewidth \rightedgewidth = \leftedgewidth - -\newdimen\topheight \topheight = 0cm -\newdimen\bottomheight \bottomheight = \topheight - -\newcount\layoutlines \layoutlines = 0 -\newcount\layoutcolumns \layoutcolumns = 0 -\newdimen\layoutcolumndistance \layoutcolumndistance = 0pt -\newdimen\layoutcolumnwidth \layoutcolumnwidth = 0pt - -%D We can save some tokens and fuzzy parameters by using a -%D symbolic name for the current set of layout parameters. - -\let\currentlayout\empty - -\def\layoutparameter#1% - {\csname\??ly\ifcsname - \??ly\currentlayout#1\endcsname\currentlayout - \fi#1\endcsname} - -\def\namedlayoutparameter#1#2% - {\csname\??ly\ifcsname\??ly #1#2\endcsname#1\else - \ifcsname\??ly\currentlayout#2\endcsname\currentlayout - \fi\fi#2\endcsname} - -%D Beause normal \TEX\ has at most 256 dimensions (of which a -%D substantial part is already in use), we provide a way to -%D generate a format with macro based alternatives. For a long -%D time, this used to be the default case. Beware: only fixed -%D dimensions can be used in calculations! By the way, the -%D gain in speed can hardly be called impressive and is roughly -%D 1 second on a 35 second run of 850 empty pages with a -%D couple of backgrounds only (which is far less than one -%D percent on a normal document). - -%D The next series of dimensions are complemented by left -%D and rights ones. - -\newdimen \margindistance -\newdimen \edgedistance -\newdimen \marginwidth -\newdimen \edgewidth - -%D Because a distance does not really makes sense when there -%D is no area, we use a zero distance in case there is no -%D area. - -\def\layoutdistance#1#2% - {\ifdim\zeropoint<#1\layoutparameter#2\else\zeropoint\fi} - -%D The horizontal distances are: - -\newdimen \leftedgedistance -\newdimen \rightedgedistance -\newdimen \leftmargindistance -\newdimen \rightmargindistance - -%D The vertical distances are: - -\newdimen \topdistance -\newdimen \headerdistance -\newdimen \footerdistance -\newdimen \bottomdistance - -%D We need to calculate the extra distances: - -\def\setlayoutdimensions - {\global\marginwidth \layoutparameter\c!margin - \global\edgewidth \layoutparameter\c!edge - \global\margindistance \layoutparameter\c!margindistance - \global\edgedistance \layoutparameter\c!edgedistance - \global\leftedgedistance \layoutdistance \leftedgewidth \c!leftedgedistance - \global\rightedgedistance \layoutdistance \rightedgewidth \c!rightedgedistance - \global\leftmargindistance \layoutdistance \leftmarginwidth \c!leftmargindistance - \global\rightmargindistance\layoutdistance \rightmarginwidth \c!rightmargindistance - \global\topdistance \layoutdistance \topheight \c!topdistance - \global\headerdistance \layoutdistance \headerheight \c!headerdistance - \global\footerdistance \layoutdistance \footerheight \c!footerdistance - \global\bottomdistance \layoutdistance \bottomheight \c!bottomdistance} - -\def\setlayoutdistances % local in \setreducedvsize - {\headerdistance\layoutdistance\headerheight\c!headerdistance - \footerdistance\layoutdistance\footerheight\c!footerdistance} - -% these are wrong in the running text, assumes some swapping, needs a cleanup - -\def\outermarginwidth {\rightorleftpageaction\rightmarginwidth \leftmarginwidth } -\def\innermarginwidth {\rightorleftpageaction\leftmarginwidth \rightmarginwidth} -\def\outermargindistance{\rightorleftpageaction\rightmargindistance\leftmargindistance } -\def\innermargindistance{\rightorleftpageaction\leftmargindistance \rightmargindistance} - -\def\outeredgewidth {\rightorleftpageaction\rightedgewidth \leftedgewidth } -\def\inneredgewidth {\rightorleftpageaction\leftedgewidth \rightedgewidth} -\def\outeredgedistance {\rightorleftpageaction\rightedgedistance\leftedgedistance } -\def\inneredgedistance {\rightorleftpageaction\leftedgedistance \rightedgedistance} - -\def\outerspacewidth {\rightorleftpageaction\cutspace\backspace} -\def\innerspacewidth {\rightorleftpageaction\backspace\cutspace} - -\newtoks\extralayoutcalculations \def\calculatelayoutextras{\the\extralayoutcalculations} - -% \appendtoks -% non etex calculations used to go here -% \to \extralayoutcalculations - -\newtoks\everyswapmargins % watch the order ! - -\appendtoks - \swapdimens\leftmargindistance\rightmargindistance - \swapdimens\leftedgedistance \rightedgedistance - \swapdimens\leftmarginwidth \rightmarginwidth - \swapdimens\leftedgewidth \rightedgewidth -\to \everyswapmargins - -\appendtoks - \swapmacros\leftmargintotal \rightmargintotal - \swapmacros\leftedgetotal \rightedgetotal - \swapmacros\leftsidetotal \rightsidetotal - \swapmacros\leftcombitotal \rightcombitotal - \swapmacros\innermargintotal\outermargintotal - \swapmacros\inneredgetotal \outeredgetotal - \swapmacros\innercombitotal \outercombitotal - \swapmacros\innersidetotal \outersidetotal -\to \everyswapmargins - -%D \macros -%D {definepapersize} -%D -%D Before we start calculating layout dimensions, we will -%D first take care of paper sizes. The first argument can be -%D either an assignment (for defaults) or an identifier, in -%D which case the second argument is an assignment. -%D -%D \showsetup{definepapersize} - -\def\definepapersize - {\dodoubleempty\dodefinepapersize} - -\def\definepapersize - {\dotripleempty\dodefinepapersize} - -\def\dodefinepapersize[#1][#2][#3]% - {\ifsecondargument - \doifsomething{#1} % to be sure - {\doifassignmentelse{#2} - {\getparameters - [\??pp#1] % geen \c!scale, scheelt hash ruimte - [\c!width=\@@ppwidth,\c!height=\@@ppheight,\c!offset=\@@ppoffset,#2]} - {\setvalue{\??pp:1:#1}{#2}% - \setvalue{\??pp:2:#1}{#3}}}% - \else - \getparameters[\??pp][#1]% - \setuppapersize % hm. this will freeze ! - \fi} - -%D For the moment we need to fake this macro. - -\ifx\setuppapersize\undefined - \let\setuppapersize\relax -\fi - -%D We set the defaults to the dimensions of an A4 sheet of -%D paper. - -\definepapersize - [\c!width=210mm,\c!height=297mm,\c!offset=\!!zeropoint] - -%D Yet undocumented, let's see if it gets noticed. -%D -%D \starttyping -%D \definepapersize[main] [A4] [A4] -%D \definepapersize[extra][A4,landscape][A4,landscape] -%D -%D \starttext -%D \setuppapersize[main] -%D Page 1. \page -%D Page 2. \page -%D \setuppapersize[extra] -%D Page 2 \page -%D \setuppapersize[main] -%D Page 3. \page -%D Page 4. \page -%D \adaptpapersize[extra] -%D Page 5. \page -%D Page 6. \page -%D \stoptext -%D \stoptyping - -%D \macros -%D {setuppaper,setuppapersize} -%D -%D When setting up the papersize on which to typeset and -%D print, we can also determine some more characteristics. -%D -%D \showsetup{setuppapersize} -%D -%D We keep track of these features with the following -%D variables. - -\chardef\papermirror =0 \chardef\printmirror =0 -\chardef\paperorientation=0 \chardef\printorientation=0 % beware: later no chardef -\chardef\paperreverse =0 \chardef\printreverse =0 -\chardef\paperlandscape =0 \chardef\printlandscape =0 - -\let\papersize\empty \let\printpapersize\empty - -\def\paperscale{1} \newif\ifnegateprintbox - -\def\setuppaper[#1]% - {\getparameters[\??pp][\c!paper=,\c!page=,#1]% - \edef\@@ppxy{\the\numexpr\@@ppnx*\@@ppny\relax}% - \doifelsenothing\@@pppage - {\doifelsenothing\@@pppaper - {} % {\setuppapersize} % added, removed, no need for, too tricky, mag-01 (fixed by freezing pp's) - {\dodosetuppapersize[\papersize][\@@pppaper]}} - {\doifelsenothing\@@pppaper - {\dodosetuppapersize[\@@pppage][\printpapersize]} - {\dodosetuppapersize[\@@pppage][\@@pppaper]}}} - -\def\setuppapersize - {\dodoubleempty\dosetuppapersize} - -\def\dosetuppapersize[#1][#2]% - {\doifassignmentelse{#1} - {\setuppaper[#1]} - {\doifelsenothing{#2} - {\expanded{\dodosetuppapersize - [\executeifdefined{\??pp:1:#1}{#1}]% - [\executeifdefined{\??pp:2:#1}{}]}} - {\doifassignmentelse{#2} - {\getparameters[\??pp\executeifdefined{\??pp:1:#1}{#1}][#2]} - {\expanded{\dodosetuppapersize - [\executeifdefined{\??pp:1:#1}{#1}]% - [\executeifdefined{\??pp:1:#2}{#2}]}}}}} - -\let\reinstatepapersize\relax - -\def\adaptpapersize - {\global\let\reinstatepapersize\restorepapersize - \setuppapersize} - -\appendtoks - \reinstatepapersize - \global\let\reinstatepapersize\relax -\to \everyaftershipout - -\def\dodosetuppapersize[#1][#2]% - {\ifsecondargument - \expanded{\dododosetuppapersize[#1][#2]}% - \calculatehsizes - \calculatevsizes - \recalculatelogos - \recalculatebackgrounds - \recalculatelayout - \else\iffirstargument - \setuppapersize[#1][#2]% - \else\ifx\papersize\undefined\else - \restorepapersize - \fi\fi\fi} - -% dimen freeze is a bit tricky, but catches local redundant calls -% with values where e.g width is defined in terms of \paperwidth - -\def\dododosetuppapersize[#1][#2]% - {\xdef\restorepapersize{\noexpand\setuppapersize[#1][#2]}% - \dosetuppaperorientation{#1}\paperlandscape\paperorientation\paperreverse\papermirror - \dosetuppaperorientation{#2}\printlandscape\printorientation\printreverse\printmirror - \def\docommand##1% - {\doifsomething{##1}{\doifdefined{\??pp##1\c!width} - {\global\paperwidth \getvalue{\??pp##1\c!width}% - \global\paperheight\getvalue{\??pp##1\c!height}% -\ifinpagebody - \setevalue{\??pp##1\c!height}{\the\paperheight}% - \setevalue{\??pp##1\c!width }{\the\paperwidth }% -\fi - \calculatepaperoffsets{##1}% - \xdef\papersize{##1}}}}% - \processcommacommand[#1]\docommand - \doifdefinedelse{\??pp#1\c!scale} - {\edef\paperscale{\getvalue{\??pp#1\c!scale}}} - {\edef\paperscale{1}}% - \def\docommand##1% - {\doifsomething{##1}{\doifdefined{\??pp##1\c!width} - {\global\printpaperwidth \getvalue{\??pp##1\c!width}% - \global\printpaperheight\getvalue{\??pp##1\c!height}% -\ifinpagebody - \setevalue{\??pp##1\c!height}{\the\printpaperheight}% - \setevalue{\??pp##1\c!width }{\the\printpaperwidth}% -\fi - \xdef\printpapersize{##1}}}}% - \processcommacommand[#2]\docommand - \global\setdimentoatleast\paperwidth \onepoint - \global\setdimentoatleast\paperheight \onepoint - \global\setdimentoatleast\printpaperwidth \onepoint - \global\setdimentoatleast\printpaperheight\onepoint - \ifcase\paperlandscape\else - \doglobal\swapdimens\paperwidth\paperheight - \fi - \ifcase\printlandscape\else - \doglobal\swapdimens\printpaperwidth\printpaperheight - \fi - % this check can be confusing, so we've added the possibility - % to bypass this test: \setuppapersize[option=fit] - \doif\@@ppoption\v!max % \v!fit is - {\bgroup - % we need to pre-swap else we get the wrong paper size - \ifcase\paperorientation\else - \doifinset\paperorientation{90,270}{\swapdimens\paperwidth\paperheight}% - \fi - \ifcase\printorientation\else - \doifinset\printorientation{90,270}{\swapdimens\printpaperwidth\printpaperheight}% - \fi - \ifdim\paperheight>\printpaperheight - \global\printpaperheight\paperheight - \writestatus\m!systems{print height forced to paper height}% - \fi - \ifdim\paperwidth>\printpaperwidth - \global\printpaperwidth\paperwidth - \writestatus\m!systems{print width forced to paper width}% - \fi - \egroup}} - -\def\dosetuppaperorientation#1#2#3#4#5% - {\global\chardef#2\zerocount - \global\chardef#5\zerocount - \globallet#3\!!zerocount - \globallet#4\!!zerocount - \global\negateprintboxfalse - \processallactionsinset - [#1] - [ \v!landscape=>\global\chardef#2\plusone, - \v!mirrored=>\global\chardef#5\plusone, - \v!rotated=>\gdef#3{90}\gdef#4{270}, - \v!negative=>\global\negateprintboxtrue, - 90=>\gdef#3{90}\gdef#4{270}, - 180=>\gdef#3{180}\gdef#4{0}, - 270=>\gdef#3{270}\gdef#4{90}]} - -\ifx\calculatepaperoffsets\undefined - - \def\calculatepaperoffsets#1% - {\scratchdimen\getvalue{\??pp#1\c!offset}% - \global\advance\paperwidth -2\scratchdimen - \global\advance\paperheight-2\scratchdimen} - -\fi - -\let\restorepapersize\relax - -\def\checkforems[#1]% - {\def\docommand##1% - {\beforesplitstring##1\at em\to\asciia - \doifnot\asciia{##1} - {\aftersplitstring\asciia\at=\to\asciia - \doifsomething\asciia - {\showmessage\m!systems{10}{##1}}}}% - \processcommalist[#1]\docommand} - -\ifx\setups\undefined \def\setups[#1]{\setdefaultpenalties} \fi - -% \newtoks \everybeforelayout \relax -% \newtoks \everyafterlayout \relax - -\def\recalculatelayout - {\doifsomething{\layoutparameter\c!page\layoutparameter\c!paper} - {\expanded{\dododosetuppapersize[\layoutparameter\c!page][\layoutparameter\c!paper]}}% - \dorecalculatelayout} - -\def\dorecalculatelayout - {%\the\everybeforelayout - \setups[\layoutparameter\c!preset]% - \global\leftmarginwidth \layoutparameter\c!leftmargin - \global\rightmarginwidth\layoutparameter\c!rightmargin - \global\leftedgewidth \layoutparameter\c!leftedge - \global\rightedgewidth \layoutparameter\c!rightedge - \global\headerheight \layoutparameter\c!header - \global\footerheight \layoutparameter\c!footer - \global\bottomheight \layoutparameter\c!bottom - \global\topheight \layoutparameter\c!top - \global\backspace \layoutparameter\c!backspace - \global\topspace \layoutparameter\c!topspace - \setlayoutdimensions % the rest of the `dimensions' - \doifelse\@@lygrid\v!yes\gridsnappingtrue\gridsnappingfalse - \ifgridsnapping - \setsystemmode\v!grid - \else - \resetsystemmode\v!grid - \fi - \setups[\layoutparameter\c!setups]% depends on gridsnapping ! - \simplesetupwhitespace - \simplesetupblank - \global\cutspace\layoutparameter\c!cutspace - \relax - \doifelse{\layoutparameter\c!width}\v!middle - {\ifdim\cutspace=\zeropoint - \global\cutspace\backspace - \fi - \global\makeupwidth\dimexpr\paperwidth-\backspace-\cutspace\relax} - {\doifelse{\layoutparameter\c!width}\v!fit - {\ifdim\cutspace=\zeropoint - \global\cutspace\backspace - \fi - \global\makeupwidth\dimexpr\paperwidth-\cutspace\relax - \scratchdimen\dimexpr\backspace - -\leftedgewidth -\leftedgedistance - -\leftmarginwidth-\leftmargindistance\relax - \ifdim\scratchdimen<\zeropoint - \scratchdimen\zeropoint - \fi - \global\advance\makeupwidth\dimexpr - -\rightmargindistance-\rightmarginwidth - -\rightedgedistance -\rightedgewidth - -\scratchdimen\relax} - {\global\makeupwidth\layoutparameter\c!width\relax - \ifdim\cutspace=\zeropoint - \global\cutspace\dimexpr\paperwidth-\makeupwidth-\backspace\relax - % \else - % A kind of inconsistent specification, but used - % in for instance s-pre-19.tex; the cutspace is - % used only for determining some kind of right - % margin; don't use this in doublesided mode - \fi}}% - \scratchdimen\layoutparameter\c!bottomspace\relax - %\ifdim\scratchdimen=\zeropoint - % \scratchdimen\topspace - %\fi - \global\bottomspace\layoutparameter\c!bottomspace\relax - \global\layoutlines0\number\layoutparameter\c!lines\relax % may be empty - \ifcase\layoutlines - \doifelse{\layoutparameter\c!height}\v!middle - {\ifdim\bottomspace=\zeropoint - \global\bottomspace\topspace - \fi - \global\makeupheight\dimexpr\paperheight-\topspace-\bottomspace\relax} - {\doifelse{\layoutparameter\c!height}\v!fit - {\ifdim\bottomspace=\zeropoint - \global\bottomspace\topspace - \fi - \global\makeupheight\dimexpr\paperheight-\bottomspace\relax - \scratchdimen\dimexpr\topspace-\topheight-\topdistance\relax - \ifdim\scratchdimen<\zeropoint - \scratchdimen\zeropoint - \fi - \global\advance\makeupheight\dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax} - {\global\makeupheight\layoutparameter\c!height\relax - \ifdim\bottomspace=\zeropoint - \global\bottomspace\dimexpr\paperheight-\makeupheight-\topspace\relax - \else - % inconsistent specification - \fi}}% - \else - % beware, when the bodyfont changes (switched) this will change as well; implementing - % a global lineheight is tricky: should we take the bodyfont interlinespace or the one set - % independent of the bodyfont (before or after a layout spec); way too fuzzy, so we - % stick to the current method (after a night of experimenting ...2003/10/13) - \global\makeupheight\dimexpr - \layoutparameter\c!lines\lineheight-\strutheight+\topskip+ - \headerdistance+\headerheight+\footerdistance+\footerheight\relax - \fi - \backoffset\layoutparameter\c!horoffset - \topoffset \layoutparameter\c!veroffset - \global\setdimentoatleast\makeupwidth\onepoint - \global\setdimentoatleast\makeupheight \onepoint - % \checkcurrentlayout % here ? - % \the\everyafterlayout - \calculatelayoutextras - \calculatehsizes - \calculatevsizes - \calculatepseudocolumns - \checkgridsnapping - \recalculatelogos - \recalculatebackgrounds} - -\def\calculatepseudocolumns - {\global\layoutcolumns\layoutparameter\c!columns - \global\layoutcolumndistance\layoutparameter\c!columndistance - \global\layoutcolumnwidth\dimexpr\makeupwidth-\layoutcolumns\layoutcolumndistance+\layoutcolumndistance\relax - \global\divide\layoutcolumnwidth\layoutcolumns - \dorecurse\layoutcolumns - {\setxvalue{\??ly:c:\recurselevel}% - {\the\numexpr\recurselevel-\plusone\relax\dimexpr\layoutcolumnwidth+\layoutcolumndistance\relax}}} - -%\dorecurse\layoutcolumns -% {\setxvalue{\??ly:c:\recurselevel}{\the\dimexpr -% (\numexpr(\recurselevel-1)\dimexpr(\layoutcolumnwidth+\layoutcolumndistance))}} - -\def\layoutcolumnoffset#1% - {\executeifdefined{\??ly:c:#1}\!!zeropoint} - -\def\checklayout - {\ifdim\makeupheight=\layoutlines\lineheight \else \recalculatelayout \fi} - -\appendtoks \checklayout \to \everystarttext - -% document: -% -% \setuplayout[odd][state=stop] \setuplayout[even][state=stop] \setuplayout[page] -% -% \startstandardmakeup[page=blank] ... \stopstandardmakeup - -\def\changetolayout#1% - {%\writestatus\m!layouts{changing to layout #1}% - \xdef\currentlayout{#1}\recalculatelayout} - -\def\checkcurrentoddlayout - {\ifcsname\??ly\v!odd\c!state\endcsname - \doifvalue{\??ly\v!odd\c!state}\v!start{\changetolayout\v!odd}% - \fi} - -\def\checkcurrentevenlayout - {\ifcsname\??ly\v!even\c!state\endcsname - \doifvalue{\??ly\v!even\c!state}\v!start{\changetolayout\v!even}% - \fi} - -\ifx\lastpage\undefined \def\lastpage{1} \fi - -\def\reverserealfolio - {\ifnum\lastpage>\plusone - \ifnum\lastpage=\realfolio - \v!last - \else\ifnum\plusone=\realfolio - \v!first - \else - \the\numexpr\realfolio-\lastpage\relax - \fi\fi - \else - \!!zerocount - \fi} - -\def\checkcurrentlayout % public and used in naw, so keep this name - {\ifcsname\??ly\realfolio\c!state\endcsname - \doifvalue{\??ly\realfolio\c!state}\v!start{\changetolayout\realfolio}% - \else\ifcsname\??ly\reverserealfolio\c!state\endcsname - \doifvalue{\??ly\reverserealfolio\c!state}\v!start{\changetolayout\reverserealfolio}% - \else\ifcsname\??ly\v!current\c!state\endcsname - \changetolayout\v!current % no start test ? - \else - \doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout - \fi\fi\fi} - -% testcase -% -% \setuppagenumbering[alternative=doublesided] -% -% \setuplayout [width=11cm] -% \definelayout [odd] [backspace=1cm] -% \definelayout [even] [backspace=4cm] -% \definelayout [5] [backspace=5cm] -% \definelayout [6] [backspace=5cm] -% \definelayout [-2] [backspace=0cm,cutspace=0cm] -% \definelayout [last] [backspace=0cm,cutspace=0cm] -% -% \checkcurrentlayout \showframe -% -% \starttext -% \dorecurse{20} {\input knuth \endgraf \input tufte \endgraf} -% \stoptext - -%appendtoks \checkcurrentlayout \to \everyaftershipout % no -\appendtoks \checkcurrentlayout \to \everystarttext - -\appendtoks - \dochecknextlayout -\to \everyaftershipout - -% \def\dochecknextlayout -% {\ifx\currentlayout\v!current -% % prevent redundant calculations -% \else -% \globallet\currentlayout\empty -% \global\letbeundefined{\??ly\v!current\c!state}% -% \checkcurrentlayout -% \fi} -% -% this breaks after a standardmakeup - -\def\dochecknextlayout{\checkcurrentlayout} - -\newif\ifdoublesidedprint - -\def\presetcenterpagebox % in \setuplayout !!!!!!!!!!!!!!!! - {\doublesidedprintfalse - \ExpandFirstAfter\processallactionsinset - [\@@lylocation] - [ \v!middle=>{\setuppapersize[\c!left=\hss,\c!right=\hss,\c!top=\vss,\c!bottom=\vss]}, - \v!left=>{\setuppapersize[\c!left=,\c!right=\hss]}, - \v!right=>{\setuppapersize[\c!left=\hss,\c!right=]}, - \v!bottom=>{\setuppapersize[\c!top=\vss,\c!bottom=]}, - \v!top=>{\setuppapersize[\c!top=,\c!bottom=\vss]},% - \v!doublesided=>\doublesidedprinttrue, - \v!singlesided=>\doublesidedprintfalse]} - -\def\definelayout - {\dodoubleargument\dodefinelayout} - -\def\dodefinelayout[#1][#2]% - {\getparameters[\??ly#1][\c!state=\v!start,#2]} - -\def\dodosetuplayout[#1][#2]% - {\ConvertToConstant\doifnot{#2}\v!reset % #2 ? - {\getparameters[\??ly#1][#2]% - \checkforems[#2]}} - -% global needed for non-doublesided standardmakeup - -\def\dosetuplayout[#1][#2]% - {\globallet\currentlayout\empty % new, global - \ifsecondargument - \dodosetuplayout[#1][#2]% - \else\iffirstargument - \doifassignmentelse{#1} - {\dodosetuplayout[][#1]} - {\doifnot{#1}\v!reset{\xdef\currentlayout{#1}}}% new, global - \fi\fi - \recalculatelayout - \checkcurrentlayout % here ? - \presetcenterpagebox} - -\def\setuplayout - {\dodoubleempty\dosetuplayout} - -\let\@@zaheight=\!!zeropoint - -\def\dopushpagedimensions - {\xdef\oldtextheight {\the\textheight }% - \xdef\oldfooterheight{\the\footerheight}% - \global\let\@@zaheight\@@zaheight} - -\def\dopoppagedimensions - {\global\textheight \oldtextheight - \global\footerheight\oldfooterheight - \recalculatelayout - \global\let\pushpagedimensions\dopushpagedimensions - \global\let\poppagedimensions\relax} - -\let\poppagedimensions = \relax -\let\pushpagedimensions = \dopushpagedimensions - -% Elke \csname ... \endcsname wordt ook aangemaakt, dus ook -% in een test met \doifdefined. Bij veel bladzijden kan dit -% te veel macro's kosten. Vandaar de set \adaptedpages. Het -% kost tijd, maar scheelt macro's. - -\let\adaptedpages\empty - -\def\adaptpagedimensions - {\ifx\adaptedpages\empty\else - \rawdoifinsetelse\realfolio\adaptedpages - {\getvalue{\??za\realfolio}% - \letbeundefined{\??za\realfolio}} - \donothing - \fi} - -\def\checkpagedimensions - {\poppagedimensions - \adaptpagedimensions} - -\def\reportpagedimensions - {\ifx\poppagedimensions\relax \else - \space\the\dimexpr\@@zaheight\relax\space-\space - \fi - \realfolio} - -\def\dodoadaptlayout[#1]% - {\getparameters[\??za][\c!height=,\c!lines=0,#1]% - \pushpagedimensions - \ifcase\@@zalines\relax - \showmessage\m!layouts1{\@@zaheight,\realfolio}% - \else - \showmessage\m!layouts1{\@@zalines\space\v!lines,\realfolio}% - \def\@@zaheight{\@@zalines\openlineheight}% - \fi - \doifelse\@@zaheight\v!max - {\balancedimensions\textheight\footerheight\footerheight} - {\balancedimensions\textheight\footerheight\@@zaheight}% - \ifdim\footerheight<\zeropoint - \global\advance\textheight \footerheight - \global\footerheight\zeropoint - \global\xdef\@@zaheight{\layoutparameter\c!footer\space(\v!max)}% - \fi - \setvsize - \global\pagegoal\vsize % nog corrigeren voor insertions ? - \recalculatelogos - \recalculatebackgrounds - \global\let\pushpagedimensions\relax - \global\let\poppagedimensions\dopoppagedimensions} - -\def\doadaptlayout[#1][#2]% - {\doifelsenothing{#2} - {\dodoadaptlayout[#1]} - {\def\docommand##1% - {\addtocommalist{##1}\adaptedpages - \setgvalue{\??za##1}{\dodoadaptlayout[#2]}}% - \processcommalist[#1]\docommand - \adaptpagedimensions}} - -\def\adaptlayout - {\dodoubleempty\doadaptlayout} - -% describe interface - -%D Centering the paper area on the print area is determined -%D by the \type {top}, \type {bottom}, \type {left} and \type -%D {right} parameters. - -\def\centerpagebox#1% - {\printpaperwidth \paperscale\printpaperwidth - \printpaperheight\paperscale\printpaperheight - \setbox#1\vbox to \printpaperheight - {\@@pptop - \hbox to \printpaperwidth - {\ifdoublesidedprint - \doifbothsides - {\@@ppleft \box#1\@@ppright} - {\@@ppleft \box#1\@@ppright} - {\@@ppright\box#1\@@ppleft }% - \else - \@@ppleft \box#1\@@ppright - \fi}% - \par - \@@ppbottom}} - -\def\offsetprintbox#1% - {\ifdim\topoffset=\zeropoint % \relax - \ifdim\backoffset=\zeropoint - \donefalse - \else - \donetrue - \fi - \else - \donetrue - \fi - \ifdone - \edef\next{\wd#1\the\wd#1\ht#1\the\ht#1\dp#1\the\dp#1}% - \setbox#1\vbox - {%\forgetall - \offinterlineskip - \vskip\topoffset - \doifbothsides{\hskip\backoffset}{\hskip\backoffset}{\hskip-\backoffset}% - \box#1}% - \next - \fi} - -\def\replicatepagebox#1% - {\ifnum\@@lynx>\plusone - \donetrue - \else\ifnum\@@lyny>\plusone - \donetrue - \else - \donefalse - \fi\fi - \ifdone - \setbox#1\vbox - {%\forgetall - \offinterlineskip - \dorecurse\@@lyny - {\hbox{\dorecurse\@@lynx{\copy#1\hskip\@@lydx}\unskip}% - \vskip\@@lydy} - \unskip}% - \fi} - -\def\orientpagebodybox#1#2#3% - {\ifnum#2#3>\zerocount - \setbox#1\vbox - {\edef\somerotation{\ifdoublesided\ifodd\realpageno#2\else#3\fi\else#2\fi}% - \dorotatebox\somerotation\hbox{\box#1}}% - \fi} - -\def\orientpaperbox#1% - {\orientpagebodybox{#1}\paperorientation\paperreverse} - -\def\orientprintbox#1% - {\orientpagebodybox{#1}\printorientation\printreverse} - -\def\mirrorpagebodybox#1#2% - {\ifcase#2\or - \setbox#1\vbox - {\domirrorbox\vbox{\box#1}}% - \fi} - -\def\mirrorpaperbox#1% - {\mirrorpagebodybox{#1}\papermirror} - -\def\mirrorprintbox#1% - {\mirrorpagebodybox{#1}\printmirror} - -\def\scalepagebox#1% - {\ifdim\@@lyscale\points=\onepoint \else - \setbox#1\vbox - {\scale[\c!sx=\@@lyscale,\c!sy=\@@lyscale]{\box#1}}% - \paperwidth\@@lyscale\paperwidth - \paperheight \@@lyscale\paperheight - \fi} - -\def\negateprintbox#1% - {\ifnegateprintbox - \negatecolorbox{#1}% - \fi} - -\def\pagecutmarksymbol {\the\realpageno} -\def\pagecutmarklength {.5cm} -\let\pagecutmarktoptext \empty -\let\pagecutmarkbottomtext \empty - -\def\extrapagecutmarkbottomtext - {\rlap{\jobname}\hfill\currentdate\space-\space\currenttime\hfill\llap{\realfolio}} - -\def\makepagecutbox % #1 - {\let\cutmarksymbol \pagecutmarksymbol - \let\cutmarklength \pagecutmarklength - \let\cutmarktoptext \pagecutmarktoptext - \let\cutmarkbottomtext\pagecutmarkbottomtext - \makecutbox} - -\setvalue{\??ly:n:\c!marking:\v!on}% - {\makepagecutbox} - -\setvalue{\??ly:n:\c!marking:\v!page}% only at outer when nx/ny > 0 - {\makepagecutbox} - -\setvalue{\??ly:n:\c!marking:\v!empty}% - {\let\pagecutmarksymbol\empty - \let\pagecutmarktoptext\empty - \let\pagecutmarkbottomtext\empty - \makepagecutbox} - -\setvalue{\??ly:n:\c!marking:\v!text}% - {\let\pagecutmarksymbol\empty - \let\pagecutmarkbottomtext\extrapagecutmarkbottomtext - \makepagecutbox} - -\setvalue{\??ly:c:\c!marking:\v!color}% - {\doaddpagecolormarks\colormarkbox} - -\setvalue{\??ly:c:\c!marking:\v!screen}% - {\doaddpagecolormarks\rastermarkbox} - -\def\addpagecutmarks % #1 - {\executeifdefined{\??ly:n:\c!marking:\@@lymarking}\gobbleoneargument} - -\def\addpagecolormarks % #1 - {\executeifdefined{\??ly:c:\c!marking:\@@lymarking}\gobbleoneargument} - -\def\doaddpagecolormarks#1#2% - {\makepagecutbox{#2}% - \ifnum\horizontalcutmarks>2 \chardef\colormarkoffset4 \fi - \ifnum\verticalcutmarks >2 \chardef\colormarkoffset4 \fi - #1{#2}} - -% NOG EENS NAGAAN WANNEER NU GLOBAL EN WANNEER NIET - -\ifx\doifelselayoutsomeline\undefined % defined in page-txt - \let\doifelselayoutsomeline\secondofthreearguments -\fi - -\def\calculatevsizes % global needed in \recalculatelayoutregel - {\redoglobal\textheight\makeupheight - \doifelselayoutsomeline \v!header - {\redoglobal\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}% - \donothing - \doifelselayoutsomeline \v!footer - {\redoglobal\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}% - \donothing - \ifzeropt\headerheight - \resetsystemmode\v!header - \else - \setsystemmode\v!header - \fi - \ifzeropt\footerheight - \resetsystemmode\v!footer - \else - \setsystemmode\v!footer - \fi - \resetglobal - \setvsize} - -\def\calculatereducedvsizes - {\textheight\makeupheight - \doifelselayoutsomeline \v!header - {\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}% - {\headerheight\zeropoint - \setlayoutdistances}% - \doifelselayoutsomeline \v!footer - {\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}% - {\footerheight\zeropoint - \setlayoutdistances}} - -\newdimen\innermakeupwidth % special purpose -\newdimen\innermakeupmargin % special purpose - -\chardef\innermakeupcompensation\plusone - -\def\compensatedinnermakeupmargin - {\dimexpr\ifnum\innermakeupcompensation=\plusone+\innermakeupmargin\else\zeropoint\fi\relax} - -\def\freezetextwidth % \makeupwidth may be set to \textwidth - {\textwidth\makeupwidth % which is a tricky but valid value - \doifsomething{\layoutparameter\c!textwidth} - {\textwidth\layoutparameter\c!textwidth}% % local - \global\innermakeupwidth\textwidth - \doifelsenothing{\layoutparameter\c!textmargin} - {\global\innermakeupmargin\zeropoint} - {\global\innermakeupmargin\layoutparameter\c!textmargin}% - \global\advance\innermakeupwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax - \advance\textwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax} % local - -\def\calculatehsizes - {\freezetextwidth - \sethsize} - -% De onderstaande macro voert commando's uit, afhankelijk van -% het karakter van het paginanummer. -% -% \doifoddpageelse{then-commando}{else-commando} - -%D When we start at an even page, we need to swap the layout -%D differently. We cannot adapt the real page number, since -%D it is used in cross referencing. The next switch is set -%D when we start at an even page. - -\newif\ifshiftedrealpageno - -% \def\doifoddpageelse#1#2% -% {\ifshiftedrealpageno -% \ifodd\realpageno#2\else#1\fi -% \else -% \ifodd\realpageno#1\else#2\fi -% \fi} - -\def\doifoddpageelse - {\ifshiftedrealpageno - \ifodd\realpageno - \@EAEAEA\secondoftwoarguments - \else - \@EAEAEA\firstoftwoarguments - \fi - \else - \ifodd\realpageno - \@EAEAEA\firstoftwoarguments - \else - \@EAEAEA\secondoftwoarguments - \fi - \fi} - -\let\doifonevenpaginaelse\doifoddpageelse - -% what are those \relax'es doing there? - -% \def\doifbothsidesoverruled#1#2#3% -% {\ifdoublesided -% \doifoddpageelse{#2}{#3}\relax -% \else -% #1\relax -% \fi} - -% \def\doifbothsides#1#2#3% -% {\ifdoublesided -% \ifsinglesided -% #1\relax -% \else -% \doifoddpageelse{#2}{#3}\relax -% \fi -% \else -% #1\relax -% \fi} - -\def\redoifoddpageelse#1{\doifoddpageelse} - -\def\doifbothsidesoverruled - {\ifdoublesided - \@EA\redoifoddpageelse - \else - \@EA\firstofthreearguments - \fi} - -\def\doifbothsides - {\ifdoublesided - \ifsinglesided - \@EAEAEA\firstofthreearguments - \else - \@EAEAEA\redoifoddpageelse - \fi - \else - \@EA\firstofthreearguments - \fi} - -\newdimen\texthoffset - -\def\settexthoffset - {\doifbothsides - {\texthoffset\backspace} - {\texthoffset\backspace} - {\texthoffset\dimexpr\paperwidth-\backspace-\makeupwidth\relax}} - -\def\goleftonpage - {\hskip-\dimexpr\leftmargindistance+\leftmarginwidth+\leftedgedistance+\leftedgewidth\relax} - -\def\doifmarginswapelse#1#2% - {\doifbothsides{#1}{#1}{#2}} - -\def\swapmargins - {\doifmarginswapelse\relax\doswapmargins} - -\def\doswapmargins - {\let\swapmargins \relax % to prevent local swapping - \let\doswapmargins\relax % to prevent local swapping - \the\everyswapmargins} - -\def\rightorleftpageaction - {\ifdoublesided - \ifsinglesided - \@EAEAEA\firstoftwoarguments - \else - \@EAEAEA\doifoddpageelse - \fi - \else - \@EA\firstoftwoarguments - \fi} - -\def\outermarginwidth {\rightorleftpageaction\rightmarginwidth \leftmarginwidth } -\def\innermarginwidth {\rightorleftpageaction\leftmarginwidth \rightmarginwidth} -\def\outermargindistance{\rightorleftpageaction\rightmargindistance\leftmargindistance } -\def\innermargindistance{\rightorleftpageaction\leftmargindistance \rightmargindistance} - -\def\outeredgewidth {\rightorleftpageaction\rightedgewidth \leftedgewidth } -\def\inneredgewidth {\rightorleftpageaction\leftedgewidth \rightedgewidth} -\def\outeredgedistance {\rightorleftpageaction\rightedgedistance\leftedgedistance } -\def\inneredgedistance {\rightorleftpageaction\leftedgedistance \rightedgedistance} - -\def\outerspacewidth {\rightorleftpageaction\cutspace \backspace } -\def\innerspacewidth {\rightorleftpageaction\backspace\cutspace} - -\def\leftmargintotal {\dimexpr\leftmarginwidth +\leftmargindistance \relax} -\def\rightmargintotal {\dimexpr\rightmarginwidth+\rightmargindistance\relax} -\def\leftedgetotal {\dimexpr\leftedgewidth +\leftedgedistance \relax} -\def\rightedgetotal {\dimexpr\rightedgewidth +\rightedgedistance \relax} - -\def\leftsidetotal {\dimexpr\leftmarginwidth +\leftedgetotal \relax} -\def\rightsidetotal {\dimexpr\rightmarginwidth+\rightedgetotal\relax} -\def\leftcombitotal {\dimexpr\leftmargintotal +\leftedgetotal \relax} -\def\rightcombitotal {\dimexpr\rightmargintotal+\rightedgetotal\relax} - -\def\innermargintotal {\dimexpr\innermarginwidth+\innermargindistance\relax} -\def\outermargintotal {\dimexpr\outermarginwidth+\outermargindistance\relax} -\def\inneredgetotal {\dimexpr\inneredgewidth +\inneredgedistance \relax} -\def\outeredgetotal {\dimexpr\outeredgewidth +\outeredgedistance \relax} - -\def\innercombitotal {\dimexpr\innermargintotal+\inneredgetotal\relax} -\def\outercombitotal {\dimexpr\outermargintotal+\outeredgetotal\relax} -\def\innersidetotal {\dimexpr\innermarginwidth+\inneredgetotal\relax} -\def\outersidetotal {\dimexpr\outermarginwidth+\outeredgetotal\relax} - -%D \macros -%D {startlocallayout} -%D -%D These macros should be used with care. They permit local -%D layouts (as used in fitting pages, see \type {page-app.tex}). - -%D This is kind of obsolete now that we have \type -%D {\definelayout}, so this hack will disappear in future -%D versions. - -\def\startlocallayout - {\globalpushmacro\restorepapersize - \globalpushmacro\currentlayout} - -\def\stoplocallayout - {\globalpopmacro\currentlayout - \globalpopmacro\restorepapersize - \restorepapersize - \setuplayout} - -%D \macros -%D {showprint, showframe, showlayout, showsetups} -%D -%D We predefine a couple of tracing macros. -%D -%D \showsetup{showprint} -%D \showsetup{showframe} -%D \showsetup{showlayout} -%D \showsetup{showsetups} -%D %showsetup{showmargins} - -\fetchruntimecommand \showprint {page-run} -\fetchruntimecommand \showframe {page-run} -\fetchruntimecommand \showlayout {page-run} -\fetchruntimecommand \showsetups {page-run} -\fetchruntimecommand \showmargins {page-run} - -%D The default dimensions are quite old and will not change. -%D The funny fractions were introduced when we went from fixed -%D dimensions to relative ones. Since \CONTEXT\ is a dutch -%D package, the dimensions are based on the metric system. The -%D asymmetrical layout is kind of handy for short -%D quick||and||dirty stapled documents. -%D -%D Although valid, it is not a real good idea to use -%D dimensions based on the \type {em} unit. First of all, -%D since there are no fonts loaded yet, this dimension makes -%D no sense, and second, you would loose track of values, -%D since they could change while going to a new page, -%D depending on the current font setting. - -\setuplayout - [ \c!topspace=.08417508418\paperheight, % 2.5cm - \c!top=\!!zeropoint, - \c!topdistance=\!!zeropoint, - \c!header=.06734006734\paperheight, % 2.0cm - \c!headerdistance=\!!zeropoint, - \c!height=.84175084175\paperheight, % 25.0cm - \c!footerdistance=\layoutparameter\c!headerdistance, - \c!footer=.06734006734\paperheight, % 2.0cm - \c!bottomdistance=\layoutparameter\c!topdistance, - \c!bottom=\!!zeropoint, - \c!backspace=.11904761905\paperwidth, % 2.5cm - \c!edge=\!!zeropoint, - \c!edgedistance=\layoutparameter\c!margindistance, - \c!margin=.12649983170\paperwidth, % snijwit-2*afstand - \c!margindistance=.02008341748\paperwidth, % 12.0pt - \c!leftedge=\layoutparameter\c!edge, - \c!leftedgedistance=\layoutparameter\c!edgedistance, - \c!leftmargin=\layoutparameter\c!margin, - \c!leftmargindistance=\layoutparameter\c!margindistance, - \c!width=.71428571429\paperwidth, % 15.0cm - \c!rightmargindistance=\layoutparameter\c!margindistance, - \c!rightmargin=\layoutparameter\c!margin, - \c!rightedgedistance=\layoutparameter\c!edgedistance, - \c!rightedge=\layoutparameter\c!edge, - \c!veroffset=\!!zeropoint, - \c!bottomspace=\!!zeropoint, - \c!horoffset=\!!zeropoint, - \c!cutspace=\!!zeropoint, - \c!textwidth=, % dangerous option -> centered / local - \c!textmargin=, % dangerous option -> both sides - \c!textdistance=\!!zeropoint, % shift down on grid - \c!style=, - \c!color=, - \c!marking=\v!off, - \c!location=, % \v!singlesided, but empty is signal - \c!scale=1, - \c!nx=1, - \c!ny=1, - \c!dx=\!!zeropoint, - \c!dy=\!!zeropoint, - \c!grid=\v!no, - \c!preset=, - \c!setups=\systemsetupsprefix\s!default, - \c!clipoffset=\!!zeropoint, - \c!lines=0, - \c!paper=, % for foxet - \c!page=, % for foxet - \c!columns=1, - \c!columndistance=\!!zeropoint] - -%D First we define a whole range of (DIN) papersizes, -%D of which the A-series makes most sense. We enable checking. - -%D We also set some of the parameters that will be used when -%D positioning the typeset paper onto the print paper. - -\setuppaper % (size) % only used in XY imposition - [\c!width=\zeropoint, - \c!height=\zeropoint, - \c!topspace=\zeropoint, - \c!backspace=\zeropoint, - \c!dx=\zeropoint, - \c!dy=\zeropoint, - \c!nx=1, - \c!ny=1, - \c!method=\v!normal] - -\setuppapersize - [\c!option=\v!max, - \c!top=, - \c!bottom=\vss, - \c!left=, - \c!right=\hss] - -\definepapersize [A0] [\c!width=841mm,\c!height=1189mm] -\definepapersize [A1] [\c!width=594mm,\c!height=841mm] -\definepapersize [A2] [\c!width=420mm,\c!height=594mm] -\definepapersize [A3] [\c!width=297mm,\c!height=420mm] -\definepapersize [A4] [\c!width=210mm,\c!height=297mm] -\definepapersize [A5] [\c!width=148mm,\c!height=210mm] -\definepapersize [A6] [\c!width=105mm,\c!height=148mm] -\definepapersize [A7] [\c!width=74mm,\c!height=105mm] -\definepapersize [A8] [\c!width=52mm,\c!height=74mm] -\definepapersize [A9] [\c!width=37mm,\c!height=52mm] -\definepapersize [A10] [\c!width=26mm,\c!height=37mm] - -\definepapersize [B0] [\c!width=1000mm,\c!height=1414mm] -\definepapersize [B1] [\c!width=707mm,\c!height=1000mm] -\definepapersize [B2] [\c!width=500mm,\c!height=707mm] -\definepapersize [B3] [\c!width=353mm,\c!height=500mm] % [\c!width=354mm,\c!height=500mm] -\definepapersize [B4] [\c!width=250mm,\c!height=353mm] % [\c!width=250mm,\c!height=354mm] -\definepapersize [B5] [\c!width=176mm,\c!height=250mm] % [\c!width=177mm,\c!height=250mm] -\definepapersize [B6] [\c!width=125mm,\c!height=176mm] % [\c!width=125mm,\c!height=177mm] -\definepapersize [B7] [\c!width=88mm,\c!height=125mm] -\definepapersize [B8] [\c!width=62mm,\c!height=88mm] % [\c!width=63mm,\c!height=88mm] -\definepapersize [B9] [\c!width=44mm,\c!height=62mm] % [\c!width=44mm,\c!height=63mm] -\definepapersize [B10] [\c!width=31mm,\c!height=44mm] - -\definepapersize [C0] [\c!width=917mm,\c!height=1297mm] -\definepapersize [C1] [\c!width=648mm,\c!height=917mm] % [\c!width=649mm,\c!height=917mm] -\definepapersize [C2] [\c!width=458mm,\c!height=648mm] % [\c!width=459mm,\c!height=649mm] -\definepapersize [C3] [\c!width=324mm,\c!height=458mm] % [\c!width=324mm,\c!height=459mm] -\definepapersize [C4] [\c!width=229mm,\c!height=324mm] -\definepapersize [C5] [\c!width=162mm,\c!height=229mm] -\definepapersize [C6] [\c!width=114mm,\c!height=162mm] % [\c!width=115mm,\c!height=162mm] -\definepapersize [C7] [\c!width=81mm,\c!height=114mm] % [\c!width=81mm,\c!height=115mm] -\definepapersize [C8] [\c!width=57mm,\c!height=81mm] -\definepapersize [C9] [\c!width=40mm,\c!height=57mm] -\definepapersize [C10] [\c!width=28mm,\c!height=40mm] - -%D Per August 2004 the rounding of some (seldom used) sizes -%D were corrected top the latest DIN specifications. Peter -%D Rolf came up with these and a few more missing sizes. -%D Watch out: spaces and slashes! - -\definepapersize [4 A0] [\c!width=1682mm,\c!height=2378mm] -\definepapersize [2 A0] [\c!width=1189mm,\c!height=1682mm] -\definepapersize [C6/C5] [\c!width=114mm,\c!height=229mm] - -%D Because there are no standardized screen sizes, we define -%D a bunch of sizes with $4:3$ ratios. The \type {S6} size is -%D nearly as wide as a sheet of \type {A4} paper. - -\definepapersize [S3] [\c!width=300pt,\c!height=225pt] -\definepapersize [S4] [\c!width=400pt,\c!height=300pt] -\definepapersize [S5] [\c!width=500pt,\c!height=375pt] -\definepapersize [S6] [\c!width=600pt,\c!height=450pt] -\definepapersize [S8] [\c!width=800pt,\c!height=600pt] -\definepapersize [SW] [\c!width=800pt,\c!height=450pt] -\definepapersize [SM] [\c!width=720pt,\c!height=450pt] - -%D These are handy too: - -\definepapersize [S33] [\c!width=300pt,\c!height=300pt] -\definepapersize [S44] [\c!width=400pt,\c!height=400pt] -\definepapersize [S55] [\c!width=500pt,\c!height=500pt] -\definepapersize [S66] [\c!width=600pt,\c!height=600pt] - -%D One may wonder if \TEX\ should be used for typesetting -%D \CDROM\ covers, but it does not hurt to have the paper size -%D ready. - -\definepapersize [CD] [\c!width=120mm,\c!height=120mm] - -%D The next series is for our English speaking friends who -%D decided to stick to non metric values. Thanks to Nelson -%D Beebe for completing the inch based list. - -\definepapersize [letter] [\c!width=8.5in,\c!height=11in] -\definepapersize [ledger] [\c!width=11in,\c!height=17in] -\definepapersize [tabloid] [\c!width=17in,\c!height=11in] - -\definepapersize [legal] [\c!width=8.5in,\c!height=14in] -\definepapersize [folio] [\c!width=8.5in,\c!height=13in] -\definepapersize [executive] [\c!width=7.25in,\c!height=10.5in] - -\definepapersize [A] [\c!width=8.5in,\c!height=11in] % 1 sheet -\definepapersize [B] [\c!width=11in,\c!height=17in] % 2 sheets -\definepapersize [C] [\c!width=17in,\c!height=22in] % 4 sheets - -%D The next set is for Tobias Burnus, who gave me the sizes. - -\definepapersize [envelope 9] [\c!width=8.88in,\c!height=3.88in] -\definepapersize [envelope 10] [\c!width=9.5in,\c!height=4.13in] -\definepapersize [envelope 11] [\c!width=10.38in,\c!height=4.5in] -\definepapersize [envelope 12] [\c!width=11.0in,\c!height=4.75in] -\definepapersize [envelope 14] [\c!width=11.5in,\c!height=5.0in] -\definepapersize [monarch] [\c!width=7.5in,\c!height=3.88in] -\definepapersize [check] [\c!width=8.58in,\c!height=3.88in] -\definepapersize [DL] [\c!width=110mm,\c!height=220mm] % [\c!width=220mm,\c!height=110mm] -\definepapersize [E4] [\c!width=280mm,\c!height=400mm] - -%D The next three sets are supplied by Taco: - -\definepapersize [RA0] [\c!width=860mm,\c!height=1220mm] -\definepapersize [RA1] [\c!width=610mm,\c!height=860mm] -\definepapersize [RA2] [\c!width=430mm,\c!height=610mm] -\definepapersize [RA3] [\c!width=305mm,\c!height=430mm] -\definepapersize [RA4] [\c!width=215mm,\c!height=305mm] - -%D ISO SRA (supplementary raw A) sizes: - -\definepapersize [SRA0] [\c!width=900mm,\c!height=1280mm] -\definepapersize [SRA1] [\c!width=640mm,\c!height=900mm] -\definepapersize [SRA2] [\c!width=450mm,\c!height=640mm] -\definepapersize [SRA3] [\c!width=320mm,\c!height=450mm] -\definepapersize [SRA4] [\c!width=225mm,\c!height=320mm] - -%D Swedish thesis formats: - -\definepapersize [G5] [\c!width=169mm,\c!height=239mm] -\definepapersize [E5] [\c!width=155mm,\c!height=220mm] - -%D Industry invention: - -\definepapersize [A3plus] [\c!width=329mm,\c!height=483mm] - -%D We can now default to a reasonable size. We match the print -%D paper size with the typeset paper size. This setting should -%D come after the first layout specification (already done). - -\setuppapersize - [A4][A4] - -%D A few goodies: - -\definepapersize - [oversized] - [ \c!width=\dimexpr\paperwidth +1.5cm\relax, - \c!height=\dimexpr\paperheight+1.5cm\relax] - -\definepapersize - [doublesized] - [ \c!width=\dimexpr \paperwidth \relax, - \c!height=\dimexpr2\paperheight\relax] - -\definepapersize - [doubleoversized] - [ \c!width=\dimexpr \paperheight+1.5cm\relax, - \c!height=\dimexpr2\paperwidth +1.5cm\relax] - -%D For orthogonality: - -\definepapersize - [undersized] - [ \c!width=\dimexpr\paperwidth -1.5cm\relax, - \c!height=\dimexpr\paperheight-1.5cm\relax] - -\definelayout - [\v!page] - [\c!backspace=\zeropoint, - \c!cutspace=\zeropoint, - \c!topspace=\zeropoint, - \c!bottomspace=\zeropoint, - \c!margin=\zeropoint, - \c!edge=\zeropoint, - \c!header=\zeropoint, - \c!footer=\zeropoint, - \c!top=\zeropoint, - \c!bottom=\zeropoint, - \c!leftmargin=\zeropoint, - \c!rightmargin=\zeropoint, - \c!leftedge=\zeropoint, - \c!rightedge=\zeropoint, - \c!textdistance=\zeropoint, - \c!width=\v!middle, - \c!height=\v!middle, - \c!lines=0, - \c!grid=\v!no] - -\definelayout - [\v!middle] - [\c!width=\v!middle, - \c!height=\v!middle] - -\protect \endinput diff --git a/tex/context/base/page-lin.mkiv b/tex/context/base/page-lin.mkiv index ad84fc8b2..c82d4d520 100644 --- a/tex/context/base/page-lin.mkiv +++ b/tex/context/base/page-lin.mkiv @@ -99,7 +99,8 @@ {\dontleavehmode\begingroup \global\advance\linerefcounter\plusone \dosetattribute{line-reference}\linerefcounter - #3\rawtextreference\s!lin{#2}{\noexpand\ctxlua{tex.sprint(nodes.lines.number(\the\linerefcounter))}}% + % this will change and is troublesome anyway + #3\textreference[#2]{\noexpand\ctxlua{tex.sprint(nodes.lines.number(\the\linerefcounter))}}% \endgroup} \def\mkstartlinereference#1{\mksomelinereference{#1}{lr:b:#1}{}\ignorespaces} @@ -391,8 +392,8 @@ \doifreferencefoundelse{lr:e:#1} {\let\tline\currenttextreference \ifx\fline\tline#2\else#3\fi} - {#2}} - {#2}} + {\unknownreference{#1}#2}} + {\unknownreference{#1}#2}} \def\inline#1[#2]% {\doifelsenothing{#1} diff --git a/tex/context/base/page-log.mkii b/tex/context/base/page-log.mkii new file mode 100644 index 000000000..18c7991b1 --- /dev/null +++ b/tex/context/base/page-log.mkii @@ -0,0 +1,202 @@ +%D \module +%D [ file=page-log, % moved here from main-001 +%D version=1997.03.31, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Logos, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Logos} + +\unprotect + +%D Although logos can conveniently be implemented on top of +%D background and text areas, we provide a dedicated mechanism +%D here. One reason is that such a separate mechanism cannot +%D interfere with the other ones, but an even more important +%D reason is that logos are kind of special in the sense that +%D they have a short life span and may change after the first +%D page. + +%D \macros +%D {recalculatelogos,addlogobackground} +%D +%D The interface to the other low level page building routines +%D is provided by a macro that signals changes in layout +%D specifications: +%D +%D \starttyping +%D \recalculatelogos +%D \stoptyping +%D +%D as well as a simple placement macro: +%D +%D \starttyping +%D \addlogobackground +%D \stoptyping +%D +%D In no way the following boolean switch should be used +%D directly. + +\newif\ifnewlogos + +\def\recalculatelogos + {\global\newlogostrue} + +%D The current state of logos is registered in a status +%D variable \type {\logostatus}. +%D +%D \starttabulate[|l|l|l|] +%D \NC 0 \NC don't place \NC remains 0 \NC \NR +%D \NC 1 \NC place now \NC remains 1 \NC \NR +%D \NC 2 \NC calulate and place \NC becomes 1 \NC \NR +%D \NC 3 \NC calculate and place once \NC becomes 2 \NC \NR +%D \stoptabulate + +\chardef\logostatus=0 + +\def\addlogobackground#1% todo: dimension spec + {\ifcase\logostatus \else + \ifcase\logostatus + % no logos to take care of + \or % 1 + \ifnewlogos + \chardef\logostatus2 + \setlogoboxes + \chardef\logostatus1 + \global\newlogosfalse + \fi + \or % 2 + \setlogoboxes + \chardef\logostatus1 + \or % 3 + \setlogoboxes + \global\chardef\logostatus2 + \fi + \setbox#1\vbox + {\offinterlineskip + \doifmarginswapelse + {\copy\leftlogos} + {\copy\rightlogos} + \box#1}% + \fi} + +%D For efficiency reasons (and since logos seldom change inside +%D a document) we can save the left and right hand (or first +%D and following page) logos in boxes. The areas are slightly +%D different from the ones used in backgrounds and text +%D placement, but still related to the page layout. The {\em +%D left} and {\em right edge}, as well as {\em top} and {\em +%D bottom} touch the bounding box of the paper and are +%D therefore not the sams as their background adn text +%D counterparts. In addition there are {\em left}, {\em right} +%D and {\em middle} areas as well as a {\em page} one. + +\newbox\leftlogos +\newbox\rightlogos + +\def\setlogoboxes + {\showmessage\m!layouts7\empty + \dosetlogobox\leftlogos\relax + \ifdoublesided + \dosetlogobox\rightlogos\doswapmargins + \fi} + +\def\dosetlogobox#1#2% + {\global\setbox#1\vbox to \paperheight + {\dontcomplain % needed here ? + \calculatereducedvsizes % needed here ? + \offinterlineskip + #2\relax + \vskip-\topspace + \dodosetlogobox\v!top\blap + \vskip\topspace + \dodosetlogobox\v!header\blap + \vskip\dimexpr\headerheight+\headerdistance\relax + \dodosetlogobox\v!text\blap + \vskip\dimexpr\textheight+\footerdistance+\footerheight\relax + \dodosetlogobox\v!footer \tlap + \vfilll + \dodosetlogobox\v!bottom\tlap + \vskip\topspace} + \smashbox#1} + +\def\dodosetlogobox#1#2% + {\hbox % width equals \makeupwidth + {\def\docommand##1% + {\donefalse + \ifnum\logostatus=3 \ExpandBothAfter + \doifinset{\getvalue{\??lo#1##1}}\requestedlogos\donetrue + \else + \doifvalue{\??lo#1##1\c!state}\v!start\donetrue + \fi + \ifdone + #2{\hbox{\getvalue{\??lo#1##1\c!command}}}% + \fi}% + \def\dodocommand##1##2##3##4##5##6% + {\hsmash + {\hskip-\texthoffset + \hbox to \paperwidth + {\rlap{\docommand##1}\hss\llap{\docommand##6}}% + \hskip-\paperwidth + \hbox to \paperwidth + {\hskip\texthoffset + \hskip-\leftmarginwidth + \hskip-\leftmargindistance + \hbox to \leftmarginwidth{\docommand##2\hss}% + \hskip\leftmargindistance + \hbox to \makeupwidth{\docommand##3\hss\docommand##4}% + \hskip\rightmargindistance + \hbox to \rightmarginwidth{\hss\docommand##5}% + \hfill}}}% + \normalbaselines + \settexthoffset + \hsmash + {\hbox to \makeupwidth{\hss\docommand\c!middle\hss}}% + \hsmash + {\hskip-\texthoffset + \hbox to \paperwidth{\docommand\v!page\hss}}% + \swapmargins + \doifbothsidesoverruled + {\dodocommand + \v!leftedge \v!leftmargin \v!left + \v!right \v!rightmargin \v!rightedge} + {\dodocommand + \v!leftedge \v!leftmargin \v!left + \v!right \v!rightmargin \v!rightedge} + {\dodocommand + \v!rightedge \v!rightmargin \v!right + \v!left \v!leftmargin \v!leftedge}}} + +%D The user interface is relatively simple and provides +%D macros for assigning logos to logo areas as well as +%D forcing placement. +%D +%D \showsetup{definelogo} +%D \showsetup{placelogos} + +\let\definedlogos \empty +\let\requestedlogos\empty + +\long\def\dodefinelogo[#1][#2][#3][#4]% + {\addtocommalist{#1}\definedlogos + \long\setvalue{\??lo#2#3}{#1}% + \getparameters[\??lo#2#3][#4]% + \global\chardef\logostatus2 } + +\def\definelogo + {\doquadrupleargument\dodefinelogo} + +\def\placelogos + {\dosingleempty\doplacelogos} + +\def\doplacelogos[#1]% + {\xdef\requestedlogos{\iffirstargument#1\else\definedlogos\fi}% + \global\chardef\logostatus3 } + +\protect \endinput diff --git a/tex/context/base/page-log.tex b/tex/context/base/page-log.tex deleted file mode 100644 index e52c36288..000000000 --- a/tex/context/base/page-log.tex +++ /dev/null @@ -1,218 +0,0 @@ -%D \module -%D [ file=page-log, % moved here from main-001 -%D version=1997.03.31, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Logos, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Logos} - -\unprotect - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -%D Although logos can conveniently be implemented on top of -%D background and text areas, we provide a dedicated mechanism -%D here. One reason is that such a separate mechanism cannot -%D interfere with the other ones, but an even more important -%D reason is that logos are kind of special in the sense that -%D they have a short life span and may change after the first -%D page. - -%D \macros -%D {recalculatelogos,addlogobackground} -%D -%D The interface to the other low level page building routines -%D is provided by a macro that signals changes in layout -%D specifications: -%D -%D \starttyping -%D \recalculatelogos -%D \stoptyping -%D -%D as well as a simple placement macro: -%D -%D \starttyping -%D \addlogobackground -%D \stoptyping -%D -%D In no way the following boolean switch should be used -%D directly. - -\newif\ifnewlogos - -\def\recalculatelogos - {\global\newlogostrue} - -%D The current state of logos is registered in a status -%D variable \type {\logostatus}. -%D -%D \starttabulate[|l|l|l|] -%D \NC 0 \NC don't place \NC remains 0 \NC \NR -%D \NC 1 \NC place now \NC remains 1 \NC \NR -%D \NC 2 \NC calulate and place \NC becomes 1 \NC \NR -%D \NC 3 \NC calculate and place once \NC becomes 2 \NC \NR -%D \stoptabulate - -\chardef\logostatus=0 - -\def\addlogobackground#1% todo: dimension spec - {\ifcase\logostatus \else - \ifcase\logostatus - % no logos to take care of - \or % 1 - \ifnewlogos - \chardef\logostatus2 - \setlogoboxes - \chardef\logostatus1 - \global\newlogosfalse - \fi - \or % 2 - \setlogoboxes - \chardef\logostatus1 - \or % 3 - \setlogoboxes - \global\chardef\logostatus2 - \fi - \setbox#1\vbox - {\offinterlineskip - \doifmarginswapelse - {\copy\leftlogos} - {\copy\rightlogos} - \box#1}% - \fi} - -%D For efficiency reasons (and since logos seldom change inside -%D a document) we can save the left and right hand (or first -%D and following page) logos in boxes. The areas are slightly -%D different from the ones used in backgrounds and text -%D placement, but still related to the page layout. The {\em -%D left} and {\em right edge}, as well as {\em top} and {\em -%D bottom} touch the bounding box of the paper and are -%D therefore not the sams as their background adn text -%D counterparts. In addition there are {\em left}, {\em right} -%D and {\em middle} areas as well as a {\em page} one. - -\newbox\leftlogos -\newbox\rightlogos - -\def\setlogoboxes - {\showmessage\m!layouts7\empty - \dosetlogobox\leftlogos\relax - \ifdoublesided - \dosetlogobox\rightlogos\doswapmargins - \fi} - -\def\dosetlogobox#1#2% - {\global\setbox#1\vbox to \paperheight - {\dontcomplain % needed here ? - \calculatereducedvsizes % needed here ? - \offinterlineskip - #2\relax - \vskip-\topspace - \dodosetlogobox\v!top\blap - \vskip\topspace - \dodosetlogobox\v!header\blap - \vskip\dimexpr\headerheight+\headerdistance\relax - \dodosetlogobox\v!text\blap - \vskip\dimexpr\textheight+\footerdistance+\footerheight\relax - \dodosetlogobox\v!footer \tlap - \vfilll - \dodosetlogobox\v!bottom\tlap - \vskip\topspace} - \smashbox#1} - -\def\dodosetlogobox#1#2% - {\hbox % width equals \makeupwidth - {\def\docommand##1% - {\donefalse - \ifnum\logostatus=3 \ExpandBothAfter - \doifinset{\getvalue{\??lo#1##1}}\requestedlogos\donetrue - \else - \doifvalue{\??lo#1##1\c!state}\v!start\donetrue - \fi - \ifdone - #2{\hbox{\getvalue{\??lo#1##1\c!command}}}% - \fi}% - \def\dodocommand##1##2##3##4##5##6% - {\hsmash - {\hskip-\texthoffset - \hbox to \paperwidth - {\rlap{\docommand##1}\hss\llap{\docommand##6}}% - \hskip-\paperwidth - \hbox to \paperwidth - {\hskip\texthoffset - \hskip-\leftmarginwidth - \hskip-\leftmargindistance - \hbox to \leftmarginwidth{\docommand##2\hss}% - \hskip\leftmargindistance - \hbox to \makeupwidth{\docommand##3\hss\docommand##4}% - \hskip\rightmargindistance - \hbox to \rightmarginwidth{\hss\docommand##5}% - \hfill}}}% - \normalbaselines - \settexthoffset - \hsmash - {\hbox to \makeupwidth{\hss\docommand\c!middle\hss}}% - \hsmash - {\hskip-\texthoffset - \hbox to \paperwidth{\docommand\v!page\hss}}% - \swapmargins - \doifbothsidesoverruled - {\dodocommand - \v!leftedge \v!leftmargin \v!left - \v!right \v!rightmargin \v!rightedge} - {\dodocommand - \v!leftedge \v!leftmargin \v!left - \v!right \v!rightmargin \v!rightedge} - {\dodocommand - \v!rightedge \v!rightmargin \v!right - \v!left \v!leftmargin \v!leftedge}}} - -%D The user interface is relatively simple and provides -%D macros for assigning logos to logo areas as well as -%D forcing placement. -%D -%D \showsetup{definelogo} -%D \showsetup{placelogos} - -\let\definedlogos \empty -\let\requestedlogos\empty - -\long\def\dodefinelogo[#1][#2][#3][#4]% - {\addtocommalist{#1}\definedlogos - \long\setvalue{\??lo#2#3}{#1}% - \getparameters[\??lo#2#3][#4]% - \global\chardef\logostatus2 } - -\def\definelogo - {\doquadrupleargument\dodefinelogo} - -\def\placelogos - {\dosingleempty\doplacelogos} - -\def\doplacelogos[#1]% - {\xdef\requestedlogos{\iffirstargument#1\else\definedlogos\fi}% - \global\chardef\logostatus3 } - -\protect \endinput diff --git a/tex/context/base/page-mak.mkii b/tex/context/base/page-mak.mkii new file mode 100644 index 000000000..040feb1d2 --- /dev/null +++ b/tex/context/base/page-mak.mkii @@ -0,0 +1,234 @@ +%D \module +%D [ file=page-mak, % copied from main-001, +%D version=1997.03.31, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Simple MakeUp, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / MakeUp} + +\unprotect + +%D \macros +%D {definemakeup, setupmakeup, startmakeup} +%D +%D A makeup is a separate page, like a title page or colofon. +%D There is one standard makeup page, but you can define more +%D if needed. +%D +%D \starttyping +%D \startstandardmakeup +%D My Fancy Title +%D \stopstandardmakeup +%D \stoptyping +%D +%D The associated commands are: +%D +%D \showsetup{definemakeup} +%D \showsetup{setupmakeup} +%D \showsetup{startmakeup} + +\def\definemakeup + {\dodoubleargument\dodefinemakeup} + +\def\dodefinemakeup[#1][#2]% + {\getparameters + [\??do#1]% + [\c!width=\innermakeupwidth, % example in manual / was \makeupwidth + \c!height=\textheight, % example in manual + \c!voffset=\!!zeropoint, % example in manual + \c!hoffset=\!!zeropoint, % example in manual + \c!commands=, + \c!setups=, + \c!page=\v!right, + \c!doublesided=\v!empty, + \c!before=, + \c!top=\vss, + \c!bottom=\vss, + \c!after=, + \c!bottomstate=\v!normal, + \c!topstate=\v!normal, + \c!textstate=\v!normal, + \c!headerstate=\v!stop, + \c!footerstate=\v!stop, + \c!pagestate=\v!stop, % in manual ! ! ! + \c!color=, + \c!align=, + #2]% + \setvalue{\e!start#1\e!makeup}{\startmakeup[#1]}% + \setvalue{\e!stop #1\e!makeup}{\stopmakeup}} + +\def\setupmakeup + {\dodoubleargument\dosetupmakeup} + +\def\dosetupmakeup[#1]% + {\getparameters[\??do#1]} + +%D This will save us some 375 bytes in the format file. + +\def\makeupparameter#1{\getvalue{\??do\currentmakeup#1}} + +%D The \type{\start}||\type{\stop} macros are used for both +%D the direct and indirect way. The parameterless call will +%D build a simple box. + +\newtoks\everymakeup + +\appendtoks \postponemarks \to \everymakeup + +\let\currentmakeup\empty + +\def\startmakeup + {\dodoubleempty\dostartmakeup} + +\def\dostartmakeup[#1][#2]% + {\bgroup + \edef\currentmakeup{#1}% + \the\everymakeup + \iffirstargument + \setupmakeup[\currentmakeup][#2]% + \let\stopmakeup\dodostopmakeup + \expandafter \dodostartmakeup + \else + \let\stopmakeup\donostopmakeup + \expandafter \donostartmakeup + \fi} + +%D The simple case: + +\def\donostartmakeup % textwidth ? + {\page + \setupheader[\c!state=\v!empty]% + \setupfooter[\c!state=\v!empty]% + \setsystemmode\v!makeup + \vbox to \textheight\bgroup\hsize\textwidth} + +\def\donostopmakeup + {\egroup + \flushmarks % new, here, else empty pages + \page + \egroup} + +%D The normal one: + +\newbox\makeupbox + +\def\dodostartmakeup + {\doifvaluesomething{\??do\currentmakeup\c!page} + {\ExpandFirstAfter\page[\makeupparameter\c!page]}% + \pagetype[\currentmakeup]% + \setsystemmode\v!makeup + \setupmakeuplayout + \makeupparameter\c!commands % hm, what is this one doing here ? + \startregistercolor[\makeupparameter\c!color]% + \forgetall % else indented flush + \global\setbox\makeupbox\vbox to \makeupparameter\c!height + \bgroup +% \forgetall + \setups[\makeupparameter\c!setups]% + \hsize\makeupparameter\c!width + \doifsomething{\makeupparameter\c!align} + {\setupalign[\makeupparameter\c!align]}% + \makeupparameter\c!top} + +\def\dodostopmakeup + {\endgraf + \makeupparameter\c!bottom + \egroup + \flushmarks % new, here, else empty pages + \stopregistercolor + \doflushmakeup + \egroup + \calculatehsizes + \calculatevsizes} + +%D Selective page processing is handled here. (Why?) + +\def\doflushmakeup + {\ifprocessingpages + \ifpageselected + \doshipoutmakeup + \fi + \else + \ifpageselected \else + \doshipoutmakeup + \fi + \fi + \ifselectingpages + \global\pageselectedfalse + \fi} + +% \def\pushpagestate{\globalpushmacro\@@pnstate} +% \def\poppagestate {\globalpopmacro \@@pnstate} + +\def\doshipoutmakeup + {\pushpagestate % new + \makeupparameter\c!before + \setbox\makeupbox\vbox{\hbox{\color[\makeupparameter\c!color]{\box\makeupbox}}}% + % \ifgridsnapping + % new per 22/6/2006 + \ifdim\ht\makeupbox>\vsize + \ht\makeupbox\vsize + \fi + % \fi + \box\makeupbox + \setuppagenumber[\c!state=\makeupparameter\c!pagestate]% + \setupmakeuplayout + \page + \makeupparameter\c!after + \relax % voor fi + \ifdoublesided \ifodd\realpageno\else + \processaction + [\makeupparameter\c!doublesided] + [ \v!yes=>\null + \page, + \v!empty=>{\setupmakeuplayout + \page[\v!blank]% + \null + \page}]% + \fi \fi + \poppagestate} % new + +%D The text surrounding the main body text can be influenced +%D by setting their associated status variables. The +%D connection between them is made by the following macro + +\def\setupmakeuplayout + {\setupfooter[\c!state=\makeupparameter\c!footerstate]% + \setupheader[\c!state=\makeupparameter\c!headerstate]% + \setuptext [\c!state=\makeupparameter\c!textstate]% + \setupbottom[\c!state=\makeupparameter\c!bottomstate]% + \setuptop [\c!state=\makeupparameter\c!topstate]% + % this is needed, but no \setuplayout here; fails in texexec --fig=c + \recalculatelayout} + +%D The standard page template is defined as follows: + +\definemakeup + [\v!standard] + [\c!width=\innermakeupwidth, + \c!height=\textheight, + \c!voffset=\!!zeropoint, + \c!hoffset=\!!zeropoint, + \c!page=\v!right, + \c!doublesided=\v!empty] + +\definemakeup + [\v!text] + [\c!topstate=\v!start, + \c!headerstate=\v!start, + \c!textstate=\v!start, + \c!footerstate=\v!start, + \c!bottomstate=\v!start, + \c!doublesided=\v!no, + \c!page=\v!yes, + \c!top=\pseudostrut\ignorespaces, + \c!bottom=\obeydepth\vss] + +\protect \endinput diff --git a/tex/context/base/page-mak.mkiv b/tex/context/base/page-mak.mkiv new file mode 100644 index 000000000..45a1f1167 --- /dev/null +++ b/tex/context/base/page-mak.mkiv @@ -0,0 +1,233 @@ +%D \module +%D [ file=page-mak, % copied from main-001, +%D version=1997.03.31, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Simple MakeUp, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / MakeUp} + +\unprotect + +%D \macros +%D {definemakeup, setupmakeup, startmakeup} +%D +%D A makeup is a separate page, like a title page or colofon. +%D There is one standard makeup page, but you can define more +%D if needed. +%D +%D \starttyping +%D \startstandardmakeup +%D My Fancy Title +%D \stopstandardmakeup +%D \stoptyping +%D +%D The associated commands are: +%D +%D \showsetup{definemakeup} +%D \showsetup{setupmakeup} +%D \showsetup{startmakeup} + +\def\definemakeup + {\dodoubleargument\dodefinemakeup} + +\def\dodefinemakeup[#1][#2]% + {\getparameters + [\??do#1]% + [\c!width=\innermakeupwidth, % example in manual / was \makeupwidth + \c!height=\textheight, % example in manual + \c!voffset=\!!zeropoint, % example in manual + \c!hoffset=\!!zeropoint, % example in manual + \c!commands=, + \c!setups=, + \c!page=\v!right, + \c!doublesided=\v!empty, + \c!before=, + \c!top=\vss, + \c!bottom=\vss, + \c!after=, + \c!bottomstate=\v!normal, + \c!topstate=\v!normal, + \c!textstate=\v!normal, + \c!headerstate=\v!stop, + \c!footerstate=\v!stop, + \c!pagestate=\v!stop, % in manual ! ! ! + \c!color=, + \c!align=, + #2]% + \setvalue{\e!start#1\e!makeup}{\startmakeup[#1]}% + \setvalue{\e!stop #1\e!makeup}{\stopmakeup}} + +\def\setupmakeup + {\dodoubleargument\dosetupmakeup} + +\def\dosetupmakeup[#1]% + {\getparameters[\??do#1]} + +%D This will save us some 375 bytes in the format file. + +\def\makeupparameter#1{\getvalue{\??do\currentmakeup#1}} + +%D The \type{\start}||\type{\stop} macros are used for both +%D the direct and indirect way. The parameterless call will +%D build a simple box. + +\newtoks\everymakeup + +\appendtoks \postponemarks \to \everymakeup + +\let\currentmakeup\empty + +\def\startmakeup + {\dodoubleempty\dostartmakeup} + +\def\dostartmakeup[#1][#2]% + {\bgroup + \edef\currentmakeup{#1}% + \the\everymakeup + \iffirstargument + \setupmakeup[\currentmakeup][#2]% + \let\stopmakeup\dodostopmakeup + \expandafter \dodostartmakeup + \else + \let\stopmakeup\donostopmakeup + \expandafter \donostartmakeup + \fi} + +%D The simple case: + +\def\donostartmakeup % textwidth ? + {\page + \setupheader[\c!state=\v!empty]% + \setupfooter[\c!state=\v!empty]% + \setsystemmode\v!makeup + \vbox to \textheight\bgroup\hsize\textwidth} + +\def\donostopmakeup + {\egroup + \flushmarks % new, here, else empty pages + \page + \egroup} + +%D The normal one: + +\newbox\makeupbox + +\def\dodostartmakeup + {\doifvaluesomething{\??do\currentmakeup\c!page} + {\ExpandFirstAfter\page[\makeupparameter\c!page]}% + \pagetype[\currentmakeup]% + \setsystemmode\v!makeup + \setupmakeuplayout + \makeupparameter\c!commands % hm, what is this one doing here ? + \startregistercolor[\makeupparameter\c!color]% + \forgetall % else indented flush + \global\setbox\makeupbox\vbox to \makeupparameter\c!height + \bgroup + \setups[\makeupparameter\c!setups]% + \hsize\makeupparameter\c!width + \doifsomething{\makeupparameter\c!align} + {\setupalign[\makeupparameter\c!align]}% + \makeupparameter\c!top} + +\def\dodostopmakeup + {\endgraf + \makeupparameter\c!bottom + \egroup + \flushmarks % new, here, else empty pages + \stopregistercolor + \doflushmakeup + \egroup + \calculatehsizes + \calculatevsizes} + +%D Selective page processing is handled here. (Why?) + +\def\doflushmakeup + {\ifprocessingpages + \ifpageselected + \doshipoutmakeup + \fi + \else + \ifpageselected \else + \doshipoutmakeup + \fi + \fi + \ifselectingpages + \global\pageselectedfalse + \fi} + +% \def\pushpagestate{\globalpushmacro\@@pnstate} +% \def\poppagestate {\globalpopmacro \@@pnstate} + +\def\doshipoutmakeup + {\pushpagestate % new + \makeupparameter\c!before + \setbox\makeupbox\vbox{\hbox{\color[\makeupparameter\c!color]{\box\makeupbox}}}% + % \ifgridsnapping + % new per 22/6/2006 + \ifdim\ht\makeupbox>\vsize + \ht\makeupbox\vsize + \fi + % \fi + \box\makeupbox + \setuppagenumber[\c!state=\makeupparameter\c!pagestate]% + \setupmakeuplayout + \page + \makeupparameter\c!after + \relax % voor fi + \ifdoublesided \ifodd\realpageno\else + \processaction + [\makeupparameter\c!doublesided] + [ \v!yes=>\null + \page, + \v!empty=>{\setupmakeuplayout + \page[\v!blank]% + \null + \page}]% + \fi \fi + \poppagestate} % new + +%D The text surrounding the main body text can be influenced +%D by setting their associated status variables. The +%D connection between them is made by the following macro + +\def\setupmakeuplayout + {\setupfooter[\c!state=\makeupparameter\c!footerstate]% + \setupheader[\c!state=\makeupparameter\c!headerstate]% + \setuptext [\c!state=\makeupparameter\c!textstate]% + \setupbottom[\c!state=\makeupparameter\c!bottomstate]% + \setuptop [\c!state=\makeupparameter\c!topstate]% + % this is needed, but no \setuplayout here; fails in texexec --fig=c + \recalculatelayout} + +%D The standard page template is defined as follows: + +\definemakeup + [\v!standard] + [\c!width=\innermakeupwidth, + \c!height=\textheight, + \c!voffset=\!!zeropoint, + \c!hoffset=\!!zeropoint, + \c!page=\v!right, + \c!doublesided=\v!empty] + +\definemakeup + [\v!text] + [\c!topstate=\v!start, + \c!headerstate=\v!start, + \c!textstate=\v!start, + \c!footerstate=\v!start, + \c!bottomstate=\v!start, + \c!doublesided=\v!no, + \c!page=\v!yes, + \c!top=\pseudostrut\ignorespaces, + \c!bottom=\obeydepth\vss] + +\protect \endinput diff --git a/tex/context/base/page-mak.tex b/tex/context/base/page-mak.tex deleted file mode 100644 index 040feb1d2..000000000 --- a/tex/context/base/page-mak.tex +++ /dev/null @@ -1,234 +0,0 @@ -%D \module -%D [ file=page-mak, % copied from main-001, -%D version=1997.03.31, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Simple MakeUp, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / MakeUp} - -\unprotect - -%D \macros -%D {definemakeup, setupmakeup, startmakeup} -%D -%D A makeup is a separate page, like a title page or colofon. -%D There is one standard makeup page, but you can define more -%D if needed. -%D -%D \starttyping -%D \startstandardmakeup -%D My Fancy Title -%D \stopstandardmakeup -%D \stoptyping -%D -%D The associated commands are: -%D -%D \showsetup{definemakeup} -%D \showsetup{setupmakeup} -%D \showsetup{startmakeup} - -\def\definemakeup - {\dodoubleargument\dodefinemakeup} - -\def\dodefinemakeup[#1][#2]% - {\getparameters - [\??do#1]% - [\c!width=\innermakeupwidth, % example in manual / was \makeupwidth - \c!height=\textheight, % example in manual - \c!voffset=\!!zeropoint, % example in manual - \c!hoffset=\!!zeropoint, % example in manual - \c!commands=, - \c!setups=, - \c!page=\v!right, - \c!doublesided=\v!empty, - \c!before=, - \c!top=\vss, - \c!bottom=\vss, - \c!after=, - \c!bottomstate=\v!normal, - \c!topstate=\v!normal, - \c!textstate=\v!normal, - \c!headerstate=\v!stop, - \c!footerstate=\v!stop, - \c!pagestate=\v!stop, % in manual ! ! ! - \c!color=, - \c!align=, - #2]% - \setvalue{\e!start#1\e!makeup}{\startmakeup[#1]}% - \setvalue{\e!stop #1\e!makeup}{\stopmakeup}} - -\def\setupmakeup - {\dodoubleargument\dosetupmakeup} - -\def\dosetupmakeup[#1]% - {\getparameters[\??do#1]} - -%D This will save us some 375 bytes in the format file. - -\def\makeupparameter#1{\getvalue{\??do\currentmakeup#1}} - -%D The \type{\start}||\type{\stop} macros are used for both -%D the direct and indirect way. The parameterless call will -%D build a simple box. - -\newtoks\everymakeup - -\appendtoks \postponemarks \to \everymakeup - -\let\currentmakeup\empty - -\def\startmakeup - {\dodoubleempty\dostartmakeup} - -\def\dostartmakeup[#1][#2]% - {\bgroup - \edef\currentmakeup{#1}% - \the\everymakeup - \iffirstargument - \setupmakeup[\currentmakeup][#2]% - \let\stopmakeup\dodostopmakeup - \expandafter \dodostartmakeup - \else - \let\stopmakeup\donostopmakeup - \expandafter \donostartmakeup - \fi} - -%D The simple case: - -\def\donostartmakeup % textwidth ? - {\page - \setupheader[\c!state=\v!empty]% - \setupfooter[\c!state=\v!empty]% - \setsystemmode\v!makeup - \vbox to \textheight\bgroup\hsize\textwidth} - -\def\donostopmakeup - {\egroup - \flushmarks % new, here, else empty pages - \page - \egroup} - -%D The normal one: - -\newbox\makeupbox - -\def\dodostartmakeup - {\doifvaluesomething{\??do\currentmakeup\c!page} - {\ExpandFirstAfter\page[\makeupparameter\c!page]}% - \pagetype[\currentmakeup]% - \setsystemmode\v!makeup - \setupmakeuplayout - \makeupparameter\c!commands % hm, what is this one doing here ? - \startregistercolor[\makeupparameter\c!color]% - \forgetall % else indented flush - \global\setbox\makeupbox\vbox to \makeupparameter\c!height - \bgroup -% \forgetall - \setups[\makeupparameter\c!setups]% - \hsize\makeupparameter\c!width - \doifsomething{\makeupparameter\c!align} - {\setupalign[\makeupparameter\c!align]}% - \makeupparameter\c!top} - -\def\dodostopmakeup - {\endgraf - \makeupparameter\c!bottom - \egroup - \flushmarks % new, here, else empty pages - \stopregistercolor - \doflushmakeup - \egroup - \calculatehsizes - \calculatevsizes} - -%D Selective page processing is handled here. (Why?) - -\def\doflushmakeup - {\ifprocessingpages - \ifpageselected - \doshipoutmakeup - \fi - \else - \ifpageselected \else - \doshipoutmakeup - \fi - \fi - \ifselectingpages - \global\pageselectedfalse - \fi} - -% \def\pushpagestate{\globalpushmacro\@@pnstate} -% \def\poppagestate {\globalpopmacro \@@pnstate} - -\def\doshipoutmakeup - {\pushpagestate % new - \makeupparameter\c!before - \setbox\makeupbox\vbox{\hbox{\color[\makeupparameter\c!color]{\box\makeupbox}}}% - % \ifgridsnapping - % new per 22/6/2006 - \ifdim\ht\makeupbox>\vsize - \ht\makeupbox\vsize - \fi - % \fi - \box\makeupbox - \setuppagenumber[\c!state=\makeupparameter\c!pagestate]% - \setupmakeuplayout - \page - \makeupparameter\c!after - \relax % voor fi - \ifdoublesided \ifodd\realpageno\else - \processaction - [\makeupparameter\c!doublesided] - [ \v!yes=>\null - \page, - \v!empty=>{\setupmakeuplayout - \page[\v!blank]% - \null - \page}]% - \fi \fi - \poppagestate} % new - -%D The text surrounding the main body text can be influenced -%D by setting their associated status variables. The -%D connection between them is made by the following macro - -\def\setupmakeuplayout - {\setupfooter[\c!state=\makeupparameter\c!footerstate]% - \setupheader[\c!state=\makeupparameter\c!headerstate]% - \setuptext [\c!state=\makeupparameter\c!textstate]% - \setupbottom[\c!state=\makeupparameter\c!bottomstate]% - \setuptop [\c!state=\makeupparameter\c!topstate]% - % this is needed, but no \setuplayout here; fails in texexec --fig=c - \recalculatelayout} - -%D The standard page template is defined as follows: - -\definemakeup - [\v!standard] - [\c!width=\innermakeupwidth, - \c!height=\textheight, - \c!voffset=\!!zeropoint, - \c!hoffset=\!!zeropoint, - \c!page=\v!right, - \c!doublesided=\v!empty] - -\definemakeup - [\v!text] - [\c!topstate=\v!start, - \c!headerstate=\v!start, - \c!textstate=\v!start, - \c!footerstate=\v!start, - \c!bottomstate=\v!start, - \c!doublesided=\v!no, - \c!page=\v!yes, - \c!top=\pseudostrut\ignorespaces, - \c!bottom=\obeydepth\vss] - -\protect \endinput diff --git a/tex/context/base/page-mar.mkii b/tex/context/base/page-mar.mkii new file mode 100644 index 000000000..f7c5328f3 --- /dev/null +++ b/tex/context/base/page-mar.mkii @@ -0,0 +1,867 @@ +%D \module +%D [ file=page-mar, % moved here from main-001 +%D version=1997.03.31, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Marginal Things, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Support for margin words is one of the reasons for writing +%D \CONTEXT. Over time support for marginal content has been +%D extended en enhanced. Therefore it's always good to watch +%D out for unexpected side effects. + +\writestatus{loading}{ConTeXt Page Macros / Maginal Things} + +\unprotect + +%D There are three categories and their historically grown meaning is +%D as follows: +%D +%D marginlines: these are flushed relative to the start of a line and +%D need to be invoked there. +%D +%D marginwords: these can be issued in the text flow and will migrate +%D sidewards; in spite of the name, it can be a paragraph of text as +%D well, but normally it's words. +%D +%D margintexts: these can be set beforehand and are flushed at the +%D next paragraph of text (of header) +%D +%D While these mechanisms were rather separated, they now are slightly +%D more integrated. Instead of low level instances we now have a mechanism +%D for defining additional ones. + +%D \macros +%D {inleftedge,inleftmargin,inrightmargin,inrightedge} +%D +%D The fast and clean way of putting things in the margin is +%D using \type{\rlap} or \type{\llap}. Unfortunately these +%D macro's don't handle indentation, left and right skips. We +%D therefore embed them in some macro's that (force and) +%D remove the indentation and restore it afterwards. + +\def\definemarginline + {\dodoubleargument\dodefinemarginline} + +\def\dodefinemarginline[#1][#2]% + {\getparameters + [\??im\??im#1] + [\c!location=\v!left, + \c!distance=\zeropoint, + \c!width=\leftmarginwidth, + \c!hoffset=\leftmargindistance, + \c!command=, + #2]% + \unexpanded\setvalue{#1}{\dohandlemarginline{#1}}} + +\def\marginlineparameter #1{\csname\??im\??im\currentmarginline#1\endcsname} +\def\marginlineexecuter #1#2{\executeifdefined{\??im\??im\currentmarginline#1}{#2}} + +\def\dohandlemarginline#1% #2 + {\def\currentmarginline{#1}% + \csname\s!do\??im\??im\executeifdefined{\??im\??im#1\c!location}\v!left\endcsname{#1}} % {#2} + +\def\doleftmarginline#1#2% #1 is redundant (we can remove it when we group dohandlemarginline; maybe ... + {\pushindentation + \llap + {\def\currentmarginline{#1}% + \postsignalrightpage + \hsize\marginlineparameter\c!width\relax + \marginlineexecuter\c!command\firstofoneargument{#2}\relax + \hskip\dimexpr + +\leftskip + +\compensatedinnermakeupmargin + +\marginlineparameter\c!hoffset + +\marginlineparameter\c!distance + \relax}% + \popindentation + \ignorespaces} + +\def\dorightmarginline#1#2% #1 is redundant + {\pushindentation + \rlap + {\def\currentmarginline{#1}% + \postsignalrightpage + \hskip\dimexpr + +\hsize + -\rightskip + +\compensatedinnermakeupmargin + +\marginlineparameter\c!hoffset + +\marginlineparameter\c!distance + \relax + \hsize\marginlineparameter\c!width + \marginlineexecuter\c!command\firstofoneargument{#2}}% + \popindentation + \ignorespaces} + +\long\def\installmarginlinehandler#1#2{\setvalue{\s!do\??im\??im#1}{#2}} + +\installmarginlinehandler \v!left {\doleftmarginline} +\installmarginlinehandler \v!right {\dorightmarginline} +\installmarginlinehandler \v!inner {\presignalrightpage\doifrightpageelse\doleftmarginline \dorightmarginline} +\installmarginlinehandler \v!outer {\presignalrightpage\doifrightpageelse\dorightmarginline\doleftmarginline } + +\definemarginline[inleftmargin] [\c!location=\v!left, \c!width=\leftmarginwidth, \c!distance=\leftmargindistance, \c!hoffset=\zeropoint] +\definemarginline[inrightmargin][\c!location=\v!right,\c!width=\rightmarginwidth,\c!distance=\rightmargindistance,\c!hoffset=\zeropoint] +\definemarginline[inleftedge] [\c!location=\v!left, \c!width=\leftedgewidth, \c!distance=\leftedgedistance, \c!hoffset=\leftmargintotal] +\definemarginline[inrightedge] [\c!location=\v!right,\c!width=\rightedgewidth, \c!distance=\rightedgedistance, \c!hoffset=\rightmargintotal] + +\definemarginline[inoutermargin][\c!location=\v!outer,\c!width=\outermarginwidth,\c!distance=\outermargindistance,\c!hoffset=\zeropoint] +\definemarginline[ininnermargin][\c!location=\v!inner,\c!width=\innermarginwidth,\c!distance=\innermargindistance,\c!hoffset=\zeropoint] +\definemarginline[inouteredge] [\c!location=\v!outer,\c!width=\outeredgewidth, \c!distance=\outeredgedistance, \c!hoffset=\outermargintotal] +\definemarginline[ininneredge] [\c!location=\v!inner,\c!width=\inneredgewidth, \c!distance=\inneredgedistance, \c!hoffset=\innermargintotal] + +\definemarginline[atleftmargin] [\c!location=\v!left, \c!command=\lrlap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint] +\definemarginline[atrightmargin][\c!location=\v!right,\c!command=\rllap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint] + +\ifx\lrlap\undefined \def\lrlap#1{\llap{\rlap{#1}}} \fi +\ifx\rllap\undefined \def\rllap#1{\rlap{\llap{#1}}} \fi + +\def\lrlap#1{\llap{\rlap{#1}}} +\def\rllap#1{\rlap{\hskip\hsize\llap{#1}}} + +%D We want to keep things efficient and therefore only handle +%D situations like: +%D +%D \startbuffer +%D \inleftedge {fine} some text \par +%D \strut \inleftmargin {fine} some text \par +%D \noindent \inrightmargin {fine} some text \par +%D \noindent \strut \inrightedge {fine} some text \par +%D \stopbuffer +%D +%D \typebuffer +%D +%D which looks like: +%D +%D \bgroup +%D \getbuffer +%D \parindent 30pt +%D \getbuffer +%D \egroup +%D +%D A torture test: +%D +%D \starttyping +%D \def\TestLine#1#2{\backgroundline[#1]{\strut\white\tttf#2~\recurselevel}} +%D +%D \startbuffer +%D \inleftmargin {\TestLine{red} {lm}} test test test \par +%D \inrightmargin{\TestLine{green} {rm}} test test test \par +%D \inleftedge {\TestLine{red} {le}} test test test \par +%D \inrightedge {\TestLine{green} {re}} test test test \par +%D \inoutermargin{\TestLine{blue} {om}} test test test \par +%D \ininnermargin{\TestLine{yellow}{im}} test test test \par +%D \inouteredge {\TestLine{blue} {oe}} test test test \par +%D \ininneredge {\TestLine{yellow}{ie}} test test test \par +%D \atleftmargin {\TestLine{red} {alm}} \hfill test \par +%D \atrightmargin{\TestLine{green} {arm}} test \hfill \par +%D \stopbuffer +%D +%D \dorecurse{40}\getbuffer \page +%D \stoptyping + +%D New, yet undocumented: +%D +%D used for pascal: +%D +%D \starttyping +%D \index {test} test \index {west} west \index {rest} rest +%D +%D \startnarrower +%D \placeregister[index][alternative=b,command=\atleftmargin] +%D \stopnarrower +%D \stoptyping + +% todo: compensate distance when setuplayout[textwidth=..] +% todo: generalize margin/edge model, now too much duplication + +%D The next bunch of macros looks messy which is due to its +%D multi-purpose character. + +\chardef\margincontentdisplacement \zerocount +\let \margincontentdistance \!!zeropoint +\let \margincontenthoffset \!!zeropoint +\def \margincontentlines {1} +\def \margincontenttag {0} +\let \margincontentseparator \empty +\def \margincontentstrutheight {\strutht} + +\newcount\margincontentlevel +\newdimen\margincontentheight + +\def\setupinmargin + {\dodoubleempty\dosetupinmargin} + +\def\dosetupinmargin[#1][#2]% + {\ifsecondargument + \processcommalist[#1]{\dodosetupinmargin[#2]}% becomes [#2]{##1} + \else + \getparameters[\??im][#1]% + \fi} + +% \def\dodosetupinmargin[#1]#2% [settings]{class} +% {\checkinmargin[#2]% +% \getparameters[\??im#2][#1]} + +\def\dodosetupinmargin[#1]#2% [settings]{class} + {\checkinmargin[#2]% + \getparameters[\??im#2][#1]% + % will become an \everyinmarginsetup thing + \ifcase\executeifdefined{\??im#2\c!sidemethod}{0}\else + \positioningtrue \positioningpartrue % global ? + \fi} + +\def\checkinmargin[#1]% + {\ifundefined{\??im#1\c!offset}% this offset is related to framed ! + \addtocommalist{#1}\inmargintaglist + \presetmargintext[#1]% + \fi} + +\def\presetmargintext[#1]% + {\presetlocalframed + [\??im#1]% + \getparameters + [\??im#1] + [\c!frame=\v!off, + \c!offset=\v!overlay, + \c!line=1, + \c!separator=, + \c!width=\v!broad, + \c!distance=, % empty = signal + \c!hoffset=\zeropoint, + \c!style=\@@imstyle, + \c!color=\@@imcolor, + \c!strut=\@@imstrut, + \c!location=\@@imlocation, + \c!align=\@@imalign, + \c!before=\@@imbefore, + \c!after=\@@imafter]} + +\newdimen\naturalmargincontentheight + +\def\makemargintextblock#1#2#3% width l r content + {\bgroup + \forgetall % added, else problems with 'center' and nested itemize + \dontcomplain + \hsize\getvalue{\??im#1\c!width}\relax + \doifnumberelse\margincontenttag + {\ifcase\margincontenttag\relax + \edef\margincontenttag{#1}% first one is setups id as well + \fi} + \donothing + \doifnumberelse\margincontenttag + {\ifnum\margincontenttag>25 % to be translated + \writestatus\m!systems{potential margin stack overflow (\margincontenttag)}% + \fi} + \donothing + % we need to preserve {a,b,c} kind of settings + \let\margincontentalign#1% + \processallactionsinset + [\getvalue{\??im\margincontenttag\c!align}] + [ \v!yes=>\let\margincontentalign#1, + \v!no=>\let\margincontentalign\v!normal, + \v!inner=>\let\margincontentalign#1, + \v!outer=>\let\margincontentalign#2, + \v!left=>\let\margincontentalign\v!left, + \v!middle=>\let\margincontentalign\v!middle, + \v!right=>\let\margincontentalign\v!right]% + \doifvaluesomething{\??im\margincontenttag\c!align} % watch {} around set + {\edef\margincontentalign{{\getvalue{\??im\margincontenttag\c!align},\margincontentalign}}}% + % + \expanded{\getparameters[\??im\margincontenttag][\c!align=\margincontentalign]}% + % + \edef\margincontentstrut{\getvalue{\??im\margincontenttag\c!strut}}% + \savestrut % + \setbox\scratchbox\vbox\localframed + [\??im\margincontenttag] + [\c!strut=\v!no,\c!offset=\v!overlay] % strut handled internally + {\decrement\margincontentlines + \dorecurse\margincontentlines{\savedstrut\endgraf\nointerlineskip}% ! savedstrut + \@@imbefore + \dostartattributes{\??im\margincontenttag}\c!style\c!color\empty + \dosetupstrut[\margincontentstrut]% was: \setstrut % yes or no + \begstrut#3\endstrut\endgraf + \xdef\margincontentstrutheight{\the\strutht}% so that it's known outside the framed + \dostopattributes + \@@imafter}% + \global \naturalmargincontentheight\ht\scratchbox + \global\advance\naturalmargincontentheight\dp\scratchbox + \doif\@@imstack\v!yes + {\def\overlappingmargin{-20\scaledpoint}% test value, maybe .25\strutboxdp, maybe configurable + \setbox\scratchbox\vbox{\stackeddown\vbox{\box\scratchbox}}}% new + \ht\scratchbox\strutht + \dp\scratchbox\strutdp % nieuw + \box\scratchbox + \egroup} + +%D The stacker permits constructs like: +%D +%D \starttyping +%D \setupinmargin[stack=yes] +%D +%D \inleft{test 1}test\break +%D \inleft{test 2}test\break +%D \inleft{test 1} +%D \input tufte +%D \inleft{test 1} +%D \inleft{test 2} +%D \inleft{test 3} +%D \input tufte +%D \inleft{test 1} +%D \inleft{test 2\endgraf test 3} +%D \inleft{test 4} +%D \input tufte +%D \inleft{test 1} +%D \inleft{test 2\endgraf test 3} +%D \inleft{test 4\endgraf test 5\endgraf test 6} +%D \inleft{test 7\endgraf test 8\endgraf test 9} +%D \input tufte +%D \stoptyping + +%D This approach permits us to implement a better mechanism +%D later. We need the \type {\graphicvadjust} in order to +%D handle: +%D +%D \starttyping +%D \inleft{test} {\red \dorecurse{40}{test }\par} +%D {\red \inleft{test} \dorecurse{40}{test }\par} +%D \stoptyping +%D +%D The outer margin color is either black or color set as +%D main text color. + +\newif\ifrightmargin % documenteren + +\ifx\dopositionmarginbox\undefined + \def\dopositionmarginbox#1{\graphicvadjust{\box#1}} +\fi + +% watch out, margin dimensions are swapped locally (\swapmargins) + +% with \margincontentmethod one can control pagebreaks +% +% 0 no break +% 1 each entry is one line +% 2 only natural height +% 3 also stack height + +\chardef\margincontentmethod \plusthree % beware: 1 = old method +\chardef\marginpagecheckmethod\plusone + +\def\margincontentextralines{1} % old method, play safe +\def\nofmargincontentlines {0} + +\def\doplacemargintext#1#2#3#4% + {\dontcomplain + \strut + \doifsomething{#1} + {\def\margincontenttag{#1}}% + \doifinsetelse{\margincontenttag}{\v!left,\v!right} % ugly hack + {\let \margincontentdistance \empty % signal + \let \margincontenthoffset \zeropoint} + {\edef\margincontentdistance{\executeifdefined{\??im\margincontenttag\c!distance }\empty }% signal + \edef\margincontenthoffset {\executeifdefined{\??im\margincontenttag\c!hoffset }\zeropoint}}% + \edef\margincontentlines {\executeifdefined{\??im\margincontenttag\c!line }\plusone }% + \edef\margincontentseparator {\executeifdefined{\??im\margincontenttag\c!separator}\donothing}% + \setbox\scratchbox\hbox{#4}% % todo: make sure that color stack works + \ifcase\margincontentmethod + \scratchdimen\zeropoint + \or % old method + \scratchdimen\ht\scratchbox + \advance\scratchdimen\dp\scratchbox + \or + \scratchdimen\naturalmargincontentheight + \or + \scratchdimen\naturalmargincontentheight + \ifx\laststackvmove\undefined\else\global\advance\scratchdimen\laststackvmove\fi + \fi + \ifdim\scratchdimen>\margincontentheight + \global\margincontentheight\scratchdimen + \fi + \setbox\scratchbox\hbox + {#2{\hskip#3\strut + \ifcase\margincontentdisplacement + % normal, move strutheight up + \scratchdimen\strutdp + \advance\scratchdimen \margincontentstrutheight + \advance\scratchdimen -\strutht + \raise\scratchdimen + \or + % low, obey vadjust + \fi + \box\scratchbox}}% + \ht\scratchbox\zeropoint + \dp\scratchbox\zeropoint + \gdef\margincontentstrutheight{\the\strutht}% + %\graphicvadjust{\box\scratchbox}} % fails in high math lines, let it be + %\hbox{\lower\strutdp\box\scratchbox}} % alas, wrong lapping, therefore useless + \dopositionmarginbox\scratchbox} + +% \def\domarginblockskip#1% +% {\hskip\margincontenthoffset +% \hskip\compensatedinnermakeupmargin\relax +% \doifelsenothing\margincontentdistance +% {\hskip\getvalue{\??im#1\c!distance}} +% {\hskip\margincontentdistance}% +% \relax} + +\def\domarginblockskip#1% + {\doifelsenothing\margincontentdistance + {\hskip\dimexpr + +\margincontenthoffset + +\compensatedinnermakeupmargin + +\csname\??im#1\c!distance\endcsname + \relax} + {\dimexpr + +\margincontenthoffset + +\compensatedinnermakeupmargin + +\margincontentdistance + \relax}% + \relax} + +\def\doleftmarginblock#1#2% + {\doplacemargintext{#1}\llap\zeropoint + {\llap{\placemargincontentseparator}% + \makemargintextblock\v!left\v!right{#2}% + \domarginblockskip\v!left}} + +\def\dorightmarginblock#1#2% + {\doplacemargintext{#1}\rlap\hsize + {\hskip\textwidth\hskip-\hsize % new: hsize correction + \domarginblockskip\v!right + \makemargintextblock\v!right\v!left{#2}% + \rlap{\placemargincontentseparator}}} + +\def\placemargincontentseparator + {\ifnum\margincontentlevel>\zerocount + \ifx\margincontentseparator\empty\else + \bgroup + \scratchdimen\margincontentlines\lineheight + \advance\scratchdimen -\lineheight + \lower\scratchdimen\hbox{\margincontentseparator}% + \egroup + \fi + \fi} + +\newbox\marginconstructbox + +\def\doinmarginswapped#1#2#3#4% + {\iffirstsidefloatparagraph\nowhitespace\fi % zo laat mogelijk + \setbox\marginconstructbox\hbox\bgroup % prevents page break in the middle of construction + \startsignalrightpage + \doifswappedrightpageelse + {\rightmargintrue #2} + {\rightmarginfalse#1} + {#3}% setups + {#4}% content + \stopsignalrightpage + \egroup + \unhbox\marginconstructbox} + +% history made this a bit complicated, the +/- was needed before +% we had enough mem/hash to do the page correction + +\edef\inmargintaglist{+,-,\v!low,\v!left,\v!right,\v!inner,\v!outer} + +% the old one: +% +% \def\doinmargin[#1][#2][#3][#4][#5]% #6 #7 +% {\doifcommonelse{+,-,\v!laag}{#4} +% {\dodoinmargin[#1][#2][#3][#4][#5]} +% {\dodoinmargin[#1][#2][#3][][#4]}} +% +% an alternative: +% +% \letvalue{\??im\v!laag\c!offset}\empty +% \letvalue{\??im +\c!offset}\empty +% \letvalue{\??im -\c!offset}\empty +% +% \def\doinmargin[#1][#2][#3][#4][#5]% #6 #7 +% {\doifnumberelse{#4} +% {\dodoinmargin[#1][#2][#3][#4][#5]} +% {\doifdefinedelse{\??im#4\c!offset} +% {\dodoinmargin[#1][#2][#3][#4][#5]} +% {\dodoinmargin[#1][#2][#3][][#4]}}} +% +% the problem is that we need to keep downward compatibility +% with respect to the first argument thing a reference or a +% directive; the alternative is to force users to pass a +% directive along with a reference; anyhow, as long as one +% does not use references that have the same name as a +% directive we can use the (slow) alternative + +\def\doinmargin[#1][#2][#3][#4][#5]% #6 #7 + {\expanded{\doifinsetelse{#4}{\inmargintaglist}} + {\dodoinmargin[#1][#2][#3][#4][#5]} + {\dodoinmargin[#1][#2][#3][][#4]}} + +\def\defineinmargin + {\doquadrupleempty\dodefineinmargin} + +\def\dodefineinmargin[#1][#2][#3][#4]% + {\doifassignmentelse{#4} + {\setupinmargin[#1][#4]% + \setvalue{#1}{\indentation\doquintupleempty\doinmargin[#2][#3][#1]}} + {\setvalue{#1}{\indentation\doquintupleempty\doinmargin[#2][#3][#4]}}} + +\defineinmargin [inleft] [\v!left] [\v!normal] % takes left settings +\defineinmargin [inright] [\v!right] [\v!normal] % takes right settings +\defineinmargin [ininner] [\v!inner] [\v!normal] % takes left/right settings +\defineinmargin [inouter] [\v!outer] [\v!normal] % takes left/right settings +\defineinmargin [inmargin] [\@@imlocation] [\v!normal] % takes left/right settings +\defineinmargin [inother] [\@@imlocation] [\v!reverse] % takes left/right settings + +\def\inothermargin{\inother} + +%D This permits definitions like: +%D +%D \starttyping +%D \defineinmargin [SomePlace] [inner] [normal] [distance=1cm] +%D \defineinmargin [SomePlace] [inner] [normal] [SomePlace] \setupinmargin[SomePlace][distance=1cm] +%D \defineinmargin [MyPlace] [inner] [normal] [SomePlace] +%D \defineinmargin [YourPlace] [inner] [normal] [SomePlace] +%D \stoptyping +%D +%D A torture test: +%D +%D \starttyping +%D \startbuffer +%D \inleft {\TestLine{red} {l}} test test test \par +%D \inright {\TestLine{green} {r}} test test test \par +%D \inmargin {\TestLine{blue} {m}} test test test \par +%D \inothermargin{\TestLine{yellow} {x}} test test test \par +%D \ininner {\TestLine{cyan} {i}} test test test \par +%D \inouter {\TestLine{magenta}{o}} test test test \par +%D \stopbuffer +%D +%D \dorecurse{80}\getbuffer \page +%D \stoptyping +%D +%D and +%D +%D \starttyping +%D \defineinmargin [InOuterA] [outer] [normal] [distance=0cm] +%D \defineinmargin [InOuterB] [outer] [normal] [distance=1cm] +%D \defineinmargin [InOuterC] [outer] [normal] [distance=2cm,line=2] +%D +%D \startbuffer +%D \InOuterA{\TestLine{red} {A}} test test test \par +%D \InOuterB{\TestLine{green}{B}} test test test \par +%D \InOuterC{\TestLine{blue} {C}} test test test \par +%D \stopbuffer +%D +%D \dorecurse{80}\getbuffer \page +%D +%D \dorecurse{10}{\inleft {one} test \inleft {two} test } \page +%D +%D \start +%D \margintext {one} \margintext {two} \input thuan \par +%D \setupinmargin[1][line=3,distance=1cm] +%D \margintext [1]{one} +%D \margintext [2]{two} +%D \input thuan \page +%D \stop +%D +%D \setupinmargin[3][location=inner,distance=1cm] +%D \setupinmargin[4][location=outer,distance=2cm] +%D +%D % \setupinmargin[left] [line=2] +%D % \setupinmargin[right][line=2] +%D +%D \dorecurse +%D {10} +%D {\margintext {\kern3cm\TestLine{blue}{none}} +%D \margintext[3] {\TestLine{darkgray}{3}} +%D \margintext[4] {\TestLine{darkgray}{4}} +%D \margintext[left] {\TestLine{red} {left}} +%D \margintext[right]{\TestLine{green} {right}} +%D \margintext[inner]{\TestLine{cyan} {inner}} +%D \margintext[outer]{\TestLine{magenta} {outer}} +%D \input thuan \endgraf} +%D +%D \dorecurse{10}{\margintext{test\\test\\test} \input thuan \endgraf} +%D \stoptyping + +% Test case: +% +% \setuppagenumbering[alternative=doublesided] \setupwhitespace[medium] +% +% \placefigure[right]{}{\externalfigure[dummy][width=2cm]} +% \input tufte \inothermargin{test} \input tufte + +% \def\dodoinmargin[#1][#2][#3][#4][#5]#6% +% {\bgroup +% \forgetall % otherwise sidefloat problems, added 2005/07/20, maybe dangerous +% \postponenotes % group is (somehow) needed +% \doifinsetelse\v!low{#4} +% {\chardef\margincontentdisplacement\plusone} +% {\chardef\margincontentdisplacement\zerocount}% +% \doif\v!reverse{#2} +% {\swapmacros\dorightmarginblock\doleftmarginblock}% +% \processaction +% [#1] +% [ \v!left=>\let\next\doleftmarginblock, % no swapping +% \v!right=>\let\next\dorightmarginblock, % no swapping +% \v!inner=>\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }, +% \v!outer=>\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}, +% \s!unknown=>\ifdoublesided +% \doifcommonelse{+,-}{#4} +% {\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }} +% {\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}}% +% \else +% \let\next\doleftmarginblock +% \fi]% +% \next{#3}{#6}% +% \rawpagereference\s!mar{#5}% naar binnen ! ! ! ! +% \flushnotes +% \egroup % don't forget the group +% \ignorespaces} + +% test first +% +% setupsystem[random=1235] +% +% \setupinmargin[left][sidemethod=3] +% \dorecurse{10}{test \fakewords{20}{40} test \inleft{test\\test} test \fakewords{20}{40} \par} +% \page +% \setupinmargin[left][sidemethod=4] +% \dorecurse{40}{test \fakewords{50}{80} test \inleft{test\\test} \par} +% \page + +\def\dodoinmargin[#1][#2][#3][#4][#5]#6% + {\bgroup +% \tracingall + % old stuff, a bit tricky, but now interfaced + \edef\currentmargincontent{#1}% + \chardef\marginrepositionmethod\executeifdefined{\??im\currentmargincontent\c!sidemethod }\plusone + \chardef\margincontentmethod \executeifdefined{\??im\currentmargincontent\c!textmethod }\plusthree + \chardef\marginpagecheckmethod \executeifdefined{\??im\currentmargincontent\c!splitmethod}\plusone + % so far + \forgetall % otherwise sidefloat problems, added 2005/07/20, maybe dangerous + \postponenotes % group is (somehow) needed + \doifinsetelse\v!low{#4} + {\chardef\margincontentdisplacement\plusone} + {\chardef\margincontentdisplacement\zerocount}% + \doif\v!reverse{#2} + {\swapmacros\dorightmarginblock\doleftmarginblock}% + \processaction + [#1] + [ \v!left=>\let\next\doleftmarginblock, % no swapping + \v!right=>\let\next\dorightmarginblock, % no swapping + \v!inner=>\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }, + \v!outer=>\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}, + \s!unknown=>\ifdoublesided + \doifcommonelse{+,-}{#4} + {\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }} + {\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}}% + \else + \let\next\doleftmarginblock + \fi]% + \next{#3}{#6}% + \rawpagereference\s!mar{#5}% naar binnen ! ! ! ! + \flushnotes + \egroup % don't forget the group + \ignorespaces} + +% dit zijn voorlopig lokale commando's / vervallen +% +% \def\woordinmarge {\indentation\doquintupleempty\doinmargin[\@@implaats][\inleftmargin][\inrightmarge]} +% +% \def\woordinlinker {\inleftmargin } % vervallen +% \def\woordinrechter{\inrechtermarge} % vervallen + +% Some day: \definemarking[\v!margetitel] + +%D Now come the margin text collectors. The collected content is +%D flushed at every paragraph by the following macro. Note for +%D myself: here the location (plaats) is no longer a tag (number). + +% gone: \def\doflushmargincontent{\doinmargin[\@@implaats][\v!normaal][]} % + [#1][#2]{#3}} + +%D These are now all the same (long ago they had different +%D implementations, somewhere in Sork time if I remember +%D right). + +\def\margintext {\dodoubleempty\domargincontent} +\def\marginword {\margintext} +\def\margintitle{\margintext} % txt mark as well + +\newtoks\collectedmargintexts % so .. delayed! +\chardef\margintextcollected \zerocount + +\def\domargincontent[#1][#2]#3% we used to check for #2/#1 being number, no longer now + {\global\chardef\margintextcollected\plusone + \edef\margincontenttag{#1}% + \ifx\margincontenttag\empty + \global\advance\margincontentlevel\plusone + \edef\margincontenttag{\number\margincontentlevel}% + \fi + \checkinmargin[\margincontenttag]% + \doglobal \appendetoks + \noexpand \checkinmargin[\margincontenttag]% + \noexpand \doinmargin[\executeifdefined{\??im\margincontenttag\c!location}\@@imlocation][\v!normal][\margincontenttag][\margincontenttag][#2]% + \to \collectedmargintexts + \doglobal \appendtoks + {#3}% + \to \collectedmargintexts} + +\let\restoreinterlinepenalty\relax + +\def\flushmargincontents % plural + {\restoreinterlinepenalty % here? + \ifcase\margintextcollected\else % called quite often, so we + \expandafter\doflushmargincontents % speed up the \fi scan by + \fi} % using a \do.. + +\def\doflushmargincontents % links + rechts + {\bgroup + \forgetall + \global\margincontentheight\zeropoint + \startsignalrightpage + \the\collectedmargintexts + \signalrightpage + \stopsignalrightpage + \resetmargincontent + % dirty tricks + \ifcase\margincontentmethod + \donefalse + \else\ifinsidecolumns % brrrr + \donetrue % how fuzzy + \else\ifdim\margincontentheight>\lineheight\relax + \donetrue % how dirty + \else + \donefalse % how needed + \fi\fi\fi + \savemargincontentlines + \ifdone + \advance\margincontentheight \margincontentextralines\lineheight + \ifdim\pagegoal>\pagetotal + \bgroup % preserve \margincontentheight + \advance\margincontentheight \pagetotal + \ifdim\margincontentheight>\pagegoal + \egroup + \ifcase\marginpagecheckmethod + % disabled + \or + \setmargincontentpenalties + \or + % potentially dangerous, maybe better a \goodbreak; the problem is that + % there can be a penalty there, which we then overload and we also introduce + % nasty side effects, so, we drop this option + % \vadjust pre {\page}% + \fi + \else + \egroup + \fi + \fi + \else % We need the above because interlinepenalties overrule vadjusted \nobreaks. + % a bit dangerous + \vadjust{\nobreak}% + \fi + \egroup} + +\def\setmargincontentpenalties + {\getnoflines\margincontentheight + \keeplinestogether\noflines} + +\def\savemargincontentlines + {\bgroup + \advance\margincontentheight \margincontentextralines\lineheight % 1 by default + \getnoflines\margincontentheight + \xdef\nofmargincontentlines{\the\noflines}% + \egroup} + +\def\fillupmargincontentlines % etex ! ! ! + {\endgraf + \begingroup + \scratchcounter\numexpr\nofmargincontentlines-\prevgraf\relax\relax + \ifnum\scratchcounter>\zerocount + \forgetall\dorecurse\scratchcounter{\nobreak\crlf}% + \fi + \endgroup} + +% Yet undocumented, for a manual flush in for instance headers. + +\def\resetmargincontent + {\global\margincontentlevel\zerocount + \global\chardef\margintextcollected\zerocount + \global\collectedmargintexts\emptytoks} + +% \def\placemargincontent +% {\ifcase\margintextcollected\else +% \bgroup +% \chardef\graphicvadjustmode\zerocount +% \doflushmargincontents +% \egroup +% \fi} +% +% font fix: + +\def\placemargincontent + {\ifcase\margintextcollected\else % was level check + \bgroup + \redoconvertfont % !! + \chardef\graphicvadjustmode\zerocount + \doflushmargincontents + \egroup + \fi} + +% For old times sake (i use it in project styles) we provide + +\def\placemargintexts {\placemargincontent} +\def\resetmargetitels {\resetmargincontent} +\def\margewoordpositie{\margewoord} % obsolete, now no longer range + +% but never use them yourself since they may disappear. + +\def\oplinker#1% + {\strut + \graphicvadjust + {\dontcomplain + \setbox\scratchbox\vtop{\forgetall\strut#1}% + \getboxheight\scratchdimen\of\box\scratchbox + \vskip-\scratchdimen % waarom stond hier een \ ? + \box\scratchbox}} + +\setupinmargin + [\c!style=\v!bold, + \c!color=, + \c!strut=\v!auto, + \c!location=\v!both, + \c!align=\v!inner, + \c!stack=\v!no, + \c!before=, + \c!after=] + +\setupinmargin + [\v!left] + [\c!distance=\leftmargindistance, + \c!width=\leftmarginwidth, + %\c!align=\v!left, % no + \c!location=\v!left] + +\setupinmargin + [\v!right] + [\c!distance=\rightmargindistance, + \c!width=\rightmarginwidth, + %\c!align=\v!right, % no + \c!location=\v!right] + +% bonus needed when [inner/outer] is used as tag + +\setupinmargin[\v!inner][\c!location=\v!inner,\c!align=\v!inner] +\setupinmargin[\v!outer][\c!location=\v!outer,\c!align=\v!inner] + +% more efficient (5K less fotmat file) +% +% \letvalue{\??im\v!inner\c!location}\v!inner \letvalue{\??im\v!inner\c!align}\v!inner +% \letvalue{\??im\v!outer\c!location}\v!outer \letvalue{\??im\v!outer\c!align}\v!inner + +\protect \endinput diff --git a/tex/context/base/page-mar.mkiv b/tex/context/base/page-mar.mkiv new file mode 100644 index 000000000..28f82efe5 --- /dev/null +++ b/tex/context/base/page-mar.mkiv @@ -0,0 +1,838 @@ +%D \module +%D [ file=page-mar, % moved here from main-001 +%D version=1997.03.31, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Marginal Things, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Support for margin words is one of the reasons for writing +%D \CONTEXT. Over time support for marginal content has been +%D extended en enhanced. Therefore it's always good to watch +%D out for unexpected side effects. + +\writestatus{loading}{ConTeXt Page Macros / Maginal Things} + +\unprotect + +%D There are three categories and their historically grown meaning is +%D as follows: +%D +%D marginlines: these are flushed relative to the start of a line and +%D need to be invoked there. +%D +%D marginwords: these can be issued in the text flow and will migrate +%D sidewards; in spite of the name, it can be a paragraph of text as +%D well, but normally it's words. +%D +%D margintexts: these can be set beforehand and are flushed at the +%D next paragraph of text (of header) +%D +%D While these mechanisms were rather separated, they now are slightly +%D more integrated. Instead of low level instances we now have a mechanism +%D for defining additional ones. + +%D \macros +%D {inleftedge,inleftmargin,inrightmargin,inrightedge} +%D +%D The fast and clean way of putting things in the margin is +%D using \type{\rlap} or \type{\llap}. Unfortunately these +%D macro's don't handle indentation, left and right skips. We +%D therefore embed them in some macro's that (force and) +%D remove the indentation and restore it afterwards. + +\def\definemarginline + {\dodoubleargument\dodefinemarginline} + +\def\dodefinemarginline[#1][#2]% + {\getparameters + [\??im\??im#1] + [\c!location=\v!left, + \c!distance=\zeropoint, + \c!width=\leftmarginwidth, + \c!hoffset=\leftmargindistance, + \c!command=, + #2]% + \unexpanded\setvalue{#1}{\dohandlemarginline{#1}}} + +\def\marginlineparameter #1{\csname\??im\??im\currentmarginline#1\endcsname} +\def\marginlineexecuter #1#2{\executeifdefined{\??im\??im\currentmarginline#1}{#2}} + +\def\dohandlemarginline#1% #2 + {\def\currentmarginline{#1}% + \csname\s!do\??im\??im\executeifdefined{\??im\??im#1\c!location}\v!left\endcsname{#1}} % {#2} + +\def\doleftmarginline#1#2% #1 is redundant (we can remove it when we group dohandlemarginline; maybe ... + {\pushindentation + \llap + {\def\currentmarginline{#1}% + \postsignalrightpage + \hsize\marginlineparameter\c!width\relax + \marginlineexecuter\c!command\firstofoneargument{#2}\relax + \hskip\dimexpr + +\leftskip + +\compensatedinnermakeupmargin + +\marginlineparameter\c!hoffset + +\marginlineparameter\c!distance + \relax}% + \popindentation + \ignorespaces} + +\def\dorightmarginline#1#2% #1 is redundant + {\pushindentation + \rlap + {\def\currentmarginline{#1}% + \postsignalrightpage + \hskip\dimexpr + +\hsize + -\rightskip + +\compensatedinnermakeupmargin + +\marginlineparameter\c!hoffset + +\marginlineparameter\c!distance + \relax + \hsize\marginlineparameter\c!width + \marginlineexecuter\c!command\firstofoneargument{#2}}% + \popindentation + \ignorespaces} + +\long\def\installmarginlinehandler#1#2{\setvalue{\s!do\??im\??im#1}{#2}} + +\installmarginlinehandler \v!left {\doleftmarginline} +\installmarginlinehandler \v!right {\dorightmarginline} +\installmarginlinehandler \v!inner {\presignalrightpage\doifrightpageelse\doleftmarginline \dorightmarginline} +\installmarginlinehandler \v!outer {\presignalrightpage\doifrightpageelse\dorightmarginline\doleftmarginline } + +\definemarginline[inleftmargin] [\c!location=\v!left, \c!width=\leftmarginwidth, \c!distance=\leftmargindistance, \c!hoffset=\zeropoint] +\definemarginline[inrightmargin][\c!location=\v!right,\c!width=\rightmarginwidth,\c!distance=\rightmargindistance,\c!hoffset=\zeropoint] +\definemarginline[inleftedge] [\c!location=\v!left, \c!width=\leftedgewidth, \c!distance=\leftedgedistance, \c!hoffset=\leftmargintotal] +\definemarginline[inrightedge] [\c!location=\v!right,\c!width=\rightedgewidth, \c!distance=\rightedgedistance, \c!hoffset=\rightmargintotal] + +\definemarginline[inoutermargin][\c!location=\v!outer,\c!width=\outermarginwidth,\c!distance=\outermargindistance,\c!hoffset=\zeropoint] +\definemarginline[ininnermargin][\c!location=\v!inner,\c!width=\innermarginwidth,\c!distance=\innermargindistance,\c!hoffset=\zeropoint] +\definemarginline[inouteredge] [\c!location=\v!outer,\c!width=\outeredgewidth, \c!distance=\outeredgedistance, \c!hoffset=\outermargintotal] +\definemarginline[ininneredge] [\c!location=\v!inner,\c!width=\inneredgewidth, \c!distance=\inneredgedistance, \c!hoffset=\innermargintotal] + +\definemarginline[atleftmargin] [\c!location=\v!left, \c!command=\lrlap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint] +\definemarginline[atrightmargin][\c!location=\v!right,\c!command=\rllap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint] + +\ifx\lrlap\undefined \def\lrlap#1{\llap{\rlap{#1}}} \fi +\ifx\rllap\undefined \def\rllap#1{\rlap{\llap{#1}}} \fi + +\def\lrlap#1{\llap{\rlap{#1}}} +\def\rllap#1{\rlap{\hskip\hsize\llap{#1}}} + +%D We want to keep things efficient and therefore only handle +%D situations like: +%D +%D \startbuffer +%D \inleftedge {fine} some text \par +%D \strut \inleftmargin {fine} some text \par +%D \noindent \inrightmargin {fine} some text \par +%D \noindent \strut \inrightedge {fine} some text \par +%D \stopbuffer +%D +%D \typebuffer +%D +%D which looks like: +%D +%D \bgroup +%D \getbuffer +%D \parindent 30pt +%D \getbuffer +%D \egroup +%D +%D A torture test: +%D +%D \starttyping +%D \def\TestLine#1#2{\backgroundline[#1]{\strut\white\tttf#2~\recurselevel}} +%D +%D \startbuffer +%D \inleftmargin {\TestLine{red} {lm}} test test test \par +%D \inrightmargin{\TestLine{green} {rm}} test test test \par +%D \inleftedge {\TestLine{red} {le}} test test test \par +%D \inrightedge {\TestLine{green} {re}} test test test \par +%D \inoutermargin{\TestLine{blue} {om}} test test test \par +%D \ininnermargin{\TestLine{yellow}{im}} test test test \par +%D \inouteredge {\TestLine{blue} {oe}} test test test \par +%D \ininneredge {\TestLine{yellow}{ie}} test test test \par +%D \atleftmargin {\TestLine{red} {alm}} \hfill test \par +%D \atrightmargin{\TestLine{green} {arm}} test \hfill \par +%D \stopbuffer +%D +%D \dorecurse{40}\getbuffer \page +%D \stoptyping + +%D New, yet undocumented: +%D +%D used for pascal: +%D +%D \starttyping +%D \index {test} test \index {west} west \index {rest} rest +%D +%D \startnarrower +%D \placeregister[index][alternative=b,command=\atleftmargin] +%D \stopnarrower +%D \stoptyping + +% todo: compensate distance when setuplayout[textwidth=..] +% todo: generalize margin/edge model, now too much duplication + +%D The next bunch of macros looks messy which is due to its +%D multi-purpose character. + +\chardef\margincontentdisplacement \zerocount +\let \margincontentdistance \!!zeropoint +\let \margincontenthoffset \!!zeropoint +\def \margincontentlines {1} +\def \margincontenttag {0} +\let \margincontentseparator \empty +\def \margincontentstrutheight {\strutht} + +\newcount\margincontentlevel +\newdimen\margincontentheight + +\def\setupinmargin + {\dodoubleempty\dosetupinmargin} + +\def\dosetupinmargin[#1][#2]% + {\ifsecondargument + \processcommalist[#1]{\dodosetupinmargin[#2]}% becomes [#2]{##1} + \else + \getparameters[\??im][#1]% + \fi} + +% \def\dodosetupinmargin[#1]#2% [settings]{class} +% {\checkinmargin[#2]% +% \getparameters[\??im#2][#1]} + +\def\dodosetupinmargin[#1]#2% [settings]{class} + {\checkinmargin[#2]% + \getparameters[\??im#2][#1]% + % will become an \everyinmarginsetup thing + \ifcase\executeifdefined{\??im#2\c!sidemethod}{0}\else + \positioningtrue \positioningpartrue % global ? + \fi} + +\def\checkinmargin[#1]% + {\ifcsname\??im#1\c!offset\endcsname\else % this offset is related to framed ! + \addtocommalist{#1}\inmargintaglist + \presetmargintext[#1]% + \fi} + +\def\presetmargintext[#1]% + {\presetlocalframed + [\??im#1]% + \getparameters + [\??im#1] + [\c!frame=\v!off, + \c!offset=\v!overlay, + \c!line=1, + \c!separator=, + \c!width=\v!broad, + \c!distance=, % empty = signal + \c!hoffset=\zeropoint, + \c!style=\@@imstyle, + \c!color=\@@imcolor, + \c!strut=\@@imstrut, + \c!location=\@@imlocation, + \c!align=\@@imalign, + \c!before=\@@imbefore, + \c!after=\@@imafter]} + +\newdimen\naturalmargincontentheight + +\def\makemargintextblock#1#2#3% width l r content + {\bgroup + \forgetall % added, else problems with 'center' and nested itemize + \dontcomplain + \hsize\getvalue{\??im#1\c!width}\relax + \doifnumberelse\margincontenttag + {\ifcase\margincontenttag\relax + \edef\margincontenttag{#1}% first one is setups id as well + \fi} + \donothing + \doifnumberelse\margincontenttag + {\ifnum\margincontenttag>25 % to be translated + \writestatus\m!systems{potential margin stack overflow (\margincontenttag)}% + \fi} + \donothing + % we need to preserve {a,b,c} kind of settings + \let\margincontentalign#1% + \processallactionsinset + [\getvalue{\??im\margincontenttag\c!align}] + [ \v!yes=>\let\margincontentalign#1, + \v!no=>\let\margincontentalign\v!normal, + \v!inner=>\let\margincontentalign#1, + \v!outer=>\let\margincontentalign#2, + \v!left=>\let\margincontentalign\v!left, + \v!middle=>\let\margincontentalign\v!middle, + \v!right=>\let\margincontentalign\v!right]% + \doifvaluesomething{\??im\margincontenttag\c!align} % watch {} around set + {\edef\margincontentalign{{\getvalue{\??im\margincontenttag\c!align},\margincontentalign}}}% + % + \expanded{\getparameters[\??im\margincontenttag][\c!align=\margincontentalign]}% + % + \edef\margincontentstrut{\getvalue{\??im\margincontenttag\c!strut}}% + \savestrut % + \setbox\scratchbox\vbox\localframed + [\??im\margincontenttag] + [\c!strut=\v!no,\c!offset=\v!overlay] % strut handled internally + {\decrement\margincontentlines + \dorecurse\margincontentlines{\savedstrut\endgraf\nointerlineskip}% ! savedstrut + \@@imbefore + \dostartattributes{\??im\margincontenttag}\c!style\c!color\empty + \dosetupstrut[\margincontentstrut]% was: \setstrut % yes or no + \begstrut#3\endstrut\endgraf + \xdef\margincontentstrutheight{\the\strutht}% so that it's known outside the framed + \dostopattributes + \@@imafter}% + \global \naturalmargincontentheight\ht\scratchbox + \global\advance\naturalmargincontentheight\dp\scratchbox + \doif\@@imstack\v!yes + {\def\overlappingmargin{-20\scaledpoint}% test value, maybe .25\strutboxdp, maybe configurable + \setbox\scratchbox\vbox{\stackeddown\vbox{\box\scratchbox}}}% new + \ht\scratchbox\strutht + \dp\scratchbox\strutdp % nieuw + \box\scratchbox + \egroup} + +%D The stacker permits constructs like: +%D +%D \starttyping +%D \setupinmargin[stack=yes] +%D +%D \inleft{test 1}test\break +%D \inleft{test 2}test\break +%D \inleft{test 1} +%D \input tufte +%D \inleft{test 1} +%D \inleft{test 2} +%D \inleft{test 3} +%D \input tufte +%D \inleft{test 1} +%D \inleft{test 2\endgraf test 3} +%D \inleft{test 4} +%D \input tufte +%D \inleft{test 1} +%D \inleft{test 2\endgraf test 3} +%D \inleft{test 4\endgraf test 5\endgraf test 6} +%D \inleft{test 7\endgraf test 8\endgraf test 9} +%D \input tufte +%D \stoptyping + +%D This approach permits us to implement a better mechanism +%D later. We need the \type {\graphicvadjust} in order to +%D handle: +%D +%D \starttyping +%D \inleft{test} {\red \dorecurse{40}{test }\par} +%D {\red \inleft{test} \dorecurse{40}{test }\par} +%D \stoptyping +%D +%D The outer margin color is either black or color set as +%D main text color. + +\newif\ifrightmargin % documenteren + +\ifx\dopositionmarginbox\undefined + \def\dopositionmarginbox#1{\graphicvadjust{\box#1}} +\fi + +% watch out, margin dimensions are swapped locally (\swapmargins) + +% with \margincontentmethod one can control pagebreaks +% +% 0 no break +% 1 each entry is one line +% 2 only natural height +% 3 also stack height + +\chardef\margincontentmethod \plusthree % beware: 1 = old method +\chardef\marginpagecheckmethod\plusone + +\def\margincontentextralines{1} % old method, play safe +\def\nofmargincontentlines {0} + +\def\doplacemargintext#1#2#3#4% + {\dontcomplain + \strut + \doifsomething{#1} + {\def\margincontenttag{#1}}% + \doifinsetelse{\margincontenttag}{\v!left,\v!right} % ugly hack + {\let \margincontentdistance \empty % signal + \let \margincontenthoffset \zeropoint} + {\edef\margincontentdistance{\executeifdefined{\??im\margincontenttag\c!distance }\empty }% signal + \edef\margincontenthoffset {\executeifdefined{\??im\margincontenttag\c!hoffset }\zeropoint}}% + \edef\margincontentlines {\executeifdefined{\??im\margincontenttag\c!line }\plusone }% + \edef\margincontentseparator {\executeifdefined{\??im\margincontenttag\c!separator}\donothing}% + \setbox\scratchbox\hbox{#4}% % todo: make sure that color stack works + \ifcase\margincontentmethod + \scratchdimen\zeropoint + \or % old method + \scratchdimen\ht\scratchbox + \advance\scratchdimen\dp\scratchbox + \or + \scratchdimen\naturalmargincontentheight + \or + \scratchdimen\naturalmargincontentheight + \ifx\laststackvmove\undefined\else\global\advance\scratchdimen\laststackvmove\fi + \fi + \ifdim\scratchdimen>\margincontentheight + \global\margincontentheight\scratchdimen + \fi + \setbox\scratchbox\hbox + {#2{\hskip#3\strut + \ifcase\margincontentdisplacement + % normal, move strutheight up + \scratchdimen\strutdp + \advance\scratchdimen \margincontentstrutheight + \advance\scratchdimen -\strutht + \raise\scratchdimen + \or + % low, obey vadjust + \fi + \box\scratchbox}}% + \ht\scratchbox\zeropoint + \dp\scratchbox\zeropoint + \gdef\margincontentstrutheight{\the\strutht}% + %\graphicvadjust{\box\scratchbox}} % fails in high math lines, let it be + %\hbox{\lower\strutdp\box\scratchbox}} % alas, wrong lapping, therefore useless + \dopositionmarginbox\scratchbox} + +% \def\domarginblockskip#1% +% {\hskip\margincontenthoffset +% \hskip\compensatedinnermakeupmargin\relax +% \doifelsenothing\margincontentdistance +% {\hskip\getvalue{\??im#1\c!distance}} +% {\hskip\margincontentdistance}% +% \relax} + +\def\domarginblockskip#1% + {\doifelsenothing\margincontentdistance + {\hskip\dimexpr + +\margincontenthoffset + +\compensatedinnermakeupmargin + +\csname\??im#1\c!distance\endcsname + \relax} + {\dimexpr + +\margincontenthoffset + +\compensatedinnermakeupmargin + +\margincontentdistance + \relax}% + \relax} + +\def\doleftmarginblock#1#2% + {\doplacemargintext{#1}\llap\zeropoint + {\llap{\placemargincontentseparator}% + \makemargintextblock\v!left\v!right{#2}% + \domarginblockskip\v!left}} + +\def\dorightmarginblock#1#2% + {\doplacemargintext{#1}\rlap\hsize + {\hskip\textwidth\hskip-\hsize % new: hsize correction + \domarginblockskip\v!right + \makemargintextblock\v!right\v!left{#2}% + \rlap{\placemargincontentseparator}}} + +\def\placemargincontentseparator + {\ifnum\margincontentlevel>\zerocount + \ifx\margincontentseparator\empty\else + \bgroup + \scratchdimen\margincontentlines\lineheight + \advance\scratchdimen -\lineheight + \lower\scratchdimen\hbox{\margincontentseparator}% + \egroup + \fi + \fi} + +\newbox\marginconstructbox + +\def\doinmarginswapped#1#2#3#4% + {\iffirstsidefloatparagraph\nowhitespace\fi % zo laat mogelijk + \setbox\marginconstructbox\hbox\bgroup % prevents page break in the middle of construction + \startsignalrightpage + \doifswappedrightpageelse + {\rightmargintrue #2} + {\rightmarginfalse#1} + {#3}% setups + {#4}% content + \stopsignalrightpage + \egroup + \unhbox\marginconstructbox} + +% history made this a bit complicated, the +/- was needed before +% we had enough mem/hash to do the page correction + +\edef\inmargintaglist{+,-,\v!low,\v!left,\v!right,\v!inner,\v!outer} + +% the old one: +% +% \def\doinmargin[#1][#2][#3][#4][#5]% #6 #7 +% {\doifcommonelse{+,-,\v!laag}{#4} +% {\dodoinmargin[#1][#2][#3][#4][#5]} +% {\dodoinmargin[#1][#2][#3][][#4]}} +% +% an alternative: +% +% \letvalue{\??im\v!laag\c!offset}\empty +% \letvalue{\??im +\c!offset}\empty +% \letvalue{\??im -\c!offset}\empty +% +% \def\doinmargin[#1][#2][#3][#4][#5]% #6 #7 +% {\doifnumberelse{#4} +% {\dodoinmargin[#1][#2][#3][#4][#5]} +% {\doifdefinedelse{\??im#4\c!offset} +% {\dodoinmargin[#1][#2][#3][#4][#5]} +% {\dodoinmargin[#1][#2][#3][][#4]}}} +% +% the problem is that we need to keep downward compatibility +% with respect to the first argument thing a reference or a +% directive; the alternative is to force users to pass a +% directive along with a reference; anyhow, as long as one +% does not use references that have the same name as a +% directive we can use the (slow) alternative + +\def\doinmargin[#1][#2][#3][#4][#5]% #6 #7 + {\expanded{\doifinsetelse{#4}{\inmargintaglist}} + {\dodoinmargin[#1][#2][#3][#4][#5]} + {\dodoinmargin[#1][#2][#3][][#4]}} + +\def\defineinmargin + {\doquadrupleempty\dodefineinmargin} + +\def\dodefineinmargin[#1][#2][#3][#4]% + {\doifassignmentelse{#4} + {\setupinmargin[#1][#4]% + \setvalue{#1}{\indentation\doquintupleempty\doinmargin[#2][#3][#1]}} + {\setvalue{#1}{\indentation\doquintupleempty\doinmargin[#2][#3][#4]}}} + +\defineinmargin [inleft] [\v!left] [\v!normal] % takes left settings +\defineinmargin [inright] [\v!right] [\v!normal] % takes right settings +\defineinmargin [ininner] [\v!inner] [\v!normal] % takes left/right settings +\defineinmargin [inouter] [\v!outer] [\v!normal] % takes left/right settings +\defineinmargin [inmargin] [\@@imlocation] [\v!normal] % takes left/right settings +\defineinmargin [inother] [\@@imlocation] [\v!reverse] % takes left/right settings + +\def\inothermargin{\inother} + +%D This permits definitions like: +%D +%D \starttyping +%D \defineinmargin [SomePlace] [inner] [normal] [distance=1cm] +%D \defineinmargin [SomePlace] [inner] [normal] [SomePlace] \setupinmargin[SomePlace][distance=1cm] +%D \defineinmargin [MyPlace] [inner] [normal] [SomePlace] +%D \defineinmargin [YourPlace] [inner] [normal] [SomePlace] +%D \stoptyping +%D +%D A torture test: +%D +%D \starttyping +%D \startbuffer +%D \inleft {\TestLine{red} {l}} test test test \par +%D \inright {\TestLine{green} {r}} test test test \par +%D \inmargin {\TestLine{blue} {m}} test test test \par +%D \inothermargin{\TestLine{yellow} {x}} test test test \par +%D \ininner {\TestLine{cyan} {i}} test test test \par +%D \inouter {\TestLine{magenta}{o}} test test test \par +%D \stopbuffer +%D +%D \dorecurse{80}\getbuffer \page +%D \stoptyping +%D +%D and +%D +%D \starttyping +%D \defineinmargin [InOuterA] [outer] [normal] [distance=0cm] +%D \defineinmargin [InOuterB] [outer] [normal] [distance=1cm] +%D \defineinmargin [InOuterC] [outer] [normal] [distance=2cm,line=2] +%D +%D \startbuffer +%D \InOuterA{\TestLine{red} {A}} test test test \par +%D \InOuterB{\TestLine{green}{B}} test test test \par +%D \InOuterC{\TestLine{blue} {C}} test test test \par +%D \stopbuffer +%D +%D \dorecurse{80}\getbuffer \page +%D +%D \dorecurse{10}{\inleft {one} test \inleft {two} test } \page +%D +%D \start +%D \margintext {one} \margintext {two} \input thuan \par +%D \setupinmargin[1][line=3,distance=1cm] +%D \margintext [1]{one} +%D \margintext [2]{two} +%D \input thuan \page +%D \stop +%D +%D \setupinmargin[3][location=inner,distance=1cm] +%D \setupinmargin[4][location=outer,distance=2cm] +%D +%D % \setupinmargin[left] [line=2] +%D % \setupinmargin[right][line=2] +%D +%D \dorecurse +%D {10} +%D {\margintext {\kern3cm\TestLine{blue}{none}} +%D \margintext[3] {\TestLine{darkgray}{3}} +%D \margintext[4] {\TestLine{darkgray}{4}} +%D \margintext[left] {\TestLine{red} {left}} +%D \margintext[right]{\TestLine{green} {right}} +%D \margintext[inner]{\TestLine{cyan} {inner}} +%D \margintext[outer]{\TestLine{magenta} {outer}} +%D \input thuan \endgraf} +%D +%D \dorecurse{10}{\margintext{test\\test\\test} \input thuan \endgraf} +%D \stoptyping + +% Test case: +% +% \setuppagenumbering[alternative=doublesided] \setupwhitespace[medium] +% +% \placefigure[right]{}{\externalfigure[dummy][width=2cm]} +% \input tufte \inothermargin{test} \input tufte + +% test first +% +% setupsystem[random=1235] +% +% \setupinmargin[left][sidemethod=3] +% \dorecurse{10}{test \fakewords{20}{40} test \inleft{test\\test} test \fakewords{20}{40} \par} +% \page +% \setupinmargin[left][sidemethod=4] +% \dorecurse{40}{test \fakewords{50}{80} test \inleft{test\\test} \par} +% \page + +\def\dodoinmargin[#1][#2][#3][#4][#5]#6% + {\bgroup + % old stuff, a bit tricky, but now interfaced + \edef\currentmargincontent{#1}% + \chardef\marginrepositionmethod\executeifdefined{\??im\currentmargincontent\c!sidemethod }\plusone + \chardef\margincontentmethod \executeifdefined{\??im\currentmargincontent\c!textmethod }\plusthree + \chardef\marginpagecheckmethod \executeifdefined{\??im\currentmargincontent\c!splitmethod}\plusone + % so far + \forgetall % otherwise sidefloat problems, added 2005/07/20, maybe dangerous + \postponenotes % group is (somehow) needed + \doifinsetelse\v!low{#4} + {\chardef\margincontentdisplacement\plusone} + {\chardef\margincontentdisplacement\zerocount}% + \doif\v!reverse{#2} + {\swapmacros\dorightmarginblock\doleftmarginblock}% + \processaction + [#1] + [ \v!left=>\let\next\doleftmarginblock, % no swapping + \v!right=>\let\next\dorightmarginblock, % no swapping + \v!inner=>\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }, + \v!outer=>\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}, + \s!unknown=>\ifdoublesided + \doifcommonelse{+,-}{#4} + {\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }} + {\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}}% + \else + \let\next\doleftmarginblock + \fi]% + \next{#3}{#6}% + \pagereference[#5]% naar binnen ! ! ! ! + \flushnotes + \egroup % don't forget the group + \ignorespaces} + +% dit zijn voorlopig lokale commando's / vervallen +% +% \def\woordinmarge {\indentation\doquintupleempty\doinmargin[\@@implaats][\inleftmargin][\inrightmarge]} +% +% \def\woordinlinker {\inleftmargin } % vervallen +% \def\woordinrechter{\inrechtermarge} % vervallen + +% Some day: \definemarking[\v!margetitel] + +%D Now come the margin text collectors. The collected content is +%D flushed at every paragraph by the following macro. Note for +%D myself: here the location (plaats) is no longer a tag (number). + +% gone: \def\doflushmargincontent{\doinmargin[\@@implaats][\v!normaal][]} % + [#1][#2]{#3}} + +%D These are now all the same (long ago they had different +%D implementations, somewhere in Sork time if I remember +%D right). + +\def\margintext {\dodoubleempty\domargincontent} +\def\marginword {\margintext} +\def\margintitle{\margintext} % txt mark as well + +\newtoks\collectedmargintexts % so .. delayed! +\chardef\margintextcollected \zerocount + +\def\domargincontent[#1][#2]#3% we used to check for #2/#1 being number, no longer now + {\global\chardef\margintextcollected\plusone + \edef\margincontenttag{#1}% + \ifx\margincontenttag\empty + \global\advance\margincontentlevel\plusone + \edef\margincontenttag{\number\margincontentlevel}% + \fi + \checkinmargin[\margincontenttag]% + \doglobal \appendetoks + \noexpand \checkinmargin[\margincontenttag]% + \noexpand \doinmargin[\executeifdefined{\??im\margincontenttag\c!location}\@@imlocation][\v!normal][\margincontenttag][\margincontenttag][#2]% + \to \collectedmargintexts + \doglobal \appendtoks + {#3}% + \to \collectedmargintexts} + +\let\restoreinterlinepenalty\relax + +\def\flushmargincontents % plural + {\restoreinterlinepenalty % here? + \ifcase\margintextcollected\else % called quite often, so we + \expandafter\doflushmargincontents % speed up the \fi scan by + \fi} % using a \do.. + +\def\doflushmargincontents % links + rechts + {\bgroup + \forgetall + \global\margincontentheight\zeropoint + \startsignalrightpage + \the\collectedmargintexts + \signalrightpage + \stopsignalrightpage + \resetmargincontent + % dirty tricks + \ifcase\margincontentmethod + \donefalse + \else\ifinsidecolumns % brrrr + \donetrue % how fuzzy + \else\ifdim\margincontentheight>\lineheight\relax + \donetrue % how dirty + \else + \donefalse % how needed + \fi\fi\fi + \savemargincontentlines + \ifdone + \advance\margincontentheight \margincontentextralines\lineheight + \ifdim\pagegoal>\pagetotal + \bgroup % preserve \margincontentheight + \advance\margincontentheight \pagetotal + \ifdim\margincontentheight>\pagegoal + \egroup + \ifcase\marginpagecheckmethod + % disabled + \or + \setmargincontentpenalties + \or + % potentially dangerous, maybe better a \goodbreak; the problem is that + % there can be a penalty there, which we then overload and we also introduce + % nasty side effects, so, we drop this option + % \vadjust pre {\page}% + \fi + \else + \egroup + \fi + \fi + \else % We need the above because interlinepenalties overrule vadjusted \nobreaks. + % a bit dangerous + \vadjust{\nobreak}% + \fi + \egroup} + +\def\setmargincontentpenalties + {\getnoflines\margincontentheight + \keeplinestogether\noflines} + +\def\savemargincontentlines + {\bgroup + \advance\margincontentheight \margincontentextralines\lineheight % 1 by default + \getnoflines\margincontentheight + \xdef\nofmargincontentlines{\the\noflines}% + \egroup} + +\def\fillupmargincontentlines % etex ! ! ! + {\endgraf + \begingroup + \scratchcounter\numexpr\nofmargincontentlines-\prevgraf\relax\relax + \ifnum\scratchcounter>\zerocount + \forgetall\dorecurse\scratchcounter{\nobreak\crlf}% + \fi + \endgroup} + +% Yet undocumented, for a manual flush in for instance headers. + +\def\resetmargincontent + {\global\margincontentlevel\zerocount + \global\chardef\margintextcollected\zerocount + \global\collectedmargintexts\emptytoks} + +% \def\placemargincontent +% {\ifcase\margintextcollected\else +% \bgroup +% \chardef\graphicvadjustmode\zerocount +% \doflushmargincontents +% \egroup +% \fi} +% +% font fix: + +\def\placemargincontent + {\ifcase\margintextcollected\else % was level check + \bgroup + \redoconvertfont % !! + \chardef\graphicvadjustmode\zerocount + \doflushmargincontents + \egroup + \fi} + +% For old times sake (i use it in project styles) we provide + +\def\placemargintexts {\placemargincontent} +\def\resetmargetitels {\resetmargincontent} +\def\margewoordpositie{\margewoord} % obsolete, now no longer range + +% but never use them yourself since they may disappear. + +\def\oplinker#1% + {\strut + \graphicvadjust + {\dontcomplain + \setbox\scratchbox\vtop{\forgetall\strut#1}% + \getboxheight\scratchdimen\of\box\scratchbox + \vskip-\scratchdimen % waarom stond hier een \ ? + \box\scratchbox}} + +\setupinmargin + [\c!style=\v!bold, + \c!color=, + \c!strut=\v!auto, + \c!location=\v!both, + \c!align=\v!inner, + \c!stack=\v!no, + \c!before=, + \c!after=] + +\setupinmargin + [\v!left] + [\c!distance=\leftmargindistance, + \c!width=\leftmarginwidth, + %\c!align=\v!left, % no + \c!location=\v!left] + +\setupinmargin + [\v!right] + [\c!distance=\rightmargindistance, + \c!width=\rightmarginwidth, + %\c!align=\v!right, % no + \c!location=\v!right] + +% bonus needed when [inner/outer] is used as tag + +\setupinmargin[\v!inner][\c!location=\v!inner,\c!align=\v!inner] +\setupinmargin[\v!outer][\c!location=\v!outer,\c!align=\v!inner] + +% more efficient (5K less fotmat file) +% +% \letvalue{\??im\v!inner\c!location}\v!inner \letvalue{\??im\v!inner\c!align}\v!inner +% \letvalue{\??im\v!outer\c!location}\v!outer \letvalue{\??im\v!outer\c!align}\v!inner + +\protect \endinput diff --git a/tex/context/base/page-mar.tex b/tex/context/base/page-mar.tex deleted file mode 100644 index f7c5328f3..000000000 --- a/tex/context/base/page-mar.tex +++ /dev/null @@ -1,867 +0,0 @@ -%D \module -%D [ file=page-mar, % moved here from main-001 -%D version=1997.03.31, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Marginal Things, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Support for margin words is one of the reasons for writing -%D \CONTEXT. Over time support for marginal content has been -%D extended en enhanced. Therefore it's always good to watch -%D out for unexpected side effects. - -\writestatus{loading}{ConTeXt Page Macros / Maginal Things} - -\unprotect - -%D There are three categories and their historically grown meaning is -%D as follows: -%D -%D marginlines: these are flushed relative to the start of a line and -%D need to be invoked there. -%D -%D marginwords: these can be issued in the text flow and will migrate -%D sidewards; in spite of the name, it can be a paragraph of text as -%D well, but normally it's words. -%D -%D margintexts: these can be set beforehand and are flushed at the -%D next paragraph of text (of header) -%D -%D While these mechanisms were rather separated, they now are slightly -%D more integrated. Instead of low level instances we now have a mechanism -%D for defining additional ones. - -%D \macros -%D {inleftedge,inleftmargin,inrightmargin,inrightedge} -%D -%D The fast and clean way of putting things in the margin is -%D using \type{\rlap} or \type{\llap}. Unfortunately these -%D macro's don't handle indentation, left and right skips. We -%D therefore embed them in some macro's that (force and) -%D remove the indentation and restore it afterwards. - -\def\definemarginline - {\dodoubleargument\dodefinemarginline} - -\def\dodefinemarginline[#1][#2]% - {\getparameters - [\??im\??im#1] - [\c!location=\v!left, - \c!distance=\zeropoint, - \c!width=\leftmarginwidth, - \c!hoffset=\leftmargindistance, - \c!command=, - #2]% - \unexpanded\setvalue{#1}{\dohandlemarginline{#1}}} - -\def\marginlineparameter #1{\csname\??im\??im\currentmarginline#1\endcsname} -\def\marginlineexecuter #1#2{\executeifdefined{\??im\??im\currentmarginline#1}{#2}} - -\def\dohandlemarginline#1% #2 - {\def\currentmarginline{#1}% - \csname\s!do\??im\??im\executeifdefined{\??im\??im#1\c!location}\v!left\endcsname{#1}} % {#2} - -\def\doleftmarginline#1#2% #1 is redundant (we can remove it when we group dohandlemarginline; maybe ... - {\pushindentation - \llap - {\def\currentmarginline{#1}% - \postsignalrightpage - \hsize\marginlineparameter\c!width\relax - \marginlineexecuter\c!command\firstofoneargument{#2}\relax - \hskip\dimexpr - +\leftskip - +\compensatedinnermakeupmargin - +\marginlineparameter\c!hoffset - +\marginlineparameter\c!distance - \relax}% - \popindentation - \ignorespaces} - -\def\dorightmarginline#1#2% #1 is redundant - {\pushindentation - \rlap - {\def\currentmarginline{#1}% - \postsignalrightpage - \hskip\dimexpr - +\hsize - -\rightskip - +\compensatedinnermakeupmargin - +\marginlineparameter\c!hoffset - +\marginlineparameter\c!distance - \relax - \hsize\marginlineparameter\c!width - \marginlineexecuter\c!command\firstofoneargument{#2}}% - \popindentation - \ignorespaces} - -\long\def\installmarginlinehandler#1#2{\setvalue{\s!do\??im\??im#1}{#2}} - -\installmarginlinehandler \v!left {\doleftmarginline} -\installmarginlinehandler \v!right {\dorightmarginline} -\installmarginlinehandler \v!inner {\presignalrightpage\doifrightpageelse\doleftmarginline \dorightmarginline} -\installmarginlinehandler \v!outer {\presignalrightpage\doifrightpageelse\dorightmarginline\doleftmarginline } - -\definemarginline[inleftmargin] [\c!location=\v!left, \c!width=\leftmarginwidth, \c!distance=\leftmargindistance, \c!hoffset=\zeropoint] -\definemarginline[inrightmargin][\c!location=\v!right,\c!width=\rightmarginwidth,\c!distance=\rightmargindistance,\c!hoffset=\zeropoint] -\definemarginline[inleftedge] [\c!location=\v!left, \c!width=\leftedgewidth, \c!distance=\leftedgedistance, \c!hoffset=\leftmargintotal] -\definemarginline[inrightedge] [\c!location=\v!right,\c!width=\rightedgewidth, \c!distance=\rightedgedistance, \c!hoffset=\rightmargintotal] - -\definemarginline[inoutermargin][\c!location=\v!outer,\c!width=\outermarginwidth,\c!distance=\outermargindistance,\c!hoffset=\zeropoint] -\definemarginline[ininnermargin][\c!location=\v!inner,\c!width=\innermarginwidth,\c!distance=\innermargindistance,\c!hoffset=\zeropoint] -\definemarginline[inouteredge] [\c!location=\v!outer,\c!width=\outeredgewidth, \c!distance=\outeredgedistance, \c!hoffset=\outermargintotal] -\definemarginline[ininneredge] [\c!location=\v!inner,\c!width=\inneredgewidth, \c!distance=\inneredgedistance, \c!hoffset=\innermargintotal] - -\definemarginline[atleftmargin] [\c!location=\v!left, \c!command=\lrlap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint] -\definemarginline[atrightmargin][\c!location=\v!right,\c!command=\rllap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint] - -\ifx\lrlap\undefined \def\lrlap#1{\llap{\rlap{#1}}} \fi -\ifx\rllap\undefined \def\rllap#1{\rlap{\llap{#1}}} \fi - -\def\lrlap#1{\llap{\rlap{#1}}} -\def\rllap#1{\rlap{\hskip\hsize\llap{#1}}} - -%D We want to keep things efficient and therefore only handle -%D situations like: -%D -%D \startbuffer -%D \inleftedge {fine} some text \par -%D \strut \inleftmargin {fine} some text \par -%D \noindent \inrightmargin {fine} some text \par -%D \noindent \strut \inrightedge {fine} some text \par -%D \stopbuffer -%D -%D \typebuffer -%D -%D which looks like: -%D -%D \bgroup -%D \getbuffer -%D \parindent 30pt -%D \getbuffer -%D \egroup -%D -%D A torture test: -%D -%D \starttyping -%D \def\TestLine#1#2{\backgroundline[#1]{\strut\white\tttf#2~\recurselevel}} -%D -%D \startbuffer -%D \inleftmargin {\TestLine{red} {lm}} test test test \par -%D \inrightmargin{\TestLine{green} {rm}} test test test \par -%D \inleftedge {\TestLine{red} {le}} test test test \par -%D \inrightedge {\TestLine{green} {re}} test test test \par -%D \inoutermargin{\TestLine{blue} {om}} test test test \par -%D \ininnermargin{\TestLine{yellow}{im}} test test test \par -%D \inouteredge {\TestLine{blue} {oe}} test test test \par -%D \ininneredge {\TestLine{yellow}{ie}} test test test \par -%D \atleftmargin {\TestLine{red} {alm}} \hfill test \par -%D \atrightmargin{\TestLine{green} {arm}} test \hfill \par -%D \stopbuffer -%D -%D \dorecurse{40}\getbuffer \page -%D \stoptyping - -%D New, yet undocumented: -%D -%D used for pascal: -%D -%D \starttyping -%D \index {test} test \index {west} west \index {rest} rest -%D -%D \startnarrower -%D \placeregister[index][alternative=b,command=\atleftmargin] -%D \stopnarrower -%D \stoptyping - -% todo: compensate distance when setuplayout[textwidth=..] -% todo: generalize margin/edge model, now too much duplication - -%D The next bunch of macros looks messy which is due to its -%D multi-purpose character. - -\chardef\margincontentdisplacement \zerocount -\let \margincontentdistance \!!zeropoint -\let \margincontenthoffset \!!zeropoint -\def \margincontentlines {1} -\def \margincontenttag {0} -\let \margincontentseparator \empty -\def \margincontentstrutheight {\strutht} - -\newcount\margincontentlevel -\newdimen\margincontentheight - -\def\setupinmargin - {\dodoubleempty\dosetupinmargin} - -\def\dosetupinmargin[#1][#2]% - {\ifsecondargument - \processcommalist[#1]{\dodosetupinmargin[#2]}% becomes [#2]{##1} - \else - \getparameters[\??im][#1]% - \fi} - -% \def\dodosetupinmargin[#1]#2% [settings]{class} -% {\checkinmargin[#2]% -% \getparameters[\??im#2][#1]} - -\def\dodosetupinmargin[#1]#2% [settings]{class} - {\checkinmargin[#2]% - \getparameters[\??im#2][#1]% - % will become an \everyinmarginsetup thing - \ifcase\executeifdefined{\??im#2\c!sidemethod}{0}\else - \positioningtrue \positioningpartrue % global ? - \fi} - -\def\checkinmargin[#1]% - {\ifundefined{\??im#1\c!offset}% this offset is related to framed ! - \addtocommalist{#1}\inmargintaglist - \presetmargintext[#1]% - \fi} - -\def\presetmargintext[#1]% - {\presetlocalframed - [\??im#1]% - \getparameters - [\??im#1] - [\c!frame=\v!off, - \c!offset=\v!overlay, - \c!line=1, - \c!separator=, - \c!width=\v!broad, - \c!distance=, % empty = signal - \c!hoffset=\zeropoint, - \c!style=\@@imstyle, - \c!color=\@@imcolor, - \c!strut=\@@imstrut, - \c!location=\@@imlocation, - \c!align=\@@imalign, - \c!before=\@@imbefore, - \c!after=\@@imafter]} - -\newdimen\naturalmargincontentheight - -\def\makemargintextblock#1#2#3% width l r content - {\bgroup - \forgetall % added, else problems with 'center' and nested itemize - \dontcomplain - \hsize\getvalue{\??im#1\c!width}\relax - \doifnumberelse\margincontenttag - {\ifcase\margincontenttag\relax - \edef\margincontenttag{#1}% first one is setups id as well - \fi} - \donothing - \doifnumberelse\margincontenttag - {\ifnum\margincontenttag>25 % to be translated - \writestatus\m!systems{potential margin stack overflow (\margincontenttag)}% - \fi} - \donothing - % we need to preserve {a,b,c} kind of settings - \let\margincontentalign#1% - \processallactionsinset - [\getvalue{\??im\margincontenttag\c!align}] - [ \v!yes=>\let\margincontentalign#1, - \v!no=>\let\margincontentalign\v!normal, - \v!inner=>\let\margincontentalign#1, - \v!outer=>\let\margincontentalign#2, - \v!left=>\let\margincontentalign\v!left, - \v!middle=>\let\margincontentalign\v!middle, - \v!right=>\let\margincontentalign\v!right]% - \doifvaluesomething{\??im\margincontenttag\c!align} % watch {} around set - {\edef\margincontentalign{{\getvalue{\??im\margincontenttag\c!align},\margincontentalign}}}% - % - \expanded{\getparameters[\??im\margincontenttag][\c!align=\margincontentalign]}% - % - \edef\margincontentstrut{\getvalue{\??im\margincontenttag\c!strut}}% - \savestrut % - \setbox\scratchbox\vbox\localframed - [\??im\margincontenttag] - [\c!strut=\v!no,\c!offset=\v!overlay] % strut handled internally - {\decrement\margincontentlines - \dorecurse\margincontentlines{\savedstrut\endgraf\nointerlineskip}% ! savedstrut - \@@imbefore - \dostartattributes{\??im\margincontenttag}\c!style\c!color\empty - \dosetupstrut[\margincontentstrut]% was: \setstrut % yes or no - \begstrut#3\endstrut\endgraf - \xdef\margincontentstrutheight{\the\strutht}% so that it's known outside the framed - \dostopattributes - \@@imafter}% - \global \naturalmargincontentheight\ht\scratchbox - \global\advance\naturalmargincontentheight\dp\scratchbox - \doif\@@imstack\v!yes - {\def\overlappingmargin{-20\scaledpoint}% test value, maybe .25\strutboxdp, maybe configurable - \setbox\scratchbox\vbox{\stackeddown\vbox{\box\scratchbox}}}% new - \ht\scratchbox\strutht - \dp\scratchbox\strutdp % nieuw - \box\scratchbox - \egroup} - -%D The stacker permits constructs like: -%D -%D \starttyping -%D \setupinmargin[stack=yes] -%D -%D \inleft{test 1}test\break -%D \inleft{test 2}test\break -%D \inleft{test 1} -%D \input tufte -%D \inleft{test 1} -%D \inleft{test 2} -%D \inleft{test 3} -%D \input tufte -%D \inleft{test 1} -%D \inleft{test 2\endgraf test 3} -%D \inleft{test 4} -%D \input tufte -%D \inleft{test 1} -%D \inleft{test 2\endgraf test 3} -%D \inleft{test 4\endgraf test 5\endgraf test 6} -%D \inleft{test 7\endgraf test 8\endgraf test 9} -%D \input tufte -%D \stoptyping - -%D This approach permits us to implement a better mechanism -%D later. We need the \type {\graphicvadjust} in order to -%D handle: -%D -%D \starttyping -%D \inleft{test} {\red \dorecurse{40}{test }\par} -%D {\red \inleft{test} \dorecurse{40}{test }\par} -%D \stoptyping -%D -%D The outer margin color is either black or color set as -%D main text color. - -\newif\ifrightmargin % documenteren - -\ifx\dopositionmarginbox\undefined - \def\dopositionmarginbox#1{\graphicvadjust{\box#1}} -\fi - -% watch out, margin dimensions are swapped locally (\swapmargins) - -% with \margincontentmethod one can control pagebreaks -% -% 0 no break -% 1 each entry is one line -% 2 only natural height -% 3 also stack height - -\chardef\margincontentmethod \plusthree % beware: 1 = old method -\chardef\marginpagecheckmethod\plusone - -\def\margincontentextralines{1} % old method, play safe -\def\nofmargincontentlines {0} - -\def\doplacemargintext#1#2#3#4% - {\dontcomplain - \strut - \doifsomething{#1} - {\def\margincontenttag{#1}}% - \doifinsetelse{\margincontenttag}{\v!left,\v!right} % ugly hack - {\let \margincontentdistance \empty % signal - \let \margincontenthoffset \zeropoint} - {\edef\margincontentdistance{\executeifdefined{\??im\margincontenttag\c!distance }\empty }% signal - \edef\margincontenthoffset {\executeifdefined{\??im\margincontenttag\c!hoffset }\zeropoint}}% - \edef\margincontentlines {\executeifdefined{\??im\margincontenttag\c!line }\plusone }% - \edef\margincontentseparator {\executeifdefined{\??im\margincontenttag\c!separator}\donothing}% - \setbox\scratchbox\hbox{#4}% % todo: make sure that color stack works - \ifcase\margincontentmethod - \scratchdimen\zeropoint - \or % old method - \scratchdimen\ht\scratchbox - \advance\scratchdimen\dp\scratchbox - \or - \scratchdimen\naturalmargincontentheight - \or - \scratchdimen\naturalmargincontentheight - \ifx\laststackvmove\undefined\else\global\advance\scratchdimen\laststackvmove\fi - \fi - \ifdim\scratchdimen>\margincontentheight - \global\margincontentheight\scratchdimen - \fi - \setbox\scratchbox\hbox - {#2{\hskip#3\strut - \ifcase\margincontentdisplacement - % normal, move strutheight up - \scratchdimen\strutdp - \advance\scratchdimen \margincontentstrutheight - \advance\scratchdimen -\strutht - \raise\scratchdimen - \or - % low, obey vadjust - \fi - \box\scratchbox}}% - \ht\scratchbox\zeropoint - \dp\scratchbox\zeropoint - \gdef\margincontentstrutheight{\the\strutht}% - %\graphicvadjust{\box\scratchbox}} % fails in high math lines, let it be - %\hbox{\lower\strutdp\box\scratchbox}} % alas, wrong lapping, therefore useless - \dopositionmarginbox\scratchbox} - -% \def\domarginblockskip#1% -% {\hskip\margincontenthoffset -% \hskip\compensatedinnermakeupmargin\relax -% \doifelsenothing\margincontentdistance -% {\hskip\getvalue{\??im#1\c!distance}} -% {\hskip\margincontentdistance}% -% \relax} - -\def\domarginblockskip#1% - {\doifelsenothing\margincontentdistance - {\hskip\dimexpr - +\margincontenthoffset - +\compensatedinnermakeupmargin - +\csname\??im#1\c!distance\endcsname - \relax} - {\dimexpr - +\margincontenthoffset - +\compensatedinnermakeupmargin - +\margincontentdistance - \relax}% - \relax} - -\def\doleftmarginblock#1#2% - {\doplacemargintext{#1}\llap\zeropoint - {\llap{\placemargincontentseparator}% - \makemargintextblock\v!left\v!right{#2}% - \domarginblockskip\v!left}} - -\def\dorightmarginblock#1#2% - {\doplacemargintext{#1}\rlap\hsize - {\hskip\textwidth\hskip-\hsize % new: hsize correction - \domarginblockskip\v!right - \makemargintextblock\v!right\v!left{#2}% - \rlap{\placemargincontentseparator}}} - -\def\placemargincontentseparator - {\ifnum\margincontentlevel>\zerocount - \ifx\margincontentseparator\empty\else - \bgroup - \scratchdimen\margincontentlines\lineheight - \advance\scratchdimen -\lineheight - \lower\scratchdimen\hbox{\margincontentseparator}% - \egroup - \fi - \fi} - -\newbox\marginconstructbox - -\def\doinmarginswapped#1#2#3#4% - {\iffirstsidefloatparagraph\nowhitespace\fi % zo laat mogelijk - \setbox\marginconstructbox\hbox\bgroup % prevents page break in the middle of construction - \startsignalrightpage - \doifswappedrightpageelse - {\rightmargintrue #2} - {\rightmarginfalse#1} - {#3}% setups - {#4}% content - \stopsignalrightpage - \egroup - \unhbox\marginconstructbox} - -% history made this a bit complicated, the +/- was needed before -% we had enough mem/hash to do the page correction - -\edef\inmargintaglist{+,-,\v!low,\v!left,\v!right,\v!inner,\v!outer} - -% the old one: -% -% \def\doinmargin[#1][#2][#3][#4][#5]% #6 #7 -% {\doifcommonelse{+,-,\v!laag}{#4} -% {\dodoinmargin[#1][#2][#3][#4][#5]} -% {\dodoinmargin[#1][#2][#3][][#4]}} -% -% an alternative: -% -% \letvalue{\??im\v!laag\c!offset}\empty -% \letvalue{\??im +\c!offset}\empty -% \letvalue{\??im -\c!offset}\empty -% -% \def\doinmargin[#1][#2][#3][#4][#5]% #6 #7 -% {\doifnumberelse{#4} -% {\dodoinmargin[#1][#2][#3][#4][#5]} -% {\doifdefinedelse{\??im#4\c!offset} -% {\dodoinmargin[#1][#2][#3][#4][#5]} -% {\dodoinmargin[#1][#2][#3][][#4]}}} -% -% the problem is that we need to keep downward compatibility -% with respect to the first argument thing a reference or a -% directive; the alternative is to force users to pass a -% directive along with a reference; anyhow, as long as one -% does not use references that have the same name as a -% directive we can use the (slow) alternative - -\def\doinmargin[#1][#2][#3][#4][#5]% #6 #7 - {\expanded{\doifinsetelse{#4}{\inmargintaglist}} - {\dodoinmargin[#1][#2][#3][#4][#5]} - {\dodoinmargin[#1][#2][#3][][#4]}} - -\def\defineinmargin - {\doquadrupleempty\dodefineinmargin} - -\def\dodefineinmargin[#1][#2][#3][#4]% - {\doifassignmentelse{#4} - {\setupinmargin[#1][#4]% - \setvalue{#1}{\indentation\doquintupleempty\doinmargin[#2][#3][#1]}} - {\setvalue{#1}{\indentation\doquintupleempty\doinmargin[#2][#3][#4]}}} - -\defineinmargin [inleft] [\v!left] [\v!normal] % takes left settings -\defineinmargin [inright] [\v!right] [\v!normal] % takes right settings -\defineinmargin [ininner] [\v!inner] [\v!normal] % takes left/right settings -\defineinmargin [inouter] [\v!outer] [\v!normal] % takes left/right settings -\defineinmargin [inmargin] [\@@imlocation] [\v!normal] % takes left/right settings -\defineinmargin [inother] [\@@imlocation] [\v!reverse] % takes left/right settings - -\def\inothermargin{\inother} - -%D This permits definitions like: -%D -%D \starttyping -%D \defineinmargin [SomePlace] [inner] [normal] [distance=1cm] -%D \defineinmargin [SomePlace] [inner] [normal] [SomePlace] \setupinmargin[SomePlace][distance=1cm] -%D \defineinmargin [MyPlace] [inner] [normal] [SomePlace] -%D \defineinmargin [YourPlace] [inner] [normal] [SomePlace] -%D \stoptyping -%D -%D A torture test: -%D -%D \starttyping -%D \startbuffer -%D \inleft {\TestLine{red} {l}} test test test \par -%D \inright {\TestLine{green} {r}} test test test \par -%D \inmargin {\TestLine{blue} {m}} test test test \par -%D \inothermargin{\TestLine{yellow} {x}} test test test \par -%D \ininner {\TestLine{cyan} {i}} test test test \par -%D \inouter {\TestLine{magenta}{o}} test test test \par -%D \stopbuffer -%D -%D \dorecurse{80}\getbuffer \page -%D \stoptyping -%D -%D and -%D -%D \starttyping -%D \defineinmargin [InOuterA] [outer] [normal] [distance=0cm] -%D \defineinmargin [InOuterB] [outer] [normal] [distance=1cm] -%D \defineinmargin [InOuterC] [outer] [normal] [distance=2cm,line=2] -%D -%D \startbuffer -%D \InOuterA{\TestLine{red} {A}} test test test \par -%D \InOuterB{\TestLine{green}{B}} test test test \par -%D \InOuterC{\TestLine{blue} {C}} test test test \par -%D \stopbuffer -%D -%D \dorecurse{80}\getbuffer \page -%D -%D \dorecurse{10}{\inleft {one} test \inleft {two} test } \page -%D -%D \start -%D \margintext {one} \margintext {two} \input thuan \par -%D \setupinmargin[1][line=3,distance=1cm] -%D \margintext [1]{one} -%D \margintext [2]{two} -%D \input thuan \page -%D \stop -%D -%D \setupinmargin[3][location=inner,distance=1cm] -%D \setupinmargin[4][location=outer,distance=2cm] -%D -%D % \setupinmargin[left] [line=2] -%D % \setupinmargin[right][line=2] -%D -%D \dorecurse -%D {10} -%D {\margintext {\kern3cm\TestLine{blue}{none}} -%D \margintext[3] {\TestLine{darkgray}{3}} -%D \margintext[4] {\TestLine{darkgray}{4}} -%D \margintext[left] {\TestLine{red} {left}} -%D \margintext[right]{\TestLine{green} {right}} -%D \margintext[inner]{\TestLine{cyan} {inner}} -%D \margintext[outer]{\TestLine{magenta} {outer}} -%D \input thuan \endgraf} -%D -%D \dorecurse{10}{\margintext{test\\test\\test} \input thuan \endgraf} -%D \stoptyping - -% Test case: -% -% \setuppagenumbering[alternative=doublesided] \setupwhitespace[medium] -% -% \placefigure[right]{}{\externalfigure[dummy][width=2cm]} -% \input tufte \inothermargin{test} \input tufte - -% \def\dodoinmargin[#1][#2][#3][#4][#5]#6% -% {\bgroup -% \forgetall % otherwise sidefloat problems, added 2005/07/20, maybe dangerous -% \postponenotes % group is (somehow) needed -% \doifinsetelse\v!low{#4} -% {\chardef\margincontentdisplacement\plusone} -% {\chardef\margincontentdisplacement\zerocount}% -% \doif\v!reverse{#2} -% {\swapmacros\dorightmarginblock\doleftmarginblock}% -% \processaction -% [#1] -% [ \v!left=>\let\next\doleftmarginblock, % no swapping -% \v!right=>\let\next\dorightmarginblock, % no swapping -% \v!inner=>\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }, -% \v!outer=>\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}, -% \s!unknown=>\ifdoublesided -% \doifcommonelse{+,-}{#4} -% {\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }} -% {\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}}% -% \else -% \let\next\doleftmarginblock -% \fi]% -% \next{#3}{#6}% -% \rawpagereference\s!mar{#5}% naar binnen ! ! ! ! -% \flushnotes -% \egroup % don't forget the group -% \ignorespaces} - -% test first -% -% setupsystem[random=1235] -% -% \setupinmargin[left][sidemethod=3] -% \dorecurse{10}{test \fakewords{20}{40} test \inleft{test\\test} test \fakewords{20}{40} \par} -% \page -% \setupinmargin[left][sidemethod=4] -% \dorecurse{40}{test \fakewords{50}{80} test \inleft{test\\test} \par} -% \page - -\def\dodoinmargin[#1][#2][#3][#4][#5]#6% - {\bgroup -% \tracingall - % old stuff, a bit tricky, but now interfaced - \edef\currentmargincontent{#1}% - \chardef\marginrepositionmethod\executeifdefined{\??im\currentmargincontent\c!sidemethod }\plusone - \chardef\margincontentmethod \executeifdefined{\??im\currentmargincontent\c!textmethod }\plusthree - \chardef\marginpagecheckmethod \executeifdefined{\??im\currentmargincontent\c!splitmethod}\plusone - % so far - \forgetall % otherwise sidefloat problems, added 2005/07/20, maybe dangerous - \postponenotes % group is (somehow) needed - \doifinsetelse\v!low{#4} - {\chardef\margincontentdisplacement\plusone} - {\chardef\margincontentdisplacement\zerocount}% - \doif\v!reverse{#2} - {\swapmacros\dorightmarginblock\doleftmarginblock}% - \processaction - [#1] - [ \v!left=>\let\next\doleftmarginblock, % no swapping - \v!right=>\let\next\dorightmarginblock, % no swapping - \v!inner=>\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }, - \v!outer=>\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}, - \s!unknown=>\ifdoublesided - \doifcommonelse{+,-}{#4} - {\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }} - {\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}}% - \else - \let\next\doleftmarginblock - \fi]% - \next{#3}{#6}% - \rawpagereference\s!mar{#5}% naar binnen ! ! ! ! - \flushnotes - \egroup % don't forget the group - \ignorespaces} - -% dit zijn voorlopig lokale commando's / vervallen -% -% \def\woordinmarge {\indentation\doquintupleempty\doinmargin[\@@implaats][\inleftmargin][\inrightmarge]} -% -% \def\woordinlinker {\inleftmargin } % vervallen -% \def\woordinrechter{\inrechtermarge} % vervallen - -% Some day: \definemarking[\v!margetitel] - -%D Now come the margin text collectors. The collected content is -%D flushed at every paragraph by the following macro. Note for -%D myself: here the location (plaats) is no longer a tag (number). - -% gone: \def\doflushmargincontent{\doinmargin[\@@implaats][\v!normaal][]} % + [#1][#2]{#3}} - -%D These are now all the same (long ago they had different -%D implementations, somewhere in Sork time if I remember -%D right). - -\def\margintext {\dodoubleempty\domargincontent} -\def\marginword {\margintext} -\def\margintitle{\margintext} % txt mark as well - -\newtoks\collectedmargintexts % so .. delayed! -\chardef\margintextcollected \zerocount - -\def\domargincontent[#1][#2]#3% we used to check for #2/#1 being number, no longer now - {\global\chardef\margintextcollected\plusone - \edef\margincontenttag{#1}% - \ifx\margincontenttag\empty - \global\advance\margincontentlevel\plusone - \edef\margincontenttag{\number\margincontentlevel}% - \fi - \checkinmargin[\margincontenttag]% - \doglobal \appendetoks - \noexpand \checkinmargin[\margincontenttag]% - \noexpand \doinmargin[\executeifdefined{\??im\margincontenttag\c!location}\@@imlocation][\v!normal][\margincontenttag][\margincontenttag][#2]% - \to \collectedmargintexts - \doglobal \appendtoks - {#3}% - \to \collectedmargintexts} - -\let\restoreinterlinepenalty\relax - -\def\flushmargincontents % plural - {\restoreinterlinepenalty % here? - \ifcase\margintextcollected\else % called quite often, so we - \expandafter\doflushmargincontents % speed up the \fi scan by - \fi} % using a \do.. - -\def\doflushmargincontents % links + rechts - {\bgroup - \forgetall - \global\margincontentheight\zeropoint - \startsignalrightpage - \the\collectedmargintexts - \signalrightpage - \stopsignalrightpage - \resetmargincontent - % dirty tricks - \ifcase\margincontentmethod - \donefalse - \else\ifinsidecolumns % brrrr - \donetrue % how fuzzy - \else\ifdim\margincontentheight>\lineheight\relax - \donetrue % how dirty - \else - \donefalse % how needed - \fi\fi\fi - \savemargincontentlines - \ifdone - \advance\margincontentheight \margincontentextralines\lineheight - \ifdim\pagegoal>\pagetotal - \bgroup % preserve \margincontentheight - \advance\margincontentheight \pagetotal - \ifdim\margincontentheight>\pagegoal - \egroup - \ifcase\marginpagecheckmethod - % disabled - \or - \setmargincontentpenalties - \or - % potentially dangerous, maybe better a \goodbreak; the problem is that - % there can be a penalty there, which we then overload and we also introduce - % nasty side effects, so, we drop this option - % \vadjust pre {\page}% - \fi - \else - \egroup - \fi - \fi - \else % We need the above because interlinepenalties overrule vadjusted \nobreaks. - % a bit dangerous - \vadjust{\nobreak}% - \fi - \egroup} - -\def\setmargincontentpenalties - {\getnoflines\margincontentheight - \keeplinestogether\noflines} - -\def\savemargincontentlines - {\bgroup - \advance\margincontentheight \margincontentextralines\lineheight % 1 by default - \getnoflines\margincontentheight - \xdef\nofmargincontentlines{\the\noflines}% - \egroup} - -\def\fillupmargincontentlines % etex ! ! ! - {\endgraf - \begingroup - \scratchcounter\numexpr\nofmargincontentlines-\prevgraf\relax\relax - \ifnum\scratchcounter>\zerocount - \forgetall\dorecurse\scratchcounter{\nobreak\crlf}% - \fi - \endgroup} - -% Yet undocumented, for a manual flush in for instance headers. - -\def\resetmargincontent - {\global\margincontentlevel\zerocount - \global\chardef\margintextcollected\zerocount - \global\collectedmargintexts\emptytoks} - -% \def\placemargincontent -% {\ifcase\margintextcollected\else -% \bgroup -% \chardef\graphicvadjustmode\zerocount -% \doflushmargincontents -% \egroup -% \fi} -% -% font fix: - -\def\placemargincontent - {\ifcase\margintextcollected\else % was level check - \bgroup - \redoconvertfont % !! - \chardef\graphicvadjustmode\zerocount - \doflushmargincontents - \egroup - \fi} - -% For old times sake (i use it in project styles) we provide - -\def\placemargintexts {\placemargincontent} -\def\resetmargetitels {\resetmargincontent} -\def\margewoordpositie{\margewoord} % obsolete, now no longer range - -% but never use them yourself since they may disappear. - -\def\oplinker#1% - {\strut - \graphicvadjust - {\dontcomplain - \setbox\scratchbox\vtop{\forgetall\strut#1}% - \getboxheight\scratchdimen\of\box\scratchbox - \vskip-\scratchdimen % waarom stond hier een \ ? - \box\scratchbox}} - -\setupinmargin - [\c!style=\v!bold, - \c!color=, - \c!strut=\v!auto, - \c!location=\v!both, - \c!align=\v!inner, - \c!stack=\v!no, - \c!before=, - \c!after=] - -\setupinmargin - [\v!left] - [\c!distance=\leftmargindistance, - \c!width=\leftmarginwidth, - %\c!align=\v!left, % no - \c!location=\v!left] - -\setupinmargin - [\v!right] - [\c!distance=\rightmargindistance, - \c!width=\rightmarginwidth, - %\c!align=\v!right, % no - \c!location=\v!right] - -% bonus needed when [inner/outer] is used as tag - -\setupinmargin[\v!inner][\c!location=\v!inner,\c!align=\v!inner] -\setupinmargin[\v!outer][\c!location=\v!outer,\c!align=\v!inner] - -% more efficient (5K less fotmat file) -% -% \letvalue{\??im\v!inner\c!location}\v!inner \letvalue{\??im\v!inner\c!align}\v!inner -% \letvalue{\??im\v!outer\c!location}\v!outer \letvalue{\??im\v!outer\c!align}\v!inner - -\protect \endinput diff --git a/tex/context/base/page-mis.mkii b/tex/context/base/page-mis.mkii new file mode 100644 index 000000000..bd029f896 --- /dev/null +++ b/tex/context/base/page-mis.mkii @@ -0,0 +1,268 @@ +%D \module +%D [ file=page-mis, +%D version=2008.11.17, % was part of page-flt.tex / 2000.10.20 +%D title=\CONTEXT\ Page Macros, +%D subtitle=Misc Float Things, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Misc Float Things} + +\unprotect + +\newif\ifmargeblokken + +\def\dosetupmarginblocks[#1]% + {\getparameters[\??mb][#1]% + \doifelse\@@mbstate\v!start + {\showmessage\m!layouts4\empty + \margeblokkentrue + \let\somenextfloat\dosomenextfloat + \let\startmarginblock\dostartmarginblock + \let\stopmarginblock\dostopmarginblock}% + {\showmessage\m!layouts5\empty + \margeblokkenfalse + \def\somenextfloat[##1]% + {\someelsefloat[##1,\v!here]}% + \let\startmarginblock\dontstartmargeblok + \let\stopmarginblock\dontstopmargeblok}} + +\def\setupmarginblocks + {\dosingleargument\dosetupmarginblocks} + +\newbox\marginbox + +\def\dosomenextfloat[#1]% + {\global\setbox\marginbox\vbox + {\hsize\@@mbwidth + \unvcopy\marginbox + \ifvoid\marginbox\else\expandafter\@@mbinbetween\fi + \box\floatbox\filbreak}% + \ifdim\ht\marginbox>\textheight + \dosavefloatinfo + \else + \doinsertfloatinfo + \fi} + +\newbox\preparedmarginbox + +\def\reshapemargin + {\ifdim\ht\preparedmarginbox>\zeropoint + \beginofshapebox + \unvbox\preparedmarginbox + \endofshapebox + \reshapebox + {\box\shapebox}% + \setbox\preparedmarginbox\vbox to \textheight + {\@@mbtop + \flushshapebox + \@@mbbottom}% + \fi} + +\def\plaatsrechtermargeblok + {\hskip\rightmarginwidth} + +\def\plaatslinkermargeblok + {\hskip\leftmarginwidth} + +\def\checkmargeblokken + {\ifvoid\marginbox\else\docheckmargeblokken\fi} + +\def\docheckmargeblokken % erg inefficient + {\setbox\preparedmarginbox\vbox + {\forgetall + \splittopskip\topskip + \ifvoid\marginbox\else + \ifdim\ht\marginbox>\textheight + \vsplit\marginbox to \textheight + \else + \unvbox\marginbox + \fi + \fi}% + \reshapemargin + \setbox\preparedmarginbox\vbox + {\@@mbbefore\box\preparedmarginbox\@@mbafter}% + \def\rightmarginbox + {\def\plaatsrechtermargeblok + {\setbox\preparedmarginbox\hbox to \rightmarginwidth + {\@@mbleft\box\preparedmarginbox\@@mbright}% + \vsmashbox\preparedmarginbox + \box\preparedmarginbox}}% + \def\leftmarginbox + {\def\plaatslinkermargeblok + {\setbox\preparedmarginbox\hbox to \leftmarginwidth + {\@@mbright\box\preparedmarginbox\@@mbleft}% + \vsmashbox\preparedmarginbox + \box\preparedmarginbox}}% + \processaction % traag + [\@@mblocation] + [ \v!inmargin=>\doifbothsidesoverruled\rightmarginbox\rightmarginbox\leftmarginbox, + \v!middle=>\doifbothsidesoverruled\rightmarginbox\leftmarginbox\rightmarginbox, + \v!left=>\leftmarginbox, + \v!right=>\rightmarginbox, + \s!unknown=>\setbox\preparedmarginbox\hbox{}]} + +\def\dostartmarginblock % 2 maal \vbox ivm \unvbox elders + {\global\setbox\marginbox\vtop\bgroup\vbox\bgroup + \hsize\@@mbwidth + \ifvoid\marginbox\else + \unvbox\marginbox + \@@mbinbetween + \fi + \setupalign[\@@mbalign]% + \dostartattributes\??mb\c!style\c!color{}% + \begstrut\ignorespaces} + +\def\dostopmarginblock + {\unskip\endstrut + \dostopattributes + \egroup + \egroup} + +\def\dontstartmargeblok + {\@@mbbefore + \bgroup + \dostartattributes\??mb\c!style\c!color\empty} + +\def\dontstopmargeblok + {\dostopattributes + \egroup + \@@mbafter} + +\newcounter\nofpostponedblocks + +\newif\ifinpostponing + +\newevery\everytopofpage\relax + +\appendtoks \the\everytopofpage \to\everystarttext +\appendtoks\global\everytopofpage\emptytoks\to\everystoptext + +% \startpostponing [pagenumber] [+pageoffset] +% +% \startpostponing[2] +% PAGE 2 \blank +% \stoppostponing +% +% \startpostponing[+1] +% PAGE +1 \blank +% \stoppostponing +% +% \startpostponing[+2] +% PAGE +2 \blank +% \stoppostponing +% +% \starttext \dorecurse{4}{\input tufte \page} \stoptext + +\newtoks \postponedpageblocks +\newcounter\nofpostponedpageblocks + +% \ifinpostponing: handhaven, want gebruikt in stijlen ! ! ! ! ! + +\def\flushpagefloats + {\doifoddpageelse + {\ifvoid\collectedleftpagefloats + \ifvoid\collectedrightpagefloats\else + \unvbox\collectedrightpagefloats + \page + %\the\everytopofpage + \fi + \fi} + {\ifvoid\collectedleftpagefloats\else + \unvbox\collectedleftpagefloats + \page + %\the\everytopofpage + \fi + \ifvoid\collectedrightpagefloats\else + \unvbox\collectedrightpagefloats + \page + %\the\everytopofpage + \fi}% + \ifvoid\collectedpagefloats\else + % message + \unvbox\collectedpagefloats + \fi} + +% \def\flushrestfloats +% {\doif{\floatsharedparameter\c!cache}\v!no\doflushfloats} + +% \let\flushrestfloats\relax + +\def\dopostponeblock + {\bgroup % new may 2004 + \setsystemmode\v!postponing % new may 2004 + \the\everytopofpage + %\flushrestfloats + \flushpagefloats + \donefalse + \ifinpostponing \else + \ifcase\nofpostponedblocks \else \donetrue \fi + \ifcase\nofpostponedpageblocks \else \donetrue \fi + \fi + \ifdone + \bgroup % we need the color/font switch, else problems inside split verbatim + \setnormalcatcodes % postponing in verbatim + \pushpostponedpagecolor + \restoreglobalbodyfont % The \nof-test is + \global\pagetotal\zeropoint % recently added and + \global\inpostponingtrue % definitely needed else + \the\postponedpageblocks % we can loose or disorder + \dorecurse\nofpostponedblocks % floats; anyhow, this + {\getbuffer[pbuf-\recurselevel]}% % mechanism is still + \doflushfloats % new but potential dangerous % suboptimal and needs a + \doglobal\newcounter\nofpostponedblocks % proper analysis + \global\inpostponingfalse + \poppostponedpagecolor + \egroup + \fi + \egroup} % new may 2004 + +\def\getpostponedblock#1#2% + {\doif{#1}\realfolio{\getbuffer[rbuf-#2]}} % no \ifnum, avoid \fi + +% beware, \dosingleempty conflicts with buffers (feeds back the \par) + +\setvalue{\e!start\v!postponing}% + {\bgroup + \obeylines + \doifnextoptionalelse{\egroup\nodostartpostponing}{\egroup\dodostartpostponing}} + +\def\nodostartpostponing[#1]% + {\doglobal\increment\nofpostponedpageblocks + \bgroup % a little bit of misusing grouping + \doifinstring{+}{#1}\advance \realpageno#1\relax % ugly but efficient + \doglobal\appendetoks\noexpand\getpostponedblock + {\realfolio}{\nofpostponedpageblocks}\to\postponedpageblocks + \egroup + \showmessage\m!layouts3\nofpostponedpageblocks + \dostartbuffer[rbuf-\nofpostponedpageblocks]% + [\e!start\v!postponing][\e!stop\v!postponing]} + +\def\dodostartpostponing + {\doglobal\increment\nofpostponedblocks + \showmessage\m!layouts3\nofpostponedblocks + \expanded{\dostartbuffer[pbuf-\nofpostponedblocks][\e!start\v!postponing][\e!stop\v!postponing]}} + +% Setups: + +\setupmarginblocks + [\c!state=\v!start, + \c!location=\v!inmargin, + \c!width=\rightmarginwidth, + \c!style=, + \c!color=, + \c!align=, + \c!left=, + \c!right=, + \c!top=, + \c!inbetween=\blank, + \c!bottom=\vfill, + \c!before=, + \c!after=] + +\protect \endinput diff --git a/tex/context/base/page-mis.mkiv b/tex/context/base/page-mis.mkiv new file mode 100644 index 000000000..a620835e4 --- /dev/null +++ b/tex/context/base/page-mis.mkiv @@ -0,0 +1,266 @@ +%D \module +%D [ file=page-mis, +%D version=2008.11.17, % was part of page-flt.tex / 2000.10.20 +%D title=\CONTEXT\ Page Macros, +%D subtitle=Misc Float Things, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Misc Float Things} + +\unprotect + +\newif\ifmargeblokken + +\def\dosetupmarginblocks[#1]% + {\getparameters[\??mb][#1]% + \doifelse\@@mbstate\v!start + {\showmessage\m!layouts4\empty + \margeblokkentrue + \let\somenextfloat\dosomenextfloat + \let\startmarginblock\dostartmarginblock + \let\stopmarginblock\dostopmarginblock}% + {\showmessage\m!layouts5\empty + \margeblokkenfalse + \def\somenextfloat[##1]% + {\someelsefloat[##1,\v!here]}% + \let\startmarginblock\dontstartmargeblok + \let\stopmarginblock\dontstopmargeblok}} + +\def\setupmarginblocks + {\dosingleargument\dosetupmarginblocks} + +\newbox\marginbox + +\def\dosomenextfloat[#1]% + {\global\setbox\marginbox\vbox + {\hsize\@@mbwidth + \unvcopy\marginbox + \ifvoid\marginbox\else\expandafter\@@mbinbetween\fi + \box\floatbox\filbreak}% + \ifdim\ht\marginbox>\textheight + \dosavefloatinfo + \else + \doinsertfloatinfo + \fi} + +\newbox\preparedmarginbox + +\def\reshapemargin + {\ifdim\ht\preparedmarginbox>\zeropoint + \beginofshapebox + \unvbox\preparedmarginbox + \endofshapebox + \reshapebox + {\box\shapebox}% + \setbox\preparedmarginbox\vbox to \textheight + {\@@mbtop + \flushshapebox + \@@mbbottom}% + \fi} + +\def\plaatsrechtermargeblok + {\hskip\rightmarginwidth} + +\def\plaatslinkermargeblok + {\hskip\leftmarginwidth} + +\def\checkmargeblokken + {\ifvoid\marginbox\else\docheckmargeblokken\fi} + +\def\docheckmargeblokken % erg inefficient + {\setbox\preparedmarginbox\vbox + {\forgetall + \splittopskip\topskip + \ifvoid\marginbox\else + \ifdim\ht\marginbox>\textheight + \vsplit\marginbox to \textheight + \else + \unvbox\marginbox + \fi + \fi}% + \reshapemargin + \setbox\preparedmarginbox\vbox + {\@@mbbefore\box\preparedmarginbox\@@mbafter}% + \def\rightmarginbox + {\def\plaatsrechtermargeblok + {\setbox\preparedmarginbox\hbox to \rightmarginwidth + {\@@mbleft\box\preparedmarginbox\@@mbright}% + \vsmashbox\preparedmarginbox + \box\preparedmarginbox}}% + \def\leftmarginbox + {\def\plaatslinkermargeblok + {\setbox\preparedmarginbox\hbox to \leftmarginwidth + {\@@mbright\box\preparedmarginbox\@@mbleft}% + \vsmashbox\preparedmarginbox + \box\preparedmarginbox}}% + \processaction % traag + [\@@mblocation] + [ \v!inmargin=>\doifbothsidesoverruled\rightmarginbox\rightmarginbox\leftmarginbox, + \v!middle=>\doifbothsidesoverruled\rightmarginbox\leftmarginbox\rightmarginbox, + \v!left=>\leftmarginbox, + \v!right=>\rightmarginbox, + \s!unknown=>\setbox\preparedmarginbox\hbox{}]} + +\def\dostartmarginblock % 2 maal \vbox ivm \unvbox elders + {\global\setbox\marginbox\vtop\bgroup\vbox\bgroup + \hsize\@@mbwidth + \ifvoid\marginbox\else + \unvbox\marginbox + \@@mbinbetween + \fi + \setupalign[\@@mbalign]% + \dostartattributes\??mb\c!style\c!color{}% + \begstrut\ignorespaces} + +\def\dostopmarginblock + {\unskip\endstrut + \dostopattributes + \egroup + \egroup} + +\def\dontstartmargeblok + {\@@mbbefore + \bgroup + \dostartattributes\??mb\c!style\c!color\empty} + +\def\dontstopmargeblok + {\dostopattributes + \egroup + \@@mbafter} + +\newcounter\nofpostponedblocks + +\newif\ifinpostponing + +\newevery\everytopofpage\relax + +\appendtoks \the\everytopofpage \to\everystarttext +\appendtoks\global\everytopofpage\emptytoks\to\everystoptext + +% \startpostponing [pagenumber] [+pageoffset] +% +% \startpostponing[2] +% PAGE 2 \blank +% \stoppostponing +% +% \startpostponing[+1] +% PAGE +1 \blank +% \stoppostponing +% +% \startpostponing[+2] +% PAGE +2 \blank +% \stoppostponing +% +% \starttext \dorecurse{4}{\input tufte \page} \stoptext + +\newtoks \postponedpageblocks +\newcounter\nofpostponedpageblocks + +% \ifinpostponing: handhaven, want gebruikt in stijlen ! ! ! ! ! + +\def\flushpagefloats + {\doifoddpageelse + {\ifvoid\collectedleftpagefloats + \ifvoid\collectedrightpagefloats\else + \unvbox\collectedrightpagefloats + \page + %\the\everytopofpage + \fi + \fi} + {\ifvoid\collectedleftpagefloats\else + \unvbox\collectedleftpagefloats + \page + %\the\everytopofpage + \fi + \ifvoid\collectedrightpagefloats\else + \unvbox\collectedrightpagefloats + \page + %\the\everytopofpage + \fi}% + \ifvoid\collectedpagefloats\else + % message + \unvbox\collectedpagefloats + \fi} + +% \def\flushrestfloats +% {\doif{\floatsharedparameter\c!cache}\v!no\doflushfloats} + +% \let\flushrestfloats\relax + +\def\dopostponeblock + {\bgroup % new may 2004 + \setsystemmode\v!postponing % new may 2004 + \the\everytopofpage + %\flushrestfloats + \flushpagefloats + \donefalse + \ifinpostponing \else + \ifcase\nofpostponedblocks \else \donetrue \fi + \ifcase\nofpostponedpageblocks \else \donetrue \fi + \fi + \ifdone + \bgroup % we need the color/font switch, else problems inside split verbatim + \setnormalcatcodes % postponing in verbatim + \restoreglobalbodyfont % The \nof-test is + \global\pagetotal\zeropoint % recently added and + \global\inpostponingtrue % definitely needed else + \the\postponedpageblocks % we can loose or disorder + \dorecurse\nofpostponedblocks % floats; anyhow, this + {\getbuffer[pbuf-\recurselevel]}% % mechanism is still + \doflushfloats % new but potential dangerous % suboptimal and needs a + \doglobal\newcounter\nofpostponedblocks % proper analysis + \global\inpostponingfalse + \egroup + \fi + \egroup} % new may 2004 + +\def\getpostponedblock#1#2% + {\doif{#1}\realfolio{\getbuffer[rbuf-#2]}} % no \ifnum, avoid \fi + +% beware, \dosingleempty conflicts with buffers (feeds back the \par) + +\setvalue{\e!start\v!postponing}% + {\bgroup + \obeylines + \doifnextoptionalelse{\egroup\nodostartpostponing}{\egroup\dodostartpostponing}} + +\def\nodostartpostponing[#1]% + {\doglobal\increment\nofpostponedpageblocks + \bgroup % a little bit of misusing grouping + \doifinstring{+}{#1}\advance \realpageno#1\relax % ugly but efficient + \doglobal\appendetoks\noexpand\getpostponedblock + {\realfolio}{\nofpostponedpageblocks}\to\postponedpageblocks + \egroup + \showmessage\m!layouts3\nofpostponedpageblocks + \dostartbuffer[rbuf-\nofpostponedpageblocks]% + [\e!start\v!postponing][\e!stop\v!postponing]} + +\def\dodostartpostponing + {\doglobal\increment\nofpostponedblocks + \showmessage\m!layouts3\nofpostponedblocks + \expanded{\dostartbuffer[pbuf-\nofpostponedblocks][\e!start\v!postponing][\e!stop\v!postponing]}} + +% Setups: + +\setupmarginblocks + [\c!state=\v!start, + \c!location=\v!inmargin, + \c!width=\rightmarginwidth, + \c!style=, + \c!color=, + \c!align=, + \c!left=, + \c!right=, + \c!top=, + \c!inbetween=\blank, + \c!bottom=\vfill, + \c!before=, + \c!after=] + +\protect \endinput diff --git a/tex/context/base/page-mis.tex b/tex/context/base/page-mis.tex deleted file mode 100644 index bd029f896..000000000 --- a/tex/context/base/page-mis.tex +++ /dev/null @@ -1,268 +0,0 @@ -%D \module -%D [ file=page-mis, -%D version=2008.11.17, % was part of page-flt.tex / 2000.10.20 -%D title=\CONTEXT\ Page Macros, -%D subtitle=Misc Float Things, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Misc Float Things} - -\unprotect - -\newif\ifmargeblokken - -\def\dosetupmarginblocks[#1]% - {\getparameters[\??mb][#1]% - \doifelse\@@mbstate\v!start - {\showmessage\m!layouts4\empty - \margeblokkentrue - \let\somenextfloat\dosomenextfloat - \let\startmarginblock\dostartmarginblock - \let\stopmarginblock\dostopmarginblock}% - {\showmessage\m!layouts5\empty - \margeblokkenfalse - \def\somenextfloat[##1]% - {\someelsefloat[##1,\v!here]}% - \let\startmarginblock\dontstartmargeblok - \let\stopmarginblock\dontstopmargeblok}} - -\def\setupmarginblocks - {\dosingleargument\dosetupmarginblocks} - -\newbox\marginbox - -\def\dosomenextfloat[#1]% - {\global\setbox\marginbox\vbox - {\hsize\@@mbwidth - \unvcopy\marginbox - \ifvoid\marginbox\else\expandafter\@@mbinbetween\fi - \box\floatbox\filbreak}% - \ifdim\ht\marginbox>\textheight - \dosavefloatinfo - \else - \doinsertfloatinfo - \fi} - -\newbox\preparedmarginbox - -\def\reshapemargin - {\ifdim\ht\preparedmarginbox>\zeropoint - \beginofshapebox - \unvbox\preparedmarginbox - \endofshapebox - \reshapebox - {\box\shapebox}% - \setbox\preparedmarginbox\vbox to \textheight - {\@@mbtop - \flushshapebox - \@@mbbottom}% - \fi} - -\def\plaatsrechtermargeblok - {\hskip\rightmarginwidth} - -\def\plaatslinkermargeblok - {\hskip\leftmarginwidth} - -\def\checkmargeblokken - {\ifvoid\marginbox\else\docheckmargeblokken\fi} - -\def\docheckmargeblokken % erg inefficient - {\setbox\preparedmarginbox\vbox - {\forgetall - \splittopskip\topskip - \ifvoid\marginbox\else - \ifdim\ht\marginbox>\textheight - \vsplit\marginbox to \textheight - \else - \unvbox\marginbox - \fi - \fi}% - \reshapemargin - \setbox\preparedmarginbox\vbox - {\@@mbbefore\box\preparedmarginbox\@@mbafter}% - \def\rightmarginbox - {\def\plaatsrechtermargeblok - {\setbox\preparedmarginbox\hbox to \rightmarginwidth - {\@@mbleft\box\preparedmarginbox\@@mbright}% - \vsmashbox\preparedmarginbox - \box\preparedmarginbox}}% - \def\leftmarginbox - {\def\plaatslinkermargeblok - {\setbox\preparedmarginbox\hbox to \leftmarginwidth - {\@@mbright\box\preparedmarginbox\@@mbleft}% - \vsmashbox\preparedmarginbox - \box\preparedmarginbox}}% - \processaction % traag - [\@@mblocation] - [ \v!inmargin=>\doifbothsidesoverruled\rightmarginbox\rightmarginbox\leftmarginbox, - \v!middle=>\doifbothsidesoverruled\rightmarginbox\leftmarginbox\rightmarginbox, - \v!left=>\leftmarginbox, - \v!right=>\rightmarginbox, - \s!unknown=>\setbox\preparedmarginbox\hbox{}]} - -\def\dostartmarginblock % 2 maal \vbox ivm \unvbox elders - {\global\setbox\marginbox\vtop\bgroup\vbox\bgroup - \hsize\@@mbwidth - \ifvoid\marginbox\else - \unvbox\marginbox - \@@mbinbetween - \fi - \setupalign[\@@mbalign]% - \dostartattributes\??mb\c!style\c!color{}% - \begstrut\ignorespaces} - -\def\dostopmarginblock - {\unskip\endstrut - \dostopattributes - \egroup - \egroup} - -\def\dontstartmargeblok - {\@@mbbefore - \bgroup - \dostartattributes\??mb\c!style\c!color\empty} - -\def\dontstopmargeblok - {\dostopattributes - \egroup - \@@mbafter} - -\newcounter\nofpostponedblocks - -\newif\ifinpostponing - -\newevery\everytopofpage\relax - -\appendtoks \the\everytopofpage \to\everystarttext -\appendtoks\global\everytopofpage\emptytoks\to\everystoptext - -% \startpostponing [pagenumber] [+pageoffset] -% -% \startpostponing[2] -% PAGE 2 \blank -% \stoppostponing -% -% \startpostponing[+1] -% PAGE +1 \blank -% \stoppostponing -% -% \startpostponing[+2] -% PAGE +2 \blank -% \stoppostponing -% -% \starttext \dorecurse{4}{\input tufte \page} \stoptext - -\newtoks \postponedpageblocks -\newcounter\nofpostponedpageblocks - -% \ifinpostponing: handhaven, want gebruikt in stijlen ! ! ! ! ! - -\def\flushpagefloats - {\doifoddpageelse - {\ifvoid\collectedleftpagefloats - \ifvoid\collectedrightpagefloats\else - \unvbox\collectedrightpagefloats - \page - %\the\everytopofpage - \fi - \fi} - {\ifvoid\collectedleftpagefloats\else - \unvbox\collectedleftpagefloats - \page - %\the\everytopofpage - \fi - \ifvoid\collectedrightpagefloats\else - \unvbox\collectedrightpagefloats - \page - %\the\everytopofpage - \fi}% - \ifvoid\collectedpagefloats\else - % message - \unvbox\collectedpagefloats - \fi} - -% \def\flushrestfloats -% {\doif{\floatsharedparameter\c!cache}\v!no\doflushfloats} - -% \let\flushrestfloats\relax - -\def\dopostponeblock - {\bgroup % new may 2004 - \setsystemmode\v!postponing % new may 2004 - \the\everytopofpage - %\flushrestfloats - \flushpagefloats - \donefalse - \ifinpostponing \else - \ifcase\nofpostponedblocks \else \donetrue \fi - \ifcase\nofpostponedpageblocks \else \donetrue \fi - \fi - \ifdone - \bgroup % we need the color/font switch, else problems inside split verbatim - \setnormalcatcodes % postponing in verbatim - \pushpostponedpagecolor - \restoreglobalbodyfont % The \nof-test is - \global\pagetotal\zeropoint % recently added and - \global\inpostponingtrue % definitely needed else - \the\postponedpageblocks % we can loose or disorder - \dorecurse\nofpostponedblocks % floats; anyhow, this - {\getbuffer[pbuf-\recurselevel]}% % mechanism is still - \doflushfloats % new but potential dangerous % suboptimal and needs a - \doglobal\newcounter\nofpostponedblocks % proper analysis - \global\inpostponingfalse - \poppostponedpagecolor - \egroup - \fi - \egroup} % new may 2004 - -\def\getpostponedblock#1#2% - {\doif{#1}\realfolio{\getbuffer[rbuf-#2]}} % no \ifnum, avoid \fi - -% beware, \dosingleempty conflicts with buffers (feeds back the \par) - -\setvalue{\e!start\v!postponing}% - {\bgroup - \obeylines - \doifnextoptionalelse{\egroup\nodostartpostponing}{\egroup\dodostartpostponing}} - -\def\nodostartpostponing[#1]% - {\doglobal\increment\nofpostponedpageblocks - \bgroup % a little bit of misusing grouping - \doifinstring{+}{#1}\advance \realpageno#1\relax % ugly but efficient - \doglobal\appendetoks\noexpand\getpostponedblock - {\realfolio}{\nofpostponedpageblocks}\to\postponedpageblocks - \egroup - \showmessage\m!layouts3\nofpostponedpageblocks - \dostartbuffer[rbuf-\nofpostponedpageblocks]% - [\e!start\v!postponing][\e!stop\v!postponing]} - -\def\dodostartpostponing - {\doglobal\increment\nofpostponedblocks - \showmessage\m!layouts3\nofpostponedblocks - \expanded{\dostartbuffer[pbuf-\nofpostponedblocks][\e!start\v!postponing][\e!stop\v!postponing]}} - -% Setups: - -\setupmarginblocks - [\c!state=\v!start, - \c!location=\v!inmargin, - \c!width=\rightmarginwidth, - \c!style=, - \c!color=, - \c!align=, - \c!left=, - \c!right=, - \c!top=, - \c!inbetween=\blank, - \c!bottom=\vfill, - \c!before=, - \c!after=] - -\protect \endinput diff --git a/tex/context/base/page-mul.mkii b/tex/context/base/page-mul.mkii new file mode 100644 index 000000000..c78af074a --- /dev/null +++ b/tex/context/base/page-mul.mkii @@ -0,0 +1,1773 @@ +%D \module +%D [ file=page-mul, % was: core-mul +%D version=1998.03.15, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Multi Column Output, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Simple Multi Column} + +%D This module is mostly a copy from the original multi column +%D routine as implemented in \type {core-mul}. When the main +%D OTR macro's were isolated in modules and column sets were +%D introduced, this module became part of the OTR modules. As +%D a result this module is no longer generic. It also needs +%D an overhaul. + +\unprotect + +% TO DO ! + +\let\OTRMULsetvsize \OTRONEsetvsize +\let\OTRMULsethsize \OTRONEsethsize +\let\OTRMULdopagecontents \OTRONEdopagecontents +\let\OTRMULfinalsidefloatoutput\OTRONEfinalsidefloatoutput % ??? +\let\OTRMULflushfloatbox \OTRONEflushfloatbox + +\let\OTRMULdosettopinserts \relax +\let\OTRMULdosetbotinserts \relax +\let\OTRMULdotopinsertions \relax +\let\OTRMULdobotinsertions \relax +\let\OTRMULdosetbothinserts \relax +\let\OTRMULflushsavedfloats \relax + +\let\OTRMULflushsidefloats \forgetsidefloats % \relax +\let\OTRMULsynchronizesidefloats\forgetsidefloats % \relax + +\newtoks \OTRMULoutput + +\def\OTRMULgotonextpage + {\ejectpage} + +\def\OTRMULgotonextpageX % will become obsolete + {\superejectpage} + +% check \count multiplications + +% some day try this in balancing routine +% +% \ifdim\pagetotal>\pagegoal +% \eject +% \else +% \goodbreak +% \fi + +%D The following macro's implement a multi||column output +%D routine. The original implementation was based on Donald +%D Knuth's implementation, which was adapted by Craig Platt to +%D support balancing of the last page. I gradually adapted +%D Platt's version to our needs but under certain +%D circumstances things still went wrong. I considered all +%D calls to Platt's \type{\balancingerror} as undesirable. + +%D This completely new implementation can handle enough +%D situations for everyday documents, but is still far from +%D perfect. While at the moment the routine doesn't support +%D all kind of floats, it does support: +%D +%D \startitemize[packed] +%D \item an unlimitted number of columns +%D \item ragged or not ragged bottoms +%D \item optional balancing without \type{\balancingerrors} +%D \item different \type{\baselineskips}, \type{\spacing}, +%D \type{\topskip} and \type{\maxdepth} +%D \item left- and right indentation, e.g. within lists +%D \item moving columns floats to the next column or page +%D \item handling of floats that are to wide for a columns +%D \stopitemize +%D +%D One could wonder why single and multi||columns modes are +%D still separated. One reason for this is that \TeX\ is not +%D suited well for handling multi||columns. As a result, the +%D single columns routines are more robust. Handling one +%D column as a special case of multi||columns is posible but at +%D the cost of worse float handling, worse page breaking, +%D worse etc. Complicated multi||column page handling should +%D be done in \cap{DTP}||systems anyway. +%D +%D There are three commands provided for entering and leaving +%D multi||column mode and for going to the next column: +%D +%D \interface \type{\beginmulticolumns} \\ \\ +%D \interface \type{\endmulticolumns} \\ \\ +%D \interface \type{\ejectcolumn} \\ \\ +%D +%D This routines are sort of stand||alone. They communicate +%D with the rest of \CONTEXT\ by means of some interface +%D macro's, which we only mention. +%D +%D \interface \type{\nofcolumns} \\ +%D the number of columns \\ +%D \interface \type{\minbalancetoplines} \\ +%D the minimum number op balanced top lines \\ +%D \interface \type{\betweencolumns} \\ +%D the stuff between columns \\ +%D \interface \type{\finaloutput{action}{box}} \\ +%D some kind of \type{\pagebody} and \type{\shipout} \\ +%D +%D \interface \type{\ifbalancecolumns} \\ +%D balancing the colums or not \\ +%D \interface \type{\ifstretchcolumns} \\ +%D ragging the bottom or not \\ +%D +%D \interface \type{\ifheightencolumns} \\ +%D fix the heigh tor not \\ +%D \interface \type{\fixedcolumnheight} \\ +%D the optional fixed height \\ +%D +%D \interface \type{\ifinheritcolumns} \\ +%D handle ragging or not \\ +%D \interface \type{\ifr@ggedbottom} \\ +%D use ragged bottoms \\ +%D \interface \type{\ifb@selinebottom} \\ +%D put the bottom line on the baseline \\ +%D \interface \type{\ifnormalbottom} \\ +%D put the bottom line at the baseline \\ +%D +%D \interface \type{\ifreversecolumns} \\ +%D reverse the order in wich columns are flushed \\ +%D +%D \interface \type{\usercolumnwidth} \\ +%D the calculated width of a column \\ +%D \interface \type{\columntextwidth} \\ +%D the maximum width of a column \\ +%D \interface \type{\columntextheight} \\ +%D the minimum width of a column \\ +%D +%D \interface \type{\spacingfactor} \\ +%D the spacing factor \\ +%D \interface \type{\bodyfontsize} \\ +%D the (local) bodyfontsize \\ +%D \interface \type{\openlineheight} \\ +%D the lineheight (including \type{\spacing}) \\ +%D +%D \interface \type{\EveryBodyFont} \\ +%D communication channel to font switching routines \\ +%D +%D \interface \type{\global\settopskip} \\ +%D set \type{\topskip} \\ +%D \interface \type{\setvsize} \\ +%D set \type{\vsize} and \type{\pagegoal} \\ +%D \interface \type{\sethsize} \\ +%D set \type{\hsize} \\ +%D +%D \interface \type{\flushcolumnfloats} \\ +%D push saved column floats (next page) \\ +%D \interface \type{\flushcolumnfloat} \\ +%D push saved column floats (next column) \\ +%D \interface \type{\setcolumnfloats} \\ +%D initialize column floats \\ +%D +%D \interface \type{\finishcolumnbox} \\ +%D do something special (a hook) \\ +%D \interface \type{\postprocesscolumnpagebox} \\ +%D do something with each columnbox (also a hook) \\ +%D \interface \type{\postprocesscolumnbox} \\ +%D do something with each columnbox (also a hook) \\ +%D \interface \type{\postprocesscolumnline} \\ +%D do something with each columnline (also a hook) \\ +%D \interface \type{\currentcolumn} \\ +%D the current column \\ +%D +%D These interface macro's are called upon or initialized +%D by the multi||column macro's. + +%D A lot of footnote stuff added! + +\def\finalcolumntextwidth {\makeupwidth} +\def\finalcolumntextheight {\textheight} +\def\columntextwidth {\makeupwidth} +\def\columntextheight {\textheight} +\def\usercolumnwidth {\textwidth} +\def\columntextoffset {\!!zeropoint} + +\def\fixedcolumnheight {\textheight} +\def\betweencolumns {\hskip\bodyfontsize} + +\let\setcolumnfloats \relax % in CONTEXT used for floats +\let\flushcolumnfloats \relax % in CONTEXT used for floats +\let\flushcolumnfloat \relax % in CONTEXT used for floats +\let\finishcolumnbox \relax % in CONTEXT used for backgrounds + +% %D In fact, the column height and width are set by means of +% %D two macro's. One can change their meaning if needed: +% +% \def\setcolumntextheight +% {\def\columntextheight{\teksthoogte}} +% +% \def\setcolumntextwidth +% {\def\columntextwidth{\zetbreedte}} + +%D Both macros are redefined in \CONTEXT\ when backgrounds +%D are applied to columns. The final values are used when +%D flushing the columns. + +\newtoks\singlecolumnout % remove that one + +%D It's more convenient to use \type {\columnwidth} instead +%D of messing around with boxes each time. + +\newdimen\columnwidth +\newdimen\gutterwidth + +\def\determinecolumnwidth + {\bgroup + \setbox\scratchbox\hbox + {\setcolumnhsize + \global\columnwidth\usercolumnwidth + \global\gutterwidth\intercolumnwidth}% + \egroup} + +%D Going to a new columns is done by means of a +%D \type{\ejectcolumn}. The following definition does not +%D always work. + +\def\ejectcolumn + {\goodbreak\showmessage\m!columns2\empty} + +%D The next macro should never be called so let's deal with it. +%D There were several solutions to these kind of errors. First +%D we check for a good breakpoint before firing up the +%D multi||column routine (\type{\break} or \type{\allowbreak}). +%D We do the same at the end of the routine +%D (\type{\allowbreak}). These allowances are definitely +%D needed! +%D +%D Some on first sight redundant calls to for instance +%D \type{\setvsize} in the flushing, splitting and balancing +%D macro's can definitely not be omitted! Some are just there +%D to handle situations that only few times arise. One of +%D those can be that the output routine is invoked before +%D everything is taken care of. This happens when we +%D flush (part of) the current page with an \type{\unvbox} +%D with a \type{\pagetotal}~$\approx$ \type{\pagegoal}. One +%D simply cannot balance columns that are just balanced. +%D +%D I hope one never sees the following message. Because it +%D took me a lot of time to develop the multi||columns +%D routines, every (although seldom) warning gives me the +%D creeps! + +\def\balancingerror + {\showmessage\m!columns3\empty + \finaloutput\unvbox\normalpagebox} + +\def\OTRMULsometopsfloat{\showmessage\m!columns4\empty \someherefloat} +\def\OTRMULsomebotsfloat{\showmessage\m!columns5\empty \someherefloat} + +\def\OTRMULsomeherefloat{\OTRONEsomeherefloat} + +%D The local column width is available in the dimension +%D register \type{\localcolumnwidth}, which is calculated as: + +\def\setcolumnhsize % beware, this one is available for use in macros + {\setbox\scratchbox\hbox{\parindent\zeropoint\betweencolumns}% + \intercolumnwidth\wd\scratchbox + \localcolumnwidth\columntextwidth + \advance\localcolumnwidth -\leftskip + \advance\localcolumnwidth -\rightskip + % new + \advance\localcolumnwidth -\colleftskip + \advance\localcolumnwidth -\colrightskip + % + \advance\localcolumnwidth -\nofcolumns\intercolumnwidth + \advance\localcolumnwidth \intercolumnwidth + \divide \localcolumnwidth \nofcolumns + \scratchdimen\columntextoffset + \multiply\scratchdimen \plustwo + \advance\localcolumnwidth -\scratchdimen + \usercolumnwidth\localcolumnwidth + \hsize\localcolumnwidth} % we don't do it \global + +%D Torture test: +%D +%D \startbuffer +%D \startbuffer[b] +%D \startcolumns +%D \input tufte +%D \stopcolumns +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower +%D \input tufte +%D \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startcolumns \startnarrower +%D \input tufte +%D \stopnarrower \stopcolumns +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower \startcolumns +%D \input tufte +%D \stopcolumns \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startcolumns \startnarrower[left] +%D \input tufte +%D \stopnarrower \stopcolumns +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower[left] \startcolumns +%D \input tufte +%D \stopcolumns \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower \startcolumns \startnarrower +%D \input tufte +%D \stopnarrower\stopcolumns \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower[left] \startcolumns \startnarrower +%D \input tufte +%D \stopnarrower\stopcolumns \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D \stopbuffer +%D +%D \start +%D \def\postprocesscolumnline#1{\ruledhbox{\strut\box#1}\hss} +%D \getbuffer +%D \stop + +%D One should be aware that when font related dimensions are +%D used in typesetting the in||between material, these +%D dimensions are influenced by bodyfont switches inside +%D multi||column mode. + +\newdimen\mcscratchdimen +\newcount\nofcolumnlines + +\chardef\multicolumnlinemethod\zerocount % 0: overshoot (old default), 1: tight +% \chardef\multicolumnlinemethod\plusone + +\def\getmulticolumnlines + {\mcscratchdimen-\columntextoffset + \multiply\mcscratchdimen \plustwo + \advance\mcscratchdimen \columntextheight + \ifdim\precolumnboxheight>\zeropoint + \advance\mcscratchdimen -\precolumnboxheight + \fi + \settotalinsertionheight + \advance\mcscratchdimen -\totalinsertionheight + \ifcase\multicolumnlinemethod \getnoflines\mcscratchdimen + \or \getrawnoflines\mcscratchdimen + \else \getrawnoflines\mcscratchdimen + \fi + % added 30/7/2004 + \ifnum\layoutlines>\zerocount \ifnum\noflines>\layoutlines + \noflines\layoutlines + \fi \fi + \nofcolumnlines\noflines} + +\def\multicolumnovershootratio{.5} % {\ifgridsnapping0\else.5\fi} + +\def\setcolumnvsize + {\getmulticolumnlines + \mcscratchdimen\nofcolumnlines\openlineheight + \advance\mcscratchdimen \multicolumnovershootratio\openlineheight % collect enough data + \global\vsize\nofcolumns\mcscratchdimen + \global\pagegoal\vsize} % let's do it only here + +%D It really starts here. After some checks and initializations +%D we change the output routine to continous multi||column +%D mode. This mode handles columns that fill the current and +%D next full pages. The method used is (more or less) +%D multiplying \type{\vsize} and dividing \type{\hsize} by +%D \type{\nofcolumns}. More on this can be found in the +%D \TeX book. We save the top of the current page in box +%D \type{\precolumnbox}. +%D +%D We manipulate \type{\topskip} a bit, just to be shure that +%D is has no flexibility. This has te be done every time a +%D font switch takles place, because \type{\topskip} can depend +%D on this. +%D +%D Watch the trick with the \type{\vbox}. This way we get the +%D right interlining and white space. + +\def\beginmulticolumns + {\par + \flushnotes + \xdef\precolumndepth{\the\prevdepth}% + \begingroup + % new + \leftskip1\leftskip + \rightskip1\rightskip + \edef\colleftskip {\the\leftskip}% + \edef\colrightskip{\the\rightskip}% + \leftskip\zeropoint + \rightskip\zeropoint + % + \dontshowcomposition + %\setcolumntextwidth\relax + %\setcolumntextheight\relax + \widowpenalty\zerocount % is gewoon beter + \clubpenalty \zerocount % zeker bij grids + \ifsomefloatwaiting + \showmessage\m!columns6{\the\savednoffloats}% + \global\setbox\savedfloatlist\box\floatlist + \xdef\restoresavedfloats + {\global\savednoffloats\the\savednoffloats + \global\setbox\floatlist\box\savedfloatlist + \global\noexpand\somefloatwaitingtrue}% + \global\savednoffloats\zerocount + \global\somefloatwaitingfalse + \else + \global\let\restoresavedfloats\relax + \fi + \dimen0\pagetotal + \advance\dimen0 \parskip + \advance\dimen0 \openlineheight + \ifdim\dimen0<\pagegoal + \allowbreak + \else + \break % Sometimes fails + \fi + \appendtoks\topskip1\topskip\to\everybodyfont + \the\everybodyfont % ugly here + \saveinterlinespace % ugly here + \initializecolumns\nofcolumns + \hangafter\zerocount + \hangindent\zeropoint + \everypar\emptytoks + \ifdim\pagetotal=\zeropoint \else + \verticalstrut + \vskip-\struttotal + \fi + \global\savedpagetotal\pagetotal + \global\singlecolumnout\output + %\global\output{\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}}% + \global\output{\global\setbox\precolumnbox\vbox{\dotopinsertions\unvbox\normalpagebox}}% + \eject % no \holdinginserts=1, can make footnote disappear ! + \global\precolumnboxheight\ht\precolumnbox + \global\output{\continuousmulticolumnsout}% + \setcolumnfloats + \dohandleallcolumns + {\global\setbox\currenttopcolumnbox\emptybox}% + \checkbegincolumnfootnotes + \activateotr{MUL}{ONE}% todo ! ! ! ! + \let\sethsize\setcolumnhsize + \let\setvsize\setcolumnvsize + \sethsize + \setvsize + \showcomposition} + +%D When we leave the multi||column mode, we have to process the +%D not yet shipped out part of the columns. When we don't +%D balance, we simply force a continuous output, but a balanced +%D output is more tricky. + +%D First we try to fill up the page and when all or something +%D is left we try to balance things. This is another useful +%D adaption of the ancesters of these macro's. It takes some +%D reasoning to find out what happens and maybe I'm making +%D some mistake, but it works. +%D +%D Voiding box \type{\precolumnbox} is sometimes necessary, +%D e.g. when there is no text given between \type{\begin..} +%D and \type{\end..}. The \type{\par} is needed! + +\chardef\multicolumnendsyncmethod\plusone % 1: old sync 2: new sync (cont-loc/project) / may fail ! ! ! ! + +\def\endmulticolumns + {%\par + \ifnum\multicolumnendsyncmethod=\plustwo + \synchronizeoutput + \else + % don't combine these + \vskip\lineheight + \vskip-\lineheight % take footnotes into account + \fi + \dontshowcomposition + \doflushcolumnfloat % added recently + %\doflushcolumnfloats % no, since it results in wrong top floats + \flushnotes % before start of columns + \par + \ifbalancecolumns + \ifnum\multicolumnendsyncmethod=\plusone + \global\output{\continuousmulticolumnsout}% + \goodbreak + \fi + \global\output{\balancedmulticolumnsout}% + \else + \goodbreak + \fi + \eject % the prevdepth is important, try e.g. toclist in + \prevdepth\zeropoint % columns before some noncolumned text text + \global\output\singlecolumnout + \global\output{\the\mainoutput}% % % % % todo + \ifvoid\precolumnbox\else + \unvbox\precolumnbox + \fi + \global\precolumnboxheight\zeropoint + \endgroup % here + \nofcolumns\plusone + \setvsize % the outer one! + \synchronizeoutput % new may 2004 / we need to: \pagegoal\vsize + \checkendcolumnfootnotes + \dosomebreak\allowbreak + \restoresavedfloats} + +%D Because some initializations happen three times, we +%D defined a macro for them. Erasing \type{\everypar} is +%D needed because we don't want anything to interfere. + +\def\setmulticolumnsout + {\everypar\emptytoks + \dontcomplain + \settopskip + \setmaxdepth + \topskip1\topskip + \splittopskip\topskip + \splitmaxdepth\maxdepth + \boxmaxdepth\maxdepth % dangerous + \emergencystretch\zeropoint\relax} % sometimes needed ! + +%D Flushing the page comes to pasting the columns together and +%D appending the result to box \type{\precolumnbox}, if not +%D void. I've seen a lot of implementations in which some skip +%D was put between normal text and multi||column text. When we +%D don't want this, the baselines can be messed up. I hope the +%D seemingly complicated calculation of a correction +%D \type{\kern} is adequate to overcome this. Although not +%D watertight, spacing is taken into account and even multiple +%D mode changes on one page go well. But cross your fingers and +%D don't blame me. +%D +%D One of the complications of flushing out the boxes is that +%D \type{\precolumnbox} needs to be \type{\unvbox}'ed, otherwise +%D there is too less flexibility in the page when using +%D \type{\r@ggedbottom}. It took a lot of time before these +%D kind of problems were overcome. Using \type{\unvbox} at the +%D wrong moment can generate \type{\balancingerror}'s. +%D +%D One can use the macros \type {\maxcolumnheight} and \type +%D {\maxcolumndepth} when generating material between columns +%D as well as postprocessing column lines. + +\let\maxcolumnheight=\zeropoint +\let\maxcolumndepth =\zeropoint + +\newbox\columnpagebox + +\def\setmaxcolumndimensions + {\let\maxcolumnheight\!!zeropoint + \let\maxcolumndepth \!!zeropoint + \dohandleallcolumns + {\ifdim\ht\currentcolumnbox>\maxcolumnheight + \edef\maxcolumnheight{\the\ht\currentcolumnbox}% + \fi + \ifdim\dp\currentcolumnbox>\maxcolumndepth + \edef\maxcolumndepth{\the\dp\currentcolumnbox}% + \fi}} + +\chardef\multicolumntopflushmethod\plusone % 0: no correction, 1: correction when topstuff, 2: correction, 3: correction++ +\chardef\multicolumntopalignmethod\plustwo % 0: nothing, 1: force grid, 2: follow grid + +\def\flushprecolumnboxnogrid + {\unvbox\precolumnbox} + +\def\flushprecolumnboxongrid + {\scratchdimen\savedpagetotal + \advance\scratchdimen -\ht\precolumnbox + \advance\scratchdimen -\dp\precolumnbox + \advance\scratchdimen -\topskip + \box\precolumnbox + \kern\scratchdimen} + +\newconditional\someprecolumncontent + +\def\flushcolumnedpage#1% + {\bgroup + \ifvoid\precolumnbox + \setfalse\someprecolumncontent % will be set elsewhere + \else + \settrue\someprecolumncontent +\mkprocessboxcontents\precolumnbox + \fi + \forgetall + \setmulticolumnsout + \showcomposition + \setmaxcolumndimensions + \dohandleallcolumns + {\mkprocesscolumncontents\currentcolumnbox}% + \postprocesscolumns + \dohandleallcolumns % \hbox i.v.m. \showcomposition + {\global\setbox\currentcolumnbox\hbox to \localcolumnwidth + {\box\currentcolumnbox + \global\wd\currentcolumnbox\localcolumnwidth + \ifheightencolumns + \global\ht\currentcolumnbox\fixedcolumnheight + \fi}}% + \setmaxcolumndimensions + \overlaycolumnfootnotes + \setbox\columnpagebox\vbox + {\hbox to \finalcolumntextwidth + {\hskip\colleftskip\relax % new, \relax needed + \ifreversecolumns + \popsplitproperties % else wrong color stack + \@EA\dohandlerevcolumns + \else + \@EA\dohandleallcolumns + \fi + {\finishcolumnbox{\hbox + {\ifx\finishcolumnbox\relax\else\strut\fi + \box\currentcolumnbox}}% + \hfil}% + \unskip + \hskip\colrightskip}}% new + \scratchdimen\zeropoint + \dohandleallcolumns + {\ifdim-\ht\currenttopcolumnbox<\scratchdimen + \scratchdimen-\ht\currenttopcolumnbox + \fi + \global\setbox\currenttopcolumnbox\emptybox}% + \advance\scratchdimen \ht\columnpagebox + \setbox\scratchbox\hbox to \columntextwidth + {\vrule + \!!width\zeropoint + \!!height\scratchdimen + \!!depth\dp\columnpagebox + \dostepwiserecurse2\nofcolumns1{\hfil\betweencolumns}\hfil}% + \setbox\columnpagebox\hbox + {\box\columnpagebox + \hskip-\columntextwidth + \restoretextcolor{\box\scratchbox}}% + \postprocesscolumnpagebox % new, acts upon \box\columnpagebox + \ifconditional\someprecolumncontent + \settrue\someprecolumncontent + % next some incredible crappy code + \ifcase\multicolumntopalignmethod + \flushprecolumnboxnogrid % not on grid + \or + \flushprecolumnboxongrid % force on grid + \else\ifgridsnapping % somehow this junk fails in pascal + \flushprecolumnboxongrid % obey grid settings, force on grid + \else + \flushprecolumnboxnogrid % ignore grid settings, not on grid + \fi \fi + \fi + \global\precolumnboxheight\zeropoint + \setvsize + \dosomebreak\nobreak % hm, only needed when topstuff + \ifgridsnapping + \else + \ifcase\multicolumntopflushmethod + % sometimes method 1 goes wrong, so we need a way out; best sort this out + % when we run into it again + \or + % \input tufte \startcolumns \showbaselines \input tufte \stopcolumns \input tufte + \ifconditional\someprecolumncontent +% \scratchdimen\topskip +% \advance\scratchdimen -\openstrutheight +% \nointerlineskip +% \vskip-\scratchdimen + \nointerlineskip + \vskip\dimexpr\openstrutheight-\topskip\relax + \fi + \or +% \scratchdimen\topskip +% \advance\scratchdimen -\openstrutheight +% \nointerlineskip +% \vskip-\scratchdimen + \nointerlineskip + \vskip\dimexpr\openstrutheight-\topskip\relax + \or + % untested but maybe handy +% \scratchdimen\topskip +% \advance\scratchdimen -\openstrutheight +% \nointerlineskip +% \vskip-\scratchdimen +% \vskip-\lineheight +% \vbox{\strut}% + \nointerlineskip + \vskip\dimexpr\openstrutheight-\topskip-\lineheight\relax + \vbox{\strut}% + \fi + \fi + \prevdepth\openstrutdepth + \nointerlineskip + \dp\columnpagebox\zeropoint + \global\finalcolumnheights\ht\columnpagebox + \getnoflines\finalcolumnheights + \global\finalcolumnlines\noflines + \ifcase#1\else + % messy correction, we need to rewrite this module (newcolumns) + \setbox\columnpagebox\vbox + {\offinterlineskip + \scratchdimen\ht\columnpagebox + \advance\scratchdimen\dp\columnpagebox % we probably lost that one already + \box\columnpagebox + \vskip-\scratchdimen}% + \scratchdimen\noflines\openlineheight + \advance\scratchdimen-\openstrutdepth + \advance\scratchdimen-\openlineheight + \advance\scratchdimen\topskip + \ht\columnpagebox\scratchdimen + \dp\columnpagebox\openstrutdepth + % end of mess + \fi + \box\columnpagebox + \egroup} + +%D In case one didn't notice, finaly \type{\finishcolumnbox} is +%D applied to all boxes. One can use these hooks for special +%D purposes. +%D +%D Once upon a time I wanted to manipulate the individual lines +%D in a column. This feature is demonstrated in the two examples +%D below. +%D +%D \startbuffer +%D \def\postprocesscolumnline#1% or \postprocesscolumnbox +%D {\ruledhbox{\box#1}\hss} +%D +%D \startcolumns[n=4] +%D \dorecurse{25}{line: \recurselevel\par} +%D \stopcolumns +%D \stopbuffer +%D +%D \typebuffer +%D +%D Here we show the natural width of the lines: +%D +%D {\getbuffer} +%D +%D The next example does a bit more advanced manipulation: +%D +%D \startbuffer +%D \def\postprocesscolumnline#1% +%D {\ifodd\currentcolumn +%D \hfill\unhbox#1\relax +%D \else +%D \relax\unhbox#1\hfill +%D \fi} +%D +%D \startcolumns[n=4] +%D \dorecurse{25}{line \recurselevel\par} +%D \stopcolumns +%D \stopbuffer +%D +%D \typebuffer +%D +%D Here we also see an application of \type{\currentcolumn}: +%D +%D {\getbuffer} +%D +%D This feature is implemented using the reshape macros +%D presented in \type{supp-box}. + +\def\postprocesscolumns + {\ifx\postprocesscolumnline\undefined \else + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vtop + {\beginofshapebox + \unvbox\currentcolumnbox + \unskip\unskip + \endofshapebox + \reshapebox + {\dimen0\ht\shapebox + \dimen2\dp\shapebox + \setbox\shapebox\hbox to \hsize + {\postprocesscolumnline\shapebox}% + \ht\shapebox\dimen0 + \dp\shapebox\dimen2 + \box\shapebox}% + \flushshapebox + \everypar\emptytoks + \parskip\zeropoint % = \forgetall + \verticalstrut + \vskip-\struttotal + \vfil}}% + \fi + \ifx\postprocesscolumnbox\undefined \else + \dohandleallcolumns + {\global\setbox\currentcolumnbox\hbox + {\postprocesscolumnbox\currentcolumnbox}} + \fi} + +%D We default to doing nothing! + +\let\postprocesscolumnline =\undefined +\let\postprocesscolumnbox =\undefined +\let\postprocesscolumnpagebox=\relax + +%D \macros +%D {reversecolumnstrue} +%D +%D We can force the macro that takes care of combining +%D the columns, to flush them in the revere order. Of +%D course, by default we don't reverse. + +\newif\ifreversecolumns + +%D Here comes the simple splitting routine. It's a bit +%D longer than expected because of ragging bottoms or not. +%D This part can be a bit shorter but I suppose that I will +%D forget what happens. The splitting takes some already +%D present material (think of floats) into account! +%D +%D First we present some auxiliary routines. Any material, +%D like for instance floats, that is already present in the +%D boxes is preserved. + +\def\splitcolumn#1from \box#2to \dimen#3 top \box#4% + {\bgroup + \ifdim\ht#4>\zeropoint + \dimen0\dimen#3\relax + \dimen2\dimen0 + \advance\dimen0 -\ht#4% + \columnfootnotecorrection{#1}{\dimen0}% + \setbox0\vsplit#2 to \dimen0 + \global\setbox#1\vbox to \dimen2 + {\ifgridsnapping + \dimen0-\openstrutheight + \advance\dimen0 \topskip + \vskip\dimen0\copy#4\vskip-\dimen0 + \else + \unvcopy#4% + \fi + \fuzzysnappedbox\unvbox0 + \fakecolumnfootnotes{#1}}% + \else + \ifcase\clevernotes + \global\setbox#1\vsplit#2 to \dimen#3% + \global\setbox#1\vbox + {\fuzzysnappedbox\unvbox{#1}}% % or \box ? + \else + \columnfootnotecorrection{#1}{\dimen#3}% + \setbox0\vsplit#2 to \dimen#3% + \global\setbox#1\vbox to \dimen#3% + {\fuzzysnappedbox\unvbox0 + \fakecolumnfootnotes{#1}}% + \fi + \fi + \egroup} + +\def\splitcurrentcolumn from \box#1to \dimen#2% + {\splitcolumn\currentcolumnbox from \box#1 to \dimen#2 top \box\currenttopcolumnbox} + +\def\splitfirstcolumn from \box#1to \dimen#2% + {\splitcolumn\firstcolumnbox from \box#1 to \dimen#2 top \box\firsttopcolumnbox} + +\def\splitlastcolumn from \box#1to \dimen#2% + {\global\setbox\lastcolumnbox\vbox + {\unvcopy\lasttopcolumnbox + \fuzzysnappedbox\unvbox{#1}% + \fakecolumnfootnotes\lastcolumnbox}} + +%D NEW: still to be documented. + +\def\fakecolumnfootnotes#1% + {\relax + \ifcase\clevernotes\else + \ifnum#1=\lastcolumnbox + \fakenotes + \fi + \fi} + +\def\columnfootnotecorrection#1#2% + {\relax + \ifcase\clevernotes + % page notes + \or + \ifnum#1=\firstcolumnbox\relax + \calculatetotalclevernoteheight + \advance#2 -\totalnoteheight + \fi + \else + \ifnum#1=\lastcolumnbox\relax + \calculatetotalclevernoteheight + \advance#2 -\totalnoteheight + \fi + \fi} + +\def\overlaycolumnfootnotes + {\relax + \ifcase\clevernotes + % page notes + \else + \checknotepresence + \ifnotespresent + % the note box has the depth of the notefont + % because a column (i.e. first column has no depth, + % we need to anchor top down) + \bgroup + \ifcase\clevernotes\or + \getmulticolumnlines + \advance\nofcolumnlines \minustwo + \scratchdimen\nofcolumnlines\lineheight + \advance\scratchdimen \topskip + \setbox0\hbox + {\lower\scratchdimen\vbox{\placenoteinserts}}% + \ht0=\openstrutheight % \strutht + \dp0=\openstrutdepth % \strutdp + \scratchdimen\ht\firstcolumnbox + \global\setbox\firstcolumnbox\vbox to \scratchdimen + {\box\firstcolumnbox + \vskip-\scratchdimen + \restoretextcolor{\box0}}% + \else + % maybe here also \getmulticolumnlines + \scratchdimen\ht\firstcolumnbox + \advance\scratchdimen -\openstrutdepth % \strutdp + \getnoflines\scratchdimen + \advance\noflines \minustwo + \scratchdimen\noflines\lineheight + \advance\scratchdimen \topskip + \setbox0\hbox + {\lower\scratchdimen\vbox{\placenoteinserts}}% + \ht0=\openstrutheight % \strutht + \dp0=\openstrutdepth % \strutdp + \scratchdimen\ht\lastcolumnbox + \global\setbox\lastcolumnbox\vbox to \scratchdimen + {\box\lastcolumnbox + \vskip-\scratchdimen + \restoretextcolor{\box0}}% + \fi + \egroup + \fi + \fi} + +%D Here comes the routine that splits the long box in columns. +%D The macro \type{\flushcolumnfloats} can be used to flush +%D either floats that were present before the multi||column +%D mode was entered, or floats that migrate to next columns. +%D Flushing floats is a delicate process. + +\def\continuousmulticolumnsout + {\bgroup + \forgetall + \setmulticolumnsout + \dontshowcomposition +% \dimen0=\columntextheight +% \advance\dimen0 -\precolumnboxheight +% \settotalinsertionheight +% \advance\dimen0 -\totalinsertionheight +% \ifgridsnapping % evt altijd, nog testen +% \getnoflines{\dimen0} +% \dimen0=\noflines\openlineheight +% \fi + \getmulticolumnlines + \dimen0=\nofcolumnlines\openlineheight + \dohandleallcolumns + {\splitcurrentcolumn from \box\normalpagebox to \dimen0}% + \setbox\restofpage\vbox{\unvbox\normalpagebox}% + \ifinheritcolumns + \ifr@ggedbottom % vreemd + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox to \ht\firstcolumnbox + {\dimen0\dp\currentcolumnbox + \unvbox\currentcolumnbox + \vskip-\dimen0 + \vskip\openstrutdepth % \strutdp + \prevdepth\openstrutdepth % \strutdp + \vfill}}% + \ifbottomnotes \else + \dimen0\ht\firstcolumnbox + \fi + \fi + \ifn@rmalbottom + \advance\dimen0 \maxdepth + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox to \dimen0 + {\unvbox\currentcolumnbox}}% + \fi + \ifb@selinebottom + % the columns are on top of the baseline + \fi + \else + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox to \dimen0 + {\ifstretchcolumns + \unvbox\currentcolumnbox + \else + \unvbox\currentcolumnbox % wel of niet \unvbox ? + \vfill + \fi}}% + \dohandleallcolumns + {\global\ht\currentcolumnbox\dimen0}% + \fi + \setbox\precolumnbox\vbox{\flushcolumnedpage\zerocount}% + \finaloutput\box\precolumnbox + \sethsize + \setvsize + \flushcolumnfloats + \unvbox\restofpage + % \penalty\outputpenalty % gaat gruwelijk mis in opsommingen + \egroup} + +%D And this is the balancing stuff. Again, part of the routine +%D is dedicated to handling ragged bottoms, but here we also +%D see some handling concerning the stretching of columns. +%D We set \type{\widowpenalty} at~0, which enables us to +%D balance columns with few lines. The use of \type{\box2} and +%D \type{\box4} garantees a more robust check when skips are +%D used. + +\def\multicolumnsbalancemax{250} % 100 is too small when floats are involved + +\def\balancedmulticolumnsout + {\bgroup + \setmulticolumnsout + \dontshowcomposition + \widowpenalty\zerocount + \setbox0\vbox{\unvbox\normalpagebox}% +\ifdim\ht0>\openlineheight % at least one line + \ifnum\minbalancetoplines<2 % balance anyway + \donetrue + \else % check criterium to available lines + \getnoflines{\ht0}% + \divide\noflines \nofcolumns \relax + \ifnum\noflines<\minbalancetoplines \relax + \dimen0\ht0 + \advance\dimen0 \ht\firsttopcolumnbox + \advance\dimen0 \openlineheight \relax % let's play safe + \ifdim\dimen0>\columntextheight % column exceeding text height + \donetrue + \else % it seems to fit + \donefalse + \fi + \else % balance indeed + \donetrue + \fi + \fi +\else % balancing does not make sense + \donefalse +\fi +\ifdone % start balancing + %\ifdim\ht0>\openlineheight + \dimen0\ht0 + \advance\dimen0 \topskip + \advance\dimen0 -\baselineskip + \dohandleallcolumns + {\advance\dimen0 \ht\currenttopcolumnbox}% + \divide\dimen0 \nofcolumns + \vbadness\!!tenthousand\relax + \count255=\zerocount + \bgroup + \ifgridsnapping + \dimen2\lineheight + \else + \dimen2=\onepoint % RUBISH + \dimen2=\spacingfactor\dimen2 + \fi + \doloop + {\advance\count255 \plusone + \global\setbox\restofpage\copy0\relax + \splitfirstcolumn from \box\restofpage to \dimen0 + \dohandlemidcolumns + {\splitcurrentcolumn from \box\restofpage to \dimen0}% + \splitlastcolumn from \box\restofpage to \dimen0 + \setbox2\vbox{\unvcopy\firstcolumnbox}% + \dimen4\zeropoint + \dohandleallcolumns + {\setbox4\vbox + {\unvcopy\currentcolumnbox + %rather new, test this on pdftex-z.tex + \unpenalty\unskip\unpenalty\unskip}% maybe better in main splitter + %\writestatus{balance}{\the\currentcolumnbox: \the\ht4}% +% \dimen6\ht4 \ifdim\dimen6>\dimen4 \dimen4=\dimen6 \fi}% + \ifdim\ht4>\dimen4 \dimen4=\ht4 \fi}% + \advance\dimen4 -.0005pt % get rid of accurracy problem, pretty new + \ifnum\count255>\multicolumnsbalancemax\relax + \exitloop + \else\ifdim\dimen4>\ht2 + \advance\dimen0 \dimen2\relax + \else + \exitloop + \fi\fi}% + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox{\unvcopy\currentcolumnbox}}% NIEUW + \ifnum\count255>\multicolumnsbalancemax\relax + \showmessage\m!columns7\empty + \else + \showmessage\m!columns8{\the\count255\space}% + \fi + \egroup + \ifinheritcolumns + % We cannot assume that the first column is the tallest, if + % only because we may have an aborted balance (one line in the + % first column and a graphic in the second one). + % + % \dimen0\ht\firstcolumnbox + % \dimen2\ht\firstcolumnbox + % + \dimen0=\zeropoint + \dohandleallcolumns + {\ifdim\ht\currentcolumnbox>\dimen0 + \dimen0=\ht\currentcolumnbox + \fi}% + \dimen2\dimen0 + % so far + \advance\dimen2 -\openlineheight + \dohandleallcolumns + {\dimen4\ht\currentcolumnbox + \dimen6=10\openlineheight % funny value + \global\setbox\currentcolumnbox\vbox to \dimen0 + {\unvbox\currentcolumnbox + \ifdim\dimen4>\dimen6 + \ifdim\dimen4<\dimen0 + \ifdim\dimen4>\dimen2 + \vskip\zeropoint % !! + \else + \vskip\openlineheight + \vfill + \fi + \else + \vskip\zeropoint + \fi + \else + \vskip\openlineheight + \vfill + \fi}}% + \else + \bgroup + \ifstretchcolumns + \dimen0\ht\firstcolumnbox + \dimen2=\bottomtolerance\ht\firstcolumnbox + \setbox0\vbox{\unvcopy\lastcolumnbox}% + \advance\dimen0 -\ht0\relax + \advance\dimen0 -\dp0\relax + \ifdim\dimen0>\openlineheight\relax + \ifdim\dimen0>\dimen2\relax + % \stretchcolumnsfalse % beter goed slecht dan slecht goed + \showmessage\m!columns9\empty + \fi + \fi + \fi + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox to \ht\firstcolumnbox + {\ifstretchcolumns + \unvbox\currentcolumnbox + \else + \box\currentcolumnbox + \vfill + \fi}}% + \egroup + \fi + \else + % a one liner is not properly handled here, so best rewrite the text then + \showmessage\m!columns{10}\empty + \global\setbox\firstcolumnbox\vbox{\unvbox0}% + \fi + \global\output{\balancingerror}% + \b@selinebottomtrue % forces depth in separation rule + \flushcolumnedpage\plusone + \multicolumnseject + \egroup} + +\def\multicolumnseject + {\ifdim\pagetotal>\textheight + \eject % new + \else + \allowbreak + \fi} + +%D The multicolumn mechanism is incorporated in a \CONTEXT\ +%D interface, which acts like: +%D +%D \starttyping +%D \startcolumns[n=4,balance=no] +%D some text +%D \stopcolumns +%D \stoptyping +%D +%D The setup is optional. The default behaviour of columns +%D can be set up with: +%D +%D \starttyping +%D \setupcolumns +%D [n=2, +%D balance=yes] +%D \stoptyping +%D +%D In this case, stretching is according to the way it's +%D done outside columns (\type{\inheritcolumnstrue}). Also +%D we can setup the \type{tolerance} within a column, the +%D \type{distance} between columns and the fixed +%D \type{height} of a column. + +%D Multi||column output: the float routines +%D +%D Here come the routines that handle the placement of column +%D floats. Floats that are to big migrate to the next +%D column. Floats that are too wide, migrate to the top of the +%D next page, where they span as much columns as needed. +%D Floats that are left over from outside the multi||column +%D mode are flushed first. In macro \type{\finaloutput} the +%D topfloats that are left from previous text should be set. +%D +%D When there are some floats in the queue, we inhibit the +%D flushing of floats on top of columns. The number of +%D waiting floats is preswent in \type{\savednoftopfloats} and +%D is saved. As long as there are floats waiting, the topfloats +%D are places as if we are outside multi||column mode. This is +%D neccessary for e.g. multicolumn lists. +%D +%D When all those floats are flushed, we switch to the local +%D flushing routine. + +\def\setcolumnfloats + {\xdef\globalsavednoffloats{\the\savednoffloats}% + \ifnum\globalsavednoffloats>\zerocount + \setglobalcolumnfloats + \else + \setlocalcolumnfloats + \fi} + +\def\setglobalcolumnfloats + {\everypar\emptytoks + \let\flushcolumnfloat\relax + %\let\doroomfloat\relax + \let\docheckiffloatfits\relax + \let\flushcolumnfloats\noflushcolumnfloats} + +\def\setlocalcolumnfloats + {\everypar{\flushnotes\flushcolumnfloat\flushmargincontents\checkindentation}% + \let\flushcolumnfloat\doflushcolumnfloat + %\let\doroomfloat\docolumnroomfloat + \let\docheckiffloatfits\docolumnroomfloat + \let\flushcolumnfloats\doflushcolumnfloats + \let\doflushfloats\doflushcolumnfloats % new + \let\dosetbothinserts\relax + \let\dotopinsertions\relax} + +\def\noflushcolumnfloats + {\bgroup + \xdef\localsavednoffloats{\the\savednoffloats}% + \global\savednoffloats\globalsavednoffloats + \dotopinsertions + \xdef\globalsavenoffloats{\the\savednoffloats}% + \ifnum\globalsavednoffloats=\zerocount + \setlocalcolumnfloats + \fi + \global\savednoffloats\localsavednoffloats + \egroup} + +%D We need to calculate the amount of free space in a columns. +%D When there is not enough room, we migrate the float to the +%D next column. These macro's are alternatives (and +%D look||alikes) of \type{\doroomfloat}. When a float is to +%D wide, for one column, it is moved to the top of the next +%D page. Of course such moved floats have to be taken into +%D account when we calculate the available space. It's a pitty +%D that such things are no integral part of \TEX. + +\def\getcolumnstatus\column#1\total#2\goal#3\\% + {\dimen0=\ifdim\pagegoal<\maxdimen \pagetotal \else \zeropoint \fi + \dimen2=\zeropoint + \count255=\zerocount + \dimen8=\columntextheight + \advance\dimen8 -\precolumnboxheight + \def\dogetcolumnstatus + {\advance\count255 \plusone + \advance\dimen2 \ht\currenttopcolumnbox + \advance\dimen2 \dp\currenttopcolumnbox + \dimen4\dimen2 + \advance\dimen4 \dimen0 + \dimen6=\count255\dimen8 + \ifdim\dimen4>\dimen6 + \else + \let\dogetcolumnstatus\relax + \fi}% + \dohandleallcolumns{\dogetcolumnstatus}% + \ifnum\count255=0 \count255=1 \fi + #1=\count255 + #2=\dimen4 + #3=\dimen6 } + +\def\getinsertionheight + {\ifdim\pagegoal<\maxdimen + \bgroup + \dimen0=\columntextheight + \advance\dimen0 -\pagegoal + \xdef\insertionheight{\the\dimen0}% + \egroup + \else + \global\let\insertionheight\zeropoint + \fi} + +\def\docolumnroomfloat + {\ifpostponecolumnfloats + \global\roomforfloatfalse + \else\ifnofloatpermitted + \global\roomforfloatfalse + \else + \bgroup + \getcolumnstatus\column\count255\total\dimen0\goal\dimen2\\% + \advance\dimen0 2\openlineheight % nog nodig ? + %\ifnum\count255=\nofcolumns + % \getinsertionheight + % %\message{\insertionheight}\wait + % \advance\dimen0 \insertionheight + %\fi + \setbox\scratchbox\vbox % tricky met objecten ? + {\blank[\@@bkspacebefore] + \snaptogrid\vbox{\copy\floatbox}}% + \advance\dimen0 \ht\scratchbox + \advance\dimen0 .5\lineheight % needed because goal a bit higher + %\message{column: \the\count255; total: \the\dimen0; goal: \the\dimen2}\wait + \ifdim\dimen0>\dimen2 + \global\roomforfloatfalse + \else + \global\roomforfloattrue + \fi + \ifdim\wd\floatbox>\hsize + \showmessage\m!columns{11}\empty + \global\roomforfloatfalse + \fi + \egroup + \fi\fi} + +%D Flushing one float is done as soon as possible, i.e. +%D \type{\everypar}. This means that (at the moment) +%D sidefloats are not supported (overulled)! + +\newif\ifflushingcolumnfloats \flushingcolumnfloatstrue + +\def\doflushcolumnfloat + {\ifpostponecolumnfloats\else\ifflushingcolumnfloats\ifprocessingverbatim\else\ifsomefloatwaiting + \bgroup + \forgetall + \let\doflushcolumnfloat\relax + \getcolumnstatus\column\mofcolumns\total\dimen0\goal\dimen2\\% + \ifdim\dimen0>\zeropoint + \dogetfloat + \ifdim\wd\floatbox>\hsize + \doresavefloat + \else + %\setbox2=\vbox + % {\blank[\@@bkspacebefore] + % \snaptogrid\vbox{\copy\floatbox}% + % \blank[\@@bkspaceafter] + \setbox2=\vbox + {\blank[\@@bkspacebefore] + \snaptogrid\vbox{\copy\floatbox}}% + \advance\dimen0 \ht2 + \ifdim\dimen0>\dimen2 + \ifnum\mofcolumns<\nofcolumns + \advance\mofcolumns \plusone +%% bug %% \edef\currenttopcolumnbox{\getvalue{\@@topcol\the\count255}}% + \ifdim\ht\currenttopcolumnbox=\zeropoint + \global\setbox\currenttopcolumnbox\vbox + {\snaptogrid\vbox{\copy\floatbox} + \whitespace % nodig ? + \blank[\@@bkspaceafter]}% + \dimen4=\ht\currenttopcolumnbox + \advance\dimen4 \dp\currenttopcolumnbox + \global\advance\vsize -\dimen4 + \advance\dimen4 -\pagegoal + \global\pagegoal-\dimen4 + \showmessage\m!columns{12}a% + \else + \showmessage\m!columns{12}b% + \doresavefloat + \fi + \else + \showmessage\m!columns{12}c% + \doresavefloat + \fi + \else + \ifhmode{\setbox0\lastbox}\fi% waar is die er in geslopen + \par + \ifdim\prevdepth<\zeropoint \else % anders bovenaan kolom witruimte + \nobreak + \blank[\@@bkspacebefore] + \nobreak + \fi + \flushfloatbox + \blank[\@@bkspaceafter] + \fi + \fi + \fi + \egroup + \fi\fi\fi\fi} + +%D This one looks complicated. Upto \type{\nofcolumns} floats +%D are placed, taking the width of a float into account. This +%D routine can be improved on different ways: +%D +%D \startitemize[intro,packed] +%D \item taking into account some imaginary baseline, just to +%D get the captions in line +%D \item multipass flushing until as many floats are displaced +%D as possible +%D \stopitemize +%D +%D When handling lots of (small) floats spacing can get worse +%D because of lining out the columns. + +\def\doflushcolumnfloats + {\ifpostponecolumnfloats\else + \bgroup + \forgetall + \ifsomefloatwaiting + \dimen8\zeropoint + \dimen4\zeropoint + \count0\zerocount % count0 can be used local + \count2\nofcolumns % count2 can be used local + \dohandleallcolumns + {\ifnum\count0>\zerocount % the wide one's reserved space + \global\setbox\currenttopcolumnbox\vbox + {\snaptogrid\vbox + {\copy\currenttopcolumnbox + \hbox{\vphantom{\copy\floatbox}}} + \whitespace % nodig ? + \blank[\@@bkspaceafter]}% + \else + \dogetfloat + \ifdim\wd\floatbox>\finalcolumntextwidth % better somewhere else too + \global\setbox\floatbox\hbox to \finalcolumntextwidth{\hss\box\floatbox\hss}% + \fi % otherwise the graphic may disappear + \ifdim\wd\floatbox>\hsize + \dimen0\wd\floatbox + \advance\dimen0 \intercolumnwidth + \dimen2\hsize + \advance\dimen2 \intercolumnwidth + \advance\dimen0 .5pt % hm, why 1 + \advance\dimen2 .5pt % hm, why 2 + \divide\dimen0 \dimen2 + \count0\dimen0 + \advance\count0 \plusone + \ifnum\count0>\count2 + \doresavefloat + \count0\zerocount + \else + \dimen0=\count0\hsize + \advance\dimen0 \count0\intercolumnwidth + \advance\dimen0 -\intercolumnwidth + \global\setbox\floatbox\hbox to \dimen0 + %{\hss\hbox{\copy\floatbox}\hss}% + {\processaction[\@@bklocation] % how easy to forget + [ \v!left=>\copy\floatbox\hss, + \v!right=>\hss\copy\floatbox, + \s!default=>\hss\copy\floatbox\hss, + \s!unknown=>\hss\copy\floatbox\hss]}% + \fi + \showmessage\m!columns{13}\empty + \else + % \showmessage\m!columns{13}\empty + \fi + \ifdim\ht\floatbox>\zeropoint\relax + \global\setbox\currenttopcolumnbox\vbox + {\snaptogrid\vbox + {\copy\currenttopcolumnbox + \copy\floatbox} + \whitespace % nodig ? + \blank[\@@bkspaceafter]}% + \fi + \dimen6\ht\currenttopcolumnbox + \advance\dimen6 \dp\currenttopcolumnbox + \fi + \ifdim\dimen4<\ht\currenttopcolumnbox + \dimen4\ht\currenttopcolumnbox + \fi + \advance\dimen8 \dimen6 + \advance\count2 \minusone + \advance\count0 \minusone }% + \setvsize + \global\advance\vsize -\dimen8 + \global\pagegoal\vsize + \else + %\doflushfloats % does not snap! + \fi + \egroup + \fi} + +%D The next macro can be used to flush floats in the current +%D stream. No width checking is (yet) done. + +\def\insertcolumnfloats + {\doloop + {\ifsomefloatwaiting + \bgroup + \forgetall + % no check for width + \dogetfloat + \blank[\@@bkspacebefore] + \snaptogrid\vbox{\copy\floatbox} + \blank[\@@bkspaceafter] + \egroup + \else + \exitloop + \fi}} + +%D This were the multi||column routines. They can and need to +%D be improved but at the moment their behaviour is acceptable. +%D +%D One inprovement can be to normalize the height of floats +%D to $n\times$\type{\lineheight} with a macro like: +%D +%D \starttyping +%D \normalizevbox{...} +%D \stoptyping + +% border case, should fit on one page +% +% \startcolumns +% +% 1 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{1}} +% 2 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{2}} +% 3 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{3}} +% +% \stopcolumns + +\def\setupcolumns + {\dosingleempty\dosetupcolumns} + +\def\dosetupcolumns[#1]% + {\getparameters[\??kl][#1]% + \nofcolumns\@@kln\relax + \processaction + [\@@klrule] + [ \v!on=>\let\betweencolumns\linebetweencolumns, + \v!off=>\let\betweencolumns\spacebetweencolumns, + \s!default=>\let\betweencolumns\spacebetweencolumns, + \s!unknown=>\let\betweencolumns\@@klrule]} + +\def\linebetweencolumns + {\bgroup + \starttextproperties + \ifdim\@@kldistance>\zeropoint + \dimen0=\@@kldistance + \else + \dimen0=\linewidth + \fi + \advance\dimen0 -\linewidth + \hskip.5\dimen0 + \vrule + \!!width\linewidth + \ifb@selinebottom\!!depth\strutdepth\fi + \hskip.5\dimen0\relax + \stoptextproperties + \egroup} + +\def\spacebetweencolumns + {\hskip\@@kldistance} + +\presetlocalframed[\??kl] + +\def\backgroundfinishcolumnbox + {\doifinsetelse\@@kloffset{\v!none,\v!overlay} + {\let\@@kloffset\!!zeropoint} + {\scratchdimen\@@kloffset + \advance\scratchdimen -\@@klrulethickness + \edef\@@kloffset{\the\scratchdimen}}% + \localframed + [\??kl] + [\c!strut=\v!no, + \c!width=\v!fit, + \c!height=\v!fit, + \c!align=]} + +\let\restorecolumnsettings\relax + +\definecomplexorsimpleempty\startcolumns + +\def\complexstartcolumns[#1]% %% \startcolumns + {\bgroup + \let\stopcolumns\egroup + \ifinsidecolumns + \else + \setupcolumns[#1]% + \ifnum\@@kln>1\relax + \whitespace + \begingroup + \doif\@@kloption\v!background + {\let\finishcolumnbox\backgroundfinishcolumnbox + \let\columntextoffset\@@kloffset}% + \ifx\@@klcommand\empty\else + \let\postprocesscolumnline\@@klcommand + \fi + \doifelsenothing\@@klheight + \heightencolumnsfalse + \heightencolumnstrue + \doifelse\@@kldirection\v!right + \reversecolumnsfalse + \reversecolumnstrue + \doifelse\@@klbalance\v!yes + \balancecolumnstrue + \balancecolumnsfalse +\installalign\v!yes {\stretchcolumnstrue \inheritcolumnsfalse}% todo: new key +\installalign\v!no {\stretchcolumnsfalse\inheritcolumnsfalse}% todo: new key +\installalign\v!text{\stretchcolumnsfalse\inheritcolumnstrue }% +\stretchcolumnsfalse +\inheritcolumnstrue +\doifsomething\@@klalign{\expanded{\setupalign[\@@klalign]}}% +% \processaction +% [\@@klalign] +% [ \v!yes=>\stretchcolumnstrue +% \inheritcolumnsfalse, +% \v!no=>\stretchcolumnsfalse +% \inheritcolumnsfalse, +% \v!text=>\stretchcolumnsfalse +% \inheritcolumnstrue]% + \nofcolumns=\@@kln + % + % probably more is needed, and how about nesting save's + % + \savecurrentblank + \savecurrentwhitespace + \def\restorecolumnsettings + {\boxmaxdepth\maxdimen % done elsewhere + \restorecurrentblank + \restorecurrentwhitespace}% + % + \edef\fixedcolumnheight{\@@klheight}% + \edef\minbalancetoplines{\@@klntop}% + \setuptolerance[\@@kltolerance]% %% \startcolumns + \setupblank[\@@klblank]% + \ifdim\ctxparskip>\zeropoint\relax + \setupwhitespace[\@@klblank]% + \fi + \def\stopcolumns + {\endmulticolumns + \global\insidecolumnsfalse + \endgroup + \egroup}% + \global\insidecolumnstrue + \beginmulticolumns + \fi + \fi} + +\installcolumnbreakhandler {MUL} \v!preference + {\goodbreak} + +\installcolumnbreakhandler {MUL} \v!yes + {\par % todo: since + {\testrulewidth\zeropoint\ruledvskip\textheight} % we misuse a + \penalty-200 % side effect + \vskip-\textheight + }% bugged : \prevdepth-\thousandpoint} % signals top of column to \blank + +%D New: only at start of columns; may change ! Rather +%D interwoven and therefore to be integrated when the multi +%D column modules are merged. (moved from cont-new.tex) + +\def\setupcolumnspan[#1]% + {\getparameters[\??ks][#1]} + +\presetlocalframed + [\??ks] + +\setupcolumnspan + [\c!n=2, + \c!offset=\v!overlay, + \c!frame=\v!off] + +\newbox\columnspanbox \let\postprocesscolumnspanbox\gobbleoneargument + +\def\dostartcolumnspan[#1]% + {\bgroup + \setupcolumnspan[#1]% + \forgetall + \ifinsidecolumns + \advance\hsize \intercolumnwidth + \hsize\@@ksn\hsize + \advance\hsize -\intercolumnwidth + \fi + \dowithnextbox + {\setbox\columnspanbox\flushnextbox + \ifinsidecolumns\wd\columnspanbox\hsize\fi + \postprocesscolumnspanbox\columnspanbox + \scratchdimen\ht\columnspanbox + \setbox\columnspanbox\hbox % depth to be checked, probably option! + {\localframed[\??ks][\c!offset=\v!overlay]{\box\columnspanbox}}% + \ht\columnspanbox\scratchdimen + \dp\columnspanbox\strutdp + \wd\columnspanbox\hsize + \ifinsidecolumns + \ifnum\@@ksn>1 + \setvsize + \dohandleallcolumns + {\ifnum\currentcolumn>\@@ksn\else + \global\setbox\currenttopcolumnbox=\vbox + {\ifnum\currentcolumn=1 + \snaptogrid\vbox{\copy\columnspanbox} + \else + \snaptogrid\vbox{\vphantom{\copy\columnspanbox}} + \fi}% + \wd\currenttopcolumnbox\hsize + \global\advance\vsize -\ht\currenttopcolumnbox + \fi} + \global\pagegoal\vsize + \else + \snaptogrid\vbox{\box\columnspanbox} + \fi + \else + \snaptogrid\vbox{\box\columnspanbox} + \fi + \endgraf + \ifvmode\prevdepth\strutdp\fi + \egroup} + \vbox\bgroup + %\topskipcorrection % becomes an option ! + \EveryPar{\begstrut\EveryPar{}}} % also ! + +\def\startcolumnspan + {\dosingleempty\dostartcolumnspan} + +\def\stopcolumnspan + {\egroup} + +\setupcolumns + [\c!n=2, + \c!ntop=1, + \c!command=, + \c!direction=\v!right, + \c!rule=\v!off, + \c!tolerance=\v!tolerant, + \c!distance=1.5\bodyfontsize, % influenced by switching + \c!height=, + \c!balance=\v!yes, + \c!align=\v!text, + \c!blank={\v!line,\v!fixed}, + \c!option=, + \c!rulethickness=\linewidth, + \c!offset=.5\bodyfontsize] + +%D Undocumented and still under development. + +\def\startsimplecolumns + {\dosingleempty\dostartsimplecolumns} + +\def\dostartsimplecolumns[#1]% + {\bgroup + \nopenalties + \getparameters[\??kl] + [\c!width=\hsize,\c!distance=1.5\bodyfontsize,% + \c!n=2,\c!lines=0,#1]% + \let\rigidcolumnlines\@@kllines + \setrigidcolumnhsize\@@klwidth\@@kldistance\@@kln + \setbox\scratchbox\vbox\bgroup + \forgetall} % \blank[\v!disable] + +\def\stopsimplecolumns + {\removebottomthings + \egroup + \rigidcolumnbalance\scratchbox + \egroup} + +\protect \endinput diff --git a/tex/context/base/page-mul.mkiv b/tex/context/base/page-mul.mkiv new file mode 100644 index 000000000..789cfbe43 --- /dev/null +++ b/tex/context/base/page-mul.mkiv @@ -0,0 +1,1755 @@ +%D \module +%D [ file=page-mul, % was: core-mul +%D version=1998.03.15, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Multi Column Output, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Simple Multi Column} + +%D This module is mostly a copy from the original multi column +%D routine as implemented in \type {core-mul}. When the main +%D OTR macro's were isolated in modules and column sets were +%D introduced, this module became part of the OTR modules. As +%D a result this module is no longer generic. It also needs +%D an overhaul. + +\unprotect + +% TO DO ! + +\let\OTRMULsetvsize \OTRONEsetvsize +\let\OTRMULsethsize \OTRONEsethsize +\let\OTRMULdopagecontents \OTRONEdopagecontents +\let\OTRMULfinalsidefloatoutput\OTRONEfinalsidefloatoutput % ??? +\let\OTRMULflushfloatbox \OTRONEflushfloatbox + +\let\OTRMULdosettopinserts \relax +\let\OTRMULdosetbotinserts \relax +\let\OTRMULdotopinsertions \relax +\let\OTRMULdobotinsertions \relax +\let\OTRMULdosetbothinserts \relax +\let\OTRMULflushsavedfloats \relax + +\let\OTRMULflushsidefloats \forgetsidefloats % \relax +\let\OTRMULsynchronizesidefloats\forgetsidefloats % \relax + +\newtoks \OTRMULoutput + +\def\OTRMULgotonextpage + {\ejectpage} + +\def\OTRMULgotonextpageX % will become obsolete + {\superejectpage} + +% check \count multiplications + +% some day try this in balancing routine +% +% \ifdim\pagetotal>\pagegoal +% \eject +% \else +% \goodbreak +% \fi + +%D The following macro's implement a multi||column output +%D routine. The original implementation was based on Donald +%D Knuth's implementation, which was adapted by Craig Platt to +%D support balancing of the last page. I gradually adapted +%D Platt's version to our needs but under certain +%D circumstances things still went wrong. I considered all +%D calls to Platt's \type{\balancingerror} as undesirable. + +%D This completely new implementation can handle enough +%D situations for everyday documents, but is still far from +%D perfect. While at the moment the routine doesn't support +%D all kind of floats, it does support: +%D +%D \startitemize[packed] +%D \item an unlimitted number of columns +%D \item ragged or not ragged bottoms +%D \item optional balancing without \type{\balancingerrors} +%D \item different \type{\baselineskips}, \type{\spacing}, +%D \type{\topskip} and \type{\maxdepth} +%D \item left- and right indentation, e.g. within lists +%D \item moving columns floats to the next column or page +%D \item handling of floats that are to wide for a columns +%D \stopitemize +%D +%D One could wonder why single and multi||columns modes are +%D still separated. One reason for this is that \TeX\ is not +%D suited well for handling multi||columns. As a result, the +%D single columns routines are more robust. Handling one +%D column as a special case of multi||columns is posible but at +%D the cost of worse float handling, worse page breaking, +%D worse etc. Complicated multi||column page handling should +%D be done in \cap{DTP}||systems anyway. +%D +%D There are three commands provided for entering and leaving +%D multi||column mode and for going to the next column: +%D +%D \interface \type{\beginmulticolumns} \\ \\ +%D \interface \type{\endmulticolumns} \\ \\ +%D \interface \type{\ejectcolumn} \\ \\ +%D +%D This routines are sort of stand||alone. They communicate +%D with the rest of \CONTEXT\ by means of some interface +%D macro's, which we only mention. +%D +%D \interface \type{\nofcolumns} \\ +%D the number of columns \\ +%D \interface \type{\minbalancetoplines} \\ +%D the minimum number op balanced top lines \\ +%D \interface \type{\betweencolumns} \\ +%D the stuff between columns \\ +%D \interface \type{\finaloutput{action}{box}} \\ +%D some kind of \type{\pagebody} and \type{\shipout} \\ +%D +%D \interface \type{\ifbalancecolumns} \\ +%D balancing the colums or not \\ +%D \interface \type{\ifstretchcolumns} \\ +%D ragging the bottom or not \\ +%D +%D \interface \type{\ifheightencolumns} \\ +%D fix the heigh tor not \\ +%D \interface \type{\fixedcolumnheight} \\ +%D the optional fixed height \\ +%D +%D \interface \type{\ifinheritcolumns} \\ +%D handle ragging or not \\ +%D \interface \type{\ifr@ggedbottom} \\ +%D use ragged bottoms \\ +%D \interface \type{\ifb@selinebottom} \\ +%D put the bottom line on the baseline \\ +%D \interface \type{\ifnormalbottom} \\ +%D put the bottom line at the baseline \\ +%D +%D \interface \type{\ifreversecolumns} \\ +%D reverse the order in wich columns are flushed \\ +%D +%D \interface \type{\usercolumnwidth} \\ +%D the calculated width of a column \\ +%D \interface \type{\columntextwidth} \\ +%D the maximum width of a column \\ +%D \interface \type{\columntextheight} \\ +%D the minimum width of a column \\ +%D +%D \interface \type{\spacingfactor} \\ +%D the spacing factor \\ +%D \interface \type{\bodyfontsize} \\ +%D the (local) bodyfontsize \\ +%D \interface \type{\openlineheight} \\ +%D the lineheight (including \type{\spacing}) \\ +%D +%D \interface \type{\EveryBodyFont} \\ +%D communication channel to font switching routines \\ +%D +%D \interface \type{\global\settopskip} \\ +%D set \type{\topskip} \\ +%D \interface \type{\setvsize} \\ +%D set \type{\vsize} and \type{\pagegoal} \\ +%D \interface \type{\sethsize} \\ +%D set \type{\hsize} \\ +%D +%D \interface \type{\flushcolumnfloats} \\ +%D push saved column floats (next page) \\ +%D \interface \type{\flushcolumnfloat} \\ +%D push saved column floats (next column) \\ +%D \interface \type{\setcolumnfloats} \\ +%D initialize column floats \\ +%D +%D \interface \type{\finishcolumnbox} \\ +%D do something special (a hook) \\ +%D \interface \type{\postprocesscolumnpagebox} \\ +%D do something with each columnbox (also a hook) \\ +%D \interface \type{\postprocesscolumnbox} \\ +%D do something with each columnbox (also a hook) \\ +%D \interface \type{\postprocesscolumnline} \\ +%D do something with each columnline (also a hook) \\ +%D \interface \type{\currentcolumn} \\ +%D the current column \\ +%D +%D These interface macro's are called upon or initialized +%D by the multi||column macro's. + +%D A lot of footnote stuff added! + +\def\finalcolumntextwidth {\makeupwidth} +\def\finalcolumntextheight {\textheight} +\def\columntextwidth {\makeupwidth} +\def\columntextheight {\textheight} +\def\usercolumnwidth {\textwidth} +\def\columntextoffset {\!!zeropoint} + +\def\fixedcolumnheight {\textheight} +\def\betweencolumns {\hskip\bodyfontsize} + +\let\setcolumnfloats \relax % in CONTEXT used for floats +\let\flushcolumnfloats \relax % in CONTEXT used for floats +\let\flushcolumnfloat \relax % in CONTEXT used for floats +\let\finishcolumnbox \relax % in CONTEXT used for backgrounds + +% %D In fact, the column height and width are set by means of +% %D two macro's. One can change their meaning if needed: +% +% \def\setcolumntextheight +% {\def\columntextheight{\teksthoogte}} +% +% \def\setcolumntextwidth +% {\def\columntextwidth{\zetbreedte}} + +%D Both macros are redefined in \CONTEXT\ when backgrounds +%D are applied to columns. The final values are used when +%D flushing the columns. + +\newtoks\singlecolumnout % remove that one + +%D It's more convenient to use \type {\columnwidth} instead +%D of messing around with boxes each time. + +\newdimen\columnwidth +\newdimen\gutterwidth + +\def\determinecolumnwidth + {\bgroup + \setbox\scratchbox\hbox + {\setcolumnhsize + \global\columnwidth\usercolumnwidth + \global\gutterwidth\intercolumnwidth}% + \egroup} + +%D Going to a new columns is done by means of a +%D \type{\ejectcolumn}. The following definition does not +%D always work. + +\def\ejectcolumn + {\goodbreak\showmessage\m!columns2\empty} + +%D The next macro should never be called so let's deal with it. +%D There were several solutions to these kind of errors. First +%D we check for a good breakpoint before firing up the +%D multi||column routine (\type{\break} or \type{\allowbreak}). +%D We do the same at the end of the routine +%D (\type{\allowbreak}). These allowances are definitely +%D needed! +%D +%D Some on first sight redundant calls to for instance +%D \type{\setvsize} in the flushing, splitting and balancing +%D macro's can definitely not be omitted! Some are just there +%D to handle situations that only few times arise. One of +%D those can be that the output routine is invoked before +%D everything is taken care of. This happens when we +%D flush (part of) the current page with an \type{\unvbox} +%D with a \type{\pagetotal}~$\approx$ \type{\pagegoal}. One +%D simply cannot balance columns that are just balanced. +%D +%D I hope one never sees the following message. Because it +%D took me a lot of time to develop the multi||columns +%D routines, every (although seldom) warning gives me the +%D creeps! + +\def\balancingerror + {\showmessage\m!columns3\empty + \finaloutput\unvbox\normalpagebox} + +\def\OTRMULsometopsfloat{\showmessage\m!columns4\empty \someherefloat} +\def\OTRMULsomebotsfloat{\showmessage\m!columns5\empty \someherefloat} + +\def\OTRMULsomeherefloat{\OTRONEsomeherefloat} + +%D The local column width is available in the dimension +%D register \type{\localcolumnwidth}, which is calculated as: + +\def\setcolumnhsize % beware, this one is available for use in macros + {\setbox\scratchbox\hbox{\parindent\zeropoint\betweencolumns}% + \intercolumnwidth\wd\scratchbox + \localcolumnwidth\columntextwidth + \advance\localcolumnwidth -\leftskip + \advance\localcolumnwidth -\rightskip + % new + \advance\localcolumnwidth -\colleftskip + \advance\localcolumnwidth -\colrightskip + % + \advance\localcolumnwidth -\nofcolumns\intercolumnwidth + \advance\localcolumnwidth \intercolumnwidth + \divide \localcolumnwidth \nofcolumns + \scratchdimen\columntextoffset + \multiply\scratchdimen \plustwo + \advance\localcolumnwidth -\scratchdimen + \usercolumnwidth\localcolumnwidth + \hsize\localcolumnwidth} % we don't do it \global + +%D Torture test: +%D +%D \startbuffer +%D \startbuffer[b] +%D \startcolumns +%D \input tufte +%D \stopcolumns +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower +%D \input tufte +%D \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startcolumns \startnarrower +%D \input tufte +%D \stopnarrower \stopcolumns +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower \startcolumns +%D \input tufte +%D \stopcolumns \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startcolumns \startnarrower[left] +%D \input tufte +%D \stopnarrower \stopcolumns +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower[left] \startcolumns +%D \input tufte +%D \stopcolumns \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower \startcolumns \startnarrower +%D \input tufte +%D \stopnarrower\stopcolumns \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D +%D \startbuffer[b] +%D \startnarrower[left] \startcolumns \startnarrower +%D \input tufte +%D \stopnarrower\stopcolumns \stopnarrower +%D \stopbuffer +%D \typebuffer[b] \getbuffer[b] +%D \stopbuffer +%D +%D \start +%D \def\postprocesscolumnline#1{\ruledhbox{\strut\box#1}\hss} +%D \getbuffer +%D \stop + +%D One should be aware that when font related dimensions are +%D used in typesetting the in||between material, these +%D dimensions are influenced by bodyfont switches inside +%D multi||column mode. + +\newdimen\mcscratchdimen +\newcount\nofcolumnlines + +\chardef\multicolumnlinemethod\zerocount % 0: overshoot (old default), 1: tight +% \chardef\multicolumnlinemethod\plusone + +\def\getmulticolumnlines + {\mcscratchdimen-\columntextoffset + \multiply\mcscratchdimen \plustwo + \advance\mcscratchdimen \columntextheight + \ifdim\precolumnboxheight>\zeropoint + \advance\mcscratchdimen -\precolumnboxheight + \fi + \settotalinsertionheight + \advance\mcscratchdimen -\totalinsertionheight + \ifcase\multicolumnlinemethod \getnoflines\mcscratchdimen + \or \getrawnoflines\mcscratchdimen + \else \getrawnoflines\mcscratchdimen + \fi + % added 30/7/2004 + \ifnum\layoutlines>\zerocount \ifnum\noflines>\layoutlines + \noflines\layoutlines + \fi \fi + \nofcolumnlines\noflines} + +\def\multicolumnovershootratio{.5} % {\ifgridsnapping0\else.5\fi} + +\def\setcolumnvsize + {\getmulticolumnlines + \mcscratchdimen\nofcolumnlines\openlineheight + \advance\mcscratchdimen \multicolumnovershootratio\openlineheight % collect enough data + \global\vsize\nofcolumns\mcscratchdimen + \global\pagegoal\vsize} % let's do it only here + +%D It really starts here. After some checks and initializations +%D we change the output routine to continous multi||column +%D mode. This mode handles columns that fill the current and +%D next full pages. The method used is (more or less) +%D multiplying \type{\vsize} and dividing \type{\hsize} by +%D \type{\nofcolumns}. More on this can be found in the +%D \TeX book. We save the top of the current page in box +%D \type{\precolumnbox}. +%D +%D We manipulate \type{\topskip} a bit, just to be shure that +%D is has no flexibility. This has te be done every time a +%D font switch takles place, because \type{\topskip} can depend +%D on this. +%D +%D Watch the trick with the \type{\vbox}. This way we get the +%D right interlining and white space. + +\def\beginmulticolumns + {\par + \flushnotes + \xdef\precolumndepth{\the\prevdepth}% + \begingroup + % new + \leftskip1\leftskip + \rightskip1\rightskip + \edef\colleftskip {\the\leftskip}% + \edef\colrightskip{\the\rightskip}% + \leftskip\zeropoint + \rightskip\zeropoint + % + \dontshowcomposition + %\setcolumntextwidth\relax + %\setcolumntextheight\relax + \widowpenalty\zerocount % is gewoon beter + \clubpenalty \zerocount % zeker bij grids + \ifsomefloatwaiting + \showmessage\m!columns6{\the\savednoffloats}% + \global\setbox\savedfloatlist\box\floatlist + \xdef\restoresavedfloats + {\global\savednoffloats\the\savednoffloats + \global\setbox\floatlist\box\savedfloatlist + \global\noexpand\somefloatwaitingtrue}% + \global\savednoffloats\zerocount + \global\somefloatwaitingfalse + \else + \global\let\restoresavedfloats\relax + \fi + \dimen0\dimexpr\pagetotal+\parskip+\openlineheight\relax + \ifdim\dimen0<\pagegoal + \allowbreak + \else + \break % Sometimes fails + \fi + \appendtoks\topskip1\topskip\to\everybodyfont + \the\everybodyfont % ugly here + \saveinterlinespace % ugly here + \initializecolumns\nofcolumns + \hangafter\zerocount + \hangindent\zeropoint + \everypar\emptytoks + \ifdim\pagetotal=\zeropoint \else + \verticalstrut + \vskip-\struttotal + \fi + \global\savedpagetotal\pagetotal + \global\singlecolumnout\output + %\global\output{\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}}% + \global\output{\global\setbox\precolumnbox\vbox{\dotopinsertions\unvbox\normalpagebox}}% + \eject % no \holdinginserts=1, can make footnote disappear ! + \global\precolumnboxheight\ht\precolumnbox + \global\output{\continuousmulticolumnsout}% + \setcolumnfloats + \dohandleallcolumns + {\global\setbox\currenttopcolumnbox\emptybox}% + \checkbegincolumnfootnotes + \activateotr{MUL}{ONE}% todo ! ! ! ! + \let\sethsize\setcolumnhsize + \let\setvsize\setcolumnvsize + \sethsize + \setvsize + \showcomposition} + +%D When we leave the multi||column mode, we have to process the +%D not yet shipped out part of the columns. When we don't +%D balance, we simply force a continuous output, but a balanced +%D output is more tricky. + +%D First we try to fill up the page and when all or something +%D is left we try to balance things. This is another useful +%D adaption of the ancesters of these macro's. It takes some +%D reasoning to find out what happens and maybe I'm making +%D some mistake, but it works. +%D +%D Voiding box \type{\precolumnbox} is sometimes necessary, +%D e.g. when there is no text given between \type{\begin..} +%D and \type{\end..}. The \type{\par} is needed! + +\chardef\multicolumnendsyncmethod\plusone % 1: old sync 2: new sync (cont-loc/project) / may fail ! ! ! ! + +\def\endmulticolumns + {%\par + \ifnum\multicolumnendsyncmethod=\plustwo + \synchronizeoutput + \else + % don't combine these + \vskip\lineheight + \vskip-\lineheight % take footnotes into account + \fi + \dontshowcomposition + \doflushcolumnfloat % added recently + %\doflushcolumnfloats % no, since it results in wrong top floats + \flushnotes % before start of columns + \par + \ifbalancecolumns + \ifnum\multicolumnendsyncmethod=\plusone + \global\output{\continuousmulticolumnsout}% + \goodbreak + \fi + \global\output{\balancedmulticolumnsout}% + \else + \goodbreak + \fi + \eject % the prevdepth is important, try e.g. toclist in + \prevdepth\zeropoint % columns before some noncolumned text text + \global\output\singlecolumnout + \global\output{\the\mainoutput}% % % % % todo + \ifvoid\precolumnbox\else + \unvbox\precolumnbox + \fi + \global\precolumnboxheight\zeropoint + \endgroup % here + \nofcolumns\plusone + \setvsize % the outer one! + \synchronizeoutput % new may 2004 / we need to: \pagegoal\vsize + \checkendcolumnfootnotes + \dosomebreak\allowbreak + \restoresavedfloats} + +%D Because some initializations happen three times, we +%D defined a macro for them. Erasing \type{\everypar} is +%D needed because we don't want anything to interfere. + +\def\setmulticolumnsout + {\everypar\emptytoks + \dontcomplain + \settopskip + \setmaxdepth + \topskip1\topskip + \splittopskip\topskip + \splitmaxdepth\maxdepth + \boxmaxdepth\maxdepth % dangerous + \emergencystretch\zeropoint\relax} % sometimes needed ! + +%D Flushing the page comes to pasting the columns together and +%D appending the result to box \type{\precolumnbox}, if not +%D void. I've seen a lot of implementations in which some skip +%D was put between normal text and multi||column text. When we +%D don't want this, the baselines can be messed up. I hope the +%D seemingly complicated calculation of a correction +%D \type{\kern} is adequate to overcome this. Although not +%D watertight, spacing is taken into account and even multiple +%D mode changes on one page go well. But cross your fingers and +%D don't blame me. +%D +%D One of the complications of flushing out the boxes is that +%D \type{\precolumnbox} needs to be \type{\unvbox}'ed, otherwise +%D there is too less flexibility in the page when using +%D \type{\r@ggedbottom}. It took a lot of time before these +%D kind of problems were overcome. Using \type{\unvbox} at the +%D wrong moment can generate \type{\balancingerror}'s. +%D +%D One can use the macros \type {\maxcolumnheight} and \type +%D {\maxcolumndepth} when generating material between columns +%D as well as postprocessing column lines. + +\let\maxcolumnheight=\zeropoint +\let\maxcolumndepth =\zeropoint + +\newbox\columnpagebox + +\def\setmaxcolumndimensions + {\let\maxcolumnheight\!!zeropoint + \let\maxcolumndepth \!!zeropoint + \dohandleallcolumns + {\ifdim\ht\currentcolumnbox>\maxcolumnheight + \edef\maxcolumnheight{\the\ht\currentcolumnbox}% + \fi + \ifdim\dp\currentcolumnbox>\maxcolumndepth + \edef\maxcolumndepth{\the\dp\currentcolumnbox}% + \fi}} + +\chardef\multicolumntopflushmethod\plusone % 0: no correction, 1: correction when topstuff, 2: correction, 3: correction++ +\chardef\multicolumntopalignmethod\plustwo % 0: nothing, 1: force grid, 2: follow grid + +\def\flushprecolumnboxnogrid + {\unvbox\precolumnbox} + +\def\flushprecolumnboxongrid + {\scratchdimen\savedpagetotal + \advance\scratchdimen -\ht\precolumnbox + \advance\scratchdimen -\dp\precolumnbox + \advance\scratchdimen -\topskip + \box\precolumnbox + \kern\scratchdimen} + +\newconditional\someprecolumncontent + +\def\flushcolumnedpage#1% + {\bgroup + \ifvoid\precolumnbox + \setfalse\someprecolumncontent % will be set elsewhere + \else + \settrue\someprecolumncontent +\mkprocessboxcontents\precolumnbox + \fi + \forgetall + \setmulticolumnsout + \showcomposition + \setmaxcolumndimensions + \dohandleallcolumns + {\mkprocesscolumncontents\currentcolumnbox}% + \postprocesscolumns + \dohandleallcolumns % \hbox i.v.m. \showcomposition + {\global\setbox\currentcolumnbox\hbox to \localcolumnwidth + {\box\currentcolumnbox + \global\wd\currentcolumnbox\localcolumnwidth + \ifheightencolumns + \global\ht\currentcolumnbox\fixedcolumnheight + \fi}}% + \setmaxcolumndimensions + \overlaycolumnfootnotes + \setbox\columnpagebox\vbox + {\hbox to \finalcolumntextwidth + {\hskip\colleftskip\relax % new, \relax needed + \ifreversecolumns + \@EA\dohandlerevcolumns + \else + \@EA\dohandleallcolumns + \fi + {\finishcolumnbox{\hbox + {\ifx\finishcolumnbox\relax\else\strut\fi + \box\currentcolumnbox}}% + \hfil}% + \unskip + \hskip\colrightskip}}% new + \scratchdimen\zeropoint + \dohandleallcolumns + {\ifdim-\ht\currenttopcolumnbox<\scratchdimen + \scratchdimen-\ht\currenttopcolumnbox + \fi + \global\setbox\currenttopcolumnbox\emptybox}% + \advance\scratchdimen \ht\columnpagebox + \setbox\scratchbox\hbox to \columntextwidth + {\vrule + \!!width\zeropoint + \!!height\scratchdimen + \!!depth\dp\columnpagebox + \dostepwiserecurse2\nofcolumns1{\hfil\betweencolumns}\hfil}% + \setbox\columnpagebox\hbox + {\box\columnpagebox + \hskip-\columntextwidth + \box\scratchbox}% + \postprocesscolumnpagebox % new, acts upon \box\columnpagebox + \ifconditional\someprecolumncontent + \settrue\someprecolumncontent + % next some incredible crappy code + \ifcase\multicolumntopalignmethod + \flushprecolumnboxnogrid % not on grid + \or + \flushprecolumnboxongrid % force on grid + \else\ifgridsnapping % somehow this junk fails in pascal + \flushprecolumnboxongrid % obey grid settings, force on grid + \else + \flushprecolumnboxnogrid % ignore grid settings, not on grid + \fi \fi + \fi + \global\precolumnboxheight\zeropoint + \setvsize + \dosomebreak\nobreak % hm, only needed when topstuff + \ifgridsnapping + \else + \ifcase\multicolumntopflushmethod + % sometimes method 1 goes wrong, so we need a way out; best sort this out + % when we run into it again + \or + % \input tufte \startcolumns \showbaselines \input tufte \stopcolumns \input tufte + \ifconditional\someprecolumncontent +% \scratchdimen\topskip +% \advance\scratchdimen -\openstrutheight +% \nointerlineskip +% \vskip-\scratchdimen + \nointerlineskip + \vskip\dimexpr\openstrutheight-\topskip\relax + \fi + \or +% \scratchdimen\topskip +% \advance\scratchdimen -\openstrutheight +% \nointerlineskip +% \vskip-\scratchdimen + \nointerlineskip + \vskip\dimexpr\openstrutheight-\topskip\relax + \or + % untested but maybe handy +% \scratchdimen\topskip +% \advance\scratchdimen -\openstrutheight +% \nointerlineskip +% \vskip-\scratchdimen +% \vskip-\lineheight +% \vbox{\strut}% + \nointerlineskip + \vskip\dimexpr\openstrutheight-\topskip-\lineheight\relax + \vbox{\strut}% + \fi + \fi + \prevdepth\openstrutdepth + \nointerlineskip + \dp\columnpagebox\zeropoint + \global\finalcolumnheights\ht\columnpagebox + \getnoflines\finalcolumnheights + \global\finalcolumnlines\noflines + \ifcase#1\else + % messy correction, we need to rewrite this module (newcolumns) + \setbox\columnpagebox\vbox + {\offinterlineskip + \scratchdimen\ht\columnpagebox + \advance\scratchdimen\dp\columnpagebox % we probably lost that one already + \box\columnpagebox + \vskip-\scratchdimen}% + \scratchdimen\noflines\openlineheight + \advance\scratchdimen-\openstrutdepth + \advance\scratchdimen-\openlineheight + \advance\scratchdimen\topskip + \ht\columnpagebox\scratchdimen + \dp\columnpagebox\openstrutdepth + % end of mess + \fi + \box\columnpagebox + \egroup} + +%D In case one didn't notice, finaly \type{\finishcolumnbox} is +%D applied to all boxes. One can use these hooks for special +%D purposes. +%D +%D Once upon a time I wanted to manipulate the individual lines +%D in a column. This feature is demonstrated in the two examples +%D below. +%D +%D \startbuffer +%D \def\postprocesscolumnline#1% or \postprocesscolumnbox +%D {\ruledhbox{\box#1}\hss} +%D +%D \startcolumns[n=4] +%D \dorecurse{25}{line: \recurselevel\par} +%D \stopcolumns +%D \stopbuffer +%D +%D \typebuffer +%D +%D Here we show the natural width of the lines: +%D +%D {\getbuffer} +%D +%D The next example does a bit more advanced manipulation: +%D +%D \startbuffer +%D \def\postprocesscolumnline#1% +%D {\ifodd\currentcolumn +%D \hfill\unhbox#1\relax +%D \else +%D \relax\unhbox#1\hfill +%D \fi} +%D +%D \startcolumns[n=4] +%D \dorecurse{25}{line \recurselevel\par} +%D \stopcolumns +%D \stopbuffer +%D +%D \typebuffer +%D +%D Here we also see an application of \type{\currentcolumn}: +%D +%D {\getbuffer} +%D +%D This feature is implemented using the reshape macros +%D presented in \type{supp-box}. + +\def\postprocesscolumns + {\ifx\postprocesscolumnline\undefined \else + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vtop + {\beginofshapebox + \unvbox\currentcolumnbox + \unskip\unskip + \endofshapebox + \reshapebox + {\dimen0\ht\shapebox + \dimen2\dp\shapebox + \setbox\shapebox\hbox to \hsize + {\postprocesscolumnline\shapebox}% + \ht\shapebox\dimen0 + \dp\shapebox\dimen2 + \box\shapebox}% + \flushshapebox + \everypar\emptytoks + \parskip\zeropoint % = \forgetall + \verticalstrut + \vskip-\struttotal + \vfil}}% + \fi + \ifx\postprocesscolumnbox\undefined \else + \dohandleallcolumns + {\global\setbox\currentcolumnbox\hbox + {\postprocesscolumnbox\currentcolumnbox}} + \fi} + +%D We default to doing nothing! + +\let\postprocesscolumnline =\undefined +\let\postprocesscolumnbox =\undefined +\let\postprocesscolumnpagebox=\relax + +%D \macros +%D {reversecolumnstrue} +%D +%D We can force the macro that takes care of combining +%D the columns, to flush them in the revere order. Of +%D course, by default we don't reverse. + +\newif\ifreversecolumns + +%D Here comes the simple splitting routine. It's a bit +%D longer than expected because of ragging bottoms or not. +%D This part can be a bit shorter but I suppose that I will +%D forget what happens. The splitting takes some already +%D present material (think of floats) into account! +%D +%D First we present some auxiliary routines. Any material, +%D like for instance floats, that is already present in the +%D boxes is preserved. + +\def\splitcolumn#1from \box#2to \dimen#3 top \box#4% + {\bgroup + \ifdim\ht#4>\zeropoint + \dimen0\dimen#3\relax + \dimen2\dimen0 + \advance\dimen0 -\ht#4% + \columnfootnotecorrection{#1}{\dimen0}% + \setbox0\vsplit#2 to \dimen0 + \global\setbox#1\vbox to \dimen2 + {\ifgridsnapping + \dimen0-\openstrutheight + \advance\dimen0 \topskip + \vskip\dimen0\copy#4\vskip-\dimen0 + \else + \unvcopy#4% + \fi + \fuzzysnappedbox\unvbox0 + \fakecolumnfootnotes{#1}}% + \else + \ifcase\clevernotes + \global\setbox#1\vsplit#2 to \dimen#3% + \global\setbox#1\vbox + {\fuzzysnappedbox\unvbox{#1}}% % or \box ? + \else + \columnfootnotecorrection{#1}{\dimen#3}% + \setbox0\vsplit#2 to \dimen#3% + \global\setbox#1\vbox to \dimen#3% + {\fuzzysnappedbox\unvbox0 + \fakecolumnfootnotes{#1}}% + \fi + \fi + \egroup} + +\def\splitcurrentcolumn from \box#1to \dimen#2% + {\splitcolumn\currentcolumnbox from \box#1 to \dimen#2 top \box\currenttopcolumnbox} + +\def\splitfirstcolumn from \box#1to \dimen#2% + {\splitcolumn\firstcolumnbox from \box#1 to \dimen#2 top \box\firsttopcolumnbox} + +\def\splitlastcolumn from \box#1to \dimen#2% + {\global\setbox\lastcolumnbox\vbox + {\unvcopy\lasttopcolumnbox + \fuzzysnappedbox\unvbox{#1}% + \fakecolumnfootnotes\lastcolumnbox}} + +%D NEW: still to be documented. + +\def\fakecolumnfootnotes#1% + {\relax + \ifcase\clevernotes\else + \ifnum#1=\lastcolumnbox + \fakenotes + \fi + \fi} + +\def\columnfootnotecorrection#1#2% + {\relax + \ifcase\clevernotes + % page notes + \or + \ifnum#1=\firstcolumnbox\relax + \calculatetotalclevernoteheight + \advance#2 -\totalnoteheight + \fi + \else + \ifnum#1=\lastcolumnbox\relax + \calculatetotalclevernoteheight + \advance#2 -\totalnoteheight + \fi + \fi} + +\def\overlaycolumnfootnotes + {\relax + \ifcase\clevernotes + % page notes + \else + \checknotepresence + \ifnotespresent + % the note box has the depth of the notefont + % because a column (i.e. first column has no depth, + % we need to anchor top down) + \bgroup + \ifcase\clevernotes\or + \getmulticolumnlines + \advance\nofcolumnlines \minustwo + \scratchdimen\nofcolumnlines\lineheight + \advance\scratchdimen \topskip + \setbox0\hbox + {\lower\scratchdimen\vbox{\placenoteinserts}}% + \ht0=\openstrutheight % \strutht + \dp0=\openstrutdepth % \strutdp + \scratchdimen\ht\firstcolumnbox + \global\setbox\firstcolumnbox\vbox to \scratchdimen + {\box\firstcolumnbox + \vskip-\scratchdimen + \box0}% + \else + % maybe here also \getmulticolumnlines + \scratchdimen\ht\firstcolumnbox + \advance\scratchdimen -\openstrutdepth % \strutdp + \getnoflines\scratchdimen + \advance\noflines \minustwo + \scratchdimen\noflines\lineheight + \advance\scratchdimen \topskip + \setbox0\hbox + {\lower\scratchdimen\vbox{\placenoteinserts}}% + \ht0=\openstrutheight % \strutht + \dp0=\openstrutdepth % \strutdp + \scratchdimen\ht\lastcolumnbox + \global\setbox\lastcolumnbox\vbox to \scratchdimen + {\box\lastcolumnbox + \vskip-\scratchdimen + box0}% + \fi + \egroup + \fi + \fi} + +%D Here comes the routine that splits the long box in columns. +%D The macro \type{\flushcolumnfloats} can be used to flush +%D either floats that were present before the multi||column +%D mode was entered, or floats that migrate to next columns. +%D Flushing floats is a delicate process. + +\def\continuousmulticolumnsout + {\bgroup + \forgetall + \setmulticolumnsout + \dontshowcomposition +% \dimen0=\columntextheight +% \advance\dimen0 -\precolumnboxheight +% \settotalinsertionheight +% \advance\dimen0 -\totalinsertionheight +% \ifgridsnapping % evt altijd, nog testen +% \getnoflines{\dimen0} +% \dimen0=\noflines\openlineheight +% \fi + \getmulticolumnlines + \dimen0=\nofcolumnlines\openlineheight + \dohandleallcolumns + {\splitcurrentcolumn from \box\normalpagebox to \dimen0}% + \setbox\restofpage\vbox{\unvbox\normalpagebox}% + \ifinheritcolumns + \ifr@ggedbottom % vreemd + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox to \ht\firstcolumnbox + {\dimen0\dp\currentcolumnbox + \unvbox\currentcolumnbox + \vskip-\dimen0 + \vskip\openstrutdepth % \strutdp + \prevdepth\openstrutdepth % \strutdp + \vfill}}% + \ifbottomnotes \else + \dimen0\ht\firstcolumnbox + \fi + \fi + \ifn@rmalbottom + \advance\dimen0 \maxdepth + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox to \dimen0 + {\unvbox\currentcolumnbox}}% + \fi + \ifb@selinebottom + % the columns are on top of the baseline + \fi + \else + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox to \dimen0 + {\ifstretchcolumns + \unvbox\currentcolumnbox + \else + \unvbox\currentcolumnbox % wel of niet \unvbox ? + \vfill + \fi}}% + \dohandleallcolumns + {\global\ht\currentcolumnbox\dimen0}% + \fi + \setbox\precolumnbox\vbox{\flushcolumnedpage\zerocount}% + \finaloutput\box\precolumnbox + \sethsize + \setvsize + \flushcolumnfloats + \unvbox\restofpage + % \penalty\outputpenalty % gaat gruwelijk mis in opsommingen + \egroup} + +%D And this is the balancing stuff. Again, part of the routine +%D is dedicated to handling ragged bottoms, but here we also +%D see some handling concerning the stretching of columns. +%D We set \type{\widowpenalty} at~0, which enables us to +%D balance columns with few lines. The use of \type{\box2} and +%D \type{\box4} garantees a more robust check when skips are +%D used. + +\def\multicolumnsbalancemax{250} % 100 is too small when floats are involved + +\def\balancedmulticolumnsout + {\bgroup + \setmulticolumnsout + \dontshowcomposition + \widowpenalty\zerocount + \setbox0\vbox{\unvbox\normalpagebox}% +\ifdim\ht0>\openlineheight % at least one line + \ifnum\minbalancetoplines<2 % balance anyway + \donetrue + \else % check criterium to available lines + \getnoflines{\ht0}% + \divide\noflines \nofcolumns \relax + \ifnum\noflines<\minbalancetoplines \relax + \dimen0\ht0 + \advance\dimen0 \ht\firsttopcolumnbox + \advance\dimen0 \openlineheight \relax % let's play safe + \ifdim\dimen0>\columntextheight % column exceeding text height + \donetrue + \else % it seems to fit + \donefalse + \fi + \else % balance indeed + \donetrue + \fi + \fi +\else % balancing does not make sense + \donefalse +\fi +\ifdone % start balancing + %\ifdim\ht0>\openlineheight + \dimen0\ht0 + \advance\dimen0 \topskip + \advance\dimen0 -\baselineskip + \dohandleallcolumns + {\advance\dimen0 \ht\currenttopcolumnbox}% + \divide\dimen0 \nofcolumns + \vbadness\!!tenthousand\relax + \count255=\zerocount + \bgroup + \ifgridsnapping + \dimen2\lineheight + \else + \dimen2=\onepoint % RUBISH + \dimen2=\spacingfactor\dimen2 + \fi + \doloop + {\advance\count255 \plusone + \global\setbox\restofpage\copy0\relax + \splitfirstcolumn from \box\restofpage to \dimen0 + \dohandlemidcolumns + {\splitcurrentcolumn from \box\restofpage to \dimen0}% + \splitlastcolumn from \box\restofpage to \dimen0 + \setbox2\vbox{\unvcopy\firstcolumnbox}% + \dimen4\zeropoint + \dohandleallcolumns + {\setbox4\vbox + {\unvcopy\currentcolumnbox + %rather new, test this on pdftex-z.tex + \unpenalty\unskip\unpenalty\unskip}% maybe better in main splitter + %\writestatus{balance}{\the\currentcolumnbox: \the\ht4}% +% \dimen6\ht4 \ifdim\dimen6>\dimen4 \dimen4=\dimen6 \fi}% + \ifdim\ht4>\dimen4 \dimen4=\ht4 \fi}% + \advance\dimen4 -.0005pt % get rid of accurracy problem, pretty new + \ifnum\count255>\multicolumnsbalancemax\relax + \exitloop + \else\ifdim\dimen4>\ht2 + \advance\dimen0 \dimen2\relax + \else + \exitloop + \fi\fi}% + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox{\unvcopy\currentcolumnbox}}% NIEUW + \ifnum\count255>\multicolumnsbalancemax\relax + \showmessage\m!columns7\empty + \else + \showmessage\m!columns8{\the\count255\space}% + \fi + \egroup + \ifinheritcolumns + % We cannot assume that the first column is the tallest, if + % only because we may have an aborted balance (one line in the + % first column and a graphic in the second one). + % + % \dimen0\ht\firstcolumnbox + % \dimen2\ht\firstcolumnbox + % + \dimen0=\zeropoint + \dohandleallcolumns + {\ifdim\ht\currentcolumnbox>\dimen0 + \dimen0=\ht\currentcolumnbox + \fi}% + \dimen2\dimen0 + % so far + \advance\dimen2 -\openlineheight + \dohandleallcolumns + {\dimen4\ht\currentcolumnbox + \dimen6=10\openlineheight % funny value + \global\setbox\currentcolumnbox\vbox to \dimen0 + {\unvbox\currentcolumnbox + \ifdim\dimen4>\dimen6 + \ifdim\dimen4<\dimen0 + \ifdim\dimen4>\dimen2 + \vskip\zeropoint % !! + \else + \vskip\openlineheight + \vfill + \fi + \else + \vskip\zeropoint + \fi + \else + \vskip\openlineheight + \vfill + \fi}}% + \else + \bgroup + \ifstretchcolumns + \dimen0\ht\firstcolumnbox + \dimen2=\bottomtolerance\ht\firstcolumnbox + \setbox0\vbox{\unvcopy\lastcolumnbox}% + \advance\dimen0 -\ht0\relax + \advance\dimen0 -\dp0\relax + \ifdim\dimen0>\openlineheight\relax + \ifdim\dimen0>\dimen2\relax + % \stretchcolumnsfalse % beter goed slecht dan slecht goed + \showmessage\m!columns9\empty + \fi + \fi + \fi + \dohandleallcolumns + {\global\setbox\currentcolumnbox\vbox to \ht\firstcolumnbox + {\ifstretchcolumns + \unvbox\currentcolumnbox + \else + \box\currentcolumnbox + \vfill + \fi}}% + \egroup + \fi + \else + % a one liner is not properly handled here, so best rewrite the text then + \showmessage\m!columns{10}\empty + \global\setbox\firstcolumnbox\vbox{\unvbox0}% + \fi + \global\output{\balancingerror}% + \b@selinebottomtrue % forces depth in separation rule + \flushcolumnedpage\plusone + \multicolumnseject + \egroup} + +\def\multicolumnseject + {\ifdim\pagetotal>\textheight + \eject % new + \else + \allowbreak + \fi} + +%D The multicolumn mechanism is incorporated in a \CONTEXT\ +%D interface, which acts like: +%D +%D \starttyping +%D \startcolumns[n=4,balance=no] +%D some text +%D \stopcolumns +%D \stoptyping +%D +%D The setup is optional. The default behaviour of columns +%D can be set up with: +%D +%D \starttyping +%D \setupcolumns +%D [n=2, +%D balance=yes] +%D \stoptyping +%D +%D In this case, stretching is according to the way it's +%D done outside columns (\type{\inheritcolumnstrue}). Also +%D we can setup the \type{tolerance} within a column, the +%D \type{distance} between columns and the fixed +%D \type{height} of a column. + +%D Multi||column output: the float routines +%D +%D Here come the routines that handle the placement of column +%D floats. Floats that are to big migrate to the next +%D column. Floats that are too wide, migrate to the top of the +%D next page, where they span as much columns as needed. +%D Floats that are left over from outside the multi||column +%D mode are flushed first. In macro \type{\finaloutput} the +%D topfloats that are left from previous text should be set. +%D +%D When there are some floats in the queue, we inhibit the +%D flushing of floats on top of columns. The number of +%D waiting floats is preswent in \type{\savednoftopfloats} and +%D is saved. As long as there are floats waiting, the topfloats +%D are places as if we are outside multi||column mode. This is +%D neccessary for e.g. multicolumn lists. +%D +%D When all those floats are flushed, we switch to the local +%D flushing routine. + +\def\setcolumnfloats + {\xdef\globalsavednoffloats{\the\savednoffloats}% + \ifnum\globalsavednoffloats>\zerocount + \setglobalcolumnfloats + \else + \setlocalcolumnfloats + \fi} + +\def\setglobalcolumnfloats + {\everypar\emptytoks + \let\flushcolumnfloat\relax + %\let\doroomfloat\relax + \let\docheckiffloatfits\relax + \let\flushcolumnfloats\noflushcolumnfloats} + +\def\setlocalcolumnfloats + {\everypar{\flushnotes\flushcolumnfloat\flushmargincontents\checkindentation}% + \let\flushcolumnfloat\doflushcolumnfloat + %\let\doroomfloat\docolumnroomfloat + \let\docheckiffloatfits\docolumnroomfloat + \let\flushcolumnfloats\doflushcolumnfloats + \let\doflushfloats\doflushcolumnfloats % new + \let\dosetbothinserts\relax + \let\dotopinsertions\relax} + +\def\noflushcolumnfloats + {\bgroup + \xdef\localsavednoffloats{\the\savednoffloats}% + \global\savednoffloats\globalsavednoffloats + \dotopinsertions + \xdef\globalsavenoffloats{\the\savednoffloats}% + \ifnum\globalsavednoffloats=\zerocount + \setlocalcolumnfloats + \fi + \global\savednoffloats\localsavednoffloats + \egroup} + +%D We need to calculate the amount of free space in a columns. +%D When there is not enough room, we migrate the float to the +%D next column. These macro's are alternatives (and +%D look||alikes) of \type{\doroomfloat}. When a float is to +%D wide, for one column, it is moved to the top of the next +%D page. Of course such moved floats have to be taken into +%D account when we calculate the available space. It's a pitty +%D that such things are no integral part of \TEX. + +\def\getcolumnstatus\column#1\total#2\goal#3\\% + {\dimen0=\ifdim\pagegoal<\maxdimen \pagetotal \else \zeropoint \fi + \dimen2=\zeropoint + \count255=\zerocount + \dimen8=\columntextheight + \advance\dimen8 -\precolumnboxheight + \def\dogetcolumnstatus + {\advance\count255 \plusone + \advance\dimen2 \ht\currenttopcolumnbox + \advance\dimen2 \dp\currenttopcolumnbox + \dimen4\dimen2 + \advance\dimen4 \dimen0 + \dimen6=\count255\dimen8 + \ifdim\dimen4>\dimen6 + \else + \let\dogetcolumnstatus\relax + \fi}% + \dohandleallcolumns{\dogetcolumnstatus}% + \ifnum\count255=0 \count255=1 \fi + #1=\count255 + #2=\dimen4 + #3=\dimen6 } + +\def\getinsertionheight + {\ifdim\pagegoal<\maxdimen + \bgroup + \dimen0=\columntextheight + \advance\dimen0 -\pagegoal + \xdef\insertionheight{\the\dimen0}% + \egroup + \else + \global\let\insertionheight\zeropoint + \fi} + +\def\docolumnroomfloat + {\ifpostponecolumnfloats + \global\roomforfloatfalse + \else\ifnofloatpermitted + \global\roomforfloatfalse + \else + \bgroup + \getcolumnstatus\column\count255\total\dimen0\goal\dimen2\\% + \advance\dimen0 2\openlineheight % nog nodig ? + %\ifnum\count255=\nofcolumns + % \getinsertionheight + % %\message{\insertionheight}\wait + % \advance\dimen0 \insertionheight + %\fi + \setbox\scratchbox\vbox % tricky met objecten ? + {\blank[\@@bkspacebefore] + \snaptogrid\vbox{\copy\floatbox}}% + \advance\dimen0 \ht\scratchbox + \advance\dimen0 .5\lineheight % needed because goal a bit higher + %\message{column: \the\count255; total: \the\dimen0; goal: \the\dimen2}\wait + \ifdim\dimen0>\dimen2 + \global\roomforfloatfalse + \else + \global\roomforfloattrue + \fi + \ifdim\wd\floatbox>\hsize + \showmessage\m!columns{11}\empty + \global\roomforfloatfalse + \fi + \egroup + \fi\fi} + +%D Flushing one float is done as soon as possible, i.e. +%D \type{\everypar}. This means that (at the moment) +%D sidefloats are not supported (overulled)! + +\newif\ifflushingcolumnfloats \flushingcolumnfloatstrue + +\def\doflushcolumnfloat + {\ifpostponecolumnfloats\else\ifflushingcolumnfloats\ifprocessingverbatim\else\ifsomefloatwaiting + \bgroup + \forgetall + \let\doflushcolumnfloat\relax + \getcolumnstatus\column\mofcolumns\total\dimen0\goal\dimen2\\% + \ifdim\dimen0>\zeropoint + \dogetfloat + \ifdim\wd\floatbox>\hsize + \doresavefloat + \else + %\setbox2=\vbox + % {\blank[\@@bkspacebefore] + % \snaptogrid\vbox{\copy\floatbox}% + % \blank[\@@bkspaceafter] + \setbox2=\vbox + {\blank[\@@bkspacebefore] + \snaptogrid\vbox{\copy\floatbox}}% + \advance\dimen0 \ht2 + \ifdim\dimen0>\dimen2 + \ifnum\mofcolumns<\nofcolumns + \advance\mofcolumns \plusone +%% bug %% \edef\currenttopcolumnbox{\getvalue{\@@topcol\the\count255}}% + \ifdim\ht\currenttopcolumnbox=\zeropoint + \global\setbox\currenttopcolumnbox\vbox + {\snaptogrid\vbox{\copy\floatbox} + \whitespace % nodig ? + \blank[\@@bkspaceafter]}% + \dimen4=\ht\currenttopcolumnbox + \advance\dimen4 \dp\currenttopcolumnbox + \global\advance\vsize -\dimen4 + \advance\dimen4 -\pagegoal + \global\pagegoal-\dimen4 + \showmessage\m!columns{12}a% + \else + \showmessage\m!columns{12}b% + \doresavefloat + \fi + \else + \showmessage\m!columns{12}c% + \doresavefloat + \fi + \else + \ifhmode{\setbox0\lastbox}\fi% waar is die er in geslopen + \par + \ifdim\prevdepth<\zeropoint \else % anders bovenaan kolom witruimte + \nobreak + \blank[\@@bkspacebefore] + \nobreak + \fi + \flushfloatbox + \blank[\@@bkspaceafter] + \fi + \fi + \fi + \egroup + \fi\fi\fi\fi} + +%D This one looks complicated. Upto \type{\nofcolumns} floats +%D are placed, taking the width of a float into account. This +%D routine can be improved on different ways: +%D +%D \startitemize[intro,packed] +%D \item taking into account some imaginary baseline, just to +%D get the captions in line +%D \item multipass flushing until as many floats are displaced +%D as possible +%D \stopitemize +%D +%D When handling lots of (small) floats spacing can get worse +%D because of lining out the columns. + +\def\doflushcolumnfloats + {\ifpostponecolumnfloats\else + \bgroup + \forgetall + \ifsomefloatwaiting + \dimen8\zeropoint + \dimen4\zeropoint + \count0\zerocount % count0 can be used local + \count2\nofcolumns % count2 can be used local + \dohandleallcolumns + {\ifnum\count0>\zerocount % the wide one's reserved space + \global\setbox\currenttopcolumnbox\vbox + {\snaptogrid\vbox + {\copy\currenttopcolumnbox + \hbox{\vphantom{\copy\floatbox}}} + \whitespace % nodig ? + \blank[\@@bkspaceafter]}% + \else + \dogetfloat + \ifdim\wd\floatbox>\finalcolumntextwidth % better somewhere else too + \global\setbox\floatbox\hbox to \finalcolumntextwidth{\hss\box\floatbox\hss}% + \fi % otherwise the graphic may disappear + \ifdim\wd\floatbox>\hsize + \dimen0\wd\floatbox + \advance\dimen0 \intercolumnwidth + \dimen2\hsize + \advance\dimen2 \intercolumnwidth + \advance\dimen0 .5pt % hm, why 1 + \advance\dimen2 .5pt % hm, why 2 + \divide\dimen0 \dimen2 + \count0\dimen0 + \advance\count0 \plusone + \ifnum\count0>\count2 + \doresavefloat + \count0\zerocount + \else + \dimen0=\count0\hsize + \advance\dimen0 \count0\intercolumnwidth + \advance\dimen0 -\intercolumnwidth + \global\setbox\floatbox\hbox to \dimen0 + %{\hss\hbox{\copy\floatbox}\hss}% + {\processaction[\@@bklocation] % how easy to forget + [ \v!left=>\copy\floatbox\hss, + \v!right=>\hss\copy\floatbox, + \s!default=>\hss\copy\floatbox\hss, + \s!unknown=>\hss\copy\floatbox\hss]}% + \fi + \showmessage\m!columns{13}\empty + \else + % \showmessage\m!columns{13}\empty + \fi + \ifdim\ht\floatbox>\zeropoint\relax + \global\setbox\currenttopcolumnbox\vbox + {\snaptogrid\vbox + {\copy\currenttopcolumnbox + \copy\floatbox} + \whitespace % nodig ? + \blank[\@@bkspaceafter]}% + \fi + \dimen6\ht\currenttopcolumnbox + \advance\dimen6 \dp\currenttopcolumnbox + \fi + \ifdim\dimen4<\ht\currenttopcolumnbox + \dimen4\ht\currenttopcolumnbox + \fi + \advance\dimen8 \dimen6 + \advance\count2 \minusone + \advance\count0 \minusone }% + \setvsize + \global\advance\vsize -\dimen8 + \global\pagegoal\vsize + \else + %\doflushfloats % does not snap! + \fi + \egroup + \fi} + +%D The next macro can be used to flush floats in the current +%D stream. No width checking is (yet) done. + +\def\insertcolumnfloats + {\doloop + {\ifsomefloatwaiting + \bgroup + \forgetall + % no check for width + \dogetfloat + \blank[\@@bkspacebefore] + \snaptogrid\vbox{\copy\floatbox} + \blank[\@@bkspaceafter] + \egroup + \else + \exitloop + \fi}} + +%D This were the multi||column routines. They can and need to +%D be improved but at the moment their behaviour is acceptable. +%D +%D One inprovement can be to normalize the height of floats +%D to $n\times$\type{\lineheight} with a macro like: +%D +%D \starttyping +%D \normalizevbox{...} +%D \stoptyping + +% border case, should fit on one page +% +% \startcolumns +% +% 1 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{1}} +% 2 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{2}} +% 3 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{3}} +% +% \stopcolumns + +\def\setupcolumns + {\dosingleempty\dosetupcolumns} + +\def\dosetupcolumns[#1]% + {\getparameters[\??kl][#1]% + \nofcolumns\@@kln\relax + \processaction + [\@@klrule] + [ \v!on=>\let\betweencolumns\linebetweencolumns, + \v!off=>\let\betweencolumns\spacebetweencolumns, + \s!default=>\let\betweencolumns\spacebetweencolumns, + \s!unknown=>\let\betweencolumns\@@klrule]} + +\def\linebetweencolumns + {\bgroup + \starttextproperties + \ifdim\@@kldistance>\zeropoint + \dimen0=\@@kldistance + \else + \dimen0=\linewidth + \fi + \advance\dimen0 -\linewidth + \hskip.5\dimen0 + \vrule + \!!width\linewidth + \ifb@selinebottom\!!depth\strutdepth\fi + \hskip.5\dimen0\relax + \stoptextproperties + \egroup} + +\def\spacebetweencolumns + {\hskip\@@kldistance} + +\presetlocalframed[\??kl] + +\def\backgroundfinishcolumnbox + {\doifinsetelse\@@kloffset{\v!none,\v!overlay} + {\let\@@kloffset\!!zeropoint} + {\scratchdimen\@@kloffset + \advance\scratchdimen -\@@klrulethickness + \edef\@@kloffset{\the\scratchdimen}}% + \localframed + [\??kl] + [\c!strut=\v!no, + \c!width=\v!fit, + \c!height=\v!fit, + \c!align=]} + +\definecomplexorsimpleempty\startcolumns + +\def\complexstartcolumns[#1]% %% \startcolumns + {\bgroup + \let\stopcolumns\egroup + \ifinsidecolumns + \else + \setupcolumns[#1]% + \ifnum\@@kln>1\relax + \whitespace + \begingroup + \doif\@@kloption\v!background + {\let\finishcolumnbox\backgroundfinishcolumnbox + \let\columntextoffset\@@kloffset}% + \ifx\@@klcommand\empty\else + \let\postprocesscolumnline\@@klcommand + \fi + \doifelsenothing\@@klheight + \heightencolumnsfalse + \heightencolumnstrue + \doifelse\@@kldirection\v!right + \reversecolumnsfalse + \reversecolumnstrue + \doifelse\@@klbalance\v!yes + \balancecolumnstrue + \balancecolumnsfalse + \installalign\v!yes {\stretchcolumnstrue \inheritcolumnsfalse}% todo: new key + \installalign\v!no {\stretchcolumnsfalse\inheritcolumnsfalse}% todo: new key + \installalign\v!text{\stretchcolumnsfalse\inheritcolumnstrue }% + \stretchcolumnsfalse + \inheritcolumnstrue + \doifsomething\@@klalign{\expanded{\setupalign[\@@klalign]}}% + \nofcolumns=\@@kln + % + % probably more is needed, and how about nesting save's + % + \saveouterspacing + % + \edef\fixedcolumnheight{\@@klheight}% + \edef\minbalancetoplines{\@@klntop}% + \setuptolerance[\@@kltolerance]% %% \startcolumns + \setupblank[\@@klblank]% + \ifdim\ctxparskip>\zeropoint\relax + \setupwhitespace[\@@klblank]% + \fi + \def\stopcolumns + {\endmulticolumns + \global\insidecolumnsfalse + \endgroup + \egroup}% + \global\insidecolumnstrue + \beginmulticolumns + \fi + \fi} + +\installcolumnbreakhandler {MUL} \v!preference + {\goodbreak} + +\installcolumnbreakhandler {MUL} \v!yes + {\par % todo: since + {\testrulewidth\zeropoint\ruledvskip\textheight} % we misuse a + \penalty-200 % side effect + \vskip-\textheight + }% bugged : \prevdepth-\thousandpoint} % signals top of column to \blank + +%D New: only at start of columns; may change ! Rather +%D interwoven and therefore to be integrated when the multi +%D column modules are merged. (moved from cont-new.tex) + +\def\setupcolumnspan[#1]% + {\getparameters[\??ks][#1]} + +\presetlocalframed + [\??ks] + +\setupcolumnspan + [\c!n=2, + \c!offset=\v!overlay, + \c!frame=\v!off] + +\newbox\columnspanbox \let\postprocesscolumnspanbox\gobbleoneargument + +\def\dostartcolumnspan[#1]% + {\bgroup + \setupcolumnspan[#1]% + \forgetall + \ifinsidecolumns + \advance\hsize \intercolumnwidth + \hsize\@@ksn\hsize + \advance\hsize -\intercolumnwidth + \fi + \dowithnextbox + {\setbox\columnspanbox\flushnextbox + \ifinsidecolumns\wd\columnspanbox\hsize\fi + \postprocesscolumnspanbox\columnspanbox + \scratchdimen\ht\columnspanbox + \setbox\columnspanbox\hbox % depth to be checked, probably option! + {\localframed[\??ks][\c!offset=\v!overlay]{\box\columnspanbox}}% + \ht\columnspanbox\scratchdimen + \dp\columnspanbox\strutdp + \wd\columnspanbox\hsize + \ifinsidecolumns + \ifnum\@@ksn>1 + \setvsize + \dohandleallcolumns + {\ifnum\currentcolumn>\@@ksn\else + \global\setbox\currenttopcolumnbox=\vbox + {\ifnum\currentcolumn=1 + \snaptogrid\vbox{\copy\columnspanbox} + \else + \snaptogrid\vbox{\vphantom{\copy\columnspanbox}} + \fi}% + \wd\currenttopcolumnbox\hsize + \global\advance\vsize -\ht\currenttopcolumnbox + \fi} + \global\pagegoal\vsize + \else + \snaptogrid\vbox{\box\columnspanbox} + \fi + \else + \snaptogrid\vbox{\box\columnspanbox} + \fi + \endgraf + \ifvmode\prevdepth\strutdp\fi + \egroup} + \vbox\bgroup + %\topskipcorrection % becomes an option ! + \EveryPar{\begstrut\EveryPar{}}} % also ! + +\def\startcolumnspan + {\dosingleempty\dostartcolumnspan} + +\def\stopcolumnspan + {\egroup} + +\setupcolumns + [\c!n=2, + \c!ntop=1, + \c!command=, + \c!direction=\v!right, + \c!rule=\v!off, + \c!tolerance=\v!tolerant, + \c!distance=1.5\bodyfontsize, % influenced by switching + \c!height=, + \c!balance=\v!yes, + \c!align=\v!text, + \c!blank={\v!line,\v!fixed}, + \c!option=, + \c!rulethickness=\linewidth, + \c!offset=.5\bodyfontsize] + +%D Undocumented and still under development. + +\def\startsimplecolumns + {\dosingleempty\dostartsimplecolumns} + +\def\dostartsimplecolumns[#1]% + {\bgroup + \nopenalties + \getparameters[\??kl] + [\c!width=\hsize,\c!distance=1.5\bodyfontsize,% + \c!n=2,\c!lines=0,#1]% + \let\rigidcolumnlines\@@kllines + \setrigidcolumnhsize\@@klwidth\@@kldistance\@@kln + \setbox\scratchbox\vbox\bgroup + \forgetall} % \blank[\v!disable] + +\def\stopsimplecolumns + {\removebottomthings + \egroup + \rigidcolumnbalance\scratchbox + \egroup} + +\protect \endinput diff --git a/tex/context/base/page-mul.tex b/tex/context/base/page-mul.tex deleted file mode 100644 index c78af074a..000000000 --- a/tex/context/base/page-mul.tex +++ /dev/null @@ -1,1773 +0,0 @@ -%D \module -%D [ file=page-mul, % was: core-mul -%D version=1998.03.15, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Multi Column Output, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Simple Multi Column} - -%D This module is mostly a copy from the original multi column -%D routine as implemented in \type {core-mul}. When the main -%D OTR macro's were isolated in modules and column sets were -%D introduced, this module became part of the OTR modules. As -%D a result this module is no longer generic. It also needs -%D an overhaul. - -\unprotect - -% TO DO ! - -\let\OTRMULsetvsize \OTRONEsetvsize -\let\OTRMULsethsize \OTRONEsethsize -\let\OTRMULdopagecontents \OTRONEdopagecontents -\let\OTRMULfinalsidefloatoutput\OTRONEfinalsidefloatoutput % ??? -\let\OTRMULflushfloatbox \OTRONEflushfloatbox - -\let\OTRMULdosettopinserts \relax -\let\OTRMULdosetbotinserts \relax -\let\OTRMULdotopinsertions \relax -\let\OTRMULdobotinsertions \relax -\let\OTRMULdosetbothinserts \relax -\let\OTRMULflushsavedfloats \relax - -\let\OTRMULflushsidefloats \forgetsidefloats % \relax -\let\OTRMULsynchronizesidefloats\forgetsidefloats % \relax - -\newtoks \OTRMULoutput - -\def\OTRMULgotonextpage - {\ejectpage} - -\def\OTRMULgotonextpageX % will become obsolete - {\superejectpage} - -% check \count multiplications - -% some day try this in balancing routine -% -% \ifdim\pagetotal>\pagegoal -% \eject -% \else -% \goodbreak -% \fi - -%D The following macro's implement a multi||column output -%D routine. The original implementation was based on Donald -%D Knuth's implementation, which was adapted by Craig Platt to -%D support balancing of the last page. I gradually adapted -%D Platt's version to our needs but under certain -%D circumstances things still went wrong. I considered all -%D calls to Platt's \type{\balancingerror} as undesirable. - -%D This completely new implementation can handle enough -%D situations for everyday documents, but is still far from -%D perfect. While at the moment the routine doesn't support -%D all kind of floats, it does support: -%D -%D \startitemize[packed] -%D \item an unlimitted number of columns -%D \item ragged or not ragged bottoms -%D \item optional balancing without \type{\balancingerrors} -%D \item different \type{\baselineskips}, \type{\spacing}, -%D \type{\topskip} and \type{\maxdepth} -%D \item left- and right indentation, e.g. within lists -%D \item moving columns floats to the next column or page -%D \item handling of floats that are to wide for a columns -%D \stopitemize -%D -%D One could wonder why single and multi||columns modes are -%D still separated. One reason for this is that \TeX\ is not -%D suited well for handling multi||columns. As a result, the -%D single columns routines are more robust. Handling one -%D column as a special case of multi||columns is posible but at -%D the cost of worse float handling, worse page breaking, -%D worse etc. Complicated multi||column page handling should -%D be done in \cap{DTP}||systems anyway. -%D -%D There are three commands provided for entering and leaving -%D multi||column mode and for going to the next column: -%D -%D \interface \type{\beginmulticolumns} \\ \\ -%D \interface \type{\endmulticolumns} \\ \\ -%D \interface \type{\ejectcolumn} \\ \\ -%D -%D This routines are sort of stand||alone. They communicate -%D with the rest of \CONTEXT\ by means of some interface -%D macro's, which we only mention. -%D -%D \interface \type{\nofcolumns} \\ -%D the number of columns \\ -%D \interface \type{\minbalancetoplines} \\ -%D the minimum number op balanced top lines \\ -%D \interface \type{\betweencolumns} \\ -%D the stuff between columns \\ -%D \interface \type{\finaloutput{action}{box}} \\ -%D some kind of \type{\pagebody} and \type{\shipout} \\ -%D -%D \interface \type{\ifbalancecolumns} \\ -%D balancing the colums or not \\ -%D \interface \type{\ifstretchcolumns} \\ -%D ragging the bottom or not \\ -%D -%D \interface \type{\ifheightencolumns} \\ -%D fix the heigh tor not \\ -%D \interface \type{\fixedcolumnheight} \\ -%D the optional fixed height \\ -%D -%D \interface \type{\ifinheritcolumns} \\ -%D handle ragging or not \\ -%D \interface \type{\ifr@ggedbottom} \\ -%D use ragged bottoms \\ -%D \interface \type{\ifb@selinebottom} \\ -%D put the bottom line on the baseline \\ -%D \interface \type{\ifnormalbottom} \\ -%D put the bottom line at the baseline \\ -%D -%D \interface \type{\ifreversecolumns} \\ -%D reverse the order in wich columns are flushed \\ -%D -%D \interface \type{\usercolumnwidth} \\ -%D the calculated width of a column \\ -%D \interface \type{\columntextwidth} \\ -%D the maximum width of a column \\ -%D \interface \type{\columntextheight} \\ -%D the minimum width of a column \\ -%D -%D \interface \type{\spacingfactor} \\ -%D the spacing factor \\ -%D \interface \type{\bodyfontsize} \\ -%D the (local) bodyfontsize \\ -%D \interface \type{\openlineheight} \\ -%D the lineheight (including \type{\spacing}) \\ -%D -%D \interface \type{\EveryBodyFont} \\ -%D communication channel to font switching routines \\ -%D -%D \interface \type{\global\settopskip} \\ -%D set \type{\topskip} \\ -%D \interface \type{\setvsize} \\ -%D set \type{\vsize} and \type{\pagegoal} \\ -%D \interface \type{\sethsize} \\ -%D set \type{\hsize} \\ -%D -%D \interface \type{\flushcolumnfloats} \\ -%D push saved column floats (next page) \\ -%D \interface \type{\flushcolumnfloat} \\ -%D push saved column floats (next column) \\ -%D \interface \type{\setcolumnfloats} \\ -%D initialize column floats \\ -%D -%D \interface \type{\finishcolumnbox} \\ -%D do something special (a hook) \\ -%D \interface \type{\postprocesscolumnpagebox} \\ -%D do something with each columnbox (also a hook) \\ -%D \interface \type{\postprocesscolumnbox} \\ -%D do something with each columnbox (also a hook) \\ -%D \interface \type{\postprocesscolumnline} \\ -%D do something with each columnline (also a hook) \\ -%D \interface \type{\currentcolumn} \\ -%D the current column \\ -%D -%D These interface macro's are called upon or initialized -%D by the multi||column macro's. - -%D A lot of footnote stuff added! - -\def\finalcolumntextwidth {\makeupwidth} -\def\finalcolumntextheight {\textheight} -\def\columntextwidth {\makeupwidth} -\def\columntextheight {\textheight} -\def\usercolumnwidth {\textwidth} -\def\columntextoffset {\!!zeropoint} - -\def\fixedcolumnheight {\textheight} -\def\betweencolumns {\hskip\bodyfontsize} - -\let\setcolumnfloats \relax % in CONTEXT used for floats -\let\flushcolumnfloats \relax % in CONTEXT used for floats -\let\flushcolumnfloat \relax % in CONTEXT used for floats -\let\finishcolumnbox \relax % in CONTEXT used for backgrounds - -% %D In fact, the column height and width are set by means of -% %D two macro's. One can change their meaning if needed: -% -% \def\setcolumntextheight -% {\def\columntextheight{\teksthoogte}} -% -% \def\setcolumntextwidth -% {\def\columntextwidth{\zetbreedte}} - -%D Both macros are redefined in \CONTEXT\ when backgrounds -%D are applied to columns. The final values are used when -%D flushing the columns. - -\newtoks\singlecolumnout % remove that one - -%D It's more convenient to use \type {\columnwidth} instead -%D of messing around with boxes each time. - -\newdimen\columnwidth -\newdimen\gutterwidth - -\def\determinecolumnwidth - {\bgroup - \setbox\scratchbox\hbox - {\setcolumnhsize - \global\columnwidth\usercolumnwidth - \global\gutterwidth\intercolumnwidth}% - \egroup} - -%D Going to a new columns is done by means of a -%D \type{\ejectcolumn}. The following definition does not -%D always work. - -\def\ejectcolumn - {\goodbreak\showmessage\m!columns2\empty} - -%D The next macro should never be called so let's deal with it. -%D There were several solutions to these kind of errors. First -%D we check for a good breakpoint before firing up the -%D multi||column routine (\type{\break} or \type{\allowbreak}). -%D We do the same at the end of the routine -%D (\type{\allowbreak}). These allowances are definitely -%D needed! -%D -%D Some on first sight redundant calls to for instance -%D \type{\setvsize} in the flushing, splitting and balancing -%D macro's can definitely not be omitted! Some are just there -%D to handle situations that only few times arise. One of -%D those can be that the output routine is invoked before -%D everything is taken care of. This happens when we -%D flush (part of) the current page with an \type{\unvbox} -%D with a \type{\pagetotal}~$\approx$ \type{\pagegoal}. One -%D simply cannot balance columns that are just balanced. -%D -%D I hope one never sees the following message. Because it -%D took me a lot of time to develop the multi||columns -%D routines, every (although seldom) warning gives me the -%D creeps! - -\def\balancingerror - {\showmessage\m!columns3\empty - \finaloutput\unvbox\normalpagebox} - -\def\OTRMULsometopsfloat{\showmessage\m!columns4\empty \someherefloat} -\def\OTRMULsomebotsfloat{\showmessage\m!columns5\empty \someherefloat} - -\def\OTRMULsomeherefloat{\OTRONEsomeherefloat} - -%D The local column width is available in the dimension -%D register \type{\localcolumnwidth}, which is calculated as: - -\def\setcolumnhsize % beware, this one is available for use in macros - {\setbox\scratchbox\hbox{\parindent\zeropoint\betweencolumns}% - \intercolumnwidth\wd\scratchbox - \localcolumnwidth\columntextwidth - \advance\localcolumnwidth -\leftskip - \advance\localcolumnwidth -\rightskip - % new - \advance\localcolumnwidth -\colleftskip - \advance\localcolumnwidth -\colrightskip - % - \advance\localcolumnwidth -\nofcolumns\intercolumnwidth - \advance\localcolumnwidth \intercolumnwidth - \divide \localcolumnwidth \nofcolumns - \scratchdimen\columntextoffset - \multiply\scratchdimen \plustwo - \advance\localcolumnwidth -\scratchdimen - \usercolumnwidth\localcolumnwidth - \hsize\localcolumnwidth} % we don't do it \global - -%D Torture test: -%D -%D \startbuffer -%D \startbuffer[b] -%D \startcolumns -%D \input tufte -%D \stopcolumns -%D \stopbuffer -%D \typebuffer[b] \getbuffer[b] -%D -%D \startbuffer[b] -%D \startnarrower -%D \input tufte -%D \stopnarrower -%D \stopbuffer -%D \typebuffer[b] \getbuffer[b] -%D -%D \startbuffer[b] -%D \startcolumns \startnarrower -%D \input tufte -%D \stopnarrower \stopcolumns -%D \stopbuffer -%D \typebuffer[b] \getbuffer[b] -%D -%D \startbuffer[b] -%D \startnarrower \startcolumns -%D \input tufte -%D \stopcolumns \stopnarrower -%D \stopbuffer -%D \typebuffer[b] \getbuffer[b] -%D -%D \startbuffer[b] -%D \startcolumns \startnarrower[left] -%D \input tufte -%D \stopnarrower \stopcolumns -%D \stopbuffer -%D \typebuffer[b] \getbuffer[b] -%D -%D \startbuffer[b] -%D \startnarrower[left] \startcolumns -%D \input tufte -%D \stopcolumns \stopnarrower -%D \stopbuffer -%D \typebuffer[b] \getbuffer[b] -%D -%D \startbuffer[b] -%D \startnarrower \startcolumns \startnarrower -%D \input tufte -%D \stopnarrower\stopcolumns \stopnarrower -%D \stopbuffer -%D \typebuffer[b] \getbuffer[b] -%D -%D \startbuffer[b] -%D \startnarrower[left] \startcolumns \startnarrower -%D \input tufte -%D \stopnarrower\stopcolumns \stopnarrower -%D \stopbuffer -%D \typebuffer[b] \getbuffer[b] -%D \stopbuffer -%D -%D \start -%D \def\postprocesscolumnline#1{\ruledhbox{\strut\box#1}\hss} -%D \getbuffer -%D \stop - -%D One should be aware that when font related dimensions are -%D used in typesetting the in||between material, these -%D dimensions are influenced by bodyfont switches inside -%D multi||column mode. - -\newdimen\mcscratchdimen -\newcount\nofcolumnlines - -\chardef\multicolumnlinemethod\zerocount % 0: overshoot (old default), 1: tight -% \chardef\multicolumnlinemethod\plusone - -\def\getmulticolumnlines - {\mcscratchdimen-\columntextoffset - \multiply\mcscratchdimen \plustwo - \advance\mcscratchdimen \columntextheight - \ifdim\precolumnboxheight>\zeropoint - \advance\mcscratchdimen -\precolumnboxheight - \fi - \settotalinsertionheight - \advance\mcscratchdimen -\totalinsertionheight - \ifcase\multicolumnlinemethod \getnoflines\mcscratchdimen - \or \getrawnoflines\mcscratchdimen - \else \getrawnoflines\mcscratchdimen - \fi - % added 30/7/2004 - \ifnum\layoutlines>\zerocount \ifnum\noflines>\layoutlines - \noflines\layoutlines - \fi \fi - \nofcolumnlines\noflines} - -\def\multicolumnovershootratio{.5} % {\ifgridsnapping0\else.5\fi} - -\def\setcolumnvsize - {\getmulticolumnlines - \mcscratchdimen\nofcolumnlines\openlineheight - \advance\mcscratchdimen \multicolumnovershootratio\openlineheight % collect enough data - \global\vsize\nofcolumns\mcscratchdimen - \global\pagegoal\vsize} % let's do it only here - -%D It really starts here. After some checks and initializations -%D we change the output routine to continous multi||column -%D mode. This mode handles columns that fill the current and -%D next full pages. The method used is (more or less) -%D multiplying \type{\vsize} and dividing \type{\hsize} by -%D \type{\nofcolumns}. More on this can be found in the -%D \TeX book. We save the top of the current page in box -%D \type{\precolumnbox}. -%D -%D We manipulate \type{\topskip} a bit, just to be shure that -%D is has no flexibility. This has te be done every time a -%D font switch takles place, because \type{\topskip} can depend -%D on this. -%D -%D Watch the trick with the \type{\vbox}. This way we get the -%D right interlining and white space. - -\def\beginmulticolumns - {\par - \flushnotes - \xdef\precolumndepth{\the\prevdepth}% - \begingroup - % new - \leftskip1\leftskip - \rightskip1\rightskip - \edef\colleftskip {\the\leftskip}% - \edef\colrightskip{\the\rightskip}% - \leftskip\zeropoint - \rightskip\zeropoint - % - \dontshowcomposition - %\setcolumntextwidth\relax - %\setcolumntextheight\relax - \widowpenalty\zerocount % is gewoon beter - \clubpenalty \zerocount % zeker bij grids - \ifsomefloatwaiting - \showmessage\m!columns6{\the\savednoffloats}% - \global\setbox\savedfloatlist\box\floatlist - \xdef\restoresavedfloats - {\global\savednoffloats\the\savednoffloats - \global\setbox\floatlist\box\savedfloatlist - \global\noexpand\somefloatwaitingtrue}% - \global\savednoffloats\zerocount - \global\somefloatwaitingfalse - \else - \global\let\restoresavedfloats\relax - \fi - \dimen0\pagetotal - \advance\dimen0 \parskip - \advance\dimen0 \openlineheight - \ifdim\dimen0<\pagegoal - \allowbreak - \else - \break % Sometimes fails - \fi - \appendtoks\topskip1\topskip\to\everybodyfont - \the\everybodyfont % ugly here - \saveinterlinespace % ugly here - \initializecolumns\nofcolumns - \hangafter\zerocount - \hangindent\zeropoint - \everypar\emptytoks - \ifdim\pagetotal=\zeropoint \else - \verticalstrut - \vskip-\struttotal - \fi - \global\savedpagetotal\pagetotal - \global\singlecolumnout\output - %\global\output{\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}}% - \global\output{\global\setbox\precolumnbox\vbox{\dotopinsertions\unvbox\normalpagebox}}% - \eject % no \holdinginserts=1, can make footnote disappear ! - \global\precolumnboxheight\ht\precolumnbox - \global\output{\continuousmulticolumnsout}% - \setcolumnfloats - \dohandleallcolumns - {\global\setbox\currenttopcolumnbox\emptybox}% - \checkbegincolumnfootnotes - \activateotr{MUL}{ONE}% todo ! ! ! ! - \let\sethsize\setcolumnhsize - \let\setvsize\setcolumnvsize - \sethsize - \setvsize - \showcomposition} - -%D When we leave the multi||column mode, we have to process the -%D not yet shipped out part of the columns. When we don't -%D balance, we simply force a continuous output, but a balanced -%D output is more tricky. - -%D First we try to fill up the page and when all or something -%D is left we try to balance things. This is another useful -%D adaption of the ancesters of these macro's. It takes some -%D reasoning to find out what happens and maybe I'm making -%D some mistake, but it works. -%D -%D Voiding box \type{\precolumnbox} is sometimes necessary, -%D e.g. when there is no text given between \type{\begin..} -%D and \type{\end..}. The \type{\par} is needed! - -\chardef\multicolumnendsyncmethod\plusone % 1: old sync 2: new sync (cont-loc/project) / may fail ! ! ! ! - -\def\endmulticolumns - {%\par - \ifnum\multicolumnendsyncmethod=\plustwo - \synchronizeoutput - \else - % don't combine these - \vskip\lineheight - \vskip-\lineheight % take footnotes into account - \fi - \dontshowcomposition - \doflushcolumnfloat % added recently - %\doflushcolumnfloats % no, since it results in wrong top floats - \flushnotes % before start of columns - \par - \ifbalancecolumns - \ifnum\multicolumnendsyncmethod=\plusone - \global\output{\continuousmulticolumnsout}% - \goodbreak - \fi - \global\output{\balancedmulticolumnsout}% - \else - \goodbreak - \fi - \eject % the prevdepth is important, try e.g. toclist in - \prevdepth\zeropoint % columns before some noncolumned text text - \global\output\singlecolumnout - \global\output{\the\mainoutput}% % % % % todo - \ifvoid\precolumnbox\else - \unvbox\precolumnbox - \fi - \global\precolumnboxheight\zeropoint - \endgroup % here - \nofcolumns\plusone - \setvsize % the outer one! - \synchronizeoutput % new may 2004 / we need to: \pagegoal\vsize - \checkendcolumnfootnotes - \dosomebreak\allowbreak - \restoresavedfloats} - -%D Because some initializations happen three times, we -%D defined a macro for them. Erasing \type{\everypar} is -%D needed because we don't want anything to interfere. - -\def\setmulticolumnsout - {\everypar\emptytoks - \dontcomplain - \settopskip - \setmaxdepth - \topskip1\topskip - \splittopskip\topskip - \splitmaxdepth\maxdepth - \boxmaxdepth\maxdepth % dangerous - \emergencystretch\zeropoint\relax} % sometimes needed ! - -%D Flushing the page comes to pasting the columns together and -%D appending the result to box \type{\precolumnbox}, if not -%D void. I've seen a lot of implementations in which some skip -%D was put between normal text and multi||column text. When we -%D don't want this, the baselines can be messed up. I hope the -%D seemingly complicated calculation of a correction -%D \type{\kern} is adequate to overcome this. Although not -%D watertight, spacing is taken into account and even multiple -%D mode changes on one page go well. But cross your fingers and -%D don't blame me. -%D -%D One of the complications of flushing out the boxes is that -%D \type{\precolumnbox} needs to be \type{\unvbox}'ed, otherwise -%D there is too less flexibility in the page when using -%D \type{\r@ggedbottom}. It took a lot of time before these -%D kind of problems were overcome. Using \type{\unvbox} at the -%D wrong moment can generate \type{\balancingerror}'s. -%D -%D One can use the macros \type {\maxcolumnheight} and \type -%D {\maxcolumndepth} when generating material between columns -%D as well as postprocessing column lines. - -\let\maxcolumnheight=\zeropoint -\let\maxcolumndepth =\zeropoint - -\newbox\columnpagebox - -\def\setmaxcolumndimensions - {\let\maxcolumnheight\!!zeropoint - \let\maxcolumndepth \!!zeropoint - \dohandleallcolumns - {\ifdim\ht\currentcolumnbox>\maxcolumnheight - \edef\maxcolumnheight{\the\ht\currentcolumnbox}% - \fi - \ifdim\dp\currentcolumnbox>\maxcolumndepth - \edef\maxcolumndepth{\the\dp\currentcolumnbox}% - \fi}} - -\chardef\multicolumntopflushmethod\plusone % 0: no correction, 1: correction when topstuff, 2: correction, 3: correction++ -\chardef\multicolumntopalignmethod\plustwo % 0: nothing, 1: force grid, 2: follow grid - -\def\flushprecolumnboxnogrid - {\unvbox\precolumnbox} - -\def\flushprecolumnboxongrid - {\scratchdimen\savedpagetotal - \advance\scratchdimen -\ht\precolumnbox - \advance\scratchdimen -\dp\precolumnbox - \advance\scratchdimen -\topskip - \box\precolumnbox - \kern\scratchdimen} - -\newconditional\someprecolumncontent - -\def\flushcolumnedpage#1% - {\bgroup - \ifvoid\precolumnbox - \setfalse\someprecolumncontent % will be set elsewhere - \else - \settrue\someprecolumncontent -\mkprocessboxcontents\precolumnbox - \fi - \forgetall - \setmulticolumnsout - \showcomposition - \setmaxcolumndimensions - \dohandleallcolumns - {\mkprocesscolumncontents\currentcolumnbox}% - \postprocesscolumns - \dohandleallcolumns % \hbox i.v.m. \showcomposition - {\global\setbox\currentcolumnbox\hbox to \localcolumnwidth - {\box\currentcolumnbox - \global\wd\currentcolumnbox\localcolumnwidth - \ifheightencolumns - \global\ht\currentcolumnbox\fixedcolumnheight - \fi}}% - \setmaxcolumndimensions - \overlaycolumnfootnotes - \setbox\columnpagebox\vbox - {\hbox to \finalcolumntextwidth - {\hskip\colleftskip\relax % new, \relax needed - \ifreversecolumns - \popsplitproperties % else wrong color stack - \@EA\dohandlerevcolumns - \else - \@EA\dohandleallcolumns - \fi - {\finishcolumnbox{\hbox - {\ifx\finishcolumnbox\relax\else\strut\fi - \box\currentcolumnbox}}% - \hfil}% - \unskip - \hskip\colrightskip}}% new - \scratchdimen\zeropoint - \dohandleallcolumns - {\ifdim-\ht\currenttopcolumnbox<\scratchdimen - \scratchdimen-\ht\currenttopcolumnbox - \fi - \global\setbox\currenttopcolumnbox\emptybox}% - \advance\scratchdimen \ht\columnpagebox - \setbox\scratchbox\hbox to \columntextwidth - {\vrule - \!!width\zeropoint - \!!height\scratchdimen - \!!depth\dp\columnpagebox - \dostepwiserecurse2\nofcolumns1{\hfil\betweencolumns}\hfil}% - \setbox\columnpagebox\hbox - {\box\columnpagebox - \hskip-\columntextwidth - \restoretextcolor{\box\scratchbox}}% - \postprocesscolumnpagebox % new, acts upon \box\columnpagebox - \ifconditional\someprecolumncontent - \settrue\someprecolumncontent - % next some incredible crappy code - \ifcase\multicolumntopalignmethod - \flushprecolumnboxnogrid % not on grid - \or - \flushprecolumnboxongrid % force on grid - \else\ifgridsnapping % somehow this junk fails in pascal - \flushprecolumnboxongrid % obey grid settings, force on grid - \else - \flushprecolumnboxnogrid % ignore grid settings, not on grid - \fi \fi - \fi - \global\precolumnboxheight\zeropoint - \setvsize - \dosomebreak\nobreak % hm, only needed when topstuff - \ifgridsnapping - \else - \ifcase\multicolumntopflushmethod - % sometimes method 1 goes wrong, so we need a way out; best sort this out - % when we run into it again - \or - % \input tufte \startcolumns \showbaselines \input tufte \stopcolumns \input tufte - \ifconditional\someprecolumncontent -% \scratchdimen\topskip -% \advance\scratchdimen -\openstrutheight -% \nointerlineskip -% \vskip-\scratchdimen - \nointerlineskip - \vskip\dimexpr\openstrutheight-\topskip\relax - \fi - \or -% \scratchdimen\topskip -% \advance\scratchdimen -\openstrutheight -% \nointerlineskip -% \vskip-\scratchdimen - \nointerlineskip - \vskip\dimexpr\openstrutheight-\topskip\relax - \or - % untested but maybe handy -% \scratchdimen\topskip -% \advance\scratchdimen -\openstrutheight -% \nointerlineskip -% \vskip-\scratchdimen -% \vskip-\lineheight -% \vbox{\strut}% - \nointerlineskip - \vskip\dimexpr\openstrutheight-\topskip-\lineheight\relax - \vbox{\strut}% - \fi - \fi - \prevdepth\openstrutdepth - \nointerlineskip - \dp\columnpagebox\zeropoint - \global\finalcolumnheights\ht\columnpagebox - \getnoflines\finalcolumnheights - \global\finalcolumnlines\noflines - \ifcase#1\else - % messy correction, we need to rewrite this module (newcolumns) - \setbox\columnpagebox\vbox - {\offinterlineskip - \scratchdimen\ht\columnpagebox - \advance\scratchdimen\dp\columnpagebox % we probably lost that one already - \box\columnpagebox - \vskip-\scratchdimen}% - \scratchdimen\noflines\openlineheight - \advance\scratchdimen-\openstrutdepth - \advance\scratchdimen-\openlineheight - \advance\scratchdimen\topskip - \ht\columnpagebox\scratchdimen - \dp\columnpagebox\openstrutdepth - % end of mess - \fi - \box\columnpagebox - \egroup} - -%D In case one didn't notice, finaly \type{\finishcolumnbox} is -%D applied to all boxes. One can use these hooks for special -%D purposes. -%D -%D Once upon a time I wanted to manipulate the individual lines -%D in a column. This feature is demonstrated in the two examples -%D below. -%D -%D \startbuffer -%D \def\postprocesscolumnline#1% or \postprocesscolumnbox -%D {\ruledhbox{\box#1}\hss} -%D -%D \startcolumns[n=4] -%D \dorecurse{25}{line: \recurselevel\par} -%D \stopcolumns -%D \stopbuffer -%D -%D \typebuffer -%D -%D Here we show the natural width of the lines: -%D -%D {\getbuffer} -%D -%D The next example does a bit more advanced manipulation: -%D -%D \startbuffer -%D \def\postprocesscolumnline#1% -%D {\ifodd\currentcolumn -%D \hfill\unhbox#1\relax -%D \else -%D \relax\unhbox#1\hfill -%D \fi} -%D -%D \startcolumns[n=4] -%D \dorecurse{25}{line \recurselevel\par} -%D \stopcolumns -%D \stopbuffer -%D -%D \typebuffer -%D -%D Here we also see an application of \type{\currentcolumn}: -%D -%D {\getbuffer} -%D -%D This feature is implemented using the reshape macros -%D presented in \type{supp-box}. - -\def\postprocesscolumns - {\ifx\postprocesscolumnline\undefined \else - \dohandleallcolumns - {\global\setbox\currentcolumnbox\vtop - {\beginofshapebox - \unvbox\currentcolumnbox - \unskip\unskip - \endofshapebox - \reshapebox - {\dimen0\ht\shapebox - \dimen2\dp\shapebox - \setbox\shapebox\hbox to \hsize - {\postprocesscolumnline\shapebox}% - \ht\shapebox\dimen0 - \dp\shapebox\dimen2 - \box\shapebox}% - \flushshapebox - \everypar\emptytoks - \parskip\zeropoint % = \forgetall - \verticalstrut - \vskip-\struttotal - \vfil}}% - \fi - \ifx\postprocesscolumnbox\undefined \else - \dohandleallcolumns - {\global\setbox\currentcolumnbox\hbox - {\postprocesscolumnbox\currentcolumnbox}} - \fi} - -%D We default to doing nothing! - -\let\postprocesscolumnline =\undefined -\let\postprocesscolumnbox =\undefined -\let\postprocesscolumnpagebox=\relax - -%D \macros -%D {reversecolumnstrue} -%D -%D We can force the macro that takes care of combining -%D the columns, to flush them in the revere order. Of -%D course, by default we don't reverse. - -\newif\ifreversecolumns - -%D Here comes the simple splitting routine. It's a bit -%D longer than expected because of ragging bottoms or not. -%D This part can be a bit shorter but I suppose that I will -%D forget what happens. The splitting takes some already -%D present material (think of floats) into account! -%D -%D First we present some auxiliary routines. Any material, -%D like for instance floats, that is already present in the -%D boxes is preserved. - -\def\splitcolumn#1from \box#2to \dimen#3 top \box#4% - {\bgroup - \ifdim\ht#4>\zeropoint - \dimen0\dimen#3\relax - \dimen2\dimen0 - \advance\dimen0 -\ht#4% - \columnfootnotecorrection{#1}{\dimen0}% - \setbox0\vsplit#2 to \dimen0 - \global\setbox#1\vbox to \dimen2 - {\ifgridsnapping - \dimen0-\openstrutheight - \advance\dimen0 \topskip - \vskip\dimen0\copy#4\vskip-\dimen0 - \else - \unvcopy#4% - \fi - \fuzzysnappedbox\unvbox0 - \fakecolumnfootnotes{#1}}% - \else - \ifcase\clevernotes - \global\setbox#1\vsplit#2 to \dimen#3% - \global\setbox#1\vbox - {\fuzzysnappedbox\unvbox{#1}}% % or \box ? - \else - \columnfootnotecorrection{#1}{\dimen#3}% - \setbox0\vsplit#2 to \dimen#3% - \global\setbox#1\vbox to \dimen#3% - {\fuzzysnappedbox\unvbox0 - \fakecolumnfootnotes{#1}}% - \fi - \fi - \egroup} - -\def\splitcurrentcolumn from \box#1to \dimen#2% - {\splitcolumn\currentcolumnbox from \box#1 to \dimen#2 top \box\currenttopcolumnbox} - -\def\splitfirstcolumn from \box#1to \dimen#2% - {\splitcolumn\firstcolumnbox from \box#1 to \dimen#2 top \box\firsttopcolumnbox} - -\def\splitlastcolumn from \box#1to \dimen#2% - {\global\setbox\lastcolumnbox\vbox - {\unvcopy\lasttopcolumnbox - \fuzzysnappedbox\unvbox{#1}% - \fakecolumnfootnotes\lastcolumnbox}} - -%D NEW: still to be documented. - -\def\fakecolumnfootnotes#1% - {\relax - \ifcase\clevernotes\else - \ifnum#1=\lastcolumnbox - \fakenotes - \fi - \fi} - -\def\columnfootnotecorrection#1#2% - {\relax - \ifcase\clevernotes - % page notes - \or - \ifnum#1=\firstcolumnbox\relax - \calculatetotalclevernoteheight - \advance#2 -\totalnoteheight - \fi - \else - \ifnum#1=\lastcolumnbox\relax - \calculatetotalclevernoteheight - \advance#2 -\totalnoteheight - \fi - \fi} - -\def\overlaycolumnfootnotes - {\relax - \ifcase\clevernotes - % page notes - \else - \checknotepresence - \ifnotespresent - % the note box has the depth of the notefont - % because a column (i.e. first column has no depth, - % we need to anchor top down) - \bgroup - \ifcase\clevernotes\or - \getmulticolumnlines - \advance\nofcolumnlines \minustwo - \scratchdimen\nofcolumnlines\lineheight - \advance\scratchdimen \topskip - \setbox0\hbox - {\lower\scratchdimen\vbox{\placenoteinserts}}% - \ht0=\openstrutheight % \strutht - \dp0=\openstrutdepth % \strutdp - \scratchdimen\ht\firstcolumnbox - \global\setbox\firstcolumnbox\vbox to \scratchdimen - {\box\firstcolumnbox - \vskip-\scratchdimen - \restoretextcolor{\box0}}% - \else - % maybe here also \getmulticolumnlines - \scratchdimen\ht\firstcolumnbox - \advance\scratchdimen -\openstrutdepth % \strutdp - \getnoflines\scratchdimen - \advance\noflines \minustwo - \scratchdimen\noflines\lineheight - \advance\scratchdimen \topskip - \setbox0\hbox - {\lower\scratchdimen\vbox{\placenoteinserts}}% - \ht0=\openstrutheight % \strutht - \dp0=\openstrutdepth % \strutdp - \scratchdimen\ht\lastcolumnbox - \global\setbox\lastcolumnbox\vbox to \scratchdimen - {\box\lastcolumnbox - \vskip-\scratchdimen - \restoretextcolor{\box0}}% - \fi - \egroup - \fi - \fi} - -%D Here comes the routine that splits the long box in columns. -%D The macro \type{\flushcolumnfloats} can be used to flush -%D either floats that were present before the multi||column -%D mode was entered, or floats that migrate to next columns. -%D Flushing floats is a delicate process. - -\def\continuousmulticolumnsout - {\bgroup - \forgetall - \setmulticolumnsout - \dontshowcomposition -% \dimen0=\columntextheight -% \advance\dimen0 -\precolumnboxheight -% \settotalinsertionheight -% \advance\dimen0 -\totalinsertionheight -% \ifgridsnapping % evt altijd, nog testen -% \getnoflines{\dimen0} -% \dimen0=\noflines\openlineheight -% \fi - \getmulticolumnlines - \dimen0=\nofcolumnlines\openlineheight - \dohandleallcolumns - {\splitcurrentcolumn from \box\normalpagebox to \dimen0}% - \setbox\restofpage\vbox{\unvbox\normalpagebox}% - \ifinheritcolumns - \ifr@ggedbottom % vreemd - \dohandleallcolumns - {\global\setbox\currentcolumnbox\vbox to \ht\firstcolumnbox - {\dimen0\dp\currentcolumnbox - \unvbox\currentcolumnbox - \vskip-\dimen0 - \vskip\openstrutdepth % \strutdp - \prevdepth\openstrutdepth % \strutdp - \vfill}}% - \ifbottomnotes \else - \dimen0\ht\firstcolumnbox - \fi - \fi - \ifn@rmalbottom - \advance\dimen0 \maxdepth - \dohandleallcolumns - {\global\setbox\currentcolumnbox\vbox to \dimen0 - {\unvbox\currentcolumnbox}}% - \fi - \ifb@selinebottom - % the columns are on top of the baseline - \fi - \else - \dohandleallcolumns - {\global\setbox\currentcolumnbox\vbox to \dimen0 - {\ifstretchcolumns - \unvbox\currentcolumnbox - \else - \unvbox\currentcolumnbox % wel of niet \unvbox ? - \vfill - \fi}}% - \dohandleallcolumns - {\global\ht\currentcolumnbox\dimen0}% - \fi - \setbox\precolumnbox\vbox{\flushcolumnedpage\zerocount}% - \finaloutput\box\precolumnbox - \sethsize - \setvsize - \flushcolumnfloats - \unvbox\restofpage - % \penalty\outputpenalty % gaat gruwelijk mis in opsommingen - \egroup} - -%D And this is the balancing stuff. Again, part of the routine -%D is dedicated to handling ragged bottoms, but here we also -%D see some handling concerning the stretching of columns. -%D We set \type{\widowpenalty} at~0, which enables us to -%D balance columns with few lines. The use of \type{\box2} and -%D \type{\box4} garantees a more robust check when skips are -%D used. - -\def\multicolumnsbalancemax{250} % 100 is too small when floats are involved - -\def\balancedmulticolumnsout - {\bgroup - \setmulticolumnsout - \dontshowcomposition - \widowpenalty\zerocount - \setbox0\vbox{\unvbox\normalpagebox}% -\ifdim\ht0>\openlineheight % at least one line - \ifnum\minbalancetoplines<2 % balance anyway - \donetrue - \else % check criterium to available lines - \getnoflines{\ht0}% - \divide\noflines \nofcolumns \relax - \ifnum\noflines<\minbalancetoplines \relax - \dimen0\ht0 - \advance\dimen0 \ht\firsttopcolumnbox - \advance\dimen0 \openlineheight \relax % let's play safe - \ifdim\dimen0>\columntextheight % column exceeding text height - \donetrue - \else % it seems to fit - \donefalse - \fi - \else % balance indeed - \donetrue - \fi - \fi -\else % balancing does not make sense - \donefalse -\fi -\ifdone % start balancing - %\ifdim\ht0>\openlineheight - \dimen0\ht0 - \advance\dimen0 \topskip - \advance\dimen0 -\baselineskip - \dohandleallcolumns - {\advance\dimen0 \ht\currenttopcolumnbox}% - \divide\dimen0 \nofcolumns - \vbadness\!!tenthousand\relax - \count255=\zerocount - \bgroup - \ifgridsnapping - \dimen2\lineheight - \else - \dimen2=\onepoint % RUBISH - \dimen2=\spacingfactor\dimen2 - \fi - \doloop - {\advance\count255 \plusone - \global\setbox\restofpage\copy0\relax - \splitfirstcolumn from \box\restofpage to \dimen0 - \dohandlemidcolumns - {\splitcurrentcolumn from \box\restofpage to \dimen0}% - \splitlastcolumn from \box\restofpage to \dimen0 - \setbox2\vbox{\unvcopy\firstcolumnbox}% - \dimen4\zeropoint - \dohandleallcolumns - {\setbox4\vbox - {\unvcopy\currentcolumnbox - %rather new, test this on pdftex-z.tex - \unpenalty\unskip\unpenalty\unskip}% maybe better in main splitter - %\writestatus{balance}{\the\currentcolumnbox: \the\ht4}% -% \dimen6\ht4 \ifdim\dimen6>\dimen4 \dimen4=\dimen6 \fi}% - \ifdim\ht4>\dimen4 \dimen4=\ht4 \fi}% - \advance\dimen4 -.0005pt % get rid of accurracy problem, pretty new - \ifnum\count255>\multicolumnsbalancemax\relax - \exitloop - \else\ifdim\dimen4>\ht2 - \advance\dimen0 \dimen2\relax - \else - \exitloop - \fi\fi}% - \dohandleallcolumns - {\global\setbox\currentcolumnbox\vbox{\unvcopy\currentcolumnbox}}% NIEUW - \ifnum\count255>\multicolumnsbalancemax\relax - \showmessage\m!columns7\empty - \else - \showmessage\m!columns8{\the\count255\space}% - \fi - \egroup - \ifinheritcolumns - % We cannot assume that the first column is the tallest, if - % only because we may have an aborted balance (one line in the - % first column and a graphic in the second one). - % - % \dimen0\ht\firstcolumnbox - % \dimen2\ht\firstcolumnbox - % - \dimen0=\zeropoint - \dohandleallcolumns - {\ifdim\ht\currentcolumnbox>\dimen0 - \dimen0=\ht\currentcolumnbox - \fi}% - \dimen2\dimen0 - % so far - \advance\dimen2 -\openlineheight - \dohandleallcolumns - {\dimen4\ht\currentcolumnbox - \dimen6=10\openlineheight % funny value - \global\setbox\currentcolumnbox\vbox to \dimen0 - {\unvbox\currentcolumnbox - \ifdim\dimen4>\dimen6 - \ifdim\dimen4<\dimen0 - \ifdim\dimen4>\dimen2 - \vskip\zeropoint % !! - \else - \vskip\openlineheight - \vfill - \fi - \else - \vskip\zeropoint - \fi - \else - \vskip\openlineheight - \vfill - \fi}}% - \else - \bgroup - \ifstretchcolumns - \dimen0\ht\firstcolumnbox - \dimen2=\bottomtolerance\ht\firstcolumnbox - \setbox0\vbox{\unvcopy\lastcolumnbox}% - \advance\dimen0 -\ht0\relax - \advance\dimen0 -\dp0\relax - \ifdim\dimen0>\openlineheight\relax - \ifdim\dimen0>\dimen2\relax - % \stretchcolumnsfalse % beter goed slecht dan slecht goed - \showmessage\m!columns9\empty - \fi - \fi - \fi - \dohandleallcolumns - {\global\setbox\currentcolumnbox\vbox to \ht\firstcolumnbox - {\ifstretchcolumns - \unvbox\currentcolumnbox - \else - \box\currentcolumnbox - \vfill - \fi}}% - \egroup - \fi - \else - % a one liner is not properly handled here, so best rewrite the text then - \showmessage\m!columns{10}\empty - \global\setbox\firstcolumnbox\vbox{\unvbox0}% - \fi - \global\output{\balancingerror}% - \b@selinebottomtrue % forces depth in separation rule - \flushcolumnedpage\plusone - \multicolumnseject - \egroup} - -\def\multicolumnseject - {\ifdim\pagetotal>\textheight - \eject % new - \else - \allowbreak - \fi} - -%D The multicolumn mechanism is incorporated in a \CONTEXT\ -%D interface, which acts like: -%D -%D \starttyping -%D \startcolumns[n=4,balance=no] -%D some text -%D \stopcolumns -%D \stoptyping -%D -%D The setup is optional. The default behaviour of columns -%D can be set up with: -%D -%D \starttyping -%D \setupcolumns -%D [n=2, -%D balance=yes] -%D \stoptyping -%D -%D In this case, stretching is according to the way it's -%D done outside columns (\type{\inheritcolumnstrue}). Also -%D we can setup the \type{tolerance} within a column, the -%D \type{distance} between columns and the fixed -%D \type{height} of a column. - -%D Multi||column output: the float routines -%D -%D Here come the routines that handle the placement of column -%D floats. Floats that are to big migrate to the next -%D column. Floats that are too wide, migrate to the top of the -%D next page, where they span as much columns as needed. -%D Floats that are left over from outside the multi||column -%D mode are flushed first. In macro \type{\finaloutput} the -%D topfloats that are left from previous text should be set. -%D -%D When there are some floats in the queue, we inhibit the -%D flushing of floats on top of columns. The number of -%D waiting floats is preswent in \type{\savednoftopfloats} and -%D is saved. As long as there are floats waiting, the topfloats -%D are places as if we are outside multi||column mode. This is -%D neccessary for e.g. multicolumn lists. -%D -%D When all those floats are flushed, we switch to the local -%D flushing routine. - -\def\setcolumnfloats - {\xdef\globalsavednoffloats{\the\savednoffloats}% - \ifnum\globalsavednoffloats>\zerocount - \setglobalcolumnfloats - \else - \setlocalcolumnfloats - \fi} - -\def\setglobalcolumnfloats - {\everypar\emptytoks - \let\flushcolumnfloat\relax - %\let\doroomfloat\relax - \let\docheckiffloatfits\relax - \let\flushcolumnfloats\noflushcolumnfloats} - -\def\setlocalcolumnfloats - {\everypar{\flushnotes\flushcolumnfloat\flushmargincontents\checkindentation}% - \let\flushcolumnfloat\doflushcolumnfloat - %\let\doroomfloat\docolumnroomfloat - \let\docheckiffloatfits\docolumnroomfloat - \let\flushcolumnfloats\doflushcolumnfloats - \let\doflushfloats\doflushcolumnfloats % new - \let\dosetbothinserts\relax - \let\dotopinsertions\relax} - -\def\noflushcolumnfloats - {\bgroup - \xdef\localsavednoffloats{\the\savednoffloats}% - \global\savednoffloats\globalsavednoffloats - \dotopinsertions - \xdef\globalsavenoffloats{\the\savednoffloats}% - \ifnum\globalsavednoffloats=\zerocount - \setlocalcolumnfloats - \fi - \global\savednoffloats\localsavednoffloats - \egroup} - -%D We need to calculate the amount of free space in a columns. -%D When there is not enough room, we migrate the float to the -%D next column. These macro's are alternatives (and -%D look||alikes) of \type{\doroomfloat}. When a float is to -%D wide, for one column, it is moved to the top of the next -%D page. Of course such moved floats have to be taken into -%D account when we calculate the available space. It's a pitty -%D that such things are no integral part of \TEX. - -\def\getcolumnstatus\column#1\total#2\goal#3\\% - {\dimen0=\ifdim\pagegoal<\maxdimen \pagetotal \else \zeropoint \fi - \dimen2=\zeropoint - \count255=\zerocount - \dimen8=\columntextheight - \advance\dimen8 -\precolumnboxheight - \def\dogetcolumnstatus - {\advance\count255 \plusone - \advance\dimen2 \ht\currenttopcolumnbox - \advance\dimen2 \dp\currenttopcolumnbox - \dimen4\dimen2 - \advance\dimen4 \dimen0 - \dimen6=\count255\dimen8 - \ifdim\dimen4>\dimen6 - \else - \let\dogetcolumnstatus\relax - \fi}% - \dohandleallcolumns{\dogetcolumnstatus}% - \ifnum\count255=0 \count255=1 \fi - #1=\count255 - #2=\dimen4 - #3=\dimen6 } - -\def\getinsertionheight - {\ifdim\pagegoal<\maxdimen - \bgroup - \dimen0=\columntextheight - \advance\dimen0 -\pagegoal - \xdef\insertionheight{\the\dimen0}% - \egroup - \else - \global\let\insertionheight\zeropoint - \fi} - -\def\docolumnroomfloat - {\ifpostponecolumnfloats - \global\roomforfloatfalse - \else\ifnofloatpermitted - \global\roomforfloatfalse - \else - \bgroup - \getcolumnstatus\column\count255\total\dimen0\goal\dimen2\\% - \advance\dimen0 2\openlineheight % nog nodig ? - %\ifnum\count255=\nofcolumns - % \getinsertionheight - % %\message{\insertionheight}\wait - % \advance\dimen0 \insertionheight - %\fi - \setbox\scratchbox\vbox % tricky met objecten ? - {\blank[\@@bkspacebefore] - \snaptogrid\vbox{\copy\floatbox}}% - \advance\dimen0 \ht\scratchbox - \advance\dimen0 .5\lineheight % needed because goal a bit higher - %\message{column: \the\count255; total: \the\dimen0; goal: \the\dimen2}\wait - \ifdim\dimen0>\dimen2 - \global\roomforfloatfalse - \else - \global\roomforfloattrue - \fi - \ifdim\wd\floatbox>\hsize - \showmessage\m!columns{11}\empty - \global\roomforfloatfalse - \fi - \egroup - \fi\fi} - -%D Flushing one float is done as soon as possible, i.e. -%D \type{\everypar}. This means that (at the moment) -%D sidefloats are not supported (overulled)! - -\newif\ifflushingcolumnfloats \flushingcolumnfloatstrue - -\def\doflushcolumnfloat - {\ifpostponecolumnfloats\else\ifflushingcolumnfloats\ifprocessingverbatim\else\ifsomefloatwaiting - \bgroup - \forgetall - \let\doflushcolumnfloat\relax - \getcolumnstatus\column\mofcolumns\total\dimen0\goal\dimen2\\% - \ifdim\dimen0>\zeropoint - \dogetfloat - \ifdim\wd\floatbox>\hsize - \doresavefloat - \else - %\setbox2=\vbox - % {\blank[\@@bkspacebefore] - % \snaptogrid\vbox{\copy\floatbox}% - % \blank[\@@bkspaceafter] - \setbox2=\vbox - {\blank[\@@bkspacebefore] - \snaptogrid\vbox{\copy\floatbox}}% - \advance\dimen0 \ht2 - \ifdim\dimen0>\dimen2 - \ifnum\mofcolumns<\nofcolumns - \advance\mofcolumns \plusone -%% bug %% \edef\currenttopcolumnbox{\getvalue{\@@topcol\the\count255}}% - \ifdim\ht\currenttopcolumnbox=\zeropoint - \global\setbox\currenttopcolumnbox\vbox - {\snaptogrid\vbox{\copy\floatbox} - \whitespace % nodig ? - \blank[\@@bkspaceafter]}% - \dimen4=\ht\currenttopcolumnbox - \advance\dimen4 \dp\currenttopcolumnbox - \global\advance\vsize -\dimen4 - \advance\dimen4 -\pagegoal - \global\pagegoal-\dimen4 - \showmessage\m!columns{12}a% - \else - \showmessage\m!columns{12}b% - \doresavefloat - \fi - \else - \showmessage\m!columns{12}c% - \doresavefloat - \fi - \else - \ifhmode{\setbox0\lastbox}\fi% waar is die er in geslopen - \par - \ifdim\prevdepth<\zeropoint \else % anders bovenaan kolom witruimte - \nobreak - \blank[\@@bkspacebefore] - \nobreak - \fi - \flushfloatbox - \blank[\@@bkspaceafter] - \fi - \fi - \fi - \egroup - \fi\fi\fi\fi} - -%D This one looks complicated. Upto \type{\nofcolumns} floats -%D are placed, taking the width of a float into account. This -%D routine can be improved on different ways: -%D -%D \startitemize[intro,packed] -%D \item taking into account some imaginary baseline, just to -%D get the captions in line -%D \item multipass flushing until as many floats are displaced -%D as possible -%D \stopitemize -%D -%D When handling lots of (small) floats spacing can get worse -%D because of lining out the columns. - -\def\doflushcolumnfloats - {\ifpostponecolumnfloats\else - \bgroup - \forgetall - \ifsomefloatwaiting - \dimen8\zeropoint - \dimen4\zeropoint - \count0\zerocount % count0 can be used local - \count2\nofcolumns % count2 can be used local - \dohandleallcolumns - {\ifnum\count0>\zerocount % the wide one's reserved space - \global\setbox\currenttopcolumnbox\vbox - {\snaptogrid\vbox - {\copy\currenttopcolumnbox - \hbox{\vphantom{\copy\floatbox}}} - \whitespace % nodig ? - \blank[\@@bkspaceafter]}% - \else - \dogetfloat - \ifdim\wd\floatbox>\finalcolumntextwidth % better somewhere else too - \global\setbox\floatbox\hbox to \finalcolumntextwidth{\hss\box\floatbox\hss}% - \fi % otherwise the graphic may disappear - \ifdim\wd\floatbox>\hsize - \dimen0\wd\floatbox - \advance\dimen0 \intercolumnwidth - \dimen2\hsize - \advance\dimen2 \intercolumnwidth - \advance\dimen0 .5pt % hm, why 1 - \advance\dimen2 .5pt % hm, why 2 - \divide\dimen0 \dimen2 - \count0\dimen0 - \advance\count0 \plusone - \ifnum\count0>\count2 - \doresavefloat - \count0\zerocount - \else - \dimen0=\count0\hsize - \advance\dimen0 \count0\intercolumnwidth - \advance\dimen0 -\intercolumnwidth - \global\setbox\floatbox\hbox to \dimen0 - %{\hss\hbox{\copy\floatbox}\hss}% - {\processaction[\@@bklocation] % how easy to forget - [ \v!left=>\copy\floatbox\hss, - \v!right=>\hss\copy\floatbox, - \s!default=>\hss\copy\floatbox\hss, - \s!unknown=>\hss\copy\floatbox\hss]}% - \fi - \showmessage\m!columns{13}\empty - \else - % \showmessage\m!columns{13}\empty - \fi - \ifdim\ht\floatbox>\zeropoint\relax - \global\setbox\currenttopcolumnbox\vbox - {\snaptogrid\vbox - {\copy\currenttopcolumnbox - \copy\floatbox} - \whitespace % nodig ? - \blank[\@@bkspaceafter]}% - \fi - \dimen6\ht\currenttopcolumnbox - \advance\dimen6 \dp\currenttopcolumnbox - \fi - \ifdim\dimen4<\ht\currenttopcolumnbox - \dimen4\ht\currenttopcolumnbox - \fi - \advance\dimen8 \dimen6 - \advance\count2 \minusone - \advance\count0 \minusone }% - \setvsize - \global\advance\vsize -\dimen8 - \global\pagegoal\vsize - \else - %\doflushfloats % does not snap! - \fi - \egroup - \fi} - -%D The next macro can be used to flush floats in the current -%D stream. No width checking is (yet) done. - -\def\insertcolumnfloats - {\doloop - {\ifsomefloatwaiting - \bgroup - \forgetall - % no check for width - \dogetfloat - \blank[\@@bkspacebefore] - \snaptogrid\vbox{\copy\floatbox} - \blank[\@@bkspaceafter] - \egroup - \else - \exitloop - \fi}} - -%D This were the multi||column routines. They can and need to -%D be improved but at the moment their behaviour is acceptable. -%D -%D One inprovement can be to normalize the height of floats -%D to $n\times$\type{\lineheight} with a macro like: -%D -%D \starttyping -%D \normalizevbox{...} -%D \stoptyping - -% border case, should fit on one page -% -% \startcolumns -% -% 1 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{1}} -% 2 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{2}} -% 3 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{3}} -% -% \stopcolumns - -\def\setupcolumns - {\dosingleempty\dosetupcolumns} - -\def\dosetupcolumns[#1]% - {\getparameters[\??kl][#1]% - \nofcolumns\@@kln\relax - \processaction - [\@@klrule] - [ \v!on=>\let\betweencolumns\linebetweencolumns, - \v!off=>\let\betweencolumns\spacebetweencolumns, - \s!default=>\let\betweencolumns\spacebetweencolumns, - \s!unknown=>\let\betweencolumns\@@klrule]} - -\def\linebetweencolumns - {\bgroup - \starttextproperties - \ifdim\@@kldistance>\zeropoint - \dimen0=\@@kldistance - \else - \dimen0=\linewidth - \fi - \advance\dimen0 -\linewidth - \hskip.5\dimen0 - \vrule - \!!width\linewidth - \ifb@selinebottom\!!depth\strutdepth\fi - \hskip.5\dimen0\relax - \stoptextproperties - \egroup} - -\def\spacebetweencolumns - {\hskip\@@kldistance} - -\presetlocalframed[\??kl] - -\def\backgroundfinishcolumnbox - {\doifinsetelse\@@kloffset{\v!none,\v!overlay} - {\let\@@kloffset\!!zeropoint} - {\scratchdimen\@@kloffset - \advance\scratchdimen -\@@klrulethickness - \edef\@@kloffset{\the\scratchdimen}}% - \localframed - [\??kl] - [\c!strut=\v!no, - \c!width=\v!fit, - \c!height=\v!fit, - \c!align=]} - -\let\restorecolumnsettings\relax - -\definecomplexorsimpleempty\startcolumns - -\def\complexstartcolumns[#1]% %% \startcolumns - {\bgroup - \let\stopcolumns\egroup - \ifinsidecolumns - \else - \setupcolumns[#1]% - \ifnum\@@kln>1\relax - \whitespace - \begingroup - \doif\@@kloption\v!background - {\let\finishcolumnbox\backgroundfinishcolumnbox - \let\columntextoffset\@@kloffset}% - \ifx\@@klcommand\empty\else - \let\postprocesscolumnline\@@klcommand - \fi - \doifelsenothing\@@klheight - \heightencolumnsfalse - \heightencolumnstrue - \doifelse\@@kldirection\v!right - \reversecolumnsfalse - \reversecolumnstrue - \doifelse\@@klbalance\v!yes - \balancecolumnstrue - \balancecolumnsfalse -\installalign\v!yes {\stretchcolumnstrue \inheritcolumnsfalse}% todo: new key -\installalign\v!no {\stretchcolumnsfalse\inheritcolumnsfalse}% todo: new key -\installalign\v!text{\stretchcolumnsfalse\inheritcolumnstrue }% -\stretchcolumnsfalse -\inheritcolumnstrue -\doifsomething\@@klalign{\expanded{\setupalign[\@@klalign]}}% -% \processaction -% [\@@klalign] -% [ \v!yes=>\stretchcolumnstrue -% \inheritcolumnsfalse, -% \v!no=>\stretchcolumnsfalse -% \inheritcolumnsfalse, -% \v!text=>\stretchcolumnsfalse -% \inheritcolumnstrue]% - \nofcolumns=\@@kln - % - % probably more is needed, and how about nesting save's - % - \savecurrentblank - \savecurrentwhitespace - \def\restorecolumnsettings - {\boxmaxdepth\maxdimen % done elsewhere - \restorecurrentblank - \restorecurrentwhitespace}% - % - \edef\fixedcolumnheight{\@@klheight}% - \edef\minbalancetoplines{\@@klntop}% - \setuptolerance[\@@kltolerance]% %% \startcolumns - \setupblank[\@@klblank]% - \ifdim\ctxparskip>\zeropoint\relax - \setupwhitespace[\@@klblank]% - \fi - \def\stopcolumns - {\endmulticolumns - \global\insidecolumnsfalse - \endgroup - \egroup}% - \global\insidecolumnstrue - \beginmulticolumns - \fi - \fi} - -\installcolumnbreakhandler {MUL} \v!preference - {\goodbreak} - -\installcolumnbreakhandler {MUL} \v!yes - {\par % todo: since - {\testrulewidth\zeropoint\ruledvskip\textheight} % we misuse a - \penalty-200 % side effect - \vskip-\textheight - }% bugged : \prevdepth-\thousandpoint} % signals top of column to \blank - -%D New: only at start of columns; may change ! Rather -%D interwoven and therefore to be integrated when the multi -%D column modules are merged. (moved from cont-new.tex) - -\def\setupcolumnspan[#1]% - {\getparameters[\??ks][#1]} - -\presetlocalframed - [\??ks] - -\setupcolumnspan - [\c!n=2, - \c!offset=\v!overlay, - \c!frame=\v!off] - -\newbox\columnspanbox \let\postprocesscolumnspanbox\gobbleoneargument - -\def\dostartcolumnspan[#1]% - {\bgroup - \setupcolumnspan[#1]% - \forgetall - \ifinsidecolumns - \advance\hsize \intercolumnwidth - \hsize\@@ksn\hsize - \advance\hsize -\intercolumnwidth - \fi - \dowithnextbox - {\setbox\columnspanbox\flushnextbox - \ifinsidecolumns\wd\columnspanbox\hsize\fi - \postprocesscolumnspanbox\columnspanbox - \scratchdimen\ht\columnspanbox - \setbox\columnspanbox\hbox % depth to be checked, probably option! - {\localframed[\??ks][\c!offset=\v!overlay]{\box\columnspanbox}}% - \ht\columnspanbox\scratchdimen - \dp\columnspanbox\strutdp - \wd\columnspanbox\hsize - \ifinsidecolumns - \ifnum\@@ksn>1 - \setvsize - \dohandleallcolumns - {\ifnum\currentcolumn>\@@ksn\else - \global\setbox\currenttopcolumnbox=\vbox - {\ifnum\currentcolumn=1 - \snaptogrid\vbox{\copy\columnspanbox} - \else - \snaptogrid\vbox{\vphantom{\copy\columnspanbox}} - \fi}% - \wd\currenttopcolumnbox\hsize - \global\advance\vsize -\ht\currenttopcolumnbox - \fi} - \global\pagegoal\vsize - \else - \snaptogrid\vbox{\box\columnspanbox} - \fi - \else - \snaptogrid\vbox{\box\columnspanbox} - \fi - \endgraf - \ifvmode\prevdepth\strutdp\fi - \egroup} - \vbox\bgroup - %\topskipcorrection % becomes an option ! - \EveryPar{\begstrut\EveryPar{}}} % also ! - -\def\startcolumnspan - {\dosingleempty\dostartcolumnspan} - -\def\stopcolumnspan - {\egroup} - -\setupcolumns - [\c!n=2, - \c!ntop=1, - \c!command=, - \c!direction=\v!right, - \c!rule=\v!off, - \c!tolerance=\v!tolerant, - \c!distance=1.5\bodyfontsize, % influenced by switching - \c!height=, - \c!balance=\v!yes, - \c!align=\v!text, - \c!blank={\v!line,\v!fixed}, - \c!option=, - \c!rulethickness=\linewidth, - \c!offset=.5\bodyfontsize] - -%D Undocumented and still under development. - -\def\startsimplecolumns - {\dosingleempty\dostartsimplecolumns} - -\def\dostartsimplecolumns[#1]% - {\bgroup - \nopenalties - \getparameters[\??kl] - [\c!width=\hsize,\c!distance=1.5\bodyfontsize,% - \c!n=2,\c!lines=0,#1]% - \let\rigidcolumnlines\@@kllines - \setrigidcolumnhsize\@@klwidth\@@kldistance\@@kln - \setbox\scratchbox\vbox\bgroup - \forgetall} % \blank[\v!disable] - -\def\stopsimplecolumns - {\removebottomthings - \egroup - \rigidcolumnbalance\scratchbox - \egroup} - -\protect \endinput diff --git a/tex/context/base/page-new.tex b/tex/context/base/page-new.tex deleted file mode 100644 index 0b047ffbe..000000000 --- a/tex/context/base/page-new.tex +++ /dev/null @@ -1,277 +0,0 @@ -%D \module -%D [ file=page-new, -%D version=2000.10.20, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Page New, -%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 - -% % % NOT ENGLISH % % % - -% clean up footnotes to notes - -% We need to set the \dimen globally since we are in the -% OTR. Unfortunately this interferes with local settings, -% although we may assume that they will not cross page -% boundaries. - -\def\OTRSETcheckcontent - {\bgroup - \donefalse - \def\OTRSETcheckcontent##1% - {\setbox\scratchbox##1\recurselevel - \setbox\scratchbox\vbox{\unvbox\scratchbox}% - \ifdim\ht\scratchbox>\zeropoint\donetrue\fi}% - \dorecurse{\nofcolumns} - {\OTRSETcheckcontent\columngettextbox - \OTRSETcheckcontent\columngetfootbox - \OTRSETcheckcontent\columngettopbox - \OTRSETcheckcontent\columngetbotbox}% - \ifdone\egroup\donefalse\else\egroup\donetrue\fi} - -\def\OTRSETgetcolumntextheight#1% max - boven - top - {\scratchdimen=\OTRSETgetparameter\c!maxhoogte#1% - \advance\scratchdimen -\OTRSETgetparameter\c!bovenoffset#1% - \advance\scratchdimen -\ht\columntopbox#1% - \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}% - \advance\scratchdimen -\ht\columnbotbox#1} % not used - -\def\OTRSETgetcolumnnaturalheight#1% max - boven - top - {\setbox\scratchbox\vbox{\unvcopy\columntextbox#1}% - \scratchdimen\ht\scratchbox - \advance\scratchdimen \OTRSETgetparameter\c!bovenoffset#1% - \advance\scratchdimen \ht\columntopbox#1% - \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}% - \advance\scratchdimen \ht\columnbotbox#1} % not used - -\def\OTRSETdobalance% splitten in met en zonder footnotes - {\bgroup - \maxdeadcycles=1000 - % collect content and notes - \bgroup - \OTRSEToutput - {\global\setbox1\vbox{\unvbox\normalpagebox}% - \global\setbox3\vbox{\unvbox\footins}}% - \verticalstrut\vskip-\struttotal % makes footnotes flush - \eject - \global\collectingcontentfalse - % check for footnotes only - \ifdim\ht1<\topskip % real dirty - \global\setbox1=\vbox{} - % fix height of first line - \ifdim\ht3>\!!zeropoint - \global\setbox3\vbox - {\setfootnotebodyfont - \kern-\strutht - \kern\topskip - \unvbox3} - \fi - % prepare trial box - \global\setbox5\vbox - {\ifdim\ht1>\zeropoint - \unvcopy1 \ifdim\ht3>\zeropoint \kern\skip\footins \fi - \fi - \ifdim\ht3>\zeropoint \unvcopy3 \fi} - \egroup - % erase old stuff - \columnerasetextboxes - \columnerasefootboxes - % prepare floats - \OTRSETdotopinsertions - \OTRSETdobotinsertions % not used can be removed - % calculate available space - \!!heighta\zeropoint % available total height - \dorecurse{\nofcolumns} - {\OTRSETgetcolumntextheight\recurselevel - \OTRSETcalculatelines\scratchdimen - \advance\!!heighta \scratchdimen} - % quick check - \ifdim\ht5>\!!heighta - % use normal routine - \columnerasetextboxes - \columnerasefootboxes - % TEMP, TODO, FORCE NEXT PASS ! - \unvbox1 - \unvbox3 - \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist - \donefalse - %\writestatus\m!columns{no balancing, text overflows height}% - \else\ifdim\ht5>\zeropoint \relax - % some text and/or notes - \donetrue - \else - \donefalse - \dorecurse\nofcolumns - {\ifdim\ht\columntopbox\recurselevel>\zeropoint \donetrue \fi}% - \ifdone - % no text and notes, but figures - \else - % no text, no notes, no figures - \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist - \writestatus\m!columns{no balancing, nothing to be placed}% - \fi - \fi\fi - \ifdone - \ifdim\ht5>\zeropoint \relax - % balancing text and notes - %\writestatus\m!columns{text may fit, balancing}% - \newcounter\loopcounter - \newcounter\balancinglines - \doloop - {\increment\loopcounter\relax - % initialize - \columnerasetextboxes - \columnerasefootboxes - \setbox0=\copy5 - \splittopskip\topskip - % pre-split loop and quality calculation - %\writestatus\m!columns{pass \loopcounter: correction -\balancinglines} - \dorecurse\nofcolumns - {\OTRSETgetcolumntextheight\recurselevel - \OTRSETcalculatelines\scratchdimen - \!!heightc\scratchdimen - \ifnum\recurselevel<\nofcolumns - \advance\!!heightc -\balancinglines\lineheight - \fi - \columnsettextbox\recurselevel\vsplit0 to \!!heightc} - % just one method - \OTRSETgetcolumnnaturalheight1 \dimen4\scratchdimen - \OTRSETgetcolumnnaturalheight\nofcolumns \dimen6\scratchdimen - %\writestatus\m!columns{first column: \the\dimen4}% - %\writestatus\m!columns{last column: \the\dimen6}% - \ifdim\dimen4=\dimen6 - \donetrue % perfect balance - \else\ifdim\dimen4>\dimen6 - \donefalse % not yet good enough - \increment\balancinglines % try again - \edef\balancingcount{\the\!!counta} - \else - \donetrue % worse balance - \ifnum\balancinglines>0 % take previous - \decrement\balancinglines - \fi - \fi\fi - % extra check - % \ifdim\ht0>\zeropoint\relax \donefalse \fi - % another check - \ifdone - %\writestatus\m!columns{balancing finished in pass \loopcounter}% - \else \ifnum\loopcounter>100 \donetrue - %\writestatus\m!columns{balancing aborted after pass \loopcounter}% - \else - %\writestatus\m!columns{balancing continued after pass \loopcounter}% - \fi \fi - % final balancing pass - \ifdone - \setbox0\copy1 - \setbox2\copy3 - \columnerasetextboxes - \columnerasefootboxes - \dorecurse\nofcolumns - {\OTRSETgetcolumntextheight\recurselevel - \OTRSETcalculatelines\scratchdimen - \!!heightc\scratchdimen - \ifnum\recurselevel<\nofcolumns - \advance\!!heightc -\balancinglines\lineheight - \fi - % split off text - \ifdim\ht0>\zeropoint - \columnsettextbox\recurselevel\vsplit0 to \!!heightc - \setbox4\vbox{\unvcopy\columntextbox\recurselevel} - \advance\!!heightc -\ht4 - \ifdim\ht0>\zeropoint - \columnsettextbox\recurselevel\box4 - \advance\!!heightc \skip\footins - \fi - \fi - % split off footnotes - \ifdim\ht0>\zeropoint\relax \else - \ifdim\ht2>\zeropoint\relax - \setbox4\vsplit2 to \!!heightc - \setbox\footins=\vbox{\unvbox4} % ugly and dirty trick - \ifdim\ht\columntextbox\recurselevel=\zeropoint\relax - \columnsettextbox\recurselevel\hbox - {\raise\strutdp\hbox % ugly but needed - {\setfootnotebodyfont % both these moves - \lower\strutdp\hbox{\placebottomnotes}}} - \else - \columnsetfootbox\recurselevel\hbox{\placebottomnotes} - \fi - \fi - \fi} - \exitloop - \fi} - \else - % no reason to balance floats - \fi - \fi - \doglobal\addtocommalist{\realfolio}\OTRSETbalancinglist - \OTRSETdoflush - \fi - \egroup} - -\protect \endinput - -% \def\OTRSETsetbalanceht#1#2% var col -% {#1\getvalue{\??mc\OTRSETidentifier\number#2\c!regels}\relax -% \ifcase#1#1\getvalue{\??mc\OTRSETidentifier\c!regels}\relax\fi -% \ifcase#1#1\savedcolumnmaxcells\relax\fi} - -% \def\OTRSETinitbalancing -% {\ifbalancecolumns -% \let\savedcolumnmaxcells\columnmaxcells -% \ifnum\realpageno=\balancingpageno\relax -% \ifnum\mofcolumns=\plusone\relax -% \ifcase\OTRSETbottombalance \else -% \!!countc\zeropoint -% \dorecurse\nofcolumns -% {\OTRSETsetbalanceht\!!countb\recurselevel -% \ifnum\!!countb>\!!countc\!!countc\!!countb\fi}% -% \fi -% \dorecurse\nofcolumns -% {\!!counta\recurselevel\relax -% % can be an option: absolute versus relative -% \ifcase\OTRSETbottombalance -% \OTRSETsetbalanceht\!!countb\recurselevel -% \advance\!!countb\precolumnlines -% \ifnum\!!countb>\localcolumnmaxcells\relax -% \xdef\localcolumnmaxcells{\the\!!countb}% -% \fi -% \advance\!!countb \plusone -% \dostepwiserecurse\!!countb\columnmaxcells\plusone -% {\ifvoid\OTRSETgridcell\!!counta\recurselevel -% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe -% \fi}% -% \else -% \globallet\localcolumnmaxcells\columnmaxcells -% \!!countb\!!countc -% \advance\!!countb-\columnmaxcells -% \!!countb-\!!countb -% \advance\!!countb \minusone -% \ifnum\!!countb>\zerocount -% \dostepwiserecurse\plusone\!!countb\plusone -% {\ifvoid\OTRSETgridcell\!!counta\recurselevel -% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe -% \fi}% -% \OTRSETsetbalanceht\!!countb\recurselevel -% \ifnum\!!countc>\!!countb -% \!!countd\columnmaxcells -% \advance\!!countd-\!!countc -% \advance\!!countd+\!!countb -% \dostepwiserecurse\!!countd\columnmaxcells\plusone -% {\ifvoid\OTRSETgridcell\!!counta\recurselevel -% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe -% \fi}% -% \fi -% \fi -% \fi}% -% \OTRSETsetvsize % ! ! ! -% \fi -% \fi -% \fi} diff --git a/tex/context/base/page-not.mkii b/tex/context/base/page-not.mkii new file mode 100644 index 000000000..9c67f18f1 --- /dev/null +++ b/tex/context/base/page-not.mkii @@ -0,0 +1,72 @@ +%D \module +%D [ file=page-nnt, +%D version=2002.04.16, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Footnotes, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Footnotes} + +%D Terrible hacks: we need to share save/restore + +%D We've moved some footnote handling to a separate page +%D module. The macros below are used in the single and multi +%D column page handlers and permit mixed usage of column and +%D page notes. + +\unprotect + +\def\checkbegincolumnfootnotes % should happen inside otr + {\ifcase\clevernotes + \erasenotebackup + \else + \doflushnotes + \savenotecontent + \fi + \savenotedata + \checknotes} + +\def\checkendcolumnfootnotes + {\restorenotedata % maybe better just \checknotes + \ifcase\clevernotes\else + \restorenotecontent + \fi} + +\def\checksinglecolumnfootnotes + {\checknotes} % njet : \restorenotedata + +\newdimen\totalinsertionheight + +\def\settotalinsertionheight + {\calculatetotalnoteheight + \totalinsertionheight\totalnoteheight + \addinsertionheight\topins\to\totalinsertionheight + \addinsertionheight\botins\to\totalinsertionheight} + +% hm + +\def\checkbegincolumnfootnotes % should happen inside otr + {\ifcase\clevernotes + \erasenotebackup + \else + \doflushnotes + \savenotecontent + \fi + \savenotedata + \checknotes} + +\def\checkendcolumnfootnotes + {\restorenotedata + \ifinsidecolumns + \ifcase\clevernotes\else + \restorenotecontent + \fi + \fi} + +\protect \endinput diff --git a/tex/context/base/page-not.mkiv b/tex/context/base/page-not.mkiv new file mode 100644 index 000000000..9628b9d5f --- /dev/null +++ b/tex/context/base/page-not.mkiv @@ -0,0 +1,72 @@ +%D \module +%D [ file=page-nnt, +%D version=2002.04.16, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Footnotes, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Footnotes} + +%D Terrible hacks: we need to share save/restore + +%D We've moved some footnote handling to a separate page +%D module. The macros below are used in the single and multi +%D column page handlers and permit mixed usage of column and +%D page notes. + +\unprotect + +\def\checkbegincolumnfootnotes % should happen inside otr + {\ifcase\clevernotes + \erasenotebackup + \else + \flushnotes + \savenotecontent + \fi + \savenotedata + \checknotes} + +\def\checkendcolumnfootnotes + {\restorenotedata % maybe better just \checknotes + \ifcase\clevernotes\else + \restorenotecontent + \fi} + +\def\checksinglecolumnfootnotes + {\checknotes} % niet : \restorenotedata + +\newdimen\totalinsertionheight + +\def\settotalinsertionheight + {\calculatetotalnoteheight + \totalinsertionheight\totalnoteheight + \addinsertionheight\topins\to\totalinsertionheight + \addinsertionheight\botins\to\totalinsertionheight} + +% hm + +\def\checkbegincolumnfootnotes % should happen inside otr + {\ifcase\clevernotes + \erasenotebackup + \else + \flushnotes + \savenotecontent + \fi + \savenotedata + \checknotes} + +\def\checkendcolumnfootnotes + {\restorenotedata + \ifinsidecolumns + \ifcase\clevernotes\else + \restorenotecontent + \fi + \fi} + +\protect \endinput diff --git a/tex/context/base/page-not.tex b/tex/context/base/page-not.tex deleted file mode 100644 index 9c67f18f1..000000000 --- a/tex/context/base/page-not.tex +++ /dev/null @@ -1,72 +0,0 @@ -%D \module -%D [ file=page-nnt, -%D version=2002.04.16, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Footnotes, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Footnotes} - -%D Terrible hacks: we need to share save/restore - -%D We've moved some footnote handling to a separate page -%D module. The macros below are used in the single and multi -%D column page handlers and permit mixed usage of column and -%D page notes. - -\unprotect - -\def\checkbegincolumnfootnotes % should happen inside otr - {\ifcase\clevernotes - \erasenotebackup - \else - \doflushnotes - \savenotecontent - \fi - \savenotedata - \checknotes} - -\def\checkendcolumnfootnotes - {\restorenotedata % maybe better just \checknotes - \ifcase\clevernotes\else - \restorenotecontent - \fi} - -\def\checksinglecolumnfootnotes - {\checknotes} % njet : \restorenotedata - -\newdimen\totalinsertionheight - -\def\settotalinsertionheight - {\calculatetotalnoteheight - \totalinsertionheight\totalnoteheight - \addinsertionheight\topins\to\totalinsertionheight - \addinsertionheight\botins\to\totalinsertionheight} - -% hm - -\def\checkbegincolumnfootnotes % should happen inside otr - {\ifcase\clevernotes - \erasenotebackup - \else - \doflushnotes - \savenotecontent - \fi - \savenotedata - \checknotes} - -\def\checkendcolumnfootnotes - {\restorenotedata - \ifinsidecolumns - \ifcase\clevernotes\else - \restorenotecontent - \fi - \fi} - -\protect \endinput diff --git a/tex/context/base/page-one.mkiv b/tex/context/base/page-one.mkiv index 19ab43889..73f69d582 100644 --- a/tex/context/base/page-one.mkiv +++ b/tex/context/base/page-one.mkiv @@ -116,6 +116,8 @@ \chardef\kindofpagetextareas=2 % whole page (public variable! never change) +% can we avoind the extra vboxing here? + \def\OTRONEregisteredtextarea#1% {\ifregistertextareas \setbox0\vbox{#1}% @@ -132,8 +134,7 @@ \xypos{pbd:\realfolio:b}% we could save bytes by only saving the y \endgraf \begingroup - \scratchdimen\MPy{pbd:\realfolio:b}% - \advance\scratchdimen-\MPy{pbd:\realfolio:e}% + \scratchdimen\dimexpr\MPy{pbd:\realfolio:b}-\MPy{pbd:\realfolio:e}\relax \setbox\scratchbox\null \wd\scratchbox\makeupwidth \ht\scratchbox\scratchdimen @@ -174,36 +175,31 @@ \ifgridsnapping \OTRONEregisteredtextareaA{#1#2}% \vskip-\currentpagedepth\vskip\openstrutdepth - \pushproperties % moved from just after #1#2 \prevdepth\openstrutdepth \dobotinsertions \vfil \else\ifr@ggedbottom \OTRONEregisteredtextareaA{#1#2}% \vskip-\currentpagedepth\vskip\openstrutdepth - \pushproperties % moved from just after #1#2 \prevdepth\openstrutdepth \dobotinsertions \vfil \else\ifb@selinebottom \OTRONEregisteredtextareaA{#1#2}% \kern-\currentpagedepth\kern\maxdepth - \pushproperties % moved from just after #1#2 \dobotinsertions \else \OTRONEregisteredtextareaA{#1#2}% - \pushproperties % moved from just after #1#2 \dobotinsertions % added \fi\fi\fi \fakepagenotes}% was \fakenotes, but wrong! (check with \setupalign[height]) \ifbottomnotes \ifgridsnapping -\ifcase\layoutlines % todo: make macro of this - \getrawnoflines\textheight -\else - \noflines\layoutlines -\fi -% \getnoflines\textheight + \ifcase\layoutlines % todo: make macro of this + \getrawnoflines\textheight + \else + \noflines\layoutlines + \fi \advance\noflines \minusone \scratchdimen\noflines\lineheight \advance\scratchdimen \topskip @@ -626,9 +622,7 @@ \else \topofinsertfalse \fi - \global\advance\topinserted \ht\floatbox - \global\advance\topinserted \dp\floatbox - \global\advance\topinserted \floatbottomskip + \global\advance\topinserted \ht\floatbox+\dp\floatbox+\floatbottomskip\relax \insert\topins {\forgetall \iftopofinsert @@ -643,9 +637,7 @@ \doinsertfloatinfo} \def\OTRONEsomebotsfloat[#1]% - {\global\advance\botinserted \ht\floatbox - \global\advance\botinserted \dp\floatbox - \global\advance\botinserted \floattopskip + {\global\advance\botinserted\dimexpr\ht\floatbox+\dp\floatbox+\floattopskip\relax \insert\botins {\forgetall \blank[\@@bkspacebefore]% diff --git a/tex/context/base/page-par.mkii b/tex/context/base/page-par.mkii new file mode 100644 index 000000000..a5dea2e63 --- /dev/null +++ b/tex/context/base/page-par.mkii @@ -0,0 +1,58 @@ +%D \module +%D [ file=page-par, % copied from page-lin +%D version=1997.03.31, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Line Numbering, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Paragraph Numbering} + +\unprotect + +\newcount\internalparagraphnumber + +\def\setupparagraphnumbering + {\dosingleempty\dosetupparagraphnumbering} + +\def\dosetupparagraphnumbering[#1]% + {\getparameters + [\??ph][#1]% + \processaction + [\@@phstate] + [\v!start=>\let\showparagraphnumber\doshowparagraphnumberA, + \v!stop=>\let\showparagraphnumber\relax, + \v!line=>\let\showparagraphnumber\doshowparagraphnumberB, + \v!reset=>\global\internalparagraphnumber\zerocount + \let\showparagraphnumber\doshowparagraphnumberA]} + +\def\dodoshowparagraphnumber + {\global\advance\internalparagraphnumber \plusone + \inleftmargin % \tf normalizes em + {\tf{\doattributes\??ph\c!style\c!color{\the\internalparagraphnumber}}% + \kern\@@phdistance}} + +\def\doshowparagraphnumberA + {\ifprocessingverbatim + \iflinepar\dodoshowparagraphnumber\fi + \else + \dodoshowparagraphnumber + \fi} + +\def\doshowparagraphnumberB + {\ifnumberinglines + \doshowparagraphnumberA + \fi} + +\setupparagraphnumbering + [\c!state=\v!stop, + \c!style=, + \c!color=, + \c!distance=\ifcase\linenumberlocation2em\else\!!zeropoint\fi] % will change + +\protect \endinput diff --git a/tex/context/base/page-par.mkiv b/tex/context/base/page-par.mkiv new file mode 100644 index 000000000..a5dea2e63 --- /dev/null +++ b/tex/context/base/page-par.mkiv @@ -0,0 +1,58 @@ +%D \module +%D [ file=page-par, % copied from page-lin +%D version=1997.03.31, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Line Numbering, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Paragraph Numbering} + +\unprotect + +\newcount\internalparagraphnumber + +\def\setupparagraphnumbering + {\dosingleempty\dosetupparagraphnumbering} + +\def\dosetupparagraphnumbering[#1]% + {\getparameters + [\??ph][#1]% + \processaction + [\@@phstate] + [\v!start=>\let\showparagraphnumber\doshowparagraphnumberA, + \v!stop=>\let\showparagraphnumber\relax, + \v!line=>\let\showparagraphnumber\doshowparagraphnumberB, + \v!reset=>\global\internalparagraphnumber\zerocount + \let\showparagraphnumber\doshowparagraphnumberA]} + +\def\dodoshowparagraphnumber + {\global\advance\internalparagraphnumber \plusone + \inleftmargin % \tf normalizes em + {\tf{\doattributes\??ph\c!style\c!color{\the\internalparagraphnumber}}% + \kern\@@phdistance}} + +\def\doshowparagraphnumberA + {\ifprocessingverbatim + \iflinepar\dodoshowparagraphnumber\fi + \else + \dodoshowparagraphnumber + \fi} + +\def\doshowparagraphnumberB + {\ifnumberinglines + \doshowparagraphnumberA + \fi} + +\setupparagraphnumbering + [\c!state=\v!stop, + \c!style=, + \c!color=, + \c!distance=\ifcase\linenumberlocation2em\else\!!zeropoint\fi] % will change + +\protect \endinput diff --git a/tex/context/base/page-par.tex b/tex/context/base/page-par.tex deleted file mode 100644 index a5dea2e63..000000000 --- a/tex/context/base/page-par.tex +++ /dev/null @@ -1,58 +0,0 @@ -%D \module -%D [ file=page-par, % copied from page-lin -%D version=1997.03.31, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Line Numbering, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Paragraph Numbering} - -\unprotect - -\newcount\internalparagraphnumber - -\def\setupparagraphnumbering - {\dosingleempty\dosetupparagraphnumbering} - -\def\dosetupparagraphnumbering[#1]% - {\getparameters - [\??ph][#1]% - \processaction - [\@@phstate] - [\v!start=>\let\showparagraphnumber\doshowparagraphnumberA, - \v!stop=>\let\showparagraphnumber\relax, - \v!line=>\let\showparagraphnumber\doshowparagraphnumberB, - \v!reset=>\global\internalparagraphnumber\zerocount - \let\showparagraphnumber\doshowparagraphnumberA]} - -\def\dodoshowparagraphnumber - {\global\advance\internalparagraphnumber \plusone - \inleftmargin % \tf normalizes em - {\tf{\doattributes\??ph\c!style\c!color{\the\internalparagraphnumber}}% - \kern\@@phdistance}} - -\def\doshowparagraphnumberA - {\ifprocessingverbatim - \iflinepar\dodoshowparagraphnumber\fi - \else - \dodoshowparagraphnumber - \fi} - -\def\doshowparagraphnumberB - {\ifnumberinglines - \doshowparagraphnumberA - \fi} - -\setupparagraphnumbering - [\c!state=\v!stop, - \c!style=, - \c!color=, - \c!distance=\ifcase\linenumberlocation2em\else\!!zeropoint\fi] % will change - -\protect \endinput diff --git a/tex/context/base/page-plg.mkii b/tex/context/base/page-plg.mkii new file mode 100644 index 000000000..3203b923c --- /dev/null +++ b/tex/context/base/page-plg.mkii @@ -0,0 +1,202 @@ +%D \module +%D [ file=page-pls, +%D version=2003.03.16, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Page Setup, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifx\pageareabox\undefined \else \endinput \fi + +\writestatus{loading}{ConTeXt Page Macros / Extra Page Building} + +%D This feature has been present for a while but has never been +%D exploited: pluggable pagebuilders. The next example code +%D demonstrates the application of one such a plug-in. This variant +%D support \type {page}, \type {leftpage} and \type {rightpage} +%D definitions where specific areas are placed with the \type +%D {\pagearea} command. +%D +%D \starttyping +%D \setupheadertexts[the header text] +%D \setupfootertexts[a pretty long left footer text][something right] +%D \setupbottomtexts[a not so long bottom text][another right thing] +%D \setuptexttexts [margin][something marginal][indeed] +%D +%D \startpagelayout[leftpage] +%D \setupTABLE[offset=overlay] +%D \setupTABLE[c][1][width=\leftmarginwidth] +%D \bTABLE +%D \bTR +%D \bTD[nx=3,background=color,backgroundcolor=green] +%D \pagearea[header][text][middle] +%D \eTD +%D \eTR +%D \bTR +%D \bTD \pagearea[text][margin][left] \eTD +%D \bTD[nx=2] \pagearea[text] \eTD +%D \eTR +%D \bTR +%D \bTD[nx=3,offset=overlay] +%D {\bTABLE[width=.5\hsize] +%D \bTR +%D \bTD \pagearea[footer][text][left] \eTD +%D \bTD \pagearea[bottom][text][left] \eTD +%D \eTR +%D \eTABLE} +%D \eTD +%D \eTR +%D \eTABLE +%D \stoppagelayout +%D +%D \startpagelayout[rightpage] +%D \setupTABLE[offset=overlay] +%D \setupTABLE[c][1][width=\rightmarginwidth] +%D \bTABLE +%D \bTR +%D \bTD[nx=3] \pagearea[header][text][middle] \eTD +%D \eTR +%D \bTR +%D \bTD \pagearea[text][margin][left] \eTD +%D \bTD[nx=2] \pagearea[text] \eTD +%D \eTR +%D \bTR +%D \bTD[nx=3,offset=overlay] +%D {\bTABLE[width=.5\hsize] +%D \bTR +%D \bTD \pagearea[bottom][text][right] \eTD +%D \bTD \pagearea[footer][text][right] \eTD +%D \eTR +%D \eTABLE} +%D \eTD +%D \eTR +%D \eTABLE +%D \stoppagelayout +%D +%D \setupcolors[state=start] +%D +%D \setupbackgrounds[text][background=color,backgroundcolor=blue] +%D \setupbackgrounds[header][text][background=color,backgroundcolor=red] +%D +%D \setuppagenumbering[alternative=doublesided,location=] +%D +%D \setuplayout[method=makeup] +%D +%D \definetextbackground +%D [test] +%D [state=start, +%D background=color, +%D backgroundcolor=yellow] +%D +%D \starttext +%D +%D \dorecurse{10}{\input tufte \par} +%D +%D \input tufte \starttest \input tufte \stoptest \input tufte +%D +%D \starttabulate +%D \NC test \NC \starttest \input tufte \stoptest \NC \NR +%D \stoptabulate +%D +%D \dorecurse{10}{\input tufte \par} +%D +%D \stoptext +%D \stoptyping + +\unprotect + +\setvalue{\??ly\c!method\v!makeup}#1#2% + {\setbox\pagebox\hbox + {\vbox to \textheight + {\offinterlineskip + % optie + \vskip\dimexpr-1\topskip+\strutheight\relax + % + \textwidth\makeupwidth + \hsize\textwidth + \boxmaxdepth\maxdepth + \noindent + \dopagecontents#1#2}}% + \wd\pagebox\makeupwidth + \ht\pagebox\textheight + \dp\pagebox\zeropoint + \hsize\paperwidth + \vsize\paperheight + \setbox\pagebox\vbox + {\doifbothsidesoverruled + {\let\!!stringa\v!page} + {\let\!!stringa\v!rightpage} + {\let\!!stringa\v!leftpage}% + \getvalue{\??ly\c!method:\!!stringa}}% + \wd\pagebox\paperwidth + \ht\pagebox\paperheight + \dp\pagebox\zeropoint} + +\newbox\pageareabox + +\def\pagearea + {\dotripleempty\dopagearea} + +\def\dopagearea[#1][#2][#3]% + {\ifthirdargument + \doifelse{#3}\v!left + {\dodopagearea{#1}{#2}\c!lefttext} + {\doifelse{#3}\v!right + {\dodopagearea{#1}{#2}\c!righttext} + {\dodopagearea{#1}{#2}\c!middletext}}% + \else\ifsecondargument + \doifbothsidesoverruled + {\dodopagearea{#1}{#2}\c!righttext} + {\dodopagearea{#1}{#2}\c!righttext} + {\dodopagearea{#1}{#2}\c!lefttext }% + \else + \doif{#1}\v!text % copy due to trial runs in TABLE + {\iftrialtypesetting + \copy\pagebox + \else + \setbox\pagebox\vbox + {\localstarttextcolor + \box\pagebox + \localstoptextcolor}% + \localpositioningfalse + \addtextbackground\pagebox + \addtextgridlayer\pagebox + \box\pagebox + \fi}% + \fi\fi} + +\def\dodopagearea#1#2#3% + {\setbox\pageareabox\vbox{\getvalue{\??tk#1#2#3}}% + \ifsomebackgroundfound{#1#2}% + \iftrialtypesetting + \box\pageareabox + \else + \localframed + [\??ma#1#2] + [\c!width=\wd\pageareabox, + \c!height=\ht\pageareabox, + \c!offset=\v!overlay] + {\box\pageareabox}% + \fi + \else + \box\pageareabox + \fi} + +\setvalue{\??ly\c!method:\v!leftpage }{\getvalue{\??ly\c!method:\v!page}} +\setvalue{\??ly\c!method:\v!rightpage}{\getvalue{\??ly\c!method:\v!page}} + +% \long\def\startpagelayout[#1]#2\stoppagelayout +% {\long\setvalue{\??ly\c!method:#1}{#2}} + +\long\def\startpagelayout + {\bgroup\catcode`\^^M=\@@ignore\dostartpagelayout} + +\long\def\dostartpagelayout[#1]#2\stoppagelayout + {\egroup\long\setvalue{\??ly\c!method:#1}{#2}} + +\protect \endinput diff --git a/tex/context/base/page-plg.mkiv b/tex/context/base/page-plg.mkiv new file mode 100644 index 000000000..bbee2eb57 --- /dev/null +++ b/tex/context/base/page-plg.mkiv @@ -0,0 +1,198 @@ +%D \module +%D [ file=page-pls, +%D version=2003.03.16, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Page Setup, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifx\pageareabox\undefined \else \endinput \fi + +\writestatus{loading}{ConTeXt Page Macros / Extra Page Building} + +%D This feature has been present for a while but has never been +%D exploited: pluggable pagebuilders. The next example code +%D demonstrates the application of one such a plug-in. This variant +%D support \type {page}, \type {leftpage} and \type {rightpage} +%D definitions where specific areas are placed with the \type +%D {\pagearea} command. +%D +%D \starttyping +%D \setupheadertexts[the header text] +%D \setupfootertexts[a pretty long left footer text][something right] +%D \setupbottomtexts[a not so long bottom text][another right thing] +%D \setuptexttexts [margin][something marginal][indeed] +%D +%D \startpagelayout[leftpage] +%D \setupTABLE[offset=overlay] +%D \setupTABLE[c][1][width=\leftmarginwidth] +%D \bTABLE +%D \bTR +%D \bTD[nx=3,background=color,backgroundcolor=green] +%D \pagearea[header][text][middle] +%D \eTD +%D \eTR +%D \bTR +%D \bTD \pagearea[text][margin][left] \eTD +%D \bTD[nx=2] \pagearea[text] \eTD +%D \eTR +%D \bTR +%D \bTD[nx=3,offset=overlay] +%D {\bTABLE[width=.5\hsize] +%D \bTR +%D \bTD \pagearea[footer][text][left] \eTD +%D \bTD \pagearea[bottom][text][left] \eTD +%D \eTR +%D \eTABLE} +%D \eTD +%D \eTR +%D \eTABLE +%D \stoppagelayout +%D +%D \startpagelayout[rightpage] +%D \setupTABLE[offset=overlay] +%D \setupTABLE[c][1][width=\rightmarginwidth] +%D \bTABLE +%D \bTR +%D \bTD[nx=3] \pagearea[header][text][middle] \eTD +%D \eTR +%D \bTR +%D \bTD \pagearea[text][margin][left] \eTD +%D \bTD[nx=2] \pagearea[text] \eTD +%D \eTR +%D \bTR +%D \bTD[nx=3,offset=overlay] +%D {\bTABLE[width=.5\hsize] +%D \bTR +%D \bTD \pagearea[bottom][text][right] \eTD +%D \bTD \pagearea[footer][text][right] \eTD +%D \eTR +%D \eTABLE} +%D \eTD +%D \eTR +%D \eTABLE +%D \stoppagelayout +%D +%D \setupcolors[state=start] +%D +%D \setupbackgrounds[text][background=color,backgroundcolor=blue] +%D \setupbackgrounds[header][text][background=color,backgroundcolor=red] +%D +%D \setuppagenumbering[alternative=doublesided,location=] +%D +%D \setuplayout[method=makeup] +%D +%D \definetextbackground +%D [test] +%D [state=start, +%D background=color, +%D backgroundcolor=yellow] +%D +%D \starttext +%D +%D \dorecurse{10}{\input tufte \par} +%D +%D \input tufte \starttest \input tufte \stoptest \input tufte +%D +%D \starttabulate +%D \NC test \NC \starttest \input tufte \stoptest \NC \NR +%D \stoptabulate +%D +%D \dorecurse{10}{\input tufte \par} +%D +%D \stoptext +%D \stoptyping + +\unprotect + +\setvalue{\??ly\c!method\v!makeup}#1#2% + {\setbox\pagebox\hbox + {\vbox to \textheight + {\offinterlineskip + % optie + \vskip\dimexpr-1\topskip+\strutheight\relax + % + \textwidth\makeupwidth + \hsize\textwidth + \boxmaxdepth\maxdepth + \noindent + \dopagecontents#1#2}}% + \wd\pagebox\makeupwidth + \ht\pagebox\textheight + \dp\pagebox\zeropoint + \hsize\paperwidth + \vsize\paperheight + \setbox\pagebox\vbox + {\doifbothsidesoverruled + {\let\!!stringa\v!page} + {\let\!!stringa\v!rightpage} + {\let\!!stringa\v!leftpage}% + \getvalue{\??ly\c!method:\!!stringa}}% + \wd\pagebox\paperwidth + \ht\pagebox\paperheight + \dp\pagebox\zeropoint} + +\newbox\pageareabox + +\def\pagearea + {\dotripleempty\dopagearea} + +\def\dopagearea[#1][#2][#3]% + {\ifthirdargument + \doifelse{#3}\v!left + {\dodopagearea{#1}{#2}\c!lefttext} + {\doifelse{#3}\v!right + {\dodopagearea{#1}{#2}\c!righttext} + {\dodopagearea{#1}{#2}\c!middletext}}% + \else\ifsecondargument + \doifbothsidesoverruled + {\dodopagearea{#1}{#2}\c!righttext} + {\dodopagearea{#1}{#2}\c!righttext} + {\dodopagearea{#1}{#2}\c!lefttext }% + \else + \doif{#1}\v!text % copy due to trial runs in TABLE + {\iftrialtypesetting + \copy\pagebox + \else + \localpositioningfalse + \addtextbackground\pagebox + \addtextgridlayer\pagebox + \box\pagebox + \fi}% + \fi\fi} + +\def\dodopagearea#1#2#3% + {\setbox\pageareabox\vbox{\getvalue{\??tk#1#2#3}}% + \ifsomebackgroundfound{#1#2}% + \iftrialtypesetting + \box\pageareabox + \else + \localframed + [\??ma#1#2] + [\c!width=\wd\pageareabox, + \c!height=\ht\pageareabox, + \c!offset=\v!overlay] + {\box\pageareabox}% + \fi + \else + \box\pageareabox + \fi} + +\setvalue{\??ly\c!method:\v!leftpage }{\getvalue{\??ly\c!method:\v!page}} +\setvalue{\??ly\c!method:\v!rightpage}{\getvalue{\??ly\c!method:\v!page}} + +% \long\def\startpagelayout[#1]#2\stoppagelayout +% {\long\setvalue{\??ly\c!method:#1}{#2}} + +\long\def\startpagelayout + {\bgroup\catcode`\^^M=\@@ignore\dostartpagelayout} + +\long\def\dostartpagelayout[#1]#2\stoppagelayout + {\egroup\long\setvalue{\??ly\c!method:#1}{#2}} + +\protect \endinput diff --git a/tex/context/base/page-plg.tex b/tex/context/base/page-plg.tex deleted file mode 100644 index 3203b923c..000000000 --- a/tex/context/base/page-plg.tex +++ /dev/null @@ -1,202 +0,0 @@ -%D \module -%D [ file=page-pls, -%D version=2003.03.16, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Page Setup, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifx\pageareabox\undefined \else \endinput \fi - -\writestatus{loading}{ConTeXt Page Macros / Extra Page Building} - -%D This feature has been present for a while but has never been -%D exploited: pluggable pagebuilders. The next example code -%D demonstrates the application of one such a plug-in. This variant -%D support \type {page}, \type {leftpage} and \type {rightpage} -%D definitions where specific areas are placed with the \type -%D {\pagearea} command. -%D -%D \starttyping -%D \setupheadertexts[the header text] -%D \setupfootertexts[a pretty long left footer text][something right] -%D \setupbottomtexts[a not so long bottom text][another right thing] -%D \setuptexttexts [margin][something marginal][indeed] -%D -%D \startpagelayout[leftpage] -%D \setupTABLE[offset=overlay] -%D \setupTABLE[c][1][width=\leftmarginwidth] -%D \bTABLE -%D \bTR -%D \bTD[nx=3,background=color,backgroundcolor=green] -%D \pagearea[header][text][middle] -%D \eTD -%D \eTR -%D \bTR -%D \bTD \pagearea[text][margin][left] \eTD -%D \bTD[nx=2] \pagearea[text] \eTD -%D \eTR -%D \bTR -%D \bTD[nx=3,offset=overlay] -%D {\bTABLE[width=.5\hsize] -%D \bTR -%D \bTD \pagearea[footer][text][left] \eTD -%D \bTD \pagearea[bottom][text][left] \eTD -%D \eTR -%D \eTABLE} -%D \eTD -%D \eTR -%D \eTABLE -%D \stoppagelayout -%D -%D \startpagelayout[rightpage] -%D \setupTABLE[offset=overlay] -%D \setupTABLE[c][1][width=\rightmarginwidth] -%D \bTABLE -%D \bTR -%D \bTD[nx=3] \pagearea[header][text][middle] \eTD -%D \eTR -%D \bTR -%D \bTD \pagearea[text][margin][left] \eTD -%D \bTD[nx=2] \pagearea[text] \eTD -%D \eTR -%D \bTR -%D \bTD[nx=3,offset=overlay] -%D {\bTABLE[width=.5\hsize] -%D \bTR -%D \bTD \pagearea[bottom][text][right] \eTD -%D \bTD \pagearea[footer][text][right] \eTD -%D \eTR -%D \eTABLE} -%D \eTD -%D \eTR -%D \eTABLE -%D \stoppagelayout -%D -%D \setupcolors[state=start] -%D -%D \setupbackgrounds[text][background=color,backgroundcolor=blue] -%D \setupbackgrounds[header][text][background=color,backgroundcolor=red] -%D -%D \setuppagenumbering[alternative=doublesided,location=] -%D -%D \setuplayout[method=makeup] -%D -%D \definetextbackground -%D [test] -%D [state=start, -%D background=color, -%D backgroundcolor=yellow] -%D -%D \starttext -%D -%D \dorecurse{10}{\input tufte \par} -%D -%D \input tufte \starttest \input tufte \stoptest \input tufte -%D -%D \starttabulate -%D \NC test \NC \starttest \input tufte \stoptest \NC \NR -%D \stoptabulate -%D -%D \dorecurse{10}{\input tufte \par} -%D -%D \stoptext -%D \stoptyping - -\unprotect - -\setvalue{\??ly\c!method\v!makeup}#1#2% - {\setbox\pagebox\hbox - {\vbox to \textheight - {\offinterlineskip - % optie - \vskip\dimexpr-1\topskip+\strutheight\relax - % - \textwidth\makeupwidth - \hsize\textwidth - \boxmaxdepth\maxdepth - \noindent - \dopagecontents#1#2}}% - \wd\pagebox\makeupwidth - \ht\pagebox\textheight - \dp\pagebox\zeropoint - \hsize\paperwidth - \vsize\paperheight - \setbox\pagebox\vbox - {\doifbothsidesoverruled - {\let\!!stringa\v!page} - {\let\!!stringa\v!rightpage} - {\let\!!stringa\v!leftpage}% - \getvalue{\??ly\c!method:\!!stringa}}% - \wd\pagebox\paperwidth - \ht\pagebox\paperheight - \dp\pagebox\zeropoint} - -\newbox\pageareabox - -\def\pagearea - {\dotripleempty\dopagearea} - -\def\dopagearea[#1][#2][#3]% - {\ifthirdargument - \doifelse{#3}\v!left - {\dodopagearea{#1}{#2}\c!lefttext} - {\doifelse{#3}\v!right - {\dodopagearea{#1}{#2}\c!righttext} - {\dodopagearea{#1}{#2}\c!middletext}}% - \else\ifsecondargument - \doifbothsidesoverruled - {\dodopagearea{#1}{#2}\c!righttext} - {\dodopagearea{#1}{#2}\c!righttext} - {\dodopagearea{#1}{#2}\c!lefttext }% - \else - \doif{#1}\v!text % copy due to trial runs in TABLE - {\iftrialtypesetting - \copy\pagebox - \else - \setbox\pagebox\vbox - {\localstarttextcolor - \box\pagebox - \localstoptextcolor}% - \localpositioningfalse - \addtextbackground\pagebox - \addtextgridlayer\pagebox - \box\pagebox - \fi}% - \fi\fi} - -\def\dodopagearea#1#2#3% - {\setbox\pageareabox\vbox{\getvalue{\??tk#1#2#3}}% - \ifsomebackgroundfound{#1#2}% - \iftrialtypesetting - \box\pageareabox - \else - \localframed - [\??ma#1#2] - [\c!width=\wd\pageareabox, - \c!height=\ht\pageareabox, - \c!offset=\v!overlay] - {\box\pageareabox}% - \fi - \else - \box\pageareabox - \fi} - -\setvalue{\??ly\c!method:\v!leftpage }{\getvalue{\??ly\c!method:\v!page}} -\setvalue{\??ly\c!method:\v!rightpage}{\getvalue{\??ly\c!method:\v!page}} - -% \long\def\startpagelayout[#1]#2\stoppagelayout -% {\long\setvalue{\??ly\c!method:#1}{#2}} - -\long\def\startpagelayout - {\bgroup\catcode`\^^M=\@@ignore\dostartpagelayout} - -\long\def\dostartpagelayout[#1]#2\stoppagelayout - {\egroup\long\setvalue{\??ly\c!method:#1}{#2}} - -\protect \endinput diff --git a/tex/context/base/page-run.mkii b/tex/context/base/page-run.mkii new file mode 100644 index 000000000..ae5af81e9 --- /dev/null +++ b/tex/context/base/page-run.mkii @@ -0,0 +1,382 @@ +%D \module +%D [ file=page-run, +%D version=2000.10.20, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Runtime Macros} + +\unprotect + +\gdef\doshowprint[#1][#2][#3]% + {\framed + [\c!offset=\v!overlay, + \c!strut=\v!no] + {\forgetall + \dontcomplain + \globaldefs\minusone + \dimen0\pagegoal + \definepapersize[X][\c!width=4em, \c!height=6em]% + \definepapersize[Y][\c!width=12em,\c!height=14em]% + \setuppapersize[#1,X][#2,Y]% + \setuplayout[#3]% + \setbox0\vbox + {\framed + [\c!offset=\v!overlay,\c!strut=\v!no, + \c!width=\paperwidth,\c!height=\paperheight] + {\ss ABC\par DEF}}% + \doublesidedfalse + \def\cutmarklength{.5em}% + \addpagecutmarks0% + \replicatepagebox0% + \scalepagebox0% + \mirrorpaperbox0% + \orientpaperbox0% + \centerpagebox0% + \mirrorprintbox0% + \orientprintbox0% + \offsetprintbox0% + \pagegoal\dimen0 + \box0}} + +\gdef\showprint + {\dotripleempty\doshowprint} + +% \switchnaarkorps[8pt] +% +% \startcombinatie[4*4] +% {\toonprint} {\strut} +% {\toonprint[][][plaats=midden]} {\type{plaats=midden}} +% {\toonprint[][][plaats=midden,markering=aan]} {\type{markering=aan}\break +% \type{plaats=midden}} +% {\toonprint[][][plaats=midden,markering=aan,nx=2]} {\type{markering=aan}\break +% \type{plaats=midden}\break +% \type{nx=2}} +% {\toonprint[][][plaats=links]} {\type{plaats=links}} +% {\toonprint[][][plaats=rechts]} {\type{plaats=rechts}} +% {\toonprint[][][plaats={links,onder}]} {\type{plaats={links,onder}}} +% {\toonprint[][][plaats={rechts,onder}]} {\type{plaats={rechts,onder}}} +% {\toonprint[][][nx=2,ny=1]} {\type{nx=2,ny=1}} +% {\toonprint[][][nx=1,ny=2]} {\type{nx=1,ny=2}} +% {\toonprint[][][nx=2,ny=2]} {\type{nx=2,ny=2}} +% {\toonprint[][][nx=2,ny=2,plaats=midden]} {\type{nx=2,ny=2}\break +% \type{plaats=midden}} +% {\toonprint[][][rugoffset=3pt]} {\type{rugoffset=.5cm}} +% {\toonprint[][][kopoffset=3pt]} {\type{kopoffset=.5cm}} +% {\toonprint[][][schaal=1.5]} {\type{schaal=1.5}} +% {\toonprint[][][schaal=0.8]} {\type{schaal=0.8}} +% \stopcombinatie +% +% \startcombinatie[3*4] +% {\toonprint[liggend][][plaats=midden]} {\type{liggend}} +% {\toonprint[][liggend][plaats=midden]} {\strut\break\type{liggend}} +% {\toonprint[liggend][liggend][plaats=midden]} {\type{liggend}\break\type{liggend}} +% {\toonprint[90][][plaats=midden]} {\type{90}} +% {\toonprint[][90][plaats=midden]} {\strut\break\type{90}} +% {\toonprint[90][90][plaats=midden]} {\type{90}\break\type{90}} +% {\toonprint[180][][plaats=midden]} {\type{180}} +% {\toonprint[][180][plaats=midden]} {\strut\break\type{180}} +% {\toonprint[180][180][plaats=midden]} {\type{180}\break\type{180}} +% {\toonprint[gespiegeld][][plaats=midden]} {\type{gespiegeld}} +% {\toonprint[][gespiegeld][plaats=midden]} {\strut\break\type{gespiegeld}} +% {\toonprint[gespiegeld][gespiegeld][plaats=midden]} {\type{gespiegeld}\break\type{gespiegeld}} +% \stopcombinatie + +\gdef\doshowframe[#1][#2]% + {\ifsecondargument + \setupbackgrounds + [\v!page] + [\c!frame=\v!on, + \c!corner=\v!rectangular, + \c!frameoffset=\!!zeropoint, + \c!framedepth=\!!zeropoint, + \c!framecolor=layout:page] + \setupbackgrounds + [#1][#2] + [\c!background=, + \c!frame=\v!on, + \c!corner=\v!rectangular, + \c!frameoffset=\!!zeropoint, + \c!framedepth=\!!zeropoint, + \c!framecolor=] + \else\iffirstargument + \showframe + [\v!header,\v!text,\v!footer] + [#1] + \else + \showframe + [\v!header,\v!text,\v!footer] + [\v!leftedge,\v!leftmargin, + \v!text, + \v!rightmargin,\v!rightedge] + \fi\fi + \setupbackgrounds + [\c!state=\v!repeat]} + +\gdef\showframe{\dodoubleempty\doshowframe} + +\gdef\showsetupA#1#2% + {#1&\PtToCm{\the#2}&\the#2&\tttf\string#2\cr} + +\gdef\showsetupB#1#2#3% + {#1&#3&\tttf\string#3\cr} + +% \startinterface english % english is fallback + +\gdef\showsetups + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{paperheight} \paperheight + \showsetupA{paperwidth} \paperwidth + \showsetupA{printpaperheight} \printpaperheight + \showsetupA{printpaperwidth} \printpaperwidth + \showsetupA{topspace} \topspace + \showsetupA{backspace} \backspace + \showsetupA{height} \makeupheight + \showsetupA{width} \makeupwidth + \showsetupA{top} \topheight + \showsetupA{topdistance} \topdistance + \showsetupA{header} \headerheight + \showsetupA{headerdistance} \headerdistance + \showsetupA{textheight} \textheight + \showsetupA{footerdistance} \footerdistance + \showsetupA{footer} \footerheight + \showsetupA{bottomdistance} \bottomdistance + \showsetupA{bottom} \bottomheight + \showsetupA{leftedge} \leftedgewidth + \showsetupA{leftedgedistance} \leftedgedistance + \showsetupA{leftmargin} \leftmarginwidth + \showsetupA{leftmargindistance} \leftmargindistance + \showsetupA{textwidth} \textwidth + \showsetupA{rightmargindistance}\rightmargindistance + \showsetupA{rightmargin} \rightmarginwidth + \showsetupA{rightedgedistance} \rightedgedistance + \showsetupA{rightedge} \rightedgewidth + \showsetupB{bodyfontsize} \the \globalbodyfontsize + \showsetupB{line} \relax \normallineheight + \showsetupB{height} \relax \strutheightfactor + \showsetupB{depth} \relax \strutdepthfactor + \showsetupB{topskip} \relax \topskipfactor + \showsetupB{maxdepth} \relax \maxdepthfactor}}} + +% \stopinterface + +\startinterface dutch + +\gdef\showsetups + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{papierhoogte} \papierhoogte + \showsetupA{papierbreedte} \papierbreedte + \showsetupA{printpapierhoogte} \printpapierhoogte + \showsetupA{printpapierbreedte} \printpapierbreedte + \showsetupA{kopwit} \kopwit + \showsetupA{rugwit} \rugwit + \showsetupA{snijwit} \snijwit + \showsetupA{hoogte} \zethoogte + \showsetupA{breedte} \zetbreedte + \showsetupA{boven} \bovenhoogte + \showsetupA{bovenafstand} \bovenafstand + \showsetupA{hoofd} \hoofdhoogte + \showsetupA{hoofdafstand} \hoofdafstand + \showsetupA{teksthoogte} \teksthoogte + \showsetupA{voetafstand} \voetafstand + \showsetupA{voet} \voethoogte + \showsetupA{onderafstand} \onderafstand + \showsetupA{onder} \onderhoogte + \showsetupA{linkerrand} \linkerrandbreedte + \showsetupA{linkerrandafstand} \linkerrandafstand + \showsetupA{linkermarge} \linkermargebreedte + \showsetupA{linkermargeafstand} \linkermargeafstand + \showsetupA{tekstbreedte} \tekstbreedte + \showsetupA{rechtermargeafstand}\rechtermargeafstand + \showsetupA{rechtermarge} \rechtermargebreedte + \showsetupA{rechterrandafstand} \rechterrandafstand + \showsetupA{rechterrand} \rechterrandbreedte + \showsetupB{korps} \the \globalbodyfontsize + \showsetupB{regel} \relax \normallineheight + \showsetupB{hoogte} \relax \strutheightfactor + \showsetupB{diepte} \relax \strutdepthfactor + \showsetupB{boven} \relax \topskipfactor + \showsetupB{onder} \relax \maxdepthfactor}}} + +\stopinterface + +% todo: \showsetupA{rugwit} \rugwit + +\startinterface german + +\gdef\showsetups% + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{papierhoehe} \papierhoehe + \showsetupA{papierbreite} \papierbreite + \showsetupA{printpapierhoehe} \printpapierhoehe + \showsetupA{printpapierbreite} \printpapierbreite + \showsetupA{kopfweite} \kopfweite + \showsetupA{rumpfweite} \rumpfweite + \showsetupA{hoehe} \satzhoehe + \showsetupA{breite} \satzbreite + \showsetupA{oben} \hoeheoben + \showsetupA{abstandoben} \abstandoben + \showsetupA{kopfzeile} \kopfzeilenhoehe + \showsetupA{kopfzeilenabstand} \kopfzeilenabstand + \showsetupA{texthoehe} \texthoehe + \showsetupA{fusszeileabstand} \fusszeileabstand + \showsetupA{fusszeilen} \fusszeilenhoehe + \showsetupA{abstandunten} \abstandunten + \showsetupA{hoeheunten} \hoeheunten + \showsetupA{linkerrand} \breitelinkerrand + \showsetupA{abstandlinkerrand} \abstandlinkerrand + \showsetupA{linkemarginal} \linkemarginalbreite + \showsetupA{linkemarginalafstand} \linkemarginalafstand + \showsetupA{textbreite} \textbreite + \showsetupA{rechtemarginalafstand}\rechtemarginalafstand + \showsetupA{rechtemarginal} \rechtemarginalbreite + \showsetupA{abstandrechterrand} \abstandrechterrand + \showsetupA{rechterrand} \breiterechterrand + \showsetupB{fliesstext} \the \globalbodyfontsize + \showsetupB{linie} \relax \normallineheight + \showsetupB{hoehe} \relax \strutheightfactor + \showsetupB{tiefe} \relax \strutdepthfactor + \showsetupB{topskip} \relax \topskipfactor + \showsetupB{maxdepth} \relax \maxdepthfactor}}} + +\stopinterface + +\startinterface czech + +\gdef\showsetups% + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{vyskapapiru} \vyskapapiru + \showsetupA{sirkapapiru} \sirkapapiru + \showsetupA{vyskatiskpapiru} \vyskatiskpapiru + \showsetupA{sirkatiskpapiru} \sirkatiskpapiru + \showsetupA{hornimezera} \hornimezera + \showsetupA{spodnimezera} \spodnimezera + \showsetupA{vyska} \vyskasazby + \showsetupA{breite} \sirkasazby + \showsetupA{vyskatextu} \vyskatextu + \showsetupA{sirkatextu} \sirkatextu + \showsetupA{horejsek} \vyskahorejsku + \showsetupA{vzdalenosthorejsku} \vzdalenosthorejsku + \showsetupA{zahlavi} \vyskazahlavi + \showsetupA{vzdalenostzahlavi} \vzdalenostzahlavi + \showsetupA{fusszeileabstand} \vzdalenostupati + \showsetupA{upati} \vyskaupati + \showsetupA{vzdalenostspodku} \vzdalenostspodku + \showsetupA{spodek} \vyakaspodku + \showsetupA{levyokraj} \sirkalevehookraje + \showsetupA{vzdalenostlevehookraje} \vzdalenostlevehookraje + \showsetupA{levamarginalie} \sirkalevemarginalie + \showsetupA{vzdalenostlevemarginalie} \vzdalenostlevemarginalie + \showsetupA{vzdalenostpravemarginalie}\vzdalenostpravemarginalie + \showsetupA{pravamarginalie} \sirkapravemarginalie + \showsetupA{vzdalenostpravehookraje} \vzdalenostpravehookraje + \showsetupA{pravyokraj} \sirkapravehookraje + \showsetupB{zakladnivelikost} \the \globalbodyfontsize + \showsetupB{linka} \relax \normallineheight + \showsetupB{vyska} \relax \strutheightfactor + \showsetupB{hloubka} \relax \strutdepthfactor + \showsetupB{topskip} \relax \topskipfactor + \showsetupB{maxdepth} \relax \maxdepthfactor}}} + +\stopinterface + +\startinterface romanian + +\gdef\showsetups% + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{paperheight} \paperheight + \showsetupA{paperwidth} \paperwidth + \showsetupA{printpaperheight} \printpaperheight + \showsetupA{printpaperwidth} \printpaperwidth + \showsetupA{topspace} \topspace + \showsetupA{backspace} \backspace + \showsetupA{height} \makeupheight + \showsetupA{width} \makeupwidth + \showsetupA{top} \topheight + \showsetupA{topdistance} \topdistance + \showsetupA{header} \headerheight + \showsetupA{headerdistance} \headerdistance + \showsetupA{textheight} \textheight + \showsetupA{footerdistance} \footerdistance + \showsetupA{footer} \footerheight + \showsetupA{bottomdistance} \bottomdistance + \showsetupA{bottom} \bottomheight + \showsetupA{leftedge} \leftedgewidth + \showsetupA{leftedgedistance} \leftedgedistance + \showsetupA{leftmargin} \leftmarginwidth + \showsetupA{leftmargindistance} \leftmargindistance + \showsetupA{textwidth} \textwidth + \showsetupA{rightmargindistance}\rightmargindistance + \showsetupA{rightmargin} \rightmarginwidth + \showsetupA{rightedgedistance} \rightedgedistance + \showsetupA{rightedge} \rightedgewidth + \showsetupB{bodyfontsize} \the \globalbodyfontsize + \showsetupB{line} \relax \normallineheight + \showsetupB{height} \relax \strutheightfactor + \showsetupB{depth} \relax \strutdepthfactor + \showsetupB{topskip} \relax \topskipfactor + \showsetupB{maxdepth} \relax \maxdepthfactor}}} + +\stopinterface + +\gdef\showlayout % interfereert lelijk met een \typefile er na + {\bgroup + \page + \showframe + \setuplayout[\c!marking=\v!on] + \dorecurse{4}{\showsetups\page} + \egroup} + +\gdef\showmargins + {\starttabulate + \NC asynchrone \NC \doifoddpageelse {odd} {even} \NC \NR + \NC synchrone \NC \doifrightpageelse {right} {left} \NC \NR + \NC right margin \NC \the\rightmarginwidth \NC \NR + \NC left margin \NC \the\leftmarginwidth \NC \NR + \NC outer margin \NC \the\outermarginwidth \NC \NR + \NC inner margin \NC \the\innermarginwidth \NC \NR + \stoptabulate} + +\protect \endinput diff --git a/tex/context/base/page-run.mkiv b/tex/context/base/page-run.mkiv new file mode 100644 index 000000000..ae5af81e9 --- /dev/null +++ b/tex/context/base/page-run.mkiv @@ -0,0 +1,382 @@ +%D \module +%D [ file=page-run, +%D version=2000.10.20, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Runtime Macros} + +\unprotect + +\gdef\doshowprint[#1][#2][#3]% + {\framed + [\c!offset=\v!overlay, + \c!strut=\v!no] + {\forgetall + \dontcomplain + \globaldefs\minusone + \dimen0\pagegoal + \definepapersize[X][\c!width=4em, \c!height=6em]% + \definepapersize[Y][\c!width=12em,\c!height=14em]% + \setuppapersize[#1,X][#2,Y]% + \setuplayout[#3]% + \setbox0\vbox + {\framed + [\c!offset=\v!overlay,\c!strut=\v!no, + \c!width=\paperwidth,\c!height=\paperheight] + {\ss ABC\par DEF}}% + \doublesidedfalse + \def\cutmarklength{.5em}% + \addpagecutmarks0% + \replicatepagebox0% + \scalepagebox0% + \mirrorpaperbox0% + \orientpaperbox0% + \centerpagebox0% + \mirrorprintbox0% + \orientprintbox0% + \offsetprintbox0% + \pagegoal\dimen0 + \box0}} + +\gdef\showprint + {\dotripleempty\doshowprint} + +% \switchnaarkorps[8pt] +% +% \startcombinatie[4*4] +% {\toonprint} {\strut} +% {\toonprint[][][plaats=midden]} {\type{plaats=midden}} +% {\toonprint[][][plaats=midden,markering=aan]} {\type{markering=aan}\break +% \type{plaats=midden}} +% {\toonprint[][][plaats=midden,markering=aan,nx=2]} {\type{markering=aan}\break +% \type{plaats=midden}\break +% \type{nx=2}} +% {\toonprint[][][plaats=links]} {\type{plaats=links}} +% {\toonprint[][][plaats=rechts]} {\type{plaats=rechts}} +% {\toonprint[][][plaats={links,onder}]} {\type{plaats={links,onder}}} +% {\toonprint[][][plaats={rechts,onder}]} {\type{plaats={rechts,onder}}} +% {\toonprint[][][nx=2,ny=1]} {\type{nx=2,ny=1}} +% {\toonprint[][][nx=1,ny=2]} {\type{nx=1,ny=2}} +% {\toonprint[][][nx=2,ny=2]} {\type{nx=2,ny=2}} +% {\toonprint[][][nx=2,ny=2,plaats=midden]} {\type{nx=2,ny=2}\break +% \type{plaats=midden}} +% {\toonprint[][][rugoffset=3pt]} {\type{rugoffset=.5cm}} +% {\toonprint[][][kopoffset=3pt]} {\type{kopoffset=.5cm}} +% {\toonprint[][][schaal=1.5]} {\type{schaal=1.5}} +% {\toonprint[][][schaal=0.8]} {\type{schaal=0.8}} +% \stopcombinatie +% +% \startcombinatie[3*4] +% {\toonprint[liggend][][plaats=midden]} {\type{liggend}} +% {\toonprint[][liggend][plaats=midden]} {\strut\break\type{liggend}} +% {\toonprint[liggend][liggend][plaats=midden]} {\type{liggend}\break\type{liggend}} +% {\toonprint[90][][plaats=midden]} {\type{90}} +% {\toonprint[][90][plaats=midden]} {\strut\break\type{90}} +% {\toonprint[90][90][plaats=midden]} {\type{90}\break\type{90}} +% {\toonprint[180][][plaats=midden]} {\type{180}} +% {\toonprint[][180][plaats=midden]} {\strut\break\type{180}} +% {\toonprint[180][180][plaats=midden]} {\type{180}\break\type{180}} +% {\toonprint[gespiegeld][][plaats=midden]} {\type{gespiegeld}} +% {\toonprint[][gespiegeld][plaats=midden]} {\strut\break\type{gespiegeld}} +% {\toonprint[gespiegeld][gespiegeld][plaats=midden]} {\type{gespiegeld}\break\type{gespiegeld}} +% \stopcombinatie + +\gdef\doshowframe[#1][#2]% + {\ifsecondargument + \setupbackgrounds + [\v!page] + [\c!frame=\v!on, + \c!corner=\v!rectangular, + \c!frameoffset=\!!zeropoint, + \c!framedepth=\!!zeropoint, + \c!framecolor=layout:page] + \setupbackgrounds + [#1][#2] + [\c!background=, + \c!frame=\v!on, + \c!corner=\v!rectangular, + \c!frameoffset=\!!zeropoint, + \c!framedepth=\!!zeropoint, + \c!framecolor=] + \else\iffirstargument + \showframe + [\v!header,\v!text,\v!footer] + [#1] + \else + \showframe + [\v!header,\v!text,\v!footer] + [\v!leftedge,\v!leftmargin, + \v!text, + \v!rightmargin,\v!rightedge] + \fi\fi + \setupbackgrounds + [\c!state=\v!repeat]} + +\gdef\showframe{\dodoubleempty\doshowframe} + +\gdef\showsetupA#1#2% + {#1&\PtToCm{\the#2}&\the#2&\tttf\string#2\cr} + +\gdef\showsetupB#1#2#3% + {#1&#3&\tttf\string#3\cr} + +% \startinterface english % english is fallback + +\gdef\showsetups + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{paperheight} \paperheight + \showsetupA{paperwidth} \paperwidth + \showsetupA{printpaperheight} \printpaperheight + \showsetupA{printpaperwidth} \printpaperwidth + \showsetupA{topspace} \topspace + \showsetupA{backspace} \backspace + \showsetupA{height} \makeupheight + \showsetupA{width} \makeupwidth + \showsetupA{top} \topheight + \showsetupA{topdistance} \topdistance + \showsetupA{header} \headerheight + \showsetupA{headerdistance} \headerdistance + \showsetupA{textheight} \textheight + \showsetupA{footerdistance} \footerdistance + \showsetupA{footer} \footerheight + \showsetupA{bottomdistance} \bottomdistance + \showsetupA{bottom} \bottomheight + \showsetupA{leftedge} \leftedgewidth + \showsetupA{leftedgedistance} \leftedgedistance + \showsetupA{leftmargin} \leftmarginwidth + \showsetupA{leftmargindistance} \leftmargindistance + \showsetupA{textwidth} \textwidth + \showsetupA{rightmargindistance}\rightmargindistance + \showsetupA{rightmargin} \rightmarginwidth + \showsetupA{rightedgedistance} \rightedgedistance + \showsetupA{rightedge} \rightedgewidth + \showsetupB{bodyfontsize} \the \globalbodyfontsize + \showsetupB{line} \relax \normallineheight + \showsetupB{height} \relax \strutheightfactor + \showsetupB{depth} \relax \strutdepthfactor + \showsetupB{topskip} \relax \topskipfactor + \showsetupB{maxdepth} \relax \maxdepthfactor}}} + +% \stopinterface + +\startinterface dutch + +\gdef\showsetups + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{papierhoogte} \papierhoogte + \showsetupA{papierbreedte} \papierbreedte + \showsetupA{printpapierhoogte} \printpapierhoogte + \showsetupA{printpapierbreedte} \printpapierbreedte + \showsetupA{kopwit} \kopwit + \showsetupA{rugwit} \rugwit + \showsetupA{snijwit} \snijwit + \showsetupA{hoogte} \zethoogte + \showsetupA{breedte} \zetbreedte + \showsetupA{boven} \bovenhoogte + \showsetupA{bovenafstand} \bovenafstand + \showsetupA{hoofd} \hoofdhoogte + \showsetupA{hoofdafstand} \hoofdafstand + \showsetupA{teksthoogte} \teksthoogte + \showsetupA{voetafstand} \voetafstand + \showsetupA{voet} \voethoogte + \showsetupA{onderafstand} \onderafstand + \showsetupA{onder} \onderhoogte + \showsetupA{linkerrand} \linkerrandbreedte + \showsetupA{linkerrandafstand} \linkerrandafstand + \showsetupA{linkermarge} \linkermargebreedte + \showsetupA{linkermargeafstand} \linkermargeafstand + \showsetupA{tekstbreedte} \tekstbreedte + \showsetupA{rechtermargeafstand}\rechtermargeafstand + \showsetupA{rechtermarge} \rechtermargebreedte + \showsetupA{rechterrandafstand} \rechterrandafstand + \showsetupA{rechterrand} \rechterrandbreedte + \showsetupB{korps} \the \globalbodyfontsize + \showsetupB{regel} \relax \normallineheight + \showsetupB{hoogte} \relax \strutheightfactor + \showsetupB{diepte} \relax \strutdepthfactor + \showsetupB{boven} \relax \topskipfactor + \showsetupB{onder} \relax \maxdepthfactor}}} + +\stopinterface + +% todo: \showsetupA{rugwit} \rugwit + +\startinterface german + +\gdef\showsetups% + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{papierhoehe} \papierhoehe + \showsetupA{papierbreite} \papierbreite + \showsetupA{printpapierhoehe} \printpapierhoehe + \showsetupA{printpapierbreite} \printpapierbreite + \showsetupA{kopfweite} \kopfweite + \showsetupA{rumpfweite} \rumpfweite + \showsetupA{hoehe} \satzhoehe + \showsetupA{breite} \satzbreite + \showsetupA{oben} \hoeheoben + \showsetupA{abstandoben} \abstandoben + \showsetupA{kopfzeile} \kopfzeilenhoehe + \showsetupA{kopfzeilenabstand} \kopfzeilenabstand + \showsetupA{texthoehe} \texthoehe + \showsetupA{fusszeileabstand} \fusszeileabstand + \showsetupA{fusszeilen} \fusszeilenhoehe + \showsetupA{abstandunten} \abstandunten + \showsetupA{hoeheunten} \hoeheunten + \showsetupA{linkerrand} \breitelinkerrand + \showsetupA{abstandlinkerrand} \abstandlinkerrand + \showsetupA{linkemarginal} \linkemarginalbreite + \showsetupA{linkemarginalafstand} \linkemarginalafstand + \showsetupA{textbreite} \textbreite + \showsetupA{rechtemarginalafstand}\rechtemarginalafstand + \showsetupA{rechtemarginal} \rechtemarginalbreite + \showsetupA{abstandrechterrand} \abstandrechterrand + \showsetupA{rechterrand} \breiterechterrand + \showsetupB{fliesstext} \the \globalbodyfontsize + \showsetupB{linie} \relax \normallineheight + \showsetupB{hoehe} \relax \strutheightfactor + \showsetupB{tiefe} \relax \strutdepthfactor + \showsetupB{topskip} \relax \topskipfactor + \showsetupB{maxdepth} \relax \maxdepthfactor}}} + +\stopinterface + +\startinterface czech + +\gdef\showsetups% + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{vyskapapiru} \vyskapapiru + \showsetupA{sirkapapiru} \sirkapapiru + \showsetupA{vyskatiskpapiru} \vyskatiskpapiru + \showsetupA{sirkatiskpapiru} \sirkatiskpapiru + \showsetupA{hornimezera} \hornimezera + \showsetupA{spodnimezera} \spodnimezera + \showsetupA{vyska} \vyskasazby + \showsetupA{breite} \sirkasazby + \showsetupA{vyskatextu} \vyskatextu + \showsetupA{sirkatextu} \sirkatextu + \showsetupA{horejsek} \vyskahorejsku + \showsetupA{vzdalenosthorejsku} \vzdalenosthorejsku + \showsetupA{zahlavi} \vyskazahlavi + \showsetupA{vzdalenostzahlavi} \vzdalenostzahlavi + \showsetupA{fusszeileabstand} \vzdalenostupati + \showsetupA{upati} \vyskaupati + \showsetupA{vzdalenostspodku} \vzdalenostspodku + \showsetupA{spodek} \vyakaspodku + \showsetupA{levyokraj} \sirkalevehookraje + \showsetupA{vzdalenostlevehookraje} \vzdalenostlevehookraje + \showsetupA{levamarginalie} \sirkalevemarginalie + \showsetupA{vzdalenostlevemarginalie} \vzdalenostlevemarginalie + \showsetupA{vzdalenostpravemarginalie}\vzdalenostpravemarginalie + \showsetupA{pravamarginalie} \sirkapravemarginalie + \showsetupA{vzdalenostpravehookraje} \vzdalenostpravehookraje + \showsetupA{pravyokraj} \sirkapravehookraje + \showsetupB{zakladnivelikost} \the \globalbodyfontsize + \showsetupB{linka} \relax \normallineheight + \showsetupB{vyska} \relax \strutheightfactor + \showsetupB{hloubka} \relax \strutdepthfactor + \showsetupB{topskip} \relax \topskipfactor + \showsetupB{maxdepth} \relax \maxdepthfactor}}} + +\stopinterface + +\startinterface romanian + +\gdef\showsetups% + {\noindent + \vbox + {\forgetall + \dontcomplain + \switchtobodyfont[\v!small] + \tabskip\zeropoint + \halign + {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr + \showsetupA{paperheight} \paperheight + \showsetupA{paperwidth} \paperwidth + \showsetupA{printpaperheight} \printpaperheight + \showsetupA{printpaperwidth} \printpaperwidth + \showsetupA{topspace} \topspace + \showsetupA{backspace} \backspace + \showsetupA{height} \makeupheight + \showsetupA{width} \makeupwidth + \showsetupA{top} \topheight + \showsetupA{topdistance} \topdistance + \showsetupA{header} \headerheight + \showsetupA{headerdistance} \headerdistance + \showsetupA{textheight} \textheight + \showsetupA{footerdistance} \footerdistance + \showsetupA{footer} \footerheight + \showsetupA{bottomdistance} \bottomdistance + \showsetupA{bottom} \bottomheight + \showsetupA{leftedge} \leftedgewidth + \showsetupA{leftedgedistance} \leftedgedistance + \showsetupA{leftmargin} \leftmarginwidth + \showsetupA{leftmargindistance} \leftmargindistance + \showsetupA{textwidth} \textwidth + \showsetupA{rightmargindistance}\rightmargindistance + \showsetupA{rightmargin} \rightmarginwidth + \showsetupA{rightedgedistance} \rightedgedistance + \showsetupA{rightedge} \rightedgewidth + \showsetupB{bodyfontsize} \the \globalbodyfontsize + \showsetupB{line} \relax \normallineheight + \showsetupB{height} \relax \strutheightfactor + \showsetupB{depth} \relax \strutdepthfactor + \showsetupB{topskip} \relax \topskipfactor + \showsetupB{maxdepth} \relax \maxdepthfactor}}} + +\stopinterface + +\gdef\showlayout % interfereert lelijk met een \typefile er na + {\bgroup + \page + \showframe + \setuplayout[\c!marking=\v!on] + \dorecurse{4}{\showsetups\page} + \egroup} + +\gdef\showmargins + {\starttabulate + \NC asynchrone \NC \doifoddpageelse {odd} {even} \NC \NR + \NC synchrone \NC \doifrightpageelse {right} {left} \NC \NR + \NC right margin \NC \the\rightmarginwidth \NC \NR + \NC left margin \NC \the\leftmarginwidth \NC \NR + \NC outer margin \NC \the\outermarginwidth \NC \NR + \NC inner margin \NC \the\innermarginwidth \NC \NR + \stoptabulate} + +\protect \endinput diff --git a/tex/context/base/page-run.tex b/tex/context/base/page-run.tex deleted file mode 100644 index ae5af81e9..000000000 --- a/tex/context/base/page-run.tex +++ /dev/null @@ -1,382 +0,0 @@ -%D \module -%D [ file=page-run, -%D version=2000.10.20, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Runtime Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Runtime Macros} - -\unprotect - -\gdef\doshowprint[#1][#2][#3]% - {\framed - [\c!offset=\v!overlay, - \c!strut=\v!no] - {\forgetall - \dontcomplain - \globaldefs\minusone - \dimen0\pagegoal - \definepapersize[X][\c!width=4em, \c!height=6em]% - \definepapersize[Y][\c!width=12em,\c!height=14em]% - \setuppapersize[#1,X][#2,Y]% - \setuplayout[#3]% - \setbox0\vbox - {\framed - [\c!offset=\v!overlay,\c!strut=\v!no, - \c!width=\paperwidth,\c!height=\paperheight] - {\ss ABC\par DEF}}% - \doublesidedfalse - \def\cutmarklength{.5em}% - \addpagecutmarks0% - \replicatepagebox0% - \scalepagebox0% - \mirrorpaperbox0% - \orientpaperbox0% - \centerpagebox0% - \mirrorprintbox0% - \orientprintbox0% - \offsetprintbox0% - \pagegoal\dimen0 - \box0}} - -\gdef\showprint - {\dotripleempty\doshowprint} - -% \switchnaarkorps[8pt] -% -% \startcombinatie[4*4] -% {\toonprint} {\strut} -% {\toonprint[][][plaats=midden]} {\type{plaats=midden}} -% {\toonprint[][][plaats=midden,markering=aan]} {\type{markering=aan}\break -% \type{plaats=midden}} -% {\toonprint[][][plaats=midden,markering=aan,nx=2]} {\type{markering=aan}\break -% \type{plaats=midden}\break -% \type{nx=2}} -% {\toonprint[][][plaats=links]} {\type{plaats=links}} -% {\toonprint[][][plaats=rechts]} {\type{plaats=rechts}} -% {\toonprint[][][plaats={links,onder}]} {\type{plaats={links,onder}}} -% {\toonprint[][][plaats={rechts,onder}]} {\type{plaats={rechts,onder}}} -% {\toonprint[][][nx=2,ny=1]} {\type{nx=2,ny=1}} -% {\toonprint[][][nx=1,ny=2]} {\type{nx=1,ny=2}} -% {\toonprint[][][nx=2,ny=2]} {\type{nx=2,ny=2}} -% {\toonprint[][][nx=2,ny=2,plaats=midden]} {\type{nx=2,ny=2}\break -% \type{plaats=midden}} -% {\toonprint[][][rugoffset=3pt]} {\type{rugoffset=.5cm}} -% {\toonprint[][][kopoffset=3pt]} {\type{kopoffset=.5cm}} -% {\toonprint[][][schaal=1.5]} {\type{schaal=1.5}} -% {\toonprint[][][schaal=0.8]} {\type{schaal=0.8}} -% \stopcombinatie -% -% \startcombinatie[3*4] -% {\toonprint[liggend][][plaats=midden]} {\type{liggend}} -% {\toonprint[][liggend][plaats=midden]} {\strut\break\type{liggend}} -% {\toonprint[liggend][liggend][plaats=midden]} {\type{liggend}\break\type{liggend}} -% {\toonprint[90][][plaats=midden]} {\type{90}} -% {\toonprint[][90][plaats=midden]} {\strut\break\type{90}} -% {\toonprint[90][90][plaats=midden]} {\type{90}\break\type{90}} -% {\toonprint[180][][plaats=midden]} {\type{180}} -% {\toonprint[][180][plaats=midden]} {\strut\break\type{180}} -% {\toonprint[180][180][plaats=midden]} {\type{180}\break\type{180}} -% {\toonprint[gespiegeld][][plaats=midden]} {\type{gespiegeld}} -% {\toonprint[][gespiegeld][plaats=midden]} {\strut\break\type{gespiegeld}} -% {\toonprint[gespiegeld][gespiegeld][plaats=midden]} {\type{gespiegeld}\break\type{gespiegeld}} -% \stopcombinatie - -\gdef\doshowframe[#1][#2]% - {\ifsecondargument - \setupbackgrounds - [\v!page] - [\c!frame=\v!on, - \c!corner=\v!rectangular, - \c!frameoffset=\!!zeropoint, - \c!framedepth=\!!zeropoint, - \c!framecolor=layout:page] - \setupbackgrounds - [#1][#2] - [\c!background=, - \c!frame=\v!on, - \c!corner=\v!rectangular, - \c!frameoffset=\!!zeropoint, - \c!framedepth=\!!zeropoint, - \c!framecolor=] - \else\iffirstargument - \showframe - [\v!header,\v!text,\v!footer] - [#1] - \else - \showframe - [\v!header,\v!text,\v!footer] - [\v!leftedge,\v!leftmargin, - \v!text, - \v!rightmargin,\v!rightedge] - \fi\fi - \setupbackgrounds - [\c!state=\v!repeat]} - -\gdef\showframe{\dodoubleempty\doshowframe} - -\gdef\showsetupA#1#2% - {#1&\PtToCm{\the#2}&\the#2&\tttf\string#2\cr} - -\gdef\showsetupB#1#2#3% - {#1&#3&\tttf\string#3\cr} - -% \startinterface english % english is fallback - -\gdef\showsetups - {\noindent - \vbox - {\forgetall - \dontcomplain - \switchtobodyfont[\v!small] - \tabskip\zeropoint - \halign - {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr - \showsetupA{paperheight} \paperheight - \showsetupA{paperwidth} \paperwidth - \showsetupA{printpaperheight} \printpaperheight - \showsetupA{printpaperwidth} \printpaperwidth - \showsetupA{topspace} \topspace - \showsetupA{backspace} \backspace - \showsetupA{height} \makeupheight - \showsetupA{width} \makeupwidth - \showsetupA{top} \topheight - \showsetupA{topdistance} \topdistance - \showsetupA{header} \headerheight - \showsetupA{headerdistance} \headerdistance - \showsetupA{textheight} \textheight - \showsetupA{footerdistance} \footerdistance - \showsetupA{footer} \footerheight - \showsetupA{bottomdistance} \bottomdistance - \showsetupA{bottom} \bottomheight - \showsetupA{leftedge} \leftedgewidth - \showsetupA{leftedgedistance} \leftedgedistance - \showsetupA{leftmargin} \leftmarginwidth - \showsetupA{leftmargindistance} \leftmargindistance - \showsetupA{textwidth} \textwidth - \showsetupA{rightmargindistance}\rightmargindistance - \showsetupA{rightmargin} \rightmarginwidth - \showsetupA{rightedgedistance} \rightedgedistance - \showsetupA{rightedge} \rightedgewidth - \showsetupB{bodyfontsize} \the \globalbodyfontsize - \showsetupB{line} \relax \normallineheight - \showsetupB{height} \relax \strutheightfactor - \showsetupB{depth} \relax \strutdepthfactor - \showsetupB{topskip} \relax \topskipfactor - \showsetupB{maxdepth} \relax \maxdepthfactor}}} - -% \stopinterface - -\startinterface dutch - -\gdef\showsetups - {\noindent - \vbox - {\forgetall - \dontcomplain - \switchtobodyfont[\v!small] - \tabskip\zeropoint - \halign - {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr - \showsetupA{papierhoogte} \papierhoogte - \showsetupA{papierbreedte} \papierbreedte - \showsetupA{printpapierhoogte} \printpapierhoogte - \showsetupA{printpapierbreedte} \printpapierbreedte - \showsetupA{kopwit} \kopwit - \showsetupA{rugwit} \rugwit - \showsetupA{snijwit} \snijwit - \showsetupA{hoogte} \zethoogte - \showsetupA{breedte} \zetbreedte - \showsetupA{boven} \bovenhoogte - \showsetupA{bovenafstand} \bovenafstand - \showsetupA{hoofd} \hoofdhoogte - \showsetupA{hoofdafstand} \hoofdafstand - \showsetupA{teksthoogte} \teksthoogte - \showsetupA{voetafstand} \voetafstand - \showsetupA{voet} \voethoogte - \showsetupA{onderafstand} \onderafstand - \showsetupA{onder} \onderhoogte - \showsetupA{linkerrand} \linkerrandbreedte - \showsetupA{linkerrandafstand} \linkerrandafstand - \showsetupA{linkermarge} \linkermargebreedte - \showsetupA{linkermargeafstand} \linkermargeafstand - \showsetupA{tekstbreedte} \tekstbreedte - \showsetupA{rechtermargeafstand}\rechtermargeafstand - \showsetupA{rechtermarge} \rechtermargebreedte - \showsetupA{rechterrandafstand} \rechterrandafstand - \showsetupA{rechterrand} \rechterrandbreedte - \showsetupB{korps} \the \globalbodyfontsize - \showsetupB{regel} \relax \normallineheight - \showsetupB{hoogte} \relax \strutheightfactor - \showsetupB{diepte} \relax \strutdepthfactor - \showsetupB{boven} \relax \topskipfactor - \showsetupB{onder} \relax \maxdepthfactor}}} - -\stopinterface - -% todo: \showsetupA{rugwit} \rugwit - -\startinterface german - -\gdef\showsetups% - {\noindent - \vbox - {\forgetall - \dontcomplain - \switchtobodyfont[\v!small] - \tabskip\zeropoint - \halign - {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr - \showsetupA{papierhoehe} \papierhoehe - \showsetupA{papierbreite} \papierbreite - \showsetupA{printpapierhoehe} \printpapierhoehe - \showsetupA{printpapierbreite} \printpapierbreite - \showsetupA{kopfweite} \kopfweite - \showsetupA{rumpfweite} \rumpfweite - \showsetupA{hoehe} \satzhoehe - \showsetupA{breite} \satzbreite - \showsetupA{oben} \hoeheoben - \showsetupA{abstandoben} \abstandoben - \showsetupA{kopfzeile} \kopfzeilenhoehe - \showsetupA{kopfzeilenabstand} \kopfzeilenabstand - \showsetupA{texthoehe} \texthoehe - \showsetupA{fusszeileabstand} \fusszeileabstand - \showsetupA{fusszeilen} \fusszeilenhoehe - \showsetupA{abstandunten} \abstandunten - \showsetupA{hoeheunten} \hoeheunten - \showsetupA{linkerrand} \breitelinkerrand - \showsetupA{abstandlinkerrand} \abstandlinkerrand - \showsetupA{linkemarginal} \linkemarginalbreite - \showsetupA{linkemarginalafstand} \linkemarginalafstand - \showsetupA{textbreite} \textbreite - \showsetupA{rechtemarginalafstand}\rechtemarginalafstand - \showsetupA{rechtemarginal} \rechtemarginalbreite - \showsetupA{abstandrechterrand} \abstandrechterrand - \showsetupA{rechterrand} \breiterechterrand - \showsetupB{fliesstext} \the \globalbodyfontsize - \showsetupB{linie} \relax \normallineheight - \showsetupB{hoehe} \relax \strutheightfactor - \showsetupB{tiefe} \relax \strutdepthfactor - \showsetupB{topskip} \relax \topskipfactor - \showsetupB{maxdepth} \relax \maxdepthfactor}}} - -\stopinterface - -\startinterface czech - -\gdef\showsetups% - {\noindent - \vbox - {\forgetall - \dontcomplain - \switchtobodyfont[\v!small] - \tabskip\zeropoint - \halign - {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr - \showsetupA{vyskapapiru} \vyskapapiru - \showsetupA{sirkapapiru} \sirkapapiru - \showsetupA{vyskatiskpapiru} \vyskatiskpapiru - \showsetupA{sirkatiskpapiru} \sirkatiskpapiru - \showsetupA{hornimezera} \hornimezera - \showsetupA{spodnimezera} \spodnimezera - \showsetupA{vyska} \vyskasazby - \showsetupA{breite} \sirkasazby - \showsetupA{vyskatextu} \vyskatextu - \showsetupA{sirkatextu} \sirkatextu - \showsetupA{horejsek} \vyskahorejsku - \showsetupA{vzdalenosthorejsku} \vzdalenosthorejsku - \showsetupA{zahlavi} \vyskazahlavi - \showsetupA{vzdalenostzahlavi} \vzdalenostzahlavi - \showsetupA{fusszeileabstand} \vzdalenostupati - \showsetupA{upati} \vyskaupati - \showsetupA{vzdalenostspodku} \vzdalenostspodku - \showsetupA{spodek} \vyakaspodku - \showsetupA{levyokraj} \sirkalevehookraje - \showsetupA{vzdalenostlevehookraje} \vzdalenostlevehookraje - \showsetupA{levamarginalie} \sirkalevemarginalie - \showsetupA{vzdalenostlevemarginalie} \vzdalenostlevemarginalie - \showsetupA{vzdalenostpravemarginalie}\vzdalenostpravemarginalie - \showsetupA{pravamarginalie} \sirkapravemarginalie - \showsetupA{vzdalenostpravehookraje} \vzdalenostpravehookraje - \showsetupA{pravyokraj} \sirkapravehookraje - \showsetupB{zakladnivelikost} \the \globalbodyfontsize - \showsetupB{linka} \relax \normallineheight - \showsetupB{vyska} \relax \strutheightfactor - \showsetupB{hloubka} \relax \strutdepthfactor - \showsetupB{topskip} \relax \topskipfactor - \showsetupB{maxdepth} \relax \maxdepthfactor}}} - -\stopinterface - -\startinterface romanian - -\gdef\showsetups% - {\noindent - \vbox - {\forgetall - \dontcomplain - \switchtobodyfont[\v!small] - \tabskip\zeropoint - \halign - {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr - \showsetupA{paperheight} \paperheight - \showsetupA{paperwidth} \paperwidth - \showsetupA{printpaperheight} \printpaperheight - \showsetupA{printpaperwidth} \printpaperwidth - \showsetupA{topspace} \topspace - \showsetupA{backspace} \backspace - \showsetupA{height} \makeupheight - \showsetupA{width} \makeupwidth - \showsetupA{top} \topheight - \showsetupA{topdistance} \topdistance - \showsetupA{header} \headerheight - \showsetupA{headerdistance} \headerdistance - \showsetupA{textheight} \textheight - \showsetupA{footerdistance} \footerdistance - \showsetupA{footer} \footerheight - \showsetupA{bottomdistance} \bottomdistance - \showsetupA{bottom} \bottomheight - \showsetupA{leftedge} \leftedgewidth - \showsetupA{leftedgedistance} \leftedgedistance - \showsetupA{leftmargin} \leftmarginwidth - \showsetupA{leftmargindistance} \leftmargindistance - \showsetupA{textwidth} \textwidth - \showsetupA{rightmargindistance}\rightmargindistance - \showsetupA{rightmargin} \rightmarginwidth - \showsetupA{rightedgedistance} \rightedgedistance - \showsetupA{rightedge} \rightedgewidth - \showsetupB{bodyfontsize} \the \globalbodyfontsize - \showsetupB{line} \relax \normallineheight - \showsetupB{height} \relax \strutheightfactor - \showsetupB{depth} \relax \strutdepthfactor - \showsetupB{topskip} \relax \topskipfactor - \showsetupB{maxdepth} \relax \maxdepthfactor}}} - -\stopinterface - -\gdef\showlayout % interfereert lelijk met een \typefile er na - {\bgroup - \page - \showframe - \setuplayout[\c!marking=\v!on] - \dorecurse{4}{\showsetups\page} - \egroup} - -\gdef\showmargins - {\starttabulate - \NC asynchrone \NC \doifoddpageelse {odd} {even} \NC \NR - \NC synchrone \NC \doifrightpageelse {right} {left} \NC \NR - \NC right margin \NC \the\rightmarginwidth \NC \NR - \NC left margin \NC \the\leftmarginwidth \NC \NR - \NC outer margin \NC \the\outermarginwidth \NC \NR - \NC inner margin \NC \the\innermarginwidth \NC \NR - \stoptabulate} - -\protect \endinput diff --git a/tex/context/base/page-set.mkii b/tex/context/base/page-set.mkii new file mode 100644 index 000000000..b8a075179 --- /dev/null +++ b/tex/context/base/page-set.mkii @@ -0,0 +1,3109 @@ +%D \module +%D [ file=page-set, +%D version=2000.10.20, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Column Sets, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% getnoflines vs getrawnoflines + +% some day: cleanup and go etex + +\writestatus{loading}{ConTeXt Page Macros / Column Sets} + +% todo : last longer than previous +% todo : block span over last column if footnotes +% todo : diagnosis balancing run +% todo : separate footnote placement +% todo : go on on same page with colset +% todo : test page areas per page +% todo : leftmargin/rightmargin (better than afstand(1)) + +% use the OTRSET layer for more purposes, like the footnotes ! + +\unprotect + +\newcount\tofcolumns % total +\newcount\lofcolumns % left +\newcount\rofcolumns % right + +\newcount\columnfirstcell \columnfirstcell=1 +\newcount\columnlastcell +\newcount\columnfreecells +\newcount\currenthcell +\newcount\currentvcell +\newcount\columnhcells +\newcount\columnvcells + +\newif\ifenoughcolumncells +\newif\ifsomefreecolumncells +\newif\ifcolumnspread +\newif\iftracecolumnset % \tracecolumnsettrue + +\def\columnmaxcells {75} % runtime +\def\columnmaxfreecells {0} % runtime +\def\columngaplimit {0} % {5} + +\def\@otr@{otr} + +\def\OTRSETmakeupwidth{\innermakeupwidth} + +\let\OTRSETflushsidefloats \forgetsidefloats % \relax +\let\OTRSETsynchronizesidefloats\forgetsidefloats % \relax + +\def\OTRSETgridcell #1#2{\csname \@otr@:\number#1:\number#2\endcsname} +\def\OTRSETgetgridcell#1#2{\box\csname \@otr@:\number#1:\number#2\endcsname} +\def\OTRSETsetgridcell#1#2{\global\setbox\csname\@otr@:\number#1:\number#2\endcsname} + +\long\def\OTRSETdoifcellelse#1#2% + {\relax\ifvoid\csname\@otr@:\number#1:\number#2\endcsname + \@EA\secondoftwoarguments\else\@EA\firstoftwoarguments + \fi} + +% The following two macros are used to compensate for a switch in body fonts +% as in: +% +% \definecolumnset [two] [n=2,balancing=yes] +% \definecolumnset [three] [n=3,balancing=yes] +% +% \setupcolumnsetlines[two][1][1][7] +% \setupcolumnsetlines[two][1][2][10] +% +% \setupcolumnsetlines[three][1][1][40] +% \setupcolumnsetlines[three][1][2][40] +% \setupcolumnsetlines[three][1][3][40] +% +% \setupcolumnsetstart[three][1][1][15] +% \setupcolumnsetstart[three][1][2][20] +% \setupcolumnsetstart[three][1][3][20] +% +% \starttext +% \startcolumnset [two] \dorecurse {1}{\input tufte \par} \stopcolumnset +% \switchtobodyfont[small] +% \startcolumnset [three] \dorecurse {1}{\input tufte \par} \stopcolumnset +% \stoptext + +%D Marks in columnsets: +%D +%D \starttyping +%D \definemarking[M] +%D \setupheadertexts[\setups{show-M-marks}] +%D \definecolumnset[test][n=3] +%D +%D \startsetups show-M-marks +%D \getmarking[M][1][previous]/\getmarking[M][1][first]/\getmarking[M][1][last]\quad +%D \getmarking[M][2][previous]/\getmarking[M][2][first]/\getmarking[M][2][last]\quad +%D \getmarking[M][3][previous]/\getmarking[M][3][first]/\getmarking[M][3][last]\quad +%D \getmarking[M][1][previous]/\getmarking[M][1][first]/\getmarking[M][last]\quad +%D \getsavedmarking[M][previous]/\getsavedmarking[M][first]/\getsavedmarking[M][last] +%D \stopsetups +%D +%D \startbuffer +%D \section{Knuth} [K1]\marking[M]{k1} [K2]\marking[M]{k2} \input knuth +%D \section{Zapf} [Z]\marking[M]{z} \input zapf +%D \stopbuffer +%D +%D \startbuffer +%D \section{Ward} [W]\marking[M]{w} \input ward +%D \placefigure[here]{none}{\externalfigure[a][height=2cm]} +%D \section{Davis} [D]\marking[M]{d} \input davis +%D \section{Zapf} [Z]\marking[M]{z} \input zapf +%D \stopbuffer +%D +%D \startbuffer +%D \section{Ward} [W]\marking[M]{w} \input ward +%D \placefigure[here]{none}{\externalfigure[a][height=2cm]} +%D \section{Davis} [D]\marking[M]{d} \input davis +%D \section{Zapf} [Z]\marking[M]{z} \input zapf +%D \section{Douglas} [O]\marking[M]{o} \input douglas +%D \stopbuffer +%D +%D \starttext +%D \startcolumnset[test] +%D \dorecurse{5}{\getbuffer} +%D \placefigure[here]{none}{\externalfigure[a][height=2cm]} +%D % \column % sometimes needed +%D \stopcolumnset +%D \stoptext +%D \stoptyping + +% not ok yet, for column sets we need a special case: within a column we +% need to bubble-up the marks; the indirectness permits overloading here + +\let\saveOTRSETmark \refreshsavedmark +\let\bubbleOTRSETmark\bubblesavedmark +\let\resetOTRSETmark \resetsavedmark +\let\presetOTRSETmark\presetsavedmark + +\def\doregisterOTRSETmarks#1{\saveOTRSETmark [#1][\number\mofcolumns]} +\def\dobubbleOTRSETmarks #1{\bubbleOTRSETmark[#1][\number\mofcolumns]} +\def\doresetOTRSETmarks #1{\resetOTRSETmark [#1][\recurselevel]} +\def\dopresetOTRSETmarks #1{\presetOTRSETmark[#1][\recurselevel]} + +\def\registerOTRSETmarks + {\processcommacommand[\alldefinedmarks]\doregisterOTRSETmarks} +\def\bubbleOTRSETmarks + {\processcommacommand[\alldefinedmarks]\dobubbleOTRSETmarks} +\def\resetOTRSETmarks + {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\doresetOTRSETmarks}} +\def\presetOTRSETmarks + {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\dopresetOTRSETmarks}} + +%D test case of Vit Zika (context list): +%D +%D \starttyping +%D \setuplayout[height=middle,width=middle,grid=yes] +%D +%D \starttext +%D \startcolumnset +%D \dorecurse{10} +%D {\input thuan \endgraf +%D \bgroup +%D \ss\restoreinterlinespace +%D \dorecurse{3}{\input hawking \endgraf} +%D \egroup +%D \input bryson \endgraf} +%D \stopcolumnset +%D \stoptext +%D \stoptyping + +\def\OTRSETsetcorrectnofcells#1% + {\bgroup + \!!counta#1\relax + \ifdim\globalbodyfontsize=\localbodyfontsize + \restoreinterlinespace + \else + \!!dimena-\!!counta\lineheight + \restoreglobalbodyfont % slow, we need a fast one + \advance\!!dimena\!!counta\lineheight + \getnoflines\!!dimena + \advance\!!counta\noflines + \ifnum\!!counta<#1\else + \!!counta#1\relax + \fi + \fi + \relax % needed ! ! ! ! else lookahead over \fi and \@EA + \@EA\egroup\@EA\scratchcounter\the\!!counta\relax} + +\def\OTRSETsetcorrectcellht + {\bgroup + \!!dimena-\strutht\relax + \ifdim\globalbodyfontsize=\localbodyfontsize + \restoreinterlinespace + \else + \restoreglobalbodyfont + \fi + \advance\!!dimena\strutht + \relax % needed ! ! ! ! else lookahead over \fi and \@EA + \@EA\egroup\@EA\scratchdimen\the\!!dimena\relax} + +\def\columnerasegridboxes % maybe dedicated loops + {\bgroup + \increment\columnmaxcells\relax + \ifodd\realpageno + \else % we are on the other page + \columnspreadfalse + \fi + \ifcolumnspread + \dorecurse\nofcolumns + {\let\!!stringa\recurselevel + \scratchcounter\recurselevel \advance\scratchcounter\lofcolumns + \edef\!!stringb{\the\scratchcounter}% + \dostepwiserecurse \zerocount \columnmaxcells \plusone + {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname + \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname + \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname + \box\csname\@otr@:\!!stringb:\recurselevel\endcsname + %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname + \else + \emptybox + %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox + \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname + \fi + \else + \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname + \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname + \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname + \else + \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname + \fi + \fi}}% + \else + \dorecurse \tofcolumns + {\let\!!stringa\recurselevel + \dostepwiserecurse \zerocount \columnmaxcells \plusone + {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname + \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox + \else + \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname + \fi}}% + \fi + \dorecurse\tofcolumns + {\global\setbox\csname\@otr@:\recurselevel:\columnmaxcells\endcsname\copy\placeholderboxa}% + \global\columnfirstcell\zerocount + \global\columnlastcell\columnfirstcell + \global\columnfreecells\columnfirstcell + \egroup} + +\def\doOTRSETsetgridcells#1#2#3#4#5#6% placeholder col row wid hei {data} + {\!!countd#2\advance\!!countd#4\advance\!!countd\minusone + \!!counte#3\advance\!!counte#5\advance\!!counte\minusone + \dostepwiserecurse{#2}\!!countd\plusone + {\!!countf\recurselevel + \dostepwiserecurse{#3}\!!counte\plusone + {\OTRSETsetgridcell\!!countf\recurselevel#1}}% + \dostepwiserecurse{#3}\!!counte\plusone + {\global\wd\OTRSETgridcell{#2}\recurselevel\hsize}% + \OTRSETsetgridcell{#2}\!!counte#6} + +\def\OTRSETsetgridcells + {\doOTRSETsetgridcells{\copy\placeholderboxb}} + +\def\OTRSETerasegridcells#1#2#3#4% + {\doOTRSETsetgridcells{\emptybox}{#1}{#2}{#3}{#4}{\emptybox}} + +\def\setupcolumnsetlines{\doquintupleempty\dosetupcolumnsettrick[l]} +\def\setupcolumnsetstart{\doquintupleempty\dosetupcolumnsettrick[s]} + +\def\dosetupcolumnsettrick[#1][#2][#3][#4][#5]% tag id page col value + {% not needed, is already relative + % \doifinstringelse{+}{#3}{\scratchcounter\realpageno}{\scratchcounter\zerocount}% + % \advance\scratchcounter#3\relax % \relax needed + % \setevalue{\??mc:#1:#2:\the\scratchcounter:\number#4}{\number#5}} + \iffifthargument + \setevalue{\??mc:#1:#2:\number#3:\number#4}{\number#5}% + \else + \setevalue{\??mc:#1:#2:\number#3:0}{\number#4}% + \fi} + +\def\currentcolumnmaxcellstag #1{\??mc:l:\OTRSETidentifier:\columnsetpage:\number#1} +\def\currentcolumnstartcelltag#1{\??mc:s:\OTRSETidentifier:\columnsetpage:\number#1} + +\def\doresetcolumnsetlines#1% + {\ifcsname\currentcolumnmaxcellstag{#1}\endcsname + \letgvalue{\currentcolumnmaxcellstag{#1}}\zerocount + \fi + \ifcsname\currentcolumnmaxcellstag{#1}\endcsname + \letgvalue{\currentcolumnmaxcellstag{#1}}\zerocount + \fi} + +\def\currentcolumnsomecells#1#2% + {\ifcsname#1\mofcolumns\endcsname + \ifnum\csname#1\mofcolumns\endcsname=\zerocount + #2% + \else + \number\numexpr\ifnum\csname#1\mofcolumns\endcsname<\zerocount + \columnmaxcells+\fi\csname#1\mofcolumns\endcsname\relax + \fi + \else\ifcsname#10\endcsname + \ifnum\csname#10\endcsname=\zerocount + #2% + \else + \number\numexpr\ifnum\csname#10\endcsname<\zerocount + \columnmaxcells+\fi\csname#10\endcsname\relax + \fi + \else + #2% + \fi\fi} + +\def\currentcolumnmaxcells {\currentcolumnsomecells\currentcolumnmaxcellstag \columnmaxcells} +\def\currentcolumnstartcell{\currentcolumnsomecells\currentcolumnstartcelltag\plusone} + +\def\OTRSETsetfreecells#1#2% col start + {\bgroup + \global\columnfirstcell\ifnum#2=0 1\else#2\fi\relax + \OTRSETsetcorrectnofcells\currentcolumnmaxcells % sets \scratchcounter + \edef\columnmaxcells{\the\scratchcounter}% + \ifnum\columnfirstcell>\columnmaxcells + \global\columnfreecells\zerocount + \global\columnfirstcell\plusone + \global\columnlastcell \zerocount + \global\somefreecolumncellsfalse + %\message{no cells a}% + \else + \doloop + {\ifnum\columnfirstcell>\columnmaxcells\relax + \exitloop + \else + \OTRSETdoifcellelse{#1}\columnfirstcell + {\global\advance\columnfirstcell\plusone}\exitloop + \fi}% + \global\columnlastcell\columnfirstcell + \doloop + {\ifnum\columnlastcell>\columnmaxcells\relax + \exitloop + \else + \OTRSETdoifcellelse{#1}\columnlastcell + {\global\advance\columnlastcell \minusone \exitloop} + {\global\advance\columnlastcell \plusone }% + \fi}% + \ifnum\columnfirstcell>\columnmaxcells + \global\columnfreecells\zerocount + \global\columnfirstcell\plusone + \global\columnlastcell \zerocount + \global\somefreecolumncellsfalse + %\message{no cells b}% + \else + \ifnum\columnlastcell>\columnmaxcells + \global\columnlastcell\columnmaxcells + \fi + \global\columnfreecells\columnlastcell + \global\advance\columnfreecells -\columnfirstcell + \global\advance\columnfreecells \plusone + \global\somefreecolumncellstrue + %\message{\number\columnfirstcell-\number\columnlastcell=\number\columnfreecells}% + \fi + \fi + \egroup} + +\def\OTRSETgetmaxfreecells#1#2% col start + {\let\columnmaxfreecells\!!zerocount + \let\columnfrmfreecells\!!zerocount + \pushmacro \columnmaxcells +\OTRSETsetcorrectnofcells\currentcolumnmaxcells % sets \scratchcounter +\edef\columnmaxcells{\the\scratchcounter}% + \scratchcounter\zerocount + \dostepwiserecurse{#2}\columnmaxcells\plusone + {\OTRSETdoifcellelse{#1}\recurselevel + {\ifnum\columnmaxfreecells<\scratchcounter + \edef\columnmaxfreecells{\the\scratchcounter}% + \let\columnfrmfreecells\recurselevel + \fi + \scratchcounter\zerocount} + {\advance\scratchcounter\plusone}}% + \popmacro\columnmaxcells} + +\long\def\OTRSETrecurseRL#1% + {\dostepwiserecurse\nofcolumns\plusone\minusone + {#1\hskip\OTRSETgetparameter\c!distance\recurselevel}} + +\def\OTRSETmakegridbox + {\ifcase\columndirection + \OTRSETdomakegridbox\plusone\nofcolumns\plusone + \else + \OTRSETdomakegridbox\nofcolumns\plusone\minusone + \fi} + +\def\OTRSETmakeupwidth{\makeupwidth} % temporary indirectness + +\def\OTRSETdomakegridbox#1#2#3% + {\hbox\bgroup + \dontcomplain + \forgetall % can go once in \flush + \!!heighta \textheight + % test first ! + \hbox to \OTRSETmakeupwidth + {\dostepwiserecurse{#1}{#2}{#3} + {\mofcolumns\recurselevel + \localcolumnwidth\OTRSETlocalwidth\mofcolumns + \setbox\scratchbox\hbox\localframed + [\??mc\OTRSETidentifier\number\mofcolumns]% + [\c!width=\localcolumnwidth,\c!height=\!!heighta,\c!lines=]% + {}% + \wd\scratchbox\localcolumnwidth + \ht\scratchbox\!!heighta + \ifcase\columndirection + \hskip\OTRSETgetparameter\c!distance\recurselevel + \box\scratchbox + \else + \box\scratchbox + \hskip\OTRSETgetparameter\c!distance\recurselevel + \fi}}% + \hskip-\OTRSETmakeupwidth + % main text + \hbox to \OTRSETmakeupwidth + {\dostepwiserecurse{#1}{#2}{#3} + {\mofcolumns\recurselevel + \localcolumnwidth\OTRSETlocalwidth\mofcolumns + \offinterlineskip + \setbox\scratchbox\vbox to \!!heighta + {\topskipcorrection % not needed + \ifcase\OTRSETbalancemethod + % no + \or + % yes + \doifelselayerdata{OTRTEXT}\vfill\relax % temp hack + \or + % top + \or + % bottom + \vfill + \fi + \dorecurse\columnmaxcells + {\setbox\scratchbox\hbox{\OTRSETgetgridcell\mofcolumns\recurselevel}% +% {\setbox\scratchbox\hbox +% {\localstarttextcolor +% \OTRSETgetgridcell\mofcolumns\recurselevel +% \localstoptextcolor}% + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \ifcase\columndirection + \box\scratchbox + \else + \hbox to \localcolumnwidth + {\hskip\localcolumnwidth\llap{\box\scratchbox}}% + \fi + \par}% + \ifcase\OTRSETbalancemethod + % no + \else + % yes, top, bottom + \ifdim\globalbodyfontsize=\localbodyfontsize + \removedepth + \restoreglobalbodyfont + \vskip\strutdepth + \fi + \kern\zeropoint + \vss + \fi}% + \wd\scratchbox\localcolumnwidth % \textwidth + \ifcase\columndirection + \hskip\OTRSETgetparameter\c!distance\recurselevel\box\scratchbox + \else + \box\scratchbox\hskip\OTRSETgetparameter\c!distance\recurselevel + \fi}}% + \egroup} + +\let\OTRSETbalht\zeropoint + +\def\OTRSETreducegridbox % for the moment no difference between methods + {\globallet\OTRSETbalht\zeropoint + \ifcase\OTRSETbalancemethod + % no balancing + \else + \bgroup + \!!counta\columnmaxcells + \donetrue + \doloop + {\dorecurse\nofcolumns{\OTRSETdoifcellelse\recurselevel\!!counta\donefalse\donothing}% + \ifdone + \ifnum\!!counta>\plusone\advance\!!counta\minusone\else\exitloop\fi + \else + \exitloop + \fi}% + \ifnum\!!counta>\plusone + \!!heighta\lineheight + \multiply\!!heighta \!!counta + \advance\!!heighta \topskip + \advance\!!heighta -\lineheight + \else + \!!heighta\zeropoint + \fi + \xdef\OTRSETbalht{\the\!!heighta}% + \egroup + \fi} + +\def\OTRSETflushfinalfootnotes + {\ifcase\lastcolumnlastcell \else + \setbox\scratchbox\hbox + {\placebottomnotes}% + \ifdim\ht\scratchbox>\zeropoint + \setbox\scratchbox\hbox + {\hbox to \zeropoint{\OTRSETgetgridcell\nofcolumns\lastcolumnlastcell}% + \box\scratchbox}% + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \OTRSETsetgridcell\nofcolumns\lastcolumnlastcell\box\scratchbox + \fi + \global\lastcolumnlastcell\zerocount + \fi} + +\def\OTRSETdoflush + {\ifcollectingcontent + \registerOTRSETmarks + \global\mofcolumns\plusone + \else + \OTRSETdofinalflush + \OTRSETdofinaloutput + \ifnum\columnsetpage>0 + \dorecurse\nofcolumns{\doresetcolumnsetlines\recurselevel}% + \fi + \doglobal\increment\columnsetpage + \OTRSETinitializecolumns + %\OTRSETdoflushfloats + \OTRSETstartnextpage +\presetOTRSETmarks + \initializecolumntextareas + \fi} + +\newbox\OTRfinalpagebox + +\def\OTRSETdofinalflush % see \OTRSETdoflush + {\OTRSETflushfinalfootnotes + \placecolumntextareas + \OTRSETcentergridcells + \bgroup % we want to keep the reduction local + \OTRSETreducegridbox + \global\setbox\OTRfinalpagebox\OTRSETmakegridbox + \egroup % otherwise we get the wrong number of free cells + %\gdef\localcolumnmaxcells{0}% here ? + \global\mofcolumns\nofcolumns} % otherwise problems in finaloutput + +% \def\OTRSETdofinaloutput +% {\ifdim\ht\OTRfinalpagebox=\teksthoogte +% % \bgroup \let\OTRSETsetvsize\relax % prevents useless search for gap +% \ifcase\OTRSETbalancemethod +% \finaloutput\box\OTRfinalpagebox +% \else\ifdim\OTRSETbalht>\zeropoint +% \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht +% {\box\OTRfinalpagebox}% +% \global\dp\OTRfinalpagebox\strutdepth +% \box\OTRfinalpagebox +% \else +% \finaloutput\box\OTRfinalpagebox +% \fi \fi +% \globallet\OTRSETbalht\zeropoint +% % \egroup +% \fi} + +\def\OTRSETdofinaloutput + {\ifdim\ht\OTRfinalpagebox=\textheight + \bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap + \ifcase\OTRSETbalancemethod + \finaloutput\box\OTRfinalpagebox + \else\ifdim\OTRSETbalht>\zeropoint + % catch a bordercase + \scratchdimen\OTRSETbalht + \advance\scratchdimen\lineheight\relax + \ifdim\scratchdimen>\textheight + % full page + \finaloutput\box\OTRfinalpagebox + \else + % same page + \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht + {\box\OTRfinalpagebox\vss}% + \setlayer[OTRTEXT]{\box\OTRfinalpagebox}% + \snaptogrid\vbox{\vskip\OTRSETbalht}% hack + \fi + \else + \finaloutput\box\OTRfinalpagebox + \fi \fi + \globallet\OTRSETbalht\zeropoint + \egroup + \fi} + +\definesystemvariable {mc} +\definesystemvariable {mt} +\definesystemconstant {colset} + +\definetwopasslist\s!colset + +\newdimen \OTRSETtextswidth +\newdimen \OTRSETtextsheight +\let \OTRSETidentifier=\empty + +\newtoks \OTRSEToutput + +\def\OTRSETgetparameter#1#2{\csname\??mc\OTRSETidentifier\number#2#1\endcsname} +\def\OTRSETsetparameter#1#2{\setvalue{\??mc\OTRSETidentifier\number#2#1}} + +\def\OTRSETskipstart + {\scratchcounter\executeifdefined{\??mc\OTRSETidentifier\c!start}\zerocount + \relax % needed ! + \ifcase\scratchcounter\else + \advance\scratchcounter\plusone + \doOTRSETsetgridcells + {\copy\placeholderboxe} + \plusone\plusone\nofcolumns\scratchcounter + \null + \fi} + +\def\OTRSETsetvsize % snap per sectie (gap here?) + {\ifcollectingcontent \else % can be assigndimen +\OTRSETskipstart % not that well tested + \OTRSETcheckinsert % added + \OTRSETsetfreecells\mofcolumns\columnfirstcell + \ifsomefreecolumncells + \global\vsize\columnfreecells\lineheight + \ifinotr % else problems with floats, see extreme + \global\pagegoal\vsize % niet nodig, tenzij binnen otr + \fi + \synchronizeoutput % fails on example + % \allowbreak % hm + \fi + \synchronizenotes + \fi} + +\def\OTRSETsethsize % of course this does not migrate outside the otr + {\localcolumnwidth\OTRSETlocalwidth\mofcolumns + \textwidth\localcolumnwidth + \hsize\localcolumnwidth} + +\def\OTRSETsynchronizehsize + {\ifcase0\getvalue{\??mc\??mc\c!width}\else % some width set + \bgroup + \scratchdimen\OTRSETlocalwidth\mofcolumns + \ifdim\scratchdimen=\textwidth + \egroup + \else + % only if change in width and \column/\break + \egroup \OTRSETsethsize + \fi + \fi} + +\def\OTRSETcheckfreelines + {\OTRSETsetvsize} + +\def\doOTRSETcolumnseparator + {\hbox to \zeropoint{\hss\red\vl\hss}} + +\let\OTRSETcolumnseparator\relax + +\def\showbreaks + {\let\OTRSETcolumnseparator\doOTRSETcolumnseparator} + +% \installcolumnbreakhandler {SET} \v!ja +% {% hmmm: +% \ifhmode +% \bgroup +% \removeunwantedspaces +% \parfillskip\zeropoint +% \OTRSETcolumnseparator +% \par +% \egroup +% \fi +% % brrr: +% \ejectinsert +% \ejectpage +% \OTRSETsynchronizehsize} % no \OTRSETsethsize, can be mid smaller (like tabulate) +% +% \installcolumnbreakhandler {SET} \v!forceer +% {\OTRSETgotocolumn[\v!forceer]} +% \installcolumnbreakhandler {SET} \v!eerste +% {\OTRSETgotocolumn[\v!eerste]} +% \installcolumnbreakhandler {SET} \v!laatste +% {\OTRSETgotocolumn[\v!laatste]} +% +% \installcolumnbreakhandler {SET} \v!pagina +% {\simplepagebreak % \flushnotes \executepagebreakhandler\v!ja +% \ifnum\mofcolumns>\plusone +% \OTRSETgotocolumn[\v!laatste,\v!forceer]% +% \fi} + +\def\OTRSETcolumnhbreak + {\ifhmode + \bgroup + \removeunwantedspaces + \parfillskip\zeropoint + \OTRSETcolumnseparator + \par + \egroup + \fi} + +\installcolumnbreakhandler {SET} \v!local + {\OTRSETcolumnhbreak + \ejectinsert + \ejectpage % brrr + % no \OTRSETsethsize, can be mid smaller (like tabulate) + % also, this one should be executed at the outer level + % (setting hsize inside otr does not work) + \OTRSETsynchronizehsize} + +% We need to make sure that we really leave the column; mid +% column we may end up in an empty gap, and we don't want to +% stay there (basically such a gap is a small empty page +% then). + +\installcolumnbreakhandler {SET} \v!yes + {\OTRSETcolumnhbreak + \edef\savedmofcolumns{\the\mofcolumns}% + \edef\savedrealpageno{\the\realpageno}% + \ejectinsert + \ejectpage % brrr + \doloop + {\ifnum\savedmofcolumns=\mofcolumns + \ifnum\savedrealpageno=\realpageno + \OTRSETdummycolumn + \else + \exitloop + \fi + \else + \exitloop + \fi}% + \OTRSETsynchronizehsize} + +\installcolumnbreakhandler {SET} \s!unknown + {\expanded{\OTRSETgotocolumn[\@@columnspecification]}} + +\installcolumnbreakhandler {SET} \v!page + {\vfill\eject % \doejectpage\eject + \OTRSETgotonextpage} + +\newtoks\OTRSETeverystartofcolumn + +\newbox\OTRSETsavedfootnotes + +% \installoutput\OTRSETflushtextsofar % spacing goes wrong + +%\def\OTRSETflushtextsofar +% {\ifvoid\normalpagebox \else +% \setbox\scratchbox\vbox{\unvbox\normalpagebox}% +% \OTRSETsavenotes +% \OTRSEThandleflushedtext0 +% \fi} + +% The complication is in the fact that when the HERE float +% is placed, the otr is not invoked when there is not yet +% enough content; this can lead to a change in order (turning +% on the tracer with option 0 is very instructive, watch the +% small numbers in the margin) +% +% 0 = no flushing, so no interference but user should handle +% border cases of placement +% 1 = the normal otr, rather untested +% 2 = a solution that works ok, is experimental and above +% all messy + +\chardef\OTRSETflushtextmode=0 + +\def\OTRSETflushtextsofar + {\ifcase\OTRSETflushtextmode + % don't mess around + \or + % the normal one + \ifvoid\normalpagebox\else + \OTRSETnaturalflush + \OTRSETcheckfreelines + \fi + \or + % way to complicated, but kind of ok + \doOTRSETflushtextsofar + \fi} + +\newskip\lastskipinotr + +\installoutput\doOTRSETflushtextsofar % experimental + {\ifvoid\normalpagebox\else + \scratchdimen\dp\normalpagebox + \setbox\scratchbox\vbox + {\forgetall + \unvbox\normalpagebox + \global\lastskipinotr\lastskip\relax + \ifdim\lastskipinotr>\zeropoint\relax + \removelastskip + \else + \kern-\scratchdimen % handle depth + \fi}% + \ifdim\lastskipinotr>\zeropoint + \scratchskip\ht\scratchbox + \setbox\scratchbox\hbox + {\lower\strutdepth\box\scratchbox}% + \dp\scratchbox\scratchdimen + \ht\scratchbox\scratchskip + \fi + \OTRSETsavenotes + \OTRSEThandleflushedtext\zerocount + \ifdim\lastskipinotr>\zeropoint + %\vskip \lastskipinotr % hm, gets lost anyway + \else + % we should not discard skips after here; tricky + \fi + \OTRSETsetvsize + \fi} + +\def\OTRSETplacebottomnotes + {\iflastcolumnfootnotes + \ifnum\nofcolumns=\mofcolumns + \ifintermediatefootnotes \placebottomnotes \fi + \fi + \else + \placebottomnotes + \fi} + +\def\OTRSETflushsavednotes + {\iflastcolumnfootnotes + \ifnum\nofcolumns=\mofcolumns + \flushsavednotes + \fi + \else + \flushsavednotes + \fi} + +\def\OTRSETsavenotes + {\iflastcolumnfootnotes + \ifnum\nofcolumns=\mofcolumns \else + \savenotes + \fi + \fi} + +\appendtoks \OTRSETflushsavednotes \to \OTRSETeverystartofcolumn + +\def\OTRSETnaturalflush + {\bgroup + \forgetall % new, needed ! + \setbox0\vbox to \columnfreecells\lineheight + {\vskip-\topskip + \vskip\lineheight + \prevdepth\strutdp + \unvbox\normalpagebox + \vfill}% + \setbox2\hbox + {\OTRSETplacebottomnotes}% + \setbox\scratchbox\hbox + {\wd0\zeropoint\box0\box2}% + \dp\scratchbox\strutdp + \OTRSEThandleflushedtext\plusone + \egroup} + +\newcount\lastcolumnlastcell + +\def\OTRSEThandleflushedtext#1% + {\getnoflines{\ht\scratchbox}% + %\wd\scratchbox\textwidth % geen \hsize kan < zijn in bv split tabulate + \wd\scratchbox\OTRSETlocalwidth\mofcolumns + \doOTRSETsetgridcells + {\copy\placeholderboxf} + \mofcolumns\columnfirstcell\plusone\noflines + {\registeredtextarea1\columnfirstcell\scratchbox}% == \hbox / tricky htcorr == \columnfirstcell + \global\columnlastcell\columnfirstcell + \global\advance\columnlastcell \noflines + \global\lastcolumnlastcell\columnlastcell + \global\advance\lastcolumnlastcell \minusone + % find next (acceptable) gap, todo: deadcycle + \ifcase#1\else + \OTRSETfillgapsbetweencells\mofcolumns\columnlastcell + \fi + \OTRSETfindnextgap + % \message{\the\mofcolumns,\the\columnfirstcell,\the\columnfreecells}% + % \wait + % we cannot adapt the hsize since it may have changed (like + % inside a tabulate) so we only change it when there is a + % reason to do so + \OTRSETsynchronizehsize + \OTRSETsetvsize} + +\def\OTRSETfindnextgap + {\OTRSETsetfreecells\mofcolumns\columnlastcell + \ifsomefreecolumncells + % okay + \bubbleOTRSETmarks % not robust because we reenter + \else + \registerOTRSETmarks % not robust because we reenter + \global\advance\mofcolumns \plusone + \ifnum\mofcolumns>\nofcolumns + \OTRSETdoflush + \global\columnlastcell\plusone + \global\columnfirstcell\zerocount + \OTRSETdoflushfloats + \else + \the\OTRSETeverystartofcolumn + \global\columnlastcell\plusone + \global\columnfirstcell\zerocount + \fi + \fi} + +\let\OTRSETcheckfreelines\donothing + +\def\OTRSETfillgapsbetweencells#1#2% col + {\ifnum\columngaplimit>\zerocount + \donefalse + \dostepwiserecurse{#2}\columnmaxcells\plusone + {\OTRSETdoifcellelse{#1}\recurselevel + {\ifdone + \!!countb\recurselevel \advance\!!countb -\!!counta\relax + \ifnum\!!countb>\plusone + \advance\!!countb \minusone + \ifnum\!!countb<\columngaplimit\relax + \!!countb\recurselevel \advance\!!countb \minusone + \dostepwiserecurse\!!counta\!!countb\plusone + {\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}% + %\message{[gap]}% + \fi + \fi + \fi + \donefalse} + {\ifdone \else + \donetrue + \!!counta\recurselevel + \fi}}% + \fi} + +\appendtoks + \OTRSETfillgapsbetweencells\mofcolumns\plusone +\to \OTRSETeverystartofcolumn + +%\def\OTRSETfreezeminimumgap#1% +% {\OTRSETgetmaxfreecells{#1}{1}% +% \ifnum\columnmaxfreecells>0 +% \!!countb=\columnfrmfreecells +% \!!counta=\!!counta \advance\!!counta -\columnmaxfreecells +% \dorecurse{\columnmaxcells} +% {\ifnum\recurselevel<\!!counta\relax +% \donetrue +% \else\ifnum\recurselevel>\!!countb +% \donetrue +% \else +% \donefalse +% \fi\fi +% \ifdone +% \OTRSETdoifcellelse{#1}{\recurselevel} +% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}% +% \fi}% +% \fi} +% +%\def\OTRSETfillgaps#1#2#3% col from to +% {\dostepwiserecurse{#2}{#3}{1} +% {\OTRSETdoifcellelse{#1}{\recurselevel} +% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}}} +% +%\def\OTRSETfillbotgaps#1#2% col first +% {\OTRSETfillgaps{#1}{#2}{\columnmaxcells}} +% +%\def\OTRSETfilltopgaps#1#2% col last +% {\OTRSETfillgaps{#1}{1}{#2}} + +\newif\ifspancolumnslots \spancolumnslotstrue +\newif\ifcheckcolumnspan \checkcolumnspantrue + +\def\OTRSETcheckwidthgap#1#2% box size + {\ifcheckcolumnspan + \bgroup + \scratchdimen#2% + \advance\scratchdimen-\wd#1\relax + \ifdim-10\scaledpoint>\scratchdimen + \egroup + \else\ifdim10\scaledpoint<\scratchdimen + \egroup + \else + \egroup + \wd#1=#2% + \fi\fi + \fi} + +\def\OTRSETcheckcolumnslot#1% + {\enoughcolumncellstrue + \ifspancolumnslots\else + \OTRSETcheckwidthgap#1\hsize + \ifdim\wd#1>\hsize + \enoughcolumncellsfalse + \fi + \fi + \ifenoughcolumncells + \getnoflines\pagetotal + \scratchcounter\noflines + \getnoflines{\ht#1}% + \columnvcells\noflines + \columnhcells\plusone + \advance\scratchcounter \columnvcells \relax + \ifnum\scratchcounter>\columnfreecells + \enoughcolumncellsfalse + \fi + \fi} + +\def\OTRSETstoreincolumnslotPAGE#1% + {\ifenoughcolumncells + % to do + \OTRSETsavebox{#1}% + \else + \OTRSETsavebox{#1}% + \fi} + +\def\OTRSETstoreincolumnslotTOPS#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETcheckcolumnslot{#1}% + \ifenoughcolumncells + \OTRSETcheckcolumnspace\mofcolumns\columnfirstcell{#1}% + \fi + \ifenoughcolumncells + \OTRSETsetgridcells\mofcolumns\columnfirstcell\columnhcells\columnvcells + {\hbox{\copy#1}}% + \OTRSETsetvsize + \else + \OTRSETsavebox{#1}% + \fi} + +\def\OTRSETstoreincolumnslotBOTS#1% + {\OTRSETprepareforcolumnslot3{#1}% + \edef\savedcolumnlastcell{\the\columnlastcell}% + \OTRSETcheckcolumnslot{#1}% + \ifenoughcolumncells + \advance\columnlastcell -\columnvcells \advance\columnlastcell \plusone +% \OTRSETcheckcolumnspace\mofcolumns\columnfirstcell{#1}% + \OTRSETcheckcolumnspace\mofcolumns\columnlastcell{#1}% + \fi + \ifenoughcolumncells + \OTRSETsetgridcells\mofcolumns\columnlastcell\columnhcells\columnvcells{\copy#1}% + \OTRSETfillgapsbetweencells\mofcolumns\savedcolumnlastcell % -) + \OTRSETsetvsize + \else + \columnlastcell\savedcolumnlastcell + \OTRSETsavebox{#1}% + \fi} + +\newdimen\totalcolumnspace + +\def\columnspacetopoffset{0} +\def\columnspacebotoffset{0} + +\def\OTRSETcheckcolumnspace#1#2#3% col row box + {\columnhcells\plusone + \totalcolumnspace\zeropoint + \scratchcounter#1% + \enoughcolumncellstrue + \doloop + {\advance\totalcolumnspace \OTRSETlocalwidth\scratchcounter\relax % needed +\OTRSETcheckwidthgap#3\totalcolumnspace + \ifnum\wd#3>\totalcolumnspace\relax + \ifnum\scratchcounter=\nofcolumns + \enoughcolumncellsfalse + \exitloop + \else + \advance\columnhcells \plusone + \advance\scratchcounter \plusone + \advance\totalcolumnspace \OTRSETgetparameter\c!distance\scratchcounter + \fi + \else + \exitloop + \fi}% + \ifenoughcolumncells + \getnoflines{\ht#3}% + \columnvcells\noflines + \OTRSETcheckcolumncells{#1}{#2}\columnhcells\columnvcells + \fi} + +\def\OTRSETcheckcolumncells#1#2#3#4% col row wid hei + {\!!countd#1\advance\!!countd#3\advance\!!countd\minusone + \!!counte#2\advance\!!counte#4\advance\!!counte\minusone + \ifnum\!!counte>\columnmaxcells\relax + \enoughcolumncellsfalse + \else + \enoughcolumncellstrue +%\let\columnspacetopoffset\zerocount +%\scratchcounter#2\advance\scratchcounter\minusone +%\ifnum\scratchcounter>0 +% \dostepwiserecurse{#1}\!!countd\plusone +% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint +% \let\columnspacetopoffset\plusone +% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint +% \let\columnspacetopoffset\plusone +% \fi\fi}% +% \advance\!!counte \columnspacetopoffset \relax +% \advance\columnvcells \columnspacetopoffset \relax +%\fi +%\let\columnspacebotoffset\zerocount +%\scratchcounter\!!counte +%\advance\scratchcounter \columnvcells \relax +%\ifnum\scratchcounter>\columnmaxcells\else +% \dostepwiserecurse{#1}\!!countd\plusone +% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint +% \let\columnspacebotoffset\plusone +% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint +% \let\columnspacebotoffset\plusone +% \fi\fi}% +% \advance\!!counte \columnspacebotoffset \relax +% \advance\columnvcells \columnspacebotoffset \relax +%\fi + \dostepwiserecurse{#1}\!!countd\plusone % cols + {\ifenoughcolumncells + \!!countf\recurselevel\relax + \dostepwiserecurse{#2}\!!counte\plusone % rows + {\ifenoughcolumncells + \OTRSETdoifcellelse\!!countf\recurselevel + {\enoughcolumncellsfalse}{}% + \fi}% + \fi}% + \fi} + +\def\OTRSETsetpreferedcolumnslot#1#2% + {\doifsomething{#1}{\edef\preferedcolumn{#1}}% + \doifsomething{#2}{\edef\preferedrow {#2}}} + +\OTRSETsetpreferedcolumnslot{\nofcolumns}{1} % default ? + +\let\pofcolumns\mofcolumns +\let\qofcolumns\mofcolumns + +\newif\ifquitincurrentcolumn + +\def\OTRSETstoreincolumnslotLRTB#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \mofcolumns\nofcolumns+\currenthcell + \plusone\columnmaxcells+\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotLRBT#1% + {\OTRSETprepareforcolumnslot3{#1}% + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \mofcolumns\nofcolumns+\currenthcell + \columnmaxcells\plusone-\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotRLTB#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETflushtextsofar + \OTRSETcheckprefered + \OTRSETstoreincolumnslotindeed + \nofcolumns\qofcolumns-\currenthcell + \plusone\columnmaxcells+\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotRLBT#1% + {\OTRSETprepareforcolumnslot3{#1}% + \OTRSETflushtextsofar + \OTRSETcheckprefered + \OTRSETstoreincolumnslotindeed + \nofcolumns\qofcolumns-\currenthcell + \columnmaxcells\plusone-\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotTBLR#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \plusone\columnmaxcells+\currentvcell + \mofcolumns\nofcolumns+\currenthcell{#1}} + +\def\OTRSETstoreincolumnslotTBRL#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETflushtextsofar + \OTRSETcheckprefered + \OTRSETstoreincolumnslotindeed + \plusone\columnmaxcells+\currentvcell + \nofcolumns\qofcolumns-\currenthcell{#1}} + +\def\OTRSETstoreincolumnslotBTLR#1% + {\OTRSETprepareforcolumnslot3{#1}% + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \columnmaxcells\plusone-\currentvcell + \mofcolumns\nofcolumns+\currenthcell{#1}} + +\def\OTRSETstoreincolumnslotBTRL#1% + {\OTRSETprepareforcolumnslot3{#1}% + \OTRSETflushtextsofar + \OTRSETcheckprefered + \OTRSETstoreincolumnslotindeed + \columnmaxcells\plusone-\currentvcell + \nofcolumns\qofcolumns-\currenthcell{#1}} + +\def\OTRSETstoreincolumnslotFXTB#1% fixed column + {\OTRSETcheckprefered + \OTRSETdoifcellelse\pofcolumns\plusone + {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot1}{#1}% % 1/2 dependent of place, todo + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \pofcolumns \pofcolumns +\currenthcell + \preferedrow\columnmaxcells+\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotFXBT#1% fixed column + {\OTRSETcheckprefered + \OTRSETdoifcellelse\pofcolumns\columnmaxcells + {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot3}{#1}% % 3/2 dependent of place, todo + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \pofcolumns \pofcolumns +\currenthcell + \columnmaxcells\preferedrow-\currentvcell{#1}} + +% \def\OTRSETstoreincolumnslotHERE#1% fixed column +% {\OTRSETprepareforcolumnslot2{#1}% +% \OTRSETflushtextsofar +% \getnoflines\pagetotal \advance\noflines\columnfirstcell +% \OTRSETstoreincolumnslotindeed +% \mofcolumns\mofcolumns+\currenthcell +% \noflines\columnmaxcells+\currentvcell{#1}% +% \OTRSETsetvsize} + +\chardef\OTRSETforcefixedfloats=0 + +\def\OTRSETstoreincolumnslotHERE#1% fixed column + {\ifcase\OTRSETforcefixedfloats + \OTRSETstoreincolumnslotSOMEWHERE2{#1}% + \else + \OTRSETstoreincolumnslotFIXD{#1}% + \fi} + +% this one looses too wide graphics +% +% \def\OTRSETstoreincolumnslotFIXD#1% fixed column +% {\OTRSETprepareforcolumnslot2{#1}% +% % no flush text sofar here, beware: no width test +% \snaptogrid\vbox{\box#1}} +% +% still imperfect + +\def\OTRSETstoreincolumnslotFIXD#1% fixed column + {\OTRSETflushtextsofar + \ifdim\wd#1>\textwidth + \OTRSETstoreincolumnslotSOMEWHERE2{#1}% + \else + % crappy test / needed for o-pbu-f / will be replaced + \getnoflines{\ht#1}% + \scratchdimen\noflines\lineheight + \advance\scratchdimen\lineheight + \advance\scratchdimen\pagetotal\relax + \ifdim\scratchdimen<\pagegoal + %OTRSETprepareforcolumnslot3{#1}% + %ruledvskip\columnslotspacing\lineheight + \blank[\columnslotspacing*\v!line]% + \snaptogrid\hbox to \hsize{\hss\box#1\hss}% strange, why the centering + \blank[\columnslotspacing*\v!line]% + \else + \OTRSETstoreincolumnslotSOMEWHERE2{#1}% + \fi + \fi} + +\def\OTRSETstoreincolumnslotSOMEWHERE#1#2% + {\OTRSETprepareforcolumnslot{#1}{#2}% + \OTRSETflushtextsofar + \getnoflines\pagetotal \advance\noflines\columnfirstcell + \OTRSETstoreincolumnslotindeed + \mofcolumns\mofcolumns+\currenthcell + \noflines\columnmaxcells+\currentvcell{#2}% + \OTRSETsetvsize} + +\def\OTRSETcheckprefered + {\ifnum\preferedcolumn<\mofcolumns + \let\pofcolumns\mofcolumns + \else + \let\pofcolumns\preferedcolumn + \fi + \ifquitincurrentcolumn + \ifnum\mofcolumns=\nofcolumns + \def\qofcolumns{\mofcolumns}% + \else + \scratchcounter\mofcolumns + \advance\scratchcounter \plusone + \edef\qofcolumns{\the\scratchcounter}% + \fi + \else + \let\qofcolumns\mofcolumns + \fi} + +\def\OTRSETstoreincolumnslotindeed#1#2#3#4#5#6#7#8#9% + {\OTRSETcheckprefered + \enoughcolumncellsfalse + \donefalse + \dostepwiserecurse{#1}{#2}{#31} + {\ifdone + \exitloop + \else + #4=\recurselevel + \dostepwiserecurse{#5}{#6}{#71} + {\ifdone + \exitloop + \else + #8=\recurselevel + \OTRSETcheckcolumnspace\currenthcell\currentvcell{#9}% + \ifenoughcolumncells \donetrue \fi + \fi}% + \fi}% + \ifdone + \enoughcolumncellstrue + \else + \enoughcolumncellsfalse + \fi + \ifenoughcolumncells +% \ifnum\columnspacetopoffset>0\message{[+++]}\fi +% \ifnum\columnspacebotoffset>0\message{[---]}\fi +% \OTRSETsetgridcells\currenthcell\currentvcell\columnhcells\columnvcells +% {\vbox +% {\ifcase\columnspacetopoffset\else\ruledvskip\columnspacetopoffset\lineheight\fi +% \copy#9 +% \ifcase\columnspacebotoffset\else\ruledvskip\columnspacebotoffset\lineheight\fi}}% + \OTRSETsetgridcells\currenthcell\currentvcell\columnhcells\columnvcells + {\copy#9}% + \ifnum\currenthcell=\mofcolumns\relax + \ifdim\ht\OTRSETsavedfootnotes>\zeropoint + \OTRSETsetfreecells\mofcolumns\columnfirstcell + \ifsomefreecolumncells + \getnoflines{\ht\OTRSETsavedfootnotes}\relax + \ifnum\columnfreecells<\noflines + \global\somefreecolumncellsfalse + \else + %\message{[flt]}% float + \fi + \fi + \ifsomefreecolumncells + % ok, enough room for notes + %\message{[flt]}% float + \else % ? + \OTRSETsavebox{#9}% + \OTRSETerasegridcells\currenthcell\currentvcell\columnhcells\columnvcells + %\message{[clr]}% save box + \fi + \else + %\message{[flt]}% float + \fi + \else + %\message{[flt]}% float + \fi + \OTRSETsetvsize + %\message{[fnt]}% float + \else + %\message{[rej]}% save box + \OTRSETsavebox{#9}% + \fi} + +\chardef\columnslotspacing \plusone + +\def\OTRSETstoreincolumnslot#1% #2 % {method} {box} % alleen last + {% no messing around here + % \dp#2=\zeropoint + % \ifcase\columnslotspacing\else + % \setbox#2=\vbox spread \columnslotspacing\lineheight + % {\vss\box#2\vss}% + % \fi + % and don't change this any more +% \doifdefinedelse{\strippedcsname\OTRSETstoreincolumnslot#1} +% {\getvalue{\strippedcsname\OTRSETstoreincolumnslot#1}{#2}} +% {\OTRSETstoreincolumnslotUNKNOWN{#2}}} + \executeifdefined{\strippedcsname\OTRSETstoreincolumnslot#1} + \OTRSETstoreincolumnslotUNKNOWN} % {#2}} + +\def\OTRSETstoreincolumnslotUNKNOWN#1% + {\OTRSETprepareforcolumnslot2{#1}\copy#1} % {} ? + +% \def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag +% {\dp#2\zeropoint +% \ifcase\columnslotspacing\else +% \scratchdimen\columnslotspacing\lineheight +% \ifnum#1=2 \scratchdimen2\scratchdimen \fi +% \setbox#2\vbox spread \scratchdimen +% {\ifnum#1>1\vss\fi\box#2\relax\ifnum#1<3\vss\fi}% +% \fi} + +\def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag + {\dp#2\zeropoint + \ifcase\columnslotspacing\else + \scratchdimen\columnslotspacing\lineheight + \ifnum#1=2 \scratchdimen2\scratchdimen \fi + \begingroup + \advance\scratchdimen\ht#2\relax + \ifdim\scratchdimen<\columnmaxcells\lineheight + \endgroup \setbox#2\vbox spread \scratchdimen \bgroup + \else + \endgroup \setbox#2\vbox to \columnmaxcells\lineheight \bgroup + \vskip\strutdepth + \fi + \ifnum#1>1\vss\fi + \box#2\relax + \ifnum#1<3\vss\fi + \egroup + \fi} + +\def\OTRSETdocheckiffloatfits % eigenlijk moet else float anders + {\global\ifnofloatpermitted\roomforfloatfalse\else\roomforfloattrue\fi} + +\def\OTRSETunpreparebox#1% + {\ifhbox#1% spans and so + \global\setbox\floatbox\vbox{\box#1}% + \else + \setbox\scratchbox\vbox + {\unvbox#1\unskip\unskip\unskip + \global\setbox\floatbox\lastbox}% + \fi} + +\def\OTRSETsavebox#1% clean up the skips + {\OTRSETunpreparebox{#1}% + \dosavefloat} + +\def\OTRSETresavebox#1% clean up the skips + {\OTRSETunpreparebox{#1}% + \doresavefloat} + +\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge + {\iftestfloatbox\ruledhbox\fi{\box\floatbox}} + +\def\OTRSETdoflushfloats + {\bgroup + \def\OTRSETsavebox##1{\!!doneafalse}% + \doloop + {\ifsomefloatwaiting +\OTRSETskipstart + \dogetfloat + \ifdim\wd\floatbox>\zeropoint + \!!doneatrue + \dp\floatbox\zeropoint + \OTRSETstoreincolumnslot{TBLR}\floatbox + \if!!donea + %\message{[flu]}% + \else + \OTRSETresavebox\floatbox + \exitloop + \fi + \else + %\message{[err]}% happens but why? + \fi + \else + \exitloop + \fi} + \egroup} + +\newif\ifcentergridcells \centergridcellstrue + +\newif\ifcentergridcellonly \centergridcellonlyfalse +\newif\ifautocentergridcellonly \autocentergridcellonlytrue + +\def\OTRSETcentergridcells + {\ifcentergridcells + \dorecurse\nofcolumns + {\currenthcell\recurselevel + \ifautocentergridcellonly + % we prevent centering when the next column is empty + % to be checked ! ! ! ! + \advance\currenthcell \plusone + \centergridcellonlytrue + \ifnum\currenthcell>\nofcolumns + % ok already + \else + % only span if there is a next column with content + \dorecurse\columnmaxcells + {\ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint + \centergridcellonlyfalse + \else\ifdim\dp\OTRSETgridcell\currenthcell\currentvcell>\zeropoint + \centergridcellonlyfalse + \fi\fi}% + \fi + \fi + \currenthcell\recurselevel + \dorecurse\columnmaxcells + {\currentvcell\recurselevel\relax + \ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint + \ifdim\dp\OTRSETgridcell\currenthcell\currentvcell=\zeropoint + \bgroup + \setbox\scratchbox\OTRSETgetgridcell\currenthcell\currentvcell + \getnoflines{\ht\scratchbox}% + \!!counta\currentvcell + \advance\!!counta -\noflines + \advance\!!counta \plusone + % first col always ok + \!!countb\currenthcell + \!!countc\currenthcell + \advance\!!countc \plusone + \!!donebtrue + \ifcentergridcellonly + \!!countc\maxdimen + \fi + \dostepwiserecurse\!!countc\nofcolumns\plusone + {\if!!doneb + \let\xrecurselevel\recurselevel + \dostepwiserecurse\!!counta\currentvcell\plusone + {\ifdim\ht\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint + \!!donebfalse + \else\ifdim\wd\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint + \!!donebfalse + \fi\fi}% + \if!!doneb + \!!countb\xrecurselevel + \fi + \fi}% + \totalcolumnspace\OTRSETlocalwidth\currenthcell + \dostepwiserecurse\!!countc\!!countb\plusone + {\advance\totalcolumnspace \OTRSETlocalwidth\recurselevel + \advance\totalcolumnspace \OTRSETgetparameter\c!distance\recurselevel}% + \ifdim\totalcolumnspace>\wd\scratchbox + \setbox\scratchbox\hbox to \totalcolumnspace{\hss\box\scratchbox\hss}% + \fi + \OTRSETsetgridcell\currenthcell\currentvcell\box\scratchbox + \egroup + \fi + \fi}}% + \fi} + +\def\OTRSETinitializecolumns% once per page + {\columnspreadtrue % todo + \ifcolumnspread + \global\rofcolumns\getvalue{\??mc\OTRSETidentifier\c!nright}% + \global\lofcolumns\getvalue{\??mc\OTRSETidentifier\c!nleft}% + \global\tofcolumns\rofcolumns \relax + \ifodd\realpageno\relax + \global\nofcolumns\rofcolumns + \else + \global\advance\tofcolumns\lofcolumns + \global\nofcolumns\lofcolumns + \fi + \else + \global\nofcolumns\getvalue{\??mc\OTRSETidentifier\c!n}% + \global\rofcolumns\nofcolumns + \global\lofcolumns\nofcolumns + \global\tofcolumns\nofcolumns + \fi + \OTRSETassignwidths + \global\mofcolumns\plusone + \columnerasegridboxes} + +% vanaf hier: + +\def\definecolumnset + {\dodoubleargument\dodefinecolumnset} + +\def\dodefinecolumnset[#1][#2]% + {\getparameters[\??mc#1] + [\c!direction=\v!right, + \c!balance=\v!no, + \c!distance=1.5\bodyfontsize, % controleren + \c!n=2, + \c!nleft=\getvalue{\??mc#1\c!n}, + \c!nright=\getvalue{\??mc#1\c!n}, + \c!width=\v!fit, + \c!lines=0, + \c!start=0, + #2]% + \dorecurse{\getvalue{\??mc#1\c!nleft}} % todo + {\dododefinecolumnset[#1][\recurselevel]}% + \dorecurse{\getvalue{\??mc#1\c!nright}} % todo + {\dododefinecolumnset[#1][\recurselevel]}% + % redo framed settings + \setupcolumnset[#1][1][\c!distance=\!!zeropoint]} + +\def\dododefinecolumnset[#1][#2]% + {\presetlocalframed + [\??mc#1#2]% + \setupcolumnset + [#1][#2] + [\c!offset=\v!overlay, + \c!frame=\v!off, + \c!align=, + \c!lines=0,% really needed since c!regels is now part of framed + \c!width=\getvalue{\??mc#1\c!width}, + \c!distance=\getvalue{\??mc#1\c!distance}]} + +\def\setupcolumnset + {\dotripleargument\dosetupcolumnset} + +\def\dosetupcolumnset[#1][#2][#3]% + {\ifthirdargument + \def\docommand##1% + {\doifelse{##1}\v!each + {\dorecurse{\getvalue{\??mc#1\c!n}}{\docommand\recurselevel}} + {\getparameters[\??mc#1##1][#3]}}% + \processcommalist[#2]\docommand + \else + \getparameters[\??mc#1][#2]% + \fi} + +\definecolumnset[\s!default][\c!n=2] % fallback + +\def\OTRSETgotonextpage + {\vfill\eject + \relax\ifnum\mofcolumns>\plusone + \OTRSETgotocolumn[\v!last]% + \ifnum\mofcolumns>\plusone + \OTRSETgotocolumn[\v!force]% + \fi + \fi} + +\let\OTRSETgotonextpageX\OTRSETgotonextpage % will become obsolete + +\def\OTRSETgotocolumn + {\dosingleempty\doOTRSETgotocolumn} + +\def\doOTRSETgotoCOLROW#1% |* + {\bgroup % really needed + \splitstring#1\at*\to\column\and\row + \bgroup + \ifx\column\empty\else\expanded{\doOTRSETgotoCOLUMN{\column}}\fi + \egroup + \bgroup + \ifx\row \empty\else\expanded{\doOTRSETgotoROW {\row }}\fi + \egroup + \egroup} + +\def\doOTRSETgotoCOLUMN#1% + {\ifnum\mofcolumns=#1\else + \vfill\eject % \doejectpage\eject + \doloop + {\ifnum\mofcolumns=#1\relax + \exitloop \else \OTRSETdummycolumn + \fi}% + \fi} + +\def\doOTRSETgotoROW#1% + {\ifnum#1>1 + \scratchcounter\zerocount + \currenthcell\mofcolumns + \currentvcell#1\advance\currentvcell \minusone + \dorecurse\currentvcell + {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing + {\advance\scratchcounter\plusone}} + \getnoflines\pagetotal + \advance\scratchcounter-\noflines + \ifnum\scratchcounter>\zerocount + \dorecurse\scratchcounter{\line{\strut}}% + \fi + \fi + \OTRSETsetvsize} + +\def\doOTRSETgotocolumn[#1]% yes|force|first|last||* + {\processallactionsinset + [#1] + [ \v!yes=>\OTRSETdummycolumn, + \v!no=>,% not supported + \v!force=>\OTRSETdummycolumn, + \v!first=>\expanded{\doOTRSETgotoCOLUMN{1}}, + \v!last=>\expanded{\doOTRSETgotoCOLUMN{\the\nofcolumns}}, + \s!default=>\OTRSETdummycolumn, + \s!unknown=>\expanded{\doOTRSETgotoCOLROW{\commalistelement}}]} + +% to be documented and tested, not yet that robust + +% \def\OTRSETgotocell#1#2% +% {\endgraf +% \gdef\gotocellcounter{0}% +% \doloop +% {\ifnum\mofcolumns<#1\relax +% \doglobal\increment\gotocellcounter\relax +% \ifnum\gotocellcounter>#1\relax +% \line{\strut}\crlf +% \line{\strut}\crlf +% \column +% \writestatus{columnset}{quitting goto cell}% +% \exitloop +% \else +% \column +% \fi +% \else +% \exitloop +% \fi}% +% \ifnum\mofcolumns=#1\relax +% \ifnum#2>1 +% \scratchcounter\zerocount +% \currenthcell\mofcolumns +% \currentvcell#2\advance\currentvcell \minusone +% \dorecurse\currentvcell +% {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing +% {\advance\scratchcounter\plusone}} +% \getnoflines\pagetotal +% \advance\scratchcounter-\noflines +% \ifnum\scratchcounter>\zerocount +% \dorecurse\scratchcounter{\line{\strut}}% +% \fi +% \fi +% \fi +% \OTRSETsetvsize} + +\def\OTRSETgotocell#1#2% obsolete: now \column[#1*#2] + {\endgraf + \doOTRSETgotoCOLUMN{#1}% + \doOTRSETgotoROW {#2}} + +\def\OTRSETdummycolumn + {\verticalstrut + \vskip-\struttotal + \vfill + \eject} + +\newcounter\columnsetlevel +\let\currentcolumnset\empty +\chardef\OTRSETfinish\zerocount + +\def\startcolumnset + {\dodoubleempty\dostartcolumnset} + +\def\dostartcolumnset[#1][#2]% + {\increment\columnsetlevel\relax + \globallet\localcolumnmaxcells\!!zerocount + \global\chardef\OTRSETfinish\zerocount + \resetOTRSETmarks + \ifnum\columnsetlevel=\plusone + \bgroup + \saveinterlinespace + \globallet\columnsetpage\!!plusone + \def\currentcolumnset{#2}% + \insidecolumnstrue % will be different flag in addition + \activateotr{SET}{ONE}% andere naam, activate or so + \doifelsenothing{#1} + {\globallet\OTRSETlist\s!default} + {\xdef\OTRSETlist{#1}}% + \OTRSETstartnextpage + \OTRSETassignwidths + \OTRSETsethsize + \else + \bgroup + \fi} + +% \setuplayout[grid=yes] \definecolumnset[example] \showgrid + +% \starttext +% \startcolumnset[example] +% \input knuth \endgraf \input knuth +% \placetable{table}{\framed[width=\makeupwidth,height=4cm]{Hello}} +% \input knuth \endgraf \input knuth +% \stopcolumnset +% \input knuth \endgraf \input knuth +% \stoptext + + +\def\OTRSETflushleftovers % new per 13/4/2006 + {\OTRSETdoifcellelse{1}{1} + {\bgroup + \OTRSETcentergridcells + \chardef\OTRSETbalancemethod\plusone + \OTRSETreducegridbox + \global\setbox\OTRfinalpagebox\OTRSETmakegridbox + \global\ht\OTRfinalpagebox\textheight % signals output that there is content + \OTRSETdofinaloutput + \globallet\OTRSETbalht\zeropoint + \egroup} + {}} + +\def\stopcolumnset + {\relax + \ifnum\columnsetlevel=\plusone + \endgraf % needed, else wrong vsize in one par case + \global\chardef\OTRSETfinish\plusone + % no, extra page \pagebreak % (test on pascal toc) + \dostopcolumnset + \egroup + \global\notelimittrue % brrr, untested and fuzzy + \setvsize + \sethsize + \ifvoid\OTRfinalpagebox\else + % probably balanced + \ifdim\ht\OTRfinalpagebox<\textheight + \snaptogrid[\v!page]\hbox{\box\OTRfinalpagebox}% + \else + \box\OTRfinalpagebox + \fi + \fi + \global\chardef\OTRSETfinish\zerocount + \ifsomefloatwaiting \setvsize \pagebreak \setvsize \fi + \OTRSETflushleftovers + \else + \egroup + \fi + \decrement\columnsetlevel\relax} + +\chardef\OTRSETbalancemethod\zerocount + +\def\dostopcolumnset + {%\OTRSETdofinalflushfloats % yes/no + \ifcase\OTRSETbalancemethod + \OTRSETnobalance + \else + \OTRSETdobalance + \fi} + +\def\OTRSETdobalance + {\OTRSETnobalance} + +\def\localcolumnmaxcells{0} + +% currently line represents real line, i.e. on the grid, and +% not something noflines (also, watch out for switching from +% 2-3 columns on one page with both sets balanced: the +% second set does not see the first set + +% \def\OTRSETinitbalancing +% {\ifcase\OTRSETbalancemethod\or +% \let\savedcolumnmaxcells\columnmaxcells +% \ifnum\realpageno=\balancingpageno\relax +% \ifnum\mofcolumns=\plusone +% \dorecurse\nofcolumns +% {\!!counta\recurselevel\relax +% \!!countb\getvalue{\??mc\OTRSETidentifier\number\!!counta\c!regels}\relax +% \ifcase\!!countb +% \!!countb\getvalue{\??mc\OTRSETidentifier\c!regels}\relax +% \fi +% \ifcase\!!countb +% \!!countb \savedcolumnmaxcells\relax +% \fi +% % can be an option: absolute versus relative +% \ifnum\OTRSETbalancemethod=\plusthree +% \advance\!!countb\precolumnlines +% \ifnum\!!countb>\localcolumnmaxcells\relax +% \xdef\localcolumnmaxcells{\the\!!countb}% +% \fi +% \advance\!!countb \plusone +% \dostepwiserecurse\!!countb\columnmaxcells\plusone +% {\ifvoid\OTRSETgridcell\!!counta\recurselevel +% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe +% \fi}% +% \else +% \globallet\localcolumnmaxcells\columnmaxcells +% \advance\!!countb-\columnmaxcells +% \!!countb-\!!countb +% \advance\!!countb \minusone +% \ifnum\!!countb>\zerocount +% \dostepwiserecurse\plusone\!!countb\plusone +% {\ifvoid\OTRSETgridcell\!!counta\recurselevel +% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe +% \fi}% +% \fi +% \fi}% +% \OTRSETsetvsize % ! ! ! +% \fi +% \fi +% \fi} +% +% \def\OTRSETpresetbalancing +% {\doifvaluesomething{\??mc\OTRSETidentifier\c!regels}% +% {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]% +% \ifnum\commalistsize>\plusone +% \scratchcounter\zerocount +% \def\docommand##1% +% {\advance\scratchcounter\plusone +% \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}% +% \processcommacommand +% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommand +% \setvalue{\??mc\OTRSETidentifier\c!regels}{0}% +% \fi}} + +% don't loose empty 1page/1column with area (example **) +% +% \definecolumntextarea[title][x=1,y=4,nx=2,ny=7,state=start] +% \setupcolumntextareatext[title][\vtop to 5cm{a\\b\\b\\d}] +% +% \starttext +% \startcolumnset \dorecurse{1}{\input tufte \par} \stopcolumnset +% \stoptext + +% better: + +\def\definecolumnsetarea {\definecolumntextarea} +\def\setupcolumnsetarea {\setupcolumntextarea} +\def\setupcolumnsetareatext{\setupcolumntextareatext} + +% so this will be changed + +% \def\OTRSETnobalance +% {\iflastcolumnfootnotes % testen ! optie +% % inhibit flush of floats ! +% % todo: nothing if no footnotes, else empty page +% \dostepwiserecurse\mofcolumns\nofcolumns\plusone +% {\vskip-\struttotal\verticalstrut\vfill\eject}% +% \else +% \ifdim\pagetotal>\zeropoint % no, see example ** +% \ifnum\mofcolumns=\nofcolumns +% \OTRSETflushfinalfootnotes +% \else +% % probably todo +% \fi +% \vfill +% \eject +% % brr, may result in empty page after nicely fit text +% % or if left, then lost of first column only text +% \ifnum\mofcolumns>1 +% \OTRSETdofinalflush +% \OTRSETdofinaloutput +% \fi +% \fi +% \fi} + +\def\OTRSETnobalance + {\iflastcolumnfootnotes % testen ! optie + % inhibit flush of floats ! + % todo: nothing if no footnotes, else empty page + \dostepwiserecurse\mofcolumns\nofcolumns\plusone + {\vskip-\struttotal\verticalstrut\vfill\eject}% + \else + \ifnum\mofcolumns>\plusone + \donetrue + \else\ifdim\pagetotal>\zeropoint % too dangerous, we loose data + \donetrue + \else + \donefalse + \fi\fi + \ifdone + \ifnum\mofcolumns=\nofcolumns + \OTRSETflushfinalfootnotes + \else + % probably todo + \fi + \vfill + \eject +\registerOTRSETmarks + % brr, may result in empty page after nicely fit text + % or if left, then lost of first column only text + \ifnum\mofcolumns>\plusone + \OTRSETdofinalflush + \OTRSETdofinaloutput + \fi + \fi + \fi} + +\def\OTRSETstartnextpage + {\doifsomething\OTRSETlist + {\getfromcommacommand[\OTRSETlist][1]% + \global\let\OTRSETidentifier\commalistelement + \doifundefined{\??mc\OTRSETidentifier\c!n} + {\globallet\OTRSETidentifier\s!default}% + \let\newcommalistelement\empty + \doglobal\replaceincommalist\OTRSETlist1% + \OTRSETrestart}} + +\def\OTRSETrestart % weed + {\OTRSETinitializefeatures + \OTRSETflushpreposttext + \OTRSETinitializecolumns + \OTRSETcheckinsert + \OTRSETcheckgrid + \OTRSETsetvsize + \OTRSETsethsize % or local ? + \OTRSETsetplaceholders + \OTRSEThandlepreposttext + \initializecolumntextareas % name ! + \OTRSETcheckstartcells + \OTRSETsetvsize} + +% \def\OTRSETcheckstartcells +% {\dorecurse\nofcolumns +% {\bgroup +% \mofcolumns\recurselevel +% \scratchcounter\currentcolumnstartcell % uses \mofcolumns, returns 1 or more +% \advance\scratchcounter \minusone +% \dorecurse\scratchcounter +% {\OTRSETdoifcellelse\mofcolumns\recurselevel +% \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}% +% \egroup}} + +\def\OTRSETcheckstartcells + {\dorecurse\nofcolumns + {\bgroup + \mofcolumns\recurselevel +\OTRSETsetcorrectnofcells\currentcolumnstartcell +\advance\scratchcounter \minusone + \dorecurse\scratchcounter + {\OTRSETdoifcellelse\mofcolumns\recurselevel + \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}% + \egroup}} + +% \OTRSEToutput +% {\dontcomplain % new, get rid of overfull message (to be sorted out) +% \OTRSETnaturalflush +% %\OTRSETstartnextpage +% \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) +% \OTRSETcheckfreelines +% \OTRSETchecksidefloat} + +\OTRSEToutput + {\dontcomplain % new, get rid of overfull message (to be sorted out) + \doloop + {\OTRSETnaturalflush + %\OTRSETstartnextpage % no + \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) + \OTRSETcheckfreelines + \ifsomefreecolumncells + \exitloop + \else + % flush page and get rid of more floats if present + \fi}% + \OTRSETchecksidefloat} + +\def\OTRSETinitializefeatures + {% number of lines + % new: raw + \getrawnoflines\textheight\xdef\columnmaxcells{\the\noflines}% + % direction + \doifelsevalue{\??mc\OTRSETidentifier\c!direction}\v!right + {\chardef\columndirection\zerocount} + {\chardef\columndirection\plusone}% + % balancing + \chardef\OTRSETbalancemethod\zerocount + \processaction + [\getvalue{\??mc\OTRSETidentifier\c!balance}] + [ \v!yes=>\chardef\OTRSETbalancemethod\plusone, + \v!top=>\chardef\OTRSETbalancemethod\plustwo, + \v!bottom=>\chardef\OTRSETbalancemethod\plusthree]} + +% keep 'm for a while +% +% \installoutput\OTRSETflushpreposttext +% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}% +% \ifcarryoverfootnotes \else +% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% +% \fi} +% +% to be tested on 'boekinhoud' in 'pascal/demo-bbi' +% +% junk ! ! ! ! ! +% +%\installoutput\OTRSETflushpreposttext +% {\global\setbox\precolumnbox\vbox +% {\unvbox\normalpagebox +% \strut\vskip-2\lineheight\strut}% we want a proper depth +% \ifcarryoverfootnotes \else +% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% +% \fi} +% +% \starttext +% \definecolumnset[two][n=2] +% \startcolumnset[two] \dorecurse{4}{\input tufte } \stopcolumnset +% \input tufte +% \startcolumnset[two] \input tufte \stopcolumnset +% \stoptext +% +% \installoutput\OTRSETflushpreposttext +% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}% +% \global\dp\precolumnbox\strutdepth +% \ifcarryoverfootnotes \else +% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% +% \fi} + +% test: +% +% \definecolumnset[two] [n=2,balance=yes] +% \definecolumnset[three][n=3,balance=yes] +% \setupcolumnset [two] [1] [lines=10] +% \setupcolumnset [two] [2] [lines=10] +% +% \startcolumnset[two] \dorecurse{14}{\input tufte \par} \stopcolumnset +% \startcolumnset[three] \dorecurse{12}{\input tufte \par} \stopcolumnset +% +% with: +% +% \installoutput\OTRSETflushpreposttext +% {%\ifvoid\normalpagebox +% % \global\setbox\precolumnbox\vbox{}% +% %\else +% \global\setbox\precolumnbox\vbox +% {\unvcopy\normalpagebox}% +% \global\setbox\precolumnbox\vbox to \ht\precolumnbox +% {\box\normalpagebox}% +% %\fi +% \global\dp\precolumnbox\strutdepth +% \ifcarryoverfootnotes \else +% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% +% \fi} + +% testcase : pascal demo-bbi, paragraaf/aanduiding koppen + +\ifx\lastskipinotr\undefined \newskip\lastskipinotr \fi + +\installoutput\OTRSETflushpreposttext + {\global\setbox\precolumnbox\vbox + {\unvbox\normalpagebox + \global\lastskipinotr\lastskip}% + \ifdim\lastskipinotr>\zeropoint + \global\setbox\precolumnbox\hbox + {\lower\strutdepth\box\precolumnbox}% + \fi + \global\dp\precolumnbox\strutdepth + \ifcarryoverfootnotes \else + \global\setbox\postcolumnbox\vbox{\placebottomnotes}% + \fi} + +\let\precolumnlines \!!zerocount +\let\postcolumnlines\!!zerocount + +% \def\OTRSEThandlepreposttext +% {\ifdim\ht\precolumnbox>\zeropoint % new +% \getnoflines{\ht\precolumnbox}% +% \edef\precolumnlines{\the\noflines}% +% \doOTRSETsetgridcells +% {\copy\placeholderboxe} +% \plusone\plusone\nofcolumns\noflines +% {\box\precolumnbox}% +% \else +% \let\precolumnlines\!!zerocount +% \fi +% \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line +% \getnoflines{\ht\postcolumnbox}% +% \edef\postcolumnlines{\the\noflines}% +% \advance\columnfreecells -\noflines +% \advance\columnfreecells \plusone +% \doOTRSETsetgridcells +% {\copy\placeholderboxe} +% \plusone\columnfreecells\nofcolumns\noflines +% {\box\postcolumnbox}% +% \else +% \let\postcolumnlines\!!zerocount +% \fi} + +\def\OTRSEThandlepreposttext + {\ifdim\ht\precolumnbox>\zeropoint % new + \getnoflines{\ht\precolumnbox}% + \edef\precolumnlines{\the\noflines}% + \doOTRSETsetgridcells + {\copy\placeholderboxe} + \plusone\plusone\nofcolumns\noflines + % normal version (single column set) + % {\box\precolumnbox}% + % compensated for bodyfont change + {\hbox + {\OTRSETsetcorrectcellht + \raise\scratchdimen\box\precolumnbox}}% + \else + \let\precolumnlines\!!zerocount + \fi + \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line + \getnoflines{\ht\postcolumnbox}% + \edef\postcolumnlines{\the\noflines}% + \advance\columnfreecells -\noflines + \advance\columnfreecells \plusone + \doOTRSETsetgridcells + {\copy\placeholderboxe} + \plusone\columnfreecells\nofcolumns\noflines + {\box\postcolumnbox}% + \else + \let\postcolumnlines\!!zerocount + \fi} + +\def\OTRSETchecksidefloat + {} % {\sidefloatoutput} + +\def\OTRSETfinalsidefloatoutput + {} + +\def\OTRSETcheckgrid + {\topskip1\topskip + \ifforcecolumngrid + \widowpenalty\zerocount + \clubpenalty\zerocount + \brokenpenalty\zerocount + \fi} + +\def\OTRSETcheckinsert + {\iflastcolumnfootnotes + \ifnum\nofcolumns=\mofcolumns + \OTRSETforceinserts + \else + \OTRSETinhibitinserts + \fi + \else + \OTRSETforceinserts + \fi} + +\def\OTRSETforceinserts + {\enablenotes} + +\def\OTRSETinhibitinserts + {\disablenotes} + +% interface to footnotes + +\def\OTRSETassignwidths + {%\scratchdimen\makeupwidth + \freezetextwidth \scratchdimen\textwidth + % + \scratchcounter\zerocount + \dorecurse\nofcolumns + {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit + {\advance\scratchcounter \plusone } + {\advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}% + \advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!distance}}% + \ifcase\scratchcounter\else + \divide\scratchdimen \scratchcounter + \fi + \setgvalue{\??mc\??mc\c!width}{0}% + \dorecurse\nofcolumns + {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit + {\dimen0=\scratchdimen} + {\setgvalue{\??mc\??mc\c!width}{1}% + \dimen0=\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}% + \setxvalue{\??mc\recurselevel\??mc\c!width}{\the\dimen0}}} + +\def\OTRSETlocalwidth#1% + {\getvalue{\??mc\number#1\??mc\c!width}} + +\newbox\placeholderboxa +\newbox\placeholderboxb +\newbox\placeholderboxc +\newbox\placeholderboxd +\newbox\placeholderboxe +\newbox\placeholderboxf + +\def\columnplaceholder#1#2% + {\hbox + {\localcolortrue + \setbox\scratchbox\hbox to \hsize + {\iftracecolumnset \incolortrue \localcolortrue + \hskip-.5ex% + \startcolor[columnset:#2]\vrule\!!width1ex\!!height.5ex\!!depth.5ex\stopcolor + \fi + \hss}% + \ifcase#1\relax + \ht\scratchbox\zeropoint + \dp\scratchbox\zeropoint + \wd\scratchbox\zeropoint + \else + \wd\scratchbox\hsize + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \fi + \box\scratchbox}} + +\definepalet + [columnset] + [a=cyan,b=green,c=blue,d=red,e=magenta,f=darkgray] + +\def\OTRSETsetplaceholders + {\global\setbox\placeholderboxa\columnplaceholder0a% + \global\setbox\placeholderboxb\columnplaceholder0b% + \global\setbox\placeholderboxc\columnplaceholder0c% + \global\setbox\placeholderboxd\columnplaceholder0d% + \global\setbox\placeholderboxe\columnplaceholder0e% + \global\setbox\placeholderboxf\columnplaceholder1f} + +\def\doOTRSETshowstatus + {\llap{\incolortrue \localcolortrue \tt\tfxx + \startcolor[blue](\the\vsize->\number\columnfirstcell\#\number\columnfreecells)\stopcolor + \hskip\leftskip}} + +\def\OTRSETshowstatus + {\iftracecolumnset \doOTRSETshowstatus \fi} + +% \appendtoks \OTRSETshowstatus \to \everypar + +% page contents + +\def\OTRSETdopagecontents#1#2% takes two args: \box \unvbox + {\vbox to \textheight{\forgetall#1#2\pushproperties}} + +\def\OTRSETsomepagefloat {\def\floatmethod{PAGE}\OTRSETsomeslotfloat} % check +\def\OTRSETsomeherefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check +\def\OTRSETsomeelsefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check +\def\OTRSETsomefixdfloat {\def\floatmethod{FIXD}\OTRSETsomeslotfloat} % check +\def\OTRSETsometopfloat {\def\floatmethod{TOPS}\OTRSETsomeslotfloat} % check +\def\OTRSETsomebottomfloat{\def\floatmethod{BOTS}\OTRSETsomeslotfloat} % check + +\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge + {\iftestfloatbox\ruledhbox\fi{\box\floatbox}} + +\def\OTRSETsomeslotfloat[#1]% + {\setbox\floatbox\vbox{\flushfloatbox}% + \dp\floatbox\strutdp + \@EA\uppercasestring\floatmethod\to\floatmethod + \OTRSETstoreincolumnslot\floatmethod\floatbox + \doinsertfloatinfo} + +% kind of new, looks much like OTRONE, but not entirely + +\def\OTRSETdosettopinserts + {\bgroup + \ifsomefloatwaiting + \noffloatinserts\zerocount + \let\totaltopinserted\!!zeropoint + \OTRSETdodosettopinserts + \ifnum\@@bknbottom=\zerocount + \ifnum\@@bknlines>\zerocount + \ifdim\totaltopinserted>\zeropoint\relax + \dimen0\lineheight + \dimen0=\@@bknlines\dimen0 + \advance\dimen0 \totaltopinserted\relax + \ifdim\dimen0>\textheight % \vsize %%%%%%%%% \textheight + \showmessage\m!floatblocks8{\@@bknlines}% + \vfilll\eject + \fi + \fi + \fi + \fi + \fi + \egroup} + +\def\OTRSETdodosettopinserts + {\ifnum\noffloatinserts<\noftopfloats + \dogetfloat + \ifdim\topinserted=\zeropoint\relax + \topofinserttrue + \else + \topofinsertfalse + \fi + \setbox\scratchbox\vbox % kan beter ! + {\forgetall + \iftopofinsert + \ifdim\OTRSETtopoffset=\zeropoint + \moveongrid[\v!top] + \fi + \else + \betweenfloatblanko % inserts can't look back + \fi + \flushfloatbox + \blank[\@@bkspaceafter]}% + \global\advance\topinserted \ht\scratchbox\relax + \ifdim\topinserted>\vsize % was \textheight\relax + \OTRSETresavebox\floatbox + \noffloatinserts\noftopfloats\relax + \global\advance\topinserted -\ht\scratchbox + \let\OTRSETdodosettopinserts\relax % to be tested + \else + \xdef\totaltopinserted{\the\topinserted}% + \insert\topins{\forgetall\box\scratchbox}% interlineskip ? + \ifsomefloatwaiting + \advance\noffloatinserts \plusone + \else + \noffloatinserts\noftopfloats\relax + \fi + \dofloatflushedinfo + \fi + \else + \ifsomefloatwaiting + \showmessage\m!floatblocks6{\the\noftopfloats}% + \fi + \let\OTRSETdodosettopinserts\relax + \fi + \OTRSETdodosettopinserts} + +\def\OTRSETdosetbotinserts + {\bgroup + \ifsomefloatwaiting + \noffloatinserts\zerocount + \OTRSETdodosetbotinserts + \fi + \egroup} + +\def\OTRSETdodosetbotinserts + {\ifnum\noffloatinserts<\nofbotfloats\relax + \dogetfloat + \global\advance\botinserted \ht\floatbox\relax + \global\advance\botinserted \dp\floatbox\relax + \global\advance\botinserted \floattopskip\relax + \ifdim\botinserted<\pagegoal\relax + \insert\botins + {\forgetall + \blank[\@@bkspacebefore]% + \flushfloatbox}% + \ifsomefloatwaiting + \advance\noffloatinserts \plusone + \else + \noffloatinserts\nofbotfloats + \fi + \dofloatflushedinfo + \else + \OTRSETresavebox\floatbox + \noffloatinserts\nofbotfloats\relax + \fi + \global\nofloatpermittedtrue % vgl topfloats s! + \else + \ifsomefloatwaiting + \showmessage\m!floatblocks7{\the\nofbotfloats}% + \fi + \let\OTRSETdodosetbotinserts\relax + \fi + \OTRSETdodosetbotinserts} + +\let\OTRSETdosetbothinserts\relax + +\def\OTRSETdotopinsertions + {\ifvoid\topins\else + \ifvoid\columntopbox\mofcolumns + \columnsettopbox\mofcolumns\box\topins + \else + \columnsettopbox\mofcolumns\vbox % temp, must be better + {\forgetall + \offinterlineskip + \box\columntopbox\mofcolumns + \box\topins} + \fi + \fi + \global\topinserted\zeropoint\relax} % goes away + +\def\OTRSETdobotinsertions + {\ifvoid\botins \else + \columnsetbotbox\mofcolumns\box\botins +% \else +% \columnsetbotbox\mofcolumns\vbox % temp, must be better +% {\forgetall +% \offinterlineskip +% \box\botins +% \box\columnbotbox\mofcolumns} + \fi + \global\botinserted\zeropoint\relax} % goes away + +% set ipv text + +% left right 1 2 3 +1 +2 +3 + +\let\columnleftareas \empty +\let\columnrightareas\empty + +% links rechts => odd, even, n, named + +\def\definecolumntextarea + {\dotripleempty\dodefinecolumntextarea} + +\def\dodefinecolumntextarea[#1][#2][#3]% y=0 is mogelijke en handig ! + {\ifthirdargument + \doifinsetelse{#2}{\v!both,\v!fixed} + {\definecolumntextarea[#1][\v!left ][\c!type=#2,#3]% + \definecolumntextarea[#1][\v!right][\c!type=#2,#3]} + {\doifelse{#2}\v!next + {\doifoddpageelse + {\definecolumntextarea[#1][\v!right][\c!type=#2,#3]} + {\definecolumntextarea[#1][\v!left ][\c!type=#2,#3]}} + {\presetlocalframed + [\??mt#1#2]% + \processaction[#2] % \doglobal voorkomt stack build up + [ \v!left=>\doglobal\addtocommalist{#1}\columnleftareas, + \v!right=>\doglobal\addtocommalist{#1}\columnrightareas]% + \getparameters[\??mt#1#2] + [\c!x=1,\c!y=1,\c!nx=1,\c!ny=1,\c!clipoffset=2\lineheight, + \c!offset=\v!overlay,\c!strut=\v!no,\c!frame=\v!off, + \c!type=#2,\c!page=1,\c!state=\v!stop,#3]}}% + \else + \definecolumntextarea[#1][\v!next][#2]% + \fi} + +\def\setupcolumntextarea + {\dotripleempty\dosetupcolumntextarea} + +\def\dosetupcolumntextarea[#1][#2][#3]% + {\ifthirdargument + \doifelse{#2}\v!both + {\setupcolumntextarea[#1][\v!left ][#3]% + \setupcolumntextarea[#1][\v!right][#3]} + {\doifelse{#2}\v!next + {\doifoddpageelse + {\setupcolumntextarea[#1][\v!right][#3]} + {\setupcolumntextarea[#1][\v!left][#3]}} + {\getparameters[\??mt#1#2][#3]}}% + \else + \setupcolumntextarea[#1][\v!next][#2]% + \fi} + +\def\docheckcolumnsetareapage#1#2% + {\ifnum\getvalue{\??mt#1\c!page}>\plusone + \doifelsevalue{\??mt#1\c!type}\v!fixed + {\ifnum\columnsetpage=\getvalue{\??mt#1\c!page}\relax + \donetrue\else\donefalse + \fi} + {\ifnum\columnsetpage<\getvalue{\??mt#1\c!page}\relax + \donefalse\else\donetrue + \fi}% + \else + \donetrue + \fi} + +\def\initializecolumntextareas + {\ifodd\realpageno + \doinitializecolumntextareas\columnrightareas\v!right + \else + \doinitializecolumntextareas\columnleftareas\v!left + \fi} + +\def\doinitializecolumntextareas#1#2% + {\def\docommand##1% + {\docheckcolumnsetareapage{##1#2}\plusone + \ifdone + \donefalse + \processaction + [\getvalue{\??mt##1#2\c!state}] + [ \v!start=>\donetrue, + \v!repeat=>\donetrue, + \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]% + \ifdone\dodoinitializecolumntextareas{##1}{#2}\fi + \fi}% + \processcommacommand[#1]\docommand} + +\def\dodoinitializecolumntextareas#1#2% + {\doOTRSETsetgridcells + {\copy\placeholderboxd} + {\getvalue{\??mt#1#2\c!x }}{\getvalue{\??mt#1#2\c!y }} + {\getvalue{\??mt#1#2\c!nx}}{\getvalue{\??mt#1#2\c!ny}} + {\copy\placeholderboxd}} + +\def\placecolumntextareas + {\ifodd\realpageno + \doplacecolumntextareas\columnrightareas\v!right + \else + \doplacecolumntextareas\columnleftareas\v!left + \fi} + +\def\doplacecolumntextareas#1#2% global ? + {\bgroup + \forgetall + \def\docommand##1% + {\docheckcolumnsetareapage{##1#2}\zerocount + \ifdone + \donefalse + \processaction + [\getvalue{\??mt##1#2\c!state}] + [ \v!start=>\donetrue\doglobal\removefromcommalist{##1}#1, + \v!repeat=>\donetrue, + \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]% + \ifdone + \dodoplacecolumntextareas{##1}{#2}% + \else + \doglobal\removefromcommalist{##1}#1% + \fi + \fi}% + \processcommacommand[#1]\docommand + \egroup} + +% \page[left] +% \definecolumntextarea[intro][left][x=1,y=1,nx=4,ny=20,state=start,background=introlayer] +% \setupcolumntextareatext[intro][left][\setups{intro}] +% \flushcolumntextareas + +\def\flushcolumntextareas + {\initializecolumntextareas + \setvsize} + +\def\columntextlastbackspace{\backspace} + +% beware, we have clipping offsets of 2\lineheight by default + +\def\columntextareaparameter#1% + {\csname\??mt\currentcolumntestarea#1\endcsname} + +\def\dodoplacecolumntextareas#1#2% + {\def\currentcolumntestarea{#1#2}% + \!!counta\columntextareaparameter\c!x + \!!countb\columntextareaparameter\c!nx + \docalculatecolumnsetspan + \!!heighta\columntextareaparameter\c!ny\lineheight + % wrong + % \ifnum\columntextareaparameter\c!y=\zerocount + % \advance\!!heighta -\lineheight + % \advance\!!heighta \topskip + % \fi + % \advance\!!heighta -\lineheight % option + \ifnum\columntextareaparameter\c!y=\plusone + \advance\!!heighta -\lineheight + \advance\!!heighta \topskip + \fi + % + \setbox\scratchbox\vbox + {\donetrue\localframed + [\??mt\currentcolumntestarea] + [\c!location=,% new (*) + \c!width=\!!widtha,\c!height=\!!heighta,\c!lines=] + {\columntextareaparameter\empty}}% + \!!counta\columntextareaparameter\c!x + \!!countb\columntextareaparameter\c!y + \advance\!!countb \columntextareaparameter\c!ny + \advance\!!countb \minusone + % new (*) + \doif{\columntextareaparameter\c!location}\v!depth + {\setbox\scratchbox\hbox{\lower\strutdepth\box\scratchbox}% + \dp\scratchbox\zeropoint + \ht\scratchbox\!!heighta}% + % + \setbox0\hbox + {\ifcase\!!countc + \copy\scratchbox % \box + \else + \clip + [ %\c!topoffset=\columntextareaparameter\c!clipoffset,% + %\c!bottomoffset=\columntextareaparameter\c!clipoffset,% + %\c!leftoffset=\columntextareaparameter\c!clipoffset,% + \c!offset=\columntextareaparameter\c!clipoffset,% + \c!rightoffset=\zeropoint,% + \c!width=\!!widthb,% + \c!height=\!!heighta]% + {\copy\scratchbox}% + \fi}% + \OTRSETsetgridcell\!!counta\!!countb\box0 + \ifcase\!!countc\else + \advance\!!counta \columntextareaparameter\c!nx + \advance\!!counta -\!!countc + \advance\!!widtha -\!!widthb + \setbox0\hbox + {\hskip-\namedlayoutparameter\v!odd\c!backspace + \clip + [ %\c!topoffset=\columntextareaparameter\c!clipoffset,% + %\c!bottomoffset=\columntextareaparameter\c!clipoffset,% + %\c!rightoffset=\columntextareaparameter\c!clipoffset,% + \c!offset=\columntextareaparameter\c!clipoffset,% + \c!leftoffset=\zeropoint,% + \c!width=\!!widtha,% + \c!height=\!!heighta,% + \c!hoffset=\!!widthb]% + {\copy\scratchbox}}% + \OTRSETsetgridcell\!!counta\!!countb\box0% + \fi} + +\def\setupcolumntextareatext + {\dotripleempty\dosetupcolumntextareatext} + +\long\def\dosetupcolumntextareatext[#1][#2][#3]% + {\ifthirdargument + \doifelse{#2}\v!both + {\setvalue{\??mt#1\v!left }{#3}% + \setvalue{\??mt#1\v!right}{#3}} + {\doifelse{#2}\v!next + {\doifoddpageelse + {\setvalue{\??mt#1\v!right}{#3}}% + {\setvalue{\??mt#1\v!left }{#3}}}% + {\setvalue{\??mt#1#2}{#3}}}% + \else + \setupcolumntextareatext[#1][\v!next][{#2}]% + \fi} + +\def\docalculatecolumnsetspan + {% \!!counta <= x + % \!!countb <= nx + % \!!widtha => total width + % \!!widthb => left width + % \!!countc => left cols + \!!widtha\!!countb\textwidth % we assume equal widths + \advance\!!countb \!!counta + \advance\!!countb \minusone + \ifnum\!!countb>\nofcolumns + \!!countc\!!countb + \advance\!!countc -\nofcolumns + \!!countb\nofcolumns + \else + \!!countc\zerocount + \fi + \advance\!!counta \plusone + \dostepwiserecurse\!!counta\!!countb\plusone + {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}% + \!!widthb\!!widtha + \advance\!!widthb -\!!countc\textwidth + \ifodd\realpageno \else % tricky, assumes that we keep there + \ifcase\!!countc\else + % nog niet ok voor enkel/doublesided + \advance\!!widtha \namedlayoutparameter\v!even\c!backspace + \advance\!!widtha \namedlayoutparameter\v!odd \c!backspace + \advance\!!widthb \namedlayoutparameter\v!even\c!backspace + \dorecurse\!!countc + {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}% + \fi + \fi} + +\def\columnsetspanhsize{\textwidth} + +\def\setcolumnsetspanhsize#1#2% x nx / uses counta/b + {\!!counta#1\!!countb#2\docalculatecolumnsetspan + \edef\columnsetspanhsize{\the\!!widtha}} + +\def\definecolumnsetspan + {\dodoubleempty\dodefinecolumnsetspan} + +\def\dodefinecolumnsetspan[#1][#2]% + {%\ifsecondargument + \defineframedtext + [cs:#1] + [\c!frame=\v!off, + \c!before=, + \c!after=, + \c!offset=\v!overlay, + \c!location=\v!left, + \c!linecorrection=\v!off, + \c!depthcorrection=\v!off, + \c!n=2, + \c!nlines=0, + \c!indenting=, + \c!indentnext=\v!yes, + \c!default=HERE, + \c!alternative=\v!a, + #2]% + %\else + % \definecolumnspan[][#1]% + }%\fi} + +\definecolumnsetspan[\s!default] + +\def\setupcolumnsetspan + {\dodoubleempty\dosetupcolumnsetspan} + +\def\dosetupcolumnsetspan[#1][#2]% + {\ifsecondargument + \setupframedtexts[cs:#1][#2]% + \else + \setupcolumnsetspan[\s!default][#1]% + \fi} + +\def\startcolumnsetspan + {\dotripleempty\dostartcolumnsetspan} + +%%%%%%%%%%%%%%%% TODO + +\def\dostartcolumnsetspan[#1][#2][#3]% [#3] gobbles space + {\endgraf % else rubish output if forgotten + \vskip \zeropoint % make sure otr is done, otherwise last line problems + \bgroup + \forgetall + \ifnum\columnsetlevel>\zerocount\else + % of course we needed a one-column fall back for tm + \columnsetspanhsize\hsize + \nofcolumns\plusone + \mofcolumns\plusone + \fi + \setupframedtexts[cs:#1] + [\c!width=\columnsetspanhsize, + \c!linecorrection=\v!off, + \c!depthcorrection=\v!off, + #2]% + % determine widths + \!!countc\framedtextparameter{cs:#1}\c!n + % \!!countd\numexpr(\nofcolumns-\mofcolumns+\plusone)% + \!!countd\nofcolumns + % n <= n of columns + \ifnum\!!countc>\!!countd \!!countc\!!countd \fi + \advance\!!countd -\mofcolumns + \advance\!!countd \plusone + % n <= n of available columns (alternative a) + \doif{\framedtextparameter{cs:#1}\c!alternative}\v!a + {\ifnum\!!countc>\!!countd \!!countc\!!countd \fi}% + % here it all starts + \setcolumnsetspanhsize\mofcolumns\!!countc % a/b used + \hsize\columnsetspanhsize + \setbox\scratchbox\vbox\bgroup + \dostartframedtext[cs:#1][\v!none]% geen nils placement + % spoils spacing : \vskip-\struttotal\par\verticalstrut\par + \ifnum\columnsetlevel>\zerocount + \framedtextparameter{cs:#1}\c!before + \fi + \def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}} + +\def\dostopcolumnsetspan#1% + {\par + \verticalstrut + \kern-2\struttotal + \verticalstrut + \ifnum\columnsetlevel>\zerocount + \doifsomething{\framedtextparameter{cs:#1}\c!after} + {\framedtextparameter{cs:#1}\c!after + \kern\zeropoint}% otherwise blanks disappear, better be a switch + \else + \endgraf + \fi + \dostopframedtext + \egroup + \setbox\scratchbox\frozenhbox to \hsize + {\dontcomplain + \alignedline{\framedtextparameter{cs:#1}\c!location}\v!middle + {\lower\strutdepth\box\scratchbox}}% + \dp\scratchbox\zeropoint % else wrong snap insidefloat +% +% to be tested first (strange in grid mode) +% +% \setbox\scratchbox\frozenhbox to \hsize +% {\dontcomplain +% \chardef\alignstrutmode\zerocount +% \alignedline{\framedtextparameter{cs:#1}\c!plaats}\v!midden +% {\box\scratchbox}}% +% + \ifinsidefloat + \box\scratchbox + \else\ifnum\columnsetlevel>\zerocount + % we only set \columnsetspacing when asked for, else bottom problems + % don't change this any more (test naw) + \chardef\columnslotspacing\framedtextparameter{cs:#1}\c!nlines\relax + % todo: nboven/onder & \chardef\columnslotlocation2 + %\OTRSETstoreincolumnslotHERE\scratchbox + \edef\floatmethod{\framedtextparameter{cs:#1}\c!default}% + \@EA\uppercasestring\floatmethod\to\floatmethod + % todo : \v!here -> here enzovoorts + \OTRSETstoreincolumnslot\floatmethod\scratchbox + % watch out: no \dochecknextindentation{tag} + \checknextindentation[\framedtextparameter{cs:#1}\c!indentnext]% + \else + % of course we needed a one-column fall back for tm; brrr, the box has now too + % much height (try \ruledvbox); don't change this without testing techniek + \scratchdimen\ht\scratchbox + \advance\scratchdimen-\strutdp + \ht\scratchbox\scratchdimen + \framedtextparameter{cs:#1}\c!before + \snaptogrid\vbox{\box\scratchbox}% + \framedtextparameter{cs:#1}\c!after + \fi\fi + \egroup + \endgraf} + +% \startcolumnset[two] +% \input tufte +% \startcolumnsetspan[two][width=20cm,location=middle] \input tufte \stopcolumnsetspan +% \startcolumnsetspan[two][default=btlr] \input tufte \stopcolumnsetspan +% \input tufte \par +% \input tufte \par +% \startcolumnsetspan[two] \emptylines[5] \stopcolumnsetspan +% \startcolumnsetspan[two] \input tufte \stopcolumnsetspan +% \stopcolumnset + +% We need to set the \dimen globally since we are in the +% OTR. Unfortunately this interferes with local settings, +% although we may assume that they will not cross page +% boundaries. + +\def\OTRSETcheckcontent + {\bgroup + \donefalse + \def\OTRSETcheckcontent##1% + {\setbox\scratchbox##1\recurselevel + \setbox\scratchbox\vbox{\unvbox\scratchbox}% + \ifdim\ht\scratchbox>\zeropoint\donetrue\fi}% + \dorecurse{\nofcolumns} + {\OTRSETcheckcontent\columngettextbox + \OTRSETcheckcontent\columngetfootbox + \OTRSETcheckcontent\columngettopbox + \OTRSETcheckcontent\columngetbotbox}% + \ifdone\egroup\donefalse\else\egroup\donetrue\fi} + +\def\OTRSETgetcolumntextheight#1% max - boven - top + {\scratchdimen=\OTRSETgetparameter\c!maxhoogte#1% + \advance\scratchdimen -\OTRSETgetparameter\c!bovenoffset#1% + \advance\scratchdimen -\ht\columntopbox#1% + \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}% + \advance\scratchdimen -\ht\columnbotbox#1} % not used + +\def\OTRSETgetcolumnnaturalheight#1% max - boven - top + {\setbox\scratchbox\vbox{\unvcopy\columntextbox#1}% + \scratchdimen\ht\scratchbox + \advance\scratchdimen \OTRSETgetparameter\c!bovenoffset#1% + \advance\scratchdimen \ht\columntopbox#1% + \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}% + \advance\scratchdimen \ht\columnbotbox#1} % not used + +\def\OTRSETdobalance% splitten in met en zonder footnotes + {\bgroup + \maxdeadcycles=1000 + % collect content and notes + \bgroup + \OTRSEToutput + {\global\setbox1\vbox{\unvbox\normalpagebox}% + \global\setbox3\vbox{\unvbox\footins}}% + \verticalstrut\vskip-\struttotal % makes footnotes flush + \eject + \global\collectingcontentfalse + % check for footnotes only + \ifdim\ht1<\topskip % real dirty + \global\setbox1=\vbox{} + % fix height of first line + \ifdim\ht3>\!!zeropoint + \global\setbox3\vbox + {\setfootnotebodyfont + \kern-\strutht + \kern\topskip + \unvbox3} + \fi + % prepare trial box + \global\setbox5\vbox + {\ifdim\ht1>\zeropoint + \unvcopy1 \ifdim\ht3>\zeropoint \kern\skip\footins \fi + \fi + \ifdim\ht3>\zeropoint \unvcopy3 \fi} + \egroup + % erase old stuff + \columnerasetextboxes + \columnerasefootboxes + % prepare floats + \OTRSETdotopinsertions + \OTRSETdobotinsertions % not used can be removed + % calculate available space + \!!heighta\zeropoint % available total height + \dorecurse{\nofcolumns} + {\OTRSETgetcolumntextheight\recurselevel + \OTRSETcalculatelines\scratchdimen + \advance\!!heighta \scratchdimen} + % quick check + \ifdim\ht5>\!!heighta + % use normal routine + \columnerasetextboxes + \columnerasefootboxes + % TEMP, TODO, FORCE NEXT PASS ! + \unvbox1 + \unvbox3 + \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist + \donefalse + %\writestatus\m!columns{no balancing, text overflows height}% + \else\ifdim\ht5>\zeropoint \relax + % some text and/or notes + \donetrue + \else + \donefalse + \dorecurse\nofcolumns + {\ifdim\ht\columntopbox\recurselevel>\zeropoint \donetrue \fi}% + \ifdone + % no text and notes, but figures + \else + % no text, no notes, no figures + \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist + \writestatus\m!columns{no balancing, nothing to be placed}% + \fi + \fi\fi + \ifdone + \ifdim\ht5>\zeropoint \relax + % balancing text and notes + %\writestatus\m!columns{text may fit, balancing}% + \newcounter\loopcounter + \newcounter\balancinglines + \doloop + {\increment\loopcounter\relax + % initialize + \columnerasetextboxes + \columnerasefootboxes + \setbox0=\copy5 + \splittopskip\topskip + % pre-split loop and quality calculation + %\writestatus\m!columns{pass \loopcounter: correction -\balancinglines} + \dorecurse\nofcolumns + {\OTRSETgetcolumntextheight\recurselevel + \OTRSETcalculatelines\scratchdimen + \!!heightc\scratchdimen + \ifnum\recurselevel<\nofcolumns + \advance\!!heightc -\balancinglines\lineheight + \fi + \columnsettextbox\recurselevel\vsplit0 to \!!heightc} + % just one method + \OTRSETgetcolumnnaturalheight1 \dimen4\scratchdimen + \OTRSETgetcolumnnaturalheight\nofcolumns \dimen6\scratchdimen + %\writestatus\m!columns{first column: \the\dimen4}% + %\writestatus\m!columns{last column: \the\dimen6}% + \ifdim\dimen4=\dimen6 + \donetrue % perfect balance + \else\ifdim\dimen4>\dimen6 + \donefalse % not yet good enough + \increment\balancinglines % try again + \edef\balancingcount{\the\!!counta} + \else + \donetrue % worse balance + \ifnum\balancinglines>0 % take previous + \decrement\balancinglines + \fi + \fi\fi + % extra check + % \ifdim\ht0>\zeropoint\relax \donefalse \fi + % another check + \ifdone + %\writestatus\m!columns{balancing finished in pass \loopcounter}% + \else \ifnum\loopcounter>100 \donetrue + %\writestatus\m!columns{balancing aborted after pass \loopcounter}% + \else + %\writestatus\m!columns{balancing continued after pass \loopcounter}% + \fi \fi + % final balancing pass + \ifdone + \setbox0\copy1 + \setbox2\copy3 + \columnerasetextboxes + \columnerasefootboxes + \dorecurse\nofcolumns + {\OTRSETgetcolumntextheight\recurselevel + \OTRSETcalculatelines\scratchdimen + \!!heightc\scratchdimen + \ifnum\recurselevel<\nofcolumns + \advance\!!heightc -\balancinglines\lineheight + \fi + % split off text + \ifdim\ht0>\zeropoint + \columnsettextbox\recurselevel\vsplit0 to \!!heightc + \setbox4\vbox{\unvcopy\columntextbox\recurselevel} + \advance\!!heightc -\ht4 + \ifdim\ht0>\zeropoint + \columnsettextbox\recurselevel\box4 + \advance\!!heightc \skip\footins + \fi + \fi + % split off footnotes + \ifdim\ht0>\zeropoint\relax \else + \ifdim\ht2>\zeropoint\relax + \setbox4\vsplit2 to \!!heightc + \setbox\footins=\vbox{\unvbox4} % ugly and dirty trick + \ifdim\ht\columntextbox\recurselevel=\zeropoint\relax + \columnsettextbox\recurselevel\hbox + {\raise\strutdp\hbox % ugly but needed + {\setfootnotebodyfont % both these moves + \lower\strutdp\hbox{\placebottomnotes}}} + \else + \columnsetfootbox\recurselevel\hbox{\placebottomnotes} + \fi + \fi + \fi} + \exitloop + \fi} + \else + % no reason to balance floats + \fi + \fi + \doglobal\addtocommalist{\realfolio}\OTRSETbalancinglist + \OTRSETdoflush + \fi + \egroup} + +\protect \endinput + +% extreme examples (1) +% +% \setupfloats[numbering=nocheck] +% +% \definecolumnset [first] [n=2,start=0] +% \definecolumnset [next] [n=2,start=3] +% +% \setuptexttexts[\vbox to \textheight{\topskipcorrection \hsize\makeupwidth left \hfill right\vfill}] +% +% \setuphead[chapter][text=empty] +% +% \starttext +% +% \startcolumnset[first,next] +% \placefigure[btrl]{}{} +% \placefigure[tblr]{}{} +% \chapter{thuan} \dorecurse{25}{\recurselevel: \input thuan \endgraf} +% \stopcolumnset +% +% \startcolumnset[first,next] +% \chapter{thuan} \dorecurse{25}{\input thuan \endgraf\placefigure{}{}} +% \stopcolumnset + +\unprotect + +% only in columnsets + +% \def\cornerfigure +% {\dotripleempty\docornerfigure} +% +% \def\docornerfigure[#1][#2][#3]% [layer] [location] [settings] +% {\bgroup +% \dowithnextbox +% {\!!doneafalse +% \!!donebfalse +% \processallactionsinset +% [\v!left,\v!bottom,#2] +% [ \v!left=>\!!doneatrue , +% \v!right=>\!!doneafalse, +% \v!top=>\!!donebtrue , +% \v!bottom=>\!!donebfalse]% +% \!!widtha\nextboxwd +% \if!!donea +% % unchecked +% \advance\!!widtha-\backspace +% \else +% % unchecked +% \advance\!!widtha-\backspace +% \fi +% \!!widtha\textwidth % could be an option +% \!!heighta\nextboxht +% % zou een macro moeten zijn \getnoflayoutlines +% \ifnum\layoutparameter\c!lines=\zerocount +% \getnoflines\textheight +% \else +% \noflines\layoutparameter\c!lines +% \fi +% % +% \advance\noflines \plusone % wordt default, instelbaar +% \!!heightb\noflines\lineheight\relax +% \if!!doneb % boven +% % unchecked +% \advance\!!heighta-\topspace +% \advance\!!heighta-\headerheight +% \advance\!!heighta-\headerdistance +% \else % onder +% % checked +% \advance\!!heighta-\paperheight +% \advance\!!heighta+\!!heightb +% \advance\!!heighta+\topspace +% \advance\!!heighta+\headerheight +% \advance\!!heighta+\headerdistance +% \advance\!!heighta-\footerdistance +% \advance\!!heighta-\footerheight +% \fi +% \getnoflines\!!heighta +% \!!heighta\noflines\lineheight\relax +% \def\docornerfigure[####1]% +% {\expanded{\plaatsfiguur[####1,\v!none]{} +% {\noexpand\phantombox[\c!width=\the\!!widtha,\c!height=\the\!!heighta]}}}% +% \if!!donea +% \if!!doneb % links boven / rb +% \setlayer[#1] +% [\c!corner={\v!left,\v!top},\c!location=rb,#3] +% {\flushnextbox}% +% \docornerfigure[tblr]% +% \else % links onder / rt +% \setlayer[#1] +% [\c!corner={\v!left,\v!bottom},\c!location=rt,#3] +% {\flushnextbox}% +% \docornerfigure[btlr]% +% \fi +% \else +% \if!!doneb % rechts boven / lt +% \setlayer[#1] +% [\c!corner={\v!right,\v!top},\c!location=lb,#3] +% {\flushnextbox}% +% \docornerfigure[tbrl]% +% \else % rechts onder / lb +% \setlayer[#1] +% [\c!corner={\v!right,\v!bottom},\c!location=lt,#3] +% {\flushnextbox}% +% \docornerfigure[btrl]% +% \fi +% \fi +% \egroup} +% \vbox} diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv new file mode 100644 index 000000000..e50c5ec21 --- /dev/null +++ b/tex/context/base/page-set.mkiv @@ -0,0 +1,3104 @@ +%D \module +%D [ file=page-set, +%D version=2000.10.20, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Column Sets, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% getnoflines vs getrawnoflines + +% some day: cleanup and go etex + +\writestatus{loading}{ConTeXt Page Macros / Column Sets} + +% todo : last longer than previous +% todo : block span over last column if footnotes +% todo : diagnosis balancing run +% todo : separate footnote placement +% todo : go on on same page with colset +% todo : test page areas per page +% todo : leftmargin/rightmargin (better than afstand(1)) + +% use the OTRSET layer for more purposes, like the footnotes ! + +\unprotect + +\newcount\tofcolumns % total +\newcount\lofcolumns % left +\newcount\rofcolumns % right + +\newcount\columnfirstcell \columnfirstcell=1 +\newcount\columnlastcell +\newcount\columnfreecells +\newcount\currenthcell +\newcount\currentvcell +\newcount\columnhcells +\newcount\columnvcells + +\newif\ifenoughcolumncells +\newif\ifsomefreecolumncells +\newif\ifcolumnspread +\newif\iftracecolumnset % \tracecolumnsettrue + +\def\columnmaxcells {75} % runtime +\def\columnmaxfreecells {0} % runtime +\def\columngaplimit {0} % {5} + +\def\@otr@{otr} + +\def\OTRSETmakeupwidth{\innermakeupwidth} + +\let\OTRSETflushsidefloats \forgetsidefloats % \relax +\let\OTRSETsynchronizesidefloats\forgetsidefloats % \relax + +\def\OTRSETgridcell #1#2{\csname \@otr@:\number#1:\number#2\endcsname} +\def\OTRSETgetgridcell#1#2{\box\csname \@otr@:\number#1:\number#2\endcsname} +\def\OTRSETsetgridcell#1#2{\global\setbox\csname\@otr@:\number#1:\number#2\endcsname} + +\long\def\OTRSETdoifcellelse#1#2% + {\relax\ifvoid\csname\@otr@:\number#1:\number#2\endcsname + \@EA\secondoftwoarguments\else\@EA\firstoftwoarguments + \fi} + +% The following two macros are used to compensate for a switch in body fonts +% as in: +% +% \definecolumnset [two] [n=2,balancing=yes] +% \definecolumnset [three] [n=3,balancing=yes] +% +% \setupcolumnsetlines[two][1][1][7] +% \setupcolumnsetlines[two][1][2][10] +% +% \setupcolumnsetlines[three][1][1][40] +% \setupcolumnsetlines[three][1][2][40] +% \setupcolumnsetlines[three][1][3][40] +% +% \setupcolumnsetstart[three][1][1][15] +% \setupcolumnsetstart[three][1][2][20] +% \setupcolumnsetstart[three][1][3][20] +% +% \starttext +% \startcolumnset [two] \dorecurse {1}{\input tufte \par} \stopcolumnset +% \switchtobodyfont[small] +% \startcolumnset [three] \dorecurse {1}{\input tufte \par} \stopcolumnset +% \stoptext + +%D Marks in columnsets: +%D +%D \starttyping +%D \definemarking[M] +%D \setupheadertexts[\setups{show-M-marks}] +%D \definecolumnset[test][n=3] +%D +%D \startsetups show-M-marks +%D \getmarking[M][1][previous]/\getmarking[M][1][first]/\getmarking[M][1][last]\quad +%D \getmarking[M][2][previous]/\getmarking[M][2][first]/\getmarking[M][2][last]\quad +%D \getmarking[M][3][previous]/\getmarking[M][3][first]/\getmarking[M][3][last]\quad +%D \getmarking[M][1][previous]/\getmarking[M][1][first]/\getmarking[M][last]\quad +%D \getsavedmarking[M][previous]/\getsavedmarking[M][first]/\getsavedmarking[M][last] +%D \stopsetups +%D +%D \startbuffer +%D \section{Knuth} [K1]\marking[M]{k1} [K2]\marking[M]{k2} \input knuth +%D \section{Zapf} [Z]\marking[M]{z} \input zapf +%D \stopbuffer +%D +%D \startbuffer +%D \section{Ward} [W]\marking[M]{w} \input ward +%D \placefigure[here]{none}{\externalfigure[a][height=2cm]} +%D \section{Davis} [D]\marking[M]{d} \input davis +%D \section{Zapf} [Z]\marking[M]{z} \input zapf +%D \stopbuffer +%D +%D \startbuffer +%D \section{Ward} [W]\marking[M]{w} \input ward +%D \placefigure[here]{none}{\externalfigure[a][height=2cm]} +%D \section{Davis} [D]\marking[M]{d} \input davis +%D \section{Zapf} [Z]\marking[M]{z} \input zapf +%D \section{Douglas} [O]\marking[M]{o} \input douglas +%D \stopbuffer +%D +%D \starttext +%D \startcolumnset[test] +%D \dorecurse{5}{\getbuffer} +%D \placefigure[here]{none}{\externalfigure[a][height=2cm]} +%D % \column % sometimes needed +%D \stopcolumnset +%D \stoptext +%D \stoptyping + +% not ok yet, for column sets we need a special case: within a column we +% need to bubble-up the marks; the indirectness permits overloading here + +\let\saveOTRSETmark \refreshsavedmark +\let\bubbleOTRSETmark\bubblesavedmark +\let\resetOTRSETmark \resetsavedmark +\let\presetOTRSETmark\presetsavedmark + +\def\doregisterOTRSETmarks#1{\saveOTRSETmark [#1][\number\mofcolumns]} +\def\dobubbleOTRSETmarks #1{\bubbleOTRSETmark[#1][\number\mofcolumns]} +\def\doresetOTRSETmarks #1{\resetOTRSETmark [#1][\recurselevel]} +\def\dopresetOTRSETmarks #1{\presetOTRSETmark[#1][\recurselevel]} + +\def\registerOTRSETmarks + {\processcommacommand[\alldefinedmarks]\doregisterOTRSETmarks} +\def\bubbleOTRSETmarks + {\processcommacommand[\alldefinedmarks]\dobubbleOTRSETmarks} +\def\resetOTRSETmarks + {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\doresetOTRSETmarks}} +\def\presetOTRSETmarks + {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\dopresetOTRSETmarks}} + +%D test case of Vit Zika (context list): +%D +%D \starttyping +%D \setuplayout[height=middle,width=middle,grid=yes] +%D +%D \starttext +%D \startcolumnset +%D \dorecurse{10} +%D {\input thuan \endgraf +%D \bgroup +%D \ss\restoreinterlinespace +%D \dorecurse{3}{\input hawking \endgraf} +%D \egroup +%D \input bryson \endgraf} +%D \stopcolumnset +%D \stoptext +%D \stoptyping + +\def\OTRSETsetcorrectnofcells#1% + {\bgroup + \!!counta#1\relax + \ifdim\globalbodyfontsize=\localbodyfontsize + \restoreinterlinespace + \else + \!!dimena-\!!counta\lineheight + \restoreglobalbodyfont % slow, we need a fast one + \advance\!!dimena\!!counta\lineheight + \getnoflines\!!dimena + \advance\!!counta\noflines + \ifnum\!!counta<#1\else + \!!counta#1\relax + \fi + \fi + \relax % needed ! ! ! ! else lookahead over \fi and \@EA + \@EA\egroup\@EA\scratchcounter\the\!!counta\relax} + +\def\OTRSETsetcorrectcellht + {\bgroup + \!!dimena-\strutht\relax + \ifdim\globalbodyfontsize=\localbodyfontsize + \restoreinterlinespace + \else + \restoreglobalbodyfont + \fi + \advance\!!dimena\strutht + \relax % needed ! ! ! ! else lookahead over \fi and \@EA + \@EA\egroup\@EA\scratchdimen\the\!!dimena\relax} + +\def\columnerasegridboxes % maybe dedicated loops + {\bgroup + \increment\columnmaxcells\relax + \ifodd\realpageno + \else % we are on the other page + \columnspreadfalse + \fi + \ifcolumnspread + \dorecurse\nofcolumns + {\let\!!stringa\recurselevel + \scratchcounter\recurselevel \advance\scratchcounter\lofcolumns + \edef\!!stringb{\the\scratchcounter}% + \dostepwiserecurse \zerocount \columnmaxcells \plusone + {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname + \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname + \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname + \box\csname\@otr@:\!!stringb:\recurselevel\endcsname + %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname + \else + \emptybox + %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox + \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname + \fi + \else + \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname + \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname + \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname + \else + \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname + \fi + \fi}}% + \else + \dorecurse \tofcolumns + {\let\!!stringa\recurselevel + \dostepwiserecurse \zerocount \columnmaxcells \plusone + {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname + \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox + \else + \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname + \fi}}% + \fi + \dorecurse\tofcolumns + {\global\setbox\csname\@otr@:\recurselevel:\columnmaxcells\endcsname\copy\placeholderboxa}% + \global\columnfirstcell\zerocount + \global\columnlastcell\columnfirstcell + \global\columnfreecells\columnfirstcell + \egroup} + +\def\doOTRSETsetgridcells#1#2#3#4#5#6% placeholder col row wid hei {data} + {\!!countd#2\advance\!!countd#4\advance\!!countd\minusone + \!!counte#3\advance\!!counte#5\advance\!!counte\minusone + \dostepwiserecurse{#2}\!!countd\plusone + {\!!countf\recurselevel + \dostepwiserecurse{#3}\!!counte\plusone + {\OTRSETsetgridcell\!!countf\recurselevel#1}}% + \dostepwiserecurse{#3}\!!counte\plusone + {\global\wd\OTRSETgridcell{#2}\recurselevel\hsize}% + \OTRSETsetgridcell{#2}\!!counte#6} + +\def\OTRSETsetgridcells + {\doOTRSETsetgridcells{\copy\placeholderboxb}} + +\def\OTRSETerasegridcells#1#2#3#4% + {\doOTRSETsetgridcells{\emptybox}{#1}{#2}{#3}{#4}{\emptybox}} + +\def\setupcolumnsetlines{\doquintupleempty\dosetupcolumnsettrick[l]} +\def\setupcolumnsetstart{\doquintupleempty\dosetupcolumnsettrick[s]} + +\def\dosetupcolumnsettrick[#1][#2][#3][#4][#5]% tag id page col value + {% not needed, is already relative + % \doifinstringelse{+}{#3}{\scratchcounter\realpageno}{\scratchcounter\zerocount}% + % \advance\scratchcounter#3\relax % \relax needed + % \setevalue{\??mc:#1:#2:\the\scratchcounter:\number#4}{\number#5}} + \iffifthargument + \setevalue{\??mc:#1:#2:\number#3:\number#4}{\number#5}% + \else + \setevalue{\??mc:#1:#2:\number#3:0}{\number#4}% + \fi} + +\def\currentcolumnmaxcellstag #1{\??mc:l:\OTRSETidentifier:\columnsetpage:\number#1} +\def\currentcolumnstartcelltag#1{\??mc:s:\OTRSETidentifier:\columnsetpage:\number#1} + +\def\doresetcolumnsetlines#1% + {\ifcsname\currentcolumnmaxcellstag{#1}\endcsname + \letgvalue{\currentcolumnmaxcellstag{#1}}\zerocount + \fi + \ifcsname\currentcolumnmaxcellstag{#1}\endcsname + \letgvalue{\currentcolumnmaxcellstag{#1}}\zerocount + \fi} + +\def\currentcolumnsomecells#1#2% + {\ifcsname#1\mofcolumns\endcsname + \ifnum\csname#1\mofcolumns\endcsname=\zerocount + #2% + \else + \number\numexpr\ifnum\csname#1\mofcolumns\endcsname<\zerocount + \columnmaxcells+\fi\csname#1\mofcolumns\endcsname\relax + \fi + \else\ifcsname#10\endcsname + \ifnum\csname#10\endcsname=\zerocount + #2% + \else + \number\numexpr\ifnum\csname#10\endcsname<\zerocount + \columnmaxcells+\fi\csname#10\endcsname\relax + \fi + \else + #2% + \fi\fi} + +\def\currentcolumnmaxcells {\currentcolumnsomecells\currentcolumnmaxcellstag \columnmaxcells} +\def\currentcolumnstartcell{\currentcolumnsomecells\currentcolumnstartcelltag\plusone} + +\def\OTRSETsetfreecells#1#2% col start + {\bgroup + \global\columnfirstcell\ifnum#2=0 1\else#2\fi\relax + \OTRSETsetcorrectnofcells\currentcolumnmaxcells % sets \scratchcounter + \edef\columnmaxcells{\the\scratchcounter}% + \ifnum\columnfirstcell>\columnmaxcells + \global\columnfreecells\zerocount + \global\columnfirstcell\plusone + \global\columnlastcell \zerocount + \global\somefreecolumncellsfalse + %\message{no cells a}% + \else + \doloop + {\ifnum\columnfirstcell>\columnmaxcells\relax + \exitloop + \else + \OTRSETdoifcellelse{#1}\columnfirstcell + {\global\advance\columnfirstcell\plusone}\exitloop + \fi}% + \global\columnlastcell\columnfirstcell + \doloop + {\ifnum\columnlastcell>\columnmaxcells\relax + \exitloop + \else + \OTRSETdoifcellelse{#1}\columnlastcell + {\global\advance\columnlastcell \minusone \exitloop} + {\global\advance\columnlastcell \plusone }% + \fi}% + \ifnum\columnfirstcell>\columnmaxcells + \global\columnfreecells\zerocount + \global\columnfirstcell\plusone + \global\columnlastcell \zerocount + \global\somefreecolumncellsfalse + %\message{no cells b}% + \else + \ifnum\columnlastcell>\columnmaxcells + \global\columnlastcell\columnmaxcells + \fi + \global\columnfreecells\columnlastcell + \global\advance\columnfreecells -\columnfirstcell + \global\advance\columnfreecells \plusone + \global\somefreecolumncellstrue + %\message{\number\columnfirstcell-\number\columnlastcell=\number\columnfreecells}% + \fi + \fi + \egroup} + +\def\OTRSETgetmaxfreecells#1#2% col start + {\let\columnmaxfreecells\!!zerocount + \let\columnfrmfreecells\!!zerocount + \pushmacro \columnmaxcells +\OTRSETsetcorrectnofcells\currentcolumnmaxcells % sets \scratchcounter +\edef\columnmaxcells{\the\scratchcounter}% + \scratchcounter\zerocount + \dostepwiserecurse{#2}\columnmaxcells\plusone + {\OTRSETdoifcellelse{#1}\recurselevel + {\ifnum\columnmaxfreecells<\scratchcounter + \edef\columnmaxfreecells{\the\scratchcounter}% + \let\columnfrmfreecells\recurselevel + \fi + \scratchcounter\zerocount} + {\advance\scratchcounter\plusone}}% + \popmacro\columnmaxcells} + +\long\def\OTRSETrecurseRL#1% + {\dostepwiserecurse\nofcolumns\plusone\minusone + {#1\hskip\OTRSETgetparameter\c!distance\recurselevel}} + +\def\OTRSETmakegridbox + {\ifcase\columndirection + \OTRSETdomakegridbox\plusone\nofcolumns\plusone + \else + \OTRSETdomakegridbox\nofcolumns\plusone\minusone + \fi} + +\def\OTRSETmakeupwidth{\makeupwidth} % temporary indirectness + +\def\OTRSETdomakegridbox#1#2#3% + {\hbox\bgroup + \dontcomplain + \forgetall % can go once in \flush + \!!heighta \textheight + % test first ! + \hbox to \OTRSETmakeupwidth + {\dostepwiserecurse{#1}{#2}{#3} + {\mofcolumns\recurselevel + \localcolumnwidth\OTRSETlocalwidth\mofcolumns + \setbox\scratchbox\hbox\localframed + [\??mc\OTRSETidentifier\number\mofcolumns]% + [\c!width=\localcolumnwidth,\c!height=\!!heighta,\c!lines=]% + {}% + \wd\scratchbox\localcolumnwidth + \ht\scratchbox\!!heighta + \ifcase\columndirection + \hskip\OTRSETgetparameter\c!distance\recurselevel + \box\scratchbox + \else + \box\scratchbox + \hskip\OTRSETgetparameter\c!distance\recurselevel + \fi}}% + \hskip-\OTRSETmakeupwidth + % main text + \hbox to \OTRSETmakeupwidth + {\dostepwiserecurse{#1}{#2}{#3} + {\mofcolumns\recurselevel + \localcolumnwidth\OTRSETlocalwidth\mofcolumns + \offinterlineskip + \setbox\scratchbox\vbox to \!!heighta + {\topskipcorrection % not needed + \ifcase\OTRSETbalancemethod + % no + \or + % yes + \doifelselayerdata{OTRTEXT}\vfill\relax % temp hack + \or + % top + \or + % bottom + \vfill + \fi + \dorecurse\columnmaxcells + {\setbox\scratchbox\hbox{\OTRSETgetgridcell\mofcolumns\recurselevel}% + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \ifcase\columndirection + \box\scratchbox + \else + \hbox to \localcolumnwidth + {\hskip\localcolumnwidth\llap{\box\scratchbox}}% + \fi + \par}% + \ifcase\OTRSETbalancemethod + % no + \else + % yes, top, bottom + \ifdim\globalbodyfontsize=\localbodyfontsize + \removedepth + \restoreglobalbodyfont + \vskip\strutdepth + \fi + \kern\zeropoint + \vss + \fi}% + \wd\scratchbox\localcolumnwidth % \textwidth + \ifcase\columndirection + \hskip\OTRSETgetparameter\c!distance\recurselevel\box\scratchbox + \else + \box\scratchbox\hskip\OTRSETgetparameter\c!distance\recurselevel + \fi}}% + \egroup} + +\let\OTRSETbalht\zeropoint + +\def\OTRSETreducegridbox % for the moment no difference between methods + {\globallet\OTRSETbalht\zeropoint + \ifcase\OTRSETbalancemethod + % no balancing + \else + \bgroup + \!!counta\columnmaxcells + \donetrue + \doloop + {\dorecurse\nofcolumns{\OTRSETdoifcellelse\recurselevel\!!counta\donefalse\donothing}% + \ifdone + \ifnum\!!counta>\plusone\advance\!!counta\minusone\else\exitloop\fi + \else + \exitloop + \fi}% + \ifnum\!!counta>\plusone + \!!heighta\lineheight + \multiply\!!heighta \!!counta + \advance\!!heighta \topskip + \advance\!!heighta -\lineheight + \else + \!!heighta\zeropoint + \fi + \xdef\OTRSETbalht{\the\!!heighta}% + \egroup + \fi} + +\def\OTRSETflushfinalfootnotes + {\ifcase\lastcolumnlastcell \else + \setbox\scratchbox\hbox + {\placebottomnotes}% + \ifdim\ht\scratchbox>\zeropoint + \setbox\scratchbox\hbox + {\hbox to \zeropoint{\OTRSETgetgridcell\nofcolumns\lastcolumnlastcell}% + \box\scratchbox}% + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \OTRSETsetgridcell\nofcolumns\lastcolumnlastcell\box\scratchbox + \fi + \global\lastcolumnlastcell\zerocount + \fi} + +\def\OTRSETdoflush + {\ifcollectingcontent + \registerOTRSETmarks + \global\mofcolumns\plusone + \else + \OTRSETdofinalflush + \OTRSETdofinaloutput + \ifnum\columnsetpage>0 + \dorecurse\nofcolumns{\doresetcolumnsetlines\recurselevel}% + \fi + \doglobal\increment\columnsetpage + \OTRSETinitializecolumns + %\OTRSETdoflushfloats + \OTRSETstartnextpage +\presetOTRSETmarks + \initializecolumntextareas + \fi} + +\newbox\OTRfinalpagebox + +\def\OTRSETdofinalflush % see \OTRSETdoflush + {\OTRSETflushfinalfootnotes + \placecolumntextareas + \OTRSETcentergridcells + \bgroup % we want to keep the reduction local + \OTRSETreducegridbox + \global\setbox\OTRfinalpagebox\OTRSETmakegridbox + \egroup % otherwise we get the wrong number of free cells + %\gdef\localcolumnmaxcells{0}% here ? + \global\mofcolumns\nofcolumns} % otherwise problems in finaloutput + +% \def\OTRSETdofinaloutput +% {\ifdim\ht\OTRfinalpagebox=\teksthoogte +% % \bgroup \let\OTRSETsetvsize\relax % prevents useless search for gap +% \ifcase\OTRSETbalancemethod +% \finaloutput\box\OTRfinalpagebox +% \else\ifdim\OTRSETbalht>\zeropoint +% \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht +% {\box\OTRfinalpagebox}% +% \global\dp\OTRfinalpagebox\strutdepth +% \box\OTRfinalpagebox +% \else +% \finaloutput\box\OTRfinalpagebox +% \fi \fi +% \globallet\OTRSETbalht\zeropoint +% % \egroup +% \fi} + +\def\OTRSETdofinaloutput + {\ifdim\ht\OTRfinalpagebox=\textheight + \bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap + \ifcase\OTRSETbalancemethod + \finaloutput\box\OTRfinalpagebox + \else\ifdim\OTRSETbalht>\zeropoint + % catch a bordercase + \scratchdimen\OTRSETbalht + \advance\scratchdimen\lineheight\relax + \ifdim\scratchdimen>\textheight + % full page + \finaloutput\box\OTRfinalpagebox + \else + % same page + \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht + {\box\OTRfinalpagebox\vss}% + \setlayer[OTRTEXT]{\box\OTRfinalpagebox}% + \snaptogrid\vbox{\vskip\OTRSETbalht}% hack + \fi + \else + \finaloutput\box\OTRfinalpagebox + \fi \fi + \globallet\OTRSETbalht\zeropoint + \egroup + \fi} + +\definesystemvariable {mc} +\definesystemvariable {mt} +\definesystemconstant {colset} + +\definetwopasslist\s!colset + +\newdimen \OTRSETtextswidth +\newdimen \OTRSETtextsheight +\let \OTRSETidentifier=\empty + +\newtoks \OTRSEToutput + +\def\OTRSETgetparameter#1#2{\csname\??mc\OTRSETidentifier\number#2#1\endcsname} +\def\OTRSETsetparameter#1#2{\setvalue{\??mc\OTRSETidentifier\number#2#1}} + +\def\OTRSETskipstart + {\scratchcounter\executeifdefined{\??mc\OTRSETidentifier\c!start}\zerocount + \relax % needed ! + \ifcase\scratchcounter\else + \advance\scratchcounter\plusone + \doOTRSETsetgridcells + {\copy\placeholderboxe} + \plusone\plusone\nofcolumns\scratchcounter + \null + \fi} + +\def\OTRSETsetvsize % snap per sectie (gap here?) + {\ifcollectingcontent \else % can be assigndimen +\OTRSETskipstart % not that well tested + \OTRSETcheckinsert % added + \OTRSETsetfreecells\mofcolumns\columnfirstcell + \ifsomefreecolumncells + \global\vsize\columnfreecells\lineheight + \ifinotr % else problems with floats, see extreme + \global\pagegoal\vsize % niet nodig, tenzij binnen otr + \fi + \synchronizeoutput % fails on example + % \allowbreak % hm + \fi + \synchronizenotes + \fi} + +\def\OTRSETsethsize % of course this does not migrate outside the otr + {\localcolumnwidth\OTRSETlocalwidth\mofcolumns + \textwidth\localcolumnwidth + \hsize\localcolumnwidth} + +\def\OTRSETsynchronizehsize + {\ifcase0\getvalue{\??mc\??mc\c!width}\else % some width set + \bgroup + \scratchdimen\OTRSETlocalwidth\mofcolumns + \ifdim\scratchdimen=\textwidth + \egroup + \else + % only if change in width and \column/\break + \egroup \OTRSETsethsize + \fi + \fi} + +\def\OTRSETcheckfreelines + {\OTRSETsetvsize} + +\def\doOTRSETcolumnseparator + {\hbox to \zeropoint{\hss\red\vl\hss}} + +\let\OTRSETcolumnseparator\relax + +\def\showbreaks + {\let\OTRSETcolumnseparator\doOTRSETcolumnseparator} + +% \installcolumnbreakhandler {SET} \v!ja +% {% hmmm: +% \ifhmode +% \bgroup +% \removeunwantedspaces +% \parfillskip\zeropoint +% \OTRSETcolumnseparator +% \par +% \egroup +% \fi +% % brrr: +% \ejectinsert +% \ejectpage +% \OTRSETsynchronizehsize} % no \OTRSETsethsize, can be mid smaller (like tabulate) +% +% \installcolumnbreakhandler {SET} \v!forceer +% {\OTRSETgotocolumn[\v!forceer]} +% \installcolumnbreakhandler {SET} \v!eerste +% {\OTRSETgotocolumn[\v!eerste]} +% \installcolumnbreakhandler {SET} \v!laatste +% {\OTRSETgotocolumn[\v!laatste]} +% +% \installcolumnbreakhandler {SET} \v!pagina +% {\simplepagebreak % \flushnotes \executepagebreakhandler\v!ja +% \ifnum\mofcolumns>\plusone +% \OTRSETgotocolumn[\v!laatste,\v!forceer]% +% \fi} + +\def\OTRSETcolumnhbreak + {\ifhmode + \bgroup + \removeunwantedspaces + \parfillskip\zeropoint + \OTRSETcolumnseparator + \par + \egroup + \fi} + +\installcolumnbreakhandler {SET} \v!local + {\OTRSETcolumnhbreak + \ejectinsert + \ejectpage % brrr + % no \OTRSETsethsize, can be mid smaller (like tabulate) + % also, this one should be executed at the outer level + % (setting hsize inside otr does not work) + \OTRSETsynchronizehsize} + +% We need to make sure that we really leave the column; mid +% column we may end up in an empty gap, and we don't want to +% stay there (basically such a gap is a small empty page +% then). + +\installcolumnbreakhandler {SET} \v!yes + {\OTRSETcolumnhbreak + \edef\savedmofcolumns{\the\mofcolumns}% + \edef\savedrealpageno{\the\realpageno}% + \ejectinsert + \ejectpage % brrr + \doloop + {\ifnum\savedmofcolumns=\mofcolumns + \ifnum\savedrealpageno=\realpageno + \OTRSETdummycolumn + \else + \exitloop + \fi + \else + \exitloop + \fi}% + \OTRSETsynchronizehsize} + +\installcolumnbreakhandler {SET} \s!unknown + {\expanded{\OTRSETgotocolumn[\@@columnspecification]}} + +\installcolumnbreakhandler {SET} \v!page + {\vfill\eject % \doejectpage\eject + \OTRSETgotonextpage} + +\newtoks\OTRSETeverystartofcolumn + +\newbox\OTRSETsavedfootnotes + +% \installoutput\OTRSETflushtextsofar % spacing goes wrong + +%\def\OTRSETflushtextsofar +% {\ifvoid\normalpagebox \else +% \setbox\scratchbox\vbox{\unvbox\normalpagebox}% +% \OTRSETsavenotes +% \OTRSEThandleflushedtext0 +% \fi} + +% The complication is in the fact that when the HERE float +% is placed, the otr is not invoked when there is not yet +% enough content; this can lead to a change in order (turning +% on the tracer with option 0 is very instructive, watch the +% small numbers in the margin) +% +% 0 = no flushing, so no interference but user should handle +% border cases of placement +% 1 = the normal otr, rather untested +% 2 = a solution that works ok, is experimental and above +% all messy + +\chardef\OTRSETflushtextmode=0 + +\def\OTRSETflushtextsofar + {\ifcase\OTRSETflushtextmode + % don't mess around + \or + % the normal one + \ifvoid\normalpagebox\else + \OTRSETnaturalflush + \OTRSETcheckfreelines + \fi + \or + % way to complicated, but kind of ok + \doOTRSETflushtextsofar + \fi} + +\newskip\lastskipinotr + +\installoutput\doOTRSETflushtextsofar % experimental + {\ifvoid\normalpagebox\else + \scratchdimen\dp\normalpagebox + \setbox\scratchbox\vbox + {\forgetall + \unvbox\normalpagebox + \global\lastskipinotr\lastskip\relax + \ifdim\lastskipinotr>\zeropoint\relax + \removelastskip + \else + \kern-\scratchdimen % handle depth + \fi}% + \ifdim\lastskipinotr>\zeropoint + \scratchskip\ht\scratchbox + \setbox\scratchbox\hbox + {\lower\strutdepth\box\scratchbox}% + \dp\scratchbox\scratchdimen + \ht\scratchbox\scratchskip + \fi + \OTRSETsavenotes + \OTRSEThandleflushedtext\zerocount + \ifdim\lastskipinotr>\zeropoint + %\vskip \lastskipinotr % hm, gets lost anyway + \else + % we should not discard skips after here; tricky + \fi + \OTRSETsetvsize + \fi} + +\def\OTRSETplacebottomnotes + {\iflastcolumnfootnotes + \ifnum\nofcolumns=\mofcolumns + \ifintermediatefootnotes \placebottomnotes \fi + \fi + \else + \placebottomnotes + \fi} + +\def\OTRSETflushsavednotes + {\iflastcolumnfootnotes + \ifnum\nofcolumns=\mofcolumns + \flushsavednotes + \fi + \else + \flushsavednotes + \fi} + +\def\OTRSETsavenotes + {\iflastcolumnfootnotes + \ifnum\nofcolumns=\mofcolumns \else + \savenotes + \fi + \fi} + +\appendtoks \OTRSETflushsavednotes \to \OTRSETeverystartofcolumn + +\def\OTRSETnaturalflush + {\bgroup + \forgetall % new, needed ! + \setbox0\vbox to \columnfreecells\lineheight + {\vskip-\topskip + \vskip\lineheight + \prevdepth\strutdp + \unvbox\normalpagebox + \vfill}% + \setbox2\hbox + {\OTRSETplacebottomnotes}% + \setbox\scratchbox\hbox + {\wd0\zeropoint\box0\box2}% + \dp\scratchbox\strutdp + \OTRSEThandleflushedtext\plusone + \egroup} + +\newcount\lastcolumnlastcell + +\def\OTRSEThandleflushedtext#1% + {\getnoflines{\ht\scratchbox}% + %\wd\scratchbox\textwidth % geen \hsize kan < zijn in bv split tabulate + \wd\scratchbox\OTRSETlocalwidth\mofcolumns + \doOTRSETsetgridcells + {\copy\placeholderboxf} + \mofcolumns\columnfirstcell\plusone\noflines + {\registeredtextarea1\columnfirstcell\scratchbox}% == \hbox / tricky htcorr == \columnfirstcell + \global\columnlastcell\columnfirstcell + \global\advance\columnlastcell \noflines + \global\lastcolumnlastcell\columnlastcell + \global\advance\lastcolumnlastcell \minusone + % find next (acceptable) gap, todo: deadcycle + \ifcase#1\else + \OTRSETfillgapsbetweencells\mofcolumns\columnlastcell + \fi + \OTRSETfindnextgap + % \message{\the\mofcolumns,\the\columnfirstcell,\the\columnfreecells}% + % \wait + % we cannot adapt the hsize since it may have changed (like + % inside a tabulate) so we only change it when there is a + % reason to do so + \OTRSETsynchronizehsize + \OTRSETsetvsize} + +\def\OTRSETfindnextgap + {\OTRSETsetfreecells\mofcolumns\columnlastcell + \ifsomefreecolumncells + % okay + \bubbleOTRSETmarks % not robust because we reenter + \else + \registerOTRSETmarks % not robust because we reenter + \global\advance\mofcolumns \plusone + \ifnum\mofcolumns>\nofcolumns + \OTRSETdoflush + \global\columnlastcell\plusone + \global\columnfirstcell\zerocount + \OTRSETdoflushfloats + \else + \the\OTRSETeverystartofcolumn + \global\columnlastcell\plusone + \global\columnfirstcell\zerocount + \fi + \fi} + +\let\OTRSETcheckfreelines\donothing + +\def\OTRSETfillgapsbetweencells#1#2% col + {\ifnum\columngaplimit>\zerocount + \donefalse + \dostepwiserecurse{#2}\columnmaxcells\plusone + {\OTRSETdoifcellelse{#1}\recurselevel + {\ifdone + \!!countb\recurselevel \advance\!!countb -\!!counta\relax + \ifnum\!!countb>\plusone + \advance\!!countb \minusone + \ifnum\!!countb<\columngaplimit\relax + \!!countb\recurselevel \advance\!!countb \minusone + \dostepwiserecurse\!!counta\!!countb\plusone + {\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}% + %\message{[gap]}% + \fi + \fi + \fi + \donefalse} + {\ifdone \else + \donetrue + \!!counta\recurselevel + \fi}}% + \fi} + +\appendtoks + \OTRSETfillgapsbetweencells\mofcolumns\plusone +\to \OTRSETeverystartofcolumn + +%\def\OTRSETfreezeminimumgap#1% +% {\OTRSETgetmaxfreecells{#1}{1}% +% \ifnum\columnmaxfreecells>0 +% \!!countb=\columnfrmfreecells +% \!!counta=\!!counta \advance\!!counta -\columnmaxfreecells +% \dorecurse{\columnmaxcells} +% {\ifnum\recurselevel<\!!counta\relax +% \donetrue +% \else\ifnum\recurselevel>\!!countb +% \donetrue +% \else +% \donefalse +% \fi\fi +% \ifdone +% \OTRSETdoifcellelse{#1}{\recurselevel} +% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}% +% \fi}% +% \fi} +% +%\def\OTRSETfillgaps#1#2#3% col from to +% {\dostepwiserecurse{#2}{#3}{1} +% {\OTRSETdoifcellelse{#1}{\recurselevel} +% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}}} +% +%\def\OTRSETfillbotgaps#1#2% col first +% {\OTRSETfillgaps{#1}{#2}{\columnmaxcells}} +% +%\def\OTRSETfilltopgaps#1#2% col last +% {\OTRSETfillgaps{#1}{1}{#2}} + +\newif\ifspancolumnslots \spancolumnslotstrue +\newif\ifcheckcolumnspan \checkcolumnspantrue + +\def\OTRSETcheckwidthgap#1#2% box size + {\ifcheckcolumnspan + \bgroup + \scratchdimen#2% + \advance\scratchdimen-\wd#1\relax + \ifdim-10\scaledpoint>\scratchdimen + \egroup + \else\ifdim10\scaledpoint<\scratchdimen + \egroup + \else + \egroup + \wd#1=#2% + \fi\fi + \fi} + +\def\OTRSETcheckcolumnslot#1% + {\enoughcolumncellstrue + \ifspancolumnslots\else + \OTRSETcheckwidthgap#1\hsize + \ifdim\wd#1>\hsize + \enoughcolumncellsfalse + \fi + \fi + \ifenoughcolumncells + \getnoflines\pagetotal + \scratchcounter\noflines + \getnoflines{\ht#1}% + \columnvcells\noflines + \columnhcells\plusone + \advance\scratchcounter \columnvcells \relax + \ifnum\scratchcounter>\columnfreecells + \enoughcolumncellsfalse + \fi + \fi} + +\def\OTRSETstoreincolumnslotPAGE#1% + {\ifenoughcolumncells + % to do + \OTRSETsavebox{#1}% + \else + \OTRSETsavebox{#1}% + \fi} + +\def\OTRSETstoreincolumnslotTOPS#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETcheckcolumnslot{#1}% + \ifenoughcolumncells + \OTRSETcheckcolumnspace\mofcolumns\columnfirstcell{#1}% + \fi + \ifenoughcolumncells + \OTRSETsetgridcells\mofcolumns\columnfirstcell\columnhcells\columnvcells + {\hbox{\copy#1}}% + \OTRSETsetvsize + \else + \OTRSETsavebox{#1}% + \fi} + +\def\OTRSETstoreincolumnslotBOTS#1% + {\OTRSETprepareforcolumnslot3{#1}% + \edef\savedcolumnlastcell{\the\columnlastcell}% + \OTRSETcheckcolumnslot{#1}% + \ifenoughcolumncells + \advance\columnlastcell -\columnvcells \advance\columnlastcell \plusone +% \OTRSETcheckcolumnspace\mofcolumns\columnfirstcell{#1}% + \OTRSETcheckcolumnspace\mofcolumns\columnlastcell{#1}% + \fi + \ifenoughcolumncells + \OTRSETsetgridcells\mofcolumns\columnlastcell\columnhcells\columnvcells{\copy#1}% + \OTRSETfillgapsbetweencells\mofcolumns\savedcolumnlastcell % -) + \OTRSETsetvsize + \else + \columnlastcell\savedcolumnlastcell + \OTRSETsavebox{#1}% + \fi} + +\newdimen\totalcolumnspace + +\def\columnspacetopoffset{0} +\def\columnspacebotoffset{0} + +\def\OTRSETcheckcolumnspace#1#2#3% col row box + {\columnhcells\plusone + \totalcolumnspace\zeropoint + \scratchcounter#1% + \enoughcolumncellstrue + \doloop + {\advance\totalcolumnspace \OTRSETlocalwidth\scratchcounter\relax % needed +\OTRSETcheckwidthgap#3\totalcolumnspace + \ifnum\wd#3>\totalcolumnspace\relax + \ifnum\scratchcounter=\nofcolumns + \enoughcolumncellsfalse + \exitloop + \else + \advance\columnhcells \plusone + \advance\scratchcounter \plusone + \advance\totalcolumnspace \OTRSETgetparameter\c!distance\scratchcounter + \fi + \else + \exitloop + \fi}% + \ifenoughcolumncells + \getnoflines{\ht#3}% + \columnvcells\noflines + \OTRSETcheckcolumncells{#1}{#2}\columnhcells\columnvcells + \fi} + +\def\OTRSETcheckcolumncells#1#2#3#4% col row wid hei + {\!!countd#1\advance\!!countd#3\advance\!!countd\minusone + \!!counte#2\advance\!!counte#4\advance\!!counte\minusone + \ifnum\!!counte>\columnmaxcells\relax + \enoughcolumncellsfalse + \else + \enoughcolumncellstrue +%\let\columnspacetopoffset\zerocount +%\scratchcounter#2\advance\scratchcounter\minusone +%\ifnum\scratchcounter>0 +% \dostepwiserecurse{#1}\!!countd\plusone +% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint +% \let\columnspacetopoffset\plusone +% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint +% \let\columnspacetopoffset\plusone +% \fi\fi}% +% \advance\!!counte \columnspacetopoffset \relax +% \advance\columnvcells \columnspacetopoffset \relax +%\fi +%\let\columnspacebotoffset\zerocount +%\scratchcounter\!!counte +%\advance\scratchcounter \columnvcells \relax +%\ifnum\scratchcounter>\columnmaxcells\else +% \dostepwiserecurse{#1}\!!countd\plusone +% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint +% \let\columnspacebotoffset\plusone +% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint +% \let\columnspacebotoffset\plusone +% \fi\fi}% +% \advance\!!counte \columnspacebotoffset \relax +% \advance\columnvcells \columnspacebotoffset \relax +%\fi + \dostepwiserecurse{#1}\!!countd\plusone % cols + {\ifenoughcolumncells + \!!countf\recurselevel\relax + \dostepwiserecurse{#2}\!!counte\plusone % rows + {\ifenoughcolumncells + \OTRSETdoifcellelse\!!countf\recurselevel + {\enoughcolumncellsfalse}{}% + \fi}% + \fi}% + \fi} + +\def\OTRSETsetpreferedcolumnslot#1#2% + {\doifsomething{#1}{\edef\preferedcolumn{#1}}% + \doifsomething{#2}{\edef\preferedrow {#2}}} + +\OTRSETsetpreferedcolumnslot{\nofcolumns}{1} % default ? + +\let\pofcolumns\mofcolumns +\let\qofcolumns\mofcolumns + +\newif\ifquitincurrentcolumn + +\def\OTRSETstoreincolumnslotLRTB#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \mofcolumns\nofcolumns+\currenthcell + \plusone\columnmaxcells+\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotLRBT#1% + {\OTRSETprepareforcolumnslot3{#1}% + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \mofcolumns\nofcolumns+\currenthcell + \columnmaxcells\plusone-\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotRLTB#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETflushtextsofar + \OTRSETcheckprefered + \OTRSETstoreincolumnslotindeed + \nofcolumns\qofcolumns-\currenthcell + \plusone\columnmaxcells+\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotRLBT#1% + {\OTRSETprepareforcolumnslot3{#1}% + \OTRSETflushtextsofar + \OTRSETcheckprefered + \OTRSETstoreincolumnslotindeed + \nofcolumns\qofcolumns-\currenthcell + \columnmaxcells\plusone-\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotTBLR#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \plusone\columnmaxcells+\currentvcell + \mofcolumns\nofcolumns+\currenthcell{#1}} + +\def\OTRSETstoreincolumnslotTBRL#1% + {\OTRSETprepareforcolumnslot1{#1}% + \OTRSETflushtextsofar + \OTRSETcheckprefered + \OTRSETstoreincolumnslotindeed + \plusone\columnmaxcells+\currentvcell + \nofcolumns\qofcolumns-\currenthcell{#1}} + +\def\OTRSETstoreincolumnslotBTLR#1% + {\OTRSETprepareforcolumnslot3{#1}% + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \columnmaxcells\plusone-\currentvcell + \mofcolumns\nofcolumns+\currenthcell{#1}} + +\def\OTRSETstoreincolumnslotBTRL#1% + {\OTRSETprepareforcolumnslot3{#1}% + \OTRSETflushtextsofar + \OTRSETcheckprefered + \OTRSETstoreincolumnslotindeed + \columnmaxcells\plusone-\currentvcell + \nofcolumns\qofcolumns-\currenthcell{#1}} + +\def\OTRSETstoreincolumnslotFXTB#1% fixed column + {\OTRSETcheckprefered + \OTRSETdoifcellelse\pofcolumns\plusone + {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot1}{#1}% % 1/2 dependent of place, todo + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \pofcolumns \pofcolumns +\currenthcell + \preferedrow\columnmaxcells+\currentvcell{#1}} + +\def\OTRSETstoreincolumnslotFXBT#1% fixed column + {\OTRSETcheckprefered + \OTRSETdoifcellelse\pofcolumns\columnmaxcells + {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot3}{#1}% % 3/2 dependent of place, todo + \OTRSETflushtextsofar + \OTRSETstoreincolumnslotindeed + \pofcolumns \pofcolumns +\currenthcell + \columnmaxcells\preferedrow-\currentvcell{#1}} + +% \def\OTRSETstoreincolumnslotHERE#1% fixed column +% {\OTRSETprepareforcolumnslot2{#1}% +% \OTRSETflushtextsofar +% \getnoflines\pagetotal \advance\noflines\columnfirstcell +% \OTRSETstoreincolumnslotindeed +% \mofcolumns\mofcolumns+\currenthcell +% \noflines\columnmaxcells+\currentvcell{#1}% +% \OTRSETsetvsize} + +\chardef\OTRSETforcefixedfloats=0 + +\def\OTRSETstoreincolumnslotHERE#1% fixed column + {\ifcase\OTRSETforcefixedfloats + \OTRSETstoreincolumnslotSOMEWHERE2{#1}% + \else + \OTRSETstoreincolumnslotFIXD{#1}% + \fi} + +% this one looses too wide graphics +% +% \def\OTRSETstoreincolumnslotFIXD#1% fixed column +% {\OTRSETprepareforcolumnslot2{#1}% +% % no flush text sofar here, beware: no width test +% \snaptogrid\vbox{\box#1}} +% +% still imperfect + +\def\OTRSETstoreincolumnslotFIXD#1% fixed column + {\OTRSETflushtextsofar + \ifdim\wd#1>\textwidth + \OTRSETstoreincolumnslotSOMEWHERE2{#1}% + \else + % crappy test / needed for o-pbu-f / will be replaced + \getnoflines{\ht#1}% + \scratchdimen\noflines\lineheight + \advance\scratchdimen\lineheight + \advance\scratchdimen\pagetotal\relax + \ifdim\scratchdimen<\pagegoal + %OTRSETprepareforcolumnslot3{#1}% + %ruledvskip\columnslotspacing\lineheight + \blank[\columnslotspacing*\v!line]% + \snaptogrid\hbox to \hsize{\hss\box#1\hss}% strange, why the centering + \blank[\columnslotspacing*\v!line]% + \else + \OTRSETstoreincolumnslotSOMEWHERE2{#1}% + \fi + \fi} + +\def\OTRSETstoreincolumnslotSOMEWHERE#1#2% + {\OTRSETprepareforcolumnslot{#1}{#2}% + \OTRSETflushtextsofar + \getnoflines\pagetotal \advance\noflines\columnfirstcell + \OTRSETstoreincolumnslotindeed + \mofcolumns\mofcolumns+\currenthcell + \noflines\columnmaxcells+\currentvcell{#2}% + \OTRSETsetvsize} + +\def\OTRSETcheckprefered + {\ifnum\preferedcolumn<\mofcolumns + \let\pofcolumns\mofcolumns + \else + \let\pofcolumns\preferedcolumn + \fi + \ifquitincurrentcolumn + \ifnum\mofcolumns=\nofcolumns + \def\qofcolumns{\mofcolumns}% + \else + \scratchcounter\mofcolumns + \advance\scratchcounter \plusone + \edef\qofcolumns{\the\scratchcounter}% + \fi + \else + \let\qofcolumns\mofcolumns + \fi} + +\def\OTRSETstoreincolumnslotindeed#1#2#3#4#5#6#7#8#9% + {\OTRSETcheckprefered + \enoughcolumncellsfalse + \donefalse + \dostepwiserecurse{#1}{#2}{#31} + {\ifdone + \exitloop + \else + #4=\recurselevel + \dostepwiserecurse{#5}{#6}{#71} + {\ifdone + \exitloop + \else + #8=\recurselevel + \OTRSETcheckcolumnspace\currenthcell\currentvcell{#9}% + \ifenoughcolumncells \donetrue \fi + \fi}% + \fi}% + \ifdone + \enoughcolumncellstrue + \else + \enoughcolumncellsfalse + \fi + \ifenoughcolumncells +% \ifnum\columnspacetopoffset>0\message{[+++]}\fi +% \ifnum\columnspacebotoffset>0\message{[---]}\fi +% \OTRSETsetgridcells\currenthcell\currentvcell\columnhcells\columnvcells +% {\vbox +% {\ifcase\columnspacetopoffset\else\ruledvskip\columnspacetopoffset\lineheight\fi +% \copy#9 +% \ifcase\columnspacebotoffset\else\ruledvskip\columnspacebotoffset\lineheight\fi}}% + \OTRSETsetgridcells\currenthcell\currentvcell\columnhcells\columnvcells + {\copy#9}% + \ifnum\currenthcell=\mofcolumns\relax + \ifdim\ht\OTRSETsavedfootnotes>\zeropoint + \OTRSETsetfreecells\mofcolumns\columnfirstcell + \ifsomefreecolumncells + \getnoflines{\ht\OTRSETsavedfootnotes}\relax + \ifnum\columnfreecells<\noflines + \global\somefreecolumncellsfalse + \else + %\message{[flt]}% float + \fi + \fi + \ifsomefreecolumncells + % ok, enough room for notes + %\message{[flt]}% float + \else % ? + \OTRSETsavebox{#9}% + \OTRSETerasegridcells\currenthcell\currentvcell\columnhcells\columnvcells + %\message{[clr]}% save box + \fi + \else + %\message{[flt]}% float + \fi + \else + %\message{[flt]}% float + \fi + \OTRSETsetvsize + %\message{[fnt]}% float + \else + %\message{[rej]}% save box + \OTRSETsavebox{#9}% + \fi} + +\chardef\columnslotspacing \plusone + +\def\OTRSETstoreincolumnslot#1% #2 % {method} {box} % alleen last + {% no messing around here + % \dp#2=\zeropoint + % \ifcase\columnslotspacing\else + % \setbox#2=\vbox spread \columnslotspacing\lineheight + % {\vss\box#2\vss}% + % \fi + % and don't change this any more +% \doifdefinedelse{\strippedcsname\OTRSETstoreincolumnslot#1} +% {\getvalue{\strippedcsname\OTRSETstoreincolumnslot#1}{#2}} +% {\OTRSETstoreincolumnslotUNKNOWN{#2}}} + \executeifdefined{\strippedcsname\OTRSETstoreincolumnslot#1} + \OTRSETstoreincolumnslotUNKNOWN} % {#2}} + +\def\OTRSETstoreincolumnslotUNKNOWN#1% + {\OTRSETprepareforcolumnslot2{#1}\copy#1} % {} ? + +% \def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag +% {\dp#2\zeropoint +% \ifcase\columnslotspacing\else +% \scratchdimen\columnslotspacing\lineheight +% \ifnum#1=2 \scratchdimen2\scratchdimen \fi +% \setbox#2\vbox spread \scratchdimen +% {\ifnum#1>1\vss\fi\box#2\relax\ifnum#1<3\vss\fi}% +% \fi} + +\def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag + {\dp#2\zeropoint + \ifcase\columnslotspacing\else + \scratchdimen\columnslotspacing\lineheight + \ifnum#1=2 \scratchdimen2\scratchdimen \fi + \begingroup + \advance\scratchdimen\ht#2\relax + \ifdim\scratchdimen<\columnmaxcells\lineheight + \endgroup \setbox#2\vbox spread \scratchdimen \bgroup + \else + \endgroup \setbox#2\vbox to \columnmaxcells\lineheight \bgroup + \vskip\strutdepth + \fi + \ifnum#1>1\vss\fi + \box#2\relax + \ifnum#1<3\vss\fi + \egroup + \fi} + +\def\OTRSETdocheckiffloatfits % eigenlijk moet else float anders + {\global\ifnofloatpermitted\roomforfloatfalse\else\roomforfloattrue\fi} + +\def\OTRSETunpreparebox#1% + {\ifhbox#1% spans and so + \global\setbox\floatbox\vbox{\box#1}% + \else + \setbox\scratchbox\vbox + {\unvbox#1\unskip\unskip\unskip + \global\setbox\floatbox\lastbox}% + \fi} + +\def\OTRSETsavebox#1% clean up the skips + {\OTRSETunpreparebox{#1}% + \dosavefloat} + +\def\OTRSETresavebox#1% clean up the skips + {\OTRSETunpreparebox{#1}% + \doresavefloat} + +\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge + {\iftestfloatbox\ruledhbox\fi{\box\floatbox}} + +\def\OTRSETdoflushfloats + {\bgroup + \def\OTRSETsavebox##1{\!!doneafalse}% + \doloop + {\ifsomefloatwaiting +\OTRSETskipstart + \dogetfloat + \ifdim\wd\floatbox>\zeropoint + \!!doneatrue + \dp\floatbox\zeropoint + \OTRSETstoreincolumnslot{TBLR}\floatbox + \if!!donea + %\message{[flu]}% + \else + \OTRSETresavebox\floatbox + \exitloop + \fi + \else + %\message{[err]}% happens but why? + \fi + \else + \exitloop + \fi} + \egroup} + +\newif\ifcentergridcells \centergridcellstrue + +\newif\ifcentergridcellonly \centergridcellonlyfalse +\newif\ifautocentergridcellonly \autocentergridcellonlytrue + +\def\OTRSETcentergridcells + {\ifcentergridcells + \dorecurse\nofcolumns + {\currenthcell\recurselevel + \ifautocentergridcellonly + % we prevent centering when the next column is empty + % to be checked ! ! ! ! + \advance\currenthcell \plusone + \centergridcellonlytrue + \ifnum\currenthcell>\nofcolumns + % ok already + \else + % only span if there is a next column with content + \dorecurse\columnmaxcells + {\ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint + \centergridcellonlyfalse + \else\ifdim\dp\OTRSETgridcell\currenthcell\currentvcell>\zeropoint + \centergridcellonlyfalse + \fi\fi}% + \fi + \fi + \currenthcell\recurselevel + \dorecurse\columnmaxcells + {\currentvcell\recurselevel\relax + \ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint + \ifdim\dp\OTRSETgridcell\currenthcell\currentvcell=\zeropoint + \bgroup + \setbox\scratchbox\OTRSETgetgridcell\currenthcell\currentvcell + \getnoflines{\ht\scratchbox}% + \!!counta\currentvcell + \advance\!!counta -\noflines + \advance\!!counta \plusone + % first col always ok + \!!countb\currenthcell + \!!countc\currenthcell + \advance\!!countc \plusone + \!!donebtrue + \ifcentergridcellonly + \!!countc\maxdimen + \fi + \dostepwiserecurse\!!countc\nofcolumns\plusone + {\if!!doneb + \let\xrecurselevel\recurselevel + \dostepwiserecurse\!!counta\currentvcell\plusone + {\ifdim\ht\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint + \!!donebfalse + \else\ifdim\wd\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint + \!!donebfalse + \fi\fi}% + \if!!doneb + \!!countb\xrecurselevel + \fi + \fi}% + \totalcolumnspace\OTRSETlocalwidth\currenthcell + \dostepwiserecurse\!!countc\!!countb\plusone + {\advance\totalcolumnspace \OTRSETlocalwidth\recurselevel + \advance\totalcolumnspace \OTRSETgetparameter\c!distance\recurselevel}% + \ifdim\totalcolumnspace>\wd\scratchbox + \setbox\scratchbox\hbox to \totalcolumnspace{\hss\box\scratchbox\hss}% + \fi + \OTRSETsetgridcell\currenthcell\currentvcell\box\scratchbox + \egroup + \fi + \fi}}% + \fi} + +\def\OTRSETinitializecolumns% once per page + {\columnspreadtrue % todo + \ifcolumnspread + \global\rofcolumns\getvalue{\??mc\OTRSETidentifier\c!nright}% + \global\lofcolumns\getvalue{\??mc\OTRSETidentifier\c!nleft}% + \global\tofcolumns\rofcolumns \relax + \ifodd\realpageno\relax + \global\nofcolumns\rofcolumns + \else + \global\advance\tofcolumns\lofcolumns + \global\nofcolumns\lofcolumns + \fi + \else + \global\nofcolumns\getvalue{\??mc\OTRSETidentifier\c!n}% + \global\rofcolumns\nofcolumns + \global\lofcolumns\nofcolumns + \global\tofcolumns\nofcolumns + \fi + \OTRSETassignwidths + \global\mofcolumns\plusone + \columnerasegridboxes} + +% vanaf hier: + +\def\definecolumnset + {\dodoubleargument\dodefinecolumnset} + +\def\dodefinecolumnset[#1][#2]% + {\getparameters[\??mc#1] + [\c!direction=\v!right, + \c!balance=\v!no, + \c!distance=1.5\bodyfontsize, % controleren + \c!n=2, + \c!nleft=\getvalue{\??mc#1\c!n}, + \c!nright=\getvalue{\??mc#1\c!n}, + \c!width=\v!fit, + \c!lines=0, + \c!start=0, + #2]% + \dorecurse{\getvalue{\??mc#1\c!nleft}} % todo + {\dododefinecolumnset[#1][\recurselevel]}% + \dorecurse{\getvalue{\??mc#1\c!nright}} % todo + {\dododefinecolumnset[#1][\recurselevel]}% + % redo framed settings + \setupcolumnset[#1][1][\c!distance=\!!zeropoint]} + +\def\dododefinecolumnset[#1][#2]% + {\presetlocalframed + [\??mc#1#2]% + \setupcolumnset + [#1][#2] + [\c!offset=\v!overlay, + \c!frame=\v!off, + \c!align=, + \c!lines=0,% really needed since c!regels is now part of framed + \c!width=\getvalue{\??mc#1\c!width}, + \c!distance=\getvalue{\??mc#1\c!distance}]} + +\def\setupcolumnset + {\dotripleargument\dosetupcolumnset} + +\def\dosetupcolumnset[#1][#2][#3]% + {\ifthirdargument + \def\docommand##1% + {\doifelse{##1}\v!each + {\dorecurse{\getvalue{\??mc#1\c!n}}{\docommand\recurselevel}} + {\getparameters[\??mc#1##1][#3]}}% + \processcommalist[#2]\docommand + \else + \getparameters[\??mc#1][#2]% + \fi} + +\definecolumnset[\s!default][\c!n=2] % fallback + +\def\OTRSETgotonextpage + {\vfill\eject + \relax\ifnum\mofcolumns>\plusone + \OTRSETgotocolumn[\v!last]% + \ifnum\mofcolumns>\plusone + \OTRSETgotocolumn[\v!force]% + \fi + \fi} + +\let\OTRSETgotonextpageX\OTRSETgotonextpage % will become obsolete + +\def\OTRSETgotocolumn + {\dosingleempty\doOTRSETgotocolumn} + +\def\doOTRSETgotoCOLROW#1% |* + {\bgroup % really needed + \splitstring#1\at*\to\column\and\row + \bgroup + \ifx\column\empty\else\expanded{\doOTRSETgotoCOLUMN{\column}}\fi + \egroup + \bgroup + \ifx\row \empty\else\expanded{\doOTRSETgotoROW {\row }}\fi + \egroup + \egroup} + +\def\doOTRSETgotoCOLUMN#1% + {\ifnum\mofcolumns=#1\else + \vfill\eject % \doejectpage\eject + \doloop + {\ifnum\mofcolumns=#1\relax + \exitloop \else \OTRSETdummycolumn + \fi}% + \fi} + +\def\doOTRSETgotoROW#1% + {\ifnum#1>1 + \scratchcounter\zerocount + \currenthcell\mofcolumns + \currentvcell#1\advance\currentvcell \minusone + \dorecurse\currentvcell + {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing + {\advance\scratchcounter\plusone}} + \getnoflines\pagetotal + \advance\scratchcounter-\noflines + \ifnum\scratchcounter>\zerocount + \dorecurse\scratchcounter{\line{\strut}}% + \fi + \fi + \OTRSETsetvsize} + +\def\doOTRSETgotocolumn[#1]% yes|force|first|last||* + {\processallactionsinset + [#1] + [ \v!yes=>\OTRSETdummycolumn, + \v!no=>,% not supported + \v!force=>\OTRSETdummycolumn, + \v!first=>\expanded{\doOTRSETgotoCOLUMN{1}}, + \v!last=>\expanded{\doOTRSETgotoCOLUMN{\the\nofcolumns}}, + \s!default=>\OTRSETdummycolumn, + \s!unknown=>\expanded{\doOTRSETgotoCOLROW{\commalistelement}}]} + +% to be documented and tested, not yet that robust + +% \def\OTRSETgotocell#1#2% +% {\endgraf +% \gdef\gotocellcounter{0}% +% \doloop +% {\ifnum\mofcolumns<#1\relax +% \doglobal\increment\gotocellcounter\relax +% \ifnum\gotocellcounter>#1\relax +% \line{\strut}\crlf +% \line{\strut}\crlf +% \column +% \writestatus{columnset}{quitting goto cell}% +% \exitloop +% \else +% \column +% \fi +% \else +% \exitloop +% \fi}% +% \ifnum\mofcolumns=#1\relax +% \ifnum#2>1 +% \scratchcounter\zerocount +% \currenthcell\mofcolumns +% \currentvcell#2\advance\currentvcell \minusone +% \dorecurse\currentvcell +% {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing +% {\advance\scratchcounter\plusone}} +% \getnoflines\pagetotal +% \advance\scratchcounter-\noflines +% \ifnum\scratchcounter>\zerocount +% \dorecurse\scratchcounter{\line{\strut}}% +% \fi +% \fi +% \fi +% \OTRSETsetvsize} + +\def\OTRSETgotocell#1#2% obsolete: now \column[#1*#2] + {\endgraf + \doOTRSETgotoCOLUMN{#1}% + \doOTRSETgotoROW {#2}} + +\def\OTRSETdummycolumn + {\verticalstrut + \vskip-\struttotal + \vfill + \eject} + +\newcounter\columnsetlevel +\let\currentcolumnset\empty +\chardef\OTRSETfinish\zerocount + +\def\startcolumnset + {\dodoubleempty\dostartcolumnset} + +\def\dostartcolumnset[#1][#2]% + {\increment\columnsetlevel\relax + \globallet\localcolumnmaxcells\!!zerocount + \global\chardef\OTRSETfinish\zerocount + \resetOTRSETmarks + \ifnum\columnsetlevel=\plusone + \bgroup + \saveinterlinespace + \globallet\columnsetpage\!!plusone + \def\currentcolumnset{#2}% + \insidecolumnstrue % will be different flag in addition + \activateotr{SET}{ONE}% andere naam, activate or so + \doifelsenothing{#1} + {\globallet\OTRSETlist\s!default} + {\xdef\OTRSETlist{#1}}% + \OTRSETstartnextpage + \OTRSETassignwidths + \OTRSETsethsize + \else + \bgroup + \fi} + +% \setuplayout[grid=yes] \definecolumnset[example] \showgrid + +% \starttext +% \startcolumnset[example] +% \input knuth \endgraf \input knuth +% \placetable{table}{\framed[width=\makeupwidth,height=4cm]{Hello}} +% \input knuth \endgraf \input knuth +% \stopcolumnset +% \input knuth \endgraf \input knuth +% \stoptext + + +\def\OTRSETflushleftovers % new per 13/4/2006 + {\OTRSETdoifcellelse{1}{1} + {\bgroup + \OTRSETcentergridcells + \chardef\OTRSETbalancemethod\plusone + \OTRSETreducegridbox + \global\setbox\OTRfinalpagebox\OTRSETmakegridbox + \global\ht\OTRfinalpagebox\textheight % signals output that there is content + \OTRSETdofinaloutput + \globallet\OTRSETbalht\zeropoint + \egroup} + {}} + +\def\stopcolumnset + {\relax + \ifnum\columnsetlevel=\plusone + \endgraf % needed, else wrong vsize in one par case + \global\chardef\OTRSETfinish\plusone + % no, extra page \pagebreak % (test on pascal toc) + \dostopcolumnset + \egroup + \global\notelimittrue % brrr, untested and fuzzy + \setvsize + \sethsize + \ifvoid\OTRfinalpagebox\else + % probably balanced + \ifdim\ht\OTRfinalpagebox<\textheight + \snaptogrid[\v!page]\hbox{\box\OTRfinalpagebox}% + \else + \box\OTRfinalpagebox + \fi + \fi + \global\chardef\OTRSETfinish\zerocount + \ifsomefloatwaiting \setvsize \pagebreak \setvsize \fi + \OTRSETflushleftovers + \else + \egroup + \fi + \decrement\columnsetlevel\relax} + +\chardef\OTRSETbalancemethod\zerocount + +\def\dostopcolumnset + {%\OTRSETdofinalflushfloats % yes/no + \ifcase\OTRSETbalancemethod + \OTRSETnobalance + \else + \OTRSETdobalance + \fi} + +\def\OTRSETdobalance + {\OTRSETnobalance} + +\def\localcolumnmaxcells{0} + +% currently line represents real line, i.e. on the grid, and +% not something noflines (also, watch out for switching from +% 2-3 columns on one page with both sets balanced: the +% second set does not see the first set + +% \def\OTRSETinitbalancing +% {\ifcase\OTRSETbalancemethod\or +% \let\savedcolumnmaxcells\columnmaxcells +% \ifnum\realpageno=\balancingpageno\relax +% \ifnum\mofcolumns=\plusone +% \dorecurse\nofcolumns +% {\!!counta\recurselevel\relax +% \!!countb\getvalue{\??mc\OTRSETidentifier\number\!!counta\c!regels}\relax +% \ifcase\!!countb +% \!!countb\getvalue{\??mc\OTRSETidentifier\c!regels}\relax +% \fi +% \ifcase\!!countb +% \!!countb \savedcolumnmaxcells\relax +% \fi +% % can be an option: absolute versus relative +% \ifnum\OTRSETbalancemethod=\plusthree +% \advance\!!countb\precolumnlines +% \ifnum\!!countb>\localcolumnmaxcells\relax +% \xdef\localcolumnmaxcells{\the\!!countb}% +% \fi +% \advance\!!countb \plusone +% \dostepwiserecurse\!!countb\columnmaxcells\plusone +% {\ifvoid\OTRSETgridcell\!!counta\recurselevel +% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe +% \fi}% +% \else +% \globallet\localcolumnmaxcells\columnmaxcells +% \advance\!!countb-\columnmaxcells +% \!!countb-\!!countb +% \advance\!!countb \minusone +% \ifnum\!!countb>\zerocount +% \dostepwiserecurse\plusone\!!countb\plusone +% {\ifvoid\OTRSETgridcell\!!counta\recurselevel +% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe +% \fi}% +% \fi +% \fi}% +% \OTRSETsetvsize % ! ! ! +% \fi +% \fi +% \fi} +% +% \def\OTRSETpresetbalancing +% {\doifvaluesomething{\??mc\OTRSETidentifier\c!regels}% +% {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]% +% \ifnum\commalistsize>\plusone +% \scratchcounter\zerocount +% \def\docommand##1% +% {\advance\scratchcounter\plusone +% \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}% +% \processcommacommand +% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommand +% \setvalue{\??mc\OTRSETidentifier\c!regels}{0}% +% \fi}} + +% don't loose empty 1page/1column with area (example **) +% +% \definecolumntextarea[title][x=1,y=4,nx=2,ny=7,state=start] +% \setupcolumntextareatext[title][\vtop to 5cm{a\\b\\b\\d}] +% +% \starttext +% \startcolumnset \dorecurse{1}{\input tufte \par} \stopcolumnset +% \stoptext + +% better: + +\def\definecolumnsetarea {\definecolumntextarea} +\def\setupcolumnsetarea {\setupcolumntextarea} +\def\setupcolumnsetareatext{\setupcolumntextareatext} + +% so this will be changed + +% \def\OTRSETnobalance +% {\iflastcolumnfootnotes % testen ! optie +% % inhibit flush of floats ! +% % todo: nothing if no footnotes, else empty page +% \dostepwiserecurse\mofcolumns\nofcolumns\plusone +% {\vskip-\struttotal\verticalstrut\vfill\eject}% +% \else +% \ifdim\pagetotal>\zeropoint % no, see example ** +% \ifnum\mofcolumns=\nofcolumns +% \OTRSETflushfinalfootnotes +% \else +% % probably todo +% \fi +% \vfill +% \eject +% % brr, may result in empty page after nicely fit text +% % or if left, then lost of first column only text +% \ifnum\mofcolumns>1 +% \OTRSETdofinalflush +% \OTRSETdofinaloutput +% \fi +% \fi +% \fi} + +\def\OTRSETnobalance + {\iflastcolumnfootnotes % testen ! optie + % inhibit flush of floats ! + % todo: nothing if no footnotes, else empty page + \dostepwiserecurse\mofcolumns\nofcolumns\plusone + {\vskip-\struttotal\verticalstrut\vfill\eject}% + \else + \ifnum\mofcolumns>\plusone + \donetrue + \else\ifdim\pagetotal>\zeropoint % too dangerous, we loose data + \donetrue + \else + \donefalse + \fi\fi + \ifdone + \ifnum\mofcolumns=\nofcolumns + \OTRSETflushfinalfootnotes + \else + % probably todo + \fi + \vfill + \eject +\registerOTRSETmarks + % brr, may result in empty page after nicely fit text + % or if left, then lost of first column only text + \ifnum\mofcolumns>\plusone + \OTRSETdofinalflush + \OTRSETdofinaloutput + \fi + \fi + \fi} + +\def\OTRSETstartnextpage + {\doifsomething\OTRSETlist + {\getfromcommacommand[\OTRSETlist][1]% + \global\let\OTRSETidentifier\commalistelement + \doifundefined{\??mc\OTRSETidentifier\c!n} + {\globallet\OTRSETidentifier\s!default}% + \let\newcommalistelement\empty + \doglobal\replaceincommalist\OTRSETlist1% + \OTRSETrestart}} + +\def\OTRSETrestart % weed + {\OTRSETinitializefeatures + \OTRSETflushpreposttext + \OTRSETinitializecolumns + \OTRSETcheckinsert + \OTRSETcheckgrid + \OTRSETsetvsize + \OTRSETsethsize % or local ? + \OTRSETsetplaceholders + \OTRSEThandlepreposttext + \initializecolumntextareas % name ! + \OTRSETcheckstartcells + \OTRSETsetvsize} + +% \def\OTRSETcheckstartcells +% {\dorecurse\nofcolumns +% {\bgroup +% \mofcolumns\recurselevel +% \scratchcounter\currentcolumnstartcell % uses \mofcolumns, returns 1 or more +% \advance\scratchcounter \minusone +% \dorecurse\scratchcounter +% {\OTRSETdoifcellelse\mofcolumns\recurselevel +% \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}% +% \egroup}} + +\def\OTRSETcheckstartcells + {\dorecurse\nofcolumns + {\bgroup + \mofcolumns\recurselevel +\OTRSETsetcorrectnofcells\currentcolumnstartcell +\advance\scratchcounter \minusone + \dorecurse\scratchcounter + {\OTRSETdoifcellelse\mofcolumns\recurselevel + \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}% + \egroup}} + +% \OTRSEToutput +% {\dontcomplain % new, get rid of overfull message (to be sorted out) +% \OTRSETnaturalflush +% %\OTRSETstartnextpage +% \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) +% \OTRSETcheckfreelines +% \OTRSETchecksidefloat} + +\OTRSEToutput + {\dontcomplain % new, get rid of overfull message (to be sorted out) + \doloop + {\OTRSETnaturalflush + %\OTRSETstartnextpage % no + \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) + \OTRSETcheckfreelines + \ifsomefreecolumncells + \exitloop + \else + % flush page and get rid of more floats if present + \fi}% + \OTRSETchecksidefloat} + +\def\OTRSETinitializefeatures + {% number of lines + % new: raw + \getrawnoflines\textheight\xdef\columnmaxcells{\the\noflines}% + % direction + \doifelsevalue{\??mc\OTRSETidentifier\c!direction}\v!right + {\chardef\columndirection\zerocount} + {\chardef\columndirection\plusone}% + % balancing + \chardef\OTRSETbalancemethod\zerocount + \processaction + [\getvalue{\??mc\OTRSETidentifier\c!balance}] + [ \v!yes=>\chardef\OTRSETbalancemethod\plusone, + \v!top=>\chardef\OTRSETbalancemethod\plustwo, + \v!bottom=>\chardef\OTRSETbalancemethod\plusthree]} + +% keep 'm for a while +% +% \installoutput\OTRSETflushpreposttext +% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}% +% \ifcarryoverfootnotes \else +% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% +% \fi} +% +% to be tested on 'boekinhoud' in 'pascal/demo-bbi' +% +% junk ! ! ! ! ! +% +%\installoutput\OTRSETflushpreposttext +% {\global\setbox\precolumnbox\vbox +% {\unvbox\normalpagebox +% \strut\vskip-2\lineheight\strut}% we want a proper depth +% \ifcarryoverfootnotes \else +% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% +% \fi} +% +% \starttext +% \definecolumnset[two][n=2] +% \startcolumnset[two] \dorecurse{4}{\input tufte } \stopcolumnset +% \input tufte +% \startcolumnset[two] \input tufte \stopcolumnset +% \stoptext +% +% \installoutput\OTRSETflushpreposttext +% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}% +% \global\dp\precolumnbox\strutdepth +% \ifcarryoverfootnotes \else +% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% +% \fi} + +% test: +% +% \definecolumnset[two] [n=2,balance=yes] +% \definecolumnset[three][n=3,balance=yes] +% \setupcolumnset [two] [1] [lines=10] +% \setupcolumnset [two] [2] [lines=10] +% +% \startcolumnset[two] \dorecurse{14}{\input tufte \par} \stopcolumnset +% \startcolumnset[three] \dorecurse{12}{\input tufte \par} \stopcolumnset +% +% with: +% +% \installoutput\OTRSETflushpreposttext +% {%\ifvoid\normalpagebox +% % \global\setbox\precolumnbox\vbox{}% +% %\else +% \global\setbox\precolumnbox\vbox +% {\unvcopy\normalpagebox}% +% \global\setbox\precolumnbox\vbox to \ht\precolumnbox +% {\box\normalpagebox}% +% %\fi +% \global\dp\precolumnbox\strutdepth +% \ifcarryoverfootnotes \else +% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% +% \fi} + +% testcase : pascal demo-bbi, paragraaf/aanduiding koppen + +\ifx\lastskipinotr\undefined \newskip\lastskipinotr \fi + +\installoutput\OTRSETflushpreposttext + {\global\setbox\precolumnbox\vbox + {\unvbox\normalpagebox + \global\lastskipinotr\lastskip}% + \ifdim\lastskipinotr>\zeropoint + \global\setbox\precolumnbox\hbox + {\lower\strutdepth\box\precolumnbox}% + \fi + \global\dp\precolumnbox\strutdepth + \ifcarryoverfootnotes \else + \global\setbox\postcolumnbox\vbox{\placebottomnotes}% + \fi} + +\let\precolumnlines \!!zerocount +\let\postcolumnlines\!!zerocount + +% \def\OTRSEThandlepreposttext +% {\ifdim\ht\precolumnbox>\zeropoint % new +% \getnoflines{\ht\precolumnbox}% +% \edef\precolumnlines{\the\noflines}% +% \doOTRSETsetgridcells +% {\copy\placeholderboxe} +% \plusone\plusone\nofcolumns\noflines +% {\box\precolumnbox}% +% \else +% \let\precolumnlines\!!zerocount +% \fi +% \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line +% \getnoflines{\ht\postcolumnbox}% +% \edef\postcolumnlines{\the\noflines}% +% \advance\columnfreecells -\noflines +% \advance\columnfreecells \plusone +% \doOTRSETsetgridcells +% {\copy\placeholderboxe} +% \plusone\columnfreecells\nofcolumns\noflines +% {\box\postcolumnbox}% +% \else +% \let\postcolumnlines\!!zerocount +% \fi} + +\def\OTRSEThandlepreposttext + {\ifdim\ht\precolumnbox>\zeropoint % new + \getnoflines{\ht\precolumnbox}% + \edef\precolumnlines{\the\noflines}% + \doOTRSETsetgridcells + {\copy\placeholderboxe} + \plusone\plusone\nofcolumns\noflines + % normal version (single column set) + % {\box\precolumnbox}% + % compensated for bodyfont change + {\hbox + {\OTRSETsetcorrectcellht + \raise\scratchdimen\box\precolumnbox}}% + \else + \let\precolumnlines\!!zerocount + \fi + \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line + \getnoflines{\ht\postcolumnbox}% + \edef\postcolumnlines{\the\noflines}% + \advance\columnfreecells -\noflines + \advance\columnfreecells \plusone + \doOTRSETsetgridcells + {\copy\placeholderboxe} + \plusone\columnfreecells\nofcolumns\noflines + {\box\postcolumnbox}% + \else + \let\postcolumnlines\!!zerocount + \fi} + +\def\OTRSETchecksidefloat + {} % {\sidefloatoutput} + +\def\OTRSETfinalsidefloatoutput + {} + +\def\OTRSETcheckgrid + {\topskip1\topskip + \ifforcecolumngrid + \widowpenalty\zerocount + \clubpenalty\zerocount + \brokenpenalty\zerocount + \fi} + +\def\OTRSETcheckinsert + {\iflastcolumnfootnotes + \ifnum\nofcolumns=\mofcolumns + \OTRSETforceinserts + \else + \OTRSETinhibitinserts + \fi + \else + \OTRSETforceinserts + \fi} + +\def\OTRSETforceinserts + {\enablenotes} + +\def\OTRSETinhibitinserts + {\disablenotes} + +% interface to footnotes + +\def\OTRSETassignwidths + {%\scratchdimen\makeupwidth + \freezetextwidth \scratchdimen\textwidth + % + \scratchcounter\zerocount + \dorecurse\nofcolumns + {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit + {\advance\scratchcounter \plusone } + {\advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}% + \advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!distance}}% + \ifcase\scratchcounter\else + \divide\scratchdimen \scratchcounter + \fi + \setgvalue{\??mc\??mc\c!width}{0}% + \dorecurse\nofcolumns + {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit + {\dimen0=\scratchdimen} + {\setgvalue{\??mc\??mc\c!width}{1}% + \dimen0=\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}% + \setxvalue{\??mc\recurselevel\??mc\c!width}{\the\dimen0}}} + +\def\OTRSETlocalwidth#1% + {\getvalue{\??mc\number#1\??mc\c!width}} + +\newbox\placeholderboxa +\newbox\placeholderboxb +\newbox\placeholderboxc +\newbox\placeholderboxd +\newbox\placeholderboxe +\newbox\placeholderboxf + +\def\columnplaceholder#1#2% + {\hbox + {\setbox\scratchbox\hbox to \hsize + {\iftracecolumnset + \hskip-.5ex% + \startcolor[columnset:#2]\vrule\!!width1ex\!!height.5ex\!!depth.5ex\stopcolor + \fi + \hss}% + \ifcase#1\relax + \ht\scratchbox\zeropoint + \dp\scratchbox\zeropoint + \wd\scratchbox\zeropoint + \else + \wd\scratchbox\hsize + \ht\scratchbox\strutht + \dp\scratchbox\strutdp + \fi + \box\scratchbox}} + +\definepalet + [columnset] + [a=cyan,b=green,c=blue,d=red,e=magenta,f=darkgray] + +\def\OTRSETsetplaceholders + {\global\setbox\placeholderboxa\columnplaceholder0a% + \global\setbox\placeholderboxb\columnplaceholder0b% + \global\setbox\placeholderboxc\columnplaceholder0c% + \global\setbox\placeholderboxd\columnplaceholder0d% + \global\setbox\placeholderboxe\columnplaceholder0e% + \global\setbox\placeholderboxf\columnplaceholder1f} + +\def\doOTRSETshowstatus + {\llap{\tt\tfxx + \startcolor[blue](\the\vsize->\number\columnfirstcell\#\number\columnfreecells)\stopcolor + \hskip\leftskip}} + +\def\OTRSETshowstatus + {\iftracecolumnset \doOTRSETshowstatus \fi} + +% \appendtoks \OTRSETshowstatus \to \everypar + +% page contents + +\def\OTRSETdopagecontents#1#2% takes two args: \box \unvbox + {\vbox to \textheight{\forgetall#1#2}} + +\def\OTRSETsomepagefloat {\def\floatmethod{PAGE}\OTRSETsomeslotfloat} % check +\def\OTRSETsomeherefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check +\def\OTRSETsomeelsefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check +\def\OTRSETsomefixdfloat {\def\floatmethod{FIXD}\OTRSETsomeslotfloat} % check +\def\OTRSETsometopfloat {\def\floatmethod{TOPS}\OTRSETsomeslotfloat} % check +\def\OTRSETsomebottomfloat{\def\floatmethod{BOTS}\OTRSETsomeslotfloat} % check + +\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge + {\iftestfloatbox\ruledhbox\fi{\box\floatbox}} + +\def\OTRSETsomeslotfloat[#1]% + {\setbox\floatbox\vbox{\flushfloatbox}% + \dp\floatbox\strutdp + \@EA\uppercasestring\floatmethod\to\floatmethod + \OTRSETstoreincolumnslot\floatmethod\floatbox + \doinsertfloatinfo} + +% kind of new, looks much like OTRONE, but not entirely + +\def\OTRSETdosettopinserts + {\bgroup + \ifsomefloatwaiting + \noffloatinserts\zerocount + \let\totaltopinserted\!!zeropoint + \OTRSETdodosettopinserts + \ifnum\@@bknbottom=\zerocount + \ifnum\@@bknlines>\zerocount + \ifdim\totaltopinserted>\zeropoint\relax + \dimen0\lineheight + \dimen0=\@@bknlines\dimen0 + \advance\dimen0 \totaltopinserted\relax + \ifdim\dimen0>\textheight % \vsize %%%%%%%%% \textheight + \showmessage\m!floatblocks8{\@@bknlines}% + \vfilll\eject + \fi + \fi + \fi + \fi + \fi + \egroup} + +\def\OTRSETdodosettopinserts + {\ifnum\noffloatinserts<\noftopfloats + \dogetfloat + \ifdim\topinserted=\zeropoint\relax + \topofinserttrue + \else + \topofinsertfalse + \fi + \setbox\scratchbox\vbox % kan beter ! + {\forgetall + \iftopofinsert + \ifdim\OTRSETtopoffset=\zeropoint + \moveongrid[\v!top] + \fi + \else + \betweenfloatblanko % inserts can't look back + \fi + \flushfloatbox + \blank[\@@bkspaceafter]}% + \global\advance\topinserted \ht\scratchbox\relax + \ifdim\topinserted>\vsize % was \textheight\relax + \OTRSETresavebox\floatbox + \noffloatinserts\noftopfloats\relax + \global\advance\topinserted -\ht\scratchbox + \let\OTRSETdodosettopinserts\relax % to be tested + \else + \xdef\totaltopinserted{\the\topinserted}% + \insert\topins{\forgetall\box\scratchbox}% interlineskip ? + \ifsomefloatwaiting + \advance\noffloatinserts \plusone + \else + \noffloatinserts\noftopfloats\relax + \fi + \dofloatflushedinfo + \fi + \else + \ifsomefloatwaiting + \showmessage\m!floatblocks6{\the\noftopfloats}% + \fi + \let\OTRSETdodosettopinserts\relax + \fi + \OTRSETdodosettopinserts} + +\def\OTRSETdosetbotinserts + {\bgroup + \ifsomefloatwaiting + \noffloatinserts\zerocount + \OTRSETdodosetbotinserts + \fi + \egroup} + +\def\OTRSETdodosetbotinserts + {\ifnum\noffloatinserts<\nofbotfloats\relax + \dogetfloat + \global\advance\botinserted \ht\floatbox\relax + \global\advance\botinserted \dp\floatbox\relax + \global\advance\botinserted \floattopskip\relax + \ifdim\botinserted<\pagegoal\relax + \insert\botins + {\forgetall + \blank[\@@bkspacebefore]% + \flushfloatbox}% + \ifsomefloatwaiting + \advance\noffloatinserts \plusone + \else + \noffloatinserts\nofbotfloats + \fi + \dofloatflushedinfo + \else + \OTRSETresavebox\floatbox + \noffloatinserts\nofbotfloats\relax + \fi + \global\nofloatpermittedtrue % vgl topfloats s! + \else + \ifsomefloatwaiting + \showmessage\m!floatblocks7{\the\nofbotfloats}% + \fi + \let\OTRSETdodosetbotinserts\relax + \fi + \OTRSETdodosetbotinserts} + +\let\OTRSETdosetbothinserts\relax + +\def\OTRSETdotopinsertions + {\ifvoid\topins\else + \ifvoid\columntopbox\mofcolumns + \columnsettopbox\mofcolumns\box\topins + \else + \columnsettopbox\mofcolumns\vbox % temp, must be better + {\forgetall + \offinterlineskip + \box\columntopbox\mofcolumns + \box\topins} + \fi + \fi + \global\topinserted\zeropoint\relax} % goes away + +\def\OTRSETdobotinsertions + {\ifvoid\botins \else + \columnsetbotbox\mofcolumns\box\botins +% \else +% \columnsetbotbox\mofcolumns\vbox % temp, must be better +% {\forgetall +% \offinterlineskip +% \box\botins +% \box\columnbotbox\mofcolumns} + \fi + \global\botinserted\zeropoint\relax} % goes away + +% set ipv text + +% left right 1 2 3 +1 +2 +3 + +\let\columnleftareas \empty +\let\columnrightareas\empty + +% links rechts => odd, even, n, named + +\def\definecolumntextarea + {\dotripleempty\dodefinecolumntextarea} + +\def\dodefinecolumntextarea[#1][#2][#3]% y=0 is mogelijke en handig ! + {\ifthirdargument + \doifinsetelse{#2}{\v!both,\v!fixed} + {\definecolumntextarea[#1][\v!left ][\c!type=#2,#3]% + \definecolumntextarea[#1][\v!right][\c!type=#2,#3]} + {\doifelse{#2}\v!next + {\doifoddpageelse + {\definecolumntextarea[#1][\v!right][\c!type=#2,#3]} + {\definecolumntextarea[#1][\v!left ][\c!type=#2,#3]}} + {\presetlocalframed + [\??mt#1#2]% + \processaction[#2] % \doglobal voorkomt stack build up + [ \v!left=>\doglobal\addtocommalist{#1}\columnleftareas, + \v!right=>\doglobal\addtocommalist{#1}\columnrightareas]% + \getparameters[\??mt#1#2] + [\c!x=1,\c!y=1,\c!nx=1,\c!ny=1,\c!clipoffset=2\lineheight, + \c!offset=\v!overlay,\c!strut=\v!no,\c!frame=\v!off, + \c!type=#2,\c!page=1,\c!state=\v!stop,#3]}}% + \else + \definecolumntextarea[#1][\v!next][#2]% + \fi} + +\def\setupcolumntextarea + {\dotripleempty\dosetupcolumntextarea} + +\def\dosetupcolumntextarea[#1][#2][#3]% + {\ifthirdargument + \doifelse{#2}\v!both + {\setupcolumntextarea[#1][\v!left ][#3]% + \setupcolumntextarea[#1][\v!right][#3]} + {\doifelse{#2}\v!next + {\doifoddpageelse + {\setupcolumntextarea[#1][\v!right][#3]} + {\setupcolumntextarea[#1][\v!left][#3]}} + {\getparameters[\??mt#1#2][#3]}}% + \else + \setupcolumntextarea[#1][\v!next][#2]% + \fi} + +\def\docheckcolumnsetareapage#1#2% + {\ifnum\getvalue{\??mt#1\c!page}>\plusone + \doifelsevalue{\??mt#1\c!type}\v!fixed + {\ifnum\columnsetpage=\getvalue{\??mt#1\c!page}\relax + \donetrue\else\donefalse + \fi} + {\ifnum\columnsetpage<\getvalue{\??mt#1\c!page}\relax + \donefalse\else\donetrue + \fi}% + \else + \donetrue + \fi} + +\def\initializecolumntextareas + {\ifodd\realpageno + \doinitializecolumntextareas\columnrightareas\v!right + \else + \doinitializecolumntextareas\columnleftareas\v!left + \fi} + +\def\doinitializecolumntextareas#1#2% + {\def\docommand##1% + {\docheckcolumnsetareapage{##1#2}\plusone + \ifdone + \donefalse + \processaction + [\getvalue{\??mt##1#2\c!state}] + [ \v!start=>\donetrue, + \v!repeat=>\donetrue, + \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]% + \ifdone\dodoinitializecolumntextareas{##1}{#2}\fi + \fi}% + \processcommacommand[#1]\docommand} + +\def\dodoinitializecolumntextareas#1#2% + {\doOTRSETsetgridcells + {\copy\placeholderboxd} + {\getvalue{\??mt#1#2\c!x }}{\getvalue{\??mt#1#2\c!y }} + {\getvalue{\??mt#1#2\c!nx}}{\getvalue{\??mt#1#2\c!ny}} + {\copy\placeholderboxd}} + +\def\placecolumntextareas + {\ifodd\realpageno + \doplacecolumntextareas\columnrightareas\v!right + \else + \doplacecolumntextareas\columnleftareas\v!left + \fi} + +\def\doplacecolumntextareas#1#2% global ? + {\bgroup + \forgetall + \def\docommand##1% + {\docheckcolumnsetareapage{##1#2}\zerocount + \ifdone + \donefalse + \processaction + [\getvalue{\??mt##1#2\c!state}] + [ \v!start=>\donetrue\doglobal\removefromcommalist{##1}#1, + \v!repeat=>\donetrue, + \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]% + \ifdone + \dodoplacecolumntextareas{##1}{#2}% + \else + \doglobal\removefromcommalist{##1}#1% + \fi + \fi}% + \processcommacommand[#1]\docommand + \egroup} + +% \page[left] +% \definecolumntextarea[intro][left][x=1,y=1,nx=4,ny=20,state=start,background=introlayer] +% \setupcolumntextareatext[intro][left][\setups{intro}] +% \flushcolumntextareas + +\def\flushcolumntextareas + {\initializecolumntextareas + \setvsize} + +\def\columntextlastbackspace{\backspace} + +% beware, we have clipping offsets of 2\lineheight by default + +\def\columntextareaparameter#1% + {\csname\??mt\currentcolumntestarea#1\endcsname} + +\def\dodoplacecolumntextareas#1#2% + {\def\currentcolumntestarea{#1#2}% + \!!counta\columntextareaparameter\c!x + \!!countb\columntextareaparameter\c!nx + \docalculatecolumnsetspan + \!!heighta\columntextareaparameter\c!ny\lineheight + % wrong + % \ifnum\columntextareaparameter\c!y=\zerocount + % \advance\!!heighta -\lineheight + % \advance\!!heighta \topskip + % \fi + % \advance\!!heighta -\lineheight % option + \ifnum\columntextareaparameter\c!y=\plusone + \advance\!!heighta -\lineheight + \advance\!!heighta \topskip + \fi + % + \setbox\scratchbox\vbox + {\donetrue\localframed + [\??mt\currentcolumntestarea] + [\c!location=,% new (*) + \c!width=\!!widtha,\c!height=\!!heighta,\c!lines=] + {\columntextareaparameter\empty}}% + \!!counta\columntextareaparameter\c!x + \!!countb\columntextareaparameter\c!y + \advance\!!countb \columntextareaparameter\c!ny + \advance\!!countb \minusone + % new (*) + \doif{\columntextareaparameter\c!location}\v!depth + {\setbox\scratchbox\hbox{\lower\strutdepth\box\scratchbox}% + \dp\scratchbox\zeropoint + \ht\scratchbox\!!heighta}% + % + \setbox0\hbox + {\ifcase\!!countc + \copy\scratchbox % \box + \else + \clip + [ %\c!topoffset=\columntextareaparameter\c!clipoffset,% + %\c!bottomoffset=\columntextareaparameter\c!clipoffset,% + %\c!leftoffset=\columntextareaparameter\c!clipoffset,% + \c!offset=\columntextareaparameter\c!clipoffset,% + \c!rightoffset=\zeropoint,% + \c!width=\!!widthb,% + \c!height=\!!heighta]% + {\copy\scratchbox}% + \fi}% + \OTRSETsetgridcell\!!counta\!!countb\box0 + \ifcase\!!countc\else + \advance\!!counta \columntextareaparameter\c!nx + \advance\!!counta -\!!countc + \advance\!!widtha -\!!widthb + \setbox0\hbox + {\hskip-\namedlayoutparameter\v!odd\c!backspace + \clip + [ %\c!topoffset=\columntextareaparameter\c!clipoffset,% + %\c!bottomoffset=\columntextareaparameter\c!clipoffset,% + %\c!rightoffset=\columntextareaparameter\c!clipoffset,% + \c!offset=\columntextareaparameter\c!clipoffset,% + \c!leftoffset=\zeropoint,% + \c!width=\!!widtha,% + \c!height=\!!heighta,% + \c!hoffset=\!!widthb]% + {\copy\scratchbox}}% + \OTRSETsetgridcell\!!counta\!!countb\box0% + \fi} + +\def\setupcolumntextareatext + {\dotripleempty\dosetupcolumntextareatext} + +\long\def\dosetupcolumntextareatext[#1][#2][#3]% + {\ifthirdargument + \doifelse{#2}\v!both + {\setvalue{\??mt#1\v!left }{#3}% + \setvalue{\??mt#1\v!right}{#3}} + {\doifelse{#2}\v!next + {\doifoddpageelse + {\setvalue{\??mt#1\v!right}{#3}}% + {\setvalue{\??mt#1\v!left }{#3}}}% + {\setvalue{\??mt#1#2}{#3}}}% + \else + \setupcolumntextareatext[#1][\v!next][{#2}]% + \fi} + +\def\docalculatecolumnsetspan + {% \!!counta <= x + % \!!countb <= nx + % \!!widtha => total width + % \!!widthb => left width + % \!!countc => left cols + \!!widtha\!!countb\textwidth % we assume equal widths + \advance\!!countb \!!counta + \advance\!!countb \minusone + \ifnum\!!countb>\nofcolumns + \!!countc\!!countb + \advance\!!countc -\nofcolumns + \!!countb\nofcolumns + \else + \!!countc\zerocount + \fi + \advance\!!counta \plusone + \dostepwiserecurse\!!counta\!!countb\plusone + {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}% + \!!widthb\!!widtha + \advance\!!widthb -\!!countc\textwidth + \ifodd\realpageno \else % tricky, assumes that we keep there + \ifcase\!!countc\else + % nog niet ok voor enkel/doublesided + \advance\!!widtha \namedlayoutparameter\v!even\c!backspace + \advance\!!widtha \namedlayoutparameter\v!odd \c!backspace + \advance\!!widthb \namedlayoutparameter\v!even\c!backspace + \dorecurse\!!countc + {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}% + \fi + \fi} + +\def\columnsetspanhsize{\textwidth} + +\def\setcolumnsetspanhsize#1#2% x nx / uses counta/b + {\!!counta#1\!!countb#2\docalculatecolumnsetspan + \edef\columnsetspanhsize{\the\!!widtha}} + +\def\definecolumnsetspan + {\dodoubleempty\dodefinecolumnsetspan} + +\def\dodefinecolumnsetspan[#1][#2]% + {%\ifsecondargument + \defineframedtext + [cs:#1] + [\c!frame=\v!off, + \c!before=, + \c!after=, + \c!offset=\v!overlay, + \c!location=\v!left, + \c!linecorrection=\v!off, + \c!depthcorrection=\v!off, + \c!n=2, + \c!nlines=0, + \c!indenting=, + \c!indentnext=\v!yes, + \c!default=HERE, + \c!alternative=\v!a, + #2]% + %\else + % \definecolumnspan[][#1]% + }%\fi} + +\definecolumnsetspan[\s!default] + +\def\setupcolumnsetspan + {\dodoubleempty\dosetupcolumnsetspan} + +\def\dosetupcolumnsetspan[#1][#2]% + {\ifsecondargument + \setupframedtexts[cs:#1][#2]% + \else + \setupcolumnsetspan[\s!default][#1]% + \fi} + +\def\startcolumnsetspan + {\dotripleempty\dostartcolumnsetspan} + +%%%%%%%%%%%%%%%% TODO + +\def\dostartcolumnsetspan[#1][#2][#3]% [#3] gobbles space + {\endgraf % else rubish output if forgotten + \vskip \zeropoint % make sure otr is done, otherwise last line problems + \bgroup + \forgetall + \ifnum\columnsetlevel>\zerocount\else + % of course we needed a one-column fall back for tm + \columnsetspanhsize\hsize + \nofcolumns\plusone + \mofcolumns\plusone + \fi + \setupframedtexts[cs:#1] + [\c!width=\columnsetspanhsize, + \c!linecorrection=\v!off, + \c!depthcorrection=\v!off, + #2]% + % determine widths + \!!countc\framedtextparameter{cs:#1}\c!n + % \!!countd\numexpr(\nofcolumns-\mofcolumns+\plusone)% + \!!countd\nofcolumns + % n <= n of columns + \ifnum\!!countc>\!!countd \!!countc\!!countd \fi + \advance\!!countd -\mofcolumns + \advance\!!countd \plusone + % n <= n of available columns (alternative a) + \doif{\framedtextparameter{cs:#1}\c!alternative}\v!a + {\ifnum\!!countc>\!!countd \!!countc\!!countd \fi}% + % here it all starts + \setcolumnsetspanhsize\mofcolumns\!!countc % a/b used + \hsize\columnsetspanhsize + \setbox\scratchbox\vbox\bgroup + \dostartframedtext[cs:#1][\v!none]% geen nils placement + % spoils spacing : \vskip-\struttotal\par\verticalstrut\par + \ifnum\columnsetlevel>\zerocount + \framedtextparameter{cs:#1}\c!before + \fi + \def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}} + +\def\dostopcolumnsetspan#1% + {\par + \verticalstrut + \kern-2\struttotal + \verticalstrut + \ifnum\columnsetlevel>\zerocount + \doifsomething{\framedtextparameter{cs:#1}\c!after} + {\framedtextparameter{cs:#1}\c!after + \kern\zeropoint}% otherwise blanks disappear, better be a switch + \else + \endgraf + \fi + \dostopframedtext + \egroup + \setbox\scratchbox\frozenhbox to \hsize + {\dontcomplain + \alignedline{\framedtextparameter{cs:#1}\c!location}\v!middle + {\lower\strutdepth\box\scratchbox}}% + \dp\scratchbox\zeropoint % else wrong snap insidefloat +% +% to be tested first (strange in grid mode) +% +% \setbox\scratchbox\frozenhbox to \hsize +% {\dontcomplain +% \chardef\alignstrutmode\zerocount +% \alignedline{\framedtextparameter{cs:#1}\c!plaats}\v!midden +% {\box\scratchbox}}% +% + \ifinsidefloat + \box\scratchbox + \else\ifnum\columnsetlevel>\zerocount + % we only set \columnsetspacing when asked for, else bottom problems + % don't change this any more (test naw) + \chardef\columnslotspacing\framedtextparameter{cs:#1}\c!nlines\relax + % todo: nboven/onder & \chardef\columnslotlocation2 + %\OTRSETstoreincolumnslotHERE\scratchbox + \edef\floatmethod{\framedtextparameter{cs:#1}\c!default}% + \@EA\uppercasestring\floatmethod\to\floatmethod + % todo : \v!here -> here enzovoorts + \OTRSETstoreincolumnslot\floatmethod\scratchbox + % watch out: no \dochecknextindentation{tag} + \checknextindentation[\framedtextparameter{cs:#1}\c!indentnext]% + \else + % of course we needed a one-column fall back for tm; brrr, the box has now too + % much height (try \ruledvbox); don't change this without testing techniek + \scratchdimen\ht\scratchbox + \advance\scratchdimen-\strutdp + \ht\scratchbox\scratchdimen + \framedtextparameter{cs:#1}\c!before + \snaptogrid\vbox{\box\scratchbox}% + \framedtextparameter{cs:#1}\c!after + \fi\fi + \egroup + \endgraf} + +% \startcolumnset[two] +% \input tufte +% \startcolumnsetspan[two][width=20cm,location=middle] \input tufte \stopcolumnsetspan +% \startcolumnsetspan[two][default=btlr] \input tufte \stopcolumnsetspan +% \input tufte \par +% \input tufte \par +% \startcolumnsetspan[two] \emptylines[5] \stopcolumnsetspan +% \startcolumnsetspan[two] \input tufte \stopcolumnsetspan +% \stopcolumnset + +% We need to set the \dimen globally since we are in the +% OTR. Unfortunately this interferes with local settings, +% although we may assume that they will not cross page +% boundaries. + +\def\OTRSETcheckcontent + {\bgroup + \donefalse + \def\OTRSETcheckcontent##1% + {\setbox\scratchbox##1\recurselevel + \setbox\scratchbox\vbox{\unvbox\scratchbox}% + \ifdim\ht\scratchbox>\zeropoint\donetrue\fi}% + \dorecurse{\nofcolumns} + {\OTRSETcheckcontent\columngettextbox + \OTRSETcheckcontent\columngetfootbox + \OTRSETcheckcontent\columngettopbox + \OTRSETcheckcontent\columngetbotbox}% + \ifdone\egroup\donefalse\else\egroup\donetrue\fi} + +\def\OTRSETgetcolumntextheight#1% max - boven - top + {\scratchdimen=\OTRSETgetparameter\c!maxhoogte#1% + \advance\scratchdimen -\OTRSETgetparameter\c!bovenoffset#1% + \advance\scratchdimen -\ht\columntopbox#1% + \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}% + \advance\scratchdimen -\ht\columnbotbox#1} % not used + +\def\OTRSETgetcolumnnaturalheight#1% max - boven - top + {\setbox\scratchbox\vbox{\unvcopy\columntextbox#1}% + \scratchdimen\ht\scratchbox + \advance\scratchdimen \OTRSETgetparameter\c!bovenoffset#1% + \advance\scratchdimen \ht\columntopbox#1% + \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}% + \advance\scratchdimen \ht\columnbotbox#1} % not used + +\def\OTRSETdobalance% splitten in met en zonder footnotes + {\bgroup + \maxdeadcycles=1000 + % collect content and notes + \bgroup + \OTRSEToutput + {\global\setbox1\vbox{\unvbox\normalpagebox}% + \global\setbox3\vbox{\unvbox\footins}}% + \verticalstrut\vskip-\struttotal % makes footnotes flush + \eject + \global\collectingcontentfalse + % check for footnotes only + \ifdim\ht1<\topskip % real dirty + \global\setbox1=\vbox{} + % fix height of first line + \ifdim\ht3>\!!zeropoint + \global\setbox3\vbox + {\setfootnotebodyfont + \kern-\strutht + \kern\topskip + \unvbox3} + \fi + % prepare trial box + \global\setbox5\vbox + {\ifdim\ht1>\zeropoint + \unvcopy1 \ifdim\ht3>\zeropoint \kern\skip\footins \fi + \fi + \ifdim\ht3>\zeropoint \unvcopy3 \fi} + \egroup + % erase old stuff + \columnerasetextboxes + \columnerasefootboxes + % prepare floats + \OTRSETdotopinsertions + \OTRSETdobotinsertions % not used can be removed + % calculate available space + \!!heighta\zeropoint % available total height + \dorecurse{\nofcolumns} + {\OTRSETgetcolumntextheight\recurselevel + \OTRSETcalculatelines\scratchdimen + \advance\!!heighta \scratchdimen} + % quick check + \ifdim\ht5>\!!heighta + % use normal routine + \columnerasetextboxes + \columnerasefootboxes + % TEMP, TODO, FORCE NEXT PASS ! + \unvbox1 + \unvbox3 + \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist + \donefalse + %\writestatus\m!columns{no balancing, text overflows height}% + \else\ifdim\ht5>\zeropoint \relax + % some text and/or notes + \donetrue + \else + \donefalse + \dorecurse\nofcolumns + {\ifdim\ht\columntopbox\recurselevel>\zeropoint \donetrue \fi}% + \ifdone + % no text and notes, but figures + \else + % no text, no notes, no figures + \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist + \writestatus\m!columns{no balancing, nothing to be placed}% + \fi + \fi\fi + \ifdone + \ifdim\ht5>\zeropoint \relax + % balancing text and notes + %\writestatus\m!columns{text may fit, balancing}% + \newcounter\loopcounter + \newcounter\balancinglines + \doloop + {\increment\loopcounter\relax + % initialize + \columnerasetextboxes + \columnerasefootboxes + \setbox0=\copy5 + \splittopskip\topskip + % pre-split loop and quality calculation + %\writestatus\m!columns{pass \loopcounter: correction -\balancinglines} + \dorecurse\nofcolumns + {\OTRSETgetcolumntextheight\recurselevel + \OTRSETcalculatelines\scratchdimen + \!!heightc\scratchdimen + \ifnum\recurselevel<\nofcolumns + \advance\!!heightc -\balancinglines\lineheight + \fi + \columnsettextbox\recurselevel\vsplit0 to \!!heightc} + % just one method + \OTRSETgetcolumnnaturalheight1 \dimen4\scratchdimen + \OTRSETgetcolumnnaturalheight\nofcolumns \dimen6\scratchdimen + %\writestatus\m!columns{first column: \the\dimen4}% + %\writestatus\m!columns{last column: \the\dimen6}% + \ifdim\dimen4=\dimen6 + \donetrue % perfect balance + \else\ifdim\dimen4>\dimen6 + \donefalse % not yet good enough + \increment\balancinglines % try again + \edef\balancingcount{\the\!!counta} + \else + \donetrue % worse balance + \ifnum\balancinglines>0 % take previous + \decrement\balancinglines + \fi + \fi\fi + % extra check + % \ifdim\ht0>\zeropoint\relax \donefalse \fi + % another check + \ifdone + %\writestatus\m!columns{balancing finished in pass \loopcounter}% + \else \ifnum\loopcounter>100 \donetrue + %\writestatus\m!columns{balancing aborted after pass \loopcounter}% + \else + %\writestatus\m!columns{balancing continued after pass \loopcounter}% + \fi \fi + % final balancing pass + \ifdone + \setbox0\copy1 + \setbox2\copy3 + \columnerasetextboxes + \columnerasefootboxes + \dorecurse\nofcolumns + {\OTRSETgetcolumntextheight\recurselevel + \OTRSETcalculatelines\scratchdimen + \!!heightc\scratchdimen + \ifnum\recurselevel<\nofcolumns + \advance\!!heightc -\balancinglines\lineheight + \fi + % split off text + \ifdim\ht0>\zeropoint + \columnsettextbox\recurselevel\vsplit0 to \!!heightc + \setbox4\vbox{\unvcopy\columntextbox\recurselevel} + \advance\!!heightc -\ht4 + \ifdim\ht0>\zeropoint + \columnsettextbox\recurselevel\box4 + \advance\!!heightc \skip\footins + \fi + \fi + % split off footnotes + \ifdim\ht0>\zeropoint\relax \else + \ifdim\ht2>\zeropoint\relax + \setbox4\vsplit2 to \!!heightc + \setbox\footins=\vbox{\unvbox4} % ugly and dirty trick + \ifdim\ht\columntextbox\recurselevel=\zeropoint\relax + \columnsettextbox\recurselevel\hbox + {\raise\strutdp\hbox % ugly but needed + {\setfootnotebodyfont % both these moves + \lower\strutdp\hbox{\placebottomnotes}}} + \else + \columnsetfootbox\recurselevel\hbox{\placebottomnotes} + \fi + \fi + \fi} + \exitloop + \fi} + \else + % no reason to balance floats + \fi + \fi + \doglobal\addtocommalist{\realfolio}\OTRSETbalancinglist + \OTRSETdoflush + \fi + \egroup} + +\protect \endinput + +% extreme examples (1) +% +% \setupfloats[numbering=nocheck] +% +% \definecolumnset [first] [n=2,start=0] +% \definecolumnset [next] [n=2,start=3] +% +% \setuptexttexts[\vbox to \textheight{\topskipcorrection \hsize\makeupwidth left \hfill right\vfill}] +% +% \setuphead[chapter][text=empty] +% +% \starttext +% +% \startcolumnset[first,next] +% \placefigure[btrl]{}{} +% \placefigure[tblr]{}{} +% \chapter{thuan} \dorecurse{25}{\recurselevel: \input thuan \endgraf} +% \stopcolumnset +% +% \startcolumnset[first,next] +% \chapter{thuan} \dorecurse{25}{\input thuan \endgraf\placefigure{}{}} +% \stopcolumnset + +\unprotect + +% only in columnsets + +% \def\cornerfigure +% {\dotripleempty\docornerfigure} +% +% \def\docornerfigure[#1][#2][#3]% [layer] [location] [settings] +% {\bgroup +% \dowithnextbox +% {\!!doneafalse +% \!!donebfalse +% \processallactionsinset +% [\v!left,\v!bottom,#2] +% [ \v!left=>\!!doneatrue , +% \v!right=>\!!doneafalse, +% \v!top=>\!!donebtrue , +% \v!bottom=>\!!donebfalse]% +% \!!widtha\nextboxwd +% \if!!donea +% % unchecked +% \advance\!!widtha-\backspace +% \else +% % unchecked +% \advance\!!widtha-\backspace +% \fi +% \!!widtha\textwidth % could be an option +% \!!heighta\nextboxht +% % zou een macro moeten zijn \getnoflayoutlines +% \ifnum\layoutparameter\c!lines=\zerocount +% \getnoflines\textheight +% \else +% \noflines\layoutparameter\c!lines +% \fi +% % +% \advance\noflines \plusone % wordt default, instelbaar +% \!!heightb\noflines\lineheight\relax +% \if!!doneb % boven +% % unchecked +% \advance\!!heighta-\topspace +% \advance\!!heighta-\headerheight +% \advance\!!heighta-\headerdistance +% \else % onder +% % checked +% \advance\!!heighta-\paperheight +% \advance\!!heighta+\!!heightb +% \advance\!!heighta+\topspace +% \advance\!!heighta+\headerheight +% \advance\!!heighta+\headerdistance +% \advance\!!heighta-\footerdistance +% \advance\!!heighta-\footerheight +% \fi +% \getnoflines\!!heighta +% \!!heighta\noflines\lineheight\relax +% \def\docornerfigure[####1]% +% {\expanded{\plaatsfiguur[####1,\v!none]{} +% {\noexpand\phantombox[\c!width=\the\!!widtha,\c!height=\the\!!heighta]}}}% +% \if!!donea +% \if!!doneb % links boven / rb +% \setlayer[#1] +% [\c!corner={\v!left,\v!top},\c!location=rb,#3] +% {\flushnextbox}% +% \docornerfigure[tblr]% +% \else % links onder / rt +% \setlayer[#1] +% [\c!corner={\v!left,\v!bottom},\c!location=rt,#3] +% {\flushnextbox}% +% \docornerfigure[btlr]% +% \fi +% \else +% \if!!doneb % rechts boven / lt +% \setlayer[#1] +% [\c!corner={\v!right,\v!top},\c!location=lb,#3] +% {\flushnextbox}% +% \docornerfigure[tbrl]% +% \else % rechts onder / lb +% \setlayer[#1] +% [\c!corner={\v!right,\v!bottom},\c!location=lt,#3] +% {\flushnextbox}% +% \docornerfigure[btrl]% +% \fi +% \fi +% \egroup} +% \vbox} diff --git a/tex/context/base/page-set.tex b/tex/context/base/page-set.tex deleted file mode 100644 index a9d42bce8..000000000 --- a/tex/context/base/page-set.tex +++ /dev/null @@ -1,2815 +0,0 @@ -%D \module -%D [ file=page-set, -%D version=2000.10.20, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Column Sets, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% getnoflines vs getrawnoflines - -% some day: cleanup and go etex - -\writestatus{loading}{ConTeXt Page Macros / Column Sets} - -% todo : last longer than previous -% todo : block span over last column if footnotes -% todo : diagnosis balancing run -% todo : separate footnote placement -% todo : go on on same page with colset -% todo : test page areas per page -% todo : leftmargin/rightmargin (better than afstand(1)) - -% use the OTRSET layer for more purposes, like the footnotes ! - -\unprotect - -\newcount\tofcolumns % total -\newcount\lofcolumns % left -\newcount\rofcolumns % right - -\newcount\columnfirstcell \columnfirstcell=1 -\newcount\columnlastcell -\newcount\columnfreecells -\newcount\currenthcell -\newcount\currentvcell -\newcount\columnhcells -\newcount\columnvcells - -\newif\ifenoughcolumncells -\newif\ifsomefreecolumncells -\newif\ifcolumnspread -\newif\iftracecolumnset % \tracecolumnsettrue - -\def\columnmaxcells {75} % runtime -\def\columnmaxfreecells {0} % runtime -\def\columngaplimit {0} % {5} - -\def\@otr@{otr} - -\def\OTRSETmakeupwidth{\innermakeupwidth} - -\let\OTRSETflushsidefloats \forgetsidefloats % \relax -\let\OTRSETsynchronizesidefloats\forgetsidefloats % \relax - -\def\OTRSETgridcell #1#2{\csname \@otr@:\number#1:\number#2\endcsname} -\def\OTRSETgetgridcell#1#2{\box\csname \@otr@:\number#1:\number#2\endcsname} -\def\OTRSETsetgridcell#1#2{\global\setbox\csname\@otr@:\number#1:\number#2\endcsname} - -\long\def\OTRSETdoifcellelse#1#2% - {\relax\ifvoid\csname\@otr@:\number#1:\number#2\endcsname - \@EA\secondoftwoarguments\else\@EA\firstoftwoarguments - \fi} - -% The following two macros are used to compensate for a switch in body fonts -% as in: -% -% \definecolumnset [two] [n=2,balancing=yes] -% \definecolumnset [three] [n=3,balancing=yes] -% -% \setupcolumnsetlines[two][1][1][7] -% \setupcolumnsetlines[two][1][2][10] -% -% \setupcolumnsetlines[three][1][1][40] -% \setupcolumnsetlines[three][1][2][40] -% \setupcolumnsetlines[three][1][3][40] -% -% \setupcolumnsetstart[three][1][1][15] -% \setupcolumnsetstart[three][1][2][20] -% \setupcolumnsetstart[three][1][3][20] -% -% \starttext -% \startcolumnset [two] \dorecurse {1}{\input tufte \par} \stopcolumnset -% \switchtobodyfont[small] -% \startcolumnset [three] \dorecurse {1}{\input tufte \par} \stopcolumnset -% \stoptext - -%D Marks in columnsets: -%D -%D \starttyping -%D \definemarking[M] -%D \setupheadertexts[\setups{show-M-marks}] -%D \definecolumnset[test][n=3] -%D -%D \startsetups show-M-marks -%D \getmarking[M][1][previous]/\getmarking[M][1][first]/\getmarking[M][1][last]\quad -%D \getmarking[M][2][previous]/\getmarking[M][2][first]/\getmarking[M][2][last]\quad -%D \getmarking[M][3][previous]/\getmarking[M][3][first]/\getmarking[M][3][last]\quad -%D \getmarking[M][1][previous]/\getmarking[M][1][first]/\getmarking[M][last]\quad -%D \getsavedmarking[M][previous]/\getsavedmarking[M][first]/\getsavedmarking[M][last] -%D \stopsetups -%D -%D \startbuffer -%D \section{Knuth} [K1]\marking[M]{k1} [K2]\marking[M]{k2} \input knuth -%D \section{Zapf} [Z]\marking[M]{z} \input zapf -%D \stopbuffer -%D -%D \startbuffer -%D \section{Ward} [W]\marking[M]{w} \input ward -%D \placefigure[here]{none}{\externalfigure[a][height=2cm]} -%D \section{Davis} [D]\marking[M]{d} \input davis -%D \section{Zapf} [Z]\marking[M]{z} \input zapf -%D \stopbuffer -%D -%D \startbuffer -%D \section{Ward} [W]\marking[M]{w} \input ward -%D \placefigure[here]{none}{\externalfigure[a][height=2cm]} -%D \section{Davis} [D]\marking[M]{d} \input davis -%D \section{Zapf} [Z]\marking[M]{z} \input zapf -%D \section{Douglas} [O]\marking[M]{o} \input douglas -%D \stopbuffer -%D -%D \starttext -%D \startcolumnset[test] -%D \dorecurse{5}{\getbuffer} -%D \placefigure[here]{none}{\externalfigure[a][height=2cm]} -%D % \column % sometimes needed -%D \stopcolumnset -%D \stoptext -%D \stoptyping - -% not ok yet, for column sets we need a special case: within a column we -% need to bubble-up the marks; the indirectness permits overloading here - -\let\saveOTRSETmark \refreshsavedmark -\let\bubbleOTRSETmark\bubblesavedmark -\let\resetOTRSETmark \resetsavedmark -\let\presetOTRSETmark\presetsavedmark - -\def\doregisterOTRSETmarks#1{\saveOTRSETmark [#1][\number\mofcolumns]} -\def\dobubbleOTRSETmarks #1{\bubbleOTRSETmark[#1][\number\mofcolumns]} -\def\doresetOTRSETmarks #1{\resetOTRSETmark [#1][\recurselevel]} -\def\dopresetOTRSETmarks #1{\presetOTRSETmark[#1][\recurselevel]} - -\def\registerOTRSETmarks - {\processcommacommand[\alldefinedmarks]\doregisterOTRSETmarks} -\def\bubbleOTRSETmarks - {\processcommacommand[\alldefinedmarks]\dobubbleOTRSETmarks} -\def\resetOTRSETmarks - {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\doresetOTRSETmarks}} -\def\presetOTRSETmarks - {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\dopresetOTRSETmarks}} - -%D test case of Vit Zika (context list): -%D -%D \starttyping -%D \setuplayout[height=middle,width=middle,grid=yes] -%D -%D \starttext -%D \startcolumnset -%D \dorecurse{10} -%D {\input thuan \endgraf -%D \bgroup -%D \ss\restoreinterlinespace -%D \dorecurse{3}{\input hawking \endgraf} -%D \egroup -%D \input bryson \endgraf} -%D \stopcolumnset -%D \stoptext -%D \stoptyping - -\def\OTRSETsetcorrectnofcells#1% - {\bgroup - \!!counta#1\relax - \ifdim\globalbodyfontsize=\localbodyfontsize - \restoreinterlinespace - \else - \!!dimena-\!!counta\lineheight - \restoreglobalbodyfont % slow, we need a fast one - \advance\!!dimena\!!counta\lineheight - \getnoflines\!!dimena - \advance\!!counta\noflines - \ifnum\!!counta<#1\else - \!!counta#1\relax - \fi - \fi - \relax % needed ! ! ! ! else lookahead over \fi and \@EA - \@EA\egroup\@EA\scratchcounter\the\!!counta\relax} - -\def\OTRSETsetcorrectcellht - {\bgroup - \!!dimena-\strutht\relax - \ifdim\globalbodyfontsize=\localbodyfontsize - \restoreinterlinespace - \else - \restoreglobalbodyfont - \fi - \advance\!!dimena\strutht - \relax % needed ! ! ! ! else lookahead over \fi and \@EA - \@EA\egroup\@EA\scratchdimen\the\!!dimena\relax} - -\def\columnerasegridboxes % maybe dedicated loops - {\bgroup - \increment\columnmaxcells\relax - \ifodd\realpageno - \else % we are on the other page - \columnspreadfalse - \fi - \ifcolumnspread - \dorecurse\nofcolumns - {\let\!!stringa\recurselevel - \scratchcounter\recurselevel \advance\scratchcounter\lofcolumns - \edef\!!stringb{\the\scratchcounter}% - \dostepwiserecurse \zerocount \columnmaxcells \plusone - {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname - \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname - \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname - \box\csname\@otr@:\!!stringb:\recurselevel\endcsname - %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname - \else - \emptybox - %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox - \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname - \fi - \else - \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname - \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname - \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname - \else - \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname - \fi - \fi}}% - \else - \dorecurse \tofcolumns - {\let\!!stringa\recurselevel - \dostepwiserecurse \zerocount \columnmaxcells \plusone - {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname - \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox - \else - \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname - \fi}}% - \fi - \dorecurse\tofcolumns - {\global\setbox\csname\@otr@:\recurselevel:\columnmaxcells\endcsname\copy\placeholderboxa}% - \global\columnfirstcell\zerocount - \global\columnlastcell\columnfirstcell - \global\columnfreecells\columnfirstcell - \egroup} - -\def\doOTRSETsetgridcells#1#2#3#4#5#6% placeholder col row wid hei {data} - {\!!countd#2\advance\!!countd#4\advance\!!countd\minusone - \!!counte#3\advance\!!counte#5\advance\!!counte\minusone - \dostepwiserecurse{#2}\!!countd\plusone - {\!!countf\recurselevel - \dostepwiserecurse{#3}\!!counte\plusone - {\OTRSETsetgridcell\!!countf\recurselevel#1}}% - \dostepwiserecurse{#3}\!!counte\plusone - {\global\wd\OTRSETgridcell{#2}\recurselevel\hsize}% - \OTRSETsetgridcell{#2}\!!counte#6} - -\def\OTRSETsetgridcells - {\doOTRSETsetgridcells{\copy\placeholderboxb}} - -\def\OTRSETerasegridcells#1#2#3#4% - {\doOTRSETsetgridcells{\emptybox}{#1}{#2}{#3}{#4}{\emptybox}} - -\def\setupcolumnsetlines{\doquintupleempty\dosetupcolumnsettrick[l]} -\def\setupcolumnsetstart{\doquintupleempty\dosetupcolumnsettrick[s]} - -\def\dosetupcolumnsettrick[#1][#2][#3][#4][#5]% tag id page col value - {% not needed, is already relative - % \doifinstringelse{+}{#3}{\scratchcounter\realpageno}{\scratchcounter\zerocount}% - % \advance\scratchcounter#3\relax % \relax needed - % \setevalue{\??mc:#1:#2:\the\scratchcounter:\number#4}{\number#5}} - \iffifthargument - \setevalue{\??mc:#1:#2:\number#3:\number#4}{\number#5}% - \else - \setevalue{\??mc:#1:#2:\number#3:0}{\number#4}% - \fi} - -\def\currentcolumnmaxcellstag #1{\??mc:l:\OTRSETidentifier:\columnsetpage:\number#1} -\def\currentcolumnstartcelltag#1{\??mc:s:\OTRSETidentifier:\columnsetpage:\number#1} - -\def\doresetcolumnsetlines#1% - {\ifcsname\currentcolumnmaxcellstag{#1}\endcsname - \letgvalue{\currentcolumnmaxcellstag{#1}}\zerocount - \fi - \ifcsname\currentcolumnmaxcellstag{#1}\endcsname - \letgvalue{\currentcolumnmaxcellstag{#1}}\zerocount - \fi} - -\def\currentcolumnsomecells#1#2% - {\ifcsname#1\mofcolumns\endcsname - \ifnum\csname#1\mofcolumns\endcsname=\zerocount - #2% - \else - \number\numexpr\ifnum\csname#1\mofcolumns\endcsname<\zerocount - \columnmaxcells+\fi\csname#1\mofcolumns\endcsname\relax - \fi - \else\ifcsname#10\endcsname - \ifnum\csname#10\endcsname=\zerocount - #2% - \else - \number\numexpr\ifnum\csname#10\endcsname<\zerocount - \columnmaxcells+\fi\csname#10\endcsname\relax - \fi - \else - #2% - \fi\fi} - -\def\currentcolumnmaxcells {\currentcolumnsomecells\currentcolumnmaxcellstag \columnmaxcells} -\def\currentcolumnstartcell{\currentcolumnsomecells\currentcolumnstartcelltag\plusone} - -\def\OTRSETsetfreecells#1#2% col start - {\bgroup - \global\columnfirstcell\ifnum#2=0 1\else#2\fi\relax - \OTRSETsetcorrectnofcells\currentcolumnmaxcells % sets \scratchcounter - \edef\columnmaxcells{\the\scratchcounter}% - \ifnum\columnfirstcell>\columnmaxcells - \global\columnfreecells\zerocount - \global\columnfirstcell\plusone - \global\columnlastcell \zerocount - \global\somefreecolumncellsfalse - %\message{no cells a}% - \else - \doloop - {\ifnum\columnfirstcell>\columnmaxcells\relax - \exitloop - \else - \OTRSETdoifcellelse{#1}\columnfirstcell - {\global\advance\columnfirstcell\plusone}\exitloop - \fi}% - \global\columnlastcell\columnfirstcell - \doloop - {\ifnum\columnlastcell>\columnmaxcells\relax - \exitloop - \else - \OTRSETdoifcellelse{#1}\columnlastcell - {\global\advance\columnlastcell \minusone \exitloop} - {\global\advance\columnlastcell \plusone }% - \fi}% - \ifnum\columnfirstcell>\columnmaxcells - \global\columnfreecells\zerocount - \global\columnfirstcell\plusone - \global\columnlastcell \zerocount - \global\somefreecolumncellsfalse - %\message{no cells b}% - \else - \ifnum\columnlastcell>\columnmaxcells - \global\columnlastcell\columnmaxcells - \fi - \global\columnfreecells\columnlastcell - \global\advance\columnfreecells -\columnfirstcell - \global\advance\columnfreecells \plusone - \global\somefreecolumncellstrue - %\message{\number\columnfirstcell-\number\columnlastcell=\number\columnfreecells}% - \fi - \fi - \egroup} - -\def\OTRSETgetmaxfreecells#1#2% col start - {\let\columnmaxfreecells\!!zerocount - \let\columnfrmfreecells\!!zerocount - \pushmacro \columnmaxcells -\OTRSETsetcorrectnofcells\currentcolumnmaxcells % sets \scratchcounter -\edef\columnmaxcells{\the\scratchcounter}% - \scratchcounter\zerocount - \dostepwiserecurse{#2}\columnmaxcells\plusone - {\OTRSETdoifcellelse{#1}\recurselevel - {\ifnum\columnmaxfreecells<\scratchcounter - \edef\columnmaxfreecells{\the\scratchcounter}% - \let\columnfrmfreecells\recurselevel - \fi - \scratchcounter\zerocount} - {\advance\scratchcounter\plusone}}% - \popmacro\columnmaxcells} - -\long\def\OTRSETrecurseRL#1% - {\dostepwiserecurse\nofcolumns\plusone\minusone - {#1\hskip\OTRSETgetparameter\c!distance\recurselevel}} - -\def\OTRSETmakegridbox - {\ifcase\columndirection - \OTRSETdomakegridbox\plusone\nofcolumns\plusone - \else - \OTRSETdomakegridbox\nofcolumns\plusone\minusone - \fi} - -\def\OTRSETmakeupwidth{\makeupwidth} % temporary indirectness - -\def\OTRSETdomakegridbox#1#2#3% - {\hbox\bgroup - \dontcomplain - \forgetall % can go once in \flush - \!!heighta \textheight - % test first ! - \hbox to \OTRSETmakeupwidth - {\dostepwiserecurse{#1}{#2}{#3} - {\mofcolumns\recurselevel - \localcolumnwidth\OTRSETlocalwidth\mofcolumns - \setbox\scratchbox\hbox\localframed - [\??mc\OTRSETidentifier\number\mofcolumns]% - [\c!width=\localcolumnwidth,\c!height=\!!heighta,\c!lines=]% - {}% - \wd\scratchbox\localcolumnwidth - \ht\scratchbox\!!heighta - \ifcase\columndirection - \hskip\OTRSETgetparameter\c!distance\recurselevel - \box\scratchbox - \else - \box\scratchbox - \hskip\OTRSETgetparameter\c!distance\recurselevel - \fi}}% - \hskip-\OTRSETmakeupwidth - % main text - \hbox to \OTRSETmakeupwidth - {\dostepwiserecurse{#1}{#2}{#3} - {\mofcolumns\recurselevel - \localcolumnwidth\OTRSETlocalwidth\mofcolumns - \offinterlineskip - \setbox\scratchbox\vbox to \!!heighta - {\topskipcorrection % not needed - \ifcase\OTRSETbalancemethod - % no - \or - % yes - \doifelselayerdata{OTRTEXT}\vfill\relax % temp hack - \or - % top - \or - % bottom - \vfill - \fi - \dorecurse\columnmaxcells - {\setbox\scratchbox\hbox{\OTRSETgetgridcell\mofcolumns\recurselevel}% -% {\setbox\scratchbox\hbox -% {\localstarttextcolor -% \OTRSETgetgridcell\mofcolumns\recurselevel -% \localstoptextcolor}% - \ht\scratchbox\strutht - \dp\scratchbox\strutdp - \ifcase\columndirection - \box\scratchbox - \else - \hbox to \localcolumnwidth - {\hskip\localcolumnwidth\llap{\box\scratchbox}}% - \fi - \par}% - \ifcase\OTRSETbalancemethod - % no - \else - % yes, top, bottom - \ifdim\globalbodyfontsize=\localbodyfontsize - \removedepth - \restoreglobalbodyfont - \vskip\strutdepth - \fi - \kern\zeropoint - \vss - \fi}% - \wd\scratchbox\localcolumnwidth % \textwidth - \ifcase\columndirection - \hskip\OTRSETgetparameter\c!distance\recurselevel\box\scratchbox - \else - \box\scratchbox\hskip\OTRSETgetparameter\c!distance\recurselevel - \fi}}% - \egroup} - -\let\OTRSETbalht\zeropoint - -\def\OTRSETreducegridbox % for the moment no difference between methods - {\globallet\OTRSETbalht\zeropoint - \ifcase\OTRSETbalancemethod - % no balancing - \else - \bgroup - \!!counta\columnmaxcells - \donetrue - \doloop - {\dorecurse\nofcolumns{\OTRSETdoifcellelse\recurselevel\!!counta\donefalse\donothing}% - \ifdone - \ifnum\!!counta>\plusone\advance\!!counta\minusone\else\exitloop\fi - \else - \exitloop - \fi}% - \ifnum\!!counta>\plusone - \!!heighta\lineheight - \multiply\!!heighta \!!counta - \advance\!!heighta \topskip - \advance\!!heighta -\lineheight - \else - \!!heighta\zeropoint - \fi - \xdef\OTRSETbalht{\the\!!heighta}% - \egroup - \fi} - -\def\OTRSETflushfinalfootnotes - {\ifcase\lastcolumnlastcell \else - \setbox\scratchbox\hbox - {\placebottomnotes}% - \ifdim\ht\scratchbox>\zeropoint - \setbox\scratchbox\hbox - {\hbox to \zeropoint{\OTRSETgetgridcell\nofcolumns\lastcolumnlastcell}% - \box\scratchbox}% - \ht\scratchbox\strutht - \dp\scratchbox\strutdp - \OTRSETsetgridcell\nofcolumns\lastcolumnlastcell\box\scratchbox - \fi - \global\lastcolumnlastcell\zerocount - \fi} - -\def\OTRSETdoflush - {\ifcollectingcontent - \registerOTRSETmarks - \global\mofcolumns\plusone - \else - \OTRSETdofinalflush - \OTRSETdofinaloutput - \ifnum\columnsetpage>0 - \dorecurse\nofcolumns{\doresetcolumnsetlines\recurselevel}% - \fi - \doglobal\increment\columnsetpage - \OTRSETinitializecolumns - %\OTRSETdoflushfloats - \OTRSETstartnextpage -\presetOTRSETmarks - \initializecolumntextareas - \fi} - -\newbox\OTRfinalpagebox - -\def\OTRSETdofinalflush % see \OTRSETdoflush - {\OTRSETflushfinalfootnotes - \placecolumntextareas - \OTRSETcentergridcells - \bgroup % we want to keep the reduction local - \OTRSETreducegridbox - \global\setbox\OTRfinalpagebox\OTRSETmakegridbox - \egroup % otherwise we get the wrong number of free cells - %\gdef\localcolumnmaxcells{0}% here ? - \global\mofcolumns\nofcolumns} % otherwise problems in finaloutput - -% \def\OTRSETdofinaloutput -% {\ifdim\ht\OTRfinalpagebox=\teksthoogte -% % \bgroup \let\OTRSETsetvsize\relax % prevents useless search for gap -% \ifcase\OTRSETbalancemethod -% \finaloutput\box\OTRfinalpagebox -% \else\ifdim\OTRSETbalht>\zeropoint -% \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht -% {\box\OTRfinalpagebox}% -% \global\dp\OTRfinalpagebox\strutdepth -% \box\OTRfinalpagebox -% \else -% \finaloutput\box\OTRfinalpagebox -% \fi \fi -% \globallet\OTRSETbalht\zeropoint -% % \egroup -% \fi} - -\def\OTRSETdofinaloutput - {\ifdim\ht\OTRfinalpagebox=\textheight - \bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap - \ifcase\OTRSETbalancemethod - \finaloutput\box\OTRfinalpagebox - \else\ifdim\OTRSETbalht>\zeropoint - % catch a bordercase - \scratchdimen\OTRSETbalht - \advance\scratchdimen\lineheight\relax - \ifdim\scratchdimen>\textheight - % full page - \finaloutput\box\OTRfinalpagebox - \else - % same page - \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht - {\box\OTRfinalpagebox\vss}% - \setlayer[OTRTEXT]{\box\OTRfinalpagebox}% - \snaptogrid\vbox{\vskip\OTRSETbalht}% hack - \fi - \else - \finaloutput\box\OTRfinalpagebox - \fi \fi - \globallet\OTRSETbalht\zeropoint - \egroup - \fi} - -\definesystemvariable {mc} -\definesystemvariable {mt} -\definesystemconstant {colset} - -\definetwopasslist\s!colset - -\newdimen \OTRSETtextswidth -\newdimen \OTRSETtextsheight -\let \OTRSETidentifier=\empty - -\newtoks \OTRSEToutput - -\def\OTRSETgetparameter#1#2{\csname\??mc\OTRSETidentifier\number#2#1\endcsname} -\def\OTRSETsetparameter#1#2{\setvalue{\??mc\OTRSETidentifier\number#2#1}} - -\def\OTRSETskipstart - {\scratchcounter\executeifdefined{\??mc\OTRSETidentifier\c!start}\zerocount - \relax % needed ! - \ifcase\scratchcounter\else - \advance\scratchcounter\plusone - \doOTRSETsetgridcells - {\copy\placeholderboxe} - \plusone\plusone\nofcolumns\scratchcounter - \null - \fi} - -\def\OTRSETsetvsize % snap per sectie (gap here?) - {\ifcollectingcontent \else % can be assigndimen -\OTRSETskipstart % not that well tested - \OTRSETcheckinsert % added - \OTRSETsetfreecells\mofcolumns\columnfirstcell - \ifsomefreecolumncells - \global\vsize\columnfreecells\lineheight - \ifinotr % else problems with floats, see extreme - \global\pagegoal\vsize % niet nodig, tenzij binnen otr - \fi - \synchronizeoutput % fails on example - % \allowbreak % hm - \fi - \synchronizenotes - \fi} - -\def\OTRSETsethsize % of course this does not migrate outside the otr - {\localcolumnwidth\OTRSETlocalwidth\mofcolumns - \textwidth\localcolumnwidth - \hsize\localcolumnwidth} - -\def\OTRSETsynchronizehsize - {\ifcase0\getvalue{\??mc\??mc\c!width}\else % some width set - \bgroup - \scratchdimen\OTRSETlocalwidth\mofcolumns - \ifdim\scratchdimen=\textwidth - \egroup - \else - % only if change in width and \column/\break - \egroup \OTRSETsethsize - \fi - \fi} - -\def\OTRSETcheckfreelines - {\OTRSETsetvsize} - -\def\doOTRSETcolumnseparator - {\hbox to \zeropoint{\hss\red\vl\hss}} - -\let\OTRSETcolumnseparator\relax - -\def\showbreaks - {\let\OTRSETcolumnseparator\doOTRSETcolumnseparator} - -% \installcolumnbreakhandler {SET} \v!ja -% {% hmmm: -% \ifhmode -% \bgroup -% \removeunwantedspaces -% \parfillskip\zeropoint -% \OTRSETcolumnseparator -% \par -% \egroup -% \fi -% % brrr: -% \ejectinsert -% \ejectpage -% \OTRSETsynchronizehsize} % no \OTRSETsethsize, can be mid smaller (like tabulate) -% -% \installcolumnbreakhandler {SET} \v!forceer -% {\OTRSETgotocolumn[\v!forceer]} -% \installcolumnbreakhandler {SET} \v!eerste -% {\OTRSETgotocolumn[\v!eerste]} -% \installcolumnbreakhandler {SET} \v!laatste -% {\OTRSETgotocolumn[\v!laatste]} -% -% \installcolumnbreakhandler {SET} \v!pagina -% {\simplepagebreak % \flushnotes \executepagebreakhandler\v!ja -% \ifnum\mofcolumns>\plusone -% \OTRSETgotocolumn[\v!laatste,\v!forceer]% -% \fi} - -\def\OTRSETcolumnhbreak - {\ifhmode - \bgroup - \removeunwantedspaces - \parfillskip\zeropoint - \OTRSETcolumnseparator - \par - \egroup - \fi} - -\installcolumnbreakhandler {SET} \v!local - {\OTRSETcolumnhbreak - \ejectinsert - \ejectpage % brrr - % no \OTRSETsethsize, can be mid smaller (like tabulate) - % also, this one should be executed at the outer level - % (setting hsize inside otr does not work) - \OTRSETsynchronizehsize} - -% We need to make sure that we really leave the column; mid -% column we may end up in an empty gap, and we don't want to -% stay there (basically such a gap is a small empty page -% then). - -\installcolumnbreakhandler {SET} \v!yes - {\OTRSETcolumnhbreak - \edef\savedmofcolumns{\the\mofcolumns}% - \edef\savedrealpageno{\the\realpageno}% - \ejectinsert - \ejectpage % brrr - \doloop - {\ifnum\savedmofcolumns=\mofcolumns - \ifnum\savedrealpageno=\realpageno - \OTRSETdummycolumn - \else - \exitloop - \fi - \else - \exitloop - \fi}% - \OTRSETsynchronizehsize} - -\installcolumnbreakhandler {SET} \s!unknown - {\expanded{\OTRSETgotocolumn[\@@columnspecification]}} - -\installcolumnbreakhandler {SET} \v!page - {\vfill\eject % \doejectpage\eject - \OTRSETgotonextpage} - -\newtoks\OTRSETeverystartofcolumn - -\newbox\OTRSETsavedfootnotes - -% \installoutput\OTRSETflushtextsofar % spacing goes wrong - -%\def\OTRSETflushtextsofar -% {\ifvoid\normalpagebox \else -% \setbox\scratchbox\vbox{\unvbox\normalpagebox}% -% \OTRSETsavenotes -% \OTRSEThandleflushedtext0 -% \fi} - -% The complication is in the fact that when the HERE float -% is placed, the otr is not invoked when there is not yet -% enough content; this can lead to a change in order (turning -% on the tracer with option 0 is very instructive, watch the -% small numbers in the margin) -% -% 0 = no flushing, so no interference but user should handle -% border cases of placement -% 1 = the normal otr, rather untested -% 2 = a solution that works ok, is experimental and above -% all messy - -\chardef\OTRSETflushtextmode=0 - -\def\OTRSETflushtextsofar - {\ifcase\OTRSETflushtextmode - % don't mess around - \or - % the normal one - \ifvoid\normalpagebox\else - \OTRSETnaturalflush - \OTRSETcheckfreelines - \fi - \or - % way to complicated, but kind of ok - \doOTRSETflushtextsofar - \fi} - -\newskip\lastskipinotr - -\installoutput\doOTRSETflushtextsofar % experimental - {\ifvoid\normalpagebox\else - \scratchdimen\dp\normalpagebox - \setbox\scratchbox\vbox - {\forgetall - \unvbox\normalpagebox - \global\lastskipinotr\lastskip\relax - \ifdim\lastskipinotr>\zeropoint\relax - \removelastskip - \else - \kern-\scratchdimen % handle depth - \fi}% - \ifdim\lastskipinotr>\zeropoint - \scratchskip\ht\scratchbox - \setbox\scratchbox\hbox - {\lower\strutdepth\box\scratchbox}% - \dp\scratchbox\scratchdimen - \ht\scratchbox\scratchskip - \fi - \OTRSETsavenotes - \OTRSEThandleflushedtext\zerocount - \ifdim\lastskipinotr>\zeropoint - %\vskip \lastskipinotr % hm, gets lost anyway - \else - % we should not discard skips after here; tricky - \fi - \OTRSETsetvsize - \fi} - -\def\OTRSETplacebottomnotes - {\iflastcolumnfootnotes - \ifnum\nofcolumns=\mofcolumns - \ifintermediatefootnotes \placebottomnotes \fi - \fi - \else - \placebottomnotes - \fi} - -\def\OTRSETflushsavednotes - {\iflastcolumnfootnotes - \ifnum\nofcolumns=\mofcolumns - \flushsavednotes - \fi - \else - \flushsavednotes - \fi} - -\def\OTRSETsavenotes - {\iflastcolumnfootnotes - \ifnum\nofcolumns=\mofcolumns \else - \savenotes - \fi - \fi} - -\appendtoks \OTRSETflushsavednotes \to \OTRSETeverystartofcolumn - -\def\OTRSETnaturalflush - {\bgroup - \forgetall % new, needed ! - \setbox0\vbox to \columnfreecells\lineheight - {\vskip-\topskip - \vskip\lineheight - \prevdepth\strutdp - \unvbox\normalpagebox - \vfill}% - \setbox2\hbox - {\OTRSETplacebottomnotes}% - \setbox\scratchbox\hbox - {\wd0\zeropoint\box0\box2}% - \dp\scratchbox\strutdp - \OTRSEThandleflushedtext\plusone - \egroup} - -\newcount\lastcolumnlastcell - -\def\OTRSEThandleflushedtext#1% - {\getnoflines{\ht\scratchbox}% - %\wd\scratchbox\textwidth % geen \hsize kan < zijn in bv split tabulate - \wd\scratchbox\OTRSETlocalwidth\mofcolumns - \doOTRSETsetgridcells - {\copy\placeholderboxf} - \mofcolumns\columnfirstcell\plusone\noflines - {\registeredtextarea1\columnfirstcell\scratchbox}% == \hbox / tricky htcorr == \columnfirstcell - \global\columnlastcell\columnfirstcell - \global\advance\columnlastcell \noflines - \global\lastcolumnlastcell\columnlastcell - \global\advance\lastcolumnlastcell \minusone - % find next (acceptable) gap, todo: deadcycle - \ifcase#1\else - \OTRSETfillgapsbetweencells\mofcolumns\columnlastcell - \fi - \OTRSETfindnextgap - % \message{\the\mofcolumns,\the\columnfirstcell,\the\columnfreecells}% - % \wait - % we cannot adapt the hsize since it may have changed (like - % inside a tabulate) so we only change it when there is a - % reason to do so - \OTRSETsynchronizehsize - \OTRSETsetvsize} - -\def\OTRSETfindnextgap - {\OTRSETsetfreecells\mofcolumns\columnlastcell - \ifsomefreecolumncells - % okay - \bubbleOTRSETmarks % not robust because we reenter - \else - \registerOTRSETmarks % not robust because we reenter - \global\advance\mofcolumns \plusone - \ifnum\mofcolumns>\nofcolumns - \OTRSETdoflush - \global\columnlastcell\plusone - \global\columnfirstcell\zerocount - \OTRSETdoflushfloats - \else - \the\OTRSETeverystartofcolumn - \global\columnlastcell\plusone - \global\columnfirstcell\zerocount - \fi - \fi} - -\let\OTRSETcheckfreelines\donothing - -\def\OTRSETfillgapsbetweencells#1#2% col - {\ifnum\columngaplimit>\zerocount - \donefalse - \dostepwiserecurse{#2}\columnmaxcells\plusone - {\OTRSETdoifcellelse{#1}\recurselevel - {\ifdone - \!!countb\recurselevel \advance\!!countb -\!!counta\relax - \ifnum\!!countb>\plusone - \advance\!!countb \minusone - \ifnum\!!countb<\columngaplimit\relax - \!!countb\recurselevel \advance\!!countb \minusone - \dostepwiserecurse\!!counta\!!countb\plusone - {\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}% - %\message{[gap]}% - \fi - \fi - \fi - \donefalse} - {\ifdone \else - \donetrue - \!!counta\recurselevel - \fi}}% - \fi} - -\appendtoks - \OTRSETfillgapsbetweencells\mofcolumns\plusone -\to \OTRSETeverystartofcolumn - -%\def\OTRSETfreezeminimumgap#1% -% {\OTRSETgetmaxfreecells{#1}{1}% -% \ifnum\columnmaxfreecells>0 -% \!!countb=\columnfrmfreecells -% \!!counta=\!!counta \advance\!!counta -\columnmaxfreecells -% \dorecurse{\columnmaxcells} -% {\ifnum\recurselevel<\!!counta\relax -% \donetrue -% \else\ifnum\recurselevel>\!!countb -% \donetrue -% \else -% \donefalse -% \fi\fi -% \ifdone -% \OTRSETdoifcellelse{#1}{\recurselevel} -% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}% -% \fi}% -% \fi} -% -%\def\OTRSETfillgaps#1#2#3% col from to -% {\dostepwiserecurse{#2}{#3}{1} -% {\OTRSETdoifcellelse{#1}{\recurselevel} -% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}}} -% -%\def\OTRSETfillbotgaps#1#2% col first -% {\OTRSETfillgaps{#1}{#2}{\columnmaxcells}} -% -%\def\OTRSETfilltopgaps#1#2% col last -% {\OTRSETfillgaps{#1}{1}{#2}} - -\newif\ifspancolumnslots \spancolumnslotstrue -\newif\ifcheckcolumnspan \checkcolumnspantrue - -\def\OTRSETcheckwidthgap#1#2% box size - {\ifcheckcolumnspan - \bgroup - \scratchdimen#2% - \advance\scratchdimen-\wd#1\relax - \ifdim-10\scaledpoint>\scratchdimen - \egroup - \else\ifdim10\scaledpoint<\scratchdimen - \egroup - \else - \egroup - \wd#1=#2% - \fi\fi - \fi} - -\def\OTRSETcheckcolumnslot#1% - {\enoughcolumncellstrue - \ifspancolumnslots\else - \OTRSETcheckwidthgap#1\hsize - \ifdim\wd#1>\hsize - \enoughcolumncellsfalse - \fi - \fi - \ifenoughcolumncells - \getnoflines\pagetotal - \scratchcounter\noflines - \getnoflines{\ht#1}% - \columnvcells\noflines - \columnhcells\plusone - \advance\scratchcounter \columnvcells \relax - \ifnum\scratchcounter>\columnfreecells - \enoughcolumncellsfalse - \fi - \fi} - -\def\OTRSETstoreincolumnslotPAGE#1% - {\ifenoughcolumncells - % to do - \OTRSETsavebox{#1}% - \else - \OTRSETsavebox{#1}% - \fi} - -\def\OTRSETstoreincolumnslotTOPS#1% - {\OTRSETprepareforcolumnslot1{#1}% - \OTRSETcheckcolumnslot{#1}% - \ifenoughcolumncells - \OTRSETcheckcolumnspace\mofcolumns\columnfirstcell{#1}% - \fi - \ifenoughcolumncells - \OTRSETsetgridcells\mofcolumns\columnfirstcell\columnhcells\columnvcells - {\hbox{\copy#1}}% - \OTRSETsetvsize - \else - \OTRSETsavebox{#1}% - \fi} - -\def\OTRSETstoreincolumnslotBOTS#1% - {\OTRSETprepareforcolumnslot3{#1}% - \edef\savedcolumnlastcell{\the\columnlastcell}% - \OTRSETcheckcolumnslot{#1}% - \ifenoughcolumncells - \advance\columnlastcell -\columnvcells \advance\columnlastcell \plusone -% \OTRSETcheckcolumnspace\mofcolumns\columnfirstcell{#1}% - \OTRSETcheckcolumnspace\mofcolumns\columnlastcell{#1}% - \fi - \ifenoughcolumncells - \OTRSETsetgridcells\mofcolumns\columnlastcell\columnhcells\columnvcells{\copy#1}% - \OTRSETfillgapsbetweencells\mofcolumns\savedcolumnlastcell % -) - \OTRSETsetvsize - \else - \columnlastcell\savedcolumnlastcell - \OTRSETsavebox{#1}% - \fi} - -\newdimen\totalcolumnspace - -\def\columnspacetopoffset{0} -\def\columnspacebotoffset{0} - -\def\OTRSETcheckcolumnspace#1#2#3% col row box - {\columnhcells\plusone - \totalcolumnspace\zeropoint - \scratchcounter#1% - \enoughcolumncellstrue - \doloop - {\advance\totalcolumnspace \OTRSETlocalwidth\scratchcounter\relax % needed -\OTRSETcheckwidthgap#3\totalcolumnspace - \ifnum\wd#3>\totalcolumnspace\relax - \ifnum\scratchcounter=\nofcolumns - \enoughcolumncellsfalse - \exitloop - \else - \advance\columnhcells \plusone - \advance\scratchcounter \plusone - \advance\totalcolumnspace \OTRSETgetparameter\c!distance\scratchcounter - \fi - \else - \exitloop - \fi}% - \ifenoughcolumncells - \getnoflines{\ht#3}% - \columnvcells\noflines - \OTRSETcheckcolumncells{#1}{#2}\columnhcells\columnvcells - \fi} - -\def\OTRSETcheckcolumncells#1#2#3#4% col row wid hei - {\!!countd#1\advance\!!countd#3\advance\!!countd\minusone - \!!counte#2\advance\!!counte#4\advance\!!counte\minusone - \ifnum\!!counte>\columnmaxcells\relax - \enoughcolumncellsfalse - \else - \enoughcolumncellstrue -%\let\columnspacetopoffset\zerocount -%\scratchcounter#2\advance\scratchcounter\minusone -%\ifnum\scratchcounter>0 -% \dostepwiserecurse{#1}\!!countd\plusone -% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint -% \let\columnspacetopoffset\plusone -% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint -% \let\columnspacetopoffset\plusone -% \fi\fi}% -% \advance\!!counte \columnspacetopoffset \relax -% \advance\columnvcells \columnspacetopoffset \relax -%\fi -%\let\columnspacebotoffset\zerocount -%\scratchcounter\!!counte -%\advance\scratchcounter \columnvcells \relax -%\ifnum\scratchcounter>\columnmaxcells\else -% \dostepwiserecurse{#1}\!!countd\plusone -% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint -% \let\columnspacebotoffset\plusone -% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint -% \let\columnspacebotoffset\plusone -% \fi\fi}% -% \advance\!!counte \columnspacebotoffset \relax -% \advance\columnvcells \columnspacebotoffset \relax -%\fi - \dostepwiserecurse{#1}\!!countd\plusone % cols - {\ifenoughcolumncells - \!!countf\recurselevel\relax - \dostepwiserecurse{#2}\!!counte\plusone % rows - {\ifenoughcolumncells - \OTRSETdoifcellelse\!!countf\recurselevel - {\enoughcolumncellsfalse}{}% - \fi}% - \fi}% - \fi} - -\def\OTRSETsetpreferedcolumnslot#1#2% - {\doifsomething{#1}{\edef\preferedcolumn{#1}}% - \doifsomething{#2}{\edef\preferedrow {#2}}} - -\OTRSETsetpreferedcolumnslot{\nofcolumns}{1} % default ? - -\let\pofcolumns\mofcolumns -\let\qofcolumns\mofcolumns - -\newif\ifquitincurrentcolumn - -\def\OTRSETstoreincolumnslotLRTB#1% - {\OTRSETprepareforcolumnslot1{#1}% - \OTRSETflushtextsofar - \OTRSETstoreincolumnslotindeed - \mofcolumns\nofcolumns+\currenthcell - \plusone\columnmaxcells+\currentvcell{#1}} - -\def\OTRSETstoreincolumnslotLRBT#1% - {\OTRSETprepareforcolumnslot3{#1}% - \OTRSETflushtextsofar - \OTRSETstoreincolumnslotindeed - \mofcolumns\nofcolumns+\currenthcell - \columnmaxcells\plusone-\currentvcell{#1}} - -\def\OTRSETstoreincolumnslotRLTB#1% - {\OTRSETprepareforcolumnslot1{#1}% - \OTRSETflushtextsofar - \OTRSETcheckprefered - \OTRSETstoreincolumnslotindeed - \nofcolumns\qofcolumns-\currenthcell - \plusone\columnmaxcells+\currentvcell{#1}} - -\def\OTRSETstoreincolumnslotRLBT#1% - {\OTRSETprepareforcolumnslot3{#1}% - \OTRSETflushtextsofar - \OTRSETcheckprefered - \OTRSETstoreincolumnslotindeed - \nofcolumns\qofcolumns-\currenthcell - \columnmaxcells\plusone-\currentvcell{#1}} - -\def\OTRSETstoreincolumnslotTBLR#1% - {\OTRSETprepareforcolumnslot1{#1}% - \OTRSETflushtextsofar - \OTRSETstoreincolumnslotindeed - \plusone\columnmaxcells+\currentvcell - \mofcolumns\nofcolumns+\currenthcell{#1}} - -\def\OTRSETstoreincolumnslotTBRL#1% - {\OTRSETprepareforcolumnslot1{#1}% - \OTRSETflushtextsofar - \OTRSETcheckprefered - \OTRSETstoreincolumnslotindeed - \plusone\columnmaxcells+\currentvcell - \nofcolumns\qofcolumns-\currenthcell{#1}} - -\def\OTRSETstoreincolumnslotBTLR#1% - {\OTRSETprepareforcolumnslot3{#1}% - \OTRSETflushtextsofar - \OTRSETstoreincolumnslotindeed - \columnmaxcells\plusone-\currentvcell - \mofcolumns\nofcolumns+\currenthcell{#1}} - -\def\OTRSETstoreincolumnslotBTRL#1% - {\OTRSETprepareforcolumnslot3{#1}% - \OTRSETflushtextsofar - \OTRSETcheckprefered - \OTRSETstoreincolumnslotindeed - \columnmaxcells\plusone-\currentvcell - \nofcolumns\qofcolumns-\currenthcell{#1}} - -\def\OTRSETstoreincolumnslotFXTB#1% fixed column - {\OTRSETcheckprefered - \OTRSETdoifcellelse\pofcolumns\plusone - {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot1}{#1}% % 1/2 dependent of place, todo - \OTRSETflushtextsofar - \OTRSETstoreincolumnslotindeed - \pofcolumns \pofcolumns +\currenthcell - \preferedrow\columnmaxcells+\currentvcell{#1}} - -\def\OTRSETstoreincolumnslotFXBT#1% fixed column - {\OTRSETcheckprefered - \OTRSETdoifcellelse\pofcolumns\columnmaxcells - {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot3}{#1}% % 3/2 dependent of place, todo - \OTRSETflushtextsofar - \OTRSETstoreincolumnslotindeed - \pofcolumns \pofcolumns +\currenthcell - \columnmaxcells\preferedrow-\currentvcell{#1}} - -% \def\OTRSETstoreincolumnslotHERE#1% fixed column -% {\OTRSETprepareforcolumnslot2{#1}% -% \OTRSETflushtextsofar -% \getnoflines\pagetotal \advance\noflines\columnfirstcell -% \OTRSETstoreincolumnslotindeed -% \mofcolumns\mofcolumns+\currenthcell -% \noflines\columnmaxcells+\currentvcell{#1}% -% \OTRSETsetvsize} - -\chardef\OTRSETforcefixedfloats=0 - -\def\OTRSETstoreincolumnslotHERE#1% fixed column - {\ifcase\OTRSETforcefixedfloats - \OTRSETstoreincolumnslotSOMEWHERE2{#1}% - \else - \OTRSETstoreincolumnslotFIXD{#1}% - \fi} - -% this one looses too wide graphics -% -% \def\OTRSETstoreincolumnslotFIXD#1% fixed column -% {\OTRSETprepareforcolumnslot2{#1}% -% % no flush text sofar here, beware: no width test -% \snaptogrid\vbox{\box#1}} -% -% still imperfect - -\def\OTRSETstoreincolumnslotFIXD#1% fixed column - {\OTRSETflushtextsofar - \ifdim\wd#1>\textwidth - \OTRSETstoreincolumnslotSOMEWHERE2{#1}% - \else - % crappy test / needed for o-pbu-f / will be replaced - \getnoflines{\ht#1}% - \scratchdimen\noflines\lineheight - \advance\scratchdimen\lineheight - \advance\scratchdimen\pagetotal\relax - \ifdim\scratchdimen<\pagegoal - %OTRSETprepareforcolumnslot3{#1}% - %ruledvskip\columnslotspacing\lineheight - \blank[\columnslotspacing*\v!line]% - \snaptogrid\hbox to \hsize{\hss\box#1\hss}% strange, why the centering - \blank[\columnslotspacing*\v!line]% - \else - \OTRSETstoreincolumnslotSOMEWHERE2{#1}% - \fi - \fi} - -\def\OTRSETstoreincolumnslotSOMEWHERE#1#2% - {\OTRSETprepareforcolumnslot{#1}{#2}% - \OTRSETflushtextsofar - \getnoflines\pagetotal \advance\noflines\columnfirstcell - \OTRSETstoreincolumnslotindeed - \mofcolumns\mofcolumns+\currenthcell - \noflines\columnmaxcells+\currentvcell{#2}% - \OTRSETsetvsize} - -\def\OTRSETcheckprefered - {\ifnum\preferedcolumn<\mofcolumns - \let\pofcolumns\mofcolumns - \else - \let\pofcolumns\preferedcolumn - \fi - \ifquitincurrentcolumn - \ifnum\mofcolumns=\nofcolumns - \def\qofcolumns{\mofcolumns}% - \else - \scratchcounter\mofcolumns - \advance\scratchcounter \plusone - \edef\qofcolumns{\the\scratchcounter}% - \fi - \else - \let\qofcolumns\mofcolumns - \fi} - -\def\OTRSETstoreincolumnslotindeed#1#2#3#4#5#6#7#8#9% - {\OTRSETcheckprefered - \enoughcolumncellsfalse - \donefalse - \dostepwiserecurse{#1}{#2}{#31} - {\ifdone - \exitloop - \else - #4=\recurselevel - \dostepwiserecurse{#5}{#6}{#71} - {\ifdone - \exitloop - \else - #8=\recurselevel - \OTRSETcheckcolumnspace\currenthcell\currentvcell{#9}% - \ifenoughcolumncells \donetrue \fi - \fi}% - \fi}% - \ifdone - \enoughcolumncellstrue - \else - \enoughcolumncellsfalse - \fi - \ifenoughcolumncells -% \ifnum\columnspacetopoffset>0\message{[+++]}\fi -% \ifnum\columnspacebotoffset>0\message{[---]}\fi -% \OTRSETsetgridcells\currenthcell\currentvcell\columnhcells\columnvcells -% {\vbox -% {\ifcase\columnspacetopoffset\else\ruledvskip\columnspacetopoffset\lineheight\fi -% \copy#9 -% \ifcase\columnspacebotoffset\else\ruledvskip\columnspacebotoffset\lineheight\fi}}% - \OTRSETsetgridcells\currenthcell\currentvcell\columnhcells\columnvcells - {\copy#9}% - \ifnum\currenthcell=\mofcolumns\relax - \ifdim\ht\OTRSETsavedfootnotes>\zeropoint - \OTRSETsetfreecells\mofcolumns\columnfirstcell - \ifsomefreecolumncells - \getnoflines{\ht\OTRSETsavedfootnotes}\relax - \ifnum\columnfreecells<\noflines - \global\somefreecolumncellsfalse - \else - %\message{[flt]}% float - \fi - \fi - \ifsomefreecolumncells - % ok, enough room for notes - %\message{[flt]}% float - \else % ? - \OTRSETsavebox{#9}% - \OTRSETerasegridcells\currenthcell\currentvcell\columnhcells\columnvcells - %\message{[clr]}% save box - \fi - \else - %\message{[flt]}% float - \fi - \else - %\message{[flt]}% float - \fi - \OTRSETsetvsize - %\message{[fnt]}% float - \else - %\message{[rej]}% save box - \OTRSETsavebox{#9}% - \fi} - -\chardef\columnslotspacing \plusone - -\def\OTRSETstoreincolumnslot#1% #2 % {method} {box} % alleen last - {% no messing around here - % \dp#2=\zeropoint - % \ifcase\columnslotspacing\else - % \setbox#2=\vbox spread \columnslotspacing\lineheight - % {\vss\box#2\vss}% - % \fi - % and don't change this any more -% \doifdefinedelse{\strippedcsname\OTRSETstoreincolumnslot#1} -% {\getvalue{\strippedcsname\OTRSETstoreincolumnslot#1}{#2}} -% {\OTRSETstoreincolumnslotUNKNOWN{#2}}} - \executeifdefined{\strippedcsname\OTRSETstoreincolumnslot#1} - \OTRSETstoreincolumnslotUNKNOWN} % {#2}} - -\def\OTRSETstoreincolumnslotUNKNOWN#1% - {\OTRSETprepareforcolumnslot2{#1}\copy#1} % {} ? - -% \def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag -% {\dp#2\zeropoint -% \ifcase\columnslotspacing\else -% \scratchdimen\columnslotspacing\lineheight -% \ifnum#1=2 \scratchdimen2\scratchdimen \fi -% \setbox#2\vbox spread \scratchdimen -% {\ifnum#1>1\vss\fi\box#2\relax\ifnum#1<3\vss\fi}% -% \fi} - -\def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag - {\dp#2\zeropoint - \ifcase\columnslotspacing\else - \scratchdimen\columnslotspacing\lineheight - \ifnum#1=2 \scratchdimen2\scratchdimen \fi - \begingroup - \advance\scratchdimen\ht#2\relax - \ifdim\scratchdimen<\columnmaxcells\lineheight - \endgroup \setbox#2\vbox spread \scratchdimen \bgroup - \else - \endgroup \setbox#2\vbox to \columnmaxcells\lineheight \bgroup - \vskip\strutdepth - \fi - \ifnum#1>1\vss\fi - \box#2\relax - \ifnum#1<3\vss\fi - \egroup - \fi} - -\def\OTRSETdocheckiffloatfits % eigenlijk moet else float anders - {\global\ifnofloatpermitted\roomforfloatfalse\else\roomforfloattrue\fi} - -\def\OTRSETunpreparebox#1% - {\ifhbox#1% spans and so - \global\setbox\floatbox\vbox{\box#1}% - \else - \setbox\scratchbox\vbox - {\unvbox#1\unskip\unskip\unskip - \global\setbox\floatbox\lastbox}% - \fi} - -\def\OTRSETsavebox#1% clean up the skips - {\OTRSETunpreparebox{#1}% - \dosavefloat} - -\def\OTRSETresavebox#1% clean up the skips - {\OTRSETunpreparebox{#1}% - \doresavefloat} - -\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge - {\iftestfloatbox\ruledhbox\fi{\box\floatbox}} - -\def\OTRSETdoflushfloats - {\bgroup - \def\OTRSETsavebox##1{\!!doneafalse}% - \doloop - {\ifsomefloatwaiting -\OTRSETskipstart - \dogetfloat - \ifdim\wd\floatbox>\zeropoint - \!!doneatrue - \dp\floatbox\zeropoint - \OTRSETstoreincolumnslot{TBLR}\floatbox - \if!!donea - %\message{[flu]}% - \else - \OTRSETresavebox\floatbox - \exitloop - \fi - \else - %\message{[err]}% happens but why? - \fi - \else - \exitloop - \fi} - \egroup} - -\newif\ifcentergridcells \centergridcellstrue - -\newif\ifcentergridcellonly \centergridcellonlyfalse -\newif\ifautocentergridcellonly \autocentergridcellonlytrue - -\def\OTRSETcentergridcells - {\ifcentergridcells - \dorecurse\nofcolumns - {\currenthcell\recurselevel - \ifautocentergridcellonly - % we prevent centering when the next column is empty - % to be checked ! ! ! ! - \advance\currenthcell \plusone - \centergridcellonlytrue - \ifnum\currenthcell>\nofcolumns - % ok already - \else - % only span if there is a next column with content - \dorecurse\columnmaxcells - {\ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint - \centergridcellonlyfalse - \else\ifdim\dp\OTRSETgridcell\currenthcell\currentvcell>\zeropoint - \centergridcellonlyfalse - \fi\fi}% - \fi - \fi - \currenthcell\recurselevel - \dorecurse\columnmaxcells - {\currentvcell\recurselevel\relax - \ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint - \ifdim\dp\OTRSETgridcell\currenthcell\currentvcell=\zeropoint - \bgroup - \setbox\scratchbox\OTRSETgetgridcell\currenthcell\currentvcell - \getnoflines{\ht\scratchbox}% - \!!counta\currentvcell - \advance\!!counta -\noflines - \advance\!!counta \plusone - % first col always ok - \!!countb\currenthcell - \!!countc\currenthcell - \advance\!!countc \plusone - \!!donebtrue - \ifcentergridcellonly - \!!countc\maxdimen - \fi - \dostepwiserecurse\!!countc\nofcolumns\plusone - {\if!!doneb - \let\xrecurselevel\recurselevel - \dostepwiserecurse\!!counta\currentvcell\plusone - {\ifdim\ht\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint - \!!donebfalse - \else\ifdim\wd\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint - \!!donebfalse - \fi\fi}% - \if!!doneb - \!!countb\xrecurselevel - \fi - \fi}% - \totalcolumnspace\OTRSETlocalwidth\currenthcell - \dostepwiserecurse\!!countc\!!countb\plusone - {\advance\totalcolumnspace \OTRSETlocalwidth\recurselevel - \advance\totalcolumnspace \OTRSETgetparameter\c!distance\recurselevel}% - \ifdim\totalcolumnspace>\wd\scratchbox - \setbox\scratchbox\hbox to \totalcolumnspace{\hss\box\scratchbox\hss}% - \fi - \OTRSETsetgridcell\currenthcell\currentvcell\box\scratchbox - \egroup - \fi - \fi}}% - \fi} - -\def\OTRSETinitializecolumns% once per page - {\columnspreadtrue % todo - \ifcolumnspread - \global\rofcolumns\getvalue{\??mc\OTRSETidentifier\c!nright}% - \global\lofcolumns\getvalue{\??mc\OTRSETidentifier\c!nleft}% - \global\tofcolumns\rofcolumns \relax - \ifodd\realpageno\relax - \global\nofcolumns\rofcolumns - \else - \global\advance\tofcolumns\lofcolumns - \global\nofcolumns\lofcolumns - \fi - \else - \global\nofcolumns\getvalue{\??mc\OTRSETidentifier\c!n}% - \global\rofcolumns\nofcolumns - \global\lofcolumns\nofcolumns - \global\tofcolumns\nofcolumns - \fi - \OTRSETassignwidths - \global\mofcolumns\plusone - \columnerasegridboxes} - -% vanaf hier: - -\def\definecolumnset - {\dodoubleargument\dodefinecolumnset} - -\def\dodefinecolumnset[#1][#2]% - {\getparameters[\??mc#1] - [\c!direction=\v!right, - \c!balance=\v!no, - \c!distance=1.5\bodyfontsize, % controleren - \c!n=2, - \c!nleft=\getvalue{\??mc#1\c!n}, - \c!nright=\getvalue{\??mc#1\c!n}, - \c!width=\v!fit, - \c!lines=0, - \c!start=0, - #2]% - \dorecurse{\getvalue{\??mc#1\c!nleft}} % todo - {\dododefinecolumnset[#1][\recurselevel]}% - \dorecurse{\getvalue{\??mc#1\c!nright}} % todo - {\dododefinecolumnset[#1][\recurselevel]}% - % redo framed settings - \setupcolumnset[#1][1][\c!distance=\!!zeropoint]} - -\def\dododefinecolumnset[#1][#2]% - {\presetlocalframed - [\??mc#1#2]% - \setupcolumnset - [#1][#2] - [\c!offset=\v!overlay, - \c!frame=\v!off, - \c!align=, - \c!lines=0,% really needed since c!regels is now part of framed - \c!width=\getvalue{\??mc#1\c!width}, - \c!distance=\getvalue{\??mc#1\c!distance}]} - -\def\setupcolumnset - {\dotripleargument\dosetupcolumnset} - -\def\dosetupcolumnset[#1][#2][#3]% - {\ifthirdargument - \def\docommand##1% - {\doifelse{##1}\v!each - {\dorecurse{\getvalue{\??mc#1\c!n}}{\docommand\recurselevel}} - {\getparameters[\??mc#1##1][#3]}}% - \processcommalist[#2]\docommand - \else - \getparameters[\??mc#1][#2]% - \fi} - -\definecolumnset[\s!default][\c!n=2] % fallback - -\def\OTRSETgotonextpage - {\vfill\eject - \relax\ifnum\mofcolumns>\plusone - \OTRSETgotocolumn[\v!last]% - \ifnum\mofcolumns>\plusone - \OTRSETgotocolumn[\v!force]% - \fi - \fi} - -\let\OTRSETgotonextpageX\OTRSETgotonextpage % will become obsolete - -\def\OTRSETgotocolumn - {\dosingleempty\doOTRSETgotocolumn} - -\def\doOTRSETgotoCOLROW#1% |* - {\bgroup % really needed - \splitstring#1\at*\to\column\and\row - \bgroup - \ifx\column\empty\else\expanded{\doOTRSETgotoCOLUMN{\column}}\fi - \egroup - \bgroup - \ifx\row \empty\else\expanded{\doOTRSETgotoROW {\row }}\fi - \egroup - \egroup} - -\def\doOTRSETgotoCOLUMN#1% - {\ifnum\mofcolumns=#1\else - \vfill\eject % \doejectpage\eject - \doloop - {\ifnum\mofcolumns=#1\relax - \exitloop \else \OTRSETdummycolumn - \fi}% - \fi} - -\def\doOTRSETgotoROW#1% - {\ifnum#1>1 - \scratchcounter\zerocount - \currenthcell\mofcolumns - \currentvcell#1\advance\currentvcell \minusone - \dorecurse\currentvcell - {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing - {\advance\scratchcounter\plusone}} - \getnoflines\pagetotal - \advance\scratchcounter-\noflines - \ifnum\scratchcounter>\zerocount - \dorecurse\scratchcounter{\line{\strut}}% - \fi - \fi - \OTRSETsetvsize} - -\def\doOTRSETgotocolumn[#1]% yes|force|first|last||* - {\processallactionsinset - [#1] - [ \v!yes=>\OTRSETdummycolumn, - \v!no=>,% not supported - \v!force=>\OTRSETdummycolumn, - \v!first=>\expanded{\doOTRSETgotoCOLUMN{1}}, - \v!last=>\expanded{\doOTRSETgotoCOLUMN{\the\nofcolumns}}, - \s!default=>\OTRSETdummycolumn, - \s!unknown=>\expanded{\doOTRSETgotoCOLROW{\commalistelement}}]} - -% to be documented and tested, not yet that robust - -% \def\OTRSETgotocell#1#2% -% {\endgraf -% \gdef\gotocellcounter{0}% -% \doloop -% {\ifnum\mofcolumns<#1\relax -% \doglobal\increment\gotocellcounter\relax -% \ifnum\gotocellcounter>#1\relax -% \line{\strut}\crlf -% \line{\strut}\crlf -% \column -% \writestatus{columnset}{quitting goto cell}% -% \exitloop -% \else -% \column -% \fi -% \else -% \exitloop -% \fi}% -% \ifnum\mofcolumns=#1\relax -% \ifnum#2>1 -% \scratchcounter\zerocount -% \currenthcell\mofcolumns -% \currentvcell#2\advance\currentvcell \minusone -% \dorecurse\currentvcell -% {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing -% {\advance\scratchcounter\plusone}} -% \getnoflines\pagetotal -% \advance\scratchcounter-\noflines -% \ifnum\scratchcounter>\zerocount -% \dorecurse\scratchcounter{\line{\strut}}% -% \fi -% \fi -% \fi -% \OTRSETsetvsize} - -\def\OTRSETgotocell#1#2% obsolete: now \column[#1*#2] - {\endgraf - \doOTRSETgotoCOLUMN{#1}% - \doOTRSETgotoROW {#2}} - -\def\OTRSETdummycolumn - {\verticalstrut - \vskip-\struttotal - \vfill - \eject} - -\newcounter\columnsetlevel -\let\currentcolumnset\empty -\chardef\OTRSETfinish\zerocount - -\def\startcolumnset - {\dodoubleempty\dostartcolumnset} - -\def\dostartcolumnset[#1][#2]% - {\increment\columnsetlevel\relax - \globallet\localcolumnmaxcells\!!zerocount - \global\chardef\OTRSETfinish\zerocount - \resetOTRSETmarks - \ifnum\columnsetlevel=\plusone - \bgroup - \saveinterlinespace - \globallet\columnsetpage\!!plusone - \def\currentcolumnset{#2}% - \insidecolumnstrue % will be different flag in addition - \activateotr{SET}{ONE}% andere naam, activate or so - \doifelsenothing{#1} - {\globallet\OTRSETlist\s!default} - {\xdef\OTRSETlist{#1}}% - \OTRSETstartnextpage - \OTRSETassignwidths - \OTRSETsethsize - \else - \bgroup - \fi} - -% \setuplayout[grid=yes] \definecolumnset[example] \showgrid - -% \starttext -% \startcolumnset[example] -% \input knuth \endgraf \input knuth -% \placetable{table}{\framed[width=\makeupwidth,height=4cm]{Hello}} -% \input knuth \endgraf \input knuth -% \stopcolumnset -% \input knuth \endgraf \input knuth -% \stoptext - - -\def\OTRSETflushleftovers % new per 13/4/2006 - {\OTRSETdoifcellelse{1}{1} - {\bgroup - \OTRSETcentergridcells - \chardef\OTRSETbalancemethod\plusone - \OTRSETreducegridbox - \global\setbox\OTRfinalpagebox\OTRSETmakegridbox - \global\ht\OTRfinalpagebox\textheight % signals output that there is content - \OTRSETdofinaloutput - \globallet\OTRSETbalht\zeropoint - \egroup} - {}} - -\def\stopcolumnset - {\relax - \ifnum\columnsetlevel=\plusone - \endgraf % needed, else wrong vsize in one par case - \global\chardef\OTRSETfinish\plusone - % no, extra page \pagebreak % (test on pascal toc) - \dostopcolumnset - \egroup - \global\notelimittrue % brrr, untested and fuzzy - \setvsize - \sethsize - \ifvoid\OTRfinalpagebox\else - % probably balanced - \ifdim\ht\OTRfinalpagebox<\textheight - \snaptogrid[\v!page]\hbox{\box\OTRfinalpagebox}% - \else - \box\OTRfinalpagebox - \fi - \fi - \global\chardef\OTRSETfinish\zerocount - \ifsomefloatwaiting \setvsize \pagebreak \setvsize \fi - \OTRSETflushleftovers - \else - \egroup - \fi - \decrement\columnsetlevel\relax} - -\chardef\OTRSETbalancemethod\zerocount - -\def\dostopcolumnset - {%\OTRSETdofinalflushfloats % yes/no - \ifcase\OTRSETbalancemethod - \OTRSETnobalance - \else - \OTRSETdobalance - \fi} - -\def\OTRSETdobalance - {\OTRSETnobalance} - -\def\localcolumnmaxcells{0} - -% currently line represents real line, i.e. on the grid, and -% not something noflines (also, watch out for switching from -% 2-3 columns on one page with both sets balanced: the -% second set does not see the first set - -% \def\OTRSETinitbalancing -% {\ifcase\OTRSETbalancemethod\or -% \let\savedcolumnmaxcells\columnmaxcells -% \ifnum\realpageno=\balancingpageno\relax -% \ifnum\mofcolumns=\plusone -% \dorecurse\nofcolumns -% {\!!counta\recurselevel\relax -% \!!countb\getvalue{\??mc\OTRSETidentifier\number\!!counta\c!regels}\relax -% \ifcase\!!countb -% \!!countb\getvalue{\??mc\OTRSETidentifier\c!regels}\relax -% \fi -% \ifcase\!!countb -% \!!countb \savedcolumnmaxcells\relax -% \fi -% % can be an option: absolute versus relative -% \ifnum\OTRSETbalancemethod=\plusthree -% \advance\!!countb\precolumnlines -% \ifnum\!!countb>\localcolumnmaxcells\relax -% \xdef\localcolumnmaxcells{\the\!!countb}% -% \fi -% \advance\!!countb \plusone -% \dostepwiserecurse\!!countb\columnmaxcells\plusone -% {\ifvoid\OTRSETgridcell\!!counta\recurselevel -% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe -% \fi}% -% \else -% \globallet\localcolumnmaxcells\columnmaxcells -% \advance\!!countb-\columnmaxcells -% \!!countb-\!!countb -% \advance\!!countb \minusone -% \ifnum\!!countb>\zerocount -% \dostepwiserecurse\plusone\!!countb\plusone -% {\ifvoid\OTRSETgridcell\!!counta\recurselevel -% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe -% \fi}% -% \fi -% \fi}% -% \OTRSETsetvsize % ! ! ! -% \fi -% \fi -% \fi} -% -% \def\OTRSETpresetbalancing -% {\doifvaluesomething{\??mc\OTRSETidentifier\c!regels}% -% {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]% -% \ifnum\commalistsize>\plusone -% \scratchcounter\zerocount -% \def\docommand##1% -% {\advance\scratchcounter\plusone -% \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}% -% \processcommacommand -% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommand -% \setvalue{\??mc\OTRSETidentifier\c!regels}{0}% -% \fi}} - -% don't loose empty 1page/1column with area (example **) -% -% \definecolumntextarea[title][x=1,y=4,nx=2,ny=7,state=start] -% \setupcolumntextareatext[title][\vtop to 5cm{a\\b\\b\\d}] -% -% \starttext -% \startcolumnset \dorecurse{1}{\input tufte \par} \stopcolumnset -% \stoptext - -% better: - -\def\definecolumnsetarea {\definecolumntextarea} -\def\setupcolumnsetarea {\setupcolumntextarea} -\def\setupcolumnsetareatext{\setupcolumntextareatext} - -% so this will be changed - -% \def\OTRSETnobalance -% {\iflastcolumnfootnotes % testen ! optie -% % inhibit flush of floats ! -% % todo: nothing if no footnotes, else empty page -% \dostepwiserecurse\mofcolumns\nofcolumns\plusone -% {\vskip-\struttotal\verticalstrut\vfill\eject}% -% \else -% \ifdim\pagetotal>\zeropoint % no, see example ** -% \ifnum\mofcolumns=\nofcolumns -% \OTRSETflushfinalfootnotes -% \else -% % probably todo -% \fi -% \vfill -% \eject -% % brr, may result in empty page after nicely fit text -% % or if left, then lost of first column only text -% \ifnum\mofcolumns>1 -% \OTRSETdofinalflush -% \OTRSETdofinaloutput -% \fi -% \fi -% \fi} - -\def\OTRSETnobalance - {\iflastcolumnfootnotes % testen ! optie - % inhibit flush of floats ! - % todo: nothing if no footnotes, else empty page - \dostepwiserecurse\mofcolumns\nofcolumns\plusone - {\vskip-\struttotal\verticalstrut\vfill\eject}% - \else - \ifnum\mofcolumns>\plusone - \donetrue - \else\ifdim\pagetotal>\zeropoint % too dangerous, we loose data - \donetrue - \else - \donefalse - \fi\fi - \ifdone - \ifnum\mofcolumns=\nofcolumns - \OTRSETflushfinalfootnotes - \else - % probably todo - \fi - \vfill - \eject -\registerOTRSETmarks - % brr, may result in empty page after nicely fit text - % or if left, then lost of first column only text - \ifnum\mofcolumns>\plusone - \OTRSETdofinalflush - \OTRSETdofinaloutput - \fi - \fi - \fi} - -\def\OTRSETstartnextpage - {\doifsomething\OTRSETlist - {\getfromcommacommand[\OTRSETlist][1]% - \global\let\OTRSETidentifier\commalistelement - \doifundefined{\??mc\OTRSETidentifier\c!n} - {\globallet\OTRSETidentifier\s!default}% - \let\newcommalistelement\empty - \doglobal\replaceincommalist\OTRSETlist1% - \OTRSETrestart}} - -\def\OTRSETrestart % weed - {\OTRSETinitializefeatures - \OTRSETflushpreposttext - \OTRSETinitializecolumns - \OTRSETcheckinsert - \OTRSETcheckgrid - \OTRSETsetvsize - \OTRSETsethsize % or local ? - \OTRSETsetplaceholders - \OTRSEThandlepreposttext - \initializecolumntextareas % name ! - \OTRSETcheckstartcells - \OTRSETsetvsize} - -% \def\OTRSETcheckstartcells -% {\dorecurse\nofcolumns -% {\bgroup -% \mofcolumns\recurselevel -% \scratchcounter\currentcolumnstartcell % uses \mofcolumns, returns 1 or more -% \advance\scratchcounter \minusone -% \dorecurse\scratchcounter -% {\OTRSETdoifcellelse\mofcolumns\recurselevel -% \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}% -% \egroup}} - -\def\OTRSETcheckstartcells - {\dorecurse\nofcolumns - {\bgroup - \mofcolumns\recurselevel -\OTRSETsetcorrectnofcells\currentcolumnstartcell -\advance\scratchcounter \minusone - \dorecurse\scratchcounter - {\OTRSETdoifcellelse\mofcolumns\recurselevel - \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}% - \egroup}} - -% \OTRSEToutput -% {\dontcomplain % new, get rid of overfull message (to be sorted out) -% \OTRSETnaturalflush -% %\OTRSETstartnextpage -% \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) -% \OTRSETcheckfreelines -% \OTRSETchecksidefloat} - -\OTRSEToutput - {\dontcomplain % new, get rid of overfull message (to be sorted out) - \doloop - {\OTRSETnaturalflush - %\OTRSETstartnextpage % no - \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) - \OTRSETcheckfreelines - \ifsomefreecolumncells - \exitloop - \else - % flush page and get rid of more floats if present - \fi}% - \OTRSETchecksidefloat} - -\def\OTRSETinitializefeatures - {% number of lines - % new: raw - \getrawnoflines\textheight\xdef\columnmaxcells{\the\noflines}% - % direction - \doifelsevalue{\??mc\OTRSETidentifier\c!direction}\v!right - {\chardef\columndirection\zerocount} - {\chardef\columndirection\plusone}% - % balancing - \chardef\OTRSETbalancemethod\zerocount - \processaction - [\getvalue{\??mc\OTRSETidentifier\c!balance}] - [ \v!yes=>\chardef\OTRSETbalancemethod\plusone, - \v!top=>\chardef\OTRSETbalancemethod\plustwo, - \v!bottom=>\chardef\OTRSETbalancemethod\plusthree]} - -% keep 'm for a while -% -% \installoutput\OTRSETflushpreposttext -% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}% -% \ifcarryoverfootnotes \else -% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% -% \fi} -% -% to be tested on 'boekinhoud' in 'pascal/demo-bbi' -% -% junk ! ! ! ! ! -% -%\installoutput\OTRSETflushpreposttext -% {\global\setbox\precolumnbox\vbox -% {\unvbox\normalpagebox -% \strut\vskip-2\lineheight\strut}% we want a proper depth -% \ifcarryoverfootnotes \else -% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% -% \fi} -% -% \starttext -% \definecolumnset[two][n=2] -% \startcolumnset[two] \dorecurse{4}{\input tufte } \stopcolumnset -% \input tufte -% \startcolumnset[two] \input tufte \stopcolumnset -% \stoptext -% -% \installoutput\OTRSETflushpreposttext -% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}% -% \global\dp\precolumnbox\strutdepth -% \ifcarryoverfootnotes \else -% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% -% \fi} - -% test: -% -% \definecolumnset[two] [n=2,balance=yes] -% \definecolumnset[three][n=3,balance=yes] -% \setupcolumnset [two] [1] [lines=10] -% \setupcolumnset [two] [2] [lines=10] -% -% \startcolumnset[two] \dorecurse{14}{\input tufte \par} \stopcolumnset -% \startcolumnset[three] \dorecurse{12}{\input tufte \par} \stopcolumnset -% -% with: -% -% \installoutput\OTRSETflushpreposttext -% {%\ifvoid\normalpagebox -% % \global\setbox\precolumnbox\vbox{}% -% %\else -% \global\setbox\precolumnbox\vbox -% {\unvcopy\normalpagebox}% -% \global\setbox\precolumnbox\vbox to \ht\precolumnbox -% {\box\normalpagebox}% -% %\fi -% \global\dp\precolumnbox\strutdepth -% \ifcarryoverfootnotes \else -% \global\setbox\postcolumnbox\vbox{\placebottomnotes}% -% \fi} - -% testcase : pascal demo-bbi, paragraaf/aanduiding koppen - -\ifx\lastskipinotr\undefined \newskip\lastskipinotr \fi - -\installoutput\OTRSETflushpreposttext - {\global\setbox\precolumnbox\vbox - {\unvbox\normalpagebox - \global\lastskipinotr\lastskip}% - \ifdim\lastskipinotr>\zeropoint - \global\setbox\precolumnbox\hbox - {\lower\strutdepth\box\precolumnbox}% - \fi - \global\dp\precolumnbox\strutdepth - \ifcarryoverfootnotes \else - \global\setbox\postcolumnbox\vbox{\placebottomnotes}% - \fi} - -\let\precolumnlines \!!zerocount -\let\postcolumnlines\!!zerocount - -% \def\OTRSEThandlepreposttext -% {\ifdim\ht\precolumnbox>\zeropoint % new -% \getnoflines{\ht\precolumnbox}% -% \edef\precolumnlines{\the\noflines}% -% \doOTRSETsetgridcells -% {\copy\placeholderboxe} -% \plusone\plusone\nofcolumns\noflines -% {\box\precolumnbox}% -% \else -% \let\precolumnlines\!!zerocount -% \fi -% \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line -% \getnoflines{\ht\postcolumnbox}% -% \edef\postcolumnlines{\the\noflines}% -% \advance\columnfreecells -\noflines -% \advance\columnfreecells \plusone -% \doOTRSETsetgridcells -% {\copy\placeholderboxe} -% \plusone\columnfreecells\nofcolumns\noflines -% {\box\postcolumnbox}% -% \else -% \let\postcolumnlines\!!zerocount -% \fi} - -\def\OTRSEThandlepreposttext - {\ifdim\ht\precolumnbox>\zeropoint % new - \getnoflines{\ht\precolumnbox}% - \edef\precolumnlines{\the\noflines}% - \doOTRSETsetgridcells - {\copy\placeholderboxe} - \plusone\plusone\nofcolumns\noflines - % normal version (single column set) - % {\box\precolumnbox}% - % compensated for bodyfont change - {\hbox - {\OTRSETsetcorrectcellht - \raise\scratchdimen\box\precolumnbox}}% - \else - \let\precolumnlines\!!zerocount - \fi - \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line - \getnoflines{\ht\postcolumnbox}% - \edef\postcolumnlines{\the\noflines}% - \advance\columnfreecells -\noflines - \advance\columnfreecells \plusone - \doOTRSETsetgridcells - {\copy\placeholderboxe} - \plusone\columnfreecells\nofcolumns\noflines - {\box\postcolumnbox}% - \else - \let\postcolumnlines\!!zerocount - \fi} - -\def\OTRSETchecksidefloat - {} % {\sidefloatoutput} - -\def\OTRSETfinalsidefloatoutput - {} - -\def\OTRSETcheckgrid - {\topskip1\topskip - \ifforcecolumngrid - \widowpenalty\zerocount - \clubpenalty\zerocount - \brokenpenalty\zerocount - \fi} - -\def\OTRSETcheckinsert - {\iflastcolumnfootnotes - \ifnum\nofcolumns=\mofcolumns - \OTRSETforceinserts - \else - \OTRSETinhibitinserts - \fi - \else - \OTRSETforceinserts - \fi} - -\def\OTRSETforceinserts - {\enablenotes} - -\def\OTRSETinhibitinserts - {\disablenotes} - -% interface to footnotes - -\def\OTRSETassignwidths - {%\scratchdimen\makeupwidth - \freezetextwidth \scratchdimen\textwidth - % - \scratchcounter\zerocount - \dorecurse\nofcolumns - {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit - {\advance\scratchcounter \plusone } - {\advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}% - \advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!distance}}% - \ifcase\scratchcounter\else - \divide\scratchdimen \scratchcounter - \fi - \setgvalue{\??mc\??mc\c!width}{0}% - \dorecurse\nofcolumns - {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit - {\dimen0=\scratchdimen} - {\setgvalue{\??mc\??mc\c!width}{1}% - \dimen0=\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}% - \setxvalue{\??mc\recurselevel\??mc\c!width}{\the\dimen0}}} - -\def\OTRSETlocalwidth#1% - {\getvalue{\??mc\number#1\??mc\c!width}} - -\newbox\placeholderboxa -\newbox\placeholderboxb -\newbox\placeholderboxc -\newbox\placeholderboxd -\newbox\placeholderboxe -\newbox\placeholderboxf - -\def\columnplaceholder#1#2% - {\hbox - {\localcolortrue - \setbox\scratchbox\hbox to \hsize - {\iftracecolumnset \incolortrue \localcolortrue - \hskip-.5ex% - \startcolor[columnset:#2]\vrule\!!width1ex\!!height.5ex\!!depth.5ex\stopcolor - \fi - \hss}% - \ifcase#1\relax - \ht\scratchbox\zeropoint - \dp\scratchbox\zeropoint - \wd\scratchbox\zeropoint - \else - \wd\scratchbox\hsize - \ht\scratchbox\strutht - \dp\scratchbox\strutdp - \fi - \box\scratchbox}} - -\definepalet - [columnset] - [a=cyan,b=green,c=blue,d=red,e=magenta,f=darkgray] - -\def\OTRSETsetplaceholders - {\global\setbox\placeholderboxa\columnplaceholder0a% - \global\setbox\placeholderboxb\columnplaceholder0b% - \global\setbox\placeholderboxc\columnplaceholder0c% - \global\setbox\placeholderboxd\columnplaceholder0d% - \global\setbox\placeholderboxe\columnplaceholder0e% - \global\setbox\placeholderboxf\columnplaceholder1f} - -\def\doOTRSETshowstatus - {\llap{\incolortrue \localcolortrue \tt\tfxx - \startcolor[blue](\the\vsize->\number\columnfirstcell\#\number\columnfreecells)\stopcolor - \hskip\leftskip}} - -\def\OTRSETshowstatus - {\iftracecolumnset \doOTRSETshowstatus \fi} - -% \appendtoks \OTRSETshowstatus \to \everypar - -% page contents - -\def\OTRSETdopagecontents#1#2% takes two args: \box \unvbox - {\vbox to \textheight{\forgetall#1#2\pushproperties}} - -\def\OTRSETsomepagefloat {\def\floatmethod{PAGE}\OTRSETsomeslotfloat} % check -\def\OTRSETsomeherefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check -\def\OTRSETsomeelsefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check -\def\OTRSETsomefixdfloat {\def\floatmethod{FIXD}\OTRSETsomeslotfloat} % check -\def\OTRSETsometopfloat {\def\floatmethod{TOPS}\OTRSETsomeslotfloat} % check -\def\OTRSETsomebottomfloat{\def\floatmethod{BOTS}\OTRSETsomeslotfloat} % check - -\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge - {\iftestfloatbox\ruledhbox\fi{\box\floatbox}} - -\def\OTRSETsomeslotfloat[#1]% - {\setbox\floatbox\vbox{\flushfloatbox}% - \dp\floatbox\strutdp - \@EA\uppercasestring\floatmethod\to\floatmethod - \OTRSETstoreincolumnslot\floatmethod\floatbox - \doinsertfloatinfo} - -% kind of new, looks much like OTRONE, but not entirely - -\def\OTRSETdosettopinserts - {\bgroup - \ifsomefloatwaiting - \noffloatinserts\zerocount - \let\totaltopinserted\!!zeropoint - \OTRSETdodosettopinserts - \ifnum\@@bknbottom=\zerocount - \ifnum\@@bknlines>\zerocount - \ifdim\totaltopinserted>\zeropoint\relax - \dimen0\lineheight - \dimen0=\@@bknlines\dimen0 - \advance\dimen0 \totaltopinserted\relax - \ifdim\dimen0>\textheight % \vsize %%%%%%%%% \textheight - \showmessage\m!floatblocks8{\@@bknlines}% - \vfilll\eject - \fi - \fi - \fi - \fi - \fi - \egroup} - -\def\OTRSETdodosettopinserts - {\ifnum\noffloatinserts<\noftopfloats - \dogetfloat - \ifdim\topinserted=\zeropoint\relax - \topofinserttrue - \else - \topofinsertfalse - \fi - \setbox\scratchbox\vbox % kan beter ! - {\forgetall - \iftopofinsert - \ifdim\OTRSETtopoffset=\zeropoint - \moveongrid[\v!top] - \fi - \else - \betweenfloatblanko % inserts can't look back - \fi - \flushfloatbox - \blank[\@@bkspaceafter]}% - \global\advance\topinserted \ht\scratchbox\relax - \ifdim\topinserted>\vsize % was \textheight\relax - \OTRSETresavebox\floatbox - \noffloatinserts\noftopfloats\relax - \global\advance\topinserted -\ht\scratchbox - \let\OTRSETdodosettopinserts\relax % to be tested - \else - \xdef\totaltopinserted{\the\topinserted}% - \insert\topins{\forgetall\box\scratchbox}% interlineskip ? - \ifsomefloatwaiting - \advance\noffloatinserts \plusone - \else - \noffloatinserts\noftopfloats\relax - \fi - \dofloatflushedinfo - \fi - \else - \ifsomefloatwaiting - \showmessage\m!floatblocks6{\the\noftopfloats}% - \fi - \let\OTRSETdodosettopinserts\relax - \fi - \OTRSETdodosettopinserts} - -\def\OTRSETdosetbotinserts - {\bgroup - \ifsomefloatwaiting - \noffloatinserts\zerocount - \OTRSETdodosetbotinserts - \fi - \egroup} - -\def\OTRSETdodosetbotinserts - {\ifnum\noffloatinserts<\nofbotfloats\relax - \dogetfloat - \global\advance\botinserted \ht\floatbox\relax - \global\advance\botinserted \dp\floatbox\relax - \global\advance\botinserted \floattopskip\relax - \ifdim\botinserted<\pagegoal\relax - \insert\botins - {\forgetall - \blank[\@@bkspacebefore]% - \flushfloatbox}% - \ifsomefloatwaiting - \advance\noffloatinserts \plusone - \else - \noffloatinserts\nofbotfloats - \fi - \dofloatflushedinfo - \else - \OTRSETresavebox\floatbox - \noffloatinserts\nofbotfloats\relax - \fi - \global\nofloatpermittedtrue % vgl topfloats s! - \else - \ifsomefloatwaiting - \showmessage\m!floatblocks7{\the\nofbotfloats}% - \fi - \let\OTRSETdodosetbotinserts\relax - \fi - \OTRSETdodosetbotinserts} - -\let\OTRSETdosetbothinserts\relax - -\def\OTRSETdotopinsertions - {\ifvoid\topins\else - \ifvoid\columntopbox\mofcolumns - \columnsettopbox\mofcolumns\box\topins - \else - \columnsettopbox\mofcolumns\vbox % temp, must be better - {\forgetall - \offinterlineskip - \box\columntopbox\mofcolumns - \box\topins} - \fi - \fi - \global\topinserted\zeropoint\relax} % goes away - -\def\OTRSETdobotinsertions - {\ifvoid\botins \else - \columnsetbotbox\mofcolumns\box\botins -% \else -% \columnsetbotbox\mofcolumns\vbox % temp, must be better -% {\forgetall -% \offinterlineskip -% \box\botins -% \box\columnbotbox\mofcolumns} - \fi - \global\botinserted\zeropoint\relax} % goes away - -% set ipv text - -% left right 1 2 3 +1 +2 +3 - -\let\columnleftareas \empty -\let\columnrightareas\empty - -% links rechts => odd, even, n, named - -\def\definecolumntextarea - {\dotripleempty\dodefinecolumntextarea} - -\def\dodefinecolumntextarea[#1][#2][#3]% y=0 is mogelijke en handig ! - {\ifthirdargument - \doifinsetelse{#2}{\v!both,\v!fixed} - {\definecolumntextarea[#1][\v!left ][\c!type=#2,#3]% - \definecolumntextarea[#1][\v!right][\c!type=#2,#3]} - {\doifelse{#2}\v!next - {\doifoddpageelse - {\definecolumntextarea[#1][\v!right][\c!type=#2,#3]} - {\definecolumntextarea[#1][\v!left ][\c!type=#2,#3]}} - {\presetlocalframed - [\??mt#1#2]% - \processaction[#2] % \doglobal voorkomt stack build up - [ \v!left=>\doglobal\addtocommalist{#1}\columnleftareas, - \v!right=>\doglobal\addtocommalist{#1}\columnrightareas]% - \getparameters[\??mt#1#2] - [\c!x=1,\c!y=1,\c!nx=1,\c!ny=1,\c!clipoffset=2\lineheight, - \c!offset=\v!overlay,\c!strut=\v!no,\c!frame=\v!off, - \c!type=#2,\c!page=1,\c!state=\v!stop,#3]}}% - \else - \definecolumntextarea[#1][\v!next][#2]% - \fi} - -\def\setupcolumntextarea - {\dotripleempty\dosetupcolumntextarea} - -\def\dosetupcolumntextarea[#1][#2][#3]% - {\ifthirdargument - \doifelse{#2}\v!both - {\setupcolumntextarea[#1][\v!left ][#3]% - \setupcolumntextarea[#1][\v!right][#3]} - {\doifelse{#2}\v!next - {\doifoddpageelse - {\setupcolumntextarea[#1][\v!right][#3]} - {\setupcolumntextarea[#1][\v!left][#3]}} - {\getparameters[\??mt#1#2][#3]}}% - \else - \setupcolumntextarea[#1][\v!next][#2]% - \fi} - -\def\docheckcolumnsetareapage#1#2% - {\ifnum\getvalue{\??mt#1\c!page}>\plusone - \doifelsevalue{\??mt#1\c!type}\v!fixed - {\ifnum\columnsetpage=\getvalue{\??mt#1\c!page}\relax - \donetrue\else\donefalse - \fi} - {\ifnum\columnsetpage<\getvalue{\??mt#1\c!page}\relax - \donefalse\else\donetrue - \fi}% - \else - \donetrue - \fi} - -\def\initializecolumntextareas - {\ifodd\realpageno - \doinitializecolumntextareas\columnrightareas\v!right - \else - \doinitializecolumntextareas\columnleftareas\v!left - \fi} - -\def\doinitializecolumntextareas#1#2% - {\def\docommand##1% - {\docheckcolumnsetareapage{##1#2}\plusone - \ifdone - \donefalse - \processaction - [\getvalue{\??mt##1#2\c!state}] - [ \v!start=>\donetrue, - \v!repeat=>\donetrue, - \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]% - \ifdone\dodoinitializecolumntextareas{##1}{#2}\fi - \fi}% - \processcommacommand[#1]\docommand} - -\def\dodoinitializecolumntextareas#1#2% - {\doOTRSETsetgridcells - {\copy\placeholderboxd} - {\getvalue{\??mt#1#2\c!x }}{\getvalue{\??mt#1#2\c!y }} - {\getvalue{\??mt#1#2\c!nx}}{\getvalue{\??mt#1#2\c!ny}} - {\copy\placeholderboxd}} - -\def\placecolumntextareas - {\ifodd\realpageno - \doplacecolumntextareas\columnrightareas\v!right - \else - \doplacecolumntextareas\columnleftareas\v!left - \fi} - -\def\doplacecolumntextareas#1#2% global ? - {\bgroup - \forgetall - \def\docommand##1% - {\docheckcolumnsetareapage{##1#2}\zerocount - \ifdone - \donefalse - \processaction - [\getvalue{\??mt##1#2\c!state}] - [ \v!start=>\donetrue\doglobal\removefromcommalist{##1}#1, - \v!repeat=>\donetrue, - \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]% - \ifdone - \dodoplacecolumntextareas{##1}{#2}% - \else - \doglobal\removefromcommalist{##1}#1% - \fi - \fi}% - \processcommacommand[#1]\docommand - \egroup} - -\def\columntextlastbackspace{\backspace} - -% beware, we have clipping offsets of 2\lineheight by default - -\def\columntextareaparameter#1% - {\csname\??mt\currentcolumntestarea#1\endcsname} - -\def\dodoplacecolumntextareas#1#2% - {\def\currentcolumntestarea{#1#2}% - \!!counta\columntextareaparameter\c!x - \!!countb\columntextareaparameter\c!nx - \docalculatecolumnsetspan - \!!heighta\columntextareaparameter\c!ny\lineheight - % wrong - % \ifnum\columntextareaparameter\c!y=\zerocount - % \advance\!!heighta -\lineheight - % \advance\!!heighta \topskip - % \fi - % \advance\!!heighta -\lineheight % option - \ifnum\columntextareaparameter\c!y=\plusone - \advance\!!heighta -\lineheight - \advance\!!heighta \topskip - \fi - % - \setbox\scratchbox\vbox - {\donetrue\localframed - [\??mt\currentcolumntestarea] - [\c!location=,% new (*) - \c!width=\!!widtha,\c!height=\!!heighta,\c!lines=] - {\columntextareaparameter\empty}}% - \!!counta\columntextareaparameter\c!x - \!!countb\columntextareaparameter\c!y - \advance\!!countb \columntextareaparameter\c!ny - \advance\!!countb \minusone - % new (*) - \doif{\columntextareaparameter\c!location}\v!depth - {\setbox\scratchbox\hbox{\lower\strutdepth\box\scratchbox}% - \dp\scratchbox\zeropoint - \ht\scratchbox\!!heighta}% - % - \setbox0\hbox - {\ifcase\!!countc - \copy\scratchbox % \box - \else - \clip - [ %\c!topoffset=\columntextareaparameter\c!clipoffset,% - %\c!bottomoffset=\columntextareaparameter\c!clipoffset,% - %\c!leftoffset=\columntextareaparameter\c!clipoffset,% - \c!offset=\columntextareaparameter\c!clipoffset,% - \c!rightoffset=\zeropoint,% - \c!width=\!!widthb,% - \c!height=\!!heighta]% - {\copy\scratchbox}% - \fi}% - \OTRSETsetgridcell\!!counta\!!countb\box0 - \ifcase\!!countc\else - \advance\!!counta \columntextareaparameter\c!nx - \advance\!!counta -\!!countc - \advance\!!widtha -\!!widthb - \setbox0\hbox - {\hskip-\namedlayoutparameter\v!odd\c!backspace - \clip - [ %\c!topoffset=\columntextareaparameter\c!clipoffset,% - %\c!bottomoffset=\columntextareaparameter\c!clipoffset,% - %\c!rightoffset=\columntextareaparameter\c!clipoffset,% - \c!offset=\columntextareaparameter\c!clipoffset,% - \c!leftoffset=\zeropoint,% - \c!width=\!!widtha,% - \c!height=\!!heighta,% - \c!hoffset=\!!widthb]% - {\copy\scratchbox}}% - \OTRSETsetgridcell\!!counta\!!countb\box0% - \fi} - -\def\setupcolumntextareatext - {\dotripleempty\dosetupcolumntextareatext} - -\long\def\dosetupcolumntextareatext[#1][#2][#3]% - {\ifthirdargument - \doifelse{#2}\v!both - {\setvalue{\??mt#1\v!left }{#3}% - \setvalue{\??mt#1\v!right}{#3}} - {\doifelse{#2}\v!next - {\doifoddpageelse - {\setvalue{\??mt#1\v!right}{#3}}% - {\setvalue{\??mt#1\v!left }{#3}}}% - {\setvalue{\??mt#1#2}{#3}}}% - \else - \setupcolumntextareatext[#1][\v!next][{#2}]% - \fi} - -\def\docalculatecolumnsetspan - {% \!!counta <= x - % \!!countb <= nx - % \!!widtha => total width - % \!!widthb => left width - % \!!countc => left cols - \!!widtha\!!countb\textwidth % we assume equal widths - \advance\!!countb \!!counta - \advance\!!countb \minusone - \ifnum\!!countb>\nofcolumns - \!!countc\!!countb - \advance\!!countc -\nofcolumns - \!!countb\nofcolumns - \else - \!!countc\zerocount - \fi - \advance\!!counta \plusone - \dostepwiserecurse\!!counta\!!countb\plusone - {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}% - \!!widthb\!!widtha - \advance\!!widthb -\!!countc\textwidth - \ifodd\realpageno \else % tricky, assumes that we keep there - \ifcase\!!countc\else - % nog niet ok voor enkel/doublesided - \advance\!!widtha \namedlayoutparameter\v!even\c!backspace - \advance\!!widtha \namedlayoutparameter\v!odd \c!backspace - \advance\!!widthb \namedlayoutparameter\v!even\c!backspace - \dorecurse\!!countc - {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}% - \fi - \fi} - -\def\columnsetspanhsize{\textwidth} - -\def\setcolumnsetspanhsize#1#2% x nx / uses counta/b - {\!!counta#1\!!countb#2\docalculatecolumnsetspan - \edef\columnsetspanhsize{\the\!!widtha}} - -\def\definecolumnsetspan - {\dodoubleempty\dodefinecolumnsetspan} - -\def\dodefinecolumnsetspan[#1][#2]% - {%\ifsecondargument - \defineframedtext - [cs:#1] - [\c!frame=\v!off, - \c!before=, - \c!after=, - \c!offset=\v!overlay, - \c!location=\v!left, - \c!linecorrection=\v!off, - \c!depthcorrection=\v!off, - \c!n=2, - \c!nlines=0, - \c!indenting=, - \c!indentnext=\v!yes, - \c!default=HERE, - \c!alternative=\v!a, - #2]% - %\else - % \definecolumnspan[][#1]% - }%\fi} - -\definecolumnsetspan[\s!default] - -\def\setupcolumnsetspan - {\dodoubleempty\dosetupcolumnsetspan} - -\def\dosetupcolumnsetspan[#1][#2]% - {\ifsecondargument - \setupframedtexts[cs:#1][#2]% - \else - \setupcolumnsetspan[\s!default][#1]% - \fi} - -\def\startcolumnsetspan - {\dotripleempty\dostartcolumnsetspan} - -%%%%%%%%%%%%%%%% TODO - -\def\dostartcolumnsetspan[#1][#2][#3]% [#3] gobbles space - {\endgraf % else rubish output if forgotten - \vskip \zeropoint % make sure otr is done, otherwise last line problems - \bgroup - \forgetall - \ifnum\columnsetlevel>\zerocount\else - % of course we needed a one-column fall back for tm - \columnsetspanhsize\hsize - \nofcolumns\plusone - \mofcolumns\plusone - \fi - \setupframedtexts[cs:#1] - [\c!width=\columnsetspanhsize, - \c!linecorrection=\v!off, - \c!depthcorrection=\v!off, - #2]% - % determine widths - \!!countc\framedtextparameter{cs:#1}\c!n - % \!!countd\numexpr(\nofcolumns-\mofcolumns+\plusone)% - \!!countd\nofcolumns - % n <= n of columns - \ifnum\!!countc>\!!countd \!!countc\!!countd \fi - \advance\!!countd -\mofcolumns - \advance\!!countd \plusone - % n <= n of available columns (alternative a) - \doif{\framedtextparameter{cs:#1}\c!alternative}\v!a - {\ifnum\!!countc>\!!countd \!!countc\!!countd \fi}% - % here it all starts - \setcolumnsetspanhsize\mofcolumns\!!countc % a/b used - \hsize\columnsetspanhsize - \setbox\scratchbox\vbox\bgroup - \dostartframedtext[cs:#1][\v!none]% geen nils placement - % spoils spacing : \vskip-\struttotal\par\verticalstrut\par - \ifnum\columnsetlevel>\zerocount - \framedtextparameter{cs:#1}\c!before - \fi - \def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}} - -\def\dostopcolumnsetspan#1% - {\par - \verticalstrut - \kern-2\struttotal - \verticalstrut - \ifnum\columnsetlevel>\zerocount - \doifsomething{\framedtextparameter{cs:#1}\c!after} - {\framedtextparameter{cs:#1}\c!after - \kern\zeropoint}% otherwise blanks disappear, better be a switch - \else - \endgraf - \fi - \dostopframedtext - \egroup - \setbox\scratchbox\frozenhbox to \hsize - {\dontcomplain - \alignedline{\framedtextparameter{cs:#1}\c!location}\v!middle - {\lower\strutdepth\box\scratchbox}}% - \dp\scratchbox\zeropoint % else wrong snap insidefloat -% -% to be tested first (strange in grid mode) -% -% \setbox\scratchbox\frozenhbox to \hsize -% {\dontcomplain -% \chardef\alignstrutmode\zerocount -% \alignedline{\framedtextparameter{cs:#1}\c!plaats}\v!midden -% {\box\scratchbox}}% -% - \ifinsidefloat - \box\scratchbox - \else\ifnum\columnsetlevel>\zerocount - % we only set \columnsetspacing when asked for, else bottom problems - % don't change this any more (test naw) - \chardef\columnslotspacing\framedtextparameter{cs:#1}\c!nlines\relax - % todo: nboven/onder & \chardef\columnslotlocation2 - %\OTRSETstoreincolumnslotHERE\scratchbox - \edef\floatmethod{\framedtextparameter{cs:#1}\c!default}% - \@EA\uppercasestring\floatmethod\to\floatmethod - % todo : \v!here -> here enzovoorts - \OTRSETstoreincolumnslot\floatmethod\scratchbox - % watch out: no \dochecknextindentation{tag} - \checknextindentation[\framedtextparameter{cs:#1}\c!indentnext]% - \else - % of course we needed a one-column fall back for tm; brrr, the box has now too - % much height (try \ruledvbox); don't change this without testing techniek - \scratchdimen\ht\scratchbox - \advance\scratchdimen-\strutdp - \ht\scratchbox\scratchdimen - \framedtextparameter{cs:#1}\c!before - \snaptogrid\vbox{\box\scratchbox}% - \framedtextparameter{cs:#1}\c!after - \fi\fi - \egroup - \endgraf} - -% \startcolumnset[two] -% \input tufte -% \startcolumnsetspan[two][width=20cm,location=middle] \input tufte \stopcolumnsetspan -% \startcolumnsetspan[two][default=btlr] \input tufte \stopcolumnsetspan -% \input tufte \par -% \input tufte \par -% \startcolumnsetspan[two] \emptylines[5] \stopcolumnsetspan -% \startcolumnsetspan[two] \input tufte \stopcolumnsetspan -% \stopcolumnset - -\protect \endinput - -% extreme examples (1) -% -% \setupfloats[numbering=nocheck] -% -% \definecolumnset [first] [n=2,start=0] -% \definecolumnset [next] [n=2,start=3] -% -% \setuptexttexts[\vbox to \textheight{\topskipcorrection \hsize\makeupwidth left \hfill right\vfill}] -% -% \setuphead[chapter][text=empty] -% -% \starttext -% -% \startcolumnset[first,next] -% \placefigure[btrl]{}{} -% \placefigure[tblr]{}{} -% \chapter{thuan} \dorecurse{25}{\recurselevel: \input thuan \endgraf} -% \stopcolumnset -% -% \startcolumnset[first,next] -% \chapter{thuan} \dorecurse{25}{\input thuan \endgraf\placefigure{}{}} -% \stopcolumnset diff --git a/tex/context/base/page-sid.mkii b/tex/context/base/page-sid.mkii new file mode 100644 index 000000000..0848c9d8c --- /dev/null +++ b/tex/context/base/page-sid.mkii @@ -0,0 +1,931 @@ +%D \module +%D [ file=page-sid, +%D version=2000.10.20, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Side Floats, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Side Floats} + +\unprotect + +% problem: when too small, side effects; we need to determine the +% shift earlier so that we can act when shift < size +% +% \definefloat[edgefigure] +% \setupfloat +% [edgefigure] +% [rightmargindistance=-\rightmargintotal, +% leftmargindistance=-\rightmargintotal, +% default=outer] +% \starttext +% \placeedgefigure{}{\framed[width=12cm]{}} \input tufte +% \placeedgefigure{}{\framed[width=5cm]{}} \input tufte +% \placeedgefigure{}{\framed[width=4cm]{}} \input tufte +% \placeedgefigure{}{\framed[width=2cm]{}} \input tufte +% \stoptext + +% todo: dimexpr an dnumexpr + +% These macro deal with side floats. We started with Daniel +% Comenetz macros as published in TUGBoat Volume 14 (1993), +% No.\ 1: Anchored Figures at Either Margin. I extended and +% patched the macros to suite our needs which results in a +% messy module. Therefore, this module badly needs an update +% because it's now a mixture of old and new macros. + +% afhankelijke variabelen +% +% \overgap vervangen door \floatsidetopskip +% \sidegap vervangen door \floatsideskip +% \undergap vervangen door \floatsidebottomskip +% +% \prskp vervangen door \ctxparskip + +% toegevoegde macro's/aanroepen +% +% \logsidefloat : loginformatie +% \flushsidefloats : nodig voor koppen + +% recente wijzigingen: +% +% namen aangepast: \float... enz. i.p.v. \pic + +% Pas op: \EveryPar{\EveryPar{}\margetitel{whatever}} +% \plaatsfiguur[links]{}{} moet goed gaan. In dat geval +% begint de tekst terecht wat lager. + +\newdimen\sidefloatheight % includes the topskip +\newdimen\sidefloatwidth +\newdimen\sidefloathsize +\newdimen\sidefloatshift +\newdimen\sidefloatextrashift +\newdimen\sidefloatvsize \def\nofloatvsize{-1pt } +\newdimen\sidefloatprogress +\newdimen\sidefloatpagetotal + +\newbox\floatbottom + +\newcount\sidefloatsidelines +\newcount\sidefloatlinesdone + +% 1 = backspace +% 2 = leftedge +% 3 = leftmargin +% 4 = leftside +% 5 = rightside +% 6 = rightmargin +% 7 = rightedge +% 8 = cutspace + +\chardef\sidefloattype\zerocount + +\def\backspacefloat {\global\chardef\sidefloattype1 \putsidefloat} +\def\leftedgefloat {\global\chardef\sidefloattype2 \putsidefloat} +\def\leftmarginfloat {\global\chardef\sidefloattype3 \putsidefloat} +\def\leftfloat {\global\chardef\sidefloattype4 \putsidefloat} +\def\rightfloat {\global\chardef\sidefloattype5 \putsidefloat} +\def\rightmarginfloat {\global\chardef\sidefloattype6 \putsidefloat} +\def\rightedgefloat {\global\chardef\sidefloattype7 \putsidefloat} +\def\cutspacefloat {\global\chardef\sidefloattype8 \putsidefloat} + +\let\marginfloat \cutspacefloat + +\newif\ifroomforfloat +\newif\iffloatshort +\newif\iffloatflag +\newif\iffloatrighteqo +\newif\iffloatlefteqo + +\newdimen\sidefloatleftskip +\newdimen\sidefloatrightskip +\newdimen\sidefloatmaximum + +% \def\checksidefloatshift +% {\ifdim\sidefloatmaximum>\zeropoint +% \ifcase\sidefloattype +% % invalid +% \or +% % backspace +% \or +% \global\sidefloatshift-\sidefloatmaximum +% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance +% \or +% \global\sidefloatshift-\sidefloatmaximum +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance +% \or +% % left +% \or +% % right +% \or +% \global\sidefloatshift-\sidefloatmaximum +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance +% \or +% \global\sidefloatshift-\sidefloatmaximum +% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance +% \or +% % cutspace +% \fi +% \fi} + +\def\checksidefloatshift + {\ifdim\sidefloatmaximum>\zeropoint + \ifcase\sidefloattype + % invalid + \or + % backspace + \or + \global\sidefloatshift\dimexpr + -\sidefloatmaximum + -\rightorleftpageaction \leftedgedistance \rightedgedistance + -\rightorleftpageaction \leftmarginwidth \rightmarginwidth + -\rightorleftpageaction \leftmargindistance \rightmargindistance + -\compensatedinnermakeupmargin + \relax + \or + \global\sidefloatshift\dimexpr + -\sidefloatmaximum + -\rightorleftpageaction \leftmargindistance \rightmargindistance + -\compensatedinnermakeupmargin + \relax + \or + % left + \or + % right + \or + \global\sidefloatshift\dimexpr + -\sidefloatmaximum + -\rightorleftpageaction \leftmargindistance \rightmargindistance + -\compensatedinnermakeupmargin + \relax + \or + \global\sidefloatshift\dimexpr + -\sidefloatmaximum + -\rightorleftpageaction \leftedgedistance \rightedgedistance + -\rightorleftpageaction \leftmarginwidth \rightmarginwidth + -\rightorleftpageaction \leftmargindistance \rightmargindistance + -\compensatedinnermakeupmargin + \relax + \or + % cutspace + \fi + \fi} + +% \def\setsidefloatskips +% {\global\sidefloatrightskip\zeropoint +% \global\sidefloatleftskip \zeropoint +% \ifcase\sidefloattype +% \or % backspace +% \global \sidefloatleftskip \rightorleftpageaction \backspace \cutspace +% \or % leftedge +% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance +% \global\advance\sidefloatleftskip \rightorleftpageaction \leftmarginwidth\rightmarginwidth +% \global\advance\sidefloatleftskip \rightorleftpageaction \leftedgedistance\rightedgedistance +% \or % leftmargin +% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance +% \or % leftside +% \or % rightside +% \or % rightmargin +% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance +% \or % rightedge +% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance +% \global\advance\sidefloatrightskip\rightorleftpageaction \rightmarginwidth\leftmarginwidth +% \global\advance\sidefloatrightskip\rightorleftpageaction \rightedgedistance\leftedgedistance +% \or % cutspace +% \global \sidefloatrightskip\rightorleftpageaction \cutspace\backspace +% \fi +% \ifdim\sidefloatrightskip>\zeropoint +% \doglobal\advance\sidefloatrightskip\rightskip +% \fi +% \ifdim\sidefloatleftskip>\zeropoint +% \doglobal\advance\sidefloatleftskip\leftskip +% \fi} + + +% use \outermarginwidth etc here + +\def\setsidefloatskips + {\global\sidefloatrightskip\zeropoint + \global\sidefloatleftskip \zeropoint + \ifcase\sidefloattype + \or % backspace + \global\sidefloatleftskip\dimexpr + +\rightorleftpageaction \backspace \cutspace + +\compensatedinnermakeupmargin + \relax + \or % leftedge + \global\sidefloatleftskip\dimexpr + +\rightorleftpageaction \leftmargindistance \rightmargindistance + +\rightorleftpageaction \leftmarginwidth \rightmarginwidth + +\rightorleftpageaction \leftedgedistance \rightedgedistance + +\compensatedinnermakeupmargin + \relax + \or % leftmargin + \global\sidefloatleftskip\dimexpr + +\rightorleftpageaction \leftmargindistance \rightmargindistance + +\compensatedinnermakeupmargin + \relax + \or % leftside + \or % rightside + \or % rightmargin + \global\sidefloatrightskip\dimexpr + +\rightorleftpageaction \rightmargindistance \leftmargindistance + +\compensatedinnermakeupmargin + \relax + \or % rightedge + \global\sidefloatrightskip\dimexpr + +\rightorleftpageaction \rightmargindistance \leftmargindistance + +\rightorleftpageaction \rightmarginwidth \leftmarginwidth + +\rightorleftpageaction \rightedgedistance \leftedgedistance + +\compensatedinnermakeupmargin + \relax + \or % cutspace + \global\sidefloatrightskip\dimexpr + +\rightorleftpageaction \cutspace \backspace + +\compensatedinnermakeupmargin + \relax + \fi + \ifdim\sidefloatrightskip>\zeropoint \doglobal\advance\sidefloatrightskip\rightskip \fi + \ifdim\sidefloatleftskip >\zeropoint \doglobal\advance\sidefloatleftskip \leftskip \fi} + +% eq is still crap + +\ifx\normalleqno\undefined + + \let\floatrighteqo=\eqno + \let\floatleftleqo=\leqno + +\else + + \let\floatrighteqo=\normaleqno + \let\floatleftleqo=\normalleqno + +\fi + +% Watch it even more! In inner, gaat't mis omdat daar +% pagetotal enz niet zijn aangepast. Inner kan overigens niet +% betrouwbaar worden getest! + +% \def\flushsidefloats% +% {\par +% \sidefloatprogress=\sidefloatvsize +% \advance\sidefloatprogress by -\pagetotal +% \ifdim\sidefloatprogress>\zeropoint +% \witruimte % nog checken op interferentie +% \kern\sidefloatprogress +% \fi +% \global\sidefloatvsize=\nofloatvsize +% \global\floatflagfalse} +% +% no, too buggy, leads to top of page crap +% +%\def\flushsidefloats +% {\par +% \dochecksidefloat +% \scratchcounter=-\hangafter +% \dorecurse{\scratchcounter}{\strut\hfill\strut\par}} +% +%\def\flushsidefloats +% {\par +% \!!heighta\sidefloatvsize +% \advance\!!heighta -\pagetotal +% \ifdim\!!heighta>\zeropoint +% % to be checked for interference +% \witruimte +% % will be option +% \getnoflines\!!heighta +% \!!heighta\noflines\lineheight +% % so far for option +% \kern\!!heighta +% \fi +% % == \forgetsidefloats +% \global\sidefloatvsize\nofloatvsize +% \global\floatshortfalse +% \global\floatflagfalse} + +% \def\flushsidefloats +% {\par +% \!!heighta\sidefloatvsize +% \advance\!!heighta -\pagetotal +% \ifdim\!!heighta>\zeropoint +% % to be checked for interference +% \witruimte +% % will be option +% \getnoflines\!!heighta +% \!!heighta\noflines\lineheight +% % so far for option +% \ifdim\sidefloatbottomskip>\zeropoint\relax +% \ifdim\!!heighta>\sidefloatbottomskip +% \advance\!!heighta-\sidefloatbottomskip +% \kern\!!heighta +% \vskip\sidefloatbottomskip +% \else +% \kern\!!heighta +% \fi +% \else +% \kern\!!heighta +% \fi +% \fi +% % == \forgetsidefloats +% \global\sidefloatvsize\nofloatvsize +% \global\floatshortfalse +% \global\floatflagfalse} + +\newif\iftracesidefloats + +\def\flushsidefloats + {\par + \!!heighta\sidefloatvsize + \advance\!!heighta -\pagetotal + \ifnum\!!heighta>\zeropoint + \global\advance\sidefloatvsize -\sidefloatbottomskip + \ifdim\!!heighta>\zeropoint + \bgroup + \let\flushsidefloats\relax + \forgetall + \doloop + {\strut + \iftracesidefloats + \color[darkgray]% + {\baselinerulefalse + \boxrulewidth.5\points + \ruledhbox{\strut\kern\sidefloatwidth}}% + \fi + \par + \!!heighta\sidefloatvsize + \advance\!!heighta -\pagetotal + \ifdim\!!heighta>\zeropoint + \ifnum\recurselevel>\plushundred + \exitloop + \fi + \else + \exitloop + \fi}% + \egroup + \ifdim\parskip>\zeropoint + \ifdim\sidefloatbottomskip>\parskip + \nowhitespace + \vskip\sidefloatbottomskip + \fi + \fi + \else\ifdim\sidefloatbottomskip>\parskip + \vskip\sidefloatbottomskip + \fi\fi + \fi + % not entirely the same as \forgetsidefloats + \global\sidefloatvsize\nofloatvsize + % \global\sidefloatsidelines\zerocount % no, we flush before a side float + \global\floatshortfalse % so this will get lost + % also here if used at all \global\holdinginserts\zerocount + \global\floatflagfalse} + +\def\flushsidefloatsafterpar + {\xdef\oldpagetotal{\the\pagetotal}% + \gdef\checksidefloat + {\dochecksidefloat + \ifdim\oldpagetotal=\pagetotal \else + \global\let\checksidefloat\dochecksidefloat + \flushsidefloats + \global\sidefloatsidelines\zerocount % here ! + \fi}} + +\def\forgetsidefloats + {\global\sidefloatvsize\nofloatvsize + \global\sidefloatsidelines\zerocount + % also here if used at all \global\holdinginserts\zerocount + \global\floatshortfalse + \global\floatflagfalse} + +\let\logsidefloat=\relax + +\def\pushpenalties % needed ? and right + {\widowpenalty\plusone + \clubpenalty\plustwo + \brokenpenalty\plusone + \let\pushpenalties\relax + \edef\poppenalties + {\widowpenalty \the\widowpenalty + \clubpenalty \the\clubpenalty + \brokenpenalty\the\brokenpenalty + \let\poppenalties\relax}} + +% shouldn;t that be: +% +% \def\pushpenalties % needed? +% {\let\pushpenalties\relax +% \edef\poppenalties +% {\widowpenalty \the\widowpenalty +% \clubpenalty \the\clubpenalty +% \brokenpenalty\the\brokenpenalty +% \let\poppenalties\relax}% +% \widowpenalty\plusone +% \clubpenalty\plustwo +% \brokenpenalty\plusone} + +\let\poppenalties=\relax + +\def\restorepenalties + {\ifnum\outputpenalty=\!!tenthousand\else + \penalty\outputpenalty + \fi} + +\def\sidefloatoutput + {\iffloatshort + \unvbox\normalpagebox + \setbox\floatbottom\lastbox + \ifdim\wd\floatbottom>\sidefloathsize + \penalty-201 + \box\floatbottom + \else + \ifvoid\floatbottom + \else + \restoreleftindent + \ifdim\wd\floatbottom<\sidefloathsize + \parskip\zeropoint + %\noindent + \ifinner\else\vadjust{\penalty\minusone}\fi + \iffloatlefteqo + \global\floatlefteqofalse + \else + \global\advance\sidefloathsize -\wd\floatbottom + \iffloatrighteqo + \global\floatrighteqofalse + \else + \global\divide\sidefloathsize \plustwo + \fi + \hskip\sidefloathsize + \fi + \fi + \box\floatbottom + \restorepenalties + \fi + \fi + % why was this \global\holdinginserts\zerocount + \global\floatshortfalse + \else + \finalsidefloatoutput % new + \global\sidefloatvsize\nofloatvsize + \global\sidefloatsidelines\zerocount + % we can end up in fig lock, so \global\holdinginserts\zerocount here too ? + \poppenalties + \fi} + +\def\finalsidefloatoutput% new + {\finaloutput\unvbox\normalpagebox} + +\def\restoreleftindent + {\relax \ifnum\sidefloattype>4 \else + \parskip\zeropoint % here ? + \ifdim\sidefloatwidth>\zeropoint % new, see prikkels + \noindent + \ifinner\else\vadjust{\penalty\minusone}\fi + \hskip\sidefloatwidth + %\else + % we have a margin or edge float + \fi + \fi} + +\ifx\normaleqno\undefined + + \def\normaleqno + {\iffloatshort + \global\floatrighteqotrue + \fi + \floatrighteqo} + +\else + + \def\eqno + {\iffloatshort + \global\floatrighteqotrue + \fi + \floatrighteqo} + +\fi + +% externfiguur -> grid =ja|hoogte|diepte|halveregel|passend -> helemaal in details +% stelplaatsblokin -> zijuitlijnen=hoogte|diepte|regel|halveregel|grid -> halveregel in 'details' + +% replacement for below +% +% \global\setbox\floatbox\hbox % no \hskip, but \kern here +% {\ifcase\sidefloattype +% \vbox{#1}% +% \or % 1 +% \hskip\sidefloatleftshift +% \hskip\sidefloatshift +% \vbox{#1}% +% \kern-\sidefloatextrashift +% \or % 2 +% \hskip\sidefloatshift +% \vbox{#1}% +% \kern-\sidefloatextrashift +% \or % 3 +% \hskip\sidefloatshift +% \vbox{#1}% +% \kern-\sidefloatextrashift +% \or % 4 +% \hskip\sidefloatleftshift +% \hskip\sidefloatshift +% \vbox{#1\removedepth}% +% \kern-\sidefloatextrashift +% \or % 5 +% \hskip-\sidefloatextrashift +% \vbox{#1}% +% \kern\sidefloatshift +% \kern\sidefloatrightshift +% \or % 6 +% \hskip-\sidefloatextrashift +% \vbox{#1}% +% \kern\sidefloatshift +% \or % 7 +% \hskip-\sidefloatextrashift +% \vbox{#1}% +% \kern\sidefloatshift +% \or % 8 +% \hskip-\sidefloatextrashift +% \vbox{#1}% +% \kern\sidefloatshift +% \kern\sidefloatrightshift +% \fi}% +% +% keep this ^ + +\def\putsidefloat#1% grid (4) is rather experimental + {\par + \whitespace + % moved here dec 2001 + {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}% moved + \checksidefloatshift + \ifdim\sidefloatshift=\zeropoint \relax + \ifnum\sidefloattype=4 + \global\advance\sidefloatshift\sidefloatextrashift + \global\sidefloatextrashift\zeropoint + \else\ifnum\sidefloattype=5 + \global\advance\sidefloatshift\sidefloatextrashift + \global\sidefloatextrashift\zeropoint + \fi\fi + \else + \ifnum\sidefloattype<4 + \global\chardef\sidefloattype4 + \else\ifnum\sidefloattype>5 + \global\chardef\sidefloattype5 + \fi\fi + \fi + \previoussidefloat + \stallsidefloat + %\global\setbox\floatbox\hbox + % {\ifmarginfloat\else\ifrightfloat\else\kern\sidefloatleftshift\fi\fi + % \hskip\ifrightfloat-\sidefloatextrashift\else\sidefloatshift\fi + % \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}% + % \kern\ifrightfloat\sidefloatshift\else-\sidefloatextrashift\fi + % \ifmarginfloat\else\ifrightfloat\kern\sidefloatrightshift\fi\fi}% + \global\setbox\floatbox\hbox % no \hskip, but \kern here + {\ifnum\sidefloattype=4 + \hskip\sidefloatleftshift + \else\ifnum\sidefloattype=1 + \hskip\sidefloatleftshift + \fi\fi + \ifnum\sidefloattype>4 + \hskip-\sidefloatextrashift + \else + \hskip\sidefloatshift + \fi + \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}% + \ifnum\sidefloattype>4 + \kern\sidefloatshift + \else + \kern-\sidefloatextrashift + \fi + \ifnum\sidefloattype=8 + \kern\sidefloatrightshift + \else\ifnum\sidefloattype=5 + \kern\sidefloatrightshift + \fi\fi}% + \ifnum\sidefloatalign=4 + \getnoflines{\ht\floatbox}% + \scratchdimen\noflines\lineheight + \advance\scratchdimen-\strutdepth + \getrawnoflines\sidefloattopskip + \advance\scratchdimen\noflines\lineheight + % todo: maybe rounding problem here + % \global\setbox\floatbox\hbox{\lower\lineheight\box\floatbox}% + \global\setbox\floatbox\hbox{\lower\strutdepth\box\floatbox}% + \global\ht\floatbox\scratchdimen + \global\dp\floatbox\zeropoint + \fi + \ifcase\sidefloatalign \else + \global\sidefloattopskip\zeropoint + \fi + \scratchdimen + \ifnum\sidefloattype<4 + \sidefloattopskip + \else\ifnum\sidefloattype>5 + \sidefloattopskip + \else + \zeropoint + \fi\fi + % the top of the box is at the previous baseline + \ifcase\sidefloatalign + % 0 normal + \advance\scratchdimen\strutdepth % == \sidefloattopoffset + \or % 1 height + \advance\scratchdimen\strutdepth % == \sidefloattopoffset + \or % 2 line + \or % 3 depth + \advance\scratchdimen\lineheight + \advance\scratchdimen\strutdepth + \or % 4 grid + \scratchdimen\zeropoint + \or + \advance\scratchdimen\strutheight + \fi + % new + \global\sidefloatlinesdone\zerocount + \ifnum\sidefloatsidelines>\zerocount + \advance\scratchdimen\sidefloatsidelines\lineheight + \fi + % new + \global\setbox\floatbox\hbox + {\vbox + {\vskip\scratchdimen + \nointerlineskip + \box\floatbox + \ifnum\sidefloatalign=5 \vskip-\lineheight \fi}}% + \ifnum\sidefloattype<4 + \global\sidefloattopskip\zeropoint + \else\ifnum\sidefloattype>5 + \global\sidefloattopskip\zeropoint + \fi\fi + \global\sidefloatdownshift\zeropoint + \measuresidefloat + \ifroomforfloat \else + \tosssidefloat + \measuresidefloat + \stallsidefloat + \fi + \setsidefloat} + +\def\progresssidefloat + {\sidefloatprogress\sidefloatvsize + \iffloatflag + \advance\sidefloatprogress -\sidefloatpagetotal + \global\floatflagfalse + \else + \advance\sidefloatprogress -\pagetotal + \fi} + +\def\tosssidefloat + {\vfill\eject} + +\def\measuresidefloat + {\global\floatflagtrue + \global\sidefloatpagetotal \pagetotal % global + \ifnum\sidefloattype<4 + \global \sidefloatwidth \zeropoint + \else\ifnum\sidefloattype>5 + \global \sidefloatwidth \zeropoint + \else + \global \sidefloatwidth \wd\floatbox + \global\advance\sidefloatwidth \floatsideskip + \fi\fi + \ifdim\sidefloatwidth<\zeropoint + \global\sidefloatwidth\zeropoint + \fi + \global \sidefloathsize \hsize + \global\advance\sidefloathsize -\sidefloatwidth + \global \sidefloatheight \ht\floatbox + \global\advance\sidefloatheight \dp\floatbox + \global\advance\sidefloatheight \sidefloattopskip + \global \sidefloatvsize \sidefloatheight + \global\advance\sidefloatvsize \sidefloatpagetotal + \dimen0\sidefloatvsize + \dimen2\pagegoal + \relax + \ifcase\sidefloatmethod + % method 0 : raw + \or + % method 1 : safe + \dimen2 .99\pagegoal + \or + % method 2 : tight + \advance\dimen0 -\onepoint + \fi + \relax % really needed ! ! ! ! + \ifdim\dimen0>\dimen2 + \global\roomforfloatfalse + \else + \dimen0=\pagegoal + \advance\dimen0 -\sidefloatvsize + \ifdim\dimen0<\sidefloatbottomskip + \global\advance\sidefloatvsize \dimen0 + \global\floatshorttrue + \pushpenalties + % why was this \global\holdinginserts\plusone + \else + \global\advance\sidefloatvsize \sidefloatbottomskip + \global\floatshortfalse + \fi + \global\roomforfloattrue + \fi} + +\def\setsidefloat% nilling everypar saves time and redudant pos's + {% removed here dec 2001 + % {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}% + \ifnum\sidefloattype=4 \kern\sidefloattopskip \fi + \ifnum\sidefloattype=5 \kern\sidefloattopskip \fi + \edef\presidefloatdepth{\the\prevdepth}% + \nointerlineskip + \bgroup + \everypar\emptytoks + \parskip\zeropoint + %\checksidefloatshift + \setsidefloatskips + \logsidefloat + \relax + \ifcase\sidefloattype + % invalid + \or % backspace + \noindent\llap{\rlap{\box\floatbox}\hskip\sidefloatleftskip}\hfill + \or % leftedge + \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill + \or % leftmargin + \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill + \or % leftside + \noindent\box\floatbox\hfill + \or % rightside + \hfill\box\floatbox + \or % rightmargin + \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}% + \or % rightedge + \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}% + \or % cutspace + \hfill\rlap{\hskip\sidefloatrightskip\llap{\box\floatbox}}% + \fi + \egroup + \par + \kern-\sidefloatheight + \penalty10001 % oeps, this will change + \normalbaselines + \prevdepth\presidefloatdepth + % \noindent + \resetsidefloatparagraph + \ignorespaces} % not really needed + +\newcount\sidefloatparagraph + +\def\iffirstsidefloatparagraph + {\ifcase\sidefloatparagraph\or} + +% without sidefloat lines +% +% \def\setsidefloatparagraph +% {%\advance\sidefloatprogress \sidefloatbottomskip +% %\!!counta\sidefloatprogress +% \scratchdimen\sidefloatprogress +% \advance\scratchdimen \strutht +% \advance\scratchdimen -\roundingeps % new, needed in prikkels, prevent rounding errors +% \!!counta\scratchdimen +% \divide\!!counta \baselineskip +% \ifnum\!!counta>0 +% \hangindent \ifnum\sidefloattype>4 -\fi\sidefloatwidth +% \hangafter-\!!counta +% \fi +% \global\advance\sidefloatparagraph \plusone +% \iftracesidefloats +% \hskip-\sidefloatwidth +% \color[darkgray]% +% {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth +% %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}% +% \llap{\showstruts\strut\hskip.25\bodyfontsize}}% +% \fi} + +\def\setsidefloatparagraph + {%\advance\sidefloatprogress \sidefloatbottomskip + %\!!counta\sidefloatprogress + \scratchdimen\sidefloatprogress + \advance\scratchdimen \strutht + \advance\scratchdimen -\roundingeps % new, needed in prikkels, prevent rounding errors + \!!counta\scratchdimen + \divide\!!counta \baselineskip\relax + \ifnum\!!counta>0 + % new from here + \ifcase\sidefloatsidelines\else + \ifcase\sidefloatlinesdone + \global\sidefloatlinesdone\!!counta + \else + \scratchcounter\sidefloatlinesdone + \advance\scratchcounter-\!!counta + \global\advance\sidefloatsidelines-\scratchcounter + \fi + \fi + \ifnum\sidefloatsidelines>\zerocount + \scratchtoks\emptytoks + \scratchcounter\sidefloatsidelines + \scratchdimen\hsize + \advance\scratchdimen-\sidefloatwidth + \dorecurse\sidefloatsidelines + {\appendtoks \zeropoint \hsize \to \scratchtoks}% + \ifnum\!!counta>\sidefloatsidelines + \advance\!!counta -\sidefloatsidelines\relax + \advance\scratchcounter\!!counta + \dorecurse\!!counta + {\ifnum\sidefloattype>4 + \appendtoks \zeropoint \scratchdimen \to \scratchtoks + \else + \appendtoks \sidefloatwidth \scratchdimen \to \scratchtoks + \fi}% + \fi + \advance\scratchcounter \plusone + \parshape \scratchcounter \the\scratchtoks \zeropoint \hsize\relax + \else + % new till here + \hangindent \ifnum\sidefloattype>4 -\fi\sidefloatwidth + \hangafter-\!!counta + \fi + \fi + \global\advance\sidefloatparagraph \plusone + \iftracesidefloats + \hskip-\sidefloatwidth + \color[darkgray]% + {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth + %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}% + \llap{\showstruts\strut\hskip.25\bodyfontsize}}% + \fi} + +\def\resetsidefloatparagraph + {\global\sidefloatparagraph\zerocount } + +\def\dochecksidefloat + {\progresssidefloat + \ifdim\sidefloatprogress>\zeropoint + \setsidefloatparagraph + \else + \resetsidefloatparagraph + \fi + \parskip\ctxparskip} + +\def\checksidefloat + {\dochecksidefloat} + +\def\synchronizesidefloats + {\ifinner \else \checksidefloat \fi} + +\def\doadjustsidefloatdisplaylines + {\par + \vskip-\parskip + \noindent + \ignorespaces} + +\def\adjustsidefloatdisplaylines + {\aftergroup\doadjustsidefloatdisplaylines} + +\def\previoussidefloat + {\progresssidefloat + \ifdim\sidefloatprogress>\zeropoint \relax + \iffloatshort + \global\floatshortfalse + \tosssidefloat + \else + \kern\sidefloatprogress + \fi + \fi} + +\def\stallsidefloat + {\!!counta\pageshrink + \divide\!!counta \baselineskip + \advance\!!counta \plusone + \parskip\zeropoint + \dorecurse\!!counta{\line{}} + \kern-\!!counta\baselineskip + \penalty\zerocount } + +% We need to hook it into the other otr's. This code will move. + +\let\OTRONEflushsidefloats \flushsidefloats +\let\OTRONEsynchronizesidefloats\synchronizesidefloats + +% page-set +% +% \let\OTRSETflushsidefloats \forgetsidefloats +% \let\OTRSETsynchronizesidefloats\forgetsidefloats + +% page-mul +% +% \let\OTRMULflushsidefloats \forgetsidefloats +% \let\OTRMULsynchronizesidefloats\forgetsidefloats + +\def\synchronizesidefloats{\OTRcommand\synchronizesidefloats} +\def\flushsidefloats {\OTRcommand\flushsidefloats} + +\protect \endinput diff --git a/tex/context/base/page-sid.mkiv b/tex/context/base/page-sid.mkiv new file mode 100644 index 000000000..0848c9d8c --- /dev/null +++ b/tex/context/base/page-sid.mkiv @@ -0,0 +1,931 @@ +%D \module +%D [ file=page-sid, +%D version=2000.10.20, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Side Floats, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Side Floats} + +\unprotect + +% problem: when too small, side effects; we need to determine the +% shift earlier so that we can act when shift < size +% +% \definefloat[edgefigure] +% \setupfloat +% [edgefigure] +% [rightmargindistance=-\rightmargintotal, +% leftmargindistance=-\rightmargintotal, +% default=outer] +% \starttext +% \placeedgefigure{}{\framed[width=12cm]{}} \input tufte +% \placeedgefigure{}{\framed[width=5cm]{}} \input tufte +% \placeedgefigure{}{\framed[width=4cm]{}} \input tufte +% \placeedgefigure{}{\framed[width=2cm]{}} \input tufte +% \stoptext + +% todo: dimexpr an dnumexpr + +% These macro deal with side floats. We started with Daniel +% Comenetz macros as published in TUGBoat Volume 14 (1993), +% No.\ 1: Anchored Figures at Either Margin. I extended and +% patched the macros to suite our needs which results in a +% messy module. Therefore, this module badly needs an update +% because it's now a mixture of old and new macros. + +% afhankelijke variabelen +% +% \overgap vervangen door \floatsidetopskip +% \sidegap vervangen door \floatsideskip +% \undergap vervangen door \floatsidebottomskip +% +% \prskp vervangen door \ctxparskip + +% toegevoegde macro's/aanroepen +% +% \logsidefloat : loginformatie +% \flushsidefloats : nodig voor koppen + +% recente wijzigingen: +% +% namen aangepast: \float... enz. i.p.v. \pic + +% Pas op: \EveryPar{\EveryPar{}\margetitel{whatever}} +% \plaatsfiguur[links]{}{} moet goed gaan. In dat geval +% begint de tekst terecht wat lager. + +\newdimen\sidefloatheight % includes the topskip +\newdimen\sidefloatwidth +\newdimen\sidefloathsize +\newdimen\sidefloatshift +\newdimen\sidefloatextrashift +\newdimen\sidefloatvsize \def\nofloatvsize{-1pt } +\newdimen\sidefloatprogress +\newdimen\sidefloatpagetotal + +\newbox\floatbottom + +\newcount\sidefloatsidelines +\newcount\sidefloatlinesdone + +% 1 = backspace +% 2 = leftedge +% 3 = leftmargin +% 4 = leftside +% 5 = rightside +% 6 = rightmargin +% 7 = rightedge +% 8 = cutspace + +\chardef\sidefloattype\zerocount + +\def\backspacefloat {\global\chardef\sidefloattype1 \putsidefloat} +\def\leftedgefloat {\global\chardef\sidefloattype2 \putsidefloat} +\def\leftmarginfloat {\global\chardef\sidefloattype3 \putsidefloat} +\def\leftfloat {\global\chardef\sidefloattype4 \putsidefloat} +\def\rightfloat {\global\chardef\sidefloattype5 \putsidefloat} +\def\rightmarginfloat {\global\chardef\sidefloattype6 \putsidefloat} +\def\rightedgefloat {\global\chardef\sidefloattype7 \putsidefloat} +\def\cutspacefloat {\global\chardef\sidefloattype8 \putsidefloat} + +\let\marginfloat \cutspacefloat + +\newif\ifroomforfloat +\newif\iffloatshort +\newif\iffloatflag +\newif\iffloatrighteqo +\newif\iffloatlefteqo + +\newdimen\sidefloatleftskip +\newdimen\sidefloatrightskip +\newdimen\sidefloatmaximum + +% \def\checksidefloatshift +% {\ifdim\sidefloatmaximum>\zeropoint +% \ifcase\sidefloattype +% % invalid +% \or +% % backspace +% \or +% \global\sidefloatshift-\sidefloatmaximum +% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance +% \or +% \global\sidefloatshift-\sidefloatmaximum +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance +% \or +% % left +% \or +% % right +% \or +% \global\sidefloatshift-\sidefloatmaximum +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance +% \or +% \global\sidefloatshift-\sidefloatmaximum +% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth +% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance +% \or +% % cutspace +% \fi +% \fi} + +\def\checksidefloatshift + {\ifdim\sidefloatmaximum>\zeropoint + \ifcase\sidefloattype + % invalid + \or + % backspace + \or + \global\sidefloatshift\dimexpr + -\sidefloatmaximum + -\rightorleftpageaction \leftedgedistance \rightedgedistance + -\rightorleftpageaction \leftmarginwidth \rightmarginwidth + -\rightorleftpageaction \leftmargindistance \rightmargindistance + -\compensatedinnermakeupmargin + \relax + \or + \global\sidefloatshift\dimexpr + -\sidefloatmaximum + -\rightorleftpageaction \leftmargindistance \rightmargindistance + -\compensatedinnermakeupmargin + \relax + \or + % left + \or + % right + \or + \global\sidefloatshift\dimexpr + -\sidefloatmaximum + -\rightorleftpageaction \leftmargindistance \rightmargindistance + -\compensatedinnermakeupmargin + \relax + \or + \global\sidefloatshift\dimexpr + -\sidefloatmaximum + -\rightorleftpageaction \leftedgedistance \rightedgedistance + -\rightorleftpageaction \leftmarginwidth \rightmarginwidth + -\rightorleftpageaction \leftmargindistance \rightmargindistance + -\compensatedinnermakeupmargin + \relax + \or + % cutspace + \fi + \fi} + +% \def\setsidefloatskips +% {\global\sidefloatrightskip\zeropoint +% \global\sidefloatleftskip \zeropoint +% \ifcase\sidefloattype +% \or % backspace +% \global \sidefloatleftskip \rightorleftpageaction \backspace \cutspace +% \or % leftedge +% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance +% \global\advance\sidefloatleftskip \rightorleftpageaction \leftmarginwidth\rightmarginwidth +% \global\advance\sidefloatleftskip \rightorleftpageaction \leftedgedistance\rightedgedistance +% \or % leftmargin +% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance +% \or % leftside +% \or % rightside +% \or % rightmargin +% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance +% \or % rightedge +% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance +% \global\advance\sidefloatrightskip\rightorleftpageaction \rightmarginwidth\leftmarginwidth +% \global\advance\sidefloatrightskip\rightorleftpageaction \rightedgedistance\leftedgedistance +% \or % cutspace +% \global \sidefloatrightskip\rightorleftpageaction \cutspace\backspace +% \fi +% \ifdim\sidefloatrightskip>\zeropoint +% \doglobal\advance\sidefloatrightskip\rightskip +% \fi +% \ifdim\sidefloatleftskip>\zeropoint +% \doglobal\advance\sidefloatleftskip\leftskip +% \fi} + + +% use \outermarginwidth etc here + +\def\setsidefloatskips + {\global\sidefloatrightskip\zeropoint + \global\sidefloatleftskip \zeropoint + \ifcase\sidefloattype + \or % backspace + \global\sidefloatleftskip\dimexpr + +\rightorleftpageaction \backspace \cutspace + +\compensatedinnermakeupmargin + \relax + \or % leftedge + \global\sidefloatleftskip\dimexpr + +\rightorleftpageaction \leftmargindistance \rightmargindistance + +\rightorleftpageaction \leftmarginwidth \rightmarginwidth + +\rightorleftpageaction \leftedgedistance \rightedgedistance + +\compensatedinnermakeupmargin + \relax + \or % leftmargin + \global\sidefloatleftskip\dimexpr + +\rightorleftpageaction \leftmargindistance \rightmargindistance + +\compensatedinnermakeupmargin + \relax + \or % leftside + \or % rightside + \or % rightmargin + \global\sidefloatrightskip\dimexpr + +\rightorleftpageaction \rightmargindistance \leftmargindistance + +\compensatedinnermakeupmargin + \relax + \or % rightedge + \global\sidefloatrightskip\dimexpr + +\rightorleftpageaction \rightmargindistance \leftmargindistance + +\rightorleftpageaction \rightmarginwidth \leftmarginwidth + +\rightorleftpageaction \rightedgedistance \leftedgedistance + +\compensatedinnermakeupmargin + \relax + \or % cutspace + \global\sidefloatrightskip\dimexpr + +\rightorleftpageaction \cutspace \backspace + +\compensatedinnermakeupmargin + \relax + \fi + \ifdim\sidefloatrightskip>\zeropoint \doglobal\advance\sidefloatrightskip\rightskip \fi + \ifdim\sidefloatleftskip >\zeropoint \doglobal\advance\sidefloatleftskip \leftskip \fi} + +% eq is still crap + +\ifx\normalleqno\undefined + + \let\floatrighteqo=\eqno + \let\floatleftleqo=\leqno + +\else + + \let\floatrighteqo=\normaleqno + \let\floatleftleqo=\normalleqno + +\fi + +% Watch it even more! In inner, gaat't mis omdat daar +% pagetotal enz niet zijn aangepast. Inner kan overigens niet +% betrouwbaar worden getest! + +% \def\flushsidefloats% +% {\par +% \sidefloatprogress=\sidefloatvsize +% \advance\sidefloatprogress by -\pagetotal +% \ifdim\sidefloatprogress>\zeropoint +% \witruimte % nog checken op interferentie +% \kern\sidefloatprogress +% \fi +% \global\sidefloatvsize=\nofloatvsize +% \global\floatflagfalse} +% +% no, too buggy, leads to top of page crap +% +%\def\flushsidefloats +% {\par +% \dochecksidefloat +% \scratchcounter=-\hangafter +% \dorecurse{\scratchcounter}{\strut\hfill\strut\par}} +% +%\def\flushsidefloats +% {\par +% \!!heighta\sidefloatvsize +% \advance\!!heighta -\pagetotal +% \ifdim\!!heighta>\zeropoint +% % to be checked for interference +% \witruimte +% % will be option +% \getnoflines\!!heighta +% \!!heighta\noflines\lineheight +% % so far for option +% \kern\!!heighta +% \fi +% % == \forgetsidefloats +% \global\sidefloatvsize\nofloatvsize +% \global\floatshortfalse +% \global\floatflagfalse} + +% \def\flushsidefloats +% {\par +% \!!heighta\sidefloatvsize +% \advance\!!heighta -\pagetotal +% \ifdim\!!heighta>\zeropoint +% % to be checked for interference +% \witruimte +% % will be option +% \getnoflines\!!heighta +% \!!heighta\noflines\lineheight +% % so far for option +% \ifdim\sidefloatbottomskip>\zeropoint\relax +% \ifdim\!!heighta>\sidefloatbottomskip +% \advance\!!heighta-\sidefloatbottomskip +% \kern\!!heighta +% \vskip\sidefloatbottomskip +% \else +% \kern\!!heighta +% \fi +% \else +% \kern\!!heighta +% \fi +% \fi +% % == \forgetsidefloats +% \global\sidefloatvsize\nofloatvsize +% \global\floatshortfalse +% \global\floatflagfalse} + +\newif\iftracesidefloats + +\def\flushsidefloats + {\par + \!!heighta\sidefloatvsize + \advance\!!heighta -\pagetotal + \ifnum\!!heighta>\zeropoint + \global\advance\sidefloatvsize -\sidefloatbottomskip + \ifdim\!!heighta>\zeropoint + \bgroup + \let\flushsidefloats\relax + \forgetall + \doloop + {\strut + \iftracesidefloats + \color[darkgray]% + {\baselinerulefalse + \boxrulewidth.5\points + \ruledhbox{\strut\kern\sidefloatwidth}}% + \fi + \par + \!!heighta\sidefloatvsize + \advance\!!heighta -\pagetotal + \ifdim\!!heighta>\zeropoint + \ifnum\recurselevel>\plushundred + \exitloop + \fi + \else + \exitloop + \fi}% + \egroup + \ifdim\parskip>\zeropoint + \ifdim\sidefloatbottomskip>\parskip + \nowhitespace + \vskip\sidefloatbottomskip + \fi + \fi + \else\ifdim\sidefloatbottomskip>\parskip + \vskip\sidefloatbottomskip + \fi\fi + \fi + % not entirely the same as \forgetsidefloats + \global\sidefloatvsize\nofloatvsize + % \global\sidefloatsidelines\zerocount % no, we flush before a side float + \global\floatshortfalse % so this will get lost + % also here if used at all \global\holdinginserts\zerocount + \global\floatflagfalse} + +\def\flushsidefloatsafterpar + {\xdef\oldpagetotal{\the\pagetotal}% + \gdef\checksidefloat + {\dochecksidefloat + \ifdim\oldpagetotal=\pagetotal \else + \global\let\checksidefloat\dochecksidefloat + \flushsidefloats + \global\sidefloatsidelines\zerocount % here ! + \fi}} + +\def\forgetsidefloats + {\global\sidefloatvsize\nofloatvsize + \global\sidefloatsidelines\zerocount + % also here if used at all \global\holdinginserts\zerocount + \global\floatshortfalse + \global\floatflagfalse} + +\let\logsidefloat=\relax + +\def\pushpenalties % needed ? and right + {\widowpenalty\plusone + \clubpenalty\plustwo + \brokenpenalty\plusone + \let\pushpenalties\relax + \edef\poppenalties + {\widowpenalty \the\widowpenalty + \clubpenalty \the\clubpenalty + \brokenpenalty\the\brokenpenalty + \let\poppenalties\relax}} + +% shouldn;t that be: +% +% \def\pushpenalties % needed? +% {\let\pushpenalties\relax +% \edef\poppenalties +% {\widowpenalty \the\widowpenalty +% \clubpenalty \the\clubpenalty +% \brokenpenalty\the\brokenpenalty +% \let\poppenalties\relax}% +% \widowpenalty\plusone +% \clubpenalty\plustwo +% \brokenpenalty\plusone} + +\let\poppenalties=\relax + +\def\restorepenalties + {\ifnum\outputpenalty=\!!tenthousand\else + \penalty\outputpenalty + \fi} + +\def\sidefloatoutput + {\iffloatshort + \unvbox\normalpagebox + \setbox\floatbottom\lastbox + \ifdim\wd\floatbottom>\sidefloathsize + \penalty-201 + \box\floatbottom + \else + \ifvoid\floatbottom + \else + \restoreleftindent + \ifdim\wd\floatbottom<\sidefloathsize + \parskip\zeropoint + %\noindent + \ifinner\else\vadjust{\penalty\minusone}\fi + \iffloatlefteqo + \global\floatlefteqofalse + \else + \global\advance\sidefloathsize -\wd\floatbottom + \iffloatrighteqo + \global\floatrighteqofalse + \else + \global\divide\sidefloathsize \plustwo + \fi + \hskip\sidefloathsize + \fi + \fi + \box\floatbottom + \restorepenalties + \fi + \fi + % why was this \global\holdinginserts\zerocount + \global\floatshortfalse + \else + \finalsidefloatoutput % new + \global\sidefloatvsize\nofloatvsize + \global\sidefloatsidelines\zerocount + % we can end up in fig lock, so \global\holdinginserts\zerocount here too ? + \poppenalties + \fi} + +\def\finalsidefloatoutput% new + {\finaloutput\unvbox\normalpagebox} + +\def\restoreleftindent + {\relax \ifnum\sidefloattype>4 \else + \parskip\zeropoint % here ? + \ifdim\sidefloatwidth>\zeropoint % new, see prikkels + \noindent + \ifinner\else\vadjust{\penalty\minusone}\fi + \hskip\sidefloatwidth + %\else + % we have a margin or edge float + \fi + \fi} + +\ifx\normaleqno\undefined + + \def\normaleqno + {\iffloatshort + \global\floatrighteqotrue + \fi + \floatrighteqo} + +\else + + \def\eqno + {\iffloatshort + \global\floatrighteqotrue + \fi + \floatrighteqo} + +\fi + +% externfiguur -> grid =ja|hoogte|diepte|halveregel|passend -> helemaal in details +% stelplaatsblokin -> zijuitlijnen=hoogte|diepte|regel|halveregel|grid -> halveregel in 'details' + +% replacement for below +% +% \global\setbox\floatbox\hbox % no \hskip, but \kern here +% {\ifcase\sidefloattype +% \vbox{#1}% +% \or % 1 +% \hskip\sidefloatleftshift +% \hskip\sidefloatshift +% \vbox{#1}% +% \kern-\sidefloatextrashift +% \or % 2 +% \hskip\sidefloatshift +% \vbox{#1}% +% \kern-\sidefloatextrashift +% \or % 3 +% \hskip\sidefloatshift +% \vbox{#1}% +% \kern-\sidefloatextrashift +% \or % 4 +% \hskip\sidefloatleftshift +% \hskip\sidefloatshift +% \vbox{#1\removedepth}% +% \kern-\sidefloatextrashift +% \or % 5 +% \hskip-\sidefloatextrashift +% \vbox{#1}% +% \kern\sidefloatshift +% \kern\sidefloatrightshift +% \or % 6 +% \hskip-\sidefloatextrashift +% \vbox{#1}% +% \kern\sidefloatshift +% \or % 7 +% \hskip-\sidefloatextrashift +% \vbox{#1}% +% \kern\sidefloatshift +% \or % 8 +% \hskip-\sidefloatextrashift +% \vbox{#1}% +% \kern\sidefloatshift +% \kern\sidefloatrightshift +% \fi}% +% +% keep this ^ + +\def\putsidefloat#1% grid (4) is rather experimental + {\par + \whitespace + % moved here dec 2001 + {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}% moved + \checksidefloatshift + \ifdim\sidefloatshift=\zeropoint \relax + \ifnum\sidefloattype=4 + \global\advance\sidefloatshift\sidefloatextrashift + \global\sidefloatextrashift\zeropoint + \else\ifnum\sidefloattype=5 + \global\advance\sidefloatshift\sidefloatextrashift + \global\sidefloatextrashift\zeropoint + \fi\fi + \else + \ifnum\sidefloattype<4 + \global\chardef\sidefloattype4 + \else\ifnum\sidefloattype>5 + \global\chardef\sidefloattype5 + \fi\fi + \fi + \previoussidefloat + \stallsidefloat + %\global\setbox\floatbox\hbox + % {\ifmarginfloat\else\ifrightfloat\else\kern\sidefloatleftshift\fi\fi + % \hskip\ifrightfloat-\sidefloatextrashift\else\sidefloatshift\fi + % \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}% + % \kern\ifrightfloat\sidefloatshift\else-\sidefloatextrashift\fi + % \ifmarginfloat\else\ifrightfloat\kern\sidefloatrightshift\fi\fi}% + \global\setbox\floatbox\hbox % no \hskip, but \kern here + {\ifnum\sidefloattype=4 + \hskip\sidefloatleftshift + \else\ifnum\sidefloattype=1 + \hskip\sidefloatleftshift + \fi\fi + \ifnum\sidefloattype>4 + \hskip-\sidefloatextrashift + \else + \hskip\sidefloatshift + \fi + \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}% + \ifnum\sidefloattype>4 + \kern\sidefloatshift + \else + \kern-\sidefloatextrashift + \fi + \ifnum\sidefloattype=8 + \kern\sidefloatrightshift + \else\ifnum\sidefloattype=5 + \kern\sidefloatrightshift + \fi\fi}% + \ifnum\sidefloatalign=4 + \getnoflines{\ht\floatbox}% + \scratchdimen\noflines\lineheight + \advance\scratchdimen-\strutdepth + \getrawnoflines\sidefloattopskip + \advance\scratchdimen\noflines\lineheight + % todo: maybe rounding problem here + % \global\setbox\floatbox\hbox{\lower\lineheight\box\floatbox}% + \global\setbox\floatbox\hbox{\lower\strutdepth\box\floatbox}% + \global\ht\floatbox\scratchdimen + \global\dp\floatbox\zeropoint + \fi + \ifcase\sidefloatalign \else + \global\sidefloattopskip\zeropoint + \fi + \scratchdimen + \ifnum\sidefloattype<4 + \sidefloattopskip + \else\ifnum\sidefloattype>5 + \sidefloattopskip + \else + \zeropoint + \fi\fi + % the top of the box is at the previous baseline + \ifcase\sidefloatalign + % 0 normal + \advance\scratchdimen\strutdepth % == \sidefloattopoffset + \or % 1 height + \advance\scratchdimen\strutdepth % == \sidefloattopoffset + \or % 2 line + \or % 3 depth + \advance\scratchdimen\lineheight + \advance\scratchdimen\strutdepth + \or % 4 grid + \scratchdimen\zeropoint + \or + \advance\scratchdimen\strutheight + \fi + % new + \global\sidefloatlinesdone\zerocount + \ifnum\sidefloatsidelines>\zerocount + \advance\scratchdimen\sidefloatsidelines\lineheight + \fi + % new + \global\setbox\floatbox\hbox + {\vbox + {\vskip\scratchdimen + \nointerlineskip + \box\floatbox + \ifnum\sidefloatalign=5 \vskip-\lineheight \fi}}% + \ifnum\sidefloattype<4 + \global\sidefloattopskip\zeropoint + \else\ifnum\sidefloattype>5 + \global\sidefloattopskip\zeropoint + \fi\fi + \global\sidefloatdownshift\zeropoint + \measuresidefloat + \ifroomforfloat \else + \tosssidefloat + \measuresidefloat + \stallsidefloat + \fi + \setsidefloat} + +\def\progresssidefloat + {\sidefloatprogress\sidefloatvsize + \iffloatflag + \advance\sidefloatprogress -\sidefloatpagetotal + \global\floatflagfalse + \else + \advance\sidefloatprogress -\pagetotal + \fi} + +\def\tosssidefloat + {\vfill\eject} + +\def\measuresidefloat + {\global\floatflagtrue + \global\sidefloatpagetotal \pagetotal % global + \ifnum\sidefloattype<4 + \global \sidefloatwidth \zeropoint + \else\ifnum\sidefloattype>5 + \global \sidefloatwidth \zeropoint + \else + \global \sidefloatwidth \wd\floatbox + \global\advance\sidefloatwidth \floatsideskip + \fi\fi + \ifdim\sidefloatwidth<\zeropoint + \global\sidefloatwidth\zeropoint + \fi + \global \sidefloathsize \hsize + \global\advance\sidefloathsize -\sidefloatwidth + \global \sidefloatheight \ht\floatbox + \global\advance\sidefloatheight \dp\floatbox + \global\advance\sidefloatheight \sidefloattopskip + \global \sidefloatvsize \sidefloatheight + \global\advance\sidefloatvsize \sidefloatpagetotal + \dimen0\sidefloatvsize + \dimen2\pagegoal + \relax + \ifcase\sidefloatmethod + % method 0 : raw + \or + % method 1 : safe + \dimen2 .99\pagegoal + \or + % method 2 : tight + \advance\dimen0 -\onepoint + \fi + \relax % really needed ! ! ! ! + \ifdim\dimen0>\dimen2 + \global\roomforfloatfalse + \else + \dimen0=\pagegoal + \advance\dimen0 -\sidefloatvsize + \ifdim\dimen0<\sidefloatbottomskip + \global\advance\sidefloatvsize \dimen0 + \global\floatshorttrue + \pushpenalties + % why was this \global\holdinginserts\plusone + \else + \global\advance\sidefloatvsize \sidefloatbottomskip + \global\floatshortfalse + \fi + \global\roomforfloattrue + \fi} + +\def\setsidefloat% nilling everypar saves time and redudant pos's + {% removed here dec 2001 + % {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}% + \ifnum\sidefloattype=4 \kern\sidefloattopskip \fi + \ifnum\sidefloattype=5 \kern\sidefloattopskip \fi + \edef\presidefloatdepth{\the\prevdepth}% + \nointerlineskip + \bgroup + \everypar\emptytoks + \parskip\zeropoint + %\checksidefloatshift + \setsidefloatskips + \logsidefloat + \relax + \ifcase\sidefloattype + % invalid + \or % backspace + \noindent\llap{\rlap{\box\floatbox}\hskip\sidefloatleftskip}\hfill + \or % leftedge + \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill + \or % leftmargin + \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill + \or % leftside + \noindent\box\floatbox\hfill + \or % rightside + \hfill\box\floatbox + \or % rightmargin + \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}% + \or % rightedge + \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}% + \or % cutspace + \hfill\rlap{\hskip\sidefloatrightskip\llap{\box\floatbox}}% + \fi + \egroup + \par + \kern-\sidefloatheight + \penalty10001 % oeps, this will change + \normalbaselines + \prevdepth\presidefloatdepth + % \noindent + \resetsidefloatparagraph + \ignorespaces} % not really needed + +\newcount\sidefloatparagraph + +\def\iffirstsidefloatparagraph + {\ifcase\sidefloatparagraph\or} + +% without sidefloat lines +% +% \def\setsidefloatparagraph +% {%\advance\sidefloatprogress \sidefloatbottomskip +% %\!!counta\sidefloatprogress +% \scratchdimen\sidefloatprogress +% \advance\scratchdimen \strutht +% \advance\scratchdimen -\roundingeps % new, needed in prikkels, prevent rounding errors +% \!!counta\scratchdimen +% \divide\!!counta \baselineskip +% \ifnum\!!counta>0 +% \hangindent \ifnum\sidefloattype>4 -\fi\sidefloatwidth +% \hangafter-\!!counta +% \fi +% \global\advance\sidefloatparagraph \plusone +% \iftracesidefloats +% \hskip-\sidefloatwidth +% \color[darkgray]% +% {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth +% %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}% +% \llap{\showstruts\strut\hskip.25\bodyfontsize}}% +% \fi} + +\def\setsidefloatparagraph + {%\advance\sidefloatprogress \sidefloatbottomskip + %\!!counta\sidefloatprogress + \scratchdimen\sidefloatprogress + \advance\scratchdimen \strutht + \advance\scratchdimen -\roundingeps % new, needed in prikkels, prevent rounding errors + \!!counta\scratchdimen + \divide\!!counta \baselineskip\relax + \ifnum\!!counta>0 + % new from here + \ifcase\sidefloatsidelines\else + \ifcase\sidefloatlinesdone + \global\sidefloatlinesdone\!!counta + \else + \scratchcounter\sidefloatlinesdone + \advance\scratchcounter-\!!counta + \global\advance\sidefloatsidelines-\scratchcounter + \fi + \fi + \ifnum\sidefloatsidelines>\zerocount + \scratchtoks\emptytoks + \scratchcounter\sidefloatsidelines + \scratchdimen\hsize + \advance\scratchdimen-\sidefloatwidth + \dorecurse\sidefloatsidelines + {\appendtoks \zeropoint \hsize \to \scratchtoks}% + \ifnum\!!counta>\sidefloatsidelines + \advance\!!counta -\sidefloatsidelines\relax + \advance\scratchcounter\!!counta + \dorecurse\!!counta + {\ifnum\sidefloattype>4 + \appendtoks \zeropoint \scratchdimen \to \scratchtoks + \else + \appendtoks \sidefloatwidth \scratchdimen \to \scratchtoks + \fi}% + \fi + \advance\scratchcounter \plusone + \parshape \scratchcounter \the\scratchtoks \zeropoint \hsize\relax + \else + % new till here + \hangindent \ifnum\sidefloattype>4 -\fi\sidefloatwidth + \hangafter-\!!counta + \fi + \fi + \global\advance\sidefloatparagraph \plusone + \iftracesidefloats + \hskip-\sidefloatwidth + \color[darkgray]% + {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth + %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}% + \llap{\showstruts\strut\hskip.25\bodyfontsize}}% + \fi} + +\def\resetsidefloatparagraph + {\global\sidefloatparagraph\zerocount } + +\def\dochecksidefloat + {\progresssidefloat + \ifdim\sidefloatprogress>\zeropoint + \setsidefloatparagraph + \else + \resetsidefloatparagraph + \fi + \parskip\ctxparskip} + +\def\checksidefloat + {\dochecksidefloat} + +\def\synchronizesidefloats + {\ifinner \else \checksidefloat \fi} + +\def\doadjustsidefloatdisplaylines + {\par + \vskip-\parskip + \noindent + \ignorespaces} + +\def\adjustsidefloatdisplaylines + {\aftergroup\doadjustsidefloatdisplaylines} + +\def\previoussidefloat + {\progresssidefloat + \ifdim\sidefloatprogress>\zeropoint \relax + \iffloatshort + \global\floatshortfalse + \tosssidefloat + \else + \kern\sidefloatprogress + \fi + \fi} + +\def\stallsidefloat + {\!!counta\pageshrink + \divide\!!counta \baselineskip + \advance\!!counta \plusone + \parskip\zeropoint + \dorecurse\!!counta{\line{}} + \kern-\!!counta\baselineskip + \penalty\zerocount } + +% We need to hook it into the other otr's. This code will move. + +\let\OTRONEflushsidefloats \flushsidefloats +\let\OTRONEsynchronizesidefloats\synchronizesidefloats + +% page-set +% +% \let\OTRSETflushsidefloats \forgetsidefloats +% \let\OTRSETsynchronizesidefloats\forgetsidefloats + +% page-mul +% +% \let\OTRMULflushsidefloats \forgetsidefloats +% \let\OTRMULsynchronizesidefloats\forgetsidefloats + +\def\synchronizesidefloats{\OTRcommand\synchronizesidefloats} +\def\flushsidefloats {\OTRcommand\flushsidefloats} + +\protect \endinput diff --git a/tex/context/base/page-sid.tex b/tex/context/base/page-sid.tex deleted file mode 100644 index 0848c9d8c..000000000 --- a/tex/context/base/page-sid.tex +++ /dev/null @@ -1,931 +0,0 @@ -%D \module -%D [ file=page-sid, -%D version=2000.10.20, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Side Floats, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Side Floats} - -\unprotect - -% problem: when too small, side effects; we need to determine the -% shift earlier so that we can act when shift < size -% -% \definefloat[edgefigure] -% \setupfloat -% [edgefigure] -% [rightmargindistance=-\rightmargintotal, -% leftmargindistance=-\rightmargintotal, -% default=outer] -% \starttext -% \placeedgefigure{}{\framed[width=12cm]{}} \input tufte -% \placeedgefigure{}{\framed[width=5cm]{}} \input tufte -% \placeedgefigure{}{\framed[width=4cm]{}} \input tufte -% \placeedgefigure{}{\framed[width=2cm]{}} \input tufte -% \stoptext - -% todo: dimexpr an dnumexpr - -% These macro deal with side floats. We started with Daniel -% Comenetz macros as published in TUGBoat Volume 14 (1993), -% No.\ 1: Anchored Figures at Either Margin. I extended and -% patched the macros to suite our needs which results in a -% messy module. Therefore, this module badly needs an update -% because it's now a mixture of old and new macros. - -% afhankelijke variabelen -% -% \overgap vervangen door \floatsidetopskip -% \sidegap vervangen door \floatsideskip -% \undergap vervangen door \floatsidebottomskip -% -% \prskp vervangen door \ctxparskip - -% toegevoegde macro's/aanroepen -% -% \logsidefloat : loginformatie -% \flushsidefloats : nodig voor koppen - -% recente wijzigingen: -% -% namen aangepast: \float... enz. i.p.v. \pic - -% Pas op: \EveryPar{\EveryPar{}\margetitel{whatever}} -% \plaatsfiguur[links]{}{} moet goed gaan. In dat geval -% begint de tekst terecht wat lager. - -\newdimen\sidefloatheight % includes the topskip -\newdimen\sidefloatwidth -\newdimen\sidefloathsize -\newdimen\sidefloatshift -\newdimen\sidefloatextrashift -\newdimen\sidefloatvsize \def\nofloatvsize{-1pt } -\newdimen\sidefloatprogress -\newdimen\sidefloatpagetotal - -\newbox\floatbottom - -\newcount\sidefloatsidelines -\newcount\sidefloatlinesdone - -% 1 = backspace -% 2 = leftedge -% 3 = leftmargin -% 4 = leftside -% 5 = rightside -% 6 = rightmargin -% 7 = rightedge -% 8 = cutspace - -\chardef\sidefloattype\zerocount - -\def\backspacefloat {\global\chardef\sidefloattype1 \putsidefloat} -\def\leftedgefloat {\global\chardef\sidefloattype2 \putsidefloat} -\def\leftmarginfloat {\global\chardef\sidefloattype3 \putsidefloat} -\def\leftfloat {\global\chardef\sidefloattype4 \putsidefloat} -\def\rightfloat {\global\chardef\sidefloattype5 \putsidefloat} -\def\rightmarginfloat {\global\chardef\sidefloattype6 \putsidefloat} -\def\rightedgefloat {\global\chardef\sidefloattype7 \putsidefloat} -\def\cutspacefloat {\global\chardef\sidefloattype8 \putsidefloat} - -\let\marginfloat \cutspacefloat - -\newif\ifroomforfloat -\newif\iffloatshort -\newif\iffloatflag -\newif\iffloatrighteqo -\newif\iffloatlefteqo - -\newdimen\sidefloatleftskip -\newdimen\sidefloatrightskip -\newdimen\sidefloatmaximum - -% \def\checksidefloatshift -% {\ifdim\sidefloatmaximum>\zeropoint -% \ifcase\sidefloattype -% % invalid -% \or -% % backspace -% \or -% \global\sidefloatshift-\sidefloatmaximum -% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance -% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth -% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance -% \or -% \global\sidefloatshift-\sidefloatmaximum -% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance -% \or -% % left -% \or -% % right -% \or -% \global\sidefloatshift-\sidefloatmaximum -% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance -% \or -% \global\sidefloatshift-\sidefloatmaximum -% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance -% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth -% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance -% \or -% % cutspace -% \fi -% \fi} - -\def\checksidefloatshift - {\ifdim\sidefloatmaximum>\zeropoint - \ifcase\sidefloattype - % invalid - \or - % backspace - \or - \global\sidefloatshift\dimexpr - -\sidefloatmaximum - -\rightorleftpageaction \leftedgedistance \rightedgedistance - -\rightorleftpageaction \leftmarginwidth \rightmarginwidth - -\rightorleftpageaction \leftmargindistance \rightmargindistance - -\compensatedinnermakeupmargin - \relax - \or - \global\sidefloatshift\dimexpr - -\sidefloatmaximum - -\rightorleftpageaction \leftmargindistance \rightmargindistance - -\compensatedinnermakeupmargin - \relax - \or - % left - \or - % right - \or - \global\sidefloatshift\dimexpr - -\sidefloatmaximum - -\rightorleftpageaction \leftmargindistance \rightmargindistance - -\compensatedinnermakeupmargin - \relax - \or - \global\sidefloatshift\dimexpr - -\sidefloatmaximum - -\rightorleftpageaction \leftedgedistance \rightedgedistance - -\rightorleftpageaction \leftmarginwidth \rightmarginwidth - -\rightorleftpageaction \leftmargindistance \rightmargindistance - -\compensatedinnermakeupmargin - \relax - \or - % cutspace - \fi - \fi} - -% \def\setsidefloatskips -% {\global\sidefloatrightskip\zeropoint -% \global\sidefloatleftskip \zeropoint -% \ifcase\sidefloattype -% \or % backspace -% \global \sidefloatleftskip \rightorleftpageaction \backspace \cutspace -% \or % leftedge -% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance -% \global\advance\sidefloatleftskip \rightorleftpageaction \leftmarginwidth\rightmarginwidth -% \global\advance\sidefloatleftskip \rightorleftpageaction \leftedgedistance\rightedgedistance -% \or % leftmargin -% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance -% \or % leftside -% \or % rightside -% \or % rightmargin -% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance -% \or % rightedge -% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance -% \global\advance\sidefloatrightskip\rightorleftpageaction \rightmarginwidth\leftmarginwidth -% \global\advance\sidefloatrightskip\rightorleftpageaction \rightedgedistance\leftedgedistance -% \or % cutspace -% \global \sidefloatrightskip\rightorleftpageaction \cutspace\backspace -% \fi -% \ifdim\sidefloatrightskip>\zeropoint -% \doglobal\advance\sidefloatrightskip\rightskip -% \fi -% \ifdim\sidefloatleftskip>\zeropoint -% \doglobal\advance\sidefloatleftskip\leftskip -% \fi} - - -% use \outermarginwidth etc here - -\def\setsidefloatskips - {\global\sidefloatrightskip\zeropoint - \global\sidefloatleftskip \zeropoint - \ifcase\sidefloattype - \or % backspace - \global\sidefloatleftskip\dimexpr - +\rightorleftpageaction \backspace \cutspace - +\compensatedinnermakeupmargin - \relax - \or % leftedge - \global\sidefloatleftskip\dimexpr - +\rightorleftpageaction \leftmargindistance \rightmargindistance - +\rightorleftpageaction \leftmarginwidth \rightmarginwidth - +\rightorleftpageaction \leftedgedistance \rightedgedistance - +\compensatedinnermakeupmargin - \relax - \or % leftmargin - \global\sidefloatleftskip\dimexpr - +\rightorleftpageaction \leftmargindistance \rightmargindistance - +\compensatedinnermakeupmargin - \relax - \or % leftside - \or % rightside - \or % rightmargin - \global\sidefloatrightskip\dimexpr - +\rightorleftpageaction \rightmargindistance \leftmargindistance - +\compensatedinnermakeupmargin - \relax - \or % rightedge - \global\sidefloatrightskip\dimexpr - +\rightorleftpageaction \rightmargindistance \leftmargindistance - +\rightorleftpageaction \rightmarginwidth \leftmarginwidth - +\rightorleftpageaction \rightedgedistance \leftedgedistance - +\compensatedinnermakeupmargin - \relax - \or % cutspace - \global\sidefloatrightskip\dimexpr - +\rightorleftpageaction \cutspace \backspace - +\compensatedinnermakeupmargin - \relax - \fi - \ifdim\sidefloatrightskip>\zeropoint \doglobal\advance\sidefloatrightskip\rightskip \fi - \ifdim\sidefloatleftskip >\zeropoint \doglobal\advance\sidefloatleftskip \leftskip \fi} - -% eq is still crap - -\ifx\normalleqno\undefined - - \let\floatrighteqo=\eqno - \let\floatleftleqo=\leqno - -\else - - \let\floatrighteqo=\normaleqno - \let\floatleftleqo=\normalleqno - -\fi - -% Watch it even more! In inner, gaat't mis omdat daar -% pagetotal enz niet zijn aangepast. Inner kan overigens niet -% betrouwbaar worden getest! - -% \def\flushsidefloats% -% {\par -% \sidefloatprogress=\sidefloatvsize -% \advance\sidefloatprogress by -\pagetotal -% \ifdim\sidefloatprogress>\zeropoint -% \witruimte % nog checken op interferentie -% \kern\sidefloatprogress -% \fi -% \global\sidefloatvsize=\nofloatvsize -% \global\floatflagfalse} -% -% no, too buggy, leads to top of page crap -% -%\def\flushsidefloats -% {\par -% \dochecksidefloat -% \scratchcounter=-\hangafter -% \dorecurse{\scratchcounter}{\strut\hfill\strut\par}} -% -%\def\flushsidefloats -% {\par -% \!!heighta\sidefloatvsize -% \advance\!!heighta -\pagetotal -% \ifdim\!!heighta>\zeropoint -% % to be checked for interference -% \witruimte -% % will be option -% \getnoflines\!!heighta -% \!!heighta\noflines\lineheight -% % so far for option -% \kern\!!heighta -% \fi -% % == \forgetsidefloats -% \global\sidefloatvsize\nofloatvsize -% \global\floatshortfalse -% \global\floatflagfalse} - -% \def\flushsidefloats -% {\par -% \!!heighta\sidefloatvsize -% \advance\!!heighta -\pagetotal -% \ifdim\!!heighta>\zeropoint -% % to be checked for interference -% \witruimte -% % will be option -% \getnoflines\!!heighta -% \!!heighta\noflines\lineheight -% % so far for option -% \ifdim\sidefloatbottomskip>\zeropoint\relax -% \ifdim\!!heighta>\sidefloatbottomskip -% \advance\!!heighta-\sidefloatbottomskip -% \kern\!!heighta -% \vskip\sidefloatbottomskip -% \else -% \kern\!!heighta -% \fi -% \else -% \kern\!!heighta -% \fi -% \fi -% % == \forgetsidefloats -% \global\sidefloatvsize\nofloatvsize -% \global\floatshortfalse -% \global\floatflagfalse} - -\newif\iftracesidefloats - -\def\flushsidefloats - {\par - \!!heighta\sidefloatvsize - \advance\!!heighta -\pagetotal - \ifnum\!!heighta>\zeropoint - \global\advance\sidefloatvsize -\sidefloatbottomskip - \ifdim\!!heighta>\zeropoint - \bgroup - \let\flushsidefloats\relax - \forgetall - \doloop - {\strut - \iftracesidefloats - \color[darkgray]% - {\baselinerulefalse - \boxrulewidth.5\points - \ruledhbox{\strut\kern\sidefloatwidth}}% - \fi - \par - \!!heighta\sidefloatvsize - \advance\!!heighta -\pagetotal - \ifdim\!!heighta>\zeropoint - \ifnum\recurselevel>\plushundred - \exitloop - \fi - \else - \exitloop - \fi}% - \egroup - \ifdim\parskip>\zeropoint - \ifdim\sidefloatbottomskip>\parskip - \nowhitespace - \vskip\sidefloatbottomskip - \fi - \fi - \else\ifdim\sidefloatbottomskip>\parskip - \vskip\sidefloatbottomskip - \fi\fi - \fi - % not entirely the same as \forgetsidefloats - \global\sidefloatvsize\nofloatvsize - % \global\sidefloatsidelines\zerocount % no, we flush before a side float - \global\floatshortfalse % so this will get lost - % also here if used at all \global\holdinginserts\zerocount - \global\floatflagfalse} - -\def\flushsidefloatsafterpar - {\xdef\oldpagetotal{\the\pagetotal}% - \gdef\checksidefloat - {\dochecksidefloat - \ifdim\oldpagetotal=\pagetotal \else - \global\let\checksidefloat\dochecksidefloat - \flushsidefloats - \global\sidefloatsidelines\zerocount % here ! - \fi}} - -\def\forgetsidefloats - {\global\sidefloatvsize\nofloatvsize - \global\sidefloatsidelines\zerocount - % also here if used at all \global\holdinginserts\zerocount - \global\floatshortfalse - \global\floatflagfalse} - -\let\logsidefloat=\relax - -\def\pushpenalties % needed ? and right - {\widowpenalty\plusone - \clubpenalty\plustwo - \brokenpenalty\plusone - \let\pushpenalties\relax - \edef\poppenalties - {\widowpenalty \the\widowpenalty - \clubpenalty \the\clubpenalty - \brokenpenalty\the\brokenpenalty - \let\poppenalties\relax}} - -% shouldn;t that be: -% -% \def\pushpenalties % needed? -% {\let\pushpenalties\relax -% \edef\poppenalties -% {\widowpenalty \the\widowpenalty -% \clubpenalty \the\clubpenalty -% \brokenpenalty\the\brokenpenalty -% \let\poppenalties\relax}% -% \widowpenalty\plusone -% \clubpenalty\plustwo -% \brokenpenalty\plusone} - -\let\poppenalties=\relax - -\def\restorepenalties - {\ifnum\outputpenalty=\!!tenthousand\else - \penalty\outputpenalty - \fi} - -\def\sidefloatoutput - {\iffloatshort - \unvbox\normalpagebox - \setbox\floatbottom\lastbox - \ifdim\wd\floatbottom>\sidefloathsize - \penalty-201 - \box\floatbottom - \else - \ifvoid\floatbottom - \else - \restoreleftindent - \ifdim\wd\floatbottom<\sidefloathsize - \parskip\zeropoint - %\noindent - \ifinner\else\vadjust{\penalty\minusone}\fi - \iffloatlefteqo - \global\floatlefteqofalse - \else - \global\advance\sidefloathsize -\wd\floatbottom - \iffloatrighteqo - \global\floatrighteqofalse - \else - \global\divide\sidefloathsize \plustwo - \fi - \hskip\sidefloathsize - \fi - \fi - \box\floatbottom - \restorepenalties - \fi - \fi - % why was this \global\holdinginserts\zerocount - \global\floatshortfalse - \else - \finalsidefloatoutput % new - \global\sidefloatvsize\nofloatvsize - \global\sidefloatsidelines\zerocount - % we can end up in fig lock, so \global\holdinginserts\zerocount here too ? - \poppenalties - \fi} - -\def\finalsidefloatoutput% new - {\finaloutput\unvbox\normalpagebox} - -\def\restoreleftindent - {\relax \ifnum\sidefloattype>4 \else - \parskip\zeropoint % here ? - \ifdim\sidefloatwidth>\zeropoint % new, see prikkels - \noindent - \ifinner\else\vadjust{\penalty\minusone}\fi - \hskip\sidefloatwidth - %\else - % we have a margin or edge float - \fi - \fi} - -\ifx\normaleqno\undefined - - \def\normaleqno - {\iffloatshort - \global\floatrighteqotrue - \fi - \floatrighteqo} - -\else - - \def\eqno - {\iffloatshort - \global\floatrighteqotrue - \fi - \floatrighteqo} - -\fi - -% externfiguur -> grid =ja|hoogte|diepte|halveregel|passend -> helemaal in details -% stelplaatsblokin -> zijuitlijnen=hoogte|diepte|regel|halveregel|grid -> halveregel in 'details' - -% replacement for below -% -% \global\setbox\floatbox\hbox % no \hskip, but \kern here -% {\ifcase\sidefloattype -% \vbox{#1}% -% \or % 1 -% \hskip\sidefloatleftshift -% \hskip\sidefloatshift -% \vbox{#1}% -% \kern-\sidefloatextrashift -% \or % 2 -% \hskip\sidefloatshift -% \vbox{#1}% -% \kern-\sidefloatextrashift -% \or % 3 -% \hskip\sidefloatshift -% \vbox{#1}% -% \kern-\sidefloatextrashift -% \or % 4 -% \hskip\sidefloatleftshift -% \hskip\sidefloatshift -% \vbox{#1\removedepth}% -% \kern-\sidefloatextrashift -% \or % 5 -% \hskip-\sidefloatextrashift -% \vbox{#1}% -% \kern\sidefloatshift -% \kern\sidefloatrightshift -% \or % 6 -% \hskip-\sidefloatextrashift -% \vbox{#1}% -% \kern\sidefloatshift -% \or % 7 -% \hskip-\sidefloatextrashift -% \vbox{#1}% -% \kern\sidefloatshift -% \or % 8 -% \hskip-\sidefloatextrashift -% \vbox{#1}% -% \kern\sidefloatshift -% \kern\sidefloatrightshift -% \fi}% -% -% keep this ^ - -\def\putsidefloat#1% grid (4) is rather experimental - {\par - \whitespace - % moved here dec 2001 - {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}% moved - \checksidefloatshift - \ifdim\sidefloatshift=\zeropoint \relax - \ifnum\sidefloattype=4 - \global\advance\sidefloatshift\sidefloatextrashift - \global\sidefloatextrashift\zeropoint - \else\ifnum\sidefloattype=5 - \global\advance\sidefloatshift\sidefloatextrashift - \global\sidefloatextrashift\zeropoint - \fi\fi - \else - \ifnum\sidefloattype<4 - \global\chardef\sidefloattype4 - \else\ifnum\sidefloattype>5 - \global\chardef\sidefloattype5 - \fi\fi - \fi - \previoussidefloat - \stallsidefloat - %\global\setbox\floatbox\hbox - % {\ifmarginfloat\else\ifrightfloat\else\kern\sidefloatleftshift\fi\fi - % \hskip\ifrightfloat-\sidefloatextrashift\else\sidefloatshift\fi - % \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}% - % \kern\ifrightfloat\sidefloatshift\else-\sidefloatextrashift\fi - % \ifmarginfloat\else\ifrightfloat\kern\sidefloatrightshift\fi\fi}% - \global\setbox\floatbox\hbox % no \hskip, but \kern here - {\ifnum\sidefloattype=4 - \hskip\sidefloatleftshift - \else\ifnum\sidefloattype=1 - \hskip\sidefloatleftshift - \fi\fi - \ifnum\sidefloattype>4 - \hskip-\sidefloatextrashift - \else - \hskip\sidefloatshift - \fi - \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}% - \ifnum\sidefloattype>4 - \kern\sidefloatshift - \else - \kern-\sidefloatextrashift - \fi - \ifnum\sidefloattype=8 - \kern\sidefloatrightshift - \else\ifnum\sidefloattype=5 - \kern\sidefloatrightshift - \fi\fi}% - \ifnum\sidefloatalign=4 - \getnoflines{\ht\floatbox}% - \scratchdimen\noflines\lineheight - \advance\scratchdimen-\strutdepth - \getrawnoflines\sidefloattopskip - \advance\scratchdimen\noflines\lineheight - % todo: maybe rounding problem here - % \global\setbox\floatbox\hbox{\lower\lineheight\box\floatbox}% - \global\setbox\floatbox\hbox{\lower\strutdepth\box\floatbox}% - \global\ht\floatbox\scratchdimen - \global\dp\floatbox\zeropoint - \fi - \ifcase\sidefloatalign \else - \global\sidefloattopskip\zeropoint - \fi - \scratchdimen - \ifnum\sidefloattype<4 - \sidefloattopskip - \else\ifnum\sidefloattype>5 - \sidefloattopskip - \else - \zeropoint - \fi\fi - % the top of the box is at the previous baseline - \ifcase\sidefloatalign - % 0 normal - \advance\scratchdimen\strutdepth % == \sidefloattopoffset - \or % 1 height - \advance\scratchdimen\strutdepth % == \sidefloattopoffset - \or % 2 line - \or % 3 depth - \advance\scratchdimen\lineheight - \advance\scratchdimen\strutdepth - \or % 4 grid - \scratchdimen\zeropoint - \or - \advance\scratchdimen\strutheight - \fi - % new - \global\sidefloatlinesdone\zerocount - \ifnum\sidefloatsidelines>\zerocount - \advance\scratchdimen\sidefloatsidelines\lineheight - \fi - % new - \global\setbox\floatbox\hbox - {\vbox - {\vskip\scratchdimen - \nointerlineskip - \box\floatbox - \ifnum\sidefloatalign=5 \vskip-\lineheight \fi}}% - \ifnum\sidefloattype<4 - \global\sidefloattopskip\zeropoint - \else\ifnum\sidefloattype>5 - \global\sidefloattopskip\zeropoint - \fi\fi - \global\sidefloatdownshift\zeropoint - \measuresidefloat - \ifroomforfloat \else - \tosssidefloat - \measuresidefloat - \stallsidefloat - \fi - \setsidefloat} - -\def\progresssidefloat - {\sidefloatprogress\sidefloatvsize - \iffloatflag - \advance\sidefloatprogress -\sidefloatpagetotal - \global\floatflagfalse - \else - \advance\sidefloatprogress -\pagetotal - \fi} - -\def\tosssidefloat - {\vfill\eject} - -\def\measuresidefloat - {\global\floatflagtrue - \global\sidefloatpagetotal \pagetotal % global - \ifnum\sidefloattype<4 - \global \sidefloatwidth \zeropoint - \else\ifnum\sidefloattype>5 - \global \sidefloatwidth \zeropoint - \else - \global \sidefloatwidth \wd\floatbox - \global\advance\sidefloatwidth \floatsideskip - \fi\fi - \ifdim\sidefloatwidth<\zeropoint - \global\sidefloatwidth\zeropoint - \fi - \global \sidefloathsize \hsize - \global\advance\sidefloathsize -\sidefloatwidth - \global \sidefloatheight \ht\floatbox - \global\advance\sidefloatheight \dp\floatbox - \global\advance\sidefloatheight \sidefloattopskip - \global \sidefloatvsize \sidefloatheight - \global\advance\sidefloatvsize \sidefloatpagetotal - \dimen0\sidefloatvsize - \dimen2\pagegoal - \relax - \ifcase\sidefloatmethod - % method 0 : raw - \or - % method 1 : safe - \dimen2 .99\pagegoal - \or - % method 2 : tight - \advance\dimen0 -\onepoint - \fi - \relax % really needed ! ! ! ! - \ifdim\dimen0>\dimen2 - \global\roomforfloatfalse - \else - \dimen0=\pagegoal - \advance\dimen0 -\sidefloatvsize - \ifdim\dimen0<\sidefloatbottomskip - \global\advance\sidefloatvsize \dimen0 - \global\floatshorttrue - \pushpenalties - % why was this \global\holdinginserts\plusone - \else - \global\advance\sidefloatvsize \sidefloatbottomskip - \global\floatshortfalse - \fi - \global\roomforfloattrue - \fi} - -\def\setsidefloat% nilling everypar saves time and redudant pos's - {% removed here dec 2001 - % {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}% - \ifnum\sidefloattype=4 \kern\sidefloattopskip \fi - \ifnum\sidefloattype=5 \kern\sidefloattopskip \fi - \edef\presidefloatdepth{\the\prevdepth}% - \nointerlineskip - \bgroup - \everypar\emptytoks - \parskip\zeropoint - %\checksidefloatshift - \setsidefloatskips - \logsidefloat - \relax - \ifcase\sidefloattype - % invalid - \or % backspace - \noindent\llap{\rlap{\box\floatbox}\hskip\sidefloatleftskip}\hfill - \or % leftedge - \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill - \or % leftmargin - \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill - \or % leftside - \noindent\box\floatbox\hfill - \or % rightside - \hfill\box\floatbox - \or % rightmargin - \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}% - \or % rightedge - \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}% - \or % cutspace - \hfill\rlap{\hskip\sidefloatrightskip\llap{\box\floatbox}}% - \fi - \egroup - \par - \kern-\sidefloatheight - \penalty10001 % oeps, this will change - \normalbaselines - \prevdepth\presidefloatdepth - % \noindent - \resetsidefloatparagraph - \ignorespaces} % not really needed - -\newcount\sidefloatparagraph - -\def\iffirstsidefloatparagraph - {\ifcase\sidefloatparagraph\or} - -% without sidefloat lines -% -% \def\setsidefloatparagraph -% {%\advance\sidefloatprogress \sidefloatbottomskip -% %\!!counta\sidefloatprogress -% \scratchdimen\sidefloatprogress -% \advance\scratchdimen \strutht -% \advance\scratchdimen -\roundingeps % new, needed in prikkels, prevent rounding errors -% \!!counta\scratchdimen -% \divide\!!counta \baselineskip -% \ifnum\!!counta>0 -% \hangindent \ifnum\sidefloattype>4 -\fi\sidefloatwidth -% \hangafter-\!!counta -% \fi -% \global\advance\sidefloatparagraph \plusone -% \iftracesidefloats -% \hskip-\sidefloatwidth -% \color[darkgray]% -% {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth -% %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}% -% \llap{\showstruts\strut\hskip.25\bodyfontsize}}% -% \fi} - -\def\setsidefloatparagraph - {%\advance\sidefloatprogress \sidefloatbottomskip - %\!!counta\sidefloatprogress - \scratchdimen\sidefloatprogress - \advance\scratchdimen \strutht - \advance\scratchdimen -\roundingeps % new, needed in prikkels, prevent rounding errors - \!!counta\scratchdimen - \divide\!!counta \baselineskip\relax - \ifnum\!!counta>0 - % new from here - \ifcase\sidefloatsidelines\else - \ifcase\sidefloatlinesdone - \global\sidefloatlinesdone\!!counta - \else - \scratchcounter\sidefloatlinesdone - \advance\scratchcounter-\!!counta - \global\advance\sidefloatsidelines-\scratchcounter - \fi - \fi - \ifnum\sidefloatsidelines>\zerocount - \scratchtoks\emptytoks - \scratchcounter\sidefloatsidelines - \scratchdimen\hsize - \advance\scratchdimen-\sidefloatwidth - \dorecurse\sidefloatsidelines - {\appendtoks \zeropoint \hsize \to \scratchtoks}% - \ifnum\!!counta>\sidefloatsidelines - \advance\!!counta -\sidefloatsidelines\relax - \advance\scratchcounter\!!counta - \dorecurse\!!counta - {\ifnum\sidefloattype>4 - \appendtoks \zeropoint \scratchdimen \to \scratchtoks - \else - \appendtoks \sidefloatwidth \scratchdimen \to \scratchtoks - \fi}% - \fi - \advance\scratchcounter \plusone - \parshape \scratchcounter \the\scratchtoks \zeropoint \hsize\relax - \else - % new till here - \hangindent \ifnum\sidefloattype>4 -\fi\sidefloatwidth - \hangafter-\!!counta - \fi - \fi - \global\advance\sidefloatparagraph \plusone - \iftracesidefloats - \hskip-\sidefloatwidth - \color[darkgray]% - {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth - %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}% - \llap{\showstruts\strut\hskip.25\bodyfontsize}}% - \fi} - -\def\resetsidefloatparagraph - {\global\sidefloatparagraph\zerocount } - -\def\dochecksidefloat - {\progresssidefloat - \ifdim\sidefloatprogress>\zeropoint - \setsidefloatparagraph - \else - \resetsidefloatparagraph - \fi - \parskip\ctxparskip} - -\def\checksidefloat - {\dochecksidefloat} - -\def\synchronizesidefloats - {\ifinner \else \checksidefloat \fi} - -\def\doadjustsidefloatdisplaylines - {\par - \vskip-\parskip - \noindent - \ignorespaces} - -\def\adjustsidefloatdisplaylines - {\aftergroup\doadjustsidefloatdisplaylines} - -\def\previoussidefloat - {\progresssidefloat - \ifdim\sidefloatprogress>\zeropoint \relax - \iffloatshort - \global\floatshortfalse - \tosssidefloat - \else - \kern\sidefloatprogress - \fi - \fi} - -\def\stallsidefloat - {\!!counta\pageshrink - \divide\!!counta \baselineskip - \advance\!!counta \plusone - \parskip\zeropoint - \dorecurse\!!counta{\line{}} - \kern-\!!counta\baselineskip - \penalty\zerocount } - -% We need to hook it into the other otr's. This code will move. - -\let\OTRONEflushsidefloats \flushsidefloats -\let\OTRONEsynchronizesidefloats\synchronizesidefloats - -% page-set -% -% \let\OTRSETflushsidefloats \forgetsidefloats -% \let\OTRSETsynchronizesidefloats\forgetsidefloats - -% page-mul -% -% \let\OTRMULflushsidefloats \forgetsidefloats -% \let\OTRMULsynchronizesidefloats\forgetsidefloats - -\def\synchronizesidefloats{\OTRcommand\synchronizesidefloats} -\def\flushsidefloats {\OTRcommand\flushsidefloats} - -\protect \endinput diff --git a/tex/context/base/page-spr.mkii b/tex/context/base/page-spr.mkii new file mode 100644 index 000000000..06947a36a --- /dev/null +++ b/tex/context/base/page-spr.mkii @@ -0,0 +1,104 @@ +%D \module +%D [ file=page-spr, +%D version=2002.11.11, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Spreading, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Spreading} + +% This module is experimental and not yet official! + +\unprotect + +\newbox\spreadbox +\newif \ifinspread + +\chardef\showspreadmode=1 + +% beware, ugly overload, to be redone + +\def\normalsettextpagecontent#1#2#3% #2 and #3 will disappear + {\setbox#1\hbox + {\vbox to \textheight + {\offinterlineskip + \freezetextwidth + \hsize\textwidth % local variant of \sethsize + \boxmaxdepth\maxdepth + \noindent % content can be < \hsize + \dopagecontents#2#3}}% + \dp#1\zeropoint + \setbox#1\hbox to \makeupwidth + {\ifinspread + \ifvoid\spreadbox + \global\setbox\spreadbox\box#1% + \copy\spreadbox\hss % left page + \else + % prevent duplicate writes in normal run + \ifarrangingpages \else \ifcase\showspreadmode + \global\setbox\spreadbox\null + \wd\spreadbox\makeupwidth + \ht\spreadbox\textheight + \fi \fi + \hss\box\spreadbox % right page + \fi + \else + \hss\box#1\hss % never change the \hss's + \fi}} + +\def\doflushspread + {\ifinspread \ifvoid\spreadbox\else + % this page will be discarded later + \null \page + \fi \fi } + +\def\startspread + {\bgroup + \ifdoublesided + \page[\v!left]% + %\setsystemmode{spread}% + \inspreadtrue + \scratchdimen2\textwidth + \advance\scratchdimen2\backspace + \expanded{\setuplayout[\c!textwidth=\the\scratchdimen]}% + \def\startspread{\bgroup\let\stopspread\egroup}% + \let\stopspread\dostopspread + \else + \let\stopspread\egroup + \fi} + +\let\stopspread\relax + +\def\dostopspread + {\kern\zeropoint\page + \inspreadfalse + \setuplayout[\c!textwidth=\textwidth] + \page[\v!left] + \egroup} + +\protect \endinput + +% texexec --arr --pdf test +% +% \setuplayout[width=middle] +% \setuppapersize[A4][A3,landscape] +% \setuppagenumbering[alternative=doublesided] +% \setuparranging[2UP] +% +% \starttext +% +% \dorecurse{3}{\input tufte } +% +% \startspread +% \dorecurse{10}{\input tufte } +% \stopspread +% +% \dorecurse{3}{\input tufte } +% +% \stoptext diff --git a/tex/context/base/page-spr.mkiv b/tex/context/base/page-spr.mkiv new file mode 100644 index 000000000..4436ddcc2 --- /dev/null +++ b/tex/context/base/page-spr.mkiv @@ -0,0 +1,103 @@ +%D \module +%D [ file=page-spr, +%D version=2002.11.11, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Spreading, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Spreading} + +% This module is experimental and not yet official! + +\unprotect + +\newbox\spreadbox +\newif \ifinspread + +\chardef\showspreadmode\plusone + +% beware, ugly overload, to be redone + +\def\normalsettextpagecontent#1#2#3% #2 and #3 will disappear + {\setbox#1\hbox + {\setlayoutcomponentattribute\v!page\v!text + \vbox \layoutcomponentboxattribute to \textheight + {\offinterlineskip + \freezetextwidth + \hsize\textwidth % local variant of \sethsize + \boxmaxdepth\maxdepth + \noindent % content can be < \hsize + \dopagecontents#2#3}}% + \dp#1\zeropoint + \setbox#1\hbox to \makeupwidth + {\ifinspread + \ifvoid\spreadbox + \global\setbox\spreadbox\box#1% + \copy\spreadbox\hss % left page + \else + % prevent duplicate writes in normal run + \ifarrangingpages \else \ifcase\showspreadmode + \global\setbox\spreadbox\null + \wd\spreadbox\makeupwidth + \ht\spreadbox\textheight + \fi \fi + \hss\box\spreadbox % right page + \fi + \else + \hss\box#1\hss % never change the \hss's + \fi}} + +\def\doflushspread + {\ifinspread \ifvoid\spreadbox\else + % this page will be discarded later + \null \page + \fi \fi } + +\def\startspread + {\bgroup + \ifdoublesided + \page[\v!left]% + %\setsystemmode{spread}% + \inspreadtrue + \expanded{\setuplayout[\c!textwidth=\the\dimexpr2\textwidth+2\backspace\relax]}% + \def\startspread{\bgroup\let\stopspread\egroup}% + \let\stopspread\dostopspread + \else + \let\stopspread\egroup + \fi} + +\let\stopspread\relax + +\def\dostopspread + {\kern\zeropoint\page + \inspreadfalse + \setuplayout[\c!textwidth=\textwidth] + \page[\v!left] + \egroup} + +\protect \endinput + +% texexec --arr --pdf test +% +% \setuplayout[width=middle] +% \setuppapersize[A4][A3,landscape] +% \setuppagenumbering[alternative=doublesided] +% \setuparranging[2UP] +% +% \starttext +% +% \dorecurse{3}{\input tufte } +% +% \startspread +% \dorecurse{10}{\input tufte } +% \stopspread +% +% \dorecurse{3}{\input tufte } +% +% \stoptext diff --git a/tex/context/base/page-spr.tex b/tex/context/base/page-spr.tex deleted file mode 100644 index 06947a36a..000000000 --- a/tex/context/base/page-spr.tex +++ /dev/null @@ -1,104 +0,0 @@ -%D \module -%D [ file=page-spr, -%D version=2002.11.11, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Spreading, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Spreading} - -% This module is experimental and not yet official! - -\unprotect - -\newbox\spreadbox -\newif \ifinspread - -\chardef\showspreadmode=1 - -% beware, ugly overload, to be redone - -\def\normalsettextpagecontent#1#2#3% #2 and #3 will disappear - {\setbox#1\hbox - {\vbox to \textheight - {\offinterlineskip - \freezetextwidth - \hsize\textwidth % local variant of \sethsize - \boxmaxdepth\maxdepth - \noindent % content can be < \hsize - \dopagecontents#2#3}}% - \dp#1\zeropoint - \setbox#1\hbox to \makeupwidth - {\ifinspread - \ifvoid\spreadbox - \global\setbox\spreadbox\box#1% - \copy\spreadbox\hss % left page - \else - % prevent duplicate writes in normal run - \ifarrangingpages \else \ifcase\showspreadmode - \global\setbox\spreadbox\null - \wd\spreadbox\makeupwidth - \ht\spreadbox\textheight - \fi \fi - \hss\box\spreadbox % right page - \fi - \else - \hss\box#1\hss % never change the \hss's - \fi}} - -\def\doflushspread - {\ifinspread \ifvoid\spreadbox\else - % this page will be discarded later - \null \page - \fi \fi } - -\def\startspread - {\bgroup - \ifdoublesided - \page[\v!left]% - %\setsystemmode{spread}% - \inspreadtrue - \scratchdimen2\textwidth - \advance\scratchdimen2\backspace - \expanded{\setuplayout[\c!textwidth=\the\scratchdimen]}% - \def\startspread{\bgroup\let\stopspread\egroup}% - \let\stopspread\dostopspread - \else - \let\stopspread\egroup - \fi} - -\let\stopspread\relax - -\def\dostopspread - {\kern\zeropoint\page - \inspreadfalse - \setuplayout[\c!textwidth=\textwidth] - \page[\v!left] - \egroup} - -\protect \endinput - -% texexec --arr --pdf test -% -% \setuplayout[width=middle] -% \setuppapersize[A4][A3,landscape] -% \setuppagenumbering[alternative=doublesided] -% \setuparranging[2UP] -% -% \starttext -% -% \dorecurse{3}{\input tufte } -% -% \startspread -% \dorecurse{10}{\input tufte } -% \stopspread -% -% \dorecurse{3}{\input tufte } -% -% \stoptext diff --git a/tex/context/base/page-str.mkii b/tex/context/base/page-str.mkii new file mode 100644 index 000000000..cfaebe398 --- /dev/null +++ b/tex/context/base/page-str.mkii @@ -0,0 +1,376 @@ +%D \module +%D [ file=page-str, +%D version=2006.03.21, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Page Streams, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Page Streams} + +%D The first version of this component of \CONTEXT\ was written +%D for Thomas Schmitz who asked for parallel page streams. While +%D playing with the code, I decided to make it into a component +%D that can be used to construct all kind of stream related +%D mechanisms. Because I could apply this feature in a project, +%D there is some additional code here (related to graphics). +%D +%D These macros were written while listening to and watching the DVD +%D \quotation {Rush In Rio}. + +% not yet ok in mkiv ... marknotes + +\unprotect + +% taco, what is the best way to append a otr chunk (insert pagediscards?) + +\let\currentoutputstream\s!default + +\newtoks\defaultstreamoutput \defaultstreamoutput=\OTRONEoutput + +\newtoks\normalstreamoutput \normalstreamoutput={\saveoutputstream[\currentoutputstream]} + +\newcount\streampenalty \streampenalty=-101010101 + +\ifx\multicolumnseject\undefined \else + \let\normalmulticolumnseject\multicolumnseject + \def\multicolumnseject{\ifinoutputstream\else\normalmulticolumnseject\fi} +\fi + +\newif\ifinoutputstream + +\newtoks \everyenableoutputstream + +\appendtoks + \flushsidefloats +\to \everyenableoutputstream + +\def\enableoutputstream[#1]% + {\the\everyenableoutputstream + \finishoutputstream + \writestatus{otr}{switching to output stream #1}% + \inoutputstreamtrue + \xdef\currentoutputstream{#1}} + +\def\disableoutputstream + {\finishoutputstream + \writestatus{otr}{switching to default output stream}% + \inoutputstreamfalse + \global\let\currentoutputstream\s!default} + +\def\useoutputstream[#1]% + {\writestatus{otr}{using output stream #1}% + \xdef\currentoutputstream{#1}} + +\def\handlestreamoutput + {\doifelse\currentoutputstream\s!default + {\ifnum\outputpenalty=\streampenalty + \ifvoid\normalpagebox \else + \unvbox\normalpagebox + \fi + \else + \the\defaultstreamoutput + \fi} + {\the\normalstreamoutput}} + +\OTRONEoutput{\handlestreamoutput} + +\def\defineoutputstream[#1]% + {\doifundefined{otrs:#1}{\expandafter\newbox\csname otrs:#1\endcsname}} + +\def\outputstreamtag#1% + {\csname otrs:#1\endcsname} + +\def\finishoutputstream % todo: installoutput + {\endgraf + \penalty\streampenalty + \endgraf} + +\def\saveoutputstream[#1]% + {\writestatus{otr}{saving otr stream #1}% + \ifvoid\normalpagebox + \global\setbox\outputstreamtag{#1}\emptybox + \else + \global\setbox\outputstreamtag{#1}\vbox + {\presetoutputstream + \ifvoid\outputstreamtag{#1}\else\unvbox\outputstreamtag{#1}\fi + \scratchdimen\dp\normalpagebox + \unvbox\normalpagebox + \vskip-\scratchdimen + \kern\strutdepth}% + \fi} + +% \def\presetoutputstream +% {\pdffirstlineheight\strutheight +% \pdflastlinedepth \strutdepth +% \pdfeachlineheight \strutheight +% \pdfeachlinedepth \strutdepth} + +\let\presetoutputstream\relax + +\def\outputstreamht [#1]{\ht\outputstreamtag{#1}} +\def\outputstreamdp [#1]{\dp\outputstreamtag{#1}} +\def\outputstreamwd [#1]{\wd\outputstreamtag{#1}} + +%def\outputstreambox [#1]{\ifvoid\outputstreamtag{#1}\else\box \outputstreamtag{#1}\fi} +%def\outputstreamcopy[#1]{\ifvoid\outputstreamtag{#1}\else\copy\outputstreamtag{#1}\fi} + +\def\dowithoutputstreambox#1[#2]{\ifvoid\outputstreamtag{#2}\else#1\outputstreamtag{#2}\fi} + +\def\outputstreamcopy {\dowithoutputstreambox\copy } +\def\outputstreambox {\dowithoutputstreambox\box } +\def\outputstreamunvcopy{\dowithoutputstreambox\unvcopy} +\def\outputstreamunvbox {\dowithoutputstreambox\unvbox } + +%D Footnotes don't go along with streams, simply because there is no +%D way to re-split inserts. A dirty way out is to use marks and store +%D notes that way. + +\def\definemarknote + {\dodoubleempty\dodefinemarknote} + +\def\dodefinemarknote[#1][#2]% + {\definemarking[mn:#1]% + \setvalue{mn:#1:n}{0}% + \getparameters + [mn:#1] + [\c!before=, + \c!after=, + \c!inbetween=\endgraf, + \c!command=\firstofoneargument, + #2]} + +\def\setmarknote[#1]#2% + {\doglobal\incrementvalue{mn:#1:n}% + \setgvalue{mn:#1:t:\getvalue{mn:#1:n}}{#2}% + \expanded{\marking[mn:#1]{\getvalue{mn:#1:n}}}} + +\def\flushmarknotes[#1]% assumes split + {\begingroup +% \edef\firstmarknote{0\fetchmark[mn:#1][column:first]}% +% \edef\lastmarknote {0\fetchmark[mn:#1][column:last]}% +% \ifnum\firstmarknote<\lastmarknote\relax +% \getvalue{mn:#1\c!before}% +% \dostepwiserecurse\firstmarknote\lastmarknote\plusone +% {\ifnum\recurselevel>\firstmarknote\relax +% \ifnum\recurselevel<\lastmarknote\relax +% \getvalue{mn:#1\c!inbetween}% +% \fi +% \fi +% \getvalue{mn:#1\c!command}{\getvalue{mn:#1:t:\recurselevel}}}% +% \getvalue{mn:#1\c!after}% +% \fi + \endgroup} + +\def\erasemarknotes[#1]% + {\begingroup + \edef\firstmarknote{0\fetchmark[mn:#1][column:first]}% + \edef\lastmarknote {0\fetchmark[mn:#1][column:last]}% + \dostepwiserecurse\firstmarknote\lastmarknote\plusone + {\global\letvalue{mn:#1:t:\recurselevel}\empty}% + \endgroup} + +%D The next section implements synchronization of (currently +%D two) output streams. In due time we will implement both a +%D vertical and horizontal system, as well as alternative +%D splitters (firstpagevsize, succesivevsize etc). + +\def\synchronizeoutputstreams[#1]% [one,two] [left,right] + {\bgroup + \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement + \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement + \forgeteverypar + \def\roundingeps{50sp}% + \getboxheight\dimen0\of\box\outputstreamtag\firstoutputstream + \getboxheight\dimen2\of\box\outputstreamtag\secondoutputstream + \scratchdimen\dimexpr\dimen0-\dimen2\relax + \ifdim\scratchdimen<-\roundingeps\relax + \scratchdimen-\scratchdimen + \writestatus{sync}{compensating first stream: \the\scratchdimen/\number\scratchdimen}% + \getroundednoflines\scratchdimen + \global\setbox\outputstreamtag\firstoutputstream\vbox + {\presetoutputstream + \unvbox\outputstreamtag\firstoutputstream\dorecurse\noflines\crlf}% + \else\ifdim\scratchdimen>\roundingeps\relax + \writestatus{sync}{compensating second stream: \the\scratchdimen/\number\scratchdimen}% + \getroundednoflines\scratchdimen + \global\setbox\outputstreamtag\secondoutputstream\vbox + {\presetoutputstream + \unvbox\outputstreamtag\secondoutputstream\dorecurse\noflines\crlf}% + \else + \writestatus{sync}{no need to compensate streams: \the\scratchdimen/\number\scratchdimen}% + \fi\fi + \egroup} + +\def\nofoutputstreamsplitlines {\v!auto} % {40} +\def\outputstreamsplittolerance {-5} + +\def\flushoutputstreampages[#1]% + {\bgroup + \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement + \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement + \doloop + {\flushoutputstreams[#1]% + \ifvoid\outputstreamtag\firstoutputstream + \ifvoid\outputstreamtag\secondoutputstream + \exitloop + \else + \global\setbox\outputstreamtag\firstoutputstream\vbox{\strut}% + \fi + \else + \ifvoid\outputstreamtag\secondoutputstream + \global\setbox\outputstreamtag\secondoutputstream\vbox{\strut}% + \else + % okay + \fi + \fi}% + \egroup} + +\def\flushoutputstreams[#1]% + {\bgroup + \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement + \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement + \doif\nofoutputstreamsplitlines\v!auto + {\getrawnoflines\textheight + \edef\nofoutputstreamsplitlines{\the\noflines}}% + \splittopskip\strutheight + \scratchdimen\nofoutputstreamsplitlines\lineheight\relax + \unless\iffalse + \dimen0\scratchdimen + \doloop + {\setbox4\copy\outputstreamtag\firstoutputstream + \setbox0\vsplit4 to \dimen0 + \setbox0\vbox + {\directsetup{stream:\firstoutputstream:top}% + \unvbox0 + \directsetup{stream:\firstoutputstream:bottom}}% + \ifdim\ht0>\scratchdimen + \advance\dimen0-\lineheight + \else + \exitloop + \fi}% + \scratchdimen\dimen0 + \dimen2\scratchdimen + \doloop + {\setbox6\copy\outputstreamtag\secondoutputstream + \setbox2\vsplit6 to \dimen2 + \setbox2\vbox + {\directsetup{stream:\secondoutputstream:top}% + \unvbox0 + \directsetup{stream:\secondoutputstream:bottom}}% + \ifdim\ht2>\scratchdimen + \advance\dimen2-\lineheight + \else + \exitloop + \fi}% + \scratchdimen\dimen2 + \fi + \setbox4\copy\outputstreamtag\firstoutputstream + \setbox6\copy\outputstreamtag\secondoutputstream + \scratchcounter\zerocount + \doloop + {\setbox0\vsplit4 to \scratchdimen + \setbox0\vbox{\unvbox0}% + \setbox2\vsplit6 to \scratchdimen + \setbox2\vbox{\unvbox2}% + \ifvoid4 + \exitloop + \else\ifvoid6 + \exitloop + \else + \dimen8=\dimexpr\ht4-\ht6\relax + \ifdim\dimen8<\zeropoint\dimen8=-\dimen8\relax\fi + \advance\scratchcounter\plusone + \ifdim\dimen8<.5\lineheight + \exitloop + \else\ifnum\outputstreamsplittolerance>\zeropoint + \ifnum\scratchcounter>\outputstreamsplittolerance\relax + \exitloop + \else + \advance\scratchdimen\lineheight + \fi + \else\ifnum\outputstreamsplittolerance<\zeropoint + \ifnum-\scratchcounter<\outputstreamsplittolerance\relax + \exitloop + \else + \advance\scratchdimen-\lineheight + \fi + \else\ifnum\outputstreamsplittolerance=\zeropoint + \exitloop + \fi\fi\fi\fi + \fi\fi}% + \setbox0\vsplit\outputstreamtag\firstoutputstream to \scratchdimen + \setbox0\vbox to \textheight + {\presetoutputstream + \directsetup{stream:\firstoutputstream:top}% + \unvbox0 + \vfill + \directsetup{stream:\firstoutputstream:bottom}}% + \setbox2\vsplit\outputstreamtag\secondoutputstream to \scratchdimen + \setbox2\vbox to \textheight + {\presetoutputstream + \directsetup{stream:\secondoutputstream:top}% + \unvbox2 + \vfill + \directsetup{stream:\secondoutputstream:bottom}}% + \directsetup{stream:\firstoutputstream:reset}% + \directsetup{stream:\secondoutputstream:reset}% + \page[even] + \box0\vfill\page + \box2\vfill\page + \egroup} + + %D Although one can put floats in a stream, it sometimes makes sense + %D to keep them apart and this is what local floats do. + + \def\setuplocalfloats + {\getparameters[\??lf]} + + \setuplocalfloats + [%before=\blank, + %after=\blank, + inbetween=\blank] + + \installfloathandler \v!local \somelocalfloat + + \initializeboxstack{localfloats} + + \newcounter\noflocalfloats + + \def\resetlocalfloats + {\doglobal\newcounter\noflocalfloats + \initializeboxstack{localfloats}} + + \def\somelocalfloat[#1]% + {\doglobal\increment\noflocalfloats + \savebox{localfloats}{\noflocalfloats}{\box\floatbox}} + + \def\getlocalfloats + {\dorecurse\noflocalfloats + {\ifnum\recurselevel=\plusone % 1\relax + \getvalue{\??lf\c!before}% + \else + \getvalue{\??lf\c!inbetween}% + \fi + \dontleavehmode\hbox{\foundbox{localfloats}\recurselevel}% + \ifnum\recurselevel=\noflocalfloats\relax + \getvalue{\??lf\c!after}% + \fi}} + + \def\flushlocalfloats + {\getlocalfloats + \resetlocalfloats} + + \def\getlocalfloat#1{\expanded{\foundbox{localfloats}{\number#1}}} + + \def\forcelocalfloats{\let\forcedfloatmethod\v!local} + +%D Because many arrangements are possible, we will implement +%D some examples in a runtime loadable module \type {m-streams}. + +\protect \endinput diff --git a/tex/context/base/page-str.mkiv b/tex/context/base/page-str.mkiv new file mode 100644 index 000000000..e4fd39794 --- /dev/null +++ b/tex/context/base/page-str.mkiv @@ -0,0 +1,380 @@ +%D \module +%D [ file=page-str, +%D version=2006.03.21, +%D title=\CONTEXT\ Page Macros, +%D subtitle=Page Streams, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Page Macros / Page Streams} + +%D The first version of this component of \CONTEXT\ was written +%D for Thomas Schmitz who asked for parallel page streams. While +%D playing with the code, I decided to make it into a component +%D that can be used to construct all kind of stream related +%D mechanisms. Because I could apply this feature in a project, +%D there is some additional code here (related to graphics). +%D +%D These macros were written while listening to and watching the DVD +%D \quotation {Rush In Rio}. + +% not yet ok in mkiv ... marknotes .. will be completely redone + +\unprotect + +% taco, what is the best way to append a otr chunk (insert pagediscards?) + +\let\currentoutputstream\s!default + +\newtoks\defaultstreamoutput \defaultstreamoutput=\OTRONEoutput + +\newtoks\normalstreamoutput \normalstreamoutput={\saveoutputstream[\currentoutputstream]} + +\newcount\streampenalty \streampenalty=-101010101 + +\ifx\multicolumnseject\undefined \else + \let\normalmulticolumnseject\multicolumnseject + \def\multicolumnseject{\ifinoutputstream\else\normalmulticolumnseject\fi} +\fi + +\newif\ifinoutputstream + +\newtoks \everyenableoutputstream + +\appendtoks + \flushsidefloats +\to \everyenableoutputstream + +\def\enableoutputstream[#1]% + {\the\everyenableoutputstream + \finishoutputstream + \writestatus{otr}{switching to output stream #1}% + \inoutputstreamtrue + \xdef\currentoutputstream{#1}} + +\def\disableoutputstream + {\finishoutputstream + \writestatus{otr}{switching to default output stream}% + \inoutputstreamfalse + \global\let\currentoutputstream\s!default} + +\def\useoutputstream[#1]% + {\writestatus{otr}{using output stream #1}% + \xdef\currentoutputstream{#1}} + +\def\handlestreamoutput + {\ifx\currentoutputstream\s!default % already expanded + \ifnum\outputpenalty=\streampenalty + \ifvoid\normalpagebox \else + \unvbox\normalpagebox + \fi + \else + \the\defaultstreamoutput + \fi + \else + \the\normalstreamoutput + \fi} + +\OTRONEoutput{\handlestreamoutput} + +\def\defineoutputstream[#1]% + {\doifundefined{otrs:#1}{\expandafter\newbox\csname otrs:#1\endcsname}} + +\def\outputstreamtag#1% + {\csname otrs:#1\endcsname} + +\def\finishoutputstream % todo: installoutput + {\endgraf + \penalty\streampenalty + \endgraf} + +\def\saveoutputstream[#1]% + {\writestatus{otr}{saving otr stream #1}% + \ifvoid\normalpagebox + \global\setbox\outputstreamtag{#1}\emptybox + \else + \global\setbox\outputstreamtag{#1}\vbox + {\presetoutputstream + \ifvoid\outputstreamtag{#1}\else\unvbox\outputstreamtag{#1}\fi + \scratchdimen\dp\normalpagebox + \unvbox\normalpagebox + \vskip-\scratchdimen + \kern\strutdepth}% + \fi} + +% \def\presetoutputstream +% {\pdffirstlineheight\strutheight +% \pdflastlinedepth \strutdepth +% \pdfeachlineheight \strutheight +% \pdfeachlinedepth \strutdepth} + +\let\presetoutputstream\relax + +\def\outputstreamht [#1]{\ht\outputstreamtag{#1}} +\def\outputstreamdp [#1]{\dp\outputstreamtag{#1}} +\def\outputstreamwd [#1]{\wd\outputstreamtag{#1}} + +%def\outputstreambox [#1]{\ifvoid\outputstreamtag{#1}\else\box \outputstreamtag{#1}\fi} +%def\outputstreamcopy[#1]{\ifvoid\outputstreamtag{#1}\else\copy\outputstreamtag{#1}\fi} + +\def\dowithoutputstreambox#1[#2]{\ifvoid\outputstreamtag{#2}\else#1\outputstreamtag{#2}\fi} + +\def\outputstreamcopy {\dowithoutputstreambox\copy } +\def\outputstreambox {\dowithoutputstreambox\box } +\def\outputstreamunvcopy{\dowithoutputstreambox\unvcopy} +\def\outputstreamunvbox {\dowithoutputstreambox\unvbox } + +%D Footnotes don't go along with streams, simply because there is no +%D way to re-split inserts. A dirty way out is to use marks and store +%D notes that way. + +% not mkiv ready yet + +\def\definemarknote + {\dodoubleempty\dodefinemarknote} + +\def\dodefinemarknote[#1][#2]% + {\definemarking[mn:#1]% + \setvalue{mn:#1:n}{0}% + \getparameters + [mn:#1] + [\c!before=, + \c!after=, + \c!inbetween=\endgraf, + \c!command=\firstofoneargument, + #2]} + +\def\setmarknote[#1]#2% + {\doglobal\incrementvalue{mn:#1:n}% + \setgvalue{mn:#1:t:\getvalue{mn:#1:n}}{#2}% + \expanded{\marking[mn:#1]{\getvalue{mn:#1:n}}}} + +\def\flushmarknotes[#1]% assumes split + {\begingroup +% \edef\firstmarknote{0\fetchmark[mn:#1][column:first]}% +% \edef\lastmarknote {0\fetchmark[mn:#1][column:last]}% +% \ifnum\firstmarknote<\lastmarknote\relax +% \getvalue{mn:#1\c!before}% +% \dostepwiserecurse\firstmarknote\lastmarknote\plusone +% {\ifnum\recurselevel>\firstmarknote\relax +% \ifnum\recurselevel<\lastmarknote\relax +% \getvalue{mn:#1\c!inbetween}% +% \fi +% \fi +% \getvalue{mn:#1\c!command}{\getvalue{mn:#1:t:\recurselevel}}}% +% \getvalue{mn:#1\c!after}% +% \fi + \endgroup} + +\def\erasemarknotes[#1]% + {\begingroup + \edef\firstmarknote{0\fetchmark[mn:#1][column:first]}% + \edef\lastmarknote {0\fetchmark[mn:#1][column:last]}% + \dostepwiserecurse\firstmarknote\lastmarknote\plusone + {\global\letvalue{mn:#1:t:\recurselevel}\empty}% + \endgroup} + +%D The next section implements synchronization of (currently +%D two) output streams. In due time we will implement both a +%D vertical and horizontal system, as well as alternative +%D splitters (firstpagevsize, succesivevsize etc). + +\def\synchronizeoutputstreams[#1]% [one,two] [left,right] + {\bgroup + \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement + \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement + \forgeteverypar + \def\roundingeps{50sp}% + \getboxheight\dimen0\of\box\outputstreamtag\firstoutputstream + \getboxheight\dimen2\of\box\outputstreamtag\secondoutputstream + \scratchdimen\dimexpr\dimen0-\dimen2\relax + \ifdim\scratchdimen<-\roundingeps\relax + \scratchdimen-\scratchdimen + \writestatus{sync}{compensating first stream: \the\scratchdimen/\number\scratchdimen}% + \getroundednoflines\scratchdimen + \global\setbox\outputstreamtag\firstoutputstream\vbox + {\presetoutputstream + \unvbox\outputstreamtag\firstoutputstream\dorecurse\noflines\crlf}% + \else\ifdim\scratchdimen>\roundingeps\relax + \writestatus{sync}{compensating second stream: \the\scratchdimen/\number\scratchdimen}% + \getroundednoflines\scratchdimen + \global\setbox\outputstreamtag\secondoutputstream\vbox + {\presetoutputstream + \unvbox\outputstreamtag\secondoutputstream\dorecurse\noflines\crlf}% + \else + \writestatus{sync}{no need to compensate streams: \the\scratchdimen/\number\scratchdimen}% + \fi\fi + \egroup} + +\def\nofoutputstreamsplitlines {\v!auto} % {40} +\def\outputstreamsplittolerance {-5} + +\def\flushoutputstreampages[#1]% + {\bgroup + \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement + \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement + \doloop + {\flushoutputstreams[#1]% + \ifvoid\outputstreamtag\firstoutputstream + \ifvoid\outputstreamtag\secondoutputstream + \exitloop + \else + \global\setbox\outputstreamtag\firstoutputstream\vbox{\strut}% + \fi + \else + \ifvoid\outputstreamtag\secondoutputstream + \global\setbox\outputstreamtag\secondoutputstream\vbox{\strut}% + \else + % okay + \fi + \fi}% + \egroup} + +\def\flushoutputstreams[#1]% + {\bgroup + \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement + \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement + \doif\nofoutputstreamsplitlines\v!auto + {\getrawnoflines\textheight + \edef\nofoutputstreamsplitlines{\the\noflines}}% + \splittopskip\strutheight + \scratchdimen\nofoutputstreamsplitlines\lineheight\relax + \unless\iffalse + \dimen0\scratchdimen + \doloop + {\setbox4\copy\outputstreamtag\firstoutputstream + \setbox0\vsplit4 to \dimen0 + \setbox0\vbox + {\directsetup{stream:\firstoutputstream:top}% + \unvbox0 + \directsetup{stream:\firstoutputstream:bottom}}% + \ifdim\ht0>\scratchdimen + \advance\dimen0-\lineheight + \else + \exitloop + \fi}% + \scratchdimen\dimen0 + \dimen2\scratchdimen + \doloop + {\setbox6\copy\outputstreamtag\secondoutputstream + \setbox2\vsplit6 to \dimen2 + \setbox2\vbox + {\directsetup{stream:\secondoutputstream:top}% + \unvbox0 + \directsetup{stream:\secondoutputstream:bottom}}% + \ifdim\ht2>\scratchdimen + \advance\dimen2-\lineheight + \else + \exitloop + \fi}% + \scratchdimen\dimen2 + \fi + \setbox4\copy\outputstreamtag\firstoutputstream + \setbox6\copy\outputstreamtag\secondoutputstream + \scratchcounter\zerocount + \doloop + {\setbox0\vsplit4 to \scratchdimen + \setbox0\vbox{\unvbox0}% + \setbox2\vsplit6 to \scratchdimen + \setbox2\vbox{\unvbox2}% + \ifvoid4 + \exitloop + \else\ifvoid6 + \exitloop + \else + \dimen8=\dimexpr\ht4-\ht6\relax + \ifdim\dimen8<\zeropoint\dimen8=-\dimen8\relax\fi + \advance\scratchcounter\plusone + \ifdim\dimen8<.5\lineheight + \exitloop + \else\ifnum\outputstreamsplittolerance>\zeropoint + \ifnum\scratchcounter>\outputstreamsplittolerance\relax + \exitloop + \else + \advance\scratchdimen\lineheight + \fi + \else\ifnum\outputstreamsplittolerance<\zeropoint + \ifnum-\scratchcounter<\outputstreamsplittolerance\relax + \exitloop + \else + \advance\scratchdimen-\lineheight + \fi + \else\ifnum\outputstreamsplittolerance=\zeropoint + \exitloop + \fi\fi\fi\fi + \fi\fi}% + \setbox0\vsplit\outputstreamtag\firstoutputstream to \scratchdimen + \setbox0\vbox to \textheight + {\presetoutputstream + \directsetup{stream:\firstoutputstream:top}% + \unvbox0 + \vfill + \directsetup{stream:\firstoutputstream:bottom}}% + \setbox2\vsplit\outputstreamtag\secondoutputstream to \scratchdimen + \setbox2\vbox to \textheight + {\presetoutputstream + \directsetup{stream:\secondoutputstream:top}% + \unvbox2 + \vfill + \directsetup{stream:\secondoutputstream:bottom}}% + \directsetup{stream:\firstoutputstream:reset}% + \directsetup{stream:\secondoutputstream:reset}% + \page[even] + \box0\vfill\page + \box2\vfill\page + \egroup} + + %D Although one can put floats in a stream, it sometimes makes sense + %D to keep them apart and this is what local floats do. + + \def\setuplocalfloats + {\getparameters[\??lf]} + + \setuplocalfloats + [%before=\blank, + %after=\blank, + inbetween=\blank] + + \installfloathandler \v!local \somelocalfloat + + \initializeboxstack{localfloats} + + \newcounter\noflocalfloats + + \def\resetlocalfloats + {\doglobal\newcounter\noflocalfloats + \initializeboxstack{localfloats}} + + \def\somelocalfloat[#1]% + {\doglobal\increment\noflocalfloats + \savebox{localfloats}{\noflocalfloats}{\box\floatbox}} + + \def\getlocalfloats + {\dorecurse\noflocalfloats + {\ifnum\recurselevel=\plusone % 1\relax + \getvalue{\??lf\c!before}% + \else + \getvalue{\??lf\c!inbetween}% + \fi + \dontleavehmode\hbox{\foundbox{localfloats}\recurselevel}% + \ifnum\recurselevel=\noflocalfloats\relax + \getvalue{\??lf\c!after}% + \fi}} + + \def\flushlocalfloats + {\getlocalfloats + \resetlocalfloats} + + \def\getlocalfloat#1{\expanded{\foundbox{localfloats}{\number#1}}} + + \def\forcelocalfloats{\let\forcedfloatmethod\v!local} + +%D Because many arrangements are possible, we will implement +%D some examples in a runtime loadable module \type {m-streams}. + +\protect \endinput diff --git a/tex/context/base/page-str.tex b/tex/context/base/page-str.tex deleted file mode 100644 index 2fb53bc6a..000000000 --- a/tex/context/base/page-str.tex +++ /dev/null @@ -1,374 +0,0 @@ -%D \module -%D [ file=page-str, -%D version=2006.03.21, -%D title=\CONTEXT\ Page Macros, -%D subtitle=Page Streams, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Page Macros / Page Streams} - -%D The first version of this component of \CONTEXT\ was written -%D for Thomas Schmitz who asked for parallel page streams. While -%D playing with the code, I decided to make it into a component -%D that can be used to construct all kind of stream related -%D mechanisms. Because I could apply this feature in a project, -%D there is some additional code here (related to graphics). -%D -%D These macros were written while listening to and watching the DVD -%D \quotation {Rush In Rio}. - -\unprotect - -% taco, what is the best way to append a otr chunk (insert pagediscards?) - -\let\currentoutputstream\s!default - -\newtoks\defaultstreamoutput \defaultstreamoutput=\OTRONEoutput - -\newtoks\normalstreamoutput \normalstreamoutput={\saveoutputstream[\currentoutputstream]} - -\newcount\streampenalty \streampenalty=-101010101 - -\ifx\multicolumnseject\undefined \else - \let\normalmulticolumnseject\multicolumnseject - \def\multicolumnseject{\ifinoutputstream\else\normalmulticolumnseject\fi} -\fi - -\newif\ifinoutputstream - -\newtoks \everyenableoutputstream - -\appendtoks - \flushsidefloats -\to \everyenableoutputstream - -\def\enableoutputstream[#1]% - {\the\everyenableoutputstream - \finishoutputstream - \writestatus{otr}{switching to output stream #1}% - \inoutputstreamtrue - \xdef\currentoutputstream{#1}} - -\def\disableoutputstream - {\finishoutputstream - \writestatus{otr}{switching to default output stream}% - \inoutputstreamfalse - \global\let\currentoutputstream\s!default} - -\def\useoutputstream[#1]% - {\writestatus{otr}{using output stream #1}% - \xdef\currentoutputstream{#1}} - -\def\handlestreamoutput - {\doifelse\currentoutputstream\s!default - {\ifnum\outputpenalty=\streampenalty - \ifvoid\normalpagebox \else - \unvbox\normalpagebox - \fi - \else - \the\defaultstreamoutput - \fi} - {\the\normalstreamoutput}} - -\OTRONEoutput{\handlestreamoutput} - -\def\defineoutputstream[#1]% - {\doifundefined{otrs:#1}{\expandafter\newbox\csname otrs:#1\endcsname}} - -\def\outputstreamtag#1% - {\csname otrs:#1\endcsname} - -\def\finishoutputstream % todo: installoutput - {\endgraf - \penalty\streampenalty - \endgraf} - -\def\saveoutputstream[#1]% - {\writestatus{otr}{saving otr stream #1}% - \ifvoid\normalpagebox - \global\setbox\outputstreamtag{#1}\emptybox - \else - \global\setbox\outputstreamtag{#1}\vbox - {\presetoutputstream - \ifvoid\outputstreamtag{#1}\else\unvbox\outputstreamtag{#1}\fi - \scratchdimen\dp\normalpagebox - \unvbox\normalpagebox - \vskip-\scratchdimen - \kern\strutdepth}% - \fi} - -% \def\presetoutputstream -% {\pdffirstlineheight\strutheight -% \pdflastlinedepth \strutdepth -% \pdfeachlineheight \strutheight -% \pdfeachlinedepth \strutdepth} - -\let\presetoutputstream\relax - -\def\outputstreamht [#1]{\ht\outputstreamtag{#1}} -\def\outputstreamdp [#1]{\dp\outputstreamtag{#1}} -\def\outputstreamwd [#1]{\wd\outputstreamtag{#1}} - -%def\outputstreambox [#1]{\ifvoid\outputstreamtag{#1}\else\box \outputstreamtag{#1}\fi} -%def\outputstreamcopy[#1]{\ifvoid\outputstreamtag{#1}\else\copy\outputstreamtag{#1}\fi} - -\def\dowithoutputstreambox#1[#2]{\ifvoid\outputstreamtag{#2}\else#1\outputstreamtag{#2}\fi} - -\def\outputstreamcopy {\dowithoutputstreambox\copy } -\def\outputstreambox {\dowithoutputstreambox\box } -\def\outputstreamunvcopy{\dowithoutputstreambox\unvcopy} -\def\outputstreamunvbox {\dowithoutputstreambox\unvbox } - -%D Footnotes don't go along with streams, simply because there is no -%D way to re-split inserts. A dirty way out is to use marks and store -%D notes that way. - -\def\definemarknote - {\dodoubleempty\dodefinemarknote} - -\def\dodefinemarknote[#1][#2]% - {\definemarking[mn:#1]% - \setvalue{mn:#1:n}{0}% - \getparameters - [mn:#1] - [\c!before=, - \c!after=, - \c!inbetween=\endgraf, - \c!command=\firstofoneargument, - #2]} - -\def\setmarknote[#1]#2% - {\doglobal\incrementvalue{mn:#1:n}% - \setgvalue{mn:#1:t:\getvalue{mn:#1:n}}{#2}% - \expanded{\marking[mn:#1]{\getvalue{mn:#1:n}}}} - -\def\flushmarknotes[#1]% assumes split - {\begingroup - \edef\firstmarknote{0\fetchmark[mn:#1][column:first]}% - \edef\lastmarknote {0\fetchmark[mn:#1][column:last]}% - \ifnum\firstmarknote<\lastmarknote\relax - \getvalue{mn:#1\c!before}% - \dostepwiserecurse\firstmarknote\lastmarknote\plusone - {\ifnum\recurselevel>\firstmarknote\relax - \ifnum\recurselevel<\lastmarknote\relax - \getvalue{mn:#1\c!inbetween}% - \fi - \fi - \getvalue{mn:#1\c!command}{\getvalue{mn:#1:t:\recurselevel}}}% - \getvalue{mn:#1\c!after}% - \fi - \endgroup} - -\def\erasemarknotes[#1]% - {\begingroup - \edef\firstmarknote{0\fetchmark[mn:#1][column:first]}% - \edef\lastmarknote {0\fetchmark[mn:#1][column:last]}% - \dostepwiserecurse\firstmarknote\lastmarknote\plusone - {\global\letvalue{mn:#1:t:\recurselevel}\empty}% - \endgroup} - -%D The next section implements synchronization of (currently -%D two) output streams. In due time we will implement both a -%D vertical and horizontal system, as well as alternative -%D splitters (firstpagevsize, succesivevsize etc). - -\def\synchronizeoutputstreams[#1]% [one,two] [left,right] - {\bgroup - \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement - \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement - \forgeteverypar - \def\roundingeps{50sp}% - \getboxheight\dimen0\of\box\outputstreamtag\firstoutputstream - \getboxheight\dimen2\of\box\outputstreamtag\secondoutputstream - \scratchdimen\dimexpr\dimen0-\dimen2\relax - \ifdim\scratchdimen<-\roundingeps\relax - \scratchdimen-\scratchdimen - \writestatus{sync}{compensating first stream: \the\scratchdimen/\number\scratchdimen}% - \getroundednoflines\scratchdimen - \global\setbox\outputstreamtag\firstoutputstream\vbox - {\presetoutputstream - \unvbox\outputstreamtag\firstoutputstream\dorecurse\noflines\crlf}% - \else\ifdim\scratchdimen>\roundingeps\relax - \writestatus{sync}{compensating second stream: \the\scratchdimen/\number\scratchdimen}% - \getroundednoflines\scratchdimen - \global\setbox\outputstreamtag\secondoutputstream\vbox - {\presetoutputstream - \unvbox\outputstreamtag\secondoutputstream\dorecurse\noflines\crlf}% - \else - \writestatus{sync}{no need to compensate streams: \the\scratchdimen/\number\scratchdimen}% - \fi\fi - \egroup} - -\def\nofoutputstreamsplitlines {\v!auto} % {40} -\def\outputstreamsplittolerance {-5} - -\def\flushoutputstreampages[#1]% - {\bgroup - \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement - \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement - \doloop - {\flushoutputstreams[#1]% - \ifvoid\outputstreamtag\firstoutputstream - \ifvoid\outputstreamtag\secondoutputstream - \exitloop - \else - \global\setbox\outputstreamtag\firstoutputstream\vbox{\strut}% - \fi - \else - \ifvoid\outputstreamtag\secondoutputstream - \global\setbox\outputstreamtag\secondoutputstream\vbox{\strut}% - \else - % okay - \fi - \fi}% - \egroup} - -\def\flushoutputstreams[#1]% - {\bgroup - \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement - \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement - \doif\nofoutputstreamsplitlines\v!auto - {\getrawnoflines\textheight - \edef\nofoutputstreamsplitlines{\the\noflines}}% - \splittopskip\strutheight - \scratchdimen\nofoutputstreamsplitlines\lineheight\relax - \unless\iffalse - \dimen0\scratchdimen - \doloop - {\setbox4\copy\outputstreamtag\firstoutputstream - \setbox0\vsplit4 to \dimen0 - \setbox0\vbox - {\directsetup{stream:\firstoutputstream:top}% - \unvbox0 - \directsetup{stream:\firstoutputstream:bottom}}% - \ifdim\ht0>\scratchdimen - \advance\dimen0-\lineheight - \else - \exitloop - \fi}% - \scratchdimen\dimen0 - \dimen2\scratchdimen - \doloop - {\setbox6\copy\outputstreamtag\secondoutputstream - \setbox2\vsplit6 to \dimen2 - \setbox2\vbox - {\directsetup{stream:\secondoutputstream:top}% - \unvbox0 - \directsetup{stream:\secondoutputstream:bottom}}% - \ifdim\ht2>\scratchdimen - \advance\dimen2-\lineheight - \else - \exitloop - \fi}% - \scratchdimen\dimen2 - \fi - \setbox4\copy\outputstreamtag\firstoutputstream - \setbox6\copy\outputstreamtag\secondoutputstream - \scratchcounter\zerocount - \doloop - {\setbox0\vsplit4 to \scratchdimen - \setbox0\vbox{\unvbox0}% - \setbox2\vsplit6 to \scratchdimen - \setbox2\vbox{\unvbox2}% - \ifvoid4 - \exitloop - \else\ifvoid6 - \exitloop - \else - \dimen8=\dimexpr\ht4-\ht6\relax - \ifdim\dimen8<\zeropoint\dimen8=-\dimen8\relax\fi - \advance\scratchcounter\plusone - \ifdim\dimen8<.5\lineheight - \exitloop - \else\ifnum\outputstreamsplittolerance>\zeropoint - \ifnum\scratchcounter>\outputstreamsplittolerance\relax - \exitloop - \else - \advance\scratchdimen\lineheight - \fi - \else\ifnum\outputstreamsplittolerance<\zeropoint - \ifnum-\scratchcounter<\outputstreamsplittolerance\relax - \exitloop - \else - \advance\scratchdimen-\lineheight - \fi - \else\ifnum\outputstreamsplittolerance=\zeropoint - \exitloop - \fi\fi\fi\fi - \fi\fi}% - \setbox0\vsplit\outputstreamtag\firstoutputstream to \scratchdimen - \setbox0\vbox to \textheight - {\presetoutputstream - \directsetup{stream:\firstoutputstream:top}% - \unvbox0 - \vfill - \directsetup{stream:\firstoutputstream:bottom}}% - \setbox2\vsplit\outputstreamtag\secondoutputstream to \scratchdimen - \setbox2\vbox to \textheight - {\presetoutputstream - \directsetup{stream:\secondoutputstream:top}% - \unvbox2 - \vfill - \directsetup{stream:\secondoutputstream:bottom}}% - \directsetup{stream:\firstoutputstream:reset}% - \directsetup{stream:\secondoutputstream:reset}% - \page[even] - \box0\vfill\page - \box2\vfill\page - \egroup} - - %D Although one can put floats in a stream, it sometimes makes sense - %D to keep them apart and this is what local floats do. - - \def\setuplocalfloats - {\getparameters[\??lf]} - - \setuplocalfloats - [%before=\blank, - %after=\blank, - inbetween=\blank] - - \installfloathandler \v!local \somelocalfloat - - \initializeboxstack{localfloats} - - \newcounter\noflocalfloats - - \def\resetlocalfloats - {\doglobal\newcounter\noflocalfloats - \initializeboxstack{localfloats}} - - \def\somelocalfloat[#1]% - {\doglobal\increment\noflocalfloats - \savebox{localfloats}{\noflocalfloats}{\box\floatbox}} - - \def\getlocalfloats - {\dorecurse\noflocalfloats - {\ifnum\recurselevel=\plusone % 1\relax - \getvalue{\??lf\c!before}% - \else - \getvalue{\??lf\c!inbetween}% - \fi - \dontleavehmode\hbox{\foundbox{localfloats}\recurselevel}% - \ifnum\recurselevel=\noflocalfloats\relax - \getvalue{\??lf\c!after}% - \fi}} - - \def\flushlocalfloats - {\getlocalfloats - \resetlocalfloats} - - \def\getlocalfloat#1{\expanded{\foundbox{localfloats}{\number#1}}} - - \def\forcelocalfloats{\let\forcedfloatmethod\v!local} - -%D Because many arrangements are possible, we will implement -%D some examples in a runtime loadable module \type {m-streams}. - -\protect \endinput diff --git a/tex/context/base/page-txt.mkiv b/tex/context/base/page-txt.mkiv index ab0370316..f4e2d76f9 100644 --- a/tex/context/base/page-txt.mkiv +++ b/tex/context/base/page-txt.mkiv @@ -19,8 +19,6 @@ \unprotect -\let\dodummypageskip\gobbleoneargument % obsolete - %D Interfacing between this and other modules is handled by %D the following macros. The current state of a text line %D (header, footer, etc.) is checked by: @@ -74,16 +72,18 @@ \getparameters[\??tk#1#2][#3]% \else %\getparameters[\??tk#1\v!text][#2]% - \edef\previoustextstate{\getvalue{\??tk#1\c!state}}% + \edef\previoustextstate{\csname\??tk#1\c!state\endcsname}% \getparameters[\??tk#1][#2]% - \doifnotvalue{\??tk#1\c!state}\previoustextstate - {%\checkcurrentlayout % no - \edef\currenttextstate{\getvalue{\??tk#1\c!state}}% - % speed optimization (calculating backgrounds takes time) - \doifcommon{\previoustextstate,\currenttextstate}{\v!high,\v!none} - {\calculatevsizes - \recalculatebackgrounds - \recalculatelogos}}% + \edef\currenttextstate{\csname\??tk#1\c!state\endcsname}% + \ifx\currenttextstate\previoustextstate + % no change in state + \else + %\checkcurrentlayout % no + % speed optimization (calculating backgrounds takes time) + \doifcommon{\previoustextstate,\currenttextstate}{\v!high,\v!none} + {\calculatevsizes + \recalculatebackgrounds}% + \fi \fi} \def\setuptop {\dotripleempty\dosetuplayouttext[\v!top]} @@ -125,11 +125,11 @@ %D \showsetup{setupfootertexts} %D \showsetup{setupbottomtexts} -\def\setuptoptexts {\dosixtupleempty\dosetuptexts[\v!top]} -\def\setupheadertexts {\dosixtupleempty\dosetuptexts[\v!header]} -\def\setuptexttexts {\dosixtupleempty\dosetuptexts[\v!text]} +\def\setuptoptexts {\dosixtupleempty\dosetuptexts[\v!top ]} +\def\setupheadertexts {\dosixtupleempty\dosetuptexts[\v!header ]} +\def\setuptexttexts {\dosixtupleempty\dosetuptexts[\v!text ]} \def\setupfootertexts {\dosixtupleempty\dosetuptexts[\v!footer ]} -\def\setupbottomtexts {\dosixtupleempty\dosetuptexts[\v!bottom]} +\def\setupbottomtexts {\dosixtupleempty\dosetuptexts[\v!bottom ]} %D The left, right and center variables can also be set %D directly using the previously discussed macros. @@ -137,97 +137,78 @@ \def\dosetuptexts[#1][#2][#3][#4][#5][#6]% {\ifsixthargument \setvalue{\??tk#1#2\c!lefttext}% - {\dodoubletexts{\??tk#1}{#2}% + {\dodoubletexts{#1}{#2}% {\c!leftstyle \c!leftcolor \c!leftwidth }{#3}% {\c!rightstyle\c!rightcolor\c!rightwidth}{#6}}% \setvalue{\??tk#1#2\c!righttext}% - {\dodoubletexts{\??tk#1}{#2}% + {\dodoubletexts{#1}{#2}% {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}% {\c!leftstyle \c!leftcolor \c!leftwidth }{#5}}% \else\iffifthargument \setvalue{\??tk#1\v!text\c!lefttext}% - {\dodoubletexts{\??tk#1}\v!text + {\dodoubletexts{#1}\v!text {\c!leftstyle \c!leftcolor \c!leftwidth }{#2}% {\c!rightstyle\c!rightcolor\c!rightwidth}{#5}}% \setvalue{\??tk#1\v!text\c!righttext}% - {\dodoubletexts{\??tk#1}\v!text + {\dodoubletexts{#1}\v!text {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}% {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}}% \else\iffourthargument \setvalue{\??tk#1#2\c!lefttext}% - {\dodoubletexts{\??tk#1}{#2} + {\dodoubletexts{#1}{#2} {\c!leftstyle\c!leftcolor\c!leftwidth}{#3}% {\c!leftstyle\c!leftcolor\c!leftwidth}{#3}}% \setvalue{\??tk#1#2\c!righttext}% - {\dodoubletexts{\??tk#1}{#2} + {\dodoubletexts{#1}{#2} {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}% {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}}% \else\ifthirdargument \setvalue{\??tk#1\v!text\c!lefttext}% - {\dodoubletexts{\??tk#1}\v!text + {\dodoubletexts{#1}\v!text {\c!leftstyle\c!leftcolor\c!leftwidth}{#2}% {\c!leftstyle\c!leftcolor\c!leftwidth}{#2}}% \setvalue{\??tk#1\v!text\c!righttext}% - {\dodoubletexts{\??tk#1}\v!text + {\dodoubletexts{#1}\v!text {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}% {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}}% \else\ifsecondargument % new - \letvalue{\??tk#1\v!text\c!lefttext }\empty - \letvalue{\??tk#1\v!text\c!righttext}\empty - \setvalue{\??tk#1\v!text\c!middletext }% - {\dosingletexts{\??tk#1}\v!text\c!style\c!color\c!width{#2}}% + \letvalue{\??tk#1\v!text\c!lefttext }\empty + \letvalue{\??tk#1\v!text\c!righttext }\empty + \setvalue{\??tk#1\v!text\c!middletext}{\dosingletexts{#1}\v!text\c!style\c!color\c!width{#2}}% \else - \dosixtupleempty\dosetuptexts[#1][\v!text][][][][]% + \dosixtupleempty\dosetuptexts[#1][\v!text ][][][][]% \dosixtupleempty\dosetuptexts[#1][\v!margin][][][][]% - \dosixtupleempty\dosetuptexts[#1][\v!edge ][][][][]% + \dosixtupleempty\dosetuptexts[#1][\v!edge ][][][][]% \fi\fi\fi\fi\fi} %D Left and right texts are swapped on odd and even pages, but %D only when double sided typesetting is enabled. -\def\dodoubletexts#1#2#3#4#5#6% - {\doifoddpageelse - {\dosingletexts{#1}{#2}#3{#4}} % #3 => provides three arguments - {\dosingletexts{#1}{#2}#5{#6}}} % #5 => provides three arguments +\def\dodoubletexts{\doifoddpageelse\dodoubletextsodd\dodoubletextseven} -%D The next macro will be cleaned up amd made less messy and +\def\dodoubletextsodd #1#2#3#4#5#6{\dosingletexts{#1}{#2}#3{#4}} % #3 => provides three arguments +\def\dodoubletextseven#1#2#3#4#5#6{\dosingletexts{#1}{#2}#5{#6}} % #5 => provides three arguments + +%D The next macro will be cleaned up and made less messy and %D dependent. \def\placetextlinestrut#1% {\doifvalue{#1\c!strut}\v!yes{\setstrut\strut}} -% \def\dosingletexts#1#2#3#4#5#6% -% {\bgroup -% \defconvertedargument\ascii{#6}% -% \doifsomething\ascii -% {\doattributes{#1#2}#3#4% -% {\placetextlinestrut{#1}% here ! -% %\doifdefinedelse{\??mk\ascii\c!coupling} % brrr -% \doifelsemarking\ascii -% {\dolimitatetexts{#1#2#5}{\getmarking[\ascii][\v!first]}} -% {\ConvertConstantAfter\doifelse\v!pagenumber{#6} -% \placelocationpagenumber % pretty low level -% {\ConvertConstantAfter\doifelse\v!date{#6} -% {\currentdate} -% {% #6{}{}{} -> {} needed for macros that look -% % ahead, like \uniqueMPgraphic -% \ignorecrlf\dolimitatetexts{#1#2#5}{#6{}{}{}}}}}}}% -% \egroup} - \def\dosingletexts#1#2#3#4#5#6% {\bgroup \defconvertedargument\ascii{#6}% no longer \defconvertedargument \ifx\ascii\empty\else - \dostartattributes{#1#2}#3#4\empty - \placetextlinestrut{#1}% here ! + \dostartattributes{\??tk#1#2}#3#4\empty + \placetextlinestrut{\??tk#1}% here ! \doifelsemarking\ascii - {\dolimitatetexts{#1#2#5}{\getmarking[\ascii][\v!first]}}% + {\dolimitatetexts{\??tk#1#2#5}{\getmarking[\ascii][\v!first]}}% {\ifcsname\??tk->\ascii\endcsname \csname\??tk->\ascii\endcsname \else % #6{}{}{} -> {} needed for macros that look % ahead, like \uniqueMPgraphic - \ignorecrlf\dolimitatetexts{#1#2#5}{#6{}{}{}}% + \ignorecrlf\dolimitatetexts{\??tk#1#2#5}{#6{}{}{}}% \fi}% \dostopattributes \fi @@ -240,7 +221,7 @@ %D length. \def\dolimitatetexts#1#2% - {\doifelsevaluenothing{#1}{#2}{\limitatetext{#2}{\getvalue{#1}}{\unknown}}} + {\doifelsevaluenothing{#1}{#2}{\limitatetext{#2}{\csname#1\endcsname}{\unknown}}} %D The placement of text is hooked into the token lists %D associated to the area at hand. @@ -255,24 +236,15 @@ %D the \type {status} variable. This is handled by the next %D couple of macros. -\def\settextlinestatus #1{\edef\textlinestatus{\csname\??tk#1\c!state\endcsname}} -%def\resettextlinestatus#1{\letgvalue{\??tk#1\c!state}\v!normal} +\def\settextlinestatus#1% + {\edef\textlinestatus{\csname\??tk#1\c!state\endcsname}} \def\resettextlinestatus#1% postpone - {\setgvalue{\??tk#1\s!reset}{\letgvalue{\??tk#1\c!state}\v!normal}} + {\expandafter\gdef\csname\??tk#1\s!reset\endcsname{\global\expandafter\let\csname\??tk#1\c!state\endcsname\v!normal}} \def\placelayouttextline#1% #2 - {\settextlinestatus{#1}% - \csname\string\placelayouttextline - \ifcsname\string\placelayouttextline\textlinestatus\endcsname - \textlinestatus - \else - \s!unknown - \fi - \endcsname{#1}} % {#2} - -% \def\doifelselayouttextline#1% shown or not -% {\doifinsetelse{\getvalue{\??tk#1\c!state}}{\v!normal,\v!start}} + {\settextlinestatus#1% + \csname\??tk::\ifcsname\??tk::\textlinestatus\endcsname\textlinestatus\else\s!unknown\fi\endcsname#1} % {#2} \def\doifelselayouttextline#1% shown or not {\edef\!!stringa{\csname\??tk#1\c!state\endcsname}% @@ -298,50 +270,49 @@ \newconditional\resyncaftertextline -\setvalue{\string\placelayouttextline\v!normal }{\doplacelayouttextline} -\setvalue{\string\placelayouttextline }{\doplacelayouttextline} +% there is no need for {#1} etc since we use symbolic names -\setvalue{\string\placelayouttextline\v!none}#1#2% - {} +\setvalue{\??tk::\v!normal}{\doplacelayouttextline} +\setvalue{\??tk::\empty }{\doplacelayouttextline} -\setvalue{\string\placelayouttextline\v!high}#1#2% - {\global\settrue\resyncaftertextline - \resettextlinestatus{#1}} +\setvalue{\??tk::\v!none }#1#2{} +\setvalue{\??tk::\v!stop }#1#2{} -\setvalue{\string\placelayouttextline\v!empty}#1#2% - {\resettextlinestatus{#1}} +\setvalue{\??tk::\v!high}#1#2% + {\global\settrue\resyncaftertextline + \resettextlinestatus#1} -\setvalue{\string\placelayouttextline\v!start}#1#2% - {\resettextlinestatus{#1}% - \doplacelayouttextline{#1}{#2}} +\setvalue{\??tk::\v!empty}#1#2% + {\resettextlinestatus#1} -\setvalue{\string\placelayouttextline\v!stop}#1#2% - {} +\setvalue{\??tk::\v!start}#1#2% + {\resettextlinestatus#1% + \doplacelayouttextline#1#2} -\setvalue{\string\placelayouttextline\v!nomarking}#1#2% +\setvalue{\??tk::\v!nomarking}#1#2% {\bgroup - \resettextlinestatus{#1}% + \resettextlinestatus#1% \let\dogetmarking\nogetmarking - \doplacelayouttextline{#1}{#2}% + \doplacelayouttextline#1#2% \egroup} -\setvalue{\string\placelayouttextline\s!unknown}#1#2% +\setvalue{\??tk::\s!unknown}#1#2% {\global\settrue\resyncaftertextline \bgroup % new - \resettextlinestatus{#1}% - \getvalue{\??tk#1\textlinestatus}% - \getvalue{\??tk#1\v!text \textlinestatus}% - \getvalue{\??tk#1\v!margin\textlinestatus}% - \getvalue{\??tk#1\v!edge \textlinestatus}% - \doplacelayouttextline{#1}{#2}% + \resettextlinestatus#1% + \csname\??tk#1\textlinestatus\endcsname + \csname\??tk#1\v!text \textlinestatus\endcsname + \csname\??tk#1\v!margin\textlinestatus\endcsname + \csname\??tk#1\v!edge \textlinestatus\endcsname + \doplacelayouttextline#1#2% \egroup} %D The following macro has to be called after a page %D is flushed. \def\resetlayouttextline#1% - {\getvalue {\??tk#1\s!reset}% - \letgvalue{\??tk#1\s!reset}\relax} + {\csname\??tk#1\s!reset\endcsname + \global\expandafter\let\csname\??tk#1\s!reset\endcsname\relax} \def\resetlayouttextlines {\resetlayouttextline\v!top @@ -350,9 +321,8 @@ \resetlayouttextline\v!footer \resetlayouttextline\v!bottom \ifconditional\resyncaftertextline - \doglobal\calculatevsizes + \calculateglobalvsizes \recalculatebackgrounds - \recalculatelogos \global\setfalse\resyncaftertextline \fi} @@ -458,15 +428,9 @@ \egroup \mkprocesspagecontents{#2}% \settextpagecontent\scratchpagebox{#1}{#2}% - \setbox\scratchpagebox\vbox % can we avoid this extra box - {\startlayoutcomponent{textbody}{text body}% - \box\scratchpagebox - \stoplayoutcomponent}% \addtextbackground\scratchpagebox \addtextgridlayer\scratchpagebox - \localstarttextcolor % does not work in mkiv \box\scratchpagebox - \localstoptextcolor % so we have to change this \bgroup \hskip\rightmargindistance \ifdim\rightmarginwidth>\zeropoint @@ -486,17 +450,20 @@ %D The main text area has to be combined with some additional %D (tracing) information. -% will be overloaded in page-lyr +% will be stored as normal and overloaded in page-lyr and later in +% page-spr we overload the the stored version .. evenatually i will +% clear up the experimental mess \def\settextpagecontent#1#2#3% #2 and #3 will disappear {\setbox#1\hbox to \makeupwidth - {\hss % so don't change this - \vbox to \textheight + {\hss % so don't change this + \setlayoutcomponentattribute\v!page\v!text + \vbox \layoutcomponentboxattribute to \textheight {\offinterlineskip \freezetextwidth \hsize\textwidth % local variant of \sethsize \boxmaxdepth\maxdepth - \noindent % content can be < \hsize + \noindent % content can be < \hsize \dopagecontents#2#3}% \hss}% \dp#1\zeropoint} @@ -506,17 +473,17 @@ [grid=red, page=green] -\def\addtextgridlayer#1% tzt run time +\def\addtextgridlayer#1% to be checked for color and layer {\ifcase\showgridstate\else % 1=bottom 2=top - \setgridbox\scratchbox\makeupwidth\textheight + \startcolor[layout:grid]% + \setgridbox\scratchbox\makeupwidth\textheight % todo: check color \setbox#1\hbox {\ifcase\showgridstate\or\or\box#1\hskip-\makeupwidth\fi \bgroup % color - \startlayoutcomponent{gridcolumns}{grid columns}% - \incolortrue \ifcase\layoutcolumns\else \gray - \hbox to \makeupwidth + \setlayoutcomponentattribute\v!grid\v!columns + \hbox \layoutcomponentboxattribute to \makeupwidth {\dorecurse\layoutcolumns {\hskip\layoutcolumnwidth \ifnum\recurselevel<\layoutcolumns @@ -527,12 +494,11 @@ \fi}}% \hskip-\makeupwidth \fi - \stoplayoutcomponent - \startlayoutcomponent{gridlines}{grid lines}% - \startcolor[layout:grid]\box\scratchbox\stopcolor - \stoplayoutcomponent + \setlayoutcomponentattribute\v!grid\v!lines + \hbox \layoutcomponentboxattribute{\box\scratchbox}% \egroup \ifcase\showgridstate\or\hskip-\makeupwidth\box#1\fi}% + \stopcolor \fi} %D The placement of a whole line is handled by the next two @@ -541,89 +507,158 @@ \def\ignoredlinebreak{\unskip\space\ignorespaces} +% \def\doplacelayouttextline#1#2% +% {\ifdim#2>\zeropoint\relax % prevents pagenumbers when zero height +% \goleftonpage +% \hbox +% {\setbox\scratchpagebox\vbox to #2 +% {\vsize#2\relax +% \normalbaselines +% \let\\\ignoredlinebreak +% \let\crlf\ignoredlinebreak +% \csname\??tk#1\c!before\endcsname +% \doifbothsidesoverruled +% {\dodoplacelayouttextline#1\c!lefttext \c!middletext\c!righttext\zerocount\plusone} +% {\dodoplacelayouttextline#1\c!lefttext \c!middletext\c!righttext\zerocount\plusone} +% {\dodoplacelayouttextline#1\c!righttext\c!middletext\c!lefttext \plusone\zerocount}% +% \csname\??tk#1\c!after\endcsname +% \kern\zeropoint}% keep the \dp, beware of \vtops, never change this! +% \dp\scratchpagebox\zeropoint +% \box\scratchpagebox}% +% \vskip-#2\relax +% \fi} +% +% \def\dodoplacelayouttextline#1#2#3#4#5#6% \hsize toegevoegd, \hss's niet meer wijzigen +% {\hbox +% {\ifdim\leftedgewidth>\zeropoint +% \dododoplacelayouttextline\leftedgewidth#1\v!edge +% {\hss\csname\??tk#1\v!edge#2\endcsname}% +% \hskip\leftedgedistance +% \fi +% \ifdim\leftmarginwidth>\zeropoint +% \dododoplacelayouttextline\leftmarginwidth#1\v!margin +% {\hbox to \leftmarginwidth +% {\hss\csname\??tk#1\v!margin#2\endcsname}% +% \hskip-\leftmarginwidth +% \hbox to \leftmarginwidth +% {\hss\ifcase#5\or\csname\??tk#1\v!margin\c!margintext\endcsname\fi}}% +% \hskip\leftmargindistance +% \fi +% \ifdim\makeupwidth>\zeropoint +% \dododoplacelayouttextline\makeupwidth{#1}\v!text +% {\hbox to \makeupwidth +% {\ifcase#5\or\@@nmpre{\csname\??tk#1\v!text\c!marginedgetext\endcsname}\fi +% \csname\??tk#1\v!text#2\endcsname\hss}% +% \hskip-\makeupwidth +% \hbox to \makeupwidth +% {\hss\csname\??tk#1\v!text#3\endcsname\hss}% +% \hskip-\makeupwidth +% \hbox to \makeupwidth +% {\hss\csname\??tk#1\v!text#4\endcsname +% \ifcase#6\or\@@nmpos{\csname\??tk#1\v!text\c!marginedgetext\endcsname}\fi}}% +% \fi +% \ifdim\rightmarginwidth>\zeropoint +% \hskip\rightmargindistance +% \dododoplacelayouttextline\rightmarginwidth{#1}\v!margin +% {\hbox to \rightmarginwidth +% {\csname\??tk#1\v!margin#4\endcsname\hss}% +% \hskip-\rightmarginwidth +% \hbox to \rightmarginwidth +% {\ifcase#6\or\csname\??tk#1\v!margin\c!margintext\endcsname\fi\hss}}% +% \fi +% \ifdim\rightedgewidth>\zeropoint +% \hskip\rightedgedistance +% \dododoplacelayouttextline\rightedgewidth{#1}\v!edge +% {\csname\??tk#1\v!edge#4\endcsname\hss}% +% \fi}} +% +% \def\dododoplacelayouttextline#1#2#3#4% +% {\vbox % to \vsize +% {\hsize#1\relax +% \csname\??tk#2#3\c!before\endcsname +% \setlayoutcomponentattribute#2#3% +% \hbox \layoutcomponentboxattribute to #1{#4}% +% \csname\??tk#2#3\c!after\endcsname}} + \def\doplacelayouttextline#1#2% - {\ifdim#2>\zeropoint\relax % prevents pagenumbers when zero height - \goleftonpage - \hbox - {\setbox\scratchpagebox\vbox to #2 - {%\forgetall - \vsize#2\relax - \normalbaselines - \let\\\ignoredlinebreak - \let\crlf\ignoredlinebreak - %\getvalue{\??tk#1\v!text\c!before}% - \getvalue{\??tk#1\c!before}% - \doifbothsidesoverruled - {\dodoplacelayouttextline#1\c!lefttext \c!middletext\c!righttext\gobbleoneargument\getvalue} - {\dodoplacelayouttextline#1\c!lefttext \c!middletext\c!righttext\gobbleoneargument\getvalue} - {\dodoplacelayouttextline#1\c!righttext\c!middletext\c!lefttext \getvalue\gobbleoneargument}% - %\getvalue{\??tk#1\v!text\c!after}% - \getvalue{\??tk#1\c!after}% - \kern\zeropoint}% keep the \dp, beware of \vtops, never change this! - \dp\scratchpagebox\zeropoint - \box\scratchpagebox}% - \vskip-#2\relax + {\let\currentlayouttextline#1% + \ifdim#2>\zeropoint\relax % prevents pagenumbers when zero height + \doplacelayouttextlineindeed{#2}% \fi} -\def\dodoplacelayouttextline#1#2#3#4#5#6% \hsize toegevoegd, \hss's niet meer wijzigen +\def\doplacelayouttextlineindeed#1% + {\goleftonpage + \hbox + {\setbox\scratchpagebox\vbox to #1 + {\vsize#1\relax + \normalbaselines + \let\\\ignoredlinebreak + \let\crlf\ignoredlinebreak + \csname\??tk\currentlayouttextline\c!before\endcsname + \doifbothsidesoverruled\dodoplacelayouttextlineright\dodoplacelayouttextlineright\dodoplacelayouttextlineleft + \csname\??tk\currentlayouttextline\c!after\endcsname + \kern\zeropoint}% keep the \dp, beware of \vtops, never change this! + \dp\scratchpagebox\zeropoint + \box\scratchpagebox}% + \vskip-#1\relax} + +\def\dodoplacelayouttextlineright{\dodoplacelayouttextline\c!lefttext \c!middletext\c!righttext\zerocount\plusone} +\def\dodoplacelayouttextlineleft {\dodoplacelayouttextline\c!righttext\c!middletext\c!lefttext \plusone\zerocount} + +\def\dodoplacelayouttextline#1#2#3#4#5% \hsize toegevoegd, \hss's niet meer wijzigen {\hbox {\ifdim\leftedgewidth>\zeropoint - \dododoplacelayouttextline\leftedgewidth{#1}\v!edge - {\hss\getvalue{\??tk#1\v!edge#2}}% + \dododoplacelayouttextline\leftedgewidth\currentlayouttextline\v!edge{\thelayoutleftedgeline#1}% \hskip\leftedgedistance \fi \ifdim\leftmarginwidth>\zeropoint - \dododoplacelayouttextline\leftmarginwidth{#1}\v!margin - {\hbox to \leftmarginwidth - {\hss\getvalue{\??tk#1\v!margin#2}}% - \hskip-\leftmarginwidth - \hbox to \leftmarginwidth - {\hss#5{\??tk#1\v!margin\c!margintext}}}% + \dododoplacelayouttextline\leftmarginwidth\currentlayouttextline\v!margin{\thelayoutleftmarginline#1#4}% \hskip\leftmargindistance \fi \ifdim\makeupwidth>\zeropoint - \dododoplacelayouttextline\makeupwidth{#1}\v!text - {\hbox to \makeupwidth - {\@@nmpre{#5{\??tk#1\v!text\c!marginedgetext}}% - \getvalue{\??tk#1\v!text#2}\hss}% - \hskip-\makeupwidth - \hbox to \makeupwidth - {\hss\getvalue{\??tk#1\v!text#3}\hss}% - \hskip-\makeupwidth - \hbox to \makeupwidth - {\hss\getvalue{\??tk#1\v!text#4}% - \@@nmpos{#6{\??tk#1\v!text\c!marginedgetext}}}}% + \dododoplacelayouttextline\makeupwidth\currentlayouttextline\v!text{\thelayouttextline#1#2#3#4#5}% \fi \ifdim\rightmarginwidth>\zeropoint \hskip\rightmargindistance - \dododoplacelayouttextline\rightmarginwidth{#1}\v!margin - {\hbox to \rightmarginwidth - {\getvalue{\??tk#1\v!margin#4}\hss}% - \hskip-\rightmarginwidth - \hbox to \rightmarginwidth - {#6{\??tk#1\v!margin\c!margintext}\hss}}% + \dododoplacelayouttextline\rightmarginwidth\currentlayouttextline\v!margin{\thelayoutrightmarginline#3#5}% \fi \ifdim\rightedgewidth>\zeropoint \hskip\rightedgedistance - \dododoplacelayouttextline\rightedgewidth{#1}\v!edge - {\getvalue{\??tk#1\v!edge#4}\hss}% + \dododoplacelayouttextline\rightedgewidth\currentlayouttextline\v!edge{\thelayoutrightedgeline#1}% \fi}} -% \def\dododoplacelayouttextline#1#2#3#4% -% {\vbox % to \vsize -% {\hsize#1\relax -% \getvalue{\??tk#2#3\c!voor} -% \hbox to #1{#4}% -% \getvalue{\??tk#2#3\c!na}}} +\def\thelayoutleftedgeline#1% + {\hss\csname\??tk\currentlayouttextline\v!edge#1\endcsname}% + +\def\thelayoutrightedgeline#1% + {\csname\??tk\currentlayouttextline\v!edge#1\endcsname\hss} + +\def\thelayoutleftmarginline#1#2% + {\hbox to \leftmarginwidth{\hss\csname\??tk\currentlayouttextline\v!margin#1\endcsname}% + \hskip-\leftmarginwidth + \hbox to \leftmarginwidth{\hss\ifcase#2\or\csname\??tk\currentlayouttextline\v!margin\c!margintext\endcsname\fi}} + +\def\thelayoutrightmarginline#1#2% + {\hbox to \rightmarginwidth{\csname\??tk\currentlayouttextline\v!margin#1\endcsname\hss}% + \hskip-\rightmarginwidth + \hbox to \rightmarginwidth{\ifcase#2\or\csname\??tk\currentlayouttextline\v!margin\c!margintext\endcsname\fi\hss}} + +\def\thelayoutedgetextline{\csname\??tk\currentlayouttextline\v!text\c!marginedgetext\endcsname} + +\def\thelayouttextline#1#2#3#4#5% + {\hbox to \makeupwidth{\ifcase#4\or\@@nmpre\thelayoutedgetextline\fi\csname\??tk\currentlayouttextline\v!text#1\endcsname\hss}% + \hskip-\makeupwidth + \hbox to \makeupwidth{\hss\csname\??tk\currentlayouttextline\v!text#2\endcsname\hss}% + \hskip-\makeupwidth + \hbox to \makeupwidth{\hss\csname\??tk\currentlayouttextline\v!text#3\endcsname\ifcase#5\or\@@nmpos\thelayoutedgetextline\fi}} \def\dododoplacelayouttextline#1#2#3#4% {\vbox % to \vsize {\hsize#1\relax - \getvalue{\??tk#2#3\c!before}% - \startlayoutcomponent{t:#2:#3}{area #2 #3}% - \hbox to #1{#4}% - \stoplayoutcomponent - \getvalue{\??tk#2#3\c!after}}} + \csname\??tk#2#3\c!before\endcsname + \setlayoutcomponentattribute#2#3% + \hbox \layoutcomponentboxattribute to #1{#4}% + \csname\??tk#2#3\c!after\endcsname}} %D Although it is far better to use backgrounds for this %D purpose, one can add a rule in the following way. This @@ -649,19 +684,41 @@ % \def\@@nmpos#1{\setbox0\hbox{#1}\ifdim\wd0=\zeropoint\else\tfskip\unhbox0\fi} % cleaner - -\def\@@nmpre#1{\doiftext{#1}{{#1}\tfskip}} -\def\@@nmpos#1{\doiftext{#1}{\tfskip{#1}}} - +% +% \def\@@nmpre#1{\doiftext{#1}{{#1}\tfskip}} +% \def\@@nmpos#1{\doiftext{#1}{\tfskip{#1}}} +% % newer - -\def\@@nmprepos#1#2#3#4#5% - {\doifelsenothing\@@nmwidth - {\doiftext{#5}{#1{#5}#2}} - {\doiftext{#5}{\hbox to \@@nmwidth{#3{#5}#4}}}} - -\def\@@nmpre{\@@nmprepos\empty\tfskip\relax\hss} -\def\@@nmpos{\@@nmprepos\tfskip\empty\hss\relax} +% +% \def\@@nmprepos#1#2#3#4#5% +% {\doifelsenothing\@@nmwidth +% {\doiftext{#5}{#1{#5}#2}} +% {\doiftext{#5}{\hbox to \@@nmwidth{#3{#5}#4}}}} +% +% \def\@@nmpre{\@@nmprepos\empty\tfskip\relax\hss} +% \def\@@nmpos{\@@nmprepos\tfskip\empty\hss\relax} +% +% faster + +\def\@@nmpre#1% + {\begingroup + \setbox\scratchbox\normalhbox{\trialtypesettingtrue\ignorespaces#1\removeunwantedspaces}% + \ifzeropt\wd\scratchbox\else + \doifelsenothing\@@nmwidth + {\box\scratchbox\tfskip} + {\hbox to \@@nmwidth{\box\scratchbox\hss}}% + \fi + \endgroup} + +\def\@@nmpos#1% + {\begingroup + \setbox\scratchbox\normalhbox{\trialtypesettingtrue\ignorespaces#1\removeunwantedspaces}% + \ifzeropt\wd\scratchbox\else + \doifelsenothing\@@nmwidth + {\tfskip\box\scratchbox} + {\hbox to \@@nmwidth{\hss\box\scratchbox}}% + \fi + \endgroup} %D This code will move to \type {page-flt.tex}. @@ -768,21 +825,21 @@ {\getparameters [\??tk#1#2] [%\c!state=\v!normal, % moved - \c!before=, % both global and local are used - \c!after=, % both global and local are used - \c!strut=, % the local one, not (yet) used - \c!style=\getvalue{\??tk#1\c!style},% hm, got lost - \c!color=\getvalue{\??tk#1\c!color}, % hm, got lost + \c!before=,% both global and local are used + \c!after=,% both global and local are used + \c!strut=,% the local one, not (yet) used + \c!style=\csname\??tk#1\c!style\endcsname,% hm, got lost + \c!color=\csname\??tk#1\c!color\endcsname,% hm, got lost \c!lefttext=, \c!middletext=, \c!righttext=, \c!marginedgetext=, \c!margintext=, \c!width=]% - \inheritparameter[\??tk#1#2][\c!leftstyle ][\c!style ]% - \inheritparameter[\??tk#1#2][\c!rightstyle ][\c!style ]% - \inheritparameter[\??tk#1#2][\c!leftcolor ][\c!color ]% - \inheritparameter[\??tk#1#2][\c!rightcolor ][\c!color ]% + \inheritparameter[\??tk#1#2][\c!leftstyle ][\c!style ]% + \inheritparameter[\??tk#1#2][\c!rightstyle][\c!style ]% + \inheritparameter[\??tk#1#2][\c!leftcolor ][\c!color ]% + \inheritparameter[\??tk#1#2][\c!rightcolor][\c!color ]% \inheritparameter[\??tk#1#2][\c!leftwidth ][\c!width]% \inheritparameter[\??tk#1#2][\c!rightwidth][\c!width]} diff --git a/tex/context/base/pdfr-def.mkii b/tex/context/base/pdfr-def.mkii new file mode 100644 index 000000000..7554bda9e --- /dev/null +++ b/tex/context/base/pdfr-def.mkii @@ -0,0 +1,843 @@ +% filename : pdfr-def.tex +% comment : generated by mtxrun --script chars --pdf +% author : Hans Hagen, PRAGMA-ADE, Hasselt NL +% copyright: PRAGMA ADE / ConTeXt Development Team +% license : see context related readme files +% +\pdfglyphtounicode{space}{0020}% +\pdfglyphtounicode{exclam}{0021}% +\pdfglyphtounicode{quotedbl}{0022}% +\pdfglyphtounicode{numbersign}{0023}% +\pdfglyphtounicode{dollar}{0024}% +\pdfglyphtounicode{percent}{0025}% +\pdfglyphtounicode{ampersand}{0026}% +\pdfglyphtounicode{quotesingle}{0027}% +\pdfglyphtounicode{parenleft}{0028}% +\pdfglyphtounicode{parenright}{0029}% +\pdfglyphtounicode{asterisk}{002A}% +\pdfglyphtounicode{plus}{002B}% +\pdfglyphtounicode{comma}{002C}% +\pdfglyphtounicode{hyphen}{002D}% +\pdfglyphtounicode{period}{002E}% +\pdfglyphtounicode{slash}{002F}% +\pdfglyphtounicode{zero}{0030}% +\pdfglyphtounicode{one}{0031}% +\pdfglyphtounicode{two}{0032}% +\pdfglyphtounicode{three}{0033}% +\pdfglyphtounicode{four}{0034}% +\pdfglyphtounicode{five}{0035}% +\pdfglyphtounicode{six}{0036}% +\pdfglyphtounicode{seven}{0037}% +\pdfglyphtounicode{eight}{0038}% +\pdfglyphtounicode{nine}{0039}% +\pdfglyphtounicode{colon}{003A}% +\pdfglyphtounicode{semicolon}{003B}% +\pdfglyphtounicode{less}{003C}% +\pdfglyphtounicode{equal}{003D}% +\pdfglyphtounicode{greater}{003E}% +\pdfglyphtounicode{question}{003F}% +\pdfglyphtounicode{at}{0040}% +\pdfglyphtounicode{A}{0041}% +\pdfglyphtounicode{B}{0042}% +\pdfglyphtounicode{C}{0043}% +\pdfglyphtounicode{D}{0044}% +\pdfglyphtounicode{E}{0045}% +\pdfglyphtounicode{F}{0046}% +\pdfglyphtounicode{G}{0047}% +\pdfglyphtounicode{H}{0048}% +\pdfglyphtounicode{I}{0049}% +\pdfglyphtounicode{J}{004A}% +\pdfglyphtounicode{K}{004B}% +\pdfglyphtounicode{L}{004C}% +\pdfglyphtounicode{M}{004D}% +\pdfglyphtounicode{N}{004E}% +\pdfglyphtounicode{O}{004F}% +\pdfglyphtounicode{P}{0050}% +\pdfglyphtounicode{Q}{0051}% +\pdfglyphtounicode{R}{0052}% +\pdfglyphtounicode{S}{0053}% +\pdfglyphtounicode{T}{0054}% +\pdfglyphtounicode{U}{0055}% +\pdfglyphtounicode{V}{0056}% +\pdfglyphtounicode{W}{0057}% +\pdfglyphtounicode{X}{0058}% +\pdfglyphtounicode{Y}{0059}% +\pdfglyphtounicode{Z}{005A}% +\pdfglyphtounicode{bracketleft}{005B}% +\pdfglyphtounicode{backslash}{005C}% +\pdfglyphtounicode{bracketright}{005D}% +\pdfglyphtounicode{asciicircum}{005E}% +\pdfglyphtounicode{underscore}{005F}% +\pdfglyphtounicode{grave}{0060}% +\pdfglyphtounicode{a}{0061}% +\pdfglyphtounicode{b}{0062}% +\pdfglyphtounicode{c}{0063}% +\pdfglyphtounicode{d}{0064}% +\pdfglyphtounicode{e}{0065}% +\pdfglyphtounicode{f}{0066}% +\pdfglyphtounicode{g}{0067}% +\pdfglyphtounicode{h}{0068}% +\pdfglyphtounicode{i}{0069}% +\pdfglyphtounicode{j}{006A}% +\pdfglyphtounicode{k}{006B}% +\pdfglyphtounicode{l}{006C}% +\pdfglyphtounicode{m}{006D}% +\pdfglyphtounicode{n}{006E}% +\pdfglyphtounicode{o}{006F}% +\pdfglyphtounicode{p}{0070}% +\pdfglyphtounicode{q}{0071}% +\pdfglyphtounicode{r}{0072}% +\pdfglyphtounicode{s}{0073}% +\pdfglyphtounicode{t}{0074}% +\pdfglyphtounicode{u}{0075}% +\pdfglyphtounicode{v}{0076}% +\pdfglyphtounicode{w}{0077}% +\pdfglyphtounicode{x}{0078}% +\pdfglyphtounicode{y}{0079}% +\pdfglyphtounicode{z}{007A}% +\pdfglyphtounicode{braceleft}{007B}% +\pdfglyphtounicode{bar}{007C}% +\pdfglyphtounicode{braceright}{007D}% +\pdfglyphtounicode{asciitilde}{007E}% +\pdfglyphtounicode{exclamdown}{00A1}% +\pdfglyphtounicode{cent}{00A2}% +\pdfglyphtounicode{sterling}{00A3}% +\pdfglyphtounicode{currency}{00A4}% +\pdfglyphtounicode{yen}{00A5}% +\pdfglyphtounicode{brokenbar}{00A6}% +\pdfglyphtounicode{section}{00A7}% +\pdfglyphtounicode{dieresis}{00A8}% +\pdfglyphtounicode{copyright}{00A9}% +\pdfglyphtounicode{ordfeminine}{00AA}% +\pdfglyphtounicode{guillemotleft}{00AB}% +\pdfglyphtounicode{logicalnot}{00AC}% +\pdfglyphtounicode{registered}{00AE}% +\pdfglyphtounicode{macron}{00AF}% +\pdfglyphtounicode{degree}{00B0}% +\pdfglyphtounicode{plusminus}{00B1}% +\pdfglyphtounicode{acute}{00B4}% +\pdfglyphtounicode{mu}{00B5}% +\pdfglyphtounicode{paragraph}{00B6}% +\pdfglyphtounicode{periodcentered}{00B7}% +\pdfglyphtounicode{cedilla}{00B8}% +\pdfglyphtounicode{ordmasculine}{00BA}% +\pdfglyphtounicode{guillemotright}{00BB}% +\pdfglyphtounicode{onequarter}{00BC}% +\pdfglyphtounicode{onehalf}{00BD}% +\pdfglyphtounicode{threequarters}{00BE}% +\pdfglyphtounicode{questiondown}{00BF}% +\pdfglyphtounicode{Agrave}{00C0}% +\pdfglyphtounicode{Aacute}{00C1}% +\pdfglyphtounicode{Acircumflex}{00C2}% +\pdfglyphtounicode{Atilde}{00C3}% +\pdfglyphtounicode{Adieresis}{00C4}% +\pdfglyphtounicode{Aring}{00C5}% +\pdfglyphtounicode{AE}{00C6}% +\pdfglyphtounicode{Ccedilla}{00C7}% +\pdfglyphtounicode{Egrave}{00C8}% +\pdfglyphtounicode{Eacute}{00C9}% +\pdfglyphtounicode{Ecircumflex}{00CA}% +\pdfglyphtounicode{Edieresis}{00CB}% +\pdfglyphtounicode{Igrave}{00CC}% +\pdfglyphtounicode{Iacute}{00CD}% +\pdfglyphtounicode{Icircumflex}{00CE}% +\pdfglyphtounicode{Idieresis}{00CF}% +\pdfglyphtounicode{Eth}{00D0}% +\pdfglyphtounicode{Ntilde}{00D1}% +\pdfglyphtounicode{Ograve}{00D2}% +\pdfglyphtounicode{Oacute}{00D3}% +\pdfglyphtounicode{Ocircumflex}{00D4}% +\pdfglyphtounicode{Otilde}{00D5}% +\pdfglyphtounicode{Odieresis}{00D6}% +\pdfglyphtounicode{multiply}{00D7}% +\pdfglyphtounicode{Oslash}{00D8}% +\pdfglyphtounicode{Ugrave}{00D9}% +\pdfglyphtounicode{Uacute}{00DA}% +\pdfglyphtounicode{Ucircumflex}{00DB}% +\pdfglyphtounicode{Udieresis}{00DC}% +\pdfglyphtounicode{Yacute}{00DD}% +\pdfglyphtounicode{Thorn}{00DE}% +\pdfglyphtounicode{germandbls}{00DF}% +\pdfglyphtounicode{agrave}{00E0}% +\pdfglyphtounicode{aacute}{00E1}% +\pdfglyphtounicode{acircumflex}{00E2}% +\pdfglyphtounicode{atilde}{00E3}% +\pdfglyphtounicode{adieresis}{00E4}% +\pdfglyphtounicode{aring}{00E5}% +\pdfglyphtounicode{ae}{00E6}% +\pdfglyphtounicode{ccedilla}{00E7}% +\pdfglyphtounicode{egrave}{00E8}% +\pdfglyphtounicode{eacute}{00E9}% +\pdfglyphtounicode{ecircumflex}{00EA}% +\pdfglyphtounicode{edieresis}{00EB}% +\pdfglyphtounicode{igrave}{00EC}% +\pdfglyphtounicode{iacute}{00ED}% +\pdfglyphtounicode{icircumflex}{00EE}% +\pdfglyphtounicode{idieresis}{00EF}% +\pdfglyphtounicode{eth}{00F0}% +\pdfglyphtounicode{ntilde}{00F1}% +\pdfglyphtounicode{ograve}{00F2}% +\pdfglyphtounicode{oacute}{00F3}% +\pdfglyphtounicode{ocircumflex}{00F4}% +\pdfglyphtounicode{otilde}{00F5}% +\pdfglyphtounicode{odieresis}{00F6}% +\pdfglyphtounicode{divide}{00F7}% +\pdfglyphtounicode{oslash}{00F8}% +\pdfglyphtounicode{ugrave}{00F9}% +\pdfglyphtounicode{uacute}{00FA}% +\pdfglyphtounicode{ucircumflex}{00FB}% +\pdfglyphtounicode{udieresis}{00FC}% +\pdfglyphtounicode{yacute}{00FD}% +\pdfglyphtounicode{thorn}{00FE}% +\pdfglyphtounicode{ydieresis}{00FF}% +\pdfglyphtounicode{Amacron}{0100}% +\pdfglyphtounicode{amacron}{0101}% +\pdfglyphtounicode{Abreve}{0102}% +\pdfglyphtounicode{abreve}{0103}% +\pdfglyphtounicode{Aogonek}{0104}% +\pdfglyphtounicode{aogonek}{0105}% +\pdfglyphtounicode{Cacute}{0106}% +\pdfglyphtounicode{cacute}{0107}% +\pdfglyphtounicode{Ccircumflex}{0108}% +\pdfglyphtounicode{ccircumflex}{0109}% +\pdfglyphtounicode{Cdotaccent}{010A}% +\pdfglyphtounicode{cdotaccent}{010B}% +\pdfglyphtounicode{Ccaron}{010C}% +\pdfglyphtounicode{ccaron}{010D}% +\pdfglyphtounicode{Dcaron}{010E}% +\pdfglyphtounicode{dcaron}{010F}% +\pdfglyphtounicode{Dcroat}{0110}% +\pdfglyphtounicode{dcroat}{0111}% +\pdfglyphtounicode{Emacron}{0112}% +\pdfglyphtounicode{emacron}{0113}% +\pdfglyphtounicode{Ebreve}{0114}% +\pdfglyphtounicode{ebreve}{0115}% +\pdfglyphtounicode{Edotaccent}{0116}% +\pdfglyphtounicode{edotaccent}{0117}% +\pdfglyphtounicode{Eogonek}{0118}% +\pdfglyphtounicode{eogonek}{0119}% +\pdfglyphtounicode{Ecaron}{011A}% +\pdfglyphtounicode{ecaron}{011B}% +\pdfglyphtounicode{Gcircumflex}{011C}% +\pdfglyphtounicode{gcircumflex}{011D}% +\pdfglyphtounicode{Gbreve}{011E}% +\pdfglyphtounicode{gbreve}{011F}% +\pdfglyphtounicode{Gdotaccent}{0120}% +\pdfglyphtounicode{gdotaccent}{0121}% +\pdfglyphtounicode{Gcommaaccent}{0122}% +\pdfglyphtounicode{gcommaaccent}{0123}% +\pdfglyphtounicode{Hcircumflex}{0124}% +\pdfglyphtounicode{hcircumflex}{0125}% +\pdfglyphtounicode{Hbar}{0126}% +\pdfglyphtounicode{hbar}{0127}% +\pdfglyphtounicode{Itilde}{0128}% +\pdfglyphtounicode{itilde}{0129}% +\pdfglyphtounicode{Imacron}{012A}% +\pdfglyphtounicode{imacron}{012B}% +\pdfglyphtounicode{Ibreve}{012C}% +\pdfglyphtounicode{ibreve}{012D}% +\pdfglyphtounicode{Iogonek}{012E}% +\pdfglyphtounicode{iogonek}{012F}% +\pdfglyphtounicode{Idotaccent}{0130}% +\pdfglyphtounicode{dotlessi}{0131}% +\pdfglyphtounicode{IJ}{0132}% +\pdfglyphtounicode{ij}{0133}% +\pdfglyphtounicode{Jcircumflex}{0134}% +\pdfglyphtounicode{jcircumflex}{0135}% +\pdfglyphtounicode{Kcommaaccent}{0136}% +\pdfglyphtounicode{kcommaaccent}{0137}% +\pdfglyphtounicode{kgreenlandic}{0138}% +\pdfglyphtounicode{Lacute}{0139}% +\pdfglyphtounicode{lacute}{013A}% +\pdfglyphtounicode{Lcommaaccent}{013B}% +\pdfglyphtounicode{lcommaaccent}{013C}% +\pdfglyphtounicode{Lcaron}{013D}% +\pdfglyphtounicode{lcaron}{013E}% +\pdfglyphtounicode{Ldot}{013F}% +\pdfglyphtounicode{ldot}{0140}% +\pdfglyphtounicode{Lslash}{0141}% +\pdfglyphtounicode{lslash}{0142}% +\pdfglyphtounicode{Nacute}{0143}% +\pdfglyphtounicode{nacute}{0144}% +\pdfglyphtounicode{Ncommaaccent}{0145}% +\pdfglyphtounicode{ncommaaccent}{0146}% +\pdfglyphtounicode{Ncaron}{0147}% +\pdfglyphtounicode{ncaron}{0148}% +\pdfglyphtounicode{napostrophe}{0149}% +\pdfglyphtounicode{Eng}{014A}% +\pdfglyphtounicode{eng}{014B}% +\pdfglyphtounicode{Omacron}{014C}% +\pdfglyphtounicode{omacron}{014D}% +\pdfglyphtounicode{Obreve}{014E}% +\pdfglyphtounicode{obreve}{014F}% +\pdfglyphtounicode{Ohungarumlaut}{0150}% +\pdfglyphtounicode{ohungarumlaut}{0151}% +\pdfglyphtounicode{OE}{0152}% +\pdfglyphtounicode{oe}{0153}% +\pdfglyphtounicode{Racute}{0154}% +\pdfglyphtounicode{racute}{0155}% +\pdfglyphtounicode{Rcommaaccent}{0156}% +\pdfglyphtounicode{rcommaaccent}{0157}% +\pdfglyphtounicode{Rcaron}{0158}% +\pdfglyphtounicode{rcaron}{0159}% +\pdfglyphtounicode{Sacute}{015A}% +\pdfglyphtounicode{sacute}{015B}% +\pdfglyphtounicode{Scircumflex}{015C}% +\pdfglyphtounicode{scircumflex}{015D}% +\pdfglyphtounicode{Scedilla}{015E}% +\pdfglyphtounicode{scedilla}{015F}% +\pdfglyphtounicode{Scaron}{0160}% +\pdfglyphtounicode{scaron}{0161}% +\pdfglyphtounicode{Tcommaaccent}{0162}% +\pdfglyphtounicode{tcommaaccent}{0163}% +\pdfglyphtounicode{Tcaron}{0164}% +\pdfglyphtounicode{tcaron}{0165}% +\pdfglyphtounicode{Tbar}{0166}% +\pdfglyphtounicode{tbar}{0167}% +\pdfglyphtounicode{Utilde}{0168}% +\pdfglyphtounicode{utilde}{0169}% +\pdfglyphtounicode{Umacron}{016A}% +\pdfglyphtounicode{umacron}{016B}% +\pdfglyphtounicode{Ubreve}{016C}% +\pdfglyphtounicode{ubreve}{016D}% +\pdfglyphtounicode{Uring}{016E}% +\pdfglyphtounicode{uring}{016F}% +\pdfglyphtounicode{Uhungarumlaut}{0170}% +\pdfglyphtounicode{uhungarumlaut}{0171}% +\pdfglyphtounicode{Uogonek}{0172}% +\pdfglyphtounicode{uogonek}{0173}% +\pdfglyphtounicode{Wcircumflex}{0174}% +\pdfglyphtounicode{wcircumflex}{0175}% +\pdfglyphtounicode{Ycircumflex}{0176}% +\pdfglyphtounicode{ycircumflex}{0177}% +\pdfglyphtounicode{Ydieresis}{0178}% +\pdfglyphtounicode{Zacute}{0179}% +\pdfglyphtounicode{zacute}{017A}% +\pdfglyphtounicode{Zdotaccent}{017B}% +\pdfglyphtounicode{zdotaccent}{017C}% +\pdfglyphtounicode{Zcaron}{017D}% +\pdfglyphtounicode{zcaron}{017E}% +\pdfglyphtounicode{longs}{017F}% +\pdfglyphtounicode{florin}{0192}% +\pdfglyphtounicode{Ohorn}{01A0}% +\pdfglyphtounicode{ohorn}{01A1}% +\pdfglyphtounicode{Uhorn}{01AF}% +\pdfglyphtounicode{uhorn}{01B0}% +\pdfglyphtounicode{Gcaron}{01E6}% +\pdfglyphtounicode{gcaron}{01E7}% +\pdfglyphtounicode{Aringacute}{01FA}% +\pdfglyphtounicode{aringacute}{01FB}% +\pdfglyphtounicode{AEacute}{01FC}% +\pdfglyphtounicode{aeacute}{01FD}% +\pdfglyphtounicode{Oslashacute}{01FE}% +\pdfglyphtounicode{oslashacute}{01FF}% +\pdfglyphtounicode{Scommaaccent}{0218}% +\pdfglyphtounicode{scommaaccent}{0219}% +\pdfglyphtounicode{afii57929}{02BC}% +\pdfglyphtounicode{afii64937}{02BD}% +\pdfglyphtounicode{circumflex}{02C6}% +\pdfglyphtounicode{caron}{02C7}% +\pdfglyphtounicode{breve}{02D8}% +\pdfglyphtounicode{dotaccent}{02D9}% +\pdfglyphtounicode{ring}{02DA}% +\pdfglyphtounicode{ogonek}{02DB}% +\pdfglyphtounicode{tilde}{02DC}% +\pdfglyphtounicode{hungarumlaut}{02DD}% +\pdfglyphtounicode{gravecomb}{0300}% +\pdfglyphtounicode{acutecomb}{0301}% +\pdfglyphtounicode{tildecomb}{0303}% +\pdfglyphtounicode{hookabovecomb}{0309}% +\pdfglyphtounicode{dotbelowcomb}{0323}% +\pdfglyphtounicode{tonos}{0384}% +\pdfglyphtounicode{dieresistonos}{0385}% +\pdfglyphtounicode{Alphatonos}{0386}% +\pdfglyphtounicode{anoteleia}{0387}% +\pdfglyphtounicode{Epsilontonos}{0388}% +\pdfglyphtounicode{Etatonos}{0389}% +\pdfglyphtounicode{Iotatonos}{038A}% +\pdfglyphtounicode{Omicrontonos}{038C}% +\pdfglyphtounicode{Upsilontonos}{038E}% +\pdfglyphtounicode{Omegatonos}{038F}% +\pdfglyphtounicode{iotadieresistonos}{0390}% +\pdfglyphtounicode{Alpha}{0391}% +\pdfglyphtounicode{Beta}{0392}% +\pdfglyphtounicode{Gamma}{0393}% +\pdfglyphtounicode{Epsilon}{0395}% +\pdfglyphtounicode{Zeta}{0396}% +\pdfglyphtounicode{Eta}{0397}% +\pdfglyphtounicode{Theta}{0398}% +\pdfglyphtounicode{Iota}{0399}% +\pdfglyphtounicode{Kappa}{039A}% +\pdfglyphtounicode{Lambda}{039B}% +\pdfglyphtounicode{Mu}{039C}% +\pdfglyphtounicode{Nu}{039D}% +\pdfglyphtounicode{Xi}{039E}% +\pdfglyphtounicode{Omicron}{039F}% +\pdfglyphtounicode{Pi}{03A0}% +\pdfglyphtounicode{Rho}{03A1}% +\pdfglyphtounicode{Sigma}{03A3}% +\pdfglyphtounicode{Tau}{03A4}% +\pdfglyphtounicode{Upsilon}{03A5}% +\pdfglyphtounicode{Phi}{03A6}% +\pdfglyphtounicode{Chi}{03A7}% +\pdfglyphtounicode{Psi}{03A8}% +\pdfglyphtounicode{Iotadieresis}{03AA}% +\pdfglyphtounicode{Upsilondieresis}{03AB}% +\pdfglyphtounicode{alphatonos}{03AC}% +\pdfglyphtounicode{epsilontonos}{03AD}% +\pdfglyphtounicode{etatonos}{03AE}% +\pdfglyphtounicode{iotatonos}{03AF}% +\pdfglyphtounicode{upsilondieresistonos}{03B0}% +\pdfglyphtounicode{alpha}{03B1}% +\pdfglyphtounicode{beta}{03B2}% +\pdfglyphtounicode{gamma}{03B3}% +\pdfglyphtounicode{delta}{03B4}% +\pdfglyphtounicode{epsilon}{03B5}% +\pdfglyphtounicode{zeta}{03B6}% +\pdfglyphtounicode{eta}{03B7}% +\pdfglyphtounicode{theta}{03B8}% +\pdfglyphtounicode{iota}{03B9}% +\pdfglyphtounicode{kappa}{03BA}% +\pdfglyphtounicode{lambda}{03BB}% +\pdfglyphtounicode{nu}{03BD}% +\pdfglyphtounicode{xi}{03BE}% +\pdfglyphtounicode{omicron}{03BF}% +\pdfglyphtounicode{pi}{03C0}% +\pdfglyphtounicode{rho}{03C1}% +\pdfglyphtounicode{sigma1}{03C2}% +\pdfglyphtounicode{sigma}{03C3}% +\pdfglyphtounicode{tau}{03C4}% +\pdfglyphtounicode{upsilon}{03C5}% +\pdfglyphtounicode{phi}{03C6}% +\pdfglyphtounicode{chi}{03C7}% +\pdfglyphtounicode{psi}{03C8}% +\pdfglyphtounicode{omega}{03C9}% +\pdfglyphtounicode{iotadieresis}{03CA}% +\pdfglyphtounicode{upsilondieresis}{03CB}% +\pdfglyphtounicode{omicrontonos}{03CC}% +\pdfglyphtounicode{upsilontonos}{03CD}% +\pdfglyphtounicode{omegatonos}{03CE}% +\pdfglyphtounicode{theta1}{03D1}% +\pdfglyphtounicode{Upsilon1}{03D2}% +\pdfglyphtounicode{phi1}{03D5}% +\pdfglyphtounicode{omega1}{03D6}% +\pdfglyphtounicode{afii10023}{0401}% +\pdfglyphtounicode{afii10051}{0402}% +\pdfglyphtounicode{afii10052}{0403}% +\pdfglyphtounicode{afii10053}{0404}% +\pdfglyphtounicode{afii10054}{0405}% +\pdfglyphtounicode{afii10055}{0406}% +\pdfglyphtounicode{afii10056}{0407}% +\pdfglyphtounicode{afii10057}{0408}% +\pdfglyphtounicode{afii10058}{0409}% +\pdfglyphtounicode{afii10059}{040A}% +\pdfglyphtounicode{afii10060}{040B}% +\pdfglyphtounicode{afii10061}{040C}% +\pdfglyphtounicode{afii10062}{040E}% +\pdfglyphtounicode{afii10145}{040F}% +\pdfglyphtounicode{afii10017}{0410}% +\pdfglyphtounicode{afii10018}{0411}% +\pdfglyphtounicode{afii10019}{0412}% +\pdfglyphtounicode{afii10020}{0413}% +\pdfglyphtounicode{afii10021}{0414}% +\pdfglyphtounicode{afii10022}{0415}% +\pdfglyphtounicode{afii10024}{0416}% +\pdfglyphtounicode{afii10025}{0417}% +\pdfglyphtounicode{afii10026}{0418}% +\pdfglyphtounicode{afii10027}{0419}% +\pdfglyphtounicode{afii10028}{041A}% +\pdfglyphtounicode{afii10029}{041B}% +\pdfglyphtounicode{afii10030}{041C}% +\pdfglyphtounicode{afii10031}{041D}% +\pdfglyphtounicode{afii10032}{041E}% +\pdfglyphtounicode{afii10033}{041F}% +\pdfglyphtounicode{afii10034}{0420}% +\pdfglyphtounicode{afii10035}{0421}% +\pdfglyphtounicode{afii10036}{0422}% +\pdfglyphtounicode{afii10037}{0423}% +\pdfglyphtounicode{afii10038}{0424}% +\pdfglyphtounicode{afii10039}{0425}% +\pdfglyphtounicode{afii10040}{0426}% +\pdfglyphtounicode{afii10041}{0427}% +\pdfglyphtounicode{afii10042}{0428}% +\pdfglyphtounicode{afii10043}{0429}% +\pdfglyphtounicode{afii10044}{042A}% +\pdfglyphtounicode{afii10045}{042B}% +\pdfglyphtounicode{afii10046}{042C}% +\pdfglyphtounicode{afii10047}{042D}% +\pdfglyphtounicode{afii10048}{042E}% +\pdfglyphtounicode{afii10049}{042F}% +\pdfglyphtounicode{afii10065}{0430}% +\pdfglyphtounicode{afii10066}{0431}% +\pdfglyphtounicode{afii10067}{0432}% +\pdfglyphtounicode{afii10068}{0433}% +\pdfglyphtounicode{afii10069}{0434}% +\pdfglyphtounicode{afii10070}{0435}% +\pdfglyphtounicode{afii10072}{0436}% +\pdfglyphtounicode{afii10073}{0437}% +\pdfglyphtounicode{afii10074}{0438}% +\pdfglyphtounicode{afii10075}{0439}% +\pdfglyphtounicode{afii10076}{043A}% +\pdfglyphtounicode{afii10077}{043B}% +\pdfglyphtounicode{afii10078}{043C}% +\pdfglyphtounicode{afii10079}{043D}% +\pdfglyphtounicode{afii10080}{043E}% +\pdfglyphtounicode{afii10081}{043F}% +\pdfglyphtounicode{afii10082}{0440}% +\pdfglyphtounicode{afii10083}{0441}% +\pdfglyphtounicode{afii10084}{0442}% +\pdfglyphtounicode{afii10085}{0443}% +\pdfglyphtounicode{afii10086}{0444}% +\pdfglyphtounicode{afii10087}{0445}% +\pdfglyphtounicode{afii10088}{0446}% +\pdfglyphtounicode{afii10089}{0447}% +\pdfglyphtounicode{afii10090}{0448}% +\pdfglyphtounicode{afii10091}{0449}% +\pdfglyphtounicode{afii10092}{044A}% +\pdfglyphtounicode{afii10093}{044B}% +\pdfglyphtounicode{afii10094}{044C}% +\pdfglyphtounicode{afii10095}{044D}% +\pdfglyphtounicode{afii10096}{044E}% +\pdfglyphtounicode{afii10097}{044F}% +\pdfglyphtounicode{afii10071}{0451}% +\pdfglyphtounicode{afii10099}{0452}% +\pdfglyphtounicode{afii10100}{0453}% +\pdfglyphtounicode{afii10101}{0454}% +\pdfglyphtounicode{afii10102}{0455}% +\pdfglyphtounicode{afii10103}{0456}% +\pdfglyphtounicode{afii10104}{0457}% +\pdfglyphtounicode{afii10105}{0458}% +\pdfglyphtounicode{afii10106}{0459}% +\pdfglyphtounicode{afii10107}{045A}% +\pdfglyphtounicode{afii10108}{045B}% +\pdfglyphtounicode{afii10109}{045C}% +\pdfglyphtounicode{afii10110}{045E}% +\pdfglyphtounicode{afii10193}{045F}% +\pdfglyphtounicode{afii10146}{0462}% +\pdfglyphtounicode{afii10194}{0463}% +\pdfglyphtounicode{afii10147}{0472}% +\pdfglyphtounicode{afii10195}{0473}% +\pdfglyphtounicode{afii10148}{0474}% +\pdfglyphtounicode{afii10196}{0475}% +\pdfglyphtounicode{afii10050}{0490}% +\pdfglyphtounicode{afii10098}{0491}% +\pdfglyphtounicode{afii10846}{04D9}% +\pdfglyphtounicode{afii57799}{05B0}% +\pdfglyphtounicode{afii57801}{05B1}% +\pdfglyphtounicode{afii57800}{05B2}% +\pdfglyphtounicode{afii57802}{05B3}% +\pdfglyphtounicode{afii57793}{05B4}% +\pdfglyphtounicode{afii57794}{05B5}% +\pdfglyphtounicode{afii57795}{05B6}% +\pdfglyphtounicode{afii57798}{05B7}% +\pdfglyphtounicode{afii57797}{05B8}% +\pdfglyphtounicode{afii57806}{05B9}% +\pdfglyphtounicode{afii57796}{05BB}% +\pdfglyphtounicode{afii57807}{05BC}% +\pdfglyphtounicode{afii57839}{05BD}% +\pdfglyphtounicode{afii57645}{05BE}% +\pdfglyphtounicode{afii57841}{05BF}% +\pdfglyphtounicode{afii57842}{05C0}% +\pdfglyphtounicode{afii57804}{05C1}% +\pdfglyphtounicode{afii57803}{05C2}% +\pdfglyphtounicode{afii57658}{05C3}% +\pdfglyphtounicode{afii57664}{05D0}% +\pdfglyphtounicode{afii57665}{05D1}% +\pdfglyphtounicode{afii57666}{05D2}% +\pdfglyphtounicode{afii57667}{05D3}% +\pdfglyphtounicode{afii57668}{05D4}% +\pdfglyphtounicode{afii57669}{05D5}% +\pdfglyphtounicode{afii57670}{05D6}% +\pdfglyphtounicode{afii57671}{05D7}% +\pdfglyphtounicode{afii57672}{05D8}% +\pdfglyphtounicode{afii57673}{05D9}% +\pdfglyphtounicode{afii57674}{05DA}% +\pdfglyphtounicode{afii57675}{05DB}% +\pdfglyphtounicode{afii57676}{05DC}% +\pdfglyphtounicode{afii57677}{05DD}% +\pdfglyphtounicode{afii57678}{05DE}% +\pdfglyphtounicode{afii57679}{05DF}% +\pdfglyphtounicode{afii57680}{05E0}% +\pdfglyphtounicode{afii57681}{05E1}% +\pdfglyphtounicode{afii57682}{05E2}% +\pdfglyphtounicode{afii57683}{05E3}% +\pdfglyphtounicode{afii57684}{05E4}% +\pdfglyphtounicode{afii57685}{05E5}% +\pdfglyphtounicode{afii57686}{05E6}% +\pdfglyphtounicode{afii57687}{05E7}% +\pdfglyphtounicode{afii57688}{05E8}% +\pdfglyphtounicode{afii57689}{05E9}% +\pdfglyphtounicode{afii57690}{05EA}% +\pdfglyphtounicode{afii57716}{05F0}% +\pdfglyphtounicode{afii57717}{05F1}% +\pdfglyphtounicode{afii57718}{05F2}% +\pdfglyphtounicode{afii57388}{060C}% +\pdfglyphtounicode{afii57403}{061B}% +\pdfglyphtounicode{afii57407}{061F}% +\pdfglyphtounicode{afii57409}{0621}% +\pdfglyphtounicode{afii57410}{0622}% +\pdfglyphtounicode{afii57411}{0623}% +\pdfglyphtounicode{afii57412}{0624}% +\pdfglyphtounicode{afii57413}{0625}% +\pdfglyphtounicode{afii57414}{0626}% +\pdfglyphtounicode{afii57415}{0627}% +\pdfglyphtounicode{afii57416}{0628}% +\pdfglyphtounicode{afii57417}{0629}% +\pdfglyphtounicode{afii57418}{062A}% +\pdfglyphtounicode{afii57419}{062B}% +\pdfglyphtounicode{afii57420}{062C}% +\pdfglyphtounicode{afii57421}{062D}% +\pdfglyphtounicode{afii57422}{062E}% +\pdfglyphtounicode{afii57423}{062F}% +\pdfglyphtounicode{afii57424}{0630}% +\pdfglyphtounicode{afii57425}{0631}% +\pdfglyphtounicode{afii57426}{0632}% +\pdfglyphtounicode{afii57427}{0633}% +\pdfglyphtounicode{afii57428}{0634}% +\pdfglyphtounicode{afii57429}{0635}% +\pdfglyphtounicode{afii57430}{0636}% +\pdfglyphtounicode{afii57431}{0637}% +\pdfglyphtounicode{afii57432}{0638}% +\pdfglyphtounicode{afii57433}{0639}% +\pdfglyphtounicode{afii57434}{063A}% +\pdfglyphtounicode{afii57440}{0640}% +\pdfglyphtounicode{afii57441}{0641}% +\pdfglyphtounicode{afii57442}{0642}% +\pdfglyphtounicode{afii57443}{0643}% +\pdfglyphtounicode{afii57444}{0644}% +\pdfglyphtounicode{afii57445}{0645}% +\pdfglyphtounicode{afii57446}{0646}% +\pdfglyphtounicode{afii57470}{0647}% +\pdfglyphtounicode{afii57448}{0648}% +\pdfglyphtounicode{afii57449}{0649}% +\pdfglyphtounicode{afii57450}{064A}% +\pdfglyphtounicode{afii57451}{064B}% +\pdfglyphtounicode{afii57452}{064C}% +\pdfglyphtounicode{afii57453}{064D}% +\pdfglyphtounicode{afii57454}{064E}% +\pdfglyphtounicode{afii57455}{064F}% +\pdfglyphtounicode{afii57456}{0650}% +\pdfglyphtounicode{afii57457}{0651}% +\pdfglyphtounicode{afii57458}{0652}% +\pdfglyphtounicode{afii57392}{0660}% +\pdfglyphtounicode{afii57393}{0661}% +\pdfglyphtounicode{afii57394}{0662}% +\pdfglyphtounicode{afii57395}{0663}% +\pdfglyphtounicode{afii57396}{0664}% +\pdfglyphtounicode{afii57397}{0665}% +\pdfglyphtounicode{afii57398}{0666}% +\pdfglyphtounicode{afii57399}{0667}% +\pdfglyphtounicode{afii57400}{0668}% +\pdfglyphtounicode{afii57401}{0669}% +\pdfglyphtounicode{afii57381}{066A}% +\pdfglyphtounicode{afii63167}{066D}% +\pdfglyphtounicode{afii57511}{0679}% +\pdfglyphtounicode{afii57506}{067E}% +\pdfglyphtounicode{afii57507}{0686}% +\pdfglyphtounicode{afii57512}{0688}% +\pdfglyphtounicode{afii57513}{0691}% +\pdfglyphtounicode{afii57508}{0698}% +\pdfglyphtounicode{afii57505}{06A4}% +\pdfglyphtounicode{afii57509}{06AF}% +\pdfglyphtounicode{afii57514}{06BA}% +\pdfglyphtounicode{afii57519}{06D2}% +\pdfglyphtounicode{afii57534}{06D5}% +\pdfglyphtounicode{Wgrave}{1E80}% +\pdfglyphtounicode{wgrave}{1E81}% +\pdfglyphtounicode{Wacute}{1E82}% +\pdfglyphtounicode{wacute}{1E83}% +\pdfglyphtounicode{Wdieresis}{1E84}% +\pdfglyphtounicode{wdieresis}{1E85}% +\pdfglyphtounicode{Ygrave}{1EF2}% +\pdfglyphtounicode{ygrave}{1EF3}% +\pdfglyphtounicode{afii61664}{200C}% +\pdfglyphtounicode{afii301}{200D}% +\pdfglyphtounicode{afii299}{200E}% +\pdfglyphtounicode{afii300}{200F}% +\pdfglyphtounicode{figuredash}{2012}% +\pdfglyphtounicode{endash}{2013}% +\pdfglyphtounicode{emdash}{2014}% +\pdfglyphtounicode{afii208}{2015}% +\pdfglyphtounicode{underscoredbl}{2017}% +\pdfglyphtounicode{quoteleft}{2018}% +\pdfglyphtounicode{quoteright}{2019}% +\pdfglyphtounicode{quotesinglbase}{201A}% +\pdfglyphtounicode{quotereversed}{201B}% +\pdfglyphtounicode{quotedblleft}{201C}% +\pdfglyphtounicode{quotedblright}{201D}% +\pdfglyphtounicode{quotedblbase}{201E}% +\pdfglyphtounicode{dagger}{2020}% +\pdfglyphtounicode{daggerdbl}{2021}% +\pdfglyphtounicode{bullet}{2022}% +\pdfglyphtounicode{onedotenleader}{2024}% +\pdfglyphtounicode{twodotenleader}{2025}% +\pdfglyphtounicode{ellipsis}{2026}% +\pdfglyphtounicode{afii61573}{202C}% +\pdfglyphtounicode{afii61574}{202D}% +\pdfglyphtounicode{afii61575}{202E}% +\pdfglyphtounicode{perthousand}{2030}% +\pdfglyphtounicode{minute}{2032}% +\pdfglyphtounicode{second}{2033}% +\pdfglyphtounicode{guilsinglleft}{2039}% +\pdfglyphtounicode{guilsinglright}{203A}% +\pdfglyphtounicode{exclamdbl}{203C}% +\pdfglyphtounicode{fraction}{2044}% +\pdfglyphtounicode{colonmonetary}{20A1}% +\pdfglyphtounicode{franc}{20A3}% +\pdfglyphtounicode{lira}{20A4}% +\pdfglyphtounicode{peseta}{20A7}% +\pdfglyphtounicode{afii57636}{20AA}% +\pdfglyphtounicode{dong}{20AB}% +\pdfglyphtounicode{Euro}{20AC}% +\pdfglyphtounicode{afii61248}{2105}% +\pdfglyphtounicode{Ifraktur}{2111}% +\pdfglyphtounicode{afii61289}{2113}% +\pdfglyphtounicode{afii61352}{2116}% +\pdfglyphtounicode{weierstrass}{2118}% +\pdfglyphtounicode{Rfraktur}{211C}% +\pdfglyphtounicode{prescription}{211E}% +\pdfglyphtounicode{trademark}{2122}% +\pdfglyphtounicode{Omega}{2126}% +\pdfglyphtounicode{estimated}{212E}% +\pdfglyphtounicode{aleph}{2135}% +\pdfglyphtounicode{onethird}{2153}% +\pdfglyphtounicode{twothirds}{2154}% +\pdfglyphtounicode{oneeighth}{215B}% +\pdfglyphtounicode{threeeighths}{215C}% +\pdfglyphtounicode{fiveeighths}{215D}% +\pdfglyphtounicode{seveneighths}{215E}% +\pdfglyphtounicode{arrowleft}{2190}% +\pdfglyphtounicode{arrowup}{2191}% +\pdfglyphtounicode{arrowright}{2192}% +\pdfglyphtounicode{arrowdown}{2193}% +\pdfglyphtounicode{arrowboth}{2194}% +\pdfglyphtounicode{arrowupdn}{2195}% +\pdfglyphtounicode{arrowupdnbse}{21A8}% +\pdfglyphtounicode{carriagereturn}{21B5}% +\pdfglyphtounicode{arrowdblleft}{21D0}% +\pdfglyphtounicode{arrowdblup}{21D1}% +\pdfglyphtounicode{arrowdblright}{21D2}% +\pdfglyphtounicode{arrowdbldown}{21D3}% +\pdfglyphtounicode{arrowdblboth}{21D4}% +\pdfglyphtounicode{universal}{2200}% +\pdfglyphtounicode{partialdiff}{2202}% +\pdfglyphtounicode{existential}{2203}% +\pdfglyphtounicode{emptyset}{2205}% +\pdfglyphtounicode{Delta}{2206}% +\pdfglyphtounicode{gradient}{2207}% +\pdfglyphtounicode{element}{2208}% +\pdfglyphtounicode{notelement}{2209}% +\pdfglyphtounicode{suchthat}{220B}% +\pdfglyphtounicode{product}{220F}% +\pdfglyphtounicode{summation}{2211}% +\pdfglyphtounicode{minus}{2212}% +\pdfglyphtounicode{asteriskmath}{2217}% +\pdfglyphtounicode{radical}{221A}% +\pdfglyphtounicode{proportional}{221D}% +\pdfglyphtounicode{infinity}{221E}% +\pdfglyphtounicode{orthogonal}{221F}% +\pdfglyphtounicode{angle}{2220}% +\pdfglyphtounicode{logicaland}{2227}% +\pdfglyphtounicode{logicalor}{2228}% +\pdfglyphtounicode{intersection}{2229}% +\pdfglyphtounicode{union}{222A}% +\pdfglyphtounicode{integral}{222B}% +\pdfglyphtounicode{therefore}{2234}% +\pdfglyphtounicode{similar}{223C}% +\pdfglyphtounicode{congruent}{2245}% +\pdfglyphtounicode{approxequal}{2248}% +\pdfglyphtounicode{notequal}{2260}% +\pdfglyphtounicode{equivalence}{2261}% +\pdfglyphtounicode{lessequal}{2264}% +\pdfglyphtounicode{greaterequal}{2265}% +\pdfglyphtounicode{propersubset}{2282}% +\pdfglyphtounicode{propersuperset}{2283}% +\pdfglyphtounicode{notsubset}{2284}% +\pdfglyphtounicode{reflexsubset}{2286}% +\pdfglyphtounicode{reflexsuperset}{2287}% +\pdfglyphtounicode{circleplus}{2295}% +\pdfglyphtounicode{circlemultiply}{2297}% +\pdfglyphtounicode{perpendicular}{22A5}% +\pdfglyphtounicode{dotmath}{22C5}% +\pdfglyphtounicode{house}{2302}% +\pdfglyphtounicode{revlogicalnot}{2310}% +\pdfglyphtounicode{integraltp}{2320}% +\pdfglyphtounicode{integralbt}{2321}% +\pdfglyphtounicode{angleleft}{2329}% +\pdfglyphtounicode{angleright}{232A}% +\pdfglyphtounicode{SF100000}{2500}% +\pdfglyphtounicode{SF110000}{2502}% +\pdfglyphtounicode{SF10000}{250C}% +\pdfglyphtounicode{SF30000}{2510}% +\pdfglyphtounicode{SF20000}{2514}% +\pdfglyphtounicode{SF40000}{2518}% +\pdfglyphtounicode{SF80000}{251C}% +\pdfglyphtounicode{SF90000}{2524}% +\pdfglyphtounicode{SF60000}{252C}% +\pdfglyphtounicode{SF70000}{2534}% +\pdfglyphtounicode{SF50000}{253C}% +\pdfglyphtounicode{SF430000}{2550}% +\pdfglyphtounicode{SF240000}{2551}% +\pdfglyphtounicode{SF510000}{2552}% +\pdfglyphtounicode{SF520000}{2553}% +\pdfglyphtounicode{SF390000}{2554}% +\pdfglyphtounicode{SF220000}{2555}% +\pdfglyphtounicode{SF210000}{2556}% +\pdfglyphtounicode{SF250000}{2557}% +\pdfglyphtounicode{SF500000}{2558}% +\pdfglyphtounicode{SF490000}{2559}% +\pdfglyphtounicode{SF380000}{255A}% +\pdfglyphtounicode{SF280000}{255B}% +\pdfglyphtounicode{SF270000}{255C}% +\pdfglyphtounicode{SF260000}{255D}% +\pdfglyphtounicode{SF360000}{255E}% +\pdfglyphtounicode{SF370000}{255F}% +\pdfglyphtounicode{SF420000}{2560}% +\pdfglyphtounicode{SF190000}{2561}% +\pdfglyphtounicode{SF200000}{2562}% +\pdfglyphtounicode{SF230000}{2563}% +\pdfglyphtounicode{SF470000}{2564}% +\pdfglyphtounicode{SF480000}{2565}% +\pdfglyphtounicode{SF410000}{2566}% +\pdfglyphtounicode{SF450000}{2567}% +\pdfglyphtounicode{SF460000}{2568}% +\pdfglyphtounicode{SF400000}{2569}% +\pdfglyphtounicode{SF540000}{256A}% +\pdfglyphtounicode{SF530000}{256B}% +\pdfglyphtounicode{SF440000}{256C}% +\pdfglyphtounicode{upblock}{2580}% +\pdfglyphtounicode{dnblock}{2584}% +\pdfglyphtounicode{block}{2588}% +\pdfglyphtounicode{lfblock}{258C}% +\pdfglyphtounicode{rtblock}{2590}% +\pdfglyphtounicode{ltshade}{2591}% +\pdfglyphtounicode{shade}{2592}% +\pdfglyphtounicode{dkshade}{2593}% +\pdfglyphtounicode{filledbox}{25A0}% +\pdfglyphtounicode{H22073}{25A1}% +\pdfglyphtounicode{H18543}{25AA}% +\pdfglyphtounicode{H18551}{25AB}% +\pdfglyphtounicode{filledrect}{25AC}% +\pdfglyphtounicode{triagup}{25B2}% +\pdfglyphtounicode{triagrt}{25BA}% +\pdfglyphtounicode{triagdn}{25BC}% +\pdfglyphtounicode{triaglf}{25C4}% +\pdfglyphtounicode{lozenge}{25CA}% +\pdfglyphtounicode{circle}{25CB}% +\pdfglyphtounicode{H18533}{25CF}% +\pdfglyphtounicode{invbullet}{25D8}% +\pdfglyphtounicode{invcircle}{25D9}% +\pdfglyphtounicode{openbullet}{25E6}% +\pdfglyphtounicode{smileface}{263A}% +\pdfglyphtounicode{invsmileface}{263B}% +\pdfglyphtounicode{sun}{263C}% +\pdfglyphtounicode{female}{2640}% +\pdfglyphtounicode{male}{2642}% +\pdfglyphtounicode{spade}{2660}% +\pdfglyphtounicode{club}{2663}% +\pdfglyphtounicode{heart}{2665}% +\pdfglyphtounicode{diamond}{2666}% +\pdfglyphtounicode{musicalnote}{266A}% +\pdfglyphtounicode{musicalnotedbl}{266B}% +% +\endinput diff --git a/tex/context/base/pdfr-def.tex b/tex/context/base/pdfr-def.tex deleted file mode 100644 index 7554bda9e..000000000 --- a/tex/context/base/pdfr-def.tex +++ /dev/null @@ -1,843 +0,0 @@ -% filename : pdfr-def.tex -% comment : generated by mtxrun --script chars --pdf -% author : Hans Hagen, PRAGMA-ADE, Hasselt NL -% copyright: PRAGMA ADE / ConTeXt Development Team -% license : see context related readme files -% -\pdfglyphtounicode{space}{0020}% -\pdfglyphtounicode{exclam}{0021}% -\pdfglyphtounicode{quotedbl}{0022}% -\pdfglyphtounicode{numbersign}{0023}% -\pdfglyphtounicode{dollar}{0024}% -\pdfglyphtounicode{percent}{0025}% -\pdfglyphtounicode{ampersand}{0026}% -\pdfglyphtounicode{quotesingle}{0027}% -\pdfglyphtounicode{parenleft}{0028}% -\pdfglyphtounicode{parenright}{0029}% -\pdfglyphtounicode{asterisk}{002A}% -\pdfglyphtounicode{plus}{002B}% -\pdfglyphtounicode{comma}{002C}% -\pdfglyphtounicode{hyphen}{002D}% -\pdfglyphtounicode{period}{002E}% -\pdfglyphtounicode{slash}{002F}% -\pdfglyphtounicode{zero}{0030}% -\pdfglyphtounicode{one}{0031}% -\pdfglyphtounicode{two}{0032}% -\pdfglyphtounicode{three}{0033}% -\pdfglyphtounicode{four}{0034}% -\pdfglyphtounicode{five}{0035}% -\pdfglyphtounicode{six}{0036}% -\pdfglyphtounicode{seven}{0037}% -\pdfglyphtounicode{eight}{0038}% -\pdfglyphtounicode{nine}{0039}% -\pdfglyphtounicode{colon}{003A}% -\pdfglyphtounicode{semicolon}{003B}% -\pdfglyphtounicode{less}{003C}% -\pdfglyphtounicode{equal}{003D}% -\pdfglyphtounicode{greater}{003E}% -\pdfglyphtounicode{question}{003F}% -\pdfglyphtounicode{at}{0040}% -\pdfglyphtounicode{A}{0041}% -\pdfglyphtounicode{B}{0042}% -\pdfglyphtounicode{C}{0043}% -\pdfglyphtounicode{D}{0044}% -\pdfglyphtounicode{E}{0045}% -\pdfglyphtounicode{F}{0046}% -\pdfglyphtounicode{G}{0047}% -\pdfglyphtounicode{H}{0048}% -\pdfglyphtounicode{I}{0049}% -\pdfglyphtounicode{J}{004A}% -\pdfglyphtounicode{K}{004B}% -\pdfglyphtounicode{L}{004C}% -\pdfglyphtounicode{M}{004D}% -\pdfglyphtounicode{N}{004E}% -\pdfglyphtounicode{O}{004F}% -\pdfglyphtounicode{P}{0050}% -\pdfglyphtounicode{Q}{0051}% -\pdfglyphtounicode{R}{0052}% -\pdfglyphtounicode{S}{0053}% -\pdfglyphtounicode{T}{0054}% -\pdfglyphtounicode{U}{0055}% -\pdfglyphtounicode{V}{0056}% -\pdfglyphtounicode{W}{0057}% -\pdfglyphtounicode{X}{0058}% -\pdfglyphtounicode{Y}{0059}% -\pdfglyphtounicode{Z}{005A}% -\pdfglyphtounicode{bracketleft}{005B}% -\pdfglyphtounicode{backslash}{005C}% -\pdfglyphtounicode{bracketright}{005D}% -\pdfglyphtounicode{asciicircum}{005E}% -\pdfglyphtounicode{underscore}{005F}% -\pdfglyphtounicode{grave}{0060}% -\pdfglyphtounicode{a}{0061}% -\pdfglyphtounicode{b}{0062}% -\pdfglyphtounicode{c}{0063}% -\pdfglyphtounicode{d}{0064}% -\pdfglyphtounicode{e}{0065}% -\pdfglyphtounicode{f}{0066}% -\pdfglyphtounicode{g}{0067}% -\pdfglyphtounicode{h}{0068}% -\pdfglyphtounicode{i}{0069}% -\pdfglyphtounicode{j}{006A}% -\pdfglyphtounicode{k}{006B}% -\pdfglyphtounicode{l}{006C}% -\pdfglyphtounicode{m}{006D}% -\pdfglyphtounicode{n}{006E}% -\pdfglyphtounicode{o}{006F}% -\pdfglyphtounicode{p}{0070}% -\pdfglyphtounicode{q}{0071}% -\pdfglyphtounicode{r}{0072}% -\pdfglyphtounicode{s}{0073}% -\pdfglyphtounicode{t}{0074}% -\pdfglyphtounicode{u}{0075}% -\pdfglyphtounicode{v}{0076}% -\pdfglyphtounicode{w}{0077}% -\pdfglyphtounicode{x}{0078}% -\pdfglyphtounicode{y}{0079}% -\pdfglyphtounicode{z}{007A}% -\pdfglyphtounicode{braceleft}{007B}% -\pdfglyphtounicode{bar}{007C}% -\pdfglyphtounicode{braceright}{007D}% -\pdfglyphtounicode{asciitilde}{007E}% -\pdfglyphtounicode{exclamdown}{00A1}% -\pdfglyphtounicode{cent}{00A2}% -\pdfglyphtounicode{sterling}{00A3}% -\pdfglyphtounicode{currency}{00A4}% -\pdfglyphtounicode{yen}{00A5}% -\pdfglyphtounicode{brokenbar}{00A6}% -\pdfglyphtounicode{section}{00A7}% -\pdfglyphtounicode{dieresis}{00A8}% -\pdfglyphtounicode{copyright}{00A9}% -\pdfglyphtounicode{ordfeminine}{00AA}% -\pdfglyphtounicode{guillemotleft}{00AB}% -\pdfglyphtounicode{logicalnot}{00AC}% -\pdfglyphtounicode{registered}{00AE}% -\pdfglyphtounicode{macron}{00AF}% -\pdfglyphtounicode{degree}{00B0}% -\pdfglyphtounicode{plusminus}{00B1}% -\pdfglyphtounicode{acute}{00B4}% -\pdfglyphtounicode{mu}{00B5}% -\pdfglyphtounicode{paragraph}{00B6}% -\pdfglyphtounicode{periodcentered}{00B7}% -\pdfglyphtounicode{cedilla}{00B8}% -\pdfglyphtounicode{ordmasculine}{00BA}% -\pdfglyphtounicode{guillemotright}{00BB}% -\pdfglyphtounicode{onequarter}{00BC}% -\pdfglyphtounicode{onehalf}{00BD}% -\pdfglyphtounicode{threequarters}{00BE}% -\pdfglyphtounicode{questiondown}{00BF}% -\pdfglyphtounicode{Agrave}{00C0}% -\pdfglyphtounicode{Aacute}{00C1}% -\pdfglyphtounicode{Acircumflex}{00C2}% -\pdfglyphtounicode{Atilde}{00C3}% -\pdfglyphtounicode{Adieresis}{00C4}% -\pdfglyphtounicode{Aring}{00C5}% -\pdfglyphtounicode{AE}{00C6}% -\pdfglyphtounicode{Ccedilla}{00C7}% -\pdfglyphtounicode{Egrave}{00C8}% -\pdfglyphtounicode{Eacute}{00C9}% -\pdfglyphtounicode{Ecircumflex}{00CA}% -\pdfglyphtounicode{Edieresis}{00CB}% -\pdfglyphtounicode{Igrave}{00CC}% -\pdfglyphtounicode{Iacute}{00CD}% -\pdfglyphtounicode{Icircumflex}{00CE}% -\pdfglyphtounicode{Idieresis}{00CF}% -\pdfglyphtounicode{Eth}{00D0}% -\pdfglyphtounicode{Ntilde}{00D1}% -\pdfglyphtounicode{Ograve}{00D2}% -\pdfglyphtounicode{Oacute}{00D3}% -\pdfglyphtounicode{Ocircumflex}{00D4}% -\pdfglyphtounicode{Otilde}{00D5}% -\pdfglyphtounicode{Odieresis}{00D6}% -\pdfglyphtounicode{multiply}{00D7}% -\pdfglyphtounicode{Oslash}{00D8}% -\pdfglyphtounicode{Ugrave}{00D9}% -\pdfglyphtounicode{Uacute}{00DA}% -\pdfglyphtounicode{Ucircumflex}{00DB}% -\pdfglyphtounicode{Udieresis}{00DC}% -\pdfglyphtounicode{Yacute}{00DD}% -\pdfglyphtounicode{Thorn}{00DE}% -\pdfglyphtounicode{germandbls}{00DF}% -\pdfglyphtounicode{agrave}{00E0}% -\pdfglyphtounicode{aacute}{00E1}% -\pdfglyphtounicode{acircumflex}{00E2}% -\pdfglyphtounicode{atilde}{00E3}% -\pdfglyphtounicode{adieresis}{00E4}% -\pdfglyphtounicode{aring}{00E5}% -\pdfglyphtounicode{ae}{00E6}% -\pdfglyphtounicode{ccedilla}{00E7}% -\pdfglyphtounicode{egrave}{00E8}% -\pdfglyphtounicode{eacute}{00E9}% -\pdfglyphtounicode{ecircumflex}{00EA}% -\pdfglyphtounicode{edieresis}{00EB}% -\pdfglyphtounicode{igrave}{00EC}% -\pdfglyphtounicode{iacute}{00ED}% -\pdfglyphtounicode{icircumflex}{00EE}% -\pdfglyphtounicode{idieresis}{00EF}% -\pdfglyphtounicode{eth}{00F0}% -\pdfglyphtounicode{ntilde}{00F1}% -\pdfglyphtounicode{ograve}{00F2}% -\pdfglyphtounicode{oacute}{00F3}% -\pdfglyphtounicode{ocircumflex}{00F4}% -\pdfglyphtounicode{otilde}{00F5}% -\pdfglyphtounicode{odieresis}{00F6}% -\pdfglyphtounicode{divide}{00F7}% -\pdfglyphtounicode{oslash}{00F8}% -\pdfglyphtounicode{ugrave}{00F9}% -\pdfglyphtounicode{uacute}{00FA}% -\pdfglyphtounicode{ucircumflex}{00FB}% -\pdfglyphtounicode{udieresis}{00FC}% -\pdfglyphtounicode{yacute}{00FD}% -\pdfglyphtounicode{thorn}{00FE}% -\pdfglyphtounicode{ydieresis}{00FF}% -\pdfglyphtounicode{Amacron}{0100}% -\pdfglyphtounicode{amacron}{0101}% -\pdfglyphtounicode{Abreve}{0102}% -\pdfglyphtounicode{abreve}{0103}% -\pdfglyphtounicode{Aogonek}{0104}% -\pdfglyphtounicode{aogonek}{0105}% -\pdfglyphtounicode{Cacute}{0106}% -\pdfglyphtounicode{cacute}{0107}% -\pdfglyphtounicode{Ccircumflex}{0108}% -\pdfglyphtounicode{ccircumflex}{0109}% -\pdfglyphtounicode{Cdotaccent}{010A}% -\pdfglyphtounicode{cdotaccent}{010B}% -\pdfglyphtounicode{Ccaron}{010C}% -\pdfglyphtounicode{ccaron}{010D}% -\pdfglyphtounicode{Dcaron}{010E}% -\pdfglyphtounicode{dcaron}{010F}% -\pdfglyphtounicode{Dcroat}{0110}% -\pdfglyphtounicode{dcroat}{0111}% -\pdfglyphtounicode{Emacron}{0112}% -\pdfglyphtounicode{emacron}{0113}% -\pdfglyphtounicode{Ebreve}{0114}% -\pdfglyphtounicode{ebreve}{0115}% -\pdfglyphtounicode{Edotaccent}{0116}% -\pdfglyphtounicode{edotaccent}{0117}% -\pdfglyphtounicode{Eogonek}{0118}% -\pdfglyphtounicode{eogonek}{0119}% -\pdfglyphtounicode{Ecaron}{011A}% -\pdfglyphtounicode{ecaron}{011B}% -\pdfglyphtounicode{Gcircumflex}{011C}% -\pdfglyphtounicode{gcircumflex}{011D}% -\pdfglyphtounicode{Gbreve}{011E}% -\pdfglyphtounicode{gbreve}{011F}% -\pdfglyphtounicode{Gdotaccent}{0120}% -\pdfglyphtounicode{gdotaccent}{0121}% -\pdfglyphtounicode{Gcommaaccent}{0122}% -\pdfglyphtounicode{gcommaaccent}{0123}% -\pdfglyphtounicode{Hcircumflex}{0124}% -\pdfglyphtounicode{hcircumflex}{0125}% -\pdfglyphtounicode{Hbar}{0126}% -\pdfglyphtounicode{hbar}{0127}% -\pdfglyphtounicode{Itilde}{0128}% -\pdfglyphtounicode{itilde}{0129}% -\pdfglyphtounicode{Imacron}{012A}% -\pdfglyphtounicode{imacron}{012B}% -\pdfglyphtounicode{Ibreve}{012C}% -\pdfglyphtounicode{ibreve}{012D}% -\pdfglyphtounicode{Iogonek}{012E}% -\pdfglyphtounicode{iogonek}{012F}% -\pdfglyphtounicode{Idotaccent}{0130}% -\pdfglyphtounicode{dotlessi}{0131}% -\pdfglyphtounicode{IJ}{0132}% -\pdfglyphtounicode{ij}{0133}% -\pdfglyphtounicode{Jcircumflex}{0134}% -\pdfglyphtounicode{jcircumflex}{0135}% -\pdfglyphtounicode{Kcommaaccent}{0136}% -\pdfglyphtounicode{kcommaaccent}{0137}% -\pdfglyphtounicode{kgreenlandic}{0138}% -\pdfglyphtounicode{Lacute}{0139}% -\pdfglyphtounicode{lacute}{013A}% -\pdfglyphtounicode{Lcommaaccent}{013B}% -\pdfglyphtounicode{lcommaaccent}{013C}% -\pdfglyphtounicode{Lcaron}{013D}% -\pdfglyphtounicode{lcaron}{013E}% -\pdfglyphtounicode{Ldot}{013F}% -\pdfglyphtounicode{ldot}{0140}% -\pdfglyphtounicode{Lslash}{0141}% -\pdfglyphtounicode{lslash}{0142}% -\pdfglyphtounicode{Nacute}{0143}% -\pdfglyphtounicode{nacute}{0144}% -\pdfglyphtounicode{Ncommaaccent}{0145}% -\pdfglyphtounicode{ncommaaccent}{0146}% -\pdfglyphtounicode{Ncaron}{0147}% -\pdfglyphtounicode{ncaron}{0148}% -\pdfglyphtounicode{napostrophe}{0149}% -\pdfglyphtounicode{Eng}{014A}% -\pdfglyphtounicode{eng}{014B}% -\pdfglyphtounicode{Omacron}{014C}% -\pdfglyphtounicode{omacron}{014D}% -\pdfglyphtounicode{Obreve}{014E}% -\pdfglyphtounicode{obreve}{014F}% -\pdfglyphtounicode{Ohungarumlaut}{0150}% -\pdfglyphtounicode{ohungarumlaut}{0151}% -\pdfglyphtounicode{OE}{0152}% -\pdfglyphtounicode{oe}{0153}% -\pdfglyphtounicode{Racute}{0154}% -\pdfglyphtounicode{racute}{0155}% -\pdfglyphtounicode{Rcommaaccent}{0156}% -\pdfglyphtounicode{rcommaaccent}{0157}% -\pdfglyphtounicode{Rcaron}{0158}% -\pdfglyphtounicode{rcaron}{0159}% -\pdfglyphtounicode{Sacute}{015A}% -\pdfglyphtounicode{sacute}{015B}% -\pdfglyphtounicode{Scircumflex}{015C}% -\pdfglyphtounicode{scircumflex}{015D}% -\pdfglyphtounicode{Scedilla}{015E}% -\pdfglyphtounicode{scedilla}{015F}% -\pdfglyphtounicode{Scaron}{0160}% -\pdfglyphtounicode{scaron}{0161}% -\pdfglyphtounicode{Tcommaaccent}{0162}% -\pdfglyphtounicode{tcommaaccent}{0163}% -\pdfglyphtounicode{Tcaron}{0164}% -\pdfglyphtounicode{tcaron}{0165}% -\pdfglyphtounicode{Tbar}{0166}% -\pdfglyphtounicode{tbar}{0167}% -\pdfglyphtounicode{Utilde}{0168}% -\pdfglyphtounicode{utilde}{0169}% -\pdfglyphtounicode{Umacron}{016A}% -\pdfglyphtounicode{umacron}{016B}% -\pdfglyphtounicode{Ubreve}{016C}% -\pdfglyphtounicode{ubreve}{016D}% -\pdfglyphtounicode{Uring}{016E}% -\pdfglyphtounicode{uring}{016F}% -\pdfglyphtounicode{Uhungarumlaut}{0170}% -\pdfglyphtounicode{uhungarumlaut}{0171}% -\pdfglyphtounicode{Uogonek}{0172}% -\pdfglyphtounicode{uogonek}{0173}% -\pdfglyphtounicode{Wcircumflex}{0174}% -\pdfglyphtounicode{wcircumflex}{0175}% -\pdfglyphtounicode{Ycircumflex}{0176}% -\pdfglyphtounicode{ycircumflex}{0177}% -\pdfglyphtounicode{Ydieresis}{0178}% -\pdfglyphtounicode{Zacute}{0179}% -\pdfglyphtounicode{zacute}{017A}% -\pdfglyphtounicode{Zdotaccent}{017B}% -\pdfglyphtounicode{zdotaccent}{017C}% -\pdfglyphtounicode{Zcaron}{017D}% -\pdfglyphtounicode{zcaron}{017E}% -\pdfglyphtounicode{longs}{017F}% -\pdfglyphtounicode{florin}{0192}% -\pdfglyphtounicode{Ohorn}{01A0}% -\pdfglyphtounicode{ohorn}{01A1}% -\pdfglyphtounicode{Uhorn}{01AF}% -\pdfglyphtounicode{uhorn}{01B0}% -\pdfglyphtounicode{Gcaron}{01E6}% -\pdfglyphtounicode{gcaron}{01E7}% -\pdfglyphtounicode{Aringacute}{01FA}% -\pdfglyphtounicode{aringacute}{01FB}% -\pdfglyphtounicode{AEacute}{01FC}% -\pdfglyphtounicode{aeacute}{01FD}% -\pdfglyphtounicode{Oslashacute}{01FE}% -\pdfglyphtounicode{oslashacute}{01FF}% -\pdfglyphtounicode{Scommaaccent}{0218}% -\pdfglyphtounicode{scommaaccent}{0219}% -\pdfglyphtounicode{afii57929}{02BC}% -\pdfglyphtounicode{afii64937}{02BD}% -\pdfglyphtounicode{circumflex}{02C6}% -\pdfglyphtounicode{caron}{02C7}% -\pdfglyphtounicode{breve}{02D8}% -\pdfglyphtounicode{dotaccent}{02D9}% -\pdfglyphtounicode{ring}{02DA}% -\pdfglyphtounicode{ogonek}{02DB}% -\pdfglyphtounicode{tilde}{02DC}% -\pdfglyphtounicode{hungarumlaut}{02DD}% -\pdfglyphtounicode{gravecomb}{0300}% -\pdfglyphtounicode{acutecomb}{0301}% -\pdfglyphtounicode{tildecomb}{0303}% -\pdfglyphtounicode{hookabovecomb}{0309}% -\pdfglyphtounicode{dotbelowcomb}{0323}% -\pdfglyphtounicode{tonos}{0384}% -\pdfglyphtounicode{dieresistonos}{0385}% -\pdfglyphtounicode{Alphatonos}{0386}% -\pdfglyphtounicode{anoteleia}{0387}% -\pdfglyphtounicode{Epsilontonos}{0388}% -\pdfglyphtounicode{Etatonos}{0389}% -\pdfglyphtounicode{Iotatonos}{038A}% -\pdfglyphtounicode{Omicrontonos}{038C}% -\pdfglyphtounicode{Upsilontonos}{038E}% -\pdfglyphtounicode{Omegatonos}{038F}% -\pdfglyphtounicode{iotadieresistonos}{0390}% -\pdfglyphtounicode{Alpha}{0391}% -\pdfglyphtounicode{Beta}{0392}% -\pdfglyphtounicode{Gamma}{0393}% -\pdfglyphtounicode{Epsilon}{0395}% -\pdfglyphtounicode{Zeta}{0396}% -\pdfglyphtounicode{Eta}{0397}% -\pdfglyphtounicode{Theta}{0398}% -\pdfglyphtounicode{Iota}{0399}% -\pdfglyphtounicode{Kappa}{039A}% -\pdfglyphtounicode{Lambda}{039B}% -\pdfglyphtounicode{Mu}{039C}% -\pdfglyphtounicode{Nu}{039D}% -\pdfglyphtounicode{Xi}{039E}% -\pdfglyphtounicode{Omicron}{039F}% -\pdfglyphtounicode{Pi}{03A0}% -\pdfglyphtounicode{Rho}{03A1}% -\pdfglyphtounicode{Sigma}{03A3}% -\pdfglyphtounicode{Tau}{03A4}% -\pdfglyphtounicode{Upsilon}{03A5}% -\pdfglyphtounicode{Phi}{03A6}% -\pdfglyphtounicode{Chi}{03A7}% -\pdfglyphtounicode{Psi}{03A8}% -\pdfglyphtounicode{Iotadieresis}{03AA}% -\pdfglyphtounicode{Upsilondieresis}{03AB}% -\pdfglyphtounicode{alphatonos}{03AC}% -\pdfglyphtounicode{epsilontonos}{03AD}% -\pdfglyphtounicode{etatonos}{03AE}% -\pdfglyphtounicode{iotatonos}{03AF}% -\pdfglyphtounicode{upsilondieresistonos}{03B0}% -\pdfglyphtounicode{alpha}{03B1}% -\pdfglyphtounicode{beta}{03B2}% -\pdfglyphtounicode{gamma}{03B3}% -\pdfglyphtounicode{delta}{03B4}% -\pdfglyphtounicode{epsilon}{03B5}% -\pdfglyphtounicode{zeta}{03B6}% -\pdfglyphtounicode{eta}{03B7}% -\pdfglyphtounicode{theta}{03B8}% -\pdfglyphtounicode{iota}{03B9}% -\pdfglyphtounicode{kappa}{03BA}% -\pdfglyphtounicode{lambda}{03BB}% -\pdfglyphtounicode{nu}{03BD}% -\pdfglyphtounicode{xi}{03BE}% -\pdfglyphtounicode{omicron}{03BF}% -\pdfglyphtounicode{pi}{03C0}% -\pdfglyphtounicode{rho}{03C1}% -\pdfglyphtounicode{sigma1}{03C2}% -\pdfglyphtounicode{sigma}{03C3}% -\pdfglyphtounicode{tau}{03C4}% -\pdfglyphtounicode{upsilon}{03C5}% -\pdfglyphtounicode{phi}{03C6}% -\pdfglyphtounicode{chi}{03C7}% -\pdfglyphtounicode{psi}{03C8}% -\pdfglyphtounicode{omega}{03C9}% -\pdfglyphtounicode{iotadieresis}{03CA}% -\pdfglyphtounicode{upsilondieresis}{03CB}% -\pdfglyphtounicode{omicrontonos}{03CC}% -\pdfglyphtounicode{upsilontonos}{03CD}% -\pdfglyphtounicode{omegatonos}{03CE}% -\pdfglyphtounicode{theta1}{03D1}% -\pdfglyphtounicode{Upsilon1}{03D2}% -\pdfglyphtounicode{phi1}{03D5}% -\pdfglyphtounicode{omega1}{03D6}% -\pdfglyphtounicode{afii10023}{0401}% -\pdfglyphtounicode{afii10051}{0402}% -\pdfglyphtounicode{afii10052}{0403}% -\pdfglyphtounicode{afii10053}{0404}% -\pdfglyphtounicode{afii10054}{0405}% -\pdfglyphtounicode{afii10055}{0406}% -\pdfglyphtounicode{afii10056}{0407}% -\pdfglyphtounicode{afii10057}{0408}% -\pdfglyphtounicode{afii10058}{0409}% -\pdfglyphtounicode{afii10059}{040A}% -\pdfglyphtounicode{afii10060}{040B}% -\pdfglyphtounicode{afii10061}{040C}% -\pdfglyphtounicode{afii10062}{040E}% -\pdfglyphtounicode{afii10145}{040F}% -\pdfglyphtounicode{afii10017}{0410}% -\pdfglyphtounicode{afii10018}{0411}% -\pdfglyphtounicode{afii10019}{0412}% -\pdfglyphtounicode{afii10020}{0413}% -\pdfglyphtounicode{afii10021}{0414}% -\pdfglyphtounicode{afii10022}{0415}% -\pdfglyphtounicode{afii10024}{0416}% -\pdfglyphtounicode{afii10025}{0417}% -\pdfglyphtounicode{afii10026}{0418}% -\pdfglyphtounicode{afii10027}{0419}% -\pdfglyphtounicode{afii10028}{041A}% -\pdfglyphtounicode{afii10029}{041B}% -\pdfglyphtounicode{afii10030}{041C}% -\pdfglyphtounicode{afii10031}{041D}% -\pdfglyphtounicode{afii10032}{041E}% -\pdfglyphtounicode{afii10033}{041F}% -\pdfglyphtounicode{afii10034}{0420}% -\pdfglyphtounicode{afii10035}{0421}% -\pdfglyphtounicode{afii10036}{0422}% -\pdfglyphtounicode{afii10037}{0423}% -\pdfglyphtounicode{afii10038}{0424}% -\pdfglyphtounicode{afii10039}{0425}% -\pdfglyphtounicode{afii10040}{0426}% -\pdfglyphtounicode{afii10041}{0427}% -\pdfglyphtounicode{afii10042}{0428}% -\pdfglyphtounicode{afii10043}{0429}% -\pdfglyphtounicode{afii10044}{042A}% -\pdfglyphtounicode{afii10045}{042B}% -\pdfglyphtounicode{afii10046}{042C}% -\pdfglyphtounicode{afii10047}{042D}% -\pdfglyphtounicode{afii10048}{042E}% -\pdfglyphtounicode{afii10049}{042F}% -\pdfglyphtounicode{afii10065}{0430}% -\pdfglyphtounicode{afii10066}{0431}% -\pdfglyphtounicode{afii10067}{0432}% -\pdfglyphtounicode{afii10068}{0433}% -\pdfglyphtounicode{afii10069}{0434}% -\pdfglyphtounicode{afii10070}{0435}% -\pdfglyphtounicode{afii10072}{0436}% -\pdfglyphtounicode{afii10073}{0437}% -\pdfglyphtounicode{afii10074}{0438}% -\pdfglyphtounicode{afii10075}{0439}% -\pdfglyphtounicode{afii10076}{043A}% -\pdfglyphtounicode{afii10077}{043B}% -\pdfglyphtounicode{afii10078}{043C}% -\pdfglyphtounicode{afii10079}{043D}% -\pdfglyphtounicode{afii10080}{043E}% -\pdfglyphtounicode{afii10081}{043F}% -\pdfglyphtounicode{afii10082}{0440}% -\pdfglyphtounicode{afii10083}{0441}% -\pdfglyphtounicode{afii10084}{0442}% -\pdfglyphtounicode{afii10085}{0443}% -\pdfglyphtounicode{afii10086}{0444}% -\pdfglyphtounicode{afii10087}{0445}% -\pdfglyphtounicode{afii10088}{0446}% -\pdfglyphtounicode{afii10089}{0447}% -\pdfglyphtounicode{afii10090}{0448}% -\pdfglyphtounicode{afii10091}{0449}% -\pdfglyphtounicode{afii10092}{044A}% -\pdfglyphtounicode{afii10093}{044B}% -\pdfglyphtounicode{afii10094}{044C}% -\pdfglyphtounicode{afii10095}{044D}% -\pdfglyphtounicode{afii10096}{044E}% -\pdfglyphtounicode{afii10097}{044F}% -\pdfglyphtounicode{afii10071}{0451}% -\pdfglyphtounicode{afii10099}{0452}% -\pdfglyphtounicode{afii10100}{0453}% -\pdfglyphtounicode{afii10101}{0454}% -\pdfglyphtounicode{afii10102}{0455}% -\pdfglyphtounicode{afii10103}{0456}% -\pdfglyphtounicode{afii10104}{0457}% -\pdfglyphtounicode{afii10105}{0458}% -\pdfglyphtounicode{afii10106}{0459}% -\pdfglyphtounicode{afii10107}{045A}% -\pdfglyphtounicode{afii10108}{045B}% -\pdfglyphtounicode{afii10109}{045C}% -\pdfglyphtounicode{afii10110}{045E}% -\pdfglyphtounicode{afii10193}{045F}% -\pdfglyphtounicode{afii10146}{0462}% -\pdfglyphtounicode{afii10194}{0463}% -\pdfglyphtounicode{afii10147}{0472}% -\pdfglyphtounicode{afii10195}{0473}% -\pdfglyphtounicode{afii10148}{0474}% -\pdfglyphtounicode{afii10196}{0475}% -\pdfglyphtounicode{afii10050}{0490}% -\pdfglyphtounicode{afii10098}{0491}% -\pdfglyphtounicode{afii10846}{04D9}% -\pdfglyphtounicode{afii57799}{05B0}% -\pdfglyphtounicode{afii57801}{05B1}% -\pdfglyphtounicode{afii57800}{05B2}% -\pdfglyphtounicode{afii57802}{05B3}% -\pdfglyphtounicode{afii57793}{05B4}% -\pdfglyphtounicode{afii57794}{05B5}% -\pdfglyphtounicode{afii57795}{05B6}% -\pdfglyphtounicode{afii57798}{05B7}% -\pdfglyphtounicode{afii57797}{05B8}% -\pdfglyphtounicode{afii57806}{05B9}% -\pdfglyphtounicode{afii57796}{05BB}% -\pdfglyphtounicode{afii57807}{05BC}% -\pdfglyphtounicode{afii57839}{05BD}% -\pdfglyphtounicode{afii57645}{05BE}% -\pdfglyphtounicode{afii57841}{05BF}% -\pdfglyphtounicode{afii57842}{05C0}% -\pdfglyphtounicode{afii57804}{05C1}% -\pdfglyphtounicode{afii57803}{05C2}% -\pdfglyphtounicode{afii57658}{05C3}% -\pdfglyphtounicode{afii57664}{05D0}% -\pdfglyphtounicode{afii57665}{05D1}% -\pdfglyphtounicode{afii57666}{05D2}% -\pdfglyphtounicode{afii57667}{05D3}% -\pdfglyphtounicode{afii57668}{05D4}% -\pdfglyphtounicode{afii57669}{05D5}% -\pdfglyphtounicode{afii57670}{05D6}% -\pdfglyphtounicode{afii57671}{05D7}% -\pdfglyphtounicode{afii57672}{05D8}% -\pdfglyphtounicode{afii57673}{05D9}% -\pdfglyphtounicode{afii57674}{05DA}% -\pdfglyphtounicode{afii57675}{05DB}% -\pdfglyphtounicode{afii57676}{05DC}% -\pdfglyphtounicode{afii57677}{05DD}% -\pdfglyphtounicode{afii57678}{05DE}% -\pdfglyphtounicode{afii57679}{05DF}% -\pdfglyphtounicode{afii57680}{05E0}% -\pdfglyphtounicode{afii57681}{05E1}% -\pdfglyphtounicode{afii57682}{05E2}% -\pdfglyphtounicode{afii57683}{05E3}% -\pdfglyphtounicode{afii57684}{05E4}% -\pdfglyphtounicode{afii57685}{05E5}% -\pdfglyphtounicode{afii57686}{05E6}% -\pdfglyphtounicode{afii57687}{05E7}% -\pdfglyphtounicode{afii57688}{05E8}% -\pdfglyphtounicode{afii57689}{05E9}% -\pdfglyphtounicode{afii57690}{05EA}% -\pdfglyphtounicode{afii57716}{05F0}% -\pdfglyphtounicode{afii57717}{05F1}% -\pdfglyphtounicode{afii57718}{05F2}% -\pdfglyphtounicode{afii57388}{060C}% -\pdfglyphtounicode{afii57403}{061B}% -\pdfglyphtounicode{afii57407}{061F}% -\pdfglyphtounicode{afii57409}{0621}% -\pdfglyphtounicode{afii57410}{0622}% -\pdfglyphtounicode{afii57411}{0623}% -\pdfglyphtounicode{afii57412}{0624}% -\pdfglyphtounicode{afii57413}{0625}% -\pdfglyphtounicode{afii57414}{0626}% -\pdfglyphtounicode{afii57415}{0627}% -\pdfglyphtounicode{afii57416}{0628}% -\pdfglyphtounicode{afii57417}{0629}% -\pdfglyphtounicode{afii57418}{062A}% -\pdfglyphtounicode{afii57419}{062B}% -\pdfglyphtounicode{afii57420}{062C}% -\pdfglyphtounicode{afii57421}{062D}% -\pdfglyphtounicode{afii57422}{062E}% -\pdfglyphtounicode{afii57423}{062F}% -\pdfglyphtounicode{afii57424}{0630}% -\pdfglyphtounicode{afii57425}{0631}% -\pdfglyphtounicode{afii57426}{0632}% -\pdfglyphtounicode{afii57427}{0633}% -\pdfglyphtounicode{afii57428}{0634}% -\pdfglyphtounicode{afii57429}{0635}% -\pdfglyphtounicode{afii57430}{0636}% -\pdfglyphtounicode{afii57431}{0637}% -\pdfglyphtounicode{afii57432}{0638}% -\pdfglyphtounicode{afii57433}{0639}% -\pdfglyphtounicode{afii57434}{063A}% -\pdfglyphtounicode{afii57440}{0640}% -\pdfglyphtounicode{afii57441}{0641}% -\pdfglyphtounicode{afii57442}{0642}% -\pdfglyphtounicode{afii57443}{0643}% -\pdfglyphtounicode{afii57444}{0644}% -\pdfglyphtounicode{afii57445}{0645}% -\pdfglyphtounicode{afii57446}{0646}% -\pdfglyphtounicode{afii57470}{0647}% -\pdfglyphtounicode{afii57448}{0648}% -\pdfglyphtounicode{afii57449}{0649}% -\pdfglyphtounicode{afii57450}{064A}% -\pdfglyphtounicode{afii57451}{064B}% -\pdfglyphtounicode{afii57452}{064C}% -\pdfglyphtounicode{afii57453}{064D}% -\pdfglyphtounicode{afii57454}{064E}% -\pdfglyphtounicode{afii57455}{064F}% -\pdfglyphtounicode{afii57456}{0650}% -\pdfglyphtounicode{afii57457}{0651}% -\pdfglyphtounicode{afii57458}{0652}% -\pdfglyphtounicode{afii57392}{0660}% -\pdfglyphtounicode{afii57393}{0661}% -\pdfglyphtounicode{afii57394}{0662}% -\pdfglyphtounicode{afii57395}{0663}% -\pdfglyphtounicode{afii57396}{0664}% -\pdfglyphtounicode{afii57397}{0665}% -\pdfglyphtounicode{afii57398}{0666}% -\pdfglyphtounicode{afii57399}{0667}% -\pdfglyphtounicode{afii57400}{0668}% -\pdfglyphtounicode{afii57401}{0669}% -\pdfglyphtounicode{afii57381}{066A}% -\pdfglyphtounicode{afii63167}{066D}% -\pdfglyphtounicode{afii57511}{0679}% -\pdfglyphtounicode{afii57506}{067E}% -\pdfglyphtounicode{afii57507}{0686}% -\pdfglyphtounicode{afii57512}{0688}% -\pdfglyphtounicode{afii57513}{0691}% -\pdfglyphtounicode{afii57508}{0698}% -\pdfglyphtounicode{afii57505}{06A4}% -\pdfglyphtounicode{afii57509}{06AF}% -\pdfglyphtounicode{afii57514}{06BA}% -\pdfglyphtounicode{afii57519}{06D2}% -\pdfglyphtounicode{afii57534}{06D5}% -\pdfglyphtounicode{Wgrave}{1E80}% -\pdfglyphtounicode{wgrave}{1E81}% -\pdfglyphtounicode{Wacute}{1E82}% -\pdfglyphtounicode{wacute}{1E83}% -\pdfglyphtounicode{Wdieresis}{1E84}% -\pdfglyphtounicode{wdieresis}{1E85}% -\pdfglyphtounicode{Ygrave}{1EF2}% -\pdfglyphtounicode{ygrave}{1EF3}% -\pdfglyphtounicode{afii61664}{200C}% -\pdfglyphtounicode{afii301}{200D}% -\pdfglyphtounicode{afii299}{200E}% -\pdfglyphtounicode{afii300}{200F}% -\pdfglyphtounicode{figuredash}{2012}% -\pdfglyphtounicode{endash}{2013}% -\pdfglyphtounicode{emdash}{2014}% -\pdfglyphtounicode{afii208}{2015}% -\pdfglyphtounicode{underscoredbl}{2017}% -\pdfglyphtounicode{quoteleft}{2018}% -\pdfglyphtounicode{quoteright}{2019}% -\pdfglyphtounicode{quotesinglbase}{201A}% -\pdfglyphtounicode{quotereversed}{201B}% -\pdfglyphtounicode{quotedblleft}{201C}% -\pdfglyphtounicode{quotedblright}{201D}% -\pdfglyphtounicode{quotedblbase}{201E}% -\pdfglyphtounicode{dagger}{2020}% -\pdfglyphtounicode{daggerdbl}{2021}% -\pdfglyphtounicode{bullet}{2022}% -\pdfglyphtounicode{onedotenleader}{2024}% -\pdfglyphtounicode{twodotenleader}{2025}% -\pdfglyphtounicode{ellipsis}{2026}% -\pdfglyphtounicode{afii61573}{202C}% -\pdfglyphtounicode{afii61574}{202D}% -\pdfglyphtounicode{afii61575}{202E}% -\pdfglyphtounicode{perthousand}{2030}% -\pdfglyphtounicode{minute}{2032}% -\pdfglyphtounicode{second}{2033}% -\pdfglyphtounicode{guilsinglleft}{2039}% -\pdfglyphtounicode{guilsinglright}{203A}% -\pdfglyphtounicode{exclamdbl}{203C}% -\pdfglyphtounicode{fraction}{2044}% -\pdfglyphtounicode{colonmonetary}{20A1}% -\pdfglyphtounicode{franc}{20A3}% -\pdfglyphtounicode{lira}{20A4}% -\pdfglyphtounicode{peseta}{20A7}% -\pdfglyphtounicode{afii57636}{20AA}% -\pdfglyphtounicode{dong}{20AB}% -\pdfglyphtounicode{Euro}{20AC}% -\pdfglyphtounicode{afii61248}{2105}% -\pdfglyphtounicode{Ifraktur}{2111}% -\pdfglyphtounicode{afii61289}{2113}% -\pdfglyphtounicode{afii61352}{2116}% -\pdfglyphtounicode{weierstrass}{2118}% -\pdfglyphtounicode{Rfraktur}{211C}% -\pdfglyphtounicode{prescription}{211E}% -\pdfglyphtounicode{trademark}{2122}% -\pdfglyphtounicode{Omega}{2126}% -\pdfglyphtounicode{estimated}{212E}% -\pdfglyphtounicode{aleph}{2135}% -\pdfglyphtounicode{onethird}{2153}% -\pdfglyphtounicode{twothirds}{2154}% -\pdfglyphtounicode{oneeighth}{215B}% -\pdfglyphtounicode{threeeighths}{215C}% -\pdfglyphtounicode{fiveeighths}{215D}% -\pdfglyphtounicode{seveneighths}{215E}% -\pdfglyphtounicode{arrowleft}{2190}% -\pdfglyphtounicode{arrowup}{2191}% -\pdfglyphtounicode{arrowright}{2192}% -\pdfglyphtounicode{arrowdown}{2193}% -\pdfglyphtounicode{arrowboth}{2194}% -\pdfglyphtounicode{arrowupdn}{2195}% -\pdfglyphtounicode{arrowupdnbse}{21A8}% -\pdfglyphtounicode{carriagereturn}{21B5}% -\pdfglyphtounicode{arrowdblleft}{21D0}% -\pdfglyphtounicode{arrowdblup}{21D1}% -\pdfglyphtounicode{arrowdblright}{21D2}% -\pdfglyphtounicode{arrowdbldown}{21D3}% -\pdfglyphtounicode{arrowdblboth}{21D4}% -\pdfglyphtounicode{universal}{2200}% -\pdfglyphtounicode{partialdiff}{2202}% -\pdfglyphtounicode{existential}{2203}% -\pdfglyphtounicode{emptyset}{2205}% -\pdfglyphtounicode{Delta}{2206}% -\pdfglyphtounicode{gradient}{2207}% -\pdfglyphtounicode{element}{2208}% -\pdfglyphtounicode{notelement}{2209}% -\pdfglyphtounicode{suchthat}{220B}% -\pdfglyphtounicode{product}{220F}% -\pdfglyphtounicode{summation}{2211}% -\pdfglyphtounicode{minus}{2212}% -\pdfglyphtounicode{asteriskmath}{2217}% -\pdfglyphtounicode{radical}{221A}% -\pdfglyphtounicode{proportional}{221D}% -\pdfglyphtounicode{infinity}{221E}% -\pdfglyphtounicode{orthogonal}{221F}% -\pdfglyphtounicode{angle}{2220}% -\pdfglyphtounicode{logicaland}{2227}% -\pdfglyphtounicode{logicalor}{2228}% -\pdfglyphtounicode{intersection}{2229}% -\pdfglyphtounicode{union}{222A}% -\pdfglyphtounicode{integral}{222B}% -\pdfglyphtounicode{therefore}{2234}% -\pdfglyphtounicode{similar}{223C}% -\pdfglyphtounicode{congruent}{2245}% -\pdfglyphtounicode{approxequal}{2248}% -\pdfglyphtounicode{notequal}{2260}% -\pdfglyphtounicode{equivalence}{2261}% -\pdfglyphtounicode{lessequal}{2264}% -\pdfglyphtounicode{greaterequal}{2265}% -\pdfglyphtounicode{propersubset}{2282}% -\pdfglyphtounicode{propersuperset}{2283}% -\pdfglyphtounicode{notsubset}{2284}% -\pdfglyphtounicode{reflexsubset}{2286}% -\pdfglyphtounicode{reflexsuperset}{2287}% -\pdfglyphtounicode{circleplus}{2295}% -\pdfglyphtounicode{circlemultiply}{2297}% -\pdfglyphtounicode{perpendicular}{22A5}% -\pdfglyphtounicode{dotmath}{22C5}% -\pdfglyphtounicode{house}{2302}% -\pdfglyphtounicode{revlogicalnot}{2310}% -\pdfglyphtounicode{integraltp}{2320}% -\pdfglyphtounicode{integralbt}{2321}% -\pdfglyphtounicode{angleleft}{2329}% -\pdfglyphtounicode{angleright}{232A}% -\pdfglyphtounicode{SF100000}{2500}% -\pdfglyphtounicode{SF110000}{2502}% -\pdfglyphtounicode{SF10000}{250C}% -\pdfglyphtounicode{SF30000}{2510}% -\pdfglyphtounicode{SF20000}{2514}% -\pdfglyphtounicode{SF40000}{2518}% -\pdfglyphtounicode{SF80000}{251C}% -\pdfglyphtounicode{SF90000}{2524}% -\pdfglyphtounicode{SF60000}{252C}% -\pdfglyphtounicode{SF70000}{2534}% -\pdfglyphtounicode{SF50000}{253C}% -\pdfglyphtounicode{SF430000}{2550}% -\pdfglyphtounicode{SF240000}{2551}% -\pdfglyphtounicode{SF510000}{2552}% -\pdfglyphtounicode{SF520000}{2553}% -\pdfglyphtounicode{SF390000}{2554}% -\pdfglyphtounicode{SF220000}{2555}% -\pdfglyphtounicode{SF210000}{2556}% -\pdfglyphtounicode{SF250000}{2557}% -\pdfglyphtounicode{SF500000}{2558}% -\pdfglyphtounicode{SF490000}{2559}% -\pdfglyphtounicode{SF380000}{255A}% -\pdfglyphtounicode{SF280000}{255B}% -\pdfglyphtounicode{SF270000}{255C}% -\pdfglyphtounicode{SF260000}{255D}% -\pdfglyphtounicode{SF360000}{255E}% -\pdfglyphtounicode{SF370000}{255F}% -\pdfglyphtounicode{SF420000}{2560}% -\pdfglyphtounicode{SF190000}{2561}% -\pdfglyphtounicode{SF200000}{2562}% -\pdfglyphtounicode{SF230000}{2563}% -\pdfglyphtounicode{SF470000}{2564}% -\pdfglyphtounicode{SF480000}{2565}% -\pdfglyphtounicode{SF410000}{2566}% -\pdfglyphtounicode{SF450000}{2567}% -\pdfglyphtounicode{SF460000}{2568}% -\pdfglyphtounicode{SF400000}{2569}% -\pdfglyphtounicode{SF540000}{256A}% -\pdfglyphtounicode{SF530000}{256B}% -\pdfglyphtounicode{SF440000}{256C}% -\pdfglyphtounicode{upblock}{2580}% -\pdfglyphtounicode{dnblock}{2584}% -\pdfglyphtounicode{block}{2588}% -\pdfglyphtounicode{lfblock}{258C}% -\pdfglyphtounicode{rtblock}{2590}% -\pdfglyphtounicode{ltshade}{2591}% -\pdfglyphtounicode{shade}{2592}% -\pdfglyphtounicode{dkshade}{2593}% -\pdfglyphtounicode{filledbox}{25A0}% -\pdfglyphtounicode{H22073}{25A1}% -\pdfglyphtounicode{H18543}{25AA}% -\pdfglyphtounicode{H18551}{25AB}% -\pdfglyphtounicode{filledrect}{25AC}% -\pdfglyphtounicode{triagup}{25B2}% -\pdfglyphtounicode{triagrt}{25BA}% -\pdfglyphtounicode{triagdn}{25BC}% -\pdfglyphtounicode{triaglf}{25C4}% -\pdfglyphtounicode{lozenge}{25CA}% -\pdfglyphtounicode{circle}{25CB}% -\pdfglyphtounicode{H18533}{25CF}% -\pdfglyphtounicode{invbullet}{25D8}% -\pdfglyphtounicode{invcircle}{25D9}% -\pdfglyphtounicode{openbullet}{25E6}% -\pdfglyphtounicode{smileface}{263A}% -\pdfglyphtounicode{invsmileface}{263B}% -\pdfglyphtounicode{sun}{263C}% -\pdfglyphtounicode{female}{2640}% -\pdfglyphtounicode{male}{2642}% -\pdfglyphtounicode{spade}{2660}% -\pdfglyphtounicode{club}{2663}% -\pdfglyphtounicode{heart}{2665}% -\pdfglyphtounicode{diamond}{2666}% -\pdfglyphtounicode{musicalnote}{266A}% -\pdfglyphtounicode{musicalnotedbl}{266B}% -% -\endinput diff --git a/tex/context/base/pdfr-ec.mkii b/tex/context/base/pdfr-ec.mkii new file mode 100644 index 000000000..b6604984c --- /dev/null +++ b/tex/context/base/pdfr-ec.mkii @@ -0,0 +1,145 @@ +%D \module +%D [ file=pdfr-ec, +%D version=2005.07.27, +%D title=\CONTEXT\ PDF Font Resources, +%D subtitle=EC encoding, +%D author={Vladimir Volovich / Taco Hoekwater}, +%D date=\currentdate, +%D copyright={PRAGMA / 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 vector is derived (but reformatted a bit) from +%D the one in \LaTeX's CMap package + +\startpdffontresource[ec] +/CIDInit /ProcSet findresource begin +12 dict begin + begincmap + /CIDSystemInfo + << /Registry (TeX) + /Ordering (T1) + /Supplement 0 + >> def + /CMapName /TeX-T1-0 def + /CMapType 2 def + 1 begincodespacerange + <00> + endcodespacerange + 10 beginbfrange + <0E> <0F> <2039> + <10> <12> <201C> + <15> <16> <2013> + <21> <26> <0021> + <28> <5F> <0028> + <61> <7E> <0061> + <00C0> + <00D8> + <00E0> + <00F8> + endbfrange + 95 beginbfchar + <00> <0060> + <01> <00B4> + <02> <02C6> + <03> <02DC> + <04> <00A8> + <05> <02DD> + <06> <02DA> + <07> <02C7> + <08> <02D8> + <09> <00AF> + <0A> <02D9> + <0B> <00B8> + <0C> <02DB> + <0D> <201A> + <13> <00AB> + <14> <00BB> + <17> <200C> + <19> <0131> + <1B> <00660066> + <1C> <00660069> + <1D> <0066006C> + <1E> <006600660069> + <1F> <00660066006C> + <20> <2423> + <27> <2019> + <60> <2018> + <7F> <002D> + <80> <0102> + <81> <0104> + <82> <0106> + <83> <010C> + <84> <010E> + <85> <011A> + <86> <0118> + <87> <011E> + <88> <0139> + <89> <013D> + <8A> <0141> + <8B> <0143> + <8C> <0147> + <8D> <014A> + <8E> <0150> + <8F> <0154> + <90> <0158> + <91> <015A> + <92> <0160> + <93> <015E> + <94> <0164> + <95> <021A> + <96> <0170> + <97> <016E> + <98> <0178> + <99> <0179> + <9A> <017D> + <9B> <017B> + <9C> <0132> + <9D> <0130> + <9E> <0111> + <9F> <00A7> + <0103> + <0105> + <0107> + <010D> + <010F> + <011B> + <0119> + <011F> + <013A> + <013E> + <0142> + <0144> + <0148> + <014B> + <0151> + <0155> + <0159> + <015B> + <0161> + <015F> + <0165> + <021B> + <0171> + <016F> + <00FF> + <017A> + <017E> + <017C> + <0133> + <00A1> + <00BF> + <00A3> + <0152> + <00530053> + <0153> + <00DF> + endbfchar + endcmap +CMapName currentdict /CMap defineresource pop end +end +\stoppdffontresource + +\endinput diff --git a/tex/context/base/pdfr-ec.tex b/tex/context/base/pdfr-ec.tex deleted file mode 100644 index b6604984c..000000000 --- a/tex/context/base/pdfr-ec.tex +++ /dev/null @@ -1,145 +0,0 @@ -%D \module -%D [ file=pdfr-ec, -%D version=2005.07.27, -%D title=\CONTEXT\ PDF Font Resources, -%D subtitle=EC encoding, -%D author={Vladimir Volovich / Taco Hoekwater}, -%D date=\currentdate, -%D copyright={PRAGMA / 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 vector is derived (but reformatted a bit) from -%D the one in \LaTeX's CMap package - -\startpdffontresource[ec] -/CIDInit /ProcSet findresource begin -12 dict begin - begincmap - /CIDSystemInfo - << /Registry (TeX) - /Ordering (T1) - /Supplement 0 - >> def - /CMapName /TeX-T1-0 def - /CMapType 2 def - 1 begincodespacerange - <00> - endcodespacerange - 10 beginbfrange - <0E> <0F> <2039> - <10> <12> <201C> - <15> <16> <2013> - <21> <26> <0021> - <28> <5F> <0028> - <61> <7E> <0061> - <00C0> - <00D8> - <00E0> - <00F8> - endbfrange - 95 beginbfchar - <00> <0060> - <01> <00B4> - <02> <02C6> - <03> <02DC> - <04> <00A8> - <05> <02DD> - <06> <02DA> - <07> <02C7> - <08> <02D8> - <09> <00AF> - <0A> <02D9> - <0B> <00B8> - <0C> <02DB> - <0D> <201A> - <13> <00AB> - <14> <00BB> - <17> <200C> - <19> <0131> - <1B> <00660066> - <1C> <00660069> - <1D> <0066006C> - <1E> <006600660069> - <1F> <00660066006C> - <20> <2423> - <27> <2019> - <60> <2018> - <7F> <002D> - <80> <0102> - <81> <0104> - <82> <0106> - <83> <010C> - <84> <010E> - <85> <011A> - <86> <0118> - <87> <011E> - <88> <0139> - <89> <013D> - <8A> <0141> - <8B> <0143> - <8C> <0147> - <8D> <014A> - <8E> <0150> - <8F> <0154> - <90> <0158> - <91> <015A> - <92> <0160> - <93> <015E> - <94> <0164> - <95> <021A> - <96> <0170> - <97> <016E> - <98> <0178> - <99> <0179> - <9A> <017D> - <9B> <017B> - <9C> <0132> - <9D> <0130> - <9E> <0111> - <9F> <00A7> - <0103> - <0105> - <0107> - <010D> - <010F> - <011B> - <0119> - <011F> - <013A> - <013E> - <0142> - <0144> - <0148> - <014B> - <0151> - <0155> - <0159> - <015B> - <0161> - <015F> - <0165> - <021B> - <0171> - <016F> - <00FF> - <017A> - <017E> - <017C> - <0133> - <00A1> - <00BF> - <00A3> - <0152> - <00530053> - <0153> - <00DF> - endbfchar - endcmap -CMapName currentdict /CMap defineresource pop end -end -\stoppdffontresource - -\endinput diff --git a/tex/context/base/pdfr-il2.mkii b/tex/context/base/pdfr-il2.mkii new file mode 100644 index 000000000..70bcb25da --- /dev/null +++ b/tex/context/base/pdfr-il2.mkii @@ -0,0 +1,233 @@ +%D \module +%D [ file=pdfr-il2, +%D version=2000.12.10, +%D title=\CONTEXT\ PDF Font Resources, +%D subtitle=ISO Latin 2, +%D author={Ondrej Koala Vacha, Hans Hagen}, +%D date=\currentdate, +%D copyright={PRAGMA / 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 vector is derived (but reformatted a bit) from a +%D sample send to me by Petr Ferdus. There was some Czech +%D comment in which I could recognize the name of Ondrej +%D Koala Vacha. More information on setting up such a vector +%D can be found in the \PDF\ reference manual. + +\startpdffontresource[il2] +/CIDInit /ProcSet findresource begin +12 dict begin + begincmap + /CIDSystemInfo + << /Registry (Adobe) + /Ordering (T1UV) + /Supplement 0 + >> def + /CMapName /Adobe-Identity-UCS def + /CMapType 1 def + 1 begincodespacerange + <00> + endcodespacerange + %%FontSpecificEncoding + 191 beginbfrange + <20> <20> <0020> % space dec: 32 oct:040 hex:20 + <21> <21> <0021> % exclam dec: 33 oct:041 hex:21 + <22> <22> <0022> % quotedbl dec: 34 oct:042 hex:22 + <23> <23> <0023> % numbersign dec: 35 oct:043 hex:23 + <24> <24> <0024> % dollar dec: 36 oct:044 hex:24 + <25> <25> <0025> % percent dec: 37 oct:045 hex:25 + <26> <26> <0026> % ampersand dec: 38 oct:046 hex:26 + <27> <27> <0027> % quotesingle dec: 39 oct:047 hex:27 + <28> <28> <0028> % parenleft dec: 40 oct:050 hex:28 + <29> <29> <0029> % parenright dec: 41 oct:051 hex:29 + <2a> <2a> <002a> % asterisk dec: 42 oct:052 hex:2a + <2b> <2b> <002b> % plus dec: 43 oct:053 hex:2b + <2c> <2c> <002c> % comma dec: 44 oct:054 hex:2c + <2d> <2d> <002d> % hyphen dec: 45 oct:055 hex:2d + <2e> <2e> <002e> % period dec: 46 oct:056 hex:2e + <2f> <2f> <002f> % slash dec: 47 oct:057 hex:2f + <30> <30> <0030> % zero dec: 48 oct:060 hex:30 + <31> <31> <0031> % one dec: 49 oct:061 hex:31 + <32> <32> <0032> % two dec: 50 oct:062 hex:32 + <33> <33> <0033> % three dec: 51 oct:063 hex:33 + <34> <34> <0034> % four dec: 52 oct:064 hex:34 + <35> <35> <0035> % five dec: 53 oct:065 hex:35 + <36> <36> <0036> % six dec: 54 oct:066 hex:36 + <37> <37> <0037> % seven dec: 55 oct:067 hex:37 + <38> <38> <0038> % eight dec: 56 oct:070 hex:38 + <39> <39> <0039> % nine dec: 57 oct:071 hex:39 + <3a> <3a> <003a> % colon dec: 58 oct:072 hex:3a + <3b> <3b> <003b> % semicolon dec: 59 oct:073 hex:3b + <3c> <3c> <003c> % less dec: 60 oct:074 hex:3c + <3d> <3d> <003d> % equal dec: 61 oct:075 hex:3d + <3e> <3e> <003e> % greater dec: 62 oct:076 hex:3e + <3f> <3f> <003f> % question dec: 63 oct:077 hex:3f + <40> <40> <0040> % at dec: 64 oct:100 hex:40 + <41> <41> <0041> % A dec: 65 oct:101 hex:41 + <42> <42> <0042> % B dec: 66 oct:102 hex:42 + <43> <43> <0043> % C dec: 67 oct:103 hex:43 + <44> <44> <0044> % D dec: 68 oct:104 hex:44 + <45> <45> <0045> % E dec: 69 oct:105 hex:45 + <46> <46> <0046> % F dec: 70 oct:106 hex:46 + <47> <47> <0047> % G dec: 71 oct:107 hex:47 + <48> <48> <0048> % H dec: 72 oct:110 hex:48 + <49> <49> <0049> % I dec: 73 oct:111 hex:49 + <4a> <4a> <004a> % J dec: 74 oct:112 hex:4a + <4b> <4b> <004b> % K dec: 75 oct:113 hex:4b + <4c> <4c> <004c> % L dec: 76 oct:114 hex:4c + <4d> <4d> <004d> % M dec: 77 oct:115 hex:4d + <4e> <4e> <004e> % N dec: 78 oct:116 hex:4e + <4f> <4f> <004f> % O dec: 79 oct:117 hex:4f + <50> <50> <0050> % P dec: 80 oct:120 hex:50 + <51> <51> <0051> % Q dec: 81 oct:121 hex:51 + <52> <52> <0052> % R dec: 82 oct:122 hex:52 + <53> <53> <0053> % S dec: 83 oct:123 hex:53 + <54> <54> <0054> % T dec: 84 oct:124 hex:54 + <55> <55> <0055> % U dec: 85 oct:125 hex:55 + <56> <56> <0056> % V dec: 86 oct:126 hex:56 + <57> <57> <0057> % W dec: 87 oct:127 hex:57 + <58> <58> <0058> % X dec: 88 oct:130 hex:58 + <59> <59> <0059> % Y dec: 89 oct:131 hex:59 + <5a> <5a> <005a> % Z dec: 90 oct:132 hex:5a + <5b> <5b> <005b> % bracketleft dec: 91 oct:133 hex:5b + <5c> <5c> <005c> % backslash dec: 92 oct:134 hex:5c + <5d> <5d> <005d> % bracketright dec: 93 oct:135 hex:5d + <5e> <5e> <005e> % asciicircum dec: 94 oct:136 hex:5e + <5f> <5f> <005f> % underscore dec: 95 oct:137 hex:5f + <60> <60> <0060> % grave dec: 96 oct:140 hex:60 + <61> <61> <0061> % a dec: 97 oct:141 hex:61 + <62> <62> <0062> % b dec: 98 oct:142 hex:62 + <63> <63> <0063> % c dec: 99 oct:143 hex:63 + <64> <64> <0064> % d dec:100 oct:144 hex:64 + <65> <65> <0065> % e dec:101 oct:145 hex:65 + <66> <66> <0066> % f dec:102 oct:146 hex:66 + <67> <67> <0067> % g dec:103 oct:147 hex:67 + <68> <68> <0068> % h dec:104 oct:150 hex:68 + <69> <69> <0069> % i dec:105 oct:151 hex:69 + <6a> <6a> <006a> % j dec:106 oct:152 hex:6a + <6b> <6b> <006b> % k dec:107 oct:153 hex:6b + <6c> <6c> <006c> % l dec:108 oct:154 hex:6c + <6d> <6d> <006d> % m dec:109 oct:155 hex:6d + <6e> <6e> <006e> % n dec:110 oct:156 hex:6e + <6f> <6f> <006f> % o dec:111 oct:157 hex:6f + <70> <70> <0070> % p dec:112 oct:160 hex:70 + <71> <71> <0071> % q dec:113 oct:161 hex:71 + <72> <72> <0072> % r dec:114 oct:162 hex:72 + <73> <73> <0073> % s dec:115 oct:163 hex:73 + <74> <74> <0074> % t dec:116 oct:164 hex:74 + <75> <75> <0075> % u dec:117 oct:165 hex:75 + <76> <76> <0076> % v dec:118 oct:166 hex:76 + <77> <77> <0077> % w dec:119 oct:167 hex:77 + <78> <78> <0078> % x dec:120 oct:170 hex:78 + <79> <79> <0079> % y dec:121 oct:171 hex:79 + <7a> <7a> <007a> % z dec:122 oct:172 hex:7a + <7b> <7b> <007b> % braceleft dec:123 oct:173 hex:7b + <7c> <7c> <007c> % bar dec:124 oct:174 hex:7c + <7d> <7d> <007d> % braceright dec:125 oct:175 hex:7d + <7e> <7e> <007e> % asciitilde dec:126 oct:176 hex:7e + <00a0> % nbspace dec:160 oct:240 hex:a0 + <0104> % Aogonek dec:161 oct:241 hex:a1 + <00a2> % breve dec:162 oct:242 hex:a2 + <00a3> % Lslash dec:163 oct:243 hex:a3 + <00a4> % currency dec:164 oct:244 hex:a4 + <013d> % Lcaron dec:165 oct:245 hex:a5 + <015a> % Sacute dec:166 oct:246 hex:a6 + <00a7> % section dec:167 oct:247 hex:a7 + <00a8> % dieresis dec:168 oct:250 hex:a8 + <0160> % Scaron dec:169 oct:251 hex:a9 + <015e> % Scedilla dec:170 oct:252 hex:aa + <0164> % Tcaron dec:171 oct:253 hex:ab + <0179> % Zacute dec:172 oct:254 hex:ac + <00ad> % sfthyphen dec:173 oct:255 hex:ad + <017d> % Zcaron dec:174 oct:256 hex:ae + <00af> % Zdotaccent dec:175 oct:257 hex:af + <00b0> % ring dec:176 oct:260 hex:b0 + <0105> % aogonek dec:177 oct:261 hex:b1 + <00b2> % ogonek dec:178 oct:262 hex:b2 + <00b3> % lslash dec:179 oct:263 hex:b3 + <00b4> % acute dec:180 oct:264 hex:b4 + <013e> % lcaron dec:181 oct:265 hex:b5 + <015b> % sacute dec:182 oct:266 hex:b6 + <00b7> % caron dec:183 oct:267 hex:b7 + <00b8> % cedilla dec:184 oct:270 hex:b8 + <0161> % scaron dec:185 oct:271 hex:b9 + <015f> % scedilla dec:186 oct:272 hex:ba + <0165> % tcaron dec:187 oct:273 hex:bb + <017a> % zacute dec:188 oct:274 hex:bc + <00bd> % hungarumlaut dec:189 oct:275 hex:bd + <017e> % zcaron dec:190 oct:276 hex:be + <00bf> % zdotaccent dec:191 oct:277 hex:bf + <0154> % Racute dec:192 oct:300 hex:c0 + <00c1> % Aacute dec:193 oct:301 hex:c1 + <00c2> % Acircumflex dec:194 oct:302 hex:c2 + <0102> % Abreve dec:195 oct:303 hex:c3 + <00c4> % Adieresis dec:196 oct:304 hex:c4 + <0139> % Lacute dec:197 oct:305 hex:c5 + <0106> % Cacute dec:198 oct:306 hex:c6 + <00c7> % Ccedilla dec:199 oct:307 hex:c7 + <010c> % Ccaron dec:200 oct:310 hex:c8 + <00c9> % Eacute dec:201 oct:311 hex:c9 + <0118> % Eogonek dec:202 oct:312 hex:ca + <00cb> % Edieresis dec:203 oct:313 hex:cb + <011a> % Ecaron dec:204 oct:314 hex:cc + <00cd> % Iacute dec:205 oct:315 hex:cd + <00ce> % Icircumflex dec:206 oct:316 hex:ce + <010e> % Dcaron dec:207 oct:317 hex:cf + <00d0> % Dslash dec:208 oct:320 hex:d0 + <0143> % Nacute dec:209 oct:321 hex:d1 + <0147> % Ncaron dec:210 oct:322 hex:d2 + <00d3> % Oacute dec:211 oct:323 hex:d3 + <00d4> % Ocircumflex dec:212 oct:324 hex:d4 + <00d5> % Ohungarumlaut dec:213 oct:325 hex:d5 + <00d6> % Odieresis dec:214 oct:326 hex:d6 + <00d7> % multiply dec:215 oct:327 hex:d7 + <0158> % Rcaron dec:216 oct:330 hex:d8 + <016e> % Uring dec:217 oct:331 hex:d9 + <00da> % Uacute dec:218 oct:332 hex:da + <00db> % Uhungarumlaut dec:219 oct:333 hex:db + <00dc> % Udieresis dec:220 oct:334 hex:dc +
<00dd> % Yacute dec:221 oct:335 hex:dd + <00de> % Tcommaaccent dec:222 oct:336 hex:de + <00df> % germandbls dec:223 oct:337 hex:df + <0155> % racute dec:224 oct:340 hex:e0 + <00e1> % aacute dec:225 oct:341 hex:e1 + <00e2> % acircumflex dec:226 oct:342 hex:e2 + <0103> % abreve dec:227 oct:343 hex:e3 + <00e4> % adieresis dec:228 oct:344 hex:e4 + <013a> % lacute dec:229 oct:345 hex:e5 + <0107> % cacute dec:230 oct:346 hex:e6 + <00e7> % ccedilla dec:231 oct:347 hex:e7 + <010d> % ccaron dec:232 oct:350 hex:e8 + <00e9> % eacute dec:233 oct:351 hex:e9 + <0119> % eogonek dec:234 oct:352 hex:ea + <00eb> % edieresis dec:235 oct:353 hex:eb + <011b> % ecaron dec:236 oct:354 hex:ec + <00ed> % iacute dec:237 oct:355 hex:ed + <00ee> % icircumflex dec:238 oct:356 hex:ee + <010f> % dcaron dec:239 oct:357 hex:ef + <00f0> % dmacron dec:240 oct:360 hex:f0 + <0144> % nacute dec:241 oct:361 hex:f1 + <0148> % ncaron dec:242 oct:362 hex:f2 + <00f3> % oacute dec:243 oct:363 hex:f3 + <00f4> % ocircumflex dec:244 oct:364 hex:f4 + <00f5> % ohungarumlaut dec:245 oct:365 hex:f5 + <00f6> % odieresis dec:246 oct:366 hex:f6 + <00f7> % divide dec:247 oct:367 hex:f7 + <0159> % rcaron dec:248 oct:370 hex:f8 + <016f> % uring dec:249 oct:371 hex:f9 + <00fa> % uacute dec:250 oct:372 hex:fa + <00fb> % uhungarumlaut dec:251 oct:373 hex:fb + <00fc> % udieresis dec:252 oct:374 hex:fc + <00fd> % yacute dec:253 oct:375 hex:fd + <00fe> % tcommaaccent dec:254 oct:376 hex:fe + <00ff> % dotaccent dec:255 oct:377 hex:ff + endbfrange + endcmap +CMapName currentdict /CMap defineresource pop end +end +\stoppdffontresource + +\endinput diff --git a/tex/context/base/prop-ini.mkiv b/tex/context/base/prop-ini.mkiv index 2320f1069..c5df391a7 100644 --- a/tex/context/base/prop-ini.mkiv +++ b/tex/context/base/prop-ini.mkiv @@ -93,7 +93,7 @@ \expandafter\newcount\csname\??py:l:#2\endcsname % current level \expandafter\newcount\csname\??py:p:#2\endcsname % previous level \global\csname\??py:p:#2\endcsname\minusone - \global\expandafter\expandafter\let\csname\??py:c:0\endcsname\empty + \global\expandafter\let\csname\??py:c:0\endcsname\empty \fi \letgvalue{\??py\s!check#1}\docheckproperty \doifelsevalue{\??py#1\c!method}\v!command @@ -130,9 +130,9 @@ \def\propertyparameter#1#2% expands to #1 when not defined (see \define...) {\csname\??py \ifcsname\??py#1#2\endcsname - #1#2% + #1#2% \else\ifcsname\??py\csname\??py#1\c!type\endcsname#2\endcsname - \csname\??py#1\c!type\endcsname#2% + \csname\??py#1\c!type\endcsname#2% \else \s!empty \fi\fi @@ -142,7 +142,7 @@ {\propertyparameter\currentproperty} \def\checkedpropertyparameter#1% only self - {\executeifdefined{\??py\currentproperty#1}} + {\ifcsname\??py\currentproperty#1\endcsname\csname\??py\currentproperty#1\endcsname\fi} \def\definepropertyhandler#1{\setvalue{\??py*#1}} \def\propertyhandler #1{\getvalue{\??py*#1}} diff --git a/tex/context/base/prop-lay.mkiv b/tex/context/base/prop-lay.mkiv index 0cd4bc2c8..a34a71632 100644 --- a/tex/context/base/prop-lay.mkiv +++ b/tex/context/base/prop-lay.mkiv @@ -25,56 +25,33 @@ \unprotect -\let\currentlayerproperty\empty +% will be redone ... no longer using property mechanism (less clashes) + +\let\currentviewerlayer\empty + +\appendtoks + \let\currentviewerlayer\empty +\to \everypagebody \def\startlayerproperty - {\let\currentlayerproperty\currentproperty + {\pushmacro\currentviewerlayer % grouped (used in interaction) + \let\currentlayerproperty\currentproperty % can be cross group \dotriggerviewerlayer\currentlayerproperty} \def\stoplayerproperty - {\let\currentlayerproperty\previousproperty + {\popmacro\currentviewerlayer % grouped (used in interaction) + \let\currentlayerproperty\previousproperty % can be cross group \dotriggerviewerlayer\currentlayerproperty} \def\checklayerproperty % could be made more clever - {\doifelse{\checkedpropertyparameter\v!printable\currentproperty}\v!no - {\def\printviewerlayer{0}} - {\def\printviewerlayer{1}}% - \registerviewerlayer\currentproperty\currentproperty - \dodefineviewerlayer - \currentproperty % tag - {\checkedpropertyparameter\c!title\currentproperty}% - {\checkedpropertyparameter\c!state\v!start}% visible or hidden - {0}% type (1=frozen) - {\printviewerlayer}}% 1=printable - -\def\domakelayerpropertylist - {\iflocation - \expandafter\domakeviewerlayerlist - \else - \expandafter\gobbleoneargument - \fi} - -\ifdefined\setglobalsystemreference - - \setglobalsystemreference \rt!exec \v!HideLayer {hidelayer} - \setglobalsystemreference \rt!exec \v!VideLayer {videlayer} - \setglobalsystemreference \rt!exec \v!ToggleLayer {togglelayer} - - \setexecutecommandcheck {hidelayer} \domakelayerpropertylist - \setexecutecommandcheck {videlayer} \domakelayerpropertylist - \setexecutecommandcheck {togglelayer} \domakelayerpropertylist - -\else - - % todo, but after a full split (saves dev time) - -\fi - -% \currentlayerproperty -% \checklayerproperty -% \startlayerproperty -% \stoplayerproperty -% \domakelayerpropertylist + {\registerviewerlayer\currentproperty\currentproperty + \ctxlua{backends.codeinjections.defineviewerlayer{ + tag = "\currentproperty", + title = "\checkedpropertyparameter\c!title\currentproperty", + visible = "\checkedpropertyparameter\c!state\v!start", + kind = 0, % 1 == frozen + printable = "\checkedpropertyparameter\v!printable\v!yes" % v! looks wrong + }}} %D \starttext %D @@ -118,42 +95,48 @@ %D %D \stoptext -%D Handy for tracing: - -\def\showlayoutcomponents - {\let\startlayoutcomponent\dostartlayoutcomponent - \let\stoplayoutcomponent \dostoplayoutcomponent} - -\def\dodefinelayoutcomponent#1#2% - {\doifelsenothing{#2}% - {\defineproperty[#1][\s!layer]}% - {\defineproperty[#1][\s!layer][\c!title=#2]}} +\def\doinitializelayoutcomponent#1#2% + {\ctxlua{backends.codeinjections.defineviewerlayer{ + tag = "#1:#2", + title = "#1 #2", + visible = "\v!start", + kind = 0, % 1 == frozen + printable = "\v!yes" + }}% + \edef\layoutcomponentboxattribute{attr \viewerlayerattribute \ctxlua{tex.write(viewerlayers.register('#1:#2'))} }% + \expandafter\glet\csname\??ly>#1:#2\endcsname\layoutcomponentboxattribute} + +\def\dosetlayoutcomponentattribute#1#2% make this faster + {\expandafter\let\expandafter\layoutcomponentboxattribute\csname\??ly>#1:#2\endcsname + \ifx\layoutcomponentboxattribute\relax + \doinitializelayoutcomponent{#1}{#2}% get rid of { } + \fi} -\def\dostartlayoutcomponent#1#2% - {\doifelseproperty{#1}\donothing{\dodefinelayoutcomponent{#1}{#2}}% - \startproperty[#1]} +\def\doresetlayoutcomponentattribute + {\let\layoutcomponentboxattribute\empty} -\def\dostoplayoutcomponent - {\stopproperty} +\let\startlayoutcomponent \gobbletwoarguments % obsolete +\let\stoplayoutcomponent \relax % obsolete +\let\setlayoutcomponentattribute \gobbletwoarguments +\let\resetlayoutcomponentattribute\relax +\let\layoutcomponentboxattribute \empty -\let\startlayoutcomponent\gobbletwoarguments -\let\stoplayoutcomponent \relax +\def\showlayoutcomponents + {\ctxlua{viewerlayers.enabled=true}% + \let\setlayoutcomponentattribute \dosetlayoutcomponentattribute + \let\resetlayoutcomponentattribute\doresetlayoutcomponentattribute} \protect \endinput -% \def\remaplayering -% {\dodoubleargument\doremaplayering} -% -% \def\remaplayering[#1][#2]% -% {\setvalue{\??lm#1}{#2}} -% -% \def\remappedlayering#1% -% {\ifcsname\??lm#1\endcsname -% \@EA\remappedlayering\csname\??lm#1\endcsname\else#1% -% \fi} -% -% \def\startshowlayering#1#2% -% {\ifshowlayering -% \defineproperty[\remappedlayering{#1}][\s!layer][\c!titel=#2]% -% \startproperty[\remappedlayering{#1}]% -% \fi} +% \starttext +% \showlayoutcomponents +% \setupinteraction[state=start] +% \setupheadertexts[{\goto{page 1}[page(2)]}] +% test \setlayoutcomponentattribute{test}{aap}\hbox \layoutcomponentboxattribute \bgroup aap +% \setlayoutcomponentattribute{test}{noot}\hbox \layoutcomponentboxattribute \bgroup noot +% \setlayoutcomponentattribute{test}{mies}\hbox \layoutcomponentboxattribute \bgroup mies +% \egroup noot \egroup aap \egroup +% test \setlayoutcomponentattribute{test}{hans}\hbox \layoutcomponentboxattribute \bgroup aap \hbox{!} aap\egroup +% test \page test \page +% \stoptext + diff --git a/tex/context/base/regi-8859-1.mkii b/tex/context/base/regi-8859-1.mkii new file mode 100644 index 000000000..c291b029a --- /dev/null +++ b/tex/context/base/regi-8859-1.mkii @@ -0,0 +1,154 @@ +%D \module +%D [ file=regi-8859-1, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-1 (West European), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-1/Latin1 input encoding (regime) for West European languages, +%D see also cp1252 and iso-8859-15 (includes Euro). +%D +%D (Contributors to the original file: Daniel Flipo, Hans Hagen \& Denis Roegel.) +%D +%D Usage: \type{\enableregime[8859-1]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[8859-1] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK +\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\textmacron} % 00AF MACRON +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA +\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE +\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER +\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF +\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS +\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK +\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA +\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS +\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH +\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE +\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE +\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE +\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE +\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA +\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS +\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH +\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE +\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE +\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE +\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN +\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS + +\stopregime + diff --git a/tex/context/base/regi-8859-1.tex b/tex/context/base/regi-8859-1.tex deleted file mode 100644 index c291b029a..000000000 --- a/tex/context/base/regi-8859-1.tex +++ /dev/null @@ -1,154 +0,0 @@ -%D \module -%D [ file=regi-8859-1, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-1 (West European), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-1/Latin1 input encoding (regime) for West European languages, -%D see also cp1252 and iso-8859-15 (includes Euro). -%D -%D (Contributors to the original file: Daniel Flipo, Hans Hagen \& Denis Roegel.) -%D -%D Usage: \type{\enableregime[8859-1]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[8859-1] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK -\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\textmacron} % 00AF MACRON -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA -\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE -\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER -\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF -\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS -\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK -\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE -\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA -\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS -\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH -\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE -\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE -\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE -\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE -\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA -\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS -\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH -\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE -\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE -\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE -\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN -\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS - -\stopregime - diff --git a/tex/context/base/regi-8859-10.mkii b/tex/context/base/regi-8859-10.mkii new file mode 100644 index 000000000..79d74d952 --- /dev/null +++ b/tex/context/base/regi-8859-10.mkii @@ -0,0 +1,152 @@ +%D \module +%D [ file=regi-8859-10, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-10 (Nordic), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-10/Latin6 input encoding (regime) for Nordic languages. +%D +%D Usage: \type{\enableregime[8859-10]} (see \type {regi-syn} for +%D alternatives calls). + + +\startregime[iso-8859-10] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK +\defineactivetoken 162 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON +\defineactivetoken 163 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA +\defineactivetoken 164 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON +\defineactivetoken 165 {\Itilde} % 0128 LATIN CAPITAL LETTER I WITH TILDE +\defineactivetoken 166 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA +\defineactivetoken 169 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE +\defineactivetoken 170 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 171 {\Tstroke} % 0166 LATIN CAPITAL LETTER T WITH STROKE +\defineactivetoken 172 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON +\defineactivetoken 175 {\Neng} % 014A LATIN CAPITAL LETTER ENG +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK +\defineactivetoken 178 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON +\defineactivetoken 179 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA +\defineactivetoken 180 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON +\defineactivetoken 181 {\itilde} % 0129 LATIN SMALL LETTER I WITH TILDE +\defineactivetoken 182 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA +\defineactivetoken 185 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE +\defineactivetoken 186 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 187 {\tstroke} % 0167 LATIN SMALL LETTER T WITH STROKE +\defineactivetoken 188 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON +\defineactivetoken 189 {\texthorizontalbar} % 2015 HORIZONTAL BAR +\defineactivetoken 190 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON +\defineactivetoken 191 {\neng} % 014B LATIN SMALL LETTER ENG +\defineactivetoken 192 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 199 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK +\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS +\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH +\defineactivetoken 209 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA +\defineactivetoken 210 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\Utilde} % 0168 LATIN CAPITAL LETTER U WITH TILDE +\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE +\defineactivetoken 217 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE +\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE +\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 231 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK +\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS +\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH +\defineactivetoken 241 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA +\defineactivetoken 242 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\utilde} % 0169 LATIN SMALL LETTER U WITH TILDE +\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE +\defineactivetoken 249 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE +\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN +\defineactivetoken 255 {\kkra} % 0138 LATIN SMALL LETTER KRA + +\stopregime + diff --git a/tex/context/base/regi-8859-10.tex b/tex/context/base/regi-8859-10.tex deleted file mode 100644 index 79d74d952..000000000 --- a/tex/context/base/regi-8859-10.tex +++ /dev/null @@ -1,152 +0,0 @@ -%D \module -%D [ file=regi-8859-10, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-10 (Nordic), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-10/Latin6 input encoding (regime) for Nordic languages. -%D -%D Usage: \type{\enableregime[8859-10]} (see \type {regi-syn} for -%D alternatives calls). - - -\startregime[iso-8859-10] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK -\defineactivetoken 162 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON -\defineactivetoken 163 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA -\defineactivetoken 164 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON -\defineactivetoken 165 {\Itilde} % 0128 LATIN CAPITAL LETTER I WITH TILDE -\defineactivetoken 166 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA -\defineactivetoken 169 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE -\defineactivetoken 170 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 171 {\Tstroke} % 0166 LATIN CAPITAL LETTER T WITH STROKE -\defineactivetoken 172 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON -\defineactivetoken 175 {\Neng} % 014A LATIN CAPITAL LETTER ENG -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK -\defineactivetoken 178 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON -\defineactivetoken 179 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA -\defineactivetoken 180 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON -\defineactivetoken 181 {\itilde} % 0129 LATIN SMALL LETTER I WITH TILDE -\defineactivetoken 182 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA -\defineactivetoken 185 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE -\defineactivetoken 186 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 187 {\tstroke} % 0167 LATIN SMALL LETTER T WITH STROKE -\defineactivetoken 188 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON -\defineactivetoken 189 {\texthorizontalbar} % 2015 HORIZONTAL BAR -\defineactivetoken 190 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON -\defineactivetoken 191 {\neng} % 014B LATIN SMALL LETTER ENG -\defineactivetoken 192 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE -\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 199 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK -\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS -\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH -\defineactivetoken 209 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA -\defineactivetoken 210 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\Utilde} % 0168 LATIN CAPITAL LETTER U WITH TILDE -\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE -\defineactivetoken 217 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE -\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE -\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 231 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK -\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS -\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH -\defineactivetoken 241 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA -\defineactivetoken 242 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\utilde} % 0169 LATIN SMALL LETTER U WITH TILDE -\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE -\defineactivetoken 249 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE -\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN -\defineactivetoken 255 {\kkra} % 0138 LATIN SMALL LETTER KRA - -\stopregime - diff --git a/tex/context/base/regi-8859-13.mkii b/tex/context/base/regi-8859-13.mkii new file mode 100644 index 000000000..a6dbe376f --- /dev/null +++ b/tex/context/base/regi-8859-13.mkii @@ -0,0 +1,152 @@ +%D \module +%D [ file=regi-8859-13, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-13 (Baltic), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-13/Latin7 input encoding (regime) for Baltic languages, +%D see also iso-8859-4 and cp1257. +%D +%D Usage: \type{\enableregime[8859-13]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[iso-8859-13] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK +\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\Rcommaaccent} % 0156 LATIN CAPITAL LETTER R WITH CEDILLA +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE +\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE +\defineactivetoken 186 {\rcommaaccent} % 0157 LATIN SMALL LETTER R WITH CEDILLA +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER +\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF +\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS +\defineactivetoken 191 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 192 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK +\defineactivetoken 193 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK +\defineactivetoken 194 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON +\defineactivetoken 195 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +\defineactivetoken 198 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK +\defineactivetoken 199 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON +\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE +\defineactivetoken 203 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE +\defineactivetoken 204 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA +\defineactivetoken 205 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA +\defineactivetoken 206 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON +\defineactivetoken 207 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA +\defineactivetoken 208 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE +\defineactivetoken 210 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON +\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK +\defineactivetoken 217 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE +\defineactivetoken 218 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE +\defineactivetoken 219 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE +\defineactivetoken 222 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK +\defineactivetoken 225 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK +\defineactivetoken 226 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON +\defineactivetoken 227 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE +\defineactivetoken 230 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK +\defineactivetoken 231 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON +\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE +\defineactivetoken 235 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE +\defineactivetoken 236 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA +\defineactivetoken 237 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA +\defineactivetoken 238 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON +\defineactivetoken 239 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA +\defineactivetoken 240 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE +\defineactivetoken 242 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK +\defineactivetoken 249 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE +\defineactivetoken 250 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE +\defineactivetoken 251 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE +\defineactivetoken 254 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON +\defineactivetoken 255 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK + +\stopregime + diff --git a/tex/context/base/regi-8859-13.tex b/tex/context/base/regi-8859-13.tex deleted file mode 100644 index a6dbe376f..000000000 --- a/tex/context/base/regi-8859-13.tex +++ /dev/null @@ -1,152 +0,0 @@ -%D \module -%D [ file=regi-8859-13, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-13 (Baltic), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-13/Latin7 input encoding (regime) for Baltic languages, -%D see also iso-8859-4 and cp1257. -%D -%D Usage: \type{\enableregime[8859-13]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[iso-8859-13] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK -\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\Rcommaaccent} % 0156 LATIN CAPITAL LETTER R WITH CEDILLA -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE -\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE -\defineactivetoken 186 {\rcommaaccent} % 0157 LATIN SMALL LETTER R WITH CEDILLA -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER -\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF -\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS -\defineactivetoken 191 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 192 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK -\defineactivetoken 193 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK -\defineactivetoken 194 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON -\defineactivetoken 195 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE -\defineactivetoken 198 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK -\defineactivetoken 199 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON -\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE -\defineactivetoken 203 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE -\defineactivetoken 204 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA -\defineactivetoken 205 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA -\defineactivetoken 206 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON -\defineactivetoken 207 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA -\defineactivetoken 208 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE -\defineactivetoken 210 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON -\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK -\defineactivetoken 217 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE -\defineactivetoken 218 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE -\defineactivetoken 219 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE -\defineactivetoken 222 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK -\defineactivetoken 225 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK -\defineactivetoken 226 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON -\defineactivetoken 227 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE -\defineactivetoken 230 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK -\defineactivetoken 231 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON -\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE -\defineactivetoken 235 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE -\defineactivetoken 236 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA -\defineactivetoken 237 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA -\defineactivetoken 238 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON -\defineactivetoken 239 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA -\defineactivetoken 240 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE -\defineactivetoken 242 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK -\defineactivetoken 249 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE -\defineactivetoken 250 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE -\defineactivetoken 251 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE -\defineactivetoken 254 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON -\defineactivetoken 255 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK - -\stopregime - diff --git a/tex/context/base/regi-8859-15.mkii b/tex/context/base/regi-8859-15.mkii new file mode 100644 index 000000000..cf788d3f3 --- /dev/null +++ b/tex/context/base/regi-8859-15.mkii @@ -0,0 +1,154 @@ +%D \module +%D [ file=regi-8859-15, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-15 (West European), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-15/Latin9 input encoding (regime) for +%D West European languages, almost the same as iso-8859-1 with rarely +%D used symbols (currency symbol,%D fractions, accents) replaced by +%D Euro and some additional letters,%D see also cp1252. +%D +%D Usage: \type{\enableregime[8859-15]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[8859-15] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK +\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\texteuro} % 20AC EURO SIGN +\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN +\defineactivetoken 166 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\textmacron} % 00AF MACRON +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON +\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE +\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE +\defineactivetoken 189 {\oeligature} % 0153 LATIN SMALL LIGATURE OE +\defineactivetoken 190 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS +\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK +\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA +\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS +\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH +\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE +\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE +\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE +\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE +\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA +\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS +\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH +\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE +\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE +\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE +\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN +\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS + +\stopregime + diff --git a/tex/context/base/regi-8859-15.tex b/tex/context/base/regi-8859-15.tex deleted file mode 100644 index cf788d3f3..000000000 --- a/tex/context/base/regi-8859-15.tex +++ /dev/null @@ -1,154 +0,0 @@ -%D \module -%D [ file=regi-8859-15, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-15 (West European), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-15/Latin9 input encoding (regime) for -%D West European languages, almost the same as iso-8859-1 with rarely -%D used symbols (currency symbol,%D fractions, accents) replaced by -%D Euro and some additional letters,%D see also cp1252. -%D -%D Usage: \type{\enableregime[8859-15]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[8859-15] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK -\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\texteuro} % 20AC EURO SIGN -\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN -\defineactivetoken 166 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\textmacron} % 00AF MACRON -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON -\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE -\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE -\defineactivetoken 189 {\oeligature} % 0153 LATIN SMALL LIGATURE OE -\defineactivetoken 190 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS -\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK -\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE -\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA -\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS -\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH -\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE -\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE -\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE -\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE -\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA -\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS -\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH -\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE -\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE -\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE -\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN -\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS - -\stopregime - diff --git a/tex/context/base/regi-8859-16.mkii b/tex/context/base/regi-8859-16.mkii new file mode 100644 index 000000000..96f0a15d4 --- /dev/null +++ b/tex/context/base/regi-8859-16.mkii @@ -0,0 +1,151 @@ +%D \module +%D [ file=regi-8859-16, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-16 (Romanian), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-16/Latin10 input encoding (regime) for Romanian. +%D +%D Usage: \type{\enableregime[8859-16]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[8859-16] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK +\defineactivetoken 162 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK +\defineactivetoken 163 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE +\defineactivetoken 164 {\texteuro} % 20AC EURO SIGN +\defineactivetoken 165 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK +\defineactivetoken 166 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\Scommaaccent} % 0218 LATIN CAPITAL LETTER S WITH COMMA BELOW +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE +\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON +\defineactivetoken 179 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE +\defineactivetoken 180 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON +\defineactivetoken 181 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON +\defineactivetoken 185 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON +\defineactivetoken 186 {\scommaaccent} % 0219 LATIN SMALL LETTER S WITH COMMA BELOW +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE +\defineactivetoken 189 {\oeligature} % 0153 LATIN SMALL LIGATURE OE +\defineactivetoken 190 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS +\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE +\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE +\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA +\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS +\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE +\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE +\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Ohungarumlaut} % 0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE +\defineactivetoken 216 {\Uhungarumlaut} % 0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK +\defineactivetoken 222 {\Tcommaaccent} % 021A LATIN CAPITAL LETTER T WITH COMMA BELOW +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE +\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA +\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS +\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE +\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE +\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\ohungarumlaut} % 0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE +\defineactivetoken 248 {\uhungarumlaut} % 0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE +\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK +\defineactivetoken 254 {\tcommaaccent} % 021B LATIN SMALL LETTER T WITH COMMA BELOW +\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS + +\stopregime + diff --git a/tex/context/base/regi-8859-16.tex b/tex/context/base/regi-8859-16.tex deleted file mode 100644 index 96f0a15d4..000000000 --- a/tex/context/base/regi-8859-16.tex +++ /dev/null @@ -1,151 +0,0 @@ -%D \module -%D [ file=regi-8859-16, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-16 (Romanian), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-16/Latin10 input encoding (regime) for Romanian. -%D -%D Usage: \type{\enableregime[8859-16]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[8859-16] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK -\defineactivetoken 162 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK -\defineactivetoken 163 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE -\defineactivetoken 164 {\texteuro} % 20AC EURO SIGN -\defineactivetoken 165 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK -\defineactivetoken 166 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\Scommaaccent} % 0218 LATIN CAPITAL LETTER S WITH COMMA BELOW -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE -\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON -\defineactivetoken 179 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE -\defineactivetoken 180 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON -\defineactivetoken 181 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON -\defineactivetoken 185 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON -\defineactivetoken 186 {\scommaaccent} % 0219 LATIN SMALL LETTER S WITH COMMA BELOW -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE -\defineactivetoken 189 {\oeligature} % 0153 LATIN SMALL LIGATURE OE -\defineactivetoken 190 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS -\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE -\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE -\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA -\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS -\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE -\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE -\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Ohungarumlaut} % 0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE -\defineactivetoken 216 {\Uhungarumlaut} % 0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK -\defineactivetoken 222 {\Tcommaaccent} % 021A LATIN CAPITAL LETTER T WITH COMMA BELOW -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE -\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA -\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS -\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE -\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE -\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\ohungarumlaut} % 0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE -\defineactivetoken 248 {\uhungarumlaut} % 0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE -\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK -\defineactivetoken 254 {\tcommaaccent} % 021B LATIN SMALL LETTER T WITH COMMA BELOW -\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS - -\stopregime - diff --git a/tex/context/base/regi-8859-2.mkii b/tex/context/base/regi-8859-2.mkii new file mode 100644 index 000000000..81fe8419e --- /dev/null +++ b/tex/context/base/regi-8859-2.mkii @@ -0,0 +1,152 @@ +%D \module +%D [ file=regi-8859-2, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-2 (East European), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-2/Latin2 input encoding (regime) for +%D Central European languages, see also cp1250. +%D +%D Usage: \type{\enableregime[8859-2]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[8859-2] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK +\defineactivetoken 162 {\textbreve} % 02D8 BREVE +\defineactivetoken 163 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\Lcaron} % 013D LATIN CAPITAL LETTER L WITH CARON +\defineactivetoken 166 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 170 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA +\defineactivetoken 171 {\Tcaron} % 0164 LATIN CAPITAL LETTER T WITH CARON +\defineactivetoken 172 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON +\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK +\defineactivetoken 178 {\textogonek} % 02DB OGONEK +\defineactivetoken 179 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE +\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT +\defineactivetoken 181 {\lcaron} % 013E LATIN SMALL LETTER L WITH CARON +\defineactivetoken 182 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE +\defineactivetoken 183 {\textcaron} % 02C7 CARON +\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA +\defineactivetoken 185 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 186 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA +\defineactivetoken 187 {\tcaron} % 0165 LATIN SMALL LETTER T WITH CARON +\defineactivetoken 188 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE +\defineactivetoken 189 {\texthungarumlaut} % 02DD DOUBLE ACUTE ACCENT +\defineactivetoken 190 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON +\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE +\defineactivetoken 192 {\Racute} % 0154 LATIN CAPITAL LETTER R WITH ACUTE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Lacute} % 0139 LATIN CAPITAL LETTER L WITH ACUTE +\defineactivetoken 198 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE +\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA +\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Ecaron} % 011A LATIN CAPITAL LETTER E WITH CARON +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Dcaron} % 010E LATIN CAPITAL LETTER D WITH CARON +\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE +\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE +\defineactivetoken 210 {\Ncaron} % 0147 LATIN CAPITAL LETTER N WITH CARON +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Ohungarumlaut} % 0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Rcaron} % 0158 LATIN CAPITAL LETTER R WITH CARON +\defineactivetoken 217 {\Uring} % 016E LATIN CAPITAL LETTER U WITH RING ABOVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Uhungarumlaut} % 0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE +\defineactivetoken 222 {\Tcedilla} % 0162 LATIN CAPITAL LETTER T WITH CEDILLA +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\racute} % 0155 LATIN SMALL LETTER R WITH ACUTE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\lacute} % 013A LATIN SMALL LETTER L WITH ACUTE +\defineactivetoken 230 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE +\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA +\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\ecaron} % 011B LATIN SMALL LETTER E WITH CARON +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\dcaron} % 010F LATIN SMALL LETTER D WITH CARON +\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE +\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE +\defineactivetoken 242 {\ncaron} % 0148 LATIN SMALL LETTER N WITH CARON +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\ohungarumlaut} % 0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\rcaron} % 0159 LATIN SMALL LETTER R WITH CARON +\defineactivetoken 249 {\uring} % 016F LATIN SMALL LETTER U WITH RING ABOVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\uhungarumlaut} % 0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE +\defineactivetoken 254 {\tcedilla} % 0163 LATIN SMALL LETTER T WITH CEDILLA +\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE + +\stopregime + diff --git a/tex/context/base/regi-8859-2.tex b/tex/context/base/regi-8859-2.tex deleted file mode 100644 index 81fe8419e..000000000 --- a/tex/context/base/regi-8859-2.tex +++ /dev/null @@ -1,152 +0,0 @@ -%D \module -%D [ file=regi-8859-2, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-2 (East European), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-2/Latin2 input encoding (regime) for -%D Central European languages, see also cp1250. -%D -%D Usage: \type{\enableregime[8859-2]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[8859-2] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK -\defineactivetoken 162 {\textbreve} % 02D8 BREVE -\defineactivetoken 163 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\Lcaron} % 013D LATIN CAPITAL LETTER L WITH CARON -\defineactivetoken 166 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 170 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA -\defineactivetoken 171 {\Tcaron} % 0164 LATIN CAPITAL LETTER T WITH CARON -\defineactivetoken 172 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON -\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK -\defineactivetoken 178 {\textogonek} % 02DB OGONEK -\defineactivetoken 179 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE -\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT -\defineactivetoken 181 {\lcaron} % 013E LATIN SMALL LETTER L WITH CARON -\defineactivetoken 182 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE -\defineactivetoken 183 {\textcaron} % 02C7 CARON -\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA -\defineactivetoken 185 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 186 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA -\defineactivetoken 187 {\tcaron} % 0165 LATIN SMALL LETTER T WITH CARON -\defineactivetoken 188 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE -\defineactivetoken 189 {\texthungarumlaut} % 02DD DOUBLE ACUTE ACCENT -\defineactivetoken 190 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON -\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE -\defineactivetoken 192 {\Racute} % 0154 LATIN CAPITAL LETTER R WITH ACUTE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Lacute} % 0139 LATIN CAPITAL LETTER L WITH ACUTE -\defineactivetoken 198 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE -\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA -\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Ecaron} % 011A LATIN CAPITAL LETTER E WITH CARON -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Dcaron} % 010E LATIN CAPITAL LETTER D WITH CARON -\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE -\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE -\defineactivetoken 210 {\Ncaron} % 0147 LATIN CAPITAL LETTER N WITH CARON -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Ohungarumlaut} % 0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Rcaron} % 0158 LATIN CAPITAL LETTER R WITH CARON -\defineactivetoken 217 {\Uring} % 016E LATIN CAPITAL LETTER U WITH RING ABOVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Uhungarumlaut} % 0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE -\defineactivetoken 222 {\Tcedilla} % 0162 LATIN CAPITAL LETTER T WITH CEDILLA -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\racute} % 0155 LATIN SMALL LETTER R WITH ACUTE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\lacute} % 013A LATIN SMALL LETTER L WITH ACUTE -\defineactivetoken 230 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE -\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA -\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\ecaron} % 011B LATIN SMALL LETTER E WITH CARON -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\dcaron} % 010F LATIN SMALL LETTER D WITH CARON -\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE -\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE -\defineactivetoken 242 {\ncaron} % 0148 LATIN SMALL LETTER N WITH CARON -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\ohungarumlaut} % 0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\rcaron} % 0159 LATIN SMALL LETTER R WITH CARON -\defineactivetoken 249 {\uring} % 016F LATIN SMALL LETTER U WITH RING ABOVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\uhungarumlaut} % 0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE -\defineactivetoken 254 {\tcedilla} % 0163 LATIN SMALL LETTER T WITH CEDILLA -\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE - -\stopregime - diff --git a/tex/context/base/regi-8859-3.mkii b/tex/context/base/regi-8859-3.mkii new file mode 100644 index 000000000..dcb8be67f --- /dev/null +++ b/tex/context/base/regi-8859-3.mkii @@ -0,0 +1,145 @@ +%D \module +%D [ file=regi-8859-3, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-3 (South European), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-3/Latin3 input encoding (regime) for South +%D European languages, esp. for Esperanto and Maltese. +%D +%D Usage: \type{\enableregime[8859-3]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[8859-3] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\Hstroke} % 0126 LATIN CAPITAL LETTER H WITH STROKE +\defineactivetoken 162 {\textbreve} % 02D8 BREVE +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 166 {\Hcircumflex} % 0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\Idotaccent} % 0130 LATIN CAPITAL LETTER I WITH DOT ABOVE +\defineactivetoken 170 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA +\defineactivetoken 171 {\Gbreve} % 011E LATIN CAPITAL LETTER G WITH BREVE +\defineactivetoken 172 {\Jcircumflex} % 0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\hstroke} % 0127 LATIN SMALL LETTER H WITH STROKE +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\hcircumflex} % 0125 LATIN SMALL LETTER H WITH CIRCUMFLEX +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA +\defineactivetoken 185 {\dotlessi} % 0131 LATIN SMALL LETTER DOTLESS I +\defineactivetoken 186 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA +\defineactivetoken 187 {\gbreve} % 011F LATIN SMALL LETTER G WITH BREVE +\defineactivetoken 188 {\jcircumflex} % 0135 LATIN SMALL LETTER J WITH CIRCUMFLEX +\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF +\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE +\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Cdotaccent} % 010A LATIN CAPITAL LETTER C WITH DOT ABOVE +\defineactivetoken 198 {\Ccircumflex} % 0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX +\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA +\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS +\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE +\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Gdotaccent} % 0120 LATIN CAPITAL LETTER G WITH DOT ABOVE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Gcircumflex} % 011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX +\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Ubreve} % 016C LATIN CAPITAL LETTER U WITH BREVE +\defineactivetoken 222 {\Scircumflex} % 015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\cdotaccent} % 010B LATIN SMALL LETTER C WITH DOT ABOVE +\defineactivetoken 230 {\ccircumflex} % 0109 LATIN SMALL LETTER C WITH CIRCUMFLEX +\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA +\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS +\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE +\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\gdotaccent} % 0121 LATIN SMALL LETTER G WITH DOT ABOVE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\gcircumflex} % 011D LATIN SMALL LETTER G WITH CIRCUMFLEX +\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\ubreve} % 016D LATIN SMALL LETTER U WITH BREVE +\defineactivetoken 254 {\scircumflex} % 015D LATIN SMALL LETTER S WITH CIRCUMFLEX +\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE + +\stopregime + diff --git a/tex/context/base/regi-8859-3.tex b/tex/context/base/regi-8859-3.tex deleted file mode 100644 index dcb8be67f..000000000 --- a/tex/context/base/regi-8859-3.tex +++ /dev/null @@ -1,145 +0,0 @@ -%D \module -%D [ file=regi-8859-3, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-3 (South European), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-3/Latin3 input encoding (regime) for South -%D European languages, esp. for Esperanto and Maltese. -%D -%D Usage: \type{\enableregime[8859-3]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[8859-3] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\Hstroke} % 0126 LATIN CAPITAL LETTER H WITH STROKE -\defineactivetoken 162 {\textbreve} % 02D8 BREVE -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 166 {\Hcircumflex} % 0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\Idotaccent} % 0130 LATIN CAPITAL LETTER I WITH DOT ABOVE -\defineactivetoken 170 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA -\defineactivetoken 171 {\Gbreve} % 011E LATIN CAPITAL LETTER G WITH BREVE -\defineactivetoken 172 {\Jcircumflex} % 0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\hstroke} % 0127 LATIN SMALL LETTER H WITH STROKE -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\hcircumflex} % 0125 LATIN SMALL LETTER H WITH CIRCUMFLEX -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA -\defineactivetoken 185 {\dotlessi} % 0131 LATIN SMALL LETTER DOTLESS I -\defineactivetoken 186 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA -\defineactivetoken 187 {\gbreve} % 011F LATIN SMALL LETTER G WITH BREVE -\defineactivetoken 188 {\jcircumflex} % 0135 LATIN SMALL LETTER J WITH CIRCUMFLEX -\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF -\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE -\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Cdotaccent} % 010A LATIN CAPITAL LETTER C WITH DOT ABOVE -\defineactivetoken 198 {\Ccircumflex} % 0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX -\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA -\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS -\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE -\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Gdotaccent} % 0120 LATIN CAPITAL LETTER G WITH DOT ABOVE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Gcircumflex} % 011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX -\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Ubreve} % 016C LATIN CAPITAL LETTER U WITH BREVE -\defineactivetoken 222 {\Scircumflex} % 015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\cdotaccent} % 010B LATIN SMALL LETTER C WITH DOT ABOVE -\defineactivetoken 230 {\ccircumflex} % 0109 LATIN SMALL LETTER C WITH CIRCUMFLEX -\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA -\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS -\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE -\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\gdotaccent} % 0121 LATIN SMALL LETTER G WITH DOT ABOVE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\gcircumflex} % 011D LATIN SMALL LETTER G WITH CIRCUMFLEX -\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\ubreve} % 016D LATIN SMALL LETTER U WITH BREVE -\defineactivetoken 254 {\scircumflex} % 015D LATIN SMALL LETTER S WITH CIRCUMFLEX -\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE - -\stopregime - diff --git a/tex/context/base/regi-8859-4.mkii b/tex/context/base/regi-8859-4.mkii new file mode 100644 index 000000000..3ebe66a13 --- /dev/null +++ b/tex/context/base/regi-8859-4.mkii @@ -0,0 +1,152 @@ +%D \module +%D [ file=regi-8859-4, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-4 (North European), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-4/Latin4 input encoding (regime) for West +%D European languages, see also cp1257 and iso-8859-13. +%D +%D Usage: \type{\enableregime[8859-4]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[8859-4] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK +\defineactivetoken 162 {\kkra} % 0138 LATIN SMALL LETTER KRA +\defineactivetoken 163 {\Rcommaaccent} % 0156 LATIN CAPITAL LETTER R WITH CEDILLA +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\Itilde} % 0128 LATIN CAPITAL LETTER I WITH TILDE +\defineactivetoken 166 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 170 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON +\defineactivetoken 171 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA +\defineactivetoken 172 {\Tstroke} % 0166 LATIN CAPITAL LETTER T WITH STROKE +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON +\defineactivetoken 175 {\textmacron} % 00AF MACRON +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK +\defineactivetoken 178 {\textogonek} % 02DB OGONEK +\defineactivetoken 179 {\rcommaaccent} % 0157 LATIN SMALL LETTER R WITH CEDILLA +\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT +\defineactivetoken 181 {\itilde} % 0129 LATIN SMALL LETTER I WITH TILDE +\defineactivetoken 182 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA +\defineactivetoken 183 {\textcaron} % 02C7 CARON +\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA +\defineactivetoken 185 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 186 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON +\defineactivetoken 187 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA +\defineactivetoken 188 {\tstroke} % 0167 LATIN SMALL LETTER T WITH STROKE +\defineactivetoken 189 {\Neng} % 014A LATIN CAPITAL LETTER ENG +\defineactivetoken 190 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON +\defineactivetoken 191 {\neng} % 014B LATIN SMALL LETTER ENG +\defineactivetoken 192 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 199 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK +\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON +\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE +\defineactivetoken 209 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA +\defineactivetoken 210 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON +\defineactivetoken 211 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE +\defineactivetoken 217 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Utilde} % 0168 LATIN CAPITAL LETTER U WITH TILDE +\defineactivetoken 222 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE +\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 231 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK +\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON +\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE +\defineactivetoken 241 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA +\defineactivetoken 242 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON +\defineactivetoken 243 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE +\defineactivetoken 249 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\utilde} % 0169 LATIN SMALL LETTER U WITH TILDE +\defineactivetoken 254 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON +\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE + +\stopregime + diff --git a/tex/context/base/regi-8859-4.tex b/tex/context/base/regi-8859-4.tex deleted file mode 100644 index 3ebe66a13..000000000 --- a/tex/context/base/regi-8859-4.tex +++ /dev/null @@ -1,152 +0,0 @@ -%D \module -%D [ file=regi-8859-4, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-4 (North European), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-4/Latin4 input encoding (regime) for West -%D European languages, see also cp1257 and iso-8859-13. -%D -%D Usage: \type{\enableregime[8859-4]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[8859-4] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK -\defineactivetoken 162 {\kkra} % 0138 LATIN SMALL LETTER KRA -\defineactivetoken 163 {\Rcommaaccent} % 0156 LATIN CAPITAL LETTER R WITH CEDILLA -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\Itilde} % 0128 LATIN CAPITAL LETTER I WITH TILDE -\defineactivetoken 166 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 170 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON -\defineactivetoken 171 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA -\defineactivetoken 172 {\Tstroke} % 0166 LATIN CAPITAL LETTER T WITH STROKE -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON -\defineactivetoken 175 {\textmacron} % 00AF MACRON -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK -\defineactivetoken 178 {\textogonek} % 02DB OGONEK -\defineactivetoken 179 {\rcommaaccent} % 0157 LATIN SMALL LETTER R WITH CEDILLA -\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT -\defineactivetoken 181 {\itilde} % 0129 LATIN SMALL LETTER I WITH TILDE -\defineactivetoken 182 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA -\defineactivetoken 183 {\textcaron} % 02C7 CARON -\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA -\defineactivetoken 185 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 186 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON -\defineactivetoken 187 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA -\defineactivetoken 188 {\tstroke} % 0167 LATIN SMALL LETTER T WITH STROKE -\defineactivetoken 189 {\Neng} % 014A LATIN CAPITAL LETTER ENG -\defineactivetoken 190 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON -\defineactivetoken 191 {\neng} % 014B LATIN SMALL LETTER ENG -\defineactivetoken 192 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE -\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 199 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK -\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON -\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE -\defineactivetoken 209 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA -\defineactivetoken 210 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON -\defineactivetoken 211 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE -\defineactivetoken 217 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Utilde} % 0168 LATIN CAPITAL LETTER U WITH TILDE -\defineactivetoken 222 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE -\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 231 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK -\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON -\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE -\defineactivetoken 241 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA -\defineactivetoken 242 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON -\defineactivetoken 243 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE -\defineactivetoken 249 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\utilde} % 0169 LATIN SMALL LETTER U WITH TILDE -\defineactivetoken 254 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON -\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE - -\stopregime - diff --git a/tex/context/base/regi-8859-5.mkii b/tex/context/base/regi-8859-5.mkii new file mode 100644 index 000000000..531226433 --- /dev/null +++ b/tex/context/base/regi-8859-5.mkii @@ -0,0 +1,152 @@ +%D \module +%D [ file=regi-8859-5, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-5 (Cyrillic), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-5 input encoding (regime) for Cyrillic, +%D see also regi-cyr and regi-cyp. +%D +%D Usage: \type{\enableregime[8859-5]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[8859-5] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\cyrillicYO} % 0401 CYRILLIC CAPITAL LETTER IO +\defineactivetoken 162 {\cyrillicDJE} % 0402 CYRILLIC CAPITAL LETTER DJE +\defineactivetoken 163 {\cyrillicGJE} % 0403 CYRILLIC CAPITAL LETTER GJE +\defineactivetoken 164 {\cyrillicIE} % 0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE +\defineactivetoken 165 {\cyrillicDZE} % 0405 CYRILLIC CAPITAL LETTER DZE +\defineactivetoken 166 {\cyrillicII} % 0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +\defineactivetoken 167 {\cyrillicYI} % 0407 CYRILLIC CAPITAL LETTER YI +\defineactivetoken 168 {\cyrillicJE} % 0408 CYRILLIC CAPITAL LETTER JE +\defineactivetoken 169 {\cyrillicLJE} % 0409 CYRILLIC CAPITAL LETTER LJE +\defineactivetoken 170 {\cyrillicNJE} % 040A CYRILLIC CAPITAL LETTER NJE +\defineactivetoken 171 {\cyrillicTSHE} % 040B CYRILLIC CAPITAL LETTER TSHE +\defineactivetoken 172 {\cyrillicKJE} % 040C CYRILLIC CAPITAL LETTER KJE +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\cyrillicUSHRT} % 040E CYRILLIC CAPITAL LETTER SHORT U +\defineactivetoken 175 {\cyrillicDZHE} % 040F CYRILLIC CAPITAL LETTER DZHE +\defineactivetoken 176 {\cyrillicA} % 0410 CYRILLIC CAPITAL LETTER A +\defineactivetoken 177 {\cyrillicB} % 0411 CYRILLIC CAPITAL LETTER BE +\defineactivetoken 178 {\cyrillicV} % 0412 CYRILLIC CAPITAL LETTER VE +\defineactivetoken 179 {\cyrillicG} % 0413 CYRILLIC CAPITAL LETTER GHE +\defineactivetoken 180 {\cyrillicD} % 0414 CYRILLIC CAPITAL LETTER DE +\defineactivetoken 181 {\cyrillicE} % 0415 CYRILLIC CAPITAL LETTER IE +\defineactivetoken 182 {\cyrillicZH} % 0416 CYRILLIC CAPITAL LETTER ZHE +\defineactivetoken 183 {\cyrillicZ} % 0417 CYRILLIC CAPITAL LETTER ZE +\defineactivetoken 184 {\cyrillicI} % 0418 CYRILLIC CAPITAL LETTER I +\defineactivetoken 185 {\cyrillicISHRT} % 0419 CYRILLIC CAPITAL LETTER SHORT I +\defineactivetoken 186 {\cyrillicK} % 041A CYRILLIC CAPITAL LETTER KA +\defineactivetoken 187 {\cyrillicL} % 041B CYRILLIC CAPITAL LETTER EL +\defineactivetoken 188 {\cyrillicM} % 041C CYRILLIC CAPITAL LETTER EM +\defineactivetoken 189 {\cyrillicN} % 041D CYRILLIC CAPITAL LETTER EN +\defineactivetoken 190 {\cyrillicO} % 041E CYRILLIC CAPITAL LETTER O +\defineactivetoken 191 {\cyrillicP} % 041F CYRILLIC CAPITAL LETTER PE +\defineactivetoken 192 {\cyrillicR} % 0420 CYRILLIC CAPITAL LETTER ER +\defineactivetoken 193 {\cyrillicS} % 0421 CYRILLIC CAPITAL LETTER ES +\defineactivetoken 194 {\cyrillicT} % 0422 CYRILLIC CAPITAL LETTER TE +\defineactivetoken 195 {\cyrillicU} % 0423 CYRILLIC CAPITAL LETTER U +\defineactivetoken 196 {\cyrillicF} % 0424 CYRILLIC CAPITAL LETTER EF +\defineactivetoken 197 {\cyrillicH} % 0425 CYRILLIC CAPITAL LETTER HA +\defineactivetoken 198 {\cyrillicC} % 0426 CYRILLIC CAPITAL LETTER TSE +\defineactivetoken 199 {\cyrillicCH} % 0427 CYRILLIC CAPITAL LETTER CHE +\defineactivetoken 200 {\cyrillicSH} % 0428 CYRILLIC CAPITAL LETTER SHA +\defineactivetoken 201 {\cyrillicSHCH} % 0429 CYRILLIC CAPITAL LETTER SHCHA +\defineactivetoken 202 {\cyrillicHRDSN} % 042A CYRILLIC CAPITAL LETTER HARD SIGN +\defineactivetoken 203 {\cyrillicERY} % 042B CYRILLIC CAPITAL LETTER YERU +\defineactivetoken 204 {\cyrillicSFTSN} % 042C CYRILLIC CAPITAL LETTER SOFT SIGN +\defineactivetoken 205 {\cyrillicEREV} % 042D CYRILLIC CAPITAL LETTER E +\defineactivetoken 206 {\cyrillicYU} % 042E CYRILLIC CAPITAL LETTER YU +\defineactivetoken 207 {\cyrillicYA} % 042F CYRILLIC CAPITAL LETTER YA +\defineactivetoken 208 {\cyrillica} % 0430 CYRILLIC SMALL LETTER A +\defineactivetoken 209 {\cyrillicb} % 0431 CYRILLIC SMALL LETTER BE +\defineactivetoken 210 {\cyrillicv} % 0432 CYRILLIC SMALL LETTER VE +\defineactivetoken 211 {\cyrillicg} % 0433 CYRILLIC SMALL LETTER GHE +\defineactivetoken 212 {\cyrillicd} % 0434 CYRILLIC SMALL LETTER DE +\defineactivetoken 213 {\cyrillice} % 0435 CYRILLIC SMALL LETTER IE +\defineactivetoken 214 {\cyrilliczh} % 0436 CYRILLIC SMALL LETTER ZHE +\defineactivetoken 215 {\cyrillicz} % 0437 CYRILLIC SMALL LETTER ZE +\defineactivetoken 216 {\cyrillici} % 0438 CYRILLIC SMALL LETTER I +\defineactivetoken 217 {\cyrillicishrt} % 0439 CYRILLIC SMALL LETTER SHORT I +\defineactivetoken 218 {\cyrillick} % 043A CYRILLIC SMALL LETTER KA +\defineactivetoken 219 {\cyrillicl} % 043B CYRILLIC SMALL LETTER EL +\defineactivetoken 220 {\cyrillicm} % 043C CYRILLIC SMALL LETTER EM +\defineactivetoken 221 {\cyrillicn} % 043D CYRILLIC SMALL LETTER EN +\defineactivetoken 222 {\cyrillico} % 043E CYRILLIC SMALL LETTER O +\defineactivetoken 223 {\cyrillicp} % 043F CYRILLIC SMALL LETTER PE +\defineactivetoken 224 {\cyrillicr} % 0440 CYRILLIC SMALL LETTER ER +\defineactivetoken 225 {\cyrillics} % 0441 CYRILLIC SMALL LETTER ES +\defineactivetoken 226 {\cyrillict} % 0442 CYRILLIC SMALL LETTER TE +\defineactivetoken 227 {\cyrillicu} % 0443 CYRILLIC SMALL LETTER U +\defineactivetoken 228 {\cyrillicf} % 0444 CYRILLIC SMALL LETTER EF +\defineactivetoken 229 {\cyrillich} % 0445 CYRILLIC SMALL LETTER HA +\defineactivetoken 230 {\cyrillicc} % 0446 CYRILLIC SMALL LETTER TSE +\defineactivetoken 231 {\cyrillicch} % 0447 CYRILLIC SMALL LETTER CHE +\defineactivetoken 232 {\cyrillicsh} % 0448 CYRILLIC SMALL LETTER SHA +\defineactivetoken 233 {\cyrillicshch} % 0449 CYRILLIC SMALL LETTER SHCHA +\defineactivetoken 234 {\cyrillichrdsn} % 044A CYRILLIC SMALL LETTER HARD SIGN +\defineactivetoken 235 {\cyrillicery} % 044B CYRILLIC SMALL LETTER YERU +\defineactivetoken 236 {\cyrillicsftsn} % 044C CYRILLIC SMALL LETTER SOFT SIGN +\defineactivetoken 237 {\cyrillicerev} % 044D CYRILLIC SMALL LETTER E +\defineactivetoken 238 {\cyrillicyu} % 044E CYRILLIC SMALL LETTER YU +\defineactivetoken 239 {\cyrillicya} % 044F CYRILLIC SMALL LETTER YA +\defineactivetoken 240 {\textnumero} % 2116 NUMERO SIGN +\defineactivetoken 241 {\cyrillicyo} % 0451 CYRILLIC SMALL LETTER IO +\defineactivetoken 242 {\cyrillicdje} % 0452 CYRILLIC SMALL LETTER DJE +\defineactivetoken 243 {\cyrillicgje} % 0453 CYRILLIC SMALL LETTER GJE +\defineactivetoken 244 {\cyrillicie} % 0454 CYRILLIC SMALL LETTER UKRAINIAN IE +\defineactivetoken 245 {\cyrillicdze} % 0455 CYRILLIC SMALL LETTER DZE +\defineactivetoken 246 {\cyrillicii} % 0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +\defineactivetoken 247 {\cyrillicyi} % 0457 CYRILLIC SMALL LETTER YI +\defineactivetoken 248 {\cyrillicje} % 0458 CYRILLIC SMALL LETTER JE +\defineactivetoken 249 {\cyrilliclje} % 0459 CYRILLIC SMALL LETTER LJE +\defineactivetoken 250 {\cyrillicnje} % 045A CYRILLIC SMALL LETTER NJE +\defineactivetoken 251 {\cyrillictshe} % 045B CYRILLIC SMALL LETTER TSHE +\defineactivetoken 252 {\cyrillickje} % 045C CYRILLIC SMALL LETTER KJE +\defineactivetoken 253 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 254 {\cyrillicushrt} % 045E CYRILLIC SMALL LETTER SHORT U +\defineactivetoken 255 {\cyrillicdzhe} % 045F CYRILLIC SMALL LETTER DZHE + +\stopregime + diff --git a/tex/context/base/regi-8859-5.tex b/tex/context/base/regi-8859-5.tex deleted file mode 100644 index 531226433..000000000 --- a/tex/context/base/regi-8859-5.tex +++ /dev/null @@ -1,152 +0,0 @@ -%D \module -%D [ file=regi-8859-5, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-5 (Cyrillic), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-5 input encoding (regime) for Cyrillic, -%D see also regi-cyr and regi-cyp. -%D -%D Usage: \type{\enableregime[8859-5]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[8859-5] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\cyrillicYO} % 0401 CYRILLIC CAPITAL LETTER IO -\defineactivetoken 162 {\cyrillicDJE} % 0402 CYRILLIC CAPITAL LETTER DJE -\defineactivetoken 163 {\cyrillicGJE} % 0403 CYRILLIC CAPITAL LETTER GJE -\defineactivetoken 164 {\cyrillicIE} % 0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE -\defineactivetoken 165 {\cyrillicDZE} % 0405 CYRILLIC CAPITAL LETTER DZE -\defineactivetoken 166 {\cyrillicII} % 0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I -\defineactivetoken 167 {\cyrillicYI} % 0407 CYRILLIC CAPITAL LETTER YI -\defineactivetoken 168 {\cyrillicJE} % 0408 CYRILLIC CAPITAL LETTER JE -\defineactivetoken 169 {\cyrillicLJE} % 0409 CYRILLIC CAPITAL LETTER LJE -\defineactivetoken 170 {\cyrillicNJE} % 040A CYRILLIC CAPITAL LETTER NJE -\defineactivetoken 171 {\cyrillicTSHE} % 040B CYRILLIC CAPITAL LETTER TSHE -\defineactivetoken 172 {\cyrillicKJE} % 040C CYRILLIC CAPITAL LETTER KJE -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\cyrillicUSHRT} % 040E CYRILLIC CAPITAL LETTER SHORT U -\defineactivetoken 175 {\cyrillicDZHE} % 040F CYRILLIC CAPITAL LETTER DZHE -\defineactivetoken 176 {\cyrillicA} % 0410 CYRILLIC CAPITAL LETTER A -\defineactivetoken 177 {\cyrillicB} % 0411 CYRILLIC CAPITAL LETTER BE -\defineactivetoken 178 {\cyrillicV} % 0412 CYRILLIC CAPITAL LETTER VE -\defineactivetoken 179 {\cyrillicG} % 0413 CYRILLIC CAPITAL LETTER GHE -\defineactivetoken 180 {\cyrillicD} % 0414 CYRILLIC CAPITAL LETTER DE -\defineactivetoken 181 {\cyrillicE} % 0415 CYRILLIC CAPITAL LETTER IE -\defineactivetoken 182 {\cyrillicZH} % 0416 CYRILLIC CAPITAL LETTER ZHE -\defineactivetoken 183 {\cyrillicZ} % 0417 CYRILLIC CAPITAL LETTER ZE -\defineactivetoken 184 {\cyrillicI} % 0418 CYRILLIC CAPITAL LETTER I -\defineactivetoken 185 {\cyrillicISHRT} % 0419 CYRILLIC CAPITAL LETTER SHORT I -\defineactivetoken 186 {\cyrillicK} % 041A CYRILLIC CAPITAL LETTER KA -\defineactivetoken 187 {\cyrillicL} % 041B CYRILLIC CAPITAL LETTER EL -\defineactivetoken 188 {\cyrillicM} % 041C CYRILLIC CAPITAL LETTER EM -\defineactivetoken 189 {\cyrillicN} % 041D CYRILLIC CAPITAL LETTER EN -\defineactivetoken 190 {\cyrillicO} % 041E CYRILLIC CAPITAL LETTER O -\defineactivetoken 191 {\cyrillicP} % 041F CYRILLIC CAPITAL LETTER PE -\defineactivetoken 192 {\cyrillicR} % 0420 CYRILLIC CAPITAL LETTER ER -\defineactivetoken 193 {\cyrillicS} % 0421 CYRILLIC CAPITAL LETTER ES -\defineactivetoken 194 {\cyrillicT} % 0422 CYRILLIC CAPITAL LETTER TE -\defineactivetoken 195 {\cyrillicU} % 0423 CYRILLIC CAPITAL LETTER U -\defineactivetoken 196 {\cyrillicF} % 0424 CYRILLIC CAPITAL LETTER EF -\defineactivetoken 197 {\cyrillicH} % 0425 CYRILLIC CAPITAL LETTER HA -\defineactivetoken 198 {\cyrillicC} % 0426 CYRILLIC CAPITAL LETTER TSE -\defineactivetoken 199 {\cyrillicCH} % 0427 CYRILLIC CAPITAL LETTER CHE -\defineactivetoken 200 {\cyrillicSH} % 0428 CYRILLIC CAPITAL LETTER SHA -\defineactivetoken 201 {\cyrillicSHCH} % 0429 CYRILLIC CAPITAL LETTER SHCHA -\defineactivetoken 202 {\cyrillicHRDSN} % 042A CYRILLIC CAPITAL LETTER HARD SIGN -\defineactivetoken 203 {\cyrillicERY} % 042B CYRILLIC CAPITAL LETTER YERU -\defineactivetoken 204 {\cyrillicSFTSN} % 042C CYRILLIC CAPITAL LETTER SOFT SIGN -\defineactivetoken 205 {\cyrillicEREV} % 042D CYRILLIC CAPITAL LETTER E -\defineactivetoken 206 {\cyrillicYU} % 042E CYRILLIC CAPITAL LETTER YU -\defineactivetoken 207 {\cyrillicYA} % 042F CYRILLIC CAPITAL LETTER YA -\defineactivetoken 208 {\cyrillica} % 0430 CYRILLIC SMALL LETTER A -\defineactivetoken 209 {\cyrillicb} % 0431 CYRILLIC SMALL LETTER BE -\defineactivetoken 210 {\cyrillicv} % 0432 CYRILLIC SMALL LETTER VE -\defineactivetoken 211 {\cyrillicg} % 0433 CYRILLIC SMALL LETTER GHE -\defineactivetoken 212 {\cyrillicd} % 0434 CYRILLIC SMALL LETTER DE -\defineactivetoken 213 {\cyrillice} % 0435 CYRILLIC SMALL LETTER IE -\defineactivetoken 214 {\cyrilliczh} % 0436 CYRILLIC SMALL LETTER ZHE -\defineactivetoken 215 {\cyrillicz} % 0437 CYRILLIC SMALL LETTER ZE -\defineactivetoken 216 {\cyrillici} % 0438 CYRILLIC SMALL LETTER I -\defineactivetoken 217 {\cyrillicishrt} % 0439 CYRILLIC SMALL LETTER SHORT I -\defineactivetoken 218 {\cyrillick} % 043A CYRILLIC SMALL LETTER KA -\defineactivetoken 219 {\cyrillicl} % 043B CYRILLIC SMALL LETTER EL -\defineactivetoken 220 {\cyrillicm} % 043C CYRILLIC SMALL LETTER EM -\defineactivetoken 221 {\cyrillicn} % 043D CYRILLIC SMALL LETTER EN -\defineactivetoken 222 {\cyrillico} % 043E CYRILLIC SMALL LETTER O -\defineactivetoken 223 {\cyrillicp} % 043F CYRILLIC SMALL LETTER PE -\defineactivetoken 224 {\cyrillicr} % 0440 CYRILLIC SMALL LETTER ER -\defineactivetoken 225 {\cyrillics} % 0441 CYRILLIC SMALL LETTER ES -\defineactivetoken 226 {\cyrillict} % 0442 CYRILLIC SMALL LETTER TE -\defineactivetoken 227 {\cyrillicu} % 0443 CYRILLIC SMALL LETTER U -\defineactivetoken 228 {\cyrillicf} % 0444 CYRILLIC SMALL LETTER EF -\defineactivetoken 229 {\cyrillich} % 0445 CYRILLIC SMALL LETTER HA -\defineactivetoken 230 {\cyrillicc} % 0446 CYRILLIC SMALL LETTER TSE -\defineactivetoken 231 {\cyrillicch} % 0447 CYRILLIC SMALL LETTER CHE -\defineactivetoken 232 {\cyrillicsh} % 0448 CYRILLIC SMALL LETTER SHA -\defineactivetoken 233 {\cyrillicshch} % 0449 CYRILLIC SMALL LETTER SHCHA -\defineactivetoken 234 {\cyrillichrdsn} % 044A CYRILLIC SMALL LETTER HARD SIGN -\defineactivetoken 235 {\cyrillicery} % 044B CYRILLIC SMALL LETTER YERU -\defineactivetoken 236 {\cyrillicsftsn} % 044C CYRILLIC SMALL LETTER SOFT SIGN -\defineactivetoken 237 {\cyrillicerev} % 044D CYRILLIC SMALL LETTER E -\defineactivetoken 238 {\cyrillicyu} % 044E CYRILLIC SMALL LETTER YU -\defineactivetoken 239 {\cyrillicya} % 044F CYRILLIC SMALL LETTER YA -\defineactivetoken 240 {\textnumero} % 2116 NUMERO SIGN -\defineactivetoken 241 {\cyrillicyo} % 0451 CYRILLIC SMALL LETTER IO -\defineactivetoken 242 {\cyrillicdje} % 0452 CYRILLIC SMALL LETTER DJE -\defineactivetoken 243 {\cyrillicgje} % 0453 CYRILLIC SMALL LETTER GJE -\defineactivetoken 244 {\cyrillicie} % 0454 CYRILLIC SMALL LETTER UKRAINIAN IE -\defineactivetoken 245 {\cyrillicdze} % 0455 CYRILLIC SMALL LETTER DZE -\defineactivetoken 246 {\cyrillicii} % 0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -\defineactivetoken 247 {\cyrillicyi} % 0457 CYRILLIC SMALL LETTER YI -\defineactivetoken 248 {\cyrillicje} % 0458 CYRILLIC SMALL LETTER JE -\defineactivetoken 249 {\cyrilliclje} % 0459 CYRILLIC SMALL LETTER LJE -\defineactivetoken 250 {\cyrillicnje} % 045A CYRILLIC SMALL LETTER NJE -\defineactivetoken 251 {\cyrillictshe} % 045B CYRILLIC SMALL LETTER TSHE -\defineactivetoken 252 {\cyrillickje} % 045C CYRILLIC SMALL LETTER KJE -\defineactivetoken 253 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 254 {\cyrillicushrt} % 045E CYRILLIC SMALL LETTER SHORT U -\defineactivetoken 255 {\cyrillicdzhe} % 045F CYRILLIC SMALL LETTER DZHE - -\stopregime - diff --git a/tex/context/base/regi-8859-7.mkii b/tex/context/base/regi-8859-7.mkii new file mode 100644 index 000000000..80259be65 --- /dev/null +++ b/tex/context/base/regi-8859-7.mkii @@ -0,0 +1,153 @@ +%D \module +%D [ file=regi-8859-7, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-7 (Greek), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-7 input encoding (regime) for Greek, +%D see also cp1253. +%D +%D (Contributor to the original file: Apostolos Syropoulos.) +%D +%D Usage: \type{\enableregime[8859-7]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[8859-7] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK +\defineactivetoken 162 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\texteuro} % 20AC EURO SIGN +\defineactivetoken 165 {\unknownchar} % 20AF DRACHMA SIGN (TODO) +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\unknownchar} % 037A GREEK YPOGEGRAMMENI (TODO) +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 175 {\texthorizontalbar} % 2015 HORIZONTAL BAR +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\greektonos} % 0384 GREEK TONOS +\defineactivetoken 181 {\greekdialytikatonos} % 0385 GREEK DIALYTIKA TONOS +\defineactivetoken 182 {\greekAlphatonos} % 0386 GREEK CAPITAL LETTER ALPHA WITH TONOS +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\greekEpsilontonos} % 0388 GREEK CAPITAL LETTER EPSILON WITH TONOS +\defineactivetoken 185 {\greekEtatonos} % 0389 GREEK CAPITAL LETTER ETA WITH TONOS +\defineactivetoken 186 {\greekIotatonos} % 038A GREEK CAPITAL LETTER IOTA WITH TONOS +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\greekOmicrontonos} % 038C GREEK CAPITAL LETTER OMICRON WITH TONOS +\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF +\defineactivetoken 190 {\greekUpsilontonos} % 038E GREEK CAPITAL LETTER UPSILON WITH TONOS +\defineactivetoken 191 {\greekOmegatonos} % 038F GREEK CAPITAL LETTER OMEGA WITH TONOS +\defineactivetoken 192 {\greekiotadialytikatonos} % 0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS +\defineactivetoken 193 {\greekAlpha} % 0391 GREEK CAPITAL LETTER ALPHA +\defineactivetoken 194 {\greekBeta} % 0392 GREEK CAPITAL LETTER BETA +\defineactivetoken 195 {\greekGamma} % 0393 GREEK CAPITAL LETTER GAMMA +\defineactivetoken 196 {\greekDelta} % 0394 GREEK CAPITAL LETTER DELTA +\defineactivetoken 197 {\greekEpsilon} % 0395 GREEK CAPITAL LETTER EPSILON +\defineactivetoken 198 {\greekZeta} % 0396 GREEK CAPITAL LETTER ZETA +\defineactivetoken 199 {\greekEta} % 0397 GREEK CAPITAL LETTER ETA +\defineactivetoken 200 {\greekTheta} % 0398 GREEK CAPITAL LETTER THETA +\defineactivetoken 201 {\greekIota} % 0399 GREEK CAPITAL LETTER IOTA +\defineactivetoken 202 {\greekKappa} % 039A GREEK CAPITAL LETTER KAPPA +\defineactivetoken 203 {\greekLambda} % 039B GREEK CAPITAL LETTER LAMDA +\defineactivetoken 204 {\greekMu} % 039C GREEK CAPITAL LETTER MU +\defineactivetoken 205 {\greekNu} % 039D GREEK CAPITAL LETTER NU +\defineactivetoken 206 {\greekXi} % 039E GREEK CAPITAL LETTER XI +\defineactivetoken 207 {\greekOmicron} % 039F GREEK CAPITAL LETTER OMICRON +\defineactivetoken 208 {\greekPi} % 03A0 GREEK CAPITAL LETTER PI +\defineactivetoken 209 {\greekRho} % 03A1 GREEK CAPITAL LETTER RHO +\defineactivetoken 210 {\unknownchar} % +\defineactivetoken 211 {\greekSigma} % 03A3 GREEK CAPITAL LETTER SIGMA +\defineactivetoken 212 {\greekTau} % 03A4 GREEK CAPITAL LETTER TAU +\defineactivetoken 213 {\greekUpsilon} % 03A5 GREEK CAPITAL LETTER UPSILON +\defineactivetoken 214 {\greekPhi} % 03A6 GREEK CAPITAL LETTER PHI +\defineactivetoken 215 {\greekChi} % 03A7 GREEK CAPITAL LETTER CHI +\defineactivetoken 216 {\greekPsi} % 03A8 GREEK CAPITAL LETTER PSI +\defineactivetoken 217 {\greekOmega} % 03A9 GREEK CAPITAL LETTER OMEGA +\defineactivetoken 218 {\greekIotadialytika} % 03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA +\defineactivetoken 219 {\greekUpsilondialytika} % 03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA +\defineactivetoken 220 {\greekalphatonos} % 03AC GREEK SMALL LETTER ALPHA WITH TONOS +\defineactivetoken 221 {\greekepsilontonos} % 03AD GREEK SMALL LETTER EPSILON WITH TONOS +\defineactivetoken 222 {\greeketatonos} % 03AE GREEK SMALL LETTER ETA WITH TONOS +\defineactivetoken 223 {\greekiotatonos} % 03AF GREEK SMALL LETTER IOTA WITH TONOS +\defineactivetoken 224 {\greekupsilondialytikatonos} % 03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS +\defineactivetoken 225 {\greekalpha} % 03B1 GREEK SMALL LETTER ALPHA +\defineactivetoken 226 {\greekbeta} % 03B2 GREEK SMALL LETTER BETA +\defineactivetoken 227 {\greekgamma} % 03B3 GREEK SMALL LETTER GAMMA +\defineactivetoken 228 {\greekdelta} % 03B4 GREEK SMALL LETTER DELTA +\defineactivetoken 229 {\greekepsilon} % 03B5 GREEK SMALL LETTER EPSILON +\defineactivetoken 230 {\greekzeta} % 03B6 GREEK SMALL LETTER ZETA +\defineactivetoken 231 {\greeketa} % 03B7 GREEK SMALL LETTER ETA +\defineactivetoken 232 {\greektheta} % 03B8 GREEK SMALL LETTER THETA +\defineactivetoken 233 {\greekiota} % 03B9 GREEK SMALL LETTER IOTA +\defineactivetoken 234 {\greekkappa} % 03BA GREEK SMALL LETTER KAPPA +\defineactivetoken 235 {\greeklambda} % 03BB GREEK SMALL LETTER LAMDA +\defineactivetoken 236 {\greekmu} % 03BC GREEK SMALL LETTER MU +\defineactivetoken 237 {\greeknu} % 03BD GREEK SMALL LETTER NU +\defineactivetoken 238 {\greekxi} % 03BE GREEK SMALL LETTER XI +\defineactivetoken 239 {\greekomicron} % 03BF GREEK SMALL LETTER OMICRON +\defineactivetoken 240 {\greekpi} % 03C0 GREEK SMALL LETTER PI +\defineactivetoken 241 {\greekrho} % 03C1 GREEK SMALL LETTER RHO +\defineactivetoken 242 {\greekfinalsigma} % 03C2 GREEK SMALL LETTER FINAL SIGMA +\defineactivetoken 243 {\greeksigma} % 03C3 GREEK SMALL LETTER SIGMA +\defineactivetoken 244 {\greektau} % 03C4 GREEK SMALL LETTER TAU +\defineactivetoken 245 {\greekupsilon} % 03C5 GREEK SMALL LETTER UPSILON +\defineactivetoken 246 {\greekphi} % 03C6 GREEK SMALL LETTER PHI +\defineactivetoken 247 {\greekchi} % 03C7 GREEK SMALL LETTER CHI +\defineactivetoken 248 {\greekpsi} % 03C8 GREEK SMALL LETTER PSI +\defineactivetoken 249 {\greekomega} % 03C9 GREEK SMALL LETTER OMEGA +\defineactivetoken 250 {\greekiotadialytika} % 03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA +\defineactivetoken 251 {\greekupsilondiaeresis} % 03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA +\defineactivetoken 252 {\greekomicrontonos} % 03CC GREEK SMALL LETTER OMICRON WITH TONOS +\defineactivetoken 253 {\greekupsilontonos} % 03CD GREEK SMALL LETTER UPSILON WITH TONOS +\defineactivetoken 254 {\greekomegatonos} % 03CE GREEK SMALL LETTER OMEGA WITH TONOS +\defineactivetoken 255 {\unknownchar} % + +\stopregime + diff --git a/tex/context/base/regi-8859-7.tex b/tex/context/base/regi-8859-7.tex deleted file mode 100644 index 80259be65..000000000 --- a/tex/context/base/regi-8859-7.tex +++ /dev/null @@ -1,153 +0,0 @@ -%D \module -%D [ file=regi-8859-7, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-7 (Greek), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-7 input encoding (regime) for Greek, -%D see also cp1253. -%D -%D (Contributor to the original file: Apostolos Syropoulos.) -%D -%D Usage: \type{\enableregime[8859-7]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[8859-7] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK -\defineactivetoken 162 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\texteuro} % 20AC EURO SIGN -\defineactivetoken 165 {\unknownchar} % 20AF DRACHMA SIGN (TODO) -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\unknownchar} % 037A GREEK YPOGEGRAMMENI (TODO) -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 175 {\texthorizontalbar} % 2015 HORIZONTAL BAR -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\greektonos} % 0384 GREEK TONOS -\defineactivetoken 181 {\greekdialytikatonos} % 0385 GREEK DIALYTIKA TONOS -\defineactivetoken 182 {\greekAlphatonos} % 0386 GREEK CAPITAL LETTER ALPHA WITH TONOS -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\greekEpsilontonos} % 0388 GREEK CAPITAL LETTER EPSILON WITH TONOS -\defineactivetoken 185 {\greekEtatonos} % 0389 GREEK CAPITAL LETTER ETA WITH TONOS -\defineactivetoken 186 {\greekIotatonos} % 038A GREEK CAPITAL LETTER IOTA WITH TONOS -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\greekOmicrontonos} % 038C GREEK CAPITAL LETTER OMICRON WITH TONOS -\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF -\defineactivetoken 190 {\greekUpsilontonos} % 038E GREEK CAPITAL LETTER UPSILON WITH TONOS -\defineactivetoken 191 {\greekOmegatonos} % 038F GREEK CAPITAL LETTER OMEGA WITH TONOS -\defineactivetoken 192 {\greekiotadialytikatonos} % 0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS -\defineactivetoken 193 {\greekAlpha} % 0391 GREEK CAPITAL LETTER ALPHA -\defineactivetoken 194 {\greekBeta} % 0392 GREEK CAPITAL LETTER BETA -\defineactivetoken 195 {\greekGamma} % 0393 GREEK CAPITAL LETTER GAMMA -\defineactivetoken 196 {\greekDelta} % 0394 GREEK CAPITAL LETTER DELTA -\defineactivetoken 197 {\greekEpsilon} % 0395 GREEK CAPITAL LETTER EPSILON -\defineactivetoken 198 {\greekZeta} % 0396 GREEK CAPITAL LETTER ZETA -\defineactivetoken 199 {\greekEta} % 0397 GREEK CAPITAL LETTER ETA -\defineactivetoken 200 {\greekTheta} % 0398 GREEK CAPITAL LETTER THETA -\defineactivetoken 201 {\greekIota} % 0399 GREEK CAPITAL LETTER IOTA -\defineactivetoken 202 {\greekKappa} % 039A GREEK CAPITAL LETTER KAPPA -\defineactivetoken 203 {\greekLambda} % 039B GREEK CAPITAL LETTER LAMDA -\defineactivetoken 204 {\greekMu} % 039C GREEK CAPITAL LETTER MU -\defineactivetoken 205 {\greekNu} % 039D GREEK CAPITAL LETTER NU -\defineactivetoken 206 {\greekXi} % 039E GREEK CAPITAL LETTER XI -\defineactivetoken 207 {\greekOmicron} % 039F GREEK CAPITAL LETTER OMICRON -\defineactivetoken 208 {\greekPi} % 03A0 GREEK CAPITAL LETTER PI -\defineactivetoken 209 {\greekRho} % 03A1 GREEK CAPITAL LETTER RHO -\defineactivetoken 210 {\unknownchar} % -\defineactivetoken 211 {\greekSigma} % 03A3 GREEK CAPITAL LETTER SIGMA -\defineactivetoken 212 {\greekTau} % 03A4 GREEK CAPITAL LETTER TAU -\defineactivetoken 213 {\greekUpsilon} % 03A5 GREEK CAPITAL LETTER UPSILON -\defineactivetoken 214 {\greekPhi} % 03A6 GREEK CAPITAL LETTER PHI -\defineactivetoken 215 {\greekChi} % 03A7 GREEK CAPITAL LETTER CHI -\defineactivetoken 216 {\greekPsi} % 03A8 GREEK CAPITAL LETTER PSI -\defineactivetoken 217 {\greekOmega} % 03A9 GREEK CAPITAL LETTER OMEGA -\defineactivetoken 218 {\greekIotadialytika} % 03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA -\defineactivetoken 219 {\greekUpsilondialytika} % 03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA -\defineactivetoken 220 {\greekalphatonos} % 03AC GREEK SMALL LETTER ALPHA WITH TONOS -\defineactivetoken 221 {\greekepsilontonos} % 03AD GREEK SMALL LETTER EPSILON WITH TONOS -\defineactivetoken 222 {\greeketatonos} % 03AE GREEK SMALL LETTER ETA WITH TONOS -\defineactivetoken 223 {\greekiotatonos} % 03AF GREEK SMALL LETTER IOTA WITH TONOS -\defineactivetoken 224 {\greekupsilondialytikatonos} % 03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS -\defineactivetoken 225 {\greekalpha} % 03B1 GREEK SMALL LETTER ALPHA -\defineactivetoken 226 {\greekbeta} % 03B2 GREEK SMALL LETTER BETA -\defineactivetoken 227 {\greekgamma} % 03B3 GREEK SMALL LETTER GAMMA -\defineactivetoken 228 {\greekdelta} % 03B4 GREEK SMALL LETTER DELTA -\defineactivetoken 229 {\greekepsilon} % 03B5 GREEK SMALL LETTER EPSILON -\defineactivetoken 230 {\greekzeta} % 03B6 GREEK SMALL LETTER ZETA -\defineactivetoken 231 {\greeketa} % 03B7 GREEK SMALL LETTER ETA -\defineactivetoken 232 {\greektheta} % 03B8 GREEK SMALL LETTER THETA -\defineactivetoken 233 {\greekiota} % 03B9 GREEK SMALL LETTER IOTA -\defineactivetoken 234 {\greekkappa} % 03BA GREEK SMALL LETTER KAPPA -\defineactivetoken 235 {\greeklambda} % 03BB GREEK SMALL LETTER LAMDA -\defineactivetoken 236 {\greekmu} % 03BC GREEK SMALL LETTER MU -\defineactivetoken 237 {\greeknu} % 03BD GREEK SMALL LETTER NU -\defineactivetoken 238 {\greekxi} % 03BE GREEK SMALL LETTER XI -\defineactivetoken 239 {\greekomicron} % 03BF GREEK SMALL LETTER OMICRON -\defineactivetoken 240 {\greekpi} % 03C0 GREEK SMALL LETTER PI -\defineactivetoken 241 {\greekrho} % 03C1 GREEK SMALL LETTER RHO -\defineactivetoken 242 {\greekfinalsigma} % 03C2 GREEK SMALL LETTER FINAL SIGMA -\defineactivetoken 243 {\greeksigma} % 03C3 GREEK SMALL LETTER SIGMA -\defineactivetoken 244 {\greektau} % 03C4 GREEK SMALL LETTER TAU -\defineactivetoken 245 {\greekupsilon} % 03C5 GREEK SMALL LETTER UPSILON -\defineactivetoken 246 {\greekphi} % 03C6 GREEK SMALL LETTER PHI -\defineactivetoken 247 {\greekchi} % 03C7 GREEK SMALL LETTER CHI -\defineactivetoken 248 {\greekpsi} % 03C8 GREEK SMALL LETTER PSI -\defineactivetoken 249 {\greekomega} % 03C9 GREEK SMALL LETTER OMEGA -\defineactivetoken 250 {\greekiotadialytika} % 03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA -\defineactivetoken 251 {\greekupsilondiaeresis} % 03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA -\defineactivetoken 252 {\greekomicrontonos} % 03CC GREEK SMALL LETTER OMICRON WITH TONOS -\defineactivetoken 253 {\greekupsilontonos} % 03CD GREEK SMALL LETTER UPSILON WITH TONOS -\defineactivetoken 254 {\greekomegatonos} % 03CE GREEK SMALL LETTER OMEGA WITH TONOS -\defineactivetoken 255 {\unknownchar} % - -\stopregime - diff --git a/tex/context/base/regi-8859-9.mkii b/tex/context/base/regi-8859-9.mkii new file mode 100644 index 000000000..8460d739b --- /dev/null +++ b/tex/context/base/regi-8859-9.mkii @@ -0,0 +1,152 @@ +%D \module +%D [ file=regi-8859-9, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=iso-8859-9 (Turkish), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for iso-8859-9/Latin5 input encoding (regime) for Turkish, +%D see also cp1254. +%D +%D Usage: \type{\enableregime[8859-9]} (see \type {regi-syn} for +%D alternatives calls). + +\startregime[8859-9] + +\defineactivetoken 128 {\unknownchar} % 0080 +\defineactivetoken 129 {\unknownchar} % 0081 +\defineactivetoken 130 {\unknownchar} % 0082 +\defineactivetoken 131 {\unknownchar} % 0083 +\defineactivetoken 132 {\unknownchar} % 0084 +\defineactivetoken 133 {\unknownchar} % 0085 +\defineactivetoken 134 {\unknownchar} % 0086 +\defineactivetoken 135 {\unknownchar} % 0087 +\defineactivetoken 136 {\unknownchar} % 0088 +\defineactivetoken 137 {\unknownchar} % 0089 +\defineactivetoken 138 {\unknownchar} % 008A +\defineactivetoken 139 {\unknownchar} % 008B +\defineactivetoken 140 {\unknownchar} % 008C +\defineactivetoken 141 {\unknownchar} % 008D +\defineactivetoken 142 {\unknownchar} % 008E +\defineactivetoken 143 {\unknownchar} % 008F +\defineactivetoken 144 {\unknownchar} % 0090 +\defineactivetoken 145 {\unknownchar} % 0091 +\defineactivetoken 146 {\unknownchar} % 0092 +\defineactivetoken 147 {\unknownchar} % 0093 +\defineactivetoken 148 {\unknownchar} % 0094 +\defineactivetoken 149 {\unknownchar} % 0095 +\defineactivetoken 150 {\unknownchar} % 0096 +\defineactivetoken 151 {\unknownchar} % 0097 +\defineactivetoken 152 {\unknownchar} % 0098 +\defineactivetoken 153 {\unknownchar} % 0099 +\defineactivetoken 154 {\unknownchar} % 009A +\defineactivetoken 155 {\unknownchar} % 009B +\defineactivetoken 156 {\unknownchar} % 009C +\defineactivetoken 157 {\unknownchar} % 009D +\defineactivetoken 158 {\unknownchar} % 009E +\defineactivetoken 159 {\unknownchar} % 009F +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK +\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\textmacron} % 00AF MACRON +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA +\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE +\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER +\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF +\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS +\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK +\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA +\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS +\defineactivetoken 208 {\Gbreve} % 011E LATIN CAPITAL LETTER G WITH BREVE +\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE +\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE +\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Idotaccent} % 0130 LATIN CAPITAL LETTER I WITH DOT ABOVE +\defineactivetoken 222 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE +\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA +\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS +\defineactivetoken 240 {\gbreve} % 011F LATIN SMALL LETTER G WITH BREVE +\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE +\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE +\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\dotlessi} % 0131 LATIN SMALL LETTER DOTLESS I +\defineactivetoken 254 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA +\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS + +\stopregime + diff --git a/tex/context/base/regi-8859-9.tex b/tex/context/base/regi-8859-9.tex deleted file mode 100644 index 8460d739b..000000000 --- a/tex/context/base/regi-8859-9.tex +++ /dev/null @@ -1,152 +0,0 @@ -%D \module -%D [ file=regi-8859-9, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=iso-8859-9 (Turkish), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for iso-8859-9/Latin5 input encoding (regime) for Turkish, -%D see also cp1254. -%D -%D Usage: \type{\enableregime[8859-9]} (see \type {regi-syn} for -%D alternatives calls). - -\startregime[8859-9] - -\defineactivetoken 128 {\unknownchar} % 0080 -\defineactivetoken 129 {\unknownchar} % 0081 -\defineactivetoken 130 {\unknownchar} % 0082 -\defineactivetoken 131 {\unknownchar} % 0083 -\defineactivetoken 132 {\unknownchar} % 0084 -\defineactivetoken 133 {\unknownchar} % 0085 -\defineactivetoken 134 {\unknownchar} % 0086 -\defineactivetoken 135 {\unknownchar} % 0087 -\defineactivetoken 136 {\unknownchar} % 0088 -\defineactivetoken 137 {\unknownchar} % 0089 -\defineactivetoken 138 {\unknownchar} % 008A -\defineactivetoken 139 {\unknownchar} % 008B -\defineactivetoken 140 {\unknownchar} % 008C -\defineactivetoken 141 {\unknownchar} % 008D -\defineactivetoken 142 {\unknownchar} % 008E -\defineactivetoken 143 {\unknownchar} % 008F -\defineactivetoken 144 {\unknownchar} % 0090 -\defineactivetoken 145 {\unknownchar} % 0091 -\defineactivetoken 146 {\unknownchar} % 0092 -\defineactivetoken 147 {\unknownchar} % 0093 -\defineactivetoken 148 {\unknownchar} % 0094 -\defineactivetoken 149 {\unknownchar} % 0095 -\defineactivetoken 150 {\unknownchar} % 0096 -\defineactivetoken 151 {\unknownchar} % 0097 -\defineactivetoken 152 {\unknownchar} % 0098 -\defineactivetoken 153 {\unknownchar} % 0099 -\defineactivetoken 154 {\unknownchar} % 009A -\defineactivetoken 155 {\unknownchar} % 009B -\defineactivetoken 156 {\unknownchar} % 009C -\defineactivetoken 157 {\unknownchar} % 009D -\defineactivetoken 158 {\unknownchar} % 009E -\defineactivetoken 159 {\unknownchar} % 009F -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK -\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\textmacron} % 00AF MACRON -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA -\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE -\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER -\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF -\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS -\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK -\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE -\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA -\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS -\defineactivetoken 208 {\Gbreve} % 011E LATIN CAPITAL LETTER G WITH BREVE -\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE -\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE -\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Idotaccent} % 0130 LATIN CAPITAL LETTER I WITH DOT ABOVE -\defineactivetoken 222 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE -\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA -\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS -\defineactivetoken 240 {\gbreve} % 011F LATIN SMALL LETTER G WITH BREVE -\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE -\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE -\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\dotlessi} % 0131 LATIN SMALL LETTER DOTLESS I -\defineactivetoken 254 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA -\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS - -\stopregime - diff --git a/tex/context/base/regi-cp1250.mkii b/tex/context/base/regi-cp1250.mkii new file mode 100644 index 000000000..b92eb5e31 --- /dev/null +++ b/tex/context/base/regi-cp1250.mkii @@ -0,0 +1,153 @@ +%D \module +%D [ file=regi-cp1250, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=cp1250 (East European), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for cp1250 input encoding (regime) for Central European languages, +%D see also iso-8859-2. +%D +%D Usage: +%D \type{\enableregime[cp1250]} or \type{\enablereregime[windows-1250]} + + +\startregime[cp1250] + +\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN +\defineactivetoken 129 {\unknownchar} % +\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK +\defineactivetoken 131 {\unknownchar} % +\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK +\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS +\defineactivetoken 134 {\textdag} % 2020 DAGGER +\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER +\defineactivetoken 136 {\unknownchar} % +\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN +\defineactivetoken 138 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 140 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE +\defineactivetoken 141 {\Tcaron} % 0164 LATIN CAPITAL LETTER T WITH CARON +\defineactivetoken 142 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON +\defineactivetoken 143 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE +\defineactivetoken 144 {\unknownchar} % +\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK +\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK +\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK +\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK +\defineactivetoken 149 {\textbullet} % 2022 BULLET +\defineactivetoken 150 {\endash} % 2013 EN DASH +\defineactivetoken 151 {\emdash} % 2014 EM DASH +\defineactivetoken 152 {\unknownchar} % +\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN +\defineactivetoken 154 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 156 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE +\defineactivetoken 157 {\tcaron} % 0165 LATIN SMALL LETTER T WITH CARON +\defineactivetoken 158 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON +\defineactivetoken 159 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\textcaron} % 02C7 CARON +\defineactivetoken 162 {\textbreve} % 02D8 BREVE +\defineactivetoken 163 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\textogonek} % 02DB OGONEK +\defineactivetoken 179 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE +\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA +\defineactivetoken 185 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK +\defineactivetoken 186 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\Lcaron} % 013D LATIN CAPITAL LETTER L WITH CARON +\defineactivetoken 189 {\texthungarumlaut} % 02DD DOUBLE ACUTE ACCENT +\defineactivetoken 190 {\lcaron} % 013E LATIN SMALL LETTER L WITH CARON +\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE +\defineactivetoken 192 {\Racute} % 0154 LATIN CAPITAL LETTER R WITH ACUTE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Lacute} % 0139 LATIN CAPITAL LETTER L WITH ACUTE +\defineactivetoken 198 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE +\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA +\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Ecaron} % 011A LATIN CAPITAL LETTER E WITH CARON +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Dcaron} % 010E LATIN CAPITAL LETTER D WITH CARON +\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE +\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE +\defineactivetoken 210 {\Ncaron} % 0147 LATIN CAPITAL LETTER N WITH CARON +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Ohungarumlaut} % 0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Rcaron} % 0158 LATIN CAPITAL LETTER R WITH CARON +\defineactivetoken 217 {\Uring} % 016E LATIN CAPITAL LETTER U WITH RING ABOVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Uhungarumlaut} % 0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE +\defineactivetoken 222 {\Tcedilla} % 0162 LATIN CAPITAL LETTER T WITH CEDILLA +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\racute} % 0155 LATIN SMALL LETTER R WITH ACUTE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\lacute} % 013A LATIN SMALL LETTER L WITH ACUTE +\defineactivetoken 230 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE +\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA +\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\ecaron} % 011B LATIN SMALL LETTER E WITH CARON +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\dcaron} % 010F LATIN SMALL LETTER D WITH CARON +\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE +\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE +\defineactivetoken 242 {\ncaron} % 0148 LATIN SMALL LETTER N WITH CARON +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\ohungarumlaut} % 0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\rcaron} % 0159 LATIN SMALL LETTER R WITH CARON +\defineactivetoken 249 {\uring} % 016F LATIN SMALL LETTER U WITH RING ABOVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\uhungarumlaut} % 0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE +\defineactivetoken 254 {\tcedilla} % 0163 LATIN SMALL LETTER T WITH CEDILLA +\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE + +\stopregime + diff --git a/tex/context/base/regi-cp1250.tex b/tex/context/base/regi-cp1250.tex deleted file mode 100644 index b92eb5e31..000000000 --- a/tex/context/base/regi-cp1250.tex +++ /dev/null @@ -1,153 +0,0 @@ -%D \module -%D [ file=regi-cp1250, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=cp1250 (East European), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for cp1250 input encoding (regime) for Central European languages, -%D see also iso-8859-2. -%D -%D Usage: -%D \type{\enableregime[cp1250]} or \type{\enablereregime[windows-1250]} - - -\startregime[cp1250] - -\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN -\defineactivetoken 129 {\unknownchar} % -\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK -\defineactivetoken 131 {\unknownchar} % -\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK -\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS -\defineactivetoken 134 {\textdag} % 2020 DAGGER -\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER -\defineactivetoken 136 {\unknownchar} % -\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN -\defineactivetoken 138 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 140 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE -\defineactivetoken 141 {\Tcaron} % 0164 LATIN CAPITAL LETTER T WITH CARON -\defineactivetoken 142 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON -\defineactivetoken 143 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE -\defineactivetoken 144 {\unknownchar} % -\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK -\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK -\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK -\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK -\defineactivetoken 149 {\textbullet} % 2022 BULLET -\defineactivetoken 150 {\endash} % 2013 EN DASH -\defineactivetoken 151 {\emdash} % 2014 EM DASH -\defineactivetoken 152 {\unknownchar} % -\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN -\defineactivetoken 154 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 156 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE -\defineactivetoken 157 {\tcaron} % 0165 LATIN SMALL LETTER T WITH CARON -\defineactivetoken 158 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON -\defineactivetoken 159 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\textcaron} % 02C7 CARON -\defineactivetoken 162 {\textbreve} % 02D8 BREVE -\defineactivetoken 163 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\textogonek} % 02DB OGONEK -\defineactivetoken 179 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE -\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA -\defineactivetoken 185 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK -\defineactivetoken 186 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\Lcaron} % 013D LATIN CAPITAL LETTER L WITH CARON -\defineactivetoken 189 {\texthungarumlaut} % 02DD DOUBLE ACUTE ACCENT -\defineactivetoken 190 {\lcaron} % 013E LATIN SMALL LETTER L WITH CARON -\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE -\defineactivetoken 192 {\Racute} % 0154 LATIN CAPITAL LETTER R WITH ACUTE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Lacute} % 0139 LATIN CAPITAL LETTER L WITH ACUTE -\defineactivetoken 198 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE -\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA -\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Ecaron} % 011A LATIN CAPITAL LETTER E WITH CARON -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Dcaron} % 010E LATIN CAPITAL LETTER D WITH CARON -\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE -\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE -\defineactivetoken 210 {\Ncaron} % 0147 LATIN CAPITAL LETTER N WITH CARON -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Ohungarumlaut} % 0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Rcaron} % 0158 LATIN CAPITAL LETTER R WITH CARON -\defineactivetoken 217 {\Uring} % 016E LATIN CAPITAL LETTER U WITH RING ABOVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Uhungarumlaut} % 0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE -\defineactivetoken 222 {\Tcedilla} % 0162 LATIN CAPITAL LETTER T WITH CEDILLA -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\racute} % 0155 LATIN SMALL LETTER R WITH ACUTE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\lacute} % 013A LATIN SMALL LETTER L WITH ACUTE -\defineactivetoken 230 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE -\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA -\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\ecaron} % 011B LATIN SMALL LETTER E WITH CARON -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\dcaron} % 010F LATIN SMALL LETTER D WITH CARON -\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE -\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE -\defineactivetoken 242 {\ncaron} % 0148 LATIN SMALL LETTER N WITH CARON -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\ohungarumlaut} % 0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\rcaron} % 0159 LATIN SMALL LETTER R WITH CARON -\defineactivetoken 249 {\uring} % 016F LATIN SMALL LETTER U WITH RING ABOVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\uhungarumlaut} % 0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE -\defineactivetoken 254 {\tcedilla} % 0163 LATIN SMALL LETTER T WITH CEDILLA -\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE - -\stopregime - diff --git a/tex/context/base/regi-cp1251.mkii b/tex/context/base/regi-cp1251.mkii new file mode 100644 index 000000000..60f04170b --- /dev/null +++ b/tex/context/base/regi-cp1251.mkii @@ -0,0 +1,152 @@ +%D \module +%D [ file=regi-cp1251, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=cp1251 (Cyrillic), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for cp1251 input encoding (regime) for Cyrillic. +%D +%D Usage: +%D \type{\enableregime[cp1251]} or \type{\enablereregime[windows-1251]} + + +\startregime[cp1251] + +\defineactivetoken 128 {\cyrillicDJE} % 0402 CYRILLIC CAPITAL LETTER DJE +\defineactivetoken 129 {\cyrillicGJE} % 0403 CYRILLIC CAPITAL LETTER GJE +\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK +\defineactivetoken 131 {\cyrillicgje} % 0453 CYRILLIC SMALL LETTER GJE +\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK +\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS +\defineactivetoken 134 {\textdag} % 2020 DAGGER +\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER +\defineactivetoken 136 {\texteuro} % 20AC EURO SIGN +\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN +\defineactivetoken 138 {\cyrillicLJE} % 0409 CYRILLIC CAPITAL LETTER LJE +\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 140 {\cyrillicNJE} % 040A CYRILLIC CAPITAL LETTER NJE +\defineactivetoken 141 {\cyrillicKJE} % 040C CYRILLIC CAPITAL LETTER KJE +\defineactivetoken 142 {\cyrillicTSHE} % 040B CYRILLIC CAPITAL LETTER TSHE +\defineactivetoken 143 {\cyrillicDZHE} % 040F CYRILLIC CAPITAL LETTER DZHE +\defineactivetoken 144 {\cyrillicdje} % 0452 CYRILLIC SMALL LETTER DJE +\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK +\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK +\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK +\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK +\defineactivetoken 149 {\textbullet} % 2022 BULLET +\defineactivetoken 150 {\endash} % 2013 EN DASH +\defineactivetoken 151 {\emdash} % 2014 EM DASH +\defineactivetoken 152 {\unknownchar} % +\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN +\defineactivetoken 154 {\cyrilliclje} % 0459 CYRILLIC SMALL LETTER LJE +\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 156 {\cyrillicnje} % 045A CYRILLIC SMALL LETTER NJE +\defineactivetoken 157 {\cyrillickje} % 045C CYRILLIC SMALL LETTER KJE +\defineactivetoken 158 {\cyrillictshe} % 045B CYRILLIC SMALL LETTER TSHE +\defineactivetoken 159 {\cyrillicdzhe} % 045F CYRILLIC SMALL LETTER DZHE +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\cyrillicUSHRT} % 040E CYRILLIC CAPITAL LETTER SHORT U +\defineactivetoken 162 {\cyrillicushrt} % 045E CYRILLIC SMALL LETTER SHORT U +\defineactivetoken 163 {\cyrillicJE} % 0408 CYRILLIC CAPITAL LETTER JE +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\cyrillicGHEupturn} % 0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\cyrillicYO} % 0401 CYRILLIC CAPITAL LETTER IO +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\cyrillicIE} % 0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\cyrillicYI} % 0407 CYRILLIC CAPITAL LETTER YI +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\cyrillicII} % 0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +\defineactivetoken 179 {\cyrillicii} % 0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +\defineactivetoken 180 {\cyrillicgheupturn} % 0491 CYRILLIC SMALL LETTER GHE WITH UPTURN +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\cyrillicyo} % 0451 CYRILLIC SMALL LETTER IO +\defineactivetoken 185 {\textnumero} % 2116 NUMERO SIGN +\defineactivetoken 186 {\cyrillicie} % 0454 CYRILLIC SMALL LETTER UKRAINIAN IE +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\cyrillicje} % 0458 CYRILLIC SMALL LETTER JE +\defineactivetoken 189 {\cyrillicDZE} % 0405 CYRILLIC CAPITAL LETTER DZE +\defineactivetoken 190 {\cyrillicdze} % 0455 CYRILLIC SMALL LETTER DZE +\defineactivetoken 191 {\cyrillicyi} % 0457 CYRILLIC SMALL LETTER YI +\defineactivetoken 192 {\cyrillicA} % 0410 CYRILLIC CAPITAL LETTER A +\defineactivetoken 193 {\cyrillicB} % 0411 CYRILLIC CAPITAL LETTER BE +\defineactivetoken 194 {\cyrillicV} % 0412 CYRILLIC CAPITAL LETTER VE +\defineactivetoken 195 {\cyrillicG} % 0413 CYRILLIC CAPITAL LETTER GHE +\defineactivetoken 196 {\cyrillicD} % 0414 CYRILLIC CAPITAL LETTER DE +\defineactivetoken 197 {\cyrillicE} % 0415 CYRILLIC CAPITAL LETTER IE +\defineactivetoken 198 {\cyrillicZH} % 0416 CYRILLIC CAPITAL LETTER ZHE +\defineactivetoken 199 {\cyrillicZ} % 0417 CYRILLIC CAPITAL LETTER ZE +\defineactivetoken 200 {\cyrillicI} % 0418 CYRILLIC CAPITAL LETTER I +\defineactivetoken 201 {\cyrillicISHRT} % 0419 CYRILLIC CAPITAL LETTER SHORT I +\defineactivetoken 202 {\cyrillicK} % 041A CYRILLIC CAPITAL LETTER KA +\defineactivetoken 203 {\cyrillicL} % 041B CYRILLIC CAPITAL LETTER EL +\defineactivetoken 204 {\cyrillicM} % 041C CYRILLIC CAPITAL LETTER EM +\defineactivetoken 205 {\cyrillicN} % 041D CYRILLIC CAPITAL LETTER EN +\defineactivetoken 206 {\cyrillicO} % 041E CYRILLIC CAPITAL LETTER O +\defineactivetoken 207 {\cyrillicP} % 041F CYRILLIC CAPITAL LETTER PE +\defineactivetoken 208 {\cyrillicR} % 0420 CYRILLIC CAPITAL LETTER ER +\defineactivetoken 209 {\cyrillicS} % 0421 CYRILLIC CAPITAL LETTER ES +\defineactivetoken 210 {\cyrillicT} % 0422 CYRILLIC CAPITAL LETTER TE +\defineactivetoken 211 {\cyrillicU} % 0423 CYRILLIC CAPITAL LETTER U +\defineactivetoken 212 {\cyrillicF} % 0424 CYRILLIC CAPITAL LETTER EF +\defineactivetoken 213 {\cyrillicH} % 0425 CYRILLIC CAPITAL LETTER HA +\defineactivetoken 214 {\cyrillicC} % 0426 CYRILLIC CAPITAL LETTER TSE +\defineactivetoken 215 {\cyrillicCH} % 0427 CYRILLIC CAPITAL LETTER CHE +\defineactivetoken 216 {\cyrillicSH} % 0428 CYRILLIC CAPITAL LETTER SHA +\defineactivetoken 217 {\cyrillicSHCH} % 0429 CYRILLIC CAPITAL LETTER SHCHA +\defineactivetoken 218 {\cyrillicHRDSN} % 042A CYRILLIC CAPITAL LETTER HARD SIGN +\defineactivetoken 219 {\cyrillicERY} % 042B CYRILLIC CAPITAL LETTER YERU +\defineactivetoken 220 {\cyrillicSFTSN} % 042C CYRILLIC CAPITAL LETTER SOFT SIGN +\defineactivetoken 221 {\cyrillicEREV} % 042D CYRILLIC CAPITAL LETTER E +\defineactivetoken 222 {\cyrillicYU} % 042E CYRILLIC CAPITAL LETTER YU +\defineactivetoken 223 {\cyrillicYA} % 042F CYRILLIC CAPITAL LETTER YA +\defineactivetoken 224 {\cyrillica} % 0430 CYRILLIC SMALL LETTER A +\defineactivetoken 225 {\cyrillicb} % 0431 CYRILLIC SMALL LETTER BE +\defineactivetoken 226 {\cyrillicv} % 0432 CYRILLIC SMALL LETTER VE +\defineactivetoken 227 {\cyrillicg} % 0433 CYRILLIC SMALL LETTER GHE +\defineactivetoken 228 {\cyrillicd} % 0434 CYRILLIC SMALL LETTER DE +\defineactivetoken 229 {\cyrillice} % 0435 CYRILLIC SMALL LETTER IE +\defineactivetoken 230 {\cyrilliczh} % 0436 CYRILLIC SMALL LETTER ZHE +\defineactivetoken 231 {\cyrillicz} % 0437 CYRILLIC SMALL LETTER ZE +\defineactivetoken 232 {\cyrillici} % 0438 CYRILLIC SMALL LETTER I +\defineactivetoken 233 {\cyrillicishrt} % 0439 CYRILLIC SMALL LETTER SHORT I +\defineactivetoken 234 {\cyrillick} % 043A CYRILLIC SMALL LETTER KA +\defineactivetoken 235 {\cyrillicl} % 043B CYRILLIC SMALL LETTER EL +\defineactivetoken 236 {\cyrillicm} % 043C CYRILLIC SMALL LETTER EM +\defineactivetoken 237 {\cyrillicn} % 043D CYRILLIC SMALL LETTER EN +\defineactivetoken 238 {\cyrillico} % 043E CYRILLIC SMALL LETTER O +\defineactivetoken 239 {\cyrillicp} % 043F CYRILLIC SMALL LETTER PE +\defineactivetoken 240 {\cyrillicr} % 0440 CYRILLIC SMALL LETTER ER +\defineactivetoken 241 {\cyrillics} % 0441 CYRILLIC SMALL LETTER ES +\defineactivetoken 242 {\cyrillict} % 0442 CYRILLIC SMALL LETTER TE +\defineactivetoken 243 {\cyrillicu} % 0443 CYRILLIC SMALL LETTER U +\defineactivetoken 244 {\cyrillicf} % 0444 CYRILLIC SMALL LETTER EF +\defineactivetoken 245 {\cyrillich} % 0445 CYRILLIC SMALL LETTER HA +\defineactivetoken 246 {\cyrillicc} % 0446 CYRILLIC SMALL LETTER TSE +\defineactivetoken 247 {\cyrillicch} % 0447 CYRILLIC SMALL LETTER CHE +\defineactivetoken 248 {\cyrillicsh} % 0448 CYRILLIC SMALL LETTER SHA +\defineactivetoken 249 {\cyrillicshch} % 0449 CYRILLIC SMALL LETTER SHCHA +\defineactivetoken 250 {\cyrillichrdsn} % 044A CYRILLIC SMALL LETTER HARD SIGN +\defineactivetoken 251 {\cyrillicery} % 044B CYRILLIC SMALL LETTER YERU +\defineactivetoken 252 {\cyrillicsftsn} % 044C CYRILLIC SMALL LETTER SOFT SIGN +\defineactivetoken 253 {\cyrillicerev} % 044D CYRILLIC SMALL LETTER E +\defineactivetoken 254 {\cyrillicyu} % 044E CYRILLIC SMALL LETTER YU +\defineactivetoken 255 {\cyrillicya} % 044F CYRILLIC SMALL LETTER YA + +\stopregime + diff --git a/tex/context/base/regi-cp1251.tex b/tex/context/base/regi-cp1251.tex deleted file mode 100644 index 60f04170b..000000000 --- a/tex/context/base/regi-cp1251.tex +++ /dev/null @@ -1,152 +0,0 @@ -%D \module -%D [ file=regi-cp1251, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=cp1251 (Cyrillic), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for cp1251 input encoding (regime) for Cyrillic. -%D -%D Usage: -%D \type{\enableregime[cp1251]} or \type{\enablereregime[windows-1251]} - - -\startregime[cp1251] - -\defineactivetoken 128 {\cyrillicDJE} % 0402 CYRILLIC CAPITAL LETTER DJE -\defineactivetoken 129 {\cyrillicGJE} % 0403 CYRILLIC CAPITAL LETTER GJE -\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK -\defineactivetoken 131 {\cyrillicgje} % 0453 CYRILLIC SMALL LETTER GJE -\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK -\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS -\defineactivetoken 134 {\textdag} % 2020 DAGGER -\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER -\defineactivetoken 136 {\texteuro} % 20AC EURO SIGN -\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN -\defineactivetoken 138 {\cyrillicLJE} % 0409 CYRILLIC CAPITAL LETTER LJE -\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 140 {\cyrillicNJE} % 040A CYRILLIC CAPITAL LETTER NJE -\defineactivetoken 141 {\cyrillicKJE} % 040C CYRILLIC CAPITAL LETTER KJE -\defineactivetoken 142 {\cyrillicTSHE} % 040B CYRILLIC CAPITAL LETTER TSHE -\defineactivetoken 143 {\cyrillicDZHE} % 040F CYRILLIC CAPITAL LETTER DZHE -\defineactivetoken 144 {\cyrillicdje} % 0452 CYRILLIC SMALL LETTER DJE -\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK -\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK -\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK -\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK -\defineactivetoken 149 {\textbullet} % 2022 BULLET -\defineactivetoken 150 {\endash} % 2013 EN DASH -\defineactivetoken 151 {\emdash} % 2014 EM DASH -\defineactivetoken 152 {\unknownchar} % -\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN -\defineactivetoken 154 {\cyrilliclje} % 0459 CYRILLIC SMALL LETTER LJE -\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 156 {\cyrillicnje} % 045A CYRILLIC SMALL LETTER NJE -\defineactivetoken 157 {\cyrillickje} % 045C CYRILLIC SMALL LETTER KJE -\defineactivetoken 158 {\cyrillictshe} % 045B CYRILLIC SMALL LETTER TSHE -\defineactivetoken 159 {\cyrillicdzhe} % 045F CYRILLIC SMALL LETTER DZHE -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\cyrillicUSHRT} % 040E CYRILLIC CAPITAL LETTER SHORT U -\defineactivetoken 162 {\cyrillicushrt} % 045E CYRILLIC SMALL LETTER SHORT U -\defineactivetoken 163 {\cyrillicJE} % 0408 CYRILLIC CAPITAL LETTER JE -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\cyrillicGHEupturn} % 0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\cyrillicYO} % 0401 CYRILLIC CAPITAL LETTER IO -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\cyrillicIE} % 0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\cyrillicYI} % 0407 CYRILLIC CAPITAL LETTER YI -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\cyrillicII} % 0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I -\defineactivetoken 179 {\cyrillicii} % 0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -\defineactivetoken 180 {\cyrillicgheupturn} % 0491 CYRILLIC SMALL LETTER GHE WITH UPTURN -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\cyrillicyo} % 0451 CYRILLIC SMALL LETTER IO -\defineactivetoken 185 {\textnumero} % 2116 NUMERO SIGN -\defineactivetoken 186 {\cyrillicie} % 0454 CYRILLIC SMALL LETTER UKRAINIAN IE -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\cyrillicje} % 0458 CYRILLIC SMALL LETTER JE -\defineactivetoken 189 {\cyrillicDZE} % 0405 CYRILLIC CAPITAL LETTER DZE -\defineactivetoken 190 {\cyrillicdze} % 0455 CYRILLIC SMALL LETTER DZE -\defineactivetoken 191 {\cyrillicyi} % 0457 CYRILLIC SMALL LETTER YI -\defineactivetoken 192 {\cyrillicA} % 0410 CYRILLIC CAPITAL LETTER A -\defineactivetoken 193 {\cyrillicB} % 0411 CYRILLIC CAPITAL LETTER BE -\defineactivetoken 194 {\cyrillicV} % 0412 CYRILLIC CAPITAL LETTER VE -\defineactivetoken 195 {\cyrillicG} % 0413 CYRILLIC CAPITAL LETTER GHE -\defineactivetoken 196 {\cyrillicD} % 0414 CYRILLIC CAPITAL LETTER DE -\defineactivetoken 197 {\cyrillicE} % 0415 CYRILLIC CAPITAL LETTER IE -\defineactivetoken 198 {\cyrillicZH} % 0416 CYRILLIC CAPITAL LETTER ZHE -\defineactivetoken 199 {\cyrillicZ} % 0417 CYRILLIC CAPITAL LETTER ZE -\defineactivetoken 200 {\cyrillicI} % 0418 CYRILLIC CAPITAL LETTER I -\defineactivetoken 201 {\cyrillicISHRT} % 0419 CYRILLIC CAPITAL LETTER SHORT I -\defineactivetoken 202 {\cyrillicK} % 041A CYRILLIC CAPITAL LETTER KA -\defineactivetoken 203 {\cyrillicL} % 041B CYRILLIC CAPITAL LETTER EL -\defineactivetoken 204 {\cyrillicM} % 041C CYRILLIC CAPITAL LETTER EM -\defineactivetoken 205 {\cyrillicN} % 041D CYRILLIC CAPITAL LETTER EN -\defineactivetoken 206 {\cyrillicO} % 041E CYRILLIC CAPITAL LETTER O -\defineactivetoken 207 {\cyrillicP} % 041F CYRILLIC CAPITAL LETTER PE -\defineactivetoken 208 {\cyrillicR} % 0420 CYRILLIC CAPITAL LETTER ER -\defineactivetoken 209 {\cyrillicS} % 0421 CYRILLIC CAPITAL LETTER ES -\defineactivetoken 210 {\cyrillicT} % 0422 CYRILLIC CAPITAL LETTER TE -\defineactivetoken 211 {\cyrillicU} % 0423 CYRILLIC CAPITAL LETTER U -\defineactivetoken 212 {\cyrillicF} % 0424 CYRILLIC CAPITAL LETTER EF -\defineactivetoken 213 {\cyrillicH} % 0425 CYRILLIC CAPITAL LETTER HA -\defineactivetoken 214 {\cyrillicC} % 0426 CYRILLIC CAPITAL LETTER TSE -\defineactivetoken 215 {\cyrillicCH} % 0427 CYRILLIC CAPITAL LETTER CHE -\defineactivetoken 216 {\cyrillicSH} % 0428 CYRILLIC CAPITAL LETTER SHA -\defineactivetoken 217 {\cyrillicSHCH} % 0429 CYRILLIC CAPITAL LETTER SHCHA -\defineactivetoken 218 {\cyrillicHRDSN} % 042A CYRILLIC CAPITAL LETTER HARD SIGN -\defineactivetoken 219 {\cyrillicERY} % 042B CYRILLIC CAPITAL LETTER YERU -\defineactivetoken 220 {\cyrillicSFTSN} % 042C CYRILLIC CAPITAL LETTER SOFT SIGN -\defineactivetoken 221 {\cyrillicEREV} % 042D CYRILLIC CAPITAL LETTER E -\defineactivetoken 222 {\cyrillicYU} % 042E CYRILLIC CAPITAL LETTER YU -\defineactivetoken 223 {\cyrillicYA} % 042F CYRILLIC CAPITAL LETTER YA -\defineactivetoken 224 {\cyrillica} % 0430 CYRILLIC SMALL LETTER A -\defineactivetoken 225 {\cyrillicb} % 0431 CYRILLIC SMALL LETTER BE -\defineactivetoken 226 {\cyrillicv} % 0432 CYRILLIC SMALL LETTER VE -\defineactivetoken 227 {\cyrillicg} % 0433 CYRILLIC SMALL LETTER GHE -\defineactivetoken 228 {\cyrillicd} % 0434 CYRILLIC SMALL LETTER DE -\defineactivetoken 229 {\cyrillice} % 0435 CYRILLIC SMALL LETTER IE -\defineactivetoken 230 {\cyrilliczh} % 0436 CYRILLIC SMALL LETTER ZHE -\defineactivetoken 231 {\cyrillicz} % 0437 CYRILLIC SMALL LETTER ZE -\defineactivetoken 232 {\cyrillici} % 0438 CYRILLIC SMALL LETTER I -\defineactivetoken 233 {\cyrillicishrt} % 0439 CYRILLIC SMALL LETTER SHORT I -\defineactivetoken 234 {\cyrillick} % 043A CYRILLIC SMALL LETTER KA -\defineactivetoken 235 {\cyrillicl} % 043B CYRILLIC SMALL LETTER EL -\defineactivetoken 236 {\cyrillicm} % 043C CYRILLIC SMALL LETTER EM -\defineactivetoken 237 {\cyrillicn} % 043D CYRILLIC SMALL LETTER EN -\defineactivetoken 238 {\cyrillico} % 043E CYRILLIC SMALL LETTER O -\defineactivetoken 239 {\cyrillicp} % 043F CYRILLIC SMALL LETTER PE -\defineactivetoken 240 {\cyrillicr} % 0440 CYRILLIC SMALL LETTER ER -\defineactivetoken 241 {\cyrillics} % 0441 CYRILLIC SMALL LETTER ES -\defineactivetoken 242 {\cyrillict} % 0442 CYRILLIC SMALL LETTER TE -\defineactivetoken 243 {\cyrillicu} % 0443 CYRILLIC SMALL LETTER U -\defineactivetoken 244 {\cyrillicf} % 0444 CYRILLIC SMALL LETTER EF -\defineactivetoken 245 {\cyrillich} % 0445 CYRILLIC SMALL LETTER HA -\defineactivetoken 246 {\cyrillicc} % 0446 CYRILLIC SMALL LETTER TSE -\defineactivetoken 247 {\cyrillicch} % 0447 CYRILLIC SMALL LETTER CHE -\defineactivetoken 248 {\cyrillicsh} % 0448 CYRILLIC SMALL LETTER SHA -\defineactivetoken 249 {\cyrillicshch} % 0449 CYRILLIC SMALL LETTER SHCHA -\defineactivetoken 250 {\cyrillichrdsn} % 044A CYRILLIC SMALL LETTER HARD SIGN -\defineactivetoken 251 {\cyrillicery} % 044B CYRILLIC SMALL LETTER YERU -\defineactivetoken 252 {\cyrillicsftsn} % 044C CYRILLIC SMALL LETTER SOFT SIGN -\defineactivetoken 253 {\cyrillicerev} % 044D CYRILLIC SMALL LETTER E -\defineactivetoken 254 {\cyrillicyu} % 044E CYRILLIC SMALL LETTER YU -\defineactivetoken 255 {\cyrillicya} % 044F CYRILLIC SMALL LETTER YA - -\stopregime - diff --git a/tex/context/base/regi-cp1252.mkii b/tex/context/base/regi-cp1252.mkii new file mode 100644 index 000000000..9a54f178f --- /dev/null +++ b/tex/context/base/regi-cp1252.mkii @@ -0,0 +1,156 @@ +%D \module +%D [ file=regi-cp1252, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=cp1252 (West European), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for cp1252 input encoding (regime) for West European languages, +%D see also iso-8859-1 and iso-8859-15. +%D +%D (Contributors to the original file: Tobias Burnus, Hans Hagen \& Victor Figurnov.) +%D +%D Usage: +%D \type{\enableregime[cp1252]} or \type{\enablereregime[windows-1252]} +%D % and \enableregime[win] for backward-compatibility + + +\startregime[cp1252] + +\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN +\defineactivetoken 129 {\unknownchar} % +\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK +\defineactivetoken 131 {\fhook} % 0192 LATIN SMALL LETTER F WITH HOOK +\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK +\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS +\defineactivetoken 134 {\textdag} % 2020 DAGGER +\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER +\defineactivetoken 136 {\textcircumflex} % 02C6 MODIFIER LETTER CIRCUMFLEX ACCENT +\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN +\defineactivetoken 138 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 140 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE +\defineactivetoken 141 {\unknownchar} % +\defineactivetoken 142 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON +\defineactivetoken 143 {\unknownchar} % +\defineactivetoken 144 {\unknownchar} % +\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK +\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK +\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK +\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK +\defineactivetoken 149 {\textbullet} % 2022 BULLET +\defineactivetoken 150 {\endash} % 2013 EN DASH +\defineactivetoken 151 {\emdash} % 2014 EM DASH +\defineactivetoken 152 {\texttilde} % 02DC SMALL TILDE +\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN +\defineactivetoken 154 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 156 {\oeligature} % 0153 LATIN SMALL LIGATURE OE +\defineactivetoken 157 {\unknownchar} % +\defineactivetoken 158 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON +\defineactivetoken 159 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK +\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\textmacron} % 00AF MACRON +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA +\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE +\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER +\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF +\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS +\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK +\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA +\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS +\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH +\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE +\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE +\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE +\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE +\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA +\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS +\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH +\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE +\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE +\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE +\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN +\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS + +\stopregime + diff --git a/tex/context/base/regi-cp1252.tex b/tex/context/base/regi-cp1252.tex deleted file mode 100644 index 9a54f178f..000000000 --- a/tex/context/base/regi-cp1252.tex +++ /dev/null @@ -1,156 +0,0 @@ -%D \module -%D [ file=regi-cp1252, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=cp1252 (West European), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for cp1252 input encoding (regime) for West European languages, -%D see also iso-8859-1 and iso-8859-15. -%D -%D (Contributors to the original file: Tobias Burnus, Hans Hagen \& Victor Figurnov.) -%D -%D Usage: -%D \type{\enableregime[cp1252]} or \type{\enablereregime[windows-1252]} -%D % and \enableregime[win] for backward-compatibility - - -\startregime[cp1252] - -\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN -\defineactivetoken 129 {\unknownchar} % -\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK -\defineactivetoken 131 {\fhook} % 0192 LATIN SMALL LETTER F WITH HOOK -\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK -\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS -\defineactivetoken 134 {\textdag} % 2020 DAGGER -\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER -\defineactivetoken 136 {\textcircumflex} % 02C6 MODIFIER LETTER CIRCUMFLEX ACCENT -\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN -\defineactivetoken 138 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 140 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE -\defineactivetoken 141 {\unknownchar} % -\defineactivetoken 142 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON -\defineactivetoken 143 {\unknownchar} % -\defineactivetoken 144 {\unknownchar} % -\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK -\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK -\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK -\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK -\defineactivetoken 149 {\textbullet} % 2022 BULLET -\defineactivetoken 150 {\endash} % 2013 EN DASH -\defineactivetoken 151 {\emdash} % 2014 EM DASH -\defineactivetoken 152 {\texttilde} % 02DC SMALL TILDE -\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN -\defineactivetoken 154 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 156 {\oeligature} % 0153 LATIN SMALL LIGATURE OE -\defineactivetoken 157 {\unknownchar} % -\defineactivetoken 158 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON -\defineactivetoken 159 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK -\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\textmacron} % 00AF MACRON -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA -\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE -\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER -\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF -\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS -\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK -\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE -\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA -\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS -\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH -\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE -\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE -\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE -\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE -\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA -\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS -\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH -\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE -\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE -\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE -\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN -\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS - -\stopregime - diff --git a/tex/context/base/regi-cp1253.mkii b/tex/context/base/regi-cp1253.mkii new file mode 100644 index 000000000..24ec45eac --- /dev/null +++ b/tex/context/base/regi-cp1253.mkii @@ -0,0 +1,153 @@ +%D \module +%D [ file=regi-cp1253, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=cp1253 (Greek), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for cp1253 input encoding (regime) for Greek, +%D see also iso-8859-7. +%D +%D Usage: +%D \type{\enableregime[cp1253]} or \type{\enablereregime[windows-1253]} + + +\startregime[cp1253] + +\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN +\defineactivetoken 129 {\unknownchar} % +\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK +\defineactivetoken 131 {\fhook} % 0192 LATIN SMALL LETTER F WITH HOOK +\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK +\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS +\defineactivetoken 134 {\textdag} % 2020 DAGGER +\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER +\defineactivetoken 136 {\unknownchar} % +\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN +\defineactivetoken 138 {\unknownchar} % +\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 140 {\unknownchar} % +\defineactivetoken 141 {\unknownchar} % +\defineactivetoken 142 {\unknownchar} % +\defineactivetoken 143 {\unknownchar} % +\defineactivetoken 144 {\unknownchar} % +\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK +\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK +\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK +\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK +\defineactivetoken 149 {\textbullet} % 2022 BULLET +\defineactivetoken 150 {\endash} % 2013 EN DASH +\defineactivetoken 151 {\emdash} % 2014 EM DASH +\defineactivetoken 152 {\unknownchar} % +\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN +\defineactivetoken 154 {\unknownchar} % +\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 156 {\unknownchar} % +\defineactivetoken 157 {\unknownchar} % +\defineactivetoken 158 {\unknownchar} % +\defineactivetoken 159 {\unknownchar} % +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\greekdialytikatonos} % 0385 GREEK DIALYTIKA TONOS +\defineactivetoken 162 {\greekAlphatonos} % 0386 GREEK CAPITAL LETTER ALPHA WITH TONOS +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\unknownchar} % +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\texthorizontalbar} % 2015 HORIZONTAL BAR +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\greektonos} % 0384 GREEK TONOS +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\greekEpsilontonos} % 0388 GREEK CAPITAL LETTER EPSILON WITH TONOS +\defineactivetoken 185 {\greekEtatonos} % 0389 GREEK CAPITAL LETTER ETA WITH TONOS +\defineactivetoken 186 {\greekIotatonos} % 038A GREEK CAPITAL LETTER IOTA WITH TONOS +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\greekOmicrontonos} % 038C GREEK CAPITAL LETTER OMICRON WITH TONOS +\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF +\defineactivetoken 190 {\greekUpsilontonos} % 038E GREEK CAPITAL LETTER UPSILON WITH TONOS +\defineactivetoken 191 {\greekOmegatonos} % 038F GREEK CAPITAL LETTER OMEGA WITH TONOS +\defineactivetoken 192 {\greekiotadialytikatonos} % 0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS +\defineactivetoken 193 {\greekAlpha} % 0391 GREEK CAPITAL LETTER ALPHA +\defineactivetoken 194 {\greekBeta} % 0392 GREEK CAPITAL LETTER BETA +\defineactivetoken 195 {\greekGamma} % 0393 GREEK CAPITAL LETTER GAMMA +\defineactivetoken 196 {\greekDelta} % 0394 GREEK CAPITAL LETTER DELTA +\defineactivetoken 197 {\greekEpsilon} % 0395 GREEK CAPITAL LETTER EPSILON +\defineactivetoken 198 {\greekZeta} % 0396 GREEK CAPITAL LETTER ZETA +\defineactivetoken 199 {\greekEta} % 0397 GREEK CAPITAL LETTER ETA +\defineactivetoken 200 {\greekTheta} % 0398 GREEK CAPITAL LETTER THETA +\defineactivetoken 201 {\greekIota} % 0399 GREEK CAPITAL LETTER IOTA +\defineactivetoken 202 {\greekKappa} % 039A GREEK CAPITAL LETTER KAPPA +\defineactivetoken 203 {\greekLambda} % 039B GREEK CAPITAL LETTER LAMDA +\defineactivetoken 204 {\greekMu} % 039C GREEK CAPITAL LETTER MU +\defineactivetoken 205 {\greekNu} % 039D GREEK CAPITAL LETTER NU +\defineactivetoken 206 {\greekXi} % 039E GREEK CAPITAL LETTER XI +\defineactivetoken 207 {\greekOmicron} % 039F GREEK CAPITAL LETTER OMICRON +\defineactivetoken 208 {\greekPi} % 03A0 GREEK CAPITAL LETTER PI +\defineactivetoken 209 {\greekRho} % 03A1 GREEK CAPITAL LETTER RHO +\defineactivetoken 210 {\unknownchar} % +\defineactivetoken 211 {\greekSigma} % 03A3 GREEK CAPITAL LETTER SIGMA +\defineactivetoken 212 {\greekTau} % 03A4 GREEK CAPITAL LETTER TAU +\defineactivetoken 213 {\greekUpsilon} % 03A5 GREEK CAPITAL LETTER UPSILON +\defineactivetoken 214 {\greekPhi} % 03A6 GREEK CAPITAL LETTER PHI +\defineactivetoken 215 {\greekChi} % 03A7 GREEK CAPITAL LETTER CHI +\defineactivetoken 216 {\greekPsi} % 03A8 GREEK CAPITAL LETTER PSI +\defineactivetoken 217 {\greekOmega} % 03A9 GREEK CAPITAL LETTER OMEGA +\defineactivetoken 218 {\greekIotadialytika} % 03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA +\defineactivetoken 219 {\greekUpsilondialytika} % 03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA +\defineactivetoken 220 {\greekalphatonos} % 03AC GREEK SMALL LETTER ALPHA WITH TONOS +\defineactivetoken 221 {\greekepsilontonos} % 03AD GREEK SMALL LETTER EPSILON WITH TONOS +\defineactivetoken 222 {\greeketatonos} % 03AE GREEK SMALL LETTER ETA WITH TONOS +\defineactivetoken 223 {\greekiotatonos} % 03AF GREEK SMALL LETTER IOTA WITH TONOS +\defineactivetoken 224 {\greekupsilondialytikatonos} % 03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS +\defineactivetoken 225 {\greekalpha} % 03B1 GREEK SMALL LETTER ALPHA +\defineactivetoken 226 {\greekbeta} % 03B2 GREEK SMALL LETTER BETA +\defineactivetoken 227 {\greekgamma} % 03B3 GREEK SMALL LETTER GAMMA +\defineactivetoken 228 {\greekdelta} % 03B4 GREEK SMALL LETTER DELTA +\defineactivetoken 229 {\greekepsilon} % 03B5 GREEK SMALL LETTER EPSILON +\defineactivetoken 230 {\greekzeta} % 03B6 GREEK SMALL LETTER ZETA +\defineactivetoken 231 {\greeketa} % 03B7 GREEK SMALL LETTER ETA +\defineactivetoken 232 {\greektheta} % 03B8 GREEK SMALL LETTER THETA +\defineactivetoken 233 {\greekiota} % 03B9 GREEK SMALL LETTER IOTA +\defineactivetoken 234 {\greekkappa} % 03BA GREEK SMALL LETTER KAPPA +\defineactivetoken 235 {\greeklambda} % 03BB GREEK SMALL LETTER LAMDA +\defineactivetoken 236 {\greekmu} % 03BC GREEK SMALL LETTER MU +\defineactivetoken 237 {\greeknu} % 03BD GREEK SMALL LETTER NU +\defineactivetoken 238 {\greekxi} % 03BE GREEK SMALL LETTER XI +\defineactivetoken 239 {\greekomicron} % 03BF GREEK SMALL LETTER OMICRON +\defineactivetoken 240 {\greekpi} % 03C0 GREEK SMALL LETTER PI +\defineactivetoken 241 {\greekrho} % 03C1 GREEK SMALL LETTER RHO +\defineactivetoken 242 {\greekfinalsigma} % 03C2 GREEK SMALL LETTER FINAL SIGMA +\defineactivetoken 243 {\greeksigma} % 03C3 GREEK SMALL LETTER SIGMA +\defineactivetoken 244 {\greektau} % 03C4 GREEK SMALL LETTER TAU +\defineactivetoken 245 {\greekupsilon} % 03C5 GREEK SMALL LETTER UPSILON +\defineactivetoken 246 {\greekphi} % 03C6 GREEK SMALL LETTER PHI +\defineactivetoken 247 {\greekchi} % 03C7 GREEK SMALL LETTER CHI +\defineactivetoken 248 {\greekpsi} % 03C8 GREEK SMALL LETTER PSI +\defineactivetoken 249 {\greekomega} % 03C9 GREEK SMALL LETTER OMEGA +\defineactivetoken 250 {\greekiotadialytika} % 03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA +\defineactivetoken 251 {\greekupsilondiaeresis} % 03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA +\defineactivetoken 252 {\greekomicrontonos} % 03CC GREEK SMALL LETTER OMICRON WITH TONOS +\defineactivetoken 253 {\greekupsilontonos} % 03CD GREEK SMALL LETTER UPSILON WITH TONOS +\defineactivetoken 254 {\greekomegatonos} % 03CE GREEK SMALL LETTER OMEGA WITH TONOS +\defineactivetoken 255 {\unknownchar} % + +\stopregime + diff --git a/tex/context/base/regi-cp1253.tex b/tex/context/base/regi-cp1253.tex deleted file mode 100644 index 24ec45eac..000000000 --- a/tex/context/base/regi-cp1253.tex +++ /dev/null @@ -1,153 +0,0 @@ -%D \module -%D [ file=regi-cp1253, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=cp1253 (Greek), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for cp1253 input encoding (regime) for Greek, -%D see also iso-8859-7. -%D -%D Usage: -%D \type{\enableregime[cp1253]} or \type{\enablereregime[windows-1253]} - - -\startregime[cp1253] - -\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN -\defineactivetoken 129 {\unknownchar} % -\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK -\defineactivetoken 131 {\fhook} % 0192 LATIN SMALL LETTER F WITH HOOK -\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK -\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS -\defineactivetoken 134 {\textdag} % 2020 DAGGER -\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER -\defineactivetoken 136 {\unknownchar} % -\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN -\defineactivetoken 138 {\unknownchar} % -\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 140 {\unknownchar} % -\defineactivetoken 141 {\unknownchar} % -\defineactivetoken 142 {\unknownchar} % -\defineactivetoken 143 {\unknownchar} % -\defineactivetoken 144 {\unknownchar} % -\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK -\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK -\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK -\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK -\defineactivetoken 149 {\textbullet} % 2022 BULLET -\defineactivetoken 150 {\endash} % 2013 EN DASH -\defineactivetoken 151 {\emdash} % 2014 EM DASH -\defineactivetoken 152 {\unknownchar} % -\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN -\defineactivetoken 154 {\unknownchar} % -\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 156 {\unknownchar} % -\defineactivetoken 157 {\unknownchar} % -\defineactivetoken 158 {\unknownchar} % -\defineactivetoken 159 {\unknownchar} % -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\greekdialytikatonos} % 0385 GREEK DIALYTIKA TONOS -\defineactivetoken 162 {\greekAlphatonos} % 0386 GREEK CAPITAL LETTER ALPHA WITH TONOS -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\unknownchar} % -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\texthorizontalbar} % 2015 HORIZONTAL BAR -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\greektonos} % 0384 GREEK TONOS -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\greekEpsilontonos} % 0388 GREEK CAPITAL LETTER EPSILON WITH TONOS -\defineactivetoken 185 {\greekEtatonos} % 0389 GREEK CAPITAL LETTER ETA WITH TONOS -\defineactivetoken 186 {\greekIotatonos} % 038A GREEK CAPITAL LETTER IOTA WITH TONOS -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\greekOmicrontonos} % 038C GREEK CAPITAL LETTER OMICRON WITH TONOS -\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF -\defineactivetoken 190 {\greekUpsilontonos} % 038E GREEK CAPITAL LETTER UPSILON WITH TONOS -\defineactivetoken 191 {\greekOmegatonos} % 038F GREEK CAPITAL LETTER OMEGA WITH TONOS -\defineactivetoken 192 {\greekiotadialytikatonos} % 0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS -\defineactivetoken 193 {\greekAlpha} % 0391 GREEK CAPITAL LETTER ALPHA -\defineactivetoken 194 {\greekBeta} % 0392 GREEK CAPITAL LETTER BETA -\defineactivetoken 195 {\greekGamma} % 0393 GREEK CAPITAL LETTER GAMMA -\defineactivetoken 196 {\greekDelta} % 0394 GREEK CAPITAL LETTER DELTA -\defineactivetoken 197 {\greekEpsilon} % 0395 GREEK CAPITAL LETTER EPSILON -\defineactivetoken 198 {\greekZeta} % 0396 GREEK CAPITAL LETTER ZETA -\defineactivetoken 199 {\greekEta} % 0397 GREEK CAPITAL LETTER ETA -\defineactivetoken 200 {\greekTheta} % 0398 GREEK CAPITAL LETTER THETA -\defineactivetoken 201 {\greekIota} % 0399 GREEK CAPITAL LETTER IOTA -\defineactivetoken 202 {\greekKappa} % 039A GREEK CAPITAL LETTER KAPPA -\defineactivetoken 203 {\greekLambda} % 039B GREEK CAPITAL LETTER LAMDA -\defineactivetoken 204 {\greekMu} % 039C GREEK CAPITAL LETTER MU -\defineactivetoken 205 {\greekNu} % 039D GREEK CAPITAL LETTER NU -\defineactivetoken 206 {\greekXi} % 039E GREEK CAPITAL LETTER XI -\defineactivetoken 207 {\greekOmicron} % 039F GREEK CAPITAL LETTER OMICRON -\defineactivetoken 208 {\greekPi} % 03A0 GREEK CAPITAL LETTER PI -\defineactivetoken 209 {\greekRho} % 03A1 GREEK CAPITAL LETTER RHO -\defineactivetoken 210 {\unknownchar} % -\defineactivetoken 211 {\greekSigma} % 03A3 GREEK CAPITAL LETTER SIGMA -\defineactivetoken 212 {\greekTau} % 03A4 GREEK CAPITAL LETTER TAU -\defineactivetoken 213 {\greekUpsilon} % 03A5 GREEK CAPITAL LETTER UPSILON -\defineactivetoken 214 {\greekPhi} % 03A6 GREEK CAPITAL LETTER PHI -\defineactivetoken 215 {\greekChi} % 03A7 GREEK CAPITAL LETTER CHI -\defineactivetoken 216 {\greekPsi} % 03A8 GREEK CAPITAL LETTER PSI -\defineactivetoken 217 {\greekOmega} % 03A9 GREEK CAPITAL LETTER OMEGA -\defineactivetoken 218 {\greekIotadialytika} % 03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA -\defineactivetoken 219 {\greekUpsilondialytika} % 03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA -\defineactivetoken 220 {\greekalphatonos} % 03AC GREEK SMALL LETTER ALPHA WITH TONOS -\defineactivetoken 221 {\greekepsilontonos} % 03AD GREEK SMALL LETTER EPSILON WITH TONOS -\defineactivetoken 222 {\greeketatonos} % 03AE GREEK SMALL LETTER ETA WITH TONOS -\defineactivetoken 223 {\greekiotatonos} % 03AF GREEK SMALL LETTER IOTA WITH TONOS -\defineactivetoken 224 {\greekupsilondialytikatonos} % 03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS -\defineactivetoken 225 {\greekalpha} % 03B1 GREEK SMALL LETTER ALPHA -\defineactivetoken 226 {\greekbeta} % 03B2 GREEK SMALL LETTER BETA -\defineactivetoken 227 {\greekgamma} % 03B3 GREEK SMALL LETTER GAMMA -\defineactivetoken 228 {\greekdelta} % 03B4 GREEK SMALL LETTER DELTA -\defineactivetoken 229 {\greekepsilon} % 03B5 GREEK SMALL LETTER EPSILON -\defineactivetoken 230 {\greekzeta} % 03B6 GREEK SMALL LETTER ZETA -\defineactivetoken 231 {\greeketa} % 03B7 GREEK SMALL LETTER ETA -\defineactivetoken 232 {\greektheta} % 03B8 GREEK SMALL LETTER THETA -\defineactivetoken 233 {\greekiota} % 03B9 GREEK SMALL LETTER IOTA -\defineactivetoken 234 {\greekkappa} % 03BA GREEK SMALL LETTER KAPPA -\defineactivetoken 235 {\greeklambda} % 03BB GREEK SMALL LETTER LAMDA -\defineactivetoken 236 {\greekmu} % 03BC GREEK SMALL LETTER MU -\defineactivetoken 237 {\greeknu} % 03BD GREEK SMALL LETTER NU -\defineactivetoken 238 {\greekxi} % 03BE GREEK SMALL LETTER XI -\defineactivetoken 239 {\greekomicron} % 03BF GREEK SMALL LETTER OMICRON -\defineactivetoken 240 {\greekpi} % 03C0 GREEK SMALL LETTER PI -\defineactivetoken 241 {\greekrho} % 03C1 GREEK SMALL LETTER RHO -\defineactivetoken 242 {\greekfinalsigma} % 03C2 GREEK SMALL LETTER FINAL SIGMA -\defineactivetoken 243 {\greeksigma} % 03C3 GREEK SMALL LETTER SIGMA -\defineactivetoken 244 {\greektau} % 03C4 GREEK SMALL LETTER TAU -\defineactivetoken 245 {\greekupsilon} % 03C5 GREEK SMALL LETTER UPSILON -\defineactivetoken 246 {\greekphi} % 03C6 GREEK SMALL LETTER PHI -\defineactivetoken 247 {\greekchi} % 03C7 GREEK SMALL LETTER CHI -\defineactivetoken 248 {\greekpsi} % 03C8 GREEK SMALL LETTER PSI -\defineactivetoken 249 {\greekomega} % 03C9 GREEK SMALL LETTER OMEGA -\defineactivetoken 250 {\greekiotadialytika} % 03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA -\defineactivetoken 251 {\greekupsilondiaeresis} % 03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA -\defineactivetoken 252 {\greekomicrontonos} % 03CC GREEK SMALL LETTER OMICRON WITH TONOS -\defineactivetoken 253 {\greekupsilontonos} % 03CD GREEK SMALL LETTER UPSILON WITH TONOS -\defineactivetoken 254 {\greekomegatonos} % 03CE GREEK SMALL LETTER OMEGA WITH TONOS -\defineactivetoken 255 {\unknownchar} % - -\stopregime - diff --git a/tex/context/base/regi-cp1254.mkii b/tex/context/base/regi-cp1254.mkii new file mode 100644 index 000000000..4dd509b9d --- /dev/null +++ b/tex/context/base/regi-cp1254.mkii @@ -0,0 +1,153 @@ +%D \module +%D [ file=regi-cp1254, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=cp1254 (Turkish), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for cp1254 input encoding (regime) for Turkish, +%D see also iso-8859-9. +%D +%D Usage: +%D \type{\enableregime[cp1254]} or \type{\enablereregime[windows-1254]} + + +\startregime[cp1254] + +\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN +\defineactivetoken 129 {\unknownchar} % +\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK +\defineactivetoken 131 {\fhook} % 0192 LATIN SMALL LETTER F WITH HOOK +\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK +\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS +\defineactivetoken 134 {\textdag} % 2020 DAGGER +\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER +\defineactivetoken 136 {\textcircumflex} % 02C6 MODIFIER LETTER CIRCUMFLEX ACCENT +\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN +\defineactivetoken 138 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 140 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE +\defineactivetoken 141 {\unknownchar} % +\defineactivetoken 142 {\unknownchar} % +\defineactivetoken 143 {\unknownchar} % +\defineactivetoken 144 {\unknownchar} % +\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK +\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK +\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK +\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK +\defineactivetoken 149 {\textbullet} % 2022 BULLET +\defineactivetoken 150 {\endash} % 2013 EN DASH +\defineactivetoken 151 {\emdash} % 2014 EM DASH +\defineactivetoken 152 {\texttilde} % 02DC SMALL TILDE +\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN +\defineactivetoken 154 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 156 {\oeligature} % 0153 LATIN SMALL LIGATURE OE +\defineactivetoken 157 {\unknownchar} % +\defineactivetoken 158 {\unknownchar} % +\defineactivetoken 159 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK +\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\textmacron} % 00AF MACRON +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA +\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE +\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER +\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF +\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS +\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK +\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA +\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX +\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS +\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS +\defineactivetoken 208 {\Gbreve} % 011E LATIN CAPITAL LETTER G WITH BREVE +\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE +\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE +\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Idotaccent} % 0130 LATIN CAPITAL LETTER I WITH DOT ABOVE +\defineactivetoken 222 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE +\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA +\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX +\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS +\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX +\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS +\defineactivetoken 240 {\gbreve} % 011F LATIN SMALL LETTER G WITH BREVE +\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE +\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE +\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\dotlessi} % 0131 LATIN SMALL LETTER DOTLESS I +\defineactivetoken 254 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA +\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS + +\stopregime + diff --git a/tex/context/base/regi-cp1254.tex b/tex/context/base/regi-cp1254.tex deleted file mode 100644 index 4dd509b9d..000000000 --- a/tex/context/base/regi-cp1254.tex +++ /dev/null @@ -1,153 +0,0 @@ -%D \module -%D [ file=regi-cp1254, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=cp1254 (Turkish), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for cp1254 input encoding (regime) for Turkish, -%D see also iso-8859-9. -%D -%D Usage: -%D \type{\enableregime[cp1254]} or \type{\enablereregime[windows-1254]} - - -\startregime[cp1254] - -\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN -\defineactivetoken 129 {\unknownchar} % -\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK -\defineactivetoken 131 {\fhook} % 0192 LATIN SMALL LETTER F WITH HOOK -\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK -\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS -\defineactivetoken 134 {\textdag} % 2020 DAGGER -\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER -\defineactivetoken 136 {\textcircumflex} % 02C6 MODIFIER LETTER CIRCUMFLEX ACCENT -\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN -\defineactivetoken 138 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 140 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE -\defineactivetoken 141 {\unknownchar} % -\defineactivetoken 142 {\unknownchar} % -\defineactivetoken 143 {\unknownchar} % -\defineactivetoken 144 {\unknownchar} % -\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK -\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK -\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK -\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK -\defineactivetoken 149 {\textbullet} % 2022 BULLET -\defineactivetoken 150 {\endash} % 2013 EN DASH -\defineactivetoken 151 {\emdash} % 2014 EM DASH -\defineactivetoken 152 {\texttilde} % 02DC SMALL TILDE -\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN -\defineactivetoken 154 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 156 {\oeligature} % 0153 LATIN SMALL LIGATURE OE -\defineactivetoken 157 {\unknownchar} % -\defineactivetoken 158 {\unknownchar} % -\defineactivetoken 159 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK -\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\textmacron} % 00AF MACRON -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA -\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE -\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER -\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF -\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS -\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK -\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE -\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA -\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS -\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS -\defineactivetoken 208 {\Gbreve} % 011E LATIN CAPITAL LETTER G WITH BREVE -\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE -\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE -\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Idotaccent} % 0130 LATIN CAPITAL LETTER I WITH DOT ABOVE -\defineactivetoken 222 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE -\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA -\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX -\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS -\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX -\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS -\defineactivetoken 240 {\gbreve} % 011F LATIN SMALL LETTER G WITH BREVE -\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE -\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE -\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\dotlessi} % 0131 LATIN SMALL LETTER DOTLESS I -\defineactivetoken 254 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA -\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS - -\stopregime - diff --git a/tex/context/base/regi-cp1257.mkii b/tex/context/base/regi-cp1257.mkii new file mode 100644 index 000000000..0790ef734 --- /dev/null +++ b/tex/context/base/regi-cp1257.mkii @@ -0,0 +1,153 @@ +%D \module +%D [ file=regi-cp1257, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=cp1257 (Windows Baltic), +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for cp1257 input encoding (regime) for Baltic languages, +%D see also iso-8859-4 and iso-8859-13. +%D +%D Usage: +%D \type{\enableregime[cp1257]} or \type{\enablereregime[windows-1257]} + + +\startregime[cp1257] + +\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN +\defineactivetoken 129 {\unknownchar} % +\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK +\defineactivetoken 131 {\unknownchar} % +\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK +\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS +\defineactivetoken 134 {\textdag} % 2020 DAGGER +\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER +\defineactivetoken 136 {\unknownchar} % +\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN +\defineactivetoken 138 {\unknownchar} % +\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 140 {\unknownchar} % +\defineactivetoken 141 {\textdiaeresis} % 00A8 DIAERESIS +\defineactivetoken 142 {\textcaron} % 02C7 CARON +\defineactivetoken 143 {\textcedilla} % 00B8 CEDILLA +\defineactivetoken 144 {\unknownchar} % +\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK +\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK +\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK +\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK +\defineactivetoken 149 {\textbullet} % 2022 BULLET +\defineactivetoken 150 {\endash} % 2013 EN DASH +\defineactivetoken 151 {\emdash} % 2014 EM DASH +\defineactivetoken 152 {\unknownchar} % +\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN +\defineactivetoken 154 {\unknownchar} % +\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK +\defineactivetoken 156 {\unknownchar} % +\defineactivetoken 157 {\textmacron} % 00AF MACRON +\defineactivetoken 158 {\textogonek} % 02DB OGONEK +\defineactivetoken 159 {\unknownchar} % +\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE +\defineactivetoken 161 {\unknownchar} % +\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN +\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN +\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN +\defineactivetoken 165 {\unknownchar} % +\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR +\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN +\defineactivetoken 168 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE +\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN +\defineactivetoken 170 {\Rcommaaccent} % 0156 LATIN CAPITAL LETTER R WITH CEDILLA +\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN +\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN +\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN +\defineactivetoken 175 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE +\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN +\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN +\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO +\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE +\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT +\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN +\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN +\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT +\defineactivetoken 184 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE +\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE +\defineactivetoken 186 {\rcommaaccent} % 0157 LATIN SMALL LETTER R WITH CEDILLA +\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK +\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER +\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF +\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS +\defineactivetoken 191 {\aeligature} % 00E6 LATIN SMALL LETTER AE +\defineactivetoken 192 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK +\defineactivetoken 193 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK +\defineactivetoken 194 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON +\defineactivetoken 195 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE +\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS +\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE +\defineactivetoken 198 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK +\defineactivetoken 199 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON +\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE +\defineactivetoken 203 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE +\defineactivetoken 204 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA +\defineactivetoken 205 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA +\defineactivetoken 206 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON +\defineactivetoken 207 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA +\defineactivetoken 208 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON +\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE +\defineactivetoken 210 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON +\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS +\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN +\defineactivetoken 216 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK +\defineactivetoken 217 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE +\defineactivetoken 218 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE +\defineactivetoken 219 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON +\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS +\defineactivetoken 221 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE +\defineactivetoken 222 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON +\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S +\defineactivetoken 224 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK +\defineactivetoken 225 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK +\defineactivetoken 226 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON +\defineactivetoken 227 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE +\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS +\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE +\defineactivetoken 230 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK +\defineactivetoken 231 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON +\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE +\defineactivetoken 235 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE +\defineactivetoken 236 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA +\defineactivetoken 237 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA +\defineactivetoken 238 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON +\defineactivetoken 239 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA +\defineactivetoken 240 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON +\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE +\defineactivetoken 242 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS +\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN +\defineactivetoken 248 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK +\defineactivetoken 249 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE +\defineactivetoken 250 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE +\defineactivetoken 251 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON +\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS +\defineactivetoken 253 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE +\defineactivetoken 254 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON +\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE + +\stopregime + diff --git a/tex/context/base/regi-cp1257.tex b/tex/context/base/regi-cp1257.tex deleted file mode 100644 index 0790ef734..000000000 --- a/tex/context/base/regi-cp1257.tex +++ /dev/null @@ -1,153 +0,0 @@ -%D \module -%D [ file=regi-cp1257, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=cp1257 (Windows Baltic), -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for cp1257 input encoding (regime) for Baltic languages, -%D see also iso-8859-4 and iso-8859-13. -%D -%D Usage: -%D \type{\enableregime[cp1257]} or \type{\enablereregime[windows-1257]} - - -\startregime[cp1257] - -\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN -\defineactivetoken 129 {\unknownchar} % -\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK -\defineactivetoken 131 {\unknownchar} % -\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK -\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS -\defineactivetoken 134 {\textdag} % 2020 DAGGER -\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER -\defineactivetoken 136 {\unknownchar} % -\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN -\defineactivetoken 138 {\unknownchar} % -\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 140 {\unknownchar} % -\defineactivetoken 141 {\textdiaeresis} % 00A8 DIAERESIS -\defineactivetoken 142 {\textcaron} % 02C7 CARON -\defineactivetoken 143 {\textcedilla} % 00B8 CEDILLA -\defineactivetoken 144 {\unknownchar} % -\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK -\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK -\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK -\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK -\defineactivetoken 149 {\textbullet} % 2022 BULLET -\defineactivetoken 150 {\endash} % 2013 EN DASH -\defineactivetoken 151 {\emdash} % 2014 EM DASH -\defineactivetoken 152 {\unknownchar} % -\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN -\defineactivetoken 154 {\unknownchar} % -\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK -\defineactivetoken 156 {\unknownchar} % -\defineactivetoken 157 {\textmacron} % 00AF MACRON -\defineactivetoken 158 {\textogonek} % 02DB OGONEK -\defineactivetoken 159 {\unknownchar} % -\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE -\defineactivetoken 161 {\unknownchar} % -\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN -\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN -\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN -\defineactivetoken 165 {\unknownchar} % -\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR -\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN -\defineactivetoken 168 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE -\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN -\defineactivetoken 170 {\Rcommaaccent} % 0156 LATIN CAPITAL LETTER R WITH CEDILLA -\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN -\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN -\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN -\defineactivetoken 175 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE -\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN -\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN -\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO -\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE -\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT -\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN -\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN -\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT -\defineactivetoken 184 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE -\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE -\defineactivetoken 186 {\rcommaaccent} % 0157 LATIN SMALL LETTER R WITH CEDILLA -\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK -\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER -\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF -\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS -\defineactivetoken 191 {\aeligature} % 00E6 LATIN SMALL LETTER AE -\defineactivetoken 192 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK -\defineactivetoken 193 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK -\defineactivetoken 194 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON -\defineactivetoken 195 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE -\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS -\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE -\defineactivetoken 198 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK -\defineactivetoken 199 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON -\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE -\defineactivetoken 203 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE -\defineactivetoken 204 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA -\defineactivetoken 205 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA -\defineactivetoken 206 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON -\defineactivetoken 207 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA -\defineactivetoken 208 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON -\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE -\defineactivetoken 210 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON -\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS -\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN -\defineactivetoken 216 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK -\defineactivetoken 217 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE -\defineactivetoken 218 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE -\defineactivetoken 219 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON -\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS -\defineactivetoken 221 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE -\defineactivetoken 222 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON -\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S -\defineactivetoken 224 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK -\defineactivetoken 225 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK -\defineactivetoken 226 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON -\defineactivetoken 227 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE -\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS -\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE -\defineactivetoken 230 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK -\defineactivetoken 231 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON -\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE -\defineactivetoken 235 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE -\defineactivetoken 236 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA -\defineactivetoken 237 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA -\defineactivetoken 238 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON -\defineactivetoken 239 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA -\defineactivetoken 240 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON -\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE -\defineactivetoken 242 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS -\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN -\defineactivetoken 248 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK -\defineactivetoken 249 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE -\defineactivetoken 250 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE -\defineactivetoken 251 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON -\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS -\defineactivetoken 253 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE -\defineactivetoken 254 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON -\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE - -\stopregime - diff --git a/tex/context/base/regi-cyp.mkii b/tex/context/base/regi-cyp.mkii new file mode 100644 index 000000000..7d134df50 --- /dev/null +++ b/tex/context/base/regi-cyp.mkii @@ -0,0 +1,1169 @@ +%D \module +%D [ file=regi-cyp, +%D version=2003.01.24, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Cyrillic Plus, +%D author=..., +%D date=\currentdate, +%D copyright={PRAGMA / 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 file several rarely user cyrillic input regimes +%D are defined. + +\startregime[cp855] + +\defineactivetoken 128 {\cyrillicdje} +\defineactivetoken 129 {\cyrillicDJE} +\defineactivetoken 130 {\'\cyrillicg} +\defineactivetoken 131 {\'\cyrillicG} +\defineactivetoken 132 {\cyrillicyo} +\defineactivetoken 133 {\cyrillicYO} +\defineactivetoken 134 {\cyrillicie} +\defineactivetoken 135 {\cyrillicIE} +\defineactivetoken 136 {\cyrillicdze} +\defineactivetoken 137 {\cyrillicDZE} +\defineactivetoken 138 {\cyrillicii} +\defineactivetoken 139 {\cyrillicII} +\defineactivetoken 140 {\cyrillicyi} +\defineactivetoken 141 {\cyrillicYI} +\defineactivetoken 142 {\cyrillicje} +\defineactivetoken 143 {\cyrillicJE} +\defineactivetoken 144 {\cyrilliclje} +\defineactivetoken 145 {\cyrillicLJE} +\defineactivetoken 146 {\cyrillicnje} +\defineactivetoken 147 {\cyrillicNJE} +\defineactivetoken 148 {\cyrillictshe} +\defineactivetoken 149 {\cyrillicTSHE} +\defineactivetoken 150 {\'\cyrillick} +\defineactivetoken 151 {\'\cyrillicK} +\defineactivetoken 152 {\cyrillicushrt} +\defineactivetoken 153 {\cyrillicUSHRT} +\defineactivetoken 154 {\cyrillicdzhe} +\defineactivetoken 155 {\cyrillicDZHE} +\defineactivetoken 156 {\cyrillicyu} +\defineactivetoken 157 {\cyrillicYU} +\defineactivetoken 158 {\cyrillichrdsn} +\defineactivetoken 159 {\cyrillicHRDSN} +\defineactivetoken 160 {\cyrillica} +\defineactivetoken 161 {\cyrillicA} +\defineactivetoken 162 {\cyrillicb} +\defineactivetoken 163 {\cyrillicB} +\defineactivetoken 164 {\cyrillicc} +\defineactivetoken 165 {\cyrillicC} +\defineactivetoken 166 {\cyrillicd} +\defineactivetoken 167 {\cyrillicD} +\defineactivetoken 168 {\cyrillice} +\defineactivetoken 169 {\cyrillicE} +\defineactivetoken 170 {\cyrillicf} +\defineactivetoken 171 {\cyrillicF} +\defineactivetoken 172 {\cyrillicg} +\defineactivetoken 173 {\cyrillicG} +\defineactivetoken 174 {\leftguillemot} +\defineactivetoken 175 {\rightguillemot} +\defineactivetoken 181 {\cyrillich} +\defineactivetoken 182 {\cyrillicH} +\defineactivetoken 183 {\cyrillici} +\defineactivetoken 184 {\cyrillicI} +\defineactivetoken 189 {\cyrillicishrt} +\defineactivetoken 190 {\cyrillicISHRT} +\defineactivetoken 198 {\cyrillick} +\defineactivetoken 199 {\cyrillicK} +\defineactivetoken 207 {\textcurrency} +\defineactivetoken 208 {\cyrillicl} +\defineactivetoken 209 {\cyrillicL} +\defineactivetoken 210 {\cyrillicm} +\defineactivetoken 211 {\cyrillicM} +\defineactivetoken 212 {\cyrillicn} +\defineactivetoken 213 {\cyrillicN} +\defineactivetoken 214 {\cyrillico} +\defineactivetoken 215 {\cyrillicO} +\defineactivetoken 216 {\cyrillicp} +\defineactivetoken 221 {\cyrillicP} +\defineactivetoken 222 {\cyrillicya} +\defineactivetoken 224 {\cyrillicYA} +\defineactivetoken 225 {\cyrillicr} +\defineactivetoken 226 {\cyrillicR} +\defineactivetoken 227 {\cyrillics} +\defineactivetoken 228 {\cyrillicS} +\defineactivetoken 229 {\cyrillict} +\defineactivetoken 230 {\cyrillicT} +\defineactivetoken 231 {\cyrillicu} +\defineactivetoken 232 {\cyrillicU} +\defineactivetoken 233 {\cyrilliczh} +\defineactivetoken 234 {\cyrillicZH} +\defineactivetoken 235 {\cyrillicv} +\defineactivetoken 236 {\cyrillicV} +\defineactivetoken 237 {\cyrillicsftsn} +\defineactivetoken 238 {\cyrillicSFTSN} +\defineactivetoken 239 {\textnumero} +\defineactivetoken 240 {\-} +\defineactivetoken 241 {\cyrillicery} +\defineactivetoken 242 {\cyrillicERY} +\defineactivetoken 243 {\cyrillicz} +\defineactivetoken 244 {\cyrillicZ} +\defineactivetoken 245 {\cyrillicsh} +\defineactivetoken 246 {\cyrillicSH} +\defineactivetoken 247 {\cyrillicerev} +\defineactivetoken 248 {\cyrillicEREV} +\defineactivetoken 249 {\cyrillicshch} +\defineactivetoken 250 {\cyrillicSHCH} +\defineactivetoken 251 {\cyrillicch} +\defineactivetoken 252 {\cyrillicCH} +\defineactivetoken 253 {\sectionmark} +\defineactivetoken 254 {\textblacksquare} +\defineactivetoken 255 {\nonbreakablespace} + +\stopregime + +\startregime[cp866av] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicZH} +\defineactivetoken 135 {\cyrillicZ} +\defineactivetoken 136 {\cyrillicI} +\defineactivetoken 137 {\cyrillicISHRT} +\defineactivetoken 138 {\cyrillicK} +\defineactivetoken 139 {\cyrillicL} +\defineactivetoken 140 {\cyrillicM} +\defineactivetoken 141 {\cyrillicN} +\defineactivetoken 142 {\cyrillicO} +\defineactivetoken 143 {\cyrillicP} +\defineactivetoken 144 {\cyrillicR} +\defineactivetoken 145 {\cyrillicS} +\defineactivetoken 146 {\cyrillicT} +\defineactivetoken 147 {\cyrillicU} +\defineactivetoken 148 {\cyrillicF} +\defineactivetoken 149 {\cyrillicH} +\defineactivetoken 150 {\cyrillicC} +\defineactivetoken 151 {\cyrillicCH} +\defineactivetoken 152 {\cyrillicSH} +\defineactivetoken 153 {\cyrillicSHCH} +\defineactivetoken 154 {\cyrillicHRDSN} +\defineactivetoken 155 {\cyrillicERY} +\defineactivetoken 156 {\cyrillicSFTSN} +\defineactivetoken 157 {\cyrillicEREV} +\defineactivetoken 158 {\cyrillicYU} +\defineactivetoken 159 {\cyrillicYA} +\defineactivetoken 160 {\cyrillica} +\defineactivetoken 161 {\cyrillicb} +\defineactivetoken 162 {\cyrillicv} +\defineactivetoken 163 {\cyrillicg} +\defineactivetoken 164 {\cyrillicd} +\defineactivetoken 165 {\cyrillice} +\defineactivetoken 166 {\cyrilliczh} +\defineactivetoken 167 {\cyrillicz} +\defineactivetoken 168 {\cyrillici} +\defineactivetoken 169 {\cyrillicishrt} +\defineactivetoken 170 {\cyrillick} +\defineactivetoken 171 {\cyrillicl} +\defineactivetoken 172 {\cyrillicm} +\defineactivetoken 173 {\cyrillicn} +\defineactivetoken 174 {\cyrillico} +\defineactivetoken 175 {\cyrillicp} +\defineactivetoken 224 {\cyrillicr} +\defineactivetoken 225 {\cyrillics} +\defineactivetoken 226 {\cyrillict} +\defineactivetoken 227 {\cyrillicu} +\defineactivetoken 228 {\cyrillicf} +\defineactivetoken 229 {\cyrillich} +\defineactivetoken 230 {\cyrillicc} +\defineactivetoken 231 {\cyrillicch} +\defineactivetoken 232 {\cyrillicsh} +\defineactivetoken 233 {\cyrillicshch} +\defineactivetoken 234 {\cyrillichrdsn} +\defineactivetoken 235 {\cyrillicery} +\defineactivetoken 236 {\cyrillicsftsn} +\defineactivetoken 237 {\cyrillicerev} +\defineactivetoken 238 {\cyrillicyu} +\defineactivetoken 239 {\cyrillicya} +\defineactivetoken 240 {\cyrillicYO} +\defineactivetoken 241 {\cyrillicyo} +\defineactivetoken 252 {\textnumero} +\defineactivetoken 253 {\textcurrency} +\defineactivetoken 254 {\textblacksquare} +\defineactivetoken 255 {\nonbreakablespace} +\defineactivetoken 246 {\mathematics\rightarrow} +\defineactivetoken 247 {\mathematics\leftarrow} +\defineactivetoken 248 {\mathematics\downarrow} +\defineactivetoken 249 {\mathematics\uparrow} +\defineactivetoken 250 {\textdiv} +\defineactivetoken 251 {\textpm} + +\stopregime + +\startregime[cp866mav] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicZH} +\defineactivetoken 135 {\cyrillicZ} +\defineactivetoken 136 {\cyrillicI} +\defineactivetoken 137 {\cyrillicISHRT} +\defineactivetoken 138 {\cyrillicK} +\defineactivetoken 139 {\cyrillicL} +\defineactivetoken 140 {\cyrillicM} +\defineactivetoken 141 {\cyrillicN} +\defineactivetoken 142 {\cyrillicO} +\defineactivetoken 143 {\cyrillicP} +\defineactivetoken 144 {\cyrillicR} +\defineactivetoken 145 {\cyrillicS} +\defineactivetoken 146 {\cyrillicT} +\defineactivetoken 147 {\cyrillicU} +\defineactivetoken 148 {\cyrillicF} +\defineactivetoken 149 {\cyrillicH} +\defineactivetoken 150 {\cyrillicC} +\defineactivetoken 151 {\cyrillicCH} +\defineactivetoken 152 {\cyrillicSH} +\defineactivetoken 153 {\cyrillicSHCH} +\defineactivetoken 154 {\cyrillicHRDSN} +\defineactivetoken 155 {\cyrillicERY} +\defineactivetoken 156 {\cyrillicSFTSN} +\defineactivetoken 157 {\cyrillicEREV} +\defineactivetoken 158 {\cyrillicYU} +\defineactivetoken 159 {\cyrillicYA} +\defineactivetoken 160 {\cyrillica} +\defineactivetoken 161 {\cyrillicb} +\defineactivetoken 162 {\cyrillicv} +\defineactivetoken 163 {\cyrillicg} +\defineactivetoken 164 {\cyrillicd} +\defineactivetoken 165 {\cyrillice} +\defineactivetoken 166 {\cyrilliczh} +\defineactivetoken 167 {\cyrillicz} +\defineactivetoken 168 {\cyrillici} +\defineactivetoken 169 {\cyrillicishrt} +\defineactivetoken 170 {\cyrillick} +\defineactivetoken 171 {\cyrillicl} +\defineactivetoken 172 {\cyrillicm} +\defineactivetoken 173 {\cyrillicn} +\defineactivetoken 174 {\cyrillico} +\defineactivetoken 175 {\cyrillicp} +\defineactivetoken 224 {\cyrillicr} +\defineactivetoken 225 {\cyrillics} +\defineactivetoken 226 {\cyrillict} +\defineactivetoken 227 {\cyrillicu} +\defineactivetoken 228 {\cyrillicf} +\defineactivetoken 229 {\cyrillich} +\defineactivetoken 230 {\cyrillicc} +\defineactivetoken 231 {\cyrillicch} +\defineactivetoken 232 {\cyrillicsh} +\defineactivetoken 233 {\cyrillicshch} +\defineactivetoken 234 {\cyrillichrdsn} +\defineactivetoken 235 {\cyrillicery} +\defineactivetoken 236 {\cyrillicsftsn} +\defineactivetoken 237 {\cyrillicerev} +\defineactivetoken 238 {\cyrillicyu} +\defineactivetoken 239 {\cyrillicya} +\defineactivetoken 240 {\cyrillicYO} +\defineactivetoken 241 {\cyrillicyo} +\defineactivetoken 248 {\textdegree} +\defineactivetoken 249 {\textbullet} +\defineactivetoken 250 {\periodcentered} +\defineactivetoken 254 {\textblacksquare} +\defineactivetoken 255 {\nonbreakablespace} +\defineactivetoken 242 {\mathematics\geq} +\defineactivetoken 243 {\mathematics\leq} +\defineactivetoken 246 {\textdiv} +\defineactivetoken 247 {\mathematics\sim} +\defineactivetoken 251 {\textsurd} +\defineactivetoken 252 {\high{\txx n}} +\defineactivetoken 253 {\twosuperior} + +\stopregime + +\startregime[cp866tat] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicZH} +\defineactivetoken 135 {\cyrillicZ} +\defineactivetoken 136 {\cyrillicI} +\defineactivetoken 137 {\cyrillicISHRT} +\defineactivetoken 138 {\cyrillicK} +\defineactivetoken 139 {\cyrillicL} +\defineactivetoken 140 {\cyrillicM} +\defineactivetoken 141 {\cyrillicN} +\defineactivetoken 142 {\cyrillicO} +\defineactivetoken 143 {\cyrillicP} +\defineactivetoken 144 {\cyrillicR} +\defineactivetoken 145 {\cyrillicS} +\defineactivetoken 146 {\cyrillicT} +\defineactivetoken 147 {\cyrillicU} +\defineactivetoken 148 {\cyrillicF} +\defineactivetoken 149 {\cyrillicH} +\defineactivetoken 150 {\cyrillicC} +\defineactivetoken 151 {\cyrillicCH} +\defineactivetoken 152 {\cyrillicSH} +\defineactivetoken 153 {\cyrillicSHCH} +\defineactivetoken 154 {\cyrillicHRDSN} +\defineactivetoken 155 {\cyrillicERY} +\defineactivetoken 156 {\cyrillicSFTSN} +\defineactivetoken 157 {\cyrillicEREV} +\defineactivetoken 158 {\cyrillicYU} +\defineactivetoken 159 {\cyrillicYA} +\defineactivetoken 160 {\cyrillica} +\defineactivetoken 161 {\cyrillicb} +\defineactivetoken 162 {\cyrillicv} +\defineactivetoken 163 {\cyrillicg} +\defineactivetoken 164 {\cyrillicd} +\defineactivetoken 165 {\cyrillice} +\defineactivetoken 166 {\cyrilliczh} +\defineactivetoken 167 {\cyrillicz} +\defineactivetoken 168 {\cyrillici} +\defineactivetoken 169 {\cyrillicishrt} +\defineactivetoken 170 {\cyrillick} +\defineactivetoken 171 {\cyrillicl} +\defineactivetoken 172 {\cyrillicm} +\defineactivetoken 173 {\cyrillicn} +\defineactivetoken 174 {\cyrillico} +\defineactivetoken 175 {\cyrillicp} +\defineactivetoken 224 {\cyrillicr} +\defineactivetoken 225 {\cyrillics} +\defineactivetoken 226 {\cyrillict} +\defineactivetoken 227 {\cyrillicu} +\defineactivetoken 228 {\cyrillicf} +\defineactivetoken 229 {\cyrillich} +\defineactivetoken 230 {\cyrillicc} +\defineactivetoken 231 {\cyrillicch} +\defineactivetoken 232 {\cyrillicsh} +\defineactivetoken 233 {\cyrillicshch} +\defineactivetoken 234 {\cyrillichrdsn} +\defineactivetoken 235 {\cyrillicery} +\defineactivetoken 236 {\cyrillicsftsn} +\defineactivetoken 237 {\cyrillicerev} +\defineactivetoken 238 {\cyrillicyu} +\defineactivetoken 239 {\cyrillicya} +\defineactivetoken 240 {\cyrillicYO} +\defineactivetoken 241 {\cyrillicyo} +\defineactivetoken 242 {\cyrillicSCHWA} +\defineactivetoken 243 {\cyrillicschwa} +\defineactivetoken 244 {\cyrillicOTLD} +\defineactivetoken 245 {\cyrillicotld} +\defineactivetoken 246 {\cyrillicY} +\defineactivetoken 247 {\cyrillicy} +\defineactivetoken 248 {\cyrillicZHDSC} +\defineactivetoken 249 {\cyrilliczhdsc} +\defineactivetoken 250 {\cyrillicNDSC} +\defineactivetoken 251 {\cyrillicndsc} +\defineactivetoken 252 {\cyrillicSHHA} +\defineactivetoken 253 {\cyrillicshha} +\defineactivetoken 254 {\textblacksquare} +\defineactivetoken 255 {\nonbreakablespace} + +\stopregime + +\startregime[ctt] + +\defineactivetoken 171 {\leftguillemot} +\defineactivetoken 187 {\rightguillemot} +\defineactivetoken 192 {\cyrillicA} +\defineactivetoken 193 {\cyrillicB} +\defineactivetoken 194 {\cyrillicV} +\defineactivetoken 195 {\cyrillicG} +\defineactivetoken 196 {\cyrillicD} +\defineactivetoken 197 {\cyrillicE} +\defineactivetoken 168 {\cyrillicYO} +\defineactivetoken 198 {\cyrillicZH} +\defineactivetoken 199 {\cyrillicZ} +\defineactivetoken 200 {\cyrillicI} +\defineactivetoken 201 {\cyrillicISHRT} +\defineactivetoken 202 {\cyrillicK} +\defineactivetoken 203 {\cyrillicL} +\defineactivetoken 204 {\cyrillicM} +\defineactivetoken 205 {\cyrillicN} +\defineactivetoken 206 {\cyrillicO} +\defineactivetoken 170 {\cyrillicOTLD} +\defineactivetoken 207 {\cyrillicP} +\defineactivetoken 208 {\cyrillicR} +\defineactivetoken 209 {\cyrillicS} +\defineactivetoken 210 {\cyrillicT} +\defineactivetoken 211 {\cyrillicU} +\defineactivetoken 175 {\cyrillicY} +\defineactivetoken 212 {\cyrillicF} +\defineactivetoken 213 {\cyrillicH} +\defineactivetoken 214 {\cyrillicC} +\defineactivetoken 215 {\cyrillicCH} +\defineactivetoken 216 {\cyrillicSH} +\defineactivetoken 217 {\cyrillicSHCH} +\defineactivetoken 218 {\cyrillicHRDSN} +\defineactivetoken 219 {\cyrillicERY} +\defineactivetoken 220 {\cyrillicSFTSN} +\defineactivetoken 221 {\cyrillicEREV} +\defineactivetoken 222 {\cyrillicYU} +\defineactivetoken 223 {\cyrillicYA} +\defineactivetoken 224 {\cyrillica} +\defineactivetoken 225 {\cyrillicb} +\defineactivetoken 226 {\cyrillicv} +\defineactivetoken 227 {\cyrillicg} +\defineactivetoken 228 {\cyrillicd} +\defineactivetoken 229 {\cyrillice} +\defineactivetoken 184 {\cyrillicyo} +\defineactivetoken 230 {\cyrilliczh} +\defineactivetoken 231 {\cyrillicz} +\defineactivetoken 232 {\cyrillici} +\defineactivetoken 233 {\cyrillicishrt} +\defineactivetoken 234 {\cyrillick} +\defineactivetoken 235 {\cyrillicl} +\defineactivetoken 236 {\cyrillicm} +\defineactivetoken 237 {\cyrillicn} +\defineactivetoken 238 {\cyrillico} +\defineactivetoken 186 {\cyrillicotld} +\defineactivetoken 239 {\cyrillicp} +\defineactivetoken 240 {\cyrillicr} +\defineactivetoken 241 {\cyrillics} +\defineactivetoken 242 {\cyrillict} +\defineactivetoken 243 {\cyrillicu} +\defineactivetoken 191 {\cyrillicy} +\defineactivetoken 244 {\cyrillicf} +\defineactivetoken 245 {\cyrillich} +\defineactivetoken 246 {\cyrillicc} +\defineactivetoken 247 {\cyrillicch} +\defineactivetoken 248 {\cyrillicsh} +\defineactivetoken 249 {\cyrillicshch} +\defineactivetoken 250 {\cyrillichrdsn} +\defineactivetoken 251 {\cyrillicery} +\defineactivetoken 252 {\cyrillicsftsn} +\defineactivetoken 253 {\cyrillicerev} +\defineactivetoken 254 {\cyrillicyu} +\defineactivetoken 255 {\cyrillicya} + +\stopregime + +\startregime[dbk] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicYO} +\defineactivetoken 135 {\cyrillicZH} +\defineactivetoken 136 {\cyrillicZ} +\defineactivetoken 137 {\cyrillicI} +\defineactivetoken 139 {\cyrillicISHRT} +\defineactivetoken 140 {\cyrillicK} +\defineactivetoken 142 {\cyrillicL} +\defineactivetoken 143 {\cyrillicM} +\defineactivetoken 144 {\cyrillicN} +\defineactivetoken 145 {\cyrillicO} +\defineactivetoken 146 {\cyrillicOTLD} +\defineactivetoken 147 {\cyrillicP} +\defineactivetoken 148 {\cyrillicR} +\defineactivetoken 149 {\cyrillicS} +\defineactivetoken 150 {\cyrillicT} +\defineactivetoken 151 {\cyrillicU} +\defineactivetoken 152 {\cyrillicY} +\defineactivetoken 153 {\cyrillicF} +\defineactivetoken 154 {\cyrillicH} +\defineactivetoken 155 {\cyrillicC} +\defineactivetoken 156 {\cyrillicCH} +\defineactivetoken 157 {\cyrillicSH} +\defineactivetoken 158 {\cyrillicSHCH} +\defineactivetoken 159 {\cyrillicHRDSN} +\defineactivetoken 160 {\cyrillicERY} +\defineactivetoken 161 {\cyrillicSFTSN} +\defineactivetoken 162 {\cyrillicEREV} +\defineactivetoken 163 {\cyrillicYU} +\defineactivetoken 164 {\cyrillicYA} +\defineactivetoken 165 {\cyrillica} +\defineactivetoken 166 {\cyrillicb} +\defineactivetoken 167 {\cyrillicv} +\defineactivetoken 168 {\cyrillicg} +\defineactivetoken 169 {\cyrillicd} +\defineactivetoken 170 {\cyrillice} +\defineactivetoken 171 {\cyrillicyo} +\defineactivetoken 172 {\cyrilliczh} +\defineactivetoken 173 {\cyrillicz} +\defineactivetoken 174 {\cyrillici} +\defineactivetoken 175 {\cyrillicishrt} +\defineactivetoken 225 {\cyrillick} +\defineactivetoken 226 {\cyrillicl} +\defineactivetoken 227 {\cyrillicm} +\defineactivetoken 228 {\cyrillicn} +\defineactivetoken 229 {\cyrillico} +\defineactivetoken 230 {\cyrillicotld} +\defineactivetoken 231 {\cyrillicp} +\defineactivetoken 232 {\cyrillicr} +\defineactivetoken 233 {\cyrillics} +\defineactivetoken 234 {\cyrillict} +\defineactivetoken 235 {\cyrillicu} +\defineactivetoken 236 {\cyrillicy} +\defineactivetoken 237 {\cyrillicf} +\defineactivetoken 238 {\cyrillich} +\defineactivetoken 239 {\cyrillicc} +\defineactivetoken 241 {\cyrillicch} +\defineactivetoken 242 {\cyrillicsh} +\defineactivetoken 243 {\cyrillicshch} +\defineactivetoken 244 {\cyrillichrdsn} +\defineactivetoken 245 {\cyrillicery} +\defineactivetoken 246 {\cyrillicsftsn} +\defineactivetoken 247 {\cyrillicerev} +\defineactivetoken 248 {\cyrillicyu} +\defineactivetoken 249 {\cyrillicya} + +\stopregime + +\startregime[iso88595] + +\defineactivetoken 160 {\nonbreakablespace} +\defineactivetoken 161 {\cyrillicYO} +\defineactivetoken 162 {\cyrillicDJE} +\defineactivetoken 163 {\'\cyrillicG} +\defineactivetoken 164 {\cyrillicIE} +\defineactivetoken 165 {\cyrillicDZE} +\defineactivetoken 166 {\cyrillicII} +\defineactivetoken 167 {\cyrillicYI} +\defineactivetoken 168 {\cyrillicJE} +\defineactivetoken 169 {\cyrillicLJE} +\defineactivetoken 170 {\cyrillicNJE} +\defineactivetoken 171 {\cyrillicTSHE} +\defineactivetoken 172 {\'\cyrillicK} +\defineactivetoken 173 {\-} +\defineactivetoken 174 {\cyrillicUSHRT} +\defineactivetoken 175 {\cyrillicDZHE} +\defineactivetoken 176 {\cyrillicA} +\defineactivetoken 177 {\cyrillicB} +\defineactivetoken 178 {\cyrillicV} +\defineactivetoken 179 {\cyrillicG} +\defineactivetoken 180 {\cyrillicD} +\defineactivetoken 181 {\cyrillicE} +\defineactivetoken 182 {\cyrillicZH} +\defineactivetoken 183 {\cyrillicZ} +\defineactivetoken 184 {\cyrillicI} +\defineactivetoken 185 {\cyrillicISHRT} +\defineactivetoken 186 {\cyrillicK} +\defineactivetoken 187 {\cyrillicL} +\defineactivetoken 188 {\cyrillicM} +\defineactivetoken 189 {\cyrillicN} +\defineactivetoken 190 {\cyrillicO} +\defineactivetoken 191 {\cyrillicP} +\defineactivetoken 192 {\cyrillicR} +\defineactivetoken 193 {\cyrillicS} +\defineactivetoken 194 {\cyrillicT} +\defineactivetoken 195 {\cyrillicU} +\defineactivetoken 196 {\cyrillicF} +\defineactivetoken 197 {\cyrillicH} +\defineactivetoken 198 {\cyrillicC} +\defineactivetoken 199 {\cyrillicCH} +\defineactivetoken 200 {\cyrillicSH} +\defineactivetoken 201 {\cyrillicSHCH} +\defineactivetoken 202 {\cyrillicHRDSN} +\defineactivetoken 203 {\cyrillicERY} +\defineactivetoken 204 {\cyrillicSFTSN} +\defineactivetoken 205 {\cyrillicEREV} +\defineactivetoken 206 {\cyrillicYU} +\defineactivetoken 207 {\cyrillicYA} +\defineactivetoken 208 {\cyrillica} +\defineactivetoken 209 {\cyrillicb} +\defineactivetoken 210 {\cyrillicv} +\defineactivetoken 211 {\cyrillicg} +\defineactivetoken 212 {\cyrillicd} +\defineactivetoken 213 {\cyrillice} +\defineactivetoken 214 {\cyrilliczh} +\defineactivetoken 215 {\cyrillicz} +\defineactivetoken 216 {\cyrillici} +\defineactivetoken 217 {\cyrillicishrt} +\defineactivetoken 218 {\cyrillick} +\defineactivetoken 219 {\cyrillicl} +\defineactivetoken 220 {\cyrillicm} +\defineactivetoken 221 {\cyrillicn} +\defineactivetoken 222 {\cyrillico} +\defineactivetoken 223 {\cyrillicp} +\defineactivetoken 224 {\cyrillicr} +\defineactivetoken 225 {\cyrillics} +\defineactivetoken 226 {\cyrillict} +\defineactivetoken 227 {\cyrillicu} +\defineactivetoken 228 {\cyrillicf} +\defineactivetoken 229 {\cyrillich} +\defineactivetoken 230 {\cyrillicc} +\defineactivetoken 231 {\cyrillicch} +\defineactivetoken 232 {\cyrillicsh} +\defineactivetoken 233 {\cyrillicshch} +\defineactivetoken 234 {\cyrillichrdsn} +\defineactivetoken 235 {\cyrillicery} +\defineactivetoken 236 {\cyrillicsftsn} +\defineactivetoken 237 {\cyrillicerev} +\defineactivetoken 238 {\cyrillicyu} +\defineactivetoken 239 {\cyrillicya} +\defineactivetoken 240 {\textnumero} +\defineactivetoken 241 {\cyrillicyo} +\defineactivetoken 242 {\cyrillicdje} +\defineactivetoken 243 {\'\cyrillicg} +\defineactivetoken 244 {\cyrillicie} +\defineactivetoken 245 {\cyrillicdze} +\defineactivetoken 246 {\cyrillicii} +\defineactivetoken 247 {\cyrillicyi} +\defineactivetoken 248 {\cyrillicje} +\defineactivetoken 249 {\cyrilliclje} +\defineactivetoken 250 {\cyrillicnje} +\defineactivetoken 251 {\cyrillictshe} +\defineactivetoken 252 {\'\cyrillick} +\defineactivetoken 253 {\sectionmark} +\defineactivetoken 254 {\cyrillicushrt} +\defineactivetoken 255 {\cyrillicdzhe} + +\stopregime + +\startregime[isoir111] + +\defineactivetoken 225 {\cyrillicA} +\defineactivetoken 226 {\cyrillicB} +\defineactivetoken 247 {\cyrillicV} +\defineactivetoken 231 {\cyrillicG} +\defineactivetoken 228 {\cyrillicD} +\defineactivetoken 229 {\cyrillicE} +\defineactivetoken 179 {\cyrillicYO} +\defineactivetoken 246 {\cyrillicZH} +\defineactivetoken 250 {\cyrillicZ} +\defineactivetoken 233 {\cyrillicI} +\defineactivetoken 234 {\cyrillicISHRT} +\defineactivetoken 235 {\cyrillicK} +\defineactivetoken 236 {\cyrillicL} +\defineactivetoken 237 {\cyrillicM} +\defineactivetoken 238 {\cyrillicN} +\defineactivetoken 239 {\cyrillicO} +\defineactivetoken 240 {\cyrillicP} +\defineactivetoken 242 {\cyrillicR} +\defineactivetoken 243 {\cyrillicS} +\defineactivetoken 244 {\cyrillicT} +\defineactivetoken 245 {\cyrillicU} +\defineactivetoken 230 {\cyrillicF} +\defineactivetoken 232 {\cyrillicH} +\defineactivetoken 227 {\cyrillicC} +\defineactivetoken 254 {\cyrillicCH} +\defineactivetoken 251 {\cyrillicSH} +\defineactivetoken 253 {\cyrillicSHCH} +\defineactivetoken 255 {\cyrillicHRDSN} +\defineactivetoken 249 {\cyrillicERY} +\defineactivetoken 248 {\cyrillicSFTSN} +\defineactivetoken 252 {\cyrillicEREV} +\defineactivetoken 224 {\cyrillicYU} +\defineactivetoken 241 {\cyrillicYA} +\defineactivetoken 193 {\cyrillica} +\defineactivetoken 194 {\cyrillicb} +\defineactivetoken 215 {\cyrillicv} +\defineactivetoken 199 {\cyrillicg} +\defineactivetoken 196 {\cyrillicd} +\defineactivetoken 197 {\cyrillice} +\defineactivetoken 163 {\cyrillicyo} +\defineactivetoken 214 {\cyrilliczh} +\defineactivetoken 218 {\cyrillicz} +\defineactivetoken 201 {\cyrillici} +\defineactivetoken 202 {\cyrillicishrt} +\defineactivetoken 203 {\cyrillick} +\defineactivetoken 204 {\cyrillicl} +\defineactivetoken 205 {\cyrillicm} +\defineactivetoken 206 {\cyrillicn} +\defineactivetoken 207 {\cyrillico} +\defineactivetoken 208 {\cyrillicp} +\defineactivetoken 210 {\cyrillicr} +\defineactivetoken 211 {\cyrillics} +\defineactivetoken 212 {\cyrillict} +\defineactivetoken 213 {\cyrillicu} +\defineactivetoken 198 {\cyrillicf} +\defineactivetoken 200 {\cyrillich} +\defineactivetoken 195 {\cyrillicc} +\defineactivetoken 222 {\cyrillicch} +\defineactivetoken 219 {\cyrillicsh} +\defineactivetoken 221 {\cyrillicshch} +\defineactivetoken 223 {\cyrillichrdsn} +\defineactivetoken 217 {\cyrillicery} +\defineactivetoken 216 {\cyrillicsftsn} +\defineactivetoken 220 {\cyrillicerev} +\defineactivetoken 192 {\cyrillicyu} +\defineactivetoken 209 {\cyrillicya} +\defineactivetoken 160 {\nonbreakablespace} +\defineactivetoken 161 {\cyrillicdje} +\defineactivetoken 162 {\'\cyrillicg} +\defineactivetoken 164 {\cyrillicie} +\defineactivetoken 165 {\cyrillicdze} +\defineactivetoken 166 {\cyrillicii} +\defineactivetoken 167 {\cyrillicyi} +\defineactivetoken 168 {\cyrillicje} +\defineactivetoken 169 {\cyrilliclje} +\defineactivetoken 170 {\cyrillicnje} +\defineactivetoken 171 {\cyrillictshe} +\defineactivetoken 172 {\'\cyrillick} +\defineactivetoken 173 {\-} +\defineactivetoken 174 {\cyrillicushrt} +\defineactivetoken 175 {\cyrillicdzhe} +\defineactivetoken 176 {\textnumero} +\defineactivetoken 177 {\cyrillicDJE} +\defineactivetoken 178 {\'\cyrillicG} +\defineactivetoken 180 {\cyrillicIE} +\defineactivetoken 181 {\cyrillicDZE} +\defineactivetoken 182 {\cyrillicII} +\defineactivetoken 183 {\cyrillicYI} +\defineactivetoken 184 {\cyrillicJE} +\defineactivetoken 185 {\cyrillicLJE} +\defineactivetoken 186 {\cyrillicNJE} +\defineactivetoken 187 {\cyrillicTSHE} +\defineactivetoken 188 {\'\cyrillicK} +\defineactivetoken 189 {\textcurrency} +\defineactivetoken 190 {\cyrillicUSHRT} +\defineactivetoken 191 {\cyrillicDZHE} + +\stopregime + +\startregime[mik] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicZH} +\defineactivetoken 135 {\cyrillicZ} +\defineactivetoken 136 {\cyrillicI} +\defineactivetoken 137 {\cyrillicISHRT} +\defineactivetoken 138 {\cyrillicK} +\defineactivetoken 139 {\cyrillicL} +\defineactivetoken 140 {\cyrillicM} +\defineactivetoken 141 {\cyrillicN} +\defineactivetoken 142 {\cyrillicO} +\defineactivetoken 143 {\cyrillicP} +\defineactivetoken 144 {\cyrillicR} +\defineactivetoken 145 {\cyrillicS} +\defineactivetoken 146 {\cyrillicT} +\defineactivetoken 147 {\cyrillicU} +\defineactivetoken 148 {\cyrillicF} +\defineactivetoken 149 {\cyrillicH} +\defineactivetoken 150 {\cyrillicC} +\defineactivetoken 151 {\cyrillicCH} +\defineactivetoken 152 {\cyrillicSH} +\defineactivetoken 153 {\cyrillicSHCH} +\defineactivetoken 154 {\cyrillicHRDSN} +\defineactivetoken 155 {\cyrillicERY} +\defineactivetoken 156 {\cyrillicSFTSN} +\defineactivetoken 157 {\cyrillicEREV} +\defineactivetoken 158 {\cyrillicYU} +\defineactivetoken 159 {\cyrillicYA} +\defineactivetoken 160 {\cyrillica} +\defineactivetoken 161 {\cyrillicb} +\defineactivetoken 162 {\cyrillicv} +\defineactivetoken 163 {\cyrillicg} +\defineactivetoken 164 {\cyrillicd} +\defineactivetoken 165 {\cyrillice} +\defineactivetoken 166 {\cyrilliczh} +\defineactivetoken 167 {\cyrillicz} +\defineactivetoken 168 {\cyrillici} +\defineactivetoken 169 {\cyrillicishrt} +\defineactivetoken 170 {\cyrillick} +\defineactivetoken 171 {\cyrillicl} +\defineactivetoken 172 {\cyrillicm} +\defineactivetoken 173 {\cyrillicn} +\defineactivetoken 174 {\cyrillico} +\defineactivetoken 175 {\cyrillicp} +\defineactivetoken 176 {\cyrillicr} +\defineactivetoken 177 {\cyrillics} +\defineactivetoken 178 {\cyrillict} +\defineactivetoken 179 {\cyrillicu} +\defineactivetoken 180 {\cyrillicf} +\defineactivetoken 181 {\cyrillich} +\defineactivetoken 182 {\cyrillicc} +\defineactivetoken 183 {\cyrillicch} +\defineactivetoken 184 {\cyrillicsh} +\defineactivetoken 185 {\cyrillicshch} +\defineactivetoken 186 {\cyrillichrdsn} +\defineactivetoken 187 {\cyrillicery} +\defineactivetoken 188 {\cyrillicsftsn} +\defineactivetoken 189 {\cyrillicerev} +\defineactivetoken 190 {\cyrillicyu} +\defineactivetoken 191 {\cyrillicya} +\defineactivetoken 213 {\textnumero} +\defineactivetoken 214 {\sectionmark} +\defineactivetoken 248 {\textdegree} +\defineactivetoken 249 {\textbullet} +\defineactivetoken 250 {\periodcentered} +\defineactivetoken 254 {\textblacksquare} +\defineactivetoken 255 {\nonbreakablespace} +\defineactivetoken 224 {\mathematics\alpha} +\defineactivetoken 225 {\mathematics\beta} +\defineactivetoken 226 {\mathematics\Gamma} +\defineactivetoken 227 {\mathematics\pi} +\defineactivetoken 228 {\mathematics\Sigma} +\defineactivetoken 229 {\mathematics\sigma} +\defineactivetoken 230 {\textmu} +\defineactivetoken 231 {\mathematics\tau} +\defineactivetoken 232 {\mathematics\Phi} +\defineactivetoken 233 {\mathematics\Theta} +\defineactivetoken 234 {\mathematics\Omega} +\defineactivetoken 235 {\mathematics\delta} +\defineactivetoken 236 {\mathematics\infty} +\defineactivetoken 237 {\mathematics\emptyset} +\defineactivetoken 238 {\mathematics\in} +\defineactivetoken 239 {\mathematics\cap} +\defineactivetoken 240 {\mathematics\equiv} +\defineactivetoken 241 {\textpm} +\defineactivetoken 242 {\mathematics\geq} +\defineactivetoken 243 {\mathematics\leq} +\defineactivetoken 246 {\textdiv} +\defineactivetoken 247 {\mathematics\sim} +\defineactivetoken 251 {\textsurd} +\defineactivetoken 252 {\high{\txx n}} +\defineactivetoken 253 {\twosuperior} + +\stopregime + +\startregime[mls] + +% The symbols 194 to 253 are defined in Mongolian fonts in +% the Mon\TeX\ package (?) + +\defineactivetoken 128 {\cyrillicB} +\defineactivetoken 129 {\cyrillicy} +\defineactivetoken 130 {\cyrillicD} +\defineactivetoken 131 {\cyrillicYO} +\defineactivetoken 132 {\cyrillicerev} +\defineactivetoken 133 {\cyrillicZH} +\defineactivetoken 134 {\cyrillicZ} +\defineactivetoken 135 {\cyrillicI} +\defineactivetoken 136 {\cyrillicISHRT} +\defineactivetoken 137 {\cyrillicyo} +\defineactivetoken 138 {\cyrillicL} +\defineactivetoken 139 {\cyrillicishrt} +\defineactivetoken 140 {\cyrillicOTLD} +\defineactivetoken 141 {\cyrillicP} +\defineactivetoken 142 {\cyrillicEREV} +\defineactivetoken 143 {\cyrillicU} +\defineactivetoken 144 {\cyrillicF} +\defineactivetoken 145 {\cyrillicC} +\defineactivetoken 146 {\cyrillicCH} +\defineactivetoken 147 {\cyrillicSH} +\defineactivetoken 148 {\cyrillicotld} +\defineactivetoken 149 {\cyrillicSHCH} +\defineactivetoken 150 {\cyrillicHRDSN} +\defineactivetoken 151 {\cyrillicERY} +\defineactivetoken 152 {\cyrillicSFTSN} +\defineactivetoken 153 {\cyrillicOTLD} +\defineactivetoken 154 {\cyrillicY} +\defineactivetoken 155 {\cyrillicEREV} +\defineactivetoken 156 {\cyrillicYU} +\defineactivetoken 157 {\cyrillicYA} +\defineactivetoken 158 {\cyrillicb} +\defineactivetoken 159 {\cyrillicv} +\defineactivetoken 160 {\cyrillicg} +\defineactivetoken 161 {\cyrillicd} +\defineactivetoken 162 {\cyrilliczh} +\defineactivetoken 163 {\cyrillicz} +\defineactivetoken 164 {\cyrillici} +\defineactivetoken 165 {\cyrillicishrt} +\defineactivetoken 166 {\cyrillick} +\defineactivetoken 167 {\cyrillicl} +\defineactivetoken 168 {\cyrillicm} +\defineactivetoken 169 {\cyrillicn} +\defineactivetoken 170 {\cyrillicotld} +\defineactivetoken 171 {\cyrillicp} +\defineactivetoken 172 {\cyrillict} +\defineactivetoken 173 {\cyrillicy} +\defineactivetoken 174 {\leftguillemot} +\defineactivetoken 175 {\rightguillemot} +\defineactivetoken 176 {\cyrillicf} +\defineactivetoken 177 {\cyrillicc} +\defineactivetoken 178 {\cyrillicch} +\defineactivetoken 180 {\cyrillicsh} +\defineactivetoken 181 {\cyrillicshch} +\defineactivetoken 182 {\cyrillichrdsn} +\defineactivetoken 183 {\cyrillicery} +\defineactivetoken 184 {\cyrillicsftsn} +\defineactivetoken 189 {\cyrillicerev} +\defineactivetoken 190 {\cyrillicyu} +\defineactivetoken 193 {\cyrillicya} +\defineactivetoken 226 {\cyrillicG} +\defineactivetoken 225 {\ss} +\defineactivetoken 231 {\mathematics{\gamma}} +\defineactivetoken 255 {\nonbreakablespace} +\defineactivetoken 194 {\titem} +\defineactivetoken 195 {\shud} +\defineactivetoken 197 {\secondaryshud} +\defineactivetoken 198 {\shilbe} +\defineactivetoken 199 {\gedes} +\defineactivetoken 207 {\secondarygedes} +\defineactivetoken 208 {\cegteishud} +\defineactivetoken 209 {\lewer} +\defineactivetoken 210 {\suuliinlewer} +\defineactivetoken 211 {\tertiarylewer} +\defineactivetoken 212 {\mewer} +\defineactivetoken 213 {\suuliinmewer} +\defineactivetoken 214 {\xewteeqix} +\defineactivetoken 215 {\dawxarcegtxewteeqix} +\defineactivetoken 216 {\halfnum} +\defineactivetoken 219 {\num} +\defineactivetoken 220 {\halfnumtgedes} +\defineactivetoken 221 {\numtaigedes} +\defineactivetoken 222 {\buruuxarsangedes} +\defineactivetoken 223 {\gedesteishilbe} +\defineactivetoken 224 {\erweeljinshilbe} +\defineactivetoken 227 {\secerweeljin} +\defineactivetoken 228 {\bosooshilbe} +\defineactivetoken 229 {\etgershilbe} +\defineactivetoken 230 {\zawj} +\defineactivetoken 232 {\suuliinzawj} +\defineactivetoken 233 {\dawxarcegtzawj} +\defineactivetoken 234 {\sereeewer} +\defineactivetoken 235 {\matgarshilbe} +\defineactivetoken 236 {\bituushilbe} +\defineactivetoken 237 {\secondaryqagt} +\defineactivetoken 238 {\qagt} +\defineactivetoken 239 {\secnumtdelbenqix} +\defineactivetoken 240 {\numtdelbenqix} +\defineactivetoken 241 {\secsertenqixtnum} +\defineactivetoken 242 {\sertenqixtnum} +\defineactivetoken 243 {\zadgaizardigt} +\defineactivetoken 244 {\bituuzardigt} +\defineactivetoken 245 {\malgaitaititem} +\defineactivetoken 246 {\suul} +\defineactivetoken 247 {\orxic} +\defineactivetoken 248 {\biodoisuul} +\defineactivetoken 249 {\bagodoisuul} +\defineactivetoken 250 {\nceg} +\defineactivetoken 251 {\gceg} +\defineactivetoken 252 {\ceg} +\defineactivetoken 253 {\dorwoljin} + +\stopregime + +\startregime[mnk] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicYO} +\defineactivetoken 135 {\cyrillicZH} +\defineactivetoken 136 {\cyrillicZ} +\defineactivetoken 137 {\cyrillicI} +\defineactivetoken 138 {\cyrillicISHRT} +\defineactivetoken 139 {\cyrillicK} +\defineactivetoken 140 {\cyrillicL} +\defineactivetoken 141 {\cyrillicM} +\defineactivetoken 142 {\cyrillicN} +\defineactivetoken 143 {\cyrillicO} +\defineactivetoken 144 {\cyrillicOTLD} +\defineactivetoken 145 {\cyrillicP} +\defineactivetoken 146 {\cyrillicR} +\defineactivetoken 147 {\cyrillicS} +\defineactivetoken 148 {\cyrillicT} +\defineactivetoken 149 {\cyrillicU} +\defineactivetoken 150 {\cyrillicY} +\defineactivetoken 151 {\cyrillicF} +\defineactivetoken 152 {\cyrillicH} +\defineactivetoken 153 {\cyrillicC} +\defineactivetoken 154 {\cyrillicCH} +\defineactivetoken 155 {\cyrillicSH} +\defineactivetoken 156 {\cyrillicSHCH} +\defineactivetoken 157 {\cyrillicHRDSN} +\defineactivetoken 158 {\cyrillicERY} +\defineactivetoken 159 {\cyrillicSFTSN} +\defineactivetoken 160 {\cyrillicEREV} +\defineactivetoken 161 {\cyrillicYU} +\defineactivetoken 162 {\cyrillicYA} +\defineactivetoken 163 {\cyrillica} +\defineactivetoken 164 {\cyrillicb} +\defineactivetoken 165 {\cyrillicv} +\defineactivetoken 166 {\cyrillicg} +\defineactivetoken 167 {\cyrillicd} +\defineactivetoken 168 {\cyrillice} +\defineactivetoken 169 {\cyrillicyo} +\defineactivetoken 170 {\cyrilliczh} +\defineactivetoken 173 {\cyrillicz} +\defineactivetoken 224 {\cyrillici} +\defineactivetoken 225 {\cyrillicishrt} +\defineactivetoken 226 {\cyrillick} +\defineactivetoken 227 {\cyrillicl} +\defineactivetoken 228 {\cyrillicm} +\defineactivetoken 229 {\cyrillicn} +\defineactivetoken 230 {\cyrillico} +\defineactivetoken 231 {\cyrillicotld} +\defineactivetoken 232 {\cyrillicp} +\defineactivetoken 233 {\cyrillicr} +\defineactivetoken 234 {\cyrillics} +\defineactivetoken 235 {\cyrillict} +\defineactivetoken 236 {\cyrillicu} +\defineactivetoken 237 {\cyrillicy} +\defineactivetoken 238 {\cyrillicf} +\defineactivetoken 239 {\cyrillich} +\defineactivetoken 240 {\cyrillicc} +\defineactivetoken 241 {\cyrillicch} +\defineactivetoken 242 {\cyrillicsh} +\defineactivetoken 243 {\cyrillicshch} +\defineactivetoken 244 {\cyrillichrdsn} +\defineactivetoken 245 {\cyrillicery} +\defineactivetoken 248 {\cyrillicsftsn} +\defineactivetoken 252 {\cyrillicerev} +\defineactivetoken 253 {\cyrillicyu} +\defineactivetoken 254 {\cyrillicya} + +\stopregime + +\startregime[mos] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 160 {\cyrillicYO} +\defineactivetoken 134 {\cyrillicZH} +\defineactivetoken 135 {\cyrillicZ} +\defineactivetoken 136 {\cyrillicI} +\defineactivetoken 137 {\cyrillicISHRT} +\defineactivetoken 138 {\cyrillicK} +\defineactivetoken 139 {\cyrillicL} +\defineactivetoken 140 {\cyrillicM} +\defineactivetoken 141 {\cyrillicN} +\defineactivetoken 142 {\cyrillicO} +\defineactivetoken 153 {\cyrillicOTLD} +\defineactivetoken 143 {\cyrillicP} +\defineactivetoken 144 {\cyrillicR} +\defineactivetoken 145 {\cyrillicS} +\defineactivetoken 146 {\cyrillicT} +\defineactivetoken 147 {\cyrillicU} +\defineactivetoken 154 {\cyrillicY} +\defineactivetoken 148 {\cyrillicF} +\defineactivetoken 149 {\cyrillicH} +\defineactivetoken 150 {\cyrillicC} +\defineactivetoken 151 {\cyrillicCH} +\defineactivetoken 152 {\cyrillicSH} +\defineactivetoken 164 {\cyrillicSHCH} +\defineactivetoken 162 {\cyrillicHRDSN} +\defineactivetoken 155 {\cyrillicERY} +\defineactivetoken 156 {\cyrillicSFTSN} +\defineactivetoken 157 {\cyrillicEREV} +\defineactivetoken 158 {\cyrillicYU} +\defineactivetoken 159 {\cyrillicYA} +\defineactivetoken 224 {\cyrillica} +\defineactivetoken 225 {\cyrillicb} +\defineactivetoken 226 {\cyrillicv} +\defineactivetoken 227 {\cyrillicg} +\defineactivetoken 228 {\cyrillicd} +\defineactivetoken 229 {\cyrillice} +\defineactivetoken 161 {\cyrillicyo} +\defineactivetoken 230 {\cyrilliczh} +\defineactivetoken 231 {\cyrillicz} +\defineactivetoken 232 {\cyrillici} +\defineactivetoken 233 {\cyrillicishrt} +\defineactivetoken 234 {\cyrillick} +\defineactivetoken 235 {\cyrillicl} +\defineactivetoken 236 {\cyrillicm} +\defineactivetoken 237 {\cyrillicn} +\defineactivetoken 238 {\cyrillico} +\defineactivetoken 249 {\cyrillicotld} +\defineactivetoken 239 {\cyrillicp} +\defineactivetoken 240 {\cyrillicr} +\defineactivetoken 241 {\cyrillics} +\defineactivetoken 242 {\cyrillict} +\defineactivetoken 243 {\cyrillicu} +\defineactivetoken 250 {\cyrillicy} +\defineactivetoken 244 {\cyrillicf} +\defineactivetoken 245 {\cyrillich} +\defineactivetoken 246 {\cyrillicc} +\defineactivetoken 247 {\cyrillicch} +\defineactivetoken 248 {\cyrillicsh} +\defineactivetoken 165 {\cyrillicshch} +\defineactivetoken 163 {\cyrillichrdsn} +\defineactivetoken 251 {\cyrillicery} +\defineactivetoken 252 {\cyrillicsftsn} +\defineactivetoken 253 {\cyrillicerev} +\defineactivetoken 254 {\cyrillicyu} +\defineactivetoken 168 {\cyrillicya} + +\stopregime + +\startregime[ncc] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicYO} +\defineactivetoken 135 {\cyrillicZH} +\defineactivetoken 136 {\cyrillicZ} +\defineactivetoken 137 {\cyrillicI} +\defineactivetoken 139 {\cyrillicISHRT} +\defineactivetoken 140 {\cyrillicK} +\defineactivetoken 142 {\cyrillicL} +\defineactivetoken 143 {\cyrillicM} +\defineactivetoken 144 {\cyrillicN} +\defineactivetoken 145 {\cyrillicO} +\defineactivetoken 146 {\cyrillicOTLD} +\defineactivetoken 147 {\cyrillicP} +\defineactivetoken 148 {\cyrillicR} +\defineactivetoken 149 {\cyrillicS} +\defineactivetoken 150 {\cyrillicT} +\defineactivetoken 151 {\cyrillicU} +\defineactivetoken 152 {\cyrillicY} +\defineactivetoken 153 {\cyrillicF} +\defineactivetoken 154 {\cyrillicH} +\defineactivetoken 155 {\cyrillicC} +\defineactivetoken 156 {\cyrillicCH} +\defineactivetoken 157 {\cyrillicSH} +\defineactivetoken 158 {\cyrillicSHCH} +\defineactivetoken 159 {\cyrillicHRDSN} +\defineactivetoken 160 {\cyrillicERY} +\defineactivetoken 161 {\cyrillicSFTSN} +\defineactivetoken 162 {\cyrillicEREV} +\defineactivetoken 163 {\cyrillicYU} +\defineactivetoken 164 {\cyrillicYA} +\defineactivetoken 165 {\cyrillica} +\defineactivetoken 166 {\cyrillicb} +\defineactivetoken 167 {\cyrillicv} +\defineactivetoken 168 {\cyrillicg} +\defineactivetoken 169 {\cyrillicd} +\defineactivetoken 170 {\cyrillice} +\defineactivetoken 171 {\cyrillicyo} +\defineactivetoken 172 {\cyrilliczh} +\defineactivetoken 173 {\cyrillicz} +\defineactivetoken 225 {\cyrillici} +\defineactivetoken 226 {\cyrillicishrt} +\defineactivetoken 227 {\cyrillick} +\defineactivetoken 228 {\cyrillicl} +\defineactivetoken 229 {\cyrillicm} +\defineactivetoken 230 {\cyrillicn} +\defineactivetoken 231 {\cyrillico} +\defineactivetoken 232 {\cyrillicotld} +\defineactivetoken 233 {\cyrillicp} +\defineactivetoken 234 {\cyrillicr} +\defineactivetoken 235 {\cyrillics} +\defineactivetoken 236 {\cyrillict} +\defineactivetoken 237 {\cyrillicu} +\defineactivetoken 238 {\cyrillicy} +\defineactivetoken 239 {\cyrillicf} +\defineactivetoken 240 {\cyrillich} +\defineactivetoken 241 {\cyrillicc} +\defineactivetoken 242 {\cyrillicch} +\defineactivetoken 243 {\cyrillicsh} +\defineactivetoken 244 {\cyrillicshch} +\defineactivetoken 245 {\cyrillichrdsn} +\defineactivetoken 246 {\cyrillicery} +\defineactivetoken 247 {\cyrillicsftsn} +\defineactivetoken 248 {\cyrillicerev} +\defineactivetoken 249 {\cyrillicyu} +\defineactivetoken 251 {\cyrillicya} + +\stopregime + +\endinput diff --git a/tex/context/base/regi-cyp.tex b/tex/context/base/regi-cyp.tex deleted file mode 100644 index 7d134df50..000000000 --- a/tex/context/base/regi-cyp.tex +++ /dev/null @@ -1,1169 +0,0 @@ -%D \module -%D [ file=regi-cyp, -%D version=2003.01.24, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Cyrillic Plus, -%D author=..., -%D date=\currentdate, -%D copyright={PRAGMA / 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 file several rarely user cyrillic input regimes -%D are defined. - -\startregime[cp855] - -\defineactivetoken 128 {\cyrillicdje} -\defineactivetoken 129 {\cyrillicDJE} -\defineactivetoken 130 {\'\cyrillicg} -\defineactivetoken 131 {\'\cyrillicG} -\defineactivetoken 132 {\cyrillicyo} -\defineactivetoken 133 {\cyrillicYO} -\defineactivetoken 134 {\cyrillicie} -\defineactivetoken 135 {\cyrillicIE} -\defineactivetoken 136 {\cyrillicdze} -\defineactivetoken 137 {\cyrillicDZE} -\defineactivetoken 138 {\cyrillicii} -\defineactivetoken 139 {\cyrillicII} -\defineactivetoken 140 {\cyrillicyi} -\defineactivetoken 141 {\cyrillicYI} -\defineactivetoken 142 {\cyrillicje} -\defineactivetoken 143 {\cyrillicJE} -\defineactivetoken 144 {\cyrilliclje} -\defineactivetoken 145 {\cyrillicLJE} -\defineactivetoken 146 {\cyrillicnje} -\defineactivetoken 147 {\cyrillicNJE} -\defineactivetoken 148 {\cyrillictshe} -\defineactivetoken 149 {\cyrillicTSHE} -\defineactivetoken 150 {\'\cyrillick} -\defineactivetoken 151 {\'\cyrillicK} -\defineactivetoken 152 {\cyrillicushrt} -\defineactivetoken 153 {\cyrillicUSHRT} -\defineactivetoken 154 {\cyrillicdzhe} -\defineactivetoken 155 {\cyrillicDZHE} -\defineactivetoken 156 {\cyrillicyu} -\defineactivetoken 157 {\cyrillicYU} -\defineactivetoken 158 {\cyrillichrdsn} -\defineactivetoken 159 {\cyrillicHRDSN} -\defineactivetoken 160 {\cyrillica} -\defineactivetoken 161 {\cyrillicA} -\defineactivetoken 162 {\cyrillicb} -\defineactivetoken 163 {\cyrillicB} -\defineactivetoken 164 {\cyrillicc} -\defineactivetoken 165 {\cyrillicC} -\defineactivetoken 166 {\cyrillicd} -\defineactivetoken 167 {\cyrillicD} -\defineactivetoken 168 {\cyrillice} -\defineactivetoken 169 {\cyrillicE} -\defineactivetoken 170 {\cyrillicf} -\defineactivetoken 171 {\cyrillicF} -\defineactivetoken 172 {\cyrillicg} -\defineactivetoken 173 {\cyrillicG} -\defineactivetoken 174 {\leftguillemot} -\defineactivetoken 175 {\rightguillemot} -\defineactivetoken 181 {\cyrillich} -\defineactivetoken 182 {\cyrillicH} -\defineactivetoken 183 {\cyrillici} -\defineactivetoken 184 {\cyrillicI} -\defineactivetoken 189 {\cyrillicishrt} -\defineactivetoken 190 {\cyrillicISHRT} -\defineactivetoken 198 {\cyrillick} -\defineactivetoken 199 {\cyrillicK} -\defineactivetoken 207 {\textcurrency} -\defineactivetoken 208 {\cyrillicl} -\defineactivetoken 209 {\cyrillicL} -\defineactivetoken 210 {\cyrillicm} -\defineactivetoken 211 {\cyrillicM} -\defineactivetoken 212 {\cyrillicn} -\defineactivetoken 213 {\cyrillicN} -\defineactivetoken 214 {\cyrillico} -\defineactivetoken 215 {\cyrillicO} -\defineactivetoken 216 {\cyrillicp} -\defineactivetoken 221 {\cyrillicP} -\defineactivetoken 222 {\cyrillicya} -\defineactivetoken 224 {\cyrillicYA} -\defineactivetoken 225 {\cyrillicr} -\defineactivetoken 226 {\cyrillicR} -\defineactivetoken 227 {\cyrillics} -\defineactivetoken 228 {\cyrillicS} -\defineactivetoken 229 {\cyrillict} -\defineactivetoken 230 {\cyrillicT} -\defineactivetoken 231 {\cyrillicu} -\defineactivetoken 232 {\cyrillicU} -\defineactivetoken 233 {\cyrilliczh} -\defineactivetoken 234 {\cyrillicZH} -\defineactivetoken 235 {\cyrillicv} -\defineactivetoken 236 {\cyrillicV} -\defineactivetoken 237 {\cyrillicsftsn} -\defineactivetoken 238 {\cyrillicSFTSN} -\defineactivetoken 239 {\textnumero} -\defineactivetoken 240 {\-} -\defineactivetoken 241 {\cyrillicery} -\defineactivetoken 242 {\cyrillicERY} -\defineactivetoken 243 {\cyrillicz} -\defineactivetoken 244 {\cyrillicZ} -\defineactivetoken 245 {\cyrillicsh} -\defineactivetoken 246 {\cyrillicSH} -\defineactivetoken 247 {\cyrillicerev} -\defineactivetoken 248 {\cyrillicEREV} -\defineactivetoken 249 {\cyrillicshch} -\defineactivetoken 250 {\cyrillicSHCH} -\defineactivetoken 251 {\cyrillicch} -\defineactivetoken 252 {\cyrillicCH} -\defineactivetoken 253 {\sectionmark} -\defineactivetoken 254 {\textblacksquare} -\defineactivetoken 255 {\nonbreakablespace} - -\stopregime - -\startregime[cp866av] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicZH} -\defineactivetoken 135 {\cyrillicZ} -\defineactivetoken 136 {\cyrillicI} -\defineactivetoken 137 {\cyrillicISHRT} -\defineactivetoken 138 {\cyrillicK} -\defineactivetoken 139 {\cyrillicL} -\defineactivetoken 140 {\cyrillicM} -\defineactivetoken 141 {\cyrillicN} -\defineactivetoken 142 {\cyrillicO} -\defineactivetoken 143 {\cyrillicP} -\defineactivetoken 144 {\cyrillicR} -\defineactivetoken 145 {\cyrillicS} -\defineactivetoken 146 {\cyrillicT} -\defineactivetoken 147 {\cyrillicU} -\defineactivetoken 148 {\cyrillicF} -\defineactivetoken 149 {\cyrillicH} -\defineactivetoken 150 {\cyrillicC} -\defineactivetoken 151 {\cyrillicCH} -\defineactivetoken 152 {\cyrillicSH} -\defineactivetoken 153 {\cyrillicSHCH} -\defineactivetoken 154 {\cyrillicHRDSN} -\defineactivetoken 155 {\cyrillicERY} -\defineactivetoken 156 {\cyrillicSFTSN} -\defineactivetoken 157 {\cyrillicEREV} -\defineactivetoken 158 {\cyrillicYU} -\defineactivetoken 159 {\cyrillicYA} -\defineactivetoken 160 {\cyrillica} -\defineactivetoken 161 {\cyrillicb} -\defineactivetoken 162 {\cyrillicv} -\defineactivetoken 163 {\cyrillicg} -\defineactivetoken 164 {\cyrillicd} -\defineactivetoken 165 {\cyrillice} -\defineactivetoken 166 {\cyrilliczh} -\defineactivetoken 167 {\cyrillicz} -\defineactivetoken 168 {\cyrillici} -\defineactivetoken 169 {\cyrillicishrt} -\defineactivetoken 170 {\cyrillick} -\defineactivetoken 171 {\cyrillicl} -\defineactivetoken 172 {\cyrillicm} -\defineactivetoken 173 {\cyrillicn} -\defineactivetoken 174 {\cyrillico} -\defineactivetoken 175 {\cyrillicp} -\defineactivetoken 224 {\cyrillicr} -\defineactivetoken 225 {\cyrillics} -\defineactivetoken 226 {\cyrillict} -\defineactivetoken 227 {\cyrillicu} -\defineactivetoken 228 {\cyrillicf} -\defineactivetoken 229 {\cyrillich} -\defineactivetoken 230 {\cyrillicc} -\defineactivetoken 231 {\cyrillicch} -\defineactivetoken 232 {\cyrillicsh} -\defineactivetoken 233 {\cyrillicshch} -\defineactivetoken 234 {\cyrillichrdsn} -\defineactivetoken 235 {\cyrillicery} -\defineactivetoken 236 {\cyrillicsftsn} -\defineactivetoken 237 {\cyrillicerev} -\defineactivetoken 238 {\cyrillicyu} -\defineactivetoken 239 {\cyrillicya} -\defineactivetoken 240 {\cyrillicYO} -\defineactivetoken 241 {\cyrillicyo} -\defineactivetoken 252 {\textnumero} -\defineactivetoken 253 {\textcurrency} -\defineactivetoken 254 {\textblacksquare} -\defineactivetoken 255 {\nonbreakablespace} -\defineactivetoken 246 {\mathematics\rightarrow} -\defineactivetoken 247 {\mathematics\leftarrow} -\defineactivetoken 248 {\mathematics\downarrow} -\defineactivetoken 249 {\mathematics\uparrow} -\defineactivetoken 250 {\textdiv} -\defineactivetoken 251 {\textpm} - -\stopregime - -\startregime[cp866mav] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicZH} -\defineactivetoken 135 {\cyrillicZ} -\defineactivetoken 136 {\cyrillicI} -\defineactivetoken 137 {\cyrillicISHRT} -\defineactivetoken 138 {\cyrillicK} -\defineactivetoken 139 {\cyrillicL} -\defineactivetoken 140 {\cyrillicM} -\defineactivetoken 141 {\cyrillicN} -\defineactivetoken 142 {\cyrillicO} -\defineactivetoken 143 {\cyrillicP} -\defineactivetoken 144 {\cyrillicR} -\defineactivetoken 145 {\cyrillicS} -\defineactivetoken 146 {\cyrillicT} -\defineactivetoken 147 {\cyrillicU} -\defineactivetoken 148 {\cyrillicF} -\defineactivetoken 149 {\cyrillicH} -\defineactivetoken 150 {\cyrillicC} -\defineactivetoken 151 {\cyrillicCH} -\defineactivetoken 152 {\cyrillicSH} -\defineactivetoken 153 {\cyrillicSHCH} -\defineactivetoken 154 {\cyrillicHRDSN} -\defineactivetoken 155 {\cyrillicERY} -\defineactivetoken 156 {\cyrillicSFTSN} -\defineactivetoken 157 {\cyrillicEREV} -\defineactivetoken 158 {\cyrillicYU} -\defineactivetoken 159 {\cyrillicYA} -\defineactivetoken 160 {\cyrillica} -\defineactivetoken 161 {\cyrillicb} -\defineactivetoken 162 {\cyrillicv} -\defineactivetoken 163 {\cyrillicg} -\defineactivetoken 164 {\cyrillicd} -\defineactivetoken 165 {\cyrillice} -\defineactivetoken 166 {\cyrilliczh} -\defineactivetoken 167 {\cyrillicz} -\defineactivetoken 168 {\cyrillici} -\defineactivetoken 169 {\cyrillicishrt} -\defineactivetoken 170 {\cyrillick} -\defineactivetoken 171 {\cyrillicl} -\defineactivetoken 172 {\cyrillicm} -\defineactivetoken 173 {\cyrillicn} -\defineactivetoken 174 {\cyrillico} -\defineactivetoken 175 {\cyrillicp} -\defineactivetoken 224 {\cyrillicr} -\defineactivetoken 225 {\cyrillics} -\defineactivetoken 226 {\cyrillict} -\defineactivetoken 227 {\cyrillicu} -\defineactivetoken 228 {\cyrillicf} -\defineactivetoken 229 {\cyrillich} -\defineactivetoken 230 {\cyrillicc} -\defineactivetoken 231 {\cyrillicch} -\defineactivetoken 232 {\cyrillicsh} -\defineactivetoken 233 {\cyrillicshch} -\defineactivetoken 234 {\cyrillichrdsn} -\defineactivetoken 235 {\cyrillicery} -\defineactivetoken 236 {\cyrillicsftsn} -\defineactivetoken 237 {\cyrillicerev} -\defineactivetoken 238 {\cyrillicyu} -\defineactivetoken 239 {\cyrillicya} -\defineactivetoken 240 {\cyrillicYO} -\defineactivetoken 241 {\cyrillicyo} -\defineactivetoken 248 {\textdegree} -\defineactivetoken 249 {\textbullet} -\defineactivetoken 250 {\periodcentered} -\defineactivetoken 254 {\textblacksquare} -\defineactivetoken 255 {\nonbreakablespace} -\defineactivetoken 242 {\mathematics\geq} -\defineactivetoken 243 {\mathematics\leq} -\defineactivetoken 246 {\textdiv} -\defineactivetoken 247 {\mathematics\sim} -\defineactivetoken 251 {\textsurd} -\defineactivetoken 252 {\high{\txx n}} -\defineactivetoken 253 {\twosuperior} - -\stopregime - -\startregime[cp866tat] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicZH} -\defineactivetoken 135 {\cyrillicZ} -\defineactivetoken 136 {\cyrillicI} -\defineactivetoken 137 {\cyrillicISHRT} -\defineactivetoken 138 {\cyrillicK} -\defineactivetoken 139 {\cyrillicL} -\defineactivetoken 140 {\cyrillicM} -\defineactivetoken 141 {\cyrillicN} -\defineactivetoken 142 {\cyrillicO} -\defineactivetoken 143 {\cyrillicP} -\defineactivetoken 144 {\cyrillicR} -\defineactivetoken 145 {\cyrillicS} -\defineactivetoken 146 {\cyrillicT} -\defineactivetoken 147 {\cyrillicU} -\defineactivetoken 148 {\cyrillicF} -\defineactivetoken 149 {\cyrillicH} -\defineactivetoken 150 {\cyrillicC} -\defineactivetoken 151 {\cyrillicCH} -\defineactivetoken 152 {\cyrillicSH} -\defineactivetoken 153 {\cyrillicSHCH} -\defineactivetoken 154 {\cyrillicHRDSN} -\defineactivetoken 155 {\cyrillicERY} -\defineactivetoken 156 {\cyrillicSFTSN} -\defineactivetoken 157 {\cyrillicEREV} -\defineactivetoken 158 {\cyrillicYU} -\defineactivetoken 159 {\cyrillicYA} -\defineactivetoken 160 {\cyrillica} -\defineactivetoken 161 {\cyrillicb} -\defineactivetoken 162 {\cyrillicv} -\defineactivetoken 163 {\cyrillicg} -\defineactivetoken 164 {\cyrillicd} -\defineactivetoken 165 {\cyrillice} -\defineactivetoken 166 {\cyrilliczh} -\defineactivetoken 167 {\cyrillicz} -\defineactivetoken 168 {\cyrillici} -\defineactivetoken 169 {\cyrillicishrt} -\defineactivetoken 170 {\cyrillick} -\defineactivetoken 171 {\cyrillicl} -\defineactivetoken 172 {\cyrillicm} -\defineactivetoken 173 {\cyrillicn} -\defineactivetoken 174 {\cyrillico} -\defineactivetoken 175 {\cyrillicp} -\defineactivetoken 224 {\cyrillicr} -\defineactivetoken 225 {\cyrillics} -\defineactivetoken 226 {\cyrillict} -\defineactivetoken 227 {\cyrillicu} -\defineactivetoken 228 {\cyrillicf} -\defineactivetoken 229 {\cyrillich} -\defineactivetoken 230 {\cyrillicc} -\defineactivetoken 231 {\cyrillicch} -\defineactivetoken 232 {\cyrillicsh} -\defineactivetoken 233 {\cyrillicshch} -\defineactivetoken 234 {\cyrillichrdsn} -\defineactivetoken 235 {\cyrillicery} -\defineactivetoken 236 {\cyrillicsftsn} -\defineactivetoken 237 {\cyrillicerev} -\defineactivetoken 238 {\cyrillicyu} -\defineactivetoken 239 {\cyrillicya} -\defineactivetoken 240 {\cyrillicYO} -\defineactivetoken 241 {\cyrillicyo} -\defineactivetoken 242 {\cyrillicSCHWA} -\defineactivetoken 243 {\cyrillicschwa} -\defineactivetoken 244 {\cyrillicOTLD} -\defineactivetoken 245 {\cyrillicotld} -\defineactivetoken 246 {\cyrillicY} -\defineactivetoken 247 {\cyrillicy} -\defineactivetoken 248 {\cyrillicZHDSC} -\defineactivetoken 249 {\cyrilliczhdsc} -\defineactivetoken 250 {\cyrillicNDSC} -\defineactivetoken 251 {\cyrillicndsc} -\defineactivetoken 252 {\cyrillicSHHA} -\defineactivetoken 253 {\cyrillicshha} -\defineactivetoken 254 {\textblacksquare} -\defineactivetoken 255 {\nonbreakablespace} - -\stopregime - -\startregime[ctt] - -\defineactivetoken 171 {\leftguillemot} -\defineactivetoken 187 {\rightguillemot} -\defineactivetoken 192 {\cyrillicA} -\defineactivetoken 193 {\cyrillicB} -\defineactivetoken 194 {\cyrillicV} -\defineactivetoken 195 {\cyrillicG} -\defineactivetoken 196 {\cyrillicD} -\defineactivetoken 197 {\cyrillicE} -\defineactivetoken 168 {\cyrillicYO} -\defineactivetoken 198 {\cyrillicZH} -\defineactivetoken 199 {\cyrillicZ} -\defineactivetoken 200 {\cyrillicI} -\defineactivetoken 201 {\cyrillicISHRT} -\defineactivetoken 202 {\cyrillicK} -\defineactivetoken 203 {\cyrillicL} -\defineactivetoken 204 {\cyrillicM} -\defineactivetoken 205 {\cyrillicN} -\defineactivetoken 206 {\cyrillicO} -\defineactivetoken 170 {\cyrillicOTLD} -\defineactivetoken 207 {\cyrillicP} -\defineactivetoken 208 {\cyrillicR} -\defineactivetoken 209 {\cyrillicS} -\defineactivetoken 210 {\cyrillicT} -\defineactivetoken 211 {\cyrillicU} -\defineactivetoken 175 {\cyrillicY} -\defineactivetoken 212 {\cyrillicF} -\defineactivetoken 213 {\cyrillicH} -\defineactivetoken 214 {\cyrillicC} -\defineactivetoken 215 {\cyrillicCH} -\defineactivetoken 216 {\cyrillicSH} -\defineactivetoken 217 {\cyrillicSHCH} -\defineactivetoken 218 {\cyrillicHRDSN} -\defineactivetoken 219 {\cyrillicERY} -\defineactivetoken 220 {\cyrillicSFTSN} -\defineactivetoken 221 {\cyrillicEREV} -\defineactivetoken 222 {\cyrillicYU} -\defineactivetoken 223 {\cyrillicYA} -\defineactivetoken 224 {\cyrillica} -\defineactivetoken 225 {\cyrillicb} -\defineactivetoken 226 {\cyrillicv} -\defineactivetoken 227 {\cyrillicg} -\defineactivetoken 228 {\cyrillicd} -\defineactivetoken 229 {\cyrillice} -\defineactivetoken 184 {\cyrillicyo} -\defineactivetoken 230 {\cyrilliczh} -\defineactivetoken 231 {\cyrillicz} -\defineactivetoken 232 {\cyrillici} -\defineactivetoken 233 {\cyrillicishrt} -\defineactivetoken 234 {\cyrillick} -\defineactivetoken 235 {\cyrillicl} -\defineactivetoken 236 {\cyrillicm} -\defineactivetoken 237 {\cyrillicn} -\defineactivetoken 238 {\cyrillico} -\defineactivetoken 186 {\cyrillicotld} -\defineactivetoken 239 {\cyrillicp} -\defineactivetoken 240 {\cyrillicr} -\defineactivetoken 241 {\cyrillics} -\defineactivetoken 242 {\cyrillict} -\defineactivetoken 243 {\cyrillicu} -\defineactivetoken 191 {\cyrillicy} -\defineactivetoken 244 {\cyrillicf} -\defineactivetoken 245 {\cyrillich} -\defineactivetoken 246 {\cyrillicc} -\defineactivetoken 247 {\cyrillicch} -\defineactivetoken 248 {\cyrillicsh} -\defineactivetoken 249 {\cyrillicshch} -\defineactivetoken 250 {\cyrillichrdsn} -\defineactivetoken 251 {\cyrillicery} -\defineactivetoken 252 {\cyrillicsftsn} -\defineactivetoken 253 {\cyrillicerev} -\defineactivetoken 254 {\cyrillicyu} -\defineactivetoken 255 {\cyrillicya} - -\stopregime - -\startregime[dbk] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicYO} -\defineactivetoken 135 {\cyrillicZH} -\defineactivetoken 136 {\cyrillicZ} -\defineactivetoken 137 {\cyrillicI} -\defineactivetoken 139 {\cyrillicISHRT} -\defineactivetoken 140 {\cyrillicK} -\defineactivetoken 142 {\cyrillicL} -\defineactivetoken 143 {\cyrillicM} -\defineactivetoken 144 {\cyrillicN} -\defineactivetoken 145 {\cyrillicO} -\defineactivetoken 146 {\cyrillicOTLD} -\defineactivetoken 147 {\cyrillicP} -\defineactivetoken 148 {\cyrillicR} -\defineactivetoken 149 {\cyrillicS} -\defineactivetoken 150 {\cyrillicT} -\defineactivetoken 151 {\cyrillicU} -\defineactivetoken 152 {\cyrillicY} -\defineactivetoken 153 {\cyrillicF} -\defineactivetoken 154 {\cyrillicH} -\defineactivetoken 155 {\cyrillicC} -\defineactivetoken 156 {\cyrillicCH} -\defineactivetoken 157 {\cyrillicSH} -\defineactivetoken 158 {\cyrillicSHCH} -\defineactivetoken 159 {\cyrillicHRDSN} -\defineactivetoken 160 {\cyrillicERY} -\defineactivetoken 161 {\cyrillicSFTSN} -\defineactivetoken 162 {\cyrillicEREV} -\defineactivetoken 163 {\cyrillicYU} -\defineactivetoken 164 {\cyrillicYA} -\defineactivetoken 165 {\cyrillica} -\defineactivetoken 166 {\cyrillicb} -\defineactivetoken 167 {\cyrillicv} -\defineactivetoken 168 {\cyrillicg} -\defineactivetoken 169 {\cyrillicd} -\defineactivetoken 170 {\cyrillice} -\defineactivetoken 171 {\cyrillicyo} -\defineactivetoken 172 {\cyrilliczh} -\defineactivetoken 173 {\cyrillicz} -\defineactivetoken 174 {\cyrillici} -\defineactivetoken 175 {\cyrillicishrt} -\defineactivetoken 225 {\cyrillick} -\defineactivetoken 226 {\cyrillicl} -\defineactivetoken 227 {\cyrillicm} -\defineactivetoken 228 {\cyrillicn} -\defineactivetoken 229 {\cyrillico} -\defineactivetoken 230 {\cyrillicotld} -\defineactivetoken 231 {\cyrillicp} -\defineactivetoken 232 {\cyrillicr} -\defineactivetoken 233 {\cyrillics} -\defineactivetoken 234 {\cyrillict} -\defineactivetoken 235 {\cyrillicu} -\defineactivetoken 236 {\cyrillicy} -\defineactivetoken 237 {\cyrillicf} -\defineactivetoken 238 {\cyrillich} -\defineactivetoken 239 {\cyrillicc} -\defineactivetoken 241 {\cyrillicch} -\defineactivetoken 242 {\cyrillicsh} -\defineactivetoken 243 {\cyrillicshch} -\defineactivetoken 244 {\cyrillichrdsn} -\defineactivetoken 245 {\cyrillicery} -\defineactivetoken 246 {\cyrillicsftsn} -\defineactivetoken 247 {\cyrillicerev} -\defineactivetoken 248 {\cyrillicyu} -\defineactivetoken 249 {\cyrillicya} - -\stopregime - -\startregime[iso88595] - -\defineactivetoken 160 {\nonbreakablespace} -\defineactivetoken 161 {\cyrillicYO} -\defineactivetoken 162 {\cyrillicDJE} -\defineactivetoken 163 {\'\cyrillicG} -\defineactivetoken 164 {\cyrillicIE} -\defineactivetoken 165 {\cyrillicDZE} -\defineactivetoken 166 {\cyrillicII} -\defineactivetoken 167 {\cyrillicYI} -\defineactivetoken 168 {\cyrillicJE} -\defineactivetoken 169 {\cyrillicLJE} -\defineactivetoken 170 {\cyrillicNJE} -\defineactivetoken 171 {\cyrillicTSHE} -\defineactivetoken 172 {\'\cyrillicK} -\defineactivetoken 173 {\-} -\defineactivetoken 174 {\cyrillicUSHRT} -\defineactivetoken 175 {\cyrillicDZHE} -\defineactivetoken 176 {\cyrillicA} -\defineactivetoken 177 {\cyrillicB} -\defineactivetoken 178 {\cyrillicV} -\defineactivetoken 179 {\cyrillicG} -\defineactivetoken 180 {\cyrillicD} -\defineactivetoken 181 {\cyrillicE} -\defineactivetoken 182 {\cyrillicZH} -\defineactivetoken 183 {\cyrillicZ} -\defineactivetoken 184 {\cyrillicI} -\defineactivetoken 185 {\cyrillicISHRT} -\defineactivetoken 186 {\cyrillicK} -\defineactivetoken 187 {\cyrillicL} -\defineactivetoken 188 {\cyrillicM} -\defineactivetoken 189 {\cyrillicN} -\defineactivetoken 190 {\cyrillicO} -\defineactivetoken 191 {\cyrillicP} -\defineactivetoken 192 {\cyrillicR} -\defineactivetoken 193 {\cyrillicS} -\defineactivetoken 194 {\cyrillicT} -\defineactivetoken 195 {\cyrillicU} -\defineactivetoken 196 {\cyrillicF} -\defineactivetoken 197 {\cyrillicH} -\defineactivetoken 198 {\cyrillicC} -\defineactivetoken 199 {\cyrillicCH} -\defineactivetoken 200 {\cyrillicSH} -\defineactivetoken 201 {\cyrillicSHCH} -\defineactivetoken 202 {\cyrillicHRDSN} -\defineactivetoken 203 {\cyrillicERY} -\defineactivetoken 204 {\cyrillicSFTSN} -\defineactivetoken 205 {\cyrillicEREV} -\defineactivetoken 206 {\cyrillicYU} -\defineactivetoken 207 {\cyrillicYA} -\defineactivetoken 208 {\cyrillica} -\defineactivetoken 209 {\cyrillicb} -\defineactivetoken 210 {\cyrillicv} -\defineactivetoken 211 {\cyrillicg} -\defineactivetoken 212 {\cyrillicd} -\defineactivetoken 213 {\cyrillice} -\defineactivetoken 214 {\cyrilliczh} -\defineactivetoken 215 {\cyrillicz} -\defineactivetoken 216 {\cyrillici} -\defineactivetoken 217 {\cyrillicishrt} -\defineactivetoken 218 {\cyrillick} -\defineactivetoken 219 {\cyrillicl} -\defineactivetoken 220 {\cyrillicm} -\defineactivetoken 221 {\cyrillicn} -\defineactivetoken 222 {\cyrillico} -\defineactivetoken 223 {\cyrillicp} -\defineactivetoken 224 {\cyrillicr} -\defineactivetoken 225 {\cyrillics} -\defineactivetoken 226 {\cyrillict} -\defineactivetoken 227 {\cyrillicu} -\defineactivetoken 228 {\cyrillicf} -\defineactivetoken 229 {\cyrillich} -\defineactivetoken 230 {\cyrillicc} -\defineactivetoken 231 {\cyrillicch} -\defineactivetoken 232 {\cyrillicsh} -\defineactivetoken 233 {\cyrillicshch} -\defineactivetoken 234 {\cyrillichrdsn} -\defineactivetoken 235 {\cyrillicery} -\defineactivetoken 236 {\cyrillicsftsn} -\defineactivetoken 237 {\cyrillicerev} -\defineactivetoken 238 {\cyrillicyu} -\defineactivetoken 239 {\cyrillicya} -\defineactivetoken 240 {\textnumero} -\defineactivetoken 241 {\cyrillicyo} -\defineactivetoken 242 {\cyrillicdje} -\defineactivetoken 243 {\'\cyrillicg} -\defineactivetoken 244 {\cyrillicie} -\defineactivetoken 245 {\cyrillicdze} -\defineactivetoken 246 {\cyrillicii} -\defineactivetoken 247 {\cyrillicyi} -\defineactivetoken 248 {\cyrillicje} -\defineactivetoken 249 {\cyrilliclje} -\defineactivetoken 250 {\cyrillicnje} -\defineactivetoken 251 {\cyrillictshe} -\defineactivetoken 252 {\'\cyrillick} -\defineactivetoken 253 {\sectionmark} -\defineactivetoken 254 {\cyrillicushrt} -\defineactivetoken 255 {\cyrillicdzhe} - -\stopregime - -\startregime[isoir111] - -\defineactivetoken 225 {\cyrillicA} -\defineactivetoken 226 {\cyrillicB} -\defineactivetoken 247 {\cyrillicV} -\defineactivetoken 231 {\cyrillicG} -\defineactivetoken 228 {\cyrillicD} -\defineactivetoken 229 {\cyrillicE} -\defineactivetoken 179 {\cyrillicYO} -\defineactivetoken 246 {\cyrillicZH} -\defineactivetoken 250 {\cyrillicZ} -\defineactivetoken 233 {\cyrillicI} -\defineactivetoken 234 {\cyrillicISHRT} -\defineactivetoken 235 {\cyrillicK} -\defineactivetoken 236 {\cyrillicL} -\defineactivetoken 237 {\cyrillicM} -\defineactivetoken 238 {\cyrillicN} -\defineactivetoken 239 {\cyrillicO} -\defineactivetoken 240 {\cyrillicP} -\defineactivetoken 242 {\cyrillicR} -\defineactivetoken 243 {\cyrillicS} -\defineactivetoken 244 {\cyrillicT} -\defineactivetoken 245 {\cyrillicU} -\defineactivetoken 230 {\cyrillicF} -\defineactivetoken 232 {\cyrillicH} -\defineactivetoken 227 {\cyrillicC} -\defineactivetoken 254 {\cyrillicCH} -\defineactivetoken 251 {\cyrillicSH} -\defineactivetoken 253 {\cyrillicSHCH} -\defineactivetoken 255 {\cyrillicHRDSN} -\defineactivetoken 249 {\cyrillicERY} -\defineactivetoken 248 {\cyrillicSFTSN} -\defineactivetoken 252 {\cyrillicEREV} -\defineactivetoken 224 {\cyrillicYU} -\defineactivetoken 241 {\cyrillicYA} -\defineactivetoken 193 {\cyrillica} -\defineactivetoken 194 {\cyrillicb} -\defineactivetoken 215 {\cyrillicv} -\defineactivetoken 199 {\cyrillicg} -\defineactivetoken 196 {\cyrillicd} -\defineactivetoken 197 {\cyrillice} -\defineactivetoken 163 {\cyrillicyo} -\defineactivetoken 214 {\cyrilliczh} -\defineactivetoken 218 {\cyrillicz} -\defineactivetoken 201 {\cyrillici} -\defineactivetoken 202 {\cyrillicishrt} -\defineactivetoken 203 {\cyrillick} -\defineactivetoken 204 {\cyrillicl} -\defineactivetoken 205 {\cyrillicm} -\defineactivetoken 206 {\cyrillicn} -\defineactivetoken 207 {\cyrillico} -\defineactivetoken 208 {\cyrillicp} -\defineactivetoken 210 {\cyrillicr} -\defineactivetoken 211 {\cyrillics} -\defineactivetoken 212 {\cyrillict} -\defineactivetoken 213 {\cyrillicu} -\defineactivetoken 198 {\cyrillicf} -\defineactivetoken 200 {\cyrillich} -\defineactivetoken 195 {\cyrillicc} -\defineactivetoken 222 {\cyrillicch} -\defineactivetoken 219 {\cyrillicsh} -\defineactivetoken 221 {\cyrillicshch} -\defineactivetoken 223 {\cyrillichrdsn} -\defineactivetoken 217 {\cyrillicery} -\defineactivetoken 216 {\cyrillicsftsn} -\defineactivetoken 220 {\cyrillicerev} -\defineactivetoken 192 {\cyrillicyu} -\defineactivetoken 209 {\cyrillicya} -\defineactivetoken 160 {\nonbreakablespace} -\defineactivetoken 161 {\cyrillicdje} -\defineactivetoken 162 {\'\cyrillicg} -\defineactivetoken 164 {\cyrillicie} -\defineactivetoken 165 {\cyrillicdze} -\defineactivetoken 166 {\cyrillicii} -\defineactivetoken 167 {\cyrillicyi} -\defineactivetoken 168 {\cyrillicje} -\defineactivetoken 169 {\cyrilliclje} -\defineactivetoken 170 {\cyrillicnje} -\defineactivetoken 171 {\cyrillictshe} -\defineactivetoken 172 {\'\cyrillick} -\defineactivetoken 173 {\-} -\defineactivetoken 174 {\cyrillicushrt} -\defineactivetoken 175 {\cyrillicdzhe} -\defineactivetoken 176 {\textnumero} -\defineactivetoken 177 {\cyrillicDJE} -\defineactivetoken 178 {\'\cyrillicG} -\defineactivetoken 180 {\cyrillicIE} -\defineactivetoken 181 {\cyrillicDZE} -\defineactivetoken 182 {\cyrillicII} -\defineactivetoken 183 {\cyrillicYI} -\defineactivetoken 184 {\cyrillicJE} -\defineactivetoken 185 {\cyrillicLJE} -\defineactivetoken 186 {\cyrillicNJE} -\defineactivetoken 187 {\cyrillicTSHE} -\defineactivetoken 188 {\'\cyrillicK} -\defineactivetoken 189 {\textcurrency} -\defineactivetoken 190 {\cyrillicUSHRT} -\defineactivetoken 191 {\cyrillicDZHE} - -\stopregime - -\startregime[mik] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicZH} -\defineactivetoken 135 {\cyrillicZ} -\defineactivetoken 136 {\cyrillicI} -\defineactivetoken 137 {\cyrillicISHRT} -\defineactivetoken 138 {\cyrillicK} -\defineactivetoken 139 {\cyrillicL} -\defineactivetoken 140 {\cyrillicM} -\defineactivetoken 141 {\cyrillicN} -\defineactivetoken 142 {\cyrillicO} -\defineactivetoken 143 {\cyrillicP} -\defineactivetoken 144 {\cyrillicR} -\defineactivetoken 145 {\cyrillicS} -\defineactivetoken 146 {\cyrillicT} -\defineactivetoken 147 {\cyrillicU} -\defineactivetoken 148 {\cyrillicF} -\defineactivetoken 149 {\cyrillicH} -\defineactivetoken 150 {\cyrillicC} -\defineactivetoken 151 {\cyrillicCH} -\defineactivetoken 152 {\cyrillicSH} -\defineactivetoken 153 {\cyrillicSHCH} -\defineactivetoken 154 {\cyrillicHRDSN} -\defineactivetoken 155 {\cyrillicERY} -\defineactivetoken 156 {\cyrillicSFTSN} -\defineactivetoken 157 {\cyrillicEREV} -\defineactivetoken 158 {\cyrillicYU} -\defineactivetoken 159 {\cyrillicYA} -\defineactivetoken 160 {\cyrillica} -\defineactivetoken 161 {\cyrillicb} -\defineactivetoken 162 {\cyrillicv} -\defineactivetoken 163 {\cyrillicg} -\defineactivetoken 164 {\cyrillicd} -\defineactivetoken 165 {\cyrillice} -\defineactivetoken 166 {\cyrilliczh} -\defineactivetoken 167 {\cyrillicz} -\defineactivetoken 168 {\cyrillici} -\defineactivetoken 169 {\cyrillicishrt} -\defineactivetoken 170 {\cyrillick} -\defineactivetoken 171 {\cyrillicl} -\defineactivetoken 172 {\cyrillicm} -\defineactivetoken 173 {\cyrillicn} -\defineactivetoken 174 {\cyrillico} -\defineactivetoken 175 {\cyrillicp} -\defineactivetoken 176 {\cyrillicr} -\defineactivetoken 177 {\cyrillics} -\defineactivetoken 178 {\cyrillict} -\defineactivetoken 179 {\cyrillicu} -\defineactivetoken 180 {\cyrillicf} -\defineactivetoken 181 {\cyrillich} -\defineactivetoken 182 {\cyrillicc} -\defineactivetoken 183 {\cyrillicch} -\defineactivetoken 184 {\cyrillicsh} -\defineactivetoken 185 {\cyrillicshch} -\defineactivetoken 186 {\cyrillichrdsn} -\defineactivetoken 187 {\cyrillicery} -\defineactivetoken 188 {\cyrillicsftsn} -\defineactivetoken 189 {\cyrillicerev} -\defineactivetoken 190 {\cyrillicyu} -\defineactivetoken 191 {\cyrillicya} -\defineactivetoken 213 {\textnumero} -\defineactivetoken 214 {\sectionmark} -\defineactivetoken 248 {\textdegree} -\defineactivetoken 249 {\textbullet} -\defineactivetoken 250 {\periodcentered} -\defineactivetoken 254 {\textblacksquare} -\defineactivetoken 255 {\nonbreakablespace} -\defineactivetoken 224 {\mathematics\alpha} -\defineactivetoken 225 {\mathematics\beta} -\defineactivetoken 226 {\mathematics\Gamma} -\defineactivetoken 227 {\mathematics\pi} -\defineactivetoken 228 {\mathematics\Sigma} -\defineactivetoken 229 {\mathematics\sigma} -\defineactivetoken 230 {\textmu} -\defineactivetoken 231 {\mathematics\tau} -\defineactivetoken 232 {\mathematics\Phi} -\defineactivetoken 233 {\mathematics\Theta} -\defineactivetoken 234 {\mathematics\Omega} -\defineactivetoken 235 {\mathematics\delta} -\defineactivetoken 236 {\mathematics\infty} -\defineactivetoken 237 {\mathematics\emptyset} -\defineactivetoken 238 {\mathematics\in} -\defineactivetoken 239 {\mathematics\cap} -\defineactivetoken 240 {\mathematics\equiv} -\defineactivetoken 241 {\textpm} -\defineactivetoken 242 {\mathematics\geq} -\defineactivetoken 243 {\mathematics\leq} -\defineactivetoken 246 {\textdiv} -\defineactivetoken 247 {\mathematics\sim} -\defineactivetoken 251 {\textsurd} -\defineactivetoken 252 {\high{\txx n}} -\defineactivetoken 253 {\twosuperior} - -\stopregime - -\startregime[mls] - -% The symbols 194 to 253 are defined in Mongolian fonts in -% the Mon\TeX\ package (?) - -\defineactivetoken 128 {\cyrillicB} -\defineactivetoken 129 {\cyrillicy} -\defineactivetoken 130 {\cyrillicD} -\defineactivetoken 131 {\cyrillicYO} -\defineactivetoken 132 {\cyrillicerev} -\defineactivetoken 133 {\cyrillicZH} -\defineactivetoken 134 {\cyrillicZ} -\defineactivetoken 135 {\cyrillicI} -\defineactivetoken 136 {\cyrillicISHRT} -\defineactivetoken 137 {\cyrillicyo} -\defineactivetoken 138 {\cyrillicL} -\defineactivetoken 139 {\cyrillicishrt} -\defineactivetoken 140 {\cyrillicOTLD} -\defineactivetoken 141 {\cyrillicP} -\defineactivetoken 142 {\cyrillicEREV} -\defineactivetoken 143 {\cyrillicU} -\defineactivetoken 144 {\cyrillicF} -\defineactivetoken 145 {\cyrillicC} -\defineactivetoken 146 {\cyrillicCH} -\defineactivetoken 147 {\cyrillicSH} -\defineactivetoken 148 {\cyrillicotld} -\defineactivetoken 149 {\cyrillicSHCH} -\defineactivetoken 150 {\cyrillicHRDSN} -\defineactivetoken 151 {\cyrillicERY} -\defineactivetoken 152 {\cyrillicSFTSN} -\defineactivetoken 153 {\cyrillicOTLD} -\defineactivetoken 154 {\cyrillicY} -\defineactivetoken 155 {\cyrillicEREV} -\defineactivetoken 156 {\cyrillicYU} -\defineactivetoken 157 {\cyrillicYA} -\defineactivetoken 158 {\cyrillicb} -\defineactivetoken 159 {\cyrillicv} -\defineactivetoken 160 {\cyrillicg} -\defineactivetoken 161 {\cyrillicd} -\defineactivetoken 162 {\cyrilliczh} -\defineactivetoken 163 {\cyrillicz} -\defineactivetoken 164 {\cyrillici} -\defineactivetoken 165 {\cyrillicishrt} -\defineactivetoken 166 {\cyrillick} -\defineactivetoken 167 {\cyrillicl} -\defineactivetoken 168 {\cyrillicm} -\defineactivetoken 169 {\cyrillicn} -\defineactivetoken 170 {\cyrillicotld} -\defineactivetoken 171 {\cyrillicp} -\defineactivetoken 172 {\cyrillict} -\defineactivetoken 173 {\cyrillicy} -\defineactivetoken 174 {\leftguillemot} -\defineactivetoken 175 {\rightguillemot} -\defineactivetoken 176 {\cyrillicf} -\defineactivetoken 177 {\cyrillicc} -\defineactivetoken 178 {\cyrillicch} -\defineactivetoken 180 {\cyrillicsh} -\defineactivetoken 181 {\cyrillicshch} -\defineactivetoken 182 {\cyrillichrdsn} -\defineactivetoken 183 {\cyrillicery} -\defineactivetoken 184 {\cyrillicsftsn} -\defineactivetoken 189 {\cyrillicerev} -\defineactivetoken 190 {\cyrillicyu} -\defineactivetoken 193 {\cyrillicya} -\defineactivetoken 226 {\cyrillicG} -\defineactivetoken 225 {\ss} -\defineactivetoken 231 {\mathematics{\gamma}} -\defineactivetoken 255 {\nonbreakablespace} -\defineactivetoken 194 {\titem} -\defineactivetoken 195 {\shud} -\defineactivetoken 197 {\secondaryshud} -\defineactivetoken 198 {\shilbe} -\defineactivetoken 199 {\gedes} -\defineactivetoken 207 {\secondarygedes} -\defineactivetoken 208 {\cegteishud} -\defineactivetoken 209 {\lewer} -\defineactivetoken 210 {\suuliinlewer} -\defineactivetoken 211 {\tertiarylewer} -\defineactivetoken 212 {\mewer} -\defineactivetoken 213 {\suuliinmewer} -\defineactivetoken 214 {\xewteeqix} -\defineactivetoken 215 {\dawxarcegtxewteeqix} -\defineactivetoken 216 {\halfnum} -\defineactivetoken 219 {\num} -\defineactivetoken 220 {\halfnumtgedes} -\defineactivetoken 221 {\numtaigedes} -\defineactivetoken 222 {\buruuxarsangedes} -\defineactivetoken 223 {\gedesteishilbe} -\defineactivetoken 224 {\erweeljinshilbe} -\defineactivetoken 227 {\secerweeljin} -\defineactivetoken 228 {\bosooshilbe} -\defineactivetoken 229 {\etgershilbe} -\defineactivetoken 230 {\zawj} -\defineactivetoken 232 {\suuliinzawj} -\defineactivetoken 233 {\dawxarcegtzawj} -\defineactivetoken 234 {\sereeewer} -\defineactivetoken 235 {\matgarshilbe} -\defineactivetoken 236 {\bituushilbe} -\defineactivetoken 237 {\secondaryqagt} -\defineactivetoken 238 {\qagt} -\defineactivetoken 239 {\secnumtdelbenqix} -\defineactivetoken 240 {\numtdelbenqix} -\defineactivetoken 241 {\secsertenqixtnum} -\defineactivetoken 242 {\sertenqixtnum} -\defineactivetoken 243 {\zadgaizardigt} -\defineactivetoken 244 {\bituuzardigt} -\defineactivetoken 245 {\malgaitaititem} -\defineactivetoken 246 {\suul} -\defineactivetoken 247 {\orxic} -\defineactivetoken 248 {\biodoisuul} -\defineactivetoken 249 {\bagodoisuul} -\defineactivetoken 250 {\nceg} -\defineactivetoken 251 {\gceg} -\defineactivetoken 252 {\ceg} -\defineactivetoken 253 {\dorwoljin} - -\stopregime - -\startregime[mnk] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicYO} -\defineactivetoken 135 {\cyrillicZH} -\defineactivetoken 136 {\cyrillicZ} -\defineactivetoken 137 {\cyrillicI} -\defineactivetoken 138 {\cyrillicISHRT} -\defineactivetoken 139 {\cyrillicK} -\defineactivetoken 140 {\cyrillicL} -\defineactivetoken 141 {\cyrillicM} -\defineactivetoken 142 {\cyrillicN} -\defineactivetoken 143 {\cyrillicO} -\defineactivetoken 144 {\cyrillicOTLD} -\defineactivetoken 145 {\cyrillicP} -\defineactivetoken 146 {\cyrillicR} -\defineactivetoken 147 {\cyrillicS} -\defineactivetoken 148 {\cyrillicT} -\defineactivetoken 149 {\cyrillicU} -\defineactivetoken 150 {\cyrillicY} -\defineactivetoken 151 {\cyrillicF} -\defineactivetoken 152 {\cyrillicH} -\defineactivetoken 153 {\cyrillicC} -\defineactivetoken 154 {\cyrillicCH} -\defineactivetoken 155 {\cyrillicSH} -\defineactivetoken 156 {\cyrillicSHCH} -\defineactivetoken 157 {\cyrillicHRDSN} -\defineactivetoken 158 {\cyrillicERY} -\defineactivetoken 159 {\cyrillicSFTSN} -\defineactivetoken 160 {\cyrillicEREV} -\defineactivetoken 161 {\cyrillicYU} -\defineactivetoken 162 {\cyrillicYA} -\defineactivetoken 163 {\cyrillica} -\defineactivetoken 164 {\cyrillicb} -\defineactivetoken 165 {\cyrillicv} -\defineactivetoken 166 {\cyrillicg} -\defineactivetoken 167 {\cyrillicd} -\defineactivetoken 168 {\cyrillice} -\defineactivetoken 169 {\cyrillicyo} -\defineactivetoken 170 {\cyrilliczh} -\defineactivetoken 173 {\cyrillicz} -\defineactivetoken 224 {\cyrillici} -\defineactivetoken 225 {\cyrillicishrt} -\defineactivetoken 226 {\cyrillick} -\defineactivetoken 227 {\cyrillicl} -\defineactivetoken 228 {\cyrillicm} -\defineactivetoken 229 {\cyrillicn} -\defineactivetoken 230 {\cyrillico} -\defineactivetoken 231 {\cyrillicotld} -\defineactivetoken 232 {\cyrillicp} -\defineactivetoken 233 {\cyrillicr} -\defineactivetoken 234 {\cyrillics} -\defineactivetoken 235 {\cyrillict} -\defineactivetoken 236 {\cyrillicu} -\defineactivetoken 237 {\cyrillicy} -\defineactivetoken 238 {\cyrillicf} -\defineactivetoken 239 {\cyrillich} -\defineactivetoken 240 {\cyrillicc} -\defineactivetoken 241 {\cyrillicch} -\defineactivetoken 242 {\cyrillicsh} -\defineactivetoken 243 {\cyrillicshch} -\defineactivetoken 244 {\cyrillichrdsn} -\defineactivetoken 245 {\cyrillicery} -\defineactivetoken 248 {\cyrillicsftsn} -\defineactivetoken 252 {\cyrillicerev} -\defineactivetoken 253 {\cyrillicyu} -\defineactivetoken 254 {\cyrillicya} - -\stopregime - -\startregime[mos] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 160 {\cyrillicYO} -\defineactivetoken 134 {\cyrillicZH} -\defineactivetoken 135 {\cyrillicZ} -\defineactivetoken 136 {\cyrillicI} -\defineactivetoken 137 {\cyrillicISHRT} -\defineactivetoken 138 {\cyrillicK} -\defineactivetoken 139 {\cyrillicL} -\defineactivetoken 140 {\cyrillicM} -\defineactivetoken 141 {\cyrillicN} -\defineactivetoken 142 {\cyrillicO} -\defineactivetoken 153 {\cyrillicOTLD} -\defineactivetoken 143 {\cyrillicP} -\defineactivetoken 144 {\cyrillicR} -\defineactivetoken 145 {\cyrillicS} -\defineactivetoken 146 {\cyrillicT} -\defineactivetoken 147 {\cyrillicU} -\defineactivetoken 154 {\cyrillicY} -\defineactivetoken 148 {\cyrillicF} -\defineactivetoken 149 {\cyrillicH} -\defineactivetoken 150 {\cyrillicC} -\defineactivetoken 151 {\cyrillicCH} -\defineactivetoken 152 {\cyrillicSH} -\defineactivetoken 164 {\cyrillicSHCH} -\defineactivetoken 162 {\cyrillicHRDSN} -\defineactivetoken 155 {\cyrillicERY} -\defineactivetoken 156 {\cyrillicSFTSN} -\defineactivetoken 157 {\cyrillicEREV} -\defineactivetoken 158 {\cyrillicYU} -\defineactivetoken 159 {\cyrillicYA} -\defineactivetoken 224 {\cyrillica} -\defineactivetoken 225 {\cyrillicb} -\defineactivetoken 226 {\cyrillicv} -\defineactivetoken 227 {\cyrillicg} -\defineactivetoken 228 {\cyrillicd} -\defineactivetoken 229 {\cyrillice} -\defineactivetoken 161 {\cyrillicyo} -\defineactivetoken 230 {\cyrilliczh} -\defineactivetoken 231 {\cyrillicz} -\defineactivetoken 232 {\cyrillici} -\defineactivetoken 233 {\cyrillicishrt} -\defineactivetoken 234 {\cyrillick} -\defineactivetoken 235 {\cyrillicl} -\defineactivetoken 236 {\cyrillicm} -\defineactivetoken 237 {\cyrillicn} -\defineactivetoken 238 {\cyrillico} -\defineactivetoken 249 {\cyrillicotld} -\defineactivetoken 239 {\cyrillicp} -\defineactivetoken 240 {\cyrillicr} -\defineactivetoken 241 {\cyrillics} -\defineactivetoken 242 {\cyrillict} -\defineactivetoken 243 {\cyrillicu} -\defineactivetoken 250 {\cyrillicy} -\defineactivetoken 244 {\cyrillicf} -\defineactivetoken 245 {\cyrillich} -\defineactivetoken 246 {\cyrillicc} -\defineactivetoken 247 {\cyrillicch} -\defineactivetoken 248 {\cyrillicsh} -\defineactivetoken 165 {\cyrillicshch} -\defineactivetoken 163 {\cyrillichrdsn} -\defineactivetoken 251 {\cyrillicery} -\defineactivetoken 252 {\cyrillicsftsn} -\defineactivetoken 253 {\cyrillicerev} -\defineactivetoken 254 {\cyrillicyu} -\defineactivetoken 168 {\cyrillicya} - -\stopregime - -\startregime[ncc] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicYO} -\defineactivetoken 135 {\cyrillicZH} -\defineactivetoken 136 {\cyrillicZ} -\defineactivetoken 137 {\cyrillicI} -\defineactivetoken 139 {\cyrillicISHRT} -\defineactivetoken 140 {\cyrillicK} -\defineactivetoken 142 {\cyrillicL} -\defineactivetoken 143 {\cyrillicM} -\defineactivetoken 144 {\cyrillicN} -\defineactivetoken 145 {\cyrillicO} -\defineactivetoken 146 {\cyrillicOTLD} -\defineactivetoken 147 {\cyrillicP} -\defineactivetoken 148 {\cyrillicR} -\defineactivetoken 149 {\cyrillicS} -\defineactivetoken 150 {\cyrillicT} -\defineactivetoken 151 {\cyrillicU} -\defineactivetoken 152 {\cyrillicY} -\defineactivetoken 153 {\cyrillicF} -\defineactivetoken 154 {\cyrillicH} -\defineactivetoken 155 {\cyrillicC} -\defineactivetoken 156 {\cyrillicCH} -\defineactivetoken 157 {\cyrillicSH} -\defineactivetoken 158 {\cyrillicSHCH} -\defineactivetoken 159 {\cyrillicHRDSN} -\defineactivetoken 160 {\cyrillicERY} -\defineactivetoken 161 {\cyrillicSFTSN} -\defineactivetoken 162 {\cyrillicEREV} -\defineactivetoken 163 {\cyrillicYU} -\defineactivetoken 164 {\cyrillicYA} -\defineactivetoken 165 {\cyrillica} -\defineactivetoken 166 {\cyrillicb} -\defineactivetoken 167 {\cyrillicv} -\defineactivetoken 168 {\cyrillicg} -\defineactivetoken 169 {\cyrillicd} -\defineactivetoken 170 {\cyrillice} -\defineactivetoken 171 {\cyrillicyo} -\defineactivetoken 172 {\cyrilliczh} -\defineactivetoken 173 {\cyrillicz} -\defineactivetoken 225 {\cyrillici} -\defineactivetoken 226 {\cyrillicishrt} -\defineactivetoken 227 {\cyrillick} -\defineactivetoken 228 {\cyrillicl} -\defineactivetoken 229 {\cyrillicm} -\defineactivetoken 230 {\cyrillicn} -\defineactivetoken 231 {\cyrillico} -\defineactivetoken 232 {\cyrillicotld} -\defineactivetoken 233 {\cyrillicp} -\defineactivetoken 234 {\cyrillicr} -\defineactivetoken 235 {\cyrillics} -\defineactivetoken 236 {\cyrillict} -\defineactivetoken 237 {\cyrillicu} -\defineactivetoken 238 {\cyrillicy} -\defineactivetoken 239 {\cyrillicf} -\defineactivetoken 240 {\cyrillich} -\defineactivetoken 241 {\cyrillicc} -\defineactivetoken 242 {\cyrillicch} -\defineactivetoken 243 {\cyrillicsh} -\defineactivetoken 244 {\cyrillicshch} -\defineactivetoken 245 {\cyrillichrdsn} -\defineactivetoken 246 {\cyrillicery} -\defineactivetoken 247 {\cyrillicsftsn} -\defineactivetoken 248 {\cyrillicerev} -\defineactivetoken 249 {\cyrillicyu} -\defineactivetoken 251 {\cyrillicya} - -\stopregime - -\endinput diff --git a/tex/context/base/regi-cyr.mkii b/tex/context/base/regi-cyr.mkii new file mode 100644 index 000000000..1e84b9cba --- /dev/null +++ b/tex/context/base/regi-cyr.mkii @@ -0,0 +1,722 @@ +%D \module +%D [ file=regi-cyr, +%D version=2003.01.24, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Cyrillic, +%D author=..., +%D date=\currentdate, +%D copyright={PRAGMA / 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 Here are additional input regimes for cyrillic encodings others than cp1251 +%D and iso-8859-5: +%D +%D \startitemize +%D \item two variants of dos +%D \item three variants of koi-8 for *nix: russian, +%D ukrainian and mixed +%D \item two variants for the mac +%D \stopitemize +%D +%D Other, not so popular regimes, can be found in \type +%D {regi-cy2}. + +\startregime[cp866] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicZH} +\defineactivetoken 135 {\cyrillicZ} +\defineactivetoken 136 {\cyrillicI} +\defineactivetoken 137 {\cyrillicISHRT} +\defineactivetoken 138 {\cyrillicK} +\defineactivetoken 139 {\cyrillicL} +\defineactivetoken 140 {\cyrillicM} +\defineactivetoken 141 {\cyrillicN} +\defineactivetoken 142 {\cyrillicO} +\defineactivetoken 143 {\cyrillicP} +\defineactivetoken 144 {\cyrillicR} +\defineactivetoken 145 {\cyrillicS} +\defineactivetoken 146 {\cyrillicT} +\defineactivetoken 147 {\cyrillicU} +\defineactivetoken 148 {\cyrillicF} +\defineactivetoken 149 {\cyrillicH} +\defineactivetoken 150 {\cyrillicC} +\defineactivetoken 151 {\cyrillicCH} +\defineactivetoken 152 {\cyrillicSH} +\defineactivetoken 153 {\cyrillicSHCH} +\defineactivetoken 154 {\cyrillicHRDSN} +\defineactivetoken 155 {\cyrillicERY} +\defineactivetoken 156 {\cyrillicSFTSN} +\defineactivetoken 157 {\cyrillicEREV} +\defineactivetoken 158 {\cyrillicYU} +\defineactivetoken 159 {\cyrillicYA} +\defineactivetoken 160 {\cyrillica} +\defineactivetoken 161 {\cyrillicb} +\defineactivetoken 162 {\cyrillicv} +\defineactivetoken 163 {\cyrillicg} +\defineactivetoken 164 {\cyrillicd} +\defineactivetoken 165 {\cyrillice} +\defineactivetoken 166 {\cyrilliczh} +\defineactivetoken 167 {\cyrillicz} +\defineactivetoken 168 {\cyrillici} +\defineactivetoken 169 {\cyrillicishrt} +\defineactivetoken 170 {\cyrillick} +\defineactivetoken 171 {\cyrillicl} +\defineactivetoken 172 {\cyrillicm} +\defineactivetoken 173 {\cyrillicn} +\defineactivetoken 174 {\cyrillico} +\defineactivetoken 175 {\cyrillicp} +\defineactivetoken 224 {\cyrillicr} +\defineactivetoken 225 {\cyrillics} +\defineactivetoken 226 {\cyrillict} +\defineactivetoken 227 {\cyrillicu} +\defineactivetoken 228 {\cyrillicf} +\defineactivetoken 229 {\cyrillich} +\defineactivetoken 230 {\cyrillicc} +\defineactivetoken 231 {\cyrillicch} +\defineactivetoken 232 {\cyrillicsh} +\defineactivetoken 233 {\cyrillicshch} +\defineactivetoken 234 {\cyrillichrdsn} +\defineactivetoken 235 {\cyrillicery} +\defineactivetoken 236 {\cyrillicsftsn} +\defineactivetoken 237 {\cyrillicerev} +\defineactivetoken 238 {\cyrillicyu} +\defineactivetoken 239 {\cyrillicya} +\defineactivetoken 240 {\cyrillicYO} +\defineactivetoken 241 {\cyrillicyo} +\defineactivetoken 242 {\cyrillicIE} +\defineactivetoken 243 {\cyrillicie} +\defineactivetoken 244 {\cyrillicYI} +\defineactivetoken 245 {\cyrillicyi} +\defineactivetoken 246 {\cyrillicUSHRT} +\defineactivetoken 247 {\cyrillicushrt} +\defineactivetoken 248 {\textdegree} +\defineactivetoken 249 {\bullet} +\defineactivetoken 250 {\periodcentered} +\defineactivetoken 252 {\textnumero} +\defineactivetoken 253 {\textcurrency} +\defineactivetoken 254 {\textblacksquare} +\defineactivetoken 255 {\nonbreakablespace} +\defineactivetoken 251 {\textsurd} + +\stopregime + +\startregime[cp866nav] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicZH} +\defineactivetoken 135 {\cyrillicZ} +\defineactivetoken 136 {\cyrillicI} +\defineactivetoken 137 {\cyrillicISHRT} +\defineactivetoken 138 {\cyrillicK} +\defineactivetoken 139 {\cyrillicL} +\defineactivetoken 140 {\cyrillicM} +\defineactivetoken 141 {\cyrillicN} +\defineactivetoken 142 {\cyrillicO} +\defineactivetoken 143 {\cyrillicP} +\defineactivetoken 144 {\cyrillicR} +\defineactivetoken 145 {\cyrillicS} +\defineactivetoken 146 {\cyrillicT} +\defineactivetoken 147 {\cyrillicU} +\defineactivetoken 148 {\cyrillicF} +\defineactivetoken 149 {\cyrillicH} +\defineactivetoken 150 {\cyrillicC} +\defineactivetoken 151 {\cyrillicCH} +\defineactivetoken 152 {\cyrillicSH} +\defineactivetoken 153 {\cyrillicSHCH} +\defineactivetoken 154 {\cyrillicHRDSN} +\defineactivetoken 155 {\cyrillicERY} +\defineactivetoken 156 {\cyrillicSFTSN} +\defineactivetoken 157 {\cyrillicEREV} +\defineactivetoken 158 {\cyrillicYU} +\defineactivetoken 159 {\cyrillicYA} +\defineactivetoken 160 {\cyrillica} +\defineactivetoken 161 {\cyrillicb} +\defineactivetoken 162 {\cyrillicv} +\defineactivetoken 163 {\cyrillicg} +\defineactivetoken 164 {\cyrillicd} +\defineactivetoken 165 {\cyrillice} +\defineactivetoken 166 {\cyrilliczh} +\defineactivetoken 167 {\cyrillicz} +\defineactivetoken 168 {\cyrillici} +\defineactivetoken 169 {\cyrillicishrt} +\defineactivetoken 170 {\cyrillick} +\defineactivetoken 171 {\cyrillicl} +\defineactivetoken 172 {\cyrillicm} +\defineactivetoken 173 {\cyrillicn} +\defineactivetoken 174 {\cyrillico} +\defineactivetoken 175 {\cyrillicp} +\defineactivetoken 224 {\cyrillicr} +\defineactivetoken 225 {\cyrillics} +\defineactivetoken 226 {\cyrillict} +\defineactivetoken 227 {\cyrillicu} +\defineactivetoken 228 {\cyrillicf} +\defineactivetoken 229 {\cyrillich} +\defineactivetoken 230 {\cyrillicc} +\defineactivetoken 231 {\cyrillicch} +\defineactivetoken 232 {\cyrillicsh} +\defineactivetoken 233 {\cyrillicshch} +\defineactivetoken 234 {\cyrillichrdsn} +\defineactivetoken 235 {\cyrillicery} +\defineactivetoken 236 {\cyrillicsftsn} +\defineactivetoken 237 {\cyrillicerev} +\defineactivetoken 238 {\cyrillicyu} +\defineactivetoken 239 {\cyrillicya} +\defineactivetoken 240 {\cyrillicYO} +\defineactivetoken 241 {\cyrillicyo} +\defineactivetoken 242 {\cyrillicGUP} +\defineactivetoken 243 {\cyrillicgup} +\defineactivetoken 244 {\cyrillicIE} +\defineactivetoken 245 {\cyrillicie} +\defineactivetoken 246 {\cyrillicII} +\defineactivetoken 247 {\cyrillicii} +\defineactivetoken 248 {\cyrillicYI} +\defineactivetoken 249 {\cyrillicyi} +\defineactivetoken 250 {\cyrillicUSHRT} +\defineactivetoken 251 {\cyrillicushrt} +\defineactivetoken 252 {\textnumero} +\defineactivetoken 253 {\leftguillemot} +\defineactivetoken 254 {\rightguillemot} +\defineactivetoken 255 {\nonbreakablespace} + +\stopregime + +\startregime[koi8-r] + +\defineactivetoken 225 {\cyrillicA} +\defineactivetoken 226 {\cyrillicB} +\defineactivetoken 247 {\cyrillicV} +\defineactivetoken 231 {\cyrillicG} +\defineactivetoken 228 {\cyrillicD} +\defineactivetoken 229 {\cyrillicE} +\defineactivetoken 179 {\cyrillicYO} +\defineactivetoken 246 {\cyrillicZH} +\defineactivetoken 250 {\cyrillicZ} +\defineactivetoken 233 {\cyrillicI} +\defineactivetoken 234 {\cyrillicISHRT} +\defineactivetoken 235 {\cyrillicK} +\defineactivetoken 236 {\cyrillicL} +\defineactivetoken 237 {\cyrillicM} +\defineactivetoken 238 {\cyrillicN} +\defineactivetoken 239 {\cyrillicO} +\defineactivetoken 240 {\cyrillicP} +\defineactivetoken 242 {\cyrillicR} +\defineactivetoken 243 {\cyrillicS} +\defineactivetoken 244 {\cyrillicT} +\defineactivetoken 245 {\cyrillicU} +\defineactivetoken 230 {\cyrillicF} +\defineactivetoken 232 {\cyrillicH} +\defineactivetoken 227 {\cyrillicC} +\defineactivetoken 254 {\cyrillicCH} +\defineactivetoken 251 {\cyrillicSH} +\defineactivetoken 253 {\cyrillicSHCH} +\defineactivetoken 255 {\cyrillicHRDSN} +\defineactivetoken 249 {\cyrillicERY} +\defineactivetoken 248 {\cyrillicSFTSN} +\defineactivetoken 252 {\cyrillicEREV} +\defineactivetoken 224 {\cyrillicYU} +\defineactivetoken 241 {\cyrillicYA} +\defineactivetoken 193 {\cyrillica} +\defineactivetoken 194 {\cyrillicb} +\defineactivetoken 215 {\cyrillicv} +\defineactivetoken 199 {\cyrillicg} +\defineactivetoken 196 {\cyrillicd} +\defineactivetoken 197 {\cyrillice} +\defineactivetoken 163 {\cyrillicyo} +\defineactivetoken 214 {\cyrilliczh} +\defineactivetoken 218 {\cyrillicz} +\defineactivetoken 201 {\cyrillici} +\defineactivetoken 202 {\cyrillicishrt} +\defineactivetoken 203 {\cyrillick} +\defineactivetoken 204 {\cyrillicl} +\defineactivetoken 205 {\cyrillicm} +\defineactivetoken 206 {\cyrillicn} +\defineactivetoken 207 {\cyrillico} +\defineactivetoken 208 {\cyrillicp} +\defineactivetoken 210 {\cyrillicr} +\defineactivetoken 211 {\cyrillics} +\defineactivetoken 212 {\cyrillict} +\defineactivetoken 213 {\cyrillicu} +\defineactivetoken 198 {\cyrillicf} +\defineactivetoken 200 {\cyrillich} +\defineactivetoken 195 {\cyrillicc} +\defineactivetoken 222 {\cyrillicch} +\defineactivetoken 219 {\cyrillicsh} +\defineactivetoken 221 {\cyrillicshch} +\defineactivetoken 223 {\cyrillichrdsn} +\defineactivetoken 217 {\cyrillicery} +\defineactivetoken 216 {\cyrillicsftsn} +\defineactivetoken 220 {\cyrillicerev} +\defineactivetoken 192 {\cyrillicyu} +\defineactivetoken 209 {\cyrillicya} +\defineactivetoken 148 {\textblacksquare} +\defineactivetoken 149 {\textbullet} +\defineactivetoken 154 {\nonbreakablespace} +\defineactivetoken 156 {\textdegree} +\defineactivetoken 158 {\periodcentered} +\defineactivetoken 191 {\copyright} +\defineactivetoken 150 {\textsurd} +\defineactivetoken 151 {\mathematics\sim} +\defineactivetoken 152 {\mathematics\leq} +\defineactivetoken 153 {\mathematics\geq} +\defineactivetoken 157 {\twosuperior} +\defineactivetoken 159 {\textdiv} + +\stopregime + +\startregime[koi8-ru] + +\defineactivetoken 225 {\cyrillicA} +\defineactivetoken 226 {\cyrillicB} +\defineactivetoken 247 {\cyrillicV} +\defineactivetoken 231 {\cyrillicG} +\defineactivetoken 228 {\cyrillicD} +\defineactivetoken 229 {\cyrillicE} +\defineactivetoken 179 {\cyrillicYO} +\defineactivetoken 246 {\cyrillicZH} +\defineactivetoken 250 {\cyrillicZ} +\defineactivetoken 233 {\cyrillicI} +\defineactivetoken 234 {\cyrillicISHRT} +\defineactivetoken 235 {\cyrillicK} +\defineactivetoken 236 {\cyrillicL} +\defineactivetoken 237 {\cyrillicM} +\defineactivetoken 238 {\cyrillicN} +\defineactivetoken 239 {\cyrillicO} +\defineactivetoken 240 {\cyrillicP} +\defineactivetoken 242 {\cyrillicR} +\defineactivetoken 243 {\cyrillicS} +\defineactivetoken 244 {\cyrillicT} +\defineactivetoken 245 {\cyrillicU} +\defineactivetoken 230 {\cyrillicF} +\defineactivetoken 232 {\cyrillicH} +\defineactivetoken 227 {\cyrillicC} +\defineactivetoken 254 {\cyrillicCH} +\defineactivetoken 251 {\cyrillicSH} +\defineactivetoken 253 {\cyrillicSHCH} +\defineactivetoken 255 {\cyrillicHRDSN} +\defineactivetoken 249 {\cyrillicERY} +\defineactivetoken 248 {\cyrillicSFTSN} +\defineactivetoken 252 {\cyrillicEREV} +\defineactivetoken 224 {\cyrillicYU} +\defineactivetoken 241 {\cyrillicYA} +\defineactivetoken 193 {\cyrillica} +\defineactivetoken 194 {\cyrillicb} +\defineactivetoken 215 {\cyrillicv} +\defineactivetoken 199 {\cyrillicg} +\defineactivetoken 196 {\cyrillicd} +\defineactivetoken 197 {\cyrillice} +\defineactivetoken 163 {\cyrillicyo} +\defineactivetoken 214 {\cyrilliczh} +\defineactivetoken 218 {\cyrillicz} +\defineactivetoken 201 {\cyrillici} +\defineactivetoken 202 {\cyrillicishrt} +\defineactivetoken 203 {\cyrillick} +\defineactivetoken 204 {\cyrillicl} +\defineactivetoken 205 {\cyrillicm} +\defineactivetoken 206 {\cyrillicn} +\defineactivetoken 207 {\cyrillico} +\defineactivetoken 208 {\cyrillicp} +\defineactivetoken 210 {\cyrillicr} +\defineactivetoken 211 {\cyrillics} +\defineactivetoken 212 {\cyrillict} +\defineactivetoken 213 {\cyrillicu} +\defineactivetoken 198 {\cyrillicf} +\defineactivetoken 200 {\cyrillich} +\defineactivetoken 195 {\cyrillicc} +\defineactivetoken 222 {\cyrillicch} +\defineactivetoken 219 {\cyrillicsh} +\defineactivetoken 221 {\cyrillicshch} +\defineactivetoken 223 {\cyrillichrdsn} +\defineactivetoken 217 {\cyrillicery} +\defineactivetoken 216 {\cyrillicsftsn} +\defineactivetoken 220 {\cyrillicerev} +\defineactivetoken 192 {\cyrillicyu} +\defineactivetoken 209 {\cyrillicya} +\defineactivetoken 147 {\upperleftsinglesixquote} +\defineactivetoken 148 {\textblacksquare} +\defineactivetoken 149 {\textbullet} % Changed by V.F. 07/02/2003 (was: \bullet) +\defineactivetoken 150 {\upperrightdoubleninequote} +\defineactivetoken 151 {\emdash} +\defineactivetoken 152 {\textnumero} +\defineactivetoken 153 {\trademark} % Changed by V.F. 07/02/2003 (was: \texttrademark) +\defineactivetoken 154 {\nonbreakablespace} +\defineactivetoken 155 {\rightguillemot} +\defineactivetoken 156 {\registered} +\defineactivetoken 157 {\leftguillemot} +\defineactivetoken 158 {\periodcentered} % Changed by V.F. 07/02/2003 (was: \textperiodcentered) +\defineactivetoken 159 {\textcurrency} +\defineactivetoken 164 {\cyrillicie} +\defineactivetoken 166 {\cyrillicii} +\defineactivetoken 167 {\cyrillicyi} +\defineactivetoken 173 {\cyrillicgup} +\defineactivetoken 174 {\cyrillicushrt} +\defineactivetoken 180 {\cyrillicIE} +\defineactivetoken 182 {\cyrillicII} +\defineactivetoken 183 {\cyrillicYI} +\defineactivetoken 189 {\cyrillicGUP} +\defineactivetoken 190 {\cyrillicUSHRT} +\defineactivetoken 191 {\copyright} + +\stopregime + +\startregime[koi8-u] + +\defineactivetoken 225 {\cyrillicA} +\defineactivetoken 226 {\cyrillicB} +\defineactivetoken 247 {\cyrillicV} +\defineactivetoken 231 {\cyrillicG} +\defineactivetoken 228 {\cyrillicD} +\defineactivetoken 229 {\cyrillicE} +\defineactivetoken 179 {\cyrillicYO} +\defineactivetoken 246 {\cyrillicZH} +\defineactivetoken 250 {\cyrillicZ} +\defineactivetoken 233 {\cyrillicI} +\defineactivetoken 234 {\cyrillicISHRT} +\defineactivetoken 235 {\cyrillicK} +\defineactivetoken 236 {\cyrillicL} +\defineactivetoken 237 {\cyrillicM} +\defineactivetoken 238 {\cyrillicN} +\defineactivetoken 239 {\cyrillicO} +\defineactivetoken 240 {\cyrillicP} +\defineactivetoken 242 {\cyrillicR} +\defineactivetoken 243 {\cyrillicS} +\defineactivetoken 244 {\cyrillicT} +\defineactivetoken 245 {\cyrillicU} +\defineactivetoken 230 {\cyrillicF} +\defineactivetoken 232 {\cyrillicH} +\defineactivetoken 227 {\cyrillicC} +\defineactivetoken 254 {\cyrillicCH} +\defineactivetoken 251 {\cyrillicSH} +\defineactivetoken 253 {\cyrillicSHCH} +\defineactivetoken 255 {\cyrillicHRDSN} +\defineactivetoken 249 {\cyrillicERY} +\defineactivetoken 248 {\cyrillicSFTSN} +\defineactivetoken 252 {\cyrillicEREV} +\defineactivetoken 224 {\cyrillicYU} +\defineactivetoken 241 {\cyrillicYA} +\defineactivetoken 193 {\cyrillica} +\defineactivetoken 194 {\cyrillicb} +\defineactivetoken 215 {\cyrillicv} +\defineactivetoken 199 {\cyrillicg} +\defineactivetoken 196 {\cyrillicd} +\defineactivetoken 197 {\cyrillice} +\defineactivetoken 163 {\cyrillicyo} +\defineactivetoken 214 {\cyrilliczh} +\defineactivetoken 218 {\cyrillicz} +\defineactivetoken 201 {\cyrillici} +\defineactivetoken 202 {\cyrillicishrt} +\defineactivetoken 203 {\cyrillick} +\defineactivetoken 204 {\cyrillicl} +\defineactivetoken 205 {\cyrillicm} +\defineactivetoken 206 {\cyrillicn} +\defineactivetoken 207 {\cyrillico} +\defineactivetoken 208 {\cyrillicp} +\defineactivetoken 210 {\cyrillicr} +\defineactivetoken 211 {\cyrillics} +\defineactivetoken 212 {\cyrillict} +\defineactivetoken 213 {\cyrillicu} +\defineactivetoken 198 {\cyrillicf} +\defineactivetoken 200 {\cyrillich} +\defineactivetoken 195 {\cyrillicc} +\defineactivetoken 222 {\cyrillicch} +\defineactivetoken 219 {\cyrillicsh} +\defineactivetoken 221 {\cyrillicshch} +\defineactivetoken 223 {\cyrillichrdsn} +\defineactivetoken 217 {\cyrillicery} +\defineactivetoken 216 {\cyrillicsftsn} +\defineactivetoken 220 {\cyrillicerev} +\defineactivetoken 192 {\cyrillicyu} +\defineactivetoken 209 {\cyrillicya} +\defineactivetoken 164 {\cyrillicie} +\defineactivetoken 166 {\cyrillicii} +\defineactivetoken 167 {\cyrillicyi} +\defineactivetoken 173 {\cyrillicgup} +\defineactivetoken 180 {\cyrillicIE} +\defineactivetoken 182 {\cyrillicII} +\defineactivetoken 183 {\cyrillicYI} +\defineactivetoken 189 {\cyrillicGUP} + +\stopregime + +\startregime[maccyr] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicZH} +\defineactivetoken 135 {\cyrillicZ} +\defineactivetoken 136 {\cyrillicI} +\defineactivetoken 137 {\cyrillicISHRT} +\defineactivetoken 138 {\cyrillicK} +\defineactivetoken 139 {\cyrillicL} +\defineactivetoken 140 {\cyrillicM} +\defineactivetoken 141 {\cyrillicN} +\defineactivetoken 142 {\cyrillicO} +\defineactivetoken 143 {\cyrillicP} +\defineactivetoken 144 {\cyrillicR} +\defineactivetoken 145 {\cyrillicS} +\defineactivetoken 146 {\cyrillicT} +\defineactivetoken 147 {\cyrillicU} +\defineactivetoken 148 {\cyrillicF} +\defineactivetoken 149 {\cyrillicH} +\defineactivetoken 150 {\cyrillicC} +\defineactivetoken 151 {\cyrillicCH} +\defineactivetoken 152 {\cyrillicSH} +\defineactivetoken 153 {\cyrillicSHCH} +\defineactivetoken 154 {\cyrillicHRDSN} +\defineactivetoken 155 {\cyrillicERY} +\defineactivetoken 156 {\cyrillicSFTSN} +\defineactivetoken 157 {\cyrillicEREV} +\defineactivetoken 158 {\cyrillicYU} +\defineactivetoken 159 {\cyrillicYA} +\defineactivetoken 160 {\textdag} % Changed by V.F. 07/02/2003 (was: dag) +\defineactivetoken 161 {\textdegree} +\defineactivetoken 162 {\textcent} +\defineactivetoken 163 {\textsterling} % Changed by V.F. 07/02/2003 (was: \sterling) +\defineactivetoken 164 {\sectionmark} % Changed by V.F. 07/02/2003 (was: \S) +\defineactivetoken 165 {\textbullet} % Changed by V.F. 07/02/2003 (was: \bullet} +\defineactivetoken 166 {\paragraphmark} % Changed by V.F. 07/02/2003 (was: \P) +\defineactivetoken 167 {\cyrillicII} +\defineactivetoken 168 {\registered} +\defineactivetoken 169 {\copyright} +\defineactivetoken 170 {\trademark} % Changed by V.F. 07/02/2003 (was: \texttrademark} +\defineactivetoken 171 {\cyrillicDJE} +\defineactivetoken 172 {\cyrillicdje} +\defineactivetoken 174 {\'\cyrillicG} +\defineactivetoken 175 {\'\cyrillicg} +\defineactivetoken 180 {\cyrillicii} +\defineactivetoken 183 {\cyrillicJE} +\defineactivetoken 184 {\cyrillicIE} +\defineactivetoken 185 {\cyrillicie} +\defineactivetoken 186 {\cyrillicYI} +\defineactivetoken 187 {\cyrillicyi} +\defineactivetoken 188 {\cyrillicLJE} +\defineactivetoken 189 {\cyrilliclje} +\defineactivetoken 190 {\cyrillicNJE} +\defineactivetoken 191 {\cyrillicnje} +\defineactivetoken 192 {\cyrillicje} +\defineactivetoken 193 {\cyrillicDZE} +\defineactivetoken 196 {\textflorin} % Changed by V.F. 07/02/2003 (was: \florijn) +\defineactivetoken 199 {\leftguillemot} +\defineactivetoken 200 {\rightguillemot} +\defineactivetoken 201 {\textellipsis} % Changed by V.F. 07/02/2003 (was: \dots) +\defineactivetoken 202 {\nonbreakablespace} +\defineactivetoken 203 {\cyrillicTSHE} +\defineactivetoken 204 {\cyrillictshe} +\defineactivetoken 205 {\'\cyrillicK} +\defineactivetoken 206 {\'\cyrillick} +\defineactivetoken 207 {\cyrillicdze} +\defineactivetoken 208 {\endash} +\defineactivetoken 209 {\emdash} +\defineactivetoken 210 {\upperleftdoublesixquote} % Changed by V.F. 07/02/2003 + % (was: \upperleftsinglesixquote) +\defineactivetoken 211 {\upperrightdoubleninequote} +\defineactivetoken 212 {\upperleftsinglesixquote} +\defineactivetoken 213 {\upperrightsingleninequote} +\defineactivetoken 215 {\lowerleftdoubleninequote} +\defineactivetoken 216 {\cyrillicUSHRT} +\defineactivetoken 217 {\cyrillicushrt} +\defineactivetoken 218 {\cyrillicDZHE} +\defineactivetoken 219 {\cyrillicdzhe} +\defineactivetoken 220 {\textnumero} +\defineactivetoken 221 {\cyrillicYO} +\defineactivetoken 222 {\cyrillicyo} +\defineactivetoken 223 {\cyrillicya} +\defineactivetoken 224 {\cyrillica} +\defineactivetoken 225 {\cyrillicb} +\defineactivetoken 226 {\cyrillicv} +\defineactivetoken 227 {\cyrillicg} +\defineactivetoken 228 {\cyrillicd} +\defineactivetoken 229 {\cyrillice} +\defineactivetoken 230 {\cyrilliczh} +\defineactivetoken 231 {\cyrillicz} +\defineactivetoken 232 {\cyrillici} +\defineactivetoken 233 {\cyrillicishrt} +\defineactivetoken 234 {\cyrillick} +\defineactivetoken 235 {\cyrillicl} +\defineactivetoken 236 {\cyrillicm} +\defineactivetoken 237 {\cyrillicn} +\defineactivetoken 238 {\cyrillico} +\defineactivetoken 239 {\cyrillicp} +\defineactivetoken 240 {\cyrillicr} +\defineactivetoken 241 {\cyrillics} +\defineactivetoken 242 {\cyrillict} +\defineactivetoken 243 {\cyrillicu} +\defineactivetoken 244 {\cyrillicf} +\defineactivetoken 245 {\cyrillich} +\defineactivetoken 246 {\cyrillicc} +\defineactivetoken 247 {\cyrillicch} +\defineactivetoken 248 {\cyrillicsh} +\defineactivetoken 249 {\cyrillicshch} +\defineactivetoken 250 {\cyrillichrdsn} +\defineactivetoken 251 {\cyrillicery} +\defineactivetoken 252 {\cyrillicsftsn} +\defineactivetoken 253 {\cyrillicerev} +\defineactivetoken 254 {\cyrillicyu} +\defineactivetoken 255 {\textcurrency} +\defineactivetoken 173 {\mathematics{\neq}} % Added by V.F. 07/02/2003 +\defineactivetoken 176 {\mathematics{\infty}} % Added by V.F. 07/02/2003 +\defineactivetoken 177 {\textpm} % Added by V.F. 07/02/2003 +\defineactivetoken 178 {\mathematics{\leq}} % Added by V.F. 07/02/2003 +\defineactivetoken 179 {\mathematics{\geq}} % Added by V.F. 07/02/2003 +\defineactivetoken 181 {\textmu} % Added by V.F. 07/02/2003 +\defineactivetoken 182 {\mathematics{\partial}} % Added by V.F. 07/02/2003 +\defineactivetoken 194 {\textlognot} % Added by V.F. 07/02/2003 +\defineactivetoken 195 {\textsurd} % Added by V.F. 07/02/2003 +\defineactivetoken 197 {\mathematics{\approx}} % Added by V.F. 07/02/2003 +\defineactivetoken 198 {\mathematics{\Delta}} % Added by V.F. 07/02/2003 +\defineactivetoken 214 {\textdiv} % Added by V.F. 07/02/2003 + +\stopregime + +\startregime[macukr] + +\defineactivetoken 128 {\cyrillicA} +\defineactivetoken 129 {\cyrillicB} +\defineactivetoken 130 {\cyrillicV} +\defineactivetoken 131 {\cyrillicG} +\defineactivetoken 132 {\cyrillicD} +\defineactivetoken 133 {\cyrillicE} +\defineactivetoken 134 {\cyrillicZH} +\defineactivetoken 135 {\cyrillicZ} +\defineactivetoken 136 {\cyrillicI} +\defineactivetoken 137 {\cyrillicISHRT} +\defineactivetoken 138 {\cyrillicK} +\defineactivetoken 139 {\cyrillicL} +\defineactivetoken 140 {\cyrillicM} +\defineactivetoken 141 {\cyrillicN} +\defineactivetoken 142 {\cyrillicO} +\defineactivetoken 143 {\cyrillicP} +\defineactivetoken 144 {\cyrillicR} +\defineactivetoken 145 {\cyrillicS} +\defineactivetoken 146 {\cyrillicT} +\defineactivetoken 147 {\cyrillicU} +\defineactivetoken 148 {\cyrillicF} +\defineactivetoken 149 {\cyrillicH} +\defineactivetoken 150 {\cyrillicC} +\defineactivetoken 151 {\cyrillicCH} +\defineactivetoken 152 {\cyrillicSH} +\defineactivetoken 153 {\cyrillicSHCH} +\defineactivetoken 154 {\cyrillicHRDSN} +\defineactivetoken 155 {\cyrillicERY} +\defineactivetoken 156 {\cyrillicSFTSN} +\defineactivetoken 157 {\cyrillicEREV} +\defineactivetoken 158 {\cyrillicYU} +\defineactivetoken 159 {\cyrillicYA} +\defineactivetoken 160 {\textdag} % Changed by V.F. 07/02/2003 (was: \dag) +\defineactivetoken 161 {\textdegree} +\defineactivetoken 162 {\cyrillicGUP} +\defineactivetoken 163 {\textsterling} % Changed by V.F. 07/02/2003 (was: \sterling) +\defineactivetoken 164 {\sectionmark} % Changed by V.F. 07/02/2003 (was: \S) +\defineactivetoken 165 {\textbullet} % Changed by V.F. 07/02/2003 (was: \bullet} +\defineactivetoken 166 {\paragraphmark} % Changed by V.F. 07/02/2003 (was: \P) +\defineactivetoken 167 {\cyrillicII} +\defineactivetoken 168 {\registered} +\defineactivetoken 169 {\copyright} +\defineactivetoken 170 {\trademark} % Changed by V.F. 07/02/2003 (was: \texttrademark} +\defineactivetoken 171 {\cyrillicDJE} +\defineactivetoken 172 {\cyrillicdje} +\defineactivetoken 174 {\'\cyrillicG} +\defineactivetoken 175 {\'\cyrillicg} +\defineactivetoken 180 {\cyrillicii} +\defineactivetoken 182 {\cyrillicgup} +\defineactivetoken 183 {\cyrillicJE} +\defineactivetoken 184 {\cyrillicIE} +\defineactivetoken 185 {\cyrillicie} +\defineactivetoken 186 {\cyrillicYI} +\defineactivetoken 187 {\cyrillicyi} +\defineactivetoken 188 {\cyrillicLJE} +\defineactivetoken 189 {\cyrilliclje} +\defineactivetoken 190 {\cyrillicNJE} +\defineactivetoken 191 {\cyrillicnje} +\defineactivetoken 192 {\cyrillicje} +\defineactivetoken 193 {\cyrillicDZE} +\defineactivetoken 196 {\textflorin} % Changed by V.F. 07/02/2003 (was: \florijn) +\defineactivetoken 199 {\leftguillemot} +\defineactivetoken 200 {\rightguillemot} +\defineactivetoken 201 {\textellipsis} % Changed by V.F. 07/02/2003 (was: \dots) +\defineactivetoken 202 {\nonbreakablespace} +\defineactivetoken 203 {\cyrillicTSHE} +\defineactivetoken 204 {\cyrillictshe} +\defineactivetoken 205 {\'\cyrillicK} +\defineactivetoken 206 {\'\cyrillick} +\defineactivetoken 207 {\cyrillicdze} +\defineactivetoken 208 {\endash} +\defineactivetoken 209 {\emdash} +\defineactivetoken 210 {\upperleftdoublesixquote} % Changed by V.F. 07/02/2003 + % (was: \upperleftsinglesixquote) +\defineactivetoken 211 {\upperrightdoubleninequote} +\defineactivetoken 212 {\upperleftsinglesixquote} +\defineactivetoken 213 {\upperrightsingleninequote} +\defineactivetoken 215 {\lowerleftdoubleninequote} +\defineactivetoken 216 {\cyrillicUSHRT} +\defineactivetoken 217 {\cyrillicushrt} +\defineactivetoken 218 {\cyrillicDZHE} +\defineactivetoken 219 {\cyrillicdzhe} +\defineactivetoken 220 {\textnumero} +\defineactivetoken 221 {\cyrillicYO} +\defineactivetoken 222 {\cyrillicyo} +\defineactivetoken 223 {\cyrillicya} +\defineactivetoken 224 {\cyrillica} +\defineactivetoken 225 {\cyrillicb} +\defineactivetoken 226 {\cyrillicv} +\defineactivetoken 227 {\cyrillicg} +\defineactivetoken 228 {\cyrillicd} +\defineactivetoken 229 {\cyrillice} +\defineactivetoken 230 {\cyrilliczh} +\defineactivetoken 231 {\cyrillicz} +\defineactivetoken 232 {\cyrillici} +\defineactivetoken 233 {\cyrillicishrt} +\defineactivetoken 234 {\cyrillick} +\defineactivetoken 235 {\cyrillicl} +\defineactivetoken 236 {\cyrillicm} +\defineactivetoken 237 {\cyrillicn} +\defineactivetoken 238 {\cyrillico} +\defineactivetoken 239 {\cyrillicp} +\defineactivetoken 240 {\cyrillicr} +\defineactivetoken 241 {\cyrillics} +\defineactivetoken 242 {\cyrillict} +\defineactivetoken 243 {\cyrillicu} +\defineactivetoken 244 {\cyrillicf} +\defineactivetoken 245 {\cyrillich} +\defineactivetoken 246 {\cyrillicc} +\defineactivetoken 247 {\cyrillicch} +\defineactivetoken 248 {\cyrillicsh} +\defineactivetoken 249 {\cyrillicshch} +\defineactivetoken 250 {\cyrillichrdsn} +\defineactivetoken 251 {\cyrillicery} +\defineactivetoken 252 {\cyrillicsftsn} +\defineactivetoken 253 {\cyrillicerev} +\defineactivetoken 254 {\cyrillicyu} +\defineactivetoken 255 {\textcurrency} +\defineactivetoken 173 {\mathematics{\neq}} % Added by V.F. 07/02/2003 +\defineactivetoken 176 {\mathematics{\infty}} % Added by V.F. 07/02/2003 +\defineactivetoken 177 {\textpm} % Added by V.F. 07/02/2003 +\defineactivetoken 178 {\mathematics{\leq}} % Added by V.F. 07/02/2003 +\defineactivetoken 179 {\mathematics{\geq}} % Added by V.F. 07/02/2003 +\defineactivetoken 181 {\textmu} % Added by V.F. 07/02/2003 +\defineactivetoken 194 {\textlognot} % Added by V.F. 07/02/2003 +\defineactivetoken 195 {\textsurd} % Added by V.F. 07/02/2003 +\defineactivetoken 197 {\mathematics{\approx}} % Added by V.F. 07/02/2003 +\defineactivetoken 198 {\mathematics{\Delta}} % Added by V.F. 07/02/2003 +\defineactivetoken 214 {\textdiv} % Added by V.F. 07/02/2003 + +\stopregime + +\endinput diff --git a/tex/context/base/regi-cyr.tex b/tex/context/base/regi-cyr.tex deleted file mode 100644 index 1e84b9cba..000000000 --- a/tex/context/base/regi-cyr.tex +++ /dev/null @@ -1,722 +0,0 @@ -%D \module -%D [ file=regi-cyr, -%D version=2003.01.24, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Cyrillic, -%D author=..., -%D date=\currentdate, -%D copyright={PRAGMA / 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 Here are additional input regimes for cyrillic encodings others than cp1251 -%D and iso-8859-5: -%D -%D \startitemize -%D \item two variants of dos -%D \item three variants of koi-8 for *nix: russian, -%D ukrainian and mixed -%D \item two variants for the mac -%D \stopitemize -%D -%D Other, not so popular regimes, can be found in \type -%D {regi-cy2}. - -\startregime[cp866] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicZH} -\defineactivetoken 135 {\cyrillicZ} -\defineactivetoken 136 {\cyrillicI} -\defineactivetoken 137 {\cyrillicISHRT} -\defineactivetoken 138 {\cyrillicK} -\defineactivetoken 139 {\cyrillicL} -\defineactivetoken 140 {\cyrillicM} -\defineactivetoken 141 {\cyrillicN} -\defineactivetoken 142 {\cyrillicO} -\defineactivetoken 143 {\cyrillicP} -\defineactivetoken 144 {\cyrillicR} -\defineactivetoken 145 {\cyrillicS} -\defineactivetoken 146 {\cyrillicT} -\defineactivetoken 147 {\cyrillicU} -\defineactivetoken 148 {\cyrillicF} -\defineactivetoken 149 {\cyrillicH} -\defineactivetoken 150 {\cyrillicC} -\defineactivetoken 151 {\cyrillicCH} -\defineactivetoken 152 {\cyrillicSH} -\defineactivetoken 153 {\cyrillicSHCH} -\defineactivetoken 154 {\cyrillicHRDSN} -\defineactivetoken 155 {\cyrillicERY} -\defineactivetoken 156 {\cyrillicSFTSN} -\defineactivetoken 157 {\cyrillicEREV} -\defineactivetoken 158 {\cyrillicYU} -\defineactivetoken 159 {\cyrillicYA} -\defineactivetoken 160 {\cyrillica} -\defineactivetoken 161 {\cyrillicb} -\defineactivetoken 162 {\cyrillicv} -\defineactivetoken 163 {\cyrillicg} -\defineactivetoken 164 {\cyrillicd} -\defineactivetoken 165 {\cyrillice} -\defineactivetoken 166 {\cyrilliczh} -\defineactivetoken 167 {\cyrillicz} -\defineactivetoken 168 {\cyrillici} -\defineactivetoken 169 {\cyrillicishrt} -\defineactivetoken 170 {\cyrillick} -\defineactivetoken 171 {\cyrillicl} -\defineactivetoken 172 {\cyrillicm} -\defineactivetoken 173 {\cyrillicn} -\defineactivetoken 174 {\cyrillico} -\defineactivetoken 175 {\cyrillicp} -\defineactivetoken 224 {\cyrillicr} -\defineactivetoken 225 {\cyrillics} -\defineactivetoken 226 {\cyrillict} -\defineactivetoken 227 {\cyrillicu} -\defineactivetoken 228 {\cyrillicf} -\defineactivetoken 229 {\cyrillich} -\defineactivetoken 230 {\cyrillicc} -\defineactivetoken 231 {\cyrillicch} -\defineactivetoken 232 {\cyrillicsh} -\defineactivetoken 233 {\cyrillicshch} -\defineactivetoken 234 {\cyrillichrdsn} -\defineactivetoken 235 {\cyrillicery} -\defineactivetoken 236 {\cyrillicsftsn} -\defineactivetoken 237 {\cyrillicerev} -\defineactivetoken 238 {\cyrillicyu} -\defineactivetoken 239 {\cyrillicya} -\defineactivetoken 240 {\cyrillicYO} -\defineactivetoken 241 {\cyrillicyo} -\defineactivetoken 242 {\cyrillicIE} -\defineactivetoken 243 {\cyrillicie} -\defineactivetoken 244 {\cyrillicYI} -\defineactivetoken 245 {\cyrillicyi} -\defineactivetoken 246 {\cyrillicUSHRT} -\defineactivetoken 247 {\cyrillicushrt} -\defineactivetoken 248 {\textdegree} -\defineactivetoken 249 {\bullet} -\defineactivetoken 250 {\periodcentered} -\defineactivetoken 252 {\textnumero} -\defineactivetoken 253 {\textcurrency} -\defineactivetoken 254 {\textblacksquare} -\defineactivetoken 255 {\nonbreakablespace} -\defineactivetoken 251 {\textsurd} - -\stopregime - -\startregime[cp866nav] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicZH} -\defineactivetoken 135 {\cyrillicZ} -\defineactivetoken 136 {\cyrillicI} -\defineactivetoken 137 {\cyrillicISHRT} -\defineactivetoken 138 {\cyrillicK} -\defineactivetoken 139 {\cyrillicL} -\defineactivetoken 140 {\cyrillicM} -\defineactivetoken 141 {\cyrillicN} -\defineactivetoken 142 {\cyrillicO} -\defineactivetoken 143 {\cyrillicP} -\defineactivetoken 144 {\cyrillicR} -\defineactivetoken 145 {\cyrillicS} -\defineactivetoken 146 {\cyrillicT} -\defineactivetoken 147 {\cyrillicU} -\defineactivetoken 148 {\cyrillicF} -\defineactivetoken 149 {\cyrillicH} -\defineactivetoken 150 {\cyrillicC} -\defineactivetoken 151 {\cyrillicCH} -\defineactivetoken 152 {\cyrillicSH} -\defineactivetoken 153 {\cyrillicSHCH} -\defineactivetoken 154 {\cyrillicHRDSN} -\defineactivetoken 155 {\cyrillicERY} -\defineactivetoken 156 {\cyrillicSFTSN} -\defineactivetoken 157 {\cyrillicEREV} -\defineactivetoken 158 {\cyrillicYU} -\defineactivetoken 159 {\cyrillicYA} -\defineactivetoken 160 {\cyrillica} -\defineactivetoken 161 {\cyrillicb} -\defineactivetoken 162 {\cyrillicv} -\defineactivetoken 163 {\cyrillicg} -\defineactivetoken 164 {\cyrillicd} -\defineactivetoken 165 {\cyrillice} -\defineactivetoken 166 {\cyrilliczh} -\defineactivetoken 167 {\cyrillicz} -\defineactivetoken 168 {\cyrillici} -\defineactivetoken 169 {\cyrillicishrt} -\defineactivetoken 170 {\cyrillick} -\defineactivetoken 171 {\cyrillicl} -\defineactivetoken 172 {\cyrillicm} -\defineactivetoken 173 {\cyrillicn} -\defineactivetoken 174 {\cyrillico} -\defineactivetoken 175 {\cyrillicp} -\defineactivetoken 224 {\cyrillicr} -\defineactivetoken 225 {\cyrillics} -\defineactivetoken 226 {\cyrillict} -\defineactivetoken 227 {\cyrillicu} -\defineactivetoken 228 {\cyrillicf} -\defineactivetoken 229 {\cyrillich} -\defineactivetoken 230 {\cyrillicc} -\defineactivetoken 231 {\cyrillicch} -\defineactivetoken 232 {\cyrillicsh} -\defineactivetoken 233 {\cyrillicshch} -\defineactivetoken 234 {\cyrillichrdsn} -\defineactivetoken 235 {\cyrillicery} -\defineactivetoken 236 {\cyrillicsftsn} -\defineactivetoken 237 {\cyrillicerev} -\defineactivetoken 238 {\cyrillicyu} -\defineactivetoken 239 {\cyrillicya} -\defineactivetoken 240 {\cyrillicYO} -\defineactivetoken 241 {\cyrillicyo} -\defineactivetoken 242 {\cyrillicGUP} -\defineactivetoken 243 {\cyrillicgup} -\defineactivetoken 244 {\cyrillicIE} -\defineactivetoken 245 {\cyrillicie} -\defineactivetoken 246 {\cyrillicII} -\defineactivetoken 247 {\cyrillicii} -\defineactivetoken 248 {\cyrillicYI} -\defineactivetoken 249 {\cyrillicyi} -\defineactivetoken 250 {\cyrillicUSHRT} -\defineactivetoken 251 {\cyrillicushrt} -\defineactivetoken 252 {\textnumero} -\defineactivetoken 253 {\leftguillemot} -\defineactivetoken 254 {\rightguillemot} -\defineactivetoken 255 {\nonbreakablespace} - -\stopregime - -\startregime[koi8-r] - -\defineactivetoken 225 {\cyrillicA} -\defineactivetoken 226 {\cyrillicB} -\defineactivetoken 247 {\cyrillicV} -\defineactivetoken 231 {\cyrillicG} -\defineactivetoken 228 {\cyrillicD} -\defineactivetoken 229 {\cyrillicE} -\defineactivetoken 179 {\cyrillicYO} -\defineactivetoken 246 {\cyrillicZH} -\defineactivetoken 250 {\cyrillicZ} -\defineactivetoken 233 {\cyrillicI} -\defineactivetoken 234 {\cyrillicISHRT} -\defineactivetoken 235 {\cyrillicK} -\defineactivetoken 236 {\cyrillicL} -\defineactivetoken 237 {\cyrillicM} -\defineactivetoken 238 {\cyrillicN} -\defineactivetoken 239 {\cyrillicO} -\defineactivetoken 240 {\cyrillicP} -\defineactivetoken 242 {\cyrillicR} -\defineactivetoken 243 {\cyrillicS} -\defineactivetoken 244 {\cyrillicT} -\defineactivetoken 245 {\cyrillicU} -\defineactivetoken 230 {\cyrillicF} -\defineactivetoken 232 {\cyrillicH} -\defineactivetoken 227 {\cyrillicC} -\defineactivetoken 254 {\cyrillicCH} -\defineactivetoken 251 {\cyrillicSH} -\defineactivetoken 253 {\cyrillicSHCH} -\defineactivetoken 255 {\cyrillicHRDSN} -\defineactivetoken 249 {\cyrillicERY} -\defineactivetoken 248 {\cyrillicSFTSN} -\defineactivetoken 252 {\cyrillicEREV} -\defineactivetoken 224 {\cyrillicYU} -\defineactivetoken 241 {\cyrillicYA} -\defineactivetoken 193 {\cyrillica} -\defineactivetoken 194 {\cyrillicb} -\defineactivetoken 215 {\cyrillicv} -\defineactivetoken 199 {\cyrillicg} -\defineactivetoken 196 {\cyrillicd} -\defineactivetoken 197 {\cyrillice} -\defineactivetoken 163 {\cyrillicyo} -\defineactivetoken 214 {\cyrilliczh} -\defineactivetoken 218 {\cyrillicz} -\defineactivetoken 201 {\cyrillici} -\defineactivetoken 202 {\cyrillicishrt} -\defineactivetoken 203 {\cyrillick} -\defineactivetoken 204 {\cyrillicl} -\defineactivetoken 205 {\cyrillicm} -\defineactivetoken 206 {\cyrillicn} -\defineactivetoken 207 {\cyrillico} -\defineactivetoken 208 {\cyrillicp} -\defineactivetoken 210 {\cyrillicr} -\defineactivetoken 211 {\cyrillics} -\defineactivetoken 212 {\cyrillict} -\defineactivetoken 213 {\cyrillicu} -\defineactivetoken 198 {\cyrillicf} -\defineactivetoken 200 {\cyrillich} -\defineactivetoken 195 {\cyrillicc} -\defineactivetoken 222 {\cyrillicch} -\defineactivetoken 219 {\cyrillicsh} -\defineactivetoken 221 {\cyrillicshch} -\defineactivetoken 223 {\cyrillichrdsn} -\defineactivetoken 217 {\cyrillicery} -\defineactivetoken 216 {\cyrillicsftsn} -\defineactivetoken 220 {\cyrillicerev} -\defineactivetoken 192 {\cyrillicyu} -\defineactivetoken 209 {\cyrillicya} -\defineactivetoken 148 {\textblacksquare} -\defineactivetoken 149 {\textbullet} -\defineactivetoken 154 {\nonbreakablespace} -\defineactivetoken 156 {\textdegree} -\defineactivetoken 158 {\periodcentered} -\defineactivetoken 191 {\copyright} -\defineactivetoken 150 {\textsurd} -\defineactivetoken 151 {\mathematics\sim} -\defineactivetoken 152 {\mathematics\leq} -\defineactivetoken 153 {\mathematics\geq} -\defineactivetoken 157 {\twosuperior} -\defineactivetoken 159 {\textdiv} - -\stopregime - -\startregime[koi8-ru] - -\defineactivetoken 225 {\cyrillicA} -\defineactivetoken 226 {\cyrillicB} -\defineactivetoken 247 {\cyrillicV} -\defineactivetoken 231 {\cyrillicG} -\defineactivetoken 228 {\cyrillicD} -\defineactivetoken 229 {\cyrillicE} -\defineactivetoken 179 {\cyrillicYO} -\defineactivetoken 246 {\cyrillicZH} -\defineactivetoken 250 {\cyrillicZ} -\defineactivetoken 233 {\cyrillicI} -\defineactivetoken 234 {\cyrillicISHRT} -\defineactivetoken 235 {\cyrillicK} -\defineactivetoken 236 {\cyrillicL} -\defineactivetoken 237 {\cyrillicM} -\defineactivetoken 238 {\cyrillicN} -\defineactivetoken 239 {\cyrillicO} -\defineactivetoken 240 {\cyrillicP} -\defineactivetoken 242 {\cyrillicR} -\defineactivetoken 243 {\cyrillicS} -\defineactivetoken 244 {\cyrillicT} -\defineactivetoken 245 {\cyrillicU} -\defineactivetoken 230 {\cyrillicF} -\defineactivetoken 232 {\cyrillicH} -\defineactivetoken 227 {\cyrillicC} -\defineactivetoken 254 {\cyrillicCH} -\defineactivetoken 251 {\cyrillicSH} -\defineactivetoken 253 {\cyrillicSHCH} -\defineactivetoken 255 {\cyrillicHRDSN} -\defineactivetoken 249 {\cyrillicERY} -\defineactivetoken 248 {\cyrillicSFTSN} -\defineactivetoken 252 {\cyrillicEREV} -\defineactivetoken 224 {\cyrillicYU} -\defineactivetoken 241 {\cyrillicYA} -\defineactivetoken 193 {\cyrillica} -\defineactivetoken 194 {\cyrillicb} -\defineactivetoken 215 {\cyrillicv} -\defineactivetoken 199 {\cyrillicg} -\defineactivetoken 196 {\cyrillicd} -\defineactivetoken 197 {\cyrillice} -\defineactivetoken 163 {\cyrillicyo} -\defineactivetoken 214 {\cyrilliczh} -\defineactivetoken 218 {\cyrillicz} -\defineactivetoken 201 {\cyrillici} -\defineactivetoken 202 {\cyrillicishrt} -\defineactivetoken 203 {\cyrillick} -\defineactivetoken 204 {\cyrillicl} -\defineactivetoken 205 {\cyrillicm} -\defineactivetoken 206 {\cyrillicn} -\defineactivetoken 207 {\cyrillico} -\defineactivetoken 208 {\cyrillicp} -\defineactivetoken 210 {\cyrillicr} -\defineactivetoken 211 {\cyrillics} -\defineactivetoken 212 {\cyrillict} -\defineactivetoken 213 {\cyrillicu} -\defineactivetoken 198 {\cyrillicf} -\defineactivetoken 200 {\cyrillich} -\defineactivetoken 195 {\cyrillicc} -\defineactivetoken 222 {\cyrillicch} -\defineactivetoken 219 {\cyrillicsh} -\defineactivetoken 221 {\cyrillicshch} -\defineactivetoken 223 {\cyrillichrdsn} -\defineactivetoken 217 {\cyrillicery} -\defineactivetoken 216 {\cyrillicsftsn} -\defineactivetoken 220 {\cyrillicerev} -\defineactivetoken 192 {\cyrillicyu} -\defineactivetoken 209 {\cyrillicya} -\defineactivetoken 147 {\upperleftsinglesixquote} -\defineactivetoken 148 {\textblacksquare} -\defineactivetoken 149 {\textbullet} % Changed by V.F. 07/02/2003 (was: \bullet) -\defineactivetoken 150 {\upperrightdoubleninequote} -\defineactivetoken 151 {\emdash} -\defineactivetoken 152 {\textnumero} -\defineactivetoken 153 {\trademark} % Changed by V.F. 07/02/2003 (was: \texttrademark) -\defineactivetoken 154 {\nonbreakablespace} -\defineactivetoken 155 {\rightguillemot} -\defineactivetoken 156 {\registered} -\defineactivetoken 157 {\leftguillemot} -\defineactivetoken 158 {\periodcentered} % Changed by V.F. 07/02/2003 (was: \textperiodcentered) -\defineactivetoken 159 {\textcurrency} -\defineactivetoken 164 {\cyrillicie} -\defineactivetoken 166 {\cyrillicii} -\defineactivetoken 167 {\cyrillicyi} -\defineactivetoken 173 {\cyrillicgup} -\defineactivetoken 174 {\cyrillicushrt} -\defineactivetoken 180 {\cyrillicIE} -\defineactivetoken 182 {\cyrillicII} -\defineactivetoken 183 {\cyrillicYI} -\defineactivetoken 189 {\cyrillicGUP} -\defineactivetoken 190 {\cyrillicUSHRT} -\defineactivetoken 191 {\copyright} - -\stopregime - -\startregime[koi8-u] - -\defineactivetoken 225 {\cyrillicA} -\defineactivetoken 226 {\cyrillicB} -\defineactivetoken 247 {\cyrillicV} -\defineactivetoken 231 {\cyrillicG} -\defineactivetoken 228 {\cyrillicD} -\defineactivetoken 229 {\cyrillicE} -\defineactivetoken 179 {\cyrillicYO} -\defineactivetoken 246 {\cyrillicZH} -\defineactivetoken 250 {\cyrillicZ} -\defineactivetoken 233 {\cyrillicI} -\defineactivetoken 234 {\cyrillicISHRT} -\defineactivetoken 235 {\cyrillicK} -\defineactivetoken 236 {\cyrillicL} -\defineactivetoken 237 {\cyrillicM} -\defineactivetoken 238 {\cyrillicN} -\defineactivetoken 239 {\cyrillicO} -\defineactivetoken 240 {\cyrillicP} -\defineactivetoken 242 {\cyrillicR} -\defineactivetoken 243 {\cyrillicS} -\defineactivetoken 244 {\cyrillicT} -\defineactivetoken 245 {\cyrillicU} -\defineactivetoken 230 {\cyrillicF} -\defineactivetoken 232 {\cyrillicH} -\defineactivetoken 227 {\cyrillicC} -\defineactivetoken 254 {\cyrillicCH} -\defineactivetoken 251 {\cyrillicSH} -\defineactivetoken 253 {\cyrillicSHCH} -\defineactivetoken 255 {\cyrillicHRDSN} -\defineactivetoken 249 {\cyrillicERY} -\defineactivetoken 248 {\cyrillicSFTSN} -\defineactivetoken 252 {\cyrillicEREV} -\defineactivetoken 224 {\cyrillicYU} -\defineactivetoken 241 {\cyrillicYA} -\defineactivetoken 193 {\cyrillica} -\defineactivetoken 194 {\cyrillicb} -\defineactivetoken 215 {\cyrillicv} -\defineactivetoken 199 {\cyrillicg} -\defineactivetoken 196 {\cyrillicd} -\defineactivetoken 197 {\cyrillice} -\defineactivetoken 163 {\cyrillicyo} -\defineactivetoken 214 {\cyrilliczh} -\defineactivetoken 218 {\cyrillicz} -\defineactivetoken 201 {\cyrillici} -\defineactivetoken 202 {\cyrillicishrt} -\defineactivetoken 203 {\cyrillick} -\defineactivetoken 204 {\cyrillicl} -\defineactivetoken 205 {\cyrillicm} -\defineactivetoken 206 {\cyrillicn} -\defineactivetoken 207 {\cyrillico} -\defineactivetoken 208 {\cyrillicp} -\defineactivetoken 210 {\cyrillicr} -\defineactivetoken 211 {\cyrillics} -\defineactivetoken 212 {\cyrillict} -\defineactivetoken 213 {\cyrillicu} -\defineactivetoken 198 {\cyrillicf} -\defineactivetoken 200 {\cyrillich} -\defineactivetoken 195 {\cyrillicc} -\defineactivetoken 222 {\cyrillicch} -\defineactivetoken 219 {\cyrillicsh} -\defineactivetoken 221 {\cyrillicshch} -\defineactivetoken 223 {\cyrillichrdsn} -\defineactivetoken 217 {\cyrillicery} -\defineactivetoken 216 {\cyrillicsftsn} -\defineactivetoken 220 {\cyrillicerev} -\defineactivetoken 192 {\cyrillicyu} -\defineactivetoken 209 {\cyrillicya} -\defineactivetoken 164 {\cyrillicie} -\defineactivetoken 166 {\cyrillicii} -\defineactivetoken 167 {\cyrillicyi} -\defineactivetoken 173 {\cyrillicgup} -\defineactivetoken 180 {\cyrillicIE} -\defineactivetoken 182 {\cyrillicII} -\defineactivetoken 183 {\cyrillicYI} -\defineactivetoken 189 {\cyrillicGUP} - -\stopregime - -\startregime[maccyr] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicZH} -\defineactivetoken 135 {\cyrillicZ} -\defineactivetoken 136 {\cyrillicI} -\defineactivetoken 137 {\cyrillicISHRT} -\defineactivetoken 138 {\cyrillicK} -\defineactivetoken 139 {\cyrillicL} -\defineactivetoken 140 {\cyrillicM} -\defineactivetoken 141 {\cyrillicN} -\defineactivetoken 142 {\cyrillicO} -\defineactivetoken 143 {\cyrillicP} -\defineactivetoken 144 {\cyrillicR} -\defineactivetoken 145 {\cyrillicS} -\defineactivetoken 146 {\cyrillicT} -\defineactivetoken 147 {\cyrillicU} -\defineactivetoken 148 {\cyrillicF} -\defineactivetoken 149 {\cyrillicH} -\defineactivetoken 150 {\cyrillicC} -\defineactivetoken 151 {\cyrillicCH} -\defineactivetoken 152 {\cyrillicSH} -\defineactivetoken 153 {\cyrillicSHCH} -\defineactivetoken 154 {\cyrillicHRDSN} -\defineactivetoken 155 {\cyrillicERY} -\defineactivetoken 156 {\cyrillicSFTSN} -\defineactivetoken 157 {\cyrillicEREV} -\defineactivetoken 158 {\cyrillicYU} -\defineactivetoken 159 {\cyrillicYA} -\defineactivetoken 160 {\textdag} % Changed by V.F. 07/02/2003 (was: dag) -\defineactivetoken 161 {\textdegree} -\defineactivetoken 162 {\textcent} -\defineactivetoken 163 {\textsterling} % Changed by V.F. 07/02/2003 (was: \sterling) -\defineactivetoken 164 {\sectionmark} % Changed by V.F. 07/02/2003 (was: \S) -\defineactivetoken 165 {\textbullet} % Changed by V.F. 07/02/2003 (was: \bullet} -\defineactivetoken 166 {\paragraphmark} % Changed by V.F. 07/02/2003 (was: \P) -\defineactivetoken 167 {\cyrillicII} -\defineactivetoken 168 {\registered} -\defineactivetoken 169 {\copyright} -\defineactivetoken 170 {\trademark} % Changed by V.F. 07/02/2003 (was: \texttrademark} -\defineactivetoken 171 {\cyrillicDJE} -\defineactivetoken 172 {\cyrillicdje} -\defineactivetoken 174 {\'\cyrillicG} -\defineactivetoken 175 {\'\cyrillicg} -\defineactivetoken 180 {\cyrillicii} -\defineactivetoken 183 {\cyrillicJE} -\defineactivetoken 184 {\cyrillicIE} -\defineactivetoken 185 {\cyrillicie} -\defineactivetoken 186 {\cyrillicYI} -\defineactivetoken 187 {\cyrillicyi} -\defineactivetoken 188 {\cyrillicLJE} -\defineactivetoken 189 {\cyrilliclje} -\defineactivetoken 190 {\cyrillicNJE} -\defineactivetoken 191 {\cyrillicnje} -\defineactivetoken 192 {\cyrillicje} -\defineactivetoken 193 {\cyrillicDZE} -\defineactivetoken 196 {\textflorin} % Changed by V.F. 07/02/2003 (was: \florijn) -\defineactivetoken 199 {\leftguillemot} -\defineactivetoken 200 {\rightguillemot} -\defineactivetoken 201 {\textellipsis} % Changed by V.F. 07/02/2003 (was: \dots) -\defineactivetoken 202 {\nonbreakablespace} -\defineactivetoken 203 {\cyrillicTSHE} -\defineactivetoken 204 {\cyrillictshe} -\defineactivetoken 205 {\'\cyrillicK} -\defineactivetoken 206 {\'\cyrillick} -\defineactivetoken 207 {\cyrillicdze} -\defineactivetoken 208 {\endash} -\defineactivetoken 209 {\emdash} -\defineactivetoken 210 {\upperleftdoublesixquote} % Changed by V.F. 07/02/2003 - % (was: \upperleftsinglesixquote) -\defineactivetoken 211 {\upperrightdoubleninequote} -\defineactivetoken 212 {\upperleftsinglesixquote} -\defineactivetoken 213 {\upperrightsingleninequote} -\defineactivetoken 215 {\lowerleftdoubleninequote} -\defineactivetoken 216 {\cyrillicUSHRT} -\defineactivetoken 217 {\cyrillicushrt} -\defineactivetoken 218 {\cyrillicDZHE} -\defineactivetoken 219 {\cyrillicdzhe} -\defineactivetoken 220 {\textnumero} -\defineactivetoken 221 {\cyrillicYO} -\defineactivetoken 222 {\cyrillicyo} -\defineactivetoken 223 {\cyrillicya} -\defineactivetoken 224 {\cyrillica} -\defineactivetoken 225 {\cyrillicb} -\defineactivetoken 226 {\cyrillicv} -\defineactivetoken 227 {\cyrillicg} -\defineactivetoken 228 {\cyrillicd} -\defineactivetoken 229 {\cyrillice} -\defineactivetoken 230 {\cyrilliczh} -\defineactivetoken 231 {\cyrillicz} -\defineactivetoken 232 {\cyrillici} -\defineactivetoken 233 {\cyrillicishrt} -\defineactivetoken 234 {\cyrillick} -\defineactivetoken 235 {\cyrillicl} -\defineactivetoken 236 {\cyrillicm} -\defineactivetoken 237 {\cyrillicn} -\defineactivetoken 238 {\cyrillico} -\defineactivetoken 239 {\cyrillicp} -\defineactivetoken 240 {\cyrillicr} -\defineactivetoken 241 {\cyrillics} -\defineactivetoken 242 {\cyrillict} -\defineactivetoken 243 {\cyrillicu} -\defineactivetoken 244 {\cyrillicf} -\defineactivetoken 245 {\cyrillich} -\defineactivetoken 246 {\cyrillicc} -\defineactivetoken 247 {\cyrillicch} -\defineactivetoken 248 {\cyrillicsh} -\defineactivetoken 249 {\cyrillicshch} -\defineactivetoken 250 {\cyrillichrdsn} -\defineactivetoken 251 {\cyrillicery} -\defineactivetoken 252 {\cyrillicsftsn} -\defineactivetoken 253 {\cyrillicerev} -\defineactivetoken 254 {\cyrillicyu} -\defineactivetoken 255 {\textcurrency} -\defineactivetoken 173 {\mathematics{\neq}} % Added by V.F. 07/02/2003 -\defineactivetoken 176 {\mathematics{\infty}} % Added by V.F. 07/02/2003 -\defineactivetoken 177 {\textpm} % Added by V.F. 07/02/2003 -\defineactivetoken 178 {\mathematics{\leq}} % Added by V.F. 07/02/2003 -\defineactivetoken 179 {\mathematics{\geq}} % Added by V.F. 07/02/2003 -\defineactivetoken 181 {\textmu} % Added by V.F. 07/02/2003 -\defineactivetoken 182 {\mathematics{\partial}} % Added by V.F. 07/02/2003 -\defineactivetoken 194 {\textlognot} % Added by V.F. 07/02/2003 -\defineactivetoken 195 {\textsurd} % Added by V.F. 07/02/2003 -\defineactivetoken 197 {\mathematics{\approx}} % Added by V.F. 07/02/2003 -\defineactivetoken 198 {\mathematics{\Delta}} % Added by V.F. 07/02/2003 -\defineactivetoken 214 {\textdiv} % Added by V.F. 07/02/2003 - -\stopregime - -\startregime[macukr] - -\defineactivetoken 128 {\cyrillicA} -\defineactivetoken 129 {\cyrillicB} -\defineactivetoken 130 {\cyrillicV} -\defineactivetoken 131 {\cyrillicG} -\defineactivetoken 132 {\cyrillicD} -\defineactivetoken 133 {\cyrillicE} -\defineactivetoken 134 {\cyrillicZH} -\defineactivetoken 135 {\cyrillicZ} -\defineactivetoken 136 {\cyrillicI} -\defineactivetoken 137 {\cyrillicISHRT} -\defineactivetoken 138 {\cyrillicK} -\defineactivetoken 139 {\cyrillicL} -\defineactivetoken 140 {\cyrillicM} -\defineactivetoken 141 {\cyrillicN} -\defineactivetoken 142 {\cyrillicO} -\defineactivetoken 143 {\cyrillicP} -\defineactivetoken 144 {\cyrillicR} -\defineactivetoken 145 {\cyrillicS} -\defineactivetoken 146 {\cyrillicT} -\defineactivetoken 147 {\cyrillicU} -\defineactivetoken 148 {\cyrillicF} -\defineactivetoken 149 {\cyrillicH} -\defineactivetoken 150 {\cyrillicC} -\defineactivetoken 151 {\cyrillicCH} -\defineactivetoken 152 {\cyrillicSH} -\defineactivetoken 153 {\cyrillicSHCH} -\defineactivetoken 154 {\cyrillicHRDSN} -\defineactivetoken 155 {\cyrillicERY} -\defineactivetoken 156 {\cyrillicSFTSN} -\defineactivetoken 157 {\cyrillicEREV} -\defineactivetoken 158 {\cyrillicYU} -\defineactivetoken 159 {\cyrillicYA} -\defineactivetoken 160 {\textdag} % Changed by V.F. 07/02/2003 (was: \dag) -\defineactivetoken 161 {\textdegree} -\defineactivetoken 162 {\cyrillicGUP} -\defineactivetoken 163 {\textsterling} % Changed by V.F. 07/02/2003 (was: \sterling) -\defineactivetoken 164 {\sectionmark} % Changed by V.F. 07/02/2003 (was: \S) -\defineactivetoken 165 {\textbullet} % Changed by V.F. 07/02/2003 (was: \bullet} -\defineactivetoken 166 {\paragraphmark} % Changed by V.F. 07/02/2003 (was: \P) -\defineactivetoken 167 {\cyrillicII} -\defineactivetoken 168 {\registered} -\defineactivetoken 169 {\copyright} -\defineactivetoken 170 {\trademark} % Changed by V.F. 07/02/2003 (was: \texttrademark} -\defineactivetoken 171 {\cyrillicDJE} -\defineactivetoken 172 {\cyrillicdje} -\defineactivetoken 174 {\'\cyrillicG} -\defineactivetoken 175 {\'\cyrillicg} -\defineactivetoken 180 {\cyrillicii} -\defineactivetoken 182 {\cyrillicgup} -\defineactivetoken 183 {\cyrillicJE} -\defineactivetoken 184 {\cyrillicIE} -\defineactivetoken 185 {\cyrillicie} -\defineactivetoken 186 {\cyrillicYI} -\defineactivetoken 187 {\cyrillicyi} -\defineactivetoken 188 {\cyrillicLJE} -\defineactivetoken 189 {\cyrilliclje} -\defineactivetoken 190 {\cyrillicNJE} -\defineactivetoken 191 {\cyrillicnje} -\defineactivetoken 192 {\cyrillicje} -\defineactivetoken 193 {\cyrillicDZE} -\defineactivetoken 196 {\textflorin} % Changed by V.F. 07/02/2003 (was: \florijn) -\defineactivetoken 199 {\leftguillemot} -\defineactivetoken 200 {\rightguillemot} -\defineactivetoken 201 {\textellipsis} % Changed by V.F. 07/02/2003 (was: \dots) -\defineactivetoken 202 {\nonbreakablespace} -\defineactivetoken 203 {\cyrillicTSHE} -\defineactivetoken 204 {\cyrillictshe} -\defineactivetoken 205 {\'\cyrillicK} -\defineactivetoken 206 {\'\cyrillick} -\defineactivetoken 207 {\cyrillicdze} -\defineactivetoken 208 {\endash} -\defineactivetoken 209 {\emdash} -\defineactivetoken 210 {\upperleftdoublesixquote} % Changed by V.F. 07/02/2003 - % (was: \upperleftsinglesixquote) -\defineactivetoken 211 {\upperrightdoubleninequote} -\defineactivetoken 212 {\upperleftsinglesixquote} -\defineactivetoken 213 {\upperrightsingleninequote} -\defineactivetoken 215 {\lowerleftdoubleninequote} -\defineactivetoken 216 {\cyrillicUSHRT} -\defineactivetoken 217 {\cyrillicushrt} -\defineactivetoken 218 {\cyrillicDZHE} -\defineactivetoken 219 {\cyrillicdzhe} -\defineactivetoken 220 {\textnumero} -\defineactivetoken 221 {\cyrillicYO} -\defineactivetoken 222 {\cyrillicyo} -\defineactivetoken 223 {\cyrillicya} -\defineactivetoken 224 {\cyrillica} -\defineactivetoken 225 {\cyrillicb} -\defineactivetoken 226 {\cyrillicv} -\defineactivetoken 227 {\cyrillicg} -\defineactivetoken 228 {\cyrillicd} -\defineactivetoken 229 {\cyrillice} -\defineactivetoken 230 {\cyrilliczh} -\defineactivetoken 231 {\cyrillicz} -\defineactivetoken 232 {\cyrillici} -\defineactivetoken 233 {\cyrillicishrt} -\defineactivetoken 234 {\cyrillick} -\defineactivetoken 235 {\cyrillicl} -\defineactivetoken 236 {\cyrillicm} -\defineactivetoken 237 {\cyrillicn} -\defineactivetoken 238 {\cyrillico} -\defineactivetoken 239 {\cyrillicp} -\defineactivetoken 240 {\cyrillicr} -\defineactivetoken 241 {\cyrillics} -\defineactivetoken 242 {\cyrillict} -\defineactivetoken 243 {\cyrillicu} -\defineactivetoken 244 {\cyrillicf} -\defineactivetoken 245 {\cyrillich} -\defineactivetoken 246 {\cyrillicc} -\defineactivetoken 247 {\cyrillicch} -\defineactivetoken 248 {\cyrillicsh} -\defineactivetoken 249 {\cyrillicshch} -\defineactivetoken 250 {\cyrillichrdsn} -\defineactivetoken 251 {\cyrillicery} -\defineactivetoken 252 {\cyrillicsftsn} -\defineactivetoken 253 {\cyrillicerev} -\defineactivetoken 254 {\cyrillicyu} -\defineactivetoken 255 {\textcurrency} -\defineactivetoken 173 {\mathematics{\neq}} % Added by V.F. 07/02/2003 -\defineactivetoken 176 {\mathematics{\infty}} % Added by V.F. 07/02/2003 -\defineactivetoken 177 {\textpm} % Added by V.F. 07/02/2003 -\defineactivetoken 178 {\mathematics{\leq}} % Added by V.F. 07/02/2003 -\defineactivetoken 179 {\mathematics{\geq}} % Added by V.F. 07/02/2003 -\defineactivetoken 181 {\textmu} % Added by V.F. 07/02/2003 -\defineactivetoken 194 {\textlognot} % Added by V.F. 07/02/2003 -\defineactivetoken 195 {\textsurd} % Added by V.F. 07/02/2003 -\defineactivetoken 197 {\mathematics{\approx}} % Added by V.F. 07/02/2003 -\defineactivetoken 198 {\mathematics{\Delta}} % Added by V.F. 07/02/2003 -\defineactivetoken 214 {\textdiv} % Added by V.F. 07/02/2003 - -\stopregime - -\endinput diff --git a/tex/context/base/regi-def.mkii b/tex/context/base/regi-def.mkii new file mode 100644 index 000000000..e26709c77 --- /dev/null +++ b/tex/context/base/regi-def.mkii @@ -0,0 +1,21 @@ +%D \module +%D [ file=regi-def, +%D version=2000.20.12, % split from less verbose base file +%D title=\CONTEXT\ Regime Macros, +%D subtitle=Default Character Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=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. + +\startregime[default] + +\dostepwiserecurse{128}{255}{1} + {\expanded{\defineactivetoken\recurselevel\space{\rawcharacter\recurselevel}}}% + +\stopregime + +\endinput diff --git a/tex/context/base/regi-def.tex b/tex/context/base/regi-def.tex deleted file mode 100644 index e26709c77..000000000 --- a/tex/context/base/regi-def.tex +++ /dev/null @@ -1,21 +0,0 @@ -%D \module -%D [ file=regi-def, -%D version=2000.20.12, % split from less verbose base file -%D title=\CONTEXT\ Regime Macros, -%D subtitle=Default Character Definitions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=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. - -\startregime[default] - -\dostepwiserecurse{128}{255}{1} - {\expanded{\defineactivetoken\recurselevel\space{\rawcharacter\recurselevel}}}% - -\stopregime - -\endinput diff --git a/tex/context/base/regi-ibm.mkii b/tex/context/base/regi-ibm.mkii new file mode 100644 index 000000000..1fad9545a --- /dev/null +++ b/tex/context/base/regi-ibm.mkii @@ -0,0 +1,73 @@ +%D \module +%D [ file=regi-ibm, +%D version=1995.01.01, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=The Good Old MSDOS IBM codepage, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module activates the \cap{IBM PC} high \ASCII\ +%D characters, such as and . + +\startregime [ibm] + +\defineactivetoken 145 {\aeligature} % +\defineactivetoken 146 {\AEligature} % +\defineactivetoken 152 {\ijligature} % + +\defineactivetoken 225 {\ssharp} % + +\defineactivetoken 160 {\aacute} % +\defineactivetoken 130 {\eacute} % +\defineactivetoken 144 {\Eacute} % +\defineactivetoken 161 {\iacute} % +\defineactivetoken 162 {\oacute} % +\defineactivetoken 163 {\uacute} % + +\defineactivetoken 135 {\ccedilla} % +\defineactivetoken 128 {\Ccedilla} % + +\defineactivetoken 132 {\adiaeresis} % +\defineactivetoken 142 {\Adiaeresis} % +\defineactivetoken 137 {\ediaeresis} % +\defineactivetoken 139 {\idiaeresis} % +\defineactivetoken 148 {\odiaeresis} % +\defineactivetoken 153 {\Odiaeresis} % +\defineactivetoken 129 {\udiaeresis} % +\defineactivetoken 154 {\Udiaeresis} % + +\defineactivetoken 164 {\ntilde} % +\defineactivetoken 165 {\Ntilde} % + +\defineactivetoken 134 {\aring} % +\defineactivetoken 143 {\Aring} % + +\defineactivetoken 131 {\acircumflex} % +\defineactivetoken 136 {\ecircumflex} % +\defineactivetoken 140 {\icircumflex} % +\defineactivetoken 147 {\ocircumflex} % +\defineactivetoken 150 {\ucircumflex} % + +\defineactivetoken 133 {\agrave} % +\defineactivetoken 138 {\egrave} % +\defineactivetoken 141 {\igrave} % +\defineactivetoken 149 {\ograve} % +\defineactivetoken 151 {\ugrave} % + +\stopregime + +% todo + +\startregime [ibm] + +\defineactivetoken {\ifvmode\leavevmode\fi\leftguillemot\prewordbreak} +\defineactivetoken {\prewordbreak\rightguillemot} + +\stopregime + +\endinput diff --git a/tex/context/base/regi-ibm.tex b/tex/context/base/regi-ibm.tex deleted file mode 100644 index 1fad9545a..000000000 --- a/tex/context/base/regi-ibm.tex +++ /dev/null @@ -1,73 +0,0 @@ -%D \module -%D [ file=regi-ibm, -%D version=1995.01.01, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=The Good Old MSDOS IBM codepage, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module activates the \cap{IBM PC} high \ASCII\ -%D characters, such as and . - -\startregime [ibm] - -\defineactivetoken 145 {\aeligature} % -\defineactivetoken 146 {\AEligature} % -\defineactivetoken 152 {\ijligature} % - -\defineactivetoken 225 {\ssharp} % - -\defineactivetoken 160 {\aacute} % -\defineactivetoken 130 {\eacute} % -\defineactivetoken 144 {\Eacute} % -\defineactivetoken 161 {\iacute} % -\defineactivetoken 162 {\oacute} % -\defineactivetoken 163 {\uacute} % - -\defineactivetoken 135 {\ccedilla} % -\defineactivetoken 128 {\Ccedilla} % - -\defineactivetoken 132 {\adiaeresis} % -\defineactivetoken 142 {\Adiaeresis} % -\defineactivetoken 137 {\ediaeresis} % -\defineactivetoken 139 {\idiaeresis} % -\defineactivetoken 148 {\odiaeresis} % -\defineactivetoken 153 {\Odiaeresis} % -\defineactivetoken 129 {\udiaeresis} % -\defineactivetoken 154 {\Udiaeresis} % - -\defineactivetoken 164 {\ntilde} % -\defineactivetoken 165 {\Ntilde} % - -\defineactivetoken 134 {\aring} % -\defineactivetoken 143 {\Aring} % - -\defineactivetoken 131 {\acircumflex} % -\defineactivetoken 136 {\ecircumflex} % -\defineactivetoken 140 {\icircumflex} % -\defineactivetoken 147 {\ocircumflex} % -\defineactivetoken 150 {\ucircumflex} % - -\defineactivetoken 133 {\agrave} % -\defineactivetoken 138 {\egrave} % -\defineactivetoken 141 {\igrave} % -\defineactivetoken 149 {\ograve} % -\defineactivetoken 151 {\ugrave} % - -\stopregime - -% todo - -\startregime [ibm] - -\defineactivetoken {\ifvmode\leavevmode\fi\leftguillemot\prewordbreak} -\defineactivetoken {\prewordbreak\rightguillemot} - -\stopregime - -\endinput diff --git a/tex/context/base/regi-ini.mkii b/tex/context/base/regi-ini.mkii index 9ba567145..3cdfe2763 100644 --- a/tex/context/base/regi-ini.mkii +++ b/tex/context/base/regi-ini.mkii @@ -150,7 +150,7 @@ {\letgvalue{\c!file\f!regimeprefix#1}\empty \makeshortfilename[\truefilename{\f!regimeprefix#1}]% \startreadingfile - \readsysfile\shortfilename + \readsysfile{\shortfilename.mkii} {\showmessage\m!regimes2{#1}} {\showmessage\m!regimes3{#1}}% \stopreadingfile}} @@ -199,6 +199,24 @@ \catcode#1=#2\relax \fi} +%D Goodie: + +\def\showregime[#1]% + {\doifnot{#1}{utf} + {\bgroup + \enableregime[#1]% + \starttabulate[|l|l|l|] + \dostepwiserecurse{128}{255}{1} + {\expanded + {\scantokens + {\NC \recurselevel + \NC \rawcharacter\recurselevel + \NC \noexpand\tttf + \noexpand\meaning\rawcharacter\recurselevel \NC \NR}}}% + \stoptabulate + \unskip + \egroup}} + %D Sort related: \def\dowalkregime#1% diff --git a/tex/context/base/regi-mac.mkii b/tex/context/base/regi-mac.mkii new file mode 100644 index 000000000..b3c281ec0 --- /dev/null +++ b/tex/context/base/regi-mac.mkii @@ -0,0 +1,147 @@ +%D \module +%D [ file=regi-mac, +%D version=2001.03.18, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Mac Encoding, +%D author={Michel Bovani \& Adam Lindsay \& Hans Hagen}, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\startregime [mac] + +\defineactivetoken 128 {\Adiaeresis} +\defineactivetoken 129 {\Aring} +\defineactivetoken 130 {\Ccedilla} +\defineactivetoken 131 {\Eacute} +\defineactivetoken 132 {\Ntilde} +\defineactivetoken 133 {\Odiaeresis} +\defineactivetoken 134 {\Udiaeresis} +\defineactivetoken 135 {\aacute} +\defineactivetoken 136 {\agrave} +\defineactivetoken 137 {\acircumflex} +\defineactivetoken 138 {\adiaeresis} +\defineactivetoken 139 {\atilde} +\defineactivetoken 140 {\aring} +\defineactivetoken 141 {\ccedilla} +\defineactivetoken 142 {\eacute} +\defineactivetoken 143 {\egrave} +\defineactivetoken 144 {\ecircumflex} +\defineactivetoken 145 {\ediaeresis} +\defineactivetoken 146 {\iacute} +\defineactivetoken 147 {\igrave} +\defineactivetoken 148 {\icircumflex} +\defineactivetoken 149 {\idiaeresis} +\defineactivetoken 150 {\ntilde} +\defineactivetoken 151 {\oacute} +\defineactivetoken 152 {\ograve} +\defineactivetoken 153 {\ocircumflex} +\defineactivetoken 154 {\odiaeresis} +\defineactivetoken 155 {\otilde} +\defineactivetoken 156 {\uacute} +\defineactivetoken 157 {\ugrave} +\defineactivetoken 158 {\ucircumflex} +\defineactivetoken 159 {\udiaeresis} +\defineactivetoken 160 {\textdag} +\defineactivetoken 161 {\textdegree} +\defineactivetoken 162 {\textcent} +\defineactivetoken 163 {\textsterling} +\defineactivetoken 164 {\sectionmark} +\defineactivetoken 165 {\textbullet} +\defineactivetoken 166 {\paragraphmark} +\defineactivetoken 167 {\ssharp} +\defineactivetoken 168 {\registered} +\defineactivetoken 169 {\copyright} +\defineactivetoken 170 {\trademark} +\defineactivetoken 171 {\textacute} +\defineactivetoken 172 {\textdiaeresis} +\defineactivetoken 173 {\mathematics\neq} +\defineactivetoken 174 {\AEligature} +\defineactivetoken 175 {\Ostroke} +\defineactivetoken 176 {\mathematics\infty} +\defineactivetoken 177 {\textpm} +\defineactivetoken 178 {\mathematics\leq} +\defineactivetoken 179 {\mathematics\geq} +\defineactivetoken 180 {\textyen} +\defineactivetoken 181 {\textmu} +\defineactivetoken 182 {\mathematics\partial} +\defineactivetoken 183 {\mathematics\Sigma} +\defineactivetoken 184 {\mathematics\Pi} +\defineactivetoken 185 {\mathematics\pi} +\defineactivetoken 186 {\mathematics\smallint} +\defineactivetoken 187 {\ordfeminine} +\defineactivetoken 188 {\ordmasculine} +\defineactivetoken 189 {\mathematics\Omega} +\defineactivetoken 190 {\aeligature} +\defineactivetoken 191 {\ostroke} +\defineactivetoken 192 {\questiondown} +\defineactivetoken 193 {\exclamdown} +\defineactivetoken 194 {\textlognot} +\defineactivetoken 195 {\mathematics{\sqrt{}}} +\defineactivetoken 196 {\textflorin} +\defineactivetoken 197 {\mathematics\approx} +\defineactivetoken 198 {\mathematics\Delta} +\defineactivetoken 199 {\leftguillemot} +\defineactivetoken 200 {\rightguillemot} +\defineactivetoken 201 {\dots} +\defineactivetoken 202 {\nonbreakablespace} +\defineactivetoken 203 {\Agrave} +\defineactivetoken 204 {\Atilde} +\defineactivetoken 205 {\Otilde} +\defineactivetoken 206 {\OEligature} +\defineactivetoken 207 {\oeligature} +\defineactivetoken 208 {\endash} +\defineactivetoken 209 {\emdash} +\defineactivetoken 210 {\quotedblleft} +\defineactivetoken 211 {\quotedblright} +\defineactivetoken 212 {\quoteleft} +\defineactivetoken 213 {\quoteright} +\defineactivetoken 214 {\textdiv} +\defineactivetoken 215 {\mathematics\diamond} +\defineactivetoken 216 {\ydiaeresis} +\defineactivetoken 217 {\Ydiaeresis} +\defineactivetoken 218 {\textfraction} +\defineactivetoken 219 {\texteuro} +\defineactivetoken 220 {\guilsingleleft} +\defineactivetoken 221 {\guilsingleright} +\defineactivetoken 222 {fi} +\defineactivetoken 223 {fl} +\defineactivetoken 224 {\textddag} +\defineactivetoken 225 {\periodcentered} +\defineactivetoken 226 {\quotesinglebase} +\defineactivetoken 227 {\quotedblbase } +\defineactivetoken 228 {\perthousand} +\defineactivetoken 229 {\Acircumflex} +\defineactivetoken 230 {\Ecircumflex} +\defineactivetoken 231 {\Aacute} +\defineactivetoken 232 {\Ediaeresis} +\defineactivetoken 233 {\Egrave} +\defineactivetoken 234 {\Iacute} +\defineactivetoken 235 {\Icircumflex} +\defineactivetoken 236 {\Idiaeresis} +\defineactivetoken 237 {\Igrave} +\defineactivetoken 238 {\Oacute} +\defineactivetoken 239 {\Ocircumflex} +%defineactivetoken 240 % No definition for Apple logo glyph yet. +\defineactivetoken 241 {\Ograve} +\defineactivetoken 242 {\Uacute} +\defineactivetoken 243 {\Ucircumflex} +\defineactivetoken 244 {\Ugrave} +\defineactivetoken 245 {\dotlessi} +\defineactivetoken 246 {\textcircumflex} +\defineactivetoken 247 {\texttilde} +\defineactivetoken 248 {\textmacron} +\defineactivetoken 249 {\textbreve} +\defineactivetoken 250 {\textdotaccent} +\defineactivetoken 251 {\textring} +\defineactivetoken 252 {\textcedilla} +\defineactivetoken 253 {\texthungarumlaut} +\defineactivetoken 254 {\textogonek} +\defineactivetoken 255 {\textcaron} + +\stopregime + +\endinput diff --git a/tex/context/base/regi-mac.tex b/tex/context/base/regi-mac.tex deleted file mode 100644 index b3c281ec0..000000000 --- a/tex/context/base/regi-mac.tex +++ /dev/null @@ -1,147 +0,0 @@ -%D \module -%D [ file=regi-mac, -%D version=2001.03.18, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Mac Encoding, -%D author={Michel Bovani \& Adam Lindsay \& Hans Hagen}, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\startregime [mac] - -\defineactivetoken 128 {\Adiaeresis} -\defineactivetoken 129 {\Aring} -\defineactivetoken 130 {\Ccedilla} -\defineactivetoken 131 {\Eacute} -\defineactivetoken 132 {\Ntilde} -\defineactivetoken 133 {\Odiaeresis} -\defineactivetoken 134 {\Udiaeresis} -\defineactivetoken 135 {\aacute} -\defineactivetoken 136 {\agrave} -\defineactivetoken 137 {\acircumflex} -\defineactivetoken 138 {\adiaeresis} -\defineactivetoken 139 {\atilde} -\defineactivetoken 140 {\aring} -\defineactivetoken 141 {\ccedilla} -\defineactivetoken 142 {\eacute} -\defineactivetoken 143 {\egrave} -\defineactivetoken 144 {\ecircumflex} -\defineactivetoken 145 {\ediaeresis} -\defineactivetoken 146 {\iacute} -\defineactivetoken 147 {\igrave} -\defineactivetoken 148 {\icircumflex} -\defineactivetoken 149 {\idiaeresis} -\defineactivetoken 150 {\ntilde} -\defineactivetoken 151 {\oacute} -\defineactivetoken 152 {\ograve} -\defineactivetoken 153 {\ocircumflex} -\defineactivetoken 154 {\odiaeresis} -\defineactivetoken 155 {\otilde} -\defineactivetoken 156 {\uacute} -\defineactivetoken 157 {\ugrave} -\defineactivetoken 158 {\ucircumflex} -\defineactivetoken 159 {\udiaeresis} -\defineactivetoken 160 {\textdag} -\defineactivetoken 161 {\textdegree} -\defineactivetoken 162 {\textcent} -\defineactivetoken 163 {\textsterling} -\defineactivetoken 164 {\sectionmark} -\defineactivetoken 165 {\textbullet} -\defineactivetoken 166 {\paragraphmark} -\defineactivetoken 167 {\ssharp} -\defineactivetoken 168 {\registered} -\defineactivetoken 169 {\copyright} -\defineactivetoken 170 {\trademark} -\defineactivetoken 171 {\textacute} -\defineactivetoken 172 {\textdiaeresis} -\defineactivetoken 173 {\mathematics\neq} -\defineactivetoken 174 {\AEligature} -\defineactivetoken 175 {\Ostroke} -\defineactivetoken 176 {\mathematics\infty} -\defineactivetoken 177 {\textpm} -\defineactivetoken 178 {\mathematics\leq} -\defineactivetoken 179 {\mathematics\geq} -\defineactivetoken 180 {\textyen} -\defineactivetoken 181 {\textmu} -\defineactivetoken 182 {\mathematics\partial} -\defineactivetoken 183 {\mathematics\Sigma} -\defineactivetoken 184 {\mathematics\Pi} -\defineactivetoken 185 {\mathematics\pi} -\defineactivetoken 186 {\mathematics\smallint} -\defineactivetoken 187 {\ordfeminine} -\defineactivetoken 188 {\ordmasculine} -\defineactivetoken 189 {\mathematics\Omega} -\defineactivetoken 190 {\aeligature} -\defineactivetoken 191 {\ostroke} -\defineactivetoken 192 {\questiondown} -\defineactivetoken 193 {\exclamdown} -\defineactivetoken 194 {\textlognot} -\defineactivetoken 195 {\mathematics{\sqrt{}}} -\defineactivetoken 196 {\textflorin} -\defineactivetoken 197 {\mathematics\approx} -\defineactivetoken 198 {\mathematics\Delta} -\defineactivetoken 199 {\leftguillemot} -\defineactivetoken 200 {\rightguillemot} -\defineactivetoken 201 {\dots} -\defineactivetoken 202 {\nonbreakablespace} -\defineactivetoken 203 {\Agrave} -\defineactivetoken 204 {\Atilde} -\defineactivetoken 205 {\Otilde} -\defineactivetoken 206 {\OEligature} -\defineactivetoken 207 {\oeligature} -\defineactivetoken 208 {\endash} -\defineactivetoken 209 {\emdash} -\defineactivetoken 210 {\quotedblleft} -\defineactivetoken 211 {\quotedblright} -\defineactivetoken 212 {\quoteleft} -\defineactivetoken 213 {\quoteright} -\defineactivetoken 214 {\textdiv} -\defineactivetoken 215 {\mathematics\diamond} -\defineactivetoken 216 {\ydiaeresis} -\defineactivetoken 217 {\Ydiaeresis} -\defineactivetoken 218 {\textfraction} -\defineactivetoken 219 {\texteuro} -\defineactivetoken 220 {\guilsingleleft} -\defineactivetoken 221 {\guilsingleright} -\defineactivetoken 222 {fi} -\defineactivetoken 223 {fl} -\defineactivetoken 224 {\textddag} -\defineactivetoken 225 {\periodcentered} -\defineactivetoken 226 {\quotesinglebase} -\defineactivetoken 227 {\quotedblbase } -\defineactivetoken 228 {\perthousand} -\defineactivetoken 229 {\Acircumflex} -\defineactivetoken 230 {\Ecircumflex} -\defineactivetoken 231 {\Aacute} -\defineactivetoken 232 {\Ediaeresis} -\defineactivetoken 233 {\Egrave} -\defineactivetoken 234 {\Iacute} -\defineactivetoken 235 {\Icircumflex} -\defineactivetoken 236 {\Idiaeresis} -\defineactivetoken 237 {\Igrave} -\defineactivetoken 238 {\Oacute} -\defineactivetoken 239 {\Ocircumflex} -%defineactivetoken 240 % No definition for Apple logo glyph yet. -\defineactivetoken 241 {\Ograve} -\defineactivetoken 242 {\Uacute} -\defineactivetoken 243 {\Ucircumflex} -\defineactivetoken 244 {\Ugrave} -\defineactivetoken 245 {\dotlessi} -\defineactivetoken 246 {\textcircumflex} -\defineactivetoken 247 {\texttilde} -\defineactivetoken 248 {\textmacron} -\defineactivetoken 249 {\textbreve} -\defineactivetoken 250 {\textdotaccent} -\defineactivetoken 251 {\textring} -\defineactivetoken 252 {\textcedilla} -\defineactivetoken 253 {\texthungarumlaut} -\defineactivetoken 254 {\textogonek} -\defineactivetoken 255 {\textcaron} - -\stopregime - -\endinput diff --git a/tex/context/base/regi-run.mkii b/tex/context/base/regi-run.mkii deleted file mode 100644 index 573f1803b..000000000 --- a/tex/context/base/regi-run.mkii +++ /dev/null @@ -1,32 +0,0 @@ -%D \module -%D [ file=regi-run, -%D version=2003.03.12, -%D title=\CONTEXT\ Regime Macros, -%D subtitle=Runtime Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=Hans Hagen \& Ton Otten] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\gdef\mkshowregime#1% - {\doifnot{#1}{utf} - {\bgroup - \enableregime[#1]% - \starttabulate[|l|l|l|] - \dostepwiserecurse{128}{255}{1} - {\expanded - {\scantokens - {\NC \recurselevel - \NC \rawcharacter\recurselevel - \NC \noexpand\tttf - \noexpand\meaning\rawcharacter\recurselevel \NC \NR}}}% - \stoptabulate - \unskip - \egroup}} - -\protect \endinput diff --git a/tex/context/base/regi-uni.mkii b/tex/context/base/regi-uni.mkii new file mode 100644 index 000000000..c4d9521e9 --- /dev/null +++ b/tex/context/base/regi-uni.mkii @@ -0,0 +1,24 @@ +%D \module +%D [ file=enco-uni, +%D version=1998.10.18, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=Unicode, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module activates all characters in the upper range +%D and sets them to the basic unicodehandler. Beware, this is +%D a special purpose handler (esp for chinese encodings). + +\startregime[unicode] + +\defineactivedecimals 128 to 255 as {\handleunicodeflowglyph} + +\stopregime + +\endinput diff --git a/tex/context/base/regi-uni.tex b/tex/context/base/regi-uni.tex deleted file mode 100644 index c4d9521e9..000000000 --- a/tex/context/base/regi-uni.tex +++ /dev/null @@ -1,24 +0,0 @@ -%D \module -%D [ file=enco-uni, -%D version=1998.10.18, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=Unicode, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module activates all characters in the upper range -%D and sets them to the basic unicodehandler. Beware, this is -%D a special purpose handler (esp for chinese encodings). - -\startregime[unicode] - -\defineactivedecimals 128 to 255 as {\handleunicodeflowglyph} - -\stopregime - -\endinput diff --git a/tex/context/base/regi-utf.mkii b/tex/context/base/regi-utf.mkii new file mode 100644 index 000000000..01556ab2d --- /dev/null +++ b/tex/context/base/regi-utf.mkii @@ -0,0 +1,51 @@ +%D \module +%D [ file=regi-utf, +%D version=2002.12.03, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=UTF-8, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifnum\texengine>\pdftexengine + \expandafter \endinput +\fi + +%D This regime activates the characters $>192$ and let them +%D handle \UTF\ encoded content streams. This regime runs on +%D top of the \type {unic} modules. We use an active inspector +%D instead of a active token handler because here we don't want +%D the \type {{}}. We only support this in \ETEX. + +% ÀÁÂÃÄÅàáâãäå +% ÆÇæç +% ÈÉÊËèéêë +% ÌÍÎÏÞìíîïþ +% Ðð +% Ññ +% ÒÓÔÕÖòóôõö +% Øø +% ÙÚÛÜùúû +% Ýýÿ +% ß + +\unprotect + +\startregime[utf] + +\dostepwiserecurse{192}{223}{1} + {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utftwouniglph {\recurselevel}}}} % space delimited + +\dostepwiserecurse{224}{239}{1} + {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utfthreeuniglph{\recurselevel}}}} % space delimited + +\dostepwiserecurse{240}{247}{1} + {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utffouruniglph {\recurselevel}}}} % space delimited + +\stopregime + +\protect \endinput diff --git a/tex/context/base/regi-utf.tex b/tex/context/base/regi-utf.tex deleted file mode 100644 index 5b30e85ee..000000000 --- a/tex/context/base/regi-utf.tex +++ /dev/null @@ -1,51 +0,0 @@ -%D \module -%D [ file=regi-utf, -%D version=2002.12.03, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=UTF-8, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifnum\texengine>\pdftexengine - \endinput -\fi - -%D This regime activates the characters $>192$ and let them -%D handle \UTF\ encoded content streams. This regime runs on -%D top of the \type {unic} modules. We use an active inspector -%D instead of a active token handler because here we don't want -%D the \type {{}}. We only support this in \ETEX. - -% ÀÁÂÃÄÅàáâãäå -% ÆÇæç -% ÈÉÊËèéêë -% ÌÍÎÏÞìíîïþ -% Ðð -% Ññ -% ÒÓÔÕÖòóôõö -% Øø -% ÙÚÛÜùúû -% Ýýÿ -% ß - -\unprotect - -\startregime[utf] - -\dostepwiserecurse{192}{223}{1} - {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utftwouniglph {\recurselevel}}}} % space delimited - -\dostepwiserecurse{224}{239}{1} - {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utfthreeuniglph{\recurselevel}}}} % space delimited - -\dostepwiserecurse{240}{247}{1} - {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utffouruniglph {\recurselevel}}}} % space delimited - -\stopregime - -\protect \endinput diff --git a/tex/context/base/regi-vis.mkii b/tex/context/base/regi-vis.mkii new file mode 100644 index 000000000..d1071354f --- /dev/null +++ b/tex/context/base/regi-vis.mkii @@ -0,0 +1,158 @@ +%D \module +%D [ file=regi-vis, +%D version=2005.12.26, +%D title=\CONTEXT\ Encoding Macros, +%D subtitle=viscii, +%D author=script-generated, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Support for VISCII input encoding (regime) for Vietnamese. +%D +%D Usage: +%D \type{\enableregime[vis]} + + +\startregime[viscii] + +\defineactivetoken 2 {\Abrevehook} % 1EB2 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE +\defineactivetoken 5 {\Abrevetilde} % 1EB4 LATIN CAPITAL LETTER A WITH BREVE AND TILDE +\defineactivetoken 6 {\Acircumflextilde} % 1EAA LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE +\defineactivetoken 20 {\Yhook} % 1EF6 LATIN CAPITAL LETTER Y WITH HOOK ABOVE +\defineactivetoken 25 {\Ytilde} % 1EF8 LATIN CAPITAL LETTER Y WITH TILDE +\defineactivetoken 30 {\Ydotbelow} % 1EF4 LATIN CAPITAL LETTER Y WITH DOT BELOW +\defineactivetoken 128 {\Adotbelow} % 1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW +\defineactivetoken 129 {\Abreveacute} % 1EAE LATIN CAPITAL LETTER A WITH BREVE AND ACUTE +\defineactivetoken 130 {\Abrevegrave} % 1EB0 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE +\defineactivetoken 131 {\Abrevedotbelow} % 1EB6 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW +\defineactivetoken 132 {\Acircumflexacute} % 1EA4 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE +\defineactivetoken 133 {\Acircumflexgrave} % 1EA6 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE +\defineactivetoken 134 {\Acircumflexhook} % 1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE +\defineactivetoken 135 {\Acircumflexdotbelow} % 1EAC LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW +\defineactivetoken 136 {\Etilde} % 1EBC LATIN CAPITAL LETTER E WITH TILDE +\defineactivetoken 137 {\Edotbelow} % 1EB8 LATIN CAPITAL LETTER E WITH DOT BELOW +\defineactivetoken 138 {\Ecircumflexacute} % 1EBE LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE +\defineactivetoken 139 {\Ecircumflexgrave} % 1EC0 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE +\defineactivetoken 140 {\Ecircumflexhook} % 1EC2 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE +\defineactivetoken 141 {\Ecircumflextilde} % 1EC4 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE +\defineactivetoken 142 {\Ecircumflexdotbelow} % 1EC6 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW +\defineactivetoken 143 {\Ocircumflexacute} % 1ED0 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE +\defineactivetoken 144 {\Ocircumflexgrave} % 1ED2 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE +\defineactivetoken 145 {\Ocircumflexhook} % 1ED4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE +\defineactivetoken 146 {\Ocircumflextilde} % 1ED6 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE +\defineactivetoken 147 {\Ocircumflexdotbelow} % 1ED8 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW +\defineactivetoken 148 {\Ohorndotbelow} % 1EE2 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW +\defineactivetoken 149 {\Ohornacute} % 1EDA LATIN CAPITAL LETTER O WITH HORN AND ACUTE +\defineactivetoken 150 {\Ohorngrave} % 1EDC LATIN CAPITAL LETTER O WITH HORN AND GRAVE +\defineactivetoken 151 {\Ohornhook} % 1EDE LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE +\defineactivetoken 152 {\Idotbelow} % 1ECA LATIN CAPITAL LETTER I WITH DOT BELOW +\defineactivetoken 153 {\Ohook} % 1ECE LATIN CAPITAL LETTER O WITH HOOK ABOVE +\defineactivetoken 154 {\Odotbelow} % 1ECC LATIN CAPITAL LETTER O WITH DOT BELOW +\defineactivetoken 155 {\Ihook} % 1EC8 LATIN CAPITAL LETTER I WITH HOOK ABOVE +\defineactivetoken 156 {\Uhook} % 1EE6 LATIN CAPITAL LETTER U WITH HOOK ABOVE +\defineactivetoken 157 {\Utilde} % 0168 LATIN CAPITAL LETTER U WITH TILDE +\defineactivetoken 158 {\Udotbelow} % 1EE4 LATIN CAPITAL LETTER U WITH DOT BELOW +\defineactivetoken 159 {\Ygrave} % 1EF2 LATIN CAPITAL LETTER Y WITH GRAVE +\defineactivetoken 160 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE +\defineactivetoken 161 {\abreveacute} % 1EAF LATIN SMALL LETTER A WITH BREVE AND ACUTE +\defineactivetoken 162 {\abrevegrave} % 1EB1 LATIN SMALL LETTER A WITH BREVE AND GRAVE +\defineactivetoken 163 {\abrevedotbelow} % 1EB7 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW +\defineactivetoken 164 {\acircumflexacute} % 1EA5 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE +\defineactivetoken 165 {\acircumflexgrave} % 1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE +\defineactivetoken 166 {\Acircumflexhook} % 1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE +\defineactivetoken 167 {\acircumflexdotbelow} % 1EAD LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW +\defineactivetoken 168 {\etilde} % 1EBD LATIN SMALL LETTER E WITH TILDE +\defineactivetoken 169 {\edotbelow} % 1EB9 LATIN SMALL LETTER E WITH DOT BELOW +\defineactivetoken 170 {\ecircumflexacute} % 1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE +\defineactivetoken 171 {\ecircumflexgrave} % 1EC1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE +\defineactivetoken 172 {\ecircumflexhook} % 1EC3 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE +\defineactivetoken 173 {\ecircumflextilde} % 1EC5 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE +\defineactivetoken 174 {\ecircumflexdotbelow} % 1EC7 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW +\defineactivetoken 175 {\ocircumflexacute} % 1ED1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE +\defineactivetoken 176 {\ocircumflexgrave} % 1ED3 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE +\defineactivetoken 177 {\ocircumflexhook} % 1ED5 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE +\defineactivetoken 178 {\ocircumflextilde} % 1ED7 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE +\defineactivetoken 179 {\Ohorntilde} % 1EE0 LATIN CAPITAL LETTER O WITH HORN AND TILDE +\defineactivetoken 180 {\Ohorn} % 01A0 LATIN CAPITAL LETTER O WITH HORN +\defineactivetoken 181 {\ocircumflexdotbelow} % 1ED9 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW +\defineactivetoken 182 {\ohorngrave} % 1EDD LATIN SMALL LETTER O WITH HORN AND GRAVE +\defineactivetoken 183 {\ohornhook} % 1EDF LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE +\defineactivetoken 184 {\idotbelow} % 1ECB LATIN SMALL LETTER I WITH DOT BELOW +\defineactivetoken 185 {\Uhorndotbelow} % 1EF0 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW +\defineactivetoken 186 {\Uhornacute} % 1EE8 LATIN CAPITAL LETTER U WITH HORN AND ACUTE +\defineactivetoken 187 {\Uhorngrave} % 1EEA LATIN CAPITAL LETTER U WITH HORN AND GRAVE +\defineactivetoken 188 {\Uhornhook} % 1EEC LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE +\defineactivetoken 189 {\ohorn} % 01A1 LATIN SMALL LETTER O WITH HORN +\defineactivetoken 190 {\ohornacute} % 1EDB LATIN SMALL LETTER O WITH HORN AND ACUTE +\defineactivetoken 191 {\Uhorn} % 01AF LATIN CAPITAL LETTER U WITH HORN +\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE +\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE +\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE +\defineactivetoken 196 {\Ahook} % 1EA2 LATIN CAPITAL LETTER A WITH HOOK ABOVE +\defineactivetoken 197 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE +\defineactivetoken 198 {\abrevehook} % 1EB3 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE +\defineactivetoken 199 {\abrevetilde} % 1EB5 LATIN SMALL LETTER A WITH BREVE AND TILDE +\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE +\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE +\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX +\defineactivetoken 203 {\Ehook} % 1EBA LATIN CAPITAL LETTER E WITH HOOK ABOVE +\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE +\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE +\defineactivetoken 206 {\Itilde} % 0128 LATIN CAPITAL LETTER I WITH TILDE +\defineactivetoken 207 {\ygrave} % 1EF3 LATIN SMALL LETTER Y WITH GRAVE +\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE +\defineactivetoken 209 {\uhornacute} % 1EE9 LATIN SMALL LETTER U WITH HORN AND ACUTE +\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE +\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE +\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\defineactivetoken 213 {\adotbelow} % 1EA1 LATIN SMALL LETTER A WITH DOT BELOW +\defineactivetoken 214 {\yhook} % 1EF7 LATIN SMALL LETTER Y WITH HOOK ABOVE +\defineactivetoken 215 {\uhorngrave} % 1EEB LATIN SMALL LETTER U WITH HORN AND GRAVE +\defineactivetoken 216 {\uhornhook} % 1EED LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE +\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE +\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE +\defineactivetoken 219 {\ytilde} % 1EF9 LATIN SMALL LETTER Y WITH TILDE +\defineactivetoken 220 {\ydotbelow} % 1EF5 LATIN SMALL LETTER Y WITH DOT BELOW +\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE +\defineactivetoken 222 {\ohorntilde} % 1EE1 LATIN SMALL LETTER O WITH HORN AND TILDE +\defineactivetoken 223 {\uhorn} % 01B0 LATIN SMALL LETTER U WITH HORN +\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE +\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE +\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX +\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE +\defineactivetoken 228 {\ahook} % 1EA3 LATIN SMALL LETTER A WITH HOOK ABOVE +\defineactivetoken 229 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE +\defineactivetoken 230 {\uhorntilde} % 1EEF LATIN SMALL LETTER U WITH HORN AND TILDE +\defineactivetoken 231 {\acircumflextilde} % 1EAB LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE +\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE +\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE +\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX +\defineactivetoken 235 {\ehook} % 1EBB LATIN SMALL LETTER E WITH HOOK ABOVE +\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE +\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE +\defineactivetoken 238 {\itilde} % 0129 LATIN SMALL LETTER I WITH TILDE +\defineactivetoken 239 {\ihook} % 1EC9 LATIN SMALL LETTER I WITH HOOK ABOVE +\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE +\defineactivetoken 241 {\uhorndotbelow} % 1EF1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW +\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE +\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE +\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX +\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE +\defineactivetoken 246 {\ohook} % 1ECF LATIN SMALL LETTER O WITH HOOK ABOVE +\defineactivetoken 247 {\odotbelow} % 1ECD LATIN SMALL LETTER O WITH DOT BELOW +\defineactivetoken 248 {\udotbelow} % 1EE5 LATIN SMALL LETTER U WITH DOT BELOW +\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE +\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE +\defineactivetoken 251 {\utilde} % 0169 LATIN SMALL LETTER U WITH TILDE +\defineactivetoken 252 {\uhook} % 1EE7 LATIN SMALL LETTER U WITH HOOK ABOVE +\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE +\defineactivetoken 254 {\ohorndotbelow} % 1EE3 LATIN SMALL LETTER O WITH HORN AND DOT BELOW +\defineactivetoken 255 {\Uhorntilde} % 1EEE LATIN CAPITAL LETTER U WITH HORN AND TILDE + +\stopregime + diff --git a/tex/context/base/regi-vis.tex b/tex/context/base/regi-vis.tex deleted file mode 100644 index d1071354f..000000000 --- a/tex/context/base/regi-vis.tex +++ /dev/null @@ -1,158 +0,0 @@ -%D \module -%D [ file=regi-vis, -%D version=2005.12.26, -%D title=\CONTEXT\ Encoding Macros, -%D subtitle=viscii, -%D author=script-generated, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Support for VISCII input encoding (regime) for Vietnamese. -%D -%D Usage: -%D \type{\enableregime[vis]} - - -\startregime[viscii] - -\defineactivetoken 2 {\Abrevehook} % 1EB2 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE -\defineactivetoken 5 {\Abrevetilde} % 1EB4 LATIN CAPITAL LETTER A WITH BREVE AND TILDE -\defineactivetoken 6 {\Acircumflextilde} % 1EAA LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE -\defineactivetoken 20 {\Yhook} % 1EF6 LATIN CAPITAL LETTER Y WITH HOOK ABOVE -\defineactivetoken 25 {\Ytilde} % 1EF8 LATIN CAPITAL LETTER Y WITH TILDE -\defineactivetoken 30 {\Ydotbelow} % 1EF4 LATIN CAPITAL LETTER Y WITH DOT BELOW -\defineactivetoken 128 {\Adotbelow} % 1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW -\defineactivetoken 129 {\Abreveacute} % 1EAE LATIN CAPITAL LETTER A WITH BREVE AND ACUTE -\defineactivetoken 130 {\Abrevegrave} % 1EB0 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE -\defineactivetoken 131 {\Abrevedotbelow} % 1EB6 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW -\defineactivetoken 132 {\Acircumflexacute} % 1EA4 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE -\defineactivetoken 133 {\Acircumflexgrave} % 1EA6 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE -\defineactivetoken 134 {\Acircumflexhook} % 1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE -\defineactivetoken 135 {\Acircumflexdotbelow} % 1EAC LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW -\defineactivetoken 136 {\Etilde} % 1EBC LATIN CAPITAL LETTER E WITH TILDE -\defineactivetoken 137 {\Edotbelow} % 1EB8 LATIN CAPITAL LETTER E WITH DOT BELOW -\defineactivetoken 138 {\Ecircumflexacute} % 1EBE LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE -\defineactivetoken 139 {\Ecircumflexgrave} % 1EC0 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE -\defineactivetoken 140 {\Ecircumflexhook} % 1EC2 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE -\defineactivetoken 141 {\Ecircumflextilde} % 1EC4 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE -\defineactivetoken 142 {\Ecircumflexdotbelow} % 1EC6 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW -\defineactivetoken 143 {\Ocircumflexacute} % 1ED0 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE -\defineactivetoken 144 {\Ocircumflexgrave} % 1ED2 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE -\defineactivetoken 145 {\Ocircumflexhook} % 1ED4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE -\defineactivetoken 146 {\Ocircumflextilde} % 1ED6 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE -\defineactivetoken 147 {\Ocircumflexdotbelow} % 1ED8 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW -\defineactivetoken 148 {\Ohorndotbelow} % 1EE2 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW -\defineactivetoken 149 {\Ohornacute} % 1EDA LATIN CAPITAL LETTER O WITH HORN AND ACUTE -\defineactivetoken 150 {\Ohorngrave} % 1EDC LATIN CAPITAL LETTER O WITH HORN AND GRAVE -\defineactivetoken 151 {\Ohornhook} % 1EDE LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE -\defineactivetoken 152 {\Idotbelow} % 1ECA LATIN CAPITAL LETTER I WITH DOT BELOW -\defineactivetoken 153 {\Ohook} % 1ECE LATIN CAPITAL LETTER O WITH HOOK ABOVE -\defineactivetoken 154 {\Odotbelow} % 1ECC LATIN CAPITAL LETTER O WITH DOT BELOW -\defineactivetoken 155 {\Ihook} % 1EC8 LATIN CAPITAL LETTER I WITH HOOK ABOVE -\defineactivetoken 156 {\Uhook} % 1EE6 LATIN CAPITAL LETTER U WITH HOOK ABOVE -\defineactivetoken 157 {\Utilde} % 0168 LATIN CAPITAL LETTER U WITH TILDE -\defineactivetoken 158 {\Udotbelow} % 1EE4 LATIN CAPITAL LETTER U WITH DOT BELOW -\defineactivetoken 159 {\Ygrave} % 1EF2 LATIN CAPITAL LETTER Y WITH GRAVE -\defineactivetoken 160 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE -\defineactivetoken 161 {\abreveacute} % 1EAF LATIN SMALL LETTER A WITH BREVE AND ACUTE -\defineactivetoken 162 {\abrevegrave} % 1EB1 LATIN SMALL LETTER A WITH BREVE AND GRAVE -\defineactivetoken 163 {\abrevedotbelow} % 1EB7 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW -\defineactivetoken 164 {\acircumflexacute} % 1EA5 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE -\defineactivetoken 165 {\acircumflexgrave} % 1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE -\defineactivetoken 166 {\Acircumflexhook} % 1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE -\defineactivetoken 167 {\acircumflexdotbelow} % 1EAD LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW -\defineactivetoken 168 {\etilde} % 1EBD LATIN SMALL LETTER E WITH TILDE -\defineactivetoken 169 {\edotbelow} % 1EB9 LATIN SMALL LETTER E WITH DOT BELOW -\defineactivetoken 170 {\ecircumflexacute} % 1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE -\defineactivetoken 171 {\ecircumflexgrave} % 1EC1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE -\defineactivetoken 172 {\ecircumflexhook} % 1EC3 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE -\defineactivetoken 173 {\ecircumflextilde} % 1EC5 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE -\defineactivetoken 174 {\ecircumflexdotbelow} % 1EC7 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW -\defineactivetoken 175 {\ocircumflexacute} % 1ED1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE -\defineactivetoken 176 {\ocircumflexgrave} % 1ED3 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE -\defineactivetoken 177 {\ocircumflexhook} % 1ED5 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE -\defineactivetoken 178 {\ocircumflextilde} % 1ED7 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE -\defineactivetoken 179 {\Ohorntilde} % 1EE0 LATIN CAPITAL LETTER O WITH HORN AND TILDE -\defineactivetoken 180 {\Ohorn} % 01A0 LATIN CAPITAL LETTER O WITH HORN -\defineactivetoken 181 {\ocircumflexdotbelow} % 1ED9 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW -\defineactivetoken 182 {\ohorngrave} % 1EDD LATIN SMALL LETTER O WITH HORN AND GRAVE -\defineactivetoken 183 {\ohornhook} % 1EDF LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE -\defineactivetoken 184 {\idotbelow} % 1ECB LATIN SMALL LETTER I WITH DOT BELOW -\defineactivetoken 185 {\Uhorndotbelow} % 1EF0 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW -\defineactivetoken 186 {\Uhornacute} % 1EE8 LATIN CAPITAL LETTER U WITH HORN AND ACUTE -\defineactivetoken 187 {\Uhorngrave} % 1EEA LATIN CAPITAL LETTER U WITH HORN AND GRAVE -\defineactivetoken 188 {\Uhornhook} % 1EEC LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE -\defineactivetoken 189 {\ohorn} % 01A1 LATIN SMALL LETTER O WITH HORN -\defineactivetoken 190 {\ohornacute} % 1EDB LATIN SMALL LETTER O WITH HORN AND ACUTE -\defineactivetoken 191 {\Uhorn} % 01AF LATIN CAPITAL LETTER U WITH HORN -\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE -\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE -\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE -\defineactivetoken 196 {\Ahook} % 1EA2 LATIN CAPITAL LETTER A WITH HOOK ABOVE -\defineactivetoken 197 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE -\defineactivetoken 198 {\abrevehook} % 1EB3 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE -\defineactivetoken 199 {\abrevetilde} % 1EB5 LATIN SMALL LETTER A WITH BREVE AND TILDE -\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE -\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE -\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX -\defineactivetoken 203 {\Ehook} % 1EBA LATIN CAPITAL LETTER E WITH HOOK ABOVE -\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE -\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE -\defineactivetoken 206 {\Itilde} % 0128 LATIN CAPITAL LETTER I WITH TILDE -\defineactivetoken 207 {\ygrave} % 1EF3 LATIN SMALL LETTER Y WITH GRAVE -\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE -\defineactivetoken 209 {\uhornacute} % 1EE9 LATIN SMALL LETTER U WITH HORN AND ACUTE -\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE -\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE -\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\defineactivetoken 213 {\adotbelow} % 1EA1 LATIN SMALL LETTER A WITH DOT BELOW -\defineactivetoken 214 {\yhook} % 1EF7 LATIN SMALL LETTER Y WITH HOOK ABOVE -\defineactivetoken 215 {\uhorngrave} % 1EEB LATIN SMALL LETTER U WITH HORN AND GRAVE -\defineactivetoken 216 {\uhornhook} % 1EED LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE -\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE -\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE -\defineactivetoken 219 {\ytilde} % 1EF9 LATIN SMALL LETTER Y WITH TILDE -\defineactivetoken 220 {\ydotbelow} % 1EF5 LATIN SMALL LETTER Y WITH DOT BELOW -\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE -\defineactivetoken 222 {\ohorntilde} % 1EE1 LATIN SMALL LETTER O WITH HORN AND TILDE -\defineactivetoken 223 {\uhorn} % 01B0 LATIN SMALL LETTER U WITH HORN -\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE -\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE -\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX -\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE -\defineactivetoken 228 {\ahook} % 1EA3 LATIN SMALL LETTER A WITH HOOK ABOVE -\defineactivetoken 229 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE -\defineactivetoken 230 {\uhorntilde} % 1EEF LATIN SMALL LETTER U WITH HORN AND TILDE -\defineactivetoken 231 {\acircumflextilde} % 1EAB LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE -\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE -\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE -\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX -\defineactivetoken 235 {\ehook} % 1EBB LATIN SMALL LETTER E WITH HOOK ABOVE -\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE -\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE -\defineactivetoken 238 {\itilde} % 0129 LATIN SMALL LETTER I WITH TILDE -\defineactivetoken 239 {\ihook} % 1EC9 LATIN SMALL LETTER I WITH HOOK ABOVE -\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE -\defineactivetoken 241 {\uhorndotbelow} % 1EF1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW -\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE -\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE -\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE -\defineactivetoken 246 {\ohook} % 1ECF LATIN SMALL LETTER O WITH HOOK ABOVE -\defineactivetoken 247 {\odotbelow} % 1ECD LATIN SMALL LETTER O WITH DOT BELOW -\defineactivetoken 248 {\udotbelow} % 1EE5 LATIN SMALL LETTER U WITH DOT BELOW -\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE -\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE -\defineactivetoken 251 {\utilde} % 0169 LATIN SMALL LETTER U WITH TILDE -\defineactivetoken 252 {\uhook} % 1EE7 LATIN SMALL LETTER U WITH HOOK ABOVE -\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE -\defineactivetoken 254 {\ohorndotbelow} % 1EE3 LATIN SMALL LETTER O WITH HORN AND DOT BELOW -\defineactivetoken 255 {\Uhorntilde} % 1EEE LATIN CAPITAL LETTER U WITH HORN AND TILDE - -\stopregime - diff --git a/tex/context/base/s-pre-11.tex b/tex/context/base/s-pre-11.tex new file mode 100644 index 000000000..23bf9e223 --- /dev/null +++ b/tex/context/base/s-pre-11.tex @@ -0,0 +1,220 @@ +%D \module +%D [ file=s-pre-11, +%D version=1999.08.20, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment 11, +%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. + +\setuppapersize + [S6][S6] + +\setuplayout + [topspace=0cm, + backspace=0cm, + header=0pt, + footer=0pt, + width=middle, + height=middle] + +\setupbodyfont + [14.4pt,lbr] + +\setupcolors + [state=start] + +\setupinteraction + [click=no, + display=new, + state=start] + +\setupinteractionscreen + [option=max] + +\def\SomeShape% + {\resetMPdrawing + \startMPdrawing + path p[], q[] ; pair a, b ; + StartPage ; + \stopMPdrawing + \dorecurse{\CurrentTopic} + {\startMPdrawing + initialize_box(\MPpos{topic-\realfolio-\recurselevel}) ; + p[\recurselevel] := tensecircle (wxy,hxy,.25cm) shifted cxy ; + fill p[\recurselevel] withcolor .9white ; + pickup pencircle scaled .25cm ; + \ifnum\recurselevel=\CurrentTopic\space + draw p[\recurselevel] withcolor \MPcolor{ShowColor} ; + \else + draw p[\recurselevel] withcolor \MPcolor{DoneColor} ; + \fi + \stopMPdrawing}% + \dorecurse{\CurrentMaxItem} + {\startMPdrawing + initialize_box(\MPpos{item-\realfolio-\recurselevel}) ; + linewidth := .25cm ; + q[\recurselevel] := tensecircle (wxy,hxy,linewidth) shifted cxy ; + fill q[\recurselevel] withcolor .9white ; + pickup pencircle scaled linewidth ; + \ifnum\recurselevel=\CurrentMaxItem\space + draw q[\recurselevel] withcolor \MPcolor{ShowColor} ; + \else + draw q[\recurselevel] withcolor \MPcolor{DoneColor} ; + \fi + \stopMPdrawing}% + \dostepwiserecurse{2}{\CurrentTopic}{1} + {\startMPdrawing + draw + rt point 3 of p[\recurselevel-1] -- + lft point 7 of p[\recurselevel] + withcolor \MPcolor{ArrowColor} ; + \stopMPdrawing}% + \dostepwiserecurse{2}{\CurrentMaxItem}{1} + {\startMPdrawing + draw + bot point 9 of q[\recurselevel-1] -- + top point 5 of q[\recurselevel] + withcolor \MPcolor{ArrowColor} ; + \stopMPdrawing}% + \startMPdrawing + draw Page + withpen pencircle scaled .5cm + withcolor \MPcolor{EdgeColor} ; + StopPage ; + \stopMPdrawing + \MPdrawingdonetrue + \getMPdrawing} + +\def\TitlePage#1% + {\startstandardmakeup + \setupalign[middle] + \def\\{\vfil\bfb\setupinterlinespace} + \bfd\setupinterlinespace + \vfil#1\vfil\vfil + \stopstandardmakeup} + +\definecolor[PageColor][r=.5,g=.4,b=.3] +\definecolor[LineColor][r=.7,g=.6,b=.5] + +\definecolor[PageColor] [s=.60] +\definecolor[ShowColor] [r=.40] +\definecolor[EdgeColor] [g=.40] +\definecolor[DoneColor] [r=.40,g=.40] +\definecolor[ArrowColor] [b=.40] +\definecolor[LineColor] [r=.60,g=.60] +\definecolor[GotoColor] [ArrowColor] + +\setupinteraction[color=GotoColor,contrastcolor=GotoColor] + +\defineoverlay [shape] [\SomeShape] +\defineoverlay [next] [\overlaybutton{forward}] % [{nextpage}] + +\setupbackgrounds + [page] + [background={color,next,shape}, + backgroundcolor=PageColor] + +\doglobal\newcounter\CurrentMaxItem +\doglobal\newcounter\CurrentItem +\doglobal\newcounter\CurrentTopic + +\def\StartIdea% + {\doglobal\newcounter\CurrentItem} + +\def\StartTopic% + {\doglobal\increment\CurrentTopic + \dostartbuffer[topic-\CurrentTopic][StartTopic][StopTopic]} + +\def\StopIdea% + {\dorecurse{\CurrentItem} + {\let\CurrentMaxItem\recurselevel + \doStopIdea}} + +\def\doStopIdea% + {\startstandardmakeup + \dontcomplain + \vskip.875cm + \hbox to \makeupwidth + {\hfill + \dorecurse{\CurrentTopic} + {\edef\Topic{topic-\realfolio-\recurselevel}% + \hpos + {\Topic} + {\framed + [frame=off,align=middle,offset=.25cm] + {\getbuffer[topic-\recurselevel]}}% + \ifnum\recurselevel<\CurrentTopic + \hskip.875cm + \fi}% + \hfill} + \vskip.875cm + \vfilll + \dorecurse{\CurrentMaxItem} + {\edef\Item{item-\realfolio-\recurselevel} + \hbox to \makeupwidth + {\hfill + \hpos + {\Item} + {\framed + [width=.75\makeupwidth, + frame=off, + align=middle,offset=.125cm] + {\getbuffer[item-\recurselevel]}}% + \hfill} + \vskip.875cm} + \vfilll + \stopstandardmakeup} + +\def\StartItem% + {\doglobal\increment\CurrentItem + \dostartbuffer[item-\CurrentItem][StartItem][StopItem]} + +\lefthyphenmin =\maxdimen +\righthyphenmin=\maxdimen + +\doifnotmode{demo}{\endinput} + +\starttext + +\StartIdea + \StartTopic + A Nice Idea + \StopTopic + \StartItem + \input reich \relax + \StopItem + \StartItem + \input reich \relax + \StopItem + \StartItem + \input reich \relax + \StopItem +\StopIdea + +\StartIdea + \StartTopic + One More Nice Idea + \StopTopic + \StartItem + \input reich \relax + \StopItem + \StartItem + \input reich \relax + \StopItem +\StopIdea + +\StartIdea + \StartTopic + The Last Idea + \StopTopic + \StartItem + \input tufte \relax + \StopItem +\StopIdea + +\stoptext diff --git a/tex/context/base/s-pre-12.tex b/tex/context/base/s-pre-12.tex new file mode 100644 index 000000000..722d59ced --- /dev/null +++ b/tex/context/base/s-pre-12.tex @@ -0,0 +1,226 @@ +%D \module +%D [ file=s-pre-12, +%D version=1999.08.20, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment 12, +%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. + +\setuppapersize + [S6][S6] + +\setuplayout + [topspace=0cm, + backspace=0cm, + header=0pt, + footer=0pt, + width=middle, + height=middle] + +\setupbodyfont + [14.4pt,lbr] + +\setupcolors + [state=start] + +\setupinteraction + [click=no, + display=new, + state=start] + +\setupinteractionscreen + [option=max] + +\def\SomeShape% + {\resetMPdrawing + \startMPdrawing + path p ; pair a, b ; + ahlength := .375cm ; + StartPage ; + draw Page %unitsquare + %xscaled PaperWidth yscaled PaperHeight + withpen pencircle scaled .5cm + withcolor \MPcolor{EdgeColor} ; + \stopMPdrawing + \dorecurse{\CurrentTopic} + {\startMPdrawing + initialize_box(\MPpos{topic-\realfolio-\recurselevel}) ; + p := tensecircle (wxy,hxy,.25cm) shifted cxy ; + fill p withcolor .9white ; + pickup pencircle scaled .25cm ; + \ifnum\recurselevel=\CurrentTopic + draw p withcolor \MPcolor{ShowColor} ; + a := bot point 7 of p ; + \else + draw p withcolor \MPcolor{DoneColor} ; + \fi + \stopMPdrawing} + \dorecurse{\CurrentMaxItem} + {\startMPdrawing + initialize_box(\MPpos{item-\realfolio-\recurselevel}) ; + linewidth := .25cm ; + p := tensecircle (wxy,hxy,linewidth) shifted cxy ; + fill p withcolor .9white ; + pickup pencircle scaled linewidth ; + b := rt point 3 of p ; + \ifnum\recurselevel=\CurrentMaxItem + draw p withcolor \MPcolor{ShowColor} ; + \else + draw p withcolor \MPcolor{DoneColor} ; + \fi + dxab := xpart a-xpart b ; + dyab := ypart a-ypart b ; + sign := if dyab>0 : - fi 1 ; + drawarrow + a -- + a shifted (+2linewidth-dxab/2,0) {left} .. + if abs(dyab)>4linewidth : + a shifted (-dxab/2,+sign*2linewidth) -- + b shifted (+dxab/2,-sign*2linewidth) .. + fi + {left} b shifted (-2linewidth+dxab/2,0) -- + b + withcolor \MPcolor{ArrowColor} ; + \stopMPdrawing}% + \startMPdrawing + StopPage ; + \stopMPdrawing + \MPdrawingdonetrue + \getMPdrawing} + +\definecolor[PageColor][r=.5,g=.4,b=.3] +\definecolor[LineColor][r=.7,g=.6,b=.5] + +\definecolor[PageColor] [s=.60] +\definecolor[ShowColor] [r=.40] +\definecolor[EdgeColor] [g=.40] +\definecolor[DoneColor] [r=.40,g=.40] +\definecolor[ArrowColor] [b=.40] +\definecolor[LineColor] [r=.60,g=.60] +\definecolor[GotoColor] [ArrowColor] + +\setupinteraction[color=GotoColor,contrastcolor=GotoColor] + +\defineoverlay [shape] [\SomeShape] +\defineoverlay [next] [\overlaybutton{forward}] + +\setupbackgrounds + [page] + [background={color,next,shape}, + backgroundcolor=PageColor] + +\doglobal\newcounter\CurrentItem +\doglobal\newcounter\CurrentTopic +\doglobal\newcounter\CurrentMaxItem + +\def\StartIdea% + {\doglobal\newcounter\CurrentItem} + +\def\StartTopic% + {\doglobal\increment\CurrentTopic + \dostartbuffer[topic-\CurrentTopic][StartTopic][StopTopic]} + +\def\StopIdea% + {\dorecurse{\CurrentItem} + {\let\CurrentMaxItem\recurselevel + \doStopIdea}} + +\def\IdeaWidth {.6\makeupwidth} % .5 +\def\TopicWidth{.2\makeupwidth} % .3 + +\def\doStopIdea% + {\startstandardmakeup + \dontcomplain + \vbox to \makeupheight + {\vskip.75cm \relax % \vfill + \dorecurse{\CurrentMaxItem} + {\edef\Item{item-\realfolio-\recurselevel} + \hbox to \makeupwidth + {\hskip.75cm + \hpos + {\Item} + {\framed + [width=\IdeaWidth,frame=off, + align=middle,offset=.125cm] + {\getbuffer[item-\recurselevel]}}} + \vskip.875cm} + \vfill} + \vskip-\makeupheight + \vbox to \makeupheight + {\vskip.75cm \relax + \dorecurse{\CurrentTopic} + {\edef\Topic{topic-\realfolio-\recurselevel} + \hbox to \makeupwidth + {\hfill + \hpos + {\Topic} + {\framed + [width=\TopicWidth,frame=off, + align=middle,offset=.25cm] + {\getbuffer[topic-\recurselevel]}}% + \hskip.75cm} + \vskip.875cm} + \vfill} + \stopstandardmakeup} + +\def\StartItem% + {\doglobal\increment\CurrentItem + \dostartbuffer[item-\CurrentItem][StartItem][StopItem]} + +\lefthyphenmin =\maxdimen +\righthyphenmin=\maxdimen + +\def\TitlePage#1% + {\startstandardmakeup + \setupalign[middle] + \def\\{\vfil\bfb\setupinterlinespace} + \bfd\setupinterlinespace + \vfil#1\vfil\vfil + \stopstandardmakeup} + +\endinput + +% \starttext +% +% \StartIdea +% \StartTopic +% What a topic +% \StopTopic +% \StartItem +% \input reich \relax +% \StopItem +% \StartItem +% \input reich \relax +% \StopItem +% \StartItem +% \input reich \relax +% \StopItem +% \StopIdea +% +% \StartIdea +% \StartTopic +% One More Nice Idea +% \StopTopic +% \StartItem +% \input reich \relax +% \StopItem +% \StartItem +% \input reich \relax +% \StopItem +% \StopIdea +% +% \StartIdea +% \StartTopic +% The Last Idea +% \StopTopic +% \StartItem +% \input tufte \relax +% \StopItem +% \StopIdea +% +% \stoptext diff --git a/tex/context/base/s-pre-17.tex b/tex/context/base/s-pre-17.tex new file mode 100644 index 000000000..798f30cf8 --- /dev/null +++ b/tex/context/base/s-pre-17.tex @@ -0,0 +1,399 @@ +%D \module +%D [ file=s-pre-17, +%D version=1999.08.20, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment 17, +%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. + +\setupbodyfont + [12pt,ss] + +\setupcolors + [state=start] + +\setupsystem + [random=medium] + +\setupbackgrounds + [state=repeat] + +\setupbackgrounds + [page] + [background={page,forward}] + +\setupbackgrounds + [text][text] + [background=blowup] + +\setupinteraction + [state=start, + %click=off, + color=TitleColor, + contrastcolor=TitleColor] + +\setupinteractionscreen + [option=max] + +\setuptolerance + [verytolerant,stretch] + +\definecolor [BackColor] [s=.30] +\definecolor [PageColor] [g=1] +\definecolor [FrameColor] [r=1] +\definecolor [TitleColor] [y=1] +\definecolor [ArrowColor] [b=1] + +\defineoverlay [title] [\useMPgraphic{title}] +\defineoverlay [page] [\useMPgraphic{page}] +\defineoverlay [blowup] [\overlaybutton{page(\realfolio)}] +\defineoverlay [forward] [\overlaybutton{forward}] + +\startMPpositiongraphic{mppos:connection} + path pa, pb, pc ; pair ca, cb ; + initialize_box(\MPpos{\MPvar{self}}) ; pa := pxy ; ca := cxy ; + initialize_box(\MPpos{\MPvar{prev}}) ; pb := pxy ; cb := cxy ; + pickup pencircle scaled .5pt ; + pa := pa enlarged 10pt ; + pb := pb enlarged 10pt ; + for i=1 upto 10 : + draw pa randomized 20pt withcolor \MPcolor{FrameColor} ; + endfor ; + if \MPp{\MPvar{prev}}>0 : + pair a, b, c, d ; + for i=1 upto 25 : + a := .5[ulcorner pa,urcorner pa] randomized (10pt,10pt) ; + b := .5[llcorner pb,lrcorner pb] randomized (20pt,10pt) ; + c := .5[a,b] rotatedaround(a,-25) randomized (5pt,5pt) ; + d := .5[a,b] rotatedaround(a,+25) randomized (5pt,5pt) ; + draw (a--b) withcolor \MPcolor{ArrowColor} ; + draw (d--a--c) withcolor \MPcolor{ArrowColor} ; + endfor ; + fi ; + anchor_box(\MPanchor{\MPvar{self}}) ; +\stopMPpositiongraphic + +\startuseMPgraphic{title} + pickup pencircle scaled .5pt ; + for i=1 upto 10 : + draw + fullsquare xyscaled(OverlayWidth,OverlayHeight) + enlarged 10pt randomized 20pt + withcolor \MPcolor{TitleColor} ; + endfor ; +\stopuseMPgraphic + +\startuseMPgraphic{page} + StartPage ; + pickup pencircle scaled .5pt ; + fill Page withcolor \MPcolor{BackColor} ; + for i=1 upto 20 : + draw Page enlarged -50pt randomized 50pt withcolor \MPcolor{PageColor} ; + endfor ; + StopPage ; +\stopuseMPgraphic + +\def\StartText% + {\bgroup + \getrandomdimen\scratchdimen{250pt}{350pt}% + \edef\TextWidth{\the\scratchdimen}% + \setbox\scratchbox=\hbox\bgroup + \hsize\TextWidth + \setupframedtexts + [before=,after=, + width=fit,align=right, % normal, + frame=off,foregroundcolor=white]% + \framedtext\bgroup} + +\def\BlowX{450pt} % \def\BlowX{600pt} +\def\BlowY{300pt} % \def\BlowY{450pt} +\def\BlowV {50pt} % \def\BlowV{100pt} +\def\BlowH {75pt} % \def\BlowH{100pt} +\def\BackO {50pt} % \def\BackO {50pt} + +\def\StopText% + {\egroup\egroup + \doglobal\increment\CurrentBlaBla + \let\PrevBlaBla\CurrentBlaBla \doglobal\decrement\PrevBlaBla + \let\NextBlaBla\CurrentBlaBla \doglobal\increment\NextBlaBla + \setMPpositiongraphic + {connection:\CurrentBlaBla}% + {mppos:connection}% + {seed=\CurrentBlaBla, + prev=connection:\PrevBlaBla, + next=connection:\NextBlaBla}% + \SetBlowUp{connection:\CurrentBlaBla}\BlowX\BlowY\BlowH\BlowV + \hbox to 600pt +% {\getrandomdimen\scratchdimen{50pt}{100pt}% + {\getrandomdimen\scratchdimen{50pt}{75pt}% + \hskip0pt plus \scratchdimen minus \scratchdimen + \hpos{connection:\CurrentBlaBla}% + {\framed + [frame=off, + offset=overlay, + backgroundoffset=\BackO, + background=blowup] + {\box\scratchbox}}% +% \getrandomdimen\scratchdimen{50pt}{100pt}% + \getrandomdimen\scratchdimen{50pt}{75pt}% + \hskip0pt plus \scratchdimen minus \scratchdimen}% +% \getrandomdimen\scratchdimen{100pt}{150pt}% + \getrandomdimen\scratchdimen{75pt}{125pt}% + \vskip\scratchdimen + \egroup} + +\def\xStartText + {\bgroup + \setbox\scratchbox=\hbox\bgroup + \framed + [frame=off,foregroundcolor=white] + \bgroup} + +\def\xStopText{\StopText} + +\def\SetBlowUp#1#2#3#4#5% tag width height hoffset voffset + {\scratchdimen=\MPw{#1}% + \advance\scratchdimen-#2 % + \divide\scratchdimen by 2 + \advance\scratchdimen by \MPx{#1}\relax + \ifdim\scratchdimen<0pt \scratchdimen=0pt \fi + \ScaledPointsToBigPoints{\number\scratchdimen}\TextX + \advance\scratchdimen by #2 % + \ScaledPointsToBigPoints{\number\scratchdimen}\TextW + % + \scratchdimen=\MPh{#1}% + \advance\scratchdimen-#3 % + \divide\scratchdimen by 2 + \advance\scratchdimen\MPy{#1}\relax + \ifdim\scratchdimen<0pt \scratchdimen=0pt \fi + \ScaledPointsToBigPoints{\number\scratchdimen}\TextY + \advance\scratchdimen by #3 + \ScaledPointsToBigPoints{\number\scratchdimen}\TextH + % + \def\PDFpageviewkey{ fitr \TextX\space\TextY\space\TextW\space\TextH}% + \def\PDFpageviewwrd{ /FitR \TextX\space\TextY\space\TextW\space\TextH}% + \edef\PDFpageview{/View [\PDFpageviewwrd]}} + +\def\xSetBlowUp#1#2#3#4#5% tag width height hoffset voffset + {\scratchdimen\MPx{#1}\relax + \ifdim\scratchdimen<#4 + \ScaledPointsToBigPoints{0}\TextX + \multiply\scratchdimen 2 + \else + \advance\scratchdimen-#4 + \ScaledPointsToBigPoints{\number\scratchdimen}\TextX + \advance\scratchdimen#4 + \advance\scratchdimen#4 + \fi + \advance\scratchdimen\MPw{#1}% + \ScaledPointsToBigPoints{\number\scratchdimen}\TextW + % + \scratchdimen\MPy{#1}\relax + \ifdim\scratchdimen<#5 + \ScaledPointsToBigPoints{0}\TextY + \multiply\scratchdimen 2 + \else + \advance\scratchdimen-#5 + \ScaledPointsToBigPoints{\number\scratchdimen}\TextY + \advance\scratchdimen#5 + \advance\scratchdimen#5 + \fi + \advance\scratchdimen\MPh{#1}% + \ScaledPointsToBigPoints{\number\scratchdimen}\TextH + % + \def\PDFpageviewkey{ fitr \TextX\space\TextY\space\TextW\space\TextH}% + \def\PDFpageviewwrd{ /FitR \TextX\space\TextY\space\TextW\space\TextH}% + \edef\PDFpageview{/View [\PDFpageviewwrd]}} + +\dontcomplain + +\def\StartPage#1% + {\doStartPage{1}{#1}} + +\def\doStartPage#1#2% + {\def\StopPage{\doStopPage{#1}{#2}}% + \setbox\scratchbox=\hbox\bgroup + \valign\bgroup\ignorespaces##\vss\cr} + +\def\doStopPage#1#2% + {\cr + \egroup + \egroup + \setbox\scratchbox=\vbox + {\vskip100pt + \hbox \ifcase#1 spread 200pt \else to \wd\scratchbox \fi + {\hss + \switchtobodyfont[big]% + \bfd\setupinterlinespace + \ifcase#1\else \SetBlowUp{title:\realfolio}\BlowX\BlowY\BlowH\BlowV \fi + \hpos{title:\realfolio} + {\framed + [frame=off,align=middle, + foregroundcolor=white, + background={title,blowup}] + {#2}}% + \hss} + \vskip100pt + \box\scratchbox} + \doFlushPage} + +\def\doFlushPage + {\scratchdimen=\ht\scratchbox + \advance\scratchdimen \dp\scratchbox + \advance\scratchdimen 100pt + \edef\height{\the\scratchdimen} + \scratchdimen=\wd\scratchbox + \advance\scratchdimen 100pt + \edef\width {\the\scratchdimen} + \expanded{\definepapersize[MASTER][width=\width,height=\height]} + \setuppapersize + [MASTER][MASTER] + \setuplayout + [topspace=25pt,backspace=25pt, + width=middle,header=0pt,footer=0pt,height=middle] + \centerbox{\box\scratchbox} + \page} + +\def\StartTopic#1% + {\unskip\unskip\cr + \doglobal\increment(\CurrentBlaBla,100)% + \vbox\bgroup + \vskip100pt + \bgroup + \definecolor[FrameColor][TitleColor] + \switchtobodyfont[big] + \bfd\setupinterlinespace + \xStartText#1\xStopText + \vskip25pt + \egroup} + +\def\StopTopic% + {\vskip-\lastskip + \vskip100pt + \egroup + \ignorespaces} + +\def\TitlePage#1% + {\doStartPage{0}{\def\\{\vskip1ex\bfc\def\\{\vskip1ex\bfb}}#1} + \StopPage} + +\doifnotmode{demo}{\endinput} + +\setupoutput[pdftex] + +\starttext + +\TitlePage{About Text\\Today's Talk\\Hans Hagen} + +\StartPage{The First Page} + +\StartTopic{Some Text} + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText + \StartText \input knuth \StopText +\StopTopic + +\StartTopic{Another Text} + \StartText \input tufte \StopText + \StartText \input zapf \StopText + \StartText \input knuth \StopText +\StopTopic + +\StartTopic{Some More Text} + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText + \StartText \input tufte \StopText +\StopTopic + +\StartTopic{Some Text Agian} + \StartText \input tufte \StopText + \StartText \input zapf \StopText + \StartText \input knuth \StopText + \StartText \input tufte \StopText +\StopTopic + +\StopPage + +\StartPage{The Second Page} + +\StartTopic{Some Text} + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText +\StopTopic + +\StartTopic{Another Text} + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText +\StopTopic + +\StartTopic{Some Nice Text} + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText + \StartText \input tufte \StopText + \StartText \input tufte \StopText +\StopTopic + +\StartTopic{Some Funny Text} + \StartText \input tufte \StopText + \StartText \input knuth \StopText +\StopTopic + +\StartTopic{Quite Some Text} + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText +\StopTopic + +\StartTopic{Even More Text} + \StartText \input knuth \StopText + \StartText \input zapf \StopText + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText +\StopTopic + +\StopPage + +\StartPage{The Third Page} + +\StartTopic{Some Short Text} + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText +\StopTopic + +\StartTopic{Some Minimal Text} + \StartText \input tufte \StopText + \StartText \input zapf \StopText +\StopTopic + +\StartTopic{Some More Text} + \StartText \input tufte \StopText + \StartText \input knuth \StopText + \StartText \input zapf \StopText + \StartText \input tufte \StopText + \StartText \input tufte \StopText +\StopTopic + +\StopPage + +\stoptext diff --git a/tex/context/base/s-pre-18.tex b/tex/context/base/s-pre-18.tex new file mode 100644 index 000000000..407f30824 --- /dev/null +++ b/tex/context/base/s-pre-18.tex @@ -0,0 +1,177 @@ +%D \module +%D [ file=s-pre-18, +%D version=1999.08.20, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment 18, +%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. + + + +% output=pdftex interface=en + +% todo: met pos en dan iedere titel + +\setuppapersize + [S6][S6] + +\setupbodyfont + [loc,ppl] + +\setupcolors + [state=start] + +\definecolor [shade-1] [s=.7] +\definecolor [shade-2] [s=.1] + +\definecolor [shade-3] [s=.8] +\definecolor [shade-4] [b=.8] + +\definecolor [shade-5] [g=.6] + +\setuplayout + [topspace=1cm, + height=fit, + backspace=1cm, + width=middle, + header=0pt, + footer=0pt, + bottomdistance=1cm] + +\setupbackgrounds + [state=repeat] + +\setupbackgrounds [page] [background=page] + +\defineoverlay [page] [\useMPgraphic{page}] +\defineoverlay [text] [\useMPgraphic{text}] + +\startuseMPgraphic{page} + StartPage ; + path p ; numeric s ; pair cp ; cp := center Page ; + s := define_circular_shade(cp,cp,0,TextWidth, + \MPcolor{shade-1},\MPcolor{shade-2}) ; + fill Page withshade s ; + p := fullcircle xyscaled (TextWidth+1cm, TextHeight+1cm) shifted cp ; + s := define_circular_shade(cp,cp,0,TextWidth,\MPcolor{shade-3}, + \MPcolor{shade-4}) ; + fill p withshade s ; + StopPage +\stopuseMPgraphic + +\startuseMPgraphic{text} + StartPage ; + path p ; numeric s, t ; pair cp ; cp := center Page ; + s := define_circular_shade(cp,cp,0,TextWidth, + \MPcolor{shade-1},\MPcolor{shade-2}) ; + fill Page withshade s ; + p := llcorner Field[Text][Bottom] -- + lrcorner Field[Text][Bottom] -- + urcorner Field[Text][Text] -- + ulcorner Field[Text][Text] -- cycle ; + p := p enlarged .5cm randomized .5cm ; + t := define_circular_shade(cp,cp,0,TextWidth,\MPcolor{shade-3}, + \MPcolor{shade-4}) ; + fill p withshade t ; + + def bottom_menu_button (expr nn, rr, pp, xx, yy, ww, hh, dd) = + if (pp>0) and (rr>0) : + if nn = 1 : + p := (0,0)--(ww,hh/2)--(0,hh)--cycle ; + elseif nn = 2 : + p := (0,hh/2)--(ww,hh)--(ww,0)--cycle ; + else : + p := origin--cycle ; + fi ; + fill p randomized 2.5mm shifted (xx,yy) withshade s ; + fi ; + enddef ; + + \MPmenubuttons{bottom} + + if length \MPstring{topic} > 0 : + graphictext + \MPstring{topic} + scaled 3 + shifted ulcorner Field[Text][Text] + shifted (0,-1.5cm) + withshade s ; + fi ; + + StopPage ; +\stopuseMPgraphic + +\setupinteractionmenu + [bottom] + [state=start, + frame=off, + left=\hfill, + middle=\hskip.5cm, + width=2\bottomheight, + position=yes] + +\startinteractionmenu[bottom] + \but [previouspage] \\ + \but [nextpage] \\ +\stopinteractionmenu + +\setupinteraction + [state=start, + click=no, + color=shade-5, + contrastcolor=shade-5, + menu=on] + +\setupwhitespace + [big] + +\def\Topic#1% + {\page + \setMPtext{topic}{#1} + \vbox to 2cm{}} + +\setMPtext{topic}{} + +\def\StartTitlePage% + {\startstandardmakeup[bottomstate=none] + \setupalign[middle] + \vfill} + +\def\StopTitlePage% + {\stopstandardmakeup + \setuplayout[bottom=1.5cm] + \setupbackgrounds[page][background=text]} + +\def\TitleString#1#2% + {\indent + \startMPcode + graphictext + "#2" + scaled #1 + withdrawcolor .4white + withfillcolor .7white + withpen pencircle scaled 2pt ; + \stopMPcode + \vfill} + +\doifnotmode{demo}{\endinput} + +\starttext + +\StartTitlePage + \TitleString{8}{Welcome} + \TitleString{4}{to my favourite} + \TitleString{8}{Quotes} +\StopTitlePage + +\Topic {Douglas R. Hofstadter} \input douglas \page +\Topic {Donald E. Knuth} \input knuth \page +\Topic {Edward R. Tufte} \input tufte \page +\Topic {Hermann Zapf} \input zapf \page + +\stoptext diff --git a/tex/context/base/s-pre-19.tex b/tex/context/base/s-pre-19.tex index dc013d0b3..3715d6ac1 100644 --- a/tex/context/base/s-pre-19.tex +++ b/tex/context/base/s-pre-19.tex @@ -337,6 +337,7 @@ enddef ; A Simple Style Demo\\ Hans Hagen, August 2000} + \Topic {Douglas R. Hofstadter} \input douglas \page \Topic {Donald E. Knuth} \input knuth \page \Topic {Edward R. Tufte} \input tufte \page diff --git a/tex/context/base/s-pre-26.tex b/tex/context/base/s-pre-26.tex new file mode 100644 index 000000000..a99516960 --- /dev/null +++ b/tex/context/base/s-pre-26.tex @@ -0,0 +1,255 @@ +%D \module +%D [ file=s-pre-26, +%D version=2001.02.18, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment 26, +%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 modes: reverse + +%D This is a nice and simple style, written in februari +%D 2001. It uses a square papersize, derived from \type {S4}. +%D Because this style is meant to be used with Zapf +%D Chancery, I dedicate this style to Volker Schaa, a fan of +%D Zapf. + +\setuppapersize + [S44][S44] + +\startmode[asintended] + \definetypeface[zaphy][cg][calligraphy][chancery] + \setupbodyfont[zaphy,cg,12pt] +\stopmode + +\startnotmode[asintended] + \setupbodyfont[13pt] +\stopnotmode + +%D We use the whole page. + +\setuplayout + [backspace=0pt, + topspace=0pt, + header=0pt, + footer=0pt, + bottom=0pt, + width=middle, + height=middle] + +%D We will be very tolerant in alignment. + +\setuptolerance + [verytolerant,stretch] + +%D Of course use navigation, but we hide the in this case +%D ugly reverse video hyper spot. + +\setupinteraction + [state=start, + color=white, + contrastcolor=white, + style=\underbar, + click=no] + +%D This style looks best in a dark room, full screen. + +\setupinteractionscreen + [option=max] + +%D We use colors and remap a couple of standard colors. + +\setupcolors + [state=start] + +\definecolor[white] [s=.8] +\definecolor[red] [r=.7] +\definecolor[green] [g=.7] +\definecolor[blue] [b=.7] +\definecolor[yellow][r=.7,g=.7] + +\definecolor [PageColor][black] + +%D These colors will cyclic be assigned to \type +%D {TextColor}. + +\definecolor [TextColor 0][white] +\definecolor [TextColor 1][red] +\definecolor [TextColor 2][green] +\definecolor [TextColor 3][blue] +\definecolor [TextColor 4][yellow] + +\definecolor [TextColor] [TextColor 0] + +%D We will collect everything in a layer. + +\definelayer + [main] + [state=repeat] + +%D We have quite some overlays. + +\defineoverlay [page] [\reuseMPgraphic{page}] +\defineoverlay [text] [\useMPgraphic{text}] +\defineoverlay [next] [\overlaybutton{nextpage}] +\defineoverlay [prev] [\overlaybutton{previouspage}] +\defineoverlay [main] [\composedlayer{main}] + +%D These end up as paper, page and text backgrounds. We need +%D to locate the foreground, otherwise hyperlinks will not +%D work. + +\setupbackgrounds % otherwise in acrobat 5 rounding error + [paper] % and one pixel white line + [backgroundcolor=Pagecolor, + background=page] + +\setupbackgrounds + [page] + [background={page,prev,foreground,main}] + +\setupbackgrounds + [text] + [background=next, + backgroundoffset=-10pt] + +%D This means that clicking on the center brings you to the +%D next page, while clicking on teh page frame brings you one +%D page back. + +%D As usual, the graphics are handled by \METAPOST: + +\startuseMPgraphic{text} + path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; + color c ; c := (.7+uniformdeviate.3)*\MPcolor{TextColor} ; + p := p enlarged -1.25pt ; + filldraw p withcolor c ; + draw p withpen pencircle scaled 2.5pt withcolor .75c ; +\stopuseMPgraphic + +\startreusableMPgraphic{page} + path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; + color c ; c := \MPcolor{PageColor} ; + filldraw p enlarged 5pt withcolor c ; % bleeding +\stopreusableMPgraphic + +%D The text is typeset in a framed text. We cycle trough the +%D colors by means of a counter. This counter also determines +%D the positioning on the main layer. The width is slightly +%D random. + +\newcounter\KindOfTopic % and cycle through corners +\newdimen \TopicWidth % with randomized widths + +\defineframedtext + [TopicText] + [frame=off, + offset=10pt, + style=bold, + width=\TopicWidth, + background=text, + before=, + after=, + align=normal] + +\def\BeforeTopic + {\ifcase\KindOfTopic\relax + \TopicWidth=.7\textwidth + \definecolor[CharColor][black] + \else + \getrandomdimen\TopicWidth{.55\textwidth}{.7\textwidth} + \definecolor[CharColor][white] + \fi + \doifmode{reverse} + {\setupframedtexts[TopicText][foregroundcolor=CharColor]} + \definecolor[TextColor][TextColor \KindOfTopic] + \ifcase\KindOfTopic\relax + \setuplayer[main][x=.5\textwidth,y=.5\textheight,location=c] \or + \setuplayer[main][x=0pt, y=0pt, location=rb] \or + \setuplayer[main][x=\textwidth, y=0pt, location=lb] \or + \setuplayer[main][x=\textwidth, y=\textheight, location=lt] \or + \setuplayer[main][x=0pt, y=\textheight, location=rt] \fi} + +\def\AfterTopic + {\ifnum\KindOfTopic=4 + \gdef\KindOfTopic{1} + \else + \doglobal\increment\KindOfTopic + \fi} + +\def\StartTopic + {\BeforeTopic + \startstandardmakeup + \setlayer[main] \bgroup \startTopicText[none] + }%\setupwhitespace[big]} % generates an empty line + +\def\StopTopic + {\stopTopicText \egroup + \stopstandardmakeup + \AfterTopic} + +%D The title and colofon page are centered on the page. + +\def\StartNopic + {\doglobal\newcounter\KindOfTopic % centered at the page + \StartTopic + \bfd\setupinterlinespace + \setupinteraction[color=,contrastcolor=]% + \def\\{\blank\bfb\setupinterlinespace\def\\{\blank}}% + \raggedcenter\ignorespaces} + +\def\StopNopic + {\StopTopic} + +\let\StartTitlePage\StartNopic \let\StartColofonPage\StartNopic +\let\StopTitlePage \StopNopic \let\StopColofonPage \StopNopic + +\def\TitlePage #1{\StartTitlePage #1\StopTitlePage} +\def\ColofonPage#1{\StartColofonPage#1\StopColofonPage} + +%D We provide a minimum of title commands. + +\definehead + [Title] + [title] + +\definehead + [Subject] + [subject] + +\setuphead + [Title] + [style=\bfb, + page=, + before=, + after=\blank] + +\setuphead + [Subject] + [style=\bfa, + before=\blank, + after=\blank] + +\doifnotmode{demo}{\endinput} + +\def\Sample #1 {\input #1 \par \rightaligned{--- #1 ---}} + +\starttext + +\StartNopic The \ConTeXt\ Test Quotes \\ \currentdate \StopNopic + +\StartTopic \Sample tufte \StopTopic +\StartTopic \Sample knuth \StopTopic +\StartTopic \Sample zapf \StopTopic +\StartTopic \Sample douglas \StopTopic +\StartTopic \Sample stork \StopTopic +\StartTopic \Sample materie \StopTopic + +\StartNopic There Will Be Some More \StopNopic + +\stoptext diff --git a/tex/context/base/s-pre-27.tex b/tex/context/base/s-pre-27.tex new file mode 100644 index 000000000..eda75e8f4 --- /dev/null +++ b/tex/context/base/s-pre-27.tex @@ -0,0 +1,181 @@ +%D \module +%D [ file=s-pre-27, +%D version=1999.08.20, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment 27, +%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. + +\setuppapersize + [S6][S6] + +% \setupbodyfont[ppl] + +\definetypeface[main][rm][casual][informal][default] +\loadmapfile[original-micropress-informal.map] + +\setupbodyfont[main,10pt] + +\setuplayout + [footerdistance=20pt, + footer=40pt, + %footer=24pt, + %bottomdistance=10pt, + %bottom=12pt, + header=0pt, + backspace=20pt, + topspace=20pt, + width=middle, + height=fit] + +% \def\MainTitle#1{\setupfootertexts[\hfill#1]} +% \def\SubTitle #1{\setupbottomtexts[\hfill#1]} +% +% \MainTitle{a dull talk held at \currentdate} +% \SubTitle {welcome to whatever} +% +% \setupbottom +% [style=\ssbf, +% color=white] +% +% \setupfooter +% [style=\ssbfb, +% color=white] + +\setupfooter + [strut=no, + style=\bfb, + color=white] + +\setupinteraction + [state=start] + +\setupinteractionscreen + [option=max] + +\definecolor[white] [s=.8] +\definecolor[red] [r=.7] +\definecolor[green] [g=.7] +\definecolor[blue] [b=.7] +\definecolor[yellow][r=.7,g=.7] + +\setupcolors + [state=start] + +\defineoverlay [page] [\reuseMPgraphic{page}] +\defineoverlay [text] [\useMPgraphic {text}] +\defineoverlay [continue] [\overlaybutton {forward}] + +\setupbackgrounds + [page] + [background={page,continue}] + +\definecolor [PageColor] [red] +\definecolor [TextColor] [yellow] + +\defineframedtext + [TopicPage] + +\defineframedtext + [TopicText] + +\setupframedtexts + [TopicPage] + [width=\textwidth, + height=\textheight, + offset=overlay] + +\setupframedtexts + [TopicText] + [offset=10pt, + style=bold, % hm + width=\TopicWidth, + background=text, + align=normal] + +\setupframedtexts + [TopicPage,TopicText] + [frame=off, + depthcorrection=off, + before=, + after=] + +\newbox \TopicBox +\newcounter \KindOfTopic +\newdimen \TopicWidth + +\def\KindOfTopic{1} + +\def\StartTopic + {\getrandomdimen\TopicWidth{.5\textwidth}{.7\textwidth} + \ifcase\KindOfTopic\or + \setupframedtexts [TopicPage] [align={right,high}] \or + \setupframedtexts [TopicPage] [align={left,high}] \or + \setupframedtexts [TopicPage] [align={left,low}] \or + \setupframedtexts [TopicPage] [align={right,low}] \fi + \setbox\scratchbox=\vbox \bgroup \dontcomplain + \noindent \startTopicPage [none] + \noindent \startTopicText [none] + \setuptolerance [verytolerant,stretch]} + +\def\StopTopic% + {\stopTopicText + \stopTopicPage + \egroup + \global\setbox\TopicBox=\vbox + {\startoverlay + {\box\TopicBox} {\box\scratchbox} + \stopoverlay} + \copy\TopicBox + \ifnum\KindOfTopic=4 + \def\KindOfTopic{1} + \else + \increment\KindOfTopic + \fi + \page} + +\startuseMPgraphic{text} + path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; + color c ; c := (.7+uniformdeviate.3)*\MPcolor{TextColor} ; + p := p enlarged -1.25pt ; + fill p withcolor c ; + draw p withpen pencircle scaled 2.5pt withcolor .75c ; +\stopuseMPgraphic + +\startreusableMPgraphic{page} + path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; + color c ; c := \MPcolor{PageColor} ; + fill p withcolor c ; + draw p withpen pencircle scaled 2.5pt withcolor c ; +\stopreusableMPgraphic + +\def\StartNopic#1\StopNopic + {\setupfootertexts + [\vbox to \footerheight + {\vfill + \raggedleft + \def\\{\endgraf\tx\setstrut\strut} + \setstrut\strut\ignorespaces#1\unskip\endgraf\removedepth}] + \null \page} + +\def\TitlePage#1% + {\StartNopic#1\StopNopic} + +\setuphead[title] [style=\bfc,after=\blank] +\setuphead[subject][style=\bfa,before=\blank] + +\doifnotmode{demo}{\endinput} + +\starttext + +\TitlePage + {a dull talk held at \currentdate\\welcome to whatever} + +\dorecurse{10}{\StartTopic \input tufte \StopTopic} + +\stoptext diff --git a/tex/context/base/s-pre-61.tex b/tex/context/base/s-pre-61.tex index 216bb9a00..fa52d158a 100644 --- a/tex/context/base/s-pre-61.tex +++ b/tex/context/base/s-pre-61.tex @@ -221,7 +221,7 @@ [bottom] [text] [background=topics] -\doifnotmode{demo}{\endinput} +% \doifnotmode{demo}{\endinput} \starttext diff --git a/tex/context/base/s-pre-93.tex b/tex/context/base/s-pre-93.tex new file mode 100644 index 000000000..b67645806 --- /dev/null +++ b/tex/context/base/s-pre-93.tex @@ -0,0 +1,210 @@ +%D \module +%D [ file=s-pre-20, +%D version=2000.08.07, +%D title=\CONTEXT\ Style File, +%D subtitle=Presentation Environment 20, +%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. + +\setupbodyfont + [lbr,14.4pt] + +\setuppapersize + [S6][S6] + +\setuplayout + [topspace=0cm, + backspace=0cm, + header=0pt, + footer=0pt, + width=middle, + height=middle] + +\setupcolors + [state=start] + +\setupinteraction + [state=start, + click=no, + display=new, + color=LineColor, + contrastcolor=LineColor] + +\setupinteractionscreen + [option=max] + +\setupsystem + [random=big] % once per hour + +\startreusableMPgraphic{page} + StartPage ; + filldraw Page withcolor \MPcolor{PageColor} ; + pickup pencircle scaled (.25cm+uniformdeviate.25cm) ; + for i=1 upto 200 : + drawdot + (uniformdeviate PaperWidth,uniformdeviate PaperHeight) + withcolor \MPcolor {LineColor} ; + endfor ; + StopPage ; +\stopreusableMPgraphic + +\startuseMPgraphic{idea} + StartPage ; + path p ; + p := unitsquare xyscaled(\MPw{idea:\realfolio},\MPh{idea:\realfolio}) superellipsed .90 ; + p := p shifted \MPxy{idea:\realfolio} ; + draw p withpen pencircle scaled .500cm withcolor \MPcolor{PageColor} ; + fill p withcolor \MPcolor{\overlaycolor} ; + draw p withpen pencircle scaled .250cm withcolor \MPcolor{LineColor} ; + p := unitsquare xyscaled(\MPw{title:\realfolio},\MPh{title:\realfolio}) superellipsed .90 ; + p := p shifted \MPxy{title:\realfolio} ; + draw p withpen pencircle scaled .250cm withcolor \MPcolor{PageColor} ; + fill p withcolor \MPcolor{\overlaycolor} ; + draw p withpen pencircle scaled .125cm withcolor \MPcolor{LineColor} ; + StopPage ; +\stopuseMPgraphic + +\definecolor[PageColor][s=.50] +\definecolor[TextColor][s=.80] +\definecolor[DoneColor][s=.65] +\definecolor[LineColor][r=.7,g=.6,b=.5] + +\defineoverlay [idea] [\useMPgraphic {idea}] +\defineoverlay [page] [\reuseMPgraphic{page}] + +\setupbackgrounds + [page] + [background={page,forward}] + +\defineoverlay[forward][\overlaybutton{forward}] + +% alternatief: buffer en ander regime, zodat lokale kleuren +% kunnen worden genilled. Pos gebruiken om te positioneren. + +\definereference[thispage][page(\realfolio)] + +\newbox\firstideabox \setbox\firstideabox =\null +\newbox\secondideabox \setbox\secondideabox=\null +\newbox\thirdideabox \setbox\thirdideabox =\null + +\def\StartTopic% bottom title, top title + {\dodoublegroupempty\doStartTopic} + +\def\doStartTopic#1#2% the positions end up at each page -) + {\setbox\firstideabox= + \vbox to \makeupheight + \bgroup + \getrandomdimen\scratchdimen{.5cm}\makeupheight + \vskip 0cm plus \scratchdimen + \hbox to \makeupwidth + \bgroup + \getrandomdimen\scratchdimen{.5cm}\makeupwidth + \hskip 0cm plus \scratchdimen + \setbox\scratchbox=\hbox\bgroup\hpos{idea:\realfolio} + \bgroup + \getrandomdimen\hsize{.5\makeupwidth}{.7\makeupwidth}% + \framed + [offset=3ex,align=middle,strut=no,frame=off, + before=,after=] + \bgroup + \setupwhitespace[big]% + \doifsomething{#2}{\Title{#2}}% + \def\StopTopic{% + \egroup + \egroup + \egroup + \gotobox{\box\scratchbox}[thispage]% + \getrandomdimen\scratchdimen{.5cm}\makeupwidth + \hskip 0cm plus \scratchdimen + \egroup + \getrandomdimen\scratchdimen{.5cm}\makeupheight + \vskip 0cm plus \scratchdimen + \hbox to \makeupwidth + \bgroup + \hfill + \hpos{title:\realfolio} + {\button[offset=1.5ex,frame=off]{#1}[backward]}% + \getrandomdimen\scratchdimen{.5cm}{2.5cm}% + \hskip \scratchdimen + \egroup + \getrandomdimen\scratchdimen{.5cm}{1.5cm} + \vskip \scratchdimen + \egroup + \setbox\secondideabox=\vbox + {\framed + [offset=overlay,frame=off,background=idea,backgroundcolor=TextColor] + {\copy\firstideabox}} + \setbox\firstideabox=\vbox + {\framed + [offset=overlay,frame=off,background=idea,backgroundcolor=DoneColor] + {\LineColor\copy\firstideabox}} + \startstandardmakeup + \startoverlay + {\copy\thirdideabox } + {\copy\secondideabox} + \stopoverlay + \stopstandardmakeup + \setbox\thirdideabox=\vbox + {\startoverlay + {\copy\thirdideabox } + {\copy\firstideabox} + \stopoverlay}}} + +\long\def\TitlePage#1#2% + {\bgroup + \switchtobodyfont[32pt] + \StartTopic{#1}#2\StopTopic + \egroup} + +\def\Title#1{\midaligned{\bfb#1}\blank} + +\doifnotmode{demo}{\endinput} + +% \usemodule[pre-super] % super ellipse as well as superpositioned + +\starttext + +\setupoutput[pdftex] + +\TitlePage{August 2000}{Something Very Important} + +\StartTopic{Alpha} + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. +\StopTopic + +\StartTopic{Beta and Gamma} + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. +\StopTopic + +\StartTopic{Delta} + A simple and not too long text just to show the idea. +\StopTopic + +\StartTopic{Epsilon} + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. +\StopTopic + +\StartTopic{Zeta, Eta and Theta} + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. +\StopTopic + +\StartTopic{Omega} + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. + A simple and not too long text just to show the idea. +\StopTopic + +\stoptext diff --git a/tex/context/base/scrn-bar.mkiv b/tex/context/base/scrn-bar.mkiv new file mode 100644 index 000000000..fd274419d --- /dev/null +++ b/tex/context/base/scrn-bar.mkiv @@ -0,0 +1,398 @@ +%D \module +%D [ file=scrn-bar, % was part of scrn-int +%D version=1995.01.01, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Progress Bars, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Screen Macros / Progress Bars} + +\unprotect + +%D The code is a bit upgraded to \MKIV\ but the output is mostly the same. +%D In retrospect this shoul dhave been a module. + +% todo: replace blackrule by stupid rules + +% \setupinteraction[state=start] +% \setupsubpagenumber[state=start] +% +% \startsetups bars +% \vbox +% {\hsize 5cm +% \hbox{\interactionbar[a]}\blank +% \hbox{\interactionbar[b]}\blank +% \hbox{\interactionbar[c]}\blank +% \hbox{\interactionbar[d]}\blank +% \hbox{\interactionbar[e]}\blank +% \hbox{\interactionbar[f]}\blank +% \hbox{\interactionbar[g]}\blank +% } +% \stopsetups +% +% \setupheadertexts[\setups{bars}] +% +% \starttext +% \dorecurse{10}{test \page } +% \stoptext + +\presetlocalframed[\??ib] + +%D First the usual definition code. + +\let\currentinteractionbar\empty + +\def\setinteractionbarparameter#1#2#3{\@EA\def\csname\??ib#1#2\endcsname{#3}} +\def\letinteractionbarparameter #1#2{\@EA\let\csname\??ib#1#2\endcsname} + +\def\interactionbarparameter #1{\csname\dointeractionbarparameter{\??ib\currentinteractionbar}#1\endcsname} +\def\namedinteractionbarparameter#1#2{\csname\dointeractionbarparameter{\??ib#1}#2\endcsname} +\def\interactionbarparameterhash #1{\dointeractionbarparameterhash {\??ib\currentinteractionbar}#1} + +\def\dointeractionbarparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dointeractionbarparentparameter \csname#1\s!parent\endcsname#2\fi} +\def\dointeractionbarparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\dointeractionbarparentparameterhash\csname#1\s!parent\endcsname#2\fi} + +\def\dointeractionbarparentparameter #1#2{\ifx#1\relax\s!empty\else\dointeractionbarparameter #1#2\fi} +\def\dointeractionbarparentparameterhash#1#2{\ifx#1\relax \else\dointeractionbarparameterhash#1#2\fi} + +\def\defineinteractionbar{\dodoubleargument\dodefineinteractionbar} +\def\setupinteractionbar {\dodoubleempty \dosetupinteractionbar} +\def\interactionbar {\dodoubleempty \dointeractionbar} + +\def\dosetupinteractionbar[#1][#2]% + {\ifsecondargument + \getparameters[\??ib#1][#2]% + \else + \getparameters[\??ib][#1]% + \fi} + +\def\dodefineinteractionbar[#1][#2]% + {\getparameters + [\??ib#1]% + [\s!parent=\??ib,% +% \c!foregroundcolor=\interactionbarparameter\c!color,% +% \c!foregroundstyle=\interactionbarparameter\c!style,% + #2]} + +\def\dointeractionbar[#1][#2]% + {\iflocation + \begingroup + \doifnot{#1}\v!reset % obsolete, no caching any more + {\doifassignmentelse{#1} + {\getparameters[\??ib][#2]% + \edef\currentinteractionbar{\interactionbarparameter\c!alternative}}% + {\edef\currentinteractionbar{#1}% + \ifsecondargument\getparameters[\??ib#1][#2]\fi}% + \doif{\interactionbarparameter\c!state}\v!start + {\interactionbarparameter\c!command}}% + \endgroup + \fi} + +\newdimen\interactionbarwidth +\newdimen\interactionbarheight +\newdimen\interactionbardepth +\newdimen\interactionbardistance + +%D Interaction buttons, in fact a row of tiny buttons, are +%D typically only used for navigational purposed. The next +%D macro builds such a row based on a specification list. +%D +%D \startbuffer +%D \interactionbuttons[width=\hsize][page,PreviousJump,ExitViewer] +%D \stopbuffer +%D +%D \typebuffer +%D +%D gives +%D +%D \getbuffer +%D +%D Apart from individual entries, one can use \type{page} and +%D \type {subpage} as shortcuts to their four associated buttons. +%D The symbols are derived from the symbols linked to the +%D entries. + +\def\interactionbuttons + {\dodoubleempty\dointeractionbuttons} + +\def\dointeractionbuttons[#1][#2]% er is een verdeel macro \horizontalfractions + {\iflocation + \begingroup + % beware, is already set \let\currentinteractionbar\empty + \doif{\interactionbarparameter\c!state}\v!stop\locationfalse + \iflocation + \ifsecondargument + \let\menuparameter\interactionbarparameter + \setupinteractionbar[#1]% + \interactionbarwidth\interactionbarparameter\c!width + \ifdim\interactionbarwidth=\zeropoint + \interactionbarwidth1.5\emwidth + \fi + \doifnothing\@@ibheight{\letinteractionbarparameter\c!height\v!broad}% + \doifnothing\@@ibdepth {\letinteractionbarparameter\c!depth\!!zeropoint}%%% + \setbox2\hbox{\localframed[\??ib\currentinteractionbar][\c!background=]{\symbol[\@@iasymbolset][\v!previouspage]}}% + \!!heighta\ht2 % needed because we default to nothing + \setupinteractionbar[\c!strut=\v!no]% + \setinteractionparameter\c!width\!!zeropoint + \!!counta\zerocount % new, was 1 + \processallactionsinset + [#2] + [ \v!page=>\advance\!!counta 4, + \v!subpage=>\advance\!!counta 4, + \s!unknown=>\advance\!!counta 1]% + \ifdim\interactionbarwidth=\zeropoint + \!!widtha\dimexpr2\emwidth+\interactionbardistance\relax + \!!widthb\dimexpr\!!counta\!!widtha-\interactionbardistance\relax + \else + \!!widtha\interactionbarwidth + \!!widthb\dimexpr\!!counta\interactionbardistance-\interactionbardistance\relax + \advance\!!widtha -\!!widthb + \divide\!!widtha \!!counta + \!!widthb\interactionbarwidth + \fi + \hbox to \!!widthb + {\setnostrut + \processallactionsinset + [#2] + [ \v!page=>\interactionbargotox\v!firstpage \interactionbargotox\v!nextpage \interactionbargotox\v!previouspage \interactionbargotox\v!lastpage, + \v!subpage=>\interactionbargotox\v!firstsubpage\interactionbargotox\v!nextsubpage\interactionbargotox\v!previoussubpage\interactionbargotox\v!lastsubpage, + \s!unknown=>\interactionbargotox\commalistelement]% + \unskip}% + \else + \interactionbuttons[][#1]% + \fi + \fi + \endgroup + \fi} + +\def\interactionbargotox#1% + {\normalexpanded{\noexpand\dodocomplexbutton +% {\??ib\currentinteractionbar}% + {\??ib}% + [\c!height=\the\!!heighta,\c!width=\the\!!widtha]% + {\noexpand\symbol[\@@iasymbolset][#1]}% + [#1]}% + \hss} + +\def\interactionbara + {\iflocation + \interactionbarwidth \interactionbarparameter\c!width + \interactionbardistance\interactionbarparameter\c!distance + \interactionbarheight \interactionbarparameter\c!height + \interactionbardepth \interactionbarparameter\c!depth + \noindent\hbox to \interactionbarwidth \bgroup + \dontcomplain + \setupblackrules[\c!height=\v!max,\c!depth=\v!max]% + \!!widthb\dimexpr\interactionbarwidth-4\emwidth\relax + \processaction + [\interactionbarparameter\c!step] + [ \v!small=>\scratchcounter 20, + \v!medium=>\scratchcounter 10, + \v!big=>\scratchcounter 5, + \s!unknown=>\scratchcounter 10]% + \!!widtha\dimexpr\!!widthb/\scratchcounter\relax + \setupblackrules[\c!width=\!!widtha]% + \setbox\scratchbox\hbox to \interactionbarwidth + {\hskip2\emwidth + \setbox\scratchbox\hbox{\blackrule[\c!color=\interactionbarparameter\c!backgroundcolor]}% + \dorecurse\scratchcounter + {\hss\normalexpanded{\directgotodumbbox{\copy\scratchbox}[page(\the\numexpr\recurselevel*\lastpage/\scratchcounter\relax)]}}% + \hss + \hskip2\emwidth}% + \wd\scratchbox\zeropoint + \box \scratchbox + \setupblackrules[\c!width=\emwidth]% + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\blackrule}[\v!firstpage]}% + \hskip\emwidth + \ifnum\realpageno>\plusone + \hskip\zeropoint\!!plus\numexpr\realpageno-\plustwo\relax \s!sp\relax % cm gives overflow + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\blackrule}[\v!previouspage)]}% + \fi + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\blackrule}[page(\number\realpageno)]}% todo: \v!currentpage + \ifnum\realpageno<\lastpage\relax + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\blackrule}[\v!nextpage]}% + \hskip\zeropoint\!!plus\numexpr\lastpage-\realpageno-\plusone\relax \s!sp\relax % cm gives overflow + \fi + \hskip\emwidth + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\blackrule}[\v!lastpage]}% + \egroup + \fi} + +\def\interactionbarb + {\ifnum\lastpage>\firstpage\relax + \interactionbuttons[\v!firstpage,\v!previouspage,\v!nextpage,\v!lastpage]% + \fi} + +\def\interactionbarc + {\iflocation \ifnum\lastpage>\plusone + \interactionbarwidth\interactionbarparameter\c!width + \hbox to \interactionbarwidth + {\setupblackrules[\c!height=\interactionbarparameter\c!height,\c!depth=\interactionbarparameter\c!depth,\c!width=\emwidth]% + \scratchdimen\dimexpr(\interactionbarwidth-4\emwidth)/\numexpr\lastpage+\minusone\relax\relax + \!!widtha\numexpr\realpageno+\minusone\relax\scratchdimen + \!!widthb\numexpr\lastpage-\realpageno\relax\scratchdimen + \directgotospecbox\interactionbarparameter{\blackrule}[\v!firstpage]% + \hss + \directgotospecbox\interactionbarparameter{\blackrule[\c!width=\!!widtha]}[\v!previouspage]% + \blackrule[\c!color=\interactionbarparameter\c!contrastcolor]% + \directgotospecbox\interactionbarparameter{\blackrule[\c!width=\!!widthb]}[\v!nextpage]% + \hss + \directgotospecbox\interactionbarparameter{\blackrule}[\v!lastpage]}% + \fi \fi} + +\unexpanded\def\@@commoninteractionbargotoa#1% + {\symbol[\ifcase#1\v!previous\or\v!somewhere\or\v!next\fi]} + +\unexpanded\def\@@commoninteractionbargotob#1% + {\vrule\!!height\interactionbarheight\!!depth\interactionbardepth\!!width\!!widtha\relax} + +\unexpanded\def\@@commoninteractionbargotoc#1% + {\symbol[\ifcase#1\v!previous\or\v!somewhere\or\v!somewhere\or\v!somewhere\or\v!next\fi} + +\unexpanded\def\@@commoninteractionbargotod#1% + {\vrule \!!width\!!widtha \ifcase#1% + \!!height \interactionbarheight \!!depth \interactionbardepth \or + \!!height.5\interactionbarheight \!!depth.5\interactionbardepth \or + \!!height \interactionbarheight \!!depth \interactionbardepth \or + \!!height.5\interactionbarheight \!!depth.5\interactionbardepth \else + \!!height \interactionbarheight \!!depth \interactionbardepth \fi} + +\unexpanded\def\@@commoninteractionbarx#1% + {\doifelse{\interactionbarparameter\c!symbol}\v!yes + {\setupsymbolset[\@@iasymbolset]% + \let\dogotox\@@commoninteractionbargotoa} + {\let\dogotox\@@commoninteractionbargotob}% + \dorecurse\nofsubpages + {\scratchcounter\numexpr\recurselevel+\firstsubpage+\minusone\relax + \chardef\what + \ifnum\scratchcounter<\realpageno \zerocount \else + \ifnum\scratchcounter=\realpageno \plusone \else + \plustwo \fi\fi + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\dogotox\what}[page(\the\scratchcounter)]}% + #1}% + \unskip} + +\def\interactionbard + {\iflocation \ifnum\nofsubpages>\plusone \doif{\structurecounterparameter\s!subpage\c!state}\v!start{% + \interactionbarwidth \interactionbarparameter\c!width + \interactionbardistance\interactionbarparameter\c!distance + \interactionbarheight \interactionbarparameter\c!height + \interactionbardepth \interactionbarparameter\c!depth + \!!widtha\interactionbarwidth + \noindent\hbox{\@@commoninteractionbarx{\hskip\interactionbardistance}}% + }\fi \fi} + +\def\interactionbare + {\iflocation \ifnum\nofsubpages>\plusone \doif{\structurecounterparameter\s!subpage\c!state}\v!start{% + \begingroup + \interactionbarwidth \interactionbarparameter\c!width + \interactionbardistance\interactionbarparameter\c!distance + \interactionbarheight \interactionbarparameter\c!height + \interactionbardepth \interactionbarparameter\c!depth + \!!widthb\dimexpr\nofsubpages\interactionbardistance-\interactionbardistance\relax % (n-1) + \!!widtha\dimexpr(\interactionbarwidth-\!!widthb)/\nofsubpages\relax + \ifdim\!!widtha<\interactionbardistance + \interactionbarf + \else + \noindent\hbox to \interactionbarwidth{\@@commoninteractionbarx{\hss}\unskip}% + \fi + \endgroup + }\fi\fi} + +\def\interactionbarf + {\iflocation \ifnum\nofsubpages>\plusone \doif{\structurecounterparameter\s!subpage\c!state}\v!start{% + \interactionbarwidth \interactionbarparameter\c!width + \interactionbardistance\interactionbarparameter\c!distance + \interactionbarheight \interactionbarparameter\c!height + \interactionbardepth \interactionbarparameter\c!depth + \noindent \hbox to \interactionbarwidth \bgroup + \doloop + {\!!countc\numexpr(\nofsubpages/\recurselevel)+\plusone\relax % rounding + \!!widthb\interactionbardistance + \multiply\!!widthb \!!countc + \advance\!!widthb -\interactionbardistance + \!!widtha\interactionbarwidth + \advance\!!widtha -\!!widthb + \divide\!!widtha \!!countc + \ifdim\!!widtha<\interactionbardistance\else + \!!countb\recurselevel + \exitloop + \fi}% + \ifnum\!!countc>\plusone + % this is not that well tested + \advance\!!countc \minustwo + \!!widtha-\interactionbardistance + \!!widtha\!!countc\!!widtha + \advance\!!widtha \interactionbarwidth + \advance\!!countc \plusone + \divide\!!widtha \!!countc + \fi + \doifelse{\interactionbarparameter\c!symbol}\v!yes + {\setupsymbolset[\@@iasymbolset]% + \let\dogotox\@@commoninteractionbargotoc}% + {\let\dogotox\@@commoninteractionbargotod}% + \!!countc\numexpr\realpageno-\plustwo\relax + \!!countd\numexpr\realpageno+\plustwo\relax + \ifnum\!!countc<\plusone \!!countc\plusone \fi + \!!countf\zerocount + \dostepwiserecurse\firstsubpage\lastsubpage\plusone + {\!!doneafalse + \advance\!!countf \plusone + \ifnum\recurselevel=\firstsubpage\relax \!!doneatrue \fi + \ifnum\recurselevel=\lastsubpage \relax \!!doneatrue \fi + \chardef\what \if!!donea + \ifnum\recurselevel<\realpageno \zerocount \else + \ifnum\recurselevel>\realpageno \plustwo \else + \plusfour \fi\fi + \else \ifnum\!!countf=\!!countb + \ifnum\recurselevel<\realpageno \plusone \else + \ifnum\recurselevel>\realpageno \plusthree \else + \plustwo \fi\fi + \fi \fi + \normalexpanded{\directgotospecbox\noexpand\interactionbarparameter{\dogotox\what}[page(\recurselevel)]}% + \hss + \!!countf\zerocount}% + \unskip + \egroup + }\fi\fi} + +\def\interactionbarg + {\iflocation \ifnum\lastsubpage>\firstsubpage\relax % no test for state? + \interactionbuttons[\v!firstsubpage,\v!previoussubpage,\v!nextsubpage,\v!lastsubpage]% + \fi \fi} + +\setupinteractionbar + [\c!state=\v!start, + \c!alternative=a, + \c!symbol=\v!no, + \c!width=10\emwidth, + \c!height=.5\emwidth, + \c!depth=\zeropoint, + \c!distance=.5\emwidth, + \c!step=\v!medium, + \c!foregroundcolor=\interactionbarparameter\c!color, + \c!foregroundstyle=\interactionbarparameter\c!style, + \c!color=\@@iacolor, + \c!contrastcolor=\@@iacontrastcolor, + \c!style=, + \c!frame=\v!on, + \c!background=color, + \c!backgroundcolor=gray, + \c!samepage=\v!yes, + \c!unknownreference=\v!yes] + +\defineinteractionbar[a][\c!command=\interactionbara] +\defineinteractionbar[b][\c!command=\interactionbarb,\c!height=\v!broad] +\defineinteractionbar[c][\c!command=\interactionbarc,\c!height=\v!max,\c!depth=\v!max] +\defineinteractionbar[d][\c!command=\interactionbard,\c!width=.5\emwidth] +\defineinteractionbar[e][\c!command=\interactionbare] +\defineinteractionbar[f][\c!command=\interactionbarf] +\defineinteractionbar[g][\c!command=\interactionbarg,\c!height=\v!broad] + +\protect \endinput diff --git a/tex/context/base/scrn-but.mkiv b/tex/context/base/scrn-but.mkiv new file mode 100644 index 000000000..6beaee757 --- /dev/null +++ b/tex/context/base/scrn-but.mkiv @@ -0,0 +1,126 @@ +%D \module +%D [ file=scrn-but, % moved code +%D version=1995.01.01, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Interaction, +%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 Screen Macros / Buttons} + +\unprotect + +%D Buttons are just what their names says: things that can be +%D clicked (pushed) on. They are similar to \type{\goto}, +%D except that the text argument is not interpreted. +%D Furthermore one can apply anything to them that can be done +%D with \type{\framed}. +%D +%D \startbuffer +%D \button[width=3cm,height=1.5cm]{Exit}[ExitViewer] +%D \stopbuffer +%D +%D \typebuffer +%D +%D gives +%D +%D \getbuffer +%D +%D This command is formally specified as: +%D +%D \showsetup{button} +%D +%D The characteristics can be set with: +%D +%D \showsetup{setupbuttons} + +\def\setupbuttons + {\dodoubleargument\getparameters[\??bt]} + +\definecomplexorsimpleempty\button + +\def\complexbutton + {\docomplexbutton\??bt} + +\presetlocalframed[\??bt] + +\def\buttonparameter#1{\csname\??bt#1\endcsname} % simple version + +\long\def\docomplexbutton#1[#2]#3#4% get rid of possible space before [#4] + {\dodocomplexbutton#1[#2]{#3}#4} % #4 == [ + +\def\buttonframed{\dodoubleempty\localframed[\??bt]} % goodie + +% #3=none is obsolete, just use empty=yes + +\long\def\dodocomplexbutton#1[#2]#3[#4]% #3 can contain [] -> {#3} later + {\begingroup + \let\menuparameter\buttonparameter + \doif{\buttonparameter\c!state}\v!stop\locationfalse + \iflocation + \setlocationboxyes#1[#2]{#3}[#4]% + \fi + \endgroup} + +%D \macros +%D {overlaybutton} +%D +%D For converience we provide: +%D +%D \starttyping +%D \overlaybutton[reference] +%D \stoptyping +%D +%D This command can be used to define overlays an/or can be +%D used in the whatevertext areas, like: +%D +%D \starttyping +%D \defineoverlay[PrevPage][\overlaybutton{PrevPage}] +%D \setupbackgrounds[page][background=PrevPage] +%D \setuptexttexts[\overlaybutton{NextPage}] +%D \stoptyping +%D +%D For practical reasons, this macro accepts square brackets +%D as well as braces. + +\definecomplexorsimple\overlaybutton + +\def\simpleoverlaybutton#1% + {\complexoverlaybutton[#1]} + +\def\complexoverlaybutton[#1]% + {\iflocation + \gotobox{\overlayfakebox}[#1]% + \fi} + +\def\overlayfakebox + {\hbox + {\setbox\scratchbox\null + \wd\scratchbox\overlaywidth + \ht\scratchbox\overlayheight + \box\scratchbox}} + +%D Done. + +\setupbuttons + [\c!state=\v!start, + \c!width=\v!fit, + \c!height=\v!broad, + \c!offset=0.25em, + \c!frame=\v!on, + \c!background=, + \c!backgroundcolor=, + \c!foregroundstyle=\buttonparameter\c!style, + \c!foregroundcolor=\buttonparameter\c!color, + \c!style=\@@iastyle, + \c!color=\@@iacolor, + \c!contrastcolor=\@@iacontrastcolor, + \c!samepage=\v!yes, + \c!unknownreference=\v!yes] + +\protect \endinput diff --git a/tex/context/base/scrn-fld.mkii b/tex/context/base/scrn-fld.mkii index 60511ac2b..85e4aa738 100644 --- a/tex/context/base/scrn-fld.mkii +++ b/tex/context/base/scrn-fld.mkii @@ -1077,4 +1077,169 @@ \setupforms [\c!method=HTML] +%D Goodie: + +\def\definepushbutton % name optional setup + {\dodoubleempty\dodefinepushbutton} + +\def\dodefinepushbutton[#1][#2]% name setup + {\dododefinepushbutton{#1}{n}{push}% + \dododefinepushbutton{#1}{r}{\symbol[psym:#1:n]}% + \dododefinepushbutton{#1}{d}{\symbol[psym:#1:r]}% + \setvalue{pushbutton:#1}{\dohandlepushbutton{#1}{#2}}} + +\def\dododefinepushbutton#1#2#3% + {\doifsymboldefinedelse{psym:#1:#2}% + \donothing{\definesymbol[psym:#1:#2][{#3}]}} + +\def\definepushsymbol + {\dotripleargument\dodefinepushsymbol} + +\def\dodefinepushsymbol[#1][#2]% [#3] + {\definesymbol[psym:#1:#2]} + +\def\dopushbutton[#1][#2]% + {\executeifdefined{pushbutton:#1}\gobbleoneargument{#2}} + +\def\pushbutton + {\dodoubleargument\dopushbutton} + +\def\dohandlepushbutton#1#2#3% identifier setup script + {\bgroup + \nextsystemfield + \setupfield + [pushbutton] + [\c!frame=\v!overlay, + \c!offset=\v!overlay, + \c!clickout=#3,#2]% + \definefield + [\currentsystemfield] + [push] + [pushbutton] + [psym:#1:n,psym:#1:r,psym:#1:d]% + \fitfield + [\currentsystemfield]% + \egroup} + +% \def\do@@ampsh +% {\dodoubleargument\dodo@@ampsh} +% +% \def\dodo@@ampsh[#1][#2]#3\\% +% {\txt\pushbutton[#1][#2]\\}% +% +%\appendtoks \let\psh\do@@ampsh \to \everysetmenucommands + +\def\@@ampsh{\txt\pushbutton} + +\appendtoks \let\psh\@@ampsh \to \everysetmenucommands + +% \definepushbutton [reset] +% +% \definepushsymbol [reset] [n] [\uniqueMPgraphic{whatever}{color=green}] +% \definepushsymbol [reset] [r] [\uniqueMPgraphic{whatever}{color=white}] +% +% \startinteractionmenu[bottom] +% \psh [reset] [JS(reset_something)] \\ +% \stopinteractionmenu + +%D Another goodie: + +% \definecolor[rollover:n][red] +% \definecolor[rollover:r][green] +% \definecolor[rollover:d][blue] + +\definepalet + [rollover] + [n=red, + r=green, + d=blue] + +\newcounter\nofrollovers +\newcounter\nofrollbuttons + +\def\dorollbutton[#1][#2]#3[#4]% + {\dontleavehmode + \bgroup + \doglobal\increment\nofrollovers + \doglobal\increment\nofrollbuttons + \unexpanded\def\dosetlocationbox[##1]##2[##3]% + {\getparameters[##1][##3]% + \definecolor[rollover][rollover:##2]% + \doifelse{##2}{n}{\doifelsevalue{##1\c!alternative}\v!hidden\phantom\hbox}\hbox + {\localframed[##1] + [\c!framecolor=rollover,\c!backgroundcolor=rollover,\c!color=rollover]% + {\dolocationattributes{##1}\c!style\c!color{#3}}}}% + \iffirstargument + \ifsecondargument + \def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[#2]}% + \else + \doifassignmentelse{#1} + {\def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[#1]}} + {\def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[]}}% + \fi + \else + \def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[]}% + \fi + % todo: share symbols, tricky since different dimensions + \definesymbol[rsym:\nofrollovers:n][\setlocationbox n]% + \definesymbol[rsym:\nofrollovers:r][\setlocationbox r]% + \definesymbol[rsym:\nofrollovers:d][\setlocationbox d]% + \setupfield + [rollbutton] + [\c!frame=\v!off, + \c!offset=\v!overlay, + \c!clickout={#4}]% + \definefield + [roll:\nofrollbuttons][push][rollbutton] + [rsym:\nofrollovers:n,% + rsym:\nofrollovers:r,% + rsym:\nofrollovers:d]% + \fitfield[roll:\nofrollbuttons]% + \egroup} + +\unexpanded\def\rollbutton + {\dodoubleempty\dorollbutton} + +\def\menu@rob[#1]#2\\% + {\txt\rollbutton[\currentmenu]{\ignorespaces#2\unskip}[#1]\\}% + +\appendtoks \let\rob\menu@rob \to \everysetmenucommands + +% calls: +% {..} [JS..] +% [left] {..} [JS..] +% [a=b] {..} [JS..] +% [left] [a=b] {..} [JS..] +% +% \setupbuttons[offset=0pt,frame=off] % alternative=hidden +% +% \rollbutton {Manuals} [JS(Goto_File{show-man.pdf})] +% \rollbutton {Articles} [JS(Goto_File{show-art.pdf})] +% \rollbutton {Papers} [JS(Goto_File{show-pap.pdf})] +% \rollbutton {Presentations} [JS(Goto_File{show-pre.pdf})] +% \rollbutton {Resources} [JS(Goto_File{show-res.pdf})] +% +% \rob [JS(...)] bla bla \\ + +\unexpanded\def\overlayrollbutton + {\dodoubleargument\dooverlayrollbutton} + +\def\dooverlayrollbutton[#1][#2]% + {\bgroup + \nextsystemfield + \setupfield + [overlayrollbutton] + [\c!frame=\v!off,\c!offset=\v!overlay,\c!regionin={#1},\c!regionout={#2}]% + \definesymbol + [\currentsystemfield] + [{\framed[\c!frame=\v!off,\c!width=\overlaywidth,\c!height=\overlayheight]{}}]% + \definefield + [\currentsystemfield][push][overlayrollbutton][\currentsystemfield][\currentsystemfield]% + \fitfield[\currentsystemfield]% + \egroup} + +% \defineoverlay +% [ShowMenu] +% [{\overlayrollbutton[VideLayer{navigation}][HideLayer{navigation}]}] + \protect \endinput diff --git a/tex/context/base/scrn-fld.mkiv b/tex/context/base/scrn-fld.mkiv index 604b675c0..eef6bbe7d 100644 --- a/tex/context/base/scrn-fld.mkiv +++ b/tex/context/base/scrn-fld.mkiv @@ -11,310 +11,20 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% \appendtocommalist versus \addtocommalist -% -% * as default trigger in radiofields ? -% -% beware: weblink plugin truncates on length, while save as doesn't; -% more precise: (1) first time right string is sent, (2) -% internal string truncated, (3) second time truncated -% string is sent. - \writestatus{loading}{ConTeXt Screen Macros / Fields} -% messages - -\definemessageconstant{fields} - \unprotect %D First we hook fields into the (viewer based) layering mechanism %D (implemented as properties). -\ifx\currentlayerproperty\undefined\else \let\currentlayerproperty\empty\fi - \appendtoks - \doif\@@iafieldlayer\v!auto - {\def\@@iafieldlayer{\currentlayerproperty}}% + \doif\@@iafieldlayer\v!auto{\def\@@iafieldlayer{\currentviewerlayer}}% \to \everysetupinteraction \setupinteraction [\c!fieldlayer=\v!auto] % auto by default -%D Internal command, linked to \type{\definesymbol}. - -\def\dogetfieldsymbol#1% - {\getobject{SYM}{#1}} - -\def\dopresetfieldsymbol#1% - {\doifobjectfoundelse{SYM}{#1} - {} - {\settightobject{SYM}{#1}\hbox{\symbol[#1]}% - \flushatshipout - {\setbox0\hbox{\hskip-\maxdimen\getobject{SYM}{#1}}% - \smashbox0\box0}}} - -\def\presetfieldsymbols[#1]% slow - {\def\dopresetfieldsymbols##1% - {\processcommalist[##1]\dopresetfieldsymbol}% - \@EA\processcommalist\@EA[#1]\dopresetfieldsymbols} - -\def\definedefaultsymbols - {\definesymbol[defaultyes][$\times$]% - \definesymbol[defaultno][$\cdot$]} - -\def\resetfieldsymbol[#1]% for experimental usage only - {\resetobject{SYM}{#1}} - -%D The interface to the specials. DEFAULT NOG ANDERS - -\def\preparefieldvariables % evt \def's at the outer level (test) or \edef's here for fast testing - {\let\@@DriverFieldNumber \@@fdn - \let\@@DriverFieldStyle \@@fdstyle - \let\@@DriverFieldColor \@@fdcolor - \let\@@DriverFieldBackgroundColor\@@fdfieldbackgroundcolor - \let\@@DriverFieldFrameColor \@@fdfieldframecolor - \let\@@DriverFieldLayer \@@fdfieldlayer - \let\@@DriverFieldOption \@@fdoption - \let\@@DriverFieldAlign \@@fdalign - \let\@@DriverFieldClickIn \@@fdclickin - \let\@@DriverFieldClickOut \@@fdclickout - \let\@@DriverFieldRegionIn \@@fdregionin - \let\@@DriverFieldRegionOut \@@fdregionout - \let\@@DriverFieldAfterKey \@@fdafterkey - \let\@@DriverFieldFormat \@@fdformat - \let\@@DriverFieldValidate \@@fdvalidate - \let\@@DriverFieldCalculate \@@fdcalculate - \let\@@DriverFieldFocusIn \@@fdfocusin - \let\@@DriverFieldFocusOut \@@fdfocusout} - -% todo : remove arguments, consider DriverField a namespace - -\def\presetlinefield - {\preparefieldvariables - \dopresetlinefield - {\@@DriverFieldName} - {\@@DriverFieldWidth} - {\@@DriverFieldHeight} - {\@@DriverFieldDefault} - {\@@DriverFieldNumber} - {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor} - {\@@DriverFieldOption} - {\@@DriverFieldAlign} - {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,% - \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,% - \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}} - -\def\presettextfield - {\preparefieldvariables - \dopresettextfield - {\@@DriverFieldName} - {\@@DriverFieldWidth} - {\@@DriverFieldHeight} - {\@@DriverFieldDefault} - {\@@DriverFieldNumber} - {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor} - {\@@DriverFieldOption} - {\@@DriverFieldAlign} - {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,% - \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,% - \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}} - -\def\presetchoicefield - {\preparefieldvariables - \dopresetchoicefield - {\@@DriverFieldName} - {\@@DriverFieldWidth} - {\@@DriverFieldHeight} - {\@@DriverFieldDefault} - {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor} - {\@@DriverFieldOption} - {\@@DriverFieldValues} - {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,% - \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,% - \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}} - -\def\presetpopupfield - {\preparefieldvariables - \dopresetpopupfield - {\@@DriverFieldName} - {\@@DriverFieldWidth} - {\@@DriverFieldHeight} - {\@@DriverFieldDefault} - {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor} - {\@@DriverFieldOption} - {\@@DriverFieldValues} - {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,% - \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,% - \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}} - -\def\presetcombofield - {\preparefieldvariables - \dopresetcombofield - {\@@DriverFieldName} - {\@@DriverFieldWidth} - {\@@DriverFieldHeight} - {\@@DriverFieldDefault} - {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor} - {\@@DriverFieldOption} - {\@@DriverFieldValues} - {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,% - \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,% - \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}} - -\def\presetcheckfield - {\preparefieldvariables - \presetfieldsymbols[\@@DriverFieldValues]% - \dopresetcheckfield - {\@@DriverFieldName} - {\@@DriverFieldWidth} - {\@@DriverFieldHeight} - {\@@DriverFieldDefault} - {\@@DriverFieldOption} - {\@@DriverFieldValues} - {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,% - \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,% - \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}} - -\def\presetpushfield - {\preparefieldvariables - %\edef\@@DriverFieldValues{{\@@DriverFieldValues}}% makes sure {a,b,c} is passed - \presetfieldsymbols[\@@DriverFieldValues]% - \dopresetpushfield - {\@@DriverFieldName} - {\@@DriverFieldWidth} - {\@@DriverFieldHeight} - {\@@DriverFieldDefault} - {\@@DriverFieldOption} - {\@@DriverFieldValues} - {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,% - \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,% - \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}} - -\def\presetradiofield - {\preparefieldvariables - \presetfieldsymbols[\@@DriverFieldValues]% - \dopresetradiofield - {\@@DriverFieldName} - {\@@DriverFieldWidth} - {\@@DriverFieldHeight} - {\@@DriverFieldDefault} - {\@@DriverFieldOption} - {\@@DriverFieldRoot} - {\@@DriverFieldValues} - {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,% - \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,% - \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}} - -\def\presetradiorecord - {\preparefieldvariables - \dopresetradiorecord - {\@@DriverFieldName} - {\@@DriverFieldDefault} - {\@@DriverFieldOption} - {\@@DriverFieldKids} - {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,% - \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,% - \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}} - -\def\setfieldmodes#1#2#3% - {\xdef\@@DriverFieldMode{#1}% % 0 1 2 3 - \xdef\@@DriverFieldFree{#2}% % 0 1 - \xdef\@@DriverFieldAuto{#3}} % 0 1 - -\newevery\everysetfield\relax - -\def\doiffieldelse#1{\doifdefinedelse{fielddata#1}} - -\def\setfield#1#2#3#4#5#6#7#8#9% - {\bgroup - \doglobal\increment\numberoffields - \iftracefields - \doglobal\addtocommalist{#1}\collectedfields - \fi - \the\everysetfield - \setxvalue{fielddata#1}% kortere tag #7 needs expansion etc - {\noexpand\dosetfield{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}% - \egroup} - -\def\dosetfield#1#2#3#4#5#6#7#8#9% - {\xdef\@@DriverFieldName {#1}% - \xdef\@@DriverFieldType {#2}% - \xdef\@@DriverFieldRoot {#3}% - \xdef\@@DriverFieldParent {#4}% - \xdef\@@DriverFieldKids {#5}% - \xdef\@@DriverFieldGroup {#6}% - \setfieldmodes #7% - \bgroup - \def\par{\string\n\string\n}% - \xdef\@@DriverFieldValues {#8}% - \xdef\@@DriverFieldDefault{#9}% - \egroup} - -\def\changefield#1% - {\setfield{#1}\@@DriverFieldType\@@DriverFieldRoot\@@DriverFieldParent\@@DriverFieldKids\@@DriverFieldGroup - {\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}\@@DriverFieldValues\@@DriverFieldDefault} - -\def\getfield#1% name - {\doifundefinedelse{fielddata#1} - {\dosetfield{#1}\empty\empty\empty\empty\empty{\empty00}\empty\empty} - {\getvalue{fielddata#1}}} - -\newif\iftracefields \tracefieldsfalse - -\let\tracefields\tracefieldstrue - -\def\doshowfields[#1]% todo: tabulate van maken en runtime - {\bgroup - \switchtobodyfont[8pt,tt]% - \doifsomething{#1}{\def\collectedfields{#1}}% - \ifx\collectedfields\empty - \par specify [fieldlist] or say \type{\tracefieldstrue} first\par - \else - \def\normalizedfieldmode##1##2##3% - {\ifcase0##2 \else\sl\fi - \ifcase0##1 loner\or parent\or clone\or copy\fi}% - \def\dosetfield##1##2##3##4##5##6##7##8##9% - {##1&##2&##3&##4&##5&##6&\normalizedfieldmode##7&##8&##9\cr}% - \halign - {&##\strut\hss\quad\cr - \noalign{\hrule}% - NAME &TYPE &ROOT & - PARENT&KIDS &GROUP & - MODE &VALUES&DEFAULT\cr - \noalign{\hrule}% - \@EA\globalprocesscommalist\@EA[\collectedfields]\getfield - \noalign{\hrule}}% - \fi - \egroup} - -\def\showfields - {\dosingleempty\doshowfields} - -\def\dologfields[#1]% - {\bgroup - \immediate\openout\scratchwrite=fields.log - \doifsomething{#1}{\def\collectedfields{#1}}% - \ifx\colledtedfields\empty - \immediate\write\scratchwrite{use \tracefieldstrue}% - \else - \def\normalizedfieldmode##1##2##3% - {\edef\@@DriverFieldMode - {\ifcase##1 loner \or parent \or clone \or copy \fi - \ifcase##2 \else(done)\fi}}% - \def\dosetfield##1##2##3##4##5##6##7##8##9% - {\normalizedfieldmode##7% - \immediate\write\scratchwrite - {N=##1 / T=##2 / R=##3 / P=##4 / K=##5 / G=##6 / - M=\@@DriverFieldMode\space/ V=##8 / D=##9}}% - \processcommacommand[\collectedfields]\getfield - \fi - \immediate\closeout\scratchwrite - \egroup} - -\def\logfields - {\dosingleempty\doLogFields} - %D \starttyping %D \definefield [name] [type] [group] [values] [default] %D @@ -340,411 +50,124 @@ %D \fitfield[XXXX] %D \stoptyping -\newif\ifdefinemainfield \definemainfieldfalse +%D Internal command, linked to \type{\definesymbol}. -%D We need to keep track of cloned (related) fields and so by -%D maintaining lists of field clones. -%D -%D The first alternative used a two pass data list and was -%D implemented as follows: -%D -%D \starttyping -%D \def\getmainfieldkids#1% -%D {\let\@@DriverFieldKids\empty -%D \ifdefinemainfield -%D \definetwopasslist{fld:#1}% defined by system -%D \doloop -%D {\gettwopassdata{fld:#1}% -%D \iftwopassdatafound -%D %\addtocommalist\twopassdata\@@DriverFieldKids -%D \appendtocommalist\twopassdata\@@DriverFieldKids -%D \else -%D \exitloop -%D \fi}% -%D \fi} -%D \stoptyping -%D -%D However, the next alternative is much faster when we have -%D a field with thousands of clones, something not that -%D imaginary. -%D -%D \starttyping -%D \def\getmainfieldkids#1% -%D {\let\@@DriverFieldKids\empty -%D \ifdefinemainfield -%D \definetwopasslist{fld:#1}% runtime defined by system -%D \getnamedtwopassdatalist{fld:#1}\@@DriverFieldKids -%D \fi} -%D \stoptyping -%D -%D The data is written by file using: -%D -%D \starttyping -%D \newcounter\nofmainfieldkids -%D -%D \def\setmainfieldkid#1#2% -%D {\doglobal\increment\nofmainfieldkids -%D \savetwopassdata{fld:#1}{\nofmainfieldkids}{#2}} -%D \stoptyping -%D -%D The trade of of this mechanism is that for each cloned or -%D copied field, the uitlity file is to be read in order to -%D fetch the data. -%D -%D The next, much faster alternative uses a dedicated % -%D reference mechanism. - -\def\setmainfieldkid#1#2% - {\immediatewriteutilitycommand{\fieldreference{#1}{#2}}} - -\def\checkfieldreferences - {\startnointerference - \protectlabels - \doutilities{fieldreferences}\jobname\empty\relax\relax - \global\let\checkfieldreferences\relax - \stopnointerference} - -\def\setfieldreferences - {\def\fieldreference##1##2% - {\ifundefined{\r!widget##1}% - \setxvalue{\r!widget##1}{##2}% - \else - \edef\!!stringa{\getvalue{\r!widget##1}}% - \setxvalue{\r!widget##1}{\!!stringa,##2}% - \fi}} +\def\dogetfieldsymbol#1% + {\getobject{SYM}{#1}} -\def\resetfieldreferences - {\let\fieldreference\gobbletwoarguments} +\def\dopresetfieldsymbol#1% + {\doifobjectfoundelse{SYM}{#1} + {} + {\settightobject{SYM}{#1}\hbox{\symbol[#1]}% + \flushatshipout + {\setbox0\hbox{\hskip-\maxdimen\getobject{SYM}{#1}}% + \smashbox0\box0}}} -\def\getmainfieldkids#1% - {\checkfieldreferences - \ifdefinemainfield - \doifundefinedelse{\r!widget#1}% - {\let\@@DriverFieldKids\empty} - {\@EA\let\@EA\@@DriverFieldKids\csname\r!widget#1\endcsname}% - \else - \let\@@DriverFieldKids\empty - \fi} +\def\presetfieldsymbols[#1]% slow + {\def\dopresetfieldsymbols##1{\processcommalist[##1]\dopresetfieldsymbol}% + \@EA\processcommalist\@EA[#1]\dopresetfieldsymbols} -\resetfieldreferences +\def\definedefaultsymbols + {\definesymbol[defaultyes][$\times$]% + \definesymbol[defaultno][$\cdot$]} -%D Of course it costs a few more tokens to implement, but it's -%D worth the memory: running for instance the 2000 page -%D english examns publishing on demand document went down from -%D 1350 seconds to less than 950 on a 650 Mhz pentium. +\def\resetfieldsymbol[#1]% for experimental usage only + {\resetobject{SYM}{#1}} -\def\definefield - {\definemainfieldfalse\doquintupleempty\dodefinefield} +%D The interface to the specials. DEFAULT NOG ANDERS -\def\definemainfield - {\definemainfieldtrue \doquintupleempty\dodefinefield} +\def\typesetfield + {\ctxlua{backends.codeinjections.typesetfield("\currentfieldname", { + title = "\currentfieldname", + width = \number\dimexpr\@@fdwidth\relax, + height = \number\dimexpr\@@fdheight\relax, + align = "\@@fdalign", + length = tonumber("\@@fdn") or 0, + style = "\@@fdstyle", + color = "\@@fdcolor", + backgroundcolor = "\@@fdfieldbackgroundcolor", + framecolor = "\@@fdfieldframecolor", + layer = "\@@fdfieldlayer", + options = "\@@fdoption", + align = "\@@fdalign", + clickin = "\@@fdclickin", + clickout = "\@@fdclickout", + regionin = "\@@fdregionin", + regionout = "\@@fdregionout", + afterkey = "\@@fdafterkey", + format = "\@@fdformat", + validate = "\@@fdvalidate", + calculate = "\@@fdcalculate", + focusin = "\@@fdfocusin", + focusout = "\@@fdfocusout", + }) }} + +\unexpanded\def\definefieldset {\dodoubleargument\dodefinefieldset} +\unexpanded\def\definefield {\doquintupleempty\dodefinefield} +\unexpanded\def\definemainfield{\doquintupleempty\dodefinefield} % redundant +\unexpanded\def\definesubfield {\dotripleempty \dodefinesubfield} +\unexpanded\def\clonefield {\doquadrupleempty\doclonefield} +\unexpanded\def\copyfield {\dodoubleempty \docopyfield} +\unexpanded\def\field {\dodoubleempty \donormalfield} +\unexpanded\def\fitfield {\dodoubleempty \dofitfield} +\unexpanded\def\setupfield {\doquintupleempty\dosetupfield} +\unexpanded\def\setupfields {\doquadrupleempty\dosetupfields} -\let\collectedfields\empty -\newcounter\numberoffields -\newcounter\totalnumberoffields +% misc -\def\savenumberoffields - {\ifcase\numberoffields\relax\else - \savecurrentvalue\totalnumberoffields\numberoffields - \fi} +\appendtoks\ctxlua{backends.codeinjections.finishfields()}\to\everylastshipout -\appendtoks \savenumberoffields \to \everybye % \everylastshipout +% testing -% \def\presetfieldreferences -% {\ifnum\totalnumberoffields>0 -% \definereference[AtOpenInitializeForm][\v!ResetForm]% -% \fi} -% -% \definereference[AtOpenInitializeForm][\v!geen] -% -% \appendtoks \presetfieldreferences \to \everycheckreferences +\def\doiffieldelse #1{\ctxlua{backends.codeinjections.doiffieldelse("#1")}} +\def\doiffieldgroupelse#1{\ctxlua{backends.codeinjections.doiffieldgroupelse("#1")}} -\def\dodefinefield[#1][#2][#3][#4][#5]% - {\ifsecondargument - \edef\currentfieldname{#1}% just in case we're inside a loop - \doifundefinedelse{define#2field} - {\writestatus\m!fields{unknown field type #2}} - {\doifundefined{fielddata\currentfieldname} - {\getmainfieldkids\currentfieldname - \ifdefinemainfield - \ifx\@@DriverFieldKids\empty - \let\@@DriverFieldMode\fieldlonermode - \else - \let\@@DriverFieldMode\fieldparentmode - \fi - \def\@@DriverFieldAuto{1}% - \else - \let\@@DriverFieldMode\fieldlonermode - \def\@@DriverFieldAuto{0}% - \fi - \def\@@DriverFieldFree{0}% - \getvalue{define#2field}{\currentfieldname}{#2}{#3}{#4}{#5}}}% - \else - \writestatus\m!fields{pass fieldname and fieldtype}% - \fi} +% definition -\def\definelinefield#1#2#3#4#5% - {\setfield{#1}{#2}{}{}{\@@DriverFieldKids}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{#4}} - -\let\definetextfield=\definelinefield - -\def\definechoicefield#1#2#3#4#5% - {\doifelsenothing{#4} - {\def\@@DriverFieldValues{yes,no}} - {\def\@@DriverFieldValues{#4}}% - \doifelsenothing{#5} - {\dogetcommacommandelement2\from\@@DriverFieldValues \to\@@DriverFieldDefault - \dogetcommacommandelement1\from\@@DriverFieldDefault\to\@@DriverFieldDefault} - {\def\@@DriverFieldDefault{#5}}% - \setfield{#1}{#2}{}{}{\@@DriverFieldKids}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{\@@DriverFieldValues}{\@@DriverFieldDefault}} - -\let\definepopupfield=\definechoicefield -\let\definecombofield=\definechoicefield - -%\def\definecheckfield#1#2#3#4#5% -% {\doifelsenothing{#4} -% {\definedefaultsymbols -% \def\@@DriverFieldValues{defaultyes}} -% {\def\@@DriverFieldValues{#4}}% -% \doifelsenothing{#5} -% {\dogetcommacommandelement2\from\@@DriverFieldValues\to\@@DriverFieldDefault -% \dogetcommacommandelement1\from\@@DriverFieldDefault\to\@@DriverFieldDefault} -% {\def\@@DriverFieldDefault{#5}}% -% \setfield{#1}{#2}{}{}{\@@DriverFieldKids}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{\@@DriverFieldValues}{\@@DriverFieldDefault}} - -%D Since these fields have an on/off state only, we pass 1/0 -%D to the driver as default values. - -\def\definecheckfield#1#2#3#4#5% - {\doifelsenothing{#4} - {\definedefaultsymbols - \def\@@DriverFieldValues{defaultyes}} - {\def\@@DriverFieldValues{#4}}% - \doifelsenothing{#5} - {\def\@@DriverFieldDefault{2}} - {\dogetcommacommandelement1\from\@@DriverFieldValues\to\@@DriverFieldDefault - \doifinstringelse{#5}{\@@DriverFieldDefault} - {\def\@@DriverFieldDefault{1}} - {\def\@@DriverFieldDefault{0}}}% - \setfield - {#1}{#2}{}{}{\@@DriverFieldKids}{#3}% - {\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}% - {\@@DriverFieldValues}{\@@DriverFieldDefault}} - -\let\definepushfield=\definecheckfield - -\def\defineradiofield#1#2#3#4#5% - {\iffourthargument - \doifelsenothing{#5} - {\dogetcommacommandelement1\from#4\to\SavedFieldDefault - \dogetcommacommandelement1\from\SavedFieldDefault\to\SavedFieldDefault} - {\def\SavedFieldDefault{#5}}% -% when opt works -% \@EA\beforesplitstring\SavedFieldDefault\at=>\to\SavedFieldDefault - \ifx\@@DriverFieldKids\empty - \setfield{#1}{#2}{}{}{#4}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\SavedFieldDefault}% - \else - \setfield{#1}{#2}{}{}{#4,\@@DriverFieldKids}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\SavedFieldDefault}% - \fi -% - \def\docommand##1% - {\doifelse{##1}\SavedFieldDefault - {\def\@@DriverFieldDefault{##1}}% - {\let\@@DriverFieldDefault\empty}% - \setfield{##1}{#2}{#1}{}{}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\@@DriverFieldDefault}}% -% when opt works -% \def\docommand##1% -% {\@EA\beforesplitstring##1\at=>\to\FieldValue -% \doifelse\FieldValue\SavedFieldDefault -% {\let\@@DriverFieldDefault\FieldValue}% -% {\let\@@DriverFieldDefault\empty}% -% \setfield\FieldValue{#2}{#1}{}{}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\@@DriverFieldDefault}}% - \processcommalist[#4]\docommand - \else - \writestatus\m!fields{pass values too}% - \fi} - -\def\definesubfield - {\dotripleempty\dodefinesubfield} - -\def\dodefinesubfield[#1][#2][#3]% for the moment only radio ones - {\ifsecondargument - \def\docommand##1% - {\getfield{##1}% - \ifx\@@DriverFieldType\empty - \writestatus\m!fields{unknown field ##1}% to do - \else - \doifsomething{#2} - {\edef\@@DriverFieldGroup{#2}}% - \doifelsenothing{#3} - {\definedefaultsymbols - \def\@@DriverFieldValues{defaultyes}} - {\def\@@DriverFieldValues{#3}}% - \changefield{##1}% - \fi}% - \processcommalist[#1]\docommand - \else - \writestatus\m!fields{pass fieldname, setupgroup, values and default}% - \fi} +\def\dodefinefield[#1][#2][#3][#4][#5]% [name] [kind] [group] [values] [default] + {\ctxlua{backends.codeinjections.definefield{ variant="normal", name="#1", kind="#2", group="#3", values=\!!bs#4\!!es, default=\!!bs#5\!!es }}} -\def\doclonefield[#1][#2][#3][#4]% parent children setupgroup values - {\ifsecondargument - \getfield{#1}% -\iftrialtypesetting\else - \ifx\@@DriverFieldType\empty - \writestatus\m!fields{unknown field #1}% - \else - \let\@@DriverFieldMode\fieldparentmode - %\def\docommand##1{\addtocommalist{##1}\@@DriverFieldKids}% - \def\docommand##1{\appendtocommalist{##1}\@@DriverFieldKids}% - \processcommalist[#2]\docommand - \changefield{#1}% - \let\@@DriverFieldAutoParent\@@DriverFieldAuto - \def\@@DriverFieldParent{#1}% - \let\@@DriverFieldKids\empty - \let\@@DriverFieldRoot\empty - \let\@@DriverFieldMode\fieldchildmode - \def\@@DriverFieldFree{0}% - \def\@@DriverFieldAuto{0}% - \doifsomething{#3}{\edef\@@DriverFieldGroup{#3}}% - \doifsomething{#4}{\edef\@@DriverFieldValues{#4}}% - \def\docommand##1% - {\ifcase\@@DriverFieldAutoParent\else - \setmainfieldkid{\@@DriverFieldParent}{##1}% - \fi - \changefield{##1}}% - \processcommalist[#2]\docommand - \fi -\fi - \else - \writestatus\m!fields{pass parent field and clones}% - \fi} +\def\dodefinesubfield[#1][#2][#3]% [name] [group] [values] + {\ctxlua{backends.codeinjections.definefield{ variant="normal", name="#1", kind="sub", group="#2", values=\!!bs#3\!!es }}} -\def\clonefield - {\doquadrupleempty\doclonefield} +\def\doclonefield[#1][#2][#3][#4]% [parent] [children] [group] [values] + {\ctxlua{backends.codeinjections.clonefield{ variant="clone", parent="#1", children="#2", group="#3", values=\!!bs#4\!!es }}} -\def\docopyfield[#1][#2]% parent children - {\ifsecondargument - \getfield{#1}% -\iftrialtypesetting\else - \ifx\@@DriverFieldType\empty - \writestatus\m!fields{unknown field #1}% - \else - \let\@@DriverFieldMode\fieldparentmode - %\def\docommand##1{\addtocommalist{##1}\@@DriverFieldKids}% - \def\docommand##1{\appendtocommalist{##1}\@@DriverFieldKids}% - \processcommalist[#2]\docommand - \changefield{#1}% - \let\@@DriverFieldAutoParent\@@DriverFieldAuto - \def\@@DriverFieldParent{#1}% - \let\@@DriverFieldKids\empty - \let\@@DriverFieldRoot\empty - \let\@@DriverFieldMode\fieldcopymode - \def\@@DriverFieldFree{0}% - \def\@@DriverFieldAuto{0}% - \def\docommand##1% - {\ifcase\@@DriverFieldAutoParent\else - \setmainfieldkid{\@@DriverFieldParent}{##1}% - \fi - \changefield{##1}}% - \processcommalist[#2]\docommand - \fi -\fi - \else - \writestatus\m!fields{pass parent field and copies}% - \fi} +\def\docopyfield[#1][#2]% [parent] [children] + {\ctxlua{backends.codeinjections.clonefield{ variant="copy", parent="#1", children="#2" }}} -\def\copyfield{\dodoubleempty\docopyfield} +\def\dodefinefieldset[#1][#2]% + {\ctxlua{backends.codeinjections.definefieldset("#1","#2")}} -\unexpanded\def\field {\dotripleempty\dofield[\dohandlefield]} -\unexpanded\def\fitfield{\dotripleempty\dofield[\dohandlefitfield]} +% usage +% +% \iftrialtypesetting +% +% just a default setup -\def\dofield[#1][#2][#3]% - {\iffirstargument - \bgroup - \getfield{#2}% - \ifsecondargument - \def\@@DriverFieldLabel{#3}% - \else - \let\@@DriverFieldLabel\@@DriverFieldName - \fi - \ifx\@@DriverFieldType\empty - \writestatus\m!fields{unknown field #2}% - \else\ifcase\@@DriverFieldFree\relax - \doifdefinedelse{\strippedcsname\setupfield\@@DriverFieldGroup} - {\let\dosetupfield=#1\getvalue{\strippedcsname\setupfield\@@DriverFieldGroup}} - {#1[\@@DriverFieldName][\v!label,\v!frame,\v!horizontal][][][]}% -\iftrialtypesetting\else - \def\@@DriverFieldFree{1}% - \changefield{#2}% -\fi - \else\ifcase\@@DriverFieldAuto\relax - % \writestatus\m!fields{field #2 already typeset}% - \else - % \writestatus\m!fields{field #2 automatically copied}% - \nextsystemfield - \copyfield[\@@DriverFieldName][\currentsystemfield]% - \dotripleempty\dofield[#1][\currentsystemfield][#3]% get the if's right - \fi\fi\fi - \egroup - \fi} +\def\loadfieldscripts{\useJSscripts[fld]\globallet\loadfieldscripts\relax} -\def\typesetfield - {\useJSscripts[fld]% - \ifx\@@DriverFieldRoot\empty \else - \let\@@SavedFieldName\@@DriverFieldName - \getfield\@@DriverFieldRoot - \ifcase\@@DriverFieldFree\relax - \dosetfieldstatus\@@DriverFieldMode\@@DriverFieldParent\@@DriverFieldKids\@@DriverFieldRoot - \dopresetrecord -\iftrialtypesetting\else - \def\@@DriverFieldFree{1}% - \changefield\@@DriverFieldName -\fi - \fi - \getfield\@@SavedFieldName +\def\donormalfield{\doprocessfield\dohandlefield} +\def\dofitfield {\doprocessfield\dohandlefitfield} + +\def\doprocessfield#1[#2][#3]% \method [name] [label] + {\dontleavehmode + \begingroup + \loadfieldscripts + \edef\currentfieldname {#2}% + \edef\currentfieldlabel{#3}% + \edef\currentfieldgroup{\ctxlua{backends.codeinjections.getfieldgroup("#2")}}% + \ifx\currentfieldlabel\empty + \let\currentfieldlabel\currentfieldname \fi - \ifx\@@DriverFieldKids\empty - \donefalse + \ifx\currentfieldgroup\empty + #1[#2][\v!label,\v!frame,\v!horizontal][][][]% \else - \donetrue + #1[#2][][][][]% todo: pass setups \fi - \ifdone - \let\@@DriverFieldParent\@@DriverFieldName - %\addtocommalist\@@DriverFieldParent\@@DriverFieldKids - \appendtocommalist\@@DriverFieldParent\@@DriverFieldKids - \dosetfieldstatus\@@DriverFieldMode\@@DriverFieldParent\@@DriverFieldKids\@@DriverFieldRoot - \dopresetfield - \let\@@DriverFieldMode\fieldchildmode - \fi - \dosetfieldstatus\@@DriverFieldMode\@@DriverFieldParent\@@DriverFieldKids\@@DriverFieldRoot - \dopresetfield} - -\def\dopresetfield - {\iftrialtypesetting\else\iflocation\getvalue{preset\@@DriverFieldType field}\fi\fi} - -\def\dopresetrecord - {\iftrialtypesetting\else\iflocation\getvalue{preset\@@DriverFieldType record}\fi\fi} - -\def\dodefinethefieldset[#1][#2]% - {\dodefinefieldset{#1}{#2}} - -\def\definefieldset% - {\dodoubleargument\dodefinethefieldset} - -\def\normaldodosetupfield[#1][#2][#3][#4][#5]% - {\doifdefinedelse{\strippedcsname\setupfield#1} - {\pushmacro\dosetupfield - \def\dosetupfield[##1][##2][##3][##4][##5]% - {\setvalue{\strippedcsname\setupfield#1}{\dosetupfield[#1][##2,#2][##3,#3][##4,#4][##5,#5]}}% - \getvalue{\strippedcsname\setupfield#1}% - \popmacro\dosetupfield} - {\setvalue{\strippedcsname\setupfield#1}{\dosetupfield[#1][#2][#3][#4][#5]}}} + \endgroup} -\let\dodosetupfield\normaldodosetupfield - -\def\donosetupfield[#1][#2][#3][#4][#5]% - {\setvalue{\strippedcsname\setupfield#1}{\dosetupfield[#1][#2][#3][#4][#5]}} +% setups \def\dosetupfield[#1][#2][#3][#4][#5]% {\iffifthargument @@ -765,17 +188,31 @@ \writestatus\m!fields{provide either 1, 2, 3 or 5 arguments}% \fi\fi\fi\fi} -\def\setupfield - {\doquintupleempty\dosetupfield} +\def\normaldodosetupfield[#1][#2][#3][#4][#5]% + {\ifcsname\??fd::#1\endcsname + \pushmacro\dosetupfield + \def\dosetupfield[##1][##2][##3][##4][##5]{\setvalue{\??fd::#1}{\dosetupfield[#1][##2,#2][##3,#3][##4,#4][##5,#5]}}% + \getvalue{\??fd::#1}% + \popmacro\dosetupfield + \else + \setvalue{\??fd::#1}{\dosetupfield[#1][#2][#3][#4][#5]}% + \fi} + +\let\dodosetupfield\normaldodosetupfield + +\def\donosetupfield[#1][#2][#3][#4][#5]% + {\setvalue{\??fd::#1}{\dosetupfield[#1][#2][#3][#4][#5]}} \def\dosetupfields[#1][#2][#3][#4]% {\ifsecondargument \def\dodosetupfield[##1][##2][##3][##4][##5]% - {\doifdefinedelse{\strippedcsname\setupfield##1} - {\def\dosetupfield[####1][####2][####3][####4][####5]% - {\setvalue{\strippedcsname\setupfield##1}{\dosetupfield[##1][#1,####2,##2][#2,####3,##3][#3,####4,##4][#4,####5,##5]}}% - \getvalue{\strippedcsname\setupfield##1}} - {\setvalue{\strippedcsname\setupfield##1}{\dosetupfield[##1][#1,##2][#2,##3][#3,##4][#4,##5]}}}% + {\ifcsname\??fd::##1\endcsname + \def\dosetupfield[####1][####2][####3][####4][####5]% + {\setvalue{\??fd::##1}{\dosetupfield[##1][#1,####2,##2][#2,####3,##3][#3,####4,##4][#4,####5,##5]}}% + \getvalue{\??fd::##1}% + \else + \setvalue{\??fd::##1}{\dosetupfield[##1][#1,##2][#2,##3][#3,##4][#4,##5]}% + \fi}% \else\iffirstargument \doifelse{#1}\v!reset {\resetfields} @@ -784,9 +221,6 @@ \writestatus\m!fields{provide either 1 or 4 arguments}% \fi\fi} -\def\setupfields - {\doquadrupleempty\dosetupfields} - \def\resetfields {\let\dodosetupfield\normaldodosetupfield} @@ -806,27 +240,19 @@ {\presetlocalframed[\??fd]% \processallactionsinset [#2] - [ \v!reset=>\ShowFieldLabelfalse\ShowFieldFramefalse - \HorizontalFieldfalse\VerticalFieldfalse, + [ \v!reset=>\ShowFieldLabelfalse\ShowFieldFramefalse\HorizontalFieldfalse\VerticalFieldfalse, \v!label=>\ShowFieldLabeltrue, \v!frame=>\ShowFieldFrametrue, \v!horizontal=>\HorizontalFieldtrue, \v!vertical=>\VerticalFieldtrue]% \ifVerticalField - \getparameters[\??fd] - [\c!distance=\!!zeropoint,\c!inbetween=\vskip\@@localoffset, - \c!align=\v!right,\c!width=20em]% + \getparameters[\??fd][\c!distance=\!!zeropoint,\c!inbetween=\vskip\@@localoffset,\c!align=\v!right,\c!width=20em]% \else\ifHorizontalField - \getparameters[\??fd] - [\c!distance=\@@localoffset,\c!inbetween=,\c!align=\c!left, - \c!height=10ex]% + \getparameters[\??fd][\c!distance=\@@localoffset,\c!inbetween=,\c!align=\c!left,\c!height=10ex]% \else - \getparameters[\??fd] - [\c!distance=\!!zeropoint,\c!inbetween=,\c!align=\c!left]% + \getparameters[\??fd][\c!distance=\!!zeropoint,\c!inbetween=,\c!align=\c!left]% \fi\fi - \getparameters[\??fd] - [\c!n=,\c!before=,\c!after=\vss,\c!style=,\c!color=,#3]% - \reshapeframeboxfalse % else ugly spacing + \getparameters[\??fd][\c!n=,\c!before=,\c!after=\vss,\c!style=,\c!color=,#3]% \ifShowFieldFrame \localframed[\??fd][\c!strut=\v!no,\c!align=]\bgroup \else @@ -838,7 +264,7 @@ {\reshapeframeboxtrue % else wrong dimensions \framed [\c!style=,\c!color=,\c!align=\c!right,#4] - {\@@DriverFieldLabel}}% + {\currentfieldlabel}}% \fi \setbox2\hbox {\reshapeframeboxtrue % else wrong dimensions @@ -859,8 +285,8 @@ \c!focusin=,\c!focusout=, \c!fieldoffset=\!!zeropoint,\c!fieldbackgroundcolor=, \c!fieldframecolor=,\c!fieldlayer=\@@iafieldlayer,#5]% - \scratchdimen\framedwidth \edef\@@DriverFieldWidth {\the\scratchdimen}% - \scratchdimen\framedheight\edef\@@DriverFieldHeight{\the\scratchdimen}% + \scratchdimen\framedwidth \edef\@@fdwidth {\the\scratchdimen}% + \scratchdimen\framedheight\edef\@@fdheight{\the\scratchdimen}% \vfill \hbox{\lower\@@fdfieldoffset\hbox{\typesetfield}} \vss}}% @@ -900,33 +326,31 @@ \c!afterkey=,\c!format=,\c!validate=,\c!calculate=, \c!fieldoffset=\!!zeropoint,\c!fieldbackgroundcolor=, \c!fieldframecolor=,\c!fieldlayer=\@@iafieldlayer,#5,\c!align=] - {\dogetcommacommandelement1\from\@@DriverFieldValues\to\@@DriverFieldValue - \ifx\@@DriverFieldValue\empty - \let\@@DriverFieldValue\@@DriverFieldDefault - \fi - \dopresetfieldsymbol\@@DriverFieldValue - \setbox\scratchbox\hbox{\dogetfieldsymbol\@@DriverFieldValue}% - \scratchdimen\wd\scratchbox \edef\@@DriverFieldWidth {\the\scratchdimen}% - \scratchdimen\ht\scratchbox \edef\@@DriverFieldHeight{\the\scratchdimen}% + {\edef\defaultfield{\ctxlua{backends.codeinjections.getdefaultfieldvalue("#1")}}% +\dopresetsymbol\defaultfield +\setbox\scratchbox\hbox{\dogetsymbol\defaultfield}% + \edef\@@fdwidth {\the\wd\scratchbox}% \ifcase\fitfieldmode + \edef\@@fdheight{\the\ht\scratchbox}% \typesetfield \or % 1 = ignore depth (original, assumed no depth, actually a bug) + \edef\@@fdheight{\the\ht\scratchbox}% \vbox to \ht\scratchbox{\vfill\hbox to \wd\scratchbox{\typesetfield\hfill}\vss}% \or % 2 = add depth to height, but no depth in result - \advance\scratchdimen\dp\scratchbox \edef\@@DriverFieldHeight{\the\scratchdimen}% + \edef\@@fdheight{\the\htdp\scratchbox}% \vbox to \ht\scratchbox{\vfill\hbox to \wd\scratchbox{\typesetfield\hfill}\vss}% \or % 3 = add depth to height, and apply depth to result - \advance\scratchdimen\dp\scratchbox \edef\@@DriverFieldHeight{\the\scratchdimen}% + \edef\@@fdheight{\the\htdp\scratchbox}% \hbox to \wd\scratchbox{\lower\dp\scratchbox\hbox{\typesetfield}\hfill}% \fi}} %D Common stuff -\newcounter\nofsystemfields +\newcount\nofsystemfields \def\nextsystemfield - {\doglobal\increment\nofsystemfields - \def\currentsystemfield{sys::\nofsystemfields}} + {\global\advance\nofsystemfields\plusone + \def\currentsystemfield{sys::\number\nofsystemfields}} %D An example: @@ -968,7 +392,8 @@ {\dosingleempty\dotooltip} \def\dotooltip[#1]#2#3% - {\bgroup + {\dontleavehmode + \begingroup \setupfields[\v!reset]% \useJSscripts[fld]% \setbox0\hbox @@ -1013,7 +438,7 @@ {\fitfield[\currentsystemfield:but]}% #2}% \ht0\strutht\dp0\strutdp\box0 - \egroup} + \enfgroup} %D And one more: @@ -1021,11 +446,24 @@ {\dotripleargument\dodefinefieldstack} \def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings - {\doifundefined{fieldstack:#1} - {\setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}}} + {\ifcsname fieldstack:#1\endcsname + \setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}% + \fi} + +\def\fieldstack + {\dotripleempty\dofieldstack} + +\def\dofieldstack[#1][#2][#3]% + {\ifsecondargument + \dodefinefieldstack[#1][#2][#3]\fieldstack[#1]% + \else + \getvalue {fieldstack:#1}% + \setgvalue{fieldstack:#1}{[#1]}% + \fi} \def\dodofieldstack[#1][#2][#3]% start=n, 0 == leeg - {\bgroup + {\dontleavehmode + \begingroup \getparameters[\??fd][\c!start=1,#3]% \setupfields[\v!reset]% \definesymbol[\v!empty][]% @@ -1050,30 +488,189 @@ \globalprocesscommalist[#2]\dododofieldstack \egroup \stopoverlay + \endgroup} + +%D When submitting a form, we need to tell the driver module +%D that we want \FDF\ or \HTML. + +\newtoks\everysetupforms + +\def\setupforms{\dosingleempty\dosetupforms} + +\def\dosetupforms[#1] + {\getparameters[\??fr][#1]% + \the\everysetupforms} + +\appendtoks + \ctxlua{backends.codeinjections.setformsmethod("@@frmethod")}% +\to \everysetupforms + +\setupforms + [\c!method=XML] % no need for everyjob initialization as this is the default + +%D Goodie: (unchecked in \MKIV) + +\def\definepushbutton % name optional setup + {\dodoubleempty\dodefinepushbutton} + +\def\dodefinepushbutton[#1][#2]% name setup + {\dododefinepushbutton{#1}{n}{push}% + \dododefinepushbutton{#1}{r}{\symbol[psym:#1:n]}% + \dododefinepushbutton{#1}{d}{\symbol[psym:#1:r]}% + \setvalue{pushbutton:#1}{\dohandlepushbutton{#1}{#2}}} + +\def\dododefinepushbutton#1#2#3% + {\doifsymboldefinedelse{psym:#1:#2}% + \donothing{\definesymbol[psym:#1:#2][{#3}]}} + +\def\definepushsymbol + {\dotripleargument\dodefinepushsymbol} + +\def\dodefinepushsymbol[#1][#2]% [#3] + {\definesymbol[psym:#1:#2]} + +\def\dopushbutton[#1][#2]% + {\executeifdefined{pushbutton:#1}\gobbleoneargument{#2}} + +\def\pushbutton + {\dodoubleargument\dopushbutton} + +\def\dohandlepushbutton#1#2#3% identifier setup script + {\bgroup + \nextsystemfield + \setupfield + [pushbutton] + [\c!frame=\v!overlay, + \c!offset=\v!overlay, + \c!clickout=#3,#2]% + \definefield + [\currentsystemfield] + [push] + [pushbutton] + [psym:#1:n,psym:#1:r,psym:#1:d]% + \fitfield + [\currentsystemfield]% \egroup} -\def\dofieldstack[#1][#2][#3]% - {\ifsecondargument - \dodefinefieldstack[#1][#2][#3]\fieldstack[#1]% +% \def\menu@psh +% {\dodoubleargument\domenu@psh} +% +% \def\domenu@psh[#1][#2]#3\\% +% {\txt\pushbutton[#1][#2]\\}% +% +%\appendtoks \let\psh\do@@ampsh \to \everysetmenucommands + +\unexpanded\def\menu@psh{\txt\pushbutton} + +\appendtoks \let\psh\menu@psh \to \everysetmenucommands + +% \definepushbutton [reset] +% +% \definepushsymbol [reset] [n] [\uniqueMPgraphic{whatever}{color=green}] +% \definepushsymbol [reset] [r] [\uniqueMPgraphic{whatever}{color=white}] +% +% \startinteractionmenu[bottom] +% \psh [reset] [JS(reset_something)] \\ +% \stopinteractionmenu + +%D Another goodie: (unchecked in \MKIV) + +% \definecolor[rollover:n][red] +% \definecolor[rollover:r][green] +% \definecolor[rollover:d][blue] + +\definepalet + [rollover] + [n=red, + r=green, + d=blue] + +\newcounter\nofrollovers +\newcounter\nofrollbuttons + +\def\dorollbutton[#1][#2]#3[#4]% + {\dontleavehmode + \bgroup + \doglobal\increment\nofrollovers + \doglobal\increment\nofrollbuttons + \unexpanded\def\dosetlocationbox[##1]##2[##3]% + {\getparameters[##1][##3]% + \definecolor[rollover][rollover:##2]% + \doifelse{##2}{n}{\doifelsevalue{##1\c!alternative}\v!hidden\phantom\hbox}\hbox + {\localframed[##1] + [\c!framecolor=rollover,\c!backgroundcolor=rollover,\c!color=rollover]% + {\dolocationattributes{##1}\c!style\c!color{#3}}}}% + \iffirstargument + \ifsecondargument + \def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[#2]}% + \else + \doifassignmentelse{#1} + {\def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[#1]}} + {\def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[]}}% + \fi \else - \getvalue{fieldstack:#1}\setgvalue{fieldstack:#1}{[#1]}% - \fi} + \def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[]}% + \fi + % todo: share symbols, tricky since different dimensions + \definesymbol[rsym:\nofrollovers:n][\setlocationbox n]% + \definesymbol[rsym:\nofrollovers:r][\setlocationbox r]% + \definesymbol[rsym:\nofrollovers:d][\setlocationbox d]% + \setupfield + [rollbutton] + [\c!frame=\v!off, + \c!offset=\v!overlay, + \c!clickout={#4}]% + \definefield + [roll:\nofrollbuttons][push][rollbutton] + [rsym:\nofrollovers:n,% + rsym:\nofrollovers:r,% + rsym:\nofrollovers:d]% + \fitfield[roll:\nofrollbuttons]% + \egroup} -\def\fieldstack - {\dotripleempty\dofieldstack} +\unexpanded\def\rollbutton + {\dodoubleempty\dorollbutton} -%D When submitting a form, we need to tell the driver module -%D that we want \FDF\ or \HTML. +\def\menu@rob[#1]#2\\% + {\txt\rollbutton[\currentmenu]{\ignorespaces#2\unskip}[#1]\\}% -\def\setupforms - {\dodoubleargument\getparameters[\??fr]} +\appendtoks \let\rob\menu@rob \to \everysetmenucommands -\def\checksubmitform#1% - {\setsubmitoutputformat\@@frmethod} +% calls: +% {..} [JS..] +% [left] {..} [JS..] +% [a=b] {..} [JS..] +% [left] [a=b] {..} [JS..] +% +% \setupbuttons[offset=0pt,frame=off] % alternative=hidden +% +% \rollbutton {Manuals} [JS(Goto_File{show-man.pdf})] +% \rollbutton {Articles} [JS(Goto_File{show-art.pdf})] +% \rollbutton {Papers} [JS(Goto_File{show-pap.pdf})] +% \rollbutton {Presentations} [JS(Goto_File{show-pre.pdf})] +% \rollbutton {Resources} [JS(Goto_File{show-res.pdf})] +% +% \rob [JS(...)] bla bla \\ -\setexecutecommandcheck {submitform} \checksubmitform +\unexpanded\def\overlayrollbutton + {\dodoubleargument\dooverlayrollbutton} -\setupforms - [\c!method=HTML] +\def\dooverlayrollbutton[#1][#2]% + {\bgroup + \nextsystemfield + \setupfield + [overlayrollbutton] + [\c!frame=\v!off,\c!offset=\v!overlay,\c!regionin={#1},\c!regionout={#2}]% + \definesymbol + [\currentsystemfield] + [{\framed[\c!frame=\v!off,\c!width=\overlaywidth,\c!height=\overlayheight]{}}]% + \definefield + [\currentsystemfield][push][overlayrollbutton][\currentsystemfield][\currentsystemfield]% + \fitfield[\currentsystemfield]% + \egroup} + +% \defineoverlay +% [ShowMenu] +% [{\overlayrollbutton[VideLayer{navigation}][HideLayer{navigation}]}] \protect \endinput diff --git a/tex/context/base/scrn-int.lua b/tex/context/base/scrn-int.lua new file mode 100644 index 000000000..7e90ed069 --- /dev/null +++ b/tex/context/base/scrn-int.lua @@ -0,0 +1,111 @@ +if not modules then modules = { } end modules ['scrn-int'] = { + version = 1.001, + comment = "companion to scrn-int.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local format = string.format +local texsprint, texcount, ctxcatcodes = tex.sprint, tex.count, tex.ctxcatcodes + +interactions = interactions or { } + +local attachments = { } + +function interactions.registerattachment(specification) + if specification.label then + specification.filename = specification.filename or specification.label + specification.newname = specification.newname or specification.filename + specification.title = specification.title or specification.filename + specification.newname = file.addsuffix(specification.newname,file.extname(specification.filename)) + attachments[specification.label] = specification + return specification + end +end + +function interactions.attachment(label) + local at = attachments[label] + if not at then + interfaces.showmessage("interactions",6,label) + return interactions.registerattachment { label = label } + else + return at + end +end + +function interactions.attachmentvar(label,key) + local at = attachments[label] + texsprint(ctxcatcodes,at and at[key] or "") +end + +local soundclips = { } + +function interactions.registersoundclip(specification) + if specification.label then + specification.filename = specification.filename or specification.label + soundclips[specification.label] = specification + return specification + end +end + +function interactions.soundclip(label) + local sc = soundclips[label] + if not sc then + -- todo: message + return interactions.registersoundclip { label = label } + else + return sc + end +end + +local renderings = { } + +function interactions.registerrendering(specification) + if specification.label then + renderings[specification.label] = specification + return specification + end +end + +function interactions.rendering(label) + local rn = renderings[label] + if not rn then + -- todo: message + return interactions.registerrendering { label = label } + else + return rn + end +end + +function interactions.renderingvar(label,key) + local rn = renderings[label] + texsprint(ctxcatcodes,rn and rn[key] or "") +end + +-- linked lists + +function interactions.definelinkedlist(name) + -- no need +end + +function interactions.addlinktolist(name) + local tobesaved = jobpasses.gettobesaved(name) + local collected = jobpasses.getcollected(name) or { } + local currentlink = #tobesaved + 1 + local noflinks = #collected + tobesaved[currentlink] = 0 + local f = collected[1] or 0 + local l = collected[noflinks] or 0 + local p = collected[currentlink-1] or f + local n = collected[currentlink+1] or l + texsprint(ctxcatcodes,format("\\setlinkproperties{%s}{%s}{%s}{%s}{%s}{%s}",currentlink,noflinks,f,p,n,l)) +end + +function interactions.enhancelinkoflist(name,n) + local ll = jobpasses.gettobesaved(name) + if ll then + ll[n] = texcount.realpageno + end +end + diff --git a/tex/context/base/scrn-int.mkii b/tex/context/base/scrn-int.mkii index 38d50a350..9f1be68e1 100644 --- a/tex/context/base/scrn-int.mkii +++ b/tex/context/base/scrn-int.mkii @@ -27,64 +27,9 @@ \newcounter\numberoflinks -\def\stelkoppelingenin% +\def\stelkoppelingenin {\dodoubleargument\getparameters[\??lk]} -\def\definieerkoppeling[#1]% % local loading ! - {\doifundefined{\s!link:#1:\s!list} - {\expanded{\definetwopasslist{\s!link:#1}}% - \expanded{\doloadtwopassdata{\s!link:#1}}% - \getfirsttwopassdata{\s!link:#1}% - \letgvalue{\s!link:#1:f}\twopassdata - \getlasttwopassdata{\s!link:#1}% - \letgvalue{\s!link:#1:l}\twopassdata - \letgvalue{\s!link:#1:s}\noftwopassitems - \gettwopassdata{\s!link:#1}% - \letgvalue{\s!link:#1:c}\twopassdata - \letgvalue{\s!link:#1:n}\twopassdata}} - -\def\koppeling[#1]#2% - {\bgroup - \definieerkoppeling[#1]% - \doglobal\increment\numberoflinks - \gettwopassdata{\s!link:#1}% - \edef\numberoflinks{0\getvalue{\s!link:#1:s}}% - \edef\firstlink {0\getvalue{\s!link:#1:f}}% - \edef\lastlink {0\getvalue{\s!link:#1:l}}% - \edef\currentlink {0\getvalue{\s!link:#1:n}}% - \edef\prevlink {0\getvalue{\s!link:#1:c}}% - \iftwopassdatafound - \edef\nextlink{0\twopassdata}% - \letgvalue{\s!link:#1:n}\nextlink - \letgvalue{\s!link:#1:c}\currentlink - \else - \edef\nextlink{0\getvalue{\s!link:#1:l}}% - \fi - \lazysavetwopassdata{\s!link:#1}{\numberoflinks}{\noexpand\realfolio}% - \ifnum\noflinks<\plustwo - \locationfalse - \fi - \iflocation - \hbox - {\setinteractionparameter\c!width\!!zeropoint - \dogotosomepage\??lk\gotobegincharacter\firstlink\hss - \ifnum\noflinks>\plustwo - \hskip\@@lkdistance - \dogotosomepage\??lk\gobackwardcharacter\prevlink\hss - \fi - \hskip\@@lkdistance - #2\relax - \hskip\@@lkdistance - \ifnum\noflinks>\plustwo - \dogotosomepage\??lk\goforwardcharacter\nextlink\hss - \hskip\@@lkdistance - \fi - \dogotosomepage\??lk\gotoendcharacter\lastlink}% - \else - \hbox{#2}% - \fi - \egroup} - \def\definieerkoppeling[#1]% % local loading ! {\doifundefined{\s!link:#1:\s!list} {\expanded{\definetwopasslist{\s!link:#1}}% \expanded{\doloadtwopassdata{\s!link:#1}}% @@ -560,7 +505,7 @@ \fi}}% \ifskippedmenuitem\else\box\locationbox\fi} -\def\setlocationboxnop#1[#2]#3[#4]% +\def\setlocationboxnop#1[#2]#3[#4]% inefficient as text can be outside box {\locationclickfalse \setbox\locationbox\hbox {\resetgoto % anders cyclische aanroep ! @@ -1932,7 +1877,6 @@ % % \starttext \attachment[whatever] \stoptext -\definesystemvariable{at} \def\useattachment {\doquadrupleempty\douseattachment} @@ -2028,6 +1972,144 @@ \def\registermenubuttons {\dodoubleempty\doregistermenubuttons} +% It took quite a while to figure this out (using the preliminary 1.5 +% spec). There are still a lot of things to be implemented. This is +% the third alternative. + +% todo: multiple instances, dus indirect + +\let\currentrendering\empty + +\definereference[StartCurrentRendering] [\v!StartRendering {\currentrendering}] +\definereference[StopCurrentRendering] [\v!StopRendering {\currentrendering}] +\definereference[PauseCurrentRendering] [\v!PauseRendering {\currentrendering}] +\definereference[ResumeCurrentRendering][\v!ResumeRendering{\currentrendering}] + +\newcounter\nofexternalrenderings + +\def\useexternalrendering{\doquadrupleempty\douseexternalrendering} +\def\setinternalrendering{\dodoubleempty \dosetinternalrendering} + +\def\douseexternalrendering[#1][#2][#3][#4]% tag mime file options + {\setgvalue{\??rd:#1}{\plusone{#1}{#2}{#3}{#4}}} + +\def\dosetinternalrendering[#1][#2]% tag options {content} + {\bgroup + \dowithnextbox + {\setgvalue{\??rd:#1}{\plustwo{#1}{IRO}{#1}{#2}}% + \let\objectoffset\zeropoint + \setobject{IRO}{#1}\hbox{\box\nextbox}% + \egroup}% + \hbox} + +\def\checkrendering#1% let's hope that \next is not used + {\iflocation + \doifsomething{#1}% + {\doifdefined{\??rd:#1}% + {\expanded{\getvalue{\??rd::\number\renderingtype{#1}}% + {\filterfromvalue{\??rd:#1}52}{\filterfromvalue{\??rd:#1}53}% + {\filterfromvalue{\??rd:#1}54}{\filterfromvalue{\??rd:#1}55}}}}% + \fi} + +\setvalue{\??rd::1}{\doinsertrendering} +\setvalue{\??rd::2}{\doinsertrenderingobject} + +\def\renderingtype #1{\filterfromvalue{\??rd:#1}51} +\def\renderingoptions#1{\filterfromvalue{\??rd:#1}55} + +\setexecutecommandcheck {startrendering} \checkrendering +\setexecutecommandcheck {stoprendering} \checkrendering +\setexecutecommandcheck {pauserendering} \checkrendering +\setexecutecommandcheck {resumerendering} \checkrendering + +% by using a nice trick (used in other places of context as well) we +% can easily overload the default size to match the opbject size + +\def\renderingwidth {8cm} +\def\renderingheight{6cm} + +\def\definerenderingwindow + {\dodoubleempty\dodefinerenderingwindow} + +\def\dodefinerenderingwindow[#1][#2]% + {\presetlocalframed[\??rw#1]% + \getparameters% + [\??rw#1]% + [\c!openpageaction=,\c!closepageaction=,% + \c!width=\renderingwidth,\c!height=\renderingheight,% + #2]} + +\def\setuprenderingwindow + {\dodoubleargument\dosetuprenderingwindow} + +\def\dosetuprenderingwindow[#1]% + {\getparameters[\??rw#1]} + +\def\placerenderingwindow + {\dodoubleempty\doplacerenderingwindow} + +\def\doplacerenderingwindow[#1][#2]% + {\bgroup + \edef\currentrendering{\ifsecondargument#2\else#1\fi}% + \ifcase\renderingtype\currentrendering\or + % a file + \or + % an object + \getobjectdimensions{IRO}\currentrendering + \scratchdimen\objectheight + \advance\scratchdimen\objectdepth + \edef\renderingheight{\the\scratchdimen}% + \edef\renderingwidth{\objectwidth}% + \fi + % create fall back if needed + \doifdefinedelse{\??rw#1\c!width} + {\def\currentrenderingwindow{#1}} + {\let\currentrenderingwindow\s!default + \definerenderingwindow[\currentrenderingwindow]}% + \checkrendering\currentrendering + \handlereferenceactions{\getvalue{\??rw\currentrenderingwindow\c!openpageaction }}\dosetuprenderingopenpageaction + \handlereferenceactions{\getvalue{\??rw\currentrenderingwindow\c!closepageaction}}\dosetuprenderingclosepageaction + \localframed + [\??rw\currentrenderingwindow][\c!offset=\v!overlay]% + {\expanded{\doinsertrenderingwindow + \noexpand\currentrendering\hsize\vsize{\renderingoptions\currentrendering}}}% + \egroup} + +% todo: +% +% \setinternalrendering[example-1][options]{} + +% test file: +% +% \definerenderingwindow +% [example] +% [width=320pt,height=150pt,frame=off, +% background=color,backgroundcolor=gray, +% openpageaction=StartCurrentRendering, +% closepageaction=NextPage]% StopCurrentRendering] +% +% \useexternalrendering[example-1][audio/mpeg] [eldorado.mp3] +% \useexternalrendering[example-2][audio/mpeg] [myst-12.mp3] +% \useexternalrendering[example-3][application/x-shockwave-flash][http://localhost/mb.swf] [auto] +% \useexternalrendering[example-4][application/x-shockwave-flash][celebration.swf] +% \useexternalrendering[example-5][video/quicktime] [p1000726.mov] +% \useexternalrendering[example-6][application/smil] [quadratic_map.smi] +% +% \def\renderingmenu[#1]% +% {\hbox +% {\setupbuttons[width=2.5em]% +% \button{\symbol[StartRendering]} [StartRendering{#1}]\enspace +% \button{\symbol[StopRendering]} [StopRendering{#1}]\enspace +% \button{\symbol[PauseRendering]} [PauseRendering{#1}]\enspace +% \button{\symbol[ResumeRendering]}[ResumeRendering{#1}]}} +% +% \renderingmenu[example-1]\blank +% \renderingmenu[example-2]\blank +% \renderingmenu[example-3]\blank +% \renderingmenu[example-4] \placefigure{A ShockWave}{\placerenderingwindow[example][example-4]} \page +% \renderingmenu[example-5] \placefigure{A Movie}{\placerenderingwindow[example][example-5]} \page +% \renderingmenu[example-6] \placefigure{A Smile}{\placerenderingwindow[example][example-6]} + \stelkoppelingenin [\c!distance=.25em, \c!width=\v!fit, diff --git a/tex/context/base/scrn-int.mkiv b/tex/context/base/scrn-int.mkiv index 80f85145b..ddf6e5938 100644 --- a/tex/context/base/scrn-int.mkiv +++ b/tex/context/base/scrn-int.mkiv @@ -11,191 +11,30 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -% evt interactionbaren runtime laden (scheelt 8K) - -%D Still to be done properly. - \writestatus{loading}{ConTeXt Screen Macros / Interaction} \unprotect -% \expand vs \expanded - -% linked registers implementeren als een koppeling == mooier +%D This is an update of \MKII\ code. In the process profiles and versions +%D were removed as I never used them (although they were kind of cool at +%D that time). -\presetlocalframed[\??lk] +% a bit complex due to papercomment (see imposition code) -\newcounter\numberoflinks +\newtoks\everysetupinteractionscreen -\def\stelkoppelingenin% - {\dodoubleargument\getparameters[\??lk]} +\def\setupinteractionscreen + {\dosingleempty\dosetupinteractionscreen} -\def\definieerkoppeling[#1]% % local loading ! - {\doifundefined{\s!link:#1:\s!list} - {\expanded{\definetwopasslist{\s!link:#1}}% - \expanded{\doloadtwopassdata{\s!link:#1}}% - \getfirsttwopassdata{\s!link:#1}% - \letgvalue{\s!link:#1:f}\twopassdata - \getlasttwopassdata{\s!link:#1}% - \letgvalue{\s!link:#1:l}\twopassdata - \letgvalue{\s!link:#1:s}\noftwopassitems - \gettwopassdata{\s!link:#1}% - \letgvalue{\s!link:#1:c}\twopassdata - \letgvalue{\s!link:#1:n}\twopassdata}} +\def\dosetupinteractionscreen[#1]% + {\getparameters[\??sc][#1]% + \the\everysetupinteractionscreen} -\def\koppeling[#1]#2% - {\bgroup - \definieerkoppeling[#1]% - \doglobal\increment\numberoflinks - \gettwopassdata{\s!link:#1}% - \edef\numberoflinks{0\getvalue{\s!link:#1:s}}% - \edef\firstlink {0\getvalue{\s!link:#1:f}}% - \edef\lastlink {0\getvalue{\s!link:#1:l}}% - \edef\currentlink {0\getvalue{\s!link:#1:n}}% - \edef\prevlink {0\getvalue{\s!link:#1:c}}% - \iftwopassdatafound - \edef\nextlink{0\twopassdata}% - \letgvalue{\s!link:#1:n}\nextlink - \letgvalue{\s!link:#1:c}\currentlink - \else - \edef\nextlink{0\getvalue{\s!link:#1:l}}% - \fi - \lazysavetwopassdata{\s!link:#1}{\numberoflinks}{\noexpand\realfolio}% - \ifnum\noflinks<\plustwo - \locationfalse - \fi - \iflocation - \hbox - {\setinteractionparameter\c!width\!!zeropoint - \dogotosomepage\??lk\gotobegincharacter\firstlink\hss - \ifnum\noflinks>\plustwo - \hskip\@@lkdistance - \dogotosomepage\??lk\gobackwardcharacter\prevlink\hss - \fi - \hskip\@@lkdistance - #2\relax - \hskip\@@lkdistance - \ifnum\noflinks>\plustwo - \dogotosomepage\??lk\goforwardcharacter\nextlink\hss - \hskip\@@lkdistance - \fi - \dogotosomepage\??lk\gotoendcharacter\lastlink}% - \else - \hbox{#2}% - \fi - \egroup} - -\def\definieerkoppeling[#1]% % local loading ! - {\doifundefined{\s!link:#1:\s!list} - {\expanded{\definetwopasslist{\s!link:#1}}% \expanded{\doloadtwopassdata{\s!link:#1}}% - \getfirsttwopassdata{\s!link:#1}% - \let\firstlink\twopassdata - \getlasttwopassdata{\s!link:#1}% - \let\lastlink\twopassdata - \let\noflinks\noftwopassitems - \gettwopassdata{\s!link:#1}% - \let\currentlink\twopassdata - \let\nextlink\twopassdata - \setxvalue{\s!link:#1:}{\firstlink:\lastlink:\noflinks:\currentlink:\nextlink}}} - -\def\koppeling[#1]#2% - {\bgroup - \definieerkoppeling[#1]% - \doglobal\increment\numberoflinks - \gettwopassdata{\s!link:#1}% - \def\next[##1:##2:##3:##4:##5]% - {\edef\firstlink {0##1}% - \edef\lastlink {0##2}% - \edef\noflinks {0##3}% - \edef\prevlink {0##4}% - \edef\currentlink{0##5}}% - \expanded{\next[\getvalue{\s!link:#1:}]}% - \edef\nextlink{0\iftwopassdatafound\twopassdata\else\lastlink\fi}% - \setxvalue{\s!link:#1:}{\firstlink:\lastlink:\noflinks:\currentlink:\nextlink}% - \lazysavetwopassdata{\s!link:#1}{\numberoflinks}{\noexpand\realfolio}% - \ifnum\noflinks<\plustwo - \locationfalse - \fi - \iflocation - \hbox - {\setinteractionparameter\c!width\!!zeropoint - #2\relax - \hskip\@@lkdistance - \dogotosomepage\??lk\gotobegincharacter\firstlink\hss - \ifnum\noflinks>\plustwo - \dogotosomepage\??lk\gobackwardcharacter\prevlink\hss - \fi - \ifnum\noflinks>\plustwo - \dogotosomepage\??lk\goforwardcharacter\nextlink\hss - \hskip\@@lkdistance - \fi - \dogotosomepage\??lk\gotoendcharacter\lastlink}% - \else - \hbox{#2}% - \fi - \egroup} - -\let\setupinteractionscreens\empty - -\def\docalculateinteractionscreen - {\doifelse\@@scwidth\v!fit - {\!!widtha\leftcombitotal - \ifdim\backspace>\!!widtha\ifdim\backspace>\zeropoint\relax - \advance\backspace -\!!widtha - \fi\fi - \advance\!!widtha\rightcombitotal - \advance\!!widtha 2\dimexpr\@@scbackspace+\@@schoroffset\relax} - {\doifelse\@@scwidth\v!max - {\!!widtha\printpaperwidth} - {\!!widtha\@@scwidth}}% - \doifelse\@@scheight\v!fit - {\!!heighta\dimexpr\topheight+\topdistance\relax - \ifdim\topspace>\!!heighta\ifdim\topspace>\zeropoint\relax - \advance\topspace -\!!heighta - \fi\fi - \advance\!!heighta \dimexpr\makeupheight+\bottomdistance+\bottomheight\relax - \advance\!!heighta 2\dimexpr\@@sctopspace+\@@scveroffset\relax} - {\doifelse\@@scheight\v!max - {\!!heighta\printpaperheight} - {\!!heighta\@@scheight}}% - \doif\@@scdelay\v!none{\let\@@scdelay\zerocountervalue}} - -% The macro is not to be changed; only the \@@ia-variables -% may be set! ConTeXt is the producer but we no longer -% mention the pragma site, since we don't want to be bothered -% with remarks about third party documents and/or associated -% with documents produced outside our control. - -\def\doprepareidentity % beware, we need to construct - {\let\!!stringa\@@iakeyword % an unexpanded space separated - \let\@@iakeyword\empty % list of keywords from a comma - \def\doprepareidentity##1% % separated one - {\ifx\@@iakeyword\empty - \appended\def\@@iakeyword{##1}% - \else - \appended\def\@@iakeyword{ ##1}% - \fi}% - \@EA\processcommalist\@EA[\!!stringa]\doprepareidentity - \global\let\doprepareidentity\relax} - -%D The Creator field is changed per 12/04/2006 due to user presure. This -%D means that I need to put my own status info someplace else. - -\def\initializeidentity - {\doprepareidentity - \dosetupidentity % no \expanded{..} will be done in special (else no pdfdoc) - {\@@iatitle}{\@@iasubtitle}{\@@iaauthor}% - {ConTeXt - \contextversion}% - {\@@iadate}{\@@iakeyword}% - \global\let\initializeidentity\relax} - -\appendtoks \initializeidentity \to \everyshipout - -\def\initializepaper +\def\synchronizepaperdimensionssimple % simple version {\bgroup - \ifx\@@ppleft \empty - \ifx\@@ppright\empty - \ifx\@@pptop \empty + \ifx\@@ppleft \empty + \ifx\@@ppright \empty + \ifx\@@pptop \empty \ifx\@@ppbottom \empty \ifx\@@pcstate\v!start \locationfalse\fi\else @@ -204,1500 +43,276 @@ \locationfalse\fi\else \locationfalse\fi \iflocation % without screen settings - \egroup - \dosetuppaper\papersize\paperwidth\paperheight + \ctxlua{backends.codeinjections.setupcanvas { + paperwidth = \number\paperwidth, + paperheight = \number\paperheight + }}% \else - \egroup - \dosetuppaper\printpapersize\printpaperwidth\printpaperheight - \fi} - -\appendtoks \initializepaper \to \everyshipout + \ctxlua{backends.codeinjections.setupcanvas { + paperwidth = \number\printpaperwidth, + paperheight = \number\printpaperheight + }}% + \fi + \egroup} -\def\doinitializepaper +\def\synchronizepaperdimensionscomplex % complex version {\bgroup - \docalculateinteractionscreen + \edef\@@scwidth {\@@scwidth}% + \edef\@@scheight{\@@scheight}% + \ifx\@@scwidth\v!fit + \!!widtha\leftcombitotal + \ifdim\backspace>\!!widtha\ifdim\backspace>\zeropoint\relax + \advance\backspace -\!!widtha + \fi\fi + \advance\!!widtha\dimexpr\rightcombitotal+2\dimexpr\@@scbackspace+\@@schoroffset\relax\relax + \else\ifx\@@scwidth\v!max + \!!widtha\printpaperwidth + \else + \!!widtha\@@scwidth + \fi\fi + \ifx\@@scheight\v!fit + \!!heighta\dimexpr\topheight+\topdistance\relax + \ifdim\topspace>\!!heighta\ifdim\topspace>\zeropoint\relax + \advance\topspace -\!!heighta + \fi\fi + \advance\!!heighta\dimexpr\makeupheight+\bottomdistance+\bottomheight+2\dimexpr\@@sctopspace+\@@scveroffset\relax\relax + \else\ifx\@@scheight\v!max + \!!heighta\printpaperheight + \else + \!!heighta\@@scheight + \fi\fi + \doif\@@scdelay\v!none{\let\@@scdelay\zerocountervalue}% \ifdim\!!widtha>\paperwidth\ifdim\!!widtha>\zeropoint \paperwidth\!!widtha \fi\fi \ifdim\!!heighta>\paperheight\ifdim\!!heighta>\zeropoint \paperheight\!!heighta \fi\fi - \dosetuppaper - {\printpapersize} - {\the\paperwidth} - {\the\paperheight}% - \egroup} - -\let\@@pcscreendata\empty - -\def\dosetupinteractionscreens % met a, b en \number - {\doifnot\@@pcstate\v!start\dodosetupinteractionscreens} - -\setvalue{\??sc\c!option\v!max }{1} % tzt share with driver -\setvalue{\??sc\c!option\v!bookmark }{2} % tzt share with driver -\setvalue{\??sc\c!option\v!fit }{3} % tzt share with driver -\setvalue{\??sc\c!option\v!doublesided}{4} % tzt share with driver - -\def\dodosetupinteractionscreens % met a, b en \number - {\bgroup - \docalculateinteractionscreen - \!!counte=0\getvalue{\??sc\c!option\@@scoption}\relax - % niet waterdicht - \doifnot{\the\!!widtha\the\!!heighta}\@@pcscreendata - {\xdef\@@pcscreendata{\the\!!widtha\the\!!heighta}% - \showmessage\m!interactions1{\withoutpt\the\!!widtha,\withoutpt\the\!!heighta}}% - % needs to be split: dimensions for each page - % and mode per document and only once ! - \dosetupscreen \backoffset\topoffset\!!widtha\!!heighta{\the\!!counte}% - \dosetupcropbox\backoffset\topoffset\!!widtha\!!heighta - \egroup} - -\def\dosetupinteractionscreen[#1]% - {\getparameters[\??sc][#1]% - \ifproductionrun - \let\initializepaper\doinitializepaper - \let\setupinteractionscreens\dosetupinteractionscreens - \fi} - -\appendtoks \setupinteractionscreens \to \everyfirstshipout % needed to get option=max etc working -\appendtoks \setupinteractionscreens \to \everyshipout % needed for page/screen dimensions - -\def\setupinteractionscreen - {\dosingleempty\dosetupinteractionscreen} - -% \startinteractionmenu[rechts] -% \but [eerste] eerste \\ -% \txt hello world \\ -% \but [tweede] tweede \\ -% \nop \\ -% \but [tweede] tweede \\ -% \rul whow \\ -% \but [tweede] tweede \\ -% \raw hello world \\ -% \but [tweede] tweede \\ -% \com \vfill \\ -% \but [derde] derde \\ -% \stopinteractionmenu - -\newif\iflocationmenupermitted - -\def\testinteractionmenu#1% - {\iflocation - \doifelse\@@iamenu\v!on - {\doifelsevalue{\??am#1\c!state}\v!start - {\global\locationmenupermittedtrue} - {\global\locationmenupermittedfalse}} - {\global\locationmenupermittedfalse}% - \else - \global\locationmenupermittedfalse - \fi} - -\def\dodisableinteractionmenu[#1][#2][#3]% - {\def\dododisableinteractionmenu##1% - {\doifelse{#3}{} - {\letvalue{\??am##1\c!obstruction}\empty} - {\edef\interactieblokkade{\getvalue{\??am##1\c!obstruction}} - \def\docommand####1{#1{####1}{\interactieblokkade}}% #1 = \remove or \add - \processcommalist[#3]\docommand - \setevalue{\??am##1\c!obstruction}{\interactieblokkade}}}% - \processcommalist[#2]\dododisableinteractionmenu} - -\def\disableinteractionmenu - {\dotripleempty\dodisableinteractionmenu[\addtocommalist]} - -\def\enableinteractionmenu - {\dotripleempty\dodisableinteractionmenu[\removefromcommalist]} - -% ja : kader/achtergrond met tekst -% leeg : kader/achtergrond maar geen tekst -% nee : alleen ruimte reserveren -% geen : helemaal weglaten - -\newif\iflocationdummy -\newif\ifskippedmenuitem - -\newif\iflocationempty -\newif\iflocationclick - -% ja : kader/achtergrond met tekst -% leeg : kader/achtergrond maar geen tekst -% nee : alleen ruimte reserveren -% geen : helemaal weglaten -% -% \setupinteractionmenu[right][samepage=yes, unknownreference=yes] -% \setupinteractionmenu[right][samepage=empty,unknownreference=empty] -% \setupinteractionmenu[right][samepage=no, unknownreference=no] -% \setupinteractionmenu[right][samepage=none, unknownreference=none] -% -% \startinteractionmenu[right] -% \but [firstpage] first \\ -% \but [lastpage] last \\ -% \but [somepage] crap \\ -% \stopinteractionmenu - -\def\dosetlocationboxcontent#1[#2]#3[#4]% - {\global\skippedmenuitemfalse - \setbox\locationbox\hbox - {\resetgoto % anders cyclische aanroep ! - \localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}}% - \iflocationclick - \hbox{\gotolocation{#4}{\box\locationbox}}% - \else - \hbox{\box\locationbox}% - \fi} - -\let\dosetlocationboxyes\dosetlocationboxcontent - -\def\dosetlocationboxempty#1[% - {\dosetlocationboxcontent{#1}[\c!empty=\v!yes,} - -\def\dosetlocationboxno#1[% - {\dosetlocationboxcontent{#1}[\c!empty=\v!yes,\c!frame=,\c!background=,} - -\def\dosetlocationboxnone#1[#2]#3[#4]% - {\global\skippedmenuitemtrue} - -\def\setlocationboxyes#1[#2]#3[#4]% - {\locationclicktrue - \setbox\locationbox\hbox - {\resetgoto % anders cyclische aanroep ! - \global\skippedmenuitemfalse - \gotolocation - {#4}% % needed - {\ifrealreferencepage - \ifcase\csname\??am\??am\csname#1\c!samepage\endcsname\endcsname\relax - \copycsname#1\c!color\endcsname\csname#1\c!contrastcolor\endcsname - \localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}% - \or - \localframed[#1][\c!empty=\v!yes,#2]{\dolocationattributes{#1}\c!style\c!color{#3}}% - \or - \localframed[#1][\c!empty=\v!yes,\c!frame=,\c!background=,#2]{\dolocationattributes{#1}\c!style\c!color{#3}}% - \or - \global\skippedmenuitemtrue - \fi - \else - \localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}% - \fi}}% - \ifskippedmenuitem\else\box\locationbox\fi} - -\def\setlocationboxnop#1[#2]#3[#4]% - {\locationclickfalse - \setbox\locationbox\hbox - {\resetgoto % anders cyclische aanroep ! - \global\skippedmenuitemfalse - \ifcase\csname\??am\??am\csname#1\c!unknownreference\endcsname\endcsname\relax - \localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}% - \or - \localframed[#1][\c!empty=\v!yes,#2]{\dolocationattributes{#1}\c!style\c!color{#3}}% - \or - \localframed[#1][\c!empty=\v!yes,\c!frame=,\c!background=,#2]{\dolocationattributes{#1}\c!style\c!color{#3}}% - \or - \global\skippedmenuitemtrue - \fi}% - \ifskippedmenuitem\else\box\locationbox\fi} - -\def\setlocationboxraw#1[#2]#3[#4]% - {\localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}} - -\def\setlocationbox#1[#2]#3[#4]% - {\bgroup % really needed ! - \edef\permittedreferences{\csname#1\c!obstruction\endcsname}% - \doifreferencepermittedelse{#4}% - {\setlocationboxyes{#1}[#2]{#3}[#4]}% - {\setlocationboxnop{#1}[#2]{#3}[#4]}% + \ctxlua{backends.codeinjections.setupcanvas { + mode = "\@@scoption", + doublesided = \ifsinglesided false\else\ifdoublesided true\else false\fi\fi, + leftoffset = \number\dimexpr\backoffset\relax, + topoffset = \number\dimexpr\topoffset \relax, + width = \number\dimexpr\!!widtha \relax, + height = \number\dimexpr\!!heighta \relax, + paperwidth = \number\paperwidth, + paperheight = \number\paperheight + }}% \egroup} - -\def\setlocationnop#1[#2]#3% - {\localframed[#1][#2]{#3}} - -\def\executeamboxcommands#1#2#3#4#5% - {%\processaction - % [\getvalue{\??am#1\c!dummy}] - % [ \v!yes=>\chardef\handleunknownmenuitem=0\relax, - % \v!empty=>\chardef\handleunknownmenuitem=1\relax, - % \v!no=>\chardef\handleunknownmenuitem=2\relax]% - \getvalue{\??am#1#3}\relax - \setamboxcommands{#1}{#4}% - \ignorespaces#2\unskip - \getvalue{\??am#1#5}} - -\newcounter\currentamposition - -\newtoks\everysetmenucommands - -\def\setamboxcommands#1#2% - {\def\currentmenu{#1}% % kan nog eerder - \def\currentsubmenu{#2}% % ? ? - \doglobal\newcounter\currentamposition - \the\everysetmenucommands} - -\def\menu@@amboxcommand#1\\% - {\dontleavehmode - \bgroup - \ignorespaces#1\unskip\relax - \ifskippedmenuitem \else - \getvalue{\??am\currentmenu\currentsubmenu}% - \fi - \egroup - \ignorespaces} - -\appendtoks - \let\@@amboxcommand\menu@@amboxcommand -\to \everysetmenucommands - -\def\menu@raw[#1]#2\\% - {\@@amboxcommand\gotobox{\ignorespaces#2\unskip}[#1]\\}% - -\def\menu@but[#1]#2\\% - {\@@amboxcommand\do@@amposition\currentmenu{#1}{\setlocationbox{\??am\currentmenu}[]{\ignorespaces#2\unskip}[#1]}\\}% - -\def\menu@got[#1]#2\\% pas op! offset - {\@@amboxcommand\setlocationbox{\??am\currentmenu}[\c!frame=\v!off,\c!background=]{\ignorespaces#2\unskip}[#1]\\}% -\def\menu@nop#1\\% - {\@@amboxcommand\setlocationboxraw{\??am\currentmenu}[\c!frame=\v!off,\c!background=,\c!empty=\v!yes]{\ignorespaces#1\unskip}[]\\}% - -\def\menu@txt#1\\% - {\@@amboxcommand\localframed[\??am\currentmenu][\c!frame=\v!off,\c!background=]{\ignorespaces#1\unskip}\\}% - -\def\menu@rul#1\\% ook \do@@amposition ! - {\@@amboxcommand\localframed[\??am\currentmenu][]{\ignorespaces#1\unskip}\\}% - -\def\menu@com#1\\% - {\ignorespaces#1\unskip\ignorespaces}% +\let\synchronizepaperdimensions \synchronizepaperdimensionscomplex \appendtoks - \let\raw\menu@raw - \let\but\menu@but - \let\got\menu@got - \let\nop\menu@nop - \let\txt\menu@txt - \let\rul\menu@rul - \let\com\menu@com -\to \everysetmenucommands - -\ifx\do@@amposition\undefined - \let\do@@amposition\gobbletwoarguments % hook for positional thingies -\fi - -\let\currentmenu\empty - -% beware : never change the concept of pbgoffset - -\def\menuparameter#1{\csname\??am\currentmenu#1\endcsname} - -\def\@@amhbox#1#2#3#4% - {\def\currentmenu{#3}% - \testinteractionmenu{#3}% - \iflocationmenupermitted - \bgroup - \showcomposition - \scratchdimen\dimexpr - \makeupwidth - +\pagebackgroundhoffset - +\pagebackgroundhoffset - -\menuparameter\c!leftoffset - -\menuparameter\c!rightoffset - \relax - \setbox\scratchbox\hbox to \scratchdimen - {\forgetall\executeamboxcommands{#3}{#4}\c!left\c!middle\c!right}% - \setbox\scratchbox\hbox{\do@@ammenuposition{#3}{\box\scratchbox}}% - \wd\scratchbox\makeupwidth % geen \ht=#2 setting (yet) - \hskip\dimexpr-\pagebackgroundhoffset+\menuparameter\c!leftoffset\relax - \box\scratchbox - \egroup - \else - #1\relax - \fi} - -\def\@@amvbox#1#2#3#4% don't change skipping, this one works! - {\def\currentmenu{#3}% - \testinteractionmenu{#3}% - \iflocationmenupermitted - \bgroup - \showcomposition - \scratchdimen\dimexpr - \textheight - +\pagebackgroundvoffset - +\pagebackgroundvoffset - +\pagebackgrounddepth - -\menuparameter\c!topoffset - -\menuparameter\c!bottomoffset - \relax - \setbox\scratchbox\vbox to \scratchdimen - {\forgetall % Voor't geval de afstand - %\setupblank[\v!standard]% % (tijdelijk) is aangepast. - \restorestandardblank - \hsize#2\relax - \executeamboxcommands{#3}{#4}\c!before\c!inbetween\c!after}% - \setbox\scratchbox\vbox{\hbox{\do@@ammenuposition{#3}{\box\scratchbox}}}% - \setbox\scratchbox\vbox - {\ht\scratchbox\zeropoint - \vskip\dimexpr-\pagebackgroundvoffset+\menuparameter\c!topoffset\relax - \box\scratchbox - \vskip\pagebackgroundvoffset}% overbodig - \ht\scratchbox\textheight - \wd\scratchbox#2\relax - \box\scratchbox - \egroup - \else - #1\relax - \fi} - -\ifx\do@@ammenuposition\undefined - \let\do@@ammenuposition\gobbleoneargument % hook for positional thingies -\fi - -\setvalue{\??am\s!do\v!right }{\@@amvbox{\dodummypageskip\v!right }\rightedgewidth} -\setvalue{\??am\s!do\v!left }{\@@amvbox{\dodummypageskip\v!left }\leftedgewidth } -\setvalue{\??am\s!do\v!top }{\@@amhbox{\dodummypageskip\v!top }\topheight } -\setvalue{\??am\s!do\v!bottom}{\@@amhbox{\dodummypageskip\v!bottom}\bottomheight } - -\def\dointeractionmenu#1#2% - {\getvalue{\??am\s!do\getvalue{\??am#1\c!location}}{#1}{#2}} - -\unexpanded\def\interactionmenu[#1]% - {\getvalue{\??am\c!menu#1}} - -\def\horizontalinteractionmenu#1#2#3#4% - {\ifdim#2>\zeropoint % new - \scratchdimen\zeropoint - \setbox\scratchbox\hbox - {\def\docommand##1% - {\doifnotvalue{\??am##1\c!state}\v!none - {\hskip\scratchdimen - \setbox2\hbox to #2 - {\getvalue{\??am##1#3}\interactionmenu[##1]\getvalue{\??am##1#4}}% - \doifelsevalue{\??am##1\c!distance}\v!overlay - {\scratchdimen\zeropoint - \wd2\zeropoint}% - {\scratchdimen\getvalue{\??am##1\c!distance}}% - \box2}}% - \startinteraction - \processcommacommand[\getvalue{\??am#1}]\docommand - \stopinteraction}% - \wd\scratchbox#2\relax - \box\scratchbox - \fi} - -\def\verticalinteractionmenu#1#2#3#4% - {\ifdim#2>\zeropoint % new - \scratchdimen\zeropoint - \setbox\scratchbox\vbox - {\def\docommand##1% - {\doifnotvalue{\??am##1\c!state}\v!none - {\vskip\scratchdimen - \setbox2\vbox to #2 - {\getvalue{\??am##1#3}\interactionmenu[##1]\getvalue{\??am##1#4}}% - \doifelsevalue{\??am##1\c!distance}\v!overlay - {\scratchdimen\zeropoint - \offinterlineskip - \dp2\zeropoint - \ht2\zeropoint}% - {\scratchdimen\getvalue{\??am##1\c!distance}}% - \box2}}% - \startinteraction - \processcommacommand[\getvalue{\??am#1}]\docommand - \stopinteraction}% - \ht\scratchbox#2\relax - \dp\scratchbox\zeropoint - \box\scratchbox - \fi} - -\letvalue{\??am\v!left }\empty -\letvalue{\??am\v!right}\empty -\letvalue{\??am\v!top }\empty -\letvalue{\??am\v!bottom }\empty - -% todo : \defineinteractionmenuclass - -\def\interactionmenus[#1]% - {\iflocation - \getvalue{\??am\??am\c!menu#1}% - \else - \dodummypageskip{#1}% - \fi} - -\setvalue{\??am\??am\c!menu\v!left }{\horizontalinteractionmenu\v!left \leftedgewidth \c!left \c!right} -\setvalue{\??am\??am\c!menu\v!right }{\horizontalinteractionmenu\v!right \rightedgewidth\c!left \c!right} -\setvalue{\??am\??am\c!menu\v!top }{\verticalinteractionmenu \v!top \topheight \c!before\c!after} -\setvalue{\??am\??am\c!menu\v!bottom}{\verticalinteractionmenu \v!bottom\bottomheight \c!before\c!after} - -% this can be implemented with the following command (which -% is new, undocumented, experimental, untested, etc etc) - -\def\defineinteractionmenuclass - {\dodoubleargument\dodefineinteractionmenuclass} + \ifproductionrun + \doifelse\@@pcstate\v!start + {\let\synchronizepaperdimensions\synchronizepaperdimensionssimple} + {\let\synchronizepaperdimensions\synchronizepaperdimensionscomplex}% + \fi +\to \everysetupinteractionscreen + +\appendtoks \synchronizepaperdimensions \to \everyshipout + +%D The next mechanism, linked lists, is quite old and +%D is \MKIV'd for completeness. I will finish the +%D confuguration part when I need it. -\def\dodefineinteractionmenuclass[#1][#2]% tag hori|veri - {\doifelse{#2}\v!vertical - {\setvalue{\??am\??am\c!menu#1}{\verticalinteractionmenu {#1}{\getvalue{\??am#1\c!width }}\c!before\c!after}} - {\setvalue{\??am\??am\c!menu#1}{\horizontalinteractionmenu{#1}{\getvalue{\??am#1\c!height}}\c!left\c!right }}} +% todo: a kind of button that gets a tag passed (\??tk) -% \setupinteraction[menu=on,state=start] -% -% \defineinteractionmenuclass[test] [vertical] -% \defineinteractionmenuclass[another][horizontal] -% -% \defineinteractionmenu[test] [left][state=start,width=4cm] -% \defineinteractionmenu[another][top] [state=start,height=1cm] -% -% \startinteractionmenu[test] -% \but [firstpage] test-a \\ -% \but [nextpage] test-b \\ -% \stopinteractionmenu -% -% \startinteractionmenu[another] -% \but [firstpage] test-a \\ -% \but [nextpage] test-b \\ -% \stopinteractionmenu -% -% \setupheadertexts[{\interactionmenu[another]}] -% % \starttext -% -% test \interactionmenu[test] \page -% test \interactionmenu[test] \page -% +% \setupinteraction[state=start] +% \definelinkedlist[demo] +% \dorecurse{10}{\linkedlistelement[demo]{link \recurselevel} \page} % \stoptext -%D This can save complicated menu macros when one want to -%D keep control over parts of a menu (i.e.\ turn them on and -%D off). We could have achieved something similar with modes. - -\def\local@@ambox#1#2#3#4% don't change skipping, this one works! - {\bgroup - \testinteractionmenu{#3}% - \iflocationmenupermitted - \executeamboxcommands{#3}{#4}\c!before\c!inbetween\c!after - \else - #1\relax - \fi - \egroup} +\def\linkedlistparameter #1{\csname\dolinkedlistparameter{\??lk\currentlinkedlist}#1\endcsname} +\def\dolinkedlistparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dolinkedlistparentparameter\csname#1\s!parent\endcsname#2\fi} +\def\dolinkedlistparentparameter#1#2{\ifx#1\relax\s!empty\else\dolinkedlistparameter#1#2\fi} -\def\includemenu[#1]% - {\doifvalue{\??am#1\c!state}\v!local - {\bgroup - \letvalue{\??am#1\c!state}\v!start - \let\@@amvbox\local@@ambox - \let\@@amhbox\local@@ambox - \getvalue{\??am\c!menu#1}% - \egroup}} - -%D We also need an explicit position control some day. I'll -%D do that when I need it. [The stacking order.] - -\newif\ifextendedmenu - -% [name] [location] -% [name] [location] [pars] - -\def\defineinteractionmenu - {\dotripleempty\dodefineinteractionmenu} - -\def\dodefineinteractionmenu[#1][#2][#3]% - {% main settings - \letvalue{\??am\c!menu#1}\empty - \setvalue{\@@dodolistelement#1}{\def\dosomelistelement{\dodomenulistelement{#1}}}% - \presetlocalframed[\??am#1]% - % register location - \expanded{\addtocommalist{#1}\@EA\noexpand\csname\??am#2\endcsname}% - % inherit settings - \doifnot{#1}{#2} - {\copyparameters[\??am#1][\??am#2] - [\c!left,\c!middle,\c!right,\c!before,\c!after,\c!inbetween,% - \c!width,\c!height,\c!distance,\c!offset,% - \c!frame,\c!framecolor,\c!rulethickness,% - \c!background,\c!backgroundcolor,\c!backgroundscreen,% - \c!style,\c!color,\c!contrastcolor,\c!samepage,\c!unknownreference,% - \c!leftoffset,\c!rightoffset,\c!topoffset,\c!bottomoffset]}% - % additional settings - \getparameters[\??am#1][\c!location=#2,\c!obstruction=,#3]} - -\def\setupinteractionmenu - {\dodoubleargument\dosetupinteractionmenu} - -\def\dosetupinteractionmenu[#1][#2]% - {\def\docommand##1{\getparameters[\??am##1][#2]}% - \processcommalist[#1]\docommand} - -\expandafter\chardef\csname\??am\??am\v!yes \endcsname\zerocount -\expandafter\chardef\csname\??am\??am\v!empty\endcsname\plusone -\expandafter\chardef\csname\??am\??am\v!no \endcsname\plustwo -\expandafter\chardef\csname\??am\??am\v!none \endcsname\plusthree -\expandafter\chardef\csname\??am\??am \endcsname\plusone % default - -\processbetween{\v!interactionmenu}\dostartinteractionmenu - -\def\dostartinteractionmenu#1% - {\dodostartinteractionmenu#1\dodostopinteractionmenu} - -\def\dodostartinteractionmenu[#1]#2\dodostopinteractionmenu - {\setvalue{\??am\c!menu#1}{\extendedmenutrue\dointeractionmenu{#1}{#2}}} - -\def\resetinteractionmenu[#1]% - {\letvalue{\??am\c!menu#1}\empty} - -\def\dodomenulistelement#1#2#3#4#5#6#7% - {\setbox0=\hbox - {\let\gotolocation\gobbleoneargument % hack to catch last [] - %\locationclickfalse % ipv ^ - \docheckrealreferencepage{#7}% - \setlocationboxyes - {\??am#1}% % needed ! - []% no settings - {\limitatetext{#5}{\namedlistparameter{#2}\c!maxwidth}{\unknown}}% % needed ! - []}% normally the destination, catch by gobble - \@@amboxcommand\do@@amposition{#1}{#7}% beware, we pass the pagenumber - {\ignorespaces\linklisttoelement{#3}{#6}{#7}{\box0}\unskip}\\} - -% \scherm moet worden als \page +\def\definelinkedlist{\dodoubleargument\dodefinelinkedlist} +\def\setuplinkedlist {\dodoubleargument\dosetuplinkedlist } +\def\setuplinkedlists{\dosingleargument\dosetuplinkedlists} -\def\screen - {\dosingleempty\doscreen} - -\def\doscreen[#1]% - {\iflocation\page[#1]\fi} - -\unexpanded\def\menubutton - {\dodoubleempty\domenubutton} - -\def\domenubutton[#1]% - {\iffirstargument - \ifsecondargument - \@EAEAEA\domenubuttonB - \else - \doifassignmentelse{#1} - {\@EAEAEA\domenubuttonC} - {\@EAEAEA\domenubuttonD}% - \fi - \else - \@EA\domenubuttonA - \fi[#1]} - -\def\domenubuttonA[#1][#2]#3[#4]% normal button, no parameters - {\bgroup - %\locationdummytrue - \setlocationbox\??bt[]{#3}[#4]% - \egroup} +\def\dodefinelinkedlist[#1][#2]% + {\ctxlua{interactions.definelinkedlist("#1")}% + \getparameters[\??lk#1][\s!parent=\??lk,#2]} -\def\domenubuttonB[#1][#2]#3[#4]% menu button, with parameters - {\bgroup - %\locationdummytrue - \setlocationbox{\??am#1}[#2]{#3}[#4]% - \egroup} - -\def\domenubuttonC[#1][#2]#3[#4]% normal button, with parameters - {\bgroup - %\locationdummytrue - \setlocationbox\??bt[#1]{#3}[#4]% - \egroup} - -\def\domenubuttonD[#1][#2]#3[#4]% menu button, no parameters - {\bgroup - %\locationdummytrue - \setlocationbox{\??am#1}[]{#3}[#4]% - \egroup} - -\def\menubox - {\dodoubleempty\domenubox} - -\def\domenubox[#1][#2]#3% - {\bgroup - \let\setlocationbox\setlocationboxraw - \domenubutton[#1][#2]#3[]% - \egroup} - -% Hier volgen de synchronisatiemacro's: - -\def\syncprefix{sync} - -%def\syncmarker{syncmark} -%\definemarking[\syncmarker] -%\setupmarking[\syncmarker][\c!expansie=\v!ja] - -\newmark\syncmarker - -\newcounter\synccounter - -\newif\ifsynchronisation - -\def\startsynchronization% - {\iflocation\ifsynchronisation - \doglobal\increment\synccounter - \fi\fi} - -\def\stopsynchronization% - {\iflocation\ifsynchronisation - %\thisisdestination{\syncprefix:\synccounter}% - \pagereference[\syncprefix:\synccounter]% - \ifvmode - \@EA\setmark\@EA\syncmarker\@EA{\synccounter} % \marking[\syncmarker]{\synccounter}% - \else - \showmessage\m!interactions4\synccounter - \fi - \fi\fi} +\def\dosetuplinkedlist[#1][#2]% + {\getparameters[\??lk#1][#2]} -\def\synchronize% - {\startsynchronization - \stopsynchronization} +\def\dosetuplinkedlists[#1]% + {\getparameters[\??lk][#1]} -\def\dosetupsynchronization[#1]% - {\getparameters[\??sy][#1]% - \doifelse\@@systate\v!start - \synchronisationtrue - \synchronisationfalse} +\def\setlinkproperties#1#2#3#4#5#6% + {\def\currentlink {#1}% + \def\noflinks {#2}% + \def\firstlink {#3}% + \def\previouslink{#4}% + \def\nextlink {#5}% + \def\lastlink {#6}} -\def\setupsynchronization - {\dosingleargument\dosetupsynchronization} - -\def\definesynchronization - {\dosingleargument\dodefinesynchronization} - -\def\setupsynchronizationbar - {\dodoubleargument\getparameters[\??ba]} - -\presetlocalframed[\??ba] - -\setvalue{synchronisatie\v!page}[#1]% - {\bgroup - %\setupinteraction[\c!width=\!!zeropoint]% - \setinteractionparameter\c!width\!!zeropoint - \setbox0\hbox - {\localframed[\??ba][]{\dolocationattributes\??ba\c!style\c!color{\strut\@@batext}}}% - \dontcomplain - \def\atthebottom - {\leaders\hrule\!!depth1ex\!!height-.5ex\hfil}% - \def\atthetop##1##2##3% - {\dimen0=\wd0 - \divide\dimen0 3 - \multiply\dimen0 ##2\relax - \dimen2=.25em % brrr - \advance\dimen0 -##3\dimen2 - %\gotodestination - % {}{#1}{\syncprefix:##1}{} - % {\hbox to \dimen0{\color[\locationcolor\@@bacolor]{\atthebottom}}}}% - \gotobox - {\hbox to \dimen0{\color[\locationcolor\@@bacolor]{\atthebottom}}}% - [#1::\syncprefix:##1]}% - \hbox - {\def\check##1##2% - {\edef##2{0##1\syncmarker}% - \ifnum0##2=0 \def##2{1}\fi}% - \check\gettopmark\top - \check\getfirstmark\first - \check\getbotmark\bot - \setbox2\hbox to \wd0 - {\ifnum\top=\first\relax - \ifnum\first=\bot\relax - \atthetop\first30\relax - \else - \atthetop\first21\hss\atthetop\bot11\relax - \fi - \else - \ifnum\first=\bot\relax - \atthetop\top11\hss\atthetop\first21\relax - \else - \atthetop\top11\hss\atthetop\first11\hss\atthetop\bot11\relax - \fi - \fi}% - \wd2=\zeropoint\box2 - \box0\relax}% - \egroup} - -\setvalue{synchronisatie\v!local}[#1]% - {\bgroup - %\setupinteraction[\c!width=\!!zeropoint]% - \setinteractionparameter\c!width\!!zeropoint - \def\blackrule{\hbox{\vrule\!!height.5em\!!width.5em}}% - %\gotodestination - % {}{##1}{\syncprefix:#1}{0} - % {\color[\locationcolor\@@bacolor]{\blackrule}}% - \gotobox % - {\color[\locationcolor\@@bacolor]{\blackrule}}% - [#1::\syncprefix:\synccounter]% - \egroup} - -\def\synchronizationbar[#1][#2]% - {\iflocation\ifsynchronisation - \bgroup - \setupsynchronizationbar - [\c!text=\getvalue{doc:des:#1},#2]% - \getvalue{synchronisatie\@@baalternative}[#1]% - \egroup - \fi\fi} - -% A nice application of glue. All this code will be rewritten and -% generalized. - -\newbox\interactionbarbox - -\newif\ifbarsymbol - -\def\dogotosomepage#1#2#3% nog checken ! - {\hbox - {\iflocation - \ifnum#3=\realpageno - #2% - \else - \gotorealpage\empty\empty{#3}{\doifsomething{#1}{\dolocationattributes{#1}\c!style\c!color}{#2}}% +\def\linkedlistelement[#1]#2% currently no view support + {\dontleavehmode\hbox\bgroup + #2% + \iflocation + \edef\currentlinkedlist{#1}% + \ifcsname\??lk\currentlinkedlist\s!parent\endcsname + \hskip\linkedlistparameter\c!distance + \ctxlua{interactions.addlinktolist("\currentlinkedlist")}% + \expanded{\ctxlatelua{interactions.enhancelinkoflist("\currentlinkedlist",\currentlink)}}% + \dogotosomepage {\??lk\currentlinkedlist}\gotobegincharacter \firstlink + \ifnum\noflinks>\plustwo + \dogotosomepage{\??lk\currentlinkedlist}\gobackwardcharacter\previouslink + \dogotosomepage{\??lk\currentlinkedlist}\goforwardcharacter \nextlink \fi + \dogotosomepage {\??lk\currentlinkedlist}\gotoendcharacter \lastlink \else - #2% - \fi}} - -\def\dogotosomecontrastpage#1#2#3% nog checken, may replace previous - {\checkreferences % nodig ?? - \hbox - {\iflocation - \ifnum#3=\realpageno - \gotorealpage\empty\empty{#3}{\doifsomething{#1}{\dolocationattributes{#1}\c!style\c!contrastcolor}{#2}}% - \else - \gotorealpage\empty\empty{#3}{\doifsomething{#1}{\dolocationattributes{#1}\c!style\c!color}{#2}}% - \fi - \else - #2% - \fi}} - -\presetlocalframed[\??ib] - -\def\interactionbara % we need better control over contrastcolor - {\iflocation % maybe just use gotopage and set colors - \bgroup - \setinteractionparameter\c!width\zeropoint - \setupblackrules[\c!height=\v!max,\c!depth=\v!max]% - \!!widthb\dimexpr\@@ibwidth-2.75\emwidth\relax - \!!widtha\dimexpr\!!widthb/\lastpage\relax - \bgroup - \advance\realpageno\minusone - \ifvoid\interactionbarbox - \bgroup - \processaction - [\@@ibstep] - [ \v!small=>\scratchdimen.25\emwidth, - \v!medium=>\scratchdimen.5\emwidth, - \v!big=>\scratchdimen\emwidth, - \s!unknown=>\scratchdimen\!!widtha]% - \ifdim\!!widtha<\scratchdimen\relax - \!!counta\numexpr\scratchdimen/\!!widtha\relax - \else - \!!counta\@@ibstep\relax - \fi - \!!widtha\!!counta\!!widtha - \setbox\scratchbox\hbox{\blackrule[\c!width=\!!widtha,\c!color=middlegray]}% color here, else no mkiv - \global\setbox\interactionbarbox\hbox to \!!widthb - {\hss - \dostepwiserecurse\plusone\lastpage\!!counta - {\gotorealpage\empty\empty\recurselevel{\copy\scratchbox}}% - \hss}% - \global\wd\interactionbarbox\zeropoint - \egroup - \fi - \egroup - \noindent - \strut - \hbox to \@@ibwidth - {\dontcomplain - \setupblackrules[\c!width=\emwidth]% - \dogotosomecontrastpage\??ib\blackrule\firstpage - \hss - \copy\interactionbarbox - \hbox to \!!widthb - {\ifdim\!!widtha<\emwidth - \!!widtha\emwidth - \fi - \setupblackrules[\c!width=\!!widtha]% - \ifnum\realpageno>\plusone - \!!counta\numexpr\realpageno-\plustwo\relax - \hskip\zeropoint\!!plus\!!counta \s!sp\relax % cm gives overflow - \dogotosomepage\??ib\blackrule\prevpage - \fi - \dogotosomecontrastpage\??ib{\blackrule[\c!width=.5em]}\realpageno - \ifnum\realpageno<\lastpage\relax - \dogotosomepage\??ib\blackrule\nextpage - \!!counta\numexpr\lastpage-\realpageno-\plusone\relax - \hskip\zeropoint\!!plus\!!counta \s!sp\relax % cm gives overflow - \fi}% - \hss - \dogotosomecontrastpage\??ib\blackrule\lastpage}% - \egroup - \fi} - -\def\interactionbarb - {\ifnum\lastpage>\firstpage\relax - \interactionbuttons[\v!firstpage,\v!previouspage,\v!nextpage,\v!lastpage]% - \fi} - -\def\interactionbarc - {\iflocation - \ifnum\lastpage>\plusone - \hbox to \@@ibwidth - {\setupblackrules[\c!height=\@@ibheight,\c!depth=\@@ibdepth]% - \scratchdimen\dimexpr(\@@ibwidth-4\emwidth)/\numexpr\lastpage+\minusone\relax\relax - \!!widtha\numexpr\realpageno+\minusone\relax\scratchdimen - \!!widthb\numexpr\lastpage-\realpageno\relax\scratchdimen - \startcolor[\locationcolor\@@ibcolor]% - \dogotosomepage\empty{\blackrule[\c!width=\emwidth]}\firstpage - \hss - \dogotosomepage\empty{\blackrule[\c!width=\!!widtha]}\prevpage - \color[\@@ibcontrastcolor]{\blackrule[\c!width=\emwidth]}% - \dogotosomepage\empty{\blackrule[\c!width=\!!widthb]}\nextpage - \hss - \dogotosomepage\empty{\blackrule[\c!width=\emwidth]}\lastpage - \stopcolor}% - \fi - \fi} - -\def\interactionbard - {\iflocation\ifshowingsubpage - \ifnum\nofsubpages>\plusone - \hbox \bgroup - \setinteractionparameter\c!width\!!zeropoint - \ifbarsymbol - \setupsymbolset[\@@iasymbolset]% - \def\dogotox##1% - {\hbox{\symbol[\ifcase##1 \v!previous\or\v!somewhere\or\v!next\fi]}}% - \else - \def\dogotox##1% - {\hbox{\vrule\!!height\@@ibheight\!!depth \@@ibdepth\!!width \@@ibwidth}}% - \fi - \dostepwiserecurse\plusone\nofsubpages\plusone - {\bgroup - \scratchcounter\numexpr\recurselevel+\firstsubpage+\minusone\relax - \ifnum\scratchcounter<\realpageno\relax - \dogotosomecontrastpage\??ib{\dogotox0}\scratchcounter - \else\ifnum\scratchcounter=\realpageno\relax - \dogotosomecontrastpage\??ib{\dogotox1}\scratchcounter - \else - \dogotosomecontrastpage\??ib{\dogotox2}\scratchcounter - \fi\fi - \egroup - \hskip\@@ibdistance}% - \unskip % not needed - \egroup - \fi - \fi\fi} - -\def\interactionbare% KAN WORDEN GECOMBINEERD MET D - {\iflocation\ifshowingsubpage - \ifnum\nofsubpages>\plusone - \bgroup - \!!widthb\dimexpr\nofsubpages\dimexpr\@@ibdistance\relax-\@@ibdistance\relax % (n-1) - \!!widtha\dimexpr(\@@ibwidth-\!!widthb)/\nofsubpages\relax - \ifdim\!!widtha<\@@ibdistance\relax - \interactionbarf - \else - \setinteractionparameter\c!width\!!zeropoint - \noindent - \hbox to \@@ibwidth - \bgroup - \ifbarsymbol - \setupsymbolset[\@@iasymbolset]% - \def\dogotox##1% - {\hbox{\symbol[\ifcase##1 \v!previous\or\v!somewhere\or\v!next\fi}}% - \else - \def\dogotox##1% - {\hbox{\vrule\!!height\@@ibheight\!!depth\@@ibdepth\!!width\!!widtha}}% - \fi - \dostepwiserecurse\plusone\nofsubpages\plusone - {\bgroup - \scratchcounter\numexpr\recurselevel+\firstsubpage+\minusone\relax - \ifnum\scratchcounter<\realpageno\relax - \dogotosomecontrastpage\??ib{\dogotox0}\scratchcounter - \else\ifnum\scratchcounter=\realpageno\relax - \dogotosomecontrastpage\??ib{\dogotox1}\scratchcounter - \else - \dogotosomecontrastpage\??ib{\dogotox2}\scratchcounter - \fi\fi - \egroup - \hss}% - \unskip - \egroup - \fi - \egroup + \writestatus\m!interactions{no such linked list: \currentlinkedlist}% \fi - \fi\fi} - -\def\interactionbarf % !! KAN WORDEN GECOMBINEERD MET D !! - {\iflocation\ifshowingsubpage - \ifnum\nofsubpages>\plusone - \setinteractionparameter\c!width\!!zeropoint - \noindent - \hbox to \@@ibwidth - \bgroup - \!!countb\zerocount - \loop % todo: \doloop - \advance\!!countb \plusone - %\!!countc\nofsubpages \divide\!!countc \!!countb \advance\!!countc \plusone - \!!countc\numexpr(\nofsubpages/\!!countb)+\plusone\relax % rounding - \!!widthb\@@ibdistance - \multiply\!!widthb \!!countc - \advance\!!widthb -\@@ibdistance - \!!widtha\@@ibwidth - \advance\!!widtha -\!!widthb - \divide\!!widtha \!!countc - \ifdim\!!widtha<\@@ibdistance\relax - \repeat - \ifnum\!!countc>\plusone - % this is not that well tested - \advance\!!countc \minustwo - \!!widtha-\@@ibdistance - \!!widtha\!!countc\!!widtha - \advance\!!widtha \@@ibwidth - \advance\!!countc \plusone - \divide\!!widtha \!!countc - \fi - \ifbarsymbol - \setupsymbolset[\@@iasymbolset]% - \def\dogotox##1% - {\hbox{\symbol[\ifcase##1 \v!previous\or\v!somewhere\or\v!somewhere\or\v!somewhere\or\v!next\fi}}% - \else - \def\dogotox##1% - {\hbox - {\!!heighta\@@ibheight - \!!deptha\@@ibdepth - \ifcase##1\relax - \vrule\!!height \!!heighta\!!depth \!!deptha\!!width\!!widtha - \or - \vrule\!!height.5\!!heighta\!!depth.5\!!deptha\!!width\!!widtha - \or - \vrule\!!height \!!heighta\!!depth \!!deptha\!!width\!!widtha - \or - \vrule\!!height.5\!!heighta\!!depth.5\!!deptha\!!width\!!widtha - \or - \vrule\!!height \!!heighta\!!depth \!!deptha\!!width\!!widtha - \fi}}% - \fi - \!!countc\numexpr\realpageno-\plustwo\relax - \!!countd\numexpr\realpageno+\plustwo\relax - \ifnum\!!countc<\plusone \!!countc\plusone \fi - \!!countf\zerocount - \dostepwiserecurse\firstsubpage\lastsubpage\plusone - {\!!doneafalse - \advance\!!countf \plusone - \ifnum\recurselevel=\firstsubpage\relax \!!doneatrue \fi - \ifnum\recurselevel=\lastsubpage\relax \!!doneatrue \fi - \if!!donea - \ifnum\recurselevel<\realpageno - \dogotosomecontrastpage\??ib{\dogotox0}\recurselevel - \else\ifnum\recurselevel>\realpageno - \dogotosomecontrastpage\??ib{\dogotox2}\recurselevel - \else - \dogotosomecontrastpage\??ib{\dogotox4}\recurselevel - \fi\fi - \hss - \!!countf\zerocount - \else\ifnum\!!countf=\!!countb - \ifnum\recurselevel<\realpageno - \dogotosomecontrastpage\??ib{\dogotox1}\recurselevel - \else\ifnum\recurselevel>\realpageno - \dogotosomecontrastpage\??ib{\dogotox3}\recurselevel - \else - \dogotosomecontrastpage\??ib{\dogotox2}\recurselevel - \fi\fi - \hss - \!!countf\zerocount - \fi\fi}% - \unskip - \egroup - \fi - \fi\fi} - -\def\interactionbarg - {\ifnum\lastsubpage>\firstsubpage\relax - \interactionbuttons[\v!firstsubpage,\v!previoussubpage,\v!nextsubpage,\v!lastsubpage]% - \fi} - -\def\checkinteractionbar#1#2#3% - {\ifdim\@@ibwidth=\zeropoint\def\@@ibwidth{#1}\fi - \doifnothing\@@ibheight{\def\@@ibheight{#2}}% - \doifnothing\@@ibdepth{\def\@@ibdepth{#3}}} - -\def\complexinteractionbar[#1]% - {\doifelse{#1}\v!reset - {\global\setbox\interactionbarbox\emptybox}% - {\bgroup - \iflocation - \checksubpages % goes wrong / loads \numberofpages too - \getparameters[\??ib][#1]% - \doif\@@ibstate\v!start - {\startinteraction - \processaction % breedte defaults ! - [\@@ibalternative] - [ c=>\checkinteractionbar{10em}\v!max \v!max, - d=>\checkinteractionbar{.5em}{.5em} \!!zeropoint, - e=>\checkinteractionbar{10em}{.5em} \!!zeropoint, - f=>\checkinteractionbar{10em}{.5em} \!!zeropoint, - \s!default=>\checkinteractionbar{10em}\v!broad\!!zeropoint, - \s!unknown=>\checkinteractionbar{10em}\v!broad\!!zeropoint]% - \doifelse\@@ibsymbol\v!yes - \barsymboltrue\barsymbolfalse - \getvalue{interactionbar\@@ibalternative}% - \stopinteraction}% - \fi - \egroup}} - -\definecomplexorsimpleempty\interactionbar - -\def\setupinteractionbar - {\dodoubleargument\getparameters[\??ib]} - -% Er wordt vooralsnog uitgegaan van een symmetrische -% start-stop situatie. - -\def\c!profiel!! {profiel:} % brrr -\def\c!versie!! {versie:} - -\def\dodefineprofile[#1][#2]% - {\iflocation - \def\dododefineprofile##1% - {\def\dodododefineprofile####1% - {\doifdefinedelse{\c!profiel!!####1}% - {\edef\!!stringa{\getvalue{\c!profiel!!####1}}% - \setevalue{\c!profiel!!####1}{\!!stringa,##1}}% - {\setevalue{\c!profiel!!####1}{##1}}}% - \processcommalist[#2]\dodododefineprofile}% - \processcommalist[#1]\dododefineprofile - \fi} - -\def\defineprofile% - {\dodoubleargument\dodefineprofile} - -% Als met \getpar wordt gewerkt, dan moet \next worden toegepast. - -% TZT initialisatie! - -\def\profilepage{} - -\let\dosetprofilepage\relax -\let\dogetprofilepage\relax - -\def\processprofile#1[#2]% - {\iflocation - \par % needed for pdftex - \bgroup - \dosetprofilepage - \dogetprofilepage - \def\processoneprofile##1##2% - {\ExpandBothAfter\doifinsetelse{##2}{\processedprofiles}% - {\doifsomething{##1}{(##1)}}% - {\addtocommalist{##2}\processedprofiles - ##1\relax - \ifcase#1\relax - \dobeginofprofile{##2}\paperwidth\paperheight\profilepage - \else - \doendofprofile - \fi}}% - \let\processedprofiles\empty - \def\doprocessprofile##1% - {\doifelse{\@@pfoption}{\v!test}% - {\goodbreak\blank\nobreak\tt[\space - \ifcase#1\v!start\else\v!stop\fi profiel\space ##1:\space - \doifdefinedelse{\c!profiel!!##1}% - {\def\dodoprocessprofile####1% - {\processoneprofile - {\goto{####1}[\c!profiel!!####1]}% - {####1}% - \space}% - \processcommacommand - [\getvalue{\c!profiel!!##1}]\dodoprocessprofile}% - {- }% - ]\nobreak\blank}% - {\doifdefined{\c!profiel!!##1}% - {\def\dodoprocessprofile####1% - {\processoneprofile{}{####1}}% - \processcommacommand - [\getvalue{\c!profiel!!##1}]\dodoprocessprofile}}}% - \processcommalist[#2]\doprocessprofile - \egroup - \par % needed for pdftex - \fi} - -\def\startprofile[#1]% - {\iflocation - \bgroup - \addtocommalist{#1}\actualprofile - \def\stopprofile% - {\processprofile1[#1]% - \egroup}% - \def\next{\processprofile0[#1]}% % \DoAfterFi \processprofile0[#1]% - \else % ^^^^^^^^^^ will be obsolete - \let\next\relax % since ugly and never used \fi - \next} - -\let\stopprofile\relax - -\def\dofollowprofile#1[#2]% - {\iflocation - \hbox - {\dohandlegoto - {\dolocationattributes\??ia\c!style\c!color{#1\presetgoto}}% - {\dostartgotoprofile\buttonwidth\buttonheight{#2}}% - {\dostopgotoprofile}}% - \else - {#1}% - \fi} - -\def\followprofile#1[#2]% - {\iflocation - \doif\@@pfoption\v!test{\pagereference[\c!profiel!!#2]}% - \dofollowprofile{#1}[#2]% - \fi} - -\def\setupprofiles% - {\dodoubleargument\getparameters[\??pf]} - -% Als er nog geen tekst op de pagina staat, dan heeft het -% profiel betrekking op het bovenstaande, dus soms een vorige -% pagina! Vreemd, omdat PDF paginagewijs werkt. Gelukkig -% biedt /page een oplossing. Echter: expansie van een -% \special kan niet worden uitgesteld, zodat alleen een -% two-pass een oplossing vormt. Het onderstaande kan komen -% te vervallen als Acrobat dit ondervangt. Het scheelt een -% pass en een lijst. -% -% Er kunnen eventueel twee lijsten worden gebruikt. Een voor -% het begin (start) en een voor het eind (stop). Nu staat -% alles in een lijst. - -\definetwopasslist\s!profile - -\newcounter\currentprofile - -\def\dosetprofilepage% - {\doglobal\increment\currentprofile - \lazysavetwopassdata{\s!profile}{\currentprofile}{\noexpand\realfolio}} - -\def\dogetprofilepage% - {\gettwopassdata{\s!profile}% - \let\profilepage=\twopassdata} - -% is this stuff used at all - -\newcounter\versionlevel -\newcounter\versionorder - -\newif\ifrecentversion - -\let\oldatcharacter=@ - -\def\minimumversion{0} -\def\actualversion{0} + \egroup} -\def\dosetupversions[#1]% - {\getparameters[\??ve][#1] - \stripcharacter.\from\@@venumber\to\minimumversion} +\setuplinkedlists + [\c!distance=.25em, + \c!width=\v!fit, + \c!location=\v!low, + \c!color=\@@iacolor, + \c!frame=\v!off, + \c!background=, + \c!backgroundcolor=] -\def\setupversions - {\dosingleargument\dosetupversions} +\def\koppeling {\linkedlistelement} +\def\stelkoppelingenin {\setuplinkedlists} +\def\definieerkoppeling{\definelinkedlist} -\definetwopasslist\s!versionbegin -\definetwopasslist\s!versionend +%D Conditional page breaks: -\let\actualprofile\empty +\def\screen + {\dosingleempty\doscreen} -\def\doresetpageversion - {\lazysavetwopassdata{\s!versionend}{\versionorder}{\noexpand\realfolio}} +\def\doscreen[#1]% + {\iflocation\page[#1]\fi} -\def\dosetpageversion#1% - {\recentversiontrue - \doglobal\increment\versionorder\relax - \lazysavetwopassdata{\s!versionbegin}{\versionorder}{\noexpand\realfolio}% - \let\resetpageversion\doresetpageversion} +%D Page transitions: -\def\recentcontributions{} +\let\askedpagetransitions\empty -\def\checkrecentcontributions% - {\gettwopassdata{\s!versionbegin}% - \iftwopassdatafound - \!!counta\twopassdata\relax - \gettwopassdata{\s!versionend}% - \iftwopassdatafound - \!!countb\twopassdata\relax - \doglobal\increment\versionorder\relax - \savetwopassdata{\s!versionbegin}{\versionorder}{\the\!!counta}% - \savetwopassdata{\s!versionend }{\versionorder}{\the\!!countb}% - \dostepwiserecurse\!!counta\!!countb\plusone - {\@EA\doglobal\@EA\addtocommalist\@EA{\recurselevel}{\recentcontributions}}% - \let\next\checkrecentcontributions - \else - \let\next\relax - \fi - \else - \let\next\relax - \fi - \next} +\def\setuppagetransitions + {\dosingleempty\dosetuppagetransitions} -\def\docheckpageversion - {\ExpandBothAfter\doifinsetelse{\realfolio}{\recentcontributions} - {\pageselectedtrue}% - {\pageselectedfalse}} +\def\dosetuppagetransitions[#1]% + {\edef\askedpagetransitions{#1}} -\let\setpageversion \gobbleoneargument -\let\resetpageversion \relax -\let\checkpageversion \relax +\def\setpagetransition + {\iflocation \ifx\askedpagetransitions\empty \else + \ctxlua{backends.codeinjections.setpagetransition{ n = "\askedpagetransitions", delay = "\@@scdelay" }}% + \fi \fi} -\def\complexstartversion[#1]% - {\bgroup - \doifelsenothing\actualprofile - {\startprofile[#1]}% - {\startprofile[#1,\actualprofile]}% - \def\docomplexstartversie##1% - {\stripcharacter.\from##1\to\actualversion - \ifnum\versionlevel>\zerocount\relax - \ifnum\actualversion=\zerocount - \setpageversion\actualversion % unknown version - \else - \ifnum\actualversion<\minimumversion\relax - \relax % old version - \else - \setpageversion\actualversion % new version - \fi - \fi - \fi}% - \doglobal\increment\versionlevel\relax - \doifelsenothing{#1} - {\docomplexstartversie{0}}% - {\processcommalist[#1]\docomplexstartversie}} - -\definecomplexorsimpleempty\startversion - -\def\stopversion - {\stopprofile - \doglobal\decrement\versionlevel - \ifnum\versionlevel<\zerocount - \showmessage\m!versions1\empty - \else - \resetpageversion - \egroup - \fi} +\prependtoks \setpagetransition \to \everyshipout -\def\markversion - {\showmessage\m!versions2\empty - \let\setpageversion\dosetpageversion - \let\resetpageversion\relax - \let\checkpageversion\relax} - -\def\selectversion - {\checkrecentcontributions - \showmessage\m!versions3\recentcontributions - \let\setpageversio\gobbleoneargument - \let\resetpageversion\relax - \let\checkpageversion\docheckpageversion} - -\def\dodefineversion[#1][#2]% - {\setvalue{\c!versie!!#1}{#2}% - \defineprofile[#1][#2]} - -\def\defineversion - {\dodoubleargument\dodefineversion} - -\def\followversion - {\followprofile} - -\def\followprofileversion#1[#2][#3]% - {\def\docommand##1% - {\defineprofile[#2#3][##1]}% - \processcommacommand[\getvalue{\c!versie!!#3}]\docommand - \followprofile#1[#2#3]} - -\newcounter\currentpagetransition +\setuppagetransitions + [\v!reset] -\newif\ifrandomtransitions +%D Comments: -\def\setuppagetransitions% - {\dosingleempty\dosetuppagetransitions} +\newbox\commentcollection +\newbox\commentbox +\newbox\commentboxone +\newbox\commentboxtwo -\def\dosetuppagetransitions[#1]% - {\doifelsenothing{#1} - {\doifnot\@@scdelay\v!none - {\let\setpagetransition\setsomepagedelay}} - {\doifelse{#1}\v!start - {\doifnot\@@scdelay\v!none - {\let\setpagetransition\setsomepagedelay}} - {\doglobal\newcounter\currentpagetransition - \doifinsetelse{#1}{\v!reset,\v!stop} - {\let\setpagetransition\relax} - {\let\setpagetransition\setsomepagetransition - \doifinsetelse\v!random{#1} - {\randomtransitionstrue}{\randomtransitionsfalse}% - \edef\userpagetransitions{#1}% - \@EA\removefromcommalist\@EA{\v!random}\userpagetransitions - \ifx\userpagetransitions\empty - \let\userpagetransitions\pagetransitions - \fi}}}} - -\def\setsomepagedelay - {\expanded{\dosetpagetransition{0}{\@@scdelay}}} - -\def\setsomepagetransition - {\iflocation - \ifrandomtransitions - \expanded{\getcommalistsize[\userpagetransitions]}% - \getrandomnumber\currentpagetransition1\commalistsize - \else - \doglobal\increment\currentpagetransition - \fi - \expanded{\getfromcommalist[\userpagetransitions][\currentpagetransition]}% - \doifnumberelse\commalistelement - {\expanded{\getfromcommalist[\pagetransitions][\commalistelement]}} - {}% - \ifx\commalistelement\empty - \doglobal\newcounter\currentpagetransition - \setsomepagetransition - \else - \doifelse\@@scdelay\v!none - {\expanded{\dosetpagetransition{\commalistelement}{0}}} - {\expanded{\dosetpagetransition{\commalistelement}{\@@scdelay}}}% - \fi - \fi} +\def\raisedcommentanchors#1#2{#1{\hbox{\raise\strutht#2}}} -\prependtoks \setpagetransition \to \everyshipout - -% temporary here - -%D \startbuffer -%D \dorecurse{10} -%D {\horizontalpositionbar -%D \pos\recurselevel \min1 \max10 -%D \token\framed{\recurselevel}% -%D \\} -%D -%D \hbox to 15em -%D {\hss -%D \dorecurse{10} -%D {\verticalpositionbar\pos\recurselevel\min1\max10\token\blackrule\\ -%D \hss}} -%D \stopbuffer - -\def\horizontalpositionbar\pos#1\min#2\max#3\token#4\\% - {\hbox to \hsize - {\hskip\zeropoint\!!plus #1\!!fill - \hskip\zeropoint\!!plus-#2\!!fill - #4\relax - \hskip\zeropoint\!!plus #3\!!fill - \hskip\zeropoint\!!plus-#1\!!fill}} - -\def\verticalpositionbar\pos#1\min#2\max#3\token#4\\% - {\vbox to \vsize - {\vskip\zeropoint\!!plus #1\!!fill - \vskip\zeropoint\!!plus-#2\!!fill - \hbox{#4}\relax - \vskip\zeropoint\!!plus #3\!!fill - \vskip\zeropoint\!!plus-#1\!!fill}} - -\def\horizontalgrowingbar\pos#1\min#2\max#3\height#4\depth#5\\% - {\hbox to \hsize - {\scratchcounter#1% - \advance\scratchcounter -#2% - \advance\scratchcounter \plusone - \leaders\vrule\hskip\zeropoint\!!plus \scratchcounter\!!fill - \vrule\!!width\zeropoint\!!height#4\!!depth#5% - \hskip\zeropoint\!!plus #3\!!fill - \hskip\zeropoint\!!plus-#1\!!fill}} - -\def\verticalgrowingbar\pos#1\min#2\max#3\width#4\\% - {\vbox to \vsize - {\scratchcounter#1% - \advance\scratchcounter -#2% - \advance\scratchcounter \plusone - \leaders\hrule\vskip\zeropoint\!!plus\scratchcounter\!!fill - \hrule\!!width#4\!!height\zeropoint\!!depth\zeropoint - \vskip\zeropoint\!!plus #3\!!fill - \vskip\zeropoint\!!plus-#1\!!fill}} - -\newbox\commentbox +\setvalue{\??cc:\c!location:\v!inmargin }{\raisedcommentanchors\inmargin } +\setvalue{\??cc:\c!location:\v!leftedge }{\raisedcommentanchors\inleftedge } +\setvalue{\??cc:\c!location:\v!rightedge }{\raisedcommentanchors\inrightedge } +\setvalue{\??cc:\c!location:\v!leftmargin }{\raisedcommentanchors\inleftmargin } +\setvalue{\??cc:\c!location:\v!rightmargin}{\raisedcommentanchors\inrightmargin} \def\doflushcommentanchors - {\let\next\relax % new - \processaction - [\@@cclocation] - [% \v!text=>\let\next\relax, % new - \v!inmargin=>\let\next\inmargin, % brr not the same as inleft|rightmargin - \v!leftedge=>\let\next\inleftedge, - \v!rightedge=>\let\next\inrightedge, - \v!leftmargin=>\let\next\inleftmargin, - \v!rightmargin=>\let\next\inrightmargin]% - \next{\hbox{\raise\strutht\box\commentbox}}} - -\def\flushcommentanchors % in everypar so indirect - {\ifvoid\commentbox\else \doflushcommentanchors \fi} + {\executeifdefined{\??cc:\c!location:\@@cclocation}\hbox{\box\commentbox}} \def\setupcomment {\dodoubleargument\getparameters[\??cc]} -\setvalue{\e!start\v!comment}% the dummy triple gobbles trailing spaces - {\dotripleempty\dostartcommentaar} +\def\placecomments {\box\commentcollection} % when option=buffer +\def\flushcommentanchors{\ifvoid\commentbox\else\doflushcommentanchors\fi} % in everypar so indirect + +\def\doinsertcomment#1% + {\begingroup + \ctxlua{backends.codeinjections.presetsymbollist("\@@ccsymbol")}% + % in between predefined symbols are dealt with + \ctxlua{backends.codeinjections.registercomment { + title = "\@@cctitle", + width = \number\dimexpr\@@ccwidth \relax, + height = \number\dimexpr\@@ccheight\relax, + colormodel = \number\currentcolormodel, + colorvalue = \thecolorattribute{\@@cccolor}, + open = \@@ccopen, + symbol = "\@@ccsymbol", + buffer = "#1", + layer = "\@@cctextlayer" + }}% + \box\commentboxone + \doif\@@ccoption\v!buffer + {\setbox\scratchbox\vbox to \@@ccheight{\forgetall\vss\box\commentboxtwo}% + \wd\scratchbox\@@ccwidth + \global\setbox\commentcollection\vbox + {\startoverlay{\box\commentcollection}{\box\scratchbox}\stopoverlay}}% + \endgroup} + +\setvalue{\e!start\v!comment}{\dotripleempty\dostartcomment}% the dummy triple gobbles trailing spaces + +\def\dostartcomment[#1][#2][#3]% + {\bgroup + \doifassignmentelse{#1}{\getparameters[\??cc][#1]}{\getparameters[\??cc][\c!title=#1,#2]}% + \doifelse\@@ccoption\v!max{\let\@@ccopen\s!true}{\let\@@ccopen\s!false}% + \setcurrentbuffer{\v!comment\v!buffer}% + \dostartbuffer[\v!comment\v!buffer][\v!comment\v!buffer][\e!start\v!comment][\e!stop\v!comment]} + +\def\stopcomment + {\doif\@@ccstate\v!start + {\global\setbox\commentbox\frozenhbox + {\hbox to \zeropoint{\struttedbox{\tbox{\doinsertcomment{\v!comment\v!buffer}}}\hss}% + \hskip\ifvoid\commentbox\@@ccmargin\else\@@ccdistance\fi + \box\commentbox}}% + \egroup} \def\comment {\dodoubleempty\docomment} -\def\dodocomment#1% - {\!!widtha\@@ccwidth - \!!heighta\@@ccheight - \doifelse\@@ccoption\v!max - {\let\@@ccopen \!!plusone}{\let\@@ccopen \!!zerocount}% - \doifelse\@@ccoption\v!buffer - {\let\@@cccollect\!!plusone}{\let\@@cccollect\!!zerocount}% - \preparecommentvariables - \doinsertcomment - \@@cctitle\!!widtha\!!heighta - \@@cccolor\@@ccopen\@@ccsymbol - \@@cccollect{#1}} - -\def\preparecommentvariables % more will move here as with fields - {\let\@@DriverCommentLayer\@@cctextlayer} - -\def\dopreparecommentaar#1#2% - {\doifassignmentelse{#1} - {\getparameters[\??cc][#1]} - {\getparameters[\??cc][\c!title=#1,#2]}% - \obeylines - \doif\@@ccspace\v!yes\obeyspaces} - -\def\dostartcommentaar[#1][#2][#3]% - {\bgroup - \doifelse\@@ccstate\v!start - {\dopreparecommentaar{#1}{#2}% - \long\def\docommand##1% - {\global\setbox\commentbox\frozenhbox - {\hbox to \zeropoint - {\struttedbox{\tbox{\dodocomment{##1}}}\hss}% - \hskip\ifvoid\commentbox\@@ccmargin\else\@@ccdistance\fi - \box\commentbox}% - \egroup}}% - {\long\def\docommand##1% - {\egroup}}% - \grabuntil{\e!stop\v!comment}\docommand} - -\letvalue{\e!stop\v!comment}\relax % handy for \expanded{...} - \def\docomment[#1][#2]#3% {\doif\@@ccstate\v!start {\hbox to \zeropoint - {\dopreparecommentaar{#1}{#2}% + {\doifassignmentelse{#1}{\getparameters[\??cc][#1]}{\getparameters[\??cc][\c!title=#1,#2]}% \hskip-\@@ccmargin - \struttedbox{\tbox{\dodocomment{#3}}\hss}}}% + \ctxlua{buffers.set("\v!comment\v!buffer", \!!bs\detokenize{#3}\!!es)}% + \struttedbox{\tbox{\doinsertcomment{\v!comment\v!buffer}}\hss}}}% \ignorespaces} +% test +% % \startcomment % hello beautiful\\world % \stopcomment % +% test +% % \startcomment[hello] -% hello << \'e\'erste >> +% hello << eerste >> % beautiful % world % \stopcomment % -% \startcomment[hello][color=green,width=4cm,height=3cm] +% test +% +% \startcomment[hello][color=green,width=10cm,height=3cm] % hello \leftguillemot\ \'e\'erste \rightguillemot\ % beautiful % world -% \stopcommentaar +% \stopcomment +% +% test % -% \startcomment[hello][color=green,width=4cm,height=3cm] +% \startcomment[hello][color=red,width=4cm,height=3cm] % hello \leftguillemot\ \'e\'erste \rightguillemot\ test % % beautiful @@ -1705,6 +320,8 @@ % world % \stopcomment % +% test +% % \startcomment[symbol=Balloon] % Do we want this kind of rubish? And, why isn't this and % some more features related to text annotations so poorly @@ -1713,7 +330,9 @@ % the way, it's funny that when in Acrobat we scale up the % text, the symbols scale down. % \stopcomment - +% +% test +% % \definesymbol [comment-normal][{\externalfigure[cow.pdf]}] % \definesymbol [comment-down] [{\externalfigure[cow.pdf]}] % @@ -1735,11 +354,38 @@ % [\c!symbol={comment-normal,comment-down}, % \c!option=\v!buffer] % -% \setupfootertexts[\placecomments] +% \startcomment[hello] +% oeps +% \stopcomment +% +% test +% +% \setupcomment +% [\c!symbol=normal, +% \c!option=max,width=10cm] +% +% \startcomment[hello] +% oeps +% \stopcomment +% +% test + +\setupcomment + [\c!state=\v!start, + \c!margin=2.5em, + \c!distance=1em, + \c!width=.3\textwidth, + \c!height=.2\textheight, + \c!color=\@@iacolor, + \c!title=, + \c!space=\v!no, + \c!symbol=\v!normal, + \c!location=\v!inmargin, + \c!option=, + \c!textlayer=] + +%D Attachments: -\def\placecomments - {\doflushcomments} - % \setupinteraction[state=start] % % \useattachment[test.tex] @@ -1751,67 +397,42 @@ % % \starttext \attachment[whatever] \stoptext -\definesystemvariable{at} - \def\useattachment {\doquadrupleempty\douseattachment} \def\douseattachment[#1][#2][#3][#4]% tag title newname filename {\iffourthargument - \setgvalue{\??at:#1}{{#2}{#3}{#4}}% tooltip kind of case + \ctxlua{interactions.registerattachment{ label="#1", title="#2", newname="#3", filename="#4" }}% \else\ifthirdargument - \setgvalue{\??at:#1}{{#2}{#2}{#3}}% full path case + \ctxlua{interactions.registerattachment{ label="#1", title="#2", newname="#2", filename="#3" }}% \else\ifsecondargument - \setgvalue{\??at:#1}{{#2}{#2}{#2}}% obvious case + \ctxlua{interactions.registerattachment{ label="#1", title="#2", newname="#2", filename="#2" }}% \else - \setgvalue{\??at:#1}{{#1}{#1}{#1}}% worst case + \ctxlua{interactions.registerattachment{ label="#1", title="#1", newname="#1", filename="#1" }}% \fi\fi\fi} -\let\attachmenttitle\empty -\let\attachmentname \empty -\let\attachmentfile \empty - -\def\getattachmentdata[#1]% - {\edef\attachmenttitle{\filterfromvalue{\??at:#1}31}% description - \edef\attachmentname {\filterfromvalue{\??at:#1}32}% new name - \edef\attachmentfile {\filterfromvalue{\??at:#1}33}% original - \expandafter\splitstring\attachmentname\at.\to\!!stringa\and\!!stringb - \ifx\!!stringb\empty % no suffix, so we need to inherit it - \expandafter\splitstring\attachmentfile\at.\to\!!stringc\and\!!stringd - \edef\attachmentname{\attachmentname.\!!stringd}% - \fi} - \def\attachment {\dodoubleempty\doattachment} -\def\doattachment[#1][#2]% currently title equals newname +\def\doattachment[#1][#2]% [tag] [settings] {\iflocation - \ifsecondargument - \doifundefined{\??at:#2} - {\showmessage\m!interactions6{#2}% - \useattachment[#2]}% - \doif\@@atstate\v!start - {\bgroup - \getattachmentdata[#2]% - \doiffileelse\attachmentfile - {\setupattachments[#1]% - \presetattachmentvariables -\struttedbox{\tbox{% - \doattachfile - \attachmenttitle - {1em}\strutheight\strutdepth\@@atcolor\@@atsymbol - \attachmentname - \attachmentfile}% -}}% - {\showmessage\m!interactions5\attachmentfile}% - \egroup}% - \else\iffirstargument - \attachment[][#1]% - \fi\fi + \doif\@@atstate\v!start + {\bgroup + \setupattachments[#2]% + \ctxlua{backends.codeinjections.presetsymbollist("\@@atsymbol")}% + \getvalue{\??at:\@@atalternative}{\ctxlua{backends.codeinjections.attachfile{ + label = "#1", + width = \number\dimexpr\@@atwidth \relax, + height = \number\dimexpr\@@atheight\relax, + depth = \number\dimexpr\@@atdepth \relax, + color = "\@@atcolor", + symbol = "\@@atsymbol", + layer = "\@@attextlayer", + }}}% + \egroup}% \fi} -\def\presetattachmentvariables - {\let\@@DriverAttachmentLayer\@@attextlayer} +\setvalue{\??at:\v!high}#1{\struttedbox{\tbox{#1}}} \def\setupattachments {\dodoubleempty\getparameters[\??at]} @@ -1820,139 +441,141 @@ [\c!state=\v!start, \c!color=\@@iacolor, \c!textlayer=, + \c!width=1em, + \c!height=\strutheight, + \c!depth=\strutdepth, + \c!alternative=\v!high, \c!symbol=] - -% jammer, tussen/midden had erin gemoeten; \c!commando toevoegen -\def\registermenucommand#1% - {{\textonly\noindent#1\space}} % no math switching +%D Defining sound tracks: +%D +%D \starttyping +%D \useexternalsoundtrack[label][file] +%D \stoptyping +%D +%D associated actions: StartSound StopSound PauseSound ResumeSound +%D +%D Todo: like external figures, also search on path, +%D although, they need to be present ar viewing time, so ... + +\def\useexternalsoundtrack + {\dodoubleargument\douseexternalsoundtrack} + +\def\douseexternalsoundtrack[#1][#2]% + {\ctxlua{interactions.registersound{ label="#1", filename="#2" }}} + +\def\checksoundtrack#1% yet untested in mkiv (also move management to lua) + {\iflocation + \ctxlua{codeinjections.insertsound{ + label = "#1", + repeat = "\@@sdoption", % not entirely ok but works + }}% + \fi} + +\def\setupexternalsoundtracks + {\dodoubleargument\getparameters[\??sd]} + +\setupexternalsoundtracks + [\c!option=] + +%D Multi Media: -\def\doregistermenubuttons[#1][#2]% [menu id] [register] +% todo: multiple instances, dus indirect + +\let\currentrendering\empty + +\definereference[StartCurrentRendering] [\v!StartRendering {\currentrendering}] +\definereference[StopCurrentRendering] [\v!StopRendering {\currentrendering}] +\definereference[PauseCurrentRendering] [\v!PauseRendering {\currentrendering}] +\definereference[ResumeCurrentRendering][\v!ResumeRendering{\currentrendering}] + +\newcounter\nofexternalrenderings + +\def\useexternalrendering{\doquadrupleempty\douseexternalrendering} +\def\setinternalrendering{\dodoubleempty \dosetinternalrendering} + +\def\douseexternalrendering[#1][#2][#3][#4]% tag mime file options + {\ctxlua{interactions.registerrendering { + kind = "external", + label = "#1", + mime = "#2", + filename = "#3", + options = "#4", + }}} + +\def\dosetinternalrendering[#1][#2]% tag options {content} {\bgroup - \ifsecondargument - \setupinteractionmenu - [#1][\c!unknownreference=\v!yes,\c!samepage=\v!yes]% - \def\docommand##1% - {\registermenucommand{\menubutton[#1]{##1}[#2:##1]}}% + \dowithnextbox + {\ctxlua{interactions.registerrendering { + kind = "internal", + label = "#1", + mime = "IRO", + filename = "#1", + options = "#2", + }}% + \let\objectoffset\zeropoint + \setobject{IRO}{#1}\hbox{\box\nextbox}% + \egroup}% + \hbox} + +\def\renderingtype #1{\ctxlua{interactions.renderingvar("#1","kind")}} +\def\renderingoptions#1{\ctxlua{interactions.renderingvar("#1","options")}} + +\def\renderingwidth {8cm} +\def\renderingheight {6cm} + +\def\definerenderingwindow + {\dodoubleempty\dodefinerenderingwindow} + +\def\dodefinerenderingwindow[#1][#2]% + {\presetlocalframed[\??rw#1]% + \getparameters + [\??rw#1]% + [\c!openpageaction=,\c!closepageaction=,% + \c!width=\renderingwidth,\c!height=\renderingheight,% + #2]} + +\def\setuprenderingwindow + {\dodoubleargument\dosetuprenderingwindow} + +\def\dosetuprenderingwindow[#1]% + {\getparameters[\??rw#1]} + +\def\placerenderingwindow + {\dodoubleempty\doplacerenderingwindow} + +\def\doplacerenderingwindow[#1][#2]% + {\bgroup + \edef\currentrendering{\ifsecondargument#2\else#1\fi}% + \doifelse{\renderingtype\currentrendering}{internal} % an object + {\getobjectdimensions{IRO}\currentrendering + \edef\renderingheight{\the\dimexpr\objectheight+\objectdepth\relax}% + \edef\renderingwidth{\objectwidth}% + \dogetobjectreferencepage{IRO}\currentrendering\renderingpage}% + {\def\renderingheight{\vsize}% + \def\renderingwidth{\hsize}% + \def\renderingpage{\realpageno}}% + % create fall back if needed + \ifcsname\??rw#1\c!width\endcsname + \def\currentrenderingwindow{#1}% \else - \def\docommand##1% - {\registermenucommand - {\button - [\c!unknownreference=\v!yes,\c!samepage=\v!yes] - {##1}[#1:##1]}}% + \let\currentrenderingwindow\s!default + \definerenderingwindow[\currentrenderingwindow]% \fi - \handletokens abcdefghijklmnopqrstuvwxyz\with\docommand % moet anders +% todo +% \handlereferenceactions{\getvalue{\??rw\currentrenderingwindow\c!openpageaction }}\dosetuprenderingopenpageaction +% \handlereferenceactions{\getvalue{\??rw\currentrenderingwindow\c!closepageaction}}\dosetuprenderingclosepageaction + \localframed + [\??rw\currentrenderingwindow][\c!offset=\v!overlay]% + {\ctxlua{backends.codeinjections.insertrenderingwindow { + label = "\currentrendering", + width = \number\dimexpr\renderingwidth\relax, + height = \number\dimexpr\renderingheight\relax, + options = "\renderingoptions\currentrendering", + page = \number\renderingpage, + }}}% \egroup} - -\def\registermenubuttons - {\dodoubleempty\doregistermenubuttons} -\stelkoppelingenin - [\c!distance=.25em, - \c!width=\v!fit, - \c!location=\v!low, - \c!color=\@@iacolor, - \c!frame=\v!off, - \c!background=, - \c!backgroundscreen=\@@rsscreen, - \c!backgroundcolor=] - -\defineinteractionmenu - [\v!right] - [\v!right] - [\c!before=, - \c!after=\vfil, - \c!inbetween=\blank, - \c!distance=\bodyfontsize, % 12pt - \c!left=\hss, - \c!right=\hss, - \c!width=\rightedgewidth, - \c!height=\v!broad] - -\defineinteractionmenu - [\v!left] - [\v!left] - [\c!before=, - \c!after=\vfil, - \c!inbetween=\blank, - \c!distance=\bodyfontsize, % 12pt - \c!left=\hss, - \c!right=\hss, - \c!width=\leftedgewidth, - \c!height=\v!broad] - -\defineinteractionmenu - [\v!bottom] - [\v!bottom] - [\c!before=\vss, - \c!after=\vss, - \c!middle=\hfil, - \c!distance=\bodyfontsize, % 12pt - \c!width=\v!fit, - \c!height=\v!broad] - -\defineinteractionmenu - [\v!top] - [\v!top] - [\c!before=\vss, - \c!after=\vss, - \c!middle=\hfil, - \c!distance=\bodyfontsize, % 12pt - \c!width=\v!fit, - \c!height=\v!broad] - -\setupinteractionmenu - [\v!left,\v!right,\v!top,\v!bottom] - [\c!offset=.25em, - \c!position=\v!no, - \c!frame=\v!on, - \c!background=, - \c!backgroundcolor=, - \c!backgroundscreen=\@@rsscreen, - \c!style=\@@iastyle, - \c!color=\@@iacolor, - \c!contrastcolor=\@@iacontrastcolor, - \c!state=\v!start, - \c!samepage=\v!yes, - \c!unknownreference=\v!empty, - \c!topoffset=\!!zeropoint, - \c!bottomoffset=\!!zeropoint, - \c!leftoffset=\!!zeropoint, - \c!rightoffset=\!!zeropoint] - -\def\placeleftedgetextblock % Is \hss/\hsize really needed here? - {\hbox to \leftedgewidth % (check outer level and settings) - {\hsize\leftedgewidth\hss\interactionmenus[\v!left]}} - -\def\placerightedgetextblock % Is \hss/\hsize really needed here? - {\hbox to \rightedgewidth % (check outer level and settings) - {\hsize\rightedgewidth\interactionmenus[\v!right]\hss}} - -\def\placetoptextblock - {\vbox to \topheight - {\vsize\topheight - \csname\??tk\v!top\c!before\endcsname - \interactionmenus[\v!top]% - \csname\??tk\v!top\c!after\endcsname - \kern\zeropoint}} - -\def\placebottomtextblock - {\vbox to \bottomheight - {\vsize\bottomheight - \csname\??tk\v!bottom\c!before\endcsname - \interactionmenus[\v!bottom]% - \csname\??tk\v!bottom\c!after\endcsname - \kern\zeropoint}} - -\ifx\leftedgetextcontent\undefined \else - - \appendtoks \placeleftedgetextblock \hskip-\leftedgewidth \to \leftedgetextcontent - \appendtoks \placerightedgetextblock \hskip-\rightedgewidth \to \rightedgetextcontent - \appendtoks \placetoptextblock \vskip-\topheight \to \toptextcontent - \appendtoks \placebottomtextblock \vskip-\bottomheight \to \bottomtextcontent - -\fi - \setupinteractionscreen [\c!width=\printpaperwidth, \c!height=\printpaperheight, @@ -1963,74 +586,4 @@ \c!option=\v!min, \c!delay=\v!none] -\setupbuttons - [\c!state=\v!start, - \c!width=\v!fit, - \c!height=\v!broad, - \c!offset=0.25em, - \c!frame=\v!on, - \c!background=, - \c!backgroundscreen=\@@rsscreen, - \c!backgroundcolor=, - \c!style=\@@iastyle, - \c!color=\@@iacolor, - \c!contrastcolor=\@@iacontrastcolor, - \c!samepage=\v!yes, - \c!unknownreference=\v!yes] - -\setupinteractionbar - [\c!state=\v!start, - \c!alternative=a, - \c!symbol=\v!no, - \c!width=\rightedgewidth, - \c!height=, % these are taken care - \c!depth=, % of at calling time - \c!distance=.5em, % beter relateren aan breedte - \c!step=1, - \c!color=\@@iacolor, - \c!contrastcolor=\@@iacontrastcolor, - \c!frame=\v!on, - \c!background=, - \c!backgroundscreen=\@@rsscreen, - \c!backgroundcolor=, - \c!samepage=\v!yes, - \c!unknownreference=\v!yes] - -\setupsynchronizationbar - [\c!alternative=\v!page, - \c!width=\rightedgewidth, - \c!style=\@@iastyle, - \c!color=\@@iacolor, - \c!background=, - \c!backgroundscreen=\@@rsscreen, - \c!backgroundcolor=] - -\setupsynchronization - [\c!state=\v!stop] - -\setupprofiles - [\c!option=] - -\setuppagetransitions - [\v!reset] - -\setupcomment - [\c!state=\v!start, - \c!margin=2.5em, - \c!distance=1em, - \c!width=.3\textwidth, - \c!height=.2\textheight, - \c!color=\@@iacolor, - \c!title=, - \c!space=\v!no, - \c!symbol=\v!normal, - \c!location=\v!inmargin, - \c!option=, - \c!textlayer=] - -\setupversions % beware, @ is made active here, - [\c!number=1, % therefore we set this one at the end - \c!style=\ss, - \c!color=] - \protect \endinput diff --git a/tex/context/base/scrn-men.mkiv b/tex/context/base/scrn-men.mkiv new file mode 100644 index 000000000..ae95a5c04 --- /dev/null +++ b/tex/context/base/scrn-men.mkiv @@ -0,0 +1,616 @@ +%D \module +%D [ file=scrn-bar, % was part of scrn-int +%D version=1995.01.01, +%D title=\CONTEXT\ Core Macros, +%D subtitle=Menus, +%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 Screen Macros / Menus} + +\unprotect + +% \startinteractionmenu[rechts] +% \but [eerste] eerste \\ +% \txt hello world \\ +% \but [tweede] tweede \\ +% \nop \\ +% \but [tweede] tweede \\ +% \rul whow \\ +% \but [tweede] tweede \\ +% \raw hello world \\ +% \but [tweede] tweede \\ +% \com \vfill \\ +% \but [derde] derde \\ +% \stopinteractionmenu + +% \setupinteraction[menu=on,state=start] +% +% \defineinteractionmenuclass[test] [vertical] +% \defineinteractionmenuclass[another][horizontal] +% +% \defineinteractionmenu[test] [left][state=start,width=4cm] +% \defineinteractionmenu[another][top] [state=start,height=1cm] +% +% \startinteractionmenu[test] +% \but [firstpage] test-a \\ +% \but [nextpage] test-b \\ +% \stopinteractionmenu +% +% \startinteractionmenu[another] +% \but [firstpage] test-a \\ +% \but [nextpage] test-b \\ +% \stopinteractionmenu +% +% \setupheadertexts[{\interactionmenu[another]}] +% +% \starttext +% +% test \interactionmenu[test] \page +% test \interactionmenu[test] \page +% +% \stoptext + +% ja : kader/achtergrond met tekst +% leeg : kader/achtergrond maar geen tekst +% nee : alleen ruimte reserveren +% geen : helemaal weglaten +% +% \setupinteractionmenu[right][samepage=yes, unknownreference=yes] +% \setupinteractionmenu[right][samepage=empty,unknownreference=empty] +% \setupinteractionmenu[right][samepage=no, unknownreference=no] +% \setupinteractionmenu[right][samepage=none, unknownreference=none] +% +% \startinteractionmenu[right] +% \but [firstpage] first \\ +% \but [lastpage] last \\ +% \but [somepage] crap \\ +% \stopinteractionmenu + +%D Define menus: + +\def\setmenuparameter#1#2#3{\@EA\def\csname\??am#1#2\endcsname{#3}} +\def\letmenuparameter #1#2{\@EA\let\csname\??am#1#2\endcsname} + +\def\menuparameter #1{\csname\domenuparameter{\??am\currentmenu}#1\endcsname} +\def\namedmenuparameter#1#2{\csname\domenuparameter{\??am #1}#2\endcsname} +\def\menuparameterhash #1{\domenuparameterhash {\??am\currentmenu}#1} + +\def\domenuparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\domenuparentparameter \csname#1\s!parent\endcsname#2\fi} +\def\domenuparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\domenuparentparameterhash\csname#1\s!parent\endcsname#2\fi} + +\def\domenuparentparameter #1#2{\ifx#1\relax\s!empty\else\domenuparameter #1#2\fi} +\def\domenuparentparameterhash#1#2{\ifx#1\relax \else\domenuparameterhash#1#2\fi} + +\def\defineinteractionmenu + {\dotripleempty\dodefineinteractionmenu} + +\def\dodefineinteractionmenu[#1][#2][#3]% [name] [location] [settings] + {\ifsecondargument + \ifcsname\??am:\c!list:#2\endcsname \else + \letvalue{\??am:\c!list:#2}\empty + \fi + \normalexpanded{\noexpand\addtocommalist{#1}\@EA\noexpand\csname\??am:\c!list:#2\endcsname}% + \setvalue{\@@dodolistelement#1}{\def\dosomelistelement{\dodomenulistelement{#1}}}% + \ifthirdargument + \presetlocalframed[\??am#1]% + \doifassignmentelse{#3} + {\doifelse{#1}{#2} + {\getparameters[\??am#1][\c!location=#2,\c!menu=,\s!parent=\??am,#3]} + {\getparameters[\??am#1][\c!location=#2,\c!menu=,\s!parent=\??am#2,#3]}}% + {\doifelsenothing{#3} + {\getparameters[\??am#1][\c!location=#2,\c!menu=,\s!parent=\??am]} + {\getparameters[\??am#1][\c!location=#2,\c!menu=,\s!parent=\??am#3]}}% + \else + \getparameters[\??am#1][\c!location=#2,\c!menu=,\s!parent=\??am#2]% + \fi + \else + \getparameters[\??am#1][\s!parent=\??am]% simple cloning + \fi} + +\def\currentmenulist{\ifcsname\??am:\c!list:\currentmenu\endcsname\csname\??am:\c!list:\currentmenu\endcsname\fi} + +%D Setup menus: + +\def\setupinteractionmenu + {\dodoubleargument\dosetupinteractionmenu} + +\def\dosetupinteractionmenu[#1][#2]% + {\def\docommand##1{\getparameters[\??am##1][#2]}% + \processcommalist[#1]\docommand} + +\def\setupinteractionmenus[#1]% + {\getparameters[\??am][#1]} + +%D Fill menus: + +\normalexpanded{\long\def\expandafter\noexpand\csname\e!start\v!interactionmenu\endcsname[#1]#2\expandafter\noexpand\csname\e!stop\v!interactionmenu\endcsname}% + {\long\setmenuparameter{#1}\c!menu{\dointeractionmenu{#1}{#2}}} + +\def\resetinteractionmenu[#1]% + {\letmenuparameter{#1}\c!menu\empty} + +%D Check if menus permitted: + +\newif\iflocationmenupermitted + +\def\testinteractionmenu + {\iflocation + \doifelse\@@iamenu\v!on + {\doifelse{\menuparameter\c!state}\v!start + {\global\locationmenupermittedtrue} + {\global\locationmenupermittedfalse}} + {\global\locationmenupermittedfalse}% + \else + \global\locationmenupermittedfalse + \fi} + +%D Placement of menus: + +\def\interactionmenus[#1]% location + {\iflocation + \csname\??am:\c!menu:#1\endcsname + \fi} + +% \def\defineinteractionmenuclass +% {\dodoubleargument\dodefineinteractionmenuclass} +% +% \def\dodefineinteractionmenuclass[#1][#2]% tag hori|veri +% {\doifelse{#2}\v!vertical +% {\setvalue{\??am:\c!menu:#1}{\verticalinteractionmenu {#1}{\getvalue{\??am#1\c!width }}}} +% {\setvalue{\??am:\c!menu:#1}{\horizontalinteractionmenu{#1}{\getvalue{\??am#1\c!height}}}}} +% +% \defineinteractionmenuclass[\v!left ][\v!horizontal] +% \defineinteractionmenuclass[\v!right ][\v!horizontal] +% \defineinteractionmenuclass[\v!top ][\v!vertical] +% \defineinteractionmenuclass[\v!bottom][\v!vertical] + +\setvalue{\??am:\c!menu :\v!left }{\horizontalinteractionmenu\v!left \leftedgewidth } +\setvalue{\??am:\c!menu :\v!right }{\horizontalinteractionmenu\v!right \rightedgewidth} +\setvalue{\??am:\c!menu :\v!top }{\verticalinteractionmenu \v!top \topheight } +\setvalue{\??am:\c!menu :\v!bottom}{\verticalinteractionmenu \v!bottom\bottomheight } + +\setvalue{\??am:\c!command:\v!right }{\@@amvbox{}\rightedgewidth} +\setvalue{\??am:\c!command:\v!left }{\@@amvbox{}\leftedgewidth } +\setvalue{\??am:\c!command:\v!top }{\@@amhbox{}\topheight } +\setvalue{\??am:\c!command:\v!bottom}{\@@amhbox{}\bottomheight } + +\def\dointeractionmenu#1#2% + {\edef\currentmenu{#1}% + \getvalue{\??am:\c!command:\menuparameter\c!location}\currentmenu{#2}} + +\unexpanded\def\interactionmenu[#1]% + {\def\currentmenu{#1}% + \menuparameter\c!menu} + +\newdimen \intermenudistance +\newdimen \finalmenuwidth +\newdimen \finalmenuheight + +\newcounter\currentamposition % better \currentmenuposition +\newtoks \everysetmenucommands + +\def\horizontalinteractionmenu#1#2% location vhsize before/after + {\ifdim#2>\zeropoint + \edef\currentmenu{#1}% + \finalmenuwidth#2\relax + \horizontalinteractionmenuindeed + \fi} + +\def\verticalinteractionmenu#1#2% + {\ifdim#2>\zeropoint + \edef\currentmenu{#1}% + \finalmenuheight#2\relax + \verticalinteractionmenuindeed + \fi} + +\def\horizontalinteractionmenuindeed + {\global\intermenudistance\zeropoint + \setbox\scratchbox\hbox + {\processcommacommand[\currentmenulist]\somehorizontalinteractionmenu}% + \wd\scratchbox\finalmenuwidth\relax + \box\scratchbox} + +\def\verticalinteractionmenuindeed + {\global\intermenudistance\zeropoint + \setbox\scratchbox\vbox + {\processcommacommand[\currentmenulist]\someverticalinteractionmenu}% + \ht\scratchbox\finalmenuheight + \dp\scratchbox\zeropoint + \box\scratchbox} + +\def\somehorizontalinteractionmenu#1% + {\begingroup + \edef\currentmenu{#1}% + \doifnot{\menuparameter\c!state}\v!none + {\hskip\intermenudistance + \setbox\scratchbox\hbox to \finalmenuwidth + {\menuparameter\c!left + \interactionmenu[#1]% + \menuparameter\c!right}% + \doifelse{\menuparameter\c!distance}\v!overlay + {\global\intermenudistance\zeropoint + \wd\scratchbox\zeropoint}% + {\global\intermenudistance\menuparameter\c!distance}% + \box\scratchbox}% + \endgroup} + +\def\someverticalinteractionmenu#1% + {\begingroup + \edef\currentmenu{#1}% + \doifnot{\menuparameter\c!state}\v!none + {\vskip\intermenudistance + \setbox\scratchbox\vbox to \finalmenuheight + {\menuparameter\c!before + \interactionmenu[#1]% + \menuparameter\c!after}% + \doifelse{\menuparameter\c!distance}\v!overlay + {\global\intermenudistance\zeropoint + \offinterlineskip + \dp\scratchbox\zeropoint + \ht\scratchbox\zeropoint}% + {\global\intermenudistance\menuparameter\c!distance}% + \box\scratchbox}% + \endgroup} + +% don't change skipping, this one works! \showcomposition removed + +\def\@@amhbox#1#2#3#4% #1 obsolete, #3 is redundant + {\edef\currentmenu{#3}% + \testinteractionmenu + \iflocationmenupermitted + \begingroup + \forgetall + \scratchdimen\dimexpr\makeupwidth+\pagebackgroundhoffset*2-\menuparameter\c!leftoffset-\menuparameter\c!rightoffset\relax + \setbox\scratchbox\hbox to \scratchdimen + {\executeamboxcommands{#3}{#4}\c!left\c!middle\c!right}% + \setbox\scratchbox\hbox{\dowholemenuposition{#3}{\box\scratchbox}}% cannot happen in previous due to align + \wd\scratchbox\makeupwidth % geen \ht=#2 setting (yet) + \hskip\dimexpr-\pagebackgroundhoffset+\menuparameter\c!leftoffset\relax + \box\scratchbox + \endgroup + \fi} + +\def\@@amvbox#1#2#3#4% #1 obsolete, #3 is redundant + {\edef\currentmenu{#3}% + \testinteractionmenu + \iflocationmenupermitted + \bgroup + \forgetall + \scratchdimen\dimexpr\textheight+\pagebackgroundvoffset*2+\pagebackgrounddepth-\menuparameter\c!topoffset-\menuparameter\c!bottomoffset\relax + \setbox\scratchbox\vbox to \scratchdimen + {\restorestandardblank % todo: vspacing + \hsize#2\relax + \executeamboxcommands{#3}{#4}\c!before\c!inbetween\c!after}% + % strange: when we mnake this a hbox the content disappears + \setbox\scratchbox\vbox{\dowholemenuposition{#3}{\box\scratchbox}}% cannot happen in previous due to align + \setbox\scratchbox\vbox + {\ht\scratchbox\zeropoint + \vskip\dimexpr-\pagebackgroundvoffset+\menuparameter\c!topoffset\relax + \box\scratchbox + \vskip\pagebackgroundvoffset}% overbodig + \ht\scratchbox\textheight + \wd\scratchbox#2\relax + \box\scratchbox + \egroup + \fi} + +\def\executeamboxcommands#1#2#3#4#5% + {\begingroup + \edef\currentmenu{#1}% + \menuparameter#3\relax + \setamboxcommands{#1}{#4}% + \ignorespaces#2\unskip + \menuparameter#5\relax + \endgroup} + +\def\setamboxcommands#1#2% + {\edef\currentmenu{#1}% + \edef\betweenmenu{#2}% + \doglobal\newcounter\currentamposition + \the\everysetmenucommands} + +\def\addsomemenuitem#1% + {\dontleavehmode + \begingroup + \ignorespaces#1\unskip\relax + \ifconditional\skippedmenuitem \else + \menuparameter\betweenmenu + \fi + \endgroup + \ignorespaces} + +%D This can save complicated menu macros when one want to +%D keep control over parts of a menu (i.e.\ turn them on and +%D off). We could have achieved something similar with modes. + +\def\local@@ambox#1#2#3#4% don't change skipping, this one works! + {\begingroup + \edef\currentmenu{#3}% + \iflocationmenupermitted + \executeamboxcommands{#3}{#4}\c!before\c!inbetween\c!after + \fi + \endgroup} + +\def\includemenu[#1]% + {\begingroup + \edef\currentmenu{#1}% + \doif{\menuparameter\c!state}\v!local + {\letmenuparameter\currentmenu\c!state\v!start + \let\@@amvbox\local@@ambox + \let\@@amhbox\local@@ambox + \menuparameter\c!menu}% + \endgroup} + +%D The menu commands: + +% ja : kader/achtergrond met tekst +% leeg : kader/achtergrond maar geen tekst +% nee : alleen ruimte reserveren +% geen : helemaal weglaten + +\newconditional\skippedmenuitem +\newconditional\usemenuclick + +\def\dosetlocationboxcontent#1[#2]#3[#4]% to be checked + {\global\setfalse\skippedmenuitem + \setbox\locationbox\hbox{\localframed[#1][#2]{#3}}% + \ifconditional\usemenuclick + \gotobox{\box\locationbox}[#4]% + \else + \box\locationbox + \fi} + +\def\dosetlocationboxempty#1[% + {\dosetlocationboxcontent{#1}[\c!empty=\v!yes,} + +\def\dosetlocationboxno#1[% + {\dosetlocationboxcontent{#1}[\c!empty=\v!yes,\c!frame=,\c!background=,} + +\def\dosetlocationboxnone#1[#2]#3[#4]% + {\global\settrue\skippedmenuitem} + +% make two sub macros + +% \dosetfontattribute {#1}{#2}% +% \dosetcolorattribute{#1}{#3}% + +\def\setlocationboxyes#1[#2]#3[#4]% needs to be split as the attr is not applicable to the box + {\begingroup + \settrue\usemenuclick + \global\setfalse\skippedmenuitem + \attribute\referenceattribute\attributeunsetvalue + \doifreferencefoundelse{#4} + {\analyzecurrentreference % we need to act on the state + \ifcase\referencepagestate + % something else than a page reference + \ctxlua{jobreferences.injectcurrentset(nil,nil)}% + \hbox attr \referenceattribute \lastreferenceattribute {\localframed[#1][#2]{#3}}% + \else\ifcase\csname\??am:\c!location:\menuparameter\c!samepage\endcsname\relax + % yes: same page or not ... todo + \ctxlua{jobreferences.injectcurrentset(nil,nil)}% + \ifnum\referencepagestate=\plusone % same page + \hbox attr \referenceattribute \lastreferenceattribute {\localframed[#1][#2,\c!color=\menuparameter\c!contrastcolor]{#3}}% + \else % elsewhere + \hbox attr \referenceattribute \lastreferenceattribute {\localframed[#1][#2]{#3}}% + \fi + \or + % empty but frame: no click + \localframed[#1][\c!empty=\v!yes,#2]{#3}% + \or + % empty no frame: no + \localframed[#1][\c!empty=\v!yes,\c!frame=,\c!background=,#2]{#3}% + \or + % nothing at all + \global\settrue\skippedmenuitem + \fi\fi}% + {\unknownreference{#4}% + \ifcase\csname\??am:\c!location:\menuparameter\c!unknownreference\endcsname\relax + \localframed[#1][#2]{#3}% + \or + \localframed[#1][\c!empty=\v!yes,#2]{#3}% + \or + \localframed[#1][\c!empty=\v!yes,\c!frame=,\c!background=,#2]{#1}% + \or + \global\skippedmenuitemtrue + \fi}% + \endgroup} + +\def\setlocationboxraw#1[#2]#3[#4]% + {\localframed[#1][#2]{#3}} + +\def\setlocationnop#1[#2]#3% + {\localframed[#1][#2]{#3}} + +\def\menu@raw[#1]#2\\% + {\addsomemenuitem{\gotobox{\ignorespaces#2\unskip}[#1]}} + +\def\menu@but[#1]#2\\% + {\addsomemenuitem{\domenuitemposition\currentmenu{#1}{\setlocationboxyes{\??am\currentmenu}[]{\ignorespaces#2\unskip}[#1]}}} + +\def\menu@got[#1]#2\\% + {\addsomemenuitem{\setlocationboxyes{\??am\currentmenu}[\c!frame=\v!off,\c!background=]{\ignorespaces#2\unskip}[#1]}} + +\def\menu@nop#1\\% + {\addsomemenuitem{\setlocationboxraw{\??am\currentmenu}[\c!frame=\v!off,\c!background=,\c!empty=\v!yes]{\ignorespaces#1\unskip}[]}} + +\def\menu@txt#1\\% + {\addsomemenuitem{\localframed[\??am\currentmenu][\c!frame=\v!off,\c!background=]{\ignorespaces#1\unskip}}} + +\def\menu@rul#1\\% + {\addsomemenuitem{\localframed[\??am\currentmenu][]{\ignorespaces#1\unskip}}} + +\def\menu@com#1\\% + {\ignorespaces#1\unskip\ignorespaces} + +\appendtoks + \let\raw\menu@raw \let\but\menu@but \let\got\menu@got \let\nop\menu@nop + \let\txt\menu@txt \let\rul\menu@rul \let\com\menu@com +\to \everysetmenucommands + +\ifdefined\domenuitemposition \else \let\domenuitemposition \gobbletwoarguments \fi +\ifdefined\dowholemenuposition \else \let\dowholemenuposition\gobbleoneargument \fi + +%D We also need an explicit position control some day. I'll +%D do that when I need it. [The stacking order.] + +% [name] [location] +% [name] [location] [pars] + +\expandafter\chardef\csname\??am:\c!location:\v!yes \endcsname\zerocount +\expandafter\chardef\csname\??am:\c!location:\v!empty \endcsname\plusone +\expandafter\chardef\csname\??am:\c!location:\v!no \endcsname\plustwo +\expandafter\chardef\csname\??am:\c!location:\v!none \endcsname\plusthree + +\expandafter\chardef\csname\??am:\c!location:\v!normal \endcsname\plusone % default +\expandafter\chardef\csname\??am:\c!location:\s!default\endcsname\plusone % default +\expandafter\chardef\csname\??am:\c!location:\s!empty \endcsname\plusone % default + +\def\dodomenulistelement#1#2#3#4#5#6#7% + {\addsomemenuitem{\domenuitemposition\currentmenu{internal(#3)}% + {\setlocationboxyes{\??am\currentmenu}[]{\limitatetext{#5}{\namedlistparameter{#2}\c!maxwidth}{\unknown}}[internal(#3)]}}} + +\unexpanded\def\menubutton + {\dodoubleempty\domenubutton} + +\def\domenubutton[#1]% + {\iffirstargument + \ifsecondargument + \@EAEAEA\domenubuttonB + \else + \doifassignmentelse{#1} + {\@EAEAEA\domenubuttonC} + {\@EAEAEA\domenubuttonD}% + \fi + \else + \@EA\domenubuttonA + \fi[#1]} + +\def\domenubuttonA[#1][#2]#3[#4]{\setlocationboxyes\??bt[]{#3}[#4]} % normal button, no parameters +\def\domenubuttonB[#1][#2]#3[#4]{\setlocationboxyes{\??am#1}[#2]{#3}[#4]} % menu button, with parameters +\def\domenubuttonC[#1][#2]#3[#4]{\setlocationboxyes\??bt[#1]{#3}[#4]} % normal button, with parameters +\def\domenubuttonD[#1][#2]#3[#4]{\setlocationboxyes{\??am#1}[]{#3}[#4]} % menu button, no parameters + +\def\menubox + {\dodoubleempty\domenubox} + +\def\domenubox[#1][#2]#3% + {\bgroup + \let\setlocationboxyes\setlocationboxraw + \domenubutton[#1][#2]#3[]% + \egroup} + +% jammer, tussen/midden had erin gemoeten; \c!commando toevoegen + +\def\registermenucommand#1% + {{\textonly\noindent#1\space}} % no math switching + +\def\doregistermenubuttons[#1][#2]% [menu id] [register] + {\bgroup + \ifsecondargument + \setupinteractionmenu[#1][\c!unknownreference=\v!yes,\c!samepage=\v!yes]% + \def\docommand##1{\registermenucommand{\menubutton[#1]{##1}[#2:##1]}}% + \else + \def\docommand##1{\registermenucommand{\button[\c!unknownreference=\v!yes,\c!samepage=\v!yes]{##1}[#1:##1]}}% + \fi + \handletokens abcdefghijklmnopqrstuvwxyz\with\docommand % moet anders + \egroup} + +\def\registermenubuttons + {\dodoubleempty\doregistermenubuttons} + +\defineinteractionmenu [\v!vertical] % we happen to know that this works out ok (just a setup set) +\defineinteractionmenu [\v!horizontal] % we happen to know that this works out ok (just a setup set) + +\defineinteractionmenu [\v!right ] [\v!right ] [\v!vertical ] % we share a setup set +\defineinteractionmenu [\v!left ] [\v!left ] [\v!vertical ] % we share a setup set +\defineinteractionmenu [\v!top ] [\v!top ] [\v!horizontal] % we share a setup set +\defineinteractionmenu [\v!bottom] [\v!bottom] [\v!horizontal] % we share a setup set + +\setupinteractionmenus + [\c!offset=.25em, + \c!position=\v!no, + \c!frame=\v!on, + \c!background=, + \c!backgroundcolor=, + \c!foregroundstyle=\menuparameter\c!style, + \c!foregroundcolor=\menuparameter\c!color, + \c!style=\@@iastyle, + \c!color=\@@iacolor, + \c!contrastcolor=\@@iacontrastcolor, + \c!state=\v!start, + \c!samepage=\v!yes, + \c!unknownreference=\v!empty, + \c!topoffset=\zeropoint, + \c!bottomoffset=\zeropoint, + \c!leftoffset=\zeropoint, + \c!rightoffset=\zeropoint] + +\setupinteractionmenu + [\v!vertical] % not really a menu + [\c!before=, + \c!after=\vfil, + \c!inbetween=\blank, + \c!distance=\bodyfontsize, % 12pt + \c!left=\hss, + \c!right=\hss, + \c!height=\v!broad] + +\setupinteractionmenu + [\v!horizontal] % not really a menu + [\c!before=\vss, + \c!after=\vss, + \c!middle=\hfil, + \c!distance=\bodyfontsize, % 12pt + \c!width=\v!fit, + \c!height=\v!broad] + +\setupinteractionmenu[\v!left ][\c!width=\leftedgewidth ] +\setupinteractionmenu[\v!right ][\c!width=\rightedgewidth] +% \setupinteractionmenu[\v!top ] [\c!height=\topheight ] +% \setupinteractionmenu[\v!bottom] [\c!height=\bottomheight ] + +\def\placeleftedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings) + {\hbox to \leftedgewidth{\hsize\leftedgewidth\hss\interactionmenus[\v!left]}} + +\def\placerightedgetextblock % Is \hss/\hsize really needed here? (check outer level and settings) + {\hbox to \rightedgewidth{\hsize\rightedgewidth\interactionmenus[\v!right]\hss}} + +\def\placetoptextblock + {\vbox to \topheight + {\vsize\topheight + \csname\??tk\v!top\c!before\endcsname + \interactionmenus[\v!top]% + \csname\??tk\v!top\c!after\endcsname + \kern\zeropoint}} + +\def\placebottomtextblock + {\vbox to \bottomheight + {\vsize\bottomheight + \csname\??tk\v!bottom\c!before\endcsname + \interactionmenus[\v!bottom]% + \csname\??tk\v!bottom\c!after\endcsname + \kern\zeropoint}} + +\ifdefined\leftedgetextcontent + + \appendtoks \iflocation\placeleftedgetextblock \hskip-\leftedgewidth \fi\to \leftedgetextcontent + \appendtoks \iflocation\placerightedgetextblock \hskip-\rightedgewidth \fi\to \rightedgetextcontent + \appendtoks \iflocation\placetoptextblock \vskip-\topheight \fi\to \toptextcontent + \appendtoks \iflocation\placebottomtextblock \vskip-\bottomheight \fi\to \bottomtextcontent + +\fi + +%D Enable and disable menus \unknown\ obsolete: + +\def\gobbletwoparameters[#1][#2]{} + +\def\disableinteractionmenu{\dodoubleempty\gobbletwoparameters} +\def\enableinteractionmenu {\dodoubleempty\gobbletwoparameters} + +\protect \endinput diff --git a/tex/context/base/scrn-nav.mkiv b/tex/context/base/scrn-nav.mkiv index 441951eff..6b21a9e95 100644 --- a/tex/context/base/scrn-nav.mkiv +++ b/tex/context/base/scrn-nav.mkiv @@ -20,17 +20,9 @@ %D this module, where we deal with some common navigational %D features, there will be quite some forward references. %D -%D When I started implementing hypertext support, the macros -%D were mostly dealing with things related to locations, that -%D is click in this location and goto that one. The -%D functionality of many macro depends on the output medium: -%D paper or screen. The next boolean holds the state: - -\newif\iflocation \def\ifinteractief{\iflocation} % upw comp - -%D We also allocate a scratchbox: - -\newbox\locationbox +%D The current support in \MKIV\ is mostly the same as in +%D \MKII\ and the old files have some more detailed +%D (sometimes historic) information. %D There is no interaction at all unless enabled by saying: %D @@ -41,19 +33,14 @@ %D The other settings are: %D %D \showsetup{setupinteraction} -%D -%D In the special driver modules we introduced a switch that -%D forces page destinations (instead of named ones). We set -%D this switch here. -\def\setinteractionparameter#1#2% use with case, no checking done - {\setvalue{\??ia#1}{#2}} % pass #2, can be \blabla +% use with care, no checking done -\def\resetinteractionparameter#1% use with case, no checking done - {\letvalue{\??ia#1}\empty} +\def\setinteractionparameter#1#2% + {\expandafter\def\csname\??ia#1\endcsname{#2}} -% \def\interactionparameter#1% -% {\csname\??ia#1\endcsname} +\def\resetinteractionparameter#1% + {\expandafter\let\csname\??ia#1\endcsname\empty} \newtoks\everysetupinteraction @@ -71,7 +58,7 @@ {\iflocation\else \showmessage\m!interactions2{\ifusepagedestinations\space(PAGE)\fi}% \global\locationtrue - \fi} + \fi}% {\iflocation \showmessage\m!interactions3{\ifusepagedestinations\space(PAGE)\fi}% \global\locationfalse @@ -81,199 +68,66 @@ \else \resetsystemmode\v!interaction \fi - \dosetuppageview\@@iafocus \doifsomething\@@iacalculate {\doregistercalculationset\@@iacalculate}% - \doifelse\@@iastrut\v!yes - \locationstruttrue - \locationstrutfalse - \doifelse\@@iaclick\v!yes - \highlighthyperlinkstrue - \highlighthyperlinksfalse - \doifelse\@@iasplit\v!yes - \locationsplittrue - \locationsplitfalse - \doifelse\@@iadisplay\v!new - \gotonewwindowtrue - \gotonewwindowfalse - \doifelse\@@iapage\v!yes - {\global\usepagedestinationstrue} - {\global\usepagedestinationsfalse}% + \doifelse\@@iastrut \v!yes \settrue \setfalse \uselocationstrut + \doifelse\@@iaclick \v!yes \settrue \setfalse \highlighthyperlinks + \doifelse\@@iadisplay\v!new \settrue \setfalse \gotonewwindow + \doifelse\@@iapage \v!yes \settrue \setfalse \usepagedestinations \to \everysetupinteraction +\def\synchronizebackendidentity + {\ctxlua{backends.codeinjections.setupidentity{ + title = \!!bs\@@iatitle\!!es, + subtitle = \!!bs\@@iasubtitle\!!es, + author = \!!bs\@@iaauthor\!!es, + creator = \!!bs ConTeXt - \contextversion\!!es, + date = \!!bs\@@iadate\!!es, + keywords = \!!bs\@@iakeyword\!!es, + }}} + +\appendtoks + \synchronizebackendidentity +\to \everyfirstshipout + %D We have to make sure of some settings: \def\dolocationstartup {\iflocation - \dosetupinteraction - \handlereferenceactions\@@iaopenaction \dosetupopenaction - \handlereferenceactions\@@iacloseaction\dosetupcloseaction - \setupinteractionscreens + \donefalse + \ifx\@@iaopenaction\empty \else \donetrue + \ctxlua{jobreferences.checkopendocumentactions("\@@iaopenaction")}% + \ctxlua{jobreferences.expandcurrent()}% + \fi + \ifx\@@iacloseaction\empty \else \donetrue + \ctxlua{jobreferences.checkclosedocumentactions("\@@iacloseaction")}% + \ctxlua{jobreferences.expandcurrent()}% + \fi + \ifdone + \ctxlua{jobreferences.flushdocumentactions()}% + \fi \global\let\dolocationstartup\relax \fi} -\appendtoks \dolocationstartup \to \everyshipout - -\def\dolocationpagecheck % brr pdf dependent +\def\dolocationpagecheck {\iflocation - \handlereferenceactions\@@iaopenpageaction \dosetupopenpageaction - \handlereferenceactions\@@iaclosepageaction\dosetupclosepageaction + \donefalse + \ifx\@@iaopenpageaction\empty \else \donetrue + \ctxlua{jobreferences.checkopenpageactions("\@@iaopenpageaction")}% + \ctxlua{jobreferences.expandcurrent()}% + \fi + \ifx\@@iaclosepageaction\empty \else \donetrue + \ctxlua{jobreferences.checkclosepageactions("\@@iaclosepageaction")}% + \ctxlua{jobreferences.expandcurrent()}% + \fi + \ifdone + \ctxlua{jobreferences.flushpageactions()}% + \fi \fi} +\appendtoks \dolocationstartup \to \everyshipout \appendtoks \dolocationpagecheck \to \everyshipout -%D The next few macros are really horrible. For proper -%D navigation a in||line hypertext fragment must have -%D comfortable properties, so we must force some minimal -%D dimensions. On the other hand button, and here I mean those -%D pieces of text with fancy outlines and/or backgrounds, often -%D have fixed, preset dimensions. -%D -%D To make things even worse, if we choose to let the optimal -%D dimensions depend on the height and depth of a strut, a not -%D too uncommon practice in \TEX, we have to deal with the fact -%D that such a strut, set inside a box, is unknown too the -%D outside world. -%D -%D The solution lays in passing the strut characteristics in -%D a proper way, in our case by applying \type{\presetgoto}: -%D -%D \starttyping -%D {some piece of text \presetgoto} -%D \stoptyping -%D -%D This macro stores the current strut values. - -\newif\iflocationstrut -\newif\iflocationsplit - -\def\resetgoto - {\globallet\@@ia@@hoogte\!!zeropoint - \globallet\@@ia@@diepte\!!zeropoint} - -\resetgoto - -\def\presetgoto - {\iflocationstrut - \setstrut - %\xdef\@@ia@@hoogte{\the\strutht}% - %\xdef\@@ia@@diepte{\the\strutdp}% - \globallet\@@ia@@hoogte\strutheight - \globallet\@@ia@@diepte\strutdepth - \else - \globallet\@@ia@@hoogte\@@iaheight - \globallet\@@ia@@diepte\@@iadepth - \fi} - -%D In the macros that deal with making areas into hyperlinks, -%D we use: - -\newbox\driverresources - -\def\collectdriverresource#1% - {\global\setbox\driverresources\hbox{\box\driverresources#1}} - -\def\flushdriverresources - {\ifvoid\driverresources\else\box\driverresources\fi} - -% \def\dohandlegoto#1#2#3% -% {\ifsecondaryreference -% \bgroup\setbox0\hbox{#2#3}\egroup -% \else -% \hbox -% {\setbox0\hbox{#1}% -% \ifdim\wd0<\@@iawidth\relax -% \buttonwidth\@@iawidth\relax -% \else -% \buttonwidth\wd0 -% \fi -% \ifdim\ht0<\@@ia@@hoogte\relax -% \buttonheight\@@ia@@hoogte\relax -% \else -% \buttonheight\ht0 -% \fi -% \ifdim\dp0<\@@ia@@diepte\relax -% \dimen0=\@@ia@@diepte\relax % = ! -% \else -% \dimen0\dp0 -% \fi -% \advance\buttonheight \dimen0 -% \setbox2\hbox -% {\lower\dimen0\hbox -% {\dontcomplain -% \dimen0=.5\wd0 % direct skipping is faster of course -% \advance\dimen0 -.5\buttonwidth % buts this is nicer -% \hskip\dimen0#2#3}}% when visualizing things -% \naturalhbox % needed for omega / moved from plus-omg -% {\ifreversegoto -% \dimen0\wd0\box0\kern-\dimen0\smashbox2\box2\kern\dimen0 -% \else -% \smashbox2\box2\box0 -% \fi -% \flushdriverresources}% -% \resetgoto}% -% \fi} - -\def\dohandlegoto#1#2#3% - {\ifcollectreferenceactions - % this happens here while in mkii elsewhere, better is to deal with - % in in the ref module but that's for later to deal with - \bgroup\setbox\scratchbox\hbox{#2#3}\egroup - \ifsecondaryreference \else - \resetgoto - \fi - \ifsecondaryreference\else#1\resetgoto\fi - \else\ifsecondaryreference - \bgroup\setbox\scratchbox\hbox{#2#3}\egroup - \else - \hbox - {\setbox0\hbox{#1}% - \ifdim\wd0<\@@iawidth\relax - \buttonwidth\@@iawidth\relax - \else - \buttonwidth\wd0 - \fi - \ifdim\ht0<\@@ia@@hoogte\relax - \buttonheight\@@ia@@hoogte\relax - \else - \buttonheight\ht0 - \fi - \ifdim\dp0<\@@ia@@diepte\relax - \dimen0=\@@ia@@diepte\relax % = ! - \else - \dimen0\dp0 - \fi - \advance\buttonheight \dimen0 - \setbox2\hbox - {\lower\dimen0\hbox - {\dontcomplain - \dimen0=.5\wd0 % direct skipping is faster of course - \advance\dimen0 -.5\buttonwidth % buts this is nicer - \hskip\dimen0#2#3}}% when visualizing things - \naturalhbox % needed for omega / moved from plus-omg - {\ifreversegoto - \dimen0\wd0\box0\kern-\dimen0\smashbox2\box2\kern\dimen0 - \else - \smashbox2\box2\box0 - \fi - \flushdriverresources}% - \resetgoto}% - \fi\fi} - -%D The secondary references are processed but not typeset. The -%D special driver must collect the data needed. - -%D The width of the active area depends on the dimensions -%D preset, the actual dimens and/or the height and depth of the -%D strut. -%D -%D Normally the hyper active area is laid on top of the text. -%D This enables stacking hyperlinks on top of each other. When, -%D for some reason the opposite is prefered, one can use the -%D next boolean to signal this wish. - -\newif\ifreversegoto \reversegotofalse - %D As long as there a natural feeling of what can be considered %D hyper active or not, we have to tell users where they can %D possibly click. We've already seen a few macros that deal @@ -296,109 +150,62 @@ %D situations where the typeface is handled by the calling %D macro. -\def\interactioncolor % todo \??ia as argument - {\iflocation - \ifrealreferencepage - \@@iacontrastcolor +%D When we're dealing with pure page references, contrast +%D colors are used when we are already at the page mentioned. + +\def\setlocationcolor#1% not grouped ! + {\ifnum\referencepagestate=\plusone + \edef\askedcontrastcolor{\csname#1\c!contrastcolor\endcsname}% + \ifx\askedcontrastcolor\empty + \dosetcolorattribute{#1}\c!color \else - \@@iacolor + \dosetcolorattribute{#1}\c!contrastcolor \fi + \else % we could just set and if > 0 set again + \dosetcolorattribute{#1}\c!color \fi} -%D CHECK WHERE USED / CONSISTENCY - -\def\showlocation#1% - {\iflocation\color[\@@iacolor]{#1\presetgoto}\else#1\fi} - -%D When local color settings are to be used, we can use the -%D next macro, where \type{#1} is a tag like \type{\??tg} and -%D \type{#2} some text. - -\def\showcoloredlocation#1#2% - {\iflocation - \color[\getvalue{#1\c!color}]{#2\presetgoto}% - \else - #2% - \fi} +\def\setlocationfont#1% + {\dosetfontattribute{#1}\c!style} -%D When we're dealing with pure page references, contrast -%D colors are used when we are already at the page mentioned. +\def\setlocationattributes#1% + {\ifnum\referencepagestate=\plusone + \edef\askedcontrastcolor{\csname#1\c!contrastcolor\endcsname}% + \ifx\askedcontrastcolor\empty + \dosetcolorattribute{#1}\c!color + \else + \dosetcolorattribute{#1}\c!contrastcolor + \fi + \else % we could just set and if > 0 set again + \dosetcolorattribute{#1}\c!color + \fi + \dosetfontattribute{#1}\c!style} -\def\showcontrastlocation#1#2#3% the \@EA is needed - {\iflocation - \ifnum#2=\realpageno\relax - \doifelsevaluenothing{#1\c!color} - {#3\presetgoto} - {\color[\getvalue{#1\c!contrastcolor}]{#3\presetgoto}}% +\def\setlocationcolorspec#1% \resolver + {\ifnum\referencepagestate=\plusone + \edef\askedcontrastcolor{#1\c!contrastcolor}% + \ifx\askedcontrastcolor\empty + \doactivatecolor{#1\c!color}% \else - \color[\getvalue{#1\c!color}]{#3\presetgoto}% + \doactivatecolor\askedcontrastcolor \fi \else - #3% + \doactivatecolor{#1\c!color}% \fi} -%D The next simple macro can be used in color specifications, -%D like \type{\color[\locationcolor{green}]}. - -\def\locationcolor#1% - {\iflocation#1\fi} - %D More tokens are spend when we want both typeface and color %D highlighting. -\def\dolocationattributes#1#2#3#4% - {\bgroup - \let\fontattribute\empty - \let\colorattribute\empty - \doifdefined{#1#2}{\def\fontattribute{\getvalue{#1#2}}}% - \iflocation - \doifdefined{#1#3}{\def\colorattribute{\getvalue{#1#3}}}% - \fi - \startcolor[\colorattribute]% - \@EA\doconvertfont\@EA{\fontattribute}{#4}% no \edef, but \@EA here - \stopcolor - \egroup} - -\def\navigating - {\dolocationattributes\??ia\c!style\c!color} - -%D Although not decently supported in current viewers, a -%D provisory hiding mechanims is implemented. Areas marked as -%D such, are visible on screen, but invisible on paper. Don't -%D trust this mechanism yet! - -\def\dostartinteraction - {\bgroup - \let\stopinteraction\egroup - \dowithnextbox{\dostarthide\flushnextbox\dostophide\egroup}\hbox} - -\let\startinteraction = \relax -\let\stopinteraction = \relax - -% in the future: -% -% eerst boolean invoeren bij menu, achtergrond, balk, button -% enz; verder startinteractie een argument meegeven {#1} -> -% \getvalue{#1\c!print}=={\v!ja} enz. Consequent menubutton -% gebruiken! - \def\@@iatimestamp {\the\normalyear \ifnum\normalmonth<10 0\fi\the\normalmonth \ifnum\normalday <10 0\fi\the\normalday} -% happens in core-fld -% -% \definereference [AtOpenInitializeForm] [\v!geen] - \setupinteraction % start fit page and reset form [\c!state=\v!stop, \c!page=\v!no, \c!click=\v!yes, \c!display=, - %\c!openaction={\v!firstpage,AtOpenInitializeForm}, - %\c!openaction={\v!firstpage,\v!ResetForm}, - %\c!openaction=\v!ResetForm, % too buggy in reader 4.05 \c!openaction=, \c!closeaction=, \c!openpageaction=, diff --git a/tex/context/base/sort-def.mkii b/tex/context/base/sort-def.mkii new file mode 100644 index 000000000..10dc31b14 --- /dev/null +++ b/tex/context/base/sort-def.mkii @@ -0,0 +1,450 @@ +%D \module +%D [ file=sort-def, +%D version=2005.08.08, +%D title=\CONTEXT\ Sort Macros, +%D subtitle=Defaults, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module replaces existing sort key handling and is meant to be +%D used with the new texutil functionality. Here we define the default +%D mappings + +\exportsortexpansion{aeligature} {ae} +\exportsortexpansion{AEligature} {AE} +\exportsortexpansion{ijligature} {ij} +\exportsortexpansion{IJligature} {IJ} +\exportsortexpansion{oeligature} {oe} +\exportsortexpansion{OEligature} {OE} + +\exportsortexpansion{ssharp} {ss} +\exportsortexpansion{Ssharp} {SS} + +\exportsortexpansion{thorn} {} +\exportsortexpansion{Thorn} {} + +\exportsortexpansion{eth} {} +\exportsortexpansion{Eth} {} + +\exportsortexpansion{dj} {dstroke} +\exportsortexpansion{Dj} {Dstroke} + +\exportsortexpansion{Acircumflex} {} +\exportsortexpansion{acircumflex} {} +\exportsortexpansion{Ccircumflex} {} +\exportsortexpansion{ccircumflex} {} +\exportsortexpansion{Ecircumflex} {} +\exportsortexpansion{ecircumflex} {} +\exportsortexpansion{Gcircumflex} {} +\exportsortexpansion{gcircumflex} {} +\exportsortexpansion{Hcircumflex} {} +\exportsortexpansion{hcircumflex} {} +\exportsortexpansion{Icircumflex} {} +\exportsortexpansion{icircumflex} {} +\exportsortexpansion{Jcircumflex} {} +\exportsortexpansion{jcircumflex} {} +\exportsortexpansion{Ocircumflex} {} +\exportsortexpansion{ocircumflex} {} +\exportsortexpansion{Scircumflex} {} +\exportsortexpansion{scircumflex} {} +\exportsortexpansion{Ucircumflex} {} +\exportsortexpansion{ucircumflex} {} +\exportsortexpansion{Wcircumflex} {} +\exportsortexpansion{wcircumflex} {} +\exportsortexpansion{Ycircumflex} {} +\exportsortexpansion{ycircumflex} {} + +\exportsortexpansion{Agrave} {} +\exportsortexpansion{agrave} {} +\exportsortexpansion{Egrave} {} +\exportsortexpansion{egrave} {} +\exportsortexpansion{Igrave} {} +\exportsortexpansion{igrave} {} +\exportsortexpansion{Ograve} {} +\exportsortexpansion{ograve} {} +\exportsortexpansion{Ugrave} {} +\exportsortexpansion{ugrave} {} +\exportsortexpansion{Ygrave} {} +\exportsortexpansion{ygrave} {} + +\exportsortexpansion{Atilde} {} +\exportsortexpansion{atilde} {} +\exportsortexpansion{Itilde} {} +\exportsortexpansion{itilde} {} +\exportsortexpansion{Ntilde} {} +\exportsortexpansion{ntilde} {} +\exportsortexpansion{Otilde} {} +\exportsortexpansion{otilde} {} +\exportsortexpansion{Utilde} {} +\exportsortexpansion{utilde} {} +\exportsortexpansion{Ytilde} {} +\exportsortexpansion{ytilde} {} + +\exportsortexpansion{Adiaeresis} {} +\exportsortexpansion{adiaeresis} {} +\exportsortexpansion{Ediaeresis} {} +\exportsortexpansion{ediaeresis} {} +\exportsortexpansion{Idiaeresis} {} +\exportsortexpansion{idiaeresis} {} +\exportsortexpansion{Odiaeresis} {} +\exportsortexpansion{odiaeresis} {} +\exportsortexpansion{Udiaeresis} {} +\exportsortexpansion{udiaeresis} {} +\exportsortexpansion{Ydiaeresis} {} +\exportsortexpansion{ydiaeresis} {} + +\exportsortexpansion{Aacute} {} +\exportsortexpansion{aacute} {} +\exportsortexpansion{Cacute} {} +\exportsortexpansion{cacute} {} +\exportsortexpansion{Eacute} {} +\exportsortexpansion{eacute} {} +\exportsortexpansion{Iacute} {} +\exportsortexpansion{iacute} {} +\exportsortexpansion{Lacute} {} +\exportsortexpansion{lacute} {} +\exportsortexpansion{Nacute} {} +\exportsortexpansion{nacute} {} +\exportsortexpansion{Oacute} {} +\exportsortexpansion{oacute} {} +\exportsortexpansion{Racute} {} +\exportsortexpansion{racute} {} +\exportsortexpansion{Sacute} {} +\exportsortexpansion{sacute} {} +\exportsortexpansion{Uacute} {} +\exportsortexpansion{uacute} {} +\exportsortexpansion{Yacute} {} +\exportsortexpansion{yacute} {} +\exportsortexpansion{Zacute} {} +\exportsortexpansion{zacute} {} + +\exportsortexpansion{dstroke} {} +\exportsortexpansion{Dstroke} {} +\exportsortexpansion{Hstroke} {} +\exportsortexpansion{hstroke} {} +\exportsortexpansion{Tstroke} {} +\exportsortexpansion{tstroke} {} + +\exportsortexpansion{Cdotaccent} {} +\exportsortexpansion{cdotaccent} {} +\exportsortexpansion{Edotaccent} {} +\exportsortexpansion{edotaccent} {} +\exportsortexpansion{Gdotaccent} {} +\exportsortexpansion{gdotaccent} {} +\exportsortexpansion{Idotaccent} {} +\exportsortexpansion{idotaccent} {} +\exportsortexpansion{Zdotaccent} {} +\exportsortexpansion{zdotaccent} {} + +\exportsortexpansion{Amacron} {} +\exportsortexpansion{amacron} {} +\exportsortexpansion{Emacron} {} +\exportsortexpansion{emacron} {} +\exportsortexpansion{Imacron} {} +\exportsortexpansion{imacron} {} +\exportsortexpansion{Omacron} {} +\exportsortexpansion{omacron} {} +\exportsortexpansion{Umacron} {} +\exportsortexpansion{umacron} {} + +\exportsortexpansion{Ccedilla} {} +\exportsortexpansion{ccedilla} {} +\exportsortexpansion{Kcedilla} {} +\exportsortexpansion{kcedilla} {} +\exportsortexpansion{Lcedilla} {} +\exportsortexpansion{lcedilla} {} +\exportsortexpansion{Ncedilla} {} +\exportsortexpansion{ncedilla} {} +\exportsortexpansion{Rcedilla} {} +\exportsortexpansion{rcedilla} {} +\exportsortexpansion{Scedilla} {} +\exportsortexpansion{scedilla} {} +\exportsortexpansion{Tcedilla} {} +\exportsortexpansion{tcedilla} {} + +\exportsortexpansion{Ohungarumlaut} {} +\exportsortexpansion{ohungarumlaut} {} +\exportsortexpansion{Uhungarumlaut} {} +\exportsortexpansion{uhungarumlaut} {} + +\exportsortexpansion{Aogonek} {} +\exportsortexpansion{aogonek} {} +\exportsortexpansion{Eogonek} {} +\exportsortexpansion{eogonek} {} +\exportsortexpansion{Iogonek} {} +\exportsortexpansion{iogonek} {} +\exportsortexpansion{Uogonek} {} +\exportsortexpansion{uogonek} {} + +\exportsortexpansion{Aring} {} +\exportsortexpansion{aring} {} +\exportsortexpansion{Uring} {} +\exportsortexpansion{uring} {} + +\exportsortexpansion{Abreve} {} +\exportsortexpansion{abreve} {} +\exportsortexpansion{Ebreve} {} +\exportsortexpansion{ebreve} {} +\exportsortexpansion{Gbreve} {} +\exportsortexpansion{gbreve} {} +\exportsortexpansion{Ibreve} {} +\exportsortexpansion{ibreve} {} +\exportsortexpansion{Obreve} {} +\exportsortexpansion{obreve} {} +\exportsortexpansion{Ubreve} {} +\exportsortexpansion{ubreve} {} + +\exportsortexpansion{Ccaron} {} +\exportsortexpansion{ccaron} {} +\exportsortexpansion{Dcaron} {} +\exportsortexpansion{dcaron} {} +\exportsortexpansion{Ecaron} {} +\exportsortexpansion{ecaron} {} +\exportsortexpansion{Lcaron} {} +\exportsortexpansion{lcaron} {} +\exportsortexpansion{Ncaron} {} +\exportsortexpansion{ncaron} {} +\exportsortexpansion{Rcaron} {} +\exportsortexpansion{rcaron} {} +\exportsortexpansion{Scaron} {} +\exportsortexpansion{scaron} {} +\exportsortexpansion{Tcaron} {} +\exportsortexpansion{tcaron} {} +\exportsortexpansion{Ycaron} {} +\exportsortexpansion{ycaron} {} +\exportsortexpansion{Zcaron} {} +\exportsortexpansion{zcaron} {} + +\exportsortexpansion{Lstroke} {} +\exportsortexpansion{lstroke} {} +\exportsortexpansion{Ostroke} {} +\exportsortexpansion{ostroke} {} + +\exportsortexpansion{aumlaut} {} +\exportsortexpansion{eumlaut} {} +\exportsortexpansion{iumlaut} {} +\exportsortexpansion{oumlaut} {} +\exportsortexpansion{uumlaut} {} + +\exportsortexpansion{Aumlaut} {} +\exportsortexpansion{Eumlaut} {} +\exportsortexpansion{Iumlaut} {} +\exportsortexpansion{Oumlaut} {} +\exportsortexpansion{Uumlaut} {} + +\exportsortexpansion{scommaaccent} {} +\exportsortexpansion{Scommaaccent} {} +\exportsortexpansion{tcommaaccent} {} +\exportsortexpansion{Tcommaaccent} {} + +\exportsortexpansion{Etilde} {} +\exportsortexpansion{etilde} {} + +\exportsortexpansion{Ahook} {} +\exportsortexpansion{ahook} {} +\exportsortexpansion{Ehook} {} +\exportsortexpansion{ehook} {} +\exportsortexpansion{Ihook} {} +\exportsortexpansion{ihook} {} +\exportsortexpansion{Ohook} {} +\exportsortexpansion{ohook} {} +\exportsortexpansion{Uhook} {} +\exportsortexpansion{uhook} {} +\exportsortexpansion{Yhook} {} +\exportsortexpansion{yhook} {} + +\exportsortexpansion{Acircumflexgrave} {} +\exportsortexpansion{Acircumflexacute} {} +\exportsortexpansion{Acircumflextilde} {} +\exportsortexpansion{Acircumflexhook} {} +\exportsortexpansion{acircumflexgrave} {} +\exportsortexpansion{acircumflexacute} {} +\exportsortexpansion{acircumflextilde} {} +\exportsortexpansion{acircumflexhook} {} +\exportsortexpansion{Ecircumflexgrave} {} +\exportsortexpansion{Ecircumflexacute} {} +\exportsortexpansion{Ecircumflextilde} {} +\exportsortexpansion{Ecircumflexhook} {} +\exportsortexpansion{ecircumflexgrave} {} +\exportsortexpansion{ecircumflexacute} {} +\exportsortexpansion{ecircumflextilde} {} +\exportsortexpansion{ecircumflexhook} {} +\exportsortexpansion{Ocircumflexgrave} {} +\exportsortexpansion{Ocircumflexacute} {} +\exportsortexpansion{Ocircumflextilde} {} +\exportsortexpansion{Ocircumflexhook} {} +\exportsortexpansion{ocircumflexgrave} {} +\exportsortexpansion{ocircumflexacute} {} +\exportsortexpansion{ocircumflextilde} {} +\exportsortexpansion{ocircumflexhook} {} + +\exportsortexpansion{Abrevegrave} {} +\exportsortexpansion{Abreveacute} {} +\exportsortexpansion{Abrevetilde} {} +\exportsortexpansion{Abrevehook} {} +\exportsortexpansion{abrevegrave} {} +\exportsortexpansion{abreveacute} {} +\exportsortexpansion{abrevetilde} {} +\exportsortexpansion{abrevehook} {} + +\exportsortexpansion{Adotbelow} {} +\exportsortexpansion{adotbelow} {} +\exportsortexpansion{Edotbelow} {} +\exportsortexpansion{edotbelow} {} +\exportsortexpansion{Idotbelow} {} +\exportsortexpansion{idotbelow} {} +\exportsortexpansion{Odotbelow} {} +\exportsortexpansion{odotbelow} {} +\exportsortexpansion{Udotbelow} {} +\exportsortexpansion{udotbelow} {} +\exportsortexpansion{Ydotbelow} {} +\exportsortexpansion{ydotbelow} {} +\exportsortexpansion{Ohorndotbelow} {} +\exportsortexpansion{ohorndotbelow} {} +\exportsortexpansion{Uhorndotbelow} {} +\exportsortexpansion{uhorndotbelow} {} + +\exportsortexpansion{Acircumflexdotbelow} {} +\exportsortexpansion{acircumflexdotbelow} {} +\exportsortexpansion{Ecircumflexdotbelow} {} +\exportsortexpansion{ecircumflexdotbelow} {} +\exportsortexpansion{Ocircumflexdotbelow} {} +\exportsortexpansion{ocircumflexdotbelow} {} +\exportsortexpansion{Abrevedotbelow} {} +\exportsortexpansion{abrevedotbelow} {} + +\exportsortexpansion{Ohorn} {} +\exportsortexpansion{Ohorngrave} {} +\exportsortexpansion{Ohornacute} {} +\exportsortexpansion{Ohorntilde} {} +\exportsortexpansion{Ohornhook } {} +\exportsortexpansion{ohorn} {} +\exportsortexpansion{ohorngrave} {} +\exportsortexpansion{ohornacute} {} +\exportsortexpansion{ohorntilde} {} +\exportsortexpansion{ohornhook } {} +\exportsortexpansion{Uhorn} {} +\exportsortexpansion{Uhorngrave} {} +\exportsortexpansion{Uhornacute} {} +\exportsortexpansion{Uhorntilde} {} +\exportsortexpansion{Uhornhook } {} +\exportsortexpansion{uhorn} {} +\exportsortexpansion{uhorngrave} {} +\exportsortexpansion{uhornacute} {} +\exportsortexpansion{uhorntilde} {} +\exportsortexpansion{uhornhook} {} + +\exportsortexpansion{eszett} {ssharp} +\exportsortexpansion{Eszett} {Ssharp} + +\exportsortexpansion{lslash} {lstroke} +\exportsortexpansion{Lslash} {Lstroke} +\exportsortexpansion{dslash} {dstroke} +\exportsortexpansion{Dslash} {Dstroke} +\exportsortexpansion{oslash} {ostroke} +\exportsortexpansion{Oslash} {Ostroke} + +\exportsortexpansion{dcroat} {dstroke} +\exportsortexpansion{Dcroat} {Dstroke} + +% more + +\exportsortshortcut{\^ A} {\Acircumflex} \exportsortshortcut{\^ a} {\acircumflex} +\exportsortshortcut{\^ C} {\Ccircumflex} \exportsortshortcut{\^ c} {\ccircumflex} +\exportsortshortcut{\^ E} {\Ecircumflex} \exportsortshortcut{\^ e} {\ecircumflex} +\exportsortshortcut{\^ G} {\Gcircumflex} \exportsortshortcut{\^ g} {\gcircumflex} +\exportsortshortcut{\^ H} {\Hcircumflex} \exportsortshortcut{\^ h} {\hcircumflex} +\exportsortshortcut{\^ I} {\Icircumflex} \exportsortshortcut{\^ i} {\icircumflex} \exportsortshortcut{\^\i} {\icircumflex} +\exportsortshortcut{\^ J} {\Jcircumflex} \exportsortshortcut{\^ j} {\jcircumflex} \exportsortshortcut{\^\j} {\jcircumflex} +\exportsortshortcut{\^ O} {\Ocircumflex} \exportsortshortcut{\^ o} {\ocircumflex} +\exportsortshortcut{\^ S} {\Scircumflex} \exportsortshortcut{\^ s} {\scircumflex} +\exportsortshortcut{\^ U} {\Ucircumflex} \exportsortshortcut{\^ u} {\ucircumflex} +\exportsortshortcut{\^ W} {\Wcircumflex} \exportsortshortcut{\^ w} {\wcircumflex} +\exportsortshortcut{\^ Y} {\Ycircumflex} \exportsortshortcut{\^ y} {\ycircumflex} + +\exportsortshortcut{\` A} {\Agrave} \exportsortshortcut{\` a} {\agrave} +\exportsortshortcut{\` E} {\Egrave} \exportsortshortcut{\` e} {\egrave} +\exportsortshortcut{\` I} {\Igrave} \exportsortshortcut{\` i} {\igrave} \exportsortshortcut{\`\i} {\igrave} +\exportsortshortcut{\` O} {\Ograve} \exportsortshortcut{\` o} {\ograve} +\exportsortshortcut{\` U} {\Ugrave} \exportsortshortcut{\` u} {\ugrave} +\exportsortshortcut{\` Y} {\Ygrave} \exportsortshortcut{\` y} {\ygrave} + +\exportsortshortcut{\~ A} {\Atilde} \exportsortshortcut{\~ a} {\atilde} +\exportsortshortcut{\~ I} {\Itilde} \exportsortshortcut{\~ i} {\itilde} \exportsortshortcut{\~\i} {\itilde} +\exportsortshortcut{\~ O} {\Otilde} \exportsortshortcut{\~ o} {\otilde} +\exportsortshortcut{\~ U} {\Utilde} \exportsortshortcut{\~ u} {\utilde} + +\exportsortshortcut{\" A} {\Adiaeresis} \exportsortshortcut{\" a} {\adiaeresis} +\exportsortshortcut{\" E} {\Ediaeresis} \exportsortshortcut{\" e} {\ediaeresis} +\exportsortshortcut{\" I} {\Idiaeresis} \exportsortshortcut{\" i} {\idiaeresis} \exportsortshortcut{\"\i} {\idiaeresis} +\exportsortshortcut{\" O} {\Odiaeresis} \exportsortshortcut{\" o} {\odiaeresis} +\exportsortshortcut{\" U} {\Udiaeresis} \exportsortshortcut{\" u} {\udiaeresis} +\exportsortshortcut{\" Y} {\Ydiaeresis} \exportsortshortcut{\" y} {\ydiaeresis} + +\exportsortshortcut{\' A} {\Aacute} \exportsortshortcut{\' a} {\aacute} +\exportsortshortcut{\' C} {\Cacute} \exportsortshortcut{\' c} {\cacute} +\exportsortshortcut{\' E} {\Eacute} \exportsortshortcut{\' e} {\eacute} +\exportsortshortcut{\' I} {\Iacute} \exportsortshortcut{\' i} {\iacute} \exportsortshortcut{\'\i} {\iacute} +\exportsortshortcut{\' L} {\Lacute} \exportsortshortcut{\' l} {\lacute} +\exportsortshortcut{\' N} {\Nacute} \exportsortshortcut{\' n} {\nacute} +\exportsortshortcut{\' O} {\Oacute} \exportsortshortcut{\' o} {\oacute} +\exportsortshortcut{\' R} {\Racute} \exportsortshortcut{\' r} {\racute} +\exportsortshortcut{\' S} {\Sacute} \exportsortshortcut{\' s} {\sacute} +\exportsortshortcut{\' U} {\Uacute} \exportsortshortcut{\' u} {\uacute} +\exportsortshortcut{\' Y} {\Yacute} \exportsortshortcut{\' y} {\yacute} +\exportsortshortcut{\' Z} {\Zacute} \exportsortshortcut{\' z} {\zacute} + +\exportsortshortcut{\. C} {\Cdotaccent} \exportsortshortcut{\. c} {\cdotaccent} +\exportsortshortcut{\. E} {\Edotaccent} \exportsortshortcut{\. e} {\edotaccent} +\exportsortshortcut{\. G} {\Gdotaccent} \exportsortshortcut{\. g} {\gdotaccent} +\exportsortshortcut{\. I} {\Idotaccent} \exportsortshortcut{\. i} {\idotaccent} \exportsortshortcut{\.\i} {\idotaccent} +\exportsortshortcut{\. Z} {\Zdotaccent} \exportsortshortcut{\. z} {\zdotaccent} + +\exportsortshortcut{\= A} {\Amacron} \exportsortshortcut{\= a} {\amacron} +\exportsortshortcut{\= E} {\Emacron} \exportsortshortcut{\= e} {\emacron} +\exportsortshortcut{\= I} {\Imacron} \exportsortshortcut{\= i} {\imacron} \exportsortshortcut{\=\i} {\imacron} +\exportsortshortcut{\= O} {\Omacron} \exportsortshortcut{\= o} {\omacron} +\exportsortshortcut{\= U} {\Umacron} \exportsortshortcut{\= u} {\umacron} + +\exportsortshortcut{\c C} {\Ccedilla} \exportsortshortcut{\c c} {\ccedilla} +\exportsortshortcut{\c K} {\Kcedilla} \exportsortshortcut{\c k} {\kcedilla} +\exportsortshortcut{\c L} {\Lcedilla} \exportsortshortcut{\c l} {\lcedilla} +\exportsortshortcut{\c N} {\Ncedilla} \exportsortshortcut{\c n} {\ncedilla} +\exportsortshortcut{\c R} {\Rcedilla} \exportsortshortcut{\c r} {\rcedilla} +\exportsortshortcut{\c S} {\Scedilla} \exportsortshortcut{\c s} {\scedilla} +\exportsortshortcut{\c T} {\Tcedilla} \exportsortshortcut{\c t} {\tcedilla} + +\exportsortshortcut{\H O} {\Ohungarumlaut} \exportsortshortcut{\H o} {\ohungarumlaut} +\exportsortshortcut{\H u} {\uhungarumlaut} \exportsortshortcut{\H U} {\Uhungarumlaut} + +\exportsortshortcut{\k A} {\Aogonek} \exportsortshortcut{\k a} {\aogonek} +\exportsortshortcut{\k E} {\Eogonek} \exportsortshortcut{\k e} {\eogonek} +\exportsortshortcut{\k I} {\Iogonek} \exportsortshortcut{\k i} {\iogonek} +\exportsortshortcut{\k U} {\Uogonek} \exportsortshortcut{\k u} {\uogonek} + +\exportsortshortcut{\r A} {\Aring} \exportsortshortcut{\r a} {\aring} +\exportsortshortcut{\r U} {\Uring} \exportsortshortcut{\r u} {\uring} + +\exportsortshortcut{\u A} {\Abreve} \exportsortshortcut{\u a} {\abreve} +\exportsortshortcut{\u E} {\Ebreve} \exportsortshortcut{\u e} {\ebreve} +\exportsortshortcut{\u G} {\Gbreve} \exportsortshortcut{\u g} {\gbreve} +\exportsortshortcut{\u I} {\Ibreve} \exportsortshortcut{\u i} {\ibreve} \exportsortshortcut{\u\i} {\ibreve} +\exportsortshortcut{\u O} {\Obreve} \exportsortshortcut{\u o} {\obreve} +\exportsortshortcut{\u U} {\Ubreve} \exportsortshortcut{\u u} {\ubreve} + +\exportsortshortcut{\v C} {\Ccaron} \exportsortshortcut{\v c} {\ccaron} +\exportsortshortcut{\v D} {\Dcaron} \exportsortshortcut{\v d} {\dcaron} +\exportsortshortcut{\v E} {\Ecaron} \exportsortshortcut{\v e} {\ecaron} +\exportsortshortcut{\v L} {\Lcaron} \exportsortshortcut{\v l} {\lcaron} +\exportsortshortcut{\v N} {\Ncaron} \exportsortshortcut{\v n} {\ncaron} +\exportsortshortcut{\v R} {\Rcaron} \exportsortshortcut{\v r} {\rcaron} +\exportsortshortcut{\v S} {\Scaron} \exportsortshortcut{\v s} {\scaron} +\exportsortshortcut{\v T} {\Tcaron} \exportsortshortcut{\v t} {\tcaron} +\exportsortshortcut{\v Z} {\Zcaron} \exportsortshortcut{\v z} {\zcaron} + +\endinput diff --git a/tex/context/base/sort-def.tex b/tex/context/base/sort-def.tex deleted file mode 100644 index 10dc31b14..000000000 --- a/tex/context/base/sort-def.tex +++ /dev/null @@ -1,450 +0,0 @@ -%D \module -%D [ file=sort-def, -%D version=2005.08.08, -%D title=\CONTEXT\ Sort Macros, -%D subtitle=Defaults, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module replaces existing sort key handling and is meant to be -%D used with the new texutil functionality. Here we define the default -%D mappings - -\exportsortexpansion{aeligature} {ae} -\exportsortexpansion{AEligature} {AE} -\exportsortexpansion{ijligature} {ij} -\exportsortexpansion{IJligature} {IJ} -\exportsortexpansion{oeligature} {oe} -\exportsortexpansion{OEligature} {OE} - -\exportsortexpansion{ssharp} {ss} -\exportsortexpansion{Ssharp} {SS} - -\exportsortexpansion{thorn} {} -\exportsortexpansion{Thorn} {} - -\exportsortexpansion{eth} {} -\exportsortexpansion{Eth} {} - -\exportsortexpansion{dj} {dstroke} -\exportsortexpansion{Dj} {Dstroke} - -\exportsortexpansion{Acircumflex} {} -\exportsortexpansion{acircumflex} {} -\exportsortexpansion{Ccircumflex} {} -\exportsortexpansion{ccircumflex} {} -\exportsortexpansion{Ecircumflex} {} -\exportsortexpansion{ecircumflex} {} -\exportsortexpansion{Gcircumflex} {} -\exportsortexpansion{gcircumflex} {} -\exportsortexpansion{Hcircumflex} {} -\exportsortexpansion{hcircumflex} {} -\exportsortexpansion{Icircumflex} {} -\exportsortexpansion{icircumflex} {} -\exportsortexpansion{Jcircumflex} {} -\exportsortexpansion{jcircumflex} {} -\exportsortexpansion{Ocircumflex} {} -\exportsortexpansion{ocircumflex} {} -\exportsortexpansion{Scircumflex} {} -\exportsortexpansion{scircumflex} {} -\exportsortexpansion{Ucircumflex} {} -\exportsortexpansion{ucircumflex} {} -\exportsortexpansion{Wcircumflex} {} -\exportsortexpansion{wcircumflex} {} -\exportsortexpansion{Ycircumflex} {} -\exportsortexpansion{ycircumflex} {} - -\exportsortexpansion{Agrave} {} -\exportsortexpansion{agrave} {} -\exportsortexpansion{Egrave} {} -\exportsortexpansion{egrave} {} -\exportsortexpansion{Igrave} {} -\exportsortexpansion{igrave} {} -\exportsortexpansion{Ograve} {} -\exportsortexpansion{ograve} {} -\exportsortexpansion{Ugrave} {} -\exportsortexpansion{ugrave} {} -\exportsortexpansion{Ygrave} {} -\exportsortexpansion{ygrave} {} - -\exportsortexpansion{Atilde} {} -\exportsortexpansion{atilde} {} -\exportsortexpansion{Itilde} {} -\exportsortexpansion{itilde} {} -\exportsortexpansion{Ntilde} {} -\exportsortexpansion{ntilde} {} -\exportsortexpansion{Otilde} {} -\exportsortexpansion{otilde} {} -\exportsortexpansion{Utilde} {} -\exportsortexpansion{utilde} {} -\exportsortexpansion{Ytilde} {} -\exportsortexpansion{ytilde} {} - -\exportsortexpansion{Adiaeresis} {} -\exportsortexpansion{adiaeresis} {} -\exportsortexpansion{Ediaeresis} {} -\exportsortexpansion{ediaeresis} {} -\exportsortexpansion{Idiaeresis} {} -\exportsortexpansion{idiaeresis} {} -\exportsortexpansion{Odiaeresis} {} -\exportsortexpansion{odiaeresis} {} -\exportsortexpansion{Udiaeresis} {} -\exportsortexpansion{udiaeresis} {} -\exportsortexpansion{Ydiaeresis} {} -\exportsortexpansion{ydiaeresis} {} - -\exportsortexpansion{Aacute} {} -\exportsortexpansion{aacute} {} -\exportsortexpansion{Cacute} {} -\exportsortexpansion{cacute} {} -\exportsortexpansion{Eacute} {} -\exportsortexpansion{eacute} {} -\exportsortexpansion{Iacute} {} -\exportsortexpansion{iacute} {} -\exportsortexpansion{Lacute} {} -\exportsortexpansion{lacute} {} -\exportsortexpansion{Nacute} {} -\exportsortexpansion{nacute} {} -\exportsortexpansion{Oacute} {} -\exportsortexpansion{oacute} {} -\exportsortexpansion{Racute} {} -\exportsortexpansion{racute} {} -\exportsortexpansion{Sacute} {} -\exportsortexpansion{sacute} {} -\exportsortexpansion{Uacute} {} -\exportsortexpansion{uacute} {} -\exportsortexpansion{Yacute} {} -\exportsortexpansion{yacute} {} -\exportsortexpansion{Zacute} {} -\exportsortexpansion{zacute} {} - -\exportsortexpansion{dstroke} {} -\exportsortexpansion{Dstroke} {} -\exportsortexpansion{Hstroke} {} -\exportsortexpansion{hstroke} {} -\exportsortexpansion{Tstroke} {} -\exportsortexpansion{tstroke} {} - -\exportsortexpansion{Cdotaccent} {} -\exportsortexpansion{cdotaccent} {} -\exportsortexpansion{Edotaccent} {} -\exportsortexpansion{edotaccent} {} -\exportsortexpansion{Gdotaccent} {} -\exportsortexpansion{gdotaccent} {} -\exportsortexpansion{Idotaccent} {} -\exportsortexpansion{idotaccent} {} -\exportsortexpansion{Zdotaccent} {} -\exportsortexpansion{zdotaccent} {} - -\exportsortexpansion{Amacron} {} -\exportsortexpansion{amacron} {} -\exportsortexpansion{Emacron} {} -\exportsortexpansion{emacron} {} -\exportsortexpansion{Imacron} {} -\exportsortexpansion{imacron} {} -\exportsortexpansion{Omacron} {} -\exportsortexpansion{omacron} {} -\exportsortexpansion{Umacron} {} -\exportsortexpansion{umacron} {} - -\exportsortexpansion{Ccedilla} {} -\exportsortexpansion{ccedilla} {} -\exportsortexpansion{Kcedilla} {} -\exportsortexpansion{kcedilla} {} -\exportsortexpansion{Lcedilla} {} -\exportsortexpansion{lcedilla} {} -\exportsortexpansion{Ncedilla} {} -\exportsortexpansion{ncedilla} {} -\exportsortexpansion{Rcedilla} {} -\exportsortexpansion{rcedilla} {} -\exportsortexpansion{Scedilla} {} -\exportsortexpansion{scedilla} {} -\exportsortexpansion{Tcedilla} {} -\exportsortexpansion{tcedilla} {} - -\exportsortexpansion{Ohungarumlaut} {} -\exportsortexpansion{ohungarumlaut} {} -\exportsortexpansion{Uhungarumlaut} {} -\exportsortexpansion{uhungarumlaut} {} - -\exportsortexpansion{Aogonek} {} -\exportsortexpansion{aogonek} {} -\exportsortexpansion{Eogonek} {} -\exportsortexpansion{eogonek} {} -\exportsortexpansion{Iogonek} {} -\exportsortexpansion{iogonek} {} -\exportsortexpansion{Uogonek} {} -\exportsortexpansion{uogonek} {} - -\exportsortexpansion{Aring} {} -\exportsortexpansion{aring} {} -\exportsortexpansion{Uring} {} -\exportsortexpansion{uring} {} - -\exportsortexpansion{Abreve} {} -\exportsortexpansion{abreve} {} -\exportsortexpansion{Ebreve} {} -\exportsortexpansion{ebreve} {} -\exportsortexpansion{Gbreve} {} -\exportsortexpansion{gbreve} {} -\exportsortexpansion{Ibreve} {} -\exportsortexpansion{ibreve} {} -\exportsortexpansion{Obreve} {} -\exportsortexpansion{obreve} {} -\exportsortexpansion{Ubreve} {} -\exportsortexpansion{ubreve} {} - -\exportsortexpansion{Ccaron} {} -\exportsortexpansion{ccaron} {} -\exportsortexpansion{Dcaron} {} -\exportsortexpansion{dcaron} {} -\exportsortexpansion{Ecaron} {} -\exportsortexpansion{ecaron} {} -\exportsortexpansion{Lcaron} {} -\exportsortexpansion{lcaron} {} -\exportsortexpansion{Ncaron} {} -\exportsortexpansion{ncaron} {} -\exportsortexpansion{Rcaron} {} -\exportsortexpansion{rcaron} {} -\exportsortexpansion{Scaron} {} -\exportsortexpansion{scaron} {} -\exportsortexpansion{Tcaron} {} -\exportsortexpansion{tcaron} {} -\exportsortexpansion{Ycaron} {} -\exportsortexpansion{ycaron} {} -\exportsortexpansion{Zcaron} {} -\exportsortexpansion{zcaron} {} - -\exportsortexpansion{Lstroke} {} -\exportsortexpansion{lstroke} {} -\exportsortexpansion{Ostroke} {} -\exportsortexpansion{ostroke} {} - -\exportsortexpansion{aumlaut} {} -\exportsortexpansion{eumlaut} {} -\exportsortexpansion{iumlaut} {} -\exportsortexpansion{oumlaut} {} -\exportsortexpansion{uumlaut} {} - -\exportsortexpansion{Aumlaut} {} -\exportsortexpansion{Eumlaut} {} -\exportsortexpansion{Iumlaut} {} -\exportsortexpansion{Oumlaut} {} -\exportsortexpansion{Uumlaut} {} - -\exportsortexpansion{scommaaccent} {} -\exportsortexpansion{Scommaaccent} {} -\exportsortexpansion{tcommaaccent} {} -\exportsortexpansion{Tcommaaccent} {} - -\exportsortexpansion{Etilde} {} -\exportsortexpansion{etilde} {} - -\exportsortexpansion{Ahook} {} -\exportsortexpansion{ahook} {} -\exportsortexpansion{Ehook} {} -\exportsortexpansion{ehook} {} -\exportsortexpansion{Ihook} {} -\exportsortexpansion{ihook} {} -\exportsortexpansion{Ohook} {} -\exportsortexpansion{ohook} {} -\exportsortexpansion{Uhook} {} -\exportsortexpansion{uhook} {} -\exportsortexpansion{Yhook} {} -\exportsortexpansion{yhook} {} - -\exportsortexpansion{Acircumflexgrave} {} -\exportsortexpansion{Acircumflexacute} {} -\exportsortexpansion{Acircumflextilde} {} -\exportsortexpansion{Acircumflexhook} {} -\exportsortexpansion{acircumflexgrave} {} -\exportsortexpansion{acircumflexacute} {} -\exportsortexpansion{acircumflextilde} {} -\exportsortexpansion{acircumflexhook} {} -\exportsortexpansion{Ecircumflexgrave} {} -\exportsortexpansion{Ecircumflexacute} {} -\exportsortexpansion{Ecircumflextilde} {} -\exportsortexpansion{Ecircumflexhook} {} -\exportsortexpansion{ecircumflexgrave} {} -\exportsortexpansion{ecircumflexacute} {} -\exportsortexpansion{ecircumflextilde} {} -\exportsortexpansion{ecircumflexhook} {} -\exportsortexpansion{Ocircumflexgrave} {} -\exportsortexpansion{Ocircumflexacute} {} -\exportsortexpansion{Ocircumflextilde} {} -\exportsortexpansion{Ocircumflexhook} {} -\exportsortexpansion{ocircumflexgrave} {} -\exportsortexpansion{ocircumflexacute} {} -\exportsortexpansion{ocircumflextilde} {} -\exportsortexpansion{ocircumflexhook} {} - -\exportsortexpansion{Abrevegrave} {} -\exportsortexpansion{Abreveacute} {} -\exportsortexpansion{Abrevetilde} {} -\exportsortexpansion{Abrevehook} {} -\exportsortexpansion{abrevegrave} {} -\exportsortexpansion{abreveacute} {} -\exportsortexpansion{abrevetilde} {} -\exportsortexpansion{abrevehook} {} - -\exportsortexpansion{Adotbelow} {} -\exportsortexpansion{adotbelow} {} -\exportsortexpansion{Edotbelow} {} -\exportsortexpansion{edotbelow} {} -\exportsortexpansion{Idotbelow} {} -\exportsortexpansion{idotbelow} {} -\exportsortexpansion{Odotbelow} {} -\exportsortexpansion{odotbelow} {} -\exportsortexpansion{Udotbelow} {} -\exportsortexpansion{udotbelow} {} -\exportsortexpansion{Ydotbelow} {} -\exportsortexpansion{ydotbelow} {} -\exportsortexpansion{Ohorndotbelow} {} -\exportsortexpansion{ohorndotbelow} {} -\exportsortexpansion{Uhorndotbelow} {} -\exportsortexpansion{uhorndotbelow} {} - -\exportsortexpansion{Acircumflexdotbelow} {} -\exportsortexpansion{acircumflexdotbelow} {} -\exportsortexpansion{Ecircumflexdotbelow} {} -\exportsortexpansion{ecircumflexdotbelow} {} -\exportsortexpansion{Ocircumflexdotbelow} {} -\exportsortexpansion{ocircumflexdotbelow} {} -\exportsortexpansion{Abrevedotbelow} {} -\exportsortexpansion{abrevedotbelow} {} - -\exportsortexpansion{Ohorn} {} -\exportsortexpansion{Ohorngrave} {} -\exportsortexpansion{Ohornacute} {} -\exportsortexpansion{Ohorntilde} {} -\exportsortexpansion{Ohornhook } {} -\exportsortexpansion{ohorn} {} -\exportsortexpansion{ohorngrave} {} -\exportsortexpansion{ohornacute} {} -\exportsortexpansion{ohorntilde} {} -\exportsortexpansion{ohornhook } {} -\exportsortexpansion{Uhorn} {} -\exportsortexpansion{Uhorngrave} {} -\exportsortexpansion{Uhornacute} {} -\exportsortexpansion{Uhorntilde} {} -\exportsortexpansion{Uhornhook } {} -\exportsortexpansion{uhorn} {} -\exportsortexpansion{uhorngrave} {} -\exportsortexpansion{uhornacute} {} -\exportsortexpansion{uhorntilde} {} -\exportsortexpansion{uhornhook} {} - -\exportsortexpansion{eszett} {ssharp} -\exportsortexpansion{Eszett} {Ssharp} - -\exportsortexpansion{lslash} {lstroke} -\exportsortexpansion{Lslash} {Lstroke} -\exportsortexpansion{dslash} {dstroke} -\exportsortexpansion{Dslash} {Dstroke} -\exportsortexpansion{oslash} {ostroke} -\exportsortexpansion{Oslash} {Ostroke} - -\exportsortexpansion{dcroat} {dstroke} -\exportsortexpansion{Dcroat} {Dstroke} - -% more - -\exportsortshortcut{\^ A} {\Acircumflex} \exportsortshortcut{\^ a} {\acircumflex} -\exportsortshortcut{\^ C} {\Ccircumflex} \exportsortshortcut{\^ c} {\ccircumflex} -\exportsortshortcut{\^ E} {\Ecircumflex} \exportsortshortcut{\^ e} {\ecircumflex} -\exportsortshortcut{\^ G} {\Gcircumflex} \exportsortshortcut{\^ g} {\gcircumflex} -\exportsortshortcut{\^ H} {\Hcircumflex} \exportsortshortcut{\^ h} {\hcircumflex} -\exportsortshortcut{\^ I} {\Icircumflex} \exportsortshortcut{\^ i} {\icircumflex} \exportsortshortcut{\^\i} {\icircumflex} -\exportsortshortcut{\^ J} {\Jcircumflex} \exportsortshortcut{\^ j} {\jcircumflex} \exportsortshortcut{\^\j} {\jcircumflex} -\exportsortshortcut{\^ O} {\Ocircumflex} \exportsortshortcut{\^ o} {\ocircumflex} -\exportsortshortcut{\^ S} {\Scircumflex} \exportsortshortcut{\^ s} {\scircumflex} -\exportsortshortcut{\^ U} {\Ucircumflex} \exportsortshortcut{\^ u} {\ucircumflex} -\exportsortshortcut{\^ W} {\Wcircumflex} \exportsortshortcut{\^ w} {\wcircumflex} -\exportsortshortcut{\^ Y} {\Ycircumflex} \exportsortshortcut{\^ y} {\ycircumflex} - -\exportsortshortcut{\` A} {\Agrave} \exportsortshortcut{\` a} {\agrave} -\exportsortshortcut{\` E} {\Egrave} \exportsortshortcut{\` e} {\egrave} -\exportsortshortcut{\` I} {\Igrave} \exportsortshortcut{\` i} {\igrave} \exportsortshortcut{\`\i} {\igrave} -\exportsortshortcut{\` O} {\Ograve} \exportsortshortcut{\` o} {\ograve} -\exportsortshortcut{\` U} {\Ugrave} \exportsortshortcut{\` u} {\ugrave} -\exportsortshortcut{\` Y} {\Ygrave} \exportsortshortcut{\` y} {\ygrave} - -\exportsortshortcut{\~ A} {\Atilde} \exportsortshortcut{\~ a} {\atilde} -\exportsortshortcut{\~ I} {\Itilde} \exportsortshortcut{\~ i} {\itilde} \exportsortshortcut{\~\i} {\itilde} -\exportsortshortcut{\~ O} {\Otilde} \exportsortshortcut{\~ o} {\otilde} -\exportsortshortcut{\~ U} {\Utilde} \exportsortshortcut{\~ u} {\utilde} - -\exportsortshortcut{\" A} {\Adiaeresis} \exportsortshortcut{\" a} {\adiaeresis} -\exportsortshortcut{\" E} {\Ediaeresis} \exportsortshortcut{\" e} {\ediaeresis} -\exportsortshortcut{\" I} {\Idiaeresis} \exportsortshortcut{\" i} {\idiaeresis} \exportsortshortcut{\"\i} {\idiaeresis} -\exportsortshortcut{\" O} {\Odiaeresis} \exportsortshortcut{\" o} {\odiaeresis} -\exportsortshortcut{\" U} {\Udiaeresis} \exportsortshortcut{\" u} {\udiaeresis} -\exportsortshortcut{\" Y} {\Ydiaeresis} \exportsortshortcut{\" y} {\ydiaeresis} - -\exportsortshortcut{\' A} {\Aacute} \exportsortshortcut{\' a} {\aacute} -\exportsortshortcut{\' C} {\Cacute} \exportsortshortcut{\' c} {\cacute} -\exportsortshortcut{\' E} {\Eacute} \exportsortshortcut{\' e} {\eacute} -\exportsortshortcut{\' I} {\Iacute} \exportsortshortcut{\' i} {\iacute} \exportsortshortcut{\'\i} {\iacute} -\exportsortshortcut{\' L} {\Lacute} \exportsortshortcut{\' l} {\lacute} -\exportsortshortcut{\' N} {\Nacute} \exportsortshortcut{\' n} {\nacute} -\exportsortshortcut{\' O} {\Oacute} \exportsortshortcut{\' o} {\oacute} -\exportsortshortcut{\' R} {\Racute} \exportsortshortcut{\' r} {\racute} -\exportsortshortcut{\' S} {\Sacute} \exportsortshortcut{\' s} {\sacute} -\exportsortshortcut{\' U} {\Uacute} \exportsortshortcut{\' u} {\uacute} -\exportsortshortcut{\' Y} {\Yacute} \exportsortshortcut{\' y} {\yacute} -\exportsortshortcut{\' Z} {\Zacute} \exportsortshortcut{\' z} {\zacute} - -\exportsortshortcut{\. C} {\Cdotaccent} \exportsortshortcut{\. c} {\cdotaccent} -\exportsortshortcut{\. E} {\Edotaccent} \exportsortshortcut{\. e} {\edotaccent} -\exportsortshortcut{\. G} {\Gdotaccent} \exportsortshortcut{\. g} {\gdotaccent} -\exportsortshortcut{\. I} {\Idotaccent} \exportsortshortcut{\. i} {\idotaccent} \exportsortshortcut{\.\i} {\idotaccent} -\exportsortshortcut{\. Z} {\Zdotaccent} \exportsortshortcut{\. z} {\zdotaccent} - -\exportsortshortcut{\= A} {\Amacron} \exportsortshortcut{\= a} {\amacron} -\exportsortshortcut{\= E} {\Emacron} \exportsortshortcut{\= e} {\emacron} -\exportsortshortcut{\= I} {\Imacron} \exportsortshortcut{\= i} {\imacron} \exportsortshortcut{\=\i} {\imacron} -\exportsortshortcut{\= O} {\Omacron} \exportsortshortcut{\= o} {\omacron} -\exportsortshortcut{\= U} {\Umacron} \exportsortshortcut{\= u} {\umacron} - -\exportsortshortcut{\c C} {\Ccedilla} \exportsortshortcut{\c c} {\ccedilla} -\exportsortshortcut{\c K} {\Kcedilla} \exportsortshortcut{\c k} {\kcedilla} -\exportsortshortcut{\c L} {\Lcedilla} \exportsortshortcut{\c l} {\lcedilla} -\exportsortshortcut{\c N} {\Ncedilla} \exportsortshortcut{\c n} {\ncedilla} -\exportsortshortcut{\c R} {\Rcedilla} \exportsortshortcut{\c r} {\rcedilla} -\exportsortshortcut{\c S} {\Scedilla} \exportsortshortcut{\c s} {\scedilla} -\exportsortshortcut{\c T} {\Tcedilla} \exportsortshortcut{\c t} {\tcedilla} - -\exportsortshortcut{\H O} {\Ohungarumlaut} \exportsortshortcut{\H o} {\ohungarumlaut} -\exportsortshortcut{\H u} {\uhungarumlaut} \exportsortshortcut{\H U} {\Uhungarumlaut} - -\exportsortshortcut{\k A} {\Aogonek} \exportsortshortcut{\k a} {\aogonek} -\exportsortshortcut{\k E} {\Eogonek} \exportsortshortcut{\k e} {\eogonek} -\exportsortshortcut{\k I} {\Iogonek} \exportsortshortcut{\k i} {\iogonek} -\exportsortshortcut{\k U} {\Uogonek} \exportsortshortcut{\k u} {\uogonek} - -\exportsortshortcut{\r A} {\Aring} \exportsortshortcut{\r a} {\aring} -\exportsortshortcut{\r U} {\Uring} \exportsortshortcut{\r u} {\uring} - -\exportsortshortcut{\u A} {\Abreve} \exportsortshortcut{\u a} {\abreve} -\exportsortshortcut{\u E} {\Ebreve} \exportsortshortcut{\u e} {\ebreve} -\exportsortshortcut{\u G} {\Gbreve} \exportsortshortcut{\u g} {\gbreve} -\exportsortshortcut{\u I} {\Ibreve} \exportsortshortcut{\u i} {\ibreve} \exportsortshortcut{\u\i} {\ibreve} -\exportsortshortcut{\u O} {\Obreve} \exportsortshortcut{\u o} {\obreve} -\exportsortshortcut{\u U} {\Ubreve} \exportsortshortcut{\u u} {\ubreve} - -\exportsortshortcut{\v C} {\Ccaron} \exportsortshortcut{\v c} {\ccaron} -\exportsortshortcut{\v D} {\Dcaron} \exportsortshortcut{\v d} {\dcaron} -\exportsortshortcut{\v E} {\Ecaron} \exportsortshortcut{\v e} {\ecaron} -\exportsortshortcut{\v L} {\Lcaron} \exportsortshortcut{\v l} {\lcaron} -\exportsortshortcut{\v N} {\Ncaron} \exportsortshortcut{\v n} {\ncaron} -\exportsortshortcut{\v R} {\Rcaron} \exportsortshortcut{\v r} {\rcaron} -\exportsortshortcut{\v S} {\Scaron} \exportsortshortcut{\v s} {\scaron} -\exportsortshortcut{\v T} {\Tcaron} \exportsortshortcut{\v t} {\tcaron} -\exportsortshortcut{\v Z} {\Zcaron} \exportsortshortcut{\v z} {\zcaron} - -\endinput diff --git a/tex/context/base/sort-ini.lua b/tex/context/base/sort-ini.lua index b75950860..3930e85fe 100644 --- a/tex/context/base/sort-ini.lua +++ b/tex/context/base/sort-ini.lua @@ -14,8 +14,8 @@ if not modules then modules = { } end modules ['sort-ini'] = { -- always expand to utf local utf = unicode.utf8 -local gsub = string.gsub -local utfcharacters, utfvalues = string.utfcharacters, string.utfvalues +local gsub, rep = string.gsub, string.rep +local utfcharacters, utfvalues, strcharacters = string.utfcharacters, string.utfvalues, string.characters sorters = { } sorters.comparers = { } @@ -26,16 +26,26 @@ sorters.replacements = { } sorters.language = 'en' function sorters.comparers.basic(sort_a,sort_b) + local sm = sorters.mappings[sorters.language or sorters.defaultlanguage] -- slow, will become sorters.initialize if #sort_a > #sort_b then if #sort_b == 0 then return 1 else for i=1,#sort_b do local ai, bi = sort_a[i], sort_b[i] - if ai > bi then - return 1 - elseif ai < bi then - return -1 + local am, bm = sm[ai], sm[bi] + if am and bm then + if am > bm then + return 1 + elseif am < bm then + return -1 + end + else + if ai > bi then + return 1 + elseif ai < bi then + return -1 + end end end return 1 @@ -46,10 +56,19 @@ function sorters.comparers.basic(sort_a,sort_b) else for i=1,#sort_a do local ai, bi = sort_a[i], sort_b[i] - if ai > bi then - return 1 - elseif ai < bi then - return -1 + local am, bm = sm[ai], sm[bi] + if am and bm then + if am > bm then + return 1 + elseif am < bm then + return -1 + end + else + if ai > bi then + return 1 + elseif ai < bi then + return -1 + end end end return -1 @@ -59,42 +78,65 @@ function sorters.comparers.basic(sort_a,sort_b) else for i=1,#sort_a do local ai, bi = sort_a[i], sort_b[i] - if ai > bi then - return 1 - elseif ai < bi then - return -1 + local am, bm = sm[ai], sm[bi] + if am and bm then + if am > bm then + return 1 + elseif am < bm then + return -1 + end + else + if ai > bi then + return 1 + elseif ai < bi then + return -1 + end end end return 0 end end +local function padd(s) return rep(" ",10-#s) .. s end -- or format with padd + function sorters.strip(str) -- todo: only letters and such utf.gsub("([^%w%d])","") - str = gsub(str,"\\%S*","") - str = gsub(str,"[%s%[%](){}%$\"\']*","") - str = gsub(str,"(%d+)",function(s) return (" "):rep(10-#s) .. s end) -- sort numbers properly - return str + if str then + str = gsub(str,"\\%S*","") + str = gsub(str,"[%s%[%](){}%$\"\']*","") + str = gsub(str,"(%d+)",padd) -- sort numbers properly + return str + else + return "" + end +end + +function sorters.firstofsplit(split) + -- numbers are left padded by spaces + local se = sorters.entries[sorters.language or sorters.defaultlanguage] -- slow, will become sorters.initialize + local vs = split[1] + local entry = (vs and vs[1]) or "" + return entry, (se and se[entry]) or "\000" end sorters.defaultlanguage = 'en' +-- beware, numbers get spaces in front + function sorters.splitters.utf(str) -- brrr, todo: language local r = sorters.replacements[sorters.language] or sorters.replacements[sorters.defaultlanguage] or { } - local m = sorters.mappings [sorters.language] or sorters.mappings [sorters.defaultlanguage] or { } +--~ local m = sorters.mappings [sorters.language] or sorters.mappings [sorters.defaultlanguage] or { } local u = characters.uncompose local b = utf.byte local t = { } for _,v in next, r do str = gsub(str,v[1],v[2]) end - for c in utfcharacters(str) do - if m[c] then - t[#t+1] = m[c] - elseif #c == 1 then - t[#t+1] = b(c) + for c in utfcharacters(str) do -- maybe an lpeg + if #c == 1 then + t[#t+1] = c else - for cc in string.characters(u(c)) do -- utf ? - t[#t+1] = m[cc] or b(cc) + for cc in strcharacters(c) do + t[#t+1] = cc end end end @@ -104,27 +146,3 @@ end function sorters.sort(entries,cmp) table.sort(entries,function(a,b) return cmp(a,b) == -1 end) end - --- temp workaround (is gone) - -function sorters.process() - -- gone -end - --- was: - ---~ function sorters.process(kind,data) ---~ if data.entries then ---~ if not data.sorted then ---~ sorters.language = data.language or sorters.language ---~ sorters[kind].prepare(data.entries) ---~ sorters[kind].sort(data.entries) ---~ sorters[kind].unique(data.entries) ---~ data.sorted = true ---~ end ---~ return sorters[kind].flush(sorters[kind].finalize(data.entries),data.class,data.flush) ---~ else ---~ return { } ---~ end ---~ end - diff --git a/tex/context/base/sort-ini.mkii b/tex/context/base/sort-ini.mkii index f26f4febe..f1ed1c316 100644 --- a/tex/context/base/sort-ini.mkii +++ b/tex/context/base/sort-ini.mkii @@ -128,10 +128,8 @@ {\dowalkregime\characterencoding}}% \egroup \startnointerference -% \startreadingfile -\setcatcodetable\ctxcatcodes - \readsysfile{\f!sortprefix def}\donothing\donothing % default -% \stopreadingfile + \setcatcodetable\ctxcatcodes + \readsysfile{\f!sortprefix def.mkii}\donothing\donothing % default \stopnointerference \global\let\savesortdefinitions\relax} @@ -142,10 +140,8 @@ \global\letvalue{\f!sortprefix::#1}\empty \def\currentexportclass{#1}% \enablemode[sortorder-#1]% -% \startreadingfile -\setcatcodetable\ctxcatcodes - \readsysfile{\f!sortprefix lan}\donothing\donothing -% \stopreadingfile + \setcatcodetable\ctxcatcodes + \readsysfile{\f!sortprefix lan.mkii}\donothing\donothing \stopnointerference}}} \prependtoks diff --git a/tex/context/base/sort-lan.lua b/tex/context/base/sort-lan.lua index 394cbabe1..5d4ded78e 100644 --- a/tex/context/base/sort-lan.lua +++ b/tex/context/base/sort-lan.lua @@ -17,19 +17,20 @@ local utf = unicode.utf8 -- other languages are sparse so for the moment we keep this one. sorters.entries['en'] = { - [ 1] = "a", [ 3] = "b", [ 5] = "c", [ 7] = "d", [ 9] = "e", - [11] = "f", [13] = "g", [15] = "h", [17] = "i", [19] = "j", - [21] = "k", [23] = "l", [25] = "m", [27] = "n", [29] = "o", - [31] = "p", [33] = "q", [35] = "r", [37] = "s", [39] = "t", - [41] = "u", [43] = "v", [45] = "w", [47] = "x", [49] = "y", - [51] = "z", - [ 2] = 1, [ 4] = 3, [ 6] = 5, [ 8] = 7, [10] = 9, - [12] = 11, [14] = 13, [16] = 15, [18] = 17, [20] = 19, - [22] = 21, [24] = 23, [26] = 25, [28] = 27, [30] = 29, - [32] = 31, [34] = 33, [36] = 35, [38] = 37, [40] = 39, - [42] = 41, [44] = 43, [46] = 45, [48] = 47, [50] = 49, - [52] = 51, + ["a"] = "a", ["b"] = "b", ["c"] = "c", ["d"] = "d", ["e"] = "e", + ["f"] = "f", ["g"] = "g", ["h"] = "h", ["i"] = "i", ["j"] = "j", + ["k"] = "k", ["l"] = "l", ["m"] = "m", ["n"] = "n", ["o"] = "o", + ["p"] = "p", ["q"] = "q", ["r"] = "r", ["s"] = "s", ["t"] = "t", + ["u"] = "u", ["v"] = "v", ["w"] = "w", ["x"] = "x", ["y"] = "y", + ["z"] = "z", + ["A"] = "a", ["B"] = "b", ["C"] = "c", ["D"] = "d", ["E"] = "e", + ["F"] = "f", ["G"] = "g", ["H"] = "h", ["I"] = "i", ["J"] = "j", + ["K"] = "k", ["L"] = "l", ["M"] = "m", ["N"] = "n", ["O"] = "o", + ["P"] = "p", ["Q"] = "q", ["R"] = "r", ["S"] = "s", ["T"] = "t", + ["U"] = "u", ["V"] = "v", ["W"] = "w", ["X"] = "x", ["Y"] = "y", + ["Z"] = "z", } + sorters.mappings['en'] = { ["a"] = 1, ["b"] = 3, ["c"] = 5, ["d"] = 7, ["e"] = 9, ["f"] = 11, ["g"] = 13, ["h"] = 15, ["i"] = 17, ["j"] = 19, @@ -61,46 +62,46 @@ sorters.replacements['cz'] = { } sorters.entries['cz'] = { - [ 1] = "a", - [ 2] = 1, - [ 3] = "b", - [ 4] = "c", - [ 5] = uc(0x010D), -- ccaron - [ 6] = "d", - [ 7] = uc(0x010F), -- dcaron - [ 8] = "e", - [ 9] = 8, - [10] = 8, - [11] = "f", - [12] = "g", - [13] = "h", - [14] = "ch", - [15] = "i", - [16] = 15, - [17] = "j", - [18] = "k", - [19] = "l", - [20] = "m", - [21] = "n", - [22] = uc(0x0147), -- ncaron - [23] = "o", - [24] = "p", - [25] = "q", - [26] = "r", - [27] = uc(0x0147), -- rcaron - [28] = "s", - [29] = uc(0x0161), -- scaron - [30] = "t", - [31] = uc(0x0165), -- tcaron - [32] = "u", - [33] = 32, - [34] = 32, - [35] = "v", - [36] = "w", - [37] = "x", - [38] = "y", - [49] = "z", - [40] = uc(0x017E), -- zcaron + ['a'] = "a", + [uc(0x00E1)] = "a", + ['b'] = "b", + ['c'] = "c", + [uc(0x010D)] = uc(0x010D), -- ccaron + ['d'] = "d", + [uc(0x010F)] = uc(0x010F), -- dcaron + ['e'] = "e", + [uc(0x00E9)] = "e", + [uc(0x011B)] = "e", + ['f'] = "f", + ['g'] = "g", + ['h'] = "h", + [uc(0xFF01)] = "ch", + ['i'] = "i", + [uc(0x00ED)] = "i", + ['j'] = "j", + ['k'] = "k", + ['l'] = "l", + ['m'] = "m", + ['n'] = "n", + [uc(0x0147)] = uc(0x0147), -- ncaron + ['o'] = "o", + ['p'] = "p", + ['q'] = "q", + ['s'] = "r", + [uc(0x0147)] = uc(0x0147), -- rcaron + ['s'] = "s", + [uc(0x0161)] = uc(0x0161), -- scaron + ['t'] = "t", + [uc(0x0165)] = uc(0x0165), -- tcaron + ['u'] = "u", + [uc(0x00FA)] = "u", + [uc(0x01F6)] = "u", + ['v'] = "v", + ['w'] = "w", + ['x'] = "x", + ['y'] = "y", + ['z'] = "z", + [uc(0x017E)] = uc(0x017E), -- zcaron } sorters.mappings['cz'] = { @@ -196,19 +197,20 @@ sorters.mappings ['de-CH'] = sorters.mappings['de'] -- german - Austria sorters.entries['de-AT'] = { - [ 1] = "a", [ 3] = 1, [ 5] = "b", [ 7] = "c", [ 9] = "d", - [11] = "e", [13] = "f", [15] = "g", [17] = "h", [19] = "i", - [21] = "j", [23] = "k", [25] = "l", [27] = "m", [29] = "n", - [31] = "o", [33] = 31, [35] = "p", [37] = "q", [39] = "r", - [41] = "s", [43] = "t", [45] = "u", [47] = 45, [49] = "v", - [51] = "w", [53] = "y", [55] = "y", [57] = "z", - [ 2] = 1, [ 4] = 3, [ 6] = 5, [ 8] = 7, [10] = 9, - [12] = 11, [14] = 13, [16] = 15, [18] = 17, [20] = 19, - [22] = 21, [24] = 23, [26] = 25, [28] = 27, [30] = 29, - [32] = 31, [34] = 33, [36] = 35, [38] = 37, [40] = 39, - [42] = 41, [44] = 43, [46] = 45, [48] = 47, [50] = 49, - [52] = 51, [54] = 53, [56] = 55, [58] = 57, + ["a"] = "a", ["ä"] = "ä", ["b"] = "b", ["c"] = "c", ["d"] = "d", + ["e"] = "e", ["f"] = "f", ["g"] = "g", ["h"] = "h", ["i"] = "i", + ["j"] = "j", ["k"] = "k", ["l"] = "l", ["m"] = "m", ["n"] = "n", + ["o"] = "o", ["ö"] = "ö", ["p"] = "p", ["q"] = "q", ["r"] = "r", + ["s"] = "s", ["t"] = "t", ["u"] = "u", ["ü"] = "ü", ["v"] = "v", + ["w"] = "w", ["x"] = "x", ["y"] = "y", ["z"] = "z", + ["A"] = "a", ["Ä"] = "ä", ["B"] = "b", ["C"] = "c", ["D"] = "d", + ["E"] = "e", ["F"] = "f", ["G"] = "g", ["H"] = "h", ["I"] = "i", + ["J"] = "j", ["K"] = "k", ["L"] = "l", ["M"] = "m", ["N"] = "n", + ["O"] = "o", ["Ö"] = "ö", ["P"] = "p", ["Q"] = "q", ["R"] = "r", + ["S"] = "s", ["T"] = "t", ["U"] = "u", ["Ü"] = "ü", ["V"] = "v", + ["W"] = "w", ["X"] = "x", ["Y"] = "y", ["Z"] = "z", } + sorters.mappings['de-AT'] = { ["a"] = 1, ["ä"] = 3, ["b"] = 5, ["c"] = 7, ["d"] = 9, ["e"] = 11, ["f"] = 13, ["g"] = 15, ["h"] = 17, ["i"] = 19, @@ -240,19 +242,20 @@ sorters.entries['fi'] = { [42] = 41, [44] = 43, [46] = 45, [48] = 47, [50] = 49, [52] = 51, [54] = 53, [56] = 55, [58] = 57, } -sorters.mappings['fi'] = { - ["a"] = 1, ["b"] = 3, ["c"] = 5, ["d"] = 7, ["e"] = 9, - ["f"] = 11, ["g"] = 13, ["h"] = 15, ["i"] = 17, ["j"] = 19, - ["k"] = 21, ["l"] = 23, ["m"] = 25, ["n"] = 27, ["o"] = 29, - ["p"] = 31, ["q"] = 33, ["r"] = 35, ["s"] = 37, ["t"] = 39, - ["u"] = 41, ["v"] = 43, ["w"] = 45, ["x"] = 47, ["y"] = 49, - ["z"] = 51, ["å"] = 53, ["ä"] = 55, ["ö"] = 57, - ["A"] = 2, ["B"] = 4, ["C"] = 6, ["D"] = 8, ["E"] = 10, - ["F"] = 12, ["G"] = 14, ["H"] = 16, ["I"] = 18, ["J"] = 20, - ["K"] = 22, ["L"] = 24, ["M"] = 26, ["N"] = 28, ["O"] = 30, - ["P"] = 32, ["Q"] = 34, ["R"] = 36, ["S"] = 38, ["T"] = 40, - ["U"] = 42, ["V"] = 44, ["W"] = 46, ["X"] = 48, ["Y"] = 50, - ["Z"] = 52, ["Å"] = 54, ["Ä"] = 56, ["Ö"] = 58, + +sorters.entries['fi'] = { + ["a"] = "a", ["b"] = "b", ["c"] = "c", ["d"] = "d", ["e"] = "e", + ["f"] = "f", ["g"] = "g", ["h"] = "h", ["i"] = "i", ["j"] = "j", + ["k"] = "k", ["l"] = "l", ["m"] = "m", ["n"] = "n", ["o"] = "o", + ["p"] = "p", ["q"] = "q", ["r"] = "r", ["s"] = "s", ["t"] = "t", + ["u"] = "u", ["v"] = "v", ["w"] = "w", ["x"] = "x", ["y"] = "y", + ["z"] = "z", ["å"] = "å", ["ä"] = "ä", ["ö"] = "ö", + ["A"] = "a", ["B"] = "b", ["C"] = "c", ["D"] = "d", ["E"] = "e", + ["F"] = "f", ["G"] = "g", ["H"] = "h", ["I"] = "i", ["J"] = "j", + ["K"] = "k", ["L"] = "l", ["M"] = "m", ["N"] = "n", ["O"] = "o", + ["P"] = "p", ["Q"] = "q", ["R"] = "r", ["S"] = "s", ["T"] = "t", + ["U"] = "u", ["V"] = "v", ["W"] = "w", ["X"] = "x", ["Y"] = "y", + ["Z"] = "z", ["Å"] = "å", ["Ä"] = "ä", ["Ö"] = "ö", } --~ sorters.test = '' diff --git a/tex/context/base/sort-lan.mkii b/tex/context/base/sort-lan.mkii new file mode 100644 index 000000000..ad5232b02 --- /dev/null +++ b/tex/context/base/sort-lan.mkii @@ -0,0 +1,203 @@ +%D \module +%D [ file=sort-lan, +%D version=2005.08.08, +%D title=\CONTEXT\ Sort Macros, +%D subtitle=Language Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 testing: + +\startmode[sortorder-en] + \exportsortexpansion{aacute}{a+1} + \exportsortexpansion{Aacute}{A+2} + \exportsortexpansion{agrave}{a+1} + \exportsortexpansion{Agrave}{A+2} +\stopmode + +%D This module replaces existing sort key handling and is meant to be +%D used with the new texutil functionality. Here we define the language +%D specific sort rules. + +% slovenian +% +% a-c, ccaron, cacute, d, dstroke, e-s, scaron, t-z, zcaron + +% \enableregime[utf] +% \mainlanguage[sl] +% \starttext +% \ccaron\index{\ccaron\space 1} +% \Ccaron\index{\Ccaron\space 1} +% č\index{č 2} +% Č\index{Č 2} +% \v c\index{\v c 3} +% \v C\index{\v C 3} +% \placeindex +% \stoptext + +% \startmode[sortorder-sl] +% \exportsortexpansion {ccaron} {cz} +% \exportsortexpansion {cacute} {czz} +% \exportsortexpansion {dstroke} {dz} +% \exportsortexpansion {scaron} {sz} +% \exportsortexpansion {zacron} {zz} + +% \exportsortdivision {cz} {ccaron} +% \exportsortdivision {czz} {cacute} +% \exportsortdivision {dz} {dstroke} +% \exportsortdivision {sz} {scaron} +% \exportsortdivision {zz} {zacron} +% \stopmode +% +% \startmode[sortorder-sl] +% \exportsortexpansion {ccaron} {c+1} +% \exportsortexpansion {cacute} {c+2} +% \exportsortexpansion {dstroke} {d+1} +% \exportsortexpansion {scaron} {s+1} +% \exportsortexpansion {zacron} {z+1} +% +% \exportsortdivision {c+1} {ccaron} +% \exportsortdivision {c+2} {cacute} +% \exportsortdivision {d+1} {dstroke} +% \exportsortdivision {s+1} {scaron} +% \exportsortdivision {z+1} {zacron} +% \stopmode + +\startmode[sortorder-sl] + \exportsortrule {ccaron} {c+1} + \exportsortrule {cacute} {c+2} + \exportsortrule {dstroke} {d+1} + \exportsortrule {scaron} {s+1} + \exportsortrule {zacron} {z+1} +\stopmode + +% finnish +% +% a-u, v+w sorted together, x-z, aring, adiaeresis, odiaeresis + +\startmode[sortorder-fi] + \exportsortrule {v} {w} + \exportsortrule {aring} {z+1} + \exportsortrule {adiaeresis} {z+2} + \exportsortrule {odiaeresis} {z+3} +\stopmode + +% swedish +% +% a-z, aring, adiaeresis, odiaeresis + +% \mainlanguage[sv] +% \starttext +% a\index{a} +% a\index{a} +% z\index{z} +% z\index{z} +% q\index{q} +% q\index{q} +% \index{} +% \index{} +% \index{} +% \index{} +% \index{} +% \index{} +% \index{} +% \index{} +% \index{} +% \aring\index{\aring} +% \adiaeresis\index{\adiaeresis} +% \odiaeresis\index{\odiaeresis} +% A\index{A} +% \index{} +% \index{} +% \index{} +% \Aring\index{\Aring} +% \Adiaeresis\index{\Adiaeresis} +% \Odiaeresis\index{\Odiaeresis} +% \placeindex +% \stoptext + +\startmode[sortorder-sv] + \exportsortrule {aring} {z+1} + \exportsortrule {adiaeresis} {z+2} + \exportsortrule {odiaeresis} {z+3} +\stopmode + +% norwegian, danish +% +% a-z, aeligature, oslash, aring + +\startmode[sortorder-no,sortorder-da] + \exportsortrule {aeligature} {z+1} + \exportsortrule {oslash} {z+2} + \exportsortrule {aring} {z+3} +\stopmode + +% islandic +% +% a, aacute, b, c, d, eth, e, eacute, f-i, iacute, j-o, oacute, p-u, uacute, v, w (?), x, y, yacute, z, aeligature, oslash, thorn + +% estonian +% +% a-s, scaron, z, zcaron, t-w, otilde, adiaeresis, odiaeresis, udiaeresis, x, y + +% czech +% +% a) make a single group for: "a", "", "A", "" +% b) make a different two groups for: "c", "C" and "c", "C" +% c) sorting rule: "A" < "" < "a" < "" < "C" < "c" < "C" < "c" +% d) sorting rule: "h" < "ch" < "i" ("c" < "h") + +\gdef\czsortdivisionch{ch} +\gdef\czsortdivisionCh{Ch} + +\startmode[sortorder-cz] + \exportsortexpansion {aacute} {a+1} + \exportsortexpansion {Aacute} {A+1} + \exportsortexpansion {ccaron} {c+1} + \exportsortexpansion {Ccaron} {C+1} + \exportsortdivision {c+1} {ccaron} + \exportsortexpansion {dcaron} {d+1} + \exportsortexpansion {Dcaron} {D+1} + \exportsortdivision {d+1} {dcaron} + \exportsortexpansion {eacute} {e+1} + \exportsortexpansion {Eacute} {E+1} + \exportsortexpansion {ecaron} {e+2} + \exportsortexpansion {Ecaron} {E+2} + \exportsortreduction {ch} {h+1} + \exportsortexpansion {ch} {h+1} + \exportsortreduction {Ch} {H+1} + \exportsortexpansion {Ch} {H+1} + \exportsortdivision {h+1} {czsortdivisionch} + \exportsortexpansion {iacute} {i+1} + \exportsortexpansion {Iacute} {I+1} + \exportsortexpansion {ncaron} {n+1} + \exportsortexpansion {Ncaron} {N+1} + \exportsortdivision {n+1} {ncaron} + \exportsortexpansion {oacute} {o+1} + \exportsortexpansion {Oacute} {O+1} + \exportsortexpansion {rcaron} {r+1} + \exportsortexpansion {Rcaron} {R+1} + \exportsortdivision {r+1} {rcaron} + \exportsortexpansion {scaron} {s+1} + \exportsortexpansion {Scaron} {S+1} + \exportsortdivision {s+1} {scaron} + \exportsortexpansion {tcaron} {t+1} + \exportsortexpansion {Tcaron} {T+1} + \exportsortdivision {t+1} {tcaron} + \exportsortexpansion {uacute} {u+1} + \exportsortexpansion {Uacute} {U+1} + \exportsortexpansion {uring} {u+2} + \exportsortexpansion {Uring} {U+2} + \exportsortexpansion {yacute} {y+1} + \exportsortexpansion {Yacute} {Y+1} + \exportsortexpansion {zcaron} {z+1} + \exportsortexpansion {Zcaron} {Z+1} + \exportsortdivision {z+1} {zcaron} +\stopmode + +\endinput diff --git a/tex/context/base/sort-lan.tex b/tex/context/base/sort-lan.tex deleted file mode 100644 index ad5232b02..000000000 --- a/tex/context/base/sort-lan.tex +++ /dev/null @@ -1,203 +0,0 @@ -%D \module -%D [ file=sort-lan, -%D version=2005.08.08, -%D title=\CONTEXT\ Sort Macros, -%D subtitle=Language Definitions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 testing: - -\startmode[sortorder-en] - \exportsortexpansion{aacute}{a+1} - \exportsortexpansion{Aacute}{A+2} - \exportsortexpansion{agrave}{a+1} - \exportsortexpansion{Agrave}{A+2} -\stopmode - -%D This module replaces existing sort key handling and is meant to be -%D used with the new texutil functionality. Here we define the language -%D specific sort rules. - -% slovenian -% -% a-c, ccaron, cacute, d, dstroke, e-s, scaron, t-z, zcaron - -% \enableregime[utf] -% \mainlanguage[sl] -% \starttext -% \ccaron\index{\ccaron\space 1} -% \Ccaron\index{\Ccaron\space 1} -% č\index{č 2} -% Č\index{Č 2} -% \v c\index{\v c 3} -% \v C\index{\v C 3} -% \placeindex -% \stoptext - -% \startmode[sortorder-sl] -% \exportsortexpansion {ccaron} {cz} -% \exportsortexpansion {cacute} {czz} -% \exportsortexpansion {dstroke} {dz} -% \exportsortexpansion {scaron} {sz} -% \exportsortexpansion {zacron} {zz} - -% \exportsortdivision {cz} {ccaron} -% \exportsortdivision {czz} {cacute} -% \exportsortdivision {dz} {dstroke} -% \exportsortdivision {sz} {scaron} -% \exportsortdivision {zz} {zacron} -% \stopmode -% -% \startmode[sortorder-sl] -% \exportsortexpansion {ccaron} {c+1} -% \exportsortexpansion {cacute} {c+2} -% \exportsortexpansion {dstroke} {d+1} -% \exportsortexpansion {scaron} {s+1} -% \exportsortexpansion {zacron} {z+1} -% -% \exportsortdivision {c+1} {ccaron} -% \exportsortdivision {c+2} {cacute} -% \exportsortdivision {d+1} {dstroke} -% \exportsortdivision {s+1} {scaron} -% \exportsortdivision {z+1} {zacron} -% \stopmode - -\startmode[sortorder-sl] - \exportsortrule {ccaron} {c+1} - \exportsortrule {cacute} {c+2} - \exportsortrule {dstroke} {d+1} - \exportsortrule {scaron} {s+1} - \exportsortrule {zacron} {z+1} -\stopmode - -% finnish -% -% a-u, v+w sorted together, x-z, aring, adiaeresis, odiaeresis - -\startmode[sortorder-fi] - \exportsortrule {v} {w} - \exportsortrule {aring} {z+1} - \exportsortrule {adiaeresis} {z+2} - \exportsortrule {odiaeresis} {z+3} -\stopmode - -% swedish -% -% a-z, aring, adiaeresis, odiaeresis - -% \mainlanguage[sv] -% \starttext -% a\index{a} -% a\index{a} -% z\index{z} -% z\index{z} -% q\index{q} -% q\index{q} -% \index{} -% \index{} -% \index{} -% \index{} -% \index{} -% \index{} -% \index{} -% \index{} -% \index{} -% \aring\index{\aring} -% \adiaeresis\index{\adiaeresis} -% \odiaeresis\index{\odiaeresis} -% A\index{A} -% \index{} -% \index{} -% \index{} -% \Aring\index{\Aring} -% \Adiaeresis\index{\Adiaeresis} -% \Odiaeresis\index{\Odiaeresis} -% \placeindex -% \stoptext - -\startmode[sortorder-sv] - \exportsortrule {aring} {z+1} - \exportsortrule {adiaeresis} {z+2} - \exportsortrule {odiaeresis} {z+3} -\stopmode - -% norwegian, danish -% -% a-z, aeligature, oslash, aring - -\startmode[sortorder-no,sortorder-da] - \exportsortrule {aeligature} {z+1} - \exportsortrule {oslash} {z+2} - \exportsortrule {aring} {z+3} -\stopmode - -% islandic -% -% a, aacute, b, c, d, eth, e, eacute, f-i, iacute, j-o, oacute, p-u, uacute, v, w (?), x, y, yacute, z, aeligature, oslash, thorn - -% estonian -% -% a-s, scaron, z, zcaron, t-w, otilde, adiaeresis, odiaeresis, udiaeresis, x, y - -% czech -% -% a) make a single group for: "a", "", "A", "" -% b) make a different two groups for: "c", "C" and "c", "C" -% c) sorting rule: "A" < "" < "a" < "" < "C" < "c" < "C" < "c" -% d) sorting rule: "h" < "ch" < "i" ("c" < "h") - -\gdef\czsortdivisionch{ch} -\gdef\czsortdivisionCh{Ch} - -\startmode[sortorder-cz] - \exportsortexpansion {aacute} {a+1} - \exportsortexpansion {Aacute} {A+1} - \exportsortexpansion {ccaron} {c+1} - \exportsortexpansion {Ccaron} {C+1} - \exportsortdivision {c+1} {ccaron} - \exportsortexpansion {dcaron} {d+1} - \exportsortexpansion {Dcaron} {D+1} - \exportsortdivision {d+1} {dcaron} - \exportsortexpansion {eacute} {e+1} - \exportsortexpansion {Eacute} {E+1} - \exportsortexpansion {ecaron} {e+2} - \exportsortexpansion {Ecaron} {E+2} - \exportsortreduction {ch} {h+1} - \exportsortexpansion {ch} {h+1} - \exportsortreduction {Ch} {H+1} - \exportsortexpansion {Ch} {H+1} - \exportsortdivision {h+1} {czsortdivisionch} - \exportsortexpansion {iacute} {i+1} - \exportsortexpansion {Iacute} {I+1} - \exportsortexpansion {ncaron} {n+1} - \exportsortexpansion {Ncaron} {N+1} - \exportsortdivision {n+1} {ncaron} - \exportsortexpansion {oacute} {o+1} - \exportsortexpansion {Oacute} {O+1} - \exportsortexpansion {rcaron} {r+1} - \exportsortexpansion {Rcaron} {R+1} - \exportsortdivision {r+1} {rcaron} - \exportsortexpansion {scaron} {s+1} - \exportsortexpansion {Scaron} {S+1} - \exportsortdivision {s+1} {scaron} - \exportsortexpansion {tcaron} {t+1} - \exportsortexpansion {Tcaron} {T+1} - \exportsortdivision {t+1} {tcaron} - \exportsortexpansion {uacute} {u+1} - \exportsortexpansion {Uacute} {U+1} - \exportsortexpansion {uring} {u+2} - \exportsortexpansion {Uring} {U+2} - \exportsortexpansion {yacute} {y+1} - \exportsortexpansion {Yacute} {Y+1} - \exportsortexpansion {zcaron} {z+1} - \exportsortexpansion {Zcaron} {Z+1} - \exportsortdivision {z+1} {zcaron} -\stopmode - -\endinput diff --git a/tex/context/base/spec-def.mkii b/tex/context/base/spec-def.mkii new file mode 100644 index 000000000..ad1a9bb1d --- /dev/null +++ b/tex/context/base/spec-def.mkii @@ -0,0 +1,1016 @@ +%D \module +%D [ file=spec-def, +%D version=1996.01.25, +%D title=\CONTEXT\ Special Macros, +%D subtitle=Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module used to be integrated in \type {spec-ini}, +%D but testing optimization is more convenient this way. + +\writestatus{loading}{ConTeXt Special Macros / Definitions} + +\unprotect + +%D Ok, messy, but we need this because we load drivers before +%D references. + +\newif\ifcollectreferenceactions + +%D The following libraries are defined. Two postscript +%D drivers are supported, as well as two mechanisms for +%D interactive texts. +%D +%D \startlinecorrection +%D \starttable[|l|l|l|l|l|] +%D \HL +%D \NC \bf file \NC +%D \bf name \NC +%D \bf calls \NC +%D \bf support \NC +%D \bf program / driver \NC\SR +%D \HL +%D \NC \tttf spec-tex \NC +%D \tttf tex \NC +%D \NC +%D Generic \TEX\ (\DVI) \NC +%D (default) \NC\FR +%D \NC \tttf spec-tpd \NC +%D \tttf \PDF \NC +%D \NC +%D Han The Thanh \NC +%D (pdftex) \NC\MR +%D \NC \tttf spec-ps \NC +%D \tttf postscript \NC +%D \NC +%D Adobe PostScript \NC +%D (default) \NC\MR +%D \NC \tttf spec-tr \NC +%D \tttf rokicki \NC +%D \tttf postscript \NC +%D Thomas Rokicki \NC +%D (dvips) \NC\MR +%D \NC \tttf spec-yy \NC +%D \tttf yandy \NC +%D \tttf postscript \NC +%D YandY \NC +%D (dvipsone, dviwindo) \NC\MR +%D \NC \tttf spec-pdf \NC +%D \tttf pdf \NC +%D \NC +%D Adobe PDF \NC +%D (Acrobat) \NC\MR +%D \NC \tttf spec-win \NC +%D \tttf dviwindo \NC +%D YandY \NC +%D (dviwindo) \NC\MR +%D \NC \tttf spec-htm \NC +%D \tttf html \NC +%D \NC +%D HTML V 2.0 \NC +%D (dvips) \NC\LR +%D \HL +%D \stoptable +%D \stoplinecorrection + +%D \macros +%D {dostartgraymode,dostopgraymode, +%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode} +%D +%D Switching to and from color can be done in two ways: +%D +%D \startitemize[packed,n] +%D \item insert driver specific commands +%D \item pass instructions to the output device +%D \stopitemize +%D +%D The first approach is more general and lays the +%D responsibility at the driver side. Probably due to the fact +%D that \TEX\ does not directly support color, we have been +%D confronted for the last few years with changing special +%D definitions. The need for support depends on how a macro +%D package handles colored text that crosses the page boundary. +%D Again, there are two approaches. +%D +%D \startitemize[packed,n] +%D \item let \TEX\ do the job +%D \item let the driver handle things +%D \stopitemize +%D +%D The first approach is as driver independant as possible and +%D can easily be accomplished by using \TEX's mark mechanism. +%D In \CONTEXT\ we follow this approach. More and more, drivers +%D are starting to support color, including stacking them. +%D +%D Colors as well as grayscales can be represented in scales +%D from~0 to~1. When drivers use values in the range 0..255, +%D this value has to be adapted in the translation process. +%D Technically it's possible to get a grayscale from combining +%D colors. In the \cap{RGB} color system, a color with Red, +%D Green and Blue components of 0.80 show the same gray as a +%D Gray Scale specified 0.80. The \cap{CMYK} color system +%D supports a Black component apart from Cyan, Magenta and +%D Yellow. +%D +%D Depending on the target format, color support differs from +%D gray support. PostScript for example offers different +%D operators for setting gray and color. This is because +%D printing something using three colors is someting else than +%D printing with just black. +%D +%D In \CONTEXT\ we have implemented a color subsystem that +%D supports the use of well defined colors that, when printed +%D in black and white, still can be distinguished. This +%D approach enables us to serve both printed and electronic +%D versions, using colored text and illustrations. More on the +%D fundamentals of this topic can be found in the \cap{MAPS} of +%D the Dutch User Group, 14 (95.1). +%D +%D To satisfy all those needs, we define four specials which +%D supply enough information for drivers to act upon. We +%D could have used more general commands with the keywords +%D 'rgb' and 'gray', but because these specials are used often, +%D we prefer the more direct and shorter alternative. +%D +%D We start with the installation of color and grayscale +%D specials. The values are in the range 0..1 (e.g. 0.25). +%D +%D \starttyping +%D \dostartgraymode {gray} ... \dostopgraymode +%D \dostartrgbcolormode {red} {green} {blue} ... \dostopcolormode +%D \dostartcmykcolormode {cyan} {magenta} {yellow} {black} ... \dostopcolormode +%D \dostartgraycolormode {gray} ... \dostopcolormode +%D \stoptyping +%D +%D Because we can expect conflicts between drivers, we +%D implement them as category \type{or}. In previous versions +%D of \DVIPSONE\ the use of their color||specials did not +%D interfere with the PostScript ones, but recent versions do. + +\installspecial [\dostartgraymode] [or] [1] +\installspecial [\dostopgraymode] [or] [0] + +\installspecial [\dostartrgbcolormode] [or] [3] +\installspecial [\dostartcmykcolormode] [or] [4] +\installspecial [\dostartgraycolormode] [or] [1] +\installspecial [\dostopcolormode] [or] [0] + +%D New and experimental: + +\installspecial [\dostartspotcolormode] [or] [2] + +\installspecial [\doregisterrgbspotcolor] [or] [7] +\installspecial [\doregistercmykspotcolor] [or] [8] +\installspecial [\doregistergrayspotcolor] [or] [5] + +\installspecial [\doregisterrgbindexcolor] [or] [7] +\installspecial [\doregistercmykindexcolor] [or] [8] +\installspecial [\doregistergrayindexcolor] [or] [5] + +\installspecial [\doregisterspotcolorname] [or] [2] + +\installspecial [\dostartnonecolormode] [or] [0] +\installspecial [\doregisternonecolor] [or] [0] + +%D For some drivers, the stop special is of no use and can +%D simply call the start one with zero arguments. + +%D \macros +%D {dogetfiguresize,doinsertfile,doinsertMPfile} +%D +%D Probably the most problematic special is the following +%D one. Because we want to be able to support different +%D schemes, we pass a lot of data to it. +%D +%D The support of inserting files (like illustrations) comes in +%D many flavors. Some drivers use scales, some take dimensions. +%D Some need offsets and others act on stored characteristics. +%D They need one thing in common: a filename. Although separate +%D specials for different formats sometimes are more clear, we +%D decided to combine them all in one: +%D +%D \starttyping +%D \doinsertfile {type,method} {file,label} +%D {xscale} {yscale} {x} {y} {w} {h} +%D {options} +%D \stoptyping +%D +%D The scale is given percents, the other values are base +%D points. +%D +%D Per 2006 we have simplified this model. The amount of drivers +%D is not growing and all support scaling. We pass variables via +%D Driver specific macros. +%D +%D \starttyping +%D \doinsertfile +%D \stoptyping +%D +%D The special is implemented as \type{or}. Because \DVIPSONE\ +%D understands them all, a chain of alternatives would generate +%D multiple occurrences of the same illustration. +%D +%D When option 1 is passed, the viewers is asked to present a +%D preview, like the first frame of a movie. + +\installspecial [\dogetfiguresize][or] [0] % now a special +\installspecial [\doinsertfile] [or] [0] % [9] +\installspecial [\doinsertMPfile] [or] [1] % speed up + +%D No start||stop construction is needed here, because there in +%D no further interference of \TEX. All dimensions are output +%D in points and scales as a number, where 100 equal 100\%. (We +%D used to pass scaled points). + +%D \macros +%D {doinsertsoundtrack} +%D +%D Sounds are (for the moment) just files with +%D associated options. +%D +%D \starttyping +%D \doinsertsoundtrack {file} {label} {options} +%D \stoptyping + +\installspecial [\doinsertsoundtrack] [or] [3] + +%D \macros +%D {dogetnofinsertpages} +%D +%D Some file formats support more than one page, like \PDF, +%D and for special applications, one may want to have access +%D to the total number of pages. +%D +%D \starttyping +%D \dogetnofinsertpages{filename} +%D \stoptyping +%D +%D The number is also available after the insert is placed, +%D since inclusion may take place immediate when an insert is +%D called upon. + +\def\nofinsertpages{1} % one of the few 'talk backs' + +\installspecial [\dogetnofinsertpages] [or] [1] + +%D \macros +%D {dostartrotation, +%D dostoprotation} +%D +%D We support rotation with the special: +%D +%D \starttyping +%D \dostartrotation {angle} ... \dostoprotation +%D \stoptyping +%D +%D For the moment these specials are installed as +%D category \type{or}. + +\installspecial [\dostartrotation] [or] [1] +\installspecial [\dostoprotation] [or] [0] + +%D \macros +%D {dostartscaling, +%D dostopscaling} +%D +%D Scaling is also supported: +%D +%D \starttyping +%D \dostartscaling {x} {y} ... \dostopscaling +%D \stoptyping +%D +%D Like the previous one, these specials are of category +%D \type{or}. + +\installspecial [\dostartscaling] [or] [2] +\installspecial [\dostopscaling] [or] [0] + +%D \macros +%D {dostartmirroring, +%D dostopmirroring} +%D +%D And indeed, mirroring is there too: +%D +%D \starttyping +%D \dostartmirroring {x} {y} ... \dostopmirroring +%D \stoptyping +%D +%D Again these specials are installed as category \type{or}. + +\installspecial [\dostartmirroring] [or] [0] +\installspecial [\dostopmirroring] [or] [0] + +%D \macros +%D {dostartnegative, +%D dostopnegative} +%D +%D When producing output for an image setter, negating the +%D page comes into view. Here are the tools: + +\installspecial [\dostartnegative] [or] [0] +\installspecial [\dostopnegative] [or] [0] + +%D \macros +%D {dostartoverprint, +%D dostopoverprint} +%D +%D Rudimentary overprint (knockout) control is implemented +%D using: + +\installspecial [\dostartoverprint] [or] [0] +\installspecial [\dostopoverprint] [or] [0] + +%D The following two specials are used in for instance \type +%D {\vadjust}'d margin material inside colored paragraphs. + +\installspecial [\dostartgraphicgroup] [or] [0] +\installspecial [\dostopgraphicgroup ] [or] [0] + +%D \macros +%D {doselectfirstpaperbin, +%D doselectsecondpaperbin} +%D +%D Here are some very printer||specific ones. No further +%D comment. + +\installspecial [\doselectfirstpaperbin] [or] [0] +\installspecial [\doselectsecondpaperbin] [or] [0] + +%D \macros +%D {doovalbox} +%D +%D When we look at the implementation, this is a complicated +%D one. There are seven arguments. +%D +%D \starttyping +%D \doovalbox {w} {h} {d} {linewidth} {radius} {stroke} {fill} {variant} +%D \stoptyping +%D +%D This command has to return a \type{\vbox} which can be used +%D to lay over another one (with text). The radius is in +%D degrees, the stroke and fill are~\type{1} (true) of~\type{0} +%D (false). + +\installspecial [\doovalbox] [or] [8] + +%D \macros +%D {dostartclipping,dostopclipping} +%D +%D Clipping is implemented in such a way that an arbitrary +%D can be fed. +%D +%D \starttyping +%D \dostartclipping {pathname}{width} {height} +%D \dostopclipping +%D \stoptyping +%D +%D + +\installspecial [\dostartclipping] [or] [3] +\installspecial [\dostopclipping] [or] [0] + +%D \macros +%D {dosetupidentity} +%D +%D We can declare some characteristics of the document with +%D +%D \starttyping +%D \dosetupidentity {title} {subject} {author} {creator} {date} {keys} +%D \stoptyping +%D +%D All data is in string format. + +\installspecial [\dosetupidentity] [and] [6] + +%D \macros +%D {dosetuppaper} +%D +%D This special can be used to tell the driver what page size +%D to use. The special takes three arguments. +%D +%D \starttyping +%D \dosetuppaper {type} {width} {height} +%D \stoptyping +%D +%D The type is one of the common identifiers, like A4, A5 or +%D B2. + +\installspecial [\dosetuppaper] [and] [3] + +%D \macros +%D {dosetupprinter} +%D +%D Some drivers enable the user to specify the paper type +%D used and/or page dimensions to be taken into account. +%D +%D \starttyping +%D \dosetupprinter {type} {hoffset} {voffset} {width} {height} +%D \stoptyping +%D +%D The first argument is one of \type{letter}, \type{legal}, +%D \type{A4}, \type{A5} etc. The dimensions are in +%D basepoints. + +\installspecial [\dosetupprinter] [and] [5] + +%D \macros +%D {dosetupopenaction, dosetupclosaction, +%D dosetupopenpageaction, dosetupclospageaction, +%D dosetupinteraction, +%D dosetupscreen, +%D dosetupviewmode} +%D +%D Here come some obscure interactive commands. Probably the +%D specs will change with the development of the macros that +%D use them. +%D +%D The first ones can be used to set up the interaction. +%D +%D \starttyping +%D \dosetupinteraction +%D \stoptyping +%D +%D Normally this command does nothing but giving a message +%D that some scheme is supported. +%D +%D \starttyping +%D \dosetupstartaction +%D \dosetupstopaction +%D \stoptyping +%D +%D These two setup the actions to be executed when the document +%D is opened and closed. +%D +%D The next commands sets up the page and screen. They are +%D kind of related. +%D +%D \starttyping +%D \dosetuppage {hoffset} {voffset} {width} {height} {options} +%D \dosetupscreen {hoffset} {voffset} {width} {height} {options} +%D \stoptyping +%D +%D The first four arguments are in points. Option~1 results in a +%D full screen launch. +%D +%D \starttyping +%D \dosetuppageview {keyword} +%D \stoptyping +%D +%D For the moment we only support \type{fit}. + +\installspecial [\dosetupinteraction] [and] [0] + +\installspecial [\dosetupopenaction] [and] [0] +\installspecial [\dosetupscreen] [and] [5] +\installspecial [\dosetuppageview] [and] [1] + +\installspecial [\dosetupcloseaction] [and] [0] +\installspecial [\dosetupopenpageaction] [and] [0] +\installspecial [\dosetupclosepageaction] [and] [0] +\installspecial [\dosetuprenderingopenpageaction] [and] [0] +\installspecial [\dosetuprenderingclosepageaction] [and] [0] + +% new, yet undocumented, replaces \dosetupscreen + +\installspecial [\dosetupcropbox] [and] [4] +\installspecial [\dosetuptrimbox] [and] [4] +\installspecial [\dosetupartbox] [and] [4] +\installspecial [\dosetupbleedbox] [and] [4] + +%D \macros +%D {dostarthide, +%D dostophide} +%D +%D Not every part of the screen is suitable for paper. Menus +%D for instance have no meaning on an non||interactive medium. +%D These elements are hidden by means of: +%D +%D \starttyping +%D \dostarthide +%D \dostophide +%D \stoptyping + +\installspecial [\dostarthide] [or] [0] +\installspecial [\dostophide] [or] [0] + +%D \macros +%D {dostartgotolocation, dostopgotolocation, +%D dostartgotorealpage, dostopgotorealpage} +%D +%D When we want to support hypertext buttons, again we have +%D to deal with two concepts. +%D +%D \startitemize[packed,n] +%D \item let \TEX\ highlight the text +%D \item let the driver show us where to click +%D \stopitemize +%D +%D The first approach is the most secure one. It gives us +%D complete control over the visual appearance of hyper +%D buttons. The second alternative lets the driver guess what +%D part of the text needs highlighting. As long as we deal with +%D not too complicated textual buttons, this is no problem. +%D It's even a bit more efficient when we take long mid +%D paragraph active regions into account. When we let \TEX\ +%D handle active sentences {\em for instance marked like this +%D one}, we have to take care of line- and pagebreaks ourselve. +%D However, it's no trivial matter to let a driver find out +%D where things begin and end. Because most hyperlinks can be +%D found in tables of contents and registers, the saving in +%D terms of bytes can be neglected and the first approach is a +%D clear winner. +%D +%D The most convenient way of cross||referencing is using named +%D destinations. A more simple scheme is using page numbers as +%D destinations. Because the latter alternative can often be +%D implemented more efficient, and because we cannot be sure +%D what scheme a driver supports, we always have to supply a +%D pagenumber, even when we use named destinations. +%D +%D To enable a driver to find out what to make active, we have +%D to provide begin and endpoints, so like with color, we use +%D pairs of specials. The first scheme can be satisfied with +%D proper dimensions of the areas to be made active. +%D +%D The interactive real work is done by the following four +%D specials. The reason for providing the first one with both +%D a label and a number, is a result of the quite poor +%D implementation of \type{pdfmarks} in version 1.0 of +%D Acrobat. Because only pagenumbers were supported as +%D destination, we had to provide both labels (\DVIWINDO) and +%D pagenumbers (\PDF). Some drivers use start stop pairs. +%D +%D \starttyping +%D \dostartgotolocation {w} {h} {url} {file} {label} {page} +%D \dostartgotorealpage {w} {h} {url} {file} {page} +%D \stoptyping +%D +%D Their counterparts are: +%D +%D \starttyping +%D \dostopgotolocation +%D \dostopgotorealpage +%D \stoptyping +%D +%D The internal alternative is used for system||generated +%D links, the external one for user||generated links. The +%D Uniform Resource Locator can be used to let the reader +%D surf the net. + +\installspecial [\dostartgotolocation] [and] [6] +\installspecial [\dostopgotolocation] [and] [0] +\installspecial [\dostartgotorealpage] [and] [5] +\installspecial [\dostopgotorealpage] [and] [0] + +%D One may wonder why jumps to page and location are not +%D combined. By splitting them, we enable macro||packages to +%D force the prefered alternative, while on the other hand +%D drivers can pick up the alternative desired most. + +%D \macros +%D {dostartgotoJS, doflushJSpreamble} +%D +%D Rather special is the option to include and execute +%D JavaScript code. This is a typical \PDF\ option. +%D +%D \starttyping +%D \dostartgotoJS {w} {h} {script} +%D \stoptyping +%D +%D This not so standard \TEX\ feature should be used with +%D care. Preamble scripts are flushed by +%D +%D \doflushJSpreamble {script} + +\installspecial [\dostartgotoJS] [and] [3] +\installspecial [\dostopgotoJS] [and] [0] +\installspecial [\doflushJSpreamble][and] [1] + +%D \macros +%D {dostartthisislocation, dostopthisislocation, +%D dostartthisisrealpage, dostopthisisrealpage} +%D +%D Before we can goto some location or page, we have to tell +%D the system where it can be found. Because some drivers +%D follow the \SGML\ approach of begin||end tags, we have to +%D support pairs. A possible extension to this scheme is +%D supplying coordinates for viewing the text. +%D +%D The opposite commands of \type{\dogotosomething} have only +%D one argument: +%D +%D \starttyping +%D \dostartthisislocation {label} +%D \dostartthisisrealpage {page} +%D \stoptyping +%D +%D These commands are accompanied by: +%D +%D \starttyping +%D \dostopthisislocation +%D \dostopthisisrealpage +%D \stoptyping +%D +%D As with all interactive commands's they are installed as +%D \type{and} category specials. + +\installspecial [\dostartthisislocation] [and] [1] +\installspecial [\dostopthisislocation] [and] [0] +\installspecial [\dostartthisisrealpage] [and] [1] +\installspecial [\dostopthisisrealpage] [and] [0] + +%D In \CONTEXT\ we don't use the \type{\stopsomething} +%D macros because we let \TEX\ take care of typographic +%D issues. + +%D \macros +%D {doresetgotowhereever} +%D +%D These and others need: + +\installspecial [\doresetgotowhereever] [and] [0] + +%D \macros +%D {dostartexecutecommand, dostopexecutecommand} +%D +%D The actual behavior of the next pair of commands depends +%D much on the viewing engine. Therefore one cannot depend +%D too much on their support. +%D +%D \starttyping +%D \dostartexecutecommand {w} {h} {command} {options} +%D \stoptyping +%D +%D At least the next commands are supported (more examples +%D can be found in \type {spec-fdf.tex}: +%D +%D \startlinecorrection\setupalign[middle]\leavevmode +%D \starttable[|l|l|] +%D \HL +%D \NC \bf command \NC \bf action \NC\SR +%D \HL +%D \NC first \NC go to the first page \NC\FR +%D \NC previous \NC go to the previous page \NC\MR +%D \NC next \NC go to the next page \NC\MR +%D \NC last \NC go to the last page \NC\MR +%D \NC backward \NC go back to the link list \NC\MR +%D \NC forward \NC go forward in the link list \NC\MR +%D \NC print \NC enter print mode \NC\MR +%D \NC exit \NC exit viewer \NC\MR +%D \NC close \NC close document \NC\MR +%D \NC enter \NC enter viewer \NC\MR +%D \NC help \NC show help on the viewer \NC\LR +%D \HL +%D \stoptable +%D \stoplinecorrection +%D +%D Options are to be passed as a comma separated list of +%D assignments. + +\installspecial [\dostartexecutecommand] [and] [4] +\installspecial [\dostopexecutecommand] [and] [0] + +%D \macros +%D {dostartobject, +%D dostopobject, +%D doresetobjects, +%D doinsertobject} +%D +%D Reuse of object can reduce the output filesize +%D considerably. Reusable objects are implemented with: +%D +%D \starttyping +%D \dostartobject{class}{name}{width}{height}{depth} +%D some typeset material +%D \dostopobject +%D \stoptyping +%D +%D \starttyping +%D \doinsertobject{class}{name} +%D \stoptyping +%D +%D The savings can be huge in interactive texts. The next macro needs +%D to be called after a graphic is inserted (in order to clean up +%D global references). +%D +%D \starttyping +%D \doresetobjects +%D \stoptyping + +\installspecial [\dostartobject] [or] [5] +\installspecial [\dostopobject] [or] [0] +\installspecial [\doinsertobject] [or] [2] +\installspecial [\doresetobjects] [or] [0] + +%D \macros +%D {doregisterfigure, doregisterfigurecolor} +%D +%D Images can be objects as well and it's up to the driver to +%D handle this. Alternative images are also up to the driver, +%D and the next macro tells the driver that the previous image +%D is somehow followed by another and that both have to be +%D handled together. This is a rather fuzzy model, but for the +%D moment it suits its purpose: low res screen versions combined +%D with high res printable ones. + +\installspecial [\doregisterfigure] [or] [2] +\installspecial [\doregisterfigurecolor][or] [1] + +% %D \macros +% %D {dogetobjectreference} +% %D +% %D For very special purposes, one can ask for the internal +% %D reference to the object. Beware! +% +% \installspecial [\dogetobjectreference] [or] [3] +% +% %D The first argument is the name, the second a macro that +% %D gets the associated value. + +%D \macros +%D {dostartrunprogram, dostoprunprogram, +%D dostartgotoprofile, dostopgotoprofile, +%D dobeginofprofile, +%D doendofprofile} +%D +%D These specials are still experimental. They are not yet +%D supported by the programs the way they should be. +%D +%D {\em --- still undocumented ---} + +\installspecial [\dostartrunprogram] [and] [4] +\installspecial [\dostoprunprogram] [and] [0] +\installspecial [\dostartgotoprofile] [and] [3] +\installspecial [\dostopgotoprofile] [and] [0] +\installspecial [\dobeginofprofile] [and] [4] +\installspecial [\doendofprofile] [and] [0] + +%D \macros +%D {doinsertbookmark} +%D +%D Bookmarks, that is viewer generated tables of contents, are +%D a strange phenomena, mainly because \TEX\ can provide +%D whatever kind of table in much better quality. + +\installspecial [\doinsertbookmark] [and] [5] + +%D This special is called as: +%D +%D \starttyping +%D \doinstallbookmark {level} {nofsubentries} {text} {page} {open} +%D \stoptyping +%D +%D This definition is very \PDF\ oriented, so for more +%D information we kindly refer to the \PDF\ manuals. + +%D \macros +%D {dosetpagetransition} +%D +%D In presentations, fancy page transitions can, at least for a +%D short moment, let the audience focus at the screen. Like the +%D previous one, this special is very \PDF. +%D +%D \starttyping +%D \dosetpagetransition{dissolve}{0} +%D \stoptyping +%D +%D Transitions have symbolic names, like dissolve, box, split, +%D blinds, wipe and glitter. The second argument determines +%D the wait time (unless zero). + +\installspecial [\dosetpagetransition] [or] [2] + +%D \macros +%D {dopresettextfield,dopresetlinefield, +%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, +%D dopresetbuttonfield,dopresetcheckfield, +%D dopresetradiofield,dopresetradiorecord} +%D +%D The special drivers are programmed independant from their +%D calling macros are thereby use the standard \TEX\ way of +%D passing parameters. Unfortunately fields often have more +%D than nine characteristics, so we pack some arguments in one. +%D +%D \starttyping +%D \dopresettextfield / \dopresetlinefield +%D {name} {width} {height} {default} {length} +%D {style,color} {options} {alignment} {actions} +%D +%D \dopresetchoicefield / \dopresetpopupfield / \dopresetcombofield +%D {name} {width} {height} {default} +%D {style,color} {options} {values} {actions} +%D +%D \dopresetpushfield +%D {name} {width} {height} {default} +%D {options} {values} {actions} +%D +%D \dopresetcheckfield +%D {name} {width} {height} {default} +%D {options} {values} {actions} +%D +%D \dopresetradiofield +%D {name} {width} {height} {default} +%D {options} {parent} {values} {actions} +%D +%D \dopresetradiorecord +%D {name} {top} {options} {kids} {actions} +%D \stoptyping + +\installspecial [\dopresetlinefield] [or] [9] +\installspecial [\dopresettextfield] [or] [9] +\installspecial [\dopresetchoicefield] [or] [8] +\installspecial [\dopresetpopupfield] [or] [8] +\installspecial [\dopresetcombofield] [or] [8] +\installspecial [\dopresetpushfield] [or] [7] +\installspecial [\dopresetcheckfield] [or] [7] +\installspecial [\dopresetradiofield] [or] [8] +\installspecial [\dopresetradiorecord] [or] [5] + +%D \macros +%D {dodefinefieldset,dogetfieldset,doiffieldset} +%D +%D Field sets, used in resetting and submitting, are handled +%D by: + +\installspecial [\dodefinefieldset] [or] [2] +\installspecial [\dogetfieldset] [or] [1] +\installspecial [\doiffieldset] [or] [2] + +%D \macros +%D {dosetfieldstatus} +%D +%D For practical reasons we set some field characteristics +%D using: +%D +%D \starttyping +%D \dosetfieldstatus {mode} {parent} {kids} {root} +%D \stoptyping + +\installspecial [\dosetfieldstatus] [or] [4] + +%D with: + +\def\fieldlonermode {0} % no \chardef here +\def\fieldparentmode{1} % no \chardef here +\def\fieldchildmode {2} % no \chardef here +\def\fieldcopymode {3} % no \chardef here + +%D \macros +%D {doregistercalculationset} +%D +%D We can define a calculation order list with: +%D +%D \starttyping +%D \doregistercalculationset {set identifier} +%D \stoptyping + +\installspecial [\doregistercalculationset] [or] [1] + +%D \macros +%D {doinsertcomment, doflushcomments} +%D +%D Not so much out of need, but to be complete, we also +%D implement text annotations, so called comment: +%D +%D \starttyping +%D \doinsertcomment +%D {title} {width} {height} {color} {open} {symbol} {collect} {data} +%D \stoptyping +%D +%D When enables, comments can be collected and flushed: +%D +%D \starttyping +%D \doflushcomments +%D \stoptyping + +\installspecial[\doinsertcomment] [and] [8] +\installspecial[\doflushcomments] [and] [0] + +%D \macros +%D {dosetposition, dosetpositionwhd, dosetpositionplus, +%D dosetpositionpapersize} +%D +%D Not natural to \TEX, but available in \PDFTEX, and by +%D means of postprocessed \DVI, we can save and call upon +%D positions. +%D +%D \starttyping +%D \dosetposition {identifier} +%D \dosetpositionwhd {identifier} {width} {height} {depth} +%D \dosetpositionplus {identifier} {width} {height} {depth} {list} +%D \dosetpositionpapersize {width} {height} +%D \stoptyping +%D +%D This is one of the few specials where when using \PDFTEX\ +%D the driver directly deals with the utility file. + +%D Support is moved to spec-mis.tex. The whole idea originates +%D and was implemented first in \PDFTEX. Later \DVIPDFMX\ +%D supported the \CONTEXT\ specific specials and nowadays +%D \PDFTEX\ supports this feature in \DVI\ mode and \XETEX\ +%D implements it as well. This means that only \ALEPH\ is +%D still dependent on specials, but that variant of \TEX\ has +%D become obsolete anyway. + +% \installspecial [\dosetposition] [or] [1] +% \installspecial [\dosetpositionwhd] [or] [4] +% \installspecial [\dosetpositionplus] [or] [5] + +% \installspecial [\dosetpositionpapersize] [or] [2] + +%D \macros +%D {dostarttransparency,dostoptransparency} +%D +%D \starttyping +%D \dostarttransparency{fraction}{type} +%D \dostoptransparency +%D \stoptyping +%D +%D Although in \CONTEXT\ transparency is closely integrated +%D in the color drivers, in the end it is an independent +%D feature. + +\installspecial [\dostarttransparency] [or] [2] +\installspecial [\dostoptransparency] [or] [0] + +%D \macros +%D {doattachfile} +%D +%D \starttyping +%D \doattachfile{title}{width}{height}{depth}{color}{symbol}{filename}{source} +%D \stoptyping + +\installspecial [\doattachfile] [or] [8] + +%D Experimental (properties): + +\installspecial[\dostartviewerlayer] [or] [1] +\installspecial[\dostopviewerlayer] [or] [0] +\installspecial[\dodefineviewerlayer] [or] [5] +%installspecial[\doflushviewertextlayers] [or] [0] +%installspecial[\doflushviewerpagelayers] [or] [0] +\installspecial[\domakeviewerlayerlist] [or] [1] + +\installspecial[\doinsertrenderingwindow] [or] [4] +\installspecial[\doinsertrendering] [or] [4] +\installspecial[\doinsertrenderingobject] [or] [4] +\installspecial[\doinsertrenderingobject] [or] [4] + +\installspecial[\dostartfonteffect] [or] [3] +\installspecial[\dostopfonteffect] [or] [0] + +%D From now on, mapfile loading is also a special; we assume the +%D more or less standard dvips syntax. + +\installspecial[\doresetmapfilelist] [and] [0] +\installspecial[\doloadmapfile] [and] [2] % + - = | filename +\installspecial[\doloadmapline] [and] [2] % + - = | fileline + +%D We define a couple of backends: + +\defineoutput [dvipsone] [dvi,ps,yy] +\defineoutput [dviwindo] [dvi,ps,yy,win] +\defineoutput [dvips] [dvi,ps,tr] +\defineoutput [dviview] [dvi,ps,tr,dv] +\defineoutput [pdftex] [tpd] +\defineoutput [pdf] [tpd] +\defineoutput [dvipdfm] [dpm] +\defineoutput [dpm] [dpm] +\defineoutput [dvipdfmx] [dpx] +\defineoutput [dpx] [dpx] +\defineoutput [acrobat] [pdf,ps,tr] + +\defineoutput [xetex] [dpx,xet] +\defineoutput [xtx] [dpx,xet] +\defineoutput [xdv] [dvi,xtx,xet] +\defineoutput [xdv2pdf] [dvi,xtx,xet] + +%D We don't enable \ACROBAT, because pure \POSTSCRIPT\ is not +%D that strong on objects and \PDFTEX\ does a better job. +%D Some reasonable alternatives are: +%D +%D \starttyping +%D \setupoutput [dvipsone,acrobat] +%D \setupoutput [dviwindo,acrobat] +%D \stoptyping +%D +%D Although, better is: +%D +%D \starttyping +%D \setupoutput [pdftex] +%D \stoptyping + +%D Please let me know if we need more. From now on we default +%D to: + +\appendtoks + \setupoutput[dvips]% +\to \everydump + +\protect \endinput diff --git a/tex/context/base/spec-def.tex b/tex/context/base/spec-def.tex deleted file mode 100644 index ad1a9bb1d..000000000 --- a/tex/context/base/spec-def.tex +++ /dev/null @@ -1,1016 +0,0 @@ -%D \module -%D [ file=spec-def, -%D version=1996.01.25, -%D title=\CONTEXT\ Special Macros, -%D subtitle=Definitions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module used to be integrated in \type {spec-ini}, -%D but testing optimization is more convenient this way. - -\writestatus{loading}{ConTeXt Special Macros / Definitions} - -\unprotect - -%D Ok, messy, but we need this because we load drivers before -%D references. - -\newif\ifcollectreferenceactions - -%D The following libraries are defined. Two postscript -%D drivers are supported, as well as two mechanisms for -%D interactive texts. -%D -%D \startlinecorrection -%D \starttable[|l|l|l|l|l|] -%D \HL -%D \NC \bf file \NC -%D \bf name \NC -%D \bf calls \NC -%D \bf support \NC -%D \bf program / driver \NC\SR -%D \HL -%D \NC \tttf spec-tex \NC -%D \tttf tex \NC -%D \NC -%D Generic \TEX\ (\DVI) \NC -%D (default) \NC\FR -%D \NC \tttf spec-tpd \NC -%D \tttf \PDF \NC -%D \NC -%D Han The Thanh \NC -%D (pdftex) \NC\MR -%D \NC \tttf spec-ps \NC -%D \tttf postscript \NC -%D \NC -%D Adobe PostScript \NC -%D (default) \NC\MR -%D \NC \tttf spec-tr \NC -%D \tttf rokicki \NC -%D \tttf postscript \NC -%D Thomas Rokicki \NC -%D (dvips) \NC\MR -%D \NC \tttf spec-yy \NC -%D \tttf yandy \NC -%D \tttf postscript \NC -%D YandY \NC -%D (dvipsone, dviwindo) \NC\MR -%D \NC \tttf spec-pdf \NC -%D \tttf pdf \NC -%D \NC -%D Adobe PDF \NC -%D (Acrobat) \NC\MR -%D \NC \tttf spec-win \NC -%D \tttf dviwindo \NC -%D YandY \NC -%D (dviwindo) \NC\MR -%D \NC \tttf spec-htm \NC -%D \tttf html \NC -%D \NC -%D HTML V 2.0 \NC -%D (dvips) \NC\LR -%D \HL -%D \stoptable -%D \stoplinecorrection - -%D \macros -%D {dostartgraymode,dostopgraymode, -%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode} -%D -%D Switching to and from color can be done in two ways: -%D -%D \startitemize[packed,n] -%D \item insert driver specific commands -%D \item pass instructions to the output device -%D \stopitemize -%D -%D The first approach is more general and lays the -%D responsibility at the driver side. Probably due to the fact -%D that \TEX\ does not directly support color, we have been -%D confronted for the last few years with changing special -%D definitions. The need for support depends on how a macro -%D package handles colored text that crosses the page boundary. -%D Again, there are two approaches. -%D -%D \startitemize[packed,n] -%D \item let \TEX\ do the job -%D \item let the driver handle things -%D \stopitemize -%D -%D The first approach is as driver independant as possible and -%D can easily be accomplished by using \TEX's mark mechanism. -%D In \CONTEXT\ we follow this approach. More and more, drivers -%D are starting to support color, including stacking them. -%D -%D Colors as well as grayscales can be represented in scales -%D from~0 to~1. When drivers use values in the range 0..255, -%D this value has to be adapted in the translation process. -%D Technically it's possible to get a grayscale from combining -%D colors. In the \cap{RGB} color system, a color with Red, -%D Green and Blue components of 0.80 show the same gray as a -%D Gray Scale specified 0.80. The \cap{CMYK} color system -%D supports a Black component apart from Cyan, Magenta and -%D Yellow. -%D -%D Depending on the target format, color support differs from -%D gray support. PostScript for example offers different -%D operators for setting gray and color. This is because -%D printing something using three colors is someting else than -%D printing with just black. -%D -%D In \CONTEXT\ we have implemented a color subsystem that -%D supports the use of well defined colors that, when printed -%D in black and white, still can be distinguished. This -%D approach enables us to serve both printed and electronic -%D versions, using colored text and illustrations. More on the -%D fundamentals of this topic can be found in the \cap{MAPS} of -%D the Dutch User Group, 14 (95.1). -%D -%D To satisfy all those needs, we define four specials which -%D supply enough information for drivers to act upon. We -%D could have used more general commands with the keywords -%D 'rgb' and 'gray', but because these specials are used often, -%D we prefer the more direct and shorter alternative. -%D -%D We start with the installation of color and grayscale -%D specials. The values are in the range 0..1 (e.g. 0.25). -%D -%D \starttyping -%D \dostartgraymode {gray} ... \dostopgraymode -%D \dostartrgbcolormode {red} {green} {blue} ... \dostopcolormode -%D \dostartcmykcolormode {cyan} {magenta} {yellow} {black} ... \dostopcolormode -%D \dostartgraycolormode {gray} ... \dostopcolormode -%D \stoptyping -%D -%D Because we can expect conflicts between drivers, we -%D implement them as category \type{or}. In previous versions -%D of \DVIPSONE\ the use of their color||specials did not -%D interfere with the PostScript ones, but recent versions do. - -\installspecial [\dostartgraymode] [or] [1] -\installspecial [\dostopgraymode] [or] [0] - -\installspecial [\dostartrgbcolormode] [or] [3] -\installspecial [\dostartcmykcolormode] [or] [4] -\installspecial [\dostartgraycolormode] [or] [1] -\installspecial [\dostopcolormode] [or] [0] - -%D New and experimental: - -\installspecial [\dostartspotcolormode] [or] [2] - -\installspecial [\doregisterrgbspotcolor] [or] [7] -\installspecial [\doregistercmykspotcolor] [or] [8] -\installspecial [\doregistergrayspotcolor] [or] [5] - -\installspecial [\doregisterrgbindexcolor] [or] [7] -\installspecial [\doregistercmykindexcolor] [or] [8] -\installspecial [\doregistergrayindexcolor] [or] [5] - -\installspecial [\doregisterspotcolorname] [or] [2] - -\installspecial [\dostartnonecolormode] [or] [0] -\installspecial [\doregisternonecolor] [or] [0] - -%D For some drivers, the stop special is of no use and can -%D simply call the start one with zero arguments. - -%D \macros -%D {dogetfiguresize,doinsertfile,doinsertMPfile} -%D -%D Probably the most problematic special is the following -%D one. Because we want to be able to support different -%D schemes, we pass a lot of data to it. -%D -%D The support of inserting files (like illustrations) comes in -%D many flavors. Some drivers use scales, some take dimensions. -%D Some need offsets and others act on stored characteristics. -%D They need one thing in common: a filename. Although separate -%D specials for different formats sometimes are more clear, we -%D decided to combine them all in one: -%D -%D \starttyping -%D \doinsertfile {type,method} {file,label} -%D {xscale} {yscale} {x} {y} {w} {h} -%D {options} -%D \stoptyping -%D -%D The scale is given percents, the other values are base -%D points. -%D -%D Per 2006 we have simplified this model. The amount of drivers -%D is not growing and all support scaling. We pass variables via -%D Driver specific macros. -%D -%D \starttyping -%D \doinsertfile -%D \stoptyping -%D -%D The special is implemented as \type{or}. Because \DVIPSONE\ -%D understands them all, a chain of alternatives would generate -%D multiple occurrences of the same illustration. -%D -%D When option 1 is passed, the viewers is asked to present a -%D preview, like the first frame of a movie. - -\installspecial [\dogetfiguresize][or] [0] % now a special -\installspecial [\doinsertfile] [or] [0] % [9] -\installspecial [\doinsertMPfile] [or] [1] % speed up - -%D No start||stop construction is needed here, because there in -%D no further interference of \TEX. All dimensions are output -%D in points and scales as a number, where 100 equal 100\%. (We -%D used to pass scaled points). - -%D \macros -%D {doinsertsoundtrack} -%D -%D Sounds are (for the moment) just files with -%D associated options. -%D -%D \starttyping -%D \doinsertsoundtrack {file} {label} {options} -%D \stoptyping - -\installspecial [\doinsertsoundtrack] [or] [3] - -%D \macros -%D {dogetnofinsertpages} -%D -%D Some file formats support more than one page, like \PDF, -%D and for special applications, one may want to have access -%D to the total number of pages. -%D -%D \starttyping -%D \dogetnofinsertpages{filename} -%D \stoptyping -%D -%D The number is also available after the insert is placed, -%D since inclusion may take place immediate when an insert is -%D called upon. - -\def\nofinsertpages{1} % one of the few 'talk backs' - -\installspecial [\dogetnofinsertpages] [or] [1] - -%D \macros -%D {dostartrotation, -%D dostoprotation} -%D -%D We support rotation with the special: -%D -%D \starttyping -%D \dostartrotation {angle} ... \dostoprotation -%D \stoptyping -%D -%D For the moment these specials are installed as -%D category \type{or}. - -\installspecial [\dostartrotation] [or] [1] -\installspecial [\dostoprotation] [or] [0] - -%D \macros -%D {dostartscaling, -%D dostopscaling} -%D -%D Scaling is also supported: -%D -%D \starttyping -%D \dostartscaling {x} {y} ... \dostopscaling -%D \stoptyping -%D -%D Like the previous one, these specials are of category -%D \type{or}. - -\installspecial [\dostartscaling] [or] [2] -\installspecial [\dostopscaling] [or] [0] - -%D \macros -%D {dostartmirroring, -%D dostopmirroring} -%D -%D And indeed, mirroring is there too: -%D -%D \starttyping -%D \dostartmirroring {x} {y} ... \dostopmirroring -%D \stoptyping -%D -%D Again these specials are installed as category \type{or}. - -\installspecial [\dostartmirroring] [or] [0] -\installspecial [\dostopmirroring] [or] [0] - -%D \macros -%D {dostartnegative, -%D dostopnegative} -%D -%D When producing output for an image setter, negating the -%D page comes into view. Here are the tools: - -\installspecial [\dostartnegative] [or] [0] -\installspecial [\dostopnegative] [or] [0] - -%D \macros -%D {dostartoverprint, -%D dostopoverprint} -%D -%D Rudimentary overprint (knockout) control is implemented -%D using: - -\installspecial [\dostartoverprint] [or] [0] -\installspecial [\dostopoverprint] [or] [0] - -%D The following two specials are used in for instance \type -%D {\vadjust}'d margin material inside colored paragraphs. - -\installspecial [\dostartgraphicgroup] [or] [0] -\installspecial [\dostopgraphicgroup ] [or] [0] - -%D \macros -%D {doselectfirstpaperbin, -%D doselectsecondpaperbin} -%D -%D Here are some very printer||specific ones. No further -%D comment. - -\installspecial [\doselectfirstpaperbin] [or] [0] -\installspecial [\doselectsecondpaperbin] [or] [0] - -%D \macros -%D {doovalbox} -%D -%D When we look at the implementation, this is a complicated -%D one. There are seven arguments. -%D -%D \starttyping -%D \doovalbox {w} {h} {d} {linewidth} {radius} {stroke} {fill} {variant} -%D \stoptyping -%D -%D This command has to return a \type{\vbox} which can be used -%D to lay over another one (with text). The radius is in -%D degrees, the stroke and fill are~\type{1} (true) of~\type{0} -%D (false). - -\installspecial [\doovalbox] [or] [8] - -%D \macros -%D {dostartclipping,dostopclipping} -%D -%D Clipping is implemented in such a way that an arbitrary -%D can be fed. -%D -%D \starttyping -%D \dostartclipping {pathname}{width} {height} -%D \dostopclipping -%D \stoptyping -%D -%D - -\installspecial [\dostartclipping] [or] [3] -\installspecial [\dostopclipping] [or] [0] - -%D \macros -%D {dosetupidentity} -%D -%D We can declare some characteristics of the document with -%D -%D \starttyping -%D \dosetupidentity {title} {subject} {author} {creator} {date} {keys} -%D \stoptyping -%D -%D All data is in string format. - -\installspecial [\dosetupidentity] [and] [6] - -%D \macros -%D {dosetuppaper} -%D -%D This special can be used to tell the driver what page size -%D to use. The special takes three arguments. -%D -%D \starttyping -%D \dosetuppaper {type} {width} {height} -%D \stoptyping -%D -%D The type is one of the common identifiers, like A4, A5 or -%D B2. - -\installspecial [\dosetuppaper] [and] [3] - -%D \macros -%D {dosetupprinter} -%D -%D Some drivers enable the user to specify the paper type -%D used and/or page dimensions to be taken into account. -%D -%D \starttyping -%D \dosetupprinter {type} {hoffset} {voffset} {width} {height} -%D \stoptyping -%D -%D The first argument is one of \type{letter}, \type{legal}, -%D \type{A4}, \type{A5} etc. The dimensions are in -%D basepoints. - -\installspecial [\dosetupprinter] [and] [5] - -%D \macros -%D {dosetupopenaction, dosetupclosaction, -%D dosetupopenpageaction, dosetupclospageaction, -%D dosetupinteraction, -%D dosetupscreen, -%D dosetupviewmode} -%D -%D Here come some obscure interactive commands. Probably the -%D specs will change with the development of the macros that -%D use them. -%D -%D The first ones can be used to set up the interaction. -%D -%D \starttyping -%D \dosetupinteraction -%D \stoptyping -%D -%D Normally this command does nothing but giving a message -%D that some scheme is supported. -%D -%D \starttyping -%D \dosetupstartaction -%D \dosetupstopaction -%D \stoptyping -%D -%D These two setup the actions to be executed when the document -%D is opened and closed. -%D -%D The next commands sets up the page and screen. They are -%D kind of related. -%D -%D \starttyping -%D \dosetuppage {hoffset} {voffset} {width} {height} {options} -%D \dosetupscreen {hoffset} {voffset} {width} {height} {options} -%D \stoptyping -%D -%D The first four arguments are in points. Option~1 results in a -%D full screen launch. -%D -%D \starttyping -%D \dosetuppageview {keyword} -%D \stoptyping -%D -%D For the moment we only support \type{fit}. - -\installspecial [\dosetupinteraction] [and] [0] - -\installspecial [\dosetupopenaction] [and] [0] -\installspecial [\dosetupscreen] [and] [5] -\installspecial [\dosetuppageview] [and] [1] - -\installspecial [\dosetupcloseaction] [and] [0] -\installspecial [\dosetupopenpageaction] [and] [0] -\installspecial [\dosetupclosepageaction] [and] [0] -\installspecial [\dosetuprenderingopenpageaction] [and] [0] -\installspecial [\dosetuprenderingclosepageaction] [and] [0] - -% new, yet undocumented, replaces \dosetupscreen - -\installspecial [\dosetupcropbox] [and] [4] -\installspecial [\dosetuptrimbox] [and] [4] -\installspecial [\dosetupartbox] [and] [4] -\installspecial [\dosetupbleedbox] [and] [4] - -%D \macros -%D {dostarthide, -%D dostophide} -%D -%D Not every part of the screen is suitable for paper. Menus -%D for instance have no meaning on an non||interactive medium. -%D These elements are hidden by means of: -%D -%D \starttyping -%D \dostarthide -%D \dostophide -%D \stoptyping - -\installspecial [\dostarthide] [or] [0] -\installspecial [\dostophide] [or] [0] - -%D \macros -%D {dostartgotolocation, dostopgotolocation, -%D dostartgotorealpage, dostopgotorealpage} -%D -%D When we want to support hypertext buttons, again we have -%D to deal with two concepts. -%D -%D \startitemize[packed,n] -%D \item let \TEX\ highlight the text -%D \item let the driver show us where to click -%D \stopitemize -%D -%D The first approach is the most secure one. It gives us -%D complete control over the visual appearance of hyper -%D buttons. The second alternative lets the driver guess what -%D part of the text needs highlighting. As long as we deal with -%D not too complicated textual buttons, this is no problem. -%D It's even a bit more efficient when we take long mid -%D paragraph active regions into account. When we let \TEX\ -%D handle active sentences {\em for instance marked like this -%D one}, we have to take care of line- and pagebreaks ourselve. -%D However, it's no trivial matter to let a driver find out -%D where things begin and end. Because most hyperlinks can be -%D found in tables of contents and registers, the saving in -%D terms of bytes can be neglected and the first approach is a -%D clear winner. -%D -%D The most convenient way of cross||referencing is using named -%D destinations. A more simple scheme is using page numbers as -%D destinations. Because the latter alternative can often be -%D implemented more efficient, and because we cannot be sure -%D what scheme a driver supports, we always have to supply a -%D pagenumber, even when we use named destinations. -%D -%D To enable a driver to find out what to make active, we have -%D to provide begin and endpoints, so like with color, we use -%D pairs of specials. The first scheme can be satisfied with -%D proper dimensions of the areas to be made active. -%D -%D The interactive real work is done by the following four -%D specials. The reason for providing the first one with both -%D a label and a number, is a result of the quite poor -%D implementation of \type{pdfmarks} in version 1.0 of -%D Acrobat. Because only pagenumbers were supported as -%D destination, we had to provide both labels (\DVIWINDO) and -%D pagenumbers (\PDF). Some drivers use start stop pairs. -%D -%D \starttyping -%D \dostartgotolocation {w} {h} {url} {file} {label} {page} -%D \dostartgotorealpage {w} {h} {url} {file} {page} -%D \stoptyping -%D -%D Their counterparts are: -%D -%D \starttyping -%D \dostopgotolocation -%D \dostopgotorealpage -%D \stoptyping -%D -%D The internal alternative is used for system||generated -%D links, the external one for user||generated links. The -%D Uniform Resource Locator can be used to let the reader -%D surf the net. - -\installspecial [\dostartgotolocation] [and] [6] -\installspecial [\dostopgotolocation] [and] [0] -\installspecial [\dostartgotorealpage] [and] [5] -\installspecial [\dostopgotorealpage] [and] [0] - -%D One may wonder why jumps to page and location are not -%D combined. By splitting them, we enable macro||packages to -%D force the prefered alternative, while on the other hand -%D drivers can pick up the alternative desired most. - -%D \macros -%D {dostartgotoJS, doflushJSpreamble} -%D -%D Rather special is the option to include and execute -%D JavaScript code. This is a typical \PDF\ option. -%D -%D \starttyping -%D \dostartgotoJS {w} {h} {script} -%D \stoptyping -%D -%D This not so standard \TEX\ feature should be used with -%D care. Preamble scripts are flushed by -%D -%D \doflushJSpreamble {script} - -\installspecial [\dostartgotoJS] [and] [3] -\installspecial [\dostopgotoJS] [and] [0] -\installspecial [\doflushJSpreamble][and] [1] - -%D \macros -%D {dostartthisislocation, dostopthisislocation, -%D dostartthisisrealpage, dostopthisisrealpage} -%D -%D Before we can goto some location or page, we have to tell -%D the system where it can be found. Because some drivers -%D follow the \SGML\ approach of begin||end tags, we have to -%D support pairs. A possible extension to this scheme is -%D supplying coordinates for viewing the text. -%D -%D The opposite commands of \type{\dogotosomething} have only -%D one argument: -%D -%D \starttyping -%D \dostartthisislocation {label} -%D \dostartthisisrealpage {page} -%D \stoptyping -%D -%D These commands are accompanied by: -%D -%D \starttyping -%D \dostopthisislocation -%D \dostopthisisrealpage -%D \stoptyping -%D -%D As with all interactive commands's they are installed as -%D \type{and} category specials. - -\installspecial [\dostartthisislocation] [and] [1] -\installspecial [\dostopthisislocation] [and] [0] -\installspecial [\dostartthisisrealpage] [and] [1] -\installspecial [\dostopthisisrealpage] [and] [0] - -%D In \CONTEXT\ we don't use the \type{\stopsomething} -%D macros because we let \TEX\ take care of typographic -%D issues. - -%D \macros -%D {doresetgotowhereever} -%D -%D These and others need: - -\installspecial [\doresetgotowhereever] [and] [0] - -%D \macros -%D {dostartexecutecommand, dostopexecutecommand} -%D -%D The actual behavior of the next pair of commands depends -%D much on the viewing engine. Therefore one cannot depend -%D too much on their support. -%D -%D \starttyping -%D \dostartexecutecommand {w} {h} {command} {options} -%D \stoptyping -%D -%D At least the next commands are supported (more examples -%D can be found in \type {spec-fdf.tex}: -%D -%D \startlinecorrection\setupalign[middle]\leavevmode -%D \starttable[|l|l|] -%D \HL -%D \NC \bf command \NC \bf action \NC\SR -%D \HL -%D \NC first \NC go to the first page \NC\FR -%D \NC previous \NC go to the previous page \NC\MR -%D \NC next \NC go to the next page \NC\MR -%D \NC last \NC go to the last page \NC\MR -%D \NC backward \NC go back to the link list \NC\MR -%D \NC forward \NC go forward in the link list \NC\MR -%D \NC print \NC enter print mode \NC\MR -%D \NC exit \NC exit viewer \NC\MR -%D \NC close \NC close document \NC\MR -%D \NC enter \NC enter viewer \NC\MR -%D \NC help \NC show help on the viewer \NC\LR -%D \HL -%D \stoptable -%D \stoplinecorrection -%D -%D Options are to be passed as a comma separated list of -%D assignments. - -\installspecial [\dostartexecutecommand] [and] [4] -\installspecial [\dostopexecutecommand] [and] [0] - -%D \macros -%D {dostartobject, -%D dostopobject, -%D doresetobjects, -%D doinsertobject} -%D -%D Reuse of object can reduce the output filesize -%D considerably. Reusable objects are implemented with: -%D -%D \starttyping -%D \dostartobject{class}{name}{width}{height}{depth} -%D some typeset material -%D \dostopobject -%D \stoptyping -%D -%D \starttyping -%D \doinsertobject{class}{name} -%D \stoptyping -%D -%D The savings can be huge in interactive texts. The next macro needs -%D to be called after a graphic is inserted (in order to clean up -%D global references). -%D -%D \starttyping -%D \doresetobjects -%D \stoptyping - -\installspecial [\dostartobject] [or] [5] -\installspecial [\dostopobject] [or] [0] -\installspecial [\doinsertobject] [or] [2] -\installspecial [\doresetobjects] [or] [0] - -%D \macros -%D {doregisterfigure, doregisterfigurecolor} -%D -%D Images can be objects as well and it's up to the driver to -%D handle this. Alternative images are also up to the driver, -%D and the next macro tells the driver that the previous image -%D is somehow followed by another and that both have to be -%D handled together. This is a rather fuzzy model, but for the -%D moment it suits its purpose: low res screen versions combined -%D with high res printable ones. - -\installspecial [\doregisterfigure] [or] [2] -\installspecial [\doregisterfigurecolor][or] [1] - -% %D \macros -% %D {dogetobjectreference} -% %D -% %D For very special purposes, one can ask for the internal -% %D reference to the object. Beware! -% -% \installspecial [\dogetobjectreference] [or] [3] -% -% %D The first argument is the name, the second a macro that -% %D gets the associated value. - -%D \macros -%D {dostartrunprogram, dostoprunprogram, -%D dostartgotoprofile, dostopgotoprofile, -%D dobeginofprofile, -%D doendofprofile} -%D -%D These specials are still experimental. They are not yet -%D supported by the programs the way they should be. -%D -%D {\em --- still undocumented ---} - -\installspecial [\dostartrunprogram] [and] [4] -\installspecial [\dostoprunprogram] [and] [0] -\installspecial [\dostartgotoprofile] [and] [3] -\installspecial [\dostopgotoprofile] [and] [0] -\installspecial [\dobeginofprofile] [and] [4] -\installspecial [\doendofprofile] [and] [0] - -%D \macros -%D {doinsertbookmark} -%D -%D Bookmarks, that is viewer generated tables of contents, are -%D a strange phenomena, mainly because \TEX\ can provide -%D whatever kind of table in much better quality. - -\installspecial [\doinsertbookmark] [and] [5] - -%D This special is called as: -%D -%D \starttyping -%D \doinstallbookmark {level} {nofsubentries} {text} {page} {open} -%D \stoptyping -%D -%D This definition is very \PDF\ oriented, so for more -%D information we kindly refer to the \PDF\ manuals. - -%D \macros -%D {dosetpagetransition} -%D -%D In presentations, fancy page transitions can, at least for a -%D short moment, let the audience focus at the screen. Like the -%D previous one, this special is very \PDF. -%D -%D \starttyping -%D \dosetpagetransition{dissolve}{0} -%D \stoptyping -%D -%D Transitions have symbolic names, like dissolve, box, split, -%D blinds, wipe and glitter. The second argument determines -%D the wait time (unless zero). - -\installspecial [\dosetpagetransition] [or] [2] - -%D \macros -%D {dopresettextfield,dopresetlinefield, -%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, -%D dopresetbuttonfield,dopresetcheckfield, -%D dopresetradiofield,dopresetradiorecord} -%D -%D The special drivers are programmed independant from their -%D calling macros are thereby use the standard \TEX\ way of -%D passing parameters. Unfortunately fields often have more -%D than nine characteristics, so we pack some arguments in one. -%D -%D \starttyping -%D \dopresettextfield / \dopresetlinefield -%D {name} {width} {height} {default} {length} -%D {style,color} {options} {alignment} {actions} -%D -%D \dopresetchoicefield / \dopresetpopupfield / \dopresetcombofield -%D {name} {width} {height} {default} -%D {style,color} {options} {values} {actions} -%D -%D \dopresetpushfield -%D {name} {width} {height} {default} -%D {options} {values} {actions} -%D -%D \dopresetcheckfield -%D {name} {width} {height} {default} -%D {options} {values} {actions} -%D -%D \dopresetradiofield -%D {name} {width} {height} {default} -%D {options} {parent} {values} {actions} -%D -%D \dopresetradiorecord -%D {name} {top} {options} {kids} {actions} -%D \stoptyping - -\installspecial [\dopresetlinefield] [or] [9] -\installspecial [\dopresettextfield] [or] [9] -\installspecial [\dopresetchoicefield] [or] [8] -\installspecial [\dopresetpopupfield] [or] [8] -\installspecial [\dopresetcombofield] [or] [8] -\installspecial [\dopresetpushfield] [or] [7] -\installspecial [\dopresetcheckfield] [or] [7] -\installspecial [\dopresetradiofield] [or] [8] -\installspecial [\dopresetradiorecord] [or] [5] - -%D \macros -%D {dodefinefieldset,dogetfieldset,doiffieldset} -%D -%D Field sets, used in resetting and submitting, are handled -%D by: - -\installspecial [\dodefinefieldset] [or] [2] -\installspecial [\dogetfieldset] [or] [1] -\installspecial [\doiffieldset] [or] [2] - -%D \macros -%D {dosetfieldstatus} -%D -%D For practical reasons we set some field characteristics -%D using: -%D -%D \starttyping -%D \dosetfieldstatus {mode} {parent} {kids} {root} -%D \stoptyping - -\installspecial [\dosetfieldstatus] [or] [4] - -%D with: - -\def\fieldlonermode {0} % no \chardef here -\def\fieldparentmode{1} % no \chardef here -\def\fieldchildmode {2} % no \chardef here -\def\fieldcopymode {3} % no \chardef here - -%D \macros -%D {doregistercalculationset} -%D -%D We can define a calculation order list with: -%D -%D \starttyping -%D \doregistercalculationset {set identifier} -%D \stoptyping - -\installspecial [\doregistercalculationset] [or] [1] - -%D \macros -%D {doinsertcomment, doflushcomments} -%D -%D Not so much out of need, but to be complete, we also -%D implement text annotations, so called comment: -%D -%D \starttyping -%D \doinsertcomment -%D {title} {width} {height} {color} {open} {symbol} {collect} {data} -%D \stoptyping -%D -%D When enables, comments can be collected and flushed: -%D -%D \starttyping -%D \doflushcomments -%D \stoptyping - -\installspecial[\doinsertcomment] [and] [8] -\installspecial[\doflushcomments] [and] [0] - -%D \macros -%D {dosetposition, dosetpositionwhd, dosetpositionplus, -%D dosetpositionpapersize} -%D -%D Not natural to \TEX, but available in \PDFTEX, and by -%D means of postprocessed \DVI, we can save and call upon -%D positions. -%D -%D \starttyping -%D \dosetposition {identifier} -%D \dosetpositionwhd {identifier} {width} {height} {depth} -%D \dosetpositionplus {identifier} {width} {height} {depth} {list} -%D \dosetpositionpapersize {width} {height} -%D \stoptyping -%D -%D This is one of the few specials where when using \PDFTEX\ -%D the driver directly deals with the utility file. - -%D Support is moved to spec-mis.tex. The whole idea originates -%D and was implemented first in \PDFTEX. Later \DVIPDFMX\ -%D supported the \CONTEXT\ specific specials and nowadays -%D \PDFTEX\ supports this feature in \DVI\ mode and \XETEX\ -%D implements it as well. This means that only \ALEPH\ is -%D still dependent on specials, but that variant of \TEX\ has -%D become obsolete anyway. - -% \installspecial [\dosetposition] [or] [1] -% \installspecial [\dosetpositionwhd] [or] [4] -% \installspecial [\dosetpositionplus] [or] [5] - -% \installspecial [\dosetpositionpapersize] [or] [2] - -%D \macros -%D {dostarttransparency,dostoptransparency} -%D -%D \starttyping -%D \dostarttransparency{fraction}{type} -%D \dostoptransparency -%D \stoptyping -%D -%D Although in \CONTEXT\ transparency is closely integrated -%D in the color drivers, in the end it is an independent -%D feature. - -\installspecial [\dostarttransparency] [or] [2] -\installspecial [\dostoptransparency] [or] [0] - -%D \macros -%D {doattachfile} -%D -%D \starttyping -%D \doattachfile{title}{width}{height}{depth}{color}{symbol}{filename}{source} -%D \stoptyping - -\installspecial [\doattachfile] [or] [8] - -%D Experimental (properties): - -\installspecial[\dostartviewerlayer] [or] [1] -\installspecial[\dostopviewerlayer] [or] [0] -\installspecial[\dodefineviewerlayer] [or] [5] -%installspecial[\doflushviewertextlayers] [or] [0] -%installspecial[\doflushviewerpagelayers] [or] [0] -\installspecial[\domakeviewerlayerlist] [or] [1] - -\installspecial[\doinsertrenderingwindow] [or] [4] -\installspecial[\doinsertrendering] [or] [4] -\installspecial[\doinsertrenderingobject] [or] [4] -\installspecial[\doinsertrenderingobject] [or] [4] - -\installspecial[\dostartfonteffect] [or] [3] -\installspecial[\dostopfonteffect] [or] [0] - -%D From now on, mapfile loading is also a special; we assume the -%D more or less standard dvips syntax. - -\installspecial[\doresetmapfilelist] [and] [0] -\installspecial[\doloadmapfile] [and] [2] % + - = | filename -\installspecial[\doloadmapline] [and] [2] % + - = | fileline - -%D We define a couple of backends: - -\defineoutput [dvipsone] [dvi,ps,yy] -\defineoutput [dviwindo] [dvi,ps,yy,win] -\defineoutput [dvips] [dvi,ps,tr] -\defineoutput [dviview] [dvi,ps,tr,dv] -\defineoutput [pdftex] [tpd] -\defineoutput [pdf] [tpd] -\defineoutput [dvipdfm] [dpm] -\defineoutput [dpm] [dpm] -\defineoutput [dvipdfmx] [dpx] -\defineoutput [dpx] [dpx] -\defineoutput [acrobat] [pdf,ps,tr] - -\defineoutput [xetex] [dpx,xet] -\defineoutput [xtx] [dpx,xet] -\defineoutput [xdv] [dvi,xtx,xet] -\defineoutput [xdv2pdf] [dvi,xtx,xet] - -%D We don't enable \ACROBAT, because pure \POSTSCRIPT\ is not -%D that strong on objects and \PDFTEX\ does a better job. -%D Some reasonable alternatives are: -%D -%D \starttyping -%D \setupoutput [dvipsone,acrobat] -%D \setupoutput [dviwindo,acrobat] -%D \stoptyping -%D -%D Although, better is: -%D -%D \starttyping -%D \setupoutput [pdftex] -%D \stoptyping - -%D Please let me know if we need more. From now on we default -%D to: - -\appendtoks - \setupoutput[dvips]% -\to \everydump - -\protect \endinput diff --git a/tex/context/base/spec-dpm.mkii b/tex/context/base/spec-dpm.mkii new file mode 100644 index 000000000..9cf023fe0 --- /dev/null +++ b/tex/context/base/spec-dpm.mkii @@ -0,0 +1,445 @@ +%D \module +%D [ file=spec-dpm, +%D version=1998.11.24, +%D title=\CONTEXT\ Special Macros, +%D subtitle=DVIPDFM support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 driver is build on top of the general \PDF\ macros, +%D as defined in \type{spec-fdf}, so we inherit that one. Remark: +%D this driver is no longer actively maintained, use the dpx one +%D instead! + +\startspecials[dpm][reset,fdf] + +%D \macros +%D {jobsuffix} +%D +%D Because no intermediate output format is used, we set the +%D jobsuffix to \PDF. + +\setjobsuffix{pdf} + +%D Literal \PDF\ inclusion is implemented as: + +\def\PDFcode #1{\special{pdf: content #1}} +\def\PDFcontentcode#1{\special{pdf: content #1}} +\def\PDFdirectcode #1{\special{pdf: literal #1}} + +%D \macros +%D {dosetuppaper} +%D +%D A simple one. + +\def\doDPMsetuppaper#1#2#3% + {\bgroup + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \special{pdf: pagesize width \width height \height}% + \global\let\doDPMsetuppaper\gobblethreearguments + \egroup} + +\definespecial\dosetuppaper#1#2#3% + {\doDPMsetuppaper{#1}{#2}{#3}} + +%D \macros +%D {doinsertfile} +%D +%D Only \METAPOST, \JPG\ and \PDF\ inclusion are supported. + +\definespecial\doinsertfile + {\dofileinsertion{dpm}\@@DriverImageType} + +\definefileinsertion{dpm}{mps}% + {\PointsToWholeBigPoints\@@DriverImageWidth \width + \PointsToWholeBigPoints\@@DriverImageHeight\height + \special + {PSfile="\@@DriverImageFile"\space + llx=\EPSllx\space lly=\EPSlly\space + urx=\EPSurx\space ury=\EPSury\space + rwi=\width0\space rhi=\height0}} + +\definefileinsertion{dpm}{pdf}% + {\special{pdf: epdf + width \@@DriverImageWidth \space + height \@@DriverImageHeight\space + (\@@DriverImageFile)}} + +\definefileinsertion{dpm}{jpg}% + {\special{pdf: image + width \@@DriverImageWidth \space + height \@@DriverImageHeight\space + (\@@DriverImageFile)}} + +\definefileinsertion{dpm}{mov}{\doPDFinsertmov} +\definefileinsertion{dpm}{avi}{\doPDFinsertmov} + +%D \macros +%D {doinsertsoundtrack} +%D +%D Sounds are supported too. + +\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack} + +%D \macros +%D {doovalbox} + +\definespecial\doovalbox{\doPDFovalbox} + +%D \macros +%D {dostartgraymode,dostopgraymode, +%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode, +%D dostopcolormode, +%D dostartrotation,dostoprotation, +%D dostartscaling,dostopscaling, +%D dostartmirroring,dostopmirroring, +%D dostartnegative,dostopnegative} +%D +%D Unfortunately the direct \PDF\ inclusion is not suited +%D for the next macros, which means that we cannot use the +%D \type {\doPDF..} alternatives. Since \CONTEXT\ maintains +%D its own colorstack, we use the \DVIPS\ alternatives. + +\definespecial\dostartgraymode #1{\special{color gray #1}} +\definespecial\dostopgraymode {\special{color gray 0}} +\definespecial\dostartrgbcolormode #1#2#3{\special{color rgb #1 #2 #3}} +\definespecial\dostartcmykcolormode#1#2#3#4{\special{color cmyk #1 #2 #3 #4}} +\definespecial\dostartgraycolormode #1{\special{color gray #1}} +\definespecial\dostopcolormode {\special{color gray 0}} +\definespecial\dostartrotation #1{\special{pdf: bt rotate #1}} +\definespecial\dostoprotation {\special{pdf: et}} +\definespecial\dostartscaling #1#2{\special{pdf: bt xscale #1 yscale #2}} +\definespecial\dostopscaling {\special{pdf: et}} +\definespecial\dostartmirroring {\special{pdf: bt xscale -1}} % ? +\definespecial\dostopmirroring {\special{pdf: et}} + +%D Negation is not (yet) supported: + +% \definespecial\dostartnegative {} +% \definespecial\dostopnegative {} +% \definespecial\dostarttransparency {} +% \definespecial\dostoptransparency {} + + +%D \macros +%D {dosetupinteraction, +%D dosetupopenaction,dosetupcloseaction} + +\definespecial\dosetupinteraction% + {\showmessage\m!interactions{21}{DVIPDFM}} + +\definespecial\dosetupopenaction {\doPDFsetupopenaction} +\definespecial\dosetupcloseaction{\doPDFsetupcloseaction} + +%D \macros +%D {doresetgotowhereever, +%D dostartthisisrealpage,dostartthisislocation, +%D dostartgotorealpage,dostartgotolocation,dostartgotoJS} + +\definespecial\doresetgotowhereever {\doPDFresetgotowhereever} +\definespecial\dostartthisislocation{\doPDFstartthisislocation} + +\definespecial\dostartgotolocation{\doPDFstartgotolocation} +\definespecial\dostartgotorealpage{\doPDFstartgotorealpage} +\definespecial\dostartgotoJS {\doPDFstartgotoJS} + +%D \macros +%D {doflushJSpreamble} + +\definespecial\doflushJSpreamble#1% + {\bgroup + \let\compositeJScode=\empty + \def\docommand##1% + {\edef\sanitizedJScode{\getJSpreamble{##1}}% + \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode + \special{pdf: object @JS:#1 <>}% + \edef\compositeJScode{\compositeJScode\space (##1) @JS:#1}}% + \processcommalist[#1]\docommand + \special{pdf: object @JS:JS <>}% + \special{pdf: put @names <>}% + \egroup} + +%D \macros +%D {dostarthide,dostophide} + +\definespecial\dostarthide{} +\definespecial\dostophide {} + +%D \macros +%D {dosetupscreen} + +\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight} + +\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight} +\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight} +\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight} +\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight} + +%D \macros +%D {dostartexecutecommand} + +\definespecial\dostartexecutecommand{\doPDFstartexecutecommand} + +%D \macros +%D {dosetupidentity} + +\definespecial\dosetupidentity{\doPDFsetupidentity} + +%D \macros +%D {dostartrunprogam} + +\definespecial\dostartrunprogram{\doPDFstartrunprogram} + +%D \macros +%D {dostartgotoprofile, dostopgotoprofile, +%D dobeginofprofile, doendofprofile} + +\definespecial\dostartgotoprofile{\doPDFstartgotoprofile} + +\definespecial\dobeginofprofile#1#2#3#4% + {\bgroup + \setPDFdestination{#1}% + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \doifsomething{\PDFdestination} + {\special + {pdf: thread @ART::\PDFdestination\space + width \width height \height + <>}}% + \egroup} + +\definespecial\doendofprofile% + {} + +%D \macros +%D {doinsertbookmark} + +\definespecial\doinsertbookmark{\doPDFinsertbookmark} + +%D \macros +%D {dostartobject,dostopobject,doinsertobject} + +% \definespecial\dostartobject#1#2#3#4#5% +% {\bgroup +% \setbox\nextbox=\hbox\bgroup +% \dosetobjectreference{#1}{#2}{#1::#2}% +% \scratchdimen#3\edef\width {\the\scratchdimen\space}% +% \scratchdimen#4\edef\height{\the\scratchdimen\space}% +% \special{pdf: bxobj @#1::#2 width \width height \height}} + +% \definespecial\dostopobject% +% {\special{pdf: exobj}% +% \egroup +% \smashbox\nextbox +% \flushatshipout{\box\nextbox}% +% \egroup} + +\definespecial\dostartobject#1#2#3#4#5% + {\bgroup + \dowithnextbox + {\dosetobjectreference{#1}{#2}{#1::#2}% + \scratchdimen#3\edef\width {\the\scratchdimen\space}% + \scratchdimen#4\edef\height{\the\scratchdimen\space}% + \setbox\nextbox\vbox + {\special{pdf: bxobj @#1::#2 width \width height \height}% + % we need to compensate for the box offset (ugly, sigh) + \scratchdimen\nextboxht + \advance\scratchdimen\nextboxdp + \advance\scratchdimen-#4\relax + \nextboxdp\zeropoint + \nextboxht\zeropoint + \hbox to #3{\hss\lower.5\scratchdimen\box\nextbox\hss}% + \special{pdf: exobj}% + \global\let\currentPDFresources\empty}% + \smashbox\nextbox + \flushatshipout{\box\nextbox}% + \egroup}% + \hbox\bgroup} + +\definespecial\dostopobject + {\egroup} + + +\definespecial\doinsertobject#1#2% + {\hbox + {\dogetobjectreference{#1}{#2}\PDFobjectreference + \ifx\PDFobjectreference\empty \else + \special{pdf: usexobj @#1::#2}% + \fi}} + +%D \macros +%D {dosetpagetransition} + +\definespecial\dosetpagetransition{\doPDFsetpagetransition} + +%D \macros +%D {doinsertcomment, doflushcomments} + +\definespecial\doinsertcomment{\doPDFinsertcomment} +\definespecial\doflushcomments{\doPDFflushcomments} + +%D \macros +%D {dopresetlinefield,dopresettextfield, +%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, +%D dopresetpushfield,dopresetcheckfield, +%D dopresetradiofield,dopresetradiorecord} + +\definespecial\dopresetlinefield {\doFDFpresetlinefield} +\definespecial\dopresettextfield {\doFDFpresettextfield} +\definespecial\dopresetchoicefield{\doFDFpresetchoicefield} +\definespecial\dopresetpopupfield {\doFDFpresetpopupfield} +\definespecial\dopresetcombofield {\doFDFpresetcombofield} +\definespecial\dopresetpushfield {\doFDFpresetpushfield} +\definespecial\dopresetcheckfield {\doFDFpresetcheckfield} +\definespecial\dopresetradiofield {\doFDFpresetradiofield} +\definespecial\dopresetradiorecord{\doFDFpresetradiorecord} + +%D \macros +%D {dodefinefieldset,dogetfieldset,doiffieldset} + +\definespecial\dodefinefieldset{\doFDFdefinefieldset} +\definespecial\dogetfieldset {\doFDFgetfieldset} +\definespecial\doiffieldset {\doFDFiffieldset} + +%D \macros +%D {doregistercalculationset} + +\definespecial\doregistercalculationset{\doFDFregistercalculationset} + +%D \macros +%D {doPDFdestination} + +\def\doPDFdestination#1% + {\special{pdf: dest (#1) [@thispage /View [/Fit]]}} + +%D \macros +%D {doPDFaction,doPDFannotation,ifsharePDFactions} +%D +%D Sharing is not yet supported. + +\newif\ifsharePDFactions \sharePDFactionsfalse + +\def\dodoPDFaction#1#2#3#4% + {\ifcollectreferenceactions + \xdef\lastPDFaction{#4}% + \else + \bgroup + % this is yet untested + %\ifsharePDFactions + % \ifcase\similarreference\relax + % \xdef\lastPDFaction{<<#4>>}% + % \or + % \global\advance\nofPDFsimilar by 1 + % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#4>>}% + % \xdef\lastPDFaction{@PDF::sim:\the\nofPDFsimilar}% + % \else + % % leave \lastPDFaction untouched + % \fi + %\else + \xdef\lastPDFaction{<<#4>>}% + %\fi + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \special{pdf: ann #1 width \width height \height + <>}% + \egroup + \fi} + +\def\doPDFaction#1#2#3% + {\dodoPDFaction\empty{#1}{#2}{#3}} + +\def\doPDFannotation#1#2#3% + {\bgroup + \scratchdimen#1\edef\width {\the\scratchdimen\space}% + \scratchdimen#2\edef\height{\the\scratchdimen\space}% + \special{pdf: ann width \width height \height + <>}% + \egroup} + +%D \macros +%D {doPDFannotationobject,doPDFactionobject} + +\def\doPDFannotationobject#1#2#3#4#5% + {\bgroup + \scratchdimen#3\edef\width {\the\scratchdimen\space}% + \scratchdimen#4\edef\height{\the\scratchdimen\space}% + \special{pdf: ann @#1::#2 width \width height \height <<#5>>}% + \dosetobjectreference{#1}{#2}{@#1::#2}% + \egroup} + +\def\doPDFactionobject#1#2#3#4#5% + {\dodoPDFaction{@#1::#2}{#3}{#4}{#5}% + \dosetobjectreference{#1}{#2}{#1::#2}} + +%D \macros +%D {doPDFaddtocatalog,doPDFaddtoinfo, +%D doPDFpageattribute,doPDFpagesattribute} + +\def\doPDFaddtocatalog#1% + {\special{pdf: put @catalog <<#1>>}} + +\def\doPDFaddtoinfo#1% Is this auto appended? Not checked! + {\special{pdf: docinfo <<#1>>}} % put @docinfo <<#1>>}} + +\def\doPDFpageattribute#1% + {\special{pdf: put @thispage <<#1>>}} + +\def\doPDFpagesattribute#1% + {\special{pdf: put @pages <<#1>>}} + +\def\doPDFpageresource#1% + {\message{[skipping PDF resource]}} + +\let\doPDFresetpageresources \relax +\let\doPDFresetpageattributes\relax + +%D \macros +%D {doPDFbookmark} + +\def\doPDFbookmark#1#2#3#4#5% + {\ifcase#2\else + \scratchcounter#4\advance\scratchcounter\minusone + \special{pdf: out \ifcase#5-\fi#2 + % <>}% + <> >>}% + \fi} + +%D \macros +%D {doPDFdictionaryobject,doPDFarrayobject} + +\def\doPDFdictionaryobject#1#2#3% + {\special{pdf: object @#1::#2 <<#3>>}} + +\def\doPDFarrayobject#1#2#3% + {\special{pdf: object @#1::#2 [#3]}} + +%D \macros +%D {defaultobjectreference,doPDFgetobjectreference} + +\def\defaultobjectreference#1#2{#1::#2} + +\def\doPDFgetobjectreference#1#2#3% + {\dogetobjectreference{#1}{#2}#3% + \ifx#3\empty\else\edef#3{{#3}}\fi} + +% \def\doPDFgetobjectpage #1#2#3{..} +% \def\doPDFgetobjectpagereference#1#2#3{..} + +\def\doPDFgetpagereference#1#2% + {\edef#2{@page#1}} + +%D Done. + +\stopspecials + +\protect \endinput diff --git a/tex/context/base/spec-dpm.tex b/tex/context/base/spec-dpm.tex deleted file mode 100644 index 9cf023fe0..000000000 --- a/tex/context/base/spec-dpm.tex +++ /dev/null @@ -1,445 +0,0 @@ -%D \module -%D [ file=spec-dpm, -%D version=1998.11.24, -%D title=\CONTEXT\ Special Macros, -%D subtitle=DVIPDFM support, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 driver is build on top of the general \PDF\ macros, -%D as defined in \type{spec-fdf}, so we inherit that one. Remark: -%D this driver is no longer actively maintained, use the dpx one -%D instead! - -\startspecials[dpm][reset,fdf] - -%D \macros -%D {jobsuffix} -%D -%D Because no intermediate output format is used, we set the -%D jobsuffix to \PDF. - -\setjobsuffix{pdf} - -%D Literal \PDF\ inclusion is implemented as: - -\def\PDFcode #1{\special{pdf: content #1}} -\def\PDFcontentcode#1{\special{pdf: content #1}} -\def\PDFdirectcode #1{\special{pdf: literal #1}} - -%D \macros -%D {dosetuppaper} -%D -%D A simple one. - -\def\doDPMsetuppaper#1#2#3% - {\bgroup - \scratchdimen#2\edef\width {\the\scratchdimen\space}% - \scratchdimen#3\edef\height{\the\scratchdimen\space}% - \special{pdf: pagesize width \width height \height}% - \global\let\doDPMsetuppaper\gobblethreearguments - \egroup} - -\definespecial\dosetuppaper#1#2#3% - {\doDPMsetuppaper{#1}{#2}{#3}} - -%D \macros -%D {doinsertfile} -%D -%D Only \METAPOST, \JPG\ and \PDF\ inclusion are supported. - -\definespecial\doinsertfile - {\dofileinsertion{dpm}\@@DriverImageType} - -\definefileinsertion{dpm}{mps}% - {\PointsToWholeBigPoints\@@DriverImageWidth \width - \PointsToWholeBigPoints\@@DriverImageHeight\height - \special - {PSfile="\@@DriverImageFile"\space - llx=\EPSllx\space lly=\EPSlly\space - urx=\EPSurx\space ury=\EPSury\space - rwi=\width0\space rhi=\height0}} - -\definefileinsertion{dpm}{pdf}% - {\special{pdf: epdf - width \@@DriverImageWidth \space - height \@@DriverImageHeight\space - (\@@DriverImageFile)}} - -\definefileinsertion{dpm}{jpg}% - {\special{pdf: image - width \@@DriverImageWidth \space - height \@@DriverImageHeight\space - (\@@DriverImageFile)}} - -\definefileinsertion{dpm}{mov}{\doPDFinsertmov} -\definefileinsertion{dpm}{avi}{\doPDFinsertmov} - -%D \macros -%D {doinsertsoundtrack} -%D -%D Sounds are supported too. - -\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack} - -%D \macros -%D {doovalbox} - -\definespecial\doovalbox{\doPDFovalbox} - -%D \macros -%D {dostartgraymode,dostopgraymode, -%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode, -%D dostopcolormode, -%D dostartrotation,dostoprotation, -%D dostartscaling,dostopscaling, -%D dostartmirroring,dostopmirroring, -%D dostartnegative,dostopnegative} -%D -%D Unfortunately the direct \PDF\ inclusion is not suited -%D for the next macros, which means that we cannot use the -%D \type {\doPDF..} alternatives. Since \CONTEXT\ maintains -%D its own colorstack, we use the \DVIPS\ alternatives. - -\definespecial\dostartgraymode #1{\special{color gray #1}} -\definespecial\dostopgraymode {\special{color gray 0}} -\definespecial\dostartrgbcolormode #1#2#3{\special{color rgb #1 #2 #3}} -\definespecial\dostartcmykcolormode#1#2#3#4{\special{color cmyk #1 #2 #3 #4}} -\definespecial\dostartgraycolormode #1{\special{color gray #1}} -\definespecial\dostopcolormode {\special{color gray 0}} -\definespecial\dostartrotation #1{\special{pdf: bt rotate #1}} -\definespecial\dostoprotation {\special{pdf: et}} -\definespecial\dostartscaling #1#2{\special{pdf: bt xscale #1 yscale #2}} -\definespecial\dostopscaling {\special{pdf: et}} -\definespecial\dostartmirroring {\special{pdf: bt xscale -1}} % ? -\definespecial\dostopmirroring {\special{pdf: et}} - -%D Negation is not (yet) supported: - -% \definespecial\dostartnegative {} -% \definespecial\dostopnegative {} -% \definespecial\dostarttransparency {} -% \definespecial\dostoptransparency {} - - -%D \macros -%D {dosetupinteraction, -%D dosetupopenaction,dosetupcloseaction} - -\definespecial\dosetupinteraction% - {\showmessage\m!interactions{21}{DVIPDFM}} - -\definespecial\dosetupopenaction {\doPDFsetupopenaction} -\definespecial\dosetupcloseaction{\doPDFsetupcloseaction} - -%D \macros -%D {doresetgotowhereever, -%D dostartthisisrealpage,dostartthisislocation, -%D dostartgotorealpage,dostartgotolocation,dostartgotoJS} - -\definespecial\doresetgotowhereever {\doPDFresetgotowhereever} -\definespecial\dostartthisislocation{\doPDFstartthisislocation} - -\definespecial\dostartgotolocation{\doPDFstartgotolocation} -\definespecial\dostartgotorealpage{\doPDFstartgotorealpage} -\definespecial\dostartgotoJS {\doPDFstartgotoJS} - -%D \macros -%D {doflushJSpreamble} - -\definespecial\doflushJSpreamble#1% - {\bgroup - \let\compositeJScode=\empty - \def\docommand##1% - {\edef\sanitizedJScode{\getJSpreamble{##1}}% - \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode - \special{pdf: object @JS:#1 <>}% - \edef\compositeJScode{\compositeJScode\space (##1) @JS:#1}}% - \processcommalist[#1]\docommand - \special{pdf: object @JS:JS <>}% - \special{pdf: put @names <>}% - \egroup} - -%D \macros -%D {dostarthide,dostophide} - -\definespecial\dostarthide{} -\definespecial\dostophide {} - -%D \macros -%D {dosetupscreen} - -\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight} - -\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight} -\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight} -\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight} -\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight} - -%D \macros -%D {dostartexecutecommand} - -\definespecial\dostartexecutecommand{\doPDFstartexecutecommand} - -%D \macros -%D {dosetupidentity} - -\definespecial\dosetupidentity{\doPDFsetupidentity} - -%D \macros -%D {dostartrunprogam} - -\definespecial\dostartrunprogram{\doPDFstartrunprogram} - -%D \macros -%D {dostartgotoprofile, dostopgotoprofile, -%D dobeginofprofile, doendofprofile} - -\definespecial\dostartgotoprofile{\doPDFstartgotoprofile} - -\definespecial\dobeginofprofile#1#2#3#4% - {\bgroup - \setPDFdestination{#1}% - \scratchdimen#2\edef\width {\the\scratchdimen\space}% - \scratchdimen#3\edef\height{\the\scratchdimen\space}% - \doifsomething{\PDFdestination} - {\special - {pdf: thread @ART::\PDFdestination\space - width \width height \height - <>}}% - \egroup} - -\definespecial\doendofprofile% - {} - -%D \macros -%D {doinsertbookmark} - -\definespecial\doinsertbookmark{\doPDFinsertbookmark} - -%D \macros -%D {dostartobject,dostopobject,doinsertobject} - -% \definespecial\dostartobject#1#2#3#4#5% -% {\bgroup -% \setbox\nextbox=\hbox\bgroup -% \dosetobjectreference{#1}{#2}{#1::#2}% -% \scratchdimen#3\edef\width {\the\scratchdimen\space}% -% \scratchdimen#4\edef\height{\the\scratchdimen\space}% -% \special{pdf: bxobj @#1::#2 width \width height \height}} - -% \definespecial\dostopobject% -% {\special{pdf: exobj}% -% \egroup -% \smashbox\nextbox -% \flushatshipout{\box\nextbox}% -% \egroup} - -\definespecial\dostartobject#1#2#3#4#5% - {\bgroup - \dowithnextbox - {\dosetobjectreference{#1}{#2}{#1::#2}% - \scratchdimen#3\edef\width {\the\scratchdimen\space}% - \scratchdimen#4\edef\height{\the\scratchdimen\space}% - \setbox\nextbox\vbox - {\special{pdf: bxobj @#1::#2 width \width height \height}% - % we need to compensate for the box offset (ugly, sigh) - \scratchdimen\nextboxht - \advance\scratchdimen\nextboxdp - \advance\scratchdimen-#4\relax - \nextboxdp\zeropoint - \nextboxht\zeropoint - \hbox to #3{\hss\lower.5\scratchdimen\box\nextbox\hss}% - \special{pdf: exobj}% - \global\let\currentPDFresources\empty}% - \smashbox\nextbox - \flushatshipout{\box\nextbox}% - \egroup}% - \hbox\bgroup} - -\definespecial\dostopobject - {\egroup} - - -\definespecial\doinsertobject#1#2% - {\hbox - {\dogetobjectreference{#1}{#2}\PDFobjectreference - \ifx\PDFobjectreference\empty \else - \special{pdf: usexobj @#1::#2}% - \fi}} - -%D \macros -%D {dosetpagetransition} - -\definespecial\dosetpagetransition{\doPDFsetpagetransition} - -%D \macros -%D {doinsertcomment, doflushcomments} - -\definespecial\doinsertcomment{\doPDFinsertcomment} -\definespecial\doflushcomments{\doPDFflushcomments} - -%D \macros -%D {dopresetlinefield,dopresettextfield, -%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, -%D dopresetpushfield,dopresetcheckfield, -%D dopresetradiofield,dopresetradiorecord} - -\definespecial\dopresetlinefield {\doFDFpresetlinefield} -\definespecial\dopresettextfield {\doFDFpresettextfield} -\definespecial\dopresetchoicefield{\doFDFpresetchoicefield} -\definespecial\dopresetpopupfield {\doFDFpresetpopupfield} -\definespecial\dopresetcombofield {\doFDFpresetcombofield} -\definespecial\dopresetpushfield {\doFDFpresetpushfield} -\definespecial\dopresetcheckfield {\doFDFpresetcheckfield} -\definespecial\dopresetradiofield {\doFDFpresetradiofield} -\definespecial\dopresetradiorecord{\doFDFpresetradiorecord} - -%D \macros -%D {dodefinefieldset,dogetfieldset,doiffieldset} - -\definespecial\dodefinefieldset{\doFDFdefinefieldset} -\definespecial\dogetfieldset {\doFDFgetfieldset} -\definespecial\doiffieldset {\doFDFiffieldset} - -%D \macros -%D {doregistercalculationset} - -\definespecial\doregistercalculationset{\doFDFregistercalculationset} - -%D \macros -%D {doPDFdestination} - -\def\doPDFdestination#1% - {\special{pdf: dest (#1) [@thispage /View [/Fit]]}} - -%D \macros -%D {doPDFaction,doPDFannotation,ifsharePDFactions} -%D -%D Sharing is not yet supported. - -\newif\ifsharePDFactions \sharePDFactionsfalse - -\def\dodoPDFaction#1#2#3#4% - {\ifcollectreferenceactions - \xdef\lastPDFaction{#4}% - \else - \bgroup - % this is yet untested - %\ifsharePDFactions - % \ifcase\similarreference\relax - % \xdef\lastPDFaction{<<#4>>}% - % \or - % \global\advance\nofPDFsimilar by 1 - % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#4>>}% - % \xdef\lastPDFaction{@PDF::sim:\the\nofPDFsimilar}% - % \else - % % leave \lastPDFaction untouched - % \fi - %\else - \xdef\lastPDFaction{<<#4>>}% - %\fi - \scratchdimen#2\edef\width {\the\scratchdimen\space}% - \scratchdimen#3\edef\height{\the\scratchdimen\space}% - \special{pdf: ann #1 width \width height \height - <>}% - \egroup - \fi} - -\def\doPDFaction#1#2#3% - {\dodoPDFaction\empty{#1}{#2}{#3}} - -\def\doPDFannotation#1#2#3% - {\bgroup - \scratchdimen#1\edef\width {\the\scratchdimen\space}% - \scratchdimen#2\edef\height{\the\scratchdimen\space}% - \special{pdf: ann width \width height \height - <>}% - \egroup} - -%D \macros -%D {doPDFannotationobject,doPDFactionobject} - -\def\doPDFannotationobject#1#2#3#4#5% - {\bgroup - \scratchdimen#3\edef\width {\the\scratchdimen\space}% - \scratchdimen#4\edef\height{\the\scratchdimen\space}% - \special{pdf: ann @#1::#2 width \width height \height <<#5>>}% - \dosetobjectreference{#1}{#2}{@#1::#2}% - \egroup} - -\def\doPDFactionobject#1#2#3#4#5% - {\dodoPDFaction{@#1::#2}{#3}{#4}{#5}% - \dosetobjectreference{#1}{#2}{#1::#2}} - -%D \macros -%D {doPDFaddtocatalog,doPDFaddtoinfo, -%D doPDFpageattribute,doPDFpagesattribute} - -\def\doPDFaddtocatalog#1% - {\special{pdf: put @catalog <<#1>>}} - -\def\doPDFaddtoinfo#1% Is this auto appended? Not checked! - {\special{pdf: docinfo <<#1>>}} % put @docinfo <<#1>>}} - -\def\doPDFpageattribute#1% - {\special{pdf: put @thispage <<#1>>}} - -\def\doPDFpagesattribute#1% - {\special{pdf: put @pages <<#1>>}} - -\def\doPDFpageresource#1% - {\message{[skipping PDF resource]}} - -\let\doPDFresetpageresources \relax -\let\doPDFresetpageattributes\relax - -%D \macros -%D {doPDFbookmark} - -\def\doPDFbookmark#1#2#3#4#5% - {\ifcase#2\else - \scratchcounter#4\advance\scratchcounter\minusone - \special{pdf: out \ifcase#5-\fi#2 - % <>}% - <> >>}% - \fi} - -%D \macros -%D {doPDFdictionaryobject,doPDFarrayobject} - -\def\doPDFdictionaryobject#1#2#3% - {\special{pdf: object @#1::#2 <<#3>>}} - -\def\doPDFarrayobject#1#2#3% - {\special{pdf: object @#1::#2 [#3]}} - -%D \macros -%D {defaultobjectreference,doPDFgetobjectreference} - -\def\defaultobjectreference#1#2{#1::#2} - -\def\doPDFgetobjectreference#1#2#3% - {\dogetobjectreference{#1}{#2}#3% - \ifx#3\empty\else\edef#3{{#3}}\fi} - -% \def\doPDFgetobjectpage #1#2#3{..} -% \def\doPDFgetobjectpagereference#1#2#3{..} - -\def\doPDFgetpagereference#1#2% - {\edef#2{@page#1}} - -%D Done. - -\stopspecials - -\protect \endinput diff --git a/tex/context/base/spec-dpx.mkii b/tex/context/base/spec-dpx.mkii new file mode 100644 index 000000000..ed49ea843 --- /dev/null +++ b/tex/context/base/spec-dpx.mkii @@ -0,0 +1,793 @@ +%D \module +%D [ file=spec-dpx, +%D version=2005.08.12, +%D title=\CONTEXT\ Special Macros, +%D subtitle=DVIPDFMx support, +%D author=Jin-Hwan Cho, +%D date=\currentdate, +%D copyright={Jin-Hwan Cho \& Hans Hagen}] +%C +%C DVIPDFMx is an eXtended version of the DVIPDFM, a DVI to PDF +%C translator, still under construction by Jin-Hwan Cho and +%C Shunsaku Hirata. +%C +%C It supports multi-byte character encodings and large character +%C sets for East Asian languages by CID-keyed font technology, +%C and many features including PDF encryption, PDF bookmarks and +%C annotations with Chinese, Japanese, Korean characters, etc. +%C +%C DVIPDFMx (and information) can be downloaded from: +%C +%C http://project.ktug.or.kr/dvipdfmx/ + +\unprotect + +%D This driver is built on top of the general \PDF\ macros, +%D as defined in \type{spec-fdf}, so we inherit that one. + +\startspecials[dpx][reset,fdf] + +%D 1. Modified codes from \type{spec-dpm} + +%D \macros +%D {jobsuffix} +%D +%D Because no intermediate output format is used, we set the +%D jobsuffix to \PDF. + +\setjobsuffix{pdf} + +%D Map files (experimental) + +\definespecial\doloadmapfile#1#2% + {\flushatshipout{\special{pdf:mapfile +#2}}} + +%D DVIPDFMx supports the special command \type{pdf: literal ...} +%D since the version \type{dvipdfmx-20021028}. +%D +%D 1. \type{pdf: literal #1} puts the given PDF commands \#1 +%D after changing the text matrix with \type{"1 0 0 1 x y cm"} +%D to set the current DVI position $(x,y)$ to the origin. +%D +%D 2. \type{pdf: literal reverse #1} puts the given PDF commands \#1 +%D after changing the text matrix with \type{"1 0 0 1 -x -y cm"}. +%D +%D 3. \type{pdf: literal direct #1} puts directly the given PDF +%D commands \#1 without changing the text matrix. +%D +%D Since the version \type{dvipdfmx-20050812}, the role of the special +%D command \type{pdf:literal} is changed so that +%D +%D 1. \type{pdf:literal #1} puts the given PDF commands \#1 +%D after changing the text matrix with \type{"1 0 0 1 x y cm"} +%D to set the current DVI position $(x,y)$ to the origin. After that +%D it restores the previous setting by changing the text matrix with +%D \type{"1 0 0 1 -x -y cm"}. +%D +%D 2. \type{pdf:literal direct #1} puts directly the given PDF commands +%D \type {#1} without changing the text matrix. +%D +%D Literal \PDF\ inclusion is implemented as: + +\def\PDFcode #1{\special{pdf:literal #1}} +\def\PDFcontentcode#1{\special{pdf:content #1}} +\def\PDFdirectcode #1{\special{pdf:literal direct #1}} + +%D \type{\dosetuppaper} in \type{spec-dpm} did not work properly +%D because DVIPDFM did not permit changing the page size. +%D +%D However, DVIPDFMx permits different page size in each page +%D since the version \type{dvipdfmx-20021028}. +%D +%D \macros +%D {dosetuppaper} +%D +%D A simple one. + +\let\PDFpagexyzspec\relax \def\PDFpagexyzspec{@xpos @ypos 0} % untested + +\definespecial\dosetuppaper#1#2#3% + {\bgroup + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \special{pdf:pagesize width \width height \height}% + \egroup} + +%D \macros +%D {doinsertfile} +%D +%D Only \METAPOST, \BMP\ \JPG\ \PNG\ and \PDF\ inclusion are supported. + +\definespecial\doinsertfile + {\dofileinsertion{dpx}\@@DriverImageType} + +%D Even though DVIPDFM supports \METAPOST directly, the funtionality +%D is not good. It conflicts much with \CONTEXT. +%D +%D So, \METAPOST will be treated as the same way as PDFTeX using +%D MPtoPDF in DVIPDFMx since the version \type{dvipdfmx-20021028}. + +%D DVIPDFM (and DVIPDFMx too) supports the image files with +%D the extension, \PDF, \JPG, \PNG, \BMP, and \EPS. + +% \def\handleepsimage +% {\PointsToWholeBigPoints\@@DriverImageWidth \width +% \PointsToWholeBigPoints\@@DriverImageHeight\height +% \special +% {PSfile="\@@DriverImageFile"\space +% llx=\EPSllx\space lly=\EPSlly\space +% urx=\EPSurx\space ury=\EPSury\space +% rwi=\width0\space rhi=\height0}} + +% \definefileinsertion{dpx}{mps}{\handleepsimage} + +\definefileinsertion{dpx}{mps} + {\hbox + {\convertMPtoPDF\@@DriverImageFile{1}{1}% + \global\let\PDFimagereference\empty}} + +\def\handlebmpimage + {\special{pdf: image + width \@@DriverImageWidth \space + height \@@DriverImageHeight\space + (\@@DriverImageFile)}} + +\definefileinsertion{dpx}{pdf}{\handlebmpimage} +\definefileinsertion{dpx}{jpg}{\handlebmpimage} +\definefileinsertion{dpx}{png}{\handlebmpimage} +\definefileinsertion{dpx}{bmp}{\handlebmpimage} + +\definefileinsertion{dpx}{mov}{\doPDFinsertmov} +\definefileinsertion{dpx}{avi}{\doPDFinsertmov} + +%D \macros +%D {doinsertsoundtrack} +%D +%D Sounds are supported too. + +\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack} + +%D \macros +%D {doovalbox} + +\definespecial\doovalbox{\doPDFovalbox} + +%D \macros +%D {dostartgraymode,dostopgraymode, +%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode, +%D dostopcolormode, +%D dostartrotation,dostoprotation, +%D dostartscaling,dostopscaling, +%D dostartmirroring,dostopmirroring, +%D dostartnegative,dostopnegative} +%D +%D Unfortunately the direct \PDF\ inclusion is not suited +%D for the next macros, which means that we cannot use the +%D \type {\doPDF..} alternatives. Since \CONTEXT\ maintains +%D its own colorstack, we use the \DVIPS\ alternatives. + +\definespecial\dostartgraymode {\doPDFstartgraymode} +\definespecial\dostopgraymode {\doPDFstopgraymode} +\definespecial\dostartrgbcolormode {\doPDFstartrgbcolormode} +\definespecial\dostartcmykcolormode{\doPDFstartcmykcolormode} +\definespecial\dostartgraycolormode{\doPDFstartgraycolormode} +\definespecial\dostartspotcolormode{\doPDFstartspotcolormode} +\definespecial\dostopcolormode {\doPDFstopcolormode} + +\definespecial\doregistercmykspotcolor{\doPDFregistercmykspotcolor} +\definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor} +\definespecial\doregistergrayspotcolor{\doPDFregistergrayspotcolor} + +\definespecial\doregistercmykindexcolor{\doPDFregistercmykindexcolor} +\definespecial\doregisterrgbindexcolor {\doPDFregisterrgbindexcolor} +\definespecial\doregistergrayindexcolor{\doPDFregistergrayindexcolor} + +\definespecial\doregisterfigurecolor{\doPDFregisterfigurecolor} + +\definespecial\dostartnonecolormode{\doPDFstartnonecolormode} +\definespecial\doregisternonecolor {\doPDFregisternonecolor} + +\definespecial\dostartrotation #1{\special{pdf:btrans rotate #1}} +\definespecial\dostoprotation {\special{pdf:etrans}} +\definespecial\dostartscaling#1#2{\special{pdf:btrans xscale #1 yscale #2}} +\definespecial\dostopscaling {\special{pdf:etrans}} +\definespecial\dostartmirroring {\special{pdf:btrans xscale -1}} +\definespecial\dostopmirroring {\special{pdf:etrans}} + +%D Negation is not (yet) supported: +\definespecial\dostartnegative {\doPDFstartnegative} +\definespecial\dostopnegative {\doPDFstopnegative} +\definespecial\dostartoverprint {\doPDFstartoverprint} +\definespecial\dostopoverprint {\doPDFstopoverprint} + +\definespecial\dostarttransparency{\doPDFstarttransparency} +\definespecial\dostoptransparency {\doPDFstoptransparency} + +\PDFtransparencysupportedtrue + +\def\@@PDT{@PDT@} + +\ifx\PDFcurrenttransparency\undefined + \newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1 +\fi + +\def\assignPDFtransparency#1#2% + {\def\PDFtransparencyidentifier{/Tr#1}% + \def\PDFtransparencyreference{@TR:#2}} % todo: \PDFobjref{TR:#2} + +\def\presetPDFtransparency#1#2% + {\initializePDFtransparency + \executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}} + +\def\dopresetPDFtransparency#1#2% + {\global\advance\PDFcurrenttransparency \plusone + \doPDFreserveDPXobject{TR:\the\PDFcurrenttransparency}{<< >>}% hack + \special{pdf:\doPDFcheckedDPXobject{TR:\the\PDFcurrenttransparency}\PDFtransparancydictionary{#1}{#2}{}}% + \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}% + \edef\PDFtransparencyreference {@TR:\the\PDFcurrenttransparency}% + \setxvalue{\@@PDT#1:#2}% + {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\PDFcurrenttransparency}}% + \appendtoPDFdocumentextgstates + {\PDFtransparencyidentifier\space + \PDFtransparencyreference\space}} + +\def\initializePDFtransparency + {\doPDFreserveDPXobject{TR:0}{<< >>}% hack + \special{pdf:\doPDFcheckedDPXobject{TR:0}\PDFtransparancydictionary{1}{1}{/AIS false}}% + \xdef\PDFtransparencyresetidentifier{/Tr0}% + \xdef\PDFtransparencyresetreference{@TR:0}% + \setxvalue{\@@PDT0:0}% + {\noexpand\assignPDFtransparency{0}{0}}% + \appendtoPDFdocumentextgstates + {\PDFtransparencyresetidentifier\space + \PDFtransparencyresetreference\space}% + \global\let\initializePDFtransparency\relax} + +%D \macros +%D {dosetupinteraction, +%D dosetupopenaction,dosetupcloseaction} + +\definespecial\dosetupinteraction + {\showmessage\m!interactions{21}{DVIPDFMx}} + +\definespecial\dosetupopenaction {\doPDFsetupopenaction} +\definespecial\dosetupcloseaction{\doPDFsetupcloseaction} + +%D \macros +%D {doresetgotowhereever, +%D dostartthisisrealpage,dostartthisislocation, +%D dostartgotorealpage,dostartgotolocation,dostartgotoJS} + +\definespecial\doresetgotowhereever {\doPDFresetgotowhereever} +\definespecial\dostartthisislocation{\doPDFstartthisislocation} + +\definespecial\dostartgotolocation{\doPDFstartgotolocation} +\definespecial\dostartgotorealpage{\doPDFstartgotorealpage} +\definespecial\dostartgotoJS {\doPDFstartgotoJS} + +%D \macros +%D {doflushJSpreamble} + +\definespecial\doflushJSpreamble#1% + {\bgroup + \let\compositeJScode\empty + \def\docommand##1% + {\edef\sanitizedJScode{\getJSpreamble{##1}}% + \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode + \special{pdf:object @JS:##1 <>}% + \edef\compositeJScode{\compositeJScode\space (##1) @JS:##1}}% + \processcommalist[#1]\docommand + \special{pdf:names /JavaScript [\compositeJScode]}% + \egroup} + +%D \macros +%D {dostarthide,dostophide} + +\definespecial\dostarthide{} +\definespecial\dostophide {} + +%D \macros +%D {dosetupscreen} + +\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight} + +\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight} +\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight} +\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight} +\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight} + +%D \macros +%D {dostartexecutecommand} + +\definespecial\dostartexecutecommand{\doPDFstartexecutecommand} + +%D \macros +%D {dosetupidentity} + +\definespecial\dosetupidentity{\doPDFsetupidentity} + +%D \macros +%D {dostartrunprogam} + +\definespecial\dostartrunprogram{\doPDFstartrunprogram} + +%D \macros +%D {dostartgotoprofile, dostopgotoprofile, +%D dobeginofprofile, doendofprofile} + +\definespecial\dostartgotoprofile{\doPDFstartgotoprofile} + +\definespecial\dobeginofprofile#1#2#3#4% + {\bgroup + \setPDFdestination{#1}% + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \doifsomething{\PDFdestination} + {\special + {pdf:thread @ART::\PDFdestination\space + width \width height \height + <>}}% + \egroup} + +\definespecial\doendofprofile + {} + +%D \macros +%D {doinsertbookmark} + +\definespecial\doinsertbookmark{\doPDFinsertbookmark} + +%D \macros +%D {dostartobject,dostopobject,doinsertobject} +%D +%D Modified to support the color shading feature since version +%D \type{dvipdfmx-20021128}. + +% wd nextbox > #3 ivm offset + +% \definespecial\dostartobject#1#2#3#4#5% +% {\bgroup +% \dowithnextbox +% {\dosetobjectreference{#1}{#2}{@#1::#2}% +% \scratchdimen#3\edef\width {\the\scratchdimen\space}% +% \scratchdimen#4\edef\height{\the\scratchdimen\space}% +% \setbox\nextbox\vbox +% {\special{pdf:bxobj @#1::#2 width \width height \height}% +% % we need to compensate for the box offset (ugly, sigh) +% \scratchdimen\nextboxht +% \advance\scratchdimen\nextboxdp +% \advance\scratchdimen-#4\relax +% \nextboxdp\zeropoint +% \nextboxht\zeropoint +% \hbox to #3{\hss\lower.5\scratchdimen\box\nextbox\hss}% +% \ifx\currentPDFresources\empty +% \else +% \special{pdf:put @resources <<\currentPDFresources>>}% +% \global\let\currentPDFresources\empty +% \fi +% \special{pdf:exobj}}% +% \smashbox\nextbox +% \flushatshipout{\box\nextbox}% +% \egroup}% +% \hbox\bgroup} + +% \definespecial\dostopobject +% {\egroup} + +\def\doDVIPDFMXstartobject#1#2#3#4#5#6% + {\bgroup + \dowithnextbox + {\ifcase#1\or\dosetobjectreference{#2}{#3}{@#2::#3}\fi + \scratchdimen#4\edef\width {\the\scratchdimen\space}% + \scratchdimen#5\edef\height{\the\scratchdimen\space}% + \setbox\nextbox\vbox + {\special{pdf:bxobj @#2::#3 width \width height \height}% + % we need to compensate for the box offset (ugly, sigh) + \scratchdimen\nextboxht + \advance\scratchdimen\nextboxdp + \advance\scratchdimen-#5\relax + \nextboxdp\zeropoint + \nextboxht\zeropoint + \hbox to #4{\hss\lower.5\scratchdimen\box\nextbox\hss}% + \ifx\currentPDFresources\empty + \else + \special{pdf:put @resources <<\currentPDFresources>>}% + \global\let\currentPDFresources\empty + \fi + \special{pdf:exobj}}% + \finalizeobjectbox\nextbox + \smashbox\nextbox + \flushatshipout{\box\nextbox}% + \egroup}% + \hbox\bgroup} + +\def\doDVIPDFMXstopobject + {\egroup} + +\definespecial\dostartobject#1#2#3#4#5% + {\doDVIPDFMXstartobject\plusone{#1}{#2}{#3}{#4}{#5}} + +\definespecial\dostopobject + {\doDVIPDFMXstopobject} + +\definespecial\doinsertobject#1#2% + {\hbox + {\doPDFgetobjectreference{#1}{#2}\PDFobjectreference + \ifx\PDFobjectreference\empty \else + \special{pdf:uxobj @#1::#2}% + \fi}} + +%D \macros +%D {dosetpagetransition} + +\definespecial\dosetpagetransition{\doPDFsetpagetransition} + +%D \macros +%D {doinsertcomment, doflushcomments} + +\definespecial\doinsertcomment{\doPDFinsertcomment} +\definespecial\doflushcomments{\doPDFflushcomments} + +%D \macros +%D {dopresetlinefield,dopresettextfield, +%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, +%D dopresetpushfield,dopresetcheckfield, +%D dopresetradiofield,dopresetradiorecord} + +\definespecial\dopresetlinefield {\doFDFpresetlinefield} +\definespecial\dopresettextfield {\doFDFpresettextfield} +\definespecial\dopresetchoicefield{\doFDFpresetchoicefield} +\definespecial\dopresetpopupfield {\doFDFpresetpopupfield} +\definespecial\dopresetcombofield {\doFDFpresetcombofield} +\definespecial\dopresetpushfield {\doFDFpresetpushfield} +\definespecial\dopresetcheckfield {\doFDFpresetcheckfield} +\definespecial\dopresetradiofield {\doFDFpresetradiofield} +\definespecial\dopresetradiorecord{\doFDFpresetradiorecord} + +%D \macros +%D {dodefinefieldset,dogetfieldset,doiffieldset} + +\definespecial\dodefinefieldset{\doFDFdefinefieldset} +\definespecial\dogetfieldset {\doFDFgetfieldset} +\definespecial\doiffieldset {\doFDFiffieldset} + +%D \macros +%D {doregistercalculationset} + +\definespecial\doregistercalculationset{\doFDFregistercalculationset} + +%D \type{\doPDFdestination} in \type{spec-dpm} had a bug. +%D +%D \macros +%D {doPDFdestination} + +\def\doPDFdestination#1% + {\special{pdf:names /Dests (#1) [@thispage \PDFpageviewwrd]}} + +%D \macros +%D {doPDFaction,doPDFannotation,ifsharePDFactions} +%D +%D Sharing is not yet supported. + +\newif\ifsharePDFactions \sharePDFactionsfalse + +\def\dodoPDFaction#1#2#3#4% + {\ifcollectreferenceactions + \xdef\lastPDFaction{#4}% + \else + \bgroup + % this is yet untested + %\ifsharePDFactions + % \ifcase\similarreference\relax + % \xdef\lastPDFaction{<<#4>>}% + % \or + % \global\advance\nofPDFsimilar by 1 + % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#4>>}% + % \xdef\lastPDFaction{@PDF::sim:\the\nofPDFsimilar}% + % \else + % % leave \lastPDFaction untouched + % \fi + %\else + \xdef\lastPDFaction{<<#4>>}% + %\fi + \scratchdimen#2\edef\width {\the\scratchdimen\space}% + \scratchdimen#3\edef\height{\the\scratchdimen\space}% + \special{pdf:ann #1 width \width height \height + <>}% + \egroup + \fi} + +\def\doPDFaction#1#2#3% + {\dodoPDFaction\empty{#1}{#2}{#3}} + +%D \type{\doPDFannotation} in \type{spec-dpm} had a bug. +%D +%D \type{\doPDFannotation} conflicts with \type{\doPDFinsertmov}, +%D since width and height also defined in \type{\doPDFinsertmov}. + +\def\doPDFannotation#1#2#3% + {\bgroup + \edef\data{#3}% + \scratchdimen#1\edef\width {\the\scratchdimen\space}% + \scratchdimen#2\edef\height{\the\scratchdimen\space}% + \special{pdf:ann width \width height \height <<\data>>}% + \egroup} + +%D \macros +%D {doPDFannotationobject,doPDFactionobject} + +\def\doPDFannotationobject#1#2#3#4#5% + {\bgroup + \scratchdimen#3\edef\width {\the\scratchdimen\space}% + \scratchdimen#4\edef\height{\the\scratchdimen\space}% + \special{pdf:ann @#1::#2 width \width height \height <<#5>>}% + \dosetobjectreference{#1}{#2}{@#1::#2}% + \egroup} + +\def\doPDFactionobject#1#2#3#4#5% + {\dodoPDFaction{@#1::#2}{#3}{#4}{#5}% + \dosetobjectreference{#1}{#2}{@#1::#2}} + +%D \macros +%D {doPDFaddtocatalog,doPDFaddtoinfo, +%D doPDFpageattribute,doPDFpagesattribute} + +% we could move much more to spec-fdf + +% \ifx\pdfcatalog \undefined \newtoks\pdfcatalog \fi +% \ifx\pdfinfo \undefined \newtoks\pdfinfo \fi +% \ifx\pdfpageattr \undefined \newtoks\pdfpageattr \fi +% \ifx\pdfpageresources\undefined \newtoks\pdfpageresources \fi +% \ifx\pdfpagesattr \undefined \newtoks\pdfpagesattr \fi + +% \def\doPDFaddtocatalog #1{\expanded{\global\pdfcatalog {#1\the\pdfcatalog }}} +% \def\doPDFaddtoinfo #1{\expanded{\global\pdfinfo {#1\the\pdfinfo }}} +% \def\doPDFpageattribute #1{\expanded{\global\pdfpageattr {#1\the\pdfpageattr }}} +% \def\doPDFpageresource #1{\expanded{\global\pdfpageresources{#1\the\pdfpageresources}}} +% \def\doPDFpagesattribute#1{\expanded{\global\pdfpagesattr {#1\the\pdfpagesattr }}} + +% \def\doPDFresetpageattributes{\global\pdfpageattr\emptytoks} +% \def\doPDFresetpageresources {\global\pdfpageresources\emptytoks} + +% \appendtoks +% \special{pdf: put @catalog <<#1>>}% +% \special{pdf: docinfo <<#1>>}% +% \special{pdf: put @pages <<#1>>}% +% \to \everylastshipout + +% \appendtoks +% \special{pdf: put @thispage <<#1>>}% +% \to\everyshipout + +\def\doPDFaddtocatalog#1% + {\special{pdf:put @catalog <<#1>>}} + +\def\doPDFaddtoinfo#1% + {\special{pdf:put @docinfo <<#1>>}} + +\def\doPDFpageattribute#1% + {\special{pdf:put @thispage <<#1>>}} + +\def\doPDFpagesattribute#1% + {\special{pdf:put @pages <<#1>>}} + +\def\doPDFpageresource#1% + {\special{pdf:put @resources <<#1>>}} + +\let\doPDFresetpageresources \relax +\let\doPDFresetpageattributes\relax + +%D \type{\doPDFbookmark} in \type{spec-dpm} had a bug. +%D The openbookmark option \#5 is not supported yet. +%D +%D \macros +%D {doPDFbookmark} + +\def\doPDFbookmark#1#2#3#4#5% + {\ifcase#1\else + %\scratchcounter#4\advance\scratchcounter\minusone + \special{pdf:outline #1 %\ifcase#5 opened\fi + % <>>>}% + <> >>}% + \fi} + +%D \macros +%D {doPDFdictionaryobject,doPDFarrayobject} + +% Dvipdfmx can't handle +% +% \special{pdf:put @foo << /Bar @bar >>} +% \special{pdf:put @bar << /Foo @foo >>} +% +% Objects must be defined before they are used. +% +% \special{pdf:obj @foo << >>} +% \special{pdf:obj @bar << >>} +% \special{pdf:put @foo << /Bar @bar >>} +% \special{pdf:put @bar << /Foo @foo >>} +% +% However, this only works for dictionary and array. + +\def\doPDFreserveDPXobject#1#2% + {\ifundefined{r:pdx:d:#1}% + % we need a \flushatshipoutprep (prepended, normally appended) + \flushatshipout{\special{pdf:object @#1 #2}}% + \global\letvalue{r:pdx:d:#1}\empty + \fi} + +\def\doPDFreserveDPXobjectfirst#1#2% + {\ifundefined{r:pdx:d:#1}% + \doglobal\prependtoks\special{pdf:object @#1 #2}\to\everyfirstshipout + \global\letvalue{r:pdx:d:#1}\empty + \fi} + +\def\doPDFcheckedDPXobject#1{\ifundefined{r:pdx:d:#1}object\else put\fi\space @#1\space} + +% new, experimental, can save a run, bugged, too many xforms now +% +% \def\doreservePDFobject#1#2% +% {\dosetobjectreference{#1}{#2}{@#1::#2}} +% +% \def\doPDFreserveddictionaryobject#1#2#3% +% {\flushatshipout{\special{pdf:object @#1::#2 << #3 >>}}} +% +% \def\doPDFreservedarrayobject#1#2#3% +% {\flushatshipout{\special{pdf:object @#1::#2 [ #3 ]}}} +% +% \doreservePDFobject{FDF}{docuextgstates} +% \doreservePDFobject{FDF}{colorspaces} +% \doreservePDFobject{FDF}{docushades} + +% so this is to be checked + +\def\doPDFdictionaryobject#1#2#3% + {\flushatshipout + {\special{pdf:\doPDFcheckedDPXobject{#1::#2}<<#3>>}% + \dosetobjectreference{#1}{#2}{@#1::#2}}} + +\def\doPDFarrayobject#1#2#3% + {\flushatshipout + {\special{pdf:\doPDFcheckedDPXobject{#1::#2}[#3]}% + \dosetobjectreference{#1}{#2}{@#1::#2}}} + +%D \macros +%D {defaultobjectreference,doPDFgetobjectreference} + +\def\defaultobjectreference#1#2{@#1::#2} + +%D \type{\doPDFgetobjectreference} in \type{spec-dpm} had a bug. + +\def\doPDFgetobjectreference#1#2#3% + {\dogetobjectreference{#1}{#2}#3% + \ifx#3\empty\else\edef#3{#3}\fi} + +\def\doPDFgetpagereference#1#2% + {\edef#2{@page#1}} + +%D Done. + +% %D 2. Modified codes from \type{spec-fdf} +% +% \definespecial\dostartgraphicgroup{\special{pdf: literal direct q}} +% \definespecial\dostopgraphicgroup {\special{pdf: literal direct Q}} + +%D 3. Copied codes from \type{spec-tpd} + +%D \macros +%D {dostartclipping,dostopclipping} +%D +%D Clipping in \PDFTEX\ is rather trivial. We can even hook +%D in \METAPOST\ without problems. + +\definespecial\dostartclipping#1#2#3% + {\PointsToBigPoints{#2}\width + \PointsToBigPoints{#3}\height + \grabMPclippath{#1}{1}\width\height + {0 0 m \width\space 0 l \width \height l 0 \height l}% + \PDFcode + {q 0 w \MPclippath\space W n}} + +\definespecial\dostopclipping + {\PDFcode{Q n}} + +%D 4. Modified codes from \type{supp-pdf} + +\def\dosetMPsomePDFshade#1#2% + {\global\advance\currentPDFshade \plusone + \special{pdf:object @ftn:Sh:\currentPDFshade\space + <>}% + \special{pdf:object @obj:Sh:\currentPDFshade\space + <>}% + \appendtoPDFdocumentshades{/Sh\the\currentPDFshade\space @obj:Sh:\currentPDFshade}% + \setxvalue{\@@MPSK#2}{\noexpand\dohandleMPshade{\the\currentPDFshade}}} + +\def\handleMPfigurespecial#1#2#3#4#5#6#7% toto : combine with ext fig + {\doiffileelse{#7} + {\vbox to \zeropoint + {\vss + \hbox to \zeropoint + {\special{pdf:btrans matrix #1 #2 #3 #4 #5 #6}% + \rlap{\special{pdf:image width 1bp height 1bp (#7)}} + \special{pdf:etrans}\hss}}} + {\message{[unknown figure #7]}}} + +%D 5. Modified codes from \type{supp-pdf} + +\let\handleMPfshow\dohandleMPfshow + +\newcounter\MPPDFcounter + +\newcounter\MPPDFobjectcounter + +\def\setMPPDFobject#1#2% resources boxnumber + {\doglobal\increment\MPPDFobjectcounter + \xdef\getMPPDFobject + {\vbox to \the\ht#2% + {\vss + \hbox to \the\wd#2% + {%\scratchdimen\wd#2\scratchdimen.5\scratchdimen\hskip-\the\scratchdimen + \special{pdf:uxobj @MPPDF::\MPPDFobjectcounter}}}}% + \expanded{\doDVIPDFMXstartobject\zerocount{MPPDF}\MPPDFobjectcounter{\the\wd#2}{\the\ht#2}{\the\dp#2}}% + \finalizeobjectbox#2% + \box#2% + \doDVIPDFMXstopobject} + +\let\getMPPDFobject\gobbletwoarguments + +\definespecial\doinsertMPfile#1% + {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}} + +%D Experimental (untested): + +\definespecial\dostartfonteffect#1#2#3% + {\ifdim#2>\zeropoint + \PointsToBigPoints{#2}\ascii + \PDFdirectcode{\ascii\space w}% + \fi + \ifdim#3\points=\onepoint\else + \scratchdimen#3\points + \PDFdirectcode{\withoutpt{\the\scratchdimen}\space Tc}% + \fi + \PDFdirectcode{\purenumber#1 Tr}} + +\definespecial\dostopfonteffect + {\PDFdirectcode{1 w 0 Tc 0 Tr}} + +%D 6. Modified codes from \type{core-obj} +%D +%D In the viewpoint of TeX, the special command \type{pdf:uxobj @obj} +%D generates a box with zero point width and zero point height so that +%D it must be careful to place the box at the reference point. + +\def\dogetobject#1#2#3#4#5#6#7% don't change this, should work for dvi & pdf + {\initializepaper + \forgetall + \dontshowcomposition + \setbox\scratchbox\vbox + {\doinsertobject{#1}{#2}}% + \setbox\scratchbox#3% + {\vbox to #5\scaledpoint + {\ifdim\ht\scratchbox>#5\scaledpoint + \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss + \else\ifdim\wd\scratchbox>#4\scaledpoint + \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss + \else + %\vss\box\scratchbox + \vss\hbox to #4\scaledpoint{\box\scratchbox\hss}% + \fi\fi}}% + \box\scratchbox + \elabelgroup} + +\stopspecials + +\protect \endinput diff --git a/tex/context/base/spec-dpx.tex b/tex/context/base/spec-dpx.tex deleted file mode 100644 index ed49ea843..000000000 --- a/tex/context/base/spec-dpx.tex +++ /dev/null @@ -1,793 +0,0 @@ -%D \module -%D [ file=spec-dpx, -%D version=2005.08.12, -%D title=\CONTEXT\ Special Macros, -%D subtitle=DVIPDFMx support, -%D author=Jin-Hwan Cho, -%D date=\currentdate, -%D copyright={Jin-Hwan Cho \& Hans Hagen}] -%C -%C DVIPDFMx is an eXtended version of the DVIPDFM, a DVI to PDF -%C translator, still under construction by Jin-Hwan Cho and -%C Shunsaku Hirata. -%C -%C It supports multi-byte character encodings and large character -%C sets for East Asian languages by CID-keyed font technology, -%C and many features including PDF encryption, PDF bookmarks and -%C annotations with Chinese, Japanese, Korean characters, etc. -%C -%C DVIPDFMx (and information) can be downloaded from: -%C -%C http://project.ktug.or.kr/dvipdfmx/ - -\unprotect - -%D This driver is built on top of the general \PDF\ macros, -%D as defined in \type{spec-fdf}, so we inherit that one. - -\startspecials[dpx][reset,fdf] - -%D 1. Modified codes from \type{spec-dpm} - -%D \macros -%D {jobsuffix} -%D -%D Because no intermediate output format is used, we set the -%D jobsuffix to \PDF. - -\setjobsuffix{pdf} - -%D Map files (experimental) - -\definespecial\doloadmapfile#1#2% - {\flushatshipout{\special{pdf:mapfile +#2}}} - -%D DVIPDFMx supports the special command \type{pdf: literal ...} -%D since the version \type{dvipdfmx-20021028}. -%D -%D 1. \type{pdf: literal #1} puts the given PDF commands \#1 -%D after changing the text matrix with \type{"1 0 0 1 x y cm"} -%D to set the current DVI position $(x,y)$ to the origin. -%D -%D 2. \type{pdf: literal reverse #1} puts the given PDF commands \#1 -%D after changing the text matrix with \type{"1 0 0 1 -x -y cm"}. -%D -%D 3. \type{pdf: literal direct #1} puts directly the given PDF -%D commands \#1 without changing the text matrix. -%D -%D Since the version \type{dvipdfmx-20050812}, the role of the special -%D command \type{pdf:literal} is changed so that -%D -%D 1. \type{pdf:literal #1} puts the given PDF commands \#1 -%D after changing the text matrix with \type{"1 0 0 1 x y cm"} -%D to set the current DVI position $(x,y)$ to the origin. After that -%D it restores the previous setting by changing the text matrix with -%D \type{"1 0 0 1 -x -y cm"}. -%D -%D 2. \type{pdf:literal direct #1} puts directly the given PDF commands -%D \type {#1} without changing the text matrix. -%D -%D Literal \PDF\ inclusion is implemented as: - -\def\PDFcode #1{\special{pdf:literal #1}} -\def\PDFcontentcode#1{\special{pdf:content #1}} -\def\PDFdirectcode #1{\special{pdf:literal direct #1}} - -%D \type{\dosetuppaper} in \type{spec-dpm} did not work properly -%D because DVIPDFM did not permit changing the page size. -%D -%D However, DVIPDFMx permits different page size in each page -%D since the version \type{dvipdfmx-20021028}. -%D -%D \macros -%D {dosetuppaper} -%D -%D A simple one. - -\let\PDFpagexyzspec\relax \def\PDFpagexyzspec{@xpos @ypos 0} % untested - -\definespecial\dosetuppaper#1#2#3% - {\bgroup - \scratchdimen#2\edef\width {\the\scratchdimen\space}% - \scratchdimen#3\edef\height{\the\scratchdimen\space}% - \special{pdf:pagesize width \width height \height}% - \egroup} - -%D \macros -%D {doinsertfile} -%D -%D Only \METAPOST, \BMP\ \JPG\ \PNG\ and \PDF\ inclusion are supported. - -\definespecial\doinsertfile - {\dofileinsertion{dpx}\@@DriverImageType} - -%D Even though DVIPDFM supports \METAPOST directly, the funtionality -%D is not good. It conflicts much with \CONTEXT. -%D -%D So, \METAPOST will be treated as the same way as PDFTeX using -%D MPtoPDF in DVIPDFMx since the version \type{dvipdfmx-20021028}. - -%D DVIPDFM (and DVIPDFMx too) supports the image files with -%D the extension, \PDF, \JPG, \PNG, \BMP, and \EPS. - -% \def\handleepsimage -% {\PointsToWholeBigPoints\@@DriverImageWidth \width -% \PointsToWholeBigPoints\@@DriverImageHeight\height -% \special -% {PSfile="\@@DriverImageFile"\space -% llx=\EPSllx\space lly=\EPSlly\space -% urx=\EPSurx\space ury=\EPSury\space -% rwi=\width0\space rhi=\height0}} - -% \definefileinsertion{dpx}{mps}{\handleepsimage} - -\definefileinsertion{dpx}{mps} - {\hbox - {\convertMPtoPDF\@@DriverImageFile{1}{1}% - \global\let\PDFimagereference\empty}} - -\def\handlebmpimage - {\special{pdf: image - width \@@DriverImageWidth \space - height \@@DriverImageHeight\space - (\@@DriverImageFile)}} - -\definefileinsertion{dpx}{pdf}{\handlebmpimage} -\definefileinsertion{dpx}{jpg}{\handlebmpimage} -\definefileinsertion{dpx}{png}{\handlebmpimage} -\definefileinsertion{dpx}{bmp}{\handlebmpimage} - -\definefileinsertion{dpx}{mov}{\doPDFinsertmov} -\definefileinsertion{dpx}{avi}{\doPDFinsertmov} - -%D \macros -%D {doinsertsoundtrack} -%D -%D Sounds are supported too. - -\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack} - -%D \macros -%D {doovalbox} - -\definespecial\doovalbox{\doPDFovalbox} - -%D \macros -%D {dostartgraymode,dostopgraymode, -%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode, -%D dostopcolormode, -%D dostartrotation,dostoprotation, -%D dostartscaling,dostopscaling, -%D dostartmirroring,dostopmirroring, -%D dostartnegative,dostopnegative} -%D -%D Unfortunately the direct \PDF\ inclusion is not suited -%D for the next macros, which means that we cannot use the -%D \type {\doPDF..} alternatives. Since \CONTEXT\ maintains -%D its own colorstack, we use the \DVIPS\ alternatives. - -\definespecial\dostartgraymode {\doPDFstartgraymode} -\definespecial\dostopgraymode {\doPDFstopgraymode} -\definespecial\dostartrgbcolormode {\doPDFstartrgbcolormode} -\definespecial\dostartcmykcolormode{\doPDFstartcmykcolormode} -\definespecial\dostartgraycolormode{\doPDFstartgraycolormode} -\definespecial\dostartspotcolormode{\doPDFstartspotcolormode} -\definespecial\dostopcolormode {\doPDFstopcolormode} - -\definespecial\doregistercmykspotcolor{\doPDFregistercmykspotcolor} -\definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor} -\definespecial\doregistergrayspotcolor{\doPDFregistergrayspotcolor} - -\definespecial\doregistercmykindexcolor{\doPDFregistercmykindexcolor} -\definespecial\doregisterrgbindexcolor {\doPDFregisterrgbindexcolor} -\definespecial\doregistergrayindexcolor{\doPDFregistergrayindexcolor} - -\definespecial\doregisterfigurecolor{\doPDFregisterfigurecolor} - -\definespecial\dostartnonecolormode{\doPDFstartnonecolormode} -\definespecial\doregisternonecolor {\doPDFregisternonecolor} - -\definespecial\dostartrotation #1{\special{pdf:btrans rotate #1}} -\definespecial\dostoprotation {\special{pdf:etrans}} -\definespecial\dostartscaling#1#2{\special{pdf:btrans xscale #1 yscale #2}} -\definespecial\dostopscaling {\special{pdf:etrans}} -\definespecial\dostartmirroring {\special{pdf:btrans xscale -1}} -\definespecial\dostopmirroring {\special{pdf:etrans}} - -%D Negation is not (yet) supported: -\definespecial\dostartnegative {\doPDFstartnegative} -\definespecial\dostopnegative {\doPDFstopnegative} -\definespecial\dostartoverprint {\doPDFstartoverprint} -\definespecial\dostopoverprint {\doPDFstopoverprint} - -\definespecial\dostarttransparency{\doPDFstarttransparency} -\definespecial\dostoptransparency {\doPDFstoptransparency} - -\PDFtransparencysupportedtrue - -\def\@@PDT{@PDT@} - -\ifx\PDFcurrenttransparency\undefined - \newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1 -\fi - -\def\assignPDFtransparency#1#2% - {\def\PDFtransparencyidentifier{/Tr#1}% - \def\PDFtransparencyreference{@TR:#2}} % todo: \PDFobjref{TR:#2} - -\def\presetPDFtransparency#1#2% - {\initializePDFtransparency - \executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}} - -\def\dopresetPDFtransparency#1#2% - {\global\advance\PDFcurrenttransparency \plusone - \doPDFreserveDPXobject{TR:\the\PDFcurrenttransparency}{<< >>}% hack - \special{pdf:\doPDFcheckedDPXobject{TR:\the\PDFcurrenttransparency}\PDFtransparancydictionary{#1}{#2}{}}% - \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}% - \edef\PDFtransparencyreference {@TR:\the\PDFcurrenttransparency}% - \setxvalue{\@@PDT#1:#2}% - {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\PDFcurrenttransparency}}% - \appendtoPDFdocumentextgstates - {\PDFtransparencyidentifier\space - \PDFtransparencyreference\space}} - -\def\initializePDFtransparency - {\doPDFreserveDPXobject{TR:0}{<< >>}% hack - \special{pdf:\doPDFcheckedDPXobject{TR:0}\PDFtransparancydictionary{1}{1}{/AIS false}}% - \xdef\PDFtransparencyresetidentifier{/Tr0}% - \xdef\PDFtransparencyresetreference{@TR:0}% - \setxvalue{\@@PDT0:0}% - {\noexpand\assignPDFtransparency{0}{0}}% - \appendtoPDFdocumentextgstates - {\PDFtransparencyresetidentifier\space - \PDFtransparencyresetreference\space}% - \global\let\initializePDFtransparency\relax} - -%D \macros -%D {dosetupinteraction, -%D dosetupopenaction,dosetupcloseaction} - -\definespecial\dosetupinteraction - {\showmessage\m!interactions{21}{DVIPDFMx}} - -\definespecial\dosetupopenaction {\doPDFsetupopenaction} -\definespecial\dosetupcloseaction{\doPDFsetupcloseaction} - -%D \macros -%D {doresetgotowhereever, -%D dostartthisisrealpage,dostartthisislocation, -%D dostartgotorealpage,dostartgotolocation,dostartgotoJS} - -\definespecial\doresetgotowhereever {\doPDFresetgotowhereever} -\definespecial\dostartthisislocation{\doPDFstartthisislocation} - -\definespecial\dostartgotolocation{\doPDFstartgotolocation} -\definespecial\dostartgotorealpage{\doPDFstartgotorealpage} -\definespecial\dostartgotoJS {\doPDFstartgotoJS} - -%D \macros -%D {doflushJSpreamble} - -\definespecial\doflushJSpreamble#1% - {\bgroup - \let\compositeJScode\empty - \def\docommand##1% - {\edef\sanitizedJScode{\getJSpreamble{##1}}% - \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode - \special{pdf:object @JS:##1 <>}% - \edef\compositeJScode{\compositeJScode\space (##1) @JS:##1}}% - \processcommalist[#1]\docommand - \special{pdf:names /JavaScript [\compositeJScode]}% - \egroup} - -%D \macros -%D {dostarthide,dostophide} - -\definespecial\dostarthide{} -\definespecial\dostophide {} - -%D \macros -%D {dosetupscreen} - -\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight} - -\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight} -\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight} -\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight} -\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight} - -%D \macros -%D {dostartexecutecommand} - -\definespecial\dostartexecutecommand{\doPDFstartexecutecommand} - -%D \macros -%D {dosetupidentity} - -\definespecial\dosetupidentity{\doPDFsetupidentity} - -%D \macros -%D {dostartrunprogam} - -\definespecial\dostartrunprogram{\doPDFstartrunprogram} - -%D \macros -%D {dostartgotoprofile, dostopgotoprofile, -%D dobeginofprofile, doendofprofile} - -\definespecial\dostartgotoprofile{\doPDFstartgotoprofile} - -\definespecial\dobeginofprofile#1#2#3#4% - {\bgroup - \setPDFdestination{#1}% - \scratchdimen#2\edef\width {\the\scratchdimen\space}% - \scratchdimen#3\edef\height{\the\scratchdimen\space}% - \doifsomething{\PDFdestination} - {\special - {pdf:thread @ART::\PDFdestination\space - width \width height \height - <>}}% - \egroup} - -\definespecial\doendofprofile - {} - -%D \macros -%D {doinsertbookmark} - -\definespecial\doinsertbookmark{\doPDFinsertbookmark} - -%D \macros -%D {dostartobject,dostopobject,doinsertobject} -%D -%D Modified to support the color shading feature since version -%D \type{dvipdfmx-20021128}. - -% wd nextbox > #3 ivm offset - -% \definespecial\dostartobject#1#2#3#4#5% -% {\bgroup -% \dowithnextbox -% {\dosetobjectreference{#1}{#2}{@#1::#2}% -% \scratchdimen#3\edef\width {\the\scratchdimen\space}% -% \scratchdimen#4\edef\height{\the\scratchdimen\space}% -% \setbox\nextbox\vbox -% {\special{pdf:bxobj @#1::#2 width \width height \height}% -% % we need to compensate for the box offset (ugly, sigh) -% \scratchdimen\nextboxht -% \advance\scratchdimen\nextboxdp -% \advance\scratchdimen-#4\relax -% \nextboxdp\zeropoint -% \nextboxht\zeropoint -% \hbox to #3{\hss\lower.5\scratchdimen\box\nextbox\hss}% -% \ifx\currentPDFresources\empty -% \else -% \special{pdf:put @resources <<\currentPDFresources>>}% -% \global\let\currentPDFresources\empty -% \fi -% \special{pdf:exobj}}% -% \smashbox\nextbox -% \flushatshipout{\box\nextbox}% -% \egroup}% -% \hbox\bgroup} - -% \definespecial\dostopobject -% {\egroup} - -\def\doDVIPDFMXstartobject#1#2#3#4#5#6% - {\bgroup - \dowithnextbox - {\ifcase#1\or\dosetobjectreference{#2}{#3}{@#2::#3}\fi - \scratchdimen#4\edef\width {\the\scratchdimen\space}% - \scratchdimen#5\edef\height{\the\scratchdimen\space}% - \setbox\nextbox\vbox - {\special{pdf:bxobj @#2::#3 width \width height \height}% - % we need to compensate for the box offset (ugly, sigh) - \scratchdimen\nextboxht - \advance\scratchdimen\nextboxdp - \advance\scratchdimen-#5\relax - \nextboxdp\zeropoint - \nextboxht\zeropoint - \hbox to #4{\hss\lower.5\scratchdimen\box\nextbox\hss}% - \ifx\currentPDFresources\empty - \else - \special{pdf:put @resources <<\currentPDFresources>>}% - \global\let\currentPDFresources\empty - \fi - \special{pdf:exobj}}% - \finalizeobjectbox\nextbox - \smashbox\nextbox - \flushatshipout{\box\nextbox}% - \egroup}% - \hbox\bgroup} - -\def\doDVIPDFMXstopobject - {\egroup} - -\definespecial\dostartobject#1#2#3#4#5% - {\doDVIPDFMXstartobject\plusone{#1}{#2}{#3}{#4}{#5}} - -\definespecial\dostopobject - {\doDVIPDFMXstopobject} - -\definespecial\doinsertobject#1#2% - {\hbox - {\doPDFgetobjectreference{#1}{#2}\PDFobjectreference - \ifx\PDFobjectreference\empty \else - \special{pdf:uxobj @#1::#2}% - \fi}} - -%D \macros -%D {dosetpagetransition} - -\definespecial\dosetpagetransition{\doPDFsetpagetransition} - -%D \macros -%D {doinsertcomment, doflushcomments} - -\definespecial\doinsertcomment{\doPDFinsertcomment} -\definespecial\doflushcomments{\doPDFflushcomments} - -%D \macros -%D {dopresetlinefield,dopresettextfield, -%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, -%D dopresetpushfield,dopresetcheckfield, -%D dopresetradiofield,dopresetradiorecord} - -\definespecial\dopresetlinefield {\doFDFpresetlinefield} -\definespecial\dopresettextfield {\doFDFpresettextfield} -\definespecial\dopresetchoicefield{\doFDFpresetchoicefield} -\definespecial\dopresetpopupfield {\doFDFpresetpopupfield} -\definespecial\dopresetcombofield {\doFDFpresetcombofield} -\definespecial\dopresetpushfield {\doFDFpresetpushfield} -\definespecial\dopresetcheckfield {\doFDFpresetcheckfield} -\definespecial\dopresetradiofield {\doFDFpresetradiofield} -\definespecial\dopresetradiorecord{\doFDFpresetradiorecord} - -%D \macros -%D {dodefinefieldset,dogetfieldset,doiffieldset} - -\definespecial\dodefinefieldset{\doFDFdefinefieldset} -\definespecial\dogetfieldset {\doFDFgetfieldset} -\definespecial\doiffieldset {\doFDFiffieldset} - -%D \macros -%D {doregistercalculationset} - -\definespecial\doregistercalculationset{\doFDFregistercalculationset} - -%D \type{\doPDFdestination} in \type{spec-dpm} had a bug. -%D -%D \macros -%D {doPDFdestination} - -\def\doPDFdestination#1% - {\special{pdf:names /Dests (#1) [@thispage \PDFpageviewwrd]}} - -%D \macros -%D {doPDFaction,doPDFannotation,ifsharePDFactions} -%D -%D Sharing is not yet supported. - -\newif\ifsharePDFactions \sharePDFactionsfalse - -\def\dodoPDFaction#1#2#3#4% - {\ifcollectreferenceactions - \xdef\lastPDFaction{#4}% - \else - \bgroup - % this is yet untested - %\ifsharePDFactions - % \ifcase\similarreference\relax - % \xdef\lastPDFaction{<<#4>>}% - % \or - % \global\advance\nofPDFsimilar by 1 - % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#4>>}% - % \xdef\lastPDFaction{@PDF::sim:\the\nofPDFsimilar}% - % \else - % % leave \lastPDFaction untouched - % \fi - %\else - \xdef\lastPDFaction{<<#4>>}% - %\fi - \scratchdimen#2\edef\width {\the\scratchdimen\space}% - \scratchdimen#3\edef\height{\the\scratchdimen\space}% - \special{pdf:ann #1 width \width height \height - <>}% - \egroup - \fi} - -\def\doPDFaction#1#2#3% - {\dodoPDFaction\empty{#1}{#2}{#3}} - -%D \type{\doPDFannotation} in \type{spec-dpm} had a bug. -%D -%D \type{\doPDFannotation} conflicts with \type{\doPDFinsertmov}, -%D since width and height also defined in \type{\doPDFinsertmov}. - -\def\doPDFannotation#1#2#3% - {\bgroup - \edef\data{#3}% - \scratchdimen#1\edef\width {\the\scratchdimen\space}% - \scratchdimen#2\edef\height{\the\scratchdimen\space}% - \special{pdf:ann width \width height \height <<\data>>}% - \egroup} - -%D \macros -%D {doPDFannotationobject,doPDFactionobject} - -\def\doPDFannotationobject#1#2#3#4#5% - {\bgroup - \scratchdimen#3\edef\width {\the\scratchdimen\space}% - \scratchdimen#4\edef\height{\the\scratchdimen\space}% - \special{pdf:ann @#1::#2 width \width height \height <<#5>>}% - \dosetobjectreference{#1}{#2}{@#1::#2}% - \egroup} - -\def\doPDFactionobject#1#2#3#4#5% - {\dodoPDFaction{@#1::#2}{#3}{#4}{#5}% - \dosetobjectreference{#1}{#2}{@#1::#2}} - -%D \macros -%D {doPDFaddtocatalog,doPDFaddtoinfo, -%D doPDFpageattribute,doPDFpagesattribute} - -% we could move much more to spec-fdf - -% \ifx\pdfcatalog \undefined \newtoks\pdfcatalog \fi -% \ifx\pdfinfo \undefined \newtoks\pdfinfo \fi -% \ifx\pdfpageattr \undefined \newtoks\pdfpageattr \fi -% \ifx\pdfpageresources\undefined \newtoks\pdfpageresources \fi -% \ifx\pdfpagesattr \undefined \newtoks\pdfpagesattr \fi - -% \def\doPDFaddtocatalog #1{\expanded{\global\pdfcatalog {#1\the\pdfcatalog }}} -% \def\doPDFaddtoinfo #1{\expanded{\global\pdfinfo {#1\the\pdfinfo }}} -% \def\doPDFpageattribute #1{\expanded{\global\pdfpageattr {#1\the\pdfpageattr }}} -% \def\doPDFpageresource #1{\expanded{\global\pdfpageresources{#1\the\pdfpageresources}}} -% \def\doPDFpagesattribute#1{\expanded{\global\pdfpagesattr {#1\the\pdfpagesattr }}} - -% \def\doPDFresetpageattributes{\global\pdfpageattr\emptytoks} -% \def\doPDFresetpageresources {\global\pdfpageresources\emptytoks} - -% \appendtoks -% \special{pdf: put @catalog <<#1>>}% -% \special{pdf: docinfo <<#1>>}% -% \special{pdf: put @pages <<#1>>}% -% \to \everylastshipout - -% \appendtoks -% \special{pdf: put @thispage <<#1>>}% -% \to\everyshipout - -\def\doPDFaddtocatalog#1% - {\special{pdf:put @catalog <<#1>>}} - -\def\doPDFaddtoinfo#1% - {\special{pdf:put @docinfo <<#1>>}} - -\def\doPDFpageattribute#1% - {\special{pdf:put @thispage <<#1>>}} - -\def\doPDFpagesattribute#1% - {\special{pdf:put @pages <<#1>>}} - -\def\doPDFpageresource#1% - {\special{pdf:put @resources <<#1>>}} - -\let\doPDFresetpageresources \relax -\let\doPDFresetpageattributes\relax - -%D \type{\doPDFbookmark} in \type{spec-dpm} had a bug. -%D The openbookmark option \#5 is not supported yet. -%D -%D \macros -%D {doPDFbookmark} - -\def\doPDFbookmark#1#2#3#4#5% - {\ifcase#1\else - %\scratchcounter#4\advance\scratchcounter\minusone - \special{pdf:outline #1 %\ifcase#5 opened\fi - % <>>>}% - <> >>}% - \fi} - -%D \macros -%D {doPDFdictionaryobject,doPDFarrayobject} - -% Dvipdfmx can't handle -% -% \special{pdf:put @foo << /Bar @bar >>} -% \special{pdf:put @bar << /Foo @foo >>} -% -% Objects must be defined before they are used. -% -% \special{pdf:obj @foo << >>} -% \special{pdf:obj @bar << >>} -% \special{pdf:put @foo << /Bar @bar >>} -% \special{pdf:put @bar << /Foo @foo >>} -% -% However, this only works for dictionary and array. - -\def\doPDFreserveDPXobject#1#2% - {\ifundefined{r:pdx:d:#1}% - % we need a \flushatshipoutprep (prepended, normally appended) - \flushatshipout{\special{pdf:object @#1 #2}}% - \global\letvalue{r:pdx:d:#1}\empty - \fi} - -\def\doPDFreserveDPXobjectfirst#1#2% - {\ifundefined{r:pdx:d:#1}% - \doglobal\prependtoks\special{pdf:object @#1 #2}\to\everyfirstshipout - \global\letvalue{r:pdx:d:#1}\empty - \fi} - -\def\doPDFcheckedDPXobject#1{\ifundefined{r:pdx:d:#1}object\else put\fi\space @#1\space} - -% new, experimental, can save a run, bugged, too many xforms now -% -% \def\doreservePDFobject#1#2% -% {\dosetobjectreference{#1}{#2}{@#1::#2}} -% -% \def\doPDFreserveddictionaryobject#1#2#3% -% {\flushatshipout{\special{pdf:object @#1::#2 << #3 >>}}} -% -% \def\doPDFreservedarrayobject#1#2#3% -% {\flushatshipout{\special{pdf:object @#1::#2 [ #3 ]}}} -% -% \doreservePDFobject{FDF}{docuextgstates} -% \doreservePDFobject{FDF}{colorspaces} -% \doreservePDFobject{FDF}{docushades} - -% so this is to be checked - -\def\doPDFdictionaryobject#1#2#3% - {\flushatshipout - {\special{pdf:\doPDFcheckedDPXobject{#1::#2}<<#3>>}% - \dosetobjectreference{#1}{#2}{@#1::#2}}} - -\def\doPDFarrayobject#1#2#3% - {\flushatshipout - {\special{pdf:\doPDFcheckedDPXobject{#1::#2}[#3]}% - \dosetobjectreference{#1}{#2}{@#1::#2}}} - -%D \macros -%D {defaultobjectreference,doPDFgetobjectreference} - -\def\defaultobjectreference#1#2{@#1::#2} - -%D \type{\doPDFgetobjectreference} in \type{spec-dpm} had a bug. - -\def\doPDFgetobjectreference#1#2#3% - {\dogetobjectreference{#1}{#2}#3% - \ifx#3\empty\else\edef#3{#3}\fi} - -\def\doPDFgetpagereference#1#2% - {\edef#2{@page#1}} - -%D Done. - -% %D 2. Modified codes from \type{spec-fdf} -% -% \definespecial\dostartgraphicgroup{\special{pdf: literal direct q}} -% \definespecial\dostopgraphicgroup {\special{pdf: literal direct Q}} - -%D 3. Copied codes from \type{spec-tpd} - -%D \macros -%D {dostartclipping,dostopclipping} -%D -%D Clipping in \PDFTEX\ is rather trivial. We can even hook -%D in \METAPOST\ without problems. - -\definespecial\dostartclipping#1#2#3% - {\PointsToBigPoints{#2}\width - \PointsToBigPoints{#3}\height - \grabMPclippath{#1}{1}\width\height - {0 0 m \width\space 0 l \width \height l 0 \height l}% - \PDFcode - {q 0 w \MPclippath\space W n}} - -\definespecial\dostopclipping - {\PDFcode{Q n}} - -%D 4. Modified codes from \type{supp-pdf} - -\def\dosetMPsomePDFshade#1#2% - {\global\advance\currentPDFshade \plusone - \special{pdf:object @ftn:Sh:\currentPDFshade\space - <>}% - \special{pdf:object @obj:Sh:\currentPDFshade\space - <>}% - \appendtoPDFdocumentshades{/Sh\the\currentPDFshade\space @obj:Sh:\currentPDFshade}% - \setxvalue{\@@MPSK#2}{\noexpand\dohandleMPshade{\the\currentPDFshade}}} - -\def\handleMPfigurespecial#1#2#3#4#5#6#7% toto : combine with ext fig - {\doiffileelse{#7} - {\vbox to \zeropoint - {\vss - \hbox to \zeropoint - {\special{pdf:btrans matrix #1 #2 #3 #4 #5 #6}% - \rlap{\special{pdf:image width 1bp height 1bp (#7)}} - \special{pdf:etrans}\hss}}} - {\message{[unknown figure #7]}}} - -%D 5. Modified codes from \type{supp-pdf} - -\let\handleMPfshow\dohandleMPfshow - -\newcounter\MPPDFcounter - -\newcounter\MPPDFobjectcounter - -\def\setMPPDFobject#1#2% resources boxnumber - {\doglobal\increment\MPPDFobjectcounter - \xdef\getMPPDFobject - {\vbox to \the\ht#2% - {\vss - \hbox to \the\wd#2% - {%\scratchdimen\wd#2\scratchdimen.5\scratchdimen\hskip-\the\scratchdimen - \special{pdf:uxobj @MPPDF::\MPPDFobjectcounter}}}}% - \expanded{\doDVIPDFMXstartobject\zerocount{MPPDF}\MPPDFobjectcounter{\the\wd#2}{\the\ht#2}{\the\dp#2}}% - \finalizeobjectbox#2% - \box#2% - \doDVIPDFMXstopobject} - -\let\getMPPDFobject\gobbletwoarguments - -\definespecial\doinsertMPfile#1% - {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}} - -%D Experimental (untested): - -\definespecial\dostartfonteffect#1#2#3% - {\ifdim#2>\zeropoint - \PointsToBigPoints{#2}\ascii - \PDFdirectcode{\ascii\space w}% - \fi - \ifdim#3\points=\onepoint\else - \scratchdimen#3\points - \PDFdirectcode{\withoutpt{\the\scratchdimen}\space Tc}% - \fi - \PDFdirectcode{\purenumber#1 Tr}} - -\definespecial\dostopfonteffect - {\PDFdirectcode{1 w 0 Tc 0 Tr}} - -%D 6. Modified codes from \type{core-obj} -%D -%D In the viewpoint of TeX, the special command \type{pdf:uxobj @obj} -%D generates a box with zero point width and zero point height so that -%D it must be careful to place the box at the reference point. - -\def\dogetobject#1#2#3#4#5#6#7% don't change this, should work for dvi & pdf - {\initializepaper - \forgetall - \dontshowcomposition - \setbox\scratchbox\vbox - {\doinsertobject{#1}{#2}}% - \setbox\scratchbox#3% - {\vbox to #5\scaledpoint - {\ifdim\ht\scratchbox>#5\scaledpoint - \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss - \else\ifdim\wd\scratchbox>#4\scaledpoint - \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss - \else - %\vss\box\scratchbox - \vss\hbox to #4\scaledpoint{\box\scratchbox\hss}% - \fi\fi}}% - \box\scratchbox - \elabelgroup} - -\stopspecials - -\protect \endinput diff --git a/tex/context/base/spec-dvi.mkii b/tex/context/base/spec-dvi.mkii new file mode 100644 index 000000000..1a8f653f0 --- /dev/null +++ b/tex/context/base/spec-dvi.mkii @@ -0,0 +1,118 @@ +%D \module +%D [ file=spec-dvi, +%D version=1996.01.25, +%D title=\CONTEXT\ Special Macros, +%D subtitle=Generic \TEX\ Solutions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 \macros +%D {dostartobject, +%D dostopobject, +%D doinsertobject} +%D +%D Reuse of object is not supported by the \DVI\ format. We +%D therefore just duplicate them using boxes. + +\setjobsuffix{dvi} % can be overloaded in other spec's + +\startspecials[tex] + +\newbox\DVIobjects \newcounter\DVIobjectcounter + +\definespecial\dostartobject#1#2#3#4#5% + {\setbox\nextbox\vbox\bgroup + \def\dodostopobject + {\egroup + \doglobal\increment\DVIobjectcounter + \global\setbox\DVIobjects\vbox + {\offinterlineskip + \forgetall + \unvbox\DVIobjects + \setbox\nextbox\hbox{\box\nextbox}% + \wd\nextbox\zeropoint + \dp\nextbox\zeropoint + \ht\nextbox\onepoint + \allowbreak + \box\nextbox}% + \dosetobjectreference{#1}{#2}{\DVIobjectcounter}}} + +\definespecial\dostopobject + {\dodostopobject} + +\definespecial\doinsertobject#1#2% + {\bgroup + \dogetobjectreference{#1}{#2}\DVIobjectreference + \splittopskip\zeropoint + \setbox0=\copy\DVIobjects + \dimen0=\DVIobjectreference\onepoint + \advance\dimen0 -\onepoint + \setbox2\vsplit0 to \dimen0 + \ifdim\ht0>\onepoint + \setbox0\vsplit0 to \onepoint + \fi + \unvbox0 + \setbox0\lastbox + \hbox{\unhbox0}% the \hbox is really needed! + \egroup} + +%D \macros +%D {dosetposition, +%D dosetpositionwhd, +%D dosetpositionplus} +%D +%D The next specials only identify a position. It is up to +%D a \DVI\ postprocessing utility to merge the right commands +%D into the utility file. Since in \CONTEXT, we only deal +%D with relative positions, the reference point is not so +%D important. +%D +%D The postprocessor should translate the specials into +%D commands and append these to \type {jobname.tuo} using the +%D format: +%D +%D \starttyping +%D \pospxy {identifier}{page}{x}{y} +%D \pospxywhd {identifier}{page}{x}{y}{w}{h}{d} +%D \pospxyplus{identifier}{page}{x}{y}{w}{h}{d}{list} +%D \stoptyping +%D +%D The postprocessor should, of course, provide the \type +%D {page}, \type {x}, and \type {y} values. + +%D Now in spec-mis.tex: + +% \definespecial\dosetposition#1% +% {\special{pos:pxy "#1"}} +% +% \definespecial\dosetpositionwhd#1#2#3#4% +% {\special{pos:pxywhd "#1" #2 #3 #4}} +% +% \definespecial\dosetpositionplus#1#2#3#4#5% +% {\special{pos:pxyplus "#1" #2 #3 #4 #5}} + +%D The next special tells the position postprocessor what +%D page dimensions were used. + +%D Also in spec-mis.tex: + +% \let\flushDVIpositionpapersize\relax +% +% \definespecial\dosetpositionpapersize#1#2% +% {\xdef\flushDVIpositionpapersize% +% {\special{pos:papersize \number#1 \number#2}% +% \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }% +% \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} +% +% \prependtoksonce \flushDVIpositionpapersize \to \everyshipout + +\stopspecials + +\protect \endinput diff --git a/tex/context/base/spec-dvi.tex b/tex/context/base/spec-dvi.tex deleted file mode 100644 index 1a8f653f0..000000000 --- a/tex/context/base/spec-dvi.tex +++ /dev/null @@ -1,118 +0,0 @@ -%D \module -%D [ file=spec-dvi, -%D version=1996.01.25, -%D title=\CONTEXT\ Special Macros, -%D subtitle=Generic \TEX\ Solutions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 \macros -%D {dostartobject, -%D dostopobject, -%D doinsertobject} -%D -%D Reuse of object is not supported by the \DVI\ format. We -%D therefore just duplicate them using boxes. - -\setjobsuffix{dvi} % can be overloaded in other spec's - -\startspecials[tex] - -\newbox\DVIobjects \newcounter\DVIobjectcounter - -\definespecial\dostartobject#1#2#3#4#5% - {\setbox\nextbox\vbox\bgroup - \def\dodostopobject - {\egroup - \doglobal\increment\DVIobjectcounter - \global\setbox\DVIobjects\vbox - {\offinterlineskip - \forgetall - \unvbox\DVIobjects - \setbox\nextbox\hbox{\box\nextbox}% - \wd\nextbox\zeropoint - \dp\nextbox\zeropoint - \ht\nextbox\onepoint - \allowbreak - \box\nextbox}% - \dosetobjectreference{#1}{#2}{\DVIobjectcounter}}} - -\definespecial\dostopobject - {\dodostopobject} - -\definespecial\doinsertobject#1#2% - {\bgroup - \dogetobjectreference{#1}{#2}\DVIobjectreference - \splittopskip\zeropoint - \setbox0=\copy\DVIobjects - \dimen0=\DVIobjectreference\onepoint - \advance\dimen0 -\onepoint - \setbox2\vsplit0 to \dimen0 - \ifdim\ht0>\onepoint - \setbox0\vsplit0 to \onepoint - \fi - \unvbox0 - \setbox0\lastbox - \hbox{\unhbox0}% the \hbox is really needed! - \egroup} - -%D \macros -%D {dosetposition, -%D dosetpositionwhd, -%D dosetpositionplus} -%D -%D The next specials only identify a position. It is up to -%D a \DVI\ postprocessing utility to merge the right commands -%D into the utility file. Since in \CONTEXT, we only deal -%D with relative positions, the reference point is not so -%D important. -%D -%D The postprocessor should translate the specials into -%D commands and append these to \type {jobname.tuo} using the -%D format: -%D -%D \starttyping -%D \pospxy {identifier}{page}{x}{y} -%D \pospxywhd {identifier}{page}{x}{y}{w}{h}{d} -%D \pospxyplus{identifier}{page}{x}{y}{w}{h}{d}{list} -%D \stoptyping -%D -%D The postprocessor should, of course, provide the \type -%D {page}, \type {x}, and \type {y} values. - -%D Now in spec-mis.tex: - -% \definespecial\dosetposition#1% -% {\special{pos:pxy "#1"}} -% -% \definespecial\dosetpositionwhd#1#2#3#4% -% {\special{pos:pxywhd "#1" #2 #3 #4}} -% -% \definespecial\dosetpositionplus#1#2#3#4#5% -% {\special{pos:pxyplus "#1" #2 #3 #4 #5}} - -%D The next special tells the position postprocessor what -%D page dimensions were used. - -%D Also in spec-mis.tex: - -% \let\flushDVIpositionpapersize\relax -% -% \definespecial\dosetpositionpapersize#1#2% -% {\xdef\flushDVIpositionpapersize% -% {\special{pos:papersize \number#1 \number#2}% -% \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }% -% \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} -% -% \prependtoksonce \flushDVIpositionpapersize \to \everyshipout - -\stopspecials - -\protect \endinput diff --git a/tex/context/base/spec-fdf.mkii b/tex/context/base/spec-fdf.mkii new file mode 100644 index 000000000..6579a9247 --- /dev/null +++ b/tex/context/base/spec-fdf.mkii @@ -0,0 +1,3444 @@ +%D \module +%D [ file=spec-fdf, +%D version=1998.05.18, +%D title=\CONTEXT\ \PDF\ Macros, +%D subtitle=Support Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D The name of this module is a bit strange but it started with fields +%D so we keep the name. + +%D When dealing with resources, we share the resource dictionaries +%D between all xforms. This is inefficent in the sense that when no +%D resources are used, redundant entries take space, but on the other +%D hand we save redundant dictionaries so it's a nice compromise. Maybe +%D that in \LUATEX\ I will reimplement most of the code here anyway. + +%D We need to check if we can use \type {\driverreferenced} +%D object in more places. + +%D Initialization of fields is tricky. If a field has no +%D value, it is kind of not there. If ResetForm is used, the +%D default is assigned, but pushbuttons are spoiled. Adding a +%D \type {/MK} dictionary helps, but gives ugly down +%D appearances (displaced with background). What a mess. +%D Also, in order to get at least something, the \type {/AS} +%D key should be provided. + +% to do : /IF << /SW /N >> == no scaling / clipping of widget + +\unprotect + +%D \macros +%D {PDFobjref} +%D +%D Just a shortcut. + +% Watch out, \def\PDFobjref#1{\purenumber#1 0 R} also works, but not when +% #1 == \the\whatever + +\def\PDFobjref#1{\purenumber{#1} 0 R} + +%D \macros +%D {PDFswapdir} + +\let\PDFswapdir\empty \def\PDFswapdir{\ifcase\inlinedirection\or\or-\fi} + +% the pdf spec changed cq. viewers started behaving differently / 5+ + +\chardef\overcomePDFpage\plusone % page numbers/ beware: optimizers remove this one +\chardef\overcomePDFpage\plustwo % page:number +%chardef\overcomePDFpage\plusthree % pdftex page ref feature + +\ifx\pdfpageref\undefined \else \chardef\overcomePDFpage\plusthree \fi + +%D \macros +%D {setPDFdestination} +%D +%D \PDF\ destinations should obey the specifications laid down +%D in the \PDF\ reference manual. The next macro strips illegal +%D characters from the destination name. +%D +%D The \ACROBAT\ programs are not bug free. By setting the next +%D switches, we will at least try to prevent problems. + +\newif\ifovercomePDFbugs \overcomePDFbugsfalse % dest sort problem / 3- +\newif\ifovercomePDFspace \overcomePDFspacetrue % dest sort problem / 3- + +\let\setPDFdestination\gobbleoneargument % a MK specific definition + +%D \macros +%D {sanitizePDFstring} +%D +%D This macro at least tries to convert a arbitrary string +%D into a sequence of characters valid for \PDF\ bookmarks and +%D alike. + +\def\sanitizePDFstring#1\to#2{} + +%D \macros +%D {doPDFdestination, +%D doPDFaction, +%D doPDFannotation, +%D doPDFannotationobject, +%D doPDFdictionaryobject, +%D doPDFarrayobject, +%D doPDFaddtocatalog, +%D doPDFaddtoinfo, +%D doPDFpageattribute, +%D doPDFpageresource, +%D doPDFpagesattribute, +%D doPDFbookmark, +%D defaultobjectreference, +%D doPDFgetobjectreference} +%D +%D This module deals with \PDF\ support, including fill||in +%D forms. Before we present the largely unreadable bunch of +%D macros, we introduce the here||not||defined low level +%D interface macros. These must be provided by the special +%D drivers \type{pdf} (\ACROBAT) and \type{tpd} (\PDFTEX). +%D +%D \starttyping +%D \doPDFdestination #1 name +%D \doPDFaction #1#2#3 width height action +%D \doPDFannotation #1#2#3 width height data +%D \doPDFannotationobject #1#2#3#4#5 class name width height data +%D \doPDFdictionaryobject #1#2#3 class name data +%D \doPDFarrayobject #1#2#3 class name data +%D \doPDFaddtocatalog #1 +%D \doPDFaddtoinfo #1 +%D \doPDFpageattribute #1 +%D \doPDFpageresource #1 +%D \doPDFpagesattribute #1 +%D \doPDFbookmark #1#2#3#4#5 level n text page open +%D +%D \defaultobjectreference #1#2 class name +%D \doPDFgetobjectreference #1#2#3 class name \PDFobjectreference +%D \doPDFgetobjectpagereference #1#2#3 class name \PDFobjectreference +%D \stoptyping +%D +%D The keywords reflect their use. For the moment we stick to +%D keywords, because that way at we get an indication of what +%D we're doing. + +\startspecials[fdf] + +%D Common: + +% \def\doPDFgetobjectreference#1#2#3% +% {\def#3{..}} + +\def\doPDFgetobjectpage#1#2#3% + {\dogetobjectreferencepage{#1}{#2}#3% + \ifx#3\empty\def#3{\realfolio}\fi} + +\def\doPDFgetobjectpagereference#1#2#3% + {\dogetobjectreferencepage{#1}{#2}#3% + \ifx#3\empty + \doPDFgetpagereference\realfolio#3% + \else + \doPDFgetpagereference#3#3% we assume that #3 gets expanded + \fi} + +% \def\doPDFgetpagereference#1#2%%%%%%%%%%%%%%% +% {\def#2{...}} + +%D Due to the fact that \PDFTEX\ has a different concept of +%D page attributes, we need: + +\let\doPDFresetpageattributes\relax +\let\doPDFresetpageresources \relax + +\appendtoksonce + \doPDFresetpageattributes + \doPDFresetpageresources +\to \everyaftershipout + +\ifx\PDFcode\undefined + \ifx\pdfliteral\undefined + \def\PDFcode#1{\message{[ignored pdfliteral: #1]}} + \else + \let\PDFcode\pdfliteral + \fi +\fi + +%D For special (\METAPOST) effects, we need to build +%D resource dictionaries. Here is the framework. + +\let\docuPDFextgstates\empty +%let\pagePDFextgstates\empty + +\def\checkPDFextgstates + {\ifx\docuPDFextgstates\empty \else + \ifnum\realpageno=\lastpage\relax + %\doPDFreserveddictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}% + \doPDFdictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}% + \fi + \doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference + \doPDFpageresource{/ExtGState \PDFobjectreference}% + \fi} + +\appendtoksonce + \checkPDFextgstates +\to \everyshipout + +\def\appendtoPDFdocumentextgstates#1% + {\xdef\docuPDFextgstates{\docuPDFextgstates\space#1}} + +%D Another special mechanism (needed for color separation): + +\let\docuPDFcolorspaces\empty + +\def\checkPDFcolorspaces + {\ifx\docuPDFcolorspaces\empty \else + \ifnum\realpageno=\lastpage\relax + %\doPDFreserveddictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}% + \doPDFdictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}% + \fi + \doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference + \doPDFpageresource{/ColorSpace \PDFobjectreference}% + \fi} + +\appendtoksonce + \checkPDFcolorspaces +\to \everyshipout + +\def\appendtoPDFdocumentcolorspaces#1% + {\xdef\docuPDFcolorspaces{\docuPDFcolorspaces\space#1}} + +%D And another one (used to be in spec-pdf) + +\let\docuPDFshades\empty + +\def\checkPDFshades + {\ifx\docuPDFshades\empty \else + \ifnum\realpageno=\lastpage\relax + %\doPDFreserveddictionaryobject{FDF}{docushades}{\docuPDFshades}% + \doPDFdictionaryobject{FDF}{docushades}{\docuPDFshades}% + \fi + \doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference + \doPDFpageresource{/Shading \PDFobjectreference}% + \fi} + +\appendtoksonce + \checkPDFshades +\to \everyshipout + +\def\appendtoPDFdocumentshades#1% + {\xdef\docuPDFshades{\docuPDFshades\space#1}} + +%D \macros +%D {doPDFsetupscreen,doPDFsetupidentity} +%D +%D Opposite to \DVI\ drivers, \PDF\ ones must know which what +%D page dimensions they are dealing. We also use the +%D opportunity to launch full screen (1) or show bookmarks (2). + +\let\currentPDFpagemode \empty % document catalog +\let\currentPDFviewerprefs\empty % document catalog + +\let\currentPDFcropbox \empty % page attributes +\let\currentPDFbleedbox \empty % page attributes +\let\currentPDFartbox \empty % page attributes +\let\currentPDFtrimbox \empty % page attributes + +\def\doPDFsetupscreen#1#2#3#4#5#6% watch the extra argument + {\bgroup +% \!!widtha#4% +% \advance\!!widtha#2% +% \!!heighta-#5% +% \!!heightb#1% extra argument +% \advance\!!heightb -#3% +% \advance\!!heighta \!!heightb +% % sometimes whole values give better results +% % \PointsToWholeBigPoints{#2}\left +% % \PointsToWholeBigPoints\!!heighta\bottom +% % \PointsToWholeBigPoints\!!widtha \width +% % \PointsToWholeBigPoints\!!heightb\height +% % but since pdf/x does not round when checking if +% % the boxes fit inside the media box ... +% \PointsToBigPoints{#2}\left +% \PointsToBigPoints\!!heighta\bottom +% \PointsToBigPoints\!!widtha \width +% \PointsToBigPoints\!!heightb\height +% \xdef\currentPDFcropboxspec +% {[\left\space\bottom\space\width\space\height]}% +% \global\let\currentPDFtrimboxspec\currentPDFcropboxspec +% +% \xdef\currentPDFpagemode +% {/PageMode \ifcase#6 +% /UseNone\or/FullScreen\or/UseOutlines\else/UseNone\fi}% +% + \xdef\currentPDFpagemode + {\ifnum#6=4 + /PageLayout /TwoColumnRight + \else + /PageMode \ifcase#6 + /UseNone\or/FullScreen\or/UseOutlines\else/UseNone\fi + \fi}% + \xdef\currentPDFviewerprefs % space after #6 needed, else \relax + {\ifcase#6 \or\or\else /ViewerPreferences << /FitWindow true >>\fi}% + \egroup} + +% not that good if we switch drivers + +\def\addPDFdocumentinfo + {\doPDFaddtocatalog{\currentPDFpagemode\currentPDFviewerprefs}% + \doPDFaddtocatalog{/Version /\PDFversion}% + \doPDFaddtoinfo{/Trapped /False}% + \doPDFaddtoinfo{/ConTeXt.Version (\contextversion)}% + \doPDFaddtoinfo{/ConTeXt.Time (\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}% + \doPDFaddtoinfo{/ConTeXt.Jobname (\jobname)}% + \doPDFaddtoinfo{/ConTeXt.Url (www.pragma-ade.com)}} + +\appendtoksonce % hack to prevent duplicates + \addPDFdocumentinfo +\to \everyfirstshipout + +\def\PDFversion{1.5} + +\appendtoksonce + \def\PDFversion{1.5}% + \let\addPDFdocumentinfo\relax +\to \everyresetspecials + +\def\doPDFsetupwhateverbox#1#2#3#4#5#6% watch the extra arguments + {\bgroup + \!!widtha \dimexpr#5+#3\relax + \!!heightb\dimexpr#2-#4\relax + \!!heighta\dimexpr\!!heightb-#6\relax + % sometimes whole values give better results + % \PointsToWholeBigPoints{#3}\left + % \PointsToWholeBigPoints\!!heighta\bottom + % \PointsToWholeBigPoints\!!widtha \width + % \PointsToWholeBigPoints\!!heightb\height + % but since pdf/x does not round when checking if + % the boxes fit inside the media box ... + \PointsToBigPoints{#3}\left + \PointsToBigPoints\!!heighta\bottom + \PointsToBigPoints\!!widtha \width + \PointsToBigPoints\!!heightb\height + \xdef#1{[\left\space\bottom\space\width\space\height]}% + \egroup} + +\def\doPDFsetupartbox {\doPDFsetupwhateverbox\currentPDFartbox } +\def\doPDFsetupcropbox {\doPDFsetupwhateverbox\currentPDFcropbox } +\def\doPDFsetupbleedbox{\doPDFsetupwhateverbox\currentPDFbleedbox} +\def\doPDFsetuptrimbox {\doPDFsetupwhateverbox\currentPDFtrimbox } + +\gdef\currentPDFtrimbox{\currentPDFcropbox} % default, needed for pdf/x + +\def\flushPDFwhateverbox#1#2% + {\doifsomething{#1}{\doPDFpageattribute{/#2Box #1}}} + +\def\flushPDFpageboxes + {\flushPDFwhateverbox\currentPDFartbox {Art}% + \flushPDFwhateverbox\currentPDFcropbox {Crop}% + \flushPDFwhateverbox\currentPDFbleedbox{Bleed}% + \flushPDFwhateverbox\currentPDFtrimbox {Trim}} + +\appendtoksonce + \flushPDFpageboxes +\to \everyshipout + +\def\doPDFsetupidentity#1#2#3#4#5#6% + {\bgroup + \enablePDFdocencoding + \edef\!!stringa{#5}% + \ifx\!!stringa\empty \ifx\pdfdate\undefined\else + \edef\!!stringa{D:\pdfdate}% + \fi \fi + \expanded{\doPDFaddtoinfo + {/Title (#1) + /Subject (#2) + /Author (#3) + /Creator (#4) + /ModDate (\!!stringa) + /ID (\jobname.\!!stringa) % needed for pdf/x + /Keywords (#6)}}% + \egroup} + +%D \macros +%D {doPDFsetupopenaction,doPDFsetupcloseaction, +%D doPDFsetupopenpageaction,doPDFsetupclosepageaction} +%D +%D Setting the open and close actions is kind of fuzzy +%D because action chains are derived from the reference +%D mechanism. + +%D Starting with version~5 viewers, when the open actions +%D started yto give problems, for testing purposes we +%D decided use indirect actions. + +% \definespecial\dosetupopenaction {\doPDFsetupopenaction} +% \definespecial\dosetupcloseaction {\doPDFsetupcloseaction} +% \definespecial\dosetupopenpageaction {\doPDFsetupopenpageaction} +% \definespecial\dosetupclosepageaction{\doPDFsetupclosepageaction} + +\let\lastPDFaction\empty + +%D We can safe a couple of references by moving this code +%D to the specific drivers. +%D +%D The following code used to work okay, but as with any +%D update of Acrobat Viewers, upward compatibility was +%D just a dream. + +\definespecial\dosetupopenaction {\doPDFaddtocatalog{/OpenAction <<\lastPDFaction>>}} +\definespecial\dosetupcloseaction{\doPDFaddtocatalog{/CloseAction <<\lastPDFaction>>}} + +% todo: /AA << dictionary in catalog >> + +% \globalletempty\PDFdocumentclose +% \globalletempty\PDFwillsave +% \globalletempty\PDFdidsave +% \globalletempty\PDFwillprint +% \globalletempty\PDFdidprint + +% \definespecial\dosetupdocumentcloseaction {\global\let\PDFdocumentclose\lastPDFaction} +% \definespecial\dosetupwillsaveaction {\global\let\PDFwillsave \lastPDFaction} +% \definespecial\dosetupdidsaveaction {\global\let\PDFdidsave \lastPDFaction} +% \definespecial\dosetupwillprintaction {\global\let\PDFwillprint \lastPDFaction} +% \definespecial\dosetupdidprintaction {\global\let\PDFdidprint \lastPDFaction} + +% \def\checkPDFdocumentactions +% {\iflocation +% \doPDFpageattribute +% {/AA <<\ifx\PDFdocumentclose\empty \else /DC <<\PDFdocumentclose>> \fi +% \ifx\PDFwillsave \empty \else /WS <<\PDFwillsave >> \fi +% \ifx\PDFdidsave \empty \else /DS <<\PDFdidsave >> \fi +% \ifx\PDFwillprint \empty \else /WP <<\PDFwillprint >> \fi +% \ifx\PDFdidprint \empty \else /DP <<\PDFdidprint >> \fi>>}% +% % \globalletempty\PDFdocumentclose +% % \globalletempty\PDFwillsave +% % \globalletempty\PDFdidsave +% % \globalletempty\PDFwillprint +% % \globalletempty\PDFdidprint +% \global\let\checkPDFdocumentactions\relax +% \fi} + +% \appendtoksonce +% \checkPDFdocumentactions +% \to \everylastshipout + +%\def\doPDFsetupopenaction% +% {\doPDFdictionaryobject{FDF}{local:openaction}\lastPDFaction +% \doPDFgetobjectreference{FDF}{local:openaction}\PDFobjectreference +% \doPDFaddtocatalog{/OpenAction \PDFobjectreference}} +% +%\def\doPDFsetupcloseaction% +% {\doPDFdictionaryobject{FDF}{local:closeaction}\lastPDFaction +% \doPDFgetobjectreference{FDF}{local:closeaction}\PDFobjectreference +% \doPDFaddtocatalog{/CloseAction \PDFobjectreference}} + +\let\PDFopenpageaction \empty +\let\PDFclosepageaction\empty + +\definespecial\dosetupopenpageaction {\global\let\PDFopenpageaction \lastPDFaction} +\definespecial\dosetupclosepageaction{\global\let\PDFclosepageaction\lastPDFaction} + +\def\checkPDFpageactions + {\iflocation % important since direct -) + \donefalse + \ifx\PDFopenpageaction \empty\!!doneafalse\else\donetrue\!!doneatrue\fi + \ifx\PDFclosepageaction\empty\!!donebfalse\else\donetrue\!!donebtrue\fi + \ifdone + \doPDFpageattribute + {/AA <<\if!!donea/O <<\PDFopenpageaction >> \fi + \if!!doneb/C <<\PDFclosepageaction>> \fi>>}% + \fi + \global\let\PDFopenpageaction \empty + \global\let\PDFclosepageaction\empty + \fi} + +\appendtoksonce + \checkPDFpageactions +\to \everyshipout + +%D \macros +%D {doPDFstartthisislocation} +%D +%D Next we define the macros that deal with hyperreferencing, +%D graphic inclusion and general document features. These are +%D the olderst ones. I won't comment much because one needs +%D knowledge of \PDF\ itself, and explaning \PDF\ is beyond +%D this documentation. + +\def\doPDFstartthisislocation#1% + {\bgroup + \setPDFdestination{#1}% + \ifx\PDFdestination\empty \else + \doPDFdestination{\PDFdestination}% + \fi + \egroup} + +%D \macros +%D {doPDFstartgotolocation, +%D doPDFstartgotorealpage, +%D doPDFstartgotoJS} +%D +%D The goto macros use the switch \type{\ifsecondaryreference} +%D to determine if actions should be linked. + +\def\locationfilesuffix{pdf} + +% \def\preparePDFlocationfile#1#2% +% {\setreferencefilename#1\to#2% +% \expanded{\doifnotinstring{.\locationfilesuffix}{#2}} +% {\edef#2{#2.\locationfilesuffix}}} +% +% \def\preparePDFlocationfile#1\to#2% +% {\setreferencefilename#1\to#2% +% \expanded{\doifnotinstring{.pdf}{#2}}{\edef#2{#2.pdf}}} + +\def\doPDFstartgotolocation#1#2#3#4#5#6% + {\bgroup + \doifelsenothing{#3} + {\setPDFdestination{#5}% + \doifelsenothing\PDFdestination + {\let\action\empty} + {\doifelsenothing{#4} + {\let\PDFfile\empty} + {\expanded{\beforesplitstring#4}\at.\to\PDFfile + \doifparentfileelse\PDFfile % {#4} + {\let\PDFfile\empty} + %{\setreferencefilename#4.\locationfilesuffix\to\PDFfile + {\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile + \edef\PDFfile + {R /F (\PDFfile)\ifgotonewwindow\space/NewWindow true \fi}}}% + \edef\action% + {/S /GoTo\PDFfile\space /D (\PDFdestination)}}} + {\doifelsenothing{#4} + {\let\PDFfile\empty + \let\PDFdestination\empty} + {\setreferencefilename/#4\to\PDFfile + \setPDFdestination{#5}% + \doifsomething\PDFdestination + {\edef\PDFdestination{\URLhash\PDFdestination}}}% + \edef\action{/S /URI /URI (#3\PDFfile\PDFdestination)}}% + \ifx\action\empty\else + \ifsecondaryreference + \savesecondaryPDFreference\action + \else + \getsecondaryPDFreferences + \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% + \fi + \fi + \egroup} + +\def\PDFgotonewwindow{\ifgotonewwindow\space/NewWindow true \fi} + +% optimization in tpd driver +% +% \edef\PDFdestination{(page:\the\scratchcounter)}% +% +% ==> +% +% \advance\scratchcounter 1 +% \edef\PDFdestination{[\pdfpageref \PDFobjref\scratchcounter\PDFpageviewwrd]}% +% +% \doPDFgetpagedestination#1#2% pagenumber macro % % fuzzy hack + +\def\doPDFstartgotorealpage#1#2#3#4#5% watch the R append trick + {\bgroup + \doifelsenothing{#3}% #1 = url + {\scratchcounter0#5\relax + \ifnum\scratchcounter>0 + \doifelsenothing{#4} + {\let\PDFfile\empty} + {\expanded{\beforesplitstring#4}\at.\to\PDFfile + \doifparentfileelse\PDFfile % {#4} + {\let\PDFfile\empty} + %{\setreferencefilename#4.\locationfilesuffix\to\PDFfile + {\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile + \edef\PDFfile{R /F (\PDFfile)\PDFgotonewwindow}}}% + \ifx\PDFfile\empty + \ifcase\overcomePDFpage + \or % pdf starts numbering at zero + \advance\scratchcounter \minusone + \edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}% + \or % pdf starts numbering at zero + \advance\scratchcounter \minusone + \edef\PDFdestination{(page:\the\scratchcounter)}% + \or % pdftex starts numbering at one + \edef\PDFdestination{[\pdfpageref\scratchcounter\space0 R \PDFpageviewwrd]}% + \fi + \else % across files it's a page number / pdf starts numbering at zero + \advance\scratchcounter \minusone + \edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}% + \fi + \edef\action{/S /GoTo\PDFfile\space /D \PDFdestination}% + \else + \let\action\empty + \fi} + {\doifelsenothing{#4} + {\let\PDFfile\empty} + {\setreferencefilename/#4\to\PDFfile}% + \edef\action{/S /URI /URI (#3\PDFfile)}}% + \ifx\action\empty\else + \ifsecondaryreference + \savesecondaryPDFreference\action + \else + \getsecondaryPDFreferences + \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% + \fi + \fi + \egroup} + +\let\lastfakedPDFpage\!!zerocount + +\def\fakePDFpagedestination % as in pdf, we start numbering at zero + {\iflocation \ifarrangingpages \else \ifnum\overcomePDFpage=\plustwo + \ifnum\lastfakedPDFpage<\realpageno + \bgroup + \xdef\lastfakedPDFpage{\realfolio}% + \advance\realpageno \minusone % is \expanded needed ? + \expanded{\doPDFdestination{page:\realfolio}}% + \egroup + \fi + \fi \fi \fi} + +\appendtoksonce + \fakePDFpagedestination +\to \everyshipout + +\def\doPDFstartgotoJS#1#2#3% + {\bgroup + \doPSsanitizeJScode#3\to\sanitizedJScode + \edef\action + {/S /JavaScript /JS (\sanitizedJScode)}% + \ifsecondaryreference + \savesecondaryPDFreference\action + \else + \getsecondaryPDFreferences + \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% + \fi + \egroup} + +%D \macros +%D {doPDFstartexecutecommand} +%D +%D At the cost of much auxiliary placeholders, we can pretty +%D fast convert the command asked for. This is how the \PDF\ +%D code looks like. + +\def\PDFmoviecode#1#2#3% + {/Movie + /T (\ifcase#1movie \else sound \fi\ifx\argumentA\empty#2\else\argumentA\fi) + /Operation /\ifcase#3Play\or Stop\or Pause\or Resume\fi\space} + +\def\PDFexecutestartmovie {\PDFmoviecode0\currentmovie0} +\def\PDFexecutestopmovie {\PDFmoviecode0\currentmovie1} +\def\PDFexecutepausemovie {\PDFmoviecode0\currentmovie2} +\def\PDFexecuteresumemovie {\PDFmoviecode0\currentmovie3} + +\def\PDFexecutestartsound {\PDFmoviecode1\currentsound0} +\def\PDFexecutestopsound {\PDFmoviecode1\currentsound1} +\def\PDFexecutepausesound {\PDFmoviecode1\currentsound2} +\def\PDFexecuteresumesound {\PDFmoviecode1\currentsound3} + +\def\PDFformcode#1% + {\doFDFiffieldset{#1}{/Field [\doFDFgetfieldset{#1}]}} + +% bit 3 = html +% bit 6 = xml +% bit 4 = get + +\ifx\PDFsubmitfiller\undefined \let\PDFsubmitfiller\empty \fi + +\chardef\PDFformmethod=1 % 0=GET 1=POST + +\def\PDFformflag#1#2{\ifcase\PDFformmethod#1\else#2\fi} + +\def\PDFexecuteimportform {/Named /N /AcroForm:ImportFDF} +\def\PDFexecuteexportform {/Named /N /AcroForm:ExportFDF} +\def\PDFexecuteresetform {/ResetForm \PDFformcode\argumentA} +\def\PDFexecutesubmitform {/SubmitForm \PDFformcode\argumentB + /Flags \ifcase\submitoutputformat\space + \PDFformflag{12} {4} % 0=unknown + \or \PDFformflag{12} {4} % 1=HTML + \or \PDFformflag {8} {0} % 2=FDF + \or \PDFformflag{40}{32} % 3=XML + \else \PDFformflag{12} {4} % ?=unknown + \fi + /F (\argumentA)\PDFsubmitfiller} + +% urifill permits url substitution + +\def\PDFexecutehide {/Hide /T (\argumentA) /H true} +\def\PDFexecuteshow {/Hide /T (\argumentA) /H false} + +\def\PDFexecutefirst {/Named /N /FirstPage} +\def\PDFexecuteprevious {/Named /N /PrevPage} +\def\PDFexecutenext {/Named /N /NextPage} +\def\PDFexecutelast {/Named /N /LastPage} +\def\PDFexecutebackward {/Named /N /GoBack} +\def\PDFexecuteforward {/Named /N /GoForward} +\def\PDFexecuteprint {/Named /N /Print} +\def\PDFexecuteexit {/Named /N /Quit} +\def\PDFexecuteclose {/Named /N /Close} +\def\PDFexecutesave {/Named /N /Save} +\def\PDFexecutesavenamed {/Named /N /SaveAs} +\def\PDFexecuteopennamed {/Named /N /Open} +\def\PDFexecutehelp {/Named /N /HelpUserGuide} +\def\PDFexecutetoggle {/Named /N /FullScreen} +\def\PDFexecutesearch {/Named /N /Find} +\def\PDFexecutesearchagain {/Named /N /FindAgain} +\def\PDFexecutegotopage {/Named /N /GoToPage} +\def\PDFexecutequery {/Named /N /AcroSrch:Query} +\def\PDFexecutequeryagain {/Named /N /AcroSrch:NextHit} +\def\PDFexecutefitwidth {/Named /N /FitWidth} +\def\PDFexecutefitheight {/Named /N /FitHeight} + +\let\PDFobjectclass\empty +\let\PDFobjectname \empty + +\def\doPDFstartexecutecommand#1#2#3#4% + {\doifdefined{PDFexecute#3} + {\bgroup + \edef\argument{#4}% + \ifx\argument\empty + \let\argumentA\empty + \let\argumentB\empty + \else + \@EA\dogetcommalistelement\@EA1\@EA\from#4\to\argumentA + \@EA\dogetcommalistelement\@EA2\@EA\from#4\to\argumentB + \fi + \edef\action% + {/S \getvalue{PDFexecute#3}}% + \ifsecondaryreference + \savesecondaryPDFreference\action + \else + \getsecondaryPDFreferences +% \ifx\PDFobjectclass\empty +% \let\next\doPDFaction +% \else +% \edef\next{\doPDFactionobject{\PDFobjectclass}{\PDFobjectname}}% +% \globalletempty\PDFobjectclass +% \globalletempty\PDFobjectname +% \fi +% \next + \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% + \fi + \egroup}} + +%D \macros +%D {doPDFstartrunprogram} +%D +%D Running programs is possible, but is non that portable, and +%D therefore dangerous. + +\def\doPDFstartrunprogram#1#2#3#4% new: #3 => #3#4 + {\bgroup + %\edef\string{#3}% + %\@EA\beforesplitstring\string\at{ }\to\program + %\@EA\aftersplitstring \string\at{ }\to\parameters + %\edef\action% + % {/S /Launch /F (\program) /P (\parameters) /D (.)}% + \edef\action + {/S /Launch /F (#3) /P (#4) /D (.)}% + \ifsecondaryreference + \savesecondaryPDFreference\action + \else + \getsecondaryPDFreferences + \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% + \fi + \egroup} + +%D \macros +%D {doPDFstartgotoprofile} +%D +%D Far from perfect, but nevertheless present, is the profile +%D handler. We want to misuse article threads for reder +%D profiles. + +\def\doPDFstartgotoprofile#1#2#3% to be done: file + {\bgroup + \setPDFdestination{#3}% + \doifsomething\PDFdestination + {\edef\action + {/S /Thread /D (\PDFdestination)}% + \ifsecondaryreference + \savesecondaryPDFreference\action + \else + \getsecondaryPDFreferences + \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% + \fi}% + \egroup} + +%D \macros +%D {doPDFsetpagetransition} +%D +%D This array holds a reasonable selection of transitions +%D (watch out: \type{replace} is not in this list). Most of +%D the transitions look awful anyway. By the way, \CONTEXT\ is +%D able to select transitions randomly. + +% some day, when 1.5 is on linux and apple, we will add: +% +% \def\pagetransitions +% {{split,in,vertical},{split,in,horizontal}, +% {split,out,vertical},{split,out,horizontal}, +% {blinds,horizontal},{blinds,vertical}, +% {box,in},{box,out}, +% {wipe,east},{wipe,west},{wipe,north},{wipe,south}, +% dissolve, +% {glitter,east},{glitter,south}, +% {fly,in,east},{fly,in,west},{fly,in,north},{fly,in,south}, +% {fly,out,east},{fly,out,west},{fly,out,north},{fly,out,south}, +% {push,east},{push,west},{push,north},{push,south}, +% {cover,east},{cover,west},{cover,north},{cover,south}, +% {uncover,east},{uncover,west},{uncover,north},{uncover,south}, +% fade} + +\def\pagetransitions + {{split,in,vertical},{split,in,horizontal}, + {split,out,vertical},{split,out,horizontal}, + {blinds,horizontal},{blinds,vertical}, + {box,in},{box,out}, + {wipe,east},{wipe,west},{wipe,north},{wipe,south}, + dissolve, + {glitter,east},{glitter,south}} + +%D Again, we use macros as placeholders for \PDF\ key||value +%D pairs. + +\def\PDFpagesplit {/S /Split } +\def\PDFpageblinds {/S /Blinds } +\def\PDFpagebox {/S /Box } +\def\PDFpagewipe {/S /Wipe } +\def\PDFpagedissolve {/S /Dissolve } +\def\PDFpageglitter {/S /Glitter } +\def\PDFpagereplace {/S /R } + +\def\PDFpagefly {/S /Fly } % 1.5 +\def\PDFpagepush {/S /Push } % 1.5 +\def\PDFpagecover {/S /Cover } % 1.5 +\def\PDFpageuncover {/S /Uncover } % 1.5 +\def\PDFpagefade {/S /Fade } % 1.5 + +\def\PDFpagehorizontal {/Dm /H } +\def\PDFpagevertical {/Dm /V } +\def\PDFpagein {/M /I } +\def\PDFpageout {/M /O } +\def\PDFpageeast {/Di 0 } +\def\PDFpagenorth {/Di 90 } +\def\PDFpagewest {/Di 180 } +\def\PDFpagesouth {/Di 270 } + +\def\dodoPDFsetpagetransition#1% + {\doifdefined{PDFpage#1} + {\edef\PDFpagetransitions{\PDFpagetransitions\getvalue{PDFpage#1}}}} + +\def\doPDFsetpagetransition#1#2% + {\let\PDFpagetransitions\empty + \processcommalist[#1]\dodoPDFsetpagetransition + \doPDFpageattribute + %{\ifnum#2>0 /Dur #2 \fi + {\ifnum0<0#2 /Dur #2 \fi + \ifx\PDFpagetransitions\empty\else/Trans <<\PDFpagetransitions>>\fi}} +% \ifx\PDFpagetransitions\empty\else/Trans <>\fi}} + +%D \macros +%D {doPDFinsertmov} +%D +%D Most of the annotations we use here are of type {\em +%D link}, but here is another one: the {\em movie} annotation. +%D The driver module must implement \type {setcurrentmovie}. + +%D Great: this will become an obsolete pdf feature; why did we have to +%D keep up with the bugs ... and by the time acrobat gets better in +%D handling it have to drop it. + +\let\currentmovie\s!unknown + +\def\doPDFinsertmov + {\bgroup + \xdef\currentmovie{\@@DriverImageLabel}% + \PointsToBigPoints\@@DriverImageWidth \width + \PointsToBigPoints\@@DriverImageHeight\height + \let\pdf@@options\empty + \let\pdf@@actions\empty + \donefalse + \expanded{\processallactionsinset[\@@DriverImageOptions]} + [\v!controls=>\donetrue, + \v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }, + \v!preview=>\edef\pdf@@options{\pdf@@options /Poster true }]% + \edef\pdf@@actions{\pdf@@actions /ShowControls \ifdone true\else false\fi}% + \doPDFannotation\@@DriverImageWidth\@@DriverImageHeight + {/Subtype /Movie + /Border [0 0 0] + /T (movie \currentmovie) + /Movie << /F (\@@DriverImageFile) /Aspect [\width\space\height] \pdf@@options >> + /A << \pdf@@actions >>}% + \egroup} + +%D \macros +%D {doPDFinsertsoundtrack} +%D +%D In \PDF\ sounds can be embedded like movies. + +\ifx\everygoto\undefined \newtoks\everygoto \fi + +\let\currentsound\s!unknown + +\def\doPDFinsertsoundtrack#1#2#3% + {\bgroup + \xdef\currentsound{#2}% + \let\pdf@@actions\empty + \@EA\processallactionsinset\@EA + [#3] + [\v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }]% + \collectdriverresource + %\flushatshipout % since it can be buried in a chained box + {\doPDFannotation{0pt}{0pt} + {/Subtype /Movie + /Border [0 0 0] + /T (sound \currentsound) + /Movie <>% + \ifx\pdf@@actions\empty\else/A << \pdf@@actions >>\fi}}% + \egroup} + +%D \macros +%D {doPDFattachfile} + +\def\doPDFfilestreamobject#1#2#3#4% + {} + +\def\doPDFfilestreamidentifier#1% + {0} + +\def\doPDFgetfilestreamreference#1#2% + {0 0 R} + +\def\doPDFattachfile#1#2#3#4#5#6#7#8% + {\bgroup % title width height color symbol file + \edefconvertedargument\PDFfile{#8}% + % beware: the symbol may (indirectly) use the file + % reference when typesetting the object number; + \presetPDFsymbolappearance{#5}{#6}{#2}{#3}{#4}% sets width/height + \startPDFsymbolappearance + \doPDFembedfile\PDFfile{#7}{#8}% + \doPDFgetembeddedfilereference\PDFfile\PDFobjectreference + \setFDFlayer\@@DriverAttachmentLayer + \doPDFannotation{\width}{\totalheight} + {/Subtype /FileAttachment + /FS \PDFobjectreference\space + /Contents (#1) + \PDFsymbol + \FDFlayer + \PDFattributes}% + \stopPDFsymbolappearance + \egroup} + +% semi-public + +\def\doPDFembedfile#1#2#3% symbolic name | filename | user name + {\edefconvertedargument\PDFfile{#1}% + \doifnotflagged{a:\PDFfile}% + {\doPDFfilestreamobject{PDFEF}{\PDFfile}{#2}{#3}% + \doglobal\setflag{a:\PDFfile}}} + +\def\doPDFgetembeddedfilereference#1#2% + {\edefconvertedargument\PDFfile{#1}% + \doPDFgetobjectreference{PDFEF}\PDFfile#2} + +\def\doPDFgetembeddedfilestreamreference#1#2% + {\edefconvertedargument\PDFfile{#1}% + \doPDFgetfilestreamreference\PDFfile#2} % == \doPDFgetobjectreference{PDFFS}\PDFfile#2 + +\definespecial \doattachfile {\doPDFattachfile} + +% requested by Jens-Uwe Morawski: permits usage of pdftosrc +% in viewers that don't support attachments: +% +% \definesymbol +% [ObjectNumber] +% % [object number {\PDFattachmentnumber[xx]}] % named +% [object number \PDFattachmentnumber] % current +% +% \useattachment[test][xx][test.tex] +% \setupattachments[symbol=ObjectNumber] +% \attachment[test] + +\def\PDFattachmentnumber + {\dosingleargument\doPDFattachmentnumber} + +\def\doPDFattachmentnumber[#1]% + {\iffirstargument + \doPDFfilestreamidentifier{#1}% + \else + \doPDFfilestreamidentifier\PDFfile + \fi} + +%D \macros +%D {...} +%D +%D Rather preliminary. We have to wait till the complete specs +%D show up. As usual, we cannot really check it (Acrobat 6.0 +%D has a bug that inhibits us to make a test file). Half a day +%D of testing made clear that trying to control the plugin fails +%D in most cases (we need plugin specs -). We also miss a feature +%D to let acrobat wait with proceeding (action processing) till +%D the media clip is ready. + +% aiff audio/aiff +% au audio/basic +% avi video/avi +% mid audio/midi +% mov video/quicktime +% mp3 audio/x-mp3 (mpeg) +% mp4 audio/mp4 +% mp4 video/mp4 +% mpeg video/mpeg +% smil application/smil +% swf application/x-shockwave-flash + +% beware, this is preliminary code, should be improved + +\def\PDFrenderingspecs#1{\executeifdefined{PDFMR:#1}\empty} + +\def\PDFexecutestartrendering {/Rendition /OP 0 \PDFrenderingspecs\argumentA} +\def\PDFexecutestoprendering {/Rendition /OP 1 \PDFrenderingspecs\argumentA} +\def\PDFexecutepauserendering {/Rendition /OP 2 \PDFrenderingspecs\argumentA} +\def\PDFexecuteresumerendering {/Rendition /OP 3 \PDFrenderingspecs\argumentA} + +% todo : sub files +% +% \doPDFembedfile{pier-39.png}{pier-39.png}{pier-39.png}% +% \doPDFgetembeddedfilestreamreference{pier-39.png}\xPDFobjectreference +% \edef\xxxx{/RF [(pier-39.png) \xPDFobjectreference]}% + +% todo: alternative renderings +% +% object_1 -> <> >> +% object_2 -> <> >> +% +% rendering -> <> + +% todo: embedded files (too buggy) +% +% \let\PDFattribute\empty +% % /D \PDFobjectreference +% % test one, no error, but ignored +% \doifinset\v!file{#4} +% {\doPDFembedfile{#3}{#3}{#3}% +% \doPDFgetembeddedfilestreamreference{#3}\PDFobjectreference +% \edef\PDFattribute{/EF \PDFobjectreference}}% +% % official, does not work either +% \doifinset\v!file{#4} +% {\doPDFembedfile{#3}{#3}{#3}% +% \doPDFgetembeddedfilereference{#3}\PDFobjectreference} +% % do we play the game as follows + +\definespecial\doinsertrendering#1#2#3#4% tag mime file options + {\ifundefined{PDFMR:#1}% + \doifinstringelse{://}{#3}\donetrue\donefalse % evt url as keyword + \doPDFdictionaryobject{PDFMF}{#1} + {/Type /Rendition + /S /MR + % does not work: /SP << /Type /MediaScreenParam /BE << /B [1 0 0] /O 0.5 >> >> + /C << /Type /MediaClip + /S /MCD + /N (#1) + /Alt [() (file not found)] % language id + message + /D << /Type /Filespec + /F (#3) + \ifdone/FS /URL\fi >> + /CT (#2) >>}% + % common code + \doifobjectreferencefoundelse{PDFMS}{#1} + {\doPDFgetobjectreference{PDFMS}{#1}\PDFobjectreferenceB} + {\doPDFgetobjectreference{PDFMU}{#1}\PDFobjectreferenceB}% + \doPDFgetobjectreference{PDFMF}{#1}\PDFobjectreferenceA + \setxvalue{PDFMR:#1}% needed /AA actions in /Screen + {/R \PDFobjectreferenceA + /AN \PDFobjectreferenceB}% + \doifobjectreferencefoundelse{PDFMS}{#1}\donothing + {\dodoinsertrenderingwindow{PDFMU}{#1}\zeropoint\zeropoint{#4}}% + \fi} + +\definespecial\doinsertrenderingobject#1#2#3#4% tag class objectname options + {\ifundefined{PDFMR:#1}% + \doPDFgetobjectreference{#2}{#3}\PDFobjectreference + \doPDFdictionaryobject{PDFMF}{#1} + {/Type /Rendition + /S /MR + /C << /Type /MediaClip + /S /MCD + /N (#1) + /D \PDFobjectreference>>}% + % common code + \doifobjectreferencefoundelse{PDFMS}{#1} + {\doPDFgetobjectreference{PDFMS}{#1}\PDFobjectreferenceB} + {\doPDFgetobjectreference{PDFMU}{#1}\PDFobjectreferenceB}% + \doPDFgetobjectreference{PDFMF}{#1}\PDFobjectreferenceA + \setxvalue{PDFMR:#1}% needed /AA actions in /Screen + {/R \PDFobjectreferenceA + /AN \PDFobjectreferenceB}% + \doifobjectreferencefoundelse{PDFMS}{#1}\donothing + {\dodoinsertrenderingwindow{PDFMU}{#1}\zeropoint\zeropoint{#4}}% + \fi} + +\definespecial\doinsertrenderingwindow + {\dodoinsertrenderingwindow{PDFMS}} + +\def\dodoinsertrenderingwindow#1#2#3#4#5% + {\vbox to #4 \bgroup + \checkPDFscreenactions{#2}{#5}% + \doPDFgetobjectpagereference{PDFMF}{#2}\PDFobjectreferenceA + \doPDFgetobjectreference {PDFMF}{#2}\PDFobjectreferenceB + \vss + \hbox to #3 \bgroup + \doPDFannotationobject{#1}{#2}{#3}{#4} + {/Subtype /Screen + /P \PDFobjectreferenceA + /A \PDFobjectreferenceB + \PDFattributes + /Border [0 0 0]}% + \hss + \egroup + \egroup} + +\global\let\PDFrenderingopenpageaction \empty +\global\let\PDFrenderingclosepageaction\empty + +\def\checkPDFscreenactions#1#2% + {\let\PDFattributes\empty + \iflocation % important since direct -) + % the action can either (already) be set by the window handler + % or (normally when no window [i.e a zero dimensions one] is present) by keyword + \doifinset\v!auto{#2} + {% brrr, here instead of in navigation module, must move and become special + % now two sided dependency + \let\checkrendering\gobbleoneargument + \ifx\PDFrenderingopenpageaction \empty + \handlereferenceactions{\v!StartRendering{#1}}\dosetuprenderingopenpageaction + \fi + \ifx\PDFrenderingclosepageaction\empty + \handlereferenceactions{\v!StopRendering {#1}}\dosetuprenderingclosepageaction + \fi + }% + \donefalse + \ifx\PDFrenderingopenpageaction \empty\!!doneafalse\else\donetrue\!!doneatrue\fi + \ifx\PDFrenderingclosepageaction\empty\!!donebfalse\else\donetrue\!!donebtrue\fi + \ifdone + \edef\PDFattributes + {/AA <<\if!!donea/PO <<\PDFrenderingopenpageaction >> \fi + \if!!doneb/PC <<\PDFrenderingclosepageaction>> \fi>>}% + \fi + \global\let\PDFrenderingopenpageaction \empty + \global\let\PDFrenderingclosepageaction\empty + \fi} + +\definespecial\dosetuprenderingopenpageaction {\global\let\PDFrenderingopenpageaction \lastPDFaction} +\definespecial\dosetuprenderingclosepageaction{\global\let\PDFrenderingclosepageaction\lastPDFaction} + +%D \macros +%D {doPDFinsertbookmark} +%D +%D Well, here is the dreadfull bookmark, rather useless because +%D only standard encoding is possible, no typography is done, +%D and a maximum of 32~characters is advized. + +\def\doPDFinsertbookmark#1#2#3#4#5% level sublevels text page open=1 + {\bgroup + % todo, unicode + \sanitizePDFdocencoding#3\to\bookmarktext % uses scratchcounter + \stripstring\bookmarktext + %\sanitizePDFstring#3\to\bookmarktext + \doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}% + \egroup} + +%D The next section of this module is dedicated to form +%D support. These macros are complicated by the fact that +%D cloning is possible. + +%D \macros +%D {FDFflag...,FDFplus...} +%D +%D The \type{/FT} key determines the type of field: text, +%D button or choice. The latter two come in several disguises, +%D which are set by flipping bits in the \type{/Ff}. Other bits +%D are used to set states. Personally I hate this bitty way of +%D doing things. The next six bit determine the field sub type: + +\def\FDFflagMultiLine {4096} % 13 +\def\FDFflagNoToggleToOff {16384} % 15 +\def\FDFflagRadio {32768} % 16 +\def\FDFflagPushButton {65536} % 17 +\def\FDFflagPopUp {131072} % 18 +\def\FDFflagEdit {262144} % 19 + +% bugged anyway, so we need to drop it: + +\def\FDFflagRadiosInUnison {33554432} % 26 + +%D A few more (pdf 1.4) flags, what the spell check one: for +%D obscure reasons for Adobe downward compatibility means +%D enabling features that harm old applications like testing. + +\def\FDFflagDoNotSpellCheck {4194304} % 23 +\def\FDFflagDoNotScroll {8388608} % 24 + +%D The next bits (watch how strange the bits are organized) +%D take care of the states: + +\def\FDFflagReadOnly {1} % 1 +\def\FDFflagRequired {2} % 2 +\def\FDFflagNoExport {4} % 3 +\def\FDFflagPassword {8192} % 14 +\def\FDFflagSort {524288} % 20 +\def\FDFflagFileSelect {1048576} % 21 + +%D There is a second, again bitset oriented, \type{/F} flag: + +\def\FDFplusInvisible {1} % 1 +\def\FDFplusHidden {2} % 2 +\def\FDFplusPrintable {4} % 3 + +%def\FDFplusNoView {32} % 6 +%def\FDFplusToggleNoView {256} % 9 + +\def\FDFplusAutoView {256} % {288} % 6+9 + +%D \macros +%D {setFDFswitches} +%D +%D The non||type bits are mapped onto user||interface +%D swithes, to be used later on: + +\def\@@FDFflag{FDFflag} +\def\@@FDFplus{FDFplus} + +\letvalue {\@@FDFflag\v!readonly}=\FDFflagReadOnly +\letvalue {\@@FDFflag\v!required}=\FDFflagRequired +\letvalue {\@@FDFflag\v!protected}=\FDFflagPassword +\letvalue {\@@FDFflag\v!sorted}=\FDFflagSort +\letvalue {\@@FDFflag\v!unavailable}=\FDFflagNoExport +\letvalue {\@@FDFflag\v!nocheck}=\FDFflagDoNotSpellCheck +\letvalue {\@@FDFflag\v!fixed}=\FDFflagDoNotScroll +\letvalue {\@@FDFflag\v!file}=\FDFflagFileSelect + +\letvalue {\@@FDFplus\v!hidden}=\FDFplusHidden +\letvalue {\@@FDFplus\v!printable}=\FDFplusPrintable + +\letvalue {\@@FDFplus\v!auto}=\FDFplusAutoView + +%D A set of switches is collected into the flags we mentioned +%D before by the next macro (we don't handle negations yet, +%D but do take care of redundancy): + +\def\FDFflag{0} +\def\FDFplus{0} + +\def\setFDFswitches[#1]% + {\bgroup + \!!counta\zerocount + \!!countb\zerocount + \def\docommand##1% + {\doifsomething{##1} + {\advance\!!counta 0\getvalue{\@@FDFflag##1}% + \setvalue{\@@FDFflag##1}{0}% + \advance\!!countb 0\getvalue{\@@FDFplus##1}% + \setvalue{\@@FDFplus##1}{0}}}% + \processcommacommand[#1]\docommand + \xdef\FDFflag{\the\!!counta}% + \xdef\FDFplus{\the\!!countb}% + \egroup} + +%D \macros +%D {setFDFvalues} +%D +%D Menu items are passed as an array of \type{(string)}'s and +%D the content of this array is build with: + +\let\FDFvalues \empty +\let\FDFfirstvalues \empty +\let\FDFsecondvalues\empty +\let\FDFkidlist \empty +\let\FDFdefaultindex\!!zerocount +\let\FDFdefaultvalue\empty + +% Why do we need to tweak this mechanism each time acrobat updates ... +% it would make sense to have version specific sections in pdf files +% since my guess is that it never will be done right since each year +% new programmers have new ideas about what is supposed to happen with +% kids. So .. best is not to trust this feature esp not for radio +% widgets. (new flags, different interpretation of AS etc etc) + +\def\setFDFvalues[#1][#2]% #1 = list (item=>value) #2 = default + {\let\FDFvalues \empty + %when radio opt works ok + %\let\FDFfirstvalues \empty + %\let\FDFsecondvalues\empty + \let\FDFkidlist \empty + %\let\FDFdefaultindex\!!zerocount + %\let\FDFdefaultvalue\empty + %\scratchcounter\zerocount + \def\dodocommand##1=>##2=>##3\end + {\addtocommalist{##1}\FDFkidlist + %\edef\FDFfirstvalues{\FDFfirstvalues(##1)}% + %\doif{##1}{#2}{\edef\FDFdefaultindex{\the\scratchcounter}}% + %\advance\scratchcounter\plusone + \doifelsenothing{##2} + {\doif{##1}{#2}{\edef\FDFdefaultvalue{##1}}% + %\edef\FDFsecondvalues{\FDFsecondvalues(##1)}% + \edef\FDFvalues{\FDFvalues [(##1)(##1)] }} + {\doif{##1}{#2}{\edef\FDFdefaultvalue{##2}}% + %\edef\FDFsecondvalues{\FDFsecondvalues(##2)}% + \edef\FDFvalues{\FDFvalues [(##2)(##1)] }}}% ! ##1 is shown + \def\docommand##1% + {\dodocommand##1=>=>\end}% + \expanded{\processcommalist[#1]}\docommand} + +%D This macro accepts comma separated \type{visual=>result} +%D pairs. + +%D \macros +%D {setFDFalignment} +%D +%D Text and line fields can be entered and showed in three +%D alternative alingments, indicated by a digit: + +\def\FDFalign{0} + +\def\setFDFalignment[#1]% + {\processaction + [#1] + [ \v!left=>\edef\FDFalign{2}, % raggedleft + \v!middle=>\edef\FDFalign{1}, % raggedcenter + \v!right=>\edef\FDFalign{0}]} % raggedright + +%D \macros +%D {setFDFattributes} +%D +%D The weak part of (at least version 2.1 \PDF) is that only +%D default fonts are handled well. Another restriction is that +%D the encoding vector must be the standard \PDF\ document one. +%D Although the \PDF\ reference explictly states that one could +%D use the normal text operators, leading is not yet handled. +%D +%D For the moment the current \CONTEXT\ font is mapped onto +%D one best suitable default font. The color attribute is +%D less problematic and is directly derived from the \CONTEXT\ +%D color. + +\def\FDFattributes{/Helv 12 Tf 0 g 14.4 TL} + +\def\FDFrm {TiRo} \def\FDFss {Helv} \def\FDFtt {Cour} +\def\FDFrmtf{TiRo} \def\FDFsstf{Helv} \def\FDFtttf{Cour} +\def\FDFrmbf{TiBo} \def\FDFssbf{HeBo} \def\FDFttbf{CoBo} +\def\FDFrmit{TiIt} \def\FDFssit{HeOb} \def\FDFttit{CoOb} +\def\FDFrmsl{TiIt} \def\FDFsssl{HeOb} \def\FDFttsl{CoOb} +\def\FDFrmbi{TiBI} \def\FDFssbi{HeBO} \def\FDFttbi{CoBO} +\def\FDFrmbs{TiBI} \def\FDFssbs{HeBO} \def\FDFttbs{CoBO} + +\let\FDFusedfonts=\FDFsstf + +\def\setFDFattributes[#1,#2,#3,#4]% style, color, backgroundcolor, framecolor + {\bgroup % nog interlinie: n TL + \setbox\scratchbox\hbox + \bgroup + \doconvertfont{#1}{}% + \PointsToBigPoints\bodyfontsize\size % x/xx, so better the actual size + \doifdefinedelse{FDF\fontstyle\fontalternative} + {\xdef\FDFattributes{\getvalue{FDF\fontstyle\fontalternative}}} + {\doifdefinedelse{FDF\fontstyle} + {\xdef\FDFattributes{\getvalue{FDF\fontstyle}}} + {\xdef\FDFattributes{\FDFrm}}}% + \doglobal\addtocommalist\FDFattributes\FDFusedfonts + \xdef\FDFattributes% move up with "x.y Ts" + {/\FDFattributes\space\size\space Tf\space\PDFcolor{#2}}% + \doifelsenothing{#3} + {\global\let\FDFsurroundings\empty} + {\xdef\FDFsurroundings{/BG \FDFcolor{#3}}}% + \doifsomething{#4} + {\xdef\FDFsurroundings{\FDFsurroundings\space /BC \FDFcolor{#4}}}% + \ifx\FDFsurroundings\empty \else + \xdef\FDFsurroundings{/MK << \FDFsurroundings\space>>}% + \fi + \egroup + \egroup} + +%D \macros +%D {setFDFactions} +%D +%D Depending on the type of the field, one can assign +%D \JAVASCRIPT\ code to a mouse event or keystroke. The next +%D preparation macro shows what events are handled. + +\let\FDFactions\empty + +%\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8]% +% {\global\let\FDFactions\empty +% \setFDFaction D#1% mousedown +% \setFDFaction U#2% mouseup +% \setFDFaction E#3% enterregion +% \setFDFaction X#4% exitregion +% \setFDFaction K#5% afterkeystroke +% \setFDFaction F#6% formatresult +% \setFDFaction V#7% validateresult +% \setFDFaction C#8% calculatewhatever +% \ifx\FDFactions\empty\else +% \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited +% \fi} +%% {\setFDFaction A#2}% mouseup % changed for version 5 + +% \def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,% +% {\global\let\FDFactions\empty +% \setFDFaction D#1% mousedown +% %\setFDFaction U#2% mouseup +% \setFDFaction E#3% enterregion +% \setFDFaction X#4% exitregion +% \setFDFaction K#5% afterkeystroke +% \setFDFaction F#6% formatresult +% \setFDFaction V#7% validateresult +% \setFDFaction C#8% calculatewhatever +% \setFDFactionsmore#2,} + +% \def\setFDFactionsmore#1,#2,#3]% +% {\setFDFaction{Fo}#2% focusin +% \setFDFaction{Bl}#3% focusout % was I (now pdf ref manual explicitly talks about lowercase l) +% \ifx\FDFactions\empty\else +% \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited +% \fi +% \setFDFaction A#1}% mouseup + +\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,% + {\global\let\FDFactions\empty + \setFDFaction D#1% mousedown + \setFDFaction U#2% mouseup + \setFDFaction E#3% enterregion + \setFDFaction X#4% exitregion + \setFDFaction K#5% afterkeystroke + \setFDFaction F#6% formatresult + \setFDFaction V#7% validateresult + \setFDFaction C#8% calculatewhatever + \setFDFactionsmore} + +\def\setFDFactionsmore#1,#2]% + {\setFDFaction{Fo}#1% focusin + \setFDFaction{Bl}#2% focusout % was I (now pdf ref manual explicitly talks about lowercase l) + \ifx\FDFactions\empty\else + \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited + \fi} + +% todo, when new var scheme is implemented +% +% \setFDFaction{PO}\@@DriverFieldPageOpen +% \setFDFaction{PC}\@@DriverFieldPageClose +% \setFDFaction{PV}\@@DriverFieldPageVisible +% \setFDFaction{PI}\@@DriverFieldPageInVisible + +%D The event handler becomes something: +%D +%D \starttyping +%D /AA << /D << /S ... >> ... /C << /S ... >> +%D /A << /S /JavaScript /JS (...) >> +%D \stoptyping + +% \def\setFDFaction#1#2% +% {\bgroup +% \global\let\sanitizedJScode\empty +% \def\setFDFaction##1% +% {\doifreferencefoundelse{##1} +% {\doifelse{\currentreferencespecial}{JS} % filter non-js +% {\presetJScode +% \currentreferenceoperation +% \currentreferencearguments +% \doPSsanitizeJScode\JScode\to\JScode +% \xdef\sanitizedJScode{\sanitizedJScode\space\JScode}} +% {\illegalreference{##1}}} +% {\unknownreference{##1}}}% +% \@EA\processcommalist\@EA[#2]\setFDFaction % one level expansion +% \ifx\sanitizedJScode\empty \else +% \xdef\FDFactions% +% {\FDFactions /#1 << /S /JavaScript /JS (\sanitizedJScode) >> }% +% \fi +% \egroup} +% +% acrobat 5 supports other that JS actions too + +\def\setFDFaction#1#2% + {\bgroup + \def\docommand{\xdef\FDFactions{\FDFactions /#1 << \lastPDFaction >> }}% + \@EA\handlereferenceactions\@EA{#2}\docommand % one level expansion + \egroup} + +%D \macros +%D {testFDFactions} +%D +%D This rather confusion prone series of script can be tested +%D with: +%D +%D \starttyping +%D \testFDFactions +%D \stoptyping +%D +%D which simply redefined the previous macro to one that prints +%D a message to the console. + +\def\testFDFactions + {\def\setFDFaction##1##2% + {\doPSsanitizeJScode console.show();console.println("executing:##1"); \to\sanitizedJScode + \edef\FDFactions{\FDFactions /##1 << /S /JavaScript /JS (\sanitizedJScode) >> }}} + +%D \macros +%D {doFDFregistercalculationset} +%D +%D There is at most one calculation order list, which defines +%D the order in which fields are calculated. + +\let\PDFcalculationset\empty + +\def\doFDFregistercalculationset#1% + {\def\PDFcalculationset{#1}} + +%D \macros +%D {registerFDFobject,everylastshipout} +%D +%D Officially one needs to embed some general datastructures +%D that tell the viewer what fields are present in the file, as +%D well as what resources they use. The next mechanism does that +%D job automatically when one registers the field. + +\def\flushFDFnames + {\ifbuildFDFdictionary + \ifx\FDFcollection\empty\else + \ifbuildFDFencodingvector + \doPDFdictionaryobject{FDF}{local:encodingvector}{\FDFencodingvector}% + \fi + \defineFDFfonts + \doPDFarrayobject{FDF}{local:fields}{\FDFcollection}% + \doPDFgetobjectreference{FDF}{local:fields}\PDFobjectreference + % The /NeedAppearances is pretty important because + % otherwise Acrobat 5 blows up on cloned radio widgets + \doPDFdictionaryobject{FDF}{local:acroform} + {/Fields \PDFobjectreference\space + /NeedAppearances true + \doFDFiffieldset\PDFcalculationset{/CO [\doFDFgetfieldset\PDFcalculationset]} + /DR << /Font << \FDFfonts >> >> + /DA (/Helv 10 Tf 0 g)}% + \doPDFgetobjectreference{FDF}{local:acroform}\PDFobjectreference + \doPDFaddtocatalog + {/AcroForm \PDFobjectreference}% + \global\let\FDFcollection\empty + \global\let\flushFDFnames\relax + \fi + \fi} + +\let\FDFcollection\empty + +\def\registerFDFobject#1% + {\ifbuildFDFdictionary + \ifx\flushFDFnames\relax + \writestatus{FDF}{second run needed for field list (#1)}% + \fi + \doPDFgetobjectreference{FDF}{#1}\PDFobjectreference + \xdef\FDFcollection{\FDFcollection\space\PDFobjectreference}% + \fi} + +\appendtoksonce \flushFDFnames \to \everylastshipout % test \everybye / was \prependtoksonce + +%D \macros +%D {defineFDFfonts, +%D ifbuildFDFdictionary, +%D ifbuildFDFencodingvector} +%D +%D Another datastruture concerns the fonts used. We only +%D define the fonts we use. + +\newif\ifbuildFDFdictionary \buildFDFdictionarytrue +\newif\ifbuildFDFencodingvector \buildFDFencodingvectortrue + +\def\defineFDFfonts + {\let\FDFfonts\empty + \processcommacommand[\FDFusedfonts]\defineFDFfont} + +\def\defineFDFfont#1% + {\ifbuildFDFencodingvector + \doPDFgetobjectreference{FDF}{local:encodingvector}\PDFobjectreference + \fi + \doPDFdictionaryobject{FDF}{local:#1} + {/Type /Font + /Subtype /Type1 + /Name /#1 + \ifbuildFDFencodingvector /Encoding \PDFobjectreference\space\fi + /BaseFont /\getvalue{FDFname#1}}% + \doPDFgetobjectreference{FDF}{local:#1}\PDFobjectreference + \edef\FDFfonts{\FDFfonts \space/#1 \PDFobjectreference}} + +%D Another list of constants: + +\def\FDFnameTiRo {Times-Roman} +\def\FDFnameTiBo {Times-Bold} +\def\FDFnameTiIt {Times-Italic} +\def\FDFnameTiBI {Times-BoldItalic} +\def\FDFnameHelv {Helvetica} +\def\FDFnameHeBo {Helvetica-Bold} +\def\FDFnameHeOb {Helvetica-Oblique} +\def\FDFnameHeBO {Helvetica-BoldOblique} +\def\FDFnameCour {Courier} +\def\FDFnameCoBo {Courier-Bold} +\def\FDFnameCoOb {Courier-Oblique} +\def\FDFnameCoBO {Courier-BoldOblique} + +%D And a big one: (should be run time loaded (spec-run or +%D so)). + +\def\FDFencodingvector + {/Type /Encoding + /Differences + [ 24 /breve /caron /circumflex /dotaccent /hungarumlaut /ogonek + /ring /tilde + 39 /quotesingle + 96 /grave + 128 /bullet /dagger /daggerdbl /ellipsis /emdash /endash /florin + /fraction /guilsinglleft /guilsinglright /minus /perthousand + /quotedblbase /quotedblleft /quotedblright /quoteleft + /quoteright /quotesinglbase /trademark /fi /fl /Lslash /OE + /Scaron /Ydieresis /Zcaron /dotlessi /lslash /oe /scaron + /zcaron + 164 /currency + 166 /brokenbar + 168 /dieresis /copyright /ordfeminine + 172 /logicalnot /.notdef /registered /macron /degree /plusminus + /twosuperior /threesuperior /acute /mu + 183 /periodcentered /cedilla /onesuperior /ordmasculine + 188 /onequarter /onehalf /threequarters 192 /Agrave /Aacute + /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave + /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex + /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde + /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex + /Udieresis /Yacute /Thorn /germandbls /agrave /aacute + /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave + /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex + /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde + /odieresis /divide /oslash /ugrave /uacute /ucircumflex + /udieresis /yacute /thorn /ydieresis ]} + +%D \macros +%D {currentFDFmode,currentFDFparent,currentFDFkids,currenrFDFroot} +%D +%D There are three more quasi global interfacing variables +%D that need to be set. + +\let\currentFDFmode =\fieldlonermode +\let\currentFDFkids =\empty +\let\currentFDFparent=\empty +\let\currentFDFroot =\empty + +%D \macros +%D {dosetfieldstatus} +%D +%D And here comes the special that deals with them. + +\definespecial\dosetfieldstatus#1#2#3#4% + {\chardef\currentFDFmode #1% + \edef\currentFDFparent {#2}% + \edef\currentFDFkids {#3}% + \edef\currentFDFroot {#4}} + +%D \macros +%D {dosetuppageview} +%D +%D Because this command will seldom be called, we can permit +%D slow action processing. We need three settings, one for +%D direct \PDF\ inclusion, the other as \PDFTEX\ keyword, an +%D a last one for form. All determine in what way the +%D screen is adapted when going to a destination. Watch the +%D space. + +\def\PDFpageviewkey{fit} +\def\PDFpageviewwrd{/Fit} +\def\PDFpageview {/View [\PDFpageviewwrd] } +\let\PDFpagexyzspec\relax % 0 0 0 hack, pdftex does handle this, for dvipdfmx we need height + +\def\dosetuppageview#1% watch the v-h swapping here + {\processaction + [#1] + [ \v!fit=>\def\PDFpageviewkey {fit}\def\PDFpageviewwrd{/Fit}, + \v!width=>\def\PDFpageviewkey {fith}\def\PDFpageviewwrd{/FitH}, + \v!height=>\def\PDFpageviewkey {fitv}\def\PDFpageviewwrd{/FitV}, + \v!minwidth=>\def\PDFpageviewkey{fitbh}\def\PDFpageviewwrd{/FitBH}, + \v!minheight=>\def\PDFpageviewkey{fitbv}\def\PDFpageviewwrd{/FitBV}, + \v!standard=>\ifx\PDFpagexyzspec\relax + % empty does not work too wel with dpx + \def\PDFpageviewkey{fit}% + \def\PDFpageviewwrd{/Fit}% + \else + \edef\PDFpageviewkey{xyz \PDFpagexyzspec}% + \edef\PDFpageviewwrd{/XYZ \PDFpagexyzspec}% + \fi, + \s!unknown=>\def\PDFpageviewkey {fit}\def\PDFpageviewwrd{/Fit}]% + \edef\PDFpageview{\ifx\PDFpageviewwrd\empty\else/View [\PDFpageviewwrd]\fi}} + +%D \macros +%D {setFDFkids} +%D +%D Clones as well as radiofields (which themselves can have +%D cloned components) need a list of kids. The next macro +%D builds one. + +\def\setFDFkids[#1][#2]% tag commalist + {\let\FDFkids\empty + \def\docommand##1% + {\doPDFgetobjectreference{FDF}{#1##1}\PDFobjectreference + \edef\FDFkids{\FDFkids\PDFobjectreference\space}}% + \@EA\processcommalist\@EA[#2]\docommand + \ifx\FDFkids\empty\else\edef\FDFkids{/Kids [\FDFkids]}\fi +% \edef\FDFkids{/Kids [\FDFkids]}% + } + +%D \macros +%D {doFDFpresetlinefield,doFDFpresettextfield, +%D doFDFpresetchoicefield,doFDFpresetpopupfield,doFDFpresetcombofield, +%D doFDFpresetpushfield,doFDFpresetcheckfield, +%D doFDFpresetfield,doFDFpresetradiorecord} +%D +%D I would say: read the \PDF\ reference manual first and see +%D what happens here next. Lucky us that they have so much in +%D common. + +\def\doFDFpresetlinefield#1#2#3#4#5#6#7#8#9% + {\bgroup + \setFDFlayer\@@DriverFieldLayer + \setFDFswitches[#7]% + \setFDFattributes[#6]% + \setFDFalignment[#8]% + \setFDFactions[#9]% + \expanded{\escapePSstring#4}\to\FDFtext + \ifcase\currentFDFmode + \doPDFannotationobject{FDF}{#1}{#2}{#3} + {/Subtype /Widget /T (#1) /FT /Tx + /MaxLen \ifcase0#5 1000 \else#5 \fi + %/DV (#4) /V (#4) % value added + /DV (\FDFtext) /V (\FDFtext) % value added + /Ff \FDFflag\space + /F \FDFplus\space + /DA (\FDFattributes) + \FDFlayer\space + \FDFsurroundings\space + /Q \FDFalign\space + \FDFactions}% + \registerFDFobject{#1}% + \or + \setFDFkids[kids:][\currentFDFkids]% + \doPDFdictionaryobject{FDF}{#1} + {/T (#1) /FT /Tx + /MaxLen \ifcase0#5 1000 \else#5 \fi + \FDFkids\space + %/DV (#4) /V (#4) % value added + /DV (\FDFtext) /V (\FDFtext) % value added + /Ff \FDFflag\space + /F \FDFplus\space + /DA (\FDFattributes) + \FDFlayer\space + \FDFsurroundings\space + /Q \FDFalign\space + \FDFactions}% + \registerFDFobject{#1}% + \or + \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference + %\global\objectreferencingtrue + \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} + {/Subtype /Widget + /Parent \PDFobjectreference + /Ff \FDFflag\space + /F \FDFplus\space + /DA (\FDFattributes) + \FDFlayer\space + \FDFsurroundings\space + /Q \FDFalign\space + \FDFactions}% + \or + \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference + %\global\objectreferencingtrue + \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} + {/Subtype /Widget + /Parent \PDFobjectreference + /F \FDFplus + \FDFactions}% + \fi + \egroup} + +\def\doFDFpresettextfield#1#2#3#4#5#6#7#8#9% + {\doFDFpresetlinefield{#1}{#2}{#3}{#4}{#5}{#6}{MultiLine,#7}{#8}{#9}} + +\def\doFDFpresetchoicefield#1#2#3#4#5#6#7#8% + {\bgroup + \setFDFlayer\@@DriverFieldLayer + \setFDFswitches[#6]% + \setFDFattributes[#5]% + \setFDFvalues[#7][#4]% + \setFDFactions[#8]% + \ifcase\currentFDFmode + \doPDFannotationobject{FDF}{#1}{#2}{#3} + {/Subtype /Widget + /T (#1) /FT /Ch + /DV (#4) /V (#4) + /Ff \FDFflag\space + /F \FDFplus\space + /DA (\FDFattributes) + \FDFlayer\space + \FDFsurroundings\space + /Opt [\FDFvalues] + \FDFactions}% + \registerFDFobject{#1}% + \or + \setFDFkids[kids:][\currentFDFkids]% + \doPDFdictionaryobject{FDF}{#1} + {/T (#1) /FT /Ch + \FDFkids\space + /DV (#4) /V (#4) + /Ff \FDFflag\space + /F \FDFplus\space + /DA (\FDFattributes) + \FDFlayer\space + \FDFsurroundings\space + /Opt [\FDFvalues] + \FDFactions}% + \registerFDFobject{#1}% + \or + \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference + %\global\objectreferencingtrue + \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} + {/Subtype /Widget + /Parent \PDFobjectreference + /Ff \FDFflag\space + /F \FDFplus\space + /DA (\FDFattributes) + \FDFlayer\space + \FDFsurroundings\space + \FDFactions}% + \or + \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference + %\global\objectreferencingtrue + \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} + {/Subtype /Widget + /Parent \PDFobjectreference + /F \FDFplus + \FDFactions}% + \fi + \egroup} + +\def\doFDFpresetpopupfield#1#2#3#4#5#6#7#8% + {\doFDFpresetchoicefield{#1}{#2}{#3}{#4}{#5}{PopUp,#6}{#7}{#8}} + +\def\doFDFpresetcombofield#1#2#3#4#5#6#7#8% + {\doFDFpresetchoicefield{#1}{#2}{#3}{#4}{#5}{PopUp,Edit,#6}{#7}{#8}} + +\newif\ifFDFvalues + +\def\doFDFpresetpushcheckfield#1#2#3#4#5#6#7#8% in acro<5 (\FDFdefault) + {\bgroup % in acro>5 /\FDFdefault + \setFDFlayer\@@DriverFieldLayer + \ifcase#8\relax\FDFvaluesfalse\else\FDFvaluestrue\fi + \setFDFswitches[#5]% + \setFDFactions[#7]% + \doifelse{#4}{1} + {\def\FDFdefault{On}} + {\def\FDFdefault{Off}}% + \ifcase\currentFDFmode + \doFDFappearance{On}{#6}{#8}% + \doPDFannotationobject{FDF}{#1}{#2}{#3} + {/Subtype /Widget /T (#1) /FT /Btn + \ifFDFvalues + /DV /\FDFdefault\space + /V /\FDFdefault\space + /AS /\FDFdefault\space + \fi + \FDFlayer + /Ff \FDFflag\space + /F \FDFplus\space + \FDFlayer\space + \FDFappearance\space +% /IF << /SW /N >> % strange, only works for stupid buttons + \FDFactions}% + \registerFDFobject{#1}% + \or % no appearance and layer ? + \setFDFkids[kids:][\currentFDFkids]% + \doPDFdictionaryobject{FDF}{#1} + {/T (#1) /FT /Btn + \FDFkids\space + \ifFDFvalues + /DV /\FDFdefault\space + /V /\FDFdefault\space + /AS /\FDFdefault\space + \fi + /Ff \FDFflag\space + /F \FDFplus\space + \FDFactions}% + \registerFDFobject{#1}% + \or + \doFDFappearance{On}{#6}{#8}% + \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference + %\global\objectreferencingtrue + \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} + {/Subtype /Widget + /Parent \PDFobjectreference\space + \ifFDFvalues + /DV /\FDFdefault\space + /V /\FDFdefault\space + /AS /\FDFdefault\space + \fi + /Ff \FDFflag\space + /F \FDFplus\space + \FDFlayer\space + \FDFappearance\space + \FDFactions}% + \or + \doFDFappearance{On}{#6}{#8}% + \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference + %\global\objectreferencingtrue + \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} + {/Subtype /Widget + /Parent \PDFobjectreference\space + /F \FDFplus\space + \ifFDFvalues + /DV /\FDFdefault\space + /V /\FDFdefault\space + /AS /\FDFdefault\space + \fi + \FDFlayer\space + \FDFappearance + \FDFactions}% + \fi + \egroup} + +\def\doFDFpresetpushfield#1#2#3#4#5#6#7% + {\doFDFpresetpushcheckfield{#1}{#2}{#3}{#4}{PushButton,#5}{#6}{#7}{0}} + +\def\doFDFpresetcheckfield#1#2#3#4#5#6#7% + {\doFDFpresetpushcheckfield{#1}{#2}{#3}{#4}{#5}{#6}{#7}{1}} + +\def\doFDFpresetradiofield#1#2#3#4#5#6#7#8% + {\bgroup + \setFDFlayer\@@DriverFieldLayer + \FDFvaluestrue + \setFDFswitches[#5]% + \setFDFactions[#8]% + \doifelsenothing{#4} + {\def\FDFdefault{Off}} + {\def\FDFdefault{#4}}% + \@EA\aftersplitstring\FDFdefault\at=>\to\FDFdefaultvalue + \ifx\FDFdefaultvalue\empty\else\let\FDFdefault\FDFdefaultvalue\fi + \ifcase\currentFDFmode + \doFDFappearance{#1}{#7}{1}% + \doPDFgetobjectreference{FDF}{#6}\PDFobjectreference + \doPDFannotationobject{FDF}{#1}{#2}{#3} + {/Subtype /Widget + /Parent \PDFobjectreference\space + /F \FDFplus\space + /AS /\FDFdefault\space + \FDFlayer\space + \FDFappearance\space + \FDFactions}% + \registerFDFobject{#1}% + \or + \setFDFkids[kids:][\currentFDFkids]% + \doPDFgetobjectreference{FDF}{#6}\PDFobjectreference + \doPDFdictionaryobject{FDF}{#1} + {/Parent \PDFobjectreference\space + \FDFkids\space + /F \FDFplus\space + \FDFactions}% + \registerFDFobject{#1}% + \or + %\doFDFappearance{#1}{#7}{1}% + \doFDFappearance{\currentFDFparent}{#7}{1}% + \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference + %\global\objectreferencingtrue % nb + \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} + {/Subtype /Widget + /Parent \PDFobjectreference\space + /AS /\FDFdefault\space + /F \FDFplus\space + \FDFlayer\space + \FDFappearance\space + \FDFactions}% + \or + %\doFDFappearance{#1}{#7}{1}% + \doFDFappearance{\currentFDFparent}{#7}{1}% + \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference + %\global\objectreferencingtrue + \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} + {/Subtype /Widget + /Parent \PDFobjectreference\space + /AS /\FDFdefault\space + /F \FDFplus\space + \FDFlayer\space + \FDFappearance\space + \FDFactions}% + \fi + \egroup} + +%D \macros +%D {setFDFstrings} +%D +%D This one creates a string array. + +%\def\setFDFstrings[#1]% +% {\let\FDFstrings\empty +% \def\docommand##1{\edef\FDFstrings{\FDFstrings(##1)}}% +% \processcommacommand[#1]\docommand} + +% Beware, RadiosInUnison is really needed in the pre 1.5/6 time this +% was the default but out of a sudden it's no longer the case. Also +% the NoToggleToOff interferes with kids of kids and both it will +% break older documents, i.e. so much for pdf as standard. With +% features like widgets we can probably best wait till adobe tools +% themselves support it because that's probably the moment that +% functionality gets frozen/becomes definitive. Actually, acrobat +% flattens the kids tree, so that's yet another situation. The +% interesting thing is that it worked ok in acrobat 2/3 but got bugged +% in later versions. [The rationale is in html compatibility, which +% seems to be more important than compatibility of documents, which in +% turn renders acrobat useless for forms.] Anyway, synchronization is +% broken or not depending on the combination pdfversion/acrobatversion. + +\def\doFDFpresetradiorecord#1#2#3#4#5% + {\bgroup + % < pdf 1.5 (1.5 was broken) + % \setFDFswitches[Radio,NoToggleToOff,RadiosInUnison,#3]% + % > pdf 1.5 + \setFDFswitches[Radio,RadiosInUnison,#3]% + % older, else fatal error + % \setFDFkids[#4][]% + % newer + \setFDFvalues[#4][#2]% inits kidlist + \expanded{\setFDFkids[][\FDFkidlist]}% + % + \setFDFactions[#5]% + \doPDFdictionaryobject{FDF}{#1} + {%/Subtype /Widget + /FT /Btn /T (#1) /Rect [0 0 0 0] + % used to be this + % /V (#2) + % then this + % /DV (#2) + % since this bomded in 5 + % /V (#2) + % and now finally this works + /H /N + % /opt is buggy in 5.05, only works once, sigh + %\ifx\FDFfirstvalues\FDFsecondvalues + /V /#2 + %\else + % /V /\FDFdefaultindex\space + % /Opt [\FDFsecondvalues] + %\fi + /Ff \FDFflag\space + /F \FDFplus\space + \FDFkids\space + \FDFactions}% + \egroup} + +%D At the cost of some more references, we can save bytes, +%D by sharing appearance dictionaries. This code needs more +%D documentation. Surprise: + +\def\dodoFDFappearance#1#2% + {\ifx#2\empty\else + \dogetcommacommandelement1\from#2\to\commalistelement + \ifx\commalistelement\empty\else + \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference + \edef\N{\ifFDFvalues\N /#1 \fi\PDFobjectreference\space}% + \fi + \dogetcommacommandelement2\from#2\to\commalistelement + \ifx\commalistelement\empty\else + \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference + \edef\R{\ifFDFvalues\R /#1 \fi\PDFobjectreference\space}% + \fi + \dogetcommacommandelement3\from#2\to\commalistelement + \ifx\commalistelement\empty\else + \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference + \edef\D{\ifFDFvalues\D /#1 \fi\PDFobjectreference\space}% + \def\FDFappearance{/H /P }% + \fi + \fi} + +\def\redoFDFappearance#1% + {\ifx#1\empty\else + \dogetcommacommandelement3\from#1\to\commalistelement + \ifx\commalistelement\empty\else + \def\FDFappearance{/H /P }% + \fi + \fi} + +\def\doFDFappearance#1#2#3% + {\ifcase#3\relax % push only field + \edef\yes{#2}% + \let\no\empty + \else % on / off field + \dogetcommacommandelement1\from#2,\to\yes + \dogetcommacommandelement2\from#2,\to\no + \fi + \def\FDFappearance{/H /N}% + \doifobjectfoundelse{FDF}{ap:#1:\yes:\no} + {\redoFDFappearance\yes + \redoFDFappearance\no} + {\presetobject{FDF}{ap:#1:\yes:\no}% funny hack + \let\N\empty\let\R\empty\let\D\empty + \dodoFDFappearance{#1}\yes + \dodoFDFappearance{Off}\no + \doPDFdictionaryobject{FDF}{ap:#1:\yes:\no} + {\ifx\N\empty\else/N \ifFDFvalues<<\N>>\else\N\fi\fi + \ifx\R\empty\else/R \ifFDFvalues<<\R>>\else\R\fi\fi + \ifx\D\empty\else/D \ifFDFvalues<<\D>>\else\D\fi\fi}}% + \doPDFgetobjectreference{FDF}{ap:#1:\yes:\no}\PDFobjectreference + \edef\FDFappearance{\FDFappearance /AP \PDFobjectreference}} + +%\def\doFDFdefault#1#2% +% {\dogetcommacommandelement1\from#1,\to\commalistelement +% \dogetcommacommandelement1\from\commalistelement\to\commalistelement +% \doifelse{\commalistelement}{#2} % kan ook met \ifx +% {\def\FDFdefault{On}}{\def\FDFdefault{Off}}} + +\def\doFDFdefault#1#2% + {\doifelse{#2}{1}{\def\FDFdefault{On}}{\def\FDFdefault{Off}}} + +%D Layer support: + +\def\setFDFlayer#1% todo : \ifx\PDFobjectreference\noPDFobjectreference ipv found + {\letempty\FDFlayer + \doifsomething{#1}% + {\checkproperty[#1]% == \dodocheckproperty\@@DriverFieldLayer + \doifobjectreferencefoundelse{PDLN}{#1} + {\doPDFgetobjectreference{PDLN}{#1}\!!stringa % we need to avoid a clash with other macros + \edef\FDFlayer{/OC \!!stringa}}% + \donothing}} + +%D The three appearances {\em normal}, \type{roll over} and +%D \type{push down} are passed as comma separated triplets, +%D that is, the second argument can look like: +%D +%D \starttyping +%D {yes,ok,fine},{no,rubish,awful} +%D \stoptyping + +%D \macros +%D {doFDFdefinefieldset,doFDFgetfieldset,doFDFiffieldset} +%D +%D Field sets, the ones we use in submitting and resetting +%D fields, are implemented using the next low level specials: +%D +%D \starttyping +%D \doFDFdefinefieldset{TAG}{name,name,...} +%D \doFDFgetfieldset{TAG} +%D \doFDFiffieldset{TAG}{sequence} +%D \stoptyping + +\def\doFDFdefinefieldset#1#2% tag commalist + {\let\FDFfieldset\empty + \def\docommand##1% + {\doPDFgetobjectreference{FDF}{##1}\PDFobjectreference + \edef\FDFfieldset{\FDFfieldset\PDFobjectreference\space}}% + \processcommacommand[#2]\docommand % nb: command + \setevalue{FDF:set:#1}{\FDFfieldset}} + +\def\doFDFgetfieldset#1% + {\getvalue{FDF:set:#1}} + +\def\doFDFiffieldset#1#2% + {\ifundefined{FDF:set:#1}\else#2\fi} + +%D In the goto specials we took care of secondary references. +%D Here we define the macros used. + +\def\doPDFresetgotowhereever + {\global\let\secondaryPDFreferences\empty} + +\doPDFresetgotowhereever % just to be sure + +% we can (in etex) share more by testing on this + +\def\savesecondaryPDFreference#1% + {\@EA\xdef\csname PDF-SR:\the\nofsecondaryreferences\endcsname{#1}} + +\def\savesecondaryPDFreference % #1 == \action + {\global\@EA\let\csname PDF-SR:\the\nofsecondaryreferences\endcsname} + +%\def\getsecondaryPDFreferences% +% {\ifcase\nofsecondaryreferences\else +% %\doifdefined{PDF-SR:\the\nofsecondaryreferences} +% \xdef\secondaryPDFreferences% +% {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space +% \secondaryPDFreferences >>}% +% \global\advance\nofsecondaryreferences \minusone +% \expandafter\getsecondaryPDFreferences +% \fi} + +% test should happen in core-ref + +\def\getsecondaryPDFreferences + {\ifcase\nofsecondaryreferences\else + \ifcsname PDF-SR:\the\nofsecondaryreferences\endcsname + \xdef\secondaryPDFreferences + {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space + \secondaryPDFreferences >>}% + \fi + \global\advance\nofsecondaryreferences \minusone + \expandafter\getsecondaryPDFreferences + \fi} + +%D \macros +%D {loadFDFfields, showFDFfields, +%D getFDFfield, setFDFfield} +%D +%D Once filled in, we can export or submit the field in the +%D \FDF\ file format. Such a file can be loaded by +%D +%D \starttyping +%D \loadFDFfields{fiel-ini} +%D \stoptyping +%D +%D or inspected by +%D +%D \starttyping +%D \showFDFfields{fiel-ini} +%D \stoptyping +%D +%D After both commands, one can use +%D +%D \starttyping +%D \getFDFfield{name} +%D \setFDFfield{name}{value} +%D \stoptyping +%D +%D to inspect and overrule the data. +%D +%D By default \CONTEXT\ calls the perl script \type{fdf2tex}. +%D This script reads the \type{fdf} file and produces a file +%D named \type{filename.fdt}. If one disables the call to this +%D script, by saying: +%D +%D \starttyping +%D \runFDFconverterfalse +%D \stoptyping +%D +%D or when \CONTEXT\ cannot find the \type{fdt} file, it tries +%D to interpret the \type{fdf} file directly. Both mechanisms +%D are rather crude. + +\newif\ifrunFDFconverter \runFDFconvertertrue + +%D The \PERL\ script produces a file formatted as: +%D +%D \starttyping +%D \beginFDFobject +%D \beginFDFdata +%D \beginFDFfields +%D \FDFfield[name=,value=] +%D \endFDFfields +%D \endFDFdata +%D \endFDFobject +%D \stoptyping +%D +%D One reason for using key value pairs is that we cannot be +%D sure or the order in which the name and value are given +%D (actually the reverse). + +\def\PERLloadFDFfields#1% will become obsolete soon + {\bgroup + \global\let\allFDFfields\empty + \ifrunFDFconverter + \executesystemcommand{fdf2tex #1}% + \let\beginFDFobject\relax \let\endFDFobject\relax + \let\beginFDFdata \relax \let\endFDFdata \relax + \let\beginFDFfields\relax \let\endFDFfields\relax + \def\FDFfield[##1]% + {\getparameters[FDF][##1]% + \doglobal\addtocommalist\FDFname\allFDFfields + \global\setFDFfield{\FDFname}{\FDFvalue}}% + \ReadFile{#1.fdt}% + \fi + \egroup} + +%D The next macro does the same job, but now in the \TEX\ way +%D of doing things. Easy eh? Will become obsolete! + +\bgroup + +\catcode`\/=\@@other +\global\let\normalslash=/ +\catcode`\/=\@@escape + +\gdef\TEXloadFDFfields#1% will become obsolete due to XFDF + {\bgroup + \setbox0=\hbox + {\global\let\allFDFfields\empty + \scratchcounter=0 + \escapechar=-1 + \catcode`\/=\@@escape + \catcode`\(=\@@begingroup + \catcode`\)=\@@endgroup + \catcode`\%=\@@letter + \let/A =\relax \let/AS =\relax \let/Kids=\relax \let/Fields=\relax + \let/F =\relax \let/ID =\relax \let/SetF=\relax \let/setFf =\relax + \let/Ff=\relax \let/Opt=\relax \let/ClrF=\relax \let/ClrFf =\relax + \let/AP=\relax \let/FDF=\relax \let/Root=\relax + \def/T##1{\check\Title{##1}} + \def/V{\bgroup\catcode`\/=\@@other\futurelet\next/doV} + \def/doV{\ifx\next\normalslash\@EA/doVb\else\@EA/doVa\fi} + \def/doVa##1{\egroup\check\Value{##1}} + \def/doVb##1##2 {\egroup\check\Value{##2}} % watch the space + \def\check##1##2% + {\def##1{##2} + \advance\scratchcounter\plusone\relax + \ifodd\scratchcounter \else + \defconvertedcommand\asciia\Title + \global\setFDFfield{\asciia}{\Value} + \doglobal\addtocommalist\Title\allFDFfields + \fi} + \ReadFile{#1.fdf}}% + \egroup} + +\egroup + +%D Whatever mechanism is used, the next macros can be used to +%D fetch the values. + +\def\getFDFfield #1{\getvalue {FDFfield::#1}} +\def\setFDFfield#1#2{\setevalue{FDFfield::#1}{#2}} + +%D Of course the fields are only present when the file is +%D loaded. + +\def\loadFDFfields#1% + {\PERLloadFDFfields{#1}% + \ifx\allFDFfields\empty + \TEXloadFDFfields{#1}% + \fi} + +\def\showFDFfields#1% + {\bgroup + \loadFDFfields{#1} + \def\docommand##1{\par##1 = \getFDFfield{##1}\par}% + \processcommacommand[\allFDFfields]\docommand + \egroup} + +%D \macros +%D {sanitizePDFencoding,sanitizePDFdocencoding} +%D +%D We already dealt with the encoding vector. Conversion from +%D \TEX\ \ASCII\ encoding to the other one, is accomplished by +%D the next few macros. Wach out: we don't group here. + +%D This will be reimplemented using the mapping mechanism. + +% \def\enablePDFdocencoding +% {\reducetocoding[pdfdoc]\simplifycommands} + +\def\enablePDFdocencoding + {\enablecoding[pdfdoc]% + \enablelanguagespecifics[\currentlanguage]% redundant ? + \simplifycommands} + +\long\def\sanitizePDFdocencoding#1\to#2% + {\enablePDFcrlf + \enablePDFdocencoding + %\honorunexpanded % otherwise problems with "e etc in de + \edef#2{#1}} + +\bgroup +\catcode`\^^M=\@@active +\gdef\enablePDFcrlf% + {\def\\{\string\r}% + \def\par{\\\\}% + \def\endgraf{\\\\}% + \catcode`\^^M=\@@active% + \let^^M=\\} +\egroup + +\let\sanitizePDFencoding\sanitizePDFdocencoding + +%D A bit out of place, but useful: + +\ifdefined\everysetfield \else \newtoks\everysetfield \fi + +\appendtoksonce + \enablePDFdocencoding + \enablePDFcrlf +\to \everysetfield + +%D \macros +%D {doPDFinsertcomment} +%D +%D An example its use is the next special, one that deals with +%D text annotations. + +% starting point (keep this) +% +% \long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8% +% {\bgroup % title width height color open symbol collect data +% \doifelsenothing{#1} +% {\let\PDFidentifier\empty} +% {\def\PDFidentifier{/T (#1)}}% +% \doifelsenothing{#4} +% {\let\PDFattributes\empty} +% {\def\PDFattributes{/C \FDFcolor{#4}}}% +% \doifundefinedelse{PDFsymbol#6} +% {\let\PDFsymbol\empty} +% {\def\PDFsymbol{/Name \getvalue{PDFsymbol#6} }}% +% \sanitizePDFencoding#8\to\PDFdata +% \setbox\scratchbox\vbox to #3 +% {\vfill +% \doPDFannotation{#2}{#3} +% {/Subtype /Text +% \ifcase#5 \else/Open true\fi +% /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi +% \PDFsymbol +% \PDFidentifier +% \PDFattributes}}% +% \wd\scratchbox\zeropoint +% \ht\scratchbox\zeropoint +% \dp\scratchbox\zeropoint +% \box\scratchbox +% \egroup} + +\newcounter\nofFDFcomments + +\newif\ifPDFpopupcomments \PDFpopupcommentstrue + +\def\doPDFflushcomments + {\box\PDFsymbolbox} + +\long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8% % \@@DriverCommentLayer set otherwise + {\bgroup % title width height color open symbol collect data + \presetPDFsymbolappearance{#4}{#6}{#2}{#3}\!!zeropoint% sets width/height +% \doifelsenothing{#1} +% {\let\PDFidentifier\empty} +% {\def\PDFidentifier{/T (#1)}}% + \doifelsenothing{#1} + {\let\PDFidentifier\empty} + {\sanitizePDFencoding#1\to\PDFcommenttitle + \def\PDFidentifier{/T \ifPDFunicode <\PDFcommenttitle>\else (\PDFcommenttitle)\fi}}% + \sanitizePDFencoding#8\to\PDFdata + \setFDFlayer\@@DriverCommentLayer + \startPDFsymbolappearance + \ifPDFpopupcomments + \doglobal\increment\nofFDFcomments + \doifobjectreferencefoundelse{FDF}{c:\nofFDFcomments} + {\doPDFgetobjectreference{FDF}{c:\nofFDFcomments}\PDFobjectreference + \donetrue} + \donefalse + \ifdone + \setbox\scratchbox\hbox + {\doPDFannotationobject{FDF}{c::\nofFDFcomments}{#2}{#3}% text window, size does not work + {/Subtype /Popup + /Parent \PDFobjectreference}}% + \ifcase#7\relax + \vbox to \height{\forgetall\vskip#3\box\scratchbox\vss}% + \else % incredible trial and error hack + % it's quite a mess, the annot width cannot be set, well, it can + % but the appearance and text sizes get mixed up +% \setbox\scratchbox\vbox to \height{\forgetall\vskip#3\box\scratchbox\vss}% +% \global\setbox\PDFsymbolbox\vbox +% {\hsize#2% +% \forgetall +% \vsmash{\box\PDFsymbolbox} +% \box\scratchbox}% + % this may change when acrobat gets less bugged + \setbox\scratchbox\vbox to #3{\forgetall\vss\box\scratchbox}% + \wd\scratchbox#2% + \global\setbox\PDFsymbolbox\vbox + {\startoverlay{\box\PDFsymbolbox}{\box\scratchbox}\stopoverlay}% + \fi + \fi + % generic + \doifobjectreferencefoundelse{FDF}{c::\nofFDFcomments} + {\doPDFgetobjectreference{FDF}{c::\nofFDFcomments}\PDFobjectreference + \donetrue} + \donefalse + \doPDFannotationobject{FDF}{c:\nofFDFcomments}{\width}{\height} + {/Subtype /Text + \ifcase#5 \else/Open true\fi + % pdftex (efficient) + % \ifdone /Popup \PDFobjref\pdflastannot\fi + % generic (less efficient) + \ifdone /Popup \PDFobjectreference\fi + /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi + \PDFidentifier + \FDFlayer + \PDFsymbol + \PDFattributes}% + \else + \doPDFannotation{#2}{#3} + {/Subtype /Text + \ifcase#5 \else/Open true\fi + /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi + \FDFlayer + \PDFsymbol + \PDFidentifier + \PDFattributes}% + \fi + \stopPDFsymbolappearance + \egroup} + +% symbols with a reasonable default of 18/24 pt + +\newbox\PDFsymbolbox + +\def\PDFsymbolNew {/Insert} +\def\PDFsymbolBalloon {/Comment} +\def\PDFsymbolAddition {/NewParagraph} +\def\PDFsymbolHelp {/Help} +\def\PDFsymbolParagraph {/Paragraph} +\def\PDFsymbolKey {/Key } + +\def\PDFsymbolGraph {/Graph} +\def\PDFsymbolPaperclip {/Paperclip} +\def\PDFsymbolAttachment{/Attachment} +\def\PDFsymbolTag {/Tag} + +\def\startPDFsymbolappearance + {\setbox\scratchbox\vbox to \totalheight \bgroup \vfill} + +\def\stopPDFsymbolappearance + {\egroup + \setbox\scratchbox\hbox{\lower\depth\box\scratchbox}% + \wd\scratchbox\width + \ht\scratchbox\height + \dp\scratchbox\depth + \box\scratchbox} + +\def\presetPDFsymbolappearance#1#2#3#4#5% symbol color width height depth + {\doifelsenothing{#1} + {\let\PDFattributes\empty} + {\def\PDFattributes{/C \FDFcolor{#1}}}% + \scratchdimen#3\edef\width {\the\scratchdimen}% + \scratchdimen#4\edef\height{\the\scratchdimen}% + \scratchdimen#5\edef\depth {\the\scratchdimen}% + \advance\scratchdimen\height\edef\totalheight{\the\scratchdimen}% + \doifelsenothing{#2} + {\let\PDFsymbol\empty} + {\ifundefined{PDFsymbol#2}% + \getfromcommacommand[#2][1]\let\PDFsymbolnormalsymbol\commalistelement + \getfromcommacommand[#2][2]\let\PDFsymboldownsymbol \commalistelement + \doifsymboldefinedelse\PDFsymbolnormalsymbol + {\doifsymboldefinedelse\PDFsymboldownsymbol + {\dopresetPDFsymbolappearance + \PDFsymbolnormalsymbol\PDFsymboldownsymbol} + {\dopresetPDFsymbolappearance + \PDFsymbolnormalsymbol\PDFsymbolnormalsymbol}} + {\doifsymboldefinedelse\PDFsymboldownsymbol + {\dopresetPDFsymbolappearance + \PDFsymboldownsymbol\PDFsymboldownsymbol} + {\let\PDFsymbol\empty}}% + \else + \def\PDFsymbol{/Name \getvalue{PDFsymbol#2} }% + \fi}} + +\def\dopresetPDFsymbolappearance#1#2% + {\dopresetfieldsymbol{#1}% + \dopresetfieldsymbol{#2}% + \setbox\scratchbox\hbox{\symbol[#1]}% + \edef\width {\the\wd\scratchbox}% + \edef\height{\the\ht\scratchbox}% + \edef\depth {\the\dp\scratchbox}% + \scratchdimen\height \advance\scratchdimen\depth + \edef\totalheight{\the\scratchdimen}% + \doPDFgetobjectreference{SYM}{#1}\FDFsymbolNappearance + \doPDFgetobjectreference{SYM}{#2}\FDFsymbolDappearance + \edef\PDFsymbol + {/AP <>}} + +%D Hooked into \CONTEXT, this special supports +%D +%D \starttyping +%D \startcomment +%D hello beautiful\\world +%D \stopcomment +%D +%D \startcomment[hello] +%D de \'e\'erste keer +%D the f\'irst time +%D \stopcommen +%D +%D \startcommentaar[hallo][color=green,width=4cm,height=3cm] +%D first +%D +%D second +%D \stopcommentaar +%D \stoptyping +%D +%D So, special characters, forced linebreaks using \type{\\} +%D and \type{\par} are handled in the appropriate way. + +%D \macros +%D {doPDFovalbox} +%D +%D For drawing ovals we use quite raw \PDF\ code. The next +%D implementation does not differ that much from the one +%D implemented in the \POSTSCRIPT\ driver. + +\def\doPDFovalcalc#1#2#3% + {\dimen2=#1% + \advance\dimen2 #2\relax + \PointsToBigPoints{\dimen2}#3} + +\def\doPDFovalbox#1#2#3#4#5#6#7#8% todo: \scratchdimen/\scatchbox + {\forcecolorhack + \bgroup + \dimen0=#4\divide\dimen0 \plustwo + \doPDFovalcalc{0pt}{+\dimen0}\xmin + \doPDFovalcalc{#1}{-\dimen0}\xmax + \doPDFovalcalc{#2}{-\dimen0}\ymax + \doPDFovalcalc{-#3}{+\dimen0}\ymin + \advance\dimen0 by #5% + \doPDFovalcalc{0pt}{+\dimen0}\xxmin + \doPDFovalcalc{#1}{-\dimen0}\xxmax + \doPDFovalcalc{#2}{-\dimen0}\yymax + \doPDFovalcalc{-#3}{+\dimen0}\yymin + \doPDFovalcalc{#4}{\zeropoint}\stroke + \doPDFovalcalc{#5}{\zeropoint}\radius + \edef\dostroke{#6}% + \edef\dofill{#7}% + \edef\mode{\number#8 \space}% + % no \ifcase, else \relax in pdfcode + \setbox\scratchbox\hbox + {\ifnum\dostroke\dofill>\zerocount + \ifPDFstrokecolor\else\ifnum\dostroke=\plusone + \writestatus\m!colors{pdf stroke color will fail}\wait + \fi\fi + \PDFcode + {q + \stroke\space w + \ifcase\mode + \xxmin\space \ymin \space m + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax\space \ymax \space y + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + h + \or % 1 + \xxmin\space \ymin \space m + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \ymax \space l + \xmin \space \ymax \space l + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + h + \or % 2 + \xxmin\space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \ymax \space l + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + h + \or % 3 + \xmin \space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax\space \ymax \space y + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \ymin \space l + h + \or % 4 + \xmin \space \ymin \space m + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax\space \ymax \space y + \xmin \space \ymax \space l + \xmin \space \ymin\space l + h + \or % 5 + \xmin \space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax\space \ymax \space y + \xmin \space \ymax \space l + \xmin \space \ymin \space l + h + \or % 6 + \xmin \space \ymin \space m + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \ymax \space l + \xmin \space \ymax \space l + \xmin \space \ymin \space l + h + \or + \xxmin\space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \ymax \space l + \xmin \space \ymax \space l + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + h + \or + \xmin \space \ymin \space m + \xmax \space \ymin \space l + \xmax \space \ymax \space l + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \ymin \space l + h + \or % 9 top open + \xmin \space \ymax \space m + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + \xxmax\space \ymin \space l + \xmax \space \ymin \space \xmax \space \yymin\space y + \xmax \space \ymax \space l + \or % 10 right open + \xmax \space \ymax \space m + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \yymin\space l + \xmin \space \ymin \space \xxmin\space \ymin \space y + \xmax\space \ymin \space l + \or % 11 bottom open + \xmax \space \ymin \space m + \xmax \space \yymax\space l + \xmax \space \ymax \space \xxmax \space \ymax\space y + \xxmin\space \ymax \space l + \xmin \space \ymax \space \xmin \space \yymax\space y + \xmin \space \ymin \space l + \or % 12 left open + \xmin \space \ymax \space m + \xxmax\space \ymax \space l + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmax \space \yymin\space l + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xmin \space \ymin \space l + \or % 13 + \xmin \space \ymax \space m + \xxmax\space \ymax \space l + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmax\space \ymin \space l + \or % 14 + \xmax \space \ymax \space m + \xmax \space \yymin\space l + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xmin \space \ymin \space l + \or % 15 + \xmax \space \ymin \space m + \xxmin\space \ymin \space l + \xmin \space \ymin \space \xmin \space \yymin\space y + \xmin \space \ymax \space l + \or % 16 + \xmin \space \ymin \space m + \xmin \space \yymax\space l + \xmin \space \ymax \space \xxmin\space \ymax \space y + \xmax \space \ymax \space l + \or % 17 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \or % 18 + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \or % 19 + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \or % 20 + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 21 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 22 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \or % 23 + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \or % 24 + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 25 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 26 + \xmax \space \yymin\space m + \xmax \space \ymin \space \xxmax\space \ymin \space y + \xmin \space \yymax\space m + \xmin \space \ymax \space \xxmin\space \ymax \space y + \or % 27 + \xxmax\space \ymax \space m + \xmax \space \ymax \space \xmax \space \yymax\space y + \xxmin\space \ymin \space m + \xmin \space \ymin \space \xmin \space \yymin\space y + \or % 28 + \fi + \ifnum\mode>8 + S + \else + \ifnum\dostroke=\plusone S \fi + \ifnum\dofill =\plusone f \fi + \fi + Q}% + \fi}% + \wd\scratchbox#1\ht\scratchbox#2\dp\scratchbox#3\box\scratchbox + \egroup} + +%D \macros +%D {doPDFstartgraymode,doPDFstopgraymode, +%D doPDFstartrgbcolormode,doPDFstartcmykcolormode,doPDFstartgraycolormode, +%D doPDFstopcolormode} +%D +%D In \PDF\ there are two color states, one for strokes and one +%D for fills. This means that we have to set the color in a +%D rather redundant looking way. Unfortunately this makes the +%D \PDF\ file much larger than needed. We can save few bytes +%D by not setting the stroke color. Due to zip compression we +%D only save a few percent. + +% \newif\ifPDFstrokecolor \PDFstrokecolortrue + +\def\doPDFstartgraymode#1% +% {\PDFdirectcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} + {\PDFcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} + +\def\doPDFstopgraymode +% {\PDFdirectcode{0 g\ifPDFstrokecolor\space0 G\fi}} + {\PDFcode{0 g\ifPDFstrokecolor\space0 G\fi}} + +\def\doPDFstartrgbcolormode#1#2#3% +% {\PDFdirectcode{#1 #2 #3 rg\ifPDFstrokecolor\space#1 #2 #3 RG\fi}} + {\PDFcode{#1 #2 #3 rg\ifPDFstrokecolor\space#1 #2 #3 RG\fi}} + +\def\doPDFstartcmykcolormode#1#2#3#4% +% {\PDFdirectcode{#1 #2 #3 #4 k\ifPDFstrokecolor\space#1 #2 #3 #4 K\fi}} + {\PDFcode{#1 #2 #3 #4 k\ifPDFstrokecolor\space#1 #2 #3 #4 K\fi}} + +\def\doPDFstartgraycolormode#1% +% {\PDFdirectcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} + {\PDFcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} + +\def\doPDFstartspotcolormode#1#2% redefining spotcolors is not possible anyway + {\ifundefined{pdf:scs:#2}% + \bgroup + \getcommacommandsize[#2]% + \ifcase\commalistsize\or + \setxvalue{pdf:scs:#2}{#2 SCN #2 scn}% \setxvalue{pdf:scs:#2}{#2 SC #2 sc}% + \else + \let\PDFspotcolorspecs\empty + \def\dospotcolorcommand##1{\edef\PDFspotcolorspecs{\PDFspotcolorspecs##1\space}}% + \processcommacommand[#2]\dospotcolorcommand + \setxvalue{pdf:scs:#2}{\PDFspotcolorspecs SCN \PDFspotcolorspecs scn}% + \fi + \egroup + \fi +% \PDFdirectcode{/#1 cs /#1 CS \PDFgetspotcolorspec{#2}}} + \PDFcode{/#1 cs /#1 CS \PDFgetspotcolorspec{#2}}} + +\def\PDFgetspotcolorspec#1% + {\executeifdefined{pdf:scs:#1}\empty} % better no default than one with too less args + +\def\doPDFstartnonecolormode +% {\PDFdirectcode{/None CS 1 SC /None cs 1 sc}} + {\PDFcode{/None CS 1 SC /None cs 1 sc}} + +\def\doPDFstopcolormode +% {\PDFdirectcode{0 g\ifPDFstrokecolor\space0 G\fi}} + {\PDFcode{0 g\ifPDFstrokecolor\space0 G\fi}} + +%D We need to register the spot colors and their fallbacks. + +% we cannot use /DeviceN since GS <=7.21 breaks on it +% and Jaws does not handle it at all {[/DeviceN [/All|/None] +% /Device#2 \PDFobjref\pdflastobj]} so we use separation +% colors that work and print ok + +\def\doPDFregistersomespotcolor#1#2#3#4% implemented in the driver + {\writestatus\m!systems{missing spot color definition}\wait} + +\def\doPDFregisternonecolor % internal command + {\doPDFregistergrayspotcolor{None}{1}% + \globallet\doPDFregisternonecolor\relax} + +\def\doPDFregisterspotcolorname#1#2% implemented in the driver + {} + +\definespecial\doregisterspotcolorname{\doPDFregisterspotcolorname} + +\def\dodoPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b + {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{RGB}{0.0 1.0 0.0 1.0 0.0 1.0}% + {\ifcase#2\or dup #5 mul exch dup #6 mul exch #7 mul\else#5 #6 #7\fi}} + +\def\dodoPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k + {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{CMYK}{0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0}% + {\ifcase#2\or dup #5 mul exch dup #6 mul exch dup #7 mul exch #8 mul\else #5 #6 #7 #8\fi}} + +\def\dodoPDFregistergrayspotcolor#1#2#3#4#5% name noffractions names p's s + {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}% + {\ifcase#2\or #5 mul\else #5\fi}} + +% \let\doPDFregisterrgbspotcolor \dodoPDFregisterrgbspotcolor +% \let\doPDFregistercmykspotcolor\dodoPDFregistercmykspotcolor +% \let\doPDFregistergrayspotcolor\dodoPDFregistergrayspotcolor + +\def\doPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b + {\ifRGBsupported + \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}% + \else + \edef\@@cl@@r{#5}\edef\@@cl@@g{#6}\edef\@@cl@@b{#7}% + \ifCMYKsupported + \convertRGBtoCMYK\@@cl@@r\@@cl@@g\@@cl@@b + \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k + \else + \convertRGBtoGRAY\@@cl@@r\@@cl@@g\@@cl@@b + \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s + \fi + \fi} + +\def\doPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k + {\ifCMYKsupported + \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% + \else + \edef\@@cl@@c{#5}\edef\@@cl@@m{#6}\edef\@@cl@@y{#7}\edef\@@cl@@k{#8}% + \ifRGBsupported + \convertCMYKtoRGB\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k + \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}\@@cl@@r\@@cl@@g\@@cl@@b + \else + \convertCMYKtoGRAY\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k + \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s + \fi + \fi} + +\def\doPDFregistergrayspotcolor{\dodoPDFregistergrayspotcolor} + +%D New and very experimental. + +\def\doPDFregistercmykindexcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k + {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{CMYK}{0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0}% + {dup #5 mul exch dup #6 mul exch dup #7 mul exch #8 mul}} + +\def\doPDFregisterrgbindexcolor#1#2#3#4#5#6#7% name noffractions names p's r g b + {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{RGB}{0.0 1.0 0.0 1.0 0.0 1.0}% + {dup #5 mul exch dup #6 mul exch #7 mul}} + +\def\doPDFregistergrayindexcolor#1#2#3#4#5% name noffractions names p's s + {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}% + {pop}} + +\let\checkpredefinedcolor\predefineindexcolor % we need an index in order to negate bitmaps + +\def\doPDFregisterfigurecolor#1% always an index color + {\dogetobjectreference + {PDFIX} + {\internalspotcolorname{#1}} + \PDFimagecolorreference} + +%D \macros +%D {doPDFstartrotation,doPDFstoprotation} +%D +%D Rotating some text can be accomplished by setting the first +%D four elements of the transform matrix. We only support some +%D fixed angles. The \type{q}'s take care of grouping. + +% The original: +% +% \def\doPDFstartrotation#1% +% {\PDFcode{q}% +% \processaction +% [#1] +% [ 90=>\PDFcode{ 0 1 -1 0 0 0 cm}, +% 180=>\PDFcode{-1 0 0 -1 0 0 cm}, +% 270=>\PDFcode{ 0 -1 1 0 0 0 cm}, +% 360=>\PDFcode{ 1 0 0 1 0 0 cm}]} +% +% We cannot directly pass an angle, but have to calculate +% factors (rx and ry). As in the \METAPOST\ to \PDF\ +% converter module we need to compensate the deformation +% by setting (sx and sy). +% +% Optimized but bigger: +% +% \def\doPDFstartrotation#1% +% {\PDFcode{q}% +% \processaction +% [#1] +% [ 0=>\PDFcode{ 1 0 0 1 0 0 cm}, +% 90=>\PDFcode{ 0 1 -1 0 0 0 cm}, +% 180=>\PDFcode{-1 0 0 -1 0 0 cm}, +% 270=>\PDFcode{ 0 -1 1 0 0 0 cm}, +% 360=>\PDFcode{ 1 0 0 1 0 0 cm}, +% #1=>\setcalculatedcos\cos{#1}% +% \setcalculatedsin\sin{#1}% +% \PDFcode{\cos \space % cos +% \sin \space % sin +% \negated\sin\space % -sin +% \cos \space % cos +% 0 0 cm}]} +% +% Since the sine and cosine values are preset and rounded we +% can use the next alternative without running into inaccuracies. + +\def\doPDFstartrotation#1% grouped + {\setcalculatedcos\cos{#1}% + \setcalculatedsin\sin{#1}% + \forcecolorhack + \PDFcode{q \cos\space\sin\space\negated\sin\space\cos\space0 0 cm}} + +\def\doPDFstoprotation + {\PDFcode{Q}} + +%D \macros +%D {doPDFstartscaling,doPDFstopscaling} +%D +%D Scaling is rather straightforward: + +\def\@@PDFzeroscale{.0001} + +\def\doPDFstartscaling#1#2% the test is needed because acrobat is bugged! + {\forcecolorhack + \PDFcode{q \ifdim#1\points=\zeropoint\@@PDFzeroscale\else#1\fi\space 0 0 + \ifdim#2\points=\zeropoint\@@PDFzeroscale\else#2\fi\space 0 0 cm}} + +% \def\doPDFstartscaling#1#2% the test is needed because acrobat is bugged! +% {\PDFcode{q\ifdim#1\points=\zeropoint\else\ifdim#2\points=\zeropoint\else +% \space#1\space 0 0 #2\space 0 0 cm\fi\fi}} + +\def\doPDFstopscaling + {\PDFcode{Q}} + +%D \macros +%D {doPDFstartmirroring,doPDFstopmirroring} +%D +%D Mirroring is implemented in a similar way: + +\def\doPDFstartmirroring + {\PDFcode{-1 0 0 1 0 0 cm}} + +\def\doPDFstopmirroring + {\PDFcode{-1 0 0 1 0 0 cm}} + +%D \macros +%D {doPDFstartnegative,doPDFstopnegative} +%D +%D When producing output for an image setter, sometimes negative +%D output is needed. + +\def\doPDFstartnegative + {\ifx\initializePDFnegative\undefined\else + \initializePDFnegative +% \PDFdirectcode{/GSnegative gs}% + \PDFcode{/GSnegative gs}% + \fi} + +\def\doPDFstopnegative + {\ifx\initializePDFnegative\undefined\else + \initializePDFnegative +% \PDFdirectcode{/GSpositive gs}% + \PDFcode{/GSpositive gs}% + \fi} + +%D \macros +%D {doPDFstartoverprint,doPDFstopoverprint} +%D +%D Some printers like overprint more than knockout. + +\def\doPDFstartoverprint + {\ifx\initializePDFoverprint\undefined\else + \initializePDFoverprint +% \PDFdirectcode{/GSoverprint gs}% + \PDFcode{/GSoverprint gs}% + \fi} + +\def\doPDFstopoverprint + {\ifx\initializePDFoverprint\undefined\else + \initializePDFoverprint +% \PDFdirectcode{/GSknockout gs}% + \PDFcode{/GSknockout gs}% wrong + \fi} + +%D Transparency support: + +\newif\ifPDFtransparencysupported + +\def\PDFtransparancydictionary#1#2#3% type fraction extras + {<>} + +\def\dodoPDFstarttransparency#1#2% + {\presetPDFtransparency{#1}{#2}% + \PDFcode{\PDFtransparencyidentifier\space gs }} + +\def\dodoPDFstoptransparency + {\PDFcode{/Tr0 gs }} + +\def\doPDFstarttransparency + {\ifPDFtransparencysupported + \global\let\doPDFstarttransparency\dodoPDFstarttransparency + \global\let\doPDFstoptransparency \dodoPDFstoptransparency + \initializetransparency + \expandafter\doPDFstarttransparency + \else + \expandafter\gobbletwoarguments + \fi} + +% \let\doPDFstoptransparency\relax +% +% This is tricky: because a text stream is handled before +% the page body is built, we can run into stops that will +% match an outer start; however, the stop is needed in case +% of a text color: [text color text] [other color text] on a +% first page combined with color splitting will go wrong if +% we stick to the relaxing method. + +\def\doPDFstoptransparency + {\ifPDFtransparencysupported + \initializetransparency + \dodoPDFstoptransparency + \fi} + +%D These use: + +\let\PDFtransparencyresetreference \empty +\let\PDFtransparencyresetidentifier\empty + +\let\PDFtransparencyreference \empty +\let\PDFtransparencyidentifier\empty + +\let\presetPDFtransparency \gobbletwoarguments +\let\initializetransparency\relax + +%D New trickery: + +\definespecial\dostartgraphicgroup{\PDFcode{q}} +\definespecial\dostopgraphicgroup {\PDFcode{Q}} + +%D Even newer trickery: + +\definespecial\dostartviewerlayer {\doPDFstartlayer} +\definespecial\dostopviewerlayer {\doPDFstoplayer} +\definespecial\dodefineviewerlayer{\doPDFdefinelayer} + +\let\PDFtextlayers\empty +\let\PDFpagelayers\empty +\let\PDFhidelayers\empty +\let\PDFvidelayers\empty + +% \def\doPDFstartlayer#1{\PDFdirectcode{/OC /#1 BDC}} +% \def\doPDFstoplayer {\PDFdirectcode {EMC}} + +\def\doPDFstartlayer#1{\PDFcode{/OC /#1 BDC}} +\def\doPDFstoplayer {\PDFcode {EMC}} + +% resource -> prop -> mc's -> OCG|OCMD (nested) + +% ocg: + +% /Intent/Design + +% ocmd + +% /P /AllOn + +% kan zelf ocmd bevatten + +\def\doPDFdefinelayer#1#2#3#4#5% tag title visible type printable + {\doPDFdictionaryobject{PDLN}{#1} + {/Type /OCG + \ifcase#4 \or + /Intent /Design % disable layer hiding by user + \fi + \ifnum#5=\zerocount + /Usage << /Print << /PrintState /OFF >> >> % printable or not + \fi + /Name (#2)}% + \doPDFgetobjectreference{PDLN}{#1}\PDFobjectreference + \xdef\PDFtextlayers{\PDFtextlayers\space\PDFobjectreference}% + \doifelse{#3}\v!start + {\xdef\PDFvidelayers{\PDFvidelayers\space\PDFobjectreference}}% + {\xdef\PDFhidelayers{\PDFhidelayers\space\PDFobjectreference}}% + \doPDFdictionaryobject{PDLD}{#1} + {/Type /OCMD + /OCGs [\PDFobjectreference]}% + \doPDFgetobjectreference{PDLD}{#1}\PDFobjectreference + \xdef\PDFpagelayers{\PDFpagelayers\space /#1 \PDFobjectreference}} + +\def\flushPDFtextlayers + {\ifx\PDFtextlayers\empty \else + \driverreferenced \doPDFarrayobject{PDF}{textlayers}{\PDFtextlayers}% + \doPDFgetobjectreference{PDF}{textlayers}\!!stringa + \ifx\PDFvidelayers\empty + \def\!!stringb{[null]}% + \else + \driverreferenced \doPDFarrayobject{PDF}{videlayers}{\PDFvidelayers}% + \doPDFgetobjectreference{PDF}{videlayers}\!!stringb + \fi + \ifx\PDFhidelayers\empty + \def\!!stringc{[null]}% + \else + \driverreferenced \doPDFarrayobject{PDF}{hidelayers}{\PDFhidelayers}% + \doPDFgetobjectreference{PDF}{hidelayers}\!!stringc + \fi + \doPDFaddtocatalog + {/OCProperties + << % display in menu + /D << /Order \!!stringa + /ON \!!stringb + /OFF \!!stringc >> + % used properties + /OCGs \!!stringa >>}% + \globallet\flushPDFtextlayers\relax + \fi} + +\def\flushPDFpagelayers + {\ifx\PDFpagelayers\empty \else + \doPDFpageresource{/Properties <<\PDFpagelayers>>}% + \fi} + +\prependtoksonce \flushPDFpagelayers \to \everyshipout +\prependtoksonce \flushPDFtextlayers \to \everylastshipout + +\def\PDFlayeractionlist{null} + +\def\PDFexecutehidelayer {/SetOCGState /State [/OFF \PDFlayeractionlist]} +\def\PDFexecutevidelayer {/SetOCGState /State [/ON \PDFlayeractionlist]} +\def\PDFexecutetogglelayer {/SetOCGState /State [/Toggle \PDFlayeractionlist]} + +\def\domakeviewerlayerlist#1% + {\bgroup + \globallet\PDFlayeractionlist\empty + \def\docommand##1% + {\doPDFgetobjectreference{PDLN}{##1}\PDFobjectreference + \xdef\PDFlayeractionlist{\PDFlayeractionlist\space\PDFobjectreference}}% + \processcommalist[#1]\docommand + \egroup} + +%D Something rather pdf dependent: + +% #1 => 1=fill 2=stroke 3=strokedfill 4=invisible +% #2 => linewidth +% #3 => spacing (beware, one needs to set the hsize as well) + +\def\doPDFstartfonteffect#1#2#3% + {\ifdim#2>\zeropoint + \PointsToBigPoints{#2}\ascii +% \PDFdirectcode{\ascii\space w}% + \PDFcode{\ascii\space w}% + \fi + \ifdim#3\points=\onepoint\else + \scratchdimen#3\points +% \PDFdirectcode{\withoutpt{\the\scratchdimen}\space Tc}% + \PDFcode{\withoutpt{\the\scratchdimen}\space Tc}% + \fi +% \PDFdirectcode{\purenumber#1 Tr}} + \PDFcode{\purenumber#1 Tr}} + +\def\doPDFstopfonteffect +% {\PDFdirectcode{1 w 0 Tc 0 Tr}} + {\PDFcode{1 w 0 Tc 0 Tr}} + +%D Handy for the \METAPOST\ to \PDF\ converter: + +\ifdefined\everyPDFximage \else \newtoks\everyPDFximage \fi +\ifdefined\everyPDFxform \else \newtoks\everyPDFxform \fi + +\appendtoksonce + \collectPDFresources + \global\let\currentPDFresources\collectedPDFresources +\to \everyPDFxform + +\let\collectedPDFresources\empty + +\def\collectPDFresources % suboptimal + {\doifobjectreferencefoundelse{FDF}{docushades} % redundant, we have an reserved object now + {\doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference + \xdef\collectedPDFresources{\collectedPDFresources/Shading \PDFobjectreference}}\donothing + \doifobjectreferencefoundelse{FDF}{docuextgstates} + {\doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference + \xdef\collectedPDFresources{\collectedPDFresources/ExtGState \PDFobjectreference}}\donothing + \doifobjectreferencefoundelse{FDF}{colorspaces} + {\doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference + \xdef\collectedPDFresources{\collectedPDFresources/ColorSpace \PDFobjectreference}}\donothing + \global\let\collectPDFresources\relax} + +%D And that was about all. + +\stopspecials + +\ifx\fullytransparentcolor\undefined \else + + \def\fullytransparentcolor + {\doPDFregisternonecolor + \doPDFstartnonecolormode} + + \let\doPDFstarttransparency\gobbletwoarguments + \let\doPDFstoptransparency\relax + +\fi + +%D Temporary hack: + +\def\TransparencyHack % png: /CS /DeviceRGB /I true + {\appendtoks + \doPDFpageattribute{/Group << /S /Transparency /I true /K true>>}% + \to \everyPDFxform + \appendtoks + \doPDFpageattribute{/Group << /S /Transparency /I true /K true>>}% + \to \everyshipout} + +%D We still need to implement a few helpers: + +\chardef\safePDFcode=`- + +\def\setPDFdestination#1% + {\bgroup + \retainlccodes + \lccode`\/\safePDFcode \lccode`\#\safePDFcode + \lccode`\<\safePDFcode \lccode`\>\safePDFcode + \lccode`\[\safePDFcode \lccode`\]\safePDFcode + \lccode`\(\safePDFcode \lccode`\)\safePDFcode + \ifovercomePDFspace + \lccode`\ \safePDFcode + \fi + \ifovercomePDFbugs + \xdef\PDFdestination{'#1'}% + \else + \xdef\PDFdestination{#1}% + \fi + % nicer \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}% + \lowercase\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}% + \egroup} + +%D This is much faster since we don't have to set the full +%D range of lc-codes; about 5 sec on a 1000mhz PIII for +%D 20K named destinations "x(x) x"). Of course when you use +%D page destinations, the saving is nil. + +% \doifnotmode{atpragma}{\let\next\setPDFdestination} % experimental +% +% \catcode`\/=\@@active \catcode`\#=\@@active +% \catcode`\<=\@@active \catcode`\>=\@@active +% \catcode`\[=\@@active \catcode`\]=\@@active +% \catcode`\(=\@@active \catcode`\)=\@@active +% +% \gdef\PDFrepchar{-} +% +% \gdef\setPDFdcharacters +% {\catcode`\/=\@@active \let/\PDFrepchar +% \catcode`\#=\@@active \let#\PDFrepchar +% \catcode`\<=\@@active \let<\PDFrepchar +% \catcode`\>=\@@active \let>\PDFrepchar +% \catcode`\[=\@@active \let[\PDFrepchar +% \catcode`\]=\@@active \let]\PDFrepchar +% \catcode`\(=\@@active \let(\PDFrepchar +% \catcode`\)=\@@active \let)\PDFrepchar} +% +% \egroup +% +% \def\setPDFdestination#1% expansion is needed, otherwise embedded +% {\bgroup % macros will not expand under the new +% \setPDFdcharacters % catcode regime +% \ifovercomePDFspace +% \catcode32=\@@ignore +% \fi +% \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}% +% \scantokens\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}% +% \egroup} +% +% \doifnotmode{atpragma}{\let\setPDFdestination\next} % experimental + +%D This is a slow one, that uses \type{\lccode}'s to +%D change the glyph as well as converts sensisitve ones into a +%D \PDF\ command sequence, so \type{(} becomes \type{\(}. In +%D fact we translate the string to lowercase inactive and non +%D special characters, limit their number and finaly convert +%D some of the characters to save ones. + +\chardef\maxPDFstringsize=60 + +\def\sanitizePDFstring#1\to#2% bugged + {\bgroup + \retainlccodes + \lccode`( \zerocount \lccode`) \zerocount + \lccode`< \zerocount \lccode`> \zerocount + \lccode`[ \zerocount \lccode`] \zerocount + \lccode`\\\zerocount \lccode`/ \zerocount + \lowercase{\defconvertedargument\ascii{#1}}% + % by integrating the split in the loop below + % \splitofftokens\maxPDFstringsize\from\ascii\to\ascii + % we diminish the processing time considerably + \scratchcounter\maxPDFstringsize + \def\docommand##1% + {\ifcase\scratchcounter\else + \advance\scratchcounter \minusone + \ifcase\lccode`##1\relax + \xdef#2{#2\expandafter\string\csname##1\endcsname}% + \else + \xdef#2{#2##1}% + \fi + \fi}% + %\global\let#2=\empty + % or to permit #2 to be \ascii too: + \global\@EA\let\@EA#2\@EA\empty + \@EA\handletokens\ascii\with\docommand + \egroup} + +% \doifnotmode{atpragma}{\let\next\sanitizePDFstring} % experimental +% +% \bgroup +% +% \catcode`\.=\@@escape +% +% .catcode`./=.@@active +% .catcode`.<=.@@active .catcode`.>=.@@active +% .catcode`.[=.@@active .catcode`.]=.@@active +% .catcode`.(=.@@active .catcode`.)=.@@active +% +% .gdef.setPDFscharacters% +% {.catcode`.\=.@@other +% .catcode`./=.@@active .def/{.noexpand./}% +% .catcode`.<=.@@active .def<{.noexpand.<}% +% .catcode`.>=.@@active .def>{.noexpand.>}% +% .catcode`.[=.@@active .def[{.noexpand.[}% +% .catcode`.]=.@@active .def]{.noexpand.]}% +% .catcode`.(=.@@active .def({.noexpand.(}% +% .catcode`.)=.@@active .def){.noexpand.)}} +% +% .gdef.sanitizePDFstring#1.to#2% +% {.bgroup +% .setPDFscharacters +% .catcode`=.@@escape +% .edef.next{.strippedcsname#2}% +% .scantokens{setxvalue{next}{#1}}% +% .egroup} +% +% .egroup +% +% \doifnotmode{atpragma}{\let\sanitizePDFstring\next} % experimental +% +% There is an unicode variant in spec-tst! + +\protect \endinput diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex deleted file mode 100644 index da29a5b38..000000000 --- a/tex/context/base/spec-fdf.tex +++ /dev/null @@ -1,3446 +0,0 @@ -%D \module -%D [ file=spec-fdf, -%D version=1998.05.18, -%D title=\CONTEXT\ \PDF\ Macros, -%D subtitle=Support Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D The name of this module is a bit strange but it started with fields -%D so we keep the name. - -%D When dealing with resources, we share the resource dictionaries -%D between all xforms. This is inefficent in the sense that when no -%D resources are used, redundant entries take space, but on the other -%D hand we save redundant dictionaries so it's a nice compromise. Maybe -%D that in \LUATEX\ I will reimplement most of the code here anyway. - -%D We need to check if we can use \type {\driverreferenced} -%D object in more places. - -%D Initialization of fields is tricky. If a field has no -%D value, it is kind of not there. If ResetForm is used, the -%D default is assigned, but pushbuttons are spoiled. Adding a -%D \type {/MK} dictionary helps, but gives ugly down -%D appearances (displaced with background). What a mess. -%D Also, in order to get at least something, the \type {/AS} -%D key should be provided. - -% to do : /IF << /SW /N >> == no scaling / clipping of widget - -\unprotect - -%D \macros -%D {PDFobjref} -%D -%D Just a shortcut. - -% Watch out, \def\PDFobjref#1{\purenumber#1 0 R} also works, but not when -% #1 == \the\whatever - -\def\PDFobjref#1{\purenumber{#1} 0 R} - -%D \macros -%D {PDFswapdir} - -\let\PDFswapdir\empty \def\PDFswapdir{\ifcase\inlinedirection\or\or-\fi} - -% the pdf spec changed cq. viewers started behaving differently / 5+ - -\chardef\overcomePDFpage\plusone % page numbers/ beware: optimizers remove this one -\chardef\overcomePDFpage\plustwo % page:number -%chardef\overcomePDFpage\plusthree % pdftex page ref feature - -\ifx\pdfpageref\undefined \else \chardef\overcomePDFpage\plusthree \fi - -%D \macros -%D {setPDFdestination} -%D -%D \PDF\ destinations should obey the specifications laid down -%D in the \PDF\ reference manual. The next macro strips illegal -%D characters from the destination name. -%D -%D The \ACROBAT\ programs are not bug free. By setting the next -%D switches, we will at least try to prevent problems. - -\newif\ifovercomePDFbugs \overcomePDFbugsfalse % dest sort problem / 3- -\newif\ifovercomePDFspace \overcomePDFspacetrue % dest sort problem / 3- - -\let\setPDFdestination\gobbleoneargument % a MK specific definition - -%D \macros -%D {sanitizePDFstring} -%D -%D This macro at least tries to convert a arbitrary string -%D into a sequence of characters valid for \PDF\ bookmarks and -%D alike. - -\def\sanitizePDFstring#1\to#2{} - -%D \macros -%D {doPDFdestination, -%D doPDFaction, -%D doPDFannotation, -%D doPDFannotationobject, -%D doPDFdictionaryobject, -%D doPDFarrayobject, -%D doPDFaddtocatalog, -%D doPDFaddtoinfo, -%D doPDFpageattribute, -%D doPDFpageresource, -%D doPDFpagesattribute, -%D doPDFbookmark, -%D defaultobjectreference, -%D doPDFgetobjectreference} -%D -%D This module deals with \PDF\ support, including fill||in -%D forms. Before we present the largely unreadable bunch of -%D macros, we introduce the here||not||defined low level -%D interface macros. These must be provided by the special -%D drivers \type{pdf} (\ACROBAT) and \type{tpd} (\PDFTEX). -%D -%D \starttyping -%D \doPDFdestination #1 name -%D \doPDFaction #1#2#3 width height action -%D \doPDFannotation #1#2#3 width height data -%D \doPDFannotationobject #1#2#3#4#5 class name width height data -%D \doPDFdictionaryobject #1#2#3 class name data -%D \doPDFarrayobject #1#2#3 class name data -%D \doPDFaddtocatalog #1 -%D \doPDFaddtoinfo #1 -%D \doPDFpageattribute #1 -%D \doPDFpageresource #1 -%D \doPDFpagesattribute #1 -%D \doPDFbookmark #1#2#3#4#5 level n text page open -%D -%D \defaultobjectreference #1#2 class name -%D \doPDFgetobjectreference #1#2#3 class name \PDFobjectreference -%D \doPDFgetobjectpagereference #1#2#3 class name \PDFobjectreference -%D \stoptyping -%D -%D The keywords reflect their use. For the moment we stick to -%D keywords, because that way at we get an indication of what -%D we're doing. - -\startspecials[fdf] - -%D Common: - -% \def\doPDFgetobjectreference#1#2#3% -% {\def#3{..}} - -\def\doPDFgetobjectpage#1#2#3% - {\dogetobjectreferencepage{#1}{#2}#3% - \ifx#3\empty\def#3{1}\fi} - -\def\doPDFgetobjectpagereference#1#2#3% - {\dogetobjectreferencepage{#1}{#2}#3% - \ifx#3\empty - \doPDFgetpagereference\realfolio#3% - \else - \doPDFgetpagereference#3#3% we assume that #3 gets expanded - \fi} - -% \def\doPDFgetpagereference#1#2%%%%%%%%%%%%%%% -% {\def#2{...}} - -%D Due to the fact that \PDFTEX\ has a different concept of -%D page attributes, we need: - -\let\doPDFresetpageattributes\relax -\let\doPDFresetpageresources \relax - -\appendtoksonce - \doPDFresetpageattributes - \doPDFresetpageresources -\to \everyaftershipout - -\ifx\PDFcode\undefined - \ifx\pdfliteral\undefined - \def\PDFcode#1{\message{[ignored pdfliteral: #1]}} - \else - \let\PDFcode\pdfliteral - \fi -\fi - -%D For special (\METAPOST) effects, we need to build -%D resource dictionaries. Here is the framework. - -\let\docuPDFextgstates\empty -%let\pagePDFextgstates\empty - -\def\checkPDFextgstates - {\ifx\docuPDFextgstates\empty \else - \ifnum\realpageno=\lastpage\relax - %\doPDFreserveddictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}% - \doPDFdictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}% - \fi - \doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference - \doPDFpageresource{/ExtGState \PDFobjectreference}% - \fi} - -\appendtoksonce - \checkPDFextgstates -\to \everyshipout - -\def\appendtoPDFdocumentextgstates#1% - {\xdef\docuPDFextgstates{\docuPDFextgstates\space#1}} - -%D Another special mechanism (needed for color separation): - -\let\docuPDFcolorspaces\empty - -\def\checkPDFcolorspaces - {\ifx\docuPDFcolorspaces\empty \else - \ifnum\realpageno=\lastpage\relax - %\doPDFreserveddictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}% - \doPDFdictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}% - \fi - \doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference - \doPDFpageresource{/ColorSpace \PDFobjectreference}% - \fi} - -\appendtoksonce - \checkPDFcolorspaces -\to \everyshipout - -\def\appendtoPDFdocumentcolorspaces#1% - {\xdef\docuPDFcolorspaces{\docuPDFcolorspaces\space#1}} - -%D And another one (used to be in spec-pdf) - -\let\docuPDFshades\empty - -\def\checkPDFshades - {\ifx\docuPDFshades\empty \else - \ifnum\realpageno=\lastpage\relax - %\doPDFreserveddictionaryobject{FDF}{docushades}{\docuPDFshades}% - \doPDFdictionaryobject{FDF}{docushades}{\docuPDFshades}% - \fi - \doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference - \doPDFpageresource{/Shading \PDFobjectreference}% - \fi} - -\appendtoksonce - \checkPDFshades -\to \everyshipout - -\def\appendtoPDFdocumentshades#1% - {\xdef\docuPDFshades{\docuPDFshades\space#1}} - -%D \macros -%D {doPDFsetupscreen,doPDFsetupidentity} -%D -%D Opposite to \DVI\ drivers, \PDF\ ones must know which what -%D page dimensions they are dealing. We also use the -%D opportunity to launch full screen (1) or show bookmarks (2). - -\let\currentPDFpagemode \empty % document catalog -\let\currentPDFviewerprefs\empty % document catalog - -\let\currentPDFcropbox \empty % page attributes -\let\currentPDFbleedbox \empty % page attributes -\let\currentPDFartbox \empty % page attributes -\let\currentPDFtrimbox \empty % page attributes - -\def\doPDFsetupscreen#1#2#3#4#5#6% watch the extra argument - {\bgroup -% \!!widtha#4% -% \advance\!!widtha#2% -% \!!heighta-#5% -% \!!heightb#1% extra argument -% \advance\!!heightb -#3% -% \advance\!!heighta \!!heightb -% % sometimes whole values give better results -% % \PointsToWholeBigPoints{#2}\left -% % \PointsToWholeBigPoints\!!heighta\bottom -% % \PointsToWholeBigPoints\!!widtha \width -% % \PointsToWholeBigPoints\!!heightb\height -% % but since pdf/x does not round when checking if -% % the boxes fit inside the media box ... -% \PointsToBigPoints{#2}\left -% \PointsToBigPoints\!!heighta\bottom -% \PointsToBigPoints\!!widtha \width -% \PointsToBigPoints\!!heightb\height -% \xdef\currentPDFcropboxspec -% {[\left\space\bottom\space\width\space\height]}% -% \global\let\currentPDFtrimboxspec\currentPDFcropboxspec -% -% \xdef\currentPDFpagemode -% {/PageMode \ifcase#6 -% /UseNone\or/FullScreen\or/UseOutlines\else/UseNone\fi}% -% - \xdef\currentPDFpagemode - {\ifnum#6=4 - /PageLayout /TwoColumnRight - \else - /PageMode \ifcase#6 - /UseNone\or/FullScreen\or/UseOutlines\else/UseNone\fi - \fi}% - \xdef\currentPDFviewerprefs % space after #6 needed, else \relax - {\ifcase#6 \or\or\else /ViewerPreferences << /FitWindow true >>\fi}% - \egroup} - -% not that good if we switch drivers - -\def\addPDFdocumentinfo - {\doPDFaddtocatalog{\currentPDFpagemode\currentPDFviewerprefs}% - \doPDFaddtocatalog{/Version \ifdim\PDFversion00\points>100\points 1.\fi\PDFversion}% - \doPDFaddtoinfo{/Trapped /False}% - \doPDFaddtoinfo{/ConTeXt.Version (\contextversion)}% - \doPDFaddtoinfo{/ConTeXt.Time (\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}% - \doPDFaddtoinfo{/ConTeXt.Jobname (\jobname)}% - \doPDFaddtoinfo{/ConTeXt.Url (www.pragma-ade.com)}} - -\appendtoksonce % hack to prevent duplicates - \addPDFdocumentinfo -\to \everyfirstshipout - -\def\PDFversion{1.5} - -\appendtoksonce - \def\PDFversion{1.5}% - \let\addPDFdocumentinfo\relax -\to \everyresetspecials - -\def\doPDFsetupwhateverbox#1#2#3#4#5#6% watch the extra arguments - {\bgroup - \!!widtha \dimexpr#5+#3\relax - \!!heightb\dimexpr#2-#4\relax - \!!heighta\dimexpr\!!heightb-#6\relax - % sometimes whole values give better results - % \PointsToWholeBigPoints{#3}\left - % \PointsToWholeBigPoints\!!heighta\bottom - % \PointsToWholeBigPoints\!!widtha \width - % \PointsToWholeBigPoints\!!heightb\height - % but since pdf/x does not round when checking if - % the boxes fit inside the media box ... - \PointsToBigPoints{#3}\left - \PointsToBigPoints\!!heighta\bottom - \PointsToBigPoints\!!widtha \width - \PointsToBigPoints\!!heightb\height - \xdef#1{[\left\space\bottom\space\width\space\height]}% - \egroup} - -\def\doPDFsetupartbox {\doPDFsetupwhateverbox\currentPDFartbox } -\def\doPDFsetupcropbox {\doPDFsetupwhateverbox\currentPDFcropbox } -\def\doPDFsetupbleedbox{\doPDFsetupwhateverbox\currentPDFbleedbox} -\def\doPDFsetuptrimbox {\doPDFsetupwhateverbox\currentPDFtrimbox } - -\gdef\currentPDFtrimbox{\currentPDFcropbox} % default, needed for pdf/x - -\def\flushPDFwhateverbox#1#2% - {\doifsomething{#1}{\doPDFpageattribute{/#2Box #1}}} - -\def\flushPDFpageboxes - {\flushPDFwhateverbox\currentPDFartbox {Art}% - \flushPDFwhateverbox\currentPDFcropbox {Crop}% - \flushPDFwhateverbox\currentPDFbleedbox{Bleed}% - \flushPDFwhateverbox\currentPDFtrimbox {Trim}} - -\appendtoksonce - \flushPDFpageboxes -\to \everyshipout - -\def\doPDFsetupidentity#1#2#3#4#5#6% - {\bgroup - \enablePDFdocencoding - \edef\!!stringa{#5}% - \ifx\!!stringa\empty \ifx\pdfdate\undefined\else - \edef\!!stringa{D:\pdfdate}% - \fi \fi - \expanded{\doPDFaddtoinfo - {/Title (#1) - /Subject (#2) - /Author (#3) - /Creator (#4) - /ModDate (\!!stringa) - /ID (\jobname.\!!stringa) % needed for pdf/x - /Keywords (#6)}}% - \egroup} - -%D \macros -%D {doPDFsetupopenaction,doPDFsetupcloseaction, -%D doPDFsetupopenpageaction,doPDFsetupclosepageaction} -%D -%D Setting the open and close actions is kind of fuzzy -%D because action chains are derived from the reference -%D mechanism. - -%D Starting with version~5 viewers, when the open actions -%D started yto give problems, for testing purposes we -%D decided use indirect actions. - -% \definespecial\dosetupopenaction {\doPDFsetupopenaction} -% \definespecial\dosetupcloseaction {\doPDFsetupcloseaction} -% \definespecial\dosetupopenpageaction {\doPDFsetupopenpageaction} -% \definespecial\dosetupclosepageaction{\doPDFsetupclosepageaction} - -\let\lastPDFaction\empty - -%D We can safe a couple of references by moving this code -%D to the specific drivers. -%D -%D The following code used to work okay, but as with any -%D update of Acrobat Viewers, upward compatibility was -%D just a dream. - -\definespecial\dosetupopenaction {\doPDFaddtocatalog{/OpenAction <<\lastPDFaction>>}} -\definespecial\dosetupcloseaction{\doPDFaddtocatalog{/CloseAction <<\lastPDFaction>>}} - -% todo: /AA << dictionary in catalog >> - -% \globalletempty\PDFdocumentclose -% \globalletempty\PDFwillsave -% \globalletempty\PDFdidsave -% \globalletempty\PDFwillprint -% \globalletempty\PDFdidprint - -% \definespecial\dosetupdocumentcloseaction {\global\let\PDFdocumentclose\lastPDFaction} -% \definespecial\dosetupwillsaveaction {\global\let\PDFwillsave \lastPDFaction} -% \definespecial\dosetupdidsaveaction {\global\let\PDFdidsave \lastPDFaction} -% \definespecial\dosetupwillprintaction {\global\let\PDFwillprint \lastPDFaction} -% \definespecial\dosetupdidprintaction {\global\let\PDFdidprint \lastPDFaction} - -% \def\checkPDFdocumentactions -% {\iflocation -% \doPDFpageattribute -% {/AA <<\ifx\PDFdocumentclose\empty \else /DC <<\PDFdocumentclose>> \fi -% \ifx\PDFwillsave \empty \else /WS <<\PDFwillsave >> \fi -% \ifx\PDFdidsave \empty \else /DS <<\PDFdidsave >> \fi -% \ifx\PDFwillprint \empty \else /WP <<\PDFwillprint >> \fi -% \ifx\PDFdidprint \empty \else /DP <<\PDFdidprint >> \fi>>}% -% % \globalletempty\PDFdocumentclose -% % \globalletempty\PDFwillsave -% % \globalletempty\PDFdidsave -% % \globalletempty\PDFwillprint -% % \globalletempty\PDFdidprint -% \global\let\checkPDFdocumentactions\relax -% \fi} - -% \appendtoksonce -% \checkPDFdocumentactions -% \to \everylastshipout - -%\def\doPDFsetupopenaction% -% {\doPDFdictionaryobject{FDF}{local:openaction}\lastPDFaction -% \doPDFgetobjectreference{FDF}{local:openaction}\PDFobjectreference -% \doPDFaddtocatalog{/OpenAction \PDFobjectreference}} -% -%\def\doPDFsetupcloseaction% -% {\doPDFdictionaryobject{FDF}{local:closeaction}\lastPDFaction -% \doPDFgetobjectreference{FDF}{local:closeaction}\PDFobjectreference -% \doPDFaddtocatalog{/CloseAction \PDFobjectreference}} - -\let\PDFopenpageaction \empty -\let\PDFclosepageaction\empty - -\definespecial\dosetupopenpageaction {\global\let\PDFopenpageaction \lastPDFaction} -\definespecial\dosetupclosepageaction{\global\let\PDFclosepageaction\lastPDFaction} - -\def\checkPDFpageactions - {\iflocation % important since direct -) - \donefalse - \ifx\PDFopenpageaction \empty\!!doneafalse\else\donetrue\!!doneatrue\fi - \ifx\PDFclosepageaction\empty\!!donebfalse\else\donetrue\!!donebtrue\fi - \ifdone - \doPDFpageattribute - {/AA <<\if!!donea/O <<\PDFopenpageaction >> \fi - \if!!doneb/C <<\PDFclosepageaction>> \fi>>}% - \fi - \global\let\PDFopenpageaction \empty - \global\let\PDFclosepageaction\empty - \fi} - -\appendtoksonce - \checkPDFpageactions -\to \everyshipout - -%D \macros -%D {doPDFstartthisislocation} -%D -%D Next we define the macros that deal with hyperreferencing, -%D graphic inclusion and general document features. These are -%D the olderst ones. I won't comment much because one needs -%D knowledge of \PDF\ itself, and explaning \PDF\ is beyond -%D this documentation. - -\def\doPDFstartthisislocation#1% - {\bgroup - \setPDFdestination{#1}% - \ifx\PDFdestination\empty \else - \doPDFdestination{\PDFdestination}% - \fi - \egroup} - -%D \macros -%D {doPDFstartgotolocation, -%D doPDFstartgotorealpage, -%D doPDFstartgotoJS} -%D -%D The goto macros use the switch \type{\ifsecondaryreference} -%D to determine if actions should be linked. - -\def\locationfilesuffix{pdf} - -% \def\preparePDFlocationfile#1#2% -% {\setreferencefilename#1\to#2% -% \expanded{\doifnotinstring{.\locationfilesuffix}{#2}} -% {\edef#2{#2.\locationfilesuffix}}} -% -% \def\preparePDFlocationfile#1\to#2% -% {\setreferencefilename#1\to#2% -% \expanded{\doifnotinstring{.pdf}{#2}}{\edef#2{#2.pdf}}} - -\def\doPDFstartgotolocation#1#2#3#4#5#6% - {\bgroup - \doifelsenothing{#3} - {\setPDFdestination{#5}% - \doifelsenothing\PDFdestination - {\let\action\empty} - {\doifelsenothing{#4} - {\let\PDFfile\empty} - {\expanded{\beforesplitstring#4}\at.\to\PDFfile - \doifparentfileelse\PDFfile % {#4} - {\let\PDFfile\empty} - %{\setreferencefilename#4.\locationfilesuffix\to\PDFfile - {\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile - \edef\PDFfile - {R /F (\PDFfile)\ifgotonewwindow\space/NewWindow true \fi}}}% - \edef\action% - {/S /GoTo\PDFfile\space /D (\PDFdestination)}}} - {\doifelsenothing{#4} - {\let\PDFfile\empty - \let\PDFdestination\empty} - {\setreferencefilename/#4\to\PDFfile - \setPDFdestination{#5}% - \doifsomething\PDFdestination - {\edef\PDFdestination{\URLhash\PDFdestination}}}% - \edef\action{/S /URI /URI (#3\PDFfile\PDFdestination)}}% - \ifx\action\empty\else - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \fi - \egroup} - -\def\PDFgotonewwindow{\ifgotonewwindow\space/NewWindow true \fi} - -% optimization in tpd driver -% -% \edef\PDFdestination{(page:\the\scratchcounter)}% -% -% ==> -% -% \advance\scratchcounter 1 -% \edef\PDFdestination{[\pdfpageref \PDFobjref\scratchcounter\PDFpageviewwrd]}% -% -% \doPDFgetpagedestination#1#2% pagenumber macro % % fuzzy hack - -\def\doPDFstartgotorealpage#1#2#3#4#5% watch the R append trick - {\bgroup - \doifelsenothing{#3}% #1 = url - {\scratchcounter0#5\relax - \ifnum\scratchcounter>0 - \doifelsenothing{#4} - {\let\PDFfile\empty} - {\expanded{\beforesplitstring#4}\at.\to\PDFfile - \doifparentfileelse\PDFfile % {#4} - {\let\PDFfile\empty} - %{\setreferencefilename#4.\locationfilesuffix\to\PDFfile - {\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile - \edef\PDFfile{R /F (\PDFfile)\PDFgotonewwindow}}}% - \ifx\PDFfile\empty - \ifcase\overcomePDFpage - \or % pdf starts numbering at zero - \advance\scratchcounter \minusone - \edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}% - \or % pdf starts numbering at zero - \advance\scratchcounter \minusone - \edef\PDFdestination{(page:\the\scratchcounter)}% - \or % pdftex starts numbering at one - \edef\PDFdestination{[\pdfpageref\scratchcounter\space0 R \PDFpageviewwrd]}% - \fi - \else % across files it's a page number / pdf starts numbering at zero - \advance\scratchcounter \minusone - \edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}% - \fi - \edef\action{/S /GoTo\PDFfile\space /D \PDFdestination}% - \else - \let\action\empty - \fi} - {\doifelsenothing{#4} - {\let\PDFfile\empty} - {\setreferencefilename/#4\to\PDFfile}% - \edef\action{/S /URI /URI (#3\PDFfile)}}% - \ifx\action\empty\else - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \fi - \egroup} - -\let\lastfakedPDFpage\!!zerocount - -\def\fakePDFpagedestination % as in pdf, we start numbering at zero - {\iflocation \ifarrangingpages \ifnum\overcomePDFpage=\plustwo \else - \ifnum\lastfakedPDFpage<\realpageno - \bgroup - \xdef\lastfakedPDFpage{\realfolio}% - \advance\realpageno \minusone % is \expanded needed ? - \expanded{\doPDFdestination{page:\realfolio}}% - \egroup - \fi - \fi \fi \fi} - -\appendtoksonce - \fakePDFpagedestination -\to \everyshipout - -\def\doPDFstartgotoJS#1#2#3% - {\bgroup - \doPSsanitizeJScode#3\to\sanitizedJScode - \edef\action - {/S /JavaScript /JS (\sanitizedJScode)}% - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \egroup} - -%D \macros -%D {doPDFstartexecutecommand} -%D -%D At the cost of much auxiliary placeholders, we can pretty -%D fast convert the command asked for. This is how the \PDF\ -%D code looks like. - -\def\PDFmoviecode#1#2#3% - {/Movie - /T (\ifcase#1movie \else sound \fi\ifx\argumentA\empty#2\else\argumentA\fi) - /Operation /\ifcase#3Play\or Stop\or Pause\or Resume\fi\space} - -\def\PDFexecutestartmovie {\PDFmoviecode0\currentmovie0} -\def\PDFexecutestopmovie {\PDFmoviecode0\currentmovie1} -\def\PDFexecutepausemovie {\PDFmoviecode0\currentmovie2} -\def\PDFexecuteresumemovie {\PDFmoviecode0\currentmovie3} - -\def\PDFexecutestartsound {\PDFmoviecode1\currentsound0} -\def\PDFexecutestopsound {\PDFmoviecode1\currentsound1} -\def\PDFexecutepausesound {\PDFmoviecode1\currentsound2} -\def\PDFexecuteresumesound {\PDFmoviecode1\currentsound3} - -\def\PDFformcode#1% - {\doFDFiffieldset{#1}{/Field [\doFDFgetfieldset{#1}]}} - -% bit 3 = html -% bit 6 = xml -% bit 4 = get - -\ifx\PDFsubmitfiller\undefined \let\PDFsubmitfiller\empty \fi - -\chardef\PDFformmethod=1 % 0=GET 1=POST - -\def\PDFformflag#1#2{\ifcase\PDFformmethod#1\else#2\fi} - -\def\PDFexecuteimportform {/Named /N /AcroForm:ImportFDF} -\def\PDFexecuteexportform {/Named /N /AcroForm:ExportFDF} -\def\PDFexecuteresetform {/ResetForm \PDFformcode\argumentA} -\def\PDFexecutesubmitform {/SubmitForm \PDFformcode\argumentB - /Flags \ifcase\submitoutputformat\space - \PDFformflag{12} {4} % 0=unknown - \or \PDFformflag{12} {4} % 1=HTML - \or \PDFformflag {8} {0} % 2=FDF - \or \PDFformflag{40}{32} % 3=XML - \else \PDFformflag{12} {4} % ?=unknown - \fi - /F (\argumentA)\PDFsubmitfiller} - -% urifill permits url substitution - -\def\PDFexecutehide {/Hide /T (\argumentA) /H true} -\def\PDFexecuteshow {/Hide /T (\argumentA) /H false} - -\def\PDFexecutefirst {/Named /N /FirstPage} -\def\PDFexecuteprevious {/Named /N /PrevPage} -\def\PDFexecutenext {/Named /N /NextPage} -\def\PDFexecutelast {/Named /N /LastPage} -\def\PDFexecutebackward {/Named /N /GoBack} -\def\PDFexecuteforward {/Named /N /GoForward} -\def\PDFexecuteprint {/Named /N /Print} -\def\PDFexecuteexit {/Named /N /Quit} -\def\PDFexecuteclose {/Named /N /Close} -\def\PDFexecutesave {/Named /N /Save} -\def\PDFexecutesavenamed {/Named /N /SaveAs} -\def\PDFexecuteopennamed {/Named /N /Open} -\def\PDFexecutehelp {/Named /N /HelpUserGuide} -\def\PDFexecutetoggle {/Named /N /FullScreen} -\def\PDFexecutesearch {/Named /N /Find} -\def\PDFexecutesearchagain {/Named /N /FindAgain} -\def\PDFexecutegotopage {/Named /N /GoToPage} -\def\PDFexecutequery {/Named /N /AcroSrch:Query} -\def\PDFexecutequeryagain {/Named /N /AcroSrch:NextHit} -\def\PDFexecutefitwidth {/Named /N /FitWidth} -\def\PDFexecutefitheight {/Named /N /FitHeight} - -\let\PDFobjectclass\empty -\let\PDFobjectname \empty - -\def\doPDFstartexecutecommand#1#2#3#4% - {\doifdefined{PDFexecute#3} - {\bgroup - \edef\argument{#4}% - \ifx\argument\empty - \let\argumentA\empty - \let\argumentB\empty - \else - \@EA\dogetcommalistelement\@EA1\@EA\from#4\to\argumentA - \@EA\dogetcommalistelement\@EA2\@EA\from#4\to\argumentB - \fi - \edef\action% - {/S \getvalue{PDFexecute#3}}% - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences -% \ifx\PDFobjectclass\empty -% \let\next\doPDFaction -% \else -% \edef\next{\doPDFactionobject{\PDFobjectclass}{\PDFobjectname}}% -% \globalletempty\PDFobjectclass -% \globalletempty\PDFobjectname -% \fi -% \next - \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \egroup}} - -%D \macros -%D {doPDFstartrunprogram} -%D -%D Running programs is possible, but is non that portable, and -%D therefore dangerous. - -\def\doPDFstartrunprogram#1#2#3#4% new: #3 => #3#4 - {\bgroup - %\edef\string{#3}% - %\@EA\beforesplitstring\string\at{ }\to\program - %\@EA\aftersplitstring \string\at{ }\to\parameters - %\edef\action% - % {/S /Launch /F (\program) /P (\parameters) /D (.)}% - \edef\action - {/S /Launch /F (#3) /P (#4) /D (.)}% - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi - \egroup} - -%D \macros -%D {doPDFstartgotoprofile} -%D -%D Far from perfect, but nevertheless present, is the profile -%D handler. We want to misuse article threads for reder -%D profiles. - -\def\doPDFstartgotoprofile#1#2#3% to be done: file - {\bgroup - \setPDFdestination{#3}% - \doifsomething\PDFdestination - {\edef\action - {/S /Thread /D (\PDFdestination)}% - \ifsecondaryreference - \savesecondaryPDFreference\action - \else - \getsecondaryPDFreferences - \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}% - \fi}% - \egroup} - -%D \macros -%D {doPDFsetpagetransition} -%D -%D This array holds a reasonable selection of transitions -%D (watch out: \type{replace} is not in this list). Most of -%D the transitions look awful anyway. By the way, \CONTEXT\ is -%D able to select transitions randomly. - -% some day, when 1.5 is on linux and apple, we will add: -% -% \def\pagetransitions -% {{split,in,vertical},{split,in,horizontal}, -% {split,out,vertical},{split,out,horizontal}, -% {blinds,horizontal},{blinds,vertical}, -% {box,in},{box,out}, -% {wipe,east},{wipe,west},{wipe,north},{wipe,south}, -% dissolve, -% {glitter,east},{glitter,south}, -% {fly,in,east},{fly,in,west},{fly,in,north},{fly,in,south}, -% {fly,out,east},{fly,out,west},{fly,out,north},{fly,out,south}, -% {push,east},{push,west},{push,north},{push,south}, -% {cover,east},{cover,west},{cover,north},{cover,south}, -% {uncover,east},{uncover,west},{uncover,north},{uncover,south}, -% fade} - -\def\pagetransitions - {{split,in,vertical},{split,in,horizontal}, - {split,out,vertical},{split,out,horizontal}, - {blinds,horizontal},{blinds,vertical}, - {box,in},{box,out}, - {wipe,east},{wipe,west},{wipe,north},{wipe,south}, - dissolve, - {glitter,east},{glitter,south}} - -%D Again, we use macros as placeholders for \PDF\ key||value -%D pairs. - -\def\PDFpagesplit {/S /Split } -\def\PDFpageblinds {/S /Blinds } -\def\PDFpagebox {/S /Box } -\def\PDFpagewipe {/S /Wipe } -\def\PDFpagedissolve {/S /Dissolve } -\def\PDFpageglitter {/S /Glitter } -\def\PDFpagereplace {/S /R } - -\def\PDFpagefly {/S /Fly } % 1.5 -\def\PDFpagepush {/S /Push } % 1.5 -\def\PDFpagecover {/S /Cover } % 1.5 -\def\PDFpageuncover {/S /Uncover } % 1.5 -\def\PDFpagefade {/S /Fade } % 1.5 - -\def\PDFpagehorizontal {/Dm /H } -\def\PDFpagevertical {/Dm /V } -\def\PDFpagein {/M /I } -\def\PDFpageout {/M /O } -\def\PDFpageeast {/Di 0 } -\def\PDFpagenorth {/Di 90 } -\def\PDFpagewest {/Di 180 } -\def\PDFpagesouth {/Di 270 } - -\def\dodoPDFsetpagetransition#1% - {\doifdefined{PDFpage#1} - {\edef\PDFpagetransitions{\PDFpagetransitions\getvalue{PDFpage#1}}}} - -\def\doPDFsetpagetransition#1#2% - {\let\PDFpagetransitions\empty - \processcommalist[#1]\dodoPDFsetpagetransition - \doPDFpageattribute - %{\ifnum#2>0 /Dur #2 \fi - {\ifnum0<0#2 /Dur #2 \fi - \ifx\PDFpagetransitions\empty\else/Trans <<\PDFpagetransitions>>\fi}} -% \ifx\PDFpagetransitions\empty\else/Trans <>\fi}} - -%D \macros -%D {doPDFinsertmov} -%D -%D Most of the annotations we use here are of type {\em -%D link}, but here is another one: the {\em movie} annotation. -%D The driver module must implement \type {setcurrentmovie}. - -%D Great: this will become an obsolete pdf feature; why did we have to -%D keep up with the bugs ... and by the time acrobat gets better in -%D handling it have to drop it. - -\let\currentmovie\s!unknown - -\def\doPDFinsertmov - {\bgroup - \xdef\currentmovie{\@@DriverImageLabel}% - \PointsToBigPoints\@@DriverImageWidth \width - \PointsToBigPoints\@@DriverImageHeight\height - \let\pdf@@options\empty - \let\pdf@@actions\empty - \donefalse - \expanded{\processallactionsinset[\@@DriverImageOptions]} - [\v!controls=>\donetrue, - \v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }, - \v!preview=>\edef\pdf@@options{\pdf@@options /Poster true }]% - \edef\pdf@@actions{\pdf@@actions /ShowControls \ifdone true\else false\fi}% - \doPDFannotation\@@DriverImageWidth\@@DriverImageHeight - {/Subtype /Movie - /Border [0 0 0] - /T (movie \currentmovie) - /Movie << /F (\@@DriverImageFile) /Aspect [\width\space\height] \pdf@@options >> - /A << \pdf@@actions >>}% - \egroup} - -%D \macros -%D {doPDFinsertsoundtrack} -%D -%D In \PDF\ sounds can be embedded like movies. - -\ifx\everygoto\undefined \newtoks\everygoto \fi - -\let\currentsound\s!unknown - -\def\doPDFinsertsoundtrack#1#2#3% - {\bgroup - \xdef\currentsound{#2}% - \let\pdf@@actions\empty - \@EA\processallactionsinset\@EA - [#3] - [\v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }]% - \collectdriverresource - %\flushatshipout % since it can be buried in a chained box - {\doPDFannotation{0pt}{0pt} - {/Subtype /Movie - /Border [0 0 0] - /T (sound \currentsound) - /Movie <>% - \ifx\pdf@@actions\empty\else/A << \pdf@@actions >>\fi}}% - \egroup} - -%D \macros -%D {doPDFattachfile} - -\def\doPDFfilestreamobject#1#2#3#4% - {} - -\def\doPDFfilestreamidentifier#1% - {0} - -\def\doPDFgetfilestreamreference#1#2% - {0 0 R} - -\def\doPDFattachfile#1#2#3#4#5#6#7#8% - {\bgroup % title width height color symbol file - \edefconvertedargument\PDFfile{#8}% - % beware: the symbol may (indirectly) use the file - % reference when typesetting the object number; - \presetPDFsymbolappearance{#5}{#6}{#2}{#3}{#4}% sets width/height - \startPDFsymbolappearance - \doPDFembedfile\PDFfile{#7}{#8}% - \doPDFgetembeddedfilereference\PDFfile\PDFobjectreference - \setFDFlayer\@@DriverAttachmentLayer - \doPDFannotation{\width}{\totalheight} - {/Subtype /FileAttachment - /FS \PDFobjectreference\space - /Contents (#1) - \PDFsymbol - \FDFlayer - \PDFattributes}% - \stopPDFsymbolappearance - \egroup} - -% semi-public - -\def\doPDFembedfile#1#2#3% symbolic name | filename | user name - {\edefconvertedargument\PDFfile{#1}% - \doifnotflagged{a:\PDFfile}% - {\doPDFfilestreamobject{PDFEF}{\PDFfile}{#2}{#3}% - \doglobal\setflag{a:\PDFfile}}} - -\def\doPDFgetembeddedfilereference#1#2% - {\edefconvertedargument\PDFfile{#1}% - \doPDFgetobjectreference{PDFEF}\PDFfile#2} - -\def\doPDFgetembeddedfilestreamreference#1#2% - {\edefconvertedargument\PDFfile{#1}% - \doPDFgetfilestreamreference\PDFfile#2} % == \doPDFgetobjectreference{PDFFS}\PDFfile#2 - -\definespecial \doattachfile {\doPDFattachfile} - -% requested by Jens-Uwe Morawski: permits usage of pdftosrc -% in viewers that don't support attachments: -% -% \definesymbol -% [ObjectNumber] -% % [object number {\PDFattachmentnumber[xx]}] % named -% [object number \PDFattachmentnumber] % current -% -% \useattachment[test][xx][test.tex] -% \setupattachments[symbol=ObjectNumber] -% \attachment[test] - -\def\PDFattachmentnumber - {\dosingleargument\doPDFattachmentnumber} - -\def\doPDFattachmentnumber[#1]% - {\iffirstargument - \doPDFfilestreamidentifier{#1}% - \else - \doPDFfilestreamidentifier\PDFfile - \fi} - -%D \macros -%D {...} -%D -%D Rather preliminary. We have to wait till the complete specs -%D show up. As usual, we cannot really check it (Acrobat 6.0 -%D has a bug that inhibits us to make a test file). Half a day -%D of testing made clear that trying to control the plugin fails -%D in most cases (we need plugin specs -). We also miss a feature -%D to let acrobat wait with proceeding (action processing) till -%D the media clip is ready. - -% aiff audio/aiff -% au audio/basic -% avi video/avi -% mid audio/midi -% mov video/quicktime -% mp3 audio/x-mp3 (mpeg) -% mp4 audio/mp4 -% mp4 video/mp4 -% mpeg video/mpeg -% smil application/smil -% swf application/x-shockwave-flash - -% beware, this is preliminary code, should be improved - -\def\PDFrenderingspecs#1{\executeifdefined{PDFMR:#1}\empty} - -\def\PDFexecutestartrendering {/Rendition /OP 0 \PDFrenderingspecs\argumentA} -\def\PDFexecutestoprendering {/Rendition /OP 1 \PDFrenderingspecs\argumentA} -\def\PDFexecutepauserendering {/Rendition /OP 2 \PDFrenderingspecs\argumentA} -\def\PDFexecuteresumerendering {/Rendition /OP 3 \PDFrenderingspecs\argumentA} - -% todo : sub files -% -% \doPDFembedfile{pier-39.png}{pier-39.png}{pier-39.png}% -% \doPDFgetembeddedfilestreamreference{pier-39.png}\xPDFobjectreference -% \edef\xxxx{/RF [(pier-39.png) \xPDFobjectreference]}% - -% todo: alternative renderings -% -% object_1 -> <> >> -% object_2 -> <> >> -% -% rendering -> <> - -% todo: embedded files (too buggy) -% -% \let\PDFattribute\empty -% % /D \PDFobjectreference -% % test one, no error, but ignored -% \doifinset\v!file{#4} -% {\doPDFembedfile{#3}{#3}{#3}% -% \doPDFgetembeddedfilestreamreference{#3}\PDFobjectreference -% \edef\PDFattribute{/EF \PDFobjectreference}}% -% % official, does not work either -% \doifinset\v!file{#4} -% {\doPDFembedfile{#3}{#3}{#3}% -% \doPDFgetembeddedfilereference{#3}\PDFobjectreference} -% % do we play the game as follows - -\definespecial\doinsertrendering#1#2#3#4% tag mime file options - {\ifundefined{PDFMR:#1}% - \doifinstringelse{://}{#3}\donetrue\donefalse % evt url as keyword - \doPDFdictionaryobject{PDFMF}{#1} - {/Type /Rendition - /S /MR - % does not work: /SP << /Type /MediaScreenParam /BE << /B [1 0 0] /O 0.5 >> >> - /C << /Type /MediaClip - /S /MCD - /N (#1) - /Alt [() (file not found)] % language id + message - /D << /Type /Filespec - /F (#3) - \ifdone/FS /URL\fi >> - /CT (#2) >>}% - % common code - \doifobjectreferencefoundelse{PDFMS}{#1} - {\doPDFgetobjectreference{PDFMS}{#1}\PDFobjectreferenceB} - {\doPDFgetobjectreference{PDFMU}{#1}\PDFobjectreferenceB}% - \doPDFgetobjectreference{PDFMF}{#1}\PDFobjectreferenceA - \setxvalue{PDFMR:#1}% needed /AA actions in /Screen - {/R \PDFobjectreferenceA - /AN \PDFobjectreferenceB}% - \doifobjectreferencefoundelse{PDFMS}{#1}\donothing - {\dodoinsertrenderingwindow{PDFMU}{#1}\zeropoint\zeropoint{#4}}% - \fi} - -\definespecial\doinsertrenderingobject#1#2#3#4% tag class objectname options - {\ifundefined{PDFMR:#1}% - \doPDFgetobjectreference{#2}{#3}\PDFobjectreference - \doPDFdictionaryobject{PDFMF}{#1} - {/Type /Rendition - /S /MR - /C << /Type /MediaClip - /S /MCD - /N (#1) - /D \PDFobjectreference>>}% - % common code - \doifobjectreferencefoundelse{PDFMS}{#1} - {\doPDFgetobjectreference{PDFMS}{#1}\PDFobjectreferenceB} - {\doPDFgetobjectreference{PDFMU}{#1}\PDFobjectreferenceB}% - \doPDFgetobjectreference{PDFMF}{#1}\PDFobjectreferenceA - \setxvalue{PDFMR:#1}% needed /AA actions in /Screen - {/R \PDFobjectreferenceA - /AN \PDFobjectreferenceB}% - \doifobjectreferencefoundelse{PDFMS}{#1}\donothing - {\dodoinsertrenderingwindow{PDFMU}{#1}\zeropoint\zeropoint{#4}}% - \fi} - -\definespecial\doinsertrenderingwindow - {\dodoinsertrenderingwindow{PDFMS}} - -\def\dodoinsertrenderingwindow#1#2#3#4#5% - {\vbox to #4 \bgroup - \checkPDFscreenactions{#2}{#5}% - \doPDFgetobjectpagereference{PDFMF}{#2}\PDFobjectreferenceA - \doPDFgetobjectreference {PDFMF}{#2}\PDFobjectreferenceB - \vss - \hbox to #3 \bgroup - \doPDFannotationobject{#1}{#2}{#3}{#4} - {/Subtype /Screen - /P \PDFobjectreferenceA - /A \PDFobjectreferenceB - \PDFattributes - /Border [0 0 0]}% - \hss - \egroup - \egroup} - -\global\let\PDFrenderingopenpageaction \empty -\global\let\PDFrenderingclosepageaction\empty - -\def\checkPDFscreenactions#1#2% - {\let\PDFattributes\empty - \iflocation % important since direct -) - % the action can either (already) be set by the window handler - % or (normally when no window [i.e a zero dimensions one] is present) by keyword - \doifinset\v!auto{#2} - {% brrr, here instead of in navigation module, must move and become special - % now two sided dependency - \let\checkrendering\gobbleoneargument - \ifx\PDFrenderingopenpageaction \empty - \handlereferenceactions{\v!StartRendering{#1}}\dosetuprenderingopenpageaction - \fi - \ifx\PDFrenderingclosepageaction\empty - \handlereferenceactions{\v!StopRendering {#1}}\dosetuprenderingclosepageaction - \fi - }% - \donefalse - \ifx\PDFrenderingopenpageaction \empty\!!doneafalse\else\donetrue\!!doneatrue\fi - \ifx\PDFrenderingclosepageaction\empty\!!donebfalse\else\donetrue\!!donebtrue\fi - \ifdone - \edef\PDFattributes - {/AA <<\if!!donea/PO <<\PDFrenderingopenpageaction >> \fi - \if!!doneb/PC <<\PDFrenderingclosepageaction>> \fi>>}% - \fi - \global\let\PDFrenderingopenpageaction \empty - \global\let\PDFrenderingclosepageaction\empty - \fi} - -\definespecial\dosetuprenderingopenpageaction {\global\let\PDFrenderingopenpageaction \lastPDFaction} -\definespecial\dosetuprenderingclosepageaction{\global\let\PDFrenderingclosepageaction\lastPDFaction} - -%D \macros -%D {doPDFinsertbookmark} -%D -%D Well, here is the dreadfull bookmark, rather useless because -%D only standard encoding is possible, no typography is done, -%D and a maximum of 32~characters is advized. - -\def\doPDFinsertbookmark#1#2#3#4#5% level sublevels text page open=1 - {\bgroup - % todo, unicode - \sanitizePDFdocencoding#3\to\bookmarktext % uses scratchcounter - \stripstring\bookmarktext - %\sanitizePDFstring#3\to\bookmarktext - \doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}% - \egroup} - -%D The next section of this module is dedicated to form -%D support. These macros are complicated by the fact that -%D cloning is possible. - -%D \macros -%D {FDFflag...,FDFplus...} -%D -%D The \type{/FT} key determines the type of field: text, -%D button or choice. The latter two come in several disguises, -%D which are set by flipping bits in the \type{/Ff}. Other bits -%D are used to set states. Personally I hate this bitty way of -%D doing things. The next six bit determine the field sub type: - -\def\FDFflagMultiLine {4096} % 13 -\def\FDFflagNoToggleToOff {16384} % 15 -\def\FDFflagRadio {32768} % 16 -\def\FDFflagPushButton {65536} % 17 -\def\FDFflagPopUp {131072} % 18 -\def\FDFflagEdit {262144} % 19 - -% bugged anyway, so we need to drop it: - -\def\FDFflagRadiosInUnison {33554432} % 26 - -%D A few more (pdf 1.4) flags, what the spell check one: for -%D obscure reasons for Adobe downward compatibility means -%D enabling features that harm old applications like testing. - -\def\FDFflagDoNotSpellCheck {4194304} % 23 -\def\FDFflagDoNotScroll {8388608} % 24 - -%D The next bits (watch how strange the bits are organized) -%D take care of the states: - -\def\FDFflagReadOnly {1} % 1 -\def\FDFflagRequired {2} % 2 -\def\FDFflagNoExport {4} % 3 -\def\FDFflagPassword {8192} % 14 -\def\FDFflagSort {524288} % 20 -\def\FDFflagFileSelect {1048576} % 21 - -%D There is a second, again bitset oriented, \type{/F} flag: - -\def\FDFplusInvisible {1} % 1 -\def\FDFplusHidden {2} % 2 -\def\FDFplusPrintable {4} % 3 - -%def\FDFplusNoView {32} % 6 -%def\FDFplusToggleNoView {256} % 9 - -\def\FDFplusAutoView {256} % {288} % 6+9 - -%D \macros -%D {setFDFswitches} -%D -%D The non||type bits are mapped onto user||interface -%D swithes, to be used later on: - -\def\@@FDFflag{FDFflag} -\def\@@FDFplus{FDFplus} - -\letvalue {\@@FDFflag\v!readonly}=\FDFflagReadOnly -\letvalue {\@@FDFflag\v!required}=\FDFflagRequired -\letvalue {\@@FDFflag\v!protected}=\FDFflagPassword -\letvalue {\@@FDFflag\v!sorted}=\FDFflagSort -\letvalue {\@@FDFflag\v!unavailable}=\FDFflagNoExport -\letvalue {\@@FDFflag\v!nocheck}=\FDFflagDoNotSpellCheck -\letvalue {\@@FDFflag\v!fixed}=\FDFflagDoNotScroll -\letvalue {\@@FDFflag\v!file}=\FDFflagFileSelect - -\letvalue {\@@FDFplus\v!hidden}=\FDFplusHidden -\letvalue {\@@FDFplus\v!printable}=\FDFplusPrintable - -\letvalue {\@@FDFplus\v!auto}=\FDFplusAutoView - -%D A set of switches is collected into the flags we mentioned -%D before by the next macro (we don't handle negations yet, -%D but do take care of redundancy): - -\def\FDFflag{0} -\def\FDFplus{0} - -\def\setFDFswitches[#1]% - {\bgroup - \!!counta\zerocount - \!!countb\zerocount - \def\docommand##1% - {\doifsomething{##1} - {\advance\!!counta 0\getvalue{\@@FDFflag##1}% - \setvalue{\@@FDFflag##1}{0}% - \advance\!!countb 0\getvalue{\@@FDFplus##1}% - \setvalue{\@@FDFplus##1}{0}}}% - \processcommacommand[#1]\docommand - \xdef\FDFflag{\the\!!counta}% - \xdef\FDFplus{\the\!!countb}% - \egroup} - -%D \macros -%D {setFDFvalues} -%D -%D Menu items are passed as an array of \type{(string)}'s and -%D the content of this array is build with: - -\let\FDFvalues \empty -\let\FDFfirstvalues \empty -\let\FDFsecondvalues\empty -\let\FDFkidlist \empty -\let\FDFdefaultindex\!!zerocount -\let\FDFdefaultvalue\empty - -% Why do we need to tweak this mechanism each time acrobat updates ... -% it would make sense to have version specific sections in pdf files -% since my guess is that it never will be done right since each year -% new programmers have new ideas about what is supposed to happen with -% kids. So .. best is not to trust this feature esp not for radio -% widgets. (new flags, different interpretation of AS etc etc) - -\def\setFDFvalues[#1][#2]% #1 = list (item=>value) #2 = default - {\let\FDFvalues \empty - %when radio opt works ok - %\let\FDFfirstvalues \empty - %\let\FDFsecondvalues\empty - \let\FDFkidlist \empty - %\let\FDFdefaultindex\!!zerocount - %\let\FDFdefaultvalue\empty - %\scratchcounter\zerocount - \def\dodocommand##1=>##2=>##3\end - {\addtocommalist{##1}\FDFkidlist - %\edef\FDFfirstvalues{\FDFfirstvalues(##1)}% - %\doif{##1}{#2}{\edef\FDFdefaultindex{\the\scratchcounter}}% - %\advance\scratchcounter\plusone - \doifelsenothing{##2} - {\doif{##1}{#2}{\edef\FDFdefaultvalue{##1}}% - %\edef\FDFsecondvalues{\FDFsecondvalues(##1)}% - \edef\FDFvalues{\FDFvalues [(##1)(##1)] }} - {\doif{##1}{#2}{\edef\FDFdefaultvalue{##2}}% - %\edef\FDFsecondvalues{\FDFsecondvalues(##2)}% - \edef\FDFvalues{\FDFvalues [(##2)(##1)] }}}% ! ##1 is shown - \def\docommand##1% - {\dodocommand##1=>=>\end}% - \expanded{\processcommalist[#1]}\docommand} - -%D This macro accepts comma separated \type{visual=>result} -%D pairs. - -%D \macros -%D {setFDFalignment} -%D -%D Text and line fields can be entered and showed in three -%D alternative alingments, indicated by a digit: - -\def\FDFalign{0} - -\def\setFDFalignment[#1]% - {\processaction - [#1] - [ \v!left=>\edef\FDFalign{2}, % raggedleft - \v!middle=>\edef\FDFalign{1}, % raggedcenter - \v!right=>\edef\FDFalign{0}]} % raggedright - -%D \macros -%D {setFDFattributes} -%D -%D The weak part of (at least version 2.1 \PDF) is that only -%D default fonts are handled well. Another restriction is that -%D the encoding vector must be the standard \PDF\ document one. -%D Although the \PDF\ reference explictly states that one could -%D use the normal text operators, leading is not yet handled. -%D -%D For the moment the current \CONTEXT\ font is mapped onto -%D one best suitable default font. The color attribute is -%D less problematic and is directly derived from the \CONTEXT\ -%D color. - -\def\FDFattributes{/Helv 12 Tf 0 g 14.4 TL} - -\def\FDFrm {TiRo} \def\FDFss {Helv} \def\FDFtt {Cour} -\def\FDFrmtf{TiRo} \def\FDFsstf{Helv} \def\FDFtttf{Cour} -\def\FDFrmbf{TiBo} \def\FDFssbf{HeBo} \def\FDFttbf{CoBo} -\def\FDFrmit{TiIt} \def\FDFssit{HeOb} \def\FDFttit{CoOb} -\def\FDFrmsl{TiIt} \def\FDFsssl{HeOb} \def\FDFttsl{CoOb} -\def\FDFrmbi{TiBI} \def\FDFssbi{HeBO} \def\FDFttbi{CoBO} -\def\FDFrmbs{TiBI} \def\FDFssbs{HeBO} \def\FDFttbs{CoBO} - -\let\FDFusedfonts=\FDFsstf - -\def\setFDFattributes[#1,#2,#3,#4]% style, color, backgroundcolor, framecolor - {\bgroup % nog interlinie: n TL - \setbox\scratchbox\hbox - \bgroup - \doconvertfont{#1}{}% - \PointsToBigPoints\bodyfontsize\size % x/xx, so better the actual size - \doifdefinedelse{FDF\fontstyle\fontalternative} - {\xdef\FDFattributes{\getvalue{FDF\fontstyle\fontalternative}}} - {\doifdefinedelse{FDF\fontstyle} - {\xdef\FDFattributes{\getvalue{FDF\fontstyle}}} - {\xdef\FDFattributes{\FDFrm}}}% - \doglobal\addtocommalist\FDFattributes\FDFusedfonts - \xdef\FDFattributes% move up with "x.y Ts" - {/\FDFattributes\space\size\space Tf\space\PDFcolor{#2}}% - \doifelsenothing{#3} - {\global\let\FDFsurroundings\empty} - {\xdef\FDFsurroundings{/BG \FDFcolor{#3}}}% - \doifsomething{#4} - {\xdef\FDFsurroundings{\FDFsurroundings\space /BC \FDFcolor{#4}}}% - \ifx\FDFsurroundings\empty \else - \xdef\FDFsurroundings{/MK << \FDFsurroundings\space>>}% - \fi - \egroup - \egroup} - -%D \macros -%D {setFDFactions} -%D -%D Depending on the type of the field, one can assign -%D \JAVASCRIPT\ code to a mouse event or keystroke. The next -%D preparation macro shows what events are handled. - -\let\FDFactions\empty - -%\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8]% -% {\global\let\FDFactions\empty -% \setFDFaction D#1% mousedown -% \setFDFaction U#2% mouseup -% \setFDFaction E#3% enterregion -% \setFDFaction X#4% exitregion -% \setFDFaction K#5% afterkeystroke -% \setFDFaction F#6% formatresult -% \setFDFaction V#7% validateresult -% \setFDFaction C#8% calculatewhatever -% \ifx\FDFactions\empty\else -% \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited -% \fi} -%% {\setFDFaction A#2}% mouseup % changed for version 5 - -% \def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,% -% {\global\let\FDFactions\empty -% \setFDFaction D#1% mousedown -% %\setFDFaction U#2% mouseup -% \setFDFaction E#3% enterregion -% \setFDFaction X#4% exitregion -% \setFDFaction K#5% afterkeystroke -% \setFDFaction F#6% formatresult -% \setFDFaction V#7% validateresult -% \setFDFaction C#8% calculatewhatever -% \setFDFactionsmore#2,} - -% \def\setFDFactionsmore#1,#2,#3]% -% {\setFDFaction{Fo}#2% focusin -% \setFDFaction{Bl}#3% focusout % was I (now pdf ref manual explicitly talks about lowercase l) -% \ifx\FDFactions\empty\else -% \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited -% \fi -% \setFDFaction A#1}% mouseup - -\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,% - {\global\let\FDFactions\empty - \setFDFaction D#1% mousedown - \setFDFaction U#2% mouseup - \setFDFaction E#3% enterregion - \setFDFaction X#4% exitregion - \setFDFaction K#5% afterkeystroke - \setFDFaction F#6% formatresult - \setFDFaction V#7% validateresult - \setFDFaction C#8% calculatewhatever - \setFDFactionsmore} - -\def\setFDFactionsmore#1,#2]% - {\setFDFaction{Fo}#1% focusin - \setFDFaction{Bl}#2% focusout % was I (now pdf ref manual explicitly talks about lowercase l) - \ifx\FDFactions\empty\else - \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited - \fi} - -% todo, when new var scheme is implemented -% -% \setFDFaction{PO}\@@DriverFieldPageOpen -% \setFDFaction{PC}\@@DriverFieldPageClose -% \setFDFaction{PV}\@@DriverFieldPageVisible -% \setFDFaction{PI}\@@DriverFieldPageInVisible - -%D The event handler becomes something: -%D -%D \starttyping -%D /AA << /D << /S ... >> ... /C << /S ... >> -%D /A << /S /JavaScript /JS (...) >> -%D \stoptyping - -% \def\setFDFaction#1#2% -% {\bgroup -% \global\let\sanitizedJScode\empty -% \def\setFDFaction##1% -% {\doifreferencefoundelse{##1} -% {\doifelse{\currentreferencespecial}{JS} % filter non-js -% {\presetJScode -% \currentreferenceoperation -% \currentreferencearguments -% \doPSsanitizeJScode\JScode\to\JScode -% \xdef\sanitizedJScode{\sanitizedJScode\space\JScode}} -% {\illegalreference{##1}}} -% {\unknownreference{##1}}}% -% \@EA\processcommalist\@EA[#2]\setFDFaction % one level expansion -% \ifx\sanitizedJScode\empty \else -% \xdef\FDFactions% -% {\FDFactions /#1 << /S /JavaScript /JS (\sanitizedJScode) >> }% -% \fi -% \egroup} -% -% acrobat 5 supports other that JS actions too - -\def\setFDFaction#1#2% - {\bgroup - \def\docommand{\xdef\FDFactions{\FDFactions /#1 << \lastPDFaction >> }}% - \@EA\handlereferenceactions\@EA{#2}\docommand % one level expansion - \egroup} - -%D \macros -%D {testFDFactions} -%D -%D This rather confusion prone series of script can be tested -%D with: -%D -%D \starttyping -%D \testFDFactions -%D \stoptyping -%D -%D which simply redefined the previous macro to one that prints -%D a message to the console. - -\def\testFDFactions - {\def\setFDFaction##1##2% - {\doPSsanitizeJScode console.show();console.println("executing:##1"); \to\sanitizedJScode - \edef\FDFactions{\FDFactions /##1 << /S /JavaScript /JS (\sanitizedJScode) >> }}} - -%D \macros -%D {doFDFregistercalculationset} -%D -%D There is at most one calculation order list, which defines -%D the order in which fields are calculated. - -\let\PDFcalculationset\empty - -\def\doFDFregistercalculationset#1% - {\def\PDFcalculationset{#1}} - -%D \macros -%D {registerFDFobject,everylastshipout} -%D -%D Officially one needs to embed some general datastructures -%D that tell the viewer what fields are present in the file, as -%D well as what resources they use. The next mechanism does that -%D job automatically when one registers the field. - -\def\flushFDFnames - {\ifbuildFDFdictionary - \ifx\FDFcollection\empty\else - \ifbuildFDFencodingvector - \doPDFdictionaryobject{FDF}{local:encodingvector}{\FDFencodingvector}% - \fi - \defineFDFfonts - \doPDFarrayobject{FDF}{local:fields}{\FDFcollection}% - \doPDFgetobjectreference{FDF}{local:fields}\PDFobjectreference - % The /NeedAppearances is pretty important because - % otherwise Acrobat 5 blows up on cloned radio widgets - \doPDFdictionaryobject{FDF}{local:acroform} - {/Fields \PDFobjectreference\space - /NeedAppearances true - \doFDFiffieldset\PDFcalculationset{/CO [\doFDFgetfieldset\PDFcalculationset]} - /DR << /Font << \FDFfonts >> >> - /DA (/Helv 10 Tf 0 g)}% - \doPDFgetobjectreference{FDF}{local:acroform}\PDFobjectreference - \doPDFaddtocatalog - {/AcroForm \PDFobjectreference}% - \global\let\FDFcollection\empty - \global\let\flushFDFnames\relax - \fi - \fi} - -\let\FDFcollection\empty - -\def\registerFDFobject#1% - {\ifbuildFDFdictionary - \ifx\flushFDFnames\relax - \writestatus{FDF}{second run needed for field list (#1)}% - \fi - \doPDFgetobjectreference{FDF}{#1}\PDFobjectreference - \xdef\FDFcollection{\FDFcollection\space\PDFobjectreference}% - \fi} - -\appendtoksonce \flushFDFnames \to \everylastshipout % test \everybye / was \prependtoksonce - -%D \macros -%D {defineFDFfonts, -%D ifbuildFDFdictionary, -%D ifbuildFDFencodingvector} -%D -%D Another datastruture concerns the fonts used. We only -%D define the fonts we use. - -\newif\ifbuildFDFdictionary \buildFDFdictionarytrue -\newif\ifbuildFDFencodingvector \buildFDFencodingvectortrue - -\def\defineFDFfonts - {\let\FDFfonts\empty - \processcommacommand[\FDFusedfonts]\defineFDFfont} - -\def\defineFDFfont#1% - {\ifbuildFDFencodingvector - \doPDFgetobjectreference{FDF}{local:encodingvector}\PDFobjectreference - \fi - \doPDFdictionaryobject{FDF}{local:#1} - {/Type /Font - /Subtype /Type1 - /Name /#1 - \ifbuildFDFencodingvector /Encoding \PDFobjectreference\space\fi - /BaseFont /\getvalue{FDFname#1}}% - \doPDFgetobjectreference{FDF}{local:#1}\PDFobjectreference - \edef\FDFfonts{\FDFfonts \space/#1 \PDFobjectreference}} - -%D Another list of constants: - -\def\FDFnameTiRo {Times-Roman} -\def\FDFnameTiBo {Times-Bold} -\def\FDFnameTiIt {Times-Italic} -\def\FDFnameTiBI {Times-BoldItalic} -\def\FDFnameHelv {Helvetica} -\def\FDFnameHeBo {Helvetica-Bold} -\def\FDFnameHeOb {Helvetica-Oblique} -\def\FDFnameHeBO {Helvetica-BoldOblique} -\def\FDFnameCour {Courier} -\def\FDFnameCoBo {Courier-Bold} -\def\FDFnameCoOb {Courier-Oblique} -\def\FDFnameCoBO {Courier-BoldOblique} - -%D And a big one: (should be run time loaded (spec-run or -%D so)). - -\def\FDFencodingvector - {/Type /Encoding - /Differences - [ 24 /breve /caron /circumflex /dotaccent /hungarumlaut /ogonek - /ring /tilde - 39 /quotesingle - 96 /grave - 128 /bullet /dagger /daggerdbl /ellipsis /emdash /endash /florin - /fraction /guilsinglleft /guilsinglright /minus /perthousand - /quotedblbase /quotedblleft /quotedblright /quoteleft - /quoteright /quotesinglbase /trademark /fi /fl /Lslash /OE - /Scaron /Ydieresis /Zcaron /dotlessi /lslash /oe /scaron - /zcaron - 164 /currency - 166 /brokenbar - 168 /dieresis /copyright /ordfeminine - 172 /logicalnot /.notdef /registered /macron /degree /plusminus - /twosuperior /threesuperior /acute /mu - 183 /periodcentered /cedilla /onesuperior /ordmasculine - 188 /onequarter /onehalf /threequarters 192 /Agrave /Aacute - /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave - /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex - /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde - /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex - /Udieresis /Yacute /Thorn /germandbls /agrave /aacute - /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave - /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex - /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde - /odieresis /divide /oslash /ugrave /uacute /ucircumflex - /udieresis /yacute /thorn /ydieresis ]} - -%D \macros -%D {currentFDFmode,currentFDFparent,currentFDFkids,currenrFDFroot} -%D -%D There are three more quasi global interfacing variables -%D that need to be set. - -\let\currentFDFmode =\fieldlonermode -\let\currentFDFkids =\empty -\let\currentFDFparent=\empty -\let\currentFDFroot =\empty - -%D \macros -%D {dosetfieldstatus} -%D -%D And here comes the special that deals with them. - -\definespecial\dosetfieldstatus#1#2#3#4% - {\chardef\currentFDFmode #1% - \edef\currentFDFparent {#2}% - \edef\currentFDFkids {#3}% - \edef\currentFDFroot {#4}} - -%D \macros -%D {dosetuppageview} -%D -%D Because this command will seldom be called, we can permit -%D slow action processing. We need three settings, one for -%D direct \PDF\ inclusion, the other as \PDFTEX\ keyword, an -%D a last one for form. All determine in what way the -%D screen is adapted when going to a destination. Watch the -%D space. - -\def\PDFpageviewkey{fit} -\def\PDFpageviewwrd{/Fit} -\def\PDFpageview {/View [\PDFpageviewwrd] } -\let\PDFpagexyzspec\relax % 0 0 0 hack, pdftex does handle this, for dvipdfmx we need height - -\def\dosetuppageview#1% watch the v-h swapping here - {\processaction - [#1] - [ \v!fit=>\def\PDFpageviewkey {fit}\def\PDFpageviewwrd{/Fit}, - \v!width=>\def\PDFpageviewkey {fith}\def\PDFpageviewwrd{/FitH}, - \v!height=>\def\PDFpageviewkey {fitv}\def\PDFpageviewwrd{/FitV}, - \v!minwidth=>\def\PDFpageviewkey{fitbh}\def\PDFpageviewwrd{/FitBH}, - \v!minheight=>\def\PDFpageviewkey{fitbv}\def\PDFpageviewwrd{/FitBV}, - \v!standard=>\ifx\PDFpagexyzspec\relax - % empty does not work too wel with dpx - \def\PDFpageviewkey{fit}% - \def\PDFpageviewwrd{/Fit}% - \else - \edef\PDFpageviewkey{xyz \PDFpagexyzspec}% - \edef\PDFpageviewwrd{/XYZ \PDFpagexyzspec}% - \fi, - \s!unknown=>\def\PDFpageviewkey {fit}\def\PDFpageviewwrd{/Fit}]% - \edef\PDFpageview{\ifx\PDFpageviewwrd\empty\else/View [\PDFpageviewwrd]\fi}} - -%D \macros -%D {setFDFkids} -%D -%D Clones as well as radiofields (which themselves can have -%D cloned components) need a list of kids. The next macro -%D builds one. - -\def\setFDFkids[#1][#2]% tag commalist - {\let\FDFkids\empty - \def\docommand##1% - {\doPDFgetobjectreference{FDF}{#1##1}\PDFobjectreference - \edef\FDFkids{\FDFkids\PDFobjectreference\space}}% - \@EA\processcommalist\@EA[#2]\docommand - \ifx\FDFkids\empty\else\edef\FDFkids{/Kids [\FDFkids]}\fi -% \edef\FDFkids{/Kids [\FDFkids]}% - } - -%D \macros -%D {doFDFpresetlinefield,doFDFpresettextfield, -%D doFDFpresetchoicefield,doFDFpresetpopupfield,doFDFpresetcombofield, -%D doFDFpresetpushfield,doFDFpresetcheckfield, -%D doFDFpresetfield,doFDFpresetradiorecord} -%D -%D I would say: read the \PDF\ reference manual first and see -%D what happens here next. Lucky us that they have so much in -%D common. - -\def\doFDFpresetlinefield#1#2#3#4#5#6#7#8#9% - {\bgroup - \setFDFlayer\@@DriverFieldLayer - \setFDFswitches[#7]% - \setFDFattributes[#6]% - \setFDFalignment[#8]% - \setFDFactions[#9]% - \expanded{\escapePSstring#4}\to\FDFtext - \ifcase\currentFDFmode - \doPDFannotationobject{FDF}{#1}{#2}{#3} - {/Subtype /Widget /T (#1) /FT /Tx - /MaxLen \ifcase0#5 1000 \else#5 \fi - %/DV (#4) /V (#4) % value added - /DV (\FDFtext) /V (\FDFtext) % value added - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Q \FDFalign\space - \FDFactions}% - \registerFDFobject{#1}% - \or - \setFDFkids[kids:][\currentFDFkids]% - \doPDFdictionaryobject{FDF}{#1} - {/T (#1) /FT /Tx - /MaxLen \ifcase0#5 1000 \else#5 \fi - \FDFkids\space - %/DV (#4) /V (#4) % value added - /DV (\FDFtext) /V (\FDFtext) % value added - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Q \FDFalign\space - \FDFactions}% - \registerFDFobject{#1}% - \or - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Q \FDFalign\space - \FDFactions}% - \or - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference - /F \FDFplus - \FDFactions}% - \fi - \egroup} - -\def\doFDFpresettextfield#1#2#3#4#5#6#7#8#9% - {\doFDFpresetlinefield{#1}{#2}{#3}{#4}{#5}{#6}{MultiLine,#7}{#8}{#9}} - -\def\doFDFpresetchoicefield#1#2#3#4#5#6#7#8% - {\bgroup - \setFDFlayer\@@DriverFieldLayer - \setFDFswitches[#6]% - \setFDFattributes[#5]% - \setFDFvalues[#7][#4]% - \setFDFactions[#8]% - \ifcase\currentFDFmode - \doPDFannotationobject{FDF}{#1}{#2}{#3} - {/Subtype /Widget - /T (#1) /FT /Ch - /DV (#4) /V (#4) - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Opt [\FDFvalues] - \FDFactions}% - \registerFDFobject{#1}% - \or - \setFDFkids[kids:][\currentFDFkids]% - \doPDFdictionaryobject{FDF}{#1} - {/T (#1) /FT /Ch - \FDFkids\space - /DV (#4) /V (#4) - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - /Opt [\FDFvalues] - \FDFactions}% - \registerFDFobject{#1}% - \or - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference - /Ff \FDFflag\space - /F \FDFplus\space - /DA (\FDFattributes) - \FDFlayer\space - \FDFsurroundings\space - \FDFactions}% - \or - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference - /F \FDFplus - \FDFactions}% - \fi - \egroup} - -\def\doFDFpresetpopupfield#1#2#3#4#5#6#7#8% - {\doFDFpresetchoicefield{#1}{#2}{#3}{#4}{#5}{PopUp,#6}{#7}{#8}} - -\def\doFDFpresetcombofield#1#2#3#4#5#6#7#8% - {\doFDFpresetchoicefield{#1}{#2}{#3}{#4}{#5}{PopUp,Edit,#6}{#7}{#8}} - -\newif\ifFDFvalues - -\def\doFDFpresetpushcheckfield#1#2#3#4#5#6#7#8% in acro<5 (\FDFdefault) - {\bgroup % in acro>5 /\FDFdefault - \setFDFlayer\@@DriverFieldLayer - \ifcase#8\relax\FDFvaluesfalse\else\FDFvaluestrue\fi - \setFDFswitches[#5]% - \setFDFactions[#7]% - \doifelse{#4}{1} - {\def\FDFdefault{On}} - {\def\FDFdefault{Off}}% - \ifcase\currentFDFmode - \doFDFappearance{On}{#6}{#8}% - \doPDFannotationobject{FDF}{#1}{#2}{#3} - {/Subtype /Widget /T (#1) /FT /Btn - \ifFDFvalues - /DV /\FDFdefault\space - /V /\FDFdefault\space - /AS /\FDFdefault\space - \fi - \FDFlayer - /Ff \FDFflag\space - /F \FDFplus\space - \FDFlayer\space - \FDFappearance\space -% /IF << /SW /N >> % strange, only works for stupid buttons - \FDFactions}% - \registerFDFobject{#1}% - \or % no appearance and layer ? - \setFDFkids[kids:][\currentFDFkids]% - \doPDFdictionaryobject{FDF}{#1} - {/T (#1) /FT /Btn - \FDFkids\space - \ifFDFvalues - /DV /\FDFdefault\space - /V /\FDFdefault\space - /AS /\FDFdefault\space - \fi - /Ff \FDFflag\space - /F \FDFplus\space - \FDFactions}% - \registerFDFobject{#1}% - \or - \doFDFappearance{On}{#6}{#8}% - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - \ifFDFvalues - /DV /\FDFdefault\space - /V /\FDFdefault\space - /AS /\FDFdefault\space - \fi - /Ff \FDFflag\space - /F \FDFplus\space - \FDFlayer\space - \FDFappearance\space - \FDFactions}% - \or - \doFDFappearance{On}{#6}{#8}% - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - /F \FDFplus\space - \ifFDFvalues - /DV /\FDFdefault\space - /V /\FDFdefault\space - /AS /\FDFdefault\space - \fi - \FDFlayer\space - \FDFappearance - \FDFactions}% - \fi - \egroup} - -\def\doFDFpresetpushfield#1#2#3#4#5#6#7% - {\doFDFpresetpushcheckfield{#1}{#2}{#3}{#4}{PushButton,#5}{#6}{#7}{0}} - -\def\doFDFpresetcheckfield#1#2#3#4#5#6#7% - {\doFDFpresetpushcheckfield{#1}{#2}{#3}{#4}{#5}{#6}{#7}{1}} - -\def\doFDFpresetradiofield#1#2#3#4#5#6#7#8% - {\bgroup - \setFDFlayer\@@DriverFieldLayer - \FDFvaluestrue - \setFDFswitches[#5]% - \setFDFactions[#8]% - \doifelsenothing{#4} - {\def\FDFdefault{Off}} - {\def\FDFdefault{#4}}% - \@EA\aftersplitstring\FDFdefault\at=>\to\FDFdefaultvalue - \ifx\FDFdefaultvalue\empty\else\let\FDFdefault\FDFdefaultvalue\fi - \ifcase\currentFDFmode - \doFDFappearance{#1}{#7}{1}% - \doPDFgetobjectreference{FDF}{#6}\PDFobjectreference - \doPDFannotationobject{FDF}{#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - /F \FDFplus\space - /AS /\FDFdefault\space - \FDFlayer\space - \FDFappearance\space - \FDFactions}% - \registerFDFobject{#1}% - \or - \setFDFkids[kids:][\currentFDFkids]% - \doPDFgetobjectreference{FDF}{#6}\PDFobjectreference - \doPDFdictionaryobject{FDF}{#1} - {/Parent \PDFobjectreference\space - \FDFkids\space - /F \FDFplus\space - \FDFactions}% - \registerFDFobject{#1}% - \or - %\doFDFappearance{#1}{#7}{1}% - \doFDFappearance{\currentFDFparent}{#7}{1}% - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue % nb - \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - /AS /\FDFdefault\space - /F \FDFplus\space - \FDFlayer\space - \FDFappearance\space - \FDFactions}% - \or - %\doFDFappearance{#1}{#7}{1}% - \doFDFappearance{\currentFDFparent}{#7}{1}% - \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference - %\global\objectreferencingtrue - \doPDFannotationobject{FDF}{kids:#1}{#2}{#3} - {/Subtype /Widget - /Parent \PDFobjectreference\space - /AS /\FDFdefault\space - /F \FDFplus\space - \FDFlayer\space - \FDFappearance\space - \FDFactions}% - \fi - \egroup} - -%D \macros -%D {setFDFstrings} -%D -%D This one creates a string array. - -%\def\setFDFstrings[#1]% -% {\let\FDFstrings\empty -% \def\docommand##1{\edef\FDFstrings{\FDFstrings(##1)}}% -% \processcommacommand[#1]\docommand} - -% Beware, RadiosInUnison is really needed in the pre 1.5/6 time this -% was the default but out of a sudden it's no longer the case. Also -% the NoToggleToOff interferes with kids of kids and both it will -% break older documents, i.e. so much for pdf as standard. With -% features like widgets we can probably best wait till adobe tools -% themselves support it because that's probably the moment that -% functionality gets frozen/becomes definitive. Actually, acrobat -% flattens the kids tree, so that's yet another situation. The -% interesting thing is that it worked ok in acrobat 2/3 but got bugged -% in later versions. [The rationale is in html compatibility, which -% seems to be more important than compatibility of documents, which in -% turn renders acrobat useless for forms.] Anyway, synchronization is -% broken or not depending on the combination pdfversion/acrobatversion. - -\def\doFDFpresetradiorecord#1#2#3#4#5% - {\bgroup - % < pdf 1.5 (1.5 was broken) - % \setFDFswitches[Radio,NoToggleToOff,RadiosInUnison,#3]% - % > pdf 1.5 - \setFDFswitches[Radio,RadiosInUnison,#3]% - % older, else fatal error - % \setFDFkids[#4][]% - % newer - \setFDFvalues[#4][#2]% inits kidlist - \expanded{\setFDFkids[][\FDFkidlist]}% - % - \setFDFactions[#5]% - \doPDFdictionaryobject{FDF}{#1} - {%/Subtype /Widget - /FT /Btn /T (#1) /Rect [0 0 0 0] - % used to be this - % /V (#2) - % then this - % /DV (#2) - % since this bomded in 5 - % /V (#2) - % and now finally this works - /H /N - % /opt is buggy in 5.05, only works once, sigh - %\ifx\FDFfirstvalues\FDFsecondvalues - /V /#2 - %\else - % /V /\FDFdefaultindex\space - % /Opt [\FDFsecondvalues] - %\fi - /Ff \FDFflag\space - /F \FDFplus\space - \FDFkids\space - \FDFactions}% - \egroup} - -%D At the cost of some more references, we can save bytes, -%D by sharing appearance dictionaries. This code needs more -%D documentation. Surprise: - -\def\dodoFDFappearance#1#2% - {\ifx#2\empty\else - \dogetcommacommandelement1\from#2\to\commalistelement - \ifx\commalistelement\empty\else - \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference - \edef\N{\ifFDFvalues\N /#1 \fi\PDFobjectreference\space}% - \fi - \dogetcommacommandelement2\from#2\to\commalistelement - \ifx\commalistelement\empty\else - \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference - \edef\R{\ifFDFvalues\R /#1 \fi\PDFobjectreference\space}% - \fi - \dogetcommacommandelement3\from#2\to\commalistelement - \ifx\commalistelement\empty\else - \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference - \edef\D{\ifFDFvalues\D /#1 \fi\PDFobjectreference\space}% - \def\FDFappearance{/H /P }% - \fi - \fi} - -\def\redoFDFappearance#1% - {\ifx#1\empty\else - \dogetcommacommandelement3\from#1\to\commalistelement - \ifx\commalistelement\empty\else - \def\FDFappearance{/H /P }% - \fi - \fi} - -\def\doFDFappearance#1#2#3% - {\ifcase#3\relax % push only field - \edef\yes{#2}% - \let\no\empty - \else % on / off field - \dogetcommacommandelement1\from#2,\to\yes - \dogetcommacommandelement2\from#2,\to\no - \fi - \def\FDFappearance{/H /N}% - \doifobjectfoundelse{FDF}{ap:#1:\yes:\no} - {\redoFDFappearance\yes - \redoFDFappearance\no} - {\presetobject{FDF}{ap:#1:\yes:\no}% funny hack - \let\N\empty\let\R\empty\let\D\empty - \dodoFDFappearance{#1}\yes - \dodoFDFappearance{Off}\no - \doPDFdictionaryobject{FDF}{ap:#1:\yes:\no} - {\ifx\N\empty\else/N \ifFDFvalues<<\N>>\else\N\fi\fi - \ifx\R\empty\else/R \ifFDFvalues<<\R>>\else\R\fi\fi - \ifx\D\empty\else/D \ifFDFvalues<<\D>>\else\D\fi\fi}}% - \doPDFgetobjectreference{FDF}{ap:#1:\yes:\no}\PDFobjectreference - \edef\FDFappearance{\FDFappearance /AP \PDFobjectreference}} - -%\def\doFDFdefault#1#2% -% {\dogetcommacommandelement1\from#1,\to\commalistelement -% \dogetcommacommandelement1\from\commalistelement\to\commalistelement -% \doifelse{\commalistelement}{#2} % kan ook met \ifx -% {\def\FDFdefault{On}}{\def\FDFdefault{Off}}} - -\def\doFDFdefault#1#2% - {\doifelse{#2}{1}{\def\FDFdefault{On}}{\def\FDFdefault{Off}}} - -%D Layer support: - -\def\setFDFlayer#1% todo : \ifx\PDFobjectreference\noPDFobjectreference ipv found - {\letempty\FDFlayer - \doifsomething{#1}% - {\checkproperty[#1]% == \dodocheckproperty\@@DriverFieldLayer - \doifobjectreferencefoundelse{PDLN}{#1} - {\doPDFgetobjectreference{PDLN}{#1}\!!stringa % we need to avoid a clash with other macros - \edef\FDFlayer{/OC \!!stringa}}% - \donothing}} - -%D The three appearances {\em normal}, \type{roll over} and -%D \type{push down} are passed as comma separated triplets, -%D that is, the second argument can look like: -%D -%D \starttyping -%D {yes,ok,fine},{no,rubish,awful} -%D \stoptyping - -%D \macros -%D {doFDFdefinefieldset,doFDFgetfieldset,doFDFiffieldset} -%D -%D Field sets, the ones we use in submitting and resetting -%D fields, are implemented using the next low level specials: -%D -%D \starttyping -%D \doFDFdefinefieldset{TAG}{name,name,...} -%D \doFDFgetfieldset{TAG} -%D \doFDFiffieldset{TAG}{sequence} -%D \stoptyping - -\def\doFDFdefinefieldset#1#2% tag commalist - {\let\FDFfieldset\empty - \def\docommand##1% - {\doPDFgetobjectreference{FDF}{##1}\PDFobjectreference - \edef\FDFfieldset{\FDFfieldset\PDFobjectreference\space}}% - \processcommacommand[#2]\docommand % nb: command - \setevalue{FDF:set:#1}{\FDFfieldset}} - -\def\doFDFgetfieldset#1% - {\getvalue{FDF:set:#1}} - -\def\doFDFiffieldset#1#2% - {\ifundefined{FDF:set:#1}\else#2\fi} - -%D In the goto specials we took care of secondary references. -%D Here we define the macros used. - -\def\doPDFresetgotowhereever - {\global\let\secondaryPDFreferences\empty} - -\doPDFresetgotowhereever % just to be sure - -% we can (in etex) share more by testing on this - -\def\savesecondaryPDFreference#1% - {\@EA\xdef\csname PDF-SR:\the\nofsecondaryreferences\endcsname{#1}} - -\def\savesecondaryPDFreference % #1 == \action - {\global\@EA\let\csname PDF-SR:\the\nofsecondaryreferences\endcsname} - -%\def\getsecondaryPDFreferences% -% {\ifcase\nofsecondaryreferences\else -% %\doifdefined{PDF-SR:\the\nofsecondaryreferences} -% \xdef\secondaryPDFreferences% -% {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space -% \secondaryPDFreferences >>}% -% \global\advance\nofsecondaryreferences \minusone -% \expandafter\getsecondaryPDFreferences -% \fi} - -% test should happen in core-ref - -\def\getsecondaryPDFreferences - {\ifcase\nofsecondaryreferences\else - \ifcsname PDF-SR:\the\nofsecondaryreferences\endcsname - \xdef\secondaryPDFreferences - {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space - \secondaryPDFreferences >>}% - \fi - \global\advance\nofsecondaryreferences \minusone - \expandafter\getsecondaryPDFreferences - \fi} - -%D \macros -%D {loadFDFfields, showFDFfields, -%D getFDFfield, setFDFfield} -%D -%D Once filled in, we can export or submit the field in the -%D \FDF\ file format. Such a file can be loaded by -%D -%D \starttyping -%D \loadFDFfields{fiel-ini} -%D \stoptyping -%D -%D or inspected by -%D -%D \starttyping -%D \showFDFfields{fiel-ini} -%D \stoptyping -%D -%D After both commands, one can use -%D -%D \starttyping -%D \getFDFfield{name} -%D \setFDFfield{name}{value} -%D \stoptyping -%D -%D to inspect and overrule the data. -%D -%D By default \CONTEXT\ calls the perl script \type{fdf2tex}. -%D This script reads the \type{fdf} file and produces a file -%D named \type{filename.fdt}. If one disables the call to this -%D script, by saying: -%D -%D \starttyping -%D \runFDFconverterfalse -%D \stoptyping -%D -%D or when \CONTEXT\ cannot find the \type{fdt} file, it tries -%D to interpret the \type{fdf} file directly. Both mechanisms -%D are rather crude. - -\newif\ifrunFDFconverter \runFDFconvertertrue - -%D The \PERL\ script produces a file formatted as: -%D -%D \starttyping -%D \beginFDFobject -%D \beginFDFdata -%D \beginFDFfields -%D \FDFfield[name=,value=] -%D \endFDFfields -%D \endFDFdata -%D \endFDFobject -%D \stoptyping -%D -%D One reason for using key value pairs is that we cannot be -%D sure or the order in which the name and value are given -%D (actually the reverse). - -\def\PERLloadFDFfields#1% will become obsolete soon - {\bgroup - \global\let\allFDFfields\empty - \ifrunFDFconverter - \executesystemcommand{fdf2tex #1}% - \let\beginFDFobject\relax \let\endFDFobject\relax - \let\beginFDFdata \relax \let\endFDFdata \relax - \let\beginFDFfields\relax \let\endFDFfields\relax - \def\FDFfield[##1]% - {\getparameters[FDF][##1]% - \doglobal\addtocommalist\FDFname\allFDFfields - \global\setFDFfield{\FDFname}{\FDFvalue}}% - \ReadFile{#1.fdt}% - \fi - \egroup} - -%D The next macro does the same job, but now in the \TEX\ way -%D of doing things. Easy eh? Will become obsolete! - -\bgroup - -\catcode`\/=\@@other -\global\let\normalslash=/ -\catcode`\/=\@@escape - -\gdef\TEXloadFDFfields#1% will become obsolete due to XFDF - {\bgroup - \setbox0=\hbox - {\global\let\allFDFfields\empty - \scratchcounter=0 - \escapechar=-1 - \catcode`\/=\@@escape - \catcode`\(=\@@begingroup - \catcode`\)=\@@endgroup - \catcode`\%=\@@letter - \let/A =\relax \let/AS =\relax \let/Kids=\relax \let/Fields=\relax - \let/F =\relax \let/ID =\relax \let/SetF=\relax \let/setFf =\relax - \let/Ff=\relax \let/Opt=\relax \let/ClrF=\relax \let/ClrFf =\relax - \let/AP=\relax \let/FDF=\relax \let/Root=\relax - \def/T##1{\check\Title{##1}} - \def/V{\bgroup\catcode`\/=\@@other\futurelet\next/doV} - \def/doV{\ifx\next\normalslash\@EA/doVb\else\@EA/doVa\fi} - \def/doVa##1{\egroup\check\Value{##1}} - \def/doVb##1##2 {\egroup\check\Value{##2}} % watch the space - \def\check##1##2% - {\def##1{##2} - \advance\scratchcounter\plusone\relax - \ifodd\scratchcounter \else - \defconvertedcommand\asciia\Title - \global\setFDFfield{\asciia}{\Value} - \doglobal\addtocommalist\Title\allFDFfields - \fi} - \ReadFile{#1.fdf}}% - \egroup} - -\egroup - -%D Whatever mechanism is used, the next macros can be used to -%D fetch the values. - -\def\getFDFfield #1{\getvalue {FDFfield::#1}} -\def\setFDFfield#1#2{\setevalue{FDFfield::#1}{#2}} - -%D Of course the fields are only present when the file is -%D loaded. - -\def\loadFDFfields#1% - {\PERLloadFDFfields{#1}% - \ifx\allFDFfields\empty - \TEXloadFDFfields{#1}% - \fi} - -\def\showFDFfields#1% - {\bgroup - \loadFDFfields{#1} - \def\docommand##1{\par##1 = \getFDFfield{##1}\par}% - \processcommacommand[\allFDFfields]\docommand - \egroup} - -%D \macros -%D {sanitizePDFencoding,sanitizePDFdocencoding} -%D -%D We already dealt with the encoding vector. Conversion from -%D \TEX\ \ASCII\ encoding to the other one, is accomplished by -%D the next few macros. Wach out: we don't group here. - -%D This will be reimplemented using the mapping mechanism. - -% \def\enablePDFdocencoding -% {\reducetocoding[pdfdoc]\simplifycommands} - -\def\enablePDFdocencoding - {\enablecoding[pdfdoc]% - \enablelanguagespecifics[\currentlanguage]% redundant ? - \simplifycommands} - -\long\def\sanitizePDFdocencoding#1\to#2% - {\enablePDFcrlf - \enablePDFdocencoding - %\honorunexpanded % otherwise problems with "e etc in de - \edef#2{#1}} - -\bgroup -\catcode`\^^M=\@@active -\gdef\enablePDFcrlf% - {\def\\{\string\r}% - \def\par{\\\\}% - \def\endgraf{\\\\}% - \catcode`\^^M=\@@active% - \let^^M=\\} -\egroup - -\let\sanitizePDFencoding\sanitizePDFdocencoding - -%D A bit out of place, but useful: - -\ifdefined\everysetfield \else \newtoks\everysetfield \fi - -\appendtoksonce - \enablePDFdocencoding - \enablePDFcrlf -\to \everysetfield - -%D \macros -%D {doPDFinsertcomment} -%D -%D An example its use is the next special, one that deals with -%D text annotations. - -% starting point (keep this) -% -% \long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8% -% {\bgroup % title width height color open symbol collect data -% \doifelsenothing{#1} -% {\let\PDFidentifier\empty} -% {\def\PDFidentifier{/T (#1)}}% -% \doifelsenothing{#4} -% {\let\PDFattributes\empty} -% {\def\PDFattributes{/C \FDFcolor{#4}}}% -% \doifundefinedelse{PDFsymbol#6} -% {\let\PDFsymbol\empty} -% {\def\PDFsymbol{/Name \getvalue{PDFsymbol#6} }}% -% \sanitizePDFencoding#8\to\PDFdata -% \setbox\scratchbox\vbox to #3 -% {\vfill -% \doPDFannotation{#2}{#3} -% {/Subtype /Text -% \ifcase#5 \else/Open true\fi -% /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi -% \PDFsymbol -% \PDFidentifier -% \PDFattributes}}% -% \wd\scratchbox\zeropoint -% \ht\scratchbox\zeropoint -% \dp\scratchbox\zeropoint -% \box\scratchbox -% \egroup} - -\newcounter\nofFDFcomments - -\newif\ifPDFpopupcomments \PDFpopupcommentstrue - -\def\doPDFflushcomments - {\box\PDFsymbolbox} - -\long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8% % \@@DriverCommentLayer set otherwise - {\bgroup % title width height color open symbol collect data - \presetPDFsymbolappearance{#4}{#6}{#2}{#3}\!!zeropoint% sets width/height -% \doifelsenothing{#1} -% {\let\PDFidentifier\empty} -% {\def\PDFidentifier{/T (#1)}}% - \doifelsenothing{#1} - {\let\PDFidentifier\empty} - {\sanitizePDFencoding#1\to\PDFcommenttitle - \def\PDFidentifier{/T \ifPDFunicode <\PDFcommenttitle>\else (\PDFcommenttitle)\fi}}% - \sanitizePDFencoding#8\to\PDFdata - \setFDFlayer\@@DriverCommentLayer - \startPDFsymbolappearance - \ifPDFpopupcomments - \doglobal\increment\nofFDFcomments - \doifobjectreferencefoundelse{FDF}{c:\nofFDFcomments} - {\doPDFgetobjectreference{FDF}{c:\nofFDFcomments}\PDFobjectreference - \donetrue} - \donefalse - \ifdone - \setbox\scratchbox\hbox - {\doPDFannotationobject{FDF}{c::\nofFDFcomments}{#2}{#3}% text window, size does not work - {/Subtype /Popup - /Parent \PDFobjectreference}}% - \ifcase#7\relax - \vbox to \height{\forgetall\vskip#3\box\scratchbox\vss}% - \else % incredible trial and error hack - % it's quite a mess, the annot width cannot be set, well, it can - % but the appearance and text sizes get mixed up -% \setbox\scratchbox\vbox to \height{\forgetall\vskip#3\box\scratchbox\vss}% -% \global\setbox\PDFsymbolbox\vbox -% {\hsize#2% -% \forgetall -% \vsmash{\box\PDFsymbolbox} -% \box\scratchbox}% - % this may change when acrobat gets less bugged - \setbox\scratchbox\vbox to #3{\forgetall\vss\box\scratchbox}% - \wd\scratchbox#2% - \global\setbox\PDFsymbolbox\vbox - {\startoverlay{\box\PDFsymbolbox}{\box\scratchbox}\stopoverlay}% - \fi - \fi - % generic - \doifobjectreferencefoundelse{FDF}{c::\nofFDFcomments} - {\doPDFgetobjectreference{FDF}{c::\nofFDFcomments}\PDFobjectreference - \donetrue} - \donefalse - \doPDFannotationobject{FDF}{c:\nofFDFcomments}{\width}{\height} - {/Subtype /Text - \ifcase#5 \else/Open true\fi - % pdftex (efficient) - % \ifdone /Popup \PDFobjref\pdflastannot\fi - % generic (less efficient) - \ifdone /Popup \PDFobjectreference\fi - /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi - \PDFidentifier - \FDFlayer - \PDFsymbol - \PDFattributes}% - \else - \doPDFannotation{#2}{#3} - {/Subtype /Text - \ifcase#5 \else/Open true\fi - /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi - \FDFlayer - \PDFsymbol - \PDFidentifier - \PDFattributes}% - \fi - \stopPDFsymbolappearance - \egroup} - -% symbols with a reasonable default of 18/24 pt - -\newbox\PDFsymbolbox - -\def\PDFsymbolNew {/Insert} -\def\PDFsymbolBalloon {/Comment} -\def\PDFsymbolAddition {/NewParagraph} -\def\PDFsymbolHelp {/Help} -\def\PDFsymbolParagraph {/Paragraph} -\def\PDFsymbolKey {/Key } - -\def\PDFsymbolGraph {/Graph} -\def\PDFsymbolPaperclip {/Paperclip} -\def\PDFsymbolAttachment{/Attachment} -\def\PDFsymbolTag {/Tag} - -\def\startPDFsymbolappearance - {\setbox\scratchbox\vbox to \totalheight \bgroup \vfill} - -\def\stopPDFsymbolappearance - {\egroup - \setbox\scratchbox\hbox{\lower\depth\box\scratchbox}% - \wd\scratchbox\width - \ht\scratchbox\height - \dp\scratchbox\depth - \box\scratchbox} - -\def\presetPDFsymbolappearance#1#2#3#4#5% symbol color width height depth - {\doifelsenothing{#1} - {\let\PDFattributes\empty} - {\def\PDFattributes{/C \FDFcolor{#1}}}% - \scratchdimen#3\edef\width {\the\scratchdimen}% - \scratchdimen#4\edef\height{\the\scratchdimen}% - \scratchdimen#5\edef\depth {\the\scratchdimen}% - \advance\scratchdimen\height\edef\totalheight{\the\scratchdimen}% - \doifelsenothing{#2} - {\let\PDFsymbol\empty} - {\ifundefined{PDFsymbol#2}% - \getfromcommacommand[#2][1]\let\PDFsymbolnormalsymbol\commalistelement - \getfromcommacommand[#2][2]\let\PDFsymboldownsymbol \commalistelement - \doifsymboldefinedelse\PDFsymbolnormalsymbol - {\doifsymboldefinedelse\PDFsymboldownsymbol - {\dopresetPDFsymbolappearance - \PDFsymbolnormalsymbol\PDFsymboldownsymbol} - {\dopresetPDFsymbolappearance - \PDFsymbolnormalsymbol\PDFsymbolnormalsymbol}} - {\doifsymboldefinedelse\PDFsymboldownsymbol - {\dopresetPDFsymbolappearance - \PDFsymboldownsymbol\PDFsymboldownsymbol} - {\let\PDFsymbol\empty}}% - \else - \def\PDFsymbol{/Name \getvalue{PDFsymbol#2} }% - \fi}} - -\def\dopresetPDFsymbolappearance#1#2% - {\dopresetfieldsymbol{#1}% - \dopresetfieldsymbol{#2}% - \setbox\scratchbox\hbox{\symbol[#1]}% - \edef\width {\the\wd\scratchbox}% - \edef\height{\the\ht\scratchbox}% - \edef\depth {\the\dp\scratchbox}% - \scratchdimen\height \advance\scratchdimen\depth - \edef\totalheight{\the\scratchdimen}% - \doPDFgetobjectreference{SYM}{#1}\FDFsymbolNappearance - \doPDFgetobjectreference{SYM}{#2}\FDFsymbolDappearance - \edef\PDFsymbol - {/AP <>}} - -%D Hooked into \CONTEXT, this special supports -%D -%D \starttyping -%D \startcomment -%D hello beautiful\\world -%D \stopcomment -%D -%D \startcomment[hello] -%D de \'e\'erste keer -%D the f\'irst time -%D \stopcommen -%D -%D \startcommentaar[hallo][color=green,width=4cm,height=3cm] -%D first -%D -%D second -%D \stopcommentaar -%D \stoptyping -%D -%D So, special characters, forced linebreaks using \type{\\} -%D and \type{\par} are handled in the appropriate way. - -%D \macros -%D {doPDFovalbox} -%D -%D For drawing ovals we use quite raw \PDF\ code. The next -%D implementation does not differ that much from the one -%D implemented in the \POSTSCRIPT\ driver. - -\def\doPDFovalcalc#1#2#3% - {\dimen2=#1% - \advance\dimen2 #2\relax - \PointsToBigPoints{\dimen2}#3} - -\def\doPDFovalbox#1#2#3#4#5#6#7#8% todo: \scratchdimen/\scatchbox - {\forcecolorhack - \bgroup - \dimen0=#4\divide\dimen0 \plustwo - \doPDFovalcalc{0pt}{+\dimen0}\xmin - \doPDFovalcalc{#1}{-\dimen0}\xmax - \doPDFovalcalc{#2}{-\dimen0}\ymax - \doPDFovalcalc{-#3}{+\dimen0}\ymin - \advance\dimen0 by #5% - \doPDFovalcalc{0pt}{+\dimen0}\xxmin - \doPDFovalcalc{#1}{-\dimen0}\xxmax - \doPDFovalcalc{#2}{-\dimen0}\yymax - \doPDFovalcalc{-#3}{+\dimen0}\yymin - \doPDFovalcalc{#4}{\zeropoint}\stroke - \doPDFovalcalc{#5}{\zeropoint}\radius - \edef\dostroke{#6}% - \edef\dofill{#7}% - \edef\mode{\number#8 \space}% - % no \ifcase, else \relax in pdfcode - \setbox\scratchbox\hbox - {\ifnum\dostroke\dofill>\zerocount - \ifPDFstrokecolor\else\ifnum\dostroke=\plusone - \writestatus\m!colors{pdf stroke color will fail}\wait - \fi\fi - \PDFcode - {q - \stroke\space w - \ifcase\mode - \xxmin\space \ymin \space m - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax\space \ymax \space y - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - h - \or % 1 - \xxmin\space \ymin \space m - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \ymax \space l - \xmin \space \ymax \space l - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - h - \or % 2 - \xxmin\space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \ymax \space l - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - h - \or % 3 - \xmin \space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax\space \ymax \space y - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \ymin \space l - h - \or % 4 - \xmin \space \ymin \space m - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax\space \ymax \space y - \xmin \space \ymax \space l - \xmin \space \ymin\space l - h - \or % 5 - \xmin \space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax\space \ymax \space y - \xmin \space \ymax \space l - \xmin \space \ymin \space l - h - \or % 6 - \xmin \space \ymin \space m - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \ymax \space l - \xmin \space \ymax \space l - \xmin \space \ymin \space l - h - \or - \xxmin\space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \ymax \space l - \xmin \space \ymax \space l - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - h - \or - \xmin \space \ymin \space m - \xmax \space \ymin \space l - \xmax \space \ymax \space l - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \ymin \space l - h - \or % 9 top open - \xmin \space \ymax \space m - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - \xxmax\space \ymin \space l - \xmax \space \ymin \space \xmax \space \yymin\space y - \xmax \space \ymax \space l - \or % 10 right open - \xmax \space \ymax \space m - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \yymin\space l - \xmin \space \ymin \space \xxmin\space \ymin \space y - \xmax\space \ymin \space l - \or % 11 bottom open - \xmax \space \ymin \space m - \xmax \space \yymax\space l - \xmax \space \ymax \space \xxmax \space \ymax\space y - \xxmin\space \ymax \space l - \xmin \space \ymax \space \xmin \space \yymax\space y - \xmin \space \ymin \space l - \or % 12 left open - \xmin \space \ymax \space m - \xxmax\space \ymax \space l - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmax \space \yymin\space l - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xmin \space \ymin \space l - \or % 13 - \xmin \space \ymax \space m - \xxmax\space \ymax \space l - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmax\space \ymin \space l - \or % 14 - \xmax \space \ymax \space m - \xmax \space \yymin\space l - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xmin \space \ymin \space l - \or % 15 - \xmax \space \ymin \space m - \xxmin\space \ymin \space l - \xmin \space \ymin \space \xmin \space \yymin\space y - \xmin \space \ymax \space l - \or % 16 - \xmin \space \ymin \space m - \xmin \space \yymax\space l - \xmin \space \ymax \space \xxmin\space \ymax \space y - \xmax \space \ymax \space l - \or % 17 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \or % 18 - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \or % 19 - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \or % 20 - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 21 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 22 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \or % 23 - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \or % 24 - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 25 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 26 - \xmax \space \yymin\space m - \xmax \space \ymin \space \xxmax\space \ymin \space y - \xmin \space \yymax\space m - \xmin \space \ymax \space \xxmin\space \ymax \space y - \or % 27 - \xxmax\space \ymax \space m - \xmax \space \ymax \space \xmax \space \yymax\space y - \xxmin\space \ymin \space m - \xmin \space \ymin \space \xmin \space \yymin\space y - \or % 28 - \fi - \ifnum\mode>8 - S - \else - \ifnum\dostroke=\plusone S \fi - \ifnum\dofill =\plusone f \fi - \fi - Q}% - \fi}% - \wd\scratchbox#1\ht\scratchbox#2\dp\scratchbox#3\box\scratchbox - \egroup} - -%D \macros -%D {doPDFstartgraymode,doPDFstopgraymode, -%D doPDFstartrgbcolormode,doPDFstartcmykcolormode,doPDFstartgraycolormode, -%D doPDFstopcolormode} -%D -%D In \PDF\ there are two color states, one for strokes and one -%D for fills. This means that we have to set the color in a -%D rather redundant looking way. Unfortunately this makes the -%D \PDF\ file much larger than needed. We can save few bytes -%D by not setting the stroke color. Due to zip compression we -%D only save a few percent. - -% \newif\ifPDFstrokecolor \PDFstrokecolortrue - -\def\doPDFstartgraymode#1% -% {\PDFdirectcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} - {\PDFcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} - -\def\doPDFstopgraymode -% {\PDFdirectcode{0 g\ifPDFstrokecolor\space0 G\fi}} - {\PDFcode{0 g\ifPDFstrokecolor\space0 G\fi}} - -\def\doPDFstartrgbcolormode#1#2#3% -% {\PDFdirectcode{#1 #2 #3 rg\ifPDFstrokecolor\space#1 #2 #3 RG\fi}} - {\PDFcode{#1 #2 #3 rg\ifPDFstrokecolor\space#1 #2 #3 RG\fi}} - -\def\doPDFstartcmykcolormode#1#2#3#4% -% {\PDFdirectcode{#1 #2 #3 #4 k\ifPDFstrokecolor\space#1 #2 #3 #4 K\fi}} - {\PDFcode{#1 #2 #3 #4 k\ifPDFstrokecolor\space#1 #2 #3 #4 K\fi}} - -\def\doPDFstartgraycolormode#1% -% {\PDFdirectcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} - {\PDFcode{#1 g\ifPDFstrokecolor\space#1 G\fi}} - -\def\doPDFstartspotcolormode#1#2% redefining spotcolors is not possible anyway - {\ifundefined{pdf:scs:#2}% - \bgroup - \getcommacommandsize[#2]% - \ifcase\commalistsize\or - \setxvalue{pdf:scs:#2}{#2 SCN #2 scn}% \setxvalue{pdf:scs:#2}{#2 SC #2 sc}% - \else - \let\PDFspotcolorspecs\empty - \def\dospotcolorcommand##1{\edef\PDFspotcolorspecs{\PDFspotcolorspecs##1\space}}% - \processcommacommand[#2]\dospotcolorcommand - \setxvalue{pdf:scs:#2}{\PDFspotcolorspecs SCN \PDFspotcolorspecs scn}% - \fi - \egroup - \fi -% \PDFdirectcode{/#1 cs /#1 CS \PDFgetspotcolorspec{#2}}} - \PDFcode{/#1 cs /#1 CS \PDFgetspotcolorspec{#2}}} - -\def\PDFgetspotcolorspec#1% - {\executeifdefined{pdf:scs:#1}\empty} % better no default than one with too less args - -\def\doPDFstartnonecolormode -% {\PDFdirectcode{/None CS 1 SC /None cs 1 sc}} - {\PDFcode{/None CS 1 SC /None cs 1 sc}} - -\def\doPDFstopcolormode -% {\PDFdirectcode{0 g\ifPDFstrokecolor\space0 G\fi}} - {\PDFcode{0 g\ifPDFstrokecolor\space0 G\fi}} - -%D We need to register the spot colors and their fallbacks. - -% we cannot use /DeviceN since GS <=7.21 breaks on it -% and Jaws does not handle it at all {[/DeviceN [/All|/None] -% /Device#2 \PDFobjref\pdflastobj]} so we use separation -% colors that work and print ok - -\def\doPDFregistersomespotcolor#1#2#3#4% implemented in the driver - {\writestatus\m!systems{missing spot color definition}\wait} - -\def\doPDFregisternonecolor % internal command - {\doPDFregistergrayspotcolor{None}{1}% - \globallet\doPDFregisternonecolor\relax} - -\def\doPDFregisterspotcolorname#1#2% implemented in the driver - {} - -\definespecial\doregisterspotcolorname{\doPDFregisterspotcolorname} - -\def\dodoPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b - {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{RGB}{0.0 1.0 0.0 1.0 0.0 1.0}% - {\ifcase#2\or dup #5 mul exch dup #6 mul exch #7 mul\else#5 #6 #7\fi}} - -\def\dodoPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k - {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{CMYK}{0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0}% - {\ifcase#2\or dup #5 mul exch dup #6 mul exch dup #7 mul exch #8 mul\else #5 #6 #7 #8\fi}} - -\def\dodoPDFregistergrayspotcolor#1#2#3#4#5% name noffractions names p's s - {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}% - {\ifcase#2\or #5 mul\else #5\fi}} - -% \let\doPDFregisterrgbspotcolor \dodoPDFregisterrgbspotcolor -% \let\doPDFregistercmykspotcolor\dodoPDFregistercmykspotcolor -% \let\doPDFregistergrayspotcolor\dodoPDFregistergrayspotcolor - -\def\doPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b - {\ifRGBsupported - \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}% - \else - \edef\@@cl@@r{#5}\edef\@@cl@@g{#6}\edef\@@cl@@b{#7}% - \ifCMYKsupported - \convertRGBtoCMYK\@@cl@@r\@@cl@@g\@@cl@@b - \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k - \else - \convertRGBtoGRAY\@@cl@@r\@@cl@@g\@@cl@@b - \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s - \fi - \fi} - -\def\doPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k - {\ifCMYKsupported - \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% - \else - \edef\@@cl@@c{#5}\edef\@@cl@@m{#6}\edef\@@cl@@y{#7}\edef\@@cl@@k{#8}% - \ifRGBsupported - \convertCMYKtoRGB\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k - \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}\@@cl@@r\@@cl@@g\@@cl@@b - \else - \convertCMYKtoGRAY\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k - \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s - \fi - \fi} - -\def\doPDFregistergrayspotcolor{\dodoPDFregistergrayspotcolor} - -%D New and very experimental. - -\def\doPDFregistercmykindexcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k - {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{CMYK}{0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0}% - {dup #5 mul exch dup #6 mul exch dup #7 mul exch #8 mul}} - -\def\doPDFregisterrgbindexcolor#1#2#3#4#5#6#7% name noffractions names p's r g b - {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{RGB}{0.0 1.0 0.0 1.0 0.0 1.0}% - {dup #5 mul exch dup #6 mul exch #7 mul}} - -\def\doPDFregistergrayindexcolor#1#2#3#4#5% name noffractions names p's s - {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}% - {pop}} - -\let\checkpredefinedcolor\predefineindexcolor % we need an index in order to negate bitmaps - -\def\doPDFregisterfigurecolor#1% always an index color - {\dogetobjectreference - {PDFIX} - {\internalspotcolorname{#1}} - \PDFimagecolorreference} - -%D \macros -%D {doPDFstartrotation,doPDFstoprotation} -%D -%D Rotating some text can be accomplished by setting the first -%D four elements of the transform matrix. We only support some -%D fixed angles. The \type{q}'s take care of grouping. - -% The original: -% -% \def\doPDFstartrotation#1% -% {\PDFcode{q}% -% \processaction -% [#1] -% [ 90=>\PDFcode{ 0 1 -1 0 0 0 cm}, -% 180=>\PDFcode{-1 0 0 -1 0 0 cm}, -% 270=>\PDFcode{ 0 -1 1 0 0 0 cm}, -% 360=>\PDFcode{ 1 0 0 1 0 0 cm}]} -% -% We cannot directly pass an angle, but have to calculate -% factors (rx and ry). As in the \METAPOST\ to \PDF\ -% converter module we need to compensate the deformation -% by setting (sx and sy). -% -% Optimized but bigger: -% -% \def\doPDFstartrotation#1% -% {\PDFcode{q}% -% \processaction -% [#1] -% [ 0=>\PDFcode{ 1 0 0 1 0 0 cm}, -% 90=>\PDFcode{ 0 1 -1 0 0 0 cm}, -% 180=>\PDFcode{-1 0 0 -1 0 0 cm}, -% 270=>\PDFcode{ 0 -1 1 0 0 0 cm}, -% 360=>\PDFcode{ 1 0 0 1 0 0 cm}, -% #1=>\setcalculatedcos\cos{#1}% -% \setcalculatedsin\sin{#1}% -% \PDFcode{\cos \space % cos -% \sin \space % sin -% \negated\sin\space % -sin -% \cos \space % cos -% 0 0 cm}]} -% -% Since the sine and cosine values are preset and rounded we -% can use the next alternative without running into inaccuracies. - -\def\doPDFstartrotation#1% grouped - {\setcalculatedcos\cos{#1}% - \setcalculatedsin\sin{#1}% - \forcecolorhack - \PDFcode{q \cos\space\sin\space\negated\sin\space\cos\space0 0 cm}} - -\def\doPDFstoprotation - {\PDFcode{Q}} - -%D \macros -%D {doPDFstartscaling,doPDFstopscaling} -%D -%D Scaling is rather straightforward: - -\def\@@PDFzeroscale{.0001} - -\def\doPDFstartscaling#1#2% the test is needed because acrobat is bugged! - {\forcecolorhack - \PDFcode{q \ifdim#1\points=\zeropoint\@@PDFzeroscale\else#1\fi\space 0 0 - \ifdim#2\points=\zeropoint\@@PDFzeroscale\else#2\fi\space 0 0 cm}} - -% \def\doPDFstartscaling#1#2% the test is needed because acrobat is bugged! -% {\PDFcode{q\ifdim#1\points=\zeropoint\else\ifdim#2\points=\zeropoint\else -% \space#1\space 0 0 #2\space 0 0 cm\fi\fi}} - -\def\doPDFstopscaling - {\PDFcode{Q}} - -%D \macros -%D {doPDFstartmirroring,doPDFstopmirroring} -%D -%D Mirroring is implemented in a similar way: - -\def\doPDFstartmirroring - {\PDFcode{-1 0 0 1 0 0 cm}} - -\def\doPDFstopmirroring - {\PDFcode{-1 0 0 1 0 0 cm}} - -%D \macros -%D {doPDFstartnegative,doPDFstopnegative} -%D -%D When producing output for an image setter, sometimes negative -%D output is needed. - -\def\doPDFstartnegative - {\ifx\initializePDFnegative\undefined\else - \initializePDFnegative -% \PDFdirectcode{/GSnegative gs}% - \PDFcode{/GSnegative gs}% - \fi} - -\def\doPDFstopnegative - {\ifx\initializePDFnegative\undefined\else - \initializePDFnegative -% \PDFdirectcode{/GSpositive gs}% - \PDFcode{/GSpositive gs}% - \fi} - -%D \macros -%D {doPDFstartoverprint,doPDFstopoverprint} -%D -%D Some printers like overprint more than knockout. - -\def\doPDFstartoverprint - {\ifx\initializePDFoverprint\undefined\else - \initializePDFoverprint -% \PDFdirectcode{/GSoverprint gs}% - \PDFcode{/GSoverprint gs}% - \fi} - -\def\doPDFstopoverprint - {\ifx\initializePDFoverprint\undefined\else - \initializePDFoverprint -% \PDFdirectcode{/GSknockout gs}% - \PDFcode{/GSknockout gs}% wrong - \fi} - -%D Transparency support: - -\newif\ifPDFtransparencysupported - -\def\PDFtransparancydictionary#1#2#3% type fraction extras - {<>} - -\def\dodoPDFstarttransparency#1#2% - {\presetPDFtransparency{#1}{#2}% - \PDFcode{\PDFtransparencyidentifier\space gs }} - -\def\dodoPDFstoptransparency - {\PDFcode{/Tr0 gs }} - -\def\doPDFstarttransparency - {\ifPDFtransparencysupported - \global\let\doPDFstarttransparency\dodoPDFstarttransparency - \global\let\doPDFstoptransparency \dodoPDFstoptransparency - \initializetransparency - \expandafter\doPDFstarttransparency - \else - \expandafter\gobbletwoarguments - \fi} - -% \let\doPDFstoptransparency\relax -% -% This is tricky: because a text stream is handled before -% the page body is built, we can run into stops that will -% match an outer start; however, the stop is needed in case -% of a text color: [text color text] [other color text] on a -% first page combined with color splitting will go wrong if -% we stick to the relaxing method. - -\def\doPDFstoptransparency - {\ifPDFtransparencysupported - \initializetransparency - \dodoPDFstoptransparency - \fi} - -%D These use: - -\let\PDFtransparencyresetreference \empty -\let\PDFtransparencyresetidentifier\empty - -\let\PDFtransparencyreference \empty -\let\PDFtransparencyidentifier\empty - -\let\presetPDFtransparency \gobbletwoarguments -\let\initializetransparency\relax - -%D New trickery: - -\definespecial\dostartgraphicgroup{\PDFcode{q}} -\definespecial\dostopgraphicgroup {\PDFcode{Q}} - -%D Even newer trickery: - -\definespecial\dostartviewerlayer {\doPDFstartlayer} -\definespecial\dostopviewerlayer {\doPDFstoplayer} -\definespecial\dodefineviewerlayer{\doPDFdefinelayer} - -\let\PDFtextlayers\empty -\let\PDFpagelayers\empty -\let\PDFhidelayers\empty -\let\PDFvidelayers\empty - -% \def\doPDFstartlayer#1{\PDFdirectcode{/OC /#1 BDC}} -% \def\doPDFstoplayer {\PDFdirectcode {EMC}} - -\def\doPDFstartlayer#1{\PDFcode{/OC /#1 BDC}} -\def\doPDFstoplayer {\PDFcode {EMC}} - -% resource -> prop -> mc's -> OCG|OCMD (nested) - -% ocg: - -% /Intent/Design - -% ocmd - -% /P /AllOn - -% kan zelf ocmd bevatten - -\def\doPDFdefinelayer#1#2#3#4#5% tag title visible type printable -% {\driverreferenced \doPDFdictionaryobject{PDLN}{#1} - {\doPDFdictionaryobject{PDLN}{#1} - {/Type /OCG - \ifcase#4 \or - /Intent /Design % disable layer hiding by user - \fi - \ifnum#5=\zerocount - /Usage << /Print << /PrintState /OFF >> >> % printable or not - \fi - /Name (#2)}% - \doPDFgetobjectreference{PDLN}{#1}\PDFobjectreference - \xdef\PDFtextlayers{\PDFtextlayers\space\PDFobjectreference}% - \doifelse{#3}\v!start - {\xdef\PDFvidelayers{\PDFvidelayers\space\PDFobjectreference}}% - {\xdef\PDFhidelayers{\PDFhidelayers\space\PDFobjectreference}}% - %\driverreferenced \doPDFdictionaryobject{PDLD}{#1} - \doPDFdictionaryobject{PDLD}{#1} - {/Type /OCMD - /OCGs [\PDFobjectreference]}% - \doPDFgetobjectreference{PDLD}{#1}\PDFobjectreference - \xdef\PDFpagelayers{\PDFpagelayers\space /#1 \PDFobjectreference}} - -\def\flushPDFtextlayers - {\ifx\PDFtextlayers\empty \else - \driverreferenced \doPDFarrayobject{PDF}{textlayers}{\PDFtextlayers}% - \doPDFgetobjectreference{PDF}{textlayers}\!!stringa - \ifx\PDFvidelayers\empty - \def\!!stringb{[null]}% - \else - \driverreferenced \doPDFarrayobject{PDF}{videlayers}{\PDFvidelayers}% - \doPDFgetobjectreference{PDF}{videlayers}\!!stringb - \fi - \ifx\PDFhidelayers\empty - \def\!!stringc{[null]}% - \else - \driverreferenced \doPDFarrayobject{PDF}{hidelayers}{\PDFhidelayers}% - \doPDFgetobjectreference{PDF}{hidelayers}\!!stringc - \fi - \doPDFaddtocatalog - {/OCProperties - << % display in menu - /D << /Order \!!stringa - /ON \!!stringb - /OFF \!!stringc >> - % used properties - /OCGs \!!stringa >>}% - \globallet\flushPDFtextlayers\relax - \fi} - -\def\flushPDFpagelayers - {\ifx\PDFpagelayers\empty \else - \doPDFpageresource{/Properties <<\PDFpagelayers>>}% - \fi} - -\prependtoksonce \flushPDFpagelayers \to \everyshipout -\prependtoksonce \flushPDFtextlayers \to \everylastshipout - -\def\PDFlayeractionlist{null} - -\def\PDFexecutehidelayer {/SetOCGState /State [/OFF \PDFlayeractionlist]} -\def\PDFexecutevidelayer {/SetOCGState /State [/ON \PDFlayeractionlist]} -\def\PDFexecutetogglelayer {/SetOCGState /State [/Toggle \PDFlayeractionlist]} - -\def\domakeviewerlayerlist#1% - {\bgroup - \globallet\PDFlayeractionlist\empty - \def\docommand##1% - {\doPDFgetobjectreference{PDLN}{##1}\PDFobjectreference - \xdef\PDFlayeractionlist{\PDFlayeractionlist\space\PDFobjectreference}}% - \processcommalist[#1]\docommand - \egroup} - -%D Something rather pdf dependent: - -% #1 => 1=fill 2=stroke 3=strokedfill 4=invisible -% #2 => linewidth -% #3 => spacing (beware, one needs to set the hsize as well) - -\def\doPDFstartfonteffect#1#2#3% - {\ifdim#2>\zeropoint - \PointsToBigPoints{#2}\ascii -% \PDFdirectcode{\ascii\space w}% - \PDFcode{\ascii\space w}% - \fi - \ifdim#3\points=\onepoint\else - \scratchdimen#3\points -% \PDFdirectcode{\withoutpt{\the\scratchdimen}\space Tc}% - \PDFcode{\withoutpt{\the\scratchdimen}\space Tc}% - \fi -% \PDFdirectcode{\purenumber#1 Tr}} - \PDFcode{\purenumber#1 Tr}} - -\def\doPDFstopfonteffect -% {\PDFdirectcode{1 w 0 Tc 0 Tr}} - {\PDFcode{1 w 0 Tc 0 Tr}} - -%D Handy for the \METAPOST\ to \PDF\ converter: - -\ifdefined\everyPDFximage \else \newtoks\everyPDFximage \fi -\ifdefined\everyPDFxform \else \newtoks\everyPDFxform \fi - -\appendtoksonce - \collectPDFresources - \global\let\currentPDFresources\collectedPDFresources -\to \everyPDFxform - -\let\collectedPDFresources\empty - -\def\collectPDFresources % suboptimal - {\doifobjectreferencefoundelse{FDF}{docushades} % redundant, we have an reserved object now - {\doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference - \xdef\collectedPDFresources{\collectedPDFresources/Shading \PDFobjectreference}}\donothing - \doifobjectreferencefoundelse{FDF}{docuextgstates} - {\doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference - \xdef\collectedPDFresources{\collectedPDFresources/ExtGState \PDFobjectreference}}\donothing - \doifobjectreferencefoundelse{FDF}{colorspaces} - {\doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference - \xdef\collectedPDFresources{\collectedPDFresources/ColorSpace \PDFobjectreference}}\donothing - \global\let\collectPDFresources\relax} - -%D And that was about all. - -\stopspecials - -\ifx\fullytransparentcolor\undefined \else - - \def\fullytransparentcolor - {\doPDFregisternonecolor - \doPDFstartnonecolormode} - - \let\doPDFstarttransparency\gobbletwoarguments - \let\doPDFstoptransparency\relax - -\fi - -%D Temporary hack: - -\def\TransparencyHack % png: /CS /DeviceRGB /I true - {\appendtoks - \doPDFpageattribute{/Group << /S /Transparency /I true /K true>>}% - \to \everyPDFxform - \appendtoks - \doPDFpageattribute{/Group << /S /Transparency /I true /K true>>}% - \to \everyshipout} - -%D We still need to implement a few helpers: - -\chardef\safePDFcode=`- - -\def\setPDFdestination#1% - {\bgroup - \retainlccodes - \lccode`\/\safePDFcode \lccode`\#\safePDFcode - \lccode`\<\safePDFcode \lccode`\>\safePDFcode - \lccode`\[\safePDFcode \lccode`\]\safePDFcode - \lccode`\(\safePDFcode \lccode`\)\safePDFcode - \ifovercomePDFspace - \lccode`\ \safePDFcode - \fi - \ifovercomePDFbugs - \xdef\PDFdestination{'#1'}% - \else - \xdef\PDFdestination{#1}% - \fi - % nicer \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}% - \lowercase\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}% - \egroup} - -%D This is much faster since we don't have to set the full -%D range of lc-codes; about 5 sec on a 1000mhz PIII for -%D 20K named destinations "x(x) x"). Of course when you use -%D page destinations, the saving is nil. - -% \doifnotmode{atpragma}{\let\next\setPDFdestination} % experimental -% -% \catcode`\/=\@@active \catcode`\#=\@@active -% \catcode`\<=\@@active \catcode`\>=\@@active -% \catcode`\[=\@@active \catcode`\]=\@@active -% \catcode`\(=\@@active \catcode`\)=\@@active -% -% \gdef\PDFrepchar{-} -% -% \gdef\setPDFdcharacters -% {\catcode`\/=\@@active \let/\PDFrepchar -% \catcode`\#=\@@active \let#\PDFrepchar -% \catcode`\<=\@@active \let<\PDFrepchar -% \catcode`\>=\@@active \let>\PDFrepchar -% \catcode`\[=\@@active \let[\PDFrepchar -% \catcode`\]=\@@active \let]\PDFrepchar -% \catcode`\(=\@@active \let(\PDFrepchar -% \catcode`\)=\@@active \let)\PDFrepchar} -% -% \egroup -% -% \def\setPDFdestination#1% expansion is needed, otherwise embedded -% {\bgroup % macros will not expand under the new -% \setPDFdcharacters % catcode regime -% \ifovercomePDFspace -% \catcode32=\@@ignore -% \fi -% \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}% -% \scantokens\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}% -% \egroup} -% -% \doifnotmode{atpragma}{\let\setPDFdestination\next} % experimental - -%D This is a slow one, that uses \type{\lccode}'s to -%D change the glyph as well as converts sensisitve ones into a -%D \PDF\ command sequence, so \type{(} becomes \type{\(}. In -%D fact we translate the string to lowercase inactive and non -%D special characters, limit their number and finaly convert -%D some of the characters to save ones. - -\chardef\maxPDFstringsize=60 - -\def\sanitizePDFstring#1\to#2% bugged - {\bgroup - \retainlccodes - \lccode`( \zerocount \lccode`) \zerocount - \lccode`< \zerocount \lccode`> \zerocount - \lccode`[ \zerocount \lccode`] \zerocount - \lccode`\\\zerocount \lccode`/ \zerocount - \lowercase{\defconvertedargument\ascii{#1}}% - % by integrating the split in the loop below - % \splitofftokens\maxPDFstringsize\from\ascii\to\ascii - % we diminish the processing time considerably - \scratchcounter\maxPDFstringsize - \def\docommand##1% - {\ifcase\scratchcounter\else - \advance\scratchcounter \minusone - \ifcase\lccode`##1\relax - \xdef#2{#2\expandafter\string\csname##1\endcsname}% - \else - \xdef#2{#2##1}% - \fi - \fi}% - %\global\let#2=\empty - % or to permit #2 to be \ascii too: - \global\@EA\let\@EA#2\@EA\empty - \@EA\handletokens\ascii\with\docommand - \egroup} - -% \doifnotmode{atpragma}{\let\next\sanitizePDFstring} % experimental -% -% \bgroup -% -% \catcode`\.=\@@escape -% -% .catcode`./=.@@active -% .catcode`.<=.@@active .catcode`.>=.@@active -% .catcode`.[=.@@active .catcode`.]=.@@active -% .catcode`.(=.@@active .catcode`.)=.@@active -% -% .gdef.setPDFscharacters% -% {.catcode`.\=.@@other -% .catcode`./=.@@active .def/{.noexpand./}% -% .catcode`.<=.@@active .def<{.noexpand.<}% -% .catcode`.>=.@@active .def>{.noexpand.>}% -% .catcode`.[=.@@active .def[{.noexpand.[}% -% .catcode`.]=.@@active .def]{.noexpand.]}% -% .catcode`.(=.@@active .def({.noexpand.(}% -% .catcode`.)=.@@active .def){.noexpand.)}} -% -% .gdef.sanitizePDFstring#1.to#2% -% {.bgroup -% .setPDFscharacters -% .catcode`=.@@escape -% .edef.next{.strippedcsname#2}% -% .scantokens{setxvalue{next}{#1}}% -% .egroup} -% -% .egroup -% -% \doifnotmode{atpragma}{\let\sanitizePDFstring\next} % experimental -% -% There is an unicode variant in spec-tst! - -\protect \endinput diff --git a/tex/context/base/spec-ini.mkii b/tex/context/base/spec-ini.mkii new file mode 100644 index 000000000..0229a0e3d --- /dev/null +++ b/tex/context/base/spec-ini.mkii @@ -0,0 +1,559 @@ +%D \module +%D [ file=spec-ini, +%D version=1996.01.25, +%D title=\CONTEXT\ Special Macros, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 one more plain so that i can use it in plain jobs +% todo: no args, named vars instead +% maybe also drop multiple drivers and make simplify the default, then simplier defs + +\newif\ifsimplifyspecials \simplifyspecialstrue % see later + +%D We will forbid loading specials after the first page is +%D shipped out. + +\ifx\realpageno\undefined + \countdef\realpageno=0 \realpageno=1 +\fi + +%D Specials are \TEX's channel to the outside world. They make +%D \TEX\ even more platform independant and permit easy +%D adaption to new developments. One major drawback of specials +%D is that they have to be supported by printer drivers. We've +%D tried to overcome this problem by implementing specials as +%D a sort of drivers themselves. + +\writestatus{loading}{ConTeXt Special Macros / Initialization} + +\unprotect + +%D \TEX\ produces files in the \DVI\ format. This format is +%D well defined and stable. In this format one||byte commands +%D are used which can optionally be followed by length +%D specifiers and arguments. The \DVI||format incorporates a +%D channel to the outside world. This channel is activated by +%D the \TEX\ primitive \type {\special}. The sequence +%D +%D \starttyping +%D \special{Hello here I am.} +%D \stoptyping +%D +%D results in \DVI||codes: +%D +%D \starttyping +%D xxx1 16 Hello here I am. +%D \stoptyping +%D +%D The \type {xxx1} is represented in byte code 239 and the +%D number of following bytes in a~1, 2, 3 or~4 byte number. So +%D here we get $1+1+16$ bytes of code. +%D +%D Translating these codes is upto the \DVI\ driver. It's +%D common use to ignore specials that cannot be interpreted, so +%D the example string should have no consequences for the +%D output. + +%D \macros +%D {jobsuffix} +%D +%D By default, \TEX\ produces \DVI\ files which can be +%D converted to other filetypes. Sometimes it is handy to +%D know what the target file will be. In other driver +%D modules we wil set \type {\jobsuffix} to \type {pdf}. + +\def\jobsuffix{dvi} + +\def\setjobsuffix#1% + {\resetsystemmode\jobsuffix + \edef\jobsuffix{#1}% + \setsystemmode\jobsuffix} + +%D \macros +%D {everyresetspecials} +%D +%D Now what will this one do? We'll see in a few lines. + +\newtoks \everyresetspecials + +\appendtoksonce + \ifx\setjobsuffix\undefined\else\setjobsuffix{dvi}\fi +\to \everyresetspecials + +%D A rather fundamental difference between special and direct +%D settings is that the latter don't interfere with typesetting +%D but must be set before the first shipout, while the specials +%D must be packaged in the shipped out box in such a way that +%D they don't interfere. + +\newif\ifspecialbasedsettings \specialbasedsettingstrue + +\appendtoksonce + \specialbasedsettingstrue +\to \everyresetspecials + +%D Because there is no standardization in the use of specials, +%D more than one driver or program can be supported. The +%D specials are grouped in libraries. Some of these are +%D general, such as the \type{postscript} library, some are +%D tuned to a special kind of program, like the \type{pdf} +%D ones, and some support a specific driver, as we can see in +%D the \type{yandy} library. A library is build with the +%D commands: +%D +%D \starttyping +%D \startspecials[name][inheritance] +%D +%D \definespecial\none{...} +%D \definespecial\onlyone#1{...} +%D \definespecial\alot#1#2#3#4{...} +%D +%D \stopspecials +%D \stoptyping +%D +%D Because drivers can have overlap in low level macros, a +%D mechanism of inheritance is implemented. The libraries +%D defined as second argument are loaded first. +%D +%D Every special has to be predefined first. We do this with +%D the command: +%D +%D \starttyping +%D \installspecial [\none] [and] [0] +%D \installspecial [\onlyone] [and] [1] +%D \installspecial [\alot] [or] [4] +%D \stoptyping +%D +%D This means as much as: there is a special names +%D \type{\none} which has no arguments and has more than one +%D appearance. The special \type{\alot} on the other hand has +%D four arguments and is only defined once. Every instance in +%D the libraries of a special of category \type{and} is +%D executed when called upon, but only one special of +%D category \type{or} can be active. Most of the +%D \type{postscript}||specials are of category \type{or}, +%D because they tend to interfere with driver specific ones. +%D The interactive specials of \type{dviwindo} and \type{pdf} +%D are an example of specials that can be called both. +%D +%D A library is defined in a file with the name +%D \type{spec-...}. We load a library with the command: +%D +%D \starttyping +%D \usespecials [list] +%D \stoptyping +%D +%D where the list can contain one or more file tags, the +%D \type{...} in the filename. The keyword \type{reset} +%D resets all loaded specials. This is equivalent to +%D \type{\resetspecials}. + +%D Although a mechanism of nesting can be implemented, we +%D prefer to use a inheritance mechanism as mentioned. Calls +%D upon \type{\usespecials} within a \type{\startspecials} +%D would lead to confusion and errors. + +\newif\ifinheritspecials + +%D We define some local constants and variables. They look a +%D bit horrible but we don't want conflicts. + +\def\@@specfil@@{@@spcfil@@} +\def\@@speclst@@{@@spclst@@} +\def\@@speccat@@{@@spccat@@} +\def\@@specarg@@{@@spcarg@@} +\def\@@specexc@@{@@spcexc@@} + +% not faster +% +% \def\@@specfil@@{@sp@f@} +% \def\@@speclst@@{@sp@l@} +% \def\@@speccat@@{@sp@c@} +% \def\@@specarg@@{@sp@a@} +% \def\@@specexc@@{@sp@e@} + +\let\currentspecial \empty +\let\currentspecialfile\empty + +%D \macros +%D {startspecials} +%D +%D Every library has a unique name, which is given as the first +%D argument to \type{\startspecials}. When another library is +%D defined with the same name, previous specials can be +%D overruled. The name may differ from the file||tag. +%D +%D The optional second argument can consist of a list of +%D libraries that are to be loaded first. + +\def\dostartspecials[#1][#2]% + {\doifsomething{#2} + {\processcommalist[#2]\dousespecials}% + \doifelsenothing{#1} + {\let\currentspecial\s!unknown} + {\def\currentspecial{#1}}% + \unprotect} + +\def\startspecials + {\localpushmacro\currentspecial + \dodoubleempty\dostartspecials} + +\def\stopspecials + {\localpopmacro\currentspecial + \protect} + +%D \macros +%D {installspecial, +%D resetspecials} +%D +%D We have to install specials before we can define and use +%D them. The command itself is defined as a call to another +%D command that executes one or more user||defined specials, +%D depending of it's category: \type{or} versus \type{and}. +%D +%D The command \type{\installspecial} takes three +%D (non||optional) arguments: the name of the command, the +%D category it belongs to and the number of arguments it +%D takes. +%D +%D With \type{\resetspecials} we can unload the predefined +%D specials. Special reset actions |<|look in \type{spec-mis} +%D for an example|>| can be assigned to the token register +%D \type{\everyresetspecials}. + +\let\@@allspecials=\empty + +\def\doinstallspecial[#1][#2][#3]% + {\letvalue{\@@speclst@@\string#1}\empty + \setvalue{\@@speccat@@\string#1}{#2}% + \setvalue{\@@specarg@@\string#1}{#3}% + \addtocommalist{\string#1}\@@allspecials + \def#1{\executespecial#1}} + +\def\installspecial + {\dotripleargument\doinstallspecial} + +\def\resetspecials + {\the\everyresetspecials + \def\docommand##1% + {\letvalue{\@@speclst@@##1}\empty}% + \processcommacommand[\@@allspecials]\docommand} + +%D \macros +%D {definespecial} +%D +%D The command \type{\definespecial} take the place of +%D \type{\def} in the definition of a special. Just to be +%D sure, we first check if the command is permitted, i.e. +%D installed. If not, we give a warning and gobble the +%D illegal command in an quite elegant way. +%D +%D If the command can be combined (\type{and}) with others, +%D we append it to a list, otherwise (\type{or}) it becomes +%D the only item in the list. + +\def\definespecial#1% + {\ifx#1\undefined + \showmessage\m!specials4{\string#1}% + \def\next + {\def\@@illegalspecial@@}% + \else + \def\next + {\doifelsevalue{\@@speccat@@\string#1}{or} + {\edef\@@newspeclst@@{\currentspecial}} + {\edef\@@newspeclst@@{\getvalue{\@@speclst@@\string#1}}% + \addtocommalist\currentspecial\@@newspeclst@@}% + \setevalue{\@@speclst@@\string#1}{\@@newspeclst@@}% + \setvalue{\currentspecial\string#1}}% + \fi + \next} + +%D \macros +%D {usespecials} +%D +%D We use \type{\usespecials} to load a specific library. +%D This command is only permitted outside the definition part. + +\def\dousespecials#1% + {\doifelse{#1}\v!reset + {\resetspecials} + {\doifdefinedelse{\@@specfil@@#1} + {\edef\currentspecialfile{\getvalue{\@@specfil@@#1}}} + {\edef\currentspecialfile{#1}}% + \makeshortfilename[\truefilename{\f!specialprefix\currentspecialfile}]% + \startreadingfile + \readsysfile{\shortfilename.mkii}{\showmessage\m!specials5\currentspecialfile}\donothing + \stopreadingfile}} + +\def\usespecials[#1]% + {\ifnum\realpageno<2 + \doifelsenothing\currentspecial + {\processcommalist[#1]\dousespecials} + {\showmessage\m!specials6\empty}% + \fi} + +%D \macros +%D {executespecials} +%D +%D The command \type{\executespecials} is used to execute the +%D defined specials. Once a special is installed, the special +%D itself calls for this command, so it's not needed outside +%D this module. One can use it if wanted. +%D +%D A former implementation grouped the execution. Recent +%D additions however |<|like the specials that implement object +%D handling|>| asked for non||grouped execution. + +%D \starttyping +%D \def\executespecials#1#2% +%D {\def\doonespecial##1% +%D {\getvalue{##1\string#1}#2\relax}% +%D \processcommacommand +%D [\getvalue{\@@speclst@@\string#1}]\doonespecial} +%D +%D \def\executespecial#1% +%D {\expandafter\ifcase\getvalue{\@@specarg@@\string#1}\relax +%D \def\next% +%D {\executespecials#1{}}% +%D \or +%D \def\next##1% +%D {\executespecials#1{{##1}}}% +%D \or +%D \def\next##1##2% +%D {\executespecials#1{{##1}{##2}}}% +%D \or +%D \def\next##1##2##3% +%D {\executespecials#1{{##1}{##2}{##3}}}% +%D \or +%D \def\next##1##2##3##4% +%D {\executespecials#1{{##1}{##2}{##3}{##4}}}% +%D \or +%D \def\next##1##2##3##4##5% +%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}}}% +%D \or +%D \def\next##1##2##3##4##5##6% +%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}}}% +%D \or +%D \def\next##1##2##3##4##5##6##7% +%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}{##7}}}% +%D \or +%D \def\next##1##2##3##4##5##6##7##8% +%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}}}% +%D \or +%D \def\next##1##2##3##4##5##6##7##8##9% +%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}{##9}}}% +%D \else +%D \def\next% +%D {\message{illegal special: \string#1}}% +%D \fi +%D \next} +%D \stoptyping +%D +%D Because specials happen quite often, we will use a bit more +%D brute force. Keep in mind that we have to collect the +%D arguments because we want to support more drivers at once. +%D +%D I tested this on the next test. Where the previous alternative +%D took about 32 seconds, the new alternative takes 25 seconds. +%D +%D \starttyping +%D \testfeature{10000}{\setbox0=\hbox{test \color[red]{oeps} test}} +%D \stoptyping + +\def\@@exsp{exsp} + +\setvalue{\@@exsp0}{{}} +\setvalue{\@@exsp1}#1{{{#1}}} +\setvalue{\@@exsp2}#1#2{{{#1}{#2}}} +\setvalue{\@@exsp3}#1#2#3{{{#1}{#2}{#3}}} +\setvalue{\@@exsp4}#1#2#3#4{{{#1}{#2}{#3}{#4}}} +\setvalue{\@@exsp5}#1#2#3#4#5{{{#1}{#2}{#3}{#4}{#5}}} +\setvalue{\@@exsp6}#1#2#3#4#5#6{{{#1}{#2}{#3}{#4}{#5}{#6}}} +\setvalue{\@@exsp7}#1#2#3#4#5#6#7{{{#1}{#2}{#3}{#4}{#5}{#6}{#7}}} +\setvalue{\@@exsp8}#1#2#3#4#5#6#7#8{{{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}} +\setvalue{\@@exsp9}#1#2#3#4#5#6#7#8#9{{{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}} + +%D \starttyping +%D \def\executespecials#1% +%D {\def\doonespecial##1% +%D {\csname##1\xspecialcommand\endcsname#1\relax}% +%D \@EA\rawprocesscommalist\@EA +%D [\csname\@@speclst@@\xspecialcommand\endcsname]\doonespecial} +%D +%D \def\executespecial#1% +%D {\def\xspecialcommand{\string#1}% +%D \@EA\@EA\@EA\executespecials\csname\@@exsp\csname\@@specarg@@\xspecialcommand\endcsname\endcsname} +%D \stoptyping + +%D Some more speed can be gained by using a dedicated string +%D processing routine. Now we can bring down the execution +%D time to 21 seconds, one third less than the original run time. + +\def\executespecials#1% + {\@EA\let\@EA\speciallist\csname\@@speclst@@\xspecialcommand\endcsname + \ifx\speciallist\empty\else + \def\doonespecial##1% + {\csname##1\xspecialcommand\endcsname#1\relax}% + \@EA\dodoonespecial\speciallist,\end,% + \fi} + +\def\executespecial#1% + {\def\xspecialcommand{\string#1}% + \@EA\@EA\@EA\executespecials\csname\@@exsp\csname\@@specarg@@\xspecialcommand\endcsname\endcsname} + +\def\dodoonespecial#1,% + {\ifx\end#1\else + \doonespecial{#1}\expandafter\dodoonespecial + \fi} + +%D This kind of saving only shows up when making interative +%D documents with lots of color switches. In such documents +%D tens of thousands of special calls are rather normal. +%D On a 650 Mhz Pentium, the previous test takes 15 seconds +%D less (on about 65 seconds). When processing 2000 page +%D interactive documents this saving can be neglected. + +%D In the previous macros, the \type{{{...}}} are needed +%D because we pass all those arguments to the specials support +%D macro. + +\let\openspecialfile \relax +\let\closespecialfile \relax + +%D \macros +%D {doifspecialavailableelse} +%D +%D For testing purposes (this was first needed when object +%D support was implemented) we have: +%D +%D \starttyping +%D \doifspecialavailableelse\specialcommand{true}{false} +%D \stoptyping +%D +%D e.g: +%D +%D \starttyping +%D \doifspecialavailableelse\doinsertobject{...}{...} +%D \stoptyping + +\def\doifspecialavailableelse#1#2#3% + {\doifelsevaluenothing{\@@speclst@@\string#1}{#3}{#2}} + +%D So far for the macros that deal with installing specials. +%D In the file \type {spec-def} you will find the predefined +%D specials. + +%D Now that we have seen the flexible way (permitting +%D special chains) we will implement a faster and flat +%D alternative. But only if flag si set. + +\ifsimplifyspecials + + \def\doinstallspecial[#1][#2][#3]% + {\appendtoks\forgetspecial#1{#3}\to\everyresetspecials + \@EA\chardef\csname\@@speclst@@\string#1\endcsname\zerocount + \forgetspecial#1{#3}} + + \def\forgetspecial#1#2% + {\ifcase#2\relax + \let#1\relax \or + \let#1\gobbleoneargument \or + \let#1\gobbletwoarguments \or + \let#1\gobblethreearguments \or + \let#1\gobblefourarguments \or + \let#1\gobblefivearguments \or + \let#1\gobblesixarguments \or + \let#1\gobblesevenarguments \or + \let#1\gobbleeightarguments \or + \let#1\gobbleninearguments \or + \let#1\gobbletenarguments \fi} + + \def\resetspecials + {\the\everyresetspecials} + + \def\definespecial#1% + {\@EA\chardef\csname\@@speclst@@\string#1\endcsname=1 + \def#1} + + \def\doifspecialavailableelse#1% + {\ifcase\csname\@@speclst@@\string#1\endcsname + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + +\fi + +%D For quite some time the \CONTEXT\ way of specifying the +%D output format has been: +%D +%D \starttyping +%D \usespecials[ps,yy,win,pdf] +%D \stoptyping +%D +%D Because at \PRAGMA\ we use \DVIPSONE, this was a suitable +%D setting, but with \CONTEXT\ going public, the next sequence +%D is more suitable for \DVIPS\ users: +%D +%D \starttyping +%D \usespecials[reset,ps,tr,pdf] +%D \stoptyping +%D +%D On the other hand, for \PDFTEX\ we needed: +%D +%D \starttyping +%D \usespecials[tpd] +%D \stoptyping +%D +%D To simplify things, I decided to provide a higher level +%D command. +%D +%D \starttyping +%D \defineoutput[name][specials] +%D \setupoutput[name,...] +%D \stoptyping +%D +%D In a \type {spec-def} you can find some examples. + +\def\defineoutput + {\dodoubleargument\dodefineoutput} + +\def\dodefineoutput[#1][#2]% + {\setvalue{\??ui#1}{#2}} + +\def\dosetupoutput#1% + {\doifdefinedelse{\??ui#1} + {\processcommacommand[\getvalue{\??ui#1}]\dousespecials} + {\doifdefinedelse{\@@specfil@@#1} + {\dousespecials{#1}} + {\showmessage\m!specials7{#1}}}} + +% Beware, from now on changing the (default) driver files demands +% remaking the format (no big deal, since only i adapt the driver +% and need delayed loading). + +\let\currentoutput\empty + +\def\setupoutput[#1]% + {\doifnot{#1}{\currentoutput} + {\ifnum\realpageno<\plustwo % new + \resetspecials\processcommacommand[#1]\dosetupoutput + \edef\currentoutput{#1}% + \fi}} + +\def\preloadspecials % it's nicer to report this + {\doifsomething\currentoutput + {\showmessage\m!specials1\currentoutput}} + +\appendtoks + \savecurrentvalue\usedoutputdriver\currentoutput +\to \everyfirstshipout + +\protect \endinput diff --git a/tex/context/base/spec-ini.tex b/tex/context/base/spec-ini.tex deleted file mode 100644 index 4f3d884be..000000000 --- a/tex/context/base/spec-ini.tex +++ /dev/null @@ -1,591 +0,0 @@ -%D \module -%D [ file=spec-ini, -%D version=1996.01.25, -%D title=\CONTEXT\ Special Macros, -%D subtitle=Initialization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 one more plain so that i can use it in plain jobs -% todo: no args, named vars instead -% maybe also drop multiple drivers and make simplify the default, then simplier defs - -\newif\ifsimplifyspecials \simplifyspecialstrue % see later - -%D We will forbid loading specials after the first page is -%D shipped out. - -\ifx\realpageno\undefined - \countdef\realpageno=0 \realpageno=1 -\fi - -%D Specials are \TEX's channel to the outside world. They make -%D \TEX\ even more platform independant and permit easy -%D adaption to new developments. One major drawback of specials -%D is that they have to be supported by printer drivers. We've -%D tried to overcome this problem by implementing specials as -%D a sort of drivers themselves. - -\writestatus{loading}{ConTeXt Special Macros / Initialization} - -\unprotect - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -% messages moved - -%D \TEX\ produces files in the \DVI\ format. This format is -%D well defined and stable. In this format one||byte commands -%D are used which can optionally be followed by length -%D specifiers and arguments. The \DVI||format incorporates a -%D channel to the outside world. This channel is activated by -%D the \TEX\ primitive \type {\special}. The sequence -%D -%D \starttyping -%D \special{Hello here I am.} -%D \stoptyping -%D -%D results in \DVI||codes: -%D -%D \starttyping -%D xxx1 16 Hello here I am. -%D \stoptyping -%D -%D The \type {xxx1} is represented in byte code 239 and the -%D number of following bytes in a~1, 2, 3 or~4 byte number. So -%D here we get $1+1+16$ bytes of code. -%D -%D Translating these codes is upto the \DVI\ driver. It's -%D common use to ignore specials that cannot be interpreted, so -%D the example string should have no consequences for the -%D output. - -%D \macros -%D {jobsuffix} -%D -%D By default, \TEX\ produces \DVI\ files which can be -%D converted to other filetypes. Sometimes it is handy to -%D know what the target file will be. In other driver -%D modules we wil set \type {\jobsuffix} to \type {pdf}. - -\def\jobsuffix{dvi} - -\def\setjobsuffix#1% - {\resetsystemmode\jobsuffix - \edef\jobsuffix{#1}% - \setsystemmode\jobsuffix} - -%D \macros -%D {everyresetspecials} -%D -%D Now what will this one do? We'll see in a few lines. - -\newtoks \everyresetspecials - -\appendtoksonce - \ifx\setjobsuffix\undefined\else\setjobsuffix{dvi}\fi -\to \everyresetspecials - -%D A rather fundamental difference between special and direct -%D settings is that the latter don't interfere with typesetting -%D but must be set before the first shipout, while the specials -%D must be packaged in the shipped out box in such a way that -%D they don't interfere. - -\newif\ifspecialbasedsettings \specialbasedsettingstrue - -\appendtoksonce - \specialbasedsettingstrue -\to \everyresetspecials - -%D Because there is no standardization in the use of specials, -%D more than one driver or program can be supported. The -%D specials are grouped in libraries. Some of these are -%D general, such as the \type{postscript} library, some are -%D tuned to a special kind of program, like the \type{pdf} -%D ones, and some support a specific driver, as we can see in -%D the \type{yandy} library. A library is build with the -%D commands: -%D -%D \starttyping -%D \startspecials[name][inheritance] -%D -%D \definespecial\none{...} -%D \definespecial\onlyone#1{...} -%D \definespecial\alot#1#2#3#4{...} -%D -%D \stopspecials -%D \stoptyping -%D -%D Because drivers can have overlap in low level macros, a -%D mechanism of inheritance is implemented. The libraries -%D defined as second argument are loaded first. -%D -%D Every special has to be predefined first. We do this with -%D the command: -%D -%D \starttyping -%D \installspecial [\none] [and] [0] -%D \installspecial [\onlyone] [and] [1] -%D \installspecial [\alot] [or] [4] -%D \stoptyping -%D -%D This means as much as: there is a special names -%D \type{\none} which has no arguments and has more than one -%D appearance. The special \type{\alot} on the other hand has -%D four arguments and is only defined once. Every instance in -%D the libraries of a special of category \type{and} is -%D executed when called upon, but only one special of -%D category \type{or} can be active. Most of the -%D \type{postscript}||specials are of category \type{or}, -%D because they tend to interfere with driver specific ones. -%D The interactive specials of \type{dviwindo} and \type{pdf} -%D are an example of specials that can be called both. -%D -%D A library is defined in a file with the name -%D \type{spec-...}. We load a library with the command: -%D -%D \starttyping -%D \usespecials [list] -%D \stoptyping -%D -%D where the list can contain one or more file tags, the -%D \type{...} in the filename. The keyword \type{reset} -%D resets all loaded specials. This is equivalent to -%D \type{\resetspecials}. - -%D Although a mechanism of nesting can be implemented, we -%D prefer to use a inheritance mechanism as mentioned. Calls -%D upon \type{\usespecials} within a \type{\startspecials} -%D would lead to confusion and errors. - -\newif\ifinheritspecials - -%D We define some local constants and variables. They look a -%D bit horrible but we don't want conflicts. - -\def\@@specfil@@{@@spcfil@@} -\def\@@speclst@@{@@spclst@@} -\def\@@speccat@@{@@spccat@@} -\def\@@specarg@@{@@spcarg@@} -\def\@@specexc@@{@@spcexc@@} - -% not faster -% -% \def\@@specfil@@{@sp@f@} -% \def\@@speclst@@{@sp@l@} -% \def\@@speccat@@{@sp@c@} -% \def\@@specarg@@{@sp@a@} -% \def\@@specexc@@{@sp@e@} - -\let\currentspecial \empty -\let\currentspecialfile\empty - -%D \macros -%D {startspecials} -%D -%D Every library has a unique name, which is given as the first -%D argument to \type{\startspecials}. When another library is -%D defined with the same name, previous specials can be -%D overruled. The name may differ from the file||tag. -%D -%D The optional second argument can consist of a list of -%D libraries that are to be loaded first. - -\def\dostartspecials[#1][#2]% - {\doifsomething{#2} - {\processcommalist[#2]\dousespecials}% - \doifelsenothing{#1} - {\let\currentspecial\s!unknown} - {\def\currentspecial{#1}}% - \unprotect} - -\def\startspecials - {\localpushmacro\currentspecial - \dodoubleempty\dostartspecials} - -\def\stopspecials - {\localpopmacro\currentspecial - \protect} - -%D \macros -%D {installspecial, -%D resetspecials} -%D -%D We have to install specials before we can define and use -%D them. The command itself is defined as a call to another -%D command that executes one or more user||defined specials, -%D depending of it's category: \type{or} versus \type{and}. -%D -%D The command \type{\installspecial} takes three -%D (non||optional) arguments: the name of the command, the -%D category it belongs to and the number of arguments it -%D takes. -%D -%D With \type{\resetspecials} we can unload the predefined -%D specials. Special reset actions |<|look in \type{spec-mis} -%D for an example|>| can be assigned to the token register -%D \type{\everyresetspecials}. - -\let\@@allspecials=\empty - -\def\doinstallspecial[#1][#2][#3]% - {\letvalue{\@@speclst@@\string#1}\empty - \setvalue{\@@speccat@@\string#1}{#2}% - \setvalue{\@@specarg@@\string#1}{#3}% - \addtocommalist{\string#1}\@@allspecials - \def#1{\executespecial#1}} - -\def\installspecial - {\dotripleargument\doinstallspecial} - -\def\resetspecials - {\the\everyresetspecials - \def\docommand##1% - {\letvalue{\@@speclst@@##1}\empty}% - \processcommacommand[\@@allspecials]\docommand} - -%D \macros -%D {definespecial} -%D -%D The command \type{\definespecial} take the place of -%D \type{\def} in the definition of a special. Just to be -%D sure, we first check if the command is permitted, i.e. -%D installed. If not, we give a warning and gobble the -%D illegal command in an quite elegant way. -%D -%D If the command can be combined (\type{and}) with others, -%D we append it to a list, otherwise (\type{or}) it becomes -%D the only item in the list. - -\def\definespecial#1% - {\ifx#1\undefined - \showmessage\m!specials4{\string#1}% - \def\next - {\def\@@illegalspecial@@}% - \else - \def\next - {\doifelsevalue{\@@speccat@@\string#1}{or} - {\edef\@@newspeclst@@{\currentspecial}} - {\edef\@@newspeclst@@{\getvalue{\@@speclst@@\string#1}}% - \addtocommalist\currentspecial\@@newspeclst@@}% - \setevalue{\@@speclst@@\string#1}{\@@newspeclst@@}% - \setvalue{\currentspecial\string#1}}% - \fi - \next} - -%D \macros -%D {usespecials} -%D -%D We use \type{\usespecials} to load a specific library. -%D This command is only permitted outside the definition part. - -\def\dousespecials#1% - {\doifelse{#1}\v!reset - {\resetspecials} - {\doifdefinedelse{\@@specfil@@#1} - {\edef\currentspecialfile{\getvalue{\@@specfil@@#1}}} - {\edef\currentspecialfile{#1}}% - \makeshortfilename[\truefilename{\f!specialprefix\currentspecialfile}]% - \startreadingfile - \readsysfile\shortfilename{\showmessage\m!specials5\currentspecialfile}\donothing - \stopreadingfile}} - -\def\usespecials[#1]% - {\ifnum\realpageno<2 - \doifelsenothing\currentspecial - {\processcommalist[#1]\dousespecials} - {\showmessage\m!specials6\empty}% - \fi} - -%D \macros -%D {executespecials} -%D -%D The command \type{\executespecials} is used to execute the -%D defined specials. Once a special is installed, the special -%D itself calls for this command, so it's not needed outside -%D this module. One can use it if wanted. -%D -%D A former implementation grouped the execution. Recent -%D additions however |<|like the specials that implement object -%D handling|>| asked for non||grouped execution. - -%D \starttyping -%D \def\executespecials#1#2% -%D {\def\doonespecial##1% -%D {\getvalue{##1\string#1}#2\relax}% -%D \processcommacommand -%D [\getvalue{\@@speclst@@\string#1}]\doonespecial} -%D -%D \def\executespecial#1% -%D {\expandafter\ifcase\getvalue{\@@specarg@@\string#1}\relax -%D \def\next% -%D {\executespecials#1{}}% -%D \or -%D \def\next##1% -%D {\executespecials#1{{##1}}}% -%D \or -%D \def\next##1##2% -%D {\executespecials#1{{##1}{##2}}}% -%D \or -%D \def\next##1##2##3% -%D {\executespecials#1{{##1}{##2}{##3}}}% -%D \or -%D \def\next##1##2##3##4% -%D {\executespecials#1{{##1}{##2}{##3}{##4}}}% -%D \or -%D \def\next##1##2##3##4##5% -%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}}}% -%D \or -%D \def\next##1##2##3##4##5##6% -%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}}}% -%D \or -%D \def\next##1##2##3##4##5##6##7% -%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}{##7}}}% -%D \or -%D \def\next##1##2##3##4##5##6##7##8% -%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}}}% -%D \or -%D \def\next##1##2##3##4##5##6##7##8##9% -%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}{##9}}}% -%D \else -%D \def\next% -%D {\message{illegal special: \string#1}}% -%D \fi -%D \next} -%D \stoptyping -%D -%D Because specials happen quite often, we will use a bit more -%D brute force. Keep in mind that we have to collect the -%D arguments because we want to support more drivers at once. -%D -%D I tested this on the next test. Where the previous alternative -%D took about 32 seconds, the new alternative takes 25 seconds. -%D -%D \starttyping -%D \testfeature{10000}{\setbox0=\hbox{test \color[red]{oeps} test}} -%D \stoptyping - -\def\@@exsp{exsp} - -\setvalue{\@@exsp0}{{}} -\setvalue{\@@exsp1}#1{{{#1}}} -\setvalue{\@@exsp2}#1#2{{{#1}{#2}}} -\setvalue{\@@exsp3}#1#2#3{{{#1}{#2}{#3}}} -\setvalue{\@@exsp4}#1#2#3#4{{{#1}{#2}{#3}{#4}}} -\setvalue{\@@exsp5}#1#2#3#4#5{{{#1}{#2}{#3}{#4}{#5}}} -\setvalue{\@@exsp6}#1#2#3#4#5#6{{{#1}{#2}{#3}{#4}{#5}{#6}}} -\setvalue{\@@exsp7}#1#2#3#4#5#6#7{{{#1}{#2}{#3}{#4}{#5}{#6}{#7}}} -\setvalue{\@@exsp8}#1#2#3#4#5#6#7#8{{{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}} -\setvalue{\@@exsp9}#1#2#3#4#5#6#7#8#9{{{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}} - -%D \starttyping -%D \def\executespecials#1% -%D {\def\doonespecial##1% -%D {\csname##1\xspecialcommand\endcsname#1\relax}% -%D \@EA\rawprocesscommalist\@EA -%D [\csname\@@speclst@@\xspecialcommand\endcsname]\doonespecial} -%D -%D \def\executespecial#1% -%D {\def\xspecialcommand{\string#1}% -%D \@EA\@EA\@EA\executespecials\csname\@@exsp\csname\@@specarg@@\xspecialcommand\endcsname\endcsname} -%D \stoptyping - -%D Some more speed can be gained by using a dedicated string -%D processing routine. Now we can bring down the execution -%D time to 21 seconds, one third less than the original run time. - -\def\executespecials#1% - {\@EA\let\@EA\speciallist\csname\@@speclst@@\xspecialcommand\endcsname - \ifx\speciallist\empty\else - \def\doonespecial##1% - {\csname##1\xspecialcommand\endcsname#1\relax}% - \@EA\dodoonespecial\speciallist,\end,% - \fi} - -\def\executespecial#1% - {\def\xspecialcommand{\string#1}% - \@EA\@EA\@EA\executespecials\csname\@@exsp\csname\@@specarg@@\xspecialcommand\endcsname\endcsname} - -\def\dodoonespecial#1,% - {\ifx\end#1\else - \doonespecial{#1}\expandafter\dodoonespecial - \fi} - -%D This kind of saving only shows up when making interative -%D documents with lots of color switches. In such documents -%D tens of thousands of special calls are rather normal. -%D On a 650 Mhz Pentium, the previous test takes 15 seconds -%D less (on about 65 seconds). When processing 2000 page -%D interactive documents this saving can be neglected. - -%D In the previous macros, the \type{{{...}}} are needed -%D because we pass all those arguments to the specials support -%D macro. - -\let\openspecialfile \relax -\let\closespecialfile \relax - -%D \macros -%D {doifspecialavailableelse} -%D -%D For testing purposes (this was first needed when object -%D support was implemented) we have: -%D -%D \starttyping -%D \doifspecialavailableelse\specialcommand{true}{false} -%D \stoptyping -%D -%D e.g: -%D -%D \starttyping -%D \doifspecialavailableelse\doinsertobject{...}{...} -%D \stoptyping - -\def\doifspecialavailableelse#1#2#3% - {\doifelsevaluenothing{\@@speclst@@\string#1}{#3}{#2}} - -%D So far for the macros that deal with installing specials. -%D In the file \type {spec-def} you will find the predefined -%D specials. - -%D Now that we have seen the flexible way (permitting -%D special chains) we will implement a faster and flat -%D alternative. But only if flag si set. - -\ifsimplifyspecials - - \def\doinstallspecial[#1][#2][#3]% - {\appendtoks\forgetspecial#1{#3}\to\everyresetspecials - \@EA\chardef\csname\@@speclst@@\string#1\endcsname\zerocount - \forgetspecial#1{#3}} - - \def\forgetspecial#1#2% - {\ifcase#2\relax - \let#1\relax \or - \let#1\gobbleoneargument \or - \let#1\gobbletwoarguments \or - \let#1\gobblethreearguments \or - \let#1\gobblefourarguments \or - \let#1\gobblefivearguments \or - \let#1\gobblesixarguments \or - \let#1\gobblesevenarguments \or - \let#1\gobbleeightarguments \or - \let#1\gobbleninearguments \or - \let#1\gobbletenarguments \fi} - - \def\resetspecials - {\the\everyresetspecials} - - \def\definespecial#1% - {\@EA\chardef\csname\@@speclst@@\string#1\endcsname=1 - \def#1} - - \def\doifspecialavailableelse#1% - {\ifcase\csname\@@speclst@@\string#1\endcsname - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} - -\fi - -%D For quite some time the \CONTEXT\ way of specifying the -%D output format has been: -%D -%D \starttyping -%D \usespecials[ps,yy,win,pdf] -%D \stoptyping -%D -%D Because at \PRAGMA\ we use \DVIPSONE, this was a suitable -%D setting, but with \CONTEXT\ going public, the next sequence -%D is more suitable for \DVIPS\ users: -%D -%D \starttyping -%D \usespecials[reset,ps,tr,pdf] -%D \stoptyping -%D -%D On the other hand, for \PDFTEX\ we needed: -%D -%D \starttyping -%D \usespecials[tpd] -%D \stoptyping -%D -%D To simplify things, I decided to provide a higher level -%D command. -%D -%D \starttyping -%D \defineoutput[name][specials] -%D \setupoutput[name,...] -%D \stoptyping -%D -%D In a \type {spec-def} you can find some examples. - -\def\defineoutput - {\dodoubleargument\dodefineoutput} - -\def\dodefineoutput[#1][#2]% - {\setvalue{\??ui#1}{#2}} - -\def\dosetupoutput#1% - {\doifdefinedelse{\??ui#1} - {\processcommacommand[\getvalue{\??ui#1}]\dousespecials} - {\doifdefinedelse{\@@specfil@@#1} - {\dousespecials{#1}} - {\showmessage\m!specials7{#1}}}} - -% Beware, from now on changing the (default) driver files demands -% remaking the format (no big deal, since only i adapt the driver -% and need delayed loading). - -\let\currentoutput\empty - -\def\setupoutput[#1]% - {\doifnot{#1}{\currentoutput} - {\ifnum\realpageno<\plustwo % new - \resetspecials\processcommacommand[#1]\dosetupoutput - \edef\currentoutput{#1}% - \fi}} - -\def\preloadspecials % it's nicer to report this - {\doifsomething\currentoutput - {\showmessage\m!specials1\currentoutput}} - -\appendtoks - \savecurrentvalue\usedoutputdriver\currentoutput -\to \everyfirstshipout - -\protect \endinput diff --git a/tex/context/base/spec-mis.mkii b/tex/context/base/spec-mis.mkii new file mode 100644 index 000000000..3d263eace --- /dev/null +++ b/tex/context/base/spec-mis.mkii @@ -0,0 +1,286 @@ +%D \module +%D [ file=spec-mis, +%D version=1997.04.01, +%D title=\CONTEXT\ Special Macros, +%D subtitle=Miscellaneous Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Quite some modules in this group are dedicated to supporting +%D \PDF\ directly by means of \PDFTEX or indirectly by using +%D Acrobat Distiller. This module implements some common +%D features. + +\writestatus{loading}{ConTeXt Special Macros / Miscellaneous Macros} + +\unprotect + +%D \macros +%D {URLhash} +%D +%D A rather trivial macro: + +\expandafter\def\expandafter\URLhash\expandafter{\string#} + +%D \macros +%D {ifusepagedestinations} +%D +%D In \PDF\ version 1.0 only page references were supported, +%D while in \DVIWINDO\ 1.N only named references were accepted. +%D Therefore \CONTEXT\ supports both methods of referencing. In +%D \PDF\ version 1.1 named destinations arrived. Lack of +%D continuous support of version 1.1 viewers for \MSDOS\ +%D therefore sometimes forces us to prefer page references. As +%D a bonus, they are faster too and have no limitations. How +%D fortunate we were having both mechanisms available when the +%D version 3.0 (\PDF\ version 1.2) viewers proved to be too +%D bugged to support named destinations. + +\newif\ifusepagedestinations + +%D \macros +%D {ifhighlighthyperlinks} +%D +%D The next switch can be used to make user hyperlinks are +%D not highlighted when clicked on. + +\newif\ifhighlighthyperlinks + +%D \macros +%D {ifgotonewwindow} +%D +%D To make the {\em goto previous jump} feature more +%D convenient when using more than one file, it makes sense +%D to force the viewer to open a new window for each file +%D opened. + +\newif\ifgotonewwindow + +%D \macros +%D {ifPDFstrokecolor} +%D +%D We can reduce the filesize a bit by setting the next switch +%D to false. The amount of reduction depends on the use of +%D color, but don't expect more than a few percent. Zip +%D compression is already rather efficient in itself. + +\newif\ifPDFstrokecolor \PDFstrokecolortrue + +%D \macros +%D {dofileinsertion,definefileinsertion,doiffileinsertionsupported} +%D +%D File insertion depend on the driver or \TEX\ variant used. +%D All driver modules use the same scheme for file insertion, +%D and therefore have the next macro in common (stupified +%D per august 2006): + +\let\supportedfileinsertions\empty +\let\supportedfilecheckers \empty + +\def\definefileinsertion#1#2#3% + {\addtocommalist{#2}\supportedfileinsertions + \setvalue{do#1insert#2}{#3}} + +\def\definefilechecker#1#2#3% + {\addtocommalist{#2}\supportedfilecheckers + \setvalue{do#1check#2}{#3}} + +\def\dofileinsertion#1#2{\executeifdefined{do#1insert#2}\donothing} +\def\dofilechecker #1#2{\executeifdefined{do#1check#2} \donothing} + +\appendtoks \let\supportedfileinsertions\empty \to \everyresetspecials +\appendtoks \let\supportedfilecheckers \empty \to \everyresetspecials + +% \def\doiffileinsertionsupportedelse#1% +% {\expanded{\doifinstringelse{#1}{\c!tex,\c!tmp,\supportedfileinsertions}}} + +\def\doiffileinsertionsupportedelse#1% lowercasing happens at tex end + {\expanded{\doifinstringelse{\truegraphictype{#1}}{\c!tex,\c!tmp,\supportedfileinsertions}}} + +%D This macro is called with 10 arguments, where the first +%D one specifies the driver, like \type{yy} or \type{tr}. The +%D second argument is a \type{{type,method}} pair and the +%D third the filename. + +%D Just in case this one is undefined (which can happen if +%D this module is used outside \CONTEXT): + +\ifx\setreferencefilename\undefined + + \def\setreferencefilename#1\to#2{\edef#2{#1}} + +\fi + +%D When submitting forms, we need to communicate the format. + +\chardef\submitoutputformat=0 % 0=unknown 1=HTML 2=FDF 3=XML + +\def\setsubmitoutputformat#1% + {\doifinsetelse{#1}{FDF,fdf} + {\chardef\submitoutputformat2} + {\doifinsetelse{#1}{XML,xml} + {\chardef\submitoutputformat3} + {\chardef\submitoutputformat1}}% + \relax} + +%D \macros +%D {escapePSstring} +%D +%D \starttyping +%D \escapePSstring(t\e\1st)))))\to\crap \crap +%D \stoptyping + +% testcase: webschrift met lege regels en unbalanced () + +\bgroup + +\catcode`\*=\@@escape +\catcode`\\=\@@letter + +*long*gdef*escapedPSstring#1% + {*aftergroup*string + *ifnum`#1=12 + *aftergroup*n% + *else*ifnum`#1=13 + *aftergroup*n% + *else*if#1(% + *aftergroup*(% + *else*if#1)% + *aftergroup*)% + *else*if#1\% + *aftergroup*\% + *else + *aftergroup#1% + *fi*fi*fi*fi*fi} + +*egroup + +\long\def\escapePSstring#1\to#2% + {\defconvertedargument#2{#1}% + \bgroup + \ifx#2\empty \else + \setverbosecscharacters + \aftergroup\edef + \aftergroup#2% + \aftergroup{% + \expandafter\handletokens#2\with\escapedPSstring + \aftergroup}% + \fi + \egroup} + +% \long\def\preservePSpar#1\to#2% +% {\bgroup +% \def\par{\rawcharacter{12}}% +% \expanded{\egroup\noexpand\def\noexpand#2{#1}}} + +\long\def\preservePSpar#1\to#2% + {\bgroup + \def\par{\rawcharacter{12}\rawcharacter{12}}% hm, should be one 13 but 12 ff is platform safe + \expanded{\egroup\noexpand\def\noexpand#2{#1}}} + +%D \macros +%D {ifPDFunicode} +%D +%D We can use this switch to signal that content streams has +%D to be unicoded. + +\newif\ifPDFunicode + +%D \macros +%D {makeMPintoPDFobject, handleMPfshow, setMPPDFobject, getMPPDFobject} +%D +%D \METAPOST\ support. + +\appendtoks + \chardef\makeMPintoPDFobject\zerocount + \def\setMPPDFobject#1#2{\def\getMPPDFobject{\box#2}}% +\to \everyresetspecials + +\appendtoks + \let\handleMPfshow\dohandleMPfshow +\to \everyresetspecials + +%D + +%D \macros +%D {dosetposition, dosetpositionwdh, dosetpositionplus} +%D +%D Opposite to its \DVI\ counterpart, the \PDFTEX\ backend +%D can provide positional information directly. Since +%D \CONTEXT\ only uses relative positions, the origin is of +%D less importance. Nowadays \XETEX\ also supports this +%D feature. + +\ifx\pdfsavepos\undefined + + % only for ancient pdftex, less old xetex and current aleph + + \def\dosetposition #1{\special{pos:pxy "#1"}} + \def\dosetpositionwhd #1#2#3#4{\special{pos:pxywhd "#1" #2 #3 #4}} + \def\dosetpositionplus#1#2#3#4#5{\special{pos:pxyplus "#1" #2 #3 #4 #5}} + + \let\flushDVIpositionpapersize\relax + + \def\dosetpositionpapersize#1#2% + {\xdef\flushDVIpositionpapersize + {\special{pos:papersize \number#1 \number#2}% + \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }% + \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} + + % kind of obsolete since nowadays xetex supports \pdfsavepos as well + + \ifnum\texengine=\xetexengine + + \def\dosetpositionpapersize#1#2% + {\xdef\flushDVIpositionpapersize + {\special{pos:papersize \number#1 \number#2}% + \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.xdv }% + \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} + + \fi + + \prependtoksonce \flushDVIpositionpapersize \to \everyshipout + +\else + + \def\dosetposition#1% + {\pdfsavepos + \dolazysaveposition + {#1}% + {\noexpand\realfolio}% + {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% + {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}}% + + \def\dosetpositionwhd#1#2#3#4% + {\pdfsavepos + \dolazysavepositionwhd + {#1}% + {\noexpand\realfolio}% + {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% + {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}% + {#2}{#3}{#4}} + + \def\dosetpositionplus#1#2#3#4#5% + {\pdfsavepos + \dolazysavepositionplus + {#1}% + {\noexpand\realfolio}% + {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% + {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}% + {#2}{#3}{#4}{#5}} + + \let\dosetpositionpapersize\gobbletwoarguments + +\fi + +%D Handy to have this available asap: + +\ifdefined\everyPDFxform \newtoks\everyPDFxform \fi +\ifdefined\everyPDFximage \newtoks\everyPDFximage \fi + +\protect \endinput diff --git a/tex/context/base/spec-mis.tex b/tex/context/base/spec-mis.tex deleted file mode 100644 index 3d263eace..000000000 --- a/tex/context/base/spec-mis.tex +++ /dev/null @@ -1,286 +0,0 @@ -%D \module -%D [ file=spec-mis, -%D version=1997.04.01, -%D title=\CONTEXT\ Special Macros, -%D subtitle=Miscellaneous Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Quite some modules in this group are dedicated to supporting -%D \PDF\ directly by means of \PDFTEX or indirectly by using -%D Acrobat Distiller. This module implements some common -%D features. - -\writestatus{loading}{ConTeXt Special Macros / Miscellaneous Macros} - -\unprotect - -%D \macros -%D {URLhash} -%D -%D A rather trivial macro: - -\expandafter\def\expandafter\URLhash\expandafter{\string#} - -%D \macros -%D {ifusepagedestinations} -%D -%D In \PDF\ version 1.0 only page references were supported, -%D while in \DVIWINDO\ 1.N only named references were accepted. -%D Therefore \CONTEXT\ supports both methods of referencing. In -%D \PDF\ version 1.1 named destinations arrived. Lack of -%D continuous support of version 1.1 viewers for \MSDOS\ -%D therefore sometimes forces us to prefer page references. As -%D a bonus, they are faster too and have no limitations. How -%D fortunate we were having both mechanisms available when the -%D version 3.0 (\PDF\ version 1.2) viewers proved to be too -%D bugged to support named destinations. - -\newif\ifusepagedestinations - -%D \macros -%D {ifhighlighthyperlinks} -%D -%D The next switch can be used to make user hyperlinks are -%D not highlighted when clicked on. - -\newif\ifhighlighthyperlinks - -%D \macros -%D {ifgotonewwindow} -%D -%D To make the {\em goto previous jump} feature more -%D convenient when using more than one file, it makes sense -%D to force the viewer to open a new window for each file -%D opened. - -\newif\ifgotonewwindow - -%D \macros -%D {ifPDFstrokecolor} -%D -%D We can reduce the filesize a bit by setting the next switch -%D to false. The amount of reduction depends on the use of -%D color, but don't expect more than a few percent. Zip -%D compression is already rather efficient in itself. - -\newif\ifPDFstrokecolor \PDFstrokecolortrue - -%D \macros -%D {dofileinsertion,definefileinsertion,doiffileinsertionsupported} -%D -%D File insertion depend on the driver or \TEX\ variant used. -%D All driver modules use the same scheme for file insertion, -%D and therefore have the next macro in common (stupified -%D per august 2006): - -\let\supportedfileinsertions\empty -\let\supportedfilecheckers \empty - -\def\definefileinsertion#1#2#3% - {\addtocommalist{#2}\supportedfileinsertions - \setvalue{do#1insert#2}{#3}} - -\def\definefilechecker#1#2#3% - {\addtocommalist{#2}\supportedfilecheckers - \setvalue{do#1check#2}{#3}} - -\def\dofileinsertion#1#2{\executeifdefined{do#1insert#2}\donothing} -\def\dofilechecker #1#2{\executeifdefined{do#1check#2} \donothing} - -\appendtoks \let\supportedfileinsertions\empty \to \everyresetspecials -\appendtoks \let\supportedfilecheckers \empty \to \everyresetspecials - -% \def\doiffileinsertionsupportedelse#1% -% {\expanded{\doifinstringelse{#1}{\c!tex,\c!tmp,\supportedfileinsertions}}} - -\def\doiffileinsertionsupportedelse#1% lowercasing happens at tex end - {\expanded{\doifinstringelse{\truegraphictype{#1}}{\c!tex,\c!tmp,\supportedfileinsertions}}} - -%D This macro is called with 10 arguments, where the first -%D one specifies the driver, like \type{yy} or \type{tr}. The -%D second argument is a \type{{type,method}} pair and the -%D third the filename. - -%D Just in case this one is undefined (which can happen if -%D this module is used outside \CONTEXT): - -\ifx\setreferencefilename\undefined - - \def\setreferencefilename#1\to#2{\edef#2{#1}} - -\fi - -%D When submitting forms, we need to communicate the format. - -\chardef\submitoutputformat=0 % 0=unknown 1=HTML 2=FDF 3=XML - -\def\setsubmitoutputformat#1% - {\doifinsetelse{#1}{FDF,fdf} - {\chardef\submitoutputformat2} - {\doifinsetelse{#1}{XML,xml} - {\chardef\submitoutputformat3} - {\chardef\submitoutputformat1}}% - \relax} - -%D \macros -%D {escapePSstring} -%D -%D \starttyping -%D \escapePSstring(t\e\1st)))))\to\crap \crap -%D \stoptyping - -% testcase: webschrift met lege regels en unbalanced () - -\bgroup - -\catcode`\*=\@@escape -\catcode`\\=\@@letter - -*long*gdef*escapedPSstring#1% - {*aftergroup*string - *ifnum`#1=12 - *aftergroup*n% - *else*ifnum`#1=13 - *aftergroup*n% - *else*if#1(% - *aftergroup*(% - *else*if#1)% - *aftergroup*)% - *else*if#1\% - *aftergroup*\% - *else - *aftergroup#1% - *fi*fi*fi*fi*fi} - -*egroup - -\long\def\escapePSstring#1\to#2% - {\defconvertedargument#2{#1}% - \bgroup - \ifx#2\empty \else - \setverbosecscharacters - \aftergroup\edef - \aftergroup#2% - \aftergroup{% - \expandafter\handletokens#2\with\escapedPSstring - \aftergroup}% - \fi - \egroup} - -% \long\def\preservePSpar#1\to#2% -% {\bgroup -% \def\par{\rawcharacter{12}}% -% \expanded{\egroup\noexpand\def\noexpand#2{#1}}} - -\long\def\preservePSpar#1\to#2% - {\bgroup - \def\par{\rawcharacter{12}\rawcharacter{12}}% hm, should be one 13 but 12 ff is platform safe - \expanded{\egroup\noexpand\def\noexpand#2{#1}}} - -%D \macros -%D {ifPDFunicode} -%D -%D We can use this switch to signal that content streams has -%D to be unicoded. - -\newif\ifPDFunicode - -%D \macros -%D {makeMPintoPDFobject, handleMPfshow, setMPPDFobject, getMPPDFobject} -%D -%D \METAPOST\ support. - -\appendtoks - \chardef\makeMPintoPDFobject\zerocount - \def\setMPPDFobject#1#2{\def\getMPPDFobject{\box#2}}% -\to \everyresetspecials - -\appendtoks - \let\handleMPfshow\dohandleMPfshow -\to \everyresetspecials - -%D - -%D \macros -%D {dosetposition, dosetpositionwdh, dosetpositionplus} -%D -%D Opposite to its \DVI\ counterpart, the \PDFTEX\ backend -%D can provide positional information directly. Since -%D \CONTEXT\ only uses relative positions, the origin is of -%D less importance. Nowadays \XETEX\ also supports this -%D feature. - -\ifx\pdfsavepos\undefined - - % only for ancient pdftex, less old xetex and current aleph - - \def\dosetposition #1{\special{pos:pxy "#1"}} - \def\dosetpositionwhd #1#2#3#4{\special{pos:pxywhd "#1" #2 #3 #4}} - \def\dosetpositionplus#1#2#3#4#5{\special{pos:pxyplus "#1" #2 #3 #4 #5}} - - \let\flushDVIpositionpapersize\relax - - \def\dosetpositionpapersize#1#2% - {\xdef\flushDVIpositionpapersize - {\special{pos:papersize \number#1 \number#2}% - \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }% - \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} - - % kind of obsolete since nowadays xetex supports \pdfsavepos as well - - \ifnum\texengine=\xetexengine - - \def\dosetpositionpapersize#1#2% - {\xdef\flushDVIpositionpapersize - {\special{pos:papersize \number#1 \number#2}% - \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.xdv }% - \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}} - - \fi - - \prependtoksonce \flushDVIpositionpapersize \to \everyshipout - -\else - - \def\dosetposition#1% - {\pdfsavepos - \dolazysaveposition - {#1}% - {\noexpand\realfolio}% - {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% - {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}}% - - \def\dosetpositionwhd#1#2#3#4% - {\pdfsavepos - \dolazysavepositionwhd - {#1}% - {\noexpand\realfolio}% - {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% - {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}% - {#2}{#3}{#4}} - - \def\dosetpositionplus#1#2#3#4#5% - {\pdfsavepos - \dolazysavepositionplus - {#1}% - {\noexpand\realfolio}% - {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}% - {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}% - {#2}{#3}{#4}{#5}} - - \let\dosetpositionpapersize\gobbletwoarguments - -\fi - -%D Handy to have this available asap: - -\ifdefined\everyPDFxform \newtoks\everyPDFxform \fi -\ifdefined\everyPDFximage \newtoks\everyPDFximage \fi - -\protect \endinput diff --git a/tex/context/base/spec-pdf.mkii b/tex/context/base/spec-pdf.mkii new file mode 100644 index 000000000..2191eaeae --- /dev/null +++ b/tex/context/base/spec-pdf.mkii @@ -0,0 +1,484 @@ +%D \module +%D [ file=spec-pdf, +%D version=1997.09.20, +%D title=\CONTEXT\ Special Macros, +%D subtitle=Adobe \ACROBAT\ version 2.1, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% funny things: mail to yeny: "please geen auto-crlf in special" + +\unprotect + +%D This driver is build on top of the general \PDF\ macros, +%D as defined in \type{spec-fdf}, so we inherit that one. + +\startspecials[pdf][fdf] + +%D \macros +%D {dosetupinteraction, +%D doPDFsetopenaction,doPDFsetcloseaction} +%D +%D Instead of a prolog, we can put the code in the file +%D ourselve. +%D +%D \starttyping +%D \definespecial\dosetupinteraction% +%D {\special +%D {\@@insertpostscriptretain +%D /pdfmark where +%D {pop} +%D {userdict /pdfmark /cleartomark load put} +%D ifelse}} +%D \stoptyping +%D +%D We decided to use a prolog file. The following code has to +%D be put somewhere, e.g.\ in the startup directory of +%D \DISTILLER. To overcome problems, we always embed the fonts, +%D but copyrights force us always to make subsets. +%D +%D \starttyping +%D /currentdistillerparams where +%D { pop } { userdict /currentdistillerparams { 1 dict } put } ifelse +%D +%D /setdistillerparams where +%D { pop } { userdict /setdistillerparams { pop } put } ifelse +%D +%D << /AntiAliasColorImages true +%D /AntiAliasGrayImages true +%D /AntiAliasMonoImages true +%D /ConvertCMYKImagesToRGB true +%D /MaxSubsetPct 99 +%D /EmbedAllFonts true +%D /SubSetFonts true >> setdistillerparams +%D \stoptyping +%D +%D Beware, this is the PostScript Level 2 way of doing things. + +\definespecial\dosetupinteraction + {\showmessage\m!interactions{21}{acrobat}} + +\definespecial\dosetupopenaction {\doPDFsetupopenaction} +\definespecial\dosetupcloseaction{\doPDFsetupcloseaction} + +%D \macros +%D {dostartthisislocation} +%D +%D We share a lot of macros with the \PDFTEX\ driver. First +%D the one that handles named destinations. + +\definespecial\dostartthisislocation {\doPDFstartthisislocation} + +%D \macros +%D {doresetgotowhereever, +%D dostartgotolocation,dostartgotorealpage,dostartgotoJS, +%D dostartexecutecommand,dostartrunprogram,dostartgotoprofile} +%D +%D The next specials are responsible for handling references. +%D Each goto handler can handle multiple references. + +\definespecial\doresetgotowhereever {\doPDFresetgotowhereever} +\definespecial\dostartgotolocation {\doPDFstartgotolocation} +\definespecial\dostartgotorealpage {\doPDFstartgotorealpage} +\definespecial\dostartgotoJS {\doPDFstartgotoJS} +\definespecial\dostartexecutecommand{\doPDFstartexecutecommand} +\definespecial\dostartrunprogram {\doPDFstartrunprogram} +\definespecial\dostartgotoprofile {\doPDFstartgotoprofile} + +%D \macros +%D {doflushJSpreamble} +%D +%D Thanks to the fact that \DISTILLER\ cannot handle multiple +%D names entries in the document catalog, for the moment we +%D have to misuse the page attributes. Beware, the preambles +%D must be packed. + +\definespecial\doflushJSpreamble#1% + {\bgroup + \ifoneJSpreamble + \edef\sanitizedJScode{\getJSpreamble{#1}}% + \expandafter\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode + \special % nota bene, the page starts at 1 + {\@@insertpostscriptretain + [ /_objdef{JS:#1} /type /dict /OBJ pdfmark + [ {JS:#1} << /S /JavaScript /JS (\sanitizedJScode) >> /PUT pdfmark + [ {Page1} << /AA << /O {JS:#1} >> >> /PUT pdfmark}% + \else % temporary message + \writestatus{\m!specials}{Acrobat workaround needed: please pack JS preambles}% + \fi + \egroup} + +%D \macros +%D {dostarthide,dostophide} +%D +%D Hopefully some day hiding navigational things when +%D printing \PDF\ files will be supported properly. + +\definespecial\dostarthide% + {\special + {\@@insertpostscriptretain + [ /DataSource (false \iftrue\string{\else}\fi) + /PS + pdfmark}} + +\definespecial\dostophide% + {\special + {\@@insertpostscriptretain + [ /DataSource (\iffalse{\else\string}\fi if) + /PS + pdfmark}} + +%D \macros +%D {dosetupscreen, +%D dosetupidentity} +%D +%D We can set up the page dimensions, full screen start up +%D mode and identify the file with: + +\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight} + +\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight} +\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight} +\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight} +\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight} + +\definespecial\dosetupidentity{\doPDFsetupidentity} + +%D \macros +%D {dobeginofprofile,doendofprofile} +%D +%D Profile support is still far from perfect. This is +%D especially due to the fact that the specification of +%D threads are sort of fuzzy and depend on the viewer. + +\definespecial\dobeginofprofile#1#2#3#4% label width height page + {\bgroup + \setPDFdestination{#1}% + \doifsomething{\PDFdestination} + {\PointsToBigPoints{#2}\width + \PointsToBigPoints{#3}\height + \special + {\@@insertpostscriptretain + [ /Title (\PDFdestination) + /Rect [0 0 \width\space\height] + /ARTICLE + pdfmark}}% + \egroup} + +\definespecial\doendofprofile% + {} + +%D Apart from movies, graphic inclusion is handled in the +%D \POSTSCRIPT\ drivers. We just link the movie annotation +%D handled to the file inclusion system. + +\definefileinsertion{yy}{mov}{\doPDFinsertmov} +\definefileinsertion{tr}{mov}{\doPDFinsertmov} + +\definefileinsertion{yy}{avi}{\doPDFinsertmov} +\definefileinsertion{tr}{avi}{\doPDFinsertmov} + +%D \macros +%D {doinsertsoundtrack} +%D +%D Sounds look much like movies: + +\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack} + +%D \macros +%D {dostartobject,dostopobject, +%D doinsertobject} +%D +%D Objects, those nice reusable pieces of text and graphics, +%D are handled by three specials: + +\definespecial\dostartobject#1#2#3#4#5% + {\bgroup + \setbox\nextbox=\hbox\bgroup + \bgroup + \PointsToBigPoints{#3}\width + \PointsToBigPoints{#4}\height + \PointsToBigPoints{#5}\depth + \dosetobjectreference{#1}{#2}{#1::#2}% + \special + {\@@insertpostscriptretain + [ /BBox [0 -\depth\space \width\space \height] + /_objdef {#1::#2} + /BP + pdfmark}% + \egroup} + +\definespecial\dostopobject% + {\special + {\@@insertpostscriptretain + [ /EP + pdfmark}% + \egroup + \smashbox\nextbox + \flushatshipout{\box\nextbox}% + \egroup} + +\definespecial\doinsertobject#1#2% + {\hbox + {\dogetobjectreference{#1}{#2}\PDFobjectreference + \ifx\PDFobjectreference\empty \else + \special + {\@@insertpostscriptretain + [ {\PDFobjectreference} + /SP + pdfmark}% + \fi}} + +%D \macros +%D {doinsertbookmark} +%D +%D Although personally I never use bookmarks, \CONTEXT\ does +%D support them, due to user requests. + +\definespecial\doinsertbookmark {\doPDFinsertbookmark} + +%D \macros +%D {dosetpagetransition} +%D +%D Page transitions, again a user wish, is taken care of by: + +\definespecial\dosetpagetransition{\doPDFsetpagetransition} + +%D \macros +%D {doinsertcomment, doflushcomments} +%D +%D I never needed (and used) one until now, but here is the +%D text annotation special: + +\definespecial\doinsertcomment{\doPDFinsertcomment} +\definespecial\doflushcomments{\doPDFflushcomments} + +%D \macros +%D {dopresetlinefield,dopresettextfield, +%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, +%D dopresetpushfield,dopresetcheckfield, +%D dopresetradiofield,dopresetradiorecord} +%D +%D There is nothing enervating to the next few mappings. + +\definespecial\dopresetlinefield {\doFDFpresetlinefield} +\definespecial\dopresettextfield {\doFDFpresettextfield} +\definespecial\dopresetchoicefield{\doFDFpresetchoicefield} +\definespecial\dopresetpopupfield {\doFDFpresetpopupfield} +\definespecial\dopresetcombofield {\doFDFpresetcombofield} +\definespecial\dopresetpushfield {\doFDFpresetpushfield} +\definespecial\dopresetcheckfield {\doFDFpresetcheckfield} +\definespecial\dopresetradiofield {\doFDFpresetradiofield} +\definespecial\dopresetradiorecord{\doFDFpresetradiorecord} + +%D \macros +%D {dodefinefieldset,dogetfieldset,doiffieldset} +%D +%D Field sets, used in resetting and submitting, are handled +%D by: + +\definespecial\dodefinefieldset{\doFDFdefinefieldset} +\definespecial\dogetfieldset {\doFDFgetfieldset} +\definespecial\doiffieldset {\doFDFiffieldset} + +%D \macros +%D {doregistercalculationset} +%D +%D The calculation order is defined using: + +\definespecial\doregistercalculationset{\doFDFregistercalculationset} + +%D \macros +%D {doPDFdestination} +%D +%D Last we implement the low level pdfmark macros. The +%D definitions are rather verbose. First the destination +%D macro. + +\def\doPDFdestination#1% + {\special + {\@@insertpostscriptretain + [ /Dest /#1\space + \PDFpageview + /DEST + pdfmark}} + +%D \macros +%D {doPDFaction,doPDFannotation,doPDFannotationobject, +%D ifsharePDFactions} +%D +%D We have three alternative annotation macros. The first +%D handles the goto ones, the second takes care of for instance +%D movies and the third is used in fields. + +\newcount\nofPDFsimilar + +\newif\ifsharePDFactions \sharePDFactionstrue + +\def\dodoPDFaction#1#2#3#4% + {\ifcollectreferenceactions + \xdef\lastPDFaction{#4}% + \else + \bgroup + % does not work well with distiller 4 + %\ifsharePDFactions + % \ifcase\similarreference\relax + % \xdef\lastPDFaction{<<#4>>}% + % \or + % \global\advance\nofPDFsimilar by 1 + % \special + % {\@@insertpostscriptretain + % [ /_objdef {PDF::sim:\the\nofPDFsimilar} /type /dict /OBJ pdfmark + % [ {PDF::sim:\the\nofPDFsimilar} <<#4>>\space /PUT pdfmark}% + % \xdef\lastPDFaction{{PDF::sim:\the\nofPDFsimilar}}% + % \else + % % leave \lastPDFaction untouched + % \fi + %\else + \xdef\lastPDFaction{<<#4>>}% + %\fi + \PointsToBigPoints{#2}\width + \PointsToBigPoints{#1}\height + \special + {\@@insertpostscriptretain + [ #1 + /Action \lastPDFaction\space + /Rect [0 0 \width\space \height] + /Border [0 0 0] + \ifhighlighthyperlinks \else /H /N \fi + /Subtype /Link + /ANN + pdfmark}% + \egroup + \fi} + +\def\doPDFaction#1#2#3% + {\dodoPDFaction\empty{#1}{#2}{#3}} + +\def\doPDFannotation#1#2#3% + {\bgroup + \PointsToBigPoints{#1}\width + \PointsToBigPoints{#2}\height + \special + {\@@insertpostscriptretain + [ /Rect [0 0 \width\space \height] #3 + /ANN + pdfmark}% + \egroup} + +\def\doPDFannotationobject#1#2#3#4#5% + {\bgroup + \PointsToBigPoints{#3}\width + \PointsToBigPoints{#4}\height + \special + {\@@insertpostscriptretain + [ /_objdef {#1::#2} + /Rect [0 0 \width\space \height] #5 + /ANN + pdfmark}% + \egroup + \dosetobjectreference{#1}{#2}{#1::#2}} + +\def\doPDFactionobject#1#2#3#4#5% + {\dodoPDFaction{/_objdef {#1::#2}}{#3}{#4}{#5}% + \dosetobjectreference{#1}{#2}{#1::#2}} + +%D \macros +%D {doPDFdictionaryobject,doPDFarrayobject} +%D +%D These two macros are used to build low level objects. + +\def\doPDFdictionaryobject#1#2#3% + {\special + {\@@insertpostscriptretain + [ /_objdef {#1::#2} /type /dict /OBJ pdfmark + [ {#1::#2} << #3 >> /PUT pdfmark}% + \dosetobjectreference{#1}{#2}{#1::#2}} + +\def\doPDFarrayobject#1#2#3% + {\special + {\@@insertpostscriptretain + [ /_objdef {#1::#2} /type /array /OBJ pdfmark + [ {#1::#2} 0 [#3] /PUTINTERVAL pdfmark}% + \dosetobjectreference{#1}{#2}{#1::#2}} + +%D \macros +%D {doPDFaddtocatalog,doPDFaddtoinfo, +%D doPDFpageattribute,doPDFpagesattribute} +%D +%D Next come our housekeeping macros. + +\def\doPDFaddtocatalog#1% + {\doifsomething{#1} + {\special + {\@@insertpostscriptretain + [ {Catalog} << #1 >> /PUT pdfmark}}} + +\def\doPDFaddtoinfo#1% unchecked + {\special + {\@@insertpostscriptretain + [ #1 /DOCINFO pdfmark}} % [ {DocInfo} << #1 >> /PUT pdfmark}} + +\def\doPDFpageattribute#1% + {\doifsomething{#1} + {\special + {\@@insertpostscriptretain + [ {ThisPage} << #1 >> /PUT pdfmark}}} + +\def\doPDFpageresource#1% + {\message{[skipping PDF resource]}} + +\def\doPDFpagesattribute#1% + {\doifsomething{#1} + {\special + {\@@insertpostscriptretain + [ #1 /PAGES pdfmark}}} + +\let\doPDFresetpageresources \relax +\let\doPDFresetpageattributes\relax + +%D \macros +%D {doPDFbookmark} +%D +%D This is how we force bookmarks entries in the file. + +\def\doPDFbookmark#1#2#3#4#5% + {\scratchcounter#4\advance\scratchcounter\minusone + \special + {\@@insertpostscriptretain + [ /Page \the\scratchcounter\space + \ifcase#2 \else/Count \ifcase#5-\fi#2 \fi + \PDFpageview + /Title (#3) + /OUT + pdfmark}} + +%D \macros +%D {defaultobjectreference,doPDFgetobjectreference} +%D +%D The object references are \type{{named}}, that is, no hard +%D coded numbers are needed (opposite to \PDFTEX). + +\def\defaultobjectreference#1#2{#1::#2} + +\def\doPDFgetobjectreference#1#2#3% + {\dogetobjectreference{#1}{#2}#3% + \ifx#3\empty\else\edef#3{{#3}}\fi} + %\edef#3{\ifx#3\empty null\else{#3}\fi}} + +% \def\doPDFgetobjectpage #1#2#3{..} +% \def\doPDFgetobjectpagereference#1#2#3{..} + +\def\doPDFgetpagereference#1#2% + {\edef#2{{page#1}}} + +%D Done. + +\stopspecials + +\protect \endinput diff --git a/tex/context/base/spec-pdf.tex b/tex/context/base/spec-pdf.tex deleted file mode 100644 index 2191eaeae..000000000 --- a/tex/context/base/spec-pdf.tex +++ /dev/null @@ -1,484 +0,0 @@ -%D \module -%D [ file=spec-pdf, -%D version=1997.09.20, -%D title=\CONTEXT\ Special Macros, -%D subtitle=Adobe \ACROBAT\ version 2.1, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% funny things: mail to yeny: "please geen auto-crlf in special" - -\unprotect - -%D This driver is build on top of the general \PDF\ macros, -%D as defined in \type{spec-fdf}, so we inherit that one. - -\startspecials[pdf][fdf] - -%D \macros -%D {dosetupinteraction, -%D doPDFsetopenaction,doPDFsetcloseaction} -%D -%D Instead of a prolog, we can put the code in the file -%D ourselve. -%D -%D \starttyping -%D \definespecial\dosetupinteraction% -%D {\special -%D {\@@insertpostscriptretain -%D /pdfmark where -%D {pop} -%D {userdict /pdfmark /cleartomark load put} -%D ifelse}} -%D \stoptyping -%D -%D We decided to use a prolog file. The following code has to -%D be put somewhere, e.g.\ in the startup directory of -%D \DISTILLER. To overcome problems, we always embed the fonts, -%D but copyrights force us always to make subsets. -%D -%D \starttyping -%D /currentdistillerparams where -%D { pop } { userdict /currentdistillerparams { 1 dict } put } ifelse -%D -%D /setdistillerparams where -%D { pop } { userdict /setdistillerparams { pop } put } ifelse -%D -%D << /AntiAliasColorImages true -%D /AntiAliasGrayImages true -%D /AntiAliasMonoImages true -%D /ConvertCMYKImagesToRGB true -%D /MaxSubsetPct 99 -%D /EmbedAllFonts true -%D /SubSetFonts true >> setdistillerparams -%D \stoptyping -%D -%D Beware, this is the PostScript Level 2 way of doing things. - -\definespecial\dosetupinteraction - {\showmessage\m!interactions{21}{acrobat}} - -\definespecial\dosetupopenaction {\doPDFsetupopenaction} -\definespecial\dosetupcloseaction{\doPDFsetupcloseaction} - -%D \macros -%D {dostartthisislocation} -%D -%D We share a lot of macros with the \PDFTEX\ driver. First -%D the one that handles named destinations. - -\definespecial\dostartthisislocation {\doPDFstartthisislocation} - -%D \macros -%D {doresetgotowhereever, -%D dostartgotolocation,dostartgotorealpage,dostartgotoJS, -%D dostartexecutecommand,dostartrunprogram,dostartgotoprofile} -%D -%D The next specials are responsible for handling references. -%D Each goto handler can handle multiple references. - -\definespecial\doresetgotowhereever {\doPDFresetgotowhereever} -\definespecial\dostartgotolocation {\doPDFstartgotolocation} -\definespecial\dostartgotorealpage {\doPDFstartgotorealpage} -\definespecial\dostartgotoJS {\doPDFstartgotoJS} -\definespecial\dostartexecutecommand{\doPDFstartexecutecommand} -\definespecial\dostartrunprogram {\doPDFstartrunprogram} -\definespecial\dostartgotoprofile {\doPDFstartgotoprofile} - -%D \macros -%D {doflushJSpreamble} -%D -%D Thanks to the fact that \DISTILLER\ cannot handle multiple -%D names entries in the document catalog, for the moment we -%D have to misuse the page attributes. Beware, the preambles -%D must be packed. - -\definespecial\doflushJSpreamble#1% - {\bgroup - \ifoneJSpreamble - \edef\sanitizedJScode{\getJSpreamble{#1}}% - \expandafter\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode - \special % nota bene, the page starts at 1 - {\@@insertpostscriptretain - [ /_objdef{JS:#1} /type /dict /OBJ pdfmark - [ {JS:#1} << /S /JavaScript /JS (\sanitizedJScode) >> /PUT pdfmark - [ {Page1} << /AA << /O {JS:#1} >> >> /PUT pdfmark}% - \else % temporary message - \writestatus{\m!specials}{Acrobat workaround needed: please pack JS preambles}% - \fi - \egroup} - -%D \macros -%D {dostarthide,dostophide} -%D -%D Hopefully some day hiding navigational things when -%D printing \PDF\ files will be supported properly. - -\definespecial\dostarthide% - {\special - {\@@insertpostscriptretain - [ /DataSource (false \iftrue\string{\else}\fi) - /PS - pdfmark}} - -\definespecial\dostophide% - {\special - {\@@insertpostscriptretain - [ /DataSource (\iffalse{\else\string}\fi if) - /PS - pdfmark}} - -%D \macros -%D {dosetupscreen, -%D dosetupidentity} -%D -%D We can set up the page dimensions, full screen start up -%D mode and identify the file with: - -\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight} - -\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight} -\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight} -\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight} -\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight} - -\definespecial\dosetupidentity{\doPDFsetupidentity} - -%D \macros -%D {dobeginofprofile,doendofprofile} -%D -%D Profile support is still far from perfect. This is -%D especially due to the fact that the specification of -%D threads are sort of fuzzy and depend on the viewer. - -\definespecial\dobeginofprofile#1#2#3#4% label width height page - {\bgroup - \setPDFdestination{#1}% - \doifsomething{\PDFdestination} - {\PointsToBigPoints{#2}\width - \PointsToBigPoints{#3}\height - \special - {\@@insertpostscriptretain - [ /Title (\PDFdestination) - /Rect [0 0 \width\space\height] - /ARTICLE - pdfmark}}% - \egroup} - -\definespecial\doendofprofile% - {} - -%D Apart from movies, graphic inclusion is handled in the -%D \POSTSCRIPT\ drivers. We just link the movie annotation -%D handled to the file inclusion system. - -\definefileinsertion{yy}{mov}{\doPDFinsertmov} -\definefileinsertion{tr}{mov}{\doPDFinsertmov} - -\definefileinsertion{yy}{avi}{\doPDFinsertmov} -\definefileinsertion{tr}{avi}{\doPDFinsertmov} - -%D \macros -%D {doinsertsoundtrack} -%D -%D Sounds look much like movies: - -\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack} - -%D \macros -%D {dostartobject,dostopobject, -%D doinsertobject} -%D -%D Objects, those nice reusable pieces of text and graphics, -%D are handled by three specials: - -\definespecial\dostartobject#1#2#3#4#5% - {\bgroup - \setbox\nextbox=\hbox\bgroup - \bgroup - \PointsToBigPoints{#3}\width - \PointsToBigPoints{#4}\height - \PointsToBigPoints{#5}\depth - \dosetobjectreference{#1}{#2}{#1::#2}% - \special - {\@@insertpostscriptretain - [ /BBox [0 -\depth\space \width\space \height] - /_objdef {#1::#2} - /BP - pdfmark}% - \egroup} - -\definespecial\dostopobject% - {\special - {\@@insertpostscriptretain - [ /EP - pdfmark}% - \egroup - \smashbox\nextbox - \flushatshipout{\box\nextbox}% - \egroup} - -\definespecial\doinsertobject#1#2% - {\hbox - {\dogetobjectreference{#1}{#2}\PDFobjectreference - \ifx\PDFobjectreference\empty \else - \special - {\@@insertpostscriptretain - [ {\PDFobjectreference} - /SP - pdfmark}% - \fi}} - -%D \macros -%D {doinsertbookmark} -%D -%D Although personally I never use bookmarks, \CONTEXT\ does -%D support them, due to user requests. - -\definespecial\doinsertbookmark {\doPDFinsertbookmark} - -%D \macros -%D {dosetpagetransition} -%D -%D Page transitions, again a user wish, is taken care of by: - -\definespecial\dosetpagetransition{\doPDFsetpagetransition} - -%D \macros -%D {doinsertcomment, doflushcomments} -%D -%D I never needed (and used) one until now, but here is the -%D text annotation special: - -\definespecial\doinsertcomment{\doPDFinsertcomment} -\definespecial\doflushcomments{\doPDFflushcomments} - -%D \macros -%D {dopresetlinefield,dopresettextfield, -%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, -%D dopresetpushfield,dopresetcheckfield, -%D dopresetradiofield,dopresetradiorecord} -%D -%D There is nothing enervating to the next few mappings. - -\definespecial\dopresetlinefield {\doFDFpresetlinefield} -\definespecial\dopresettextfield {\doFDFpresettextfield} -\definespecial\dopresetchoicefield{\doFDFpresetchoicefield} -\definespecial\dopresetpopupfield {\doFDFpresetpopupfield} -\definespecial\dopresetcombofield {\doFDFpresetcombofield} -\definespecial\dopresetpushfield {\doFDFpresetpushfield} -\definespecial\dopresetcheckfield {\doFDFpresetcheckfield} -\definespecial\dopresetradiofield {\doFDFpresetradiofield} -\definespecial\dopresetradiorecord{\doFDFpresetradiorecord} - -%D \macros -%D {dodefinefieldset,dogetfieldset,doiffieldset} -%D -%D Field sets, used in resetting and submitting, are handled -%D by: - -\definespecial\dodefinefieldset{\doFDFdefinefieldset} -\definespecial\dogetfieldset {\doFDFgetfieldset} -\definespecial\doiffieldset {\doFDFiffieldset} - -%D \macros -%D {doregistercalculationset} -%D -%D The calculation order is defined using: - -\definespecial\doregistercalculationset{\doFDFregistercalculationset} - -%D \macros -%D {doPDFdestination} -%D -%D Last we implement the low level pdfmark macros. The -%D definitions are rather verbose. First the destination -%D macro. - -\def\doPDFdestination#1% - {\special - {\@@insertpostscriptretain - [ /Dest /#1\space - \PDFpageview - /DEST - pdfmark}} - -%D \macros -%D {doPDFaction,doPDFannotation,doPDFannotationobject, -%D ifsharePDFactions} -%D -%D We have three alternative annotation macros. The first -%D handles the goto ones, the second takes care of for instance -%D movies and the third is used in fields. - -\newcount\nofPDFsimilar - -\newif\ifsharePDFactions \sharePDFactionstrue - -\def\dodoPDFaction#1#2#3#4% - {\ifcollectreferenceactions - \xdef\lastPDFaction{#4}% - \else - \bgroup - % does not work well with distiller 4 - %\ifsharePDFactions - % \ifcase\similarreference\relax - % \xdef\lastPDFaction{<<#4>>}% - % \or - % \global\advance\nofPDFsimilar by 1 - % \special - % {\@@insertpostscriptretain - % [ /_objdef {PDF::sim:\the\nofPDFsimilar} /type /dict /OBJ pdfmark - % [ {PDF::sim:\the\nofPDFsimilar} <<#4>>\space /PUT pdfmark}% - % \xdef\lastPDFaction{{PDF::sim:\the\nofPDFsimilar}}% - % \else - % % leave \lastPDFaction untouched - % \fi - %\else - \xdef\lastPDFaction{<<#4>>}% - %\fi - \PointsToBigPoints{#2}\width - \PointsToBigPoints{#1}\height - \special - {\@@insertpostscriptretain - [ #1 - /Action \lastPDFaction\space - /Rect [0 0 \width\space \height] - /Border [0 0 0] - \ifhighlighthyperlinks \else /H /N \fi - /Subtype /Link - /ANN - pdfmark}% - \egroup - \fi} - -\def\doPDFaction#1#2#3% - {\dodoPDFaction\empty{#1}{#2}{#3}} - -\def\doPDFannotation#1#2#3% - {\bgroup - \PointsToBigPoints{#1}\width - \PointsToBigPoints{#2}\height - \special - {\@@insertpostscriptretain - [ /Rect [0 0 \width\space \height] #3 - /ANN - pdfmark}% - \egroup} - -\def\doPDFannotationobject#1#2#3#4#5% - {\bgroup - \PointsToBigPoints{#3}\width - \PointsToBigPoints{#4}\height - \special - {\@@insertpostscriptretain - [ /_objdef {#1::#2} - /Rect [0 0 \width\space \height] #5 - /ANN - pdfmark}% - \egroup - \dosetobjectreference{#1}{#2}{#1::#2}} - -\def\doPDFactionobject#1#2#3#4#5% - {\dodoPDFaction{/_objdef {#1::#2}}{#3}{#4}{#5}% - \dosetobjectreference{#1}{#2}{#1::#2}} - -%D \macros -%D {doPDFdictionaryobject,doPDFarrayobject} -%D -%D These two macros are used to build low level objects. - -\def\doPDFdictionaryobject#1#2#3% - {\special - {\@@insertpostscriptretain - [ /_objdef {#1::#2} /type /dict /OBJ pdfmark - [ {#1::#2} << #3 >> /PUT pdfmark}% - \dosetobjectreference{#1}{#2}{#1::#2}} - -\def\doPDFarrayobject#1#2#3% - {\special - {\@@insertpostscriptretain - [ /_objdef {#1::#2} /type /array /OBJ pdfmark - [ {#1::#2} 0 [#3] /PUTINTERVAL pdfmark}% - \dosetobjectreference{#1}{#2}{#1::#2}} - -%D \macros -%D {doPDFaddtocatalog,doPDFaddtoinfo, -%D doPDFpageattribute,doPDFpagesattribute} -%D -%D Next come our housekeeping macros. - -\def\doPDFaddtocatalog#1% - {\doifsomething{#1} - {\special - {\@@insertpostscriptretain - [ {Catalog} << #1 >> /PUT pdfmark}}} - -\def\doPDFaddtoinfo#1% unchecked - {\special - {\@@insertpostscriptretain - [ #1 /DOCINFO pdfmark}} % [ {DocInfo} << #1 >> /PUT pdfmark}} - -\def\doPDFpageattribute#1% - {\doifsomething{#1} - {\special - {\@@insertpostscriptretain - [ {ThisPage} << #1 >> /PUT pdfmark}}} - -\def\doPDFpageresource#1% - {\message{[skipping PDF resource]}} - -\def\doPDFpagesattribute#1% - {\doifsomething{#1} - {\special - {\@@insertpostscriptretain - [ #1 /PAGES pdfmark}}} - -\let\doPDFresetpageresources \relax -\let\doPDFresetpageattributes\relax - -%D \macros -%D {doPDFbookmark} -%D -%D This is how we force bookmarks entries in the file. - -\def\doPDFbookmark#1#2#3#4#5% - {\scratchcounter#4\advance\scratchcounter\minusone - \special - {\@@insertpostscriptretain - [ /Page \the\scratchcounter\space - \ifcase#2 \else/Count \ifcase#5-\fi#2 \fi - \PDFpageview - /Title (#3) - /OUT - pdfmark}} - -%D \macros -%D {defaultobjectreference,doPDFgetobjectreference} -%D -%D The object references are \type{{named}}, that is, no hard -%D coded numbers are needed (opposite to \PDFTEX). - -\def\defaultobjectreference#1#2{#1::#2} - -\def\doPDFgetobjectreference#1#2#3% - {\dogetobjectreference{#1}{#2}#3% - \ifx#3\empty\else\edef#3{{#3}}\fi} - %\edef#3{\ifx#3\empty null\else{#3}\fi}} - -% \def\doPDFgetobjectpage #1#2#3{..} -% \def\doPDFgetobjectpagereference#1#2#3{..} - -\def\doPDFgetpagereference#1#2% - {\edef#2{{page#1}}} - -%D Done. - -\stopspecials - -\protect \endinput diff --git a/tex/context/base/spec-ps.mkii b/tex/context/base/spec-ps.mkii new file mode 100644 index 000000000..803defe02 --- /dev/null +++ b/tex/context/base/spec-ps.mkii @@ -0,0 +1,229 @@ +%D \module +%D [ file=spec-ps, +%D version=1996.01.25, +%D title=\CONTEXT\ Special Macros, +%D subtitle=Adobe PostScript, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 \macros +%D {dostartgraymode,dostopgraymode, +%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode, +%D dostartrotation,dostoprotation, +%D dostartscaling,dostopscaling, +%D dostartmirroring,dostopmirroring, +%D dostartnegative,dostopnegative, +%D dostartoverprint,dostopoverprint, +%D doselectfirstpaperbin, +%D doselectsecondpaperbin} +%D +%D This implementation is straightforward and can be used as +%D a default with postscript||drivers. We use \type{ps:} as +%D opening, because most drivers support this. + +\startspecials[postscript] + +\def\@@insertpostscriptliteral {ps: } +\def\@@insertpostscriptretain {" } + +\definespecial\dostartgraymode#1% + {\special + {\@@insertpostscriptliteral + #1\space setgray}} + +\definespecial\dostopgraymode + {\special + {\@@insertpostscriptliteral + 0 setgray}} + +\definespecial\dostartrgbcolormode#1#2#3% + {\special + {\@@insertpostscriptliteral + #1\space #2\space #3\space setrgbcolor}} + +\definespecial\dostartcmykcolormode#1#2#3#4% + {\special + {\@@insertpostscriptliteral + #1\space #2\space #3\space #4\space setcmykcolor}} + +\definespecial\dostartgraycolormode#1% + {\special + {\@@insertpostscriptliteral + #1\space setgray}} + +\definespecial\dostopcolormode + {\special + {\@@insertpostscriptliteral + 0 setgray}} + +\definespecial\doselectfirstpaperbin + {\special + {\@@insertpostscriptliteral + statusdict begin 1 setpapertray end}} % checken + +\definespecial\doselectsecondpaperbin + {\special + {\@@insertpostscriptliteral + statusdict begin 0 setpapertray end}} % checken + +\definespecial\dostartrotation#1% straight from the YandY manual + {\special + {\@@insertpostscriptliteral + gsave currentpoint currentpoint translate + \number#1\space\space rotate neg exch neg exch translate}} + +\definespecial\dostoprotation + {\special + {\@@insertpostscriptliteral + currentfont currentpoint grestore moveto setfont}} + +\definespecial\dostartscaling#1#2% conforming the YandY manual + {\special + {\@@insertpostscriptliteral + gsave currentpoint currentpoint translate + #1\space #2\space scale neg exch neg exch translate}} + +\definespecial\dostopscaling + {\special + {\@@insertpostscriptliteral + currentfont currentpoint grestore moveto setfont}} + +\definespecial\dostartmirroring % some translate and exch stuff from YandY + {\special + {\@@insertpostscriptliteral + gsave currentpoint currentpoint translate + [-1 0 0 1 0 0] concat neg exch neg exch translate}} + +\definespecial\dostopmirroring + {\special + {\@@insertpostscriptliteral + currentfont currentpoint grestore moveto setfont}} + +\definespecial\dostartnegative + {\special{\@@insertpostscriptliteral gsave {1 exch sub} settransfer}} + +\definespecial\dostopnegative + {\special{\@@insertpostscriptliteral grestore}} + +\definespecial\dostartoverprint + {\special{\@@insertpostscriptliteral true setoverprint}} + +\definespecial\dostopoverprint + {\special{\@@insertpostscriptliteral false setoverprint}} + +\definespecial\dostartgraphicgroup + {\special{\@@insertpostscriptliteral gsave}} + +\definespecial\dostopgraphicgroup + {\special{\@@insertpostscriptliteral grestore}} + +%D \macros +%D {doovalbox} +%D +%D This implementation is a mixture of several possible +%D implementations. We use some constants that may not be +%D changed. It took some time to find them, but these values +%D offer quite accurate results. The macro calls for +%D \type{\forgetall}, which resets indentation, skips and +%D \type{\everypar}. +%D +%D Because a stroke follows the line, we correct for half of +%D the linewidth. Furthermore we use scaling to overcome some +%D limitations in the precision ($<1$~sp) and to prevent +%D rounding errors. We also do some correction for large +%D values. We let PostScript compare some arguments with +%D \type{a b eq {action} fi}. +%D +%D The path is based on a macro of J.~Hefferon cs. We also +%D tried the D.~Salomon implementation, but this did not work +%D well, just like some other alternatives. + +% #1 = width #2 = height #3 = depth +% #4 = linewidth #5 = radius +% #5 = stroke (ja,nee) #7 = fill (ja,nee) + +\def\@@insertpostscriptliteral {ps: } +\def\@@insertpostscriptretain {postscript } % unknown + +\def\dosomeovalcalc#1#2#3% + {\dimen2=#1% + \advance\dimen2 #2% + \PointsToBigPoints{\dimen2}#3} + +\def\dosomeovalbox#1#2#3#4#5#6#7#8% variant not yet supported + {\bgroup + \dimen0=#4\divide\dimen0 2 + \dosomeovalcalc{0pt}{+\dimen0}\xmin + \dosomeovalcalc{#1}{-\dimen0}\xmax + \dosomeovalcalc{#2}{-\dimen0}\ymax + \dosomeovalcalc{-#3}{+\dimen0}\ymin + \dosomeovalcalc{#4}{0pt}\stroke + \dosomeovalcalc{#5}{0pt}\radius + \edef\dostroke{#6}% + \edef\dofill{#7}% + \setbox\nextbox\hbox + {\ifnum\dostroke\dofill>0 + \special + {\@@insertpostscriptretain + gsave + newpath + \xmin\space \radius\space add \ymin\space moveto + \xmax\space \ymin\space \xmax\space \ymax\space \radius\space arcto + \xmax\space \ymax\space \xmin\space \ymax\space \radius\space arcto + \xmin\space \ymax\space \xmin\space \ymin\space \radius\space arcto + \xmin\space \ymin\space \xmax\space \ymin\space \radius\space arcto + \xmin\space \radius\space add \ymin\space moveto + 16 {pop} repeat + closepath + (\dostroke) (1) eq + {\stroke\space 0 ne + {gsave + \stroke\space setlinewidth + stroke + grestore} if} if + (\dofill) (1) eq + {fill} if + grestore}% + \fi}% + \nextboxwd#1% + \nextboxht#2% + \nextboxdp#3% + \flushnextbox + \egroup} + +%D The indirect call permits a (rather) dirty hack, needed +%D for \DVIPS\ support. + +\definespecial\doovalbox + {\dosomeovalbox} + +%D \macros +%D {dostartclipping,dostopclipping} +%D +%D These two specials are not yet working as expected. + +\definespecial\dostartclipping#1#2#3% + {\PointsToBigPoints{#2}\width + \PointsToBigPoints{#3}\height + \grabMPclippath{#1}{0}{\width}{\height} + {0 0 moveto \width 0 lineto \width \height lineto 0 \height\space lineto}% + \special + {\@@insertpostscriptliteral\space + save newpath \MPclippath\space closepath clip}} + +\definespecial\dostopclipping + {\special{\@@insertpostscriptliteral\space restore}} + +%D Some MP stuff: + +\definespecial\doinsertMPfile#1% + {\doiffileelse{./#1}{\includeMPasEPS{./#1}}{\message{[MP #1]}}} + +\stopspecials + +\endinput diff --git a/tex/context/base/spec-ps.tex b/tex/context/base/spec-ps.tex deleted file mode 100644 index 803defe02..000000000 --- a/tex/context/base/spec-ps.tex +++ /dev/null @@ -1,229 +0,0 @@ -%D \module -%D [ file=spec-ps, -%D version=1996.01.25, -%D title=\CONTEXT\ Special Macros, -%D subtitle=Adobe PostScript, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 \macros -%D {dostartgraymode,dostopgraymode, -%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode, -%D dostartrotation,dostoprotation, -%D dostartscaling,dostopscaling, -%D dostartmirroring,dostopmirroring, -%D dostartnegative,dostopnegative, -%D dostartoverprint,dostopoverprint, -%D doselectfirstpaperbin, -%D doselectsecondpaperbin} -%D -%D This implementation is straightforward and can be used as -%D a default with postscript||drivers. We use \type{ps:} as -%D opening, because most drivers support this. - -\startspecials[postscript] - -\def\@@insertpostscriptliteral {ps: } -\def\@@insertpostscriptretain {" } - -\definespecial\dostartgraymode#1% - {\special - {\@@insertpostscriptliteral - #1\space setgray}} - -\definespecial\dostopgraymode - {\special - {\@@insertpostscriptliteral - 0 setgray}} - -\definespecial\dostartrgbcolormode#1#2#3% - {\special - {\@@insertpostscriptliteral - #1\space #2\space #3\space setrgbcolor}} - -\definespecial\dostartcmykcolormode#1#2#3#4% - {\special - {\@@insertpostscriptliteral - #1\space #2\space #3\space #4\space setcmykcolor}} - -\definespecial\dostartgraycolormode#1% - {\special - {\@@insertpostscriptliteral - #1\space setgray}} - -\definespecial\dostopcolormode - {\special - {\@@insertpostscriptliteral - 0 setgray}} - -\definespecial\doselectfirstpaperbin - {\special - {\@@insertpostscriptliteral - statusdict begin 1 setpapertray end}} % checken - -\definespecial\doselectsecondpaperbin - {\special - {\@@insertpostscriptliteral - statusdict begin 0 setpapertray end}} % checken - -\definespecial\dostartrotation#1% straight from the YandY manual - {\special - {\@@insertpostscriptliteral - gsave currentpoint currentpoint translate - \number#1\space\space rotate neg exch neg exch translate}} - -\definespecial\dostoprotation - {\special - {\@@insertpostscriptliteral - currentfont currentpoint grestore moveto setfont}} - -\definespecial\dostartscaling#1#2% conforming the YandY manual - {\special - {\@@insertpostscriptliteral - gsave currentpoint currentpoint translate - #1\space #2\space scale neg exch neg exch translate}} - -\definespecial\dostopscaling - {\special - {\@@insertpostscriptliteral - currentfont currentpoint grestore moveto setfont}} - -\definespecial\dostartmirroring % some translate and exch stuff from YandY - {\special - {\@@insertpostscriptliteral - gsave currentpoint currentpoint translate - [-1 0 0 1 0 0] concat neg exch neg exch translate}} - -\definespecial\dostopmirroring - {\special - {\@@insertpostscriptliteral - currentfont currentpoint grestore moveto setfont}} - -\definespecial\dostartnegative - {\special{\@@insertpostscriptliteral gsave {1 exch sub} settransfer}} - -\definespecial\dostopnegative - {\special{\@@insertpostscriptliteral grestore}} - -\definespecial\dostartoverprint - {\special{\@@insertpostscriptliteral true setoverprint}} - -\definespecial\dostopoverprint - {\special{\@@insertpostscriptliteral false setoverprint}} - -\definespecial\dostartgraphicgroup - {\special{\@@insertpostscriptliteral gsave}} - -\definespecial\dostopgraphicgroup - {\special{\@@insertpostscriptliteral grestore}} - -%D \macros -%D {doovalbox} -%D -%D This implementation is a mixture of several possible -%D implementations. We use some constants that may not be -%D changed. It took some time to find them, but these values -%D offer quite accurate results. The macro calls for -%D \type{\forgetall}, which resets indentation, skips and -%D \type{\everypar}. -%D -%D Because a stroke follows the line, we correct for half of -%D the linewidth. Furthermore we use scaling to overcome some -%D limitations in the precision ($<1$~sp) and to prevent -%D rounding errors. We also do some correction for large -%D values. We let PostScript compare some arguments with -%D \type{a b eq {action} fi}. -%D -%D The path is based on a macro of J.~Hefferon cs. We also -%D tried the D.~Salomon implementation, but this did not work -%D well, just like some other alternatives. - -% #1 = width #2 = height #3 = depth -% #4 = linewidth #5 = radius -% #5 = stroke (ja,nee) #7 = fill (ja,nee) - -\def\@@insertpostscriptliteral {ps: } -\def\@@insertpostscriptretain {postscript } % unknown - -\def\dosomeovalcalc#1#2#3% - {\dimen2=#1% - \advance\dimen2 #2% - \PointsToBigPoints{\dimen2}#3} - -\def\dosomeovalbox#1#2#3#4#5#6#7#8% variant not yet supported - {\bgroup - \dimen0=#4\divide\dimen0 2 - \dosomeovalcalc{0pt}{+\dimen0}\xmin - \dosomeovalcalc{#1}{-\dimen0}\xmax - \dosomeovalcalc{#2}{-\dimen0}\ymax - \dosomeovalcalc{-#3}{+\dimen0}\ymin - \dosomeovalcalc{#4}{0pt}\stroke - \dosomeovalcalc{#5}{0pt}\radius - \edef\dostroke{#6}% - \edef\dofill{#7}% - \setbox\nextbox\hbox - {\ifnum\dostroke\dofill>0 - \special - {\@@insertpostscriptretain - gsave - newpath - \xmin\space \radius\space add \ymin\space moveto - \xmax\space \ymin\space \xmax\space \ymax\space \radius\space arcto - \xmax\space \ymax\space \xmin\space \ymax\space \radius\space arcto - \xmin\space \ymax\space \xmin\space \ymin\space \radius\space arcto - \xmin\space \ymin\space \xmax\space \ymin\space \radius\space arcto - \xmin\space \radius\space add \ymin\space moveto - 16 {pop} repeat - closepath - (\dostroke) (1) eq - {\stroke\space 0 ne - {gsave - \stroke\space setlinewidth - stroke - grestore} if} if - (\dofill) (1) eq - {fill} if - grestore}% - \fi}% - \nextboxwd#1% - \nextboxht#2% - \nextboxdp#3% - \flushnextbox - \egroup} - -%D The indirect call permits a (rather) dirty hack, needed -%D for \DVIPS\ support. - -\definespecial\doovalbox - {\dosomeovalbox} - -%D \macros -%D {dostartclipping,dostopclipping} -%D -%D These two specials are not yet working as expected. - -\definespecial\dostartclipping#1#2#3% - {\PointsToBigPoints{#2}\width - \PointsToBigPoints{#3}\height - \grabMPclippath{#1}{0}{\width}{\height} - {0 0 moveto \width 0 lineto \width \height lineto 0 \height\space lineto}% - \special - {\@@insertpostscriptliteral\space - save newpath \MPclippath\space closepath clip}} - -\definespecial\dostopclipping - {\special{\@@insertpostscriptliteral\space restore}} - -%D Some MP stuff: - -\definespecial\doinsertMPfile#1% - {\doiffileelse{./#1}{\includeMPasEPS{./#1}}{\message{[MP #1]}}} - -\stopspecials - -\endinput diff --git a/tex/context/base/spec-tpd.mkii b/tex/context/base/spec-tpd.mkii new file mode 100644 index 000000000..597993e0a --- /dev/null +++ b/tex/context/base/spec-tpd.mkii @@ -0,0 +1,1334 @@ +%D \module +%D [ file=spec-tpd, +%D version=1996.01.25, +%D title=\CONTEXT\ Special Macros, +%D subtitle=\PDFTEX, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% once we can be sure that the latest versions of pdftex are +% available we can use: +% +% \pdfobj reserveobjnum \edef\one{\the\pdflastobj} +% \pdfobj reserveobjnum \edef\two{\the\pdflastobj} +% +% \pdfobj useobjnum \one {x} +% \pdfobj useobjnum \two {x} +% +% we then can rewrite part of spec-fdf because the other drivers +% already support symbolic references + +% layers and links don't work while the spec says they should + +% method = auto +% +% \definefileinsertion{tpd}{auto}% +% {\executesystemcommand{t:/ruby/pstopdf.rb #2}% +% \dofileinsertion{tpd}{pdf}} + +% \let\PDFdestvoffset\zeropoint +% \newbox\pdfdestbox +% +% \def\doPDFdestination#1% +% {\ifdim\PDFdestvoffset=\zeropoint\relax +% \pdfdest name {#1}\PDFpageviewkey +% \else +% \setbox\pdfdestbox\hbox to \zeropoint +% {\raise\PDFdestvoffset\hbox{\pdfdest name {#1}\PDFpageviewkey}}% +% \ht\pdfdestbox\zeropoint +% \box\pdfdestbox +% \fi} +% +% \def\PDFdestvoffset{2\lineheight} % {1.5\strutht} + +%D \macros +%D {jobsuffix} +%D +%D Being one of the first typographical systems able to support +%D advances \PDF\ support, \TEX\ is also one of the first +%D systems to produce high quality \PDF\ code directly. Thanks +%D to Han The Thanh c.s. the \TEX\ community can leap forward +%D once again. +%D +%D One important characteristic of \PDFTEX\ is that is can +%D produce standard \DVI\ code as well as \PDF\ code. This +%D enables us to use one format file to support both output +%D formats. + +%D All modules in this group use specials to tell drivers what +%D non||\TEX\ actions to take. Because from the \TEX\ point of +%D view, there is no difference between \DVI\ and \PDF, we +%D therefore only have to bend the \DVI\ driver support into +%D \PDF\ support. Technically spoken, specials no longer serve +%D a purpose, except from ending up as comment in the \PDF\ +%D file. +%D +%D Before we continue we need to make sure if indeed those +%D \PDFTEX\ primitives are permitted. If no primitives are +%D available, we just stop reading any further. + +\unprotect + +\ifx\pdftexversion\undefined + \writestatus\m!systems{you should use pdfTeX binaries}\wait + \protect\expandafter\endinput +\fi + +\ifnum\pdftexversion<13 + \writestatus\m!systems{your pdfTeX version is much too old}\wait + \protect\expandafter\endinput +\fi + +\ifnum\pdftexversion<14 + \writestatus\m!systems{please update your pdfTeX binaries} +\fi + +\ifnum\pdftexversion>19 + \pdfhorigin=1 true in + \pdfvorigin=1 true in +\fi + +%D We default to 300 dots per inch image resolution and 600 dpi +%D bitmap fonts (when asked for). + +\ifx\pdfimageresolution\undefined \newcount\pdfimageresolution \fi +\ifx\pdfpkresolution \undefined \newcount\pdfpkresolution \fi + +\pdfimageresolution=300 +\pdfpkresolution =600 + +%D Another downward compatible hack: + +\ifx\pdflastximagepages\undefined + \newcount\pdflastximagepages \pdflastximagepages=1 +\fi + +%D And: + +\ifx\pdfpageresources\undefined + \newtoks\pdfpageresources +\fi + +%D In order to get high quality \METAPOST\ inclusion, we set +%D the number of digits to~5 (prevents rounding errors). + +\ifx\pdfdecimaldigits\undefined + \newcount\pdfdecimaldigits +\fi + +\pdfdecimaldigits=10 + +\ifx\pdfinclusionerrorlevel\undefined + \ifx\pdfoptionpdfinclusionerrorlevel\undefined + \newcount\pdfinclusionerrorlevel + \else + \let\pdfinclusionerrorlevel\pdfoptionpdfinclusionerrorlevel + \fi +\fi + +\pdfinclusionerrorlevel=0 + +\ifx\pdfminorversion\undefined + \ifx\pdfoptionpdfminorversion\undefined + \newcount\pdfminorversion + \else + \let\pdfminorversion\pdfoptionpdfminorversion + \fi +\fi + +\pdfminorversion=5 + +\def\PDFversion{1.\number\pdfminorversion} + +% %D Why are the Acrobat viewers so buggy? To prevent font cache +% %D mismatches, we say: +% +% \ifx\pdfuniqueresname\undefined \else +% \pdfuniqueresname=1 +% \fi + +%D Once we are sure that we're indeed supporting \PDFTEX, we +%D force \PDF\ output at the highest compression. For debugging +%D purposes one can set the compresslevel to~0. We also have to +%D make sure no other specials are supported, else \PDFTEX\ +%D will keep on telling us that we're wrong. We also load the +%D general \PDF\ macros that are shared between this driver and +%D the \ACROBAT\ one. + +\startspecials[tpd][reset,fdf] + +%D This means that by saying +%D +%D \starttyping +%D \usespecials[tpd] +%D \stoptyping +%D +%D we get ourselves full \PDF\ output. + +%D For some internal testing we need to know the output +%D suffix. + +\setjobsuffix{pdf} + +%D We don't use specials here, which means that we must flush +%D settings before the page is shipped out. + +\specialbasedsettingsfalse + +%D Some more internal settings. + +\appendtoksonce + \pdfoutput\zerocount +\to \everyresetspecials + +\pdfoutput=1 % we reset that one with \everyresetspecials + +%D Just in case we mimmick specials, we have to make sure no +%D default specials end up in the process. + +\let\defaultspecial=\gobbleoneargument + +\appendtoksonce + \let\defaultspecial\normalspecial +\to \everyresetspecials + +\let\PDFcode \pdfliteral +\def\PDFcontentcode{\pdfliteral} +\def\PDFdirectcode {\pdfliteral direct} + +%D \macros +%D {everyPDFximage} +%D +%D This token register is flushed before an ximage is loaded. + +\ifdefined\everyPDFximage \else \newtoks\everyPDFximage \fi +\ifdefined\everyPDFxform \else \newtoks\everyPDFxform \fi + +%D \macros +%D {dosetuppaper} +%D +%D If we don't set the paper size, \PDFTEX\ will certainly do +%D it in a way we don't want, therefore we need: + +\definespecial\dosetuppaper#1#2#3% + {\global\pdfpagewidth #2\relax + \global\pdfpageheight#3\relax} + +%D \macros +%D {doloadmapfile,doloadmapline,doresetmapfilelist} + +\ifx\pdfmapfile\undefined \let\pdfmapfile\gobbletwoarguments \fi +\ifx\pdfmapline\undefined \let\pdfmapline\gobbletwoarguments \fi + +\definespecial\doresetmapfilelist + {\global\let\doresetmapfilelist\relax + \pdfmapfile{original-empty.map}} + +\ifnum\pdftexversion<120 + + \definespecial\doloadmapfile #1#2{\pdfmapfile{+#2}} + \definespecial\doloadmapline #1#2{} + +\else + + \definespecial\doloadmapfile #1#2{\pdfmapfile{#1#2}} + \definespecial\doloadmapline #1#2{\pdfmapline{#1#2}} + +\fi + +%D nasty but needed + +\appendtoksonce \loadallfontmapfiles \to \everyPDFximage +\appendtoksonce \loadallfontmapfiles \to \everyPDFxform + +%D \macros +%D {doinsertfile,dogetnofinsertpages} +%D +%D Graphics are not part of \TEX\ and therefore not part of the +%D \DVI\ standard. \PDF\ on the other hand has several graphic +%D primitives. During the multi||step process \TEX\ +%D $\rightarrow$ \DVI\ $\rightarrow$ \POSTSCRIPT\ $\rightarrow$ +%D \PDF\ one can insert graphics using specials. In \PDFTEX\ +%D however there is only one step! This means that \PDFTEX\ +%D itself has to do the inclusion. +%D +%D At the moment \PDFTEX\ supports inclusion of bitmap \PNG\ +%D graphics as well as not too complicated \PDF\ code. Using +%D this last option, we are able to include both \METAPOST\ and +%D \PDF\ output produced by \GHOSTSCRIPT. +%D +%D We fall back on the generic \CONTEXT\ module supp-pdf to +%D accomplish \PDF\ inclusion. The methods implemented there +%D are hooked into both the figure placement mechanisms of +%D \CONTEXT\ and the specials inclusion mechanism. + +\definespecial\doinsertfile + {\dofileinsertion{tpd}{\truegraphictype\@@DriverImageType}} + +%D The number of pages in (for instance an \PDF) insert +%D file, can be asked for using: + +\definespecial\dogetnofinsertpages#1% + {\xdef\nofinsertpages{1}% global + \doifvalidpdfimagefileelse{#1}% + {\pdfximage{#1}\xdef\nofinsertpages{\the\pdflastximagepages}} + {}} + +%D Currently we support \type{pdf} for \PDF\ files, \type{mps} +%D for \METAPOST\ graphics, \type{png} and \type{jpg} for +%D bitmap graphics. + +\definefileinsertion{tpd}{mps} + {\hbox + {\convertMPtoPDF\@@DriverImageFile{1}{1}% + \global\let\PDFimagereference\empty}} + +\definefileinsertion{tpd}{pdf}{\handlepdfimage} +\definefileinsertion{tpd}{png}{\handlepdfimage} +\definefileinsertion{tpd}{jpg}{\handlepdfimage} +\definefileinsertion{tpd}{jb2}{\handlepdfimage} + +% \definefileinsertion{tpd}{jpeg} {\handlepdfimage} +% \definefileinsertion{tpd}{jbig2}{\handlepdfimage} + +%D Experimental: + +%D The main file insertion macro is as follows. Because +%D \PDFTEX\ does not support arbitrary suffixes, we double +%D check on a user supplied filename, because \PDFTEX\ chokes +%D on unknown suffixes. + +\def\doifvalidpdfimagefileelse#1% todo: greedy split + {\doiffileelse{#1} + {\edef\filesuffix{#1}% + \doloop + {\@EA\aftersplitstring\filesuffix\at.\to\temp + \ifx\temp\empty + \exitloop + \else + \lowercasestring\temp\to\filesuffix % insertion check also needs lowercase + % a temporary hack + \doif\filesuffix{pdf}{\pdfimageresolution72}% + % because pdfTeX scales back + \fi}} + {\let\filesuffix\s!unknown}% + \doiffileinsertionsupportedelse\filesuffix} + +\ifx\pdflastximagepages\undefined \chardef\pdflastximagepages=1 \fi + +\def\checkpdfimagepagenumber + {\edef\pdfimagepagenumber + {\ifx\@@DriverImagePage\empty\else\ifnum\@@DriverImagePage>\zerocount + \space page\space\@@DriverImagePage\space + \fi\fi}} + +\ifnum\pdftexversion>13 + + \def\handlepdfimage + {\bgroup + \the\everyPDFximage + \doifvalidpdfimagefileelse\@@DriverImageFile + {\checkpdfimagepagenumber + \ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi + \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \fi + \ifdim\@@DriverImageHeight>\zeropoint \!!height\@@DriverImageHeight\fi + \pdfimagepagenumber + \@@DriverImageBox + {\@@DriverImageFile} + \xdef\PDFimagereference{\the\pdflastximage}% + \xdef\nofinsertpages{\the\pdflastximagepages}% + \pdfrefximage\pdflastximage} + {\framed[\c!width=\@@DriverImageWidth,\c!height=\@@DriverImageHeight]{\@@DriverImageFile}}% + \egroup} + +\else + + \def\handlepdfimage + {\bgroup + \doifvalidpdfimagefileelse\@@DriverImageFile + {\pdfimage + \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \fi + \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight\fi + {\@@DriverImageFile}}% + {\framed[\c!width=\@@DriverImageWidth,\c!height=\@@DriverImageHeight]{\@@DriverImageFile}}% + \egroup} + +\fi + +%D As we will see now, \PDFTEX\ not only directly supports +%D \type{mps}, \type{png}, \type{pdf}, \type{jpg} but also +%D \type{mov}. In \CONTEXT\ we support movie inserts in a way +%D similar to figure inclusion. The next macro calls the +%D general \PDF\ one. + +\definefileinsertion{tpd}{mov}{\doPDFinsertmov} +\definefileinsertion{tpd}{avi}{\doPDFinsertmov} + +%D \macros +%D {doinsertsoundtrack} +%D +%D We use numbers instead of labels to keep track of sounds. + +\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack} + +%D For the moment we don't test for alternatives that +%D themselves have alternatives, especially cylcic +%D dependencies. + +% some day we will do a proper check on bitmap depth, +% +% \pdfobj reserveobjnum\relax +% \pdfximage colorspace \pdflastobj {some file} +% ... \pdflastximagecolordepth ... +% \immediate\pdfobj useobjnum \pdflastobj {some spec} + +\ifx\@@DriverImageBox\undefined \def\@@DriverImageBox{artbox} \fi + +\def\pdfimmediateximage{\immediate\pdfximage} + +\ifnum\pdftexversion>13 + + \def\checkpdfimageattributes + {\ifx\PDFfigurereference\empty + \global\let\pdfimageattributes\empty + \else + \immediate\pdfobj + {[ << /Image \PDFobjref\PDFfigurereference + /DefaultForPrinting true >> ]}% + \xdef\pdfimageattributes + {attr {/Alternates \PDFobjref\pdflastobj}}% + \fi} + + \global\let\PDFimagecolorreference\empty + + \def\checkpdfimagecolorspecs + {\ifx\pdflastximagecolordepth \undefined + \global\let\pdfimagecolorspecs\empty + \else\ifx\PDFimagecolorreference\empty + \global\let\pdfimagecolorspecs\empty + \else + \xdef\pdfimagecolorspecs{colorspace \PDFimagecolorreference\space}% + \fi\fi + \global\let\PDFimagecolorreference\empty} + + \def\dogetTPDfiguresize + {\doifvalidpdfimagefileelse\@@DriverImageFile + {\ifvoid\foundexternalfigure + \donetrue + \else\ifx\PDFfigurereference\empty + \donetrue + \else + % hm, is this still needed + \doifinstringelse\filesuffix{\c!png,\c!jpg}\donetrue\donefalse + \fi\fi} + {\donefalse}% + \ifdone + \the\everyPDFximage + \checkpdfimageattributes + \checkpdfimagecolorspecs + \checkpdfimagepagenumber + \global\setbox\foundexternalfigure\hbox + {\ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi + \pdfimageattributes + \pdfimagecolorspecs + \pdfimagepagenumber + \@@DriverImageBox + {\@@DriverImageFile}% + \xdef\PDFimagereference{\the\pdflastximage}% + \xdef\nofinsertpages{\the\pdflastximagepages}% + \pdfrefximage\pdflastximage}% + \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}% + \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}% + \global\let\PDFfigurereference\empty + \global\let\PDFimageattributes\empty + \else + \global\let\analyzedfigurewidth \!!zeropoint + \global\let\analyzedfigureheight\!!zeropoint + \fi} + +\else + + \def\dogetTPDfiguresize + {\doifvalidpdfimagefileelse\@@DriverImageFile + {\global\setbox\foundexternalfigure\vbox{\pdfimage{\@@DriverImageFile}}% + \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}% + \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}} + {\global\let\analyzedfigurewidth \!!zeropoint + \global\let\analyzedfigureheight\!!zeropoint}} + +\fi + +\definefilechecker{tpd}{pdf}{\dogetTPDfiguresize} +\definefilechecker{tpd}{png}{\dogetTPDfiguresize} +\definefilechecker{tpd}{jpg}{\dogetTPDfiguresize} +\definefilechecker{tpd}{jb2}{\dogetTPDfiguresize} + +\definespecial\dogetfiguresize + {\dofilechecker{tpd}{\truegraphictype\@@DriverImageType}} + +%D \macros +%D {doregisterfigure} +%D +%D Here is the fuzzy, very special dependant figure +%D registration special. We need to refer to the innermost +%D object (ximage). + +\ifnum\pdftexversion>13 + + \definespecial\doregisterfigure#1#2% + {\doifundefined{IM::#1::#2} + {\setxvalue{IM::#1::#2}{\the\pdflastximage}}% + \xdef\PDFfigurereference{\getvalue{IM::#1::#2}}} + +\fi + +%D \macros +%D {doovalbox} +%D +%D Drawing frames with round corners is inherited from the +%D main module. + +\definespecial\doovalbox {\doPDFovalbox} + +%D \macros +%D {dostartgraymode,dostopgraymode, +%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode, +%D dostopcolormode, +%D dostartrotation,dostoprotation, +%D dostartscaling,dostopscaling, +%D dostartmirroring,dostopmirroring, +%D dostartnegative,dostopnegative, +%D dostartoverprint,dostopoverprint} +%D +%D These are implemented in the main \PDF\ module. + +\definespecial\dostartgraymode {\doPDFstartgraymode} +\definespecial\dostopgraymode {\doPDFstopgraymode} +\definespecial\dostartrgbcolormode {\doPDFstartrgbcolormode} +\definespecial\dostartcmykcolormode{\doPDFstartcmykcolormode} +\definespecial\dostartgraycolormode{\doPDFstartgraycolormode} +\definespecial\dostartspotcolormode{\doPDFstartspotcolormode} +\definespecial\dostopcolormode {\doPDFstopcolormode} +\definespecial\dostartrotation {\doPDFstartrotation} +\definespecial\dostoprotation {\doPDFstoprotation} +\definespecial\dostartscaling {\doPDFstartscaling} +\definespecial\dostopscaling {\doPDFstopscaling} +\definespecial\dostartmirroring {\doPDFstartmirroring} +\definespecial\dostopmirroring {\doPDFstopmirroring} +\definespecial\dostartnegative {\doPDFstartnegative} +\definespecial\dostopnegative {\doPDFstopnegative} +\definespecial\dostartoverprint {\doPDFstartoverprint} +\definespecial\dostopoverprint {\doPDFstopoverprint} + +\definespecial\doregistercmykspotcolor{\doPDFregistercmykspotcolor} +\definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor} +\definespecial\doregistergrayspotcolor{\doPDFregistergrayspotcolor} + +\definespecial\doregistercmykindexcolor{\doPDFregistercmykindexcolor} +\definespecial\doregisterrgbindexcolor {\doPDFregisterrgbindexcolor} +\definespecial\doregistergrayindexcolor{\doPDFregistergrayindexcolor} + +\definespecial\doregisterfigurecolor{\doPDFregisterfigurecolor} + +\definespecial\dostartnonecolormode{\doPDFstartnonecolormode} +\definespecial\doregisternonecolor {\doPDFregisternonecolor} + +\def\doPDFregisterspotcolorname#1#2% no need for escape in luatex + {\bgroup + \let\ascii\empty + \def\docommand##1% + {\edef\ascii{\ascii + \ifx\nexthandledtoken\space + \letterhash20% + \else\ifx\nexthandledtoken\blankspace + \letterhash20% + \else + ##1% + \fi\fi}}% + \expanded{\handletokens#2}\with\docommand + \letgvalue{@@pdf@@scn@@#1}\ascii + \egroup} + +\def\doPDFregistersomespotcolor#1#2#3#4#5#6#7% name fractions names p's space domain function + {\bgroup + \let\spotpops\empty + \ifcase#2\or + %def\PDFspotcolornames{/Separation /#1}% + \edef\PDFspotcolornames{/Separation /\executeifdefined{@@pdf@@scn@@#1}{#1}}% + \def\PDFspotcolordomain{0.0 1.0}% + \else + \dorecurse{#2}{\edef\spotpops{\spotpops pop }}% + \let\PDFspotcolornames \empty + \let\PDFspotcolordomain\empty + \def\dospotcolorcommand##1% + {\edef\PDFspotcolornames {\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}% + \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}% + \processcommacommand[#3]\dospotcolorcommand + \edef\PDFspotcolornames{/DeviceN [\PDFspotcolornames]}% + \fi + \immediate \pdfobj stream attr + {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}% + \immediate \pdfobj + {[\PDFspotcolornames\space /Device#5 \PDFobjref\pdflastobj]}% + \dosetobjectreference{PDFCS}{#1}{\the\pdflastobj}% + \appendtoPDFdocumentcolorspaces{/#1 \PDFobjref\pdflastobj}% + \egroup} + +%D New and very experimental. + +% \def\doPDFregistersomeindexcolor#1#2#3#4#5#6#7% name fractions names p's space domain function +% {\bgroup +% \let\spotpops\empty +% \dorecurse{#2}{\edef\spotpops{\spotpops exch pop\space}}% +% \let\PDFspotcolornames \empty +% \let\PDFspotcolordomain\empty +% \def\docommand##1% +% {\edef\PDFspotcolornames{\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}% +% \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}% +% \processcommacommand[#3,None]\docommand +% \let\PDFcolorindexvector\empty +% \def\docommand##1% +% {\scratchdimen##1\points +% \scratchdimen\recurselevel\scratchdimen +% \scratchcounter\scratchdimen +% \divide\scratchcounter \maxcard +% \edef\PDFcolorindexvector{\PDFcolorindexvector\uchexnumbers\scratchcounter}}% +% \dostepwiserecurse\zerocount{255}\plusone +% {\rawprocesscommacommand[#4,1]\docommand +% \xdef\PDFcolorindexvector{\PDFcolorindexvector\space}}% +% \immediate \pdfobj stream attr +% {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}% +% \immediate \pdfobj +% {[/Indexed +% [/DeviceN [\PDFspotcolornames] /Device#5 \PDFobjref\pdflastobj] % +% 255 <\PDFcolorindexvector>]}% +% \dosetobjectreference{PDFIX}{#1}{\the\pdflastobj}% +% \appendtoPDFdocumentcolorspaces{/#1_INDEXED \PDFobjref\pdflastobj}% +% \egroup} + +% we reverse the index; an alternative is to negate the graphic itself (\start/stop negative) + +\def\doPDFregistersomeindexcolor#1#2#3#4#5#6#7% name fractions names p's space domain function + {\bgroup + \let\spotpops\empty + \dorecurse{#2}{\edef\spotpops{\spotpops exch pop\space}}% + \let\PDFspotcolornames \empty + \let\PDFspotcolordomain\empty + \def\docommand##1% + {%\edef\PDFspotcolornames {\PDFspotcolornames/##1\space}% + \edef\PDFspotcolornames{\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}% + \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}% + \processcommacommand[#3,None]\docommand + \let\PDFcolorindexvector\empty + \def\docommand##1% + {\scratchdimen##1\points + \scratchdimen\recurselevel\scratchdimen + \scratchcounter\scratchdimen + \divide\scratchcounter \maxcard + \edef\PDFcolorindexvector{\PDFcolorindexvector\uchexnumbers\scratchcounter}}% + %\dostepwiserecurse\zerocount{255}\plusone + \dostepwiserecurse{255}\zerocount\minusone % we need to negate + {\rawprocesscommacommand[#4,1]\docommand + \xdef\PDFcolorindexvector{\PDFcolorindexvector\space}}% + \immediate \pdfobj stream attr + {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}% + \immediate \pdfobj + {[/Indexed + [/DeviceN [\PDFspotcolornames] /Device#5 \the\pdflastobj\space0 R] % + 255 <\PDFcolorindexvector>]}% + \dosetobjectreference{PDFIX}{#1}{\the\pdflastobj}% + \appendtoPDFdocumentcolorspaces{/#1_INDEXED \the\pdflastobj\space0 R}% + \egroup} + +%D \macros +%D {dostarttransparency,dostoptransparency} +%D +%D For transparency, we need to implement a couple of +%D auxiliary macros. If needed, we will generalize them later. + +\definespecial\dostarttransparency{\doPDFstarttransparency} +\definespecial\dostoptransparency {\doPDFstoptransparency} + +\PDFtransparencysupportedtrue + +\def\@@PDT{@PDT@} + +\ifx\PDFcurrenttransparency\undefined + \newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1 +\fi + +\def\assignPDFtransparency#1#2% + {\edef\PDFtransparencyidentifier{/Tr#1}% + \edef\PDFtransparencyreference{\PDFobjref{#2}}} + +\def\presetPDFtransparency#1#2% + {\initializePDFtransparency + \executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}} + +\def\dopresetPDFtransparency#1#2% + {\global\advance\PDFcurrenttransparency \plusone + \immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}% + \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}% + \edef\PDFtransparencyreference {\PDFobjref\pdflastobj}% + \setxvalue{\@@PDT#1:#2}% + {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\pdflastobj}}% + \appendtoPDFdocumentextgstates + {\PDFtransparencyidentifier\space + \PDFtransparencyreference\space}} + +\def\initializePDFtransparency + {\immediate\pdfobj{\PDFtransparancydictionary{1}{1}{/AIS false}}% + \xdef\PDFtransparencyresetidentifier{/Tr0}% + \xdef\PDFtransparencyresetreference{\PDFobjref\pdflastobj}% + \setxvalue{\@@PDT0:0}% + {\noexpand\assignPDFtransparency{0}{\the\pdflastobj}}% + \appendtoPDFdocumentextgstates + {\PDFtransparencyresetidentifier\space + \PDFtransparencyresetreference\space}% + \global\let\initializePDFtransparency\relax} + +%D \macros +%D {dostartclipping,dostopclipping} +%D +%D Clipping in \PDFTEX\ is rather trivial. We can even hook +%D in \METAPOST\ without problems. + +\definespecial\dostartclipping#1#2#3% + {\PointsToBigPoints{#2}\width + \PointsToBigPoints{#3}\height + \grabMPclippath{#1}{1}\width\height + {0 0 m \width\space 0 l \width \height l 0 \height l}% + \pdfliteral % PDFcode ? + {q 0 w \MPclippath\space W n}} + +\definespecial\dostopclipping + {\pdfliteral{Q n}} % PDFcode + +%D \macros +%D {dosetupinteraction} +%D +%D Nothing special is needed to enable \PDF\ commands and +%D interaction. We stick with a message. + +\definespecial\dosetupinteraction + {\showmessage\m!interactions{21}{pdftex}} + +%D \macros +%D {doresetgotowhereever, +%D dostartthisisrealpage,dostartthisislocation, +%D dostartgotorealpage,dostartgotolocation,dostartgotoJS} +%D +%D The interactions macros are the core of this module. We +%D support both page destinations and named ones. We don't +%D need the \type{\stop}||alternatives. We also don't need +%D to set the special that sets the real page number. + +\definespecial\doresetgotowhereever {\doPDFresetgotowhereever} +\definespecial\dostartthisislocation{\doPDFstartthisislocation} + +%D When going to a location, we obey the time and space saving +%D boolean \type{\ifusepagedestination}. Named destinations are +%D stripped and made robust. This all happens in the macros +%D called for. + +\definespecial\dostartgotolocation{\doPDFstartgotolocation} +\definespecial\dostartgotorealpage{\doPDFstartgotorealpage} +\definespecial\dostartgotoJS {\doPDFstartgotoJS} + +\let\PDFpagexyzspec\empty % pdftex does not accept spec + +%D \macros +%D {doflushJSpreamble} +%D +%D It does not make sense to duplicate common \JAVASCRIPT\ +%D functions, and therefore they can be predefined and must be +%D output separately. Currently this special is not shared +%D with the \ACROBAT\ one, simply because \DISTILLER\ does not +%D yet support something \type{\pdfnames}. + +% \oneJSpreamblefalse % buggy in acrobat + +\definespecial\doflushJSpreamble#1% + {\bgroup + \let\compositeJScode\empty + \def\docommand##1% + {\edef\sanitizedJScode{\getJSpreamble{##1}}% + \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode + \immediate\pdfobj {<< /S /JavaScript /JS (\sanitizedJScode) >>}% + \edef\compositeJScode + {\compositeJScode\space (##1) \PDFobjref\pdflastobj}}% + \processcommalist[#1]\docommand + \immediate\pdfobj{<< /Names [ \compositeJScode ] >>}% + \pdfnames{/JavaScript \PDFobjref\pdflastobj}% + \egroup} + +%D \macros +%D {dostarthide,dostophide} +%D +%D Hiding parts of the document for printing is not yet +%D supported by \PDF\ and therefore \PDFTEX. + +\definespecial\dostarthide{} +\definespecial\dostophide {} + +%D \macros +%D {dosetupscreen} +%D +%D Setting of the screen boundingbox involves some +%D calculations. Here we also take care of (non) full screen +%D startup. The dimensions are rounded. Because \PDFTEX\ and +%D \ACROBAT\ handle setting the page dimensions in a +%D different way, we do not share this special. + +\definespecial\dosetupscreen {\doPDFsetupscreen \pdfpageheight} + +\definespecial\dosetupartbox {\doPDFsetupartbox \pdfpageheight} +\definespecial\dosetupcropbox {\doPDFsetupcropbox \pdfpageheight} +\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\pdfpageheight} +\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \pdfpageheight} + +%D \macros +%D {dostartexecutecommand} +%D +%D \PDF\ viewers enable us to navigate using menus and shortcut +%D keys. These navigational tools can also be accessed by using +%D annotations. The next special takes care of inserting them. + +\definespecial\dostartexecutecommand{\doPDFstartexecutecommand} + +%D \macros +%D {dosetupidentity} +%D +%D Documents can be tagged with an application accessible title +%D and subtitle, the authorname, a date, the creator, keywords +%D etc. For the moment \PDFTEX\ only supports the first three +%D of these. + +\definespecial\dosetupidentity{\doPDFsetupidentity} + +%D \macros +%D {dostartrunprogam} +%D +%D We can run a program form within a document, although this +%D feature is rather weak, due to path problems and buggy +%D argument passing. + +\definespecial\dostartrunprogram{\doPDFstartrunprogram} + +%D \macros +%D {dostartgotoprofile, dostopgotoprofile, +%D dobeginofprofile, doendofprofile} +%D +%D \CONTEXT\ user profiles and version control fall back on +%D \PDF\ article threads. Unfortunately one cannot influence +%D the view yet in an (for me) acceptable way. + +\definespecial\dostartgotoprofile{\doPDFstartgotoprofile} + +%D Some day, I'll reimplement threading in a useful way. +%D Currently the viewers handle threads rather diffuse. + +\ifnum\pdftexversion>13 + +\definespecial\dobeginofprofile#1#2#3#4% + {\setPDFdestination{#1}% + \doifsomething\PDFdestination + {\pdfthread + width #2 height #3 + attr {/Title (\PDFdestination)} % can be omitted + name {\PDFdestination}}} + +\definespecial\doendofprofile% + {} + +\fi + +%D \macros +%D {doinsertbookmark} +%D +%D In \PDF\ bookmarks are the building blocks of a viewer +%D provided sort of table of contents. \TEX\ has to provide +%D the entry as well as the number of child entries. Strings +%D need to be sanatized as good as possible to suit the default +%D encoding. In \CONTEXT\ users can overrule this string by +%D supplying an alternative one. Look at the macro called for +%D to see how funny these bookmarks are defined. + +\definespecial\doinsertbookmark{\doPDFinsertbookmark} + +%D \macros +%D {dostartobject,dostopobject,doinsertobject} +%D +%D Due to \PDF's object oriented character, we can include and +%D reuse objects. These can be compared with \TEX's boxes. The +%D \TEX\ counterpart is defined in the module \type{spec-dvi}. +%D We don't use the dimensions here. +%D +%D The next solution is not that beautiful. Because objects are +%D containers for whatever kind of content, graphics can be +%D part of this content, and a graphic object can be part of +%D the more general type. In practice this means that an ximage +%D would be embedded in an xform, which in itself is not that +%D big a problem, apart from a few bytes overhead. However, for +%D reasons unknown to me alternative images must be pure +%D ximages |<|indeed, somehow one cannot use a vector graphic +%D as alternative|>| that are not embedded into forms, so this +%D is why the object handler treats them different. This +%D implies knowledge of the calling routines, especially the +%D \type{FIG} trigger, that signals that we just embedded an +%D image. Alternatively I could have introduced a dual object +%D system, but the overhead in duplicate specials is currently +%D not what we want. I'd rather implement a more mature +%D object support system from scratch. + +\let\currentPDFresources\empty +\let\PDFimageattributes \empty +\let\PDFfigurereference \empty +\let\PDFimagereference \empty + +\ifnum\pdftexversion>13 + + \definespecial\dostartobject#1#2#3#4#5% + {\bgroup + \setbox\nextbox\vbox\bgroup + \def\dodostopobject + {\egroup + \ifx\PDFimagereference\empty + % We also flush page resources, since shared + % resources end up there; otherwise transparencies + % won't work in xforms; some day I will optimize + % this. + \the\everyPDFxform + \finalizeobjectbox\nextbox + \immediate\pdfxform + resources {\currentPDFresources\the\pdfpageresources}% + \nextbox + \global\let\currentPDFresources\empty + \dosetobjectreference{#1}{#2}{\the\pdflastxform}% + \else + \dosetobjectreference{#1}{#2}{-\PDFimagereference}% + \global\let\PDFimagereference\empty + \fi}} + + \definespecial\dostopobject + {\dodostopobject + \egroup} + + \definespecial\doresetobjects + {\global\let\PDFimagereference\empty} + + \definespecial\doinsertobject#1#2% + {\bgroup + \doifobjectreferencefoundelse{#1}{#2} + {\dogetobjectreference{#1}{#2}\PDFobjectreference + \ifnum\PDFobjectreference<0 + \@EA\@EA\@EA\pdfrefximage\@EA\gobbleoneargument\PDFobjectreference + \else + \pdfrefxform\PDFobjectreference + \fi}% + {}% + \egroup} + +\else + + \definespecial\dostartobject#1#2#3#4#5% + {\bgroup + \setbox\nextbox\vbox\bgroup + \def\dodostopobject + {\egroup + \the\everyPDFxform + \pdfform\nextbox + \dosetobjectreference{#1}{#2}{\the\pdflastform}}} + + \definespecial\dostopobject + {\dodostopobject + \egroup} + + \definespecial\doinsertobject#1#2% + {\bgroup + \dogetobjectreference{#1}{#2}\PDFobjectreference + \pdfrefform\PDFobjectreference + \egroup} + +\fi + +\appendtoksonce + \collectPDFresources + \global\let\currentPDFresources\collectedPDFresources +\to \everyPDFxform + +%D \macros +%D {dosetpagetransition} +%D +%D Page transitions only make sence in presentations. They are +%D passed as raw \PDF\ code to the page object. Take a look +%D at the implementation to get an impression of the rubish +%D passed on. + +\definespecial\dosetpagetransition{\doPDFsetpagetransition} + +%D The expansion is needed because else the \type{\pdfpageattr} +%D token list flushes an unexpanded \type{\csname}. The +%D \type{\global} is needed because the assignment can take +%D place deeply buried (for instance in the \type{\shipout} +%D box. + +%D \macros +%D {doinsertcomment, doflushcomments} +%D +%D Text annotation, or comments, are provided too: + +\definespecial\doinsertcomment{\doPDFinsertcomment} +\definespecial\doflushcomments{\doPDFflushcomments} + +%D \macros +%D {dopresetlinefield,dopresettextfield, +%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, +%D dopresetpushfield,dopresetcheckfield, +%D dopresetradiofield,dopresetradiorecord} +%D +%D \PDF\ offers extensive field support. The next bunch of +%D definitions map the specials. + +\definespecial\dopresetlinefield {\doFDFpresetlinefield} +\definespecial\dopresettextfield {\doFDFpresettextfield} +\definespecial\dopresetchoicefield{\doFDFpresetchoicefield} +\definespecial\dopresetpopupfield {\doFDFpresetpopupfield} +\definespecial\dopresetcombofield {\doFDFpresetcombofield} +\definespecial\dopresetpushfield {\doFDFpresetpushfield} +\definespecial\dopresetcheckfield {\doFDFpresetcheckfield} +\definespecial\dopresetradiofield {\doFDFpresetradiofield} +\definespecial\dopresetradiorecord{\doFDFpresetradiorecord} + +%D \macros +%D {dodefinefieldset,dogetfieldset,doiffieldset} +%D +%D Field sets, needed for reset and submit handling, are +%D taken care of by: + +\definespecial\dodefinefieldset{\doFDFdefinefieldset} +\definespecial\dogetfieldset {\doFDFgetfieldset} +\definespecial\doiffieldset {\doFDFiffieldset} + +%D \macros +%D {doregistercalculationset} +%D +%D The calculation order is defined using: + +\definespecial\doregistercalculationset{\doFDFregistercalculationset} + +%D \macros +%D {doPDFdestination} +%D +%D Finally we implement some low level macros to deal with +%D flushing \PDF\ code. First we handle the named destinations. + +\def\doPDFdestination#1% + {\pdfdest name {#1}\PDFpageviewkey} + +%D \macros +%D {doPDFaction,doPDFannotation,ifsharePDFactions} +%D +%D Next we handle annotations. All link annotations are +%D implemented using the action dictionary. This enables us to +%D use multiple actions. The second macro is for instance +%D used for movie inclusion. + +\newif\ifsharePDFactions \sharePDFactionstrue + +% hm, due to some stupid optimization this feature has been +% disabled for some time, watch out \lastPDFaction is to be +% persistent + +\ifnum\pdftexversion>13 + + \def\doPDFaction#1#2#3% + {\xdef\lastPDFcontent{#3}% + \ifcollectreferenceactions + \global\let\lastPDFaction\lastPDFcontent + \else + \ifsharePDFactions + \ifcase\similarreference\relax + \xdef\lastPDFaction{<<\lastPDFcontent>>}% + \or + \immediate\pdfobj{<<\lastPDFcontent>>}% + \xdef\lastPDFaction{\PDFobjref\pdflastobj}% + \else + % leave \lastPDFaction untouched + \fi + \else + \xdef\lastPDFaction{<<\lastPDFcontent>>}% + \fi + \pdfannot + width #1 height #2 depth \zeropoint + {/Subtype /Link + /Border [0 0 0] + \ifhighlighthyperlinks \else /H /N \fi + /A \lastPDFaction}% + \fi} + +\else + + \def\doPDFaction#1#2#3% + {\ifcollectreferenceactions + \xdef\lastPDFaction{#3}% + \else + \ifsharePDFactions + \ifcase\similarreference\relax + \xdef\lastPDFaction{<<#3>>}% + \or + \immediate\pdfobj{<<#3>>}% + \xdef\lastPDFaction{\PDFobjref\pdflastobj}% + \else + % leave \lastPDFaction untouched + \fi + \else + \xdef\lastPDFaction{<<#3>>}% + \fi + \pdfannotlink % could be \pdfannot if not the - problem was there + width #1 height #2 depth \zeropoint + user {/Subtype /Link + /Border [0 0 0] + \ifhighlighthyperlinks \else /H /N \fi + /A \lastPDFaction}% + \pdfendlink + \fi} + +\fi + +% pdftex and viewers give problems with this one (printing forms) +% +%\def\doPDFannotation#1#2#3% +% {\pdfannot width #1sp height -#2sp depth \zeropoint{#3}} +% +% This is corrected in version 14. When this version is wide +% spread, this will be cleaned up. + +\ifnum\pdftexversion>13 + + \def\doPDFannotation#1#2#3% + {\pdfannot width #1 height #2 depth \zeropoint{#3}} + +\else + + \def\doPDFannotation#1#2#3% + {\hbox{\raise#2\hbox{\pdfannot width #1 height #2 depth \zeropoint{#3}}}} + +\fi + +%D \macros +%D {doPDFannotationobject,doPDFactionobject} +%D +%D For field support we need annotation objects. Although in +%D many cases we can do without indirect references (and use +%D the last annotation object number directly), we take the +%D save route. + +\def\doPDFannotationobject#1#2#3#4#5% + {\doPDFannotation{#3}{#4}{#5}% + \dosetobjectreference{#1}{#2}{\the\pdflastannot}} + +\def\doPDFactionobject#1#2#3#4#5% + {\doPDFaction{#3}{#4}{#5}% + \dosetobjectreference{#1}{#2}{\the\pdflastannot}} + +%D \macros +%D {doPDFaddtocatalog,doPDFaddtoinfo, +%D doPDFpageattribute,doPDFpagesattribute} +%D +%D Next some simple ones. Watch the global directive and the +%D expansion in the page attribute macro. + +\def\doPDFaddtocatalog + {\pdfcatalog} + +\def\doPDFaddtoinfo + {\pdfinfo} + +\def\doPDFpageattribute#1% + {\expanded{\global\pdfpageattr{#1\the\pdfpageattr}}} + +\def\doPDFpageresource#1% + {\expanded{\global\pdfpageresources{#1\the\pdfpageresources}}} + +\def\doPDFpagesattribute#1% + {\expanded{\global\pdfpagesattr{#1\the\pdfpagesattr}}} + +\def\doPDFresetpageattributes + {\global\pdfpageattr\emptytoks} + +\def\doPDFresetpageresources + {\global\pdfpageresources\emptytoks} + +%D \macros +%D {doPDFbookmark} +%D +%D Well, isn't the next one ugly? Thanks to the \PDF\ +%D standard. + +\def\doPDFbookmark#1#2#3#4#5% + {\doPDFgetpagereference{#4}\PDFobjectreference + \pdfoutline + user {<>}% + \ifcase#2 \else count \ifcase#5-\fi#2 \fi + {#3}} + +%D \macros +%D {doPDFdictionaryobject,doPDFarrayobject} +%D +%D Where \PDFTEX\ has only one object primitive, optionally a +%D stream one, \ACROBAT\ has several operators. + +\def\doPDFdictionaryobject#1#2#3% + {\flushatshipout + {\immediate\pdfobj{<< #3 >>}% + \dosetobjectreference{#1}{#2}{\the\pdflastobj}}} + +\def\doPDFarrayobject#1#2#3% + {\flushatshipout + {\immediate\pdfobj{[ #3 ]}% + \dosetobjectreference{#1}{#2}{\the\pdflastobj}}} + +% tricky .. too many xforms now +% +% \def\doreservePDFobject#1#2% +% {\pdfobj reserveobjnum{}% +% \driverreferenced\dosetobjectreference{#1}{#2}{\the\pdflastobj}} +% +% \def\doPDFreserveddictionaryobject#1#2#3% +% {\doPDFgetobjectnumber{#1}{#2}\PDFobjectnumber +% \immediate\pdfobj useobjnum \PDFobjectnumber {<< #3 >>}} +% +% \def\doPDFreservedarrayobject#1#2#3% +% {\doPDFgetobjectnumber{#1}{#2}\PDFobjectnumber +% \immediate\pdfobj useobjnum \PDFobjectnumber {[ #3 ]}} + +% \doreservePDFobject{FDF}{docuextgstates} +% \doreservePDFobject{FDF}{colorspaces} +% \doreservePDFobject{FDF}{docushades} + +%D \macros +%D {defaultobjectreference,doPDFgetobjectreference} +%D +%D Because in \PDFTEX\ we have to construct the object +%D references \type{N 0 R}, we can default to the non existing +%D zero object number. + +\def\defaultobjectreference#1#2% + {0} + +\def\doPDFgetobjectreference#1#2#3% + {\dogetobjectreference{#1}{#2}#3% + \edef#3{\ifx#3\empty null\else\PDFobjref{#3}\fi}} + +\def\doPDFgetobjectnumber#1#2#3% + {\dogetobjectreference{#1}{#2}#3% + \edef#3{\ifx#3\empty 0\else#3\fi}} + +% \def\doPDFgetobjectpage #1#2#3{..} +% \def\doPDFgetobjectpagereference#1#2#3{..} + +\ifx\pdfpageref\undefined + + \def\doPDFgetpagereference % number macro + {\installprogram{texutil --filter \jobname}% + \gdef\doPDFgetpagereference##1{\doPDFgetobjectreference{PDFP}{\number##1}}% {##2} + \doPDFgetpagereference} + +\else + + \def\doPDFgetpagereference#1#2% number macro + {\edef#2{\ifnum#1>\zerocount\PDFobjref{\pdfpageref#1}\else null\fi}} + +\fi + +%D \macros +%D {initializePDFnegative,initializePDFoverprint} +%D +%D Here follow some rather obscure macros. They will only +%D come into action when one wants negated output. + +%D Todo: move code to fdf module + +\def\initializePDFnegative + {\immediate\pdfobj stream attr {/FunctionType 4 /Range [0 1] /Domain [0 1]} {{1 exch sub}}% + \immediate\pdfobj{<>}% + \appendtoPDFdocumentextgstates{/GSnegative \PDFobjref\pdflastobj}% + \immediate\pdfobj{<>}% + \appendtoPDFdocumentextgstates{/GSpositive \PDFobjref\pdflastobj}% + \global\let\initializePDFnegative\relax} + +\def\initializePDFoverprint + {\immediate\pdfobj{<>}% /op defaults to /OP + \appendtoPDFdocumentextgstates{/GSknockout \PDFobjref\pdflastobj}% + \immediate\pdfobj{<>}% /op defaults to /OP + \edef\PDFobjectreferenceB{\the\pdflastobj}% + \appendtoPDFdocumentextgstates{/GSoverprint \PDFobjref\pdflastobj}% + \global\let\initializePDFoverprint\relax} + +%D File embedding. Storing the stream identifier is needed +%D to get access to the number. When typeset, the user can +%D feed this number to \type {pdftosrc} and filter the +%D file from the \PDF\ file. + +\let\PDFlaststreamobject \s!unknown +%def\PDFlaststreamreference{0 0 R} + +\def\doPDFfilestreamobject#1#2#3#4% + {\immediate\pdfobj stream file{#4}% + \edef\PDFlaststreamobject{\the\pdflastobj}% + \dosetobjectreference{PDFFS}{#2}{\PDFlaststreamobject}% + \doPDFdictionaryobject{#1}{#2}{/Type /Filespec /F (#3) /EF <>}} + +\def\doPDFgetfilestreamreference#1#2% + {\doPDFgetobjectreference{PDFFS}{#1}#2} + +\def\doPDFfilestreamidentifier#1% + {\doifsomething{#1} + {\doPDFgetfilestreamreference{#1}\PDFobjectreference + \@EA\beforesplitstring\PDFobjectreference\at{ }\to\PDFlaststreamobject + \PDFlaststreamobject}} + +% %D We can set \METAPOST\ prologues to~1: + +\def\MPprologues{1} + +%D Experimental: + +\definespecial\dostartfonteffect{\doPDFstartfonteffect} +\definespecial\dostopfonteffect {\doPDFstopfonteffect} + +%D Some MP stuff: + +\let\handleMPfshow\dohandleMPfshow % default anyway + +\ifnum\pdftexversion<14 + + \def\setMPPDFobject#1#2% resources boxnumber + {\def\getMPPDFobject{\box#2}} + +\else + + \def\setMPPDFobject#1#2% resources boxnumber + {\the\everyPDFxform + \finalizeobjectbox{#2}% + \immediate\pdfxform resources{#1}#2% + \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}} + +\fi + +\let\getMPPDFobject\relax + +\definespecial\doinsertMPfile#1% + {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}} + +%D Now we can finish this module. + +\stopspecials + +\protect \endinput diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex deleted file mode 100644 index 597993e0a..000000000 --- a/tex/context/base/spec-tpd.tex +++ /dev/null @@ -1,1334 +0,0 @@ -%D \module -%D [ file=spec-tpd, -%D version=1996.01.25, -%D title=\CONTEXT\ Special Macros, -%D subtitle=\PDFTEX, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% once we can be sure that the latest versions of pdftex are -% available we can use: -% -% \pdfobj reserveobjnum \edef\one{\the\pdflastobj} -% \pdfobj reserveobjnum \edef\two{\the\pdflastobj} -% -% \pdfobj useobjnum \one {x} -% \pdfobj useobjnum \two {x} -% -% we then can rewrite part of spec-fdf because the other drivers -% already support symbolic references - -% layers and links don't work while the spec says they should - -% method = auto -% -% \definefileinsertion{tpd}{auto}% -% {\executesystemcommand{t:/ruby/pstopdf.rb #2}% -% \dofileinsertion{tpd}{pdf}} - -% \let\PDFdestvoffset\zeropoint -% \newbox\pdfdestbox -% -% \def\doPDFdestination#1% -% {\ifdim\PDFdestvoffset=\zeropoint\relax -% \pdfdest name {#1}\PDFpageviewkey -% \else -% \setbox\pdfdestbox\hbox to \zeropoint -% {\raise\PDFdestvoffset\hbox{\pdfdest name {#1}\PDFpageviewkey}}% -% \ht\pdfdestbox\zeropoint -% \box\pdfdestbox -% \fi} -% -% \def\PDFdestvoffset{2\lineheight} % {1.5\strutht} - -%D \macros -%D {jobsuffix} -%D -%D Being one of the first typographical systems able to support -%D advances \PDF\ support, \TEX\ is also one of the first -%D systems to produce high quality \PDF\ code directly. Thanks -%D to Han The Thanh c.s. the \TEX\ community can leap forward -%D once again. -%D -%D One important characteristic of \PDFTEX\ is that is can -%D produce standard \DVI\ code as well as \PDF\ code. This -%D enables us to use one format file to support both output -%D formats. - -%D All modules in this group use specials to tell drivers what -%D non||\TEX\ actions to take. Because from the \TEX\ point of -%D view, there is no difference between \DVI\ and \PDF, we -%D therefore only have to bend the \DVI\ driver support into -%D \PDF\ support. Technically spoken, specials no longer serve -%D a purpose, except from ending up as comment in the \PDF\ -%D file. -%D -%D Before we continue we need to make sure if indeed those -%D \PDFTEX\ primitives are permitted. If no primitives are -%D available, we just stop reading any further. - -\unprotect - -\ifx\pdftexversion\undefined - \writestatus\m!systems{you should use pdfTeX binaries}\wait - \protect\expandafter\endinput -\fi - -\ifnum\pdftexversion<13 - \writestatus\m!systems{your pdfTeX version is much too old}\wait - \protect\expandafter\endinput -\fi - -\ifnum\pdftexversion<14 - \writestatus\m!systems{please update your pdfTeX binaries} -\fi - -\ifnum\pdftexversion>19 - \pdfhorigin=1 true in - \pdfvorigin=1 true in -\fi - -%D We default to 300 dots per inch image resolution and 600 dpi -%D bitmap fonts (when asked for). - -\ifx\pdfimageresolution\undefined \newcount\pdfimageresolution \fi -\ifx\pdfpkresolution \undefined \newcount\pdfpkresolution \fi - -\pdfimageresolution=300 -\pdfpkresolution =600 - -%D Another downward compatible hack: - -\ifx\pdflastximagepages\undefined - \newcount\pdflastximagepages \pdflastximagepages=1 -\fi - -%D And: - -\ifx\pdfpageresources\undefined - \newtoks\pdfpageresources -\fi - -%D In order to get high quality \METAPOST\ inclusion, we set -%D the number of digits to~5 (prevents rounding errors). - -\ifx\pdfdecimaldigits\undefined - \newcount\pdfdecimaldigits -\fi - -\pdfdecimaldigits=10 - -\ifx\pdfinclusionerrorlevel\undefined - \ifx\pdfoptionpdfinclusionerrorlevel\undefined - \newcount\pdfinclusionerrorlevel - \else - \let\pdfinclusionerrorlevel\pdfoptionpdfinclusionerrorlevel - \fi -\fi - -\pdfinclusionerrorlevel=0 - -\ifx\pdfminorversion\undefined - \ifx\pdfoptionpdfminorversion\undefined - \newcount\pdfminorversion - \else - \let\pdfminorversion\pdfoptionpdfminorversion - \fi -\fi - -\pdfminorversion=5 - -\def\PDFversion{1.\number\pdfminorversion} - -% %D Why are the Acrobat viewers so buggy? To prevent font cache -% %D mismatches, we say: -% -% \ifx\pdfuniqueresname\undefined \else -% \pdfuniqueresname=1 -% \fi - -%D Once we are sure that we're indeed supporting \PDFTEX, we -%D force \PDF\ output at the highest compression. For debugging -%D purposes one can set the compresslevel to~0. We also have to -%D make sure no other specials are supported, else \PDFTEX\ -%D will keep on telling us that we're wrong. We also load the -%D general \PDF\ macros that are shared between this driver and -%D the \ACROBAT\ one. - -\startspecials[tpd][reset,fdf] - -%D This means that by saying -%D -%D \starttyping -%D \usespecials[tpd] -%D \stoptyping -%D -%D we get ourselves full \PDF\ output. - -%D For some internal testing we need to know the output -%D suffix. - -\setjobsuffix{pdf} - -%D We don't use specials here, which means that we must flush -%D settings before the page is shipped out. - -\specialbasedsettingsfalse - -%D Some more internal settings. - -\appendtoksonce - \pdfoutput\zerocount -\to \everyresetspecials - -\pdfoutput=1 % we reset that one with \everyresetspecials - -%D Just in case we mimmick specials, we have to make sure no -%D default specials end up in the process. - -\let\defaultspecial=\gobbleoneargument - -\appendtoksonce - \let\defaultspecial\normalspecial -\to \everyresetspecials - -\let\PDFcode \pdfliteral -\def\PDFcontentcode{\pdfliteral} -\def\PDFdirectcode {\pdfliteral direct} - -%D \macros -%D {everyPDFximage} -%D -%D This token register is flushed before an ximage is loaded. - -\ifdefined\everyPDFximage \else \newtoks\everyPDFximage \fi -\ifdefined\everyPDFxform \else \newtoks\everyPDFxform \fi - -%D \macros -%D {dosetuppaper} -%D -%D If we don't set the paper size, \PDFTEX\ will certainly do -%D it in a way we don't want, therefore we need: - -\definespecial\dosetuppaper#1#2#3% - {\global\pdfpagewidth #2\relax - \global\pdfpageheight#3\relax} - -%D \macros -%D {doloadmapfile,doloadmapline,doresetmapfilelist} - -\ifx\pdfmapfile\undefined \let\pdfmapfile\gobbletwoarguments \fi -\ifx\pdfmapline\undefined \let\pdfmapline\gobbletwoarguments \fi - -\definespecial\doresetmapfilelist - {\global\let\doresetmapfilelist\relax - \pdfmapfile{original-empty.map}} - -\ifnum\pdftexversion<120 - - \definespecial\doloadmapfile #1#2{\pdfmapfile{+#2}} - \definespecial\doloadmapline #1#2{} - -\else - - \definespecial\doloadmapfile #1#2{\pdfmapfile{#1#2}} - \definespecial\doloadmapline #1#2{\pdfmapline{#1#2}} - -\fi - -%D nasty but needed - -\appendtoksonce \loadallfontmapfiles \to \everyPDFximage -\appendtoksonce \loadallfontmapfiles \to \everyPDFxform - -%D \macros -%D {doinsertfile,dogetnofinsertpages} -%D -%D Graphics are not part of \TEX\ and therefore not part of the -%D \DVI\ standard. \PDF\ on the other hand has several graphic -%D primitives. During the multi||step process \TEX\ -%D $\rightarrow$ \DVI\ $\rightarrow$ \POSTSCRIPT\ $\rightarrow$ -%D \PDF\ one can insert graphics using specials. In \PDFTEX\ -%D however there is only one step! This means that \PDFTEX\ -%D itself has to do the inclusion. -%D -%D At the moment \PDFTEX\ supports inclusion of bitmap \PNG\ -%D graphics as well as not too complicated \PDF\ code. Using -%D this last option, we are able to include both \METAPOST\ and -%D \PDF\ output produced by \GHOSTSCRIPT. -%D -%D We fall back on the generic \CONTEXT\ module supp-pdf to -%D accomplish \PDF\ inclusion. The methods implemented there -%D are hooked into both the figure placement mechanisms of -%D \CONTEXT\ and the specials inclusion mechanism. - -\definespecial\doinsertfile - {\dofileinsertion{tpd}{\truegraphictype\@@DriverImageType}} - -%D The number of pages in (for instance an \PDF) insert -%D file, can be asked for using: - -\definespecial\dogetnofinsertpages#1% - {\xdef\nofinsertpages{1}% global - \doifvalidpdfimagefileelse{#1}% - {\pdfximage{#1}\xdef\nofinsertpages{\the\pdflastximagepages}} - {}} - -%D Currently we support \type{pdf} for \PDF\ files, \type{mps} -%D for \METAPOST\ graphics, \type{png} and \type{jpg} for -%D bitmap graphics. - -\definefileinsertion{tpd}{mps} - {\hbox - {\convertMPtoPDF\@@DriverImageFile{1}{1}% - \global\let\PDFimagereference\empty}} - -\definefileinsertion{tpd}{pdf}{\handlepdfimage} -\definefileinsertion{tpd}{png}{\handlepdfimage} -\definefileinsertion{tpd}{jpg}{\handlepdfimage} -\definefileinsertion{tpd}{jb2}{\handlepdfimage} - -% \definefileinsertion{tpd}{jpeg} {\handlepdfimage} -% \definefileinsertion{tpd}{jbig2}{\handlepdfimage} - -%D Experimental: - -%D The main file insertion macro is as follows. Because -%D \PDFTEX\ does not support arbitrary suffixes, we double -%D check on a user supplied filename, because \PDFTEX\ chokes -%D on unknown suffixes. - -\def\doifvalidpdfimagefileelse#1% todo: greedy split - {\doiffileelse{#1} - {\edef\filesuffix{#1}% - \doloop - {\@EA\aftersplitstring\filesuffix\at.\to\temp - \ifx\temp\empty - \exitloop - \else - \lowercasestring\temp\to\filesuffix % insertion check also needs lowercase - % a temporary hack - \doif\filesuffix{pdf}{\pdfimageresolution72}% - % because pdfTeX scales back - \fi}} - {\let\filesuffix\s!unknown}% - \doiffileinsertionsupportedelse\filesuffix} - -\ifx\pdflastximagepages\undefined \chardef\pdflastximagepages=1 \fi - -\def\checkpdfimagepagenumber - {\edef\pdfimagepagenumber - {\ifx\@@DriverImagePage\empty\else\ifnum\@@DriverImagePage>\zerocount - \space page\space\@@DriverImagePage\space - \fi\fi}} - -\ifnum\pdftexversion>13 - - \def\handlepdfimage - {\bgroup - \the\everyPDFximage - \doifvalidpdfimagefileelse\@@DriverImageFile - {\checkpdfimagepagenumber - \ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi - \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \fi - \ifdim\@@DriverImageHeight>\zeropoint \!!height\@@DriverImageHeight\fi - \pdfimagepagenumber - \@@DriverImageBox - {\@@DriverImageFile} - \xdef\PDFimagereference{\the\pdflastximage}% - \xdef\nofinsertpages{\the\pdflastximagepages}% - \pdfrefximage\pdflastximage} - {\framed[\c!width=\@@DriverImageWidth,\c!height=\@@DriverImageHeight]{\@@DriverImageFile}}% - \egroup} - -\else - - \def\handlepdfimage - {\bgroup - \doifvalidpdfimagefileelse\@@DriverImageFile - {\pdfimage - \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \fi - \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight\fi - {\@@DriverImageFile}}% - {\framed[\c!width=\@@DriverImageWidth,\c!height=\@@DriverImageHeight]{\@@DriverImageFile}}% - \egroup} - -\fi - -%D As we will see now, \PDFTEX\ not only directly supports -%D \type{mps}, \type{png}, \type{pdf}, \type{jpg} but also -%D \type{mov}. In \CONTEXT\ we support movie inserts in a way -%D similar to figure inclusion. The next macro calls the -%D general \PDF\ one. - -\definefileinsertion{tpd}{mov}{\doPDFinsertmov} -\definefileinsertion{tpd}{avi}{\doPDFinsertmov} - -%D \macros -%D {doinsertsoundtrack} -%D -%D We use numbers instead of labels to keep track of sounds. - -\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack} - -%D For the moment we don't test for alternatives that -%D themselves have alternatives, especially cylcic -%D dependencies. - -% some day we will do a proper check on bitmap depth, -% -% \pdfobj reserveobjnum\relax -% \pdfximage colorspace \pdflastobj {some file} -% ... \pdflastximagecolordepth ... -% \immediate\pdfobj useobjnum \pdflastobj {some spec} - -\ifx\@@DriverImageBox\undefined \def\@@DriverImageBox{artbox} \fi - -\def\pdfimmediateximage{\immediate\pdfximage} - -\ifnum\pdftexversion>13 - - \def\checkpdfimageattributes - {\ifx\PDFfigurereference\empty - \global\let\pdfimageattributes\empty - \else - \immediate\pdfobj - {[ << /Image \PDFobjref\PDFfigurereference - /DefaultForPrinting true >> ]}% - \xdef\pdfimageattributes - {attr {/Alternates \PDFobjref\pdflastobj}}% - \fi} - - \global\let\PDFimagecolorreference\empty - - \def\checkpdfimagecolorspecs - {\ifx\pdflastximagecolordepth \undefined - \global\let\pdfimagecolorspecs\empty - \else\ifx\PDFimagecolorreference\empty - \global\let\pdfimagecolorspecs\empty - \else - \xdef\pdfimagecolorspecs{colorspace \PDFimagecolorreference\space}% - \fi\fi - \global\let\PDFimagecolorreference\empty} - - \def\dogetTPDfiguresize - {\doifvalidpdfimagefileelse\@@DriverImageFile - {\ifvoid\foundexternalfigure - \donetrue - \else\ifx\PDFfigurereference\empty - \donetrue - \else - % hm, is this still needed - \doifinstringelse\filesuffix{\c!png,\c!jpg}\donetrue\donefalse - \fi\fi} - {\donefalse}% - \ifdone - \the\everyPDFximage - \checkpdfimageattributes - \checkpdfimagecolorspecs - \checkpdfimagepagenumber - \global\setbox\foundexternalfigure\hbox - {\ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi - \pdfimageattributes - \pdfimagecolorspecs - \pdfimagepagenumber - \@@DriverImageBox - {\@@DriverImageFile}% - \xdef\PDFimagereference{\the\pdflastximage}% - \xdef\nofinsertpages{\the\pdflastximagepages}% - \pdfrefximage\pdflastximage}% - \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}% - \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}% - \global\let\PDFfigurereference\empty - \global\let\PDFimageattributes\empty - \else - \global\let\analyzedfigurewidth \!!zeropoint - \global\let\analyzedfigureheight\!!zeropoint - \fi} - -\else - - \def\dogetTPDfiguresize - {\doifvalidpdfimagefileelse\@@DriverImageFile - {\global\setbox\foundexternalfigure\vbox{\pdfimage{\@@DriverImageFile}}% - \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}% - \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}} - {\global\let\analyzedfigurewidth \!!zeropoint - \global\let\analyzedfigureheight\!!zeropoint}} - -\fi - -\definefilechecker{tpd}{pdf}{\dogetTPDfiguresize} -\definefilechecker{tpd}{png}{\dogetTPDfiguresize} -\definefilechecker{tpd}{jpg}{\dogetTPDfiguresize} -\definefilechecker{tpd}{jb2}{\dogetTPDfiguresize} - -\definespecial\dogetfiguresize - {\dofilechecker{tpd}{\truegraphictype\@@DriverImageType}} - -%D \macros -%D {doregisterfigure} -%D -%D Here is the fuzzy, very special dependant figure -%D registration special. We need to refer to the innermost -%D object (ximage). - -\ifnum\pdftexversion>13 - - \definespecial\doregisterfigure#1#2% - {\doifundefined{IM::#1::#2} - {\setxvalue{IM::#1::#2}{\the\pdflastximage}}% - \xdef\PDFfigurereference{\getvalue{IM::#1::#2}}} - -\fi - -%D \macros -%D {doovalbox} -%D -%D Drawing frames with round corners is inherited from the -%D main module. - -\definespecial\doovalbox {\doPDFovalbox} - -%D \macros -%D {dostartgraymode,dostopgraymode, -%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode, -%D dostopcolormode, -%D dostartrotation,dostoprotation, -%D dostartscaling,dostopscaling, -%D dostartmirroring,dostopmirroring, -%D dostartnegative,dostopnegative, -%D dostartoverprint,dostopoverprint} -%D -%D These are implemented in the main \PDF\ module. - -\definespecial\dostartgraymode {\doPDFstartgraymode} -\definespecial\dostopgraymode {\doPDFstopgraymode} -\definespecial\dostartrgbcolormode {\doPDFstartrgbcolormode} -\definespecial\dostartcmykcolormode{\doPDFstartcmykcolormode} -\definespecial\dostartgraycolormode{\doPDFstartgraycolormode} -\definespecial\dostartspotcolormode{\doPDFstartspotcolormode} -\definespecial\dostopcolormode {\doPDFstopcolormode} -\definespecial\dostartrotation {\doPDFstartrotation} -\definespecial\dostoprotation {\doPDFstoprotation} -\definespecial\dostartscaling {\doPDFstartscaling} -\definespecial\dostopscaling {\doPDFstopscaling} -\definespecial\dostartmirroring {\doPDFstartmirroring} -\definespecial\dostopmirroring {\doPDFstopmirroring} -\definespecial\dostartnegative {\doPDFstartnegative} -\definespecial\dostopnegative {\doPDFstopnegative} -\definespecial\dostartoverprint {\doPDFstartoverprint} -\definespecial\dostopoverprint {\doPDFstopoverprint} - -\definespecial\doregistercmykspotcolor{\doPDFregistercmykspotcolor} -\definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor} -\definespecial\doregistergrayspotcolor{\doPDFregistergrayspotcolor} - -\definespecial\doregistercmykindexcolor{\doPDFregistercmykindexcolor} -\definespecial\doregisterrgbindexcolor {\doPDFregisterrgbindexcolor} -\definespecial\doregistergrayindexcolor{\doPDFregistergrayindexcolor} - -\definespecial\doregisterfigurecolor{\doPDFregisterfigurecolor} - -\definespecial\dostartnonecolormode{\doPDFstartnonecolormode} -\definespecial\doregisternonecolor {\doPDFregisternonecolor} - -\def\doPDFregisterspotcolorname#1#2% no need for escape in luatex - {\bgroup - \let\ascii\empty - \def\docommand##1% - {\edef\ascii{\ascii - \ifx\nexthandledtoken\space - \letterhash20% - \else\ifx\nexthandledtoken\blankspace - \letterhash20% - \else - ##1% - \fi\fi}}% - \expanded{\handletokens#2}\with\docommand - \letgvalue{@@pdf@@scn@@#1}\ascii - \egroup} - -\def\doPDFregistersomespotcolor#1#2#3#4#5#6#7% name fractions names p's space domain function - {\bgroup - \let\spotpops\empty - \ifcase#2\or - %def\PDFspotcolornames{/Separation /#1}% - \edef\PDFspotcolornames{/Separation /\executeifdefined{@@pdf@@scn@@#1}{#1}}% - \def\PDFspotcolordomain{0.0 1.0}% - \else - \dorecurse{#2}{\edef\spotpops{\spotpops pop }}% - \let\PDFspotcolornames \empty - \let\PDFspotcolordomain\empty - \def\dospotcolorcommand##1% - {\edef\PDFspotcolornames {\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}% - \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}% - \processcommacommand[#3]\dospotcolorcommand - \edef\PDFspotcolornames{/DeviceN [\PDFspotcolornames]}% - \fi - \immediate \pdfobj stream attr - {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}% - \immediate \pdfobj - {[\PDFspotcolornames\space /Device#5 \PDFobjref\pdflastobj]}% - \dosetobjectreference{PDFCS}{#1}{\the\pdflastobj}% - \appendtoPDFdocumentcolorspaces{/#1 \PDFobjref\pdflastobj}% - \egroup} - -%D New and very experimental. - -% \def\doPDFregistersomeindexcolor#1#2#3#4#5#6#7% name fractions names p's space domain function -% {\bgroup -% \let\spotpops\empty -% \dorecurse{#2}{\edef\spotpops{\spotpops exch pop\space}}% -% \let\PDFspotcolornames \empty -% \let\PDFspotcolordomain\empty -% \def\docommand##1% -% {\edef\PDFspotcolornames{\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}% -% \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}% -% \processcommacommand[#3,None]\docommand -% \let\PDFcolorindexvector\empty -% \def\docommand##1% -% {\scratchdimen##1\points -% \scratchdimen\recurselevel\scratchdimen -% \scratchcounter\scratchdimen -% \divide\scratchcounter \maxcard -% \edef\PDFcolorindexvector{\PDFcolorindexvector\uchexnumbers\scratchcounter}}% -% \dostepwiserecurse\zerocount{255}\plusone -% {\rawprocesscommacommand[#4,1]\docommand -% \xdef\PDFcolorindexvector{\PDFcolorindexvector\space}}% -% \immediate \pdfobj stream attr -% {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}% -% \immediate \pdfobj -% {[/Indexed -% [/DeviceN [\PDFspotcolornames] /Device#5 \PDFobjref\pdflastobj] % -% 255 <\PDFcolorindexvector>]}% -% \dosetobjectreference{PDFIX}{#1}{\the\pdflastobj}% -% \appendtoPDFdocumentcolorspaces{/#1_INDEXED \PDFobjref\pdflastobj}% -% \egroup} - -% we reverse the index; an alternative is to negate the graphic itself (\start/stop negative) - -\def\doPDFregistersomeindexcolor#1#2#3#4#5#6#7% name fractions names p's space domain function - {\bgroup - \let\spotpops\empty - \dorecurse{#2}{\edef\spotpops{\spotpops exch pop\space}}% - \let\PDFspotcolornames \empty - \let\PDFspotcolordomain\empty - \def\docommand##1% - {%\edef\PDFspotcolornames {\PDFspotcolornames/##1\space}% - \edef\PDFspotcolornames{\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}% - \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}% - \processcommacommand[#3,None]\docommand - \let\PDFcolorindexvector\empty - \def\docommand##1% - {\scratchdimen##1\points - \scratchdimen\recurselevel\scratchdimen - \scratchcounter\scratchdimen - \divide\scratchcounter \maxcard - \edef\PDFcolorindexvector{\PDFcolorindexvector\uchexnumbers\scratchcounter}}% - %\dostepwiserecurse\zerocount{255}\plusone - \dostepwiserecurse{255}\zerocount\minusone % we need to negate - {\rawprocesscommacommand[#4,1]\docommand - \xdef\PDFcolorindexvector{\PDFcolorindexvector\space}}% - \immediate \pdfobj stream attr - {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}% - \immediate \pdfobj - {[/Indexed - [/DeviceN [\PDFspotcolornames] /Device#5 \the\pdflastobj\space0 R] % - 255 <\PDFcolorindexvector>]}% - \dosetobjectreference{PDFIX}{#1}{\the\pdflastobj}% - \appendtoPDFdocumentcolorspaces{/#1_INDEXED \the\pdflastobj\space0 R}% - \egroup} - -%D \macros -%D {dostarttransparency,dostoptransparency} -%D -%D For transparency, we need to implement a couple of -%D auxiliary macros. If needed, we will generalize them later. - -\definespecial\dostarttransparency{\doPDFstarttransparency} -\definespecial\dostoptransparency {\doPDFstoptransparency} - -\PDFtransparencysupportedtrue - -\def\@@PDT{@PDT@} - -\ifx\PDFcurrenttransparency\undefined - \newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1 -\fi - -\def\assignPDFtransparency#1#2% - {\edef\PDFtransparencyidentifier{/Tr#1}% - \edef\PDFtransparencyreference{\PDFobjref{#2}}} - -\def\presetPDFtransparency#1#2% - {\initializePDFtransparency - \executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}} - -\def\dopresetPDFtransparency#1#2% - {\global\advance\PDFcurrenttransparency \plusone - \immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}% - \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}% - \edef\PDFtransparencyreference {\PDFobjref\pdflastobj}% - \setxvalue{\@@PDT#1:#2}% - {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\pdflastobj}}% - \appendtoPDFdocumentextgstates - {\PDFtransparencyidentifier\space - \PDFtransparencyreference\space}} - -\def\initializePDFtransparency - {\immediate\pdfobj{\PDFtransparancydictionary{1}{1}{/AIS false}}% - \xdef\PDFtransparencyresetidentifier{/Tr0}% - \xdef\PDFtransparencyresetreference{\PDFobjref\pdflastobj}% - \setxvalue{\@@PDT0:0}% - {\noexpand\assignPDFtransparency{0}{\the\pdflastobj}}% - \appendtoPDFdocumentextgstates - {\PDFtransparencyresetidentifier\space - \PDFtransparencyresetreference\space}% - \global\let\initializePDFtransparency\relax} - -%D \macros -%D {dostartclipping,dostopclipping} -%D -%D Clipping in \PDFTEX\ is rather trivial. We can even hook -%D in \METAPOST\ without problems. - -\definespecial\dostartclipping#1#2#3% - {\PointsToBigPoints{#2}\width - \PointsToBigPoints{#3}\height - \grabMPclippath{#1}{1}\width\height - {0 0 m \width\space 0 l \width \height l 0 \height l}% - \pdfliteral % PDFcode ? - {q 0 w \MPclippath\space W n}} - -\definespecial\dostopclipping - {\pdfliteral{Q n}} % PDFcode - -%D \macros -%D {dosetupinteraction} -%D -%D Nothing special is needed to enable \PDF\ commands and -%D interaction. We stick with a message. - -\definespecial\dosetupinteraction - {\showmessage\m!interactions{21}{pdftex}} - -%D \macros -%D {doresetgotowhereever, -%D dostartthisisrealpage,dostartthisislocation, -%D dostartgotorealpage,dostartgotolocation,dostartgotoJS} -%D -%D The interactions macros are the core of this module. We -%D support both page destinations and named ones. We don't -%D need the \type{\stop}||alternatives. We also don't need -%D to set the special that sets the real page number. - -\definespecial\doresetgotowhereever {\doPDFresetgotowhereever} -\definespecial\dostartthisislocation{\doPDFstartthisislocation} - -%D When going to a location, we obey the time and space saving -%D boolean \type{\ifusepagedestination}. Named destinations are -%D stripped and made robust. This all happens in the macros -%D called for. - -\definespecial\dostartgotolocation{\doPDFstartgotolocation} -\definespecial\dostartgotorealpage{\doPDFstartgotorealpage} -\definespecial\dostartgotoJS {\doPDFstartgotoJS} - -\let\PDFpagexyzspec\empty % pdftex does not accept spec - -%D \macros -%D {doflushJSpreamble} -%D -%D It does not make sense to duplicate common \JAVASCRIPT\ -%D functions, and therefore they can be predefined and must be -%D output separately. Currently this special is not shared -%D with the \ACROBAT\ one, simply because \DISTILLER\ does not -%D yet support something \type{\pdfnames}. - -% \oneJSpreamblefalse % buggy in acrobat - -\definespecial\doflushJSpreamble#1% - {\bgroup - \let\compositeJScode\empty - \def\docommand##1% - {\edef\sanitizedJScode{\getJSpreamble{##1}}% - \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode - \immediate\pdfobj {<< /S /JavaScript /JS (\sanitizedJScode) >>}% - \edef\compositeJScode - {\compositeJScode\space (##1) \PDFobjref\pdflastobj}}% - \processcommalist[#1]\docommand - \immediate\pdfobj{<< /Names [ \compositeJScode ] >>}% - \pdfnames{/JavaScript \PDFobjref\pdflastobj}% - \egroup} - -%D \macros -%D {dostarthide,dostophide} -%D -%D Hiding parts of the document for printing is not yet -%D supported by \PDF\ and therefore \PDFTEX. - -\definespecial\dostarthide{} -\definespecial\dostophide {} - -%D \macros -%D {dosetupscreen} -%D -%D Setting of the screen boundingbox involves some -%D calculations. Here we also take care of (non) full screen -%D startup. The dimensions are rounded. Because \PDFTEX\ and -%D \ACROBAT\ handle setting the page dimensions in a -%D different way, we do not share this special. - -\definespecial\dosetupscreen {\doPDFsetupscreen \pdfpageheight} - -\definespecial\dosetupartbox {\doPDFsetupartbox \pdfpageheight} -\definespecial\dosetupcropbox {\doPDFsetupcropbox \pdfpageheight} -\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\pdfpageheight} -\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \pdfpageheight} - -%D \macros -%D {dostartexecutecommand} -%D -%D \PDF\ viewers enable us to navigate using menus and shortcut -%D keys. These navigational tools can also be accessed by using -%D annotations. The next special takes care of inserting them. - -\definespecial\dostartexecutecommand{\doPDFstartexecutecommand} - -%D \macros -%D {dosetupidentity} -%D -%D Documents can be tagged with an application accessible title -%D and subtitle, the authorname, a date, the creator, keywords -%D etc. For the moment \PDFTEX\ only supports the first three -%D of these. - -\definespecial\dosetupidentity{\doPDFsetupidentity} - -%D \macros -%D {dostartrunprogam} -%D -%D We can run a program form within a document, although this -%D feature is rather weak, due to path problems and buggy -%D argument passing. - -\definespecial\dostartrunprogram{\doPDFstartrunprogram} - -%D \macros -%D {dostartgotoprofile, dostopgotoprofile, -%D dobeginofprofile, doendofprofile} -%D -%D \CONTEXT\ user profiles and version control fall back on -%D \PDF\ article threads. Unfortunately one cannot influence -%D the view yet in an (for me) acceptable way. - -\definespecial\dostartgotoprofile{\doPDFstartgotoprofile} - -%D Some day, I'll reimplement threading in a useful way. -%D Currently the viewers handle threads rather diffuse. - -\ifnum\pdftexversion>13 - -\definespecial\dobeginofprofile#1#2#3#4% - {\setPDFdestination{#1}% - \doifsomething\PDFdestination - {\pdfthread - width #2 height #3 - attr {/Title (\PDFdestination)} % can be omitted - name {\PDFdestination}}} - -\definespecial\doendofprofile% - {} - -\fi - -%D \macros -%D {doinsertbookmark} -%D -%D In \PDF\ bookmarks are the building blocks of a viewer -%D provided sort of table of contents. \TEX\ has to provide -%D the entry as well as the number of child entries. Strings -%D need to be sanatized as good as possible to suit the default -%D encoding. In \CONTEXT\ users can overrule this string by -%D supplying an alternative one. Look at the macro called for -%D to see how funny these bookmarks are defined. - -\definespecial\doinsertbookmark{\doPDFinsertbookmark} - -%D \macros -%D {dostartobject,dostopobject,doinsertobject} -%D -%D Due to \PDF's object oriented character, we can include and -%D reuse objects. These can be compared with \TEX's boxes. The -%D \TEX\ counterpart is defined in the module \type{spec-dvi}. -%D We don't use the dimensions here. -%D -%D The next solution is not that beautiful. Because objects are -%D containers for whatever kind of content, graphics can be -%D part of this content, and a graphic object can be part of -%D the more general type. In practice this means that an ximage -%D would be embedded in an xform, which in itself is not that -%D big a problem, apart from a few bytes overhead. However, for -%D reasons unknown to me alternative images must be pure -%D ximages |<|indeed, somehow one cannot use a vector graphic -%D as alternative|>| that are not embedded into forms, so this -%D is why the object handler treats them different. This -%D implies knowledge of the calling routines, especially the -%D \type{FIG} trigger, that signals that we just embedded an -%D image. Alternatively I could have introduced a dual object -%D system, but the overhead in duplicate specials is currently -%D not what we want. I'd rather implement a more mature -%D object support system from scratch. - -\let\currentPDFresources\empty -\let\PDFimageattributes \empty -\let\PDFfigurereference \empty -\let\PDFimagereference \empty - -\ifnum\pdftexversion>13 - - \definespecial\dostartobject#1#2#3#4#5% - {\bgroup - \setbox\nextbox\vbox\bgroup - \def\dodostopobject - {\egroup - \ifx\PDFimagereference\empty - % We also flush page resources, since shared - % resources end up there; otherwise transparencies - % won't work in xforms; some day I will optimize - % this. - \the\everyPDFxform - \finalizeobjectbox\nextbox - \immediate\pdfxform - resources {\currentPDFresources\the\pdfpageresources}% - \nextbox - \global\let\currentPDFresources\empty - \dosetobjectreference{#1}{#2}{\the\pdflastxform}% - \else - \dosetobjectreference{#1}{#2}{-\PDFimagereference}% - \global\let\PDFimagereference\empty - \fi}} - - \definespecial\dostopobject - {\dodostopobject - \egroup} - - \definespecial\doresetobjects - {\global\let\PDFimagereference\empty} - - \definespecial\doinsertobject#1#2% - {\bgroup - \doifobjectreferencefoundelse{#1}{#2} - {\dogetobjectreference{#1}{#2}\PDFobjectreference - \ifnum\PDFobjectreference<0 - \@EA\@EA\@EA\pdfrefximage\@EA\gobbleoneargument\PDFobjectreference - \else - \pdfrefxform\PDFobjectreference - \fi}% - {}% - \egroup} - -\else - - \definespecial\dostartobject#1#2#3#4#5% - {\bgroup - \setbox\nextbox\vbox\bgroup - \def\dodostopobject - {\egroup - \the\everyPDFxform - \pdfform\nextbox - \dosetobjectreference{#1}{#2}{\the\pdflastform}}} - - \definespecial\dostopobject - {\dodostopobject - \egroup} - - \definespecial\doinsertobject#1#2% - {\bgroup - \dogetobjectreference{#1}{#2}\PDFobjectreference - \pdfrefform\PDFobjectreference - \egroup} - -\fi - -\appendtoksonce - \collectPDFresources - \global\let\currentPDFresources\collectedPDFresources -\to \everyPDFxform - -%D \macros -%D {dosetpagetransition} -%D -%D Page transitions only make sence in presentations. They are -%D passed as raw \PDF\ code to the page object. Take a look -%D at the implementation to get an impression of the rubish -%D passed on. - -\definespecial\dosetpagetransition{\doPDFsetpagetransition} - -%D The expansion is needed because else the \type{\pdfpageattr} -%D token list flushes an unexpanded \type{\csname}. The -%D \type{\global} is needed because the assignment can take -%D place deeply buried (for instance in the \type{\shipout} -%D box. - -%D \macros -%D {doinsertcomment, doflushcomments} -%D -%D Text annotation, or comments, are provided too: - -\definespecial\doinsertcomment{\doPDFinsertcomment} -\definespecial\doflushcomments{\doPDFflushcomments} - -%D \macros -%D {dopresetlinefield,dopresettextfield, -%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield, -%D dopresetpushfield,dopresetcheckfield, -%D dopresetradiofield,dopresetradiorecord} -%D -%D \PDF\ offers extensive field support. The next bunch of -%D definitions map the specials. - -\definespecial\dopresetlinefield {\doFDFpresetlinefield} -\definespecial\dopresettextfield {\doFDFpresettextfield} -\definespecial\dopresetchoicefield{\doFDFpresetchoicefield} -\definespecial\dopresetpopupfield {\doFDFpresetpopupfield} -\definespecial\dopresetcombofield {\doFDFpresetcombofield} -\definespecial\dopresetpushfield {\doFDFpresetpushfield} -\definespecial\dopresetcheckfield {\doFDFpresetcheckfield} -\definespecial\dopresetradiofield {\doFDFpresetradiofield} -\definespecial\dopresetradiorecord{\doFDFpresetradiorecord} - -%D \macros -%D {dodefinefieldset,dogetfieldset,doiffieldset} -%D -%D Field sets, needed for reset and submit handling, are -%D taken care of by: - -\definespecial\dodefinefieldset{\doFDFdefinefieldset} -\definespecial\dogetfieldset {\doFDFgetfieldset} -\definespecial\doiffieldset {\doFDFiffieldset} - -%D \macros -%D {doregistercalculationset} -%D -%D The calculation order is defined using: - -\definespecial\doregistercalculationset{\doFDFregistercalculationset} - -%D \macros -%D {doPDFdestination} -%D -%D Finally we implement some low level macros to deal with -%D flushing \PDF\ code. First we handle the named destinations. - -\def\doPDFdestination#1% - {\pdfdest name {#1}\PDFpageviewkey} - -%D \macros -%D {doPDFaction,doPDFannotation,ifsharePDFactions} -%D -%D Next we handle annotations. All link annotations are -%D implemented using the action dictionary. This enables us to -%D use multiple actions. The second macro is for instance -%D used for movie inclusion. - -\newif\ifsharePDFactions \sharePDFactionstrue - -% hm, due to some stupid optimization this feature has been -% disabled for some time, watch out \lastPDFaction is to be -% persistent - -\ifnum\pdftexversion>13 - - \def\doPDFaction#1#2#3% - {\xdef\lastPDFcontent{#3}% - \ifcollectreferenceactions - \global\let\lastPDFaction\lastPDFcontent - \else - \ifsharePDFactions - \ifcase\similarreference\relax - \xdef\lastPDFaction{<<\lastPDFcontent>>}% - \or - \immediate\pdfobj{<<\lastPDFcontent>>}% - \xdef\lastPDFaction{\PDFobjref\pdflastobj}% - \else - % leave \lastPDFaction untouched - \fi - \else - \xdef\lastPDFaction{<<\lastPDFcontent>>}% - \fi - \pdfannot - width #1 height #2 depth \zeropoint - {/Subtype /Link - /Border [0 0 0] - \ifhighlighthyperlinks \else /H /N \fi - /A \lastPDFaction}% - \fi} - -\else - - \def\doPDFaction#1#2#3% - {\ifcollectreferenceactions - \xdef\lastPDFaction{#3}% - \else - \ifsharePDFactions - \ifcase\similarreference\relax - \xdef\lastPDFaction{<<#3>>}% - \or - \immediate\pdfobj{<<#3>>}% - \xdef\lastPDFaction{\PDFobjref\pdflastobj}% - \else - % leave \lastPDFaction untouched - \fi - \else - \xdef\lastPDFaction{<<#3>>}% - \fi - \pdfannotlink % could be \pdfannot if not the - problem was there - width #1 height #2 depth \zeropoint - user {/Subtype /Link - /Border [0 0 0] - \ifhighlighthyperlinks \else /H /N \fi - /A \lastPDFaction}% - \pdfendlink - \fi} - -\fi - -% pdftex and viewers give problems with this one (printing forms) -% -%\def\doPDFannotation#1#2#3% -% {\pdfannot width #1sp height -#2sp depth \zeropoint{#3}} -% -% This is corrected in version 14. When this version is wide -% spread, this will be cleaned up. - -\ifnum\pdftexversion>13 - - \def\doPDFannotation#1#2#3% - {\pdfannot width #1 height #2 depth \zeropoint{#3}} - -\else - - \def\doPDFannotation#1#2#3% - {\hbox{\raise#2\hbox{\pdfannot width #1 height #2 depth \zeropoint{#3}}}} - -\fi - -%D \macros -%D {doPDFannotationobject,doPDFactionobject} -%D -%D For field support we need annotation objects. Although in -%D many cases we can do without indirect references (and use -%D the last annotation object number directly), we take the -%D save route. - -\def\doPDFannotationobject#1#2#3#4#5% - {\doPDFannotation{#3}{#4}{#5}% - \dosetobjectreference{#1}{#2}{\the\pdflastannot}} - -\def\doPDFactionobject#1#2#3#4#5% - {\doPDFaction{#3}{#4}{#5}% - \dosetobjectreference{#1}{#2}{\the\pdflastannot}} - -%D \macros -%D {doPDFaddtocatalog,doPDFaddtoinfo, -%D doPDFpageattribute,doPDFpagesattribute} -%D -%D Next some simple ones. Watch the global directive and the -%D expansion in the page attribute macro. - -\def\doPDFaddtocatalog - {\pdfcatalog} - -\def\doPDFaddtoinfo - {\pdfinfo} - -\def\doPDFpageattribute#1% - {\expanded{\global\pdfpageattr{#1\the\pdfpageattr}}} - -\def\doPDFpageresource#1% - {\expanded{\global\pdfpageresources{#1\the\pdfpageresources}}} - -\def\doPDFpagesattribute#1% - {\expanded{\global\pdfpagesattr{#1\the\pdfpagesattr}}} - -\def\doPDFresetpageattributes - {\global\pdfpageattr\emptytoks} - -\def\doPDFresetpageresources - {\global\pdfpageresources\emptytoks} - -%D \macros -%D {doPDFbookmark} -%D -%D Well, isn't the next one ugly? Thanks to the \PDF\ -%D standard. - -\def\doPDFbookmark#1#2#3#4#5% - {\doPDFgetpagereference{#4}\PDFobjectreference - \pdfoutline - user {<>}% - \ifcase#2 \else count \ifcase#5-\fi#2 \fi - {#3}} - -%D \macros -%D {doPDFdictionaryobject,doPDFarrayobject} -%D -%D Where \PDFTEX\ has only one object primitive, optionally a -%D stream one, \ACROBAT\ has several operators. - -\def\doPDFdictionaryobject#1#2#3% - {\flushatshipout - {\immediate\pdfobj{<< #3 >>}% - \dosetobjectreference{#1}{#2}{\the\pdflastobj}}} - -\def\doPDFarrayobject#1#2#3% - {\flushatshipout - {\immediate\pdfobj{[ #3 ]}% - \dosetobjectreference{#1}{#2}{\the\pdflastobj}}} - -% tricky .. too many xforms now -% -% \def\doreservePDFobject#1#2% -% {\pdfobj reserveobjnum{}% -% \driverreferenced\dosetobjectreference{#1}{#2}{\the\pdflastobj}} -% -% \def\doPDFreserveddictionaryobject#1#2#3% -% {\doPDFgetobjectnumber{#1}{#2}\PDFobjectnumber -% \immediate\pdfobj useobjnum \PDFobjectnumber {<< #3 >>}} -% -% \def\doPDFreservedarrayobject#1#2#3% -% {\doPDFgetobjectnumber{#1}{#2}\PDFobjectnumber -% \immediate\pdfobj useobjnum \PDFobjectnumber {[ #3 ]}} - -% \doreservePDFobject{FDF}{docuextgstates} -% \doreservePDFobject{FDF}{colorspaces} -% \doreservePDFobject{FDF}{docushades} - -%D \macros -%D {defaultobjectreference,doPDFgetobjectreference} -%D -%D Because in \PDFTEX\ we have to construct the object -%D references \type{N 0 R}, we can default to the non existing -%D zero object number. - -\def\defaultobjectreference#1#2% - {0} - -\def\doPDFgetobjectreference#1#2#3% - {\dogetobjectreference{#1}{#2}#3% - \edef#3{\ifx#3\empty null\else\PDFobjref{#3}\fi}} - -\def\doPDFgetobjectnumber#1#2#3% - {\dogetobjectreference{#1}{#2}#3% - \edef#3{\ifx#3\empty 0\else#3\fi}} - -% \def\doPDFgetobjectpage #1#2#3{..} -% \def\doPDFgetobjectpagereference#1#2#3{..} - -\ifx\pdfpageref\undefined - - \def\doPDFgetpagereference % number macro - {\installprogram{texutil --filter \jobname}% - \gdef\doPDFgetpagereference##1{\doPDFgetobjectreference{PDFP}{\number##1}}% {##2} - \doPDFgetpagereference} - -\else - - \def\doPDFgetpagereference#1#2% number macro - {\edef#2{\ifnum#1>\zerocount\PDFobjref{\pdfpageref#1}\else null\fi}} - -\fi - -%D \macros -%D {initializePDFnegative,initializePDFoverprint} -%D -%D Here follow some rather obscure macros. They will only -%D come into action when one wants negated output. - -%D Todo: move code to fdf module - -\def\initializePDFnegative - {\immediate\pdfobj stream attr {/FunctionType 4 /Range [0 1] /Domain [0 1]} {{1 exch sub}}% - \immediate\pdfobj{<>}% - \appendtoPDFdocumentextgstates{/GSnegative \PDFobjref\pdflastobj}% - \immediate\pdfobj{<>}% - \appendtoPDFdocumentextgstates{/GSpositive \PDFobjref\pdflastobj}% - \global\let\initializePDFnegative\relax} - -\def\initializePDFoverprint - {\immediate\pdfobj{<>}% /op defaults to /OP - \appendtoPDFdocumentextgstates{/GSknockout \PDFobjref\pdflastobj}% - \immediate\pdfobj{<>}% /op defaults to /OP - \edef\PDFobjectreferenceB{\the\pdflastobj}% - \appendtoPDFdocumentextgstates{/GSoverprint \PDFobjref\pdflastobj}% - \global\let\initializePDFoverprint\relax} - -%D File embedding. Storing the stream identifier is needed -%D to get access to the number. When typeset, the user can -%D feed this number to \type {pdftosrc} and filter the -%D file from the \PDF\ file. - -\let\PDFlaststreamobject \s!unknown -%def\PDFlaststreamreference{0 0 R} - -\def\doPDFfilestreamobject#1#2#3#4% - {\immediate\pdfobj stream file{#4}% - \edef\PDFlaststreamobject{\the\pdflastobj}% - \dosetobjectreference{PDFFS}{#2}{\PDFlaststreamobject}% - \doPDFdictionaryobject{#1}{#2}{/Type /Filespec /F (#3) /EF <>}} - -\def\doPDFgetfilestreamreference#1#2% - {\doPDFgetobjectreference{PDFFS}{#1}#2} - -\def\doPDFfilestreamidentifier#1% - {\doifsomething{#1} - {\doPDFgetfilestreamreference{#1}\PDFobjectreference - \@EA\beforesplitstring\PDFobjectreference\at{ }\to\PDFlaststreamobject - \PDFlaststreamobject}} - -% %D We can set \METAPOST\ prologues to~1: - -\def\MPprologues{1} - -%D Experimental: - -\definespecial\dostartfonteffect{\doPDFstartfonteffect} -\definespecial\dostopfonteffect {\doPDFstopfonteffect} - -%D Some MP stuff: - -\let\handleMPfshow\dohandleMPfshow % default anyway - -\ifnum\pdftexversion<14 - - \def\setMPPDFobject#1#2% resources boxnumber - {\def\getMPPDFobject{\box#2}} - -\else - - \def\setMPPDFobject#1#2% resources boxnumber - {\the\everyPDFxform - \finalizeobjectbox{#2}% - \immediate\pdfxform resources{#1}#2% - \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}} - -\fi - -\let\getMPPDFobject\relax - -\definespecial\doinsertMPfile#1% - {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}} - -%D Now we can finish this module. - -\stopspecials - -\protect \endinput diff --git a/tex/context/base/spec-tr.mkii b/tex/context/base/spec-tr.mkii new file mode 100644 index 000000000..c1f997bca --- /dev/null +++ b/tex/context/base/spec-tr.mkii @@ -0,0 +1,107 @@ +%D \module +%D [ file=spec-tr, +%D version=1996.01.25, +%D title=\CONTEXT\ Special Macros, +%D subtitle=Thomas Rokicki's \DVIPS, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Especially the rotation proved to be incompatible with +%D the default \POSTSCRIPT\ special driver. Many thanks to +%D Gilbert van den Dobbelsteen for testing and hacking the +%D \DVIPS\ source and pinpointing the problem. + +%D \macros +%D {doinsertfile} +%D +%D We overrule the figure||insertion special. Things should +%D be more accurate, but maybe someday \unknown + +\startspecials[rokicki] + +\def\@@insertpostscriptliteral {ps: } +\def\@@insertpostscriptretain {" } + +%D Ugly but useful: + +\definefileinsertion{tr}{eps} + {\bgroup + \PointsToWholeBigPoints\@@DriverImageWidth \width + \PointsToWholeBigPoints\@@DriverImageHeight\height + \special + {PSfile="\@@DriverImageFile"\space + llx=\EPSllx\space + lly=\EPSlly\space + urx=\EPSurx\space + ury=\EPSury\space + \ifdim\@@DriverImageWidth >\zeropoint rwi=\width 0\space\fi + \ifdim\@@DriverImageHeight>\zeropoint rhi=\height0 \fi}% + \egroup} + +\definefileinsertion{tr}{mps} + {\hbox + {\convertMPcolors\@@DriverImageFile + \dofileinsertion{tr}{eps}}} + +\definespecial\doinsertfile + {\dofileinsertion{tr}\@@DriverImageType} + +%D Some MP stuff: + +\definespecial\doinsertMPfile#1% + {\doiffileelse{./#1}{\includeMPasEPS{./#1}}{\message{[MP #1]}}} + +%D \macros +%D {dostartrotation} +%D +%D Because \DVIPS\ uses a reverse rotation scheme, we have +%D to add an extra \type{neg} to the default \POSTSCRIPT\ +%D rotation definition: + +\definespecial\dostartrotation#1% straight from the YandY manual / 1st neg added + {\special + {\@@insertpostscriptliteral + gsave currentpoint currentpoint translate + \number#1\space\space neg rotate neg exch neg exch translate}} + +\definespecial\dostoprotation + {\special + {\@@insertpostscriptliteral + currentfont currentpoint grestore moveto setfont}} + +%D Drawing ovals in \DVIPS\ is complicated by the fact that +%D the colors get reset. Therefore we need a more literal +%D approach and therefore scale to local units. By redefining +%D the retain constant into a macro, we can use the already +%D present \POSTSCRIPT\ definition (see \type{spec-ps}). + +\definespecial\doovalbox#1#2#3#4#5#6#7#8% variant not yet supported + {\bgroup + \edef\@@insertpostscriptretain gsave% + {\@@insertpostscriptliteral + gsave + Resolution 72 div + VResolution 72 div neg scale currentpoint translate}% + \dosomeovalbox{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% + \egroup} + +%D \macros +%D {dosetuppaper} +%D +%D Relatively new: + +\definespecial\dosetuppaper#1#2#3% + {\begingroup + \!!dimena#2% + \!!dimenb#3% + \special{papersize=\the\!!dimena,\the\!!dimenb}% + \endgroup} + +\stopspecials + +\endinput diff --git a/tex/context/base/spec-tr.tex b/tex/context/base/spec-tr.tex deleted file mode 100644 index c1f997bca..000000000 --- a/tex/context/base/spec-tr.tex +++ /dev/null @@ -1,107 +0,0 @@ -%D \module -%D [ file=spec-tr, -%D version=1996.01.25, -%D title=\CONTEXT\ Special Macros, -%D subtitle=Thomas Rokicki's \DVIPS, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Especially the rotation proved to be incompatible with -%D the default \POSTSCRIPT\ special driver. Many thanks to -%D Gilbert van den Dobbelsteen for testing and hacking the -%D \DVIPS\ source and pinpointing the problem. - -%D \macros -%D {doinsertfile} -%D -%D We overrule the figure||insertion special. Things should -%D be more accurate, but maybe someday \unknown - -\startspecials[rokicki] - -\def\@@insertpostscriptliteral {ps: } -\def\@@insertpostscriptretain {" } - -%D Ugly but useful: - -\definefileinsertion{tr}{eps} - {\bgroup - \PointsToWholeBigPoints\@@DriverImageWidth \width - \PointsToWholeBigPoints\@@DriverImageHeight\height - \special - {PSfile="\@@DriverImageFile"\space - llx=\EPSllx\space - lly=\EPSlly\space - urx=\EPSurx\space - ury=\EPSury\space - \ifdim\@@DriverImageWidth >\zeropoint rwi=\width 0\space\fi - \ifdim\@@DriverImageHeight>\zeropoint rhi=\height0 \fi}% - \egroup} - -\definefileinsertion{tr}{mps} - {\hbox - {\convertMPcolors\@@DriverImageFile - \dofileinsertion{tr}{eps}}} - -\definespecial\doinsertfile - {\dofileinsertion{tr}\@@DriverImageType} - -%D Some MP stuff: - -\definespecial\doinsertMPfile#1% - {\doiffileelse{./#1}{\includeMPasEPS{./#1}}{\message{[MP #1]}}} - -%D \macros -%D {dostartrotation} -%D -%D Because \DVIPS\ uses a reverse rotation scheme, we have -%D to add an extra \type{neg} to the default \POSTSCRIPT\ -%D rotation definition: - -\definespecial\dostartrotation#1% straight from the YandY manual / 1st neg added - {\special - {\@@insertpostscriptliteral - gsave currentpoint currentpoint translate - \number#1\space\space neg rotate neg exch neg exch translate}} - -\definespecial\dostoprotation - {\special - {\@@insertpostscriptliteral - currentfont currentpoint grestore moveto setfont}} - -%D Drawing ovals in \DVIPS\ is complicated by the fact that -%D the colors get reset. Therefore we need a more literal -%D approach and therefore scale to local units. By redefining -%D the retain constant into a macro, we can use the already -%D present \POSTSCRIPT\ definition (see \type{spec-ps}). - -\definespecial\doovalbox#1#2#3#4#5#6#7#8% variant not yet supported - {\bgroup - \edef\@@insertpostscriptretain gsave% - {\@@insertpostscriptliteral - gsave - Resolution 72 div - VResolution 72 div neg scale currentpoint translate}% - \dosomeovalbox{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}% - \egroup} - -%D \macros -%D {dosetuppaper} -%D -%D Relatively new: - -\definespecial\dosetuppaper#1#2#3% - {\begingroup - \!!dimena#2% - \!!dimenb#3% - \special{papersize=\the\!!dimena,\the\!!dimenb}% - \endgroup} - -\stopspecials - -\endinput diff --git a/tex/context/base/spec-tst.mkii b/tex/context/base/spec-tst.mkii new file mode 100644 index 000000000..bdd8a29b2 --- /dev/null +++ b/tex/context/base/spec-tst.mkii @@ -0,0 +1,152 @@ +%D \module +%D [ file=spec-tst, +%D version=2002.12.08, +%D title=\CONTEXT\ \PDF\ Macros, +%D subtitle=Special Test Macro, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +\ifcase \pdfoutput \endinput \fi + +\unprotect + +%D The conversions comes down to (for the sake of speed the +%D implementation combines steps): +%D +%D \startitemize +%D \item we expand the \UTF\ sequences into \type {\unicodechar}'s +%D \item spaces become character 255's (so that they are not +%D gobbled in argument fetching +%D \item normal \ASCII\ chars are unchanged +%D \item \par's and alike are converted to \type {\unicodechar}'s +%D \stopitemize +%D +%D This happens by expansion; next we convert the resulting +%D sequence by interpreting the stream. + +\long\def\sanitizePDFuniencoding#1\to#2% + {\enablePDFunicrlf + \simplifycommands % added due to Dohyun Kim + \let\unicodechar\relax % prevent further expansion + \retainlccodes\lccode32=255 % slooow + \lowercasestring\PDFunicodetrigger#1\to#2% + \edef#2{\expandafter\doPDFuni#2\empty\empty}} % slooow + +%D Handling of empty lines: + +\bgroup +\catcode`\^^M=\@@active +\gdef\enablePDFunicrlf% + {\def\\{\unicodechar{13}}% + \def\par{\\\\}% + \catcode`\^^M=\@@active% + \let^^M=\\} +\egroup + +%D Conversion to 16 bit \UNICODE: + +\def\PDFunicodechar#1% + {\@EA\lchexnumbers\@EA{\number\utfdiv{#1}}% + \@EA\lchexnumbers\@EA{\number\utfmod{#1}}} + +\def\PDFunicodetrigger + {\unicodechar{65279}} + +%D The postprocessor: + +\def\doPDFuni#1% + {\ifx#1\relax + \@EA\dodoPDFuni + \else\ifx#1\empty + % quit + \else + \@EAEAEA\nodoPDFuni + \fi\fi#1} + +\def\nodoPDFuni#1% + {\PDFunicodechar{\ifnum`#1=255 32\else`#1\fi}\doPDFuni} + +\def\dodoPDFuni#1#2% + {\PDFunicodechar{#2}\doPDFuni} + +\def\sanitizePDFencoding + {\doifelse\currentregime{utf}% + {\PDFunicodetrue\sanitizePDFuniencoding}\sanitizePDFdocencoding} + +% pdftex specific + +\def\doPDFinsertbookmark#1#2#3#4#5% level sublevels text page open=1 + {\bgroup + \sanitizePDFencoding#3\to\bookmarktext % uses scratchcounter + \stripstring\bookmarktext + \doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}% + \egroup} + +\def\doPDFbookmark#1#2#3#4#5% + {\doPDFgetpagereference{#4}\PDFobjectreference + \pdfoutline + user {<>}% + \ifcase#2 \else count \ifcase#5-\fi#2 \fi + {\ifPDFunicode<#3>\else#3\fi}} + +\def\doPDFsetupidentity#1#2#3#4#5#6% + {\bgroup + \enablePDFdocencoding + \sanitizePDFencoding#1\to\idtitle \stripstring\idtitle + \sanitizePDFencoding#2\to\idsubject\stripstring\idsubject + \sanitizePDFencoding#3\to\idauthor \stripstring\idauthor + \sanitizePDFencoding#4\to\idcreator\stripstring\idcreator + \sanitizePDFencoding#6\to\idkeyword\stripstring\idkeyword + \expanded{\doPDFaddtoinfo + {/Title \ifPDFunicode<\idtitle >\else(\idtitle )\fi + /Subject \ifPDFunicode<\idsubject>\else(\idsubject)\fi + /Author \ifPDFunicode<\idauthor >\else(\idauthor )\fi + /Creator \ifPDFunicode<\idcreator>\else(\idcreator)\fi + /ModDate (#4) + /ID (\jobname.#5) % needed for pdf/x + /Keywords \ifPDFunicode<\idkeyword>\else(\idkeyword)\fi}}% + \egroup} + +\protect + +\doifnotmode{demo}{\endinput} + +% \input spec-tst.tex + +\mainlanguage[vn] +\enableregime[utf] +\usetypescript[all][computer-modern][t5] + +\setupinteraction + [state=start, + title={Thử tiếng Việt}, + author={Tác Văn Giả}, + keyword={Thử tiếng Việt}] + +\placebookmarks[chapter,section,subsection] + +\starttext + +\placelist[chapter,section,subsection][alternative=c] + +\chapter{Thử tiếng Việt} + +\section {Mục thứ nhất} +\subsection{Mục nhỏ thứ nhất} Thử tiếng Việt +\subsection{Mục nhỏ thứ hai} Thử tiếng Việt + +\section {Mục thứ hai} +\subsection{Mục nhỏ thứ nhất} Thử tiếng Việt +\subsection{Mục nhỏ thứ hai} Thử tiếng Việt + +\section {Mục thứ ba} +\subsection{Mục nhỏ thứ nhất} Thử tiếng Việt +\subsection{Mục nhỏ thứ hai} Thử tiếng Việt + +\stoptext + diff --git a/tex/context/base/spec-tst.tex b/tex/context/base/spec-tst.tex deleted file mode 100644 index bdd8a29b2..000000000 --- a/tex/context/base/spec-tst.tex +++ /dev/null @@ -1,152 +0,0 @@ -%D \module -%D [ file=spec-tst, -%D version=2002.12.08, -%D title=\CONTEXT\ \PDF\ Macros, -%D subtitle=Special Test Macro, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -\ifcase \pdfoutput \endinput \fi - -\unprotect - -%D The conversions comes down to (for the sake of speed the -%D implementation combines steps): -%D -%D \startitemize -%D \item we expand the \UTF\ sequences into \type {\unicodechar}'s -%D \item spaces become character 255's (so that they are not -%D gobbled in argument fetching -%D \item normal \ASCII\ chars are unchanged -%D \item \par's and alike are converted to \type {\unicodechar}'s -%D \stopitemize -%D -%D This happens by expansion; next we convert the resulting -%D sequence by interpreting the stream. - -\long\def\sanitizePDFuniencoding#1\to#2% - {\enablePDFunicrlf - \simplifycommands % added due to Dohyun Kim - \let\unicodechar\relax % prevent further expansion - \retainlccodes\lccode32=255 % slooow - \lowercasestring\PDFunicodetrigger#1\to#2% - \edef#2{\expandafter\doPDFuni#2\empty\empty}} % slooow - -%D Handling of empty lines: - -\bgroup -\catcode`\^^M=\@@active -\gdef\enablePDFunicrlf% - {\def\\{\unicodechar{13}}% - \def\par{\\\\}% - \catcode`\^^M=\@@active% - \let^^M=\\} -\egroup - -%D Conversion to 16 bit \UNICODE: - -\def\PDFunicodechar#1% - {\@EA\lchexnumbers\@EA{\number\utfdiv{#1}}% - \@EA\lchexnumbers\@EA{\number\utfmod{#1}}} - -\def\PDFunicodetrigger - {\unicodechar{65279}} - -%D The postprocessor: - -\def\doPDFuni#1% - {\ifx#1\relax - \@EA\dodoPDFuni - \else\ifx#1\empty - % quit - \else - \@EAEAEA\nodoPDFuni - \fi\fi#1} - -\def\nodoPDFuni#1% - {\PDFunicodechar{\ifnum`#1=255 32\else`#1\fi}\doPDFuni} - -\def\dodoPDFuni#1#2% - {\PDFunicodechar{#2}\doPDFuni} - -\def\sanitizePDFencoding - {\doifelse\currentregime{utf}% - {\PDFunicodetrue\sanitizePDFuniencoding}\sanitizePDFdocencoding} - -% pdftex specific - -\def\doPDFinsertbookmark#1#2#3#4#5% level sublevels text page open=1 - {\bgroup - \sanitizePDFencoding#3\to\bookmarktext % uses scratchcounter - \stripstring\bookmarktext - \doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}% - \egroup} - -\def\doPDFbookmark#1#2#3#4#5% - {\doPDFgetpagereference{#4}\PDFobjectreference - \pdfoutline - user {<>}% - \ifcase#2 \else count \ifcase#5-\fi#2 \fi - {\ifPDFunicode<#3>\else#3\fi}} - -\def\doPDFsetupidentity#1#2#3#4#5#6% - {\bgroup - \enablePDFdocencoding - \sanitizePDFencoding#1\to\idtitle \stripstring\idtitle - \sanitizePDFencoding#2\to\idsubject\stripstring\idsubject - \sanitizePDFencoding#3\to\idauthor \stripstring\idauthor - \sanitizePDFencoding#4\to\idcreator\stripstring\idcreator - \sanitizePDFencoding#6\to\idkeyword\stripstring\idkeyword - \expanded{\doPDFaddtoinfo - {/Title \ifPDFunicode<\idtitle >\else(\idtitle )\fi - /Subject \ifPDFunicode<\idsubject>\else(\idsubject)\fi - /Author \ifPDFunicode<\idauthor >\else(\idauthor )\fi - /Creator \ifPDFunicode<\idcreator>\else(\idcreator)\fi - /ModDate (#4) - /ID (\jobname.#5) % needed for pdf/x - /Keywords \ifPDFunicode<\idkeyword>\else(\idkeyword)\fi}}% - \egroup} - -\protect - -\doifnotmode{demo}{\endinput} - -% \input spec-tst.tex - -\mainlanguage[vn] -\enableregime[utf] -\usetypescript[all][computer-modern][t5] - -\setupinteraction - [state=start, - title={Thử tiếng Việt}, - author={Tác Văn Giả}, - keyword={Thử tiếng Việt}] - -\placebookmarks[chapter,section,subsection] - -\starttext - -\placelist[chapter,section,subsection][alternative=c] - -\chapter{Thử tiếng Việt} - -\section {Mục thứ nhất} -\subsection{Mục nhỏ thứ nhất} Thử tiếng Việt -\subsection{Mục nhỏ thứ hai} Thử tiếng Việt - -\section {Mục thứ hai} -\subsection{Mục nhỏ thứ nhất} Thử tiếng Việt -\subsection{Mục nhỏ thứ hai} Thử tiếng Việt - -\section {Mục thứ ba} -\subsection{Mục nhỏ thứ nhất} Thử tiếng Việt -\subsection{Mục nhỏ thứ hai} Thử tiếng Việt - -\stoptext - diff --git a/tex/context/base/spec-var.mkii b/tex/context/base/spec-var.mkii new file mode 100644 index 000000000..8d561dc6f --- /dev/null +++ b/tex/context/base/spec-var.mkii @@ -0,0 +1,83 @@ +%D \module +%D [ file=spec-var, +%D version=2003.10.10, +%D title=\CONTEXT\ Special Macros, +%D subtitle=Variables, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module used to be integrated in \type {spec-ini}, +%D but testing optimization is more convenient this way. + +\writestatus{loading}{ConTeXt Special Macros / Variables} + +% new approach, 'global' variables, since we run out of +% arguments + +\unprotect + +% This variable holds a comma separated list of (supported) figure +% types. It may be changes by other modules. + +\let\figuretypes\empty + +\ifx\undefined\@@DriverFieldName + + \letempty \@@DriverFieldName + \letempty \@@DriverFieldWidth + \letempty \@@DriverFieldHeight + \letempty \@@DriverFieldDefault + \letempty \@@DriverFieldNumber + \letempty \@@DriverFieldNumber + \letempty \@@DriverFieldStyle + \letempty \@@DriverFieldColor + \letempty \@@DriverFieldBackgroundColor + \letempty \@@DriverFieldFrameColor + \letempty \@@DriverFieldLayer + \letempty \@@DriverFieldOption + \letempty \@@DriverFieldAlign + \letempty \@@DriverFieldClickIn + \letempty \@@DriverFieldClickOut + \letempty \@@DriverFieldRegionIn + \letempty \@@DriverFieldRegionOut + \letempty \@@DriverFieldAfterKey + \letempty \@@DriverFieldFormat + \letempty \@@DriverFieldValidate + \letempty \@@DriverFieldCalculate + \letempty \@@DriverFieldFocusIn + \letempty \@@DriverFieldFocusOut + +\fi + +\ifx\undefined\@@DriverCommentLayer + + \letempty \@@DriverCommentLayer + +\fi + +\ifx\undefined\@@DriverAttachmentLayer + + \letempty \@@DriverAttachmentLayer + +\fi + +\ifx\undefined\@@DriverImageBox + + \letempty \@@DriverImageBox + \letempty \@@DriverImageOptions + \letempty \@@DriverImageWidth + \letempty \@@DriverImageHeight + \letempty \@@DriverImageFile + \letempty \@@DriverImageLabel + \letempty \@@DriverImageType + \letempty \@@DriverImageMethod + \letempty \@@DriverImagePage + +\fi + +\protect \endinput diff --git a/tex/context/base/spec-var.tex b/tex/context/base/spec-var.tex deleted file mode 100644 index 8d561dc6f..000000000 --- a/tex/context/base/spec-var.tex +++ /dev/null @@ -1,83 +0,0 @@ -%D \module -%D [ file=spec-var, -%D version=2003.10.10, -%D title=\CONTEXT\ Special Macros, -%D subtitle=Variables, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module used to be integrated in \type {spec-ini}, -%D but testing optimization is more convenient this way. - -\writestatus{loading}{ConTeXt Special Macros / Variables} - -% new approach, 'global' variables, since we run out of -% arguments - -\unprotect - -% This variable holds a comma separated list of (supported) figure -% types. It may be changes by other modules. - -\let\figuretypes\empty - -\ifx\undefined\@@DriverFieldName - - \letempty \@@DriverFieldName - \letempty \@@DriverFieldWidth - \letempty \@@DriverFieldHeight - \letempty \@@DriverFieldDefault - \letempty \@@DriverFieldNumber - \letempty \@@DriverFieldNumber - \letempty \@@DriverFieldStyle - \letempty \@@DriverFieldColor - \letempty \@@DriverFieldBackgroundColor - \letempty \@@DriverFieldFrameColor - \letempty \@@DriverFieldLayer - \letempty \@@DriverFieldOption - \letempty \@@DriverFieldAlign - \letempty \@@DriverFieldClickIn - \letempty \@@DriverFieldClickOut - \letempty \@@DriverFieldRegionIn - \letempty \@@DriverFieldRegionOut - \letempty \@@DriverFieldAfterKey - \letempty \@@DriverFieldFormat - \letempty \@@DriverFieldValidate - \letempty \@@DriverFieldCalculate - \letempty \@@DriverFieldFocusIn - \letempty \@@DriverFieldFocusOut - -\fi - -\ifx\undefined\@@DriverCommentLayer - - \letempty \@@DriverCommentLayer - -\fi - -\ifx\undefined\@@DriverAttachmentLayer - - \letempty \@@DriverAttachmentLayer - -\fi - -\ifx\undefined\@@DriverImageBox - - \letempty \@@DriverImageBox - \letempty \@@DriverImageOptions - \letempty \@@DriverImageWidth - \letempty \@@DriverImageHeight - \letempty \@@DriverImageFile - \letempty \@@DriverImageLabel - \letempty \@@DriverImageType - \letempty \@@DriverImageMethod - \letempty \@@DriverImagePage - -\fi - -\protect \endinput diff --git a/tex/context/base/spec-win.mkii b/tex/context/base/spec-win.mkii new file mode 100644 index 000000000..73db8830e --- /dev/null +++ b/tex/context/base/spec-win.mkii @@ -0,0 +1,99 @@ +%D \module +%D [ file=spec-win, +%D version=1996.01.25, +%D title=\CONTEXT\ Special Macros, +%D subtitle=\YandY's \DVIWINDO, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Remark: chained references are not yet implemented. + +%D \macros +%D {dosetupinteraction, +%D dostartthisislocation, +%D dostartthisisrealpage, +%D dostartgotolocation, +%D dostartgotorealpage, +%D dostartrunprogram, +%D usepagedestinations} +%D {} +%D +%D As told before, these were the first interactive specials. +%D In those days, these kind of specials were still elegant +%D and straightforward. + +\startspecials[dviwindo] + +\definespecial\dosetupinteraction% + {\showmessage\m!interactions{21}{dviwindo}} + +\definespecial\dostartgotolocation#1#2#3#4#5#6% + {\bgroup + \doifelsenothing{#3} + {\doifelsenothing{#4} + {\!!doneafalse} + {\doifparentfileelse{#4} + {\!!doneafalse} + {\!!doneatrue}}% + \setreferencefilename#4\to\DVIfile + \scratchdimen#1\edef\width {\the\scratchdimen\space}% + \scratchdimen#2\edef\height{\the\scratchdimen\space}% + \special + {button: + \width \height + \if!!donea + file: \DVIfile, + \fi + "#5"}} + {}% nog uri afhandelen + \egroup} + +\definespecial\dostartgotorealpage#1#2#3#4#5% + {\bgroup + \doifelsenothing{#3} + {\doifelsenothing{#4} + {\!!doneafalse} + {\doifparentfileelse{#4} + {\!!doneafalse} + {\!!doneatrue}}% + \setreferencefilename#4\to\DVIfile + \scratchdimen#1\edef\width {\the\scratchdimen\space}% + \scratchdimen#2\edef\height{\the\scratchdimen\space}% + \special + {button: + \width \height + \if!!donea + file: \DVIfile, + \fi + \ifnum0#5=0 \else + page: #5 + \fi}} + {}% nog uri afhandelen + \egroup} + +\definespecial\dostartthisislocation#1% + {\special{mark: "#1"}} + +\definespecial\dostartthisisrealpage#1% + {} + +\definespecial\dostartrunprogram#1#2#3#4% + {\bgroup + \scratchdimen#1\edef\width {\the\scratchdimen\space}% + \scratchdimen#2\edef\height{\the\scratchdimen\space}% + \special{button: \width \height launch: #3 #4}% + \egroup} + +\let\doyandyinsertmov = \docommoninsertmov +\let\dotrinsertmov = \docommoninsertmov + +\stopspecials + +\protect \endinput diff --git a/tex/context/base/spec-win.tex b/tex/context/base/spec-win.tex deleted file mode 100644 index 73db8830e..000000000 --- a/tex/context/base/spec-win.tex +++ /dev/null @@ -1,99 +0,0 @@ -%D \module -%D [ file=spec-win, -%D version=1996.01.25, -%D title=\CONTEXT\ Special Macros, -%D subtitle=\YandY's \DVIWINDO, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Remark: chained references are not yet implemented. - -%D \macros -%D {dosetupinteraction, -%D dostartthisislocation, -%D dostartthisisrealpage, -%D dostartgotolocation, -%D dostartgotorealpage, -%D dostartrunprogram, -%D usepagedestinations} -%D {} -%D -%D As told before, these were the first interactive specials. -%D In those days, these kind of specials were still elegant -%D and straightforward. - -\startspecials[dviwindo] - -\definespecial\dosetupinteraction% - {\showmessage\m!interactions{21}{dviwindo}} - -\definespecial\dostartgotolocation#1#2#3#4#5#6% - {\bgroup - \doifelsenothing{#3} - {\doifelsenothing{#4} - {\!!doneafalse} - {\doifparentfileelse{#4} - {\!!doneafalse} - {\!!doneatrue}}% - \setreferencefilename#4\to\DVIfile - \scratchdimen#1\edef\width {\the\scratchdimen\space}% - \scratchdimen#2\edef\height{\the\scratchdimen\space}% - \special - {button: - \width \height - \if!!donea - file: \DVIfile, - \fi - "#5"}} - {}% nog uri afhandelen - \egroup} - -\definespecial\dostartgotorealpage#1#2#3#4#5% - {\bgroup - \doifelsenothing{#3} - {\doifelsenothing{#4} - {\!!doneafalse} - {\doifparentfileelse{#4} - {\!!doneafalse} - {\!!doneatrue}}% - \setreferencefilename#4\to\DVIfile - \scratchdimen#1\edef\width {\the\scratchdimen\space}% - \scratchdimen#2\edef\height{\the\scratchdimen\space}% - \special - {button: - \width \height - \if!!donea - file: \DVIfile, - \fi - \ifnum0#5=0 \else - page: #5 - \fi}} - {}% nog uri afhandelen - \egroup} - -\definespecial\dostartthisislocation#1% - {\special{mark: "#1"}} - -\definespecial\dostartthisisrealpage#1% - {} - -\definespecial\dostartrunprogram#1#2#3#4% - {\bgroup - \scratchdimen#1\edef\width {\the\scratchdimen\space}% - \scratchdimen#2\edef\height{\the\scratchdimen\space}% - \special{button: \width \height launch: #3 #4}% - \egroup} - -\let\doyandyinsertmov = \docommoninsertmov -\let\dotrinsertmov = \docommoninsertmov - -\stopspecials - -\protect \endinput diff --git a/tex/context/base/spec-xet.mkii b/tex/context/base/spec-xet.mkii new file mode 100644 index 000000000..0cbd55ba7 --- /dev/null +++ b/tex/context/base/spec-xet.mkii @@ -0,0 +1,66 @@ +%D \module +%D [ file=spec-xtx, +%D version=2004.11.08, +%D title=\CONTEXT\ Special Macros, +%D subtitle=\XETEX\ support, +%D author={Adam Lindsay \& Hans Hagen \& \unknown}, +%D date=\currentdate, +%D copyright={Adam Lindsay \& Hans Hagen}] + +\unprotect + +\definespecial\doinsertfile + {\dofileinsertion{xtx}\@@DriverImageType} + +\definefileinsertion{xtx}{jpg}{\xtxhandleotherimage} +\definefileinsertion{xtx}{png}{\xtxhandleotherimage} +\definefileinsertion{xtx}{gif}{\xtxhandleotherimage} +\definefileinsertion{xtx}{tif}{\xtxhandleotherimage} +\definefileinsertion{xtx}{pdf}{\xtxhandlepdfimage } + +\def\checkpdfimagepagenumber + {\edef\pdfimagepagenumber + {\ifx\@@DriverImagePage\empty\else\ifnum\@@DriverImagePage>\zerocount + \space page\space\@@DriverImagePage\space + \fi\fi}} + +\def\xtxhandleotherimage + {\XeTeXpicfile "\@@DriverImageFile" + \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \space\fi + \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight \fi + \relax} + +\def\xtxhandlepdfimage + {\checkpdfimagepagenumber + \XeTeXpdffile "\@@DriverImageFile" + \pdfimagepagenumber + \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \space\fi + \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight \fi + \relax} + +\def\dogetXTXfiguresize + {\setbox\foundexternalfigure\vbox{\XeTeXpicfile "\@@DriverImageFile"\relax}% + \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}% + \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}} + +\def\dogetXTXpdfsize + {\checkpdfimagepagenumber + \setbox\foundexternalfigure\vbox{\XeTeXpdffile "\@@DriverImageFile" \pdfimagepagenumber\relax}% + \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}% + \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}} + +\definefilechecker{xtx}{png}{\dogetXTXfiguresize} +\definefilechecker{xtx}{jpg}{\dogetXTXfiguresize} +\definefilechecker{xtx}{gif}{\dogetXTXfiguresize} +\definefilechecker{xtx}{tif}{\dogetXTXfiguresize} +\definefilechecker{xtx}{pdf}{\dogetXTXpdfsize } + +\definespecial\dogetfiguresize + {\dofilechecker{xtx}\@@DriverImageType} + +%D The figure object system caused no end of headaches. They all +%D went away with this single line: + +\setupexternalfigures[\c!object=\v!no] + +\protect \endinput diff --git a/tex/context/base/spec-xet.tex b/tex/context/base/spec-xet.tex deleted file mode 100644 index 0cbd55ba7..000000000 --- a/tex/context/base/spec-xet.tex +++ /dev/null @@ -1,66 +0,0 @@ -%D \module -%D [ file=spec-xtx, -%D version=2004.11.08, -%D title=\CONTEXT\ Special Macros, -%D subtitle=\XETEX\ support, -%D author={Adam Lindsay \& Hans Hagen \& \unknown}, -%D date=\currentdate, -%D copyright={Adam Lindsay \& Hans Hagen}] - -\unprotect - -\definespecial\doinsertfile - {\dofileinsertion{xtx}\@@DriverImageType} - -\definefileinsertion{xtx}{jpg}{\xtxhandleotherimage} -\definefileinsertion{xtx}{png}{\xtxhandleotherimage} -\definefileinsertion{xtx}{gif}{\xtxhandleotherimage} -\definefileinsertion{xtx}{tif}{\xtxhandleotherimage} -\definefileinsertion{xtx}{pdf}{\xtxhandlepdfimage } - -\def\checkpdfimagepagenumber - {\edef\pdfimagepagenumber - {\ifx\@@DriverImagePage\empty\else\ifnum\@@DriverImagePage>\zerocount - \space page\space\@@DriverImagePage\space - \fi\fi}} - -\def\xtxhandleotherimage - {\XeTeXpicfile "\@@DriverImageFile" - \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \space\fi - \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight \fi - \relax} - -\def\xtxhandlepdfimage - {\checkpdfimagepagenumber - \XeTeXpdffile "\@@DriverImageFile" - \pdfimagepagenumber - \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \space\fi - \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight \fi - \relax} - -\def\dogetXTXfiguresize - {\setbox\foundexternalfigure\vbox{\XeTeXpicfile "\@@DriverImageFile"\relax}% - \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}% - \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}} - -\def\dogetXTXpdfsize - {\checkpdfimagepagenumber - \setbox\foundexternalfigure\vbox{\XeTeXpdffile "\@@DriverImageFile" \pdfimagepagenumber\relax}% - \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}% - \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}} - -\definefilechecker{xtx}{png}{\dogetXTXfiguresize} -\definefilechecker{xtx}{jpg}{\dogetXTXfiguresize} -\definefilechecker{xtx}{gif}{\dogetXTXfiguresize} -\definefilechecker{xtx}{tif}{\dogetXTXfiguresize} -\definefilechecker{xtx}{pdf}{\dogetXTXpdfsize } - -\definespecial\dogetfiguresize - {\dofilechecker{xtx}\@@DriverImageType} - -%D The figure object system caused no end of headaches. They all -%D went away with this single line: - -\setupexternalfigures[\c!object=\v!no] - -\protect \endinput diff --git a/tex/context/base/spec-xtx.mkii b/tex/context/base/spec-xtx.mkii new file mode 100644 index 000000000..799c6ca8d --- /dev/null +++ b/tex/context/base/spec-xtx.mkii @@ -0,0 +1,87 @@ +%D \module +%D [ file=spec-xtx, +%D version=2004.11.08, +%D title=\CONTEXT\ Special Macros, +%D subtitle=\XETEX\ support, +%D author={Adam Lindsay \& Hans Hagen \& \unknown}, +%D date=\currentdate, +%D copyright={Adam Lindsay \& Hans Hagen}] + +\unprotect + +\startspecials[xetex][reset,dpx] + +%D Actually, there's an intermediate ``\type{xdv}'' +%D output format, but by default, it's tranparently +%D converted to \PDF\ by \XETEX. + +\setjobsuffix{pdf} + +%D Rotation looks fine. + +\definespecial\dostartrotation#1% + {\special{x:gsave}\special{x:rotate #1}} + +\definespecial\dostoprotation + {\special{x:grestore}} + +%D Scaling and mirroring are also fine. + +\definespecial\dostartscaling#1#2% + {\special{x:gsave}\special{x:scale #1 #2}} + +\definespecial\dostopscaling + {\special{x:grestore}} + +\definespecial\dostartmirroring + {\special{x:gsave}\special{x:scale -1 1}} + +\definespecial\dostopmirroring + {\special{x:grestore}} + +%D Colors are done with the \DVIPDFMX\ color model, which are +%D inherited. + +%D Although hex colors were accommodated by Hans, we'll try the +%D more familiar \DVIPDFMX\ ones. One good side-effect of the +%D previous approach was that it kept track of the color state +%D (transparency in XeTeX is accomplished setting the color to +%D an RGBA quadruple, rather than an RGB triple). So transparency +%D will need another plan. + +% \macros +% {dostarttransparency,dostoptransparency} +% +% \starttypen +% \dostarttransparency{fraction}{type} +% \dostoptransparency +% \stoptypen +% +% Although in \CONTEXT\ transparency is closely integrated +% in the color drivers, in the end it is an independent +% feature. + +%\installspecial [\dostarttransparency] [or] [2] +%\installspecial [\dostoptransparency] [or] [0] + +%D \macros +%D {doloadmapfile,doloadmapline,doresetmapfilelist} +%D +%D \XETEX\ 0.91 allows map file additions, via a special. + +\definespecial\doresetmapfilelist{\special{x:fontmapfile original-empty.map}} +\definespecial\doloadmapfile #1#2{\special{x:fontmapfile #1#2}} +\definespecial\doloadmapline #1#2{\special{x:fontmapline #1#2}} + +%D \macros +%D {dosetuppaper} + +\ifx\pdfpagewidth\undefined \else + \definespecial\dosetuppaper#1#2#3% + {\global\pdfpagewidth #2\relax + \global\pdfpageheight#3\relax} +\fi + +\stopspecials + +\protect \endinput diff --git a/tex/context/base/spec-xtx.tex b/tex/context/base/spec-xtx.tex deleted file mode 100644 index 799c6ca8d..000000000 --- a/tex/context/base/spec-xtx.tex +++ /dev/null @@ -1,87 +0,0 @@ -%D \module -%D [ file=spec-xtx, -%D version=2004.11.08, -%D title=\CONTEXT\ Special Macros, -%D subtitle=\XETEX\ support, -%D author={Adam Lindsay \& Hans Hagen \& \unknown}, -%D date=\currentdate, -%D copyright={Adam Lindsay \& Hans Hagen}] - -\unprotect - -\startspecials[xetex][reset,dpx] - -%D Actually, there's an intermediate ``\type{xdv}'' -%D output format, but by default, it's tranparently -%D converted to \PDF\ by \XETEX. - -\setjobsuffix{pdf} - -%D Rotation looks fine. - -\definespecial\dostartrotation#1% - {\special{x:gsave}\special{x:rotate #1}} - -\definespecial\dostoprotation - {\special{x:grestore}} - -%D Scaling and mirroring are also fine. - -\definespecial\dostartscaling#1#2% - {\special{x:gsave}\special{x:scale #1 #2}} - -\definespecial\dostopscaling - {\special{x:grestore}} - -\definespecial\dostartmirroring - {\special{x:gsave}\special{x:scale -1 1}} - -\definespecial\dostopmirroring - {\special{x:grestore}} - -%D Colors are done with the \DVIPDFMX\ color model, which are -%D inherited. - -%D Although hex colors were accommodated by Hans, we'll try the -%D more familiar \DVIPDFMX\ ones. One good side-effect of the -%D previous approach was that it kept track of the color state -%D (transparency in XeTeX is accomplished setting the color to -%D an RGBA quadruple, rather than an RGB triple). So transparency -%D will need another plan. - -% \macros -% {dostarttransparency,dostoptransparency} -% -% \starttypen -% \dostarttransparency{fraction}{type} -% \dostoptransparency -% \stoptypen -% -% Although in \CONTEXT\ transparency is closely integrated -% in the color drivers, in the end it is an independent -% feature. - -%\installspecial [\dostarttransparency] [or] [2] -%\installspecial [\dostoptransparency] [or] [0] - -%D \macros -%D {doloadmapfile,doloadmapline,doresetmapfilelist} -%D -%D \XETEX\ 0.91 allows map file additions, via a special. - -\definespecial\doresetmapfilelist{\special{x:fontmapfile original-empty.map}} -\definespecial\doloadmapfile #1#2{\special{x:fontmapfile #1#2}} -\definespecial\doloadmapline #1#2{\special{x:fontmapline #1#2}} - -%D \macros -%D {dosetuppaper} - -\ifx\pdfpagewidth\undefined \else - \definespecial\dosetuppaper#1#2#3% - {\global\pdfpagewidth #2\relax - \global\pdfpageheight#3\relax} -\fi - -\stopspecials - -\protect \endinput diff --git a/tex/context/base/spec-yy.mkii b/tex/context/base/spec-yy.mkii new file mode 100644 index 000000000..beec95493 --- /dev/null +++ b/tex/context/base/spec-yy.mkii @@ -0,0 +1,90 @@ +%D \module +%D [ file=spec-yy, +%D version=1996.01.25, +%D title=\CONTEXT\ Special Macros, +%D subtitle=\YandY's \DVIPSONE\ and \DVIWINDO, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 \macros +%D {dostartgraymode,dostopgraymode, +%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode, +%D doinsertfile} +%D +%D We implement a nice and simple figure||insertion special +%D and make use of \YandY's color specials. Otherwise \DVIWINDO\ +%D would not show colors. + +\startspecials[yandy] + +\def\@@insertpostscriptliteral {ps: } +\def\@@insertpostscriptretain {" } % this was: {postscript} + +\definespecial\dostartgraymode#1% + {\special{color gray #1}} + +\definespecial\dostopgraymode% + {\special{color gray 0}} + +\definespecial\dostartrgbcolormode#1#2#3% + {\special{color rgb #1 #2 #3}} + +\definespecial\dostartcmykcolormode#1#2#3#4% + {\special{color cmyk #1 #2 #3 #4}} + +\definespecial\dostartgraycolormode#1% + {\special{color gray #1}} + +\definespecial\dostopcolormode% + {\special{color gray 0}} + +% \definefileinsertion{yy}{eps}% +% {\PointsToBigPoints\@@DriverImageWidth \width +% \PointsToBigPoints\@@DriverImageHeight\height +% \special +% {psfile=\@@DriverImageFile\space +% %hscale=100\space +% %vscale=100\space +% hoffset=\width\space +% voffset=\height}} + +\definefileinsertion{tr}{eps} + {\bgroup + \PointsToWholeBigPoints\@@DriverImageWidth \width + \PointsToWholeBigPoints\@@DriverImageHeight\height + \special + {PSfile="\@@DriverImageFile"\space + llx=\EPSllx\space + lly=\EPSlly\space + urx=\EPSurx\space + ury=\EPSury\space + \ifdim\@@DriverImageWidth >\zeropoint rwi=\width 0\space\fi + \ifdim\@@DriverImageHeight>\zeropoint rhi=\height0 \fi}% + \egroup} + +\definefileinsertion{yy}{mps} + {\hbox + {\includeMPfonts \@@DriverImageFile + \convertMPcolors\@@DriverImageFile + \dofileinsertion{yy}{eps}}} + +\definefileinsertion{yy}{tif} + {\special{insertimage: + \@@DriverImageFile \space + \@@DriverImageWidth\space + \@@DriverImageHeight}} + +\definespecial\doinsertfile + {\dofileinsertion{yy}\@@DriverImageType} + +\def\MPprologues{1} +\def\MPOSTdriver{dvipsone} + +\stopspecials + +\endinput diff --git a/tex/context/base/spec-yy.tex b/tex/context/base/spec-yy.tex deleted file mode 100644 index beec95493..000000000 --- a/tex/context/base/spec-yy.tex +++ /dev/null @@ -1,90 +0,0 @@ -%D \module -%D [ file=spec-yy, -%D version=1996.01.25, -%D title=\CONTEXT\ Special Macros, -%D subtitle=\YandY's \DVIPSONE\ and \DVIWINDO, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 \macros -%D {dostartgraymode,dostopgraymode, -%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode, -%D doinsertfile} -%D -%D We implement a nice and simple figure||insertion special -%D and make use of \YandY's color specials. Otherwise \DVIWINDO\ -%D would not show colors. - -\startspecials[yandy] - -\def\@@insertpostscriptliteral {ps: } -\def\@@insertpostscriptretain {" } % this was: {postscript} - -\definespecial\dostartgraymode#1% - {\special{color gray #1}} - -\definespecial\dostopgraymode% - {\special{color gray 0}} - -\definespecial\dostartrgbcolormode#1#2#3% - {\special{color rgb #1 #2 #3}} - -\definespecial\dostartcmykcolormode#1#2#3#4% - {\special{color cmyk #1 #2 #3 #4}} - -\definespecial\dostartgraycolormode#1% - {\special{color gray #1}} - -\definespecial\dostopcolormode% - {\special{color gray 0}} - -% \definefileinsertion{yy}{eps}% -% {\PointsToBigPoints\@@DriverImageWidth \width -% \PointsToBigPoints\@@DriverImageHeight\height -% \special -% {psfile=\@@DriverImageFile\space -% %hscale=100\space -% %vscale=100\space -% hoffset=\width\space -% voffset=\height}} - -\definefileinsertion{tr}{eps} - {\bgroup - \PointsToWholeBigPoints\@@DriverImageWidth \width - \PointsToWholeBigPoints\@@DriverImageHeight\height - \special - {PSfile="\@@DriverImageFile"\space - llx=\EPSllx\space - lly=\EPSlly\space - urx=\EPSurx\space - ury=\EPSury\space - \ifdim\@@DriverImageWidth >\zeropoint rwi=\width 0\space\fi - \ifdim\@@DriverImageHeight>\zeropoint rhi=\height0 \fi}% - \egroup} - -\definefileinsertion{yy}{mps} - {\hbox - {\includeMPfonts \@@DriverImageFile - \convertMPcolors\@@DriverImageFile - \dofileinsertion{yy}{eps}}} - -\definefileinsertion{yy}{tif} - {\special{insertimage: - \@@DriverImageFile \space - \@@DriverImageWidth\space - \@@DriverImageHeight}} - -\definespecial\doinsertfile - {\dofileinsertion{yy}\@@DriverImageType} - -\def\MPprologues{1} -\def\MPOSTdriver{dvipsone} - -\stopspecials - -\endinput diff --git a/tex/context/base/strc-bkm.lua b/tex/context/base/strc-bkm.lua index 1104157bd..8f8a3ca24 100644 --- a/tex/context/base/strc-bkm.lua +++ b/tex/context/base/strc-bkm.lua @@ -6,75 +6,22 @@ if not modules then modules = { } end modules ['strc-bkm'] = { license = "see context related readme files" } --- todo: move some code to backend +-- Future version will support adding arbitrary bookmarks with +-- associated complex actions (rather trivial to implement). local format, concat, gsub = string.format, table.concat, string.gsub local texsprint, utfvalues = tex.sprint, string.utfvalues local ctxcatcodes = tex.ctxcatcodes -local lists = structure.lists - --- todo: backend code - -local function pdfhexified(str) - local t = { } - t[#t+1] = "feff" - for b in utfvalues(str) do - if b < 0x10000 then - t[#t+1] = format("%04x",b) - else - t[#t+1] = format("%04x%04x",b/1024+0xD800,b%1024+0xDC00) - end - end - return concat(t) -end - --- todo: lpeg cleaner - -local function pdfbookmark(level,n,text,page,open) - text = gsub(text,"\\([A-Z]+)","%1") -- \LOGO - text = gsub(text,"\\ "," ") -- \ - text = gsub(text,"\\([A-Za-z]+) *{(.-)}","%1") -- \bla{...} - text = gsub(text," +"," ") -- spaces - text = pdfhexified(text) -- somehow must happen here - texsprint(ctxcatcodes,format("\\doinsertbookmark{%s}{%s}{%s}{%s}{%s}",level,n,text,page,open)) -end - --- end of todo - +local lists = structure.lists local levelmap = structure.sections.levelmap structure.bookmarks = structure.bookmarks or { } local bookmarks = structure.bookmarks -local function nofchildren(list,current,currentlevel) - local i = current + 1 - local li = list[i] - if li then - local nextlevel = levelmap[li.metadata.name] - if nextlevel and nextlevel > currentlevel then - local n = 1 - i = i + 1 - li = list[i] - while li do - local somelevel = levelmap[li.metadata.name] - if somelevel then - if somelevel == nextlevel then - n = n + 1 - elseif somelevel < nextlevel then - break - end - end - i = i + 1 - li = list[i] - end - return n - end - end - return 0 -end +bookmarks.method = "internal" -- or "page" local names, opened = "", "" @@ -83,34 +30,6 @@ function bookmarks.register(n,o) if opened == "" then opened = o else opened = opened .. "," .. o end end -function bookmarks.place() - if name ~= "" then - local list = lists.filter(names,"all",nil,lists.collected) - if #list > 0 then - local allopen = (opened == interfaces.variables.all) and 1 - opened = aux.settings_to_set(opened) - for i=1,#list do - local li = list[i] - local metadata = li.metadata - if not metadata.nolist and levelmap[metadata.name] then - local name, titledata = metadata.name, li.titledata - if titledata then - local level = levelmap[name] - local children = nofchildren(list,i,level) - local title = titledata.bookmark or titledata.title or "?" - local realpage = li.references and li.references.realpage - if realpage then - local open = allopen or (opened[name] and 1) - pdfbookmark(level,children,title,realpage,allopen or open or 0) - end - end - end - end - bookmarks.place = function() end - end - end -end - function bookmarks.overload(name,text) local l, ls = lists.tobesaved, nil if #l == 0 then @@ -131,3 +50,38 @@ function bookmarks.overload(name,text) ls.titledata.bookmark = text end end + +local function stripped(str) -- kind of generic + str = gsub(str,"\\([A-Z]+)","%1") -- \LOGO + str = gsub(str,"\\ "," ") -- \ + str = gsub(str,"\\([A-Za-z]+) *{(.-)}","%1") -- \bla{...} + str = gsub(str," +"," ") -- spaces + return str +end + +function bookmarks.place() + if names ~= "" then + local list = lists.filter(names,"all",nil,lists.collected) + if #list > 0 then + local opened, levels = aux.settings_to_set(opened), { } + for i=1,#list do + local li = list[i] + local metadata = li.metadata + local name = metadata.name + if not metadata.nolist and levelmap[name] then + local titledata = li.titledata + if titledata then + levels[#levels+1] = { + levelmap[name], + stripped(titledata.bookmark or titledata.title or "?"), + li.references, -- has internal and realpage + allopen or opened[name] + } + end + end + end + backends.codeinjections.addbookmarks(levels,bookmarks.method) + end + function bookmarks.place() end -- prevent second run + end +end diff --git a/tex/context/base/strc-def.mkiv b/tex/context/base/strc-def.mkiv index f24ee2023..2395ddf6c 100644 --- a/tex/context/base/strc-def.mkiv +++ b/tex/context/base/strc-def.mkiv @@ -81,10 +81,6 @@ \c!ownnumber=\v!no, %\c!page=, \c!placehead=\v!yes, - %\c!prefix=, - \c!previousnumber=\v!yes, - \c!resetnumber=\v!yes, - %\c!section=, \c!sectionconversionset=\s!default, \c!sectionnumber=\v!yes, %\c!sectionsegments=, @@ -103,9 +99,17 @@ % \setupstructureblock[appendix][sectionconversionset=appendix] % \setupstructurehead[chapter][sectionconversionset=\structureblockparameter\c!sectionconversionset] % \structureblockparameter] +% \definestructureresetset[default][0,1,1,0][1] % this will not reset parts and subsections +% \setuphead[part][sectionresetset=default] +% \starttext +% \placelist[chapter,section,subsection][criterium=all,width=3cm] +% \part{first} \chapter{alpha} \section{a} \section{b} \subsection{x} \subsection{y} \chapter{beta} +% \part{second} \chapter{gamma} \section{a} \section{b} \subsection{x} \subsection{y} \chapter{delta} +% \stoptext + \definestructureseparatorset [\s!default] [] [.] \definestructureconversionset [\s!default] [] [numbers] -\definestructureresetset [\s!default] [] [0] +\definestructureresetset [\s!default] [] [1] \definestructureprefixset [\s!default] [section-1,section-2,section-3] [] \definestructureprefixset [\v!all] [section-1,section-2,section-3,section-4,section-5,section-6,section-7,section-8] [] diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv index f2fbe2329..42e216789 100644 --- a/tex/context/base/strc-des.mkiv +++ b/tex/context/base/strc-des.mkiv @@ -485,6 +485,7 @@ \dodescriptionheadtext{#1}% \iftrialtypesetting \else \currentdescriptionsynchronize + \dosetattribute{destination}\currentdescriptionattribute % todo \fi} \def\dodescriptionheadtext#1% title @@ -619,6 +620,7 @@ \fi \iftrialtypesetting \else \currentdescriptionsynchronize + \dosetattribute{destination}\currentdescriptionattribute % todo \fi} \def\doenumerationsavecounter {\savestructurecounter[\currentdescriptionnumber]} @@ -737,8 +739,8 @@ \globallet\currentdescriptionlisttitle \currentdescriptiontitle \globallet\currentdescriptioncoding\s!tex \fi - \xdef\currentdescriptionlabel {\descriptionparameter\c!label}% - \xdef\currentdescriptionreference {\descriptionparameter\c!reference}% + \xdef\currentdescriptionlabel {\descriptionparameter\c!label}% + \xdef\currentdescriptionreference{\descriptionparameter\c!reference}% % \doif{\descriptionparameter\c!title}\v!none{\global\nodescriptioncaptiontrue\global\nodescriptionnumbertrue}% will become obsolete % @@ -749,6 +751,7 @@ \ifnodescriptioncaption \glet\currentdescriptionlistnumber \relax \glet\currentdescriptionsynchronize\relax + \glet\currentdescriptionattribute \relax \else \setnextinternalreference \xdef\currentdescriptionnumberentry{\ctxlua{structure.lists.push{ @@ -797,9 +800,8 @@ userdata = structure.helpers.touserdata(\!!bs\detokenize{#2}\!!es) } }}% - \xdef\currentdescriptionsynchronize % make this a macro because shared - {\noexpand\ctxlua{jobreferences.setinternalreference(nil,nil,\nextinternalreference)}% - \noexpand\ctxlatelua{structure.lists.enhance(\currentdescriptionnumberentry)}}% + \xdef\currentdescriptionattribute {\ctxlua {tex.write(jobreferences.setinternalreference("\referenceprefix","\currentdescriptionreference",\nextinternalreference,"\@@iafocus"))}}% + \xdef\currentdescriptionsynchronize{\ctxlatelua{structure.lists.enhance(\currentdescriptionnumberentry)}}% \fi \endgroup} @@ -863,7 +865,6 @@ \def\dodocurrentlabelnumber[#1]% {\dontleavehmode \writestatus{!!!}{todo: reference of label}% -% \rawreference{lab}{#1}{\composedsectionnumber}% \dotextprefix{\descriptionparameter\c!text}% \convertedsubstructurecounter[\currentdescriptionnumber][\currentdescriptionlevel]} diff --git a/tex/context/base/strc-doc.lua b/tex/context/base/strc-doc.lua index 93cdb71e3..23d39a110 100644 --- a/tex/context/base/strc-doc.lua +++ b/tex/context/base/strc-doc.lua @@ -181,64 +181,93 @@ function sections.getcurrentlevel() texwrite(data.depth) end -function sections.nextlevel() - local depth = data.depth + 1 - data.depth = depth - return depth -end - -function sections.prevlevel() - local numbers, ownnumbers, status, depth = data.numbers, data.ownnumbers, data.status, data.depth - local resetter = sets.getall("structure:resets",data.block,status[depth].resets or "") - local rd = resetter and resetter[depth] - numbers[depth] = (rd and rd > 0 and rd < depth and numbers[depth]) or 0 - status[depth] = nil - depth = depth - 1 - data.depth = depth - return depth -end - -function sections.somelevel(t) - local numbers, ownnumbers, status, depth = data.numbers, data.ownnumbers, data.status, data.depth - local d = tonumber(levelmap[t.metadata.name] or (depth > 0 and depth) or 1) - local resetter = sets.getall("structure:resets",data.block,(t and t.resets) or "") - local previous = { } - if d > depth then - local rd = resetter and resetter[i] - for i=depth+1,d do - numbers[i] = (rd and rd[i] and rd[i] > 0 and rd[i] < i and numbers[i]) or 0 +function sections.somelevel(given) + -- old number + local numbers, ownnumbers, status, olddepth = data.numbers, data.ownnumbers, data.status, data.depth + local newdepth = tonumber(levelmap[given.metadata.name] or (olddepth > 0 and olddepth) or 1) + local directives = given.directives + local resetset = (directives and directives.resetset) or "" + local resetter = sets.getall("structure:resets",data.block,resetset) + -- a trick to permits userdata to overload title, ownnumber and reference + -- normally these are passed as argument but nowadays we provide several + -- interfaces (we need this because we want to be compatible) + local u = given.userdata + if u then + -- kind of obsolete as we can pass them directly anyway + if u.reference and u.reference ~= "" then given.metadata.reference = u.reference ; u.reference = nil end + if u.ownnumber and u.ownnumber ~= "" then given.numberdata.ownnumber = u.ownnumber ; u.ownnumber = nil end + if u.title and u.title ~= "" then given.titledata.title = u.title ; u.title = nil end + if u.bookmark and u.bookmark ~= "" then given.titledata.bookmark = u.bookmark ; u.bookmark = nil end + if u.label and u.label ~= "" then given.titledata.label = u.label ; u.label = nil end + end + -- so far for the trick + if newdepth > olddepth then + for i=olddepth+1,newdepth do + local s = tonumber(sets.get("structure:resets",data.block,resetset,i)) +--~ logs.report("structure >","old: %s, new:%s, reset: %s (%s: %s)",olddepth,newdepth,s,resetset,table.concat(resetter,",")) + if not s or s == 0 then + numbers[i] = numbers[i] or 0 + ownnumbers[i] = ownnumbers[i] or "" + else + numbers[i] = s - 1 + ownnumbers[i] = "" + end status[i] = { } end - elseif d < depth then - local rd = resetter and resetter[i] - for i=depth,d+1,-1 do - numbers[i] = (rd and rd[i] and rd[i] > 0 and rd[i] < i and numbers[i]) or 0 + elseif newdepth < olddepth then + for i=olddepth,newdepth+1,-1 do + local s = tonumber(sets.get("structure:resets",data.block,resetset,i)) +--~ logs.report("structure <","old: %s, new:%s, reset: %s (%s: %s)",olddepth,newdepth,s,resetset,table.concat(resetter,",")) + if not s or s == 0 then + numbers[i] = numbers[i] or 0 + ownnumbers[i] = ownnumbers[i] or "" + else + numbers[i] = s - 1 + ownnumbers[i] = "" + end status[i] = nil end end - for i=1,d do - -- selective resetter - if numbers[i] == 0 then - ownnumbers[i] = "" + ownnumbers[newdepth] = given.numberdata.ownnumber or "" + given.numberdata.ownnumber = nil + data.depth = newdepth + -- new number + olddepth = newdepth + if given.metadata.increment then + if numbers[newdepth] then + numbers[newdepth] = numbers[newdepth] + 1 + else + local s = tonumber(sets.get("structure:resets",data.block,resetset,newdepth)) +--~ logs.report("structure =","old: %s, new:%s, reset: %s (%s: %s)",olddepth,newdepth,s,resetset,table.concat(resetter,",")) + if not s or s == 0 then + numbers[newdepth] = numbers[newdepth] or 0 + else + numbers[newdepth] = s - 1 + end end end - -- a trick to permits userdata to overload title, ownnumber and reference - -- normally these are passed as argument but nowadays we provide several - -- interfaces (we need this because we want to be compatible) - local u = t.userdata - if u then - if u.reference and u.reference ~= "" then t.metadata.reference = u.reference ; u.reference = nil end - if u.ownnumber and u.ownnumber ~= "" then t.numberdata.ownnumber = u.ownnumber ; u.ownnumber = nil end - if u.title and u.title ~= "" then t.titledata.title = u.title ; u.title = nil end - if u.bookmark and u.bookmark ~= "" then t.titledata.bookmark = u.bookmark ; u.bookmark = nil end - if u.label and u.label ~= "" then t.titledata.label = u.label ; u.label = nil end + status[newdepth] = given or { } + for k, v in pairs(data.checkers) do + if v[1] == newdepth and v[2] then + v[2](k) + end end - -- so far for the trick - ownnumbers[d] = t.numberdata.ownnumber or "" - t.numberdata.ownnumber = nil --- t.numberdata = helpers.simplify(t.numberdata) - data.depth = d - sections.pluslevel(t) + local numberdata= given.numberdata + if not numberdata then + -- probably simplified to nothing + numberdata = { } + given.numberdata = numberdata + end + local n = { } + for i=1,newdepth do + n[i] = numbers[i] + end + numberdata.numbers = n + if #ownnumbers > 0 then + numberdata.ownnumbers = table.fastcopy(ownnumbers) + end + given.references.section = sections.save(given) + -- given.numberdata = nil end function sections.writestatus() @@ -260,44 +289,6 @@ function sections.writestatus() end end -function sections.pluslevel(t) - -- data has saved level data - local numbers, ownnumbers, status, depth = data.numbers, data.ownnumbers, data.status, data.depth - local directives = t.directives - local resetter = sets.getall("structure:resets",data.block, (directives and directives.resetset) or "") ---~ if not (directives and directives.hidenumber) then - if t.metadata.increment then - if numbers[depth] then - numbers[depth] = numbers[depth] + 1 - else - numbers[depth] = 1 - end - end - for k, v in pairs(resetter) do -- sparse - if v > 0 and depth == v then - numbers[k] = 0 - end - end - status[depth] = t or { } - for k, v in pairs(data.checkers) do - if v[1] == depth and v[2] then - v[2](k) - end - end - local numberdata= t.numberdata - if not numberdata then - -- probably simplified to nothing - numberdata = { } - t.numberdata = numberdata - end - numberdata.numbers = table.fastcopy(numbers) - if #ownnumbers > 0 then - numberdata.ownnumbers = table.fastcopy(ownnumbers) - end - t.references.section = sections.save(t) ---~ t.numberdata = nil -end - function sections.setnumber(depth,n) local numbers, depth = data.numbers, data.depth local d = numbers[depth] @@ -331,7 +322,7 @@ function sections.cct() texsprint((metadata and metadata.catcodes) or ctxcatcodes) end -function sections.get(key,default,honorcatcodetable) +function sections.structuredata(key,default,honorcatcodetable) local data = data.status[data.depth] local d = data for k in key:gmatch("([^.]+)") do @@ -357,11 +348,14 @@ function sections.get(key,default,honorcatcodetable) end end -function sections.getuser(key,default) - local userdata = data.status[data.depth].userdata - local str = (userdata and userdata[key]) or default - if str then - texsprint(ctxcatcodes,str) +function sections.userdata(key,default) + if data.depth > 0 then + local userdata = data.status[data.depth] + userdata = userdata and userdata.userdata + userdata = (userdata and userdata[key]) or default + if userdata then + texsprint(ctxcatcodes,userdata) + end end end diff --git a/tex/context/base/strc-doc.mkiv b/tex/context/base/strc-doc.mkiv index 9d0d7c01c..637248929 100644 --- a/tex/context/base/strc-doc.mkiv +++ b/tex/context/base/strc-doc.mkiv @@ -34,14 +34,16 @@ \getparameters % initialization, used not grouped anyway [\??ns] - [\c!number=,\c!level=,\c!name=,\c!title=,\c!bookmark=,\c!label=,\c!coupling=,\c!ownnumber=, + [\c!number=,\c!level=,\c!name=,\c!title=,\c!bookmark=,\c!marking=,\c!list=,\c!label=,\c!coupling=,\c!ownnumber=, \c!sectionseparatorset=\s!default,\c!sectionconversionset=\s!default, \c!sectionstopper=,\c!sectionsegments=, - \c!reset=,\c!reference=, + \c!sectionresetset=,\c!reference=, \c!expansion=\v!no, \c!saveinlist=\v!yes, \c!command=\showstructuredata] +% maybe flags for list, bm, mark + \def\dostructurecomponent[#1][#2]% #1=interfaced-settings, #2=optional user data (not yet supported) {\begingroup \getparameters[\??ns][#1]% @@ -49,23 +51,38 @@ \xdef\currentstructurecoupling {\structureparameter\c!coupling}% \xdef\currentstructureownnumber{\structureparameter\c!ownnumber}% optional own number \xdef\currentstructurelevel {\structureparameter\c!level}% +\ifnum\catcodetable=\xmlcatcodes + \let\currentstructureexpansion\s!xml +\else \edef\currentstructureexpansion{\structureparameter\c!expansion} +\fi + \ifx\currentstructureexpansion\s!xml % goes via lua anyway \xdef\currentstructuretitle {\detokenizedstructureparameter\c!title}% \xdef\currentstructurebookmark{\detokenizedstructureparameter\c!bookmark}% + \xdef\currentstructuremarking {\detokenizedstructureparameter\c!marking}% + \xdef\currentstructurelist {\detokenizedstructureparameter\c!list}% + \ifx\currentstructurelist\empty + \globallet\currentstructurelist\currentstructuretitle + \else + \xmlstartraw + \xdef\currentstructurelist{\structureparameter\c!list}% + \xmlstopraw + \fi % - \xmlstartraw - \xdef\currentstructurelisttitle {\structureparameter\c!title}% - \xmlstopraw \globallet\currentstructurecoding\s!xml \else \ifx\currentstructureexpansion\v!yes \xdef\currentstructuretitle {\structureparameter\c!title}% \xdef\currentstructurebookmark{\structureparameter\c!bookmark}% + \xdef\currentstructuremarking {\structureparameter\c!marking}% + \xdef\currentstructurelist {\structureparameter\c!list}% \else \xdef\currentstructuretitle {\detokenizedstructureparameter\c!title}% \xdef\currentstructurebookmark{\detokenizedstructureparameter\c!bookmark}% + \xdef\currentstructuremarking {\detokenizedstructureparameter\c!marking}% + \xdef\currentstructurelist {\detokenizedstructureparameter\c!list}% \iflocation \ifx\currentstructurebookmark\empty \begingroup \simplifycommands @@ -73,7 +90,9 @@ \endgroup \fi \fi \fi - \globallet\currentstructurelisttitle \currentstructuretitle + \ifx\currentstructurelist\empty + \globallet\currentstructurelist\currentstructuretitle + \fi \globallet\currentstructurecoding\s!tex \fi \xdef\currentstructurelabel {\structureparameter\c!label}% @@ -92,7 +111,7 @@ referenceprefix = "\currentstructurereferenceprefix", }, directives = { - resetset = "\structureparameter\c!reset", + resetset = "\structureparameter\c!sectionresetset", }, metadata = { kind = "section", @@ -113,9 +132,14 @@ \ifx\currentstructurebookmark\currentstructuretitle \else bookmark = \!!bs\detokenize\expandafter{\currentstructurebookmark }\!!es, \fi - \ifx\currentstructurelisttitle\currentstructuretitle \else \ifx\currentstructuresaveinlist\v!no - list = \!!bs\detokenize\expandafter{\currentstructurelisttitle}\!!es, - \fi \fi + \ifx\currentstructuremarking\currentstructuretitle \else + marking = \!!bs\detokenize\expandafter{\currentstructuremarking }\!!es, + \fi + \ifx\currentstructuresaveinlist\v!no \else + \ifx\currentstructurelist\currentstructuretitle \else + list = \!!bs\detokenize\expandafter{\currentstructurelist}\!!es, + \fi + \fi }, numberdata = { block = "\currentstructureblock", @@ -142,9 +166,8 @@ hidenumber = \ifx\currentstructureshownumber\v!no true\else nil\fi, % titles \let\previousstructurecounter\!!zerocount \def\setstructuresynchronization#1% - {\xdef\currentstructuresynchronize - {\noexpand\ctxlua{jobreferences.setinternalreference("\currentstructurereferenceprefix","\currentstructurereference",\nextinternalreference)}% - \noexpand\ctxlatelua{structure.lists.enhance(#1)}}} + {\xdef\currentstructureattribute {\ctxlua {tex.write(jobreferences.setinternalreference("\currentstructurereferenceprefix","\currentstructurereference",\nextinternalreference,"\@@iafocus"))}}% + \xdef\currentstructuresynchronize{\ctxlatelua{structure.lists.enhance(#1)}}} \def\reportcurrentstructure{\ctxlua{structure.sections.writestatus()}} @@ -153,17 +176,32 @@ hidenumber = \ifx\currentstructureshownumber\v!no true\else nil\fi, % titles \def\showstructuredata {\par - \dontleavehmode + \dontleavehmode\begingroup \currentstructuresynchronize + \currentstructureattribute [\currentstructurename: \showstructurelevel: \currentstructuretitle] - \par} + \endgroup\par} % We can access the (stored) data with the following macros. - -\def\structurevalue #1{\ctxlua{structure.sections.get("#1")}} -\def\structureuservalue#1{\ctxlua{structure.sections.getuser("#1")}} -\def\structurenumber {\ctxlua{structure.sections.fullnumber()}} - -\def\structurecctvalue #1{\ctxlua{structure.sections.get("#1",nil,true)}} +% +% \def\MyHeadCommand #1#2{\framed{#1}\framed{#2 / \structureuservariable{subtitle}}} +% \def\MyListCommand#1#2#3{\externalfigure[\structurelistuservariable{figure}][height=5mm]#2} +% +% \setuphead[chapter][command=\MyHeadCommand] +% \setuplist[chapter][alternative=command,command=\MyListCommand] +% +% \starttext +% \setupheadertexts[chapter] +% \setupinteraction[state=start] +% \placebookmarks[chapter] +% \placelist[chapter] +% \startchapter[ownnumber=10,title=Ton,list=Hans,marking=Kees,bookmark=Bram][figure=cow.pdf,subtitle=oeps] +% \stopchapter +% \stoptext + +\def\structurevariable #1{\ctxlua{structure.sections.structuredata("#1")}} +\def\structureuservariable#1{\ctxlua{structure.sections.userdata("#1")}} +\def\structurenumber {\ctxlua{structure.sections.fullnumber()}} +\def\structurecatcodedget #1{\ctxlua{structure.sections.structuredata("#1",nil,true)}} % bad name \protect \endinput diff --git a/tex/context/base/strc-flt.mkiv b/tex/context/base/strc-flt.mkiv index 9a39b7f88..fc0b9ef3b 100644 --- a/tex/context/base/strc-flt.mkiv +++ b/tex/context/base/strc-flt.mkiv @@ -136,7 +136,6 @@ \c!radius=.5\bodyfontsize, \c!corner=\v!rectangular, \c!background=, - \c!backgroundscreen=, \c!backgroundcolor=, \c!backgroundoffset=\!!zeropoint, \c!topframe=, @@ -215,11 +214,11 @@ \newtoks\everysetupcaption \def\dosetupfloat[#1][#2]% - {\def\docommand##1{\getparameters[\??fl##1][#2]\the\everysetupfloat}% + {\def\docommand##1{\getparameters[\??fl##1][#2]\def\currentfloat{##1}\the\everysetupfloat}% \processcommalist[#1]\docommand} \def\dosetupcaption[#1][#2]% - {\def\docommand##1{\getparameters[\??kj##1][#2]\the\everysetupcaption}% + {\def\docommand##1{\getparameters[\??kj##1][#2]\def\currentfloat{##1}\the\everysetupcaption}% \processcommalist[#1]\docommand} \appendtoks @@ -349,9 +348,7 @@ \setgvalue{@fl@r@#1}% {\tracefloatnumber{#1}% \ifconditional\retainfloatnumber\else - % \dowritetolist{#1}{\getvalue{@fl@n@#1}}{#3}{#1}% - % \gdefconvertedargument\flasciititle{#3}% \asciititle is global - % \doifsomething{#2}{\rawreference\s!flt{#2}{{\getvalue{@fl@n@#1}}{\flasciititle}}}% + % todo \fi \letgvalue{@fl@r@#1}\relax}% nils \setgvalue{@fl@t@#1}% @@ -484,7 +481,7 @@ \let\twopassfloatdata\realpageno % used for odd/even determination, can be combined with nodelocation -\def\dosavefloatdata % \expanded +\def\dosavefloatdata % \expanded ... will change in mkiv {\doglobal\increment\noffloatdata \lazysavetaggedtwopassdata{\s!float\s!data}{\noffloatdata}{\noffloatpages}{\noexpand\realfolio}}% later {}{}{}{} and \getfirst... @@ -737,6 +734,11 @@ % todo: optional user pars +\def\floatcaptionattribute + {\iflocation \ifnofloatnumber \else \ifnofloatcaption \else + attr \destinationattribute \currentfloatattribute + \fi \fi \fi} + \long\def\docompletefloat#1#2#3#4#5% #1:floatclass #2:reference #3:optionlist #4:caption #5:box number {\presetfloatvariables{#1}{#3}{#2}{#5}% check this one \bgroup @@ -759,6 +761,7 @@ \c!reference=#2,\c!title={#4},\c!bookmark=]% []% \globallet\currentfloatnumber \laststructurecounternumber + \globallet\currentfloatattribute \laststructurecounterattribute \globallet\currentfloatsynchronize\laststructurecountersynchronize % % check float box @@ -770,7 +773,7 @@ \global\setbox\floatbox\vbox{\doemptyfloatblock{#1}}% \fi % deal with lack of caption - \global\setbox\floatbox\vbox + \global\setbox\floatbox\vbox \floatcaptionattribute {\doifelsemainfloatbody\currentfloatsynchronize\donothing \unvbox\floatbox \ifnofloatcaption @@ -993,29 +996,9 @@ \newdimen\floatwidth \newdimen\floatheight -% In \dofloatinfomessage wordt {{ }} gebruikt omdat anders -% binnen \startpostponing...\stoppostponing geen goede -% melding in de marge volgt: \ifinner is dan namelijk true. - -\def\dofloatinfomessage#1#2#3% - {\bgroup - \showmessage\m!floatblocks{#2}{#3}% - \setmessagetext\m!floatblocks{#2}% - \@EA\floatinfo\@EA#1\@EA{\currentmessagetext}% - \egroup} - -\def\dosavefloatinfo - {\dofloatinfomessage>2{\the\totalnoffloats}} - -\def\dofloatflushedinfo - {\bgroup - \!!counta\totalnoffloats - \advance\!!counta -\savednoffloats - \dofloatinfomessage<3{\the\!!counta}% - \egroup} - -\def\doinsertfloatinfo - {\dofloatinfomessage<4{\the\totalnoffloats}} +\def\dosavefloatinfo {\showmessage\m!floatblocks2{\the\totalnoffloats}} +\def\doinsertfloatinfo {\showmessage\m!floatblocks4{\the\totalnoffloats}} +\def\dofloatflushedinfo{\showmessage\m!floatblocks3{\the\numexpr\totalnoffloats-\savednoffloats\relax}} \def\dogetfloat {\ifsomefloatwaiting @@ -1185,32 +1168,6 @@ \ifx\somefacefloat\undefined \let\somefacefloat\doplacefloatbox \fi \ifx\sometextfloat\undefined \let\sometextfloat\doplacefloatbox \fi -% brr, wordt deze niet overladen in page-one? weg er mee - -% \def\somepagefloat[#1]% links, rechts, midden, hoog, midden, laag -% {%\checkwaitingfloats{#1}% -% \global\setbox\collectedpagefloats\vbox -% {\unvbox\collectedpagefloats -% \vbox to \textheight -% {\doifnotinset\v!high{#1}\vfill -% \box\floatbox -% \doifnotinset\v!low{#1}\vfill}% -% \goodbreak}% -% \doinsertfloatinfo} - -% \def\OTRONEsomepagefloat[#1]% -% {%\checkwaitingfloats{#1}% -% \global\setbox\collectedpagefloats\vbox -% {\ifvoid\collectedpagefloats\else\unvbox\collectedpagefloats\fi -% \vbox to \textheight % vss and unvbox catch too high and limited floats -% {\vss -% \doifnotinset\v!high{#1}\vfill -% \unvbox\floatbox -% \doifnotinset\v!low{#1}\vfill -% \vss}% -% \goodbreak}% -% \doinsertfloatinfo} - % test case: % % \placefigure[page,none]{}{\blackrule[width=\textwidth,height=0.9\textheight,color=green]} @@ -2016,8 +1973,7 @@ \edef\floatcaptiondirectives{\floatparameter\c!location,\floatcaptionparameter\c!location}% \ifparfloat\@EA\dosetparfloat\else\@EA\dosetpagfloat\fi{#1}{#2}{#3}% \setlocalfloatdimensions{#1}% - \setbox\floatbox\hbox - {\dosavefloatdata\restoretextcolor{\box\floatbox}}% + \setbox\floatbox\hbox{\dosavefloatdata\box\floatbox}% still needed? we will do renumbering differently \global\floatheight\ht\floatbox \global\advance\floatheight \dp\floatbox \global\floatwidth\wd\floatbox diff --git a/tex/context/base/strc-itm.mkii b/tex/context/base/strc-itm.mkii index 0148f83ca..d0afd13c8 100644 --- a/tex/context/base/strc-itm.mkii +++ b/tex/context/base/strc-itm.mkii @@ -151,6 +151,14 @@ \def\setitemparameter #1#2{\@EA\def\csname\??op\currentitemgroup#1#2\endcsname} % #3 -> {#3} \def\letitemparameter #1#2{\@EA\let\csname\??op\currentitemgroup#1#2\endcsname} +% works ok but not needed (also possible compatibility problem) +% +% \def\getitemparameter#1#2% +% {\executeifdefined{\??op\currentitemgroup#1#2}% +% {\executeifdefined{\??op\currentitemgroup #2}% +% {\executeifdefined{\??oo #2}% +% {}}}} + % test this: saves hash entries and is also faster % % \let\doinitializeitemgrouplevel\gobbleoneargument % todo ! ! ! diff --git a/tex/context/base/strc-itm.mkiv b/tex/context/base/strc-itm.mkiv index dd639d72b..2abe54d50 100644 --- a/tex/context/base/strc-itm.mkiv +++ b/tex/context/base/strc-itm.mkiv @@ -67,30 +67,30 @@ \def\dohandleitemreference % we will make a decent number helper {\ifx\currentitemreference \empty \else \setnextinternalreference - \ctxlua { - jobreferences.set("\s!full", "\referenceprefix","\currentitemreference", - { - metadata = { - kind = "list", - catcodes = \the\catcodetable, - xmlroot = \ifx\currentreferencecoding\s!xml "\xmldocument" \else nil \fi, % only useful when text - }, - references = { - internal = \nextinternalreference, - section = structure.sections.currentid(), - }, - numberdata = structure.helpers.simplify { - numbers = structure.counters.compact("\currentitemgroupcounter",nil,true), - separatorset = "\structurecounterparameter\currentitemgroupcounter\c!numberseparatorset", - conversion = "\structurecounterparameter\currentitemgroupcounter\c!numberconversion", - conversionset = "\structurecounterparameter\currentitemgroupcounter\c!numberconversionset", - % for the moment no stopper, we need to make references configurable first - % stopper = \!!bs\structurecounterparameter\currentitemgroupcounter\c!numberstopper\!!es, - segments = "\structurecounterparameter\currentitemgroupcounter\c!numbersegments", - }, - }) - jobreferences.setinternalreference("\referenceprefix","\currentitemreference",\nextinternalreference) + \ctxlua { jobreferences.setandgetattribute("\s!full", "\referenceprefix","\currentitemreference", + { + metadata = { + kind = "list", + catcodes = \the\catcodetable, + xmlroot = \ifx\currentreferencecoding\s!xml "\xmldocument" \else nil \fi, % only useful when text + }, + references = { + internal = \nextinternalreference, + section = structure.sections.currentid(), + }, + numberdata = structure.helpers.simplify { + numbers = structure.counters.compact("\currentitemgroupcounter",nil,true), + separatorset = "\structurecounterparameter\currentitemgroupcounter\c!numberseparatorset", + conversion = "\structurecounterparameter\currentitemgroupcounter\c!numberconversion", + conversionset = "\structurecounterparameter\currentitemgroupcounter\c!numberconversionset", + % for the moment no stopper, we need to make references configurable first + % stopper = \!!bs\structurecounterparameter\currentitemgroupcounter\c!numberstopper\!!es, + segments = "\structurecounterparameter\currentitemgroupcounter\c!numbersegments", + }, + }) }% + \xdef\currentitemattribute{\number\lastdestinationattribute}% + \begingroup\dosetattribute{destination}\currentitemattribute\kern\zeropoint\endgroup % todo \fi} % \startitemize[n,packed] @@ -925,7 +925,7 @@ \fi \fi \doifsomething\doitemdestination - {\setbox\itemgroupitembox\hbox{\goto{\box\itemgroupitembox}[\doitemdestination]}}% + {\setbox\itemgroupitembox\hbox{\directgotobox{\box\itemgroupitembox}[\doitemdestination]}}% \globallet\doitemdestination\empty \itemgroupaskedwidth\getitemparameter\currentitemlevel\c!width\relax % new, prevents loops when symbol is (not yet found) graphic diff --git a/tex/context/base/strc-lnt.mkii b/tex/context/base/strc-lnt.mkii new file mode 100644 index 000000000..ef09842cd --- /dev/null +++ b/tex/context/base/strc-lnt.mkii @@ -0,0 +1,197 @@ +%D \module +%D [ file=strc-lnt, +%D version=2002.05.10, +%D title=\CONTEXT\ Structure Macros, +%D subtitle=Line Notes, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Structure Macros / Line Notes} + +%D This module loads on top of the footnote and line numbering macros. + +\unprotect + +\newcounter\linenotecounter +\newtoks \collectedlinenotes +\newif \iftracelinenotes + +\appendtoks + \the\collectedlinenotes +\to \everylinenumber + +\appendtoks + \global\collectedlinenotes\emptytoks +\to \beforeeverylinenumbering + +\def\dohandlelinenote#1#2#3% + {\bgroup + \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber + \ifnum\linenotelinenumber=\linenumber\relax + % todo: \onlyfootnote{#2}{#3}% == configurable + % \setupnote[#1][\c!numbercommand=\gobbleoneargument]% + % \setnotetext[#1]{\rawreference\s!fnt{\s!fnt:f:\number\internalnotereference}{}#2: #3}% + \def\linenotelinenumber##1{#2}% + \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% + \setnote[#1]{#3}% + \fi + \egroup} + +\def\dotracedlinenote#1% + {\iftracelinenotes + \hbox to \zeropoint + {\forgetall + \localcolortrue + \hsize\zeropoint + \hss + \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}% + {\color[blue]{\vl}}% + \vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}% + \hss}% + \prewordbreak + \fi} + +\def\dolinenote#1#2% + {\doglobal\increment\linenotecounter + \doifreferencefoundelse{\??rr:\linenotecounter}% + {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote + {#1}{\currenttextreference}}{#2}\to\collectedlinenotes} + \donothing + \dotracedlinenote\empty + \expanded{\someline[\??rr:\linenotecounter]}} + +\def\dostartlinenote#1[#2]#3% + {\doifreferencefoundelse{\??rr:#2}% + {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote + {#1}{\currenttextreference}}{#3}\to\collectedlinenotes} + \donothing + \dotracedlinenote{#2}% + \startline[\??rr:#2]} + +\def\dostoplinenote#1[#2]% + {\stopline[\??rr:#2]} + +% defining them + +\def\definelinenote + {\dodoubleempty\dodefinelinenote} + +\def\dodefinelinenote[#1][#2]% + {\definenote[#1][#2]% + \setvalue {#1}{\dolinenote {#1}}% + \setvalue{\e!start#1}{\dostartlinenote{#1}}% + \setvalue{\e!stop #1}{\dostoplinenote {#1}}} + +\def\setuplinenote % convenient + {\setupnote} + +% We predefine one, namely \type {\linenote} cum suis. + +\definelinenote[\v!linenote] + +% \startbuffer[test] +% \startlinenumbering[100] +% test \linenote {oeps} test test test test test test +% test \startlinenote [well] {oeps} test test test test test test +% test \linenote {oeps} test test test test test test +% test \linenote {oeps} test test test test test test +% test \linenote {oeps} test test test test test test +% test \linenote {oeps} test test test test test test +% test \stoplinenote [well] test test test test test test +% \stoplinenumbering +% \stopbuffer +% +% \setupnotedefinition[linenote] [location=serried,distance=.5em] +% +% {\typebuffer[test] \getbuffer[test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [align=left] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [width=1em, +% align=left] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [width=2em, +% distance=.5em, +% align=left] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [width=2em, +% align=middle] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [conversion=romannumerals, +% start=1, +% step=1, +% location=text, +% style=slanted, +% color=blue, +% width=1.5em] +% \stopbuffer +% +% {\typebuffer[setup] \startnarrower\getbuffer[setup,test]\stopnarrower} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [width=4em, +% left=--, +% right=--, +% align=middle] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup-1] +% \setuplinenumbering +% [style=\bfxx, +% command=\WatchThis] +% \stopbuffer +% +% \startbuffer[setup-2] +% \def\WatchThis#1% +% {\ifodd\linenumber +% \definecolor[linecolor][red]% +% \else +% \definecolor[linecolor][green]% +% \fi +% \inframed +% [offset=1pt,frame=off,background=color,backgroundcolor=linecolor] +% {#1}} +% \stopbuffer +% +% {\typebuffer[setup-1,setup-2] \getbuffer[setup-1,setup-2,test]} \page +% +% \startbuffer[setup-1] +% \setuplinenumbering +% [location=inright, +% style=\bfxx, +% command=\WatchThis] +% \stopbuffer +% +% {\typebuffer[setup-1] \getbuffer[setup-1,setup-2,test]} \page + +\protect \endinput diff --git a/tex/context/base/strc-lnt.mkiv b/tex/context/base/strc-lnt.mkiv new file mode 100644 index 000000000..d0816cfc7 --- /dev/null +++ b/tex/context/base/strc-lnt.mkiv @@ -0,0 +1,193 @@ +%D \module +%D [ file=strc-lnt, +%D version=2002.05.10, +%D title=\CONTEXT\ Structure Macros, +%D subtitle=Line Notes, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Structure Macros / Line Notes} + +%D This module loads on top of the footnote and line numbering macros. + +\unprotect + +\newcounter\linenotecounter +\newtoks \collectedlinenotes +\newif \iftracelinenotes + +\appendtoks + \the\collectedlinenotes +\to \everylinenumber + +\appendtoks + \global\collectedlinenotes\emptytoks +\to \beforeeverylinenumbering + +\def\dohandlelinenote#1#2#3% + {\bgroup + \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber + \ifnum\linenotelinenumber=\linenumber\relax + \def\linenotelinenumber##1{#2}% + \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% + \setnote[#1]{#3}% + \fi + \egroup} + +\def\dotracedlinenote#1% + {\iftracelinenotes + \hbox to \zeropoint + {\forgetall + \hsize\zeropoint + \hss + \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}% + {\color[blue]{\vl}}% + \vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}% + \hss}% + \prewordbreak + \fi} + +\def\dolinenote#1#2% + {\doglobal\increment\linenotecounter + \doifreferencefoundelse{\??rr:\linenotecounter}% + {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote + {#1}{\currenttextreference}}{#2}\to\collectedlinenotes} + \donothing + \dotracedlinenote\empty + \expanded{\someline[\??rr:\linenotecounter]}} + +\def\dostartlinenote#1[#2]#3% + {\doifreferencefoundelse{\??rr:#2}% + {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote + {#1}{\currenttextreference}}{#3}\to\collectedlinenotes}% + {\unknownreference{#2}}% + \dotracedlinenote{#2}% + \startline[\??rr:#2]} + +\def\dostoplinenote#1[#2]% + {\stopline[\??rr:#2]} + +% defining them + +\def\definelinenote + {\dodoubleempty\dodefinelinenote} + +\def\dodefinelinenote[#1][#2]% + {\definenote[#1][#2]% + \setvalue {#1}{\dolinenote {#1}}% + \setvalue{\e!start#1}{\dostartlinenote{#1}}% + \setvalue{\e!stop #1}{\dostoplinenote {#1}}} + +\def\setuplinenote % convenient + {\setupnote} + +% We predefine one, namely \type {\linenote} cum suis. + +\definelinenote[\v!linenote] + +% \startbuffer[test] +% \startlinenumbering[100] +% test \linenote {oeps} test test test test test test +% test \startlinenote [well] {oeps} test test test test test test +% test \linenote {oeps} test test test test test test +% test \linenote {oeps} test test test test test test +% test \linenote {oeps} test test test test test test +% test \linenote {oeps} test test test test test test +% test \stoplinenote [well] test test test test test test +% \stoplinenumbering +% \stopbuffer +% +% \setupnotedefinition[linenote] [location=serried,distance=.5em] +% +% {\typebuffer[test] \getbuffer[test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [align=left] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [width=1em, +% align=left] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [width=2em, +% distance=.5em, +% align=left] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [width=2em, +% align=middle] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [conversion=romannumerals, +% start=1, +% step=1, +% location=text, +% style=slanted, +% color=blue, +% width=1.5em] +% \stopbuffer +% +% {\typebuffer[setup] \startnarrower\getbuffer[setup,test]\stopnarrower} \page +% +% \startbuffer[setup] +% \setuplinenumbering +% [width=4em, +% left=--, +% right=--, +% align=middle] +% \stopbuffer +% +% {\typebuffer[setup] \getbuffer[setup,test]} \page +% +% \startbuffer[setup-1] +% \setuplinenumbering +% [style=\bfxx, +% command=\WatchThis] +% \stopbuffer +% +% \startbuffer[setup-2] +% \def\WatchThis#1% +% {\ifodd\linenumber +% \definecolor[linecolor][red]% +% \else +% \definecolor[linecolor][green]% +% \fi +% \inframed +% [offset=1pt,frame=off,background=color,backgroundcolor=linecolor] +% {#1}} +% \stopbuffer +% +% {\typebuffer[setup-1,setup-2] \getbuffer[setup-1,setup-2,test]} \page +% +% \startbuffer[setup-1] +% \setuplinenumbering +% [location=inright, +% style=\bfxx, +% command=\WatchThis] +% \stopbuffer +% +% {\typebuffer[setup-1] \getbuffer[setup-1,setup-2,test]} \page + +\protect \endinput diff --git a/tex/context/base/strc-lst.lua b/tex/context/base/strc-lst.lua index 07f551764..37c520306 100644 --- a/tex/context/base/strc-lst.lua +++ b/tex/context/base/strc-lst.lua @@ -12,7 +12,7 @@ if not modules then modules = { } end modules ['strc-lst'] = { -- shared cache [we can use a fast and stupid serializer] local format, tonumber = string.format, tonumber -local texsprint, texprint, texwrite, count = tex.sprint, tex.print, tex.write, tex.count +local texsprint, texprint, texwrite, texcount = tex.sprint, tex.print, tex.write, tex.count local ctxcatcodes = tex.ctxcatcodes @@ -40,7 +40,7 @@ local function initializer() -- create a cross reference between internal references -- and list entries local collected = lists.collected - local internals = lists.internals + local internals = jobreferences.internals local ordered = lists.ordered for i=1,#collected do local c = collected[i] @@ -105,7 +105,7 @@ function lists.enhance(n) -- save in the right order (happen sat shipout) lists.tobesaved[#lists.tobesaved+1] = l -- default enhancer (cross referencing) - l.references.realpage = count[0] + l.references.realpage = texcount.realpageno -- specific enhancer (kind of obsolete) local kind = l.metadata.kind local enhancer = kind and lists.enhancers[kind] @@ -240,7 +240,8 @@ local function filter_collected(names, criterium, number, collected) local cnumbers = sectionnumber.numbers local metadata = v.metadata if cnumbers then - if metadata and not metadata.nolist and (all or hash[metadata.name or false]) and #cnumbers >= depth and cnumbers[depth] == number then +-- if metadata and not metadata.nolist and (all or hash[metadata.name or false]) and #cnumbers >= depth and cnumbers[depth] == number then + if metadata and not metadata.nolist and (all or hash[metadata.name or false]) and #cnumbers >= depth and (number == 0 or cnumbers[depth] == number) then result[#result+1] = v end end @@ -272,7 +273,7 @@ function lists.analyze(...) lists.result = lists.filter(...) end -function lists.userdata(name,r,tag) +function lists.userdata(name,r,tag) -- to tex local str = lists.result[r] str = str and str.userdata str = str and str[tag] @@ -281,7 +282,7 @@ function lists.userdata(name,r,tag) end end -function lists.uservalue(name,r,tag,default) +function lists.uservalue(name,r,tag,default) -- to lua local str = lists.result[r] str = str and str.userdata str = str and str[tag] @@ -311,7 +312,7 @@ function lists.title(name,n,tag) -- tag becomes obsolete if data then local titledata = data.titledata if titledata then - texsprint(ctxcatcodes,titledata[tag] or titledata.title or "") + texsprint(ctxcatcodes,titledata[tag] or titledata.list or titledata.title or "") end end end diff --git a/tex/context/base/strc-lst.mkiv b/tex/context/base/strc-lst.mkiv index 3f829dc20..e56f492c9 100644 --- a/tex/context/base/strc-lst.mkiv +++ b/tex/context/base/strc-lst.mkiv @@ -25,11 +25,6 @@ % auto refs to lists (chain) -> todo (\dododowritetolist) % todo: \normalexpanded{\noexpand\everylistentry\emptytoks\the\everylistentry}% \emptytoks, else loop -% \def\linklisttoelement#1#2#3#4{#4}% list location format page data - -\def\linklisttoelement#1#2#3#4% % list location format page data - {\gotonextinternal\currentlist{#1}{#3}{#4}} - % interface to lua % we have to deal with compatible processing, i.e. list elements that have two @@ -71,7 +66,6 @@ % handling - % The next code injects data into the list at the current level. \def\structurelistinject{\dotripleempty\dostructurelistinject} @@ -126,6 +120,9 @@ \def\structurelistsecond {\ctxlua{structure.lists.userdata("\currentlist",\currentlistindex,"second")}} +\def\structurelistuservariable#1% + {\ctxlua{structure.lists.userdata("\currentlist",\currentlistindex,"#1")}} + % \appendtoks % \to \everystructurelist @@ -523,17 +520,19 @@ {\listparameter\c!command{#3}{#4}{#5}} {[\currentlist: #3 -- #4 -- #5]}} +\def\domakelistelement#1#2#3#4% ref internal command data + {\dontleavehmode + \doifnot{\listparameter\c!interaction}{#1}\locationfalse + \iflocation + \directgotobox{\setlocationcolor\??ia#4}[internal(#2)]% + \else + #3{#4}% + \fi} + \def\dodofreelistelement#1#2#3#4#5#6#7#8% - {\def\makelistelement##1##2% - {\noindent % new and needed - \hbox - {\doifelse{\listparameter\c!interaction}{##1} % \??li ipv \??ia - {\setbox0\hbox{\showcontrastlocation{\??li\currentlist}{#6}{##2}}% - \linklisttoelement{#2}{#5}{#6}{\box0}}%{\copy0}}% - {##2}}}% - \listparameter\c!before% can be \hskip + {\listparameter\c!before% can be \hskip \doifdefinedelse{\??li#1\c!command} - {\makelistelement{\listparameter\c!interaction}% this forces all + {\domakelistelement{\listparameter\c!interaction}{#2}\hbox {\listparameter\c!command {#3}% geen conversies etc {#4}% geen conversies etc @@ -541,19 +540,19 @@ {#7% \vbox {\forgetall - \makelistelement\v!all + \domakelistelement\v!all{#2}\hbox {\doif{\listparameter\c!headnumber}\v!yes - {\makelistelement\v!sectionnumber + {\domakelistelement\v!sectionnumber{#2}\hbox {\donestedlistattributes\c!numberstyle\c!numbercolor {\listparameter\c!numbercommand{\currentlistsymbol}}}}% - \makelistelement\v!text + \domakelistelement\v!text{#2}\hbox {\donestedlistattributes\c!textstyle\c!textcolor {\let\\=\newlineinlist \dontconvertfont \listparameter\c!textcommand{#4}}}% \doif{\listparameter\c!pagenumber}\v!yes {\doifsomething{#5} - {\makelistelement\v!pagenumber + {\domakelistelement\v!pagenumber{#2}\hbox {\donestedlistattributes\c!pagestyle\c!pagecolor {\listparameter\c!pagecommand{#5}}}}}}}% #8}% @@ -594,16 +593,11 @@ {\!!widtha\listparameter\c!width}}% \getvalue{\??li\c!alternative\listparameter\c!alternative}% \endgraf - \def\makelistelement##1##2% - {\doifelse{\listparameter\c!interaction}{##1} - {\setbox0\hbox{\showcontrastlocation\??ia{#6}{##2}}% - \linklisttoelement{#2}{#5}{#6}{\box0}}%{\copy0}}% - {\hbox{##2}}}% \doif{\listparameter\c!interaction}\v!text % not supported ! ! ! ! ! ! text == all {\setlistparameter\currentlist\c!interaction\v!all}% % \dontleavehmode % new, else no margin, but wrong, better (else \indent as well): \noindent - \makelistelement\v!all + \domakelistelement\v!all{#2}\hbox {\setlocalhsize \hsize\localhsize \hbox to \hsize @@ -612,7 +606,7 @@ \!!widthb\hsize \doifelse{\listparameter\c!headnumber}\v!yes {\setbox2\hbox \ifdim\!!widtha>\zeropoint to \!!widtha \fi - {\makelistelement\v!sectionnumber + {\domakelistelement\v!sectionnumber{#2}\hbox {\donestedlistattributes\c!numberstyle\c!numbercolor {\listparameter\c!numbercommand{\currentlistsymbol}}% \hfill}}} @@ -624,7 +618,7 @@ {\doifsomething{#5} % \listwidth is new ; temp hack {\hbox \ifdim\listwidth>\zeropoint to \listwidth\fi {\hfill - \makelistelement\v!pagenumber + \domakelistelement\v!pagenumber{#2}\hbox {\donestedlistattributes\c!pagestyle\c!pagecolor {\listparameter\c!pagecommand{#5}}}}}}}% \vbox @@ -711,15 +705,10 @@ {\setlistparameter\currentlist\c!interaction\v!sectionnumber}% \doif{\listparameter\c!interaction}\v!all % not supported {\setlistparameter\currentlist\c!interaction\v!sectionnumber}% - \def\makelistelement##1##2% - {\doifelse{\listparameter\c!interaction}{##1} - {\setbox0\hbox{\showcontrastlocation\??ia{#6}{##2}}% - \linklisttoelement{#2}{#5}{#6}{\box0}}%{\copy0}}% - {\hbox{##2}}}% \setbox4\hbox {\doif{\listparameter\c!pagenumber}\v!yes {\doifsomething{#5} - {\makelistelement\v!pagenumber + {\domakelistelement\v!pagenumber{#2}\hbox {\donestedlistattributes\c!pagestyle\c!pagecolor {\listparameter\c!pagecommand{#5}}}}}}% \doif{\listparameter\c!headnumber}\v!yes @@ -729,7 +718,7 @@ \ifdone \hbox {\listparameter\c!left - \makelistelement\v!sectionnumber + \domakelistelement\v!sectionnumber{#2}\hbox {\donestedlistattributes\c!numberstyle\c!numbercolor {\listparameter\c!numbercommand{\currentlistsymbol}}}% \listparameter\c!right @@ -777,12 +766,7 @@ \def\dodofixdlistelementEFG#1#2#3#4#5#6#7#8% {\noindent \bgroup - \def\makelistelement##1##2% isolated by Wolfgang Schuster - {\doifelse{\listparameter\c!interaction}{##1} - {#2{##2}} - {\setbox0\hbox{#2{\showcontrastlocation\??ia{#8}{##2}}}% - \linklisttoelement{#4}{#7}{#8}{\box0}}}% - \makelistelement\v!no + \domakelistelement\v!no{#4}{#2}% {\let\\=\newlineinlist #1% in case E nils the strut (still needed?) \dosetlistattributes\c!style\c!color diff --git a/tex/context/base/strc-mar.lua b/tex/context/base/strc-mar.lua index 14eac8c2c..f0d6df314 100644 --- a/tex/context/base/strc-mar.lua +++ b/tex/context/base/strc-mar.lua @@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['strc-mar'] = { structure.marks = structure.marks or { } function structure.marks.title(tag,n) - structure.lists.savedtitle(tag,n,"mark") + structure.lists.savedtitle(tag,n,"marking") end function structure.marks.number(tag,n) -- no spec diff --git a/tex/context/base/strc-mat.mkiv b/tex/context/base/strc-mat.mkiv index 482426b48..097b1d710 100644 --- a/tex/context/base/strc-mat.mkiv +++ b/tex/context/base/strc-mat.mkiv @@ -50,7 +50,7 @@ [\v!formula] [\c!numberconversionset=\v!formula] -\def\storecurrentformulanumber#1#2#3% ref, todo:str, \sync % todo: title etc (like float) +\def\storecurrentformulanumber#1#2#3#4% ref, todo:str, \sync % todo: title etc (like float) {\dostructurecountercomponent {formula}% \getfloatparameters @@ -64,7 +64,8 @@ \c!reference=#1,\c!title=,\c!bookmark=]% [#2]% \globallet\currentformulanumber\laststructurecounternumber - \globallet#3\laststructurecountersynchronize} + \globallet#3\laststructurecountersynchronize + \globallet#4\laststructurecounterattribute} \def\thecurrentformulanumber {%\ifnoformulacaption \else \ifnoformulanumber \else @@ -72,13 +73,10 @@ }%\fi \fi} \def\placecurrentformulanumber - {\currentformulassynchronize - \currentformulasynchronize - \currentsubformulasynchronize - \thecurrentformulanumber} %\convertedstructurecounter[\v!formula]\relax} - -\def\doformulareference#1#2% - {\doifsomething{#1}{\doifnotinset{#1}{+,-}{\rawreference\s!for{#1}{#2}}}} + {\currentformulassynchronize \currentformulasattribute % todo + \currentformulasynchronize \currentformulasattribute % todo + \currentsubformulasynchronize \currentsubformulaattribute % todo + \thecurrentformulanumber} \def\doformulanumber {\dotripleempty\dodoformulanumber} @@ -88,8 +86,9 @@ \let\subformulasreference\empty % temp hack -\let\currentformulasynchronize \relax -\let\currentformulassynchronize\relax +\let\currentformulasynchronize \relax \let\currentformulaattribute \relax +\let\currentsubformulasynchronize\relax \let\currentsubformulaattribute\relax +\let\currentformulassynchronize \relax \let\currentformulasattribute \relax \def\dododoformulanumber#1#2#3#4% (#1,#2)=outer(ref,sub) (#3,#4)=inner(ref,sub) {\hbox\bgroup @@ -110,8 +109,9 @@ \edef\currentformulareference{#1}% \ifx\currentformulareference\empty \glet\currentformulasynchronize\relax + \glet\currentformulaattribute \relax \else - \storecurrentformulanumber\currentformulareference\empty\currentformulasynchronize + \storecurrentformulanumber\currentformulareference\empty\currentformulasynchronize\currentformulaattribute \fi % subcounter \setbox0\hbox{\ignorespaces#4\unskip}% @@ -121,8 +121,9 @@ \edef\currentsubformulareference{#3}% \ifx\currentsubformulareference\empty \glet\currentsubformulasynchronize\relax + \glet\currentsubformulaattribute \relax \else - \storecurrentformulanumber\currentsubformulareference\empty\currentsubformulasynchronize + \storecurrentformulanumber\currentsubformulareference\empty\currentsubformulasynchronize\currentsubformulaattribute \fi % \rm % nodig ? @@ -546,8 +547,9 @@ \edef\subformulasreference{#1}% messy \ifx\subformulasreference\empty \glet\currentformulassynchronize\relax + \glet\currentformulasattribute \relax \else - \storecurrentformulanumber\subformulasreference\empty\currentformulassynchronize + \storecurrentformulanumber\subformulasreference\empty\currentformulassynchronize\currentformulasattribute \fi \fi \settrue\insidesubformulas} diff --git a/tex/context/base/strc-not.lua b/tex/context/base/strc-not.lua index 115de7b9d..32a836ba8 100644 --- a/tex/context/base/strc-not.lua +++ b/tex/context/base/strc-not.lua @@ -8,10 +8,12 @@ if not modules then modules = { } end modules ['strc-not'] = { local format = string.format local next = next -local texsprint, texwrite = tex.sprint, tex.write +local texsprint, texwrite, texcount = tex.sprint, tex.write, tex.count local ctxcatcodes = tex.ctxcatcodes +local trace_notes = false trackers.register("structure.notes", function(v) trace_notes = v end) + structure = structure or { } structure.helpers = structure.helpers or { } structure.lists = structure.lists or { } @@ -41,11 +43,14 @@ function notes.store(tag,n) nd = { } notedata[tag] = nd end - nd[#nd+1] = n + local nnd = #nd+1 + nd[nnd] = n local state = notestates[tag] if state.kind ~= "insert" then ---~ state.start = #nd - state.start = state.start or #nd + if trace_notes then + logs.report("notes","storing %s with state %s as %s",tag,state.kind,nnd) + end + state.start = state.start or nnd end tex.write(#nd) end @@ -53,8 +58,12 @@ end function notes.get(tag,n) local nd = notedata[tag] if nd then - nd = nd[n or #notedata] + n = n or #notedata + nd = nd[n or n] if nd then + if trace_notes then + logs.report("notes","getting %s of %s",n,tag) + end return structure.lists.collected[nd] end end @@ -86,6 +95,9 @@ end function notes.setstate(tag,newkind) local state = notestates[tag] + if trace_notes then + logs.report("notes","setting state of %s from %s to %s",tag,(state and state.kind) or "unset",newkind) + end if not state then state = { kind = newkind @@ -98,6 +110,7 @@ function notes.setstate(tag,newkind) else state.kind = newkind end + -- state.start can already be set and will be set when an entry is added or flushed return state end @@ -128,7 +141,8 @@ local function internal(tag,n) local r = nd.references if r then local i = r.internal - return i and lists.internals[i] +--~ return i and lists.internals[i] + return i and jobreferences.internals[i] end end return nil @@ -152,7 +166,7 @@ function notes.checkpagechange(tag) -- called before increment ! end elseif current then -- we need to locate the next one, best guess - if tex.count[0] > current.pagenumber.number then + if texcount.realpageno > current.pagenumber.number then counters.reset(tag) end end @@ -187,6 +201,9 @@ function notes.deltapage(tag,n) end function notes.postpone() + if trace_notes then + logs.report("notes","postponing all insert notes") + end for tag, state in next, notestates do if state.kind ~= "store" then notes.setstate(tag,"postpone") @@ -197,7 +214,7 @@ end function notes.setsymbolpage(tag,n) local nd = notes.get(tag,n) if nd then - nd.metadata.symbolpage = tex.count[0] -- realpage + nd.metadata.symbolpage = texcount.realpageno end end @@ -216,26 +233,59 @@ function notes.getnumberpage(tag,n) end function notes.flush(tag,whatkind) -- store and postpone - local nd = notedata[tag] - if nd then - local state = notestates[tag] - local ns = state and state.start -- first index - if ns then - local kind = state.kind - if kind == whatkind then - if kind == "postpone" then - for i=ns,#nd do - texsprint(ctxcatcodes,format("\\handlenoteinsert{%s}{%s}",tag,i)) - end - state.start = nil - state.kind = "insert" - elseif kind == "store" then - for i=ns,#nd do - texsprint(ctxcatcodes,format("\\handlenoteitself{%s}{%s}",tag,i)) - end - state.start = nil + local state = notestates[tag] + local kind = state.kind + if kind == whatkind then + if kind == "postpone" then + local nd = notedata[tag] + local ns = state.start -- first index + if nd and ns then + if trace_notes then + logs.report("notes","flushing state %s of %s from %s to %s",whatkind,tag,ns,#nd) + end + for i=ns,#nd do + texsprint(ctxcatcodes,format("\\handlenoteinsert{%s}{%s}",tag,i)) + end + end + state.start = nil + state.kind = "insert" + elseif kind == "store" then + local nd = notedata[tag] + local ns = state.start -- first index + if trace_notes then + logs.report("notes","flushing state %s of %s from %s to %s",whatkind,tag,ns,#nd) + end + if nd and ns then + for i=ns,#nd do + texsprint(ctxcatcodes,format("\\handlenoteitself{%s}{%s}",tag,i)) end end + state.start = nil + elseif trace_notes then + logs.report("notes","not flushing state %s of %s",whatkind,tag) + end + elseif trace_notes then + logs.report("notes","not flushing state %s of %s",whatkind,tag) + end +end + +function notes.flushpostponed() + if trace_notes then + logs.report("notes","flushing all postponed notes") + end + for tag, _ in next, notestates do + notes.flush(tag,"postpone") + end +end + +function notes.resetpostponed() + if trace_notes then + logs.report("notes","resetting all postponed notes") + end + for tag, state in next, notestates do + if state.kind == "postpone" then + state.start = nil + state.kind = "insert" end end end diff --git a/tex/context/base/strc-not.mkiv b/tex/context/base/strc-not.mkiv index 7dc998451..d432deb30 100644 --- a/tex/context/base/strc-not.mkiv +++ b/tex/context/base/strc-not.mkiv @@ -86,7 +86,11 @@ \newif\ifnotesenabled \notesenabledtrue -\appendtoks \notesenabledfalse \to \everymarking +% better mark a note .. once flushed no more flushing + +%appendtoks \notesenabledfalse \to \everymarking +\appendtoks \notesenabledfalse \to \everypagebody +\appendtoks \notesenabledfalse \to \everystructurelist % quick hack %D Often we need to process the whole set of notes and to make that %D fast, we use a token register: @@ -94,7 +98,7 @@ \newtoks\tobeprocessednotes \def\processnotes#1% #1: \macro that uses \currentnote - {\def\doprocesssomenote##1{\edef\currentdescription{##1}\edef\currentnote{##1}#1}% + {\def\doprocesssomenote##1{\edef\currentnote{##1}\let\currentdescription\currentnote#1}% \the\tobeprocessednotes} %D Notes have their own paremater handlers. The complication here @@ -106,6 +110,8 @@ \def\noteparameter #1{\csname\donoteparameter{\??vn\currentnote}#1\endcsname} \def\noteparameterhash#1{\donoteparameterhash {\??vn\currentnote}#1} +\def\namednoteparameter#1#2{\csname\donoteparameter{\??vn#1}#2\endcsname} + \def\donoteparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\donoteparentparameter \csname#1\s!parent\endcsname#2\fi} \def\donoteparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\donoteparentparameterhash\csname#1\s!parent\endcsname#2\fi} @@ -239,7 +245,8 @@ \definestructurecounter [\currentnote]% \ctxlua{structure.notes.define("\currentnote","insert",\number\csname\??vn:\currentnote\endcsname)}% - \the\everysetupnote} + \the\everysetupnote + \dochecknote} \let\setupnotedefinition\setupenumerations @@ -247,6 +254,11 @@ \setupenumerations[\currentnote][]% \to \everysetupnote +% \appendtoks +% \dochecknote +% \to \everysetupnote + + \def\setupnote {\dodoubleempty\dosetupnote} @@ -309,8 +321,8 @@ \def\s!notefmt{nodefmt} % 1 text \def\s!notecol{nodecol} -\def\clevernotes % compatibility hack - {\numexpr\ifcase\noteparameter\s!noteloc\or0\or2\or2\or1\else0\fi\relax} +\def\clevernotes % compatibility hack, will be redone + {\numexpr\ifcase\namednoteparameter\v!footnote\s!noteloc\or0\or2\or2\or1\else0\fi\relax} \def\setnotelocation #1{\expandafter\chardef\csname\??vn\currentnote\s!noteloc\endcsname#1\relax} \def\setnoteposition #1{\expandafter\chardef\csname\??vn\currentnote\s!notepos\endcsname#1\relax} @@ -319,21 +331,22 @@ \def\currentnofcolumns{\@@kln} +\setvalue{\??vn @\v!page }{\setnotelocation\plusone} +\setvalue{\??vn @\v!columns }{\setnotelocation\plustwo} +\setvalue{\??vn @\v!firstcolumn}{\setnotelocation\plusthree} +\setvalue{\??vn @\v!lastcolumn }{\setnotelocation\plusfour} +\setvalue{\??vn @\v!none }{\setnotelocation\plusfive} +\setvalue{\??vn @\v!text }{\setnotelocation\plusfive \setnoteformatting\plusone} % test +\setvalue{\??vn @\v!high }{\setnoteposition\plusone} +\setvalue{\??vn @\v!bottom }{\setnoteposition\plustwo} + +\def\dosetcheckednote#1{\csname\??vn @#1\endcsname} + \def\dochecknote {% node states \setnotelocation\plusone \setnoteposition\plustwo - \processallactionsinset - [\noteparameter\c!location] - [ \v!page=>\setnotelocation \plusone, - \v!columns=>\setnotelocation \plustwo, - \v!firstcolumn=>\setnotelocation \plusthree, - \v!lastcolumn=>\setnotelocation \plusfour, - \v!none=>\setnotelocation \plusfive, - \v!text=>\setnotelocation \plusfive - \setnoteformatting\plusone, % test - \v!high=>\setnoteposition \plusone, - \v!bottom=>\setnoteposition \plustwo]% + \normalexpanded{\noexpand\rawprocesscommalist[\noteparameter\c!location]}\dosetcheckednote % compatibility hack \ifnum\noteparameter\s!noteloc=\plusfive \endnotestrue \else \endnotesfalse \fi \ifnum\noteparameter\s!notepos=\plustwo \bottomnotestrue \else \bottomnotesfalse \fi @@ -383,8 +396,10 @@ \global\skip \currentnoteins\zeropoint \fi} -\def\checknotes - {\processnotes\dochecknote} +% \def\checknotes +% {\processnotes\dochecknote} + +\let\checknotes\relax % experiment, avoiding this saves a lot of time % D When \type{n} exceeds~1, footnotes are typeset in % D multi||columns, using the algoritm presented on page~397 @@ -505,35 +520,37 @@ \newconditional\skipnoteplacement \def\@@notemakedescription[#1]#2#3% todo ... proper [key=value] etc - {\begingroup - \doenumerationcheckconditions - \let\currentnote\currentdescriptionmain - \dodescriptioncomponent[\c!reference=#1,\c!label={\descriptionparameter\c!text},\c!title={#3},\c!bookmark=,][]% - \xdef\currentnotenumber{\ctxlua{structure.notes.store("\currentnote",\currentdescriptionnumberentry)}}% - \settrue\processingnote - \ifconditional\skipnoteplacement - \globallet\lastnotesymbol\dolastnotesymbol - \else - \iftypesettinglines % otherwise problems with \type {xxx} - \ignorelines % makes footnotes work in \startlines ... \stoplines + {\ifnotesenabled + \begingroup + \doenumerationcheckconditions + \let\currentnote\currentdescriptionmain + \dodescriptioncomponent[\c!reference=#1,\c!label={\descriptionparameter\c!text},\c!title={#3},\c!bookmark=,][]% + \xdef\currentnotenumber{\ctxlua{structure.notes.store("\currentnote",\currentdescriptionnumberentry)}}% + \settrue\processingnote + \ifconditional\skipnoteplacement + \globallet\lastnotesymbol\dolastnotesymbol + \else + \iftypesettinglines % otherwise problems with \type {xxx} + \ignorelines % makes footnotes work in \startlines ... \stoplines + \fi + \ifnotesymbol + \dolastnotesymbol + \else + \unskip\unskip + \globallet\lastnotesymbol\dolastnotesymbol + \fi \fi - \ifnotesymbol - \dolastnotesymbol + \ifconditional\postponingnotes + \global\settrue\postponednote \else - \unskip\unskip - \globallet\lastnotesymbol\dolastnotesymbol + \handlenoteinsert\currentnote\currentnotenumber \fi - \fi - \ifconditional\postponingnotes - \global\settrue\postponednote - \else - \handlenoteinsert\currentnote\currentnotenumber - \fi - \ifconditional\skipnoteplacement \else - \kern\notesignal\relax % \relax is needed to honor spaces - \iftrialtypesetting \else \global\setfalse\skipnoteplacement \fi - \fi - \endgroup} + \ifconditional\skipnoteplacement \else + \kern\notesignal\relax % \relax is needed to honor spaces + \iftrialtypesetting \else \global\setfalse\skipnoteplacement \fi + \fi + \endgroup + \fi} \def\dolastnotesymbol{\typesetsomenotesymbol\currentnote\currentnotenumber} @@ -552,7 +569,7 @@ \nobreak \doifelse{\noteparameter\c!interaction}\v!no {\dotypesetsomenotesymbol{#1}{#2}} - {\gotobox{\dotypesetsomenotesymbol{#1}{#2}}[page(\ctxlua{structure.notes.getnumberpage("#1",\number#2)})]}% f: + {\directgotobox{\dotypesetsomenotesymbol{#1}{#2}}[page(\ctxlua{structure.notes.getnumberpage("#1",\number#2)})]}% f: \globallet\lastnotesymbol\relax} \def\currentnotedescriptiontext % todo: can be other number @@ -561,7 +578,7 @@ \def\currentnoteenumerationfullnumber {\doifelse{\noteparameter\c!interaction}\v!no {\docurrentnoteenumerationfullnumber}% - {\gotobox + {\directgotobox {\docurrentnoteenumerationfullnumber}% [page(\ctxlua{structure.notes.getsymbolpage("\currentnote",\currentdescriptionnumberentry)})]}} @@ -632,7 +649,7 @@ \newtoks\everyafternoteinsert \appendtoks - \let\doflushnotes\relax + \let\flushnotes\relax \let\postponenotes\relax \forgetall \to \everybeforenoteinsert @@ -782,52 +799,19 @@ \ctxlua{structure.notes.postpone()}% \fi} -% \def\flushnotes -% {\ifconditional\processingnote \else -% \ifconditional\postponednote -% \ifinner \else -% \ifinpagebody \else -% %ifvmode % less interference, but also less secure -% \doflushnotes -% %fi -% \fi -% \fi -% \fi -% \fi} - \def\flushnotes - {\ifconditional\postponednote + {\ifconditional\postponingnotes \flushnotesindeed \fi} \def\flushnotesindeed - {\ifconditional\processingnote \else - \ifinner \else - \ifinpagebody \else - %ifvmode % less interference, but also less secure - \doflushnotes - %fi - \fi - \fi - \fi} - -\def\doflushnotes % also called directly, \ifvoid is needed ! {\begingroup - \let\doflushnotes\relax + \let\flushnotes \relax \let\postponenotes\relax - \ifconditional\processingnote \else - \ifconditional\postponednote - \processnotes\dodoflushnotes - \global\setfalse\postponednote - \setfalse\postponingnotes - \fi - \fi - \endgroup} - -\def\dodoflushnotes % per class, todo: handle endnotes here - {%\writestatus{notes}{flushing \currentnote}% + \ctxlua{structure.notes.flushpostponed()}% this also resets the states ! + \global\setfalse\postponednote \global\setfalse\postponingnotes - \ctxlua{structure.notes.flush("\currentnote","postpone")}} + \endgroup} %D \macros %D {startlocalfootnotes,placelocalfootnotes} @@ -843,7 +827,7 @@ \newtoks\everyplacelocalnotes \appendtoks - \let\doflushnotes\relax + \let\flushnotes \relax \let\postponenotes\relax \to \everyplacelocalnotes @@ -1003,6 +987,8 @@ %D \macros %D {fakenotes} + % is this ok? endnotes and such + \def\fakenotes {\ifhmode\endgraf\fi\ifvmode \calculatetotalclevernoteheight @@ -1123,8 +1109,6 @@ \def\placelocalfootnotes {\dodoubleempty\doplacelocalfootnotes[\v!footnote]} \def\startlocalfootnotes {\startlocalnotes [\v!footnote]} % alleen footnote \def\stoplocalfootnotes {\stoplocalnotes } - \def\flushfootnotes {\flushnotes} - \def\doflushfootnotes {\doflushnotes} \def\doplacefootnotes [#1][#2]{\ifsecondargument\placenotes [#1][#2,\c!height=\textheight]\else\placenotes [#1]\fi} \def\doplacelocalfootnotes[#1][#2]{\ifsecondargument\placelocalnotes[#1][#2,\c!height=\textheight]\else\placelocalnotes[#1]\fi} diff --git a/tex/context/base/strc-num.lua b/tex/context/base/strc-num.lua index 8918346c6..b80c27f3c 100644 --- a/tex/context/base/strc-num.lua +++ b/tex/context/base/strc-num.lua @@ -8,7 +8,8 @@ if not modules then modules = { } end modules ['strc-num'] = { local format = string.format local next, type = next, type -local texsprint = tex.sprint +local min, max = math.min, math.max +local texsprint, texcount = tex.sprint, tex.count structure = structure or { } structure.helpers = structure.helpers or { } @@ -71,15 +72,29 @@ local function constructor(t,s,name,i) return t.stop end elseif s == "first" then - if t.offset then + if t.start > 0 then + return t.start -- brrr + elseif t.offset then return t.start + t.step + 1 else return t.start + 1 end elseif s == "prev" or s == "previous" then - return math.max(t.first,t.number-1) -- todo: step + return max(t.first,t.number-1) -- todo: step elseif s == "next" then - return math.min(t.last,t.number+1) -- todo: step + return min(t.last,t.number+1) -- todo: step + elseif s == "backward" then + if t.number - 1 < t.first then + return t.last + else + return t.previous + end + elseif s == "forward" then + if t.number + 1 > t.last then + return t.first + else + return t.next + end elseif s == "subs" then local cc = collected[name] t.subs = (cc and cc[i+1] and cc[i+1][t.range]) or 0 @@ -134,6 +149,10 @@ local function allocate(name,i) return ci end +function counters.record(name,i) + return allocate(name,i or 1) +end + local function savevalue(name,i) local cd = counterdata[name].data[i] local cs = tobesaved[name][i] @@ -148,8 +167,8 @@ end function counters.define(name, start, counter) -- todo: step local d = allocate(name,1) d.start = start - if counter and counter > 0 then - d.counter = counter -- only for special purposes + if counter ~= "" then + d.counter = counter -- only for special purposes, cannot be false end end @@ -248,7 +267,7 @@ function counters.reset(name,n) savevalue(name,i) d.number = d.start or 0 d.own = nil - -- if d.counter then tex.count[d.counter] = d.number end + if d.counter then texcount[d.counter] = d.number end end cd.numbers = nil end @@ -260,7 +279,7 @@ function counters.set(name,n,value) local d = allocate(name,n) d.number = value or 0 d.own = nil - -- if d.counter then tex.count[d.counter] = d.number end + if d.counter then texcount[d.counter] = d.number end end end @@ -270,7 +289,7 @@ local function check(name,data,start,stop) savevalue(name,i) d.number = d.start or 0 d.own = nil - -- if d.counter then tex.count[d.counter] = d.number end + if d.counter then texcount[d.counter] = d.number end end end @@ -283,6 +302,7 @@ function counters.setown(name,n,value) if cd.level and cd.level > 0 then -- 0 is signal that we reset manually check(name,data,n+1) -- where is check defined end + if d.counter then texcount[d.counter] = d.number end end end @@ -322,6 +342,7 @@ function counters.add(name,n,delta) if cd.level and cd.level > 0 then -- 0 is signal that we reset manually check(name,data,n+1) end + if d.counter then texcount[d.counter] = d.number end return d.number end return 0 diff --git a/tex/context/base/strc-num.mkiv b/tex/context/base/strc-num.mkiv index 6498b4e55..eb2f441fd 100644 --- a/tex/context/base/strc-num.mkiv +++ b/tex/context/base/strc-num.mkiv @@ -93,13 +93,8 @@ {\donodefinestructurecounter[#1][#2]}}} \def\dododefinestructurecounter[#1][#2]% - {\getparameters - [\??nn#1] - [\s!counter=,#2]% counter is for internal purposes - \ctxlua{structure.counters.define("#1", - tonumber("\structurecounterparameter{#1}\c!start") or 0, - tonumber("\structurecounterparameter{#1}\s!counter") or 0 - )}% + {\getparameters[\??nn#1][\s!counter=,#2]% counter is for internal purposes + \ctxlua{structure.counters.define("#1",tonumber("\structurecounterparameter{#1}\c!start") or 0,"\structurecounterparameter{#1}\s!counter")}% \docheckstructurecountersetup{#1}} \def\donodefinestructurecounter[#1][#2]% inherit @@ -227,6 +222,32 @@ )}% \endgroup} +\def\directconvertedstructurecounter#1#2% name, type + {\begingroup + \ctxlua{structure.counters.prefixedconverted( + "\@@thestructurecounter{#1}", + { + prefix = "\structurecounterparameter{#1}\c!prefix", + separatorset = "\structurecounterparameter{#1}\c!prefixseparatorset", + conversion = "\structurecounterparameter{#1}\c!prefixconversion", + conversionset = "\structurecounterparameter{#1}\c!prefixconversionset", + stopper = \!!bs\structurecounterparameter{#1}\c!prefixstopper\!!es, + set = "\structurecounterparameter{#1}\c!prefixset", + segments = "\structurecounterparameter{#1}\c!prefixsegments", + connector = \!!bs\structurecounterparameter{#1}\c!prefixconnector\!!es, + }, + { + order = "\structurecounterparameter{#1}\c!numberorder", + separatorset = "\structurecounterparameter{#1}\c!numberseparatorset", + conversion = \!!bs\structurecounterparameter{#1}\c!numberconversion\!!es, + conversionset = "\structurecounterparameter{#1}\c!numberconversionset", + stopper = \!!bs\structurecounterparameter{#1}\c!numberstopper\!!es, + segments = "\structurecounterparameter{#1}\c!numbersegments", + type = "#2", + } + )}% + \endgroup} + \def\convertedsubstructurecounter {\dotripleempty\doconvertedsubstructurecounter} @@ -414,11 +435,11 @@ userdata = structure.helpers.touserdata(\!!bs\detokenize{#9}\!!es) } }}% - \xdef\laststructurecountersynchronize % make this a macro because shared - {\noexpand\ctxlua{jobreferences.setinternalreference(nil,nil,\nextinternalreference)}% - \noexpand\ctxlatelua{structure.lists.enhance(\laststructurecounternumber)}}% + \xdef\laststructurecounterattribute {\ctxlua {tex.write(jobreferences.setinternalreference(nil,nil,\nextinternalreference))}}% + \xdef\laststructurecountersynchronize{\ctxlatelua{structure.lists.enhance(\laststructurecounternumber)}}% \else \glet\laststructurecounternumber \relax + \glet\laststructurecounterattribute \relax \glet\laststructurecountersynchronize\relax \fi \endgroup} diff --git a/tex/context/base/strc-pag.lua b/tex/context/base/strc-pag.lua index bb2de7881..b95f0842a 100644 --- a/tex/context/base/strc-pag.lua +++ b/tex/context/base/strc-pag.lua @@ -6,10 +6,10 @@ if not modules then modules = { } end modules ['strc-pag'] = { license = "see context related readme files" } -local count, format = tex.count, string.format +local texcount, format = tex.count, string.format local ctxcatcodes = tex.ctxcatcodes -local texsprint = tex.sprint +local texsprint, texwrite = tex.sprint, tex.write structure.pages = structure.pages or { } @@ -38,7 +38,7 @@ job.register('jobpages.collected', jobpages.tobesaved, initializer) local specification = { } function pages.save(userspec) - local realpage, userpage = count[0], count[1] + local realpage, userpage = texcount.realpageno, texcount.userpageno local data = { number = userpage, specification = helpers.simplify(userspec or specification), @@ -61,9 +61,9 @@ function pages.pagenumber(localspec) end end if deltaspec then - return { realpage = count[0], specification = deltaspec } + return { realpage = texcount.realpageno, specification = deltaspec } else - return { realpage = count[0] } + return { realpage = texcount.realpageno } end end @@ -142,7 +142,8 @@ end function helpers.prefixpage(data,prefixspec,pagespec) if data then - local pagedata, prefixdata = pages.analyse(data,pagespec) + local pagedata, prefixdata, e = pages.analyse(data,pagespec) +--~ tex.write(e) if pagedata then if prefixdata then sections.typesetnumber(prefixdata,"prefix",prefixspec or false,prefixdata or false,pagedata.specification or false) @@ -156,7 +157,7 @@ function helpers.prefixlastpage(data,prefixspec,pagespec) if data then local r = data.references local ls, lr = r.section, r.realpage - r.section, r.realpage = r.lastsection, r.lastrealpage + r.section, r.realpage = r.lastsection or r.section, r.lastrealpage or r.realpage helpers.prefixpage(data,prefixspec,pagespec) r.section, r.realpage = ls, lr end diff --git a/tex/context/base/strc-pag.mkiv b/tex/context/base/strc-pag.mkiv index b4286f970..276cf8b78 100644 --- a/tex/context/base/strc-pag.mkiv +++ b/tex/context/base/strc-pag.mkiv @@ -20,9 +20,6 @@ % Hacks: \let\preparepageprefix\gobbleoneargument -\let\checkrealpage \relax -\let\checksubpages \relax -\let\setpagecounters \relax % Allocation: @@ -58,9 +55,9 @@ % prefixset=mine, % prefixseparatorset=mine] -\definestructurecounter[\s!realpage][\c!prefix=\v!no,\c!start=1,\c!prefixsegments=] % [\s!counter=0] -\definestructurecounter[\s!userpage][\c!prefix=\v!no,\c!start=1,\c!prefixsegments=] % [\s!counter=1] -\definestructurecounter[\s!subpage] [\c!prefix=\v!no,\c!start=1,\c!prefixsegments=] % [\s!counter=2] +\definestructurecounter[\s!realpage][\c!prefix=\v!no,\c!start=1,\c!prefixsegments=] % \c!counter=realpage +\definestructurecounter[\s!userpage][\c!prefix=\v!no,\c!start=1,\c!prefixsegments=] % \c!counter=userpage +\definestructurecounter[\s!subpage] [\c!prefix=\v!no,\c!start=1,\c!prefixsegments=] % \c!counter=subpage \newtoks\everysetuprealpagenumber % todo: set state: none, start, stop, reset \newtoks\everysetupuserpagenumber % todo: set state: none, start, stop, reset @@ -89,26 +86,6 @@ \let\setuppagenumber\setupuserpagenumber \let\resetpagenumber\resetuserpagenumber -% { -% prefix = "\structurecounterparameter{#1}\c!prefix", -% separatorset = "\structurecounterparameter{#1}\c!prefixseparatorset", -% conversion = "\structurecounterparameter{#1}\c!prefixconversion", -% conversionset = "\structurecounterparameter{#1}\c!prefixconversionset", -% stopper = \!!bs\structurecounterparameter{#1}\c!prefixstopper\!!es, -% set = "\structurecounterparameter{#1}\c!prefixset", -% segments = "\structurecounterparameter{#1}\c!prefixsegments", -% connector = \!!bs\structurecounterparameter{#1}\c!prefixconnector\!!es, -% }, -% { -% order = "\structurecounterparameter{#1}\c!numberorder", -% separatorset = "\structurecounterparameter{#1}\c!numberseparatorset", -% conversion = "\structurecounterparameter{#1}\c!numberconversion", -% conversionset = "\structurecounterparameter{#1}\c!numberconversionset", -% stopper = \!!bs\structurecounterparameter{#1}\c!numberstopper\!!es, -% segments = "\structurecounterparameter{#1}\c!numbersegments", -% type = "\structurecounterparameter{#1}\c!type", -% } - \def\savecurrentpagestate {\ctxlua{structure.pages.save { prefix = "\structurecounterparameter\s!userpage\c!prefix", @@ -139,15 +116,6 @@ [\c!way=\v!by\v!part, \c!state=\v!stop] -% We don't want conflicts when \type {\pageno} is used by other -% packages, like \CWEB, so we redefine \type {\pageno}. - -\newcount\pageno \pageno\userpageno \let\folio\userfolio - -\appendtoks - \global\pageno\userpageno -\to \everyinitializepagecounters - % Counters % \def\firstpage {1} \def\prevpage {1} \def\nextpage {1} \def\lastpage {1} @@ -209,28 +177,28 @@ % Renderers: -\def\realpagenumber{\convertedstructurecounter[\s!realpage]} -\def\userpagenumber{\convertedstructurecounter[\s!userpage]} -\def\subpagenumber {\convertedstructurecounter[\s!subpage]} +\def\pagenumber {\rawstructurecounter[\s!userpage]} +\def\prefixedpagenumber {\directconvertedstructurecounter\s!userpage\empty} % \userpagenumber -\def\pagenumber {\rawstructurecounter[\s!userpage]} -\def\prefixedpagenumber{\convertedstructurecounter[\s!userpage]} % \userpagenumber +\def\realpagenumber {\directconvertedstructurecounter\s!realpage\empty} +\def\userpagenumber {\directconvertedstructurecounter\s!userpage\empty} +\def\subpagenumber {\directconvertedstructurecounter\s!subpage \empty} -\def\firstrealpagenumber{\convertedstructurecounter[\s!realpage][\c!type=\v!first]} -\def\firstuserpagenumber{\convertedstructurecounter[\s!userpage][\c!type=\v!first]} -\def\firstsubpagenumber {\convertedstructurecounter[\s!subpage ][\c!type=\v!first]} +\def\firstrealpagenumber{\directconvertedstructurecounter\s!realpage\v!first} +\def\firstuserpagenumber{\directconvertedstructurecounter\s!userpage\v!first} +\def\firstsubpagenumber {\directconvertedstructurecounter\s!subpage \v!first} -\def\lastrealpagenumber {\convertedstructurecounter[\s!realpage][\c!type=\v!last]} -\def\lastuserpagenumber {\convertedstructurecounter[\s!userpage][\c!type=\v!last]} -\def\lastsubpagenumber {\convertedstructurecounter[\s!subpage ][\c!type=\v!last]} +\def\lastrealpagenumber {\directconvertedstructurecounter\s!realpage\v!last} +\def\lastuserpagenumber {\directconvertedstructurecounter\s!userpage\v!last} +\def\lastsubpagenumber {\directconvertedstructurecounter\s!subpage \v!last} -\def\prevrealpagenumber {\convertedstructurecounter[\s!realpage][\c!type=\v!previous]} -\def\prevuserpagenumber {\convertedstructurecounter[\s!userpage][\c!type=\v!previous]} -\def\prevsubpagenumber {\convertedstructurecounter[\s!subpage ][\c!type=\v!previous]} +\def\prevrealpagenumber {\directconvertedstructurecounter\s!realpage\v!previous} +\def\prevuserpagenumber {\directconvertedstructurecounter\s!userpage\v!previous} +\def\prevsubpagenumber {\directconvertedstructurecounter\s!subpage \v!previous} -\def\nextrealpagenumber {\convertedstructurecounter[\s!realpage][\c!type=\v!next]} -\def\nextuserpagenumber {\convertedstructurecounter[\s!userpage][\c!type=\v!next]} -\def\nextsubpagenumber {\convertedstructurecounter[\s!subpage ][\c!type=\v!next]} +\def\nextrealpagenumber {\directconvertedstructurecounter\s!realpage\v!next} +\def\nextuserpagenumber {\directconvertedstructurecounter\s!userpage\v!next} +\def\nextsubpagenumber {\directconvertedstructurecounter\s!subpage \v!next} \appendtoks \decrementstructurecounter[\s!realpage]% @@ -242,9 +210,9 @@ % % todo: maybe leave lastpage etc lua calls -\def\realpage{\realfolio} -\def\userpage{\userfolio} -\def\subpage {\subfolio} +\def\realpage{\the\realpageno} +\def\userpage{\the\userpageno} +\def\subpage {\the\subpageno} % Hooks: @@ -253,71 +221,26 @@ \ifnum\realpageno>\lastpage \globallet\lastpage\lastrealpage \fi \to \everyinitializepagecounters -% \def\savenofpages -% {\global\realpageno\decrementedstructurecounter[\s!realpage]\relax -% \global\pageno \decrementedstructurecounter[\s!userpage]\relax} - -\let\savenofpages\relax - % States: \newif\ifrightpage \rightpagetrue \newif\ifdoublesided \newif\ifsinglesided -% Real page numbers: +% Realpage and subpage numbers: -\def\gotonextrealpage - {\global\realpageno\incrementedstructurecounter[\s!realpage]\relax - \ifnum\realpageno>\lastpage - \xdef\lastpage{\realfolio}% - \fi - \setpagereference\v!firstpage\firstpage - \setpagereference\v!lastpage\lastpage - \ifnum\realpageno>\plusone - \xdef\prevpage{\the\numexpr\realpageno+\minusone}% - \setpagereference\v!backward\prevpage - \else - \global\let\prevpage\firstpage - \setpagereference\v!backward\lastpage - \fi - \setpagereference\v!previouspage\prevpage - \ifnum\realpageno<\lastpage\relax - \xdef\nextpage{\the\numexpr\realpageno+\plusone}% - \setpagereference\v!page\nextpage - \setpagereference\v!forward\nextpage - \glet\nextnextpage\nextpage - \ifodd\nextpage\relax - \setpagereference\v!nextoddpage\nextnextpage - \else - \setpagereference\v!nextevenpage\nextnextpage - \fi - \xdef\nextnextpage{\the\numexpr\realpageno+\plustwo}% - \ifnum\nextnextpage>\lastpage\else - \ifodd\nextnextpage\relax - \setpagereference\v!nextoddpage\nextnextpage - \else - \setpagereference\v!nextevenpage\nextnextpage - \fi - \fi - \else - \glet\nextpage\lastpage - \setpagereference\v!page\firstpage - \setpagereference\v!forward\firstpage - \setpagereference\v!nextoddpage\lastpage - \setpagereference\v!nextevenpage\lastpage - \fi - \setpagereference\v!nextpage\realfolio} +\def\setnextrealpageno{\global\realpageno\incrementedstructurecounter[\s!realpage]\relax} +\def\setnextsubpageno {\global\subpageno \incrementedstructurecounter[\s!subpage ]\relax} -% Pagenumbers: +% Page numbers: -\def\dodecrementpagenumber{\global\userpageno\decrementedstructurecounter[\s!userpage]\relax\global\pageno\userpageno} -\def\doincrementpagenumber{\global\userpageno\incrementedstructurecounter[\s!userpage]\relax\global\pageno\userpageno} +\def\dodecrementpagenumber{\global\userpageno\decrementedstructurecounter[\s!userpage]\relax} +\def\doincrementpagenumber{\global\userpageno\incrementedstructurecounter[\s!userpage]\relax} \def\dosynchronizepagenumber{\global\let\@@pnstate\v!start} -\def\decrementpagenumber{\getvalue{\??pn-\structurecounterparameter\s!userpage\c!state}} -\def\incrementpagenumber{\getvalue{\??pn+\structurecounterparameter\s!userpage\c!state}} +\def\decrementpagenumber{\csname\??pn-\structurecounterparameter\s!userpage\c!state\endcsname} +\def\incrementpagenumber{\csname\??pn+\structurecounterparameter\s!userpage\c!state\endcsname} \letvalue{\??pn-\v!start}\dodecrementpagenumber \letvalue{\??pn-\v!none }\dodecrementpagenumber @@ -330,36 +253,6 @@ % todo: check if number set, and reset it after testing; also take care of \global\shiftedrealpagenotrue -% Subpagenumbers: - -\def\gotonextsubpage - {\global\subpageno\incrementedstructurecounter[\s!subpage]\relax - \ifnum\subpageno>\lastsubpage - \xdef\lastsubpage{\subfolio}% - \fi - \setpagereference\v!firstsubpage\firstsubpage - \setpagereference\v!lastsubpage\lastsubpage - \ifnum\subpageno>\plusone - \xdef\prevsubpage{\the\numexpr\subpageno+\minusone}% - \setpagereference\v!subbackward\prevsubpage - \else - \global\let\prevsubpage\firstsubpage - \setpagereference\v!subbackward\lastsubpage - \fi - \setpagereference\v!previoussubpage\prevsubpage - \ifnum\subpageno<\lastsubpage\relax - \xdef\nextsubpage{\the\numexpr\subpageno+\plusone}% - \setpagereference\v!subpage\nextsubpage - \setpagereference\v!subforward\nextsubpage - \glet\nextnextpage\nextsubpage - \xdef\nextnextpage{\the\numexpr\subpageno+\plustwo}% - \else - \glet\nextsubpage\lastsubpage - \setpagereference\v!subpage\firstsubpage - \setpagereference\v!subforward\firstsubpage - \fi - \setpagereference\v!nextsubpage\subfolio} - % Control: \def\getpagestatus % hierboven gebruiken @@ -383,8 +276,7 @@ \appendtoks \singlesidedfalse \doublesidedfalse - \ExpandFirstAfter\processallactionsinset - [\@@nmalternative] + \normalexpanded{\noexpand\processallactionsinset[\@@nmalternative]} [ \v!singlesided=>\singlesidedtrue, \v!doublesided=>\doublesidedtrue]% \ifx\trackingmarginnotestrue\undefined\else diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua index f18bb9407..da5de43d6 100644 --- a/tex/context/base/strc-ref.lua +++ b/tex/context/base/strc-ref.lua @@ -6,7 +6,8 @@ if not modules then modules = { } end modules ['strc-ref'] = { license = "see context related readme files" } -local format, gmatch, texsprint, texwrite, count = string.format, string.gmatch, tex.sprint, tex.write, tex.count +local format, find, gmatch, match = string.format, string.find, string.gmatch, string.match +local texsprint, texwrite, texcount = tex.sprint, tex.write, tex.count local ctxcatcodes = tex.ctxcatcodes local variables = interfaces.variables @@ -32,13 +33,6 @@ local defined, derived, specials, runners = jobreferences.defined, jobreferences local currentreference = nil -local gotoinner = "\\gotoinner{%s}{%s}{%s}{%s}" -- prefix inner page data -local gotoouterfilelocation = "\\gotoouterfilelocation{%s}{%s}{%s}{%s}" -- file location page data -local gotoouterfilepage = "\\gotoouterfilepage{%s}{%s}{%s}" -- file page data -local gotoouterurl = "\\gotoouterurl{%s}{%s}{%s}" -- url args data -local gotoinnerpage = "\\gotoinnerpage{%s}{%s}" -- page data -local gotospecial = "\\gotospecial{%s}{%s}{%s}{%s}{%s}" -- action, special, operation, arguments, data - jobreferences.initializers = jobreferences.initializers or { } function jobreferences.registerinitializer(func) -- we could use a token register instead @@ -56,9 +50,11 @@ if job then job.register('jobreferences.collected', jobreferences.tobesaved, initializer) end +-- todo: delay split till later as in destinations we split anyway + function jobreferences.set(kind,prefix,tag,data) for ref in gmatch(tag,"[^,]+") do - local p, r = ref:match("^(%-):(.-)$") + local p, r = match(ref,"^(%-):(.-)$") if p and r then prefix, ref = p, r else @@ -76,10 +72,15 @@ function jobreferences.set(kind,prefix,tag,data) end end +function jobreferences.setandgetattribute(kind,prefix,tag,data) -- maybe do internal automatically here + jobreferences.set(kind,prefix,tag,data) + texcount.lastdestinationattribute = jobreferences.setinternalreference(prefix,tag) or -0x7FFFFFFF +end + function jobreferences.enhance(prefix,tag,spec) local l = tobesaved[prefix][tag] if l then - l.references.realpage = tex.count[0] + l.references.realpage = texcount.realpageno end end @@ -87,14 +88,22 @@ end local result = { } -local lparent, rparent, lbrace, rbrace, dcolon = lpeg.P("("), lpeg.P(")"), lpeg.P("{"), lpeg.P("}"), lpeg.P("::") +local lparent, rparent, lbrace, rbrace, dcolon, backslash = lpeg.P("("), lpeg.P(")"), lpeg.P("{"), lpeg.P("}"), lpeg.P("::"), lpeg.P("\\") -local reset = lpeg.P("") / function (s) result = { } end -local outer = (1-dcolon-lparent-lbrace )^1 / function (s) result.outer = s end -local operation = (1-rparent-rbrace-lparent-lbrace)^1 / function (s) result.operation = s end -local arguments = (1-rbrace )^0 / function (s) result.arguments = s end -local special = (1-lparent-lbrace-lparent-lbrace)^1 / function (s) result.special = s end -local inner = (1-lparent-lbrace )^1 / function (s) result.inner = s end +local reset = lpeg.P("") / function() result = { } end +local b_token = backslash / function(s) result.has_tex = true return s end + +local o_token = 1 - rparent - rbrace - lparent - lbrace +local a_token = 1 - rbrace +local s_token = 1 - lparent - lbrace - lparent - lbrace +local i_token = 1 - lparent - lbrace +local f_token = 1 - lparent - lbrace - dcolon + +local outer = (f_token )^1 / function (s) result.outer = s end +local operation = lpeg.Cs((b_token + o_token)^1) / function (s) result.operation = s end +local arguments = lpeg.Cs((b_token + a_token)^0) / function (s) result.arguments = s end +local special = (s_token )^1 / function (s) result.special = s end +local inner = (i_token )^1 / function (s) result.inner = s end local outer_reference = (outer * dcolon)^0 @@ -110,12 +119,8 @@ function jobreferences.analyse(str) return scanner:match(str) end -local splittemplate = "\\setreferencevariables{%s}{%s}{%s}{%s}{%s}" -- will go away - function jobreferences.split(str) - local t = scanner:match(str or "") - texsprint(ctxcatcodes,format(splittemplate,t.special or "",t.operation or "",t.arguments or "",t.outer or "",t.inner or "")) - return t + return scanner:match(str or "") end --~ print(table.serialize(jobreferences.analyse(""))) @@ -173,7 +178,10 @@ local function register_from_lists(collected,derived) local kind, realpage = m.kind, r.realpage if kind and realpage then local d = derived[prefix] if not d then d = { } derived[prefix] = d end - d[reference] = { kind, i } +--~ d[reference] = { kind, i } +for s in gmatch(reference,"[^,]+") do + d[s] = { kind, i } +end end end end @@ -345,6 +353,7 @@ end local settings_to_array = aux.settings_to_array local function resolve(prefix,reference,args,set) -- we start with prefix,reference + texcount.referencehastexstate = 0 if reference and reference ~= "" then set = set or { } local r = settings_to_array(reference) @@ -369,11 +378,17 @@ local function resolve(prefix,reference,args,set) -- we start with prefix,refere if args then var.arguments = args end set[#set+1] = var end + if var.has_tex then + set.has_tex = true + end else -- logs.report("references","funny pattern: %s",ri or "?") end end end + if set.has_tex then + texcount.referencehastexstate = 1 + end return set else return { } @@ -382,6 +397,44 @@ end -- prefix == "" is valid prefix which saves multistep lookup +jobreferences.currentset = nil + +local b, e = "\\ctxlua{local jc = jobreferences.currentset;", "}" +local o, a = 'jc[%s].operation=[[%s]];', 'jc[%s].arguments=[[%s]];' + +function jobreferences.expandcurrent() -- todo: two booleans: o_has_tex& a_has_tex + local currentset = jobreferences.currentset + if currentset and currentset.has_tex then + local done = false + for i=1,#currentset do + local ci = currentset[i] + local operation = ci.operation + if operation then + if find(operation,"\\") then -- if o_has_tex then + if not done then + texsprint(ctxcatcodes,b) + done = true + end + texsprint(ctxcatcodes,format(o,i,operation)) + end + end + local arguments = ci.arguments + if arguments then + if find(arguments,"\\") then -- if a_has_tex then + if not done then + texsprint(ctxcatcodes,b) + done = true + end + texsprint(ctxcatcodes,format(a,i,arguments)) + end + end + end + if done then + texsprint(ctxcatcodes,e) + end + end +end + local function identify(prefix,reference) local set = resolve(prefix,reference) local bug = false @@ -390,7 +443,6 @@ local function identify(prefix,reference) local special, inner, outer, arguments, operation = var.special, var.inner, var.outer, var.arguments, var.operation if special then local s = specials[special] ---~ print(table.serialize(specials)) if s then if outer then if operation then @@ -535,9 +587,6 @@ local function identify(prefix,reference) if s then var.kind = "special" else ---~ i = (tobesaved[""] and tobesaved[""][inner]) or ---~ (derived [""] and derived [""][inner]) or ---~ (collected[""] and collected[""][inner]) i = (collected[""] and collected[""][inner]) or (derived [""] and derived [""][inner]) or (tobesaved[""] and tobesaved[""][inner]) @@ -558,91 +607,45 @@ local function identify(prefix,reference) bug = bug or var.error set[i] = var end ---~ print(prefix,reference,table.serialize(set)) + jobreferences.currentset = set return set, bug end jobreferences.identify = identify -function jobreferences.doifelse(prefix,reference) +function jobreferences.doifelse(prefix,reference,highlight,newwindow,layer) local set, bug = identify(prefix,reference) local unknown = bug or #set == 0 if unknown then - currentreference = nil + currentreference = nil -- will go away else + set.highlight, set.newwindow,set.layer = highlight, newwindow, layer currentreference = set[1] end + -- we can do the expansion here which saves a call commands.doifelse(not unknown) end -function jobreferences.analysis(prefix,reference) - local set, bug = identify(prefix,reference) - local unknown = bug or #set == 0 - if unknown then - currentreference = nil - texwrite(0) -- unknown - else - currentreference = set[1] - texwrite(1) -- whatever ---~ texwrite(2) -- forward, following page ---~ texwrite(3) -- backward, preceding page ---~ texwrite(4) -- forward, same page ---~ texwrite(5) -- backward, same page - end -end - -function jobreferences.handle(prefix,reference) -- todo: use currentreference is possible - local set, bug = identify(prefix,reference) - if bug or #set == 0 then - texsprint(ctxcatcodes,"\\referenceunknownaction") - else - for i=2,#set do - local s = set[i] -currentreference = s - -- not that needed, but keep it for a while - texsprint(ctxcatcodes,format(splittemplate,s.special or "",s.operation or "",s.arguments or "",s.outer or "",s.inner or "")) - -- - if s.error then - texsprint(ctxcatcodes,"\\referenceunknownaction") - else - local runner = runners[s.kind] - if runner then - texsprint(ctxcatcodes,runner(s,"\\secondaryreferencefoundaction")) - end +function jobreferences.setinternalreference(prefix,tag,internal,view) + local t = { } + if tag then + if prefix and prefix ~= "" then + prefix = prefix .. ":" + for ref in gmatch(tag,"[^,]+") do + t[#t+1] = prefix .. ref end - end - local s = set[1] -currentreference = s - -- not that needed, but keep it for a while - texsprint(ctxcatcodes,format(splittemplate,s.special or "",s.operation or "",s.arguments or "",s.outer or "",s.inner or "")) - -- - if s.error then - texsprint(ctxcatcodes,"\\referenceunknownaction") else - local runner = runners[s.kind] - if runner then - texsprint(ctxcatcodes,runner(s,"\\primaryreferencefoundaction")) + for ref in gmatch(tag,"[^,]+") do + t[#t+1] = ref end end end -end - -local thisdestinationyes = "\\thisisdestination{%s:%s}" -local thisdestinationnop = "\\thisisdestination{%s}" -local thisdestinationaut = "\\thisisdestination{aut:%s}" - -function jobreferences.setinternalreference(prefix,tag,internal) - if tag then - for ref in gmatch(tag,"[^,]+") do - if not prefix or prefix == "" then - texsprint(ctxcatcodes,format(thisdestinationnop,ref)) - else - texsprint(ctxcatcodes,format(thisdestinationyes,prefix,ref)) - end - end + if internal then + t[#t+1] = "aut:" .. internal end - texsprint(ctxcatcodes,format(thisdestinationaut,internal)) - -- texsprint(ctxcatcodes,"[["..internal.."]]") + local destination = jobreferences.mark(t,nil,nil,view) -- returns an attribute + texcount.lastdestinationattribute = destination + return destination end -- @@ -708,11 +711,19 @@ function filters.text.page(data,prefixspec,pagespec) helpers.prefixpage(data,prefixspec,pagespec) end ---~ filters.section = { } +filters.section = { } ---~ filters.section.title = filters.generic.title ---~ filters.section.number = filters.generic.number ---~ filters.section.page = filters.generic.page +filters.section.title = filters.generic.title +filters.section.page = filters.generic.page + +function filters.section.number(data) -- todo: spec and then no stopper + if data then + local numberdata = data.numberdata + if numberdata then + sections.typesetnumber(numberdata,"number",numberdata or false) + end + end +end --~ filters.float = { } @@ -720,164 +731,126 @@ end --~ filters.float.number = filters.generic.number --~ filters.float.page = filters.generic.page --- each method gets its own call, so that we can later move completely to lua +structure.references = structure.references or { } +structure.helpers = structure.helpers or { } -runners["inner"] = function(var,content) - -- inner - currentreference = var - local r = var.r - return (r and format(gotoinner,var.p or "",var.inner,r,content)) or "error" -end +local references = structure.references +local helpers = structure.helpers -runners["inner with arguments"] = function(var,content) - -- inner{argument} - currentreference = var - return "todo: " .. var.kind or "?" +function references.sectiontitle(n) + helpers.sectiontitle(lists.collected[tonumber(n) or 0]) end -runners["outer"] = function(var,content) - -- outer:: - -- todo: resolve url/file name - currentreference = var - local url = "" - local file = var.o - return format(gotoouterfilepage,url,file,1,content) +function references.sectionnumber(n) + helpers.sectionnumber(lists.collected[tonumber(n) or 0]) end -runners["outer with inner"] = function(var,content) - -- outer::inner - -- todo: resolve url/file name - currentreference = var - local r = var.r - return (r and format(gotoouterfilelocation,var.f,var.inner,r,content)) or "error" +function references.sectionpage(n,prefixspec,pagespec) + helpers.prefixedpage(lists.collected[tonumber(n) or 0],prefixspec,pagespec) end -runners["special outer with operation"] = function(var,content) - -- special(outer::operation) - currentreference = var - return "todo: " .. var.kind or "?" -end +-- analyse -runners["special outer"] = function(var,content) - -- special() - currentreference = var - return "todo: " .. var.kind or "?" -end +jobreferences.testrunners = jobreferences.testrunners or { } +jobreferences.testspecials = jobreferences.testspecials or { } -runners["special"] = function(var,content) - -- special(operation) - currentreference = var - local handler = specials[var.special] - if handler then - return handler(var,content) -- var.special wegwerken +local runners = jobreferences.testrunners +local specials = jobreferences.testspecials + +function jobreferences.analyse(actions) + actions = actions or jobreferences.currentset + if not actions then + actions = { realpage = 0 } + elseif actions.realpage then + -- already analysed else - return "" + -- we store some analysis data alongside the indexed array + -- at this moment only the real reference page is analysed + -- normally such an analysis happens in the backend code + texcount.referencepagestate = 0 + local nofactions = #actions + if nofactions > 0 then + for i=1,nofactions do + local a = actions[i] + local what = runners[a.kind] + if what then + what = what(a,actions) + end + end + local realpage, p = texcount.realpageno, tonumber(actions.realpage) + if not p then + -- sorry + elseif p > realpage then + texcount.referencepagestate = 3 + elseif p < realpage then + texcount.referencepagestate = 2 + else + texcount.referencepagestate = 1 + end + end end + return actions end -runners["outer with inner with arguments"] = function(var,content) - -- outer::inner{argument} - currentreference = var - return "todo: " .. var.kind or "?" -end - -runners["outer with special and operation and arguments"] = function(var,content) - -- outer::special(operation{argument,argument}) - currentreference = var - return "todo: " .. var.kind or "?" -end -runners["outer with special"] = function(var,content) - -- outer::special() - currentreference = var - return "todo: " .. var.kind or "?" +function jobreferences.realpage() -- special case, we always want result + local cs = jobreferences.analyse() + texwrite(cs.realpage or 0) end -runners["outer with special and operation"] = function(var,content) - -- outer::special(operation) - currentreference = var - return "todo: " .. var.kind or "?" -end - -runners["special operation"] = runners["special"] -runners["special operation with arguments"] = runners["special"] - -local gotoactionspecial = "\\gotoactionspecial{%s}{%s}{%s}{%s}" -local gotopagespecial = "\\gotopagespecial{%s}{%s}{%s}{%s}" -local gotourlspecial = "\\gotourlspecial{%s}{%s}{%s}{%s}" -local gotofilespecial = "\\gotofilespecial{%s}{%s}{%s}{%s}" -local gotoprogramspecial = "\\gotoprogramspecial{%s}{%s}{%s}{%s}" -local gotojavascriptspecial = "\\gotojavascriptspecial{%s}{%s}{%s}{%s}" +-- -function specials.action(var,content) - return format(gotoactionspecial,var.special,var.operation,var.arguments or "",content) -end +jobreferences.pages = { + [variables.firstpage] = function() return structure.counters.record("realpage")["first"] end, + [variables.previouspage] = function() return structure.counters.record("realpage")["previous"] end, + [variables.nextpage] = function() return structure.counters.record("realpage")["next"] end, + [variables.lastpage] = function() return structure.counters.record("realpage")["last"] end, -function specials.page(var,content) - -- we need to deal with page(inner) and page(outer::1) and outer::page(1) - return format(gotopagespecial,var.special,var.operation,var.arguments or "",content) -end + [variables.firstsubpage] = function() return structure.counters.record("subpage" )["first"] end, + [variables.previoussubpage] = function() return structure.counters.record("subpage" )["previous"] end, + [variables.nextsubpage] = function() return structure.counters.record("subpage" )["next"] end, + [variables.lastsubpage] = function() return structure.counters.record("subpage" )["last"] end, -function specials.url(var,content) - local url = var.operation - if url then - local u = urls[url] - if u then - local u, f = u[1], u[2] - if f and f ~= "" then - url = u .. "/" .. f - else - url = u - end - end - end - return format(gotourlspecial,var.special,url,var.arguments or "",content) -end + [variables.forward] = function() return structure.counters.record("realpage")["forward"] end, + [variables.backward] = function() return structure.counters.record("realpage")["backward"] end, +} -function specials.file(var,content) - local file = var.operation - if file then - local f = files[file] - if f then - file = f[1] - end - end - return format(gotofilespecial,var.special,file,var.arguments or "",content) -end +-- maybe some day i will merge this in the backend code with a testmode (so each +-- runner then implements a branch) -function specials.program(var,content) - local program = var.operation - if program then - local p = programs[program] - if p then - programs = p[1] - end +runners["inner"] = function(var,actions) + local r = var.r + if r then + actions.realpage = r end - return format(gotoprogramspecial,var.special,program,var.arguments or "",content) end -function specials.javascript(var,content) - -- todo: store js code in lua - return format(gotojavascriptspecial,var.special,var.operation,var.arguments or "",content) +runners["special"] = function(var,actions) + local handler = specials[var.special] + return handler and handler(var,actions) end -specials.JS = specials.javascript - -structure.references = structure.references or { } -structure.helpers = structure.helpers or { } +runners["special operation"] = runners["special"] +runners["special operation with arguments"] = runners["special"] -local references = structure.references -local helpers = structure.helpers +local pages = jobreferences.pages -function references.sectiontitle(n) - helpers.sectiontitle(lists.collected[tonumber(n) or 0]) +function specials.internal(var,actions) + local v = jobreferences.internals[tonumber(var.operation)] + local r = v and v.references.realpage + if r then + actions.realpage = r + end end -function references.sectionnumber(n) - helpers.sectionnumber(lists.collected[tonumber(n) or 0]) -end +specials.i = specials.internal -function references.sectionpage(n,prefixspec,pagespec) - helpers.prefixedpage(lists.collected[tonumber(n) or 0],prefixspec,pagespec) +function specials.page(var,actions) + local p = pages[var.operation] + if type(p) == "function" then + p = p() + end + if p then + actions.realpage = p + end end - diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv index 61436ef77..3cd0def78 100644 --- a/tex/context/base/strc-ref.mkiv +++ b/tex/context/base/strc-ref.mkiv @@ -14,6 +14,7 @@ \writestatus{loading}{ConTeXt Structure Macros / Cross Referencing} \registerctxluafile{strc-ref}{1.001} +\registerctxluafile{node-ref}{1.001} \unprotect @@ -91,21 +92,16 @@ %D full reference, but it's the concept that counts. The low %D level implementation is: -\newcount\crossreferencenumber +\newcount\lastreferenceattribute +\newcount\lastdestinationattribute -\def\dofinishfullreference#1#2% - {\normalexpanded{\noexpand\ctxlatelua{jobreferences.enhance("#1","#2")}}% - \referenceinfo>{#1\letterbar#2}} +\def\dofinishfullreference#1#2{\normalexpanded{\ctxlatelua{jobreferences.enhance("#1","#2")}}} +\def\dofinishtextreference#1#2{\normalexpanded{\ctxlatelua{jobreferences.enhance("#1","#2",{})}}} \let\dofinishpagereference\dofinishfullreference -\def\dofinishtextreference#1#2% - {\normalexpanded{\noexpand\ctxlatelua{jobreferences.enhance("#1","#2",{})}}% - \referenceinfo>{#1\letterbar#2}} - \def\dosetreference#1#2#3% kind labels text -> todo: userdata {\ifreferencing - \global\advance\crossreferencenumber\plusone \edef\currentreferencekind{#1}% \edef\currentreferencelabels{#2}% \edef\currentreferenceexpansion{\@@rfexpansion}% {\referenceparameter\c!expansion} @@ -123,35 +119,30 @@ \fi \globallet\currentreferencecoding\s!tex \fi - \setnextinternalreference - \ctxlua { - jobreferences.set("\currentreferencekind", "\referenceprefix","\currentreferencelabels", - { - references = { - internal = \nextinternalreference, - block = "\currentstructureblock", - section = structure.sections.currentid(), - }, - metadata = { - kind = "#1", - catcodes = \the\catcodetable, - xmlroot = \ifx\currentreferencecoding\s!xml "\xmldocument" \else nil \fi, % only useful when text - }, - entries = { - text = \!!bs\currentreferencetext\!!es - } - }) - jobreferences.setinternalreference("\referenceprefix","\currentreferencelabels",\nextinternalreference) - }% + % beware, the jobreferences.set writes a + % \setnextinternalreference + \ctxlua{jobreferences.setandgetattribute("\currentreferencekind", "\referenceprefix","\currentreferencelabels", + { + references = { + % internal = \nextinternalreference, % no need for an internal as we have an explicit + block = "\currentstructureblock", + section = structure.sections.currentid(), + }, + metadata = { + kind = "#1", + catcodes = \the\catcodetable, + xmlroot = \ifx\currentreferencecoding\s!xml "\xmldocument" \else nil \fi, % only useful when text + }, + entries = { + text = \!!bs\currentreferencetext\!!es + } + }) + }% + \xdef\currentdestinationattribute{\number\lastdestinationattribute}% + \begingroup\dosetattribute{destination}\currentdestinationattribute\hbox{}\endgroup % todo \fi \fi} -%D For compatibility we provide: - -\def\rawreference #1#2#3{\dosetreference\s!full{#2}{#3}} % tag, labels, text -\def\rawpagereference #1#2{\dosetreference\s!page{#2}{}} % tag, labels -\def\rawtextreference#1#2#3{\dosetreference\s!text{#2}{#3}} % tag, labels, text - \def\defaultreferencepage#1{[[[#1]]]} \def\defaultreferencetext#1{[[[#1]]]} @@ -200,7 +191,7 @@ %D \NC \NC $\star$ \NC \NC\NR %D \stoptabulate -\def\usereferences[#1]% +\def\usereferences[#1]% not yet {\writestatus\m!systems{references from other files are handled automatically}} %D As mentioned we will also use the cross reference mechanism @@ -233,19 +224,12 @@ \let\currentsubtextreference \empty \let\currentsubsubtextreference\empty -%D System references only have one component: - -\newif\ifforwardreference -\newif\ifrealreferencepage +\newcount\referencepagestate % set in backend +\newcount\referencehastexstate % set in backend -\def\docheckrealreferencepage#1% todo - {\doifnumberelse{#1} - {\ifnum#1=\realpageno - \realreferencepagetrue - \else - \realreferencepagefalse - \fi} - {\realreferencepagefalse}} +% referencepagestate: +% +% 0 = no page ref, 1=same page, 2=before, 3=after %D Text references can contain more than one entry and %D therefore we check for @@ -262,11 +246,6 @@ %D %D and split accordingly. -% todo: - -\def\doifforwardreferenceelse#1#2% todo - {\iffalse} - %D Cross references appear as numbers (figure~1.1, chapter~2) %D or pagenumbers (page~2, page 3--2), and are called with %D \type{\in} and \type{\at}. In interactive documents we also @@ -302,19 +281,12 @@ \newif\ifreferencefound -\let\currentfullreference \empty -\let\currentreferencespecial \empty -\let\currentreferenceoperation\empty -\let\currentreferencearguments\empty -\let\currentouterreference \empty -\let\currentinnerreference \empty - -\def\setreferencevariables#1#2#3#4#5% - {\def\currentreferencespecial {#1}% - \def\currentreferenceoperation{#2}% - \def\currentreferencearguments{#3}% - \def\currentouterreference {#4}% - \def\currentinnerreference {#5}} +% \let\currentfullreference \empty +% \let\currentreferencespecial \empty +% \let\currentreferenceoperation\empty +% \let\currentreferencearguments\empty +% \let\currentouterreference \empty +% \let\currentinnerreference \empty %D Now we've come to the testing step. As we can see below, %D this macro does bit more than testing: it also resolves @@ -364,7 +336,7 @@ %D %D \starttyping %D \definereference[startup][JS(My_Script{"test",123}),titlepage] -%D \goto{do}[REF(startup)] +%D \goto{do}[startup] %D \stoptyping %D %D Now is this is a handy feature or not? @@ -395,22 +367,41 @@ %D Actually supporting chains is up to the special driver. Here %D we only provide the hooks. -\newif \ifsecondaryreference -\newcount\nofsecondaryreferences +%D \macros +%D {highlighthyperlinks} +%D +%D The next switch can be used to make user hyperlinks are +%D not highlighted when clicked on. + +\newconditional\highlighthyperlinks \settrue\highlighthyperlinks + +%D \macros +%D {gotonewwindow} +%D +%D To make the {\em goto previous jump} feature more +%D convenient when using more than one file, it makes sense +%D to force the viewer to open a new window for each file +%D opened. -% the counter stuff should move to the (mkiv) backend +\newconditional\gotonewwindow \setfalse\gotonewwindow -\def\doifreferencefoundelse#1% - {\ctxlua{jobreferences.doifelse("\referenceprefix","#1")}} +\def\expandtexincurrentreference % will happen in lua some time + {\ifcase\referencehastexstate\else\ctxlua{jobreferences.expandcurrent()}\fi} -\def\doprocessreferenceelse#1#2#3% - {\doresetgotowhereever - \nofsecondaryreferences\zerocount - \def\primaryreferencefoundaction {\secondaryreferencefalse#2}% - \def\secondaryreferencefoundaction{\advance\nofsecondaryreferences\plusone\secondaryreferencetrue#2}% - \def\referenceunknownaction {#3}% - \ctxlua{jobreferences.handle("\referenceprefix","#1")}% - \doresetgotowhereever} % to prevent problems with direct goto's +\def\doifreferencefoundelse#1#2#3% + {\ctxlua{jobreferences.doifelse("\referenceprefix","#1",\luaconditional\highlighthyperlinks,\luaconditional\gotonewwindow)}% + {\expandtexincurrentreference#2}% + {#3}} + +%D The tester only splits the reference in components but does +%D not look into them. The following macro does a preroll and +%D determines for instance the current real reference pagenumber. +%D The \type {\currentrealreference} macro does the same so unless +%D one wants to use the pagestate the next macro seldom needs to +%D be called. + +\def\analyzecurrentreference + {\ctxlua{jobreferences.analyse()}} %D The inner case is simple. Only two cases have to be taken %D care of: @@ -453,37 +444,6 @@ %D being defined, we set such an unknown reference to an empty %D one after the first encounter. -%D Sometimes we want to temporary put a reference out of -%D order. An example can be found in the menu macros. -%D -%D \starttyping -%D \doifreferencepermittedelse{reference}{set}{true}{false} -%D \stoptyping -%D -%D The second argument can be a comma seperated list. - -\let\permittedreferences\empty - - \def\doifreferencepermittedelse#1#2#3% ref found notfound - {\doprocessreferenceelse{#1} - {\donetrue - \ifx\permittedreferences\empty \else - \docheckifreferencepermitted{#1}% - \fi - \ifdone#2\else#3\fi} - {#3\unknownreference{#1}}} - - \def\docheckifreferencepermitted#1% - {\ifx\currentinnerreference\empty - \ifx\currentouterreference\empty \else - \doifinstring{\currentouterreference::}\permittedreferences\donefalse - \fi - \else\ifx\currentouterreference\empty - \doifinstring{\currentinnerreference}\permittedreferences\donefalse - \else - \doifinstring{\currentouterreference::\currentinnerreference}\permittedreferences\donefalse - \fi\fi} - %D Apart from cross references supplied by the user, \CONTEXT\ %D generates cross references itself. Most of them are not %D saved as a reference, but stored with their source, for @@ -521,103 +481,9 @@ %D the special driver modules (see \type{spec-ini}). The flag %D \type{\iflocation} signals if we're in interactive mode. -\def\thisisdestination#1% destination - {\iflocation \ifusepagedestinations \else - \dostartthisislocation{#1}\dostopthisislocation - \fi \fi} - -\def\thisisrealpage#1% pagenumber - {\iflocation - \dostartthisisrealpage{#1}\dostopthisisrealpage - \fi} - -%D The previous tho macros were easy ones, opposite to their -%D counterparts. A common component in these is: -%D -%D \starttyping -%D \dohandlegoto{..}{..}{..} -%D \stoptyping -%D -%D Here data can be whatever needs highlighting, e.g. {\em -%D figure 2.4}, and the start and stop entries handle the -%D specials. The two \DIMENSIONS\ \type{\buttonwidth} and -%D \type{\buttonheight} have to be set when handling the -%D data~(\type{#2}). - \ifx\buttonheight\undefined \newdimen\buttonheight \fi \ifx\buttonwidth \undefined \newdimen\buttonwidth \fi -\def\gotodestination#1#2#3#4#5% url file destination page data - {\iflocation - \ifusepagedestinations - \gotorealpage{#1}{#2}{\number#4}{#5}% - \else - \dohandlegoto - {#5}% - {\the\everyreference\dostartgotolocation\buttonwidth\buttonheight{#1}{#2}{#3}{\number#4}}% - {\dostopgotolocation}% - \fi - \else - {#5}% - \fi} - -\def\gotorealpage#1#2#3#4% url file page data - {\iflocation - \dohandlegoto - {#4}% - {\dostartgotorealpage\buttonwidth\buttonheight{#1}{#2}{\number#3}}% - {\dostopgotorealpage}% - \else - {#4}% - \fi} - -\def\gotoinnerpage#1#2% page data - {\iflocation - \dohandlegoto - {#2}% - {\dostartgotorealpage\buttonwidth\buttonheight\empty\empty{\number#1}}% - {\dostopgotorealpage}% - \else - {#2}% - \fi} - -\def\gotoouterfilepage#1#2#3% file page data - {\iflocation - \dohandlegoto - {#3}% - {\dostartgotorealpage\buttonwidth\buttonheight\empty{#1}{\number#2}}% - {\dostopgotorealpage}% - \else - {#3}% - \fi} - -%D \macros -%D {setreferencefilename} -%D -%D This command can be used in the special drivers to -%D uppercase filenames. This is needed when one wants to -%D produce \CDROM's conforming to ISO9660. We consider is the -%D savest to enable this feature by default. We cannot handle -%D uppercase here, since the suffix is handled in the special -%D driver. Conversion is taken care of by: -%D -%D \starttyping -%D \setreferencefilename somefilename\to\SomeFileName -%D \stoptyping - -\chardef\referencefilecase=0 - - \def\setreferencefilename#1\to#2% - {\ifcase\referencefilecase - \edef#2{#1}% - \or - \uppercasestring#1\to#2% - \or - \lowercasestring#1\to#2% - \else - \edef#2{#1}% - \fi} - %D Internal references can best be set using the next few %D macros. Setting such references to unique values is %D completely up to the macros that call them. @@ -627,30 +493,9 @@ %D \gotosomeinternal {tag}{identifier}{pagenumber}{text} %D \stoptyping -\def\thisissomeinternal#1#2% tag reference - {\doifsomething{#2}{\thisisdestination{#1:#2}}} - -\def\gotosomeinternal#1#2% #3#4 - {\gotodestination\empty\empty{#1:#2}} - -%D An automatic mechanism is provided too: -%D -%D \starttyping -%D \thisisnextinternal{tag} -%D \gotonextinternal {tag}{number}{pagenumber}{text} -%D \stoptyping -%D -%D The first macro increments a counter. The value of this -%D counter is available in the macro \type{\nextinternalreference} -%D and should be saved somewhere (for instance in a file) for -%D future reference. The second argument of -%D \type {\gotonextinternal} takes such a saved number. One can -%D turn on tracing these references, in which case the -%D references are a bit more verbose. - +\newif \iflocation \newcount\locationcount - -\newif\ifinternalnamedreferences \internalnamedreferencestrue +\newbox \locationbox \def\nextinternalreference {\the\locationcount} @@ -658,120 +503,18 @@ \def\setnextinternalreference {\global\advance\locationcount\plusone} -\def\thisisnextinternal#1% #1 will be removed when we are done with mkiv - {\ifinternalnamedreferences - \thisisdestination{\s!aut:\nextinternalreference}% - \fi} - -\def\insertnextinternal#1% - {\ifinternalnamedreferences - \thisisdestination{\s!aut:\number#1}% - \fi} +\def\thisissomeinternal#1#2% tag reference (only for old time sake) + {\begingroup\dosetattribute{destination}{\ctxlua{jobreferences.mark("#1:#2")}}\hbox{}\endgroup} -\def\gotonextinternal#1#2#3#4% #1 will be removed when we are done with mkiv +\def\gotosomeinternal#1#2#3#4% {\ifinternalnamedreferences - \gotodestination\empty\empty{\s!aut:#2}{#3}{#4}% + \directgoto{#4}[#1:#2]% \else - \gotorealpage\empty\empty{#3}{#4}% + \directgoto{#4}[page(#3)]% \fi} -%D We already went through a lot of problems to sort out what -%D kind of reference we're dealing with. Sorting out the user -%D supplied cross references (show/goto this or that) as well -%D as user supplied system references (invoke this or that) is -%D already taken care of in the test routine, but we still have -%D to direct the request to the right (first) routine. - -\def\gotolocation#1#2{\doprocessreferenceelse{#1}{#2}{\unknownreference{#1}}} % obsolete - -%D An inner reference refers to some place in the document -%D itself. - - \def\gotoinnerlocation#1% #2% - {\gotodestination\empty\empty{\referenceprefix\currentinnerreference}\currentrealreference} % {#2} - -\def\gotoinner#1#2#3% prefix inner page data - {\gotodestination\empty\empty{#1#2}{#3}} % {#4} - -%D The outer location refers to another document, specified as -%D file or \URL. - - \def\gotoouterlocation#1#2% % page checken! - {\bgroup - \let\referenceprefix\empty - \setouterlocation\currentouterreference - \ifx\currentinnerreference\empty - \gotorealpage\otherURL\otherfile1{#2}% - \else - \gotodestination\otherURL\otherfile\currentinnerreference\currentrealreference{#2}% - \fi - \egroup} - -\def\gotoouterfile#1#2% file location page data #3 #4 - {\doifelsenothing{#2}{\gotorealpage\empty{#1}}{\gotodestination\empty{#1}{#2}}} - -\def\gotoouterfilepage#1% file page data - {\gotorealpage\empty{#1}\empty} - -\def\gotoouterfilelocation% file location page data - {\gotodestination\empty} - -\def\gotoouterurl#1#2% url args data #2 - {\gotodestination{#1}\empty{#2}1} - -%D Special locations are those that are accessed by saying -%D things like: -%D -%D \starttyping -%D \goto{calculate total}[JS(summarize{10,23,56}] -%D \stoptyping -%D -%D After several intermediate steps this finally arrives at -%D the next macro and expands into (simplified): -%D -%D \starttyping -%D \gotoJSlocation{total{summarize{10,23,56}}}{calculate total} -%D \stoptyping -%D -%D The first argument is the full reference, the second one -%D is the text, in some kind of manipulated form. In practice -%D we split references, so we get: -%D -%D \starttyping -%D \gotoJSlocation{summarize{10,23,56}}{calculate} -%D \gotoJSlocation{summarize{10,23,56}}{total} -%D \stoptyping -%D -%D where \type{calculate} and \type{total} are colored, boxed -%D or whatever \type{\goto} is told to do. -%D -%D The macro \type{\gotoJSlocation} can use \type -%D {\currentreferenceoperation} (in our example -%D \type{summarize}) and \type{\currentreference} (here -%D being \type {10,23,56}) to perform its task. - - \def\gotospeciallocation - {\executeifdefined{goto\currentreferencespecial location}\gobbleoneargument} - -%D Such special macros can be defined by: - - \def\definespeciallocation#1% - {\setvalue{goto#1location}} - -%D The associated test is to be defined by: - -\def\definespecialtest#1% - {\setvalue{\s!do:\v!test:#1}} - -%D This \type{\def} alike macro is to be used as: -%D -%D \starttyping -%D \definespeciallocation{JS}#1#2{... #1 ... #2 ...} -%D \stoptyping -%D -%D In module \type {java-ini} one can see that \type -%D {\gotoJSlocation} looks much like the previous goto -%D definitions. +\def\gotonextinternal#1#2% + {\directgoto{#1}[internal(#2)]} %D In this module we define three system references: one for %D handling navigational, viewer specific, commands, another @@ -796,40 +539,6 @@ \def\setglobalsystemreference#1#2#3{\definereference[#2][\v!action(#3)]} -% action actions - -\def\gotoactionspecial#1#2#3#4% special operation arguments data - {\begingroup - \iflocation - \dohandlegoto - {#4}% - {\dostartexecutecommand\buttonwidth\buttonheight{#2}{#3}}% - {\dostopexecutecommand}% - \else - #4% - \fi - \endgroup} - -\def\gotopagespecial#1#2#3#4% page(n) page(+n) page(-n) page(file::1) - {\begingroup - \iflocation - \doifnonzeropositiveelse{#2} - {\doifinstringelse+{#2} - {\edef\currenttargetpage{\the\numexpr\realpageno#2}} - {\doifinstringelse-{#2} - {\edef\currenttargetpage{\the\numexpr\realpageno#2}} - {\edef\currenttargetpage{#2}}}}% - {\edef\currenttargetpage{1}}% - \docheckrealreferencepage\currenttargetpage % new - \gotorealpage\empty\empty\currenttargetpage{#4}% - \else - #4% - \fi - \endgroup} - -%D It is possible to disable the writing of references to the -%D utility file by setting: - \newif\ifreferencing \referencingtrue %D One can also activate an automatic prefix mechanism. By @@ -902,33 +611,6 @@ \edef\referenceprefix{\@@rfprefix:}% \fi\fi\fi\fi} -%D \macros -%D {handlereferenceactions, -%D collectreferenceactions} -%D -%D Sometimes we need to pass the actions connected to -%D references to variables instead of rectangular areas on -%D which one can click. The next macro collects the actions -%D and passes them to a handle. This is a rather dreadfull -%D hack! -%D -%D \starttyping -%D \handlereferenceactions{references}\handle -%D \stoptyping -%D -%D So, \type {\handle} does the final job, which in for -%D instance the \PDF\ drivers comes down to doing something -%D with \type {\lastPDFaction}. - -\newif\ifcollectreferenceactions - -\def\handlereferenceactions#1#2% - {\doifsomething{#1} - {\bgroup - \collectreferenceactionstrue - \doprocessreferenceelse{#1}{#2}{\unknownreference{#1}}% - \egroup}} - %D The most straightforward way of retrieving references is %D using \type{\ref}. Consider the reference: %D @@ -957,20 +639,23 @@ %D \startlines %D \getbuffer %D \stoplines +%D +%D This is a cheap compatibility hack. Don't use this command +%D as there will be more advanced access to user data. \def\ref{\dodoubleargument\doref} -\def\reftypep{\currentpagereference} -\def\reftypet{\currenttextreference} -\def\reftyper{\currentrealreference} -\def\reftypes{\currentsubtextreference} -\def\reftypee{\currentsubsubtextreference} +\def\reftypep{\currentreferencepage} +\def\reftypet{\currentreferencetext} +\def\reftyper{\currentreferencepage} +\def\reftypes{\currentreferencetext} +\def\reftypee{\currentreferencetext} \def\doref[#1][#2]% {\ifsecondargument -% \doifreferencefoundelse{#2} -% {\executeifdefined{reftype#1}\reftypep} -% {\unknownreference{#2}\dummyreference}% + \doifreferencefoundelse{#2} + {\executeifdefined{reftype#1}\reftypep} + {\unknownreference{#2}\dummyreference}% \else \dummyreference \fi} @@ -1025,9 +710,10 @@ \definecommand from {\dospecialfrom} \definecommand over {\dospecialabout} % needed here, else math problems -\def\currentreferencenumber{\ctxlua{jobreferences.filter("number")}} -\def\currentreferencepage {\ctxlua{jobreferences.filter("page")}} -\def\currentreferencetitle {\ctxlua{jobreferences.filter("title")}} +\def\currentreferencenumber {\ctxlua{jobreferences.filter("number")}} +\def\currentreferencepage {\ctxlua{jobreferences.filter("page")}} +\def\currentreferencetitle {\ctxlua{jobreferences.filter("title")}} +\def\currentreferencerealpage{\ctxlua{jobreferences.realpage()}} % there will eb a few more \unexpanded\def\dospecialin{\doinatreference\currentreferencenumber} \unexpanded\def\dospecialat{\doinatreference\currentreferencepage} @@ -1039,18 +725,14 @@ {\def\dododoinatreference{\dodododoinatreference{#1}}% \futurelet\next\dododoinatreference} -\unexpanded\def\dospecialabout[#1]% +\unexpanded\def\dospecialabout[#1]% hm, does this work? {\dontleavehmode \bgroup + \let\crlf\space + \let\\\space \@@rfleft - \doprocessreferenceelse{#1} - {\let\crlf\space - \let\\\space - \let\dogotofixed\dogotospace - \dogotospace{\limitatetext\currentreferencetitle\@@rfwidth\unknown}[#1]} - {\unknownreference{#1}\dummyreference}% + \goto{\limitatetext\currentreferencetitle\@@rfwidth\unknown}[#1]% \@@rfright - \referenceinfo{<}{#1}% \egroup} %D We arrived at the last step. Before we do the typesetting, @@ -1065,31 +747,44 @@ %D $^\gobackwardcharacter$ $^\gonowherecharacter$}, depending %D on the direction to go. - \def\dosymbolreference#1#2[#3]% todo - {\bgroup - \setupsymbolset[\@@iasymbolset]% - \removelastskip - \ifx\currentreferencespecial\empty - \ifx\currentouterreference\empty - \ifnum0\currentrealreference=\zerocount - \ifhmode\strut\high{\symbol[\v!nowhere]}\fi - \else\ifnum0\currentrealreference>\realpageno - \dodosymbolreference{#2}{\high{\symbol[\v!next]}}% - \else\ifnum0\currentrealreference<\realpageno - \dodosymbolreference{#2}{\high{\symbol[\v!previous]}}% - \else - \ifhmode\strut\high{\symbol[\v!nowhere]}\fi - \fi\fi\fi - \else - \gotoouterlocation{#3}{\showlocation{\high{\symbol[\v!somewhere]}}}% - \fi - \else - \gotospeciallocation{#3}{\showlocation{\high{\symbol[\v!somewhere]}}}% - \fi - \egroup} - - \def\dodosymbolreference#1#2% todo - {#1\hbox{\gotorealpage\empty\empty\currentrealreference{\dolocationattributes\??ia\c!style\c!color{#2}}}} +% 1 = whatever +% 2 = forward, following page +% 3 = backward, preceding page +% 4 = forward, same page +% 5 = backward, same page + +% Yet untested: + +\unexpanded\def\somewhere#1#2#3[#4]% #3 gobbles space around #2 % todo + {\goto{\ifcase\referencepagestate#1/#2\or#2\or#1\or#2\fi}[#4]} + +\unexpanded\def\atpage[#1]% todo + {\goto{\ifcase\referencepagestate + \labeltexts\v!page\dummyreference + \or + \labeltexts\v!atpage\currentreferencepage + \or + \labeltexts\v!atpage\currentreferencepage + \or + \labeltexts\v!atpage\currentreferencepage + \or + \labeltext\v!hereafter + \or + \labeltext\v!hencefore + \fi}[#1]} + +\def\dosymbolreference#1#2[#3]% + {\removeunwantedspaces + \goto{\setupsymbolset[\@@iasymbolset]\high{\symbol + [\ifcase\referencepagestate + \v!somewhere + \or % same + \v!nowhere + \or % before + \v!previous + \or % after + \v!next% + \fi]}}[#3]} %D The other alternatives just conform their names: only the %D label, only the text, or the label and the text. @@ -1098,19 +793,18 @@ {\unknownreference{#3}\dotextprefix{#2}\dummyreference}% \def\docompletereference#1#2[#3]% - {\iflocationsplit - \doifsomespaceelse{#2}\dogotospace\dogotofixed{\dotextprefix{#2}#1}[#3]% - \else - \dogotofixed{\dotextprefix{#2}#1}[#3]% - \fi} + {\goto{\dotextprefix{#2}#1}[#3]} + +% \def\dolabelonlyreference#1#2[#3]% +% {\doifsomespaceelse{#2}% space? +% {\doifsomething{#2}{\goto{#2}[#3]}} +% {\goto{\dotextprefix{#2}}[#3]}} \def\dolabelonlyreference#1#2[#3]% - {\doifsomespaceelse{#2} - {\doifsomething{#2}{\dogotospace{#2}[#3]}} - {\dogotofixed{\dotextprefix{#2}}[#3]}} + {\goto{\dotextprefix{#2}}[#3]} \def\dotextonlyreference#1#2[#3]% - {\dotextprefix{#2}\dogotofixed{#1}[#3]} + {\dotextprefix{#2}\goto{#1}[#3]} \let\dowantedreference\docompletereference @@ -1158,8 +852,7 @@ \fi} \def\noexecutelabelreferenceformat#1% - {\doifvaluesomething{\??rf#1\c!text} - {\gdef\textofreference{\csname\??rf#1\c!text\endcsname}}% + {\doifvaluesomething{\??rf#1\c!text}{\gdef\textofreference{\csname\??rf#1\c!text\endcsname}}% \csname\??rf#1\c!command\endcsname} \def\doexecutelabelreferenceformat#1% @@ -1171,8 +864,7 @@ {\gdef\leftofreference {\csname\??rf#1\c!left \endcsname}% \gdef\rightofreference{\csname\??rf#1\c!right\endcsname}% \global\let\textofreference\empty % otherwise ~ added - \doifelsevaluenothing{\??rf#1\c!label} - \noexecutelabelreferenceformat\doexecutelabelreferenceformat{#1}} + \doifelsevaluenothing{\??rf#1\c!label}\noexecutelabelreferenceformat\doexecutelabelreferenceformat{#1}} \let\leftofreference \relax \let\rightofreference\relax @@ -1192,12 +884,10 @@ \def\dododododoinatreference#1#2[#3]% {\dontleavehmode % replaces \leaveoutervmode \begingroup - \forgetall \postponenotes \doifreferencefoundelse{#3} {\doifelsenothing{#1}\dosymbolreference\dowantedreference{#1}{#2}[#3]}% {\dounknownreference{#1}{#2}[#3]}% - \referenceinfo<{#3}% \endgroup} %D In interactive documents going to a specific location is not @@ -1211,85 +901,127 @@ %D %D \showsetup{goto} %D -%D One important chaacteristic is that the first argument of +%D One important characteristic is that the first argument of %D \type{\goto} (and therefore \type{\at} and \type{\in} is %D split at spaces. This means that, although hyphenation is %D prevented, long references can cross line endings. -\newif\ifsharesimilarreferences \sharesimilarreferencestrue -\newcount\similarreference % 0=noppes 1=create/refer 2,3,..=refer +\newconditional\uselocationstrut \settrue\uselocationstrut -\unexpanded\def\goto#1#2% - {\dogoto{#1}#2} +\def\extrareferencearguments{\luaconditional\highlighthyperlinks,\luaconditional\gotonewwindow,"\currentviewerlayer"} + +\unexpanded\def\directgoto {\ifconditional\uselocationstrut\expandafter\dodirectgoto\else\expandafter\directgotohtdp\fi} +\unexpanded\def\goto {\ifconditional\uselocationstrut\expandafter\dogoto \else\expandafter\gotohtdp \fi} + +\def\dodirectgoto#1[#2]% no test for valid references + {\dontleavehmode + \begingroup + \attribute\referenceattribute\attributeunsetvalue + \iflocation + \ctxlua{jobreferences.inject("\referenceprefix","#2",\number\ht\strutbox,\number\dp\strutbox,\extrareferencearguments)}% + \setlocationattributes\??ia + \setstrut % can be option + \attribute\referenceattribute\lastreferenceattribute + \fi + #1% + \endgroup} + +\def\dodirectgotohtdp#1[#2]% no test for valid references + {\dontleavehmode + \begingroup + \attribute\referenceattribute\attributeunsetvalue + \iflocation + \ctxlua{jobreferences.inject("\referenceprefix","#2",\number\dimexpr\@@iaheight\relax,\number\dimexpr\@@iadepth\relax,\extrareferencearguments)}% + \setlocationattributes\??ia + \attribute\referenceattribute\lastreferenceattribute + \fi + #1% + \endgroup} \def\dogoto#1[#2]% {\dontleavehmode - \bgroup - \postponenotes - % todo: handle empty #1 - \doifelsenothing{#1}{\dosymbolreference{}{}}{\dogotospace{#1}}[#2]% - \egroup - \referenceinfo{<}{#2}} - -% inefficient, we need to save the shared one (just reuse last command in lua) - -\def\dogotoprocessisolatedword#1#2% - {\ifisolatedwords\ifsharesimilarreferences - \global\advance\similarreference \plusone - \fi\fi - \hbox\bgroup - \doprocessreferenceelse{#1}{#2\presetgoto}{\unknownreference{#1}#2\relax}% - \egroup}% - -\def\dogotospace#1[#2]% - {\iflocationsplit - \ifsecondaryreference\setbox\scratchbox\hbox\fi % due to space insertion - \bgroup - \let\dogotospace\dogotofixed - \iflocation - \dosetfontattribute \??ia\c!style - \dosetcolorattribute\??ia\c!color - \processisolatedwords{#1}{\dogotoprocessisolatedword{#2}}% - \else - #1\relax % \relax prevents #1's next macros from gobbling \fi - \fi - \egroup + \begingroup + \attribute\referenceattribute\attributeunsetvalue + \iflocation + \ctxlua{jobreferences.doifelse("\referenceprefix","#2",\extrareferencearguments)}% + {\expandtexincurrentreference + \ctxlua{jobreferences.injectcurrentset(\number\ht\strutbox,\number\dp\strutbox)}% + \setlocationattributes\??ia + \setstrut % can be option + \attribute\referenceattribute\lastreferenceattribute}% + {\unknownreference{#2}}% + \fi + #1% + \endgroup} + +\def\dogotohtdp#1[#2]% + {\dontleavehmode + \begingroup + \attribute\referenceattribute\attributeunsetvalue + \iflocation + \ctxlua{jobreferences.doifelse("\referenceprefix","#2",\extrareferencearguments)}% + {\expandtexincurrentreference + \ctxlua{jobreferences.injectcurrentset(\number\dimexpr\@@iaheight\relax,\number\dimexpr\@@iadepth\relax)}% + \setlocationattributes\??ia + \attribute\referenceattribute\lastreferenceattribute}% + {\unknownreference{#2}}% + \fi + #1% + \endgroup} + +\unexpanded\def\directgotobox#1[#2]% no test for valid references + {\dontleavehmode + \begingroup + \attribute\referenceattribute\attributeunsetvalue + \iflocation + \ctxlua{jobreferences.inject("\referenceprefix","#2",nil,nil,\extrareferencearguments)}% + \setlocationattributes\??ia + \hbox attr \referenceattribute \lastreferenceattribute {#1}% \else - \iflocation - \hbox\bgroup - \dosetfontattribute \??ia\c!style - \dosetcolorattribute\??ia\c!color - \doprocessreferenceelse{#2}{#1\presetgoto}{\unknownreference{#2}#1\relax}% - \egroup% - \else - #1\relax % \relax prevents #1's next macros from gobbling \fi - \fi + #1% \fi - \global\similarreference\zerocount} - -\def\dogotofixed#1[#2]% - {{\iflocation - \hbox\bgroup - \dosetfontattribute \??ia\c!style - \dosetcolorattribute\??ia\c!color - \doprocessreferenceelse{#2}{#1\presetgoto}{\unknownreference{#2}#1\relax}% - \egroup - \else - #1% - \fi}} - -%D In case the auto split feature is not needed or even not -%D even wanted, \type{\gotobox} can be used. - -\unexpanded\def\gotobox#1[#2]% + \endgroup} + +\unexpanded\def\directgotospecbox#1#2[#3]% no test for valid references {\dontleavehmode - \bgroup - \locationstrutfalse - \doprocessreferenceelse{#2} - {\dogotofixed{#1}[#2]} - {\hbox{\unknownreference{#2}#1}}% - \referenceinfo{<}{#2}% - \egroup} + \begingroup + \attribute\referenceattribute\attributeunsetvalue + \iflocation + \ctxlua{jobreferences.inject("\referenceprefix","#3",nil,nil,\extrareferencearguments)}% + \setlocationcolorspec{#1}% no consequence for strut + \hbox attr \referenceattribute \lastreferenceattribute {#2}% + \else + #2% + \fi + \endgroup} + +\unexpanded\def\directgotodumbbox#1[#2]% no test for valid references + {\dontleavehmode + \begingroup + \attribute\referenceattribute\attributeunsetvalue + \iflocation + \ctxlua{jobreferences.inject("\referenceprefix","#2",nil,nil,\extrareferencearguments)}% + \hbox attr \referenceattribute \lastreferenceattribute {#1}% + \else + #1% + \fi + \endgroup} + +\unexpanded\def\gotobox#1[#2]% no test for valid references + {\dontleavehmode + \begingroup + \attribute\referenceattribute\attributeunsetvalue + \iflocation + \ctxlua{jobreferences.doifelse("\referenceprefix","#2",\extrareferencearguments)}% + {\expandtexincurrentreference + \ctxlua{jobreferences.injectcurrentset(nil,nil)}% + \setlocationattributes\??ia + \hbox attr \referenceattribute \lastreferenceattribute {#1}}% + {\unknownreference{#2}}% + \else + #1% + \fi + \endgroup} %D An reference to another document can be specified as a file %D or as an \URL. Both are handled by the same mechanism and @@ -1352,9 +1084,6 @@ \def\dousefile[#1][#2][#3]% {\ctxlua{jobreferences.files.define("#1",\!!bs\detokenize{#2}\!!es,\!!bs\detokenize{#3}\!!es)}} -% \doifsomething\@@urstyle{\let\@@iastyle\@@urstyle\let\@@urstyle\empty}% -% \doifsomething\@@urcolor{\let\@@iacolor\@@urcolor\let\@@urcolor\empty}% - %D \macros %D {url,setupurl} %D @@ -1439,12 +1168,6 @@ %D \goto{some text}[identifier::location] %D \stoptyping -\def\gotofilespecial#1#2#3#4% special operation arguments data - {\begingroup\iflocation\gotoouterfile{#2}{#3}{#4}\else#4\fi\endgroup} - -\def\gotourlspecial#1#2#3#4% special operation arguments data - {\begingroup\iflocation\gotoouterurl{#2}{#3}{#4}\else#4\fi\endgroup} - %D A special case of references are those to programs. These, %D very system dependant references are implemented by abusing %D some of the previous macros. @@ -1475,20 +1198,6 @@ \ctxlua{jobreferences.programs.get("#1","\@@pralternative","\@@prspace")}% \endgroup} -% needs an update: program(abc{arg}) - -\def\gotoprogramspecial#1#2#3#4% special operation arguments data - {\begingroup - \iflocation - \dohandlegoto - {#4}% - {\dostartrunprogram\buttonwidth\buttonheight{\@@prdirectory#2}{#3}}% - {\dostoprunprogram}% - \else - #4% - \fi - \endgroup} - %D As we can see, we directly use the special reference %D mechanism, which means that %D @@ -1544,40 +1253,12 @@ %D %D In future versions there will be more sophisticated -%D support, also suitable for references to floating bodies. - -\def\analysedreference#1% - {\ctxlua{jobreferences.analysis("\referenceprefix","#1")}} - -\unexpanded\def\somewhere#1#2#3[#4]% #3 gobbles space around #2 % todo - {\dontleavehmode - \ifcase\analysedreference{#4}\relax - \unknownreference{#4}#1/#2% - \or - \doifelsenothing{#2}{\dosymbolreference{}{}[#4]}{\dogotospace{#2}[#4]}% - \or % forward - \doifelsenothing{#1}{\dosymbolreference{}{}[#4]}{\dogotospace{#1}[#4]}% - \or % backward - \doifelsenothing{#2}{\dosymbolreference{}{}[#4]}{\dogotospace{#2}[#4]}% - \fi - \referenceinfo{<}{#4}} - -\unexpanded\def\atpage[#1]% todo - {\dontleavehmode -% \docheckrealreferencepage{}% -% \doifreferencefoundelse{#1} -% {\ifrealreferencepage -% \ifforwardreference -% \dogotofixed{\labeltext\v!hencefore}[#1]% -% \else -% \dogotofixed{\labeltext\v!hereafter}[#1]% -% \fi -% \else -% \dogotofixed{\labeltexts\v!atpage\currentpagereference}[#1]% -% \fi} -% {\unknownreference{#1}% -% \labeltexts\v!page\dummyreference}% - \referenceinfo{<}{#1}} +% 0 = no page reference +% 1 = same page +% 2 = preceding page +% 3 = following page +% 4 = backward, same page (todo) +% 5 = forward, same page (todo) %D We can cross link documents by using: %D @@ -1653,7 +1334,6 @@ {\begingroup \doifvalue{#1\c!state}\v!stop\locationfalse \iflocation - \resetgoto \ConvertConstantAfter\doifelse{#3}\v!none\hphantom\hbox {\doifelsenothing{#4} {\setlocationboxnop#1[#2]{#3}[#4]} @@ -1664,6 +1344,9 @@ \fi \endgroup} +\setupbuttons + [\c!state=\v!start] + %D Interaction buttons, in fact a row of tiny buttons, are %D typically only used for navigational purposed. The next %D macro builds such a row based on a specification list. @@ -1722,7 +1405,7 @@ \divide\!!widtha \!!counta \!!widthb\@@ibwidth \fi - \def\goto##1% clash ? + \def\xgoto##1% clash ? {\setnostrut \edef\localreference{##1}% \normalexpanded{\noexpand\dodocomplexbutton\??ib[\c!height=\the\!!heighta,\c!width=\the\!!widtha]}% @@ -1732,15 +1415,15 @@ \hbox to \!!widthb {\processallactionsinset [#2] - [ \v!page=>\goto\v!firstpage - \goto\v!nextpage - \goto\v!previouspage - \goto\v!lastpage, - \v!subpage=>\goto\v!firstsubpage - \goto\v!nextsubpage - \goto\v!previoussubpage - \goto\v!lastsubpage, - \s!unknown=>\goto\commalistelement]% + [ \v!page=>\xgoto\v!firstpage + \xgoto\v!nextpage + \xgoto\v!previouspage + \xgoto\v!lastpage, + \v!subpage=>\xgoto\v!firstsubpage + \xgoto\v!nextsubpage + \xgoto\v!previoussubpage + \xgoto\v!lastsubpage, + \s!unknown=>\xgoto\commalistelement]% \unskip}% \else \interactionbuttons[][#1]% @@ -1777,17 +1460,14 @@ \def\complexoverlaybutton[#1]% {\iflocation - \doprocessreferenceelse{#1} - {\overlayfakebox {#1}} - {\unknownreference{#1}}% + \gotobox{\overlayfakebox}[#1]% \fi} -\def\overlayfakebox#1% +\def\overlayfakebox {\hbox {\setbox\scratchbox\null \wd\scratchbox\overlaywidth \ht\scratchbox\overlayheight - \locationstrutfalse \box\scratchbox}} %D \macros @@ -1804,11 +1484,10 @@ \def\dotextprefix#1% {\begingroup - \global\labeltextdonefalse % this is an ugly dependancy, \setbox\scratchbox\hbox{#1}% to be solved some day \ifdim\wd\scratchbox>\zeropoint \unhbox\scratchbox - \iflabeltextdone\else\@@rfseparator\fi + \@@rfseparator \else \unhbox\scratchbox \fi @@ -1890,22 +1569,27 @@ \definereference [\v!ShowThumbs ] [action(thumbnails)] \definereference [\v!ShowBookmarks ] [action(bookmarks)] -\definereference [\v!firstpage] [page(\firstpage)] -\definereference [\v!previouspage] [page(\prevpage)] -\definereference [\v!nextpage] [page(\nextpage)] -\definereference [\v!lastpage] [page(\lastpage)] -\definereference [\v!firstsubpage] [page(\firstsubpage)] -\definereference [\v!previoussubpage] [page(\prevsubpage)] -\definereference [\v!nextsubpage] [page(\nextsubpage)] -\definereference [\v!lastsubpage] [page(\lastsubpage)] -\definereference [\v!first] [page(\firstpage)] -\definereference [\v!previous] [page(\prevpage)] -\definereference [\v!next] [page(\nextpage)] -\definereference [\v!last] [page(\lastpage)] -\definereference [\v!first\v!sub] [page(\firstsubpage)] -\definereference [\v!previous\v!sub] [page(\prevsubpage)] -\definereference [\v!next\v!sub] [page(\nextsubpage)] -\definereference [\v!last\v!sub] [page(\lastsubpage)] +\definereference [\v!firstpage] [page(firstpage)] +\definereference [\v!previouspage] [page(previouspage)] +\definereference [\v!nextpage] [page(nextpage)] +\definereference [\v!lastpage] [page(lastpage)] +\definereference [\v!forward] [page(forward)] +\definereference [\v!backward] [page(backward)] +\definereference [\v!firstsubpage] [page(firstsubpage)] +\definereference [\v!previoussubpage] [page(previoussubpage)] +\definereference [\v!nextsubpage] [page(nextsubpage)] +\definereference [\v!lastsubpage] [page(lastsubpage)] + +% we can do this but only when later in resolve (else problems with \chapter[first]{...} +% +% \definereference [\v!first] [page(firstpage)] +% \definereference [\v!previous] [page(prevpage)] +% \definereference [\v!next] [page(nextpage)] +% \definereference [\v!last] [page(lastpage)] +% \definereference [\v!first\v!sub] [page(firstsubpage)] +% \definereference [\v!previous\v!sub] [page(prevsubpage)] +% \definereference [\v!next\v!sub] [page(nextsubpage)] +% \definereference [\v!last\v!sub] [page(lastsubpage)] %D We cannot set up buttons (not yet, this one calls a menu macro): diff --git a/tex/context/base/strc-reg.lua b/tex/context/base/strc-reg.lua index 74dbf90e2..b406ea1b0 100644 --- a/tex/context/base/strc-reg.lua +++ b/tex/context/base/strc-reg.lua @@ -6,7 +6,10 @@ if not modules then modules = { } end modules ['strc-reg'] = { license = "see context related readme files" } -local texwrite, texsprint, count, format, gmatch = tex.write, tex.sprint, tex.count, string.format, string.gmatch +local next, type = next, type +local texwrite, texsprint, texcount = tex.write, tex.sprint, tex.count +local format, gmatch = string.format, string.gmatch +local utfchar = utf.char local ctxcatcodes = tex.ctxcatcodes @@ -118,12 +121,16 @@ local function filter_collected(names,criterium,number,collected,prevmode) local number = tonumber(number) or 0 for i=1,#collected do local v = collected[i] - local sectionnumber = jobsections.collected[v.references.section] - if sectionnumber then - local cnumbers = sectionnumber.numbers - if (all or hash[v.metadata.name]) and #cnumbers >= depth then -- was > - if cnumbers[depth] == number then - result[#result+1] = v + local r = v.references + if r then + local sectionnumber = jobsections.collected[r.section] + if sectionnumber then + local metadata = v.metadata + local cnumbers = sectionnumber.numbers + if cnumbers then + if (all or hash[metadata.name or false]) and #cnumbers >= depth and (number == 0 or cnumbers[depth] == number) then + result[#result+1] = v + end end end end @@ -146,6 +153,20 @@ local tobesaved, collected = jobregisters.tobesaved, jobregisters.collected local function initializer() tobesaved, collected = jobregisters.tobesaved, jobregisters.collected + local internals = jobreferences.internals + for name, list in next, collected do + local entries = list.entries + for e=1,#entries do + local entry = entries[e] + local r = entry.references + if r then + local internal = r and r.internal + if internal then + internals[internal] = entry + end + end + end + end end job.register('jobregisters.collected', jobregisters.tobesaved, initializer) @@ -170,34 +191,68 @@ jobregisters.define = allocate local entrysplitter = lpeg.Ct(lpeg.splitat('+')) -function jobregisters.store(rawdata) - local data = allocate(rawdata.metadata.name).entries +local tagged = { } + +local function preprocessentries(rawdata) local entries = rawdata.entries - local et = entrysplitter:match(entries[1]) -- alse & - local kt = entrysplitter:match(entries[2]) -- alse & - entries = { } - for k=1,#et do - entries[k] = { et[k] or "", kt[k] or "" } + if entries then + local et = entrysplitter:match(entries[1]) -- alse & + local kt = entrysplitter:match(entries[2]) -- alse & + entries = { } + for k=1,#et do + entries[k] = { et[k] or "", kt[k] or "" } + end + rawdata.list = entries + rawdata.entries = nil + else + rawdata.list = { "", "" } -- br end - rawdata.list = entries - rawdata.entries = nil +end + +function jobregisters.store(rawdata) -- metadata, references, entries + local data = allocate(rawdata.metadata.name).entries + local references = rawdata.references + references.realpage = references.realpage or 0 -- just to be sure as it can be refered to + preprocessentries(rawdata) data[#data+1] = rawdata + local label = references.label + if label and label ~= "" then tagged[label] = #data end texwrite(#data) end function jobregisters.enhance(name,n) local r = tobesaved[name].entries[n] if r then - r.references.realpage = tex.count[0] + r.references.realpage = texcount.realpageno end end -function jobregisters.extend(name,n,lastsection) - local r = tobesaved[name].entries[n] - if r then - r.references.lastrealpage = tex.count[0] - r.references.lastsection = lastsection - +function jobregisters.extend(name,tag,rawdata) -- maybe do lastsection internally + if type(tag) == "string" then + tag = tagged[tag] + end + if tag then + local r = tobesaved[name].entries[tag] + if r then + local rr = r.references + rr.lastrealpage = texcount.realpageno + rr.lastsection = structure.sections.currentid() + if rawdata then + preprocessentries(rawdata) + for k,v in pairs(rawdata) do + if not r[k] then + r[k] = v + else + local rk = r[k] + for kk,vv in pairs(v) do + if vv ~= "" then + rk[kk] = vv + end + end + end + end + end + end end end @@ -225,7 +280,10 @@ function jobregisters.compare(a,b) return -1 elseif a.metadata.kind == 'entry' then -- e/f/t local page_a, page_b = a.references.realpage, b.references.realpage - if page_a < page_b then + if not page_a or not page_b then +--~ print(table.serialize(a),table.serialize(b)) + return 0 + elseif page_a < page_b then return -1 elseif page_a > page_b then return 1 @@ -248,13 +306,15 @@ function jobregisters.prepare(data) for i=1, #result do local entry, split = result[i], { } local list = entry.list - for l=1,#list do - local ll = list[l] - local key, word = ll[1], ll[2] - if key == "" then - key = word + if list then + for l=1,#list do + local ll = list[l] + local word, key = ll[1], ll[2] + if not key or key == "" then + key = word + end + split[l] = splitter(strip(key)) end - split[l] = splitter(strip(key)) end entry.split = split end @@ -262,7 +322,7 @@ function jobregisters.prepare(data) end function jobregisters.sort(data,options) - sorters.sort(data.entries,jobregisters.compare) + sorters.sort(data.result,jobregisters.compare) end function jobregisters.unique(data,options) @@ -298,23 +358,13 @@ function jobregisters.finalize(data,options) data.metadata.nofsorted = #result local split = { } -- maps character to index (order) - local se = sorters.entries[options.language or sorters.defaultlanguage] or sorters.entries[sorters.defaultlanguage] for k=1,#result do local v = result[k] - local entry, tag = v.split[1][1], "" - if se and se[entry] then - if type(se[entry]) == "number" then - entry = se[entry] - end - tag = se[entry] - else - entry = 0 - tag = "unknown" - end - local s = split[entry] + local entry, tag = sorters.firstofsplit(v.split) + local s = split[tag] -- keeps track of change if not s then s = { tag = tag, data = { } } - split[entry] = s + split[tag] = s end s.data[#s.data+1] = v end @@ -324,6 +374,7 @@ end function jobregisters.analysed(class,options) local data = collected[class] if data and data.entries then + sorters.language = options.language or sorters.defaultlanguage jobregisters.filter(data,options) -- filter entries into results (criteria) jobregisters.prepare(data,options) -- adds split table parallel to list table jobregisters.sort(data,options) -- sorts results @@ -346,18 +397,21 @@ function jobregisters.flush(data,options,prefixspec,pagespec) local result = data.result -- todo ownnumber local function pagenumber(entry) - texsprint(ctxcatcodes,"\\registeronepage{") + local er = entry.references + texsprint(ctxcatcodes,format("\\registeronepage{%s}{%s}{",er.internal or 0,er.realpage or 0)) -- internal realpage content helpers.prefixpage(entry,prefixspec,pagespec) texsprint(ctxcatcodes,"}") end local function pagerange(f_entry,t_entry,is_last) - texsprint(ctxcatcodes,"\\registerpagerange{") + local er = f_entry.references + texsprint(ctxcatcodes,format("\\registerpagerange{%s}{%s}{",er.internal or 0,er.realpage or 0)) helpers.prefixpage(f_entry,prefixspec,pagespec) - texsprint(ctxcatcodes,"}{") + local er = t_entry.references + texsprint(ctxcatcodes,format("}{%s}{%s}{",er.internal or 0,er.realpage or 0)) if is_last then - helpers.prefixpage(t_entry,prefixspec,pagespec) + helpers.prefixlastpage(t_entry,prefixspec,pagespec) -- swaps page and realpage keys else - helpers.prefixlastpage(t_entry,prefixspec,pagespec) + helpers.prefixpage(t_entry,prefixspec,pagespec) end texsprint(ctxcatcodes,"}") end @@ -424,7 +478,7 @@ function jobregisters.flush(data,options,prefixspec,pagespec) first, last, prev = nil, nil, nil elseif not first then first, prev = next, next - elseif next.references.realpage - prev.references.realpage == 1 then + elseif next.references.realpage - prev.references.realpage == 1 then -- 1 ? last, prev = next, next else pages[#pages+1] = { first, last or first } @@ -449,7 +503,7 @@ function jobregisters.flush(data,options,prefixspec,pagespec) local first_last_pn = first_last .references.realpage local second_first_pn = second_first.references.realpage local second_last_pn = second_last .references.realpage - local first_last_last = first_last.references.lastrealpage + local first_last_last = first_last .references.lastrealpage local second_first_last = second_first.references.lastrealpage if first_last_last then first_last_pn = first_last_last @@ -550,7 +604,7 @@ function jobregisters.flush(data,options,prefixspec,pagespec) elseif kind == 'see' then -- maybe some day more words texsprint(ctxcatcodes,"\\startregisterseewords") - texsprint(ctxcatcodes,format("\\registeroneword{%s}",entry.seeword.text)) + texsprint(ctxcatcodes,format("\\registeroneword{0}{0}{%s}",entry.seeword.text)) -- todo: internal texsprint(ctxcatcodes,"\\stopregisterseewords") end end diff --git a/tex/context/base/strc-reg.mkiv b/tex/context/base/strc-reg.mkiv index b764525e1..2ec448d97 100644 --- a/tex/context/base/strc-reg.mkiv +++ b/tex/context/base/strc-reg.mkiv @@ -17,12 +17,25 @@ \unprotect +\def\c!keys {keys} +\def\c!entries{entries} + % todo: tag:: becomes rendering % todo: language, character, linked, location %D Helper: -\def\doflushatpar{\ifvmode\expandafter\dogotopar\else\expandafter\firstofoneargument\fi} +% \def\doflushatpar{\ifvmode\expandafter\dogotopar\else\expandafter\firstofoneargument\fi} + +\def\doflushatpar{\ifvmode\expandafter\flushatnextpar\else\expandafter\firstofoneargument\fi} + +% \starttext +% \placeregister[index] +% \chapter{a} \index{93} \index{456} \index{***} \index{*} \index{@} +% test \index{aa} test \startregister[index][x]{bb} test \page test \page test \page test \stopregister[index][x] +% test \index{aa} test \setregisterentry[index][label=x,entries=bb] test \page test \page test \page test \finishregisterentry[index][label=x] +% test \index{aa} test \setregisterentry[index][label=y] test \page test \page test \page test \finishregisterentry[index][label=y,entries=yy] +% \stoptext % In plaats van + kan een & worden gebruikt. Ook kan als % eerste karakter worden opgegeven wat de scheider is. @@ -40,7 +53,9 @@ \let\currentregister\empty -\def\registerparameter#1{\csname\??id\currentregister#1\endcsname} +% \def\registerparameter#1{\csname\??id\currentregister#1\endcsname} + +\def\detokenizedregisterparameter#1{\detokenize\expandafter\expandafter\expandafter{\csname\??id#1\endcsname}} % always root \def\registerparameter #1{\csname\doregisterparameter{\??id\currentregister}#1\endcsname} \def\registerparameterhash#1{\doregisterparameterhash {\??id\currentregister}#1} @@ -129,66 +144,72 @@ % tzt variant met n entries, parameters en userdata (altnum) -\def\doprocesspageregister#1#2#3#4#5% register tag key altnum entry +\def\doregisterstructurepageregister#1#2#3% register data userdata {\begingroup \edef\currentregister{#1}% - \edef\currentregistertag{#2}% + \getparameters[\??id][\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]% + \edef\currentregisterlabel {\registerparameter\c!label}% \edef\currentregisterexpansion{\registerparameter\c!expansion}% \edef\currentregisterownnumber{\registerparameter\c!ownnumber}% + \xdef\currentregisterkeys {\registerparameter\c!keys}% \ifx\currentregisterexpansion\s!xml \xmlstartraw - \xdef\currentregisterentries{\detokenize{#5}}% not ok yet + \xdef\currentregisterentries{\registerparameter\c!entries}% \xmlstopraw \globallet\currentregistercoding\s!xml \else \ifx\currentregisterexpansion\v!yes - \xdef\currentregisterentries{#5}% not ok yet + \xdef\currentregisterentries{\registerparameter\c!entries}% \else - \xdef\currentregisterentries{\detokenize{#5}}% not ok yet + \xdef\currentregisterentries{\detokenizedregisterparameter\c!entries}% \fi \globallet\currentregistercoding\s!tex \fi \setnextinternalreference - % we could consider storing register entries in list + % we could consider storing register entries in a list which we + % could then sort \xdef\currentregisternumber{\ctxlua{ jobregisters.store { metadata = { kind = "entry", name = "\currentregister", level = structure.sections.currentlevel(), + coding = "\currentregistercoding", catcodes = \the\catcodetable, - own = \ifx\currentregisterownnumber\v!yes "#4" \else nil \fi, % can be used instead of pagenumber + \ifx\currentregisterownnumber\v!yes + own = "\registerparameter\c!alternative", % can be used instead of pagenumber + \fi }, references = { internal = \nextinternalreference, - section = structure.sections.currentid(), + section = structure.sections.currentid(), % hm, why then not also lastsection the same way + label = "\currentregisterlabel", }, + \ifx\currentregisterentries\empty \else entries = { % we need a special one for xml, this is just a single one - \!!bs\currentregisterentries\!!es, \!!bs#3\!!es + \!!bs\currentregisterentries\!!es, \!!bs\currentregisterkeys\!!es }, + \fi + userdata = structure.helpers.touserdata(\!!bs\detokenize{#3}\!!es) } } }% - \xdef\currentregistersynchronize % make this a macro because shared - {\noexpand\ctxlua{jobreferences.setinternalreference(nil,nil,\nextinternalreference)}% - \ifx\currentregisterownnumber\v!yes \else - \noexpand\ctxlatelua{jobregisters.enhance("\currentregister",\currentregisternumber)}% - \fi}% - \ifx\currentregistertag\empty \else - \setxvalue{\??id#1->#2}{\noexpand\dofinishpageregister{\currentregister}{\currentregisternumber}}% + \ctxlua{jobreferences.setinternalreference(nil,nil,\nextinternalreference)}% + \ifx\currentregisterownnumber\v!yes + \glet\currentregistersynchronize\relax + \else + \xdef\currentregistersynchronize{\ctxlatelua{jobregisters.enhance("\currentregister",\currentregisternumber)}}% \fi \currentregistersynchronize % here? + \attribute\destinationattribute\lastdestinationattribute \strut % todo \endgroup} -\def\dofinishpageregister#1#2% - {\ctxlatelua{jobregisters.extend("#1",#2,\ctxlua{tex.write(structure.currentsectionnumber())}}} - \def\doregister[#1][#2]% {\def\currentregister{#1}% \doifelse{\registerparameter\c!ownnumber}\v!yes\dodoregister\donoregister{#1}{#2}} -\def\donoregister #1#2{\doflushatpar{\doprocesspageregister{#1}{}{}{#2}}} % register key - entry -\def\dodoregister#1#2#3{\doflushatpar{\doprocesspageregister{#1}{}{#2}{#3}}} % register key altnum entry +\def\donoregister #1#2#3{\doflushatpar{\doregisterstructurepageregister{#1}{\c!keys={#2},\c!entries={#3}}{}}} +\def\dodoregister#1#2#3#4{\doflushatpar{\doregisterstructurepageregister{#1}{\c!keys={#2},\c!alternative=#3,\c!entries={#4}}{}}} \def\startregister{\doquadrupleempty\dostartregister} \def\stopregister {\dodoubleargument\dostopregister} @@ -199,19 +220,72 @@ \let\closeregisterrange\stopregister \def\dostartregister[#1][#2][#3][#4]#5% - {\iffourthargument - % #1=register #2=tag #3=own #4=sortkey #5=entry - \doflushatpar{\doprocesspageregister{#1}{#2}{#4}{#3}{#5}}% - \else - % #1=register #2=tag #3=sortkey #5=entry - \doflushatpar{\doprocesspageregister{#1}{#2}{#3}{}{#5}}% - \fi} + {\iffourthargument + % #1=register #2=tag #3=own #4=sortkey #5=entry + \doflushatpar{\doregisterstructurepageregister{#1}{\c!label=#2,\c!alternative=#3,\c!keys={#4},\c!entries={#5}}{}}% + \else + % #1=register #2=tag #3=sortkey #5=entry + \doflushatpar{\doregisterstructurepageregister{#1}{\c!label=#2,\c!keys={#3},\c!entries={#5}}{}}% + \fi} \def\dostopregister[#1][#2]% - {\ifcsname\??id#1->#2\endcsname - \getvalue{\??id#1->#2}% - \letgvalue{\??id#1->#2}\relax - \fi} + {\normalexpanded{\ctxlatelua{jobregisters.extend("#1","#2")}}} + +\def\setregisterentry {\dotripleempty\dosetregisterentry} +\def\finishregisterentry{\dotripleempty\dofinishregisterentry} + +\def\dosetregisterentry [#1][#2][#3]{\doflushatpar{\doregisterstructurepageregister{#1}{#2}{#3}}} +\def\dofinishregisterentry[#1][#2][#3]{\dofinishregisterstructurepageregister{#1}{#2}{#3}} + +\def\dofinishregisterstructurepageregister#1#2#3% register data userdata + {\begingroup + \edef\currentregister{#1}% + \getparameters[\??id][\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]% + \edef\currentregisterlabel {\registerparameter\c!label}% + \edef\currentregisterexpansion{\registerparameter\c!expansion}% + \edef\currentregisterownnumber{\registerparameter\c!ownnumber}% + \xdef\currentregisterkeys {\registerparameter\c!keys}% + \ifx\currentregisterexpansion\s!xml + \xmlstartraw + \xdef\currentregisterentries{\registerparameter\c!entries}% + \xmlstopraw + \globallet\currentregistercoding\s!xml + \else + \ifx\currentregisterexpansion\v!yes + \xdef\currentregisterentries{\registerparameter\c!entries}% + \else + \xdef\currentregisterentries{\detokenizedregisterparameter\c!entries}% + \fi + \globallet\currentregistercoding\s!tex + \fi + \ifx\currentregisterentries\empty + \normalexpanded{\ctxlua{jobregisters.extend("\currentregister","\currentregisterlabel", { + metadata = { + \ifx\currentregisterownnumber\v!yes + own = "\registerparameter\c!alternative", % can be used instead of pagenumber + \fi + }, + userdata = structure.helpers.touserdata(\!!bs\detokenize{#3}\!!es) + })% + }}% + \else + \normalexpanded{\ctxlua{jobregisters.extend("\currentregister","\currentregisterlabel", { + metadata = { + catcodes = \the\catcodetable, + coding = "\currentregistercoding", + \ifx\currentregisterownnumber\v!yes + own = "\registerparameter\c!alternative", % can be used instead of pagenumber + \fi + }, + entries = { + % we need a special one for xml, this is just a single one + \!!bs\currentregisterentries\!!es, \!!bs\currentregisterkeys\!!es + }, + userdata = structure.helpers.touserdata(\!!bs\detokenize{#3}\!!es) + }) + }}% + \fi + \endgroup} \def\doseeregister[#1][#2]#3#4% {\doflushatpar{\doprocessseeregister{#1}{#2}{#3}{#4}}} @@ -278,7 +352,7 @@ \newtoks\everyplaceregister \appendtoks - \dontcomplain + \dontcomplain \to \everyplaceregister \def\placeregister @@ -287,6 +361,7 @@ \def\doplaceregister[#1][#2]% {\iffirstargument \begingroup +% \forgetall \edef\currentregister{#1}% \setupregister[\currentregister][#2]% \the\everyplaceregister @@ -371,9 +446,10 @@ \def\defaultregistercharacter#1% {\doifsomething{#1} - {\doifelse{\registerparameter\c!indicator}\v!yes - {\executeifdefined{\strippedcsname\doregistercharacter\registerparameter\c!alternative}\doregistercharactera{#1}} - {\noregistercharacter{#1}}}} + {\doifnot{#1}\s!unknown + {\doifelse{\registerparameter\c!indicator}\v!yes + {\expandcheckedcsname{\??id:\c!indicator:}{\registerparameter\c!alternative}{a}{#1}} + {\noregistercharacter{#1}}}}} \def\noregistercharacter#1% {\registerparameter\c!before @@ -381,10 +457,9 @@ % a = -\def\doregistercharactera#1% +\setvalue{\??id:\c!indicator:a}#1% {\registerparameter\c!before \vskip\lineheight\goodbreak\vskip-\lineheight - \ifhmode\unskip\else\noindent\fi % brrr \begingroup\dosetregisterattributes\c!style\c!color \registerparameter\c!command{\strut#1}% \endgroup @@ -393,28 +468,29 @@ % b = -\def\doregistercharacterb#1% here no lineheight hackery ! ! ! +\setvalue{\??id:\c!indicator:b}#1% {\registerparameter\c!before - \ifhmode\unskip\else\noindent\fi % brrr \begingroup\dosetregisterattributes\c!style\c!color \registerparameter\c!command{\strut#1}% \endgroup \registerparameter\c!after \nobreak} -% extra: - -\def\doregistercharacterA#1{\doregistercharactera{\WORD{#1}}} -\def\doregistercharacterB#1{\doregistercharacterb{\WORD{#1}}} +\setvalue{\??id:\c!indicator:A}#1{\getvalue{\??id:\c!indicator:a}{\WORD{#1}}} +\setvalue{\??id:\c!indicator:B}#1{\getvalue{\??id:\c!indicator:b}{\WORD{#1}}} %D The following macros are the interface to the rendering. These are %D generated by \LUA. This might change. \def\startregisteroutput - {\endgraf} + {\endgraf + \begingroup + \forgetparindent + \forgetparskip} \def\stopregisteroutput - {\endgraf} + {\endgraf + \endgroup} \def\startregisterentries#1% depth {\endgraf @@ -459,14 +535,14 @@ \settrue\registerpagedone \fi} -\def\registeronepage#1% content - {\registerpageseparator\registerparameter\c!pagecommand{#1}} +\def\registeronepage#1#2#3% content + {\registerpageseparator\registerparameter\c!pagecommand{\goto{#3}[internal(#1)]}} -\def\registerpagerange#1#2% content, content todo: -- configurable - {\registerpageseparator\registerparameter\c!pagecommand{#1}|--|\registerparameter\c!pagecommand{#2}} +\def\registerpagerange#1#2#3#4#5#6% content, content todo: -- configurable + {\registerpageseparator\registerparameter\c!pagecommand{\goto{#3}[internal(#1)]}|--|\registerparameter\c!pagecommand{\goto{#6}[internal(#4)]}} -\def\registeroneword#1% content - {\registerpageseparator\registerseeword{#1}} +\def\registeroneword#1#2#3% content + {\registerpageseparator\registerseeword{#3}} \def\defaultregisterentry #1{\registerparameter\c!textcommand{\limitedregisterentry{\registerparameter\c!deeptextcommand{#1}}}} \def\defaultregisterseeword#1{\labeltexts\v!see{#1}} @@ -506,14 +582,6 @@ \setregisterpagerendering \to \everyplaceregister -%D Don't use \type{\string#2}; another hack is needed, since -%D \type {#2} can be \type {\string} itself. -% -% \def\doregisterreference[#1]#2% -% {\doifsomething{#2} -% {\doif{\registerparameter\c!referencing}\v!on -% {\pagereference[#1:\strippedcsname#2]}}} - % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % diff --git a/tex/context/base/strc-ren.mkiv b/tex/context/base/strc-ren.mkiv index c2b8ffd83..8890ec8e6 100644 --- a/tex/context/base/strc-ren.mkiv +++ b/tex/context/base/strc-ren.mkiv @@ -89,15 +89,17 @@ % \newif\ifemptyhead % \newif\ifdisplaysectionhead +\def\structureheadattribute{\iflocation attr \destinationattribute \currentstructureattribute\fi} + \def\doplacestructureheadtext#1#2#3% nodes, text, endstuff {\beginheadplacement -\postponenotes +% \postponenotes \doresettructureheadnumbercontent - \ifconditional\structureheadleaveempty % \ifemptyhead - \setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi to \zeropoint{#1}% + \ifconditional\structureheadleaveempty + \setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi \structureheadattribute to \zeropoint {#1}% \makestrutofbox\sectionheadbox \else - \setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi + \setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi \structureheadattribute {\doresettructureheadnumbercontent \ifcase\headtimingmode\or#1\fi % outerside font determines distance \dosetfontattribute{\??nh\currentstructurehead}\c!style % but we don't want color to influence user command, todo: get the if-else out of it @@ -107,13 +109,13 @@ \def\doplacestructureheadnumbertext#1#2#3#4% nodes number text nodes {\beginheadplacement -\postponenotes +% \postponenotes \doiftextelse{#2}\dosettructureheadnumbercontent\doresettructureheadnumbercontent - \ifconditional\structureheadleaveempty % \ifemptyhead % = needed - \setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi to \zeropoint{#1}% + \ifconditional\structureheadleaveempty + \setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi \structureheadattribute to \zeropoint{#1}% \makestrutofbox\sectionheadbox \else % = needed - \setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi + \setbox\sectionheadbox\ifvertical\vbox\else\hbox\fi \structureheadattribute {\ifcase\headtimingmode\or#1\fi \dosetfontattribute{\??nh\currentstructurehead}\c!style \structureheadparameter\c!command{\doplaceheadnumbercomponent{#1}{#2}}{\doplaceheadtextcomponent{#1}{#3}}}% @@ -127,7 +129,7 @@ {\doplacestructureheadtext\empty\getstructureheadtitle\getstructureheadsyncs} \def\placestructureheadnothing - {\getstructureheadsyncs} + {\hbox \structureheadattribute {\getstructureheadsyncs}} %D \starttyping %D \def\StretchedBox#1% @@ -188,8 +190,7 @@ \resetinteractionparameter\c!color \resetinteractionparameter\c!contrastcolor %\strictouterreferencestrue % tzt instelling - \let\localheadsetup\dolocalheadsetup - \startsynchronization} + \let\localheadsetup\dolocalheadsetup} % \setuphead[chapter] [style=\bfd,after=,hang=line] % fit broad 2 % \setuphead[section] [style=\bfc,after=,hang=line] @@ -227,13 +228,9 @@ \newbox\sectionheadbox \def\endheadplacement#1% - {\doifelse{\structureheadparameter\c!state}\v!start - {\doifnothing{\structureheadparameter\c!file}{\autocrossdocumentfalse}} - {\autocrossdocumentfalse}% - % no message needed here, should be a proper switch - \noflines\zerocount + {\noflines\zerocount \ifconditional\structureheadisdisplay % \ifdisplaysectionhead - % new (tod tight == one following line up) + % new (todo tight == one following line up) \processaction [\structureheadparameter\c!hang] [ \v!line=>\hangheadplacement\noflines\zerocount, @@ -247,19 +244,8 @@ \snaptogrid[\structureheadparameter\c!grid]\hbox {\hskip\localheadskip \hskip\structureheadparameter\c!margin\relax - \iflocation -% \ifautocrossdocument -% \doifreferencefoundelse{\structureheadparameter\c!file::\currentstructurehead} -% {\edef\currentinnerreference{\s!aut:\currenttextreference}% stored in -% \gotoouterlocation{}{\box\sectionheadbox}} % text slot -% {\hbox{\box\sectionheadbox}}% -% \else - \hbox{\box\sectionheadbox}% -% \fi - \else - \hbox{\box\sectionheadbox}% - \fi}% - \doflushnotes % new, not really needed + \box\sectionheadbox}% + \flushnotes % new, not really needed \endgraf \ifvmode \ifnum\noflines>\zerocount @@ -271,21 +257,9 @@ #1% \else \strut - \doflushnotes % new, here since we're in par mode - \iflocation - \ifautocrossdocument - \hhboxindent=\ifconditional\continuoussectionhead\headlastlinewidth\else\zeropoint\fi - \unhhbox\sectionheadbox\with{\gotobox{\box\hhbox}[\structureheadparameter\c!file::\currentstructurehead]}% - \advance\lasthhboxwidth by \numberheaddistance - \xdef\headlastlinewidth{\the\lasthhboxwidth}% - \else - \unhbox\sectionheadbox - \globallet\headlastlinewidth\!!zeropoint - \fi - \else - \unhbox\sectionheadbox - \globallet\headlastlinewidth\!!zeropoint - \fi + \flushnotes % new, here since we're in par mode + \unhbox\sectionheadbox + \globallet\headlastlinewidth\!!zeropoint #1% \hskip\numberheaddistance\!!plus\numberheaddistance\!!minus.25\dimexpr\numberheaddistance\relax \hskip\continuousstructureheadsignal\ignorespaces @@ -299,7 +273,6 @@ \fi \fi \fi - \stopsynchronization \egroup \egroup \ifconditional\structureheadisdisplay % \ifdisplaysectionhead @@ -331,10 +304,13 @@ {\setvalue{\??ns:#1}{#2}% \setvalue{\??ns::#1}} +% \def\normalplacehead +% {\executeifdefined +% {\??ns::\numberheadalternative} +% {\getvalue{\??ns::\v!normal}}} + \def\normalplacehead - {\executeifdefined - {\??ns::\numberheadalternative} - {\getvalue{\??ns::\v!normal}}} + {\csname\??ns::\ifcsname\??ns::\numberheadalternative\endcsname\numberheadalternative\else\v!normal\fi\endcsname} \defineheadplacement[\v!paragraph][\v!vertical]#1#2% {\vbox diff --git a/tex/context/base/strc-sec.mkii b/tex/context/base/strc-sec.mkii index ef85d1e7a..0698ef93c 100644 --- a/tex/context/base/strc-sec.mkii +++ b/tex/context/base/strc-sec.mkii @@ -1325,6 +1325,25 @@ \let\fullsectionnumber\limitedfullsectionnumber +% from cont-new: + +\def\expandifnonempty#1% + {\@EA\ifx\csname#1\endcsname\empty + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi + {\csname#1\endcsname}} + +\def\@@sectiekoppeling#1% + {\expandifnonempty{\??ko#1\c!coupling}{#1}} + +\def\@@sectiesectie#1% + {\expandifnonempty{\??ko#1\c!section}{\@@sectiekoppeling{#1}}} + +\def\sectioncountervalue#1% + {\@@sectionvalue{\@@sectiesectie{#1}}} + % \dodododoconstructhead IS NON GROUPED, SO WE NEED TO RESTORE !!!! % % dit kan dus beter \everyaroundhead zijn diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv index 1768325f6..fef1dd01e 100644 --- a/tex/context/base/strc-sec.mkiv +++ b/tex/context/base/strc-sec.mkiv @@ -122,7 +122,8 @@ {\processcommalist[#1]{\dodosetupstructurehead{#2}}} \def\dodosetupstructurehead#1#2% - {\getparameters[\??nh#2][#1]% + {\edef\currentstructurehead{#2}% + \getparameters[\??nh#2][#1]% \the\everystructureheadsetup} \def\dodefinestructurehead[#1][#2]% @@ -218,25 +219,24 @@ \def\dodohandlestructureheadown[#1][#2]#3#4% {\settrue\currentstructureown - \dohandlestructurehead{#1}{\c!reference=#2,\c!ownnumber={#3},\c!title={#4}}{}} % name ref nr title -- + \dohandlestructurehead{#1}{\c!reference={#2},\c!ownnumber={#3},\c!title={#4}}{}} % name ref nr title -- \def\dodohandlestructureheadnop[#1][#2]#3% {\setfalse\currentstructureown - \dohandlestructurehead{#1}{\c!reference=#2,\c!title={#3}}{}} % name ref nr title -- + \dohandlestructurehead{#1}{\c!reference={#2},\c!title={#3}}{}} % name ref nr title -- \newtoks\everybeforestructurehead % hook, todo: before/after keys \newtoks\everyafterstructurehead % hook, todo: before/after keys \def\dodostartstructurehead[#1][#2][#3]% for the moment no grouping, too annoying with page breaks {\setfalse\currentstructureown - \globalpushmacro\currentstructurehead + %\globalpushmacro\currentstructurehead \xdef\currentstructurehead{#1}% \the\everybeforestructurehead \dohandlestructurehead{#1}{#2}{#3}} % name -- -- -- userdata \def\dostopstructurehead[#1]% - {\globalpopmacro\currentstructurehead - \doifnot{#1}\currentstructurehead{\writestatus\m!systems{missing \letterbackslash\e!stop#1}}% + {%\globalpopmacro\currentstructurehead \xdef\currentstructurehead{#1}% recover \the\everyafterstructurehead} @@ -300,11 +300,6 @@ \v!empty=>\settrue\structureheadleaveempty, \v!no=>\settrue\structureheadleaveempty\setfalse\structureheaddoplace]} -\def\setstructureheadreset % todo, also set resetset here - {\doifelse{\structureheadparameter\c!resetnumber}\v!no - {\setfalse\@@resetsubheadnumbers}% - {\settrue \@@resetsubheadnumbers}} - \def\setstructureheaddisplay {\doifelsevalue{\??nh:\structureheadparameter\c!alternative}\v!horizontal {\setfalse\structureheadisdisplay} @@ -329,17 +324,13 @@ \setfalse\structureheadshownumber \fi} -% \defconvertexpanded\asciititle{\getvalue{\??ko#1\c!expansion}}{#4}% - -% \unexpanded\def\\{\space} - \def\thestructureheadsynchonization {\pagetype[\currentstructureheadcoupling]% hm also number \normalexpanded{\noexpand\setmarking[\currentstructureheadcoupling]{\currentstructurelistnumber}}% \currentstructuresynchronize} \def\fullstructureheadnumber{\labeltexts{\structureheadparameter\c!label}{\structurenumber}} % todo -\def\fullstructureheadtitle {\structurecctvalue{titledata.title}} % todo +\def\fullstructureheadtitle {\structurevariable{titledata.title}} % no catcode! \let\currentstructurehead \empty \let\currentstructureheadcoupling\empty @@ -356,8 +347,10 @@ \c!name=#1, \c!number=\ifconditional\structureheadshownumber\v!yes\else\v!no\fi, \c!bookmark=, + \c!marking=, + \c!list=, \c!expansion=\structureheadparameter\c!expansion, - \c!reset=\structureheadparameter\c!reset, + \c!sectionresetset=\structureheadparameter\c!sectionresetset, \c!sectionseparatorset=\structureheadparameter\c!sectionseparatorset, \c!sectionconversionset=\structureheadparameter\c!sectionconversionset, \c!sectionconversion=\structureheadparameter\c!conversion, % just for compatibility @@ -401,7 +394,6 @@ \setstructureheadreference{#3}% will change \setstructureheadincrement \setstructureheadplacement - \setstructureheadreset \setstructureheaddisplay \setstructureheadnumber % @@ -496,15 +488,26 @@ {\docheckstructureheadbefore\docheckstructureheadlayout \structureheadparameter\c!inbetween} +% \def\emptystructureheadcorrection +% {\ifconditional\structureheadleaveempty % inlined \emptyheadcorrection (with after=\blank) +% \vskip-\lineheight +% \dosomebreak\nobreak % \penalty10000 in vspacing +% \kern\zeropoint +% \prevdepth\strutdepth +% \fi} + +\def\emptystructureheadcorrection + {\ifconditional\structureheadleaveempty % inlined \emptyheadcorrection (with after=\blank) + \penalty10000 % first ... we need to adapt this all to vspacing + \vskip-\lineheight + \kern\zeropoint + \prevdepth\strutdepth + \fi} + \def\dostructureheadspacingafteryes {\ifconditional\structureheadisdisplay - \dosomebreak\nobreak - \ifconditional\structureheadleaveempty % inlined \emptyheadcorrection (with after=\blank) - \vskip-\lineheight - \dosomebreak\nobreak - \kern\zeropoint - \prevdepth\strutdepth - \fi + \dosomebreak\nobreak % needs to be adapted to vspacing + \emptystructureheadcorrection \structureheadparameter\c!after \fi} diff --git a/tex/context/base/strc-syn.lua b/tex/context/base/strc-syn.lua index 00ee2fdc2..d9b7b9a57 100644 --- a/tex/context/base/strc-syn.lua +++ b/tex/context/base/strc-syn.lua @@ -122,20 +122,10 @@ function joblists.finalize(data,options) local result = data.result data.metadata.nofsorted = #result local split = { } - local se = sorters.entries[options.language or sorters.defaultlanguage] or sorters.entries[sorters.defaultlanguage] for k=1,#result do local v = result[k] - local entry, tag = v.split[1], "" - if se and se[entry] then - if type(se[entry]) == "number" then - entry = se[entry] - end - tag = se[entry] - else - entry = 0 - tag = "unknown" - end - local s = split[entry] + local entry, tag = sorters.firstofsplit(v.split) + local s = split[entry] -- keeps track of change if not s then s = { tag = tag, data = { } } split[entry] = s diff --git a/tex/context/base/supp-box.tex b/tex/context/base/supp-box.tex index dc6833e6a..e2f537a8c 100644 --- a/tex/context/base/supp-box.tex +++ b/tex/context/base/supp-box.tex @@ -210,8 +210,7 @@ \if#1b\nextboxdp\zeropoint\fi\fi\fi\fi\fi} \def\finsm@sh % redefined plain macro - {\dowithnextbox - {\@EA\handletokens\@@smash\with\makesm@sh\flushnextbox}\normalhbox} + {\dowithnextbox{\@EA\handletokens\@@smash\with\makesm@sh\flushnextbox}\normalhbox} %D \starttabulate[|l|l|] %D \NC w \NC \ruledhbox{\smash [w]{This is some great smashing, isn't it?}} \NC \NR @@ -300,7 +299,7 @@ %D number. \def\getboxheight#1\of#2\box#3% - {\def\next{#1\ht\registercount\advance#1\dp\registercount}% + {\def\next{#1\dimexpr\ht\registercount+\dp\registercount\relax}% \afterassignment\next\registercount=#3} %D For a long time the following three macros were part of @@ -351,46 +350,92 @@ \newcount\noflines \newdimen\noflinesheight -\def\getnoflines {\xdogetnoflines\plusone } % compensated -\def\getroundednoflines{\xdogetnoflines\plustwo } % rounded -\def\getrawnoflines {\xdogetnoflines\plusthree} % truncated +% \def\getnoflines {\xdogetnoflines\plusone } % compensated +% \def\getroundednoflines{\xdogetnoflines\plustwo } % rounded +% \def\getrawnoflines {\xdogetnoflines\plusthree} % truncated +% +% \def\xdogetnoflines#1#2% +% {\noflinesheight#2\relax +% \ifzeropt\noflinesheight +% \noflines\zerocount +% \else\ifdim\noflinesheight>\zeropoint +% \ifcase#1\or +% \advance\noflinesheight-\roundingeps +% \divide\noflinesheight\openlineheight +% \noflines\noflinesheight +% \advance\noflines\plusone +% \or +% \advance\noflinesheight\roundingeps +% \divide\noflinesheight\openlineheight +% \noflines\noflinesheight +% \or +% \advance\noflinesheight\roundingeps +% \advance\noflinesheight.5\openlineheight +% \divide\noflinesheight\openlineheight +% \noflines\noflinesheight +% \fi +% \else +% \ifcase#1\or +% \advance\noflinesheight\roundingeps +% \divide\noflinesheight\openlineheight +% \noflines\noflinesheight +% \advance\noflines\minusone +% \or +% \advance\noflinesheight-\roundingeps +% \divide\noflinesheight\openlineheight +% \noflines\noflinesheight +% \or +% \advance\noflinesheight-\roundingeps +% \advance\noflinesheight-.5\openlineheight +% \divide\noflinesheight\openlineheight +% \noflines\noflinesheight +% \fi +% \fi\fi} -\def\xdogetnoflines#1#2% - {\noflinesheight#2\relax +\def\getnoflines#1% + {\noflinesheight#1\relax \ifzeropt\noflinesheight \noflines\zerocount - \else\ifdim#2>\zeropoint - \ifcase#1\or - \advance\noflinesheight-\roundingeps - \divide\noflinesheight\openlineheight - \noflines\noflinesheight - \advance\noflines\plusone - \or - \advance\noflinesheight\roundingeps - \divide\noflinesheight\openlineheight - \noflines\noflinesheight - \or - \advance\noflinesheight\roundingeps - \advance\noflinesheight.5\openlineheight - \divide\noflinesheight\openlineheight - \noflines\noflinesheight - \fi + \else\ifdim\noflinesheight>\zeropoint + \advance\noflinesheight-\roundingeps + \divide\noflinesheight\openlineheight + \noflines\noflinesheight + \advance\noflines\plusone \else - \ifcase#1\or - \advance\noflinesheight\roundingeps - \divide\noflinesheight\openlineheight - \noflines\noflinesheight - \advance\noflines\minusone - \or - \advance\noflinesheight-\roundingeps - \divide\noflinesheight\openlineheight - \noflines\noflinesheight - \or - \advance\noflinesheight-\roundingeps - \advance\noflinesheight-.5\openlineheight - \divide\noflinesheight\openlineheight - \noflines\noflinesheight - \fi + \advance\noflinesheight\roundingeps + \divide\noflinesheight\openlineheight + \noflines\noflinesheight + \advance\noflines\minusone + \fi\fi} + +\def\getroundednoflines#1% + {\noflinesheight#1\relax + \ifzeropt\noflinesheight + \noflines\zerocount + \else\ifdim\noflinesheight>\zeropoint + \advance\noflinesheight\roundingeps + \divide\noflinesheight\openlineheight + \noflines\noflinesheight + \else + \advance\noflinesheight-\roundingeps + \divide\noflinesheight\openlineheight + \noflines\noflinesheight + \fi\fi} + +\def\getrawnoflines#1% + {\noflinesheight#1\relax + \ifzeropt\noflinesheight + \noflines\zerocount + \else\ifdim\noflinesheight>\zeropoint + \advance\noflinesheight\roundingeps + \advance\noflinesheight.5\openlineheight + \divide\noflinesheight\openlineheight + \noflines\noflinesheight + \else + \advance\noflinesheight-\roundingeps + \advance\noflinesheight-.5\openlineheight + \divide\noflinesheight\openlineheight + \noflines\noflinesheight \fi\fi} %D Let's proof that it works: @@ -430,7 +475,7 @@ %D \determinenoflines{\definedfont[Sans at 40pt]test\\test} %D \stoptyping -\def\determinenoflines +\def\determinenoflines % can be mkiv'd {\bgroup \forgetall \let\crlf\endgraf @@ -521,6 +566,14 @@ \def\dododowithnextbox {\aftergroup\dodowithnextbox} +\long\def\dowithnextboxcs#1% + {\let\dodowithnextbox#1% + \afterassignment\dododowithnextbox + \setbox\nextbox} + +\def\dododowithnextbox + {\aftergroup\dodowithnextbox} + %D So in fact we get: %D %D \starttyping @@ -619,14 +672,13 @@ %D Some well known friends, but we implement them our own %D way. We want the macros to work in both math and text mode. -\def\dorlap{\begingroup\dowithnextbox{\normalhbox to \zeropoint - {\flushnextbox\normalhss}\endgroup}\normalhbox} - -\def\dollap{\begingroup\dowithnextbox{\normalhbox to \zeropoint - {\normalhss\flushnextbox}\endgroup}\normalhbox} +\def\dodorlap{\normalhbox to \zeropoint{\flushnextbox\normalhss}\endgroup} +\def\dodollap{\normalhbox to \zeropoint{\normalhss\flushnextbox}\endgroup} +\def\dodoclap{\normalhbox to \zeropoint{\normalhss\flushnextbox\normalhss}\endgroup} -\def\doclap{\begingroup\dowithnextbox{\normalhbox to \zeropoint - {\normalhss\flushnextbox\normalhss}\endgroup}\normalhbox} +\def\dorlap{\begingroup\dowithnextboxcs\dodorlap\normalhbox} +\def\dollap{\begingroup\dowithnextboxcs\dodollap\normalhbox} +\def\doclap{\begingroup\dowithnextboxcs\dodoclap\normalhbox} \def\domathclap{\mathpalette\dodomathclap} \def\dodomathclap#1#2{\doclap{$\mathsurround\zeropoint#1#2$}} \def\domathllap{\mathpalette\dodomathllap} \def\dodomathllap#1#2{\dollap{$\mathsurround\zeropoint#1#2$}} @@ -636,11 +688,11 @@ \unexpanded\def\llap{\mathortext\domathllap\dollap} \unexpanded\def\clap{\mathortext\domathclap\doclap} -\def\tlap{\begingroup\dowithnextbox{\normalvbox to \zeropoint - {\normalvss\flushnextbox}\endgroup}\normalvbox} +\def\dodotlap{\normalvbox to \zeropoint{\normalvss\flushnextbox}\endgroup} +\def\dodoblap{\normalvbox to \zeropoint{\flushnextbox\normalvss}\endgroup} -\def\blap{\begingroup\dowithnextbox{\normalvbox to \zeropoint - {\flushnextbox\normalvss}\endgroup}\normalvbox} +\def\tlap{\begingroup\dowithnextboxcs\dodotlap\normalvbox} +\def\blap{\begingroup\dowithnextboxcs\dodoblap\normalvbox} %D \macros %D {beginofshapebox, @@ -1327,7 +1379,7 @@ %\def\limitatetext##1##2##3{##1}% \def ! \let\limitatetext\firstofthreearguments \fakecompoundhyphen % dangerous ! ! ! ! ! ! ! ! ! - \dowithnextbox\dolimitatetext\normalhbox} + \dowithnextboxcs\dolimitatetext\normalhbox} \def\dolimitatetext#1#2% {\doifelsenothing{#1} @@ -2389,13 +2441,17 @@ %D %D A few more boxes. -\def\lhbox{\dowithnextbox{\normalhbox to \hsize{\flushnextbox\hss }}\normalhbox} -\def\mhbox{\dowithnextbox{\normalhbox to \hsize{\hss\flushnextbox\hss}}\normalhbox} -\def\rhbox{\dowithnextbox{\normalhbox to \hsize{\hss\flushnextbox }}\normalhbox} +\def\dodolhbox{\normalhbox to \hsize{\flushnextbox\hss }} +\def\dodomhbox{\normalhbox to \hsize{\hss\flushnextbox\hss}} +\def\dodorhbox{\normalhbox to \hsize{\hss\flushnextbox }} + +\def\lhbox{\dowithnextboxcs\dodolhbox\normalhbox} +\def\mhbox{\dowithnextboxcs\dodomhbox\normalhbox} +\def\rhbox{\dowithnextboxcs\dodorhbox\normalhbox} -\let\lefthbox =\lhbox -\let\midhbox =\mhbox -\let\righthbox=\rhbox +\let\lefthbox \lhbox +\let\midhbox \mhbox +\let\righthbox\rhbox %D \macros %D {boxofsize} diff --git a/tex/context/base/supp-emp.mkii b/tex/context/base/supp-emp.mkii new file mode 100644 index 000000000..15489bca7 --- /dev/null +++ b/tex/context/base/supp-emp.mkii @@ -0,0 +1,398 @@ +%D \module +%D [ file=supp-emp, +%D version=2000.08.09, +%D title=\CONTEXT\ Support Macros, +%D subtitle=\EMTEX\ specials to \PDF\ conversion, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +%M \input supp-emp + +%D When \THANH, the author of \PDFTEX, and I were exchanging +%D some emails on \PDFTEX\ functionality, positional +%D information popped up as potential extension. Actually, it +%D did not take that much time to cook up the basic +%D functionality and the author had implemented it before I +%D could even start to think about real advanced applications. +%D +%D I'm sure that \TEX\ programmers can spend many days on how +%D and what kind of information is needed if you want to have +%D access to positions, but since high level macros will +%D probably be used anyway, even things like multiple reference +%D points have proved to be rather unimportant at the system +%D level. +%D +%D Therefore, \PDFTEX\ provides just these three primitives: +%D +%D \starttabulate[|l|l|] +%D \NC \type {\pdfsavepos} \NC marks the current position \NC \NR +%D \NC \type {\pdflastxpos} \NC the last marked horizontal position \NC \NR +%D \NC \type {\pdflastypos} \NC the last marked vertical position \NC \NR +%D \stoptabulate +%D +%D Based on these three primitives, very advanced systems can +%D be build, and for some time now, \CONTEXT\ has such a +%D system in its core. However, not everyone uses \CONTEXT, so +%D we will demonstrate position tracking in generic applications. +%D +%D Because \PDFTEX\ produces its output directly, many of those +%D nice tricks provided by back||ends by means of \type +%D {\special} fail when producing \PDF\ code directly. Take for +%D instance \EMTEX\ specials. When someone sent me a mail +%D asking if \PDFTEX\ did support those specials, the original +%D answer was \quotation {no}, but in the last few years I have learned +%D that you must never underestimate \TEX's capabilities. +%D +%D I must admit that I never use those specials myself, but +%D from the way they were used in the macros I was sent, I +%D learned that they depend on the back||end's capability to +%D access the current position. For those who know \TEX\ this +%D may be bad news, since pure \TEX\ does not provide any +%D positional information. So in order to use those specials, +%D you must be sure that they are supported by every driver you +%D use. However, the good news is that \PDFTEX\ does support +%D position tracking, so here is our generic example. +%D +%D The two \EMTEX\ specials we need to implement are packaged +%D into the macros \type {\EMmoveto} and \type {\EMlineto}, +%D like: +%D +%D \starttyping +%D \def\EMmoveto{\special{em:moveto}} +%D \def\EMlineto{\special{em:lineto}} +%D \stoptyping +%D +%D They are used in macro packages to draw lines, and the +%D results are often boxes with content like the following: +%D +%D \startbuffer +%D \vbox to 2cm +%D {\offinterlineskip \EMmoveto +%D \hskip 7cm \EMlineto +%D \vskip 2cm \EMlineto +%D \vskip-2cm \EMlineto} +%D \stopbuffer +%D +%D \typebuffer +%D +%D This box will contain a triangle, and when typeset, it should +%D look like: +%D +%D \startlinecorrection[blank] +%D \getbuffer +%D \stoplinecorrection + +\def\EMlinewd{.4} + +\ifx\dosetpositionpt\undefined % non context part + +%D These two macros can be implemented as follows. When moving +%D to a position, we only have to register the new coordinates. +%D Once they are known, we use them to draw a line and +%D afterwards we save these end coordinates as starting point +%D for the next line segment. So, at each point specified by +%D \type {\EMlineto} we need to know the coordinates. + +\def\EMmoveto + {\EMgetposition\EMlastmovex\EMlastmovey} + +%D The primitives \type {\pdflastxpos} and \type +%D {\pdflastypos} return a number, representing the $x$ and +%D $y$ coordinate in scaled points, \TEX's smallest unit of +%D length. We need to convert this number into base points as +%D used by \POSTSCRIPT\ and \PDF. When done, we insert some +%D literal \PDF\ code into the text using \type {\pdfliteral}. +%D Here, the \type {m} means \quote {moveto}, the \type {l} +%D means \quote {lineto} and the \type {S} operator \quote +%D {strokes} (draws) the line. The macro \type {\EMlinewd} +%D holds the linewidth in basepoints. + +\def\EMlineto + {\bgroup + \EMgetposition\EMlastlinex\EMlastliney + \count0=\EMlastmovex \advance\count0 -\EMlastlinex + \count2=\EMlastmovey \advance\count2 -\EMlastliney + \divide\count0 65536 + \divide\count2 65536 + \PDFcode{\EMlinewd\space w 0 0 m \the\count0 \space\the\count2 \space l S}% + \global\let\EMlastmovex\EMlastlinex + \global\let\EMlastmovey\EMlastliney + \egroup} + +%D We need a fresh start, so we first set the current position +%D to zero. + +\def\resetEMspecials + {\gdef\EMlastmovex{0}\gdef\EMlastmovey{0}} + +%D Next comes the macro that keeps track of the position. The +%D current position is marked with \type {\pdfsavepos} and its +%D coordinates are written to a file whenever the page is +%D shipped out, since \type {\write} postpones its action +%D until that moment. The file has entries like: +%D +%D \starttyping +%D \EMsetpos 1 4661756 46651918 +%D \EMsetpos 2 5000359 46990521 +%D \EMsetpos 3 4661756 46313315 +%D \EMsetpos 4 5338962 46990521 +%D \EMsetpos 5 4661756 45974712 +%D \stoptyping +%D +%D These lines are written with the command: +%D +%D \starttyping +%D \write\EMfile +%D {\EMsetpos\number\EMcounter +%D \space\number\pdflastxpos\space\number\pdflastypos}% +%D \stoptyping +%D +%D In reality the argument to \type {\write} looks slightly +%D more complicated, because we have to make sure that the +%D number of the current position is frozen and \type +%D {\EMsetpos} is not expanded. We do so by explicitly +%D expanding the number beforehand and preventing expansion of +%D \type {\EMsetpos}. + +\def\EMgetposition#1#2% + {\bgroup + \pdfsavepos + \global\advance\EMcounter 1 + \expandafter\write\expandafter\EMfile\expandafter + {\expandafter\noexpand\expandafter\EMsetpos\number\EMcounter + \space\number\pdflastxpos\space\number\pdflastypos}% + \EMsetcounters + \xdef#1{\the\count0}% + \xdef#2{\the\count2}% + \egroup} + +%D The counter mentioned a few lines ago needs to be +%D declared before it can be used. + +\newcount\EMcounter + +%D We also need a dedicated file slot. + +\newwrite\EMfile + +%D Before we open the file for writing, we read in the data +%D written in the previous pass, but only if the file is +%D present. + +\def\EMfilename{\jobname.emp} + +\def\startEMspecials% + {\resetEMspecials + \openin\scratchread=\EMfilename \relax + \ifeof\scratchread\else \input \EMfilename \relax \fi + \closein\scratchread + \immediate\openout\EMfile=\EMfilename\relax} + +\def\stopEMspecials + {\closeout\EMfile} + +%D Just to be sure, we test if \type {\scratchread} is defined, +%D and if not, we allocate a slot. + +\ifx\undefined\scratchread \newread\scratchread \fi + +%D This leaves us two commands. The \type {\EMsetpos} command +%D that ends up in the file stores each position in a macro. +%D When this macro is expanded, it assigns the coordinates to +%D two scratch counters. + +\def\EMsetpos#1 #2 #3 % number x y + {\expandafter\xdef\csname EM:#1\endcsname{\count0=#2 \count2=#3}} + +%D This position is recalled with its companion macro. First we +%D set the counters to zero. When the position is unknown, +%D nothing happens since the \type {\csname...} will expand to +%D \type {\relax}. + +\def\EMsetcounters + {\count0=0 \count2=0 + \csname EM:\the\EMcounter\endcsname} + +%D These macros are rather independent of the macro package you +%D use. For instance, in \CONTEXT\ the following works well: +%D +%D \startbuffer[pos-en] +%D \setuppositioning[unit=ex] +%D \startpositioning +%D \dostepwiserecurse{-10}{10}{1} +%D {\position(0,\recurselevel){\EMmoveto} +%D \position(\recurselevel,0){\EMlineto}} +%D \stoppositioning +%D \stopbuffer +%D +%D \startbuffer[pos-nl] +%D \setuppositioning[uniteenheid=ex] +%D \startpositioning +%D \dostepwiserecurse{-10}{10}{1} +%D {\position(0,\recurselevel){\EMmoveto} +%D \position(\recurselevel,0){\EMlineto}} +%D \stoppositioning +%D \stopbuffer +%D +%D \typebuffer[pos-en] +%D +%D Here, we hook the \EMTEX\ macros into an existing text +%D positioning mechanism, which positions the commands +%D using \TEX's skips and kerns. +%D +%D \startlinecorrection[blank] +%D \getbuffer[pos-nl] +%D \stoplinecorrection +%D +%D Of course one should start and end the file with: +%D +%D \starttyping +%D \startEMspecials +%D \stopEMspecials +%D \stoptyping +%D +%D and, if needed, reset the begin position at each page using: +%D +%D \starttyping +%D \resetEMspecials +%D \stoptyping + +\fi % end of non context part + +\ifx\dosetpositionpt\undefined \else % context part + +% \edef\EMlinewd{\withoutpt\the\linewidth} + +%D A few pages ago, we mentioned that \CONTEXT\ has built||in +%D position tracking. This means that when we want to implement +%D this kind of trickery in this macro package, we can fall +%D back on existing functionality. In the following alternative +%D we will also use a few skips. This keeps the source readable +%D and \CONTEXT\ has plenty of unused registers to accomodate +%D this strategy. + +\newcount\EMcounter \def\EMvariable{EM:\the\EMcounter} + +\newskip \EMlastmovex \newskip \EMlastmovey +\newskip \EMlastlinex \newskip \EMlastliney + +\def\resetEMspecials + {\global\EMlastmovex=0pt \global\EMlastmovey=\EMlastmovex} + +\resetEMspecials \appendtoks\resetEMspecials\to\everyshipout + +%D Watch how we reset the specials after a page is flushed. We +%D don't have to bother about files here, because saving and +%D recalling is already implemented. Although not needed, we +%D define the start||stop macros, so that \CONTEXT\ users who +%D key them in are not confronted with error messages. + +\let\startEMspecials\relax \let\stopEMspecials\relax + +\def\EMgetposition#1#2% + {\global\advance\EMcounter 1 + \setposition\EMvariable + \global#1=\POSx\EMvariable + \global#2=\POSy\EMvariable} + +\def\EMmoveto + {\EMgetposition\EMlastmovex\EMlastmovey} + +\def\EMlineto + {\EMgetposition\EMlastlinex\EMlastliney + \global\advance\EMlastmovex -\EMlastlinex + \global\advance\EMlastmovey -\EMlastliney + \ScaledPointsToBigPoints{\number\EMlastmovex}\EMx + \ScaledPointsToBigPoints{\number\EMlastmovey}\EMy + \PDFcode{\EMlinewd\space w 0 0 m \EMx \space \EMy \space l S}% + \global\EMlastmovex\EMlastlinex + \global\EMlastmovey\EMlastliney} + +%D The command \type {\setposition} registers a position by +%D name (here \type {\EMvariable}), while \type {\POSx} and +%D \type {\POSy} give you access to the coordinates. +%D +%D These three commands are containes in a suite of low level +%D commands that can be used to register and get access to +%D positional information. The current mechanism is not yet +%D complete, but already provides enough hooks for advanced +%D embedded graphics. Its functionality is a natural extension +%D to the \METAPOST\ support already present in \CONTEXT. +%D Therefore, more advanced examples can be found in the +%D \METAFUN\ manual, since they fall beyond the scope of this +%D module. + +\fi % end of context part + +%D As a bonus, I will now provide a few macros that will make +%D this mechanism transparant to \DVI\ as well as \PDF\ +%D output. We will use \type {\pdfiteral} as trigger. + +\ifx\PDFcode\undefined + \ifx\pdfliteral\undefined + \def\PDFcode#1{\special{PDF: #1}} + \else + \let\PDFcode\pdfliteral + \fi +\fi + +\ifx\PDFcode\undefined + \def\EMpdfordvi#1#2{#2} +\else\ifx\pdfoutput\undefined + \def\EMpdfordvi#1#2{#2} +\else + \def\EMpdfordvi#1#2{\ifcase\pdfoutput#2\else#1\fi} +\fi\fi + + +%D We save some of the macros we defined previously: + +\let\pdfEMmoveto\EMmoveto \let\pdfstartEMspecials\startEMspecials +\let\pdfEMlineto\EMlineto \let\pdfstopEMspecials \stopEMspecials + +%D We now redefine them to support \DVI\ and \PDF. + +\def\EMmoveto{\EMpdfordvi\pdfEMmoveto{\special{em:moveto}}} +\def\EMlineto{\EMpdfordvi\pdfEMlineto{\special{em:lineto}}} + +\def\startEMspecials{\EMpdfordvi\pdfstartEMspecials\relax} +\def\stopEMspecials {\EMpdfordvi\pdfstopEMspecials \relax} + +%D If there is any real demand for this in \CONTEXT, I will +%D hook these macros in the special drivers, so that their +%D support becomes more natural. + +%D You may want to change the default linewidth. The following +%D macro does the job. Beware of the fact that \type +%D {\special}'s may interfere with the typesetting process. +%D +%D \starttyping +%D \setEMlinewidth{1pt} +%D \stoptyping + +\def\setEMlinewidth#1% this could be done more efficient for + {\bgroup % context alone, but it's a hack anyway + \dimen0=#1\relax + \count0=\dimen0 + \divide\count0 65536 + \pdfordvi\relax{\special{em:linewidth \the\dimen0}}% + \xdef\EMlinewd{\the\count0}% + \egroup} + +%D You may wonder to what extent positional tracking is +%D \PDFTEX\ specific. In \CONTEXT, we also support position +%D tracking in \DVI\ by using specials and analyzing the \DVI\ +%D file afterwards using \DVIPOS. Since many of the advanced +%D \TEX\ features depend on some kind of back||end, we don't +%D consider it to be a disadvantage. Of course, the \PDFTEX\ +%D way is not only cleaner, but also faster. It was more out +%D of curiosity than out of need that we provided the \DVI\ +%D methods as well. Also, it is always good to have more roads +%D to reach the same goal. + +\endinput diff --git a/tex/context/base/supp-emp.tex b/tex/context/base/supp-emp.tex deleted file mode 100644 index 15489bca7..000000000 --- a/tex/context/base/supp-emp.tex +++ /dev/null @@ -1,398 +0,0 @@ -%D \module -%D [ file=supp-emp, -%D version=2000.08.09, -%D title=\CONTEXT\ Support Macros, -%D subtitle=\EMTEX\ specials to \PDF\ conversion, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -%M \input supp-emp - -%D When \THANH, the author of \PDFTEX, and I were exchanging -%D some emails on \PDFTEX\ functionality, positional -%D information popped up as potential extension. Actually, it -%D did not take that much time to cook up the basic -%D functionality and the author had implemented it before I -%D could even start to think about real advanced applications. -%D -%D I'm sure that \TEX\ programmers can spend many days on how -%D and what kind of information is needed if you want to have -%D access to positions, but since high level macros will -%D probably be used anyway, even things like multiple reference -%D points have proved to be rather unimportant at the system -%D level. -%D -%D Therefore, \PDFTEX\ provides just these three primitives: -%D -%D \starttabulate[|l|l|] -%D \NC \type {\pdfsavepos} \NC marks the current position \NC \NR -%D \NC \type {\pdflastxpos} \NC the last marked horizontal position \NC \NR -%D \NC \type {\pdflastypos} \NC the last marked vertical position \NC \NR -%D \stoptabulate -%D -%D Based on these three primitives, very advanced systems can -%D be build, and for some time now, \CONTEXT\ has such a -%D system in its core. However, not everyone uses \CONTEXT, so -%D we will demonstrate position tracking in generic applications. -%D -%D Because \PDFTEX\ produces its output directly, many of those -%D nice tricks provided by back||ends by means of \type -%D {\special} fail when producing \PDF\ code directly. Take for -%D instance \EMTEX\ specials. When someone sent me a mail -%D asking if \PDFTEX\ did support those specials, the original -%D answer was \quotation {no}, but in the last few years I have learned -%D that you must never underestimate \TEX's capabilities. -%D -%D I must admit that I never use those specials myself, but -%D from the way they were used in the macros I was sent, I -%D learned that they depend on the back||end's capability to -%D access the current position. For those who know \TEX\ this -%D may be bad news, since pure \TEX\ does not provide any -%D positional information. So in order to use those specials, -%D you must be sure that they are supported by every driver you -%D use. However, the good news is that \PDFTEX\ does support -%D position tracking, so here is our generic example. -%D -%D The two \EMTEX\ specials we need to implement are packaged -%D into the macros \type {\EMmoveto} and \type {\EMlineto}, -%D like: -%D -%D \starttyping -%D \def\EMmoveto{\special{em:moveto}} -%D \def\EMlineto{\special{em:lineto}} -%D \stoptyping -%D -%D They are used in macro packages to draw lines, and the -%D results are often boxes with content like the following: -%D -%D \startbuffer -%D \vbox to 2cm -%D {\offinterlineskip \EMmoveto -%D \hskip 7cm \EMlineto -%D \vskip 2cm \EMlineto -%D \vskip-2cm \EMlineto} -%D \stopbuffer -%D -%D \typebuffer -%D -%D This box will contain a triangle, and when typeset, it should -%D look like: -%D -%D \startlinecorrection[blank] -%D \getbuffer -%D \stoplinecorrection - -\def\EMlinewd{.4} - -\ifx\dosetpositionpt\undefined % non context part - -%D These two macros can be implemented as follows. When moving -%D to a position, we only have to register the new coordinates. -%D Once they are known, we use them to draw a line and -%D afterwards we save these end coordinates as starting point -%D for the next line segment. So, at each point specified by -%D \type {\EMlineto} we need to know the coordinates. - -\def\EMmoveto - {\EMgetposition\EMlastmovex\EMlastmovey} - -%D The primitives \type {\pdflastxpos} and \type -%D {\pdflastypos} return a number, representing the $x$ and -%D $y$ coordinate in scaled points, \TEX's smallest unit of -%D length. We need to convert this number into base points as -%D used by \POSTSCRIPT\ and \PDF. When done, we insert some -%D literal \PDF\ code into the text using \type {\pdfliteral}. -%D Here, the \type {m} means \quote {moveto}, the \type {l} -%D means \quote {lineto} and the \type {S} operator \quote -%D {strokes} (draws) the line. The macro \type {\EMlinewd} -%D holds the linewidth in basepoints. - -\def\EMlineto - {\bgroup - \EMgetposition\EMlastlinex\EMlastliney - \count0=\EMlastmovex \advance\count0 -\EMlastlinex - \count2=\EMlastmovey \advance\count2 -\EMlastliney - \divide\count0 65536 - \divide\count2 65536 - \PDFcode{\EMlinewd\space w 0 0 m \the\count0 \space\the\count2 \space l S}% - \global\let\EMlastmovex\EMlastlinex - \global\let\EMlastmovey\EMlastliney - \egroup} - -%D We need a fresh start, so we first set the current position -%D to zero. - -\def\resetEMspecials - {\gdef\EMlastmovex{0}\gdef\EMlastmovey{0}} - -%D Next comes the macro that keeps track of the position. The -%D current position is marked with \type {\pdfsavepos} and its -%D coordinates are written to a file whenever the page is -%D shipped out, since \type {\write} postpones its action -%D until that moment. The file has entries like: -%D -%D \starttyping -%D \EMsetpos 1 4661756 46651918 -%D \EMsetpos 2 5000359 46990521 -%D \EMsetpos 3 4661756 46313315 -%D \EMsetpos 4 5338962 46990521 -%D \EMsetpos 5 4661756 45974712 -%D \stoptyping -%D -%D These lines are written with the command: -%D -%D \starttyping -%D \write\EMfile -%D {\EMsetpos\number\EMcounter -%D \space\number\pdflastxpos\space\number\pdflastypos}% -%D \stoptyping -%D -%D In reality the argument to \type {\write} looks slightly -%D more complicated, because we have to make sure that the -%D number of the current position is frozen and \type -%D {\EMsetpos} is not expanded. We do so by explicitly -%D expanding the number beforehand and preventing expansion of -%D \type {\EMsetpos}. - -\def\EMgetposition#1#2% - {\bgroup - \pdfsavepos - \global\advance\EMcounter 1 - \expandafter\write\expandafter\EMfile\expandafter - {\expandafter\noexpand\expandafter\EMsetpos\number\EMcounter - \space\number\pdflastxpos\space\number\pdflastypos}% - \EMsetcounters - \xdef#1{\the\count0}% - \xdef#2{\the\count2}% - \egroup} - -%D The counter mentioned a few lines ago needs to be -%D declared before it can be used. - -\newcount\EMcounter - -%D We also need a dedicated file slot. - -\newwrite\EMfile - -%D Before we open the file for writing, we read in the data -%D written in the previous pass, but only if the file is -%D present. - -\def\EMfilename{\jobname.emp} - -\def\startEMspecials% - {\resetEMspecials - \openin\scratchread=\EMfilename \relax - \ifeof\scratchread\else \input \EMfilename \relax \fi - \closein\scratchread - \immediate\openout\EMfile=\EMfilename\relax} - -\def\stopEMspecials - {\closeout\EMfile} - -%D Just to be sure, we test if \type {\scratchread} is defined, -%D and if not, we allocate a slot. - -\ifx\undefined\scratchread \newread\scratchread \fi - -%D This leaves us two commands. The \type {\EMsetpos} command -%D that ends up in the file stores each position in a macro. -%D When this macro is expanded, it assigns the coordinates to -%D two scratch counters. - -\def\EMsetpos#1 #2 #3 % number x y - {\expandafter\xdef\csname EM:#1\endcsname{\count0=#2 \count2=#3}} - -%D This position is recalled with its companion macro. First we -%D set the counters to zero. When the position is unknown, -%D nothing happens since the \type {\csname...} will expand to -%D \type {\relax}. - -\def\EMsetcounters - {\count0=0 \count2=0 - \csname EM:\the\EMcounter\endcsname} - -%D These macros are rather independent of the macro package you -%D use. For instance, in \CONTEXT\ the following works well: -%D -%D \startbuffer[pos-en] -%D \setuppositioning[unit=ex] -%D \startpositioning -%D \dostepwiserecurse{-10}{10}{1} -%D {\position(0,\recurselevel){\EMmoveto} -%D \position(\recurselevel,0){\EMlineto}} -%D \stoppositioning -%D \stopbuffer -%D -%D \startbuffer[pos-nl] -%D \setuppositioning[uniteenheid=ex] -%D \startpositioning -%D \dostepwiserecurse{-10}{10}{1} -%D {\position(0,\recurselevel){\EMmoveto} -%D \position(\recurselevel,0){\EMlineto}} -%D \stoppositioning -%D \stopbuffer -%D -%D \typebuffer[pos-en] -%D -%D Here, we hook the \EMTEX\ macros into an existing text -%D positioning mechanism, which positions the commands -%D using \TEX's skips and kerns. -%D -%D \startlinecorrection[blank] -%D \getbuffer[pos-nl] -%D \stoplinecorrection -%D -%D Of course one should start and end the file with: -%D -%D \starttyping -%D \startEMspecials -%D \stopEMspecials -%D \stoptyping -%D -%D and, if needed, reset the begin position at each page using: -%D -%D \starttyping -%D \resetEMspecials -%D \stoptyping - -\fi % end of non context part - -\ifx\dosetpositionpt\undefined \else % context part - -% \edef\EMlinewd{\withoutpt\the\linewidth} - -%D A few pages ago, we mentioned that \CONTEXT\ has built||in -%D position tracking. This means that when we want to implement -%D this kind of trickery in this macro package, we can fall -%D back on existing functionality. In the following alternative -%D we will also use a few skips. This keeps the source readable -%D and \CONTEXT\ has plenty of unused registers to accomodate -%D this strategy. - -\newcount\EMcounter \def\EMvariable{EM:\the\EMcounter} - -\newskip \EMlastmovex \newskip \EMlastmovey -\newskip \EMlastlinex \newskip \EMlastliney - -\def\resetEMspecials - {\global\EMlastmovex=0pt \global\EMlastmovey=\EMlastmovex} - -\resetEMspecials \appendtoks\resetEMspecials\to\everyshipout - -%D Watch how we reset the specials after a page is flushed. We -%D don't have to bother about files here, because saving and -%D recalling is already implemented. Although not needed, we -%D define the start||stop macros, so that \CONTEXT\ users who -%D key them in are not confronted with error messages. - -\let\startEMspecials\relax \let\stopEMspecials\relax - -\def\EMgetposition#1#2% - {\global\advance\EMcounter 1 - \setposition\EMvariable - \global#1=\POSx\EMvariable - \global#2=\POSy\EMvariable} - -\def\EMmoveto - {\EMgetposition\EMlastmovex\EMlastmovey} - -\def\EMlineto - {\EMgetposition\EMlastlinex\EMlastliney - \global\advance\EMlastmovex -\EMlastlinex - \global\advance\EMlastmovey -\EMlastliney - \ScaledPointsToBigPoints{\number\EMlastmovex}\EMx - \ScaledPointsToBigPoints{\number\EMlastmovey}\EMy - \PDFcode{\EMlinewd\space w 0 0 m \EMx \space \EMy \space l S}% - \global\EMlastmovex\EMlastlinex - \global\EMlastmovey\EMlastliney} - -%D The command \type {\setposition} registers a position by -%D name (here \type {\EMvariable}), while \type {\POSx} and -%D \type {\POSy} give you access to the coordinates. -%D -%D These three commands are containes in a suite of low level -%D commands that can be used to register and get access to -%D positional information. The current mechanism is not yet -%D complete, but already provides enough hooks for advanced -%D embedded graphics. Its functionality is a natural extension -%D to the \METAPOST\ support already present in \CONTEXT. -%D Therefore, more advanced examples can be found in the -%D \METAFUN\ manual, since they fall beyond the scope of this -%D module. - -\fi % end of context part - -%D As a bonus, I will now provide a few macros that will make -%D this mechanism transparant to \DVI\ as well as \PDF\ -%D output. We will use \type {\pdfiteral} as trigger. - -\ifx\PDFcode\undefined - \ifx\pdfliteral\undefined - \def\PDFcode#1{\special{PDF: #1}} - \else - \let\PDFcode\pdfliteral - \fi -\fi - -\ifx\PDFcode\undefined - \def\EMpdfordvi#1#2{#2} -\else\ifx\pdfoutput\undefined - \def\EMpdfordvi#1#2{#2} -\else - \def\EMpdfordvi#1#2{\ifcase\pdfoutput#2\else#1\fi} -\fi\fi - - -%D We save some of the macros we defined previously: - -\let\pdfEMmoveto\EMmoveto \let\pdfstartEMspecials\startEMspecials -\let\pdfEMlineto\EMlineto \let\pdfstopEMspecials \stopEMspecials - -%D We now redefine them to support \DVI\ and \PDF. - -\def\EMmoveto{\EMpdfordvi\pdfEMmoveto{\special{em:moveto}}} -\def\EMlineto{\EMpdfordvi\pdfEMlineto{\special{em:lineto}}} - -\def\startEMspecials{\EMpdfordvi\pdfstartEMspecials\relax} -\def\stopEMspecials {\EMpdfordvi\pdfstopEMspecials \relax} - -%D If there is any real demand for this in \CONTEXT, I will -%D hook these macros in the special drivers, so that their -%D support becomes more natural. - -%D You may want to change the default linewidth. The following -%D macro does the job. Beware of the fact that \type -%D {\special}'s may interfere with the typesetting process. -%D -%D \starttyping -%D \setEMlinewidth{1pt} -%D \stoptyping - -\def\setEMlinewidth#1% this could be done more efficient for - {\bgroup % context alone, but it's a hack anyway - \dimen0=#1\relax - \count0=\dimen0 - \divide\count0 65536 - \pdfordvi\relax{\special{em:linewidth \the\dimen0}}% - \xdef\EMlinewd{\the\count0}% - \egroup} - -%D You may wonder to what extent positional tracking is -%D \PDFTEX\ specific. In \CONTEXT, we also support position -%D tracking in \DVI\ by using specials and analyzing the \DVI\ -%D file afterwards using \DVIPOS. Since many of the advanced -%D \TEX\ features depend on some kind of back||end, we don't -%D consider it to be a disadvantage. Of course, the \PDFTEX\ -%D way is not only cleaner, but also faster. It was more out -%D of curiosity than out of need that we provided the \DVI\ -%D methods as well. Also, it is always good to have more roads -%D to reach the same goal. - -\endinput diff --git a/tex/context/base/supp-eps.mkii b/tex/context/base/supp-eps.mkii new file mode 100644 index 000000000..5684b25dd --- /dev/null +++ b/tex/context/base/supp-eps.mkii @@ -0,0 +1,202 @@ +%D \module +%D [ file=supp-eps, +%D version=1998.05.06, +%D title=\CONTEXT\ Support Macros, +%D subtitle=\EPS\ tools, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifx \undefined \writestatus \input supp-mis.tex \relax \fi + +%D The macros in this module are rather old and were originally +%D part of the figure inclusion macros. When \PDFTEX\ started +%D to support \PDF\ inclusion, where some accompanying macros +%D were put in \type{supp-pdf}, I considered it more suitable +%D to give the \EPS\ macros their own module. + +\writestatus{loading}{ConTeXt Support Macros / EPS} + +%D \macros +%D {dogetEPSboundingbox} +%D +%D The predecessors of the following macro's are derived from +%D Thomas Rockicky's macro's. They are rewritten to a more +%D compact form, made a bit more robust and also handle the +%D \type{HiResBoundingBox} and \type{ExactBoundingBox} that +%D are sometimes present. +%D +%D A bounding box has the form: +%D +%D \starttyping +%D %%BoundingBox: llx lly urx ury +%D \stoptyping +%D +%D Before we scan the file, we have to reset special +%D characters and set some others. The percentage symbol also +%D needs special treatment. When a bounding box is +%D encountered, we keep on scanning until no more directives +%D are found, i.e. a line is found that does not start with a +%D percentage symbol. We also abort scanning after finding a +%D high resolution bounding box. +%D +%D This method also works inside verbatim mode (like when we +%D are typesetting sources and putting eps coded logos into +%D a heading. Temporary restoring the \CATCODES\ is done in +%D the calling routine. +%D +%D The creator as well as external support for specials are +%D analyzed as well and their status is available in \type +%D {\EPScreator} and \type {\EPSshading}. The boundingbox +%D components are available in \type {\EPSllx} etc. + +\unprotect + +\def\EPSllx{0} \let\MPllx\EPSllx % just in case these +\def\EPSlly{0} \let\MPlly\EPSlly % are used while running +\def\EPSurx{0} \let\MPurx\EPSurx % in fast mode we set +\def\EPSury{0} \let\MPury\EPSury % them to 0. + +\chardef\EPSfound =0 +\chardef\EPScreator=0 +\chardef\EPSspecial=0 +\chardef\EPSstatus =0 + +\let\EPScreatorstring\empty + +\newtoks\extraEPSpreambleresets +\newtoks\extraEPSpreambleparsers + +\def\dofinishEPSfile{\dofinishfile} % no \let, can be overloaded + +\def\dogetEPSboundingbox#1#2#3#4#5% + {\bgroup + \global\chardef\EPSfound \zerocount + \global\chardef\EPScreator\zerocount + \global\chardef\EPSspecial\zerocount + \global\chardef\EPSstatus \zerocount + \global\let\EPScreatorstring\empty + \the\extraEPSpreambleresets + \uncatcodespecials + \catcode`\^^M=\@@ignore + \def\doprocessEPSline + {\advance\scratchcounter\plusone + \expandafter\checkEPSboundingbox\fileline\empty\empty:.:.\end}% + \scratchcounter\zerocount + \doprocessfile\scratchread{#1}\doprocessEPSline + \egroup + % Using \EPSllx bp instead of \dimen0=1bp and \EPSllx\dimen0 is more accurate (.005pt). + \ifnum\EPSfound>\zerocount + #2\dimexpr\EPSllx\onebasepoint \relax + #3\dimexpr\EPSlly\onebasepoint \relax + #4\dimexpr\EPSurx\onebasepoint-#2\relax + #5\dimexpr\EPSury\onebasepoint-#3\relax + \else + #2\zeropoint + #3\zeropoint + #4\zeropoint + #5\zeropoint + \fi + %\message{[bbox #1: \EPSllx\space\EPSurx\space\EPSlly\space\EPSury]}\wait + \global\let\MPllx\EPSllx \global\let\MPlly\EPSlly + \global\let\MPurx\EPSurx \global\let\MPury\EPSury} + +\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup + +\def\EPSboundingboxtag {BoundingBox} +\def\EPShiresboundingboxtag{HiResBoundingBox} +\def\EPSexactboundingboxtag{ExactBoundingBox} +\def\EPScreatortag {Creator} +\def\EPSmetaposttag {MetaPost} +\def\EPSmetapostspecialtag {MetaPostSpecial} +\def\EPSmetapostspecialstag{MetaPostSpecials} +\def\EPSpagetag {Page} + +\let\EPSspecialstring \empty +\let\EPSspecialcontent\empty + +% new metapost construct (hires bb followed by creator + version) +% +%!PS +%%BoundingBox: -71 -1 651 496 +%%HiResBoundingBox: -70.9945 -0.5 650.5 495.24907 +%%Creator: MetaPost 0.901 +%%CreationDate: 2005.06.02:1633 +%%Pages: 1 + +\long\def\checkEPSboundingbox#1#2#3:#4:.#5\end + {\if\string#1\letterpercent + \if\string#2\letterpercent + \edef\EPSspecialstring{#3}% + \edef\EPSspecialcontent{#4}% + \ifx\EPSspecialstring\EPScreatortag + \getEPScreatorspec + \else\ifx\EPSspecialstring\EPSboundingboxtag + \getEPSboundingboxspec + \global\chardef\EPSfound\plusone + \else\ifx\EPSspecialstring\EPShiresboundingboxtag + \getEPSboundingboxspec + \global\chardef\EPSfound\plustwo + \scratchcounter\zerocount + \else\ifx\EPSspecialstring\EPSexactboundingboxtag + \getEPSboundingboxspec + \global\chardef\EPSfound\plustwo + \scratchcounter\zerocount + \else\ifx\EPSspecialstring\EPSmetapostspecialtag % only before finish! + \global\chardef\EPSspecial\plusone % ah, we've met some MP extensions + \else\ifx\EPSspecialstring\EPSmetapostspecialstag % only before finish! + \global\chardef\EPSspecial\plusone % ah, we've met some MP extensions + \else\ifx\EPSspecialstring\EPSpagetag + \global\chardef\EPSstatus \plusone % we passed MP font defs + \else + \the\extraEPSpreambleparsers + \fi\fi\fi\fi\fi\fi\fi + \fi + \else\ifnum\EPSfound>\zerocount + % bb found + \ifnum\EPScreator=\plusone % that is, we are dealing with MP output + \ifcase\EPSstatus + % we've run into MP fontdefs + \or + \dofinishEPSfile + \fi + \else\ifnum\scratchcounter>\plusthree + % too late for mps creator (we don't want to run into crap data) + \dofinishEPSfile + \else + \fi\fi + \fi\fi} + +\def\getEPSboundingboxspec + {\edef\EPSspecialstring{\EPSspecialcontent\space . . . . }% + \expandafter\dogetEPSboundingboxspec\EPSspecialstring\end} + +\def\dogetEPSboundingboxspec#1 #2 #3 #4 #5\end + {\gdef\EPSllx{#1}% + \ifx\EPSllx\empty + \dogetEPSboundingboxspec#2 #3 #4 #5\end + \else + \gdef\EPSlly{#2}% + \gdef\EPSurx{#3}% + \gdef\EPSury{#4}% + \fi} + +\def\getEPScreatorspec + {\edef\EPSspecialstring{\EPSspecialcontent\space . .}% + \expandafter\dogetEPScreatorspec\EPSspecialstring\end} + +\def\dogetEPScreatorspec#1#2 #3\end + {\edef\EPScreatorstring{#1#2}% + \global\chardef\EPScreator\ifx\EPScreatorstring\EPSmetaposttag\plusone\else\zerocount\fi\relax} + +\def\dogetEPSpreambledata#1% can be combined with \extraEPSpreambleparsers + {\bgroup + \let\dofinishEPSfile\relax % dirty trick, read past all bboxes + \dogetEPSboundingbox{#1}\!!widtha\!!heighta\!!widthb\!!heightb + \egroup} + +\protect \endinput diff --git a/tex/context/base/supp-eps.tex b/tex/context/base/supp-eps.tex deleted file mode 100644 index 5684b25dd..000000000 --- a/tex/context/base/supp-eps.tex +++ /dev/null @@ -1,202 +0,0 @@ -%D \module -%D [ file=supp-eps, -%D version=1998.05.06, -%D title=\CONTEXT\ Support Macros, -%D subtitle=\EPS\ tools, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifx \undefined \writestatus \input supp-mis.tex \relax \fi - -%D The macros in this module are rather old and were originally -%D part of the figure inclusion macros. When \PDFTEX\ started -%D to support \PDF\ inclusion, where some accompanying macros -%D were put in \type{supp-pdf}, I considered it more suitable -%D to give the \EPS\ macros their own module. - -\writestatus{loading}{ConTeXt Support Macros / EPS} - -%D \macros -%D {dogetEPSboundingbox} -%D -%D The predecessors of the following macro's are derived from -%D Thomas Rockicky's macro's. They are rewritten to a more -%D compact form, made a bit more robust and also handle the -%D \type{HiResBoundingBox} and \type{ExactBoundingBox} that -%D are sometimes present. -%D -%D A bounding box has the form: -%D -%D \starttyping -%D %%BoundingBox: llx lly urx ury -%D \stoptyping -%D -%D Before we scan the file, we have to reset special -%D characters and set some others. The percentage symbol also -%D needs special treatment. When a bounding box is -%D encountered, we keep on scanning until no more directives -%D are found, i.e. a line is found that does not start with a -%D percentage symbol. We also abort scanning after finding a -%D high resolution bounding box. -%D -%D This method also works inside verbatim mode (like when we -%D are typesetting sources and putting eps coded logos into -%D a heading. Temporary restoring the \CATCODES\ is done in -%D the calling routine. -%D -%D The creator as well as external support for specials are -%D analyzed as well and their status is available in \type -%D {\EPScreator} and \type {\EPSshading}. The boundingbox -%D components are available in \type {\EPSllx} etc. - -\unprotect - -\def\EPSllx{0} \let\MPllx\EPSllx % just in case these -\def\EPSlly{0} \let\MPlly\EPSlly % are used while running -\def\EPSurx{0} \let\MPurx\EPSurx % in fast mode we set -\def\EPSury{0} \let\MPury\EPSury % them to 0. - -\chardef\EPSfound =0 -\chardef\EPScreator=0 -\chardef\EPSspecial=0 -\chardef\EPSstatus =0 - -\let\EPScreatorstring\empty - -\newtoks\extraEPSpreambleresets -\newtoks\extraEPSpreambleparsers - -\def\dofinishEPSfile{\dofinishfile} % no \let, can be overloaded - -\def\dogetEPSboundingbox#1#2#3#4#5% - {\bgroup - \global\chardef\EPSfound \zerocount - \global\chardef\EPScreator\zerocount - \global\chardef\EPSspecial\zerocount - \global\chardef\EPSstatus \zerocount - \global\let\EPScreatorstring\empty - \the\extraEPSpreambleresets - \uncatcodespecials - \catcode`\^^M=\@@ignore - \def\doprocessEPSline - {\advance\scratchcounter\plusone - \expandafter\checkEPSboundingbox\fileline\empty\empty:.:.\end}% - \scratchcounter\zerocount - \doprocessfile\scratchread{#1}\doprocessEPSline - \egroup - % Using \EPSllx bp instead of \dimen0=1bp and \EPSllx\dimen0 is more accurate (.005pt). - \ifnum\EPSfound>\zerocount - #2\dimexpr\EPSllx\onebasepoint \relax - #3\dimexpr\EPSlly\onebasepoint \relax - #4\dimexpr\EPSurx\onebasepoint-#2\relax - #5\dimexpr\EPSury\onebasepoint-#3\relax - \else - #2\zeropoint - #3\zeropoint - #4\zeropoint - #5\zeropoint - \fi - %\message{[bbox #1: \EPSllx\space\EPSurx\space\EPSlly\space\EPSury]}\wait - \global\let\MPllx\EPSllx \global\let\MPlly\EPSlly - \global\let\MPurx\EPSurx \global\let\MPury\EPSury} - -\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup - -\def\EPSboundingboxtag {BoundingBox} -\def\EPShiresboundingboxtag{HiResBoundingBox} -\def\EPSexactboundingboxtag{ExactBoundingBox} -\def\EPScreatortag {Creator} -\def\EPSmetaposttag {MetaPost} -\def\EPSmetapostspecialtag {MetaPostSpecial} -\def\EPSmetapostspecialstag{MetaPostSpecials} -\def\EPSpagetag {Page} - -\let\EPSspecialstring \empty -\let\EPSspecialcontent\empty - -% new metapost construct (hires bb followed by creator + version) -% -%!PS -%%BoundingBox: -71 -1 651 496 -%%HiResBoundingBox: -70.9945 -0.5 650.5 495.24907 -%%Creator: MetaPost 0.901 -%%CreationDate: 2005.06.02:1633 -%%Pages: 1 - -\long\def\checkEPSboundingbox#1#2#3:#4:.#5\end - {\if\string#1\letterpercent - \if\string#2\letterpercent - \edef\EPSspecialstring{#3}% - \edef\EPSspecialcontent{#4}% - \ifx\EPSspecialstring\EPScreatortag - \getEPScreatorspec - \else\ifx\EPSspecialstring\EPSboundingboxtag - \getEPSboundingboxspec - \global\chardef\EPSfound\plusone - \else\ifx\EPSspecialstring\EPShiresboundingboxtag - \getEPSboundingboxspec - \global\chardef\EPSfound\plustwo - \scratchcounter\zerocount - \else\ifx\EPSspecialstring\EPSexactboundingboxtag - \getEPSboundingboxspec - \global\chardef\EPSfound\plustwo - \scratchcounter\zerocount - \else\ifx\EPSspecialstring\EPSmetapostspecialtag % only before finish! - \global\chardef\EPSspecial\plusone % ah, we've met some MP extensions - \else\ifx\EPSspecialstring\EPSmetapostspecialstag % only before finish! - \global\chardef\EPSspecial\plusone % ah, we've met some MP extensions - \else\ifx\EPSspecialstring\EPSpagetag - \global\chardef\EPSstatus \plusone % we passed MP font defs - \else - \the\extraEPSpreambleparsers - \fi\fi\fi\fi\fi\fi\fi - \fi - \else\ifnum\EPSfound>\zerocount - % bb found - \ifnum\EPScreator=\plusone % that is, we are dealing with MP output - \ifcase\EPSstatus - % we've run into MP fontdefs - \or - \dofinishEPSfile - \fi - \else\ifnum\scratchcounter>\plusthree - % too late for mps creator (we don't want to run into crap data) - \dofinishEPSfile - \else - \fi\fi - \fi\fi} - -\def\getEPSboundingboxspec - {\edef\EPSspecialstring{\EPSspecialcontent\space . . . . }% - \expandafter\dogetEPSboundingboxspec\EPSspecialstring\end} - -\def\dogetEPSboundingboxspec#1 #2 #3 #4 #5\end - {\gdef\EPSllx{#1}% - \ifx\EPSllx\empty - \dogetEPSboundingboxspec#2 #3 #4 #5\end - \else - \gdef\EPSlly{#2}% - \gdef\EPSurx{#3}% - \gdef\EPSury{#4}% - \fi} - -\def\getEPScreatorspec - {\edef\EPSspecialstring{\EPSspecialcontent\space . .}% - \expandafter\dogetEPScreatorspec\EPSspecialstring\end} - -\def\dogetEPScreatorspec#1#2 #3\end - {\edef\EPScreatorstring{#1#2}% - \global\chardef\EPScreator\ifx\EPScreatorstring\EPSmetaposttag\plusone\else\zerocount\fi\relax} - -\def\dogetEPSpreambledata#1% can be combined with \extraEPSpreambleparsers - {\bgroup - \let\dofinishEPSfile\relax % dirty trick, read past all bboxes - \dogetEPSboundingbox{#1}\!!widtha\!!heighta\!!widthb\!!heightb - \egroup} - -\protect \endinput diff --git a/tex/context/base/supp-lan.tex b/tex/context/base/supp-lan.tex deleted file mode 100644 index 8d781546f..000000000 --- a/tex/context/base/supp-lan.tex +++ /dev/null @@ -1,1377 +0,0 @@ -%D \module -%D [ file=supp-lan, -%D version=1997.03.20, -%D title=\CONTEXT\ Support Macros, -%D subtitle=Language Options, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D \gdef\starttest -%D {\blank -%D \noindent -%D \halign\bgroup\tt##\hskip2em&##\hskip2em&##\cr} -%D -%D \gdef\stoptest -%D {\egroup -%D \blank} -%D -%D \gdef\test#1% -%D {\defconvertedargument\ascii{#1}\ascii&\hyphenatedword{#1}\cr} - -%D One of \TEX's strong points in building paragraphs is the way -%D hyphenations are handled. Although for real good hyphenation -%D of non||english languages some extensions to the program are -%D needed, fairly good results can be reached with the standard -%D mechanisms and an additional macro, at least in Dutch. - -\unprotect - -\writestatus{loading}{ConTeXt Support Macros / Language Options} - -%D \CONTEXT\ originates in the wish to typeset educational -%D materials, especially in a technical environment. In -%D production oriented environments, a lot of compound words -%D are used. Because the Dutch language poses no limits on -%D combining words, we often favor putting dashes between those -%D words, because it facilitates reading, at least for those -%D who are not that accustomed to it. -%D -%D In \TEX\ compound words, separated by a hyphen, are not -%D hyphenated at all. In spite of the multiple pass paragraph -%D typesetting this can lead to parts of words sticking into -%D the margin. The solution lays in saying \type -%D {spoelwater||terugwinunit} instead of \type -%D {spoelwater-terugwinunit}. By using a one character command -%D like \type {|}, delimited by the same character \type {|}, -%D we get ourselves both a decent visualization (in \TEXEDIT\ -%D and colored verbatim we color these commands yellow) and an -%D efficient way of combining words. -%D -%D The sequence \type{||} simply leads to two words connected by -%D a hyphen. Because we want to distinguish such a hyphen from -%D the one inserted when \TEX\ hyphenates a word, we use a bit -%D longer one. -%D -%D \hyphenation {spoel-wa-ter te-rug-win-unit} -%D -%D \starttest -%D \test {spoelwater||terugwinunit} -%D \stoptest -%D -%D As we already said, the \type{|} is a command. This commands -%D accepts an optional argument before it's delimiter, which is -%D also a \type{|}. -%D -%D \hyphenation {po-ly-meer che-mie} -%D -%D \starttest -%D \test {polymeer|*|chemie} -%D \stoptest -%D -%D Arguments like \type{*} are not interpreted and inserted -%D directly, in contrary to arguments like: -%D -%D \starttest -%D \test {polymeer|~|chemie} -%D \test {|(|polymeer|)|chemie} -%D \test {polymeer|(|chemie|)| } -%D \stoptest -%D -%D Although such situations seldom occur |<|we typeset thousands -%D of pages before we encountered one that forced us to enhance -%D this mechanism|>| we also have to take care of comma's. -%D -%D \hyphenation {uit-stel-len} -%D -%D \starttest -%D \test {op||, in|| en uitstellen} -%D \stoptest -%D -%D The next special case (concerning quotes) was brought to my -%D attention by Piet Tutelaers, one of the driving forces -%D behind rebuilding hyphenation patterns for the dutch -%D language.\footnote{In 1996 the spelling of the dutch -%D language has been slightly reformed which made this topic -%D actual again.} We'll also take care of this case. -%D -%D \starttest -%D \test {AOW|'|er} -%D \test {cd|'|tje} -%D \test {ex|-|PTT|'|er} -%D \test {rock|-|'n|-|roller} -%D \stoptest -%D -%D Tobias Burnus pointed out that I should also support -%D something like -%D -%D \starttest -%D \test {well|_|known} -%D \stoptest -%D -%D to stress the compoundness of hyphenated words. -%D -%D Of course we also have to take care of the special case: -%D -%D \starttest -%D \test {text||color and ||font} -%D \stoptest - -%D \macros -%D {installdiscretionaries} -%D -%D The mechanism described here is one of the older inner parts -%D of \CONTEXT. The most recent extensions concerns some -%D special cases as well as the possibility to install other -%D characters as delimiters. The prefered way of specifying -%D compound words is using \type{||}, which is installed by: -%D -%D \starttyping -%D \installdiscretionaries || - -%D \stoptyping -%D -%D Some alternative definitions are: -%D -%D \startbuffer -%D \installdiscretionaries ** - -%D \installdiscretionaries ++ - -%D \installdiscretionaries // - -%D \installdiscretionaries ~~ - -%D \stopbuffer -%D -%D \typebuffer -%D -%D after which we can say: -%D -%D \bgroup -%D \getbuffer -%D \starttest -%D \test {test**test**test} -%D \test {test++test++test} -%D \test {test//test//test} -%D \test {test~~test~~test} -%D \stoptest -%D \egroup - -%D \macros -%D {compoundhyphen, -%D beginofsubsentence,endofsubsentence} -%D -%D Now let's go to the macros. First we define some variables. -%D In the main \CONTEXT\ modules these can be tuned by a setup -%D command. Watch the (maybe) better looking compound hyphen. - -% I've added \hbox's so that in mathmode we get proper chars - -\def\compoundhyphen {\hbox{-\kern-.25ex-}} -\def\beginofsubsentence {\hbox{---}} -\def\endofsubsentence {\hbox{---}} - -%D The last two variables are needed for subsentences -%D |<|like this one|>| which we did not yet mention. -%D -%D We want to enable breaking but at the same time don't want -%D compound characters like |-| or || to be separated from the -%D words. \TEX\ hackers will recognise the next two macro's: - -\def\prewordbreak {\penalty\plustenthousand\hskip\zeropoint\relax} -\def\postwordbreak {\penalty\zerocount\prewordbreak} - -%D We first show the original implementation, which only -%D supports \type{|} as command and delimiter. Before -%D activating \type{|} we save it's value: -%D -%D \starttyping -%D \edef\domathmodediscretionary{\string|} -%D \stoptyping -%D -%D after which we're ready to define it's meaning to: -%D -%D \starttyping -%D \catcode`\|=\@@active -%D -%D \unexpanded\def|% -%D {\ifmmode -%D \expandafter\domathmodediscretionary -%D \else -%D \expandafter\dotextmodediscretionary -%D \fi} -%D \stoptyping -%D -%D We need a two stage \type{\futurelet} because we want to -%D look ahead for both the compound character definition and -%D the (optional) comma that follows it, and because we want to -%D prevent that \TEX\ puts this comma on the next line. We use -%D \type{\next} for easy and fast checking of the argument, we -%D save this argument (which can consist of more tokens) and -%D also save the character following the \type{|#1|} in -%D \type{\nextnext}. -%D -%D \starttyping -%D \def\dotextmodediscretionary% -%D {\bgroup -%D \futurelet\next\dodotextmodediscretionary} -%D -%D \def\dodotextmodediscretionary#1|% -%D {\def\betweendiscretionaries{#1}% -%D \futurelet\nextnext\dododotextmodediscretionary} -%D \stoptyping -%D -%D The main macro consists of quite some \type{\ifx} tests -%D while \type{\checkafterdiscretionary} handles the commas. -%D We show the simplified version here: -%D -%D \starttyping -%D \def\dododotextmodediscretionary% -%D {\let\nextnextnext=\egroup -%D \ifx |\next -%D \checkafterdiscretionary -%D \prewordbreak\hbox{\compoundhyphen\nextnext}\allowbreak\postwordbreak -%D \else\ifx=\next -%D \prewordbreak\compoundhyphen -%D \else\ifx~\next -%D \discretionary{-}{}{\thinspace}\postwordbreak -%D \else\ifx(\next -%D \prewordbreak\discretionary{}{(-}{(}\prewordbreak -%D \else\ifx)\next -%D \prewordbreak\discretionary{-)}{}{)}\prewordbreak -%D \else\ifx'\next -%D \prewordbreak\discretionary{-}{}{'}\postwordbreak -%D \else -%D \checkafterdiscretionary -%D \prewordbreak\hbox{\betweendiscretionaries\nextnext}\allowbreak\postwordbreak -%D \fi\fi\fi\fi\fi\fi -%D \nextnextnext} -%D -%D \def\checkafterdiscretionary% -%D {\ifx,\nextnext -%D \def\nextnextnext{\afterassignment\egroup\let\next=}% -%D \else -%D \let\nextnext=\relax -%D \fi} -%D \stoptyping -%D -%D Handling \type{(} and \type{)} is a a bit special, because -%D \TEX\ sees them as decent hyphenation points, according to -%D their \type{\lccode} being non||zero. For the same reason, -%D later on in this module we cannot manipulate the -%D \type{\lccode} but take the \type{\uccode}. - -%D The most recent implementation is more advanced. As -%D demonstrated we can install delimiters, like: -%D -%D \starttyping -%D \installdiscretionaries || \compoundhyphen -%D \stoptyping -%D -%D This time we have to use a bit more clever way of saving the -%D math mode specification of the character we're going to -%D make active. We also save the user supplied compound hyphen. -%D We show the a bit more traditional implementation first. -%D -%D \starttyping -%D \def\installdiscretionaries#1% -%D {\catcode`#1\@@other -%D \expandafter\doinstalldiscretionaries\string#1} -%D -%D \def\doinstalldiscretionaries#1% -%D {\setvalue{mathmodediscretionary#1}{#1}% -%D \catcode`#1\@@active -%D \dodoinstalldiscretionaries} -%D -%D \def\dodoinstalldiscretionaries#1#2% -%D {\setvalue{textmodediscretionary\string#1}{#2}% -%D \unexpanded\def#1{\discretionarycommand#1}} -%D \stoptyping -%D -%D A bit more \CATCODE\ and character trickery enables us to -%D discard the two intermediate steps. This trick originates -%D on page~394 of the \TEX book, in the appendix full of -%D dirty tricks. The second argument has now become redundant, -%D but I decided to reserve it for future use. At least it -%D remembers us of the symmetry. - -\def\installdiscretionaries#1#2#3% - {\setevalue{\strippedcsname\mathmodediscretionary\string#1}{\detokenize{#1}}% - \setvalue {\strippedcsname\textmodediscretionary\string#1}{#3}% - \catcode`#1=\@@active - \scratchcounter=\the\uccode`~ - \uccode`~=`#1 - \uppercase{\unexpanded\def~{\discretionarycommand~}}% - \uccode`~=\scratchcounter} - -\def\domathmodediscretionary#1% - {\getvalue{\strippedcsname\mathmodediscretionary\string#1}} - -\def\discretionarycommand - {\relax\ifmmode - \expandafter\domathmodediscretionary - \else - \expandafter\dotextmodediscretionary - \fi} - -%D The next piece of code is a torture test for this previous -%D macro. The \type {\relax} before the \type {\ifmmode} is -%D needed because of the alignment scanner (in \ETEX\ this -%D problem is not present because there a protected macro is -%D not expanded. Thanks to Tobias Burnus for providing this -%D example. -%D -%D \startformula -%D \left|f(x_n)-{1\over2}\right| = -%D {\cases{|{1\over2}-x_n| &for $0\le x_n < {1\over2}$\cr -%D |x_n-{1\over2}| &for ${1\over2}\zeropoint\relax - (\prewordbreak - \else - \prewordbreak\discretionary{}{(-}{(}\prewordbreak - \fi - \else\ifx)\next - \ifx\nextnext\blankspace - \prewordbreak)\relax - \else - \prewordbreak\discretionary{-)}{}{)}\prewordbreak - \fi - \else\ifx'\next - \prewordbreak\discretionary{-}{}{'}\postwordbreak - \else\ifx<\next - \beginofsubsentence\prewordbreak\beginofsubsentencespacing - \else\ifnum\uccode`>=\nextuccode - \endofsubsentencespacing\prewordbreak\endofsubsentence - \else - \checkafterdiscretionary - \bgroup - \checkbeforediscretionary - \prewordbreak - \discretionary{\hbox{\betweendiscretionary}}{}{\hbox{\betweendiscretionary}}% - \allowbreak\postwordbreak - \egroup - \fi\fi\fi\fi\fi\fi\fi\fi\fi - \nextnextnext} - -\def\checkbeforediscretionary - {\ifvmode\dontleavehmode\fi - \ifhmode - \begingroup - \setbox\scratchbox\lastbox - \ifdim\wd\scratchbox=\zeropoint - \let\postwordbreak\prewordbreak - \fi - \box\scratchbox\relax - \endgroup - \fi} - -\def\checkafterdiscretionary - {\ifx,\nextnext - \def\nextnextnext{\afterassignment\egroup\let\next=}% - \else - \let\nextnext\relax - \fi} - -%D The macro \type{\checkbeforediscretionary} takes care of -%D loners like \type{||word}, while it counterpart -%D \type{\checkafterdiscretionary} is responsible for handling -%D the comma. - -%D \macros -%D {beginofsubsentencespacing,endofsubsentencespacing} -%D -%D In the previous macros we provided two hooks which can be -%D used to support nested sub||sentences. In \CONTEXT\ these -%D hooks are used to insert a small space when needed. - -\let\beginofsubsentencespacing=\relax -\let\endofsubsentencespacing =\relax - -%D Before we show some more tricky alternative, we first install -%D the mechanism: - -\installdiscretionaries || \compoundhyphen - -%D \macros -%D {fakecompoundhyphen} -%D -%D In headers and footers as well as in active pieces of text -%D we need a dirty hack. Try to imagine what is needed to -%D savely break the next text across a line and at the same -%D time make the words interactive. -%D -%D \starttyping -%D \goto{Some||Long||Word} -%D \stoptyping - -\def\currentspaceskip - {\interwordspace\!!plus\interwordstretch\!!minus\interwordshrink\relax} - -% \def\fakecompoundhyphen% wrong -% {\def|##1|{\compoundhyphen\nobreak\hskip-\currentspaceskip\allowbreak}} - -\ifx\newsignal\undefined - - \let\fakecompoundhyphen\relax - -\else - - \newsignal\compoundbreakpoint - - % \def\fakecompoundhyphen% - % {\def|##1|% - % {\doifelsenothing{##1}{\compoundhyphen}{##1}% - % \kern\compoundbreakpoint\allowbreak}} - - \def\fakecompoundhyphen - {\def\|{\mathortext\vert\dofakecompoundhyphen}} - - \def\dofakecompoundhyphen - {\def##1|% - {\doifelsenothing{##1}\compoundhyphen{##1}% - \kern\compoundbreakpoint\allowbreak}} - -\fi - -%D One of the drawbacks of this mechanism is that characters can -%D be made active afterwards. The next alternative can be used -%D in such situations. This time we don't compare the arguments -%D directly but use the \type{\uccode}'s instead. \TEX\ -%D initializes these codes of the alphabetics glyphs to their -%D uppercase counterparts. Normally the other characters remain -%D zero. If so, we can use the \type{\uccode} as a signal. - -%D \macros -%D {enableactivediscretionaries} -%D -%D The more advanced mechanism is activated by calling: -%D -%D \starttyping -%D \enableactivediscretionaries -%D \stoptyping -%D -%D which is defined as: - -\def\enableactivediscretionaries - {\uccode`'=`'\relax \uccode`~=`~\relax \uccode`_=`_\relax - \uccode`(=`(\relax \uccode`)=`)\relax \uccode`==`=\relax - \uccode`<=`<\relax \uccode`>=`>\relax - \let\dotextmodediscretionary \activedotextmodediscretionary - \let\dododotextmodediscretionary\activedododotextmodediscretionary} - -%D We only have to redefine two macros. While saving the -%D \type{\uccode} in a macro we have to take care of empty -%D arguments, like in \type{||}. - -\def\activedotextmodediscretionary#1% - {\bgroup - \def\dodotextmodediscretionary##1#1% - {\def\betweendiscretionary{##1}% - \def\nextuccode####1####2\relax% - {\ifcat\noexpand####1\noexpand\relax - \edef\nextuccode{0}% - \else - \edef\nextuccode{\the\uccode`####1}% - \fi}% - \nextuccode##1@\relax - \futurelet\nextnext\dododotextmodediscretionary}% - \let\discretionarycommand=#1% - \def\textmodediscretionary% - {\getvalue{\strippedcsname\textmodediscretionary\string#1}}% - \futurelet\next\dodotextmodediscretionary} - -%D This time we use \type{\ifnum}: - -\def\activedododotextmodediscretionary - {\let\nextnextnext\egroup - \ifx\discretionarycommand\next - \checkafterdiscretionary - \bgroup - \checkbeforediscretionary - \prewordbreak\hbox{\textmodediscretionary\nextnext}\allowbreak\postwordbreak - \egroup - \else\ifnum\uccode`==\nextuccode - \prewordbreak\textmodediscretionary - \else\ifnum\uccode`~=\nextuccode - \prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak - \else\ifnum\uccode`_=\nextuccode - \prewordbreak\discretionary{\textmodediscretionary} - {\textmodediscretionary}{\textmodediscretionary}\prewordbreak - \else\ifnum\uccode`(=\nextuccode - \ifdim\lastskip>\zeropoint\relax - (\prewordbreak - \else - \prewordbreak\discretionary{}{(-}{(}\prewordbreak - \fi - \else\ifnum\uccode`)=\nextuccode - \ifx\nextnext\blankspace - \prewordbreak)\relax - \else - \prewordbreak\discretionary{-)}{}{)}\prewordbreak - \fi - \else\ifnum\uccode`'=\nextuccode - \prewordbreak\discretionary{-}{}{'}\postwordbreak - \else\ifnum\uccode`<=\nextuccode - \beginofsubsentence\prewordbreak\beginofsubsentencespacing - \else\ifnum\uccode`>=\nextuccode - \endofsubsentencespacing\prewordbreak\endofsubsentence - \else - \checkafterdiscretionary - \bgroup - \checkbeforediscretionary - %\prewordbreak\hbox{\betweendiscretionary\nextnext}\allowbreak - \prewordbreak - \discretionary{\hbox{\betweendiscretionary}}{}{\hbox{\betweendiscretionary}}% - \allowbreak\postwordbreak - \egroup - \fi\fi\fi\fi\fi\fi\fi\fi\fi - \nextnextnext} % no lookahead in commands - -%D Now we can safely do things like: \enableactivediscretionaries -%D -%D \starttyping -%D \catcode`<=\@@active \def<{hello there} -%D \catcode`>=\@@active \def>{hello there} -%D \catcode`(=\@@active \def({hello there} -%D \catcode`)=\@@active \def){hello there} -%D \stoptyping -%D -%D In normal day||to||day production of texts this kind of -%D activation is seldom used.\footnote{In the \CONTEXT\ manual -%D the \type{<} and \type{>} are made active and used for some -%D cross||reference trickery.} If so, we have to take care of -%D the math mode explicitly, just like we did when making -%D \type{|} active. It can be confusing too, especially when we -%D load macropackages afterwards that make use of \type{<} in -%D \type{\ifnum} or \type{\ifdim} statements. - -%D And then came the Polish users, and who can deny them? Like -%D the German \TEX\ users demand an active \type {"}, some -%D Polish users like using the \type {/}. The next alternative -%D is a bit slower but far the most robust alternative. As a -%D bonus it also offers \type {|^|} and even \type {|||} which -%D both result in a breakable|^|bar. -%D -%D The trick we use here is to convert the argument to a -%D string and compare this string to string'd tokens. - -\def\activedotextmodediscretionary#1% - {\bgroup - \let\nextnextnext\egroup -% \def\handlecompoundcharacter##1% new, needed for polish -% {\getvalue{\@nc@\string##1}}% where / is active - \def\next##1#1% - {\def\next{\activedododotextmodediscretionary#1{##1}}% - \futurelet\nextnext\next}% - \next} - -\def\activedododotextmodediscretionary#1#2% - {\defconvertedargument\discretionarytoken{#2}% - \def\textmodediscretionary - {\getvalue{\strippedcsname\textmodediscretionary\string#1}}% - \ifx#1\nextnext % takes care of ||| and +++ and ...... - \prewordbreak\discretionary{\hbox{$#1$}}{}{\hbox{$#1$}}% - \allowbreak\postwordbreak - \def\nextnextnext{\afterassignment\egroup\let\next=}% - \else\ifx\discretionarytoken\empty - \checkafterdiscretionary - \bgroup - \checkbeforediscretionary - % this was: - % \prewordbreak\hbox{\textmodediscretionary\nextnext}\allowbreak\postwordbreak - % but an hbox blocks a possible \discretionary - \prewordbreak\textmodediscretionary\nextnext\allowbreak\postwordbreak - \egroup - \else\defconvertedargument\next=\ifx\next\discretionarytoken - \prewordbreak\textmodediscretionary - \else\defconvertedargument\next~\ifx\next\discretionarytoken - \prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak - \else\defconvertedargument\next_\ifx\next\discretionarytoken - \prewordbreak\discretionary{\textmodediscretionary} - {\textmodediscretionary}{\textmodediscretionary}\prewordbreak - \else\defconvertedargument\next(\ifx\next\discretionarytoken - \ifdim\lastskip>\zeropoint\relax - (\prewordbreak - \else - \prewordbreak\discretionary{}{(-}{(}\prewordbreak - \fi - \else\defconvertedargument\next)\ifx\next\discretionarytoken - \ifx\nextnext\blankspace - \prewordbreak)\relax - \else\ifx\nextnext\space - \prewordbreak)\relax - \else - \prewordbreak\discretionary{-)}{}{)}\prewordbreak - \fi\fi - \else\defconvertedargument\next'\ifx\next\discretionarytoken - \prewordbreak\discretionary{-}{}{'}\postwordbreak - \else\defconvertedargument\next<\ifx\next\discretionarytoken - \beginofsubsentence\prewordbreak\beginofsubsentencespacing - \else\defconvertedargument\next>\ifx\next\discretionarytoken - \endofsubsentencespacing\prewordbreak\endofsubsentence - \else\defconvertedargument\next^\ifx\next\discretionarytoken - \prewordbreak\discretionary{\hbox{$|$}}{}{\hbox{$|$}}% - \allowbreak\postwordbreak - \else - \checkafterdiscretionary - \bgroup - \checkbeforediscretionary - \prewordbreak - \discretionary{\hbox{#2}}{}{\hbox{#2}}% - \allowbreak\postwordbreak - \egroup - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \nextnextnext} % no lookahead in commands - -%D Since most things in \CONTEXT\ are configurable, we -%D slightly change the previous definition so that we can -%D install new functionality outside this module. We also -%D support lookahead (over the egroup). - -\def\@tmd@{@@tmd@@} - -\def\activedododotextmodediscretionary#1#2% - {\defconvertedargument\discretionarytoken{#2}% - \def\textmodediscretionary% - {\getvalue{\strippedcsname\textmodediscretionary\string#1}}% - \ifx\discretionarytoken\empty - \ifx#1\nextnext % takes care of ||| and +++ and ...... - \prewordbreak\discretionary{\hbox{$#1$}}{}{\hbox{$#1$}}% - \allowbreak\postwordbreak - \def\nextnextnext{\afterassignment\egroup\let\next=}% - \else - \checkafterdiscretionary - \bgroup - \checkbeforediscretionary - % the next line has been changed (20050203) - % \prewordbreak\hbox{\textmodediscretionary\nextnext}\allowbreak\postwordbreak - % but an hbox blocks a possible \discretionary - \prewordbreak\textmodediscretionary\nextnext\allowbreak\postwordbreak - \egroup - \fi - \else\expandafter\ifx\csname\@tmd@\discretionarytoken\endcsname\relax - \checkafterdiscretionary - \bgroup - \checkbeforediscretionary - \prewordbreak - \discretionary{\hbox{#2}}{}{\hbox{#2}}% - \allowbreak\postwordbreak - \egroup - \else\ifx\nextnextnext\egroup % so we can properly do things afterward - \@EA\egroup - \@EA\let\@EA\nextnextnext\@EA\empty - \csname\@tmd@\discretionarytoken\endcsname - \else - \csname\@tmd@\discretionarytoken\endcsname - \fi\fi\fi - \nextnextnext} % lookahead in commands - -\def\definetextmodediscretionary #1 - {\defconvertedargument\ascii{#1}% - \setvalue{\@tmd@\ascii}} - -\definetextmodediscretionary {} % empty case, also handled in parser - {\prewordbreak\compoundhyphen\allowbreak\postwordbreak} - -\definetextmodediscretionary ~ - {\prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak} - -\definetextmodediscretionary _ - {\prewordbreak - \discretionary{\compoundhyphen}{\compoundhyphen}{\compoundhyphen}% - \prewordbreak} - -\definetextmodediscretionary ( - {\ifdim\lastskip>\zeropoint - (\prewordbreak - \else - \prewordbreak\discretionary{}{(-}{(}\prewordbreak - \fi} - -\definetextmodediscretionary ) - {\ifx\nextnext\blankspace - \prewordbreak)\relax - \else\ifx\nextnext\space - \prewordbreak)\relax - \else - \prewordbreak\discretionary{-)}{}{)}\prewordbreak - \fi\fi} - -\definetextmodediscretionary ' - {\prewordbreak\discretionary{-}{}{'}\postwordbreak} - -\definetextmodediscretionary < - {\beginofsubsentence\prewordbreak\beginofsubsentencespacing} - -\definetextmodediscretionary > - {\endofsubsentencespacing\prewordbreak\endofsubsentence} - -% \definetextmodediscretionary . % not yet definitive -% {\prewordbreak\midsentence\prewordbreak} - -\definetextmodediscretionary = - {\prewordbreak\midsentence\prewordbreak} % {\prewordbreak\compoundhyphen} - -\definetextmodediscretionary ^ - {\prewordbreak\discretionary{\hbox{$|$}}{}{\hbox{$|$}}% - \allowbreak\postwordbreak} - -% french - -\definetextmodediscretionary : - {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{:}:} - -\definetextmodediscretionary ; - {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{;};} - -\definetextmodediscretionary ? - {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{?}?} - -\definetextmodediscretionary ! - {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{!}!} - -\definetextmodediscretionary * - {\prewordbreak\discretionary{-}{}{\kern.05em}\prewordbreak} - -% spanish - -\definetextmodediscretionary ?? - {\prewordbreak\questiondown} - -\definetextmodediscretionary !! - {\prewordbreak\exclamdown} - -\ifx\hspaceamount\undefined - - \def\hspaceamount#1#2{16667em} - -\fi - -%D Since we don't have to bother about active characters any -%D longer, we end up with a pretty simple activating macro: - -\def\enableactivediscretionaries - {\let\dotextmodediscretionary=\activedotextmodediscretionary} - -%D Done somewhere else: \type {\enableactivediscretionaries}. - -%D \macros -%D {directdiscretionary} -%D -%D In those situations where the nature of characters is -%D less predictable, we can use the more direct approach: - -%D Beware: an \type {\ignorespaces} in a definition works -%D okay here, but not in the main mechanism because there -%D we have \type {\nextnextnext}. - -\unexpanded\def\directdiscretionary#1% - {\defconvertedargument\discretionarytoken{#1}% - \let\textmodediscretionary\compoundhyphen - \expandafter\ifx\csname\@tmd@\string#1\endcsname\relax - \prewordbreak - \discretionary{\hbox{#1}}{}{\hbox{#1}}% - \allowbreak\postwordbreak - \else - \csname\@tmd@\string#1\endcsname - \fi} - -%D \macros -%D {installcompoundcharacter} -%D -%D When Tobias Burnus started translating the dutch manual of -%D \PPCHTEX\ into german, he suggested to let \CONTEXT\ support -%D the \type{german.sty} method of handling compound -%D characters, especially the umlaut. This package is meant for -%D use with \PLAIN\ \TEX\ as well as \LATEX. -%D -%D I decided to implement compound character support as -%D versatile as possible. As a result one can define his own -%D compound character support, like: -%D -%D \starttyping -%D \installcompoundcharacter "a {\"a} -%D \installcompoundcharacter "e {\"e} -%D \installcompoundcharacter "i {\"i} -%D \installcompoundcharacter "u {\"u} -%D \installcompoundcharacter "o {\"o} -%D \installcompoundcharacter "s {\SS} -%D \stoptyping -%D -%D or even -%D -%D \starttyping -%D \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}} -%D \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}} -%D \stoptyping -%D -%D The support is not limited to alphabetic characters, so the -%D next definition is also valid. -%D -%D \starttyping -%D \installcompoundcharacter ". {.\doifnextcharelse{\spacetoken}{}{\kern.125em}} -%D \stoptyping -%D -%D The implementation looks familiar and uses the same tricks as -%D mentioned earlier in this module. We take care of two -%D arguments, which complicates things a bit. - -\def\@nc@{@nc@} % normal character -\def\@nn@{@nn@} % normal catcode -\def\@cc@{@cc@} % compound character -\def\@cs@{@cs@} % compound characters - -% \def\installcompoundcharacter #1#2#3 #4% {#4} no grouping -% {\setvalue{\@nc@\string#1}{\char`#1}% -% \ifnum\catcode`#1=\@@active \else -% \setevalue{\@nn@\string#1}{\number\catcode`#1}% new -% \fi -% \def\!!stringa{#3}% -% \ifx\!!stringa\empty -% \setvalue{\@cc@\string#1\string#2}{#4}% -% \else -% \setvalue{\@cs@\string#1\string#2\string#3}{#4}% -% \fi -% \catcode`#1=\@@active -% \scratchcounter=\the\uccode`~ -% \uccode`~=`#1 -% \uppercase{\unexpanded\def~{\handlecompoundcharacter~}}% -% \uccode`~=\scratchcounter} - -\def\installcompoundcharacter #1#2#3 #4% {#4} no grouping - {\chardef\thecompoundcharacter`#1% - %\@EA\def\csname\@nc@\string#1\endcsname{\char`#1}% - \@EA\chardef\csname\@nc@\string#1\endcsname\thecompoundcharacter - \ifnum\catcode\thecompoundcharacter=\@@active \else - \@EA\edef\csname\@nn@\string#1\endcsname - {\number\catcode\thecompoundcharacter}% - \fi - \def\!!stringa{#3}% - \@EA\def\csname\ifx\!!stringa\empty - \@cc@\string#1\string#2% - \else - \@cs@\string#1\string#2\string#3% - \fi\endcsname{#4}% - \catcode\thecompoundcharacter\@@active - \scratchcounter\uccode\activehackcode - \uccode\activehackcode\thecompoundcharacter - \uppercase{\unexpanded\def~{\handlecompoundcharacter~}}% - \uccode\activehackcode\scratchcounter} - -%D A compound character can be reset with the following -%D command. -%D -%D \starttyping -%D \restorecompoundcharacter / -%D \stoptyping - -\def\restorecompoundcharacter#1% new - {\catcode`#1=\csname\@nn@\string#1\endcsname\relax} - -%D We can also ignore definitions (needed in for instance \XML). Beware, -%D this macro is supposed to be used grouped! - -\def\ignorecompoundcharacter - {\def\installcompoundcharacter##1 ##2{}} - -%D In handling the compound characters we have to take care of -%D \type{\bgroup} and \type{\egroup} tokens, so we end up with -%D a multi||step interpretation macro. We look ahead for a -%D \type{\bgroup}, \type{\egroup} or \type{\blankspace}. Being -%D no user of this mechanism, the credits for testing them goes -%D to Tobias Burnus, the first german user of \CONTEXT. -%D -%D We define these macros as \type{\long} because we can -%D expect \type{\par} tokens. We need to look into the future -%D with \type{\futurelet} to prevent spaces from -%D disappearing. - -% \def\handlecompoundcharacter#1% -% {\def\dohandlecompoundcharacter% -% {\ifx\next\bgroup -% %\def\next{\dodohandlecompoundcharacter#1}% % handle "{ee} -> \"ee -% %\let\next\relax % forget "{ee} -> ee -% \def\next{\handlecompoundcharacterone#1}% % ignore "{ee} -> "ee -% \else\ifx\next\egroup -% \def\next{\getvalue{\@nc@\string#1}}% -% \else\ifx\next\blankspace -% \def\next{\getvalue{\@nc@\string#1}}% -% \else -% \def\next{\dodohandlecompoundcharacter#1}% -% \fi\fi\fi -% \next}% -% \futurelet\next\dohandlecompoundcharacter} -% -% \def\dodohandlecompoundcharacter#1#2% -% {\def\dododohandlecompoundcharacter% Keep it here and -% {\ifx\next\bgroup % preserve spaces! -% \def\next{\handlecompoundcharacterone#1#2}% -% \else\ifx\next\egroup -% \def\next{\handlecompoundcharacterone#1#2}% -% \else\ifx\next\blankspace -% \def\next{\handlecompoundcharacterone#1#2}% -% \else -% \def\next{\handlecompoundcharactertwo#1#2}% -% \fi\fi\fi -% \next}% -% \futurelet\next\dododohandlecompoundcharacter} - -\def\handlecompoundcharacter#1% - {\def\xhandlecompoundcharacter{\dohandlecompoundcharacter{#1}}% - \futurelet\next\xhandlecompoundcharacter} - -\def\dohandlecompoundcharacter - {\ifx\next\bgroup - %\@EA\dodohandlecompoundcharacter % handle "{ee} -> \"ee - %\@EA\gobbleoneargument % forget "{ee} -> ee - \@EA\handlecompoundcharacterone % ignore "{ee} -> "ee - \else\ifx\next\egroup - \@EAEAEA\donohandlecompoundcharacter - \else\ifx\next\blankspace - \@EA\@EAEAEA\@EA\donohandlecompoundcharacter - \else - \@EA\@EAEAEA\@EA\dodohandlecompoundcharacter - \fi\fi\fi} - -\def\donohandlecompoundcharacter#1{\csname\@nc@\string#1\endcsname} - -\def\dododohandlecompoundcharacter - {\ifx\next\bgroup - \@EA\handlecompoundcharacterone - \else\ifx\next\egroup - \@EAEAEA\handlecompoundcharacterone - \else\ifx\next\blankspace - \@EA\@EAEAEA\@EA\handlecompoundcharacterone - \else - \@EA\@EAEAEA\@EA\handlecompoundcharactertwo - \fi\fi\fi} - -\def\dodohandlecompoundcharacter#1#2% preserve space - {\def\xdodohandlecompoundcharacter{\dododohandlecompoundcharacter#1#2}% - \futurelet\next\xdodohandlecompoundcharacter} - -%D Besides taken care of the grouping and space tokens, we have -%D to deal with three situations. First we look if the next -%D character equals the first one, if so, then we just insert -%D the original. Next we look if indeed a compound character is -%D defined. We either execute the compound character or just -%D insert the first. So we have -%D -%D \starttyping -%D -%D \stoptyping -%D -%D In later modules we will see how these commands are used. - -\long\def\handlecompoundcharacterone#1#2% - {\if\string#1\string#2% was: \ifx#1#2% - %\def\next{\getvalue{\@nc@\string#1}\getvalue{\@nc@\string#2}}% - \def\next{\getvalue{\@nc@\string#1}}% - \else\ifcsname\@cc@\string#1\string#2\endcsname - \def\next{\getvalue{\@cc@\string#1\string#2}}% - \else - \def\next{\getvalue{\@nc@\string#1}#2}% - \fi\fi - \next} - -\long\def\handlecompoundcharactertwo#1#2#3% - {\if\string#1\string#2% was: \ifx#1#2% - %\def\next{\getvalue{\@nc@\string#1}\getvalue{\@nc@\string#2}#3}% - \def\next{\getvalue{\@nc@\string#1}#3}% - \else\ifcsname\@cs@\string#1\string#2\string#3\endcsname - \def\next{\getvalue{\@cs@\string#1\string#2\string#3}}% - \else\ifcsname\@cc@\string#1\string#2\endcsname - \def\next{\getvalue{\@cc@\string#1\string#2}#3}% - \else - \def\next{\getvalue{\@nc@\string#1}#2#3}% - \fi\fi\fi - \next} - -%D For very obscure applications (see for an application \type -%D {lang-sla.tex}) we provide: - -\def\dosimplifiedcompoundcharacter#1% - {#1} - -\def\simplifiedcompoundcharacter#1#2% - {\ifcsname\@cc@\string#1\string#2\endcsname - \@EA\@EA\@EA\dosimplifiedcompoundcharacter\csname\@cc@\string#1\string#2\endcsname - \else - #2% - \fi} - -%D \macros -%D {midworddiscretionary} -%D -%D If needed, one can add a discretionary hyphen using \type -%D {\midworddiscretionary}. This macro does the same as -%D \PLAIN\ \TEX's \type {\-}, but, like the ones implemented -%D earlier, this one also looks ahead for spaces and grouping -%D tokens. - -\def\domidworddiscretionary - {\ifx\next\blankspace\else - \ifx\next\bgroup \else - \ifx\next\egroup \else - \discretionary{-}{}{}% - \fi\fi\fi} - -\def\midworddiscretionary% - {\futurelet\next\domidworddiscretionary} - -%D \macros -%D {hyphenatedurl} -%D -%D For those who want to put full \URL's in a text, we offer -%D -%D \startbuffer -%D \hyphenatedurl{http://optimist.optimist/optimist/optimist.optimist#optimist} -%D \stopbuffer -%D -%D \typebuffer -%D -%D which breaks at the appropriate places. Watch the \type{#} -%D hack. -%D -%D When passed as argument, like in \type {\goto}, one needs -%D to substitute a \type {\\} for each \type{#}. -%D -%D \startbuffer -%D \hyphenatedurl{http://this.is.a.rather/strange/reference#indeed} -%D \stopbuffer -%D -%D \typebuffer - -\ifx\\\undefined \let\\\crlf \fi - -\chardef\urlsplitmode=1 - -% 0 => don't split -% 1 => . : na, rest voor -% 2 => alles na -% 3 => alles voor - -% \bgroup \catcode`\~=\active \catcode`\/=\active - -% Why not convert to ascii first? I will redo this one! - -\bgroup \catcode`\~=\active \catcode`\/=\active - -\unexpanded\gdef\hyphenatedurl#1% {}{} handles accents - {\bgroup - \ifnum\hyphenpenalty<10000 \else - \def\discretionary##1##2##3{##1\allowbreak##2}% - \fi - \obeyhyphens - \def\splitbefore##1% - {\setbox\scratchbox=\hbox{##1{}{}}% - \ifcase\urlsplitmode - \box\scratchbox - \or - \postwordbreak\box\scratchbox\prewordbreak - \or - \prewordbreak\discretionary{\box\scratchbox}{}{\box\scratchbox}\prewordbreak - \else - \postwordbreak\box\scratchbox\prewordbreak - \fi}% - \def\splitafter##1% - {\ifcase\urlsplitmode - ##1{}{}% - \or - \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak - \or - \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak - \else - \prewordbreak\discretionary{}{##1{}{}}{##1{}{}}\prewordbreak - \fi}% - \def\splitanyway##1% - {\prewordbreak##1\prewordbreak}% - \def\flushurl% - {\savedurl\let\savedurl\empty}% - \def\\% - {\spliturl\#}% - \let\~=\lettertilde\let~=\~% - \let\/=\letterslash\let/=\/% - \let\savedurl\empty - \scratchcounter\zerocount % used for hyphenmethod - \handletokens#1\with\scanurl\savedurl - \egroup} - -\egroup - -%D This would be better, but it spoils \type {\~} and so: -%D -%D \starttyping -%D \defconvertedargument\ascii{#1} -%D \expandafter\handletokens\ascii\with\scanurl -%D \stoptyping - -\chardef\urlhyphenmethod=0 - -\def\scanurl#1% - {\advance\scratchcounter\plusone - \ifx#1\blankspace - \flushurl\splitanyway\normalspace - \else\ifx#1\ % - \flushurl\splitanyway\normalspace - \else\ifx#1\space - \flushurl\splitanyway\normalspace - \else\ifx#1\~% - \flushurl\splitbefore\~% - \else\ifx#1\#% - \flushurl\splitbefore\#% - \else\ifx#1\&% - \flushurl\splitbefore\&% - \else\ifx#1\%% - \flushurl\splitbefore\%% - \else\ifx#1\_% - \flushurl\splitbefore\_% - \else\if\noexpand#1\relax - #1% - \else\ifnum\catcode`#1=8 - \flushurl\splitbefore\_% - \else\ifnum\catcode`#1=6 - \flushurl\splitbefore\#% - \else\ifnum\catcode`#1=4 - \flushurl\splitbefore\&% - \else\expandafter\if\string#1\lettertilde - \flushurl\splitbefore\~% - \else\expandafter\if\string#1\letterpercent - \flushurl\splitbefore\%% - \else\expandafter\if\string#1\letterunderscore - \flushurl\splitbefore\_% - \else\expandafter\if\string#1\letterquestionmark - \flushurl\splitafter\letterquestionmark - \else\expandafter\if\string#1\letterat - \flushurl\splitafter\letterat - \else\expandafter\if\string#1\letterslash - \edef\savedurl{\savedurl\letterslash}% - \else\expandafter\if\string#1+% - \flushurl\splitafter+% - \else\expandafter\if\string#1:% - \flushurl\splitafter:% - \else\expandafter\if\string#1.% - \flushurl\splitafter.% - \else\expandafter\if\string#1(% - \flushurl\splitbefore(% - \else\expandafter\if\string#1)% - \flushurl\splitafter)% - \else - \ifx\savedurl\empty\else - \splitbefore\savedurl - \let\savedurl\empty - \fi - \ifcase\urlhyphenmethod - \string#1% - \else - \ifnum\scratchcounter>\plusthree % so, \http: will not break - \edef\savedurl{\string#1}% - \else - \string#1% - \fi - \fi - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} - -% \setupinteraction[state=start] -% \def\gotoURL#1{\useURL[foo][#1]\goto{\url[foo]}[url(foo)]} -% \starttext -% \endgraf \chardef\urlhyphenmethod=0 -% \hsize1pt\gotoURL{http://www.physik.fu-berlin.de/SomeVeryVeryVeryLongDirectory/And/AQuiteLongFileName.html} -% \endgraf \chardef\urlhyphenmethod=1 -% \hsize1pt\gotoURL{http://www.physik.fu-berlin.de/SomeVeryVeryVeryLongDirectory/And/AQuiteLongFileName.html} -% \stoptext - -% \useencoding[ffr] -% \mainlanguage[fr] -% \starttext -% \hyphenatedurl{http://somewhere.to/go} -% \stoptext - -%D When Joop Susan asked (on the \CONTEXT\ mailing list) how -%D to handle url's passed as argument, the following solutions -%D came to my mind: -%D -%D \starttyping -%D \def\whateverurl#1% -%D {{\def~{\string~}\useURL[dummy][#1]\goto{\url[dummy]}[URL(dummy)]}} -%D -%D \def\whateverurl#1% -%D {{\let~\lettertilde\useURL[dummy][#1]\goto{\url[dummy]}[URL(dummy)]}} -%D -%D \def\whateverurl#1% -%D {\defconvertedargument\ascii{#1}% -%D \expanded{\useURL[dummy][\ascii]}\goto{\url[dummy]}[URL(dummy)]} -%D \stoptyping - -%D \macros -%D {hyphenatedfile} -%D -%D For the moment we treat filenames in a similar way, -%D -%D \starttyping -%D \hyphenatedfile{here/there/filename.suffix} -%D \stoptyping - -\let\hyphenatedfile\hyphenatedurl - -% to be finished -% -% \def\hyphenatedstring#1% -% {\bgroup -% \nohyphens -% \def\next##1{##1\doif{##1}{-}{\allowbreak}}% -% \handletokens#1\with\next -% \egroup} -% -% {\hsize1cm\hyphenatedstring{ABXXXXXXXXXXC-12345-12345}} - -%D \macros -%D {disablediscretionaries,disablecompoundcharacter} -%D -%D Occasionally we need to disable this mechanism. For the -%D moment we assume that \type {|} is used. - -\def\disablediscretionaries - {\def|##1|{\string##1}% - \def\directdiscretionary##1{\string##1}} - -\def\disablecompoundcharacters - {\let\handlecompoundcharacter\string} - -%D \macros -%D {normalcompound} -%D -%D Handy in for instance XML: - -\ifx\normalcompound\undefined \let\normalcompound=| \fi - -\protect \endinput diff --git a/tex/context/base/supp-mis.mkii b/tex/context/base/supp-mis.mkii new file mode 100644 index 000000000..5b45d8b9d --- /dev/null +++ b/tex/context/base/supp-mis.mkii @@ -0,0 +1,710 @@ +%D \module +%D [ file=supp-mis, +%D version=2004.10.26, % 1997.01.04, +%D title=\CONTEXT\ Support Macros, +%D subtitle=Missing (For Generic Use), +%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 will clean up this module (a la supp-pdf.tex preamble). + +%D Some support modules are more or less independant. This +%D module, which is not part of plain \CONTEXT, provides the +%D missing macros and declarations of registers. + +\ifx \undefined \writestatus \else \expandafter \endinput \fi + +%D Because \LATEX\ has no safe package loading mechanism, we +%D need to take care of possible interference. + +\def\StartLatexHack % replace this by the one in supp-pdf + {\edef\StopLatexHack + {\catcode\string`\noexpand/=\the\catcode\string`/ + \catcode\string`\noexpand-=\the\catcode\string`- + \catcode\string`\noexpand:=\the\catcode\string`: + \catcode\string`\noexpand;=\the\catcode\string`; + \catcode\string`\noexpand"=\the\catcode\string`" + \catcode\string`\noexpand<=\the\catcode\string`< + \catcode\string`\noexpand>=\the\catcode\string`> + \catcode\string`\noexpand`=\the\catcode\string``}% + \catcode\string`/=12 \catcode\string`-=12 + \catcode\string`:=12 \catcode\string`;=12 + \catcode\string`"=12 \catcode\string`<=12 + \catcode\string`>=12 \catcode\string``=12 } + +%D This hack is needed especially for \LATEX\ users who use +%D the Babel package. The Germans have active \type {"}'s, the +%D Poles have \type {/}, while the French have \type {:} and +%D \type {;} defines as command (thanks to Daniel Flipo for +%D pointing that out and testing). Potentially active \type +%D {?}'s and \type {!}'s are less dangerous since they are +%D handled by the \type {\protect} and \type {\unprotect} +%D macros. + +\StartLatexHack + +%D \macros +%D {ifnocontextobject} +%D +%D First we take care of redundant defining. The next set of +%D macros are a bit complicated by the fact that Plain +%D \TEX\ defines the \type{\new}||macros as being outer. +%D Furthermore nested \type{\if}'s can get us into +%D trouble. + +\def\definecontextobject + {\iftrue} + +\def\gobblecontextobject + {\setbox0\hbox + \bgroup + \long\def\gobblecontextobject##1\fi{\egroup}% + \expandafter\gobblecontextobject\string} + +\long\def\ifnocontextobject#1\do + {\ifx#1\undefined + \expandafter\definecontextobject + \else + %\writestatus{system}{beware of conflicting \string#1}% + \expandafter\gobblecontextobject + \fi} + +%D \macros +%D {beginETEX,beginTEX} +%D +%D Outside \CONTEXT\ we will not be \ETEX||aware. + +\long\def\beginETEX #1\endETEX {} + +\let\beginTEX\relax \let\endTEX\relax + +%D \macros +%D {writestatus} +%D +%D We start each module with a message. Normally the output is +%D formatted, but here we keep things simple. + +\ifnocontextobject \writestatus \do + + \def\writestatus#1#2% + {\immediate\write16{#1 : #2}} + +\fi + +%D Let's see if it works. + +\writestatus{loading}{ConTeXt Support Macros / Miscellaneous (2004.10.26)} + +%D \macros +%D {protect,unprotect} +%D +%D Next we present a poor mans alternative for \type{\protect} +%D and \type{\unprotect}, two commands that enable us to use +%D the characters \type{@}, \type{!} and \type{?} in macro +%D names. + +\ifnocontextobject \protect \do + + \let\protect\relax + +\fi + +\newcount\protectiondepth + +\ifnocontextobject \unprotect \do + + \def\unprotect + {\advance\protectiondepth 1 + \ifnum\protectiondepth=1 + \let\normalprotect=\protect + \def\protect + {\ifnum\protectiondepth>0 + \advance\protectiondepth -1 + \ifnum\protectiondepth=0 + \doprotect + \let\protect=\normalprotect + \fi + \fi} + \edef\doprotect + {\catcode`\noexpand @=\the\catcode`@\relax + \catcode`\noexpand !=\the\catcode`!\relax + \catcode`\noexpand ?=\the\catcode`?\relax} + \catcode`@=11 + \catcode`!=11 + \catcode`?=11 + \fi} + +\fi + +%D We start using this one it at once. + +\unprotect + +%D \macros +%D {scratch...,if...,next...} +%D +%D We need some scratch registers. Users are free to use them, +%D but can never be sure of their value once another macro is +%D called. We only allocate things when they are yet +%D undefined. This way we can't mess up other macro packages, +%D but of course previous definitions can mess up our modules. + +\ifnocontextobject \donetrue \do \newif\ifdone \fi + +% no time now, will do a better test later (based on dimendef) + +\def\!!stringa{plain} \ifx\!!stringa\fmtname \donetrue \else +\def\!!stringa{eplain} \ifx\!!stringa\fmtname \donetrue \else +\def\!!stringa{babel-plain} \ifx\!!stringa\fmtname \donetrue \else + \donefalse \fi \fi \fi + +\ifdone + % plain defines some 15 dimens, so we need to define a few + % dummies in order to get out of the scratch area + \newdimen\scratchdimen % 16 + \newdimen\scratchdimen % 17 + \newdimen\scratchdimen % 18 + \newdimen\scratchdimen % 19 + \newdimen\scratchdimen % 20 + \newdimen\scratchdimen % 21 +\fi + +\def\stripnewabove#1% + {\ifnum10<9#1 #1\else\expandafter\stripnewabove\fi}% + +\def\newabove\csname#1\endcsname#2% \dimen \name + {\csname#1\endcsname#2% + \ifnum\expandafter\stripnewabove\meaning#2>20\else + \newabove\csname#1\endcsname#2% + \fi} + +\ifnocontextobject \scratchcounter \do \newabove \csname newcount\endcsname \scratchcounter \fi +\ifnocontextobject \scratchtoks \do \newabove \csname newtoks\endcsname \scratchtoks \fi +\ifnocontextobject \scratchdimen \do \newabove \csname newdimen\endcsname \scratchdimen \fi +\ifnocontextobject \scratchskip \do \newabove \csname newskip\endcsname \scratchskip \fi +\ifnocontextobject \scratchmuskip \do \newabove \csname newmuskip\endcsname \scratchmuskip \fi +\ifnocontextobject \scratchbox \do \csname newbox\endcsname \scratchbox \fi +\ifnocontextobject \scratchread \do \csname newread\endcsname \scratchread \fi +\ifnocontextobject \scratchwrite \do \csname newwrite\endcsname \scratchwrite \fi + +%D Watch out, in the past we ran into troubles with \type {\onepoint} +%D (and others) mening something different in \LATEX\ then here. In +%D such situations clashes are bound to happen. For this reason the +%D assignments are no inside the test. We try to catch those situations +%D but we cannot keep ahead of the future. + +\ifnocontextobject \zeropoint \do \newdimen \zeropoint \zeropoint = 0pt \fi % else problems with dimen12 +\ifnocontextobject \onepoint \do \newdimen \onepoint \onepoint = 1pt \fi +\ifnocontextobject \onebasepoint \do \newdimen \onebasepoint \onebasepoint = 1bp \fi +\ifnocontextobject \zerocount \do \chardef \zerocount = 0 \fi +\ifnocontextobject \plusone \do \chardef \plusone = 1 \fi +\ifnocontextobject \minusone \do \newcount \minusone \minusone = -1 \fi +\ifnocontextobject \thousandpoint \do \newdimen \thousandpoint \thousandpoint = 1000pt \fi +\ifnocontextobject \onerealpoint \do \newdimen \onerealpoint \onerealpoint = 1pt \fi % latex has a funny \onepoint + +\ifnocontextobject \emptytoks \do \newtoks \emptytoks \fi +\ifnocontextobject \nextbox \do \newbox \nextbox \fi +\ifnocontextobject \nextdepth \do \newdimen \nextdepth \fi + +\ifnocontextobject \CONTEXTtrue \do \newif\ifCONTEXT \fi +\ifnocontextobject \eightbitcharacterstrue \do \newif\ifeightbitcharacters \fi +\ifnocontextobject \MPdrawingdonetrue \do \newif\ifMPdrawingdone \fi + +\ifnocontextobject \ifzeropt \do \let\ifzeropt\ifcase \fi + +%D \macros +%D {@@...} +%D +%D We use symbolic name for \CATCODES. They can only be used +%D when we are in unprotected state. + +\ifnocontextobject \@@escape \do \chardef\@@escape = 0 \fi +\ifnocontextobject \@@begingroup \do \chardef\@@begingroup = 1 \fi +\ifnocontextobject \@@endgroup \do \chardef\@@endgroup = 2 \fi +\ifnocontextobject \@@endofline \do \chardef\@@endofline = 5 \fi +\ifnocontextobject \@@ignore \do \chardef\@@ignore = 9 \fi +\ifnocontextobject \@@space \do \chardef\@@space = 10 \fi +\ifnocontextobject \@@letter \do \chardef\@@letter = 11 \fi +\ifnocontextobject \@@other \do \chardef\@@other = 12 \fi +\ifnocontextobject \@@active \do \chardef\@@active = 13 \fi +\ifnocontextobject \@@comment \do \chardef\@@comment = 14 \fi + +\def\s!sp{sp} +\def\s!pt{pt} +\def\s!bp{bp} + +%D \macros +%D {@EA,expanded,expandoneargafter,expandtwoargsafter} +%D +%D Also needed: + +\let\@EA=\expandafter \let\@@expanded\empty + +\def\expanded#1% + {\long\xdef\@@expanded{\noexpand#1}\@@expanded} + +\def\expandoneargafter#1#2% + {\@EA#1\@EA{#2}} + +\def\expandtwoargsafter#1#2#3% + {\@EA\@EA\@EA#1\@EA\@EA\@EA{\@EA#2\@EA}\@EA{#3}} + +\def\@EAEAEA{\@EA\@EA\@EA} + +%D \macros +%D {everyline,EveryLine,EveryPar} +%D +%D In \CONTEXT\ we use \type{\everypar} for special purposes +%D and provide \type{\EveryPar} as an alternative. The same +%D goes for \type{\everyline} and \type{\EveryLine}. + +\ifnocontextobject \everyline \do \newtoks\everyline \fi +\ifnocontextobject \EveryPar \do \let\EveryPar =\everypar \fi +\ifnocontextobject \EveryLine \do \let\EveryLine=\everyline \fi + +%D \macros +%D {globallet} + +\def\globallet{\global\let} + +%D \macros +%D {!!...} +%D +%D We reserve ourselves some scratch strings (i.e. macros) +%D and some more counters. + +\ifnocontextobject \!!stringa \do \def\!!stringa {} \fi +\ifnocontextobject \!!stringb \do \def\!!stringb {} \fi +\ifnocontextobject \!!stringc \do \def\!!stringc {} \fi +\ifnocontextobject \!!stringd \do \def\!!stringd {} \fi + +\ifnocontextobject \!!counta \do \newcount\!!counta {} \fi +\ifnocontextobject \!!countb \do \newcount\!!countb {} \fi + +%D \macros +%D {!!...} +%D +%D The next set of definitions speed up processing a bit. +%D Furthermore it saves memory. + +\ifnocontextobject \!!zeropoint \do \def\!!zeropoint {0pt} \fi +\ifnocontextobject \!!zerocount \do \def\!!zerocount {0} \fi +\ifnocontextobject \!!tenthousand \do \def\!!tenthousand {10000} \fi + +\ifnocontextobject \!!width \do \def\!!width {width} \fi +\ifnocontextobject \!!height \do \def\!!height {height} \fi +\ifnocontextobject \!!depth \do \def\!!depth {depth} \fi + +\ifnocontextobject \!!plus \do \def\!!plus {plus} \fi +\ifnocontextobject \!!minus \do \def\!!minus {minus} \fi +\ifnocontextobject \!!to \do \def\!!to {to} \fi + +%D \macros +%D {smashbox} +%D +%D The system modules offer a range of smashing macros, of +%D which we only copied \type{\smashbox}. + +\ifnocontextobject \smashbox \do + + \def\smashbox#1% + {\wd#1\zeropoint + \ht#1\zeropoint + \dp#1\zeropoint} + +\fi + +%D \macros +%D {dowithnextbox} +%D +%D Also without further comment, we introduce a macro that +%D gets the next box and does something usefull with it. +%D Because the \type{\afterassignment} is executed inside the +%D box, we have to use a \type{\aftergroup} too. + +\ifnocontextobject \dowithnextbox \do + + \def\dowithnextbox#1% + {\def\dodowithnextbox{#1}% + \afterassignment\dododowithnextbox + \setbox\nextbox} + + \def\dododowithnextbox% + {\aftergroup\dodowithnextbox} + +\fi + +%D \macros +%D {setvalue,setevalue,setxvalue,,setgvalue, +%D getvalue, +%D letvalue,letgvalue} +%D +%D The next two macros expand their argument to +%D \type{\argument}. The first one is used to define macro's +%D the second one executes them. + +\ifnocontextobject \setvalue \do + + \def\setvalue #1{\expandafter\def\csname#1\endcsname} + \def\setevalue#1{\expandafter\edef\csname#1\endcsname} + \def\setgvalue#1{\expandafter\gdef\csname#1\endcsname} + \def\setxvalue#1{\expandafter\xdef\csname#1\endcsname} + \def\getvalue #1{\csname#1\endcsname} + \def\letvalue #1{\expandafter\let\csname#1\endcsname} + \def\letgvalue#1{\global\expandafter\let\csname#1\endcsname} +\fi + +%D \macros +%D {unexpanded} +%D +%D The next command can be used as prefixed for commands that +%D need protection during tests and writing to files. This +%D is a very \CONTEXT\ specific one. + +\ifnocontextobject \unexpanded \do + + \let\unexpanded\relax + +\fi + +%D \macros +%D {convertargument} +%D +%D The original one offers a bit more, like global assignment, the +%D the next implementation is however a bit more byte saving. + +\ifnocontextobject \convertargument \do + + \def\doconvertargument#1>{} + + \long\def\convertargument#1\to#2% + {\long\def\@@convertedargument{#1}% + \edef#2{\expandafter\doconvertargument\meaning\@@convertedargument}} + +\fi + +%D \macros +%D {forgetall} +%D +%D Sometimes we have to disable interference of whatever kind +%D of skips and mechanisms. The next macro resets some. + +\ifnocontextobject \forgetall \do + + \def\forgetall + {\parskip\zeropoint + \leftskip\zeropoint + \parindent\zeropoint + \everypar{}} + +\fi + +%D \macros +%D {withoutpt, +%D ScaledPointsToBigPoints,ScaledPointsToWholeBigPoints} +%D +%D \TEX\ lacks some real datastructure. We can however use +%D \DIMENSIONS. This kind of trickery is needed when we want +%D \TEX\ to communicate with the outside world (by means of +%D \type{\specials}). + +\ifnocontextobject \withoutpt \do + + {\catcode`\.=\@@other + \catcode`\p=\@@other + \catcode`\t=\@@other + \gdef\WITHOUTPT#1pt{#1}} + + \def\withoutpt#1% + {\expandafter\WITHOUTPT#1} + + \def\ScaledPointsToBigPoints#1#2% + {\scratchdimen=#1sp\relax + \scratchdimen=.996264\scratchdimen + \edef#2{\withoutpt{\the\scratchdimen}}} + + \def\ScaledPointsToWholeBigPoints#1#2% + {\scratchdimen=#1sp + \scratchdimen=.996264\scratchdimen + \scratchcounter=\scratchdimen + \advance\scratchcounter by 32768 + \divide\scratchcounter by 65536 + \edef#2{\the\scratchcounter}} + +\fi + +%D \macros +%D {doprocessfile} +%D +%D This macro takes three arguments: the file number, the +%D filename and a macro that handles the content of a read +%D line. + +\newif\iffileprocessed + +\ifnocontextobject \doprocessfile \do + + \def\doprocessfile#1#2#3% + {\openin#1=#2\relax + \ifeof#1% + \fileprocessedfalse + \closein#1\relax + \else + \fileprocessedtrue + \gdef\dofinishfile% + {\closein#1\relax + \global\let\doprocessline\relax}% + \gdef\doprocessline% + {\ifeof#1% + \dofinishfile + \else + \global\read#1 to \fileline + #3\relax + \expandafter\doprocessline + \fi}% + \expandafter\doprocessline + \fi} + +\fi + +%D \macros +%D {uncatcodespecials} +%D +%D This one is taken from the \TEX\ book. The \CONTEXT\ +%D alternative is a bit different, but we hope this one works +%D here. + +\ifx\dospecials\undefined + + \def\dospecials + {\do\ \do\\\do\{\do\}\do\$% + \do\#\do\^\do\_\do\&\do\%% + \do\~\do\^^A\do\^^K} + +\fi + +\ifnocontextobject \uncatcodespecials \do + + \def\uncatcodespecials + {\def\do##1{\catcode`##1=12 }\dospecials + \catcode`\ =\@@space + \catcode`\^^L=\@@ignore + \catcode`\^^M=\@@endofline + \catcode`\^^?=\@@ignore} + +\fi + +\ifnocontextobject \setnaturalcatcodes \do + +\def\setnaturalcatcodes + {\catcode`\!=\@@other \catcode`\?=\@@other \catcode`\@=\@@other + \catcode`\#=\@@other \catcode`\&=\@@other \catcode`\|=\@@other + \catcode`\$=\@@other \catcode`\^=\@@other \catcode`\_=\@@other + \catcode`\*=\@@other \catcode`\/=\@@other + \catcode`\-=\@@other \catcode`+=\@@other + \catcode`\==\@@other \catcode`\<=\@@other \catcode`\>=\@@other + \catcode`\"=\@@other \catcode`\'=\@@other \catcode`\`=\@@other + \catcode`\:=\@@other \catcode`\;=\@@other + \catcode`\,=\@@other \catcode`\.=\@@other \catcode`\~=\@@other + \catcode`\(=\@@other \catcode`\)=\@@other + \catcode`\{=\@@other \catcode`\}=\@@other + \catcode`\\=\@@other \catcode`\%=\@@other } + +\fi + +%D \macros +%D {doglobal} +%D +%D Some \CONTEXT\ low level macros can have a \type{\doglobal} +%D prefix. Let's just forget about that here: + +\ifnocontextobject \doglobal \do \let\doglobal\relax \fi + +%D The next obscure one is needed in the generic verbatim +%D environment. When we end up with more of these, it's time +%D to load the module \type{syst-gen}. + +\ifnocontextobject \doifincsnameelse \do + + \def\dodoifincsnameelse#1#2% + {\def\dododoifincsnameelse##1#1##2##3\war% + {\csname\if##2@iffalse\else iftrue\fi\endcsname}% + \expandafter\dododoifincsnameelse#2#1@@\war} + + \long\def\doifincsnameelse#1#2#3#4% + {\edef\@@instring{#1}% + \expandafter\dodoifincsnameelse\expandafter{\@@instring}{#2}% + #3% + \else + #4% + \fi} + +\fi + +%D \macros +%D {dostepwiserecurse, dorecurse, doloop, exitloop} +%D +%D The next loop macro is a real weak one, and does not offer +%D the full \CONTEXT\ functionality, let alone nesting, but +%D for simple purposes, its behaviour is acceptable. + +\newcount\recursecounter + +\def\dostepwiserecurse#1#2#3#4% very weak and rubishly version + {\ifnum#2<#1\relax\else\dodostepwiserecurse{#1}{#2}{#3}{#4}\fi} + +\def\dodostepwiserecurse#1#2#3#4% very weak and rubishly version + {\recursecounter=#1\relax + \loop + \edef\recurselevel{\the\recursecounter}% + #4\relax + \ifnum\recursecounter<#2\relax + \advance\recursecounter by #3\relax + \repeat} + +\def\dorecurse#1% + {\dostepwiserecurse{1}{#1}{1}} + +\def\doloop + {\dostepwiserecurse{1}{\maxdimen}{1}} + +\def\exitloop + {\recursecounter=\maxdimen} + +%D \macros +%D {ifundefined,doifdefined,doifundefined, +%D doifdefinedelse,doifundefinedelse} +%D +%D These alteratives are not robust but suitable for simple +%D usage. The official ones are a bit faster. + +\ifnocontextobject \doifdefined \do + + \def\ifundefined#1% + {\expandafter\ifx\csname#1\endcsname\relax} + + \def\doifdefinedelse#1#2#3% + {\expandafter\ifx\csname#1\endcsname\relax#3\else#2\fi} + + \def\doifundefinedelse#1#2#3% + {\expandafter\ifx\csname#1\endcsname\relax#2\else#3\fi} + + \def\doifdefined#1#2% + {\expandafter\ifx\csname#1\endcsname\relax\else#2\fi} + + \def\doifundefined#1#2% + {\expandafter\ifx\csname#1\endcsname\relax#2\fi} + +\fi + +%D \macros +%D {doifinstringelse} +%D +%D It seems like we end up with more and more macros here. +%D Sigh. + +\ifnocontextobject \doifinstringelse \do + + \def\p!doifinstringelse#1#2% + {\def\pp!doifinstringelse##1#1##2##3\war% + {\csname if\if##2@fals\else tru\fi e\endcsname}% + \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} + + \long\def\doifinstringelse#1#2#3#4% + {\edef\@@@instring{#1}% + \@EA\p!doifinstringelse\@EA{\@@@instring}{#2}#3\else#4\fi} + +\fi + +%D \macros +%D {twodigitrounding} +%D +%D We don't support rounding outside \CONTEXT. Sorry. + +\def\twodigitrounding#1{#1} + +%D \macros +%D {lineheight} +%D +%D In \CONTEXT\ we have \type{\lineheight}, which in many +%D cases matches \type {\baselineskip}. + +\ifnocontextobject \lineheight \do + + \def\lineheight{\baselineskip} + +\fi + +%D \macros +%D {dohandletokens} +%D +%D The following macro is the simplified version, but good +%D enough for day to day hacks. +%D +%D \starttyping +%D \dohandletokens some text\with\somemacro +%D \stoptyping + +\ifnocontextobject \dohandletokens \do + +\def\dodohandletokens + {\ifx\next\end \else + \docommand{\next}% + \expandafter\dohandletokens + \fi} + +\def\dohandletokens + {\afterassignment\dodohandletokens\let\next= } + +\long\def\handletokens#1\with#2% + {\let\docommand=#2% + \dohandletokens#1\end} + +\fi + +%D Very reduced: + +\long\def\appendtoks#1\to#2% + {\scratchtoks{#1}\expanded{#2{\the#2\the\scratchtoks}}} + +%D Well, also handy. + +\def\doiffileelse#1#2#3% + {\immediate\openin\scratchread=#1\relax + \ifeof\scratchread + \def\next{#3}% + \else + \def\next{#2}% + \fi + \immediate\closein\scratchread + \next} + +%D New. + +\let\donothing\empty + +%D Also new: + +\def\letempty #1{\let#1\empty} +\def\globalletempty#1{\global\let#1\empty} + +\def\letvalueempty #1{\expandafter\let\csname#1\endcsname\empty} +\def\letgvalueempty#1{\global\expandafter\let\csname#1\endcsname\empty} + +%D Sigh + +\def\settrue #1{\chardef#1\zerocount} +\def\setfalse#1{\chardef#1\plusone} + +\let\newconditional = \setfalse +\let\ifconditional = \ifcase + +%D That's it. Please forget this junk and take a look at how +%D it should be done. + +\StopLatexHack \protect \endinput diff --git a/tex/context/base/supp-mis.tex b/tex/context/base/supp-mis.tex deleted file mode 100644 index 5b45d8b9d..000000000 --- a/tex/context/base/supp-mis.tex +++ /dev/null @@ -1,710 +0,0 @@ -%D \module -%D [ file=supp-mis, -%D version=2004.10.26, % 1997.01.04, -%D title=\CONTEXT\ Support Macros, -%D subtitle=Missing (For Generic Use), -%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 will clean up this module (a la supp-pdf.tex preamble). - -%D Some support modules are more or less independant. This -%D module, which is not part of plain \CONTEXT, provides the -%D missing macros and declarations of registers. - -\ifx \undefined \writestatus \else \expandafter \endinput \fi - -%D Because \LATEX\ has no safe package loading mechanism, we -%D need to take care of possible interference. - -\def\StartLatexHack % replace this by the one in supp-pdf - {\edef\StopLatexHack - {\catcode\string`\noexpand/=\the\catcode\string`/ - \catcode\string`\noexpand-=\the\catcode\string`- - \catcode\string`\noexpand:=\the\catcode\string`: - \catcode\string`\noexpand;=\the\catcode\string`; - \catcode\string`\noexpand"=\the\catcode\string`" - \catcode\string`\noexpand<=\the\catcode\string`< - \catcode\string`\noexpand>=\the\catcode\string`> - \catcode\string`\noexpand`=\the\catcode\string``}% - \catcode\string`/=12 \catcode\string`-=12 - \catcode\string`:=12 \catcode\string`;=12 - \catcode\string`"=12 \catcode\string`<=12 - \catcode\string`>=12 \catcode\string``=12 } - -%D This hack is needed especially for \LATEX\ users who use -%D the Babel package. The Germans have active \type {"}'s, the -%D Poles have \type {/}, while the French have \type {:} and -%D \type {;} defines as command (thanks to Daniel Flipo for -%D pointing that out and testing). Potentially active \type -%D {?}'s and \type {!}'s are less dangerous since they are -%D handled by the \type {\protect} and \type {\unprotect} -%D macros. - -\StartLatexHack - -%D \macros -%D {ifnocontextobject} -%D -%D First we take care of redundant defining. The next set of -%D macros are a bit complicated by the fact that Plain -%D \TEX\ defines the \type{\new}||macros as being outer. -%D Furthermore nested \type{\if}'s can get us into -%D trouble. - -\def\definecontextobject - {\iftrue} - -\def\gobblecontextobject - {\setbox0\hbox - \bgroup - \long\def\gobblecontextobject##1\fi{\egroup}% - \expandafter\gobblecontextobject\string} - -\long\def\ifnocontextobject#1\do - {\ifx#1\undefined - \expandafter\definecontextobject - \else - %\writestatus{system}{beware of conflicting \string#1}% - \expandafter\gobblecontextobject - \fi} - -%D \macros -%D {beginETEX,beginTEX} -%D -%D Outside \CONTEXT\ we will not be \ETEX||aware. - -\long\def\beginETEX #1\endETEX {} - -\let\beginTEX\relax \let\endTEX\relax - -%D \macros -%D {writestatus} -%D -%D We start each module with a message. Normally the output is -%D formatted, but here we keep things simple. - -\ifnocontextobject \writestatus \do - - \def\writestatus#1#2% - {\immediate\write16{#1 : #2}} - -\fi - -%D Let's see if it works. - -\writestatus{loading}{ConTeXt Support Macros / Miscellaneous (2004.10.26)} - -%D \macros -%D {protect,unprotect} -%D -%D Next we present a poor mans alternative for \type{\protect} -%D and \type{\unprotect}, two commands that enable us to use -%D the characters \type{@}, \type{!} and \type{?} in macro -%D names. - -\ifnocontextobject \protect \do - - \let\protect\relax - -\fi - -\newcount\protectiondepth - -\ifnocontextobject \unprotect \do - - \def\unprotect - {\advance\protectiondepth 1 - \ifnum\protectiondepth=1 - \let\normalprotect=\protect - \def\protect - {\ifnum\protectiondepth>0 - \advance\protectiondepth -1 - \ifnum\protectiondepth=0 - \doprotect - \let\protect=\normalprotect - \fi - \fi} - \edef\doprotect - {\catcode`\noexpand @=\the\catcode`@\relax - \catcode`\noexpand !=\the\catcode`!\relax - \catcode`\noexpand ?=\the\catcode`?\relax} - \catcode`@=11 - \catcode`!=11 - \catcode`?=11 - \fi} - -\fi - -%D We start using this one it at once. - -\unprotect - -%D \macros -%D {scratch...,if...,next...} -%D -%D We need some scratch registers. Users are free to use them, -%D but can never be sure of their value once another macro is -%D called. We only allocate things when they are yet -%D undefined. This way we can't mess up other macro packages, -%D but of course previous definitions can mess up our modules. - -\ifnocontextobject \donetrue \do \newif\ifdone \fi - -% no time now, will do a better test later (based on dimendef) - -\def\!!stringa{plain} \ifx\!!stringa\fmtname \donetrue \else -\def\!!stringa{eplain} \ifx\!!stringa\fmtname \donetrue \else -\def\!!stringa{babel-plain} \ifx\!!stringa\fmtname \donetrue \else - \donefalse \fi \fi \fi - -\ifdone - % plain defines some 15 dimens, so we need to define a few - % dummies in order to get out of the scratch area - \newdimen\scratchdimen % 16 - \newdimen\scratchdimen % 17 - \newdimen\scratchdimen % 18 - \newdimen\scratchdimen % 19 - \newdimen\scratchdimen % 20 - \newdimen\scratchdimen % 21 -\fi - -\def\stripnewabove#1% - {\ifnum10<9#1 #1\else\expandafter\stripnewabove\fi}% - -\def\newabove\csname#1\endcsname#2% \dimen \name - {\csname#1\endcsname#2% - \ifnum\expandafter\stripnewabove\meaning#2>20\else - \newabove\csname#1\endcsname#2% - \fi} - -\ifnocontextobject \scratchcounter \do \newabove \csname newcount\endcsname \scratchcounter \fi -\ifnocontextobject \scratchtoks \do \newabove \csname newtoks\endcsname \scratchtoks \fi -\ifnocontextobject \scratchdimen \do \newabove \csname newdimen\endcsname \scratchdimen \fi -\ifnocontextobject \scratchskip \do \newabove \csname newskip\endcsname \scratchskip \fi -\ifnocontextobject \scratchmuskip \do \newabove \csname newmuskip\endcsname \scratchmuskip \fi -\ifnocontextobject \scratchbox \do \csname newbox\endcsname \scratchbox \fi -\ifnocontextobject \scratchread \do \csname newread\endcsname \scratchread \fi -\ifnocontextobject \scratchwrite \do \csname newwrite\endcsname \scratchwrite \fi - -%D Watch out, in the past we ran into troubles with \type {\onepoint} -%D (and others) mening something different in \LATEX\ then here. In -%D such situations clashes are bound to happen. For this reason the -%D assignments are no inside the test. We try to catch those situations -%D but we cannot keep ahead of the future. - -\ifnocontextobject \zeropoint \do \newdimen \zeropoint \zeropoint = 0pt \fi % else problems with dimen12 -\ifnocontextobject \onepoint \do \newdimen \onepoint \onepoint = 1pt \fi -\ifnocontextobject \onebasepoint \do \newdimen \onebasepoint \onebasepoint = 1bp \fi -\ifnocontextobject \zerocount \do \chardef \zerocount = 0 \fi -\ifnocontextobject \plusone \do \chardef \plusone = 1 \fi -\ifnocontextobject \minusone \do \newcount \minusone \minusone = -1 \fi -\ifnocontextobject \thousandpoint \do \newdimen \thousandpoint \thousandpoint = 1000pt \fi -\ifnocontextobject \onerealpoint \do \newdimen \onerealpoint \onerealpoint = 1pt \fi % latex has a funny \onepoint - -\ifnocontextobject \emptytoks \do \newtoks \emptytoks \fi -\ifnocontextobject \nextbox \do \newbox \nextbox \fi -\ifnocontextobject \nextdepth \do \newdimen \nextdepth \fi - -\ifnocontextobject \CONTEXTtrue \do \newif\ifCONTEXT \fi -\ifnocontextobject \eightbitcharacterstrue \do \newif\ifeightbitcharacters \fi -\ifnocontextobject \MPdrawingdonetrue \do \newif\ifMPdrawingdone \fi - -\ifnocontextobject \ifzeropt \do \let\ifzeropt\ifcase \fi - -%D \macros -%D {@@...} -%D -%D We use symbolic name for \CATCODES. They can only be used -%D when we are in unprotected state. - -\ifnocontextobject \@@escape \do \chardef\@@escape = 0 \fi -\ifnocontextobject \@@begingroup \do \chardef\@@begingroup = 1 \fi -\ifnocontextobject \@@endgroup \do \chardef\@@endgroup = 2 \fi -\ifnocontextobject \@@endofline \do \chardef\@@endofline = 5 \fi -\ifnocontextobject \@@ignore \do \chardef\@@ignore = 9 \fi -\ifnocontextobject \@@space \do \chardef\@@space = 10 \fi -\ifnocontextobject \@@letter \do \chardef\@@letter = 11 \fi -\ifnocontextobject \@@other \do \chardef\@@other = 12 \fi -\ifnocontextobject \@@active \do \chardef\@@active = 13 \fi -\ifnocontextobject \@@comment \do \chardef\@@comment = 14 \fi - -\def\s!sp{sp} -\def\s!pt{pt} -\def\s!bp{bp} - -%D \macros -%D {@EA,expanded,expandoneargafter,expandtwoargsafter} -%D -%D Also needed: - -\let\@EA=\expandafter \let\@@expanded\empty - -\def\expanded#1% - {\long\xdef\@@expanded{\noexpand#1}\@@expanded} - -\def\expandoneargafter#1#2% - {\@EA#1\@EA{#2}} - -\def\expandtwoargsafter#1#2#3% - {\@EA\@EA\@EA#1\@EA\@EA\@EA{\@EA#2\@EA}\@EA{#3}} - -\def\@EAEAEA{\@EA\@EA\@EA} - -%D \macros -%D {everyline,EveryLine,EveryPar} -%D -%D In \CONTEXT\ we use \type{\everypar} for special purposes -%D and provide \type{\EveryPar} as an alternative. The same -%D goes for \type{\everyline} and \type{\EveryLine}. - -\ifnocontextobject \everyline \do \newtoks\everyline \fi -\ifnocontextobject \EveryPar \do \let\EveryPar =\everypar \fi -\ifnocontextobject \EveryLine \do \let\EveryLine=\everyline \fi - -%D \macros -%D {globallet} - -\def\globallet{\global\let} - -%D \macros -%D {!!...} -%D -%D We reserve ourselves some scratch strings (i.e. macros) -%D and some more counters. - -\ifnocontextobject \!!stringa \do \def\!!stringa {} \fi -\ifnocontextobject \!!stringb \do \def\!!stringb {} \fi -\ifnocontextobject \!!stringc \do \def\!!stringc {} \fi -\ifnocontextobject \!!stringd \do \def\!!stringd {} \fi - -\ifnocontextobject \!!counta \do \newcount\!!counta {} \fi -\ifnocontextobject \!!countb \do \newcount\!!countb {} \fi - -%D \macros -%D {!!...} -%D -%D The next set of definitions speed up processing a bit. -%D Furthermore it saves memory. - -\ifnocontextobject \!!zeropoint \do \def\!!zeropoint {0pt} \fi -\ifnocontextobject \!!zerocount \do \def\!!zerocount {0} \fi -\ifnocontextobject \!!tenthousand \do \def\!!tenthousand {10000} \fi - -\ifnocontextobject \!!width \do \def\!!width {width} \fi -\ifnocontextobject \!!height \do \def\!!height {height} \fi -\ifnocontextobject \!!depth \do \def\!!depth {depth} \fi - -\ifnocontextobject \!!plus \do \def\!!plus {plus} \fi -\ifnocontextobject \!!minus \do \def\!!minus {minus} \fi -\ifnocontextobject \!!to \do \def\!!to {to} \fi - -%D \macros -%D {smashbox} -%D -%D The system modules offer a range of smashing macros, of -%D which we only copied \type{\smashbox}. - -\ifnocontextobject \smashbox \do - - \def\smashbox#1% - {\wd#1\zeropoint - \ht#1\zeropoint - \dp#1\zeropoint} - -\fi - -%D \macros -%D {dowithnextbox} -%D -%D Also without further comment, we introduce a macro that -%D gets the next box and does something usefull with it. -%D Because the \type{\afterassignment} is executed inside the -%D box, we have to use a \type{\aftergroup} too. - -\ifnocontextobject \dowithnextbox \do - - \def\dowithnextbox#1% - {\def\dodowithnextbox{#1}% - \afterassignment\dododowithnextbox - \setbox\nextbox} - - \def\dododowithnextbox% - {\aftergroup\dodowithnextbox} - -\fi - -%D \macros -%D {setvalue,setevalue,setxvalue,,setgvalue, -%D getvalue, -%D letvalue,letgvalue} -%D -%D The next two macros expand their argument to -%D \type{\argument}. The first one is used to define macro's -%D the second one executes them. - -\ifnocontextobject \setvalue \do - - \def\setvalue #1{\expandafter\def\csname#1\endcsname} - \def\setevalue#1{\expandafter\edef\csname#1\endcsname} - \def\setgvalue#1{\expandafter\gdef\csname#1\endcsname} - \def\setxvalue#1{\expandafter\xdef\csname#1\endcsname} - \def\getvalue #1{\csname#1\endcsname} - \def\letvalue #1{\expandafter\let\csname#1\endcsname} - \def\letgvalue#1{\global\expandafter\let\csname#1\endcsname} -\fi - -%D \macros -%D {unexpanded} -%D -%D The next command can be used as prefixed for commands that -%D need protection during tests and writing to files. This -%D is a very \CONTEXT\ specific one. - -\ifnocontextobject \unexpanded \do - - \let\unexpanded\relax - -\fi - -%D \macros -%D {convertargument} -%D -%D The original one offers a bit more, like global assignment, the -%D the next implementation is however a bit more byte saving. - -\ifnocontextobject \convertargument \do - - \def\doconvertargument#1>{} - - \long\def\convertargument#1\to#2% - {\long\def\@@convertedargument{#1}% - \edef#2{\expandafter\doconvertargument\meaning\@@convertedargument}} - -\fi - -%D \macros -%D {forgetall} -%D -%D Sometimes we have to disable interference of whatever kind -%D of skips and mechanisms. The next macro resets some. - -\ifnocontextobject \forgetall \do - - \def\forgetall - {\parskip\zeropoint - \leftskip\zeropoint - \parindent\zeropoint - \everypar{}} - -\fi - -%D \macros -%D {withoutpt, -%D ScaledPointsToBigPoints,ScaledPointsToWholeBigPoints} -%D -%D \TEX\ lacks some real datastructure. We can however use -%D \DIMENSIONS. This kind of trickery is needed when we want -%D \TEX\ to communicate with the outside world (by means of -%D \type{\specials}). - -\ifnocontextobject \withoutpt \do - - {\catcode`\.=\@@other - \catcode`\p=\@@other - \catcode`\t=\@@other - \gdef\WITHOUTPT#1pt{#1}} - - \def\withoutpt#1% - {\expandafter\WITHOUTPT#1} - - \def\ScaledPointsToBigPoints#1#2% - {\scratchdimen=#1sp\relax - \scratchdimen=.996264\scratchdimen - \edef#2{\withoutpt{\the\scratchdimen}}} - - \def\ScaledPointsToWholeBigPoints#1#2% - {\scratchdimen=#1sp - \scratchdimen=.996264\scratchdimen - \scratchcounter=\scratchdimen - \advance\scratchcounter by 32768 - \divide\scratchcounter by 65536 - \edef#2{\the\scratchcounter}} - -\fi - -%D \macros -%D {doprocessfile} -%D -%D This macro takes three arguments: the file number, the -%D filename and a macro that handles the content of a read -%D line. - -\newif\iffileprocessed - -\ifnocontextobject \doprocessfile \do - - \def\doprocessfile#1#2#3% - {\openin#1=#2\relax - \ifeof#1% - \fileprocessedfalse - \closein#1\relax - \else - \fileprocessedtrue - \gdef\dofinishfile% - {\closein#1\relax - \global\let\doprocessline\relax}% - \gdef\doprocessline% - {\ifeof#1% - \dofinishfile - \else - \global\read#1 to \fileline - #3\relax - \expandafter\doprocessline - \fi}% - \expandafter\doprocessline - \fi} - -\fi - -%D \macros -%D {uncatcodespecials} -%D -%D This one is taken from the \TEX\ book. The \CONTEXT\ -%D alternative is a bit different, but we hope this one works -%D here. - -\ifx\dospecials\undefined - - \def\dospecials - {\do\ \do\\\do\{\do\}\do\$% - \do\#\do\^\do\_\do\&\do\%% - \do\~\do\^^A\do\^^K} - -\fi - -\ifnocontextobject \uncatcodespecials \do - - \def\uncatcodespecials - {\def\do##1{\catcode`##1=12 }\dospecials - \catcode`\ =\@@space - \catcode`\^^L=\@@ignore - \catcode`\^^M=\@@endofline - \catcode`\^^?=\@@ignore} - -\fi - -\ifnocontextobject \setnaturalcatcodes \do - -\def\setnaturalcatcodes - {\catcode`\!=\@@other \catcode`\?=\@@other \catcode`\@=\@@other - \catcode`\#=\@@other \catcode`\&=\@@other \catcode`\|=\@@other - \catcode`\$=\@@other \catcode`\^=\@@other \catcode`\_=\@@other - \catcode`\*=\@@other \catcode`\/=\@@other - \catcode`\-=\@@other \catcode`+=\@@other - \catcode`\==\@@other \catcode`\<=\@@other \catcode`\>=\@@other - \catcode`\"=\@@other \catcode`\'=\@@other \catcode`\`=\@@other - \catcode`\:=\@@other \catcode`\;=\@@other - \catcode`\,=\@@other \catcode`\.=\@@other \catcode`\~=\@@other - \catcode`\(=\@@other \catcode`\)=\@@other - \catcode`\{=\@@other \catcode`\}=\@@other - \catcode`\\=\@@other \catcode`\%=\@@other } - -\fi - -%D \macros -%D {doglobal} -%D -%D Some \CONTEXT\ low level macros can have a \type{\doglobal} -%D prefix. Let's just forget about that here: - -\ifnocontextobject \doglobal \do \let\doglobal\relax \fi - -%D The next obscure one is needed in the generic verbatim -%D environment. When we end up with more of these, it's time -%D to load the module \type{syst-gen}. - -\ifnocontextobject \doifincsnameelse \do - - \def\dodoifincsnameelse#1#2% - {\def\dododoifincsnameelse##1#1##2##3\war% - {\csname\if##2@iffalse\else iftrue\fi\endcsname}% - \expandafter\dododoifincsnameelse#2#1@@\war} - - \long\def\doifincsnameelse#1#2#3#4% - {\edef\@@instring{#1}% - \expandafter\dodoifincsnameelse\expandafter{\@@instring}{#2}% - #3% - \else - #4% - \fi} - -\fi - -%D \macros -%D {dostepwiserecurse, dorecurse, doloop, exitloop} -%D -%D The next loop macro is a real weak one, and does not offer -%D the full \CONTEXT\ functionality, let alone nesting, but -%D for simple purposes, its behaviour is acceptable. - -\newcount\recursecounter - -\def\dostepwiserecurse#1#2#3#4% very weak and rubishly version - {\ifnum#2<#1\relax\else\dodostepwiserecurse{#1}{#2}{#3}{#4}\fi} - -\def\dodostepwiserecurse#1#2#3#4% very weak and rubishly version - {\recursecounter=#1\relax - \loop - \edef\recurselevel{\the\recursecounter}% - #4\relax - \ifnum\recursecounter<#2\relax - \advance\recursecounter by #3\relax - \repeat} - -\def\dorecurse#1% - {\dostepwiserecurse{1}{#1}{1}} - -\def\doloop - {\dostepwiserecurse{1}{\maxdimen}{1}} - -\def\exitloop - {\recursecounter=\maxdimen} - -%D \macros -%D {ifundefined,doifdefined,doifundefined, -%D doifdefinedelse,doifundefinedelse} -%D -%D These alteratives are not robust but suitable for simple -%D usage. The official ones are a bit faster. - -\ifnocontextobject \doifdefined \do - - \def\ifundefined#1% - {\expandafter\ifx\csname#1\endcsname\relax} - - \def\doifdefinedelse#1#2#3% - {\expandafter\ifx\csname#1\endcsname\relax#3\else#2\fi} - - \def\doifundefinedelse#1#2#3% - {\expandafter\ifx\csname#1\endcsname\relax#2\else#3\fi} - - \def\doifdefined#1#2% - {\expandafter\ifx\csname#1\endcsname\relax\else#2\fi} - - \def\doifundefined#1#2% - {\expandafter\ifx\csname#1\endcsname\relax#2\fi} - -\fi - -%D \macros -%D {doifinstringelse} -%D -%D It seems like we end up with more and more macros here. -%D Sigh. - -\ifnocontextobject \doifinstringelse \do - - \def\p!doifinstringelse#1#2% - {\def\pp!doifinstringelse##1#1##2##3\war% - {\csname if\if##2@fals\else tru\fi e\endcsname}% - \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} - - \long\def\doifinstringelse#1#2#3#4% - {\edef\@@@instring{#1}% - \@EA\p!doifinstringelse\@EA{\@@@instring}{#2}#3\else#4\fi} - -\fi - -%D \macros -%D {twodigitrounding} -%D -%D We don't support rounding outside \CONTEXT. Sorry. - -\def\twodigitrounding#1{#1} - -%D \macros -%D {lineheight} -%D -%D In \CONTEXT\ we have \type{\lineheight}, which in many -%D cases matches \type {\baselineskip}. - -\ifnocontextobject \lineheight \do - - \def\lineheight{\baselineskip} - -\fi - -%D \macros -%D {dohandletokens} -%D -%D The following macro is the simplified version, but good -%D enough for day to day hacks. -%D -%D \starttyping -%D \dohandletokens some text\with\somemacro -%D \stoptyping - -\ifnocontextobject \dohandletokens \do - -\def\dodohandletokens - {\ifx\next\end \else - \docommand{\next}% - \expandafter\dohandletokens - \fi} - -\def\dohandletokens - {\afterassignment\dodohandletokens\let\next= } - -\long\def\handletokens#1\with#2% - {\let\docommand=#2% - \dohandletokens#1\end} - -\fi - -%D Very reduced: - -\long\def\appendtoks#1\to#2% - {\scratchtoks{#1}\expanded{#2{\the#2\the\scratchtoks}}} - -%D Well, also handy. - -\def\doiffileelse#1#2#3% - {\immediate\openin\scratchread=#1\relax - \ifeof\scratchread - \def\next{#3}% - \else - \def\next{#2}% - \fi - \immediate\closein\scratchread - \next} - -%D New. - -\let\donothing\empty - -%D Also new: - -\def\letempty #1{\let#1\empty} -\def\globalletempty#1{\global\let#1\empty} - -\def\letvalueempty #1{\expandafter\let\csname#1\endcsname\empty} -\def\letgvalueempty#1{\global\expandafter\let\csname#1\endcsname\empty} - -%D Sigh - -\def\settrue #1{\chardef#1\zerocount} -\def\setfalse#1{\chardef#1\plusone} - -\let\newconditional = \setfalse -\let\ifconditional = \ifcase - -%D That's it. Please forget this junk and take a look at how -%D it should be done. - -\StopLatexHack \protect \endinput diff --git a/tex/context/base/supp-mpe.mkii b/tex/context/base/supp-mpe.mkii new file mode 100644 index 000000000..67b27919c --- /dev/null +++ b/tex/context/base/supp-mpe.mkii @@ -0,0 +1,1370 @@ +%D \module +%D [ file=supp-mpe, +%D version=1999.07.10, +%D title=\CONTEXT\ Support Macros, +%D subtitle=METAPOST Special Extensions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% fuzzy and complicating is the fact that we need to support +% context as well as mptopdf, so we cannot fall back on the +% special drivers and color module (although there may be +% good reasons to use a smaller context instead); also, +% shading is handled here while it should move to the special +% driver - to do! + +%D This module is still experimental and deals with some +%D extensions to \METAPOST. When using \POSTSCRIPT\ output, +%D these extensions can be supplied by means of proper +%D preamble definitions, but when producing \PDF\ we have to +%D set up the appropriate datastructures ourselves. It acts as +%D a plug in into \type {supp-pdf}. As soon as we need more +%D extensions, we will generalize these macro. Some +%D definitions will move to the special drivers. + +%D For usage in plain \TEX, say something: +%D +%D \starttyping +%D \input supp-pdf +%D \input supp-mpe +%D +%D \MPcmykcolorstrue +%D \MPspotcolorstrue +%D \chardef\makeMPintoPDFobject\plusone +%D \stoptyping + +\ifx\writestatus\undefined + \immediate\write16{[Loading MPS to PDF extensions.]} +\else + \writestatus{loading}{ConTeXt Support Macros / MPS extensions} +\fi + +%D We implement extensions by using the \METAPOST\ special +%D mechanism. Opposite to \TEX's specials, the \METAPOST\ ones +%D are flushed before or after the graphic data, but thereby +%D are no longer connected to a position. +%D +%D We implement specials by overloading the \type {fill} +%D operator. By counting the fills, we can let the converter +%D treat the appropriate fill in a special way. The +%D specification of the speciality can have two forms, +%D determined by the setting of a boolean variable: +%D +%D \starttyping +%D _inline_specials_ := false ; % comment like code (default) +%D _inline_specials_ := true ; % command like code +%D \stoptyping +%D +%D When the specification is embedded as comment, it looks +%D like: +%D +%D \starttyping +%D %%MetaPostSpecial +%D \stoptyping +%D +%D The in||line alternative is more tuned for \POSTSCRIPT, +%D since it permits us to define a macro \type {special}. +%D +%D \starttyping +%D inline : special +%D \stoptyping +%D +%D The \type {identifier} determines what to do, and the data +%D can be used to accomplish this. A type~2 shading function +%D has identifier~2. Alltogether, the number of parameters is +%D specified in \type {size}. The \type {number} is the number +%D of the fill that needs the special treatment. For a type~2 +%D and~3 shaded fill, the datablock contains the following + +%D data: +%D +%D \starttyping +%D from to n inner_r g b x y outer_r g b x y +%D from to n inner_r g b x y radius outer_r g b x y radius +%D \stoptyping +%D +%D The implementation below saves the data on the stack in +%D a way similar to the macros in \type {supp-pdf.tex}, and +%D just overload a few already defined handlers. That way, +%D the existing macros are still generic. \footnote {Actually, +%D the macros here are just as generic.} +%D +%D Currently the only extension concerns shading, which is +%D accomplished by handling yet another value of \type +%D {\finiMPpath}. The recource disctionary is stored and +%D later picked up by the general \CONTEXT\ figure inclusion +%D macros. + +\unprotect + +%D The \type {%%MetaPostSpecials: version.revision signal} line +%D triggers this module into handling color specifications kind +%D of special. We need this safeguard for non||special +%D usage. + +\chardef\MPspecialversion = 0 % specials when >1 +\chardef\MPspecialrevision = 0 % specials when >1 +\chardef\MPspecialsignal = 0 % passed on by graphic + +\chardef\inlineMPspecials = 1 % only needed for stack resetting + +%D This macro handles the special definitions that are +%D passed as comment. + +\def\dohandleMPspecialcomment#1 + {\setMPargument{#1}% + \advance\scratchcounter \minusone + \ifcase\scratchcounter + \handleMPspecialcommand + \donetrue + \doresetMPstack + \let\handleMPsequence\dohandleMPsequence + \expandafter\handleMPsequence + \else + \expandafter\dohandleMPspecialcomment + \fi} + +\def\handleMPspecialcomment #1 % number of arguments + {\doresetMPstack + \scratchcounter#1\relax + \ifcase\scratchcounter % when zero, inline shading is used + \chardef\inlineMPspecials\plusone + \let\handleMPsequence\dohandleMPsequence + \expandafter\handleMPsequence + \else + \chardef\inlineMPspecials\zerocount + \expandafter\dohandleMPspecialcomment + \fi} + +%D When defined inline, we use another macro to handle the +%D definitions. Actually, this macro is called by the +%D previous ones. + +\def\handleMPspecialcommand + {\ifcase\inlineMPspecials\or + \advance\nofMParguments \minusone % pop the size + \fi + \ifundefined\MPspecial + \message{[unknown \MPspecial]}% + \else + \csname\MPspecial\endcsname + \fi + \ifcase\inlineMPspecials + \doresetMPstack % 0 + \else + \resetMPstack % 1 + \fi} + +%D This macro triggers special support. Currently, the +%D version and revision number are not used. Any version number +%D greater than zero will enable special support. + +\newconditional\manyMPspecials % \settrue\manyMPspecials + +\def\handleMPspecialscomment #1.#2 #3 % version.revision signal #4=div=1000|10000 + {\doresetMPstack + \chardef\MPspecialversion #1% + \chardef\MPspecialrevision#2% + \chardef\MPspecialsignal #3% + \let\handleMPsequence\dohandleMPsequence + \ifnum#1=\plusone + \expandafter\handleMPsequence + \else + \expandafter\handleMPspecialscommentx + \fi} + +\def\handleMPspecialscommentx #1 % version 2 +% {\doifelsedoifelse{#1}{10000}{\settrue\manyMPspecials}{\setfalse\manyMPspecials}% local + {\ifnum10000=0#1\relax + \settrue \manyMPspecials + \else + \setfalse\manyMPspecials + \fi + \setMPextensions + \handleMPsequence} + +% one can say (in meta-ini): +% +% \prependtoks +% _special_div_ := 1000\ifconditional\manyMPspecials0\fi ; +% \to \MPextensions + +%D In case of \PDF, we need to prepare resourcs. + +\newtoks\MPstartresources +\newtoks\MPstopresources + +\def\startMPresources + {\the\MPstartresources + \ifx\currentPDFresources\empty\else + \message{[unused resources]}% + \fi + \global\let\currentPDFresources\empty} + +\def\stopMPresources + {\let\currentPDFresources\empty + \the\MPstopresources} + +%D Since colors are not subjected to transformations, we can +%D only use colors as signal. In our case, we use a dummy colored +%D path with a red color component of \type {0.n}, so \type +%D {0.001} is the first path and \type {0.010} the tenth. Since +%D \METAPOST strips trailing zeros, we have to padd the string. + +\newif\ifMPcmykcolors +\newif\ifMPspotcolors + +\ifx\normalhandleMPrgbcolor\undefined % in case we reload this module + + \let\normalhandleMPrgbcolor \handleMPrgbcolor + \let\normalhandleMPcmykcolor\handleMPcmykcolor + \let\normalhandleMPgraycolor\handleMPgraycolor + \let\normalhandleMPspotcolor\handleMPspotcolor + +\fi + +%D When we are using \CONTEXT, we will fall back to the +%D better color conversion routines. This also has the advantage +%D that we don't have to parse and convert the file. In this +%D alternative, \type {\!MP} is not (yet) supported. Because +%D we can (for efficiency reasons) turn off strokecolor, +%D something we cannot do in \METAPOST\ converted code. + +\newif\ifPDFMPstrokecolor \PDFMPstrokecolortrue + +%D [This code should move to meta-ini.] + +\ifCONTEXT % we can use this for a better xgstate handling + + \def\checkPDFMPstrokecolor + {\ifPDFMPstrokecolor \PDFstrokecolortrue \fi} + + \def\normalhandleMPrgbcolor + {{\checkPDFMPstrokecolor\execcolorR\gMPa1:\gMPa2:\gMPa3:0:0\od}} + + \def\normalhandleMPcmykcolor + {{\checkPDFMPstrokecolor\execcolorC\gMPa1:\gMPa2:\gMPa3:\gMPa4:0:0\od}} + + \def\normalhandleMPgraycolor + {{\checkPDFMPstrokecolor\execcolorS\gMPa1:0:0\od}} + +% \def\normalhandleMPspotcolor +% {{\checkPDFMPstrokecolor\execcolorP\gMPa1:\gMPa2:0:0\od}} + + \def\normalhandleMPspotcolor % ??? + {{\checkPDFMPstrokecolor\execcolorP\gMPa1:\gMPa2:\gMPa3:\gMPa4:0:0\od}} + +\fi + +% In the previous macros we use the special drivers. A more +% direct approach would have been: +% +% \def\doPDFstartrgbcolormode#1#2#3% +% {\PDFcode{#1 #2 #3 rg #1 #2 #3 RG}} +% +% \def\doPDFstartcmykcolormode#1#2#3#4% +% {\PDFcode{#1 #2 #3 #4 k #1 #2 #3 #4 K}} +% +% \def\doPDFstartgraycolormode#1% +% {\PDFcode{#1 g #1 G}} +% +% \appendtoks +% \let\dostartrgbcolormode \doPDFstartrgbcolormode +% \let\dostartcmykcolormode\doPDFstartcmykcolormode +% \let\dostartgraycolormode\doPDFstartgraycolormode +% \to \everyMPtoPDFconversion + +%D Now we can handle special color signals. We only do this +%D when special are detected. + +% \def\MPrgbnumber#1{\expandafter\doMPrgbnumber#1000.0000\relax} +% \def\doMPrgbnumber#1.#2#3#4#5\relax{#2#3#4} + +%D We cannot use \type {\everyMPtoPDFconversion} because in \MPTOPDF\ +%D we don't have the \type {\appendtoks} macro available. + +\def\setMPextensions + {\ifconditional\manyMPspecials + \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##10000.00000\relax}% + \def\doMPrgbnumber##1.##2##3##4##5##6\relax{##2##3##4##5}% + \else + \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##1000.0000\relax}% + \def\doMPrgbnumber##1.##2##3##4##5\relax{##2##3##4}% + \fi} + +%D The naive case looks like: +%D +%D \starttyping +%D \def\handleMPrgbcolor% +%D {\setMPcolor +%D \ifcase\MPspecialversion +%D \resetMPcolor\normalhandleMPrgbcolor +%D \else\ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal +%D % consider it to be a signal +%D \else +%D \resetMPcolor\normalhandleMPrgbcolor +%D \fi\fi} +%D \stoptyping +%D +%D However, since we want \CMYK\ support, we will use the +%D following implementation: + +% \def\setMPcolor +% {\edef\lastMPrvalue{\gMPa1}% +% \edef\lastMPgvalue{\gMPa2}% +% \edef\lastMPbvalue{\gMPa3}} +% +% speed up (hardly called, so no let is needed) + +\def\setMPcolor + {\edef\lastMPrvalue{\csname\@@MP01\endcsname}% + \edef\lastMPgvalue{\csname\@@MP02\endcsname}% + \edef\lastMPbvalue{\csname\@@MP03\endcsname}} + +\def\zeroMPrgbvalue{0.0} + +\def\resetMPcolor + {\let\lastMPrvalue\zeroMPrgbvalue + \let\lastMPgvalue\zeroMPrgbvalue + \let\lastMPbvalue\zeroMPrgbvalue} + +\resetMPcolor + +\def\@@MPSK{@MPSK@} +\def\@@MPSP{@MPSP@} + +\def\interceptMPcmykcolor % todo : \ifMPcmykcolors + {\ifcase\MPrgbnumber\lastMPgvalue + % cannot happen + \or + % 1 == cmyk color spec + \ifMPcmykcolors \dointerceptMPcmykcolor \fi + \or + % 2 == spot color + \ifMPspotcolors \dointerceptMPspotcolor \fi + \or + % 3 == rgb transparency + \invokeMPtransparencyspecial + \or + % 4 == cmyk transparency + \ifMPcmykcolors \invokeMPtransparencyspecial \fi + \or + % 5 == spot transparency + \ifMPspotcolors \invokeMPtransparencyspecial \fi + \else + % \writestatus{MPtoPDF}{unknown direct special}% + \fi} + +% ifcsname + +\def\dointerceptMPcmykcolor + {\revokeMPtransparencyspecial + \@EA\ifx\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else + \@EA\@EA\@EA\setMPcmyk\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname + \normalhandleMPcmykcolor + \fi} + +\def\dointerceptMPspotcolor + {\revokeMPtransparencyspecial + \@EA\ifx\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else + \@EA\@EA\@EA\setMPspot\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname + \normalhandleMPspotcolor + \fi} + +\def\handleMPrgbcolor + {\resetMPcolor + \ifcase\MPspecialversion + \normalhandleMPrgbcolor + \else + \setMPcolor + \ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal\relax + \interceptMPcmykcolor + \else + \revokeMPtransparencyspecial + \normalhandleMPrgbcolor + \fi + \fi} + +\def\handleMPgraycolor + {\resetMPcolor + \ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi + \normalhandleMPgraycolor} + +\def\handleMPcmykcolor + {\resetMPcolor + \ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi + \normalhandleMPcmykcolor} + +%D Specials are define and recalled using: + +\def\MPspecial + {MP special \gMPs\nofMParguments} + +\def\defineMPspecial#1#2% + {\setvalue{MP special #1}{#2}} + +%D The path processing macro is slightly extended. + +\newtoks \invokeMPspecials + +\def\finishMPpath + {\PDFcode + {\ifcase\finiMPpath W n\or S\or f\or B\else W n\fi + \extraMPpathcode}} + +\def\processMPpath + {\checkMPpath % ! + \ifcase\nofMPsegments\else + \let\extraMPpathcode\empty + \ifcase\MPspecialversion\else + \ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal + \ifnum\MPrgbnumber\lastMPgvalue>10 % really needed + \scratchcounter\MPrgbnumber\lastMPbvalue + \edef\currentMPspecial{\the\scratchcounter}% +\let\previousMPcolorspec\currentMPcolorspec +\edef\currentMPcolorspec{\lastMPrvalue\lastMPgvalue\lastMPbvalue}% +\ifx\previousMPcolorspec\currentMPcolorspec \else + \revokeMPtransparencyspecial +\fi + \ifnum\finiMPpath=2 % to outer level + \the\invokeMPspecials + \fi + \fi + \fi + \fi + \flushMPpath + \closeMPpath + \finishMPpath + \fi + \let\handleMPsequence\dohandleMPsequence + \resetMPstack + \nofMPsegments0 + \handleMPsequence} + +%D Shading is an example of a more advanced graphic feature, +%D but users will seldom encounter those complications. Here +%D we only show a few simple examples, but many other +%D alternatives are possible by setting up the functions built +%D in \PDF\ in the appropriate way. +%D +%D Shading has to do with interpolation between two or more +%D points or user supplied ranges. In \PDF, the specifications +%D of a shade has to be encapsulated in objects and passed on +%D as resources. This is a \PDF\ level 1.3. feature. One can +%D simulate three dimensional shades as well and define simple +%D functions using a limited set of \POSTSCRIPT\ primitives. +%D Given the power of \METAPOST\ and these \PDF\ features, we +%D can achieve superb graphic effects. +%D +%D Since everything is hidden in \TEX\ and \METAPOST\ graphics, +%D we can stick to high level \CONTEXT\ command, as shown in +%D the following exmples. +%D +%D \startbuffer +%D \startuniqueMPgraphic{CircularShade} +%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; +%D circular_shade(p,0,.2red,.9red) ; +%D \stopuniqueMPgraphic +%D +%D \startuniqueMPgraphic{LinearShade} +%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; +%D linear_shade(p,0,.2blue,.9blue) ; +%D \stopuniqueMPgraphic +%D +%D \startuniqueMPgraphic{DuotoneShade} +%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; +%D linear_shade(p,2,.5green,.5red) ; +%D \stopuniqueMPgraphic +%D \stopbuffer +%D +%D \typebuffer +%D +%D \getbuffer +%D +%D These graphics can be hooked into the overlay mechanism, +%D which is available in many commands. +%D +%D \startbuffer +%D \defineoverlay[demo 1][\uniqueMPgraphic{CircularShade}] +%D \defineoverlay[demo 2][\uniqueMPgraphic {LinearShade}] +%D \defineoverlay[demo 3][\uniqueMPgraphic {DuotoneShade}] +%D \stopbuffer +%D +%D \typebuffer +%D +%D \getbuffer +%D +%D These backgrounds can for instance be applied to \type +%D {\framed}: +%D +%D \startbuffer +%D \setupframed[width=3cm,height=2cm,frame=off] +%D \startcombination[3*1] +%D {\framed[background=demo 1]{\bfd \white Demo 1}} {} +%D {\framed[background=demo 2]{\bfd \white Demo 2}} {} +%D {\framed[background=demo 3]{\bfd \white Demo 3}} {} +%D \stopcombination +%D \stopbuffer +%D +%D \typebuffer +%D +%D \startlinecorrection +%D \getbuffer +%D \stoplinecorrection +%D +%D There are a few more alternatives, determined by the second +%D parameter passed to \type {circular_shade} and alike. +%D +%D \def\SomeShade#1#2#3#4#5% +%D {\startuniqueMPgraphic{Shade-#1} +%D width := \overlaywidth ; +%D height := \overlayheight ; +%D path p ; p := unitsquare xscaled width yscaled height ; +%D #2_shade(p,#3,#4,#5) ; +%D \stopuniqueMPgraphic +%D \defineoverlay[Shade-#1][\uniqueMPgraphic{Shade-#1}]% +%D \framed[backgroundachtergrond=Shade-#1,width=2cm,height=2cm,frame=off]{}} +%D +%D \startlinecorrection +%D \startcombination[5*1] +%D {\SomeShade{10}{circular}{0}{.3blue}{.9blue}} {circular 0} +%D {\SomeShade{11}{circular}{1}{.3blue}{.9blue}} {circular 1} +%D {\SomeShade{12}{circular}{2}{.3blue}{.9blue}} {circular 2} +%D {\SomeShade{13}{circular}{3}{.3blue}{.9blue}} {circular 3} +%D {\SomeShade{14}{circular}{4}{.3blue}{.9blue}} {circular 4} +%D \stopcombination +%D \stoplinecorrection +%D +%D \blank +%D +%D \startlinecorrection +%D \startcombination[5*1] +%D {\SomeShade{20}{circular}{0}{.9green}{.3green}} {circular 0} +%D {\SomeShade{21}{circular}{1}{.9green}{.3green}} {circular 1} +%D {\SomeShade{22}{circular}{2}{.9green}{.3green}} {circular 2} +%D {\SomeShade{23}{circular}{3}{.9green}{.3green}} {circular 3} +%D {\SomeShade{24}{circular}{4}{.9green}{.3green}} {circular 4} +%D \stopcombination +%D \stoplinecorrection +%D +%D \blank +%D +%D \startlinecorrection +%D \startcombination[4*1] +%D {\SomeShade{30}{linear}{0}{.3red}{.9red}} {linear 0} +%D {\SomeShade{31}{linear}{1}{.3red}{.9red}} {linear 1} +%D {\SomeShade{32}{linear}{2}{.3red}{.9red}} {linear 2} +%D {\SomeShade{33}{linear}{3}{.3red}{.9red}} {linear 3} +%D \stopcombination +%D \stoplinecorrection +%D +%D These macros closely cooperate with the \METAPOST\ module +%D \type {mp-spec.mp}, which is part of the \CONTEXT\ +%D distribution. +%D +%D The low level (\PDF) implementation is based on the \TEX\ +%D based \METAPOST\ to \PDF\ converter. Shading is supported +%D by overloading the \type {fill} operator as implemented +%D earlier. In \PDF\ type~2 and~3 shading functions are +%D specified in terms of: +%D +%D \starttabulate[|Tl|l|] +%D \NC /Domain \NC sort of meeting range \NC \NR +%D \NC /C0 \NC inner shade \NC \NR +%D \NC /C1 \NC outer shade \NC \NR +%D \NC /N \NC smaller values, bigger inner circles \NC \NR +%D \stoptabulate + +\newcount\currentPDFshade % 0 % global (document wide) counter +\let\currentMPshades\empty + +\def\startMPshading#1% + {\edef\currentMPspecial{\gMPs{#1}}} + +\def\stopMPshading + {\global\advance\currentPDFshade \plusone + \setxvalue{obj:Sh:\currentMPspecial}% + {/Sh\the\currentPDFshade\space\the\pdflastobj\space0 R }% + \setxvalue{mps:Sh:\currentMPspecial}% + {\the\currentPDFshade}} + +\appendtoks + \global\let\currentMPshades\empty +\to \MPstartresources + +\appendtoks + \ifx\currentMPshades\empty \else + \xdef\currentPDFresources{\currentPDFresources + /Shading <<\currentMPshades>>}% + \fi +\to \MPstopresources + +\def\invokeMPshadespecial + {\ifundefined{mps:Sh:\currentMPspecial}\else + \edef\currentMPshade{\getvalue{obj:Sh:\currentMPspecial}}% + \doifinstringelse\currentMPshade\currentMPshades \donothing + {\xdef\currentMPshades{\currentMPshades\currentMPshade}}% + \def\extraMPpathcode{/Sh\getvalue{mps:Sh:\currentMPspecial} sh Q}% + \chardef\finiMPpath\zerocount + \PDFcode{q /Pattern cs}% + \fi} + +\appendtoks \invokeMPshadespecial \to \invokeMPspecials + +%D We need to convert the \CMYK\ specials into colors, because +%D we have to do it twice, we define a macro. + +% \def\checkMPshadingcolor#1#2#3#4#5% +% {\edef\tempMPrvalue{\csname\@@MP0#1\endcsname}% +% \edef\tempMPgvalue{\csname\@@MP0#2\endcsname}% +% \edef\tempMPbvalue{\csname\@@MP0#3\endcsname}% +% \edef#5% +% {\ifx\tempMPrvalue\tempMPgvalue +% \ifx\tempMPrvalue\tempMPbvalue +% \ifx\tempMPgvalue\tempMPbvalue +% \tempMPbvalue +% \fi +% \fi +% \fi}% +% \edef#4% todo : spotcolors +% {\ifnum\MPrgbnumber\tempMPrvalue=\MPspecialsignal\space +% \ifMPcmykcolors\getvalue{\@@MPSK\number\MPrgbnumber\tempMPbvalue}\fi +% \fi}} + +\def\checkMPshadingcolor#1#2#3#4#5% + {\edef\tempMPrvalue{\csname\@@MP0#1\endcsname}% + \edef\tempMPgvalue{\csname\@@MP0#2\endcsname}% + \edef\tempMPbvalue{\csname\@@MP0#3\endcsname}% + \global\let\MPresolvedspace\MPgrayspace + \global\let\MPresolvedcolor\!!zerocount + \ifnum\MPrgbnumber\tempMPrvalue=\MPspecialsignal\relax + \ifcase\MPrgbnumber\tempMPgvalue + \or % 1 = cmyk + \ifMPcmykcolors + \expanded{\resolveMPcmykcolor\getvalue{\@@MPSK\number\MPrgbnumber\tempMPbvalue}}\end + \fi + \or % 2 = spot + \ifMPspotcolors + \expanded{\resolveMPspotcolor\getvalue{\@@MPSP\number\MPrgbnumber\tempMPbvalue}}\end + \fi + \or + % 3 = rgb transparency + % to do + \or + % 4 == cmyk transparency + % \ifMPcmykcolors + % to do + % \fi + \or + % 5 == spot transparency + % \ifMPspotcolors + % to do + % \fi + \fi + \else + \ifx\tempMPrvalue\tempMPgvalue + \ifx\tempMPrvalue\tempMPbvalue + \expanded{\resolveMPgraycolor\tempMPbvalue}\end + \else + \expanded{\resolveMPrgbcolor\tempMPrvalue\space\tempMPgvalue\space\tempMPbvalue}\end + \fi + \else + \expanded{\resolveMPrgbcolor\tempMPrvalue\space\tempMPgvalue\space\tempMPbvalue}\end + \fi + \fi + \let#4\MPresolvedcolor + \let#5\MPresolvedspace} + +%D We also need to make sure that we have two \RGB\ or +%D \CMYK colors, since we have to set the colorspace. + +\def\setMPshadingcolors#1#2#3#4#5#6% color space + {\checkMPshadingcolor{#1}{#2}{#3}\MPshadeAc\MPshadeAs + \checkMPshadingcolor{#4}{#5}{#6}\MPshadeBc\MPshadeBs + \ifx\MPshadeAs\MPshadeBs + \let\MPshadeA\MPshadeAc + \let\MPshadeB\MPshadeBc + \let\MPshadeC\MPshadeAs + \else\ifx\MPshadeAs\MPgrayspace + \ifx\MPshadeBs\MPrgbspace + \edef\MPshadeA{\MPshadeAc\space\MPshadeAc\space\MPshadeAc}% + \else + \negatecolorcomponent\MPshadeAc + \edef\MPshadeA{0 0 0 \MPshadeAc}% + \fi + \let\MPshadeB\MPshadeBc + \let\MPshadeC\MPshadeBs + \else\ifx\MPshadeBs\MPgrayspace + \let\MPshadeA\MPshadeAc + \ifx\MPshadeAs\MPrgbspace + \edef\MPshadeB{\MPshadeBc\space\MPshadeBc\space\MPshadeBc}% + \else + \negatecolorcomponent\MPshadeBc + \edef\MPshadeB{0 0 0 \MPshadeBc}% + \fi + \let\MPshadeC\MPshadeAs + \else + % different color spaces + \def\MPshadeA{1}% + \def\MPshadeB{1}% + \let\MPshadeC\MPgrayspace + \fi\fi\fi} + +\let\MPshadeA\MPcmykWhite +\let\MPshadeB\MPcmykBlack +\let\MPshadeC\MPgrayspace + +%D The reason why this macro is a bit complicates is that we +%D handle black and white situations (otherwise we would have +%D to use \CMYK\ b/w in case of a \CMYK\ shade). + +%D Here are the special handlers: + +\defineMPspecial{30} + {\startMPshading{14}% type 2 + \setMPshadingcolors{4}{5}{6}{9}{10}{11}% + \immediate\pdfobj + {<>}% + \immediate\pdfobj + {<>}% + \stopMPshading} + +\defineMPspecial{31} + {\startMPshading{16}% type 3 + \setMPshadingcolors{4}{5}{6}{10}{11}{12}% + \immediate\pdfobj + {<>}% + \immediate\pdfobj + {<>}% + \stopMPshading} + +%D Figure inclusion is kind of strange to \METAPOST, but when +%D Santiago Muelas started discussing this with me, I was able +%D to cook up a solution using specials. + +\def\invokeMPfigurespecial% + {\getvalue{mps:gr:\currentMPspecial}} % or \relax + +\appendtoks \invokeMPfigurespecial \to \invokeMPspecials + +\defineMPspecial{10} + {\setxvalue{mps:gr:\gMPs8}% + {\noexpand\handleMPfigurespecial + {\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}% + \noexpand\setxvalue{mps:gr:\gMPs8}{}}} + +% \def\handleMPfigurespecial#1#2#3#4#5#6#7% +% {\vbox to 0pt +% {\vss +% \hbox to 0pt +% {\pdfliteral{q #1 #2 #3 #4 #5 #6 cm}% +% \pdfimage width 1bp height 1bp {#7}% maybe 10 is better +% \pdfliteral{Q}% +% \hss}}} +% +% better, since xform reuse + +\def\handleMPfigurespecial#1#2#3#4#5#6#7% todo : combine with ext fig + {\vbox to \zeropoint + {\vss + \hbox to \zeropoint + {\ifcase\pdfoutput\or % will be hooked into the special driver + \doiffileelse{#7} + {\doifundefinedelse{mps:x:#7} + {\immediate\pdfximage\!!width\onebasepoint\!!height\onebasepoint{#7}% + \setxvalue{mps:x:#7}{\pdfrefximage\the\pdflastximage}}% + {\message{[reusing figure #7]}}% + \PDFcode{q #1 #2 #3 #4 #5 #6 cm}% + \rlap{\getvalue{mps:x:#7}}% + \PDFcode{Q}} + {\message{[unknown figure #7]}}% + \fi + \hss}}} + +%D An example of using both special features is the +%D following. +%D +%D \starttyping +%D \startMPpage +%D externalfigure "hakker1b.png" scaled 22cm rotated 10 shifted (-2cm,0cm); +%D externalfigure "hakker1b.png" scaled 10cm rotated -10 ; +%D externalfigure "hakker1b.png" scaled 7cm rotated 45 shifted (8cm,12cm) ; +%D path p ; p := unitcircle xscaled 15cm yscaled 20cm; +%D path q ; q := p rotatedaround(center p,90) ; +%D path r ; r := buildcycle(p,q) ; clip currentpicture to r ; +%D path s ; s := boundingbox currentpicture enlarged 5mm ; +%D picture c ; c := currentpicture ; currentpicture := nullpicture ; +%D circular_shade(s,0,.2red,.9red) ; +%D addto currentpicture also c ; +%D \stopMPpage +%D \stoptyping + +%D This is some experimental hyperlink driver that I wrote +%D for Mark Wicks. + +\defineMPspecial{20} + {\setxvalue{mps:hl:\gMPs6}% + {\noexpand\handleMPhyperlink + {\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}% + \noexpand\setxvalue{mps:hl:\gMPs6}{}}} + +\def\handleMPhyperlink#1#2#3#4#5% + {%\ifcase\pdfoutput\or + \setbox\scratchbox\hbox + {\setbox\scratchbox\null + \scratchdimen#1\onebasepoint\scratchdimen-\scratchdimen + \advance\scratchdimen#3\onebasepoint + \wd\scratchbox\scratchdimen + \scratchdimen#2\onebasepoint\scratchdimen-\scratchdimen + \advance\scratchdimen#4\onebasepoint + \ht\scratchbox\scratchdimen + \incolorfalse + \gotobox{\box\scratchbox}[#5]}% + \setbox\scratchbox\hbox + {\scratchdimen\MPxoffset\onebasepoint\advance\scratchdimen#1\onebasepoint + \hskip\scratchdimen + \scratchdimen\MPyoffset\onebasepoint\advance\scratchdimen#2\onebasepoint + \raise\scratchdimen\box\scratchbox}% + \smashbox\scratchbox + \box\scratchbox + }%\fi} + +\def\invokeMPhyperlinkspecial% + {\getvalue{mps:hl:\currentMPspecial}} % or \relax + +\appendtoks \invokeMPhyperlinkspecial \to \invokeMPspecials + +%D Special number~1 is dedicated to \CMYK\ support. If you +%D want to know why: look at this: +%D +%D \startbuffer[mp] +%D fill fullcircle xyscaled (3cm,1cm) withcolor \MPcolor{test} ; +%D \stopbuffer +%D +%D \startbuffer[cmyk] +%D \startcombination[4*1] +%D {\definecolor[test][c=1,y=.3,k=.3] \processMPbuffer[mp]} {c=1 y=.3 k=.3} +%D {\definecolor[test][c=.9,y=.15] \processMPbuffer[mp]} {c=.9 y=.15} +%D {\definecolor[test][c=.25,y=.8] \processMPbuffer[mp]} {c=.25 y=.8} +%D {\definecolor[test][c=.45,y=.1] \processMPbuffer[mp]} {c=.45 y=.1} +%D \stopcombination +%D \stopbuffer +%D +%D \placefigure +%D {\CMYK\ support disabled, +%D conversion to \RGB.} +%D {\setupcolors[cmyk=nee,state=start]\getbuffer[cmyk]} +%D +%D \placefigure +%D {\CMYK\ support enabled, +%D no support in \METAPOST.} +%D {\setupcolors[cmyk=ja,mpcmyk=nee,state=start]\getbuffer[cmyk]} +%D +%D \placefigure +%D {\CMYK\ support enabled, +%D no conversion to \RGB, +%D support in \METAPOST} +%D {\setupcolors[cmyk=ja,state=start]\getbuffer[cmyk]} + +\defineMPspecial{1} + {\ifMPcmykcolors + \setxvalue{\@@MPSK\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }% + \fi} + +\def\setMPcmyk#1 #2 #3 #4 % + {\setvalue{\@@MP01}{#1}% + \setvalue{\@@MP02}{#2}% + \setvalue{\@@MP03}{#3}% + \setvalue{\@@MP04}{#4}} + +%\defineMPspecial{2} +% {\ifMPspotcolors +% \setxvalue{\@@MPSP\gMPs1}{\gMPs2 \gMPs3 }% +% \fi} + +% \defineMPspecial{2} +% {\ifMPspotcolors +% \setxvalue{\@@MPSP\gMPs1}{\gMPs2 \gMPs3 }% +% \checkMPspot{\gMPs2}{\gMPs3}% +% \fi} +% +% \def\setMPspot#1 #2 % +% {\setvalue{\@@MP01}{#1}% +% \setvalue{\@@MP02}{#2}} +% +% \def\checkMPspot#1#2% +% {\expanded{\resolveMPspotcolor#1 #2}\end +% \ifx\MPspotspace\MPresolvedspace +% \edef\MPspotspacespec{/\MPspotspace\space}% +% \doifinstringelse\MPspotspacespec\currentMPcolorspaces +% \donothing\registerMPcolorspace +% \fi} + +\defineMPspecial{2} + {\ifMPspotcolors + \setxvalue{\@@MPSP\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }% space is essential + \checkMPspot{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}% + \fi} + +\def\setMPspot#1 #2 #3 #4 % + {\setvalue{\@@MP01}{#1}% + \setvalue{\@@MP02}{#2}% + \setvalue{\@@MP03}{#3}% + \setvalue{\@@MP04}{#4}} + +\def\checkMPspot#1#2#3#4% + {\expanded{\resolveMPspotcolor#1 #2 #3 #4}\end + \ifx\MPspotspace\MPresolvedspace + \edef\MPspotspacespec{/\MPspotspace\space}% + \doifinstringelse\MPspotspacespec\currentMPcolorspaces + \donothing\registerMPcolorspace + \fi} + +%D This special (number 50) passes positions to a tex file. +%D This method uses a two||pass approach an (mis|)|used the +%D context positioning macros. In \type {core-pos} we will +%D implement the low level submacro needed. +%D +%D \startbuffer +%D \definelayer[test] +%D +%D \setlayer +%D [test] +%D [x=\MPx{somepos-1},y=\MPy{somepos-1}] +%D {Whatever we want here!} +%D +%D \setlayer +%D [test] +%D [x=\MPx{somepos-2},y=\MPy{somepos-2}] +%D {Whatever we need there!} +%D +%D \startuseMPgraphic{oeps} +%D draw fullcircle scaled 6cm withcolor red ; +%D register ("somepos-1",1cm,2cm,center currentpicture) ; +%D register ("somepos-2",4cm,3cm,(-1cm,-2cm)) ; +%D \stopuseMPgraphic +%D +%D \framed[background=test,offset=overlay]{\useMPgraphic{oeps}} +%D \stopbuffer +%D +%D \typebuffer +%D +%D Here the width and height are not realy used, but one can +%D imagine situations where tex has to work with values +%D calculated by \METAPOST. +%D +%D \startlinecorrection +%D \getbuffer +%D \stoplinecorrection +%D +%D Later we will implement a more convenient macro: +%D +%D \starttyping +%D \setMPlayer [test] [somepos-1] {Whatever we want here!} +%D \setMPlayer [test] [somepos-2] {Whatever we need there!} +%D \stoptyping + +\ifx\dosavepositionwhd\undefined + \let\dosavepositionwhd\gobblesevenarguments +\fi + +\defineMPspecial{50} % x y width height label + {\bgroup + \scratchdimen\MPllx\onebasepoint\scratchdimen-\scratchdimen + % \scratchdimen-\MPllx\onebasepoint % moet ook werken + \advance\scratchdimen\gMPs1\onebasepoint + \edef\x{\number\scratchdimen}% + \scratchdimen\gMPs2\onebasepoint + \scratchdimen-\scratchdimen + \advance\scratchdimen\MPury\onebasepoint + \edef\y{\number\scratchdimen}% + \scratchdimen\gMPs3\onebasepoint + \edef\w{\number\scratchdimen}% + \scratchdimen\gMPs4\onebasepoint + \edef\h{\number\scratchdimen}% + \dosavepositionwhd{\gMPs5}0\x\y\w\h0% + \egroup} + +%D Transparency support used specials 60 (rgb) and 61 +%D (cmyk). +%D +%D \startbuffer +%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0); +%D +%D fill p rotated 90 withcolor transparent(1,.5,yellow) ; +%D fill p rotated 210 withcolor transparent(1,.5,green) ; +%D fill p rotated 330 withcolor transparent(1,.5,blue) ; +%D \stopbuffer +%D +%D \typebuffer +%D +%D \startlinecorrection \processMPbuffer \stoplinecorrection +%D +%D One can also communicate colors between \CONTEXT\ and +%D \METAPOST: +%D +%D \startbuffer +%D \definecolor[tcyan] [c=1,k=.2,t=.5] +%D \definecolor[tmagenta][m=1,k=.2,t=.5] +%D \definecolor[tyellow] [y=1,k=.2,t=.5] +%D \stopbuffer +%D +%D \typebuffer \getbuffer +%D +%D \startbuffer +%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0); +%D +%D fill p rotated 90 withcolor \MPcolor{tcyan} ; +%D fill p rotated 210 withcolor \MPcolor{tmagenta} ; +%D fill p rotated 330 withcolor \MPcolor{tyellow} ; +%D \stopbuffer +%D +%D \startlinecorrection \processMPbuffer \stoplinecorrection +%D +%D We save all the three components needed in one macro, +%D just to save hash space. + +\def\@@MPST{@MPST@} + +\def\assignMPStransparency#1#2#3% + {\edef\PDFtransparencyidentifier{#1}% + \edef\PDFtransparencyreference {#2}% + \edef\PDFtransparencycolorspecs{#3}} + +% \def\PDFtransparencyspec +% {\ifx\MPresolvedspace\MPgrayspace +% \MPresolvedcolor\space g \MPresolvedcolor\space G% +% \else\ifx\MPresolvedspace\MPrgbspace +% \MPresolvedcolor\space rg \MPresolvedcolor\space RG% +% \else\ifx\MPresolvedspace\MPcmykspace +% \MPresolvedcolor\space k \MPresolvedcolor\space K% +% \else\ifx\MPresolvedspace\empty\else +% /\MPresolvedspace\space cs \MPresolvedcolor\space sc +% /\MPresolvedspace\space CS \MPresolvedcolor\space SC% +% \fi\fi\fi\fi} + +\def\PDFtransparencyspec % todo + {\ifx\MPresolvedspace\MPgrayspace + \MPresolvedcolor\space g + \MPresolvedcolor\space G% + \else\ifx\MPresolvedspace\MPrgbspace + \MPresolvedcolor\space rg + \MPresolvedcolor\space RG% + \else\ifx\MPresolvedspace\MPcmykspace + \MPresolvedcolor\space k + \MPresolvedcolor\space K% + \else\ifx\MPresolvedspace\empty\else + /\MPresolvedspace\space cs + /\MPresolvedspace\space CS + \PDFgetspotcolorspec\MPresolvedcolor + \fi\fi\fi\fi} + +\defineMPspecial{3} % rgb + {\edef\currentMPspecial{\gMPs6}% + \presetPDFtransparency{\gMPs1}{\gMPs2}% + \expanded{\resolveMPrgbcolor\gMPs3 \gMPs4 \gMPs5}\end + \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! + {\noexpand\assignMPStransparency + {\PDFtransparencyidentifier}% + {\PDFtransparencyreference}% + {\PDFtransparencyspec}}} + +\defineMPspecial{4} % cmyk + {\edef\currentMPspecial{\gMPs7}% + \presetPDFtransparency{\gMPs1}{\gMPs2}% + \expanded{\resolveMPcmykcolor\gMPs3 \gMPs4 \gMPs5 \gMPs6}\end + \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! + {\noexpand\assignMPStransparency + {\PDFtransparencyidentifier}% + {\PDFtransparencyreference}% + {\PDFtransparencyspec}}} + +% \defineMPspecial{5} % spot +% {\edef\currentMPspecial{\gMPs5}% +% \presetPDFtransparency{\gMPs1}{\gMPs2}% +% \checkMPspot{\gMPs3}{\gMPs4}% +% \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! +% {\noexpand\assignMPStransparency +% {\PDFtransparencyidentifier}% +% {\PDFtransparencyreference}% +% {\PDFtransparencyspec}}} + +\defineMPspecial{5} % spot + {\edef\currentMPspecial{\gMPs7}% + \presetPDFtransparency{\gMPs1}{\gMPs2}% + \checkMPspot{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}% + \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! + {\noexpand\assignMPStransparency + {\PDFtransparencyidentifier}% + {\PDFtransparencyreference}% + {\PDFtransparencyspec}}} + +% beware: for the moment only supported in pdftex; needs a cleanup! + +\def\registerMPcolorspace + {\doifobjectreferencefoundelse{PDFCS}\MPspotspace + {\doPDFgetobjectreference{PDFCS}\MPspotspace\PDFobjectreference + \xdef\currentMPcolorspaces + {\currentMPcolorspaces\MPspotspacespec\PDFobjectreference\space}} + \donothing} + +%D We need to add resource specifications! + +\appendtoks + \global\let\currentMPcolorspaces\empty +\to \MPstartresources + +\appendtoks + \ifx\currentMPcolorspaces\empty \else + \xdef\currentPDFresources{\currentPDFresources + /ColorSpace <<\currentMPcolorspaces>>}% + \fi +\to \MPstopresources + +%D For efficiency reasons, we fall back on the allocation +%D mechanisms already present. For use within \MPTOPDF, we +%D provide a fall back routine. + +\let\currentMPtransparencies\empty + +% \def\invokeMPtransparencyspecial +% {\doifdefined{\@@MPST\currentMPspecial} +% {\getvalue{\@@MPST\currentMPspecial}% +% \doifinstringelse +% {\PDFtransparencyidentifier}{\currentMPtransparencies} +% {} +% {\xdef\currentMPtransparencies +% {\currentMPtransparencies +% \PDFtransparencyidentifier\space +% \PDFtransparencyreference\space}}% +% \def\extraMPpathcode{ Q}% +% \PDFcode{q +% \PDFtransparencycolorspecs\space +% \PDFtransparencyidentifier\space gs}}} + +% this one triggers a new graphic state + +\def\invokeMPtransparencyspecial + {\scratchcounter\MPrgbnumber\lastMPbvalue + \edef\currentMPspecial{\the\scratchcounter}% + \ifundefined{\@@MPST\currentMPspecial}\else + \getvalue{\@@MPST\currentMPspecial}% + \doifinstringelse\PDFtransparencyidentifier\currentMPtransparencies + \donothing\registerMPtransparencyresource % slow + \PDFcode + {\PDFtransparencycolorspecs\space + \PDFtransparencyidentifier\space gs}% + % potential optimization + % \setevalue{\@@MPST\currentMPspecial}% + % {\PDFcode + % {\PDFtransparencycolorspecs\space + % \PDFtransparencyidentifier\space gs}}% + % \getvalue{\@@MPST\currentMPspecial}% + \let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial + \fi} + +% this one does a reset + +\let\revokeMPtransparencyspecial\relax + +\appendtoks + \revokeMPtransparencyspecial +\to \MPstopresources + +\def\dorevokeMPtransparencyspecial % only called if state is set + {\ifx\PDFtransparencyresetidentifier\empty\else + \doifinstringelse\PDFtransparencyresetidentifier\currentMPtransparencies + \donothing\registerMPtransparencyresetresource + \PDFcode{\PDFtransparencyresetidentifier\space gs}% + % potential optimization + % \def\dorevokeMPtransparencyspecial + % {\PDFcode + % {\PDFtransparencycolorspecs\space + % \PDFtransparencyidentifier\space gs}}% + \let\dorevokeMPtransparencyspecial\dodorevokeMPtransparencyspecial + \let\revokeMPtransparencyspecial\relax % invoke sets it + \fi} + +% and this one a simplified reset + +% \def\dodorevokeMPtransparencyspecial % used after first invocation +% {\getvalue{\@@MPST0}% +% \PDFcode{\PDFtransparencyidentifier\space gs}} + +\def\dodorevokeMPtransparencyspecial % used after first invocation + {\PDFcode{\PDFtransparencyresetidentifier\space gs}% + \let\revokeMPtransparencyspecial\relax} % invoke sets it + +% add a resource entry + +\def\registerMPtransparencyresource + {\xdef\currentMPtransparencies + {\currentMPtransparencies + \PDFtransparencyidentifier\space + \PDFtransparencyreference\space}} + +\def\registerMPtransparencyresetresource + {\xdef\currentMPtransparencies + {\currentMPtransparencies + \PDFtransparencyresetidentifier\space + \PDFtransparencyresetreference\space}} + +\appendtoks \invokeMPtransparencyspecial \to \invokeMPspecials + +\ifCONTEXT \else + + \def\@@MPSTN{@MPSTN@} + \def\@@MPSTO{@MPSTO@} + + \newcount\PDFcurrenttransparency + + \let\PDFtransparencyresetidentifier\empty + \let\PDFtransparencyresetreference \empty + + \let\PDFtransparencyidentifier\empty + \let\PDFtransparencyreference \empty + + \def\initializePDFtransparency + {\global\let\initializePDFtransparency\relax + \presetPDFtransparency{1}{1}% + \xdef\PDFtransparencyresetidentifier{/Tr0}% + \xdef\PDFtransparencyresetreference{\the\pdflastobj\space 0 R}} + + \def\presetPDFtransparency#1#2% + {\initializePDFtransparency + \@EA\ifx\csname\@@MPSTO#1:#2\endcsname\relax + \global\advance\PDFcurrenttransparency \plusone + \immediate\pdfobj{\PDFtransparencydictionary{#1}{#2}{}}% + \setxvalue{\@@MPSTN#1:#2}{\the\PDFcurrenttransparency}% + \setxvalue{\@@MPSTO#1:#2}{\the\pdflastobj}% + \fi + \edef\PDFtransparencyidentifier{/Tr\getvalue{\@@MPSTN#1:#2}}% + \edef\PDFtransparencyreference{\getvalue{\@@MPSTO#1:#2} 0 R}} + + \def\PDFtransparencydictionary#1#2#3% type fraction extras + {<>} + +\fi + +\appendtoks + \global\let\currentMPtransparencies\empty +\to \MPstartresources + +\appendtoks + \ifx\currentMPtransparencies\empty \else + \xdef\currentPDFresources{\currentPDFresources + /ExtGState <<\currentMPtransparencies>>}% + \fi +\to \MPstopresources + +%D In all cases, we need to keep track of the resources +%D used. + +%D A few auxiliary macros: + +\def\MPgrayspace{DeviceGray} +\def\MPrgbspace {DeviceRGB} +\def\MPcmykspace{DeviceCMYK} +\let\MPspotspace\MPgrayspace + +\def\MPcmykBlack{0 0 0 0} +\def\MPcmykWhite{0 0 0 1} + +\ifCONTEXT + + \def\startMPcolorresolve + {\bgroup + \def\dostartgraycolormode##1% + {\global\let\MPresolvedspace\MPgrayspace + \xdef\MPresolvedcolor{##1}}% + \def\dostartrgbcolormode ##1##2##3% + {\global\let\MPresolvedspace\MPrgbspace + \xdef\MPresolvedcolor{##1 ##2 ##3}}% + \def\dostartcmykcolormode##1##2##3##4% + {\global\let\MPresolvedspace\MPcmykspace + \xdef\MPresolvedcolor{##1 ##2 ##3 ##4}}% + \def\dostartspotcolormode##1##2% + {\global\let\MPspotspace\empty + \xdef\MPresolvedspace{##1}% + \xdef\MPresolvedcolor{##2}% + \global\let\MPspotspace\MPresolvedspace}% signal + \dostartgraycolormode\!!zerocount} % kind of hackery initialization + + \let\stopMPcolorresolve\egroup + + \def\resolveMPrgbcolor#1 #2 #3\end + {\startMPcolorresolve + \execcolorR#1:#2:#3:0:0\od + \stopMPcolorresolve} + + \def\resolveMPcmykcolor#1 #2 #3 #4\end + {\startMPcolorresolve + \execcolorC#1:#2:#3:#4:0:0\od + \stopMPcolorresolve} + + \def\resolveMPgraycolor#1\end + {\startMPcolorresolve + \execcolorS#1:0:0\od + \stopMPcolorresolve} + +% \def\resolveMPspotcolor#1 #2\end +% {\startMPcolorresolve +% \execcolorP#1:#2:0:0\od +% \stopMPcolorresolve} + + \def\resolveMPspotcolor#1 #2 #3 #4\end + {\startMPcolorresolve + \ifnum#2>\plusone + \checkmultitonecolor{#1}% + \fi + \execcolorP#1:#2:#3:#4:0:0\od + \stopMPcolorresolve} + +\else + + \def\resolveMPspotcolor#1 #2\end + {\global\let\MPresolvedspace\MPgrayspace + \xdef\MPresolvedcolor{0}} + + \def\resolveMPrgbcolor#1 #2 #3\end + {\global\let\MPresolvedspace\MPrgbspace + \xdef\MPresolvedcolor{#1 #2 #3}} + + \def\resolveMPcmykcolor#1 #2 #3 #4\end + {\global\let\MPresolvedspace\MPcmykspace + \xdef\MPresolvedcolor{#1 #2 #3 #4}} + + \def\resolveMPgraycolor#1\end + {\global\let\MPresolvedspace\MPgrayspace + \xdef\MPresolvedcolor{#1}} % should be inverted + +\fi + +\protect \endinput diff --git a/tex/context/base/supp-mpe.tex b/tex/context/base/supp-mpe.tex deleted file mode 100644 index 67b27919c..000000000 --- a/tex/context/base/supp-mpe.tex +++ /dev/null @@ -1,1370 +0,0 @@ -%D \module -%D [ file=supp-mpe, -%D version=1999.07.10, -%D title=\CONTEXT\ Support Macros, -%D subtitle=METAPOST Special Extensions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% fuzzy and complicating is the fact that we need to support -% context as well as mptopdf, so we cannot fall back on the -% special drivers and color module (although there may be -% good reasons to use a smaller context instead); also, -% shading is handled here while it should move to the special -% driver - to do! - -%D This module is still experimental and deals with some -%D extensions to \METAPOST. When using \POSTSCRIPT\ output, -%D these extensions can be supplied by means of proper -%D preamble definitions, but when producing \PDF\ we have to -%D set up the appropriate datastructures ourselves. It acts as -%D a plug in into \type {supp-pdf}. As soon as we need more -%D extensions, we will generalize these macro. Some -%D definitions will move to the special drivers. - -%D For usage in plain \TEX, say something: -%D -%D \starttyping -%D \input supp-pdf -%D \input supp-mpe -%D -%D \MPcmykcolorstrue -%D \MPspotcolorstrue -%D \chardef\makeMPintoPDFobject\plusone -%D \stoptyping - -\ifx\writestatus\undefined - \immediate\write16{[Loading MPS to PDF extensions.]} -\else - \writestatus{loading}{ConTeXt Support Macros / MPS extensions} -\fi - -%D We implement extensions by using the \METAPOST\ special -%D mechanism. Opposite to \TEX's specials, the \METAPOST\ ones -%D are flushed before or after the graphic data, but thereby -%D are no longer connected to a position. -%D -%D We implement specials by overloading the \type {fill} -%D operator. By counting the fills, we can let the converter -%D treat the appropriate fill in a special way. The -%D specification of the speciality can have two forms, -%D determined by the setting of a boolean variable: -%D -%D \starttyping -%D _inline_specials_ := false ; % comment like code (default) -%D _inline_specials_ := true ; % command like code -%D \stoptyping -%D -%D When the specification is embedded as comment, it looks -%D like: -%D -%D \starttyping -%D %%MetaPostSpecial -%D \stoptyping -%D -%D The in||line alternative is more tuned for \POSTSCRIPT, -%D since it permits us to define a macro \type {special}. -%D -%D \starttyping -%D inline : special -%D \stoptyping -%D -%D The \type {identifier} determines what to do, and the data -%D can be used to accomplish this. A type~2 shading function -%D has identifier~2. Alltogether, the number of parameters is -%D specified in \type {size}. The \type {number} is the number -%D of the fill that needs the special treatment. For a type~2 -%D and~3 shaded fill, the datablock contains the following - -%D data: -%D -%D \starttyping -%D from to n inner_r g b x y outer_r g b x y -%D from to n inner_r g b x y radius outer_r g b x y radius -%D \stoptyping -%D -%D The implementation below saves the data on the stack in -%D a way similar to the macros in \type {supp-pdf.tex}, and -%D just overload a few already defined handlers. That way, -%D the existing macros are still generic. \footnote {Actually, -%D the macros here are just as generic.} -%D -%D Currently the only extension concerns shading, which is -%D accomplished by handling yet another value of \type -%D {\finiMPpath}. The recource disctionary is stored and -%D later picked up by the general \CONTEXT\ figure inclusion -%D macros. - -\unprotect - -%D The \type {%%MetaPostSpecials: version.revision signal} line -%D triggers this module into handling color specifications kind -%D of special. We need this safeguard for non||special -%D usage. - -\chardef\MPspecialversion = 0 % specials when >1 -\chardef\MPspecialrevision = 0 % specials when >1 -\chardef\MPspecialsignal = 0 % passed on by graphic - -\chardef\inlineMPspecials = 1 % only needed for stack resetting - -%D This macro handles the special definitions that are -%D passed as comment. - -\def\dohandleMPspecialcomment#1 - {\setMPargument{#1}% - \advance\scratchcounter \minusone - \ifcase\scratchcounter - \handleMPspecialcommand - \donetrue - \doresetMPstack - \let\handleMPsequence\dohandleMPsequence - \expandafter\handleMPsequence - \else - \expandafter\dohandleMPspecialcomment - \fi} - -\def\handleMPspecialcomment #1 % number of arguments - {\doresetMPstack - \scratchcounter#1\relax - \ifcase\scratchcounter % when zero, inline shading is used - \chardef\inlineMPspecials\plusone - \let\handleMPsequence\dohandleMPsequence - \expandafter\handleMPsequence - \else - \chardef\inlineMPspecials\zerocount - \expandafter\dohandleMPspecialcomment - \fi} - -%D When defined inline, we use another macro to handle the -%D definitions. Actually, this macro is called by the -%D previous ones. - -\def\handleMPspecialcommand - {\ifcase\inlineMPspecials\or - \advance\nofMParguments \minusone % pop the size - \fi - \ifundefined\MPspecial - \message{[unknown \MPspecial]}% - \else - \csname\MPspecial\endcsname - \fi - \ifcase\inlineMPspecials - \doresetMPstack % 0 - \else - \resetMPstack % 1 - \fi} - -%D This macro triggers special support. Currently, the -%D version and revision number are not used. Any version number -%D greater than zero will enable special support. - -\newconditional\manyMPspecials % \settrue\manyMPspecials - -\def\handleMPspecialscomment #1.#2 #3 % version.revision signal #4=div=1000|10000 - {\doresetMPstack - \chardef\MPspecialversion #1% - \chardef\MPspecialrevision#2% - \chardef\MPspecialsignal #3% - \let\handleMPsequence\dohandleMPsequence - \ifnum#1=\plusone - \expandafter\handleMPsequence - \else - \expandafter\handleMPspecialscommentx - \fi} - -\def\handleMPspecialscommentx #1 % version 2 -% {\doifelsedoifelse{#1}{10000}{\settrue\manyMPspecials}{\setfalse\manyMPspecials}% local - {\ifnum10000=0#1\relax - \settrue \manyMPspecials - \else - \setfalse\manyMPspecials - \fi - \setMPextensions - \handleMPsequence} - -% one can say (in meta-ini): -% -% \prependtoks -% _special_div_ := 1000\ifconditional\manyMPspecials0\fi ; -% \to \MPextensions - -%D In case of \PDF, we need to prepare resourcs. - -\newtoks\MPstartresources -\newtoks\MPstopresources - -\def\startMPresources - {\the\MPstartresources - \ifx\currentPDFresources\empty\else - \message{[unused resources]}% - \fi - \global\let\currentPDFresources\empty} - -\def\stopMPresources - {\let\currentPDFresources\empty - \the\MPstopresources} - -%D Since colors are not subjected to transformations, we can -%D only use colors as signal. In our case, we use a dummy colored -%D path with a red color component of \type {0.n}, so \type -%D {0.001} is the first path and \type {0.010} the tenth. Since -%D \METAPOST strips trailing zeros, we have to padd the string. - -\newif\ifMPcmykcolors -\newif\ifMPspotcolors - -\ifx\normalhandleMPrgbcolor\undefined % in case we reload this module - - \let\normalhandleMPrgbcolor \handleMPrgbcolor - \let\normalhandleMPcmykcolor\handleMPcmykcolor - \let\normalhandleMPgraycolor\handleMPgraycolor - \let\normalhandleMPspotcolor\handleMPspotcolor - -\fi - -%D When we are using \CONTEXT, we will fall back to the -%D better color conversion routines. This also has the advantage -%D that we don't have to parse and convert the file. In this -%D alternative, \type {\!MP} is not (yet) supported. Because -%D we can (for efficiency reasons) turn off strokecolor, -%D something we cannot do in \METAPOST\ converted code. - -\newif\ifPDFMPstrokecolor \PDFMPstrokecolortrue - -%D [This code should move to meta-ini.] - -\ifCONTEXT % we can use this for a better xgstate handling - - \def\checkPDFMPstrokecolor - {\ifPDFMPstrokecolor \PDFstrokecolortrue \fi} - - \def\normalhandleMPrgbcolor - {{\checkPDFMPstrokecolor\execcolorR\gMPa1:\gMPa2:\gMPa3:0:0\od}} - - \def\normalhandleMPcmykcolor - {{\checkPDFMPstrokecolor\execcolorC\gMPa1:\gMPa2:\gMPa3:\gMPa4:0:0\od}} - - \def\normalhandleMPgraycolor - {{\checkPDFMPstrokecolor\execcolorS\gMPa1:0:0\od}} - -% \def\normalhandleMPspotcolor -% {{\checkPDFMPstrokecolor\execcolorP\gMPa1:\gMPa2:0:0\od}} - - \def\normalhandleMPspotcolor % ??? - {{\checkPDFMPstrokecolor\execcolorP\gMPa1:\gMPa2:\gMPa3:\gMPa4:0:0\od}} - -\fi - -% In the previous macros we use the special drivers. A more -% direct approach would have been: -% -% \def\doPDFstartrgbcolormode#1#2#3% -% {\PDFcode{#1 #2 #3 rg #1 #2 #3 RG}} -% -% \def\doPDFstartcmykcolormode#1#2#3#4% -% {\PDFcode{#1 #2 #3 #4 k #1 #2 #3 #4 K}} -% -% \def\doPDFstartgraycolormode#1% -% {\PDFcode{#1 g #1 G}} -% -% \appendtoks -% \let\dostartrgbcolormode \doPDFstartrgbcolormode -% \let\dostartcmykcolormode\doPDFstartcmykcolormode -% \let\dostartgraycolormode\doPDFstartgraycolormode -% \to \everyMPtoPDFconversion - -%D Now we can handle special color signals. We only do this -%D when special are detected. - -% \def\MPrgbnumber#1{\expandafter\doMPrgbnumber#1000.0000\relax} -% \def\doMPrgbnumber#1.#2#3#4#5\relax{#2#3#4} - -%D We cannot use \type {\everyMPtoPDFconversion} because in \MPTOPDF\ -%D we don't have the \type {\appendtoks} macro available. - -\def\setMPextensions - {\ifconditional\manyMPspecials - \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##10000.00000\relax}% - \def\doMPrgbnumber##1.##2##3##4##5##6\relax{##2##3##4##5}% - \else - \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##1000.0000\relax}% - \def\doMPrgbnumber##1.##2##3##4##5\relax{##2##3##4}% - \fi} - -%D The naive case looks like: -%D -%D \starttyping -%D \def\handleMPrgbcolor% -%D {\setMPcolor -%D \ifcase\MPspecialversion -%D \resetMPcolor\normalhandleMPrgbcolor -%D \else\ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal -%D % consider it to be a signal -%D \else -%D \resetMPcolor\normalhandleMPrgbcolor -%D \fi\fi} -%D \stoptyping -%D -%D However, since we want \CMYK\ support, we will use the -%D following implementation: - -% \def\setMPcolor -% {\edef\lastMPrvalue{\gMPa1}% -% \edef\lastMPgvalue{\gMPa2}% -% \edef\lastMPbvalue{\gMPa3}} -% -% speed up (hardly called, so no let is needed) - -\def\setMPcolor - {\edef\lastMPrvalue{\csname\@@MP01\endcsname}% - \edef\lastMPgvalue{\csname\@@MP02\endcsname}% - \edef\lastMPbvalue{\csname\@@MP03\endcsname}} - -\def\zeroMPrgbvalue{0.0} - -\def\resetMPcolor - {\let\lastMPrvalue\zeroMPrgbvalue - \let\lastMPgvalue\zeroMPrgbvalue - \let\lastMPbvalue\zeroMPrgbvalue} - -\resetMPcolor - -\def\@@MPSK{@MPSK@} -\def\@@MPSP{@MPSP@} - -\def\interceptMPcmykcolor % todo : \ifMPcmykcolors - {\ifcase\MPrgbnumber\lastMPgvalue - % cannot happen - \or - % 1 == cmyk color spec - \ifMPcmykcolors \dointerceptMPcmykcolor \fi - \or - % 2 == spot color - \ifMPspotcolors \dointerceptMPspotcolor \fi - \or - % 3 == rgb transparency - \invokeMPtransparencyspecial - \or - % 4 == cmyk transparency - \ifMPcmykcolors \invokeMPtransparencyspecial \fi - \or - % 5 == spot transparency - \ifMPspotcolors \invokeMPtransparencyspecial \fi - \else - % \writestatus{MPtoPDF}{unknown direct special}% - \fi} - -% ifcsname - -\def\dointerceptMPcmykcolor - {\revokeMPtransparencyspecial - \@EA\ifx\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else - \@EA\@EA\@EA\setMPcmyk\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname - \normalhandleMPcmykcolor - \fi} - -\def\dointerceptMPspotcolor - {\revokeMPtransparencyspecial - \@EA\ifx\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else - \@EA\@EA\@EA\setMPspot\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname - \normalhandleMPspotcolor - \fi} - -\def\handleMPrgbcolor - {\resetMPcolor - \ifcase\MPspecialversion - \normalhandleMPrgbcolor - \else - \setMPcolor - \ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal\relax - \interceptMPcmykcolor - \else - \revokeMPtransparencyspecial - \normalhandleMPrgbcolor - \fi - \fi} - -\def\handleMPgraycolor - {\resetMPcolor - \ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi - \normalhandleMPgraycolor} - -\def\handleMPcmykcolor - {\resetMPcolor - \ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi - \normalhandleMPcmykcolor} - -%D Specials are define and recalled using: - -\def\MPspecial - {MP special \gMPs\nofMParguments} - -\def\defineMPspecial#1#2% - {\setvalue{MP special #1}{#2}} - -%D The path processing macro is slightly extended. - -\newtoks \invokeMPspecials - -\def\finishMPpath - {\PDFcode - {\ifcase\finiMPpath W n\or S\or f\or B\else W n\fi - \extraMPpathcode}} - -\def\processMPpath - {\checkMPpath % ! - \ifcase\nofMPsegments\else - \let\extraMPpathcode\empty - \ifcase\MPspecialversion\else - \ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal - \ifnum\MPrgbnumber\lastMPgvalue>10 % really needed - \scratchcounter\MPrgbnumber\lastMPbvalue - \edef\currentMPspecial{\the\scratchcounter}% -\let\previousMPcolorspec\currentMPcolorspec -\edef\currentMPcolorspec{\lastMPrvalue\lastMPgvalue\lastMPbvalue}% -\ifx\previousMPcolorspec\currentMPcolorspec \else - \revokeMPtransparencyspecial -\fi - \ifnum\finiMPpath=2 % to outer level - \the\invokeMPspecials - \fi - \fi - \fi - \fi - \flushMPpath - \closeMPpath - \finishMPpath - \fi - \let\handleMPsequence\dohandleMPsequence - \resetMPstack - \nofMPsegments0 - \handleMPsequence} - -%D Shading is an example of a more advanced graphic feature, -%D but users will seldom encounter those complications. Here -%D we only show a few simple examples, but many other -%D alternatives are possible by setting up the functions built -%D in \PDF\ in the appropriate way. -%D -%D Shading has to do with interpolation between two or more -%D points or user supplied ranges. In \PDF, the specifications -%D of a shade has to be encapsulated in objects and passed on -%D as resources. This is a \PDF\ level 1.3. feature. One can -%D simulate three dimensional shades as well and define simple -%D functions using a limited set of \POSTSCRIPT\ primitives. -%D Given the power of \METAPOST\ and these \PDF\ features, we -%D can achieve superb graphic effects. -%D -%D Since everything is hidden in \TEX\ and \METAPOST\ graphics, -%D we can stick to high level \CONTEXT\ command, as shown in -%D the following exmples. -%D -%D \startbuffer -%D \startuniqueMPgraphic{CircularShade} -%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; -%D circular_shade(p,0,.2red,.9red) ; -%D \stopuniqueMPgraphic -%D -%D \startuniqueMPgraphic{LinearShade} -%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; -%D linear_shade(p,0,.2blue,.9blue) ; -%D \stopuniqueMPgraphic -%D -%D \startuniqueMPgraphic{DuotoneShade} -%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; -%D linear_shade(p,2,.5green,.5red) ; -%D \stopuniqueMPgraphic -%D \stopbuffer -%D -%D \typebuffer -%D -%D \getbuffer -%D -%D These graphics can be hooked into the overlay mechanism, -%D which is available in many commands. -%D -%D \startbuffer -%D \defineoverlay[demo 1][\uniqueMPgraphic{CircularShade}] -%D \defineoverlay[demo 2][\uniqueMPgraphic {LinearShade}] -%D \defineoverlay[demo 3][\uniqueMPgraphic {DuotoneShade}] -%D \stopbuffer -%D -%D \typebuffer -%D -%D \getbuffer -%D -%D These backgrounds can for instance be applied to \type -%D {\framed}: -%D -%D \startbuffer -%D \setupframed[width=3cm,height=2cm,frame=off] -%D \startcombination[3*1] -%D {\framed[background=demo 1]{\bfd \white Demo 1}} {} -%D {\framed[background=demo 2]{\bfd \white Demo 2}} {} -%D {\framed[background=demo 3]{\bfd \white Demo 3}} {} -%D \stopcombination -%D \stopbuffer -%D -%D \typebuffer -%D -%D \startlinecorrection -%D \getbuffer -%D \stoplinecorrection -%D -%D There are a few more alternatives, determined by the second -%D parameter passed to \type {circular_shade} and alike. -%D -%D \def\SomeShade#1#2#3#4#5% -%D {\startuniqueMPgraphic{Shade-#1} -%D width := \overlaywidth ; -%D height := \overlayheight ; -%D path p ; p := unitsquare xscaled width yscaled height ; -%D #2_shade(p,#3,#4,#5) ; -%D \stopuniqueMPgraphic -%D \defineoverlay[Shade-#1][\uniqueMPgraphic{Shade-#1}]% -%D \framed[backgroundachtergrond=Shade-#1,width=2cm,height=2cm,frame=off]{}} -%D -%D \startlinecorrection -%D \startcombination[5*1] -%D {\SomeShade{10}{circular}{0}{.3blue}{.9blue}} {circular 0} -%D {\SomeShade{11}{circular}{1}{.3blue}{.9blue}} {circular 1} -%D {\SomeShade{12}{circular}{2}{.3blue}{.9blue}} {circular 2} -%D {\SomeShade{13}{circular}{3}{.3blue}{.9blue}} {circular 3} -%D {\SomeShade{14}{circular}{4}{.3blue}{.9blue}} {circular 4} -%D \stopcombination -%D \stoplinecorrection -%D -%D \blank -%D -%D \startlinecorrection -%D \startcombination[5*1] -%D {\SomeShade{20}{circular}{0}{.9green}{.3green}} {circular 0} -%D {\SomeShade{21}{circular}{1}{.9green}{.3green}} {circular 1} -%D {\SomeShade{22}{circular}{2}{.9green}{.3green}} {circular 2} -%D {\SomeShade{23}{circular}{3}{.9green}{.3green}} {circular 3} -%D {\SomeShade{24}{circular}{4}{.9green}{.3green}} {circular 4} -%D \stopcombination -%D \stoplinecorrection -%D -%D \blank -%D -%D \startlinecorrection -%D \startcombination[4*1] -%D {\SomeShade{30}{linear}{0}{.3red}{.9red}} {linear 0} -%D {\SomeShade{31}{linear}{1}{.3red}{.9red}} {linear 1} -%D {\SomeShade{32}{linear}{2}{.3red}{.9red}} {linear 2} -%D {\SomeShade{33}{linear}{3}{.3red}{.9red}} {linear 3} -%D \stopcombination -%D \stoplinecorrection -%D -%D These macros closely cooperate with the \METAPOST\ module -%D \type {mp-spec.mp}, which is part of the \CONTEXT\ -%D distribution. -%D -%D The low level (\PDF) implementation is based on the \TEX\ -%D based \METAPOST\ to \PDF\ converter. Shading is supported -%D by overloading the \type {fill} operator as implemented -%D earlier. In \PDF\ type~2 and~3 shading functions are -%D specified in terms of: -%D -%D \starttabulate[|Tl|l|] -%D \NC /Domain \NC sort of meeting range \NC \NR -%D \NC /C0 \NC inner shade \NC \NR -%D \NC /C1 \NC outer shade \NC \NR -%D \NC /N \NC smaller values, bigger inner circles \NC \NR -%D \stoptabulate - -\newcount\currentPDFshade % 0 % global (document wide) counter -\let\currentMPshades\empty - -\def\startMPshading#1% - {\edef\currentMPspecial{\gMPs{#1}}} - -\def\stopMPshading - {\global\advance\currentPDFshade \plusone - \setxvalue{obj:Sh:\currentMPspecial}% - {/Sh\the\currentPDFshade\space\the\pdflastobj\space0 R }% - \setxvalue{mps:Sh:\currentMPspecial}% - {\the\currentPDFshade}} - -\appendtoks - \global\let\currentMPshades\empty -\to \MPstartresources - -\appendtoks - \ifx\currentMPshades\empty \else - \xdef\currentPDFresources{\currentPDFresources - /Shading <<\currentMPshades>>}% - \fi -\to \MPstopresources - -\def\invokeMPshadespecial - {\ifundefined{mps:Sh:\currentMPspecial}\else - \edef\currentMPshade{\getvalue{obj:Sh:\currentMPspecial}}% - \doifinstringelse\currentMPshade\currentMPshades \donothing - {\xdef\currentMPshades{\currentMPshades\currentMPshade}}% - \def\extraMPpathcode{/Sh\getvalue{mps:Sh:\currentMPspecial} sh Q}% - \chardef\finiMPpath\zerocount - \PDFcode{q /Pattern cs}% - \fi} - -\appendtoks \invokeMPshadespecial \to \invokeMPspecials - -%D We need to convert the \CMYK\ specials into colors, because -%D we have to do it twice, we define a macro. - -% \def\checkMPshadingcolor#1#2#3#4#5% -% {\edef\tempMPrvalue{\csname\@@MP0#1\endcsname}% -% \edef\tempMPgvalue{\csname\@@MP0#2\endcsname}% -% \edef\tempMPbvalue{\csname\@@MP0#3\endcsname}% -% \edef#5% -% {\ifx\tempMPrvalue\tempMPgvalue -% \ifx\tempMPrvalue\tempMPbvalue -% \ifx\tempMPgvalue\tempMPbvalue -% \tempMPbvalue -% \fi -% \fi -% \fi}% -% \edef#4% todo : spotcolors -% {\ifnum\MPrgbnumber\tempMPrvalue=\MPspecialsignal\space -% \ifMPcmykcolors\getvalue{\@@MPSK\number\MPrgbnumber\tempMPbvalue}\fi -% \fi}} - -\def\checkMPshadingcolor#1#2#3#4#5% - {\edef\tempMPrvalue{\csname\@@MP0#1\endcsname}% - \edef\tempMPgvalue{\csname\@@MP0#2\endcsname}% - \edef\tempMPbvalue{\csname\@@MP0#3\endcsname}% - \global\let\MPresolvedspace\MPgrayspace - \global\let\MPresolvedcolor\!!zerocount - \ifnum\MPrgbnumber\tempMPrvalue=\MPspecialsignal\relax - \ifcase\MPrgbnumber\tempMPgvalue - \or % 1 = cmyk - \ifMPcmykcolors - \expanded{\resolveMPcmykcolor\getvalue{\@@MPSK\number\MPrgbnumber\tempMPbvalue}}\end - \fi - \or % 2 = spot - \ifMPspotcolors - \expanded{\resolveMPspotcolor\getvalue{\@@MPSP\number\MPrgbnumber\tempMPbvalue}}\end - \fi - \or - % 3 = rgb transparency - % to do - \or - % 4 == cmyk transparency - % \ifMPcmykcolors - % to do - % \fi - \or - % 5 == spot transparency - % \ifMPspotcolors - % to do - % \fi - \fi - \else - \ifx\tempMPrvalue\tempMPgvalue - \ifx\tempMPrvalue\tempMPbvalue - \expanded{\resolveMPgraycolor\tempMPbvalue}\end - \else - \expanded{\resolveMPrgbcolor\tempMPrvalue\space\tempMPgvalue\space\tempMPbvalue}\end - \fi - \else - \expanded{\resolveMPrgbcolor\tempMPrvalue\space\tempMPgvalue\space\tempMPbvalue}\end - \fi - \fi - \let#4\MPresolvedcolor - \let#5\MPresolvedspace} - -%D We also need to make sure that we have two \RGB\ or -%D \CMYK colors, since we have to set the colorspace. - -\def\setMPshadingcolors#1#2#3#4#5#6% color space - {\checkMPshadingcolor{#1}{#2}{#3}\MPshadeAc\MPshadeAs - \checkMPshadingcolor{#4}{#5}{#6}\MPshadeBc\MPshadeBs - \ifx\MPshadeAs\MPshadeBs - \let\MPshadeA\MPshadeAc - \let\MPshadeB\MPshadeBc - \let\MPshadeC\MPshadeAs - \else\ifx\MPshadeAs\MPgrayspace - \ifx\MPshadeBs\MPrgbspace - \edef\MPshadeA{\MPshadeAc\space\MPshadeAc\space\MPshadeAc}% - \else - \negatecolorcomponent\MPshadeAc - \edef\MPshadeA{0 0 0 \MPshadeAc}% - \fi - \let\MPshadeB\MPshadeBc - \let\MPshadeC\MPshadeBs - \else\ifx\MPshadeBs\MPgrayspace - \let\MPshadeA\MPshadeAc - \ifx\MPshadeAs\MPrgbspace - \edef\MPshadeB{\MPshadeBc\space\MPshadeBc\space\MPshadeBc}% - \else - \negatecolorcomponent\MPshadeBc - \edef\MPshadeB{0 0 0 \MPshadeBc}% - \fi - \let\MPshadeC\MPshadeAs - \else - % different color spaces - \def\MPshadeA{1}% - \def\MPshadeB{1}% - \let\MPshadeC\MPgrayspace - \fi\fi\fi} - -\let\MPshadeA\MPcmykWhite -\let\MPshadeB\MPcmykBlack -\let\MPshadeC\MPgrayspace - -%D The reason why this macro is a bit complicates is that we -%D handle black and white situations (otherwise we would have -%D to use \CMYK\ b/w in case of a \CMYK\ shade). - -%D Here are the special handlers: - -\defineMPspecial{30} - {\startMPshading{14}% type 2 - \setMPshadingcolors{4}{5}{6}{9}{10}{11}% - \immediate\pdfobj - {<>}% - \immediate\pdfobj - {<>}% - \stopMPshading} - -\defineMPspecial{31} - {\startMPshading{16}% type 3 - \setMPshadingcolors{4}{5}{6}{10}{11}{12}% - \immediate\pdfobj - {<>}% - \immediate\pdfobj - {<>}% - \stopMPshading} - -%D Figure inclusion is kind of strange to \METAPOST, but when -%D Santiago Muelas started discussing this with me, I was able -%D to cook up a solution using specials. - -\def\invokeMPfigurespecial% - {\getvalue{mps:gr:\currentMPspecial}} % or \relax - -\appendtoks \invokeMPfigurespecial \to \invokeMPspecials - -\defineMPspecial{10} - {\setxvalue{mps:gr:\gMPs8}% - {\noexpand\handleMPfigurespecial - {\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}% - \noexpand\setxvalue{mps:gr:\gMPs8}{}}} - -% \def\handleMPfigurespecial#1#2#3#4#5#6#7% -% {\vbox to 0pt -% {\vss -% \hbox to 0pt -% {\pdfliteral{q #1 #2 #3 #4 #5 #6 cm}% -% \pdfimage width 1bp height 1bp {#7}% maybe 10 is better -% \pdfliteral{Q}% -% \hss}}} -% -% better, since xform reuse - -\def\handleMPfigurespecial#1#2#3#4#5#6#7% todo : combine with ext fig - {\vbox to \zeropoint - {\vss - \hbox to \zeropoint - {\ifcase\pdfoutput\or % will be hooked into the special driver - \doiffileelse{#7} - {\doifundefinedelse{mps:x:#7} - {\immediate\pdfximage\!!width\onebasepoint\!!height\onebasepoint{#7}% - \setxvalue{mps:x:#7}{\pdfrefximage\the\pdflastximage}}% - {\message{[reusing figure #7]}}% - \PDFcode{q #1 #2 #3 #4 #5 #6 cm}% - \rlap{\getvalue{mps:x:#7}}% - \PDFcode{Q}} - {\message{[unknown figure #7]}}% - \fi - \hss}}} - -%D An example of using both special features is the -%D following. -%D -%D \starttyping -%D \startMPpage -%D externalfigure "hakker1b.png" scaled 22cm rotated 10 shifted (-2cm,0cm); -%D externalfigure "hakker1b.png" scaled 10cm rotated -10 ; -%D externalfigure "hakker1b.png" scaled 7cm rotated 45 shifted (8cm,12cm) ; -%D path p ; p := unitcircle xscaled 15cm yscaled 20cm; -%D path q ; q := p rotatedaround(center p,90) ; -%D path r ; r := buildcycle(p,q) ; clip currentpicture to r ; -%D path s ; s := boundingbox currentpicture enlarged 5mm ; -%D picture c ; c := currentpicture ; currentpicture := nullpicture ; -%D circular_shade(s,0,.2red,.9red) ; -%D addto currentpicture also c ; -%D \stopMPpage -%D \stoptyping - -%D This is some experimental hyperlink driver that I wrote -%D for Mark Wicks. - -\defineMPspecial{20} - {\setxvalue{mps:hl:\gMPs6}% - {\noexpand\handleMPhyperlink - {\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}% - \noexpand\setxvalue{mps:hl:\gMPs6}{}}} - -\def\handleMPhyperlink#1#2#3#4#5% - {%\ifcase\pdfoutput\or - \setbox\scratchbox\hbox - {\setbox\scratchbox\null - \scratchdimen#1\onebasepoint\scratchdimen-\scratchdimen - \advance\scratchdimen#3\onebasepoint - \wd\scratchbox\scratchdimen - \scratchdimen#2\onebasepoint\scratchdimen-\scratchdimen - \advance\scratchdimen#4\onebasepoint - \ht\scratchbox\scratchdimen - \incolorfalse - \gotobox{\box\scratchbox}[#5]}% - \setbox\scratchbox\hbox - {\scratchdimen\MPxoffset\onebasepoint\advance\scratchdimen#1\onebasepoint - \hskip\scratchdimen - \scratchdimen\MPyoffset\onebasepoint\advance\scratchdimen#2\onebasepoint - \raise\scratchdimen\box\scratchbox}% - \smashbox\scratchbox - \box\scratchbox - }%\fi} - -\def\invokeMPhyperlinkspecial% - {\getvalue{mps:hl:\currentMPspecial}} % or \relax - -\appendtoks \invokeMPhyperlinkspecial \to \invokeMPspecials - -%D Special number~1 is dedicated to \CMYK\ support. If you -%D want to know why: look at this: -%D -%D \startbuffer[mp] -%D fill fullcircle xyscaled (3cm,1cm) withcolor \MPcolor{test} ; -%D \stopbuffer -%D -%D \startbuffer[cmyk] -%D \startcombination[4*1] -%D {\definecolor[test][c=1,y=.3,k=.3] \processMPbuffer[mp]} {c=1 y=.3 k=.3} -%D {\definecolor[test][c=.9,y=.15] \processMPbuffer[mp]} {c=.9 y=.15} -%D {\definecolor[test][c=.25,y=.8] \processMPbuffer[mp]} {c=.25 y=.8} -%D {\definecolor[test][c=.45,y=.1] \processMPbuffer[mp]} {c=.45 y=.1} -%D \stopcombination -%D \stopbuffer -%D -%D \placefigure -%D {\CMYK\ support disabled, -%D conversion to \RGB.} -%D {\setupcolors[cmyk=nee,state=start]\getbuffer[cmyk]} -%D -%D \placefigure -%D {\CMYK\ support enabled, -%D no support in \METAPOST.} -%D {\setupcolors[cmyk=ja,mpcmyk=nee,state=start]\getbuffer[cmyk]} -%D -%D \placefigure -%D {\CMYK\ support enabled, -%D no conversion to \RGB, -%D support in \METAPOST} -%D {\setupcolors[cmyk=ja,state=start]\getbuffer[cmyk]} - -\defineMPspecial{1} - {\ifMPcmykcolors - \setxvalue{\@@MPSK\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }% - \fi} - -\def\setMPcmyk#1 #2 #3 #4 % - {\setvalue{\@@MP01}{#1}% - \setvalue{\@@MP02}{#2}% - \setvalue{\@@MP03}{#3}% - \setvalue{\@@MP04}{#4}} - -%\defineMPspecial{2} -% {\ifMPspotcolors -% \setxvalue{\@@MPSP\gMPs1}{\gMPs2 \gMPs3 }% -% \fi} - -% \defineMPspecial{2} -% {\ifMPspotcolors -% \setxvalue{\@@MPSP\gMPs1}{\gMPs2 \gMPs3 }% -% \checkMPspot{\gMPs2}{\gMPs3}% -% \fi} -% -% \def\setMPspot#1 #2 % -% {\setvalue{\@@MP01}{#1}% -% \setvalue{\@@MP02}{#2}} -% -% \def\checkMPspot#1#2% -% {\expanded{\resolveMPspotcolor#1 #2}\end -% \ifx\MPspotspace\MPresolvedspace -% \edef\MPspotspacespec{/\MPspotspace\space}% -% \doifinstringelse\MPspotspacespec\currentMPcolorspaces -% \donothing\registerMPcolorspace -% \fi} - -\defineMPspecial{2} - {\ifMPspotcolors - \setxvalue{\@@MPSP\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }% space is essential - \checkMPspot{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}% - \fi} - -\def\setMPspot#1 #2 #3 #4 % - {\setvalue{\@@MP01}{#1}% - \setvalue{\@@MP02}{#2}% - \setvalue{\@@MP03}{#3}% - \setvalue{\@@MP04}{#4}} - -\def\checkMPspot#1#2#3#4% - {\expanded{\resolveMPspotcolor#1 #2 #3 #4}\end - \ifx\MPspotspace\MPresolvedspace - \edef\MPspotspacespec{/\MPspotspace\space}% - \doifinstringelse\MPspotspacespec\currentMPcolorspaces - \donothing\registerMPcolorspace - \fi} - -%D This special (number 50) passes positions to a tex file. -%D This method uses a two||pass approach an (mis|)|used the -%D context positioning macros. In \type {core-pos} we will -%D implement the low level submacro needed. -%D -%D \startbuffer -%D \definelayer[test] -%D -%D \setlayer -%D [test] -%D [x=\MPx{somepos-1},y=\MPy{somepos-1}] -%D {Whatever we want here!} -%D -%D \setlayer -%D [test] -%D [x=\MPx{somepos-2},y=\MPy{somepos-2}] -%D {Whatever we need there!} -%D -%D \startuseMPgraphic{oeps} -%D draw fullcircle scaled 6cm withcolor red ; -%D register ("somepos-1",1cm,2cm,center currentpicture) ; -%D register ("somepos-2",4cm,3cm,(-1cm,-2cm)) ; -%D \stopuseMPgraphic -%D -%D \framed[background=test,offset=overlay]{\useMPgraphic{oeps}} -%D \stopbuffer -%D -%D \typebuffer -%D -%D Here the width and height are not realy used, but one can -%D imagine situations where tex has to work with values -%D calculated by \METAPOST. -%D -%D \startlinecorrection -%D \getbuffer -%D \stoplinecorrection -%D -%D Later we will implement a more convenient macro: -%D -%D \starttyping -%D \setMPlayer [test] [somepos-1] {Whatever we want here!} -%D \setMPlayer [test] [somepos-2] {Whatever we need there!} -%D \stoptyping - -\ifx\dosavepositionwhd\undefined - \let\dosavepositionwhd\gobblesevenarguments -\fi - -\defineMPspecial{50} % x y width height label - {\bgroup - \scratchdimen\MPllx\onebasepoint\scratchdimen-\scratchdimen - % \scratchdimen-\MPllx\onebasepoint % moet ook werken - \advance\scratchdimen\gMPs1\onebasepoint - \edef\x{\number\scratchdimen}% - \scratchdimen\gMPs2\onebasepoint - \scratchdimen-\scratchdimen - \advance\scratchdimen\MPury\onebasepoint - \edef\y{\number\scratchdimen}% - \scratchdimen\gMPs3\onebasepoint - \edef\w{\number\scratchdimen}% - \scratchdimen\gMPs4\onebasepoint - \edef\h{\number\scratchdimen}% - \dosavepositionwhd{\gMPs5}0\x\y\w\h0% - \egroup} - -%D Transparency support used specials 60 (rgb) and 61 -%D (cmyk). -%D -%D \startbuffer -%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0); -%D -%D fill p rotated 90 withcolor transparent(1,.5,yellow) ; -%D fill p rotated 210 withcolor transparent(1,.5,green) ; -%D fill p rotated 330 withcolor transparent(1,.5,blue) ; -%D \stopbuffer -%D -%D \typebuffer -%D -%D \startlinecorrection \processMPbuffer \stoplinecorrection -%D -%D One can also communicate colors between \CONTEXT\ and -%D \METAPOST: -%D -%D \startbuffer -%D \definecolor[tcyan] [c=1,k=.2,t=.5] -%D \definecolor[tmagenta][m=1,k=.2,t=.5] -%D \definecolor[tyellow] [y=1,k=.2,t=.5] -%D \stopbuffer -%D -%D \typebuffer \getbuffer -%D -%D \startbuffer -%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0); -%D -%D fill p rotated 90 withcolor \MPcolor{tcyan} ; -%D fill p rotated 210 withcolor \MPcolor{tmagenta} ; -%D fill p rotated 330 withcolor \MPcolor{tyellow} ; -%D \stopbuffer -%D -%D \startlinecorrection \processMPbuffer \stoplinecorrection -%D -%D We save all the three components needed in one macro, -%D just to save hash space. - -\def\@@MPST{@MPST@} - -\def\assignMPStransparency#1#2#3% - {\edef\PDFtransparencyidentifier{#1}% - \edef\PDFtransparencyreference {#2}% - \edef\PDFtransparencycolorspecs{#3}} - -% \def\PDFtransparencyspec -% {\ifx\MPresolvedspace\MPgrayspace -% \MPresolvedcolor\space g \MPresolvedcolor\space G% -% \else\ifx\MPresolvedspace\MPrgbspace -% \MPresolvedcolor\space rg \MPresolvedcolor\space RG% -% \else\ifx\MPresolvedspace\MPcmykspace -% \MPresolvedcolor\space k \MPresolvedcolor\space K% -% \else\ifx\MPresolvedspace\empty\else -% /\MPresolvedspace\space cs \MPresolvedcolor\space sc -% /\MPresolvedspace\space CS \MPresolvedcolor\space SC% -% \fi\fi\fi\fi} - -\def\PDFtransparencyspec % todo - {\ifx\MPresolvedspace\MPgrayspace - \MPresolvedcolor\space g - \MPresolvedcolor\space G% - \else\ifx\MPresolvedspace\MPrgbspace - \MPresolvedcolor\space rg - \MPresolvedcolor\space RG% - \else\ifx\MPresolvedspace\MPcmykspace - \MPresolvedcolor\space k - \MPresolvedcolor\space K% - \else\ifx\MPresolvedspace\empty\else - /\MPresolvedspace\space cs - /\MPresolvedspace\space CS - \PDFgetspotcolorspec\MPresolvedcolor - \fi\fi\fi\fi} - -\defineMPspecial{3} % rgb - {\edef\currentMPspecial{\gMPs6}% - \presetPDFtransparency{\gMPs1}{\gMPs2}% - \expanded{\resolveMPrgbcolor\gMPs3 \gMPs4 \gMPs5}\end - \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! - {\noexpand\assignMPStransparency - {\PDFtransparencyidentifier}% - {\PDFtransparencyreference}% - {\PDFtransparencyspec}}} - -\defineMPspecial{4} % cmyk - {\edef\currentMPspecial{\gMPs7}% - \presetPDFtransparency{\gMPs1}{\gMPs2}% - \expanded{\resolveMPcmykcolor\gMPs3 \gMPs4 \gMPs5 \gMPs6}\end - \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! - {\noexpand\assignMPStransparency - {\PDFtransparencyidentifier}% - {\PDFtransparencyreference}% - {\PDFtransparencyspec}}} - -% \defineMPspecial{5} % spot -% {\edef\currentMPspecial{\gMPs5}% -% \presetPDFtransparency{\gMPs1}{\gMPs2}% -% \checkMPspot{\gMPs3}{\gMPs4}% -% \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! -% {\noexpand\assignMPStransparency -% {\PDFtransparencyidentifier}% -% {\PDFtransparencyreference}% -% {\PDFtransparencyspec}}} - -\defineMPspecial{5} % spot - {\edef\currentMPspecial{\gMPs7}% - \presetPDFtransparency{\gMPs1}{\gMPs2}% - \checkMPspot{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}% - \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug ! - {\noexpand\assignMPStransparency - {\PDFtransparencyidentifier}% - {\PDFtransparencyreference}% - {\PDFtransparencyspec}}} - -% beware: for the moment only supported in pdftex; needs a cleanup! - -\def\registerMPcolorspace - {\doifobjectreferencefoundelse{PDFCS}\MPspotspace - {\doPDFgetobjectreference{PDFCS}\MPspotspace\PDFobjectreference - \xdef\currentMPcolorspaces - {\currentMPcolorspaces\MPspotspacespec\PDFobjectreference\space}} - \donothing} - -%D We need to add resource specifications! - -\appendtoks - \global\let\currentMPcolorspaces\empty -\to \MPstartresources - -\appendtoks - \ifx\currentMPcolorspaces\empty \else - \xdef\currentPDFresources{\currentPDFresources - /ColorSpace <<\currentMPcolorspaces>>}% - \fi -\to \MPstopresources - -%D For efficiency reasons, we fall back on the allocation -%D mechanisms already present. For use within \MPTOPDF, we -%D provide a fall back routine. - -\let\currentMPtransparencies\empty - -% \def\invokeMPtransparencyspecial -% {\doifdefined{\@@MPST\currentMPspecial} -% {\getvalue{\@@MPST\currentMPspecial}% -% \doifinstringelse -% {\PDFtransparencyidentifier}{\currentMPtransparencies} -% {} -% {\xdef\currentMPtransparencies -% {\currentMPtransparencies -% \PDFtransparencyidentifier\space -% \PDFtransparencyreference\space}}% -% \def\extraMPpathcode{ Q}% -% \PDFcode{q -% \PDFtransparencycolorspecs\space -% \PDFtransparencyidentifier\space gs}}} - -% this one triggers a new graphic state - -\def\invokeMPtransparencyspecial - {\scratchcounter\MPrgbnumber\lastMPbvalue - \edef\currentMPspecial{\the\scratchcounter}% - \ifundefined{\@@MPST\currentMPspecial}\else - \getvalue{\@@MPST\currentMPspecial}% - \doifinstringelse\PDFtransparencyidentifier\currentMPtransparencies - \donothing\registerMPtransparencyresource % slow - \PDFcode - {\PDFtransparencycolorspecs\space - \PDFtransparencyidentifier\space gs}% - % potential optimization - % \setevalue{\@@MPST\currentMPspecial}% - % {\PDFcode - % {\PDFtransparencycolorspecs\space - % \PDFtransparencyidentifier\space gs}}% - % \getvalue{\@@MPST\currentMPspecial}% - \let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial - \fi} - -% this one does a reset - -\let\revokeMPtransparencyspecial\relax - -\appendtoks - \revokeMPtransparencyspecial -\to \MPstopresources - -\def\dorevokeMPtransparencyspecial % only called if state is set - {\ifx\PDFtransparencyresetidentifier\empty\else - \doifinstringelse\PDFtransparencyresetidentifier\currentMPtransparencies - \donothing\registerMPtransparencyresetresource - \PDFcode{\PDFtransparencyresetidentifier\space gs}% - % potential optimization - % \def\dorevokeMPtransparencyspecial - % {\PDFcode - % {\PDFtransparencycolorspecs\space - % \PDFtransparencyidentifier\space gs}}% - \let\dorevokeMPtransparencyspecial\dodorevokeMPtransparencyspecial - \let\revokeMPtransparencyspecial\relax % invoke sets it - \fi} - -% and this one a simplified reset - -% \def\dodorevokeMPtransparencyspecial % used after first invocation -% {\getvalue{\@@MPST0}% -% \PDFcode{\PDFtransparencyidentifier\space gs}} - -\def\dodorevokeMPtransparencyspecial % used after first invocation - {\PDFcode{\PDFtransparencyresetidentifier\space gs}% - \let\revokeMPtransparencyspecial\relax} % invoke sets it - -% add a resource entry - -\def\registerMPtransparencyresource - {\xdef\currentMPtransparencies - {\currentMPtransparencies - \PDFtransparencyidentifier\space - \PDFtransparencyreference\space}} - -\def\registerMPtransparencyresetresource - {\xdef\currentMPtransparencies - {\currentMPtransparencies - \PDFtransparencyresetidentifier\space - \PDFtransparencyresetreference\space}} - -\appendtoks \invokeMPtransparencyspecial \to \invokeMPspecials - -\ifCONTEXT \else - - \def\@@MPSTN{@MPSTN@} - \def\@@MPSTO{@MPSTO@} - - \newcount\PDFcurrenttransparency - - \let\PDFtransparencyresetidentifier\empty - \let\PDFtransparencyresetreference \empty - - \let\PDFtransparencyidentifier\empty - \let\PDFtransparencyreference \empty - - \def\initializePDFtransparency - {\global\let\initializePDFtransparency\relax - \presetPDFtransparency{1}{1}% - \xdef\PDFtransparencyresetidentifier{/Tr0}% - \xdef\PDFtransparencyresetreference{\the\pdflastobj\space 0 R}} - - \def\presetPDFtransparency#1#2% - {\initializePDFtransparency - \@EA\ifx\csname\@@MPSTO#1:#2\endcsname\relax - \global\advance\PDFcurrenttransparency \plusone - \immediate\pdfobj{\PDFtransparencydictionary{#1}{#2}{}}% - \setxvalue{\@@MPSTN#1:#2}{\the\PDFcurrenttransparency}% - \setxvalue{\@@MPSTO#1:#2}{\the\pdflastobj}% - \fi - \edef\PDFtransparencyidentifier{/Tr\getvalue{\@@MPSTN#1:#2}}% - \edef\PDFtransparencyreference{\getvalue{\@@MPSTO#1:#2} 0 R}} - - \def\PDFtransparencydictionary#1#2#3% type fraction extras - {<>} - -\fi - -\appendtoks - \global\let\currentMPtransparencies\empty -\to \MPstartresources - -\appendtoks - \ifx\currentMPtransparencies\empty \else - \xdef\currentPDFresources{\currentPDFresources - /ExtGState <<\currentMPtransparencies>>}% - \fi -\to \MPstopresources - -%D In all cases, we need to keep track of the resources -%D used. - -%D A few auxiliary macros: - -\def\MPgrayspace{DeviceGray} -\def\MPrgbspace {DeviceRGB} -\def\MPcmykspace{DeviceCMYK} -\let\MPspotspace\MPgrayspace - -\def\MPcmykBlack{0 0 0 0} -\def\MPcmykWhite{0 0 0 1} - -\ifCONTEXT - - \def\startMPcolorresolve - {\bgroup - \def\dostartgraycolormode##1% - {\global\let\MPresolvedspace\MPgrayspace - \xdef\MPresolvedcolor{##1}}% - \def\dostartrgbcolormode ##1##2##3% - {\global\let\MPresolvedspace\MPrgbspace - \xdef\MPresolvedcolor{##1 ##2 ##3}}% - \def\dostartcmykcolormode##1##2##3##4% - {\global\let\MPresolvedspace\MPcmykspace - \xdef\MPresolvedcolor{##1 ##2 ##3 ##4}}% - \def\dostartspotcolormode##1##2% - {\global\let\MPspotspace\empty - \xdef\MPresolvedspace{##1}% - \xdef\MPresolvedcolor{##2}% - \global\let\MPspotspace\MPresolvedspace}% signal - \dostartgraycolormode\!!zerocount} % kind of hackery initialization - - \let\stopMPcolorresolve\egroup - - \def\resolveMPrgbcolor#1 #2 #3\end - {\startMPcolorresolve - \execcolorR#1:#2:#3:0:0\od - \stopMPcolorresolve} - - \def\resolveMPcmykcolor#1 #2 #3 #4\end - {\startMPcolorresolve - \execcolorC#1:#2:#3:#4:0:0\od - \stopMPcolorresolve} - - \def\resolveMPgraycolor#1\end - {\startMPcolorresolve - \execcolorS#1:0:0\od - \stopMPcolorresolve} - -% \def\resolveMPspotcolor#1 #2\end -% {\startMPcolorresolve -% \execcolorP#1:#2:0:0\od -% \stopMPcolorresolve} - - \def\resolveMPspotcolor#1 #2 #3 #4\end - {\startMPcolorresolve - \ifnum#2>\plusone - \checkmultitonecolor{#1}% - \fi - \execcolorP#1:#2:#3:#4:0:0\od - \stopMPcolorresolve} - -\else - - \def\resolveMPspotcolor#1 #2\end - {\global\let\MPresolvedspace\MPgrayspace - \xdef\MPresolvedcolor{0}} - - \def\resolveMPrgbcolor#1 #2 #3\end - {\global\let\MPresolvedspace\MPrgbspace - \xdef\MPresolvedcolor{#1 #2 #3}} - - \def\resolveMPcmykcolor#1 #2 #3 #4\end - {\global\let\MPresolvedspace\MPcmykspace - \xdef\MPresolvedcolor{#1 #2 #3 #4}} - - \def\resolveMPgraycolor#1\end - {\global\let\MPresolvedspace\MPgrayspace - \xdef\MPresolvedcolor{#1}} % should be inverted - -\fi - -\protect \endinput diff --git a/tex/context/base/supp-mps.mkii b/tex/context/base/supp-mps.mkii new file mode 100644 index 000000000..9864cd9a1 --- /dev/null +++ b/tex/context/base/supp-mps.mkii @@ -0,0 +1,2133 @@ +%D \module +%D [ file=supp-mps, +%D version=1997.07.05, +%D title=\CONTEXT\ Support Macros, +%D subtitle=\METAPOST\ Inclusion, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Forget about generic modules \unknown\ ... + +\ifx \undefined \contextversion \endinput \fi + +%D \METAPOST\ is John Hobbys alternative for \METAFONT\ and +%D produces superior \POSTSCRIPT\ code. In this module we +%D integrate \METAPOST\ support int \CONTEXT. We offer two +%D tracks: +%D +%D \startitemize +%D \item generating \METAPOST\ code, running this program from +%D within \TEX\ using \type{\write18}, and importing the +%D result +%D \item generating \METAPOST\ code, processing the code +%D afterward, and importing the result in a second pass +%D \stopitemize +%D +%D The first approach uses a non standard \TEX\ feature, +%D implemented in Web2c. I'm not going to discuss the pros and +%D cons of running programs from within others, but all +%D arguments against this can be overcome by implementing a +%D \TEX\ worthy primitive: +%D +%D \starttyping +%D \excuteMetaPost filename +%D \stoptyping +%D +%D Ok then, let's start: + +\writestatus{loading}{ConTeXt Support Macros / MetaPost Inclusion} + +\unprotect + +\def\@@MPG{@MPG@} + +%D First we define a handy constant: + +\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup + +% todo : sort out ^^M, \par and ; mess + +%D \macros +%D {everyMPgraphic} +%D +%D Because some graphics interact with \TEX\ (i.e.\ \CONTEXT), we +%D provide a hook for additional actions: \type {\everyMPgraphic}. + +\newtoks\everyMPgraphic \everyMPgraphic{\everyMPgraphic\emptytoks} + +%D \macros +%D {startMPgraphic} +%D +%D From within \TEX\ one can execute \METAPOST\ code by putting +%D it between the two commands +%D +%D \starttyping +%D \startMPgraphic +%D \stopMPgraphic +%D \stoptyping +%D +%D This is implemented as: + +\let\stopMPgraphic\relax + +\long\def\startMPgraphic#1\stopMPgraphic + {\startwritingMPgraphic + \writecheckedMPgraphic{#1}% % potential speedup: pass #1 as macro + \stopwritingMPgraphic} + +%D \macros +%D {startMPrun} +%D +%D If we just want to run \METAPOST\ code, that is, not to +%D explictly generate a figure in terms of \type{beginfig} and +%D \type{endfig}, we can use: +%D +%D \starttyping +%D \startMPgraphic +%D \stopMPgraphic +%D \stoptyping +%D +%D \starttyping +%D \startMPrun +%D \stopMPrun +%D \stoptyping +%D +%D The next booleans are for internal purposes only. + +% some day a bit more more clear: +% +% run directly/run afterwards/run external defined +% insert directly/insert whenever +% use object/don't use objects + +\newif\ifMPgraphics \MPgraphicstrue +\newif\ifMPrun \MPrunfalse +\newif\ifMPwrapper \MPwrappertrue + +\let\stopMPrun\relax + +\ifCONTEXT + + \long\def\dostartMPrun#1#2\stopMPrun + {\bgroup + \MPruntrue + \doifsomething{#1}{\def\MPgraphicfile{#1}}% + \startwritingMPgraphic + \writecheckedMPgraphic{#2}% + \stopwritingMPgraphic + \egroup} + + \def\startMPrun + {\dosinglegroupempty\dostartMPrun} + +\else + + \long\def\startMPrun#1\stopMPrun + {\MPruntrue + \startwritingMPgraphic + \writecheckedMPgraphic{#1}% + \stopwritingMPgraphic + \MPrunfalse} + +\fi + +%D \macros +%D {startwritingMPgraphic, +%D writeMPgraphic, +%D stopwritingMPgraphic} +%D +%D If the writing process is divided into more steps, one can +%D use the components of this macro directly. +%D +%D \starttyping +%D \startwritingMPgraphic +%D ... +%D \writeMPgraphic{...} +%D ... +%D \writeMPgraphic{...} +%D ... +%D \stopwritingMPgraphic +%D \stoptyping + +%D \macros +%D {ifrunMPgraphics,ifrunMPTEXgraphics,ifinsertMPgraphics} +%D +%D These macros look a bit more complicated that one would +%D expect at first sight. This is due to the two ways of +%D processing these graphics, mentioned in a previous +%D paragraph. Which method is used, the direct or indirect +%D one, depends on a boolean. + +\newif\ifrunMPgraphics \runMPgraphicsfalse +\newif\ifrunMPTEXgraphics \runMPTEXgraphicsfalse +\newif\ifinsertMPgraphics \insertMPgraphicstrue + +%D If set to true, one can do with a single pass, else one must +%D process the \METAPOST\ file \type{mpgraph} between two +%D succesive \TEX\ runs. + +\ifx\MPgraphicfile\undefined + +\def\MPgraphicfile{mp\ifMPrun run\else graph\fi} +\def\MPruntimefile{mprun} + +\fi + +%D \macros +%D {MPgraphic} +%D +%D When we run \METAPOST\ from within \TEX, each graphic is +%D processed at once, which means that we reuse this file many +%D times. When however the execution is delayed, all graphics +%D are saved in a separate figure. The current graphic is +%D characterized bij a \COUNTER. This counter is available +%D in \type{\MPgraphic}. + +\newcount\nofMPgraphics +\newcount\currentMPgraphic + +\def\MPgraphic{0} + +% %D \macros +% %D {ifreuseMPgraphics} +% %D +% %D If one want to reuse grapics, one can save much redundant +% %D run time by setting the next switch to true. +% +% \newif\ifreuseMPgraphics \reuseMPgraphicstrue + +%D The three macros responsible for writing the graphic +%D implement both schemes. + +%D \macros +%D {MPinclusions, startMPinclusions, MPinitializations} +%D +%D One can include for instance common input commands by +%D passing them to \type{\MPinclusions}: +%D +%D \starttyping +%D \startMPinclusions +%D input mp-mine ; +%D \stopMPinclusions +%D \stoptyping +%D +%D \starttyping +%D \MPinclusions{input mp-mine} +%D \stoptyping +%D +%D These commands reset their content each time. You can append +%D code as follows: +%D +%D \starttyping +%D \startMPinclusions[+] +%D input mp-mine ; +%D \stopMPinclusions +%D \stoptyping +%D +%D The token register \type {\MPinitializations} is expanded +%D before all other inclusions, the extensions are expanded +%D only once per run. + +%D The next hack prevents too long lines: + +\long\def\runtimeobeyMPlines + {\ifx\rawcharacter\undefined + \let\obeyedline\space + \else + \obeylines + \ifx\outputnewlinechar\undefined + \edef\obeyedline{\rawcharacter{\endlinechar}}% + \else + \let\obeyedline\outputnewlinechar + \fi + \fi} + +\long\def\obeyMPlines % anyhow, we end up with ^^M's in the input + {\obeylines + \let\obeyedline\relax} % delay expansion + +\ifx\everydump\undefined + % maybe we're not using context +\else + \appendtoks + \let\obeyMPlines\runtimeobeyMPlines + \to \everydump +\fi + +%D We use two distinguished token registers: + +\newtoks \MPextensions % once per run (can be multiple graphics) +\newtoks \MPinitializations % each graphic + +\let\stopMPextensions \relax % so that we can use it in \expanded +\let\stopMPinitializations\relax % so that we can use it in \expanded +\let\stopMPinclusions \relax % so that we can use it in \expanded + +\def\startMPextensions % no text checking done here ! + {\begingroup + \obeyMPlines + \dostartMPextensions} + +\def\dostartMPextensions#1\stopMPextensions + {\endgroup + \MPextensions\expandafter{\the\MPextensions#1}} + +\def\startMPinitializations % no text checking done here ! + {\begingroup + \obeyMPlines + \dostartMPinitializations} + +\def\dostartMPinitializations#1\stopMPinitializations + {\endgroup + \MPinitializations\expandafter{\the\MPinitializations#1}} + +\def\startMPinclusions + {\begingroup + \dosingleempty\dostartMPinclusions} + +\long\def\dostartMPinclusions + {\obeyMPlines + \dodostartMPinclusions} + +\long\def\dodostartMPinclusions[#1]#2\stopMPinclusions % document wide + {\endgroup + \doifelse{#1}{+} + {\@EA\long\@EA\def\@EA\theMPinclusions\@EA + {\theMPinclusions + \writeMPgraphic{#2}}} + {\long\def\theMPinclusions + {% \expanded ! +% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}% new + \writeMPgraphic{#2}}}} + +\def\MPinclusions + {\dosingleempty\doMPinclusions} + +\long\def\doMPinclusions[#1]#2% + {\startMPinclusions[#1]#2\stopMPinclusions} + +\def\theMPextensions + {\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}} + +\def\theMPinitializations + {\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}} + +\startMPinclusions \stopMPinclusions + +%D \macros +%D {iflongMPlines} +%D +%D When grabbing a graphic deifnition, newlines are turned +%D into spaces. By default we split the graphic definition +%D at the colon, but long lines are still possible by +%D setting the next boolean to true. + +\newwrite\MPwrite +\newwrite\MPstaticwrite + +\newif\iflongMPlines \longMPlinestrue % we now have \obeyMPlines + +\ifx \overlaywidth \undefined \def \overlaywidth {4cm} \fi +\ifx \overlayheight \undefined \def \overlayheight {3cm} \fi +\ifx \overlaylinewidth \undefined \def \overlaylinewidth {0pt} \fi + +\def\presetMPdefinitions + {\edef\overlaywidth {\overlaywidth \space}% + \edef\overlayheight {\overlayheight \space}% + \edef\overlaylinewidth {\overlaylinewidth\space}% + \edef\currentwidth {\the\hsize \space}% + \edef\currentheight {\the\vsize \space}} + +%D The \type {;} aware method (the \type {\else} branch) also +%D takes care of \type {btex}||\type {etex}, \type +%D {verbatimtex}||\type {etex}. The space after \type {tex} +%D is essential, since it protects \type {text}. + +\newif\ifMPTEXgraphic + +\let\bufferedMPgraphicsline\empty + +\appendtoks + \globallet\bufferedMPgraphicsline\empty +\to \everyMPgraphic + +\chardef\MPgraphicsscanmode\plustwo % 0=no scanning, 1=simple scanning, 2=less simple, 3=even less + +% the next fails with \chardef\MPgraphicsscanmode\plusone +% +% \startMPextensions +% gp_num_points_with_tex := 3 ; +% \stopMPextensions + +\def\writeMPgraphic % no big #1 passing here + {\iflongMPlines + \ifMPTEXgraphic + \ifcase\MPgraphicsscanmode + \let\next\writeMPgraphiclongR + \else + \let\next\writeMPgraphiclongT + \fi + \else + \let\next\writeMPgraphiclongN + \fi + \else + \ifMPTEXgraphic + \ifcase\MPgraphicsscanmode + \let\next\writeMPgraphicshortN % we could \let \writeMPgraphicshortR\writeMPgraphicshortN + \else + \let\next\writeMPgraphicshortT + \fi + \else + \let\next\writeMPgraphicshortN + \fi + \fi + \next} + +\appendtoks \obeyMPlines \to \everyMPgraphic % more efficient than in each following grouped write + +\long\def\writeMPgraphiclongR#1% fast, no scanning + {\bgroup + \let\par\space + \immediate\write\MPwrite{#1}% + \egroup} + +\long\def\writeMPgraphiclongT#1% + {\bgroup + \let\par\space + \longMPflushT#1\empty\par\relax\par + \egroup} + +\long\def\writeMPgraphicshortT#1% + {\bgroup + \let\par\space + \shortMPflushT#1\empty;\relax;% + \egroup} + +\long\def\longMPflushT#1#2\par + {\ifx#1\relax \else + \dowriteMPgraphicline#1#2tex \relax etex\MPend + \expandafter\longMPflushT + \fi} + +\long\def\shortMPflushT#1#2;% + {\ifx#1\relax \else + \dowriteMPgraphicline#1#2tex \relax etex\MPend + \expandafter\shortMPflushT + \fi} + +\long\def\writeMPgraphiclongN#1% + {\bgroup + \let\par\space + \longMPflushN#1\empty\par\relax\par + \egroup} + +\long\def\writeMPgraphicshortN#1% + {\bgroup + \let\par\space + \shortMPflushN#1\empty;\relax;% + \egroup} + +\long\def\longMPflushN#1#2\par + {\ifx#1\relax \else + \nowriteMPgraphicline#1#2\MPend + \expandafter\longMPflushN + \fi} + +\long\def\shortMPflushN#1#2;% + {\ifx#1\relax \else + \nowriteMPgraphicline#1#2\MPend + \expandafter\shortMPflushN + \fi} + +\def\dowriteMPgraphicline{\futurelet\next\dodowriteMPgraphicline} +\def\nowriteMPgraphicline{\futurelet\next\nonowriteMPgraphicline} + +%D Will move (check if next is needed): + +\long\def\nonowriteMPgraphicline#1\MPend + {\ifx\next\empty\else\ifx\next\relax\else + \bgroup + \let\par\space + \iflongMPlines + %\immediate\write\MPwrite{#1;}% oeps, ; invalid + \immediate\write\MPwrite{#1}% + \else + \long\edef\ascii{#1}% + \expandafter\flushMPgraphicline\ascii\empty;\relax;% + \fi + \egroup + \fi\fi} + +%D A first version: +%D +%D \starttyping +%D \long\def\dodowriteMPgraphicline#1tex #2#3etex#4\MPend% +%D {\ifx\next\empty\else\ifx\next\relax\else +%D \bgroup +%D \let\par=\space +%D \ifx#2\relax +%D \immediate\write\MPwrite{#1;}% +%D \egroup +%D \else +%D \global\MPTEXgraphictrue +%D \convertargument#2#3\to\ascii +%D \immediate\write\MPwrite{#1tex \ascii etex}% +%D \egroup +%D \dowriteMPgraphicline#4tex \relax etex\MPend +%D \fi +%D \fi\fi} +%D \stoptyping + +%D The next alternative also handles inclusions well. + +\newtoks \everyMPTEXgraphic + +\newif\ifforceMPTEXgraphic + +%D Before we supported the graph module, we had: +%D +%D \starttyping +%D \convertargument etex\to\MPasciiB +%D \convertargument textext\to\MPasciiC % geen "text" +%D \convertargument graphictext\to\MPasciiD % geen "text" +%D +%D \long\def\checkMPTEXgraphic#1% +%D {\ifforceMPTEXgraphic +%D \global\MPTEXgraphictrue +%D \else +%D \expandafter\convertargument#1\to\MPasciia +%D \doifstringinstringelse\MPasciiB\MPasciia{\global\MPTEXgraphictrue} +%D {\doifstringinstringelse\MPasciiC\MPasciia{\global\MPTEXgraphictrue} +%D {\doifstringinstringelse\MPasciiD\MPasciia{\global\MPTEXgraphictrue} +%D {\global\MPTEXgraphicfalse}}}% +%D \fi} +%D \stoptyping +%D +%D The next alternative permits extensions in other modules +%D without the need to know the details of testing. + +\newtoks\MPTEXgraphicchecks + +\long\def\writecheckedMPgraphic#1% + {\ifforceMPTEXgraphic + \global\MPTEXgraphictrue + \else + \global\MPTEXgraphicfalse + \edef\ascii{#1}\convertcommand\ascii\to\MPascii + \the\MPTEXgraphicchecks\relax % \relax is end condition! + \fi + \flushMPTEXgraphic % verbatimtex etc + \writeMPgraphic{#1}} % potential optimization: pass \ascii + +%D We could have used a kind of array approach using a +%D counter appended to \type {MPascii}, but this is an +%D as efficient alternative. (The uglyness comes from +%D expanding after the string \type {#1}). + +\let\MPTEXchecklist\empty + +\def\forceMPTEXcheck#1% + {\addtocommalist{#1}\MPTEXchecklist + \expanded{\convertargument#1\noexpand\to + \@EA\noexpand\csname MPascii#1\endcsname}% + \@EA\appendtoks + \@EA\doifincsnameelse\csname MPascii#1\endcsname\MPascii + {\global\MPTEXgraphictrue\gobbleuntil\relax}\donothing + \to \MPTEXgraphicchecks} + +\forceMPTEXcheck{etex} +\forceMPTEXcheck{textext} +\forceMPTEXcheck{graphictext} + +%D \starttyping +%D \forceMPTEXgraphictrue +%D +%D \forceMPTEXcheck{lintext} +%D \forceMPTEXcheck{logtext} +%D +%D \startMPcode +%D draw hlintext.lft(0, 20, 5, 20cm, "@3e") ; +%D draw vlogtext.bot(0, 10, 9, 10cm, "@3e") ; +%D \stopMPcode +%D \stoptyping + +%D A goodie for Mojca (the gnuplot wizzard): +%D +%D \starttyping +%D \startMPcode +%D draw fullcircle scaled 4cm ; +%D draw \textext{$\sqrt{\frac{3}{2}^3}$} ; +%D \stopMPcode +%D \stoptyping + +\long\def\textext#1{\normalunexpanded{textext("#1")}} % or \detokenize + +\def\flushMPTEXgraphic + {\ifMPTEXgraphic + \immediate\write\MPwrite{verbatimtex \the\everyMPTEXgraphic\space etex;}% + \fi} + +\long\def\flushMPgraphicline#1#2;% + {\ifx#1\relax \else + \immediate\write\MPwrite{#1#2;}% + \expandafter\flushMPgraphicline + \fi} + +% the next one fails on btex \vbox {\hbox .. leading to \vbox \hbox +% +% \long\def\dodowriteMPgraphicline#1tex #2#3etex#4\MPend +% {\ifx\next\empty\else\ifx\next\relax\else +% \bgroup +% \let\par\space +% \ifx#2\relax +% \iflongMPlines +% \immediate\write\MPwrite{#1;}% +% \else +% \edef\ascii{#1}% +% \expandafter\flushMPgraphicline\ascii\empty;\relax;% +% \fi +% \egroup +% \else +% \convertargument#2#3\to\ascii +% \immediate\write\MPwrite{#1tex \ascii etex}% +% \egroup +% \dowriteMPgraphicline#4tex \relax etex\MPend +% \fi +% \fi\fi} +% +% so we need a two step approach + +% \long\def\dodowriteMPgraphicline#1tex % +% {\doifnextcharelse\relax +% {\nododowriteMPgraphicline{#1}} +% {\redodowriteMPgraphicline{#1}}} +% +% better and faster + +% \long\def\dodowriteMPgraphicline#1tex #2% +% {\ifx#2\relax +% \expandafter\nododowriteMPgraphicline +% \else +% \expandafter\redodowriteMPgraphicline +% \fi{#1} #2} +% +% \long\def\redodowriteMPgraphicline#1#2etex#3\MPend +% {\ifx\next\empty\else\ifx\next\relax\else +% \bgroup +% \let\par\space +% \convertargument#2\to\ascii +% \immediate\write\MPwrite{#1tex \ascii etex}% +% \egroup +% \dowriteMPgraphicline#3tex \relax etex\MPend +% \fi\fi} +% +% \long\def\nododowriteMPgraphicline#1#2\MPend +% {\ifx\next\empty\else\ifx\next\relax\else +% \bgroup +% \let\par\space +% \iflongMPlines +% \immediate\write\MPwrite{#1;}% +% \else +% \long\edef\ascii{#1}% +% \expandafter\flushMPgraphicline\ascii\empty;\relax;% +% \fi +% \egroup +% \fi\fi} + +% extra scanning + +\long\def\dodowriteMPgraphicline#1tex #2% kind of ok + {\ifx#2\relax + \expandafter\nododowriteMPgraphicline + \else + \ifcase\MPgraphicsscanmode + % can't happen + \or + \@EAEAEA\redodowriteMPgraphicline + \or + \doifinstringelse{b$} {#1$}{\@EAEAEA\redodowriteMPgraphicline}% + {\doifinstringelse{verbatim$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% + {\@EAEAEA\dododowriteMPgraphicline}}% + \else + \doifinstringelse { b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% + {\doifinstringelse {(b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% + {\doifinstringelse {=b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% + {\doifinstringelse{verbatim$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% + {\@EAEAEA\dododowriteMPgraphicline}}}}% + \fi + \fi{#1} #2} + +\def\dododowriteMPgraphicline#1#2\MPend + {\doifsomething{#1}{\xdef\bufferedMPgraphicsline{\bufferedMPgraphicsline#1tex }}% + \dowriteMPgraphicline#2tex \relax etex\MPend} + +\long\def\redodowriteMPgraphicline#1#2etex#3\MPend + {\ifx\next\empty + \else\ifx\next\relax + \else + \bgroup + \let\par\space + \convertargument#2\to\ascii + \immediate\write\MPwrite{\bufferedMPgraphicsline#1tex \ascii etex}% + \globallet\bufferedMPgraphicsline\empty + \egroup + \dowriteMPgraphicline#3tex \relax etex\MPend + \fi\fi} + +\long\def\nododowriteMPgraphicline#1#2\MPend + {\ifx\next\empty + \else\ifx\next\relax + \else + \bgroup + \let\par\space + \iflongMPlines + \immediate\write\MPwrite{\bufferedMPgraphicsline#1;}% + \globallet\bufferedMPgraphicsline\empty + \else + \long\edef\ascii{\bufferedMPgraphicsline#1}% + \expandafter\flushMPgraphicline\ascii\empty;\relax;% + \fi + \egroup + \fi\fi} + +%D This stripper is suboptimal in the sense that more +%D \type{;}'s are output than feasible. Anyhow, \METAPOST\ +%D can handle this and users may consider it being a sort +%D of error prevention bonus. + +\ifx\blabelgroup\undefined + + \let\blabelgroup\bgroup + \let\elabelgroup\egroup + +\fi + +\newconditional\firstMPgraphic \settrue\firstMPgraphic + +\appendtoks + \let \# \letterhash + \let \_ \letterunderscore + \let \& \letterampersand + \let \{ \letteropenbrace + \let \} \letterclosebrace +\to \everyMPgraphic + +%D Not the best place but we need to make sure that no funny +%D active characters creep in. Some day we will move this code. + +\ifx\disablediscretionaries\undefined + \let\disablediscretionaries\relax +\fi + +\appendtoks + \disablediscretionaries +\to \everyMPgraphic + +\def\writeMPgraph + {\immediate\write\MPwrite{mpgraph:=\the\currentMPgraphic;}} + +\def\startwritingMPgraphic + {\blabelgroup + \global\advance\nofMPgraphics \plusone + \ifMPrun \else + \allocateMPslot\currentMPgraphic + \fi + \enableincludeMPgraphics + \xdef\MPgraphic{\the\currentMPgraphic}% + \the\everyMPgraphic + \presetMPdefinitions % moved to here from \writeMPgraphic + \ifrunMPgraphics + \openMPgraphicfile1{runtime}% + % no reset here ! + \theMPextensions + \theMPinclusions + \else + \openMPgraphicfile0{collected}% + % reset here ! global added (due to adding \blabelgroup) + \theMPextensions + \theMPinclusions + \global\let\theMPextensions\relax + \global\let\theMPinclusions\relax + \fi + \theMPinitializations % always + \ifMPrun + \else + \ifMPwrapper + \immediate\write\MPwrite{let mprunend = end ;}% + \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}% + \fi + \fi + \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic + \globallet\stopwritingMPgraphic\dostopwritingMPgraphic} + +\let\MPgraphicfiles\empty + +\let\MPinputtranslation\empty + +\def\openMPgraphicfile#1#2% #1=alwaysopen #2=message + {\@EA\ifx\csname\@@MPG\@@MPG\MPgraphicfile\endcsname\relax + \donetrue + % \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname + % for the sake of plain usage + \@EA\@EA\csname newwrite\endcsname\csname\@@MPG\@@MPG\MPgraphicfile\endcsname + \doglobal\addtocommalist\MPgraphicfile\MPgraphicfiles + \else + \ifcase#1\relax\donefalse\else\donetrue\fi + \fi + \@EA\let\@EA\MPwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname + \ifdone + \immediate\openout\MPwrite\MPgraphicfile.mp\relax + \ifx\MPinputtranslation\empty\else + \immediate\write\MPwrite{\MPinputtranslation}% + \immediate\write\MPwrite{verbatimtex \MPinputtranslation etex ;}% + \fi + \immediate\write\MPwrite{\letterpercent\space #2 graphics of job "\jobname"}% + \writeMPgraph + \setMPrandomseed + \fi} + +\def\dostopwritingMPgraphic + {\ifMPrun \else + \ifMPwrapper + \immediate\write\MPwrite{endfig;}% + \immediate\write\MPwrite{let end=mprunend;}% + \fi + \fi + \ifrunMPgraphics + \dodostopwritingMPgraphic + \fi + \elabelgroup} + +\def\dodostopwritingMPgraphic + {\ifnum\currentMPgraphic>\zerocount + \donetrue + \else\ifMPrun + \donetrue + \else + \donefalse + \fi\fi + \ifdone + \finishwritingMPgraphics + \runMPgraphic\MPgraphicfile + \fi + \globallet\flushMPgraphics\relax} + +\def\finishwritingMPgraphics + {\ifMPwrapper\immediate\write\MPwrite{end.}\fi + \immediate\closeout\MPwrite} + +\def\closeMPgraphicfiles + {\ifrunMPgraphics \else \ifx\MPgraphicsfiles\empty\else + \def\docommand##1% + {\message{[flush and process ##1.mp afterwards]}% + \@EA\let\@EA\MPwrite\csname\@@MPG\@@MPG##1\endcsname + \finishwritingMPgraphics}% + \processcommacommand[\MPgraphicfiles]\docommand + \fi \fi} + +\let\stopwritingMPgraphic\relax +\let\flushMPgraphics \relax + +%D By default each graphic gets its own slot (number). Later +%D on we will define a recycle bin. + +\def \allocateMPslot#1{\global\advance#1\plusone} +\def\deallocateMPslot#1{} + +%D \macros +%D {translateMPinput} +%D +%D For my polish friends: +%D +%D \starttyping +%D % translate=il2-pl +%D +%D \translateMPinput{il2-pl} +%D +%D \startMPenvironment[global] +%D \setupbodyfont[plr] +%D \stopMPenvironment +%D +%D \TeX: ± ¶ +%D +%D \startMPcode +%D draw btex MetaPost: ± ¶ etex scaled 5 ; +%D \stopMPcode +%D \stoptyping + +\def\translateMPinput#1% +% {\xdef\MPinputtranslation{\letterpercent -translate-file=#1\space}} % at some point +% {\xdef\MPinputtranslation{\letterpercent --8bit}} % some time later + {\globallet\MPinputtranslation\empty} % the new mpost is 8 bit clean + +%D \macros +%D {setMPrandomseed} +%D +%D Did you notice the random seed initialization? This is +%D needed because \METAPOST\ has a rather poor initialization, +%D which in some implementations depends on the time in +%D minutes. So, in quick successive runs, random is not that +%D random. + +\newif\ifsetMPrandomseed \setMPrandomseedtrue % false by default + +\def\setMPrandomseed + {\ifsetMPrandomseed \ifx\getrandomnumber\undefined \else + \getrandomnumber\localMPseed\zerocount{4095}% + \writeMPgraphic{randomseed:=\localMPseed;}% + \fi\fi} + +%D This feature has become optional. Thanks to Fabrice Popineau, +%D \METAPOST\ can now do a far better job! + +%D \macros +%D {flushMPgraphics} +%D +%D When we use the indirect method, all graphics are saved in +%D one file. This means that we cannot close this file after +%D every \type{\stopMPgraphic}. Therefore we need to say: +%D +%D \starttyping +%D \flushMPgraphics +%D \stoptyping +%D +%D else the file is closed without writing the \METAPOST\ end +%D command. One will notice this fast enough when in indirect +%D mode. When using the direct mode this command is not +%D implicitly needed, but ommiting it makes files less +%D portable. + +%D \macros +%D {loadcurrentMPgraphic, +%D placeMPgraphic} +%D +%D Once defined, we can call for this graphic by saying: +%D +%D \starttyping +%D \loadcurrentMPgraphic{setups} +%D \placeMPgraphic +%D \stoptyping +%D +%D This two stage insert permits some intermediate manipulations +%D of the graphic, which temporary saved in: + +\newbox\MPgraphicbox + +\def\doloadcurrentMPgraphic#1% + {\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{#1}% + \deallocateMPslot\currentMPgraphic} % added + +\ifCONTEXT + \def\loadcurrentMPgraphic{\dosinglegroupempty\doloadcurrentMPgraphic} +\else + \let\loadcurrentMPgraphic\doloadcurrentMPgraphic +\fi + +\def\loadMPgraphic#1#2% + {\setbox\MPgraphicbox\hbox{\ifinsertMPgraphics\insertMPfile{#1}{#2}\fi}} + +\def\MPllx{0} +\def\MPlly{0} + +% \def\placeMPgraphic% +% {\ifMPshiftdrawing +% \hbox{\hskip\MPllx\onebasepoint\raise\MPlly\onebasepoint\box\MPgraphicbox}% +% \else +% \box\MPgraphicbox +% \fi} +% +% experimental: + +\def\placeMPgraphic + {\ifMPshiftdrawing + \edef\next + {\wd\MPgraphicbox\the\wd\MPgraphicbox + \ht\MPgraphicbox\the\ht\MPgraphicbox + \dp\MPgraphicbox\the\dp\MPgraphicbox}% + \setbox\MPgraphicbox\hbox + {\hskip\MPllx\onebasepoint\raise\MPlly\onebasepoint\box\MPgraphicbox}% + \next + \fi + \box\MPgraphicbox} + +%D \macros +%D {startreusableMPgraphic, reuseMPgraphic, useMPbox} +%D +%D One can use the next macro for defining graphics that are +%D to be reused. When the next switch is set, graphics are +%D cached. + +\newif\ifuseMPbox \useMPboxtrue + +%D We assume that one can set objects: +%D +%D \starttyping +%D \def\douseMPbox#1% +%D {\setobject{MP}{#1}\vbox +%D {\forgetall +%D \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% +%D \deallocateMPslot\currentMPgraphic +%D \placeMPgraphic}% +%D \setgvalue{#1}{\getobject{MP}{#1}}} +%D \stoptyping +%D +%D More safe is to use a number for \type {{MP}{#1}} which permits +%D redefinition. We also saves the boundingbox. This helps positioning +%D reused graphics in layers. + +\newcount\MPobjectcounter + +\ifx\getobject\undefined \def\setobject#1#2{\setbox\scratchbox} \fi % makes dep check happy +\ifx\getobject\undefined \def\getobject#1#2{\box \scratchbox} \fi % makes dep check happy + +\def\douseMPbox#1% + {\global\advance\MPobjectcounter\plusone + \setobject{MP}{\number\MPobjectcounter}\vbox + {\forgetall + \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% + \deallocateMPslot\currentMPgraphic + \placeMPgraphic}% + \setxvalue{#1}% + {\noexpand\dodouseMPbox{\number\MPobjectcounter}{\MPllx}{\MPlly}{\MPurx}{\MPury}}} + +\def\dodouseMPbox#1#2#3#4#5% space delimiting would save some tokens + {\xdef\MPllx{#2}% but it's not worth the effort and looks + \xdef\MPlly{#3}% ugly as well + \xdef\MPurx{#4}% + \xdef\MPury{#5}% + \getobject{MP}{#1}} + +\def\nouseMPbox#1% + {\setxvalue{#1}% + {\noexpand\forgetall + \noexpand\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% + \noexpand\deallocateMPslot{\currentMPgraphic}% + \noexpand\placeMPgraphic}} + +\ifCONTEXT \else \let\douseMPbox\nouseMPbox \fi +\ifCONTEXT \else \let\doifobjectssupportedelse\relax \fi + +\long\def\handlereusableMPgraphic#1#2% + {\blabelgroup + \enableincludeMPgraphics + \startMPgraphic#2\stopMPgraphic + \doifobjectssupportedelse\donothing\useMPboxfalse + \ifuseMPbox + \expandafter \douseMPbox + \else + \expandafter \nouseMPbox + \fi {\@@MPG#1}% + \getvalue{\@@MPG#1}% + \elabelgroup} + +% \long\def\startreusableMPgraphic#1#2\stopreusableMPgraphic +% {\ifundefined{\@@MPG#1}% +% \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}}% +% \fi} + +\long\def\dostartreusableMPgraphic#1#2\stopreusableMPgraphic + {\blabelgroup + \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}}% + \elabelgroup} + +\def\reuseMPgraphic#1% + {\blabelgroup + \getvalue{\@@MPG#1}% + \elabelgroup} + +\let\stopreusableMPgraphic \relax % so that we can use it in \expanded + +%D \macros +%D {startuseMPgraphic,useMPgraphic} +%D +%D The every||time||it's||used original one is defined below. +%D This one makes sense when the graphic uses random numbers. +%D +%D We can run (process graphic) without including them at that +%D particular place. Therefore we explicitly disable +%D inclusions (resulting in an dummy figure) when we are in MP +%D run mode (see mfun-004 for an example, we process an +%D example buffer which produced graphics). + +\long\def\handleuseMPgraphic#1#2% + {\bgroup + \enableincludeMPgraphics + \startMPgraphic#2\stopMPgraphic + \ifMPrun \else + \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% + \placeMPgraphic + \fi + \deallocateMPslot\currentMPgraphic + \egroup} + +\long\def\startuseMPgraphic + {\blabelgroup + \obeyMPlines + \dostartuseMPgraphic} + +\long\def\dostartuseMPgraphic#1#2\stopuseMPgraphic + {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}% + \elabelgroup} + +\long\def\startusableMPgraphic + {\blabelgroup + \obeyMPlines + \dostartusableMPgraphic} + +\long\def\dostartusableMPgraphic#1#2\stopusableMPgraphic + {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}% + \elabelgroup} + +\let\useMPgraphic\reuseMPgraphic + +\let\stopuseMPgraphic \relax % so that we can use it in \expanded +\let\stopusableMPgraphic \relax % so that we can use it in \expanded + +%D \macros +%D {doifMPgraphicelse} +%D +%D For (mainly internal) purposes we provide a test macro. + +% \def\doifMPgraphicelse#1% +% {\doifdefinedelse{\@@MPG#1}} + +\def\doifMPgraphicelse#1% + {\blabelgroup + \doifdefinedelse{\@@MPG#1}% + {\elabelgroup\firstoftwoarguments} + {\elabelgroup\secondoftwoarguments}} + +%D \macros +%D {includeMPgraphic} +%D +%D In a graphic one can call up another (predefined one) +%D like: +%D +%D \starttyping +%D \startuseMPgraphic{a} +%D fill fullcircle scaled 100 ; +%D \stopuseMPgraphic +%D +%D \startuseMPgraphic{b} +%D \includeMPgraphic{a} +%D fill fullsquare rotated 45 scaled 50 withcolor red ; +%D \stopuseMPgraphic +%D +%D \useMPgraphic{b} +%D \stoptyping + +\def\includeMPgraphic#1% + {\executeifdefined{\@@MPG#1};} % ; if not found + +\def\enableincludeMPgraphics + {\let\handleuseMPgraphic \secondoftwoarguments + \let\handlereusableMPgraphic\secondoftwoarguments} + +%D We didn't yet define the macro responsible for processing +%D the graphic from within \TEX. + +\def\runMPgraphic#1% + {\ifrunMPgraphics + \executeMETAPOST{#1}% + \else + % \message{[flush and process \MPgraphicfile.mp afterwards]}% + \fi} + +%D \macros +%D {useMETAFUNformat} +%D +%D For faster running, one can generate a format, saying +%D +%D \starttyping +%D mpost -ini context +%D \stoptyping +%D +%D (The resulting \type {mem} file should be moved to the +%D right location. Watch out for misatching \type {progname} +%D directives, since they can clutter memory. + +\newif\ifuseMETAFUNformat + +%D \macros +%D {executeMetaPost, executeMETAPOST, executesystemcommand} +%D +%D With \type{\executeMETAPOST} being defined as: + +\ifx\undefined\executeMETAPOST + \def\executeMETAPOST#1{\executesystemcommand{\executeMetaPost{#1}}} +\fi + +%D There are two system dependant definitions: + +\ifx\undefined\executesystemcommand + \def\executesystemcommand#1{\immediate\write18{#1}} +\fi + +\ifx\TEXEXECcommand \undefined \def\TEXEXECcommand{texmfstart texexec} \fi + +\ifx\undefined\executeMetaPost + + \ifx\undefined\interactionmode \chardef\interactionmode=255 \fi + + \def\MPOSTbatchswitch {-int=batchmode} + \def\MPOSTnonstopswitch {-int=nonstopmode} + \def\MPOSTformatswitch {-progname=metafun -mem=} + \def\MPOSTdriver {dvips} + + \def\executeMPOST#1% direct call + {mpost + \ifcase\interactionmode\MPOSTbatchswitch\or\MPOSTnonstopswitch\fi + \space\ifuseMETAFUNformat \MPOSTformatswitch metafun \fi #1} + + \def\executeMPTEX#1% slower, due to nested texexec call + {\TEXEXECcommand\space + --batch \ifcase\interactionmode --logfile='mptex.log' \fi + --output=\MPOSTdriver\space + \ifuseMETAFUNformat --mpformat=metafun \fi --mptex --nomp --once #1} + + \def\executeMetaPost + {\ifrunMPTEXgraphics + \ifMPTEXgraphic + \@EAEAEA\executeMPTEX + \else + \@EAEAEA\executeMPOST + \fi + \else + \@EA\executeMPOST + \fi} + +\fi + +%D The batchmode and nonstopmode (introduced in 2003 for +%D Patrick Gundlach) switches may differ per binary and are +%D supported by \TEXEXEC. + +%D \macros +%D {insertMPfile} +%D +%D One can define this command in advance or redefine it after +%D loading this module. The same goes for the forward +%D reference to the figure loading macro: + +\ifx\undefined\insertMPfile + + \def\insertMPfile#1#2% + {\ifx\undefined\externalfigure + \message{[insert file #1 here]}% + \else + \externalfigure + [#1] + [\c!type=\c!mps,\c!object=\v!no, + \c!symbol=\v!yes,\c!reset=\v!yes, + \c!maxwidth=,\c!maxheight=, + \c!frame=\v!off,\c!background=, + #2]% + \fi} + +\fi + +%D This macro takes {\em two} arguments, the second one can be +%D used to pass info to the inclusion macro. Some examples +%D of its use can be found in the modules \type{supp-tpi} and +%D \type{prag-log}. + +%D This module can be used in \PLAIN\ \TEX too. When using +%D \DVIPS, just try to process: +%D +%D \starttyping +%D \input supp-mps +%D +%D \runMPgraphicstrue +%D +%D \def\insertMPfile#1#2% +%D {\special{psfile=#1}} +%D +%D \startuseMPgraphic{1} +%D prologues := 1; +%D draw (0,0) withpen pencircle scaled 100; +%D \stopuseMPgraphic +%D +%D \useMPgraphic{1} +%D \stoptyping +%D +%D Don't forget to enable \type{\write18}. When does not say +%D \type{\runMPgraphicstrue}, the \METAPOST\ scratch file +%D must be closed by saying +%D +%D \starttyping +%D \flushMPgraphics +%D \stoptyping +%D +%D When using the indirect method, one has to process the file +%D \type{mpgraph.mp} between two successive \TEX\ runs. +%D +%D \METAPOST\ needs the public domain \DVI\ to \POSTSCRIPT\ +%D converter \DVIPS. This symbiosis originates in the need to +%D include the fonts (glyphs) that \METAPOST\ uses in the +%D \POSTSCRIPT\ file. Driver independancy was one of my +%D prerequisites for using \METAPOST, so I decided to build +%D this kind of support myself. Personally I consider driver +%D dependancy a drawback for the dissemination of such a +%D package. The second part of this module more or less +%D decouples \METAPOST\ and \DVIPS. +%D +%D The macros hereafter are copied from the module +%D \type{m-metapost}. After writing module \type{supp-pdf} I +%D added this method to the module named and after a while +%D decided to hook it into module \type{spec-yy}. Therefore +%D they made it into a support module, but in a slightly +%D different way. + +%D \macros +%D {includeMPfonts, ifincludeMPfonts} +%D +%D The method we use is both robust and simple: one can do +%D with calling the next macro with the filename as argument: +%D +%D \starttyping +%D \includeMPfonts{filename} +%D \stoptyping +%D +%D We can turn of this mechanism with: +%D +%D \starttyping +%D \includeMPfontsfalse +%D \stoptyping +%D +%D {\em Currently this method fails for situations where the +%D font definition is not on one line, which is he case when +%D unkerned fonts are used along with long lines. One solution +%D for this is to increase the value of \type {max_print_line} +%D in \type {texmf.cnf}.}} + +\newif\ifincludeMPfonts \includeMPfontstrue + +\def\includeMPfonts#1% + {\ifincludeMPfonts + \bgroup + \message{[MP fonts #1]}% + %\uncatcodespecials + \endlinechar\minusone + \setMPspecials + \obeyMPspecials + \setbox\scratchbox\hbox + {\hskip-\maxdimen + \doprocessfile\scratchread{#1}\handleMPfont}% + \smashbox\scratchbox + \box\scratchbox + \egroup + \fi} + +\def\UseMetaPostGraphic {\includeMPfonts} % upward compatible +\def\DontUseMetaPostGraphics {\includeMPfontsfalse} % upward compatible + +%D The characters are collected in a box and moved as far as +%D possible into the left margin. The resulting box has no +%D dimensions and can be prepended (appended) to the special +%D that handles the inclusion. The characters are in the file +%D but made invisible. +%D +%D In \CONTEXT\ font handling is intergrated in the figure +%D inclusion macros. A decent plain \TEX\ alternative is: +%D +%D \starttyping +%D \def\includeMPgraphic#1% +%D {\hbox\bgroup +%D \includeMPfonts{#1}% +%D \dogetEPSboundingbox{#1}{\dimen2}{\dimen4}{\dimen6}{\dimen8}% +%D \advance\dimen6 by -\dimen2 +%D \advance\dimen8 by -\dimen4 +%D \vbox to \dimen8 +%D {\forgetall +%D \vfill +%D \hsize\dimen6 +%D \special +%D {PSfile="#1"\space +%D llx=\EPSllx\space +%D lly=\EPSlly\space +%D urx=\EPSurx\space +%D ury=\EPSury\space}}% +%D \egroup} +%D \stoptyping +%D +%D This macro needs \type {supp-eps.tex} and provided no +%D scaling. For \LATEX\ users the next one will do: +%D +%D \starttyping +%D \def\includeMPgraphic#1#% +%D {\hbox\bgroup +%D \def\includeMPgraphics##1% +%D {\includeMPfonts{##1}% +%D \includegraphics[typetype=mps,#1]{##1}% or whatever type they use +%D \egroup}% +%D \includeMPgraphics} +%D \stoptyping + +%D We scan the graphics file for the \type{fshow} operator, +%D that is, lines that start with \type{(}. If found it +%D interprets the line, which looks like: +%D +%D \starttyping +%D (string ... string) font size fshow +%D \stoptyping +%D +%D Font definitions specified in the preamble are simply +%D ignored. Only lines starting with \type{(} are interpreted. + +\def\dohandleMPfont#1#2\relax + {\if#1(\expandafter\includeMPcharacters\fileline\relax\fi} + +\def\handleMPfont + {\expandafter\dohandleMPfont\fileline\relax} + +%D Before we start scanning for data, we first change some +%D \CATCODES. The first set of macro's is copied from module +%D \type{supp-pdf}. This scheme is a bit overdone for this +%D module, but using the same macros saves us some memory. + +\def\octalMPcharacter#1#2#3% + {\char'#1#2#3\relax} + +\bgroup +\catcode`\|=\@@comment +\catcode`\%=\@@active +\catcode`\[=\@@active +\catcode`\]=\@@active +\catcode`\{=\@@active +\catcode`\}=\@@active +\catcode`B=\@@begingroup +\catcode`E=\@@endgroup +\gdef\keepMPspecials| + B\let%\letterpercent| + \def[B\noexpand[E| + \def]B\noexpand]E| + \def{B\noexpand{E| + \def}B\noexpand}EE +\gdef\ignoreMPspecials| + B\let%\letterpercent| + \def[BE| + \def]BE| + \def{BE| + \def}BEE +\gdef\obeyMPspecials| + B\def%B\char 37\relax E| + \def[B\char 91\relax E| + \def]B\char 93\relax E| + \def{B\char123\relax E| + \def}B\char125\relax EE +\gdef\setMPspecials| + B\setnaturalcatcodes + \catcode`\\=\@@escape + \catcode`\%=\@@active + \catcode`\[=\@@active + \catcode`\]=\@@active + \catcode`\{=\@@active + \catcode`\}=\@@active + \lccode`\-=0 | latex sets this to `\- + \lccode`\%=`\% | otherwise it's seen as a number + \def\(B\char40\relax E| + \def\)B\char41\relax E| + \def\\B\char92\relax E| + \def\0B\octalMPcharacter0E| + \def\1B\octalMPcharacter1E| + \def\2B\octalMPcharacter2E| + \def\3B\octalMPcharacter3E| + \def\4B\octalMPcharacter4E| + \def\5B\octalMPcharacter5E| + \def\6B\octalMPcharacter6E| + \def\7B\octalMPcharacter7E| + \def\8B\octalMPcharacter8E| + \def\9B\octalMPcharacter9EE +\egroup + +%D The lines starting with \type{(} are interpreted and +%D handled by +%D +%D \starttyping +%D \def\includeMPcharacters(#1) #2 #3 #4\relax% +%D {\font\temp=#2 at #3bp\temp#1} +%D \stoptyping +%D +%D While processing some \TUG~98 proceedings, I also had to +%D deal with: +%D +%D \starttyping +%D /nfont {10 div dup scale 10} def +%D (T) ANTTB 7.13086 nfont fshow +%D \stoptyping +%D +%D which comes to rounding sizes. This is something +%D experimental. (The macro in supp-pdf.tex is more +%D advanced.) + +\def\PSnfont{nfont} + +\def\includeMPcharacters(#1) #2 #3 #4#5#6#7#8#9\relax + {\edef\temp{#4#5#6#7#8}% + \ifx\temp\PSnfont % round font size (to pt) + \scratchdimen#3\onepoint + \ifdim\scratchdimen<\onepoint + \def\size{1pt}% + \else + \advance\scratchdimen .5\onepoint + \def\size##1.##2\relax{\def\size{##1pt}}% + \expandafter\size\the\scratchdimen\relax + \fi + \else + \edef\size{#3bp}% + \fi + \font\temp=#2 at \size + \temp\if#1 \char32\else#1\fi} + +%D This method is both robust and reasonable fast. The only +%D disadvantage is that when not embedded properly in the +%D graphics inclusion macros, one has to load all graphics by +%D hand. + +%D Now let's see if things work all right and show the example +%D files that are part of the \METAPOST\ distribution: +%D +%D \setupexternalfigures[directory={../sample}] +%D \startlinecorrection +%D \setupalign[middle] +%D \leavevmode +%D \startcombination[3*3] +%D {\externalfigure[mp-exa-1][frame=on,width=.2\hsize]} {} +%D {\externalfigure[mp-exa-2][frame=on,width=.2\hsize]} {} +%D {\externalfigure[mp-exa-3][frame=on,width=.2\hsize]} {} +%D {\externalfigure[mp-exa-4][frame=on,width=.2\hsize]} {} +%D {\externalfigure[mp-exa-5][frame=on,width=.2\hsize]} {} +%D {\externalfigure[mp-exa-6][frame=on,width=.2\hsize]} {} +%D {\externalfigure[mp-exa-7][frame=on,width=.2\hsize]} {} +%D {\externalfigure[mp-exa-8][frame=on,width=.2\hsize]} {} +%D {\externalfigure[mp-exa-9][frame=on,width=.2\hsize]} {} +%D \stopcombination +%D \stoplinecorrection +%D +%D Here we used calls like: +%D +%D \starttyping +%D \externalfigure[mp-exa-1][methode-mps,frame=on,width=.2\hsize] +%D \stoptyping + +%D \macros +%D {convertMPcolors, +%D ifconvertMPcolors,ifreduceMPcolors,ifforceMPcolors} +%D +%D When I told the editors that I wanted to use colored +%D \METAPOST\ graphics in the color issue of the \MAPS, I was +%D asked to use the \cap{CMYK} colorspace instead of \cap{RGB} +%D one. However, \METAPOST\ only supports \cap{RGB} colors. I +%D decided to write a utility to convert the \type +%D {setrgbcolor} operators into \type {setcmykcolor} ones, and +%D some experiments showed me that I could best let \TEX\ do it +%D itself. Here it is: +%D +%D There are two booleans that control the conversion process. +%D These are false by default. + +\newif\ifconvertMPcolors +\newif\ifreduceMPcolors +\newif\ifforcegrayMPcolors + +%D The main macro is called as: +%D +%D \starttyping +%D \convertMPcolors{filename} +%D \stoptyping +%D +%D When active, this macro returns a message saying if indeed +%D conversion took place. The old file is overwritten! This +%D saves time in a succesive passes and can't harm, simply +%D because MP can generate them anew. + +\def\convertMPcolorpath{} +\def\convertMPcolorfile{metacmyk.tmp} + +\def\convertMPcolors#1% todo: open on local path, no copy + {\bgroup + \ifforcegrayMPcolors + \donetrue + \else\ifconvertMPcolors + \donetrue + \else + \donefalse + \fi\fi + \ifdone + \message{[MP color conversion #1}% + \endlinechar\minusone + \uncatcodespecials + \donefalse + \immediate\openout\scratchwrite\convertMPcolorpath\convertMPcolorfile\relax + \doprocessfile\scratchread{#1}\handleMPcolor + \immediate\closeout\scratchwrite + \ifdone + \immediate\openout\scratchwrite\convertMPcolorpath#1\relax + \doprocessfile\scratchread{\convertMPcolorpath \convertMPcolorfile}\handleMPcopy + \immediate\closeout\scratchwrite + \message{done]}% + \else + \message{not needed]}% + \fi + \immediate\openout\scratchwrite\convertMPcolorpath\convertMPcolorfile + \immediate\closeout\scratchwrite + \fi + \egroup} + +%D The process is rather simple: read a line, look for the +%D \type {setrgbcolor} operator, recalculate the components and +%D check for gray reduction or black removal, write the result +%D to a temporary file, and go on. Afterwards, the file is +%D copied back. We don't have to reduce to gray scales; +%D \METAPOST\ already takes care of that. + +%D The next macro is needed for forced conversion. This macro +%D is copied from \type{colo-ini}, just in case one uses this +%D module outside \CONTEXT. + +\ifx\@@cl@@s \undefined \def\@@cl@@s{0} \fi + +\ifx\convertRGBtoGRAY\undefined + +\def\convertRGBtoGRAY#1#2#3% + {\scratchdimen#1\onepoint + \scratchdimen300\scratchdimen + \scratchcounter\scratchdimen + \scratchdimen#2\onepoint + \scratchdimen590\scratchdimen + \advance\scratchcounter \scratchdimen + \scratchdimen#3\onepoint + \scratchdimen110\scratchdimen + \advance\scratchcounter \scratchdimen + \advance\scratchcounter \!!medcard + \divide\scratchcounter \!!maxcard + \edef\@@cl@@s{\realcolorvalue\scratchcounter}} + +\fi + +%D BTW, this code is quite old, and not as complete as the +%D \PDF\ converter, which also handles spot colors and so. + +\def\handleMPcolor + {\expandafter\dohandleMPcolor\fileline setrgbcolor*\\} + +\def\dohandleMPcolor#1setrgbcolor#2#3\\% + {\if#2*% + \immediate\write\scratchwrite{#1}% + \else + \dodohandleMPcolor#1setrgbcolor#2#3\\% + \fi} + +\def\dodohandleMPcolor#1 #2 #3setrgbcolor#4setrgbcolor*\\% old and maybe broke + {\bgroup + \ifdim#1pt=.123pt + \immediate\write\scratchwrite{#1 #2 #3 setrgbcolor}% + \else + \ifforcegrayMPcolors + \convertRGBtoGRAY{#1}{#2}{#3}% + \immediate\write\scratchwrite + {\@@cl@@s \space setgray #4}% + \else + \dimen0=\onepoint \advance\dimen0 -#1\points + \dimen2=\onepoint \advance\dimen2 -#2\points + \dimen4=\onepoint \advance\dimen4 -#3\points + \ifreduceMPcolors + \dimen6\dimen0 + \ifdim\dimen2<\dimen6 \dimen6\dimen2 \fi + \ifdim\dimen4<\dimen6 \dimen6\dimen4 \fi + \advance\dimen0 -\dimen6 + \advance\dimen2 -\dimen6 + \advance\dimen4 -\dimen6 + \else + \dimen6\zeropoint + \fi + \immediate\write\scratchwrite + {\withoutpt\the\dimen0 \space + \withoutpt\the\dimen2 \space + \withoutpt\the\dimen4 \space + \withoutpt\the\dimen6 \space setcmykcolor #4}% + \fi + \fi + \egroup + \donetrue} % needed for message + +\def\handleMPcopy + {\immediate\write\scratchwrite{\fileline}} + +%D The next examples show the color conversion macros in +%D action. These examples also demonstrate in||text \METAPOST\ +%D handling. As we will see, the conversion is hooked into the +%D \CONTEXT\ color mechanism. +%D +%D By setting both \type{rgb} and \type{cmyk} to off, we force +%D conversion to gray scales using: +%D +%D \placeformula[-] +%D \startformula +%D G = .30r + .59g + .11b +%D \stopformula +%D +%D By using buffers, we keep the \ASCII\ layout clean: +%D +%D \startbuffer +%D \startbuffer[rgb] +%D \setupcolors[rgb=ja,cmyk=nee,reduction=no,conversion=no] +%D \useMPgraphic{hans} +%D \stopbuffer +%D +%D \startbuffer[cmyk] +%D \setupcolors[rgb=nee,cmyk=ja,reduction=no,conversion=no] +%D \useMPgraphic{hans} +%D \stopbuffer +%D +%D \startbuffer[cmy] +%D \setupcolors[rgb=nee,cmyk=ja,reduction=yes,conversion=no] +%D \useMPgraphic{hans} +%D \stopbuffer +%D +%D \startbuffer[gray] +%D \setupcolors[rgb=nee,cmyk=nee,reduction=no,conversion=no] +%D \useMPgraphic{hans} +%D \stopbuffer +%D \stopbuffer +%D +%D \typebuffer +%D \getbuffer +%D +%D The graphic is rather simple and is generated each time +%D it's called: +%D +%D \global\runMPgraphicstrue +%D +%D \startbuffer +%D \startbuffer[graphic] +%D \startuseMPgraphic{hans} +%D width :=\the\textwidth/5; +%D height := width/4; +%D fill fullcircle +%D xscaled width +%D yscaled height +%D withcolor (\RedGreenBlue); +%D \stopuseMPgraphic +%D \stopbuffer +%D \stopbuffer +%D +%D \typebuffer +%D \getbuffer +%D +%D Next we combine the four alternative interpretations in a +%D combination: +%D +%D \startbuffer +%D \startbuffer[result] +%D \startcombination[4] +%D {\getbuffer[rgb]} {\tfxx original} +%D {\getbuffer[cmyk]} {\ttxx\string\convertMPcolorstrue} +%D {\getbuffer[cmy]} {\ttxx\string\reduceMPcolorstrue} +%D {\getbuffer[gray]} {\ttxx\string\forcegrayMPcolorstrue} +%D \stopcombination +%D \stopbuffer +%D \stopbuffer +%D +%D \typebuffer +%D \getbuffer +%D +%D Finally we call the buffers, using different setting: +%D +%D \startbuffer +%D \placefigure +%D {\METAPOST\ color conversions} +%D {\def\RedGreenBlue{.1,.4,.6}\getbuffer[graphic]\getbuffer[result]\vskip6pt +%D \def\RedGreenBlue{.1,.6,.4}\getbuffer[graphic]\getbuffer[result]\vskip6pt +%D \def\RedGreenBlue{.4,.1,.6}\getbuffer[graphic]\getbuffer[result]\vskip6pt +%D \def\RedGreenBlue{.4,.6,.1}\getbuffer[graphic]\getbuffer[result]\vskip6pt +%D \def\RedGreenBlue{.6,.1,.4}\getbuffer[graphic]\getbuffer[result]\vskip6pt +%D \def\RedGreenBlue{.6,.4,.1}\getbuffer[graphic]\getbuffer[result]} +%D \stopbuffer +%D +%D \typebuffer +%D \getbuffer +%D +%D By the way, when the \POSTSCRIPT\ file resulting from +%D this input is converted into \PDF\ and viewed in Acrobat +%D Reader, one can quite different colors from those +%D displayed in \GHOSTSCRIPT, which view equals the +%D \POSTSCRIPT\ originals. + +%D \macros +%D {experimental} +%D +%D Some experimental macros: +%D +%D \starttyping +%D \startMPdrawing +%D \stopMPdrawing +%D \pushMPdrawing +%D \popMPdrawing +%D \resetMPdrawing +%D \ifMPdrawingdone +%D \getMPdrawing +%D \MPdivten[number] +%D \stoptyping +%D +%D These macros are used in \PPCHTEX. + +\let\MPdrawingdata\empty + +\newif\ifMPdrawingdone \MPdrawingdonefalse +\newif\ifMPshiftdrawing \MPshiftdrawingfalse + +\def\resetMPdrawing + {\globallet\MPdrawingdata\empty + \global\MPdrawingdonefalse} + +% why global push/pop here? + +\def\pushMPdrawing + {\globalpushmacro\MPdrawingdata + \globallet\MPdrawingdata\empty} + +\def\popMPdrawing + {\globalpopmacro\MPdrawingdata} + +\def\getMPdrawing + {\ifMPdrawingdone + \expandafter\startMPgraphic\MPdrawingdata\stopMPgraphic + \loadcurrentMPgraphic{}% + \deallocateMPslot\currentMPgraphic + \placeMPgraphic + \fi} + +\def\startMPdrawing + {\dosingleempty\dostartMPdrawing} + +\long\def\dostartMPdrawing[#1]#2\stopMPdrawing + {\relax + \bgroup + \enableincludeMPgraphics + \presetMPdefinitions % in case #2 has measures + \doifelse{#1}{-}{\convertargument#2\to\asciia}{\long\def\asciia{#2}}% + \long\xdef\MPdrawingdata{\MPdrawingdata\asciia}% + \egroup} + +\let\stopMPdrawing\relax + +\def\MPdivten[#1]% + {\@EA\@EA\@EA\doMPdivten\@EA\@EA\@EA[\@EA#1]} + +\def\doMPdivten[#1]% + {\ifnum#1> 9999 \dodoMPdivtenB#1\else + \ifnum#1> 999 \dodoMPdivtenC#1\else + \ifnum#1> 99 \dodoMPdivtenD#1\else + \ifnum#1> 9 \dodoMPdivtenE#1\else + \ifnum#1> 0 \dodoMPdivtenF#1\else + \ifnum#1<-9999 \dodoMPdivtenA#1\else + \ifnum#1< -999 \dodoMPdivtenB#1\else + \ifnum#1< -99 \dodoMPdivtenC#1\else + \ifnum#1< -9 \dodoMPdivtenD#1\else + \ifnum#1< 0 \dodoMPdivtenE#1\else + 0 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +\def\dodoMPdivtenA#1#2#3#4#5#6{#1#2#3#4#5.#6} +\def\dodoMPdivtenB #1#2#3#4#5{#1#2#3#4.#5} +\def\dodoMPdivtenC #1#2#3#4{#1#2#3.#4} +\def\dodoMPdivtenD #1#2#3{#1#2.#3} +\def\dodoMPdivtenE #1#2{#1.#2} +\def\dodoMPdivtenF #1{.#1} + +% if we assume etex ... \def\MPdivten[#1]{\withoutpt\the\dimexpr#1pt/10\relax} + +%D \macros +%D {startMPclip,grabMPclippath} +%D +%D We can use \METAPOST\ to calculate arbitrary clipping +%D paths. Such a path is defined by (for instance): +%D +%D \starttyping +%D \startMPclip{window} +%D clip currentpicture to fullcircle xscaled \width yscaled \height ; +%D \stopMPclip +%D \stoptyping +%D +%D Such a path can be extracted (processed) by: +%D +%D \starttyping +%D \grabMPclippath{window}{method}{width}{height}{default path} +%D \stoptyping +%D +%D Currently only method 1 makes sense; it produces \PDF\ +%D code. This macro only makes sense when hooked into a +%D special routine. + +\let\MPclippath\empty + +\long\def\startMPclip#1#2\stopMPclip + {\blabelgroup + \long\setgvalue{MPC:#1}{\startMPgraphic#2\stopMPgraphic\dograbMPclippath}% + \elabelgroup} + +\let\stopMPclip\relax + +\def\grabMPclippath#1#2#3#4#5% + {\blabelgroup + \edef\width {#3\space}\let\overlaywidth \width + \edef\height{#4\space}\let\overlayheight\height + \doifdefinedelse{MPC:#1} + {\getvalue{MPC:#1}% + \setxvalue{MPC:#1}{\noexpand\xdef\noexpand\MPclippath{\MPclippath}}}% + {\xdef\MPclippath{#5}}% + \ifcase#2\else % method 1 : + \doglobal\stripcharacter urveto\from\MPclippath\to\MPclippath + \doglobal\stripcharacter oveto\from\MPclippath\to\MPclippath + \doglobal\stripcharacter ineto\from\MPclippath\to\MPclippath + \fi + \elabelgroup} + +%D We pose some restrictions to the \METAPOST\ code and pickup +%D the clip path from the file. +%D +%D We turn the slash into a comment. The \type {\hbox} grabs spaces +%D and the \type {%} triggers the grabber. Next we filter the +%D clipping path, or actually, the first path. + +% \bgroup +% \catcode`\%=\@@active +% \catcode`\/=\@@comment +% \gdef\dograbMPclippath/ +% {\setbox\scratchbox=\hbox\bgroup/ +% \catcode`\%=\@@active +% \obeylines\let\obeyedline\space +% \def\do##1newpath##2closepath##3\od/ +% {\xdef\MPclippath{##2}\endinput}/ +% \def%##1%%EOF/ +% {\do##1newpathclosepath\od\endinput}/ +% \readfile{\MPgraphicfile.\the\currentMPgraphic}{}{}/ +% \deallocateMPslot\currentMPgraphic / new +% \egroup} +% \egroup + +\bgroup +\catcode`\%=\@@active +\catcode`\/=\@@comment +\gdef\dograbMPclippath/ + {\setbox\scratchbox=\hbox\bgroup/ + \catcode`\%=\@@active + \obeylines\let\obeyedline\space + \def\do##1q n##2p W##3\od/ + {\xdef\MPclippath{##2}\endinput}/ + \def%##1%%EOF/ + {\do##1q np W\od\endinput}/ + \readfile{\MPgraphicfile.\the\currentMPgraphic}{}{}/ + \ifx\MPclippath\empty + \def\do##1newpath##2closepath##3\od/ + {\xdef\MPclippath{##2}\endinput}/ + \def%##1%%EOF/ + {\do##1newpathclosepath\od\endinput}/ + \readfile{\MPgraphicfile.\the\currentMPgraphic}{}{}/ + \fi + \deallocateMPslot\currentMPgraphic / new + \egroup} +\egroup + +%D \macros +%D {recycleMPslots} +%D +%D When coding and embedding many \METAPOST\ figures in a +%D document, one can save quite some disk space by using +%D \PDFTEX\ and setting the next switch: + +\newif\ifrecycleMPslots \recycleMPslotstrue + +%D When a graphic takes space in the text flow, we can run +%D into deadlock typesetting. In the first pass, the graphic +%D is not available, but in the second pass it is. The +%D placeholder that was put there in the first pass in now +%D replace by the real graphic and as a result the document +%D shrinks or grows and pages are removed or added. This in +%D turn can trigger generation of other graphics, like those +%D in the background. Graphics start swapping place and again +%D page breaks change. You can imagine the mess we en dup +%D with. +%D +%D This is why we provide was to use a dedicate range if +%D numbers for fixed graphcs. Such graphics will not en dup +%D in the text flow (at least their dimensions don't +%D contribute to the main vertical list, and thereby they +%D cannot interfere. We use a rather safe maximum of 4000 +%D graphics here and 8000 in \type {meta-ini}. + +\newcount \maxnofMPgraphics \maxnofMPgraphics = 4000 % 8000 +\newcount \minnofMPgraphics \minnofMPgraphics = 1 + +\newif \ifMPstaticgraphic \MPstaticgraphicfalse % determines slot allocation + +\def\locateMPslot#1% slightly faster on one slot, much faster on multiple slots + {\ifundefined{\number#1MP}% no \ifcsname + \letgvalueempty{\number#1MP}% + \expandafter\gobbletwoarguments + \else + \global\advance#1\plusone + \fi + \locateMPslot#1} + +\def\allocateMPslot#1% + {\ifrunMPgraphics + \ifx\pdfliteral\undefined + \recycleMPslotsfalse % quite certainly not pdftex + \else\ifcase\pdfoutput + \recycleMPslotsfalse % dvi mode or not pdftex (we need to handle dvipdfmx) + \fi\fi + \else + \recycleMPslotsfalse + \fi + \ifrecycleMPslots + % \doloop % slow but used seldom + % {\doifundefined{\recurselevel MP} + % {\letgvalueempty{\recurselevel MP}% + % \global#1\recurselevel + % \exitloop}}% + \global#1\plusone + \locateMPslot#1% + % \message{[MP slot + \number#1]% + \else\ifMPstaticgraphic % beware not the same as static graphics + \global#1\maxnofMPgraphics + \global\advance\maxnofMPgraphics \minusone + \else + \global#1\minnofMPgraphics + \global\advance\minnofMPgraphics \plusone + \fi\fi + \ifnum\minnofMPgraphics<\maxnofMPgraphics \else + \writestatus\m!systems{increase \string\maxnofMPgraphics}% + \fi} + +\def\deallocateMPslot#1% + {\ifrunMPgraphics + \ifcase\pdfoutput \recycleMPslotsfalse \fi + \else + \recycleMPslotsfalse + \fi + \ifrecycleMPslots + \global\letbeundefined{\number#1MP}% + %\message{[MP slot - \number#1]}% + \fi} + +%D Experimental and overloaded later, since we need to be +%D more clever due to \METAPOST's limit of 4~open files. + +\def\MPdatafile + {mp-\the\currentMPgraphic.mpd} + +\def\getMPdata + {\input \MPdatafile\relax} + +%D \macros +%D {MPtoks, MPbox} +%D +%D For convenience, we provide some scratch registers: + +\ifx\undefined\MPtoks \newtoks\MPtoks \fi +\ifx\undefined\MPbox \newbox \MPbox \fi + +%D \macros +%D {startMPcode} +%D +%D We can save some typing with: +%D +%D \starttyping +%D \startMPcode whatever \stopMPcode +%D \stoptyping +%D +%D this automatically places the graphic + +\long\def\startMPcode + {\begingroup + \obeyMPlines + \dostartMPcode} + +\long\def\dostartMPcode#1\stopMPcode + {\startuseMPgraphic{@@}#1\stopuseMPgraphic + \useMPgraphic{@@}% + \endgroup} + +\let\stopMPcode\relax + +%D \macros +%D {startstaticMPgraphic} +%D +%D Dedicated to Aditya Mahajan. See meta-ini for usage. + +% \long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic +% {\bgroup +% \MPstaticgraphictrue +% \setMPrandomseedfalse +% \def\MPgraphicfile{#1}% no \jobname here +% \let\allocateMPslot \gobbleoneargument +% \let\deallocateMPslot\gobbleoneargument +% \let\runMPgraphic \gobbleoneargument +% \MPextensions\emptytoks +% \MPinitializations\emptytoks +% \runMPgraphicstrue +% \MPwrapperfalse +% \enableincludeMPgraphics +% \def\sometxt##1{\string\sometxt{##1}}% +% \currentMPgraphic\plusone % hack, else no close +% \startMPgraphic#2\stopMPgraphic +% \executeMPgraphicfile +% \egroup} + +% different version, less messy hooked into the rest + +\long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic + {\blabelgroup + \def\MPgraphicfile{#1}% no \jobname here + \let\MPwrite\MPstaticwrite + \immediate\openout\MPwrite=\MPgraphicfile.mp + \setMPrandomseedfalse + \enableincludeMPgraphics + \def\sometxt##1{\string\sometxt{##1}}% + \the\everyMPgraphic + \presetMPdefinitions + \theMPinclusions % brrr + \writeMPgraphic{\letterpercent mpenvironment: \the\everyMPTEXgraphic}% + \writeMPgraphic{beginfig(1);}% + \writeMPgraphic{#2}% + \writeMPgraphic{endfig; end.}% + \immediate\closeout\MPwrite + \executeMPgraphicfile + \elabelgroup} + +% this will go to meta-ini + +\def\delaysystemcommand + {\ifx\installprogram\undefined + \expandafter\executesystemcommand + \else + \expandafter\installprogram + \fi} + +\def\MPgraphicfilerunner + {texmfstart --ifchanged=\MPgraphicfile.mp texexec --mpstatic \MPgraphicfile.mp} + +\ifx\doifmode\undefined + \def\executeMPgraphicfile + {\ifrunMPgraphics\@EA\executesystemcommand\else\@EA\delaysystemcommand\fi{\MPgraphicfilerunner}} +\else + \def\executeMPgraphicfile{\doifmode{*\v!first} + {\ifrunMPgraphics\@EA\executesystemcommand\else\@EA\delaysystemcommand\fi{\MPgraphicfilerunner}}} +\fi + +%D Special for \XETEX\ (problem with newlines). This will go +%D away once the version supporting \type {--8bit} is +%D widespread. + +\ifnum\texengine=\xetexengine + \let\obeyMPlines\relax + \longMPlinesfalse % alas +\fi + +\protect \endinput diff --git a/tex/context/base/supp-mps.tex b/tex/context/base/supp-mps.tex deleted file mode 100644 index 9864cd9a1..000000000 --- a/tex/context/base/supp-mps.tex +++ /dev/null @@ -1,2133 +0,0 @@ -%D \module -%D [ file=supp-mps, -%D version=1997.07.05, -%D title=\CONTEXT\ Support Macros, -%D subtitle=\METAPOST\ Inclusion, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Forget about generic modules \unknown\ ... - -\ifx \undefined \contextversion \endinput \fi - -%D \METAPOST\ is John Hobbys alternative for \METAFONT\ and -%D produces superior \POSTSCRIPT\ code. In this module we -%D integrate \METAPOST\ support int \CONTEXT. We offer two -%D tracks: -%D -%D \startitemize -%D \item generating \METAPOST\ code, running this program from -%D within \TEX\ using \type{\write18}, and importing the -%D result -%D \item generating \METAPOST\ code, processing the code -%D afterward, and importing the result in a second pass -%D \stopitemize -%D -%D The first approach uses a non standard \TEX\ feature, -%D implemented in Web2c. I'm not going to discuss the pros and -%D cons of running programs from within others, but all -%D arguments against this can be overcome by implementing a -%D \TEX\ worthy primitive: -%D -%D \starttyping -%D \excuteMetaPost filename -%D \stoptyping -%D -%D Ok then, let's start: - -\writestatus{loading}{ConTeXt Support Macros / MetaPost Inclusion} - -\unprotect - -\def\@@MPG{@MPG@} - -%D First we define a handy constant: - -\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup - -% todo : sort out ^^M, \par and ; mess - -%D \macros -%D {everyMPgraphic} -%D -%D Because some graphics interact with \TEX\ (i.e.\ \CONTEXT), we -%D provide a hook for additional actions: \type {\everyMPgraphic}. - -\newtoks\everyMPgraphic \everyMPgraphic{\everyMPgraphic\emptytoks} - -%D \macros -%D {startMPgraphic} -%D -%D From within \TEX\ one can execute \METAPOST\ code by putting -%D it between the two commands -%D -%D \starttyping -%D \startMPgraphic -%D \stopMPgraphic -%D \stoptyping -%D -%D This is implemented as: - -\let\stopMPgraphic\relax - -\long\def\startMPgraphic#1\stopMPgraphic - {\startwritingMPgraphic - \writecheckedMPgraphic{#1}% % potential speedup: pass #1 as macro - \stopwritingMPgraphic} - -%D \macros -%D {startMPrun} -%D -%D If we just want to run \METAPOST\ code, that is, not to -%D explictly generate a figure in terms of \type{beginfig} and -%D \type{endfig}, we can use: -%D -%D \starttyping -%D \startMPgraphic -%D \stopMPgraphic -%D \stoptyping -%D -%D \starttyping -%D \startMPrun -%D \stopMPrun -%D \stoptyping -%D -%D The next booleans are for internal purposes only. - -% some day a bit more more clear: -% -% run directly/run afterwards/run external defined -% insert directly/insert whenever -% use object/don't use objects - -\newif\ifMPgraphics \MPgraphicstrue -\newif\ifMPrun \MPrunfalse -\newif\ifMPwrapper \MPwrappertrue - -\let\stopMPrun\relax - -\ifCONTEXT - - \long\def\dostartMPrun#1#2\stopMPrun - {\bgroup - \MPruntrue - \doifsomething{#1}{\def\MPgraphicfile{#1}}% - \startwritingMPgraphic - \writecheckedMPgraphic{#2}% - \stopwritingMPgraphic - \egroup} - - \def\startMPrun - {\dosinglegroupempty\dostartMPrun} - -\else - - \long\def\startMPrun#1\stopMPrun - {\MPruntrue - \startwritingMPgraphic - \writecheckedMPgraphic{#1}% - \stopwritingMPgraphic - \MPrunfalse} - -\fi - -%D \macros -%D {startwritingMPgraphic, -%D writeMPgraphic, -%D stopwritingMPgraphic} -%D -%D If the writing process is divided into more steps, one can -%D use the components of this macro directly. -%D -%D \starttyping -%D \startwritingMPgraphic -%D ... -%D \writeMPgraphic{...} -%D ... -%D \writeMPgraphic{...} -%D ... -%D \stopwritingMPgraphic -%D \stoptyping - -%D \macros -%D {ifrunMPgraphics,ifrunMPTEXgraphics,ifinsertMPgraphics} -%D -%D These macros look a bit more complicated that one would -%D expect at first sight. This is due to the two ways of -%D processing these graphics, mentioned in a previous -%D paragraph. Which method is used, the direct or indirect -%D one, depends on a boolean. - -\newif\ifrunMPgraphics \runMPgraphicsfalse -\newif\ifrunMPTEXgraphics \runMPTEXgraphicsfalse -\newif\ifinsertMPgraphics \insertMPgraphicstrue - -%D If set to true, one can do with a single pass, else one must -%D process the \METAPOST\ file \type{mpgraph} between two -%D succesive \TEX\ runs. - -\ifx\MPgraphicfile\undefined - -\def\MPgraphicfile{mp\ifMPrun run\else graph\fi} -\def\MPruntimefile{mprun} - -\fi - -%D \macros -%D {MPgraphic} -%D -%D When we run \METAPOST\ from within \TEX, each graphic is -%D processed at once, which means that we reuse this file many -%D times. When however the execution is delayed, all graphics -%D are saved in a separate figure. The current graphic is -%D characterized bij a \COUNTER. This counter is available -%D in \type{\MPgraphic}. - -\newcount\nofMPgraphics -\newcount\currentMPgraphic - -\def\MPgraphic{0} - -% %D \macros -% %D {ifreuseMPgraphics} -% %D -% %D If one want to reuse grapics, one can save much redundant -% %D run time by setting the next switch to true. -% -% \newif\ifreuseMPgraphics \reuseMPgraphicstrue - -%D The three macros responsible for writing the graphic -%D implement both schemes. - -%D \macros -%D {MPinclusions, startMPinclusions, MPinitializations} -%D -%D One can include for instance common input commands by -%D passing them to \type{\MPinclusions}: -%D -%D \starttyping -%D \startMPinclusions -%D input mp-mine ; -%D \stopMPinclusions -%D \stoptyping -%D -%D \starttyping -%D \MPinclusions{input mp-mine} -%D \stoptyping -%D -%D These commands reset their content each time. You can append -%D code as follows: -%D -%D \starttyping -%D \startMPinclusions[+] -%D input mp-mine ; -%D \stopMPinclusions -%D \stoptyping -%D -%D The token register \type {\MPinitializations} is expanded -%D before all other inclusions, the extensions are expanded -%D only once per run. - -%D The next hack prevents too long lines: - -\long\def\runtimeobeyMPlines - {\ifx\rawcharacter\undefined - \let\obeyedline\space - \else - \obeylines - \ifx\outputnewlinechar\undefined - \edef\obeyedline{\rawcharacter{\endlinechar}}% - \else - \let\obeyedline\outputnewlinechar - \fi - \fi} - -\long\def\obeyMPlines % anyhow, we end up with ^^M's in the input - {\obeylines - \let\obeyedline\relax} % delay expansion - -\ifx\everydump\undefined - % maybe we're not using context -\else - \appendtoks - \let\obeyMPlines\runtimeobeyMPlines - \to \everydump -\fi - -%D We use two distinguished token registers: - -\newtoks \MPextensions % once per run (can be multiple graphics) -\newtoks \MPinitializations % each graphic - -\let\stopMPextensions \relax % so that we can use it in \expanded -\let\stopMPinitializations\relax % so that we can use it in \expanded -\let\stopMPinclusions \relax % so that we can use it in \expanded - -\def\startMPextensions % no text checking done here ! - {\begingroup - \obeyMPlines - \dostartMPextensions} - -\def\dostartMPextensions#1\stopMPextensions - {\endgroup - \MPextensions\expandafter{\the\MPextensions#1}} - -\def\startMPinitializations % no text checking done here ! - {\begingroup - \obeyMPlines - \dostartMPinitializations} - -\def\dostartMPinitializations#1\stopMPinitializations - {\endgroup - \MPinitializations\expandafter{\the\MPinitializations#1}} - -\def\startMPinclusions - {\begingroup - \dosingleempty\dostartMPinclusions} - -\long\def\dostartMPinclusions - {\obeyMPlines - \dodostartMPinclusions} - -\long\def\dodostartMPinclusions[#1]#2\stopMPinclusions % document wide - {\endgroup - \doifelse{#1}{+} - {\@EA\long\@EA\def\@EA\theMPinclusions\@EA - {\theMPinclusions - \writeMPgraphic{#2}}} - {\long\def\theMPinclusions - {% \expanded ! -% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}% new - \writeMPgraphic{#2}}}} - -\def\MPinclusions - {\dosingleempty\doMPinclusions} - -\long\def\doMPinclusions[#1]#2% - {\startMPinclusions[#1]#2\stopMPinclusions} - -\def\theMPextensions - {\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}} - -\def\theMPinitializations - {\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}} - -\startMPinclusions \stopMPinclusions - -%D \macros -%D {iflongMPlines} -%D -%D When grabbing a graphic deifnition, newlines are turned -%D into spaces. By default we split the graphic definition -%D at the colon, but long lines are still possible by -%D setting the next boolean to true. - -\newwrite\MPwrite -\newwrite\MPstaticwrite - -\newif\iflongMPlines \longMPlinestrue % we now have \obeyMPlines - -\ifx \overlaywidth \undefined \def \overlaywidth {4cm} \fi -\ifx \overlayheight \undefined \def \overlayheight {3cm} \fi -\ifx \overlaylinewidth \undefined \def \overlaylinewidth {0pt} \fi - -\def\presetMPdefinitions - {\edef\overlaywidth {\overlaywidth \space}% - \edef\overlayheight {\overlayheight \space}% - \edef\overlaylinewidth {\overlaylinewidth\space}% - \edef\currentwidth {\the\hsize \space}% - \edef\currentheight {\the\vsize \space}} - -%D The \type {;} aware method (the \type {\else} branch) also -%D takes care of \type {btex}||\type {etex}, \type -%D {verbatimtex}||\type {etex}. The space after \type {tex} -%D is essential, since it protects \type {text}. - -\newif\ifMPTEXgraphic - -\let\bufferedMPgraphicsline\empty - -\appendtoks - \globallet\bufferedMPgraphicsline\empty -\to \everyMPgraphic - -\chardef\MPgraphicsscanmode\plustwo % 0=no scanning, 1=simple scanning, 2=less simple, 3=even less - -% the next fails with \chardef\MPgraphicsscanmode\plusone -% -% \startMPextensions -% gp_num_points_with_tex := 3 ; -% \stopMPextensions - -\def\writeMPgraphic % no big #1 passing here - {\iflongMPlines - \ifMPTEXgraphic - \ifcase\MPgraphicsscanmode - \let\next\writeMPgraphiclongR - \else - \let\next\writeMPgraphiclongT - \fi - \else - \let\next\writeMPgraphiclongN - \fi - \else - \ifMPTEXgraphic - \ifcase\MPgraphicsscanmode - \let\next\writeMPgraphicshortN % we could \let \writeMPgraphicshortR\writeMPgraphicshortN - \else - \let\next\writeMPgraphicshortT - \fi - \else - \let\next\writeMPgraphicshortN - \fi - \fi - \next} - -\appendtoks \obeyMPlines \to \everyMPgraphic % more efficient than in each following grouped write - -\long\def\writeMPgraphiclongR#1% fast, no scanning - {\bgroup - \let\par\space - \immediate\write\MPwrite{#1}% - \egroup} - -\long\def\writeMPgraphiclongT#1% - {\bgroup - \let\par\space - \longMPflushT#1\empty\par\relax\par - \egroup} - -\long\def\writeMPgraphicshortT#1% - {\bgroup - \let\par\space - \shortMPflushT#1\empty;\relax;% - \egroup} - -\long\def\longMPflushT#1#2\par - {\ifx#1\relax \else - \dowriteMPgraphicline#1#2tex \relax etex\MPend - \expandafter\longMPflushT - \fi} - -\long\def\shortMPflushT#1#2;% - {\ifx#1\relax \else - \dowriteMPgraphicline#1#2tex \relax etex\MPend - \expandafter\shortMPflushT - \fi} - -\long\def\writeMPgraphiclongN#1% - {\bgroup - \let\par\space - \longMPflushN#1\empty\par\relax\par - \egroup} - -\long\def\writeMPgraphicshortN#1% - {\bgroup - \let\par\space - \shortMPflushN#1\empty;\relax;% - \egroup} - -\long\def\longMPflushN#1#2\par - {\ifx#1\relax \else - \nowriteMPgraphicline#1#2\MPend - \expandafter\longMPflushN - \fi} - -\long\def\shortMPflushN#1#2;% - {\ifx#1\relax \else - \nowriteMPgraphicline#1#2\MPend - \expandafter\shortMPflushN - \fi} - -\def\dowriteMPgraphicline{\futurelet\next\dodowriteMPgraphicline} -\def\nowriteMPgraphicline{\futurelet\next\nonowriteMPgraphicline} - -%D Will move (check if next is needed): - -\long\def\nonowriteMPgraphicline#1\MPend - {\ifx\next\empty\else\ifx\next\relax\else - \bgroup - \let\par\space - \iflongMPlines - %\immediate\write\MPwrite{#1;}% oeps, ; invalid - \immediate\write\MPwrite{#1}% - \else - \long\edef\ascii{#1}% - \expandafter\flushMPgraphicline\ascii\empty;\relax;% - \fi - \egroup - \fi\fi} - -%D A first version: -%D -%D \starttyping -%D \long\def\dodowriteMPgraphicline#1tex #2#3etex#4\MPend% -%D {\ifx\next\empty\else\ifx\next\relax\else -%D \bgroup -%D \let\par=\space -%D \ifx#2\relax -%D \immediate\write\MPwrite{#1;}% -%D \egroup -%D \else -%D \global\MPTEXgraphictrue -%D \convertargument#2#3\to\ascii -%D \immediate\write\MPwrite{#1tex \ascii etex}% -%D \egroup -%D \dowriteMPgraphicline#4tex \relax etex\MPend -%D \fi -%D \fi\fi} -%D \stoptyping - -%D The next alternative also handles inclusions well. - -\newtoks \everyMPTEXgraphic - -\newif\ifforceMPTEXgraphic - -%D Before we supported the graph module, we had: -%D -%D \starttyping -%D \convertargument etex\to\MPasciiB -%D \convertargument textext\to\MPasciiC % geen "text" -%D \convertargument graphictext\to\MPasciiD % geen "text" -%D -%D \long\def\checkMPTEXgraphic#1% -%D {\ifforceMPTEXgraphic -%D \global\MPTEXgraphictrue -%D \else -%D \expandafter\convertargument#1\to\MPasciia -%D \doifstringinstringelse\MPasciiB\MPasciia{\global\MPTEXgraphictrue} -%D {\doifstringinstringelse\MPasciiC\MPasciia{\global\MPTEXgraphictrue} -%D {\doifstringinstringelse\MPasciiD\MPasciia{\global\MPTEXgraphictrue} -%D {\global\MPTEXgraphicfalse}}}% -%D \fi} -%D \stoptyping -%D -%D The next alternative permits extensions in other modules -%D without the need to know the details of testing. - -\newtoks\MPTEXgraphicchecks - -\long\def\writecheckedMPgraphic#1% - {\ifforceMPTEXgraphic - \global\MPTEXgraphictrue - \else - \global\MPTEXgraphicfalse - \edef\ascii{#1}\convertcommand\ascii\to\MPascii - \the\MPTEXgraphicchecks\relax % \relax is end condition! - \fi - \flushMPTEXgraphic % verbatimtex etc - \writeMPgraphic{#1}} % potential optimization: pass \ascii - -%D We could have used a kind of array approach using a -%D counter appended to \type {MPascii}, but this is an -%D as efficient alternative. (The uglyness comes from -%D expanding after the string \type {#1}). - -\let\MPTEXchecklist\empty - -\def\forceMPTEXcheck#1% - {\addtocommalist{#1}\MPTEXchecklist - \expanded{\convertargument#1\noexpand\to - \@EA\noexpand\csname MPascii#1\endcsname}% - \@EA\appendtoks - \@EA\doifincsnameelse\csname MPascii#1\endcsname\MPascii - {\global\MPTEXgraphictrue\gobbleuntil\relax}\donothing - \to \MPTEXgraphicchecks} - -\forceMPTEXcheck{etex} -\forceMPTEXcheck{textext} -\forceMPTEXcheck{graphictext} - -%D \starttyping -%D \forceMPTEXgraphictrue -%D -%D \forceMPTEXcheck{lintext} -%D \forceMPTEXcheck{logtext} -%D -%D \startMPcode -%D draw hlintext.lft(0, 20, 5, 20cm, "@3e") ; -%D draw vlogtext.bot(0, 10, 9, 10cm, "@3e") ; -%D \stopMPcode -%D \stoptyping - -%D A goodie for Mojca (the gnuplot wizzard): -%D -%D \starttyping -%D \startMPcode -%D draw fullcircle scaled 4cm ; -%D draw \textext{$\sqrt{\frac{3}{2}^3}$} ; -%D \stopMPcode -%D \stoptyping - -\long\def\textext#1{\normalunexpanded{textext("#1")}} % or \detokenize - -\def\flushMPTEXgraphic - {\ifMPTEXgraphic - \immediate\write\MPwrite{verbatimtex \the\everyMPTEXgraphic\space etex;}% - \fi} - -\long\def\flushMPgraphicline#1#2;% - {\ifx#1\relax \else - \immediate\write\MPwrite{#1#2;}% - \expandafter\flushMPgraphicline - \fi} - -% the next one fails on btex \vbox {\hbox .. leading to \vbox \hbox -% -% \long\def\dodowriteMPgraphicline#1tex #2#3etex#4\MPend -% {\ifx\next\empty\else\ifx\next\relax\else -% \bgroup -% \let\par\space -% \ifx#2\relax -% \iflongMPlines -% \immediate\write\MPwrite{#1;}% -% \else -% \edef\ascii{#1}% -% \expandafter\flushMPgraphicline\ascii\empty;\relax;% -% \fi -% \egroup -% \else -% \convertargument#2#3\to\ascii -% \immediate\write\MPwrite{#1tex \ascii etex}% -% \egroup -% \dowriteMPgraphicline#4tex \relax etex\MPend -% \fi -% \fi\fi} -% -% so we need a two step approach - -% \long\def\dodowriteMPgraphicline#1tex % -% {\doifnextcharelse\relax -% {\nododowriteMPgraphicline{#1}} -% {\redodowriteMPgraphicline{#1}}} -% -% better and faster - -% \long\def\dodowriteMPgraphicline#1tex #2% -% {\ifx#2\relax -% \expandafter\nododowriteMPgraphicline -% \else -% \expandafter\redodowriteMPgraphicline -% \fi{#1} #2} -% -% \long\def\redodowriteMPgraphicline#1#2etex#3\MPend -% {\ifx\next\empty\else\ifx\next\relax\else -% \bgroup -% \let\par\space -% \convertargument#2\to\ascii -% \immediate\write\MPwrite{#1tex \ascii etex}% -% \egroup -% \dowriteMPgraphicline#3tex \relax etex\MPend -% \fi\fi} -% -% \long\def\nododowriteMPgraphicline#1#2\MPend -% {\ifx\next\empty\else\ifx\next\relax\else -% \bgroup -% \let\par\space -% \iflongMPlines -% \immediate\write\MPwrite{#1;}% -% \else -% \long\edef\ascii{#1}% -% \expandafter\flushMPgraphicline\ascii\empty;\relax;% -% \fi -% \egroup -% \fi\fi} - -% extra scanning - -\long\def\dodowriteMPgraphicline#1tex #2% kind of ok - {\ifx#2\relax - \expandafter\nododowriteMPgraphicline - \else - \ifcase\MPgraphicsscanmode - % can't happen - \or - \@EAEAEA\redodowriteMPgraphicline - \or - \doifinstringelse{b$} {#1$}{\@EAEAEA\redodowriteMPgraphicline}% - {\doifinstringelse{verbatim$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% - {\@EAEAEA\dododowriteMPgraphicline}}% - \else - \doifinstringelse { b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% - {\doifinstringelse {(b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% - {\doifinstringelse {=b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% - {\doifinstringelse{verbatim$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}% - {\@EAEAEA\dododowriteMPgraphicline}}}}% - \fi - \fi{#1} #2} - -\def\dododowriteMPgraphicline#1#2\MPend - {\doifsomething{#1}{\xdef\bufferedMPgraphicsline{\bufferedMPgraphicsline#1tex }}% - \dowriteMPgraphicline#2tex \relax etex\MPend} - -\long\def\redodowriteMPgraphicline#1#2etex#3\MPend - {\ifx\next\empty - \else\ifx\next\relax - \else - \bgroup - \let\par\space - \convertargument#2\to\ascii - \immediate\write\MPwrite{\bufferedMPgraphicsline#1tex \ascii etex}% - \globallet\bufferedMPgraphicsline\empty - \egroup - \dowriteMPgraphicline#3tex \relax etex\MPend - \fi\fi} - -\long\def\nododowriteMPgraphicline#1#2\MPend - {\ifx\next\empty - \else\ifx\next\relax - \else - \bgroup - \let\par\space - \iflongMPlines - \immediate\write\MPwrite{\bufferedMPgraphicsline#1;}% - \globallet\bufferedMPgraphicsline\empty - \else - \long\edef\ascii{\bufferedMPgraphicsline#1}% - \expandafter\flushMPgraphicline\ascii\empty;\relax;% - \fi - \egroup - \fi\fi} - -%D This stripper is suboptimal in the sense that more -%D \type{;}'s are output than feasible. Anyhow, \METAPOST\ -%D can handle this and users may consider it being a sort -%D of error prevention bonus. - -\ifx\blabelgroup\undefined - - \let\blabelgroup\bgroup - \let\elabelgroup\egroup - -\fi - -\newconditional\firstMPgraphic \settrue\firstMPgraphic - -\appendtoks - \let \# \letterhash - \let \_ \letterunderscore - \let \& \letterampersand - \let \{ \letteropenbrace - \let \} \letterclosebrace -\to \everyMPgraphic - -%D Not the best place but we need to make sure that no funny -%D active characters creep in. Some day we will move this code. - -\ifx\disablediscretionaries\undefined - \let\disablediscretionaries\relax -\fi - -\appendtoks - \disablediscretionaries -\to \everyMPgraphic - -\def\writeMPgraph - {\immediate\write\MPwrite{mpgraph:=\the\currentMPgraphic;}} - -\def\startwritingMPgraphic - {\blabelgroup - \global\advance\nofMPgraphics \plusone - \ifMPrun \else - \allocateMPslot\currentMPgraphic - \fi - \enableincludeMPgraphics - \xdef\MPgraphic{\the\currentMPgraphic}% - \the\everyMPgraphic - \presetMPdefinitions % moved to here from \writeMPgraphic - \ifrunMPgraphics - \openMPgraphicfile1{runtime}% - % no reset here ! - \theMPextensions - \theMPinclusions - \else - \openMPgraphicfile0{collected}% - % reset here ! global added (due to adding \blabelgroup) - \theMPextensions - \theMPinclusions - \global\let\theMPextensions\relax - \global\let\theMPinclusions\relax - \fi - \theMPinitializations % always - \ifMPrun - \else - \ifMPwrapper - \immediate\write\MPwrite{let mprunend = end ;}% - \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}% - \fi - \fi - \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic - \globallet\stopwritingMPgraphic\dostopwritingMPgraphic} - -\let\MPgraphicfiles\empty - -\let\MPinputtranslation\empty - -\def\openMPgraphicfile#1#2% #1=alwaysopen #2=message - {\@EA\ifx\csname\@@MPG\@@MPG\MPgraphicfile\endcsname\relax - \donetrue - % \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname - % for the sake of plain usage - \@EA\@EA\csname newwrite\endcsname\csname\@@MPG\@@MPG\MPgraphicfile\endcsname - \doglobal\addtocommalist\MPgraphicfile\MPgraphicfiles - \else - \ifcase#1\relax\donefalse\else\donetrue\fi - \fi - \@EA\let\@EA\MPwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname - \ifdone - \immediate\openout\MPwrite\MPgraphicfile.mp\relax - \ifx\MPinputtranslation\empty\else - \immediate\write\MPwrite{\MPinputtranslation}% - \immediate\write\MPwrite{verbatimtex \MPinputtranslation etex ;}% - \fi - \immediate\write\MPwrite{\letterpercent\space #2 graphics of job "\jobname"}% - \writeMPgraph - \setMPrandomseed - \fi} - -\def\dostopwritingMPgraphic - {\ifMPrun \else - \ifMPwrapper - \immediate\write\MPwrite{endfig;}% - \immediate\write\MPwrite{let end=mprunend;}% - \fi - \fi - \ifrunMPgraphics - \dodostopwritingMPgraphic - \fi - \elabelgroup} - -\def\dodostopwritingMPgraphic - {\ifnum\currentMPgraphic>\zerocount - \donetrue - \else\ifMPrun - \donetrue - \else - \donefalse - \fi\fi - \ifdone - \finishwritingMPgraphics - \runMPgraphic\MPgraphicfile - \fi - \globallet\flushMPgraphics\relax} - -\def\finishwritingMPgraphics - {\ifMPwrapper\immediate\write\MPwrite{end.}\fi - \immediate\closeout\MPwrite} - -\def\closeMPgraphicfiles - {\ifrunMPgraphics \else \ifx\MPgraphicsfiles\empty\else - \def\docommand##1% - {\message{[flush and process ##1.mp afterwards]}% - \@EA\let\@EA\MPwrite\csname\@@MPG\@@MPG##1\endcsname - \finishwritingMPgraphics}% - \processcommacommand[\MPgraphicfiles]\docommand - \fi \fi} - -\let\stopwritingMPgraphic\relax -\let\flushMPgraphics \relax - -%D By default each graphic gets its own slot (number). Later -%D on we will define a recycle bin. - -\def \allocateMPslot#1{\global\advance#1\plusone} -\def\deallocateMPslot#1{} - -%D \macros -%D {translateMPinput} -%D -%D For my polish friends: -%D -%D \starttyping -%D % translate=il2-pl -%D -%D \translateMPinput{il2-pl} -%D -%D \startMPenvironment[global] -%D \setupbodyfont[plr] -%D \stopMPenvironment -%D -%D \TeX: ± ¶ -%D -%D \startMPcode -%D draw btex MetaPost: ± ¶ etex scaled 5 ; -%D \stopMPcode -%D \stoptyping - -\def\translateMPinput#1% -% {\xdef\MPinputtranslation{\letterpercent -translate-file=#1\space}} % at some point -% {\xdef\MPinputtranslation{\letterpercent --8bit}} % some time later - {\globallet\MPinputtranslation\empty} % the new mpost is 8 bit clean - -%D \macros -%D {setMPrandomseed} -%D -%D Did you notice the random seed initialization? This is -%D needed because \METAPOST\ has a rather poor initialization, -%D which in some implementations depends on the time in -%D minutes. So, in quick successive runs, random is not that -%D random. - -\newif\ifsetMPrandomseed \setMPrandomseedtrue % false by default - -\def\setMPrandomseed - {\ifsetMPrandomseed \ifx\getrandomnumber\undefined \else - \getrandomnumber\localMPseed\zerocount{4095}% - \writeMPgraphic{randomseed:=\localMPseed;}% - \fi\fi} - -%D This feature has become optional. Thanks to Fabrice Popineau, -%D \METAPOST\ can now do a far better job! - -%D \macros -%D {flushMPgraphics} -%D -%D When we use the indirect method, all graphics are saved in -%D one file. This means that we cannot close this file after -%D every \type{\stopMPgraphic}. Therefore we need to say: -%D -%D \starttyping -%D \flushMPgraphics -%D \stoptyping -%D -%D else the file is closed without writing the \METAPOST\ end -%D command. One will notice this fast enough when in indirect -%D mode. When using the direct mode this command is not -%D implicitly needed, but ommiting it makes files less -%D portable. - -%D \macros -%D {loadcurrentMPgraphic, -%D placeMPgraphic} -%D -%D Once defined, we can call for this graphic by saying: -%D -%D \starttyping -%D \loadcurrentMPgraphic{setups} -%D \placeMPgraphic -%D \stoptyping -%D -%D This two stage insert permits some intermediate manipulations -%D of the graphic, which temporary saved in: - -\newbox\MPgraphicbox - -\def\doloadcurrentMPgraphic#1% - {\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{#1}% - \deallocateMPslot\currentMPgraphic} % added - -\ifCONTEXT - \def\loadcurrentMPgraphic{\dosinglegroupempty\doloadcurrentMPgraphic} -\else - \let\loadcurrentMPgraphic\doloadcurrentMPgraphic -\fi - -\def\loadMPgraphic#1#2% - {\setbox\MPgraphicbox\hbox{\ifinsertMPgraphics\insertMPfile{#1}{#2}\fi}} - -\def\MPllx{0} -\def\MPlly{0} - -% \def\placeMPgraphic% -% {\ifMPshiftdrawing -% \hbox{\hskip\MPllx\onebasepoint\raise\MPlly\onebasepoint\box\MPgraphicbox}% -% \else -% \box\MPgraphicbox -% \fi} -% -% experimental: - -\def\placeMPgraphic - {\ifMPshiftdrawing - \edef\next - {\wd\MPgraphicbox\the\wd\MPgraphicbox - \ht\MPgraphicbox\the\ht\MPgraphicbox - \dp\MPgraphicbox\the\dp\MPgraphicbox}% - \setbox\MPgraphicbox\hbox - {\hskip\MPllx\onebasepoint\raise\MPlly\onebasepoint\box\MPgraphicbox}% - \next - \fi - \box\MPgraphicbox} - -%D \macros -%D {startreusableMPgraphic, reuseMPgraphic, useMPbox} -%D -%D One can use the next macro for defining graphics that are -%D to be reused. When the next switch is set, graphics are -%D cached. - -\newif\ifuseMPbox \useMPboxtrue - -%D We assume that one can set objects: -%D -%D \starttyping -%D \def\douseMPbox#1% -%D {\setobject{MP}{#1}\vbox -%D {\forgetall -%D \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% -%D \deallocateMPslot\currentMPgraphic -%D \placeMPgraphic}% -%D \setgvalue{#1}{\getobject{MP}{#1}}} -%D \stoptyping -%D -%D More safe is to use a number for \type {{MP}{#1}} which permits -%D redefinition. We also saves the boundingbox. This helps positioning -%D reused graphics in layers. - -\newcount\MPobjectcounter - -\ifx\getobject\undefined \def\setobject#1#2{\setbox\scratchbox} \fi % makes dep check happy -\ifx\getobject\undefined \def\getobject#1#2{\box \scratchbox} \fi % makes dep check happy - -\def\douseMPbox#1% - {\global\advance\MPobjectcounter\plusone - \setobject{MP}{\number\MPobjectcounter}\vbox - {\forgetall - \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% - \deallocateMPslot\currentMPgraphic - \placeMPgraphic}% - \setxvalue{#1}% - {\noexpand\dodouseMPbox{\number\MPobjectcounter}{\MPllx}{\MPlly}{\MPurx}{\MPury}}} - -\def\dodouseMPbox#1#2#3#4#5% space delimiting would save some tokens - {\xdef\MPllx{#2}% but it's not worth the effort and looks - \xdef\MPlly{#3}% ugly as well - \xdef\MPurx{#4}% - \xdef\MPury{#5}% - \getobject{MP}{#1}} - -\def\nouseMPbox#1% - {\setxvalue{#1}% - {\noexpand\forgetall - \noexpand\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% - \noexpand\deallocateMPslot{\currentMPgraphic}% - \noexpand\placeMPgraphic}} - -\ifCONTEXT \else \let\douseMPbox\nouseMPbox \fi -\ifCONTEXT \else \let\doifobjectssupportedelse\relax \fi - -\long\def\handlereusableMPgraphic#1#2% - {\blabelgroup - \enableincludeMPgraphics - \startMPgraphic#2\stopMPgraphic - \doifobjectssupportedelse\donothing\useMPboxfalse - \ifuseMPbox - \expandafter \douseMPbox - \else - \expandafter \nouseMPbox - \fi {\@@MPG#1}% - \getvalue{\@@MPG#1}% - \elabelgroup} - -% \long\def\startreusableMPgraphic#1#2\stopreusableMPgraphic -% {\ifundefined{\@@MPG#1}% -% \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}}% -% \fi} - -\long\def\dostartreusableMPgraphic#1#2\stopreusableMPgraphic - {\blabelgroup - \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}}% - \elabelgroup} - -\def\reuseMPgraphic#1% - {\blabelgroup - \getvalue{\@@MPG#1}% - \elabelgroup} - -\let\stopreusableMPgraphic \relax % so that we can use it in \expanded - -%D \macros -%D {startuseMPgraphic,useMPgraphic} -%D -%D The every||time||it's||used original one is defined below. -%D This one makes sense when the graphic uses random numbers. -%D -%D We can run (process graphic) without including them at that -%D particular place. Therefore we explicitly disable -%D inclusions (resulting in an dummy figure) when we are in MP -%D run mode (see mfun-004 for an example, we process an -%D example buffer which produced graphics). - -\long\def\handleuseMPgraphic#1#2% - {\bgroup - \enableincludeMPgraphics - \startMPgraphic#2\stopMPgraphic - \ifMPrun \else - \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}% - \placeMPgraphic - \fi - \deallocateMPslot\currentMPgraphic - \egroup} - -\long\def\startuseMPgraphic - {\blabelgroup - \obeyMPlines - \dostartuseMPgraphic} - -\long\def\dostartuseMPgraphic#1#2\stopuseMPgraphic - {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}% - \elabelgroup} - -\long\def\startusableMPgraphic - {\blabelgroup - \obeyMPlines - \dostartusableMPgraphic} - -\long\def\dostartusableMPgraphic#1#2\stopusableMPgraphic - {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}% - \elabelgroup} - -\let\useMPgraphic\reuseMPgraphic - -\let\stopuseMPgraphic \relax % so that we can use it in \expanded -\let\stopusableMPgraphic \relax % so that we can use it in \expanded - -%D \macros -%D {doifMPgraphicelse} -%D -%D For (mainly internal) purposes we provide a test macro. - -% \def\doifMPgraphicelse#1% -% {\doifdefinedelse{\@@MPG#1}} - -\def\doifMPgraphicelse#1% - {\blabelgroup - \doifdefinedelse{\@@MPG#1}% - {\elabelgroup\firstoftwoarguments} - {\elabelgroup\secondoftwoarguments}} - -%D \macros -%D {includeMPgraphic} -%D -%D In a graphic one can call up another (predefined one) -%D like: -%D -%D \starttyping -%D \startuseMPgraphic{a} -%D fill fullcircle scaled 100 ; -%D \stopuseMPgraphic -%D -%D \startuseMPgraphic{b} -%D \includeMPgraphic{a} -%D fill fullsquare rotated 45 scaled 50 withcolor red ; -%D \stopuseMPgraphic -%D -%D \useMPgraphic{b} -%D \stoptyping - -\def\includeMPgraphic#1% - {\executeifdefined{\@@MPG#1};} % ; if not found - -\def\enableincludeMPgraphics - {\let\handleuseMPgraphic \secondoftwoarguments - \let\handlereusableMPgraphic\secondoftwoarguments} - -%D We didn't yet define the macro responsible for processing -%D the graphic from within \TEX. - -\def\runMPgraphic#1% - {\ifrunMPgraphics - \executeMETAPOST{#1}% - \else - % \message{[flush and process \MPgraphicfile.mp afterwards]}% - \fi} - -%D \macros -%D {useMETAFUNformat} -%D -%D For faster running, one can generate a format, saying -%D -%D \starttyping -%D mpost -ini context -%D \stoptyping -%D -%D (The resulting \type {mem} file should be moved to the -%D right location. Watch out for misatching \type {progname} -%D directives, since they can clutter memory. - -\newif\ifuseMETAFUNformat - -%D \macros -%D {executeMetaPost, executeMETAPOST, executesystemcommand} -%D -%D With \type{\executeMETAPOST} being defined as: - -\ifx\undefined\executeMETAPOST - \def\executeMETAPOST#1{\executesystemcommand{\executeMetaPost{#1}}} -\fi - -%D There are two system dependant definitions: - -\ifx\undefined\executesystemcommand - \def\executesystemcommand#1{\immediate\write18{#1}} -\fi - -\ifx\TEXEXECcommand \undefined \def\TEXEXECcommand{texmfstart texexec} \fi - -\ifx\undefined\executeMetaPost - - \ifx\undefined\interactionmode \chardef\interactionmode=255 \fi - - \def\MPOSTbatchswitch {-int=batchmode} - \def\MPOSTnonstopswitch {-int=nonstopmode} - \def\MPOSTformatswitch {-progname=metafun -mem=} - \def\MPOSTdriver {dvips} - - \def\executeMPOST#1% direct call - {mpost - \ifcase\interactionmode\MPOSTbatchswitch\or\MPOSTnonstopswitch\fi - \space\ifuseMETAFUNformat \MPOSTformatswitch metafun \fi #1} - - \def\executeMPTEX#1% slower, due to nested texexec call - {\TEXEXECcommand\space - --batch \ifcase\interactionmode --logfile='mptex.log' \fi - --output=\MPOSTdriver\space - \ifuseMETAFUNformat --mpformat=metafun \fi --mptex --nomp --once #1} - - \def\executeMetaPost - {\ifrunMPTEXgraphics - \ifMPTEXgraphic - \@EAEAEA\executeMPTEX - \else - \@EAEAEA\executeMPOST - \fi - \else - \@EA\executeMPOST - \fi} - -\fi - -%D The batchmode and nonstopmode (introduced in 2003 for -%D Patrick Gundlach) switches may differ per binary and are -%D supported by \TEXEXEC. - -%D \macros -%D {insertMPfile} -%D -%D One can define this command in advance or redefine it after -%D loading this module. The same goes for the forward -%D reference to the figure loading macro: - -\ifx\undefined\insertMPfile - - \def\insertMPfile#1#2% - {\ifx\undefined\externalfigure - \message{[insert file #1 here]}% - \else - \externalfigure - [#1] - [\c!type=\c!mps,\c!object=\v!no, - \c!symbol=\v!yes,\c!reset=\v!yes, - \c!maxwidth=,\c!maxheight=, - \c!frame=\v!off,\c!background=, - #2]% - \fi} - -\fi - -%D This macro takes {\em two} arguments, the second one can be -%D used to pass info to the inclusion macro. Some examples -%D of its use can be found in the modules \type{supp-tpi} and -%D \type{prag-log}. - -%D This module can be used in \PLAIN\ \TEX too. When using -%D \DVIPS, just try to process: -%D -%D \starttyping -%D \input supp-mps -%D -%D \runMPgraphicstrue -%D -%D \def\insertMPfile#1#2% -%D {\special{psfile=#1}} -%D -%D \startuseMPgraphic{1} -%D prologues := 1; -%D draw (0,0) withpen pencircle scaled 100; -%D \stopuseMPgraphic -%D -%D \useMPgraphic{1} -%D \stoptyping -%D -%D Don't forget to enable \type{\write18}. When does not say -%D \type{\runMPgraphicstrue}, the \METAPOST\ scratch file -%D must be closed by saying -%D -%D \starttyping -%D \flushMPgraphics -%D \stoptyping -%D -%D When using the indirect method, one has to process the file -%D \type{mpgraph.mp} between two successive \TEX\ runs. -%D -%D \METAPOST\ needs the public domain \DVI\ to \POSTSCRIPT\ -%D converter \DVIPS. This symbiosis originates in the need to -%D include the fonts (glyphs) that \METAPOST\ uses in the -%D \POSTSCRIPT\ file. Driver independancy was one of my -%D prerequisites for using \METAPOST, so I decided to build -%D this kind of support myself. Personally I consider driver -%D dependancy a drawback for the dissemination of such a -%D package. The second part of this module more or less -%D decouples \METAPOST\ and \DVIPS. -%D -%D The macros hereafter are copied from the module -%D \type{m-metapost}. After writing module \type{supp-pdf} I -%D added this method to the module named and after a while -%D decided to hook it into module \type{spec-yy}. Therefore -%D they made it into a support module, but in a slightly -%D different way. - -%D \macros -%D {includeMPfonts, ifincludeMPfonts} -%D -%D The method we use is both robust and simple: one can do -%D with calling the next macro with the filename as argument: -%D -%D \starttyping -%D \includeMPfonts{filename} -%D \stoptyping -%D -%D We can turn of this mechanism with: -%D -%D \starttyping -%D \includeMPfontsfalse -%D \stoptyping -%D -%D {\em Currently this method fails for situations where the -%D font definition is not on one line, which is he case when -%D unkerned fonts are used along with long lines. One solution -%D for this is to increase the value of \type {max_print_line} -%D in \type {texmf.cnf}.}} - -\newif\ifincludeMPfonts \includeMPfontstrue - -\def\includeMPfonts#1% - {\ifincludeMPfonts - \bgroup - \message{[MP fonts #1]}% - %\uncatcodespecials - \endlinechar\minusone - \setMPspecials - \obeyMPspecials - \setbox\scratchbox\hbox - {\hskip-\maxdimen - \doprocessfile\scratchread{#1}\handleMPfont}% - \smashbox\scratchbox - \box\scratchbox - \egroup - \fi} - -\def\UseMetaPostGraphic {\includeMPfonts} % upward compatible -\def\DontUseMetaPostGraphics {\includeMPfontsfalse} % upward compatible - -%D The characters are collected in a box and moved as far as -%D possible into the left margin. The resulting box has no -%D dimensions and can be prepended (appended) to the special -%D that handles the inclusion. The characters are in the file -%D but made invisible. -%D -%D In \CONTEXT\ font handling is intergrated in the figure -%D inclusion macros. A decent plain \TEX\ alternative is: -%D -%D \starttyping -%D \def\includeMPgraphic#1% -%D {\hbox\bgroup -%D \includeMPfonts{#1}% -%D \dogetEPSboundingbox{#1}{\dimen2}{\dimen4}{\dimen6}{\dimen8}% -%D \advance\dimen6 by -\dimen2 -%D \advance\dimen8 by -\dimen4 -%D \vbox to \dimen8 -%D {\forgetall -%D \vfill -%D \hsize\dimen6 -%D \special -%D {PSfile="#1"\space -%D llx=\EPSllx\space -%D lly=\EPSlly\space -%D urx=\EPSurx\space -%D ury=\EPSury\space}}% -%D \egroup} -%D \stoptyping -%D -%D This macro needs \type {supp-eps.tex} and provided no -%D scaling. For \LATEX\ users the next one will do: -%D -%D \starttyping -%D \def\includeMPgraphic#1#% -%D {\hbox\bgroup -%D \def\includeMPgraphics##1% -%D {\includeMPfonts{##1}% -%D \includegraphics[typetype=mps,#1]{##1}% or whatever type they use -%D \egroup}% -%D \includeMPgraphics} -%D \stoptyping - -%D We scan the graphics file for the \type{fshow} operator, -%D that is, lines that start with \type{(}. If found it -%D interprets the line, which looks like: -%D -%D \starttyping -%D (string ... string) font size fshow -%D \stoptyping -%D -%D Font definitions specified in the preamble are simply -%D ignored. Only lines starting with \type{(} are interpreted. - -\def\dohandleMPfont#1#2\relax - {\if#1(\expandafter\includeMPcharacters\fileline\relax\fi} - -\def\handleMPfont - {\expandafter\dohandleMPfont\fileline\relax} - -%D Before we start scanning for data, we first change some -%D \CATCODES. The first set of macro's is copied from module -%D \type{supp-pdf}. This scheme is a bit overdone for this -%D module, but using the same macros saves us some memory. - -\def\octalMPcharacter#1#2#3% - {\char'#1#2#3\relax} - -\bgroup -\catcode`\|=\@@comment -\catcode`\%=\@@active -\catcode`\[=\@@active -\catcode`\]=\@@active -\catcode`\{=\@@active -\catcode`\}=\@@active -\catcode`B=\@@begingroup -\catcode`E=\@@endgroup -\gdef\keepMPspecials| - B\let%\letterpercent| - \def[B\noexpand[E| - \def]B\noexpand]E| - \def{B\noexpand{E| - \def}B\noexpand}EE -\gdef\ignoreMPspecials| - B\let%\letterpercent| - \def[BE| - \def]BE| - \def{BE| - \def}BEE -\gdef\obeyMPspecials| - B\def%B\char 37\relax E| - \def[B\char 91\relax E| - \def]B\char 93\relax E| - \def{B\char123\relax E| - \def}B\char125\relax EE -\gdef\setMPspecials| - B\setnaturalcatcodes - \catcode`\\=\@@escape - \catcode`\%=\@@active - \catcode`\[=\@@active - \catcode`\]=\@@active - \catcode`\{=\@@active - \catcode`\}=\@@active - \lccode`\-=0 | latex sets this to `\- - \lccode`\%=`\% | otherwise it's seen as a number - \def\(B\char40\relax E| - \def\)B\char41\relax E| - \def\\B\char92\relax E| - \def\0B\octalMPcharacter0E| - \def\1B\octalMPcharacter1E| - \def\2B\octalMPcharacter2E| - \def\3B\octalMPcharacter3E| - \def\4B\octalMPcharacter4E| - \def\5B\octalMPcharacter5E| - \def\6B\octalMPcharacter6E| - \def\7B\octalMPcharacter7E| - \def\8B\octalMPcharacter8E| - \def\9B\octalMPcharacter9EE -\egroup - -%D The lines starting with \type{(} are interpreted and -%D handled by -%D -%D \starttyping -%D \def\includeMPcharacters(#1) #2 #3 #4\relax% -%D {\font\temp=#2 at #3bp\temp#1} -%D \stoptyping -%D -%D While processing some \TUG~98 proceedings, I also had to -%D deal with: -%D -%D \starttyping -%D /nfont {10 div dup scale 10} def -%D (T) ANTTB 7.13086 nfont fshow -%D \stoptyping -%D -%D which comes to rounding sizes. This is something -%D experimental. (The macro in supp-pdf.tex is more -%D advanced.) - -\def\PSnfont{nfont} - -\def\includeMPcharacters(#1) #2 #3 #4#5#6#7#8#9\relax - {\edef\temp{#4#5#6#7#8}% - \ifx\temp\PSnfont % round font size (to pt) - \scratchdimen#3\onepoint - \ifdim\scratchdimen<\onepoint - \def\size{1pt}% - \else - \advance\scratchdimen .5\onepoint - \def\size##1.##2\relax{\def\size{##1pt}}% - \expandafter\size\the\scratchdimen\relax - \fi - \else - \edef\size{#3bp}% - \fi - \font\temp=#2 at \size - \temp\if#1 \char32\else#1\fi} - -%D This method is both robust and reasonable fast. The only -%D disadvantage is that when not embedded properly in the -%D graphics inclusion macros, one has to load all graphics by -%D hand. - -%D Now let's see if things work all right and show the example -%D files that are part of the \METAPOST\ distribution: -%D -%D \setupexternalfigures[directory={../sample}] -%D \startlinecorrection -%D \setupalign[middle] -%D \leavevmode -%D \startcombination[3*3] -%D {\externalfigure[mp-exa-1][frame=on,width=.2\hsize]} {} -%D {\externalfigure[mp-exa-2][frame=on,width=.2\hsize]} {} -%D {\externalfigure[mp-exa-3][frame=on,width=.2\hsize]} {} -%D {\externalfigure[mp-exa-4][frame=on,width=.2\hsize]} {} -%D {\externalfigure[mp-exa-5][frame=on,width=.2\hsize]} {} -%D {\externalfigure[mp-exa-6][frame=on,width=.2\hsize]} {} -%D {\externalfigure[mp-exa-7][frame=on,width=.2\hsize]} {} -%D {\externalfigure[mp-exa-8][frame=on,width=.2\hsize]} {} -%D {\externalfigure[mp-exa-9][frame=on,width=.2\hsize]} {} -%D \stopcombination -%D \stoplinecorrection -%D -%D Here we used calls like: -%D -%D \starttyping -%D \externalfigure[mp-exa-1][methode-mps,frame=on,width=.2\hsize] -%D \stoptyping - -%D \macros -%D {convertMPcolors, -%D ifconvertMPcolors,ifreduceMPcolors,ifforceMPcolors} -%D -%D When I told the editors that I wanted to use colored -%D \METAPOST\ graphics in the color issue of the \MAPS, I was -%D asked to use the \cap{CMYK} colorspace instead of \cap{RGB} -%D one. However, \METAPOST\ only supports \cap{RGB} colors. I -%D decided to write a utility to convert the \type -%D {setrgbcolor} operators into \type {setcmykcolor} ones, and -%D some experiments showed me that I could best let \TEX\ do it -%D itself. Here it is: -%D -%D There are two booleans that control the conversion process. -%D These are false by default. - -\newif\ifconvertMPcolors -\newif\ifreduceMPcolors -\newif\ifforcegrayMPcolors - -%D The main macro is called as: -%D -%D \starttyping -%D \convertMPcolors{filename} -%D \stoptyping -%D -%D When active, this macro returns a message saying if indeed -%D conversion took place. The old file is overwritten! This -%D saves time in a succesive passes and can't harm, simply -%D because MP can generate them anew. - -\def\convertMPcolorpath{} -\def\convertMPcolorfile{metacmyk.tmp} - -\def\convertMPcolors#1% todo: open on local path, no copy - {\bgroup - \ifforcegrayMPcolors - \donetrue - \else\ifconvertMPcolors - \donetrue - \else - \donefalse - \fi\fi - \ifdone - \message{[MP color conversion #1}% - \endlinechar\minusone - \uncatcodespecials - \donefalse - \immediate\openout\scratchwrite\convertMPcolorpath\convertMPcolorfile\relax - \doprocessfile\scratchread{#1}\handleMPcolor - \immediate\closeout\scratchwrite - \ifdone - \immediate\openout\scratchwrite\convertMPcolorpath#1\relax - \doprocessfile\scratchread{\convertMPcolorpath \convertMPcolorfile}\handleMPcopy - \immediate\closeout\scratchwrite - \message{done]}% - \else - \message{not needed]}% - \fi - \immediate\openout\scratchwrite\convertMPcolorpath\convertMPcolorfile - \immediate\closeout\scratchwrite - \fi - \egroup} - -%D The process is rather simple: read a line, look for the -%D \type {setrgbcolor} operator, recalculate the components and -%D check for gray reduction or black removal, write the result -%D to a temporary file, and go on. Afterwards, the file is -%D copied back. We don't have to reduce to gray scales; -%D \METAPOST\ already takes care of that. - -%D The next macro is needed for forced conversion. This macro -%D is copied from \type{colo-ini}, just in case one uses this -%D module outside \CONTEXT. - -\ifx\@@cl@@s \undefined \def\@@cl@@s{0} \fi - -\ifx\convertRGBtoGRAY\undefined - -\def\convertRGBtoGRAY#1#2#3% - {\scratchdimen#1\onepoint - \scratchdimen300\scratchdimen - \scratchcounter\scratchdimen - \scratchdimen#2\onepoint - \scratchdimen590\scratchdimen - \advance\scratchcounter \scratchdimen - \scratchdimen#3\onepoint - \scratchdimen110\scratchdimen - \advance\scratchcounter \scratchdimen - \advance\scratchcounter \!!medcard - \divide\scratchcounter \!!maxcard - \edef\@@cl@@s{\realcolorvalue\scratchcounter}} - -\fi - -%D BTW, this code is quite old, and not as complete as the -%D \PDF\ converter, which also handles spot colors and so. - -\def\handleMPcolor - {\expandafter\dohandleMPcolor\fileline setrgbcolor*\\} - -\def\dohandleMPcolor#1setrgbcolor#2#3\\% - {\if#2*% - \immediate\write\scratchwrite{#1}% - \else - \dodohandleMPcolor#1setrgbcolor#2#3\\% - \fi} - -\def\dodohandleMPcolor#1 #2 #3setrgbcolor#4setrgbcolor*\\% old and maybe broke - {\bgroup - \ifdim#1pt=.123pt - \immediate\write\scratchwrite{#1 #2 #3 setrgbcolor}% - \else - \ifforcegrayMPcolors - \convertRGBtoGRAY{#1}{#2}{#3}% - \immediate\write\scratchwrite - {\@@cl@@s \space setgray #4}% - \else - \dimen0=\onepoint \advance\dimen0 -#1\points - \dimen2=\onepoint \advance\dimen2 -#2\points - \dimen4=\onepoint \advance\dimen4 -#3\points - \ifreduceMPcolors - \dimen6\dimen0 - \ifdim\dimen2<\dimen6 \dimen6\dimen2 \fi - \ifdim\dimen4<\dimen6 \dimen6\dimen4 \fi - \advance\dimen0 -\dimen6 - \advance\dimen2 -\dimen6 - \advance\dimen4 -\dimen6 - \else - \dimen6\zeropoint - \fi - \immediate\write\scratchwrite - {\withoutpt\the\dimen0 \space - \withoutpt\the\dimen2 \space - \withoutpt\the\dimen4 \space - \withoutpt\the\dimen6 \space setcmykcolor #4}% - \fi - \fi - \egroup - \donetrue} % needed for message - -\def\handleMPcopy - {\immediate\write\scratchwrite{\fileline}} - -%D The next examples show the color conversion macros in -%D action. These examples also demonstrate in||text \METAPOST\ -%D handling. As we will see, the conversion is hooked into the -%D \CONTEXT\ color mechanism. -%D -%D By setting both \type{rgb} and \type{cmyk} to off, we force -%D conversion to gray scales using: -%D -%D \placeformula[-] -%D \startformula -%D G = .30r + .59g + .11b -%D \stopformula -%D -%D By using buffers, we keep the \ASCII\ layout clean: -%D -%D \startbuffer -%D \startbuffer[rgb] -%D \setupcolors[rgb=ja,cmyk=nee,reduction=no,conversion=no] -%D \useMPgraphic{hans} -%D \stopbuffer -%D -%D \startbuffer[cmyk] -%D \setupcolors[rgb=nee,cmyk=ja,reduction=no,conversion=no] -%D \useMPgraphic{hans} -%D \stopbuffer -%D -%D \startbuffer[cmy] -%D \setupcolors[rgb=nee,cmyk=ja,reduction=yes,conversion=no] -%D \useMPgraphic{hans} -%D \stopbuffer -%D -%D \startbuffer[gray] -%D \setupcolors[rgb=nee,cmyk=nee,reduction=no,conversion=no] -%D \useMPgraphic{hans} -%D \stopbuffer -%D \stopbuffer -%D -%D \typebuffer -%D \getbuffer -%D -%D The graphic is rather simple and is generated each time -%D it's called: -%D -%D \global\runMPgraphicstrue -%D -%D \startbuffer -%D \startbuffer[graphic] -%D \startuseMPgraphic{hans} -%D width :=\the\textwidth/5; -%D height := width/4; -%D fill fullcircle -%D xscaled width -%D yscaled height -%D withcolor (\RedGreenBlue); -%D \stopuseMPgraphic -%D \stopbuffer -%D \stopbuffer -%D -%D \typebuffer -%D \getbuffer -%D -%D Next we combine the four alternative interpretations in a -%D combination: -%D -%D \startbuffer -%D \startbuffer[result] -%D \startcombination[4] -%D {\getbuffer[rgb]} {\tfxx original} -%D {\getbuffer[cmyk]} {\ttxx\string\convertMPcolorstrue} -%D {\getbuffer[cmy]} {\ttxx\string\reduceMPcolorstrue} -%D {\getbuffer[gray]} {\ttxx\string\forcegrayMPcolorstrue} -%D \stopcombination -%D \stopbuffer -%D \stopbuffer -%D -%D \typebuffer -%D \getbuffer -%D -%D Finally we call the buffers, using different setting: -%D -%D \startbuffer -%D \placefigure -%D {\METAPOST\ color conversions} -%D {\def\RedGreenBlue{.1,.4,.6}\getbuffer[graphic]\getbuffer[result]\vskip6pt -%D \def\RedGreenBlue{.1,.6,.4}\getbuffer[graphic]\getbuffer[result]\vskip6pt -%D \def\RedGreenBlue{.4,.1,.6}\getbuffer[graphic]\getbuffer[result]\vskip6pt -%D \def\RedGreenBlue{.4,.6,.1}\getbuffer[graphic]\getbuffer[result]\vskip6pt -%D \def\RedGreenBlue{.6,.1,.4}\getbuffer[graphic]\getbuffer[result]\vskip6pt -%D \def\RedGreenBlue{.6,.4,.1}\getbuffer[graphic]\getbuffer[result]} -%D \stopbuffer -%D -%D \typebuffer -%D \getbuffer -%D -%D By the way, when the \POSTSCRIPT\ file resulting from -%D this input is converted into \PDF\ and viewed in Acrobat -%D Reader, one can quite different colors from those -%D displayed in \GHOSTSCRIPT, which view equals the -%D \POSTSCRIPT\ originals. - -%D \macros -%D {experimental} -%D -%D Some experimental macros: -%D -%D \starttyping -%D \startMPdrawing -%D \stopMPdrawing -%D \pushMPdrawing -%D \popMPdrawing -%D \resetMPdrawing -%D \ifMPdrawingdone -%D \getMPdrawing -%D \MPdivten[number] -%D \stoptyping -%D -%D These macros are used in \PPCHTEX. - -\let\MPdrawingdata\empty - -\newif\ifMPdrawingdone \MPdrawingdonefalse -\newif\ifMPshiftdrawing \MPshiftdrawingfalse - -\def\resetMPdrawing - {\globallet\MPdrawingdata\empty - \global\MPdrawingdonefalse} - -% why global push/pop here? - -\def\pushMPdrawing - {\globalpushmacro\MPdrawingdata - \globallet\MPdrawingdata\empty} - -\def\popMPdrawing - {\globalpopmacro\MPdrawingdata} - -\def\getMPdrawing - {\ifMPdrawingdone - \expandafter\startMPgraphic\MPdrawingdata\stopMPgraphic - \loadcurrentMPgraphic{}% - \deallocateMPslot\currentMPgraphic - \placeMPgraphic - \fi} - -\def\startMPdrawing - {\dosingleempty\dostartMPdrawing} - -\long\def\dostartMPdrawing[#1]#2\stopMPdrawing - {\relax - \bgroup - \enableincludeMPgraphics - \presetMPdefinitions % in case #2 has measures - \doifelse{#1}{-}{\convertargument#2\to\asciia}{\long\def\asciia{#2}}% - \long\xdef\MPdrawingdata{\MPdrawingdata\asciia}% - \egroup} - -\let\stopMPdrawing\relax - -\def\MPdivten[#1]% - {\@EA\@EA\@EA\doMPdivten\@EA\@EA\@EA[\@EA#1]} - -\def\doMPdivten[#1]% - {\ifnum#1> 9999 \dodoMPdivtenB#1\else - \ifnum#1> 999 \dodoMPdivtenC#1\else - \ifnum#1> 99 \dodoMPdivtenD#1\else - \ifnum#1> 9 \dodoMPdivtenE#1\else - \ifnum#1> 0 \dodoMPdivtenF#1\else - \ifnum#1<-9999 \dodoMPdivtenA#1\else - \ifnum#1< -999 \dodoMPdivtenB#1\else - \ifnum#1< -99 \dodoMPdivtenC#1\else - \ifnum#1< -9 \dodoMPdivtenD#1\else - \ifnum#1< 0 \dodoMPdivtenE#1\else - 0 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} - -\def\dodoMPdivtenA#1#2#3#4#5#6{#1#2#3#4#5.#6} -\def\dodoMPdivtenB #1#2#3#4#5{#1#2#3#4.#5} -\def\dodoMPdivtenC #1#2#3#4{#1#2#3.#4} -\def\dodoMPdivtenD #1#2#3{#1#2.#3} -\def\dodoMPdivtenE #1#2{#1.#2} -\def\dodoMPdivtenF #1{.#1} - -% if we assume etex ... \def\MPdivten[#1]{\withoutpt\the\dimexpr#1pt/10\relax} - -%D \macros -%D {startMPclip,grabMPclippath} -%D -%D We can use \METAPOST\ to calculate arbitrary clipping -%D paths. Such a path is defined by (for instance): -%D -%D \starttyping -%D \startMPclip{window} -%D clip currentpicture to fullcircle xscaled \width yscaled \height ; -%D \stopMPclip -%D \stoptyping -%D -%D Such a path can be extracted (processed) by: -%D -%D \starttyping -%D \grabMPclippath{window}{method}{width}{height}{default path} -%D \stoptyping -%D -%D Currently only method 1 makes sense; it produces \PDF\ -%D code. This macro only makes sense when hooked into a -%D special routine. - -\let\MPclippath\empty - -\long\def\startMPclip#1#2\stopMPclip - {\blabelgroup - \long\setgvalue{MPC:#1}{\startMPgraphic#2\stopMPgraphic\dograbMPclippath}% - \elabelgroup} - -\let\stopMPclip\relax - -\def\grabMPclippath#1#2#3#4#5% - {\blabelgroup - \edef\width {#3\space}\let\overlaywidth \width - \edef\height{#4\space}\let\overlayheight\height - \doifdefinedelse{MPC:#1} - {\getvalue{MPC:#1}% - \setxvalue{MPC:#1}{\noexpand\xdef\noexpand\MPclippath{\MPclippath}}}% - {\xdef\MPclippath{#5}}% - \ifcase#2\else % method 1 : - \doglobal\stripcharacter urveto\from\MPclippath\to\MPclippath - \doglobal\stripcharacter oveto\from\MPclippath\to\MPclippath - \doglobal\stripcharacter ineto\from\MPclippath\to\MPclippath - \fi - \elabelgroup} - -%D We pose some restrictions to the \METAPOST\ code and pickup -%D the clip path from the file. -%D -%D We turn the slash into a comment. The \type {\hbox} grabs spaces -%D and the \type {%} triggers the grabber. Next we filter the -%D clipping path, or actually, the first path. - -% \bgroup -% \catcode`\%=\@@active -% \catcode`\/=\@@comment -% \gdef\dograbMPclippath/ -% {\setbox\scratchbox=\hbox\bgroup/ -% \catcode`\%=\@@active -% \obeylines\let\obeyedline\space -% \def\do##1newpath##2closepath##3\od/ -% {\xdef\MPclippath{##2}\endinput}/ -% \def%##1%%EOF/ -% {\do##1newpathclosepath\od\endinput}/ -% \readfile{\MPgraphicfile.\the\currentMPgraphic}{}{}/ -% \deallocateMPslot\currentMPgraphic / new -% \egroup} -% \egroup - -\bgroup -\catcode`\%=\@@active -\catcode`\/=\@@comment -\gdef\dograbMPclippath/ - {\setbox\scratchbox=\hbox\bgroup/ - \catcode`\%=\@@active - \obeylines\let\obeyedline\space - \def\do##1q n##2p W##3\od/ - {\xdef\MPclippath{##2}\endinput}/ - \def%##1%%EOF/ - {\do##1q np W\od\endinput}/ - \readfile{\MPgraphicfile.\the\currentMPgraphic}{}{}/ - \ifx\MPclippath\empty - \def\do##1newpath##2closepath##3\od/ - {\xdef\MPclippath{##2}\endinput}/ - \def%##1%%EOF/ - {\do##1newpathclosepath\od\endinput}/ - \readfile{\MPgraphicfile.\the\currentMPgraphic}{}{}/ - \fi - \deallocateMPslot\currentMPgraphic / new - \egroup} -\egroup - -%D \macros -%D {recycleMPslots} -%D -%D When coding and embedding many \METAPOST\ figures in a -%D document, one can save quite some disk space by using -%D \PDFTEX\ and setting the next switch: - -\newif\ifrecycleMPslots \recycleMPslotstrue - -%D When a graphic takes space in the text flow, we can run -%D into deadlock typesetting. In the first pass, the graphic -%D is not available, but in the second pass it is. The -%D placeholder that was put there in the first pass in now -%D replace by the real graphic and as a result the document -%D shrinks or grows and pages are removed or added. This in -%D turn can trigger generation of other graphics, like those -%D in the background. Graphics start swapping place and again -%D page breaks change. You can imagine the mess we en dup -%D with. -%D -%D This is why we provide was to use a dedicate range if -%D numbers for fixed graphcs. Such graphics will not en dup -%D in the text flow (at least their dimensions don't -%D contribute to the main vertical list, and thereby they -%D cannot interfere. We use a rather safe maximum of 4000 -%D graphics here and 8000 in \type {meta-ini}. - -\newcount \maxnofMPgraphics \maxnofMPgraphics = 4000 % 8000 -\newcount \minnofMPgraphics \minnofMPgraphics = 1 - -\newif \ifMPstaticgraphic \MPstaticgraphicfalse % determines slot allocation - -\def\locateMPslot#1% slightly faster on one slot, much faster on multiple slots - {\ifundefined{\number#1MP}% no \ifcsname - \letgvalueempty{\number#1MP}% - \expandafter\gobbletwoarguments - \else - \global\advance#1\plusone - \fi - \locateMPslot#1} - -\def\allocateMPslot#1% - {\ifrunMPgraphics - \ifx\pdfliteral\undefined - \recycleMPslotsfalse % quite certainly not pdftex - \else\ifcase\pdfoutput - \recycleMPslotsfalse % dvi mode or not pdftex (we need to handle dvipdfmx) - \fi\fi - \else - \recycleMPslotsfalse - \fi - \ifrecycleMPslots - % \doloop % slow but used seldom - % {\doifundefined{\recurselevel MP} - % {\letgvalueempty{\recurselevel MP}% - % \global#1\recurselevel - % \exitloop}}% - \global#1\plusone - \locateMPslot#1% - % \message{[MP slot + \number#1]% - \else\ifMPstaticgraphic % beware not the same as static graphics - \global#1\maxnofMPgraphics - \global\advance\maxnofMPgraphics \minusone - \else - \global#1\minnofMPgraphics - \global\advance\minnofMPgraphics \plusone - \fi\fi - \ifnum\minnofMPgraphics<\maxnofMPgraphics \else - \writestatus\m!systems{increase \string\maxnofMPgraphics}% - \fi} - -\def\deallocateMPslot#1% - {\ifrunMPgraphics - \ifcase\pdfoutput \recycleMPslotsfalse \fi - \else - \recycleMPslotsfalse - \fi - \ifrecycleMPslots - \global\letbeundefined{\number#1MP}% - %\message{[MP slot - \number#1]}% - \fi} - -%D Experimental and overloaded later, since we need to be -%D more clever due to \METAPOST's limit of 4~open files. - -\def\MPdatafile - {mp-\the\currentMPgraphic.mpd} - -\def\getMPdata - {\input \MPdatafile\relax} - -%D \macros -%D {MPtoks, MPbox} -%D -%D For convenience, we provide some scratch registers: - -\ifx\undefined\MPtoks \newtoks\MPtoks \fi -\ifx\undefined\MPbox \newbox \MPbox \fi - -%D \macros -%D {startMPcode} -%D -%D We can save some typing with: -%D -%D \starttyping -%D \startMPcode whatever \stopMPcode -%D \stoptyping -%D -%D this automatically places the graphic - -\long\def\startMPcode - {\begingroup - \obeyMPlines - \dostartMPcode} - -\long\def\dostartMPcode#1\stopMPcode - {\startuseMPgraphic{@@}#1\stopuseMPgraphic - \useMPgraphic{@@}% - \endgroup} - -\let\stopMPcode\relax - -%D \macros -%D {startstaticMPgraphic} -%D -%D Dedicated to Aditya Mahajan. See meta-ini for usage. - -% \long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic -% {\bgroup -% \MPstaticgraphictrue -% \setMPrandomseedfalse -% \def\MPgraphicfile{#1}% no \jobname here -% \let\allocateMPslot \gobbleoneargument -% \let\deallocateMPslot\gobbleoneargument -% \let\runMPgraphic \gobbleoneargument -% \MPextensions\emptytoks -% \MPinitializations\emptytoks -% \runMPgraphicstrue -% \MPwrapperfalse -% \enableincludeMPgraphics -% \def\sometxt##1{\string\sometxt{##1}}% -% \currentMPgraphic\plusone % hack, else no close -% \startMPgraphic#2\stopMPgraphic -% \executeMPgraphicfile -% \egroup} - -% different version, less messy hooked into the rest - -\long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic - {\blabelgroup - \def\MPgraphicfile{#1}% no \jobname here - \let\MPwrite\MPstaticwrite - \immediate\openout\MPwrite=\MPgraphicfile.mp - \setMPrandomseedfalse - \enableincludeMPgraphics - \def\sometxt##1{\string\sometxt{##1}}% - \the\everyMPgraphic - \presetMPdefinitions - \theMPinclusions % brrr - \writeMPgraphic{\letterpercent mpenvironment: \the\everyMPTEXgraphic}% - \writeMPgraphic{beginfig(1);}% - \writeMPgraphic{#2}% - \writeMPgraphic{endfig; end.}% - \immediate\closeout\MPwrite - \executeMPgraphicfile - \elabelgroup} - -% this will go to meta-ini - -\def\delaysystemcommand - {\ifx\installprogram\undefined - \expandafter\executesystemcommand - \else - \expandafter\installprogram - \fi} - -\def\MPgraphicfilerunner - {texmfstart --ifchanged=\MPgraphicfile.mp texexec --mpstatic \MPgraphicfile.mp} - -\ifx\doifmode\undefined - \def\executeMPgraphicfile - {\ifrunMPgraphics\@EA\executesystemcommand\else\@EA\delaysystemcommand\fi{\MPgraphicfilerunner}} -\else - \def\executeMPgraphicfile{\doifmode{*\v!first} - {\ifrunMPgraphics\@EA\executesystemcommand\else\@EA\delaysystemcommand\fi{\MPgraphicfilerunner}}} -\fi - -%D Special for \XETEX\ (problem with newlines). This will go -%D away once the version supporting \type {--8bit} is -%D widespread. - -\ifnum\texengine=\xetexengine - \let\obeyMPlines\relax - \longMPlinesfalse % alas -\fi - -\protect \endinput diff --git a/tex/context/base/supp-mrk.mkii b/tex/context/base/supp-mrk.mkii new file mode 100644 index 000000000..eb1865471 --- /dev/null +++ b/tex/context/base/supp-mrk.mkii @@ -0,0 +1,591 @@ +%D \module +%D [ file=supp-mrk, +%D version=1995.10.10, +%D title=\CONTEXT\ Support Macros, +%D subtitle=Marks, +%D author=Jim Fox / Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Remark: due to the lack of \type {\clearmark}, the \ETEX\ +%D dedicated mechanism is not yet operational. + +%D This module has deverted so much from the original that I +%D can probably rewrite it to a more efficient one now and +%D I will do so. + +%D There are 256 \COUNTERS, \DIMENSIONS, \SKIPS, \MUSKIPS\ and +%D \BOXES, 16~in- and output buffers, but there is only one +%D \MARK. In TugBoat~8 (1987, no~1) Jim Fox presents a set of +%D macros that can be used to mimmick multiple marks. We +%D gladly adopt them here. I may rewrite this module from +%D scratch some day, since some low level \CONTEXT\ commands +%D can be used. +%D +%D This module was changed on behalf of \ETEX. The main +%D extension is that \type{\get..} and alike is used instead of +%D direct calls. The \TEX\ based multiple marks needs to store +%D the mark data but \ETEX\ uses a different approach. + +\writestatus{loading}{ConTeXt Support Macros / Marks} + +\unprotect + +%D We start with the presetting the interface macros. +%D +%D \starttabulate[|||] +%D \NC \type{\getmarks} \NC sets the marks to their values \NC \NR +%D \NC \type{\getallmarks} \NC sets all marks to their values \NC \NR +%D \NC \type{\getsplitmarks} \NC sets the splitmarks to their values\NC \NR +%D \NC \type{\getallsplitmarks} \NC sets all splitmarks to their values\NC \NR +%D \NC \type{\setmarks} \NC synchronizes topmarks (\ETEX) \NC \NR +%D \stoptabulate +%D +%D Later we will overload these, dependent of the brand of +%D \TEX\ that we use. + +\let \getmarks \gobbleoneargument +\let \getallmarks \relax +\let \getsplitmarks \gobbleoneargument +\let \getallsplitmarks \relax +\let \setallmarks \relax + +\let \newmark \gobbleoneargument +\let \newpersistentmark \gobbleoneargument +\let \resetmark \gobbleoneargument +\let \setmark \gobbletwoargument + +%D \macros +%D {expandmarks} +%D +%D We can force expansion of marks with the following switch. + +\newif\ifexpandmarks \expandmarkstrue % hm, true indeed ? + +\beginTEX + +%D This implementation is more or less compatible with the +%D other \type {\new} macros in \PLAIN\ \TEX. A mark is +%D defined by: +%D +%D \starttyping +%D \newmark\name +%D \stoptyping +%D +%D and can be called upon with: +%D +%D \starttyping +%D \gettopmark \name % or \topname +%D \getbotmark \name % or \botname +%D \getfirstmark\name % or \firstname +%D \stoptyping +%D +%D The only drawback of his approach is that the marks must be +%D preloaded in the output routine. This is accomplished by +%D means of: +%D +%D \starttyping +%D \getmarks\name +%D \stoptyping +%D +%D The macros presented here are in most aspects copies of +%D those presented by Jim Fox. We've taken the freedom to +%D change a few things for more or less obvious reasons: +%D +%D \startitemize +%D \item Because the original macros look quite complicated, +%D which is mainly due to extensive use of +%D \type{\expandafter}'s and \type{\csname}'s, we changed +%D those in favor of \type{\getvalue}. +%D \item To be more in line with the rest of \CONTEXT, we've +%D changed some of the names of macros. +%D \item Because we are already short on \COUNTERS\ we use +%D macros when possible. +%D \item We maintain a list of defined marks and use one +%D call for getting them all at once. +%D \item We have extended the mechanism to splitmarks (not +%D perfected yet). +%D \item We've introduced optional expansion of the contents +%D of marks. +%D \stopitemize +%D +%D Whatever changes we've made, the credits still go to Jim, +%D whatever goes wrong is due to me. The method is described +%D in the TugBoat mentioned before, so we won't go into +%D details. All marks belonging to a group are packed in a +%D list. In this list they are preceded by a macro that can +%D be defined at will and a number concerning the position at +%D which it was defined. +%D +%D \starttyping +%D \def\somelist{... \domark5{this} ... \domark31{that} ...} +%D \stoptyping +%D +%D The original \type{\mark} keeps track of the number and +%D \type{\topmark} and \type{\botmark} are used to extract the +%D actual marks from the list. The counting is done by +%D +%D \starttyping +%D \currentmarker +%D \stoptyping +%D +%D In \CONTEXT\ we use the mark mechanism to keep track of +%D colors. In a complicated documents with many colors per +%D page, \type{\currentmarker} can therefore get pretty high. +%D (Well, this is not completely true, because we don't +%D always have to use marks.) + +\newcount\currentmarker + +%D The original implementation used a few more \COUNTERS. Two +%D have been substituted by macros, one has been replaced by +%D our scratch counter. +%D +%D \starttyping +%D \newcount\topmarker +%D \newcount\botmarker +%D \newcount\foundmarker +%D \stoptyping +%D +%D We've also introduced some constants, one for the lists and +%D three for composing the mark commands. + +\def\@@marklist@@ {*m*} % {marklist} +\def\@@marktop@@ {*t*} % {top} +\def\@@markbot@@ {*b*} % {bot} +\def\@@markfirst@@ {*f*} % {first} +\def\@@markcurrent@@ {*c*} % {current} + +%D The next one is new too. All defined marks are packed in a +%D comma seperated list. This could of course have been a token +%D list but \CONTEXT\ has some preference for comma lists. + +\let\allmarks=\empty + +%D The next macro replaces the multiple step expansion and +%D command name constructors of Jim. This alternative leads to +%D a more readable source (we hope). + +\def\makemarknames#1% kan genest werken + {\bgroup + \escapechar=-1 + \xdef\markname{\string#1}% + \xdef\marklist{\@@marklist@@\markname}% + \egroup} + +%D \macros +%D {newmark,resetmark} +%D +%D A mark is defined by \type{\newmark}. At the same time, +%D the name of the mark is added to a commalist. The +%D three initializations were not in the original design, but +%D make calls from outside the output routine a bit more +%D robust. + +\let\domark\relax % saves a restore on the stack + +\def\definenewmark#1#2% + {\bgroup + \makemarknames{#1}% + #2% + \letgvalueempty{\@@markcurrent@@\markname}% + \letgvalueempty{\@@marktop@@ \markname}% + \letgvalueempty{\@@markfirst@@ \markname}% + \letgvalueempty{\@@markbot@@ \markname}% + \setgvalue{\marklist}{\domark0{}}% beware of halfway definitions + \long\gdef#1{\addmarker#1}% + \egroup} + +\def\newmark#1% + {\definenewmark#1{\doglobal\addtocommalist\markname\allmarks}} + +%D Don't ask me, but sometimes we need more control over +%D updating the marks, thereby we have: + +\def\newpersistentmark#1% for an example see core-grd.tex + {\definenewmark#1\relax} + +\let\setmark \empty +\let\resetmark\newmark + +%D Some more natural interfacing macros: + +\def\getcurrentmark #1{\getvalue{\@@markcurrent@@\strippedcsname#1}} +\def\gettopmark #1{\getvalue{\@@marktop@@ \strippedcsname#1}} +\def\getbottommark #1{\getvalue{\@@markbot@@ \strippedcsname#1}} +\def\getfirstmark #1{\getvalue{\@@markfirst@@ \strippedcsname#1}} +\def\getsplitbottommark#1{\getvalue{\@@markbot@@ \strippedcsname#1}} +\def\getsplitfirstmark #1{\getvalue{\@@markfirst@@ \strippedcsname#1}} + +%D \macros +%D {setmark} +%D +%D Setting a new mark and adding a mark to the designated +%D list is done by \type{\addmarker}. This is an internal +%D command, the user set a marks bij calling it's name: +%D +%D \starttyping +%D \setmark\mymark{some text} % or \mymark{some text} +%D \stoptyping +%D +%D Where \type{\mymark} is previously defined by +%D \type{\newmark}. + +\long\def\addmarker#1#2% + {\bgroup + \makemarknames{#1}% + \setgvalue{\@@markcurrent@@\markname}{#2}% + \global\advance\currentmarker \plusone + \normalmark{\the\currentmarker}% + \!!toksa\@EA\@EA\@EA{\csname\marklist\endcsname}% + \ifexpandmarks + \setxvalue\marklist + {\the\!!toksa + \noexpand\domark + \the\currentmarker{#2}}% + \else + \!!toksb\@EA{#2}% one level, why ? handy for cs + \setxvalue\marklist + {\the\!!toksa + \noexpand\domark + \the\currentmarker{\the\!!toksb}}% + \fi + \egroup} + +%D \macros +%D {getmarks,getallmarks, +%D getsplitmarks,getallsplitmarks} +%D +%D In fact, marks make only sense in the output routine. Marks +%D are derived from their list by means of \type{\getmarks}. +%D Only one call per mark is permitted in the output routine. +%D Therefore, it's far more easy to get them all at once, by +%D means of \type{\getallmarks}, which is not part of the +%D original design. +%D +%D This grabbing is done by processing the list using the +%D embedded \type{\domark} macros. When a relevant mark is +%D found, this macro is reassigned and from then on serves +%D in building the new list. + +% Hm, resetting \!!toksa got lost and took me a half a day to +% trace down ([] showed up in the pagebody); I really have +% to clean up this messy module (write it from scratch). + +\newif\ifnofirstmarker % an auxiliary switch + +\def\getmarks#1% + {\bgroup + \makemarknames{#1}% + \edef\topmarker{0\normaltopmark}% + \edef\botmarker{0\normalbotmark}% + \!!toksa\emptytoks + \!!toksb\emptytoks + \nofirstmarkertrue + % does more worse than good + \let\fi\relax + \let\or\relax + \let\else\relax + % + \let\domark\doscanmarks + \getvalue\marklist\lastmark + %\message{markstatus : [\the\!!toksa\the\!!toksb\the\!!toksc]}% + \long\setxvalue\marklist{\the\!!toksa\the\!!toksb\the\!!toksc}% + \egroup} + +\def\getsplitmarks#1% + {\bgroup + \makemarknames{#1}% + % \@EA\let\@EA\savedmarklist\@EA\csname\marklist\endcsname + \edef\topmarker{0\normalsplitfirstmark}% + \edef\botmarker{0\normalsplitbotmark}% + \!!toksa\emptytoks + \!!toksb\emptytoks + \nofirstmarkertrue + % does more worse than good + \let\fi\relax + \let\or\relax + \let\else\relax + % + \let\domark\doscanmarks + \getvalue\marklist\lastmark + % \global\@EA\let\csname\marklist\endcsname\savedmarklist + \egroup} + +\def\getallmarks {\processcommacommand[\allmarks]\getmarks} +\def\getallsplitmarks{\processcommacommand[\allmarks]\getsplitmarks} + +\def\getallmarks {\@EA\processcommalist\@EA[\allmarks]\getmarks} +\def\getallsplitmarks{\@EA\processcommalist\@EA[\allmarks]\getsplitmarks} + +\long\def\dodoscanmarks#1% + {\ifnum\scratchcounter>\topmarker\relax + \normalelse + \long\setgvalue{\@@marktop@@\markname}{#1}% + \normalfi + \ifnum\scratchcounter>\botmarker\relax + \let\domark\dorecovermarks + \!!toksb\@EA{\@EA\domark\the\scratchcounter{#1}}% + \normalelse + \ifnofirstmarker + \long\setgvalue{\@@markfirst@@\markname}{#1}% + \ifnum\scratchcounter>\topmarker\relax + \nofirstmarkerfalse + \normalfi + \normalfi + \long\setgvalue{\@@markbot@@\markname}{#1}% + \!!toksa\@EA{\@EA\domark\the\scratchcounter{#1}}% + \normalfi} + +\def\doscanmarks + {\afterassignment\dodoscanmarks\scratchcounter=} + +\long\def\dorecovermarks#1\lastmark% nice trick + {\!!toksc{\domark#1}} + +\def\lastmark% rest of trick + {\!!toksc\emptytoks} + +\endTEX + +%D The \ETEX\ way of doing things \unknown + +\beginETEX \marks cum suis + +\newtoks \listofmarks + +\def\@@prk{prk:} +\def\@@mrk{mrk:} +\def\@@trk{trk:} +\def\@@frk{frk:} +\def\@@brk{brk:} +\def\@@crk{crk:} + +%D We will use two state variables per mark, one to signal +%D that a new mark value is set, and one to trigger (on the +%D next page) the setting of the top mark. + +\def\checkedtopmarks #1{\csname\@@trk\string#1\endcsname} +\def\checkedfirstmarks#1{\csname\@@frk\string#1\endcsname} +\def\checkedbotmarks #1{\csname\@@brk\string#1\endcsname} +\def\thecurrentmarks #1{\csname\@@crk\string#1\endcsname} + +\long\def\setmark#1% + {%\writestatus{marks}{setting \string#1}\wait + \global\@EA\chardef\csname\@@mrk\string#1\endcsname\plusone + %\@EA\normalmarks\csname\@@prk\string#1\endcsname{1}% + \@EA\normalmarks\csname\@@prk\string#1\endcsname{\realfolio}% + \ifexpandmarks\@EA\setexpandedmark\else\@EA\setnormalmark\fi#1} + +\def\setexpandedmark#1#2% % marks expand anyway + {\@EA\xdef\csname\@@crk\string#1\endcsname{#2}% + \normalmarks#1{#2}} + +\def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark + {\begingroup % don't ask why, but grouping is needed + \scratchtoks{#2}% in order to to mess up scratchtoks + \@EA\xdef\csname\@@crk\string#1\endcsname{\the\scratchtoks}% + \normalmarks#1{\the\scratchtoks}% one level expansion + \endgroup} + +\def\checktopmark#1% + {%\writestatus{marks}{checking \string#1}\wait + \ifcase\csname\@@mrk\string#1\endcsname\else\dochecktopmark#1\fi} + +%\def\dochecktopmark#1% +% {\ifcase0\@EA\normalfirstmarks\csname\@@prk\string#1\endcsname\else +% \@EA\ifx\csname\@@frk\string#1\endcsname\empty +% \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}% +% \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}% +% \else +% \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}% +% \global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount +% \fi +% \fi} + +\def\dochecktopmark#1% + {\ifx*\@EA\normalfirstmarks\csname\@@prk\string#1\endcsname*\else + \@EA\ifx\csname\@@frk\string#1\endcsname\empty + \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}% + \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}% + \else + \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}% + \global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount + \fi + \fi} + +%\def\resetmark#1% we cannot use \normalmarks#1{} +% {\global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount +% \@EA\normalmarks\csname\@@prk\string#1\endcsname{0}% +% \global\@EA\let\csname\@@trk\string#1\endcsname\empty +% \global\@EA\let\csname\@@frk\string#1\endcsname\empty +% \global\@EA\let\csname\@@brk\string#1\endcsname\empty +% \global\@EA\let\csname\@@crk\string#1\endcsname\empty} + +\def\resetmark#1% we cannot use \normalmarks#1{} + {\global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount + \@EA\normalmarks\csname\@@prk\string#1\endcsname{}% {0}% + \global\@EA\let\csname\@@trk\string#1\endcsname\empty + \global\@EA\let\csname\@@frk\string#1\endcsname\empty + \global\@EA\let\csname\@@brk\string#1\endcsname\empty + \global\@EA\let\csname\@@crk\string#1\endcsname\empty} + +\def\definenewmark#1% + {\ifcsname\@@prk\string#1\endcsname\else % this is etex -) + \newmarks#1\doglobal\appendtoks\checktopmark#1\to\listofmarks + \@EA\newmarks\csname\@@prk\string#1\endcsname % status mark + \fi + \global\@EA\mathchardef\csname\@@mrk\string#1\endcsname\zerocount + \global\@EA\let\csname\@@crk\string#1\endcsname\empty + \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}% + \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}% + \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}} + +\let \newmark \definenewmark +\let \newpersistentmark \newmarks % \definenewmark +\let \normalsetmark \setmark + +\def\getallmarks{\the\listofmarks} % \def\setallmarks{\the\listofmarks} + +%D In \type {page-ini} or \type {core-mar} we should say: +%D +%D \starttyping +%D \appendtoks \getallmarks \to \everybeforepagebody +%D \appendtoks \setallmarks \to \everyafterpagebody +%D \stoptyping + +\let\getcurrentmark \thecurrentmarks +\let\gettopmark \checkedtopmarks +\let\getbottommark \checkedbotmarks % \normalbotmarks +\let\getfirstmark \checkedfirstmarks % \normalfirstmarks +\let\getsplitbottommark \normalsplitbotmarks +\let\getsplitfirstmark \normalsplitfirstmarks + +\let\getbotmark \getbottommark +\let\getsplitbotmark \normalsplitbotmarks +\let\getsplittopmark \normalsplitfirstmarks + +\endETEX + +%D A couple of goodies: + +\let\getbotmark \getbottommark +\let\getsplitbotmark\getsplitbottommark +\let\getsplittopmark\getsplitfirstmark + +%D \macros +%D {noninterferingmarks} +%D +%D Marks can interfere badly with for instance postprocessing +%D paragraphs, for instance when we want to grab the last box +%D using \type {\lastbox}, when at the same time using colors. + +\let\normalsetmark\setmark + +\def\noninterferingsetmark#1#2% + {\ifhmode\prewordbreak\hbox\fi{\normalsetmark{#1}{#2}}} + +\def\noninterferingmarks + {\let\noninterferingmarks\relax + \let\setmark\noninterferingsetmark} + +%D This macro is for instance used in the inline headings +%D postprocessing, as needed when we want to make those +%D clickable. + +%D Right from the beginning, \CONTEXT\ supported more than one +%D mark, using an extended version of Jim Fox multiple mark +%D mechanism. In \ETEX\ we can however directly access more +%D marks than we will ever need. + +%D Resetting marks in not compatible with the old method. +%D Here a node is inserted, which can interfere badly. In +%D fact, a real \type {\clearmarks\name} is needed. +%D +%D \starttyping +%D \def\resetmark#1{\marks#1{}} +%D \stoptyping +%D +%D A possible macro solution is presented here. When discussing +%D \type {\clearmarks} on the \ETEX\ discussion list, Chris +%D Rowley suggested to use a reset flag. Unfortunately this +%D is not enough since we need to keep track of both set and +%D reset state then. This means that we must postpone resetting +%D to the page following the set, and as a result we need +%D another auxiliary macro. The current solution is the best +%D I could come up with so far, especially given that we +%D need a fast mechanism. + +%D For those who want to know the story behind resetting +%D marks, here are some examples of interference +%D +%D \startbuffer +%D \setbox0=\vbox{test} +%D \unvbox0\setbox0=\lastbox +%D \ruledhbox{\unhbox0} +%D \stopbuffer +%D +%D \typebuffer\blank\getbuffer\blank +%D +%D \startbuffer +%D \setbox0=\vbox{test\normalmark{}} +%D \unvbox0\setbox0=\lastbox +%D \ruledhbox{\unhbox0} +%D \stopbuffer +%D +%D \typebuffer\blank\getbuffer\blank +%D +%D \startbuffer +%D \setbox0=\vbox{test\hbox{\normalmark{}}} +%D \unvbox0\setbox0=\lastbox +%D \ruledhbox{\unhbox0} +%D \stopbuffer +%D +%D \typebuffer\blank\getbuffer\blank +%D +%D \startbuffer +%D \setbox0=\vbox{test\vbox{\normalmark{}}} +%D \unvbox0\setbox0=\lastbox +%D \ruledhbox{\unhbox0} +%D \stopbuffer +%D +%D \typebuffer\blank\getbuffer\blank + +%D One final advice. Use marks with care. When used in globally +%D assigned boxes, the list can grow quite big, and processing +%D can slow down considerably. This drawback is removed in +%D \ETEX\ mode. + +\beginTEX + +\let\rawnewmark \newmark +\let\rawdefinemark \newmark +\let\rawsetmark \setmark +\let\rawgettopmark \gettopmark +\let\rawgetfirstmark \getfirstmark +\let\rawgetbotmark \getbotmark +\let\rawgetsplitbotmark \normalsplitbotmark +\let\rawgetsplitfirstmark\normalsplitfirstmark +\let\rawgetsplittopmark \normalsplitfirstmark + +\endTEX + +\beginETEX + +\let\rawnewmark \newmarks +\let\rawdefinemark \newmarks +\let\rawsetmark \normalmarks +\let\rawgettopmark \normaltopmarks +\let\rawgetfirstmark \normalfirstmarks +\let\rawgetbotmark \normalbotmarks +\let\rawgetsplitbotmark \normalsplitbotmarks +\let\rawgetsplitfirstmark\normalsplitfirstmarks +\let\rawgetsplittopmark \normalsplitfirstmarks + +\endETEX + +\protect \endinput diff --git a/tex/context/base/supp-mrk.tex b/tex/context/base/supp-mrk.tex deleted file mode 100644 index eb1865471..000000000 --- a/tex/context/base/supp-mrk.tex +++ /dev/null @@ -1,591 +0,0 @@ -%D \module -%D [ file=supp-mrk, -%D version=1995.10.10, -%D title=\CONTEXT\ Support Macros, -%D subtitle=Marks, -%D author=Jim Fox / Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Remark: due to the lack of \type {\clearmark}, the \ETEX\ -%D dedicated mechanism is not yet operational. - -%D This module has deverted so much from the original that I -%D can probably rewrite it to a more efficient one now and -%D I will do so. - -%D There are 256 \COUNTERS, \DIMENSIONS, \SKIPS, \MUSKIPS\ and -%D \BOXES, 16~in- and output buffers, but there is only one -%D \MARK. In TugBoat~8 (1987, no~1) Jim Fox presents a set of -%D macros that can be used to mimmick multiple marks. We -%D gladly adopt them here. I may rewrite this module from -%D scratch some day, since some low level \CONTEXT\ commands -%D can be used. -%D -%D This module was changed on behalf of \ETEX. The main -%D extension is that \type{\get..} and alike is used instead of -%D direct calls. The \TEX\ based multiple marks needs to store -%D the mark data but \ETEX\ uses a different approach. - -\writestatus{loading}{ConTeXt Support Macros / Marks} - -\unprotect - -%D We start with the presetting the interface macros. -%D -%D \starttabulate[|||] -%D \NC \type{\getmarks} \NC sets the marks to their values \NC \NR -%D \NC \type{\getallmarks} \NC sets all marks to their values \NC \NR -%D \NC \type{\getsplitmarks} \NC sets the splitmarks to their values\NC \NR -%D \NC \type{\getallsplitmarks} \NC sets all splitmarks to their values\NC \NR -%D \NC \type{\setmarks} \NC synchronizes topmarks (\ETEX) \NC \NR -%D \stoptabulate -%D -%D Later we will overload these, dependent of the brand of -%D \TEX\ that we use. - -\let \getmarks \gobbleoneargument -\let \getallmarks \relax -\let \getsplitmarks \gobbleoneargument -\let \getallsplitmarks \relax -\let \setallmarks \relax - -\let \newmark \gobbleoneargument -\let \newpersistentmark \gobbleoneargument -\let \resetmark \gobbleoneargument -\let \setmark \gobbletwoargument - -%D \macros -%D {expandmarks} -%D -%D We can force expansion of marks with the following switch. - -\newif\ifexpandmarks \expandmarkstrue % hm, true indeed ? - -\beginTEX - -%D This implementation is more or less compatible with the -%D other \type {\new} macros in \PLAIN\ \TEX. A mark is -%D defined by: -%D -%D \starttyping -%D \newmark\name -%D \stoptyping -%D -%D and can be called upon with: -%D -%D \starttyping -%D \gettopmark \name % or \topname -%D \getbotmark \name % or \botname -%D \getfirstmark\name % or \firstname -%D \stoptyping -%D -%D The only drawback of his approach is that the marks must be -%D preloaded in the output routine. This is accomplished by -%D means of: -%D -%D \starttyping -%D \getmarks\name -%D \stoptyping -%D -%D The macros presented here are in most aspects copies of -%D those presented by Jim Fox. We've taken the freedom to -%D change a few things for more or less obvious reasons: -%D -%D \startitemize -%D \item Because the original macros look quite complicated, -%D which is mainly due to extensive use of -%D \type{\expandafter}'s and \type{\csname}'s, we changed -%D those in favor of \type{\getvalue}. -%D \item To be more in line with the rest of \CONTEXT, we've -%D changed some of the names of macros. -%D \item Because we are already short on \COUNTERS\ we use -%D macros when possible. -%D \item We maintain a list of defined marks and use one -%D call for getting them all at once. -%D \item We have extended the mechanism to splitmarks (not -%D perfected yet). -%D \item We've introduced optional expansion of the contents -%D of marks. -%D \stopitemize -%D -%D Whatever changes we've made, the credits still go to Jim, -%D whatever goes wrong is due to me. The method is described -%D in the TugBoat mentioned before, so we won't go into -%D details. All marks belonging to a group are packed in a -%D list. In this list they are preceded by a macro that can -%D be defined at will and a number concerning the position at -%D which it was defined. -%D -%D \starttyping -%D \def\somelist{... \domark5{this} ... \domark31{that} ...} -%D \stoptyping -%D -%D The original \type{\mark} keeps track of the number and -%D \type{\topmark} and \type{\botmark} are used to extract the -%D actual marks from the list. The counting is done by -%D -%D \starttyping -%D \currentmarker -%D \stoptyping -%D -%D In \CONTEXT\ we use the mark mechanism to keep track of -%D colors. In a complicated documents with many colors per -%D page, \type{\currentmarker} can therefore get pretty high. -%D (Well, this is not completely true, because we don't -%D always have to use marks.) - -\newcount\currentmarker - -%D The original implementation used a few more \COUNTERS. Two -%D have been substituted by macros, one has been replaced by -%D our scratch counter. -%D -%D \starttyping -%D \newcount\topmarker -%D \newcount\botmarker -%D \newcount\foundmarker -%D \stoptyping -%D -%D We've also introduced some constants, one for the lists and -%D three for composing the mark commands. - -\def\@@marklist@@ {*m*} % {marklist} -\def\@@marktop@@ {*t*} % {top} -\def\@@markbot@@ {*b*} % {bot} -\def\@@markfirst@@ {*f*} % {first} -\def\@@markcurrent@@ {*c*} % {current} - -%D The next one is new too. All defined marks are packed in a -%D comma seperated list. This could of course have been a token -%D list but \CONTEXT\ has some preference for comma lists. - -\let\allmarks=\empty - -%D The next macro replaces the multiple step expansion and -%D command name constructors of Jim. This alternative leads to -%D a more readable source (we hope). - -\def\makemarknames#1% kan genest werken - {\bgroup - \escapechar=-1 - \xdef\markname{\string#1}% - \xdef\marklist{\@@marklist@@\markname}% - \egroup} - -%D \macros -%D {newmark,resetmark} -%D -%D A mark is defined by \type{\newmark}. At the same time, -%D the name of the mark is added to a commalist. The -%D three initializations were not in the original design, but -%D make calls from outside the output routine a bit more -%D robust. - -\let\domark\relax % saves a restore on the stack - -\def\definenewmark#1#2% - {\bgroup - \makemarknames{#1}% - #2% - \letgvalueempty{\@@markcurrent@@\markname}% - \letgvalueempty{\@@marktop@@ \markname}% - \letgvalueempty{\@@markfirst@@ \markname}% - \letgvalueempty{\@@markbot@@ \markname}% - \setgvalue{\marklist}{\domark0{}}% beware of halfway definitions - \long\gdef#1{\addmarker#1}% - \egroup} - -\def\newmark#1% - {\definenewmark#1{\doglobal\addtocommalist\markname\allmarks}} - -%D Don't ask me, but sometimes we need more control over -%D updating the marks, thereby we have: - -\def\newpersistentmark#1% for an example see core-grd.tex - {\definenewmark#1\relax} - -\let\setmark \empty -\let\resetmark\newmark - -%D Some more natural interfacing macros: - -\def\getcurrentmark #1{\getvalue{\@@markcurrent@@\strippedcsname#1}} -\def\gettopmark #1{\getvalue{\@@marktop@@ \strippedcsname#1}} -\def\getbottommark #1{\getvalue{\@@markbot@@ \strippedcsname#1}} -\def\getfirstmark #1{\getvalue{\@@markfirst@@ \strippedcsname#1}} -\def\getsplitbottommark#1{\getvalue{\@@markbot@@ \strippedcsname#1}} -\def\getsplitfirstmark #1{\getvalue{\@@markfirst@@ \strippedcsname#1}} - -%D \macros -%D {setmark} -%D -%D Setting a new mark and adding a mark to the designated -%D list is done by \type{\addmarker}. This is an internal -%D command, the user set a marks bij calling it's name: -%D -%D \starttyping -%D \setmark\mymark{some text} % or \mymark{some text} -%D \stoptyping -%D -%D Where \type{\mymark} is previously defined by -%D \type{\newmark}. - -\long\def\addmarker#1#2% - {\bgroup - \makemarknames{#1}% - \setgvalue{\@@markcurrent@@\markname}{#2}% - \global\advance\currentmarker \plusone - \normalmark{\the\currentmarker}% - \!!toksa\@EA\@EA\@EA{\csname\marklist\endcsname}% - \ifexpandmarks - \setxvalue\marklist - {\the\!!toksa - \noexpand\domark - \the\currentmarker{#2}}% - \else - \!!toksb\@EA{#2}% one level, why ? handy for cs - \setxvalue\marklist - {\the\!!toksa - \noexpand\domark - \the\currentmarker{\the\!!toksb}}% - \fi - \egroup} - -%D \macros -%D {getmarks,getallmarks, -%D getsplitmarks,getallsplitmarks} -%D -%D In fact, marks make only sense in the output routine. Marks -%D are derived from their list by means of \type{\getmarks}. -%D Only one call per mark is permitted in the output routine. -%D Therefore, it's far more easy to get them all at once, by -%D means of \type{\getallmarks}, which is not part of the -%D original design. -%D -%D This grabbing is done by processing the list using the -%D embedded \type{\domark} macros. When a relevant mark is -%D found, this macro is reassigned and from then on serves -%D in building the new list. - -% Hm, resetting \!!toksa got lost and took me a half a day to -% trace down ([] showed up in the pagebody); I really have -% to clean up this messy module (write it from scratch). - -\newif\ifnofirstmarker % an auxiliary switch - -\def\getmarks#1% - {\bgroup - \makemarknames{#1}% - \edef\topmarker{0\normaltopmark}% - \edef\botmarker{0\normalbotmark}% - \!!toksa\emptytoks - \!!toksb\emptytoks - \nofirstmarkertrue - % does more worse than good - \let\fi\relax - \let\or\relax - \let\else\relax - % - \let\domark\doscanmarks - \getvalue\marklist\lastmark - %\message{markstatus : [\the\!!toksa\the\!!toksb\the\!!toksc]}% - \long\setxvalue\marklist{\the\!!toksa\the\!!toksb\the\!!toksc}% - \egroup} - -\def\getsplitmarks#1% - {\bgroup - \makemarknames{#1}% - % \@EA\let\@EA\savedmarklist\@EA\csname\marklist\endcsname - \edef\topmarker{0\normalsplitfirstmark}% - \edef\botmarker{0\normalsplitbotmark}% - \!!toksa\emptytoks - \!!toksb\emptytoks - \nofirstmarkertrue - % does more worse than good - \let\fi\relax - \let\or\relax - \let\else\relax - % - \let\domark\doscanmarks - \getvalue\marklist\lastmark - % \global\@EA\let\csname\marklist\endcsname\savedmarklist - \egroup} - -\def\getallmarks {\processcommacommand[\allmarks]\getmarks} -\def\getallsplitmarks{\processcommacommand[\allmarks]\getsplitmarks} - -\def\getallmarks {\@EA\processcommalist\@EA[\allmarks]\getmarks} -\def\getallsplitmarks{\@EA\processcommalist\@EA[\allmarks]\getsplitmarks} - -\long\def\dodoscanmarks#1% - {\ifnum\scratchcounter>\topmarker\relax - \normalelse - \long\setgvalue{\@@marktop@@\markname}{#1}% - \normalfi - \ifnum\scratchcounter>\botmarker\relax - \let\domark\dorecovermarks - \!!toksb\@EA{\@EA\domark\the\scratchcounter{#1}}% - \normalelse - \ifnofirstmarker - \long\setgvalue{\@@markfirst@@\markname}{#1}% - \ifnum\scratchcounter>\topmarker\relax - \nofirstmarkerfalse - \normalfi - \normalfi - \long\setgvalue{\@@markbot@@\markname}{#1}% - \!!toksa\@EA{\@EA\domark\the\scratchcounter{#1}}% - \normalfi} - -\def\doscanmarks - {\afterassignment\dodoscanmarks\scratchcounter=} - -\long\def\dorecovermarks#1\lastmark% nice trick - {\!!toksc{\domark#1}} - -\def\lastmark% rest of trick - {\!!toksc\emptytoks} - -\endTEX - -%D The \ETEX\ way of doing things \unknown - -\beginETEX \marks cum suis - -\newtoks \listofmarks - -\def\@@prk{prk:} -\def\@@mrk{mrk:} -\def\@@trk{trk:} -\def\@@frk{frk:} -\def\@@brk{brk:} -\def\@@crk{crk:} - -%D We will use two state variables per mark, one to signal -%D that a new mark value is set, and one to trigger (on the -%D next page) the setting of the top mark. - -\def\checkedtopmarks #1{\csname\@@trk\string#1\endcsname} -\def\checkedfirstmarks#1{\csname\@@frk\string#1\endcsname} -\def\checkedbotmarks #1{\csname\@@brk\string#1\endcsname} -\def\thecurrentmarks #1{\csname\@@crk\string#1\endcsname} - -\long\def\setmark#1% - {%\writestatus{marks}{setting \string#1}\wait - \global\@EA\chardef\csname\@@mrk\string#1\endcsname\plusone - %\@EA\normalmarks\csname\@@prk\string#1\endcsname{1}% - \@EA\normalmarks\csname\@@prk\string#1\endcsname{\realfolio}% - \ifexpandmarks\@EA\setexpandedmark\else\@EA\setnormalmark\fi#1} - -\def\setexpandedmark#1#2% % marks expand anyway - {\@EA\xdef\csname\@@crk\string#1\endcsname{#2}% - \normalmarks#1{#2}} - -\def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark - {\begingroup % don't ask why, but grouping is needed - \scratchtoks{#2}% in order to to mess up scratchtoks - \@EA\xdef\csname\@@crk\string#1\endcsname{\the\scratchtoks}% - \normalmarks#1{\the\scratchtoks}% one level expansion - \endgroup} - -\def\checktopmark#1% - {%\writestatus{marks}{checking \string#1}\wait - \ifcase\csname\@@mrk\string#1\endcsname\else\dochecktopmark#1\fi} - -%\def\dochecktopmark#1% -% {\ifcase0\@EA\normalfirstmarks\csname\@@prk\string#1\endcsname\else -% \@EA\ifx\csname\@@frk\string#1\endcsname\empty -% \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}% -% \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}% -% \else -% \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}% -% \global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount -% \fi -% \fi} - -\def\dochecktopmark#1% - {\ifx*\@EA\normalfirstmarks\csname\@@prk\string#1\endcsname*\else - \@EA\ifx\csname\@@frk\string#1\endcsname\empty - \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}% - \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}% - \else - \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}% - \global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount - \fi - \fi} - -%\def\resetmark#1% we cannot use \normalmarks#1{} -% {\global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount -% \@EA\normalmarks\csname\@@prk\string#1\endcsname{0}% -% \global\@EA\let\csname\@@trk\string#1\endcsname\empty -% \global\@EA\let\csname\@@frk\string#1\endcsname\empty -% \global\@EA\let\csname\@@brk\string#1\endcsname\empty -% \global\@EA\let\csname\@@crk\string#1\endcsname\empty} - -\def\resetmark#1% we cannot use \normalmarks#1{} - {\global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount - \@EA\normalmarks\csname\@@prk\string#1\endcsname{}% {0}% - \global\@EA\let\csname\@@trk\string#1\endcsname\empty - \global\@EA\let\csname\@@frk\string#1\endcsname\empty - \global\@EA\let\csname\@@brk\string#1\endcsname\empty - \global\@EA\let\csname\@@crk\string#1\endcsname\empty} - -\def\definenewmark#1% - {\ifcsname\@@prk\string#1\endcsname\else % this is etex -) - \newmarks#1\doglobal\appendtoks\checktopmark#1\to\listofmarks - \@EA\newmarks\csname\@@prk\string#1\endcsname % status mark - \fi - \global\@EA\mathchardef\csname\@@mrk\string#1\endcsname\zerocount - \global\@EA\let\csname\@@crk\string#1\endcsname\empty - \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}% - \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}% - \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}} - -\let \newmark \definenewmark -\let \newpersistentmark \newmarks % \definenewmark -\let \normalsetmark \setmark - -\def\getallmarks{\the\listofmarks} % \def\setallmarks{\the\listofmarks} - -%D In \type {page-ini} or \type {core-mar} we should say: -%D -%D \starttyping -%D \appendtoks \getallmarks \to \everybeforepagebody -%D \appendtoks \setallmarks \to \everyafterpagebody -%D \stoptyping - -\let\getcurrentmark \thecurrentmarks -\let\gettopmark \checkedtopmarks -\let\getbottommark \checkedbotmarks % \normalbotmarks -\let\getfirstmark \checkedfirstmarks % \normalfirstmarks -\let\getsplitbottommark \normalsplitbotmarks -\let\getsplitfirstmark \normalsplitfirstmarks - -\let\getbotmark \getbottommark -\let\getsplitbotmark \normalsplitbotmarks -\let\getsplittopmark \normalsplitfirstmarks - -\endETEX - -%D A couple of goodies: - -\let\getbotmark \getbottommark -\let\getsplitbotmark\getsplitbottommark -\let\getsplittopmark\getsplitfirstmark - -%D \macros -%D {noninterferingmarks} -%D -%D Marks can interfere badly with for instance postprocessing -%D paragraphs, for instance when we want to grab the last box -%D using \type {\lastbox}, when at the same time using colors. - -\let\normalsetmark\setmark - -\def\noninterferingsetmark#1#2% - {\ifhmode\prewordbreak\hbox\fi{\normalsetmark{#1}{#2}}} - -\def\noninterferingmarks - {\let\noninterferingmarks\relax - \let\setmark\noninterferingsetmark} - -%D This macro is for instance used in the inline headings -%D postprocessing, as needed when we want to make those -%D clickable. - -%D Right from the beginning, \CONTEXT\ supported more than one -%D mark, using an extended version of Jim Fox multiple mark -%D mechanism. In \ETEX\ we can however directly access more -%D marks than we will ever need. - -%D Resetting marks in not compatible with the old method. -%D Here a node is inserted, which can interfere badly. In -%D fact, a real \type {\clearmarks\name} is needed. -%D -%D \starttyping -%D \def\resetmark#1{\marks#1{}} -%D \stoptyping -%D -%D A possible macro solution is presented here. When discussing -%D \type {\clearmarks} on the \ETEX\ discussion list, Chris -%D Rowley suggested to use a reset flag. Unfortunately this -%D is not enough since we need to keep track of both set and -%D reset state then. This means that we must postpone resetting -%D to the page following the set, and as a result we need -%D another auxiliary macro. The current solution is the best -%D I could come up with so far, especially given that we -%D need a fast mechanism. - -%D For those who want to know the story behind resetting -%D marks, here are some examples of interference -%D -%D \startbuffer -%D \setbox0=\vbox{test} -%D \unvbox0\setbox0=\lastbox -%D \ruledhbox{\unhbox0} -%D \stopbuffer -%D -%D \typebuffer\blank\getbuffer\blank -%D -%D \startbuffer -%D \setbox0=\vbox{test\normalmark{}} -%D \unvbox0\setbox0=\lastbox -%D \ruledhbox{\unhbox0} -%D \stopbuffer -%D -%D \typebuffer\blank\getbuffer\blank -%D -%D \startbuffer -%D \setbox0=\vbox{test\hbox{\normalmark{}}} -%D \unvbox0\setbox0=\lastbox -%D \ruledhbox{\unhbox0} -%D \stopbuffer -%D -%D \typebuffer\blank\getbuffer\blank -%D -%D \startbuffer -%D \setbox0=\vbox{test\vbox{\normalmark{}}} -%D \unvbox0\setbox0=\lastbox -%D \ruledhbox{\unhbox0} -%D \stopbuffer -%D -%D \typebuffer\blank\getbuffer\blank - -%D One final advice. Use marks with care. When used in globally -%D assigned boxes, the list can grow quite big, and processing -%D can slow down considerably. This drawback is removed in -%D \ETEX\ mode. - -\beginTEX - -\let\rawnewmark \newmark -\let\rawdefinemark \newmark -\let\rawsetmark \setmark -\let\rawgettopmark \gettopmark -\let\rawgetfirstmark \getfirstmark -\let\rawgetbotmark \getbotmark -\let\rawgetsplitbotmark \normalsplitbotmark -\let\rawgetsplitfirstmark\normalsplitfirstmark -\let\rawgetsplittopmark \normalsplitfirstmark - -\endTEX - -\beginETEX - -\let\rawnewmark \newmarks -\let\rawdefinemark \newmarks -\let\rawsetmark \normalmarks -\let\rawgettopmark \normaltopmarks -\let\rawgetfirstmark \normalfirstmarks -\let\rawgetbotmark \normalbotmarks -\let\rawgetsplitbotmark \normalsplitbotmarks -\let\rawgetsplitfirstmark\normalsplitfirstmarks -\let\rawgetsplittopmark \normalsplitfirstmarks - -\endETEX - -\protect \endinput diff --git a/tex/context/base/supp-pat.mkii b/tex/context/base/supp-pat.mkii new file mode 100644 index 000000000..d91083076 --- /dev/null +++ b/tex/context/base/supp-pat.mkii @@ -0,0 +1,179 @@ +%D \module +%D [ file=supp-pat, +%D version=2005.02.12, +%D title=\CONTEXT\ Support Macros, +%D subtitle=Patterns, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 support: +%D +%D \starttyping +%D \patterns { +%D ...[namedglyphs]... +%D } +%D \stoptyping +%D +%D as well as: +%D +%D \starttyping +%D +%D ...&namedglyphs;... +%D +%D \stoptyping +%D +%D The \XML\ variant has very limited \XML\ parsing capabilities and +%D is meant as an experiment. + +\ifx\writestatus\undefined \else + + \writestatus{loading}{ConTeXt Support Macros / Patterns} + +\fi + +%D \CONTEXT: + +\ifx\startmapping\undefined \else \ifx\startencoding\undefined \else + + \def\fetchpatterntoken#1{\csname#1\endcsname} + +\fi \fi + +%D First we define the \ETEX\ variant. We cannot do that inside +%D the if statement because normal \TEX\ gets confused over the +%D csname test (which it does not see as if but it does see the +%D else's and fi's). + +\def\etexfetchpatterntoken#1% + {\csname + \ifcsname @pattok@#1\endcsname + @pattok@#1% + \else\ifcsname#1\endcsname + #1% + \else + @pattok@default% + \fi\fi + \endcsname} + +\ifx \fetchpatterntoken \undefined + + \ifx \eTeXversion \undefined + + \def\fetchpatterntoken#1% + {\csname + \expandafter\ifx\csname @pattok@#1\endcsname\relax + \expandafter\ifx\csname#1\endcsname\relax + @pattok@default% + \else + #1% + \fi + \else + @pattok@#1% + \fi + \endcsname} + + \else + + \let\fetchpatterntoken\etexfetchpatterntoken + + \fi + +\fi + +\def\definepatterntoken #1 #2 % + {\expandafter\def\csname @pattok@#1\endcsname{#2}} + +%D \TEX\ based: + +\bgroup \catcode`\[=\active + + \gdef\enablepatterntokens + {\catcode`\[=\active \let[\handlepatterntoken} + +\egroup + +\def\handlepatterntoken#1]% + {\fetchpatterntoken{#1}} + +%D \XML\ based: + +\bgroup \catcode`\<=\active \catcode`\&=\active + + \gdef\enablepatternxml + {\catcode`\<=\active + \catcode`\&=\active + \let&\handlepatternentity + \let<\handlepatternxml} + +\egroup + +\def\handlepatternentity#1;% + {\fetchpatterntoken{#1}} + +%D We use a very simple \XML\ parser, and we only trigger on the first +%D two characters of the tag name. Consider this feature a playground +%D (and a bit of a joke). + +\def\handlepatternxml#1#2% we only distinguish the first two chars + {\csname @patxml@\ifcsname @patxml@#1#2\endcsname#1#2\else de\fi\endcsname} + +\def\definepatternxml #1#2#3 #4% + {\expandafter\def\csname @patxml@#1#2\endcsname{#4}} + +\def\fetchpatternxml#1#2>% + {\bgroup + \long\def\next##1>{\egroup}% + \catcode`\<=2 % \@@endgroup + \afterassignment\next + #1\bgroup} + +\def\gobblepatternxml + {\bgroup + \catcode`\%=11 + \dogobblepatternxml} + +\long\def\dogobblepatternxml#1>% + {\egroup} + +%D Here are the default definitions. We don't catch empty elements. + +\definepatternxml patterns {\fetchpatternxml\patterns} +\definepatternxml hyphenations {\fetchpatternxml\hyphenation} +\definepatternxml pattern {\fetchpatternxml\patterns} +\definepatternxml hyphenation {\fetchpatternxml\hyphenation} +\definepatternxml default {\gobblepatternxml} + +\definepatterntoken default x + +\ifx\pattern \undefined \let\pattern \patterns \fi +\ifx\hyphenations\undefined \let\hyphenations\hyphenation \fi + +%D An example of usage in another format than \CONTEXT: +%D +%D \starttyping +%D \bgroup +%D +%D \lccode"E4="E4 \definepatterntoken adiaeresis ^^e4 +%D \lccode"F6="F6 \definepatterntoken odiaeresis ^^f6 +%D \lccode"FC="FC \definepatterntoken ediaeresis ^^fc +%D \lccode"FF="FF \definepatterntoken ssharp ^^ff +%D +%D \enablepatterntokens +%D \enablepatternxml +%D +%D \input lang-de.pat +%D \input lang-de.hyp +%D +%D \egroup +%D \stoptyping +%D +%D This is a minimal example for EC encoding, and of course +%D a couple of more language related settings need to take +%D place (like uc mappings). + +\endinput diff --git a/tex/context/base/supp-pat.tex b/tex/context/base/supp-pat.tex deleted file mode 100644 index d91083076..000000000 --- a/tex/context/base/supp-pat.tex +++ /dev/null @@ -1,179 +0,0 @@ -%D \module -%D [ file=supp-pat, -%D version=2005.02.12, -%D title=\CONTEXT\ Support Macros, -%D subtitle=Patterns, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 support: -%D -%D \starttyping -%D \patterns { -%D ...[namedglyphs]... -%D } -%D \stoptyping -%D -%D as well as: -%D -%D \starttyping -%D -%D ...&namedglyphs;... -%D -%D \stoptyping -%D -%D The \XML\ variant has very limited \XML\ parsing capabilities and -%D is meant as an experiment. - -\ifx\writestatus\undefined \else - - \writestatus{loading}{ConTeXt Support Macros / Patterns} - -\fi - -%D \CONTEXT: - -\ifx\startmapping\undefined \else \ifx\startencoding\undefined \else - - \def\fetchpatterntoken#1{\csname#1\endcsname} - -\fi \fi - -%D First we define the \ETEX\ variant. We cannot do that inside -%D the if statement because normal \TEX\ gets confused over the -%D csname test (which it does not see as if but it does see the -%D else's and fi's). - -\def\etexfetchpatterntoken#1% - {\csname - \ifcsname @pattok@#1\endcsname - @pattok@#1% - \else\ifcsname#1\endcsname - #1% - \else - @pattok@default% - \fi\fi - \endcsname} - -\ifx \fetchpatterntoken \undefined - - \ifx \eTeXversion \undefined - - \def\fetchpatterntoken#1% - {\csname - \expandafter\ifx\csname @pattok@#1\endcsname\relax - \expandafter\ifx\csname#1\endcsname\relax - @pattok@default% - \else - #1% - \fi - \else - @pattok@#1% - \fi - \endcsname} - - \else - - \let\fetchpatterntoken\etexfetchpatterntoken - - \fi - -\fi - -\def\definepatterntoken #1 #2 % - {\expandafter\def\csname @pattok@#1\endcsname{#2}} - -%D \TEX\ based: - -\bgroup \catcode`\[=\active - - \gdef\enablepatterntokens - {\catcode`\[=\active \let[\handlepatterntoken} - -\egroup - -\def\handlepatterntoken#1]% - {\fetchpatterntoken{#1}} - -%D \XML\ based: - -\bgroup \catcode`\<=\active \catcode`\&=\active - - \gdef\enablepatternxml - {\catcode`\<=\active - \catcode`\&=\active - \let&\handlepatternentity - \let<\handlepatternxml} - -\egroup - -\def\handlepatternentity#1;% - {\fetchpatterntoken{#1}} - -%D We use a very simple \XML\ parser, and we only trigger on the first -%D two characters of the tag name. Consider this feature a playground -%D (and a bit of a joke). - -\def\handlepatternxml#1#2% we only distinguish the first two chars - {\csname @patxml@\ifcsname @patxml@#1#2\endcsname#1#2\else de\fi\endcsname} - -\def\definepatternxml #1#2#3 #4% - {\expandafter\def\csname @patxml@#1#2\endcsname{#4}} - -\def\fetchpatternxml#1#2>% - {\bgroup - \long\def\next##1>{\egroup}% - \catcode`\<=2 % \@@endgroup - \afterassignment\next - #1\bgroup} - -\def\gobblepatternxml - {\bgroup - \catcode`\%=11 - \dogobblepatternxml} - -\long\def\dogobblepatternxml#1>% - {\egroup} - -%D Here are the default definitions. We don't catch empty elements. - -\definepatternxml patterns {\fetchpatternxml\patterns} -\definepatternxml hyphenations {\fetchpatternxml\hyphenation} -\definepatternxml pattern {\fetchpatternxml\patterns} -\definepatternxml hyphenation {\fetchpatternxml\hyphenation} -\definepatternxml default {\gobblepatternxml} - -\definepatterntoken default x - -\ifx\pattern \undefined \let\pattern \patterns \fi -\ifx\hyphenations\undefined \let\hyphenations\hyphenation \fi - -%D An example of usage in another format than \CONTEXT: -%D -%D \starttyping -%D \bgroup -%D -%D \lccode"E4="E4 \definepatterntoken adiaeresis ^^e4 -%D \lccode"F6="F6 \definepatterntoken odiaeresis ^^f6 -%D \lccode"FC="FC \definepatterntoken ediaeresis ^^fc -%D \lccode"FF="FF \definepatterntoken ssharp ^^ff -%D -%D \enablepatterntokens -%D \enablepatternxml -%D -%D \input lang-de.pat -%D \input lang-de.hyp -%D -%D \egroup -%D \stoptyping -%D -%D This is a minimal example for EC encoding, and of course -%D a couple of more language related settings need to take -%D place (like uc mappings). - -\endinput diff --git a/tex/context/base/supp-pdf.mkii b/tex/context/base/supp-pdf.mkii new file mode 100644 index 000000000..c54b0c6bc --- /dev/null +++ b/tex/context/base/supp-pdf.mkii @@ -0,0 +1,2187 @@ +%D \module +%D [ file=supp-pdf, +%D version=2006.09.02, % 2004.12.16, +%D title=\CONTEXT\ Support Macros, +%D subtitle=\METAPOST\ to \PDF\ conversion, +%D author=Hans Hagen \& others (see text), +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\ifx\writestatus\undefined + \immediate\write16{[Loading MPS to PDF converter (version 2006.09.02).]} +\else + \writestatus{loading}{ConTeXt Support Macros / PDF} +\fi + +%D This module is not optimized because it is used outside +%D \CONTEXT\ and we cannot forsee what interference will take +%D place. We no longer load supp-mis. I got too tired of +%D keeping track of interferences with non \CONTEXT\ usage so +%D I moved the necessary code in here and use a derived version +%D in \CONTEXT. When I have the time I will clean up some of the +%D code that is of no use for non||\CONTEXT\ users. + +\ifx\contextversion\undefined + + \chardef\mptopdfstoredatcode\catcode`\@ + + \catcode\string`@=11 + + \def\unprotect + {\let\@@mpstopdf@@unprotect \unprotect + \let\@@mpstopdf@@protect \protect + \edef\protect + {\noexpand \let \noexpand \protect \noexpand \@@mpstopdf@@protect + \noexpand \let \noexpand \unprotect \noexpand \@@mpstopdf@@unprotect + % context specific + \catcode\string`\noexpand @=\the\catcode\string`@ + \catcode\string`\noexpand !=\the\catcode\string`! + \catcode\string`\noexpand ?=\the\catcode\string`? + % latex specific + \catcode\string`\noexpand /=\the\catcode\string`/ + \catcode\string`\noexpand -=\the\catcode\string`- + \catcode\string`\noexpand :=\the\catcode\string`: + \catcode\string`\noexpand ;=\the\catcode\string`; + \catcode\string`\noexpand "=\the\catcode\string`" + \catcode\string`\noexpand <=\the\catcode\string`< + \catcode\string`\noexpand >=\the\catcode\string`> + \catcode\string`\noexpand `=\the\catcode\string``} + \catcode\string`@=11 \catcode\string`!=11 \catcode\string`?=11 + \catcode\string`/=12 \catcode\string`-=12 + \catcode\string`:=12 \catcode\string`;=12 + \catcode\string`>=12 \catcode\string`<=12 + \catcode\string`"=12 \catcode\string``=12 } + + \def\defineMPtoPDFfallbacks + {% shortcuts + \chardef\@@escape 0 + \chardef\@@begingroup 1 + \chardef\@@endgroup 2 + \chardef\@@endofline 5 + \chardef\@@ignore 9 + \chardef\@@space 10 + \chardef\@@letter 11 + \chardef\@@other 12 + \chardef\@@active 13 + \chardef\@@comment 14 + % placeholders + \ifx\withoutpt \undefined \let\withoutpt \@@mptopdf@@withoutpt \fi + \ifx\twodigitrounding \undefined \let\twodigitrounding \@@mptopdf@@twodigitrounding \fi + \ifx\forgetall \undefined \let\forgetall \@@mptopdf@@forgetall \fi + \ifx\uncatcodespecials \undefined \let\uncatcodespecials \@@mptopdf@@uncatcodespecials \fi + \ifx\setnaturalcatcodes\undefined \let\setnaturalcatcodes\@@mptopdf@@setnaturalcatcodes \fi + \ifx\dospecials \undefined \let\dospecials \@@mptopdf@@dospecials \fi} + + \def\@@mptopdf@@forgetall + {\parskip0pt\leftskip0pt\parindent0pt\everypar{}} + + \def\@@mptopdf@@twodigitrounding#1% + {#1}% + + \def\@@mptopdf@@uncatcodespecials + {\def\do##1{\catcode`##1=\@@other}\dospecials + \catcode`\ =\@@space + \catcode`\^^L=\@@ignore + \catcode`\^^M=\@@endofline + \catcode`\^^?=\@@ignore} + + \def\@@mptopdf@@setnaturalcatcodes + {\catcode`\!=\@@other \catcode`\?=\@@other \catcode`\@=\@@other + \catcode`\#=\@@other \catcode`\&=\@@other \catcode`\|=\@@other + \catcode`\$=\@@other \catcode`\^=\@@other \catcode`\_=\@@other + \catcode`\*=\@@other \catcode`\/=\@@other + \catcode`\-=\@@other \catcode`+=\@@other + \catcode`\==\@@other \catcode`\<=\@@other \catcode`\>=\@@other + \catcode`\"=\@@other \catcode`\'=\@@other \catcode`\`=\@@other + \catcode`\:=\@@other \catcode`\;=\@@other + \catcode`\,=\@@other \catcode`\.=\@@other \catcode`\~=\@@other + \catcode`\(=\@@other \catcode`\)=\@@other + \catcode`\{=\@@other \catcode`\}=\@@other + \catcode`\\=\@@other \catcode`\%=\@@other} + + \def\@@mptopdf@@dospecials + {\do\ \do\\\do\{\do\}\do\$% + \do\#\do\^\do\_\do\&\do\%% + \do\~\do\^^A\do\^^K} + + { + \catcode`\.=12 + \catcode`\p=12 + \catcode`\t=12 + \gdef\@@MPTOPDF@@WITHOUTPT#1pt{#1} + } + + \def\@@mptopdf@@withoutpt#1% + {\expandafter\@@MPTOPDF@@WITHOUTPT#1} + +% \def\@@mptopdf@@newabove#1#2% \dimen \name +% {#1#2% +% \ifnum\expandafter\gobblesixarguments\meaning#2>20\else +% \expandafter\@@mptopdf@@newabove\expandafter#1\expandafter#2% +% \fi} + + \def\@@mptopdf@@stripnewabove#1% + {\ifnum10<9#1 #1\else\expandafter\@@mptopdf@@stripnewabove\fi}% + + \def\@@mptopdf@@newabove\csname#1\endcsname#2% \dimen \name + {\csname#1\endcsname#2% + \ifnum\expandafter\@@mptopdf@@stripnewabove\meaning#2>20\else + \@@mptopdf@@newabove\csname#1\endcsname#2% + \fi} + + \@@mptopdf@@newabove \csname newcount\endcsname \scratchcounter + \@@mptopdf@@newabove \csname newdimen\endcsname \scratchdimen + \csname newbox\endcsname \scratchbox + + \expandafter \newif \csname ifdone\endcsname + + \catcode`\@=\mptopdfstoredatcode + +\else + + \let\defineMPtoPDFfallbacks\relax + +\fi + +%D These macros are written as generic as possible. Some +%D general support macro's are loaded from a small module +%D especially made for non \CONTEXT\ use. In this module I +%D use a matrix transformation macro written by Tanmoy +%D Bhattacharya. Thanks to extensive testing by Sebastian +%D Ratz I was able to complete this module within reasonable +%D time. This module has support for \METAPOST\ extensions +%D built in. +%D +%D Daniel H. Luecking came up with a better (more precise) +%D transformation method. You can recognize his comment by +%D his initials. (We keep the old code around because it's a +%D nice illustration on how a module like this evolves.) + +%D Beware, we cannot use \type{\zeropoint} here since it may be +%D defined in the range \type{\dimen0} - 20 which we happen to use +%D as scratch registers; inside context we may consider +%D using dedicated registers. + +%D This module handles some \PDF\ conversion and insertions +%D topics. By default, the macros use the \PDFTEX\ primitive +%D \type{\pdfliteral} when available. Since \PDFTEX\ is now the +%D default engine for \TEX\ distributions, we need a more complex +%D test. + +\unprotect + +\ifx\PDFcode\undefined + \ifx\pdfliteral\undefined + \def\PDFcode#1{\special{PDF: #1}} + \else\ifx\pdfoutput\undefined + \def\PDFcode#1{\special{PDF: #1}} + \else\ifcase\pdfoutput + \def\PDFcode#1{\special{PDF: #1}} + \else % pdftex as well as in pdf mode + \let\PDFcode\pdfliteral + \fi\fi\fi +\else + % we probably use context +\fi + +%D First we define a handy constant: + +\bgroup \defineMPtoPDFfallbacks \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup + +%D \macros +%D {pdfimage,pdfimages,pdfclippedimage} +%D +%D Starting with pdftex version 14, images are included more +%D natural to the form embedding. This enables alternative +%D images to be embedded. +%D +%D \starttyping +%D \pdfimage {file} +%D \pdfimages {high res file} {low res file} +%D \stoptyping +%D +%D The first one replaces the pre||version||14 original, +%D while the latter provides alternative images. +%D +%D The next macro is dedicated to Maarten Gelderman, who +%D needed to paste prepared \PDF\ pages into conference +%D proceedings. +%D +%D \starttyping +%D \pdfclippedimage {file} {l} {r} {t} {b} +%D \stoptyping + +\ifx\pdftexversion\undefined \else \ifnum\pdftexversion>13 + + \def\pdfimage#1#% + {\dopdfimage{#1}} + + \def\dopdfimage#1#2% + {\immediate\pdfximage#1{#2}% + \pdfrefximage\pdflastximage} + + \def\pdfimages#1#% + {\dopdfimages{#1}} + + \def\dopdfimages#1#2#3% + {\immediate\pdfximage#1{#2}% + \immediate\pdfobj{[ << /Image \the\pdflastximage\space0 R /DefaultForPrinting true >> ]}% + \immediate\pdfximage#1 attr {/Alternates \the\pdflastobj\space0 R}{#3}% + \pdfrefximage\pdflastximage} + + \def\pdfclippedimage#1#% specs {file}{left}{right}{top}{bottom} + {\dopdfclippedimage{#1}} + + \def\dopdfclippedimage#1#2#3#4#5#6% + {\bgroup + \pdfximage#1{#2}% + \setbox\scratchbox\hbox + {\pdfrefximage\pdflastximage}% + \hsize\wd\scratchbox + \advance\hsize -#3 + \advance\hsize -#4 + \vsize\ht\scratchbox + \advance\vsize -#5 + \advance\vsize -#6 + \setbox\scratchbox\vbox to \vsize + {\vskip-#5\hbox to \hsize{\hskip-#3\box\scratchbox\hss}}% + \pdfxform\scratchbox + \pdfrefxform\pdflastxform + \egroup} + +\fi \fi + +%D If you want to save a few hash entries, you may prefer the +%D less readable alternatives, like: +%D +%D \starttyping +%D \def\pdfimage#1#% This one is less readable but needs no additional +%D {\bgroup % hash entry for the second stage macro. +%D \def\pdfimage##1% +%D {\immediate\pdfximage##1{#2}% +%D \pdfrefximage\pdflastximage\egroup}} +%D \stoptyping + +%D For old times sake we provide a few aliases. These will be +%D removed some day. + +\ifx\pdftexversion\undefined \else \ifnum\pdftexversion>13 + + \let\pdfform =\pdfxform + \let\pdflastform=\pdflastxform + \let\pdfrefform =\pdfrefxform + +\fi \fi + +%D The main conversion macro wraps the \PDF\ codes in a box +%D that is output as an object. The graphics are embedded +%D in~\type{q} and~\type{Q} and are scaled and positioned using +%D one transform call (\type{cm}). This saves some additional +%D scaling. + +%D \macros +%D {convertMPtoPDF} +%D +%D The next set of macros implements \METAPOST\ to \PDF\ +%D conversion. Because we want to test as fast as possible, we +%D first define the \POSTSCRIPT\ operators that \METAPOST\ +%D uses. We don't define irrelevant ones, because these are +%D skipped anyway. + +%D The converter can be made a bit faster by replacing the +%D two test macros (the ones with the many \type {\if's}) by +%D a call to named branch macros (something \typ {\getvalue +%D {xPSmoveto}}. For everyday documents with relatively +%D small graphics the gain in speed can be neglected. + +\def \PScurveto {curveto} +\def \PSlineto {lineto} +\def \PSmoveto {moveto} +\def \PSshowpage {showpage} +\def \PSnewpath {newpath} +\def \PSfshow {fshow} +\def \PSclosepath {closepath} +\def \PSfill {fill} +\def \PSstroke {stroke} +\def \PSclip {clip} +\def \PSrlineto {rlineto} +\def \PSsetlinejoin {setlinejoin} +\def \PSsetlinecap {setlinecap} +\def \PSsetmiterlimit {setmiterlimit} +\def \PSsetgray {setgray} +\def \PSsetrgbcolor {setrgbcolor} +\def \PSsetcmykcolor {setcmykcolor} +\def \PSsetdash {setdash} +\def \PSgsave {gsave} +\def \PSgrestore {grestore} +\def \PStranslate {translate} +\def \PSscale {scale} +\def \PSconcat {concat} +\def \PSdtransform {dtransform} +\def \PSsetlinewidth {setlinewidth} +\def \PSpop {pop} + +\def \PSnfont {nfont} % was needed for TUG98 proceedings +\def \PSspecial {special} % extensions to MetaPost + +%D A previous version set \type {%} to ignore, which +%D simplified the following definitions. At the start of +%D conversion the percent character was made active again. +%D Because the whole graphic is one paragraph (there are no +%D empty lines) this does not give the desired effect. This +%D went unnoticed untill Scott Pakin sent me a test file +%D percent characters in a string. So, from now on we have +%D to prefix the following strings with percentages. + +%D Some day I'll figure out a better solution (line by line reading +%D using \ETEX). + +\edef \PSBoundingBox {\letterpercent\letterpercent BoundingBox:} +\edef \PSHiResBoundingBox {\letterpercent\letterpercent HiResBoundingBox:} +\edef \PSExactBoundingBox {\letterpercent\letterpercent ExactBoundingBox:} +\edef \PSMetaPostSpecial {\letterpercent\letterpercent MetaPostSpecial:} +\edef \PSMetaPostSpecials {\letterpercent\letterpercent MetaPostSpecials:} +\edef \PSPage {\letterpercent\letterpercent Page:} +\edef \PSBeginProlog {\letterpercent\letterpercent BeginProlog} +\edef \PSEndProlog {\letterpercent\letterpercent EndProlog} +\edef \PSEof {\letterpercent\letterpercent EOF} + +%D By the way, the \type {setcmykcolor} operator is not +%D output by \METAPOST\ but can result from converting the +%D \cap{RGB} color specifications, as implemented in +%D \type{supp-mps}. + +%D In \POSTSCRIPT\ arguments precede the operators. Due to the +%D fact that in some translations we need access to those +%D arguments, and also because sometimes we have to skip them, +%D we stack them up. The stack is one||dimensional for non path +%D operators and two||dimensional for operators inside a path. +%D This is because we have to save the whole path for +%D (optional) postprocessing. Values are pushed onto the stack +%D by: +%D +%D \starttyping +%D \setMPargument {value} +%D \stoptyping +%D +%D They can be retrieved by the short named macros: +%D +%D \starttyping +%D \gMPa {number} +%D \gMPs {number} +%D \stoptyping +%D +%D When scanning a path specification, we also save the +%D operator, using +%D +%D \starttyping +%D \setMPkeyword {n} +%D \stoptyping +%D +%D The path drawing operators are coded for speed: \type{clip}, +%D \type{stroke}, \type{fill} and \type{fillstroke} become +%D 1, 2, 3 and~4. +%D +%D When processing the path this code can be retrieved +%D using +%D +%D \starttyping +%D \getMPkeyword % {n} +%D \stoptyping +%D +%D When setting an argument, the exact position on the stack +%D depends on the current value of the \COUNTERS\ +%D \type{\nofMPsegments} and \type{\nofMParguments}. + +\newcount\nofMPsegments +\newcount\nofMParguments + +%D These variables hold the coordinates. The argument part of +%D the stack is reset by: +%D +%D \starttyping +%D \resetMPstack +%D \stoptyping +%D +%D We use the prefix \type{@@MP} to keep the stack from +%D conflicting with existing macros. To speed up things a bit +%D more, we use the constant \type{\@@MP}. + +\def\@@MP{@@MP} + +\def\setMPargument% #1% + {\advance\nofMParguments 1 + \expandafter\def + \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname} % {#1} + +\def\letMPargument + {\advance\nofMParguments 1 + \expandafter\let + \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname} + +\def\setMPsequence#1 % + {\advance\nofMParguments 1 + \expandafter\def + \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname{#1}% + \handleMPsequence} + +\def\gMPa#1% + {\csname\@@MP0\number#1\endcsname} + +\def\gMPs#1% + {\csname\@@MP\the\nofMPsegments\number#1\endcsname} + +\def\dogMPa#1% + {\expandafter\expandafter\expandafter\do\csname\@@MP0\number#1\endcsname} + +\def\setMPkeyword#1 % + {\expandafter\def\csname\@@MP\the\nofMPsegments0\endcsname{#1}% + \advance\nofMPsegments 1 + \nofMParguments0} + +\def\getMPkeyword% #1% + {\csname\@@MP\the\nofMPsegments0\endcsname} % {\csname\@@MP#10\endcsname} + +\def\docleanupMPargument#1% we need this because args can have [ or ] pre/appended + {\expandafter\edef\csname\@@MP\the\nofMPsegments\number#1\endcsname + {\csname\@@MP\the\nofMPsegments\number#1\endcsname}} + +%D When we reset the stack, we can assume that all further +%D comment is to be ignored and handled in strings. +%D By redefining the reset macro after the first call, we +%D save some run time. Only use this macro after all +%D comments are processed and use the simple alternative +%D when dealing with comments. + +\def\doresetMPstack + {\nofMParguments0\relax} + +\def\resetMPstack + {\let\handleMPgraphic\handleMPendgraphic + \let\resetMPstack\doresetMPstack + \resetMPstack} + +%D The arguments are saved with the preceding command +%D \type{\do}. By default this command expands to nothing, but +%D when we deal with strings it's used to strip off the +%D \type{(} and \type{)}. +%D +%D Strings are kind of tricky, because characters can be +%D passed verbatim \type{(hello)}, by octal number +%D \type{(\005)} or as command \type{(\()}. We therefore +%D cannot simply ignore \type{(} and \type{)}, the way we do +%D with \type{[} and \type{]}. Another complication is that +%D strings may contain characters that normally have a +%D special meaning in \TEX, like \type{$} and \type{{}}. +%D +%D A previous solution made \type{\} an active character and +%D let it look ahead for a number or characters. We had to +%D abandon this scheme because of the need for verbatim +%D support. The next solution involved some \CATCODE\ +%D trickery but works well. + +\def\octalMPcharacter#1#2#3% + {\char'#1#2#3\relax} + +%D curly braces and squarly brackets are stored in the argument stack +%D as part of strings, for instance in: +%D +%D \starttyping +%D /fshow {exch findfont exch scalefont setfont show}bind def +%D [3 3 ] 0 setdash +%D \stoptyping +%D +%D but we need to keep them in situation like +%D +%D \starttyping +%D ([bla bla] bla bla) ec-lmr10 9.96265 fshow +%D ({bla bla} bla bla) ec-lmr10 9.96265 fshow +%D \stoptyping +%D +%D So, when we store the snippets, we keep the special tokens, and +%D when needed we either ignore or obey them + +\bgroup +\defineMPtoPDFfallbacks +\catcode`\|=\@@comment +\catcode`\%=\@@active +\catcode`\[=\@@active +\catcode`\]=\@@active +\catcode`\{=\@@active +\catcode`\}=\@@active +\catcode`B=\@@begingroup +\catcode`E=\@@endgroup +\gdef\keepMPspecials| + B\let%\letterpercent| + \def[B\noexpand[E| + \def]B\noexpand]E| + \def{B\noexpand{E| + \def}B\noexpand}EE +\gdef\ignoreMPspecials| + B\let%\letterpercent| + \def[BE| + \def]BE| + \def{BE| + \def}BEE +\gdef\obeyMPspecials| + B\def%B\char 37\relax E| + \def[B\char 91\relax E| + \def]B\char 93\relax E| + \def{B\char123\relax E| + \def}B\char125\relax EE +\gdef\setMPspecials| + B\setnaturalcatcodes + \catcode`\\=\@@escape + \catcode`\%=\@@active + \catcode`\[=\@@active + \catcode`\]=\@@active + \catcode`\{=\@@active + \catcode`\}=\@@active + \lccode`\-=0 | latex sets this to `\- + \lccode`\%=`\% | otherwise it's seen as a number + \def\(B\char40\relax E| + \def\)B\char41\relax E| + \def\\B\char92\relax E| + \def\0B\octalMPcharacter0E| + \def\1B\octalMPcharacter1E| + \def\2B\octalMPcharacter2E| + \def\3B\octalMPcharacter3E| + \def\4B\octalMPcharacter4E| + \def\5B\octalMPcharacter5E| + \def\6B\octalMPcharacter6E| + \def\7B\octalMPcharacter7E| + \def\8B\octalMPcharacter8E| + \def\9B\octalMPcharacter9EE +\egroup + +%D We use the comment symbol as a sort of trigger. Beware! +%D The whole graphic is seen as on eparagraph, which means +%D that we cannot change the catcodes in between. + +\bgroup +\defineMPtoPDFfallbacks +\catcode`\%=\@@active +\gdef\startMPscanning{\let%=\startMPconversion} +\egroup + +%D In earlier versions we used the sequence +%D +%D \starttyping +%D \expandafter\handleMPsequence\input filename\relax +%D \stoptyping +%D +%D Persistent problems in \LATEX\ however forced us to use a +%D different scheme. Every \POSTSCRIPT\ file starts with a +%D \type{%}, so we temporary make this an active character +%D that starts the scanning and redefines itself. (The problem +%D originates in the redefinition by \LATEX\ of the +%D \type{\input} primitive.) + +\def\startMPconversion + {\keepMPspecials + \handleMPsequence} + +%D Here comes the main loop. Most arguments are numbers. This +%D means that they can be recognized by their \type{\lccode}. +%D This method saves a lot of processing time. We could +%D speed up the conversion by handling the \type{path} +%D seperately. + +\def\dohandleMPsequence#1% + {\ifdone + \ifcase\lccode`#1\relax + \expandafter\expandafter\expandafter\dohandleMPsequenceA + \else + \expandafter\expandafter\expandafter\dohandleMPsequenceB + \fi + \else + \expandafter\dohandleMPsequenceC + \fi#1} + +\let\dohandleMPsequenceA\setMPsequence + +\def\installMPSkeywordN#1#2% + {\expandafter\def\csname\@@MP:N:#1\endcsname{#2}} + +\def\installMPSshortcutN#1#2% todo: \let + {\expandafter\let\csname\@@MP:N:#1\expandafter\endcsname\csname\@@MP:N:#2\endcsname} + +\def\dohandleMPsequenceB#1 % + {\edef\somestring{#1}% + \ifcsname\@@MP:N:\somestring\endcsname + \csname\@@MP:N:\somestring\expandafter\endcsname + \else + \expandafter\handleMPgraphic + \fi + \handleMPsequence} + +\ifx\eTeXversion\undefined + \def\dohandleMPsequenceB#1 % + {\edef\somestring{#1}% + \expandafter\ifx\csname\@@MP:N:\somestring\endcsname\relax + \expandafter\handleMPgraphic + \else + \csname\@@MP:N:\somestring\expandafter\endcsname + \fi + \handleMPsequence} +\fi + +\installMPSkeywordN \PSmoveto + {\edef\lastMPmoveX{\gMPa1}% + \edef\lastMPmoveY{\gMPa2}% + \resetMPstack} +\installMPSkeywordN \PSnewpath + {\let\handleMPsequence\handleMPpath} +\installMPSkeywordN \PSgsave + {\PDFcode{q}% + \resetMPstack} +\installMPSkeywordN \PSgrestore + {\PDFcode{Q}% + \resetMPstack} +\installMPSkeywordN \PSdtransform % == setlinewidth + {\let\handleMPsequence\handleMPdtransform} + % after that we will encounter more tokens until setlinewidth+pop + % or pop+setlinewidth which we catch next; we explicitly need to + % reset the stack since [] n setdash may follow; a more clever + % approach would be to read on till the condition is met, but it's + % the only pop / setlinewidth we will encounter so ... +\installMPSkeywordN \PSsetlinewidth + {% already handled in dtransform + \resetMPstack} +\installMPSkeywordN \PSpop + {% already handled in dtransform + \resetMPstack} +\installMPSkeywordN \PSconcat + {\cleanupMPconcat + \PDFcode{\gMPa1 \gMPa2 \gMPa3 \gMPa4 \gMPa5 \gMPa6 cm}% + \resetMPstack} +\installMPSkeywordN \PSsetrgbcolor + {\handleMPrgbcolor + \resetMPstack} +\installMPSkeywordN \PSsetcmykcolor + {\handleMPcmykcolor + \resetMPstack} +\installMPSkeywordN \PSsetgray + {\handleMPgraycolor + \resetMPstack} +\installMPSkeywordN \PStranslate + {\PDFcode{1 0 0 1 \gMPa1 \gMPa2 cm}% + \resetMPstack} +\installMPSkeywordN \PSsetdash + {\handleMPsetdash + \resetMPstack} +\installMPSkeywordN \PSsetlinejoin + {\PDFcode{\gMPa1 j}% + \resetMPstack} +\installMPSkeywordN \PSsetmiterlimit + {\PDFcode{\gMPa1 M}% + \resetMPstack} +\installMPSkeywordN \PSfshow + {%\PDFcode{n}% removed ! + \handleMPfshow + \resetMPstack} +\installMPSkeywordN \PSsetlinecap + {\PDFcode{\gMPa1 J}% + \resetMPstack} +\installMPSkeywordN \PSrlineto + {\flushMPmoveto + \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}% + \resetMPmoveto + \resetMPstack} +\installMPSkeywordN \PSscale + {\PDFcode{\gMPa1 0 0 \gMPa2 0 0 cm}% + \resetMPstack} +\installMPSkeywordN \PSspecial + {\handleMPspecialcommand + \resetMPstack} + +\installMPSshortcutN {n} \PSnewpath +\installMPSshortcutN {p} \PSclosepath +\installMPSshortcutN {l} \PSlineto +\installMPSshortcutN {r} \PSrlineto +\installMPSshortcutN {m} \PSmoveto +\installMPSshortcutN {c} \PScurveto +\installMPSshortcutN {C} \PSsetcmykcolor +\installMPSshortcutN {G} \PSsetgray +\installMPSshortcutN {R} \PSsetrgbcolor +\installMPSshortcutN {lj} \PSsetlinejoin +\installMPSshortcutN {ml} \PSsetmiterlimit +\installMPSshortcutN {lc} \PSsetlinecap +\installMPSshortcutN {sd} \PSsetdash +\installMPSshortcutN {S} \PSstroke +\installMPSshortcutN {F} \PSfill +\installMPSshortcutN {W} \PSclip + +\installMPSshortcutN {q} \PSgsave +\installMPSshortcutN {Q} \PSgrestore + +\installMPSshortcutN {s} \PSscale +\installMPSshortcutN {t} \PSconcat +\installMPSshortcutN {P} \PSshowpage + +\installMPSkeywordN {hlw} {\PDFcode{\gMPa1 w}\resetMPstack} +\installMPSkeywordN {vlw} {\PDFcode{\gMPa1 w}\resetMPstack} +\installMPSkeywordN {rd} {\PDFcode{[] 0 d}\resetMPstack} + +\def\dohandleMPsequenceC#1 % + {\edef\somestring{#1}% + \handleMPgraphic % {#1}% + \handleMPsequence} + +%D Since colors are not sensitive to transformations, they +%D are sometimes used for signaling. Therefore, we handle them +%D separately. The next macro can be redefined if needed. + +\def\handleMPrgbcolor + {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 rg + \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 RG}} + +\def\handleMPcmykcolor + {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 k + \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 K}} + +\def\handleMPgraycolor + {\PDFcode{\!MPgMPa1 g + \!MPgMPa1 G}} + +\def\handleMPspotcolor + {\PDFcode{0 g + 0 G}} + +%D Beginning and ending the graphics is taken care of by the +%D macro \type{\handleMPgraphic}, which is redefined when +%D the first graphics operator is met. + +\def\handleMPendgraphic % #1% + {\ifx\somestring\PSshowpage + \let\handleMPsequence\finishMPgraphic + \else\ifx\somestring\PSEof + \let\handleMPsequence\finishMPgraphic + \else + \letMPargument\somestring % {#1}% + \fi\fi} + +\def\handleMPbegingraphic % #1% + {\ifx\somestring\PSBoundingBox + \def\handleMPsequence{\handleMPboundingbox1}% + \else\ifx\somestring\PSHiResBoundingBox + \def\handleMPsequence{\handleMPboundingbox2}% + \else\ifx\somestring\PSExactBoundingBox + \def\handleMPsequence{\handleMPboundingbox3}% + \else\ifx\somestring\PSshowpage + \let\handleMPsequence\finishMPgraphic + \else\ifx\somestring\PSEof + \let\handleMPsequence\finishMPgraphic + \else\ifx\somestring\PSPage + \let\handleMPsequence\handleMPpage + \else\ifx\somestring\PSMetaPostSpecials + \let\handleMPsequence\handleMPspecialscomment + \else\ifx\somestring\PSMetaPostSpecial + \let\handleMPsequence\handleMPspecialcomment + \else\ifx\somestring\PSBeginProlog + \let\handleMPsequence\handleMPprolog + \else + \letMPargument\somestring % {#1}% + \fi\fi\fi\fi\fi\fi\fi\fi\fi} + +\let\handleMPgraphic=\handleMPbegingraphic + +%D New: we can best filter the prolog because nowdays it can contain +%D quite some code. + +% hm, catcode mess, so we need to tweak %'s catcode here +% \long\expandafter\def\expandafter\handleMPprolog\expandafter#\expandafter1\PSEndProlog% +% but today i'm not in the mood for ugly stuff + +\long\def\handleMPprolog#1EndProlog % + {\doresetMPstack + \let\handleMPsequence\dohandleMPsequence + \handleMPsequence} + +%D We check for three kind of bounding boxes: the normal one +%D and two high precision ones: +%D +%D \starttyping +%D BoundingBox: llx lly ucx ucy +%D HiResBoundingBox: llx lly ucx ucy +%D ExactBoundingBox: llx lly ucx ucy +%D \stoptyping +%D +%D The original as well as the recalculated dimensions are +%D saved for later use. + +\newif\ifskipemptyMPgraphic \skipemptyMPgraphicfalse + +\chardef\currentMPboundingbox=0 + +\def\handleMPboundingbox#1#2 #3 #4 #5 + {\ifnum#1>\currentMPboundingbox + \xdef\MPllx{#2}\xdef\MPlly{#3}% + \xdef\MPurx{#4}\xdef\MPury{#5}% + \dimen0=#2pt + \dimen0=-\MPxscale\dimen0 + \dimen2=#3pt + \dimen2=-\MPyscale\dimen2 + \xdef\MPxoffset{\withoutpt\the\dimen0}% + \xdef\MPyoffset{\withoutpt\the\dimen2}% + \dimen0=#2bp + \dimen0=-\dimen0 + \dimen2=#3bp + \dimen2=-\dimen2 + \advance\dimen0 #4bp + \dimen0=\MPxscale\dimen0 + \xdef\MPwidth{\the\dimen0}% + \advance\dimen2 #5bp + \xdef\MPyshift{\the\dimen2}% unscaled + \dimen2=\MPyscale\dimen2 + \xdef\MPheight{\the\dimen2}% + \chardef\currentMPboundingbox#1\relax + \fi + \doresetMPstack + \let\handleMPsequence\dohandleMPsequence + \let\next\handleMPsequence + \ifskipemptyMPgraphic + \ifdim\MPheight=0pt\relax\ifdim\MPwidth=0pt\relax + \def\next{\endinput\finishMPgraphic}% + \fi\fi + \fi + \next} + +%D Unless defined otherwise, we simply ignore specialcomments. + +\def\handleMPspecialcomment + {\doresetMPstack + \let\handleMPsequence\dohandleMPsequence + \handleMPsequence} + +\let\handleMPspecialscomment\handleMPspecialcomment + +%D We use the \type{page} comment as a signal that +%D stackbuilding can be started. + +\def\handleMPpage #1 #2 + {\doresetMPstack + \donetrue + \let\handleMPsequence\dohandleMPsequence + \handleMPsequence} + +%D The same applies to the special extensions. + +\def\handleMPspecialcommand + {\doresetMPstack + \let\handleMPsequence\dohandleMPsequence + \handleMPsequence} + +%D \METAPOST\ draws its dots by moving to a location and +%D invoking \type{0 0 rlineto}. This operator is not +%D available in \PDF. Our solution is straightforward: we draw +%D a line from $(current\_x, current\_y)$ to itself. This +%D means that the arguments of the preceding \type{moveto} have +%D to be saved. + +\def\lastMPmoveX{0} +\def\lastMPmoveY{0} + +%D These saved coordinates are also used when we handle the +%D texts. Text handling proved to be a bit of a nuisance, but +%D finally I saw the light. It proved that we also had to +%D take care of \type{(split arguments)}. + +% \def\setMPfshowfont#1#2% +% {\font\temp=#1\space at #2\relax\temp} + +% \startMPcode +% draw btex Ga toch effe f\kern0ptietsen?{}` etex ; +% \stopMPcode + +\newtoks \everyMPshowfont + +\def\setMPfshowfont#1#2% + {\font\temp=#1\space at #2\relax\temp + \the\everyMPshowfont} + +\let\MPfshowcommand\empty + +%D The next hackery handles characters one by one. We only support this +%D for the latest greatest \METAPOST\ binaries, the ones that escape +%D problematic chars. + +\def\doflushMPtext#1% + {\edef\!!stringa{#1}% + \expandafter\dodoflushMPtext\!!stringa\relax} + +\def\dodoflushMPtext + {\afterassignment\dododoflushMPtext\let\nexttoken=} + +\def\dododoflushMPtext + {\ifx\nexttoken\relax + % done + \else\ifx\nexttoken\char + \expandafter\expandafter\expandafter\dodododoflushMPtext + \else + {\nexttoken}% + \expandafter\expandafter\expandafter\dodoflushMPtext + \fi\fi} + +\def\dodododoflushMPtext + {\afterassignment\dododododoflushMPtext\scratchcounter} + +\def\dododododoflushMPtext + {{\char\scratchcounter}\let\next\dodoflushMPtext} + +\def\dohandleMPfshow + {\bgroup + \setbox\scratchbox\hbox + {\obeyMPspecials + \let\ \relax % mp breaks long lines and appends a \ + \edef\size{\gMPa\nofMParguments}% + \ifx\size\PSnfont % round font size (to pt) + \advance\nofMParguments -1 + \expandafter\scratchdimen\gMPa\nofMParguments pt\relax + \ifdim\scratchdimen<1pt + \def\size{1pt}% + \else + \advance\scratchdimen .5pt + \def\size##1.##2\relax{\def\size{##1pt}}% + \expandafter\size\the\scratchdimen\relax + \fi + \else + \edef\size{\size bp}% + \fi + \advance\nofMParguments -1 + %\font\temp=\gMPa\nofMParguments\space at \size + \let\temp\relax % to be sure + \setMPfshowfont{\gMPa\nofMParguments}\size + \advance\nofMParguments -1 + \temp + \MPfshowcommand + {\ifnum\nofMParguments=1 + \def\do(##1){##1}% + \doflushMPtext{\dogMPa1}% only latest mp gets this treatment + \else + % we need to catch ( a ) (a a a) (\123 \123 \123) etc + \scratchcounter1 + \def\dodo##1% Andreas Fieger's bug: (\304...) + {\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11 + \ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}% + \def\do(##1{\dodo{##1}}% + \dogMPa\scratchcounter\MPspacechar + \let\do\relax + \loop + \advance\scratchcounter 1 + \ifnum\scratchcounter<\nofMParguments\relax + \gMPa\scratchcounter\MPspacechar + \repeat + \def\do##1){\dodo{##1}}% + \dogMPa\scratchcounter + \fi + \unskip}}% + \setbox\scratchbox\hbox + {\hskip\lastMPmoveX bp\raise\lastMPmoveY bp\box\scratchbox}% + \ht\scratchbox0pt% + \dp\scratchbox0pt% + \wd\scratchbox0pt% + \box\scratchbox + \egroup} + +\let\handleMPfshow\dohandleMPfshow % so we can overload this one later + +%D You could consider the following definition to be the most +%D natural one. + +% \def\MPspacechar{\space} % normal case + +\def\MPspacechar{\char32\relax} % old solution does not work with math + +%D However, the following implementation is more robust, since +%D some fonts have funny visible spaces in the space slot. This +%D gives a mismatch between the space that \METAPOST\ took into +%D account and the \quote {natural} space. This only happens in +%D labels, since \type {btex}||\type {etex} thingies don't have +%D spaces. This phenomena showed up when preparing the +%D \METAFUN\ manual, where Palatino fonts are used. We can +%D safely assume that \METAPOST\ considers \type {\char32} to +%D be the space. + +\def\MPspacechar{\setbox\scratchbox\hbox{\char32}\kern\wd\scratchbox} + +%D Well, this does not work with math fonts, so: + +\def\MPspacechar{\char32\relax} + +%D Most operators are just converted and keep their +%D arguments. Dashes however need a bit different treatment, +%D otherwise \PDF\ viewers complain loudly. Another +%D complication is that one argument comes after the \type{]}. +%D When reading the data, we simply ignore the array boundary +%D characters. We save ourselves some redundant newlines and +%D at the same time keep the output readable by packing the +%D literals. + +\def\handleMPsetdash + {\bgroup + \ignoreMPspecials + \def\somestring{[}% + \scratchcounter1 + \loop + \ifnum\scratchcounter<\nofMParguments + \edef\somestring{\somestring\space\gMPa\scratchcounter}% + \advance\scratchcounter 1 + \repeat + \edef\somestring{\somestring]\gMPa\scratchcounter\space d}% + \PDFcode{\somestring}% + \egroup} + +%D The \type{setlinewidth} commands looks a bit complicated. There are +%D two alternatives, that result in a similar look in both +%D $x$- and $y$-dorection. As John Hobby says: +%D +%D \startnarrower \switchtobodyfont[ss] +%D \starttyping +%D x 0 dtransform exch truncate exch idtransform pop setlinewidth +%D 0 y dtransform truncate idtransform setlinewidth pop +%D \stoptyping +%D +%D These are just fancy versions of \type{x setlinewidth} and +%D \type{y setlinewidth}. The \type{x 0 ...} form is used if +%D the path is {\em primarily vertical}. It rounds the width +%D so that vertical lines come out an integer number of pixels +%D wide in device space. The \type{0 y ...} form does the same +%D for paths that are {\em primarily horizontal}. The reason +%D why I did this is Knuth insists on getting exactly the +%D widths \TEX\ intends for the horizontal and vertical rules +%D in \type{btex...etex} output. (Note that PostScript scan +%D conversion rules cause a horizontal or vertical line of +%D integer width $n$ in device space to come out $n+1$ pixels +%D wide, regardless of the phase relative to the pixel grid.) +%D \stopnarrower +%D +%D The common operator in these sequences is \type{dtransform}, +%D so we can use this one to trigger setting the linewidth. + +\def\handleMPdtransform + {\ifdim\gMPa1 pt>0pt + \PDFcode{\gMPa1 w}% + \def\next##1 ##2 ##3 ##4 ##5 ##6 {\handleMPsequence}% + \else + \PDFcode{\gMPa2 w}% + \def\next##1 ##2 ##3 ##4 {\handleMPsequence}% + \fi + \let\handleMPsequence\dohandleMPsequence + \resetMPstack + \next} + +%D The most complicated command is \type{concat}. \METAPOST\ +%D applies this operator to \type{stroke}. At that moment the +%D points set by \type{curveto} and \type{moveto}, are already +%D fixed. In \PDF\ however the \type{cm} operator affects the +%D points as well as the pen (stroke). Like more \PDF\ +%D operators, \type{cm} is defined in a bit ambiguous way. +%D The only save route for non||circular penshapes, is saving +%D the path, recalculating the points and applying the +%D transformation matrix in such a way that we can be sure +%D that its behavior is well defined. This comes down to +%D inverting the path and applying \type{cm} to that path as +%D well as the pen. This all means that we have to save the +%D path. + +%D In \METAPOST\ there are three ways to handle a path $p$: +%D +%D \starttyping +%D draw p; fill p; filldraw p; +%D \stoptyping +%D +%D The last case outputs a \type{gsave fill grestore} before +%D \type{stroke}. Handling the path outside the main loops +%D saves about 40\% run time.\footnote{We can save some more by +%D following the \METAPOST\ output routine, but for the moment +%D we keep things simple.} Switching between the main loop and +%D the path loop is done by means of the recursely called +%D macro \type{\handleMPsequence}. + +\def\handleMPpath + {\chardef\finiMPpath0 + \let\closeMPpath\relax + \let\flushMPpath\flushnormalMPpath + \resetMPstack + \nofMPsegments1 + \let\handleMPsequence\dohandleMPpath + \dohandleMPpath} + +%D Most paths are drawn with simple round pens. Therefore we've +%D split up the routine in two. + +\def\flushnormalMPsegment + {\ifcase\getMPkeyword\relax + \PDFcode{\!MPgMPs1 \!MPgMPs2 l}% + \or + \PDFcode{\!MPgMPs1 \!MPgMPs2 \!MPgMPs3 \!MPgMPs4 \!MPgMPs5 \!MPgMPs6 c}% + \or + \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l}% + \or + \edef\lastMPmoveX{\gMPs1}% evt \!MP here + \edef\lastMPmoveY{\gMPs2}% + \PDFcode{\!MP\lastMPmoveX\space \!MP\lastMPmoveY\space m}% + \fi} + +\def\flushconcatMPsegment + {\ifcase\getMPkeyword\relax + \doMPconcat{\gMPs1}\a{\gMPs2}\b% + \PDFcode{\!MP\a\space\!MP\b\space l}% + \or + \doMPconcat{\gMPs1}\a{\gMPs2}\b% + \doMPconcat{\gMPs3}\c{\gMPs4}\d% + \doMPconcat{\gMPs5}\e{\gMPs6}\f% + \PDFcode{\!MP\a\space\!MP\b\space + \!MP\c\space\!MP\d\space + \!MP\e\space\!MP\f\space c}% + \or + \bgroup + \noMPtranslate + \doMPconcat\lastMPmoveX\a\lastMPmoveY\b% + \PDFcode{\!MP\a\space\!MP\b\space l S}% + \egroup + \or + \edef\lastMPmoveX{\gMPs1}% + \edef\lastMPmoveY{\gMPs2}% + \doMPconcat\lastMPmoveX\a\lastMPmoveY\b% + \PDFcode{\!MP\a\space\!MP\b\space m}% + \fi} + +% \def\flushnormalMPpath +% {\scratchcounter\nofMPsegments +% \nofMPsegments 1 +% \loop +% \flushnormalMPsegment +% \advance\nofMPsegments 1 +% \ifnum\nofMPsegments<\scratchcounter +% \repeat} +% +% \def\flushconcatMPpath +% {\scratchcounter\nofMPsegments +% \nofMPsegments 1 +% \loop +% \flushconcatMPsegment +% \advance\nofMPsegments 1 +% \ifnum\nofMPsegments<\scratchcounter +% \repeat} +% +% an alternative is presented below: (no \def assignment) + +\def\doflushsomeMPpath + {\dodoflushsomeMPpath + \advance\nofMPsegments 1 + \ifnum\nofMPsegments<\scratchcounter + \expandafter\doflushsomeMPpath + \fi} + +\def\flushsomeMPpath + {\scratchcounter\nofMPsegments + \nofMPsegments 1 + \doflushsomeMPpath} + +\def\flushnormalMPpath{\let\dodoflushsomeMPpath\flushnormalMPsegment\flushsomeMPpath} + +%OLD \def\flushconcatMPpath{\let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath} + +%NEW pre-calculate 1/D so it needn't be repeated for each control point. + +\def\flushconcatMPpath + {\MPreciprocaldeterminant + \let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath} + +%D The transformation of the coordinates is handled by one of +%D the macros Tanmoy posted to the \PDFTEX\ mailing list. +%D I rewrote and optimized the original macro to suit the other +%D macros in this module. +%D +%D \starttyping +%D \doMPconcat {x position} \xresult {y position} \yresult +%D \stoptyping +%D +%D By setting the auxiliary \DIMENSIONS\ \type{\dimen0} upto +%D \type{\dimen10} only once per path, we save over 20\% run +%D time. Some more speed was gained by removing some parameter +%D passing. These macros can be optimized a bit more by using +%D more constants. There is however not much need for further +%D optimization because penshapes usually are round and +%D therefore need no transformation. Nevertheless we move the +%D factor to the outer level and use a bit different \type{pt} +%D removal macro. Although the values represent base points, +%D we converted them to pure points, simply because those can +%D be converted back. + +%OLD \mathchardef\MPconcatfactor=256 % beware don't remove spaces before it + +%OLD \def\doMPreducedimen#1 +%OLD {\count0\MPconcatfactor +%OLD \advance\dimen#1 \ifdim\dimen#1>0pt .5\else -.5\fi\count0 +%OLD \divide\dimen#1 \count0\relax} + +%OLD % too inaccurate (see old pragma logo) +%OLD +%OLD \def\doMPreducedimen#1 +%OLD {\count0=\MPconcatfactor +%OLD \divide\dimen#1 \count0\relax} + +%OLD \def\doMPreducedimen#1 +%OLD {\advance\dimen#1 \ifdim\dimen#1>0pt .5\else -.5\fi\MPconcatfactor +%OLD \divide\dimen#1 \MPconcatfactor} + +%D The transformation code is rewritten by Daniel H. Luecking who +%D describes his patch as follows: +%D +%D We would like to divide 1 by $X$, but all divisions are integer so +%D for accuracy we want to convert to large integers and make sure the +%D integer quotient has as many significant digits as possible. Thus we +%D need to replace $1/X$ with $M/N$ where $N$ is as large as possible +%D and $M/N$ is as large as possible. Also for simplicity $M$ should be +%D a power of 2. So we make $M = 2^{30}$ \footnote{$2^{31} - 1$ is the +%D largest legal integer. Using it (and simply ignoring the inaccuracy +%D caused by $-1$) turns out to be at least as accurate in all cases, +%D and more accurate in some.} (largest legal power of 2) and adjust +%D $X$ downward (if necessary) to the the range $1-2^{16}$. This gives +%D at least 15 significant binary digits, (almost as accurate as +%D \METAPOST\ for numbers near 1) or almost 5 significant figures +%D (decimal). + +\newcount\MPscratchCnt +\newdimen\MPscratchDim % will be assigned global + +\def\MPadjustdimen % sets \MPscratchDim and \MPscratchCnt + {\MPscratchCnt0 + \doMPadjustdimen} + +\def\doMPadjustdimen + {\ifdim\MPscratchDim>1pt + \divide\MPscratchDim 2 + \advance\MPscratchCnt 1 + \expandafter\doMPadjustdimen + \fi} + +%OLD \def\doMPexpanddimen#1 +%OLD {\multiply\dimen#1 \MPconcatfactor\relax} + +%D DHL: When viewed as an integer, $1 \hbox{pt}=2^{16}$ so $2^{32}/X$ +%D is the right way to do $(1 \hbox{pt})/(X \hbox{pt})$ and get the +%D answer in points. But we are limited to $2^{30}/X$. However, we +%D actually do $[ 2^{30} / (X/2^K) ]*2^{2-K}$ where $K$ is the number +%D of halvings it takes to bring $X$ below $1 \hbox{pt}$. If $K$ is 0 +%D or 1 we readjust by multiplying by 4 or 2, otherwise by halving +%D $(K-2)$ times \type {\MPscratchCnt} holds the value of $K$ from +%D \type {\MPadjustdimen}. + +\def\MPreadjustdimen % acts on \MPscratchDim and MPscratchCnt + {\ifcase\MPscratchCnt + \multiply\scratchdimen 4 + \or + \multiply\scratchdimen 2 + \else + \expandafter\doMPreadjustdimen + \fi} + +\def\doMPreadjustdimen + {\ifnum\MPscratchCnt>2 + \divide\scratchdimen 2 + \advance\MPscratchCnt -1 + \expandafter\doMPreadjustdimen + \fi} + +\def\MPreciprocaldeterminant + {\scratchdimen\withoutpt\the\dimen0 \dimen6 % s_x*s_y + \advance\scratchdimen - \withoutpt\the\dimen2 \dimen4 % s_x*s_y - r_x*r_y + \ifdim\scratchdimen<0pt % we need a positive dimension + \scratchdimen-\scratchdimen % for \MPadjustdimen (?) + \doMPreciprocal + \scratchdimen-\scratchdimen + \else + \doMPreciprocal + \fi + \edef\MPreciprocal{\withoutpt\the\scratchdimen}} + +\newcount\MPnumerator \MPnumerator = 1073741824 % 2^{30} + +% todo: dimexpr + +\def\doMPreciprocal % replace \scratchdimen with its reciprocal + {\ifdim\scratchdimen=1pt \else + \MPadjustdimen + \scratchcounter\MPnumerator + \divide\scratchcounter\scratchdimen + \scratchdimen1\scratchcounter % 1 needed ! + \MPreadjustdimen + \fi} + +%OLD \def\presetMPconcat +%OLD {\dimen 0=\gMPs1pt \doMPreducedimen 0 % r_x +%OLD \dimen 2=\gMPs2pt \doMPreducedimen 2 % s_x +%OLD \dimen 4=\gMPs3pt \doMPreducedimen 4 % s_y +%OLD \dimen 6=\gMPs4pt \doMPreducedimen 6 % r_y +%OLD \dimen 8=\gMPs5pt \doMPreducedimen 8 % t_x +%OLD \dimen10=\gMPs6pt \doMPreducedimen10 } % t_y +%OLD +%OLD \def\presetMPscale +%OLD {\dimen 0=\gMPs1pt \doMPreducedimen 0 +%OLD \dimen 2=0pt +%OLD \dimen 4=0pt +%OLD \dimen 6=\gMPs2pt \doMPreducedimen 6 +%OLD \dimen 8=0pt +%OLD \dimen10=0pt} + +\def\cleanupMPconcat + {\ignoreMPspecials + \docleanupMPargument1% + \docleanupMPargument6% + \keepMPspecials} + +\def\presetMPconcat + {\dimen 0=\gMPs1pt % s_x + \dimen 2=\gMPs2pt % r_x + \dimen 4=\gMPs3pt % r_y + \dimen 6=\gMPs4pt % s_y + \dimen 8=\gMPs5pt % t_x + \dimen10=\gMPs6pt} % t_y + +\def\presetMPscale + {\dimen 0=\gMPs1pt + \dimen 2=0pt + \dimen 4=0pt + \dimen 6=\gMPs2pt + \dimen 8=0pt + \dimen10=0pt} + +\def\noMPtranslate % use this one grouped + {\dimen 8=0pt % t_x + \dimen10=0pt} % t_y + +%D \starttyping +%D \def\doMPconcat#1#2#3#4% +%D {\dimen12=#1 pt \doMPreducedimen12 % p_x +%D \dimen14=#3 pt \doMPreducedimen14 % p_y +%D % +%D \dimen16 \dimen 0 +%D \multiply \dimen16 \dimen 6 +%D \dimen20 \dimen 2 +%D \multiply \dimen20 \dimen 4 +%D \advance \dimen16 -\dimen20 +%D % +%D \dimen18 \dimen12 +%D \multiply \dimen18 \dimen 6 +%D \dimen20 \dimen14 +%D \multiply \dimen20 \dimen 4 +%D \advance \dimen18 -\dimen20 +%D \dimen20 \dimen 4 +%D \multiply \dimen20 \dimen10 +%D \advance \dimen18 \dimen20 +%D \dimen20 \dimen 6 +%D \multiply \dimen20 \dimen 8 +%D \advance \dimen18 -\dimen20 +%D % +%D \multiply \dimen12 -\dimen 2 +%D \multiply \dimen14 \dimen 0 +%D \advance \dimen12 \dimen14 +%D \dimen20 \dimen 2 +%D \multiply \dimen20 \dimen 8 +%D \advance \dimen12 \dimen20 +%D \dimen20 \dimen 0 +%D \multiply \dimen20 \dimen10 +%D \advance \dimen12 -\dimen20 +%D % +%D \doMPreducedimen16 +%D \divide \dimen18 \dimen16 \doMPexpanddimen18 +%D \divide \dimen12 \dimen16 \doMPexpanddimen12 +%D % +%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime +%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime +%D \stoptyping + +%D The following optimization resulted from some tests by +%D and email exchanges with Sanjoy Mahajan. +%D +%D \starttyping +%D \def\doMPconcat#1#2#3#4% +%D {\dimen12=#1 pt \doMPreducedimen12 % p_x +%D \dimen14=#3 pt \doMPreducedimen14 % p_y +%D % +%D \dimen16 \dimen 0 +%D \multiply \dimen16 \dimen 6 +%D \dimen20 \dimen 2 +%D \multiply \dimen20 \dimen 4 +%D \advance \dimen16 -\dimen20 +%D % +%D \dimen18 \dimen12 +%D \multiply \dimen18 \dimen 6 +%D \dimen20 \dimen14 +%D \multiply \dimen20 \dimen 4 +%D \advance \dimen18 -\dimen20 +%D \dimen20 \dimen 4 +%D \multiply \dimen20 \dimen10 +%D \advance \dimen18 \dimen20 +%D \dimen20 \dimen 6 +%D \multiply \dimen20 \dimen 8 +%D \advance \dimen18 -\dimen20 +%D % +%D \multiply \dimen12 -\dimen 2 +%D \multiply \dimen14 \dimen 0 +%D \advance \dimen12 \dimen14 +%D \dimen20 \dimen 2 +%D \multiply \dimen20 \dimen 8 +%D \advance \dimen12 \dimen20 +%D \dimen20 \dimen 0 +%D \multiply \dimen20 \dimen10 +%D \advance \dimen12 -\dimen20 +%D % +%D %\ifdim\dimen16>1pt % oeps, can be < 1pt too +%D \ifdim\dimen16=1pt \else +%D \ifdim\dimen16>\MPconcatfactor pt +%D \doMPreducedimen16 +%D \divide \dimen18 \dimen16 \doMPexpanddimen18 +%D \divide \dimen12 \dimen16 \doMPexpanddimen12 +%D \else +%D \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18 +%D \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12 +%D \fi +%D \fi +%D % +%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime +%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime +%D \stoptyping +%D +%D But, this one is still too inaccurate, so we now have: + +% \def\doMPconcat#1#2#3#4% +% {\dimen12=#1pt % p_x +% \dimen14=#3pt % p_y +% % +% % we should test for >-1024 too, but for the moment take the gamble +% \chardef\MPfactor1\ifdim\dimen12<1024pt \ifdim\dimen14<1024pt 6\fi\fi +% % +% \multiply\dimen12 \MPfactor +% \multiply\dimen14 \MPfactor +% % +% \doMPreducedimen12 +% \doMPreducedimen14 +% % +% \dimen16 \dimen 0 +% \multiply \dimen16 \dimen 6 +% \dimen20 \dimen 2 +% \multiply \dimen20 \dimen 4 +% \advance \dimen16 -\dimen20 +% % +% \dimen18 \dimen12 +% \multiply \dimen18 \dimen 6 +% \dimen20 \dimen14 +% \multiply \dimen20 \dimen 4 +% \advance \dimen18 -\dimen20 +% \dimen20 \dimen 4 +% \multiply \dimen20 \dimen10 +% \advance \dimen18 \dimen20 +% \dimen20 \dimen 6 +% \multiply \dimen20 \dimen 8 +% \advance \dimen18 -\dimen20 +% % +% \multiply \dimen12 -\dimen 2 +% \multiply \dimen14 \dimen 0 +% \advance \dimen12 \dimen14 +% \dimen20 \dimen 2 +% \multiply \dimen20 \dimen 8 +% \advance \dimen12 \dimen20 +% \dimen20 \dimen 0 +% \multiply \dimen20 \dimen10 +% \advance \dimen12 -\dimen20 +% % +% \ifdim\dimen16=1pt \else +% \ifdim\dimen16>\MPconcatfactor pt +% \doMPreducedimen16 +% \divide \dimen18 \dimen16 \doMPexpanddimen18 +% \divide \dimen12 \dimen16 \doMPexpanddimen12 +% \else +% \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18 +% \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12 +% \fi +% \fi +% % +% \divide\dimen18 \MPfactor +% \divide\dimen12 \MPfactor +% % +% \edef#2{\withoutpt\the\dimen18}% % p_x^\prime +% \edef#4{\withoutpt\the\dimen12}} % p_y^\prime + +%D DHL: Ideally, $r_x$, $r_y$, $s_x$, $s_y$ should be in macros, not +%D dimensions (they are scalar quantities after all, not lengths). I +%D suppose the authors decided to do calculations with integer +%D arithmetic instead of using real factors because it's faster. +%D However, the actual macros test slower, possibly because I've +%D omitted three nested loops. In my test files, my approach is more +%D accurate. It is also far simpler and overflow does not seem to be a +%D significant concern. The scale factors written by Metapost are (?) +%D always $<=1$ (it scales coordinates internally) and coordinates are +%D always likely to be less than \type {\maxdimen}. +%D +%D If this should ever cause problems, the scale factors can be reduced. + +% \def\doMPconcat#1#2#3#4% +% {\dimen12=#1pt % p_x % #1pt +% \dimen14=#3pt % p_y % #3pt +% \advance\dimen12 -\dimen8 % p_x - t_x +% \advance\dimen14 -\dimen10 % p_y - t_y +% \dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x) +% \advance\dimen18 -\withoutpt\the\dimen4 \dimen14 % - r_y(p_y-t_y) +% \dimen14=\withoutpt\the\dimen0 \dimen14 % s_x(p_y-t_y) +% \advance\dimen14 -\withoutpt\the\dimen2 \dimen12 % - r_x(p_x-t_x) +% % \MPscratchDim contains precomputed 1/D: +% \dimen18=\withoutpt\the\MPscratchDim \dimen18 +% \dimen14=\withoutpt\the\MPscratchDim \dimen14 +% \edef#2{\withoutpt\the\dimen18}% % p_x^\prime +% \edef#4{\withoutpt\the\dimen14}} % p_y^\prime + +\def\doMPconcat#1#2#3#4% + {\dimen12=#1pt % p_x % #1pt + \dimen14=#3pt % p_y % #3pt + \advance\dimen12 -\dimen8 % p_x - t_x + \advance\dimen14 -\dimen10 % p_y - t_y + \dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x) + \advance\dimen18 -\withoutpt\the\dimen4 \dimen14 % - r_y(p_y-t_y) + \dimen14=\withoutpt\the\dimen0 \dimen14 % s_x(p_y-t_y) + \advance\dimen14 -\withoutpt\the\dimen2 \dimen12 % - r_x(p_x-t_x) + % \MPreciprocal contains precomputed 1/D: + \dimen18=\MPreciprocal\dimen18 + \dimen14=\MPreciprocal\dimen14 + \edef#2{\withoutpt\the\dimen18}% % p_x^\prime + \edef#4{\withoutpt\the\dimen14}} % p_y^\prime + +% faster but not that often used +% +% \def\doMPconcat#1#2#3#4% +% {\dimen12\dimexpr#1\points-\dimen 8\relax % p_x-t_x +% \dimen14\dimexpr#3\points-\dimen10\relax % p_y-t_y +% \dimen18\dimexpr\withoutpt\the\dimen6\dimen12-\withoutpt\the\dimen4\dimen14\relax % s_y(p_x-t_x)-r_y(p_y-t_y) +% \dimen14\dimexpr\withoutpt\the\dimen0\dimen14-\withoutpt\the\dimen2\dimen12\relax % s_x(p_y-t_y)-r_x(p_x-t_x) +% \edef#2{\withoutpt\the\dimexpr\MPreciprocal\dimen18\relax}% % p_x^\prime +% \edef#4{\withoutpt\the\dimexpr\MPreciprocal\dimen14\relax}} % p_y^\prime + +%D One reason for Daniel to write this patch was that at small sizes +%D the accuracy was less than optimal. Here is a test that demonstrates +%D that his alternative is pretty good: +%D +%D \startlinecorrection +%D \startMPcode +%D for i = 5cm,1cm,5mm,1mm,.5mm,.1mm,.01mm : +%D draw fullcircle scaled i withpen pencircle xscaled (i/10) yscaled (i/20) rotated 45 ; +%D endfor ; +%D \stopMPcode +%D \stoplinecorrection + +%D The following explanation of the conversion process was +%D posted to the \PDFTEX\ mailing list by Tanmoy. The original +%D macro was part of a set of macro's that included sinus and +%D cosinus calculations as well as scaling and translating. The +%D \METAPOST\ to \PDF\ conversion however only needs +%D transformation. + +%M \start \switchtobodyfont [ss] + +%D Given a point $(U_x, U_y)$ in user coordinates, the business +%D of \POSTSCRIPT\ is to convert it to device space. Let us say +%D that the device space coordinates are $(D_x, D_y)$. Then, in +%D \POSTSCRIPT\ $(D_x, D_y)$ can be written in terms of +%D $(U_x, U_y)$ in matrix notation, either as +%D +%D \placeformula +%D \startformula +%D \pmatrix{D_x&D_y&1\cr} = \pmatrix{U_x&U_y&1\cr} +%D \pmatrix{s_x&r_x&0\cr +%D r_y&s_y&0\cr +%D t_x&t_y&1\cr} +%D \stopformula +%D +%D or +%D +%D \placeformula +%D \startformula +%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x&r_y&t_x\cr +%D r_x&s_y&t_y\cr +%D 0 &0 &1 \cr} +%D \pmatrix{U_x\cr +%D U_y\cr +%D 1 \cr} +%D \stopformula +%D +%D both of which is a shorthand for the same set of equations: +%D +%D \placeformula +%D \startformula +%D D_x = s_x U_x + r_y U_y + t_x +%D \stopformula +%D +%D \placeformula +%D \startformula +%D D_y = r_x U_x + s_y U_y + t_y +%D \stopformula +%D +%D which define what is called an `affine transformation'. +%D +%D \POSTSCRIPT\ represents the `transformation matrix' as a +%D six element matrix instead of a $3\times 3$ array because +%D three of the elements are always~0, 0 and~1. Thus the above +%D transformation is written in postscript as $[s_x\, r_x\, +%D r_y\, s_y\, t_x\, t_y]$. However, when doing any +%D calculations, it is useful to go back to the original +%D matrix notation (whichever: I will use the second) and +%D continue from there. +%D +%D As an example, if the current transformation matrix is +%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$ and you say \typ{[a b +%D c d e f] concat}, this means: +%D +%D \startnarrower +%D Take the user space coordinates and transform them to an +%D intermediate set of coordinates using array $[a\, b\, c\, d\, +%D e\, f]$ as the transformation matrix. +%D +%D Take the intermediate set of coordinates and change them to +%D device coordinates using array $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$ +%D as the transformation matrix. +%D \stopnarrower +%D +%D Well, what is the net effect? In matrix notation, it is +%D +%D \placeformula +%D \startformula +%D \pmatrix{I_x\cr I_y\cr 1\cr} = \pmatrix{a&c&e\cr +%D b&d&f\cr +%D 0&0&1\cr} +%D \pmatrix{U_x\cr +%D U_y\cr +%D 1 \cr} +%D \stopformula +%D +%D \placeformula +%D \startformula +%D \pmatrix{D_y\cr D_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr +%D r_x&s_y&t_y\cr +%D 0 &0 &1 \cr} +%D \pmatrix{I_x\cr +%D I_y\cr +%D 1 \cr} +%D \stopformula +%D +%D where $(I_x, I_y)$ is the intermediate coordinate. +%D +%D Now, the beauty of the matrix notation is that when there is +%D a chain of such matrix equations, one can always compose +%D them into one matrix equation using the standard matrix +%D composition law. The composite matrix from two matrices can +%D be derived very easily: the element in the $i$\high{th} +%D horizontal row and $j$\high{th} vertical column is +%D calculated by`multiplying' the $i$\high{th} row of the first +%D matrix and the $j$\high{th} column of the second matrix (and +%D summing over the elements). Thus, in the above: +%D +%D \placeformula +%D \startformula +%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr +%D r_x^\prime&s_y^\prime&t_y^\prime\cr +%D 0 &0 &0 \cr} +%D \pmatrix{U_x\cr +%D U_y\cr +%D 1 \cr} +%D \stopformula +%D +%D with +%D +%D \placeformula +%D \startformula +%D \eqalign +%D {s_x^\prime & = s_x a + r_y b \cr +%D r_x^\prime & = r_x a + s_y b \cr +%D r_y^\prime & = s_x c + r_y d \cr +%D s_y^\prime & = r_x c + s_y d \cr +%D t_x^\prime & = s_x e + r_y f + t_x \cr +%D t_y^\prime & = r_x e + s_y f + t_y \cr} +%D \stopformula + +%D In fact, the same rule is true not only when one is going +%D from user coordinates to device coordinates, but whenever +%D one is composing two `transformations' together +%D (transformations are `associative'). Note that the formula +%D is not symmetric: you have to keep track of which +%D transformation existed before (i.e.\ the equivalent of +%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$) and which was +%D specified later (i.e.\ the equivalent of $[a\, b\, c\, d\, +%D e\, f]$). Note also that the language can be rather +%D confusing: the one specified later `acts earlier', +%D converting the user space coordinates to intermediate +%D coordinates, which are then acted upon by the pre||existing +%D transformation. The important point is that order of +%D transformation matrices cannot be flipped (transformations +%D are not `commutative'). +%D +%D Now what does it mean to move a transformation matrix +%D before a drawing? What it means is that given a point +%D $(P_x, P_y)$ we need a different set of coordinates +%D $(P_x^\prime, P_y^\prime)$ such that if the transformation +%D acts on $(P_x^\prime, P_y^\prime)$, they produce $(P_x, +%D P_y)$. That is we need to solve the set of equations: +%D +%D \placeformula +%D \startformula +%D \pmatrix{P_x\cr P_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr +%D r_x&s_y&t_y\cr +%D 0 &0 &1 \cr} +%D \pmatrix{P_x^\prime\cr +%D P_y^\prime\cr +%D 1 \cr} +%D \stopformula +%D +%D Again matrix notation comes in handy (i.e. someone has +%D already solved the problem for us): we need the inverse +%D transformation matrix. The inverse transformation matrix can +%D be calculated very easily: +%D +%D \placeformula +%D \startformula +%D \pmatrix{P_x^\prime\cr P_y^\prime\cr 1\cr} = +%D \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr +%D r_x^\prime&s_y^\prime&t_y^\prime\cr +%D 0 &0 &1 \cr} +%D \pmatrix{P_x\cr +%D P_y\cr +%D 1 \cr} +%D \stopformula +%D +%D where, the inverse transformation matrix is given by +%D +%D \placeformula +%D \startformula +%D \eqalign +%D {D & = s_x s_y - r_x r_y \cr +%D s_x^\prime & = s_y / D \cr +%D s_y^\prime & = s_x / D \cr +%D r_x^\prime & = - r_x / D \cr +%D r_y^\prime & = - r_y / D \cr +%D t_x^\prime & = ( - s_y t_x + r_y t_y ) / D \cr +%D t_y^\prime & = ( r_x t_x - s_x t_y ) / D \cr} +%D \stopformula +%D +%D And you can see that when expanded out, this does +%D give the formulas: +%D +%D \placeformula +%D \startformula +%D P_x^\prime = { { s_y(p_x-t_x) + r_y(t_y-p_y) } \over +%D { s_x s_y-r_x r_y } } +%D \stopformula +%D +%D \placeformula +%D \startformula +%D P_y^\prime = { { s_x(p_y-t_y) + r_x(t_x-p_x) } \over +%D { s_x*s_y-r_x*r_y } } +%D \stopformula +%D +%D The code works by representing a real number by converting +%D it to a dimension to be put into a \DIMENSION\ register: 2.3 would +%D be represented as 2.3pt for example. In this scheme, +%D multiplying two numbers involves multiplying the \DIMENSION\ +%D registers and dividing by 65536. Accuracy demands that the +%D division be done as late as possible, but overflow +%D considerations need early division. +%D +%D Division involves dividing the two \DIMENSION\ registers and +%D multiplying the result by 65536. Again, accuracy would +%D demand that the numerator be multiplied (and|/|or the +%D denominator divided) early: but that can lead to overflow +%D which needs to be avoided. +%D +%D If nothing is known about the numbers to start with (in +%D concat), I have chosen to divide the 65536 as a 256 in each +%D operand. However, in the series calculating the sine and +%D cosine, I know that the terms are small (because I never +%D have an angle greater than 45 degrees), so I chose to +%D apportion the factor in a different way. + +%M \stop + +%D The path is output using the values saved on the stack. If +%D needed, all coordinates are recalculated. + +\def\finishMPpath + {\PDFcode{\ifcase\finiMPpath W n\or S\or f\or B\fi}} + +\def\processMPpath + {\checkMPpath + \ifcase\nofMPsegments\else + \flushMPpath + \closeMPpath + \finishMPpath + \fi + \let\handleMPsequence\dohandleMPsequence + \resetMPstack + \nofMPsegments0 + \handleMPsequence} + +%D The following \METAPOST\ code is quite valid but, when +%D processed and converted to \PDF, will make a file +%D unprintable on a Hewlett Packard printer (from Acrobat +%D $v<=5$). Who is to blame, the driver of the OS layer in +%D between, is hard to determine, so we add an additional +%D check. +%D +%D \starttyping +%D clip currentpicture to origin -- cycle ; +%D setbounds currentpicture to fullsquare scaled 5cm ; +%D \stoptyping + +\def\checkMPpath + {\ifcase\finiMPpath + \ifnum\nofMPsegments<3 % n is one ahead + \message{omitting zero clip path}% + \nofMPsegments0 + \fi + \fi} + +%D In \PDF\ the \type{cm} operator must precede the path +%D specification. We therefore can output the \type{cm} at +%D the moment we encounter it. + +\def\handleMPpathconcat + {\presetMPconcat + \PDFcode{\gMPs1 \gMPs2 \gMPs3 \gMPs4 \gMPs5 \gMPs6 cm}% + \resetMPstack} + +\def\handleMPpathscale + {\presetMPscale + \PDFcode{\gMPs1 0 0 \gMPs2 0 0 cm}% + \resetMPstack} + +%D This macro interprets the path and saves it as compact as +%D possible. + +\def\dohandleMPpath#1% + {\ifcase\lccode`#1\relax + \expandafter\dohandleMPpathA + \else + \expandafter\dohandleMPpathB + \fi#1} + +%\def\dohandleMPpathA#1 % +% {\setMPargument{#1}% +% \handleMPsequence} + +\let\dohandleMPpathA\setMPsequence + +% \def\dohandleMPpathB#1 % +% {\def\somestring{#1}% +% \ifx\somestring\PSlineto +% \setMPkeyword0 +% \else\ifx\somestring\PScurveto +% \setMPkeyword1 +% \else\ifx\somestring\PSrlineto +% \setMPkeyword2 +% \else\ifx\somestring\PSmoveto +% \setMPkeyword3 +% \else\ifx\somestring\PSclip +% % \chardef\finiMPpath0 % already +% \let\handleMPsequence\processMPpath +% \else\ifx\somestring\PSgsave +% \chardef\finiMPpath3 +% \else\ifx\somestring\PSgrestore +% \else\ifx\somestring\PSfill +% \ifcase\finiMPpath +% \chardef\finiMPpath2 +% \let\handleMPsequence\processMPpath +% \fi +% \else\ifx\somestring\PSstroke +% \ifcase\finiMPpath +% \chardef\finiMPpath1 +% \fi +% \let\handleMPsequence\processMPpath +% \else\ifx\somestring\PSclosepath +% \def\closeMPpath{\PDFcode{h}}% +% \else\ifx\somestring\PSconcat +% \cleanupMPconcat +% \let\flushMPpath\flushconcatMPpath +% \handleMPpathconcat +% \else\ifx\somestring\PSscale +% \let\flushMPpath\flushconcatMPpath +% \handleMPpathscale +% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi +% \handleMPsequence} + +\def\installMPSkeywordP#1#2% + {\expandafter\def\csname\@@MP:P:#1\endcsname{#2}} + +\def\installMPSshortcutP#1#2% todo: \let + {\expandafter\let\csname\@@MP:P:#1\expandafter\endcsname\csname\@@MP:P:#2\endcsname} + +\def\dohandleMPpathB#1 % + {\def\somestring{#1}% + \ifcsname\@@MP:P:\somestring\endcsname + \csname\@@MP:P:\somestring\expandafter\endcsname + \fi + \handleMPsequence} + +\ifx\eTeXversion\undefined + \def\dohandleMPpathB#1 % + {\def\somestring{#1}% + \csname\@@MP:P:\somestring\endcsname + \handleMPsequence} +\fi + +\installMPSkeywordP \PSlineto + {\setMPkeyword0 } +\installMPSkeywordP \PScurveto + {\setMPkeyword1 } +\installMPSkeywordP \PSrlineto + {\setMPkeyword2 } +\installMPSkeywordP \PSmoveto + {\edef\lastMPmoveX{\gMPs1}% + \edef\lastMPmoveY{\gMPs2}% + \resetMPstack + \setMPkeyword3 } +\installMPSkeywordP \PSclip + {% \chardef\finiMPpath\zerocount % already + \let\handleMPsequence\processMPpath} +\installMPSkeywordP \PSgsave + {\chardef\finiMPpath3 } +\installMPSkeywordP \PSgrestore + {} +\installMPSkeywordP \PSfill + {\ifcase\finiMPpath + \chardef\finiMPpath2 + \let\handleMPsequence\processMPpath + \fi} +\installMPSkeywordP \PSstroke + {\ifcase\finiMPpath + \chardef\finiMPpath1 + \fi + \let\handleMPsequence\processMPpath} +\installMPSkeywordP \PSclosepath + {\def\closeMPpath{\PDFcode{h}}} +\installMPSkeywordP \PSconcat + {\cleanupMPconcat + \let\flushMPpath\flushconcatMPpath + \handleMPpathconcat} +\installMPSkeywordP \PSscale + {\let\flushMPpath\flushconcatMPpath + \handleMPpathscale} + +\installMPSshortcutP {l} \PSlineto +\installMPSshortcutP {r} \PSrlineto +\installMPSshortcutP {m} \PSmoveto +\installMPSshortcutP {c} \PScurveto + +\installMPSshortcutP {q} \PSgsave +\installMPSshortcutP {Q} \PSgrestore +\installMPSshortcutP {S} \PSstroke +\installMPSshortcutP {F} \PSfill +\installMPSshortcutP {B} \PSgsave +\installMPSshortcutP {W} \PSclip +\installMPSshortcutP {p} \PSclosepath + +\installMPSshortcutP {s} \PSscale +\installMPSshortcutP {t} \PSconcat + +%D The main conversion command is: +%D +%D \starttyping +%D \convertMPtoPDF {filename} {x scale} {y scale} +%D \stoptyping +%D +%D The dimensions are derived from the bounding box. So we +%D only have to say: +%D +%D \starttyping +%D \convertMPtoPDF{mp-pra-1.eps}{1}{1} +%D \convertMPtoPDF{mp-pra-1.eps}{.5}{.5} +%D \stoptyping + +%D \macros +%D {makeMPintoPDFobject,lastPDFMPobject} +%D +%D For experts there are a few more options. When attributes +%D are to be added, the code must be embedded in an object +%D accompanied with the appropriate directives. One can +%D influence this process with \type {\makeMPintoPDFobject}. +%D +%D This option defaults to~0, because \CONTEXT\ takes care +%D of objects at another level, which saves some bytes. +%D +%D \starttabulate[|l|l|p|] +%D \NC 0 \NC never \NC don't use an object \NC\NR +%D \NC 1 \NC always \NC always use an object \NC\NR +%D \NC 2 \NC optional \NC use object when needed \NC\NR +%D \stoptabulate +%D +%D The last object number used is avaliable in the macro +%D \type {\lastPDFMPobject}. + +\ifx\makeMPintoPDFobject\undefined \chardef\makeMPintoPDFobject=0 \fi + +\def\lastPDFMPobject{0} + +%D The additional code needed can be made available in the +%D (global) macro \type {\currentPDFresources}. + +\let\currentPDFresources\empty + +\newtoks\everyMPtoPDFconversion + +\def\convertMPtoPDF % #1#2#3% + {\bgroup + \defineMPtoPDFfallbacks + \ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new + \setbox\scratchbox\vbox\bgroup + \xdef\MPheight{0pt}% + \xdef\MPwidth {0pt}% + \forgetall + \offinterlineskip + \startMPresources + \doprocessMPtoPDFfile} % + +%D The next one is kind of private and probably will become obsolete): + +\def\processMPtoPDFfile % file xscale yscale + {\bgroup + \let\finishMPgraphic\egroup + \doprocessMPtoPDFfile} + +\let\setMPextensions\relax + +\def\doprocessMPtoPDFfile#1#2#3% file xscale yscale + {\setMPspecials + \setMPextensions + \the\everyMPtoPDFconversion + \catcode`\^^M=\@@endofline + \startMPscanning + \let\do\empty + \xdef\MPxscale{#2}% + \xdef\MPyscale{#3}% + \xdef\MPxoffset{0}% + \xdef\MPyoffset{0}% + \xdef\MPyshift{0pt}% + \donefalse + \let\handleMPsequence\dohandleMPsequence + \message{[MP to PDF]}% was: [MP to PDF #1] but there is a (#1) anyway + \input#1\relax} + +\def\PDFMPformoffset + {\ifx\objectoffset\undefined0pt\else\objectoffset\fi} + +\chardef\blackoutMPgraphic0 % in ConTeXt 1 + +\def\finishMPgraphic + {\stopMPresources + \egroup + \setbox\scratchbox\vbox + {\forgetall + \hbox + {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}% + \ifcase\blackoutMPgraphic\or\PDFcode{0 g 0 G}\fi + \lower\MPyshift\box\scratchbox % unscaled shift + \PDFcode{Q}}}% + \ht\scratchbox\MPheight + \wd\scratchbox\MPwidth + \dp\scratchbox0pt\relax + \dopackageMPgraphic\scratchbox + \egroup + \endinput} + +%D Alternative for \PDFTEX. We cannot come up with something more contexy +%D because this module is also used in \LATEX. + +\def\dopackageMPgraphic#1% #1 = boxregister + {%\ifx\pdfxform\undefined + % \chardef\makeMPintoPDFobject0 % no pdftex at all + %\else\ifx\pdftexversion\undefined + % \chardef\makeMPintoPDFobject0 % no pdftex at all + %\else\ifnum\pdftexversion<14 + % \chardef\makeMPintoPDFobject0 % no resource support + %\else + % % keep the default value + %\fi\fi\fi + \ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else + % an existing value of 2 signals object support (set elsewhere) + \chardef\makeMPintoPDFobject1 + \fi\fi + \ifcase\makeMPintoPDFobject + \box#1% + \or + \scratchdimen\PDFMPformoffset\relax + \ifdim\scratchdimen>0pt % compensate for error + \setbox#1\vbox spread 2\scratchdimen + {\forgetall\vss\hbox spread 2\scratchdimen{\hss\box#1\hss}\vss}% + \fi + \setMPPDFobject{\currentPDFresources}{#1}% + \ifdim\scratchdimen>0pt % compensate for error + \vbox to \MPheight + {\forgetall\vss\hbox to \MPwidth{\hss\getMPPDFobject\hss}\vss}% + \else + \getMPPDFobject + \fi + \global\let\currentPDFresources\empty + \else + \box#1% + \fi} + +\def\setMPPDFobject#1#2% resources boxnumber + {\ifx\pdfxform\undefined + \def\getMPPDFobject{\box#2}% + \else\ifx\pdftexversion\undefined + \def\getMPPDFobject{\box#2}% + \else\ifnum\pdftexversion<14 + \def\getMPPDFobject{\box#2}% + \else + \ifx\everyPDFxform\undefined\else\the\everyPDFxform\fi + \immediate\pdfxform resources{#1}#2% + \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}% + \fi\fi\fi} + +\let\getMPPDFobject\relax + +%D \macros +%D {deleteMPgraphic, +%D startMPresources, +%D stopMPresources} +%D +%D Here are a few hooks for \CONTEXT\ specific things. + +\ifx\deleteMPgraphic\undefined + \def\deleteMPgraphic#1{} +\fi + +\ifx\startMPresources\undefined + \let\startMPresources\relax + \let\stopMPresources\relax +\fi + +%D \macros +%D {twodigitMPoutput} +%D +%D We can limit the precision to two digits after the comma +%D by saying: +%D +%D \starttyping +%D \twodigitMPoutput +%D \stoptyping +%D +%D This option only works in \CONTEXT\ combined with \ETEX. + +\def\twodigitMPoutput + {\let\!MP \twodigitrounding + \def\!MPgMPs##1{\twodigitrounding{\gMPs##1}}% + \def\!MPgMPa##1{\twodigitrounding{\gMPa##1}}} + +\let\!MP \empty +\let\!MPgMPa\gMPa +\let\!MPgMPs\gMPs + +%D This kind of conversion is possible because \METAPOST\ +%D does all the calculations. Converting other \POSTSCRIPT\ +%D files would drive both me and \TEX\ crazy. + +\protect \endinput diff --git a/tex/context/base/supp-pdf.tex b/tex/context/base/supp-pdf.tex deleted file mode 100644 index c54b0c6bc..000000000 --- a/tex/context/base/supp-pdf.tex +++ /dev/null @@ -1,2187 +0,0 @@ -%D \module -%D [ file=supp-pdf, -%D version=2006.09.02, % 2004.12.16, -%D title=\CONTEXT\ Support Macros, -%D subtitle=\METAPOST\ to \PDF\ conversion, -%D author=Hans Hagen \& others (see text), -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\ifx\writestatus\undefined - \immediate\write16{[Loading MPS to PDF converter (version 2006.09.02).]} -\else - \writestatus{loading}{ConTeXt Support Macros / PDF} -\fi - -%D This module is not optimized because it is used outside -%D \CONTEXT\ and we cannot forsee what interference will take -%D place. We no longer load supp-mis. I got too tired of -%D keeping track of interferences with non \CONTEXT\ usage so -%D I moved the necessary code in here and use a derived version -%D in \CONTEXT. When I have the time I will clean up some of the -%D code that is of no use for non||\CONTEXT\ users. - -\ifx\contextversion\undefined - - \chardef\mptopdfstoredatcode\catcode`\@ - - \catcode\string`@=11 - - \def\unprotect - {\let\@@mpstopdf@@unprotect \unprotect - \let\@@mpstopdf@@protect \protect - \edef\protect - {\noexpand \let \noexpand \protect \noexpand \@@mpstopdf@@protect - \noexpand \let \noexpand \unprotect \noexpand \@@mpstopdf@@unprotect - % context specific - \catcode\string`\noexpand @=\the\catcode\string`@ - \catcode\string`\noexpand !=\the\catcode\string`! - \catcode\string`\noexpand ?=\the\catcode\string`? - % latex specific - \catcode\string`\noexpand /=\the\catcode\string`/ - \catcode\string`\noexpand -=\the\catcode\string`- - \catcode\string`\noexpand :=\the\catcode\string`: - \catcode\string`\noexpand ;=\the\catcode\string`; - \catcode\string`\noexpand "=\the\catcode\string`" - \catcode\string`\noexpand <=\the\catcode\string`< - \catcode\string`\noexpand >=\the\catcode\string`> - \catcode\string`\noexpand `=\the\catcode\string``} - \catcode\string`@=11 \catcode\string`!=11 \catcode\string`?=11 - \catcode\string`/=12 \catcode\string`-=12 - \catcode\string`:=12 \catcode\string`;=12 - \catcode\string`>=12 \catcode\string`<=12 - \catcode\string`"=12 \catcode\string``=12 } - - \def\defineMPtoPDFfallbacks - {% shortcuts - \chardef\@@escape 0 - \chardef\@@begingroup 1 - \chardef\@@endgroup 2 - \chardef\@@endofline 5 - \chardef\@@ignore 9 - \chardef\@@space 10 - \chardef\@@letter 11 - \chardef\@@other 12 - \chardef\@@active 13 - \chardef\@@comment 14 - % placeholders - \ifx\withoutpt \undefined \let\withoutpt \@@mptopdf@@withoutpt \fi - \ifx\twodigitrounding \undefined \let\twodigitrounding \@@mptopdf@@twodigitrounding \fi - \ifx\forgetall \undefined \let\forgetall \@@mptopdf@@forgetall \fi - \ifx\uncatcodespecials \undefined \let\uncatcodespecials \@@mptopdf@@uncatcodespecials \fi - \ifx\setnaturalcatcodes\undefined \let\setnaturalcatcodes\@@mptopdf@@setnaturalcatcodes \fi - \ifx\dospecials \undefined \let\dospecials \@@mptopdf@@dospecials \fi} - - \def\@@mptopdf@@forgetall - {\parskip0pt\leftskip0pt\parindent0pt\everypar{}} - - \def\@@mptopdf@@twodigitrounding#1% - {#1}% - - \def\@@mptopdf@@uncatcodespecials - {\def\do##1{\catcode`##1=\@@other}\dospecials - \catcode`\ =\@@space - \catcode`\^^L=\@@ignore - \catcode`\^^M=\@@endofline - \catcode`\^^?=\@@ignore} - - \def\@@mptopdf@@setnaturalcatcodes - {\catcode`\!=\@@other \catcode`\?=\@@other \catcode`\@=\@@other - \catcode`\#=\@@other \catcode`\&=\@@other \catcode`\|=\@@other - \catcode`\$=\@@other \catcode`\^=\@@other \catcode`\_=\@@other - \catcode`\*=\@@other \catcode`\/=\@@other - \catcode`\-=\@@other \catcode`+=\@@other - \catcode`\==\@@other \catcode`\<=\@@other \catcode`\>=\@@other - \catcode`\"=\@@other \catcode`\'=\@@other \catcode`\`=\@@other - \catcode`\:=\@@other \catcode`\;=\@@other - \catcode`\,=\@@other \catcode`\.=\@@other \catcode`\~=\@@other - \catcode`\(=\@@other \catcode`\)=\@@other - \catcode`\{=\@@other \catcode`\}=\@@other - \catcode`\\=\@@other \catcode`\%=\@@other} - - \def\@@mptopdf@@dospecials - {\do\ \do\\\do\{\do\}\do\$% - \do\#\do\^\do\_\do\&\do\%% - \do\~\do\^^A\do\^^K} - - { - \catcode`\.=12 - \catcode`\p=12 - \catcode`\t=12 - \gdef\@@MPTOPDF@@WITHOUTPT#1pt{#1} - } - - \def\@@mptopdf@@withoutpt#1% - {\expandafter\@@MPTOPDF@@WITHOUTPT#1} - -% \def\@@mptopdf@@newabove#1#2% \dimen \name -% {#1#2% -% \ifnum\expandafter\gobblesixarguments\meaning#2>20\else -% \expandafter\@@mptopdf@@newabove\expandafter#1\expandafter#2% -% \fi} - - \def\@@mptopdf@@stripnewabove#1% - {\ifnum10<9#1 #1\else\expandafter\@@mptopdf@@stripnewabove\fi}% - - \def\@@mptopdf@@newabove\csname#1\endcsname#2% \dimen \name - {\csname#1\endcsname#2% - \ifnum\expandafter\@@mptopdf@@stripnewabove\meaning#2>20\else - \@@mptopdf@@newabove\csname#1\endcsname#2% - \fi} - - \@@mptopdf@@newabove \csname newcount\endcsname \scratchcounter - \@@mptopdf@@newabove \csname newdimen\endcsname \scratchdimen - \csname newbox\endcsname \scratchbox - - \expandafter \newif \csname ifdone\endcsname - - \catcode`\@=\mptopdfstoredatcode - -\else - - \let\defineMPtoPDFfallbacks\relax - -\fi - -%D These macros are written as generic as possible. Some -%D general support macro's are loaded from a small module -%D especially made for non \CONTEXT\ use. In this module I -%D use a matrix transformation macro written by Tanmoy -%D Bhattacharya. Thanks to extensive testing by Sebastian -%D Ratz I was able to complete this module within reasonable -%D time. This module has support for \METAPOST\ extensions -%D built in. -%D -%D Daniel H. Luecking came up with a better (more precise) -%D transformation method. You can recognize his comment by -%D his initials. (We keep the old code around because it's a -%D nice illustration on how a module like this evolves.) - -%D Beware, we cannot use \type{\zeropoint} here since it may be -%D defined in the range \type{\dimen0} - 20 which we happen to use -%D as scratch registers; inside context we may consider -%D using dedicated registers. - -%D This module handles some \PDF\ conversion and insertions -%D topics. By default, the macros use the \PDFTEX\ primitive -%D \type{\pdfliteral} when available. Since \PDFTEX\ is now the -%D default engine for \TEX\ distributions, we need a more complex -%D test. - -\unprotect - -\ifx\PDFcode\undefined - \ifx\pdfliteral\undefined - \def\PDFcode#1{\special{PDF: #1}} - \else\ifx\pdfoutput\undefined - \def\PDFcode#1{\special{PDF: #1}} - \else\ifcase\pdfoutput - \def\PDFcode#1{\special{PDF: #1}} - \else % pdftex as well as in pdf mode - \let\PDFcode\pdfliteral - \fi\fi\fi -\else - % we probably use context -\fi - -%D First we define a handy constant: - -\bgroup \defineMPtoPDFfallbacks \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup - -%D \macros -%D {pdfimage,pdfimages,pdfclippedimage} -%D -%D Starting with pdftex version 14, images are included more -%D natural to the form embedding. This enables alternative -%D images to be embedded. -%D -%D \starttyping -%D \pdfimage {file} -%D \pdfimages {high res file} {low res file} -%D \stoptyping -%D -%D The first one replaces the pre||version||14 original, -%D while the latter provides alternative images. -%D -%D The next macro is dedicated to Maarten Gelderman, who -%D needed to paste prepared \PDF\ pages into conference -%D proceedings. -%D -%D \starttyping -%D \pdfclippedimage {file} {l} {r} {t} {b} -%D \stoptyping - -\ifx\pdftexversion\undefined \else \ifnum\pdftexversion>13 - - \def\pdfimage#1#% - {\dopdfimage{#1}} - - \def\dopdfimage#1#2% - {\immediate\pdfximage#1{#2}% - \pdfrefximage\pdflastximage} - - \def\pdfimages#1#% - {\dopdfimages{#1}} - - \def\dopdfimages#1#2#3% - {\immediate\pdfximage#1{#2}% - \immediate\pdfobj{[ << /Image \the\pdflastximage\space0 R /DefaultForPrinting true >> ]}% - \immediate\pdfximage#1 attr {/Alternates \the\pdflastobj\space0 R}{#3}% - \pdfrefximage\pdflastximage} - - \def\pdfclippedimage#1#% specs {file}{left}{right}{top}{bottom} - {\dopdfclippedimage{#1}} - - \def\dopdfclippedimage#1#2#3#4#5#6% - {\bgroup - \pdfximage#1{#2}% - \setbox\scratchbox\hbox - {\pdfrefximage\pdflastximage}% - \hsize\wd\scratchbox - \advance\hsize -#3 - \advance\hsize -#4 - \vsize\ht\scratchbox - \advance\vsize -#5 - \advance\vsize -#6 - \setbox\scratchbox\vbox to \vsize - {\vskip-#5\hbox to \hsize{\hskip-#3\box\scratchbox\hss}}% - \pdfxform\scratchbox - \pdfrefxform\pdflastxform - \egroup} - -\fi \fi - -%D If you want to save a few hash entries, you may prefer the -%D less readable alternatives, like: -%D -%D \starttyping -%D \def\pdfimage#1#% This one is less readable but needs no additional -%D {\bgroup % hash entry for the second stage macro. -%D \def\pdfimage##1% -%D {\immediate\pdfximage##1{#2}% -%D \pdfrefximage\pdflastximage\egroup}} -%D \stoptyping - -%D For old times sake we provide a few aliases. These will be -%D removed some day. - -\ifx\pdftexversion\undefined \else \ifnum\pdftexversion>13 - - \let\pdfform =\pdfxform - \let\pdflastform=\pdflastxform - \let\pdfrefform =\pdfrefxform - -\fi \fi - -%D The main conversion macro wraps the \PDF\ codes in a box -%D that is output as an object. The graphics are embedded -%D in~\type{q} and~\type{Q} and are scaled and positioned using -%D one transform call (\type{cm}). This saves some additional -%D scaling. - -%D \macros -%D {convertMPtoPDF} -%D -%D The next set of macros implements \METAPOST\ to \PDF\ -%D conversion. Because we want to test as fast as possible, we -%D first define the \POSTSCRIPT\ operators that \METAPOST\ -%D uses. We don't define irrelevant ones, because these are -%D skipped anyway. - -%D The converter can be made a bit faster by replacing the -%D two test macros (the ones with the many \type {\if's}) by -%D a call to named branch macros (something \typ {\getvalue -%D {xPSmoveto}}. For everyday documents with relatively -%D small graphics the gain in speed can be neglected. - -\def \PScurveto {curveto} -\def \PSlineto {lineto} -\def \PSmoveto {moveto} -\def \PSshowpage {showpage} -\def \PSnewpath {newpath} -\def \PSfshow {fshow} -\def \PSclosepath {closepath} -\def \PSfill {fill} -\def \PSstroke {stroke} -\def \PSclip {clip} -\def \PSrlineto {rlineto} -\def \PSsetlinejoin {setlinejoin} -\def \PSsetlinecap {setlinecap} -\def \PSsetmiterlimit {setmiterlimit} -\def \PSsetgray {setgray} -\def \PSsetrgbcolor {setrgbcolor} -\def \PSsetcmykcolor {setcmykcolor} -\def \PSsetdash {setdash} -\def \PSgsave {gsave} -\def \PSgrestore {grestore} -\def \PStranslate {translate} -\def \PSscale {scale} -\def \PSconcat {concat} -\def \PSdtransform {dtransform} -\def \PSsetlinewidth {setlinewidth} -\def \PSpop {pop} - -\def \PSnfont {nfont} % was needed for TUG98 proceedings -\def \PSspecial {special} % extensions to MetaPost - -%D A previous version set \type {%} to ignore, which -%D simplified the following definitions. At the start of -%D conversion the percent character was made active again. -%D Because the whole graphic is one paragraph (there are no -%D empty lines) this does not give the desired effect. This -%D went unnoticed untill Scott Pakin sent me a test file -%D percent characters in a string. So, from now on we have -%D to prefix the following strings with percentages. - -%D Some day I'll figure out a better solution (line by line reading -%D using \ETEX). - -\edef \PSBoundingBox {\letterpercent\letterpercent BoundingBox:} -\edef \PSHiResBoundingBox {\letterpercent\letterpercent HiResBoundingBox:} -\edef \PSExactBoundingBox {\letterpercent\letterpercent ExactBoundingBox:} -\edef \PSMetaPostSpecial {\letterpercent\letterpercent MetaPostSpecial:} -\edef \PSMetaPostSpecials {\letterpercent\letterpercent MetaPostSpecials:} -\edef \PSPage {\letterpercent\letterpercent Page:} -\edef \PSBeginProlog {\letterpercent\letterpercent BeginProlog} -\edef \PSEndProlog {\letterpercent\letterpercent EndProlog} -\edef \PSEof {\letterpercent\letterpercent EOF} - -%D By the way, the \type {setcmykcolor} operator is not -%D output by \METAPOST\ but can result from converting the -%D \cap{RGB} color specifications, as implemented in -%D \type{supp-mps}. - -%D In \POSTSCRIPT\ arguments precede the operators. Due to the -%D fact that in some translations we need access to those -%D arguments, and also because sometimes we have to skip them, -%D we stack them up. The stack is one||dimensional for non path -%D operators and two||dimensional for operators inside a path. -%D This is because we have to save the whole path for -%D (optional) postprocessing. Values are pushed onto the stack -%D by: -%D -%D \starttyping -%D \setMPargument {value} -%D \stoptyping -%D -%D They can be retrieved by the short named macros: -%D -%D \starttyping -%D \gMPa {number} -%D \gMPs {number} -%D \stoptyping -%D -%D When scanning a path specification, we also save the -%D operator, using -%D -%D \starttyping -%D \setMPkeyword {n} -%D \stoptyping -%D -%D The path drawing operators are coded for speed: \type{clip}, -%D \type{stroke}, \type{fill} and \type{fillstroke} become -%D 1, 2, 3 and~4. -%D -%D When processing the path this code can be retrieved -%D using -%D -%D \starttyping -%D \getMPkeyword % {n} -%D \stoptyping -%D -%D When setting an argument, the exact position on the stack -%D depends on the current value of the \COUNTERS\ -%D \type{\nofMPsegments} and \type{\nofMParguments}. - -\newcount\nofMPsegments -\newcount\nofMParguments - -%D These variables hold the coordinates. The argument part of -%D the stack is reset by: -%D -%D \starttyping -%D \resetMPstack -%D \stoptyping -%D -%D We use the prefix \type{@@MP} to keep the stack from -%D conflicting with existing macros. To speed up things a bit -%D more, we use the constant \type{\@@MP}. - -\def\@@MP{@@MP} - -\def\setMPargument% #1% - {\advance\nofMParguments 1 - \expandafter\def - \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname} % {#1} - -\def\letMPargument - {\advance\nofMParguments 1 - \expandafter\let - \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname} - -\def\setMPsequence#1 % - {\advance\nofMParguments 1 - \expandafter\def - \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname{#1}% - \handleMPsequence} - -\def\gMPa#1% - {\csname\@@MP0\number#1\endcsname} - -\def\gMPs#1% - {\csname\@@MP\the\nofMPsegments\number#1\endcsname} - -\def\dogMPa#1% - {\expandafter\expandafter\expandafter\do\csname\@@MP0\number#1\endcsname} - -\def\setMPkeyword#1 % - {\expandafter\def\csname\@@MP\the\nofMPsegments0\endcsname{#1}% - \advance\nofMPsegments 1 - \nofMParguments0} - -\def\getMPkeyword% #1% - {\csname\@@MP\the\nofMPsegments0\endcsname} % {\csname\@@MP#10\endcsname} - -\def\docleanupMPargument#1% we need this because args can have [ or ] pre/appended - {\expandafter\edef\csname\@@MP\the\nofMPsegments\number#1\endcsname - {\csname\@@MP\the\nofMPsegments\number#1\endcsname}} - -%D When we reset the stack, we can assume that all further -%D comment is to be ignored and handled in strings. -%D By redefining the reset macro after the first call, we -%D save some run time. Only use this macro after all -%D comments are processed and use the simple alternative -%D when dealing with comments. - -\def\doresetMPstack - {\nofMParguments0\relax} - -\def\resetMPstack - {\let\handleMPgraphic\handleMPendgraphic - \let\resetMPstack\doresetMPstack - \resetMPstack} - -%D The arguments are saved with the preceding command -%D \type{\do}. By default this command expands to nothing, but -%D when we deal with strings it's used to strip off the -%D \type{(} and \type{)}. -%D -%D Strings are kind of tricky, because characters can be -%D passed verbatim \type{(hello)}, by octal number -%D \type{(\005)} or as command \type{(\()}. We therefore -%D cannot simply ignore \type{(} and \type{)}, the way we do -%D with \type{[} and \type{]}. Another complication is that -%D strings may contain characters that normally have a -%D special meaning in \TEX, like \type{$} and \type{{}}. -%D -%D A previous solution made \type{\} an active character and -%D let it look ahead for a number or characters. We had to -%D abandon this scheme because of the need for verbatim -%D support. The next solution involved some \CATCODE\ -%D trickery but works well. - -\def\octalMPcharacter#1#2#3% - {\char'#1#2#3\relax} - -%D curly braces and squarly brackets are stored in the argument stack -%D as part of strings, for instance in: -%D -%D \starttyping -%D /fshow {exch findfont exch scalefont setfont show}bind def -%D [3 3 ] 0 setdash -%D \stoptyping -%D -%D but we need to keep them in situation like -%D -%D \starttyping -%D ([bla bla] bla bla) ec-lmr10 9.96265 fshow -%D ({bla bla} bla bla) ec-lmr10 9.96265 fshow -%D \stoptyping -%D -%D So, when we store the snippets, we keep the special tokens, and -%D when needed we either ignore or obey them - -\bgroup -\defineMPtoPDFfallbacks -\catcode`\|=\@@comment -\catcode`\%=\@@active -\catcode`\[=\@@active -\catcode`\]=\@@active -\catcode`\{=\@@active -\catcode`\}=\@@active -\catcode`B=\@@begingroup -\catcode`E=\@@endgroup -\gdef\keepMPspecials| - B\let%\letterpercent| - \def[B\noexpand[E| - \def]B\noexpand]E| - \def{B\noexpand{E| - \def}B\noexpand}EE -\gdef\ignoreMPspecials| - B\let%\letterpercent| - \def[BE| - \def]BE| - \def{BE| - \def}BEE -\gdef\obeyMPspecials| - B\def%B\char 37\relax E| - \def[B\char 91\relax E| - \def]B\char 93\relax E| - \def{B\char123\relax E| - \def}B\char125\relax EE -\gdef\setMPspecials| - B\setnaturalcatcodes - \catcode`\\=\@@escape - \catcode`\%=\@@active - \catcode`\[=\@@active - \catcode`\]=\@@active - \catcode`\{=\@@active - \catcode`\}=\@@active - \lccode`\-=0 | latex sets this to `\- - \lccode`\%=`\% | otherwise it's seen as a number - \def\(B\char40\relax E| - \def\)B\char41\relax E| - \def\\B\char92\relax E| - \def\0B\octalMPcharacter0E| - \def\1B\octalMPcharacter1E| - \def\2B\octalMPcharacter2E| - \def\3B\octalMPcharacter3E| - \def\4B\octalMPcharacter4E| - \def\5B\octalMPcharacter5E| - \def\6B\octalMPcharacter6E| - \def\7B\octalMPcharacter7E| - \def\8B\octalMPcharacter8E| - \def\9B\octalMPcharacter9EE -\egroup - -%D We use the comment symbol as a sort of trigger. Beware! -%D The whole graphic is seen as on eparagraph, which means -%D that we cannot change the catcodes in between. - -\bgroup -\defineMPtoPDFfallbacks -\catcode`\%=\@@active -\gdef\startMPscanning{\let%=\startMPconversion} -\egroup - -%D In earlier versions we used the sequence -%D -%D \starttyping -%D \expandafter\handleMPsequence\input filename\relax -%D \stoptyping -%D -%D Persistent problems in \LATEX\ however forced us to use a -%D different scheme. Every \POSTSCRIPT\ file starts with a -%D \type{%}, so we temporary make this an active character -%D that starts the scanning and redefines itself. (The problem -%D originates in the redefinition by \LATEX\ of the -%D \type{\input} primitive.) - -\def\startMPconversion - {\keepMPspecials - \handleMPsequence} - -%D Here comes the main loop. Most arguments are numbers. This -%D means that they can be recognized by their \type{\lccode}. -%D This method saves a lot of processing time. We could -%D speed up the conversion by handling the \type{path} -%D seperately. - -\def\dohandleMPsequence#1% - {\ifdone - \ifcase\lccode`#1\relax - \expandafter\expandafter\expandafter\dohandleMPsequenceA - \else - \expandafter\expandafter\expandafter\dohandleMPsequenceB - \fi - \else - \expandafter\dohandleMPsequenceC - \fi#1} - -\let\dohandleMPsequenceA\setMPsequence - -\def\installMPSkeywordN#1#2% - {\expandafter\def\csname\@@MP:N:#1\endcsname{#2}} - -\def\installMPSshortcutN#1#2% todo: \let - {\expandafter\let\csname\@@MP:N:#1\expandafter\endcsname\csname\@@MP:N:#2\endcsname} - -\def\dohandleMPsequenceB#1 % - {\edef\somestring{#1}% - \ifcsname\@@MP:N:\somestring\endcsname - \csname\@@MP:N:\somestring\expandafter\endcsname - \else - \expandafter\handleMPgraphic - \fi - \handleMPsequence} - -\ifx\eTeXversion\undefined - \def\dohandleMPsequenceB#1 % - {\edef\somestring{#1}% - \expandafter\ifx\csname\@@MP:N:\somestring\endcsname\relax - \expandafter\handleMPgraphic - \else - \csname\@@MP:N:\somestring\expandafter\endcsname - \fi - \handleMPsequence} -\fi - -\installMPSkeywordN \PSmoveto - {\edef\lastMPmoveX{\gMPa1}% - \edef\lastMPmoveY{\gMPa2}% - \resetMPstack} -\installMPSkeywordN \PSnewpath - {\let\handleMPsequence\handleMPpath} -\installMPSkeywordN \PSgsave - {\PDFcode{q}% - \resetMPstack} -\installMPSkeywordN \PSgrestore - {\PDFcode{Q}% - \resetMPstack} -\installMPSkeywordN \PSdtransform % == setlinewidth - {\let\handleMPsequence\handleMPdtransform} - % after that we will encounter more tokens until setlinewidth+pop - % or pop+setlinewidth which we catch next; we explicitly need to - % reset the stack since [] n setdash may follow; a more clever - % approach would be to read on till the condition is met, but it's - % the only pop / setlinewidth we will encounter so ... -\installMPSkeywordN \PSsetlinewidth - {% already handled in dtransform - \resetMPstack} -\installMPSkeywordN \PSpop - {% already handled in dtransform - \resetMPstack} -\installMPSkeywordN \PSconcat - {\cleanupMPconcat - \PDFcode{\gMPa1 \gMPa2 \gMPa3 \gMPa4 \gMPa5 \gMPa6 cm}% - \resetMPstack} -\installMPSkeywordN \PSsetrgbcolor - {\handleMPrgbcolor - \resetMPstack} -\installMPSkeywordN \PSsetcmykcolor - {\handleMPcmykcolor - \resetMPstack} -\installMPSkeywordN \PSsetgray - {\handleMPgraycolor - \resetMPstack} -\installMPSkeywordN \PStranslate - {\PDFcode{1 0 0 1 \gMPa1 \gMPa2 cm}% - \resetMPstack} -\installMPSkeywordN \PSsetdash - {\handleMPsetdash - \resetMPstack} -\installMPSkeywordN \PSsetlinejoin - {\PDFcode{\gMPa1 j}% - \resetMPstack} -\installMPSkeywordN \PSsetmiterlimit - {\PDFcode{\gMPa1 M}% - \resetMPstack} -\installMPSkeywordN \PSfshow - {%\PDFcode{n}% removed ! - \handleMPfshow - \resetMPstack} -\installMPSkeywordN \PSsetlinecap - {\PDFcode{\gMPa1 J}% - \resetMPstack} -\installMPSkeywordN \PSrlineto - {\flushMPmoveto - \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}% - \resetMPmoveto - \resetMPstack} -\installMPSkeywordN \PSscale - {\PDFcode{\gMPa1 0 0 \gMPa2 0 0 cm}% - \resetMPstack} -\installMPSkeywordN \PSspecial - {\handleMPspecialcommand - \resetMPstack} - -\installMPSshortcutN {n} \PSnewpath -\installMPSshortcutN {p} \PSclosepath -\installMPSshortcutN {l} \PSlineto -\installMPSshortcutN {r} \PSrlineto -\installMPSshortcutN {m} \PSmoveto -\installMPSshortcutN {c} \PScurveto -\installMPSshortcutN {C} \PSsetcmykcolor -\installMPSshortcutN {G} \PSsetgray -\installMPSshortcutN {R} \PSsetrgbcolor -\installMPSshortcutN {lj} \PSsetlinejoin -\installMPSshortcutN {ml} \PSsetmiterlimit -\installMPSshortcutN {lc} \PSsetlinecap -\installMPSshortcutN {sd} \PSsetdash -\installMPSshortcutN {S} \PSstroke -\installMPSshortcutN {F} \PSfill -\installMPSshortcutN {W} \PSclip - -\installMPSshortcutN {q} \PSgsave -\installMPSshortcutN {Q} \PSgrestore - -\installMPSshortcutN {s} \PSscale -\installMPSshortcutN {t} \PSconcat -\installMPSshortcutN {P} \PSshowpage - -\installMPSkeywordN {hlw} {\PDFcode{\gMPa1 w}\resetMPstack} -\installMPSkeywordN {vlw} {\PDFcode{\gMPa1 w}\resetMPstack} -\installMPSkeywordN {rd} {\PDFcode{[] 0 d}\resetMPstack} - -\def\dohandleMPsequenceC#1 % - {\edef\somestring{#1}% - \handleMPgraphic % {#1}% - \handleMPsequence} - -%D Since colors are not sensitive to transformations, they -%D are sometimes used for signaling. Therefore, we handle them -%D separately. The next macro can be redefined if needed. - -\def\handleMPrgbcolor - {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 rg - \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 RG}} - -\def\handleMPcmykcolor - {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 k - \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 K}} - -\def\handleMPgraycolor - {\PDFcode{\!MPgMPa1 g - \!MPgMPa1 G}} - -\def\handleMPspotcolor - {\PDFcode{0 g - 0 G}} - -%D Beginning and ending the graphics is taken care of by the -%D macro \type{\handleMPgraphic}, which is redefined when -%D the first graphics operator is met. - -\def\handleMPendgraphic % #1% - {\ifx\somestring\PSshowpage - \let\handleMPsequence\finishMPgraphic - \else\ifx\somestring\PSEof - \let\handleMPsequence\finishMPgraphic - \else - \letMPargument\somestring % {#1}% - \fi\fi} - -\def\handleMPbegingraphic % #1% - {\ifx\somestring\PSBoundingBox - \def\handleMPsequence{\handleMPboundingbox1}% - \else\ifx\somestring\PSHiResBoundingBox - \def\handleMPsequence{\handleMPboundingbox2}% - \else\ifx\somestring\PSExactBoundingBox - \def\handleMPsequence{\handleMPboundingbox3}% - \else\ifx\somestring\PSshowpage - \let\handleMPsequence\finishMPgraphic - \else\ifx\somestring\PSEof - \let\handleMPsequence\finishMPgraphic - \else\ifx\somestring\PSPage - \let\handleMPsequence\handleMPpage - \else\ifx\somestring\PSMetaPostSpecials - \let\handleMPsequence\handleMPspecialscomment - \else\ifx\somestring\PSMetaPostSpecial - \let\handleMPsequence\handleMPspecialcomment - \else\ifx\somestring\PSBeginProlog - \let\handleMPsequence\handleMPprolog - \else - \letMPargument\somestring % {#1}% - \fi\fi\fi\fi\fi\fi\fi\fi\fi} - -\let\handleMPgraphic=\handleMPbegingraphic - -%D New: we can best filter the prolog because nowdays it can contain -%D quite some code. - -% hm, catcode mess, so we need to tweak %'s catcode here -% \long\expandafter\def\expandafter\handleMPprolog\expandafter#\expandafter1\PSEndProlog% -% but today i'm not in the mood for ugly stuff - -\long\def\handleMPprolog#1EndProlog % - {\doresetMPstack - \let\handleMPsequence\dohandleMPsequence - \handleMPsequence} - -%D We check for three kind of bounding boxes: the normal one -%D and two high precision ones: -%D -%D \starttyping -%D BoundingBox: llx lly ucx ucy -%D HiResBoundingBox: llx lly ucx ucy -%D ExactBoundingBox: llx lly ucx ucy -%D \stoptyping -%D -%D The original as well as the recalculated dimensions are -%D saved for later use. - -\newif\ifskipemptyMPgraphic \skipemptyMPgraphicfalse - -\chardef\currentMPboundingbox=0 - -\def\handleMPboundingbox#1#2 #3 #4 #5 - {\ifnum#1>\currentMPboundingbox - \xdef\MPllx{#2}\xdef\MPlly{#3}% - \xdef\MPurx{#4}\xdef\MPury{#5}% - \dimen0=#2pt - \dimen0=-\MPxscale\dimen0 - \dimen2=#3pt - \dimen2=-\MPyscale\dimen2 - \xdef\MPxoffset{\withoutpt\the\dimen0}% - \xdef\MPyoffset{\withoutpt\the\dimen2}% - \dimen0=#2bp - \dimen0=-\dimen0 - \dimen2=#3bp - \dimen2=-\dimen2 - \advance\dimen0 #4bp - \dimen0=\MPxscale\dimen0 - \xdef\MPwidth{\the\dimen0}% - \advance\dimen2 #5bp - \xdef\MPyshift{\the\dimen2}% unscaled - \dimen2=\MPyscale\dimen2 - \xdef\MPheight{\the\dimen2}% - \chardef\currentMPboundingbox#1\relax - \fi - \doresetMPstack - \let\handleMPsequence\dohandleMPsequence - \let\next\handleMPsequence - \ifskipemptyMPgraphic - \ifdim\MPheight=0pt\relax\ifdim\MPwidth=0pt\relax - \def\next{\endinput\finishMPgraphic}% - \fi\fi - \fi - \next} - -%D Unless defined otherwise, we simply ignore specialcomments. - -\def\handleMPspecialcomment - {\doresetMPstack - \let\handleMPsequence\dohandleMPsequence - \handleMPsequence} - -\let\handleMPspecialscomment\handleMPspecialcomment - -%D We use the \type{page} comment as a signal that -%D stackbuilding can be started. - -\def\handleMPpage #1 #2 - {\doresetMPstack - \donetrue - \let\handleMPsequence\dohandleMPsequence - \handleMPsequence} - -%D The same applies to the special extensions. - -\def\handleMPspecialcommand - {\doresetMPstack - \let\handleMPsequence\dohandleMPsequence - \handleMPsequence} - -%D \METAPOST\ draws its dots by moving to a location and -%D invoking \type{0 0 rlineto}. This operator is not -%D available in \PDF. Our solution is straightforward: we draw -%D a line from $(current\_x, current\_y)$ to itself. This -%D means that the arguments of the preceding \type{moveto} have -%D to be saved. - -\def\lastMPmoveX{0} -\def\lastMPmoveY{0} - -%D These saved coordinates are also used when we handle the -%D texts. Text handling proved to be a bit of a nuisance, but -%D finally I saw the light. It proved that we also had to -%D take care of \type{(split arguments)}. - -% \def\setMPfshowfont#1#2% -% {\font\temp=#1\space at #2\relax\temp} - -% \startMPcode -% draw btex Ga toch effe f\kern0ptietsen?{}` etex ; -% \stopMPcode - -\newtoks \everyMPshowfont - -\def\setMPfshowfont#1#2% - {\font\temp=#1\space at #2\relax\temp - \the\everyMPshowfont} - -\let\MPfshowcommand\empty - -%D The next hackery handles characters one by one. We only support this -%D for the latest greatest \METAPOST\ binaries, the ones that escape -%D problematic chars. - -\def\doflushMPtext#1% - {\edef\!!stringa{#1}% - \expandafter\dodoflushMPtext\!!stringa\relax} - -\def\dodoflushMPtext - {\afterassignment\dododoflushMPtext\let\nexttoken=} - -\def\dododoflushMPtext - {\ifx\nexttoken\relax - % done - \else\ifx\nexttoken\char - \expandafter\expandafter\expandafter\dodododoflushMPtext - \else - {\nexttoken}% - \expandafter\expandafter\expandafter\dodoflushMPtext - \fi\fi} - -\def\dodododoflushMPtext - {\afterassignment\dododododoflushMPtext\scratchcounter} - -\def\dododododoflushMPtext - {{\char\scratchcounter}\let\next\dodoflushMPtext} - -\def\dohandleMPfshow - {\bgroup - \setbox\scratchbox\hbox - {\obeyMPspecials - \let\ \relax % mp breaks long lines and appends a \ - \edef\size{\gMPa\nofMParguments}% - \ifx\size\PSnfont % round font size (to pt) - \advance\nofMParguments -1 - \expandafter\scratchdimen\gMPa\nofMParguments pt\relax - \ifdim\scratchdimen<1pt - \def\size{1pt}% - \else - \advance\scratchdimen .5pt - \def\size##1.##2\relax{\def\size{##1pt}}% - \expandafter\size\the\scratchdimen\relax - \fi - \else - \edef\size{\size bp}% - \fi - \advance\nofMParguments -1 - %\font\temp=\gMPa\nofMParguments\space at \size - \let\temp\relax % to be sure - \setMPfshowfont{\gMPa\nofMParguments}\size - \advance\nofMParguments -1 - \temp - \MPfshowcommand - {\ifnum\nofMParguments=1 - \def\do(##1){##1}% - \doflushMPtext{\dogMPa1}% only latest mp gets this treatment - \else - % we need to catch ( a ) (a a a) (\123 \123 \123) etc - \scratchcounter1 - \def\dodo##1% Andreas Fieger's bug: (\304...) - {\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11 - \ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}% - \def\do(##1{\dodo{##1}}% - \dogMPa\scratchcounter\MPspacechar - \let\do\relax - \loop - \advance\scratchcounter 1 - \ifnum\scratchcounter<\nofMParguments\relax - \gMPa\scratchcounter\MPspacechar - \repeat - \def\do##1){\dodo{##1}}% - \dogMPa\scratchcounter - \fi - \unskip}}% - \setbox\scratchbox\hbox - {\hskip\lastMPmoveX bp\raise\lastMPmoveY bp\box\scratchbox}% - \ht\scratchbox0pt% - \dp\scratchbox0pt% - \wd\scratchbox0pt% - \box\scratchbox - \egroup} - -\let\handleMPfshow\dohandleMPfshow % so we can overload this one later - -%D You could consider the following definition to be the most -%D natural one. - -% \def\MPspacechar{\space} % normal case - -\def\MPspacechar{\char32\relax} % old solution does not work with math - -%D However, the following implementation is more robust, since -%D some fonts have funny visible spaces in the space slot. This -%D gives a mismatch between the space that \METAPOST\ took into -%D account and the \quote {natural} space. This only happens in -%D labels, since \type {btex}||\type {etex} thingies don't have -%D spaces. This phenomena showed up when preparing the -%D \METAFUN\ manual, where Palatino fonts are used. We can -%D safely assume that \METAPOST\ considers \type {\char32} to -%D be the space. - -\def\MPspacechar{\setbox\scratchbox\hbox{\char32}\kern\wd\scratchbox} - -%D Well, this does not work with math fonts, so: - -\def\MPspacechar{\char32\relax} - -%D Most operators are just converted and keep their -%D arguments. Dashes however need a bit different treatment, -%D otherwise \PDF\ viewers complain loudly. Another -%D complication is that one argument comes after the \type{]}. -%D When reading the data, we simply ignore the array boundary -%D characters. We save ourselves some redundant newlines and -%D at the same time keep the output readable by packing the -%D literals. - -\def\handleMPsetdash - {\bgroup - \ignoreMPspecials - \def\somestring{[}% - \scratchcounter1 - \loop - \ifnum\scratchcounter<\nofMParguments - \edef\somestring{\somestring\space\gMPa\scratchcounter}% - \advance\scratchcounter 1 - \repeat - \edef\somestring{\somestring]\gMPa\scratchcounter\space d}% - \PDFcode{\somestring}% - \egroup} - -%D The \type{setlinewidth} commands looks a bit complicated. There are -%D two alternatives, that result in a similar look in both -%D $x$- and $y$-dorection. As John Hobby says: -%D -%D \startnarrower \switchtobodyfont[ss] -%D \starttyping -%D x 0 dtransform exch truncate exch idtransform pop setlinewidth -%D 0 y dtransform truncate idtransform setlinewidth pop -%D \stoptyping -%D -%D These are just fancy versions of \type{x setlinewidth} and -%D \type{y setlinewidth}. The \type{x 0 ...} form is used if -%D the path is {\em primarily vertical}. It rounds the width -%D so that vertical lines come out an integer number of pixels -%D wide in device space. The \type{0 y ...} form does the same -%D for paths that are {\em primarily horizontal}. The reason -%D why I did this is Knuth insists on getting exactly the -%D widths \TEX\ intends for the horizontal and vertical rules -%D in \type{btex...etex} output. (Note that PostScript scan -%D conversion rules cause a horizontal or vertical line of -%D integer width $n$ in device space to come out $n+1$ pixels -%D wide, regardless of the phase relative to the pixel grid.) -%D \stopnarrower -%D -%D The common operator in these sequences is \type{dtransform}, -%D so we can use this one to trigger setting the linewidth. - -\def\handleMPdtransform - {\ifdim\gMPa1 pt>0pt - \PDFcode{\gMPa1 w}% - \def\next##1 ##2 ##3 ##4 ##5 ##6 {\handleMPsequence}% - \else - \PDFcode{\gMPa2 w}% - \def\next##1 ##2 ##3 ##4 {\handleMPsequence}% - \fi - \let\handleMPsequence\dohandleMPsequence - \resetMPstack - \next} - -%D The most complicated command is \type{concat}. \METAPOST\ -%D applies this operator to \type{stroke}. At that moment the -%D points set by \type{curveto} and \type{moveto}, are already -%D fixed. In \PDF\ however the \type{cm} operator affects the -%D points as well as the pen (stroke). Like more \PDF\ -%D operators, \type{cm} is defined in a bit ambiguous way. -%D The only save route for non||circular penshapes, is saving -%D the path, recalculating the points and applying the -%D transformation matrix in such a way that we can be sure -%D that its behavior is well defined. This comes down to -%D inverting the path and applying \type{cm} to that path as -%D well as the pen. This all means that we have to save the -%D path. - -%D In \METAPOST\ there are three ways to handle a path $p$: -%D -%D \starttyping -%D draw p; fill p; filldraw p; -%D \stoptyping -%D -%D The last case outputs a \type{gsave fill grestore} before -%D \type{stroke}. Handling the path outside the main loops -%D saves about 40\% run time.\footnote{We can save some more by -%D following the \METAPOST\ output routine, but for the moment -%D we keep things simple.} Switching between the main loop and -%D the path loop is done by means of the recursely called -%D macro \type{\handleMPsequence}. - -\def\handleMPpath - {\chardef\finiMPpath0 - \let\closeMPpath\relax - \let\flushMPpath\flushnormalMPpath - \resetMPstack - \nofMPsegments1 - \let\handleMPsequence\dohandleMPpath - \dohandleMPpath} - -%D Most paths are drawn with simple round pens. Therefore we've -%D split up the routine in two. - -\def\flushnormalMPsegment - {\ifcase\getMPkeyword\relax - \PDFcode{\!MPgMPs1 \!MPgMPs2 l}% - \or - \PDFcode{\!MPgMPs1 \!MPgMPs2 \!MPgMPs3 \!MPgMPs4 \!MPgMPs5 \!MPgMPs6 c}% - \or - \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l}% - \or - \edef\lastMPmoveX{\gMPs1}% evt \!MP here - \edef\lastMPmoveY{\gMPs2}% - \PDFcode{\!MP\lastMPmoveX\space \!MP\lastMPmoveY\space m}% - \fi} - -\def\flushconcatMPsegment - {\ifcase\getMPkeyword\relax - \doMPconcat{\gMPs1}\a{\gMPs2}\b% - \PDFcode{\!MP\a\space\!MP\b\space l}% - \or - \doMPconcat{\gMPs1}\a{\gMPs2}\b% - \doMPconcat{\gMPs3}\c{\gMPs4}\d% - \doMPconcat{\gMPs5}\e{\gMPs6}\f% - \PDFcode{\!MP\a\space\!MP\b\space - \!MP\c\space\!MP\d\space - \!MP\e\space\!MP\f\space c}% - \or - \bgroup - \noMPtranslate - \doMPconcat\lastMPmoveX\a\lastMPmoveY\b% - \PDFcode{\!MP\a\space\!MP\b\space l S}% - \egroup - \or - \edef\lastMPmoveX{\gMPs1}% - \edef\lastMPmoveY{\gMPs2}% - \doMPconcat\lastMPmoveX\a\lastMPmoveY\b% - \PDFcode{\!MP\a\space\!MP\b\space m}% - \fi} - -% \def\flushnormalMPpath -% {\scratchcounter\nofMPsegments -% \nofMPsegments 1 -% \loop -% \flushnormalMPsegment -% \advance\nofMPsegments 1 -% \ifnum\nofMPsegments<\scratchcounter -% \repeat} -% -% \def\flushconcatMPpath -% {\scratchcounter\nofMPsegments -% \nofMPsegments 1 -% \loop -% \flushconcatMPsegment -% \advance\nofMPsegments 1 -% \ifnum\nofMPsegments<\scratchcounter -% \repeat} -% -% an alternative is presented below: (no \def assignment) - -\def\doflushsomeMPpath - {\dodoflushsomeMPpath - \advance\nofMPsegments 1 - \ifnum\nofMPsegments<\scratchcounter - \expandafter\doflushsomeMPpath - \fi} - -\def\flushsomeMPpath - {\scratchcounter\nofMPsegments - \nofMPsegments 1 - \doflushsomeMPpath} - -\def\flushnormalMPpath{\let\dodoflushsomeMPpath\flushnormalMPsegment\flushsomeMPpath} - -%OLD \def\flushconcatMPpath{\let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath} - -%NEW pre-calculate 1/D so it needn't be repeated for each control point. - -\def\flushconcatMPpath - {\MPreciprocaldeterminant - \let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath} - -%D The transformation of the coordinates is handled by one of -%D the macros Tanmoy posted to the \PDFTEX\ mailing list. -%D I rewrote and optimized the original macro to suit the other -%D macros in this module. -%D -%D \starttyping -%D \doMPconcat {x position} \xresult {y position} \yresult -%D \stoptyping -%D -%D By setting the auxiliary \DIMENSIONS\ \type{\dimen0} upto -%D \type{\dimen10} only once per path, we save over 20\% run -%D time. Some more speed was gained by removing some parameter -%D passing. These macros can be optimized a bit more by using -%D more constants. There is however not much need for further -%D optimization because penshapes usually are round and -%D therefore need no transformation. Nevertheless we move the -%D factor to the outer level and use a bit different \type{pt} -%D removal macro. Although the values represent base points, -%D we converted them to pure points, simply because those can -%D be converted back. - -%OLD \mathchardef\MPconcatfactor=256 % beware don't remove spaces before it - -%OLD \def\doMPreducedimen#1 -%OLD {\count0\MPconcatfactor -%OLD \advance\dimen#1 \ifdim\dimen#1>0pt .5\else -.5\fi\count0 -%OLD \divide\dimen#1 \count0\relax} - -%OLD % too inaccurate (see old pragma logo) -%OLD -%OLD \def\doMPreducedimen#1 -%OLD {\count0=\MPconcatfactor -%OLD \divide\dimen#1 \count0\relax} - -%OLD \def\doMPreducedimen#1 -%OLD {\advance\dimen#1 \ifdim\dimen#1>0pt .5\else -.5\fi\MPconcatfactor -%OLD \divide\dimen#1 \MPconcatfactor} - -%D The transformation code is rewritten by Daniel H. Luecking who -%D describes his patch as follows: -%D -%D We would like to divide 1 by $X$, but all divisions are integer so -%D for accuracy we want to convert to large integers and make sure the -%D integer quotient has as many significant digits as possible. Thus we -%D need to replace $1/X$ with $M/N$ where $N$ is as large as possible -%D and $M/N$ is as large as possible. Also for simplicity $M$ should be -%D a power of 2. So we make $M = 2^{30}$ \footnote{$2^{31} - 1$ is the -%D largest legal integer. Using it (and simply ignoring the inaccuracy -%D caused by $-1$) turns out to be at least as accurate in all cases, -%D and more accurate in some.} (largest legal power of 2) and adjust -%D $X$ downward (if necessary) to the the range $1-2^{16}$. This gives -%D at least 15 significant binary digits, (almost as accurate as -%D \METAPOST\ for numbers near 1) or almost 5 significant figures -%D (decimal). - -\newcount\MPscratchCnt -\newdimen\MPscratchDim % will be assigned global - -\def\MPadjustdimen % sets \MPscratchDim and \MPscratchCnt - {\MPscratchCnt0 - \doMPadjustdimen} - -\def\doMPadjustdimen - {\ifdim\MPscratchDim>1pt - \divide\MPscratchDim 2 - \advance\MPscratchCnt 1 - \expandafter\doMPadjustdimen - \fi} - -%OLD \def\doMPexpanddimen#1 -%OLD {\multiply\dimen#1 \MPconcatfactor\relax} - -%D DHL: When viewed as an integer, $1 \hbox{pt}=2^{16}$ so $2^{32}/X$ -%D is the right way to do $(1 \hbox{pt})/(X \hbox{pt})$ and get the -%D answer in points. But we are limited to $2^{30}/X$. However, we -%D actually do $[ 2^{30} / (X/2^K) ]*2^{2-K}$ where $K$ is the number -%D of halvings it takes to bring $X$ below $1 \hbox{pt}$. If $K$ is 0 -%D or 1 we readjust by multiplying by 4 or 2, otherwise by halving -%D $(K-2)$ times \type {\MPscratchCnt} holds the value of $K$ from -%D \type {\MPadjustdimen}. - -\def\MPreadjustdimen % acts on \MPscratchDim and MPscratchCnt - {\ifcase\MPscratchCnt - \multiply\scratchdimen 4 - \or - \multiply\scratchdimen 2 - \else - \expandafter\doMPreadjustdimen - \fi} - -\def\doMPreadjustdimen - {\ifnum\MPscratchCnt>2 - \divide\scratchdimen 2 - \advance\MPscratchCnt -1 - \expandafter\doMPreadjustdimen - \fi} - -\def\MPreciprocaldeterminant - {\scratchdimen\withoutpt\the\dimen0 \dimen6 % s_x*s_y - \advance\scratchdimen - \withoutpt\the\dimen2 \dimen4 % s_x*s_y - r_x*r_y - \ifdim\scratchdimen<0pt % we need a positive dimension - \scratchdimen-\scratchdimen % for \MPadjustdimen (?) - \doMPreciprocal - \scratchdimen-\scratchdimen - \else - \doMPreciprocal - \fi - \edef\MPreciprocal{\withoutpt\the\scratchdimen}} - -\newcount\MPnumerator \MPnumerator = 1073741824 % 2^{30} - -% todo: dimexpr - -\def\doMPreciprocal % replace \scratchdimen with its reciprocal - {\ifdim\scratchdimen=1pt \else - \MPadjustdimen - \scratchcounter\MPnumerator - \divide\scratchcounter\scratchdimen - \scratchdimen1\scratchcounter % 1 needed ! - \MPreadjustdimen - \fi} - -%OLD \def\presetMPconcat -%OLD {\dimen 0=\gMPs1pt \doMPreducedimen 0 % r_x -%OLD \dimen 2=\gMPs2pt \doMPreducedimen 2 % s_x -%OLD \dimen 4=\gMPs3pt \doMPreducedimen 4 % s_y -%OLD \dimen 6=\gMPs4pt \doMPreducedimen 6 % r_y -%OLD \dimen 8=\gMPs5pt \doMPreducedimen 8 % t_x -%OLD \dimen10=\gMPs6pt \doMPreducedimen10 } % t_y -%OLD -%OLD \def\presetMPscale -%OLD {\dimen 0=\gMPs1pt \doMPreducedimen 0 -%OLD \dimen 2=0pt -%OLD \dimen 4=0pt -%OLD \dimen 6=\gMPs2pt \doMPreducedimen 6 -%OLD \dimen 8=0pt -%OLD \dimen10=0pt} - -\def\cleanupMPconcat - {\ignoreMPspecials - \docleanupMPargument1% - \docleanupMPargument6% - \keepMPspecials} - -\def\presetMPconcat - {\dimen 0=\gMPs1pt % s_x - \dimen 2=\gMPs2pt % r_x - \dimen 4=\gMPs3pt % r_y - \dimen 6=\gMPs4pt % s_y - \dimen 8=\gMPs5pt % t_x - \dimen10=\gMPs6pt} % t_y - -\def\presetMPscale - {\dimen 0=\gMPs1pt - \dimen 2=0pt - \dimen 4=0pt - \dimen 6=\gMPs2pt - \dimen 8=0pt - \dimen10=0pt} - -\def\noMPtranslate % use this one grouped - {\dimen 8=0pt % t_x - \dimen10=0pt} % t_y - -%D \starttyping -%D \def\doMPconcat#1#2#3#4% -%D {\dimen12=#1 pt \doMPreducedimen12 % p_x -%D \dimen14=#3 pt \doMPreducedimen14 % p_y -%D % -%D \dimen16 \dimen 0 -%D \multiply \dimen16 \dimen 6 -%D \dimen20 \dimen 2 -%D \multiply \dimen20 \dimen 4 -%D \advance \dimen16 -\dimen20 -%D % -%D \dimen18 \dimen12 -%D \multiply \dimen18 \dimen 6 -%D \dimen20 \dimen14 -%D \multiply \dimen20 \dimen 4 -%D \advance \dimen18 -\dimen20 -%D \dimen20 \dimen 4 -%D \multiply \dimen20 \dimen10 -%D \advance \dimen18 \dimen20 -%D \dimen20 \dimen 6 -%D \multiply \dimen20 \dimen 8 -%D \advance \dimen18 -\dimen20 -%D % -%D \multiply \dimen12 -\dimen 2 -%D \multiply \dimen14 \dimen 0 -%D \advance \dimen12 \dimen14 -%D \dimen20 \dimen 2 -%D \multiply \dimen20 \dimen 8 -%D \advance \dimen12 \dimen20 -%D \dimen20 \dimen 0 -%D \multiply \dimen20 \dimen10 -%D \advance \dimen12 -\dimen20 -%D % -%D \doMPreducedimen16 -%D \divide \dimen18 \dimen16 \doMPexpanddimen18 -%D \divide \dimen12 \dimen16 \doMPexpanddimen12 -%D % -%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime -%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime -%D \stoptyping - -%D The following optimization resulted from some tests by -%D and email exchanges with Sanjoy Mahajan. -%D -%D \starttyping -%D \def\doMPconcat#1#2#3#4% -%D {\dimen12=#1 pt \doMPreducedimen12 % p_x -%D \dimen14=#3 pt \doMPreducedimen14 % p_y -%D % -%D \dimen16 \dimen 0 -%D \multiply \dimen16 \dimen 6 -%D \dimen20 \dimen 2 -%D \multiply \dimen20 \dimen 4 -%D \advance \dimen16 -\dimen20 -%D % -%D \dimen18 \dimen12 -%D \multiply \dimen18 \dimen 6 -%D \dimen20 \dimen14 -%D \multiply \dimen20 \dimen 4 -%D \advance \dimen18 -\dimen20 -%D \dimen20 \dimen 4 -%D \multiply \dimen20 \dimen10 -%D \advance \dimen18 \dimen20 -%D \dimen20 \dimen 6 -%D \multiply \dimen20 \dimen 8 -%D \advance \dimen18 -\dimen20 -%D % -%D \multiply \dimen12 -\dimen 2 -%D \multiply \dimen14 \dimen 0 -%D \advance \dimen12 \dimen14 -%D \dimen20 \dimen 2 -%D \multiply \dimen20 \dimen 8 -%D \advance \dimen12 \dimen20 -%D \dimen20 \dimen 0 -%D \multiply \dimen20 \dimen10 -%D \advance \dimen12 -\dimen20 -%D % -%D %\ifdim\dimen16>1pt % oeps, can be < 1pt too -%D \ifdim\dimen16=1pt \else -%D \ifdim\dimen16>\MPconcatfactor pt -%D \doMPreducedimen16 -%D \divide \dimen18 \dimen16 \doMPexpanddimen18 -%D \divide \dimen12 \dimen16 \doMPexpanddimen12 -%D \else -%D \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18 -%D \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12 -%D \fi -%D \fi -%D % -%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime -%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime -%D \stoptyping -%D -%D But, this one is still too inaccurate, so we now have: - -% \def\doMPconcat#1#2#3#4% -% {\dimen12=#1pt % p_x -% \dimen14=#3pt % p_y -% % -% % we should test for >-1024 too, but for the moment take the gamble -% \chardef\MPfactor1\ifdim\dimen12<1024pt \ifdim\dimen14<1024pt 6\fi\fi -% % -% \multiply\dimen12 \MPfactor -% \multiply\dimen14 \MPfactor -% % -% \doMPreducedimen12 -% \doMPreducedimen14 -% % -% \dimen16 \dimen 0 -% \multiply \dimen16 \dimen 6 -% \dimen20 \dimen 2 -% \multiply \dimen20 \dimen 4 -% \advance \dimen16 -\dimen20 -% % -% \dimen18 \dimen12 -% \multiply \dimen18 \dimen 6 -% \dimen20 \dimen14 -% \multiply \dimen20 \dimen 4 -% \advance \dimen18 -\dimen20 -% \dimen20 \dimen 4 -% \multiply \dimen20 \dimen10 -% \advance \dimen18 \dimen20 -% \dimen20 \dimen 6 -% \multiply \dimen20 \dimen 8 -% \advance \dimen18 -\dimen20 -% % -% \multiply \dimen12 -\dimen 2 -% \multiply \dimen14 \dimen 0 -% \advance \dimen12 \dimen14 -% \dimen20 \dimen 2 -% \multiply \dimen20 \dimen 8 -% \advance \dimen12 \dimen20 -% \dimen20 \dimen 0 -% \multiply \dimen20 \dimen10 -% \advance \dimen12 -\dimen20 -% % -% \ifdim\dimen16=1pt \else -% \ifdim\dimen16>\MPconcatfactor pt -% \doMPreducedimen16 -% \divide \dimen18 \dimen16 \doMPexpanddimen18 -% \divide \dimen12 \dimen16 \doMPexpanddimen12 -% \else -% \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18 -% \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12 -% \fi -% \fi -% % -% \divide\dimen18 \MPfactor -% \divide\dimen12 \MPfactor -% % -% \edef#2{\withoutpt\the\dimen18}% % p_x^\prime -% \edef#4{\withoutpt\the\dimen12}} % p_y^\prime - -%D DHL: Ideally, $r_x$, $r_y$, $s_x$, $s_y$ should be in macros, not -%D dimensions (they are scalar quantities after all, not lengths). I -%D suppose the authors decided to do calculations with integer -%D arithmetic instead of using real factors because it's faster. -%D However, the actual macros test slower, possibly because I've -%D omitted three nested loops. In my test files, my approach is more -%D accurate. It is also far simpler and overflow does not seem to be a -%D significant concern. The scale factors written by Metapost are (?) -%D always $<=1$ (it scales coordinates internally) and coordinates are -%D always likely to be less than \type {\maxdimen}. -%D -%D If this should ever cause problems, the scale factors can be reduced. - -% \def\doMPconcat#1#2#3#4% -% {\dimen12=#1pt % p_x % #1pt -% \dimen14=#3pt % p_y % #3pt -% \advance\dimen12 -\dimen8 % p_x - t_x -% \advance\dimen14 -\dimen10 % p_y - t_y -% \dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x) -% \advance\dimen18 -\withoutpt\the\dimen4 \dimen14 % - r_y(p_y-t_y) -% \dimen14=\withoutpt\the\dimen0 \dimen14 % s_x(p_y-t_y) -% \advance\dimen14 -\withoutpt\the\dimen2 \dimen12 % - r_x(p_x-t_x) -% % \MPscratchDim contains precomputed 1/D: -% \dimen18=\withoutpt\the\MPscratchDim \dimen18 -% \dimen14=\withoutpt\the\MPscratchDim \dimen14 -% \edef#2{\withoutpt\the\dimen18}% % p_x^\prime -% \edef#4{\withoutpt\the\dimen14}} % p_y^\prime - -\def\doMPconcat#1#2#3#4% - {\dimen12=#1pt % p_x % #1pt - \dimen14=#3pt % p_y % #3pt - \advance\dimen12 -\dimen8 % p_x - t_x - \advance\dimen14 -\dimen10 % p_y - t_y - \dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x) - \advance\dimen18 -\withoutpt\the\dimen4 \dimen14 % - r_y(p_y-t_y) - \dimen14=\withoutpt\the\dimen0 \dimen14 % s_x(p_y-t_y) - \advance\dimen14 -\withoutpt\the\dimen2 \dimen12 % - r_x(p_x-t_x) - % \MPreciprocal contains precomputed 1/D: - \dimen18=\MPreciprocal\dimen18 - \dimen14=\MPreciprocal\dimen14 - \edef#2{\withoutpt\the\dimen18}% % p_x^\prime - \edef#4{\withoutpt\the\dimen14}} % p_y^\prime - -% faster but not that often used -% -% \def\doMPconcat#1#2#3#4% -% {\dimen12\dimexpr#1\points-\dimen 8\relax % p_x-t_x -% \dimen14\dimexpr#3\points-\dimen10\relax % p_y-t_y -% \dimen18\dimexpr\withoutpt\the\dimen6\dimen12-\withoutpt\the\dimen4\dimen14\relax % s_y(p_x-t_x)-r_y(p_y-t_y) -% \dimen14\dimexpr\withoutpt\the\dimen0\dimen14-\withoutpt\the\dimen2\dimen12\relax % s_x(p_y-t_y)-r_x(p_x-t_x) -% \edef#2{\withoutpt\the\dimexpr\MPreciprocal\dimen18\relax}% % p_x^\prime -% \edef#4{\withoutpt\the\dimexpr\MPreciprocal\dimen14\relax}} % p_y^\prime - -%D One reason for Daniel to write this patch was that at small sizes -%D the accuracy was less than optimal. Here is a test that demonstrates -%D that his alternative is pretty good: -%D -%D \startlinecorrection -%D \startMPcode -%D for i = 5cm,1cm,5mm,1mm,.5mm,.1mm,.01mm : -%D draw fullcircle scaled i withpen pencircle xscaled (i/10) yscaled (i/20) rotated 45 ; -%D endfor ; -%D \stopMPcode -%D \stoplinecorrection - -%D The following explanation of the conversion process was -%D posted to the \PDFTEX\ mailing list by Tanmoy. The original -%D macro was part of a set of macro's that included sinus and -%D cosinus calculations as well as scaling and translating. The -%D \METAPOST\ to \PDF\ conversion however only needs -%D transformation. - -%M \start \switchtobodyfont [ss] - -%D Given a point $(U_x, U_y)$ in user coordinates, the business -%D of \POSTSCRIPT\ is to convert it to device space. Let us say -%D that the device space coordinates are $(D_x, D_y)$. Then, in -%D \POSTSCRIPT\ $(D_x, D_y)$ can be written in terms of -%D $(U_x, U_y)$ in matrix notation, either as -%D -%D \placeformula -%D \startformula -%D \pmatrix{D_x&D_y&1\cr} = \pmatrix{U_x&U_y&1\cr} -%D \pmatrix{s_x&r_x&0\cr -%D r_y&s_y&0\cr -%D t_x&t_y&1\cr} -%D \stopformula -%D -%D or -%D -%D \placeformula -%D \startformula -%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x&r_y&t_x\cr -%D r_x&s_y&t_y\cr -%D 0 &0 &1 \cr} -%D \pmatrix{U_x\cr -%D U_y\cr -%D 1 \cr} -%D \stopformula -%D -%D both of which is a shorthand for the same set of equations: -%D -%D \placeformula -%D \startformula -%D D_x = s_x U_x + r_y U_y + t_x -%D \stopformula -%D -%D \placeformula -%D \startformula -%D D_y = r_x U_x + s_y U_y + t_y -%D \stopformula -%D -%D which define what is called an `affine transformation'. -%D -%D \POSTSCRIPT\ represents the `transformation matrix' as a -%D six element matrix instead of a $3\times 3$ array because -%D three of the elements are always~0, 0 and~1. Thus the above -%D transformation is written in postscript as $[s_x\, r_x\, -%D r_y\, s_y\, t_x\, t_y]$. However, when doing any -%D calculations, it is useful to go back to the original -%D matrix notation (whichever: I will use the second) and -%D continue from there. -%D -%D As an example, if the current transformation matrix is -%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$ and you say \typ{[a b -%D c d e f] concat}, this means: -%D -%D \startnarrower -%D Take the user space coordinates and transform them to an -%D intermediate set of coordinates using array $[a\, b\, c\, d\, -%D e\, f]$ as the transformation matrix. -%D -%D Take the intermediate set of coordinates and change them to -%D device coordinates using array $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$ -%D as the transformation matrix. -%D \stopnarrower -%D -%D Well, what is the net effect? In matrix notation, it is -%D -%D \placeformula -%D \startformula -%D \pmatrix{I_x\cr I_y\cr 1\cr} = \pmatrix{a&c&e\cr -%D b&d&f\cr -%D 0&0&1\cr} -%D \pmatrix{U_x\cr -%D U_y\cr -%D 1 \cr} -%D \stopformula -%D -%D \placeformula -%D \startformula -%D \pmatrix{D_y\cr D_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr -%D r_x&s_y&t_y\cr -%D 0 &0 &1 \cr} -%D \pmatrix{I_x\cr -%D I_y\cr -%D 1 \cr} -%D \stopformula -%D -%D where $(I_x, I_y)$ is the intermediate coordinate. -%D -%D Now, the beauty of the matrix notation is that when there is -%D a chain of such matrix equations, one can always compose -%D them into one matrix equation using the standard matrix -%D composition law. The composite matrix from two matrices can -%D be derived very easily: the element in the $i$\high{th} -%D horizontal row and $j$\high{th} vertical column is -%D calculated by`multiplying' the $i$\high{th} row of the first -%D matrix and the $j$\high{th} column of the second matrix (and -%D summing over the elements). Thus, in the above: -%D -%D \placeformula -%D \startformula -%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr -%D r_x^\prime&s_y^\prime&t_y^\prime\cr -%D 0 &0 &0 \cr} -%D \pmatrix{U_x\cr -%D U_y\cr -%D 1 \cr} -%D \stopformula -%D -%D with -%D -%D \placeformula -%D \startformula -%D \eqalign -%D {s_x^\prime & = s_x a + r_y b \cr -%D r_x^\prime & = r_x a + s_y b \cr -%D r_y^\prime & = s_x c + r_y d \cr -%D s_y^\prime & = r_x c + s_y d \cr -%D t_x^\prime & = s_x e + r_y f + t_x \cr -%D t_y^\prime & = r_x e + s_y f + t_y \cr} -%D \stopformula - -%D In fact, the same rule is true not only when one is going -%D from user coordinates to device coordinates, but whenever -%D one is composing two `transformations' together -%D (transformations are `associative'). Note that the formula -%D is not symmetric: you have to keep track of which -%D transformation existed before (i.e.\ the equivalent of -%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$) and which was -%D specified later (i.e.\ the equivalent of $[a\, b\, c\, d\, -%D e\, f]$). Note also that the language can be rather -%D confusing: the one specified later `acts earlier', -%D converting the user space coordinates to intermediate -%D coordinates, which are then acted upon by the pre||existing -%D transformation. The important point is that order of -%D transformation matrices cannot be flipped (transformations -%D are not `commutative'). -%D -%D Now what does it mean to move a transformation matrix -%D before a drawing? What it means is that given a point -%D $(P_x, P_y)$ we need a different set of coordinates -%D $(P_x^\prime, P_y^\prime)$ such that if the transformation -%D acts on $(P_x^\prime, P_y^\prime)$, they produce $(P_x, -%D P_y)$. That is we need to solve the set of equations: -%D -%D \placeformula -%D \startformula -%D \pmatrix{P_x\cr P_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr -%D r_x&s_y&t_y\cr -%D 0 &0 &1 \cr} -%D \pmatrix{P_x^\prime\cr -%D P_y^\prime\cr -%D 1 \cr} -%D \stopformula -%D -%D Again matrix notation comes in handy (i.e. someone has -%D already solved the problem for us): we need the inverse -%D transformation matrix. The inverse transformation matrix can -%D be calculated very easily: -%D -%D \placeformula -%D \startformula -%D \pmatrix{P_x^\prime\cr P_y^\prime\cr 1\cr} = -%D \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr -%D r_x^\prime&s_y^\prime&t_y^\prime\cr -%D 0 &0 &1 \cr} -%D \pmatrix{P_x\cr -%D P_y\cr -%D 1 \cr} -%D \stopformula -%D -%D where, the inverse transformation matrix is given by -%D -%D \placeformula -%D \startformula -%D \eqalign -%D {D & = s_x s_y - r_x r_y \cr -%D s_x^\prime & = s_y / D \cr -%D s_y^\prime & = s_x / D \cr -%D r_x^\prime & = - r_x / D \cr -%D r_y^\prime & = - r_y / D \cr -%D t_x^\prime & = ( - s_y t_x + r_y t_y ) / D \cr -%D t_y^\prime & = ( r_x t_x - s_x t_y ) / D \cr} -%D \stopformula -%D -%D And you can see that when expanded out, this does -%D give the formulas: -%D -%D \placeformula -%D \startformula -%D P_x^\prime = { { s_y(p_x-t_x) + r_y(t_y-p_y) } \over -%D { s_x s_y-r_x r_y } } -%D \stopformula -%D -%D \placeformula -%D \startformula -%D P_y^\prime = { { s_x(p_y-t_y) + r_x(t_x-p_x) } \over -%D { s_x*s_y-r_x*r_y } } -%D \stopformula -%D -%D The code works by representing a real number by converting -%D it to a dimension to be put into a \DIMENSION\ register: 2.3 would -%D be represented as 2.3pt for example. In this scheme, -%D multiplying two numbers involves multiplying the \DIMENSION\ -%D registers and dividing by 65536. Accuracy demands that the -%D division be done as late as possible, but overflow -%D considerations need early division. -%D -%D Division involves dividing the two \DIMENSION\ registers and -%D multiplying the result by 65536. Again, accuracy would -%D demand that the numerator be multiplied (and|/|or the -%D denominator divided) early: but that can lead to overflow -%D which needs to be avoided. -%D -%D If nothing is known about the numbers to start with (in -%D concat), I have chosen to divide the 65536 as a 256 in each -%D operand. However, in the series calculating the sine and -%D cosine, I know that the terms are small (because I never -%D have an angle greater than 45 degrees), so I chose to -%D apportion the factor in a different way. - -%M \stop - -%D The path is output using the values saved on the stack. If -%D needed, all coordinates are recalculated. - -\def\finishMPpath - {\PDFcode{\ifcase\finiMPpath W n\or S\or f\or B\fi}} - -\def\processMPpath - {\checkMPpath - \ifcase\nofMPsegments\else - \flushMPpath - \closeMPpath - \finishMPpath - \fi - \let\handleMPsequence\dohandleMPsequence - \resetMPstack - \nofMPsegments0 - \handleMPsequence} - -%D The following \METAPOST\ code is quite valid but, when -%D processed and converted to \PDF, will make a file -%D unprintable on a Hewlett Packard printer (from Acrobat -%D $v<=5$). Who is to blame, the driver of the OS layer in -%D between, is hard to determine, so we add an additional -%D check. -%D -%D \starttyping -%D clip currentpicture to origin -- cycle ; -%D setbounds currentpicture to fullsquare scaled 5cm ; -%D \stoptyping - -\def\checkMPpath - {\ifcase\finiMPpath - \ifnum\nofMPsegments<3 % n is one ahead - \message{omitting zero clip path}% - \nofMPsegments0 - \fi - \fi} - -%D In \PDF\ the \type{cm} operator must precede the path -%D specification. We therefore can output the \type{cm} at -%D the moment we encounter it. - -\def\handleMPpathconcat - {\presetMPconcat - \PDFcode{\gMPs1 \gMPs2 \gMPs3 \gMPs4 \gMPs5 \gMPs6 cm}% - \resetMPstack} - -\def\handleMPpathscale - {\presetMPscale - \PDFcode{\gMPs1 0 0 \gMPs2 0 0 cm}% - \resetMPstack} - -%D This macro interprets the path and saves it as compact as -%D possible. - -\def\dohandleMPpath#1% - {\ifcase\lccode`#1\relax - \expandafter\dohandleMPpathA - \else - \expandafter\dohandleMPpathB - \fi#1} - -%\def\dohandleMPpathA#1 % -% {\setMPargument{#1}% -% \handleMPsequence} - -\let\dohandleMPpathA\setMPsequence - -% \def\dohandleMPpathB#1 % -% {\def\somestring{#1}% -% \ifx\somestring\PSlineto -% \setMPkeyword0 -% \else\ifx\somestring\PScurveto -% \setMPkeyword1 -% \else\ifx\somestring\PSrlineto -% \setMPkeyword2 -% \else\ifx\somestring\PSmoveto -% \setMPkeyword3 -% \else\ifx\somestring\PSclip -% % \chardef\finiMPpath0 % already -% \let\handleMPsequence\processMPpath -% \else\ifx\somestring\PSgsave -% \chardef\finiMPpath3 -% \else\ifx\somestring\PSgrestore -% \else\ifx\somestring\PSfill -% \ifcase\finiMPpath -% \chardef\finiMPpath2 -% \let\handleMPsequence\processMPpath -% \fi -% \else\ifx\somestring\PSstroke -% \ifcase\finiMPpath -% \chardef\finiMPpath1 -% \fi -% \let\handleMPsequence\processMPpath -% \else\ifx\somestring\PSclosepath -% \def\closeMPpath{\PDFcode{h}}% -% \else\ifx\somestring\PSconcat -% \cleanupMPconcat -% \let\flushMPpath\flushconcatMPpath -% \handleMPpathconcat -% \else\ifx\somestring\PSscale -% \let\flushMPpath\flushconcatMPpath -% \handleMPpathscale -% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi -% \handleMPsequence} - -\def\installMPSkeywordP#1#2% - {\expandafter\def\csname\@@MP:P:#1\endcsname{#2}} - -\def\installMPSshortcutP#1#2% todo: \let - {\expandafter\let\csname\@@MP:P:#1\expandafter\endcsname\csname\@@MP:P:#2\endcsname} - -\def\dohandleMPpathB#1 % - {\def\somestring{#1}% - \ifcsname\@@MP:P:\somestring\endcsname - \csname\@@MP:P:\somestring\expandafter\endcsname - \fi - \handleMPsequence} - -\ifx\eTeXversion\undefined - \def\dohandleMPpathB#1 % - {\def\somestring{#1}% - \csname\@@MP:P:\somestring\endcsname - \handleMPsequence} -\fi - -\installMPSkeywordP \PSlineto - {\setMPkeyword0 } -\installMPSkeywordP \PScurveto - {\setMPkeyword1 } -\installMPSkeywordP \PSrlineto - {\setMPkeyword2 } -\installMPSkeywordP \PSmoveto - {\edef\lastMPmoveX{\gMPs1}% - \edef\lastMPmoveY{\gMPs2}% - \resetMPstack - \setMPkeyword3 } -\installMPSkeywordP \PSclip - {% \chardef\finiMPpath\zerocount % already - \let\handleMPsequence\processMPpath} -\installMPSkeywordP \PSgsave - {\chardef\finiMPpath3 } -\installMPSkeywordP \PSgrestore - {} -\installMPSkeywordP \PSfill - {\ifcase\finiMPpath - \chardef\finiMPpath2 - \let\handleMPsequence\processMPpath - \fi} -\installMPSkeywordP \PSstroke - {\ifcase\finiMPpath - \chardef\finiMPpath1 - \fi - \let\handleMPsequence\processMPpath} -\installMPSkeywordP \PSclosepath - {\def\closeMPpath{\PDFcode{h}}} -\installMPSkeywordP \PSconcat - {\cleanupMPconcat - \let\flushMPpath\flushconcatMPpath - \handleMPpathconcat} -\installMPSkeywordP \PSscale - {\let\flushMPpath\flushconcatMPpath - \handleMPpathscale} - -\installMPSshortcutP {l} \PSlineto -\installMPSshortcutP {r} \PSrlineto -\installMPSshortcutP {m} \PSmoveto -\installMPSshortcutP {c} \PScurveto - -\installMPSshortcutP {q} \PSgsave -\installMPSshortcutP {Q} \PSgrestore -\installMPSshortcutP {S} \PSstroke -\installMPSshortcutP {F} \PSfill -\installMPSshortcutP {B} \PSgsave -\installMPSshortcutP {W} \PSclip -\installMPSshortcutP {p} \PSclosepath - -\installMPSshortcutP {s} \PSscale -\installMPSshortcutP {t} \PSconcat - -%D The main conversion command is: -%D -%D \starttyping -%D \convertMPtoPDF {filename} {x scale} {y scale} -%D \stoptyping -%D -%D The dimensions are derived from the bounding box. So we -%D only have to say: -%D -%D \starttyping -%D \convertMPtoPDF{mp-pra-1.eps}{1}{1} -%D \convertMPtoPDF{mp-pra-1.eps}{.5}{.5} -%D \stoptyping - -%D \macros -%D {makeMPintoPDFobject,lastPDFMPobject} -%D -%D For experts there are a few more options. When attributes -%D are to be added, the code must be embedded in an object -%D accompanied with the appropriate directives. One can -%D influence this process with \type {\makeMPintoPDFobject}. -%D -%D This option defaults to~0, because \CONTEXT\ takes care -%D of objects at another level, which saves some bytes. -%D -%D \starttabulate[|l|l|p|] -%D \NC 0 \NC never \NC don't use an object \NC\NR -%D \NC 1 \NC always \NC always use an object \NC\NR -%D \NC 2 \NC optional \NC use object when needed \NC\NR -%D \stoptabulate -%D -%D The last object number used is avaliable in the macro -%D \type {\lastPDFMPobject}. - -\ifx\makeMPintoPDFobject\undefined \chardef\makeMPintoPDFobject=0 \fi - -\def\lastPDFMPobject{0} - -%D The additional code needed can be made available in the -%D (global) macro \type {\currentPDFresources}. - -\let\currentPDFresources\empty - -\newtoks\everyMPtoPDFconversion - -\def\convertMPtoPDF % #1#2#3% - {\bgroup - \defineMPtoPDFfallbacks - \ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new - \setbox\scratchbox\vbox\bgroup - \xdef\MPheight{0pt}% - \xdef\MPwidth {0pt}% - \forgetall - \offinterlineskip - \startMPresources - \doprocessMPtoPDFfile} % - -%D The next one is kind of private and probably will become obsolete): - -\def\processMPtoPDFfile % file xscale yscale - {\bgroup - \let\finishMPgraphic\egroup - \doprocessMPtoPDFfile} - -\let\setMPextensions\relax - -\def\doprocessMPtoPDFfile#1#2#3% file xscale yscale - {\setMPspecials - \setMPextensions - \the\everyMPtoPDFconversion - \catcode`\^^M=\@@endofline - \startMPscanning - \let\do\empty - \xdef\MPxscale{#2}% - \xdef\MPyscale{#3}% - \xdef\MPxoffset{0}% - \xdef\MPyoffset{0}% - \xdef\MPyshift{0pt}% - \donefalse - \let\handleMPsequence\dohandleMPsequence - \message{[MP to PDF]}% was: [MP to PDF #1] but there is a (#1) anyway - \input#1\relax} - -\def\PDFMPformoffset - {\ifx\objectoffset\undefined0pt\else\objectoffset\fi} - -\chardef\blackoutMPgraphic0 % in ConTeXt 1 - -\def\finishMPgraphic - {\stopMPresources - \egroup - \setbox\scratchbox\vbox - {\forgetall - \hbox - {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}% - \ifcase\blackoutMPgraphic\or\PDFcode{0 g 0 G}\fi - \lower\MPyshift\box\scratchbox % unscaled shift - \PDFcode{Q}}}% - \ht\scratchbox\MPheight - \wd\scratchbox\MPwidth - \dp\scratchbox0pt\relax - \dopackageMPgraphic\scratchbox - \egroup - \endinput} - -%D Alternative for \PDFTEX. We cannot come up with something more contexy -%D because this module is also used in \LATEX. - -\def\dopackageMPgraphic#1% #1 = boxregister - {%\ifx\pdfxform\undefined - % \chardef\makeMPintoPDFobject0 % no pdftex at all - %\else\ifx\pdftexversion\undefined - % \chardef\makeMPintoPDFobject0 % no pdftex at all - %\else\ifnum\pdftexversion<14 - % \chardef\makeMPintoPDFobject0 % no resource support - %\else - % % keep the default value - %\fi\fi\fi - \ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else - % an existing value of 2 signals object support (set elsewhere) - \chardef\makeMPintoPDFobject1 - \fi\fi - \ifcase\makeMPintoPDFobject - \box#1% - \or - \scratchdimen\PDFMPformoffset\relax - \ifdim\scratchdimen>0pt % compensate for error - \setbox#1\vbox spread 2\scratchdimen - {\forgetall\vss\hbox spread 2\scratchdimen{\hss\box#1\hss}\vss}% - \fi - \setMPPDFobject{\currentPDFresources}{#1}% - \ifdim\scratchdimen>0pt % compensate for error - \vbox to \MPheight - {\forgetall\vss\hbox to \MPwidth{\hss\getMPPDFobject\hss}\vss}% - \else - \getMPPDFobject - \fi - \global\let\currentPDFresources\empty - \else - \box#1% - \fi} - -\def\setMPPDFobject#1#2% resources boxnumber - {\ifx\pdfxform\undefined - \def\getMPPDFobject{\box#2}% - \else\ifx\pdftexversion\undefined - \def\getMPPDFobject{\box#2}% - \else\ifnum\pdftexversion<14 - \def\getMPPDFobject{\box#2}% - \else - \ifx\everyPDFxform\undefined\else\the\everyPDFxform\fi - \immediate\pdfxform resources{#1}#2% - \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}% - \fi\fi\fi} - -\let\getMPPDFobject\relax - -%D \macros -%D {deleteMPgraphic, -%D startMPresources, -%D stopMPresources} -%D -%D Here are a few hooks for \CONTEXT\ specific things. - -\ifx\deleteMPgraphic\undefined - \def\deleteMPgraphic#1{} -\fi - -\ifx\startMPresources\undefined - \let\startMPresources\relax - \let\stopMPresources\relax -\fi - -%D \macros -%D {twodigitMPoutput} -%D -%D We can limit the precision to two digits after the comma -%D by saying: -%D -%D \starttyping -%D \twodigitMPoutput -%D \stoptyping -%D -%D This option only works in \CONTEXT\ combined with \ETEX. - -\def\twodigitMPoutput - {\let\!MP \twodigitrounding - \def\!MPgMPs##1{\twodigitrounding{\gMPs##1}}% - \def\!MPgMPa##1{\twodigitrounding{\gMPa##1}}} - -\let\!MP \empty -\let\!MPgMPa\gMPa -\let\!MPgMPs\gMPs - -%D This kind of conversion is possible because \METAPOST\ -%D does all the calculations. Converting other \POSTSCRIPT\ -%D files would drive both me and \TEX\ crazy. - -\protect \endinput diff --git a/tex/context/base/supp-ran.mkii b/tex/context/base/supp-ran.mkii index d595fffaf..0c07099ed 100644 --- a/tex/context/base/supp-ran.mkii +++ b/tex/context/base/supp-ran.mkii @@ -46,7 +46,7 @@ %D \getrandomseed\randomseed %D \stoptyping -\input thrd-ran.tex +\input thrd-ran.mkii \ifx\uniformdeviate\undefined diff --git a/tex/context/base/supp-spe.mkii b/tex/context/base/supp-spe.mkii new file mode 100644 index 000000000..8cb8e2ac1 --- /dev/null +++ b/tex/context/base/supp-spe.mkii @@ -0,0 +1,164 @@ +%D \module +%D [ file=supp-spe, +%D version=1997.07.05, +%D title=\CONTEXT\ Support Macros, +%D subtitle=Specials, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This module implements some \type{\special} manipulation +%D macros. I needed these when I implemented the code that +%D handles the conversion of \TPIC\ specials to \PDF\ code. + +\ifx \undefined \writestatus \input supp-mis.tex \relax \fi +\ifx \undefined \redefinespecial \else \expandafter \endinput \fi + +\writestatus{loading}{ConTeXt Support Macros / Specials} + +\unprotect + +%D When interpreting specials we need to do some basic scanning. +%D For the moment we distinguish between three cases. We need +%D +%D \starttyping +%D \special{tag: arguments} +%D \special{tag arguments} +%D \special{tag} +%D \stoptyping +%D +%D We cannot be sure that the first case isn't +%D +%D \starttyping +%D \special{tag:arguments} +%D \stoptyping +%D +%D So we have to take care of that one too. + +%D \macros +%D {redefinespecial} +%D +%D Specials that are to be interpreted are defined with +%D commands like: +%D +%D \startbuffer[tmp-1] +%D \redefinespecial a: \using#1\endspecial% +%D {let's execute special 'a:' using '#1'} +%D +%D \redefinespecial a \using#1\endspecial% +%D {let's execute special 'a' using '#1'} +%D +%D \redefinespecial a \using#1\endspecial% +%D {let's execute special 'a' using nothing} +%D \stopbuffer +%D +%D \typebuffer[tmp-1] +%D +%D The first two always take an argument, the last one not. +%D The definition of this redefinition macro is not that +%D complex. The names are internally tagged with \type{\@rds@} +%D which saves both time and space. + +\def\@rds@{@rds@} + +\def\redefinespecial #1 {\setvalue{\@rds@#1}} + +%D \macros +%D {mimmickspecials} +%D +%D Mimmicking specials is activated by saying: +%D +%D \starttyping +%D \mimmickspecials +%D \stoptyping +%D +%D This commands redefines the \PLAIN\ \TEX\ primitive +%D \type{\special}. + +\def\mimmickspecials + {\let\special\domimmickspecial} + +%D The special mimmicking macro first looks if it can find an +%D colon terminated tag, next it searches for a tag that end +%D with a space. If both cannot find, the tag itself is treated +%D without argument. + +\def\domimmickspecial#1% + {\domimmickcolonspecial#1:\relax/:\relax/\end} + +\def\domimmickcolonspecial#1:#2#3:\relax/#4\end + {\ifx#2\relax + \domimmickspacespecial#1 \relax/ \relax/\end + \else + \dodomimmickspecial#1:\using#2#3\endspecial + \fi} + +\def\domimmickspacespecial#1 #2#3 \relax/#4\end + {\ifx#2\relax + \dodomimmickspecial#1\using\endspecial + \else + \dodomimmickspecial#1\using#2#3\endspecial + \fi} + +\def\dodomimmickspecial#1\using#2\endspecial + {\expandafter\ifx\csname\@rds@#1\endcsname\relax % \doifdefinedelse + \defaultspecial{#1 #2}% + \else + %\message{[mimmick special #1 with #2]}% + \getvalue{\@rds@#1}\using#2\endspecial + \fi} + +%D Now let's show that things work the way we want, using the +%D previous definitions of tag~a. +%D +%D \startbuffer[tmp-2] +%D \mimmickspecials +%D \special{a: 1 2 3 4 5} +%D \special{a: 1 2 3 4 5} +%D \special{a} +%D \stopbuffer +%D +%D \typebuffer[tmp-2] +%D +%D Which results in: +%D +%D \startlines +%D \getbuffer[tmp-1] +%D \getbuffer[tmp-2] +%D \stoplines + +%D \macros +%D {mimmickspecial} +%D +%D When needed, one can call a mimmicked special directly by +%D saying for instance: +%D +%D \starttyping +%D \mimmickspecial a: \using...\endspecial +%D \stoptyping +%D +%D This can be handy when specials have much in common. + +\def\mimmickspecial #1 {\getvalue{\@rds@#1}} + +%D \macros +%D {normalspecial,defaultspecial} +%D +%D Unknown specials are passed to the default special handler. +%D One can for instance ignore all further specials by saying +%D \type{\normalspecial}: +%D +%D \starttyping +%D \def\defaultspecial#1{} +%D \stoptyping +%D +%D But here we default to idle. + +\let\normalspecial \special +\let\defaultspecial\special + +\protect \endinput diff --git a/tex/context/base/supp-spe.tex b/tex/context/base/supp-spe.tex deleted file mode 100644 index 8cb8e2ac1..000000000 --- a/tex/context/base/supp-spe.tex +++ /dev/null @@ -1,164 +0,0 @@ -%D \module -%D [ file=supp-spe, -%D version=1997.07.05, -%D title=\CONTEXT\ Support Macros, -%D subtitle=Specials, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This module implements some \type{\special} manipulation -%D macros. I needed these when I implemented the code that -%D handles the conversion of \TPIC\ specials to \PDF\ code. - -\ifx \undefined \writestatus \input supp-mis.tex \relax \fi -\ifx \undefined \redefinespecial \else \expandafter \endinput \fi - -\writestatus{loading}{ConTeXt Support Macros / Specials} - -\unprotect - -%D When interpreting specials we need to do some basic scanning. -%D For the moment we distinguish between three cases. We need -%D -%D \starttyping -%D \special{tag: arguments} -%D \special{tag arguments} -%D \special{tag} -%D \stoptyping -%D -%D We cannot be sure that the first case isn't -%D -%D \starttyping -%D \special{tag:arguments} -%D \stoptyping -%D -%D So we have to take care of that one too. - -%D \macros -%D {redefinespecial} -%D -%D Specials that are to be interpreted are defined with -%D commands like: -%D -%D \startbuffer[tmp-1] -%D \redefinespecial a: \using#1\endspecial% -%D {let's execute special 'a:' using '#1'} -%D -%D \redefinespecial a \using#1\endspecial% -%D {let's execute special 'a' using '#1'} -%D -%D \redefinespecial a \using#1\endspecial% -%D {let's execute special 'a' using nothing} -%D \stopbuffer -%D -%D \typebuffer[tmp-1] -%D -%D The first two always take an argument, the last one not. -%D The definition of this redefinition macro is not that -%D complex. The names are internally tagged with \type{\@rds@} -%D which saves both time and space. - -\def\@rds@{@rds@} - -\def\redefinespecial #1 {\setvalue{\@rds@#1}} - -%D \macros -%D {mimmickspecials} -%D -%D Mimmicking specials is activated by saying: -%D -%D \starttyping -%D \mimmickspecials -%D \stoptyping -%D -%D This commands redefines the \PLAIN\ \TEX\ primitive -%D \type{\special}. - -\def\mimmickspecials - {\let\special\domimmickspecial} - -%D The special mimmicking macro first looks if it can find an -%D colon terminated tag, next it searches for a tag that end -%D with a space. If both cannot find, the tag itself is treated -%D without argument. - -\def\domimmickspecial#1% - {\domimmickcolonspecial#1:\relax/:\relax/\end} - -\def\domimmickcolonspecial#1:#2#3:\relax/#4\end - {\ifx#2\relax - \domimmickspacespecial#1 \relax/ \relax/\end - \else - \dodomimmickspecial#1:\using#2#3\endspecial - \fi} - -\def\domimmickspacespecial#1 #2#3 \relax/#4\end - {\ifx#2\relax - \dodomimmickspecial#1\using\endspecial - \else - \dodomimmickspecial#1\using#2#3\endspecial - \fi} - -\def\dodomimmickspecial#1\using#2\endspecial - {\expandafter\ifx\csname\@rds@#1\endcsname\relax % \doifdefinedelse - \defaultspecial{#1 #2}% - \else - %\message{[mimmick special #1 with #2]}% - \getvalue{\@rds@#1}\using#2\endspecial - \fi} - -%D Now let's show that things work the way we want, using the -%D previous definitions of tag~a. -%D -%D \startbuffer[tmp-2] -%D \mimmickspecials -%D \special{a: 1 2 3 4 5} -%D \special{a: 1 2 3 4 5} -%D \special{a} -%D \stopbuffer -%D -%D \typebuffer[tmp-2] -%D -%D Which results in: -%D -%D \startlines -%D \getbuffer[tmp-1] -%D \getbuffer[tmp-2] -%D \stoplines - -%D \macros -%D {mimmickspecial} -%D -%D When needed, one can call a mimmicked special directly by -%D saying for instance: -%D -%D \starttyping -%D \mimmickspecial a: \using...\endspecial -%D \stoptyping -%D -%D This can be handy when specials have much in common. - -\def\mimmickspecial #1 {\getvalue{\@rds@#1}} - -%D \macros -%D {normalspecial,defaultspecial} -%D -%D Unknown specials are passed to the default special handler. -%D One can for instance ignore all further specials by saying -%D \type{\normalspecial}: -%D -%D \starttyping -%D \def\defaultspecial#1{} -%D \stoptyping -%D -%D But here we default to idle. - -\let\normalspecial \special -\let\defaultspecial\special - -\protect \endinput diff --git a/tex/context/base/supp-tpi.mkii b/tex/context/base/supp-tpi.mkii new file mode 100644 index 000000000..9b2ac9328 --- /dev/null +++ b/tex/context/base/supp-tpi.mkii @@ -0,0 +1,353 @@ +%D \module +%D [ file=supp-tpi, +%D version=1997.07.05, +%D title=\CONTEXT\ Support Macros, +%D subtitle=\TPIC\ Conversion, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 modules implements the conversion of graphic \TPIC\ +%D specials using \METAPOST. +%D +%D We reimplement the \TPIC\ specials using the special +%D mimmicking mechanism implemented in the support module +%D \type{supp-spe} as well as the \METAPOST\ run||time support +%D implemented in \type{supp-mps}. + +\ifnum\texengine=\luatexengine + \endinput +\fi + +\ifx\undefined\writestatus \input supp-mis.mkii \relax \fi +\ifx\undefined\mimmickspecials \input supp-spe.mkii \relax \fi +\ifx\undefined\MPgraphicbox \input supp-mps.mkii \relax \fi +\ifx\undefined\dogetEPSboundingbox \input supp-eps.mkii \relax \fi + +\writestatus{loading}{ConTeXt Support Macros / TPIC Conversion} + +%D Beware: we haven't activated both mechanism yet. This is +%D to be done in the calling module. + +\unprotect + +%D When we want to mimmick \TPIC\ specials in \PDFTEX, we need +%D to map its graphic primitives into \PDF\ ones. The main +%D problem in doing so is that \PDF\ does not support b-splines +%D directly and also does not offer us something to draw arcs. +%D Of course all this scan be implemented in \TEX, and the +%D first implementation of this module did so, but the results +%D were not that satisfying. Not having used these specials +%D before, I had for instance to find out that the \TPIC\ +%D specials were not that unambiguesly defined. +%D +%D Then, while discussing something else, Sebastian Ratz told +%D me that the Web2c implementation that \PDFTEX\ is base upon, +%D offers some rather discutable, but nevertheless handy +%D feature: +%D +%D \starttyping +%D \write18{execute program with arguments} +%D \stoptyping +%D +%D Knowing this, I immediatelly decided to throw away the old +%D conversion macros and use the marvelous \METAPOST, \TEX\ +%D related, drawing program to do the conversion in as high a +%D quality as possible. +%D +%D implementation we're going to present here, not only uses +%D for drawing purposes, but also uses the more efficient +%D \METAPOST\ features to store the path. +%D +%D \in{Table}[tab:TPIC specials] lists the \TPIC\ specials as +%D mentioned in the \LATEX\ Graphics Companion and the +%D relevant part of the \DVIPS\ source. This list shows us +%D that we have to store the path before we can use it, simply +%D because we don't know in advance what actions to apply on +%D it. +%D +%D \placetable[here][tab:TPIC specials]{The \TPIC\ special syntax.} +%D \starttable[|||l|] +%D \HL +%D \NC \bf tag \NC \bf arguments \NC \bf meaning \NC\SR +%D \HL +%D \NC pn \NC $w$ \NC set linewidth \NC\FR +%D \NC pa \NC $x$ $y$ \NC add point to path \NC\MR +%D \NC fp \NC \NC draw/fill path \NC\MR +%D \NC ip \NC \NC fill path \NC\MR +%D \NC da \NC $l$ \NC draw dashed path \NC\MR +%D \NC dt \NC $l$ \NC draw doted path \NC\MR +%D \NC sp \NC $d$ \NC draw spline \NC\MR +%D \NC ar \NC $x$ $y$ $r_x$ $r_y$ $b$ $e$ \NC draw (partial) arc \NC\MR +%D \NC ia \NC $x$ $y$ $r_x$ $r_y$ $b$ $e$ \NC fill (partial) arc \NC\MR +%D \NC sh \NC $s$ \NC fill next path \NC\LR +%D \HL +%D \stoptable + +%D The first problem we have to take care of is the fact that +%D there is no decent begin or end of the drawing process +%D defined. We can however be quite sure that writers of +%D packages using these specials will put them into a box, +%D simply because else this is the most common used way to +%D treat something \TEX\ as as a whole, like: +%D +%D \starttyping +%D \hbox{\special{}\special{}...} +%D \stoptyping +%D +%D We just start a picture as soon as the first special is +%D encountered, so this becomes: +%D +%D \starttyping +%D \hbox{\openpicture\newspecial{}\newspecial{}... +%D \stoptyping + +%D The first step in opening the picture is to start a group. +%D Now we can savely use the egroup that closes the box to also +%D end the picture. + +% BETER: check for context and include mp-tool.mp + +\def\startTPICspecials + {\bgroup + \let\startTPICspecials\relax + \aftergroup\stopTPICspecials + \resetMPdrawing + \startMPdrawing + input mp-tool.mp; + pair p[]; + \stopMPdrawing} + +%D As soon as we begin a picture, we inhibit nesting by +%D relaxing the start macro. The first \METAPOST\ action we +%D take is declaring an array of pairs named $p$. + +%D Ending the picture is invoked by closing the current group. +%D Because the \TPIC\ picture comes out mirrored, we have to +%D reflect the current \METAPOST\ picture, stored in the system +%D variable {\it currentpicture}, around the $x$-axis. + +\def\stopTPICspecials + {\startMPdrawing + currentpicture:=currentpicture reflectedabout ((0,0),(4095,0)); + \stopMPdrawing + \MPdrawingdonetrue + \setbox\MPgraphicbox\hbox + {\getMPdrawing}% + \setbox\MPgraphicbox\hbox to \zeropoint + {\kern-\wd\MPgraphicbox + \vbox to \zeropoint{\box\MPgraphicbox\vss}\hss}% + \ht\MPgraphicbox\zeropoint + \wd\MPgraphicbox\zeropoint + \dp\MPgraphicbox\zeropoint + \box\MPgraphicbox + \egroup} + +%D Here the macro \type{\stopwritingMPgraphic} has to take care +%D of executing and including the \METAPOST\ code. + +%D We need to keep track of the number of elements that form +%D the path. This is needed because we don't know in advance +%D how the points are to be connected. + +\newcount\TPICcounter + +%D When a path is draw, we can connect the points using a +%D smooth curve of drawing straight lines. A closed path can be +%D drawn or filled. + +\newif\ifTPICdraw +\newif\ifTPICfill +\newif\ifTPICcurve + +%D The \TPIC\ specials permit specifying the line and fill +%D color as well as the linetype, which can be solid, dashed or +%D dotted. We'll save those specifications as a \METAPOST\ +%D string, using: + +\let\TPIClinetype =\empty +\let\TPICgrayscale=\empty + +%D The magic reduction factor $.07227$ is needed to map the +%D \TPIC\ $1/1000$ of an inch to \POSTSCRIPT\ points. We cannot +%D delegate this task to \METAPOST\ because this program does +%D not accept values greater than 4095. + +%D I won't discuss all the specifics used in implementing +%D the specials. The \METAPOST\ part is rather trivial. Many +%D specials have much in common, so the amout of code is not +%D that large. + +\redefinespecial pa \using#1 #2\endspecial + {\startTPICspecials + \bgroup + \global\advance\TPICcounter 1 + \dimen0=#1pt \dimen0=.07227\dimen0 + \dimen2=#2pt \dimen2=.07227\dimen2 + \startMPdrawing + p[\the\TPICcounter]:=(\the\dimen0,\the\dimen2); + \stopMPdrawing + \egroup} + +\redefinespecial pn \using#1\endspecial + {\startTPICspecials + \bgroup + \dimen0=#1pt \dimen0=.07227\dimen0 + \startMPdrawing + pickup pencircle scaled \the\dimen0; + \stopMPdrawing + \egroup} + +\redefinespecial sh \using#1\endspecial + {\startTPICspecials + \bgroup + \edef\g{#1}% + \edef\g{\ifx\g\empty.5\else#1\fi}% + \xdef\TPICgrayscale{withcolor (\g,\g,\g)}% + \egroup} + +\redefinespecial wh \using#1\endspecial + {\mimmickspecial sh \using0\endspecial} + +\redefinespecial bk \using#1\endspecial + {\mimmickspecial sh \using1\endspecial} + +\redefinespecial da \using#1\endspecial + {\startTPICspecials + \bgroup + \edef\l{#1}% + \ifx\l\empty + \gdef\TPIClinetype{dashed evenly}% + \else + \dimen0=#1in + \ifdim\dimen0<\!!zeropoint \dimen0=-\dimen0\fi + \edef\f{\the\dimen0 \space}% + \dimen0=.5\dimen0 + \edef\h{\the\dimen0 \space}% + \xdef\TPIClinetype{dashed dashpattern (on \h off \f on \h)}% + \fi + \egroup + \TPICcurvefalse\TPICdrawtrue + \drawTPICpath\using#1\endspecial} + +\redefinespecial dt \using#1\endspecial + {\startTPICspecials + \bgroup + \edef\l{#1}% + \xdef\TPIClinetype{dashed withdots \ifx\l\empty\else scaled #1in\fi}% + \egroup + \TPICcurvefalse\TPICdrawtrue + \drawTPICpath\using#1\endspecial} + +\redefinespecial fp \using#1\endspecial + {\startTPICspecials + \TPICcurvefalse\TPICdrawtrue + \ifdim0#1pt=\!!zeropoint + \drawTPICpath\using#1\endspecial + \else\ifdim0#1pt<\!!zeropoint + \mimmickspecial dt\using#1\endspecial + \else + \mimmickspecial da\using#1\endspecial + \fi\fi} + +\redefinespecial sp + {\startTPICspecials\TPICdrawtrue\TPICcurvetrue\drawTPICpath} + +\redefinespecial ip + {\startTPICspecials\TPICfilltrue\drawTPICpath} + +\redefinespecial ar + {\startTPICspecials\TPICdrawtrue\drawTPICarc} + +\redefinespecial ia + {\startTPICspecials\TPICfilltrue\drawTPICarc} + +%D These substitutes use two auxiliary macros that take care of +%D actually drawing the shape or arc. Here we use the stored +%D linetype (solid, dashed, dotted) and color (grayscale). + +\def\drawTPICpath\using#1\endspecial + {\bgroup + \ifTPICdraw + \def\TPICgrayscale{}% + \fi + \startMPdrawing + \ifTPICfill fill\fi\ifTPICdraw draw\fi\space + for i:=1 upto \the\TPICcounter-1: + p[i]\ifTPICcurve..\else--\fi + endfor + p[\the\TPICcounter] + \ifTPICfill\ifTPICcurve..\else--\fi cycle \fi + \TPIClinetype\space\TPICgrayscale; + \stopMPdrawing + \resetTPICvariables + \egroup} + +%D I have to admit that at the moment I wrote this macro, I +%D could not write this piece of \METAPOST. Fortunately +%D Thortsen Ohl promptly answered the question I posted to the +%D \METAFONT\ discussion list. + +\def\drawTPICarc\using#1 #2 #3 #4 #5 #6\endspecial + {\bgroup + \ifTPICdraw + \def\TPICgrayscale{}% + \fi + \dimen 0=#1pt\dimen 0=.07227\dimen 0 + \dimen 2=#2pt\dimen 2=.07227\dimen 2 + \dimen10=#3pt\dimen10=.14454\dimen10 + \dimen12=#4pt\dimen12=.14454\dimen12 + \dimen20=#5pt + \dimen22=#6pt + \startMPdrawing + \ifTPICfill fill\fi\ifTPICdraw draw\fi \space + \ifTPICfill\else subpath 4/3.14159*(\the\dimen20,\the\dimen22) of \fi + fullcircle xscaled \the\dimen10 \space yscaled \the\dimen12 \space + shifted (\the\dimen0,\the\dimen2) + \TPIClinetype \space \TPICgrayscale; + \stopMPdrawing + \resetTPICvariables + \egroup} + +%D Resetting the variables need to be done globally because we +%D cannot be sure if any further grouping is used by the +%D envelopping macros. + +\def\resetTPICvariables + {\global\TPICcounter\zerocount + \global\TPICfillfalse + \global\TPICdrawfalse + \global\let\TPIClinetype\empty + \global\let\TPICgrayscale\empty} + +%D I have to admit that by using the \METAPOST\ B‚zier cubics +%D routines these implementation does produce better curves +%D then most \DVI\ drivers do using the \TPIC\ prescribed +%D b-splines. Take for instance the sequence: +%D +%D \starttyping +%D \special{pa 2000 1000} +%D \special{pa 1000 2000} +%D \special{pa 0000 1000} +%D \special{pa 1000 0000} +%D \special{pa 2000 1000} +%D \special{sp} +%D \stoptyping +%D +%D One would expect that this code produced a closed circle, +%D but the curve that comes out using b-splines is far from +%D round. We can however savely asume that the arc producing +%D specials will be used for drawing circle fragments, while +%D the path specials will be used for arbitraty curves. And for +%D b-splines to produce nice curves, one will often use many +%D points to get the desired results. Therefore, using the +%D \METAPOST\ B‚zier curves will certainly produce similar and +%D even better graphics, except in those rare cases where one +%D uses delinberately the not that accurate features of +%D b-splines. Hereby the user is warned. + +\protect \endinput diff --git a/tex/context/base/supp-tpi.tex b/tex/context/base/supp-tpi.tex deleted file mode 100644 index ac38ea392..000000000 --- a/tex/context/base/supp-tpi.tex +++ /dev/null @@ -1,353 +0,0 @@ -%D \module -%D [ file=supp-tpi, -%D version=1997.07.05, -%D title=\CONTEXT\ Support Macros, -%D subtitle=\TPIC\ Conversion, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 modules implements the conversion of graphic \TPIC\ -%D specials using \METAPOST. -%D -%D We reimplement the \TPIC\ specials using the special -%D mimmicking mechanism implemented in the support module -%D \type{supp-spe} as well as the \METAPOST\ run||time support -%D implemented in \type{supp-mps}. - -\ifnum\texengine=\luatexengine - \endinput -\fi - -\ifx\undefined\writestatus \input supp-mis \relax \fi -\ifx\undefined\mimmickspecials \input supp-spe \relax \fi -\ifx\undefined\MPgraphicbox \input supp-mps \relax \fi -\ifx\undefined\dogetEPSboundingbox \input supp-eps \relax \fi - -\writestatus{loading}{ConTeXt Support Macros / TPIC Conversion} - -%D Beware: we haven't activated both mechanism yet. This is -%D to be done in the calling module. - -\unprotect - -%D When we want to mimmick \TPIC\ specials in \PDFTEX, we need -%D to map its graphic primitives into \PDF\ ones. The main -%D problem in doing so is that \PDF\ does not support b-splines -%D directly and also does not offer us something to draw arcs. -%D Of course all this scan be implemented in \TEX, and the -%D first implementation of this module did so, but the results -%D were not that satisfying. Not having used these specials -%D before, I had for instance to find out that the \TPIC\ -%D specials were not that unambiguesly defined. -%D -%D Then, while discussing something else, Sebastian Ratz told -%D me that the Web2c implementation that \PDFTEX\ is base upon, -%D offers some rather discutable, but nevertheless handy -%D feature: -%D -%D \starttyping -%D \write18{execute program with arguments} -%D \stoptyping -%D -%D Knowing this, I immediatelly decided to throw away the old -%D conversion macros and use the marvelous \METAPOST, \TEX\ -%D related, drawing program to do the conversion in as high a -%D quality as possible. -%D -%D implementation we're going to present here, not only uses -%D for drawing purposes, but also uses the more efficient -%D \METAPOST\ features to store the path. -%D -%D \in{Table}[tab:TPIC specials] lists the \TPIC\ specials as -%D mentioned in the \LATEX\ Graphics Companion and the -%D relevant part of the \DVIPS\ source. This list shows us -%D that we have to store the path before we can use it, simply -%D because we don't know in advance what actions to apply on -%D it. -%D -%D \placetable[here][tab:TPIC specials]{The \TPIC\ special syntax.} -%D \starttable[|||l|] -%D \HL -%D \NC \bf tag \NC \bf arguments \NC \bf meaning \NC\SR -%D \HL -%D \NC pn \NC $w$ \NC set linewidth \NC\FR -%D \NC pa \NC $x$ $y$ \NC add point to path \NC\MR -%D \NC fp \NC \NC draw/fill path \NC\MR -%D \NC ip \NC \NC fill path \NC\MR -%D \NC da \NC $l$ \NC draw dashed path \NC\MR -%D \NC dt \NC $l$ \NC draw doted path \NC\MR -%D \NC sp \NC $d$ \NC draw spline \NC\MR -%D \NC ar \NC $x$ $y$ $r_x$ $r_y$ $b$ $e$ \NC draw (partial) arc \NC\MR -%D \NC ia \NC $x$ $y$ $r_x$ $r_y$ $b$ $e$ \NC fill (partial) arc \NC\MR -%D \NC sh \NC $s$ \NC fill next path \NC\LR -%D \HL -%D \stoptable - -%D The first problem we have to take care of is the fact that -%D there is no decent begin or end of the drawing process -%D defined. We can however be quite sure that writers of -%D packages using these specials will put them into a box, -%D simply because else this is the most common used way to -%D treat something \TEX\ as as a whole, like: -%D -%D \starttyping -%D \hbox{\special{}\special{}...} -%D \stoptyping -%D -%D We just start a picture as soon as the first special is -%D encountered, so this becomes: -%D -%D \starttyping -%D \hbox{\openpicture\newspecial{}\newspecial{}... -%D \stoptyping - -%D The first step in opening the picture is to start a group. -%D Now we can savely use the egroup that closes the box to also -%D end the picture. - -% BETER: check for context and include mp-tool.mp - -\def\startTPICspecials - {\bgroup - \let\startTPICspecials\relax - \aftergroup\stopTPICspecials - \resetMPdrawing - \startMPdrawing - input mp-tool.mp; - pair p[]; - \stopMPdrawing} - -%D As soon as we begin a picture, we inhibit nesting by -%D relaxing the start macro. The first \METAPOST\ action we -%D take is declaring an array of pairs named $p$. - -%D Ending the picture is invoked by closing the current group. -%D Because the \TPIC\ picture comes out mirrored, we have to -%D reflect the current \METAPOST\ picture, stored in the system -%D variable {\it currentpicture}, around the $x$-axis. - -\def\stopTPICspecials - {\startMPdrawing - currentpicture:=currentpicture reflectedabout ((0,0),(4095,0)); - \stopMPdrawing - \MPdrawingdonetrue - \setbox\MPgraphicbox\hbox - {\getMPdrawing}% - \setbox\MPgraphicbox\hbox to \zeropoint - {\kern-\wd\MPgraphicbox - \vbox to \zeropoint{\box\MPgraphicbox\vss}\hss}% - \ht\MPgraphicbox\zeropoint - \wd\MPgraphicbox\zeropoint - \dp\MPgraphicbox\zeropoint - \box\MPgraphicbox - \egroup} - -%D Here the macro \type{\stopwritingMPgraphic} has to take care -%D of executing and including the \METAPOST\ code. - -%D We need to keep track of the number of elements that form -%D the path. This is needed because we don't know in advance -%D how the points are to be connected. - -\newcount\TPICcounter - -%D When a path is draw, we can connect the points using a -%D smooth curve of drawing straight lines. A closed path can be -%D drawn or filled. - -\newif\ifTPICdraw -\newif\ifTPICfill -\newif\ifTPICcurve - -%D The \TPIC\ specials permit specifying the line and fill -%D color as well as the linetype, which can be solid, dashed or -%D dotted. We'll save those specifications as a \METAPOST\ -%D string, using: - -\let\TPIClinetype =\empty -\let\TPICgrayscale=\empty - -%D The magic reduction factor $.07227$ is needed to map the -%D \TPIC\ $1/1000$ of an inch to \POSTSCRIPT\ points. We cannot -%D delegate this task to \METAPOST\ because this program does -%D not accept values greater than 4095. - -%D I won't discuss all the specifics used in implementing -%D the specials. The \METAPOST\ part is rather trivial. Many -%D specials have much in common, so the amout of code is not -%D that large. - -\redefinespecial pa \using#1 #2\endspecial - {\startTPICspecials - \bgroup - \global\advance\TPICcounter 1 - \dimen0=#1pt \dimen0=.07227\dimen0 - \dimen2=#2pt \dimen2=.07227\dimen2 - \startMPdrawing - p[\the\TPICcounter]:=(\the\dimen0,\the\dimen2); - \stopMPdrawing - \egroup} - -\redefinespecial pn \using#1\endspecial - {\startTPICspecials - \bgroup - \dimen0=#1pt \dimen0=.07227\dimen0 - \startMPdrawing - pickup pencircle scaled \the\dimen0; - \stopMPdrawing - \egroup} - -\redefinespecial sh \using#1\endspecial - {\startTPICspecials - \bgroup - \edef\g{#1}% - \edef\g{\ifx\g\empty.5\else#1\fi}% - \xdef\TPICgrayscale{withcolor (\g,\g,\g)}% - \egroup} - -\redefinespecial wh \using#1\endspecial - {\mimmickspecial sh \using0\endspecial} - -\redefinespecial bk \using#1\endspecial - {\mimmickspecial sh \using1\endspecial} - -\redefinespecial da \using#1\endspecial - {\startTPICspecials - \bgroup - \edef\l{#1}% - \ifx\l\empty - \gdef\TPIClinetype{dashed evenly}% - \else - \dimen0=#1in - \ifdim\dimen0<\!!zeropoint \dimen0=-\dimen0\fi - \edef\f{\the\dimen0 \space}% - \dimen0=.5\dimen0 - \edef\h{\the\dimen0 \space}% - \xdef\TPIClinetype{dashed dashpattern (on \h off \f on \h)}% - \fi - \egroup - \TPICcurvefalse\TPICdrawtrue - \drawTPICpath\using#1\endspecial} - -\redefinespecial dt \using#1\endspecial - {\startTPICspecials - \bgroup - \edef\l{#1}% - \xdef\TPIClinetype{dashed withdots \ifx\l\empty\else scaled #1in\fi}% - \egroup - \TPICcurvefalse\TPICdrawtrue - \drawTPICpath\using#1\endspecial} - -\redefinespecial fp \using#1\endspecial - {\startTPICspecials - \TPICcurvefalse\TPICdrawtrue - \ifdim0#1pt=\!!zeropoint - \drawTPICpath\using#1\endspecial - \else\ifdim0#1pt<\!!zeropoint - \mimmickspecial dt\using#1\endspecial - \else - \mimmickspecial da\using#1\endspecial - \fi\fi} - -\redefinespecial sp - {\startTPICspecials\TPICdrawtrue\TPICcurvetrue\drawTPICpath} - -\redefinespecial ip - {\startTPICspecials\TPICfilltrue\drawTPICpath} - -\redefinespecial ar - {\startTPICspecials\TPICdrawtrue\drawTPICarc} - -\redefinespecial ia - {\startTPICspecials\TPICfilltrue\drawTPICarc} - -%D These substitutes use two auxiliary macros that take care of -%D actually drawing the shape or arc. Here we use the stored -%D linetype (solid, dashed, dotted) and color (grayscale). - -\def\drawTPICpath\using#1\endspecial - {\bgroup - \ifTPICdraw - \def\TPICgrayscale{}% - \fi - \startMPdrawing - \ifTPICfill fill\fi\ifTPICdraw draw\fi\space - for i:=1 upto \the\TPICcounter-1: - p[i]\ifTPICcurve..\else--\fi - endfor - p[\the\TPICcounter] - \ifTPICfill\ifTPICcurve..\else--\fi cycle \fi - \TPIClinetype\space\TPICgrayscale; - \stopMPdrawing - \resetTPICvariables - \egroup} - -%D I have to admit that at the moment I wrote this macro, I -%D could not write this piece of \METAPOST. Fortunately -%D Thortsen Ohl promptly answered the question I posted to the -%D \METAFONT\ discussion list. - -\def\drawTPICarc\using#1 #2 #3 #4 #5 #6\endspecial - {\bgroup - \ifTPICdraw - \def\TPICgrayscale{}% - \fi - \dimen 0=#1pt\dimen 0=.07227\dimen 0 - \dimen 2=#2pt\dimen 2=.07227\dimen 2 - \dimen10=#3pt\dimen10=.14454\dimen10 - \dimen12=#4pt\dimen12=.14454\dimen12 - \dimen20=#5pt - \dimen22=#6pt - \startMPdrawing - \ifTPICfill fill\fi\ifTPICdraw draw\fi \space - \ifTPICfill\else subpath 4/3.14159*(\the\dimen20,\the\dimen22) of \fi - fullcircle xscaled \the\dimen10 \space yscaled \the\dimen12 \space - shifted (\the\dimen0,\the\dimen2) - \TPIClinetype \space \TPICgrayscale; - \stopMPdrawing - \resetTPICvariables - \egroup} - -%D Resetting the variables need to be done globally because we -%D cannot be sure if any further grouping is used by the -%D envelopping macros. - -\def\resetTPICvariables - {\global\TPICcounter\zerocount - \global\TPICfillfalse - \global\TPICdrawfalse - \global\let\TPIClinetype\empty - \global\let\TPICgrayscale\empty} - -%D I have to admit that by using the \METAPOST\ B‚zier cubics -%D routines these implementation does produce better curves -%D then most \DVI\ drivers do using the \TPIC\ prescribed -%D b-splines. Take for instance the sequence: -%D -%D \starttyping -%D \special{pa 2000 1000} -%D \special{pa 1000 2000} -%D \special{pa 0000 1000} -%D \special{pa 1000 0000} -%D \special{pa 2000 1000} -%D \special{sp} -%D \stoptyping -%D -%D One would expect that this code produced a closed circle, -%D but the curve that comes out using b-splines is far from -%D round. We can however savely asume that the arc producing -%D specials will be used for drawing circle fragments, while -%D the path specials will be used for arbitraty curves. And for -%D b-splines to produce nice curves, one will often use many -%D points to get the desired results. Therefore, using the -%D \METAPOST\ B‚zier curves will certainly produce similar and -%D even better graphics, except in those rare cases where one -%D uses delinberately the not that accurate features of -%D b-splines. Hereby the user is warned. - -\protect \endinput diff --git a/tex/context/base/symb-ini.mkii b/tex/context/base/symb-ini.mkii new file mode 100644 index 000000000..f7bffd240 --- /dev/null +++ b/tex/context/base/symb-ini.mkii @@ -0,0 +1,281 @@ +%D \module +%D [ file=symb-ini, +%D version=1998.07.20, +%D title=\CONTEXT\ Symbol Libraries, +%D subtitle=Basic Symbols Commands, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D The macros described here used to be part of the \type +%D {core-con} module. I decided to move them here when +%D symbolsets saw the light. Let their light shine. + +\writestatus{loading}{ConTeXt Symbol Libraries / Initialization} + +\unprotect + +%D \macros +%D {definesymbol, symbol} +%D +%D Converting numbers or levels into a character, romannumeral, +%D symbol or something else, is supported by many \CONTEXT\ +%D commands. Therefore we need a mechanism for linking such +%D numbers to their counterparts. +%D +%D First we take care of symbols. These are for instance used +%D in enumerations and itemizations. We have: +%D +%D \showsetup{definesymbol} +%D \showsetup{symbol} +%D +%D Symbols are simply linked to a tag. Such tags can be numbers +%D or strings. +%D +%D \starttyping +%D \definesymbol [1] [$\bullet$] +%D \definesymbol [level 5] [$\star$] +%D \stoptyping + +% ss:tag -> symbol +% ss:set:tag -> symbol out of set +% sstag -> list of symbols in set + +\def\definesymbol + {\dotripleempty\dodefinesymbol} + +% \def\dodefinesymbol[#1][#2][#3]% class name meaning +% {\ifthirdargument +% \setvalue{\??ss:#1:#2}{#3}% +% \doifsomething{#1}{\addvalue{\??ss*#1}{#2}}% +% \else +% \setvalue{\??ss:\currentsymboldef:#1}{#2}% +% \fi} + +\def\dodefinesymbol[#1][#2][#3]% class name meaning + {\ifthirdargument + \setvalue{\??ss:#1:#2}{#3}% + \doifsomething{#1}{\addvalue{\??ss*#1}{#2}}% + \else + \setvalue{\??ss:\currentsymboldef:#1}{#2}% + \addvalue{\??ss*\currentsymboldef}{#1}% + \fi} + +\def\doifinsymbolsetelse#1#2{\doifdefinedelse{\??ss:#1:#2}} +\def\doifinsymbolset #1#2{\doifdefined {\??ss:#1:#2}} +\def\doifsymbolsetelse #1{\doifdefinedelse{\??ss*#1}} + +\def\symbolset#1{\executeifdefined{\??ss*#1}\empty} % no [#1], to be used in commalists etc + +%D Since symbols are used frequently in interactive +%D documents, we speed up this one. Well, that was history, +%D since now we simplified things a bit, because the low +%D level macros have been sped up now and then. + +\unexpanded\def\symbol % This one always gobbles spaces, + {\dodoubleempty\dosymbol} % so never change it again! + +\newif\ifnosymbol \newtoks\everysymbol + +\def\dodosymbol#1#2% \relax's prevent lookahead problems + {\nosymbolfalse{\the\everysymbol\csname\??ss:#1:#2\endcsname\relax}\relax} + +\def\directsymbol#1#2% no \relax, there can be an argument, see lists + {\executeifdefined{\??ss:#1:#2}\firstofoneargument} + +% We support both: +% +% Test test \symbol[whatever]\ test \symbol[whatever]. +% Test test \symbol{whatever} test \symbol{whatever}. + +\def\dosymbol % so we also handle \symbol{name} + {\iffirstargument % which is nicer with following spaces + \expandafter\donormalsymbol + \else + \expandafter\dospecialsymbol + \fi} + +\def\dospecialsymbol[#1][#2]#3% + {\firstargumenttrue + \secondargumentfalse + \donormalsymbol[#3][]} + +\def\donormalsymbol[#1][#2]% + {\nosymboltrue + \ifsecondargument + \edef\currentsymbol{#2}% + \doifinsymbolset{#1}{#2}{\dodosymbol{#1}{#2}}% + \else + \edef\currentsymbol{#1}% + \fi + \ifnosymbol + \the\symbolsetups + \ifnosymbol + \redosymbol\currentsymbol + \fi + \fi} + +\def\fetchsymbol#1% + {\ifnosymbol + \doifinsymbolset{#1}\currentsymbol{\dodosymbol{#1}\currentsymbol}% + \fi} + +\def\redosymbol#1% +% {\doifinsymbolsetelse\empty{#1}{\dodosymbol\empty{#1}}{#1}} % more efficient: + {\doifinsymbolsetelse\empty{#1}{\dodosymbol\empty}\firstofoneargument{#1}} + +% % % % % +% this should go in symb-fig, to be loaded after core-fig + +%D \macros +%D {definefiguresymbol} +%D +%D To simplify defining figure symbols, we offer: +%D +%D \showsetup{definefiguresymbol} +%D +%D By default, such symbols scale along the current bodyfont +%D size or running font size (which is better). + +\def\defaultsymbolfactor{10} +\def\defaultsymbolheight{1.25ex} + +\def\figuresymbol + {\dodoubleempty\dofiguresymbol} + +\ifx\externalfigure \undefined \def\externalfigure[#1][#2]{#1} \fi +\ifx\resetexternalfigures\undefined \let\resetexternalfigures\relax \fi + +\def\dofiguresymbol[#1][% #2]% + {\externalfigure[#1][\c!reset=\v!yes,\c!symbol=\v!yes,\c!height=\defaultsymbolheight,}% #2]} + +\appendtoks \resetexternalfigures \to \everysymbol + +\def\definefiguresymbol + {\dotripleempty\dodefinefiguresymbol} + +\def\dodefinefiguresymbol[#1][#2][#3]% + {\ifsecondargument + \definesymbol[#1][{\dofiguresymbol[#2][#3]}]% + \fi} + +% but for the moment we keep it here +% % % % % % + +%\def\objectsymbol[#1]% +% {\dopresetfieldsymbol{#1}\dogetfieldsymbol{#1}} + +%D \macros +%D {doifsymboldefinedelse} +%D +%D A handy private one: + +% a bit messy + +\def\xfetchsymbol#1% + {\ifnosymbol + \doifinsymbolset{#1}\currentsymbol\nosymbolfalse + \fi} + +\def\xredosymbol#1% + {\doifinsymbolset\empty\currentsymbol\nosymbolfalse} + +\def\doifsymboldefinedelse#1% + {\bgroup + \edef\currentsymbol{#1}% + \let\fetchsymbol\xfetchsymbol + \nosymboltrue + \the\symbolsetups + \ifnosymbol + \xredosymbol\currentsymbol + \ifnosymbol + \egroup\@EAEAEA\secondoftwoarguments + \else + \egroup\@EAEAEA\firstoftwoarguments + \fi + \else + \egroup\@EA\firstoftwoarguments + \fi} + +%D \macros +%D {setupsymbolset,startsymbolset} +%D +%D From these macro definitions one can deduce that symbols can +%D be grouped in symbol sets: +%D +%D \starttyping +%D \startsymbolset [navigation 1] +%D \definefiguresymbol [Next] [mp-symb.1] +%D \definefiguresymbol [Prev] [mp-symb.2] +%D \stopsymbolset +%D \stoptyping +%D +%D Such a symbol can be typeset with: +%D +%D \starttyping +%D \setupsymbolset[navigation 1]\symbol[Next] +%D \stoptyping +%D +%D or simply: +%D +%D \starttyping +%D \symbol[navigation 1][Next] +%D \stoptyping +%D +%D Formally: +%D +%D \showsetup{setupsymbolset} +%D \showsetup{startsymbolset} + +\let\currentsymboldef\empty + +\def\startsymbolset[#1] + {\def\currentsymboldef{#1}} + +\def\stopsymbolset + {\let\currentsymboldef\empty} + +\newtoks\symbolsetups + +\def\setupsymbolset[#1]% + {\prependtoksonce\fetchsymbol{#1}\to\symbolsetups} + +\def\resetsymbolset + {\symbolsetups\emptytoks} + +\def\forcesymbolset[#1]% + {\symbolsetups{\fetchsymbol{#1}}} + +%D \macros +%D {showsymbolset} +%D +%D \showsetup{showsymbolset} + +\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run.mkii} + +%D \macros +%D {usesymbols} +%D +%D \showsetup{usesymbols} + +\def\dousesymbols#1% + {\makeshortfilename[\truefilename{\f!symbolprefix#1}]% + \startreadingfile + \readsysfile\shortfilename + {\showmessage\m!symbols1{#1}} + \donothing + \stopreadingfile} + +\def\usesymbols[#1]% + {\processcommalist[#1]\dousesymbols} + +%D As longs as symbols are linked to levels or numbers, we can +%D also use the conversion mechanism, but in for instance the +%D itemization macros, we prefer symbols because they can more +%D easier be (partially) redefined. + +\protect \endinput diff --git a/tex/context/base/symb-ini.mkiv b/tex/context/base/symb-ini.mkiv new file mode 100644 index 000000000..253a7c41c --- /dev/null +++ b/tex/context/base/symb-ini.mkiv @@ -0,0 +1,281 @@ +%D \module +%D [ file=symb-ini, +%D version=1998.07.20, +%D title=\CONTEXT\ Symbol Libraries, +%D subtitle=Basic Symbols Commands, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D The macros described here used to be part of the \type +%D {core-con} module. I decided to move them here when +%D symbolsets saw the light. Let their light shine. + +\writestatus{loading}{ConTeXt Symbol Libraries / Initialization} + +\unprotect + +%D \macros +%D {definesymbol, symbol} +%D +%D Converting numbers or levels into a character, romannumeral, +%D symbol or something else, is supported by many \CONTEXT\ +%D commands. Therefore we need a mechanism for linking such +%D numbers to their counterparts. +%D +%D First we take care of symbols. These are for instance used +%D in enumerations and itemizations. We have: +%D +%D \showsetup{definesymbol} +%D \showsetup{symbol} +%D +%D Symbols are simply linked to a tag. Such tags can be numbers +%D or strings. +%D +%D \starttyping +%D \definesymbol [1] [$\bullet$] +%D \definesymbol [level 5] [$\star$] +%D \stoptyping + +% ss:tag -> symbol +% ss:set:tag -> symbol out of set +% sstag -> list of symbols in set + +\def\definesymbol + {\dotripleempty\dodefinesymbol} + +% \def\dodefinesymbol[#1][#2][#3]% class name meaning +% {\ifthirdargument +% \setvalue{\??ss:#1:#2}{#3}% +% \doifsomething{#1}{\addvalue{\??ss*#1}{#2}}% +% \else +% \setvalue{\??ss:\currentsymboldef:#1}{#2}% +% \fi} + +\def\dodefinesymbol[#1][#2][#3]% class name meaning + {\ifthirdargument + \setvalue{\??ss:#1:#2}{#3}% + \doifsomething{#1}{\addvalue{\??ss*#1}{#2}}% + \else + \setvalue{\??ss:\currentsymboldef:#1}{#2}% + \addvalue{\??ss*\currentsymboldef}{#1}% + \fi} + +\def\doifinsymbolsetelse#1#2{\doifdefinedelse{\??ss:#1:#2}} +\def\doifinsymbolset #1#2{\doifdefined {\??ss:#1:#2}} +\def\doifsymbolsetelse #1{\doifdefinedelse{\??ss*#1}} + +\def\symbolset#1{\executeifdefined{\??ss*#1}\empty} % no [#1], to be used in commalists etc + +%D Since symbols are used frequently in interactive +%D documents, we speed up this one. Well, that was history, +%D since now we simplified things a bit, because the low +%D level macros have been sped up now and then. + +\unexpanded\def\symbol % This one always gobbles spaces, + {\dodoubleempty\dosymbol} % so never change it again! + +\newif\ifnosymbol \newtoks\everysymbol + +\def\dodosymbol#1#2% \relax's prevent lookahead problems + {\nosymbolfalse{\the\everysymbol\csname\??ss:#1:#2\endcsname\relax}\relax} + +\def\directsymbol#1#2% no \relax, there can be an argument, see lists + {\executeifdefined{\??ss:#1:#2}\firstofoneargument} + +% We support both: +% +% Test test \symbol[whatever]\ test \symbol[whatever]. +% Test test \symbol{whatever} test \symbol{whatever}. + +\def\dosymbol % so we also handle \symbol{name} + {\iffirstargument % which is nicer with following spaces + \expandafter\donormalsymbol + \else + \expandafter\dospecialsymbol + \fi} + +\def\dospecialsymbol[#1][#2]#3% + {\firstargumenttrue + \secondargumentfalse + \donormalsymbol[#3][]} + +\def\donormalsymbol[#1][#2]% + {\nosymboltrue + \ifsecondargument + \edef\currentsymbol{#2}% + \doifinsymbolset{#1}{#2}{\dodosymbol{#1}{#2}}% + \else + \edef\currentsymbol{#1}% + \fi + \ifnosymbol + \the\symbolsetups + \ifnosymbol + \redosymbol\currentsymbol + \fi + \fi} + +\def\fetchsymbol#1% + {\ifnosymbol + \doifinsymbolset{#1}\currentsymbol{\dodosymbol{#1}\currentsymbol}% + \fi} + +\def\redosymbol#1% +% {\doifinsymbolsetelse\empty{#1}{\dodosymbol\empty{#1}}{#1}} % more efficient: + {\doifinsymbolsetelse\empty{#1}{\dodosymbol\empty}\firstofoneargument{#1}} + +% % % % % +% this should go in symb-fig, to be loaded after core-fig + +%D \macros +%D {definefiguresymbol} +%D +%D To simplify defining figure symbols, we offer: +%D +%D \showsetup{definefiguresymbol} +%D +%D By default, such symbols scale along the current bodyfont +%D size or running font size (which is better). + +\def\defaultsymbolfactor{10} +\def\defaultsymbolheight{1.25ex} + +\def\figuresymbol + {\dodoubleempty\dofiguresymbol} + +\ifx\externalfigure \undefined \def\externalfigure[#1][#2]{#1} \fi +\ifx\resetexternalfigures\undefined \let\resetexternalfigures\relax \fi + +\def\dofiguresymbol[#1][% #2]% + {\externalfigure[#1][\c!reset=\v!yes,\c!symbol=\v!yes,\c!height=\defaultsymbolheight,}% #2]} + +\appendtoks \resetexternalfigures \to \everysymbol + +\def\definefiguresymbol + {\dotripleempty\dodefinefiguresymbol} + +\def\dodefinefiguresymbol[#1][#2][#3]% + {\ifsecondargument + \definesymbol[#1][{\dofiguresymbol[#2][#3]}]% + \fi} + +% but for the moment we keep it here +% % % % % % + +%\def\objectsymbol[#1]% +% {\dopresetfieldsymbol{#1}\dogetfieldsymbol{#1}} + +%D \macros +%D {doifsymboldefinedelse} +%D +%D A handy private one: + +% a bit messy + +\def\xfetchsymbol#1% + {\ifnosymbol + \doifinsymbolset{#1}\currentsymbol\nosymbolfalse + \fi} + +\def\xredosymbol#1% + {\doifinsymbolset\empty\currentsymbol\nosymbolfalse} + +\def\doifsymboldefinedelse#1% + {\bgroup + \edef\currentsymbol{#1}% + \let\fetchsymbol\xfetchsymbol + \nosymboltrue + \the\symbolsetups + \ifnosymbol + \xredosymbol\currentsymbol + \ifnosymbol + \egroup\@EAEAEA\secondoftwoarguments + \else + \egroup\@EAEAEA\firstoftwoarguments + \fi + \else + \egroup\@EA\firstoftwoarguments + \fi} + +%D \macros +%D {setupsymbolset,startsymbolset} +%D +%D From these macro definitions one can deduce that symbols can +%D be grouped in symbol sets: +%D +%D \starttyping +%D \startsymbolset [navigation 1] +%D \definefiguresymbol [Next] [mp-symb.1] +%D \definefiguresymbol [Prev] [mp-symb.2] +%D \stopsymbolset +%D \stoptyping +%D +%D Such a symbol can be typeset with: +%D +%D \starttyping +%D \setupsymbolset[navigation 1]\symbol[Next] +%D \stoptyping +%D +%D or simply: +%D +%D \starttyping +%D \symbol[navigation 1][Next] +%D \stoptyping +%D +%D Formally: +%D +%D \showsetup{setupsymbolset} +%D \showsetup{startsymbolset} + +\let\currentsymboldef\empty + +\def\startsymbolset[#1] + {\def\currentsymboldef{#1}} + +\def\stopsymbolset + {\let\currentsymboldef\empty} + +\newtoks\symbolsetups + +\def\setupsymbolset[#1]% + {\prependtoksonce\fetchsymbol{#1}\to\symbolsetups} + +\def\resetsymbolset + {\symbolsetups\emptytoks} + +\def\forcesymbolset[#1]% + {\symbolsetups{\fetchsymbol{#1}}} + +%D \macros +%D {showsymbolset} +%D +%D \showsetup{showsymbolset} + +\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run.mkiv} + +%D \macros +%D {usesymbols} +%D +%D \showsetup{usesymbols} + +\def\dousesymbols#1% + {\makeshortfilename[\truefilename{\f!symbolprefix#1}]% + \startreadingfile + \readsysfile\shortfilename + {\showmessage\m!symbols1{#1}} + \donothing + \stopreadingfile} + +\def\usesymbols[#1]% + {\processcommalist[#1]\dousesymbols} + +%D As longs as symbols are linked to levels or numbers, we can +%D also use the conversion mechanism, but in for instance the +%D itemization macros, we prefer symbols because they can more +%D easier be (partially) redefined. + +\protect \endinput diff --git a/tex/context/base/symb-ini.tex b/tex/context/base/symb-ini.tex deleted file mode 100644 index 291e22790..000000000 --- a/tex/context/base/symb-ini.tex +++ /dev/null @@ -1,294 +0,0 @@ -%D \module -%D [ file=symb-ini, -%D version=1998.07.20, -%D title=\CONTEXT\ Symbol Libraries, -%D subtitle=Basic Symbols Commands, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D The macros described here used to be part of the \type -%D {core-con} module. I decided to move them here when -%D symbolsets saw the light. Let their light shine. - -\writestatus{loading}{ConTeXt Symbol Libraries / Initialization} - -\unprotect - -%D \macros -%D {definesymbol, symbol} -%D -%D Converting numbers or levels into a character, romannumeral, -%D symbol or something else, is supported by many \CONTEXT\ -%D commands. Therefore we need a mechanism for linking such -%D numbers to their counterparts. -%D -%D First we take care of symbols. These are for instance used -%D in enumerations and itemizations. We have: -%D -%D \showsetup{definesymbol} -%D \showsetup{symbol} -%D -%D Symbols are simply linked to a tag. Such tags can be numbers -%D or strings. -%D -%D \starttyping -%D \definesymbol [1] [$\bullet$] -%D \definesymbol [level 5] [$\star$] -%D \stoptyping - -% ss:tag -> symbol -% ss:set:tag -> symbol out of set -% sstag -> list of symbols in set - -\def\definesymbol - {\dotripleempty\dodefinesymbol} - -% \def\dodefinesymbol[#1][#2][#3]% class name meaning -% {\ifthirdargument -% \setvalue{\??ss:#1:#2}{#3}% -% \doifsomething{#1}{\addvalue{\??ss*#1}{#2}}% -% \else -% \setvalue{\??ss:\currentsymboldef:#1}{#2}% -% \fi} - -\def\dodefinesymbol[#1][#2][#3]% class name meaning - {\ifthirdargument - \setvalue{\??ss:#1:#2}{#3}% - \doifsomething{#1}{\addvalue{\??ss*#1}{#2}}% - \else - \setvalue{\??ss:\currentsymboldef:#1}{#2}% - \addvalue{\??ss*\currentsymboldef}{#1}% - \fi} - -\def\doifinsymbolsetelse#1#2{\doifdefinedelse{\??ss:#1:#2}} -\def\doifinsymbolset #1#2{\doifdefined {\??ss:#1:#2}} -\def\doifsymbolsetelse #1{\doifdefinedelse{\??ss*#1}} - -\def\symbolset#1{\executeifdefined{\??ss*#1}\empty} % no [#1], to be used in commalists etc - -%D Since symbols are used frequently in interactive -%D documents, we speed up this one. Well, that was history, -%D since now we simplified things a bit, because the low -%D level macros have been sped up now and then. - -\unexpanded\def\symbol % This one always gobbles spaces, - {\dodoubleempty\dosymbol} % so never change it again! - -\newif\ifnosymbol \newtoks\everysymbol - -\def\dodosymbol#1#2% \relax's prevent lookahead problems - {\nosymbolfalse{\the\everysymbol\csname\??ss:#1:#2\endcsname\relax}\relax} - -\def\directsymbol#1#2% no \relax, there can be an argument, see lists - {\executeifdefined{\??ss:#1:#2}\firstofoneargument} - -% \def\dosymbol[#1][#2]% -% {\nosymboltrue -% \ifsecondargument -% \doifinsymbolset{#1}{#2}{\dodosymbol{#1}{#2}}% -% \fi -% \ifnosymbol -% \edef\currentsymbol{#1}% -% \the\symbolsetups -% \ifnosymbol -% \redosymbol\currentsymbol -% \fi -% \fi} - -% We support both: -% -% Test test \symbol[whatever]\ test \symbol[whatever]. -% Test test \symbol{whatever} test \symbol{whatever}. - -\def\dosymbol % so we also handle \symbol{name} - {\iffirstargument % which is nicer with following spaces - \expandafter\donormalsymbol - \else - \expandafter\dospecialsymbol - \fi} - -\def\dospecialsymbol[#1][#2]#3% - {\firstargumenttrue - \secondargumentfalse - \donormalsymbol[#3][]} - -\def\donormalsymbol[#1][#2]% - {\nosymboltrue - \ifsecondargument - \edef\currentsymbol{#2}% - \doifinsymbolset{#1}{#2}{\dodosymbol{#1}{#2}}% - \else - \edef\currentsymbol{#1}% - \fi - \ifnosymbol - \the\symbolsetups - \ifnosymbol - \redosymbol\currentsymbol - \fi - \fi} - -\def\fetchsymbol#1% - {\ifnosymbol - \doifinsymbolset{#1}\currentsymbol{\dodosymbol{#1}\currentsymbol}% - \fi} - -\def\redosymbol#1% -% {\doifinsymbolsetelse\empty{#1}{\dodosymbol\empty{#1}}{#1}} % more efficient: - {\doifinsymbolsetelse\empty{#1}{\dodosymbol\empty}\firstofoneargument{#1}} - -% % % % % -% this should go in symb-fig, to be loaded after core-fig - -%D \macros -%D {definefiguresymbol} -%D -%D To simplify defining figure symbols, we offer: -%D -%D \showsetup{definefiguresymbol} -%D -%D By default, such symbols scale along the current bodyfont -%D size or running font size (which is better). - -\def\defaultsymbolfactor{10} -\def\defaultsymbolheight{1.25ex} - -\def\figuresymbol - {\dodoubleempty\dofiguresymbol} - -\ifx\externalfigure \undefined \def\externalfigure[#1][#2]{#1} \fi -\ifx\resetexternalfigures\undefined \let\resetexternalfigures\relax \fi - -\def\dofiguresymbol[#1][% #2]% - {\externalfigure[#1][\c!reset=\v!yes,\c!symbol=\v!yes,\c!height=\defaultsymbolheight,}% #2]} - -\appendtoks \resetexternalfigures \to \everysymbol - -\def\definefiguresymbol - {\dotripleempty\dodefinefiguresymbol} - -\def\dodefinefiguresymbol[#1][#2][#3]% - {\ifsecondargument - \definesymbol[#1][{\dofiguresymbol[#2][#3]}]% - \fi} - -% but for the moment we keep it here -% % % % % % - -%\def\objectsymbol[#1]% -% {\dopresetfieldsymbol{#1}\dogetfieldsymbol{#1}} - -%D \macros -%D {doifsymboldefinedelse} -%D -%D A handy private one: - -% a bit messy - -\def\xfetchsymbol#1% - {\ifnosymbol - \doifinsymbolset{#1}\currentsymbol\nosymbolfalse - \fi} - -\def\xredosymbol#1% - {\doifinsymbolset\empty\currentsymbol\nosymbolfalse} - -\def\doifsymboldefinedelse#1% - {\bgroup - \edef\currentsymbol{#1}% - \let\fetchsymbol\xfetchsymbol - \nosymboltrue - \the\symbolsetups - \ifnosymbol - \xredosymbol\currentsymbol - \ifnosymbol - \egroup\@EAEAEA\secondoftwoarguments - \else - \egroup\@EAEAEA\firstoftwoarguments - \fi - \else - \egroup\@EA\firstoftwoarguments - \fi} - -%D \macros -%D {setupsymbolset,startsymbolset} -%D -%D From these macro definitions one can deduce that symbols can -%D be grouped in symbol sets: -%D -%D \starttyping -%D \startsymbolset [navigation 1] -%D \definefiguresymbol [Next] [mp-symb.1] -%D \definefiguresymbol [Prev] [mp-symb.2] -%D \stopsymbolset -%D \stoptyping -%D -%D Such a symbol can be typeset with: -%D -%D \starttyping -%D \setupsymbolset[navigation 1]\symbol[Next] -%D \stoptyping -%D -%D or simply: -%D -%D \starttyping -%D \symbol[navigation 1][Next] -%D \stoptyping -%D -%D Formally: -%D -%D \showsetup{setupsymbolset} -%D \showsetup{startsymbolset} - -\let\currentsymboldef\empty - -\def\startsymbolset[#1] - {\def\currentsymboldef{#1}} - -\def\stopsymbolset - {\let\currentsymboldef\empty} - -\newtoks\symbolsetups - -\def\setupsymbolset[#1]% - {\prependtoksonce\fetchsymbol{#1}\to\symbolsetups} - -\def\resetsymbolset - {\symbolsetups\emptytoks} - -\def\forcesymbolset[#1]% - {\symbolsetups{\fetchsymbol{#1}}} - -%D \macros -%D {showsymbolset} -%D -%D \showsetup{showsymbolset} - -\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run} - -%D \macros -%D {usesymbols} -%D -%D \showsetup{usesymbols} - -\def\dousesymbols#1% - {\makeshortfilename[\truefilename{\f!symbolprefix#1}]% - \startreadingfile - \readsysfile\shortfilename - {\showmessage\m!symbols1{#1}} - \donothing - \stopreadingfile} - -\def\usesymbols[#1]% - {\processcommalist[#1]\dousesymbols} - -%D As longs as symbols are linked to levels or numbers, we can -%D also use the conversion mechanism, but in for instance the -%D itemization macros, we prefer symbols because they can more -%D easier be (partially) redefined. - -\protect \endinput diff --git a/tex/context/base/symb-jmn.tex b/tex/context/base/symb-jmn.tex index 392cac552..1ed65d16e 100644 --- a/tex/context/base/symb-jmn.tex +++ b/tex/context/base/symb-jmn.tex @@ -40,8 +40,13 @@ \loadmapfile[original-base.map] % \loadmapfile [original-context-symbol.map] -\definefontsynonym[NavigationNormal] [hans] -\definefontsynonym[NavigationShadowed] [hans-sh] +\ifnum\texengine=\luatexengine + \definefontsynonym[NavigationNormal] [hans.tfm] + \definefontsynonym[NavigationShadowed] [hans-sh.tfm] +\else + \definefontsynonym[NavigationNormal] [hans] + \definefontsynonym[NavigationShadowed] [hans-sh] +\fi \definefontsynonym[NavigationFont] [NavigationNormal] %definefontsynonym[NavigationFont] [NavigationShadowed] diff --git a/tex/context/base/symb-nav.tex b/tex/context/base/symb-nav.tex index 1dd451538..90a798e01 100644 --- a/tex/context/base/symb-nav.tex +++ b/tex/context/base/symb-nav.tex @@ -15,11 +15,13 @@ \loadmapfile[original-base.map] % \loadmapfile [original-context-symbol.map] -\definefontsynonym [ContextNavigation] [contnav] +\ifnum\texengine=\luatexengine + \definefontsynonym [ContextNavigation] [contnav.tfm] +\else + \definefontsynonym [ContextNavigation] [contnav] +\fi -% \def\ContextNavigationGlyph#1{\getglyph{ContextNavigation}{\char#1}} - -\def\ContextNavigationGlyph#1{\getrawglyph{contnav}{\char#1}} +\def\ContextNavigationGlyph#1{\getglyph{ContextNavigation}{\char#1}} \startsymbolset [navigation 1] diff --git a/tex/context/base/symb-run.mkii b/tex/context/base/symb-run.mkii new file mode 100644 index 000000000..4e714832c --- /dev/null +++ b/tex/context/base/symb-run.mkii @@ -0,0 +1,54 @@ +%D \module +%D [ file=symb-run, % code moved from symb-ini +%D version=1998.07.20, +%D title=\CONTEXT\ Symbol Libraries, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\gdef\doshowsymbolset[#1][#2]% todo: make nicer, use legend or so + {\vbox\bgroup + \blank + \getparameters[\??ss][\c!n=5,#2]% + \forcesymbolset[#1]% + \doifsymbolsetelse{#1} + {\global\let\allfigures\empty + \doglobal\newcounter\figurecounter + \setupcolors[\c!state=\v!start]% to prevent mps color conversion + \dontcomplain + \def\doshowsymbols% global needed due to grouping in alignment + {\expanded{\globalprocesscommalist[\symbolset{#1}]}\docommand}% + \def\docommand##1% + {\vbox + {\forgetall + \tttf + \halign + {\hss\quad####\strut\quad\hss\cr + \symbol[##1]\quad{\red\ruledhbox{\black\symbol[##1]}}\cr + \tfx##1\cr}}% + \doglobal\increment\figurecounter + \ifnum\figurecounter=\@@ssn + \doglobal\newcounter\figurecounter + \def\next{\crcr\noalign{\vskip1ex}}% + \else + \def\next{&}% + \fi + \next}% + \tabskip\zeropoint \!!plus 1fill + \halign to \hsize + {&\hss##\hss\cr\doshowsymbols\crcr}}% + {}% + \blank + \egroup} + +\gdef\showsymbolset + {\dodoubleempty\doshowsymbolset} + +\protect \endinput diff --git a/tex/context/base/symb-run.mkiv b/tex/context/base/symb-run.mkiv new file mode 100644 index 000000000..4e714832c --- /dev/null +++ b/tex/context/base/symb-run.mkiv @@ -0,0 +1,54 @@ +%D \module +%D [ file=symb-run, % code moved from symb-ini +%D version=1998.07.20, +%D title=\CONTEXT\ Symbol Libraries, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\gdef\doshowsymbolset[#1][#2]% todo: make nicer, use legend or so + {\vbox\bgroup + \blank + \getparameters[\??ss][\c!n=5,#2]% + \forcesymbolset[#1]% + \doifsymbolsetelse{#1} + {\global\let\allfigures\empty + \doglobal\newcounter\figurecounter + \setupcolors[\c!state=\v!start]% to prevent mps color conversion + \dontcomplain + \def\doshowsymbols% global needed due to grouping in alignment + {\expanded{\globalprocesscommalist[\symbolset{#1}]}\docommand}% + \def\docommand##1% + {\vbox + {\forgetall + \tttf + \halign + {\hss\quad####\strut\quad\hss\cr + \symbol[##1]\quad{\red\ruledhbox{\black\symbol[##1]}}\cr + \tfx##1\cr}}% + \doglobal\increment\figurecounter + \ifnum\figurecounter=\@@ssn + \doglobal\newcounter\figurecounter + \def\next{\crcr\noalign{\vskip1ex}}% + \else + \def\next{&}% + \fi + \next}% + \tabskip\zeropoint \!!plus 1fill + \halign to \hsize + {&\hss##\hss\cr\doshowsymbols\crcr}}% + {}% + \blank + \egroup} + +\gdef\showsymbolset + {\dodoubleempty\doshowsymbolset} + +\protect \endinput diff --git a/tex/context/base/symb-run.tex b/tex/context/base/symb-run.tex deleted file mode 100644 index 4e714832c..000000000 --- a/tex/context/base/symb-run.tex +++ /dev/null @@ -1,54 +0,0 @@ -%D \module -%D [ file=symb-run, % code moved from symb-ini -%D version=1998.07.20, -%D title=\CONTEXT\ Symbol Libraries, -%D subtitle=Runtime Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\gdef\doshowsymbolset[#1][#2]% todo: make nicer, use legend or so - {\vbox\bgroup - \blank - \getparameters[\??ss][\c!n=5,#2]% - \forcesymbolset[#1]% - \doifsymbolsetelse{#1} - {\global\let\allfigures\empty - \doglobal\newcounter\figurecounter - \setupcolors[\c!state=\v!start]% to prevent mps color conversion - \dontcomplain - \def\doshowsymbols% global needed due to grouping in alignment - {\expanded{\globalprocesscommalist[\symbolset{#1}]}\docommand}% - \def\docommand##1% - {\vbox - {\forgetall - \tttf - \halign - {\hss\quad####\strut\quad\hss\cr - \symbol[##1]\quad{\red\ruledhbox{\black\symbol[##1]}}\cr - \tfx##1\cr}}% - \doglobal\increment\figurecounter - \ifnum\figurecounter=\@@ssn - \doglobal\newcounter\figurecounter - \def\next{\crcr\noalign{\vskip1ex}}% - \else - \def\next{&}% - \fi - \next}% - \tabskip\zeropoint \!!plus 1fill - \halign to \hsize - {&\hss##\hss\cr\doshowsymbols\crcr}}% - {}% - \blank - \egroup} - -\gdef\showsymbolset - {\dodoubleempty\doshowsymbolset} - -\protect \endinput diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv index 620c43eef..89aa21df1 100644 --- a/tex/context/base/syst-aux.mkiv +++ b/tex/context/base/syst-aux.mkiv @@ -297,7 +297,6 @@ {\def\nextoptionalcommandyes{#1}% \def\nextoptionalcommandnop{#2}% \futurelet\nexttoken\inspectnextoptionalcharacter} - \def\inspectnextoptionalcharacter {\ifx\nexttoken\blankspace \@EA\reinspectnextoptionalcharacter @@ -317,7 +316,6 @@ {\def\nextbgroupcommandyes{#1}% \def\nextbgroupcommandnop{#2}% \futurelet\nexttoken\inspectnextbgroupcharacter} - \def\inspectnextbgroupcharacter {\ifx\nexttoken\blankspace \@EA\reinspectnextbgroupcharacter @@ -331,6 +329,37 @@ \@EA\nextbgroupcommandnop \fi} +\let\nextparenthesischaractertoken( + +\long\def\doifnextparenthesiselse#1#2% + {\def\nextparenthesiscommandyes{#1}% + \def\nextparenthesiscommandnop{#2}% + \futurelet\nexttoken\inspectnextparenthesischaracter} +\def\inspectnextparenthesischaracter + {\ifx\nexttoken\blankspace + \@EA\reinspectnextparenthesischaracter + \else + \@EA\inspectnextparenthesischaracterindeed + \fi} +\def\inspectnextparenthesischaracterindeed + {\ifx\nexttoken\nextparenthesischaractertoken + \@EA\nextparenthesiscommandyes + \else + \@EA\nextparenthesiscommandnop + \fi} + +%D The next one is handy in predictable situations: + +\def\doiffastoptionalcheckelse + {\futurelet\nexttoken\dodoiffastoptionalcheckelse} + +\def\dodoiffastoptionalcheckelse + {\ifx\nexttoken\nextoptionalcharactertoken + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + %D This macro uses some auxiliary macros. Although we were able %D to program quite complicated things, I only understood these %D after rereading the \TEX book. The trick is in using a @@ -1499,14 +1528,14 @@ \expandafter\rawprocesscommaitem \fi#2} -\def\rawprocesscommalist[#1]#2% accepteert ook [\cs] +\unexpanded\def\rawprocesscommalist[#1]#2% accepteert ook [\cs] {\global\advance\commalevel \plusone \expandafter\let\csname\s!next\the\commalevel\endcsname#2% \expandafter\rawprocesscommaitem#1,],% \relax \global\advance\commalevel \minusone } \def\rawprocesscommacommand[#1]% not really needed - {\expanded{\rawprocesscommalist[#1]}} + {\normalexpanded{\rawprocesscommalist[#1]}} % \def\rawdoifinsetelse#1#2{\doifinstringelse{,#1,}{,#2,}} % \def\rawdoifinset #1#2{\doifinstring {,#1,}{,#2,}} @@ -2020,13 +2049,13 @@ \expandafter\quitcommalist \fi} -\def\getfromcommalist[#1]#2[#3]% +\unexpanded\def\getfromcommalist[#1]#2[#3]% {\let\commalistelement\empty \commalistcounter#3\relax \processcommalist[#1]\p!dogetfromcommalist} -\def\getfromcommacommand[#1]% - {\expanded{\getfromcommalist[#1]}} +\unexpanded\def\getfromcommacommand[#1]% + {\normalexpanded{\getfromcommalist[#1]}} %D Watertight (and efficient) solutions are hard to find, due %D to the handling of braces during parameters passing and @@ -3013,10 +3042,10 @@ {\catcode`.=0 .catcode`.\ 12 .xdef.letterbackslash{.string\}} % hack \fi -\def\strippedcsname#1% this permits \strippedcsname{\xxx} and \strippedcsname{xxx} - {\expandafter\dostrippedcsname\string#1} +\def\checkedstrippedcsname#1% this permits \strippedcsname{\xxx} and \strippedcsname{xxx} + {\expandafter\docheckedstrippedcsname\string#1} -\def\dostrippedcsname#1% +\def\docheckedstrippedcsname#1% {\if\noexpand#1\letterbackslash\else#1\fi} %D \macros @@ -3032,7 +3061,7 @@ %D \macros %D {newconditional, %D settrue, setfalse, -%D ifconditional} +%D ifconditional,then} %D %D \TEX's lacks boolean variables, although the \PLAIN\ format %D implements \type{\newif}. The main disadvantage of this @@ -3074,8 +3103,10 @@ \def\settrue #1{\let#1\zerocount} \def\setfalse#1{\let#1\plusone} -\let\newconditional = \setfalse -\let\ifconditional = \ifcase +\let\newconditional\setfalse +\let\ifconditional \ifcase + +\let\then\relax % so that we can say: \ifnum1>2\then -) %D \macros %D {ifzeropt} @@ -3164,7 +3195,7 @@ \else \let\nextrecurse\exitstepwiserecurse \fi - \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}} + \fi\normalexpanded{\noexpand\nextrecurse{\number#1}{\number#2}{\number#3}}} \long\def\dodostepwiserecurse#1#2#3% from to step {\ifnum#1>#2\relax @@ -3393,7 +3424,7 @@ \else \let\nextrecurse\exitstepwiserecurse \fi - \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}} + \fi\normalexpanded{\noexpand\nextrecurse{\number#1}{\number#2}{\number#3}}} \long\def\doloop#1% {\global\advance\outerrecurse \plusone @@ -3636,25 +3667,6 @@ %D \doifassignmentelse {...} {then ...} {else ...} %D \stoptyping -% \def\doifassignmentelse#1% -% {\convertargument#1\to\ascii -% \doifinstringelse=\ascii} - -% \def\doifassignmentelse#1% -% {\edef\ascii{\detokenize{#1}}% -% \ifx\ascii\empty -% \expandafter\secondoftwoarguments -% \else -% \expandafter\docheckifassignmentelse -% \fi} - -% \long\def\dodoifassignmentelse -% {\expandafter\dododoifnotassignmentelse\ascii=@@\@end@ -% \expandafter\secondoftwoarguments -% \else -% \expandafter\firstoftwoarguments -% \fi} - \long\def\docheckifassignmentelse#1=#2#3\@end@{\if#2@}% \long\def\doifassignmentelse#1% @@ -4347,7 +4359,7 @@ #4{#1}% \else\ifnum#1<\zerocount \bgroup\scratchcounter#1% - \expanded{\egroup\noexpand\dorecurse{\number-\scratchcounter}}{#4{-#2#3}}% + \normalexpanded{\egroup\noexpand\dorecurse{\number-\scratchcounter}}{#4{-#2#3}}% \else\ifx#2+% \dorecurse{#1}{#4{#3}}% \else @@ -4495,6 +4507,8 @@ \dodoglobal#1\emptytoks \the\@@scratchtoks\relax} +% better: \def\flushtoks#1{\normalexpanded{\noexpand\dodoglobal#1\emptytoks\the#\relax}} + \let\dotoks\the %D \macros @@ -6865,4 +6879,9 @@ % \showvalue{mylist} +%D A variant for \type {\executeifdefined}: + +\def\expandcheckedcsname#1#2#3% + {\csname#1\ifcsname#1#2\endcsname#2\else#3\fi\endcsname} + \protect \endinput diff --git a/tex/context/base/syst-ext.mkii b/tex/context/base/syst-ext.mkii new file mode 100644 index 000000000..2ef1053d3 --- /dev/null +++ b/tex/context/base/syst-ext.mkii @@ -0,0 +1,4980 @@ +%D \module +%D [ file=syst-ext, +%D version=1995.10.10, +%D title=\CONTEXT\ System Macros, +%D subtitle=Extras, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt System Macros / Extras} + +%D In this second system module, we continue the definition of +%D some handy commands. + +\unprotect + +%D \macros +%D {rawgetparameters} +%D +%D A raw and dirty alternative for \type {\getparameters}; no +%D checking is done! + +% \def\rawgetparameters[#1][#2]% scheelt 5\% +% {\def\rawparameterprefix{#1}% +% \expandafter\rawsetparameter#2,]=,} + +\def\rawsetparameter#1=#2,% + {\if]#1\else + \expandafter\def\csname\rawparameterprefix#1\endcsname{#2}% + \expandafter\rawsetparameter + \fi} + +% the next one handles empty #1 okay: + +\def\rawgetparameters[#1][#2% some 5-10% faster + {\ifx#2]% test is needed, else bomb on [#1][] + \expandafter\gobbleoneargument + \else + \def\rawparameterprefix{#1}% + \expandafter\dorawgetparameters + \fi#2} + +\def\dorawgetparameters#1]% + {\expandafter\rawsetparameter#1,]=,} + +%D \macros +%D {doglobal, +%D redoglobal,dodoglobal,resetglobal} +%D +%D The two macros \type {\redoglobal} and \type{\dodoglobal} are +%D used in this and some other modules to enforce a user +%D specified \type {\doglobal} action. The last and often only +%D global assignment in a macro is done with +%D \type {\dodoglobal}, but all preceding ones with +%D \type {\redoglobal}. When using only alternatives, one can +%D reset this mechanism with \type {\resetglobal}. + +\def\doglobal + {\let\redoglobal\global + \def\dodoglobal{\resetglobal\global}} + +\def\resetglobal + {\let\redoglobal\relax + \let\dodoglobal\relax} + +\resetglobal + +%D New: + +\def\doglobal + {\ifx\redoglobal\relax + \let\redoglobal\global + \let\dodoglobal\@@dodoglobal + %\else + % \writestatus{system}{global not reset, warn me!}% + \fi} + +\def\@@dodoglobal + {\resetglobal\global} + +\def\saveglobal + {\let\@@dodoglobal\dodoglobal + \let\@@redoglobal\redoglobal} + +\def\restoreglobal + {\let\redoglobal\@@redoglobal + \let\dodoglobal\@@dodoglobal} + +%D A very useful application of this macro is \type {\newif}, +%D \TEX's fake boolean type. Not being a primitive, +%D \type {\global} hopelessly fails here. But a slight +%D adaption of Knuth's original macro permits: +%D +%D \starttyping +%D \doglobal\newif\iftest +%D \stoptyping +%D +%D Of course one can still say: +%D +%D \starttyping +%D \global\testtrue +%D \global\testfalse +%D \stoptyping +%D +%D Apart from the prefixes, a few more \type{\expandafters} +%D are needed: + +\def\newif#1% + {\scratchcounter\escapechar + \escapechar\minusone + \expandafter\expandafter\expandafter + \redoglobal\expandafter\expandafter\expandafter + \edef\@if#1{true}{\let\noexpand#1\noexpand\iftrue}% + \expandafter\expandafter\expandafter + \redoglobal\expandafter\expandafter\expandafter + \edef\@if#1{false}{\let\noexpand#1\noexpand\iffalse}% + \dodoglobal\@if#1{false}% + \escapechar\scratchcounter} + +%D Also new: + +\def\define#1% + {\ifx#1\undefined + \expandafter\def + \else + \message{[\noexpand#1is already defined]}% + \expandafter\def\expandafter\gobbleddefinition + \fi#1} + +\def\redefine#1% + {\ifx#1\undefined\else + \message{[\noexpand#1is redefined]}% + \fi + \def#1} + +% \define\hans{hans} +% \redefine\hans{hans} +% \define\hans#1[]#2#3{hans} + +%D The next variant fits nicely in the setups syntax: +%D +%D \starttyping +%D \starttexdefinition bagger [#1] #2 +%D oeps +%D #1 +%D oeps +%D \stoptexdefinition +%D +%D \bagger [a] {b} +%D \stoptyping + +\bgroup \obeylines + +\gdef\starttexdefinition% + {\bgroup% + \obeylines% + \dostarttexdefinition} + +\gdef\dostarttexdefinition #1 #2 + {\catcode13=\@@ignore% + \dodostarttexdefinition{#1}{#2}}% + +\long\gdef\dodostarttexdefinition#1#2#3\stoptexdefinition% + {\egroup% + \long\setvalue{#1}#2{#3}} + +\egroup + +%D \macros +%D {newcounter, +%D increment,decrement} +%D +%D Unfortunately the number of \COUNTERS\ in \TEX\ is limited, +%D but fortunately we can store numbers in a macro. We can +%D increment such pseudo \COUNTERS\ with \type{\increment}. +%D +%D \starttyping +%D \increment(\counter,20) +%D \increment(\counter,-4) +%D \increment(\counter) +%D \increment\counter +%D \stoptyping +%D +%D After this sequence of commands, the value of +%D \type{\counter} is 20, 16, 17 and~18. Of course there is +%D also the complementary command \type{\decrement}. +%D +%D Global assignments are possible too, using \type{\doglobal}: +%D +%D \starttyping +%D \doglobal\increment\counter +%D \stoptyping +%D +%D When \type{\counter} is undefined, it's value is initialized +%D at~0. It is nevertheless better to define a \COUNTER\ +%D explicitly. One reason could be that the \COUNTER\ can be +%D part of a test with \type{\ifnum} and this conditional does +%D not accept undefined macro's. The \COUNTER\ in our example +%D can for instance be defined with: +%D +%D \starttyping +%D \newcounter\counter +%D \stoptyping +%D +%D The command \type{\newcounter} must not be confused with +%D \type{\newcount}! Of course this mechanism is much slower +%D than using \TEX's \COUNTERS\ directly. In practice +%D \COUNTERS\ (and therefore our pseudo counters too) are +%D seldom the bottleneck in the processing of a text. Apart +%D from some other incompatilities we want to mention a pitfal +%D when using \type{\ifnum}. +%D +%D \starttyping +%D \ifnum\normalcounter=\pseudocounter \doif \else \doelse \fi +%D \ifnum\pseudocounter=\normalcounter \doif \else \doelse \fi +%D \stoptyping +%D +%D In the first test, \TEX\ continues it's search for the +%D second number after reading \type{\pseudocounter}, while +%D in the second test, it stops reading after having +%D encountered a real one. Tests like the first one therefore +%D can give unexpected results, for instance execution +%D of \type{\doif} even if both numbers are unequal. + +\def\zerocountervalue{0} + +\def\newcounter#1% + {\dodoglobal\let#1\zerocountervalue} + +% This is the original implementation: +% +% \def\dodododoincrement(#1,#2)% +% {\ifx#1\undefined +% \redoglobal\let#1\zerocountervalue +% \else\ifx#1\relax % \csname...\endcsname +% \redoglobal\let#1\zerocountervalue +% \fi\fi +% \scratchcounter=#2\relax +% \scratchcounter=\incrementsign\scratchcounter +% \advance\scratchcounter #1\relax +% \dodoglobal\edef#1{\the\scratchcounter}} +% +% \def\dododoincrement#1% +% {\dodododoincrement(#1,1)} +% +% \def\dodoincrement(#1% +% {\doifnextcharelse,% +% {\dodododoincrement(#1}{\dodododoincrement(#1,1}} +% +% \def\doincrement#1% +% {\def\incrementsign{#1}% +% \doifnextcharelse(\dodoincrement\dododoincrement} +% +% \def\increment{\doincrement+} +% \def\decrement{\doincrement-} +% +% And this is the one optimized for speed: + +% maxcounter = 2\maxdimen=1 + +\def\!!zerocount {0} % alongside \zerocount +\def\!!minusone {-1} % alongside \minusone +\def\!!plusone {1} % alongside \plusone + +\beginTEX + +\def\dodoindecrement#1(#2,#3)% + {\ifx#2\undefined + \redoglobal\let#2\zerocountervalue + \else\ifx#2\relax % \csname...\endcsname + \redoglobal\let#2\zerocountervalue + \fi\fi + \scratchcounter#3\relax + \scratchcounter#1\scratchcounter + \advance\scratchcounter#2\relax + \dodoglobal\edef#2{\the\scratchcounter}} + +\def\dodoincrement(#1% + {\doifnextcharelse,{\dodoindecrement+(#1}{\dodoindecrement+(#1,1}} + +\def\dododecrement(#1% + {\doifnextcharelse,{\dodoindecrement-(#1}{\dodoindecrement-(#1,1}} + +\def\doincrement#1% 10% faster alternative + {\ifx#1\undefined + \dodoglobal\let#1\!!plusone + \else\ifx#1\relax % \csname...\endcsname + \dodoglobal\let#1\!!plusone + \else + \fastincrement#1% + \fi\fi} + +\def\dodecrement#1% 10% faster alternative + {\ifx#1\undefined + \dodoglobal\let#1\!!minusone + \else\ifx#1\relax % \csname...\endcsname + \dodoglobal\let#1\!!minusone + \else + \fastdecrement#1% + \fi\fi} + +\def\fastdecrement#1% 50% faster alternative + {\scratchcounter#1\advance\scratchcounter\minusone + \dodoglobal\edef#1{\the\scratchcounter}} + +\def\fastincrement#1% 50% faster alternative + {\scratchcounter#1\advance\scratchcounter\plusone + \dodoglobal\edef#1{\the\scratchcounter}} + +\endTEX + +\beginETEX \numexpr + +% \def\doindecrement#1#2% +% {\dodoglobal\edef#2% +% {\the\numexpr(\ifx#2\undefined\else\ifx#2\relax\else#2\fi\fi#11)}} +% +% \def\doincrement{\doindecrement+} +% \def\dodecrement{\doindecrement-} +% +% some 3\% faster: + +\def\doindecrement#1#2% + {\dodoglobal\edef#2% + {\the\numexpr\ifx#2\undefined\else\ifx#2\relax\else#2\fi\fi+#1\relax}} + +\def\doincrement{\doindecrement\plusone } +\def\dodecrement{\doindecrement\minusone} + +\def\dodoindecrement#1#2,#3)% + {\dodoglobal\edef#2% + {\the\numexpr\ifx#2\undefined\else\ifx#2\relax\else#2\fi\fi#1#3\relax}} + +\def\dodoincrement(#1% + {\doifnextcharelse,{\dodoindecrement+#1}{\dodoindecrement+#1,\plusone}} + +\def\dododecrement(#1% + {\doifnextcharelse,{\dodoindecrement-#1}{\dodoindecrement-#1,\plusone}} + +\def\fastincrement#1{\dodoglobal\edef#1{\the\numexpr#1+\plusone \relax}} +\def\fastdecrement#1{\dodoglobal\edef#1{\the\numexpr#1+\minusone\relax}} + +\endETEX + +\def\increment{\doifnextcharelse(\dodoincrement\doincrement} +\def\decrement{\doifnextcharelse(\dododecrement\dodecrement} + +\def\incrementvalue#1{\expandafter\increment\csname#1\endcsname} +\def\decrementvalue#1{\expandafter\decrement\csname#1\endcsname} + +%D \macros +%D {newsignal} +%D +%D When writing advanced macros, we cannot do without +%D signaling. A signal is a small (invisible) kern or penalty +%D that signals the next macro that something just happened. +%D This macro can take any action depending on the previous +%D signal. Signals must be unique and the next macro takes care +%D of that. +%D +%D \starttyping +%D \newsignal\somesignal +%D \stoptyping +%D +%D Signals old dimensions and can be used in skips, kerns and +%D tests like \type{\ifdim}. + +\newdimen\maximumsignal % step is about 0.00025pt + +\def\newsignal#1% + {\ifx#1\undefined + \advance\maximumsignal 2sp % to be save in rounding + \edef#1{\the\maximumsignal}% + \fi} + +%D \macros +%D {newskimen} +%D +%D \TEX\ offers 256 \DIMENSIONS\ and \SKIPS. Unfortunately this +%D amount is too small to suit certain packages. Therefore when +%D possible one should use: +%D +%D \starttyping +%D \newskimen\tempskimen +%D \stoptyping +%D +%D This commands allocates a \DIMENSION\ or a \SKIP, depending +%D on the availability. One should be aware of the difference +%D between both. When searching for some glue \TEX\ goes on +%D searching till it's sure that no other glue component if +%D found. This search can be canceled by using \type{\relax} +%D when possible and needed. +%D +%D \starttyping +%D \def\newskimen#1% +%D {\ifx#1\undefined +%D \ifnum\count11>\count12 +%D \newskip#1\relax +%D \else +%D \newdimen#1\relax +%D \fi +%D \fi} +%D \stoptyping +%D +%D In order to make this macro work in plain \TEX\ too, we +%D use the following alternative, which fools \TEX\ about +%D the new commands being \type {\outer} ones. + +% \def\newskimen#1% +% {\ifx#1\undefined +% \csname new\ifnum\count11>\count12 skip\else dimen\fi\endcsname#1% +% \fi} + +\let\newskimen\newdimen % it's all etex or later now + +%D \macros +%D {strippedcsname} +%D +%D The next macro can be very useful when using \type{\csname} +%D like in: +%D +%D \starttyping +%D \csname if\strippedcsname\something\endcsname +%D \stoptyping +%D +%D This expands to \type{\ifsomething}. +%D +%D \starttyping +%D \def\strippedcsname +%D {\expandafter\gobbleoneargument\string} +%D \stoptyping +%D +%D Slower but better: + +\ifx\letterbackslash\undefined + {\catcode`.=0 .catcode`.\ 12 .xdef.letterbackslash{.string\}} % hack +\fi + +\def\strippedcsname#1% this permits \strippedcsname{\xxx} and \strippedcsname{xxx} + {\expandafter\dostrippedcsname\string#1} + +\def\dostrippedcsname#1% + {\if\noexpand#1\letterbackslash\else#1\fi} + +%D \macros +%D {savenormalmeaning} +%D +%D We will use this one in: + +\def\savenormalmeaning#1% + {\ifundefined{normal\strippedcsname#1}% + \letvalue{normal\strippedcsname#1}#1% + \fi} + +%D \macros +%D {newconditional, +%D settrue, setfalse, +%D ifconditional,then} +%D +%D \TEX's lacks boolean variables, although the \PLAIN\ format +%D implements \type{\newif}. The main disadvantage of this +%D scheme is that it takes three hash table entries. A more +%D memory saving alternative is presented here. A conditional +%D is defined by: +%D +%D \starttyping +%D \newconditional\doublesided +%D \setfalse +%D \stoptyping +%D Setting a conditional is done by \type{\settrue} and +%D \type{\setfalse}: +%D +%D \starttyping +%D \settrue\doublesided +%D \setfalse +%D \stoptyping +%D while testing is accomplished by: +%D +%D \starttyping +%D \ifconditional\doublesided ... \else ... \fi +%D \setfalse +%D \stoptyping +%D We cannot use the simple scheme: +%D +%D \starttyping +%D \def\settrue#1{\let#1=\iftrue} +%D \def\settrue#1{\let#1=\iffalse} +%D \stoptyping +%D +%D Such an implementation gives problems with nested +%D conditionals. The next implementation is abaou as fast +%D and just as straightforward: + +\def\settrue #1{\chardef#1\zerocount} +\def\setfalse#1{\chardef#1\plusone} + +\let\newconditional = \setfalse +\let\ifconditional = \ifcase + +\let\then\relax % so that we can say \ifnum1>2\then -) + +%D \macros +%D {ifzeropt} +%D +%D The next macro is both cosmetic and byte saving. It is +%D pretty \type{\if}||safe too. It can be used in cases +%D like: +%D +%D \starttyping +%D \ifzeropt \somedimen ... \else ... \fi +%D \stoptyping + +\let\ifzeropt\ifcase + +%D \macros +%D {dorecurse,recurselevel,recursedepth, +%D dostepwiserecurse, +%D for} +%D +%D \TEX\ does not offer us powerfull for||loop mechanisms. On +%D the other hand its recursion engine is quite unique. We +%D therefore identify the for||looping macros by this method. +%D The most simple alternative is the one that only needs a +%D number. +%D +%D \starttyping +%D \dorecurse {n} {whatever we want} +%D \stoptyping +%D +%D This macro can be nested without problems and therefore be +%D used in situations where \PLAIN\ \TEX's \type{\loop} macro +%D ungracefully fails. The current value of the counter is +%D available in \type{\recurselevel}, before as well as after +%D the \typ{whatever we wat} stuff. +%D +%D \starttyping +%D \dorecurse % inner loop +%D {10} +%D {\recurselevel: % outer value +%D \dorecurse % inner loop +%D {\recurselevel} % outer value +%D {\recurselevel} % inner value +%D \dorecurse % inner loop +%D {\recurselevel} % outer value +%D {\recurselevel} % inner value +%D \endgraf} +%D \stoptyping +%D +%D In this example the first, second and fourth +%D \type{\recurselevel} concern the outer loop, while the third +%D and fifth one concern the inner loop. The depth of the +%D nesting is available for inspection in \type{\recursedepth}. +%D +%D Both \type{\recurselevel} and \type{\recursedepth} are +%D macros. The real \COUNTERS\ are hidden from the user because +%D we don't want any interference. + +\newcount\outerrecurse +\newcount\innerrecurse + +\def\recursedepth{\the\outerrecurse} +\def\recurselevel{0} + +\let\nextrecurse\relax + +%D Acceptable: +%D +%D \starttyping +%D \long\def\dostepwiserecurse#1#2#3% +%D {\let\nextrecurse\gobblefourarguments +%D \ifnum#3>0\relax\ifnum#2<#1\relax\else +%D \def\nextrecurse{\dosetstepwiserecurse>}% +%D \fi\fi +%D \ifnum#3<0\relax\ifnum#1<#2\relax\else +%D \def\nextrecurse{\dosetstepwiserecurse<}% +%D \fi\fi +%D \nextrecurse{#1}{#2}{#3}} +%D \stoptyping +%D +%D Better: +%D +%D \starttyping +%D \long\def\dostepwiserecurse#1#2#3% +%D {\let\nextrecurse\gobblefourarguments +%D \ifnum#3>0\relax \ifnum#2<#1\relax \else +%D \def\nextrecurse{\dosetstepwiserecurse>}% +%D \fi \else \ifnum#3<0\relax \ifnum#1<#2\relax \else +%D \def\nextrecurse{\dosetstepwiserecurse<}% +%D \fi \fi \fi +%D \nextrecurse{#1}{#2}{#3}} +%D +%D \def\@@irecurse{@@irecurse} % stepper +%D \def\@@nrecurse{@@nrecurse} % number of steps +%D \def\@@srecurse{@@srecurse} % step +%D \def\@@drecurse{@@drecurse} % direction, < or > +%D \def\@@arecurse{@@arecurse} % action +%D +%D \long\def\dosetstepwiserecurse#1#2#3#4#5% +%D {\global\advance\outerrecurse 1 +%D \setevalue{\@@drecurse\recursedepth}{#1}% +%D \setevalue{\@@irecurse\recursedepth}{\number#2}% +%D \setevalue{\@@nrecurse\recursedepth}{\number#3}% +%D \setevalue{\@@srecurse\recursedepth}{\number#4}% +%D \long\setvalue{\@@arecurse\recursedepth}{#5}% +%D \dodorecurse} +%D +%D \def\donorecurse +%D {} +%D +%D \def\dododorecurse +%D {\edef\recurselevel{\csname\@@irecurse\recursedepth\endcsname}% +%D \getvalue{\@@arecurse\recursedepth}% +%D \edef\recurselevel{\csname\@@irecurse\recursedepth\endcsname}% +%D \innerrecurse\recurselevel +%D \advance\innerrecurse \csname\@@srecurse\recursedepth\endcsname +%D \setevalue{\@@irecurse\recursedepth}{\the\innerrecurse}% +%D \dodorecurse} +%D +%D \def\dodorecurse +%D {\ifnum\csname\@@irecurse\recursedepth\endcsname +%D \csname\@@drecurse\recursedepth\endcsname +%D \csname\@@nrecurse\recursedepth\endcsname\relax +%D \expandafter\nododorecurse +%D \else +%D \expandafter\dododorecurse +%D \fi} +%D +%D \def\nododorecurse +%D {\global\advance\outerrecurse -1 +%D \edef\recurselevel{\csname\@@irecurse\recursedepth\endcsname}} +%D \stoptyping +%D +%D Cleaner and much faster: + +\def\@@irecurse{@@ir@@} % ecurse} % stepper +\def\@@arecurse{@@ar@@} % ecurse} % action + +% \mathchardef + +\long\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4 + {\global\advance\outerrecurse \plusone + \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#4}% + \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel + \ifnum#3>0\relax + \ifnum#2<#1\relax + \let\nextrecurse\exitstepwiserecurse + \else + \let\nextrecurse\dodostepwiserecurse + \fi + \else + \ifnum#3<0\relax + \ifnum#1<#2\relax + \let\nextrecurse\exitstepwiserecurse + \else + \let\nextrecurse\dodostepwisereverse + \fi + \else + \let\nextrecurse\exitstepwiserecurse + \fi + \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}} + +\beginETEX \numexpr + +\long\def\dodostepwiserecurse#1#2#3% from to step + {\ifnum#1>#2\relax + \@EA\nodostepwiserecurse + \else + \def\recurselevel{#1}% + \@EAEAEA\redostepwiserecurse\@EA + \fi\@EA{\the\numexpr\recurselevel+#3\relax}{#2}{#3}} + +\endETEX + +\beginTEX + +\long\def\dodostepwiserecurse#1#2#3% from to step + {\ifnum#1>#2\relax + \@EA\nodostepwiserecurse + \else + \def\recurselevel{#1}% + \innerrecurse#1\advance\innerrecurse#3\relax + \@EAEAEA\redostepwiserecurse\@EA + \fi\@EA{\the\innerrecurse}{#2}{#3}} + +\endTEX + +\def\expandrecursecontent + {\csname\@@arecurse\recursedepth\endcsname} + +\def\redostepwiserecurse + {\expandrecursecontent\dodostepwiserecurse} + +\beginETEX \numexpr + +\long\def\dodostepwisereverse#1#2#3% from to step + {\ifnum#1<#2\relax + \@EA\nodostepwiserecurse + \else + \def\recurselevel{#1}% + \@EAEAEA\redostepwisereverse\@EA + \fi\@EA{\the\numexpr\recurselevel#3\relax}{#2}{#3}} + +\endETEX + +\beginTEX + +\long\def\dodostepwisereverse#1#2#3% from to step + {\ifnum#1<#2\relax + \@EA\nodostepwiserecurse + \else + \def\recurselevel{#1}% + \innerrecurse#1\relax + \advance\innerrecurse#3\relax + \@EAEAEA\redostepwisereverse\@EA + \fi\@EA{\the\innerrecurse}{#2}{#3}} + +\endTEX + +\def\redostepwisereverse + {\expandrecursecontent\dodostepwisereverse} + +\def\exitstepwiserecurse + {\nodostepwiserecurse\relax} + +\def\nodostepwiserecurse#1#2#3#4% + {\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname + \global\advance\outerrecurse \minusone} + +\def\nonostepwiserecurse#1#2#3% + {\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname + \global\advance\outerrecurse \minusone} + +\def\dorecurse#1% + {\dostepwiserecurse1{#1}1} + +%D As we can see here, the simple command \type{\dorecurse} is +%D a special case of the more general: +%D +%D \starttyping +%D \dostepwiserecurse {from} {to} {step} {action} +%D \stoptyping +%D +%D This commands accepts positive and negative steps. Illegal +%D values are handles as good as possible and the macro accepts +%D numbers and \COUNTERS. +%D +%D \starttyping +%D \dostepwiserecurse {1} {10} {2} {...} +%D \dostepwiserecurse {10} {1} {-2} {...} +%D \stoptyping +%D +%D Because the simple case is used often, we implement it +%D more efficiently: + +\long\def\dorecurse#1% + {\ifcase#1\relax + \expandafter\gobbletwoarguments + \or + \expandafter\ydorecurse + \else + \expandafter\xdorecurse + \fi{#1}} + +\long\def\xdorecurse#1#2% + {\global\advance\outerrecurse \plusone + \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#2}% + \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel + \@EA\dodorecurse\@EA1\@EA{\number#1}} + +\long\def\ydorecurse#1#2% + {\global\advance\outerrecurse \plusone + \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel + \let\recurselevel\!!plusone + #2% + \@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname + \global\advance\outerrecurse \minusone} + +\beginETEX \numexpr + +\long\def\dodorecurse#1#2% from to + {\ifnum#1>#2\relax + \@EA\nodorecurse + \else + \def\recurselevel{#1}% + \@EAEAEA\redorecurse + \fi\@EA{\the\numexpr\recurselevel+\plusone\relax}{#2}} + +\endETEX + +\beginTEX + +\long\def\dodorecurse#1#2% from to + {\ifnum#1>#2\relax + \@EA\nodorecurse + \else + \def\recurselevel{#1}% + \innerrecurse#1\advance\innerrecurse\plusone + \@EAEAEA\redorecurse + \fi\@EA{\the\innerrecurse}{#2}} + +\endTEX + +\def\redorecurse + {\expandrecursecontent\dodorecurse} + +\def\nodorecurse#1#2#3% + {\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname + \global\advance\outerrecurse \minusone } + +%D \macros +%D {doloop,exitloop} +%D +%D Sometimes loops are not determined by counters, but by +%D (a combinations of) conditions. We therefore implement a +%D straightforward loop, which can only be left when we +%D explictly exit it. Nesting is supported. First we present +%D a more extensive alternative. +%D +%D \starttyping +%D \doloop +%D {Some kind of typesetting punishment \par +%D \ifnum\pageno>100 \exitloop \fi} +%D \stoptyping +%D +%D When needed, one can call for \type{\looplevel} and +%D \type{\loopdepth}. +%D +%D If we write this macros from scratch, we end up with +%D something like the ones described above: +%D +%D \starttyping +%D \def\@@eloop{@@eloop} % exit +%D \def\@@iloop{@@iloop} % stepper +%D \def\@@aloop{@@aloop} % action +%D +%D \newcount\outerloop +%D +%D \def\loopdepth% +%D {\the\outerloop} +%D +%D \def\exitloop% +%D {\setevalue{\@@eloop\loopdepth}{0}} +%D +%D \long\def\doloop#1% +%D {\global\advance\outerloop by 1 +%D \setevalue{\@@iloop\loopdepth}{1}% +%D \setevalue{\@@eloop\loopdepth}{1}% +%D \long\setvalue{\@@aloop\loopdepth}{#1}% +%D \dodoloop} +%D +%D \def\dodonoloop% +%D {\global\advance\outerloop by -1\relax} +%D +%D \def\dododoloop% +%D {\edef\looplevel{\getvalue{\@@iloop\loopdepth}}% +%D \innerrecurse=\looplevel +%D \advance\innerrecurse by 1 +%D \setevalue{\@@iloop\loopdepth}{\the\innerrecurse}% +%D \getvalue{\@@aloop\loopdepth}% +%D \edef\looplevel{\getvalue{\@@iloop\loopdepth}}% +%D \dodoloop} +%D +%D \def\dodoloop% +%D {\ifnum\getvalue{\@@eloop\loopdepth}=0 +%D \expandafter\dodonoloop +%D \else +%D \expandafter\dododoloop +%D \fi} +%D +%D \def\doloop% +%D {\dostepwiserecurse{1}{\maxdimen}{1}} +%D +%D \def\exitloop +%D {\setvalue{\@@irecurse\recursedepth}{\maxdimen}} +%D +%D \def\looplevel{\recurselevel} +%D \def\loopdepth{\recursedepth} +%D \stoptyping +%D +%D We don't have to declare new counters for \type{\looplevel} +%D and \type{\loopdepth} because we can use \type{\recurselevel} +%D and \type{\recursedepth}. +%D +%D We prefer however a more byte saving implementation, that +%D executes of course a bit slower. +%D +%D \starttyping +%D \def\doloop% +%D {\dostepwiserecurse1\maxdimen1} +%D +%D \def\exitloop% +%D {\letvalue{\@@irecurse\recursedepth}\maxdimen} +%D \stoptyping +%D +%D Although, the next version is faster because it used the +%D simple loop. + +\let\endofloop\donothing + +\long\def\doloop#1% + {\global\advance\outerrecurse \plusone + \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#1}% + \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel + \let\endofloop\dodoloop + \dodoloop1} % no \plusone else \recurselevel wrong + +\beginETEX \numexpr + +\long\def\dodoloop#1% + {\def\recurselevel{#1}% + \@EA\redoloop\@EA{\the\numexpr\recurselevel+\plusone\relax}} + +\endETEX + +\beginTEX + +\long\def\dodoloop#1% + {\def\recurselevel{#1}% + \innerrecurse#1\advance\innerrecurse\plusone + \@EA\redoloop\@EA{\the\innerrecurse}} + +\endTEX + +\def\redoloop + {\expandrecursecontent\endofloop} + +\def\nodoloop#1% + {\let\endofloop\dodoloop % new, permits nested \doloop's + \@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname + \global\advance\outerrecurse\minusone} + +\def\exitloop % \exitloop quits at end + {\let\endofloop\nodoloop} + +\long\def\exitloopnow#1\endofloop % \exitloopnow quits directly + {\nodoloop} + +%D The loop is executed at least once, so beware of situations +%D like: +%D +%D \starttyping +%D \doloop {\exitloop some commands} +%D \stoptyping +%D +%D It's just a matter of putting the text into the \type{\if} +%D statement that should be there anyway, like in: +%D +%D \starttyping +%D \doloop {\ifwhatever \exitloop \else some commands\fi} +%D \stoptyping +%D +%D You can also quit a loop immediately, by using \type +%D {\exitloopnow} instead. Beware, this is more sensitive +%D for conditional errors. + +%D Krzysztof Leszczynski suggested to provide access to the level by +%D means of a \type {#1}. I decided to pass the more frquently used +%D level as \type {#1} and the less favoured depth as \type {#2}. The +%D intended usage is: +%D +%D \starttyping +%D \dorecurse{3}{\definesymbol[test-#1][xx-#1]} +%D +%D \def\test{\dorecurse{3}{\definesymbol[test-##1][xx-##1]}} \test +%D +%D \symbol[test-1]\quad\symbol[test-2]\quad\symbol[test-3] +%D \stoptyping +%D +%D Since the hashed arguments are expanded, we don't need tricky +%D expansion here. +%D +%D \starttyping +%D \dorecurse{3}{\expanded{\definesymbol[test-\recurselevel][xx-\recurselevel]}} +%D \stoptyping + +\def\expandrecursecontent + {\csname\@@arecurse\recursedepth\@EA\@EA\@EA\endcsname\@EA\@EA\@EA{\@EA\recurselevel\@EA}\@EA{\recursedepth}} + +\long\def\xdorecurse#1#2% + {\global\advance\outerrecurse \plusone + \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#2}% + \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel + \@EA\dodorecurse\@EA1\@EA{\number#1}} + +\long\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4 + {\global\advance\outerrecurse \plusone + \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#4}% + \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel + \ifnum#3>0\relax + \ifnum#2<#1\relax + \let\nextrecurse\exitstepwiserecurse + \else + \let\nextrecurse\dodostepwiserecurse + \fi + \else + \ifnum#3<0\relax + \ifnum#1<#2\relax + \let\nextrecurse\exitstepwiserecurse + \else + \let\nextrecurse\dodostepwisereverse + \fi + \else + \let\nextrecurse\exitstepwiserecurse + \fi + \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}} + +\long\def\doloop#1% + {\global\advance\outerrecurse \plusone + \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#1}% + \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel + \let\endofloop\dodoloop + \dodoloop1} % no \plusone else \recurselevel wrong + +%D For special purposes: + +\newcount\fastrecursecounter +\newcount\lastrecursecounter +\newcount\steprecursecounter + +\def\dofastrecurse#1#2#3#4% + {\def\fastrecursebody{#4}% + \fastrecursecounter#1\relax + \lastrecursecounter#2\relax + \steprecursecounter#3\relax + \def\recurselevel{\number\fastrecursecounter}% + \dodofastrecurse} + +\def\dodofastrecurse + {\ifnum\fastrecursecounter>\lastrecursecounter\else + \fastrecursebody + \advance\fastrecursecounter\steprecursecounter + \expandafter\dodofastrecurse + \fi} + +%D This alternative looks a bit different and uses a +%D pseudo counter. When this macro is nested, we have to use +%D different counters. This time we use keywords. +%D +%D \starttyping +%D \def\alfa{2} \def\beta{100} \def\gamma{3} +%D +%D \for \n=55 \to 100 \step 1 \do {... \n ...} +%D \for \n=\alfa \to \beta \step \gamma \do {... \n ...} +%D \for \n=\n \to 120 \step 1 \do {... \n ...} +%D \for \n=120 \to 100 \step -3 \do {... \n ...} +%D \for \n=55 \to 100 \step 2 \do {... \n ...} +%D \stoptyping +%D +%D Only in the third example we need to predefine \type{\n}. +%D The use of \type{\od} as a dilimiter would have made nested +%D use more problematic. + +%D Don't use this one, it's kind of obsolete. + +\def\for#1=#2\to#3\step#4\do#5% + {\dostepwiserecurse{#2}{#3}{#4} + {\let#1\recurselevel#5\let#1\recurselevel}} + +%D \macros +%D {newevery,everyline,EveryLine,EveryPar} +%D +%D Lets skip to something quite different. It's common use +%D to use \type{\everypar} for special purposes. In \CONTEXT\ +%D we use this primitive for locating sidefloats. This means +%D that when user assignments to \type{\everypar} can interfere +%D with those of the package. We therefore introduce +%D \type{\EveryPar}. +%D +%D The same goes for \type{\EveryLine}. Because \TEX\ offers +%D no \type{\everyline} primitive, we have to call for +%D \type{\everyline} when we are working on a line by line +%D basis. Just by calling \type{\EveryPar{}} and +%D \type{\EveryLine{}} we restore the old situation. +%D +%D The definition command \type{\DoWithEvery} will be quite +%D unreadable, so let's first show an implementation that +%D shows how things are done: +%D +%D \starttyping +%D \newtoks \everyline +%D \newtoks \oldeveryline +%D \newif \ifeveryline +%D +%D \def\DoWithEvery#1#2#3#4% +%D {#3\else\edef\next{\noexpand#2={\the#1}}\next\fi +%D \edef\next{\noexpand#1={\the#2\the\scratchtoks}}\next +%D #4} +%D +%D \def\doEveryLine% +%D {\DoWithEvery\everyline\oldeveryline\ifeveryline\everylinetrue} +%D +%D \def\EveryLine% +%D {\afterassignment\doEveryLine\scratchtoks} +%D \stoptyping +%D +%D The real implementation is a bit more complicated but we +%D prefer something more versatile. + +% the old one +% +% \def\DoWithEvery#1% +% {\csname if\strippedcsname#1\endcsname \else +% \edef\next% +% {\@EA\noexpand\csname old\strippedcsname#1\endcsname= +% {\the#1}}% +% \next +% \fi +% \edef\next% +% {\noexpand#1= +% {\@EA\the\csname old\strippedcsname#1\endcsname\the\scratchtoks}}% +% \next +% \csname\strippedcsname#1true\endcsname} +% +% \def\dowithevery#1% +% {\@EA\afterassignment\csname do\strippedcsname#1\endcsname\scratchtoks} +% +% \def\newevery#1#2% +% {\ifx#1\undefined\newtoks#1\fi +% \ifx#2\relax\else\ifx#2\undefined +% \@EA\newtoks\csname old\strippedcsname#1\endcsname +% \@EA\newif \csname if\strippedcsname#1\endcsname +% \@EA\def \csname do\strippedcsname#2\endcsname{\DoWithEvery#1}% +% \def#2{\dowithevery#2}% +% \fi\fi} +% +% cleaner and more efficient + +%\def\dowithevery#1% +% {\def\dodowithevery% +% {\ifcase\csname c\strippedcsname#1\endcsname \expandafter\chardef +% \csname c\strippedcsname#1\endcsname=1 +% \csname t\strippedcsname#1\endcsname=#1% +% \fi +% \edef\next% +% {#1={\the\csname t\strippedcsname#1\endcsname\the\scratchtoks}}% +% \next}% +% \afterassignment\dodowithevery\scratchtoks} +% +% more efficient: + +\def\dodowithevery#1% + {\ifcase\csname c\strippedcsname#1\endcsname \expandafter\chardef + \csname c\strippedcsname#1\endcsname1 + \csname t\strippedcsname#1\endcsname#1% + \fi + \edef\next% + {#1{\the\csname t\strippedcsname#1\endcsname\the\scratchtoks}}% + \next} + +\def\dowithevery#1% + {\def\next{\dodowithevery#1}% + \afterassignment\next\scratchtoks} + +\bgroup \let\newtoks\relax % plain safe (\outer) + +\gdef\newevery#1#2% + {\ifx#1\undefined\csname newtoks\endcsname#1\fi % plain safe (\outer) + \ifx#2\relax\else\ifx#2\undefined + \expandafter\newtoks\csname t\strippedcsname#1\endcsname + \expandafter\chardef\csname c\strippedcsname#1\endcsname\zerocount + \def#2{\dowithevery#1}% + \fi\fi} + +\egroup + +%D The first \type {\outer} hack is needed to trick \TEX\ +%D into thinking that \type {\newtoks} is no outer macro, +%D the second hack is needed due to some funny interaction +%D between outer macros and \type {\if} at expansion time. + +%D This one permits definitions like: + +\newevery \everypar \EveryPar +\newevery \everyline \EveryLine + +%D and how about: + +\newevery \neverypar \NeveryPar + +%D Which we're going to use indeed! When the second argument +%D equals \type {\relax}, the first token list is created +%D unless it is already defined. + +%D Technically spoken we could have used the method we are +%D going to present in the visual debugger. First we save +%D the primitive \type{\everypar}: +%D +%D \starttyping +%D \let\normaleverypar=\everypar +%D \stoptyping +%D +%D Next we allocate a \TOKENLIST\ named \type{\everypar}, +%D which means that \type{\everypar} is no longer a primitive +%D but something like \type{\toks44}. +%D +%D \starttyping +%D \newtoks\everypar +%D \stoptyping +%D +%D Because \TEX\ now executes \type{\normaleverypar} instead +%D of \type{\everypar}, we are ready to assign some tokens to +%D this internally known and used \TOKENLIST. +%D +%D \starttyping +%D \normaleverypar={all the things the system wants to do \the\everypar} +%D \stoptyping +%D +%D Where the user can provide his own tokens to be expanded +%D every time he expects them to expand. +%D +%D \starttyping +%D \everypar={something the user wants to do} +%D \stoptyping +%D +%D We don't use this method because it undoubtly leads to +%D confusing situations, especially when other packages are +%D used, but it's this kind of tricks that make \TEX\ so +%D powerful. + +%D \macros +%D {convertargument,convertcommand,convertvalue} +%D +%D Some persistent experimenting led us to the next macro. This +%D macro converts a parameter or an expanded macro to it's +%D textual meaning. +%D +%D \starttyping +%D \convertargument ... \to \command +%D \stoptyping +%D +%D For example, +%D +%D \starttyping +%D \convertargument{one \two \three{four}}\to\ascii +%D \stoptyping +%D +%D The resulting macro \type{\ascii} can be written to a file +%D or the terminal without problems. In \CONTEXT\ we use this +%D macro for generating registers and tables of contents. +%D +%D The second conversion alternative accepts a command: +%D +%D \starttyping +%D \convertcommand\command\to\ascii +%D \stoptyping +%D +%D Both commands accept the prefix \type{\doglobal} for global +%D assignments. + +\beginTEX + +\def\doconvertargument#1>{} + +\def\convertedcommand + {\expandafter\doconvertargument\meaning} + +\long\def\convertargument#1\to#2% + {\long\def#2{#1}% saves a restore + \dodoglobal\edef#2{\convertedcommand#2}} + +\long\def\convertcommand#1\to#2% + {\dodoglobal\edef#2{\convertedcommand#1}} + +% no dodoglobal ! + +\long\def\defconvertedargument#1#2% less sensitive for \to + {\long\def#1{#2}% saves a restore + \edef#1{\convertedcommand#1}} + +\long\def\defconvertedcommand#1#2% less sensitive for \to + {\edef#1{\convertedcommand#2}} + +\long\def\gdefconvertedargument#1#2% less sensitive for \to + {\long\gdef#1{#2}% saves a restore + \xdef#1{\convertedcommand#1}} + +\long\def\gdefconvertedcommand#1#2% less sensitive for \to + {\xdef#1{\convertedcommand#2}} + +\endTEX + +\def\convertvalue#1\to + {\expandafter\convertcommand\csname#1\endcsname\to} + +\def\defconvertedvalue#1#2% less sensitive for \to + {\@EA\defconvertedcommand\@EA#1\csname#2\endcsname} + +%D \macros +%D {doifassignmentelse} +%D +%D A lot of \CONTEXT\ commands take optional arguments, for +%D instance: +%D +%D \starttyping +%D \dothisorthat[alfa,beta] +%D \dothisorthat[first=foo,second=bar] +%D \dothisorthat[alfa,beta][first=foo,second=bar] +%D \stoptyping +%D +%D Although a combined solution is possible, we prefer a +%D seperation. The next command takes care of propper +%D handling of such multi||faced commands. +%D +%D \starttyping +%D \doifassignmentelse {...} {then ...} {else ...} +%D \stoptyping + +% not robust +% +% \def\doifassignmentelse% +% {\doifinstringelse{=}} +% +% readable +% +% \def\doifassignmentelse#1% +% {\convertargument#1\to\ascii +% \doifinstringelse{=}{\ascii}} + +\def\doifassignmentelse#1% + {\convertargument#1\to\ascii + \doifinstringelse=\ascii} + +%D \macros +%D {convertasciiafter} +%D +%D Sometimes we need to convert an argument to a string (letters +%D only), for instance when we compare it with another string: +%D +%D \starttyping +%D \convertasciiafter\doifinstringelse{em}{\ascii}{...} +%D \stoptyping + +\def\convertasciiafter#1#2% + {\convertargument#2\to\asciiafter + \@EA#1\@EA{\asciiafter}} + +%D In \ETEX\ we can use \type {\detokenize} and gain some +%D speed, but in general far less that 1\% for \type +%D {\convertargument} and nil for \type {\convertcommand}. +%D This macro is more robust than the pure \TEX\ one, +%D something I found out when primitives like \type +%D {\jobname} were fed (or something undefined). + +% command variant: one level expansion ! + +\beginETEX \detokenize + +\long\def\convertargument#1\to#2{\dodoglobal\edef#2{\detokenize{#1}}} +\long\def\convertcommand #1\to#2{\dodoglobal\edef#2{\@EA\detokenize\@EA{#1}}} % hm, only second is also ok + +\long\def\defconvertedargument #1#2{\edef#1{\detokenize {#2}}} +\long\def\defconvertedcommand #1#2{\edef#1{\detokenize\@EA{#2}}} +\long\def\edefconvertedargument#1#2{\edef#1{#2}% + \edef#1{\detokenize\@EA{#1}}} +\long\def\gdefconvertedargument#1#2{\xdef#1{\detokenize {#2}}} +\long\def\gdefconvertedcommand #1#2{\xdef#1{\detokenize\@EA{#2}}} +\long\def\xdefconvertedargument#1#2{\xdef#1{#2}% + \xdef#1{\detokenize\@EA{#1}}} + +\endETEX + +%D When you try to convert a primitive command, you'll find +%D out that the \ETEX\ method fails on for instance \type +%D {\jobname} in the sense that it returns the filename +%D instead of just \type {\jobname}. So far this does not +%D give real problems. + +%D This is typically a macro that one comes to after reading +%D the \TEX book carefully. Even then, the definite solution +%D was found after rereading the \TEX book. The first +%D implementation was: +%D +%D \starttyping +%D \def\doconvertargument#1->#2\\\\{#2} +%D \stoptyping +%D +%D The \type{-}, the delimiter \type{\\\\} and the the second +%D argument are completely redundant. + +%D \macros +%D {showvalue,showargument} +%D +%D Two handy macros for testing purposes only: + +\def\showvalue#1% + {\expandafter\show\csname#1\endcsname} + +\beginETEX + +\def\showvalue#1% + {\ifcsname#1\endcsname + \expandafter\show\csname#1\endcsname + \else + \show\undefined + \fi} + +\endETEX + +\long\def\showargument#1% + {\defconvertedargument\ascii{#1}\ascii} + +%D \macros +%D {doifmeaningelse} +%D +%D We can use both commands in testing, but alas, not all +%D meanings expand to something \type {->}. This is no problem +%D in the \ETEX\ implementation, but since we want +%D compatibility, we need: +%D +%D \starttyping +%D \doifmeaningelse {\next} {\something} {true} {false} +%D \stoptyping +%D +%D Watch the one level expansion of the second argument. + +\def\doifmeaningelse#1#2% + {\edef\!!stringa{\meaning#1}% + \def\!!stringb{#2}\edef\!!stringb{\meaning\!!stringb}% + \ifx\!!stringa\!!stringb + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +%D \macros +%D {doifsamestringselse,doifsamestring,doifnotsamestring} +%D +%D The next comparison macro converts the arguments into +%D expanded strings. This command can be used to compare for +%D instance \type {\jobname} with a name stored in a macro. + +\def\@@doifsamestringelse#1#2% + {\edef\!!stringa{#1}% + \edef\!!stringb{#2}% + \convertcommand\!!stringa\to\!!stringa + \convertcommand\!!stringb\to\!!stringb + \ifx\!!stringa\!!stringb} + +\def\doifsamestringelse#1#2% + {\@@doifsamestringelse{#1}{#2}% + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\def\doifsamestring#1#2% + {\@@doifsamestringelse{#1}{#2}% + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\def\doifnotsamestring#1#2% + {\@@doifsamestringelse{#1}{#2}% + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +%D \macros +%D {ExpandFirstAfter,ExpandSecondAfter,ExpandBothAfter} +%D +%D These three commands support expansion of arguments before +%D executing the commands that uses them. We can best +%D illustrate this with an example. +%D +%D \starttyping +%D \def\first {alfa,beta,gamma} +%D \def\second {alfa,epsilon,zeta} +%D +%D \ExpandFirstAfter \doifcommon {\first} {alfa} {\message{OK}} +%D \ExpandSecondAfter \doifcommon {alfa} {\second} {\message{OK}} +%D \ExpandBothAfter \doifcommon {\first} {\second} {\message{OK}} +%D +%D \ExpandFirstAfter\processcommalist[\first]\message +%D +%D \ExpandAfter \doifcommon {\first} {alfa} {\message{OK}} +%D \stoptyping +%D +%D The first three calls result in the threefold message +%D \type{OK}, the fourth one shows the three elements of +%D \type{\first}. The command \type{\ExpandFirstAfter} takes +%D care of (first) arguments that are delimited by \type{[ ]}, +%D but the faster \type{\ExpandAfter} does not. + +\def\simpleExpandFirstAfter#1% + {\long\xdef\@@expanded{\noexpand\ExpandCommand{#1}}\@@expanded} + +\def\complexExpandFirstAfter[#1]% + {\long\xdef\@@expanded{\noexpand\ExpandCommand[#1]}\@@expanded} + +\def\ExpandFirstAfter#1% + {\let\ExpandCommand#1% + \doifnextoptionalelse\complexExpandFirstAfter\simpleExpandFirstAfter} + +\def\ExpandSecondAfter#1#2#3% + {\scratchtoks{#2}% + \long\xdef\@@expanded{\noexpand#1{\the\scratchtoks}{#3}}\@@expanded} + +\def\ExpandBothAfter#1#2#3% + {\long\xdef\@@expanded{\noexpand#1{#2}{#3}}\@@expanded} + +\def\ExpandAfter#1#2% + {\long\xdef\@@expanded{\noexpand#1{#2}}\@@expanded} + +%D Now we can for instance define \type{\ifinstringelse} as: + +\def\ifinstringelse + {\ExpandBothAfter\p!doifinstringelse} + +%D \macros +%D {ConvertToConstant,ConvertConstantAfter} +%D +%D When comparing arguments with a constant, we can get into +%D trouble when this argument consists of tricky expandable +%D commands. One solution for this is converting the +%D argument to a string of unexpandable characters. To make +%D comparison possible, we have to convert the constant too +%D +%D \starttyping +%D \ConvertToConstant\doifelse {...} {...} {then ...} {else ...} +%D \stoptyping +%D +%D This construction is only needed when the first argument +%D can give troubles. Misuse can slow down processing. +%D +%D \starttyping +%D \ConvertToConstant\doifelse{\c!alfa} {\c!alfa}{...}{...} +%D \ConvertToConstant\doifelse{alfa} {\c!alfa}{...}{...} +%D \ConvertToConstant\doifelse{alfa} {alfa} {...}{...} +%D \ConvertToConstant\doifelse{alfa \alfa test}{\c!alfa}{...}{...} +%D \stoptyping +%D +%D In examples~2 and~3 both arguments equal, in~1 and~4 +%D they differ. + +\beginTEX + +\long\def\ConvertToConstant#1#2#3% + {\expandafter\defconvertedargument\expandafter\!!stringa\expandafter{#2}% + \expandafter\defconvertedargument\expandafter\!!stringb\expandafter{#3}% + #1{\!!stringa}{\!!stringb}} + +\endTEX + +\beginETEX \detokenize + +\long\def\ConvertToConstant#1#2#3% + {\edef\!!stringa{\expandafter\detokenize\expandafter{#2}}% + \edef\!!stringb{\expandafter\detokenize\expandafter{#3}}% + #1{\!!stringa}{\!!stringb}} + +\endETEX + +%D When the argument \type{#1} consists of commands, we had +%D better use +%D +%D \starttyping +%D \ConvertConstantAfter\processaction[#1][...] +%D \ConvertConstantAfter\doifelse{#1}{\v!something}{}{} +%D \stoptyping +%D +%D This commands accepts things like: +%D +%D \starttyping +%D \v!constant +%D constant +%D \hbox to \hsize{\rubish} +%D \stoptyping +%D +%D As we will see in the core modules, this macro permits +%D constructions like: +%D +%D \starttyping +%D \setupfootertexts[...][...] +%D \setupfootertexts[margin][...][...] +%D \setupfootertexts[\v!margin][...][...] +%D \stoptyping +%D +%D where \type{...} can be anything legally \TEX. + +\def\CheckConstantAfter#1#2% + {\@EA\convertargument\v!prefix!\to\ascii + \convertargument#1\to#2\relax + \doifinstringelse\ascii{#2} + {\expandafter\convertargument#1\to#2} + {}} + +\def\ConvertConstantAfter#1#2#3% + {\CheckConstantAfter{#2}\asciia + \CheckConstantAfter{#3}\asciib + #1{\asciia}{\asciib}} + +%D \macros +%D {assignifempty} +%D +%D We can assign a default value to an empty macro using: +%D +%D \starttyping +%D \assignifempty \macros {default value} +%D \stoptyping +%D +%D We don't explicitly test if the macro is defined. + +\def\assignifempty#1#2% can be sped up + {\doifsomething{#1}{\def#1{#2}}} % {\doifnot{#1}{}{\def#1{#2}}} + +%D \macros +%D {gobbleuntil,grabuntil,gobbleuntilrelax, +%D processbetween,processuntil} +%D +%D In \TEX\ gobbling usually stand for skipping arguments, so +%D here are our gobbling macros. +%D +%D In \CONTEXT\ we use a lot of \type{\start}||\type{\stop} +%D like constructions. Sometimes, the \type{\stop} is used as a +%D hard coded delimiter like in: +%D +%D \starttyping +%D \def\startcommand#1\stopcommand% +%D {... #1 ...} +%D \stoptyping +%D +%D In many cases the \type{\start}||\type{\stop} pair is +%D defined at format generation time or during a job. This +%D means that we cannot hardcode the \type{\stop} criterium. +%D Only after completely understanding \type{\csname} and +%D \type{\expandafter} I was able to to implement a solution, +%D starting with: +%D +%D \starttyping +%D \grabuntil{stop}\command +%D \stoptyping +%D +%D This commands executes, after having encountered +%D \type {\stop} the command \type {\command}. This command +%D receives as argument the text preceding the \type {\stop}. +%D This means that: +%D +%D \starttyping +%D \def\starthello% +%D {\grabuntil{stophello}\message} +%D +%D \starthello Hello world!\stophello +%D \stoptyping +%D +%D results in: \type{\message{Hello world!}}. + +\def\dograbuntil#1#2% + {\long\def\next##1#1{#2{##1}}\next} + +\def\grabuntil#1% + {\expandafter\dograbuntil\expandafter{\csname#1\endcsname}} + +%D The next command build on this mechanism: +%D +%D \starttyping +%D \processbetween{string}\command +%D \stoptyping +%D +%D Here: +%D +%D \starttyping +%D \processbetween{hello}\message +%D \starthello Hello again!\stophello +%D \stoptyping +%D +%D leads to: \type{\message{Hello again!}}. The command +%D +%D \starttyping +%D \gobbleuntil{sequence} +%D \stoptyping +%D +%D is related to these commands. This one simply throws away +%D everything preceding \type{\command}. + +\long\def\processbetween#1#2% + {\setvalue{\s!start#1}{\grabuntil{\s!stop#1}{#2}}} + +\def\gobbleuntil#1% + {\long\def\next##1#1{}\next} + +\def\gobbleuntilrelax#1\relax + {} + +%D The next one simply expands the pickup up tokens. +%D +%D \starttyping +%D \processuntil{sequence} +%D \stoptyping + +\def\processuntil#1% + {\long\def\next##1#1{##1}\next} + +%D \macros +%D {groupedcommand} +%D +%D Commands often manipulate argument as in: +%D +%D \starttyping +%D \def\doezomaarwat#1{....#1....} +%D \stoptyping +%D +%D A disadvantage of this approach is that the tokens that +%D form \type{#1} are fixed the the moment the argument is read +%D in. Normally this is no problem, but for instance verbatim +%D environments adapt the \CATCODES\ of characters and therefore +%D are not always happy with already fixed tokens. +%D +%D Another problem arises when the argument is grouped not by +%D \type{{}} but by \type{\bgroup} and \type{\egroup}. Such an +%D argument fails, because the \type{\bgroup} is een as the +%D argument (which is quite normal). +%D +%D The next macro offers a solution for both unwanted +%D situations: +%D +%D \starttyping +%D \groupedcommand {before} {after} +%D \stoptyping +%D +%D Which can be used like: +%D +%D \starttyping +%D \def\cite% +%D {\groupedcommand{\rightquote\rightquote}{\leftquote\leftquote}} +%D \stoptyping +%D +%D This command is equivalent to, but more 'robust' than: +%D +%D \starttyping +%D \def\cite#1% +%D {\rightquote\rightquote#1\leftquote\leftquote} +%D \stoptyping +%D +%D One should say that the next implementation would suffice: +%D +%D \starttyping +%D \def\groupedcommand#1#2% +%D {\def\BeforeGroup{#1\ignorespaces}% +%D \def\AfterGroup{\unskip#2\egroup}% +%D \bgroup\bgroup +%D \aftergroup\AfterGroup +%D \afterassignment\BeforeGroup +%D \let\next=} +%D \stoptyping +%D +%D It did indeed, but one day we decided to support the +%D processing of boxes too: +%D +%D \starttyping +%D \def\rightword% +%D {\groupedcommand{\hfill\hbox}{\parfillskip\!!zeropoint}} +%D +%D .......... \rightword{the right way} +%D \stoptyping +%D +%D Here \TEX\ typesets \type{\bf the right way} unbreakable +%D at the end of the line. The solution mentioned before does +%D not work here. +%D +%D \starttyping +%D \long\unexpanded\def\groupedcommand#1#2% +%D {\bgroup +%D \long\def\BeforeGroup% +%D {\bgroup#1\bgroup\aftergroup\AfterGroup}% +%D \long\def\AfterGroup% +%D {#2\egroup\egroup}% +%D \afterassignment\BeforeGroup +%D \let\next=} +%D \stoptyping +%D +%D We used this method some time until the next alternative +%D was needed. From now on we support both +%D +%D \starttyping +%D to be \bold{bold} or not, that's the question +%D \stoptyping +%D +%D and +%D +%D \starttyping +%D to be {\bold bold} or not, that's the question +%D \stoptyping +%D +%D This alternative checks for a \type{\bgroup} token first. +%D The internal alternative does not accept the box handling +%D mentioned before, but further nesting works all right. The +%D extra \type{\bgroup}||\type{\egroup} is needed to keep +%D \type{\AfterGroup} both into sight and local. + +\long\def\HandleGroup#1#2% + {\bgroup + \long\def\BeforeGroup{\bgroup#1\bgroup\aftergroup\AfterGroup}% + \long\def\AfterGroup {#2\egroup\egroup}% + \afterassignment\BeforeGroup + \let\next=} + +\long\def\HandleSimpleGroup#1#2% no inner group (so no kerning interference) + {\bgroup + %long\def\BeforeGroup{\bgroup#1\aftergroup\AfterGroup}% interferes + \long\def\BeforeGroup{\bgroup\aftergroup\AfterGroup#1}% + \long\def\AfterGroup {#2\egroup}% + \afterassignment\BeforeGroup + \let\next=} + +\long\def\HandleNoGroup#1#2% + {\long\def\AfterGroup{#2\egroup}% + \bgroup\aftergroup\AfterGroup#1} + +%D These macros come together in: +%D +%D \starttyping +%D \long\unexpanded\def\groupedcommand#1#2% +%D {\def\dogroupedcommand% +%D {\ifx\next\bgroup +%D \let\next=\HandleGroup +%D \else +%D \let\next=\HandleNoGroup +%D \fi +%D \next{#1}{#2}}% +%D \futurelet\next\dogroupedcommand} +%D \stoptyping +%D +%D From the missing paragraph number one can deduce that the +%D last macro is not the real one yet. I considered it a +%D nuisance that +%D +%D \starttyping +%D \color[green] +%D {as grass} +%D \stoptyping +%D +%D was not interpreted as one would expect. This is due to the +%D fact that \type{\futurelet} obeys blank spaces, and a +%D line||ending token is treated as a blank space. So the final +%D implementation became: + +%\long\unexpanded\def\groupedcommand#1#2% +% {\bgroup +% \def\dogroupedcommand% +% {\ifx\next\bgroup +% \def\\{\egroup\HandleGroup{#1}{#2}}% +% \else\ifx\next\blankspace +% \def\\ {\egroup\groupedcommand{#1}{#2}}% +% \else +% \def\\{\egroup\HandleNoGroup{#1}{#2}}% +% \fi\fi +% \\}% +% \futurelet\next\dogroupedcommand} +% +% compatible ? + +\long\unexpanded\def\groupedcommand#1#2% + {\doifnextbgroupelse{\HandleGroup{#1}{#2}}{\HandleNoGroup{#1}{#2}}} + +\long\unexpanded\def\simplegroupedcommand#1#2% + {\doifnextbgroupelse{\HandleSimpleGroup{#1}{#2}}{\HandleNoGroup{#1}{#2}}} + +%D Users should be aware of the fact that grouping can +%D interfere with ones paragraph settings that are executed +%D after the paragraph is closed. One should therefore +%D explictly close the paragraph with \type{\par}, else the +%D settings will be forgotten and not applied. So it's: +%D +%D \starttyping +%D \def\BoldRaggedCenter% +%D {\groupedcommand{\raggedcenter\bf}{\par}} +%D \stoptyping + +%D \macros +%D {checkdefined} +%D +%D The bigger the system, the greater the change that +%D user defined commands collide with those that are part of +%D the system. The next macro gives a warning when a command is +%D already defined. We considered blocking the definition, but +%D this is not always what we want. +%D +%D \starttyping +%D \checkdefined {category} {class} {command} +%D \stoptyping +%D +%D The user is warned with the suggestion to use +%D \type{CAPITALS}. This suggestion is feasible, because +%D \CONTEXT only defines lowcased macros. + +\def\showdefinederror#1#2% + {\writestatus\m!systems{#1 #2 replaces a macro, use CAPITALS!}} + +\def\checkdefined#1#2#3% + {\doifdefined{#3}{\showdefinederror{#2}{#3}}} + +%D \macros +%D {GotoPar,GetPar} +%D +%D Typesetting a paragraph in a special way can be done by +%D first grabbing the contents of the paragraph and processing +%D this contents grouped. The next macro for instance typesets +%D a paragraph in boldface. +%D +%D \starttyping +%D \def\remark#1\par% +%D {\bgroup\bf#1\egroup} +%D \stoptyping +%D +%D This macro has to be called like +%D +%D \starttyping +%D \remark some text ... ending with \par +%D \stoptyping +%D +%D Instead of \type{\par} we can of course use an empty line. +%D When we started typesetting with \TEX, we already had +%D produced lots of text in plain \ASCII. In producing such +%D simple formatted texts, we adopted an open layout, and when +%D switching to \TEX, we continued this open habit. Although +%D \TEX\ permits a cramped and badly formatted source, it adds +%D to confusion and sometimes introduces errors. So we prefer: +%D +%D \starttyping +%D \remark +%D +%D some text ... ending with an empty line +%D \stoptyping +%D +%D We are going to implement a mechanism that allows such open +%D specifications. The definition of the macro handling +%D \type{\remark} becomes: +%D +%D \starttyping +%D \def\remark% +%D {\BeforePar{\bgroup\bf}% +%D \AfterPar{\egroup}% +%D \GetPar} +%D \stoptyping +%D +%D A macro like \type{\GetPar} can be defined in several +%D ways. The recent version, the fourth one in a row, +%D originally was far more complicated, but some functionality +%D has been moved to other macros. +%D +%D We start with the more simple but in some cases more +%D appropriate alternative is \type{\GotoPar}. This one leaves +%D \type{\par} unchanged and is therefore more robust. On the +%D other hand, \type{\AfterPar} is not supported. + +\newtoks\BeforePar +\newtoks\AfterPar + +\let\endoflinetoken=^^M + +%D The original definition was: +%D +%D \starttyping +%D \def\doGotoPar +%D {\ifx\nextchar\blankspace +%D \@EA\GotoPar +%D \else\ifx\nextchar\endoflinetoken +%D \@EAEAEA\GotoPar +%D \else +%D \@EAEAEA\dodoGotoPar +%D \fi\fi} +%D +%D \def\dodoGotoPar +%D {\the\BeforePar +%D \BeforePar\emptytoks +%D \nextchar} +%D +%D \def\GotoPar +%D {\afterassignment\doGotoPar\let\nextchar=} +%D \stoptyping + +%D Its big brother \type{\GetPar} redefines the \type{\par} +%D primitive, which can lead to unexpected results, depending +%D in the context. +%D +%D \starttyping +%D \def\GetPar +%D {\expanded +%D {\BeforePar +%D {\the\BeforePar +%D \BeforePar\emptytoks +%D \bgroup +%D \def\par +%D {\egroup +%D \par +%D \the\AfterPar +%D \BeforePar\emptytoks +%D \AfterPar\emptytoks}}}% +%D \GotoPar} +%D \stoptyping + +%D However, we can implement a better alternative by using: +%D +%D \starttyping +%D \def\dowithpar#1#2% +%D {\def\handlepar##1\par{#1##1#2}% +%D \def\gobblepar\par{\dowithpar{#1}{#2}}% +%D \doifnextcharelse\par\gobblepar\handlepar} +%D \stoptyping +%D +%D Or, nicer + +\def\redowithpar\par + {\doifnextcharelse\par\redowithpar\dodowithpar}% + +\def\dowithpar#1#2% + {\def\dodowithpar##1\par{#1##1#2}% + \redowithpar\par} + +\def\redogotopar\par + {\doifnextcharelse\par\redogotopar\dodogotopar}% + +\def\dogotopar#1% + {\def\dodogotopar{#1}% + \redogotopar\par} + +%D The previosuly defined macros now become: + +\def\GetPar + {\expanded + {\dowithpar + {\the\BeforePar + \BeforePar\emptytoks} + {\the\AfterPar + \BeforePar\emptytoks + \AfterPar\emptytoks}}} + +\def\GotoPar + {\expanded + {\dogotopar + {\the\BeforePar + \BeforePar\emptytoks}}} + +%D \macros +%D {dowithpargument,dowithwargument} +%D +%D The next macros are a variation on \type{\GetPar}. When +%D macros expect an argument, it interprets a grouped sequence +%D of characters a one token. While this adds to robustness and +%D less ambiguous situations, we sometimes want to be a bit +%D more flexible, or at least want to be a bit more tolerant +%D to user input. +%D +%D We start with a commands that acts on paragraphs. This +%D command is called as: +%D +%D \starttyping +%D \dowithpargument\command +%D \dowithpargument{\command ... } +%D \stoptyping +%D +%D In \CONTEXT\ we use this one to read in the titles of +%D chapters, sections etc. The commands responsible for these +%D activities accept several alternative ways of argument +%D passing. In these examples, the \type{\par} can be omitted +%D when an empty line is present. +%D +%D \starttyping +%D \command{...} +%D \command ... \par +%D \command +%D {...} +%D \command +%D ... \par +%D \stoptyping +%D +%D We show two implementations, of which for the moment the +%D we prefier to use the second one: +%D +%D \starttyping +%D \def\dowithpargument#1% +%D {\def\dodowithpargument% +%D {\ifx\next\bgroup +%D \def\next{#1}% +%D \else +%D \def\next####1 \par{#1{####1}}% +%D \fi +%D \next}% +%D \futurelet\next\dodowithpargument} +%D \stoptyping +%D +%D A second and better implementation was: +%D +%D \starttyping +%D \def\dowithpargument#1% +%D {\def\nextpar##1 \par{#1{##1}}% +%D \def\nextarg##1{#1{##1}}% +%D \doifnextcharelse\bgroup +%D {\nextarg} +%D {\nextpar}} +%D \stoptyping +%D +%D We ended up with an alternative that also accepts en empty +%D argument. This command permits for instance chapters to +%D have no title. + +%\def\dowithpargument#1% +% {\def\nextpar##1 \par{#1{##1}}% +% \def\nextarg##1{#1{##1}}% +% \doifnextcharelse\bgroup +% {\nextarg} +% {\doifnextcharelse{\par} +% {#1{}} +% {\nextpar}}} + +\def\dowithpargument#1% + {\def\nextpar##1 \par{#1{##1}}% + \def\nextarg##1{#1{##1}}% + \doifnextbgroupelse\nextarg{\doifnextcharelse\par{#1{}}\nextpar}} + +%D The \type{p} in the previous command stands for paragraph. +%D When we want to act upon words we can use the \type{w} +%D alternative. +%D +%D \starttyping +%D \dowithwargument\command +%D \dowithwargument{... \command ...} +%D \stoptyping +%D +%D The main difference bwteen two alternatives is in the +%D handling of \type{\par}'s. This time the space token acts +%D as a delimiter. +%D +%D \starttyping +%D \command{...} +%D \command ... +%D \command +%D {...} +%D \command +%D ... +%D \stoptyping +%D +%D Again there are two implementations possible: +%D +%D \starttyping +%D \def\dowithwargument#1% +%D {\def\dodowithwargument% +%D {\ifx\next\bgroup +%D \def\next{#1}% +%D \else +%D \def\next####1 {#1{####1}}% +%D \fi +%D \next}% +%D \futurelet\next\dodowithwargument} +%D \stoptyping +%D +%D We've chosen: + +%\def\dowithwargument#1% +% {\def\nextwar##1 {#1{##1}}% +% \def\nextarg##1{#1{##1}}% +% \doifnextcharelse\bgroup +% {\nextarg} +% {\nextwar}} + +\def\dowithwargument#1% + {\def\nextwar##1 {#1{##1}}% + \def\nextarg##1{#1{##1}}% + \doifnextbgroupelse\nextarg\nextwar} + +%D \macros +%D {dorepeat,dorepeatwithcommand} +%D +%D When doing repetitive tasks, we stromgly advice to use +%D \type{\dorecurse}. The next alternative however, suits +%D better some of the \CONTEXT\ interface commands. +%D +%D \starttyping +%D \dorepeat[n*\command] +%D \stoptyping +%D +%D The value of the used \COUNTER\ can be called within +%D \type{\command} by \type{\repeater}. +%D +%D A slightly different alternative is: +%D +%D \starttyping +%D \dorepeatwithcommand[n*{...}]\command +%D \stoptyping +%D +%D When we call for something like: +%D +%D \starttyping +%D \dorepeatwithcommand[3*{Hello}]\message +%D \stoptyping +%D +%D we get ourselves three \type{\message{Hello}} messages in +%D a row. In both commands, the \type{n*} is optional. When this +%D specification is missing, the command executes once. + +% this one is obsolete: + +\def\dorepeat[#1]% + {\dodorepeat#1*\empty*\relax} + +\long\def\dodorepeat#1*#2#3*#4\relax + {\ifx#2\empty#1\else\dorecurse{#1}{#2#3}\fi} + +\def\repeater + {\recurselevel} + +% this one will be kept + +\def\dorepeatwithcommand[#1]% + {\dodorepeatwithcommand#1*\empty*\relax} + +% \long\def\dodorepeatwithcommand#1*#2#3*#4\relax#5% +% {\ifx#2\empty +% #5{#1}% +% \else +% \dorecurse{#1}{#5{#2#3}}% +% \fi} +% +% more complex but better: + +% \long\def\dodorepeatwithcommand#1*#2#3*#4\relax#5% +% {\ifx#2\empty +% #5{#1}% +% \else\ifnum#1<\zerocount +% % a la etex +% % \dorecurse{-\numexpr(#1)}{#5{-#2#3}}% +% % indirect +% %\innerrecurse#1% +% %\expanded{\dorecurse{\number-\innerrecurse}}{#5{-#2#3}}% +% % safer: +% \bgroup\scratchcounter#1% +% \expanded{\egroup\noexpand\dorecurse{\number-\scratchcounter}}{#5{-#2#3}}% +% \else\ifx#2+% +% \dorecurse{#1}{#5{#3}}% +% \else +% \dorecurse{#1}{#5{#2#3}}% +% \fi\fi\fi} + +\def\dorepeatwithcommand[#1]% + {\dodorepeatwithcommand#1*\empty*\relax} + +\long\def\dodorepeatwithcommand#1*#2#3*#4\relax#5% + {\ifx#2\empty\redorepeatwithcommand[#1]#5\else\dododorepeatwithcommand{#1}{#2}{#3}#5\fi} + +\long\def\dododorepeatwithcommand#1#2#3#4% + {\ifx#2\empty % redundant but gives cleaner extensions + #4{#1}% + \else\ifnum#1<\zerocount + \bgroup\scratchcounter#1% + \expanded{\egroup\noexpand\dorecurse{\number-\scratchcounter}}{#4{-#2#3}}% + \else\ifx#2+% + \dorecurse{#1}{#4{#3}}% + \else + \dorecurse{#1}{#4{#2#3}}% + \fi\fi\fi} + +\def\redorepeatwithcommand[#1]#2% + {#2{#1}} + +%D The extension hook permits something like: +%D +%D \starttyping +%D \bgroup +%D +%D \catcode`\*=\@@superscript +%D +%D \gdef\redorepeatwithcommand[#1]% +%D {\redodorepeatwithcommand#1*\empty*\relax} +%D +%D \long\gdef\redodorepeatwithcommand#1*#2#3*#4\relax#5% +%D {\dododorepeatwithcommand{#1}{#2}{#3}#5} +%D +%D \egroup +%D \stoptyping +%D +%D although one may wonder if changing the catcode of \type {*} is wise. + +%D \macros +%D {normalbgroup,normalgroup} +%D +%D No comment. + +\let\normalbgroup\bgroup +\let\normalegroup\egroup + +%D \macros +%D {doifstringinstringelse} +%D +%D The next macro is meant for situations where both strings +%D are macros. This save some unneeded expansion. +%D +%D \starttyping +%D \long\def\doifstringinstringelse#1#2% +%D {\p!doifinstringelse#1#2% +%D \@EA\firstoftwoarguments +%D \else +%D \@EA\secondoftwoarguments +%D \fi} +%D \stoptyping +%D +%D A bit faster is: + +\def\pp!doifstringinstringelse#1% + {\if#1@% + \@EA\secondoftwoarguments + \else + \@EA\firstoftwoarguments + \fi} + +\long\def\doifstringinstringelse#1#2% + {\long\@EA\def\@EA\p!doifstringinstringelse\@EA##\@EA1#1##2##3\war + {\pp!doifstringinstringelse##2}% + \@EA\@EA\@EA\p!doifstringinstringelse\@EA#2#1@@\war} + +%D \macros +%D {appendtoks,prependtoks,appendtoksonce,prependtoksonce, +%D doifintokselse,flushtoks,dotoks} +%D +%D We use \TOKENLISTS\ sparsely within \CONTEXT, because the +%D comma separated lists are more suitable for the user +%D interface. Nevertheless we have: +%D +%D \starttyping +%D (\doglobal) \appendtoks ... \to\tokenlist +%D (\doglobal) \prependtoks ... \to\tokenlist +%D (\doglobal) \flushtoks\tokenlist +%D \dotoks\tokenlist +%D \stoptyping +%D +%D Er worden eerst enkele klad||registers gedefinieerd. These +%D macros are clones of the ones implemented in page~378 of +%D Knuth's \TeX book. +%D +%D A simple implementation, one that does not handle braces +%D at the outer level, is: +%D +%D \starttyping +%D \def\appendtoks#1\to#2% +%D {\scratchtoks={#1}% +%D \expanded{\dodoglobal\noexpand#2{\the#2\the\scratchtoks}}} +%D +%D \def\prependtoks#1\to#2% +%D {\scratchtoks={#1}% +%D \expanded{\dodoglobal\noexpand#2{\the\scratchtoks\the#2}}} +%D \stoptyping +%D +%D But here we prefer: + +\newtoks\@@scratchtoks + +% before we had the once only alternatives, we had: +% +% \def\appendtoks {\doappendtoks \relax} +% \def\prependtoks{\doprependtoks\relax} +% +% \long\def\doappendtoks#1\to#2% +% {\@@scratchtoks\@EA{\gobbleoneargument#1}% +% \expanded{\dodoglobal\noexpand#2{\the#2\the\@@scratchtoks}}} +% +% \long\def\doprependtoks#1\to#2% +% {\@@scratchtoks\@EA{\gobbleoneargument#1}% +% \expanded{\dodoglobal\noexpand#2{\the\@@scratchtoks\the#2}}} + +\def\appendtoks {\doappendtoks \relax} +\def\prependtoks {\doprependtoks \relax} +\def\appendtoksonce {\doappendtoksonce \relax} +\def\prependtoksonce{\doprependtoksonce\relax} + +% \def\dodoappendtoks#1% +% {\expanded{\dodoglobal\noexpand#1{\the#1\the\@@scratchtoks}}} +% +% \def\dodoprependtoks#1% +% {\expanded{\dodoglobal\noexpand#1{\the\@@scratchtoks\the#1}}} +% +% \long\def\doappendtoks#1\to% +% {\@@scratchtoks\@EA{\gobbleoneargument#1}\dodoappendtoks} +% +% \long\def\doprependtoks#1\to% +% {\@@scratchtoks\@EA{\gobbleoneargument#1}\dodoprependtoks} +% +% \long\def\doappendtoksonce#1\to#2% +% {\@@scratchtoks\@EA{\gobbleoneargument#1}% +% \doifintokselse\@@scratchtoks{#2}{}{\dodoappendtoks{#2}}} +% +% \long\def\doprependtoksonce#1\to#2% +% {\@@scratchtoks\@EA{\gobbleoneargument#1}% +% \doifintokselse\@@scratchtoks{#2}{}{\dodoprependtoks{#2}}} +% +% A slightly (but in the case of large arguments +% significantly) faster alternative is given below: + +\newtoks\@@toks + +\def\dodoappendtoks + {\dodoglobal\@@toks\@EAEAEA{\@EA\the\@EA\@@toks\the\@@scratchtoks}} + +\def\dodoprependtoks + {\dodoglobal\@@toks\@EAEAEA{\@EA\the\@EA\@@scratchtoks\the\@@toks}} + +\long\def\doappendtoks#1\to#2% + {\def\@@toks{#2}% + \@@scratchtoks\@EA{\gobbleoneargument#1}\dodoappendtoks} + +\long\def\doprependtoks#1\to#2% + {\def\@@toks{#2}% + \@@scratchtoks\@EA{\gobbleoneargument#1}\dodoprependtoks} + +\long\def\doappendtoksonce#1\to#2% + {\def\@@toks{#2}% + \@@scratchtoks\@EA{\gobbleoneargument#1}% + \doifintokselse\@@scratchtoks\@@toks\donothing\dodoappendtoks} + +\long\def\doprependtoksonce#1\to#2% + {\def\@@toks{#2}% + \@@scratchtoks\@EA{\gobbleoneargument#1}% + \doifintokselse\@@scratchtoks\@@toks\donothing\dodoprependtoks} + +%D The test macro: +%D +%D \starttyping +%D \def\doifintokselse#1#2% #1 en #2 zijn toks +%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciia +%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciib +%D \doifinstringelse\asciia\asciib} +%D \stoptyping +%D +%D Better: +%D +%D \starttyping +%D \def\doifintokselse#1#2% #1 en #2 zijn toks +%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciia +%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciib +%D \doifstringinstringelse\asciia\asciib} +%D \stoptyping +%D +%D Even better: + +\beginETEX + + \def\doifintokselse#1#2% #1 en #2 zijn toks + {\@EA\convertargument\the#1\to\asciia + \@EA\convertargument\the#2\to\asciib + \doifstringinstringelse\asciia\asciib} + +\endETEX + +\beginTEX + + \def\doifintokselse#1#2% #1 en #2 zijn toks + {\edef\asciia{\the#1}\convertcommand\asciia\to\asciia + \edef\asciib{\the#2}\convertcommand\asciib\to\asciib + \doifstringinstringelse\asciia\asciib} + +\endTEX + +%D Also: + +\def\appendetoks #1\to{\expanded{\appendtoks #1}\to} +\def\prependetoks#1\to{\expanded{\prependtoks#1}\to} + +%D Hm. + +\def\flushtoks#1% nb: can reassing to #1 again, hence the indirectness + {\@@scratchtoks#1\relax + \dodoglobal#1\emptytoks + \the\@@scratchtoks\relax} + +\let\dotoks\the + +%D \macros +%D {makecounter,pluscounter,minuscounter, +%D resetcounter,setcounter,countervalue} +%D +%D Declaring, setting and resetting \COUNTERS\ can be doen +%D with the next set of commands. +%D +%D \starttyping +%D \makecounter {name} +%D \pluscounter {name} +%D \minuscounter {name} +%D \resetcounter {name} +%D \setcounter {name} {value} +%D \countervalue {name} +%D \stoptyping +%D +%D We prefer the use of global counters. This means that we +%D have to load \PLAIN\ \TEX\ in a bit different way: +%D +%D \starttyping +%D \let\oldouter=\outer +%D \let\outer=\relax +%D \input plain.tex +%D \let\outer=\oldouter +%D +%D \def\newcount% +%D {\alloc@0\count\countdef\insc@unt} +%D \stoptyping +%D +%D First we show a solution in which we use real \COUNTERS. +%D Apart from some expansion, nothing special is done. +%D +%D \starttyping +%D \def\makecounter#1% +%D {\expandafter\newcount\csname#1\endcsname} +%D +%D \def\pluscounter#1% +%D {\global\advance\csname#1\endcsname by 1 } +%D +%D \def\minuscounter#1% +%D {\global\advance\csname#1\endcsname by -1 } +%D +%D \def\resetcounter#1% +%D {\expandafter\global\csname#1\endcsname=0 } +%D +%D \def\setcounter#1#2% +%D {\expandafter\global\csname#1\endcsname=#2 } +%D +%D \def\countervalue#1% +%D {\the\getvalue{#1}} +%D \stoptyping +%D +%D Because these macros are already an indirect way of working +%D with counters, there is no harm in using pseudo \COUNTERS\ +%D here: + +\def\makecounter#1% + {\letgvalue{#1}\zerocountervalue} % see earlier + +% \def\countervalue#1% +% {\getvalue{#1}} + +\let\countervalue\getvalue + +\def\pluscounter#1% + {\scratchcounter\getvalue{#1}% + \advance\scratchcounter \plusone + \setxvalue{#1}{\the\scratchcounter}} + +\def\minuscounter#1% + {\scratchcounter\getvalue{#1}% + \advance\scratchcounter \minusone + \setxvalue{#1}{\the\scratchcounter}} + +\def\resetcounter#1% + {\letgvalue{#1}\zerocountervalue} + +\def\setcounter#1#2% or: \setxvalue{#1}{\number#2} + {\scratchcounter#2% + \setxvalue{#1}{\the\scratchcounter}} + +\def\incrementcounter#1#2% #1 name #2 value + {\setxvalue{#1}{\the\numexpr\csname#1\endcsname+#2\relax}} + +\def\decrementcounter#1#2% #1 name #2 value + {\setxvalue{#1}{\the\numexpr\csname#1\endcsname-#2\relax}} + +%D \macros +%D {savecounter,restorecounter} +%D +%D These two commands can be used to save and restore counter +%D values. Only one level is saved. + +\def\savecounter#1% + {{\scratchcounter\getvalue {#1}\setxvalue{!#1}{\the\scratchcounter}}} + +\def\restorecounter#1% + {{\scratchcounter\getvalue{!#1}\setxvalue {#1}{\the\scratchcounter}}} + +% == {\setxvalue{#1}{\getvalue{!#1}}} + +%D The next \ETEX\ based solution is some 15\% faster, which +%D goes unnoticed in any normal run, simply because these +%D macros are not used milions of times. + +\beginETEX \numexpr + +\def\makecounter#1% + {\global\@EA\let\csname#1\endcsname\zerocountervalue} % see earlier + +\def\countervalue#1% + {\ifcsname#1\endcsname\csname#1\endcsname\fi} + +\def\pluscounter#1% + {\@EA\xdef\csname#1\endcsname{\the\numexpr\csname#1\endcsname+\plusone\relax}} + +\def\minuscounter#1% + {\@EA\xdef\csname#1\endcsname{\the\numexpr\csname#1\endcsname-\plusone\relax}} + +\def\resetcounter#1% + {\global\@EA\let\csname#1\endcsname\zerocountervalue} + +\def\setcounter#1#2% + {\@EA\xdef\csname#1\endcsname{\the\numexpr#2\relax}} + +\def\savecounter#1% + {\@EA\xdef\csname !#1\endcsname{\the\numexpr\csname#1\endcsname\relax}} + +\def\restorecounter#1% + {\@EA\xdef\csname#1\endcsname{\the\numexpr\csname !#1\endcsname\relax}} + +\endETEX + +%D \macros +%D {beforesplitstring,aftersplitstring} +%D +%D These both commands split a string at a given point in two +%D parts, so \type{x.y} becomes \type{x} or \type{y}. +%D +%D \starttyping +%D \beforesplitstring test.tex\at.\to\filename +%D \aftersplitstring test.tex\at.\to\extension +%D \stoptyping +%D +%D The first routine looks (and is indeed) a bit simpler than +%D the second one. The alternative looking more or less like +%D the first one did not always give the results we needed. +%D Both implementations show some insight in the manipulation +%D of arguments. + +\def\beforesplitstring#1\at#2\to#3% + {\def\dosplitstring##1#2##2#2##3\\% + {\def#3{##1}}% + \@EA\dosplitstring#1#2#2\\} + +\def\aftersplitstring#1\at#2\to#3% + {\def\dosplitstring##1#2##2@@@##3\\% + {\def#3{##2}}% + \@EA\dosplitstring#1@@@#2@@@\\} + +%D \macros +%D {splitstring,greedysplitstring} +%D +%D A bonus macro. + +\def\splitstring#1\at#2\to#3\and#4% + {\def\dosplitstring##1#2##2\empty\empty\empty##3\\% + {\def#3{##1}% + \def\dosplitstring{##3}% + \ifx\dosplitstring\empty + \let#4\empty + \else + \def#4{##2}% + \fi}% + \@EA\dosplitstring#1\empty\empty\empty#2\empty\empty\empty\\} + +% Ok, but not for all cases: +% +% \def\greedysplitstring#1\at#2\to#3\and#4% +% {\edef\asciib{#1}% +% \let\asciic\asciib +% \let#3\empty +% \let#4\empty +% \doloop +% {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib +% \ifx\asciib\empty +% \exitloop +% \else +% \edef#3{\ifx#3\empty\else#3#2\fi\asciia}% +% \let#4\asciib +% \fi}% +% \ifx#3\empty\let#3\asciic\fi} +% +% The next one is some 25\% faster, but it hardly matters because +% we seldom use this macro. +% +% \def\greedysplitstring#1\at#2\to#3\and#4% +% {\edef\asciib{#1}% +% \let\asciic\asciib +% \let#3\empty +% \let#4\empty +% \def\dogreedysplitstring +% {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib +% \ifx\asciib\empty +% \expandafter\dogreedysplitstring +% \else +% \edef#3{\ifx#3\empty\else#3#2\fi\asciia}% +% \let#4\asciib +% \fi}% +% \dogreedysplitstring +% \ifx#3\empty\let#3\asciic\fi} +% +% The better alternative: + +\def\greedysplitstring#1\at#2\to#3\and#4% + {\edef\asciib{#1}% + \let\asciic\asciib + \let#3\empty + \let#4\empty + \doloop + {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib + \ifx\asciib\empty + \exitloop + \else + % not \edef#3{\ifx#3\empty\else#3#2\fi\asciia} else + % /root/path fails because then #3==empty + \edef#3{\ifcase\recurselevel\or\else#3#2\fi\asciia}% + \let#4\asciib + \fi}% + \ifx#3\empty\let#3\asciic\fi} + +%D \macros +%D {beforetestandsplitstring, +%D aftertestandsplitstring, +%D testandsplitstring} +%D +%D The next alternatives are for Simon Pepping. This time +%D the result is empty when no split is done. + +% \def\beforetestandsplitstring#1\at#2\to#3% +% {\def\dosplitstring##1#2##2#2##3\\{\doifelsenothing +% {##3}{\let#3\empty}{\def#3{##1}}}% +% \@EA\dosplitstring#1#2#2\\} +% +% \def\aftertestandsplitstring#1\at#2\to#3% +% {\def\dosplitstring ##1#2##2@@@##3\\{\doifelsenothing +% {##3}{\let#3\empty}{\def#3{##2}}}% +% \@EA\dosplitstring #1@@@#2@@@\\} +% +% \def\testandsplitstring#1\at#2\to#3\and#4% +% {\def\dosplitstring##1#2##2#2##3\\{\doifelsenothing +% {##3}{\let#3\empty\let#4\empty}{\def#3{##1}\def#4{##2}}}% +% \@EA\dosplitstring#1#2#2\\} +% +% faster: + +\def\beforetestandsplitstring#1\at#2\to#3% + {\def\dosplitstring##1#2##2#2##3##4\\% + {\ifx##3\empty\let#3\empty\else\def#3{##1}\fi}% + \@EA\dosplitstring#1#2#2\empty\\} + +\def\aftertestandsplitstring#1\at#2\to#3% + {\def\dosplitstring ##1#2##2@@@##3##4\\% + {\ifx##3\empty\let#3\empty\else\def#3{##2}\fi}% + \@EA\dosplitstring #1@@@#2@@@\empty\\} + +\def\testandsplitstring#1\at#2\to#3\and#4% + {\def\dosplitstring##1#2##2#2##3##4\\% + {\ifx##3\empty\let#3\empty\let#4\empty\else\def#3{##1}\def#4{##2}\fi}% + \@EA\dosplitstring#1#2#2\empty\\} + +%D \macros +%D {removesubstring} +%D +%D A first application of the two routines defined above is: +%D +%D \starttyping +%D \removesubstring-\from first-last\to\nothyphenated +%D \stoptyping +%D +%D Which in terms of \TEX\ looks like: + +%\def\removesubstring#1\from#2\to#3% +% {\doifinstringelse{#1}{#2} +% {\beforesplitstring#2\at#1\to\!!stringa +% \aftersplitstring #2\at#1\to\!!stringb +% \edef#3{\!!stringa\!!stringb}% +% \removesubstring#1\from#3\to#3} +% {}} + +\def\removesubstring#1\from#2\to#3% + {\splitstring#2\to\!!stringa\and\!!stringb + \dodoglobal#3{\!!stringa\!!stringb}} + +%D \macros +%D {appendtocommalist,prependtocommalist, +%D addtocommalist,removefromcommalist} +%D +%D When working with comma separated lists, one sooner or +%D later want the tools to append or remove items from such a +%D list. When we add an item, we first check if it's already +%D there. This means that every item in the list is unique. +%D +%D \starttyping +%D \addtocommalist {alfa} \name +%D \addtocommalist {beta} \name +%D \addtocommalist {gamma} \name +%D \removefromcommalist {beta} \name +%D \stoptyping +%D +%D These commands can be prefixed with \type{\doglobal}. The +%D implementation of the second command is more complecated, +%D because we have to take leading spaces into account. Keep in +%D mind that users may provide lists with spaces after the +%D commas. When one item is left, we also have to get rid of +%D trailing spaces. +%D +%D \starttyping +%D \def\words{alfa, beta, gamma, delta} +%D \def\words{alfa,beta,gamma,delta} +%D \stoptyping +%D +%D Removing an item takes more time than adding one. +%D +%D A fast appending alternative, without any testing, is +%D also provided: +%D +%D \starttyping +%D \appendtocommalist {something} \name +%D \prependtocommalist {something} \name +%D \stoptyping +%D +%D This can be implemented as follows: +%D +%D \starttyping +%D \def\appendtocommalist#1#2% +%D {\ifx#2\empty +%D \dodoglobal\edef#2{#1}% +%D \else % no test on empty +%D \dodoglobal\edef#2{#2,#1}% +%D \fi} +%D +%D \def\prependtocommalist#1#2% +%D {\ifx#2\empty +%D \dodoglobal\edef#2{#1}% +%D \else % no test on empty +%D \dodoglobal\edef#2{#1,#2}% +%D \fi} +%D \stoptyping +%D +%D The faster alternatives are: + +\def\appendtocommalist#1#2% + {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}} + +\def\prependtocommalist#1#2% + {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}} + +%D The old ones are: +%D +%D \starttyping +%D \def\addtocommalist#1#2% +%D {\ifx#2\empty +%D \dodoglobal\edef#2{#1}% +%D \else +%D \edef\!!stringa{#2,,}% +%D \beforesplitstring#2\at,,\to#2\relax +%D \ExpandBothAfter\doifinsetelse{#1}{#2} +%D {\resetglobal} +%D {\dodoglobal\edef#2{#2,#1}}% +%D \fi} +%D +%D \def\pretocommalist#1#2% +%D {\ifx#2\empty +%D \dodoglobal\edef#2{#1}% +%D \else +%D \edef\!!stringa{#2,,}% +%D \beforesplitstring#2\at,,\to#2\relax +%D \ExpandBothAfter\doifinsetelse{#1}{#2} +%D {\resetglobal} +%D {\dodoglobal\edef#2{#1,#2}}% +%D \fi} +%D +%D \def\doremovefromcommalist#1#2#3% nog \doglobal +%D {\edef\!!stringa{,,#3,,}% +%D \beforesplitstring\!!stringa\at,#1#2,\to\!!stringb +%D \aftersplitstring\!!stringa\at,#1#2,\to\!!stringc +%D \edef#3{\!!stringb,\!!stringc}% +%D \aftersplitstring#3\at,,\to#3\relax +%D \beforesplitstring#3\at,,\to#3} +%D +%D \def\removefromcommalist#1#2% +%D {\doremovefromcommalist{ }{#1}{#2}% +%D \doremovefromcommalist{}{#1}{#2}% +%D \dofrontstrip#2% +%D \dodoglobal\edef#2{#2}} +%D \stoptyping +%D +%D Significantly faster (especially for longer lists): + +\def\addtocommalist#1#2% {item} \cs + {\rawdoifinsetelse{#1}#2\resetglobal + {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}} + +\def\pretocommalist#1#2% {item} \cs + {\rawdoifinsetelse{#1}#2\resetglobal + {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}} + +\def\robustdoifinsetelse#1#2% + {\expanded{\convertargument#1}\to\!!stringa + \expanded{\convertargument#2}\to\!!stringb + \rawdoifinsetelse\!!stringa\!!stringb} + +\def\robustaddtocommalist#1#2% {item} \cs + {\robustdoifinsetelse{#1}#2\resetglobal + {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}} + +\def\robustpretocommalist#1#2% {item} \cs + {\robustdoifinsetelse{#1}#2\resetglobal + {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}} + +\def\xsplitstring#1#2% \cs {str} + {\def\dosplitstring##1,#2,##2,#2,##3\\% + {\edef\!!stringa{\bcleanedupcommalist##1\empty\empty\relax}% + \edef\!!stringb{\acleanedupcommalist##2,,\relax}}% + \@EA\dosplitstring\@EA,#1,,#2,,#2,\\} + +\def\bcleanedupcommalist#1#2#3\relax{\if#1,\else#1\fi\if#2,\else#2\fi#3} +\def\bcleanedupcommalist#1#2\relax{\if#1,\else#1\fi#2} +\def\acleanedupcommalist#1,,#2\relax{#1} + +% \def\removefromcommalist#1#2% +% {\expanded{\xsplitstring\noexpand#2{#1}}% +% \dodoglobal\edef#2% +% {\ifx\!!stringa\empty +% \!!stringb +% \else +% \@EA\acleanedupcommalist\!!stringa,,\relax +% \ifx\!!stringb\empty\else,\!!stringb\fi +% \fi}} + +\def\removefromcommalist#1#2% + {\rawdoifinsetelse{#1}#2% + {\expanded{\xsplitstring\noexpand#2{#1}}% + \dodoglobal\edef#2% + {\ifx\!!stringa\empty + \!!stringb + \else + \!!stringa\ifx\!!stringb\empty\else,\!!stringb\fi + \fi}} + \resetglobal} + +%D \macros +%D {substituteincommalist} +%D +%D Slow but seldom used, so for the moment we stick to this +%D implementation. +%D +%D \starttyping +%D \substituteincommalist{old}{new}{list} +%D \stoptyping + +\def\substituteincommalist#1#2#3% old, new, list (slooow) + {\edef\!!stringb{#1}% + \edef\!!stringd{#2}% + \let\!!stringa#3% + \let#3\empty + \def\dosubstituteincommalist##1% + {\edef\!!stringc{##1}% + \ifx\!!stringb\!!stringc + \ifx\!!stringd\empty\else + \edef#3{#3\ifx#3\empty\else,\fi\!!stringd}% + \fi + \def\docommand####1{\edef#3{#3,####1}}% + \else + \edef#3{#3\ifx#3\empty\else,\fi##1}% + \fi}% + \@EA\rawprocesscommacommand\@EA[\!!stringa]\dosubstituteincommalist} + +%D A not so useful macro: + +\def\dodofrontstrip[#1#2]#3% + {\ifx#1\space + \def#3{#2}% + \else + \def#3{#1#2}% + \fi} + +\def\dofrontstrip#1% + {\edef\!!stringa{#1}% + \ifx\!!stringa\empty \else + \@EA\dodofrontstrip\@EA[#1]#1% + \fi} + +%D \macros +%D {replaceincommalist} +%D +%D The next macro can be used to replace an indexed element +%D in a commalist: +%D +%D \starttyping +%D \replaceincommalist\MyList{2} +%D \stoptyping +%D +%D Element~2 will be replaced by the current meaning of the macro +%D \type {\newcommalistelement}. The old meaning is saved in +%D \type {\commalistelement}. The replacement honors grouped items, +%D like in: +%D +%D \starttyping +%D \def\MyList{a,b,c,d,e,f} \replaceincommalist\MyList{3} +%D \def\MyList{a,b,c,d,e,f} \replaceincommalist\MyList{3} +%D \def\MyList{a,{b,c},d,e,f} \replaceincommalist\MyList{3} +%D \def\MyList{a,b,c,{d,e,f}} \replaceincommalist\MyList{3} +%D \stoptyping + +\let\newcommalistelement\empty + +\def\replaceincommalist#1#2% #1 = commalistelement #2 = position starts at 1 + {\def\doreplaceincommalist##1% + {\ifnum\commalistcounter=#2\relax + \ifx\newcommalistelement\empty\else + \ifx\newcommalist\empty + \let\newcommalist\newcommalistelement + \else + \@EA\@EA\@EA\def\@EA\@EA\@EA\newcommalist\@EA\@EA\@EA + {\@EA\newcommalist\@EA,\newcommalistelement}% + \fi + \fi + \def\commalistelement{##1}% + \else + \ifx\newcommalist\empty + \ifx\nexttoken\bgroup % is known -) + \def\newcommalist{{##1}}% + \else + \def\newcommalist{##1}% + \fi + \else + \ifx\nexttoken\bgroup % is known -) + \@EA\def\@EA\newcommalist\@EA{\newcommalist,{##1}}% + \else + \@EA\def\@EA\newcommalist\@EA{\newcommalist,##1}% + \fi + \fi + \fi + \advance\commalistcounter\plusone}% + \let\commalistelement\empty + \let\newcommalist\empty + \commalistcounter\plusone + \@EA\processcommalist\@EA[#1]\doreplaceincommalist + \dodoglobal\let#1\newcommalist} + +%D \macros +%D {globalprocesscommalist} +%D +%D The commalist processing commands are characterized by the +%D fact that the way they handle expansion as well as the fact +%D that they can be nested. This makes them kind of useless for +%D handling comma lists in alignments. In these situations the +%D next macro can be of use. + +\def\globalprocesscommaitem#1,% + {\if]#1\else + \globalcommacommand{#1}% + \expandafter\globalprocesscommaitem + \fi} + +\def\globalprocesscommalist[#1]#2% + {\global\let\globalcommacommand#2% + \expandafter\globalprocesscommaitem#1,],} + +%D \macros +%D {withoutpt,PtToCm, +%D numberofpoints,dimensiontocount} +%D +%D We can convert point into centimeters with: +%D +%D \starttyping +%D \PtToCm{dimension} +%D \stoptyping + +{\catcode`\.=\@@other + \catcode`\p=\@@other + \catcode`\t=\@@other + \gdef\WITHOUTPT#1pt{#1}} + +\def\withoutpt#1% + {\expandafter\WITHOUTPT#1} + +%D The capitals are needed because \type{p} and \type{t} have +%D \CATCODE~12, while macronames only permit tokens with the +%D \CATCODE~11. As a result we cannot use the \type{.group} +%D primitives. Those who want to know more about this kind of +%D manipulations, we advice to study the \TEX book in detail. +%D Because this macro does not do any assignment, we can use it +%D in the following way too. + +\def\PtToCm#1% + {\begingroup + \scratchdimen#1\relax + \scratchdimen0.0351459804\scratchdimen % 2.54/72.27 + \withoutpt\the\scratchdimen cm% + \endgroup} + +%D We also support: +%D +%D \starttyping +%D \numberofpoints {dimension} +%D \dimensiontocount {dimension} {\count} +%D \stoptyping +%D +%D Both macros return a rounded number. + +% \dimensiontocount{10.49pt}\scratchcounter \the\scratchcounter / \numberofpoints{10.49pt} +% \dimensiontocount{10.51pt}\scratchcounter \the\scratchcounter / \numberofpoints{10.51pt} + +\def\dimensiontocount#1#2{#2\numexpr\dimexpr#1\relax/\maxcard\relax} +\def\numberofpoints #1{\the\numexpr\dimexpr#1\relax/\maxcard\relax} + +%D \macros +%D {swapdimens,swapmacros} +%D +%D Simple but effective are the next two macros. There name +%D exactly states their purpose. The \type{\scratchdimen} and +%D \type{\!!stringa} can only be swapped when being the first +%D argument. + +\def\swapdimens#1#2% + {\scratchdimen #1\redoglobal #1#2\dodoglobal #2\scratchdimen} + +\def\swapmacros#1#2% + {\let\!!stringa#1\redoglobal\let#1#2\dodoglobal\let#2\!!stringa} + +%D \macros +%D {pushmacro,popmacro} +%D +%D Premature and a bit of beta, we offer: +%D +%D \starttyping +%D \pushmacro\macro +%D \popmacro\macro +%D \stoptyping +%D +%D Beware: global! + +% \def\@s@{@s@} +% +% \beginTEX +% +% \def\globalpushmacro#1% we can use a faster incement here +% {\@EA\doglobal\@EA\increment\csname\@s@*\string#1\endcsname +% \global\@EA\let\csname\csname\@s@*\string#1\endcsname*\string#1\endcsname#1} +% +% \def\globalpopmacro#1% \global\let +% {\global\@EA\let\@EA#1\csname\csname\@s@*\string#1\endcsname*\string#1\endcsname +% \@EA\doglobal\@EA\decrement\csname\@s@*\string#1\endcsname} +% +% \def\localpushmacro#1% this one can be used to push a value over an \egroup +% {\@EA\doglobal\@EA\increment\csname\@s@**\string#1\endcsname +% \global\@EA\let\csname\csname\@s@**\string#1\endcsname**\string#1\endcsname#1} +% +% \def\localpopmacro#1% \local\let +% {\@EA\let\@EA#1\csname\csname\@s@**\string#1\endcsname**\string#1\endcsname +% \global\@EA\decrement\csname\@s@**\string#1\endcsname} +% +% \endTEX +% +% \beginETEX \newcount +% +% \def\globalpushmacro#1% +% {\ifcsname\@s@*\string#1\endcsname \else +% \@EA\newcount\csname\@s@*\string#1\endcsname +% \fi +% \global\advance\csname\@s@*\string#1\endcsname \plusone +% \global\@EA\let\csname\the\csname\@s@*\string#1\endcsname*\string#1\endcsname#1} +% +% \def\globalpopmacro#1% \global\let +% {\global\@EA\let\@EA#1\csname\the\csname\@s@*\string#1\endcsname*\string#1\endcsname +% \global\advance\csname\@s@*\string#1\endcsname \minusone} +% +% \def\localpushmacro#1% this one can be used to push a value over an \egroup +% {\ifcsname\@s@**\string#1\endcsname \else +% \@EA\newcount\csname\@s@**\string#1\endcsname +% \fi +% \global\advance\csname\@s@**\string#1\endcsname \plusone +% \global\@EA\let\csname\the\csname\@s@**\string#1\endcsname**\string#1\endcsname#1} +% +% \def\localpopmacro#1% \local\let +% {\@EA\let\@EA#1\csname\the\csname\@s@**\string#1\endcsname**\string#1\endcsname +% \global\advance\csname\@s@**\string#1\endcsname \minusone } +% +% \endETEX +% +% some 5% faster (used a lot in typescripts, so ...) + +\def\@sl@{@sl@} +\def\@sg@{@sg@} + +\let\@@pushedmacro\empty + +\beginTEX + +\def\globalpushmacro#1% we can use a faster incement here + {\xdef\@@pushedmacro{\string#1}% + \@EA\doglobal\@EA\increment\csname\@sg@\@@pushedmacro\endcsname + \global\@EA\let\csname\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1} + +\def\globalpopmacro#1% + {\xdef\@@pushedmacro{\string#1}% + \global\@EA\let\@EA#1\csname\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname + \@EA\doglobal\@EA\decrement\csname\@sg@\@@pushedmacro\endcsname} + +\def\localpushmacro#1% this one can be used to push a value over an \egroup + {\xdef\@@pushedmacro{\string#1}% + \@EA\doglobal\@EA\increment\csname\@sl@\@@pushedmacro\endcsname + \global\@EA\let\csname\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1} + +\def\localpopmacro#1% + {\xdef\@@pushedmacro{\string#1}% + \@EA\let\@EA#1\csname\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname + \global\@EA\decrement\csname\@sl@\@@pushedmacro\endcsname} + +\endTEX + +\beginETEX + +\def\globalpushmacro#1% + {\xdef\@@pushedmacro{\string#1}% + \ifcsname\@sg@\@@pushedmacro\endcsname \else + \@EA\newcount\csname\@sg@\@@pushedmacro\endcsname + \fi + \global\advance\csname\@sg@\@@pushedmacro\endcsname \plusone + \global\@EA\let\csname\the\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1} + +\def\globalpopmacro#1% + {\xdef\@@pushedmacro{\string#1}% + \global\@EA\let\@EA#1\csname\the\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname + \global\advance\csname\@sg@\@@pushedmacro\endcsname \minusone} + +\def\localpushmacro#1% this one can be used to push a value over an \egroup + {\xdef\@@pushedmacro{\string#1}% + \ifcsname\@sl@\@@pushedmacro\endcsname \else + \@EA\newcount\csname\@sl@\@@pushedmacro\endcsname + \fi + \global\advance\csname\@sl@\@@pushedmacro\endcsname \plusone + \global\@EA\let\csname\the\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1} + +\def\localpopmacro#1% + {\xdef\@@pushedmacro{\string#1}% + \@EA\let\@EA#1\csname\the\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname + \global\advance\csname\@sl@\@@pushedmacro\endcsname \minusone } + +\endETEX + +% \let\pushmacro\globalpushmacro +% \let\popmacro \globalpopmacro + +\let\pushmacro\localpushmacro +\let\popmacro \localpopmacro + +%D \macros +%D {setlocalhsize} +%D +%D Sometimes we need to work with the \type{\hsize} that is +%D corrected for indentation and left and right skips. The +%D corrected value is available in \type{\localhsize}, which +%D needs to be calculated with \type{\setlocalhsize} first. +%D +%D \starttyping +%D \setlocalhsize \hbox to \localhsize{...} +%D \setlocalhsize[-1em] \hbox to \localhsize{...} +%D \setlocalhsize[.5ex] \hbox to \localhsize{...} +%D \stoptyping +%D +%D These examples show us that an optional can be used. The +%D value provided is added to \type{\localhsize}. + +\newdimen\localhsize + +\def\complexsetlocalhsize[#1]% don't change ! + {\localhsize\hsize + \ifnum\hangafter<\zerocount + \advance\localhsize\ifdim\hangindent>\zeropoint-\fi\hangindent + \fi + \advance\localhsize -\leftskip + \advance\localhsize -\rightskip + \advance\localhsize #1\relax} + +\def\simplesetlocalhsize + {\complexsetlocalhsize[\zeropoint]} + +\definecomplexorsimple\setlocalhsize + +%D \macros +%D {doifvalue,doifnotvalue,doifelsevalue, +%D doifnothing,doifsomething,doifelsenothing, +%D doifvaluenothing,doifvaluesomething,doifelsevaluenothing} +%D +%D These long named \type{\if} commands can be used to access +%D macros (or variables) that are normally accessed by using +%D \type{\getvalue}. Using these alternatives safes us three +%D tokens per call. Anyone familiar with the not||values +%D ones, can derive their meaning from the definitions. + + \def\doifvalue#1{\doif {\csname#1\endcsname}} + \def\doifnotvalue#1{\doifnot {\csname#1\endcsname}} + \def\doifelsevalue#1{\doifelse{\csname#1\endcsname}} + + \def\doifnothing#1{\doif {#1}{}} + \def\doifsomething#1{\doifnot {#1}{}} + \def\doifelsenothing#1{\doifelse{#1}{}} + + \def\doifvaluenothing#1{\doif {\csname#1\endcsname}{}} + \def\doifvaluesomething#1{\doifnot {\csname#1\endcsname}{}} +\def\doifelsevaluenothing#1{\doifelse{\csname#1\endcsname}{}} + +%D Faster but spoiling inheritance (copying parameters): +%D +%D \starttyping +%D \def\doifelsevaluesomething#1#2#3% +%D {\expandafter\ifx\csname#1\endcsname\empty#3\else#2\fi} +%D +%D \def\doifvaluesomething#1#2% +%D {\expandafter\ifx\csname#1\endcsname\empty\else#2\fi} +%D +%D \def\doifvaluenothing#1#2% +%D {\expandafter\ifx\csname#1\endcsname\empty#2\fi} +%D \stoptyping +%D +%D Slightly more efficient: + + \def\doifnothing{\doif \empty} + \def\doifsomething{\doifnot \empty} +\def\doifelsenothing{\doifelse\empty} + +%D The somewhat faster alternatives are: + +\long\def\doifvalue#1#2% + {\edef\!!stringa{\csname#1\endcsname}\edef\!!stringb{#2}% + \ifx\!!stringa\!!stringb + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\long\def\doifnotvalue#1#2% + {\edef\!!stringa{\csname#1\endcsname}\edef\!!stringb{#2}% + \ifx\!!stringa\!!stringb + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +\long\def\doifelsevalue#1#2% + {\edef\!!stringa{\csname#1\endcsname}\edef\!!stringb{#2}% + \ifx\!!stringa\!!stringb + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\long\def\doifnothing#1% + {\edef\!!stringa{#1}% + \ifx\!!stringa\empty + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\long\def\doifsomething#1% + {\edef\!!stringa{#1}% + \ifx\!!stringa\empty + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +\long\def\doifelsenothing#1% + {\edef\!!stringa{#1}% + \ifx\!!stringa\empty + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\long\def\doifsomethingelse#1% + {\edef\!!stringa{#1}% + \ifx\!!stringa\empty + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + +\long\def\doifvaluenothing#1% + {\edef\!!stringa{\csname#1\endcsname}% + \ifx\!!stringa\empty + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\long\def\doifvaluesomething#1% + {\edef\!!stringa{\csname#1\endcsname}% + \ifx\!!stringa\empty + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +\long\def\doifelsevaluenothing#1% + {\edef\!!stringa{\csname#1\endcsname}% + \ifx\!!stringa\empty + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +%D \macros +%D {doifemptyelsevalue, doifemptyvalue, doifnotemptyvalue} +%D +%D Also handy: + +\def\doifemptyelsevalue#1% + {\@EA\ifx\csname#1\endcsname\empty + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\def\doifemptyvalue#1% + {\@EA\ifx\csname#1\endcsname\empty + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\def\doifnotemptyvalue#1% + {\@EA\ifx\csname#1\endcsname\empty + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +%D \macros +%D {doifallcommonelse} +%D +%D A complete match of two sets can be tested with +%D \type {\doifallcommonelse}, where the first two +%D arguments are sets. + +%\def\doifallcommonelse#1#2#3#4% +% {\def\p!docommoncheck##1% +% {\doifnotinset{##1}{#2}{\donefalse}% +% \ifdone\else\quitcommalist\fi}% +% \donetrue +% \processcommalist[#1]\p!docommoncheck +% \ifdone#3\else#4\fi} + +\def\@@doifallcommonelse#1#2#3#4% slow + {\def\p!docommoncheck##1% + {\doifnotinset{##1}{#4}\donefalse + \ifdone\else\expandafter\quitcommalist\fi}% + \donetrue + \processcommalist[#3]\p!docommoncheck + \ifdone\expandafter#1\else\expandafter#2\fi} + +\def\doifallcommonelse + {\@@doifallcommonelse\firstoftwoarguments\secondoftwoarguments} + +\def\doifallcommon + {\@@doifallcommonelse\firstofonearguments\gobbleoneargument} + +\def\doifnotallcommon + {\@@doifallcommonelse\gobbleoneargument\firstofonearguments} + +%D \macros +%D {DOIF,DOIFELSE,DOIFNOT} +%D +%D \TEX\ is case sensitive. When comparing arguments, this +%D feature sometimes is less desirable, for instance when we +%D compare filenames. The next three alternatives upcase their +%D arguments before comparing them. +%D +%D \starttyping +%D \DOIF {string1} {string2} {...} +%D \DOIFNOT {string1} {string2} {...} +%D \DOIFELSE {string1} {string2} {then ...}{else ...} +%D \stoptyping +%D +%D We have to use a two||step implementation, because the +%D expansion has to take place outside \type{\uppercase}. + +\def\p!DOIF#1#2% + {\uppercase{\ifinstringelse{$#1$}{$#2$}}% + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\def\p!DOIFNOT#1#2% + {\uppercase{\ifinstringelse{$#1$}{$#2$}}% + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +\def\p!DOIFELSE#1#2% + {\uppercase{\ifinstringelse{$#1$}{$#2$}}% + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\def\p!DOIFINSTRINGELSE#1#2% + {\uppercase{\ifinstringelse{#1}{#2}}% + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\def\DOIF {\ExpandBothAfter\p!DOIF} +\def\DOIFNOT {\ExpandBothAfter\p!DOIFNOT} +\def\DOIFELSE {\ExpandBothAfter\p!DOIFELSE} +\def\DOIFINSTRINGELSE {\ExpandBothAfter\p!DOIFINSTRINGELSE} + +%D \macros +%D {dosingleargumentwithset, +%D dodoubleargumentwithset,dodoubleemptywithset, +%D dotripleargumentwithset,dotripleemptywithset} +%D +%D These maybe too mysterious macros enable us to handle more +%D than one setup at once. +%D +%D \starttyping +%D \dosingleargumentwithset \command[#1] +%D \dodoubleargumentwithset \command[#1][#2] +%D \dotripleargumentwithset \command[#1][#2][#3] +%D \dodoubleemptywithset \command[#1][#2] +%D \dotripleemptywithset \command[#1][#2][#3] +%D \stoptyping +%D +%D The first macro calls \type{\command[##1]} for each string +%D in the set~\type{#1}. The second one calls for +%D \type{\commando[##1][#2]} and the third, well one may guess. +%D These commands support constructions like: +%D +%D \starttyping +%D \def\dodefinesomething[#1][#2]% +%D {\getparameters[\??xx#1][#2]} +%D +%D \def\definesomething% +%D {\dodoubleargumentwithset\dodefinesomething} +%D \stoptyping +%D +%D Which accepts calls like: +%D +%D \starttyping +%D \definesomething[alfa,beta,...][variable=...,...] +%D \stoptyping +%D +%D Now a whole bunch of variables like \type{\@@xxalfavariable} +%D and \type{\@@xxbetavariable} is defined. + +\def\dodoublewithset#1#2% + {\def\dododoublewithset[##1][##2]% + {\doifsomething{##1} + {\def\dodododoublewithset####1{#2[####1][##2]}% + \processcommalist[##1]\dodododoublewithset}}% + #1\dododoublewithset} + +\def\dodoubleemptywithset {\dodoublewithset\dodoubleempty} +\def\dodoubleargumentwithset{\dodoublewithset\dodoubleargument} + +\def\dotriplewithset#1#2% + {\def\dodotriplewithset[##1][##2][##3]% + {\doifsomething{##1} + {\def\dododotriplewithset####1{#2[####1][##2][##3]}% + \processcommalist[##1]\dododotriplewithset}}% + #1\dodotriplewithset} + +\def\dotripleemptywithset {\dotriplewithset\dotripleempty} +\def\dotripleargumentwithset{\dotriplewithset\dotripleargument} + +%D \macros +%D {stripcharacters,stripspaces} +%D +%D The next command was needed first when we implemented +%D the \CONTEXT\ interactivity macros. When we use labeled +%D destinations, we often cannot use all the characters we +%D want. We therefore strip some of the troublemakers, like +%D spaces, from the labels before we write them to the +%D \DVI||file, which passes them to for instance a PostScript +%D file. +%D +%D \starttyping +%D \stripspaces\from\one\to\two +%D \stoptyping +%D +%D Both the old string \type{\one} and the new one \type{\two} +%D are expanded. This command is a special case of: +%D +%D \starttyping +%D \stripcharacter\char\from\one\to\two +%D \stoptyping +%D +%D As we can see below, spaces following a control sequence are +%D to enclosed in \type{{}}. + +% keep this one: +% +% \def\stripcharacter#1\from#2\to#3% +% {\def\dostripcharacter##1#1##2\end +% {\edef\!!strippedstring{\!!strippedstring##1}% +% \doifnotempty{##2}{\dostripcharacter##2\end}}% +% \let\!!strippedstring\empty +% \edef\!!stringa{#2}% +% \@EA\dostripcharacter\!!stringa#1\end +% \dodoglobal\let#3\!!strippedstring} +% +% the following is better (comes from syst-loc): + +\def\stripcharacter#1\from#2\to#3% + {\def\dostripcharacter##1#1##2\end + {\edef\!!strippedstring{\!!strippedstring##1}% + \doifnotempty{##2}{\dostripcharacter##2\end}}% + \let\!!strippedstring\empty + \edef\!!stringa{#2}% + \@EA\dostripcharacter\!!stringa#1\end + \dodoglobal\let#3\!!strippedstring} + +\def\stripspaces\from#1\to#2% will become \unspacestring#1\from#2 + {\stripcharacter{ }\from#1\to#2} + +%D \macros +%D {unspacestring} +%D +%D The next macro does the same but is more compatible with other macros, +%D like \type {\convert...}. + +\def\unspacestring#1\to#2% + {\stripcharacter{ }\from#1\to#2} + +%D \macros +%D {executeifdefined} +%D +%D \CONTEXT\ uses one auxiliary file for all data concerning +%D tables of contents, references, two||pass optimizations, +%D sorted lists etc. This file is loaded as many times as +%D needed. During such a pass we skip the commands thate are of +%D no use at that moment. Because we don't want to come into +%D trouble with undefined auxiliary commands, we call the +%D macros in a way similar to \type{\getvalue}. The next macro +%D take care of such executions and when not defined, gobbles +%D the unwanted arguments. +%D +%D \starttyping +%D \executeifdefined{name}\gobbleoneargument +%D \stoptyping +%D +%D We can of course gobble more arguments using the +%D appropriate gobbling command. + +\newif\ifexecuted % general purpose + +\def\executeifdefined#1#2% + {\ifundefined{#1}% + \def\next{#2}% + \else + \def\next{\getvalue{#1}}% + \fi + \next} + +%D Just for fun I times the next alternative: it was roughly +%D timed about 15\% faster than the default (10+ sec to 9 sec)! + +\beginTEX + +\def\executeifdefined#1% #2 / never change this one again + {\ifundefined{#1}% + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi + {\csname#1\endcsname}} + +\endTEX + +\beginETEX + +% \def\executeifdefined#1% #2 / never change this one again +% {\ifcsname#1\endcsname +% \expandafter\firstoftwoarguments +% \else +% \expandafter\secondoftwoarguments +% \fi +% {\csname#1\endcsname}} + +\def\executeifdefined#1% #2 / never change this one again + {\ifcsname#1\endcsname + \csname#1\expandafter\expandafter\expandafter\endcsname\expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +\endETEX + +% \letvalue{f }\firstofoneargument \def\executeifdefined#1{\csname\ifcsname#1\endcsname#1\else f \fi\endcsname} + +%D This one also has the advantage that it is fully +%D expandable and that it can be used after an assignment. + +%D \macros +%D {executeifdefinedcs} +%D +%D An also fully expandable variant is the following: +%D +%D \starttyping +%D \executeifdefinedcs{a}{b} +%D \stoptyping +%D +%D In dit geval zijn beide argumenten csnames. + +\def\executeifdefinedcs#1#2% + {\csname\ifundefined{#1}#2\else#1\fi\endcsname} + +%D We considered an alternative implementation accepting +%D commands directly, like: +%D +%D \starttyping +%D \executeifdefined\name\gobblefivearguments +%D \stoptyping +%D +%D For the moment we don't need this one, so we stick to the +%D faster one. + +%D \macros +%D {executeandforget} +%D +%D The following macros were requested by Simon. Watch the +%D global variant. +%D +%D \starttyping +%D \executeandforget\SomeCommand +%D \doglobal\executeandforget\AnotherCommand +%D \stoptyping + +\def\executeandforget#1% + {\global\let\@@expanded#1% + \dodoglobal\let#1\relax + \@@expanded} + +%D \macros +%D {doifsomespaceelse} +%D +%D The next command checks a string on the presence of a space +%D and executed a command accordingly. +%D +%D \starttyping +%D \doifsomespaceelse {tekst} {then ...} {else ...} +%D \stoptyping +%D +%D We use this command in \CONTEXT\ for determing if an +%D argument must be broken into words when made interactive. +%D Watch the use of \type{\noexpand}. + +%D Is this one still needed? + +% \long\def\doifsomespaceelse#1#2#3% +% {\def\p!doifsomespaceelse##1 ##2##3\war% +% {\if\noexpand##2@#3\else#2\fi}% +% \p!doifsomespaceelse#1 @ @\war} + +\def\p!doifsomespaceelse#1 #2#3\war{\if\noexpand#2@} + +\long\def\doifsomespaceelse#1% % #2#3% + {\p!doifsomespaceelse#1 @ @\war % #3\else#2\fi} + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + +%D \macros +%D {adaptdimension,balancedimensions} +%D +%D Again we introduce some macros that are closely related to +%D an interface aspect of \CONTEXT. The first command can be +%D used to adapt a \DIMENSION. +%D +%D \starttyping +%D \adaptdimension {dimension} {value} +%D \stoptyping +%D +%D When the value is preceed by a \type{+} or minus, the +%D dimension is advanced accordingly, otherwise it gets the +%D value. + +% \def\doadaptdimension#1#2\\#3\\% +% {\if#1+% +% \dodoglobal\advance#3 #1#2\relax +% \else\if#1-% +% \dodoglobal\advance#3 #1#2\relax +% \else +% \dodoglobal#3=#1#2\relax +% \fi\fi} +% +% more fuzzy but also more efficient + +\def\doadaptdimension#1#2\\#3\\% + {\if#1+% + \dodoglobal\advance + \else\if#1-% + \dodoglobal\advance + \else + \dodoglobal + \fi\fi + #3 #1#2\relax} + +\def\adaptdimension#1#2% + {\expandafter\doadaptdimension#2\\#1\\} + +%D A second command takes two \DIMENSIONS. Both are adapted, +%D depending on the sign of the given value. +%D maat. This time we take the value as it is, and don't look +%D explicitly at the preceding sign. +%D +%D \starttyping +%D \balancedimensions {dimension 1} {dimension 2} {value} +%D \stoptyping +%D +%D When a positive value is given, the first dimension is +%D incremented, the second ond is decremented. A negative value +%D has the opposite result. + +\def\balancedimensions#1#2#3% + {\scratchdimen#3\relax + \redoglobal\advance#1 \scratchdimen + \dodoglobal\advance#2 -\scratchdimen} + +%D Both commands can be preceded by \type{\doglobal}. Here we +%D use \type{\redo} first, because \type{\dodo} resets the +%D global character. + +%D \macros +%D {processseparatedlist} +%D +%D Maybe a bit late, but here is a more general version of the +%D \type{\processcommalist} command. This time we don't handle +%D nesting but accept arbitrary seperators. +%D +%D \starttyping +%D \processseparatedlist[list][separator]\command +%D \stoptyping +%D +%D One can think of things like: +%D +%D \starttyping +%D \processseparatedlist[alfa+beta+gamma][+]\message +%D \stoptyping + +%D First we show the simple alternative: +%D +%D \starttyping +%D \def\processseparatedlist[#1][#2]#3% +%D {\def\doprocessseparatedlist##1##2#2% +%D {\if]##1% +%D \let\next=\relax +%D \else\if]##2% +%D \let\next=\relax +%D \else\ifx\blankspace##2% +%D #3{##1}% +%D \let\next=\doprocessseparatedlist +%D \else +%D #3{##1##2}% +%D \let\next=\doprocessseparatedlist +%D \fi\fi\fi +%D \next}% +%D \doprocessseparatedlist#1#2]#2} +%D \stoptyping +%D +%D However, we want to handle all situations, like: +%D +%D \startbuffer +%D \processseparatedlist[{aap noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii} +%D \processseparatedlist[{aap} {noot}][ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii} +%D \processseparatedlist[aap {noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii} +%D \processseparatedlist[aap noot] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii} +%D \stopbuffer +%D +%D \typebuffer \getbuffer +%D +%D Therefore we smuggle a \type {\relax} in front of the +%D argument, which we remove afterwards. + +% \def\doprocessseparatedlist#1]#2[#3]#4% +% {\def\dodoprocessseparatedlist##1##2#3% +% {\if]##1% +% \let\dodoprocessseparatedlist\relax +% \else\if]##2% +% \let\dodoprocessseparatedlist\relax +% \else\ifx\blankspace##2% +% #4{##1}% +% \else +% #4{##1##2}% +% \fi\fi\fi +% \dodoprocessseparatedlist}% +% \@EA\dodoprocessseparatedlist\gobbleoneargument#1#3]#3} + +% testcase Vit Zyka: +% +% \def\Do#1{(#1)} +% 1\processseparatedlist[{aap noot}] [ ]\Do \par +% 2\processseparatedlist[{aap} {noot}][ ]\Do \par +% 3\processseparatedlist[aap {noot}] [ ]\Do \par +% 4\processseparatedlist[aap noot] [ ]\Do \par +% 5\processseparatedlist[aap;noot;a noot;noot a; noot a noot][;]\Do \par +% 6\processseparatedlist[][;]\Do \par +% 7\processseparatedlist[;][;]\Do \par + +\def\doprocessseparatedlist#1]#2[#3]#4% + {\def\dodoprocessseparatedlist##1##2#3% + {\def\!!stringa{##2}% suggested by VZ + \if]##1% + \let\dodoprocessseparatedlist\relax + \else\ifx\blankspace\!!stringa + #4{##1}% + \else\if]##2% + \let\dodoprocessseparatedlist\relax + \else + #4{##1##2}% + \fi\fi\fi + \dodoprocessseparatedlist}% + \@EA\dodoprocessseparatedlist\gobbleoneargument#1#3]#3} + +\def\processseparatedlist[% + {\doprocessseparatedlist\relax} + +%D \macros +%D {processlist} +%D +%D An even more general list processing macro is the +%D following one: +%D +%D \starttyping +%D \processlist{beginsym}{endsym}{separator}\docommand list +%D \stoptyping +%D +%D This one supports arbitrary open and close symbols as well +%D as user defined separators. +%D +%D \starttyping +%D \processlist(){=>}\docommand(a=>b=>c=>d) +%D \stoptyping + +\long\def\processlist#1#2#3#4% no blank skipping ! + {\def\doprocesslist##1#2% + {\def\dodoprocesslist####1####2#3% + {\ifx#2####1% + \let\dodoprocesslist\relax + \else\ifx#2####2% + \let\dodoprocesslist\relax + \else + #4{####1####2}% + \fi\fi + \dodoprocesslist}% + \expandafter\dodoprocesslist\gobbleoneargument##1#3#2#3}% + \def\dodoprocesslist#1% + {\doprocesslist\relax}% + \dodoprocesslist} + +% %D \macros +% %D {dohonorgroupedargument} +% %D +% %D The previous macro uses yet another auxiliary macro to +% %D handle the special case. +% +% \def\dohonorgroupedargument#1[% +% {\doifnextbgroupelse{\dodohonorgroupedargument#1}{#1[}} +% +% \def\dodohonorgroupedargument#1#2% +% {#1[{{#2}}} + +%D \macros +%D {processassignlist} +%D +%D Is possible to combine an assignment list with one +%D containing keywords. Assignments are treated accordingly, +%D keywords are treated by \type{\command}. +%D +%D \starttyping +%D \processassignlist[...=...,...=...,...]\commando +%D \stoptyping +%D +%D This command can be integrated in \type{\getparameters}, but +%D we decided best not to do so. + +\def\processassignlist#1[#2]#3% + {\def\p!dodogetparameter[##1=##2=##3]% + {\doifnot{##3}\relax{#3{##1}}}% + \def\p!dogetparameter##1% + {\p!dodogetparameter[##1==\relax]}% + \processcommalist[#2]\p!dogetparameter} + +% too ugly +% +% %D \macros +% %D {DoAfterFi,DoAfterFiFi} +% %D +% %D Sometimes \type{\fi}'s can get into the way. We can reach +% %D over such a troublemaker with: +% %D +% %D \starttyping +% %D \DoAfterFi{some commands} +% %D \DoAfterFiFi{some commands} +% %D \stoptyping +% %D +% %D It saves us a \type{\next} construction. Skipping +% %D \type{\else...\fi} is more tricky, so this one is not +% %D provided. +% +% \def\DoAfterFi#1\fi{\fi#1} +% \def\DoAfterFiFi#1\fi#2\fi{\fi\fi#1} + +%D \macros +%D {untextargument +%D untexcommand} +%D +%D When manipulating data(bases) and for instance generating +%D index entries, the next three macros can be of help: +%D +%D \starttyping +%D \untextargument{...}\to\name +%D \untexcommand {...}\to\name +%D \stoptyping +%D +%D They remove braces and backslashes and give us something to +%D sort. + +\def\untexsomething + {\begingroup + \catcode`\{=\@@ignore + \catcode`\}=\@@ignore + \escapechar\minusone + \dountexsomething} + +\long\def\dountexsomething#1#2\to#3% + {\doglobal#1#2\to\untexedargument + \endgroup + \let#3\untexedargument} + +\def\untexargument{\untexsomething\convertargument} +\def\untexcommand {\untexsomething\convertcommand} + +%D \macros +%D {ScaledPointsToBigPoints,ScaledPointsToWholeBigPoints} +%D +%D One characteristic of \POSTSCRIPT\ and \PDF\ is that both +%D used big points (\TEX's bp). The next macros convert points +%D and scaled points into big points. +%D +%D \starttyping +%D \ScaledPointsToBigPoints {number} \target +%D \ScaledPointsToWholeBigPoints {number} \target +%D \stoptyping +%D +%D The magic factor $72/72.27$ can be found in most \TEX\ +%D related books. + +% \def\ScaledPointsToBigPoints #1{\PointsToBigPoints {#1sp}} +% \def\ScaledPointsToWholeBigPoints#1{\PointsToWholeBigPoints{#1sp}} +% +% \def\PointsToBigPoints#1#2% +% {\scratchdimen#1% +% \scratchdimen.996264\scratchdimen +% \edef#2{\withoutpt\the\scratchdimen}} +% +% \def\PointsToWholeBigPoints#1#2% +% {\scratchdimen#1% +% \scratchdimen.996264\scratchdimen +% \scratchcounter\scratchdimen +% \advance\scratchcounter \medcard +% \divide\scratchcounter \maxcard +% \edef#2{\the\scratchcounter}} + +% \PointsToBigPoints{10.53940pt}\test \test +% \PointsToBigPoints{10.53941pt}\test \test +% \PointsToBigPoints{10.53942pt}\test \test + +% \PointsToWholeBigPoints{10.53940pt}\test \test +% \PointsToWholeBigPoints{10.53941pt}\test \test +% \PointsToWholeBigPoints{10.53942pt}\test \test + +\beginTEX + + \def\PointsToBigPoints#1#2% + {\scratchdimen#1% + \scratchdimen.996264\scratchdimen + \edef#2{\withoutpt\the\scratchdimen}} + + \def\PointsToWholeBigPoints#1#2% + {\scratchdimen#1% + \scratchdimen.996264\scratchdimen + \scratchcounter\scratchdimen + \advance\scratchcounter \medcard + \divide\scratchcounter \maxcard + \edef#2{\the\scratchcounter}} + +\endTEX + +\beginETEX \dimexpr \numexpr + +% \def\PointsToBigPoints#1#2% +% {\edef#2{\withoutpt\the\dimexpr(.996264\dimexpr(#1))}} + +% \def\PointsToWholeBigPoints#1#2% +% {\edef#2{\the\numexpr(\numexpr(\dimexpr(.996264\dimexpr(#1)))/\maxcard)}} + + \def\PointsToBigPoints#1#2% + {\edef#2{\withoutpt\the\dimexpr.996264\dimexpr#1\relax\relax}} + + \def\PointsToWholeBigPoints#1#2% + {\edef#2{\the\numexpr\dimexpr.996264\dimexpr#1\relax\relax/\maxcard\relax}} + +\endETEX + +\def\ScaledPointsToBigPoints #1{\PointsToBigPoints {\number#1\scaledpoint}} +\def\ScaledPointsToWholeBigPoints#1{\PointsToWholeBigPoints{\number#1\scaledpoint}} + +%D \macros +%D {PointsToReal} +%D +%D Points can be stripped from their suffix by using +%D \type{\withoutpt}. The next macro enveloppes this macro. +%D +%D \starttyping +%D \PointsToReal {dimension} \target +%D \stoptyping + +\def\PointsToReal#1#2% + {\scratchdimen#1% + \edef#2{\withoutpt\the\scratchdimen}} + +%D \macros +%D {dontleavehmode} +%D +%D Sometimes when we enter a paragraph with some command, the +%D first token gets the whole first line. We can prevent this +%D by saying: +%D +%D \starttyping +%D \dontleavehmode +%D \stoptyping +%D +%D This command is used in for instance the language module +%D \type{lang-ini}. The first version was: +%D +%D \starttyping +%D \def\dontleavehmode{\ifhmode\else\ifmmode\else$ $\fi\fi} +%D \stoptyping +%D +%D Next, Taco came with a better alternative (using mathsurround): +%D +%D \starttyping +%D \def\dontleavehmode +%D {\ifhmode\else \ifmmode\else +%D {\mathsurround\zeropoint\everymath\emptytoks$ $}% +%D \fi \fi} +%D \stoptyping +%D +%D And finaly we got the following alternative, one that avoids +%D interfering grouping at the cost of a box. + +\newbox\@@dlhbox + +\unexpanded \def\dontleavehmode + {\ifhmode\else \ifmmode\else + \setbox\@@dlhbox\hbox{\mathsurround\zeropoint\everymath\emptytoks$ $}\unhbox\@@dlhbox + \fi \fi} + +% Also ok, but more sensitive to lookahead expansion is: +% +% \def\dontleavehmode{\ifvmode \indent \fi} +% +% which assumes indent is kept unchanged. Protecting the macro is only +% possible in etex (watch out: \unexpanded in context is eq to \protected). +% +% \unexpanded \def\dontleavehmode{\ifvmode \indent \fi} % functional spec TH + +%D But, if you run a recent version of \TEX, we can use the new +%D primitive: + +\ifx\normalquitvmode\undefined \else \let\dontleavehmode\normalquitvmode \fi + +%D \macros +%D {uppercasestring,lowercasestring} +%D +%D The names tell what they do: +%D +%D \starttyping +%D \uppercasestring somestring\to\somestring +%D \lowercasestring somestring\to\somestring +%D \stoptyping +%D +%D the first argument may be a \type{\macro}. + +\def\uppercasestring#1\to#2% first @EA redundant + {\edef#2{#1}\@EA\uppercase\@EA{\@EA\dodoglobal\@EA\edef\@EA#2\@EA{#2}}} + +\def\lowercasestring#1\to#2% first @EA redundant + {\edef#2{#1}\@EA\lowercase\@EA{\@EA\dodoglobal\@EA\edef\@EA#2\@EA{#2}}} + +%D \macros +%D {handletokens} +%D +%D With the next macro we enter a critical area of macro +%D expansion. What we want is a macro that looks like: +%D +%D \starttyping +%D \handletokens some tokens\with \somemacro +%D \stoptyping +%D +%D At first sight the next implementation will suffice, but +%D running this one shows that we loose the spaces. This is no +%D surprise because we grab arguments and spaces preceding those +%D are just ignored. +%D +%D \starttyping +%D \def\nohandletokens#1\end% +%D {} +%D +%D \def\dohandletokens#1#2\end% +%D {\ifx#1\endoftoken +%D \expandafter\nohandletokens +%D \else +%D \docommand{#1}% +%D \expandafter\dohandletokens +%D \fi +%D #2\end} +%D +%D \long\def\handletokens#1\with#2% +%D {\let\docommand=#2\relax +%D \dohandletokens#1\endoftoken\end} +%D \stoptyping +%D +%D A second approach therefore grabs the individual characters +%D by using \type{\afterassignment}, in which case the space is +%D read in as space. +%D +%D \starttyping +%D \def\dodohandletokens% +%D {\ifx\next\end \else +%D \docommand{\next}% +%D \expandafter\dohandletokens +%D \fi} +%D +%D \def\dohandletokens +%D {\afterassignment\dodohandletokens\let\next= } +%D +%D \long\def\handletokens#1\with#2% +%D {\let\docommand=#2% +%D \dohandletokens#1\end} +%D \stoptyping + +%D A bonus example: +%D +%D \starttyping +%D \hbox{\handletokens tekst en meer tekst\with\ruledhbox} +%D +%D \def\weetikveel#1{\if#1\blankspace\space\else\ruledhbox{#1}\fi} +%D +%D \hbox{\handletokens tekst en meer tekst\with\weetikveel} +%D \stoptyping + +%D \macros +%D {counttoken,counttokens} +%D +%D For the few occasions that we want to know the number of +%D specific tokens in a string, we can use: +%D +%D \starttyping +%D \counttoken token\in string\to \count +%D \counttokens string\to \count +%D \stoptyping +%D +%D This macro, that for instance is used in \type{cont-tab}, +%D takes a real counter. The macro can be preceded by \type +%D {\doglobal}. + +\def\counttoken#1\in#2\to#3% + {\redoglobal#3\zerocount + \def\!!stringa{#1}% + \def\!!stringb{\end}% + \def\docounttoken##1% obeys {} + {\def\!!stringc{##1}% + \ifx\!!stringb\!!stringc \else + \ifx\!!stringa\!!stringc + \dodoglobal\advance#3 \plusone + \fi + \expandafter\docounttoken + \fi}% + \docounttoken#2\end + \resetglobal} + +% \def\counttoken#1\in#2\to#3% +% {\redoglobal#3\zerocount +% \def\!!stringa{#1}% +% \def\docounttoken##1% obeys {} +% {\def\!!stringb{##1}% +% \ifx\!!stringa\!!stringb +% \dodoglobal\advance#3\plusone +% \fi}% +% \handletokens#1\with\docounttoken +% \resetglobal} + +\def\counttokens#1\to#2% + {\redoglobal#2\zerocount + \def\docounttoken##1{\dodoglobal\advance#2\plusone}% + \handletokens#1\with\docounttoken + \resetglobal} + +%D \macros +%D {splitofftokens} +%D +%D Running this one not always gives the expected results. +%D Consider for instance the macro for which I originally +%D wrote this token handler. + +\long\def\splitofftokens#1\from#2\to#3% + {\ifnum#1>\zerocount + \scratchcounter#1\relax + \def\dosplitofftokens##1% + {\ifnum\scratchcounter>\zerocount + \advance\scratchcounter \minusone + \edef#3{#3##1}% + \fi}% + % \let#3\empty % #3 can be #2, so: + \@EA\let\@EA#3\@EA\empty + \@EA\handletokens#2\with\dosplitofftokens + \else + \edef#3{#2}% + \fi} + +%D This macro can be called like: +%D +%D \startbuffer[example] +%D \splitofftokens10\from01234567 890123456789\to\test [\test] +%D \stopbuffer +%D +%D However, the characters that we expect to find in +%D \type{\test} just don;t show up there. The reason for this +%D is not that logical but follows from \TEX's sometimes +%D mysterious way of expanding. Look at this: +%D +%D \startbuffer[next] +%D \def\next{a} \edef\test{\next} [\test] +%D \let\next=b \edef\test{\test\next} [\test] +%D \let\next=c \edef\test{\next} [\test] +%D \let\next=d \edef\test{\test\next} [\test] +%D \let\next=e \@EA\edef\@EA\test\@EA{\test\next} [\test] +%D \stopbuffer +%D +%D \typebuffer[next] +%D +%D Careful reading shows that inside an \type{\edef} macro's +%D that are \type{\let} are not expanded! +%D +%D \unprotect\getbuffer[next]\protect +%D +%D That's why we finally end up with a macro that looks +%D ahead by using an assignment, this time by using \type +%D {\futurelet}, and grabbing an argument as well. That +%D way we can handle the sentinal, a blank space and grouped +%D tokens. + +\def\dohandletokens % \nexthandledtoken is part of interface + {\futurelet\nexthandledtoken\dodohandletokens} + +\long\def\handletokens#1\with#2% + {\gdef\dododohandletokens{#2}% permits more complex #2's + \dohandletokens#1\end} + +%D A previous version said \type{\docommand=#2}, but to enable +%D use in alignments, I decided to use another placeholder, one +%D that is not sensitive to the global assignment. + +%D This alternatives does not handle grouped tokens well, so +%D next we had (for a short moment): +%D +%D \starttyping +%D \def\dodohandletokens#1% +%D {\ifx\nexthandledtoken\blankspace +%D \dododohandletokens{ }% +%D \fi +%D \ifx#1\end \else +%D \dododohandletokens{#1}% +%D \expandafter\dohandletokens +%D \fi} +%D \stoptyping +%D +%D This one failed on a trailing space, something we +%D encounter in \JAVASCRIPT\ cleaning. +%D +%D \starttyping +%D \def\dodohandletokens#1% +%D {\ifx\nexthandledtoken\blankspace +%D \dododohandletokens{ }% +%D \fi +%D \ifx\nexthandledtoken\end \else +%D \dododohandletokens{#1}% +%D \expandafter\dohandletokens +%D \fi} +%D \stoptyping +%D +%D So, now we have: + +\def\dodohandletokens % can be sped up + {\ifx\nexthandledtoken\blankspace + \def\next * {\dododohandletokens{ }\dohandletokens}% + \else\ifx\nexthandledtoken\end + \let\next\gobbletwoarguments + \else + \long\def\next *##1{\dododohandletokens{##1}\dohandletokens}% + \fi\fi + \next *} + +%D This macro is tested on: +%D +%D \def\xxx#1{[#1]} +%D +%D \startlines +%D \handletokens abc\with\xxx +%D \handletokens a b c\with\xxx +%D \handletokens a b c\with\xxx +%D \handletokens a{bc}d\with\xxx +%D \handletokens a\space bc \with\xxx +%D \stoplines +%D +%D And our previous example shows up as: +%D +%D \getbuffer[example] + +%D \macros +%D {iftrialtypesetting, ifvisible} +%D +%D The next boolean is at first sight a strange one. Sometimes +%D one does a trial typesetting run, for instance to determine +%D dimensions. Some mechanisms, like object inclusion, can fail +%D on such trials. Temporary setting the next boolean to true, +%D helps a lot. The second boolena can be used to inhibit +%D processing completely. + +\newif\iftrialtypesetting \trialtypesettingfalse +\newif\ifvisible \visibletrue + +%D \macros +%D {startlocal, startglobal} +%D +%D The next four macros are rather self explaining: +%D +%D \starttyping +%D \startlocal +%D whatever assignments +%D \stoplocal +%D +%D \startglobal +%D whatever assignments +%D \stopglobal +%D \stoptyping +%D +%D These macros are meant for those who know the difference +%D between local and global assignments and are aware of the +%D possible unwanted side effect + +\def\dostartglobaldefs#1#2% + {\edef\!!stringa{\the\globaldefs}% + \ifnum\globaldefs#10 + \globaldefs-\globaldefs + \fi + \advance\globaldefs#21 + \letvalue{@gd@\the\globaldefs}\!!stringa} + +\def\dostopglobaldefs% + {\doifdefinedelse{@gd@\the\globaldefs} + {\globaldefs\getvalue{@gd@\the\globaldefs}\relax} + {\globaldefs\zerocount}} + +\def\startlocal {\dostartglobaldefs>-} +\def\stoplocal {\dostopglobaldefs} +\def\startglobal {\dostartglobaldefs<+} +\def\stopglobal {\dostopglobaldefs} + +%D \macros +%D {twodigitrounding} +%D +%D When using \type {\special}s or \type {\pdfliteral}s, it +%D sometimes makes sense to limit the precission. The next +%D macro rounds a real number to two digits. It takes one +%D argument and only works in \ETEX. + +\beginTEX + + \let\integerrounding \firstofoneargument + \let\onedigitrounding \firstofoneargument + \let\twodigitrounding \firstofoneargument + \let\threedigitrounding\firstofoneargument + +\endTEX + +\beginETEX \dimexpr + + \def\dointegerrounding #1.#2\relax {#1} + \def\doonedigitrounding #1.#2#3\relax {\ifx#2*#1\else#1.#2\fi} + \def\dotwodigitrounding #1.#2#3#4\relax {\ifx#2*#1\else#1.#2#3\fi} + \def\dothreedigitrounding#1.#2#3#4#5\relax{\ifx#2*#1\else#1.#2#3#4\fi} + + \def\integerrounding#1% + {\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr#1\points+.5\points \relax .\relax} + \def\onedigitrounding#1% + {\@EA\@EA\@EA\doonedigitrounding \@EA\WITHOUTPT\the\dimexpr#1\points+.05\points \relax 00.*0\relax} + \def\twodigitrounding#1% + {\@EA\@EA\@EA\dotwodigitrounding \@EA\WITHOUTPT\the\dimexpr#1\points+.005\points \relax 000.*00\relax} + \def\threedigitrounding#1% + {\@EA\@EA\@EA\dothreedigitrounding\@EA\WITHOUTPT\the\dimexpr#1\points+.0005\points\relax0000.*00\relax} + +% \def\dointegerrounding #1.#2\relax {#1} +% \def\doonedigitrounding #1.#2#3\relax {#1.#2} +% \def\dotwodigitrounding #1.#2#3#4\relax {#1.#2#3} +% \def\dothreedigitrounding#1.#2#3#4#5\relax{#1.#2#3#4} + +% \def\integerrounding #1{\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr #1\points+.5\points\relax \relax} +% \def\onedigitrounding #1{\@EA\@EA\@EA\doonedigitrounding \@EA\WITHOUTPT\the\dimexpr #1\points+.05\points\relax 0\relax} +% \def\twodigitrounding #1{\@EA\@EA\@EA\dotwodigitrounding \@EA\WITHOUTPT\the\dimexpr #1\points+.005\points\relax 00\relax} +% \def\threedigitrounding#1{\@EA\@EA\@EA\dothreedigitrounding\@EA\WITHOUTPT\the\dimexpr#1\points+.0005\points\relax000\relax} + +% \def\integerroundeddimen #1{\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr #1+.5\points\relax \relax} +% \def\onedigitroundeddimen #1{\@EA\@EA\@EA\doonedigitrounding \@EA\WITHOUTPT\the\dimexpr #1+.05\points\relax 0\relax} +% \def\twodigitroundeddimen #1{\@EA\@EA\@EA\dotwodigitrounding \@EA\WITHOUTPT\the\dimexpr #1+.005\points\relax 00\relax} +% \def\threedigitroundeddimen#1{\@EA\@EA\@EA\dothreedigitrounding\@EA\WITHOUTPT\the\dimexpr#1+.0005\points\relax000\relax} + +\endETEX + +%D \macros +%D {processcontent} +%D +%D This is the first occasion where \TEX\ and \ETEX\ are no +%D longer compatible, although in many cases things go ok. +%D Beware of verbatim, i.e. catcode changes. +%D +%D \starttyping +%D \def\starthans% +%D {\processcontent{stophans}\test{\message{\test}\wait}} +%D \stoptyping +%D +%D This macro is first used in the tabulation macros. + +\def\processcontent#1% + {\begingroup\@EA\doprocesscontent\csname#1\endcsname} + +%\beginTEX + +\def\doprocesscontent#1#2#3% + {\long\def\doprocesscontent##1#1% + {\endgroup\long\def#2{##1}#3}% + \doprocesscontent} + +%\endTEX + +% Hm. Side effect, spaces after \type{\test} in verbatim. +% must set eof token + +%\beginETEX \scantokens +% +%\def\doprocesscontent#1#2#3% +% {\long\def\doprocesscontent##1#1% +% {\egroup\long\def#2{\scantokens{##1}}#3}% +% \doprocesscontent} +% +%\endETEX + +%D \macros +%D {dogobblesingleempty, dogobbledoubleempty} +%D +%D These two macros savely grab and dispose two arguments. + +\def\dogobblesingleempty{\dosingleempty\dodogobblesingleempty} +\def\dogobbledoubleempty{\dodoubleempty\dodogobbledoubleempty} + +\def\dodogobblesingleempty [#1]{} +\def\dodogobbledoubleempty[#1][#2]{} + +\let\gobblesingleempty\dogobblesingleempty % also used +\let\gobbledoubleempty\dogobbledoubleempty % also used + +%D \macros +%D {sortcommalist,sortcommacommand, +%D donumericcompare,comparedresult} +%D +%D Sometimes we need to sort a commalist, so here is Taco's +%D solution. This will in many cases be a list that is stored +%D in a \type{\csname}, so both commalist and commacommands are +%D supported. The sorting algorithm is very simple, so the list +%D should not be too long or sorting will be very slow. +%D +%D \starttyping +%D \sortcommalist[10,2,4,5,6,1,2,3,4,10,20]\donumericcompare +%D +%D \def\test{10,2,4,5,6,1,2,3,4,10,20} +%D +%D \sortcommacommand[\test]\donumericcompare +%D \stoptyping +%D +%D In both cases, the result is available in the macro \type +%D {\sortedcommalist}. +%D +%D Parameter \type{#2} is a macro that should accept two +%D parameters, and it has to decide which one is larger, by +%D setting the counter \type{\comparedresult} to~0 (for equal), +%D 1~(if it's first argument is larger), or~2 (if it's second +%D argument is larger). +%D +%D As said, these macro are largely written by Taco, and are +%D (maybe therefore) also the first application of \type +%D {\replaceincommalist}. + +\newcount\comparedresult + +\def\sortcommacommand[#1]% + {\@EA\sortcommalist\@EA[#1]} + +\def\sortcommalist[#1]#2% + {\getcommalistsize[#1]% + \ifnum\commalistsize>1 + \let\sortedcommalist\empty + \let\comparecommand#2% + \processcommalist[#1]\dosortcommacommand + \else + \def\sortedcommalist{#1}% + \fi} + +\def\dosortcommacommand#1% + {\ifx\sortedcommalist\empty + \def\sortedcommalist{#1}% + \else + \def\!!tempa{#1}% + \ifx\!!tempa\empty\else + \scratchcounter\plusone + \@EA\getcommalistsize\@EA[\sortedcommalist]% + \@EA\processcommalist\@EA[\sortedcommalist]\docompareitems + \fi + \fi} + +%D All those \type{\expandafter}'s are there because I do not +%D want to use \type{\edef}. + +\def\docompareitems#1% + {\doifnotempty{#1} + {\@EA\comparecommand\@EA{\!!tempa}{#1}\relax + %\ifcase\compareresult % equal + \ifnum\comparedresult<2 + \ifnum\scratchcounter=\commalistsize + \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist + \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}% + \fi + %\or % new element larger + % \ifnum\scratchcounter=\commalistsize + % \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist + % \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}% + % \fi + \else % old element larger + \@EA\def\@EA\newcommalistelement\@EA{\!!tempa,#1}% + \replaceincommalist\sortedcommalist\scratchcounter + \expandafter\quitcommalist + \fi}% + \advance\scratchcounter \plusone} % bug, was \minusone + +%D The macro \type{\donumericcompare} considers everything +%D that is not a number to be larger than any number. + +\def\donumericcompare#1#2% + {\doifnumberelse{#1} + {\doifnumberelse{#2} + {\ifnum#1>#2\relax + \comparedresult\plusone % #1 is larger + \else\ifnum#1<#2\relax + \comparedresult\plustwo % #2 is larger + \else + \comparedresult\zerocount % both are equal + \fi\fi} + {\comparedresult\plustwo}} + {\comparedresult\plusone}} + +%D \macros +%D {@True, @False, @Not, @And} +%D +%D Some predicate logic functions, used in for instance the +%D math module. + +\def\@True {00} +\def\@False {01} +\def\@Not #1{0\ifcase#11 \or\@EA 1\else \@EA 0\fi} +\def\@And #1#2{0\ifcase#1#2 \@EA 0\else \@EA 1\fi} + +%D \macros +%D {setdimensionwithunit, freezedimensionwithunit} +%D +%D The next assignments are all valid: +%D +%D \starttyping +%D \setdimensionwithunit\scratchdimen{10} {cm} +%D \setdimensionwithunit\scratchdimen{10cm}{cm} +%D \setdimensionwithunit\scratchdimen{10cm}{} +%D \freezedimensionwithunit\SomeWidth{\textwidth} +%D \freezedimensionwithunit\SomeDepth{\dp\strutbox} +%D \stoptyping +%D +%D As an alternative for the next macro we can use a global +%D assignment inside a box. The \type{\empty}'s permits +%D gobbling while preventing spurious \type{\relax}'s. + +\def\setdimensionwithunit#1#2#3% number unit dimension / nice trick + {\afterassignment\gobblefourarguments#1=#2#3pt\relax\empty\empty\empty\empty} + +\def\freezedimensionwithunit#1#2% + {\setdimensionwithunit\scratchdimen#1{#2}\edef#1{\the\scratchdimen}} + +%D \macros +%D {doifsometokselse} +%D +%D Not that fast I guess, but here's a way to test for token +%D registers being empty. + +\def\doifsometokselse#1% % #2#3% + {\edef\!!stringa{\the#1}% + \ifx\!!stringa\empty % #3\else#2\fi} + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + +%D \macros +%D {startstrictinspectnextcharacter} +%D +%D This one if for Taco's bibliography module: + +\let\normalinspectnextcharacter\inspectnextcharacter + +\def\strictinspectnextcharacter% no user macro ! + {\ifx\nexttoken\charactertoken + \expandafter\!!stringa + \else + \expandafter\!!stringb + \fi} + +% better: push/pop + +\def\startstrictinspectnextcharacter + {\let\inspectnextcharacter\strictinspectnextcharacter} + +\def\stopstrictinspectnextcharacter + {\let\inspectnextcharacter\normalinspectnextcharacter} + +%D \macros +%D {gobblespacetokens} +%D +%D This macro needs a speed-up! + +%\def\gobblespacetokens +% {\doifnextcharelse\empty\donothing\donothing} % no {}\do\do ! + +\def\gobblespacetokens + {\afterassignment\nexttoken\let\nexttoken=} + +%D \macros +%D {verbatimargument} +%D +%D As the name says, this macro converts its argument to a +%D (rather safe) string. + +\def\verbatimstring#1% + {\convertargument#1\to\ascii\ascii} + +%D These are needed in ordinal number conversions: + +\def\lastdigit#1% + {\@EA\thelastdigit\number#1\relax} + +\def\thelastdigit#1#2% + {\ifx#2\relax#1\else\@EA\thelastdigit\@EA#2\fi} + +\def\lasttwodigits#1% + {\@EA\thelasttwodigits\@EA0\number#1\relax} + +\def\thelasttwodigits#1#2#3% 0 dig ... \relax + {\ifx#3\relax#1#2\else\@EA\thelasttwodigits\@EA#2\@EA#3\fi} + +%D \macros +%D {serializecommalist} +%D +%D Concatenate commalists: + +\def\serializecommalist[#1]% + {\let\serializedcommalist\empty + \def\docommand##1{\edef\serializedcommalist{\serializedcommalist##1}}% + \processcommacommand[#1]\docommand} + +%D \macros +%D {purenumber} +%D +%D Sometimes we need control over when \TEX\ stops reading a +%D number, especially in full expandable macros where using +%D \type {\relax} would lead to disasters. +%D +%D \starttyping +%D \ifodd\purenumber{...}\space ... \else ... \fi +%D \stoptyping +%D +%D Here we use a space as number delimiter in combination +%D with a space- and relax-less \type {\purenumber}. This +%D macro works ok with \type {\the}, \type {\number} as well +%D as \ETEX's \type {\numexpr}. + +\def\purenumber#1{\@EA\firstofoneargument\@EA{\number#1}} + +%D \macros +%D {filterfromvalue} +%D +%D \starttyping +%D \setvalue{xx}{{A}{B}{C}} +%D +%D \filterfromvalue{xx}{3}{3} +%D \filterfromvalue{xx}{3}{2} +%D \filterfromvalue{xx}{3}{1} +%D \stoptyping +%D +%D An alternative is to store 'max' in the list, say: +%D +%D \starttyping +%D \setvalue{xx}{3{A}{B}{C}} +%D +%D \filterfromvalues{3}{xx}{3} +%D \filterfromvalues{3}{xx}{2} +%D \filterfromvalues{3}{xx}{1} +%D \stoptyping +%D +%D I'll implement this when I'm in \quotation {writing dirty +%D macros mood}. + +\def\dofilterfromstr#1#2% max n + {\ifcase#1\or + \ifcase#2\or + \strippedcsname\firstofoneargument + \else + \strippedcsname\gobbleoneargument + \fi + \or + \ifcase#2\or + \strippedcsname\firstoftwoarguments + \or + \strippedcsname\secondoftwoarguments + \else + \strippedcsname\gobbletwoarguments + \fi + \or + \ifcase#2\or + \strippedcsname\firstofthreearguments + \or + \strippedcsname\secondofthreearguments + \or + \strippedcsname\thirdofthreearguments + \else + \strippedcsname\gobblethreearguments + \fi + \or + \ifcase#2\or + \strippedcsname\firstoffourarguments + \or + \strippedcsname\secondoffourarguments + \or + \strippedcsname\thirdoffourarguments + \or + \strippedcsname\fourthoffourarguments + \else + \strippedcsname\gobblefourarguments + \fi + \or + \ifcase#2\or + \strippedcsname\firstoffivearguments + \or + \strippedcsname\secondoffivearguments + \or + \strippedcsname\thirdoffivearguments + \or + \strippedcsname\fourthoffivearguments + \or + \strippedcsname\fifthoffivearguments + \else + \strippedcsname\gobblefivearguments + \fi + \fi} + +\def\filterfromvalue#1#2#3% value max n + {\@EA\@EAEAEA\csname % we use the fact that an + \@EA\ifx\csname#1\endcsname\relax % undefined cs has become \relax + \strippedcsname\gobbleoneargument % which we then gobble here + \else + \dofilterfromstr{#2}{#3}% + \fi + \endcsname\csname#1\endcsname} + +\def\filterfromnext#1#2% max n {..}{..}{..}{..} + {\csname\dofilterfromstr{#1}{#2}\endcsname} + +%D \macros +%D {definemeasure} +%D +%D \starttyping +%D \definemeasure[mywidth][\dimexpr(\textwidth-1cm)] +%D +%D ... \measure{mywidth} ... +%D \stoptyping + +\def\??dm{@@dm} % brrr + +\def\definemeasure + {\dodoubleargument\dodefinemeasure} + +\def\dodefinemeasure[#1][#2]% + {\setvalue{\??dm#1}{#2}} + +% #2 could be omitted, but we want to support spaces +% +% \setmeasure {x} {1cm} +% \setmeasure {xx} {1cm} +% \setmeasure {xxx}{1cm} + +\def\setmeasure #1#2{\setvalue{\??dm#1}{#2}} % quick way +\def\setemeasure#1#2{\setevalue{\??dm#1}{#2}} % quick way +\def\setgmeasure#1#2{\setgvalue{\??dm#1}{#2}} % quick way +\def\setxmeasure#1#2{\setxvalue{\??dm#1}{#2}} % quick way + +\def\measure#1% + {\ifcsname\??dm#1\endcsname\csname\??dm#1\endcsname\else\zeropoint\fi} + +%D \macros +%D {doifdimensionelse} +%D +%D This is a dirty one: we simply append a unit and discard it when needed. + +\def\doifdimensionelse#1% + {\afterassignment\dodoifdimensionelse\scratchdimen#1pt\relax} + +\def\dodoifdimensionelse#1% + {\ifx#1\relax + \expandafter\secondoftwoarguments + \else % #1=p ... t\relax + \expandafter\thirdoffourarguments + \fi} + +%D \macros +%D {comparedimension,comparedimensioneps} +%D +%D This is a dirty one: we simply append a unit and discard it when needed. + +\newdimen\roundingeps \roundingeps=10sp + +\def\comparedimension#1#2% + {\chardef\compresult + \ifdim#1<#2% + \zerocount + \else\ifdim#1<#2% + \plusone + \else + \plustwo + \fi\fi} + +\beginETEX + +\def\comparedimensioneps#1#2% + {\chardef\compresult + \ifdim\dimexpr(#1-#2)<\roudingeps + \zerocount + \else\ifdim\dimexpr(#2-#1)<\roudingeps + \zerocount + \else\ifdim#1<#2% + \plusone + \else + \plustwo + \fi\fi\fi} + +\endETEX + +\beginTEX + +\newdimen\comparedimen + +\def\comparedimensioneps#1#2% + {\comparedimen#1\advance\comparedimen-#2\relax + \chardef\compresult + \ifdim\comparedimen<\roudingeps + \zerocount + \else\ifdim-\comparedimen<\roudingeps + \zerocount + \else\ifdim#1<#2% + \plusone + \else + \plustwo + \fi\fi\fi} + +\endTEX + +\protect \endinput diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex deleted file mode 100644 index bd1c02050..000000000 --- a/tex/context/base/syst-ext.tex +++ /dev/null @@ -1,4978 +0,0 @@ -%D \module -%D [ file=syst-ext, -%D version=1995.10.10, -%D title=\CONTEXT\ System Macros, -%D subtitle=Extras, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt System Macros / Extras} - -%D In this second system module, we continue the definition of -%D some handy commands. - -\unprotect - -%D \macros -%D {rawgetparameters} -%D -%D A raw and dirty alternative for \type {\getparameters}; no -%D checking is done! - -% \def\rawgetparameters[#1][#2]% scheelt 5\% -% {\def\rawparameterprefix{#1}% -% \expandafter\rawsetparameter#2,]=,} - -\def\rawsetparameter#1=#2,% - {\if]#1\else - \expandafter\def\csname\rawparameterprefix#1\endcsname{#2}% - \expandafter\rawsetparameter - \fi} - -% the next one handles empty #1 okay: - -\def\rawgetparameters[#1][#2% some 5-10% faster - {\ifx#2]% test is needed, else bomb on [#1][] - \expandafter\gobbleoneargument - \else - \def\rawparameterprefix{#1}% - \expandafter\dorawgetparameters - \fi#2} - -\def\dorawgetparameters#1]% - {\expandafter\rawsetparameter#1,]=,} - -%D \macros -%D {doglobal, -%D redoglobal,dodoglobal,resetglobal} -%D -%D The two macros \type {\redoglobal} and \type{\dodoglobal} are -%D used in this and some other modules to enforce a user -%D specified \type {\doglobal} action. The last and often only -%D global assignment in a macro is done with -%D \type {\dodoglobal}, but all preceding ones with -%D \type {\redoglobal}. When using only alternatives, one can -%D reset this mechanism with \type {\resetglobal}. - -\def\doglobal - {\let\redoglobal\global - \def\dodoglobal{\resetglobal\global}} - -\def\resetglobal - {\let\redoglobal\relax - \let\dodoglobal\relax} - -\resetglobal - -%D New: - -\def\doglobal - {\ifx\redoglobal\relax - \let\redoglobal\global - \let\dodoglobal\@@dodoglobal - %\else - % \writestatus{system}{global not reset, warn me!}% - \fi} - -\def\@@dodoglobal - {\resetglobal\global} - -\def\saveglobal - {\let\@@dodoglobal\dodoglobal - \let\@@redoglobal\redoglobal} - -\def\restoreglobal - {\let\redoglobal\@@redoglobal - \let\dodoglobal\@@dodoglobal} - -%D A very useful application of this macro is \type {\newif}, -%D \TEX's fake boolean type. Not being a primitive, -%D \type {\global} hopelessly fails here. But a slight -%D adaption of Knuth's original macro permits: -%D -%D \starttyping -%D \doglobal\newif\iftest -%D \stoptyping -%D -%D Of course one can still say: -%D -%D \starttyping -%D \global\testtrue -%D \global\testfalse -%D \stoptyping -%D -%D Apart from the prefixes, a few more \type{\expandafters} -%D are needed: - -\def\newif#1% - {\scratchcounter\escapechar - \escapechar\minusone - \expandafter\expandafter\expandafter - \redoglobal\expandafter\expandafter\expandafter - \edef\@if#1{true}{\let\noexpand#1\noexpand\iftrue}% - \expandafter\expandafter\expandafter - \redoglobal\expandafter\expandafter\expandafter - \edef\@if#1{false}{\let\noexpand#1\noexpand\iffalse}% - \dodoglobal\@if#1{false}% - \escapechar\scratchcounter} - -%D Also new: - -\def\define#1% - {\ifx#1\undefined - \expandafter\def - \else - \message{[\noexpand#1is already defined]}% - \expandafter\def\expandafter\gobbleddefinition - \fi#1} - -\def\redefine#1% - {\ifx#1\undefined\else - \message{[\noexpand#1is redefined]}% - \fi - \def#1} - -% \define\hans{hans} -% \redefine\hans{hans} -% \define\hans#1[]#2#3{hans} - -%D The next variant fits nicely in the setups syntax: -%D -%D \starttyping -%D \starttexdefinition bagger [#1] #2 -%D oeps -%D #1 -%D oeps -%D \stoptexdefinition -%D -%D \bagger [a] {b} -%D \stoptyping - -\bgroup \obeylines - -\gdef\starttexdefinition% - {\bgroup% - \obeylines% - \dostarttexdefinition} - -\gdef\dostarttexdefinition #1 #2 - {\catcode13=\@@ignore% - \dodostarttexdefinition{#1}{#2}}% - -\long\gdef\dodostarttexdefinition#1#2#3\stoptexdefinition% - {\egroup% - \long\setvalue{#1}#2{#3}} - -\egroup - -%D \macros -%D {newcounter, -%D increment,decrement} -%D -%D Unfortunately the number of \COUNTERS\ in \TEX\ is limited, -%D but fortunately we can store numbers in a macro. We can -%D increment such pseudo \COUNTERS\ with \type{\increment}. -%D -%D \starttyping -%D \increment(\counter,20) -%D \increment(\counter,-4) -%D \increment(\counter) -%D \increment\counter -%D \stoptyping -%D -%D After this sequence of commands, the value of -%D \type{\counter} is 20, 16, 17 and~18. Of course there is -%D also the complementary command \type{\decrement}. -%D -%D Global assignments are possible too, using \type{\doglobal}: -%D -%D \starttyping -%D \doglobal\increment\counter -%D \stoptyping -%D -%D When \type{\counter} is undefined, it's value is initialized -%D at~0. It is nevertheless better to define a \COUNTER\ -%D explicitly. One reason could be that the \COUNTER\ can be -%D part of a test with \type{\ifnum} and this conditional does -%D not accept undefined macro's. The \COUNTER\ in our example -%D can for instance be defined with: -%D -%D \starttyping -%D \newcounter\counter -%D \stoptyping -%D -%D The command \type{\newcounter} must not be confused with -%D \type{\newcount}! Of course this mechanism is much slower -%D than using \TEX's \COUNTERS\ directly. In practice -%D \COUNTERS\ (and therefore our pseudo counters too) are -%D seldom the bottleneck in the processing of a text. Apart -%D from some other incompatilities we want to mention a pitfal -%D when using \type{\ifnum}. -%D -%D \starttyping -%D \ifnum\normalcounter=\pseudocounter \doif \else \doelse \fi -%D \ifnum\pseudocounter=\normalcounter \doif \else \doelse \fi -%D \stoptyping -%D -%D In the first test, \TEX\ continues it's search for the -%D second number after reading \type{\pseudocounter}, while -%D in the second test, it stops reading after having -%D encountered a real one. Tests like the first one therefore -%D can give unexpected results, for instance execution -%D of \type{\doif} even if both numbers are unequal. - -\def\zerocountervalue{0} - -\def\newcounter#1% - {\dodoglobal\let#1\zerocountervalue} - -% This is the original implementation: -% -% \def\dodododoincrement(#1,#2)% -% {\ifx#1\undefined -% \redoglobal\let#1\zerocountervalue -% \else\ifx#1\relax % \csname...\endcsname -% \redoglobal\let#1\zerocountervalue -% \fi\fi -% \scratchcounter=#2\relax -% \scratchcounter=\incrementsign\scratchcounter -% \advance\scratchcounter #1\relax -% \dodoglobal\edef#1{\the\scratchcounter}} -% -% \def\dododoincrement#1% -% {\dodododoincrement(#1,1)} -% -% \def\dodoincrement(#1% -% {\doifnextcharelse,% -% {\dodododoincrement(#1}{\dodododoincrement(#1,1}} -% -% \def\doincrement#1% -% {\def\incrementsign{#1}% -% \doifnextcharelse(\dodoincrement\dododoincrement} -% -% \def\increment{\doincrement+} -% \def\decrement{\doincrement-} -% -% And this is the one optimized for speed: - -% maxcounter = 2\maxdimen=1 - -\def\!!zerocount {0} % alongside \zerocount -\def\!!minusone {-1} % alongside \minusone -\def\!!plusone {1} % alongside \plusone - -\beginTEX - -\def\dodoindecrement#1(#2,#3)% - {\ifx#2\undefined - \redoglobal\let#2\zerocountervalue - \else\ifx#2\relax % \csname...\endcsname - \redoglobal\let#2\zerocountervalue - \fi\fi - \scratchcounter#3\relax - \scratchcounter#1\scratchcounter - \advance\scratchcounter#2\relax - \dodoglobal\edef#2{\the\scratchcounter}} - -\def\dodoincrement(#1% - {\doifnextcharelse,{\dodoindecrement+(#1}{\dodoindecrement+(#1,1}} - -\def\dododecrement(#1% - {\doifnextcharelse,{\dodoindecrement-(#1}{\dodoindecrement-(#1,1}} - -\def\doincrement#1% 10% faster alternative - {\ifx#1\undefined - \dodoglobal\let#1\!!plusone - \else\ifx#1\relax % \csname...\endcsname - \dodoglobal\let#1\!!plusone - \else - \fastincrement#1% - \fi\fi} - -\def\dodecrement#1% 10% faster alternative - {\ifx#1\undefined - \dodoglobal\let#1\!!minusone - \else\ifx#1\relax % \csname...\endcsname - \dodoglobal\let#1\!!minusone - \else - \fastdecrement#1% - \fi\fi} - -\def\fastdecrement#1% 50% faster alternative - {\scratchcounter#1\advance\scratchcounter\minusone - \dodoglobal\edef#1{\the\scratchcounter}} - -\def\fastincrement#1% 50% faster alternative - {\scratchcounter#1\advance\scratchcounter\plusone - \dodoglobal\edef#1{\the\scratchcounter}} - -\endTEX - -\beginETEX \numexpr - -% \def\doindecrement#1#2% -% {\dodoglobal\edef#2% -% {\the\numexpr(\ifx#2\undefined\else\ifx#2\relax\else#2\fi\fi#11)}} -% -% \def\doincrement{\doindecrement+} -% \def\dodecrement{\doindecrement-} -% -% some 3\% faster: - -\def\doindecrement#1#2% - {\dodoglobal\edef#2% - {\the\numexpr\ifx#2\undefined\else\ifx#2\relax\else#2\fi\fi+#1\relax}} - -\def\doincrement{\doindecrement\plusone } -\def\dodecrement{\doindecrement\minusone} - -\def\dodoindecrement#1#2,#3)% - {\dodoglobal\edef#2% - {\the\numexpr\ifx#2\undefined\else\ifx#2\relax\else#2\fi\fi#1#3\relax}} - -\def\dodoincrement(#1% - {\doifnextcharelse,{\dodoindecrement+#1}{\dodoindecrement+#1,\plusone}} - -\def\dododecrement(#1% - {\doifnextcharelse,{\dodoindecrement-#1}{\dodoindecrement-#1,\plusone}} - -\def\fastincrement#1{\dodoglobal\edef#1{\the\numexpr#1+\plusone \relax}} -\def\fastdecrement#1{\dodoglobal\edef#1{\the\numexpr#1+\minusone\relax}} - -\endETEX - -\def\increment{\doifnextcharelse(\dodoincrement\doincrement} -\def\decrement{\doifnextcharelse(\dododecrement\dodecrement} - -\def\incrementvalue#1{\expandafter\increment\csname#1\endcsname} -\def\decrementvalue#1{\expandafter\decrement\csname#1\endcsname} - -%D \macros -%D {newsignal} -%D -%D When writing advanced macros, we cannot do without -%D signaling. A signal is a small (invisible) kern or penalty -%D that signals the next macro that something just happened. -%D This macro can take any action depending on the previous -%D signal. Signals must be unique and the next macro takes care -%D of that. -%D -%D \starttyping -%D \newsignal\somesignal -%D \stoptyping -%D -%D Signals old dimensions and can be used in skips, kerns and -%D tests like \type{\ifdim}. - -\newdimen\maximumsignal % step is about 0.00025pt - -\def\newsignal#1% - {\ifx#1\undefined - \advance\maximumsignal 2sp % to be save in rounding - \edef#1{\the\maximumsignal}% - \fi} - -%D \macros -%D {newskimen} -%D -%D \TEX\ offers 256 \DIMENSIONS\ and \SKIPS. Unfortunately this -%D amount is too small to suit certain packages. Therefore when -%D possible one should use: -%D -%D \starttyping -%D \newskimen\tempskimen -%D \stoptyping -%D -%D This commands allocates a \DIMENSION\ or a \SKIP, depending -%D on the availability. One should be aware of the difference -%D between both. When searching for some glue \TEX\ goes on -%D searching till it's sure that no other glue component if -%D found. This search can be canceled by using \type{\relax} -%D when possible and needed. -%D -%D \starttyping -%D \def\newskimen#1% -%D {\ifx#1\undefined -%D \ifnum\count11>\count12 -%D \newskip#1\relax -%D \else -%D \newdimen#1\relax -%D \fi -%D \fi} -%D \stoptyping -%D -%D In order to make this macro work in plain \TEX\ too, we -%D use the following alternative, which fools \TEX\ about -%D the new commands being \type {\outer} ones. - -% \def\newskimen#1% -% {\ifx#1\undefined -% \csname new\ifnum\count11>\count12 skip\else dimen\fi\endcsname#1% -% \fi} - -\let\newskimen\newdimen % it's all etex or later now - -%D \macros -%D {strippedcsname} -%D -%D The next macro can be very useful when using \type{\csname} -%D like in: -%D -%D \starttyping -%D \csname if\strippedcsname\something\endcsname -%D \stoptyping -%D -%D This expands to \type{\ifsomething}. -%D -%D \starttyping -%D \def\strippedcsname -%D {\expandafter\gobbleoneargument\string} -%D \stoptyping -%D -%D Slower but better: - -\ifx\letterbackslash\undefined - {\catcode`.=0 .catcode`.\ 12 .xdef.letterbackslash{.string\}} % hack -\fi - -\def\strippedcsname#1% this permits \strippedcsname{\xxx} and \strippedcsname{xxx} - {\expandafter\dostrippedcsname\string#1} - -\def\dostrippedcsname#1% - {\if\noexpand#1\letterbackslash\else#1\fi} - -%D \macros -%D {savenormalmeaning} -%D -%D We will use this one in: - -\def\savenormalmeaning#1% - {\ifundefined{normal\strippedcsname#1}% - \letvalue{normal\strippedcsname#1}#1% - \fi} - -%D \macros -%D {newconditional, -%D settrue, setfalse, -%D ifconditional} -%D -%D \TEX's lacks boolean variables, although the \PLAIN\ format -%D implements \type{\newif}. The main disadvantage of this -%D scheme is that it takes three hash table entries. A more -%D memory saving alternative is presented here. A conditional -%D is defined by: -%D -%D \starttyping -%D \newconditional\doublesided -%D \setfalse -%D \stoptyping -%D Setting a conditional is done by \type{\settrue} and -%D \type{\setfalse}: -%D -%D \starttyping -%D \settrue\doublesided -%D \setfalse -%D \stoptyping -%D while testing is accomplished by: -%D -%D \starttyping -%D \ifconditional\doublesided ... \else ... \fi -%D \setfalse -%D \stoptyping -%D We cannot use the simple scheme: -%D -%D \starttyping -%D \def\settrue#1{\let#1=\iftrue} -%D \def\settrue#1{\let#1=\iffalse} -%D \stoptyping -%D -%D Such an implementation gives problems with nested -%D conditionals. The next implementation is abaou as fast -%D and just as straightforward: - -\def\settrue #1{\chardef#1\zerocount} -\def\setfalse#1{\chardef#1\plusone} - -\let\newconditional = \setfalse -\let\ifconditional = \ifcase - -%D \macros -%D {ifzeropt} -%D -%D The next macro is both cosmetic and byte saving. It is -%D pretty \type{\if}||safe too. It can be used in cases -%D like: -%D -%D \starttyping -%D \ifzeropt \somedimen ... \else ... \fi -%D \stoptyping - -\let\ifzeropt\ifcase - -%D \macros -%D {dorecurse,recurselevel,recursedepth, -%D dostepwiserecurse, -%D for} -%D -%D \TEX\ does not offer us powerfull for||loop mechanisms. On -%D the other hand its recursion engine is quite unique. We -%D therefore identify the for||looping macros by this method. -%D The most simple alternative is the one that only needs a -%D number. -%D -%D \starttyping -%D \dorecurse {n} {whatever we want} -%D \stoptyping -%D -%D This macro can be nested without problems and therefore be -%D used in situations where \PLAIN\ \TEX's \type{\loop} macro -%D ungracefully fails. The current value of the counter is -%D available in \type{\recurselevel}, before as well as after -%D the \typ{whatever we wat} stuff. -%D -%D \starttyping -%D \dorecurse % inner loop -%D {10} -%D {\recurselevel: % outer value -%D \dorecurse % inner loop -%D {\recurselevel} % outer value -%D {\recurselevel} % inner value -%D \dorecurse % inner loop -%D {\recurselevel} % outer value -%D {\recurselevel} % inner value -%D \endgraf} -%D \stoptyping -%D -%D In this example the first, second and fourth -%D \type{\recurselevel} concern the outer loop, while the third -%D and fifth one concern the inner loop. The depth of the -%D nesting is available for inspection in \type{\recursedepth}. -%D -%D Both \type{\recurselevel} and \type{\recursedepth} are -%D macros. The real \COUNTERS\ are hidden from the user because -%D we don't want any interference. - -\newcount\outerrecurse -\newcount\innerrecurse - -\def\recursedepth{\the\outerrecurse} -\def\recurselevel{0} - -\let\nextrecurse\relax - -%D Acceptable: -%D -%D \starttyping -%D \long\def\dostepwiserecurse#1#2#3% -%D {\let\nextrecurse\gobblefourarguments -%D \ifnum#3>0\relax\ifnum#2<#1\relax\else -%D \def\nextrecurse{\dosetstepwiserecurse>}% -%D \fi\fi -%D \ifnum#3<0\relax\ifnum#1<#2\relax\else -%D \def\nextrecurse{\dosetstepwiserecurse<}% -%D \fi\fi -%D \nextrecurse{#1}{#2}{#3}} -%D \stoptyping -%D -%D Better: -%D -%D \starttyping -%D \long\def\dostepwiserecurse#1#2#3% -%D {\let\nextrecurse\gobblefourarguments -%D \ifnum#3>0\relax \ifnum#2<#1\relax \else -%D \def\nextrecurse{\dosetstepwiserecurse>}% -%D \fi \else \ifnum#3<0\relax \ifnum#1<#2\relax \else -%D \def\nextrecurse{\dosetstepwiserecurse<}% -%D \fi \fi \fi -%D \nextrecurse{#1}{#2}{#3}} -%D -%D \def\@@irecurse{@@irecurse} % stepper -%D \def\@@nrecurse{@@nrecurse} % number of steps -%D \def\@@srecurse{@@srecurse} % step -%D \def\@@drecurse{@@drecurse} % direction, < or > -%D \def\@@arecurse{@@arecurse} % action -%D -%D \long\def\dosetstepwiserecurse#1#2#3#4#5% -%D {\global\advance\outerrecurse 1 -%D \setevalue{\@@drecurse\recursedepth}{#1}% -%D \setevalue{\@@irecurse\recursedepth}{\number#2}% -%D \setevalue{\@@nrecurse\recursedepth}{\number#3}% -%D \setevalue{\@@srecurse\recursedepth}{\number#4}% -%D \long\setvalue{\@@arecurse\recursedepth}{#5}% -%D \dodorecurse} -%D -%D \def\donorecurse -%D {} -%D -%D \def\dododorecurse -%D {\edef\recurselevel{\csname\@@irecurse\recursedepth\endcsname}% -%D \getvalue{\@@arecurse\recursedepth}% -%D \edef\recurselevel{\csname\@@irecurse\recursedepth\endcsname}% -%D \innerrecurse\recurselevel -%D \advance\innerrecurse \csname\@@srecurse\recursedepth\endcsname -%D \setevalue{\@@irecurse\recursedepth}{\the\innerrecurse}% -%D \dodorecurse} -%D -%D \def\dodorecurse -%D {\ifnum\csname\@@irecurse\recursedepth\endcsname -%D \csname\@@drecurse\recursedepth\endcsname -%D \csname\@@nrecurse\recursedepth\endcsname\relax -%D \expandafter\nododorecurse -%D \else -%D \expandafter\dododorecurse -%D \fi} -%D -%D \def\nododorecurse -%D {\global\advance\outerrecurse -1 -%D \edef\recurselevel{\csname\@@irecurse\recursedepth\endcsname}} -%D \stoptyping -%D -%D Cleaner and much faster: - -\def\@@irecurse{@@ir@@} % ecurse} % stepper -\def\@@arecurse{@@ar@@} % ecurse} % action - -% \mathchardef - -\long\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4 - {\global\advance\outerrecurse \plusone - \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#4}% - \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel - \ifnum#3>0\relax - \ifnum#2<#1\relax - \let\nextrecurse\exitstepwiserecurse - \else - \let\nextrecurse\dodostepwiserecurse - \fi - \else - \ifnum#3<0\relax - \ifnum#1<#2\relax - \let\nextrecurse\exitstepwiserecurse - \else - \let\nextrecurse\dodostepwisereverse - \fi - \else - \let\nextrecurse\exitstepwiserecurse - \fi - \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}} - -\beginETEX \numexpr - -\long\def\dodostepwiserecurse#1#2#3% from to step - {\ifnum#1>#2\relax - \@EA\nodostepwiserecurse - \else - \def\recurselevel{#1}% - \@EAEAEA\redostepwiserecurse\@EA - \fi\@EA{\the\numexpr\recurselevel+#3\relax}{#2}{#3}} - -\endETEX - -\beginTEX - -\long\def\dodostepwiserecurse#1#2#3% from to step - {\ifnum#1>#2\relax - \@EA\nodostepwiserecurse - \else - \def\recurselevel{#1}% - \innerrecurse#1\advance\innerrecurse#3\relax - \@EAEAEA\redostepwiserecurse\@EA - \fi\@EA{\the\innerrecurse}{#2}{#3}} - -\endTEX - -\def\expandrecursecontent - {\csname\@@arecurse\recursedepth\endcsname} - -\def\redostepwiserecurse - {\expandrecursecontent\dodostepwiserecurse} - -\beginETEX \numexpr - -\long\def\dodostepwisereverse#1#2#3% from to step - {\ifnum#1<#2\relax - \@EA\nodostepwiserecurse - \else - \def\recurselevel{#1}% - \@EAEAEA\redostepwisereverse\@EA - \fi\@EA{\the\numexpr\recurselevel#3\relax}{#2}{#3}} - -\endETEX - -\beginTEX - -\long\def\dodostepwisereverse#1#2#3% from to step - {\ifnum#1<#2\relax - \@EA\nodostepwiserecurse - \else - \def\recurselevel{#1}% - \innerrecurse#1\relax - \advance\innerrecurse#3\relax - \@EAEAEA\redostepwisereverse\@EA - \fi\@EA{\the\innerrecurse}{#2}{#3}} - -\endTEX - -\def\redostepwisereverse - {\expandrecursecontent\dodostepwisereverse} - -\def\exitstepwiserecurse - {\nodostepwiserecurse\relax} - -\def\nodostepwiserecurse#1#2#3#4% - {\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname - \global\advance\outerrecurse \minusone} - -\def\nonostepwiserecurse#1#2#3% - {\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname - \global\advance\outerrecurse \minusone} - -\def\dorecurse#1% - {\dostepwiserecurse1{#1}1} - -%D As we can see here, the simple command \type{\dorecurse} is -%D a special case of the more general: -%D -%D \starttyping -%D \dostepwiserecurse {from} {to} {step} {action} -%D \stoptyping -%D -%D This commands accepts positive and negative steps. Illegal -%D values are handles as good as possible and the macro accepts -%D numbers and \COUNTERS. -%D -%D \starttyping -%D \dostepwiserecurse {1} {10} {2} {...} -%D \dostepwiserecurse {10} {1} {-2} {...} -%D \stoptyping -%D -%D Because the simple case is used often, we implement it -%D more efficiently: - -\long\def\dorecurse#1% - {\ifcase#1\relax - \expandafter\gobbletwoarguments - \or - \expandafter\ydorecurse - \else - \expandafter\xdorecurse - \fi{#1}} - -\long\def\xdorecurse#1#2% - {\global\advance\outerrecurse \plusone - \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#2}% - \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel - \@EA\dodorecurse\@EA1\@EA{\number#1}} - -\long\def\ydorecurse#1#2% - {\global\advance\outerrecurse \plusone - \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel - \let\recurselevel\!!plusone - #2% - \@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname - \global\advance\outerrecurse \minusone} - -\beginETEX \numexpr - -\long\def\dodorecurse#1#2% from to - {\ifnum#1>#2\relax - \@EA\nodorecurse - \else - \def\recurselevel{#1}% - \@EAEAEA\redorecurse - \fi\@EA{\the\numexpr\recurselevel+\plusone\relax}{#2}} - -\endETEX - -\beginTEX - -\long\def\dodorecurse#1#2% from to - {\ifnum#1>#2\relax - \@EA\nodorecurse - \else - \def\recurselevel{#1}% - \innerrecurse#1\advance\innerrecurse\plusone - \@EAEAEA\redorecurse - \fi\@EA{\the\innerrecurse}{#2}} - -\endTEX - -\def\redorecurse - {\expandrecursecontent\dodorecurse} - -\def\nodorecurse#1#2#3% - {\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname - \global\advance\outerrecurse \minusone } - -%D \macros -%D {doloop,exitloop} -%D -%D Sometimes loops are not determined by counters, but by -%D (a combinations of) conditions. We therefore implement a -%D straightforward loop, which can only be left when we -%D explictly exit it. Nesting is supported. First we present -%D a more extensive alternative. -%D -%D \starttyping -%D \doloop -%D {Some kind of typesetting punishment \par -%D \ifnum\pageno>100 \exitloop \fi} -%D \stoptyping -%D -%D When needed, one can call for \type{\looplevel} and -%D \type{\loopdepth}. -%D -%D If we write this macros from scratch, we end up with -%D something like the ones described above: -%D -%D \starttyping -%D \def\@@eloop{@@eloop} % exit -%D \def\@@iloop{@@iloop} % stepper -%D \def\@@aloop{@@aloop} % action -%D -%D \newcount\outerloop -%D -%D \def\loopdepth% -%D {\the\outerloop} -%D -%D \def\exitloop% -%D {\setevalue{\@@eloop\loopdepth}{0}} -%D -%D \long\def\doloop#1% -%D {\global\advance\outerloop by 1 -%D \setevalue{\@@iloop\loopdepth}{1}% -%D \setevalue{\@@eloop\loopdepth}{1}% -%D \long\setvalue{\@@aloop\loopdepth}{#1}% -%D \dodoloop} -%D -%D \def\dodonoloop% -%D {\global\advance\outerloop by -1\relax} -%D -%D \def\dododoloop% -%D {\edef\looplevel{\getvalue{\@@iloop\loopdepth}}% -%D \innerrecurse=\looplevel -%D \advance\innerrecurse by 1 -%D \setevalue{\@@iloop\loopdepth}{\the\innerrecurse}% -%D \getvalue{\@@aloop\loopdepth}% -%D \edef\looplevel{\getvalue{\@@iloop\loopdepth}}% -%D \dodoloop} -%D -%D \def\dodoloop% -%D {\ifnum\getvalue{\@@eloop\loopdepth}=0 -%D \expandafter\dodonoloop -%D \else -%D \expandafter\dododoloop -%D \fi} -%D -%D \def\doloop% -%D {\dostepwiserecurse{1}{\maxdimen}{1}} -%D -%D \def\exitloop -%D {\setvalue{\@@irecurse\recursedepth}{\maxdimen}} -%D -%D \def\looplevel{\recurselevel} -%D \def\loopdepth{\recursedepth} -%D \stoptyping -%D -%D We don't have to declare new counters for \type{\looplevel} -%D and \type{\loopdepth} because we can use \type{\recurselevel} -%D and \type{\recursedepth}. -%D -%D We prefer however a more byte saving implementation, that -%D executes of course a bit slower. -%D -%D \starttyping -%D \def\doloop% -%D {\dostepwiserecurse1\maxdimen1} -%D -%D \def\exitloop% -%D {\letvalue{\@@irecurse\recursedepth}\maxdimen} -%D \stoptyping -%D -%D Although, the next version is faster because it used the -%D simple loop. - -\let\endofloop\donothing - -\long\def\doloop#1% - {\global\advance\outerrecurse \plusone - \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#1}% - \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel - \let\endofloop\dodoloop - \dodoloop1} % no \plusone else \recurselevel wrong - -\beginETEX \numexpr - -\long\def\dodoloop#1% - {\def\recurselevel{#1}% - \@EA\redoloop\@EA{\the\numexpr\recurselevel+\plusone\relax}} - -\endETEX - -\beginTEX - -\long\def\dodoloop#1% - {\def\recurselevel{#1}% - \innerrecurse#1\advance\innerrecurse\plusone - \@EA\redoloop\@EA{\the\innerrecurse}} - -\endTEX - -\def\redoloop - {\expandrecursecontent\endofloop} - -\def\nodoloop#1% - {\let\endofloop\dodoloop % new, permits nested \doloop's - \@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname - \global\advance\outerrecurse\minusone} - -\def\exitloop % \exitloop quits at end - {\let\endofloop\nodoloop} - -\long\def\exitloopnow#1\endofloop % \exitloopnow quits directly - {\nodoloop} - -%D The loop is executed at least once, so beware of situations -%D like: -%D -%D \starttyping -%D \doloop {\exitloop some commands} -%D \stoptyping -%D -%D It's just a matter of putting the text into the \type{\if} -%D statement that should be there anyway, like in: -%D -%D \starttyping -%D \doloop {\ifwhatever \exitloop \else some commands\fi} -%D \stoptyping -%D -%D You can also quit a loop immediately, by using \type -%D {\exitloopnow} instead. Beware, this is more sensitive -%D for conditional errors. - -%D Krzysztof Leszczynski suggested to provide access to the level by -%D means of a \type {#1}. I decided to pass the more frquently used -%D level as \type {#1} and the less favoured depth as \type {#2}. The -%D intended usage is: -%D -%D \starttyping -%D \dorecurse{3}{\definesymbol[test-#1][xx-#1]} -%D -%D \def\test{\dorecurse{3}{\definesymbol[test-##1][xx-##1]}} \test -%D -%D \symbol[test-1]\quad\symbol[test-2]\quad\symbol[test-3] -%D \stoptyping -%D -%D Since the hashed arguments are expanded, we don't need tricky -%D expansion here. -%D -%D \starttyping -%D \dorecurse{3}{\expanded{\definesymbol[test-\recurselevel][xx-\recurselevel]}} -%D \stoptyping - -\def\expandrecursecontent - {\csname\@@arecurse\recursedepth\@EA\@EA\@EA\endcsname\@EA\@EA\@EA{\@EA\recurselevel\@EA}\@EA{\recursedepth}} - -\long\def\xdorecurse#1#2% - {\global\advance\outerrecurse \plusone - \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#2}% - \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel - \@EA\dodorecurse\@EA1\@EA{\number#1}} - -\long\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4 - {\global\advance\outerrecurse \plusone - \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#4}% - \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel - \ifnum#3>0\relax - \ifnum#2<#1\relax - \let\nextrecurse\exitstepwiserecurse - \else - \let\nextrecurse\dodostepwiserecurse - \fi - \else - \ifnum#3<0\relax - \ifnum#1<#2\relax - \let\nextrecurse\exitstepwiserecurse - \else - \let\nextrecurse\dodostepwisereverse - \fi - \else - \let\nextrecurse\exitstepwiserecurse - \fi - \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}} - -\long\def\doloop#1% - {\global\advance\outerrecurse \plusone - \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#1}% - \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel - \let\endofloop\dodoloop - \dodoloop1} % no \plusone else \recurselevel wrong - -%D For special purposes: - -\newcount\fastrecursecounter -\newcount\lastrecursecounter -\newcount\steprecursecounter - -\def\dofastrecurse#1#2#3#4% - {\def\fastrecursebody{#4}% - \fastrecursecounter#1\relax - \lastrecursecounter#2\relax - \steprecursecounter#3\relax - \def\recurselevel{\number\fastrecursecounter}% - \dodofastrecurse} - -\def\dodofastrecurse - {\ifnum\fastrecursecounter>\lastrecursecounter\else - \fastrecursebody - \advance\fastrecursecounter\steprecursecounter - \expandafter\dodofastrecurse - \fi} - -%D This alternative looks a bit different and uses a -%D pseudo counter. When this macro is nested, we have to use -%D different counters. This time we use keywords. -%D -%D \starttyping -%D \def\alfa{2} \def\beta{100} \def\gamma{3} -%D -%D \for \n=55 \to 100 \step 1 \do {... \n ...} -%D \for \n=\alfa \to \beta \step \gamma \do {... \n ...} -%D \for \n=\n \to 120 \step 1 \do {... \n ...} -%D \for \n=120 \to 100 \step -3 \do {... \n ...} -%D \for \n=55 \to 100 \step 2 \do {... \n ...} -%D \stoptyping -%D -%D Only in the third example we need to predefine \type{\n}. -%D The use of \type{\od} as a dilimiter would have made nested -%D use more problematic. - -%D Don't use this one, it's kind of obsolete. - -\def\for#1=#2\to#3\step#4\do#5% - {\dostepwiserecurse{#2}{#3}{#4} - {\let#1\recurselevel#5\let#1\recurselevel}} - -%D \macros -%D {newevery,everyline,EveryLine,EveryPar} -%D -%D Lets skip to something quite different. It's common use -%D to use \type{\everypar} for special purposes. In \CONTEXT\ -%D we use this primitive for locating sidefloats. This means -%D that when user assignments to \type{\everypar} can interfere -%D with those of the package. We therefore introduce -%D \type{\EveryPar}. -%D -%D The same goes for \type{\EveryLine}. Because \TEX\ offers -%D no \type{\everyline} primitive, we have to call for -%D \type{\everyline} when we are working on a line by line -%D basis. Just by calling \type{\EveryPar{}} and -%D \type{\EveryLine{}} we restore the old situation. -%D -%D The definition command \type{\DoWithEvery} will be quite -%D unreadable, so let's first show an implementation that -%D shows how things are done: -%D -%D \starttyping -%D \newtoks \everyline -%D \newtoks \oldeveryline -%D \newif \ifeveryline -%D -%D \def\DoWithEvery#1#2#3#4% -%D {#3\else\edef\next{\noexpand#2={\the#1}}\next\fi -%D \edef\next{\noexpand#1={\the#2\the\scratchtoks}}\next -%D #4} -%D -%D \def\doEveryLine% -%D {\DoWithEvery\everyline\oldeveryline\ifeveryline\everylinetrue} -%D -%D \def\EveryLine% -%D {\afterassignment\doEveryLine\scratchtoks} -%D \stoptyping -%D -%D The real implementation is a bit more complicated but we -%D prefer something more versatile. - -% the old one -% -% \def\DoWithEvery#1% -% {\csname if\strippedcsname#1\endcsname \else -% \edef\next% -% {\@EA\noexpand\csname old\strippedcsname#1\endcsname= -% {\the#1}}% -% \next -% \fi -% \edef\next% -% {\noexpand#1= -% {\@EA\the\csname old\strippedcsname#1\endcsname\the\scratchtoks}}% -% \next -% \csname\strippedcsname#1true\endcsname} -% -% \def\dowithevery#1% -% {\@EA\afterassignment\csname do\strippedcsname#1\endcsname\scratchtoks} -% -% \def\newevery#1#2% -% {\ifx#1\undefined\newtoks#1\fi -% \ifx#2\relax\else\ifx#2\undefined -% \@EA\newtoks\csname old\strippedcsname#1\endcsname -% \@EA\newif \csname if\strippedcsname#1\endcsname -% \@EA\def \csname do\strippedcsname#2\endcsname{\DoWithEvery#1}% -% \def#2{\dowithevery#2}% -% \fi\fi} -% -% cleaner and more efficient - -%\def\dowithevery#1% -% {\def\dodowithevery% -% {\ifcase\csname c\strippedcsname#1\endcsname \expandafter\chardef -% \csname c\strippedcsname#1\endcsname=1 -% \csname t\strippedcsname#1\endcsname=#1% -% \fi -% \edef\next% -% {#1={\the\csname t\strippedcsname#1\endcsname\the\scratchtoks}}% -% \next}% -% \afterassignment\dodowithevery\scratchtoks} -% -% more efficient: - -\def\dodowithevery#1% - {\ifcase\csname c\strippedcsname#1\endcsname \expandafter\chardef - \csname c\strippedcsname#1\endcsname1 - \csname t\strippedcsname#1\endcsname#1% - \fi - \edef\next% - {#1{\the\csname t\strippedcsname#1\endcsname\the\scratchtoks}}% - \next} - -\def\dowithevery#1% - {\def\next{\dodowithevery#1}% - \afterassignment\next\scratchtoks} - -\bgroup \let\newtoks\relax % plain safe (\outer) - -\gdef\newevery#1#2% - {\ifx#1\undefined\csname newtoks\endcsname#1\fi % plain safe (\outer) - \ifx#2\relax\else\ifx#2\undefined - \expandafter\newtoks\csname t\strippedcsname#1\endcsname - \expandafter\chardef\csname c\strippedcsname#1\endcsname\zerocount - \def#2{\dowithevery#1}% - \fi\fi} - -\egroup - -%D The first \type {\outer} hack is needed to trick \TEX\ -%D into thinking that \type {\newtoks} is no outer macro, -%D the second hack is needed due to some funny interaction -%D between outer macros and \type {\if} at expansion time. - -%D This one permits definitions like: - -\newevery \everypar \EveryPar -\newevery \everyline \EveryLine - -%D and how about: - -\newevery \neverypar \NeveryPar - -%D Which we're going to use indeed! When the second argument -%D equals \type {\relax}, the first token list is created -%D unless it is already defined. - -%D Technically spoken we could have used the method we are -%D going to present in the visual debugger. First we save -%D the primitive \type{\everypar}: -%D -%D \starttyping -%D \let\normaleverypar=\everypar -%D \stoptyping -%D -%D Next we allocate a \TOKENLIST\ named \type{\everypar}, -%D which means that \type{\everypar} is no longer a primitive -%D but something like \type{\toks44}. -%D -%D \starttyping -%D \newtoks\everypar -%D \stoptyping -%D -%D Because \TEX\ now executes \type{\normaleverypar} instead -%D of \type{\everypar}, we are ready to assign some tokens to -%D this internally known and used \TOKENLIST. -%D -%D \starttyping -%D \normaleverypar={all the things the system wants to do \the\everypar} -%D \stoptyping -%D -%D Where the user can provide his own tokens to be expanded -%D every time he expects them to expand. -%D -%D \starttyping -%D \everypar={something the user wants to do} -%D \stoptyping -%D -%D We don't use this method because it undoubtly leads to -%D confusing situations, especially when other packages are -%D used, but it's this kind of tricks that make \TEX\ so -%D powerful. - -%D \macros -%D {convertargument,convertcommand,convertvalue} -%D -%D Some persistent experimenting led us to the next macro. This -%D macro converts a parameter or an expanded macro to it's -%D textual meaning. -%D -%D \starttyping -%D \convertargument ... \to \command -%D \stoptyping -%D -%D For example, -%D -%D \starttyping -%D \convertargument{one \two \three{four}}\to\ascii -%D \stoptyping -%D -%D The resulting macro \type{\ascii} can be written to a file -%D or the terminal without problems. In \CONTEXT\ we use this -%D macro for generating registers and tables of contents. -%D -%D The second conversion alternative accepts a command: -%D -%D \starttyping -%D \convertcommand\command\to\ascii -%D \stoptyping -%D -%D Both commands accept the prefix \type{\doglobal} for global -%D assignments. - -\beginTEX - -\def\doconvertargument#1>{} - -\def\convertedcommand - {\expandafter\doconvertargument\meaning} - -\long\def\convertargument#1\to#2% - {\long\def#2{#1}% saves a restore - \dodoglobal\edef#2{\convertedcommand#2}} - -\long\def\convertcommand#1\to#2% - {\dodoglobal\edef#2{\convertedcommand#1}} - -% no dodoglobal ! - -\long\def\defconvertedargument#1#2% less sensitive for \to - {\long\def#1{#2}% saves a restore - \edef#1{\convertedcommand#1}} - -\long\def\defconvertedcommand#1#2% less sensitive for \to - {\edef#1{\convertedcommand#2}} - -\long\def\gdefconvertedargument#1#2% less sensitive for \to - {\long\gdef#1{#2}% saves a restore - \xdef#1{\convertedcommand#1}} - -\long\def\gdefconvertedcommand#1#2% less sensitive for \to - {\xdef#1{\convertedcommand#2}} - -\endTEX - -\def\convertvalue#1\to - {\expandafter\convertcommand\csname#1\endcsname\to} - -\def\defconvertedvalue#1#2% less sensitive for \to - {\@EA\defconvertedcommand\@EA#1\csname#2\endcsname} - -%D \macros -%D {doifassignmentelse} -%D -%D A lot of \CONTEXT\ commands take optional arguments, for -%D instance: -%D -%D \starttyping -%D \dothisorthat[alfa,beta] -%D \dothisorthat[first=foo,second=bar] -%D \dothisorthat[alfa,beta][first=foo,second=bar] -%D \stoptyping -%D -%D Although a combined solution is possible, we prefer a -%D seperation. The next command takes care of propper -%D handling of such multi||faced commands. -%D -%D \starttyping -%D \doifassignmentelse {...} {then ...} {else ...} -%D \stoptyping - -% not robust -% -% \def\doifassignmentelse% -% {\doifinstringelse{=}} -% -% readable -% -% \def\doifassignmentelse#1% -% {\convertargument#1\to\ascii -% \doifinstringelse{=}{\ascii}} - -\def\doifassignmentelse#1% - {\convertargument#1\to\ascii - \doifinstringelse=\ascii} - -%D \macros -%D {convertasciiafter} -%D -%D Sometimes we need to convert an argument to a string (letters -%D only), for instance when we compare it with another string: -%D -%D \starttyping -%D \convertasciiafter\doifinstringelse{em}{\ascii}{...} -%D \stoptyping - -\def\convertasciiafter#1#2% - {\convertargument#2\to\asciiafter - \@EA#1\@EA{\asciiafter}} - -%D In \ETEX\ we can use \type {\detokenize} and gain some -%D speed, but in general far less that 1\% for \type -%D {\convertargument} and nil for \type {\convertcommand}. -%D This macro is more robust than the pure \TEX\ one, -%D something I found out when primitives like \type -%D {\jobname} were fed (or something undefined). - -% command variant: one level expansion ! - -\beginETEX \detokenize - -\long\def\convertargument#1\to#2{\dodoglobal\edef#2{\detokenize{#1}}} -\long\def\convertcommand #1\to#2{\dodoglobal\edef#2{\@EA\detokenize\@EA{#1}}} % hm, only second is also ok - -\long\def\defconvertedargument #1#2{\edef#1{\detokenize {#2}}} -\long\def\defconvertedcommand #1#2{\edef#1{\detokenize\@EA{#2}}} -\long\def\edefconvertedargument#1#2{\edef#1{#2}% - \edef#1{\detokenize\@EA{#1}}} -\long\def\gdefconvertedargument#1#2{\xdef#1{\detokenize {#2}}} -\long\def\gdefconvertedcommand #1#2{\xdef#1{\detokenize\@EA{#2}}} -\long\def\xdefconvertedargument#1#2{\xdef#1{#2}% - \xdef#1{\detokenize\@EA{#1}}} - -\endETEX - -%D When you try to convert a primitive command, you'll find -%D out that the \ETEX\ method fails on for instance \type -%D {\jobname} in the sense that it returns the filename -%D instead of just \type {\jobname}. So far this does not -%D give real problems. - -%D This is typically a macro that one comes to after reading -%D the \TEX book carefully. Even then, the definite solution -%D was found after rereading the \TEX book. The first -%D implementation was: -%D -%D \starttyping -%D \def\doconvertargument#1->#2\\\\{#2} -%D \stoptyping -%D -%D The \type{-}, the delimiter \type{\\\\} and the the second -%D argument are completely redundant. - -%D \macros -%D {showvalue,showargument} -%D -%D Two handy macros for testing purposes only: - -\def\showvalue#1% - {\expandafter\show\csname#1\endcsname} - -\beginETEX - -\def\showvalue#1% - {\ifcsname#1\endcsname - \expandafter\show\csname#1\endcsname - \else - \show\undefined - \fi} - -\endETEX - -\long\def\showargument#1% - {\defconvertedargument\ascii{#1}\ascii} - -%D \macros -%D {doifmeaningelse} -%D -%D We can use both commands in testing, but alas, not all -%D meanings expand to something \type {->}. This is no problem -%D in the \ETEX\ implementation, but since we want -%D compatibility, we need: -%D -%D \starttyping -%D \doifmeaningelse {\next} {\something} {true} {false} -%D \stoptyping -%D -%D Watch the one level expansion of the second argument. - -\def\doifmeaningelse#1#2% - {\edef\!!stringa{\meaning#1}% - \def\!!stringb{#2}\edef\!!stringb{\meaning\!!stringb}% - \ifx\!!stringa\!!stringb - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -%D \macros -%D {doifsamestringselse,doifsamestring,doifnotsamestring} -%D -%D The next comparison macro converts the arguments into -%D expanded strings. This command can be used to compare for -%D instance \type {\jobname} with a name stored in a macro. - -\def\@@doifsamestringelse#1#2% - {\edef\!!stringa{#1}% - \edef\!!stringb{#2}% - \convertcommand\!!stringa\to\!!stringa - \convertcommand\!!stringb\to\!!stringb - \ifx\!!stringa\!!stringb} - -\def\doifsamestringelse#1#2% - {\@@doifsamestringelse{#1}{#2}% - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\def\doifsamestring#1#2% - {\@@doifsamestringelse{#1}{#2}% - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\def\doifnotsamestring#1#2% - {\@@doifsamestringelse{#1}{#2}% - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -%D \macros -%D {ExpandFirstAfter,ExpandSecondAfter,ExpandBothAfter} -%D -%D These three commands support expansion of arguments before -%D executing the commands that uses them. We can best -%D illustrate this with an example. -%D -%D \starttyping -%D \def\first {alfa,beta,gamma} -%D \def\second {alfa,epsilon,zeta} -%D -%D \ExpandFirstAfter \doifcommon {\first} {alfa} {\message{OK}} -%D \ExpandSecondAfter \doifcommon {alfa} {\second} {\message{OK}} -%D \ExpandBothAfter \doifcommon {\first} {\second} {\message{OK}} -%D -%D \ExpandFirstAfter\processcommalist[\first]\message -%D -%D \ExpandAfter \doifcommon {\first} {alfa} {\message{OK}} -%D \stoptyping -%D -%D The first three calls result in the threefold message -%D \type{OK}, the fourth one shows the three elements of -%D \type{\first}. The command \type{\ExpandFirstAfter} takes -%D care of (first) arguments that are delimited by \type{[ ]}, -%D but the faster \type{\ExpandAfter} does not. - -\def\simpleExpandFirstAfter#1% - {\long\xdef\@@expanded{\noexpand\ExpandCommand{#1}}\@@expanded} - -\def\complexExpandFirstAfter[#1]% - {\long\xdef\@@expanded{\noexpand\ExpandCommand[#1]}\@@expanded} - -\def\ExpandFirstAfter#1% - {\let\ExpandCommand#1% - \doifnextoptionalelse\complexExpandFirstAfter\simpleExpandFirstAfter} - -\def\ExpandSecondAfter#1#2#3% - {\scratchtoks{#2}% - \long\xdef\@@expanded{\noexpand#1{\the\scratchtoks}{#3}}\@@expanded} - -\def\ExpandBothAfter#1#2#3% - {\long\xdef\@@expanded{\noexpand#1{#2}{#3}}\@@expanded} - -\def\ExpandAfter#1#2% - {\long\xdef\@@expanded{\noexpand#1{#2}}\@@expanded} - -%D Now we can for instance define \type{\ifinstringelse} as: - -\def\ifinstringelse - {\ExpandBothAfter\p!doifinstringelse} - -%D \macros -%D {ConvertToConstant,ConvertConstantAfter} -%D -%D When comparing arguments with a constant, we can get into -%D trouble when this argument consists of tricky expandable -%D commands. One solution for this is converting the -%D argument to a string of unexpandable characters. To make -%D comparison possible, we have to convert the constant too -%D -%D \starttyping -%D \ConvertToConstant\doifelse {...} {...} {then ...} {else ...} -%D \stoptyping -%D -%D This construction is only needed when the first argument -%D can give troubles. Misuse can slow down processing. -%D -%D \starttyping -%D \ConvertToConstant\doifelse{\c!alfa} {\c!alfa}{...}{...} -%D \ConvertToConstant\doifelse{alfa} {\c!alfa}{...}{...} -%D \ConvertToConstant\doifelse{alfa} {alfa} {...}{...} -%D \ConvertToConstant\doifelse{alfa \alfa test}{\c!alfa}{...}{...} -%D \stoptyping -%D -%D In examples~2 and~3 both arguments equal, in~1 and~4 -%D they differ. - -\beginTEX - -\long\def\ConvertToConstant#1#2#3% - {\expandafter\defconvertedargument\expandafter\!!stringa\expandafter{#2}% - \expandafter\defconvertedargument\expandafter\!!stringb\expandafter{#3}% - #1{\!!stringa}{\!!stringb}} - -\endTEX - -\beginETEX \detokenize - -\long\def\ConvertToConstant#1#2#3% - {\edef\!!stringa{\expandafter\detokenize\expandafter{#2}}% - \edef\!!stringb{\expandafter\detokenize\expandafter{#3}}% - #1{\!!stringa}{\!!stringb}} - -\endETEX - -%D When the argument \type{#1} consists of commands, we had -%D better use -%D -%D \starttyping -%D \ConvertConstantAfter\processaction[#1][...] -%D \ConvertConstantAfter\doifelse{#1}{\v!something}{}{} -%D \stoptyping -%D -%D This commands accepts things like: -%D -%D \starttyping -%D \v!constant -%D constant -%D \hbox to \hsize{\rubish} -%D \stoptyping -%D -%D As we will see in the core modules, this macro permits -%D constructions like: -%D -%D \starttyping -%D \setupfootertexts[...][...] -%D \setupfootertexts[margin][...][...] -%D \setupfootertexts[\v!margin][...][...] -%D \stoptyping -%D -%D where \type{...} can be anything legally \TEX. - -\def\CheckConstantAfter#1#2% - {\@EA\convertargument\v!prefix!\to\ascii - \convertargument#1\to#2\relax - \doifinstringelse\ascii{#2} - {\expandafter\convertargument#1\to#2} - {}} - -\def\ConvertConstantAfter#1#2#3% - {\CheckConstantAfter{#2}\asciia - \CheckConstantAfter{#3}\asciib - #1{\asciia}{\asciib}} - -%D \macros -%D {assignifempty} -%D -%D We can assign a default value to an empty macro using: -%D -%D \starttyping -%D \assignifempty \macros {default value} -%D \stoptyping -%D -%D We don't explicitly test if the macro is defined. - -\def\assignifempty#1#2% can be sped up - {\doifsomething{#1}{\def#1{#2}}} % {\doifnot{#1}{}{\def#1{#2}}} - -%D \macros -%D {gobbleuntil,grabuntil,gobbleuntilrelax, -%D processbetween,processuntil} -%D -%D In \TEX\ gobbling usually stand for skipping arguments, so -%D here are our gobbling macros. -%D -%D In \CONTEXT\ we use a lot of \type{\start}||\type{\stop} -%D like constructions. Sometimes, the \type{\stop} is used as a -%D hard coded delimiter like in: -%D -%D \starttyping -%D \def\startcommand#1\stopcommand% -%D {... #1 ...} -%D \stoptyping -%D -%D In many cases the \type{\start}||\type{\stop} pair is -%D defined at format generation time or during a job. This -%D means that we cannot hardcode the \type{\stop} criterium. -%D Only after completely understanding \type{\csname} and -%D \type{\expandafter} I was able to to implement a solution, -%D starting with: -%D -%D \starttyping -%D \grabuntil{stop}\command -%D \stoptyping -%D -%D This commands executes, after having encountered -%D \type {\stop} the command \type {\command}. This command -%D receives as argument the text preceding the \type {\stop}. -%D This means that: -%D -%D \starttyping -%D \def\starthello% -%D {\grabuntil{stophello}\message} -%D -%D \starthello Hello world!\stophello -%D \stoptyping -%D -%D results in: \type{\message{Hello world!}}. - -\def\dograbuntil#1#2% - {\long\def\next##1#1{#2{##1}}\next} - -\def\grabuntil#1% - {\expandafter\dograbuntil\expandafter{\csname#1\endcsname}} - -%D The next command build on this mechanism: -%D -%D \starttyping -%D \processbetween{string}\command -%D \stoptyping -%D -%D Here: -%D -%D \starttyping -%D \processbetween{hello}\message -%D \starthello Hello again!\stophello -%D \stoptyping -%D -%D leads to: \type{\message{Hello again!}}. The command -%D -%D \starttyping -%D \gobbleuntil{sequence} -%D \stoptyping -%D -%D is related to these commands. This one simply throws away -%D everything preceding \type{\command}. - -\long\def\processbetween#1#2% - {\setvalue{\s!start#1}{\grabuntil{\s!stop#1}{#2}}} - -\def\gobbleuntil#1% - {\long\def\next##1#1{}\next} - -\def\gobbleuntilrelax#1\relax - {} - -%D The next one simply expands the pickup up tokens. -%D -%D \starttyping -%D \processuntil{sequence} -%D \stoptyping - -\def\processuntil#1% - {\long\def\next##1#1{##1}\next} - -%D \macros -%D {groupedcommand} -%D -%D Commands often manipulate argument as in: -%D -%D \starttyping -%D \def\doezomaarwat#1{....#1....} -%D \stoptyping -%D -%D A disadvantage of this approach is that the tokens that -%D form \type{#1} are fixed the the moment the argument is read -%D in. Normally this is no problem, but for instance verbatim -%D environments adapt the \CATCODES\ of characters and therefore -%D are not always happy with already fixed tokens. -%D -%D Another problem arises when the argument is grouped not by -%D \type{{}} but by \type{\bgroup} and \type{\egroup}. Such an -%D argument fails, because the \type{\bgroup} is een as the -%D argument (which is quite normal). -%D -%D The next macro offers a solution for both unwanted -%D situations: -%D -%D \starttyping -%D \groupedcommand {before} {after} -%D \stoptyping -%D -%D Which can be used like: -%D -%D \starttyping -%D \def\cite% -%D {\groupedcommand{\rightquote\rightquote}{\leftquote\leftquote}} -%D \stoptyping -%D -%D This command is equivalent to, but more 'robust' than: -%D -%D \starttyping -%D \def\cite#1% -%D {\rightquote\rightquote#1\leftquote\leftquote} -%D \stoptyping -%D -%D One should say that the next implementation would suffice: -%D -%D \starttyping -%D \def\groupedcommand#1#2% -%D {\def\BeforeGroup{#1\ignorespaces}% -%D \def\AfterGroup{\unskip#2\egroup}% -%D \bgroup\bgroup -%D \aftergroup\AfterGroup -%D \afterassignment\BeforeGroup -%D \let\next=} -%D \stoptyping -%D -%D It did indeed, but one day we decided to support the -%D processing of boxes too: -%D -%D \starttyping -%D \def\rightword% -%D {\groupedcommand{\hfill\hbox}{\parfillskip\!!zeropoint}} -%D -%D .......... \rightword{the right way} -%D \stoptyping -%D -%D Here \TEX\ typesets \type{\bf the right way} unbreakable -%D at the end of the line. The solution mentioned before does -%D not work here. -%D -%D \starttyping -%D \long\unexpanded\def\groupedcommand#1#2% -%D {\bgroup -%D \long\def\BeforeGroup% -%D {\bgroup#1\bgroup\aftergroup\AfterGroup}% -%D \long\def\AfterGroup% -%D {#2\egroup\egroup}% -%D \afterassignment\BeforeGroup -%D \let\next=} -%D \stoptyping -%D -%D We used this method some time until the next alternative -%D was needed. From now on we support both -%D -%D \starttyping -%D to be \bold{bold} or not, that's the question -%D \stoptyping -%D -%D and -%D -%D \starttyping -%D to be {\bold bold} or not, that's the question -%D \stoptyping -%D -%D This alternative checks for a \type{\bgroup} token first. -%D The internal alternative does not accept the box handling -%D mentioned before, but further nesting works all right. The -%D extra \type{\bgroup}||\type{\egroup} is needed to keep -%D \type{\AfterGroup} both into sight and local. - -\long\def\HandleGroup#1#2% - {\bgroup - \long\def\BeforeGroup{\bgroup#1\bgroup\aftergroup\AfterGroup}% - \long\def\AfterGroup {#2\egroup\egroup}% - \afterassignment\BeforeGroup - \let\next=} - -\long\def\HandleSimpleGroup#1#2% no inner group (so no kerning interference) - {\bgroup - %long\def\BeforeGroup{\bgroup#1\aftergroup\AfterGroup}% interferes - \long\def\BeforeGroup{\bgroup\aftergroup\AfterGroup#1}% - \long\def\AfterGroup {#2\egroup}% - \afterassignment\BeforeGroup - \let\next=} - -\long\def\HandleNoGroup#1#2% - {\long\def\AfterGroup{#2\egroup}% - \bgroup\aftergroup\AfterGroup#1} - -%D These macros come together in: -%D -%D \starttyping -%D \long\unexpanded\def\groupedcommand#1#2% -%D {\def\dogroupedcommand% -%D {\ifx\next\bgroup -%D \let\next=\HandleGroup -%D \else -%D \let\next=\HandleNoGroup -%D \fi -%D \next{#1}{#2}}% -%D \futurelet\next\dogroupedcommand} -%D \stoptyping -%D -%D From the missing paragraph number one can deduce that the -%D last macro is not the real one yet. I considered it a -%D nuisance that -%D -%D \starttyping -%D \color[green] -%D {as grass} -%D \stoptyping -%D -%D was not interpreted as one would expect. This is due to the -%D fact that \type{\futurelet} obeys blank spaces, and a -%D line||ending token is treated as a blank space. So the final -%D implementation became: - -%\long\unexpanded\def\groupedcommand#1#2% -% {\bgroup -% \def\dogroupedcommand% -% {\ifx\next\bgroup -% \def\\{\egroup\HandleGroup{#1}{#2}}% -% \else\ifx\next\blankspace -% \def\\ {\egroup\groupedcommand{#1}{#2}}% -% \else -% \def\\{\egroup\HandleNoGroup{#1}{#2}}% -% \fi\fi -% \\}% -% \futurelet\next\dogroupedcommand} -% -% compatible ? - -\long\unexpanded\def\groupedcommand#1#2% - {\doifnextbgroupelse{\HandleGroup{#1}{#2}}{\HandleNoGroup{#1}{#2}}} - -\long\unexpanded\def\simplegroupedcommand#1#2% - {\doifnextbgroupelse{\HandleSimpleGroup{#1}{#2}}{\HandleNoGroup{#1}{#2}}} - -%D Users should be aware of the fact that grouping can -%D interfere with ones paragraph settings that are executed -%D after the paragraph is closed. One should therefore -%D explictly close the paragraph with \type{\par}, else the -%D settings will be forgotten and not applied. So it's: -%D -%D \starttyping -%D \def\BoldRaggedCenter% -%D {\groupedcommand{\raggedcenter\bf}{\par}} -%D \stoptyping - -%D \macros -%D {checkdefined} -%D -%D The bigger the system, the greater the change that -%D user defined commands collide with those that are part of -%D the system. The next macro gives a warning when a command is -%D already defined. We considered blocking the definition, but -%D this is not always what we want. -%D -%D \starttyping -%D \checkdefined {category} {class} {command} -%D \stoptyping -%D -%D The user is warned with the suggestion to use -%D \type{CAPITALS}. This suggestion is feasible, because -%D \CONTEXT only defines lowcased macros. - -\def\showdefinederror#1#2% - {\writestatus\m!systems{#1 #2 replaces a macro, use CAPITALS!}} - -\def\checkdefined#1#2#3% - {\doifdefined{#3}{\showdefinederror{#2}{#3}}} - -%D \macros -%D {GotoPar,GetPar} -%D -%D Typesetting a paragraph in a special way can be done by -%D first grabbing the contents of the paragraph and processing -%D this contents grouped. The next macro for instance typesets -%D a paragraph in boldface. -%D -%D \starttyping -%D \def\remark#1\par% -%D {\bgroup\bf#1\egroup} -%D \stoptyping -%D -%D This macro has to be called like -%D -%D \starttyping -%D \remark some text ... ending with \par -%D \stoptyping -%D -%D Instead of \type{\par} we can of course use an empty line. -%D When we started typesetting with \TEX, we already had -%D produced lots of text in plain \ASCII. In producing such -%D simple formatted texts, we adopted an open layout, and when -%D switching to \TEX, we continued this open habit. Although -%D \TEX\ permits a cramped and badly formatted source, it adds -%D to confusion and sometimes introduces errors. So we prefer: -%D -%D \starttyping -%D \remark -%D -%D some text ... ending with an empty line -%D \stoptyping -%D -%D We are going to implement a mechanism that allows such open -%D specifications. The definition of the macro handling -%D \type{\remark} becomes: -%D -%D \starttyping -%D \def\remark% -%D {\BeforePar{\bgroup\bf}% -%D \AfterPar{\egroup}% -%D \GetPar} -%D \stoptyping -%D -%D A macro like \type{\GetPar} can be defined in several -%D ways. The recent version, the fourth one in a row, -%D originally was far more complicated, but some functionality -%D has been moved to other macros. -%D -%D We start with the more simple but in some cases more -%D appropriate alternative is \type{\GotoPar}. This one leaves -%D \type{\par} unchanged and is therefore more robust. On the -%D other hand, \type{\AfterPar} is not supported. - -\newtoks\BeforePar -\newtoks\AfterPar - -\let\endoflinetoken=^^M - -%D The original definition was: -%D -%D \starttyping -%D \def\doGotoPar -%D {\ifx\nextchar\blankspace -%D \@EA\GotoPar -%D \else\ifx\nextchar\endoflinetoken -%D \@EAEAEA\GotoPar -%D \else -%D \@EAEAEA\dodoGotoPar -%D \fi\fi} -%D -%D \def\dodoGotoPar -%D {\the\BeforePar -%D \BeforePar\emptytoks -%D \nextchar} -%D -%D \def\GotoPar -%D {\afterassignment\doGotoPar\let\nextchar=} -%D \stoptyping - -%D Its big brother \type{\GetPar} redefines the \type{\par} -%D primitive, which can lead to unexpected results, depending -%D in the context. -%D -%D \starttyping -%D \def\GetPar -%D {\expanded -%D {\BeforePar -%D {\the\BeforePar -%D \BeforePar\emptytoks -%D \bgroup -%D \def\par -%D {\egroup -%D \par -%D \the\AfterPar -%D \BeforePar\emptytoks -%D \AfterPar\emptytoks}}}% -%D \GotoPar} -%D \stoptyping - -%D However, we can implement a better alternative by using: -%D -%D \starttyping -%D \def\dowithpar#1#2% -%D {\def\handlepar##1\par{#1##1#2}% -%D \def\gobblepar\par{\dowithpar{#1}{#2}}% -%D \doifnextcharelse\par\gobblepar\handlepar} -%D \stoptyping -%D -%D Or, nicer - -\def\redowithpar\par - {\doifnextcharelse\par\redowithpar\dodowithpar}% - -\def\dowithpar#1#2% - {\def\dodowithpar##1\par{#1##1#2}% - \redowithpar\par} - -\def\redogotopar\par - {\doifnextcharelse\par\redogotopar\dodogotopar}% - -\def\dogotopar#1% - {\def\dodogotopar{#1}% - \redogotopar\par} - -%D The previosuly defined macros now become: - -\def\GetPar - {\expanded - {\dowithpar - {\the\BeforePar - \BeforePar\emptytoks} - {\the\AfterPar - \BeforePar\emptytoks - \AfterPar\emptytoks}}} - -\def\GotoPar - {\expanded - {\dogotopar - {\the\BeforePar - \BeforePar\emptytoks}}} - -%D \macros -%D {dowithpargument,dowithwargument} -%D -%D The next macros are a variation on \type{\GetPar}. When -%D macros expect an argument, it interprets a grouped sequence -%D of characters a one token. While this adds to robustness and -%D less ambiguous situations, we sometimes want to be a bit -%D more flexible, or at least want to be a bit more tolerant -%D to user input. -%D -%D We start with a commands that acts on paragraphs. This -%D command is called as: -%D -%D \starttyping -%D \dowithpargument\command -%D \dowithpargument{\command ... } -%D \stoptyping -%D -%D In \CONTEXT\ we use this one to read in the titles of -%D chapters, sections etc. The commands responsible for these -%D activities accept several alternative ways of argument -%D passing. In these examples, the \type{\par} can be omitted -%D when an empty line is present. -%D -%D \starttyping -%D \command{...} -%D \command ... \par -%D \command -%D {...} -%D \command -%D ... \par -%D \stoptyping -%D -%D We show two implementations, of which for the moment the -%D we prefier to use the second one: -%D -%D \starttyping -%D \def\dowithpargument#1% -%D {\def\dodowithpargument% -%D {\ifx\next\bgroup -%D \def\next{#1}% -%D \else -%D \def\next####1 \par{#1{####1}}% -%D \fi -%D \next}% -%D \futurelet\next\dodowithpargument} -%D \stoptyping -%D -%D A second and better implementation was: -%D -%D \starttyping -%D \def\dowithpargument#1% -%D {\def\nextpar##1 \par{#1{##1}}% -%D \def\nextarg##1{#1{##1}}% -%D \doifnextcharelse\bgroup -%D {\nextarg} -%D {\nextpar}} -%D \stoptyping -%D -%D We ended up with an alternative that also accepts en empty -%D argument. This command permits for instance chapters to -%D have no title. - -%\def\dowithpargument#1% -% {\def\nextpar##1 \par{#1{##1}}% -% \def\nextarg##1{#1{##1}}% -% \doifnextcharelse\bgroup -% {\nextarg} -% {\doifnextcharelse{\par} -% {#1{}} -% {\nextpar}}} - -\def\dowithpargument#1% - {\def\nextpar##1 \par{#1{##1}}% - \def\nextarg##1{#1{##1}}% - \doifnextbgroupelse\nextarg{\doifnextcharelse\par{#1{}}\nextpar}} - -%D The \type{p} in the previous command stands for paragraph. -%D When we want to act upon words we can use the \type{w} -%D alternative. -%D -%D \starttyping -%D \dowithwargument\command -%D \dowithwargument{... \command ...} -%D \stoptyping -%D -%D The main difference bwteen two alternatives is in the -%D handling of \type{\par}'s. This time the space token acts -%D as a delimiter. -%D -%D \starttyping -%D \command{...} -%D \command ... -%D \command -%D {...} -%D \command -%D ... -%D \stoptyping -%D -%D Again there are two implementations possible: -%D -%D \starttyping -%D \def\dowithwargument#1% -%D {\def\dodowithwargument% -%D {\ifx\next\bgroup -%D \def\next{#1}% -%D \else -%D \def\next####1 {#1{####1}}% -%D \fi -%D \next}% -%D \futurelet\next\dodowithwargument} -%D \stoptyping -%D -%D We've chosen: - -%\def\dowithwargument#1% -% {\def\nextwar##1 {#1{##1}}% -% \def\nextarg##1{#1{##1}}% -% \doifnextcharelse\bgroup -% {\nextarg} -% {\nextwar}} - -\def\dowithwargument#1% - {\def\nextwar##1 {#1{##1}}% - \def\nextarg##1{#1{##1}}% - \doifnextbgroupelse\nextarg\nextwar} - -%D \macros -%D {dorepeat,dorepeatwithcommand} -%D -%D When doing repetitive tasks, we stromgly advice to use -%D \type{\dorecurse}. The next alternative however, suits -%D better some of the \CONTEXT\ interface commands. -%D -%D \starttyping -%D \dorepeat[n*\command] -%D \stoptyping -%D -%D The value of the used \COUNTER\ can be called within -%D \type{\command} by \type{\repeater}. -%D -%D A slightly different alternative is: -%D -%D \starttyping -%D \dorepeatwithcommand[n*{...}]\command -%D \stoptyping -%D -%D When we call for something like: -%D -%D \starttyping -%D \dorepeatwithcommand[3*{Hello}]\message -%D \stoptyping -%D -%D we get ourselves three \type{\message{Hello}} messages in -%D a row. In both commands, the \type{n*} is optional. When this -%D specification is missing, the command executes once. - -% this one is obsolete: - -\def\dorepeat[#1]% - {\dodorepeat#1*\empty*\relax} - -\long\def\dodorepeat#1*#2#3*#4\relax - {\ifx#2\empty#1\else\dorecurse{#1}{#2#3}\fi} - -\def\repeater - {\recurselevel} - -% this one will be kept - -\def\dorepeatwithcommand[#1]% - {\dodorepeatwithcommand#1*\empty*\relax} - -% \long\def\dodorepeatwithcommand#1*#2#3*#4\relax#5% -% {\ifx#2\empty -% #5{#1}% -% \else -% \dorecurse{#1}{#5{#2#3}}% -% \fi} -% -% more complex but better: - -% \long\def\dodorepeatwithcommand#1*#2#3*#4\relax#5% -% {\ifx#2\empty -% #5{#1}% -% \else\ifnum#1<\zerocount -% % a la etex -% % \dorecurse{-\numexpr(#1)}{#5{-#2#3}}% -% % indirect -% %\innerrecurse#1% -% %\expanded{\dorecurse{\number-\innerrecurse}}{#5{-#2#3}}% -% % safer: -% \bgroup\scratchcounter#1% -% \expanded{\egroup\noexpand\dorecurse{\number-\scratchcounter}}{#5{-#2#3}}% -% \else\ifx#2+% -% \dorecurse{#1}{#5{#3}}% -% \else -% \dorecurse{#1}{#5{#2#3}}% -% \fi\fi\fi} - -\def\dorepeatwithcommand[#1]% - {\dodorepeatwithcommand#1*\empty*\relax} - -\long\def\dodorepeatwithcommand#1*#2#3*#4\relax#5% - {\ifx#2\empty\redorepeatwithcommand[#1]#5\else\dododorepeatwithcommand{#1}{#2}{#3}#5\fi} - -\long\def\dododorepeatwithcommand#1#2#3#4% - {\ifx#2\empty % redundant but gives cleaner extensions - #4{#1}% - \else\ifnum#1<\zerocount - \bgroup\scratchcounter#1% - \expanded{\egroup\noexpand\dorecurse{\number-\scratchcounter}}{#4{-#2#3}}% - \else\ifx#2+% - \dorecurse{#1}{#4{#3}}% - \else - \dorecurse{#1}{#4{#2#3}}% - \fi\fi\fi} - -\def\redorepeatwithcommand[#1]#2% - {#2{#1}} - -%D The extension hook permits something like: -%D -%D \starttyping -%D \bgroup -%D -%D \catcode`\*=\@@superscript -%D -%D \gdef\redorepeatwithcommand[#1]% -%D {\redodorepeatwithcommand#1*\empty*\relax} -%D -%D \long\gdef\redodorepeatwithcommand#1*#2#3*#4\relax#5% -%D {\dododorepeatwithcommand{#1}{#2}{#3}#5} -%D -%D \egroup -%D \stoptyping -%D -%D although one may wonder if changing the catcode of \type {*} is wise. - -%D \macros -%D {normalbgroup,normalgroup} -%D -%D No comment. - -\let\normalbgroup\bgroup -\let\normalegroup\egroup - -%D \macros -%D {doifstringinstringelse} -%D -%D The next macro is meant for situations where both strings -%D are macros. This save some unneeded expansion. -%D -%D \starttyping -%D \long\def\doifstringinstringelse#1#2% -%D {\p!doifinstringelse#1#2% -%D \@EA\firstoftwoarguments -%D \else -%D \@EA\secondoftwoarguments -%D \fi} -%D \stoptyping -%D -%D A bit faster is: - -\def\pp!doifstringinstringelse#1% - {\if#1@% - \@EA\secondoftwoarguments - \else - \@EA\firstoftwoarguments - \fi} - -\long\def\doifstringinstringelse#1#2% - {\long\@EA\def\@EA\p!doifstringinstringelse\@EA##\@EA1#1##2##3\war - {\pp!doifstringinstringelse##2}% - \@EA\@EA\@EA\p!doifstringinstringelse\@EA#2#1@@\war} - -%D \macros -%D {appendtoks,prependtoks,appendtoksonce,prependtoksonce, -%D doifintokselse,flushtoks,dotoks} -%D -%D We use \TOKENLISTS\ sparsely within \CONTEXT, because the -%D comma separated lists are more suitable for the user -%D interface. Nevertheless we have: -%D -%D \starttyping -%D (\doglobal) \appendtoks ... \to\tokenlist -%D (\doglobal) \prependtoks ... \to\tokenlist -%D (\doglobal) \flushtoks\tokenlist -%D \dotoks\tokenlist -%D \stoptyping -%D -%D Er worden eerst enkele klad||registers gedefinieerd. These -%D macros are clones of the ones implemented in page~378 of -%D Knuth's \TeX book. -%D -%D A simple implementation, one that does not handle braces -%D at the outer level, is: -%D -%D \starttyping -%D \def\appendtoks#1\to#2% -%D {\scratchtoks={#1}% -%D \expanded{\dodoglobal\noexpand#2{\the#2\the\scratchtoks}}} -%D -%D \def\prependtoks#1\to#2% -%D {\scratchtoks={#1}% -%D \expanded{\dodoglobal\noexpand#2{\the\scratchtoks\the#2}}} -%D \stoptyping -%D -%D But here we prefer: - -\newtoks\@@scratchtoks - -% before we had the once only alternatives, we had: -% -% \def\appendtoks {\doappendtoks \relax} -% \def\prependtoks{\doprependtoks\relax} -% -% \long\def\doappendtoks#1\to#2% -% {\@@scratchtoks\@EA{\gobbleoneargument#1}% -% \expanded{\dodoglobal\noexpand#2{\the#2\the\@@scratchtoks}}} -% -% \long\def\doprependtoks#1\to#2% -% {\@@scratchtoks\@EA{\gobbleoneargument#1}% -% \expanded{\dodoglobal\noexpand#2{\the\@@scratchtoks\the#2}}} - -\def\appendtoks {\doappendtoks \relax} -\def\prependtoks {\doprependtoks \relax} -\def\appendtoksonce {\doappendtoksonce \relax} -\def\prependtoksonce{\doprependtoksonce\relax} - -% \def\dodoappendtoks#1% -% {\expanded{\dodoglobal\noexpand#1{\the#1\the\@@scratchtoks}}} -% -% \def\dodoprependtoks#1% -% {\expanded{\dodoglobal\noexpand#1{\the\@@scratchtoks\the#1}}} -% -% \long\def\doappendtoks#1\to% -% {\@@scratchtoks\@EA{\gobbleoneargument#1}\dodoappendtoks} -% -% \long\def\doprependtoks#1\to% -% {\@@scratchtoks\@EA{\gobbleoneargument#1}\dodoprependtoks} -% -% \long\def\doappendtoksonce#1\to#2% -% {\@@scratchtoks\@EA{\gobbleoneargument#1}% -% \doifintokselse\@@scratchtoks{#2}{}{\dodoappendtoks{#2}}} -% -% \long\def\doprependtoksonce#1\to#2% -% {\@@scratchtoks\@EA{\gobbleoneargument#1}% -% \doifintokselse\@@scratchtoks{#2}{}{\dodoprependtoks{#2}}} -% -% A slightly (but in the case of large arguments -% significantly) faster alternative is given below: - -\newtoks\@@toks - -\def\dodoappendtoks - {\dodoglobal\@@toks\@EAEAEA{\@EA\the\@EA\@@toks\the\@@scratchtoks}} - -\def\dodoprependtoks - {\dodoglobal\@@toks\@EAEAEA{\@EA\the\@EA\@@scratchtoks\the\@@toks}} - -\long\def\doappendtoks#1\to#2% - {\def\@@toks{#2}% - \@@scratchtoks\@EA{\gobbleoneargument#1}\dodoappendtoks} - -\long\def\doprependtoks#1\to#2% - {\def\@@toks{#2}% - \@@scratchtoks\@EA{\gobbleoneargument#1}\dodoprependtoks} - -\long\def\doappendtoksonce#1\to#2% - {\def\@@toks{#2}% - \@@scratchtoks\@EA{\gobbleoneargument#1}% - \doifintokselse\@@scratchtoks\@@toks\donothing\dodoappendtoks} - -\long\def\doprependtoksonce#1\to#2% - {\def\@@toks{#2}% - \@@scratchtoks\@EA{\gobbleoneargument#1}% - \doifintokselse\@@scratchtoks\@@toks\donothing\dodoprependtoks} - -%D The test macro: -%D -%D \starttyping -%D \def\doifintokselse#1#2% #1 en #2 zijn toks -%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciia -%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciib -%D \doifinstringelse\asciia\asciib} -%D \stoptyping -%D -%D Better: -%D -%D \starttyping -%D \def\doifintokselse#1#2% #1 en #2 zijn toks -%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciia -%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciib -%D \doifstringinstringelse\asciia\asciib} -%D \stoptyping -%D -%D Even better: - -\beginETEX - - \def\doifintokselse#1#2% #1 en #2 zijn toks - {\@EA\convertargument\the#1\to\asciia - \@EA\convertargument\the#2\to\asciib - \doifstringinstringelse\asciia\asciib} - -\endETEX - -\beginTEX - - \def\doifintokselse#1#2% #1 en #2 zijn toks - {\edef\asciia{\the#1}\convertcommand\asciia\to\asciia - \edef\asciib{\the#2}\convertcommand\asciib\to\asciib - \doifstringinstringelse\asciia\asciib} - -\endTEX - -%D Also: - -\def\appendetoks #1\to{\expanded{\appendtoks #1}\to} -\def\prependetoks#1\to{\expanded{\prependtoks#1}\to} - -%D Hm. - -\def\flushtoks#1% nb: can reassing to #1 again, hence the indirectness - {\@@scratchtoks#1\relax - \dodoglobal#1\emptytoks - \the\@@scratchtoks\relax} - -\let\dotoks\the - -%D \macros -%D {makecounter,pluscounter,minuscounter, -%D resetcounter,setcounter,countervalue} -%D -%D Declaring, setting and resetting \COUNTERS\ can be doen -%D with the next set of commands. -%D -%D \starttyping -%D \makecounter {name} -%D \pluscounter {name} -%D \minuscounter {name} -%D \resetcounter {name} -%D \setcounter {name} {value} -%D \countervalue {name} -%D \stoptyping -%D -%D We prefer the use of global counters. This means that we -%D have to load \PLAIN\ \TEX\ in a bit different way: -%D -%D \starttyping -%D \let\oldouter=\outer -%D \let\outer=\relax -%D \input plain.tex -%D \let\outer=\oldouter -%D -%D \def\newcount% -%D {\alloc@0\count\countdef\insc@unt} -%D \stoptyping -%D -%D First we show a solution in which we use real \COUNTERS. -%D Apart from some expansion, nothing special is done. -%D -%D \starttyping -%D \def\makecounter#1% -%D {\expandafter\newcount\csname#1\endcsname} -%D -%D \def\pluscounter#1% -%D {\global\advance\csname#1\endcsname by 1 } -%D -%D \def\minuscounter#1% -%D {\global\advance\csname#1\endcsname by -1 } -%D -%D \def\resetcounter#1% -%D {\expandafter\global\csname#1\endcsname=0 } -%D -%D \def\setcounter#1#2% -%D {\expandafter\global\csname#1\endcsname=#2 } -%D -%D \def\countervalue#1% -%D {\the\getvalue{#1}} -%D \stoptyping -%D -%D Because these macros are already an indirect way of working -%D with counters, there is no harm in using pseudo \COUNTERS\ -%D here: - -\def\makecounter#1% - {\letgvalue{#1}\zerocountervalue} % see earlier - -% \def\countervalue#1% -% {\getvalue{#1}} - -\let\countervalue\getvalue - -\def\pluscounter#1% - {\scratchcounter\getvalue{#1}% - \advance\scratchcounter \plusone - \setxvalue{#1}{\the\scratchcounter}} - -\def\minuscounter#1% - {\scratchcounter\getvalue{#1}% - \advance\scratchcounter \minusone - \setxvalue{#1}{\the\scratchcounter}} - -\def\resetcounter#1% - {\letgvalue{#1}\zerocountervalue} - -\def\setcounter#1#2% or: \setxvalue{#1}{\number#2} - {\scratchcounter#2% - \setxvalue{#1}{\the\scratchcounter}} - -\def\incrementcounter#1#2% #1 name #2 value - {\setxvalue{#1}{\the\numexpr\csname#1\endcsname+#2\relax}} - -\def\decrementcounter#1#2% #1 name #2 value - {\setxvalue{#1}{\the\numexpr\csname#1\endcsname-#2\relax}} - -%D \macros -%D {savecounter,restorecounter} -%D -%D These two commands can be used to save and restore counter -%D values. Only one level is saved. - -\def\savecounter#1% - {{\scratchcounter\getvalue {#1}\setxvalue{!#1}{\the\scratchcounter}}} - -\def\restorecounter#1% - {{\scratchcounter\getvalue{!#1}\setxvalue {#1}{\the\scratchcounter}}} - -% == {\setxvalue{#1}{\getvalue{!#1}}} - -%D The next \ETEX\ based solution is some 15\% faster, which -%D goes unnoticed in any normal run, simply because these -%D macros are not used milions of times. - -\beginETEX \numexpr - -\def\makecounter#1% - {\global\@EA\let\csname#1\endcsname\zerocountervalue} % see earlier - -\def\countervalue#1% - {\ifcsname#1\endcsname\csname#1\endcsname\fi} - -\def\pluscounter#1% - {\@EA\xdef\csname#1\endcsname{\the\numexpr\csname#1\endcsname+\plusone\relax}} - -\def\minuscounter#1% - {\@EA\xdef\csname#1\endcsname{\the\numexpr\csname#1\endcsname-\plusone\relax}} - -\def\resetcounter#1% - {\global\@EA\let\csname#1\endcsname\zerocountervalue} - -\def\setcounter#1#2% - {\@EA\xdef\csname#1\endcsname{\the\numexpr#2\relax}} - -\def\savecounter#1% - {\@EA\xdef\csname !#1\endcsname{\the\numexpr\csname#1\endcsname\relax}} - -\def\restorecounter#1% - {\@EA\xdef\csname#1\endcsname{\the\numexpr\csname !#1\endcsname\relax}} - -\endETEX - -%D \macros -%D {beforesplitstring,aftersplitstring} -%D -%D These both commands split a string at a given point in two -%D parts, so \type{x.y} becomes \type{x} or \type{y}. -%D -%D \starttyping -%D \beforesplitstring test.tex\at.\to\filename -%D \aftersplitstring test.tex\at.\to\extension -%D \stoptyping -%D -%D The first routine looks (and is indeed) a bit simpler than -%D the second one. The alternative looking more or less like -%D the first one did not always give the results we needed. -%D Both implementations show some insight in the manipulation -%D of arguments. - -\def\beforesplitstring#1\at#2\to#3% - {\def\dosplitstring##1#2##2#2##3\\% - {\def#3{##1}}% - \@EA\dosplitstring#1#2#2\\} - -\def\aftersplitstring#1\at#2\to#3% - {\def\dosplitstring##1#2##2@@@##3\\% - {\def#3{##2}}% - \@EA\dosplitstring#1@@@#2@@@\\} - -%D \macros -%D {splitstring,greedysplitstring} -%D -%D A bonus macro. - -\def\splitstring#1\at#2\to#3\and#4% - {\def\dosplitstring##1#2##2\empty\empty\empty##3\\% - {\def#3{##1}% - \def\dosplitstring{##3}% - \ifx\dosplitstring\empty - \let#4\empty - \else - \def#4{##2}% - \fi}% - \@EA\dosplitstring#1\empty\empty\empty#2\empty\empty\empty\\} - -% Ok, but not for all cases: -% -% \def\greedysplitstring#1\at#2\to#3\and#4% -% {\edef\asciib{#1}% -% \let\asciic\asciib -% \let#3\empty -% \let#4\empty -% \doloop -% {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib -% \ifx\asciib\empty -% \exitloop -% \else -% \edef#3{\ifx#3\empty\else#3#2\fi\asciia}% -% \let#4\asciib -% \fi}% -% \ifx#3\empty\let#3\asciic\fi} -% -% The next one is some 25\% faster, but it hardly matters because -% we seldom use this macro. -% -% \def\greedysplitstring#1\at#2\to#3\and#4% -% {\edef\asciib{#1}% -% \let\asciic\asciib -% \let#3\empty -% \let#4\empty -% \def\dogreedysplitstring -% {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib -% \ifx\asciib\empty -% \expandafter\dogreedysplitstring -% \else -% \edef#3{\ifx#3\empty\else#3#2\fi\asciia}% -% \let#4\asciib -% \fi}% -% \dogreedysplitstring -% \ifx#3\empty\let#3\asciic\fi} -% -% The better alternative: - -\def\greedysplitstring#1\at#2\to#3\and#4% - {\edef\asciib{#1}% - \let\asciic\asciib - \let#3\empty - \let#4\empty - \doloop - {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib - \ifx\asciib\empty - \exitloop - \else - % not \edef#3{\ifx#3\empty\else#3#2\fi\asciia} else - % /root/path fails because then #3==empty - \edef#3{\ifcase\recurselevel\or\else#3#2\fi\asciia}% - \let#4\asciib - \fi}% - \ifx#3\empty\let#3\asciic\fi} - -%D \macros -%D {beforetestandsplitstring, -%D aftertestandsplitstring, -%D testandsplitstring} -%D -%D The next alternatives are for Simon Pepping. This time -%D the result is empty when no split is done. - -% \def\beforetestandsplitstring#1\at#2\to#3% -% {\def\dosplitstring##1#2##2#2##3\\{\doifelsenothing -% {##3}{\let#3\empty}{\def#3{##1}}}% -% \@EA\dosplitstring#1#2#2\\} -% -% \def\aftertestandsplitstring#1\at#2\to#3% -% {\def\dosplitstring ##1#2##2@@@##3\\{\doifelsenothing -% {##3}{\let#3\empty}{\def#3{##2}}}% -% \@EA\dosplitstring #1@@@#2@@@\\} -% -% \def\testandsplitstring#1\at#2\to#3\and#4% -% {\def\dosplitstring##1#2##2#2##3\\{\doifelsenothing -% {##3}{\let#3\empty\let#4\empty}{\def#3{##1}\def#4{##2}}}% -% \@EA\dosplitstring#1#2#2\\} -% -% faster: - -\def\beforetestandsplitstring#1\at#2\to#3% - {\def\dosplitstring##1#2##2#2##3##4\\% - {\ifx##3\empty\let#3\empty\else\def#3{##1}\fi}% - \@EA\dosplitstring#1#2#2\empty\\} - -\def\aftertestandsplitstring#1\at#2\to#3% - {\def\dosplitstring ##1#2##2@@@##3##4\\% - {\ifx##3\empty\let#3\empty\else\def#3{##2}\fi}% - \@EA\dosplitstring #1@@@#2@@@\empty\\} - -\def\testandsplitstring#1\at#2\to#3\and#4% - {\def\dosplitstring##1#2##2#2##3##4\\% - {\ifx##3\empty\let#3\empty\let#4\empty\else\def#3{##1}\def#4{##2}\fi}% - \@EA\dosplitstring#1#2#2\empty\\} - -%D \macros -%D {removesubstring} -%D -%D A first application of the two routines defined above is: -%D -%D \starttyping -%D \removesubstring-\from first-last\to\nothyphenated -%D \stoptyping -%D -%D Which in terms of \TEX\ looks like: - -%\def\removesubstring#1\from#2\to#3% -% {\doifinstringelse{#1}{#2} -% {\beforesplitstring#2\at#1\to\!!stringa -% \aftersplitstring #2\at#1\to\!!stringb -% \edef#3{\!!stringa\!!stringb}% -% \removesubstring#1\from#3\to#3} -% {}} - -\def\removesubstring#1\from#2\to#3% - {\splitstring#2\to\!!stringa\and\!!stringb - \dodoglobal#3{\!!stringa\!!stringb}} - -%D \macros -%D {appendtocommalist,prependtocommalist, -%D addtocommalist,removefromcommalist} -%D -%D When working with comma separated lists, one sooner or -%D later want the tools to append or remove items from such a -%D list. When we add an item, we first check if it's already -%D there. This means that every item in the list is unique. -%D -%D \starttyping -%D \addtocommalist {alfa} \name -%D \addtocommalist {beta} \name -%D \addtocommalist {gamma} \name -%D \removefromcommalist {beta} \name -%D \stoptyping -%D -%D These commands can be prefixed with \type{\doglobal}. The -%D implementation of the second command is more complecated, -%D because we have to take leading spaces into account. Keep in -%D mind that users may provide lists with spaces after the -%D commas. When one item is left, we also have to get rid of -%D trailing spaces. -%D -%D \starttyping -%D \def\words{alfa, beta, gamma, delta} -%D \def\words{alfa,beta,gamma,delta} -%D \stoptyping -%D -%D Removing an item takes more time than adding one. -%D -%D A fast appending alternative, without any testing, is -%D also provided: -%D -%D \starttyping -%D \appendtocommalist {something} \name -%D \prependtocommalist {something} \name -%D \stoptyping -%D -%D This can be implemented as follows: -%D -%D \starttyping -%D \def\appendtocommalist#1#2% -%D {\ifx#2\empty -%D \dodoglobal\edef#2{#1}% -%D \else % no test on empty -%D \dodoglobal\edef#2{#2,#1}% -%D \fi} -%D -%D \def\prependtocommalist#1#2% -%D {\ifx#2\empty -%D \dodoglobal\edef#2{#1}% -%D \else % no test on empty -%D \dodoglobal\edef#2{#1,#2}% -%D \fi} -%D \stoptyping -%D -%D The faster alternatives are: - -\def\appendtocommalist#1#2% - {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}} - -\def\prependtocommalist#1#2% - {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}} - -%D The old ones are: -%D -%D \starttyping -%D \def\addtocommalist#1#2% -%D {\ifx#2\empty -%D \dodoglobal\edef#2{#1}% -%D \else -%D \edef\!!stringa{#2,,}% -%D \beforesplitstring#2\at,,\to#2\relax -%D \ExpandBothAfter\doifinsetelse{#1}{#2} -%D {\resetglobal} -%D {\dodoglobal\edef#2{#2,#1}}% -%D \fi} -%D -%D \def\pretocommalist#1#2% -%D {\ifx#2\empty -%D \dodoglobal\edef#2{#1}% -%D \else -%D \edef\!!stringa{#2,,}% -%D \beforesplitstring#2\at,,\to#2\relax -%D \ExpandBothAfter\doifinsetelse{#1}{#2} -%D {\resetglobal} -%D {\dodoglobal\edef#2{#1,#2}}% -%D \fi} -%D -%D \def\doremovefromcommalist#1#2#3% nog \doglobal -%D {\edef\!!stringa{,,#3,,}% -%D \beforesplitstring\!!stringa\at,#1#2,\to\!!stringb -%D \aftersplitstring\!!stringa\at,#1#2,\to\!!stringc -%D \edef#3{\!!stringb,\!!stringc}% -%D \aftersplitstring#3\at,,\to#3\relax -%D \beforesplitstring#3\at,,\to#3} -%D -%D \def\removefromcommalist#1#2% -%D {\doremovefromcommalist{ }{#1}{#2}% -%D \doremovefromcommalist{}{#1}{#2}% -%D \dofrontstrip#2% -%D \dodoglobal\edef#2{#2}} -%D \stoptyping -%D -%D Significantly faster (especially for longer lists): - -\def\addtocommalist#1#2% {item} \cs - {\rawdoifinsetelse{#1}#2\resetglobal - {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}} - -\def\pretocommalist#1#2% {item} \cs - {\rawdoifinsetelse{#1}#2\resetglobal - {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}} - -\def\robustdoifinsetelse#1#2% - {\expanded{\convertargument#1}\to\!!stringa - \expanded{\convertargument#2}\to\!!stringb - \rawdoifinsetelse\!!stringa\!!stringb} - -\def\robustaddtocommalist#1#2% {item} \cs - {\robustdoifinsetelse{#1}#2\resetglobal - {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}} - -\def\robustpretocommalist#1#2% {item} \cs - {\robustdoifinsetelse{#1}#2\resetglobal - {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}} - -\def\xsplitstring#1#2% \cs {str} - {\def\dosplitstring##1,#2,##2,#2,##3\\% - {\edef\!!stringa{\bcleanedupcommalist##1\empty\empty\relax}% - \edef\!!stringb{\acleanedupcommalist##2,,\relax}}% - \@EA\dosplitstring\@EA,#1,,#2,,#2,\\} - -\def\bcleanedupcommalist#1#2#3\relax{\if#1,\else#1\fi\if#2,\else#2\fi#3} -\def\bcleanedupcommalist#1#2\relax{\if#1,\else#1\fi#2} -\def\acleanedupcommalist#1,,#2\relax{#1} - -% \def\removefromcommalist#1#2% -% {\expanded{\xsplitstring\noexpand#2{#1}}% -% \dodoglobal\edef#2% -% {\ifx\!!stringa\empty -% \!!stringb -% \else -% \@EA\acleanedupcommalist\!!stringa,,\relax -% \ifx\!!stringb\empty\else,\!!stringb\fi -% \fi}} - -\def\removefromcommalist#1#2% - {\rawdoifinsetelse{#1}#2% - {\expanded{\xsplitstring\noexpand#2{#1}}% - \dodoglobal\edef#2% - {\ifx\!!stringa\empty - \!!stringb - \else - \!!stringa\ifx\!!stringb\empty\else,\!!stringb\fi - \fi}} - \resetglobal} - -%D \macros -%D {substituteincommalist} -%D -%D Slow but seldom used, so for the moment we stick to this -%D implementation. -%D -%D \starttyping -%D \substituteincommalist{old}{new}{list} -%D \stoptyping - -\def\substituteincommalist#1#2#3% old, new, list (slooow) - {\edef\!!stringb{#1}% - \edef\!!stringd{#2}% - \let\!!stringa#3% - \let#3\empty - \def\dosubstituteincommalist##1% - {\edef\!!stringc{##1}% - \ifx\!!stringb\!!stringc - \ifx\!!stringd\empty\else - \edef#3{#3\ifx#3\empty\else,\fi\!!stringd}% - \fi - \def\docommand####1{\edef#3{#3,####1}}% - \else - \edef#3{#3\ifx#3\empty\else,\fi##1}% - \fi}% - \@EA\rawprocesscommacommand\@EA[\!!stringa]\dosubstituteincommalist} - -%D A not so useful macro: - -\def\dodofrontstrip[#1#2]#3% - {\ifx#1\space - \def#3{#2}% - \else - \def#3{#1#2}% - \fi} - -\def\dofrontstrip#1% - {\edef\!!stringa{#1}% - \ifx\!!stringa\empty \else - \@EA\dodofrontstrip\@EA[#1]#1% - \fi} - -%D \macros -%D {replaceincommalist} -%D -%D The next macro can be used to replace an indexed element -%D in a commalist: -%D -%D \starttyping -%D \replaceincommalist\MyList{2} -%D \stoptyping -%D -%D Element~2 will be replaced by the current meaning of the macro -%D \type {\newcommalistelement}. The old meaning is saved in -%D \type {\commalistelement}. The replacement honors grouped items, -%D like in: -%D -%D \starttyping -%D \def\MyList{a,b,c,d,e,f} \replaceincommalist\MyList{3} -%D \def\MyList{a,b,c,d,e,f} \replaceincommalist\MyList{3} -%D \def\MyList{a,{b,c},d,e,f} \replaceincommalist\MyList{3} -%D \def\MyList{a,b,c,{d,e,f}} \replaceincommalist\MyList{3} -%D \stoptyping - -\let\newcommalistelement\empty - -\def\replaceincommalist#1#2% #1 = commalistelement #2 = position starts at 1 - {\def\doreplaceincommalist##1% - {\ifnum\commalistcounter=#2\relax - \ifx\newcommalistelement\empty\else - \ifx\newcommalist\empty - \let\newcommalist\newcommalistelement - \else - \@EA\@EA\@EA\def\@EA\@EA\@EA\newcommalist\@EA\@EA\@EA - {\@EA\newcommalist\@EA,\newcommalistelement}% - \fi - \fi - \def\commalistelement{##1}% - \else - \ifx\newcommalist\empty - \ifx\nexttoken\bgroup % is known -) - \def\newcommalist{{##1}}% - \else - \def\newcommalist{##1}% - \fi - \else - \ifx\nexttoken\bgroup % is known -) - \@EA\def\@EA\newcommalist\@EA{\newcommalist,{##1}}% - \else - \@EA\def\@EA\newcommalist\@EA{\newcommalist,##1}% - \fi - \fi - \fi - \advance\commalistcounter\plusone}% - \let\commalistelement\empty - \let\newcommalist\empty - \commalistcounter\plusone - \@EA\processcommalist\@EA[#1]\doreplaceincommalist - \dodoglobal\let#1\newcommalist} - -%D \macros -%D {globalprocesscommalist} -%D -%D The commalist processing commands are characterized by the -%D fact that the way they handle expansion as well as the fact -%D that they can be nested. This makes them kind of useless for -%D handling comma lists in alignments. In these situations the -%D next macro can be of use. - -\def\globalprocesscommaitem#1,% - {\if]#1\else - \globalcommacommand{#1}% - \expandafter\globalprocesscommaitem - \fi} - -\def\globalprocesscommalist[#1]#2% - {\global\let\globalcommacommand#2% - \expandafter\globalprocesscommaitem#1,],} - -%D \macros -%D {withoutpt,PtToCm, -%D numberofpoints,dimensiontocount} -%D -%D We can convert point into centimeters with: -%D -%D \starttyping -%D \PtToCm{dimension} -%D \stoptyping - -{\catcode`\.=\@@other - \catcode`\p=\@@other - \catcode`\t=\@@other - \gdef\WITHOUTPT#1pt{#1}} - -\def\withoutpt#1% - {\expandafter\WITHOUTPT#1} - -%D The capitals are needed because \type{p} and \type{t} have -%D \CATCODE~12, while macronames only permit tokens with the -%D \CATCODE~11. As a result we cannot use the \type{.group} -%D primitives. Those who want to know more about this kind of -%D manipulations, we advice to study the \TEX book in detail. -%D Because this macro does not do any assignment, we can use it -%D in the following way too. - -\def\PtToCm#1% - {\begingroup - \scratchdimen#1\relax - \scratchdimen0.0351459804\scratchdimen % 2.54/72.27 - \withoutpt\the\scratchdimen cm% - \endgroup} - -%D We also support: -%D -%D \starttyping -%D \numberofpoints {dimension} -%D \dimensiontocount {dimension} {\count} -%D \stoptyping -%D -%D Both macros return a rounded number. - -% \dimensiontocount{10.49pt}\scratchcounter \the\scratchcounter / \numberofpoints{10.49pt} -% \dimensiontocount{10.51pt}\scratchcounter \the\scratchcounter / \numberofpoints{10.51pt} - -\def\dimensiontocount#1#2{#2\numexpr\dimexpr#1\relax/\maxcard\relax} -\def\numberofpoints #1{\the\numexpr\dimexpr#1\relax/\maxcard\relax} - -%D \macros -%D {swapdimens,swapmacros} -%D -%D Simple but effective are the next two macros. There name -%D exactly states their purpose. The \type{\scratchdimen} and -%D \type{\!!stringa} can only be swapped when being the first -%D argument. - -\def\swapdimens#1#2% - {\scratchdimen #1\redoglobal #1#2\dodoglobal #2\scratchdimen} - -\def\swapmacros#1#2% - {\let\!!stringa#1\redoglobal\let#1#2\dodoglobal\let#2\!!stringa} - -%D \macros -%D {pushmacro,popmacro} -%D -%D Premature and a bit of beta, we offer: -%D -%D \starttyping -%D \pushmacro\macro -%D \popmacro\macro -%D \stoptyping -%D -%D Beware: global! - -% \def\@s@{@s@} -% -% \beginTEX -% -% \def\globalpushmacro#1% we can use a faster incement here -% {\@EA\doglobal\@EA\increment\csname\@s@*\string#1\endcsname -% \global\@EA\let\csname\csname\@s@*\string#1\endcsname*\string#1\endcsname#1} -% -% \def\globalpopmacro#1% \global\let -% {\global\@EA\let\@EA#1\csname\csname\@s@*\string#1\endcsname*\string#1\endcsname -% \@EA\doglobal\@EA\decrement\csname\@s@*\string#1\endcsname} -% -% \def\localpushmacro#1% this one can be used to push a value over an \egroup -% {\@EA\doglobal\@EA\increment\csname\@s@**\string#1\endcsname -% \global\@EA\let\csname\csname\@s@**\string#1\endcsname**\string#1\endcsname#1} -% -% \def\localpopmacro#1% \local\let -% {\@EA\let\@EA#1\csname\csname\@s@**\string#1\endcsname**\string#1\endcsname -% \global\@EA\decrement\csname\@s@**\string#1\endcsname} -% -% \endTEX -% -% \beginETEX \newcount -% -% \def\globalpushmacro#1% -% {\ifcsname\@s@*\string#1\endcsname \else -% \@EA\newcount\csname\@s@*\string#1\endcsname -% \fi -% \global\advance\csname\@s@*\string#1\endcsname \plusone -% \global\@EA\let\csname\the\csname\@s@*\string#1\endcsname*\string#1\endcsname#1} -% -% \def\globalpopmacro#1% \global\let -% {\global\@EA\let\@EA#1\csname\the\csname\@s@*\string#1\endcsname*\string#1\endcsname -% \global\advance\csname\@s@*\string#1\endcsname \minusone} -% -% \def\localpushmacro#1% this one can be used to push a value over an \egroup -% {\ifcsname\@s@**\string#1\endcsname \else -% \@EA\newcount\csname\@s@**\string#1\endcsname -% \fi -% \global\advance\csname\@s@**\string#1\endcsname \plusone -% \global\@EA\let\csname\the\csname\@s@**\string#1\endcsname**\string#1\endcsname#1} -% -% \def\localpopmacro#1% \local\let -% {\@EA\let\@EA#1\csname\the\csname\@s@**\string#1\endcsname**\string#1\endcsname -% \global\advance\csname\@s@**\string#1\endcsname \minusone } -% -% \endETEX -% -% some 5% faster (used a lot in typescripts, so ...) - -\def\@sl@{@sl@} -\def\@sg@{@sg@} - -\let\@@pushedmacro\empty - -\beginTEX - -\def\globalpushmacro#1% we can use a faster incement here - {\xdef\@@pushedmacro{\string#1}% - \@EA\doglobal\@EA\increment\csname\@sg@\@@pushedmacro\endcsname - \global\@EA\let\csname\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1} - -\def\globalpopmacro#1% - {\xdef\@@pushedmacro{\string#1}% - \global\@EA\let\@EA#1\csname\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname - \@EA\doglobal\@EA\decrement\csname\@sg@\@@pushedmacro\endcsname} - -\def\localpushmacro#1% this one can be used to push a value over an \egroup - {\xdef\@@pushedmacro{\string#1}% - \@EA\doglobal\@EA\increment\csname\@sl@\@@pushedmacro\endcsname - \global\@EA\let\csname\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1} - -\def\localpopmacro#1% - {\xdef\@@pushedmacro{\string#1}% - \@EA\let\@EA#1\csname\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname - \global\@EA\decrement\csname\@sl@\@@pushedmacro\endcsname} - -\endTEX - -\beginETEX - -\def\globalpushmacro#1% - {\xdef\@@pushedmacro{\string#1}% - \ifcsname\@sg@\@@pushedmacro\endcsname \else - \@EA\newcount\csname\@sg@\@@pushedmacro\endcsname - \fi - \global\advance\csname\@sg@\@@pushedmacro\endcsname \plusone - \global\@EA\let\csname\the\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1} - -\def\globalpopmacro#1% - {\xdef\@@pushedmacro{\string#1}% - \global\@EA\let\@EA#1\csname\the\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname - \global\advance\csname\@sg@\@@pushedmacro\endcsname \minusone} - -\def\localpushmacro#1% this one can be used to push a value over an \egroup - {\xdef\@@pushedmacro{\string#1}% - \ifcsname\@sl@\@@pushedmacro\endcsname \else - \@EA\newcount\csname\@sl@\@@pushedmacro\endcsname - \fi - \global\advance\csname\@sl@\@@pushedmacro\endcsname \plusone - \global\@EA\let\csname\the\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1} - -\def\localpopmacro#1% - {\xdef\@@pushedmacro{\string#1}% - \@EA\let\@EA#1\csname\the\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname - \global\advance\csname\@sl@\@@pushedmacro\endcsname \minusone } - -\endETEX - -% \let\pushmacro\globalpushmacro -% \let\popmacro \globalpopmacro - -\let\pushmacro\localpushmacro -\let\popmacro \localpopmacro - -%D \macros -%D {setlocalhsize} -%D -%D Sometimes we need to work with the \type{\hsize} that is -%D corrected for indentation and left and right skips. The -%D corrected value is available in \type{\localhsize}, which -%D needs to be calculated with \type{\setlocalhsize} first. -%D -%D \starttyping -%D \setlocalhsize \hbox to \localhsize{...} -%D \setlocalhsize[-1em] \hbox to \localhsize{...} -%D \setlocalhsize[.5ex] \hbox to \localhsize{...} -%D \stoptyping -%D -%D These examples show us that an optional can be used. The -%D value provided is added to \type{\localhsize}. - -\newdimen\localhsize - -\def\complexsetlocalhsize[#1]% don't change ! - {\localhsize\hsize - \ifnum\hangafter<\zerocount - \advance\localhsize\ifdim\hangindent>\zeropoint-\fi\hangindent - \fi - \advance\localhsize -\leftskip - \advance\localhsize -\rightskip - \advance\localhsize #1\relax} - -\def\simplesetlocalhsize - {\complexsetlocalhsize[\zeropoint]} - -\definecomplexorsimple\setlocalhsize - -%D \macros -%D {doifvalue,doifnotvalue,doifelsevalue, -%D doifnothing,doifsomething,doifelsenothing, -%D doifvaluenothing,doifvaluesomething,doifelsevaluenothing} -%D -%D These long named \type{\if} commands can be used to access -%D macros (or variables) that are normally accessed by using -%D \type{\getvalue}. Using these alternatives safes us three -%D tokens per call. Anyone familiar with the not||values -%D ones, can derive their meaning from the definitions. - - \def\doifvalue#1{\doif {\csname#1\endcsname}} - \def\doifnotvalue#1{\doifnot {\csname#1\endcsname}} - \def\doifelsevalue#1{\doifelse{\csname#1\endcsname}} - - \def\doifnothing#1{\doif {#1}{}} - \def\doifsomething#1{\doifnot {#1}{}} - \def\doifelsenothing#1{\doifelse{#1}{}} - - \def\doifvaluenothing#1{\doif {\csname#1\endcsname}{}} - \def\doifvaluesomething#1{\doifnot {\csname#1\endcsname}{}} -\def\doifelsevaluenothing#1{\doifelse{\csname#1\endcsname}{}} - -%D Faster but spoiling inheritance (copying parameters): -%D -%D \starttyping -%D \def\doifelsevaluesomething#1#2#3% -%D {\expandafter\ifx\csname#1\endcsname\empty#3\else#2\fi} -%D -%D \def\doifvaluesomething#1#2% -%D {\expandafter\ifx\csname#1\endcsname\empty\else#2\fi} -%D -%D \def\doifvaluenothing#1#2% -%D {\expandafter\ifx\csname#1\endcsname\empty#2\fi} -%D \stoptyping -%D -%D Slightly more efficient: - - \def\doifnothing{\doif \empty} - \def\doifsomething{\doifnot \empty} -\def\doifelsenothing{\doifelse\empty} - -%D The somewhat faster alternatives are: - -\long\def\doifvalue#1#2% - {\edef\!!stringa{\csname#1\endcsname}\edef\!!stringb{#2}% - \ifx\!!stringa\!!stringb - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\long\def\doifnotvalue#1#2% - {\edef\!!stringa{\csname#1\endcsname}\edef\!!stringb{#2}% - \ifx\!!stringa\!!stringb - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -\long\def\doifelsevalue#1#2% - {\edef\!!stringa{\csname#1\endcsname}\edef\!!stringb{#2}% - \ifx\!!stringa\!!stringb - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\long\def\doifnothing#1% - {\edef\!!stringa{#1}% - \ifx\!!stringa\empty - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\long\def\doifsomething#1% - {\edef\!!stringa{#1}% - \ifx\!!stringa\empty - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -\long\def\doifelsenothing#1% - {\edef\!!stringa{#1}% - \ifx\!!stringa\empty - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\long\def\doifsomethingelse#1% - {\edef\!!stringa{#1}% - \ifx\!!stringa\empty - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} - -\long\def\doifvaluenothing#1% - {\edef\!!stringa{\csname#1\endcsname}% - \ifx\!!stringa\empty - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\long\def\doifvaluesomething#1% - {\edef\!!stringa{\csname#1\endcsname}% - \ifx\!!stringa\empty - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -\long\def\doifelsevaluenothing#1% - {\edef\!!stringa{\csname#1\endcsname}% - \ifx\!!stringa\empty - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -%D \macros -%D {doifemptyelsevalue, doifemptyvalue, doifnotemptyvalue} -%D -%D Also handy: - -\def\doifemptyelsevalue#1% - {\@EA\ifx\csname#1\endcsname\empty - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\def\doifemptyvalue#1% - {\@EA\ifx\csname#1\endcsname\empty - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\def\doifnotemptyvalue#1% - {\@EA\ifx\csname#1\endcsname\empty - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -%D \macros -%D {doifallcommonelse} -%D -%D A complete match of two sets can be tested with -%D \type {\doifallcommonelse}, where the first two -%D arguments are sets. - -%\def\doifallcommonelse#1#2#3#4% -% {\def\p!docommoncheck##1% -% {\doifnotinset{##1}{#2}{\donefalse}% -% \ifdone\else\quitcommalist\fi}% -% \donetrue -% \processcommalist[#1]\p!docommoncheck -% \ifdone#3\else#4\fi} - -\def\@@doifallcommonelse#1#2#3#4% slow - {\def\p!docommoncheck##1% - {\doifnotinset{##1}{#4}\donefalse - \ifdone\else\expandafter\quitcommalist\fi}% - \donetrue - \processcommalist[#3]\p!docommoncheck - \ifdone\expandafter#1\else\expandafter#2\fi} - -\def\doifallcommonelse - {\@@doifallcommonelse\firstoftwoarguments\secondoftwoarguments} - -\def\doifallcommon - {\@@doifallcommonelse\firstofonearguments\gobbleoneargument} - -\def\doifnotallcommon - {\@@doifallcommonelse\gobbleoneargument\firstofonearguments} - -%D \macros -%D {DOIF,DOIFELSE,DOIFNOT} -%D -%D \TEX\ is case sensitive. When comparing arguments, this -%D feature sometimes is less desirable, for instance when we -%D compare filenames. The next three alternatives upcase their -%D arguments before comparing them. -%D -%D \starttyping -%D \DOIF {string1} {string2} {...} -%D \DOIFNOT {string1} {string2} {...} -%D \DOIFELSE {string1} {string2} {then ...}{else ...} -%D \stoptyping -%D -%D We have to use a two||step implementation, because the -%D expansion has to take place outside \type{\uppercase}. - -\def\p!DOIF#1#2% - {\uppercase{\ifinstringelse{$#1$}{$#2$}}% - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\def\p!DOIFNOT#1#2% - {\uppercase{\ifinstringelse{$#1$}{$#2$}}% - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -\def\p!DOIFELSE#1#2% - {\uppercase{\ifinstringelse{$#1$}{$#2$}}% - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\def\p!DOIFINSTRINGELSE#1#2% - {\uppercase{\ifinstringelse{#1}{#2}}% - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\def\DOIF {\ExpandBothAfter\p!DOIF} -\def\DOIFNOT {\ExpandBothAfter\p!DOIFNOT} -\def\DOIFELSE {\ExpandBothAfter\p!DOIFELSE} -\def\DOIFINSTRINGELSE {\ExpandBothAfter\p!DOIFINSTRINGELSE} - -%D \macros -%D {dosingleargumentwithset, -%D dodoubleargumentwithset,dodoubleemptywithset, -%D dotripleargumentwithset,dotripleemptywithset} -%D -%D These maybe too mysterious macros enable us to handle more -%D than one setup at once. -%D -%D \starttyping -%D \dosingleargumentwithset \command[#1] -%D \dodoubleargumentwithset \command[#1][#2] -%D \dotripleargumentwithset \command[#1][#2][#3] -%D \dodoubleemptywithset \command[#1][#2] -%D \dotripleemptywithset \command[#1][#2][#3] -%D \stoptyping -%D -%D The first macro calls \type{\command[##1]} for each string -%D in the set~\type{#1}. The second one calls for -%D \type{\commando[##1][#2]} and the third, well one may guess. -%D These commands support constructions like: -%D -%D \starttyping -%D \def\dodefinesomething[#1][#2]% -%D {\getparameters[\??xx#1][#2]} -%D -%D \def\definesomething% -%D {\dodoubleargumentwithset\dodefinesomething} -%D \stoptyping -%D -%D Which accepts calls like: -%D -%D \starttyping -%D \definesomething[alfa,beta,...][variable=...,...] -%D \stoptyping -%D -%D Now a whole bunch of variables like \type{\@@xxalfavariable} -%D and \type{\@@xxbetavariable} is defined. - -\def\dodoublewithset#1#2% - {\def\dododoublewithset[##1][##2]% - {\doifsomething{##1} - {\def\dodododoublewithset####1{#2[####1][##2]}% - \processcommalist[##1]\dodododoublewithset}}% - #1\dododoublewithset} - -\def\dodoubleemptywithset {\dodoublewithset\dodoubleempty} -\def\dodoubleargumentwithset{\dodoublewithset\dodoubleargument} - -\def\dotriplewithset#1#2% - {\def\dodotriplewithset[##1][##2][##3]% - {\doifsomething{##1} - {\def\dododotriplewithset####1{#2[####1][##2][##3]}% - \processcommalist[##1]\dododotriplewithset}}% - #1\dodotriplewithset} - -\def\dotripleemptywithset {\dotriplewithset\dotripleempty} -\def\dotripleargumentwithset{\dotriplewithset\dotripleargument} - -%D \macros -%D {stripcharacters,stripspaces} -%D -%D The next command was needed first when we implemented -%D the \CONTEXT\ interactivity macros. When we use labeled -%D destinations, we often cannot use all the characters we -%D want. We therefore strip some of the troublemakers, like -%D spaces, from the labels before we write them to the -%D \DVI||file, which passes them to for instance a PostScript -%D file. -%D -%D \starttyping -%D \stripspaces\from\one\to\two -%D \stoptyping -%D -%D Both the old string \type{\one} and the new one \type{\two} -%D are expanded. This command is a special case of: -%D -%D \starttyping -%D \stripcharacter\char\from\one\to\two -%D \stoptyping -%D -%D As we can see below, spaces following a control sequence are -%D to enclosed in \type{{}}. - -% keep this one: -% -% \def\stripcharacter#1\from#2\to#3% -% {\def\dostripcharacter##1#1##2\end -% {\edef\!!strippedstring{\!!strippedstring##1}% -% \doifnotempty{##2}{\dostripcharacter##2\end}}% -% \let\!!strippedstring\empty -% \edef\!!stringa{#2}% -% \@EA\dostripcharacter\!!stringa#1\end -% \dodoglobal\let#3\!!strippedstring} -% -% the following is better (comes from syst-loc): - -\def\stripcharacter#1\from#2\to#3% - {\def\dostripcharacter##1#1##2\end - {\edef\!!strippedstring{\!!strippedstring##1}% - \doifnotempty{##2}{\dostripcharacter##2\end}}% - \let\!!strippedstring\empty - \edef\!!stringa{#2}% - \@EA\dostripcharacter\!!stringa#1\end - \dodoglobal\let#3\!!strippedstring} - -\def\stripspaces\from#1\to#2% will become \unspacestring#1\from#2 - {\stripcharacter{ }\from#1\to#2} - -%D \macros -%D {unspacestring} -%D -%D The next macro does the same but is more compatible with other macros, -%D like \type {\convert...}. - -\def\unspacestring#1\to#2% - {\stripcharacter{ }\from#1\to#2} - -%D \macros -%D {executeifdefined} -%D -%D \CONTEXT\ uses one auxiliary file for all data concerning -%D tables of contents, references, two||pass optimizations, -%D sorted lists etc. This file is loaded as many times as -%D needed. During such a pass we skip the commands thate are of -%D no use at that moment. Because we don't want to come into -%D trouble with undefined auxiliary commands, we call the -%D macros in a way similar to \type{\getvalue}. The next macro -%D take care of such executions and when not defined, gobbles -%D the unwanted arguments. -%D -%D \starttyping -%D \executeifdefined{name}\gobbleoneargument -%D \stoptyping -%D -%D We can of course gobble more arguments using the -%D appropriate gobbling command. - -\newif\ifexecuted % general purpose - -\def\executeifdefined#1#2% - {\ifundefined{#1}% - \def\next{#2}% - \else - \def\next{\getvalue{#1}}% - \fi - \next} - -%D Just for fun I times the next alternative: it was roughly -%D timed about 15\% faster than the default (10+ sec to 9 sec)! - -\beginTEX - -\def\executeifdefined#1% #2 / never change this one again - {\ifundefined{#1}% - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi - {\csname#1\endcsname}} - -\endTEX - -\beginETEX - -% \def\executeifdefined#1% #2 / never change this one again -% {\ifcsname#1\endcsname -% \expandafter\firstoftwoarguments -% \else -% \expandafter\secondoftwoarguments -% \fi -% {\csname#1\endcsname}} - -\def\executeifdefined#1% #2 / never change this one again - {\ifcsname#1\endcsname - \csname#1\expandafter\expandafter\expandafter\endcsname\expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -\endETEX - -% \letvalue{f }\firstofoneargument \def\executeifdefined#1{\csname\ifcsname#1\endcsname#1\else f \fi\endcsname} - -%D This one also has the advantage that it is fully -%D expandable and that it can be used after an assignment. - -%D \macros -%D {executeifdefinedcs} -%D -%D An also fully expandable variant is the following: -%D -%D \starttyping -%D \executeifdefinedcs{a}{b} -%D \stoptyping -%D -%D In dit geval zijn beide argumenten csnames. - -\def\executeifdefinedcs#1#2% - {\csname\ifundefined{#1}#2\else#1\fi\endcsname} - -%D We considered an alternative implementation accepting -%D commands directly, like: -%D -%D \starttyping -%D \executeifdefined\name\gobblefivearguments -%D \stoptyping -%D -%D For the moment we don't need this one, so we stick to the -%D faster one. - -%D \macros -%D {executeandforget} -%D -%D The following macros were requested by Simon. Watch the -%D global variant. -%D -%D \starttyping -%D \executeandforget\SomeCommand -%D \doglobal\executeandforget\AnotherCommand -%D \stoptyping - -\def\executeandforget#1% - {\global\let\@@expanded#1% - \dodoglobal\let#1\relax - \@@expanded} - -%D \macros -%D {doifsomespaceelse} -%D -%D The next command checks a string on the presence of a space -%D and executed a command accordingly. -%D -%D \starttyping -%D \doifsomespaceelse {tekst} {then ...} {else ...} -%D \stoptyping -%D -%D We use this command in \CONTEXT\ for determing if an -%D argument must be broken into words when made interactive. -%D Watch the use of \type{\noexpand}. - -%D Is this one still needed? - -% \long\def\doifsomespaceelse#1#2#3% -% {\def\p!doifsomespaceelse##1 ##2##3\war% -% {\if\noexpand##2@#3\else#2\fi}% -% \p!doifsomespaceelse#1 @ @\war} - -\def\p!doifsomespaceelse#1 #2#3\war{\if\noexpand#2@} - -\long\def\doifsomespaceelse#1% % #2#3% - {\p!doifsomespaceelse#1 @ @\war % #3\else#2\fi} - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} - -%D \macros -%D {adaptdimension,balancedimensions} -%D -%D Again we introduce some macros that are closely related to -%D an interface aspect of \CONTEXT. The first command can be -%D used to adapt a \DIMENSION. -%D -%D \starttyping -%D \adaptdimension {dimension} {value} -%D \stoptyping -%D -%D When the value is preceed by a \type{+} or minus, the -%D dimension is advanced accordingly, otherwise it gets the -%D value. - -% \def\doadaptdimension#1#2\\#3\\% -% {\if#1+% -% \dodoglobal\advance#3 #1#2\relax -% \else\if#1-% -% \dodoglobal\advance#3 #1#2\relax -% \else -% \dodoglobal#3=#1#2\relax -% \fi\fi} -% -% more fuzzy but also more efficient - -\def\doadaptdimension#1#2\\#3\\% - {\if#1+% - \dodoglobal\advance - \else\if#1-% - \dodoglobal\advance - \else - \dodoglobal - \fi\fi - #3 #1#2\relax} - -\def\adaptdimension#1#2% - {\expandafter\doadaptdimension#2\\#1\\} - -%D A second command takes two \DIMENSIONS. Both are adapted, -%D depending on the sign of the given value. -%D maat. This time we take the value as it is, and don't look -%D explicitly at the preceding sign. -%D -%D \starttyping -%D \balancedimensions {dimension 1} {dimension 2} {value} -%D \stoptyping -%D -%D When a positive value is given, the first dimension is -%D incremented, the second ond is decremented. A negative value -%D has the opposite result. - -\def\balancedimensions#1#2#3% - {\scratchdimen#3\relax - \redoglobal\advance#1 \scratchdimen - \dodoglobal\advance#2 -\scratchdimen} - -%D Both commands can be preceded by \type{\doglobal}. Here we -%D use \type{\redo} first, because \type{\dodo} resets the -%D global character. - -%D \macros -%D {processseparatedlist} -%D -%D Maybe a bit late, but here is a more general version of the -%D \type{\processcommalist} command. This time we don't handle -%D nesting but accept arbitrary seperators. -%D -%D \starttyping -%D \processseparatedlist[list][separator]\command -%D \stoptyping -%D -%D One can think of things like: -%D -%D \starttyping -%D \processseparatedlist[alfa+beta+gamma][+]\message -%D \stoptyping - -%D First we show the simple alternative: -%D -%D \starttyping -%D \def\processseparatedlist[#1][#2]#3% -%D {\def\doprocessseparatedlist##1##2#2% -%D {\if]##1% -%D \let\next=\relax -%D \else\if]##2% -%D \let\next=\relax -%D \else\ifx\blankspace##2% -%D #3{##1}% -%D \let\next=\doprocessseparatedlist -%D \else -%D #3{##1##2}% -%D \let\next=\doprocessseparatedlist -%D \fi\fi\fi -%D \next}% -%D \doprocessseparatedlist#1#2]#2} -%D \stoptyping -%D -%D However, we want to handle all situations, like: -%D -%D \startbuffer -%D \processseparatedlist[{aap noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii} -%D \processseparatedlist[{aap} {noot}][ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii} -%D \processseparatedlist[aap {noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii} -%D \processseparatedlist[aap noot] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii} -%D \stopbuffer -%D -%D \typebuffer \getbuffer -%D -%D Therefore we smuggle a \type {\relax} in front of the -%D argument, which we remove afterwards. - -% \def\doprocessseparatedlist#1]#2[#3]#4% -% {\def\dodoprocessseparatedlist##1##2#3% -% {\if]##1% -% \let\dodoprocessseparatedlist\relax -% \else\if]##2% -% \let\dodoprocessseparatedlist\relax -% \else\ifx\blankspace##2% -% #4{##1}% -% \else -% #4{##1##2}% -% \fi\fi\fi -% \dodoprocessseparatedlist}% -% \@EA\dodoprocessseparatedlist\gobbleoneargument#1#3]#3} - -% testcase Vit Zyka: -% -% \def\Do#1{(#1)} -% 1\processseparatedlist[{aap noot}] [ ]\Do \par -% 2\processseparatedlist[{aap} {noot}][ ]\Do \par -% 3\processseparatedlist[aap {noot}] [ ]\Do \par -% 4\processseparatedlist[aap noot] [ ]\Do \par -% 5\processseparatedlist[aap;noot;a noot;noot a; noot a noot][;]\Do \par -% 6\processseparatedlist[][;]\Do \par -% 7\processseparatedlist[;][;]\Do \par - -\def\doprocessseparatedlist#1]#2[#3]#4% - {\def\dodoprocessseparatedlist##1##2#3% - {\def\!!stringa{##2}% suggested by VZ - \if]##1% - \let\dodoprocessseparatedlist\relax - \else\ifx\blankspace\!!stringa - #4{##1}% - \else\if]##2% - \let\dodoprocessseparatedlist\relax - \else - #4{##1##2}% - \fi\fi\fi - \dodoprocessseparatedlist}% - \@EA\dodoprocessseparatedlist\gobbleoneargument#1#3]#3} - -\def\processseparatedlist[% - {\doprocessseparatedlist\relax} - -%D \macros -%D {processlist} -%D -%D An even more general list processing macro is the -%D following one: -%D -%D \starttyping -%D \processlist{beginsym}{endsym}{separator}\docommand list -%D \stoptyping -%D -%D This one supports arbitrary open and close symbols as well -%D as user defined separators. -%D -%D \starttyping -%D \processlist(){=>}\docommand(a=>b=>c=>d) -%D \stoptyping - -\long\def\processlist#1#2#3#4% no blank skipping ! - {\def\doprocesslist##1#2% - {\def\dodoprocesslist####1####2#3% - {\ifx#2####1% - \let\dodoprocesslist\relax - \else\ifx#2####2% - \let\dodoprocesslist\relax - \else - #4{####1####2}% - \fi\fi - \dodoprocesslist}% - \expandafter\dodoprocesslist\gobbleoneargument##1#3#2#3}% - \def\dodoprocesslist#1% - {\doprocesslist\relax}% - \dodoprocesslist} - -% %D \macros -% %D {dohonorgroupedargument} -% %D -% %D The previous macro uses yet another auxiliary macro to -% %D handle the special case. -% -% \def\dohonorgroupedargument#1[% -% {\doifnextbgroupelse{\dodohonorgroupedargument#1}{#1[}} -% -% \def\dodohonorgroupedargument#1#2% -% {#1[{{#2}}} - -%D \macros -%D {processassignlist} -%D -%D Is possible to combine an assignment list with one -%D containing keywords. Assignments are treated accordingly, -%D keywords are treated by \type{\command}. -%D -%D \starttyping -%D \processassignlist[...=...,...=...,...]\commando -%D \stoptyping -%D -%D This command can be integrated in \type{\getparameters}, but -%D we decided best not to do so. - -\def\processassignlist#1[#2]#3% - {\def\p!dodogetparameter[##1=##2=##3]% - {\doifnot{##3}\relax{#3{##1}}}% - \def\p!dogetparameter##1% - {\p!dodogetparameter[##1==\relax]}% - \processcommalist[#2]\p!dogetparameter} - -% too ugly -% -% %D \macros -% %D {DoAfterFi,DoAfterFiFi} -% %D -% %D Sometimes \type{\fi}'s can get into the way. We can reach -% %D over such a troublemaker with: -% %D -% %D \starttyping -% %D \DoAfterFi{some commands} -% %D \DoAfterFiFi{some commands} -% %D \stoptyping -% %D -% %D It saves us a \type{\next} construction. Skipping -% %D \type{\else...\fi} is more tricky, so this one is not -% %D provided. -% -% \def\DoAfterFi#1\fi{\fi#1} -% \def\DoAfterFiFi#1\fi#2\fi{\fi\fi#1} - -%D \macros -%D {untextargument -%D untexcommand} -%D -%D When manipulating data(bases) and for instance generating -%D index entries, the next three macros can be of help: -%D -%D \starttyping -%D \untextargument{...}\to\name -%D \untexcommand {...}\to\name -%D \stoptyping -%D -%D They remove braces and backslashes and give us something to -%D sort. - -\def\untexsomething - {\begingroup - \catcode`\{=\@@ignore - \catcode`\}=\@@ignore - \escapechar\minusone - \dountexsomething} - -\long\def\dountexsomething#1#2\to#3% - {\doglobal#1#2\to\untexedargument - \endgroup - \let#3\untexedargument} - -\def\untexargument{\untexsomething\convertargument} -\def\untexcommand {\untexsomething\convertcommand} - -%D \macros -%D {ScaledPointsToBigPoints,ScaledPointsToWholeBigPoints} -%D -%D One characteristic of \POSTSCRIPT\ and \PDF\ is that both -%D used big points (\TEX's bp). The next macros convert points -%D and scaled points into big points. -%D -%D \starttyping -%D \ScaledPointsToBigPoints {number} \target -%D \ScaledPointsToWholeBigPoints {number} \target -%D \stoptyping -%D -%D The magic factor $72/72.27$ can be found in most \TEX\ -%D related books. - -% \def\ScaledPointsToBigPoints #1{\PointsToBigPoints {#1sp}} -% \def\ScaledPointsToWholeBigPoints#1{\PointsToWholeBigPoints{#1sp}} -% -% \def\PointsToBigPoints#1#2% -% {\scratchdimen#1% -% \scratchdimen.996264\scratchdimen -% \edef#2{\withoutpt\the\scratchdimen}} -% -% \def\PointsToWholeBigPoints#1#2% -% {\scratchdimen#1% -% \scratchdimen.996264\scratchdimen -% \scratchcounter\scratchdimen -% \advance\scratchcounter \medcard -% \divide\scratchcounter \maxcard -% \edef#2{\the\scratchcounter}} - -% \PointsToBigPoints{10.53940pt}\test \test -% \PointsToBigPoints{10.53941pt}\test \test -% \PointsToBigPoints{10.53942pt}\test \test - -% \PointsToWholeBigPoints{10.53940pt}\test \test -% \PointsToWholeBigPoints{10.53941pt}\test \test -% \PointsToWholeBigPoints{10.53942pt}\test \test - -\beginTEX - - \def\PointsToBigPoints#1#2% - {\scratchdimen#1% - \scratchdimen.996264\scratchdimen - \edef#2{\withoutpt\the\scratchdimen}} - - \def\PointsToWholeBigPoints#1#2% - {\scratchdimen#1% - \scratchdimen.996264\scratchdimen - \scratchcounter\scratchdimen - \advance\scratchcounter \medcard - \divide\scratchcounter \maxcard - \edef#2{\the\scratchcounter}} - -\endTEX - -\beginETEX \dimexpr \numexpr - -% \def\PointsToBigPoints#1#2% -% {\edef#2{\withoutpt\the\dimexpr(.996264\dimexpr(#1))}} - -% \def\PointsToWholeBigPoints#1#2% -% {\edef#2{\the\numexpr(\numexpr(\dimexpr(.996264\dimexpr(#1)))/\maxcard)}} - - \def\PointsToBigPoints#1#2% - {\edef#2{\withoutpt\the\dimexpr.996264\dimexpr#1\relax\relax}} - - \def\PointsToWholeBigPoints#1#2% - {\edef#2{\the\numexpr\dimexpr.996264\dimexpr#1\relax\relax/\maxcard\relax}} - -\endETEX - -\def\ScaledPointsToBigPoints #1{\PointsToBigPoints {\number#1\scaledpoint}} -\def\ScaledPointsToWholeBigPoints#1{\PointsToWholeBigPoints{\number#1\scaledpoint}} - -%D \macros -%D {PointsToReal} -%D -%D Points can be stripped from their suffix by using -%D \type{\withoutpt}. The next macro enveloppes this macro. -%D -%D \starttyping -%D \PointsToReal {dimension} \target -%D \stoptyping - -\def\PointsToReal#1#2% - {\scratchdimen#1% - \edef#2{\withoutpt\the\scratchdimen}} - -%D \macros -%D {dontleavehmode} -%D -%D Sometimes when we enter a paragraph with some command, the -%D first token gets the whole first line. We can prevent this -%D by saying: -%D -%D \starttyping -%D \dontleavehmode -%D \stoptyping -%D -%D This command is used in for instance the language module -%D \type{lang-ini}. The first version was: -%D -%D \starttyping -%D \def\dontleavehmode{\ifhmode\else\ifmmode\else$ $\fi\fi} -%D \stoptyping -%D -%D Next, Taco came with a better alternative (using mathsurround): -%D -%D \starttyping -%D \def\dontleavehmode -%D {\ifhmode\else \ifmmode\else -%D {\mathsurround\zeropoint\everymath\emptytoks$ $}% -%D \fi \fi} -%D \stoptyping -%D -%D And finaly we got the following alternative, one that avoids -%D interfering grouping at the cost of a box. - -\newbox\@@dlhbox - -\unexpanded \def\dontleavehmode - {\ifhmode\else \ifmmode\else - \setbox\@@dlhbox\hbox{\mathsurround\zeropoint\everymath\emptytoks$ $}\unhbox\@@dlhbox - \fi \fi} - -% Also ok, but more sensitive to lookahead expansion is: -% -% \def\dontleavehmode{\ifvmode \indent \fi} -% -% which assumes indent is kept unchanged. Protecting the macro is only -% possible in etex (watch out: \unexpanded in context is eq to \protected). -% -% \unexpanded \def\dontleavehmode{\ifvmode \indent \fi} % functional spec TH - -%D But, if you run a recent version of \TEX, we can use the new -%D primitive: - -\ifx\normalquitvmode\undefined \else \let\dontleavehmode\normalquitvmode \fi - -%D \macros -%D {uppercasestring,lowercasestring} -%D -%D The names tell what they do: -%D -%D \starttyping -%D \uppercasestring somestring\to\somestring -%D \lowercasestring somestring\to\somestring -%D \stoptyping -%D -%D the first argument may be a \type{\macro}. - -\def\uppercasestring#1\to#2% first @EA redundant - {\edef#2{#1}\@EA\uppercase\@EA{\@EA\dodoglobal\@EA\edef\@EA#2\@EA{#2}}} - -\def\lowercasestring#1\to#2% first @EA redundant - {\edef#2{#1}\@EA\lowercase\@EA{\@EA\dodoglobal\@EA\edef\@EA#2\@EA{#2}}} - -%D \macros -%D {handletokens} -%D -%D With the next macro we enter a critical area of macro -%D expansion. What we want is a macro that looks like: -%D -%D \starttyping -%D \handletokens some tokens\with \somemacro -%D \stoptyping -%D -%D At first sight the next implementation will suffice, but -%D running this one shows that we loose the spaces. This is no -%D surprise because we grab arguments and spaces preceding those -%D are just ignored. -%D -%D \starttyping -%D \def\nohandletokens#1\end% -%D {} -%D -%D \def\dohandletokens#1#2\end% -%D {\ifx#1\endoftoken -%D \expandafter\nohandletokens -%D \else -%D \docommand{#1}% -%D \expandafter\dohandletokens -%D \fi -%D #2\end} -%D -%D \long\def\handletokens#1\with#2% -%D {\let\docommand=#2\relax -%D \dohandletokens#1\endoftoken\end} -%D \stoptyping -%D -%D A second approach therefore grabs the individual characters -%D by using \type{\afterassignment}, in which case the space is -%D read in as space. -%D -%D \starttyping -%D \def\dodohandletokens% -%D {\ifx\next\end \else -%D \docommand{\next}% -%D \expandafter\dohandletokens -%D \fi} -%D -%D \def\dohandletokens -%D {\afterassignment\dodohandletokens\let\next= } -%D -%D \long\def\handletokens#1\with#2% -%D {\let\docommand=#2% -%D \dohandletokens#1\end} -%D \stoptyping - -%D A bonus example: -%D -%D \starttyping -%D \hbox{\handletokens tekst en meer tekst\with\ruledhbox} -%D -%D \def\weetikveel#1{\if#1\blankspace\space\else\ruledhbox{#1}\fi} -%D -%D \hbox{\handletokens tekst en meer tekst\with\weetikveel} -%D \stoptyping - -%D \macros -%D {counttoken,counttokens} -%D -%D For the few occasions that we want to know the number of -%D specific tokens in a string, we can use: -%D -%D \starttyping -%D \counttoken token\in string\to \count -%D \counttokens string\to \count -%D \stoptyping -%D -%D This macro, that for instance is used in \type{cont-tab}, -%D takes a real counter. The macro can be preceded by \type -%D {\doglobal}. - -\def\counttoken#1\in#2\to#3% - {\redoglobal#3\zerocount - \def\!!stringa{#1}% - \def\!!stringb{\end}% - \def\docounttoken##1% obeys {} - {\def\!!stringc{##1}% - \ifx\!!stringb\!!stringc \else - \ifx\!!stringa\!!stringc - \dodoglobal\advance#3 \plusone - \fi - \expandafter\docounttoken - \fi}% - \docounttoken#2\end - \resetglobal} - -% \def\counttoken#1\in#2\to#3% -% {\redoglobal#3\zerocount -% \def\!!stringa{#1}% -% \def\docounttoken##1% obeys {} -% {\def\!!stringb{##1}% -% \ifx\!!stringa\!!stringb -% \dodoglobal\advance#3\plusone -% \fi}% -% \handletokens#1\with\docounttoken -% \resetglobal} - -\def\counttokens#1\to#2% - {\redoglobal#2\zerocount - \def\docounttoken##1{\dodoglobal\advance#2\plusone}% - \handletokens#1\with\docounttoken - \resetglobal} - -%D \macros -%D {splitofftokens} -%D -%D Running this one not always gives the expected results. -%D Consider for instance the macro for which I originally -%D wrote this token handler. - -\long\def\splitofftokens#1\from#2\to#3% - {\ifnum#1>\zerocount - \scratchcounter#1\relax - \def\dosplitofftokens##1% - {\ifnum\scratchcounter>\zerocount - \advance\scratchcounter \minusone - \edef#3{#3##1}% - \fi}% - % \let#3\empty % #3 can be #2, so: - \@EA\let\@EA#3\@EA\empty - \@EA\handletokens#2\with\dosplitofftokens - \else - \edef#3{#2}% - \fi} - -%D This macro can be called like: -%D -%D \startbuffer[example] -%D \splitofftokens10\from01234567 890123456789\to\test [\test] -%D \stopbuffer -%D -%D However, the characters that we expect to find in -%D \type{\test} just don;t show up there. The reason for this -%D is not that logical but follows from \TEX's sometimes -%D mysterious way of expanding. Look at this: -%D -%D \startbuffer[next] -%D \def\next{a} \edef\test{\next} [\test] -%D \let\next=b \edef\test{\test\next} [\test] -%D \let\next=c \edef\test{\next} [\test] -%D \let\next=d \edef\test{\test\next} [\test] -%D \let\next=e \@EA\edef\@EA\test\@EA{\test\next} [\test] -%D \stopbuffer -%D -%D \typebuffer[next] -%D -%D Careful reading shows that inside an \type{\edef} macro's -%D that are \type{\let} are not expanded! -%D -%D \unprotect\getbuffer[next]\protect -%D -%D That's why we finally end up with a macro that looks -%D ahead by using an assignment, this time by using \type -%D {\futurelet}, and grabbing an argument as well. That -%D way we can handle the sentinal, a blank space and grouped -%D tokens. - -\def\dohandletokens % \nexthandledtoken is part of interface - {\futurelet\nexthandledtoken\dodohandletokens} - -\long\def\handletokens#1\with#2% - {\gdef\dododohandletokens{#2}% permits more complex #2's - \dohandletokens#1\end} - -%D A previous version said \type{\docommand=#2}, but to enable -%D use in alignments, I decided to use another placeholder, one -%D that is not sensitive to the global assignment. - -%D This alternatives does not handle grouped tokens well, so -%D next we had (for a short moment): -%D -%D \starttyping -%D \def\dodohandletokens#1% -%D {\ifx\nexthandledtoken\blankspace -%D \dododohandletokens{ }% -%D \fi -%D \ifx#1\end \else -%D \dododohandletokens{#1}% -%D \expandafter\dohandletokens -%D \fi} -%D \stoptyping -%D -%D This one failed on a trailing space, something we -%D encounter in \JAVASCRIPT\ cleaning. -%D -%D \starttyping -%D \def\dodohandletokens#1% -%D {\ifx\nexthandledtoken\blankspace -%D \dododohandletokens{ }% -%D \fi -%D \ifx\nexthandledtoken\end \else -%D \dododohandletokens{#1}% -%D \expandafter\dohandletokens -%D \fi} -%D \stoptyping -%D -%D So, now we have: - -\def\dodohandletokens % can be sped up - {\ifx\nexthandledtoken\blankspace - \def\next * {\dododohandletokens{ }\dohandletokens}% - \else\ifx\nexthandledtoken\end - \let\next\gobbletwoarguments - \else - \long\def\next *##1{\dododohandletokens{##1}\dohandletokens}% - \fi\fi - \next *} - -%D This macro is tested on: -%D -%D \def\xxx#1{[#1]} -%D -%D \startlines -%D \handletokens abc\with\xxx -%D \handletokens a b c\with\xxx -%D \handletokens a b c\with\xxx -%D \handletokens a{bc}d\with\xxx -%D \handletokens a\space bc \with\xxx -%D \stoplines -%D -%D And our previous example shows up as: -%D -%D \getbuffer[example] - -%D \macros -%D {iftrialtypesetting, ifvisible} -%D -%D The next boolean is at first sight a strange one. Sometimes -%D one does a trial typesetting run, for instance to determine -%D dimensions. Some mechanisms, like object inclusion, can fail -%D on such trials. Temporary setting the next boolean to true, -%D helps a lot. The second boolena can be used to inhibit -%D processing completely. - -\newif\iftrialtypesetting \trialtypesettingfalse -\newif\ifvisible \visibletrue - -%D \macros -%D {startlocal, startglobal} -%D -%D The next four macros are rather self explaining: -%D -%D \starttyping -%D \startlocal -%D whatever assignments -%D \stoplocal -%D -%D \startglobal -%D whatever assignments -%D \stopglobal -%D \stoptyping -%D -%D These macros are meant for those who know the difference -%D between local and global assignments and are aware of the -%D possible unwanted side effect - -\def\dostartglobaldefs#1#2% - {\edef\!!stringa{\the\globaldefs}% - \ifnum\globaldefs#10 - \globaldefs-\globaldefs - \fi - \advance\globaldefs#21 - \letvalue{@gd@\the\globaldefs}\!!stringa} - -\def\dostopglobaldefs% - {\doifdefinedelse{@gd@\the\globaldefs} - {\globaldefs\getvalue{@gd@\the\globaldefs}\relax} - {\globaldefs\zerocount}} - -\def\startlocal {\dostartglobaldefs>-} -\def\stoplocal {\dostopglobaldefs} -\def\startglobal {\dostartglobaldefs<+} -\def\stopglobal {\dostopglobaldefs} - -%D \macros -%D {twodigitrounding} -%D -%D When using \type {\special}s or \type {\pdfliteral}s, it -%D sometimes makes sense to limit the precission. The next -%D macro rounds a real number to two digits. It takes one -%D argument and only works in \ETEX. - -\beginTEX - - \let\integerrounding \firstofoneargument - \let\onedigitrounding \firstofoneargument - \let\twodigitrounding \firstofoneargument - \let\threedigitrounding\firstofoneargument - -\endTEX - -\beginETEX \dimexpr - - \def\dointegerrounding #1.#2\relax {#1} - \def\doonedigitrounding #1.#2#3\relax {\ifx#2*#1\else#1.#2\fi} - \def\dotwodigitrounding #1.#2#3#4\relax {\ifx#2*#1\else#1.#2#3\fi} - \def\dothreedigitrounding#1.#2#3#4#5\relax{\ifx#2*#1\else#1.#2#3#4\fi} - - \def\integerrounding#1% - {\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr#1\points+.5\points \relax .\relax} - \def\onedigitrounding#1% - {\@EA\@EA\@EA\doonedigitrounding \@EA\WITHOUTPT\the\dimexpr#1\points+.05\points \relax 00.*0\relax} - \def\twodigitrounding#1% - {\@EA\@EA\@EA\dotwodigitrounding \@EA\WITHOUTPT\the\dimexpr#1\points+.005\points \relax 000.*00\relax} - \def\threedigitrounding#1% - {\@EA\@EA\@EA\dothreedigitrounding\@EA\WITHOUTPT\the\dimexpr#1\points+.0005\points\relax0000.*00\relax} - -% \def\dointegerrounding #1.#2\relax {#1} -% \def\doonedigitrounding #1.#2#3\relax {#1.#2} -% \def\dotwodigitrounding #1.#2#3#4\relax {#1.#2#3} -% \def\dothreedigitrounding#1.#2#3#4#5\relax{#1.#2#3#4} - -% \def\integerrounding #1{\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr #1\points+.5\points\relax \relax} -% \def\onedigitrounding #1{\@EA\@EA\@EA\doonedigitrounding \@EA\WITHOUTPT\the\dimexpr #1\points+.05\points\relax 0\relax} -% \def\twodigitrounding #1{\@EA\@EA\@EA\dotwodigitrounding \@EA\WITHOUTPT\the\dimexpr #1\points+.005\points\relax 00\relax} -% \def\threedigitrounding#1{\@EA\@EA\@EA\dothreedigitrounding\@EA\WITHOUTPT\the\dimexpr#1\points+.0005\points\relax000\relax} - -% \def\integerroundeddimen #1{\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr #1+.5\points\relax \relax} -% \def\onedigitroundeddimen #1{\@EA\@EA\@EA\doonedigitrounding \@EA\WITHOUTPT\the\dimexpr #1+.05\points\relax 0\relax} -% \def\twodigitroundeddimen #1{\@EA\@EA\@EA\dotwodigitrounding \@EA\WITHOUTPT\the\dimexpr #1+.005\points\relax 00\relax} -% \def\threedigitroundeddimen#1{\@EA\@EA\@EA\dothreedigitrounding\@EA\WITHOUTPT\the\dimexpr#1+.0005\points\relax000\relax} - -\endETEX - -%D \macros -%D {processcontent} -%D -%D This is the first occasion where \TEX\ and \ETEX\ are no -%D longer compatible, although in many cases things go ok. -%D Beware of verbatim, i.e. catcode changes. -%D -%D \starttyping -%D \def\starthans% -%D {\processcontent{stophans}\test{\message{\test}\wait}} -%D \stoptyping -%D -%D This macro is first used in the tabulation macros. - -\def\processcontent#1% - {\begingroup\@EA\doprocesscontent\csname#1\endcsname} - -%\beginTEX - -\def\doprocesscontent#1#2#3% - {\long\def\doprocesscontent##1#1% - {\endgroup\long\def#2{##1}#3}% - \doprocesscontent} - -%\endTEX - -% Hm. Side effect, spaces after \type{\test} in verbatim. -% must set eof token - -%\beginETEX \scantokens -% -%\def\doprocesscontent#1#2#3% -% {\long\def\doprocesscontent##1#1% -% {\egroup\long\def#2{\scantokens{##1}}#3}% -% \doprocesscontent} -% -%\endETEX - -%D \macros -%D {dogobblesingleempty, dogobbledoubleempty} -%D -%D These two macros savely grab and dispose two arguments. - -\def\dogobblesingleempty{\dosingleempty\dodogobblesingleempty} -\def\dogobbledoubleempty{\dodoubleempty\dodogobbledoubleempty} - -\def\dodogobblesingleempty [#1]{} -\def\dodogobbledoubleempty[#1][#2]{} - -\let\gobblesingleempty\dogobblesingleempty % also used -\let\gobbledoubleempty\dogobbledoubleempty % also used - -%D \macros -%D {sortcommalist,sortcommacommand, -%D donumericcompare,comparedresult} -%D -%D Sometimes we need to sort a commalist, so here is Taco's -%D solution. This will in many cases be a list that is stored -%D in a \type{\csname}, so both commalist and commacommands are -%D supported. The sorting algorithm is very simple, so the list -%D should not be too long or sorting will be very slow. -%D -%D \starttyping -%D \sortcommalist[10,2,4,5,6,1,2,3,4,10,20]\donumericcompare -%D -%D \def\test{10,2,4,5,6,1,2,3,4,10,20} -%D -%D \sortcommacommand[\test]\donumericcompare -%D \stoptyping -%D -%D In both cases, the result is available in the macro \type -%D {\sortedcommalist}. -%D -%D Parameter \type{#2} is a macro that should accept two -%D parameters, and it has to decide which one is larger, by -%D setting the counter \type{\comparedresult} to~0 (for equal), -%D 1~(if it's first argument is larger), or~2 (if it's second -%D argument is larger). -%D -%D As said, these macro are largely written by Taco, and are -%D (maybe therefore) also the first application of \type -%D {\replaceincommalist}. - -\newcount\comparedresult - -\def\sortcommacommand[#1]% - {\@EA\sortcommalist\@EA[#1]} - -\def\sortcommalist[#1]#2% - {\getcommalistsize[#1]% - \ifnum\commalistsize>1 - \let\sortedcommalist\empty - \let\comparecommand#2% - \processcommalist[#1]\dosortcommacommand - \else - \def\sortedcommalist{#1}% - \fi} - -\def\dosortcommacommand#1% - {\ifx\sortedcommalist\empty - \def\sortedcommalist{#1}% - \else - \def\!!tempa{#1}% - \ifx\!!tempa\empty\else - \scratchcounter\plusone - \@EA\getcommalistsize\@EA[\sortedcommalist]% - \@EA\processcommalist\@EA[\sortedcommalist]\docompareitems - \fi - \fi} - -%D All those \type{\expandafter}'s are there because I do not -%D want to use \type{\edef}. - -\def\docompareitems#1% - {\doifnotempty{#1} - {\@EA\comparecommand\@EA{\!!tempa}{#1}\relax - %\ifcase\compareresult % equal - \ifnum\comparedresult<2 - \ifnum\scratchcounter=\commalistsize - \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist - \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}% - \fi - %\or % new element larger - % \ifnum\scratchcounter=\commalistsize - % \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist - % \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}% - % \fi - \else % old element larger - \@EA\def\@EA\newcommalistelement\@EA{\!!tempa,#1}% - \replaceincommalist\sortedcommalist\scratchcounter - \expandafter\quitcommalist - \fi}% - \advance\scratchcounter \plusone} % bug, was \minusone - -%D The macro \type{\donumericcompare} considers everything -%D that is not a number to be larger than any number. - -\def\donumericcompare#1#2% - {\doifnumberelse{#1} - {\doifnumberelse{#2} - {\ifnum#1>#2\relax - \comparedresult\plusone % #1 is larger - \else\ifnum#1<#2\relax - \comparedresult\plustwo % #2 is larger - \else - \comparedresult\zerocount % both are equal - \fi\fi} - {\comparedresult\plustwo}} - {\comparedresult\plusone}} - -%D \macros -%D {@True, @False, @Not, @And} -%D -%D Some predicate logic functions, used in for instance the -%D math module. - -\def\@True {00} -\def\@False {01} -\def\@Not #1{0\ifcase#11 \or\@EA 1\else \@EA 0\fi} -\def\@And #1#2{0\ifcase#1#2 \@EA 0\else \@EA 1\fi} - -%D \macros -%D {setdimensionwithunit, freezedimensionwithunit} -%D -%D The next assignments are all valid: -%D -%D \starttyping -%D \setdimensionwithunit\scratchdimen{10} {cm} -%D \setdimensionwithunit\scratchdimen{10cm}{cm} -%D \setdimensionwithunit\scratchdimen{10cm}{} -%D \freezedimensionwithunit\SomeWidth{\textwidth} -%D \freezedimensionwithunit\SomeDepth{\dp\strutbox} -%D \stoptyping -%D -%D As an alternative for the next macro we can use a global -%D assignment inside a box. The \type{\empty}'s permits -%D gobbling while preventing spurious \type{\relax}'s. - -\def\setdimensionwithunit#1#2#3% number unit dimension / nice trick - {\afterassignment\gobblefourarguments#1=#2#3pt\relax\empty\empty\empty\empty} - -\def\freezedimensionwithunit#1#2% - {\setdimensionwithunit\scratchdimen#1{#2}\edef#1{\the\scratchdimen}} - -%D \macros -%D {doifsometokselse} -%D -%D Not that fast I guess, but here's a way to test for token -%D registers being empty. - -\def\doifsometokselse#1% % #2#3% - {\edef\!!stringa{\the#1}% - \ifx\!!stringa\empty % #3\else#2\fi} - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} - -%D \macros -%D {startstrictinspectnextcharacter} -%D -%D This one if for Taco's bibliography module: - -\let\normalinspectnextcharacter\inspectnextcharacter - -\def\strictinspectnextcharacter% no user macro ! - {\ifx\nexttoken\charactertoken - \expandafter\!!stringa - \else - \expandafter\!!stringb - \fi} - -% better: push/pop - -\def\startstrictinspectnextcharacter - {\let\inspectnextcharacter\strictinspectnextcharacter} - -\def\stopstrictinspectnextcharacter - {\let\inspectnextcharacter\normalinspectnextcharacter} - -%D \macros -%D {gobblespacetokens} -%D -%D This macro needs a speed-up! - -%\def\gobblespacetokens -% {\doifnextcharelse\empty\donothing\donothing} % no {}\do\do ! - -\def\gobblespacetokens - {\afterassignment\nexttoken\let\nexttoken=} - -%D \macros -%D {verbatimargument} -%D -%D As the name says, this macro converts its argument to a -%D (rather safe) string. - -\def\verbatimstring#1% - {\convertargument#1\to\ascii\ascii} - -%D These are needed in ordinal number conversions: - -\def\lastdigit#1% - {\@EA\thelastdigit\number#1\relax} - -\def\thelastdigit#1#2% - {\ifx#2\relax#1\else\@EA\thelastdigit\@EA#2\fi} - -\def\lasttwodigits#1% - {\@EA\thelasttwodigits\@EA0\number#1\relax} - -\def\thelasttwodigits#1#2#3% 0 dig ... \relax - {\ifx#3\relax#1#2\else\@EA\thelasttwodigits\@EA#2\@EA#3\fi} - -%D \macros -%D {serializecommalist} -%D -%D Concatenate commalists: - -\def\serializecommalist[#1]% - {\let\serializedcommalist\empty - \def\docommand##1{\edef\serializedcommalist{\serializedcommalist##1}}% - \processcommacommand[#1]\docommand} - -%D \macros -%D {purenumber} -%D -%D Sometimes we need control over when \TEX\ stops reading a -%D number, especially in full expandable macros where using -%D \type {\relax} would lead to disasters. -%D -%D \starttyping -%D \ifodd\purenumber{...}\space ... \else ... \fi -%D \stoptyping -%D -%D Here we use a space as number delimiter in combination -%D with a space- and relax-less \type {\purenumber}. This -%D macro works ok with \type {\the}, \type {\number} as well -%D as \ETEX's \type {\numexpr}. - -\def\purenumber#1{\@EA\firstofoneargument\@EA{\number#1}} - -%D \macros -%D {filterfromvalue} -%D -%D \starttyping -%D \setvalue{xx}{{A}{B}{C}} -%D -%D \filterfromvalue{xx}{3}{3} -%D \filterfromvalue{xx}{3}{2} -%D \filterfromvalue{xx}{3}{1} -%D \stoptyping -%D -%D An alternative is to store 'max' in the list, say: -%D -%D \starttyping -%D \setvalue{xx}{3{A}{B}{C}} -%D -%D \filterfromvalues{3}{xx}{3} -%D \filterfromvalues{3}{xx}{2} -%D \filterfromvalues{3}{xx}{1} -%D \stoptyping -%D -%D I'll implement this when I'm in \quotation {writing dirty -%D macros mood}. - -\def\dofilterfromstr#1#2% max n - {\ifcase#1\or - \ifcase#2\or - \strippedcsname\firstofoneargument - \else - \strippedcsname\gobbleoneargument - \fi - \or - \ifcase#2\or - \strippedcsname\firstoftwoarguments - \or - \strippedcsname\secondoftwoarguments - \else - \strippedcsname\gobbletwoarguments - \fi - \or - \ifcase#2\or - \strippedcsname\firstofthreearguments - \or - \strippedcsname\secondofthreearguments - \or - \strippedcsname\thirdofthreearguments - \else - \strippedcsname\gobblethreearguments - \fi - \or - \ifcase#2\or - \strippedcsname\firstoffourarguments - \or - \strippedcsname\secondoffourarguments - \or - \strippedcsname\thirdoffourarguments - \or - \strippedcsname\fourthoffourarguments - \else - \strippedcsname\gobblefourarguments - \fi - \or - \ifcase#2\or - \strippedcsname\firstoffivearguments - \or - \strippedcsname\secondoffivearguments - \or - \strippedcsname\thirdoffivearguments - \or - \strippedcsname\fourthoffivearguments - \or - \strippedcsname\fifthoffivearguments - \else - \strippedcsname\gobblefivearguments - \fi - \fi} - -\def\filterfromvalue#1#2#3% value max n - {\@EA\@EAEAEA\csname % we use the fact that an - \@EA\ifx\csname#1\endcsname\relax % undefined cs has become \relax - \strippedcsname\gobbleoneargument % which we then gobble here - \else - \dofilterfromstr{#2}{#3}% - \fi - \endcsname\csname#1\endcsname} - -\def\filterfromnext#1#2% max n {..}{..}{..}{..} - {\csname\dofilterfromstr{#1}{#2}\endcsname} - -%D \macros -%D {definemeasure} -%D -%D \starttyping -%D \definemeasure[mywidth][\dimexpr(\textwidth-1cm)] -%D -%D ... \measure{mywidth} ... -%D \stoptyping - -\def\??dm{@@dm} % brrr - -\def\definemeasure - {\dodoubleargument\dodefinemeasure} - -\def\dodefinemeasure[#1][#2]% - {\setvalue{\??dm#1}{#2}} - -% #2 could be omitted, but we want to support spaces -% -% \setmeasure {x} {1cm} -% \setmeasure {xx} {1cm} -% \setmeasure {xxx}{1cm} - -\def\setmeasure #1#2{\setvalue{\??dm#1}{#2}} % quick way -\def\setemeasure#1#2{\setevalue{\??dm#1}{#2}} % quick way -\def\setgmeasure#1#2{\setgvalue{\??dm#1}{#2}} % quick way -\def\setxmeasure#1#2{\setxvalue{\??dm#1}{#2}} % quick way - -\def\measure#1% - {\ifcsname\??dm#1\endcsname\csname\??dm#1\endcsname\else\zeropoint\fi} - -%D \macros -%D {doifdimensionelse} -%D -%D This is a dirty one: we simply append a unit and discard it when needed. - -\def\doifdimensionelse#1% - {\afterassignment\dodoifdimensionelse\scratchdimen#1pt\relax} - -\def\dodoifdimensionelse#1% - {\ifx#1\relax - \expandafter\secondoftwoarguments - \else % #1=p ... t\relax - \expandafter\thirdoffourarguments - \fi} - -%D \macros -%D {comparedimension,comparedimensioneps} -%D -%D This is a dirty one: we simply append a unit and discard it when needed. - -\newdimen\roundingeps \roundingeps=10sp - -\def\comparedimension#1#2% - {\chardef\compresult - \ifdim#1<#2% - \zerocount - \else\ifdim#1<#2% - \plusone - \else - \plustwo - \fi\fi} - -\beginETEX - -\def\comparedimensioneps#1#2% - {\chardef\compresult - \ifdim\dimexpr(#1-#2)<\roudingeps - \zerocount - \else\ifdim\dimexpr(#2-#1)<\roudingeps - \zerocount - \else\ifdim#1<#2% - \plusone - \else - \plustwo - \fi\fi\fi} - -\endETEX - -\beginTEX - -\newdimen\comparedimen - -\def\comparedimensioneps#1#2% - {\comparedimen#1\advance\comparedimen-#2\relax - \chardef\compresult - \ifdim\comparedimen<\roudingeps - \zerocount - \else\ifdim-\comparedimen<\roudingeps - \zerocount - \else\ifdim#1<#2% - \plusone - \else - \plustwo - \fi\fi\fi} - -\endTEX - -\protect \endinput diff --git a/tex/context/base/syst-gen.mkii b/tex/context/base/syst-gen.mkii new file mode 100644 index 000000000..993512b74 --- /dev/null +++ b/tex/context/base/syst-gen.mkii @@ -0,0 +1,4420 @@ +%D \module +%D [ file=syst-gen, +%D version=1996.03.20, +%D title=\CONTEXT\ System Macros, +%D subtitle=General, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% nagaan : \ifinstringelse in syst-ext.tex +% do => p! dodo pp! dododo ppp! +% todo: \donetrue etc local maken + +%D The following macros are responsible for the interaction +%D with \CONTEXT. These macros have proven their use. These +%D macros are optimized as far as possible within of course, +%D the know how of the author. +%D +%D In this module we also show some of the optimizations, +%D mainly because we don't want to forget them and start doing +%D things over and over again. If showing them has a learing +%D effect for others too, we've surved another purpose too. + +%D \macros +%D {abortinputifdefined} +%D +%D Because this module can be used in a different context, we +%D want to prevent it being loaded more than once. This can be +%D done using: +%D +%D \starttyping +%D \abortinputifdefined\command +%D \stoptyping +%D +%D where \type{\command} is a command defined in the module +%D to be loaded only once. +%D +%D \starttyping +%D \def\abortinputifdefined#1% +%D {\ifx#1\undefined +%D \let\next=\relax +%D \else +%D \let\next=\endinput +%D \fi +%D \next} +%D \stoptyping +%D +%D This macro can be speed up in terms of speed as well as +%D memory. Because this is a nice example of a bit strange +%D command (\type{\endinput}), we spend some more lines on this. +%D +%D If we perform such actions directly, we can say: +%D +%D \starttyping +%D \ifx\somecommand\undefined +%D \let\next=\relax +%D \else +%D \let\next=\endinput +%D \fi +%D \next +%D \stoptyping +%D +%D We need the \type{\next} because we need to end the +%D \type{\fi}. The efficient one is: +%D +%D \starttyping +%D \ifx\somecommand\undefined +%D \else +%D \expandafter\endinput +%D \fi +%D \stoptyping +%D +%D Because \type{\endinput} comes into action after the current +%D line, we can also say: +%D +%D \starttyping +%D \ifx\somecommand\undefined \else \endinput \fi +%D \stoptyping +%D +%D When we define a macro, we tend to use a format which +%D shows as besat as can how things are done. \TEX\ however +%D stores the definitions as a sequence of tokens, so in fact +%D we can use a formatted definition: + +\def\abortinputifdefined#1% + {\ifx#1\undefined \else + \endinput + \fi} + +%D which also works. Keep in mind that this is entirely due to +%D the fact that \type{\endinput} after the line, i.e. at the +%D end of the macro. We therefore can burry this primitive quite +%D deep in code. + +%D And because this module implements \type{\writestatus}, we +%D just say: + +% \abortinputifdefined\writestatus + +%D \macros +%D {overloaded, superseded, forwarded, predefined} +%D +%D This prefix is used as signal for the \CONTEXT\ dependency +%D checking features. The first four prefixes don't do anything +%D useful, apart from signaling parsers. + +\def\overloaded{} % local change at the macro level +\def\superseded{} % global change at the module level, replaces previous definitions +\def\predefined{} % defined (first) here, but may be redefined anytime (no need for \overloaded) +\def\forwarded {} % definition at the module level, only done when undefined + +\def\forwarded#1#2{\ifx#2\undefined\else\expandafter\gobbleforwarded\fi#1#2} + +\def\gobbleforwarded#1 + {} + +%D Normally we tell the users what module is being loaded. +%D However, the command that is needed for this is not yet +%D defined. +%D +%D \starttyping +%D \writestatus{laden}{Context Systeem Macros (a)} +%D \stoptyping + +%D The next few macros are needed in case this module is +%D used outside \CONTEXT. + +\ifx\beginTEX\undefined + \let\beginTEX\relax\let\endTEX\relax + \long\def\beginETEX #1\endETEX {} +\fi + +%D \macros +%D [protecting] +%D {protect,unprotect} +%D +%D We can shield macros from users by using some special +%D characters in their names. Some characters that are normally +%D no letters and therefore often used are: \type{@}, \type{!} +%D and \type{?}. Before and after the definition of protected +%D macros, we have to change the \CATCODE\ of these characters. +%D This is done by \type{\unprotect} and \type{\protect}, for +%D instance: +%D +%D \starttyping +%D \unprotect +%D \def\!test{test} +%D \protect +%D \stoptyping +%D +%D The defined command \type{\!test} can of course only be +%D called upon when we are in the \type{\unprotect}'ed state, +%D otherwise \TEX\ reads \type{\!} and probably complains +%D loudly about not being in math mode. +%D +%D Both commands can be used nested, but only the \CATCODE\ +%D of the outermost level is saved. We make use of +%D an auxilary macro \type{\doprotect} to prevent us from +%D conflicts with existing macro's \type{\protect}. When +%D nesting deeper than one level, the system shows the +%D protection level. + +\ifx\protectionlevel\undefined \newcount\protectionlevel \fi + +\ifx\protect\undefined + \def\protect{\writestatus{protection}{too much protection}} +\else + % a simple version is already defined +\fi + +\let\normalprotect\protect % only for latex + +%D Although we don't need the \type{%} after commands that +%D don't take arguments, unless lines are obeyed, I decided +%D to put it there as a reminder. I only mention this once. + +\ifx\unprotect\undefined + + \chardef\protectionthreshold=10 + + \def\saveprotectedcharacters + {\edef\doprotectcharacters + {\catcode`\noexpand @\the\catcode`@ + \catcode`\noexpand !\the\catcode`! + \catcode`\noexpand ?\the\catcode`? }} + + \def\setprotectedcharacters + {\catcode`@=11 + \catcode`!=11 + \catcode`?=11 } + + \def\unprotect + {\ifcase\protectionlevel + \saveprotectedcharacters + \let\protect\doprotect + \fi + \setprotectedcharacters + \advance\protectionlevel 1 + \ifnum\protectionlevel>\protectionthreshold + \reportunprotection + \fi} + + \def\doprotect + {\ifcase\protectionlevel\or + \doprotectcharacters + \let\doprotectcharacters\relax + \let\protect\normalprotect + \fi + \ifnum\protectionlevel>\protectionthreshold + \reportprotection + \fi + \advance\protectionlevel -1 } + + \def\reportunprotection {\writestatus{protection}{unprotect \protectionstate}} + \def\reportprotection {\writestatus{protection}{protect \protectionstate}} + \def\reportprotectionstate{\writestatus{protection}{state \protectionstate}} + + \def\protectionstate + {\the\protectionlevel + \ifcase\protectionthreshold + :\space + @=\the\catcode`@\space\space + !=\the\catcode`!\space\space + ?=\the\catcode`?% + \fi} + + \ifx\everyeof\undefined + \let\checkprotection\relax + \else + \def\checkprotection{\everyeof{\writestatus{protection}{state: \protectionstate}}} + \fi + +\else + + \let\reportprotectionstate\relax + +\fi + +%D Now it is defined, we can make use of this very useful +%D macro. + +\unprotect + +%D \macros +%D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment, +%D @@endofline,@@parameter,@@superscript,@@subscript, +%D @@ignore,@@space,@@letter,@@other,@@active,@@comment} +%D +%D In \CONTEXT\ we sometimes manipulate the \CATCODES\ of +%D certain characters. Because we are not that good at numbers, +%D we introduce some symbolic names. + +\chardef\@@escape = 0 +\chardef\@@begingroup = 1 +\chardef\@@endgroup = 2 +\chardef\@@mathshift = 3 +\chardef\@@alignment = 4 +\chardef\@@endofline = 5 +\chardef\@@parameter = 6 +\chardef\@@superscript = 7 +\chardef\@@subscript = 8 +\chardef\@@ignore = 9 +\chardef\@@space = 10 +\chardef\@@letter = 11 +\chardef\@@other = 12 \chardef\other = 12 +\chardef\@@active = 13 \chardef\active = 13 +\chardef\@@comment = 14 + +%D \macros +%D {normalspace} +%D +%D We often need a space as defined in \PLAIN\ \TEX. Because +%D we cannot be sure of \type{\space} is redefined, we define: + +\def\normalspace{ } + +%D \macros +%D {scratchcounter, +%D scratchdimen,scratchskip,scratchmuskip, +%D scratchbox, +%D scratchtoks} +%D +%D Because we often need counters on a temporary basis, we +%D define the \COUNTER\ \type{\scratchcounter}. This is a +%D real \COUNTER, and not a pseudo one, as we will meet +%D further on. We also define some other scratch registers. + +\chardef\newabovelimit=20 + +\def\stripnewabove#1% + {\ifnum10<9#1 #1\else\expandafter\stripnewabove\fi}% + +\def\newabove#1#2% \dimen \name + {#1#2% + \ifnum\expandafter\stripnewabove\meaning#2>\newabovelimit\else + \expandafter\newabove\expandafter#1\expandafter#2% + \fi} + +\newabove \newcount \scratchcounter \newabove \newcount \globalscratchcounter +\newabove \newdimen \scratchdimen \newabove \newdimen \globalscratchdimen +\newabove \newskip \scratchskip \newabove \newskip \globalscratchskip +\newabove \newmuskip \scratchmuskip \newabove \newmuskip \globalscratchmuskip +\newabove \newtoks \scratchtoks \newabove \newtoks \globalscratchtoks + \newbox \scratchbox \newbox \globalscratchbox + +\newdimen\scratchdimenone \newbox\scratchboxone \newcount\scratchcounterone +\newdimen\scratchdimentwo \newbox\scratchboxtwo \newcount\scratchcountertwo + +%D \macros +%D {ifdone} + +\newif\ifdone + +%D \macros +%D {ifCONTEXT} +%D +%D In the system and support modules we sometimes show examples +%D that make use of core commands. We can skip those parts of +%D the documentation when we use another macropackage. Of +%D course we default to false. + +\newif \ifCONTEXT + +%D \macros +%D {!!count, !!toks, !!dimen, !!box, +%D !!width, !!height, !!depth, !!string, !!done} +%D +%D We define some more \COUNTERS\ and \DIMENSIONS. We also +%D define some shortcuts to the local scatchregisters~0, 2, 4, +%D 6 and~8. + +\newcount\!!counta \toksdef\!!toksa=0 \dimendef\!!dimena= 0 \chardef\!!boxa =0 +\newcount\!!countb \toksdef\!!toksb=2 \dimendef\!!dimenb= 2 \chardef\!!boxb =2 +\newcount\!!countc \toksdef\!!toksc=4 \dimendef\!!dimenc= 4 \chardef\!!boxc =4 +\newcount\!!countd \toksdef\!!toksd=6 \dimendef\!!dimend= 6 \chardef\!!boxd =6 +\newcount\!!counte \toksdef\!!tokse=8 \dimendef\!!dimene= 8 \chardef\!!boxe =8 +\newcount\!!countf \dimendef\!!dimenf=10 %skipdef\!!skipa=0 + \dimendef\!!dimeng=12 %skipdef\!!skipb=2 + \dimendef\!!dimenh=14 %skipdef\!!skipc=4 + \dimendef\!!dimeni=16 %skipdef\!!skipd=6 + \dimendef\!!dimenj=18 %skipdef\!!skipe=8 + \dimendef\!!dimenk=20 %skipdef\!!skipf=10 + +\let\!!stringa\empty \let\!!stringb\empty \let\!!stringc\empty +\let\!!stringd\empty \let\!!stringe\empty \let\!!stringf\empty + +\newdimen\!!widtha \newdimen\!!heighta \newdimen\!!deptha +\newdimen\!!widthb \newdimen\!!heightb \newdimen\!!depthb +\newdimen\!!widthc \newdimen\!!heightc \newdimen\!!depthc + +\newif\if!!donea \newif\if!!doneb \newif\if!!donec +\newif\if!!doned \newif\if!!donee \newif\if!!donef + +\ifx\data\undefined \else \let\data \relax \fi % dep checker + +%D Beware: we don't reuse plain counters, too dangerous +%D when <= 20 (e.g. in supp-pdf this messed up things). + +\ifx\undefined\zeroskip \newskip \zeroskip \fi +\ifx\undefined\zeropoint \newdimen \zeropoint \fi +\ifx\undefined\zerocount \newcount \zerocount \fi +\ifx\undefined\minusone \newcount \minusone \fi \minusone = -1 +\ifx\undefined\minustwo \newcount \minustwo \fi \minustwo = -2 +\ifx\undefined\plusone \chardef \plusone = 1 \fi +\ifx\undefined\plustwo \chardef \plustwo = 2 \fi +\ifx\undefined\plusthree \chardef \plusthree = 3 \fi +\ifx\undefined\plusfour \chardef \plusfour = 4 \fi +\ifx\undefined\plusfive \chardef \plusfive = 5 \fi +\ifx\undefined\plusten \mathchardef \plusten = 10 \fi +\ifx\undefined\plushundred \mathchardef \plushundred = 100 \fi +\ifx\undefined\plusthousand \mathchardef \plusthousand = 1000 \fi +\ifx\undefined\plustenthousand \mathchardef \plustenthousand = 10000 \fi +\ifx\undefined\plustwentythousand \mathchardef \plustwentythousand = 20000 \fi + +%D \macros +%D {s!,c!,e!,p!,v!,@@,??} +%D +%D To save memory, we use constants (sometimes called +%D variables). Redefining these constants can have desastrous +%D results. + +\def\v!prefix! {v!} \def\c!prefix! {c!} +\def\s!prefix! {s!} \def\p!prefix! {p!} + +\def\s!next {next} \def\s!default {default} +\def\s!dummy {dummy} \def\s!unknown {unknown} + +\def\s!do {do} \def\s!dodo {dodo} + +\def\s!complex {complex} \def\s!start {start} +\def\s!simple {simple} \def\s!stop {stop} + +\def\s!empty {empty} + +%D \macros +%D {@EA,@EAEA,@EAEAEA,@EAEAEAEAEAEA,expanded,startexpanded} +%D +%D When in unprotected mode, to be entered with +%D \type{\unprotect}, one can use \type{\@EA} as equivalent +%D of \type{\expandafter}. + +\let\@NX\noexpand +\let\@EA\expandafter + +\def\@EAEA {\expandafter\expandafter} +\def\@EAEAEA{\expandafter\expandafter\expandafter} + +\def\@EAEAEAEAEAEA{\expandafter\@EAEAEA\expandafter} + +%D Sometimes we pass macros as arguments to commands that +%D don't expand them before interpretation. Such commands can +%D be enclosed with \type{\expanded}, like: +%D +%D \starttyping +%D \expanded{\setupsomething[\alfa]} +%D \stoptyping +%D +%D Such situations occur for instance when \type{\alfa} is a +%D commalist or when data stored in macros is fed to index of +%D list commands. If needed, one should use \type{\noexpand} +%D inside the argument. Later on we will meet some more clever +%D alternatives to this command. + +\long\def\@@expanded{} % always long; global (less restores) + +\long\def\expanded#1% + {\long\xdef\@@expanded{\noexpand#1}\@@expanded} + +%D Beware, the next one has no \type {\noexpand} before its +%D argument. + +\long\def\startexpanded#1\stopexpanded % see x-fo for example + {\long\xdef\@@expanded{#1}\@@expanded} + +%D \macros +%D {safeexpanded,everysafeexpanded} +%D +%D In addition we provide: + +\newtoks\everysafeexpanded + +\long\def\safeexpanded#1% why the \noexpand + {\begingroup + \the\everysafeexpanded\long\xdef\@@expanded{\noexpand#1}% + \endgroup + \@@expanded} + +\def\safeedef#1#2% + {\begingroup + \the\everysafeexpanded\long\xdef\@@expanded{\noexpand#2}% + \endgroup + \let#1\@@expanded} + +\def\safexdef#1#2% + {\begingroup + \the\everysafeexpanded\long\xdef\@@expanded{\noexpand#2}% + \endgroup + \global\let#1\@@expanded} + +%D You can append protective measures to the token register if +%D needed, as we will do later. + +%D \macros +%D {expandoneargafter,expandtwoargsafter} +%D +%D These two commands make macros more readable by hiding a +%D lot of \type {\expandafter}'s. They expand the arguments +%D after the first command. +%D +%D \starttyping +%D \expandoneargafter \command{\abc} +%D \expandtwoargsafter\command{\abc}{\def} +%D \stoptyping +%D +%D These commands expect the arguments to be macros. + +\def\expandoneargafter #1{\@EA#1\@EA} +\def\expandtwoargsafter#1#2{\@EA\@EA\@EA#1\@EA\@EA\@EA{\@EA#2\@EA}\@EA} + +%D These two do a full expansion: + +\def\fullexpandoneargafter #1#2{\long\xdef\@@expanded{\noexpand#1{#2}}\@@expanded} +\def\fullexpandtwoargsafter#1#2#3{\long\xdef\@@expanded{\noexpand#1{#2}{#3}}\@@expanded} + +%D \macros +%D {gobbleoneargument,gobble...arguments} +%D +%D The next set of macros just do nothing, except that they +%D get rid of a number of arguments. + +\long\def\gobbleoneargument #1{} +\long\def\gobbletwoarguments #1#2{} +\long\def\gobblethreearguments #1#2#3{} +\long\def\gobblefourarguments #1#2#3#4{} +\long\def\gobblefivearguments #1#2#3#4#5{} +\long\def\gobblesixarguments #1#2#3#4#5#6{} +\long\def\gobblesevenarguments #1#2#3#4#5#6#7{} +\long\def\gobbleeightarguments #1#2#3#4#5#6#7#8{} +\long\def\gobbleninearguments #1#2#3#4#5#6#7#8#9{} +\long\def\gobbletenarguments #1{\gobbleninearguments} + +%D \macros +%D {doifnextcharelse} +%D +%D When we started using \TEX\ in the late eighties, our +%D first experiences with programming concerned a simple shell +%D around \LATEX. The commands probably use most at \PRAGMA, +%D are the itemizing ones. One of those few shell commands took +%D care of an optional argument, that enabled us to specify +%D what kind of item symbol we wanted. Without understanding +%D anything we were able to locate a \LATEX\ macro that could +%D be used to inspect the next character. +%D +%D It's this macro that the ancester of the next one presented +%D here. It executes one of two actions, dependant of the next +%D character. Disturbing spaces and line endings, which are +%D normally interpreted as spaces too, are skipped. +%D +%D \starttyping +%D \doifnextcharelse {karakter} {then ...} {else ...} +%D \stoptyping +%D +%D This macro differs from the original in the use of \type +%D {\localnext} because we don't want clashes with \type +%D {\next}. + +\long\def\doifnextcharelse#1#2#3% #1 should not be {} ! + {\let\charactertoken=#1% = needed here + \def\!!stringa{#2}% + \def\!!stringb{#3}% + \futurelet\nexttoken\inspectnextcharacter} + +\def\inspectnextcharacter + {\ifx\nexttoken\blankspace + \@EA\reinspectnextcharacter + \else\ifx\nexttoken\charactertoken + \@EAEAEA\!!stringa + \else + \@EAEAEA\!!stringb + \fi\fi} + +%D Because we will mostly use this macro for testing if the next +%D character is \type {[}, we also make a slightly faster variant +%D as it is not uncommon to have tens of thousands of calls to this +%D test in a run. Of course it also is more convenient to read a +%D trace then. + +\let\nextoptionalcharactertoken=[ + +\long\def\doifnextoptionalelse#1#2% + {\def\nextoptionalcommandyes{#1}% + \def\nextoptionalcommandnop{#2}% + \futurelet\nexttoken\inspectnextoptionalcharacter} + +\def\inspectnextoptionalcharacter + {\ifx\nexttoken\blankspace + \@EA\reinspectnextoptionalcharacter + \else\ifx\nexttoken\nextoptionalcharactertoken + \@EAEAEA\nextoptionalcommandyes + \else + \@EAEAEA\nextoptionalcommandnop + \fi\fi} + +\let\nextbgroupcharactertoken\bgroup + +\long\def\doifnextbgroupelse#1#2% + {\def\nextbgroupcommandyes{#1}% + \def\nextbgroupcommandnop{#2}% + \futurelet\nexttoken\inspectnextbgroupcharacter} + +\def\inspectnextbgroupcharacter + {\ifx\nexttoken\blankspace + \@EA\reinspectnextbgroupcharacter + \else\ifx\nexttoken\nextbgroupcharactertoken + \@EAEAEA\nextbgroupcommandyes + \else + \@EAEAEA\nextbgroupcommandnop + \fi\fi} + +%D This macro uses some auxiliary macros. Although we were able +%D to program quite complicated things, I only understood these +%D after rereading the \TEX book. The trick is in using a +%D command with a one character name. Such commands differ from +%D the longer ones in the fact that trailing spaces are {\em +%D not} skipped. This enables us to indirectly define a long +%D named macro that gobbles a space. +%D +%D In the first line we define \type{\blankspace}. Next we +%D make \type{\:} equivalent to \type{\reinspect...}. This +%D one||character command is expanded before the next +%D \type{\def} comes into action. This way the space after +%D \type{\:} becomes a delimiter of the longer named +%D \type{\reinspectnextcharacter}. The chain reaction is +%D visually compatible with the next sequence: +%D +%D \starttyping +%D \expandafter\def\reinspectnextcharacter % +%D {\futurelet\nexttoken\inspectnextcharacter} +%D \stoptyping +%D +%D However complicated it may look, I'm still glad I stumbled +%D into this construction. Saving and restoring \type {\:} is +%D needed when we use \PPCHTEX\ in \LATEX. + +\let\next\: + +\def\:{\let\blankspace= } \: + +\def\:{\reinspectnextcharacter} +\expandafter\def\: {\futurelet\nexttoken\inspectnextcharacter} + +\def\:{\reinspectnextoptionalcharacter} +\expandafter\def\: {\futurelet\nexttoken\inspectnextoptionalcharacter} + +\def\:{\reinspectnextbgroupcharacter} +\expandafter\def\: {\futurelet\nexttoken\inspectnextbgroupcharacter} + +\let\:\next + +%D \macros +%D {setvalue,setgvalue,setevalue,setxvalue, +%D letvalue, +%D getvalue, +%D resetvalue} +%D +%D \TEX's primitive \type{\csname} can be used to construct +%D all kind of commands that cannot be defined with +%D \type{\def} and \type{\let}. Every macro programmer sooner +%D or later wants macros like these. +%D +%D \starttyping +%D \setvalue {name}{...} = \def\name{...} +%D \setgvalue {name}{...} = \gdef\name{...} +%D \setevalue {name}{...} = \edef\name{...} +%D \setxvalue {name}{...} = \xdef\name{...} +%D \letvalue {name}=\... = \let\name=\... +%D \letgvalue {name}=\... = \global\let\name=\... +%D \getvalue {name} = \name +%D \resetvalue {name} = \def\name{} +%D \stoptyping +%D +%D As we will see, \CONTEXT\ uses these commands many times, +%D which is mainly due to its object oriented and parameter +%D driven character. + +\def\setvalue #1{\expandafter \def\csname#1\endcsname} +\def\setgvalue #1{\expandafter\gdef\csname#1\endcsname} +\def\setevalue #1{\expandafter\edef\csname#1\endcsname} +\def\setxvalue #1{\expandafter\xdef\csname#1\endcsname} +\def\getvalue #1{\csname#1\endcsname} +\def\letvalue #1{\expandafter\let\csname#1\endcsname} +\def\letgvalue #1{\global\expandafter\let\csname#1\endcsname} +\def\resetvalue #1{\expandafter\let\csname#1\endcsname\empty} +\def\ignorevalue#1#2{\expandafter\let\csname#1\endcsname\empty} + +%D \macros +%D {globallet,glet} +%D +%D In \CONTEXT\ of May 2000 using \type {\globallet} +%D instead of the two tokens will save us some +%D $300\times4=1200$ bytes of format file on a 32~bit +%D system. So: + +\def\globallet{\global\let} \let\glet\globallet + +%D \macros +%D {donottest,unexpanded} +%D +%D When expansion of a macro gives problems, we can precede it +%D by \type{\donottest}. It seems that protection is one of the +%D burdens of developers of packages, so maybe that's why in +%D \ETEX\ protection is solved in a more robust way. +%D +%D Sometimes prefixing the macro with \type{\donottest} leads +%D to defining an auxiliary macro, like +%D +%D \starttyping +%D \def\dosomecommand {... ... ...} +%D \def\somecommand {\donottest\dosomecommand} +%D \stoptyping +%D +%D This double definition can be made transparant by using +%D \type{\unexpanded}, as in: +%D +%D \starttyping +%D \unexpanded\def\somecommand{... ... ...} +%D \stoptyping +%D +%D The protection mechanism uses: + +\beginTEX + +\def\dontprocesstest#1{==} +\def\doprocesstest #1{#1} + +\let\donottest=\doprocesstest + +\endTEX + +\beginETEX \detokenize + +\def\donottest#1{#1} % {\detokenize{#1}} + +\endETEX + +%D By the way, we use a placeholder because we don't want +%D interference when testing on empty strings. Using a +%D placeholder of 8~characters increases the processing time +%D of simple \type{\doifelse} tests by about 10 \%. When we +%D process the test, we have to remove the braces and +%D therefore explictly gobble \type{#1}. + +%D \macros +%D {honorunexpanded,forceunexpanded} +%D +%D The fact that many macros have the same prefix, could have +%D a negative impact on searching in the hash table. Because +%D some simple testing does not show differences, we just use: +%D +%D \starttyping +%D \def\unexpanded#1#2% +%D {\@EA#1\@EA#2\@EA{\@EA\donottest\csname\s!do\string#2\endcsname}% +%D \@EA#1\csname\s!do\string#2\endcsname} +%D \stoptyping +%D +%D Well, in fact we use the bit more versatile alternative. The +%D \type {\honorunexpanded} can be used to \type {\string} +%D the protected command, which by the way is seldom needed +%D in \CONTEXT. + +\beginTEX + +\def\dosetunexpanded#1#2% + {\@EA#1\@EA{\@EA#2\@EA}% + \@EA{\@EA\donottest\csname\s!do\@EA\string\csname#2\endcsname\endcsname}% + \@EA#1\@EA{\@EA\s!do\@EA\string\csname#2\endcsname}} + +\def\docomunexpanded#1#2% + {\@EA#1\@EA#2\@EA{\@EA\donottest\csname\s!do\string#2\endcsname}% + \@EA#1\csname\s!do\string#2\endcsname} + +\def\unexpanded#1% + {\def\dounexpanded + {\ifx\next\bgroup + \@EA\dosetunexpanded + \else + \@EA\docomunexpanded + \fi#1}% + \futurelet\next\dounexpanded} + +\def\honorunexpanded% for writing to a file or message + {\def\donottest##1{\expandafter\gobblethreearguments\string##1}} + +\def\forceunexpanded% for preventing expansion in \xdef + {\def\donottest##1% + {\expandafter\noexpand\csname\expandafter\gobblefourarguments\string##1\endcsname}} + +\def\resetunexpanded% + {\let\donottest\doprocesstest} + +\endTEX + +\beginETEX \protected + +\let \unexpanded \normalprotected +\let \honorunexpanded \empty % \relax +\let \forceunexpanded \empty % \relax +\let \resetunexpanded \empty % \relax + +\endETEX + +%D This one accepts the more direct \type{\def} and cousins +%D as well as the \CONTEXT\ specific \type{\setvalue} ones. +%D +%D And so the definition in our example turns out to be: +%D +%D \starttyping +%D \def\csname do\somecommand\endcsname{... ... ...} +%D \def\somecommand{\donottest\csname do\somecommand\endcsname} +%D \stoptyping +%D +%D In which \type{do\somecommand} is hidden from the user and +%D cannot lead to confusion. It's still permitted to define +%D auxiliary macros like \type{\dosomecommand}. +%D +%D When we are going to use e-\TEX, we'll probably end up +%D redefining some commands, but we can probably keep the +%D \type{\unexpanded} ones unchanged. + +%D \macros +%D {doifundefined,doifdefined, +%D doifundefinedelse,doifdefinedelse, +%D doifalldefinedelse} +%D +%D The standard way of testing if a macro is defined is +%D comparing its meaning with another undefined one, usually +%D \type{\undefined}. To garantee correct working of the next +%D set of macros, \type{\undefined} may never be defined! +%D +%D \starttyping +%D \doifundefined {string} {...} +%D \doifdefined {string} {...} +%D \doifundefinedelse {string} {then ...} {else ...} +%D \doifdefinedelse {string} {then ...} {else ...} +%D \doifalldefinedelse {commalist} {then ...} {else ...} +%D \stoptyping +%D +%D Every macroname that \TEX\ builds gets an entry in the hash +%D table, which is of limited size. It is expected that e-\TeX\ +%D will offer a less memory||consuming alternative. + +%D Although it will probably never be a big problem, it is good +%D to be aware of the difference between testing on a macro +%D name to be build by using \type{\csname} and +%D \type{\endcsname} and testing the \type{\name} directly. +%D +%D \starttyping +%D \expandafter\ifx\csname NameA\endcsname\relax ... \else ... \fi +%D +%D \ifx\NameB\undefined ... \else ... \fi +%D \stoptyping +%D +%D I became aware of this when I mistakenly testen the first +%D one against \type{\undefined}. When \TEX\ build a name using +%D \type{\csname} it automatically sets it to \type{\relax}, +%D which is definitely not the same as \type{\undefined}. The +%D quickest way to check these things is asking \TEX\ to show +%D the meaning of the names: +%D +%D \starttyping +%D \expandafter\show\csname NameA\endcsname +%D +%D \show\NameB +%D \stoptyping +%D +%D The main reason why this never will be a big problem is that +%D when one uses the \type{\csname} way, one probably has to do +%D with some macroname that always is dealt with that way. +%D Confusion can however arise when one applies both testing +%D methods to the same macroname. By the way, the assignment +%D of \type{\relax} obeys grouping. + +%D The first one gets rid of \type{#1}, but still expands to +%D something and the second one expands to \type{#1}. Because +%D we accept arguments between \type{{}}, we have to get rid +%D of one level of braces. +%D +%D Our first implementation of \type{\ifundefined} was +%D straightforward and readable: +%D +%D \starttyping +%D \def\ifundefined#1% +%D {\expandafter\ifx\csname#1\endcsname\relax}% +%D +%D \def\doifundefinedelse#1#2#3% +%D {\let\donottest=\dontprocesstest +%D \ifundefined{#1}% +%D \let\donottest=\doprocesstest#2% +%D \else +%D \let\donottest=\doprocesstest#3% +%D \fi} +%D +%D \def\doifdefinedelse#1#2#3% +%D {\doifundefinedelse{#1}{#3}{#2}} +%D +%D \def\doifundefined#1#2% +%D {\doifundefinedelse{#1}{#2}{}} +%D +%D \def\doifdefined#1#2% +%D {\doifundefinedelse{#1}{}{#2}} +%D +%D \def\doifalldefinedelse#1#2#3% +%D {\begingroup +%D \donetrue +%D \def\checkcommand##1% +%D {\doifundefined{##1}{\donefalse}}% +%D \processcommalist[#1]\checkcommand +%D \ifdone +%D \endgroup#2% +%D \else +%D \endgroup#3% +%D \fi} +%D \stoptyping +%D +%D When this module was optimized, timing showed that the +%D next alternative can be upto twice as fast, especially when +%D longer arguments are used. Watch how we reach over the +%D \type {\else} and \type {\fi}: this way they cannot get +%D into the way (and we can avoid those \type {\next} +%D hacks); I started using this method after I did some +%D speed optimization tests in the xtag modules; the +%D efficiency of such hacks depends on the length of the +%D argument etc. etc.) + +\beginTEX + +\def\ifundefined#1% + {\expandafter\ifx\csname#1\endcsname\relax} + +\def\p!doifundefined#1% + {\let\donottest\dontprocesstest + \expandafter\ifx\csname#1\endcsname\relax} + +\def\doifundefinedelse#1% + {\p!doifundefined{#1}% + \let\donottest\doprocesstest\@EA\firstoftwoarguments + \else + \let\donottest\doprocesstest\@EA\secondoftwoarguments + \fi} + +\def\doifdefinedelse#1% + {\p!doifundefined{#1}% + \let\donottest\doprocesstest\@EA\secondoftwoarguments + \else + \let\donottest\doprocesstest\@EA\firstoftwoarguments + \fi} + +\def\doifundefined#1% + {\p!doifundefined{#1}% + \let\donottest\doprocesstest\@EA\firstofoneargument + \else + \let\donottest\doprocesstest\@EA\gobbleoneargument + \fi} + +\def\doifdefined#1% + {\p!doifundefined{#1}% + \let\donottest\doprocesstest\@EA\gobbleoneargument + \else + \let\donottest\doprocesstest\@EA\firstofoneargument + \fi} + +\endTEX + +\beginETEX \ifcsname + +\def\ifundefined#1% ongelukkige naam + {\unless\ifcsname#1\endcsname} + +\def\p!doifundefined#1% + {\edef\p!defined{#1}% + \unless\ifcsname\detokenize\@EA{\p!defined}\endcsname} + +\def\doifundefinedelse#1% + {\edef\p!defined{#1}% + \ifcsname\detokenize\@EA{\p!defined}\endcsname + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + +\def\doifdefinedelse#1% + {\edef\p!defined{#1}% + \ifcsname\detokenize\@EA{\p!defined}\endcsname + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\def\doifundefined#1% + {\edef\p!defined{#1}% + \ifcsname\detokenize\@EA{\p!defined}\endcsname + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +\def\doifdefined#1% + {\edef\p!defined{#1}% + \ifcsname\detokenize\@EA{\p!defined}\endcsname + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\endETEX + +%D \macros +%D {letbeundefined} +%D +%D Testing for being undefined comes down to testing on \type +%D {\relax} when we use \type {\csname}, but when using \type +%D {\ifx}, we test on being \type {\undefined}! In \ETEX\ we +%D have \type {\ifcsname} and that way of testing on existance +%D is not the same as the one described here. Therefore we +%D introduce: + +\beginTEX + +\def\letbeundefined#1% + {\expandafter\let\csname#1\endcsname\relax} + +\endTEX + +\beginETEX \undefined + +\def\letbeundefined#1% potential stack buildup when used \global + {\expandafter\let\csname#1\endcsname\undefined} + +\def\localundefine#1% conditional + {\ifcsname#1\endcsname\expandafter\let\csname#1\endcsname\undefined\fi} +\def\globalundefine#1% conditional + {\ifcsname#1\endcsname\expandafter\global\let\csname#1\endcsname\undefined\fi} + +\endETEX + +%D Beware, being \type {\undefined} in \ETEX\ means that the macro +%D {\em is} defined! + +%D Before we start using this variant, we used another one, +%D which is even a bit faster. This one looked like: +%D +%D \starttyping +%D \def\p!doifundefined% +%D {\begingroup +%D \let\donottest=\dontprocesstest +%D \ifundefined} +%D +%D \def\doifundefinedelse#1#2#3% +%D {\p!doifundefined{#1}% +%D \endgroup#2% +%D \else +%D \endgroup#3% +%D \fi} +%D \stoptyping +%D +%D A even more previous version used \type{\bgroup} and +%D \type {\egroup}. In math mode however, \type{$1{x}2$} differs +%D from \type{$1x2$}. This can been seen when one compares the +%D output of: +%D +%D \starttyping +%D $\kern10pt\showthe\lastkern$ +%D $\kern10pt{\showthe\lastkern}$ +%D $\kern10pt\begingroup\showthe\lastkern\endgroup$ +%D \stoptyping +%D +%D Also in math mode, one can better use \type {\begingroup} +%D and companion instead of \type {\bgroup}. +%D +%D When we were developing the scientific units module, we +%D encountered different behavior in text and math mode, which +%D was due to this grouping subtilities. We therefore decided +%D to use \type{\begingroup} instead of \type{\bgroup}. +%D Later, when we had optimized some macro's the grouped +%D solution turned out to be unsafe when typesetting this +%D documentation, especially when using \type{\globaldefs}. +%D +%D We still have to define \type{\doifalldefinedelse}. Watch +%D the use of grouping, which garantees local use of the +%D boolean \type{\ifdone}. + +\beginTEX + +\def\docheckonedefined#1% + {\ifundefined{#1}% + \donefalse + \fi} + +\def\doifalldefinedelse#1% + {\begingroup + \let\donottest\dontprocesstest + \donetrue + \processcommalist[#1]\docheckonedefined + \ifdone + \endgroup\let\donottest\doprocesstest + \expandafter\firstoftwoarguments + \else + \endgroup\let\donottest\doprocesstest + \expandafter\secondoftwoarguments + \fi} + +\endTEX + +\beginETEX \ifcsname + +\def\docheckonedefined#1% + {\unless\ifcsname#1\endcsname + \donefalse + \fi} + +\def\doifalldefinedelse#1% + {\begingroup + \donetrue \processcommalist[#1]\docheckonedefined + \ifdone + \endgroup\expandafter\firstoftwoarguments + \else + \endgroup\expandafter\secondoftwoarguments + \fi} + +\endETEX + +%D \macros +%D {doif,doifelse,doifnot, +%D donottest} +%D +%D Programming in \TEX\ differs from programming in procedural +%D languages like \MODULA. This means that one --- well, let me +%D speek for myself --- tries to do the things in the well +%D known way. Therefore the next set of \type{\ifthenelse} +%D commands were between the first ones we needed. A few years +%D later, the opposite became true: when programming in +%D \MODULA, I sometimes miss handy things like grouping, +%D runtime redefinition, expansion etc. While \MODULA\ taught +%D me to structure, \TEX\ taught me to think recursive. +%D +%D \starttyping +%D \doif {string1} {string2} {...} +%D \doifnot {string1} {string2} {...} +%D \doifelse {string1} {string2} {then ...}{else ...} +%D \stoptyping +%D +%D When expansion gives problems, we can precede the +%D troublemaker with \type{\donottest}. +%D +%D This implementatie does not use the construction which is +%D more robust for nested conditionals. +%D +%D \starttyping +%D \ifx\!!stringa\!!stringb +%D \def\next{#3}% +%D \else +%D \def\next{#4}% +%D \fi +%D \next +%D \stoptyping +%D +%D In practice, this alternative is at least 20\% slower than +%D the alternative used here. The few cases in which we +%D really need the \type{\next} construction, often need some +%D other precautions and or adaptions too. + +\beginTEX + +% \long\def\doif#1#2#3% +% {\let\donottest\dontprocesstest +% \edef\!!stringa{#1}% +% \edef\!!stringb{#2}% +% \let\donottest\doprocesstest +% \ifx\!!stringa\!!stringb +% #3% +% \fi} +% +% \long\def\doifnot#1#2#3% +% {\let\donottest\dontprocesstest +% \edef\!!stringa{#1}% +% \edef\!!stringb{#2}% +% \let\donottest\doprocesstest +% \ifx\!!stringa\!!stringb +% \else +% #3% +% \fi} +% +% \long\def\doifelse#1#2#3#4% +% {\let\donottest\dontprocesstest +% \edef\!!stringa{#1}% +% \edef\!!stringb{#2}% +% \let\donottest\doprocesstest +% \ifx\!!stringa\!!stringb +% #3% +% \else +% #4% +% \fi} + +%D Slightly faster on big arguments, as well as \type +%D {\next} avoiding: + +\long\def\doif#1#2% + {\let\donottest\dontprocesstest + \edef\!!stringa{#1}% + \edef\!!stringb{#2}% + \let\donottest\doprocesstest + \ifx\!!stringa\!!stringb + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\long\def\doifnot#1#2% + {\let\donottest\dontprocesstest + \edef\!!stringa{#1}% + \edef\!!stringb{#2}% + \let\donottest\doprocesstest + \ifx\!!stringa\!!stringb + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + + +\long\def\doifelse#1#2% + {\let\donottest\dontprocesstest + \edef\!!stringa{#1}% + \edef\!!stringb{#2}% + \let\donottest\doprocesstest + \ifx\!!stringa\!!stringb + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\endTEX + +\beginETEX \protected + +% \long\def\doif#1#2#3% +% {\edef\!!stringa{#1}\edef\!!stringb{#2}% +% \ifx\!!stringa\!!stringb#3\fi} +% +% \long\def\doifnot#1#2#3% +% {\edef\!!stringa{#1}\edef\!!stringb{#2}% +% \unless\ifx\!!stringa\!!stringb#3\fi} +% +% \long\def\doifelse#1#2#3#4% +% {\edef\!!stringa{#1}\edef\!!stringb{#2}% +% \ifx\!!stringa\!!stringb#3\else#4\fi} + +%D Slightly faster on big arguments, as well as \type +%D {\next} avoiding: + +\long\def\doif#1#2% + {\edef\!!stringa{#1}\edef\!!stringb{#2}% + \ifx\!!stringa\!!stringb + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\long\def\doifnot#1#2% + {\edef\!!stringa{#1}\edef\!!stringb{#2}% + \ifx\!!stringa\!!stringb + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +\long\def\doifelse#1#2% + {\edef\!!stringa{#1}\edef\!!stringb{#2}% + \ifx\!!stringa\!!stringb + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\endETEX + +%D One could wonder why we don't follow the the same approach +%D as in \type{\doifdefined} c.s.\ and use \type{\begingroup} +%D and \type{\endgroup}. In this case, this alternative is +%D slower, which is probably due to the fact that more meanings +%D need to be restored. +%D +%D The in terms of memory more efficient alternative using a +%D auxiliary macro also proved to be slower, so we definitely +%D did not choose for: +%D +%D \starttyping +%D \def\p!doifelse#1#2% +%D {\let\donottest=\dontprocesstest +%D \edef\!!stringa{#1}% +%D \edef\!!stringb{#2}% +%D \let\donottest=\doprocesstest +%D \ifx\!!stringa\!!stringb} +%D +%D \long\def\doif#1#2#3% +%D {\p!doifelse{#1}{#2}#3\fi} +%D +%D \long\def\doifnot#1#2#3% +%D {\p!doifelse{#1}{#2}\else#3\fi} +%D +%D \long\def\doifelse#1#2#3#4% +%D {\p!doifelse{#1}{#2}#3\else#4\fi} +%D \stoptyping +%D +%D Optimizations like this are related of course to the +%D bottlenecks in \TEX. It seems that restoring saved meanings +%D and passing arguments takes some time. + +%D \macros +%D {doifempty,doifemptyelse,doifnotempty} +%D +%D We complete our set of conditionals with: +%D +%D \starttyping +%D \doifempty {string} {...} +%D \doifnotempty {string} {...} +%D \doifemptyelse {string} {then ...} {else ...} +%D \stoptyping +%D +%D This time, the string is not expanded. + +\long\def\doifemptyelse#1% + {\def\!!stringa{#1}% + \ifx\!!stringa\empty + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\long\def\doifempty#1% + {\def\!!stringa{#1}% + \ifx\!!stringa\empty + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\long\def\doifnotempty#1% + {\def\!!stringa{#1}% + \ifx\!!stringa\empty + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +%D \macros +%D {doifinset,doifnotinset,doifinsetelse} +%D +%D We can check if a string is present in a comma separated +%D set of strings. Depending on the result, some action is +%D taken. +%D +%D \starttyping +%D \doifinset {string} {string,...} {...} +%D \doifnotinset {string} {string,...} {...} +%D \doifinsetelse {string} {string,...} {then ...} {else ...} +%D \stoptyping +%D +%D The second argument is the comma separated set of strings. +%D +%D \starttyping +%D \long\def\doifinsetelse#1#2#3#4% +%D {\doifelse{#1}{} +%D {#4} +%D {\donefalse +%D \def\p!checkiteminset##1% +%D {\doif{#1}{##1} +%D {\donetrue +%D \let\p!checkiteminset=\gobbleoneargument}}% +%D \processcommalist[#2]\p!checkiteminset +%D \ifdone +%D #3% +%D \else +%D #4% +%D \fi}} +%D +%D \long\def\doifinset#1#2#3% +%D {\doifinsetelse{#1}{#2}{#3}{}} +%D +%D \long\def\doifnotinset#1#2#3% +%D {\doifinsetelse{#1}{#2}{}{#3}} +%D \stoptyping +%D +%D Because this macro is called quite often we've spent some +%D time optimizing it. This time, the gain in speed is due to +%D (1)~defining an external auxiliary macro, (2)~not calling +%D any other macros and (3)~minimizing the passing of +%D arguments. The gain in speed is impressive. + +% \def\p!dodocheckiteminset#1% +% {\edef\!!stringb{#1}% +% \ifx\!!stringa\!!stringb +% \donetrue +% \let\p!docheckiteminset\gobbleoneargument +% \fi} +% +% \beginTEX +% +% \def\p!doifinsetelse#1#2% +% {\let\donottest\dontprocesstest +% \donefalse +% \edef\!!stringa{#1}% +% \ifx\!!stringa\empty +% \else +% \let\p!docheckiteminset\p!dodocheckiteminset +% \processcommalist[#2]\p!docheckiteminset +% \fi +% \let\donottest\doprocesstest +% \ifdone} +% +% \endTEX +% +% \beginETEX \protected +% +% \def\p!doifinsetelse#1#2% +% {\donefalse +% \edef\!!stringa{#1}% +% \ifx\!!stringa\empty +% \else +% \let\p!docheckiteminset\p!dodocheckiteminset +% \processcommalist[#2]\p!docheckiteminset +% \fi +% \ifdone} +% +% \endETEX + +% then we had: +% +% \def\p!docheckiteminset#1% +% {\edef\!!stringb{#1}% +% \ifx\!!stringa\!!stringb +% \donetrue +% \expandafter\quitcommalist +% \fi} +% +% \beginTEX +% +% \def\p!doifinsetelse#1#2% +% {\let\donottest\dontprocesstest +% \donefalse +% \edef\!!stringa{#1}% +% \ifx\!!stringa\empty +% \else +% \processcommalist[#2]\p!docheckiteminset +% \fi +% \let\donottest\doprocesstest +% \ifdone} +% +% \endTEX +% +% % can be sped up with processnext... +% +% \beginETEX \protected +% +% \def\p!doifinsetelse#1#2% +% {\donefalse +% \edef\!!stringa{#1}% +% \ifx\!!stringa\empty +% \else +% \processcommalist[#2]\p!docheckiteminset +% \fi +% \ifdone} +% +% \endETEX +% +% \long\def\doifinsetelse#1#2% +% {\p!doifinsetelse{#1}{#2}% +% \expandafter\firstoftwoarguments +% \else +% \expandafter\secondoftwoarguments +% \fi} +% +% \long\def\doifinset#1#2% +% {\p!doifinsetelse{#1}{#2}% +% \expandafter\firstofoneargument +% \else +% \expandafter\gobbleoneargument +% \fi} +% +% \long\def\doifnotinset#1#2% +% {\p!doifinsetelse{#1}{#2}% +% \expandafter\gobbleoneargument +% \else +% \expandafter\firstofoneargument +% \fi} +% +% now we have + +\def\p!docheckiteminset#1% + {\edef\!!stringb{#1}% + \ifx\!!stringa\!!stringb + \donetrue + \expandafter\quitcommalist + \fi} + +\beginTEX + +\def\p!doifinsetelse#1#2#3#4% + {\let\donottest\dontprocesstest + \donefalse + \edef\!!stringa{#3}% + \ifx\!!stringa\empty + \else + \processcommalist[#4]\p!docheckiteminset + \fi + \let\donottest\doprocesstest + \ifdone\expandafter#1\else\expandafter#2\fi} + +\endTEX + +\beginETEX \protected + +\def\p!doifinsetelse#1#2#3#4% + {\donefalse + \edef\!!stringa{#3}% + \ifx\!!stringa\empty + \else + \processcommalist[#4]\p!docheckiteminset + \fi + \ifdone\expandafter#1\else\expandafter#2\fi} + +\endETEX + +\long\def\doifinsetelse + {\p!doifinsetelse\firstoftwoarguments\secondoftwoarguments} + +\long\def\doifinset + {\p!doifinsetelse\firstofoneargument\gobbleoneargument} + +\long\def\doifnotinset + {\p!doifinsetelse\gobbleoneargument\firstofoneargument} + +%D \macros +%D {doifcommon,doifnotcommon,doifcommonelse} +%D +%D Probably the most time consuming tests are those that test +%D for overlap in sets of strings. +%D +%D \starttyping +%D \doifcommon {string,...} {string,...} {...} +%D \doifnotcommon {string,...} {string,...} {...} +%D \doifcommonelse {string,...} {string,...} {then ...} {else ...} +%D \stoptyping +%D +%D We show the slower alternative first, because it shows us +%D how things are done. +%D +%D \starttyping +%D \long\def\doifcommonelse#1#2#3#4% +%D {\donefalse +%D \def\p!docommoncheck##1% +%D {\def\p!dodocommoncheck####1% +%D {\doif{####1}{##1} +%D {\donetrue +%D \def\commalistelement{##1}% +%D \let\p!docommoncheck=\gobbleoneargument +%D \let\p!dodocommoncheck=\gobbleoneargument}}% +%D \processcommalist[#2]\p!dodocommoncheck}% +%D \processcommalist[#1]\p!docommoncheck +%D \ifdone +%D #3% +%D \else +%D #4% +%D \fi} +%D +%D \long\def\doifcommon#1#2#3% +%D {\doifcommonelse{#1}{#2}{#3}{}} +%D +%D \long\def\doifnotcommon#1#2#3% +%D {\doifcommonelse{#1}{#2}{}{#3}} +%D \stoptyping +%D +%D The processing time is shortened by getting the auxiliary +%D macro to the outermost level and using less \type{\edef}'s. +%D Sometimes it makes more sence to define local macro's not +%D only because this way we can be sure that they are not +%D redefined, but also because it shows the dependance. In +%D compiled languages, this is no problem at all. It can even +%D save us bytes and processing time. In interpreted languages +%D like \TEX\ it nearly always slows down processing. + +% \def\p!dododocommoncheck#1% +% {\edef\!!stringb{#1}% +% \ifx\!!stringa\!!stringb +% \donetrue +% \let\p!docommoncheck\gobbleoneargument +% \let\p!dodocommoncheck\gobbleoneargument +% \fi} +% +% \beginTEX +% +% \def\p!doifcommonelse#1#2% +% {\donefalse +% \let\donottest\dontprocesstest +% \let\p!dodocommoncheck\p!dododocommoncheck +% \def\p!docommoncheck##1% +% {\edef\!!stringa{##1}% +% \def\commalistelement{##1}% +% \processcommalist[#2]\p!dodocommoncheck}% +% \processcommalist[#1]\p!docommoncheck +% \let\donottest\doprocesstest +% \ifdone} +% +% \endTEX +% +% \beginETEX \protected +% +% \def\p!doifcommonelse#1#2% +% {\donefalse +% \let\p!dodocommoncheck\p!dododocommoncheck +% \def\p!docommoncheck##1% +% {\edef\!!stringa{##1}% +% \def\commalistelement{##1}% +% \processcommalist[#2]\p!dodocommoncheck}% +% \processcommalist[#1]\p!docommoncheck +% \ifdone} +% +% \endETEX + +% \def\p!dodocommoncheck#1% +% {\edef\!!stringb{#1}% +% \ifx\!!stringa\!!stringb +% \donetrue +% \expandafter\quitprevcommalist +% \fi} +% +% \beginTEX +% +% \def\p!doifcommonelse#1#2% +% {\donefalse +% \let\donottest\dontprocesstest +% \def\p!docommoncheck##1% +% {\edef\!!stringa{##1}% +% \def\commalistelement{##1}% no let to stringa +% \processcommalist[#2]\p!dodocommoncheck}% +% \processcommalist[#1]\p!docommoncheck +% \let\donottest\doprocesstest +% \ifdone} +% +% \endTEX +% +% \beginETEX \protected +% +% \def\p!doifcommonelse#1#2% +% {\donefalse +% \def\p!docommoncheck##1% +% {\edef\!!stringa{##1}% +% \def\commalistelement{##1}% +% \processcommalist[#2]\p!dodocommoncheck}% +% \processcommalist[#1]\p!docommoncheck +% \ifdone} +% +% \endETEX +% +% \long\def\doifcommonelse#1#2% % #3#4% +% {\p!doifcommonelse{#1}{#2}% % #3\else#4\fi} +% \expandafter\firstoftwoarguments +% \else +% \expandafter\secondoftwoarguments +% \fi} +% +% \long\def\doifcommon#1#2% +% {\p!doifcommonelse{#1}{#2}% +% \expandafter\firstofoneargument +% \else +% \expandafter\gobbleoneargument +% \fi} +% +% \long\def\doifnotcommon#1#2% +% {\p!doifcommonelse{#1}{#2}% +% \expandafter\gobbleoneargument +% \else +% \expandafter\firstofoneargument +% \fi} + +% todo: use dedicated done + +\def\p!dodocommoncheck#1% + {\edef\!!stringb{#1}% + \ifx\!!stringa\!!stringb + \donetrue + \expandafter\quitprevcommalist + \fi} + +\beginTEX + +\def\p!doifcommonelse#1#2#3#4% + {\donefalse + \let\donottest\dontprocesstest + \def\p!docommoncheck##1% + {\edef\!!stringa{##1}% + \def\commalistelement{##1}% no let to stringa + \processcommalist[#4]\p!dodocommoncheck}% + \processcommalist[#3]\p!docommoncheck + \let\donottest\doprocesstest + \ifdone\expandafter#1\else\expandafter#2\fi} + +\endTEX + +\beginETEX \protected + +\def\p!doifcommonelse#1#2#3#4% + {\donefalse + \def\p!docommoncheck##1% + {\edef\!!stringa{##1}% + \def\commalistelement{##1}% + \processcommalist[#4]\p!dodocommoncheck}% + \processcommalist[#3]\p!docommoncheck + \ifdone\expandafter#1\else\expandafter#2\fi} + +\endETEX + +\def\doifcommonelse + {\p!doifcommonelse\firstoftwoarguments\secondoftwoarguments} + +\def\doifcommon + {\p!doifcommonelse\firstofoneargument \gobbleoneargument} + +\def\doifnotcommon + {\p!doifcommonelse\gobbleoneargument \firstofoneargument} + +%D \macros +%D {processcommalist,processcommacommand,quitcommalist, +%D processcommalistwithparameters} +%D +%D We've already seen some macros that take care of comma +%D separated lists. Such list can be processed with +%D +%D \starttyping +%D \processcommalist[string,string,...]\commando +%D \stoptyping +%D +%D The user supplied command \type{\commando} receives one +%D argument: the string. This command permits nesting and +%D spaces after commas are skipped. Empty sets are no problem. +%D +%D \startbuffer +%D \def\dosomething#1{(#1)} +%D +%D 1: \processcommalist [\hbox{$a,b,c,d,e,f$}] \dosomething \par +%D 2: \processcommalist [{a,b,c,d,e,f}] \dosomething \par +%D 3: \processcommalist [{a,b,c},d,e,f] \dosomething \par +%D 4: \processcommalist [a,b,{c,d,e},f] \dosomething \par +%D 5: \processcommalist [a{b,c},d,e,f] \dosomething \par +%D 6: \processcommalist [{a,b}c,d,e,f] \dosomething \par +%D 7: \processcommalist [] \dosomething \par +%D 8: \processcommalist [{[}] \dosomething \par +%D \stopbuffer +%D +%D \typebuffer +%D +%D Before we show the result, we present the macro's: + +\newcount\commalevel + +\def\dododoprocesscommaitem + {\csname\s!next\the\commalevel\endcsname} + +%\def\dodoprocesscommaitem% +% {\ifx\nexttoken\blankspace +% \let\nextcommaitem\redoprocesscommaitem +% \else\ifx\nexttoken]% +% \let\nextcommaitem\gobbleoneargument +% \else +% \let\nextcommaitem\dododoprocesscommaitem +% \fi\fi +% \nextcommaitem} +% +% faster ? + +\def\dodoprocesscommaitem + {\ifx\nexttoken\blankspace + \@EA\redoprocesscommaitem + \else\ifx\nexttoken]% + \@EAEAEA\gobbleoneargument + \else + \@EAEAEA\dododoprocesscommaitem + \fi\fi} + +\def\doprocesscommaitem + {\futurelet\nexttoken\dodoprocesscommaitem} + +%D Empty arguments are not processed. Empty items (\type{,,}) +%D however are treated. We have to check for the special case +%D \type{[{a,b,c}]}. +%D +%D \starttyping +%D \def\processcommalist[% +%D {\futurelet\nexttoken\docheckcommaitem} +%D +%D \def\docheckcommaitem% +%D {\ifx\nexttoken]% +%D \let\nextcommaitem\gobbletwoarguments +%D \else\ifx\nexttoken\bgroup +%D \let\nextcommaitem\doprocesscommalistA +%D \else +%D \let\nextcommaitem\doprocesscommalistB +%D \fi\fi +%D \nextcommaitem} +%D +%D \def\doprocesscommalistA#1#2]#3% +%D {\global\advance\commalevel 1 +%D \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,% +%D {#3{##1}\doprocesscommaitem}% +%D \doprocesscommaitem{#1}#2,]\relax +%D \global\advance\commalevel -1 } +%D +%D \def\doprocesscommalistB#1]#2% +%D {\global\advance\commalevel 1 +%D \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,% +%D {#2{##1}\doprocesscommaitem}% +%D \doprocesscommaitem#1,]\relax +%D \global\advance\commalevel -1 } +%D \stoptyping +%D +%D However, this is not a the most straightforward solution! +%D We can misuse one of \TEX's hidden features, and prepend +%D and remove a \type {\relax}. By the way, although it +%D involves less testing, this cleaner alternative is not +%D faster. + +\def\processcommalist[% + {\futurelet\nexttoken\docheckcommaitem} + +\def\docheckcommaitem + {\ifx\nexttoken]% + \expandafter\gobblethreearguments + \else + \expandafter\doprocesscommalist + \fi + \relax} % this one preserved the next {} + +\def\doprocesscommalist#1]#2% + {\global\advance\commalevel \plusone + \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,% + {#2{##1}\doprocesscommaitem}% + \@EA\dodoprocesscommaitem\gobbleoneargument#1,]\relax + \global\advance\commalevel \minusone } + +%D One way of quitting a commalist halfway is: + +\def\quitcommalist + {\begingroup\let\doprocesscommaitem\doquitcommalist} + +\def\doquitcommalist#1]% + {\endgroup} + +\def\quitprevcommalist + {\begingroup\let\doprocesscommaitem\doquitprevcommalist} + +\def\doquitprevcommalist#1]% + {\let\doprocesscommaitem\doquitcommalist} + +%D The hack we used for checking the next character +%D \type {\doifnextcharelse} is also used here. + +\def\:{\redoprocesscommaitem} + +\expandafter\def\: {\futurelet\nexttoken\dodoprocesscommaitem} + +%D The previous examples lead to: +%D +%D \getbuffer + +%D When a list is saved in a macro, we can use a construction +%D like: +%D +%D \starttyping +%D \expandafter\processcommalist\expandafter[\list]\command +%D \stoptyping +%D +%D Such solutions suit most situations, but we wanted a bit +%D more. +%D +%D \starttyping +%D \processcommacommand[string,\stringset,string]\commando +%D \stoptyping +%D +%D where \type{\stringset} is a predefined set, like: +%D +%D \starttyping +%D \def\first{aap,noot,mies} +%D \def\second{laatste} +%D +%D \processcommacommand[\first]\message +%D \processcommacommand[\first,second,third]\message +%D \processcommacommand[\first,between,\second]\message +%D \stoptyping +%D +%D Commands that are part of the list are expanded, so the +%D use of this macro has its limits. + +\def\processcommacommand[#1]% + {\expanded{\processcommalist[#1]}} + +%D The argument to \type{\command} is not delimited. Because +%D we often use \type{[]} as delimiters, we also have: +%D +%D \starttyping +%D \processcommalistwithparameters[string,string,...]\command +%D \stoptyping +%D +%D where \type{\command} looks like: +%D +%D \starttyping +%D \def\command[#1]{... #1 ...} +%D \stoptyping + +\def\processcommalistwithparameters[#1]#2% + {\def\docommand##1{#2[##1]}% + \processcommalist[#1]\docommand} + +%D \macros +%D {processaction, +%D processfirstactioninset, +%D processallactionsinset} +%D +%D \CONTEXT\ makes extensive use of a sort of case or switch +%D command. Depending of the presence of one or more provided +%D items, some actions is taken. These macros can be nested +%D without problems. +%D +%D \starttyping +%D \processaction [x] [a=>\a,b=>\b,c=>\c] +%D \processfirstactioninset [x,y,z] [a=>\a,b=>\b,c=>\c] +%D \processallactionsinset [x,y,z] [a=>\a,b=>\b,c=>\c] +%D \stoptyping +%D +%D We can supply both a \type{default} action and an action +%D to be undertaken when an \type{unknown} value is met: +%D +%D \starttyping +%D \processallactionsinset +%D [x,y,z] +%D [ a=>\a, +%D b=>\b, +%D c=>\c, +%D default=>\default, +%D unknown=>\unknown{... \commalistelement ...}] +%D \stoptyping +%D +%D When \type{#1} is empty, this macro scans list \type{#2} for +%D the keyword \type{default} and executed the related action +%D if present. When \type{#1} is non empty and not in the list, +%D the action related to \type{unknown} is executed. Both +%D keywords must be at the end of list \type{#2}. Afterwards, +%D the actually found keyword is available in +%D \type{\commalistelement}. An advanced example of the use of +%D this macro can be found in \PPCHTEX, where we completely +%D rely on \TEX\ for interpreting user supplied keywords like +%D \type{SB}, \type{SB1..6}, \type{SB125} etc. +%D +%D Even a quick glance at the macros below show some overlap, +%D which means that more efficient alternatives are possible. +%D Because these macro's are very sensitive to subtle changes, +%D we've decided to present the readable originals first +%D Maybe these these macros look complicated, but this is a +%D direct result of the support of nesting. Protection is only +%D applied in \type{\processaction}. +%D +%D \starttyping +%D \newcount\processlevel +%D +%D \def\processaction[#1]#2[#3]% +%D {\doifelse{#1}{} +%D {\def\p!compareprocessaction[##1=>##2]% +%D {\edef\!!stringa{##1}% +%D \ifx\!!stringa\s!default +%D \def\commalistelement{#1}% +%D ##2% +%D \fi}} +%D {\let\donottest=\dontprocesstest +%D \edef\!!stringb{#1}% +%D \let\donottest=\doprocesstest +%D \def\p!compareprocessaction[##1=>##2]% +%D {\edef\!!stringa{##1}% +%D \ifx\!!stringa\!!stringb +%D \def\commalistelement{#1}% +%D ##2% +%D \let\p!doprocessaction=\gobbleoneargument +%D \else\ifx\!!stringa\s!unknown +%D \def\commalistelement{#1}% +%D ##2% +%D \fi\fi}}% +%D \def\p!doprocessaction##1% +%D {\p!compareprocessaction[##1]}% +%D \processcommalist[#3]\p!doprocessaction} +%D +%D \def\processfirstactioninset[#1]#2[#3]% +%D {\doifelse{#1}{} +%D {\processaction[][#3]} +%D {\def\p!compareprocessaction[##1=>##2][##3]% +%D {\edef\!!stringa{##1}% +%D \edef\!!stringb{##3}% +%D \ifx\!!stringa\!!stringb +%D \def\commalistelement{##3}% +%D ##2% +%D \let\p!doprocessaction=\gobbleoneargument +%D \let\p!dodoprocessaction=\gobbleoneargument +%D \else\ifx\!!stringa\s!unknown +%D \def\commalistelement{##3}% +%D ##2% +%D \fi\fi}% +%D \def\p!doprocessaction##1% +%D {\def\p!dodoprocessaction####1% +%D {\p!compareprocessaction[####1][##1]}% +%D \processcommalist[#3]\p!dodoprocessaction}% +%D \processcommalist[#1]\p!doprocessaction}} +%D +%D \def\processallactionsinset[#1]#2[#3]% +%D {\doifelse{#1}{} +%D {\processaction[][#3]} +%D {\advance\processlevel by 1 +%D \def\p!compareprocessaction[##1=>##2][##3]% +%D {\edef\!!stringa{##1}% +%D \edef\!!stringb{##3}% +%D \ifx\!!stringa\!!stringb +%D \def\commalistelement{##3}% +%D ##2% +%D \let\p!dodoprocessaction=\gobbleoneargument +%D \else\ifx\!!stringa\s!unknown +%D \def\commalistelement{##3}% +%D ##2% +%D \fi\fi}% +%D \setvalue{\s!do\the\processlevel}##1% +%D {\def\p!dodoprocessaction####1% +%D {\p!compareprocessaction[####1][##1]}% +%D \processcommalist[#3]\p!dodoprocessaction}% +%D \processcommalist[#1]{\getvalue{\s!do\the\processlevel}}% +%D \advance\processlevel by -1 }} +%D \stoptyping +%D +%D The gain of speed in the (again) next implementation is +%D around 20\%, depending on the application. + +\newcount\processlevel + +\def\p!compareprocessactionA[#1=>#2][#3]% + {\edef\!!stringb{#1}% + \ifx\!!stringb\s!default + \let\commalistelement\empty + #2% + \fi} + +% \def\p!compareprocessactionB[#1=>#2][#3]% +% {\expandedaction\!!stringb{#1}% +% \ifx\!!stringa\!!stringb +% \def\commalistelement{#3}% +% #2% +% \let\p!doprocessaction\gobbleoneargument +% \else +% \edef\!!stringb{#1}% +% \ifx\!!stringb\s!unknown +% \def\commalistelement{#3}% beware of loops +% #2% +% \fi +% \fi} + +% met \quitcommalist tot meer dan 25\% sneller + +\def\p!compareprocessactionB[#1=>#2][#3]% + {\expandedaction\!!stringb{#1}% + \ifx\!!stringa\!!stringb + \def\commalistelement{#3}% + #2% + \expandafter\quitcommalist + \else + \edef\!!stringb{#1}% + \ifx\!!stringb\s!unknown + \def\commalistelement{#3}% beware of loops + #2% + \fi + \fi} + +\beginTEX + +\def\processaction[#1]#2[#3]% + {\let\donottest\dontprocesstest + \expandedaction\!!stringa{#1}% + \let\donottest\doprocesstest + \ifx\!!stringa\empty + \let\p!compareprocessaction\p!compareprocessactionA + \else + \let\p!compareprocessaction\p!compareprocessactionB + \fi + \def\p!doprocessaction##1% + {\p!compareprocessaction[##1][#1]}% + \processcommalist[#3]\p!doprocessaction + \expandactions} + +\endTEX + +\beginETEX \protected + +\def\processaction[#1]#2[#3]% faster version follows + {\expandedaction\!!stringa{#1}% + \ifx\!!stringa\empty + \let\p!compareprocessaction\p!compareprocessactionA + \else + \let\p!compareprocessaction\p!compareprocessactionB + \fi + \def\p!doprocessaction##1% + {\p!compareprocessaction[##1][#1]}% + \processcommalist[#3]\p!doprocessaction + \expandactions} + +\endETEX + +% \def\p!compareprocessactionC[#1=>#2][#3]% +% {\expandedaction\!!stringa{#1}% +% \expandedaction\!!stringb{#3}% +% \ifx\!!stringa\!!stringb +% \def\commalistelement{#3}% +% #2% +% \let\p!doprocessaction\gobbleoneargument +% \let\p!dodoprocessaction\gobbleoneargument +% \else +% \edef\!!stringa{#1}% +% \ifx\!!stringa\s!unknown +% \def\commalistelement{#3}% +% #2% +% \fi +% \fi} + +\def\p!compareprocessactionC[#1=>#2][#3]% + {\expandedaction\!!stringa{#1}% + \expandedaction\!!stringb{#3}% + \ifx\!!stringa\!!stringb + \def\commalistelement{#3}% + #2% + \expandafter\quitprevcommalist + \else + \edef\!!stringa{#1}% + \ifx\!!stringa\s!unknown + \def\commalistelement{#3}% + #2% + \fi + \fi} + +\def\processfirstactioninset[#1]#2[#3]% faster version follows + {\expandedaction\!!stringa{#1}% + \ifx\!!stringa\empty + \processaction[][#3]% + \else + \def\p!doprocessaction##1% + {\def\p!dodoprocessaction####1% + {\p!compareprocessactionC[####1][##1]}% + \processcommalist[#3]\p!dodoprocessaction}% + \processcommalist[#1]\p!doprocessaction + \fi + \expandactions} + +% \def\p!compareprocessactionD[#1=>#2][#3]% +% {\expandedaction\!!stringa{#1}% +% \expandedaction\!!stringb{#3}% +% \ifx\!!stringa\!!stringb +% \def\commalistelement{#3}% +% #2% +% \let\p!dodoprocessaction\gobbleoneargument +% \else +% \edef\!!stringa{#1}% +% \ifx\!!stringa\s!unknown +% \def\commalistelement{#3}% +% #2% +% \fi +% \fi} + +\def\p!compareprocessactionD[#1=>#2][#3]% + {\expandedaction\!!stringa{#1}% + \expandedaction\!!stringb{#3}% + \ifx\!!stringa\!!stringb + \def\commalistelement{#3}% + #2% + \expandafter\quitcommalist + \else + \edef\!!stringa{#1}% + \ifx\!!stringa\s!unknown + \def\commalistelement{#3}% + #2% + \fi + \fi} + +\def\doprocessallactionsinset + {\csname\s!do\the\processlevel\endcsname} + +\def\processallactionsinset[#1]#2[#3]% faster version follows + {\expandedaction\!!stringa{#1}% + \ifx\!!stringa\empty + \processaction[][#3]% + \else + \advance\processlevel \plusone + \expandafter\def\csname\s!do\the\processlevel\endcsname##1% + {\def\p!dodoprocessaction####1% + {\p!compareprocessactionD[####1][##1]}% + \processcommalist[#3]\p!dodoprocessaction}% + \processcommalist[#1]\doprocessallactionsinset + \advance\processlevel \minusone + \fi + \expandactions} + +%D We can speed up these macros a bit when we use a dedicated +%D commalist processor, one that avoids passing the (often) +%D big action list. + +\beginTEX + +\def\processaction[#1]#2[% + {\let\donottest\dontprocesstest + \expandedaction\!!stringa{#1}% + \let\donottest\doprocesstest + \ifx\!!stringa\empty + \let\p!compareprocessaction\p!compareprocessactionA + \else + \let\p!compareprocessaction\p!compareprocessactionB + \fi + \def\p!doprocessaction##1% + {\p!compareprocessaction[##1][#1]}% + \processnextcommalist\relax\expandactions\p!doprocessaction[} + +\endTEX + +\beginETEX + +\def\processaction[#1]#2[% + {\expandedaction\!!stringa{#1}% + \ifx\!!stringa\empty + \let\p!compareprocessaction\p!compareprocessactionA + \else + \let\p!compareprocessaction\p!compareprocessactionB + \fi + \def\p!doprocessaction##1% + {\p!compareprocessaction[##1][#1]}% + \processnextcommalist\relax\expandactions\p!doprocessaction[} + +\endETEX + +\def\processfirstactionsinset[#1]% + {\expandedaction\!!stringa{#1}% + \ifx\!!stringa\empty + \expandafter\processaction + \else + \expandafter\processfirstactionsinsetindeed + \fi + [#1]} + +\def\processfirstactioninsetindeed[#1]#2[#3]% + {\def\p!doprocessaction##1% + {\def\p!dodoprocessaction####1% + {\p!compareprocessactionC[####1][##1]}% + \processcommalist[#3]\p!dodoprocessaction}% + \processcommalist[#1]\p!doprocessaction + \expandactions} + +\def\processallactionsinset[#1]% + {\expandedaction\!!stringa{#1}% + \ifx\!!stringa\empty + \expandafter\processaction + \else + \expandafter\processallactionsinsetindeed + \fi + [#1]} + +\def\processallactionsinsetindeed[#1]#2[#3]% + {\advance\processlevel \plusone + \expandafter\def\csname\s!do\the\processlevel\endcsname##1% + {\def\p!dodoprocessaction####1% + {\p!compareprocessactionD[####1][##1]}% + \processcommalist[#3]\p!dodoprocessaction}% + \processcommalist[#1]\doprocessallactionsinset + \advance\processlevel \minusone + \expandactions} + +\def\processnextcommalist#1#2#3[#4#5]% + {#1% + \let\nexttoken#4% + \global\advance\commalevel \plusone + \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,% + {#3{##1}\doprocesscommaitem}% + \dodoprocesscommaitem#4#5,]\relax + \global\advance\commalevel \minusone + #2} + +%D I do have an even faster version (saving 3 sec on a 13 +%D sec run for 50K invocations, but normally we don't have +%D that many calls and that alternative uses more macros and is +%D even less readable. What we did add, was \type {\@EA}, so +%D that we can pass a command. + +%D \macros +%D {unexpandedprocessaction, +%D unexpandedprocessfirstactioninset, +%D unexpandedprocessallactionsinset} +%D +%D Now what are those expansion commands doing there. Well, +%D sometimes we want to compare actions that may consist off +%D commands (i.e. are no constants). In such occasions we can +%D use the a bit slower alternatives: + +\def\unexpandedprocessfirstactioninset{\dontexpandactions\processfirstactioninset} +\def\unexpandedprocessaction {\dontexpandactions\processaction} +\def\unexpandedprocessallactionsinset {\dontexpandactions\processallactionsinset} + +%D By default we expand actions: + +\def\expandactions{\let\expandedaction\edef} \expandactions + +%D But when needed we convert the strings to meaningful +%D sequences of characters. + +\def\unexpandedaction#1>{} + +\def\noexpandedaction#1#2% + {\def\@@convertedargument{#2}% + \@EA\edef\@EA#1\@EA{\@EA\unexpandedaction\meaning\@@convertedargument}} + +\def\dontexpandactions% + {\let\expandedaction\noexpandedaction} + +%D \macros +%D {getfirstcharacter, firstcharacter, remainingcharacters, doiffirstcharacter} +%D +%D Sometimes the action to be undertaken depends on the +%D next character. This macro get this character and puts it in +%D \type{\firstcharacter}. +%D +%D \starttyping +%D \getfirstcharacter {string} +%D \stoptyping +%D +%D A two step expansion is used to prevent problems with +%D complicated arguments, for instance arguments that +%D consist of two or more expandable tokens. + +\def\dogetfirstcharacter#1#2\relax + {\def\firstcharacter{#1}% + \def\remainingcharacters{#2}} + +\def\getfirstcharacter#1% + {\edef\!!stringa{#1}% + \expandafter\dogetfirstcharacter\!!stringa\relax} + +\def\doiffirstcharelse#1#2% char string +% kort (maar onleesbaar) +% {\expanded{\dogetfirstcharacter#2}\\\doifelse{#1}\firstcharacter} +% korter (en begrijpelijk)) + {\getfirstcharacter{#2}\doifelse{#1}\firstcharacter} +% snel (maar zelden gebruikt, dus niet zo belangrijk) +% {\getfirstcharacter{#2}% +% \edef\!!stringa{#1}% +% \ifx\!!stringa\firstcharacter +% \expandafter\firstoftwoarguments +% \else +% \expandafter\secondoftwoarguments +% \fi} + +%D \macros +%D {doifinstringelse, doifincsnameelse} +%D +%D We can check for the presence of a substring in a given +%D sequence of characters. +%D +%D \starttyping +%D \doifinsetelse {substring} {string} {then ...} {else ...} +%D \stoptyping +%D +%D An application of this command can be found further on. +%D Like before, we first show some alternatives, like the one +%D we started with: +%D +%D \starttyping +%D \long\def\p!doifinstringelse#1#2#3#4% +%D {\def\pp!doifinstringelse##1#1##2##3\war% +%D {\if##2@% +%D #4% +%D \else +%D #3% +%D \fi}% +%D \pp!doifinstringelse#2#1@@\war} +%D +%D \def\doifinstringelse% +%D {\ExpandBothAfter\p!doifinstringelse} +%D \stoptyping +%D +%D After this we came to: +%D +%D \starttyping +%D \def\p!doifinstringelse#1#2% +%D {\def\pp!doifinstringelse##1#1##2##3\war% +%D {\if##2@}% +%D \pp!doifinstringelse#2#1@@\war} +%D +%D \def\doifinstringelse#1#2#3#4% +%D {\ExpandBothAfter\p!doifinstringelse{#1}{#2}% +%D #4% +%D \else +%D #3% +%D \fi} +%D \stoptyping +%D +%D Sometimes the second argument is passed as a macro. By +%D postponing the expansion of this macro, we gain quite some +%D run time, simply because the less tokens we pass, the faster +%D \TEX\ runs. So finally the definition became: + +% \long\def\rawdoifinstringelse#1#2% ##2 can be {abc} +% {\long\def\pp!doifinstringelse##1#1##2##3\war{\if##2@}% +% \pp!doifinstringelse#2#1@@\war +% \expandafter\secondoftwoarguments +% \else +% \expandafter\firstoftwoarguments +% \fi} + +\long\def\doifinstringelse#1% + {\edef\@@@instring{#1}% expand #1 here + \ifx\@@@instring\empty + \@EA\thirdofthreearguments + \else + \@EA\dodoifinstringelse + \fi} + +\long\def\dodoifinstringelse#1% + {\p!doifinstringelse\@@@instring{#1}% + \@EA\firstoftwoarguments + \else + \@EA\secondoftwoarguments + \fi} + +\long\def\doifinstring#1%% + {\edef\@@@instring{#1}% expand #1 here + \ifx\@@@instring\empty + \@EA\gobbletwoarguments + \else + \@EA\dodoifinstring + \fi} + +\long\def\dodoifinstring#1% + {\p!doifinstringelse\@@@instring{#1}% + \@EA\firstofoneargument + \else + \@EA\gobbleoneargument + \fi} + +\long\def\doifnotinstring#1%% + {\edef\@@@instring{#1}% expand #1 here + \ifx\@@@instring\empty + \@EA\gobbletwoarguments + \else + \@EA\dodoifnotinstring + \fi} + +\long\def\dodoifnotinstring#1% + {\p!doifinstringelse\@@@instring{#1}% + \@EA\gobbleoneargument + \else + \@EA\firstofoneargument + \fi} + +%D \starttyping +%D \beginTEX +%D +%D \long\def\p!doifinstringelse#1#2% +%D {\long\def\pp!doifinstringelse##1#1##2##3\war% +%D {\csname if\if##2@fals\else tru\fi e\endcsname}% +%D \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here +%D +%D \endTEX +%D +%D \beginETEX \unless +%D +%D \long\def\p!doifinstringelse#1#2% +%D {\long\def\pp!doifinstringelse##1#1##2##3\war% +%D {\unless\if##2@}% +%D \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here +%D +%D \endETEX +%D \stoptyping +%D +%D And then \unknown\ after a couple of years, we ran into a +%D situation where \type {##2} was something \type {{bla}}. So +%D finally we need to use an auxiliary macro, otherwise we get +%D funny strings in the output. + +% \long\def\p!doifinstringelse#1#2% ##2 can be {abc} +% {\long\@EA\def\@EA\pp!doifinstringelse\@EA##\@EA1#1##2##3\war % expand #1 here +% {\ppp!doifinstringelse##2\war}% +% \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here +% +% \beginTEX +% +% \def\ppp!doifinstringelse#1#2\war% +% {\csname if\ifx#1@fals\else tru\fi e\endcsname}% +% +% \endTEX +% +% \beginETEX \unless +% +% \def\ppp!doifinstringelse#1#2\war% +% {\unless\ifx#1@} +% +% \endETEX + +\beginETEX + +\long\def\p!doifinstringelse#1#2% ##2 can be {abc} + {\long\@EA\def\@EA\pp!doifinstringelse\@EA##\@EA1#1##2##3\war % expand #1 here + {\unless\if##2@}% +% \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here + \expanded{\pp!doifinstringelse#2#1}@@\war} % expand #2 here + +\endETEX + +\beginTEX + +\long\def\p!doifinstringelse#1#2% ##2 can be {abc} + {\long\@EA\def\@EA\pp!doifinstringelse\@EA##\@EA1#1##2##3\war % expand #1 here + {\csname if\if##2@fals\else tru\fi e\endcsname}% + %\expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here + \expanded{\pp!doifinstringelse#2#1}@@\war} % expand #2 here + +\endTEX + +%D The next alternative proved to be upto twice as fast on +%D tasks like checking reserved words in pretty verbatim +%D typesetting! This is mainly due to the fact that passing +%D (expanded) strings is much slower that passing a macro. +%D +%D \starttyping +%D \doifincsnameelse {substring} {\string} {then ...} {else ...} +%D \stoptyping +%D +%D Where \type{\doifinstringelse} does as much expansion as +%D possible, the latter alternative does minimal (one level) +%D expansion. + +\beginTEX + +\long\def\p!doifincsnameelse#1#2% + {\long\def\pp!doifincsnameelse##1#1##2##3\war + {\csname if\if##2@fals\else tru\fi e\endcsname}% + \@EA\pp!doifincsnameelse#2#1@@\war} + +\endTEX + +\beginETEX \unless + +\long\def\p!doifincsnameelse#1#2% + {\long\def\pp!doifincsnameelse##1#1##2##3\war + {\unless\if##2@}% + \@EA\pp!doifincsnameelse#2#1@@\war} + +\endETEX + +\long\def\doifincsnameelse#1#2% % #3#4% + {\edef\@@@instring{#1}% + \@EA\p!doifincsnameelse\@EA{\@@@instring}{#2}% % #3\else#4\fi} + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +%D \macros +%D {doifnumberelse} +%D +%D The next macro executes a command depending of the outcome +%D of a test on numerals. This is probably one of the fastest +%D test possible, exept from a less robust 10||step +%D \type{\if}||ladder or some tricky \type{\lcode} checking. +%D +%D \starttyping +%D \doifnumberelse {string} {then ...} {else ...} +%D \stoptyping +%D +%D The macro accepts \type{123}, \type{abc}, \type{{}}, +%D \type{\getal} and \type{\the\count...}. This macro is a +%D rather dirty one. +%D +%D \starttyping +%D \long\def\doifnumberelse#1#2#3% +%D {\begingroup\donefalse +%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\donetrue\fi +%D \ifdone\endgroup#2\else\endgroup#3\fi} +%D \stoptyping +%D +%D Or better: +%D +%D \starttyping +%D \long\def\doifnumberelse#1% +%D {\begingroup\donefalse +%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\donetrue\fi +%D \ifdone +%D \endgroup\expandafter\firstoftwoarguments +%D \else +%D \endgroup\expandafter\secondoftwoarguments +%D \fi} +%D \stoptyping +%D +%D A previous implementation was: +%D +%D \starttyping +%D \long\def\doifnumberelse#1#2#3% +%D {\getfirstcharacter{#1}% +%D \@EA\p!doifinstringelse\@EA{\firstcharacter}{1234567890}% +%D #2% +%D \else +%D #3% +%D \fi} +%D \stoptyping +%D +%D And before we had \type{\p!doifinstringelse} available, we +%D used: +%D +%D \starttyping +%D \def\doifnumberelse#1% +%D {\getfirstcharacter{#1}% +%D \rawdoifinsetelse{\firstcharacter}{1,2,3,4,5,6,7,8,9,0}} +%D \stoptyping +%D +%D The implementation using \type {\ifcase} is much faster, but +%D the next one is not, not even when testing milion calls. +%D +%D \starttyping +%D \newif\ifitsanumber +%D +%D \long\def\isitanumber#1% +%D {\itsanumberfalse +%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\itsanumbertrue\fi} +%D +%D \long\def\doifnumberelse#1#2#3% +%D {\isitanumber{#1}\ifitsanumber#2\else#3\fi} +%D \stoptyping +%D +%D After a while the next evolved and this one is the one we +%D will use. This one is some 5\% faster than the group/done +%D one (partly because it does not have to pass arguments). +%D Even more important is that this alternative is fully +%D expandable! + +\long\def\doifnumberelse#1% does not accept counters + {\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + +%D \macros +%D {makerawcommalist, +%D rawdoinsetelse, +%D rawprocesscommalist, +%D rawprocessaction} +%D +%D Some of the commands mentioned earlier are effective but +%D slow. When one is desperately in need of faster alternatives +%D and when the conditions are predictable safe, the \type{\raw} +%D alternatives come into focus. A major drawback is that +%D they do not take \type{\c!constants} into account, simply +%D because no expansion is done. This is no problem with +%D \type{\rawprocesscommalist}, because this macro does not +%D compare anything. Expandable macros are permitted as search +%D string. +%D +%D \starttyping +%D \makerawcommalist[string,string,...]\stringlist +%D \rawdoifinsetelse{string}{string,...}{...}{...} +%D \rawprocesscommalist[string,string,...]\commando +%D \rawprocessaction[x][a=>\a,b=>\b,c=>\c] +%D \stoptyping +%D +%D Spaces embedded in the list, for instance after commas, +%D spoil the search process. The gain in speed depends on the +%D length of the argument (the longer the argument, the less +%D we gain). +%D +%D The slow alternative looks like: +%D +%D \starttyping +%D \def\makerawcommalist[#1]#2% +%D {\def\appendtocommalist##1% +%D {\doifelse{#2}{} +%D {\edef#2{##1}} +%D {\edef#2{#2,##1}}}% +%D \def#2{}% +%D \processcommalist[#1]\appendtocommalist} +%D \stoptyping +%D +%D But we prefer: + +% \appendtocommalist is defined in syst-ext + +\def\makerawcommalist[#1]#2% use \processnext ... here + {\def\domakerawcommalist##1% we don't expand ##1 + {\ifx#2\empty + \def#2{##1}% + \else + \@EA\def\@EA#2\@EA{#2,##1}% + \fi}% + \let#2\empty + \processcommalist[#1]\domakerawcommalist} + +\def\rawprocesscommaitem#1,#2% #2 eats up preceding space + {\if]#1\else + \csname\s!next\the\commalevel\endcsname{#1}% + \expandafter\rawprocesscommaitem + \fi#2} + +\def\rawprocesscommalist[#1]#2% accepteert ook [\cs] + {\global\advance\commalevel \plusone + \expandafter\let\csname\s!next\the\commalevel\endcsname#2% + \expandafter\rawprocesscommaitem#1,],% \relax + \global\advance\commalevel \minusone } + +\def\rawprocesscommacommand[#1]% not really needed + {\expanded{\rawprocesscommalist[#1]}} + +% \def\rawdoifinsetelse#1#2{\doifinstringelse{,#1,}{,#2,}} +% \def\rawdoifinset #1#2{\doifinstring {,#1,}{,#2,}} + +\def\@@rawempty{,,} + +\long\def\rawdoifinsetelse#1% + {\edef\@@@instring{,#1,}% expand #1 here + \ifx\@@@instring\@@rawempty + \@EA\thirdofthreearguments + \else + \@EA\rawdodoifinsetelse + \fi} + +\long\def\rawdodoifinsetelse#1% + {\p!doifinstringelse\@@@instring{,#1,}% + \@EA\firstoftwoarguments + \else + \@EA\secondoftwoarguments + \fi} + +\long\def\rawdoifinset#1% + {\edef\@@@instring{,#1,}% expand #1 here + \ifx\@@@instring\@@rawempty + \@EA\gobbletwoarguments + \else + \@EA\rawdodoifinset + \fi} + +\long\def\rawdodoifinset#1%% + {\p!doifinstringelse\@@@instring{,#1,}% + \@EA\firstofoneargument + \else + \@EA\gobbleoneargument + \fi} + +%D Some more raw material: + +\def\p!rawprocessaction[#1][#2]% + {\def\pp!rawprocessaction##1,#1=>##2,##3\war% + {\if##3@\else + \def\!!processaction{##2}% + \fi}% + \pp!rawprocessaction,#2,#1=>,@\war} + +\def\rawprocessaction[#1]#2[#3]% + {\edef\!!stringa{#1}% + \edef\!!stringb{undefined}% better \!!undefined + \let\!!processaction\!!stringb + \ifx\!!stringa\empty + \@EA\p!rawprocessaction\@EA[\s!default][#3]% + \else + \expandafter\p!rawprocessaction\expandafter[\!!stringa][#3]% + \ifx\!!processaction\!!stringb + \@EA\p!rawprocessaction\@EA[\s!unknown][#3]% + \fi + \fi + \ifx\!!processaction\!!stringb + \else + \!!processaction + \fi} + +% not needed +% +% \def\rawprocessallactionsinset[#1]#2[#3]% +% {\def\docommand##1% +% {\rawprocessaction[##1][#3]}% +% \processcommalist[#1]\docommand} + +%D When we process the list \type{a,b,c,d,e}, the raw routine +%D takes over 30\% less time, when we feed $20+$ character +%D strings we gain about 20\%. Alternatives which use +%D \type{\futurelet} perform worse. Part of the speedup is +%D due to the \type{\let} and \type{\expandafter} in the test. + +% %D \macros +% %D {processunexpandedcommalist} +% %D +% %D When processing commalists, the arguments are expanded. The +% %D main reason for doing so lays in the fact that these +% %D macros are used for interfacing. The next alternative can be used +% %D for +% %D +% %D \starttyping +% %D \processunexpandedcommalist +% %D [\alfa\beta,\gamma,\delta\epsilon] +% %D \handleitem +% %D \stoptyping +% %D +% %D This time nesting is not supported. +% +% %\def\processunexpandedcommaitem#1,% +% % {\if]\noexpand#1% +% % \let\nextcommaitem\relax +% % \else +% % \handleunexpandedcommaitem{#1}% +% % \let\nextcommaitem\processunexpandedcommaitem +% \fi +% \nextcommaitem} +% +% faster: +% +% \def\processunexpandedcommaitem#1,% +% {\if]\noexpand#1\else +% \handleunexpandedcommaitem{#1}% +% \expandafter\processunexpandedcommaitem +% \fi} +% +% \def\processunexpandedcommalist[#1]#2% +% {\def\handleunexpandedcommaitem{#2}% +% \processunexpandedcommaitem#1,],}% \relax} +% +% %D Or faster: +% +% \def\processunexpandedcommaitem#1,% +% {\if]\noexpand#1\else +% \handleunexpandedcommaitem{#1}% +% \expandafter\processunexpandedcommaitem +% \fi} + +%D \macros +%D {dosetvalue,dosetevalue,dosetgvalue,docopyvalue,doresetvalue, +%D dogetvalue} +%D +%D When we are going to do assignments, we have to take +%D multi||linguality into account. For the moment we keep +%D things simple and single||lingual. +%D +%D \starttyping +%D \dosetvalue {label} {variable} {value} +%D \dosetevalue {label} {variable} {value} +%D \dosetgvalue {label} {variable} {value} +%D \docopyvalue {to label} {from label} {variable} +%D \doresetvalue {label} {variable} +%D \stoptyping +%D +%D These macros are in fact auxiliary ones and are not meant +%D for use outside the assignment macros. + +\def\dosetvalue#1#2% #3 + {\@EA\def\csname#1#2\endcsname} % {#3}} + +\def\dosetevalue#1#2% #3 + {\@EA\edef\csname#1#2\endcsname} % {#3}} + +\def\dosetgvalue#1#2% #3 + {\@EA\gdef\csname#1#2\endcsname} % {#3}} + +\def\doresetvalue#1#2% + {\@EA\let\csname#1#2\endcsname\empty} + +\def\doignorevalue#1#2#3% + {\@EA\let\csname#1#2\endcsname\empty} + +\def\docopyvalue#1#2#3% + {\@EA\def\csname#1#3\endcsname{\csname#2#3\endcsname}} + +%D \macros +%D {doassign,undoassign,doassignempty} +%D +%D Assignments are the backbone of \CONTEXT. Abhorred by the +%D concept of style file hacking, we took a considerable effort +%D in building a parameterized system. Unfortunately there is a +%D price to pay in terms of speed. Compared to other packages +%D and taking the functionality of \CONTEXT\ into account, the +%D total size of the format file is still very acceptable. Now +%D how are these assignments done. +%D +%D Assignments can be realized with: +%D +%D \starttyping +%D \doassign[label][variable=value] +%D \undoassign[label][variable=value] +%D \stoptyping +%D +%D and: +%D +%D \starttyping +%D \doassignempty[label][variable=value] +%D \stoptyping +%D +%D Assignments like \type{\doassign} are compatible with: +%D +%D \starttyping +%D \def\labelvariable{value} +%D \stoptyping +%D +%D We do check for the presence of an \type{=} and loudly +%D complain of it's missed. We will redefine this macro later +%D on, when a more advanced message mechanism is implemented. + +\newif\iferrorisfatal + +\def\waitonfatalerror + {\iferrorisfatal\wait\fi} + +\def\showassignerror#1#2% + {\writestatus{setup}{missing or ungrouped '=' after '#1' in line #2}% + \waitonfatalerror} + +%\def\p!doassign#1[#2][#3=#4=#5]% +% {\let\donottest\dontprocesstest +% \edef\!!stringa{#5}% +% \let\!!stringb\relax +% \let\donottest\doprocesstest +% \ifx\!!stringa\!!stringb +% \showassignerror{#3}% +% \else +% #1{#2}{#3}{#4}% +% \fi} + +\def\p!doassign#1[#2][#3=#4=#5]% + {\ifx\empty#3\else % and definitely not \ifx#3\empty + \ifx\relax#5% + \showassignerror{#3}{\the\inputlineno\space(#2)}% + \else + #1{#2}{#3}{#4}% + \fi + \fi} + +\def\doassign [#1][#2]{\p!doassign\dosetvalue [#1][#2==\relax]} +\def\doeassign [#1][#2]{\p!doassign\dosetevalue [#1][#2==\relax]} +\def\undoassign[#1][#2]{\p!doassign\doresetvalue[#1][#2==\relax]} + +\def\doassignempty[#1][#2=#3]% + {\ifundefined{#1#2}\dosetvalue{#1}{#2}{#3}\fi} + +%D \macros +%D {getparameters,geteparameters,getgparameters, +%D forgetparameters} +%D +%D Using the assignment commands directly is not our +%D ideal of user friendly interfacing, so we take some further +%D steps. +%D +%D \starttyping +%D \getparameters [label] [...=...,...=...] +% %D \forgetparameters [label] [...=...,...=...] +%D \stoptyping +%D +%D Again, the label identifies the category a variable +%D belongs to. The second argument can be a comma separated +%D list of assignments. +%D +%D \starttyping +%D \getparameters +%D [demo] +%D [alfa=1, +%D beta=2] +%D \stoptyping +%D +%D is equivalent to +%D +%D \starttyping +%D \def\demoalfa{1} +%D \def\demobeta{2} +%D \stoptyping +%D +%D +%D In the pre||multi||lingual stadium \CONTEXT\ took the next +%D approach. With +%D +%D \starttyping +%D \def\??demo {@@demo} +%D \def\!!alfa {alfa} +%D \def\!!beta {beta} +%D \stoptyping +%D +%D calling +%D +%D \starttyping +%D \getparameters +%D [\??demo] +%D [\!!alfa=1, +%D \!!beta=2] +%D \stoptyping +%D +%D lead to: +%D +%D \starttyping +%D \def\@@demoalfa{1} +%D \def\@@demobeta{2} +%D \stoptyping +%D +%D Because we want to be able to distinguish the \type{!!} +%D pre||tagged user supplied variables from internal +%D counterparts, we will introduce a slightly different tag in +%D the multi||lingual modules. There we will use \type{c!} or +%D \type{v!}, depending on the context. +%D +%D By calling \type{\p!doassign} directly, we save ourselves +%D some argument passing and gain some speed. Whatever +%D optimizations we do, this command will always be one of the +%D bigger bottlenecks. +%D +%D The alternative \type{\geteparameters} --- it's funny to +%D see that this alternative saw the light so lately --- can be +%D used to do expanded assigments. + +\def\dogetparameters#1[#2]#3[#4]% + {\def\p!dogetparameter##1% + {\p!doassign#1[#2][##1==\relax]}% + \processcommalist[#4]\p!dogetparameter} + +\def\getparameters {\dogetparameters\dosetvalue} +\def\geteparameters {\dogetparameters\dosetevalue} +\def\getgparameters {\dogetparameters\dosetgvalue} +\def\forgetparameters{\dogetparameters\doignorevalue} + +\let\getexpandedparameters=\geteparameters + +%D This one is slightly faster: + +\def\dogetparameters#1[#2]#3[#4% + {\if\noexpand#4]% + \expandafter\gobbleoneargument + \else + \def\p!dogetparameter##1{\p!doassign#1[#2][##1==\relax]}% + \expandafter\xdogetparameters + \fi#4} + +\def\xdogetparameters#1]% + {\processcommalist[#1]\p!dogetparameter} + +%D The next alternative is much faster but also uglier. Because +%D in \XML\ processing we will probably set much more parameters +%D than normally we need this faster one. + +\def\dogetparameters#1[#2]#3[#4% + {\if\noexpand#4]% + \expandafter\gobbleoneargument + \else + \def\p!dogetparameter{\p!doassign#1#2}% + \expandafter\xdogetparameters + \fi#4} + +\def\xdogetparameters#1]% + {\xprocesscommaitem#1,],\@relax@} + +% \long\def\xprocesscommaitem#1,#2% #2 takes space before , +% {\if]#1% +% \expandafter\gobbleoneargument +% \else +% \p!dogetparameter\@relax@#1==\@relax@ +% \expandafter\xprocesscommaitem +% \fi#2} + +\long\def\xprocesscommaitem#1,#2% #2 takes space before , + {\if,#1,% dirty trick for testing #1=empty + \@EA\xprocesscommaitem + \else\if]#1% + \@EAEAEA\gobbleoneargument + \else + \p!dogetparameter\@relax@#1==\empty\@relax@ + \@EAEAEA\xprocesscommaitem + \fi\fi#2} + +%D Here we use a slightly different assignment macro: + +% \def\p!doassign#1#2\@relax@#3=#4=#5\@relax@ +% {\ifx\@relax@#5\@EA\xshowassignerror\else\@EA#1\fi{#2}{#3}{#4}} + +% \def\p!doassign#1#2\@relax@#3=#4=#5\@relax@ +% {\ifx#5\empty\@EA\xshowassignerror\else\@EA#1\fi{#2}{#3}{#4}} + +\def\p!doassign#1#2\@relax@#3=#4=#5#6\@relax@ + {\ifx#5\empty + \@EA\xshowassignerror + \else\ifx#5=% + \@EAEAEA#1% + \else + \@EAEAEA\xshowassignerror + \fi\fi + {#2}{#3}{#4}} + +\def\xshowassignerror#1#2#3% + {\showassignerror{#2}{\the\inputlineno\space(#1)}} + +%D Now we also have to change the other macros that depend +%D on this low level one. + +% \def\doassign [#1][#2]{\p!doassign\dosetvalue #1\@relax@#2==\@relax@} +% \def\doeassign [#1][#2]{\p!doassign\dosetevalue #1\@relax@#2==\@relax@} +% \def\undoassign[#1][#2]{\p!doassign\doresetvalue#1\@relax@#2==\@relax@} + +\def\doassign [#1][#2]{\p!doassign\dosetvalue #1\@relax@#2==\empty\@relax@} +\def\doeassign [#1][#2]{\p!doassign\dosetevalue #1\@relax@#2==\empty\@relax@} +\def\undoassign[#1][#2]{\p!doassign\doresetvalue#1\@relax@#2==\empty\@relax@} + +%D When someone asked on the mailing list if it's possible to +%D use the current value of a parameter, Taco posted a small module. His +%D method had the disadvantage of making all assignments expanded and thereby +%D fragile. The following alternative uses a prefix. + +%D \macros{currentvalue} +%D +%D Just in case a \type{\getparameter} argument itself ends up +%D inside a \type{\write} or other expandable location, our +%D new macro needs a default value. + +\let\currentvalue\empty + +% \def\p!n!doassign#1#2\@relax@#3=#4=#5#6\@relax@% normal +% {\ifx#5\empty +% \@EA\xshowassignerror +% \else\ifx#5=% +% \@EAEAEA#1% +% \else +% \@EAEAEA\xshowassignerror +% \fi\fi +% {#2}{#3}{#4}} + +\def\p!n!doassign#1#2\@relax@#3=#4=#5#6\@relax@ + {\ifx\empty#3\empty + \@EA\xshowassignerror + \else\ifx#5\empty + \@EAEAEA\xshowassignerror + \else + \@EAEAEA#1% + \fi\fi + {#2}{#3}{#4}} + +\beginTEX + +% \def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@ +% {\ifx#5\empty +% \@EA\xshowassignerror +% \else\ifx#5=% +% \@EA\ifx\csname#2#3\endcsname\relax +% \let\currentvalue\empty +% \else +% \@EA\let\@EA\currentvalue\csname#2#3\endcsname +% \fi +% \@EAEAEA#1% +% \else +% \@EAEAEA\xshowassignerror +% \fi\fi +% {#2}{#3}{#4}} + +\def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@ + {\ifx\empty#3\empty + \@EA\xshowassignerror + \else\ifx#5\empty + \@EAEAEA\xshowassignerror + \else + \@EA\ifx\csname#2#3\endcsname\relax + \let\currentvalue\empty + \else + \@EA\let\@EA\currentvalue\csname#2#3\endcsname + \fi + \@EAEAEA#1% + \fi\fi + {#2}{#3}{#4}} + +\endTEX + +\beginETEX + +% \def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@ +% {\ifx#5\empty +% \@EA\xshowassignerror +% \else\ifx#5=% +% \ifcsname#2#3\endcsname +% \@EA\let\@EA\currentvalue\csname#2#3\endcsname +% \else +% \let\currentvalue\empty +% \fi +% \@EAEAEA#1% +% \else +% \@EAEAEA\xshowassignerror +% \fi\fi +% {#2}{#3}{#4}} + +\def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@ + {\ifx\empty#3\empty + \@EA\xshowassignerror + \else\ifx#5\empty + \@EAEAEA\xshowassignerror + \else + \ifcsname#2#3\endcsname + \@EA\let\@EA\currentvalue\csname#2#3\endcsname + \else + \let\currentvalue\empty + \fi + \@EAEAEA#1% + \fi\fi + {#2}{#3}{#4}} + +\endETEX + +%D We default to: + +\let\p!doassign\p!n!doassign + +%D And set: + +\let\currentvalue\empty + +%D \macros {expandparameters} +%D +%D Example usage: +%D +%D \startbuffer +%D \getparameters[taco][name=taco] +%D \convertcommand\taconame\to\ascii \ascii +%D \expandparameters \getparameters[taco][name=\currentvalue\space hoekwater] +%D \convertcommand\taconame\to\ascii \ascii +%D \getparameters[taco][name=\currentvalue\space hoekwater] +%D \convertcommand\taconame\to\ascii \ascii +%D \stopbuffer +%D +%D \typebuffer +%D \startlines +%D \getbuffer +%D \stoplines + +%D Here we hook in the code (beware, this is the optimized get **): + +\def\xdoget@n@parameters#1]% + {\xprocesscommaitem#1,],\@relax@} + +\def\xdoget@e@parameters#1]% + {\let\dosetnvalue\dosetvalue + \let\dosetvalue\dosetevalue + \let\p!doassign\p!e!doassign + \xprocesscommaitem#1,],\@relax@ + \let\p!doassign\p!n!doassign + \let\dosetvalue\dosetnvalue + \let\xdogetparameters\xdoget@n@parameters + \let\currentvalue\empty} + +\let\xdogetparameters\xdoget@n@parameters % ** + +\def\expandparameters{\let\xdogetparameters\xdoget@e@parameters} + +%D \macros +%D {getemptyparameters} +%D +%D Sometimes we explicitly want variables to default to an +%D empty string, so we welcome: +%D +%D \starttyping +%D \getemptyparameters [label] [...=...,...=...] +%D \stoptyping + +\def\getemptyparameters[#1]#2[#3]% + {\def\p!dogetemptyparameter##1% + {\doassignempty[#1][##1]}% + \processcommalist[#3]\p!dogetemptyparameter} + +%D \macros +%D {copyparameters} +%D +%D Some \CONTEXT\ commands take their default setups from +%D others. All commands that are able to provide backgounds +%D or rules around some content, for instance default to the +%D standard command for ruled boxes. Is situations like this +%D we can use: +%D +%D \starttyping +%D \copyparameters [to-label] [from-label] [name1,name2,...] +%D \stoptyping +%D +%D For instance +%D +%D \starttyping +%D \copyparameters +%D [internal][external] +%D [alfa,beta] +%D \stoptyping +%D +%D Leads to: +%D +%D \starttyping +%D \def\internalalfa {\externalalfa} +%D \def\internalbeta {\externalbeta} +%D \stoptyping +%D +%D By using \type{\docopyvalue} we've prepared this command +%D for use in a multi||lingual environment. + +\def\copyparameters[#1]#2[#3]#4[#5]% + {\doifnot{#1}{#3} + {\def\docopyparameter{\docopyvalue{#1}{#3}}% + %\def\docopyparameter##1{\docopyvalue{#1}{#3}{##1}}% + \processcommalist[#5]\docopyparameter}} + +%D \macros +%D {ifparameters,checkparameters} +%D +%D A slightly different one is \type{\checkparameters}, which +%D also checks on the presence of a~\type{=}. +%D +%D The boolean \type{\ifparameters} can be used afterwards. +%D Combining both in one \type{\if}||macro would lead to +%D problems with nested \type{\if}'s. +%D +%D \starttyping +%D \checkparameters[argument] +%D \stoptyping + +\newif\ifparameters + +\def\p!checkparameters#1=#2#3\war% + {\if#2@\parametersfalse\else\parameterstrue\fi} + +\def\checkparameters[#1]% + {\p!checkparameters#1=@@\war} + +%D \macros +%D {getfromcommalist,getfromcommacommand, +%D commalistelement, +%D getcommalistsize,getcommacommandsize} +%D +%D It's possible to get an element from a commalist or a +%D command representing a commalist. +%D +%D \starttyping +%D \getfromcommalist [string] [n] +%D \getfromcommacommand [string,\strings,string,...] [n] +%D \stoptyping +%D +%D The difference betwee the two of them is the same as the +%D difference between \type{\processcomma...}. The found string +%D is stored in \type{\commalistelement}. +%D +%D We can calculate the size of a comma separated list by +%D using: +%D +%D \starttyping +%D \getcommalistsize [string,string,...] +%D \getcommacommandsize [string,\strings,string,...] +%D \stoptyping +%D +%D Afterwards, the length is available in the macro +%D \type{\commalistsize} (not a \COUNTER). + +\newcount\commalistcounter + +\def\commalistsize{0} + +\def\p!dogetcommalistsize#1% + {\advance\commalistcounter\plusone} + +\def\getcommalistsize#1]% don't loose [{#1}] + {\commalistcounter\zerocount + \processcommalist#1]\p!dogetcommalistsize % was [{#1}] + \edef\commalistsize{\the\commalistcounter}} + +\def\getcommacommandsize[#1]% + {\edef\commacommand{#1}% + \scratchtoks\expandafter{\expandafter[\commacommand]}% + \expandafter\getcommalistsize\the\scratchtoks } + +% to be tested first +% +% \def\getcommacommandsize[#1]% +% {\expanded{\getcommalistsize[#1]}} + +% \def\p!dogetfromcommalist#1% +% {\advance\commalistcounter \minusone +% \ifcase\commalistcounter +% \def\commalistelement{#1}% +% \begingroup\def\doprocesscommaitem##1]{\endgroup}% +% \fi} + +\def\p!dogetfromcommalist#1% + {\advance\commalistcounter \minusone + \ifcase\commalistcounter + \def\commalistelement{#1}% + \expandafter\quitcommalist + \fi} + +\def\getfromcommalist[#1]#2[#3]% + {\let\commalistelement\empty + \commalistcounter#3\relax + \processcommalist[#1]\p!dogetfromcommalist} + +% \def\getfromcommacommand[#1]% why so complicated, still needed? +% {\edef\commacommand{#1}% +% \toks0=\expandafter{\expandafter[\commacommand]}% +% \expandafter\getfromcommalist\the\toks0 } + +\def\getfromcommacommand[#1]% + {\expanded{\getfromcommalist[#1]}} + +%D Because 0, 1 and~2 are often asked for, we optimize this +%D macro for those cases. The indirect call however slows +%D down the other cases. +%D +%D \starttyping +%D \def\p!dogetfirstfromcommalist [#1,#2]{\def\commalistelement{#1}} +%D \def\p!dogetsecondfromcommalist[#1,#2,#3]{\def\commalistelement{#2}} +%D \let\p!dogetotherfromcommalist=\getfromcommalist +%D +%D \def\getfromcommalist[#1]#2[#3]% optimized for 0,1,2 +%D {\ifcase#3\relax +%D \let\commalistelement\empty +%D \or +%D \p!dogetfirstfromcommalist[#1,]% +%D \or +%D \p!dogetsecondfromcommalist[#1,,]% +%D \else +%D \p!dogetotherfromcommalist[#1][#3]% +%D \fi} +%D \stoptyping +%D +%D Even worse, this alternative does not strip preceding +%D spaces, which is what we want. So, we stick to the slow +%D alternative. + +%D Watertight (and efficient) solutions are hard to find, due +%D to the handling of braces during parameters passing and +%D scanning. Nevertheless: +%D +%D \startbuffer +%D \def\dosomething#1{(#1=\commalistsize) } +%D +%D \getcommalistsize [\hbox{$a,b,c,d,e,f$}] \dosomething 1 +%D \getcommalistsize [{a,b,c,d,e,f}] \dosomething 1 +%D \getcommalistsize [{a,b,c},d,e,f] \dosomething 4 +%D \getcommalistsize [a,b,{c,d,e},f] \dosomething 4 +%D \getcommalistsize [a{b,c},d,e,f] \dosomething 4 +%D \getcommalistsize [{a,b}c,d,e,f] \dosomething 4 +%D \getcommalistsize [] \dosomething 0 +%D \getcommalistsize [{[}] \dosomething 1 +%D \stopbuffer +%D +%D \typebuffer +%D +%D reports: +%D +%D \getbuffer + +%D \macros +%D {dogetcommalistelement,dogetcommacommandelement} +%D +%D For low level (fast) purposes, we can also use the next +%D alternative, which can handle 8~elements at most. +%D +%D \starttyping +%D \dogetcommalistelement1\from a,b,c\to\commalistelement +%D \stoptyping + +\def\dodogetcommalistelement#1\from#2,#3,#4,#5,#6,#7,#8\to#9% + {\edef#9{\ifcase#1\relax\or#2\or#3\or#4\or#5\or#6\or#7\or#8\fi}} + +% maybe better: +% +% {\@EA\edef\@EA#9\@EA{\ifcase#1\relax\or#2\or#3\or#4\or#5\or#6\or#7\or#8\fi}} + +\def\dogetcommalistelement#1\from#2\to% + {\dodogetcommalistelement#1\from#2,,,,,,\to} + +% check sources + +\def\dogetcommacommandelement#1\from#2\to% + {\@EA\dodogetcommalistelement\@EA#1\@EA\from#2,,,,,,\to} + +%D \macros +%D {dosingleargument,dodoubleargument,dotripleargument, +%D doquadrupleargument,doquintupleargument,dosixtupleargument, +%D doseventupleargument} +%D +%D When working with delimited arguments, spaces and +%D lineendings can interfere. The next set of macros uses +%D \TEX' internal scanner for grabbing everything between +%D arguments. Forgive me the funny names. +%D +%D \starttyping +%D \dosingleargument\commando = \commando[#1] +%D \dodoubleargument\commando = \commando[#1][#2] +%D \dotripleargument\commando = \commando[#1][#2][#3] +%D \doquadrupleargument\commando = \commando[#1][#2][#3][#4] +%D \doquintupleargument\commando = \commando[#1][#2][#3][#4][#5] +%D \dosixtupleargument\commando = \commando[#1][#2][#3][#4][#5][#6] +%D \doseventupleargument\command= \commando[#1][#2][#3][#4][#5][#6][#7] +%D \stoptyping +%D +%D These macros are used in the following way: +%D +%D \starttyping +%D \def\dosetupsomething[#1][#2]% +%D {... #1 ... #2 ...} +%D +%D \def\setupsomething% +%D {\dodoubleargument\dosetupsomething} +%D \stoptyping +%D +%D The implementation can be surprisingly simple and needs no +%D further explanation, like: +%D +%D \starttyping +%D \def\dosingleargument#1[#2]% +%D {#1[#2]} +%D \def\dotripleargument#1[#2]#3[#4]#5[#6]% +%D {#1[#2][#4][#6]} +%D \def\doquintupleargument#1% +%D {\def\dodoquintupleargument[##1]##2[##3]##4[##5]##6[##7]##8[##9]% +%D {#1[##1][##3][##5][##7][##9]}% +%D \dodoquintupleargument} +%D \stoptyping +%D +%D Because \TEX\ accepts 9~arguments at most, we have to use +%D two||step solution when getting five or more arguments. +%D +%D When developing more and more of the real \CONTEXT, we +%D started using some alternatives that provided empty +%D arguments (in fact optional ones) whenever the user failed +%D to supply them. Because this more complicated macros enable +%D us to do some checking, we reimplemented the non||empty +%D ones. + +\def\dosingleargument {\chardef\expectedarguments 1 \dosingleempty } +\def\dodoubleargument {\chardef\expectedarguments 2 \dodoubleempty } +\def\dotripleargument {\chardef\expectedarguments 3 \dotripleempty } +\def\doquadrupleargument {\chardef\expectedarguments 4 \doquadrupleempty } +\def\doquintupleargument {\chardef\expectedarguments 5 \doquintupleempty } +\def\dosixtupleargument {\chardef\expectedarguments 6 \dosixtupleempty } +\def\doseventupleargument{\chardef\expectedarguments 7 \doseventupleempty} + +%D \macros +%D {iffirstagument,ifsecondargument,ifthirdargument, +%D iffourthargument,iffifthargument,ifsixthargument, +%D ifseventhargument} +%D +%D We use some signals for telling the calling macros if all +%D wanted arguments are indeed supplied by the user. + +\newif\iffirstargument +\newif\ifsecondargument +\newif\ifthirdargument +\newif\iffourthargument +\newif\iffifthargument +\newif\ifsixthargument +\newif\ifseventhargument + +%D \macros +%D {dosingleempty,dodoubleempty,dotripleempty, +%D doquadrupleempty,doquintupleempty,dosixtupeempty, +%D doseventupleempty} +%D +%D The empty argument supplying macros mentioned before, look +%D like: +%D +%D \starttyping +%D \dosingleempty \command +%D \dodoubleempty \command +%D \dotripleempty \command +%D \doquadrupleempty \command +%D \doquintupleempty \command +%D \dosixtupleempty \command +%D \doseventupleempty\command +%D \stoptyping +%D +%D So \type{\dodoubleempty} leades to: +%D +%D \starttyping +%D \command[#1][#2] +%D \command[#1][] +%D \command[][] +%D \stoptyping +%D +%D Depending of the generousity of the user. Afterwards one can +%D use the \type{\if...argument} boolean. For novice: watch +%D the stepwise doubling of \type{#}'s + +% idea: \ignorespaces afterwards + +\chardef\noexpectedarguments=0 +\chardef\expectedarguments =0 + +\def\showargumenterror#1#2% + {\writestatus{systems}{#1 argument(s) expected in line #2}} + +% \long\def\dogetargument#1#2#3#4% redefined in mult-ini +% {\doifnextcharelse{#1} +% {\let\expectedarguments\noexpectedarguments +% #3\dodogetargument} +% {\ifnum\expectedarguments>\noexpectedarguments +% \showargumenterror{\expectedarguments} +% \fi +% \let\expectedarguments\noexpectedarguments +% #4\dodogetargument#1#2}} +% +% less to pass + +\def\doshowargumenterror + {\ifnum\expectedarguments>\noexpectedarguments + \showargumenterror{\number\expectedarguments}{\number\inputlineno}% + \fi + \noshowargumenterror} + +\def\noshowargumenterror + {\let\expectedarguments\noexpectedarguments} + +% \long\def\dogetargument#1#2#3#4% +% {\doifnextcharelse#1% +% {\noshowargumenterror#3\dodogetargument} +% {\doshowargumenterror#4\dodogetargument#1#2}} +% +% faster ? + +\long\def\dogetargument#1#2#3#4% + {\let\charactertoken=#1% + \def\!!stringa{\noshowargumenterror#3\dodogetargument}% + \def\!!stringb{\doshowargumenterror#4\dodogetargument#1#2}% + \futurelet\nexttoken\inspectnextcharacter} + +\def\getsingleempty#1#2#3% + {\def\dodogetargument% + {#3}% + \dogetargument#1#2\firstargumenttrue\firstargumentfalse} + +\def\getdoubleempty#1#2#3% + {\def\dodogetargument#1##1#2% + {\def\dodogetargument% + {#3#1{##1}#2}% + \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% + \dogetargument#1#2\firstargumenttrue\firstargumentfalse} + +\def\gettripleempty#1#2#3% + {\def\dodogetargument#1##1#2% + {\def\dodogetargument#1####1#2% + {\def\dodogetargument% + {#3#1{##1}#2% + #1{####1}#2}% + \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% + \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% + \dogetargument#1#2\firstargumenttrue\firstargumentfalse} + +\def\getquadrupleempty#1#2#3% + {\def\dodogetargument#1##1#2% + {\def\dodogetargument#1####1#2% + {\def\dodogetargument#1########1#2% + {\def\dodogetargument% + {#3#1{##1}#2% + #1{####1}#2% + #1{########1}#2}% + \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}% + \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% + \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% + \dogetargument#1#2\firstargumenttrue\firstargumentfalse} + +\def\getquintupleempty#1#2#3% + {\def\dodogetargument#1##1#2% + {\def\dodogetargument#1####1#2% + {\def\dodogetargument#1########1#2% + {\def\dodogetargument#1################1#2% + {\def\dodogetargument% + {#3#1{##1}#2% + #1{####1}#2% + #1{########1}#2% + #1{################1}#2}% + \dogetargument#1#2\fifthargumenttrue\fifthargumentfalse}% + \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}% + \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% + \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% + \dogetargument#1#2\firstargumenttrue\firstargumentfalse} + +\def\getsixtupleempty#1#2#3% + {\def\dodogetargument#1##1#2% + {\def\dodogetargument#1####1#2% + {\def\dodogetargument#1########1#2% + {\def\dodogetargument#1################1#2% + {\def\dodogetargument#1################################1#2% + {\def\dodogetargument% + {#3#1{##1}#2% + #1{####1}#2% + #1{########1}#2% + #1{################1}#2% + #1{################################1}#2}% + \dogetargument#1#2\sixthargumenttrue\sixthargumentfalse}% + \dogetargument#1#2\fifthargumenttrue\fifthargumentfalse}% + \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}% + \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% + \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% + \dogetargument#1#2\firstargumenttrue\firstargumentfalse} + +\def\getseventupleempty#1#2#3% + {\def\dodogetargument#1##1#2% + {\def\dodogetargument#1####1#2% + {\def\dodogetargument#1########1#2% + {\def\dodogetargument#1################1#2% + {\def\dodogetargument#1################################1#2% + {\def\dodogetargument#1################################% + ################################1#2% + {\def\dodogetargument% + {#3#1{##1}#2% + #1{####1}#2% + #1{########1}#2% + #1{################1}#2% + #1{################################1}#2% + #1{################################% + ################################1}#2}% + \dogetargument#1#2\seventhargumenttrue\seventhargumentfalse}% + \dogetargument#1#2\sixthargumenttrue\sixthargumentfalse}% + \dogetargument#1#2\fifthargumenttrue\fifthargumentfalse}% + \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}% + \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% + \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% + \dogetargument#1#2\firstargumenttrue\firstargumentfalse} + +\def\dosingleempty {\getsingleempty []} +\def\dodoubleempty {\getdoubleempty []} +\def\dotripleempty {\gettripleempty []} +\def\doquadrupleempty {\getquadrupleempty []} +\def\doquintupleempty {\getquintupleempty []} +\def\dosixtupleempty {\getsixtupleempty []} +\def\doseventupleempty{\getseventupleempty[]} + +%D Because some of these are called quite often, we will now +%D replace the more general version by alternatives tuned for +%D speed. + +\def\dosingleempty#1% + {\noshowargumenterror % \relax % prevents lookahead, brr + \doifnextoptionalelse + {\firstargumenttrue#1} + {\dosinglefakeempty#1}} + +\def\dodoubleempty#1% + {\noshowargumenterror % \relax % prevents lookahead, brr + \doifnextoptionalelse + {\dodoubletestempty#1} + {\dodoublefakeempty#1}} + +\def\dotripleempty#1% + {\noshowargumenterror % \relax % prevents lookahead, brr + \doifnextoptionalelse + {\dotripletestempty#1} + {\dotriplefakeempty#1}} + +\def\dosinglefakeempty#1% + {\firstargumentfalse#1[]} + +\def\dodoublefakeempty#1% + {\firstargumentfalse\secondargumentfalse#1[][]} + +\def\dotriplefakeempty#1% + {\firstargumentfalse\secondargumentfalse\thirdargumentfalse#1[][][]} + +\long\def\dodoubletestempty#1[#2]% + {\firstargumenttrue + \doifnextoptionalelse + {\secondargumenttrue #1[{#2}]} + {\secondargumentfalse#1[{#2}][]}} + +\long\def\dotripletestempty#1[#2]% + {\firstargumenttrue + \doifnextoptionalelse + {\dotripletestemptyx #1[{#2}]} + {\secondargumentfalse + \thirdargumentfalse #1[{#2}][][]}} + +\long\def\dotripletestemptyx#1[#2][#3]% + {\secondargumenttrue + \doifnextoptionalelse + {\thirdargumenttrue #1[{#2}][{#3}]} + {\thirdargumentfalse#1[{#2}][{#3}][]}} + +%D \macros +%D {strippedcsname} +%D +%D The next macro can be very useful when using \type{\csname} +%D like in: +%D +%D \starttyping +%D \csname if\strippedcsname\something\endcsname +%D \stoptyping +%D +%D This expands to \type{\ifsomething}. + +\def\strippedcsname% + {\expandafter\gobbleoneargument\string} + +%D \macros +%D {complexorsimple,complexorsimpleempty} +%D +%D Setups can be optional. A command expecting a setup is +%D prefixed by \type{\complex}, a command without one gets the +%D prefix \type{\simple}. Commands like this can be defined by: +%D +%D \starttyping +%D \complexorsimple\command +%D \stoptyping +%D +%D When \type{\command} is followed by a \type{[setup]}, then +%D +%D \starttyping +%D \complexcommand [setup] +%D \stoptyping +%D +%D executes, else we get +%D +%D \starttyping +%D \simplecommand +%D \stoptyping +%D +%D An alternative for \type{\complexorsimple} is: +%D +%D \starttyping +%D \complexorsimpleempty {command} +%D \stoptyping +%D +%D Depending on the presence of \type{[setup]}, this one +%D leads to one of: +%D +%D \starttyping +%D \complexcommando [setup] +%D \complexcommando [] +%D \stoptyping +%D +%D Many \CONTEXT\ commands started as complex or simple ones, +%D but changed into more versatile (more object oriented) ones +%D using the \type{\get..argument} commands. + +% This method is needed when traditional tex is used with +% the efficient definition (marked **) below. + +% an old one: +% +% \def\setnameofcommand#1% handles {abc} as well as \abc +% {\begingroup +% \escapechar=-1 +% \globaldefs=0 % pretty important! +% \xdef\nameofcommand{\string#1}% +% \endgroup} +% +% \def\complexorsimple#1% +% {\setnameofcommand{#1}% +% \doifnextcharelse{[} +% {\firstargumenttrue \getvalue{\s!complex\nameofcommand}} +% {\firstargumentfalse\getvalue{\s!simple \nameofcommand}}} +% +% \def\complexorsimpleempty#1% +% {\setnameofcommand{#1}% +% \doifnextcharelse{[} +% {\firstargumenttrue \getvalue{\s!complex\nameofcommand}} +% {\firstargumentfalse\getvalue{\s!complex\nameofcommand}[]}} +% +% a newer one: + +\def\complexorsimple#1% + {% \relax % prevents lookahead, brrr + \doifnextoptionalelse + {\firstargumenttrue \csname\s!complex\strippedcsname#1\endcsname} + {\firstargumentfalse\csname\s!simple \strippedcsname#1\endcsname}} + +\def\complexorsimpleempty#1% + {% \relax % prevents lookahead, brrr + \doifnextoptionalelse + {\firstargumenttrue \csname\s!complex\strippedcsname#1\endcsname} + {\firstargumentfalse\csname\s!complex\strippedcsname#1\endcsname[]}} + +%D \macros +%D {definecomplexorsimple,definecomplexorsimpleempty} +%D +%D The previous commands are used that often that we found it +%D worthwile to offer two more alternatives. Watch the build +%D in protection. + +% See earlier. Because we don't want \type {\simple..} and +% \type {\complex..} commands to show up in expansions, we need +% to pass them as \type {simple..} and \type {complex..}. + +% \beginTEX +% +% \def\definewithnameofcommand#1#2% +% {\setnameofcommand{#2}% +% \@EA\def\@EA#2\@EA{\@EA\donottest\@EA#1\@EA{\nameofcommand}}} +% +% \def\definecomplexorsimple% +% {\definewithnameofcommand\complexorsimple} +% +% \def\definecomplexorsimpleempty% +% {\definewithnameofcommand\complexorsimpleempty} +% +% \endTEX +% +% \beginETEX \protected +% +% \def\definecomplexorsimple#1% +% {\normalprotected\def#1{\complexorsimple#1}} +% +% \def\definecomplexorsimpleempty#1% +% {\normalprotected\def#1{\complexorsimpleempty#1}} +% +% \endETEX + +% However, since this one uses an idirect method, things go +% okay (at the cost of extra macros). + +% \def\definecomplexorsimple#1% +% {\unexpanded\def#1{\complexorsimple#1}} +% +% \def\definecomplexorsimpleempty#1% +% {\unexpanded\def#1{\complexorsimpleempty#1}} +% +% faster, since no \strippedcsname needed in call, but more spacy + +\def\docomplexorsimple#1#2% + {\doifnextoptionalelse{\firstargumenttrue#1}{\firstargumentfalse#2}} + +\def\docomplexorsimpleempty#1% + {\doifnextoptionalelse{\firstargumenttrue#1}{\firstargumentfalse#1[]}} + +\def\definecomplexorsimple#1% + {\unexpanded\edef#1% + {\noexpand\docomplexorsimple + \@EA\noexpand\csname\s!complex\strippedcsname#1\endcsname + \@EA\noexpand\csname\s!simple \strippedcsname#1\endcsname}} + +\def\definecomplexorsimpleempty#1% + {\unexpanded\edef#1% + {\noexpand\docomplexorsimpleempty + \@EA\noexpand\csname\s!complex\strippedcsname#1\endcsname}} + +%D These commands are called as: +%D +%D \starttyping +%D \definecomplexorsimple\command +%D \stoptyping +%D +%D Of course, we must have available +%D +%D \starttyping +%D \def\complexcommand[#1]{...} +%D \def\simplecommand {...} +%D \stoptyping +%D +%D Using this construction saves a few string now and then. + +%D \macros +%D {definestartstopcommand} +%D +%D Those who get the creeps of expansion may skip the next +%D one. It's one of the most recent additions and concerns +%D \type{\start}||\type{\stop} pairs with complicated +%D arguments. +%D +%D We won't go into details here, but the general form of +%D this using this command is: +%D +%D \starttyping +%D \definestartstopcommand\somecommand\e!specifier{arg}{arg}% +%D {do something with arg} +%D \stoptyping +%D +%D This expands to something like: +%D +%D \starttyping +%D \def\somecommand arg \startspecifier arg \stopspecifier% +%D {do something with arg} +%D \stoptyping +%D +%D The arguments can be anything reasonable, but double +%D \type{#}'s are needed in the specification part, like: +%D +%D \starttyping +%D \definestartstopcommand\somecommand\e!specifier{[##1][##2]}{##3}% +%D {do #1 something #2 with #3 arg} +%D \stoptyping +%D +%D which becomes: +%D +%D \starttyping +%D \def\somecommand[#1][#2]\startspecifier#3\stopspecifier% +%D {do #1 something #2 with #3 arg} +%D \stoptyping +%D +%D We will see some real applications of this command in the +%D core modules. + +\def\definestartstopcommand#1#2#3#4% can be done with \expanded ot better, toks + {\def\!stringa{#3}% % but let's keep this unused one crappy + \def\!stringb{\e!start#2}% + \def\!stringc{#4}% + \def\!stringd{\e!stop#2}% + \@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA + \def\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA + #1\@EA\@EA\@EA\@EA\@EA\@EA\@EA + \!stringa\@EA\@EA\@EA + \csname\@EA\@EA\@EA\!stringb\@EA\@EA\@EA\endcsname\@EA + \!stringc + \csname\!stringd\endcsname} + +%D \macros +%D {dosinglegroupempty,dodoublegroupempty,dotriplegroupempty, +%D doquadruplegroupempty, doquintuplegroupempty} +%D +%D We've already seen some commands that take care of +%D optional arguments between \type{[]}. The next two commands +%D handle the ones with \type{{}}. They are called as: +%D +%D \starttyping +%D \dosinglegroupempty \ineedONEargument +%D \dodoublegroupempty \ineedTWOarguments +%D \dotriplegroupempty \ineedTHREEarguments +%D \doquadruplegroupempty \ineedFOURarguments +%D \doquintuplegroupempty \ineedFIVEarguments +%D \stoptyping +%D +%D where \type{\ineedONEargument} takes one and the others +%D two and three arguments. These macro's were first needed in +%D \PPCHTEX. +%D +%D \starttyping +%D \def\dogetgroupargument#1#2% redefined in mult-ini +%D {\def\nextnextargument% +%D {\ifx\nextargument\bgroup +%D \let\expectedarguments\noexpectedarguments +%D \def\nextargument{#1\dodogetargument}% +%D %\else\ifx\nextargument\lineending % this can be an option +%D % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}% +%D %\else\ifx\nextargument\blankspace % but it may never be default +%D % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}% +%D \else +%D \ifnum\expectedarguments>\noexpectedarguments +%D \writestatus +%D {setup} +%D {\the\expectedarguments\space argument(s) expected +%D in line \the\inputlineno\space}% +%D \fi +%D \let\expectedarguments\noexpectedarguments +%D \def\nextargument{#2\dodogetargument{}}% +%D \fi%\fi\fi % so let's get rid of it +%D \nextargument}% +%D \futurelet\nextargument\nextnextargument} +%D \stoptyping +%D +%D In order to catch \type {\nextargument}'s that expand to +%D \type {\if} and friends, in practice we will use a +%D slightly more complicated macro. + +\newtoks \everyrobusttest + +\everyrobusttest + {\let\if \relax + \let\ifcat \relax + \let\ifnum \relax + \let\ifdim \relax + \let\ifodd \relax + \let\ifvmode \relax + \let\ifhmode \relax + \let\ifmmode \relax + \let\ifinner \relax + \let\ifvoid \relax + \let\ifhbox \relax + \let\ifvbox \relax + \let\ifx \relax + \let\ifeof \relax + \let\iftrue \relax + \let\iffalse \relax + \let\ifcase \relax + \let\ifdefined \relax + \let\ifcsname \relax + \let\iffontchar \relax + \let\ifincsname \relax + \let\ifprimitive\relax + \let\ifabsnum \relax + \let\ifabsdim \relax + \let\else \relax + \let\or \relax + \let\fi \relax} + +\def\beginrobusttest + {\begingroup + \the\everyrobusttest} + +\let\endrobusttest\endgroup + +%D We can add additional definitions later when we have defined +%D \type {\appendtoks}. + +\def \permitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=0 } +\def\dontpermitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=1 } + +\dontpermitspacesbetweengroups + +% \def\dogetgroupargument#1#2% +% {\def\nextnextargument% +% {\normalifx\nextargument\bgroup +% \endrobusttest +% \noshowargumenterror +% \def\nextargument{#1\dodogetargument}% +% \normalelse +% \normalifcase\@@permitspacesbetweengroups +% \normalifx\nextargument\lineending +% \endrobusttest +% \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}% +% \normalelse\normalifx\nextargument\blankspace +% \endrobusttest +% \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}% +% \normalelse +% \endrobusttest +% \doshowargumenterror +% \def\nextargument{#2\dodogetargument{}}% +% \normalfi\normalfi +% \normalelse +% \endrobusttest +% \doshowargumenterror +% \def\nextargument{#2\dodogetargument{}}% +% \normalfi +% \normalfi +% \nextargument}% +% \beginrobusttest +% \futurelet\nextargument\nextnextargument} + +\def\dodogetgroupargument + {\normalifx\nextargument\bgroup + \endrobusttest + \noshowargumenterror + \def\nextargument{\dogroupargumentyes\dodogetargument}% + \normalelse + \normalifcase\@@permitspacesbetweengroups + \normalifx\nextargument\lineending + \endrobusttest + \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument\dogroupargumentyes\dogroupargumentnop}\\}% + \normalelse\normalifx\nextargument\blankspace + \endrobusttest + \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument\dogroupargumentyes\dogroupargumentnop}\\}% + \normalelse + \endrobusttest + \doshowargumenterror + \def\nextargument{\dogroupargumentnop\dodogetargument{}}% + \normalfi\normalfi + \normalelse + \endrobusttest + \doshowargumenterror + \def\nextargument{\dogroupargumentnop\dodogetargument{}}% + \normalfi + \normalfi + \nextargument}% + +\def\dogetgroupargument#1#2% + {\let\dogroupargumentyes#1% + \let\dogroupargumentnop#2% + \beginrobusttest\futurelet\nextargument\dodogetgroupargument} + +\def\dosinglegroupempty#1% + {\def\dodogetargument% + {\dontpermitspacesbetweengroups + #1}% + \dogetgroupargument\firstargumenttrue\firstargumentfalse} + +\def\dodoublegroupempty#1% + {\def\dodogetargument##1% + {\def\dodogetargument% + {\dontpermitspacesbetweengroups + #1{##1}}% + \dogetgroupargument\secondargumenttrue\secondargumentfalse}% + \dogetgroupargument\firstargumenttrue\firstargumentfalse} + +\def\dotriplegroupempty#1% + {\def\dodogetargument##1% + {\def\dodogetargument####1% + {\def\dodogetargument% + {\dontpermitspacesbetweengroups + #1{##1}{####1}}% + \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}% + \dogetgroupargument\secondargumenttrue\secondargumentfalse}% + \dogetgroupargument\firstargumenttrue\firstargumentfalse} + +\def\doquadruplegroupempty#1% + {\def\dodogetargument##1% + {\def\dodogetargument####1% + {\def\dodogetargument########1% + {\def\dodogetargument% + {\dontpermitspacesbetweengroups + #1{##1}{####1}{########1}}% + \dogetgroupargument\fourthargumenttrue\fourthargumentfalse}% + \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}% + \dogetgroupargument\secondargumenttrue\secondargumentfalse}% + \dogetgroupargument\firstargumenttrue\firstargumentfalse} + +\def\doquintuplegroupempty#1% + {\def\dodogetargument##1% + {\def\dodogetargument####1% + {\def\dodogetargument########1% + {\def\dodogetargument################1% + {\def\dodogetargument% + {\dontpermitspacesbetweengroups + #1{##1}{####1}{########1}{################1}}% + \dogetgroupargument\fifthargumenttrue\fifthargumentfalse}% + \dogetgroupargument\fourthargumenttrue\fourthargumentfalse}% + \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}% + \dogetgroupargument\secondargumenttrue\secondargumentfalse}% + \dogetgroupargument\firstargumenttrue\firstargumentfalse} + +%D These macros can explictly take care of spaces, which means +%D that the next definition and calls are valid: +%D +%D \starttyping +%D \def\test#1#2#3{[#1#2#3]} +%D +%D \dotriplegroupempty\test {a}{b}{c} +%D \dotriplegroupempty\test {a}{b} +%D \dotriplegroupempty\test {a} +%D \dotriplegroupempty\test +%D \dotriplegroupempty\test {a} {b} {c} +%D \dotriplegroupempty\test {a} {b} +%D \dotriplegroupempty\test +%D {a} +%D {b} +%D \stoptyping +%D +%D And alike. + +%D \macros +%D {firstofoneargument, firstoftwoarguments, firstofthreearguments +%D secondoftwoarguments, secondofthreearguments, +%D thirdofthreearguments} +%D +%D The next six macros (dedicated to Taco) can conveniently +%D used to select arguments. Their names explain their +%D functionality. + +\long\def\firstofoneargument#1{#1} + +\long\def\firstoftwoarguments #1#2{#1} +\long\def\secondoftwoarguments#1#2{#2} + +\long\def\firstofthreearguments #1#2#3{#1} +\long\def\secondofthreearguments#1#2#3{#2} +\long\def\thirdofthreearguments #1#2#3{#3} + +\long\def\firstoffourarguments #1#2#3#4{#1} +\long\def\secondoffourarguments#1#2#3#4{#2} +\long\def\thirdoffourarguments #1#2#3#4{#3} +\long\def\fourthoffourarguments#1#2#3#4{#4} + +\long\def\firstoffivearguments #1#2#3#4#5{#1} +\long\def\secondoffivearguments#1#2#3#4#5{#2} +\long\def\thirdoffivearguments #1#2#3#4#5{#3} +\long\def\fourthoffivearguments#1#2#3#4#5{#4} +\long\def\fifthoffivearguments #1#2#3#4#5{#5} + +\long\def\firstofsixarguments #1#2#3#4#5#6{#1} +\long\def\secondofsixarguments#1#2#3#4#5#6{#2} +\long\def\thirdofsixarguments #1#2#3#4#5#6{#3} +\long\def\fourthofsixarguments#1#2#3#4#5#6{#4} +\long\def\fifthofsixarguments #1#2#3#4#5#6{#5} +\long\def\sixthofsixarguments #1#2#3#4#5#6{#6} + +%D \macros +%D {globalletempty,letempty,letvalueempty,letgvalueempty} +%D +%D Trivial: + +\def\letempty #1{\let#1\empty} +\def\globalletempty#1{\global\let#1\empty} + +\def\letvalueempty #1{\expandafter\let\csname#1\endcsname\empty} +\def\letgvalueempty#1{\global\expandafter\let\csname#1\endcsname\empty} + +%D \macros +%D {wait} +%D +%D The next macro hardly needs explanation. Because no +%D nesting is to be expected, we can reuse \type{\wait} within +%D \type{\wait} itself. + +\def\wait + {\begingroup + \read16 to \wait + \endgroup} + +%D \macros +%D {writestring,writeline,writebanner, +%D writestatus,statuswidth,normalwritestatus} +%D +%D Maybe one didn't notice, but we've already introduced a +%D macro for showing messages. In the multi||lingual modules, +%D we will also introduce a mechanism for message passing. For +%D the moment we stick to the core macros: +%D +%D \starttyping +%D \writestring {string} +%D \writeline +%D \writestatus {category} {message} +%D \stoptyping +%D +%D Messages are formatted. One can provide the maximum with +%D of the identification string with the macro \type +%D {\statuswidth}. + +\chardef\statuswidth=15 +\chardef\statuswrite=16 + +\ifx\writestring\undefined + + \newtoks\everywritestring + + \def\writedirect {\immediate\write\statuswrite} + \def\writeline {\writedirect{}} + \def\writestring#1{\begingroup\the\everywritestring\writedirect{#1}\endgroup} + +\fi + +%D First we present the normal \TEX\ variant, later we will +%D show the \ETEX-way. + + +\beginTEX + + \newcount\statuscounter + + \def\dosplitstatus#1% + {\advance\statuscounter \minusone + \ifcase\statuscounter + \expandafter\nosplitstatus + \else + \scratchtoks\@EA{\the\scratchtoks#1}% + \expandafter\dosplitstatus + \fi} + + \def\nosplitstatus#1\end + {} + + \def\writestatus#1#2% + {\begingroup + \scratchtoks\emptytoks + \statuscounter\statuswidth + \expandafter\dosplitstatus#1% + \space\space\space\space\space\space\space + \space\space\space\space\space\space\space + \space\space\space\space\space\space\end + \@EA\writestring\@EA{\the\scratchtoks\space:\space#2}% + \endgroup} + +\endTEX + +%D Because we're grouped, we could have initialized at forehand: +%D +%D \starttyping +%D \statuscounter\statuswidth +%D \stoptyping +%D +%D The next implementation saves only some 10 words of format +%D memory, but we hardly gain any speed. +%D +%D \starttyping +%D \def\dosplitstatus#1#2#3#4#5#6#7#8#9% +%D {#1#2#3#4#5#6#7#8#9\dodosplitstatus} +%D +%D \def\dodosplitstatus#1#2#3#4#5#6\end +%D {#1#2#3#4#5} +%D +%D \def\writestatus#1#2% +%D {\writestring +%D {\expandafter\dosplitstatus#1% +%D \space\space\space\space\space +%D \space\space\space\space\space +%D \space\space\space\space\space\end +%D \space:\space#2}} +%D \stoptyping + +%D Okay then, more obscure but slightly faster: no split grabs +%D the do split part and skipping the else branch has to happen +%D anyway, so: + +\beginTEX + + \def\dosplitstatus#1% + {\advance\statuscounter \minusone + \ifcase\statuscounter + \expandafter\nosplitstatus + \fi + \scratchtoks\@EA{\the\scratchtoks#1}% + \dosplitstatus} + +\endTEX + +%D The next (\ETEX\ specific) variant is twice as fast in 5/40 +%D situations, only gains some speed when multiple runs of large docs +%D are done; fully expandable, no statuscounter needed, no restore (due +%D to grouping) needed etc. + +\beginETEX \numexpr + + \def\normalwritestatus#1#2% + {\writestring{\expandafter\dosplitstatus\expandafter\statuswidth#1% + \space\space\space\space\space\space\space + \space\space\space\space\space\space\space + \space\space\space\space\space\space\end + \space:\space#2}} + + \def\dosplitstatus#1#2% + {\ifcase#1 \expandafter\nosplitstatus\fi#2% + \expandafter\dosplitstatus\expandafter{\the\numexpr#1+\minusone\relax}} + + \def\nosplitstatus#1\end + {} + +\endETEX + +%D \macros +%D {emptytoks} +%D +%D For this we need an empty token register, analogous +%D to \type {\empty}. + +\newtoks\emptytoks + +%D \macros +%D {debuggerinfo} +%D +%D For debugging purposes we can enhance macros with the +%D next alternative. Here \type{debuggerinfo} stands for both +%D a macro accepting two arguments and a boolean (in fact a +%D few macro's too). + +\newif\ifdebuggerinfo + +\def\debuggerinfo#1#2% + {\ifdebuggerinfo + \writestatus{debugger}{#1:: #2}% + \fi} + +%D Finally we do what from now on will be done at the top of +%D the files: we tell the user what we are loading. + +% \ifx\writestatus\undefined \let\writestatus\normalwritestatus \fi +% \ifx\writebanner\undefined \def\writebanner{\writestring} \fi + +\let\writestatus\normalwritestatus +\def\writebanner{\writestring} + +\writestatus{loading}{ConTeXt System Macros / General} + +%D Well, the real final command is the one that resets the +%D unprotected characters \type{@}, \type{?} and \type{!}. + +\protect \endinput diff --git a/tex/context/base/syst-gen.tex b/tex/context/base/syst-gen.tex deleted file mode 100644 index 993512b74..000000000 --- a/tex/context/base/syst-gen.tex +++ /dev/null @@ -1,4420 +0,0 @@ -%D \module -%D [ file=syst-gen, -%D version=1996.03.20, -%D title=\CONTEXT\ System Macros, -%D subtitle=General, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% nagaan : \ifinstringelse in syst-ext.tex -% do => p! dodo pp! dododo ppp! -% todo: \donetrue etc local maken - -%D The following macros are responsible for the interaction -%D with \CONTEXT. These macros have proven their use. These -%D macros are optimized as far as possible within of course, -%D the know how of the author. -%D -%D In this module we also show some of the optimizations, -%D mainly because we don't want to forget them and start doing -%D things over and over again. If showing them has a learing -%D effect for others too, we've surved another purpose too. - -%D \macros -%D {abortinputifdefined} -%D -%D Because this module can be used in a different context, we -%D want to prevent it being loaded more than once. This can be -%D done using: -%D -%D \starttyping -%D \abortinputifdefined\command -%D \stoptyping -%D -%D where \type{\command} is a command defined in the module -%D to be loaded only once. -%D -%D \starttyping -%D \def\abortinputifdefined#1% -%D {\ifx#1\undefined -%D \let\next=\relax -%D \else -%D \let\next=\endinput -%D \fi -%D \next} -%D \stoptyping -%D -%D This macro can be speed up in terms of speed as well as -%D memory. Because this is a nice example of a bit strange -%D command (\type{\endinput}), we spend some more lines on this. -%D -%D If we perform such actions directly, we can say: -%D -%D \starttyping -%D \ifx\somecommand\undefined -%D \let\next=\relax -%D \else -%D \let\next=\endinput -%D \fi -%D \next -%D \stoptyping -%D -%D We need the \type{\next} because we need to end the -%D \type{\fi}. The efficient one is: -%D -%D \starttyping -%D \ifx\somecommand\undefined -%D \else -%D \expandafter\endinput -%D \fi -%D \stoptyping -%D -%D Because \type{\endinput} comes into action after the current -%D line, we can also say: -%D -%D \starttyping -%D \ifx\somecommand\undefined \else \endinput \fi -%D \stoptyping -%D -%D When we define a macro, we tend to use a format which -%D shows as besat as can how things are done. \TEX\ however -%D stores the definitions as a sequence of tokens, so in fact -%D we can use a formatted definition: - -\def\abortinputifdefined#1% - {\ifx#1\undefined \else - \endinput - \fi} - -%D which also works. Keep in mind that this is entirely due to -%D the fact that \type{\endinput} after the line, i.e. at the -%D end of the macro. We therefore can burry this primitive quite -%D deep in code. - -%D And because this module implements \type{\writestatus}, we -%D just say: - -% \abortinputifdefined\writestatus - -%D \macros -%D {overloaded, superseded, forwarded, predefined} -%D -%D This prefix is used as signal for the \CONTEXT\ dependency -%D checking features. The first four prefixes don't do anything -%D useful, apart from signaling parsers. - -\def\overloaded{} % local change at the macro level -\def\superseded{} % global change at the module level, replaces previous definitions -\def\predefined{} % defined (first) here, but may be redefined anytime (no need for \overloaded) -\def\forwarded {} % definition at the module level, only done when undefined - -\def\forwarded#1#2{\ifx#2\undefined\else\expandafter\gobbleforwarded\fi#1#2} - -\def\gobbleforwarded#1 - {} - -%D Normally we tell the users what module is being loaded. -%D However, the command that is needed for this is not yet -%D defined. -%D -%D \starttyping -%D \writestatus{laden}{Context Systeem Macros (a)} -%D \stoptyping - -%D The next few macros are needed in case this module is -%D used outside \CONTEXT. - -\ifx\beginTEX\undefined - \let\beginTEX\relax\let\endTEX\relax - \long\def\beginETEX #1\endETEX {} -\fi - -%D \macros -%D [protecting] -%D {protect,unprotect} -%D -%D We can shield macros from users by using some special -%D characters in their names. Some characters that are normally -%D no letters and therefore often used are: \type{@}, \type{!} -%D and \type{?}. Before and after the definition of protected -%D macros, we have to change the \CATCODE\ of these characters. -%D This is done by \type{\unprotect} and \type{\protect}, for -%D instance: -%D -%D \starttyping -%D \unprotect -%D \def\!test{test} -%D \protect -%D \stoptyping -%D -%D The defined command \type{\!test} can of course only be -%D called upon when we are in the \type{\unprotect}'ed state, -%D otherwise \TEX\ reads \type{\!} and probably complains -%D loudly about not being in math mode. -%D -%D Both commands can be used nested, but only the \CATCODE\ -%D of the outermost level is saved. We make use of -%D an auxilary macro \type{\doprotect} to prevent us from -%D conflicts with existing macro's \type{\protect}. When -%D nesting deeper than one level, the system shows the -%D protection level. - -\ifx\protectionlevel\undefined \newcount\protectionlevel \fi - -\ifx\protect\undefined - \def\protect{\writestatus{protection}{too much protection}} -\else - % a simple version is already defined -\fi - -\let\normalprotect\protect % only for latex - -%D Although we don't need the \type{%} after commands that -%D don't take arguments, unless lines are obeyed, I decided -%D to put it there as a reminder. I only mention this once. - -\ifx\unprotect\undefined - - \chardef\protectionthreshold=10 - - \def\saveprotectedcharacters - {\edef\doprotectcharacters - {\catcode`\noexpand @\the\catcode`@ - \catcode`\noexpand !\the\catcode`! - \catcode`\noexpand ?\the\catcode`? }} - - \def\setprotectedcharacters - {\catcode`@=11 - \catcode`!=11 - \catcode`?=11 } - - \def\unprotect - {\ifcase\protectionlevel - \saveprotectedcharacters - \let\protect\doprotect - \fi - \setprotectedcharacters - \advance\protectionlevel 1 - \ifnum\protectionlevel>\protectionthreshold - \reportunprotection - \fi} - - \def\doprotect - {\ifcase\protectionlevel\or - \doprotectcharacters - \let\doprotectcharacters\relax - \let\protect\normalprotect - \fi - \ifnum\protectionlevel>\protectionthreshold - \reportprotection - \fi - \advance\protectionlevel -1 } - - \def\reportunprotection {\writestatus{protection}{unprotect \protectionstate}} - \def\reportprotection {\writestatus{protection}{protect \protectionstate}} - \def\reportprotectionstate{\writestatus{protection}{state \protectionstate}} - - \def\protectionstate - {\the\protectionlevel - \ifcase\protectionthreshold - :\space - @=\the\catcode`@\space\space - !=\the\catcode`!\space\space - ?=\the\catcode`?% - \fi} - - \ifx\everyeof\undefined - \let\checkprotection\relax - \else - \def\checkprotection{\everyeof{\writestatus{protection}{state: \protectionstate}}} - \fi - -\else - - \let\reportprotectionstate\relax - -\fi - -%D Now it is defined, we can make use of this very useful -%D macro. - -\unprotect - -%D \macros -%D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment, -%D @@endofline,@@parameter,@@superscript,@@subscript, -%D @@ignore,@@space,@@letter,@@other,@@active,@@comment} -%D -%D In \CONTEXT\ we sometimes manipulate the \CATCODES\ of -%D certain characters. Because we are not that good at numbers, -%D we introduce some symbolic names. - -\chardef\@@escape = 0 -\chardef\@@begingroup = 1 -\chardef\@@endgroup = 2 -\chardef\@@mathshift = 3 -\chardef\@@alignment = 4 -\chardef\@@endofline = 5 -\chardef\@@parameter = 6 -\chardef\@@superscript = 7 -\chardef\@@subscript = 8 -\chardef\@@ignore = 9 -\chardef\@@space = 10 -\chardef\@@letter = 11 -\chardef\@@other = 12 \chardef\other = 12 -\chardef\@@active = 13 \chardef\active = 13 -\chardef\@@comment = 14 - -%D \macros -%D {normalspace} -%D -%D We often need a space as defined in \PLAIN\ \TEX. Because -%D we cannot be sure of \type{\space} is redefined, we define: - -\def\normalspace{ } - -%D \macros -%D {scratchcounter, -%D scratchdimen,scratchskip,scratchmuskip, -%D scratchbox, -%D scratchtoks} -%D -%D Because we often need counters on a temporary basis, we -%D define the \COUNTER\ \type{\scratchcounter}. This is a -%D real \COUNTER, and not a pseudo one, as we will meet -%D further on. We also define some other scratch registers. - -\chardef\newabovelimit=20 - -\def\stripnewabove#1% - {\ifnum10<9#1 #1\else\expandafter\stripnewabove\fi}% - -\def\newabove#1#2% \dimen \name - {#1#2% - \ifnum\expandafter\stripnewabove\meaning#2>\newabovelimit\else - \expandafter\newabove\expandafter#1\expandafter#2% - \fi} - -\newabove \newcount \scratchcounter \newabove \newcount \globalscratchcounter -\newabove \newdimen \scratchdimen \newabove \newdimen \globalscratchdimen -\newabove \newskip \scratchskip \newabove \newskip \globalscratchskip -\newabove \newmuskip \scratchmuskip \newabove \newmuskip \globalscratchmuskip -\newabove \newtoks \scratchtoks \newabove \newtoks \globalscratchtoks - \newbox \scratchbox \newbox \globalscratchbox - -\newdimen\scratchdimenone \newbox\scratchboxone \newcount\scratchcounterone -\newdimen\scratchdimentwo \newbox\scratchboxtwo \newcount\scratchcountertwo - -%D \macros -%D {ifdone} - -\newif\ifdone - -%D \macros -%D {ifCONTEXT} -%D -%D In the system and support modules we sometimes show examples -%D that make use of core commands. We can skip those parts of -%D the documentation when we use another macropackage. Of -%D course we default to false. - -\newif \ifCONTEXT - -%D \macros -%D {!!count, !!toks, !!dimen, !!box, -%D !!width, !!height, !!depth, !!string, !!done} -%D -%D We define some more \COUNTERS\ and \DIMENSIONS. We also -%D define some shortcuts to the local scatchregisters~0, 2, 4, -%D 6 and~8. - -\newcount\!!counta \toksdef\!!toksa=0 \dimendef\!!dimena= 0 \chardef\!!boxa =0 -\newcount\!!countb \toksdef\!!toksb=2 \dimendef\!!dimenb= 2 \chardef\!!boxb =2 -\newcount\!!countc \toksdef\!!toksc=4 \dimendef\!!dimenc= 4 \chardef\!!boxc =4 -\newcount\!!countd \toksdef\!!toksd=6 \dimendef\!!dimend= 6 \chardef\!!boxd =6 -\newcount\!!counte \toksdef\!!tokse=8 \dimendef\!!dimene= 8 \chardef\!!boxe =8 -\newcount\!!countf \dimendef\!!dimenf=10 %skipdef\!!skipa=0 - \dimendef\!!dimeng=12 %skipdef\!!skipb=2 - \dimendef\!!dimenh=14 %skipdef\!!skipc=4 - \dimendef\!!dimeni=16 %skipdef\!!skipd=6 - \dimendef\!!dimenj=18 %skipdef\!!skipe=8 - \dimendef\!!dimenk=20 %skipdef\!!skipf=10 - -\let\!!stringa\empty \let\!!stringb\empty \let\!!stringc\empty -\let\!!stringd\empty \let\!!stringe\empty \let\!!stringf\empty - -\newdimen\!!widtha \newdimen\!!heighta \newdimen\!!deptha -\newdimen\!!widthb \newdimen\!!heightb \newdimen\!!depthb -\newdimen\!!widthc \newdimen\!!heightc \newdimen\!!depthc - -\newif\if!!donea \newif\if!!doneb \newif\if!!donec -\newif\if!!doned \newif\if!!donee \newif\if!!donef - -\ifx\data\undefined \else \let\data \relax \fi % dep checker - -%D Beware: we don't reuse plain counters, too dangerous -%D when <= 20 (e.g. in supp-pdf this messed up things). - -\ifx\undefined\zeroskip \newskip \zeroskip \fi -\ifx\undefined\zeropoint \newdimen \zeropoint \fi -\ifx\undefined\zerocount \newcount \zerocount \fi -\ifx\undefined\minusone \newcount \minusone \fi \minusone = -1 -\ifx\undefined\minustwo \newcount \minustwo \fi \minustwo = -2 -\ifx\undefined\plusone \chardef \plusone = 1 \fi -\ifx\undefined\plustwo \chardef \plustwo = 2 \fi -\ifx\undefined\plusthree \chardef \plusthree = 3 \fi -\ifx\undefined\plusfour \chardef \plusfour = 4 \fi -\ifx\undefined\plusfive \chardef \plusfive = 5 \fi -\ifx\undefined\plusten \mathchardef \plusten = 10 \fi -\ifx\undefined\plushundred \mathchardef \plushundred = 100 \fi -\ifx\undefined\plusthousand \mathchardef \plusthousand = 1000 \fi -\ifx\undefined\plustenthousand \mathchardef \plustenthousand = 10000 \fi -\ifx\undefined\plustwentythousand \mathchardef \plustwentythousand = 20000 \fi - -%D \macros -%D {s!,c!,e!,p!,v!,@@,??} -%D -%D To save memory, we use constants (sometimes called -%D variables). Redefining these constants can have desastrous -%D results. - -\def\v!prefix! {v!} \def\c!prefix! {c!} -\def\s!prefix! {s!} \def\p!prefix! {p!} - -\def\s!next {next} \def\s!default {default} -\def\s!dummy {dummy} \def\s!unknown {unknown} - -\def\s!do {do} \def\s!dodo {dodo} - -\def\s!complex {complex} \def\s!start {start} -\def\s!simple {simple} \def\s!stop {stop} - -\def\s!empty {empty} - -%D \macros -%D {@EA,@EAEA,@EAEAEA,@EAEAEAEAEAEA,expanded,startexpanded} -%D -%D When in unprotected mode, to be entered with -%D \type{\unprotect}, one can use \type{\@EA} as equivalent -%D of \type{\expandafter}. - -\let\@NX\noexpand -\let\@EA\expandafter - -\def\@EAEA {\expandafter\expandafter} -\def\@EAEAEA{\expandafter\expandafter\expandafter} - -\def\@EAEAEAEAEAEA{\expandafter\@EAEAEA\expandafter} - -%D Sometimes we pass macros as arguments to commands that -%D don't expand them before interpretation. Such commands can -%D be enclosed with \type{\expanded}, like: -%D -%D \starttyping -%D \expanded{\setupsomething[\alfa]} -%D \stoptyping -%D -%D Such situations occur for instance when \type{\alfa} is a -%D commalist or when data stored in macros is fed to index of -%D list commands. If needed, one should use \type{\noexpand} -%D inside the argument. Later on we will meet some more clever -%D alternatives to this command. - -\long\def\@@expanded{} % always long; global (less restores) - -\long\def\expanded#1% - {\long\xdef\@@expanded{\noexpand#1}\@@expanded} - -%D Beware, the next one has no \type {\noexpand} before its -%D argument. - -\long\def\startexpanded#1\stopexpanded % see x-fo for example - {\long\xdef\@@expanded{#1}\@@expanded} - -%D \macros -%D {safeexpanded,everysafeexpanded} -%D -%D In addition we provide: - -\newtoks\everysafeexpanded - -\long\def\safeexpanded#1% why the \noexpand - {\begingroup - \the\everysafeexpanded\long\xdef\@@expanded{\noexpand#1}% - \endgroup - \@@expanded} - -\def\safeedef#1#2% - {\begingroup - \the\everysafeexpanded\long\xdef\@@expanded{\noexpand#2}% - \endgroup - \let#1\@@expanded} - -\def\safexdef#1#2% - {\begingroup - \the\everysafeexpanded\long\xdef\@@expanded{\noexpand#2}% - \endgroup - \global\let#1\@@expanded} - -%D You can append protective measures to the token register if -%D needed, as we will do later. - -%D \macros -%D {expandoneargafter,expandtwoargsafter} -%D -%D These two commands make macros more readable by hiding a -%D lot of \type {\expandafter}'s. They expand the arguments -%D after the first command. -%D -%D \starttyping -%D \expandoneargafter \command{\abc} -%D \expandtwoargsafter\command{\abc}{\def} -%D \stoptyping -%D -%D These commands expect the arguments to be macros. - -\def\expandoneargafter #1{\@EA#1\@EA} -\def\expandtwoargsafter#1#2{\@EA\@EA\@EA#1\@EA\@EA\@EA{\@EA#2\@EA}\@EA} - -%D These two do a full expansion: - -\def\fullexpandoneargafter #1#2{\long\xdef\@@expanded{\noexpand#1{#2}}\@@expanded} -\def\fullexpandtwoargsafter#1#2#3{\long\xdef\@@expanded{\noexpand#1{#2}{#3}}\@@expanded} - -%D \macros -%D {gobbleoneargument,gobble...arguments} -%D -%D The next set of macros just do nothing, except that they -%D get rid of a number of arguments. - -\long\def\gobbleoneargument #1{} -\long\def\gobbletwoarguments #1#2{} -\long\def\gobblethreearguments #1#2#3{} -\long\def\gobblefourarguments #1#2#3#4{} -\long\def\gobblefivearguments #1#2#3#4#5{} -\long\def\gobblesixarguments #1#2#3#4#5#6{} -\long\def\gobblesevenarguments #1#2#3#4#5#6#7{} -\long\def\gobbleeightarguments #1#2#3#4#5#6#7#8{} -\long\def\gobbleninearguments #1#2#3#4#5#6#7#8#9{} -\long\def\gobbletenarguments #1{\gobbleninearguments} - -%D \macros -%D {doifnextcharelse} -%D -%D When we started using \TEX\ in the late eighties, our -%D first experiences with programming concerned a simple shell -%D around \LATEX. The commands probably use most at \PRAGMA, -%D are the itemizing ones. One of those few shell commands took -%D care of an optional argument, that enabled us to specify -%D what kind of item symbol we wanted. Without understanding -%D anything we were able to locate a \LATEX\ macro that could -%D be used to inspect the next character. -%D -%D It's this macro that the ancester of the next one presented -%D here. It executes one of two actions, dependant of the next -%D character. Disturbing spaces and line endings, which are -%D normally interpreted as spaces too, are skipped. -%D -%D \starttyping -%D \doifnextcharelse {karakter} {then ...} {else ...} -%D \stoptyping -%D -%D This macro differs from the original in the use of \type -%D {\localnext} because we don't want clashes with \type -%D {\next}. - -\long\def\doifnextcharelse#1#2#3% #1 should not be {} ! - {\let\charactertoken=#1% = needed here - \def\!!stringa{#2}% - \def\!!stringb{#3}% - \futurelet\nexttoken\inspectnextcharacter} - -\def\inspectnextcharacter - {\ifx\nexttoken\blankspace - \@EA\reinspectnextcharacter - \else\ifx\nexttoken\charactertoken - \@EAEAEA\!!stringa - \else - \@EAEAEA\!!stringb - \fi\fi} - -%D Because we will mostly use this macro for testing if the next -%D character is \type {[}, we also make a slightly faster variant -%D as it is not uncommon to have tens of thousands of calls to this -%D test in a run. Of course it also is more convenient to read a -%D trace then. - -\let\nextoptionalcharactertoken=[ - -\long\def\doifnextoptionalelse#1#2% - {\def\nextoptionalcommandyes{#1}% - \def\nextoptionalcommandnop{#2}% - \futurelet\nexttoken\inspectnextoptionalcharacter} - -\def\inspectnextoptionalcharacter - {\ifx\nexttoken\blankspace - \@EA\reinspectnextoptionalcharacter - \else\ifx\nexttoken\nextoptionalcharactertoken - \@EAEAEA\nextoptionalcommandyes - \else - \@EAEAEA\nextoptionalcommandnop - \fi\fi} - -\let\nextbgroupcharactertoken\bgroup - -\long\def\doifnextbgroupelse#1#2% - {\def\nextbgroupcommandyes{#1}% - \def\nextbgroupcommandnop{#2}% - \futurelet\nexttoken\inspectnextbgroupcharacter} - -\def\inspectnextbgroupcharacter - {\ifx\nexttoken\blankspace - \@EA\reinspectnextbgroupcharacter - \else\ifx\nexttoken\nextbgroupcharactertoken - \@EAEAEA\nextbgroupcommandyes - \else - \@EAEAEA\nextbgroupcommandnop - \fi\fi} - -%D This macro uses some auxiliary macros. Although we were able -%D to program quite complicated things, I only understood these -%D after rereading the \TEX book. The trick is in using a -%D command with a one character name. Such commands differ from -%D the longer ones in the fact that trailing spaces are {\em -%D not} skipped. This enables us to indirectly define a long -%D named macro that gobbles a space. -%D -%D In the first line we define \type{\blankspace}. Next we -%D make \type{\:} equivalent to \type{\reinspect...}. This -%D one||character command is expanded before the next -%D \type{\def} comes into action. This way the space after -%D \type{\:} becomes a delimiter of the longer named -%D \type{\reinspectnextcharacter}. The chain reaction is -%D visually compatible with the next sequence: -%D -%D \starttyping -%D \expandafter\def\reinspectnextcharacter % -%D {\futurelet\nexttoken\inspectnextcharacter} -%D \stoptyping -%D -%D However complicated it may look, I'm still glad I stumbled -%D into this construction. Saving and restoring \type {\:} is -%D needed when we use \PPCHTEX\ in \LATEX. - -\let\next\: - -\def\:{\let\blankspace= } \: - -\def\:{\reinspectnextcharacter} -\expandafter\def\: {\futurelet\nexttoken\inspectnextcharacter} - -\def\:{\reinspectnextoptionalcharacter} -\expandafter\def\: {\futurelet\nexttoken\inspectnextoptionalcharacter} - -\def\:{\reinspectnextbgroupcharacter} -\expandafter\def\: {\futurelet\nexttoken\inspectnextbgroupcharacter} - -\let\:\next - -%D \macros -%D {setvalue,setgvalue,setevalue,setxvalue, -%D letvalue, -%D getvalue, -%D resetvalue} -%D -%D \TEX's primitive \type{\csname} can be used to construct -%D all kind of commands that cannot be defined with -%D \type{\def} and \type{\let}. Every macro programmer sooner -%D or later wants macros like these. -%D -%D \starttyping -%D \setvalue {name}{...} = \def\name{...} -%D \setgvalue {name}{...} = \gdef\name{...} -%D \setevalue {name}{...} = \edef\name{...} -%D \setxvalue {name}{...} = \xdef\name{...} -%D \letvalue {name}=\... = \let\name=\... -%D \letgvalue {name}=\... = \global\let\name=\... -%D \getvalue {name} = \name -%D \resetvalue {name} = \def\name{} -%D \stoptyping -%D -%D As we will see, \CONTEXT\ uses these commands many times, -%D which is mainly due to its object oriented and parameter -%D driven character. - -\def\setvalue #1{\expandafter \def\csname#1\endcsname} -\def\setgvalue #1{\expandafter\gdef\csname#1\endcsname} -\def\setevalue #1{\expandafter\edef\csname#1\endcsname} -\def\setxvalue #1{\expandafter\xdef\csname#1\endcsname} -\def\getvalue #1{\csname#1\endcsname} -\def\letvalue #1{\expandafter\let\csname#1\endcsname} -\def\letgvalue #1{\global\expandafter\let\csname#1\endcsname} -\def\resetvalue #1{\expandafter\let\csname#1\endcsname\empty} -\def\ignorevalue#1#2{\expandafter\let\csname#1\endcsname\empty} - -%D \macros -%D {globallet,glet} -%D -%D In \CONTEXT\ of May 2000 using \type {\globallet} -%D instead of the two tokens will save us some -%D $300\times4=1200$ bytes of format file on a 32~bit -%D system. So: - -\def\globallet{\global\let} \let\glet\globallet - -%D \macros -%D {donottest,unexpanded} -%D -%D When expansion of a macro gives problems, we can precede it -%D by \type{\donottest}. It seems that protection is one of the -%D burdens of developers of packages, so maybe that's why in -%D \ETEX\ protection is solved in a more robust way. -%D -%D Sometimes prefixing the macro with \type{\donottest} leads -%D to defining an auxiliary macro, like -%D -%D \starttyping -%D \def\dosomecommand {... ... ...} -%D \def\somecommand {\donottest\dosomecommand} -%D \stoptyping -%D -%D This double definition can be made transparant by using -%D \type{\unexpanded}, as in: -%D -%D \starttyping -%D \unexpanded\def\somecommand{... ... ...} -%D \stoptyping -%D -%D The protection mechanism uses: - -\beginTEX - -\def\dontprocesstest#1{==} -\def\doprocesstest #1{#1} - -\let\donottest=\doprocesstest - -\endTEX - -\beginETEX \detokenize - -\def\donottest#1{#1} % {\detokenize{#1}} - -\endETEX - -%D By the way, we use a placeholder because we don't want -%D interference when testing on empty strings. Using a -%D placeholder of 8~characters increases the processing time -%D of simple \type{\doifelse} tests by about 10 \%. When we -%D process the test, we have to remove the braces and -%D therefore explictly gobble \type{#1}. - -%D \macros -%D {honorunexpanded,forceunexpanded} -%D -%D The fact that many macros have the same prefix, could have -%D a negative impact on searching in the hash table. Because -%D some simple testing does not show differences, we just use: -%D -%D \starttyping -%D \def\unexpanded#1#2% -%D {\@EA#1\@EA#2\@EA{\@EA\donottest\csname\s!do\string#2\endcsname}% -%D \@EA#1\csname\s!do\string#2\endcsname} -%D \stoptyping -%D -%D Well, in fact we use the bit more versatile alternative. The -%D \type {\honorunexpanded} can be used to \type {\string} -%D the protected command, which by the way is seldom needed -%D in \CONTEXT. - -\beginTEX - -\def\dosetunexpanded#1#2% - {\@EA#1\@EA{\@EA#2\@EA}% - \@EA{\@EA\donottest\csname\s!do\@EA\string\csname#2\endcsname\endcsname}% - \@EA#1\@EA{\@EA\s!do\@EA\string\csname#2\endcsname}} - -\def\docomunexpanded#1#2% - {\@EA#1\@EA#2\@EA{\@EA\donottest\csname\s!do\string#2\endcsname}% - \@EA#1\csname\s!do\string#2\endcsname} - -\def\unexpanded#1% - {\def\dounexpanded - {\ifx\next\bgroup - \@EA\dosetunexpanded - \else - \@EA\docomunexpanded - \fi#1}% - \futurelet\next\dounexpanded} - -\def\honorunexpanded% for writing to a file or message - {\def\donottest##1{\expandafter\gobblethreearguments\string##1}} - -\def\forceunexpanded% for preventing expansion in \xdef - {\def\donottest##1% - {\expandafter\noexpand\csname\expandafter\gobblefourarguments\string##1\endcsname}} - -\def\resetunexpanded% - {\let\donottest\doprocesstest} - -\endTEX - -\beginETEX \protected - -\let \unexpanded \normalprotected -\let \honorunexpanded \empty % \relax -\let \forceunexpanded \empty % \relax -\let \resetunexpanded \empty % \relax - -\endETEX - -%D This one accepts the more direct \type{\def} and cousins -%D as well as the \CONTEXT\ specific \type{\setvalue} ones. -%D -%D And so the definition in our example turns out to be: -%D -%D \starttyping -%D \def\csname do\somecommand\endcsname{... ... ...} -%D \def\somecommand{\donottest\csname do\somecommand\endcsname} -%D \stoptyping -%D -%D In which \type{do\somecommand} is hidden from the user and -%D cannot lead to confusion. It's still permitted to define -%D auxiliary macros like \type{\dosomecommand}. -%D -%D When we are going to use e-\TEX, we'll probably end up -%D redefining some commands, but we can probably keep the -%D \type{\unexpanded} ones unchanged. - -%D \macros -%D {doifundefined,doifdefined, -%D doifundefinedelse,doifdefinedelse, -%D doifalldefinedelse} -%D -%D The standard way of testing if a macro is defined is -%D comparing its meaning with another undefined one, usually -%D \type{\undefined}. To garantee correct working of the next -%D set of macros, \type{\undefined} may never be defined! -%D -%D \starttyping -%D \doifundefined {string} {...} -%D \doifdefined {string} {...} -%D \doifundefinedelse {string} {then ...} {else ...} -%D \doifdefinedelse {string} {then ...} {else ...} -%D \doifalldefinedelse {commalist} {then ...} {else ...} -%D \stoptyping -%D -%D Every macroname that \TEX\ builds gets an entry in the hash -%D table, which is of limited size. It is expected that e-\TeX\ -%D will offer a less memory||consuming alternative. - -%D Although it will probably never be a big problem, it is good -%D to be aware of the difference between testing on a macro -%D name to be build by using \type{\csname} and -%D \type{\endcsname} and testing the \type{\name} directly. -%D -%D \starttyping -%D \expandafter\ifx\csname NameA\endcsname\relax ... \else ... \fi -%D -%D \ifx\NameB\undefined ... \else ... \fi -%D \stoptyping -%D -%D I became aware of this when I mistakenly testen the first -%D one against \type{\undefined}. When \TEX\ build a name using -%D \type{\csname} it automatically sets it to \type{\relax}, -%D which is definitely not the same as \type{\undefined}. The -%D quickest way to check these things is asking \TEX\ to show -%D the meaning of the names: -%D -%D \starttyping -%D \expandafter\show\csname NameA\endcsname -%D -%D \show\NameB -%D \stoptyping -%D -%D The main reason why this never will be a big problem is that -%D when one uses the \type{\csname} way, one probably has to do -%D with some macroname that always is dealt with that way. -%D Confusion can however arise when one applies both testing -%D methods to the same macroname. By the way, the assignment -%D of \type{\relax} obeys grouping. - -%D The first one gets rid of \type{#1}, but still expands to -%D something and the second one expands to \type{#1}. Because -%D we accept arguments between \type{{}}, we have to get rid -%D of one level of braces. -%D -%D Our first implementation of \type{\ifundefined} was -%D straightforward and readable: -%D -%D \starttyping -%D \def\ifundefined#1% -%D {\expandafter\ifx\csname#1\endcsname\relax}% -%D -%D \def\doifundefinedelse#1#2#3% -%D {\let\donottest=\dontprocesstest -%D \ifundefined{#1}% -%D \let\donottest=\doprocesstest#2% -%D \else -%D \let\donottest=\doprocesstest#3% -%D \fi} -%D -%D \def\doifdefinedelse#1#2#3% -%D {\doifundefinedelse{#1}{#3}{#2}} -%D -%D \def\doifundefined#1#2% -%D {\doifundefinedelse{#1}{#2}{}} -%D -%D \def\doifdefined#1#2% -%D {\doifundefinedelse{#1}{}{#2}} -%D -%D \def\doifalldefinedelse#1#2#3% -%D {\begingroup -%D \donetrue -%D \def\checkcommand##1% -%D {\doifundefined{##1}{\donefalse}}% -%D \processcommalist[#1]\checkcommand -%D \ifdone -%D \endgroup#2% -%D \else -%D \endgroup#3% -%D \fi} -%D \stoptyping -%D -%D When this module was optimized, timing showed that the -%D next alternative can be upto twice as fast, especially when -%D longer arguments are used. Watch how we reach over the -%D \type {\else} and \type {\fi}: this way they cannot get -%D into the way (and we can avoid those \type {\next} -%D hacks); I started using this method after I did some -%D speed optimization tests in the xtag modules; the -%D efficiency of such hacks depends on the length of the -%D argument etc. etc.) - -\beginTEX - -\def\ifundefined#1% - {\expandafter\ifx\csname#1\endcsname\relax} - -\def\p!doifundefined#1% - {\let\donottest\dontprocesstest - \expandafter\ifx\csname#1\endcsname\relax} - -\def\doifundefinedelse#1% - {\p!doifundefined{#1}% - \let\donottest\doprocesstest\@EA\firstoftwoarguments - \else - \let\donottest\doprocesstest\@EA\secondoftwoarguments - \fi} - -\def\doifdefinedelse#1% - {\p!doifundefined{#1}% - \let\donottest\doprocesstest\@EA\secondoftwoarguments - \else - \let\donottest\doprocesstest\@EA\firstoftwoarguments - \fi} - -\def\doifundefined#1% - {\p!doifundefined{#1}% - \let\donottest\doprocesstest\@EA\firstofoneargument - \else - \let\donottest\doprocesstest\@EA\gobbleoneargument - \fi} - -\def\doifdefined#1% - {\p!doifundefined{#1}% - \let\donottest\doprocesstest\@EA\gobbleoneargument - \else - \let\donottest\doprocesstest\@EA\firstofoneargument - \fi} - -\endTEX - -\beginETEX \ifcsname - -\def\ifundefined#1% ongelukkige naam - {\unless\ifcsname#1\endcsname} - -\def\p!doifundefined#1% - {\edef\p!defined{#1}% - \unless\ifcsname\detokenize\@EA{\p!defined}\endcsname} - -\def\doifundefinedelse#1% - {\edef\p!defined{#1}% - \ifcsname\detokenize\@EA{\p!defined}\endcsname - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} - -\def\doifdefinedelse#1% - {\edef\p!defined{#1}% - \ifcsname\detokenize\@EA{\p!defined}\endcsname - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\def\doifundefined#1% - {\edef\p!defined{#1}% - \ifcsname\detokenize\@EA{\p!defined}\endcsname - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -\def\doifdefined#1% - {\edef\p!defined{#1}% - \ifcsname\detokenize\@EA{\p!defined}\endcsname - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\endETEX - -%D \macros -%D {letbeundefined} -%D -%D Testing for being undefined comes down to testing on \type -%D {\relax} when we use \type {\csname}, but when using \type -%D {\ifx}, we test on being \type {\undefined}! In \ETEX\ we -%D have \type {\ifcsname} and that way of testing on existance -%D is not the same as the one described here. Therefore we -%D introduce: - -\beginTEX - -\def\letbeundefined#1% - {\expandafter\let\csname#1\endcsname\relax} - -\endTEX - -\beginETEX \undefined - -\def\letbeundefined#1% potential stack buildup when used \global - {\expandafter\let\csname#1\endcsname\undefined} - -\def\localundefine#1% conditional - {\ifcsname#1\endcsname\expandafter\let\csname#1\endcsname\undefined\fi} -\def\globalundefine#1% conditional - {\ifcsname#1\endcsname\expandafter\global\let\csname#1\endcsname\undefined\fi} - -\endETEX - -%D Beware, being \type {\undefined} in \ETEX\ means that the macro -%D {\em is} defined! - -%D Before we start using this variant, we used another one, -%D which is even a bit faster. This one looked like: -%D -%D \starttyping -%D \def\p!doifundefined% -%D {\begingroup -%D \let\donottest=\dontprocesstest -%D \ifundefined} -%D -%D \def\doifundefinedelse#1#2#3% -%D {\p!doifundefined{#1}% -%D \endgroup#2% -%D \else -%D \endgroup#3% -%D \fi} -%D \stoptyping -%D -%D A even more previous version used \type{\bgroup} and -%D \type {\egroup}. In math mode however, \type{$1{x}2$} differs -%D from \type{$1x2$}. This can been seen when one compares the -%D output of: -%D -%D \starttyping -%D $\kern10pt\showthe\lastkern$ -%D $\kern10pt{\showthe\lastkern}$ -%D $\kern10pt\begingroup\showthe\lastkern\endgroup$ -%D \stoptyping -%D -%D Also in math mode, one can better use \type {\begingroup} -%D and companion instead of \type {\bgroup}. -%D -%D When we were developing the scientific units module, we -%D encountered different behavior in text and math mode, which -%D was due to this grouping subtilities. We therefore decided -%D to use \type{\begingroup} instead of \type{\bgroup}. -%D Later, when we had optimized some macro's the grouped -%D solution turned out to be unsafe when typesetting this -%D documentation, especially when using \type{\globaldefs}. -%D -%D We still have to define \type{\doifalldefinedelse}. Watch -%D the use of grouping, which garantees local use of the -%D boolean \type{\ifdone}. - -\beginTEX - -\def\docheckonedefined#1% - {\ifundefined{#1}% - \donefalse - \fi} - -\def\doifalldefinedelse#1% - {\begingroup - \let\donottest\dontprocesstest - \donetrue - \processcommalist[#1]\docheckonedefined - \ifdone - \endgroup\let\donottest\doprocesstest - \expandafter\firstoftwoarguments - \else - \endgroup\let\donottest\doprocesstest - \expandafter\secondoftwoarguments - \fi} - -\endTEX - -\beginETEX \ifcsname - -\def\docheckonedefined#1% - {\unless\ifcsname#1\endcsname - \donefalse - \fi} - -\def\doifalldefinedelse#1% - {\begingroup - \donetrue \processcommalist[#1]\docheckonedefined - \ifdone - \endgroup\expandafter\firstoftwoarguments - \else - \endgroup\expandafter\secondoftwoarguments - \fi} - -\endETEX - -%D \macros -%D {doif,doifelse,doifnot, -%D donottest} -%D -%D Programming in \TEX\ differs from programming in procedural -%D languages like \MODULA. This means that one --- well, let me -%D speek for myself --- tries to do the things in the well -%D known way. Therefore the next set of \type{\ifthenelse} -%D commands were between the first ones we needed. A few years -%D later, the opposite became true: when programming in -%D \MODULA, I sometimes miss handy things like grouping, -%D runtime redefinition, expansion etc. While \MODULA\ taught -%D me to structure, \TEX\ taught me to think recursive. -%D -%D \starttyping -%D \doif {string1} {string2} {...} -%D \doifnot {string1} {string2} {...} -%D \doifelse {string1} {string2} {then ...}{else ...} -%D \stoptyping -%D -%D When expansion gives problems, we can precede the -%D troublemaker with \type{\donottest}. -%D -%D This implementatie does not use the construction which is -%D more robust for nested conditionals. -%D -%D \starttyping -%D \ifx\!!stringa\!!stringb -%D \def\next{#3}% -%D \else -%D \def\next{#4}% -%D \fi -%D \next -%D \stoptyping -%D -%D In practice, this alternative is at least 20\% slower than -%D the alternative used here. The few cases in which we -%D really need the \type{\next} construction, often need some -%D other precautions and or adaptions too. - -\beginTEX - -% \long\def\doif#1#2#3% -% {\let\donottest\dontprocesstest -% \edef\!!stringa{#1}% -% \edef\!!stringb{#2}% -% \let\donottest\doprocesstest -% \ifx\!!stringa\!!stringb -% #3% -% \fi} -% -% \long\def\doifnot#1#2#3% -% {\let\donottest\dontprocesstest -% \edef\!!stringa{#1}% -% \edef\!!stringb{#2}% -% \let\donottest\doprocesstest -% \ifx\!!stringa\!!stringb -% \else -% #3% -% \fi} -% -% \long\def\doifelse#1#2#3#4% -% {\let\donottest\dontprocesstest -% \edef\!!stringa{#1}% -% \edef\!!stringb{#2}% -% \let\donottest\doprocesstest -% \ifx\!!stringa\!!stringb -% #3% -% \else -% #4% -% \fi} - -%D Slightly faster on big arguments, as well as \type -%D {\next} avoiding: - -\long\def\doif#1#2% - {\let\donottest\dontprocesstest - \edef\!!stringa{#1}% - \edef\!!stringb{#2}% - \let\donottest\doprocesstest - \ifx\!!stringa\!!stringb - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\long\def\doifnot#1#2% - {\let\donottest\dontprocesstest - \edef\!!stringa{#1}% - \edef\!!stringb{#2}% - \let\donottest\doprocesstest - \ifx\!!stringa\!!stringb - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - - -\long\def\doifelse#1#2% - {\let\donottest\dontprocesstest - \edef\!!stringa{#1}% - \edef\!!stringb{#2}% - \let\donottest\doprocesstest - \ifx\!!stringa\!!stringb - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\endTEX - -\beginETEX \protected - -% \long\def\doif#1#2#3% -% {\edef\!!stringa{#1}\edef\!!stringb{#2}% -% \ifx\!!stringa\!!stringb#3\fi} -% -% \long\def\doifnot#1#2#3% -% {\edef\!!stringa{#1}\edef\!!stringb{#2}% -% \unless\ifx\!!stringa\!!stringb#3\fi} -% -% \long\def\doifelse#1#2#3#4% -% {\edef\!!stringa{#1}\edef\!!stringb{#2}% -% \ifx\!!stringa\!!stringb#3\else#4\fi} - -%D Slightly faster on big arguments, as well as \type -%D {\next} avoiding: - -\long\def\doif#1#2% - {\edef\!!stringa{#1}\edef\!!stringb{#2}% - \ifx\!!stringa\!!stringb - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\long\def\doifnot#1#2% - {\edef\!!stringa{#1}\edef\!!stringb{#2}% - \ifx\!!stringa\!!stringb - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -\long\def\doifelse#1#2% - {\edef\!!stringa{#1}\edef\!!stringb{#2}% - \ifx\!!stringa\!!stringb - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\endETEX - -%D One could wonder why we don't follow the the same approach -%D as in \type{\doifdefined} c.s.\ and use \type{\begingroup} -%D and \type{\endgroup}. In this case, this alternative is -%D slower, which is probably due to the fact that more meanings -%D need to be restored. -%D -%D The in terms of memory more efficient alternative using a -%D auxiliary macro also proved to be slower, so we definitely -%D did not choose for: -%D -%D \starttyping -%D \def\p!doifelse#1#2% -%D {\let\donottest=\dontprocesstest -%D \edef\!!stringa{#1}% -%D \edef\!!stringb{#2}% -%D \let\donottest=\doprocesstest -%D \ifx\!!stringa\!!stringb} -%D -%D \long\def\doif#1#2#3% -%D {\p!doifelse{#1}{#2}#3\fi} -%D -%D \long\def\doifnot#1#2#3% -%D {\p!doifelse{#1}{#2}\else#3\fi} -%D -%D \long\def\doifelse#1#2#3#4% -%D {\p!doifelse{#1}{#2}#3\else#4\fi} -%D \stoptyping -%D -%D Optimizations like this are related of course to the -%D bottlenecks in \TEX. It seems that restoring saved meanings -%D and passing arguments takes some time. - -%D \macros -%D {doifempty,doifemptyelse,doifnotempty} -%D -%D We complete our set of conditionals with: -%D -%D \starttyping -%D \doifempty {string} {...} -%D \doifnotempty {string} {...} -%D \doifemptyelse {string} {then ...} {else ...} -%D \stoptyping -%D -%D This time, the string is not expanded. - -\long\def\doifemptyelse#1% - {\def\!!stringa{#1}% - \ifx\!!stringa\empty - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\long\def\doifempty#1% - {\def\!!stringa{#1}% - \ifx\!!stringa\empty - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\long\def\doifnotempty#1% - {\def\!!stringa{#1}% - \ifx\!!stringa\empty - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -%D \macros -%D {doifinset,doifnotinset,doifinsetelse} -%D -%D We can check if a string is present in a comma separated -%D set of strings. Depending on the result, some action is -%D taken. -%D -%D \starttyping -%D \doifinset {string} {string,...} {...} -%D \doifnotinset {string} {string,...} {...} -%D \doifinsetelse {string} {string,...} {then ...} {else ...} -%D \stoptyping -%D -%D The second argument is the comma separated set of strings. -%D -%D \starttyping -%D \long\def\doifinsetelse#1#2#3#4% -%D {\doifelse{#1}{} -%D {#4} -%D {\donefalse -%D \def\p!checkiteminset##1% -%D {\doif{#1}{##1} -%D {\donetrue -%D \let\p!checkiteminset=\gobbleoneargument}}% -%D \processcommalist[#2]\p!checkiteminset -%D \ifdone -%D #3% -%D \else -%D #4% -%D \fi}} -%D -%D \long\def\doifinset#1#2#3% -%D {\doifinsetelse{#1}{#2}{#3}{}} -%D -%D \long\def\doifnotinset#1#2#3% -%D {\doifinsetelse{#1}{#2}{}{#3}} -%D \stoptyping -%D -%D Because this macro is called quite often we've spent some -%D time optimizing it. This time, the gain in speed is due to -%D (1)~defining an external auxiliary macro, (2)~not calling -%D any other macros and (3)~minimizing the passing of -%D arguments. The gain in speed is impressive. - -% \def\p!dodocheckiteminset#1% -% {\edef\!!stringb{#1}% -% \ifx\!!stringa\!!stringb -% \donetrue -% \let\p!docheckiteminset\gobbleoneargument -% \fi} -% -% \beginTEX -% -% \def\p!doifinsetelse#1#2% -% {\let\donottest\dontprocesstest -% \donefalse -% \edef\!!stringa{#1}% -% \ifx\!!stringa\empty -% \else -% \let\p!docheckiteminset\p!dodocheckiteminset -% \processcommalist[#2]\p!docheckiteminset -% \fi -% \let\donottest\doprocesstest -% \ifdone} -% -% \endTEX -% -% \beginETEX \protected -% -% \def\p!doifinsetelse#1#2% -% {\donefalse -% \edef\!!stringa{#1}% -% \ifx\!!stringa\empty -% \else -% \let\p!docheckiteminset\p!dodocheckiteminset -% \processcommalist[#2]\p!docheckiteminset -% \fi -% \ifdone} -% -% \endETEX - -% then we had: -% -% \def\p!docheckiteminset#1% -% {\edef\!!stringb{#1}% -% \ifx\!!stringa\!!stringb -% \donetrue -% \expandafter\quitcommalist -% \fi} -% -% \beginTEX -% -% \def\p!doifinsetelse#1#2% -% {\let\donottest\dontprocesstest -% \donefalse -% \edef\!!stringa{#1}% -% \ifx\!!stringa\empty -% \else -% \processcommalist[#2]\p!docheckiteminset -% \fi -% \let\donottest\doprocesstest -% \ifdone} -% -% \endTEX -% -% % can be sped up with processnext... -% -% \beginETEX \protected -% -% \def\p!doifinsetelse#1#2% -% {\donefalse -% \edef\!!stringa{#1}% -% \ifx\!!stringa\empty -% \else -% \processcommalist[#2]\p!docheckiteminset -% \fi -% \ifdone} -% -% \endETEX -% -% \long\def\doifinsetelse#1#2% -% {\p!doifinsetelse{#1}{#2}% -% \expandafter\firstoftwoarguments -% \else -% \expandafter\secondoftwoarguments -% \fi} -% -% \long\def\doifinset#1#2% -% {\p!doifinsetelse{#1}{#2}% -% \expandafter\firstofoneargument -% \else -% \expandafter\gobbleoneargument -% \fi} -% -% \long\def\doifnotinset#1#2% -% {\p!doifinsetelse{#1}{#2}% -% \expandafter\gobbleoneargument -% \else -% \expandafter\firstofoneargument -% \fi} -% -% now we have - -\def\p!docheckiteminset#1% - {\edef\!!stringb{#1}% - \ifx\!!stringa\!!stringb - \donetrue - \expandafter\quitcommalist - \fi} - -\beginTEX - -\def\p!doifinsetelse#1#2#3#4% - {\let\donottest\dontprocesstest - \donefalse - \edef\!!stringa{#3}% - \ifx\!!stringa\empty - \else - \processcommalist[#4]\p!docheckiteminset - \fi - \let\donottest\doprocesstest - \ifdone\expandafter#1\else\expandafter#2\fi} - -\endTEX - -\beginETEX \protected - -\def\p!doifinsetelse#1#2#3#4% - {\donefalse - \edef\!!stringa{#3}% - \ifx\!!stringa\empty - \else - \processcommalist[#4]\p!docheckiteminset - \fi - \ifdone\expandafter#1\else\expandafter#2\fi} - -\endETEX - -\long\def\doifinsetelse - {\p!doifinsetelse\firstoftwoarguments\secondoftwoarguments} - -\long\def\doifinset - {\p!doifinsetelse\firstofoneargument\gobbleoneargument} - -\long\def\doifnotinset - {\p!doifinsetelse\gobbleoneargument\firstofoneargument} - -%D \macros -%D {doifcommon,doifnotcommon,doifcommonelse} -%D -%D Probably the most time consuming tests are those that test -%D for overlap in sets of strings. -%D -%D \starttyping -%D \doifcommon {string,...} {string,...} {...} -%D \doifnotcommon {string,...} {string,...} {...} -%D \doifcommonelse {string,...} {string,...} {then ...} {else ...} -%D \stoptyping -%D -%D We show the slower alternative first, because it shows us -%D how things are done. -%D -%D \starttyping -%D \long\def\doifcommonelse#1#2#3#4% -%D {\donefalse -%D \def\p!docommoncheck##1% -%D {\def\p!dodocommoncheck####1% -%D {\doif{####1}{##1} -%D {\donetrue -%D \def\commalistelement{##1}% -%D \let\p!docommoncheck=\gobbleoneargument -%D \let\p!dodocommoncheck=\gobbleoneargument}}% -%D \processcommalist[#2]\p!dodocommoncheck}% -%D \processcommalist[#1]\p!docommoncheck -%D \ifdone -%D #3% -%D \else -%D #4% -%D \fi} -%D -%D \long\def\doifcommon#1#2#3% -%D {\doifcommonelse{#1}{#2}{#3}{}} -%D -%D \long\def\doifnotcommon#1#2#3% -%D {\doifcommonelse{#1}{#2}{}{#3}} -%D \stoptyping -%D -%D The processing time is shortened by getting the auxiliary -%D macro to the outermost level and using less \type{\edef}'s. -%D Sometimes it makes more sence to define local macro's not -%D only because this way we can be sure that they are not -%D redefined, but also because it shows the dependance. In -%D compiled languages, this is no problem at all. It can even -%D save us bytes and processing time. In interpreted languages -%D like \TEX\ it nearly always slows down processing. - -% \def\p!dododocommoncheck#1% -% {\edef\!!stringb{#1}% -% \ifx\!!stringa\!!stringb -% \donetrue -% \let\p!docommoncheck\gobbleoneargument -% \let\p!dodocommoncheck\gobbleoneargument -% \fi} -% -% \beginTEX -% -% \def\p!doifcommonelse#1#2% -% {\donefalse -% \let\donottest\dontprocesstest -% \let\p!dodocommoncheck\p!dododocommoncheck -% \def\p!docommoncheck##1% -% {\edef\!!stringa{##1}% -% \def\commalistelement{##1}% -% \processcommalist[#2]\p!dodocommoncheck}% -% \processcommalist[#1]\p!docommoncheck -% \let\donottest\doprocesstest -% \ifdone} -% -% \endTEX -% -% \beginETEX \protected -% -% \def\p!doifcommonelse#1#2% -% {\donefalse -% \let\p!dodocommoncheck\p!dododocommoncheck -% \def\p!docommoncheck##1% -% {\edef\!!stringa{##1}% -% \def\commalistelement{##1}% -% \processcommalist[#2]\p!dodocommoncheck}% -% \processcommalist[#1]\p!docommoncheck -% \ifdone} -% -% \endETEX - -% \def\p!dodocommoncheck#1% -% {\edef\!!stringb{#1}% -% \ifx\!!stringa\!!stringb -% \donetrue -% \expandafter\quitprevcommalist -% \fi} -% -% \beginTEX -% -% \def\p!doifcommonelse#1#2% -% {\donefalse -% \let\donottest\dontprocesstest -% \def\p!docommoncheck##1% -% {\edef\!!stringa{##1}% -% \def\commalistelement{##1}% no let to stringa -% \processcommalist[#2]\p!dodocommoncheck}% -% \processcommalist[#1]\p!docommoncheck -% \let\donottest\doprocesstest -% \ifdone} -% -% \endTEX -% -% \beginETEX \protected -% -% \def\p!doifcommonelse#1#2% -% {\donefalse -% \def\p!docommoncheck##1% -% {\edef\!!stringa{##1}% -% \def\commalistelement{##1}% -% \processcommalist[#2]\p!dodocommoncheck}% -% \processcommalist[#1]\p!docommoncheck -% \ifdone} -% -% \endETEX -% -% \long\def\doifcommonelse#1#2% % #3#4% -% {\p!doifcommonelse{#1}{#2}% % #3\else#4\fi} -% \expandafter\firstoftwoarguments -% \else -% \expandafter\secondoftwoarguments -% \fi} -% -% \long\def\doifcommon#1#2% -% {\p!doifcommonelse{#1}{#2}% -% \expandafter\firstofoneargument -% \else -% \expandafter\gobbleoneargument -% \fi} -% -% \long\def\doifnotcommon#1#2% -% {\p!doifcommonelse{#1}{#2}% -% \expandafter\gobbleoneargument -% \else -% \expandafter\firstofoneargument -% \fi} - -% todo: use dedicated done - -\def\p!dodocommoncheck#1% - {\edef\!!stringb{#1}% - \ifx\!!stringa\!!stringb - \donetrue - \expandafter\quitprevcommalist - \fi} - -\beginTEX - -\def\p!doifcommonelse#1#2#3#4% - {\donefalse - \let\donottest\dontprocesstest - \def\p!docommoncheck##1% - {\edef\!!stringa{##1}% - \def\commalistelement{##1}% no let to stringa - \processcommalist[#4]\p!dodocommoncheck}% - \processcommalist[#3]\p!docommoncheck - \let\donottest\doprocesstest - \ifdone\expandafter#1\else\expandafter#2\fi} - -\endTEX - -\beginETEX \protected - -\def\p!doifcommonelse#1#2#3#4% - {\donefalse - \def\p!docommoncheck##1% - {\edef\!!stringa{##1}% - \def\commalistelement{##1}% - \processcommalist[#4]\p!dodocommoncheck}% - \processcommalist[#3]\p!docommoncheck - \ifdone\expandafter#1\else\expandafter#2\fi} - -\endETEX - -\def\doifcommonelse - {\p!doifcommonelse\firstoftwoarguments\secondoftwoarguments} - -\def\doifcommon - {\p!doifcommonelse\firstofoneargument \gobbleoneargument} - -\def\doifnotcommon - {\p!doifcommonelse\gobbleoneargument \firstofoneargument} - -%D \macros -%D {processcommalist,processcommacommand,quitcommalist, -%D processcommalistwithparameters} -%D -%D We've already seen some macros that take care of comma -%D separated lists. Such list can be processed with -%D -%D \starttyping -%D \processcommalist[string,string,...]\commando -%D \stoptyping -%D -%D The user supplied command \type{\commando} receives one -%D argument: the string. This command permits nesting and -%D spaces after commas are skipped. Empty sets are no problem. -%D -%D \startbuffer -%D \def\dosomething#1{(#1)} -%D -%D 1: \processcommalist [\hbox{$a,b,c,d,e,f$}] \dosomething \par -%D 2: \processcommalist [{a,b,c,d,e,f}] \dosomething \par -%D 3: \processcommalist [{a,b,c},d,e,f] \dosomething \par -%D 4: \processcommalist [a,b,{c,d,e},f] \dosomething \par -%D 5: \processcommalist [a{b,c},d,e,f] \dosomething \par -%D 6: \processcommalist [{a,b}c,d,e,f] \dosomething \par -%D 7: \processcommalist [] \dosomething \par -%D 8: \processcommalist [{[}] \dosomething \par -%D \stopbuffer -%D -%D \typebuffer -%D -%D Before we show the result, we present the macro's: - -\newcount\commalevel - -\def\dododoprocesscommaitem - {\csname\s!next\the\commalevel\endcsname} - -%\def\dodoprocesscommaitem% -% {\ifx\nexttoken\blankspace -% \let\nextcommaitem\redoprocesscommaitem -% \else\ifx\nexttoken]% -% \let\nextcommaitem\gobbleoneargument -% \else -% \let\nextcommaitem\dododoprocesscommaitem -% \fi\fi -% \nextcommaitem} -% -% faster ? - -\def\dodoprocesscommaitem - {\ifx\nexttoken\blankspace - \@EA\redoprocesscommaitem - \else\ifx\nexttoken]% - \@EAEAEA\gobbleoneargument - \else - \@EAEAEA\dododoprocesscommaitem - \fi\fi} - -\def\doprocesscommaitem - {\futurelet\nexttoken\dodoprocesscommaitem} - -%D Empty arguments are not processed. Empty items (\type{,,}) -%D however are treated. We have to check for the special case -%D \type{[{a,b,c}]}. -%D -%D \starttyping -%D \def\processcommalist[% -%D {\futurelet\nexttoken\docheckcommaitem} -%D -%D \def\docheckcommaitem% -%D {\ifx\nexttoken]% -%D \let\nextcommaitem\gobbletwoarguments -%D \else\ifx\nexttoken\bgroup -%D \let\nextcommaitem\doprocesscommalistA -%D \else -%D \let\nextcommaitem\doprocesscommalistB -%D \fi\fi -%D \nextcommaitem} -%D -%D \def\doprocesscommalistA#1#2]#3% -%D {\global\advance\commalevel 1 -%D \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,% -%D {#3{##1}\doprocesscommaitem}% -%D \doprocesscommaitem{#1}#2,]\relax -%D \global\advance\commalevel -1 } -%D -%D \def\doprocesscommalistB#1]#2% -%D {\global\advance\commalevel 1 -%D \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,% -%D {#2{##1}\doprocesscommaitem}% -%D \doprocesscommaitem#1,]\relax -%D \global\advance\commalevel -1 } -%D \stoptyping -%D -%D However, this is not a the most straightforward solution! -%D We can misuse one of \TEX's hidden features, and prepend -%D and remove a \type {\relax}. By the way, although it -%D involves less testing, this cleaner alternative is not -%D faster. - -\def\processcommalist[% - {\futurelet\nexttoken\docheckcommaitem} - -\def\docheckcommaitem - {\ifx\nexttoken]% - \expandafter\gobblethreearguments - \else - \expandafter\doprocesscommalist - \fi - \relax} % this one preserved the next {} - -\def\doprocesscommalist#1]#2% - {\global\advance\commalevel \plusone - \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,% - {#2{##1}\doprocesscommaitem}% - \@EA\dodoprocesscommaitem\gobbleoneargument#1,]\relax - \global\advance\commalevel \minusone } - -%D One way of quitting a commalist halfway is: - -\def\quitcommalist - {\begingroup\let\doprocesscommaitem\doquitcommalist} - -\def\doquitcommalist#1]% - {\endgroup} - -\def\quitprevcommalist - {\begingroup\let\doprocesscommaitem\doquitprevcommalist} - -\def\doquitprevcommalist#1]% - {\let\doprocesscommaitem\doquitcommalist} - -%D The hack we used for checking the next character -%D \type {\doifnextcharelse} is also used here. - -\def\:{\redoprocesscommaitem} - -\expandafter\def\: {\futurelet\nexttoken\dodoprocesscommaitem} - -%D The previous examples lead to: -%D -%D \getbuffer - -%D When a list is saved in a macro, we can use a construction -%D like: -%D -%D \starttyping -%D \expandafter\processcommalist\expandafter[\list]\command -%D \stoptyping -%D -%D Such solutions suit most situations, but we wanted a bit -%D more. -%D -%D \starttyping -%D \processcommacommand[string,\stringset,string]\commando -%D \stoptyping -%D -%D where \type{\stringset} is a predefined set, like: -%D -%D \starttyping -%D \def\first{aap,noot,mies} -%D \def\second{laatste} -%D -%D \processcommacommand[\first]\message -%D \processcommacommand[\first,second,third]\message -%D \processcommacommand[\first,between,\second]\message -%D \stoptyping -%D -%D Commands that are part of the list are expanded, so the -%D use of this macro has its limits. - -\def\processcommacommand[#1]% - {\expanded{\processcommalist[#1]}} - -%D The argument to \type{\command} is not delimited. Because -%D we often use \type{[]} as delimiters, we also have: -%D -%D \starttyping -%D \processcommalistwithparameters[string,string,...]\command -%D \stoptyping -%D -%D where \type{\command} looks like: -%D -%D \starttyping -%D \def\command[#1]{... #1 ...} -%D \stoptyping - -\def\processcommalistwithparameters[#1]#2% - {\def\docommand##1{#2[##1]}% - \processcommalist[#1]\docommand} - -%D \macros -%D {processaction, -%D processfirstactioninset, -%D processallactionsinset} -%D -%D \CONTEXT\ makes extensive use of a sort of case or switch -%D command. Depending of the presence of one or more provided -%D items, some actions is taken. These macros can be nested -%D without problems. -%D -%D \starttyping -%D \processaction [x] [a=>\a,b=>\b,c=>\c] -%D \processfirstactioninset [x,y,z] [a=>\a,b=>\b,c=>\c] -%D \processallactionsinset [x,y,z] [a=>\a,b=>\b,c=>\c] -%D \stoptyping -%D -%D We can supply both a \type{default} action and an action -%D to be undertaken when an \type{unknown} value is met: -%D -%D \starttyping -%D \processallactionsinset -%D [x,y,z] -%D [ a=>\a, -%D b=>\b, -%D c=>\c, -%D default=>\default, -%D unknown=>\unknown{... \commalistelement ...}] -%D \stoptyping -%D -%D When \type{#1} is empty, this macro scans list \type{#2} for -%D the keyword \type{default} and executed the related action -%D if present. When \type{#1} is non empty and not in the list, -%D the action related to \type{unknown} is executed. Both -%D keywords must be at the end of list \type{#2}. Afterwards, -%D the actually found keyword is available in -%D \type{\commalistelement}. An advanced example of the use of -%D this macro can be found in \PPCHTEX, where we completely -%D rely on \TEX\ for interpreting user supplied keywords like -%D \type{SB}, \type{SB1..6}, \type{SB125} etc. -%D -%D Even a quick glance at the macros below show some overlap, -%D which means that more efficient alternatives are possible. -%D Because these macro's are very sensitive to subtle changes, -%D we've decided to present the readable originals first -%D Maybe these these macros look complicated, but this is a -%D direct result of the support of nesting. Protection is only -%D applied in \type{\processaction}. -%D -%D \starttyping -%D \newcount\processlevel -%D -%D \def\processaction[#1]#2[#3]% -%D {\doifelse{#1}{} -%D {\def\p!compareprocessaction[##1=>##2]% -%D {\edef\!!stringa{##1}% -%D \ifx\!!stringa\s!default -%D \def\commalistelement{#1}% -%D ##2% -%D \fi}} -%D {\let\donottest=\dontprocesstest -%D \edef\!!stringb{#1}% -%D \let\donottest=\doprocesstest -%D \def\p!compareprocessaction[##1=>##2]% -%D {\edef\!!stringa{##1}% -%D \ifx\!!stringa\!!stringb -%D \def\commalistelement{#1}% -%D ##2% -%D \let\p!doprocessaction=\gobbleoneargument -%D \else\ifx\!!stringa\s!unknown -%D \def\commalistelement{#1}% -%D ##2% -%D \fi\fi}}% -%D \def\p!doprocessaction##1% -%D {\p!compareprocessaction[##1]}% -%D \processcommalist[#3]\p!doprocessaction} -%D -%D \def\processfirstactioninset[#1]#2[#3]% -%D {\doifelse{#1}{} -%D {\processaction[][#3]} -%D {\def\p!compareprocessaction[##1=>##2][##3]% -%D {\edef\!!stringa{##1}% -%D \edef\!!stringb{##3}% -%D \ifx\!!stringa\!!stringb -%D \def\commalistelement{##3}% -%D ##2% -%D \let\p!doprocessaction=\gobbleoneargument -%D \let\p!dodoprocessaction=\gobbleoneargument -%D \else\ifx\!!stringa\s!unknown -%D \def\commalistelement{##3}% -%D ##2% -%D \fi\fi}% -%D \def\p!doprocessaction##1% -%D {\def\p!dodoprocessaction####1% -%D {\p!compareprocessaction[####1][##1]}% -%D \processcommalist[#3]\p!dodoprocessaction}% -%D \processcommalist[#1]\p!doprocessaction}} -%D -%D \def\processallactionsinset[#1]#2[#3]% -%D {\doifelse{#1}{} -%D {\processaction[][#3]} -%D {\advance\processlevel by 1 -%D \def\p!compareprocessaction[##1=>##2][##3]% -%D {\edef\!!stringa{##1}% -%D \edef\!!stringb{##3}% -%D \ifx\!!stringa\!!stringb -%D \def\commalistelement{##3}% -%D ##2% -%D \let\p!dodoprocessaction=\gobbleoneargument -%D \else\ifx\!!stringa\s!unknown -%D \def\commalistelement{##3}% -%D ##2% -%D \fi\fi}% -%D \setvalue{\s!do\the\processlevel}##1% -%D {\def\p!dodoprocessaction####1% -%D {\p!compareprocessaction[####1][##1]}% -%D \processcommalist[#3]\p!dodoprocessaction}% -%D \processcommalist[#1]{\getvalue{\s!do\the\processlevel}}% -%D \advance\processlevel by -1 }} -%D \stoptyping -%D -%D The gain of speed in the (again) next implementation is -%D around 20\%, depending on the application. - -\newcount\processlevel - -\def\p!compareprocessactionA[#1=>#2][#3]% - {\edef\!!stringb{#1}% - \ifx\!!stringb\s!default - \let\commalistelement\empty - #2% - \fi} - -% \def\p!compareprocessactionB[#1=>#2][#3]% -% {\expandedaction\!!stringb{#1}% -% \ifx\!!stringa\!!stringb -% \def\commalistelement{#3}% -% #2% -% \let\p!doprocessaction\gobbleoneargument -% \else -% \edef\!!stringb{#1}% -% \ifx\!!stringb\s!unknown -% \def\commalistelement{#3}% beware of loops -% #2% -% \fi -% \fi} - -% met \quitcommalist tot meer dan 25\% sneller - -\def\p!compareprocessactionB[#1=>#2][#3]% - {\expandedaction\!!stringb{#1}% - \ifx\!!stringa\!!stringb - \def\commalistelement{#3}% - #2% - \expandafter\quitcommalist - \else - \edef\!!stringb{#1}% - \ifx\!!stringb\s!unknown - \def\commalistelement{#3}% beware of loops - #2% - \fi - \fi} - -\beginTEX - -\def\processaction[#1]#2[#3]% - {\let\donottest\dontprocesstest - \expandedaction\!!stringa{#1}% - \let\donottest\doprocesstest - \ifx\!!stringa\empty - \let\p!compareprocessaction\p!compareprocessactionA - \else - \let\p!compareprocessaction\p!compareprocessactionB - \fi - \def\p!doprocessaction##1% - {\p!compareprocessaction[##1][#1]}% - \processcommalist[#3]\p!doprocessaction - \expandactions} - -\endTEX - -\beginETEX \protected - -\def\processaction[#1]#2[#3]% faster version follows - {\expandedaction\!!stringa{#1}% - \ifx\!!stringa\empty - \let\p!compareprocessaction\p!compareprocessactionA - \else - \let\p!compareprocessaction\p!compareprocessactionB - \fi - \def\p!doprocessaction##1% - {\p!compareprocessaction[##1][#1]}% - \processcommalist[#3]\p!doprocessaction - \expandactions} - -\endETEX - -% \def\p!compareprocessactionC[#1=>#2][#3]% -% {\expandedaction\!!stringa{#1}% -% \expandedaction\!!stringb{#3}% -% \ifx\!!stringa\!!stringb -% \def\commalistelement{#3}% -% #2% -% \let\p!doprocessaction\gobbleoneargument -% \let\p!dodoprocessaction\gobbleoneargument -% \else -% \edef\!!stringa{#1}% -% \ifx\!!stringa\s!unknown -% \def\commalistelement{#3}% -% #2% -% \fi -% \fi} - -\def\p!compareprocessactionC[#1=>#2][#3]% - {\expandedaction\!!stringa{#1}% - \expandedaction\!!stringb{#3}% - \ifx\!!stringa\!!stringb - \def\commalistelement{#3}% - #2% - \expandafter\quitprevcommalist - \else - \edef\!!stringa{#1}% - \ifx\!!stringa\s!unknown - \def\commalistelement{#3}% - #2% - \fi - \fi} - -\def\processfirstactioninset[#1]#2[#3]% faster version follows - {\expandedaction\!!stringa{#1}% - \ifx\!!stringa\empty - \processaction[][#3]% - \else - \def\p!doprocessaction##1% - {\def\p!dodoprocessaction####1% - {\p!compareprocessactionC[####1][##1]}% - \processcommalist[#3]\p!dodoprocessaction}% - \processcommalist[#1]\p!doprocessaction - \fi - \expandactions} - -% \def\p!compareprocessactionD[#1=>#2][#3]% -% {\expandedaction\!!stringa{#1}% -% \expandedaction\!!stringb{#3}% -% \ifx\!!stringa\!!stringb -% \def\commalistelement{#3}% -% #2% -% \let\p!dodoprocessaction\gobbleoneargument -% \else -% \edef\!!stringa{#1}% -% \ifx\!!stringa\s!unknown -% \def\commalistelement{#3}% -% #2% -% \fi -% \fi} - -\def\p!compareprocessactionD[#1=>#2][#3]% - {\expandedaction\!!stringa{#1}% - \expandedaction\!!stringb{#3}% - \ifx\!!stringa\!!stringb - \def\commalistelement{#3}% - #2% - \expandafter\quitcommalist - \else - \edef\!!stringa{#1}% - \ifx\!!stringa\s!unknown - \def\commalistelement{#3}% - #2% - \fi - \fi} - -\def\doprocessallactionsinset - {\csname\s!do\the\processlevel\endcsname} - -\def\processallactionsinset[#1]#2[#3]% faster version follows - {\expandedaction\!!stringa{#1}% - \ifx\!!stringa\empty - \processaction[][#3]% - \else - \advance\processlevel \plusone - \expandafter\def\csname\s!do\the\processlevel\endcsname##1% - {\def\p!dodoprocessaction####1% - {\p!compareprocessactionD[####1][##1]}% - \processcommalist[#3]\p!dodoprocessaction}% - \processcommalist[#1]\doprocessallactionsinset - \advance\processlevel \minusone - \fi - \expandactions} - -%D We can speed up these macros a bit when we use a dedicated -%D commalist processor, one that avoids passing the (often) -%D big action list. - -\beginTEX - -\def\processaction[#1]#2[% - {\let\donottest\dontprocesstest - \expandedaction\!!stringa{#1}% - \let\donottest\doprocesstest - \ifx\!!stringa\empty - \let\p!compareprocessaction\p!compareprocessactionA - \else - \let\p!compareprocessaction\p!compareprocessactionB - \fi - \def\p!doprocessaction##1% - {\p!compareprocessaction[##1][#1]}% - \processnextcommalist\relax\expandactions\p!doprocessaction[} - -\endTEX - -\beginETEX - -\def\processaction[#1]#2[% - {\expandedaction\!!stringa{#1}% - \ifx\!!stringa\empty - \let\p!compareprocessaction\p!compareprocessactionA - \else - \let\p!compareprocessaction\p!compareprocessactionB - \fi - \def\p!doprocessaction##1% - {\p!compareprocessaction[##1][#1]}% - \processnextcommalist\relax\expandactions\p!doprocessaction[} - -\endETEX - -\def\processfirstactionsinset[#1]% - {\expandedaction\!!stringa{#1}% - \ifx\!!stringa\empty - \expandafter\processaction - \else - \expandafter\processfirstactionsinsetindeed - \fi - [#1]} - -\def\processfirstactioninsetindeed[#1]#2[#3]% - {\def\p!doprocessaction##1% - {\def\p!dodoprocessaction####1% - {\p!compareprocessactionC[####1][##1]}% - \processcommalist[#3]\p!dodoprocessaction}% - \processcommalist[#1]\p!doprocessaction - \expandactions} - -\def\processallactionsinset[#1]% - {\expandedaction\!!stringa{#1}% - \ifx\!!stringa\empty - \expandafter\processaction - \else - \expandafter\processallactionsinsetindeed - \fi - [#1]} - -\def\processallactionsinsetindeed[#1]#2[#3]% - {\advance\processlevel \plusone - \expandafter\def\csname\s!do\the\processlevel\endcsname##1% - {\def\p!dodoprocessaction####1% - {\p!compareprocessactionD[####1][##1]}% - \processcommalist[#3]\p!dodoprocessaction}% - \processcommalist[#1]\doprocessallactionsinset - \advance\processlevel \minusone - \expandactions} - -\def\processnextcommalist#1#2#3[#4#5]% - {#1% - \let\nexttoken#4% - \global\advance\commalevel \plusone - \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,% - {#3{##1}\doprocesscommaitem}% - \dodoprocesscommaitem#4#5,]\relax - \global\advance\commalevel \minusone - #2} - -%D I do have an even faster version (saving 3 sec on a 13 -%D sec run for 50K invocations, but normally we don't have -%D that many calls and that alternative uses more macros and is -%D even less readable. What we did add, was \type {\@EA}, so -%D that we can pass a command. - -%D \macros -%D {unexpandedprocessaction, -%D unexpandedprocessfirstactioninset, -%D unexpandedprocessallactionsinset} -%D -%D Now what are those expansion commands doing there. Well, -%D sometimes we want to compare actions that may consist off -%D commands (i.e. are no constants). In such occasions we can -%D use the a bit slower alternatives: - -\def\unexpandedprocessfirstactioninset{\dontexpandactions\processfirstactioninset} -\def\unexpandedprocessaction {\dontexpandactions\processaction} -\def\unexpandedprocessallactionsinset {\dontexpandactions\processallactionsinset} - -%D By default we expand actions: - -\def\expandactions{\let\expandedaction\edef} \expandactions - -%D But when needed we convert the strings to meaningful -%D sequences of characters. - -\def\unexpandedaction#1>{} - -\def\noexpandedaction#1#2% - {\def\@@convertedargument{#2}% - \@EA\edef\@EA#1\@EA{\@EA\unexpandedaction\meaning\@@convertedargument}} - -\def\dontexpandactions% - {\let\expandedaction\noexpandedaction} - -%D \macros -%D {getfirstcharacter, firstcharacter, remainingcharacters, doiffirstcharacter} -%D -%D Sometimes the action to be undertaken depends on the -%D next character. This macro get this character and puts it in -%D \type{\firstcharacter}. -%D -%D \starttyping -%D \getfirstcharacter {string} -%D \stoptyping -%D -%D A two step expansion is used to prevent problems with -%D complicated arguments, for instance arguments that -%D consist of two or more expandable tokens. - -\def\dogetfirstcharacter#1#2\relax - {\def\firstcharacter{#1}% - \def\remainingcharacters{#2}} - -\def\getfirstcharacter#1% - {\edef\!!stringa{#1}% - \expandafter\dogetfirstcharacter\!!stringa\relax} - -\def\doiffirstcharelse#1#2% char string -% kort (maar onleesbaar) -% {\expanded{\dogetfirstcharacter#2}\\\doifelse{#1}\firstcharacter} -% korter (en begrijpelijk)) - {\getfirstcharacter{#2}\doifelse{#1}\firstcharacter} -% snel (maar zelden gebruikt, dus niet zo belangrijk) -% {\getfirstcharacter{#2}% -% \edef\!!stringa{#1}% -% \ifx\!!stringa\firstcharacter -% \expandafter\firstoftwoarguments -% \else -% \expandafter\secondoftwoarguments -% \fi} - -%D \macros -%D {doifinstringelse, doifincsnameelse} -%D -%D We can check for the presence of a substring in a given -%D sequence of characters. -%D -%D \starttyping -%D \doifinsetelse {substring} {string} {then ...} {else ...} -%D \stoptyping -%D -%D An application of this command can be found further on. -%D Like before, we first show some alternatives, like the one -%D we started with: -%D -%D \starttyping -%D \long\def\p!doifinstringelse#1#2#3#4% -%D {\def\pp!doifinstringelse##1#1##2##3\war% -%D {\if##2@% -%D #4% -%D \else -%D #3% -%D \fi}% -%D \pp!doifinstringelse#2#1@@\war} -%D -%D \def\doifinstringelse% -%D {\ExpandBothAfter\p!doifinstringelse} -%D \stoptyping -%D -%D After this we came to: -%D -%D \starttyping -%D \def\p!doifinstringelse#1#2% -%D {\def\pp!doifinstringelse##1#1##2##3\war% -%D {\if##2@}% -%D \pp!doifinstringelse#2#1@@\war} -%D -%D \def\doifinstringelse#1#2#3#4% -%D {\ExpandBothAfter\p!doifinstringelse{#1}{#2}% -%D #4% -%D \else -%D #3% -%D \fi} -%D \stoptyping -%D -%D Sometimes the second argument is passed as a macro. By -%D postponing the expansion of this macro, we gain quite some -%D run time, simply because the less tokens we pass, the faster -%D \TEX\ runs. So finally the definition became: - -% \long\def\rawdoifinstringelse#1#2% ##2 can be {abc} -% {\long\def\pp!doifinstringelse##1#1##2##3\war{\if##2@}% -% \pp!doifinstringelse#2#1@@\war -% \expandafter\secondoftwoarguments -% \else -% \expandafter\firstoftwoarguments -% \fi} - -\long\def\doifinstringelse#1% - {\edef\@@@instring{#1}% expand #1 here - \ifx\@@@instring\empty - \@EA\thirdofthreearguments - \else - \@EA\dodoifinstringelse - \fi} - -\long\def\dodoifinstringelse#1% - {\p!doifinstringelse\@@@instring{#1}% - \@EA\firstoftwoarguments - \else - \@EA\secondoftwoarguments - \fi} - -\long\def\doifinstring#1%% - {\edef\@@@instring{#1}% expand #1 here - \ifx\@@@instring\empty - \@EA\gobbletwoarguments - \else - \@EA\dodoifinstring - \fi} - -\long\def\dodoifinstring#1% - {\p!doifinstringelse\@@@instring{#1}% - \@EA\firstofoneargument - \else - \@EA\gobbleoneargument - \fi} - -\long\def\doifnotinstring#1%% - {\edef\@@@instring{#1}% expand #1 here - \ifx\@@@instring\empty - \@EA\gobbletwoarguments - \else - \@EA\dodoifnotinstring - \fi} - -\long\def\dodoifnotinstring#1% - {\p!doifinstringelse\@@@instring{#1}% - \@EA\gobbleoneargument - \else - \@EA\firstofoneargument - \fi} - -%D \starttyping -%D \beginTEX -%D -%D \long\def\p!doifinstringelse#1#2% -%D {\long\def\pp!doifinstringelse##1#1##2##3\war% -%D {\csname if\if##2@fals\else tru\fi e\endcsname}% -%D \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here -%D -%D \endTEX -%D -%D \beginETEX \unless -%D -%D \long\def\p!doifinstringelse#1#2% -%D {\long\def\pp!doifinstringelse##1#1##2##3\war% -%D {\unless\if##2@}% -%D \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here -%D -%D \endETEX -%D \stoptyping -%D -%D And then \unknown\ after a couple of years, we ran into a -%D situation where \type {##2} was something \type {{bla}}. So -%D finally we need to use an auxiliary macro, otherwise we get -%D funny strings in the output. - -% \long\def\p!doifinstringelse#1#2% ##2 can be {abc} -% {\long\@EA\def\@EA\pp!doifinstringelse\@EA##\@EA1#1##2##3\war % expand #1 here -% {\ppp!doifinstringelse##2\war}% -% \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here -% -% \beginTEX -% -% \def\ppp!doifinstringelse#1#2\war% -% {\csname if\ifx#1@fals\else tru\fi e\endcsname}% -% -% \endTEX -% -% \beginETEX \unless -% -% \def\ppp!doifinstringelse#1#2\war% -% {\unless\ifx#1@} -% -% \endETEX - -\beginETEX - -\long\def\p!doifinstringelse#1#2% ##2 can be {abc} - {\long\@EA\def\@EA\pp!doifinstringelse\@EA##\@EA1#1##2##3\war % expand #1 here - {\unless\if##2@}% -% \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here - \expanded{\pp!doifinstringelse#2#1}@@\war} % expand #2 here - -\endETEX - -\beginTEX - -\long\def\p!doifinstringelse#1#2% ##2 can be {abc} - {\long\@EA\def\@EA\pp!doifinstringelse\@EA##\@EA1#1##2##3\war % expand #1 here - {\csname if\if##2@fals\else tru\fi e\endcsname}% - %\expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here - \expanded{\pp!doifinstringelse#2#1}@@\war} % expand #2 here - -\endTEX - -%D The next alternative proved to be upto twice as fast on -%D tasks like checking reserved words in pretty verbatim -%D typesetting! This is mainly due to the fact that passing -%D (expanded) strings is much slower that passing a macro. -%D -%D \starttyping -%D \doifincsnameelse {substring} {\string} {then ...} {else ...} -%D \stoptyping -%D -%D Where \type{\doifinstringelse} does as much expansion as -%D possible, the latter alternative does minimal (one level) -%D expansion. - -\beginTEX - -\long\def\p!doifincsnameelse#1#2% - {\long\def\pp!doifincsnameelse##1#1##2##3\war - {\csname if\if##2@fals\else tru\fi e\endcsname}% - \@EA\pp!doifincsnameelse#2#1@@\war} - -\endTEX - -\beginETEX \unless - -\long\def\p!doifincsnameelse#1#2% - {\long\def\pp!doifincsnameelse##1#1##2##3\war - {\unless\if##2@}% - \@EA\pp!doifincsnameelse#2#1@@\war} - -\endETEX - -\long\def\doifincsnameelse#1#2% % #3#4% - {\edef\@@@instring{#1}% - \@EA\p!doifincsnameelse\@EA{\@@@instring}{#2}% % #3\else#4\fi} - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -%D \macros -%D {doifnumberelse} -%D -%D The next macro executes a command depending of the outcome -%D of a test on numerals. This is probably one of the fastest -%D test possible, exept from a less robust 10||step -%D \type{\if}||ladder or some tricky \type{\lcode} checking. -%D -%D \starttyping -%D \doifnumberelse {string} {then ...} {else ...} -%D \stoptyping -%D -%D The macro accepts \type{123}, \type{abc}, \type{{}}, -%D \type{\getal} and \type{\the\count...}. This macro is a -%D rather dirty one. -%D -%D \starttyping -%D \long\def\doifnumberelse#1#2#3% -%D {\begingroup\donefalse -%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\donetrue\fi -%D \ifdone\endgroup#2\else\endgroup#3\fi} -%D \stoptyping -%D -%D Or better: -%D -%D \starttyping -%D \long\def\doifnumberelse#1% -%D {\begingroup\donefalse -%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\donetrue\fi -%D \ifdone -%D \endgroup\expandafter\firstoftwoarguments -%D \else -%D \endgroup\expandafter\secondoftwoarguments -%D \fi} -%D \stoptyping -%D -%D A previous implementation was: -%D -%D \starttyping -%D \long\def\doifnumberelse#1#2#3% -%D {\getfirstcharacter{#1}% -%D \@EA\p!doifinstringelse\@EA{\firstcharacter}{1234567890}% -%D #2% -%D \else -%D #3% -%D \fi} -%D \stoptyping -%D -%D And before we had \type{\p!doifinstringelse} available, we -%D used: -%D -%D \starttyping -%D \def\doifnumberelse#1% -%D {\getfirstcharacter{#1}% -%D \rawdoifinsetelse{\firstcharacter}{1,2,3,4,5,6,7,8,9,0}} -%D \stoptyping -%D -%D The implementation using \type {\ifcase} is much faster, but -%D the next one is not, not even when testing milion calls. -%D -%D \starttyping -%D \newif\ifitsanumber -%D -%D \long\def\isitanumber#1% -%D {\itsanumberfalse -%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\itsanumbertrue\fi} -%D -%D \long\def\doifnumberelse#1#2#3% -%D {\isitanumber{#1}\ifitsanumber#2\else#3\fi} -%D \stoptyping -%D -%D After a while the next evolved and this one is the one we -%D will use. This one is some 5\% faster than the group/done -%D one (partly because it does not have to pass arguments). -%D Even more important is that this alternative is fully -%D expandable! - -\long\def\doifnumberelse#1% does not accept counters - {\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} - -%D \macros -%D {makerawcommalist, -%D rawdoinsetelse, -%D rawprocesscommalist, -%D rawprocessaction} -%D -%D Some of the commands mentioned earlier are effective but -%D slow. When one is desperately in need of faster alternatives -%D and when the conditions are predictable safe, the \type{\raw} -%D alternatives come into focus. A major drawback is that -%D they do not take \type{\c!constants} into account, simply -%D because no expansion is done. This is no problem with -%D \type{\rawprocesscommalist}, because this macro does not -%D compare anything. Expandable macros are permitted as search -%D string. -%D -%D \starttyping -%D \makerawcommalist[string,string,...]\stringlist -%D \rawdoifinsetelse{string}{string,...}{...}{...} -%D \rawprocesscommalist[string,string,...]\commando -%D \rawprocessaction[x][a=>\a,b=>\b,c=>\c] -%D \stoptyping -%D -%D Spaces embedded in the list, for instance after commas, -%D spoil the search process. The gain in speed depends on the -%D length of the argument (the longer the argument, the less -%D we gain). -%D -%D The slow alternative looks like: -%D -%D \starttyping -%D \def\makerawcommalist[#1]#2% -%D {\def\appendtocommalist##1% -%D {\doifelse{#2}{} -%D {\edef#2{##1}} -%D {\edef#2{#2,##1}}}% -%D \def#2{}% -%D \processcommalist[#1]\appendtocommalist} -%D \stoptyping -%D -%D But we prefer: - -% \appendtocommalist is defined in syst-ext - -\def\makerawcommalist[#1]#2% use \processnext ... here - {\def\domakerawcommalist##1% we don't expand ##1 - {\ifx#2\empty - \def#2{##1}% - \else - \@EA\def\@EA#2\@EA{#2,##1}% - \fi}% - \let#2\empty - \processcommalist[#1]\domakerawcommalist} - -\def\rawprocesscommaitem#1,#2% #2 eats up preceding space - {\if]#1\else - \csname\s!next\the\commalevel\endcsname{#1}% - \expandafter\rawprocesscommaitem - \fi#2} - -\def\rawprocesscommalist[#1]#2% accepteert ook [\cs] - {\global\advance\commalevel \plusone - \expandafter\let\csname\s!next\the\commalevel\endcsname#2% - \expandafter\rawprocesscommaitem#1,],% \relax - \global\advance\commalevel \minusone } - -\def\rawprocesscommacommand[#1]% not really needed - {\expanded{\rawprocesscommalist[#1]}} - -% \def\rawdoifinsetelse#1#2{\doifinstringelse{,#1,}{,#2,}} -% \def\rawdoifinset #1#2{\doifinstring {,#1,}{,#2,}} - -\def\@@rawempty{,,} - -\long\def\rawdoifinsetelse#1% - {\edef\@@@instring{,#1,}% expand #1 here - \ifx\@@@instring\@@rawempty - \@EA\thirdofthreearguments - \else - \@EA\rawdodoifinsetelse - \fi} - -\long\def\rawdodoifinsetelse#1% - {\p!doifinstringelse\@@@instring{,#1,}% - \@EA\firstoftwoarguments - \else - \@EA\secondoftwoarguments - \fi} - -\long\def\rawdoifinset#1% - {\edef\@@@instring{,#1,}% expand #1 here - \ifx\@@@instring\@@rawempty - \@EA\gobbletwoarguments - \else - \@EA\rawdodoifinset - \fi} - -\long\def\rawdodoifinset#1%% - {\p!doifinstringelse\@@@instring{,#1,}% - \@EA\firstofoneargument - \else - \@EA\gobbleoneargument - \fi} - -%D Some more raw material: - -\def\p!rawprocessaction[#1][#2]% - {\def\pp!rawprocessaction##1,#1=>##2,##3\war% - {\if##3@\else - \def\!!processaction{##2}% - \fi}% - \pp!rawprocessaction,#2,#1=>,@\war} - -\def\rawprocessaction[#1]#2[#3]% - {\edef\!!stringa{#1}% - \edef\!!stringb{undefined}% better \!!undefined - \let\!!processaction\!!stringb - \ifx\!!stringa\empty - \@EA\p!rawprocessaction\@EA[\s!default][#3]% - \else - \expandafter\p!rawprocessaction\expandafter[\!!stringa][#3]% - \ifx\!!processaction\!!stringb - \@EA\p!rawprocessaction\@EA[\s!unknown][#3]% - \fi - \fi - \ifx\!!processaction\!!stringb - \else - \!!processaction - \fi} - -% not needed -% -% \def\rawprocessallactionsinset[#1]#2[#3]% -% {\def\docommand##1% -% {\rawprocessaction[##1][#3]}% -% \processcommalist[#1]\docommand} - -%D When we process the list \type{a,b,c,d,e}, the raw routine -%D takes over 30\% less time, when we feed $20+$ character -%D strings we gain about 20\%. Alternatives which use -%D \type{\futurelet} perform worse. Part of the speedup is -%D due to the \type{\let} and \type{\expandafter} in the test. - -% %D \macros -% %D {processunexpandedcommalist} -% %D -% %D When processing commalists, the arguments are expanded. The -% %D main reason for doing so lays in the fact that these -% %D macros are used for interfacing. The next alternative can be used -% %D for -% %D -% %D \starttyping -% %D \processunexpandedcommalist -% %D [\alfa\beta,\gamma,\delta\epsilon] -% %D \handleitem -% %D \stoptyping -% %D -% %D This time nesting is not supported. -% -% %\def\processunexpandedcommaitem#1,% -% % {\if]\noexpand#1% -% % \let\nextcommaitem\relax -% % \else -% % \handleunexpandedcommaitem{#1}% -% % \let\nextcommaitem\processunexpandedcommaitem -% \fi -% \nextcommaitem} -% -% faster: -% -% \def\processunexpandedcommaitem#1,% -% {\if]\noexpand#1\else -% \handleunexpandedcommaitem{#1}% -% \expandafter\processunexpandedcommaitem -% \fi} -% -% \def\processunexpandedcommalist[#1]#2% -% {\def\handleunexpandedcommaitem{#2}% -% \processunexpandedcommaitem#1,],}% \relax} -% -% %D Or faster: -% -% \def\processunexpandedcommaitem#1,% -% {\if]\noexpand#1\else -% \handleunexpandedcommaitem{#1}% -% \expandafter\processunexpandedcommaitem -% \fi} - -%D \macros -%D {dosetvalue,dosetevalue,dosetgvalue,docopyvalue,doresetvalue, -%D dogetvalue} -%D -%D When we are going to do assignments, we have to take -%D multi||linguality into account. For the moment we keep -%D things simple and single||lingual. -%D -%D \starttyping -%D \dosetvalue {label} {variable} {value} -%D \dosetevalue {label} {variable} {value} -%D \dosetgvalue {label} {variable} {value} -%D \docopyvalue {to label} {from label} {variable} -%D \doresetvalue {label} {variable} -%D \stoptyping -%D -%D These macros are in fact auxiliary ones and are not meant -%D for use outside the assignment macros. - -\def\dosetvalue#1#2% #3 - {\@EA\def\csname#1#2\endcsname} % {#3}} - -\def\dosetevalue#1#2% #3 - {\@EA\edef\csname#1#2\endcsname} % {#3}} - -\def\dosetgvalue#1#2% #3 - {\@EA\gdef\csname#1#2\endcsname} % {#3}} - -\def\doresetvalue#1#2% - {\@EA\let\csname#1#2\endcsname\empty} - -\def\doignorevalue#1#2#3% - {\@EA\let\csname#1#2\endcsname\empty} - -\def\docopyvalue#1#2#3% - {\@EA\def\csname#1#3\endcsname{\csname#2#3\endcsname}} - -%D \macros -%D {doassign,undoassign,doassignempty} -%D -%D Assignments are the backbone of \CONTEXT. Abhorred by the -%D concept of style file hacking, we took a considerable effort -%D in building a parameterized system. Unfortunately there is a -%D price to pay in terms of speed. Compared to other packages -%D and taking the functionality of \CONTEXT\ into account, the -%D total size of the format file is still very acceptable. Now -%D how are these assignments done. -%D -%D Assignments can be realized with: -%D -%D \starttyping -%D \doassign[label][variable=value] -%D \undoassign[label][variable=value] -%D \stoptyping -%D -%D and: -%D -%D \starttyping -%D \doassignempty[label][variable=value] -%D \stoptyping -%D -%D Assignments like \type{\doassign} are compatible with: -%D -%D \starttyping -%D \def\labelvariable{value} -%D \stoptyping -%D -%D We do check for the presence of an \type{=} and loudly -%D complain of it's missed. We will redefine this macro later -%D on, when a more advanced message mechanism is implemented. - -\newif\iferrorisfatal - -\def\waitonfatalerror - {\iferrorisfatal\wait\fi} - -\def\showassignerror#1#2% - {\writestatus{setup}{missing or ungrouped '=' after '#1' in line #2}% - \waitonfatalerror} - -%\def\p!doassign#1[#2][#3=#4=#5]% -% {\let\donottest\dontprocesstest -% \edef\!!stringa{#5}% -% \let\!!stringb\relax -% \let\donottest\doprocesstest -% \ifx\!!stringa\!!stringb -% \showassignerror{#3}% -% \else -% #1{#2}{#3}{#4}% -% \fi} - -\def\p!doassign#1[#2][#3=#4=#5]% - {\ifx\empty#3\else % and definitely not \ifx#3\empty - \ifx\relax#5% - \showassignerror{#3}{\the\inputlineno\space(#2)}% - \else - #1{#2}{#3}{#4}% - \fi - \fi} - -\def\doassign [#1][#2]{\p!doassign\dosetvalue [#1][#2==\relax]} -\def\doeassign [#1][#2]{\p!doassign\dosetevalue [#1][#2==\relax]} -\def\undoassign[#1][#2]{\p!doassign\doresetvalue[#1][#2==\relax]} - -\def\doassignempty[#1][#2=#3]% - {\ifundefined{#1#2}\dosetvalue{#1}{#2}{#3}\fi} - -%D \macros -%D {getparameters,geteparameters,getgparameters, -%D forgetparameters} -%D -%D Using the assignment commands directly is not our -%D ideal of user friendly interfacing, so we take some further -%D steps. -%D -%D \starttyping -%D \getparameters [label] [...=...,...=...] -% %D \forgetparameters [label] [...=...,...=...] -%D \stoptyping -%D -%D Again, the label identifies the category a variable -%D belongs to. The second argument can be a comma separated -%D list of assignments. -%D -%D \starttyping -%D \getparameters -%D [demo] -%D [alfa=1, -%D beta=2] -%D \stoptyping -%D -%D is equivalent to -%D -%D \starttyping -%D \def\demoalfa{1} -%D \def\demobeta{2} -%D \stoptyping -%D -%D -%D In the pre||multi||lingual stadium \CONTEXT\ took the next -%D approach. With -%D -%D \starttyping -%D \def\??demo {@@demo} -%D \def\!!alfa {alfa} -%D \def\!!beta {beta} -%D \stoptyping -%D -%D calling -%D -%D \starttyping -%D \getparameters -%D [\??demo] -%D [\!!alfa=1, -%D \!!beta=2] -%D \stoptyping -%D -%D lead to: -%D -%D \starttyping -%D \def\@@demoalfa{1} -%D \def\@@demobeta{2} -%D \stoptyping -%D -%D Because we want to be able to distinguish the \type{!!} -%D pre||tagged user supplied variables from internal -%D counterparts, we will introduce a slightly different tag in -%D the multi||lingual modules. There we will use \type{c!} or -%D \type{v!}, depending on the context. -%D -%D By calling \type{\p!doassign} directly, we save ourselves -%D some argument passing and gain some speed. Whatever -%D optimizations we do, this command will always be one of the -%D bigger bottlenecks. -%D -%D The alternative \type{\geteparameters} --- it's funny to -%D see that this alternative saw the light so lately --- can be -%D used to do expanded assigments. - -\def\dogetparameters#1[#2]#3[#4]% - {\def\p!dogetparameter##1% - {\p!doassign#1[#2][##1==\relax]}% - \processcommalist[#4]\p!dogetparameter} - -\def\getparameters {\dogetparameters\dosetvalue} -\def\geteparameters {\dogetparameters\dosetevalue} -\def\getgparameters {\dogetparameters\dosetgvalue} -\def\forgetparameters{\dogetparameters\doignorevalue} - -\let\getexpandedparameters=\geteparameters - -%D This one is slightly faster: - -\def\dogetparameters#1[#2]#3[#4% - {\if\noexpand#4]% - \expandafter\gobbleoneargument - \else - \def\p!dogetparameter##1{\p!doassign#1[#2][##1==\relax]}% - \expandafter\xdogetparameters - \fi#4} - -\def\xdogetparameters#1]% - {\processcommalist[#1]\p!dogetparameter} - -%D The next alternative is much faster but also uglier. Because -%D in \XML\ processing we will probably set much more parameters -%D than normally we need this faster one. - -\def\dogetparameters#1[#2]#3[#4% - {\if\noexpand#4]% - \expandafter\gobbleoneargument - \else - \def\p!dogetparameter{\p!doassign#1#2}% - \expandafter\xdogetparameters - \fi#4} - -\def\xdogetparameters#1]% - {\xprocesscommaitem#1,],\@relax@} - -% \long\def\xprocesscommaitem#1,#2% #2 takes space before , -% {\if]#1% -% \expandafter\gobbleoneargument -% \else -% \p!dogetparameter\@relax@#1==\@relax@ -% \expandafter\xprocesscommaitem -% \fi#2} - -\long\def\xprocesscommaitem#1,#2% #2 takes space before , - {\if,#1,% dirty trick for testing #1=empty - \@EA\xprocesscommaitem - \else\if]#1% - \@EAEAEA\gobbleoneargument - \else - \p!dogetparameter\@relax@#1==\empty\@relax@ - \@EAEAEA\xprocesscommaitem - \fi\fi#2} - -%D Here we use a slightly different assignment macro: - -% \def\p!doassign#1#2\@relax@#3=#4=#5\@relax@ -% {\ifx\@relax@#5\@EA\xshowassignerror\else\@EA#1\fi{#2}{#3}{#4}} - -% \def\p!doassign#1#2\@relax@#3=#4=#5\@relax@ -% {\ifx#5\empty\@EA\xshowassignerror\else\@EA#1\fi{#2}{#3}{#4}} - -\def\p!doassign#1#2\@relax@#3=#4=#5#6\@relax@ - {\ifx#5\empty - \@EA\xshowassignerror - \else\ifx#5=% - \@EAEAEA#1% - \else - \@EAEAEA\xshowassignerror - \fi\fi - {#2}{#3}{#4}} - -\def\xshowassignerror#1#2#3% - {\showassignerror{#2}{\the\inputlineno\space(#1)}} - -%D Now we also have to change the other macros that depend -%D on this low level one. - -% \def\doassign [#1][#2]{\p!doassign\dosetvalue #1\@relax@#2==\@relax@} -% \def\doeassign [#1][#2]{\p!doassign\dosetevalue #1\@relax@#2==\@relax@} -% \def\undoassign[#1][#2]{\p!doassign\doresetvalue#1\@relax@#2==\@relax@} - -\def\doassign [#1][#2]{\p!doassign\dosetvalue #1\@relax@#2==\empty\@relax@} -\def\doeassign [#1][#2]{\p!doassign\dosetevalue #1\@relax@#2==\empty\@relax@} -\def\undoassign[#1][#2]{\p!doassign\doresetvalue#1\@relax@#2==\empty\@relax@} - -%D When someone asked on the mailing list if it's possible to -%D use the current value of a parameter, Taco posted a small module. His -%D method had the disadvantage of making all assignments expanded and thereby -%D fragile. The following alternative uses a prefix. - -%D \macros{currentvalue} -%D -%D Just in case a \type{\getparameter} argument itself ends up -%D inside a \type{\write} or other expandable location, our -%D new macro needs a default value. - -\let\currentvalue\empty - -% \def\p!n!doassign#1#2\@relax@#3=#4=#5#6\@relax@% normal -% {\ifx#5\empty -% \@EA\xshowassignerror -% \else\ifx#5=% -% \@EAEAEA#1% -% \else -% \@EAEAEA\xshowassignerror -% \fi\fi -% {#2}{#3}{#4}} - -\def\p!n!doassign#1#2\@relax@#3=#4=#5#6\@relax@ - {\ifx\empty#3\empty - \@EA\xshowassignerror - \else\ifx#5\empty - \@EAEAEA\xshowassignerror - \else - \@EAEAEA#1% - \fi\fi - {#2}{#3}{#4}} - -\beginTEX - -% \def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@ -% {\ifx#5\empty -% \@EA\xshowassignerror -% \else\ifx#5=% -% \@EA\ifx\csname#2#3\endcsname\relax -% \let\currentvalue\empty -% \else -% \@EA\let\@EA\currentvalue\csname#2#3\endcsname -% \fi -% \@EAEAEA#1% -% \else -% \@EAEAEA\xshowassignerror -% \fi\fi -% {#2}{#3}{#4}} - -\def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@ - {\ifx\empty#3\empty - \@EA\xshowassignerror - \else\ifx#5\empty - \@EAEAEA\xshowassignerror - \else - \@EA\ifx\csname#2#3\endcsname\relax - \let\currentvalue\empty - \else - \@EA\let\@EA\currentvalue\csname#2#3\endcsname - \fi - \@EAEAEA#1% - \fi\fi - {#2}{#3}{#4}} - -\endTEX - -\beginETEX - -% \def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@ -% {\ifx#5\empty -% \@EA\xshowassignerror -% \else\ifx#5=% -% \ifcsname#2#3\endcsname -% \@EA\let\@EA\currentvalue\csname#2#3\endcsname -% \else -% \let\currentvalue\empty -% \fi -% \@EAEAEA#1% -% \else -% \@EAEAEA\xshowassignerror -% \fi\fi -% {#2}{#3}{#4}} - -\def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@ - {\ifx\empty#3\empty - \@EA\xshowassignerror - \else\ifx#5\empty - \@EAEAEA\xshowassignerror - \else - \ifcsname#2#3\endcsname - \@EA\let\@EA\currentvalue\csname#2#3\endcsname - \else - \let\currentvalue\empty - \fi - \@EAEAEA#1% - \fi\fi - {#2}{#3}{#4}} - -\endETEX - -%D We default to: - -\let\p!doassign\p!n!doassign - -%D And set: - -\let\currentvalue\empty - -%D \macros {expandparameters} -%D -%D Example usage: -%D -%D \startbuffer -%D \getparameters[taco][name=taco] -%D \convertcommand\taconame\to\ascii \ascii -%D \expandparameters \getparameters[taco][name=\currentvalue\space hoekwater] -%D \convertcommand\taconame\to\ascii \ascii -%D \getparameters[taco][name=\currentvalue\space hoekwater] -%D \convertcommand\taconame\to\ascii \ascii -%D \stopbuffer -%D -%D \typebuffer -%D \startlines -%D \getbuffer -%D \stoplines - -%D Here we hook in the code (beware, this is the optimized get **): - -\def\xdoget@n@parameters#1]% - {\xprocesscommaitem#1,],\@relax@} - -\def\xdoget@e@parameters#1]% - {\let\dosetnvalue\dosetvalue - \let\dosetvalue\dosetevalue - \let\p!doassign\p!e!doassign - \xprocesscommaitem#1,],\@relax@ - \let\p!doassign\p!n!doassign - \let\dosetvalue\dosetnvalue - \let\xdogetparameters\xdoget@n@parameters - \let\currentvalue\empty} - -\let\xdogetparameters\xdoget@n@parameters % ** - -\def\expandparameters{\let\xdogetparameters\xdoget@e@parameters} - -%D \macros -%D {getemptyparameters} -%D -%D Sometimes we explicitly want variables to default to an -%D empty string, so we welcome: -%D -%D \starttyping -%D \getemptyparameters [label] [...=...,...=...] -%D \stoptyping - -\def\getemptyparameters[#1]#2[#3]% - {\def\p!dogetemptyparameter##1% - {\doassignempty[#1][##1]}% - \processcommalist[#3]\p!dogetemptyparameter} - -%D \macros -%D {copyparameters} -%D -%D Some \CONTEXT\ commands take their default setups from -%D others. All commands that are able to provide backgounds -%D or rules around some content, for instance default to the -%D standard command for ruled boxes. Is situations like this -%D we can use: -%D -%D \starttyping -%D \copyparameters [to-label] [from-label] [name1,name2,...] -%D \stoptyping -%D -%D For instance -%D -%D \starttyping -%D \copyparameters -%D [internal][external] -%D [alfa,beta] -%D \stoptyping -%D -%D Leads to: -%D -%D \starttyping -%D \def\internalalfa {\externalalfa} -%D \def\internalbeta {\externalbeta} -%D \stoptyping -%D -%D By using \type{\docopyvalue} we've prepared this command -%D for use in a multi||lingual environment. - -\def\copyparameters[#1]#2[#3]#4[#5]% - {\doifnot{#1}{#3} - {\def\docopyparameter{\docopyvalue{#1}{#3}}% - %\def\docopyparameter##1{\docopyvalue{#1}{#3}{##1}}% - \processcommalist[#5]\docopyparameter}} - -%D \macros -%D {ifparameters,checkparameters} -%D -%D A slightly different one is \type{\checkparameters}, which -%D also checks on the presence of a~\type{=}. -%D -%D The boolean \type{\ifparameters} can be used afterwards. -%D Combining both in one \type{\if}||macro would lead to -%D problems with nested \type{\if}'s. -%D -%D \starttyping -%D \checkparameters[argument] -%D \stoptyping - -\newif\ifparameters - -\def\p!checkparameters#1=#2#3\war% - {\if#2@\parametersfalse\else\parameterstrue\fi} - -\def\checkparameters[#1]% - {\p!checkparameters#1=@@\war} - -%D \macros -%D {getfromcommalist,getfromcommacommand, -%D commalistelement, -%D getcommalistsize,getcommacommandsize} -%D -%D It's possible to get an element from a commalist or a -%D command representing a commalist. -%D -%D \starttyping -%D \getfromcommalist [string] [n] -%D \getfromcommacommand [string,\strings,string,...] [n] -%D \stoptyping -%D -%D The difference betwee the two of them is the same as the -%D difference between \type{\processcomma...}. The found string -%D is stored in \type{\commalistelement}. -%D -%D We can calculate the size of a comma separated list by -%D using: -%D -%D \starttyping -%D \getcommalistsize [string,string,...] -%D \getcommacommandsize [string,\strings,string,...] -%D \stoptyping -%D -%D Afterwards, the length is available in the macro -%D \type{\commalistsize} (not a \COUNTER). - -\newcount\commalistcounter - -\def\commalistsize{0} - -\def\p!dogetcommalistsize#1% - {\advance\commalistcounter\plusone} - -\def\getcommalistsize#1]% don't loose [{#1}] - {\commalistcounter\zerocount - \processcommalist#1]\p!dogetcommalistsize % was [{#1}] - \edef\commalistsize{\the\commalistcounter}} - -\def\getcommacommandsize[#1]% - {\edef\commacommand{#1}% - \scratchtoks\expandafter{\expandafter[\commacommand]}% - \expandafter\getcommalistsize\the\scratchtoks } - -% to be tested first -% -% \def\getcommacommandsize[#1]% -% {\expanded{\getcommalistsize[#1]}} - -% \def\p!dogetfromcommalist#1% -% {\advance\commalistcounter \minusone -% \ifcase\commalistcounter -% \def\commalistelement{#1}% -% \begingroup\def\doprocesscommaitem##1]{\endgroup}% -% \fi} - -\def\p!dogetfromcommalist#1% - {\advance\commalistcounter \minusone - \ifcase\commalistcounter - \def\commalistelement{#1}% - \expandafter\quitcommalist - \fi} - -\def\getfromcommalist[#1]#2[#3]% - {\let\commalistelement\empty - \commalistcounter#3\relax - \processcommalist[#1]\p!dogetfromcommalist} - -% \def\getfromcommacommand[#1]% why so complicated, still needed? -% {\edef\commacommand{#1}% -% \toks0=\expandafter{\expandafter[\commacommand]}% -% \expandafter\getfromcommalist\the\toks0 } - -\def\getfromcommacommand[#1]% - {\expanded{\getfromcommalist[#1]}} - -%D Because 0, 1 and~2 are often asked for, we optimize this -%D macro for those cases. The indirect call however slows -%D down the other cases. -%D -%D \starttyping -%D \def\p!dogetfirstfromcommalist [#1,#2]{\def\commalistelement{#1}} -%D \def\p!dogetsecondfromcommalist[#1,#2,#3]{\def\commalistelement{#2}} -%D \let\p!dogetotherfromcommalist=\getfromcommalist -%D -%D \def\getfromcommalist[#1]#2[#3]% optimized for 0,1,2 -%D {\ifcase#3\relax -%D \let\commalistelement\empty -%D \or -%D \p!dogetfirstfromcommalist[#1,]% -%D \or -%D \p!dogetsecondfromcommalist[#1,,]% -%D \else -%D \p!dogetotherfromcommalist[#1][#3]% -%D \fi} -%D \stoptyping -%D -%D Even worse, this alternative does not strip preceding -%D spaces, which is what we want. So, we stick to the slow -%D alternative. - -%D Watertight (and efficient) solutions are hard to find, due -%D to the handling of braces during parameters passing and -%D scanning. Nevertheless: -%D -%D \startbuffer -%D \def\dosomething#1{(#1=\commalistsize) } -%D -%D \getcommalistsize [\hbox{$a,b,c,d,e,f$}] \dosomething 1 -%D \getcommalistsize [{a,b,c,d,e,f}] \dosomething 1 -%D \getcommalistsize [{a,b,c},d,e,f] \dosomething 4 -%D \getcommalistsize [a,b,{c,d,e},f] \dosomething 4 -%D \getcommalistsize [a{b,c},d,e,f] \dosomething 4 -%D \getcommalistsize [{a,b}c,d,e,f] \dosomething 4 -%D \getcommalistsize [] \dosomething 0 -%D \getcommalistsize [{[}] \dosomething 1 -%D \stopbuffer -%D -%D \typebuffer -%D -%D reports: -%D -%D \getbuffer - -%D \macros -%D {dogetcommalistelement,dogetcommacommandelement} -%D -%D For low level (fast) purposes, we can also use the next -%D alternative, which can handle 8~elements at most. -%D -%D \starttyping -%D \dogetcommalistelement1\from a,b,c\to\commalistelement -%D \stoptyping - -\def\dodogetcommalistelement#1\from#2,#3,#4,#5,#6,#7,#8\to#9% - {\edef#9{\ifcase#1\relax\or#2\or#3\or#4\or#5\or#6\or#7\or#8\fi}} - -% maybe better: -% -% {\@EA\edef\@EA#9\@EA{\ifcase#1\relax\or#2\or#3\or#4\or#5\or#6\or#7\or#8\fi}} - -\def\dogetcommalistelement#1\from#2\to% - {\dodogetcommalistelement#1\from#2,,,,,,\to} - -% check sources - -\def\dogetcommacommandelement#1\from#2\to% - {\@EA\dodogetcommalistelement\@EA#1\@EA\from#2,,,,,,\to} - -%D \macros -%D {dosingleargument,dodoubleargument,dotripleargument, -%D doquadrupleargument,doquintupleargument,dosixtupleargument, -%D doseventupleargument} -%D -%D When working with delimited arguments, spaces and -%D lineendings can interfere. The next set of macros uses -%D \TEX' internal scanner for grabbing everything between -%D arguments. Forgive me the funny names. -%D -%D \starttyping -%D \dosingleargument\commando = \commando[#1] -%D \dodoubleargument\commando = \commando[#1][#2] -%D \dotripleargument\commando = \commando[#1][#2][#3] -%D \doquadrupleargument\commando = \commando[#1][#2][#3][#4] -%D \doquintupleargument\commando = \commando[#1][#2][#3][#4][#5] -%D \dosixtupleargument\commando = \commando[#1][#2][#3][#4][#5][#6] -%D \doseventupleargument\command= \commando[#1][#2][#3][#4][#5][#6][#7] -%D \stoptyping -%D -%D These macros are used in the following way: -%D -%D \starttyping -%D \def\dosetupsomething[#1][#2]% -%D {... #1 ... #2 ...} -%D -%D \def\setupsomething% -%D {\dodoubleargument\dosetupsomething} -%D \stoptyping -%D -%D The implementation can be surprisingly simple and needs no -%D further explanation, like: -%D -%D \starttyping -%D \def\dosingleargument#1[#2]% -%D {#1[#2]} -%D \def\dotripleargument#1[#2]#3[#4]#5[#6]% -%D {#1[#2][#4][#6]} -%D \def\doquintupleargument#1% -%D {\def\dodoquintupleargument[##1]##2[##3]##4[##5]##6[##7]##8[##9]% -%D {#1[##1][##3][##5][##7][##9]}% -%D \dodoquintupleargument} -%D \stoptyping -%D -%D Because \TEX\ accepts 9~arguments at most, we have to use -%D two||step solution when getting five or more arguments. -%D -%D When developing more and more of the real \CONTEXT, we -%D started using some alternatives that provided empty -%D arguments (in fact optional ones) whenever the user failed -%D to supply them. Because this more complicated macros enable -%D us to do some checking, we reimplemented the non||empty -%D ones. - -\def\dosingleargument {\chardef\expectedarguments 1 \dosingleempty } -\def\dodoubleargument {\chardef\expectedarguments 2 \dodoubleempty } -\def\dotripleargument {\chardef\expectedarguments 3 \dotripleempty } -\def\doquadrupleargument {\chardef\expectedarguments 4 \doquadrupleempty } -\def\doquintupleargument {\chardef\expectedarguments 5 \doquintupleempty } -\def\dosixtupleargument {\chardef\expectedarguments 6 \dosixtupleempty } -\def\doseventupleargument{\chardef\expectedarguments 7 \doseventupleempty} - -%D \macros -%D {iffirstagument,ifsecondargument,ifthirdargument, -%D iffourthargument,iffifthargument,ifsixthargument, -%D ifseventhargument} -%D -%D We use some signals for telling the calling macros if all -%D wanted arguments are indeed supplied by the user. - -\newif\iffirstargument -\newif\ifsecondargument -\newif\ifthirdargument -\newif\iffourthargument -\newif\iffifthargument -\newif\ifsixthargument -\newif\ifseventhargument - -%D \macros -%D {dosingleempty,dodoubleempty,dotripleempty, -%D doquadrupleempty,doquintupleempty,dosixtupeempty, -%D doseventupleempty} -%D -%D The empty argument supplying macros mentioned before, look -%D like: -%D -%D \starttyping -%D \dosingleempty \command -%D \dodoubleempty \command -%D \dotripleempty \command -%D \doquadrupleempty \command -%D \doquintupleempty \command -%D \dosixtupleempty \command -%D \doseventupleempty\command -%D \stoptyping -%D -%D So \type{\dodoubleempty} leades to: -%D -%D \starttyping -%D \command[#1][#2] -%D \command[#1][] -%D \command[][] -%D \stoptyping -%D -%D Depending of the generousity of the user. Afterwards one can -%D use the \type{\if...argument} boolean. For novice: watch -%D the stepwise doubling of \type{#}'s - -% idea: \ignorespaces afterwards - -\chardef\noexpectedarguments=0 -\chardef\expectedarguments =0 - -\def\showargumenterror#1#2% - {\writestatus{systems}{#1 argument(s) expected in line #2}} - -% \long\def\dogetargument#1#2#3#4% redefined in mult-ini -% {\doifnextcharelse{#1} -% {\let\expectedarguments\noexpectedarguments -% #3\dodogetargument} -% {\ifnum\expectedarguments>\noexpectedarguments -% \showargumenterror{\expectedarguments} -% \fi -% \let\expectedarguments\noexpectedarguments -% #4\dodogetargument#1#2}} -% -% less to pass - -\def\doshowargumenterror - {\ifnum\expectedarguments>\noexpectedarguments - \showargumenterror{\number\expectedarguments}{\number\inputlineno}% - \fi - \noshowargumenterror} - -\def\noshowargumenterror - {\let\expectedarguments\noexpectedarguments} - -% \long\def\dogetargument#1#2#3#4% -% {\doifnextcharelse#1% -% {\noshowargumenterror#3\dodogetargument} -% {\doshowargumenterror#4\dodogetargument#1#2}} -% -% faster ? - -\long\def\dogetargument#1#2#3#4% - {\let\charactertoken=#1% - \def\!!stringa{\noshowargumenterror#3\dodogetargument}% - \def\!!stringb{\doshowargumenterror#4\dodogetargument#1#2}% - \futurelet\nexttoken\inspectnextcharacter} - -\def\getsingleempty#1#2#3% - {\def\dodogetargument% - {#3}% - \dogetargument#1#2\firstargumenttrue\firstargumentfalse} - -\def\getdoubleempty#1#2#3% - {\def\dodogetargument#1##1#2% - {\def\dodogetargument% - {#3#1{##1}#2}% - \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% - \dogetargument#1#2\firstargumenttrue\firstargumentfalse} - -\def\gettripleempty#1#2#3% - {\def\dodogetargument#1##1#2% - {\def\dodogetargument#1####1#2% - {\def\dodogetargument% - {#3#1{##1}#2% - #1{####1}#2}% - \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% - \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% - \dogetargument#1#2\firstargumenttrue\firstargumentfalse} - -\def\getquadrupleempty#1#2#3% - {\def\dodogetargument#1##1#2% - {\def\dodogetargument#1####1#2% - {\def\dodogetargument#1########1#2% - {\def\dodogetargument% - {#3#1{##1}#2% - #1{####1}#2% - #1{########1}#2}% - \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}% - \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% - \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% - \dogetargument#1#2\firstargumenttrue\firstargumentfalse} - -\def\getquintupleempty#1#2#3% - {\def\dodogetargument#1##1#2% - {\def\dodogetargument#1####1#2% - {\def\dodogetargument#1########1#2% - {\def\dodogetargument#1################1#2% - {\def\dodogetargument% - {#3#1{##1}#2% - #1{####1}#2% - #1{########1}#2% - #1{################1}#2}% - \dogetargument#1#2\fifthargumenttrue\fifthargumentfalse}% - \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}% - \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% - \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% - \dogetargument#1#2\firstargumenttrue\firstargumentfalse} - -\def\getsixtupleempty#1#2#3% - {\def\dodogetargument#1##1#2% - {\def\dodogetargument#1####1#2% - {\def\dodogetargument#1########1#2% - {\def\dodogetargument#1################1#2% - {\def\dodogetargument#1################################1#2% - {\def\dodogetargument% - {#3#1{##1}#2% - #1{####1}#2% - #1{########1}#2% - #1{################1}#2% - #1{################################1}#2}% - \dogetargument#1#2\sixthargumenttrue\sixthargumentfalse}% - \dogetargument#1#2\fifthargumenttrue\fifthargumentfalse}% - \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}% - \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% - \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% - \dogetargument#1#2\firstargumenttrue\firstargumentfalse} - -\def\getseventupleempty#1#2#3% - {\def\dodogetargument#1##1#2% - {\def\dodogetargument#1####1#2% - {\def\dodogetargument#1########1#2% - {\def\dodogetargument#1################1#2% - {\def\dodogetargument#1################################1#2% - {\def\dodogetargument#1################################% - ################################1#2% - {\def\dodogetargument% - {#3#1{##1}#2% - #1{####1}#2% - #1{########1}#2% - #1{################1}#2% - #1{################################1}#2% - #1{################################% - ################################1}#2}% - \dogetargument#1#2\seventhargumenttrue\seventhargumentfalse}% - \dogetargument#1#2\sixthargumenttrue\sixthargumentfalse}% - \dogetargument#1#2\fifthargumenttrue\fifthargumentfalse}% - \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}% - \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}% - \dogetargument#1#2\secondargumenttrue\secondargumentfalse}% - \dogetargument#1#2\firstargumenttrue\firstargumentfalse} - -\def\dosingleempty {\getsingleempty []} -\def\dodoubleempty {\getdoubleempty []} -\def\dotripleempty {\gettripleempty []} -\def\doquadrupleempty {\getquadrupleempty []} -\def\doquintupleempty {\getquintupleempty []} -\def\dosixtupleempty {\getsixtupleempty []} -\def\doseventupleempty{\getseventupleempty[]} - -%D Because some of these are called quite often, we will now -%D replace the more general version by alternatives tuned for -%D speed. - -\def\dosingleempty#1% - {\noshowargumenterror % \relax % prevents lookahead, brr - \doifnextoptionalelse - {\firstargumenttrue#1} - {\dosinglefakeempty#1}} - -\def\dodoubleempty#1% - {\noshowargumenterror % \relax % prevents lookahead, brr - \doifnextoptionalelse - {\dodoubletestempty#1} - {\dodoublefakeempty#1}} - -\def\dotripleempty#1% - {\noshowargumenterror % \relax % prevents lookahead, brr - \doifnextoptionalelse - {\dotripletestempty#1} - {\dotriplefakeempty#1}} - -\def\dosinglefakeempty#1% - {\firstargumentfalse#1[]} - -\def\dodoublefakeempty#1% - {\firstargumentfalse\secondargumentfalse#1[][]} - -\def\dotriplefakeempty#1% - {\firstargumentfalse\secondargumentfalse\thirdargumentfalse#1[][][]} - -\long\def\dodoubletestempty#1[#2]% - {\firstargumenttrue - \doifnextoptionalelse - {\secondargumenttrue #1[{#2}]} - {\secondargumentfalse#1[{#2}][]}} - -\long\def\dotripletestempty#1[#2]% - {\firstargumenttrue - \doifnextoptionalelse - {\dotripletestemptyx #1[{#2}]} - {\secondargumentfalse - \thirdargumentfalse #1[{#2}][][]}} - -\long\def\dotripletestemptyx#1[#2][#3]% - {\secondargumenttrue - \doifnextoptionalelse - {\thirdargumenttrue #1[{#2}][{#3}]} - {\thirdargumentfalse#1[{#2}][{#3}][]}} - -%D \macros -%D {strippedcsname} -%D -%D The next macro can be very useful when using \type{\csname} -%D like in: -%D -%D \starttyping -%D \csname if\strippedcsname\something\endcsname -%D \stoptyping -%D -%D This expands to \type{\ifsomething}. - -\def\strippedcsname% - {\expandafter\gobbleoneargument\string} - -%D \macros -%D {complexorsimple,complexorsimpleempty} -%D -%D Setups can be optional. A command expecting a setup is -%D prefixed by \type{\complex}, a command without one gets the -%D prefix \type{\simple}. Commands like this can be defined by: -%D -%D \starttyping -%D \complexorsimple\command -%D \stoptyping -%D -%D When \type{\command} is followed by a \type{[setup]}, then -%D -%D \starttyping -%D \complexcommand [setup] -%D \stoptyping -%D -%D executes, else we get -%D -%D \starttyping -%D \simplecommand -%D \stoptyping -%D -%D An alternative for \type{\complexorsimple} is: -%D -%D \starttyping -%D \complexorsimpleempty {command} -%D \stoptyping -%D -%D Depending on the presence of \type{[setup]}, this one -%D leads to one of: -%D -%D \starttyping -%D \complexcommando [setup] -%D \complexcommando [] -%D \stoptyping -%D -%D Many \CONTEXT\ commands started as complex or simple ones, -%D but changed into more versatile (more object oriented) ones -%D using the \type{\get..argument} commands. - -% This method is needed when traditional tex is used with -% the efficient definition (marked **) below. - -% an old one: -% -% \def\setnameofcommand#1% handles {abc} as well as \abc -% {\begingroup -% \escapechar=-1 -% \globaldefs=0 % pretty important! -% \xdef\nameofcommand{\string#1}% -% \endgroup} -% -% \def\complexorsimple#1% -% {\setnameofcommand{#1}% -% \doifnextcharelse{[} -% {\firstargumenttrue \getvalue{\s!complex\nameofcommand}} -% {\firstargumentfalse\getvalue{\s!simple \nameofcommand}}} -% -% \def\complexorsimpleempty#1% -% {\setnameofcommand{#1}% -% \doifnextcharelse{[} -% {\firstargumenttrue \getvalue{\s!complex\nameofcommand}} -% {\firstargumentfalse\getvalue{\s!complex\nameofcommand}[]}} -% -% a newer one: - -\def\complexorsimple#1% - {% \relax % prevents lookahead, brrr - \doifnextoptionalelse - {\firstargumenttrue \csname\s!complex\strippedcsname#1\endcsname} - {\firstargumentfalse\csname\s!simple \strippedcsname#1\endcsname}} - -\def\complexorsimpleempty#1% - {% \relax % prevents lookahead, brrr - \doifnextoptionalelse - {\firstargumenttrue \csname\s!complex\strippedcsname#1\endcsname} - {\firstargumentfalse\csname\s!complex\strippedcsname#1\endcsname[]}} - -%D \macros -%D {definecomplexorsimple,definecomplexorsimpleempty} -%D -%D The previous commands are used that often that we found it -%D worthwile to offer two more alternatives. Watch the build -%D in protection. - -% See earlier. Because we don't want \type {\simple..} and -% \type {\complex..} commands to show up in expansions, we need -% to pass them as \type {simple..} and \type {complex..}. - -% \beginTEX -% -% \def\definewithnameofcommand#1#2% -% {\setnameofcommand{#2}% -% \@EA\def\@EA#2\@EA{\@EA\donottest\@EA#1\@EA{\nameofcommand}}} -% -% \def\definecomplexorsimple% -% {\definewithnameofcommand\complexorsimple} -% -% \def\definecomplexorsimpleempty% -% {\definewithnameofcommand\complexorsimpleempty} -% -% \endTEX -% -% \beginETEX \protected -% -% \def\definecomplexorsimple#1% -% {\normalprotected\def#1{\complexorsimple#1}} -% -% \def\definecomplexorsimpleempty#1% -% {\normalprotected\def#1{\complexorsimpleempty#1}} -% -% \endETEX - -% However, since this one uses an idirect method, things go -% okay (at the cost of extra macros). - -% \def\definecomplexorsimple#1% -% {\unexpanded\def#1{\complexorsimple#1}} -% -% \def\definecomplexorsimpleempty#1% -% {\unexpanded\def#1{\complexorsimpleempty#1}} -% -% faster, since no \strippedcsname needed in call, but more spacy - -\def\docomplexorsimple#1#2% - {\doifnextoptionalelse{\firstargumenttrue#1}{\firstargumentfalse#2}} - -\def\docomplexorsimpleempty#1% - {\doifnextoptionalelse{\firstargumenttrue#1}{\firstargumentfalse#1[]}} - -\def\definecomplexorsimple#1% - {\unexpanded\edef#1% - {\noexpand\docomplexorsimple - \@EA\noexpand\csname\s!complex\strippedcsname#1\endcsname - \@EA\noexpand\csname\s!simple \strippedcsname#1\endcsname}} - -\def\definecomplexorsimpleempty#1% - {\unexpanded\edef#1% - {\noexpand\docomplexorsimpleempty - \@EA\noexpand\csname\s!complex\strippedcsname#1\endcsname}} - -%D These commands are called as: -%D -%D \starttyping -%D \definecomplexorsimple\command -%D \stoptyping -%D -%D Of course, we must have available -%D -%D \starttyping -%D \def\complexcommand[#1]{...} -%D \def\simplecommand {...} -%D \stoptyping -%D -%D Using this construction saves a few string now and then. - -%D \macros -%D {definestartstopcommand} -%D -%D Those who get the creeps of expansion may skip the next -%D one. It's one of the most recent additions and concerns -%D \type{\start}||\type{\stop} pairs with complicated -%D arguments. -%D -%D We won't go into details here, but the general form of -%D this using this command is: -%D -%D \starttyping -%D \definestartstopcommand\somecommand\e!specifier{arg}{arg}% -%D {do something with arg} -%D \stoptyping -%D -%D This expands to something like: -%D -%D \starttyping -%D \def\somecommand arg \startspecifier arg \stopspecifier% -%D {do something with arg} -%D \stoptyping -%D -%D The arguments can be anything reasonable, but double -%D \type{#}'s are needed in the specification part, like: -%D -%D \starttyping -%D \definestartstopcommand\somecommand\e!specifier{[##1][##2]}{##3}% -%D {do #1 something #2 with #3 arg} -%D \stoptyping -%D -%D which becomes: -%D -%D \starttyping -%D \def\somecommand[#1][#2]\startspecifier#3\stopspecifier% -%D {do #1 something #2 with #3 arg} -%D \stoptyping -%D -%D We will see some real applications of this command in the -%D core modules. - -\def\definestartstopcommand#1#2#3#4% can be done with \expanded ot better, toks - {\def\!stringa{#3}% % but let's keep this unused one crappy - \def\!stringb{\e!start#2}% - \def\!stringc{#4}% - \def\!stringd{\e!stop#2}% - \@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA - \def\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA - #1\@EA\@EA\@EA\@EA\@EA\@EA\@EA - \!stringa\@EA\@EA\@EA - \csname\@EA\@EA\@EA\!stringb\@EA\@EA\@EA\endcsname\@EA - \!stringc - \csname\!stringd\endcsname} - -%D \macros -%D {dosinglegroupempty,dodoublegroupempty,dotriplegroupempty, -%D doquadruplegroupempty, doquintuplegroupempty} -%D -%D We've already seen some commands that take care of -%D optional arguments between \type{[]}. The next two commands -%D handle the ones with \type{{}}. They are called as: -%D -%D \starttyping -%D \dosinglegroupempty \ineedONEargument -%D \dodoublegroupempty \ineedTWOarguments -%D \dotriplegroupempty \ineedTHREEarguments -%D \doquadruplegroupempty \ineedFOURarguments -%D \doquintuplegroupempty \ineedFIVEarguments -%D \stoptyping -%D -%D where \type{\ineedONEargument} takes one and the others -%D two and three arguments. These macro's were first needed in -%D \PPCHTEX. -%D -%D \starttyping -%D \def\dogetgroupargument#1#2% redefined in mult-ini -%D {\def\nextnextargument% -%D {\ifx\nextargument\bgroup -%D \let\expectedarguments\noexpectedarguments -%D \def\nextargument{#1\dodogetargument}% -%D %\else\ifx\nextargument\lineending % this can be an option -%D % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}% -%D %\else\ifx\nextargument\blankspace % but it may never be default -%D % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}% -%D \else -%D \ifnum\expectedarguments>\noexpectedarguments -%D \writestatus -%D {setup} -%D {\the\expectedarguments\space argument(s) expected -%D in line \the\inputlineno\space}% -%D \fi -%D \let\expectedarguments\noexpectedarguments -%D \def\nextargument{#2\dodogetargument{}}% -%D \fi%\fi\fi % so let's get rid of it -%D \nextargument}% -%D \futurelet\nextargument\nextnextargument} -%D \stoptyping -%D -%D In order to catch \type {\nextargument}'s that expand to -%D \type {\if} and friends, in practice we will use a -%D slightly more complicated macro. - -\newtoks \everyrobusttest - -\everyrobusttest - {\let\if \relax - \let\ifcat \relax - \let\ifnum \relax - \let\ifdim \relax - \let\ifodd \relax - \let\ifvmode \relax - \let\ifhmode \relax - \let\ifmmode \relax - \let\ifinner \relax - \let\ifvoid \relax - \let\ifhbox \relax - \let\ifvbox \relax - \let\ifx \relax - \let\ifeof \relax - \let\iftrue \relax - \let\iffalse \relax - \let\ifcase \relax - \let\ifdefined \relax - \let\ifcsname \relax - \let\iffontchar \relax - \let\ifincsname \relax - \let\ifprimitive\relax - \let\ifabsnum \relax - \let\ifabsdim \relax - \let\else \relax - \let\or \relax - \let\fi \relax} - -\def\beginrobusttest - {\begingroup - \the\everyrobusttest} - -\let\endrobusttest\endgroup - -%D We can add additional definitions later when we have defined -%D \type {\appendtoks}. - -\def \permitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=0 } -\def\dontpermitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=1 } - -\dontpermitspacesbetweengroups - -% \def\dogetgroupargument#1#2% -% {\def\nextnextargument% -% {\normalifx\nextargument\bgroup -% \endrobusttest -% \noshowargumenterror -% \def\nextargument{#1\dodogetargument}% -% \normalelse -% \normalifcase\@@permitspacesbetweengroups -% \normalifx\nextargument\lineending -% \endrobusttest -% \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}% -% \normalelse\normalifx\nextargument\blankspace -% \endrobusttest -% \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}% -% \normalelse -% \endrobusttest -% \doshowargumenterror -% \def\nextargument{#2\dodogetargument{}}% -% \normalfi\normalfi -% \normalelse -% \endrobusttest -% \doshowargumenterror -% \def\nextargument{#2\dodogetargument{}}% -% \normalfi -% \normalfi -% \nextargument}% -% \beginrobusttest -% \futurelet\nextargument\nextnextargument} - -\def\dodogetgroupargument - {\normalifx\nextargument\bgroup - \endrobusttest - \noshowargumenterror - \def\nextargument{\dogroupargumentyes\dodogetargument}% - \normalelse - \normalifcase\@@permitspacesbetweengroups - \normalifx\nextargument\lineending - \endrobusttest - \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument\dogroupargumentyes\dogroupargumentnop}\\}% - \normalelse\normalifx\nextargument\blankspace - \endrobusttest - \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument\dogroupargumentyes\dogroupargumentnop}\\}% - \normalelse - \endrobusttest - \doshowargumenterror - \def\nextargument{\dogroupargumentnop\dodogetargument{}}% - \normalfi\normalfi - \normalelse - \endrobusttest - \doshowargumenterror - \def\nextargument{\dogroupargumentnop\dodogetargument{}}% - \normalfi - \normalfi - \nextargument}% - -\def\dogetgroupargument#1#2% - {\let\dogroupargumentyes#1% - \let\dogroupargumentnop#2% - \beginrobusttest\futurelet\nextargument\dodogetgroupargument} - -\def\dosinglegroupempty#1% - {\def\dodogetargument% - {\dontpermitspacesbetweengroups - #1}% - \dogetgroupargument\firstargumenttrue\firstargumentfalse} - -\def\dodoublegroupempty#1% - {\def\dodogetargument##1% - {\def\dodogetargument% - {\dontpermitspacesbetweengroups - #1{##1}}% - \dogetgroupargument\secondargumenttrue\secondargumentfalse}% - \dogetgroupargument\firstargumenttrue\firstargumentfalse} - -\def\dotriplegroupempty#1% - {\def\dodogetargument##1% - {\def\dodogetargument####1% - {\def\dodogetargument% - {\dontpermitspacesbetweengroups - #1{##1}{####1}}% - \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}% - \dogetgroupargument\secondargumenttrue\secondargumentfalse}% - \dogetgroupargument\firstargumenttrue\firstargumentfalse} - -\def\doquadruplegroupempty#1% - {\def\dodogetargument##1% - {\def\dodogetargument####1% - {\def\dodogetargument########1% - {\def\dodogetargument% - {\dontpermitspacesbetweengroups - #1{##1}{####1}{########1}}% - \dogetgroupargument\fourthargumenttrue\fourthargumentfalse}% - \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}% - \dogetgroupargument\secondargumenttrue\secondargumentfalse}% - \dogetgroupargument\firstargumenttrue\firstargumentfalse} - -\def\doquintuplegroupempty#1% - {\def\dodogetargument##1% - {\def\dodogetargument####1% - {\def\dodogetargument########1% - {\def\dodogetargument################1% - {\def\dodogetargument% - {\dontpermitspacesbetweengroups - #1{##1}{####1}{########1}{################1}}% - \dogetgroupargument\fifthargumenttrue\fifthargumentfalse}% - \dogetgroupargument\fourthargumenttrue\fourthargumentfalse}% - \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}% - \dogetgroupargument\secondargumenttrue\secondargumentfalse}% - \dogetgroupargument\firstargumenttrue\firstargumentfalse} - -%D These macros can explictly take care of spaces, which means -%D that the next definition and calls are valid: -%D -%D \starttyping -%D \def\test#1#2#3{[#1#2#3]} -%D -%D \dotriplegroupempty\test {a}{b}{c} -%D \dotriplegroupempty\test {a}{b} -%D \dotriplegroupempty\test {a} -%D \dotriplegroupempty\test -%D \dotriplegroupempty\test {a} {b} {c} -%D \dotriplegroupempty\test {a} {b} -%D \dotriplegroupempty\test -%D {a} -%D {b} -%D \stoptyping -%D -%D And alike. - -%D \macros -%D {firstofoneargument, firstoftwoarguments, firstofthreearguments -%D secondoftwoarguments, secondofthreearguments, -%D thirdofthreearguments} -%D -%D The next six macros (dedicated to Taco) can conveniently -%D used to select arguments. Their names explain their -%D functionality. - -\long\def\firstofoneargument#1{#1} - -\long\def\firstoftwoarguments #1#2{#1} -\long\def\secondoftwoarguments#1#2{#2} - -\long\def\firstofthreearguments #1#2#3{#1} -\long\def\secondofthreearguments#1#2#3{#2} -\long\def\thirdofthreearguments #1#2#3{#3} - -\long\def\firstoffourarguments #1#2#3#4{#1} -\long\def\secondoffourarguments#1#2#3#4{#2} -\long\def\thirdoffourarguments #1#2#3#4{#3} -\long\def\fourthoffourarguments#1#2#3#4{#4} - -\long\def\firstoffivearguments #1#2#3#4#5{#1} -\long\def\secondoffivearguments#1#2#3#4#5{#2} -\long\def\thirdoffivearguments #1#2#3#4#5{#3} -\long\def\fourthoffivearguments#1#2#3#4#5{#4} -\long\def\fifthoffivearguments #1#2#3#4#5{#5} - -\long\def\firstofsixarguments #1#2#3#4#5#6{#1} -\long\def\secondofsixarguments#1#2#3#4#5#6{#2} -\long\def\thirdofsixarguments #1#2#3#4#5#6{#3} -\long\def\fourthofsixarguments#1#2#3#4#5#6{#4} -\long\def\fifthofsixarguments #1#2#3#4#5#6{#5} -\long\def\sixthofsixarguments #1#2#3#4#5#6{#6} - -%D \macros -%D {globalletempty,letempty,letvalueempty,letgvalueempty} -%D -%D Trivial: - -\def\letempty #1{\let#1\empty} -\def\globalletempty#1{\global\let#1\empty} - -\def\letvalueempty #1{\expandafter\let\csname#1\endcsname\empty} -\def\letgvalueempty#1{\global\expandafter\let\csname#1\endcsname\empty} - -%D \macros -%D {wait} -%D -%D The next macro hardly needs explanation. Because no -%D nesting is to be expected, we can reuse \type{\wait} within -%D \type{\wait} itself. - -\def\wait - {\begingroup - \read16 to \wait - \endgroup} - -%D \macros -%D {writestring,writeline,writebanner, -%D writestatus,statuswidth,normalwritestatus} -%D -%D Maybe one didn't notice, but we've already introduced a -%D macro for showing messages. In the multi||lingual modules, -%D we will also introduce a mechanism for message passing. For -%D the moment we stick to the core macros: -%D -%D \starttyping -%D \writestring {string} -%D \writeline -%D \writestatus {category} {message} -%D \stoptyping -%D -%D Messages are formatted. One can provide the maximum with -%D of the identification string with the macro \type -%D {\statuswidth}. - -\chardef\statuswidth=15 -\chardef\statuswrite=16 - -\ifx\writestring\undefined - - \newtoks\everywritestring - - \def\writedirect {\immediate\write\statuswrite} - \def\writeline {\writedirect{}} - \def\writestring#1{\begingroup\the\everywritestring\writedirect{#1}\endgroup} - -\fi - -%D First we present the normal \TEX\ variant, later we will -%D show the \ETEX-way. - - -\beginTEX - - \newcount\statuscounter - - \def\dosplitstatus#1% - {\advance\statuscounter \minusone - \ifcase\statuscounter - \expandafter\nosplitstatus - \else - \scratchtoks\@EA{\the\scratchtoks#1}% - \expandafter\dosplitstatus - \fi} - - \def\nosplitstatus#1\end - {} - - \def\writestatus#1#2% - {\begingroup - \scratchtoks\emptytoks - \statuscounter\statuswidth - \expandafter\dosplitstatus#1% - \space\space\space\space\space\space\space - \space\space\space\space\space\space\space - \space\space\space\space\space\space\end - \@EA\writestring\@EA{\the\scratchtoks\space:\space#2}% - \endgroup} - -\endTEX - -%D Because we're grouped, we could have initialized at forehand: -%D -%D \starttyping -%D \statuscounter\statuswidth -%D \stoptyping -%D -%D The next implementation saves only some 10 words of format -%D memory, but we hardly gain any speed. -%D -%D \starttyping -%D \def\dosplitstatus#1#2#3#4#5#6#7#8#9% -%D {#1#2#3#4#5#6#7#8#9\dodosplitstatus} -%D -%D \def\dodosplitstatus#1#2#3#4#5#6\end -%D {#1#2#3#4#5} -%D -%D \def\writestatus#1#2% -%D {\writestring -%D {\expandafter\dosplitstatus#1% -%D \space\space\space\space\space -%D \space\space\space\space\space -%D \space\space\space\space\space\end -%D \space:\space#2}} -%D \stoptyping - -%D Okay then, more obscure but slightly faster: no split grabs -%D the do split part and skipping the else branch has to happen -%D anyway, so: - -\beginTEX - - \def\dosplitstatus#1% - {\advance\statuscounter \minusone - \ifcase\statuscounter - \expandafter\nosplitstatus - \fi - \scratchtoks\@EA{\the\scratchtoks#1}% - \dosplitstatus} - -\endTEX - -%D The next (\ETEX\ specific) variant is twice as fast in 5/40 -%D situations, only gains some speed when multiple runs of large docs -%D are done; fully expandable, no statuscounter needed, no restore (due -%D to grouping) needed etc. - -\beginETEX \numexpr - - \def\normalwritestatus#1#2% - {\writestring{\expandafter\dosplitstatus\expandafter\statuswidth#1% - \space\space\space\space\space\space\space - \space\space\space\space\space\space\space - \space\space\space\space\space\space\end - \space:\space#2}} - - \def\dosplitstatus#1#2% - {\ifcase#1 \expandafter\nosplitstatus\fi#2% - \expandafter\dosplitstatus\expandafter{\the\numexpr#1+\minusone\relax}} - - \def\nosplitstatus#1\end - {} - -\endETEX - -%D \macros -%D {emptytoks} -%D -%D For this we need an empty token register, analogous -%D to \type {\empty}. - -\newtoks\emptytoks - -%D \macros -%D {debuggerinfo} -%D -%D For debugging purposes we can enhance macros with the -%D next alternative. Here \type{debuggerinfo} stands for both -%D a macro accepting two arguments and a boolean (in fact a -%D few macro's too). - -\newif\ifdebuggerinfo - -\def\debuggerinfo#1#2% - {\ifdebuggerinfo - \writestatus{debugger}{#1:: #2}% - \fi} - -%D Finally we do what from now on will be done at the top of -%D the files: we tell the user what we are loading. - -% \ifx\writestatus\undefined \let\writestatus\normalwritestatus \fi -% \ifx\writebanner\undefined \def\writebanner{\writestring} \fi - -\let\writestatus\normalwritestatus -\def\writebanner{\writestring} - -\writestatus{loading}{ConTeXt System Macros / General} - -%D Well, the real final command is the one that resets the -%D unprotected characters \type{@}, \type{?} and \type{!}. - -\protect \endinput diff --git a/tex/context/base/syst-ini.tex b/tex/context/base/syst-ini.tex index c334b1cf6..50999d813 100644 --- a/tex/context/base/syst-ini.tex +++ b/tex/context/base/syst-ini.tex @@ -182,8 +182,8 @@ \countdef \lastallocatedfamily = 43 \lastallocatedfamily = \minallocatedfamily \countdef \lastallocatedattribute = 44 \lastallocatedattribute = \minallocatedregister -\countdef \mincountervalue = 125 \mincountervalue = -"7FFFFFFF -\countdef \maxcountervalue = 126 \maxcountervalue = "7FFFFFFF +\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 diff --git a/tex/context/base/syst-lua.lua b/tex/context/base/syst-lua.lua index e3d3ce01a..6df1b7b44 100644 --- a/tex/context/base/syst-lua.lua +++ b/tex/context/base/syst-lua.lua @@ -13,8 +13,6 @@ local ctxcatcodes = tex.ctxcatcodes commands = commands or { } cs = commands -- shorter -ctx = ctx or { } -- special context namespace, code might move from there - function commands.writestatus(a,b,c,...) if c then texiowrite_nl(format("%-16s: %s\n",a,format(b,c,...))) diff --git a/tex/context/base/syst-new.mkii b/tex/context/base/syst-new.mkii new file mode 100644 index 000000000..53ba18ffd --- /dev/null +++ b/tex/context/base/syst-new.mkii @@ -0,0 +1,868 @@ +%D \module +%D [ file=syst-new, +%D version=1997.01.03, +%D title=\CONTEXT\ Support Macros, +%D subtitle=New Ones, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Code from this module will move. For instance to +%D syst-dat.tex (datastructures). + +\unprotect + +% pretty ugly but fast + +% \copycsname xxx\endcsname\csname ..\endcsname + +\def\copycsname{\@EA\@EA\@EA\let\@EA\@EA\csname} + +% \letcscsname \crap \csname ..\endcsname +% \letcsnamecs \csname ..\endcsname\crap +% \letcsnamecsname\csname ..\endcsname\csname ..\endcsname + +\def\letcscsname {\@EA\let\@EA} +\def\letcsnamecs {\@EA\let} +\def\letcsnamecsname{\@EA\@EA\@EA\let\@EA\@EA} + +% another one, add an item to a commalist + +\def\addvalue#1#2% cs item + {\ifundefined{#1}\@EA\let\csname#1\endcsname\empty\fi + \expanded{\addtocommalist{#2}\@EA\noexpand\csname#1\endcsname}} + +% faster, and looks okay + +\def\unspaced#1% + {\dounspaced#1\end} + +\def\dounspaced#1% + {\ifx#1\end + \@EA\gobbleoneargument + \else + \ifx#1\blankspace\else#1\fi + \fi + \dounspaced} + +\def\unspaceargument#1\to#2% + {\defconvertedargument#2{#1}% + \@EA\edef\@EA#2\@EA{\@EA\unspaced\@EA{#2}}} + +\def\unspaceafter#1#2% + {\edef\ascii{\dounspaced#2\end}\@EA#1\@EA{\ascii}} + +% etex, much faster +% +% \def\unspaceargument#1\to#2% +% {\scratchcounter\catcode'32\catcode32=\@@ignore +% \scantokens{\edef#2{#1}}% +% \catcode32=\scratchcounter} + +\def\unspaceafter#1#2% + {\edef\ascii{\dounspaced#2\end}\@EA#1\@EA{\ascii}} + +% sometimes handy: + +\def\doifhasspaceelse#1% + {\edef\!!stringa{#1}% + \expanded{\dodoifhasspaceelse#1\space}\empty\relax} + +\def\dodoifhasspaceelse#1 #2#3\relax % \space\empty\relax + {\ifx\!!stringa\space + \@EA\firstoftwoarguments + \else\ifx#2\empty + \@EAEAEA\secondoftwoarguments + \else + \@EAEAEA\firstoftwoarguments + \fi\fi} + +% this will replace loadfile once and alike !!! todo + +\def\@flg@{@flg@} + +\def\setflag#1% + {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\zerocount} + +\def\resetflag#1% + {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\plusone} + +\let\ifflagged\ifcase + +\def\flag#1{\csname\@flg@#1\endcsname} + +\def\doifelseflagged#1% + {\@EA\ifx\csname\@flg@#1\endcsname\relax + \@EA\secondoftwoarguments + \else\ifcase\csname\@flg@#1\endcsname + \@EAEAEA\firstoftwoarguments + \else + \@EAEAEA\secondoftwoarguments + \fi\fi} + +\def\doifnotflagged#1% + {\@EA\ifx\csname\@flg@#1\endcsname\relax + \@EA\firstofoneargument + \else\ifcase\csname\@flg@#1\endcsname + \@EAEAEA\gobbleoneargument + \else + \@EAEAEA\firstofoneargument + \fi\fi} + +\def\inheritparameter[#1]#2[#3]#4[#5]% tag tokey fromkey % [bypasses k!prefix] + {\@EAEAEA\def\@EA\csname\@EA#1\@EA#3\@EA\endcsname\@EA + {\csname#1#5\endcsname}} + +% \buildarray[test][aa,bb,cc,dd,ee,ff] +% \setarrayelement{test}{1}{qq} +% \arrayelement{test}{1} +% \arraylength{test} +% +% \def\buildarray[#1][#2]% +% {\scratchcounter=0 +% \def\docommand##1% +% {\advance\scratchcounter by 1 +% \setvalue{@@aa#1\the\scratchcounter}{##1}}% +% \processcommalist[#2]\docommand +% \setevalue{@@aa#1}{\the\scratchcounter}}% +% +% \def\setarrayelement#1#2{\setvalue{@@aa#1#2}} +% \def\arrayelement #1#2{\getvalue{@@aa#1#2}} +% \def\arraylength #1{\getvalue{@@aa#1}} + +% \newsignal\junksignal +% +% \def\setjunksignal% +% {\ifhmode +% \hskip\junksignal +% \let\removejunkspaces\doremovejunkspaces +% \else +% \let\removejunkspaces\relax +% \fi} +% +% \def\doremovejunkspaces% +% {\doloop{\ifdim\lastskip=\junksignal\unskip\else\exitloop\fi}} + +% \def\doifnonzeropositiveelse#1#2#3% +% {\bgroup +% \setbox\scratchbox=\hbox{\scratchcounter=0#1}% +% \ifdim\wd\scratchbox=\!!zeropoint\egroup#2\else\egroup#3\fi} +% +% \def\dodoifnonzeropositiveelse#1#2\end#3#4% +% {\egroup +% \ifx#1\relax#3\else#4\fi} +% +% \def\doifnonzeropositiveelse#1% +% {\bgroup +% \afterassignment\dodoifnonzeropositiveelse\scratchcounter=0#1\relax\empty\end} + +\def\dodoifnonzeropositiveelse#1#2\end % #3#4% + {\ifx#1\relax + \ifcase\scratchcounter + \endgroup + \@EAEAEA\secondoftwoarguments + \else + \endgroup + \@EAEAEA\firstoftwoarguments + \fi + \else + \endgroup + \@EA\secondoftwoarguments + \fi} + +\def\doifnonzeropositiveelse#1% + {\begingroup\afterassignment\dodoifnonzeropositiveelse\scratchcounter=0#1\relax\empty\end} + +% here ? + +\def\dosetrawvalue #1#2#3{\@EA \def\csname#1#2\endcsname{#3}} +\def\dosetrawevalue#1#2#3{\@EA\edef\csname#1#2\endcsname{#3}} +\def\dosetrawgvalue#1#2#3{\@EA\gdef\csname#1#2\endcsname{#3}} +\def\dosetrawxvalue#1#2#3{\@EA\xdef\csname#1#2\endcsname{#3}} + +\def\getrawparameters {\dogetparameters\dosetrawvalue } +\def\getraweparameters {\dogetparameters\dosetrawevalue} +\def\getrawgparameters {\dogetparameters\dosetrawgvalue} +\def\getrawxparameters {\dogetparameters\dosetrawxvalue} + +\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete + +\def\splitskip#1% + {\scratchskip\zeropoint \!!plus \onepoint \!!minus \onepoint + \advance\scratchskip#1\relax % \relax is realy needed here + \expandafter\SPLITSKIP\the\scratchskip} + +{\catcode`\.=\@@other + \catcode`\p=\@@other + \catcode`\l=\@@other + \catcode`\u=\@@other + \catcode`\s=\@@other + \catcode`\m=\@@other + \catcode`\i=\@@other + \catcode`\n=\@@other + \catcode`\t=\@@other + \gdef\SPLITSKIP#1pt plus #2pt minus #3pt% + {\DOSPLITSKIP#1 #2 #3 }} + +% \def\DOSPLITSKIP#1 #2 #3 +% {\dimen0=#1pt\dimen2=#2pt\dimen4=#3pt +% \advance\dimen2 -\onepoint +% \advance\dimen4 -\onepoint} + +\def\DOSPLITSKIP#1 #2 #3 + {\dimen0=#1\onepoint + \dimen2=\dimexpr#2\onepoint-\onepoint\relax + \dimen4=\dimexpr#3\onepoint-\onepoint\relax} + +% \def\minimaxskip#1#2% +% {\splitskip#2\relax +% \scratchdimen=#2\relax +% #2=\scratchdimen +% \advance#2 by #1\relax} +% +% \def\maximizeskip% +% {\minimaxskip{-\dimen4}} +% +% \def\maximizeskip% +% {\minimaxskip{\dimen2}} +% +% \def\maximizespacing% +% {\maximizeskip\blankskipamount +% \maximizeskip\parskip +% \maximizeskip\ctxparskip +% \maximizeskip\baselineskip +% \maximizeskip\bigskipamount +% \maximizeskip\medskipamount +% \maximizeskip\smallskipamount} + +\newcount\modcounter + +%\def\DoMod #1by#2to#3% +% {\modcounter#1\divide\modcounter#2\multiply\modcounter#2% +% #3#1\advance#3 -\modcounter} +% +%\def\DoDiv #1by#2to#3% +% {#3#1\divide#3 #2\relax} + +\def\dosetmodulo#1#2#3% + {\modcounter#1\divide\modcounter#2\multiply\modcounter#2% + #3#1\advance#3-\modcounter} + +\def\dosetdivision#1#2#3% + {#3#1\divide#3 #2\relax} + +\def\DoMod#1by#2to#3{\dosetmodulo {#1}{#2}{#3}} +\def\DoDiv#1by#2to#3{\dosetdivision{#1}{#2}{#3}} + +\def\dounprotected#1\par + {#1\protect} + +\def\unprotected + {\unprotect\dounprotected} + +%D Standaard kan een spatie (zoals ~) uitrekken. Dit is in +%D overzichten niet altijd de bedoeling, vandaar: + +% \def\fixedspace{\hskip\interwordspace\relax} + +%\def\ExpandSecondAfter#1#2#3% +% {\!!toksa={#2}% +% \edef\!!stringa{#3}% +% \edef\expanded% +% {\noexpand#1{\the\!!toksa}{\!!stringa}}% +% \expanded} +% +%\def\ExpandThirdAfter#1#2#3#4% +% {\!!toksa={#2}% +% \!!toksb={#3}% +% \edef\!!stringa{#4}% +% \edef\expanded% +% {\noexpand#1{\the\!!toksa}{\the\!!toksb}{\!!stringa}}% +% \expanded} + +%\def\indirect#1#2#3% +% {\@EA#1\@EA#2\@EA{\@EA#3\csname\s!do\string#2\endcsname}% +% \@EA#1\csname\s!do\string#2\endcsname} +% +%\def\doubleemptied#1#2#3% +% {\indirect#1#2\dodoublempty} +% +%\indirect\def\stelietsin\dodoubleempty[#1][#2]% +% {...} +% +%\doubleemptied\def\stelietsin[#1][#2]% +% {...} + +% in mult-set +% +%\def\defaultsetup{def} +% +%\def\selectdefaultsetup#1#2% +% {\writestatus{setup}{choose #1 setupfile}% +% \bgroup +% \endlinechar=-1 +% \global\read16 to \usersetup +% \egroup +% \ifx\usersetup\empty +% \let\usersetup=\defaultsetup +% \fi +% \readfile{#2\usersetup}{}{}% +% \writestatus{setup}{loading #1 setupfile #2\usersetup}} + +% awaiting the definitive implementation + +\ifx\resettimer\undefined + \let\resettimer \relax + \newcount\elapsedtime +\fi + +\newcount\featuretest + +\def\testfeature#1#2% + {\def\dotestfeature + {\advance\featuretest \plusone + \ifnum\featuretest>#1\else#2\expandafter\dotestfeature\fi}% + \retestfeature} + +\def\retestfeature % timer support is new per 10/5/2005 + {\bgroup + \ifcase\interactionmode\let\wait\relax\fi + \writestatus\m!systems{starting feature test}\wait + \resettimer + \featuretest\zerocount \dotestfeature + \writestatus\m!systems{feature test done (\elapsedseconds s)}% + \wait + \egroup} + +\def\elapsedseconds{\expandafter\withoutpt\the\dimexpr\elapsedtime sp\relax} + +\def\showtimer#1% + {\writestatus{runtime}{\elapsedseconds\space s / #1}} + +% \edef\elapsedtime{\expandafter\withoutpt\the\dimexpr\elapsedtime\relax s}% +% \writestatus\m!systems{feature test done (\elapsedtime)}% + +\def\testfeatureonce#1#2% + {\let\wait\relax\testfeature{#1}{#2}\end} + +%D \macros +%D {adddimenregister,adddimenmacro} +%D +%D Instead of using numerous \type {\advance}'s, one can use +%D the next macros to add|/|subtract a series of dimensions +%D to a register or macro. +%D +%D \starttyping +%D \adddimenregister 10pt 5pt \paperwidth \to \somedimen +%D \adddimenmacro 10pt 5pt \paperwidth \to \bagger +%D \stoptyping + +% \newdimen\dimentoaddto + +% \def\adddimenregister#1\to#2% will be obsolete once full etex +% {\begingroup +% #2=\zeropoint +% \dimentoaddto\zeropoint +% \def\docommand% +% {\advance#2 \dimentoaddto +% \futurelet\next\dodocommand}% +% \def\dodocommand% +% {\ifx\next\relax +% \expanded{\endgroup#2=\the#2}% +% \else +% \@EA\afterassignment\@EA\docommand\@EA\dimentoaddto +% \fi}% +% \docommand#1\relax} + +% \def\adddimenmacro#1\to#2% +% {\adddimenregister#1\to\scratchdimen +% \edef#2{\the\scratchdimen}} + +%D \macros +%D {freezedimenmacro} +%D +%D This macro is use as: +%D +%D \starttyping +%D \freezedimenmacro\leftmargindistance +%D \stoptyping + +% \def\freezedimenmacro#1% +% {\scratchdimen#1\edef#1{\the\scratchdimen}} + +\def\freezedimenmacro#1% + {\edef#1{\the\dimexpr#1}} + +%D The next one is slower: +%D +%D \starttyping +%D \def\freezedimenmacro#1{\edef#1{\the\dimexpr(#1)}} +%D \stoptyping + +% \newcount\rawrecursecounter +% +% \def\rawrecurselevel{\the\rawrecursecounter}% +% +% \def\dorawrecurse#1#2% +% {\rawrecursecounter\plusone +% \let\oldrecurselevel\recurselevel +% \let\recurselevel\rawrecurselevel +% \def\dodorawrecurse +% {\ifnum\rawrecursecounter>#1\relax +% \let\recurselevel\oldrecurselevel +% \else +% #2\advance\rawrecursecounter \plusone +% \expandafter\dodorawrecurse +% \fi}% +% \dodorawrecurse} + +%D The next macro negates a macro (dimension or number, or actually, whatever. +%D It's a typical example of \type {\if} usage: +%D +%D \starttyping +%D \if-\whatever \else-\whatever\fi => else => -whatever +%D \if--\whatever\else-\whatever\fi => then => whatever +%D \stoptyping + +\def\negated#1{\if-#1\else-#1\fi} % does only work in macros or text + +% This permits things like ^\index{hans}^, where hans is +% duplicated in the text. + +\newif\ifduplicate + +\bgroup + +\gdef\checkduplication % in line with Knuth + {\ifmmode\expandafter^\else\expandafter\startduplication\fi} + +\gdef\insideduplication + {\ifmmode\expandafter^\else\expandafter\egroup\fi} + +\catcode`\^=\@@active + +\gdef\enableduplication + {\catcode`\^=\@@active \let^\checkduplication} + +\gdef\disableduplication + {\catcode`\^=\@@superscript} + +\gdef\startduplication + {\bgroup \duplicatetrue \let^\insideduplication} + +\egroup + +\def\gobbleassigndimen#1\\{} + +\def\assigndimen#1#2% + {\afterassignment\gobbleassigndimen#1=#2\!!zeropoint\\} + +\def\setusage#1% + {\@EA\let\csname#1\endcsname\iftrue} + +\def\resetusage#1% + {\@EA\let\csname#1\endcsname\iffalse} + +\beginTEX + +\def\ifusage#1% + {\@EA\ifx\csname#1\endcsname\relax + \resetusage{#1}% + \fi + \csname#1\endcsname} + +\endTEX + +\beginETEX \ifcsname + +\def\ifusage#1% + {\ifcsname#1\endcsname\else + \resetusage{#1}% + \fi + \csname#1\endcsname} + +\endETEX + +%D Very handy, more efficient than \type{{}}, and more readable +%D than \type {\empty}. + +\let\donothing\empty + +% The following macros are used in XML handling. + +% \long\def\dowithstringed#1#2#3#4% " ' space +% {\if#4"\@EA#1\else\if#4'\@EAEAEA#2\else\@EAEAEA#3\fi\fi#4} +% +% \def\unstringed +% {\dowithstringed\unstringdouble\unstringsingle\unstringspaced} +% +% \long\def\unstringdouble"#1"{#1} +% \long\def\unstringsingle'#1'{#1} +% \long\def\unstringspaced #1 {#1} +% +% \def\grabstring +% {\dowithstringed\grabstringdouble\grabstringsingle\grabstringspaced} +% +% \def\dowithgrabbedstring#1% +% {\def\@@dowithgrabbedstring{#1}% +% \afterassignment\@@dowithgrabbedstring\grabstring} +% +% \long\def\grabstringdouble"#1"{\scratchtoks{#1}} +% \long\def\grabstringsingle'#1'{\scratchtoks{#1}} +% \long\def\grabstringspaced #1 {\scratchtoks{#1}} + +\long\setvalue{@u@s@"}#1#2"{#2} \long\setvalue{@g@s@"}#1#2"{\scratchtoks{#2}} +\long\setvalue{@u@s@'}#1#2'{#2} \long\setvalue{@g@s@'}#1#2'{\scratchtoks{#2}} +\long\setvalue{@u@s@ }#1#2 {#2} \long\setvalue{@g@s@ }#1#2 {\scratchtoks{#2}} + +\long\def\unstringed#1{\csname\ifcsname @u@s@#1\endcsname @u@s@#1\else\s!empty\fi\endcsname#1} +\long\def\grabstring#1{\csname\ifcsname @g@s@#1\endcsname @g@s@#1\else\s!empty\fi\endcsname#1} + +\def\dowithgrabbedstring#1% + {\def\@@dowithgrabbedstring{#1}% + \afterassignment\@@dowithgrabbedstring\grabstring} + +\def\expifequalelse#1#2% + {\@@ifequal#1\relax\relax\@@and#2\relax\relax\@@then} + +\def\@@ifequal#1#2\@@and#3% + {\ifx#1\relax + \ifx#3\relax + \@EAEAEA\@@if@@equal@@true + \else + \@EAEAEA\@@if@@equal@@false + \fi + \else + \ifx#3\relax + \@EAEAEAEAEAEA\@@if@@equal@@false + \else\ifx#1#3% + % go on + \else + \@EAEAEAEAEAEA\@@if@@equal@@false + \fi\fi + \fi + \@@ifequal#2\@@and} + +\long\def\@@if@@equal@@true #1\@@then#2#3{#2} +\long\def\@@if@@equal@@false#1\@@then#2#3{#3} + +%D new stuff : + +\def\partialexpanded#1% + {\let\@@notexpanded\noexpand + \long\xdef\@@expanded{\noexpand#1}% + \let\@@notexpanded\empty + \@@expanded} + +% for Simon ; watch how we make them fully expandable (i.e. +% no \type {\relax}es) popping up + +\def\@do@the@number@#1\relax#2\end{#1} + +\def\@the@number@#1{\@EA\@do@the@number@\number#1\relax\end} + +\def\doifnum#1#2% + {\ifnum#1=\@the@number@{#2} % space needed + \expandafter\firstofoneargument + \else + \expandafter\gobbleoneargument + \fi} + +\def\doifnotnum#1#2% + {\ifnum#1=\@the@number@{#2} % space needed + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +\def\doifelsenum#1#2% + {\ifnum#1=\@the@number@{#2} % space needed + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +% \edef\xxxx{\doifnum{1}{2}{no}} \show \xxxx +% \edef\xxxx{\doifnum{2}{2}{yes}} \show \xxxx +% \scratchcounter0 \edef\xxxx{\doifnum{1}{\scratchcounter}{no}} \show \xxxx +% \scratchcounter1 \edef\xxxx{\doifnum{1}{\scratchcounter}{yes}} \show \xxxx + +\def\appended#1#2#3{\@EA#1\@EA#2\@EA{#2#3}} +\def\appendvalue #1{\@EA\appended\@EA \def\csname#1\endcsname} +\def\appendgvalue#1{\@EA\appended\@EA\gdef\csname#1\endcsname} + +\def\prepended#1#2#3{\scratchtoks{#3}\@EA\@EA\@EA#1\@EA\@EA\@EA#2\@EA\@EA\@EA{\@EA\the\@EA\scratchtoks#2}} +\def\prependvalue #1{\@EA\prepended\@EA \def\csname#1\endcsname} +\def\prependgvalue#1{\@EA\prepended\@EA\gdef\csname#1\endcsname} + +%D \macros +%D {compresscommacommandnrs,compresscommalistnrs,compressedcommalistnrs, +%D compresscommacommand,compresscommalist,compressedcommalist, +%D reversecommacommand,reversecommalist,reversedcommalist} +%D +%D The following two list processing macros are needed by Taco's +%D bibliography module. The numbers compressor converts the +%D list in a list of ranges. The normal compressor remove duplicate +%D and empty entries. + +\def\compresscommalistnrs[#1]% + {\let\compressedlist\empty + \!!counta\maxdimen + \!!countb\maxdimen + \processcommalist[#1]\docompresslistnrs + \ifnum\!!counta=\maxdimen\else\dodocompresslistnrs\fi} + +\def\compresscommacommandnrs[#1]% + {\expanded{\compresscommalistnrs[#1]}} + +\def\docompresslistnrs#1% + {\edef\commalistelement{#1}% + \ifx\commalistelement\empty\else + \ifnum\!!counta=\maxdimen + \!!counta\commalistelement\relax + \!!countb\!!counta + \else + \advance\!!countb\plusone + \ifnum\commalistelement>\!!countb + \advance\!!countb\minusone + \dodocompresslistnrs + \!!counta\commalistelement\relax + \!!countb\!!counta + \fi + \fi + \fi} + +\def\dodocompresslistnrs + {\edef\compressedlist + {\ifx\compressedlist\empty\else\compressedlist,\fi + {\the\!!counta}{\ifnum\!!countb>\!!counta\the\!!countb\fi}}} + +%D \def\test#1{{\tttf#1->\compresscommalistnrs[#1]\defconvertedcommand\ascii\compressedlist\ascii}} +%D \startlines +%D \test{} +%D \test{1} +%D \test{1,3} +%D \test{1,3,4} +%D \test{1,3,3,4,5} +%D \test{1,3,3,4,5,8} +%D \test{1,3,3,4,5,5,8,10} +%D \test{1,3,4,5,8,10,11} +%D \test{1,,3,,4,,5,,8,,10,,11,} +%D \stoplines + +\def\compresscommalist[#1]% + {\let\compressedlist\empty + \let\!!stringa\empty + \processcommalist[#1]\docompresslist} + +\def\compresscommacommand[#1]% + {\expanded{\compresscommalist[#1]}} + +\def\docompresslist#1% + {\edef\commalistelement{#1}% + \ifx\commalistelement\empty \else + \ifx\!!stringa\commalistelement \else + \ifx\compressedlist\empty + \def\compressedlist{#1}% + \else + \appended\def\compressedlist{,#1}% + \fi + \let\!!stringa\commalistelement + \fi + \fi} + +%D \def\test#1{{\tttf#1->\compresscommalist[#1]\defconvertedcommand\ascii\compressedlist\ascii}} +%D \startlines +%D \test{} +%D \test{1} +%D \test{1,3} +%D \test{1,3,4} +%D \test{1,3,3,4,5} +%D \test{1,3,3,4,5,8} +%D \test{1,3,3,4,5,5,8,10} +%D \test{1,3,4,5,8,10,11} +%D \test{1,,3,,4,,5,,8,,10,,11,} +%D \stoplines + +\def\reversecommalist[#1]% + {\let\reversedlist\empty + \processcommalist[#1]\doreverselist} + +\def\doreverselist#1% + {\ifx\reversedlist\empty + \def\reversedlist{#1}% + \else + \prepended\def\reversedlist{#1,}% + \fi} + +\def\reversecommacommand[#1]% + {\expanded{\reversecommalist[#1]}} + +%D \def\test#1{{\tttf#1->\reversecommalist[#1]\defconvertedcommand\ascii\reversedlist\ascii}} +%D \startlines +%D \test{} +%D \test{1} +%D \test{1,3} +%D \test{1,3,4} +%D \test{1,3,3,4,5} +%D \test{1,3,3,4,5,8} +%D \test{1,3,3,4,5,5,8,10} +%D \test{1,3,4,5,8,10,11} +%D \test{1,,3,,4,,5,,8,,10,,11,} +%D \stoplines + +%D \macros +%D {stripstring} +%D +%D Needed in bookmarks: +%D +%D \starttyping +%D {\sanitizePDFdocencoding test \CONTEXT\ test \to\oeps\stripstring\oeps\tttf[\oeps]} +%D \stoptyping + +\def\stripstring#1% #1 is \cs + {\bgroup + \defconvertedcommand\ascii{#1}% + \global\let\globalascii\empty + \donefalse + \expandafter\handletokens\ascii\with\dostripstring + \egroup + \let#1\globalascii} + +\def\dostripstring#1% + {\ifx#1\blankspace + \donetrue + \else + \ifdone\ifx\globalascii\empty\else + \xdef\globalascii{\globalascii\space}% + \donefalse + \fi\fi + \xdef\globalascii{\globalascii#1}% + \fi} + +%D \macros +%D {dowithrange} +%D +%D This one is for Mojca Miklavec, who made me aware of the fact that +%D \type {page-imp.tex} was not the best place to hide it. + +\def\dowithrange#1#2% #2 takes number + {\splitstring#1\at:\to\fromrange\and\torange + \ifx\torange\empty\let\torange\fromrange\fi + \dostepwiserecurse\fromrange\torange1{#2{\recurselevel}}} + +%D \macros {uncompresslist} +%D +%D When given a list like \type{1,4-7,9} as argument, this macro +%D will store the expanded commalist in \type{\uncompressedlist}. +%D +%D \startbuffer +%D \def\MojcaHasToDoTheTasks[#1]#2% +%D {{\uncompresslist[#1]% +%D \def\processitem##1{I have to do ##1 #2\par}% +%D \processcommacommand[\uncompressedlist]\processitem}} +%D +%D \MojcaHasToDoTheTasks [1-4,7,9-11] {until tomorrow} +%D \stopbuffer +%D +%D Here is an example of how to use \type {\uncompresslist}: +%D \typebuffer +%D +%D The output of this is: +%D +%D \getbuffer + +\beginETEX \numexpr + +\def\uncompresslist[#1]% by TH + {\let\uncompressedlist\empty + \def\docompressedlistitem##1-##2-% + {\@EA\dorecurse\@EA + {\the\numexpr1+##2-##1\relax}% + {\@EA\appendtocommalist\@EA{\the\numexpr##1-1+####1\relax}\uncompressedlist}}% + \def\douncompresslist##1% + {\doifinstringelse{-}{##1} + {\docompressedlistitem##1-} + {\appendtocommalist{##1}\uncompressedlist}}% + \processcommalist[#1]\douncompresslist} + +\endETEX + +\beginTEX + +\def\uncompresslist[#1]% + {\def\uncompressedlist{#1}} + +\endTEX + +%D \macros +%D {ignoreimplicitspaces} +%D +%D \startbuffer +%D \def\whatever[#1]{\expanded{\definedfont[#1 at 12pt]}\ignorespaces} +%D {a\whatever[Serif]b a\whatever[Serif] b a\whatever[Serif]\space b} +%D \def\whatever[#1]{\expanded{\definedfont[#1 at 12pt]}\ignoreimplicitspaces} +%D {a\whatever[Serif]b a\whatever[Serif] b a\whatever[Serif]\space b} +%D \stopbuffer +%D +%D \typebuffer \getbuffer + +\def\ignoreimplicitspaces + {\doifnextcharelse\relax\relax\relax} + +% new +% +% \startnointerference +% all kind of code +% \stopnointerference + +\newbox\nointerferencebox + +\def\startnointerference + {\setbox\nointerferencebox\vbox + \bgroup} + +\def\stopnointerference + {\egroup + \setbox\nointerferencebox\emptybox} + +\protect \endinput + + +% \def\appendtovaluelist#1#2% +% {\ifcsname#1\endcsname +% \expandafter\ifx\csname#1\endcsname\empty +% \expandafter\def\csname#1\endcsname{#2}% +% \else +% \expandafter\def\csname#1\expandafter\expandafter\expandafter\endcsname +% \expandafter\expandafter\expandafter{\csname#1\endcsname,#2}% +% \fi +% \else +% \expandafter\def\csname#1\endcsname{#2}% +% \fi} +% +% or +% +% \def\appendtovaluelist#1% +% {\ifcsname#1\endcsname +% \expandafter\ifx\csname#1\endcsname\empty +% \expandafter\noappendtovaluelist\csname#1\expandafter\expandafter\expandafter\endcsname +% \else +% \expandafter\doappendtovaluelist\csname#1\expandafter\expandafter\expandafter\endcsname +% \fi +% \else +% \expandafter\noappendtovaluelist\csname#1\expandafter\endcsname +% \fi} + +% \def\doappendtovaluelist#1#2{\expandafter\def\expandafter#1\expandafter{#1,#2}} +% \def\noappendtovaluelist#1#2{\def#1{#2}} + +% \appendtovaluelist{mylist}{aap} +% \appendtovaluelist{mylist}{noot} +% \appendtovaluelist{mylist}{mies} + +% \showvalue{mylist} diff --git a/tex/context/base/syst-new.tex b/tex/context/base/syst-new.tex deleted file mode 100644 index 53ba18ffd..000000000 --- a/tex/context/base/syst-new.tex +++ /dev/null @@ -1,868 +0,0 @@ -%D \module -%D [ file=syst-new, -%D version=1997.01.03, -%D title=\CONTEXT\ Support Macros, -%D subtitle=New Ones, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Code from this module will move. For instance to -%D syst-dat.tex (datastructures). - -\unprotect - -% pretty ugly but fast - -% \copycsname xxx\endcsname\csname ..\endcsname - -\def\copycsname{\@EA\@EA\@EA\let\@EA\@EA\csname} - -% \letcscsname \crap \csname ..\endcsname -% \letcsnamecs \csname ..\endcsname\crap -% \letcsnamecsname\csname ..\endcsname\csname ..\endcsname - -\def\letcscsname {\@EA\let\@EA} -\def\letcsnamecs {\@EA\let} -\def\letcsnamecsname{\@EA\@EA\@EA\let\@EA\@EA} - -% another one, add an item to a commalist - -\def\addvalue#1#2% cs item - {\ifundefined{#1}\@EA\let\csname#1\endcsname\empty\fi - \expanded{\addtocommalist{#2}\@EA\noexpand\csname#1\endcsname}} - -% faster, and looks okay - -\def\unspaced#1% - {\dounspaced#1\end} - -\def\dounspaced#1% - {\ifx#1\end - \@EA\gobbleoneargument - \else - \ifx#1\blankspace\else#1\fi - \fi - \dounspaced} - -\def\unspaceargument#1\to#2% - {\defconvertedargument#2{#1}% - \@EA\edef\@EA#2\@EA{\@EA\unspaced\@EA{#2}}} - -\def\unspaceafter#1#2% - {\edef\ascii{\dounspaced#2\end}\@EA#1\@EA{\ascii}} - -% etex, much faster -% -% \def\unspaceargument#1\to#2% -% {\scratchcounter\catcode'32\catcode32=\@@ignore -% \scantokens{\edef#2{#1}}% -% \catcode32=\scratchcounter} - -\def\unspaceafter#1#2% - {\edef\ascii{\dounspaced#2\end}\@EA#1\@EA{\ascii}} - -% sometimes handy: - -\def\doifhasspaceelse#1% - {\edef\!!stringa{#1}% - \expanded{\dodoifhasspaceelse#1\space}\empty\relax} - -\def\dodoifhasspaceelse#1 #2#3\relax % \space\empty\relax - {\ifx\!!stringa\space - \@EA\firstoftwoarguments - \else\ifx#2\empty - \@EAEAEA\secondoftwoarguments - \else - \@EAEAEA\firstoftwoarguments - \fi\fi} - -% this will replace loadfile once and alike !!! todo - -\def\@flg@{@flg@} - -\def\setflag#1% - {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\zerocount} - -\def\resetflag#1% - {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\plusone} - -\let\ifflagged\ifcase - -\def\flag#1{\csname\@flg@#1\endcsname} - -\def\doifelseflagged#1% - {\@EA\ifx\csname\@flg@#1\endcsname\relax - \@EA\secondoftwoarguments - \else\ifcase\csname\@flg@#1\endcsname - \@EAEAEA\firstoftwoarguments - \else - \@EAEAEA\secondoftwoarguments - \fi\fi} - -\def\doifnotflagged#1% - {\@EA\ifx\csname\@flg@#1\endcsname\relax - \@EA\firstofoneargument - \else\ifcase\csname\@flg@#1\endcsname - \@EAEAEA\gobbleoneargument - \else - \@EAEAEA\firstofoneargument - \fi\fi} - -\def\inheritparameter[#1]#2[#3]#4[#5]% tag tokey fromkey % [bypasses k!prefix] - {\@EAEAEA\def\@EA\csname\@EA#1\@EA#3\@EA\endcsname\@EA - {\csname#1#5\endcsname}} - -% \buildarray[test][aa,bb,cc,dd,ee,ff] -% \setarrayelement{test}{1}{qq} -% \arrayelement{test}{1} -% \arraylength{test} -% -% \def\buildarray[#1][#2]% -% {\scratchcounter=0 -% \def\docommand##1% -% {\advance\scratchcounter by 1 -% \setvalue{@@aa#1\the\scratchcounter}{##1}}% -% \processcommalist[#2]\docommand -% \setevalue{@@aa#1}{\the\scratchcounter}}% -% -% \def\setarrayelement#1#2{\setvalue{@@aa#1#2}} -% \def\arrayelement #1#2{\getvalue{@@aa#1#2}} -% \def\arraylength #1{\getvalue{@@aa#1}} - -% \newsignal\junksignal -% -% \def\setjunksignal% -% {\ifhmode -% \hskip\junksignal -% \let\removejunkspaces\doremovejunkspaces -% \else -% \let\removejunkspaces\relax -% \fi} -% -% \def\doremovejunkspaces% -% {\doloop{\ifdim\lastskip=\junksignal\unskip\else\exitloop\fi}} - -% \def\doifnonzeropositiveelse#1#2#3% -% {\bgroup -% \setbox\scratchbox=\hbox{\scratchcounter=0#1}% -% \ifdim\wd\scratchbox=\!!zeropoint\egroup#2\else\egroup#3\fi} -% -% \def\dodoifnonzeropositiveelse#1#2\end#3#4% -% {\egroup -% \ifx#1\relax#3\else#4\fi} -% -% \def\doifnonzeropositiveelse#1% -% {\bgroup -% \afterassignment\dodoifnonzeropositiveelse\scratchcounter=0#1\relax\empty\end} - -\def\dodoifnonzeropositiveelse#1#2\end % #3#4% - {\ifx#1\relax - \ifcase\scratchcounter - \endgroup - \@EAEAEA\secondoftwoarguments - \else - \endgroup - \@EAEAEA\firstoftwoarguments - \fi - \else - \endgroup - \@EA\secondoftwoarguments - \fi} - -\def\doifnonzeropositiveelse#1% - {\begingroup\afterassignment\dodoifnonzeropositiveelse\scratchcounter=0#1\relax\empty\end} - -% here ? - -\def\dosetrawvalue #1#2#3{\@EA \def\csname#1#2\endcsname{#3}} -\def\dosetrawevalue#1#2#3{\@EA\edef\csname#1#2\endcsname{#3}} -\def\dosetrawgvalue#1#2#3{\@EA\gdef\csname#1#2\endcsname{#3}} -\def\dosetrawxvalue#1#2#3{\@EA\xdef\csname#1#2\endcsname{#3}} - -\def\getrawparameters {\dogetparameters\dosetrawvalue } -\def\getraweparameters {\dogetparameters\dosetrawevalue} -\def\getrawgparameters {\dogetparameters\dosetrawgvalue} -\def\getrawxparameters {\dogetparameters\dosetrawxvalue} - -\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete - -\def\splitskip#1% - {\scratchskip\zeropoint \!!plus \onepoint \!!minus \onepoint - \advance\scratchskip#1\relax % \relax is realy needed here - \expandafter\SPLITSKIP\the\scratchskip} - -{\catcode`\.=\@@other - \catcode`\p=\@@other - \catcode`\l=\@@other - \catcode`\u=\@@other - \catcode`\s=\@@other - \catcode`\m=\@@other - \catcode`\i=\@@other - \catcode`\n=\@@other - \catcode`\t=\@@other - \gdef\SPLITSKIP#1pt plus #2pt minus #3pt% - {\DOSPLITSKIP#1 #2 #3 }} - -% \def\DOSPLITSKIP#1 #2 #3 -% {\dimen0=#1pt\dimen2=#2pt\dimen4=#3pt -% \advance\dimen2 -\onepoint -% \advance\dimen4 -\onepoint} - -\def\DOSPLITSKIP#1 #2 #3 - {\dimen0=#1\onepoint - \dimen2=\dimexpr#2\onepoint-\onepoint\relax - \dimen4=\dimexpr#3\onepoint-\onepoint\relax} - -% \def\minimaxskip#1#2% -% {\splitskip#2\relax -% \scratchdimen=#2\relax -% #2=\scratchdimen -% \advance#2 by #1\relax} -% -% \def\maximizeskip% -% {\minimaxskip{-\dimen4}} -% -% \def\maximizeskip% -% {\minimaxskip{\dimen2}} -% -% \def\maximizespacing% -% {\maximizeskip\blankskipamount -% \maximizeskip\parskip -% \maximizeskip\ctxparskip -% \maximizeskip\baselineskip -% \maximizeskip\bigskipamount -% \maximizeskip\medskipamount -% \maximizeskip\smallskipamount} - -\newcount\modcounter - -%\def\DoMod #1by#2to#3% -% {\modcounter#1\divide\modcounter#2\multiply\modcounter#2% -% #3#1\advance#3 -\modcounter} -% -%\def\DoDiv #1by#2to#3% -% {#3#1\divide#3 #2\relax} - -\def\dosetmodulo#1#2#3% - {\modcounter#1\divide\modcounter#2\multiply\modcounter#2% - #3#1\advance#3-\modcounter} - -\def\dosetdivision#1#2#3% - {#3#1\divide#3 #2\relax} - -\def\DoMod#1by#2to#3{\dosetmodulo {#1}{#2}{#3}} -\def\DoDiv#1by#2to#3{\dosetdivision{#1}{#2}{#3}} - -\def\dounprotected#1\par - {#1\protect} - -\def\unprotected - {\unprotect\dounprotected} - -%D Standaard kan een spatie (zoals ~) uitrekken. Dit is in -%D overzichten niet altijd de bedoeling, vandaar: - -% \def\fixedspace{\hskip\interwordspace\relax} - -%\def\ExpandSecondAfter#1#2#3% -% {\!!toksa={#2}% -% \edef\!!stringa{#3}% -% \edef\expanded% -% {\noexpand#1{\the\!!toksa}{\!!stringa}}% -% \expanded} -% -%\def\ExpandThirdAfter#1#2#3#4% -% {\!!toksa={#2}% -% \!!toksb={#3}% -% \edef\!!stringa{#4}% -% \edef\expanded% -% {\noexpand#1{\the\!!toksa}{\the\!!toksb}{\!!stringa}}% -% \expanded} - -%\def\indirect#1#2#3% -% {\@EA#1\@EA#2\@EA{\@EA#3\csname\s!do\string#2\endcsname}% -% \@EA#1\csname\s!do\string#2\endcsname} -% -%\def\doubleemptied#1#2#3% -% {\indirect#1#2\dodoublempty} -% -%\indirect\def\stelietsin\dodoubleempty[#1][#2]% -% {...} -% -%\doubleemptied\def\stelietsin[#1][#2]% -% {...} - -% in mult-set -% -%\def\defaultsetup{def} -% -%\def\selectdefaultsetup#1#2% -% {\writestatus{setup}{choose #1 setupfile}% -% \bgroup -% \endlinechar=-1 -% \global\read16 to \usersetup -% \egroup -% \ifx\usersetup\empty -% \let\usersetup=\defaultsetup -% \fi -% \readfile{#2\usersetup}{}{}% -% \writestatus{setup}{loading #1 setupfile #2\usersetup}} - -% awaiting the definitive implementation - -\ifx\resettimer\undefined - \let\resettimer \relax - \newcount\elapsedtime -\fi - -\newcount\featuretest - -\def\testfeature#1#2% - {\def\dotestfeature - {\advance\featuretest \plusone - \ifnum\featuretest>#1\else#2\expandafter\dotestfeature\fi}% - \retestfeature} - -\def\retestfeature % timer support is new per 10/5/2005 - {\bgroup - \ifcase\interactionmode\let\wait\relax\fi - \writestatus\m!systems{starting feature test}\wait - \resettimer - \featuretest\zerocount \dotestfeature - \writestatus\m!systems{feature test done (\elapsedseconds s)}% - \wait - \egroup} - -\def\elapsedseconds{\expandafter\withoutpt\the\dimexpr\elapsedtime sp\relax} - -\def\showtimer#1% - {\writestatus{runtime}{\elapsedseconds\space s / #1}} - -% \edef\elapsedtime{\expandafter\withoutpt\the\dimexpr\elapsedtime\relax s}% -% \writestatus\m!systems{feature test done (\elapsedtime)}% - -\def\testfeatureonce#1#2% - {\let\wait\relax\testfeature{#1}{#2}\end} - -%D \macros -%D {adddimenregister,adddimenmacro} -%D -%D Instead of using numerous \type {\advance}'s, one can use -%D the next macros to add|/|subtract a series of dimensions -%D to a register or macro. -%D -%D \starttyping -%D \adddimenregister 10pt 5pt \paperwidth \to \somedimen -%D \adddimenmacro 10pt 5pt \paperwidth \to \bagger -%D \stoptyping - -% \newdimen\dimentoaddto - -% \def\adddimenregister#1\to#2% will be obsolete once full etex -% {\begingroup -% #2=\zeropoint -% \dimentoaddto\zeropoint -% \def\docommand% -% {\advance#2 \dimentoaddto -% \futurelet\next\dodocommand}% -% \def\dodocommand% -% {\ifx\next\relax -% \expanded{\endgroup#2=\the#2}% -% \else -% \@EA\afterassignment\@EA\docommand\@EA\dimentoaddto -% \fi}% -% \docommand#1\relax} - -% \def\adddimenmacro#1\to#2% -% {\adddimenregister#1\to\scratchdimen -% \edef#2{\the\scratchdimen}} - -%D \macros -%D {freezedimenmacro} -%D -%D This macro is use as: -%D -%D \starttyping -%D \freezedimenmacro\leftmargindistance -%D \stoptyping - -% \def\freezedimenmacro#1% -% {\scratchdimen#1\edef#1{\the\scratchdimen}} - -\def\freezedimenmacro#1% - {\edef#1{\the\dimexpr#1}} - -%D The next one is slower: -%D -%D \starttyping -%D \def\freezedimenmacro#1{\edef#1{\the\dimexpr(#1)}} -%D \stoptyping - -% \newcount\rawrecursecounter -% -% \def\rawrecurselevel{\the\rawrecursecounter}% -% -% \def\dorawrecurse#1#2% -% {\rawrecursecounter\plusone -% \let\oldrecurselevel\recurselevel -% \let\recurselevel\rawrecurselevel -% \def\dodorawrecurse -% {\ifnum\rawrecursecounter>#1\relax -% \let\recurselevel\oldrecurselevel -% \else -% #2\advance\rawrecursecounter \plusone -% \expandafter\dodorawrecurse -% \fi}% -% \dodorawrecurse} - -%D The next macro negates a macro (dimension or number, or actually, whatever. -%D It's a typical example of \type {\if} usage: -%D -%D \starttyping -%D \if-\whatever \else-\whatever\fi => else => -whatever -%D \if--\whatever\else-\whatever\fi => then => whatever -%D \stoptyping - -\def\negated#1{\if-#1\else-#1\fi} % does only work in macros or text - -% This permits things like ^\index{hans}^, where hans is -% duplicated in the text. - -\newif\ifduplicate - -\bgroup - -\gdef\checkduplication % in line with Knuth - {\ifmmode\expandafter^\else\expandafter\startduplication\fi} - -\gdef\insideduplication - {\ifmmode\expandafter^\else\expandafter\egroup\fi} - -\catcode`\^=\@@active - -\gdef\enableduplication - {\catcode`\^=\@@active \let^\checkduplication} - -\gdef\disableduplication - {\catcode`\^=\@@superscript} - -\gdef\startduplication - {\bgroup \duplicatetrue \let^\insideduplication} - -\egroup - -\def\gobbleassigndimen#1\\{} - -\def\assigndimen#1#2% - {\afterassignment\gobbleassigndimen#1=#2\!!zeropoint\\} - -\def\setusage#1% - {\@EA\let\csname#1\endcsname\iftrue} - -\def\resetusage#1% - {\@EA\let\csname#1\endcsname\iffalse} - -\beginTEX - -\def\ifusage#1% - {\@EA\ifx\csname#1\endcsname\relax - \resetusage{#1}% - \fi - \csname#1\endcsname} - -\endTEX - -\beginETEX \ifcsname - -\def\ifusage#1% - {\ifcsname#1\endcsname\else - \resetusage{#1}% - \fi - \csname#1\endcsname} - -\endETEX - -%D Very handy, more efficient than \type{{}}, and more readable -%D than \type {\empty}. - -\let\donothing\empty - -% The following macros are used in XML handling. - -% \long\def\dowithstringed#1#2#3#4% " ' space -% {\if#4"\@EA#1\else\if#4'\@EAEAEA#2\else\@EAEAEA#3\fi\fi#4} -% -% \def\unstringed -% {\dowithstringed\unstringdouble\unstringsingle\unstringspaced} -% -% \long\def\unstringdouble"#1"{#1} -% \long\def\unstringsingle'#1'{#1} -% \long\def\unstringspaced #1 {#1} -% -% \def\grabstring -% {\dowithstringed\grabstringdouble\grabstringsingle\grabstringspaced} -% -% \def\dowithgrabbedstring#1% -% {\def\@@dowithgrabbedstring{#1}% -% \afterassignment\@@dowithgrabbedstring\grabstring} -% -% \long\def\grabstringdouble"#1"{\scratchtoks{#1}} -% \long\def\grabstringsingle'#1'{\scratchtoks{#1}} -% \long\def\grabstringspaced #1 {\scratchtoks{#1}} - -\long\setvalue{@u@s@"}#1#2"{#2} \long\setvalue{@g@s@"}#1#2"{\scratchtoks{#2}} -\long\setvalue{@u@s@'}#1#2'{#2} \long\setvalue{@g@s@'}#1#2'{\scratchtoks{#2}} -\long\setvalue{@u@s@ }#1#2 {#2} \long\setvalue{@g@s@ }#1#2 {\scratchtoks{#2}} - -\long\def\unstringed#1{\csname\ifcsname @u@s@#1\endcsname @u@s@#1\else\s!empty\fi\endcsname#1} -\long\def\grabstring#1{\csname\ifcsname @g@s@#1\endcsname @g@s@#1\else\s!empty\fi\endcsname#1} - -\def\dowithgrabbedstring#1% - {\def\@@dowithgrabbedstring{#1}% - \afterassignment\@@dowithgrabbedstring\grabstring} - -\def\expifequalelse#1#2% - {\@@ifequal#1\relax\relax\@@and#2\relax\relax\@@then} - -\def\@@ifequal#1#2\@@and#3% - {\ifx#1\relax - \ifx#3\relax - \@EAEAEA\@@if@@equal@@true - \else - \@EAEAEA\@@if@@equal@@false - \fi - \else - \ifx#3\relax - \@EAEAEAEAEAEA\@@if@@equal@@false - \else\ifx#1#3% - % go on - \else - \@EAEAEAEAEAEA\@@if@@equal@@false - \fi\fi - \fi - \@@ifequal#2\@@and} - -\long\def\@@if@@equal@@true #1\@@then#2#3{#2} -\long\def\@@if@@equal@@false#1\@@then#2#3{#3} - -%D new stuff : - -\def\partialexpanded#1% - {\let\@@notexpanded\noexpand - \long\xdef\@@expanded{\noexpand#1}% - \let\@@notexpanded\empty - \@@expanded} - -% for Simon ; watch how we make them fully expandable (i.e. -% no \type {\relax}es) popping up - -\def\@do@the@number@#1\relax#2\end{#1} - -\def\@the@number@#1{\@EA\@do@the@number@\number#1\relax\end} - -\def\doifnum#1#2% - {\ifnum#1=\@the@number@{#2} % space needed - \expandafter\firstofoneargument - \else - \expandafter\gobbleoneargument - \fi} - -\def\doifnotnum#1#2% - {\ifnum#1=\@the@number@{#2} % space needed - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -\def\doifelsenum#1#2% - {\ifnum#1=\@the@number@{#2} % space needed - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -% \edef\xxxx{\doifnum{1}{2}{no}} \show \xxxx -% \edef\xxxx{\doifnum{2}{2}{yes}} \show \xxxx -% \scratchcounter0 \edef\xxxx{\doifnum{1}{\scratchcounter}{no}} \show \xxxx -% \scratchcounter1 \edef\xxxx{\doifnum{1}{\scratchcounter}{yes}} \show \xxxx - -\def\appended#1#2#3{\@EA#1\@EA#2\@EA{#2#3}} -\def\appendvalue #1{\@EA\appended\@EA \def\csname#1\endcsname} -\def\appendgvalue#1{\@EA\appended\@EA\gdef\csname#1\endcsname} - -\def\prepended#1#2#3{\scratchtoks{#3}\@EA\@EA\@EA#1\@EA\@EA\@EA#2\@EA\@EA\@EA{\@EA\the\@EA\scratchtoks#2}} -\def\prependvalue #1{\@EA\prepended\@EA \def\csname#1\endcsname} -\def\prependgvalue#1{\@EA\prepended\@EA\gdef\csname#1\endcsname} - -%D \macros -%D {compresscommacommandnrs,compresscommalistnrs,compressedcommalistnrs, -%D compresscommacommand,compresscommalist,compressedcommalist, -%D reversecommacommand,reversecommalist,reversedcommalist} -%D -%D The following two list processing macros are needed by Taco's -%D bibliography module. The numbers compressor converts the -%D list in a list of ranges. The normal compressor remove duplicate -%D and empty entries. - -\def\compresscommalistnrs[#1]% - {\let\compressedlist\empty - \!!counta\maxdimen - \!!countb\maxdimen - \processcommalist[#1]\docompresslistnrs - \ifnum\!!counta=\maxdimen\else\dodocompresslistnrs\fi} - -\def\compresscommacommandnrs[#1]% - {\expanded{\compresscommalistnrs[#1]}} - -\def\docompresslistnrs#1% - {\edef\commalistelement{#1}% - \ifx\commalistelement\empty\else - \ifnum\!!counta=\maxdimen - \!!counta\commalistelement\relax - \!!countb\!!counta - \else - \advance\!!countb\plusone - \ifnum\commalistelement>\!!countb - \advance\!!countb\minusone - \dodocompresslistnrs - \!!counta\commalistelement\relax - \!!countb\!!counta - \fi - \fi - \fi} - -\def\dodocompresslistnrs - {\edef\compressedlist - {\ifx\compressedlist\empty\else\compressedlist,\fi - {\the\!!counta}{\ifnum\!!countb>\!!counta\the\!!countb\fi}}} - -%D \def\test#1{{\tttf#1->\compresscommalistnrs[#1]\defconvertedcommand\ascii\compressedlist\ascii}} -%D \startlines -%D \test{} -%D \test{1} -%D \test{1,3} -%D \test{1,3,4} -%D \test{1,3,3,4,5} -%D \test{1,3,3,4,5,8} -%D \test{1,3,3,4,5,5,8,10} -%D \test{1,3,4,5,8,10,11} -%D \test{1,,3,,4,,5,,8,,10,,11,} -%D \stoplines - -\def\compresscommalist[#1]% - {\let\compressedlist\empty - \let\!!stringa\empty - \processcommalist[#1]\docompresslist} - -\def\compresscommacommand[#1]% - {\expanded{\compresscommalist[#1]}} - -\def\docompresslist#1% - {\edef\commalistelement{#1}% - \ifx\commalistelement\empty \else - \ifx\!!stringa\commalistelement \else - \ifx\compressedlist\empty - \def\compressedlist{#1}% - \else - \appended\def\compressedlist{,#1}% - \fi - \let\!!stringa\commalistelement - \fi - \fi} - -%D \def\test#1{{\tttf#1->\compresscommalist[#1]\defconvertedcommand\ascii\compressedlist\ascii}} -%D \startlines -%D \test{} -%D \test{1} -%D \test{1,3} -%D \test{1,3,4} -%D \test{1,3,3,4,5} -%D \test{1,3,3,4,5,8} -%D \test{1,3,3,4,5,5,8,10} -%D \test{1,3,4,5,8,10,11} -%D \test{1,,3,,4,,5,,8,,10,,11,} -%D \stoplines - -\def\reversecommalist[#1]% - {\let\reversedlist\empty - \processcommalist[#1]\doreverselist} - -\def\doreverselist#1% - {\ifx\reversedlist\empty - \def\reversedlist{#1}% - \else - \prepended\def\reversedlist{#1,}% - \fi} - -\def\reversecommacommand[#1]% - {\expanded{\reversecommalist[#1]}} - -%D \def\test#1{{\tttf#1->\reversecommalist[#1]\defconvertedcommand\ascii\reversedlist\ascii}} -%D \startlines -%D \test{} -%D \test{1} -%D \test{1,3} -%D \test{1,3,4} -%D \test{1,3,3,4,5} -%D \test{1,3,3,4,5,8} -%D \test{1,3,3,4,5,5,8,10} -%D \test{1,3,4,5,8,10,11} -%D \test{1,,3,,4,,5,,8,,10,,11,} -%D \stoplines - -%D \macros -%D {stripstring} -%D -%D Needed in bookmarks: -%D -%D \starttyping -%D {\sanitizePDFdocencoding test \CONTEXT\ test \to\oeps\stripstring\oeps\tttf[\oeps]} -%D \stoptyping - -\def\stripstring#1% #1 is \cs - {\bgroup - \defconvertedcommand\ascii{#1}% - \global\let\globalascii\empty - \donefalse - \expandafter\handletokens\ascii\with\dostripstring - \egroup - \let#1\globalascii} - -\def\dostripstring#1% - {\ifx#1\blankspace - \donetrue - \else - \ifdone\ifx\globalascii\empty\else - \xdef\globalascii{\globalascii\space}% - \donefalse - \fi\fi - \xdef\globalascii{\globalascii#1}% - \fi} - -%D \macros -%D {dowithrange} -%D -%D This one is for Mojca Miklavec, who made me aware of the fact that -%D \type {page-imp.tex} was not the best place to hide it. - -\def\dowithrange#1#2% #2 takes number - {\splitstring#1\at:\to\fromrange\and\torange - \ifx\torange\empty\let\torange\fromrange\fi - \dostepwiserecurse\fromrange\torange1{#2{\recurselevel}}} - -%D \macros {uncompresslist} -%D -%D When given a list like \type{1,4-7,9} as argument, this macro -%D will store the expanded commalist in \type{\uncompressedlist}. -%D -%D \startbuffer -%D \def\MojcaHasToDoTheTasks[#1]#2% -%D {{\uncompresslist[#1]% -%D \def\processitem##1{I have to do ##1 #2\par}% -%D \processcommacommand[\uncompressedlist]\processitem}} -%D -%D \MojcaHasToDoTheTasks [1-4,7,9-11] {until tomorrow} -%D \stopbuffer -%D -%D Here is an example of how to use \type {\uncompresslist}: -%D \typebuffer -%D -%D The output of this is: -%D -%D \getbuffer - -\beginETEX \numexpr - -\def\uncompresslist[#1]% by TH - {\let\uncompressedlist\empty - \def\docompressedlistitem##1-##2-% - {\@EA\dorecurse\@EA - {\the\numexpr1+##2-##1\relax}% - {\@EA\appendtocommalist\@EA{\the\numexpr##1-1+####1\relax}\uncompressedlist}}% - \def\douncompresslist##1% - {\doifinstringelse{-}{##1} - {\docompressedlistitem##1-} - {\appendtocommalist{##1}\uncompressedlist}}% - \processcommalist[#1]\douncompresslist} - -\endETEX - -\beginTEX - -\def\uncompresslist[#1]% - {\def\uncompressedlist{#1}} - -\endTEX - -%D \macros -%D {ignoreimplicitspaces} -%D -%D \startbuffer -%D \def\whatever[#1]{\expanded{\definedfont[#1 at 12pt]}\ignorespaces} -%D {a\whatever[Serif]b a\whatever[Serif] b a\whatever[Serif]\space b} -%D \def\whatever[#1]{\expanded{\definedfont[#1 at 12pt]}\ignoreimplicitspaces} -%D {a\whatever[Serif]b a\whatever[Serif] b a\whatever[Serif]\space b} -%D \stopbuffer -%D -%D \typebuffer \getbuffer - -\def\ignoreimplicitspaces - {\doifnextcharelse\relax\relax\relax} - -% new -% -% \startnointerference -% all kind of code -% \stopnointerference - -\newbox\nointerferencebox - -\def\startnointerference - {\setbox\nointerferencebox\vbox - \bgroup} - -\def\stopnointerference - {\egroup - \setbox\nointerferencebox\emptybox} - -\protect \endinput - - -% \def\appendtovaluelist#1#2% -% {\ifcsname#1\endcsname -% \expandafter\ifx\csname#1\endcsname\empty -% \expandafter\def\csname#1\endcsname{#2}% -% \else -% \expandafter\def\csname#1\expandafter\expandafter\expandafter\endcsname -% \expandafter\expandafter\expandafter{\csname#1\endcsname,#2}% -% \fi -% \else -% \expandafter\def\csname#1\endcsname{#2}% -% \fi} -% -% or -% -% \def\appendtovaluelist#1% -% {\ifcsname#1\endcsname -% \expandafter\ifx\csname#1\endcsname\empty -% \expandafter\noappendtovaluelist\csname#1\expandafter\expandafter\expandafter\endcsname -% \else -% \expandafter\doappendtovaluelist\csname#1\expandafter\expandafter\expandafter\endcsname -% \fi -% \else -% \expandafter\noappendtovaluelist\csname#1\expandafter\endcsname -% \fi} - -% \def\doappendtovaluelist#1#2{\expandafter\def\expandafter#1\expandafter{#1,#2}} -% \def\noappendtovaluelist#1#2{\def#1{#2}} - -% \appendtovaluelist{mylist}{aap} -% \appendtovaluelist{mylist}{noot} -% \appendtovaluelist{mylist}{mies} - -% \showvalue{mylist} diff --git a/tex/context/base/syst-tex.mkii b/tex/context/base/syst-tex.mkii new file mode 100644 index 000000000..a8aea2683 --- /dev/null +++ b/tex/context/base/syst-tex.mkii @@ -0,0 +1,314 @@ +%D \module +%D [ file=syst-tex, +%D version=1999.03.17, % an oldie: 1995.10.10 +%D title=\CONTEXT\ System Macros, +%D subtitle=Efficient \PLAIN\ \TEX\ loading, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 used by mptopdf. + +%D We've build \CONTEXT\ on top of \PLAIN\ \TEX. Because we +%D want to make the format file as independant as possible of +%D machine dependant font encodings, we have to bypass the +%D loading of fonts. +%D +%D Let's start at the beginning. Because \PLAIN\ is not yet +%D loaded we have to define some \CATCODES\ ourselves. + +\catcode`\{=1 % left brace is begin-group character +\catcode`\}=2 % right brace is end-group character +\catcode`\#=6 % hash mark is macro parameter character +\catcode`\^=7 % circumflex is for superscripts + +%D To prevent all kind of end||of||file problems, for the +%D moment we simply ignore the Control~Z token. + +\catcode`\^^Z=9 + +%D We are going to report to the user what we are skipping. + +\def\skipmessage#1{\immediate\write16{skipping #1 in plain}} + +%D We want to be able to use the \type{\newsomething} +%D declarations not only on the \type{\outer} level. This can +%D be done by redefining \type{\outer} so we have to save its +%D original meaning. + +\let\normalouter = \outer +\let\outer = \relax + +%D We also want to postpone the loading of hyphenation patters, +%D so we redefine and therefore save \type{\input}. + +\let\normalinput = \input +\def\input #1 {\skipmessage{\string\input}} + +%D Finaly are going to we redefine some font specification +%D commands and that's why we save them too. The redefinitions +%D are straightforward because the macros have to do nothing +%D but skipping. + +\let\normalskewchar = \skewchar +\def\skewchar #1=#2 {\skipmessage{\string\skewchar}} + +\let\normaltextfont = \textfont +\let\normalscriptfont = \scriptfont +\let\normalscriptscriptfont = \scriptscriptfont + +\def\textfont #1=#2{\skipmessage{\string\textfont}} +\def\scriptfont #1=#2{\skipmessage{\string\scriptfont}} +\def\scriptscriptfont #1=#2{\skipmessage{\string\scriptscriptfont}} + +%D The redefinition of \type{\font} is a bit more complicated, +%D because in version 3.14159 a scaled specification was +%D introduced. + +\let\normalfont = \font + +\def\skipscaled scaled #1 {} + +\long\def\font#1=#2 #3% + {\ifx#3s% + \skipmessage{scaled \string\font}% + \let\next\skipscaled + \else + \skipmessage{\string\font}% + \let\next\relax + \fi + \next#3} + +% or: +% +% \long\def\font#1=#2 #3% +% {\ifx#3s% +% \skipmessage{scaled \string\font}% +% \expandafter\skipscaled +% \else +% \skipmessage{\string\font}% +% \fi +% #3} + +%D Relaxing some font switching macros is needed because we +%D don't want any error messages during loading. These +%D unharmfull messages could be ingored. +%D +%D The next substitution is needed for determining +%D \type{\p@renwd} in the macro \type{\bordermatrix}. + +\def\tenex#1% + {\skipmessage{used \string\tenex}\hskip8.75002pt} + +%D We need to define \type{\tenrm} for switching to +%D \type{\rm}. + +\def\tenrm% + {\skipmessage{\string\tenrm}} + +%D In \CONTEXT\ all \PLAIN\ \TEX\ fonts are available, just +%D like \type{\p@renwd}. We only postpone loading them until +%D they are actually needed. + +%D By bypassing fonts, some definitions become less valid so +%D we have to redefine them afterwards. +%D +%D \starttyping +%D \let\normalbordermatrix=\bordermatrix +%D +%D \def\bordermatrix% +%D {\bgroup +%D \setbox0=\hbox{\getvalue{\textface\c!mm\c!ex}B}% +%D \global\p@renwd=\wd0\relax +%D \egroup +%D \normalbordermatrix} +%D \stoptyping + +%D Now we are ready for loading \PLAIN\ \TEX. Of couse we use +%D \type{\normalinput} and not \type{\input}. + +\normalinput plain.tex \let\normalfmtversion\fmtversion + +%D We have to take care of unwanted \PDFTEX\ +%D initializations. We just want to default to \DVI\ output. + +\ifx\pdftexversion\undefined + \chardef\pdfoutput=0 +\else + \pdfoutput=0 +\fi + +%D When applicable, we also load the \ETEX\ source and +%D definition files. + +\bgroup \obeylines + +\ifx\eTeXversion\undefined + + \long\gdef\beginETEX#1\endETEX% + {} + + \gdef\beginTEX% + {\bgroup\obeylines\dobeginTEX} + + \gdef\dobeginTEX#1 + {\egroup} + + \global\let\endTEX\relax + +\else + + \long\gdef\beginTEX#1\endTEX% + {} + + \gdef\beginETEX% + {\bgroup\obeylines\dobeginETEX} + +% \gdef\dobeginETEX#1 +% {\egroup\immediate\write16% +% {system (E-TEX) : [line \the\inputlineno] \detokenize{#1}}} + + \gdef\dobeginETEX#1 + {\egroup} + + \global\let\endETEX\relax + +\fi + +\egroup + +% \ifx\eTeXversion\undefined +% \long\def\onlyTEX #1{#1} +% \long\def\onlyETEX#1{} +% \else +% \long\def\only TEX#1{} +% \long\def\onlyETEX#1{#1} +% \fi + +%D Well, this redefintion of \type {\input} fails on \ETEX, +%D because of some \type {\cs\fi} constructs. So now we use: + +% \beginETEX etex.src etexdefs.lib +% +% \def\input#1% +% {\bgroup +% \skipmessage{\string\input}% +% \expandafter\ifx\expandafter#1\csname l@ngdefnfile\endcsname +% \let\input\egroup +% \else +% \def\input##1 {\egroup}% +% \fi +% \input} +% +% \normalinput etex.src \relax +% \normalinput etexdefs.lib \relax +% +% \let\fmtversion\normalfmtversion +% +% \savinghyphcodes=1 +% +% \endETEX +% +% \ifx\normalprotected \undefined \let\normalprotected \protected \fi +% \ifx\normalunexpanded\undefined \let\normalunexpanded\unexpanded \fi +% \ifx\normalexpanded \undefined \let\normalexpanded \expanded \fi + +\beginETEX \savinghyphcodes + + \savinghyphcodes=1 + +\endETEX + +%D We restore some redefined primitives to their old meaning. + +\let\font = \normalfont +\let\skewchar = \normalskewchar +\let\textfont = \normaltextfont +\let\scriptfont = \normalscriptfont +\let\scriptscriptfont = \normalscriptscriptfont +\let\input = \normalinput +\let\outer = \normalouter + +%D We reset some of the used auxiliary macro's to +%D \type{\undefined}. One never knows what testing on them is +%D done elsewhere. + +\let\skipmessage = \undefined +\let\skipscaled = \undefined +\let\normalfont = \undefined +\let\normalskewchar = \undefined +\let\normaltextfont = \undefined +\let\normalscriptfont = \undefined +\let\normalscriptscriptfont = \undefined + +% \let\normalinput = \undefined +% \let\normalouter = \undefined + +%D We want a bit more statistics and some less logging info +%D in the \type{log} file. + +\def\wlog#1{} + +% \let\normalwlog\wlog +% +% \def\wlog#1{\normalwlog{system (\string\wlog) : #1}} + +%D To prevent clashes, we slightly redefine the phantom +%D macros: we let them hide their behaviour by grouping. + +\catcode`@=11 + +%D Somehow this one does not work ok in math mode: + +\def\ph@nt% + {\bgroup + \ifmmode + \expandafter\mathpalette\expandafter\mathph@nt + \else + \expandafter\makeph@nt + \fi} + +\def\finph@nt% + {\setbox\tw@\null + \ifv@ \ht\tw@\ht\z@ \dp\tw@\dp\z@ \fi + \ifh@ \wd\tw@\wd\z@ \fi + \box\tw@ + \egroup} + +%D But this one does work. + +\def\ph@nt% + {\ifmmode + \expandafter\mathpalette\expandafter\mathph@nt + \else + \bgroup\expandafter\makeph@nt + \fi} + +\def\finph@nt% + {\setbox\tw@\null + \ifv@ \ht\tw@\ht\z@ \dp\tw@\dp\z@ \fi + \ifh@ \wd\tw@\wd\z@ \fi + \box\tw@ + \ifmmode\else\egroup\fi} + +\catcode`@=12 + +%D Just for tracing purposes wet set: + +\tracingstats=1 + +%D To circumvent dependencies, we can postpone certain +%D initializations to dumping time, by appending them to the +%D \type {\everydump} token register. + +\newtoks \everydump + +\let\normaldump \dump + +\def\dump{\the\everydump\normaldump} + +\endinput diff --git a/tex/context/base/syst-tex.tex b/tex/context/base/syst-tex.tex deleted file mode 100644 index a8aea2683..000000000 --- a/tex/context/base/syst-tex.tex +++ /dev/null @@ -1,314 +0,0 @@ -%D \module -%D [ file=syst-tex, -%D version=1999.03.17, % an oldie: 1995.10.10 -%D title=\CONTEXT\ System Macros, -%D subtitle=Efficient \PLAIN\ \TEX\ loading, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 used by mptopdf. - -%D We've build \CONTEXT\ on top of \PLAIN\ \TEX. Because we -%D want to make the format file as independant as possible of -%D machine dependant font encodings, we have to bypass the -%D loading of fonts. -%D -%D Let's start at the beginning. Because \PLAIN\ is not yet -%D loaded we have to define some \CATCODES\ ourselves. - -\catcode`\{=1 % left brace is begin-group character -\catcode`\}=2 % right brace is end-group character -\catcode`\#=6 % hash mark is macro parameter character -\catcode`\^=7 % circumflex is for superscripts - -%D To prevent all kind of end||of||file problems, for the -%D moment we simply ignore the Control~Z token. - -\catcode`\^^Z=9 - -%D We are going to report to the user what we are skipping. - -\def\skipmessage#1{\immediate\write16{skipping #1 in plain}} - -%D We want to be able to use the \type{\newsomething} -%D declarations not only on the \type{\outer} level. This can -%D be done by redefining \type{\outer} so we have to save its -%D original meaning. - -\let\normalouter = \outer -\let\outer = \relax - -%D We also want to postpone the loading of hyphenation patters, -%D so we redefine and therefore save \type{\input}. - -\let\normalinput = \input -\def\input #1 {\skipmessage{\string\input}} - -%D Finaly are going to we redefine some font specification -%D commands and that's why we save them too. The redefinitions -%D are straightforward because the macros have to do nothing -%D but skipping. - -\let\normalskewchar = \skewchar -\def\skewchar #1=#2 {\skipmessage{\string\skewchar}} - -\let\normaltextfont = \textfont -\let\normalscriptfont = \scriptfont -\let\normalscriptscriptfont = \scriptscriptfont - -\def\textfont #1=#2{\skipmessage{\string\textfont}} -\def\scriptfont #1=#2{\skipmessage{\string\scriptfont}} -\def\scriptscriptfont #1=#2{\skipmessage{\string\scriptscriptfont}} - -%D The redefinition of \type{\font} is a bit more complicated, -%D because in version 3.14159 a scaled specification was -%D introduced. - -\let\normalfont = \font - -\def\skipscaled scaled #1 {} - -\long\def\font#1=#2 #3% - {\ifx#3s% - \skipmessage{scaled \string\font}% - \let\next\skipscaled - \else - \skipmessage{\string\font}% - \let\next\relax - \fi - \next#3} - -% or: -% -% \long\def\font#1=#2 #3% -% {\ifx#3s% -% \skipmessage{scaled \string\font}% -% \expandafter\skipscaled -% \else -% \skipmessage{\string\font}% -% \fi -% #3} - -%D Relaxing some font switching macros is needed because we -%D don't want any error messages during loading. These -%D unharmfull messages could be ingored. -%D -%D The next substitution is needed for determining -%D \type{\p@renwd} in the macro \type{\bordermatrix}. - -\def\tenex#1% - {\skipmessage{used \string\tenex}\hskip8.75002pt} - -%D We need to define \type{\tenrm} for switching to -%D \type{\rm}. - -\def\tenrm% - {\skipmessage{\string\tenrm}} - -%D In \CONTEXT\ all \PLAIN\ \TEX\ fonts are available, just -%D like \type{\p@renwd}. We only postpone loading them until -%D they are actually needed. - -%D By bypassing fonts, some definitions become less valid so -%D we have to redefine them afterwards. -%D -%D \starttyping -%D \let\normalbordermatrix=\bordermatrix -%D -%D \def\bordermatrix% -%D {\bgroup -%D \setbox0=\hbox{\getvalue{\textface\c!mm\c!ex}B}% -%D \global\p@renwd=\wd0\relax -%D \egroup -%D \normalbordermatrix} -%D \stoptyping - -%D Now we are ready for loading \PLAIN\ \TEX. Of couse we use -%D \type{\normalinput} and not \type{\input}. - -\normalinput plain.tex \let\normalfmtversion\fmtversion - -%D We have to take care of unwanted \PDFTEX\ -%D initializations. We just want to default to \DVI\ output. - -\ifx\pdftexversion\undefined - \chardef\pdfoutput=0 -\else - \pdfoutput=0 -\fi - -%D When applicable, we also load the \ETEX\ source and -%D definition files. - -\bgroup \obeylines - -\ifx\eTeXversion\undefined - - \long\gdef\beginETEX#1\endETEX% - {} - - \gdef\beginTEX% - {\bgroup\obeylines\dobeginTEX} - - \gdef\dobeginTEX#1 - {\egroup} - - \global\let\endTEX\relax - -\else - - \long\gdef\beginTEX#1\endTEX% - {} - - \gdef\beginETEX% - {\bgroup\obeylines\dobeginETEX} - -% \gdef\dobeginETEX#1 -% {\egroup\immediate\write16% -% {system (E-TEX) : [line \the\inputlineno] \detokenize{#1}}} - - \gdef\dobeginETEX#1 - {\egroup} - - \global\let\endETEX\relax - -\fi - -\egroup - -% \ifx\eTeXversion\undefined -% \long\def\onlyTEX #1{#1} -% \long\def\onlyETEX#1{} -% \else -% \long\def\only TEX#1{} -% \long\def\onlyETEX#1{#1} -% \fi - -%D Well, this redefintion of \type {\input} fails on \ETEX, -%D because of some \type {\cs\fi} constructs. So now we use: - -% \beginETEX etex.src etexdefs.lib -% -% \def\input#1% -% {\bgroup -% \skipmessage{\string\input}% -% \expandafter\ifx\expandafter#1\csname l@ngdefnfile\endcsname -% \let\input\egroup -% \else -% \def\input##1 {\egroup}% -% \fi -% \input} -% -% \normalinput etex.src \relax -% \normalinput etexdefs.lib \relax -% -% \let\fmtversion\normalfmtversion -% -% \savinghyphcodes=1 -% -% \endETEX -% -% \ifx\normalprotected \undefined \let\normalprotected \protected \fi -% \ifx\normalunexpanded\undefined \let\normalunexpanded\unexpanded \fi -% \ifx\normalexpanded \undefined \let\normalexpanded \expanded \fi - -\beginETEX \savinghyphcodes - - \savinghyphcodes=1 - -\endETEX - -%D We restore some redefined primitives to their old meaning. - -\let\font = \normalfont -\let\skewchar = \normalskewchar -\let\textfont = \normaltextfont -\let\scriptfont = \normalscriptfont -\let\scriptscriptfont = \normalscriptscriptfont -\let\input = \normalinput -\let\outer = \normalouter - -%D We reset some of the used auxiliary macro's to -%D \type{\undefined}. One never knows what testing on them is -%D done elsewhere. - -\let\skipmessage = \undefined -\let\skipscaled = \undefined -\let\normalfont = \undefined -\let\normalskewchar = \undefined -\let\normaltextfont = \undefined -\let\normalscriptfont = \undefined -\let\normalscriptscriptfont = \undefined - -% \let\normalinput = \undefined -% \let\normalouter = \undefined - -%D We want a bit more statistics and some less logging info -%D in the \type{log} file. - -\def\wlog#1{} - -% \let\normalwlog\wlog -% -% \def\wlog#1{\normalwlog{system (\string\wlog) : #1}} - -%D To prevent clashes, we slightly redefine the phantom -%D macros: we let them hide their behaviour by grouping. - -\catcode`@=11 - -%D Somehow this one does not work ok in math mode: - -\def\ph@nt% - {\bgroup - \ifmmode - \expandafter\mathpalette\expandafter\mathph@nt - \else - \expandafter\makeph@nt - \fi} - -\def\finph@nt% - {\setbox\tw@\null - \ifv@ \ht\tw@\ht\z@ \dp\tw@\dp\z@ \fi - \ifh@ \wd\tw@\wd\z@ \fi - \box\tw@ - \egroup} - -%D But this one does work. - -\def\ph@nt% - {\ifmmode - \expandafter\mathpalette\expandafter\mathph@nt - \else - \bgroup\expandafter\makeph@nt - \fi} - -\def\finph@nt% - {\setbox\tw@\null - \ifv@ \ht\tw@\ht\z@ \dp\tw@\dp\z@ \fi - \ifh@ \wd\tw@\wd\z@ \fi - \box\tw@ - \ifmmode\else\egroup\fi} - -\catcode`@=12 - -%D Just for tracing purposes wet set: - -\tracingstats=1 - -%D To circumvent dependencies, we can postpone certain -%D initializations to dumping time, by appending them to the -%D \type {\everydump} token register. - -\newtoks \everydump - -\let\normaldump \dump - -\def\dump{\the\everydump\normaldump} - -\endinput diff --git a/tex/context/base/tabl-ltb.mkii b/tex/context/base/tabl-ltb.mkii new file mode 100644 index 000000000..0ff64047e --- /dev/null +++ b/tex/context/base/tabl-ltb.mkii @@ -0,0 +1,866 @@ +%D \module +%D [ file=core-ltb, +%D version=2002.10.31, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Line Tables, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% testfile: tfmetrics.tex + +% todo: als nx>1, dan in geval van rek tussenruimte berekenen en optellen +% bij breedte, dus: nx nog niet gebruiken in combinatie met rek ! ! ! ! ! + +% This module is experimental, undocumented, and currently only set up +% eTeX. It provides a mechanism for typesetting very large tables, +% spanning many pages horizontally and vertically, with repeated +% header lines and (entry) columns, tab tracking, color, etc. In does +% two passes over a table, which is why the table goes into a +% buffer or file. As said, tables can be real huge. + +% \BH \BC .. \EC \BC .. \EC \EH % append +% \BR \BC .. \EC \BC .. \EC \ER +% +% or +% +% \NC .. \NC .. \NC \NR (todo: optional last \NC) + +% alternative: +% +% (1) direct run, save content in macro, but only if needed +% +% todo +% +% (2) buffered table content +% +% \startbuffer +% \startlinetablehead +% \stoplinetablehead +% \startlinetablebody +% \stoplinetablebody +% \stopbuffer +% +% \processlinetablebuffer[buffer] +% +% in buffer : head and body +% +% (3) unbuffered run, multipass +% +% - run with starting width zero / prev run +% - clip on prev run +% - flush real widths + +\writestatus{loading}{ConTeXt Table Macros / Line Tables} + +\unprotect + +\chardef\linetablesplitstate\zerocount +\chardef\linetableheadstate \zerocount + +\edef\??ler{\??le:r:} +\edef\??lec{\??le:c:} +\edef\??lew{\??le:w:} +\edef\??leh{\??le:h:} +\edef\??led{\??le:d:} + +\newif\iflinetablepreroll +\newif\ifinlinetable + +\newcount\linetablecolumn +\newcount\linetablesubcol +\newdimen\linetablewidth +\newdimen\linetableheight +\newbox \linetablecell + +\let\noflinetablecolumns\!!zerocount +\let\noflinetablerows \!!zerocount +\let\noflinetablelines \!!zerocount +\let\noflinetableparts \!!zerocount +\let\linetablepart \!!plusone +\let\linetablestep \!!plusone +\let\linetableline \!!zerocount +\let\linetablerow \!!zerocount +\let\linetablerows \!!zerocount + +\initializetablebox \zerocount % holds repeater + +\chardef\linetablehmode \zerocount +\chardef\linetablepage \zerocount +\chardef\linetablerepeat\zerocount + +\def\setuplinetable + {\dotripleempty\dosetuplinetable} + +\def\dosetuplinetable[#1][#2][#3]% + {\ifthirdargument + \getparameters[\??le:#1:#2][#3]% + \else\ifsecondargument + \getparameters[\??lec#1][#2]% + \else + \getparameters[\??le][#1]% + \fi\fi} + +\setuplinetable + [\c!n=\!!maxcard, + \c!lines=\!!maxcard, + \c!nx=\plusone, + \c!nleft=0, + \c!repeat=\v!yes, % when \c!nleft>0, repeat on both pages + \c!before=, + \c!after=, + \c!inbetween=\page, + \c!distance=\zeropoint, + \c!stretch=\v!no, + \c!align=\c!right, + \c!leftoffset=.25ex, + \c!rightoffset=\linetableparameter\c!leftoffset, + \c!maxwidth=\zeropoint, + \c!width=5em, + \c!height=\v!fit, % \v!line = faster + \c!background=, + \c!backgroundcolor=] + +\def\linetableparameter#1% + {\csname\??le#1\endcsname} + +\def\doifelselinetablecparameter#1% + {\ifcsname\??lec\number\linetablecolumn#1\endcsname + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\def\linetablecparameter#1% + {\csname + \ifcsname\??lec\number\linetablecolumn#1\endcsname + \??lec\number\linetablecolumn + \else + \??le + \fi + #1\endcsname} + +\def\linetablerparameter#1% faster, leaner and meaner + {\csname + \ifnum\linetablerow=\zerocount % geen ifcase + \ifcsname\??ler\v!header#1\endcsname + \??ler\v!header#1% + \else\ifcsname\??ler0#1\endcsname + \??ler0#1% + \else + \s!empty + \fi\fi + \else + \ifcsname\??ler\number\linetablerow#1\endcsname + \??ler\number\linetablerow#1% + \else\ifcsname\??ler\v!oddeven\linetablerow#1\endcsname + \??ler\v!oddeven\linetablerow#1% + \else + \s!empty + \fi\fi + \fi + \endcsname} + +\def\setnoftableslines + {\doifelse{\linetableparameter\c!lines}\v!fit + {% whitespace already added by vertical strut + \ifdim\pagegoal<\maxdimen + \scratchdimen\pagegoal + \advance\scratchdimen -\pagetotal + \else + \scratchdimen\textheight + \fi + \getrawnoflines\scratchdimen + \xdef\noflinetablelines{\the\noflines} +\iflinetablepreroll \else \ifnum\noflinetablelines<\plustwo + \page \setnoftableslines +\fi \fi +} + {\xdef\noflinetablelines{\linetableparameter\c!lines}}} + +\def\startlinetablecell + {\dosingleempty\dostartlinetablecell} + +\def\dostartlinetablecell[#1]% + {\global\setbox\linetablecell\hbox\bgroup + \iffirstargument + \getparameters[\??lec\number\linetablecolumn][#1]% + \fi + \xdef\linetablestep{\linetablecparameter\c!nx}% + \ifcase\linetablestep\or + \scratchdimen\linetablecparameter\c!width + \scratchskip \linetablecparameter\c!distance + \else + \scratchdimen \zeropoint + \scratchskip \zeropoint + \scratchcounter\linetablecolumn + \dorecurse\linetablestep + {\advance\scratchdimen\linetablecparameter\c!width + %\advance\scratchskip \linetablecparameter\c!distance + \global\advance \linetablecolumn\plusone + \advance\scratchskip \linetablecparameter\c!distance + }% + \global\linetablecolumn\scratchcounter + \fi + \chardef\linetablemode + \iflinetablepreroll + \ifdim\scratchdimen>\zeropoint \zerocount \else \plustwo \fi + \else + \zerocount + \fi + \ifcase\linetablemode + \ifcase\linetablehmode + % nothing + \or + % fit, keep it simple + \or + \chardef\linetablemode\plusone % line + \else + % some already calculated height + \fi + \fi + \setbox\scratchbox\hbox + \bgroup + \dontcomplain + \hskip\linetablecparameter\c!leftoffset\relax + % 0 = width, unknown height + % 1 = width, fixed height + % 2 = no width, auto hsize + \ifnum\linetablemode<\plustwo + \advance\scratchdimen-\linetablecparameter\c!leftoffset + \advance\scratchdimen-\linetablecparameter\c!rightoffset + \fi + \ifcase\linetablemode + \dosetraggedcommand{\linetablecparameter\c!align}% + \vtop \ifdim\linetableheight>\zeropoint to\linetableheight \fi \bgroup + \hsize\scratchdimen + \raggedcommand + \else + \setalignmentswitch{\linetablecparameter\c!align}% + \hbox \ifcase\linetablemode \or to\scratchdimen \fi \bgroup + \ifcase\alignmentswitch\hss\or\hss\fi + \fi + \dostartattributes{\??lec\number\linetablecolumn}\c!style\c!color\empty + \begstrut \ignorespaces} + +% \def\stoplinetablecell +% {\unskip \endstrut +% \dostopattributes +% \ifcase\linetablemode +% \endgraf +% \else +% \ifcase\alignmentswitch\else\hss\fi +% \fi +% \egroup +% \hskip\linetablecparameter\c!rightoffset +% \egroup +% \iflinetablepreroll +% \box\scratchbox +% \else +% \doif{\linetablecparameter\c!background}\v!color +% {\backgroundline[\linetablecparameter\c!backgroundcolor]}% +% {\box\scratchbox}% +% \fi +% \egroup} + +\newconditional\linetableautoheight \settrue\linetableautoheight + +\def\stoplinetablecell + {\unskip \endstrut + \dostopattributes + \ifcase\linetablemode + \endgraf + \else + \ifcase\alignmentswitch\else\hss\fi + \fi + \egroup + \hskip\linetablecparameter\c!rightoffset + \egroup + \iflinetablepreroll + \box\scratchbox + \else + \doifelse{\linetablecparameter\c!background}\v!color + {\ifconditional\linetableautoheight + \hbox{\blackrule + [ \c!color=\linetablecparameter\c!backgroundcolor, + \c!height=\linetablerparameter{x\c!height}, + \c!depth=\linetablerparameter{x\c!depth}, + \c!width=\wd\scratchbox]% + \hskip-\wd\scratchbox\box\scratchbox}% + \else + \backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}% + \fi}% + {\box\scratchbox}% + \fi + \egroup} + +% \def\stoplinetablecell +% {\unskip \endstrut +% \dostopattributes +% \ifcase\linetablemode +% \endgraf +% \else +% \ifcase\alignmentswitch\else\hss\fi +% \fi +% \egroup +% \hskip\linetablecparameter\c!rightoffset +% \egroup +% \iflinetablepreroll +% \box\scratchbox +% \else +% \doifelse{\linetablecparameter\c!background}\v!color +% {\ifconditional\linetableautoheight +% % \hbox{\blackrule +% % [ \c!color=\linetablecparameter\c!backgroundcolor, +% % \c!height=\linetablerparameter{x\c!height}, +% % \c!depth=\linetablerparameter{x\c!depth}, +% % \c!width=\wd\scratchbox]% +% % \hskip-\wd\scratchbox\box\scratchbox}% +% \dp\scratchbox\linetablerparameter{x\c!depth}% +% \ht\scratchbox\linetablerparameter{x\c!height}% +% \framed +% [\c!offset=\v!overlay, +% \c!frameoffset=.5\linewidth, +% \c!leftframe=\v!off,\c!rightframe=\v!off, +% \c!background=\v!color, +% \c!backgroundcolor=\linetablecparameter\c!backgroundcolor% +% ]{\box\scratchbox}% +% \else +% \backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}% +% \fi}% +% {\box\scratchbox}% +% \fi +% \egroup} + +\def\savelinetablepart + {\global\setbox\tablebox\linetablepart + \ifnum\linetablepart=\zerocount + \box\scratchbox % just storing + \else + \vbox + {\ifvoid\tablebox\linetablepart\else\unvbox\tablebox\linetablepart\fi + \doif{\linetablerparameter\c!background}\v!color + {\backgroundline[\linetablerparameter\c!backgroundcolor]}% + {\box\scratchbox}% is also arg to \backgroundline + \endgraf + \linetablerparameter\c!after}% + \fi} + +\def\flushlinetableparts + {\doglobal\increment\linetableline + \ifnum\linetableline<\noflinetablelines + % keep collecting + \else + \iflinetablepreroll + % forget about them + \else + \dorecurse\noflinetableparts + {\let\linetablepart\recurselevel + \dp\tablebox\linetablepart\strutdepth + % noindent en endgraf needed else whitespace mess-up! + \whitespace % here not after verticalstrut + \ifdim\topskipgap=\zeropoint\else + \verticalstrut\nobreak\kern-\struttotal\kern-\parskip\nobreak\nointerlineskip % fix topskip + \fi + \noindent\strut\hbox to \hsize{\box\tablebox\linetablepart\hss}\endgraf + \ifnum\linetablepart<\noflinetableparts\relax + \linetableparameter\c!inbetween + \fi}% + \ifnum\linetablerows<\noflinetablerows\relax + \linetableparameter\c!inbetween + \else + % after, later + \fi + \chardef\linetableheadstate\plusthree + \global\setbox\tablebox\zerocount\emptybox % here + \fi + % reset \linetablerow will be an option, currently + % starts at zero after split + \globallet\linetablerow\!!zerocount + \globallet\linetableline\!!zerocount + \global\chardef\linetablepage\zerocount + \global\linetablewidth\zeropoint + \setnoftableslines + \fi} + +\def\startlinetablepart + {\global\linetablesubcol\zerocount + \setbox\scratchbox\hbox\bgroup + \doconvertfont{\linetablerparameter\c!style}% + \startcolor[\linetablerparameter\c!color]% + \ignorespaces} + +\def\stoplinetablepart + {\ifnum\linetablepart>\zerocount + \unskip \unskip % remove last intercolumn skip (distance+fill) + \fi + \stopcolor + \egroup + \iflinetablepreroll \else + \ifcase\linetablepart + % we're collecting the repeater + \else + \scratchdimen\hsize \advance\scratchdimen-\wd\scratchbox\relax + \ifdim\scratchdimen>\linetableparameter\c!stretch\else + \setbox\scratchbox\hbox to \hsize{\unhbox\scratchbox}% + \fi + \fi + \fi} + +\def\checklinetablepart + {\global\advance\linetablewidth\wd\linetablecell + \global\advance\linetablecolumn\linetablestep + \global\advance\linetablesubcol\linetablestep + \relax + %\message{\the\linetablecolumn,\the\linetablesubcol}\wait + % from now on the column counter is already incremented + \ifcase\linetablesplitstate + \iflinetablepreroll \else + \box\linetablecell + % the columncounter is one ahead ! +% \hskip\linetablecparameter\c!afstand + \hskip\scratchskip + \fi + %%% + \donefalse + \ifcase\linetablerepeat\else + % van te voren berekenen + \scratchcounter\linetablecolumn\advance\scratchcounter-\plustwo + \ifnum\linetablerepeat=\scratchcounter + \donetrue % collecting repeater + \fi + \fi + %%%% + \ifdone + % collecting repeater + \else + \ifnum\linetablecolumn>\getvalue{\??le::\linetablepart}\relax + \donetrue + \fi + \fi + \ifdone + \stoplinetablepart + \iflinetablepreroll \else + \savelinetablepart + \fi + \ifcase\linetablepage \or + \global\chardef\linetablepage \plustwo + \else + \global\chardef\linetablepage \plusone + \fi + \doglobal\increment\linetablepart + \global\linetablewidth\wd\tablebox\zerocount + \startlinetablepart + \fi + \else + \donefalse + \!!doneafalse + \ifcase\linetablerepeat\else + % van te voren berekenen + \scratchcounter\linetablecolumn \advance\scratchcounter-\plustwo + \ifnum\linetablerepeat=\scratchcounter + \donetrue % collecting repeater + \fi + \fi + \ifdone + \!!doneatrue + % collecting repeater + \else\ifdim\linetablewidth>\hsize + \donetrue + \else +% \global\advance\linetablewidth\linetablecparameter\c!afstand\relax + \global\advance\linetablewidth\scratchskip + \ifdim\linetablewidth>\hsize % ? + \donetrue + \fi + \fi\fi + \ifdone + \stoplinetablepart + \savelinetablepart + \ifcase\linetablepage \or + \global\chardef\linetablepage \plustwo + \else + \global\chardef\linetablepage \plusone + \fi + \doglobal\increment\linetablepart + \ifnum\linetablepart>\noflinetableparts + \globallet\noflinetableparts\linetablepart + \initializetablebox\linetablepart + \fi + \global\linetablewidth\wd\linetablecell + \startlinetablepart + \if!!doneb \else \ifcase\linetablerepeat \else + % check for left/right page + \ifcase\linetablepage\donetrue\or\donetrue\or\donefalse\fi\ifdone + % insert repeater + \global\advance\linetablewidth\wd\tablebox\zerocount + \iflinetablepreroll\kern\wd\else\unhcopy\fi\tablebox\zerocount + \fi + \fi \fi + \fi + \iflinetablepreroll \else + \box\linetablecell + % the columncounter is one ahead ! +% \hskip\linetablecparameter\c!afstand +% \hskip\scratchskip +\dorecurse\linetablestep{\strut\hfil}% + \hskip\scratchskip + \fi + \fi} + +% \linetableparameter\c!var -> \@@levar (when no classes) + +\def\startlinetablerun % to do: quit when nested + {\bgroup + \inlinetabletrue + % autowidth + \doif{\linetableparameter\c!maxwidth}\v!fit + {\setuplinetable[\c!maxwidth=\zeropoint]}% + \processaction + [\linetableparameter\c!stretch] + [ \v!no=>{\setuplinetable[\c!stretch=\maxdimen]},% no stretch + \v!yes=>{\setuplinetable[\c!stretch=\zeropoint]}]% max stretch + \chardef\linetablerepeat\linetableparameter\c!nleft + \chardef\linetablesplitstate % = + \ifdim\linetableparameter\c!maxwidth>\zeropoint + \zerocount \else \plusone + \fi + % optional prevdepth correction + \iflinetablepreroll + \globallet\noflinetablerows\!!zerocount + \else + \linetableparameter\c!before + \fi + \globallet\linetablerows\!!zerocount + \globallet\noflinetablecolumns\!!zerocount + \globallet\noflinetableparts\!!zerocount + \!!counta\zerocount + \def\docommand##1% + {\doglobal\increment\noflinetableparts + \advance\!!counta##1% + \setxvalue{\??le::\noflinetableparts}{\the\!!counta}}% + \processcommacommand[\linetableparameter\c!n]\docommand + \initializetableboxes\noflinetableparts + \ifcase\linetablerepeat + \globallet\linetablepart\!!plusone + \else + \globallet\linetablepart\!!zerocount % repeater + \fi + \globallet\linetablestep\!!plusone + \globallet\linetableline\!!zerocount + \globallet\linetablerow \!!zerocount + \global\linetablecolumn \zerocount + \global\linetablesubcol \zerocount + \global\linetablewidth \zeropoint +\iflinetablepreroll \else \ifdim\pagetotal>\zeropoint + \verticalstrut\kern-\struttotal +\fi \fi + \setnoftableslines + \checklinetablepage + \let\BR\linetableBR + \let\ER\linetableER + \let\BH\linetableBR + \let\EH\linetableER + \let\BC\linetableBC + \let\EC\linetableEC + \let\NC\linetableNC + \let\NR\linetableNR + \flushlinetablehead} + +\def\stoplinetablerun + {\globallet\linetableline\!!maxcard + \chardef\linetableheadstate\zerocount % blocked + \flushlinetableparts + \iflinetablepreroll \else + \linetableparameter\c!after + \fi + \globallet\linetablepart \!!zerocount + \globallet\noflinetableparts\!!zerocount + \egroup} + +% \def\checklinecolumnwidth +% {\ifundefined{\??lew\number\linetablecolumn}% +% \donetrue +% \else\ifdim\getvalue{\??lew\number\linetablecolumn}<\wd\linetablecell +% \donetrue +% \else +% \donefalse +% \fi\fi +% \ifdone +% \setxvalue{\??lew\number\linetablecolumn}{\the\wd\linetablecell}% +% \fi} +% +% \def\checklinecolumnwidth +% {\ifcsname\??lew\number\linetablecolumn\endcsname +% \ifdim\csname\??lew\number\linetablecolumn\endcsname<\wd\linetablecell +% \donetrue +% \else +% \donefalse +% \fi +% \else +% \donetrue +% \fi +% \ifdone +% \setxvalue{\??lew\number\linetablecolumn}{\the\wd\linetablecell}% +% \fi} + +% \def\checklinecolumnwidth +% {\expandafter\xdef\csname\??lew\number\linetablecolumn\endcsname +% {\expandafter\ifx\csname\??lew\number\linetablecolumn\endcsname\relax +% \the\wd\linetablecell +% \else\ifdim\csname\??lew\number\linetablecolumn\endcsname<\wd\linetablecell +% \the\wd\linetablecell +% \else +% \csname\??lew\number\linetablecolumn\endcsname +% \fi\fi}} + +\def\checklinecolumndimension#1#2#3% + {\expandafter\xdef\csname#1\number#3\endcsname + {\expandafter\ifx\csname#1\number#3\endcsname\relax + \the#2\linetablecell + \else\ifdim\csname#1\number#3\endcsname<#2\linetablecell + \the#2\linetablecell + \else + \csname#1\number#3\endcsname + \fi\fi}} + +\def\checklinecolumnwidth {\checklinecolumndimension\??lew\wd\linetablecolumn} +\def\checklinecolumnheight{\checklinecolumndimension\??leh\ht\linetablerow} +\def\checklinecolumndepth {\checklinecolumndimension\??led\dp\linetablerow} + +\def\linetableBR + {\dosingleempty\dolinetableBR} + +\def\dolinetableBR[#1]% #1 not yet implemented + {\ifnum\linetableheadstate=1\else + \doglobal\increment\linetablerow + \doglobal\increment\linetablerows + \fi + \global\linetablecolumn\plusone + \global\linetablesubcol\plusone +% \linetableheight\linetablerparameter\c!height +% +% \ifx\linetableheight\empty +% % nothing +% \else\ifx\linetableheight\v!fit +% % keep it simple +% \else\ifx\linetableheight\v!line +% \chardef\linetablemode\plusone +% \else +% \!!heighta\linetableheight +% \advance\!!heighta-\strutdepth +% \fi\fi\fi +% + \linetableheight\zeropoint + \edef\!!stringa{\linetablerparameter\c!height}% + \ifx\!!stringa\empty + \chardef\linetablehmode\zerocount + \else\ifx\!!stringa\v!fit + \chardef\linetablehmode\plusone + \else\ifx\!!stringa\v!line + \chardef\linetablehmode\plustwo + \else + \linetableheight\!!stringa + \advance\linetableheight-\strutdepth + \fi\fi\fi +% + \startlinetablepart} + +\def\linetableBC + {\startlinetablecell} + +\def\linetableEC + {\stoplinetablecell + \iflinetablepreroll + \checklinecolumnwidth + \checklinecolumnheight + \checklinecolumndepth + \fi + \checklinetablepart} + +\def\linetableER + {% \stoplinetablecell + % no \box\linetablecell, i.e. dummy columnn, last \NC \NR + \stoplinetablepart + \savelinetablepart + \advance\linetablecolumn \minusone + \ifnum\linetablecolumn>\noflinetablecolumns + \xdef\noflinetablecolumns{\number\linetablecolumn}% + \fi + \flushlinetableparts + \global\linetablecolumn\zerocount + \global\linetablewidth \zeropoint + \ifcase\linetablerepeat + \globallet\linetablepart\!!plusone + \else + \globallet\linetablepart\!!zerocount % repeater + \fi + \checklinetablepage + \flushlinetablehead} + +\def\checklinetablepage + {\global\chardef\linetablepage\zerocount + \ifcase\linetablerepeat \else \ifcase\linetablepage + \doif{\linetableparameter\c!repeat}\v!no + {\global\chardef\linetablepage\doifoddpageelse\plusone\plustwo}% + \fi \fi} + +\def\flushlinetablehead + {\ifcase\linetableheadstate + % 0 blocked + \or + % 1 doing head + \or + % 2 head done + \or + % 3 trigger flush + \chardef\linetableheadstate\plusone + \the\@@linetablehead\relax + \chardef\linetableheadstate\plustwo + \fi} + +\def\linetableNC % first time special treatment + {\relax + \ifcase\linetablecolumn + \linetableBR + \else + \linetableEC + \fi + \linetableBC} % beware, this will result in BR BC EC BC NR + +\def\linetableNR + {\stoplinetablecell % dummy + \linetableER} + +\def\startlinetable + {\startlinetablerun} + +\def\stoplinetable + {\stoplinetablerun} + +\def\startlinetableanalysis + {\bgroup + \linetableprerolltrue + \trialtypesettingtrue + \startlinetablerun} + +\def\stoplinetableanalysis + {\stoplinetablerun + \egroup + \globallet\noflinetablerows\linetablerows + \dorecurse\noflinetablerows % global, from last run {\linetableparameter\c!n} + {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}% + \setevalue{\??ler\recurselevel x\c!height}{\getvalue{\??leh\recurselevel}}% + \setevalue{\??ler\recurselevel x\c!depth }{\getvalue{\??led\recurselevel}}% + \letgvalue{\??leh\recurselevel}\!!zeropoint + \letgvalue{\??led\recurselevel}\!!zeropoint} + \dorecurse\noflinetablecolumns % global, from last run {\linetableparameter\c!n} + {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}% + \setevalue{\??lec\recurselevel\c!width}{\getvalue{\??lew\recurselevel}}% + \letgvalue{\??lew\recurselevel}\!!zeropoint}} % init next table + +% todo: store in box instead of macro + +\newtoks \@@linetablehead + +\long\def\startlinetablehead#1\stoplinetablehead + {\ifinlinetable + \@@linetablehead\emptytoks + \fi + \chardef\linetableheadstate3 % full + \@@linetablehead{#1}% + \ifinlinetable + \flushlinetablehead + \fi} + +\def\linetableBH + {\ifx\EC\relax + % signal, grabbing lines + \else + \@@linetablehead\emptytoks + \fi + \pushmacro\BC + \pushmacro\EC + \def\BC##1\EC{\appendtoks##1\to\@@linetablehead}% + \let\EC\relax} % signal + +\def\linetableEH + {\popmacro\EC + \popmacro\BC + \@EA\startlinetablehead\the\@@linetablehead\stoplinetablehead} + +\let\startlinetablebody\donothing +\let\stoplinetablebody \donothing + +\def\processlinetablebuffer + {\dosingleempty\doprocesslinetablebuffer} + +\def\doprocesslinetablebuffer[#1]% + {\bgroup + \let\startlinetable\donothing + \let\stoplinetable \donothing + \startlinetableanalysis\getbuffer[#1]\stoplinetableanalysis + \startlinetablerun \getbuffer[#1]\stoplinetablerun + \egroup} + +\def\processlinetablefile#1% + {\bgroup + \let\startlinetable\donothing + \let\stoplinetable \donothing + \startlinetableanalysis\readfile{#1}\donothing\donothing\stoplinetableanalysis + \startlinetablerun \readfile{#1}\donothing\donothing\stoplinetablerun + \egroup} + +% will go away: + +\def\processlinetableXMLfile#1% + {\bgroup + \let\startlinetable\donothing + \let\stoplinetable \donothing + \startlinetableanalysis\processXMLfile{#1}\stoplinetableanalysis + \startlinetablerun \processXMLfile{#1}\stoplinetablerun + \egroup} + +\protect \endinput + +\doifnotmode{demo}{\endinput} + +\setuplinetable[n=6,m={2,2,2},lines=25] % m ? + +\setuplinetable[c][1] [width=2cm,background=color,backgroundcolor=red] +\setuplinetable[c][4] [width=3cm,background=color,backgroundcolor=yellow] +\setuplinetable[c][6] [width=3cm,background=color,backgroundcolor=magenta] +\setuplinetable[r][odd] [background=color,backgroundcolor=gray] +\setuplinetable[r][even][background=color,backgroundcolor=green] + +\starttext + +\showframe \showstruts + +\setupcolors[state=start] + +\setuppagenumbering[alternative=doublesided]\page[left] + +\startlinetable +\NC aaa\crlf aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR +\dorecurse{100}{\NC aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR} +\stoplinetable + +\startlinetable +\NC[style=slanted,color=green,background=color,backgroundcolor=darkred,nx=2,uitlijnen=middle] xxx + \NC yy \NC ddddd \NC eeee \NC ff \NC \NR +\dorecurse{100}{\NC aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR} +\stoplinetable + +% \startbuffer[lt] +% \NC aaa\crlf aaa \NC bb \NC c \NC ddddd \NC ee \NC ff \NC \NR +% \NC aaa\crlf aaa \NC b \NC cc \NC ddd \NC eeee \NC f \NC \NR +% \stopbuffer +% +% \processlinetablebuffer[lt] + +\stoptext diff --git a/tex/context/base/tabl-ltb.mkiv b/tex/context/base/tabl-ltb.mkiv new file mode 100644 index 000000000..0ff64047e --- /dev/null +++ b/tex/context/base/tabl-ltb.mkiv @@ -0,0 +1,866 @@ +%D \module +%D [ file=core-ltb, +%D version=2002.10.31, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Line Tables, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% testfile: tfmetrics.tex + +% todo: als nx>1, dan in geval van rek tussenruimte berekenen en optellen +% bij breedte, dus: nx nog niet gebruiken in combinatie met rek ! ! ! ! ! + +% This module is experimental, undocumented, and currently only set up +% eTeX. It provides a mechanism for typesetting very large tables, +% spanning many pages horizontally and vertically, with repeated +% header lines and (entry) columns, tab tracking, color, etc. In does +% two passes over a table, which is why the table goes into a +% buffer or file. As said, tables can be real huge. + +% \BH \BC .. \EC \BC .. \EC \EH % append +% \BR \BC .. \EC \BC .. \EC \ER +% +% or +% +% \NC .. \NC .. \NC \NR (todo: optional last \NC) + +% alternative: +% +% (1) direct run, save content in macro, but only if needed +% +% todo +% +% (2) buffered table content +% +% \startbuffer +% \startlinetablehead +% \stoplinetablehead +% \startlinetablebody +% \stoplinetablebody +% \stopbuffer +% +% \processlinetablebuffer[buffer] +% +% in buffer : head and body +% +% (3) unbuffered run, multipass +% +% - run with starting width zero / prev run +% - clip on prev run +% - flush real widths + +\writestatus{loading}{ConTeXt Table Macros / Line Tables} + +\unprotect + +\chardef\linetablesplitstate\zerocount +\chardef\linetableheadstate \zerocount + +\edef\??ler{\??le:r:} +\edef\??lec{\??le:c:} +\edef\??lew{\??le:w:} +\edef\??leh{\??le:h:} +\edef\??led{\??le:d:} + +\newif\iflinetablepreroll +\newif\ifinlinetable + +\newcount\linetablecolumn +\newcount\linetablesubcol +\newdimen\linetablewidth +\newdimen\linetableheight +\newbox \linetablecell + +\let\noflinetablecolumns\!!zerocount +\let\noflinetablerows \!!zerocount +\let\noflinetablelines \!!zerocount +\let\noflinetableparts \!!zerocount +\let\linetablepart \!!plusone +\let\linetablestep \!!plusone +\let\linetableline \!!zerocount +\let\linetablerow \!!zerocount +\let\linetablerows \!!zerocount + +\initializetablebox \zerocount % holds repeater + +\chardef\linetablehmode \zerocount +\chardef\linetablepage \zerocount +\chardef\linetablerepeat\zerocount + +\def\setuplinetable + {\dotripleempty\dosetuplinetable} + +\def\dosetuplinetable[#1][#2][#3]% + {\ifthirdargument + \getparameters[\??le:#1:#2][#3]% + \else\ifsecondargument + \getparameters[\??lec#1][#2]% + \else + \getparameters[\??le][#1]% + \fi\fi} + +\setuplinetable + [\c!n=\!!maxcard, + \c!lines=\!!maxcard, + \c!nx=\plusone, + \c!nleft=0, + \c!repeat=\v!yes, % when \c!nleft>0, repeat on both pages + \c!before=, + \c!after=, + \c!inbetween=\page, + \c!distance=\zeropoint, + \c!stretch=\v!no, + \c!align=\c!right, + \c!leftoffset=.25ex, + \c!rightoffset=\linetableparameter\c!leftoffset, + \c!maxwidth=\zeropoint, + \c!width=5em, + \c!height=\v!fit, % \v!line = faster + \c!background=, + \c!backgroundcolor=] + +\def\linetableparameter#1% + {\csname\??le#1\endcsname} + +\def\doifelselinetablecparameter#1% + {\ifcsname\??lec\number\linetablecolumn#1\endcsname + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\def\linetablecparameter#1% + {\csname + \ifcsname\??lec\number\linetablecolumn#1\endcsname + \??lec\number\linetablecolumn + \else + \??le + \fi + #1\endcsname} + +\def\linetablerparameter#1% faster, leaner and meaner + {\csname + \ifnum\linetablerow=\zerocount % geen ifcase + \ifcsname\??ler\v!header#1\endcsname + \??ler\v!header#1% + \else\ifcsname\??ler0#1\endcsname + \??ler0#1% + \else + \s!empty + \fi\fi + \else + \ifcsname\??ler\number\linetablerow#1\endcsname + \??ler\number\linetablerow#1% + \else\ifcsname\??ler\v!oddeven\linetablerow#1\endcsname + \??ler\v!oddeven\linetablerow#1% + \else + \s!empty + \fi\fi + \fi + \endcsname} + +\def\setnoftableslines + {\doifelse{\linetableparameter\c!lines}\v!fit + {% whitespace already added by vertical strut + \ifdim\pagegoal<\maxdimen + \scratchdimen\pagegoal + \advance\scratchdimen -\pagetotal + \else + \scratchdimen\textheight + \fi + \getrawnoflines\scratchdimen + \xdef\noflinetablelines{\the\noflines} +\iflinetablepreroll \else \ifnum\noflinetablelines<\plustwo + \page \setnoftableslines +\fi \fi +} + {\xdef\noflinetablelines{\linetableparameter\c!lines}}} + +\def\startlinetablecell + {\dosingleempty\dostartlinetablecell} + +\def\dostartlinetablecell[#1]% + {\global\setbox\linetablecell\hbox\bgroup + \iffirstargument + \getparameters[\??lec\number\linetablecolumn][#1]% + \fi + \xdef\linetablestep{\linetablecparameter\c!nx}% + \ifcase\linetablestep\or + \scratchdimen\linetablecparameter\c!width + \scratchskip \linetablecparameter\c!distance + \else + \scratchdimen \zeropoint + \scratchskip \zeropoint + \scratchcounter\linetablecolumn + \dorecurse\linetablestep + {\advance\scratchdimen\linetablecparameter\c!width + %\advance\scratchskip \linetablecparameter\c!distance + \global\advance \linetablecolumn\plusone + \advance\scratchskip \linetablecparameter\c!distance + }% + \global\linetablecolumn\scratchcounter + \fi + \chardef\linetablemode + \iflinetablepreroll + \ifdim\scratchdimen>\zeropoint \zerocount \else \plustwo \fi + \else + \zerocount + \fi + \ifcase\linetablemode + \ifcase\linetablehmode + % nothing + \or + % fit, keep it simple + \or + \chardef\linetablemode\plusone % line + \else + % some already calculated height + \fi + \fi + \setbox\scratchbox\hbox + \bgroup + \dontcomplain + \hskip\linetablecparameter\c!leftoffset\relax + % 0 = width, unknown height + % 1 = width, fixed height + % 2 = no width, auto hsize + \ifnum\linetablemode<\plustwo + \advance\scratchdimen-\linetablecparameter\c!leftoffset + \advance\scratchdimen-\linetablecparameter\c!rightoffset + \fi + \ifcase\linetablemode + \dosetraggedcommand{\linetablecparameter\c!align}% + \vtop \ifdim\linetableheight>\zeropoint to\linetableheight \fi \bgroup + \hsize\scratchdimen + \raggedcommand + \else + \setalignmentswitch{\linetablecparameter\c!align}% + \hbox \ifcase\linetablemode \or to\scratchdimen \fi \bgroup + \ifcase\alignmentswitch\hss\or\hss\fi + \fi + \dostartattributes{\??lec\number\linetablecolumn}\c!style\c!color\empty + \begstrut \ignorespaces} + +% \def\stoplinetablecell +% {\unskip \endstrut +% \dostopattributes +% \ifcase\linetablemode +% \endgraf +% \else +% \ifcase\alignmentswitch\else\hss\fi +% \fi +% \egroup +% \hskip\linetablecparameter\c!rightoffset +% \egroup +% \iflinetablepreroll +% \box\scratchbox +% \else +% \doif{\linetablecparameter\c!background}\v!color +% {\backgroundline[\linetablecparameter\c!backgroundcolor]}% +% {\box\scratchbox}% +% \fi +% \egroup} + +\newconditional\linetableautoheight \settrue\linetableautoheight + +\def\stoplinetablecell + {\unskip \endstrut + \dostopattributes + \ifcase\linetablemode + \endgraf + \else + \ifcase\alignmentswitch\else\hss\fi + \fi + \egroup + \hskip\linetablecparameter\c!rightoffset + \egroup + \iflinetablepreroll + \box\scratchbox + \else + \doifelse{\linetablecparameter\c!background}\v!color + {\ifconditional\linetableautoheight + \hbox{\blackrule + [ \c!color=\linetablecparameter\c!backgroundcolor, + \c!height=\linetablerparameter{x\c!height}, + \c!depth=\linetablerparameter{x\c!depth}, + \c!width=\wd\scratchbox]% + \hskip-\wd\scratchbox\box\scratchbox}% + \else + \backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}% + \fi}% + {\box\scratchbox}% + \fi + \egroup} + +% \def\stoplinetablecell +% {\unskip \endstrut +% \dostopattributes +% \ifcase\linetablemode +% \endgraf +% \else +% \ifcase\alignmentswitch\else\hss\fi +% \fi +% \egroup +% \hskip\linetablecparameter\c!rightoffset +% \egroup +% \iflinetablepreroll +% \box\scratchbox +% \else +% \doifelse{\linetablecparameter\c!background}\v!color +% {\ifconditional\linetableautoheight +% % \hbox{\blackrule +% % [ \c!color=\linetablecparameter\c!backgroundcolor, +% % \c!height=\linetablerparameter{x\c!height}, +% % \c!depth=\linetablerparameter{x\c!depth}, +% % \c!width=\wd\scratchbox]% +% % \hskip-\wd\scratchbox\box\scratchbox}% +% \dp\scratchbox\linetablerparameter{x\c!depth}% +% \ht\scratchbox\linetablerparameter{x\c!height}% +% \framed +% [\c!offset=\v!overlay, +% \c!frameoffset=.5\linewidth, +% \c!leftframe=\v!off,\c!rightframe=\v!off, +% \c!background=\v!color, +% \c!backgroundcolor=\linetablecparameter\c!backgroundcolor% +% ]{\box\scratchbox}% +% \else +% \backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}% +% \fi}% +% {\box\scratchbox}% +% \fi +% \egroup} + +\def\savelinetablepart + {\global\setbox\tablebox\linetablepart + \ifnum\linetablepart=\zerocount + \box\scratchbox % just storing + \else + \vbox + {\ifvoid\tablebox\linetablepart\else\unvbox\tablebox\linetablepart\fi + \doif{\linetablerparameter\c!background}\v!color + {\backgroundline[\linetablerparameter\c!backgroundcolor]}% + {\box\scratchbox}% is also arg to \backgroundline + \endgraf + \linetablerparameter\c!after}% + \fi} + +\def\flushlinetableparts + {\doglobal\increment\linetableline + \ifnum\linetableline<\noflinetablelines + % keep collecting + \else + \iflinetablepreroll + % forget about them + \else + \dorecurse\noflinetableparts + {\let\linetablepart\recurselevel + \dp\tablebox\linetablepart\strutdepth + % noindent en endgraf needed else whitespace mess-up! + \whitespace % here not after verticalstrut + \ifdim\topskipgap=\zeropoint\else + \verticalstrut\nobreak\kern-\struttotal\kern-\parskip\nobreak\nointerlineskip % fix topskip + \fi + \noindent\strut\hbox to \hsize{\box\tablebox\linetablepart\hss}\endgraf + \ifnum\linetablepart<\noflinetableparts\relax + \linetableparameter\c!inbetween + \fi}% + \ifnum\linetablerows<\noflinetablerows\relax + \linetableparameter\c!inbetween + \else + % after, later + \fi + \chardef\linetableheadstate\plusthree + \global\setbox\tablebox\zerocount\emptybox % here + \fi + % reset \linetablerow will be an option, currently + % starts at zero after split + \globallet\linetablerow\!!zerocount + \globallet\linetableline\!!zerocount + \global\chardef\linetablepage\zerocount + \global\linetablewidth\zeropoint + \setnoftableslines + \fi} + +\def\startlinetablepart + {\global\linetablesubcol\zerocount + \setbox\scratchbox\hbox\bgroup + \doconvertfont{\linetablerparameter\c!style}% + \startcolor[\linetablerparameter\c!color]% + \ignorespaces} + +\def\stoplinetablepart + {\ifnum\linetablepart>\zerocount + \unskip \unskip % remove last intercolumn skip (distance+fill) + \fi + \stopcolor + \egroup + \iflinetablepreroll \else + \ifcase\linetablepart + % we're collecting the repeater + \else + \scratchdimen\hsize \advance\scratchdimen-\wd\scratchbox\relax + \ifdim\scratchdimen>\linetableparameter\c!stretch\else + \setbox\scratchbox\hbox to \hsize{\unhbox\scratchbox}% + \fi + \fi + \fi} + +\def\checklinetablepart + {\global\advance\linetablewidth\wd\linetablecell + \global\advance\linetablecolumn\linetablestep + \global\advance\linetablesubcol\linetablestep + \relax + %\message{\the\linetablecolumn,\the\linetablesubcol}\wait + % from now on the column counter is already incremented + \ifcase\linetablesplitstate + \iflinetablepreroll \else + \box\linetablecell + % the columncounter is one ahead ! +% \hskip\linetablecparameter\c!afstand + \hskip\scratchskip + \fi + %%% + \donefalse + \ifcase\linetablerepeat\else + % van te voren berekenen + \scratchcounter\linetablecolumn\advance\scratchcounter-\plustwo + \ifnum\linetablerepeat=\scratchcounter + \donetrue % collecting repeater + \fi + \fi + %%%% + \ifdone + % collecting repeater + \else + \ifnum\linetablecolumn>\getvalue{\??le::\linetablepart}\relax + \donetrue + \fi + \fi + \ifdone + \stoplinetablepart + \iflinetablepreroll \else + \savelinetablepart + \fi + \ifcase\linetablepage \or + \global\chardef\linetablepage \plustwo + \else + \global\chardef\linetablepage \plusone + \fi + \doglobal\increment\linetablepart + \global\linetablewidth\wd\tablebox\zerocount + \startlinetablepart + \fi + \else + \donefalse + \!!doneafalse + \ifcase\linetablerepeat\else + % van te voren berekenen + \scratchcounter\linetablecolumn \advance\scratchcounter-\plustwo + \ifnum\linetablerepeat=\scratchcounter + \donetrue % collecting repeater + \fi + \fi + \ifdone + \!!doneatrue + % collecting repeater + \else\ifdim\linetablewidth>\hsize + \donetrue + \else +% \global\advance\linetablewidth\linetablecparameter\c!afstand\relax + \global\advance\linetablewidth\scratchskip + \ifdim\linetablewidth>\hsize % ? + \donetrue + \fi + \fi\fi + \ifdone + \stoplinetablepart + \savelinetablepart + \ifcase\linetablepage \or + \global\chardef\linetablepage \plustwo + \else + \global\chardef\linetablepage \plusone + \fi + \doglobal\increment\linetablepart + \ifnum\linetablepart>\noflinetableparts + \globallet\noflinetableparts\linetablepart + \initializetablebox\linetablepart + \fi + \global\linetablewidth\wd\linetablecell + \startlinetablepart + \if!!doneb \else \ifcase\linetablerepeat \else + % check for left/right page + \ifcase\linetablepage\donetrue\or\donetrue\or\donefalse\fi\ifdone + % insert repeater + \global\advance\linetablewidth\wd\tablebox\zerocount + \iflinetablepreroll\kern\wd\else\unhcopy\fi\tablebox\zerocount + \fi + \fi \fi + \fi + \iflinetablepreroll \else + \box\linetablecell + % the columncounter is one ahead ! +% \hskip\linetablecparameter\c!afstand +% \hskip\scratchskip +\dorecurse\linetablestep{\strut\hfil}% + \hskip\scratchskip + \fi + \fi} + +% \linetableparameter\c!var -> \@@levar (when no classes) + +\def\startlinetablerun % to do: quit when nested + {\bgroup + \inlinetabletrue + % autowidth + \doif{\linetableparameter\c!maxwidth}\v!fit + {\setuplinetable[\c!maxwidth=\zeropoint]}% + \processaction + [\linetableparameter\c!stretch] + [ \v!no=>{\setuplinetable[\c!stretch=\maxdimen]},% no stretch + \v!yes=>{\setuplinetable[\c!stretch=\zeropoint]}]% max stretch + \chardef\linetablerepeat\linetableparameter\c!nleft + \chardef\linetablesplitstate % = + \ifdim\linetableparameter\c!maxwidth>\zeropoint + \zerocount \else \plusone + \fi + % optional prevdepth correction + \iflinetablepreroll + \globallet\noflinetablerows\!!zerocount + \else + \linetableparameter\c!before + \fi + \globallet\linetablerows\!!zerocount + \globallet\noflinetablecolumns\!!zerocount + \globallet\noflinetableparts\!!zerocount + \!!counta\zerocount + \def\docommand##1% + {\doglobal\increment\noflinetableparts + \advance\!!counta##1% + \setxvalue{\??le::\noflinetableparts}{\the\!!counta}}% + \processcommacommand[\linetableparameter\c!n]\docommand + \initializetableboxes\noflinetableparts + \ifcase\linetablerepeat + \globallet\linetablepart\!!plusone + \else + \globallet\linetablepart\!!zerocount % repeater + \fi + \globallet\linetablestep\!!plusone + \globallet\linetableline\!!zerocount + \globallet\linetablerow \!!zerocount + \global\linetablecolumn \zerocount + \global\linetablesubcol \zerocount + \global\linetablewidth \zeropoint +\iflinetablepreroll \else \ifdim\pagetotal>\zeropoint + \verticalstrut\kern-\struttotal +\fi \fi + \setnoftableslines + \checklinetablepage + \let\BR\linetableBR + \let\ER\linetableER + \let\BH\linetableBR + \let\EH\linetableER + \let\BC\linetableBC + \let\EC\linetableEC + \let\NC\linetableNC + \let\NR\linetableNR + \flushlinetablehead} + +\def\stoplinetablerun + {\globallet\linetableline\!!maxcard + \chardef\linetableheadstate\zerocount % blocked + \flushlinetableparts + \iflinetablepreroll \else + \linetableparameter\c!after + \fi + \globallet\linetablepart \!!zerocount + \globallet\noflinetableparts\!!zerocount + \egroup} + +% \def\checklinecolumnwidth +% {\ifundefined{\??lew\number\linetablecolumn}% +% \donetrue +% \else\ifdim\getvalue{\??lew\number\linetablecolumn}<\wd\linetablecell +% \donetrue +% \else +% \donefalse +% \fi\fi +% \ifdone +% \setxvalue{\??lew\number\linetablecolumn}{\the\wd\linetablecell}% +% \fi} +% +% \def\checklinecolumnwidth +% {\ifcsname\??lew\number\linetablecolumn\endcsname +% \ifdim\csname\??lew\number\linetablecolumn\endcsname<\wd\linetablecell +% \donetrue +% \else +% \donefalse +% \fi +% \else +% \donetrue +% \fi +% \ifdone +% \setxvalue{\??lew\number\linetablecolumn}{\the\wd\linetablecell}% +% \fi} + +% \def\checklinecolumnwidth +% {\expandafter\xdef\csname\??lew\number\linetablecolumn\endcsname +% {\expandafter\ifx\csname\??lew\number\linetablecolumn\endcsname\relax +% \the\wd\linetablecell +% \else\ifdim\csname\??lew\number\linetablecolumn\endcsname<\wd\linetablecell +% \the\wd\linetablecell +% \else +% \csname\??lew\number\linetablecolumn\endcsname +% \fi\fi}} + +\def\checklinecolumndimension#1#2#3% + {\expandafter\xdef\csname#1\number#3\endcsname + {\expandafter\ifx\csname#1\number#3\endcsname\relax + \the#2\linetablecell + \else\ifdim\csname#1\number#3\endcsname<#2\linetablecell + \the#2\linetablecell + \else + \csname#1\number#3\endcsname + \fi\fi}} + +\def\checklinecolumnwidth {\checklinecolumndimension\??lew\wd\linetablecolumn} +\def\checklinecolumnheight{\checklinecolumndimension\??leh\ht\linetablerow} +\def\checklinecolumndepth {\checklinecolumndimension\??led\dp\linetablerow} + +\def\linetableBR + {\dosingleempty\dolinetableBR} + +\def\dolinetableBR[#1]% #1 not yet implemented + {\ifnum\linetableheadstate=1\else + \doglobal\increment\linetablerow + \doglobal\increment\linetablerows + \fi + \global\linetablecolumn\plusone + \global\linetablesubcol\plusone +% \linetableheight\linetablerparameter\c!height +% +% \ifx\linetableheight\empty +% % nothing +% \else\ifx\linetableheight\v!fit +% % keep it simple +% \else\ifx\linetableheight\v!line +% \chardef\linetablemode\plusone +% \else +% \!!heighta\linetableheight +% \advance\!!heighta-\strutdepth +% \fi\fi\fi +% + \linetableheight\zeropoint + \edef\!!stringa{\linetablerparameter\c!height}% + \ifx\!!stringa\empty + \chardef\linetablehmode\zerocount + \else\ifx\!!stringa\v!fit + \chardef\linetablehmode\plusone + \else\ifx\!!stringa\v!line + \chardef\linetablehmode\plustwo + \else + \linetableheight\!!stringa + \advance\linetableheight-\strutdepth + \fi\fi\fi +% + \startlinetablepart} + +\def\linetableBC + {\startlinetablecell} + +\def\linetableEC + {\stoplinetablecell + \iflinetablepreroll + \checklinecolumnwidth + \checklinecolumnheight + \checklinecolumndepth + \fi + \checklinetablepart} + +\def\linetableER + {% \stoplinetablecell + % no \box\linetablecell, i.e. dummy columnn, last \NC \NR + \stoplinetablepart + \savelinetablepart + \advance\linetablecolumn \minusone + \ifnum\linetablecolumn>\noflinetablecolumns + \xdef\noflinetablecolumns{\number\linetablecolumn}% + \fi + \flushlinetableparts + \global\linetablecolumn\zerocount + \global\linetablewidth \zeropoint + \ifcase\linetablerepeat + \globallet\linetablepart\!!plusone + \else + \globallet\linetablepart\!!zerocount % repeater + \fi + \checklinetablepage + \flushlinetablehead} + +\def\checklinetablepage + {\global\chardef\linetablepage\zerocount + \ifcase\linetablerepeat \else \ifcase\linetablepage + \doif{\linetableparameter\c!repeat}\v!no + {\global\chardef\linetablepage\doifoddpageelse\plusone\plustwo}% + \fi \fi} + +\def\flushlinetablehead + {\ifcase\linetableheadstate + % 0 blocked + \or + % 1 doing head + \or + % 2 head done + \or + % 3 trigger flush + \chardef\linetableheadstate\plusone + \the\@@linetablehead\relax + \chardef\linetableheadstate\plustwo + \fi} + +\def\linetableNC % first time special treatment + {\relax + \ifcase\linetablecolumn + \linetableBR + \else + \linetableEC + \fi + \linetableBC} % beware, this will result in BR BC EC BC NR + +\def\linetableNR + {\stoplinetablecell % dummy + \linetableER} + +\def\startlinetable + {\startlinetablerun} + +\def\stoplinetable + {\stoplinetablerun} + +\def\startlinetableanalysis + {\bgroup + \linetableprerolltrue + \trialtypesettingtrue + \startlinetablerun} + +\def\stoplinetableanalysis + {\stoplinetablerun + \egroup + \globallet\noflinetablerows\linetablerows + \dorecurse\noflinetablerows % global, from last run {\linetableparameter\c!n} + {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}% + \setevalue{\??ler\recurselevel x\c!height}{\getvalue{\??leh\recurselevel}}% + \setevalue{\??ler\recurselevel x\c!depth }{\getvalue{\??led\recurselevel}}% + \letgvalue{\??leh\recurselevel}\!!zeropoint + \letgvalue{\??led\recurselevel}\!!zeropoint} + \dorecurse\noflinetablecolumns % global, from last run {\linetableparameter\c!n} + {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}% + \setevalue{\??lec\recurselevel\c!width}{\getvalue{\??lew\recurselevel}}% + \letgvalue{\??lew\recurselevel}\!!zeropoint}} % init next table + +% todo: store in box instead of macro + +\newtoks \@@linetablehead + +\long\def\startlinetablehead#1\stoplinetablehead + {\ifinlinetable + \@@linetablehead\emptytoks + \fi + \chardef\linetableheadstate3 % full + \@@linetablehead{#1}% + \ifinlinetable + \flushlinetablehead + \fi} + +\def\linetableBH + {\ifx\EC\relax + % signal, grabbing lines + \else + \@@linetablehead\emptytoks + \fi + \pushmacro\BC + \pushmacro\EC + \def\BC##1\EC{\appendtoks##1\to\@@linetablehead}% + \let\EC\relax} % signal + +\def\linetableEH + {\popmacro\EC + \popmacro\BC + \@EA\startlinetablehead\the\@@linetablehead\stoplinetablehead} + +\let\startlinetablebody\donothing +\let\stoplinetablebody \donothing + +\def\processlinetablebuffer + {\dosingleempty\doprocesslinetablebuffer} + +\def\doprocesslinetablebuffer[#1]% + {\bgroup + \let\startlinetable\donothing + \let\stoplinetable \donothing + \startlinetableanalysis\getbuffer[#1]\stoplinetableanalysis + \startlinetablerun \getbuffer[#1]\stoplinetablerun + \egroup} + +\def\processlinetablefile#1% + {\bgroup + \let\startlinetable\donothing + \let\stoplinetable \donothing + \startlinetableanalysis\readfile{#1}\donothing\donothing\stoplinetableanalysis + \startlinetablerun \readfile{#1}\donothing\donothing\stoplinetablerun + \egroup} + +% will go away: + +\def\processlinetableXMLfile#1% + {\bgroup + \let\startlinetable\donothing + \let\stoplinetable \donothing + \startlinetableanalysis\processXMLfile{#1}\stoplinetableanalysis + \startlinetablerun \processXMLfile{#1}\stoplinetablerun + \egroup} + +\protect \endinput + +\doifnotmode{demo}{\endinput} + +\setuplinetable[n=6,m={2,2,2},lines=25] % m ? + +\setuplinetable[c][1] [width=2cm,background=color,backgroundcolor=red] +\setuplinetable[c][4] [width=3cm,background=color,backgroundcolor=yellow] +\setuplinetable[c][6] [width=3cm,background=color,backgroundcolor=magenta] +\setuplinetable[r][odd] [background=color,backgroundcolor=gray] +\setuplinetable[r][even][background=color,backgroundcolor=green] + +\starttext + +\showframe \showstruts + +\setupcolors[state=start] + +\setuppagenumbering[alternative=doublesided]\page[left] + +\startlinetable +\NC aaa\crlf aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR +\dorecurse{100}{\NC aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR} +\stoplinetable + +\startlinetable +\NC[style=slanted,color=green,background=color,backgroundcolor=darkred,nx=2,uitlijnen=middle] xxx + \NC yy \NC ddddd \NC eeee \NC ff \NC \NR +\dorecurse{100}{\NC aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR} +\stoplinetable + +% \startbuffer[lt] +% \NC aaa\crlf aaa \NC bb \NC c \NC ddddd \NC ee \NC ff \NC \NR +% \NC aaa\crlf aaa \NC b \NC cc \NC ddd \NC eeee \NC f \NC \NR +% \stopbuffer +% +% \processlinetablebuffer[lt] + +\stoptext diff --git a/tex/context/base/tabl-ltb.tex b/tex/context/base/tabl-ltb.tex deleted file mode 100644 index e45fb1bc1..000000000 --- a/tex/context/base/tabl-ltb.tex +++ /dev/null @@ -1,856 +0,0 @@ -%D \module -%D [ file=core-ltb, -%D version=2002.10.31, -%D title=\CONTEXT\ Table Macros, -%D subtitle=Line Tables, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% testfile: tfmetrics.tex - -% todo: als nx>1, dan in geval van rek tussenruimte berekenen en optellen -% bij breedte, dus: nx nog niet gebruiken in combinatie met rek ! ! ! ! ! - -% This module is experimental, undocumented, and currently only set up -% eTeX. It provides a mechanism for typesetting very large tables, -% spanning many pages horizontally and vertically, with repeated -% header lines and (entry) columns, tab tracking, color, etc. In does -% two passes over a table, which is why the table goes into a -% buffer or file. As said, tables can be real huge. - -% \BH \BC .. \EC \BC .. \EC \EH % append -% \BR \BC .. \EC \BC .. \EC \ER -% -% or -% -% \NC .. \NC .. \NC \NR (todo: optional last \NC) - -% alternative: -% -% (1) direct run, save content in macro, but only if needed -% -% todo -% -% (2) buffered table content -% -% \startbuffer -% \startlinetablehead -% \stoplinetablehead -% \startlinetablebody -% \stoplinetablebody -% \stopbuffer -% -% \processlinetablebuffer[buffer] -% -% in buffer : head and body -% -% (3) unbuffered run, multipass -% -% - run with starting width zero / prev run -% - clip on prev run -% - flush real widths - -\writestatus{loading}{ConTeXt Table Macros / Line Tables} - -\unprotect - -\chardef\linetablesplitstate\zerocount -\chardef\linetableheadstate \zerocount - -\edef\??ler{\??le:r:} -\edef\??lec{\??le:c:} -\edef\??lew{\??le:w:} -\edef\??leh{\??le:h:} -\edef\??led{\??le:d:} - -\newif\iflinetablepreroll -\newif\ifinlinetable - -\newcount\linetablecolumn -\newcount\linetablesubcol -\newdimen\linetablewidth -\newdimen\linetableheight -\newbox \linetablecell - -\let\noflinetablecolumns\!!zerocount -\let\noflinetablerows \!!zerocount -\let\noflinetablelines \!!zerocount -\let\noflinetableparts \!!zerocount -\let\linetablepart \!!plusone -\let\linetablestep \!!plusone -\let\linetableline \!!zerocount -\let\linetablerow \!!zerocount -\let\linetablerows \!!zerocount - -\initializetablebox \zerocount % holds repeater - -\chardef\linetablehmode \zerocount -\chardef\linetablepage \zerocount -\chardef\linetablerepeat\zerocount - -\def\setuplinetable - {\dotripleempty\dosetuplinetable} - -\def\dosetuplinetable[#1][#2][#3]% - {\ifthirdargument - \getparameters[\??le:#1:#2][#3]% - \else\ifsecondargument - \getparameters[\??lec#1][#2]% - \else - \getparameters[\??le][#1]% - \fi\fi} - -\setuplinetable - [\c!n=\!!maxcard, - \c!lines=\!!maxcard, - \c!nx=\plusone, - \c!nleft=0, - \c!repeat=\v!yes, % when \c!nleft>0, repeat on both pages - \c!before=, - \c!after=, - \c!inbetween=\page, - \c!distance=\zeropoint, - \c!stretch=\v!no, - \c!align=\c!right, - \c!leftoffset=.25ex, - \c!rightoffset=\linetableparameter\c!leftoffset, - \c!maxwidth=\zeropoint, - \c!width=5em, - \c!height=\v!fit, % \v!line = faster - \c!background=, - \c!backgroundcolor=] - -\def\linetableparameter#1% - {\csname\??le#1\endcsname} - -\def\doifelselinetablecparameter#1% - {\ifcsname\??lec\number\linetablecolumn#1\endcsname - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\def\linetablecparameter#1% - {\csname - \ifcsname\??lec\number\linetablecolumn#1\endcsname - \??lec\number\linetablecolumn - \else - \??le - \fi - #1\endcsname} - -\def\linetablerparameter#1% faster, leaner and meaner - {\csname - \ifnum\linetablerow=\zerocount % geen ifcase - \ifcsname\??ler\v!header#1\endcsname - \??ler\v!header#1% - \else\ifcsname\??ler0#1\endcsname - \??ler0#1% - \else - \s!empty - \fi\fi - \else - \ifcsname\??ler\number\linetablerow#1\endcsname - \??ler\number\linetablerow#1% - \else\ifcsname\??ler\v!oddeven\linetablerow#1\endcsname - \??ler\v!oddeven\linetablerow#1% - \else - \s!empty - \fi\fi - \fi - \endcsname} - -\def\setnoftableslines - {\doifelse{\linetableparameter\c!lines}\v!fit - {% whitespace already added by vertical strut - \ifdim\pagegoal<\maxdimen - \scratchdimen\pagegoal - \advance\scratchdimen -\pagetotal - \else - \scratchdimen\textheight - \fi - \getrawnoflines\scratchdimen - \xdef\noflinetablelines{\the\noflines} -\iflinetablepreroll \else \ifnum\noflinetablelines<\plustwo - \page \setnoftableslines -\fi \fi -} - {\xdef\noflinetablelines{\linetableparameter\c!lines}}} - -\def\startlinetablecell - {\dosingleempty\dostartlinetablecell} - -\def\dostartlinetablecell[#1]% - {\global\setbox\linetablecell\hbox\bgroup - \iffirstargument - \getparameters[\??lec\number\linetablecolumn][#1]% - \fi - \xdef\linetablestep{\linetablecparameter\c!nx}% - \ifcase\linetablestep\or - \scratchdimen\linetablecparameter\c!width - \scratchskip \linetablecparameter\c!distance - \else - \scratchdimen \zeropoint - \scratchskip \zeropoint - \scratchcounter\linetablecolumn - \dorecurse\linetablestep - {\advance\scratchdimen\linetablecparameter\c!width - %\advance\scratchskip \linetablecparameter\c!distance - \global\advance \linetablecolumn\plusone - \advance\scratchskip \linetablecparameter\c!distance - }% - \global\linetablecolumn\scratchcounter - \fi - \chardef\linetablemode - \iflinetablepreroll - \ifdim\scratchdimen>\zeropoint \zerocount \else \plustwo \fi - \else - \zerocount - \fi - \ifcase\linetablemode - \ifcase\linetablehmode - % nothing - \or - % fit, keep it simple - \or - \chardef\linetablemode\plusone % line - \else - % some already calculated height - \fi - \fi - \setbox\scratchbox\hbox - \bgroup - \dontcomplain - \hskip\linetablecparameter\c!leftoffset\relax - % 0 = width, unknown height - % 1 = width, fixed height - % 2 = no width, auto hsize - \ifnum\linetablemode<\plustwo - \advance\scratchdimen-\linetablecparameter\c!leftoffset - \advance\scratchdimen-\linetablecparameter\c!rightoffset - \fi - \ifcase\linetablemode - \dosetraggedcommand{\linetablecparameter\c!align}% - \vtop \ifdim\linetableheight>\zeropoint to\linetableheight \fi \bgroup - \hsize\scratchdimen - \raggedcommand - \else - \setalignmentswitch{\linetablecparameter\c!align}% - \hbox \ifcase\linetablemode \or to\scratchdimen \fi \bgroup - \ifcase\alignmentswitch\hss\or\hss\fi - \fi - \dostartattributes{\??lec\number\linetablecolumn}\c!style\c!color\empty - \begstrut \ignorespaces} - -% \def\stoplinetablecell -% {\unskip \endstrut -% \dostopattributes -% \ifcase\linetablemode -% \endgraf -% \else -% \ifcase\alignmentswitch\else\hss\fi -% \fi -% \egroup -% \hskip\linetablecparameter\c!rightoffset -% \egroup -% \iflinetablepreroll -% \box\scratchbox -% \else -% \doif{\linetablecparameter\c!background}\v!color -% {\backgroundline[\linetablecparameter\c!backgroundcolor]}% -% {\box\scratchbox}% -% \fi -% \egroup} - -\newconditional\linetableautoheight \settrue\linetableautoheight - -\def\stoplinetablecell - {\unskip \endstrut - \dostopattributes - \ifcase\linetablemode - \endgraf - \else - \ifcase\alignmentswitch\else\hss\fi - \fi - \egroup - \hskip\linetablecparameter\c!rightoffset - \egroup - \iflinetablepreroll - \box\scratchbox - \else - \doifelse{\linetablecparameter\c!background}\v!color - {\ifconditional\linetableautoheight - \hbox{\blackrule - [ \c!color=\linetablecparameter\c!backgroundcolor, - \c!height=\linetablerparameter{x\c!height}, - \c!depth=\linetablerparameter{x\c!depth}, - \c!width=\wd\scratchbox]% - \hskip-\wd\scratchbox\box\scratchbox}% - \else - \backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}% - \fi}% - {\box\scratchbox}% - \fi - \egroup} - -% \def\stoplinetablecell -% {\unskip \endstrut -% \dostopattributes -% \ifcase\linetablemode -% \endgraf -% \else -% \ifcase\alignmentswitch\else\hss\fi -% \fi -% \egroup -% \hskip\linetablecparameter\c!rightoffset -% \egroup -% \iflinetablepreroll -% \box\scratchbox -% \else -% \doifelse{\linetablecparameter\c!background}\v!color -% {\ifconditional\linetableautoheight -% % \hbox{\blackrule -% % [ \c!color=\linetablecparameter\c!backgroundcolor, -% % \c!height=\linetablerparameter{x\c!height}, -% % \c!depth=\linetablerparameter{x\c!depth}, -% % \c!width=\wd\scratchbox]% -% % \hskip-\wd\scratchbox\box\scratchbox}% -% \dp\scratchbox\linetablerparameter{x\c!depth}% -% \ht\scratchbox\linetablerparameter{x\c!height}% -% \framed -% [\c!offset=\v!overlay, -% \c!frameoffset=.5\linewidth, -% \c!leftframe=\v!off,\c!rightframe=\v!off, -% \c!background=\v!color, -% \c!backgroundcolor=\linetablecparameter\c!backgroundcolor% -% ]{\box\scratchbox}% -% \else -% \backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}% -% \fi}% -% {\box\scratchbox}% -% \fi -% \egroup} - -\def\savelinetablepart - {\global\setbox\tablebox\linetablepart - \ifnum\linetablepart=\zerocount - \box\scratchbox % just storing - \else - \vbox - {\ifvoid\tablebox\linetablepart\else\unvbox\tablebox\linetablepart\fi - \doif{\linetablerparameter\c!background}\v!color - {\backgroundline[\linetablerparameter\c!backgroundcolor]}% - {\box\scratchbox}% is also arg to \backgroundline - \endgraf - \linetablerparameter\c!after}% - \fi} - -\def\flushlinetableparts - {\doglobal\increment\linetableline - \ifnum\linetableline<\noflinetablelines - % keep collecting - \else - \iflinetablepreroll - % forget about them - \else - \dorecurse\noflinetableparts - {\let\linetablepart\recurselevel - \dp\tablebox\linetablepart\strutdepth - % noindent en endgraf needed else whitespace mess-up! - \whitespace % here not after verticalstrut - \ifdim\topskipgap=\zeropoint\else - \verticalstrut\nobreak\kern-\struttotal\kern-\parskip\nobreak\nointerlineskip % fix topskip - \fi - \noindent\strut\hbox to \hsize{\box\tablebox\linetablepart\hss}\endgraf - \ifnum\linetablepart<\noflinetableparts\relax - \linetableparameter\c!inbetween - \fi}% - \ifnum\linetablerows<\noflinetablerows\relax - \linetableparameter\c!inbetween - \else - % after, later - \fi - \chardef\linetableheadstate\plusthree - \global\setbox\tablebox\zerocount\emptybox % here - \fi - % reset \linetablerow will be an option, currently - % starts at zero after split - \globallet\linetablerow\!!zerocount - \globallet\linetableline\!!zerocount - \global\chardef\linetablepage\zerocount - \global\linetablewidth\zeropoint - \setnoftableslines - \fi} - -\def\startlinetablepart - {\global\linetablesubcol\zerocount - \setbox\scratchbox\hbox\bgroup - \doconvertfont{\linetablerparameter\c!style}% - \startcolor[\linetablerparameter\c!color]% - \ignorespaces} - -\def\stoplinetablepart - {\ifnum\linetablepart>\zerocount - \unskip \unskip % remove last intercolumn skip (distance+fill) - \fi - \stopcolor - \egroup - \iflinetablepreroll \else - \ifcase\linetablepart - % we're collecting the repeater - \else - \scratchdimen\hsize \advance\scratchdimen-\wd\scratchbox\relax - \ifdim\scratchdimen>\linetableparameter\c!stretch\else - \setbox\scratchbox\hbox to \hsize{\unhbox\scratchbox}% - \fi - \fi - \fi} - -\def\checklinetablepart - {\global\advance\linetablewidth\wd\linetablecell - \global\advance\linetablecolumn\linetablestep - \global\advance\linetablesubcol\linetablestep - \relax - %\message{\the\linetablecolumn,\the\linetablesubcol}\wait - % from now on the column counter is already incremented - \ifcase\linetablesplitstate - \iflinetablepreroll \else - \box\linetablecell - % the columncounter is one ahead ! -% \hskip\linetablecparameter\c!afstand - \hskip\scratchskip - \fi - %%% - \donefalse - \ifcase\linetablerepeat\else - % van te voren berekenen - \scratchcounter\linetablecolumn\advance\scratchcounter-\plustwo - \ifnum\linetablerepeat=\scratchcounter - \donetrue % collecting repeater - \fi - \fi - %%%% - \ifdone - % collecting repeater - \else - \ifnum\linetablecolumn>\getvalue{\??le::\linetablepart}\relax - \donetrue - \fi - \fi - \ifdone - \stoplinetablepart - \iflinetablepreroll \else - \savelinetablepart - \fi - \ifcase\linetablepage \or - \global\chardef\linetablepage \plustwo - \else - \global\chardef\linetablepage \plusone - \fi - \doglobal\increment\linetablepart - \global\linetablewidth\wd\tablebox\zerocount - \startlinetablepart - \fi - \else - \donefalse - \!!doneafalse - \ifcase\linetablerepeat\else - % van te voren berekenen - \scratchcounter\linetablecolumn \advance\scratchcounter-\plustwo - \ifnum\linetablerepeat=\scratchcounter - \donetrue % collecting repeater - \fi - \fi - \ifdone - \!!doneatrue - % collecting repeater - \else\ifdim\linetablewidth>\hsize - \donetrue - \else -% \global\advance\linetablewidth\linetablecparameter\c!afstand\relax - \global\advance\linetablewidth\scratchskip - \ifdim\linetablewidth>\hsize % ? - \donetrue - \fi - \fi\fi - \ifdone - \stoplinetablepart - \savelinetablepart - \ifcase\linetablepage \or - \global\chardef\linetablepage \plustwo - \else - \global\chardef\linetablepage \plusone - \fi - \doglobal\increment\linetablepart - \ifnum\linetablepart>\noflinetableparts - \globallet\noflinetableparts\linetablepart - \initializetablebox\linetablepart - \fi - \global\linetablewidth\wd\linetablecell - \startlinetablepart - \if!!doneb \else \ifcase\linetablerepeat \else - % check for left/right page - \ifcase\linetablepage\donetrue\or\donetrue\or\donefalse\fi\ifdone - % insert repeater - \global\advance\linetablewidth\wd\tablebox\zerocount - \iflinetablepreroll\kern\wd\else\unhcopy\fi\tablebox\zerocount - \fi - \fi \fi - \fi - \iflinetablepreroll \else - \box\linetablecell - % the columncounter is one ahead ! -% \hskip\linetablecparameter\c!afstand -% \hskip\scratchskip -\dorecurse\linetablestep{\strut\hfil}% - \hskip\scratchskip - \fi - \fi} - -% \linetableparameter\c!var -> \@@levar (when no classes) - -\def\startlinetablerun % to do: quit when nested - {\bgroup - \inlinetabletrue - % autowidth - \doif{\linetableparameter\c!maxwidth}\v!fit - {\setuplinetable[\c!maxwidth=\zeropoint]}% - \processaction - [\linetableparameter\c!stretch] - [ \v!no=>{\setuplinetable[\c!stretch=\maxdimen]},% no stretch - \v!yes=>{\setuplinetable[\c!stretch=\zeropoint]}]% max stretch - \chardef\linetablerepeat\linetableparameter\c!nleft - \chardef\linetablesplitstate % = - \ifdim\linetableparameter\c!maxwidth>\zeropoint - \zerocount \else \plusone - \fi - % optional prevdepth correction - \iflinetablepreroll - \globallet\noflinetablerows\!!zerocount - \else - \linetableparameter\c!before - \fi - \globallet\linetablerows\!!zerocount - \globallet\noflinetablecolumns\!!zerocount - \globallet\noflinetableparts\!!zerocount - \!!counta\zerocount - \def\docommand##1% - {\doglobal\increment\noflinetableparts - \advance\!!counta##1% - \setxvalue{\??le::\noflinetableparts}{\the\!!counta}}% - \processcommacommand[\linetableparameter\c!n]\docommand - \initializetableboxes\noflinetableparts - \ifcase\linetablerepeat - \globallet\linetablepart\!!plusone - \else - \globallet\linetablepart\!!zerocount % repeater - \fi - \globallet\linetablestep\!!plusone - \globallet\linetableline\!!zerocount - \globallet\linetablerow \!!zerocount - \global\linetablecolumn \zerocount - \global\linetablesubcol \zerocount - \global\linetablewidth \zeropoint -\iflinetablepreroll \else \ifdim\pagetotal>\zeropoint - \verticalstrut\kern-\struttotal -\fi \fi - \setnoftableslines - \checklinetablepage - \let\BR\linetableBR - \let\ER\linetableER - \let\BH\linetableBR - \let\EH\linetableER - \let\BC\linetableBC - \let\EC\linetableEC - \let\NC\linetableNC - \let\NR\linetableNR - \flushlinetablehead} - -\def\stoplinetablerun - {\globallet\linetableline\!!maxcard - \chardef\linetableheadstate\zerocount % blocked - \flushlinetableparts - \iflinetablepreroll \else - \linetableparameter\c!after - \fi - \globallet\linetablepart \!!zerocount - \globallet\noflinetableparts\!!zerocount - \egroup} - -% \def\checklinecolumnwidth -% {\ifundefined{\??lew\number\linetablecolumn}% -% \donetrue -% \else\ifdim\getvalue{\??lew\number\linetablecolumn}<\wd\linetablecell -% \donetrue -% \else -% \donefalse -% \fi\fi -% \ifdone -% \setxvalue{\??lew\number\linetablecolumn}{\the\wd\linetablecell}% -% \fi} -% -% \def\checklinecolumnwidth -% {\ifcsname\??lew\number\linetablecolumn\endcsname -% \ifdim\csname\??lew\number\linetablecolumn\endcsname<\wd\linetablecell -% \donetrue -% \else -% \donefalse -% \fi -% \else -% \donetrue -% \fi -% \ifdone -% \setxvalue{\??lew\number\linetablecolumn}{\the\wd\linetablecell}% -% \fi} - -% \def\checklinecolumnwidth -% {\expandafter\xdef\csname\??lew\number\linetablecolumn\endcsname -% {\expandafter\ifx\csname\??lew\number\linetablecolumn\endcsname\relax -% \the\wd\linetablecell -% \else\ifdim\csname\??lew\number\linetablecolumn\endcsname<\wd\linetablecell -% \the\wd\linetablecell -% \else -% \csname\??lew\number\linetablecolumn\endcsname -% \fi\fi}} - -\def\checklinecolumndimension#1#2#3% - {\expandafter\xdef\csname#1\number#3\endcsname - {\expandafter\ifx\csname#1\number#3\endcsname\relax - \the#2\linetablecell - \else\ifdim\csname#1\number#3\endcsname<#2\linetablecell - \the#2\linetablecell - \else - \csname#1\number#3\endcsname - \fi\fi}} - -\def\checklinecolumnwidth {\checklinecolumndimension\??lew\wd\linetablecolumn} -\def\checklinecolumnheight{\checklinecolumndimension\??leh\ht\linetablerow} -\def\checklinecolumndepth {\checklinecolumndimension\??led\dp\linetablerow} - -\def\linetableBR - {\dosingleempty\dolinetableBR} - -\def\dolinetableBR[#1]% #1 not yet implemented - {\ifnum\linetableheadstate=1\else - \doglobal\increment\linetablerow - \doglobal\increment\linetablerows - \fi - \global\linetablecolumn\plusone - \global\linetablesubcol\plusone -% \linetableheight\linetablerparameter\c!height -% -% \ifx\linetableheight\empty -% % nothing -% \else\ifx\linetableheight\v!fit -% % keep it simple -% \else\ifx\linetableheight\v!line -% \chardef\linetablemode\plusone -% \else -% \!!heighta\linetableheight -% \advance\!!heighta-\strutdepth -% \fi\fi\fi -% - \linetableheight\zeropoint - \edef\!!stringa{\linetablerparameter\c!height}% - \ifx\!!stringa\empty - \chardef\linetablehmode\zerocount - \else\ifx\!!stringa\v!fit - \chardef\linetablehmode\plusone - \else\ifx\!!stringa\v!line - \chardef\linetablehmode\plustwo - \else - \linetableheight\!!stringa - \advance\linetableheight-\strutdepth - \fi\fi\fi -% - \startlinetablepart} - -\def\linetableBC - {\startlinetablecell} - -\def\linetableEC - {\stoplinetablecell - \iflinetablepreroll - \checklinecolumnwidth - \checklinecolumnheight - \checklinecolumndepth - \fi - \checklinetablepart} - -\def\linetableER - {% \stoplinetablecell - % no \box\linetablecell, i.e. dummy columnn, last \NC \NR - \stoplinetablepart - \savelinetablepart - \advance\linetablecolumn \minusone - \ifnum\linetablecolumn>\noflinetablecolumns - \xdef\noflinetablecolumns{\number\linetablecolumn}% - \fi - \flushlinetableparts - \global\linetablecolumn\zerocount - \global\linetablewidth \zeropoint - \ifcase\linetablerepeat - \globallet\linetablepart\!!plusone - \else - \globallet\linetablepart\!!zerocount % repeater - \fi - \checklinetablepage - \flushlinetablehead} - -\def\checklinetablepage - {\global\chardef\linetablepage\zerocount - \ifcase\linetablerepeat \else \ifcase\linetablepage - \doif{\linetableparameter\c!repeat}\v!no - {\global\chardef\linetablepage\doifoddpageelse\plusone\plustwo}% - \fi \fi} - -\def\flushlinetablehead - {\ifcase\linetableheadstate - % 0 blocked - \or - % 1 doing head - \or - % 2 head done - \or - % 3 trigger flush - \chardef\linetableheadstate\plusone - \the\@@linetablehead\relax - \chardef\linetableheadstate\plustwo - \fi} - -\def\linetableNC % first time special treatment - {\relax - \ifcase\linetablecolumn - \linetableBR - \else - \linetableEC - \fi - \linetableBC} % beware, this will result in BR BC EC BC NR - -\def\linetableNR - {\stoplinetablecell % dummy - \linetableER} - -\def\startlinetable - {\startlinetablerun} - -\def\stoplinetable - {\stoplinetablerun} - -\def\startlinetableanalysis - {\bgroup - \linetableprerolltrue - \trialtypesettingtrue - \startlinetablerun} - -\def\stoplinetableanalysis - {\stoplinetablerun - \egroup - \globallet\noflinetablerows\linetablerows - \dorecurse\noflinetablerows % global, from last run {\linetableparameter\c!n} - {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}% - \setevalue{\??ler\recurselevel x\c!height}{\getvalue{\??leh\recurselevel}}% - \setevalue{\??ler\recurselevel x\c!depth }{\getvalue{\??led\recurselevel}}% - \letgvalue{\??leh\recurselevel}\!!zeropoint - \letgvalue{\??led\recurselevel}\!!zeropoint} - \dorecurse\noflinetablecolumns % global, from last run {\linetableparameter\c!n} - {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}% - \setevalue{\??lec\recurselevel\c!width}{\getvalue{\??lew\recurselevel}}% - \letgvalue{\??lew\recurselevel}\!!zeropoint}} % init next table - -% todo: store in box instead of macro - -\newtoks \@@linetablehead - -\long\def\startlinetablehead#1\stoplinetablehead - {\ifinlinetable - \@@linetablehead\emptytoks - \fi - \chardef\linetableheadstate3 % full - \@@linetablehead{#1}% - \ifinlinetable - \flushlinetablehead - \fi} - -\def\linetableBH - {\ifx\EC\relax - % signal, grabbing lines - \else - \@@linetablehead\emptytoks - \fi - \pushmacro\BC - \pushmacro\EC - \def\BC##1\EC{\appendtoks##1\to\@@linetablehead}% - \let\EC\relax} % signal - -\def\linetableEH - {\popmacro\EC - \popmacro\BC - \@EA\startlinetablehead\the\@@linetablehead\stoplinetablehead} - -\let\startlinetablebody\donothing -\let\stoplinetablebody \donothing - -\def\processlinetablebuffer - {\dosingleempty\doprocesslinetablebuffer} - -\def\doprocesslinetablebuffer[#1]% - {\bgroup - \let\startlinetable\donothing - \let\stoplinetable \donothing - \startlinetableanalysis\getbuffer[#1]\stoplinetableanalysis - \startlinetablerun \getbuffer[#1]\stoplinetablerun - \egroup} - -\def\processlinetablefile#1% - {\bgroup - \let\startlinetable\donothing - \let\stoplinetable \donothing - \startlinetableanalysis\readfile{#1}\donothing\donothing\stoplinetableanalysis - \startlinetablerun \readfile{#1}\donothing\donothing\stoplinetablerun - \egroup} - -\protect \endinput - -\doifnotmode{demo}{\endinput} - -\setuplinetable[n=6,m={2,2,2},lines=25] % m ? - -\setuplinetable[c][1] [width=2cm,background=color,backgroundcolor=red] -\setuplinetable[c][4] [width=3cm,background=color,backgroundcolor=yellow] -\setuplinetable[c][6] [width=3cm,background=color,backgroundcolor=magenta] -\setuplinetable[r][odd] [background=color,backgroundcolor=gray] -\setuplinetable[r][even][background=color,backgroundcolor=green] - -\starttext - -\showframe \showstruts - -\setupcolors[state=start] - -\setuppagenumbering[alternative=doublesided]\page[left] - -\startlinetable -\NC aaa\crlf aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR -\dorecurse{100}{\NC aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR} -\stoplinetable - -\startlinetable -\NC[style=slanted,color=green,background=color,backgroundcolor=darkred,nx=2,uitlijnen=middle] xxx - \NC yy \NC ddddd \NC eeee \NC ff \NC \NR -\dorecurse{100}{\NC aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR} -\stoplinetable - -% \startbuffer[lt] -% \NC aaa\crlf aaa \NC bb \NC c \NC ddddd \NC ee \NC ff \NC \NR -% \NC aaa\crlf aaa \NC b \NC cc \NC ddd \NC eeee \NC f \NC \NR -% \stopbuffer -% -% \processlinetablebuffer[lt] - -\stoptext diff --git a/tex/context/base/tabl-ntb.mkiv b/tex/context/base/tabl-ntb.mkiv index ca932a5d9..e7df3b281 100644 --- a/tex/context/base/tabl-ntb.mkiv +++ b/tex/context/base/tabl-ntb.mkiv @@ -665,7 +665,6 @@ \processaction [\tbltblheader] [\v!repeat=>\multipleTBLheadstrue]% - \localcolortrue \presetallTABLEparameters \ExpandFirstAfter\processallactionsinset [\tbltbloption] @@ -955,7 +954,7 @@ \ifx\!!stringa\empty \box\scratchbox \else - \normalexpanded{\noexpand\gotobox{\box\scratchbox}[\!!stringa]}% + \normalexpanded{\noexpand\directgotobox{\box\scratchbox}[\!!stringa]}% to be checked \fi \box\scratchbox} diff --git a/tex/context/base/tabl-nte.mkii b/tex/context/base/tabl-nte.mkii new file mode 100644 index 000000000..cde64a033 --- /dev/null +++ b/tex/context/base/tabl-nte.mkii @@ -0,0 +1,107 @@ +%D \module +%D [ file=core-nte, +%D version=2009.03.08, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Natural Tables Extensions, +%D author=Hans Hagen \& Wolfgang Schuster, +%D date=\currentdate, +%D copyright=PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Module / Natural Tables Extensions} + +\unprotect + +%D This module is suggested by Wolfgang Schuster who also prototyped +%D it and came up with the rationale: +%D +%D This module provides an easy way to use natural in a similiar +%D way as the older table module (based on the \TABLE\ macros) and +%D the newer tabulate module. +%D +%D You can see the advantage in the following table, once created +%D with the new macros and once with the normal macros provided +%D with the natural table module. +%D +%D Let us start with the original macros: +%D +%D \starttyping +%D \bTABLE +%D \bTR +%D \bTD Text 1 \eTD +%D \bTD Text 2 \eTD +%D \eTR +%D \bTR +%D \bTD Text 3 \eTD +%D \bTD Text 4 \eTD +%D \eTR +%D \eTABLE +%D \stoptyping +%D +%D Watch how the new macros use less code: +%D +%D \starttyping +%D \startTABLE +%D \NC Text 1 \NC Text 2 \NC\NR +%D \NC Text 3 \NC Text 4 \NC\NR +%D \stopTABLE +%D \stoptyping +%D +%D The actual code differs from the prototype that it does not need +%D to collect whole rows and parse them but looks ahead instead. + +\def\startTABLE + {\dosingleempty\dostartTABLE} + +\def\dostartTABLE[#1]% + {\bgroup + \bTABLE[#1]% + \let\NC\doTABLENC + \let\NR\doTABLENR + \let\bTR\relax + \let\bTD\relax + \let\bTH\relax + \let\bTN\relax} + +\def\stopTABLE + {\eTABLE + \egroup} + +\newconditional\inTABLEnc + +\unexpanded\def\doTABLENR + {\eTR + \setfalse\inTABLEnc} + +\unexpanded\def\doTABLENC + {\futurelet\next\dodoTABLENC} + +\def\dodoTABLENC + {\ifx\next\doTABLENR \else + \expandafter\dododoTABLENC + \fi} + +% \long\def\dododoTABLENC#1\NC +% {\ifconditional\inTABLEnc\else\settrue\inTABLEnc\parseTR[][]\fi +% \parseTD[][]#1\eTD\NC} + +\long\def\dododoTABLENC#1\NC + {\ifconditional\inTABLEnc\else\settrue\inTABLEnc\parseTR[][]\fi + \dodoubleempty\parseTD#1\eTD\NC} + +%D The related structure commands are also available: + +\unexpanded\def\startTABLEhead{\dosingleempty\dostartTABLEhead} \let\stopTABLEhead\relax +\unexpanded\def\startTABLEnext{\dosingleempty\dostartTABLEnext} \let\stopTABLEnext\relax +\unexpanded\def\startTABLEbody{\dosingleempty\dostartTABLEbody} \let\stopTABLEbody\relax +\unexpanded\def\startTABLEfoot{\dosingleempty\dostartTABLEfoot} \let\stopTABLEfoot\relax + +\long\def\dostartTABLEhead[#1]#2\stopTABLEhead{\appendtoks\doTABLEsection[#1]{#2}\to\TBLhead} +\long\def\dostartTABLEnext[#1]#2\stopTABLEnext{\appendtoks\doTABLEsection[#1]{#2}\to\TBLnext} +\long\def\dostartTABLEbody[#1]#2\stopTABLEbody{\appendtoks\doTABLEsection[#1]{#2}\to\TBLbody} +\long\def\dostartTABLEfoot[#1]#2\stopTABLEfoot{\appendtoks\doTABLEsection[#1]{#2}\to\TBLfoot} + +\protect \endinput diff --git a/tex/context/base/tabl-nte.mkiv b/tex/context/base/tabl-nte.mkiv new file mode 100644 index 000000000..cde64a033 --- /dev/null +++ b/tex/context/base/tabl-nte.mkiv @@ -0,0 +1,107 @@ +%D \module +%D [ file=core-nte, +%D version=2009.03.08, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Natural Tables Extensions, +%D author=Hans Hagen \& Wolfgang Schuster, +%D date=\currentdate, +%D copyright=PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Module / Natural Tables Extensions} + +\unprotect + +%D This module is suggested by Wolfgang Schuster who also prototyped +%D it and came up with the rationale: +%D +%D This module provides an easy way to use natural in a similiar +%D way as the older table module (based on the \TABLE\ macros) and +%D the newer tabulate module. +%D +%D You can see the advantage in the following table, once created +%D with the new macros and once with the normal macros provided +%D with the natural table module. +%D +%D Let us start with the original macros: +%D +%D \starttyping +%D \bTABLE +%D \bTR +%D \bTD Text 1 \eTD +%D \bTD Text 2 \eTD +%D \eTR +%D \bTR +%D \bTD Text 3 \eTD +%D \bTD Text 4 \eTD +%D \eTR +%D \eTABLE +%D \stoptyping +%D +%D Watch how the new macros use less code: +%D +%D \starttyping +%D \startTABLE +%D \NC Text 1 \NC Text 2 \NC\NR +%D \NC Text 3 \NC Text 4 \NC\NR +%D \stopTABLE +%D \stoptyping +%D +%D The actual code differs from the prototype that it does not need +%D to collect whole rows and parse them but looks ahead instead. + +\def\startTABLE + {\dosingleempty\dostartTABLE} + +\def\dostartTABLE[#1]% + {\bgroup + \bTABLE[#1]% + \let\NC\doTABLENC + \let\NR\doTABLENR + \let\bTR\relax + \let\bTD\relax + \let\bTH\relax + \let\bTN\relax} + +\def\stopTABLE + {\eTABLE + \egroup} + +\newconditional\inTABLEnc + +\unexpanded\def\doTABLENR + {\eTR + \setfalse\inTABLEnc} + +\unexpanded\def\doTABLENC + {\futurelet\next\dodoTABLENC} + +\def\dodoTABLENC + {\ifx\next\doTABLENR \else + \expandafter\dododoTABLENC + \fi} + +% \long\def\dododoTABLENC#1\NC +% {\ifconditional\inTABLEnc\else\settrue\inTABLEnc\parseTR[][]\fi +% \parseTD[][]#1\eTD\NC} + +\long\def\dododoTABLENC#1\NC + {\ifconditional\inTABLEnc\else\settrue\inTABLEnc\parseTR[][]\fi + \dodoubleempty\parseTD#1\eTD\NC} + +%D The related structure commands are also available: + +\unexpanded\def\startTABLEhead{\dosingleempty\dostartTABLEhead} \let\stopTABLEhead\relax +\unexpanded\def\startTABLEnext{\dosingleempty\dostartTABLEnext} \let\stopTABLEnext\relax +\unexpanded\def\startTABLEbody{\dosingleempty\dostartTABLEbody} \let\stopTABLEbody\relax +\unexpanded\def\startTABLEfoot{\dosingleempty\dostartTABLEfoot} \let\stopTABLEfoot\relax + +\long\def\dostartTABLEhead[#1]#2\stopTABLEhead{\appendtoks\doTABLEsection[#1]{#2}\to\TBLhead} +\long\def\dostartTABLEnext[#1]#2\stopTABLEnext{\appendtoks\doTABLEsection[#1]{#2}\to\TBLnext} +\long\def\dostartTABLEbody[#1]#2\stopTABLEbody{\appendtoks\doTABLEsection[#1]{#2}\to\TBLbody} +\long\def\dostartTABLEfoot[#1]#2\stopTABLEfoot{\appendtoks\doTABLEsection[#1]{#2}\to\TBLfoot} + +\protect \endinput diff --git a/tex/context/base/tabl-nte.tex b/tex/context/base/tabl-nte.tex deleted file mode 100644 index cde64a033..000000000 --- a/tex/context/base/tabl-nte.tex +++ /dev/null @@ -1,107 +0,0 @@ -%D \module -%D [ file=core-nte, -%D version=2009.03.08, -%D title=\CONTEXT\ Table Macros, -%D subtitle=Natural Tables Extensions, -%D author=Hans Hagen \& Wolfgang Schuster, -%D date=\currentdate, -%D copyright=PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Table Module / Natural Tables Extensions} - -\unprotect - -%D This module is suggested by Wolfgang Schuster who also prototyped -%D it and came up with the rationale: -%D -%D This module provides an easy way to use natural in a similiar -%D way as the older table module (based on the \TABLE\ macros) and -%D the newer tabulate module. -%D -%D You can see the advantage in the following table, once created -%D with the new macros and once with the normal macros provided -%D with the natural table module. -%D -%D Let us start with the original macros: -%D -%D \starttyping -%D \bTABLE -%D \bTR -%D \bTD Text 1 \eTD -%D \bTD Text 2 \eTD -%D \eTR -%D \bTR -%D \bTD Text 3 \eTD -%D \bTD Text 4 \eTD -%D \eTR -%D \eTABLE -%D \stoptyping -%D -%D Watch how the new macros use less code: -%D -%D \starttyping -%D \startTABLE -%D \NC Text 1 \NC Text 2 \NC\NR -%D \NC Text 3 \NC Text 4 \NC\NR -%D \stopTABLE -%D \stoptyping -%D -%D The actual code differs from the prototype that it does not need -%D to collect whole rows and parse them but looks ahead instead. - -\def\startTABLE - {\dosingleempty\dostartTABLE} - -\def\dostartTABLE[#1]% - {\bgroup - \bTABLE[#1]% - \let\NC\doTABLENC - \let\NR\doTABLENR - \let\bTR\relax - \let\bTD\relax - \let\bTH\relax - \let\bTN\relax} - -\def\stopTABLE - {\eTABLE - \egroup} - -\newconditional\inTABLEnc - -\unexpanded\def\doTABLENR - {\eTR - \setfalse\inTABLEnc} - -\unexpanded\def\doTABLENC - {\futurelet\next\dodoTABLENC} - -\def\dodoTABLENC - {\ifx\next\doTABLENR \else - \expandafter\dododoTABLENC - \fi} - -% \long\def\dododoTABLENC#1\NC -% {\ifconditional\inTABLEnc\else\settrue\inTABLEnc\parseTR[][]\fi -% \parseTD[][]#1\eTD\NC} - -\long\def\dododoTABLENC#1\NC - {\ifconditional\inTABLEnc\else\settrue\inTABLEnc\parseTR[][]\fi - \dodoubleempty\parseTD#1\eTD\NC} - -%D The related structure commands are also available: - -\unexpanded\def\startTABLEhead{\dosingleempty\dostartTABLEhead} \let\stopTABLEhead\relax -\unexpanded\def\startTABLEnext{\dosingleempty\dostartTABLEnext} \let\stopTABLEnext\relax -\unexpanded\def\startTABLEbody{\dosingleempty\dostartTABLEbody} \let\stopTABLEbody\relax -\unexpanded\def\startTABLEfoot{\dosingleempty\dostartTABLEfoot} \let\stopTABLEfoot\relax - -\long\def\dostartTABLEhead[#1]#2\stopTABLEhead{\appendtoks\doTABLEsection[#1]{#2}\to\TBLhead} -\long\def\dostartTABLEnext[#1]#2\stopTABLEnext{\appendtoks\doTABLEsection[#1]{#2}\to\TBLnext} -\long\def\dostartTABLEbody[#1]#2\stopTABLEbody{\appendtoks\doTABLEsection[#1]{#2}\to\TBLbody} -\long\def\dostartTABLEfoot[#1]#2\stopTABLEfoot{\appendtoks\doTABLEsection[#1]{#2}\to\TBLfoot} - -\protect \endinput diff --git a/tex/context/base/tabl-pln.mkii b/tex/context/base/tabl-pln.mkii new file mode 100644 index 000000000..39bb50f23 --- /dev/null +++ b/tex/context/base/tabl-pln.mkii @@ -0,0 +1,91 @@ +%D The following bunch of macros come from plain \TEX\ by +%D Don Knuth and deal with basic alignment. We just include +%D them here so that they can be used if needed. Normally, +%D \CONTEXT\ users will fall back on one of the three table +%D environments. +%D +%D The hidden names are somewhat adapted and we use other +%D local variables. + +\writestatus{loading}{ConTeXt Table Macros / Plain Tabular} + +\unprotect + +\newif \if@@plnusetab +\newif \if@@plncr +\newbox \@@plntabs +\newbox \@@plntabsyet +\newbox \@@plntabsdone +\newdimen \@@plntabdimen + +\def\cleartabs % visible + {\global\setbox\@@plntabsyet\null + \setbox\@@plntabs\null} + +\def\settabs % visible + {\setbox\@@plntabs\null + \futurelet\next\@@plnsettabs} + +\def\tabalign % visible + {\@@plnusetabtrue\@@plnmaketabbox} + +\let\+\tabalign % no outer here (can be overloaded) + +\def\@@plnsettabs + {\ifx\next\+% + \def\nxt{\afterassignment\@@plnsettab\let\nxt}% + \else + \let\nxt\@@plnsetcols + \fi + \let\next\relax + \nxt} + +\def\@@plnsettab + {\let\nxt\relax + \@@plnusetabfalse\@@plnmaketabbox} + +\def\@@plnsetcols#1\columns + {\scratchcounter#1% + \@@plntabdimen\hsize + \loop + \ifnum\scratchcounter>\zerocount \@nother + \repeat} + +\def\@nother + {\scratchdimen\@@plntabdimen + \divide\scratchdimen\scratchcounter + \setbox\@@plntabs\hbox{\hbox to\scratchdimen{}\unhbox\@@plntabs}% + \advance\@@plntabdimen-\scratchdimen + \advance\scratchcounter\minusone} + +\def\@@plnmaketabbox + {\begingroup + \global\setbox\@@plntabsyet\copy\@@plntabs + \global\setbox\@@plntabsdone\null + \def\cr + {\@@plncrtrue\crcr\egroup\egroup + \if@@plnusetab\unvbox\zerocount\lastbox\fi\endgroup + \setbox\@@plntabs\hbox{\unhbox\@@plntabsyet\unhbox\@@plntabsdone}}% + \setbox\zerocount\vbox\bgroup\@@plncrfalse + \ialign\bgroup&\@@plnbegintabbox##\@@plnendtabbox\crcr} + +\def\@@plnbegintabbox + {\setbox\zerocount\hbox\bgroup} + +\def\@@plnendtabbox + {\if@@plncr + \egroup % now \box\zerocount holds the column + \else + \hss\egroup + \global\setbox\@@plntabsyet\hbox + {\unhbox\@@plntabsyet\global\setbox\plusone\lastbox}% now \box\plusone holds its size + \ifvoid\plusone + \global\setbox\plusone\hbox to\wd\zerocount{}% + \else + \setbox\zerocount\hbox to\wd\plusone{\unhbox\zerocount}% + \fi + \global\setbox\@@plntabsdone\hbox{\box\plusone\unhbox\@@plntabsdone}% + \fi + \box\zerocount} + +\protect \endinput diff --git a/tex/context/base/tabl-pln.mkiv b/tex/context/base/tabl-pln.mkiv new file mode 100644 index 000000000..39bb50f23 --- /dev/null +++ b/tex/context/base/tabl-pln.mkiv @@ -0,0 +1,91 @@ +%D The following bunch of macros come from plain \TEX\ by +%D Don Knuth and deal with basic alignment. We just include +%D them here so that they can be used if needed. Normally, +%D \CONTEXT\ users will fall back on one of the three table +%D environments. +%D +%D The hidden names are somewhat adapted and we use other +%D local variables. + +\writestatus{loading}{ConTeXt Table Macros / Plain Tabular} + +\unprotect + +\newif \if@@plnusetab +\newif \if@@plncr +\newbox \@@plntabs +\newbox \@@plntabsyet +\newbox \@@plntabsdone +\newdimen \@@plntabdimen + +\def\cleartabs % visible + {\global\setbox\@@plntabsyet\null + \setbox\@@plntabs\null} + +\def\settabs % visible + {\setbox\@@plntabs\null + \futurelet\next\@@plnsettabs} + +\def\tabalign % visible + {\@@plnusetabtrue\@@plnmaketabbox} + +\let\+\tabalign % no outer here (can be overloaded) + +\def\@@plnsettabs + {\ifx\next\+% + \def\nxt{\afterassignment\@@plnsettab\let\nxt}% + \else + \let\nxt\@@plnsetcols + \fi + \let\next\relax + \nxt} + +\def\@@plnsettab + {\let\nxt\relax + \@@plnusetabfalse\@@plnmaketabbox} + +\def\@@plnsetcols#1\columns + {\scratchcounter#1% + \@@plntabdimen\hsize + \loop + \ifnum\scratchcounter>\zerocount \@nother + \repeat} + +\def\@nother + {\scratchdimen\@@plntabdimen + \divide\scratchdimen\scratchcounter + \setbox\@@plntabs\hbox{\hbox to\scratchdimen{}\unhbox\@@plntabs}% + \advance\@@plntabdimen-\scratchdimen + \advance\scratchcounter\minusone} + +\def\@@plnmaketabbox + {\begingroup + \global\setbox\@@plntabsyet\copy\@@plntabs + \global\setbox\@@plntabsdone\null + \def\cr + {\@@plncrtrue\crcr\egroup\egroup + \if@@plnusetab\unvbox\zerocount\lastbox\fi\endgroup + \setbox\@@plntabs\hbox{\unhbox\@@plntabsyet\unhbox\@@plntabsdone}}% + \setbox\zerocount\vbox\bgroup\@@plncrfalse + \ialign\bgroup&\@@plnbegintabbox##\@@plnendtabbox\crcr} + +\def\@@plnbegintabbox + {\setbox\zerocount\hbox\bgroup} + +\def\@@plnendtabbox + {\if@@plncr + \egroup % now \box\zerocount holds the column + \else + \hss\egroup + \global\setbox\@@plntabsyet\hbox + {\unhbox\@@plntabsyet\global\setbox\plusone\lastbox}% now \box\plusone holds its size + \ifvoid\plusone + \global\setbox\plusone\hbox to\wd\zerocount{}% + \else + \setbox\zerocount\hbox to\wd\plusone{\unhbox\zerocount}% + \fi + \global\setbox\@@plntabsdone\hbox{\box\plusone\unhbox\@@plntabsdone}% + \fi + \box\zerocount} + +\protect \endinput diff --git a/tex/context/base/tabl-pln.tex b/tex/context/base/tabl-pln.tex deleted file mode 100644 index 39bb50f23..000000000 --- a/tex/context/base/tabl-pln.tex +++ /dev/null @@ -1,91 +0,0 @@ -%D The following bunch of macros come from plain \TEX\ by -%D Don Knuth and deal with basic alignment. We just include -%D them here so that they can be used if needed. Normally, -%D \CONTEXT\ users will fall back on one of the three table -%D environments. -%D -%D The hidden names are somewhat adapted and we use other -%D local variables. - -\writestatus{loading}{ConTeXt Table Macros / Plain Tabular} - -\unprotect - -\newif \if@@plnusetab -\newif \if@@plncr -\newbox \@@plntabs -\newbox \@@plntabsyet -\newbox \@@plntabsdone -\newdimen \@@plntabdimen - -\def\cleartabs % visible - {\global\setbox\@@plntabsyet\null - \setbox\@@plntabs\null} - -\def\settabs % visible - {\setbox\@@plntabs\null - \futurelet\next\@@plnsettabs} - -\def\tabalign % visible - {\@@plnusetabtrue\@@plnmaketabbox} - -\let\+\tabalign % no outer here (can be overloaded) - -\def\@@plnsettabs - {\ifx\next\+% - \def\nxt{\afterassignment\@@plnsettab\let\nxt}% - \else - \let\nxt\@@plnsetcols - \fi - \let\next\relax - \nxt} - -\def\@@plnsettab - {\let\nxt\relax - \@@plnusetabfalse\@@plnmaketabbox} - -\def\@@plnsetcols#1\columns - {\scratchcounter#1% - \@@plntabdimen\hsize - \loop - \ifnum\scratchcounter>\zerocount \@nother - \repeat} - -\def\@nother - {\scratchdimen\@@plntabdimen - \divide\scratchdimen\scratchcounter - \setbox\@@plntabs\hbox{\hbox to\scratchdimen{}\unhbox\@@plntabs}% - \advance\@@plntabdimen-\scratchdimen - \advance\scratchcounter\minusone} - -\def\@@plnmaketabbox - {\begingroup - \global\setbox\@@plntabsyet\copy\@@plntabs - \global\setbox\@@plntabsdone\null - \def\cr - {\@@plncrtrue\crcr\egroup\egroup - \if@@plnusetab\unvbox\zerocount\lastbox\fi\endgroup - \setbox\@@plntabs\hbox{\unhbox\@@plntabsyet\unhbox\@@plntabsdone}}% - \setbox\zerocount\vbox\bgroup\@@plncrfalse - \ialign\bgroup&\@@plnbegintabbox##\@@plnendtabbox\crcr} - -\def\@@plnbegintabbox - {\setbox\zerocount\hbox\bgroup} - -\def\@@plnendtabbox - {\if@@plncr - \egroup % now \box\zerocount holds the column - \else - \hss\egroup - \global\setbox\@@plntabsyet\hbox - {\unhbox\@@plntabsyet\global\setbox\plusone\lastbox}% now \box\plusone holds its size - \ifvoid\plusone - \global\setbox\plusone\hbox to\wd\zerocount{}% - \else - \setbox\zerocount\hbox to\wd\plusone{\unhbox\zerocount}% - \fi - \global\setbox\@@plntabsdone\hbox{\box\plusone\unhbox\@@plntabsdone}% - \fi - \box\zerocount} - -\protect \endinput diff --git a/tex/context/base/tabl-tab.mkii b/tex/context/base/tabl-tab.mkii new file mode 100644 index 000000000..e3bfca9c3 --- /dev/null +++ b/tex/context/base/tabl-tab.mkii @@ -0,0 +1,2515 @@ +%D \module +%D [ file=core-tab, +%D version=1997.10.10, +%D title=\CONTEXT\ Table Macros, +%D subtitle=\TABLE\ Embedding, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Macros / TaBlE Embedding} + +% By now it makes more sense to merge the patches into the original +% and clean that one up too. + +% \starttable[|||] +% \HL +% \VL test \VS test \VL \FR +% \VL test \VD test \VL \MR +% \VL test \VT test \VL \LR +% \HL +% \stoptable + +% Don't change the splitter: +% +% ... \NR +% \TABLEnoalign{\page}\TABLEhead +% \NC ... + +% e-tex: reverse rows or vadjust or ... in tables +% \ifalign +% \xhrule : calls for 'special' with width +% BUG: +% +% \starttable[|l|l|] +% \HL +% \RL\FR \VL Head 1 \VL Head 2 \VL\FR +% \RL\LR \VL Head A \VL Head B \VL\LR % niet grijs ?? +% \HL +% \VL 1 \VL 2 \VL\FR +% \VL a \VL b \VL\LR +% \HL +% \stoptable + +% melden als in kleur conflict, uitgestelde test op \SR\SR + +% verengelsen +% interface + +% footnotes flushen +% \......TABLE........ namen +% kolommen testen +% unbreakable kop definieren +% voetnoten +% meldingen +% als direct \use{max} dan fout +% \BREAKPOINT +% breedte lijn telt +% errors: ook gray in handle + +% \AR -> als in DL dan \DR + +% nieuw: +% +% \NL / \NL[blanko] is skip, nog default? +% geen \HL in a row +% \HL[n] +% \VL[n] + remembers +% c{colorspec} key +% \HC[color][width] +% \VC[color] +% meldingen row, column, use, advise +% \AR: UITSTELLEN / EXPERIMENTEEL + +% WAARDELOZE ERROR HANDLER +% THIS RENEWED MODULE WORKS OK BUT STILL LOOKS BAD + +%D We felt no need to write our own table building macros, +%D simply because Michael Wichura made a terrific one. This +%D package is quite complete and well documented. In \CONTEXT\ +%D we provide a shell for consistent spacing as well as color +%D support. Implementing these features without adapting the +%D original macros is not trivial. One easilly gets conflicts +%D with \type{\omit}, \type{\span} and \type{\noalign}, which +%D means that we end up postponing and overloading macros, +%D mostly global. Now, let's start with loading the main +%D macros: + +\doifundefined{BeginTable}{\doinputonce{table.tex}} + +\unprotect + +%D \macros +%D {inintable, ifsplittables} +%D +%D First we declare some variables. These show a bit what we +%D are dealing with. First we introdoce some booleans that +%D enable us, inside as well as outside this module, to +%D determine in what mode we are. + +\newif\ifintable +\newif\ifsplittables + +%D \macros +%D {tracetablestrue} +%D +%D When I documented this module, I felt the need for tracing +%D options. After implementing this feature, I also added +%D warnings, error recovery and automatic spacing. + +\newif\iftracetables + +%D We show this feature in an eample that also shows some of +%D the basic table typesetting commands. +%D +%D \startbuffer +%D \starttable[|||] +%D \HL +%D \VL first \VL second \VL\AR +%D \HL +%D \VL alfa \VL 1 \VL\AR +%D \VL beta \VL 2 \VL\AR +%D \VL gamma \VL 3 \VL\AR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \startcombination +%D {\tracetablesfalse\getbuffer} {\type{\tracetablesfalse}} +%D {\tracetablestrue\getbuffer} {\type{\tracetablestrue}} +%D \stopcombination +%D +%D This table is specified as: +%D +%D \typebuffer +%D +%D This examples shows about the minimum of commands needed to +%D typeset such a table. In this table, the \type {\AR} is +%D automatically translated into the more primitive (but more +%D verbose) commands \type {\SR}, \type {\FR}, \type {\MR} and +%D \type {\LR} commands. +%D +%D \startbuffer +%D \starttables[|||] +%D \HL +%D \VL first \VL second \VL\AR +%D \HL +%D \VL alfa \VL 1 \VL\AR +%D \VL beta \VL 2 \VL\AR +%D \VL gamma \VL 3 \VL\AR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D When we use the split table feature, we get a bit more +%D information. +%D +%D {\tracetablesfalse\getbuffer} +%D +%D Sometimes in tables information shows up that is not typed +%D in by the user. These messages give a cue in what aspect a +%D table definition is wrong. +%D +%D \startbuffer +%D \starttable[||||] +%D \HL +%D \VL first second \VL third \VL\AR +%D \HL +%D \VL alfa \VL 1 \VL a \VL\AR +%D \VL beta \VL 2 \VL b \VL +%D \VL gamma \VL \THREE{3} c \VL\AR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \typebuffer +%D +%D Those terrible table has three errors, which all show up in +%D typeset messages. Errors cannot always recovered 100\% and +%D therefore can result in two or more succesive messages, like +%D in the last row. +%D +%D \getbuffer + +%D Bringing color into tables is complicated by the mere fact +%D that color is not part of \TEX. The main complication is +%D that we don't know in advance how wide a column will be. I +%D implemented color support in tables in the early 90's +%D because I needed it for some articles on color. I have to +%D admit that I seldom use the mechanism. +%D +%D Most color support in \CONTEXT\ makes use of colored rules. +%D At first sight, one is tempted to implement colors in tables +%D in a similar way, but as said, we don't know the dimensions +%D in advance. It turns out however that we don't have to, +%D simply because alignments take care of stretching rules to +%D the appropritate dimensions. This means that we can provide +%D backgrounds by coloring rules with the height of a row, +%D skipping upwards and finally drawing the content, like in: +%D +%D \gdef\ShowExample +%D {\startfiguretext +%D {none} +%D {\getbuffer} +%D \typebuffer +%D \stopfiguretext} +%D +%D \startbuffer +%D \starttable[|c|c|] +%D \HL +%D \BL[2] \SR +%D \VL test \VL test \VL\SR +%D \HL +%D \VL test \VL test \VL\FR +%D \VL test \VL test \VL\MR +%D \VL test \VL test \VL\LR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D Just to be complete we show how the other columns can be +%D given a background. Later we will provide more details over +%D the commands used. +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \HL +%D \BL[3] \SR +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \HL +%D \BC \BL[2] \SR +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \HL +%D \BC \BC \BL \SR +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \HL +%D \BC \BL \SR +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \BL \BL \SR +%D \HL +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample + +%D In these examples we can clearly see that for being a real +%D background, the color or gray specification has to precede +%D the content. Just to keep things simple, we can recall this +%D specification later on: +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \BC \BL \SR +%D \HL +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \BR\FR +%D \VL test \VL test \VL test \VL\FR +%D \BR\MR +%D \VL test \VL test \VL test \VL\MR +%D \BR\LR +%D \VL test \VL test \VL test \VL\LR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D Close study learns that we can put the specification +%D before or after the \type{\HL}, whatever suits best. Keeping +%D track of these specifications is taken care of by the next +%D variables: + +\newif \ifTABLEgrayline % executing gray line +\newif \ifTABLEgraydone % gray line executed +\newtoks \TABLEgraytoks % gray line specification + +\newif\ifTABLEinbreak + +%D Nog vervangen: + +\def\c!Table{Table} +\def\m!TABLE{TABLE} + +%D We already saw that the table macros report errors and +%D provide automatic spacing. These features can only be +%D implemented by keeping track of the state, often the last +%D command on a row. + +\chardef\TABLEunknown = 0 + +\chardef\TABLEseparaterow = 1 +\chardef\TABLEfirstrow = 2 +\chardef\TABLEmidrow = 3 +\chardef\TABLElastrow = 4 +\chardef\TABLErule = 5 +\chardef\TABLEskip = 6 +\chardef\TABLEautorow = 7 + +\chardef\TABLEforcefirstrow = 1 +\chardef\TABLEforcelastrow = 2 + +\chardef\TABLEmissingrow = 1 +\chardef\TABLEmissingcolumn = 2 +\chardef\TABLEspanoverflow = 3 +\chardef\TABLEdivisionoverflow = 4 + +%D We store these states using efficient \type {\chardef}'s. +%D Like most variables, these are global ones. When needed, +%D especially when we flush the backgrounds, we can temporary +%D disable the assignment. + +\newif\ifsetTABLEaction + +\def\setTABLEaction#1% + {\ifsetTABLEaction\global\chardef\TABLEaction#1\fi} + +\def\setTABLEforce#1% + {\ifsetTABLEaction\global\chardef\TABLEforce#1\fi} + +\def\setTABLEerror#1% + {\global\chardef\TABLEerror#1} + +%D Before we come to using these variables, we redefine and/or +%D adapt some \TABLE\ macros. Within \TABLE's the \type{|} and +%D \type{"} have special meanings in templates and are active +%D during. Their meaning can therefore conflict with those +%D elsewhere defined. To be compatible with traditional \TABLE\ +%D as well as \CONTEXT's \type{||} and the active \type{"} +%D extensions for my german friends, we do some catcode magic. + +\newif\ifForgetTableBarAndQuote \ForgetTableBarAndQuotetrue + +% \bgroup + +% \catcode`\|=\@@active +% \catcode`\"=\@@active +% +% \gdef\pushouterbarandquote +% {\ifForgetTableBarAndQuote +% \ifnum\catcode`\|=\@@active \let\outertablebar |\else\let\outertablebar \relax\fi +% \ifnum\catcode`\"=\@@active \let\outertablequote"\else\let\outertablequote\relax\fi +% \let|\letterbar +% \let"\letterdoublequote +% \fi} +% +% \gdef\popouterbarandquote +% {\ifForgetTableBarAndQuote +% \ifx\outertablebar \relax\else\let|\outertablebar \fi +% \ifx\outertablequote\relax\else\let"\outertablequote\fi +% \else +% \redefinetablebarandquote +% \fi} +% +% \egroup +% +% \def\ObeyTableBarAndQuote +% {\ForgetTableBarAndQuotefalse +% \ifintable +% \redefinetablebarandquote +% \fi} + +\let\ActivateBarAndQuote \relax +\let\ObeyTableBarAndQuote\relax +\let\pushouterbarandquote\relax +\let\popouterbarandquote \relax + +%D \macros +%D {ObeyTableBarAndQuote} +%D +%D As said, the \type{|} and \type{"} active characters are +%D often used for other purposes. By default, the outside +%D meanings are therefore preserved and available inside +%D tables. If for some reason one wants to use the \TABLE\ +%D primitives, one can say: +%D +%D \starttyping +%D \ObeyTableBarAndQuote +%D \stoptyping +%D +%D To keep things verbose, as well as to show what \TABLE\ +%D commands we affect, we show some meanings. + +\def\normalTABLEshortrule {\!ttShortHrule} % \- +\def\normalTABLElongrule {\!ttLongHrule} % \= +\def\normalTABLEfullrule {\!ttFullHrule} % \_ +\def\normalTABLEendofrow {\!ttEndOfRow} % \\ +\def\normalTABLEsimplebar {\unskip\!ttRightGlue&&} % | +\def\normalTABLEcomplexbar {\unskip\!ttRightGlue&\omit\!ttAlternateVrule} % \| +\def\normalTABLEquote {\unskip\!ttRightGlue&\omit&} % " +\def\normalTABLElineformat {\normalTABLEendofrow+} +\def\normalTABLElineending {\normalTABLEendofrow0 } +\def\normalTABLEsinglerule {&\normalTABLElongrule&} +\def\normalTABLEmultirule#1{&\use{#1}\normalTABLElongrule&} + +%D The next hack is dedicated to Tobias, who found out that +%D paragraph entries don't break well. + +\def\TABLEhack{\hskip\zeropoint} + +%D The first attemp to solve this problem was: +%D +%D \starttyping +%D \def\normalTABLEquote% +%D {\unskip\TABLEhack\!ttRightGlue&\omit&\TABLEhack} +%D \stoptyping +%D +%D But, as usual, this interfered with \type {\omit}. +%D +%D The next attempt is redefining some core \TABLE\ macro:. +%D This works ok, but breaks for instance the~\type{b} +%D key handling. +%D +%D \starttyping +%D \def\!tfAdjoinPriorColumn% +%D {\ifnum\!taColumnNumber=0 +%D \!taPreamble=\!taRuleColumnTemplate +%D ... +%D \if!taOnceOnlyTabskip +%D \!thToksEdef\!taDataColumnTemplate= +%D {\TABLEhack####\TABLEhack\tabskip\the\!taLastRegularTabskip} +%D \else +%D \!taDataColumnTemplate{\TABLEhack##\TABLEhack}% +%D \fi +%D ... +%D \ReadFormatKeys} +%D \stoptyping + +% \newdimen\TABLEparheight + +\def\BeginTableParBox#1% + {\setbox\scratchbox\vtop\bgroup % \setbox added + \hsize#1\relax + \dontcomplain + \restoretablelineskips + \normalbaselines + \let~\!ttTie + \let\-\!ttDH + \blank[\v!disable]% % added + \the\EveryTableParBox} + +\def\EndTableParBox + {\removelastskip % itemize or so + \endgraf + \ifnum\prevgraf>\zerocount % we want at least + \verticalstrut \nowhitespace \vskip-\struttotal % one line of text + \egroup + \ifdim\dp\scratchbox>\lineheight % see (*) for an + \getnoflines{\dp\scratchbox}% % example of where + \dp\scratchbox\zeropoint % saving can go + \setbox\scratchbox % terrible wrong + \vtop to \noflines\lineheight{\box\scratchbox}% + \fi % esp between rows + \else % of paragraphs + \egroup + \fi +% \getboxheight\scratchdimen\of\box\scratchbox\relax% compensate for +% \ifdim\scratchdimen>\TABLEparheight % funny depth of +% \global\TABLEparheight\scratchdimen % multi-line box +% \fi % i.e. vtop + \box\scratchbox} + +% We also need to patch away the interfering math switch: + +% \mathpunctuationtrue + +% test, test +% \starttable[|c|] +% \NC1,,10\NC\AR +% \stoptable +% test, test + +\def\!ttBeginTableA[#1]{% + \if #1u% % "unboxed" table + \ifmmode + \def\!ttEndTable{% % user had better be in display math mode + \relax}% % and have only one table at the outer level + \else % user had better be in vertical mode + \bgroup + \def\!ttEndTable{% + \egroup}% + \fi + \else + %\hbox\bgroup $ + %\def\!ttEndTable{% + % \egroup % for the \vtop, \vbox, or \vcenter, yet to come + % $% for math mode + % \egroup}% for the \hbox + %\if #1t% + % \vtop + %\else + % \if #1b% + % \vbox + % \else + % \vcenter % math mode was essential for this + % \fi + %\fi + % + \hbox\bgroup + \def\!ttEndTable{\egroup\egroup}% + \if#1t% + \vtop + \else\if#1b% + \vbox + \else + \def\!ttEndTable{\egroup$\egroup}% + %$\vcenter + \scratchtoks\everymath\everymath\emptytoks$\everymath\scratchtoks\vcenter + \fi\fi + % + \bgroup % for the \vtop, \vbox, or \vcenter + \fi + \advance\!taRecursionLevel 1 % RecursionLevel governs initialization + \let\!ttRightGlue=\relax % This may be changed by \JustCenter, etc + \everycr\emptytoks % ={} + \ifnum \!taRecursionLevel=1 + \!ttInitializeTable + \fi} + +%D The next redefinition is more robust than the original: + +\def\SetTableToWidth#1% + {\doifelsenothing{#1}{\!taTableSpread\emptytoks}{\!taTableSpread{to #1}}} + +% (*) Try this one with \type {direction} and {girection}; +% the \PPCHTEX\ manual is a nice testcase. +% +% \startoverlay +% {\starttable[ | l w(2cm) | w(8cm) | ] +% \HL +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \MR +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \LR +% \HL +% \stoptable} +% {\starttable[ | l w(2cm) | p(8cm) | ] +% \HL +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \MR +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \LR +% \HL +% \stoptable} +% \stopoverlay +% \vskip2cm +% \starttable[ | l w(2cm) | p(8cm) | ] +% \HL +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR +% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \LR +% \HL +% \stoptable +% \vskip2cm +% \starttable[ | l w(2cm) | p(8cm) | ] +% \HL +% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \FR +% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \LR +% \HL +% \stoptable + +%D To give an impression of what the (well documented) source +%D of \TABLE\ looks like, we first implement an alternative for +%D the numeric keys. The quantity keys (\type{q} and \type{Q}) +%D support the more european way of writing numbers: +%D +%D \startnarrower +%D 100.000.000,00 instead of 100,000,000.00 +%D \stopnarrower +%D +%D The next table shows how to use these keys. We use braces +%D instead of brackets because we need brackets to specify the +%D format. +%D +%D \startbuffer +%D \starttable{|q[00,000]|Q[00,00]|} +%D \HL +%D \VL -1,2 \VL 12,35 \VL\FR +%D \VL 11,203 \VL 2,4 \VL\LR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D Although a more efficient implementation is possible |<|we +%D can for instance share common macros|>| we just adapt a copy +%D of the numeric ones. To permit double loading of this +%D module, we check for the existence of one of the macros. + +\letvalue{!tk<\string q>}=\undefined +\letvalue{!tk<\string Q>}=\undefined + +%D We just copy the original {\em comments}. +%D +%D \em Key \type{q}: quantity item, non||math mode. + +\NewFormatKey q% + {\letempty\!tqStyle + \futurelet\!tnext\!tqTestForBracket} + +%D \em Key \type{Q}: quantity item, math mode. + +\NewFormatKey Q% + {\def\!tqStyle{$}% + \futurelet\!tnext\!tqTestForBracket} + +%D \em Note: the space between a quantity entry and the +%D following \type{|}, \type{"}, or \type{\|} is mandatory. +%D empty quantity entries are not allowed: use \type{{}} or +%D \type{\omit} instead. +%D +%D \em Test for bracket: invoked by the keys \type{q} and +%D \type{Q}. + +\def\!tqTestForBracket + {\ifx[\!tnext + \!thx\!tqGetArgument + \else + \!thx\!tqGetCode + \fi} + +%D \em Get code: e.g. \type{4}, or \type{4,0}, \type{0,4}, or +%D \type{10,2}. + +\def\!tqGetCode#1 % note the blank + {\!tqConvertCode #1,,!} + +%D \em Convert code: e.g. converts above to \type{[0000]}, +%D \type{[0000,]}, \type{[,0000]}, \type{[0000000000,00]}. + +\def\!tqConvertCode #1,#2,#3!% + {\begingroup + \aftergroup\edef + \aftergroup\!ttemp + \aftergroup{% + \aftergroup[% + \!taCountA #1 + \!thLoop + \ifnum \!taCountA>\zerocount + \advance\!taCountA \minusone + \aftergroup0 + \repeat + \def\!ttemp{#3}% + \ifx\!ttemp\empty + \else + \aftergroup, + \!taCountA #2 + \!thLoop + \ifnum\!taCountA>\zerocount + \advance\!taCountA \minusone + \aftergroup0 + \repeat + \fi + \aftergroup]\aftergroup}% + \endgroup\relax + \!thx\!tqGetArgument\!ttemp} + +%D \em Get argument: +%D +%D \starttyping +%D +%D \stoptyping + +\def\!tqGetArgument[#1]% + {\!tqMakeQuantityTemplate\!tqStyle#1,,!} + +%D \em Make quantity template. + +\def\!tqMakeQuantityTemplate#1#2,#3,#4!% #1= or $ + {\def\!ttemp{#4}% + \ifx\!ttemp\empty + \!taDimenC\zeropoint + \else + \setbox0\hbox{\mathsurround\zeropoint #1,#3#1}% + \!taDimenC\wd0 + \fi + \setbox0\hbox{\mathsurround\zeropoint #1#2#1}% + \!thToksEdef\!taDataColumnTemplate + ={\noexpand\!tqSetQuantityItem{\the\wd0 }{\the\!taDimenC}{#1}% + \the\!taDataColumnTemplate}% + \ReadFormatKeys} + +%D \em Set numeric item. + +\def\!tqSetQuantityItem #1#2#3#4 % + {\!tqSetQuantityItemA{#1}{#2}{#3}#4,,!} + +\def\!tqSetQuantityItemA #1#2#3#4,#5,#6!% + {\def\!ttemp{#6}% + \hbox to #1{\hss\mathsurround\zeropoint#3#4#3}% + \hbox to #2{\ifx\!ttemp\empty\else\mathsurround\zeropoint#3,#5#3\fi\hss}} + +%D Here ends the Q||extension. Did you watch the clever use +%D of aftergroup in \type{\!tqConvertCode}. + +% %D We also (have to) define a key for \type{\cap}: +% +% \letvalue{!tk<\string K>}=\undefined +% +% \NewFormatKey K% +% {\ReadFormatKeys b\smallcapped} + +%D A few pages back we saw backgrounds, further on we will see +%D colored rules, and here we provide a means to color the +%D entries in a column. (We can of course always use the normal +%D color commands for individual entries.) We could not use the +%D lowercase~\type{c}, because that one is used to force {\em +%D centering}. +%D +%D \startbuffer +%D \starttable[|C{red}|C{green}|C{blue}|] +%D \VL R(ed) \VL G(reen) \VL B(lue) \VL\SR +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample + +\letvalue{!tk<\string C>}=\undefined + +\NewFormatKey C#1% + {\ReadFormatKeys b{\localstartcolor[#1]} a{\localstopcolor}} + +%D So now we have three new keys: +%D +%D \starttable[|||] +%D \HL +%D \NC \bf key \NC \bf meaning \NC\AR +%D \HL +%D \NC Q[x,y] \NC math mode formatted numbers \NC\AR +%D \NC q[x,y] \NC text mode formatted numbers \NC\AR +%D \NC C{identifier} \NC column entry color \NC\AR +%D \HL +%D \stoptable + +%D To be compatible with the tabulate environment, we also +%D support the \type {l}, \type {c} and \type {r} keys for +%D paragraph entries. + +\letvalue{!tk<\string l>}=\undefined +\letvalue{!tk<\string c>}=\undefined +\letvalue{!tk<\string r>}=\undefined +\letvalue{!tk<\string x>}=\undefined % not that needed + +\NewFormatKey c% + {\prependtoks\raggedcenter\to\!taDataColumnTemplate + \ReadFormatKeys \LeftGlue\hfil \RightGlue\hfil} + +\NewFormatKey l% + {\prependtoks\raggedright\to\!taDataColumnTemplate + \ReadFormatKeys \LeftGlue\empty \RightGlue\hfil} + +\NewFormatKey r% + {\prependtoks\raggedleft\to\!taDataColumnTemplate + \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty} + +\NewFormatKey x% + {\prependtoks\notragged\to\!taDataColumnTemplate + \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty} + +\appendtoks \TABLEparalignment \to \EveryTableParBox + +\def\!tfReFormat#1% + {\the \!taLeftGlue + \vbox{\forgetall\ialign{\span\the\!taDataColumnTemplate\cr#1\cr}}% + \the \!taRightGlue + \kern\zeropoint} % prevents \unskip / really needed + +%D Later on, we're going to implement multiple page table +%D support, therefore the next \TABLE\ macro needs to be +%D slightly adapted, i.c. the penalty is removed. We also +%D add basic color support. + +\def\!ttFullHruleA + {\!ttGetHalfRuleThickness + \startglobalTABLEcolor % added + \hrule\!thHeight\dimen0\!thDepth\dimen0 + \stopglobalTABLEcolor % added + %\penalty0 % removed + \egroup} + +%D We'll see that when we want to give a vertical rule a color, +%D we have to set and reset states. After heavy testing it +%D proved most useful to extend a \TABLE\ primitive with some +%D hooks. One thing to keep in mind is that \type{&} keeps +%D assignments local. Again, we add basic color support. + +\let\TABLEbeforebar\empty +\let\TABLEafterbar \empty + +\def\@VLn{1} +\def\@VLd{.125em} + +\def\do!ttInsertVrule % will be merged in 2005 + {\vrule \!thWidth + \ifnum\!tgCode=\plusone + \ifx\!tgValue\empty + \LineThicknessFactor + \else + \!tgValue + \fi + \LineThicknessUnit + \else + \!tgValue + \fi + \hskip\@VLd} + +\def\!ttInsertVrule + {\hfil + \TABLEbeforebar % added + \startglobalTABLEcolor % added + % we could do without this speedup, some day merge 'm + \ifcase\@VLn\or + \do!ttInsertVrule + \unskip + \else + \dorecurse\@VLn\do!ttInsertVrule + \gdef\@VLn{1}% + \unskip + \fi + \stopglobalTABLEcolor % added + \TABLEafterbar % added + \hfil + &} + +%D The next two macros are only adapted to basis rule +%D color support. + +\def\!tfSetVrule + {\!thToksEdef\!taRuleColumnTemplate= + {\noexpand\hfil + \noexpand\startglobalTABLEcolor % added + \noexpand\vrule + \noexpand\!thWidth + \ifnum\!tgCode=\plusone + \ifx\!tgValue\empty + \the\LineThicknessFactor + \else + \!tgValue + \fi + \!taLTU + \else + \!tgValue + \fi + ####% + \noexpand\hfil + \noexpand\stopglobalTABLEcolor % added + \the\!taRuleColumnTemplate}% + \!tfAdjoinPriorColumn} + +\def\!ttShortHruleA + {\!ttGetHalfRuleThickness + \startglobalTABLEcolor % added + \leaders\hrule\!thHeight\dimen0\!thDepth\dimen0\hfill + \stopglobalTABLEcolor % added + \null + \ignorespaces} + +%D We already showed the next one, but here we slightly adapt +%D the macro by adding an \type{\expandafter}. The space after +%D \type{#1} is crucial! + +\def\normalTABLEcomplexbar#1% + {\unskip\!ttRightGlue&\omit\expandafter\!ttAlternateVrule#1 } + +%D To get rid of interfering \type{\omit}'s when we are +%D checking the number of columns and reporting problems. The +%D extensions concern the second level check, the first +%D subbranch and advancing the column. + +\ifx\mscount\undefined \newcount\mscount \fi + +\def\!ttuse#1% + {\ifnum#1>\plusone + \omit + \global\TABLEdivisionfalse + \scratchcounter\currentTABLEcolumn % added + \advance\scratchcounter #1% % added + \advance\scratchcounter \minusone % added + \ifnum\scratchcounter>\maxTABLEcolumn % added + \def\next % added + {\setTABLEerror\TABLEspanoverflow % added + \handleTABLEerror}% % added + \else % added + \def\next % added + {\global\advance\currentTABLEcolumn #1% % added + \global\advance\currentTABLEcolumn \minusone % added + \mscount#1% \mscount is in Plain + \advance\mscount \minusone + \advance\mscount \mscount + \!thLoop + \ifnum\mscount>\plusone + \spanomit \advance\mscount\minusone + \repeat + \span}% + \fi % added + \else % added + \def\next % conflicts with possible next \omit % added + {\global\advance\currentTABLEcolumn \plusone}% % added + \fi + \next} % added + +% \starttable[|c|c|c|c|] +% \HL +% \VL {test} \VL \TWO{} \VL test \VL\FR +% \DL \DC \DL\DR +% \VL {test} \VL \TWO{} \VL test \VL\LR +% \HL +% \stoptable + +%D All commands that are executed between rows are to be put in +%D \type {\noalign}. We can however not verify if we (that is +%D \TABLE) does or did not enter this mode. A moderate dirty +%D but useful trick is using our own alternative:\footnote{Once +%D one has entered the stage of redefining \TEX\ primitives, +%D such hacks become a second nature. However, redefining \type +%D {\omit} and \type{\span} is not that easy.} + +\def\TABLEnoalign + {\noalign\bgroup\let\noalign\relax\let\next=} + +%D \macros +%D {starttable} +%D +%D The rest of this module is not easy to comprehend, mainly +%D because we have to take care of: +%D +%D \startitemize[packed] +%D \item \type{\startitemize[template]} +%D \item \type{\startitemize{template}} +%D \item \type{\startitemize[predefined]} +%D \stopitemize +%D +%D as well as: +%D +%D \startitemize[continue] +%D \item restart after table break +%D \stopitemize +%D +%D The official specification of the start command is: +%D +%D \showsetup{starttable} + +\newconditional\tablerepeathead +\newconditional\tablerepeattail + +\def\starttable + {\bgroup + \doif\@@tisplit\v!auto + {\ifinsidesplitfloat\let\@@tisplit\v!yes\fi}% + \doifinsetelse\@@tisplit{\v!yes,\v!repeat} + {\def\stoptable{\stoptables\egroup}% + \starttables} + {\doifelsenothing\@@tiframe + {\ifinsidefloat\else\startbaselinecorrection\fi} + {\startframedcontent[\@@tiframe]}% + \postponenotes + \firststagestartTABLE}} + +\def\stoptable + {\chuckTABLEautorow % before the tail, else noalign problem + \insertTABLEtail + \TABLEnoalign{\globalletempty\@@TABLEhead}% + \TABLEnoalign{\globalletempty\@@TABLEtail}% + \finishTABLE + \doifelsenothing\@@tiframe + {\ifinsidefloat\else + \stopbaselinecorrection + \goodbreak % compensates all the nobreaks + \fi} + \stopframedcontent + \egroup} + +%D Before we can grab the argument, we have to make sure that +%D the \CATCODES\ are set. The first stage takes care of that. + +\def\firststagestartTABLE + {\bgroup % kan-ie weg? + \global\intabletrue + \pushouterbarandquote + %catcode`\|=\@@other + \complexorsimple\secondstagestartTABLE} + +\def\simplesecondstagestartTABLE#1% + {\complexsecondstagestartTABLE[{#1}]} + +%D \macros +%D {definetabletemplate} +%D +%D The complex (and main) start macro first takes care of the +%D predefined case. Such a predefined setup looks like: +%D +%D \starttyping +%D \definetabletemplate[test][|||] +%D +%D \starttable[test] +%D \VL test \VL test \VL\AR +%D \VL test \VL test \VL\AR +%D \VL test \VL test \VL\AR +%D \stoptable +%D \stoptyping +%D +%D The implementation of the definition macro is not that +%D complicated: + +\def\definetabletemplate % to be redone + {\bgroup + \catcode`\|=\@@other + \doquadrupleempty\dodefinetabletemplate} + +\def\dodefinetabletemplate[#1][#2][#3][#4]% + {\ifsecondargument + \setgvalue{\c!Table#1}{\douseTABLEtemplate{#2}{#3}{#4}}% + \fi + \egroup} + +\def\douseTABLEtemplate#1#2#3% + {\gdef\TABLEhead{\getvalue{@@TABLEhead#2}}% + \gdef\TABLEtail{\getvalue{@@TABLEtail#3}}% + \complexsecondstagestartTABLE[#1]} + +%D The optional third and fourth arguments define which table +%D head and tail to use. +%D +%D \starttyping +%D \definetabletemplate[test][|||][before][after] +%D \stoptyping +%D +%D This also means that one can define table heads and tails +%D by name! +%D +%D \starttyping +%D \starttablehead[before] +%D \HL \VL first \VL second \VL \SR \HL +%D \stoptablehead +%D \stoptyping +%D +%D Templates defined this way get protected names, that cannot +%D conflict with existing commands. +%D +%D \showsetup{definetabletemplate} +%D +%D The second half of the next macro prepares table +%D splitting. + +\def\insertTABLEhead + {\TABLEnoalign{\global\settrue \preventTABLEbreak \global\setfalse\someTABLEhead}% + \TABLEhead + \TABLEnoalign{\global\setfalse\preventTABLEbreak}} + +\def\insertTABLEtail + {\TABLEnoalign{\global\settrue \preventTABLEbreak \global\setfalse\someTABLEtail}% + \TABLEtail + \TABLEnoalign{\global\setfalse\preventTABLEbreak}} + +% \def\dorestartTABLE#1% +% {\gdef\restartTABLE{#1}% +% \restartTABLE +% \insertTABLEhead +% \ifsplittables \ifconditional \tablerepeattail +% \TABLEnoalign{\goodbreak}% +% \insertTABLEtail +% \TABLEnoalign{\goodbreak}% +% \fi \fi} + +\def\verysimpleTableHL + {\TABLEnoalign{\expandafter\normalTABLEfullrule\@@tiHLheight}} + +\def\dorestartTABLE#1% + {\gdef\restartTABLE{#1}% + \restartTABLE + \TABLEnoalign{\globalpushmacro\simpleTableHL\global\let\simpleTableHL\verysimpleTableHL}% + \insertTABLEhead + \ifsplittables \ifconditional \tablerepeattail + \TABLEnoalign{\goodbreak}% + \insertTABLEtail + \TABLEnoalign{\goodbreak}% + \fi \fi + \TABLEnoalign{\globalpopmacro\simpleTableHL}} + +\bgroup \catcode`|=\@@other \catcode`"=\@@other + +\gdef\complexsecondstagestartTABLE#1[#2]% brr nested mess + {\bgroup + \@@useotherbar + \@@useotherquote + \global\setfalse\someTABLEhead + \global\setfalse\someTABLEtail + \expanded{\doifinstringelse{|}{#2}} + {\xdef\restartTABLE{\noexpand\dorestartTABLE{\noexpand\thirdstagestartTABLE{#2}}}} + {\doifdefinedelse{\c!Table#2} + {\gdef\restartTABLE{\getvalue{\c!Table#2}}} + {\gdef\restartTABLE{\dorestartTABLE{\getvalue{#2}}}}}% + \egroup + \restartTABLE} + +\egroup + +%D The third stage involves a lot of (re)sets, which we will +%D explain later. + +%D The next definition is convenient and more in tune with +%D \CONTEXT. + +\let \everytable \EveryTable + +%D We immediately use this register: + +\appendtoks + \fixedspaces + \let\_\normalunderscore +\to \everytable + +%D Now we can start the table. + +\def\thirdstagestartTABLE#1% + {\global\setTABLEactiontrue + \setTABLEaction\TABLEunknown + \setTABLEforce\TABLEunknown + \setTABLEerror\TABLEunknown + \global\TABLEgraylinefalse + \global\TABLEgraydonefalse + \globalletempty\TABLEgrayline + \globalletempty\nextTABLEgrayline + \globalletempty\TABLEgraylineerror + \globalletempty\TABLEgraylinestatus + \resetVLvalues + \appendtoks\popouterbarandquote\to\EveryTable + \appendtoks\localTABLEsetup\to\EveryTable + \BeginTable[\ifsplittables u\else b\fi]% + \defineTABLEunits + \defineTABLEsteps + \defineTABLErules + \defineTABLEdivisions + \defineTABLEshorthands + \defineTABLEbackgrounds + \defineTABLEendings + \forgetall % added + \doifsomething{#1} + {\def\TABLEformat{#1}% + \getTABLEnofcolumns\TABLEformat + % more modern is to use catcode tables + \expandafter\BeginFormat\TABLEformat\EndFormat}} + +\def\finishTABLE + {\chuckTABLEautorow + \unskip\crcr + \EndTable + \global\intablefalse + \egroup} + +%D \macros +%D {starttables} +%D +%D Split tables are specified using the plural form of the +%D start and stop commands. +%D +%D \showsetup{starttables} +%D +%D For example: +%D +%D \starttyping +%D \starttables[|||] +%D \HL +%D \VL element \VL atom weight \VL\AR +%D \HL +%D \VL ....... \VL ........... \VL\AR +%D \VL ....... \VL ........... \VL\AR +%D \HL +%D \stoptables +%D \stoptyping + +\newbox\tablecontentbox + +\def\starttables + {\bgroup + \splittablestrue + \doifelse\@@tisplit\v!repeat + {\settrue \tablerepeathead\settrue \tablerepeattail} + {\setfalse\tablerepeathead\setfalse\tablerepeattail}% + \flushnotes + \setbox\tablecontentbox\vbox\bgroup + \forgetall + \global\TABLEinbreakfalse + \firststagestartTABLE} + +% \def\stoptables +% {\ifconditional\tablerepeattail\else\insertTABLEtail\fi +% \finishTABLE +% \egroup +% \dosplittablebox\tablecontentbox +% \flushnotes +% \egroup} + +\def\stoptables + {\chuckTABLEautorow % AM: before the tail, else noalign problem + \ifconditional\tablerepeattail\else\insertTABLEtail\fi + \finishTABLE + \egroup +\dontcomplain + \dosplittablebox\tablecontentbox + \flushnotes + \egroup} + +\newdimen\TABLEcaptionheight % obsolete + +\def\dosplittablebox#1% + {\resettsplit + \def\tsplitminimumfreelines{2}% + \def\tsplitminimumfreespace{\TABLEcaptionheight}% + \setbox\tsplitcontent\box#1% + \ifconditional\tablerepeathead \ifconditional\someTABLEhead + \setbox\tsplithead\vsplit\tsplitcontent to \lineheight + \setbox\tsplithead\vbox{\unvbox\tsplithead}% + \fi \fi + \ifconditional\tablerepeattail \ifconditional\someTABLEtail + \setbox\tsplittail\vsplit\tsplitcontent to \lineheight + \setbox\tsplittail\vbox{\unvbox\tsplittail}% + \fi \fi + \ifinsidefloat\else + \def\tsplitbeforeresult{\startbaselinecorrection}% + \def\tsplitafterresult {\stopbaselinecorrection}% + \fi + \handletsplit} + +%D When the table in the previous example is split across +%D pages, only the first gets a head. We could have said +%D something like: +%D +%D \starttyping +%D \starttablekop +%D \HL +%D \VL element \VL atom weight \VL\AR +%D \HL +%D \stoptablekop +%D +%D \starttablestaart +%D \HL +%D \stoptablestaart +%D +%D \starttables[|||] +%D \VL ....... \VL ........... \VL\AR +%D \VL ....... \VL ........... \VL\AR +%D \stoptables +%D \stoptyping +%D +%D This time each split table gets a head line and ends with +%D a rule. Keep in mind that such heads also apply to the +%D unbroken ones and should be defined local (grouped) if +%D needed. The rather complicated definition below is due to +%D the fact that the stopcondition is interface language +%D dependant. + +\let\@@TABLEhead\empty \def\TABLEhead{\@@TABLEhead} +\let\@@TABLEtail\empty \def\TABLEtail{\@@TABLEtail} + +\letvalue{\e!start\v!tablehead}=\undefined +\letvalue{\e!stop \v!tablehead}=\undefined +\letvalue{\e!start\v!tabletail}=\undefined +\letvalue{\e!stop \v!tabletail}=\undefined + +\expanded + {\def\csname\e!start\v!tablehead\endcsname##1\csname\e!stop\v!tablehead\endcsname% + {\noexpand\setTABLEhead##1\noexpand\end}} + +\expanded + {\def\csname\e!start\v!tabletail\endcsname##1\csname\e!stop\v!tabletail\endcsname% + {\noexpand\setTABLEtail##1\noexpand\end}} + +%D The second argument is a dummy one, by scanning for it, we +%D get rid of interfering spaces. + +\def\setTABLEhead{\dodoubleempty\dosetTABLEhead} +\def\setTABLEtail{\dodoubleempty\dosetTABLEtail} + +\newconditional\preventTABLEbreak +\newconditional\someTABLEhead + +\def\dosetTABLEhead[#1][#2]#3\end{\setvalue{@@TABLEhead#1}{\TABLEnoalign{\global\settrue\someTABLEhead}#3}} +\def\dosetTABLEtail[#1][#2]#3\end{\setvalue{@@TABLEtail#1}{\TABLEnoalign{\global\settrue\someTABLEtail}#3}} + +%D Redudant \type{\HL}'s are removed automatically, so +%D mid||lines can be used without problems. + +%D We need an alternative for the normal complex or simple +%D commands, because assignments in these system commands +%D conflict with \type{\noalign}. This alternative is about +%D as efficient as possible. + +\def\complexorsimpleTable#1#2% + {\csname\if[\noexpand#2\s!complex\else\s!simple\fi\c!Table#1\endcsname#2} + +%D The next one is used in \type{\VL} cum suis and honours +%D the next grouping. + +\def\docomplexorsimpleTable#1#2% + {\ifx\next\bgroup\@EA#2\else\@EA\dodocomplexorsimpleTable\@EA#1\@EA#2\fi} + +\def\dodocomplexorsimpleTable#1#2#3% + {\if[\noexpand#3\@EA#1\else\@EA#2\fi#3} + +%D The order of the next macros is more or less random. First +%D we implement error recovery. Errors are reported to the +%D screen and log file as well as visualized in the table in +%D teletype. + +\def\handleTABLEerror + {\ifTABLEgrayline \else + \ifnum\TABLEerror=\TABLEunknown \else + \setTABLEaction\TABLEunknown + \globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow + \fi + \ifcase\TABLEerror + % no error + \or + % \TABLEmissingrow + \tttf [missing row]% + \writestatus\m!TABLE{missing row}% + \SR + \or + % \TABLEmissingcolumn + \fillTABLEcolumns + \tttf [missing column]% + \writestatus\m!TABLE{missing column}% + \SR + \or + % \TABLEspanoverflow + \fillTABLEcolumns + \tttf [columnspan too large]% + \writestatus\m!TABLE{columnspan too large}% + \SR + \or + % \TABLEdivisionoverflow + \fillTABLEcolumns + \tttf [division line too long]% + \writestatus\m!TABLE{division line too long}% + \SR + \fi + \fi + \ifnum\TABLEerror=\TABLEunknown \else + \finishTABLErow + \fi} + +\def\finishTABLErow + {\crcr + \TABLEnoalign + {\nobreak + \setTABLEaction\TABLEunknown + \setTABLEerror\TABLEunknown + \globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow + \global\currentTABLEcolumn\zerocount}} + +\def\fillTABLEcolumns + {\ifnum\currentTABLEcolumn>\maxTABLEcolumn \else + \global\advance\currentTABLEcolumn \plusone + \normalTABLEquote + \expandafter\fillTABLEcolumns + \fi} + +%D Next we enter the more complicated area of column and row +%D switching. I won't go into much detail from now on, but just +%D mention the general principles. +%D +%D \startitemize[3*ruim] +%D \sym{\type{\SR}} end a separate row (between rules) +%D \sym{\type{\FR}} end a first row (after a rule) +%D \sym{\type{\MR}} end a mid row (between text lines) +%D \sym{\type{\LR}} end a last row (before a rule) +%D \stopitemize +%D +%D and best of all: +%D +%D \startitemize[continue] +%D \sym{\type{\AR}} end a row with automatic spacing +%D \stopitemize +%D +%D As far as possible, we report confusing situations. In +%D most cases one can use \type{\AR}, which transfigurates +%D itself into one of the other types. +%D +%D \starttyping +%D \starttable[||] +%D \HL +%D \VL a separate row \VL\SR +%D \HL +%D \VL a first row \VL\FR +%D \VL a mid row \VL\MR +%D \VL a last row \VL\LR +%D \HL +%D \stoptable +%D \stoptyping +%D +%D In this example we could have used \type{\AR} without +%D problems. +%D +%D Color or gray scale backgrounds precede the content. They +%D are passed over horizontal (division) lines when needed. +%D Errors in the color template are traced elsewhere. Here we +%D only check for inconsistent spacing. Due to the way \TEX\ +%D handles alignments, we cannot automate spacing for colored +%D rows and columns. + +\chardef\TABLErowzero=0 + +\def\checkTABLErow#1% pure for message purposes + {\unskip % added + \ifTABLEgraydone + \defconvertedargument\asciia{#1}% + \defconvertedcommand \asciib\TABLEendBCL + \ifx\asciia\asciib \else + \writestatus\m!TABLE{confusing \asciia\space and \asciib}% + \gdef\TABLEgraylineerror% + {\globalletempty\TABLEgraylineerror + [\asciia\unskip<->\asciib\unskip]}% + \fi + \global\TABLEgraydonefalse + \fi} + +\def\defineTABLEendings + {\let\SR\TableSR + \let\FR\TableFR + \let\MR\TableMR + \let\LR\TableLR + \let\AR\TableAR} + +\def\TableSR + {\ifTABLEgrayline \else + \ifnum\TABLEaction=\TABLEfirstrow + \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}% + \else\ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}% + \else\ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}% + \fi\fi\fi + \fi + \checkTABLErow\SR + \endTABLErow\TABLEseparaterow\TABLErowfactor\TABLErowfactor} + +\def\TableFR + {\ifTABLEgrayline \else + \ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\FR\space into \string\MR/\string\LR}% + \else\ifnum\TABLEaction=\TABLElastrow + \writestatus\m!TABLE{change \string\FR\space into \string\MR/\string\LR}% + \fi\fi + \fi + \checkTABLErow\FR + \endTABLErow\TABLEfirstrow\TABLErowfactor\TABLErowzero} + +\def\TableMR + {\ifTABLEgrayline \else + \ifnum\TABLEaction=\TABLErule + \writestatus\m!TABLE{change \string\MR\space into \string\FR/\string\SR}% + \else\ifnum\TABLEaction=\TABLElastrow + \writestatus\m!TABLE{change \string\MR\space into \string\FR}% + \fi\fi + \fi + \checkTABLErow\MR + \endTABLErow\TABLEmidrow00} + +\def\TableLR + {\ifTABLEgrayline \else + \ifnum\TABLEaction=\TABLErule + \writestatus\m!TABLE{change \string\LR\space into \string\FR/\string\SR}% + \fi + \fi + \checkTABLErow\LR + \endTABLErow\TABLElastrow\TABLErowzero\TABLErowfactor} + +%D \macros +%D {ifcheckTABLEcolums} +%D +%D +%D The next macros handle the actual row ending. This macro +%D also take care of space corrections due to table splitting +%D when \type{\MR} and collegues are used. When tracing is +%D enabled, the corrections as well as the values used to +%D determine the available space are shown (in color). By default +%D checking is off. + +\newif\ifcheckTABLEcolumns + +\let\beforeTABLEline\empty +\let\afterTABLEline \empty + +\def\doendTABLErow#1#2#3% + {\handleTABLEbreak#2#3% + \beforeTABLEline + \ifcase#1\relax + % unknown + \or + \endofTABLEline[blue][\SR->\SR]\TABLErowfactor\TABLErowfactor + \or + \endofTABLEline[red][\FR->\FR]\TABLErowfactor\TABLErowzero + \or + \ifnum\TABLEforce=\TABLEforcelastrow + \endofTABLEline[red][\MR->\LR]\TABLErowzero\TABLErowfactor + \else\ifnum\TABLEforce=\TABLEforcefirstrow + \endofTABLEline[red][\MR->\FR]\TABLErowfactor\TABLErowzero + \else + \endofTABLEline[green][\MR->\MR]\TABLErowzero\TABLErowzero + \fi\fi + \or + \endofTABLEline[red][\LR->\LR]\TABLErowzero\TABLErowfactor + \fi + \TABLEnoalign + {\setTABLEforce\TABLEunknown + \global\currentTABLEcolumn\zerocount}% + \afterTABLEline} + +\def\endTABLErow#1#2#3% + {\setTABLEaction#1% + \ifTABLEgrayline + \finishTABLErow + \else + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \doendTABLErow{#1}{#2}{#3}% + \else\ifcheckTABLEcolumns + \setTABLEerror\TABLEmissingcolumn + \handleTABLEerror + \else + \doendTABLErow{#1}{#2}{#3}% + \fi\fi + \fi} + +%D Handling \type{\AR} is postponed till the next row. The +%D check takes care of the first and mid rows, the chuck macro +%D |<|how about that name|>| handles the last row. + +\def\TableAR + {\ifTABLEgraydone + \globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow + \global\TABLEgraydonefalse + \TABLEendBCL + \else + \globallet\checkTABLEautorow\docheckTABLEautorow + \globallet\chuckTABLEautorow\dochuckTABLEautorow + \fi} + +\let\checkTABLEautorow\empty +\let\chuckTABLEautorow\empty + +\def\docheckTABLEautorow + {\globallet\checkTABLEautorow\empty + \ifnum\TABLEaction=\TABLErule \FR + \else\ifnum\TABLEaction=\TABLEunknown \FR + \else \MR + \fi\fi} + +\def\dochuckTABLEautorow + {\globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow + \ifnum\TABLEaction=\TABLErule \SR + \else\ifnum\TABLEaction=\TABLEunknown \SR + \else \LR + \fi\fi} + +%D When a table is split, we also add a tail and when present +%D we repeat the table head. + +\def\handleTABLEbreak#1#2% + {\globalletempty\beforeTABLEline + \gdef\afterTABLEline{\TABLEnoalign{\ifconditional\preventTABLEbreak\nobreak\else\goodbreak\fi}}} + +%D When tables are split, the spacing before and after a +%D horizontal rule is corrected according to what we expect. + +\def\endofTABLEline[#1][#2->#3]#4#5% + {\ifx#2#3\else + \writestatus\m!TABLE{\string#2\space changed into \string#3}% + \fi + \iftracetables + \bgroup + \tttf\space + \ifnum\TABLEerror=\TABLEunknown + \ifx#2#3\else\string#2->\fi + \else + ->% + \fi + \color[#1]{\string#3}% + \ifx\TABLEgraylineerror\empty + \space\TABLEgraylinestatus + \else + \space\TABLEgraylineerror + \fi + \egroup + \else\ifx\TABLEgraylineerror\empty \else + % \bgroup + % \tttf\space\TABLEgraylineerror + % \egroup + \fi\fi + \globalletempty\TABLEgraylinestatus + \globalletempty\TABLEgraylineerror + \expandafter\normalTABLElineformat#4#5\crcr % \crcr nodig ? + \TABLEnoalign{\nobreak\global\setTABLEactiontrue}} + +%D In order to prevent (as good as possible) alignment overflow +%D and therefore \TEX\ error messages, we check the maximum +%D number of columns. We keep track of the current column and +%D maximum column by means of two \COUNTERS. Keep in mind that +%D the number of \type{|}'s and \type{\VL}'s or alike is always +%D one more than the number of columns. + +\newcount\currentTABLEcolumn +\newcount\maxTABLEcolumn + +%D While defining this macro we change the \CATCODE\ of +%D \type{|}. When counting the bars, we use a non active +%D representation of the bar, simply because we cannot be sure +%D if the bar is active or not.\footnote{Normally it is, but +%D \TABLE\ changes the catcode when needed.} + +\bgroup + \catcode`\|=\@@other \gdef\@@otherbar {|} + \catcode`\"=\@@other \gdef\@@otherquote {"} + \catcode`\|=\@@active \gdef\@@useotherbar {\let|\@@otherbar} + \catcode`\"=\@@active \gdef\@@useotherquote{\let"\@@otherquote} +\egroup + +\bgroup \catcode`\|=\@@other + +\gdef\getTABLEnofcolumns#1% + {\bgroup + \cleanupfeatures % needed ! + \@@useotherbar + \@@useotherquote + \expanded{\defconvertedargument\noexpand\ascii{#1}}% + \@EA\doglobal\@EA\counttoken\@EA|\@EA\in\ascii\to\maxTABLEcolumn + \global\advance\maxTABLEcolumn \minusone + % in case of & counting, divide by 2 + \egroup} + +\egroup + +\def\!ttDoHalign + {\edef\restoretablelineskips + {\baselineskip \the\baselineskip + \lineskiplimit\the\lineskiplimit + \lineskip \the\lineskip + \tabskip \the\tabskip}% + \baselineskip \zeropoint + \lineskiplimit\zeropoint + \lineskip \zeropoint + \tabskip \zeropoint + % does not work in normal tex + % \expanded{\getTABLEnofcolumns{\the\!taPreamble}}% added + \halign \the\!taTableSpread \bgroup + \span\the\!taPreamble + \ifx \!tfRowOfWidths \empty \else \!tfRowOfWidths \cr \fi} + +%D \startitemize[3*ruim] +%D \sym{\type{\VL}} a vertical line +%D \sym{\type{\VC}} a vertical colored line +%D \sym{\type{\HL}} a horizontal line +%D \sym{\type{\HC}} a horizontal colored line +%D \stopitemize + +% \def\defineTABLErules +% {\let\VL\TableVL +% \let\VC\TableVC +% \let\HL\TableHL +% \let\HC\TableHC} + +\def\defineTABLErules + {\let\VL\TableVL + \let\VC\TableVC + \let\HL\TableHL + \let\HC\TableHC + \let\VS\TableVS + \let\VD\TableVD + \let\VT\TableVT + \let\VN\TableVN} + +\def\TableVL + {\checkTABLEautorow + \nextTABLEgrayline + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \else + \global\advance\currentTABLEcolumn \plusone + \expandafter\doTableVL + \fi} + +\def\doTableVL + {\futurelet\next\dodoTableVL} + +\def\dodoTableVL + {\docomplexorsimpleTable\complexTableVL\simpleTableVL} + +\def\complexTableVL[#1]% + {\scratchcounter=0#1% + \multiply\scratchcounter \@@tiVLwidth + \setxvalue{wVL\the\currentTABLEcolumn}{\the\scratchcounter}% + \simpleTableVL} + +\def\simpleTableVL + {\doifundefined{wVL\the\currentTABLEcolumn}% + {\setgvalue{wVL\the\currentTABLEcolumn}{\@@tiVLwidth}}% + \gdef\TABLEbeforebar + {\getvalue{bVL\the\currentTABLEcolumn}% + \letgvalueempty{bVL\the\currentTABLEcolumn}}% + \gdef\TABLEafterbar + {\getvalue{eVL\the\currentTABLEcolumn}% + \letgvalueempty{eVL\the\currentTABLEcolumn}}% + \edef\@@tiVLwidth{\getvalue{wVL\the\currentTABLEcolumn}}% + \expanded{\normalTABLEcomplexbar\@@tiVLwidth\space}}% \relax breaks \use + +% \starttable[|||] +% \HL +% \VL test \VS test \VL \FR +% \VL test \VD test \VL \MR +% \VL test \VT test \VL \LR +% \HL +% \stoptable + +\def\TableVS {\VN1} +\def\TableVD {\VN2} +\def\TableVT {\VN3} +\def\TableVN#1{\gdef\@VLn{#1}\VL} + +\def\resetVLvalues + {\dostepwiserecurse\zerocount\maxTABLEcolumn\plusone + {\setgvalue{wVL\recurselevel}{\@@tiVLwidth}% + \letgvalueempty{bVL\recurselevel}% + \letgvalueempty{eVL\recurselevel}}% + \global\currentTABLEcolumn\zerocount} + +\def\TableVC + {\checkTABLEautorow + \nextTABLEgrayline + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \else + \global\advance\currentTABLEcolumn \plusone + \expandafter\doTableVC + \fi} + +\def\doTableVC + {\futurelet\next\dodoTableVC} + +\def\dodoTableVC + {\docomplexorsimpleTable\complexTableVC\simpleTableVC} + +\def\complexTableVC[#1]% + {\global\setvalue{bVC\the\currentTABLEcolumn}{\localstartcolor[#1]}% + \global\setvalue{eVC\the\currentTABLEcolumn}{\localstopcolor}% + \simpleTableVC} + +\def\simpleTableVC + {\global\setvalue{bVL\the\currentTABLEcolumn}% + {\getvalue{bVC\the\currentTABLEcolumn}}% + \global\setvalue{eVL\the\currentTABLEcolumn}% + {\getvalue{eVC\the\currentTABLEcolumn}}% + \doTableVL} + +\def\TableHL + {\ifnum\currentTABLEcolumn>\maxTABLEcolumn + \chuckTABLEautorow + \else\ifnum\currentTABLEcolumn=\zerocount + %\chuckTABLEautorow + \TABLEnoalign + {\globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow}% + \else + \setTABLEerror\TABLEmissingcolumn + \handleTABLEerror + \fi\fi + \complexorsimpleTable{HL}} + +\def\complexTableHL[#1]% + {\TABLEnoalign + {\scratchcounter0#1% + \multiply\scratchcounter \@@tiHLheight + \edef\@@tiHLheight{\the\scratchcounter}% + \simpleTableHL}} + +\def\simpleTableHL + {\TABLEnoalign + {\nobreak + \ifnum\TABLEaction=\TABLErule + \writestatus\m!TABLE{skipping \string\HL}% \statusmessage + \else + \ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\MR\space into \string\LR/\string\SR}% + \else\ifnum\TABLEaction=\TABLEfirstrow + \writestatus\m!TABLE{change \string\MR\space into \string\SR}% + \fi\fi + \startHLcommand + \expandafter\normalTABLEfullrule\@@tiHLheight + \stopHLcommand + \globalletempty\startHLcommand + \globalletempty\stopHLcommand + \accountTABLElinewidth + \fi + \setTABLEaction\TABLErule + \nobreak}} + +\let\startHLcommand\empty +\let\stopHLcommand \empty + +\def\TableHC + {\complexorsimpleTable{HC}} + +\def\complexTableHC[#1]% + {\TABLEnoalign + {\gdef\startHCcommand{\localstartcolor[#1]}% + \gdef\stopHCcommand {\localstopcolor}}% + \simpleTableHC} + +\def\simpleTableHC + {\TABLEnoalign + {\globallet\startHLcommand\startHCcommand + \globallet\stopHLcommand \stopHCcommand}% + \HL} + +%D \startitemize[3*ruim] +%D \sym{\type{\NL}} a vertical skip +%D \sym{\type{\NR}} goto the next row +%D \sym{\type{\NC}} goto the next column +%D \sym{\type{\FC}} a first column +%D \sym{\type{\MC}} a mid column +%D \sym{\type{\LC}} a last column +%D \stopitemize + +% n+1 uitleggen + +\def\defineTABLEsteps + {\let\NL\TableNL + \let\NR\TableNR + \let\NC\TableNC + \let\FC\TableNC + \let\MC\TableNC + \let\LC\TableNC} + +\def\TableNL + {\complexorsimpleTable{NL}} + +\def\complexTableNL[#1]% + {\TABLEnoalign + {\edef\@@tiNL{#1}% + \simpleTableNL}}% + +\def\simpleTableNL + {\TABLEnoalign + {\nobreak + \setbox0\vbox{\blank[\@@tiNL]}% + \vskip\ht0 + \nobreak}} + +\def\TableNR + {\ifnum\currentTABLEcolumn>\maxTABLEcolumn + \global\currentTABLEcolumn\zerocount + \normalTABLElineending + \else + \setTABLEerror\TABLEmissingcolumn + \handleTABLEerror + \fi + \TABLEnoalign + {\nobreak + \setTABLEaction\TABLEunknown}} + +\def\TableNC + {\checkTABLEautorow + \nextTABLEgrayline + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \else + \global\advance\currentTABLEcolumn \plusone + \normalTABLEquote + \fi} + +% \bgroup +% \catcode`\|=\@@active +% \catcode`\"=\@@active +% \gdef\redefinetablebarandquote +% {\def|{\VL}% % \normalTABLEsimplebar +% \def\|##1{\VL[##1]}% % \normalTABLEcomplexbar +% \def"{\NC}} % \normalTABLEquote +% \egroup + +\let\redefinetablebarandquote\relax + +%D \startitemize[3*ruim] +%D \sym{\type{\DL}} +%D \sym{\type{\DV}} (\type{\VD}) +%D \sym{\type{\DC}} +%D \sym{\type{\DR}} +%D \stopitemize + +\newif\ifTABLEdivision + +% \def\defineTABLEdivisions +% {\global\TABLEdivisionfalse % in start +% \let\DL\TableDL +% \let\DC\TableDC +% \let\DV\TableDV +% \let\VD\TableDV +% \let\DR\TableDR} + +\def\defineTABLEdivisions + {\global\TABLEdivisionfalse % in start + \let\DL\TableDL + \let\DC\TableDC + \let\DV\TableDV + \let\DR\TableDR} + +\def\checkTABLEdivision + {\ifTABLEdivision \else + \chuckTABLEautorow + \global\currentTABLEcolumn\zerocount + \global\TABLEdivisiontrue + \fi} + +\def\TableDL + {\checkTABLEdivision + \complexorsimpleTable{DL}} + +\def\simpleTableDL + {\complexTableDL[1]} + +\def\complexTableDL[#1]% + {\ifnum\TABLEaction=\TABLErule + \writestatus\m!TABLE{skipping \string\DL}% + \else + \ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\MR\space into \string\LR/\string\SR}% + \else\ifnum\TABLEaction=\TABLEfirstrow + \writestatus\m!TABLE{change \string\MR\space into \string\SR}% + \fi\fi + \setTABLEaction=\TABLEunknown + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \fi + %\startHLcommand + \ifnum#1=\plusone + \global\advance\currentTABLEcolumn \plustwo + \let\next\normalTABLEsinglerule + \else + \ifnum#1<\maxTABLEcolumn + \global\advance\currentTABLEcolumn \plusone + \def\next{\normalTABLEmultirule{#1}}% + \else + \setTABLEerror\TABLEdivisionoverflow + \let\next\handleTABLEerror + \fi + \fi + \next + %\stopHLcommand + %\globalletempty\startHLcommand + %\globalletempty\stopHLcommand + \fi} + +\def\TableDV + {\TableDCV\normalTABLEsimplebar} + +\def\TableDC + {\TableDCV\normalTABLEquote} + +\def\TableDCV#1% + {\checkTABLEdivision + \checkTABLEautorow + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \else + \global\advance\currentTABLEcolumn \plusone + #1% + \fi} + +\def\TableDR + {\ifnum\currentTABLEcolumn<\maxTABLEcolumn % silent recovery + %\setTABLEerror\TABLEmissingcolumn % some day warning + %\handleTABLEerror + \finishTABLErow + \else + \global\currentTABLEcolumn\zerocount % nog check + \normalTABLElineending + \fi + \TABLEnoalign + {\nobreak + \global\TABLEdivisionfalse + \accountTABLElinewidth % temporary solution + \setTABLEaction\TABLErule}} + +\def\accountTABLElinewidth + {\scratchdimen\LineThicknessUnit} + +%D \startitemize[3*ruim] +%D \sym{\type{\BC}} +%D \sym{\type{\BR}} +%D \sym{\type{\BACKGROUND}} +%D \sym{\type{\CL}} +%D \sym{\type{\RL}} +%D \sym{\type{\BL}} +%D \sym{\type{\RASTER}} +%D \sym{\type{\COLOR}} +%D \stopitemize + +% definieer: \BC \BL +% herhaal: \BR +% definieer: \CL \RL (eerste \CL[green] = hele row! / \CL[1,green]) +% dus: \CL en \RL mix tussen \HL en \BL + +\def\defineTABLEbackgrounds + {\let\BC \TableBC + \let\BL \TableBL + \let\BR \TableBR + \let\BACKGROUND\TableBR + \let\CL \TableCL + \let\RL \TableRL + \let\COLOR \TableCOLOR + \let\RASTER \TableRASTER + \globallet\lastTABLEc\@@tibackgroundcolor + \globallet\lastTABLEr\@@tibackgroundscreen + \doifinsetelse\@@tibackground{c,color} % \v!color + {\global\chardef\TABLEcr\plusone} + {\global\chardef\TABLEcr\plustwo}} + +\def\TableBC + {\ifTABLEgrayline + \normalTABLEquote + \else + \TABLEnoalign\bgroup + \globallet\nextTABLEgrayline\executeTABLEgrayline + \globalletempty\TABLEgrayline % new + \let\BL\doTableBL + \let\BC\doTableBC + \expandafter\doTableBC + \fi} + +\def\doTableBC + {\addtoTABLEgrayline{\BC}% + \gobbleTableBCL} + +\def\TableBL + {\TABLEnoalign\bgroup + \globallet\nextTABLEgrayline\executeTABLEgrayline + \globalletempty\TABLEgrayline % new + \let\BL\doTableBL + \let\CL\doTableCL + \let\RL\doTableRL + \let\BC\doTableBC + \doTableBL} + +\def\doTableBL + {\complexorsimpleTable{BL}} + +\def\simpleTableBL + {\complexTableBL[,]} + +\def\complexTableBL[#1]% + {\analyzeTABLEcr[#1]% + \handleTABLEcr} + +\def\TableBR#1% + {\TABLEnoalign + {\globallet\nextTABLEgrayline\executeTABLEgrayline + \checkTABLEgrayline#1\BR + \global\TABLEgraylinetrue}} + +\def\analyzeTABLEcr[#1]% + {\doanalyzeTABLEcr[#1,,]} + +\def\doanalyzeTABLEcr[#1,#2,#3]% + {\doifnumberelse{#1x} % Is the x still needed here? + {\dodoanalyzeTABLEcr[#1,#2,#3]} + {\dodoanalyzeTABLEcr[1,#1,#2]}} + +\def\dodoanalyzeTABLEcr[#1,#2,#3]% + {\global\chardef\TABLEn#1\relax + \processaction + [#2] + [ c=>\global\chardef\TABLEcr1,% + color=>\global\chardef\TABLEcr1,% + r=>\global\chardef\TABLEcr2,% + raster=>\global\chardef\TABLEcr2]% + \ifcase\TABLEcr \or + \doifsomething{#3}{\xdef\lastTABLEc{#3}}% + \or + \doifsomething{#3}{\xdef\lastTABLEr{#3}}% + \fi} + +\def\handleTABLEcr + {\relax % else funny side effect + \ifcase\TABLEcr + % Can't happen! + \or + \addtoTABLEgrayline{\complexTableCOLOR[\the\TABLEn,\lastTABLEc]}% + \else + \addtoTABLEgrayline{\complexTableRASTER[\the\TABLEn,\lastTABLEr]}% + \fi + \gobbleTableBCL} + +\def\analyzeTABLEcrl#1[#2]% + {\doanalyzeTABLEcrl#1[#2,,]} + +\def\doanalyzeTABLEcrl#1[#2,#3,#4]% + {\doifnumberelse{#2x} % x ???????????????????? + {\dodoanalyzeTABLEcr[#2,#1,#3]} + {\dodoanalyzeTABLEcr[\ifTABLEgrayline1\else\maxTABLEcolumn\fi,#1,#2]}} + +\def\TableCL + {\TABLEnoalign\bgroup + \globallet\nextTABLEgrayline\executeTABLEgrayline + \globalletempty\TABLEgrayline % new + \let\BL\doTableBL + \let\CL\doTableCL + \let\RL\doTableRL + \let\BC\doTableBC + \doTableCL} + +\def\doTableCL + {\complexorsimpleTable{CL}} + +\def\simpleTableCL% nog eens \'e\'en lijn van maken + {\BL[\the\maxTABLEcolumn,c,\lastTABLEc]} + +\def\complexTableCL[#1]% + {\analyzeTABLEcrl{c}[#1]% + \handleTABLEcr} + +\def\TableRL + {\TABLEnoalign\bgroup + \globallet\nextTABLEgrayline\executeTABLEgrayline + \globalletempty\TABLEgrayline % new + \let\BL\doTableBL + \let\CL\doTableCL + \let\RL\doTableRL + \let\BC\doTableBC + \doTableRL} + +\def\doTableRL + {\complexorsimpleTable{RL}} + +\def\simpleTableRL + {\BL[\the\maxTABLEcolumn,r,\lastTABLEr]} + +\def\complexTableRL[#1]% + {\analyzeTABLEcrl{r}[#1]% + \handleTABLEcr} + +\def\checkTABLEgrayline#1#2% + {\!!doneatrue + \ifx#1\AR + \!!doneafalse + \else\ifx#1\SR\else\ifx#1\FR\else\ifx#1\MR\else\ifx#1\LR\else + \!!doneafalse + \fi\fi\fi\fi\fi + \if!!donea + \gdef\TABLEgraylinestatus + {[\string#1]}% + \gdef\TABLEendBCL + {#1}% + \else + \gdef\TABLEgraylineerror + {[\string#2\string#1->\string#2\string\SR]}% + \gdef\TABLEendBCL + {\SR}% + \fi} + +\def\endTABLErowGL#1#2#3% + {\ifcase#1\relax + % unknown + \or + \doPreTableGL\TABLErowfactor\TABLErowfactor + \or + \doPreTableGL\TABLErowfactor\TABLErowzero + \or + \ifnum\TABLEforce=\TABLEforcelastrow + \doPreTableGL\TABLErowzero\TABLErowfactor + \else\ifnum\TABLEforce=\TABLEforcefirstrow + \doPreTableGL\TABLErowfactor\TABLErowzero + \else + \doPreTableGL\TABLErowzero\TABLErowzero + \fi\fi + \or + \doPreTableGL\TABLErowzero\TABLErowfactor + \fi} + +\def\doPreTableGL#1#2% betere namen + {\xdef\OldLineThicknessFactor{\the\LineThicknessFactor}% + \xdef\OldLineThicknessUnit{\the\LineThicknessUnit}% + \global\LineThicknessFactor\plusone + \setbox0\hbox{\AugmentedTableStrut{#1}{#2}}% + \getboxheight\dimen0\of\box0\relax + \xdef\TABLEgraylineHeight{\the\dimen0}% + \global\LineThicknessUnit\TABLEgraylineHeight} + +\def\doPostTableGL + {\global\LineThicknessFactor\OldLineThicknessFactor + \global\LineThicknessUnit \OldLineThicknessUnit} + +% kan simpeler + +\def\docomplexTableCOLOR[#1]% + {\dodocomplexTableGL\localstartcolor \localstopcolor [#1,\lastTABLEc,,]} + +\gdef\docomplexTableRASTER[#1]% + {\dodocomplexTableGL\localstartraster\localstopraster[#1,\lastTABLEr,,]} + +\def\dodocomplexTableGL#1#2[#3,#4,#5,#6]% + {\doifelsenothing{#4}{#1[#5]}{#1[#4]}% + \doPreTableGL\TABLEendofrowheight\TABLEendofrowdepth + \ifnum#3=\plusone % else conflict with \omit in \= + \let\next\normalTABLEsinglerule + \else + \def\next{\normalTABLEmultirule{#3}}% + \fi + \next + \doPostTableGL + #2} + +\def\TableBACKGROUND + {\TableBR} + +\def\simpleTableRASTER #1{\docomplexTableRASTER[1]#1} +\def\complexTableRASTER[#1]{\docomplexTableRASTER[#1]} +\def\simpleTableCOLOR {\docomplexTableCOLOR [1]} +\def\complexTableCOLOR [#1]{\docomplexTableCOLOR [#1]} + +\def\TableRASTER{\complexorsimpleTable{RASTER}} +\def\TableCOLOR {\complexorsimpleTable{COLOR}} + +\def\addtoTABLEgrayline#1% + {\TABLEgraytoks\expandafter{\TABLEgrayline}% + \xdef\TABLEgrayline{\the\TABLEgraytoks\noexpand#1}} + +\def\setTableBCL#1#2% + {\ifx#1#2% + \gdef\TABLEgraylinestatus{[\string#1]}% + \gdef\TABLEendBCL{#1}% + \addtoTABLEgrayline{#1}% + \else + \gdef\TABLEgraylineerror{[\string#1->\string#2]}% + \gdef\TABLEendBCL{#2}% + \addtoTABLEgrayline{#2}% + \fi} + +\def\gobbleTableBCL#1% + {\ifx#1\BC \let\next\doTableBC \else + \ifx#1\BL \let\next\doTableBL \else + \ifx#1\SR \setTableBCL\SR\SR \let\next\egroup \else + \ifx#1\FR \setTableBCL\FR\FR \let\next\egroup \else + \ifx#1\MR \setTableBCL\MR\MR \let\next\egroup \else + \ifx#1\LR \setTableBCL\LR\LR \let\next\egroup \else + \setTableBCL #1\SR \let\next\egroup + \fi\fi\fi\fi\fi\fi + \next} + +\def\executeTABLEgrayline + {\TABLEnoalign + {\def\BC + {\advance\currentTABLEcolumn \plusone}% + \def\dodocomplexTableGL##1##2[##3,##4,##5,##6]% + {\BC\advance\currentTABLEcolumn ##3 }% + \let\endTABLErow\endTABLEgrayrow + \currentTABLEcolumn\zerocount + \TABLEgrayline\TABLEendBCL % determine n of columns and height + \advance\currentTABLEcolumn \minusone + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + % error message too long line + \globalletempty\TABLEgrayline + \else + % \message{n of color columns: \the\currentTABLEcolumn}\wait + \global\TABLEgraylinetrue % vanaf hier nog checken + \fi + \global\currentTABLEcolumn\zerocount}% + \unskip\TABLEgrayline\TABLEendBCL + \TABLEnoalign + {\nobreak + \vskip-\TABLEgraylineHeight + \nobreak + \global\setTABLEactiontrue + \global\currentTABLEcolumn\zerocount + \globalletempty\nextTABLEgrayline + \global\TABLEgraydonetrue + \global\TABLEgraylinefalse}} + +\def\endTABLEgrayrow#1#2#3% + {\ifcase#1\relax + \global\chardef\TABLEendofrowheight\TABLErowfactor + \global\chardef\TABLEendofrowdepth \TABLErowfactor + \or + \global\chardef\TABLEendofrowheight\TABLErowfactor + \global\chardef\TABLEendofrowdepth \TABLErowfactor + \or + \global\chardef\TABLEendofrowheight\TABLErowfactor + \global\chardef\TABLEendofrowdepth \TABLErowzero + \or + \ifnum\TABLEforce=\TABLEforcelastrow + \global\chardef\TABLEendofrowheight\TABLErowzero + \global\chardef\TABLEendofrowdepth \TABLErowfactor + \else\ifnum\TABLEforce=\TABLEforcefirstrow + \global\chardef\TABLEendofrowheight\TABLErowfactor + \global\chardef\TABLEendofrowdepth \TABLErowzero + \else + \global\chardef\TABLEendofrowheight\TABLErowzero + \global\chardef\TABLEendofrowdepth \TABLErowzero + \fi\fi + \or + \global\chardef\TABLEendofrowheight\TABLErowzero + \global\chardef\TABLEendofrowdepth \TABLErowfactor + \fi} + +\def\defineTABLEshorthands% + {\def\SPAN##1{\use{##1}}% + \def\TWO {\use2}% + \def\THREE {\use3}% + \def\FOUR {\use4}% + \def\FIVE {\use5}% + \def\SIX {\use6}% + \def\REF {\ReFormat}} + +\def\defineTABLEunits + {\processaction + [\@@tidistance] + [ \v!none=>\OpenUp00\def\LOW{\Lower6 }, + \v!small=>\OpenUp00\def\LOW{\Lower6 }, % == baseline + \v!medium=>\OpenUp11\def\LOW{\Lower7 }, + \v!big=>\OpenUp22\def\LOW{\Lower8 }]% + \doifelse\@@tidistance\v!none + {\chardef\TABLErowfactor\zerocount} + {\chardef\TABLErowfactor\plustwo }} + +\def\dohandlebar % here ? + {\ifmmode + \@EA\domathmodebar + \else\ifintable + \@EAEAEA\domathmodebar + \else + \@EAEAEA\dotextmodebar + \fi\fi} + +% De macro's t.b.v. instellingen. + +\def\setuptables + {\dosingleargument\dosetuptables} + +\def\dosetuptables[#1]% + {\getparameters[\??ti][#1]% + \processaction + [\@@tialign] + [ \v!right=>\def\TABLEparalignment{\raggedright}, + \v!left=>\def\TABLEparalignment{\raggedleft}, + \v!middle=>\def\TABLEparalignment{\raggedcenter}, + \s!default=>\def\TABLEparalignment{\notragged}, + \s!unknown=>\def\TABLEparalignment{\notragged}]% + \assignalfadimension\@@tiVL\@@tiVLwidth 246% + \assignalfadimension\@@tiHL\@@tiHLheight246} + +\def\localTABLEsetup + {\@@ticommands\relax + \expanded{\switchtobodyfont[\@@tibodyfont]}% + \StrutHeightFactor 8 + \StrutDepthFactor 4 + \LineThicknessFactor4 + \NormalTLTU {.1pt}% + \NormalTSU {\normalbaselineskip\divide\StrutUnit 12 }% + \NormalTableUnits} + +%D And then I wrote the tabulate environment. That +%D alternative supports setting the rule thickness and color, +%D so here is the table alternative. + +\let\startglobalTABLEcolor\empty +\let\stopglobalTABLEcolor \empty + +\def\localTABLEsetup + {\@@ticommands\relax + % bodyfont + \expanded{\switchtobodyfont[\@@tibodyfont]}% + % linecolor + \doifsomething\@@tirulecolor + {\def\startglobalTABLEcolor{\localstartcolor[\@@tirulecolor]}% + \def\stopglobalTABLEcolor {\localstopcolor}}% + % linethickness + \LineThicknessFactor4 + \scratchdimen\@@tirulethickness + \divide\scratchdimen \LineThicknessFactor + \expanded{\NormalTLTU{\the\scratchdimen}}% + % spacing, was depth=4 height=8 (counters, sigh, now macros) + \doifelse\@@tiheight\v!strut + {\let\StrutHeightFactor\@@itheight} + {\let\StrutHeightFactor\@@tiheight}% + \doifelse\@@tidepth\v!strut + {\let\StrutDepthFactor\@@itdepth} + {\let\StrutDepthFactor\@@tidepth}% + \scratchdimen\StrutHeightFactor\points \multiply\scratchdimen 10% + \edef\StrutHeightFactor{\withoutpt\the\scratchdimen}% + \scratchdimen\StrutDepthFactor \points \multiply\scratchdimen 10% + \edef\StrutDepthFactor{\withoutpt\the\scratchdimen}% + % units + \NormalTSU{\normalbaselineskip\divide\StrutUnit 12 }% + \NormalTableUnits} + +\def\OpenUp#1#2% + {\scratchdimen\StrutHeightFactor \points \advance\scratchdimen #1\points + \edef\StrutHeightFactor{\withoutpt\the\scratchdimen}% + \scratchdimen\StrutDepthFactor \points \advance\scratchdimen #2\points + \edef\StrutDepthFactor{\withoutpt\the\scratchdimen}} + +%D As one can see, we didn't only add color, but also more +%D control over spacing. +%D +%D \startbuffer[a] +%D \starttable[|c|] +%D \HL +%D \VL \strut test \VL \FR +%D \VL \strut test \VL \MR +%D \VL \strut test \VL \MR +%D \VL \strut test \VL \LR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \startbuffer[b] +%D \starttabulate[|c|] +%D \HL +%D \NC test \NC \NR +%D \NC test \NC \NR +%D \NC test \NC \NR +%D \NC test \NC \NR +%D \HL +%D \stoptabulate +%D \stopbuffer +%D +%D In the next example, the first table is defined as: +%D +%D \typebuffer[a] +%D +%D and the second one as: +%D +%D \typebuffer[b] +%D +%D The first table is typeset using the default height and +%D depth factors .8 and .4. The second table has both factors +%D set to \type {strut}, and the third table shows what +%D happens when we set the values to zero. The rightmost table +%D is typeset using the tabulate environment. +%D +%D \startcombination[4*1] +%D {$\vcenter{\getbuffer[a]}$} +%D {\hbox{h=.8 d=.4}} +%D {\setuptables[height=strut,depth=strut]$\vcenter{\getbuffer[a]}$} +%D {\hbox{h=d=\type{strut}}} +%D {\setuptables[height=0,depth=0]$\vcenter{\getbuffer[a]}$} +%D {\hbox{h=d=0}} +%D {$\vcenter{\getbuffer[b]}$} +%D {\hbox{tabulate}} +%D \stopcombination + +\setuptables + [HL=\v!medium, + VL=\v!medium, + NL=\v!small, + \c!frame=, + \c!align=\v!right, + \c!depth=.40, % \v!strut + \c!height=.80, % \v!strut + \c!rulethickness=\linewidth, + \c!rulecolor=, + \c!distance=\v!medium, + \c!bodyfont=\the\bodyfontsize, + \c!commands=, + \c!background=\v!screen, + \c!backgroundscreen=\@@rsscreen, + \c!backgroundcolor=, + \c!split=\v!auto] + +\def\ifintabel{\ifintable} % upward compatible + +\protect \endinput diff --git a/tex/context/base/tabl-tab.mkiv b/tex/context/base/tabl-tab.mkiv new file mode 100644 index 000000000..429f41add --- /dev/null +++ b/tex/context/base/tabl-tab.mkiv @@ -0,0 +1,2515 @@ +%D \module +%D [ file=core-tab, +%D version=1997.10.10, +%D title=\CONTEXT\ Table Macros, +%D subtitle=\TABLE\ Embedding, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Macros / TaBlE Embedding} + +% By now it makes more sense to merge the patches into the original +% and clean that one up too. + +% \starttable[|||] +% \HL +% \VL test \VS test \VL \FR +% \VL test \VD test \VL \MR +% \VL test \VT test \VL \LR +% \HL +% \stoptable + +% Don't change the splitter: +% +% ... \NR +% \TABLEnoalign{\page}\TABLEhead +% \NC ... + +% e-tex: reverse rows or vadjust or ... in tables +% \ifalign +% \xhrule : calls for 'special' with width +% BUG: +% +% \starttable[|l|l|] +% \HL +% \RL\FR \VL Head 1 \VL Head 2 \VL\FR +% \RL\LR \VL Head A \VL Head B \VL\LR % niet grijs ?? +% \HL +% \VL 1 \VL 2 \VL\FR +% \VL a \VL b \VL\LR +% \HL +% \stoptable + +% melden als in kleur conflict, uitgestelde test op \SR\SR + +% verengelsen +% interface + +% footnotes flushen +% \......TABLE........ namen +% kolommen testen +% unbreakable kop definieren +% voetnoten +% meldingen +% als direct \use{max} dan fout +% \BREAKPOINT +% breedte lijn telt +% errors: ook gray in handle + +% \AR -> als in DL dan \DR + +% nieuw: +% +% \NL / \NL[blanko] is skip, nog default? +% geen \HL in a row +% \HL[n] +% \VL[n] + remembers +% c{colorspec} key +% \HC[color][width] +% \VC[color] +% meldingen row, column, use, advise +% \AR: UITSTELLEN / EXPERIMENTEEL + +% WAARDELOZE ERROR HANDLER +% THIS RENEWED MODULE WORKS OK BUT STILL LOOKS BAD + +%D We felt no need to write our own table building macros, +%D simply because Michael Wichura made a terrific one. This +%D package is quite complete and well documented. In \CONTEXT\ +%D we provide a shell for consistent spacing as well as color +%D support. Implementing these features without adapting the +%D original macros is not trivial. One easilly gets conflicts +%D with \type{\omit}, \type{\span} and \type{\noalign}, which +%D means that we end up postponing and overloading macros, +%D mostly global. Now, let's start with loading the main +%D macros: + +\doifundefined{BeginTable}{\doinputonce{table.tex}} + +\unprotect + +%D \macros +%D {inintable, ifsplittables} +%D +%D First we declare some variables. These show a bit what we +%D are dealing with. First we introdoce some booleans that +%D enable us, inside as well as outside this module, to +%D determine in what mode we are. + +\newif\ifintable +\newif\ifsplittables + +%D \macros +%D {tracetablestrue} +%D +%D When I documented this module, I felt the need for tracing +%D options. After implementing this feature, I also added +%D warnings, error recovery and automatic spacing. + +\newif\iftracetables + +%D We show this feature in an eample that also shows some of +%D the basic table typesetting commands. +%D +%D \startbuffer +%D \starttable[|||] +%D \HL +%D \VL first \VL second \VL\AR +%D \HL +%D \VL alfa \VL 1 \VL\AR +%D \VL beta \VL 2 \VL\AR +%D \VL gamma \VL 3 \VL\AR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \startcombination +%D {\tracetablesfalse\getbuffer} {\type{\tracetablesfalse}} +%D {\tracetablestrue\getbuffer} {\type{\tracetablestrue}} +%D \stopcombination +%D +%D This table is specified as: +%D +%D \typebuffer +%D +%D This examples shows about the minimum of commands needed to +%D typeset such a table. In this table, the \type {\AR} is +%D automatically translated into the more primitive (but more +%D verbose) commands \type {\SR}, \type {\FR}, \type {\MR} and +%D \type {\LR} commands. +%D +%D \startbuffer +%D \starttables[|||] +%D \HL +%D \VL first \VL second \VL\AR +%D \HL +%D \VL alfa \VL 1 \VL\AR +%D \VL beta \VL 2 \VL\AR +%D \VL gamma \VL 3 \VL\AR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D When we use the split table feature, we get a bit more +%D information. +%D +%D {\tracetablesfalse\getbuffer} +%D +%D Sometimes in tables information shows up that is not typed +%D in by the user. These messages give a cue in what aspect a +%D table definition is wrong. +%D +%D \startbuffer +%D \starttable[||||] +%D \HL +%D \VL first second \VL third \VL\AR +%D \HL +%D \VL alfa \VL 1 \VL a \VL\AR +%D \VL beta \VL 2 \VL b \VL +%D \VL gamma \VL \THREE{3} c \VL\AR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \typebuffer +%D +%D Those terrible table has three errors, which all show up in +%D typeset messages. Errors cannot always recovered 100\% and +%D therefore can result in two or more succesive messages, like +%D in the last row. +%D +%D \getbuffer + +%D Bringing color into tables is complicated by the mere fact +%D that color is not part of \TEX. The main complication is +%D that we don't know in advance how wide a column will be. I +%D implemented color support in tables in the early 90's +%D because I needed it for some articles on color. I have to +%D admit that I seldom use the mechanism. +%D +%D Most color support in \CONTEXT\ makes use of colored rules. +%D At first sight, one is tempted to implement colors in tables +%D in a similar way, but as said, we don't know the dimensions +%D in advance. It turns out however that we don't have to, +%D simply because alignments take care of stretching rules to +%D the appropritate dimensions. This means that we can provide +%D backgrounds by coloring rules with the height of a row, +%D skipping upwards and finally drawing the content, like in: +%D +%D \gdef\ShowExample +%D {\startfiguretext +%D {none} +%D {\getbuffer} +%D \typebuffer +%D \stopfiguretext} +%D +%D \startbuffer +%D \starttable[|c|c|] +%D \HL +%D \BL[2] \SR +%D \VL test \VL test \VL\SR +%D \HL +%D \VL test \VL test \VL\FR +%D \VL test \VL test \VL\MR +%D \VL test \VL test \VL\LR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D Just to be complete we show how the other columns can be +%D given a background. Later we will provide more details over +%D the commands used. +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \HL +%D \BL[3] \SR +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \HL +%D \BC \BL[2] \SR +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \HL +%D \BC \BC \BL \SR +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \HL +%D \BC \BL \SR +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \BL \BL \SR +%D \HL +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample + +%D In these examples we can clearly see that for being a real +%D background, the color or gray specification has to precede +%D the content. Just to keep things simple, we can recall this +%D specification later on: +%D +%D \startbuffer +%D \starttable[|c|c|c|] +%D \BC \BL \SR +%D \HL +%D \VL test \VL test \VL test \VL\SR +%D \HL +%D \BR\FR +%D \VL test \VL test \VL test \VL\FR +%D \BR\MR +%D \VL test \VL test \VL test \VL\MR +%D \BR\LR +%D \VL test \VL test \VL test \VL\LR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D Close study learns that we can put the specification +%D before or after the \type{\HL}, whatever suits best. Keeping +%D track of these specifications is taken care of by the next +%D variables: + +\newif \ifTABLEgrayline % executing gray line +\newif \ifTABLEgraydone % gray line executed +\newtoks \TABLEgraytoks % gray line specification + +\newif\ifTABLEinbreak + +%D Nog vervangen: + +\def\c!Table{Table} +\def\m!TABLE{TABLE} + +%D We already saw that the table macros report errors and +%D provide automatic spacing. These features can only be +%D implemented by keeping track of the state, often the last +%D command on a row. + +\chardef\TABLEunknown = 0 + +\chardef\TABLEseparaterow = 1 +\chardef\TABLEfirstrow = 2 +\chardef\TABLEmidrow = 3 +\chardef\TABLElastrow = 4 +\chardef\TABLErule = 5 +\chardef\TABLEskip = 6 +\chardef\TABLEautorow = 7 + +\chardef\TABLEforcefirstrow = 1 +\chardef\TABLEforcelastrow = 2 + +\chardef\TABLEmissingrow = 1 +\chardef\TABLEmissingcolumn = 2 +\chardef\TABLEspanoverflow = 3 +\chardef\TABLEdivisionoverflow = 4 + +%D We store these states using efficient \type {\chardef}'s. +%D Like most variables, these are global ones. When needed, +%D especially when we flush the backgrounds, we can temporary +%D disable the assignment. + +\newif\ifsetTABLEaction + +\def\setTABLEaction#1% + {\ifsetTABLEaction\global\chardef\TABLEaction#1\fi} + +\def\setTABLEforce#1% + {\ifsetTABLEaction\global\chardef\TABLEforce#1\fi} + +\def\setTABLEerror#1% + {\global\chardef\TABLEerror#1} + +%D Before we come to using these variables, we redefine and/or +%D adapt some \TABLE\ macros. Within \TABLE's the \type{|} and +%D \type{"} have special meanings in templates and are active +%D during. Their meaning can therefore conflict with those +%D elsewhere defined. To be compatible with traditional \TABLE\ +%D as well as \CONTEXT's \type{||} and the active \type{"} +%D extensions for my german friends, we do some catcode magic. + +\newif\ifForgetTableBarAndQuote \ForgetTableBarAndQuotetrue + +% \bgroup + +% \catcode`\|=\@@active +% \catcode`\"=\@@active +% +% \gdef\pushouterbarandquote +% {\ifForgetTableBarAndQuote +% \ifnum\catcode`\|=\@@active \let\outertablebar |\else\let\outertablebar \relax\fi +% \ifnum\catcode`\"=\@@active \let\outertablequote"\else\let\outertablequote\relax\fi +% \let|\letterbar +% \let"\letterdoublequote +% \fi} +% +% \gdef\popouterbarandquote +% {\ifForgetTableBarAndQuote +% \ifx\outertablebar \relax\else\let|\outertablebar \fi +% \ifx\outertablequote\relax\else\let"\outertablequote\fi +% \else +% \redefinetablebarandquote +% \fi} +% +% \egroup +% +% \def\ObeyTableBarAndQuote +% {\ForgetTableBarAndQuotefalse +% \ifintable +% \redefinetablebarandquote +% \fi} + +\let\ActivateBarAndQuote \relax +\let\ObeyTableBarAndQuote\relax +\let\pushouterbarandquote\relax +\let\popouterbarandquote \relax + +%D \macros +%D {ObeyTableBarAndQuote} +%D +%D As said, the \type{|} and \type{"} active characters are +%D often used for other purposes. By default, the outside +%D meanings are therefore preserved and available inside +%D tables. If for some reason one wants to use the \TABLE\ +%D primitives, one can say: +%D +%D \starttyping +%D \ObeyTableBarAndQuote +%D \stoptyping +%D +%D To keep things verbose, as well as to show what \TABLE\ +%D commands we affect, we show some meanings. + +\def\normalTABLEshortrule {\!ttShortHrule} % \- +\def\normalTABLElongrule {\!ttLongHrule} % \= +\def\normalTABLEfullrule {\!ttFullHrule} % \_ +\def\normalTABLEendofrow {\!ttEndOfRow} % \\ +\def\normalTABLEsimplebar {\unskip\!ttRightGlue&&} % | +\def\normalTABLEcomplexbar {\unskip\!ttRightGlue&\omit\!ttAlternateVrule} % \| +\def\normalTABLEquote {\unskip\!ttRightGlue&\omit&} % " +\def\normalTABLElineformat {\normalTABLEendofrow+} +\def\normalTABLElineending {\normalTABLEendofrow0 } +\def\normalTABLEsinglerule {&\normalTABLElongrule&} +\def\normalTABLEmultirule#1{&\use{#1}\normalTABLElongrule&} + +%D The next hack is dedicated to Tobias, who found out that +%D paragraph entries don't break well. + +\def\TABLEhack{\hskip\zeropoint} + +%D The first attemp to solve this problem was: +%D +%D \starttyping +%D \def\normalTABLEquote% +%D {\unskip\TABLEhack\!ttRightGlue&\omit&\TABLEhack} +%D \stoptyping +%D +%D But, as usual, this interfered with \type {\omit}. +%D +%D The next attempt is redefining some core \TABLE\ macro:. +%D This works ok, but breaks for instance the~\type{b} +%D key handling. +%D +%D \starttyping +%D \def\!tfAdjoinPriorColumn% +%D {\ifnum\!taColumnNumber=0 +%D \!taPreamble=\!taRuleColumnTemplate +%D ... +%D \if!taOnceOnlyTabskip +%D \!thToksEdef\!taDataColumnTemplate= +%D {\TABLEhack####\TABLEhack\tabskip\the\!taLastRegularTabskip} +%D \else +%D \!taDataColumnTemplate{\TABLEhack##\TABLEhack}% +%D \fi +%D ... +%D \ReadFormatKeys} +%D \stoptyping + +% \newdimen\TABLEparheight + +\def\BeginTableParBox#1% + {\setbox\scratchbox\vtop\bgroup % \setbox added + \hsize#1\relax + \dontcomplain + \restoretablelineskips + \normalbaselines + \let~\!ttTie + \let\-\!ttDH + \blank[\v!disable]% % added + \the\EveryTableParBox} + +\def\EndTableParBox + {\removelastskip % itemize or so + \endgraf + \ifnum\prevgraf>\zerocount % we want at least + \verticalstrut \nowhitespace \vskip-\struttotal % one line of text + \egroup + \ifdim\dp\scratchbox>\lineheight % see (*) for an + \getnoflines{\dp\scratchbox}% % example of where + \dp\scratchbox\zeropoint % saving can go + \setbox\scratchbox % terrible wrong + \vtop to \noflines\lineheight{\box\scratchbox}% + \fi % esp between rows + \else % of paragraphs + \egroup + \fi +% \getboxheight\scratchdimen\of\box\scratchbox\relax% compensate for +% \ifdim\scratchdimen>\TABLEparheight % funny depth of +% \global\TABLEparheight\scratchdimen % multi-line box +% \fi % i.e. vtop + \box\scratchbox} + +% We also need to patch away the interfering math switch: + +% \mathpunctuationtrue + +% test, test +% \starttable[|c|] +% \NC1,,10\NC\AR +% \stoptable +% test, test + +\def\!ttBeginTableA[#1]{% + \if #1u% % "unboxed" table + \ifmmode + \def\!ttEndTable{% % user had better be in display math mode + \relax}% % and have only one table at the outer level + \else % user had better be in vertical mode + \bgroup + \def\!ttEndTable{% + \egroup}% + \fi + \else + %\hbox\bgroup $ + %\def\!ttEndTable{% + % \egroup % for the \vtop, \vbox, or \vcenter, yet to come + % $% for math mode + % \egroup}% for the \hbox + %\if #1t% + % \vtop + %\else + % \if #1b% + % \vbox + % \else + % \vcenter % math mode was essential for this + % \fi + %\fi + % + \hbox\bgroup + \def\!ttEndTable{\egroup\egroup}% + \if#1t% + \vtop + \else\if#1b% + \vbox + \else + \def\!ttEndTable{\egroup$\egroup}% + %$\vcenter + \scratchtoks\everymath\everymath\emptytoks$\everymath\scratchtoks\vcenter + \fi\fi + % + \bgroup % for the \vtop, \vbox, or \vcenter + \fi + \advance\!taRecursionLevel 1 % RecursionLevel governs initialization + \let\!ttRightGlue=\relax % This may be changed by \JustCenter, etc + \everycr\emptytoks % ={} + \ifnum \!taRecursionLevel=1 + \!ttInitializeTable + \fi} + +%D The next redefinition is more robust than the original: + +\def\SetTableToWidth#1% + {\doifelsenothing{#1}{\!taTableSpread\emptytoks}{\!taTableSpread{to #1}}} + +% (*) Try this one with \type {direction} and {girection}; +% the \PPCHTEX\ manual is a nice testcase. +% +% \startoverlay +% {\starttable[ | l w(2cm) | w(8cm) | ] +% \HL +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \MR +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \LR +% \HL +% \stoptable} +% {\starttable[ | l w(2cm) | p(8cm) | ] +% \HL +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \MR +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \LR +% \HL +% \stoptable} +% \stopoverlay +% \vskip2cm +% \starttable[ | l w(2cm) | p(8cm) | ] +% \HL +% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR +% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \LR +% \HL +% \stoptable +% \vskip2cm +% \starttable[ | l w(2cm) | p(8cm) | ] +% \HL +% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \FR +% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \LR +% \HL +% \stoptable + +%D To give an impression of what the (well documented) source +%D of \TABLE\ looks like, we first implement an alternative for +%D the numeric keys. The quantity keys (\type{q} and \type{Q}) +%D support the more european way of writing numbers: +%D +%D \startnarrower +%D 100.000.000,00 instead of 100,000,000.00 +%D \stopnarrower +%D +%D The next table shows how to use these keys. We use braces +%D instead of brackets because we need brackets to specify the +%D format. +%D +%D \startbuffer +%D \starttable{|q[00,000]|Q[00,00]|} +%D \HL +%D \VL -1,2 \VL 12,35 \VL\FR +%D \VL 11,203 \VL 2,4 \VL\LR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample +%D +%D Although a more efficient implementation is possible |<|we +%D can for instance share common macros|>| we just adapt a copy +%D of the numeric ones. To permit double loading of this +%D module, we check for the existence of one of the macros. + +\letvalue{!tk<\string q>}=\undefined +\letvalue{!tk<\string Q>}=\undefined + +%D We just copy the original {\em comments}. +%D +%D \em Key \type{q}: quantity item, non||math mode. + +\NewFormatKey q% + {\letempty\!tqStyle + \futurelet\!tnext\!tqTestForBracket} + +%D \em Key \type{Q}: quantity item, math mode. + +\NewFormatKey Q% + {\def\!tqStyle{$}% + \futurelet\!tnext\!tqTestForBracket} + +%D \em Note: the space between a quantity entry and the +%D following \type{|}, \type{"}, or \type{\|} is mandatory. +%D empty quantity entries are not allowed: use \type{{}} or +%D \type{\omit} instead. +%D +%D \em Test for bracket: invoked by the keys \type{q} and +%D \type{Q}. + +\def\!tqTestForBracket + {\ifx[\!tnext + \!thx\!tqGetArgument + \else + \!thx\!tqGetCode + \fi} + +%D \em Get code: e.g. \type{4}, or \type{4,0}, \type{0,4}, or +%D \type{10,2}. + +\def\!tqGetCode#1 % note the blank + {\!tqConvertCode #1,,!} + +%D \em Convert code: e.g. converts above to \type{[0000]}, +%D \type{[0000,]}, \type{[,0000]}, \type{[0000000000,00]}. + +\def\!tqConvertCode #1,#2,#3!% + {\begingroup + \aftergroup\edef + \aftergroup\!ttemp + \aftergroup{% + \aftergroup[% + \!taCountA #1 + \!thLoop + \ifnum \!taCountA>\zerocount + \advance\!taCountA \minusone + \aftergroup0 + \repeat + \def\!ttemp{#3}% + \ifx\!ttemp\empty + \else + \aftergroup, + \!taCountA #2 + \!thLoop + \ifnum\!taCountA>\zerocount + \advance\!taCountA \minusone + \aftergroup0 + \repeat + \fi + \aftergroup]\aftergroup}% + \endgroup\relax + \!thx\!tqGetArgument\!ttemp} + +%D \em Get argument: +%D +%D \starttyping +%D +%D \stoptyping + +\def\!tqGetArgument[#1]% + {\!tqMakeQuantityTemplate\!tqStyle#1,,!} + +%D \em Make quantity template. + +\def\!tqMakeQuantityTemplate#1#2,#3,#4!% #1= or $ + {\def\!ttemp{#4}% + \ifx\!ttemp\empty + \!taDimenC\zeropoint + \else + \setbox0\hbox{\mathsurround\zeropoint #1,#3#1}% + \!taDimenC\wd0 + \fi + \setbox0\hbox{\mathsurround\zeropoint #1#2#1}% + \!thToksEdef\!taDataColumnTemplate + ={\noexpand\!tqSetQuantityItem{\the\wd0 }{\the\!taDimenC}{#1}% + \the\!taDataColumnTemplate}% + \ReadFormatKeys} + +%D \em Set numeric item. + +\def\!tqSetQuantityItem #1#2#3#4 % + {\!tqSetQuantityItemA{#1}{#2}{#3}#4,,!} + +\def\!tqSetQuantityItemA #1#2#3#4,#5,#6!% + {\def\!ttemp{#6}% + \hbox to #1{\hss\mathsurround\zeropoint#3#4#3}% + \hbox to #2{\ifx\!ttemp\empty\else\mathsurround\zeropoint#3,#5#3\fi\hss}} + +%D Here ends the Q||extension. Did you watch the clever use +%D of aftergroup in \type{\!tqConvertCode}. + +% %D We also (have to) define a key for \type{\cap}: +% +% \letvalue{!tk<\string K>}=\undefined +% +% \NewFormatKey K% +% {\ReadFormatKeys b\smallcapped} + +%D A few pages back we saw backgrounds, further on we will see +%D colored rules, and here we provide a means to color the +%D entries in a column. (We can of course always use the normal +%D color commands for individual entries.) We could not use the +%D lowercase~\type{c}, because that one is used to force {\em +%D centering}. +%D +%D \startbuffer +%D \starttable[|C{red}|C{green}|C{blue}|] +%D \VL R(ed) \VL G(reen) \VL B(lue) \VL\SR +%D \stoptable +%D \stopbuffer +%D +%D \ShowExample + +\letvalue{!tk<\string C>}=\undefined + +\NewFormatKey C#1% + {\ReadFormatKeys b{\startcolor[#1]} a{\stopcolor}} + +%D So now we have three new keys: +%D +%D \starttable[|||] +%D \HL +%D \NC \bf key \NC \bf meaning \NC\AR +%D \HL +%D \NC Q[x,y] \NC math mode formatted numbers \NC\AR +%D \NC q[x,y] \NC text mode formatted numbers \NC\AR +%D \NC C{identifier} \NC column entry color \NC\AR +%D \HL +%D \stoptable + +%D To be compatible with the tabulate environment, we also +%D support the \type {l}, \type {c} and \type {r} keys for +%D paragraph entries. + +\letvalue{!tk<\string l>}=\undefined +\letvalue{!tk<\string c>}=\undefined +\letvalue{!tk<\string r>}=\undefined +\letvalue{!tk<\string x>}=\undefined % not that needed + +\NewFormatKey c% + {\prependtoks\raggedcenter\to\!taDataColumnTemplate + \ReadFormatKeys \LeftGlue\hfil \RightGlue\hfil} + +\NewFormatKey l% + {\prependtoks\raggedright\to\!taDataColumnTemplate + \ReadFormatKeys \LeftGlue\empty \RightGlue\hfil} + +\NewFormatKey r% + {\prependtoks\raggedleft\to\!taDataColumnTemplate + \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty} + +\NewFormatKey x% + {\prependtoks\notragged\to\!taDataColumnTemplate + \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty} + +\appendtoks \TABLEparalignment \to \EveryTableParBox + +\def\!tfReFormat#1% + {\the \!taLeftGlue + \vbox{\forgetall\ialign{\span\the\!taDataColumnTemplate\cr#1\cr}}% + \the \!taRightGlue + \kern\zeropoint} % prevents \unskip / really needed + +%D Later on, we're going to implement multiple page table +%D support, therefore the next \TABLE\ macro needs to be +%D slightly adapted, i.c. the penalty is removed. We also +%D add basic color support. + +\def\!ttFullHruleA + {\!ttGetHalfRuleThickness + \startglobalTABLEcolor % added + \hrule\!thHeight\dimen0\!thDepth\dimen0 + \stopglobalTABLEcolor % added + %\penalty0 % removed + \egroup} + +%D We'll see that when we want to give a vertical rule a color, +%D we have to set and reset states. After heavy testing it +%D proved most useful to extend a \TABLE\ primitive with some +%D hooks. One thing to keep in mind is that \type{&} keeps +%D assignments local. Again, we add basic color support. + +\let\TABLEbeforebar\empty +\let\TABLEafterbar \empty + +\def\@VLn{1} +\def\@VLd{.125em} + +\def\do!ttInsertVrule % will be merged in 2005 + {\vrule \!thWidth + \ifnum\!tgCode=\plusone + \ifx\!tgValue\empty + \LineThicknessFactor + \else + \!tgValue + \fi + \LineThicknessUnit + \else + \!tgValue + \fi + \hskip\@VLd} + +\def\!ttInsertVrule + {\hfil + \TABLEbeforebar % added + \startglobalTABLEcolor % added + % we could do without this speedup, some day merge 'm + \ifcase\@VLn\or + \do!ttInsertVrule + \unskip + \else + \dorecurse\@VLn\do!ttInsertVrule + \gdef\@VLn{1}% + \unskip + \fi + \stopglobalTABLEcolor % added + \TABLEafterbar % added + \hfil + &} + +%D The next two macros are only adapted to basis rule +%D color support. + +\def\!tfSetVrule + {\!thToksEdef\!taRuleColumnTemplate= + {\noexpand\hfil + \noexpand\startglobalTABLEcolor % added + \noexpand\vrule + \noexpand\!thWidth + \ifnum\!tgCode=\plusone + \ifx\!tgValue\empty + \the\LineThicknessFactor + \else + \!tgValue + \fi + \!taLTU + \else + \!tgValue + \fi + ####% + \noexpand\hfil + \noexpand\stopglobalTABLEcolor % added + \the\!taRuleColumnTemplate}% + \!tfAdjoinPriorColumn} + +\def\!ttShortHruleA + {\!ttGetHalfRuleThickness + \startglobalTABLEcolor % added + \leaders\hrule\!thHeight\dimen0\!thDepth\dimen0\hfill + \stopglobalTABLEcolor % added + \null + \ignorespaces} + +%D We already showed the next one, but here we slightly adapt +%D the macro by adding an \type{\expandafter}. The space after +%D \type{#1} is crucial! + +\def\normalTABLEcomplexbar#1% + {\unskip\!ttRightGlue&\omit\expandafter\!ttAlternateVrule#1 } + +%D To get rid of interfering \type{\omit}'s when we are +%D checking the number of columns and reporting problems. The +%D extensions concern the second level check, the first +%D subbranch and advancing the column. + +\ifx\mscount\undefined \newcount\mscount \fi + +\def\!ttuse#1% + {\ifnum#1>\plusone + \omit + \global\TABLEdivisionfalse + \scratchcounter\currentTABLEcolumn % added + \advance\scratchcounter #1% % added + \advance\scratchcounter \minusone % added + \ifnum\scratchcounter>\maxTABLEcolumn % added + \def\next % added + {\setTABLEerror\TABLEspanoverflow % added + \handleTABLEerror}% % added + \else % added + \def\next % added + {\global\advance\currentTABLEcolumn #1% % added + \global\advance\currentTABLEcolumn \minusone % added + \mscount#1% \mscount is in Plain + \advance\mscount \minusone + \advance\mscount \mscount + \!thLoop + \ifnum\mscount>\plusone + \spanomit \advance\mscount\minusone + \repeat + \span}% + \fi % added + \else % added + \def\next % conflicts with possible next \omit % added + {\global\advance\currentTABLEcolumn \plusone}% % added + \fi + \next} % added + +% \starttable[|c|c|c|c|] +% \HL +% \VL {test} \VL \TWO{} \VL test \VL\FR +% \DL \DC \DL\DR +% \VL {test} \VL \TWO{} \VL test \VL\LR +% \HL +% \stoptable + +%D All commands that are executed between rows are to be put in +%D \type {\noalign}. We can however not verify if we (that is +%D \TABLE) does or did not enter this mode. A moderate dirty +%D but useful trick is using our own alternative:\footnote{Once +%D one has entered the stage of redefining \TEX\ primitives, +%D such hacks become a second nature. However, redefining \type +%D {\omit} and \type{\span} is not that easy.} + +\def\TABLEnoalign + {\noalign\bgroup\let\noalign\relax\let\next=} + +%D \macros +%D {starttable} +%D +%D The rest of this module is not easy to comprehend, mainly +%D because we have to take care of: +%D +%D \startitemize[packed] +%D \item \type{\startitemize[template]} +%D \item \type{\startitemize{template}} +%D \item \type{\startitemize[predefined]} +%D \stopitemize +%D +%D as well as: +%D +%D \startitemize[continue] +%D \item restart after table break +%D \stopitemize +%D +%D The official specification of the start command is: +%D +%D \showsetup{starttable} + +\newconditional\tablerepeathead +\newconditional\tablerepeattail + +\def\starttable + {\bgroup + \doif\@@tisplit\v!auto + {\ifinsidesplitfloat\let\@@tisplit\v!yes\fi}% + \doifinsetelse\@@tisplit{\v!yes,\v!repeat} + {\def\stoptable{\stoptables\egroup}% + \starttables} + {\doifelsenothing\@@tiframe + {\ifinsidefloat\else\startbaselinecorrection\fi} + {\startframedcontent[\@@tiframe]}% + \postponenotes + \firststagestartTABLE}} + +\def\stoptable + {\chuckTABLEautorow % before the tail, else noalign problem + \insertTABLEtail + \TABLEnoalign{\globalletempty\@@TABLEhead}% + \TABLEnoalign{\globalletempty\@@TABLEtail}% + \finishTABLE + \doifelsenothing\@@tiframe + {\ifinsidefloat\else + \stopbaselinecorrection + \goodbreak % compensates all the nobreaks + \fi} + \stopframedcontent + \egroup} + +%D Before we can grab the argument, we have to make sure that +%D the \CATCODES\ are set. The first stage takes care of that. + +\def\firststagestartTABLE + {\bgroup % kan-ie weg? + \global\intabletrue + \pushouterbarandquote + %catcode`\|=\@@other + \complexorsimple\secondstagestartTABLE} + +\def\simplesecondstagestartTABLE#1% + {\complexsecondstagestartTABLE[{#1}]} + +%D \macros +%D {definetabletemplate} +%D +%D The complex (and main) start macro first takes care of the +%D predefined case. Such a predefined setup looks like: +%D +%D \starttyping +%D \definetabletemplate[test][|||] +%D +%D \starttable[test] +%D \VL test \VL test \VL\AR +%D \VL test \VL test \VL\AR +%D \VL test \VL test \VL\AR +%D \stoptable +%D \stoptyping +%D +%D The implementation of the definition macro is not that +%D complicated: + +\def\definetabletemplate % to be redone + {\bgroup + \catcode`\|=\@@other + \doquadrupleempty\dodefinetabletemplate} + +\def\dodefinetabletemplate[#1][#2][#3][#4]% + {\ifsecondargument + \setgvalue{\c!Table#1}{\douseTABLEtemplate{#2}{#3}{#4}}% + \fi + \egroup} + +\def\douseTABLEtemplate#1#2#3% + {\gdef\TABLEhead{\getvalue{@@TABLEhead#2}}% + \gdef\TABLEtail{\getvalue{@@TABLEtail#3}}% + \complexsecondstagestartTABLE[#1]} + +%D The optional third and fourth arguments define which table +%D head and tail to use. +%D +%D \starttyping +%D \definetabletemplate[test][|||][before][after] +%D \stoptyping +%D +%D This also means that one can define table heads and tails +%D by name! +%D +%D \starttyping +%D \starttablehead[before] +%D \HL \VL first \VL second \VL \SR \HL +%D \stoptablehead +%D \stoptyping +%D +%D Templates defined this way get protected names, that cannot +%D conflict with existing commands. +%D +%D \showsetup{definetabletemplate} +%D +%D The second half of the next macro prepares table +%D splitting. + +\def\insertTABLEhead + {\TABLEnoalign{\global\settrue \preventTABLEbreak \global\setfalse\someTABLEhead}% + \TABLEhead + \TABLEnoalign{\global\setfalse\preventTABLEbreak}} + +\def\insertTABLEtail + {\TABLEnoalign{\global\settrue \preventTABLEbreak \global\setfalse\someTABLEtail}% + \TABLEtail + \TABLEnoalign{\global\setfalse\preventTABLEbreak}} + +% \def\dorestartTABLE#1% +% {\gdef\restartTABLE{#1}% +% \restartTABLE +% \insertTABLEhead +% \ifsplittables \ifconditional \tablerepeattail +% \TABLEnoalign{\goodbreak}% +% \insertTABLEtail +% \TABLEnoalign{\goodbreak}% +% \fi \fi} + +\def\verysimpleTableHL + {\TABLEnoalign{\expandafter\normalTABLEfullrule\@@tiHLheight}} + +\def\dorestartTABLE#1% + {\gdef\restartTABLE{#1}% + \restartTABLE + \TABLEnoalign{\globalpushmacro\simpleTableHL\global\let\simpleTableHL\verysimpleTableHL}% + \insertTABLEhead + \ifsplittables \ifconditional \tablerepeattail + \TABLEnoalign{\goodbreak}% + \insertTABLEtail + \TABLEnoalign{\goodbreak}% + \fi \fi + \TABLEnoalign{\globalpopmacro\simpleTableHL}} + +\bgroup \catcode`|=\@@other \catcode`"=\@@other + +\gdef\complexsecondstagestartTABLE#1[#2]% brr nested mess + {\bgroup + \@@useotherbar + \@@useotherquote + \global\setfalse\someTABLEhead + \global\setfalse\someTABLEtail + \expanded{\doifinstringelse{|}{#2}} + {\xdef\restartTABLE{\noexpand\dorestartTABLE{\noexpand\thirdstagestartTABLE{#2}}}} + {\doifdefinedelse{\c!Table#2} + {\gdef\restartTABLE{\getvalue{\c!Table#2}}} + {\gdef\restartTABLE{\dorestartTABLE{\getvalue{#2}}}}}% + \egroup + \restartTABLE} + +\egroup + +%D The third stage involves a lot of (re)sets, which we will +%D explain later. + +%D The next definition is convenient and more in tune with +%D \CONTEXT. + +\let \everytable \EveryTable + +%D We immediately use this register: + +\appendtoks + \fixedspaces + \let\_\normalunderscore +\to \everytable + +%D Now we can start the table. + +\def\thirdstagestartTABLE#1% + {\global\setTABLEactiontrue + \setTABLEaction\TABLEunknown + \setTABLEforce\TABLEunknown + \setTABLEerror\TABLEunknown + \global\TABLEgraylinefalse + \global\TABLEgraydonefalse + \globalletempty\TABLEgrayline + \globalletempty\nextTABLEgrayline + \globalletempty\TABLEgraylineerror + \globalletempty\TABLEgraylinestatus + \resetVLvalues + \appendtoks\popouterbarandquote\to\EveryTable + \appendtoks\localTABLEsetup\to\EveryTable + \BeginTable[\ifsplittables u\else b\fi]% + \defineTABLEunits + \defineTABLEsteps + \defineTABLErules + \defineTABLEdivisions + \defineTABLEshorthands + \defineTABLEbackgrounds + \defineTABLEendings + \forgetall % added + \doifsomething{#1} + {\def\TABLEformat{#1}% + \getTABLEnofcolumns\TABLEformat + % more modern is to use catcode tables + \expandafter\BeginFormat\TABLEformat\EndFormat}} + +\def\finishTABLE + {\chuckTABLEautorow + \unskip\crcr + \EndTable + \global\intablefalse + \egroup} + +%D \macros +%D {starttables} +%D +%D Split tables are specified using the plural form of the +%D start and stop commands. +%D +%D \showsetup{starttables} +%D +%D For example: +%D +%D \starttyping +%D \starttables[|||] +%D \HL +%D \VL element \VL atom weight \VL\AR +%D \HL +%D \VL ....... \VL ........... \VL\AR +%D \VL ....... \VL ........... \VL\AR +%D \HL +%D \stoptables +%D \stoptyping + +\newbox\tablecontentbox + +\def\starttables + {\bgroup + \splittablestrue + \doifelse\@@tisplit\v!repeat + {\settrue \tablerepeathead\settrue \tablerepeattail} + {\setfalse\tablerepeathead\setfalse\tablerepeattail}% + \flushnotes + \setbox\tablecontentbox\vbox\bgroup + \forgetall + \global\TABLEinbreakfalse + \firststagestartTABLE} + +% \def\stoptables +% {\ifconditional\tablerepeattail\else\insertTABLEtail\fi +% \finishTABLE +% \egroup +% \dosplittablebox\tablecontentbox +% \flushnotes +% \egroup} + +\def\stoptables + {\chuckTABLEautorow % AM: before the tail, else noalign problem + \ifconditional\tablerepeattail\else\insertTABLEtail\fi + \finishTABLE + \egroup +\dontcomplain + \dosplittablebox\tablecontentbox + \flushnotes + \egroup} + +\newdimen\TABLEcaptionheight % obsolete + +\def\dosplittablebox#1% + {\resettsplit + \def\tsplitminimumfreelines{2}% + \def\tsplitminimumfreespace{\TABLEcaptionheight}% + \setbox\tsplitcontent\box#1% + \ifconditional\tablerepeathead \ifconditional\someTABLEhead + \setbox\tsplithead\vsplit\tsplitcontent to \lineheight + \setbox\tsplithead\vbox{\unvbox\tsplithead}% + \fi \fi + \ifconditional\tablerepeattail \ifconditional\someTABLEtail + \setbox\tsplittail\vsplit\tsplitcontent to \lineheight + \setbox\tsplittail\vbox{\unvbox\tsplittail}% + \fi \fi + \ifinsidefloat\else + \def\tsplitbeforeresult{\startbaselinecorrection}% + \def\tsplitafterresult {\stopbaselinecorrection}% + \fi + \handletsplit} + +%D When the table in the previous example is split across +%D pages, only the first gets a head. We could have said +%D something like: +%D +%D \starttyping +%D \starttablekop +%D \HL +%D \VL element \VL atom weight \VL\AR +%D \HL +%D \stoptablekop +%D +%D \starttablestaart +%D \HL +%D \stoptablestaart +%D +%D \starttables[|||] +%D \VL ....... \VL ........... \VL\AR +%D \VL ....... \VL ........... \VL\AR +%D \stoptables +%D \stoptyping +%D +%D This time each split table gets a head line and ends with +%D a rule. Keep in mind that such heads also apply to the +%D unbroken ones and should be defined local (grouped) if +%D needed. The rather complicated definition below is due to +%D the fact that the stopcondition is interface language +%D dependant. + +\let\@@TABLEhead\empty \def\TABLEhead{\@@TABLEhead} +\let\@@TABLEtail\empty \def\TABLEtail{\@@TABLEtail} + +\letvalue{\e!start\v!tablehead}=\undefined +\letvalue{\e!stop \v!tablehead}=\undefined +\letvalue{\e!start\v!tabletail}=\undefined +\letvalue{\e!stop \v!tabletail}=\undefined + +\expanded + {\def\csname\e!start\v!tablehead\endcsname##1\csname\e!stop\v!tablehead\endcsname% + {\noexpand\setTABLEhead##1\noexpand\end}} + +\expanded + {\def\csname\e!start\v!tabletail\endcsname##1\csname\e!stop\v!tabletail\endcsname% + {\noexpand\setTABLEtail##1\noexpand\end}} + +%D The second argument is a dummy one, by scanning for it, we +%D get rid of interfering spaces. + +\def\setTABLEhead{\dodoubleempty\dosetTABLEhead} +\def\setTABLEtail{\dodoubleempty\dosetTABLEtail} + +\newconditional\preventTABLEbreak +\newconditional\someTABLEhead + +\def\dosetTABLEhead[#1][#2]#3\end{\setvalue{@@TABLEhead#1}{\TABLEnoalign{\global\settrue\someTABLEhead}#3}} +\def\dosetTABLEtail[#1][#2]#3\end{\setvalue{@@TABLEtail#1}{\TABLEnoalign{\global\settrue\someTABLEtail}#3}} + +%D Redudant \type{\HL}'s are removed automatically, so +%D mid||lines can be used without problems. + +%D We need an alternative for the normal complex or simple +%D commands, because assignments in these system commands +%D conflict with \type{\noalign}. This alternative is about +%D as efficient as possible. + +\def\complexorsimpleTable#1#2% + {\csname\if[\noexpand#2\s!complex\else\s!simple\fi\c!Table#1\endcsname#2} + +%D The next one is used in \type{\VL} cum suis and honours +%D the next grouping. + +\def\docomplexorsimpleTable#1#2% + {\ifx\next\bgroup\@EA#2\else\@EA\dodocomplexorsimpleTable\@EA#1\@EA#2\fi} + +\def\dodocomplexorsimpleTable#1#2#3% + {\if[\noexpand#3\@EA#1\else\@EA#2\fi#3} + +%D The order of the next macros is more or less random. First +%D we implement error recovery. Errors are reported to the +%D screen and log file as well as visualized in the table in +%D teletype. + +\def\handleTABLEerror + {\ifTABLEgrayline \else + \ifnum\TABLEerror=\TABLEunknown \else + \setTABLEaction\TABLEunknown + \globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow + \fi + \ifcase\TABLEerror + % no error + \or + % \TABLEmissingrow + \tttf [missing row]% + \writestatus\m!TABLE{missing row}% + \SR + \or + % \TABLEmissingcolumn + \fillTABLEcolumns + \tttf [missing column]% + \writestatus\m!TABLE{missing column}% + \SR + \or + % \TABLEspanoverflow + \fillTABLEcolumns + \tttf [columnspan too large]% + \writestatus\m!TABLE{columnspan too large}% + \SR + \or + % \TABLEdivisionoverflow + \fillTABLEcolumns + \tttf [division line too long]% + \writestatus\m!TABLE{division line too long}% + \SR + \fi + \fi + \ifnum\TABLEerror=\TABLEunknown \else + \finishTABLErow + \fi} + +\def\finishTABLErow + {\crcr + \TABLEnoalign + {\nobreak + \setTABLEaction\TABLEunknown + \setTABLEerror\TABLEunknown + \globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow + \global\currentTABLEcolumn\zerocount}} + +\def\fillTABLEcolumns + {\ifnum\currentTABLEcolumn>\maxTABLEcolumn \else + \global\advance\currentTABLEcolumn \plusone + \normalTABLEquote + \expandafter\fillTABLEcolumns + \fi} + +%D Next we enter the more complicated area of column and row +%D switching. I won't go into much detail from now on, but just +%D mention the general principles. +%D +%D \startitemize[3*ruim] +%D \sym{\type{\SR}} end a separate row (between rules) +%D \sym{\type{\FR}} end a first row (after a rule) +%D \sym{\type{\MR}} end a mid row (between text lines) +%D \sym{\type{\LR}} end a last row (before a rule) +%D \stopitemize +%D +%D and best of all: +%D +%D \startitemize[continue] +%D \sym{\type{\AR}} end a row with automatic spacing +%D \stopitemize +%D +%D As far as possible, we report confusing situations. In +%D most cases one can use \type{\AR}, which transfigurates +%D itself into one of the other types. +%D +%D \starttyping +%D \starttable[||] +%D \HL +%D \VL a separate row \VL\SR +%D \HL +%D \VL a first row \VL\FR +%D \VL a mid row \VL\MR +%D \VL a last row \VL\LR +%D \HL +%D \stoptable +%D \stoptyping +%D +%D In this example we could have used \type{\AR} without +%D problems. +%D +%D Color or gray scale backgrounds precede the content. They +%D are passed over horizontal (division) lines when needed. +%D Errors in the color template are traced elsewhere. Here we +%D only check for inconsistent spacing. Due to the way \TEX\ +%D handles alignments, we cannot automate spacing for colored +%D rows and columns. + +\chardef\TABLErowzero=0 + +\def\checkTABLErow#1% pure for message purposes + {\unskip % added + \ifTABLEgraydone + \defconvertedargument\asciia{#1}% + \defconvertedcommand \asciib\TABLEendBCL + \ifx\asciia\asciib \else + \writestatus\m!TABLE{confusing \asciia\space and \asciib}% + \gdef\TABLEgraylineerror% + {\globalletempty\TABLEgraylineerror + [\asciia\unskip<->\asciib\unskip]}% + \fi + \global\TABLEgraydonefalse + \fi} + +\def\defineTABLEendings + {\let\SR\TableSR + \let\FR\TableFR + \let\MR\TableMR + \let\LR\TableLR + \let\AR\TableAR} + +\def\TableSR + {\ifTABLEgrayline \else + \ifnum\TABLEaction=\TABLEfirstrow + \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}% + \else\ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}% + \else\ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}% + \fi\fi\fi + \fi + \checkTABLErow\SR + \endTABLErow\TABLEseparaterow\TABLErowfactor\TABLErowfactor} + +\def\TableFR + {\ifTABLEgrayline \else + \ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\FR\space into \string\MR/\string\LR}% + \else\ifnum\TABLEaction=\TABLElastrow + \writestatus\m!TABLE{change \string\FR\space into \string\MR/\string\LR}% + \fi\fi + \fi + \checkTABLErow\FR + \endTABLErow\TABLEfirstrow\TABLErowfactor\TABLErowzero} + +\def\TableMR + {\ifTABLEgrayline \else + \ifnum\TABLEaction=\TABLErule + \writestatus\m!TABLE{change \string\MR\space into \string\FR/\string\SR}% + \else\ifnum\TABLEaction=\TABLElastrow + \writestatus\m!TABLE{change \string\MR\space into \string\FR}% + \fi\fi + \fi + \checkTABLErow\MR + \endTABLErow\TABLEmidrow00} + +\def\TableLR + {\ifTABLEgrayline \else + \ifnum\TABLEaction=\TABLErule + \writestatus\m!TABLE{change \string\LR\space into \string\FR/\string\SR}% + \fi + \fi + \checkTABLErow\LR + \endTABLErow\TABLElastrow\TABLErowzero\TABLErowfactor} + +%D \macros +%D {ifcheckTABLEcolums} +%D +%D +%D The next macros handle the actual row ending. This macro +%D also take care of space corrections due to table splitting +%D when \type{\MR} and collegues are used. When tracing is +%D enabled, the corrections as well as the values used to +%D determine the available space are shown (in color). By default +%D checking is off. + +\newif\ifcheckTABLEcolumns + +\let\beforeTABLEline\empty +\let\afterTABLEline \empty + +\def\doendTABLErow#1#2#3% + {\handleTABLEbreak#2#3% + \beforeTABLEline + \ifcase#1\relax + % unknown + \or + \endofTABLEline[blue][\SR->\SR]\TABLErowfactor\TABLErowfactor + \or + \endofTABLEline[red][\FR->\FR]\TABLErowfactor\TABLErowzero + \or + \ifnum\TABLEforce=\TABLEforcelastrow + \endofTABLEline[red][\MR->\LR]\TABLErowzero\TABLErowfactor + \else\ifnum\TABLEforce=\TABLEforcefirstrow + \endofTABLEline[red][\MR->\FR]\TABLErowfactor\TABLErowzero + \else + \endofTABLEline[green][\MR->\MR]\TABLErowzero\TABLErowzero + \fi\fi + \or + \endofTABLEline[red][\LR->\LR]\TABLErowzero\TABLErowfactor + \fi + \TABLEnoalign + {\setTABLEforce\TABLEunknown + \global\currentTABLEcolumn\zerocount}% + \afterTABLEline} + +\def\endTABLErow#1#2#3% + {\setTABLEaction#1% + \ifTABLEgrayline + \finishTABLErow + \else + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \doendTABLErow{#1}{#2}{#3}% + \else\ifcheckTABLEcolumns + \setTABLEerror\TABLEmissingcolumn + \handleTABLEerror + \else + \doendTABLErow{#1}{#2}{#3}% + \fi\fi + \fi} + +%D Handling \type{\AR} is postponed till the next row. The +%D check takes care of the first and mid rows, the chuck macro +%D |<|how about that name|>| handles the last row. + +\def\TableAR + {\ifTABLEgraydone + \globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow + \global\TABLEgraydonefalse + \TABLEendBCL + \else + \globallet\checkTABLEautorow\docheckTABLEautorow + \globallet\chuckTABLEautorow\dochuckTABLEautorow + \fi} + +\let\checkTABLEautorow\empty +\let\chuckTABLEautorow\empty + +\def\docheckTABLEautorow + {\globallet\checkTABLEautorow\empty + \ifnum\TABLEaction=\TABLErule \FR + \else\ifnum\TABLEaction=\TABLEunknown \FR + \else \MR + \fi\fi} + +\def\dochuckTABLEautorow + {\globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow + \ifnum\TABLEaction=\TABLErule \SR + \else\ifnum\TABLEaction=\TABLEunknown \SR + \else \LR + \fi\fi} + +%D When a table is split, we also add a tail and when present +%D we repeat the table head. + +\def\handleTABLEbreak#1#2% + {\globalletempty\beforeTABLEline + \gdef\afterTABLEline{\TABLEnoalign{\ifconditional\preventTABLEbreak\nobreak\else\goodbreak\fi}}} + +%D When tables are split, the spacing before and after a +%D horizontal rule is corrected according to what we expect. + +\def\endofTABLEline[#1][#2->#3]#4#5% + {\ifx#2#3\else + \writestatus\m!TABLE{\string#2\space changed into \string#3}% + \fi + \iftracetables + \bgroup + \tttf\space + \ifnum\TABLEerror=\TABLEunknown + \ifx#2#3\else\string#2->\fi + \else + ->% + \fi + \color[#1]{\string#3}% + \ifx\TABLEgraylineerror\empty + \space\TABLEgraylinestatus + \else + \space\TABLEgraylineerror + \fi + \egroup + \else\ifx\TABLEgraylineerror\empty \else + % \bgroup + % \tttf\space\TABLEgraylineerror + % \egroup + \fi\fi + \globalletempty\TABLEgraylinestatus + \globalletempty\TABLEgraylineerror + \expandafter\normalTABLElineformat#4#5\crcr % \crcr nodig ? + \TABLEnoalign{\nobreak\global\setTABLEactiontrue}} + +%D In order to prevent (as good as possible) alignment overflow +%D and therefore \TEX\ error messages, we check the maximum +%D number of columns. We keep track of the current column and +%D maximum column by means of two \COUNTERS. Keep in mind that +%D the number of \type{|}'s and \type{\VL}'s or alike is always +%D one more than the number of columns. + +\newcount\currentTABLEcolumn +\newcount\maxTABLEcolumn + +%D While defining this macro we change the \CATCODE\ of +%D \type{|}. When counting the bars, we use a non active +%D representation of the bar, simply because we cannot be sure +%D if the bar is active or not.\footnote{Normally it is, but +%D \TABLE\ changes the catcode when needed.} + +\bgroup + \catcode`\|=\@@other \gdef\@@otherbar {|} + \catcode`\"=\@@other \gdef\@@otherquote {"} + \catcode`\|=\@@active \gdef\@@useotherbar {\let|\@@otherbar} + \catcode`\"=\@@active \gdef\@@useotherquote{\let"\@@otherquote} +\egroup + +\bgroup \catcode`\|=\@@other + +\gdef\getTABLEnofcolumns#1% + {\bgroup + \cleanupfeatures % needed ! + \@@useotherbar + \@@useotherquote + \expanded{\defconvertedargument\noexpand\ascii{#1}}% + \@EA\doglobal\@EA\counttoken\@EA|\@EA\in\ascii\to\maxTABLEcolumn + \global\advance\maxTABLEcolumn \minusone + % in case of & counting, divide by 2 + \egroup} + +\egroup + +\def\!ttDoHalign + {\edef\restoretablelineskips + {\baselineskip \the\baselineskip + \lineskiplimit\the\lineskiplimit + \lineskip \the\lineskip + \tabskip \the\tabskip}% + \baselineskip \zeropoint + \lineskiplimit\zeropoint + \lineskip \zeropoint + \tabskip \zeropoint + % does not work in normal tex + % \expanded{\getTABLEnofcolumns{\the\!taPreamble}}% added + \halign \the\!taTableSpread \bgroup + \span\the\!taPreamble + \ifx \!tfRowOfWidths \empty \else \!tfRowOfWidths \cr \fi} + +%D \startitemize[3*ruim] +%D \sym{\type{\VL}} a vertical line +%D \sym{\type{\VC}} a vertical colored line +%D \sym{\type{\HL}} a horizontal line +%D \sym{\type{\HC}} a horizontal colored line +%D \stopitemize + +% \def\defineTABLErules +% {\let\VL\TableVL +% \let\VC\TableVC +% \let\HL\TableHL +% \let\HC\TableHC} + +\def\defineTABLErules + {\let\VL\TableVL + \let\VC\TableVC + \let\HL\TableHL + \let\HC\TableHC + \let\VS\TableVS + \let\VD\TableVD + \let\VT\TableVT + \let\VN\TableVN} + +\def\TableVL + {\checkTABLEautorow + \nextTABLEgrayline + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \else + \global\advance\currentTABLEcolumn \plusone + \expandafter\doTableVL + \fi} + +\def\doTableVL + {\futurelet\next\dodoTableVL} + +\def\dodoTableVL + {\docomplexorsimpleTable\complexTableVL\simpleTableVL} + +\def\complexTableVL[#1]% + {\scratchcounter=0#1% + \multiply\scratchcounter \@@tiVLwidth + \setxvalue{wVL\the\currentTABLEcolumn}{\the\scratchcounter}% + \simpleTableVL} + +\def\simpleTableVL + {\doifundefined{wVL\the\currentTABLEcolumn}% + {\setgvalue{wVL\the\currentTABLEcolumn}{\@@tiVLwidth}}% + \gdef\TABLEbeforebar + {\getvalue{bVL\the\currentTABLEcolumn}% + \letgvalueempty{bVL\the\currentTABLEcolumn}}% + \gdef\TABLEafterbar + {\getvalue{eVL\the\currentTABLEcolumn}% + \letgvalueempty{eVL\the\currentTABLEcolumn}}% + \edef\@@tiVLwidth{\getvalue{wVL\the\currentTABLEcolumn}}% + \expanded{\normalTABLEcomplexbar\@@tiVLwidth\space}}% \relax breaks \use + +% \starttable[|||] +% \HL +% \VL test \VS test \VL \FR +% \VL test \VD test \VL \MR +% \VL test \VT test \VL \LR +% \HL +% \stoptable + +\def\TableVS {\VN1} +\def\TableVD {\VN2} +\def\TableVT {\VN3} +\def\TableVN#1{\gdef\@VLn{#1}\VL} + +\def\resetVLvalues + {\dostepwiserecurse\zerocount\maxTABLEcolumn\plusone + {\setgvalue{wVL\recurselevel}{\@@tiVLwidth}% + \letgvalueempty{bVL\recurselevel}% + \letgvalueempty{eVL\recurselevel}}% + \global\currentTABLEcolumn\zerocount} + +\def\TableVC + {\checkTABLEautorow + \nextTABLEgrayline + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \else + \global\advance\currentTABLEcolumn \plusone + \expandafter\doTableVC + \fi} + +\def\doTableVC + {\futurelet\next\dodoTableVC} + +\def\dodoTableVC + {\docomplexorsimpleTable\complexTableVC\simpleTableVC} + +\def\complexTableVC[#1]% + {\global\setvalue{bVC\the\currentTABLEcolumn}{\startcolor[#1]}% + \global\setvalue{eVC\the\currentTABLEcolumn}{\stopcolor}% + \simpleTableVC} + +\def\simpleTableVC + {\global\setvalue{bVL\the\currentTABLEcolumn}% + {\getvalue{bVC\the\currentTABLEcolumn}}% + \global\setvalue{eVL\the\currentTABLEcolumn}% + {\getvalue{eVC\the\currentTABLEcolumn}}% + \doTableVL} + +\def\TableHL + {\ifnum\currentTABLEcolumn>\maxTABLEcolumn + \chuckTABLEautorow + \else\ifnum\currentTABLEcolumn=\zerocount + %\chuckTABLEautorow + \TABLEnoalign + {\globalletempty\checkTABLEautorow + \globalletempty\chuckTABLEautorow}% + \else + \setTABLEerror\TABLEmissingcolumn + \handleTABLEerror + \fi\fi + \complexorsimpleTable{HL}} + +\def\complexTableHL[#1]% + {\TABLEnoalign + {\scratchcounter0#1% + \multiply\scratchcounter \@@tiHLheight + \edef\@@tiHLheight{\the\scratchcounter}% + \simpleTableHL}} + +\def\simpleTableHL + {\TABLEnoalign + {\nobreak + \ifnum\TABLEaction=\TABLErule + \writestatus\m!TABLE{skipping \string\HL}% \statusmessage + \else + \ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\MR\space into \string\LR/\string\SR}% + \else\ifnum\TABLEaction=\TABLEfirstrow + \writestatus\m!TABLE{change \string\MR\space into \string\SR}% + \fi\fi + \startHLcommand + \expandafter\normalTABLEfullrule\@@tiHLheight + \stopHLcommand + \globalletempty\startHLcommand + \globalletempty\stopHLcommand + \accountTABLElinewidth + \fi + \setTABLEaction\TABLErule + \nobreak}} + +\let\startHLcommand\empty +\let\stopHLcommand \empty + +\def\TableHC + {\complexorsimpleTable{HC}} + +\def\complexTableHC[#1]% + {\TABLEnoalign + {\gdef\startHCcommand{\startcolor[#1]}% + \gdef\stopHCcommand {\stopcolor}}% + \simpleTableHC} + +\def\simpleTableHC + {\TABLEnoalign + {\globallet\startHLcommand\startHCcommand + \globallet\stopHLcommand \stopHCcommand}% + \HL} + +%D \startitemize[3*ruim] +%D \sym{\type{\NL}} a vertical skip +%D \sym{\type{\NR}} goto the next row +%D \sym{\type{\NC}} goto the next column +%D \sym{\type{\FC}} a first column +%D \sym{\type{\MC}} a mid column +%D \sym{\type{\LC}} a last column +%D \stopitemize + +% n+1 uitleggen + +\def\defineTABLEsteps + {\let\NL\TableNL + \let\NR\TableNR + \let\NC\TableNC + \let\FC\TableNC + \let\MC\TableNC + \let\LC\TableNC} + +\def\TableNL + {\complexorsimpleTable{NL}} + +\def\complexTableNL[#1]% + {\TABLEnoalign + {\edef\@@tiNL{#1}% + \simpleTableNL}}% + +\def\simpleTableNL + {\TABLEnoalign + {\nobreak + \setbox0\vbox{\blank[\@@tiNL]}% + \vskip\ht0 + \nobreak}} + +\def\TableNR + {\ifnum\currentTABLEcolumn>\maxTABLEcolumn + \global\currentTABLEcolumn\zerocount + \normalTABLElineending + \else + \setTABLEerror\TABLEmissingcolumn + \handleTABLEerror + \fi + \TABLEnoalign + {\nobreak + \setTABLEaction\TABLEunknown}} + +\def\TableNC + {\checkTABLEautorow + \nextTABLEgrayline + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \else + \global\advance\currentTABLEcolumn \plusone + \normalTABLEquote + \fi} + +% \bgroup +% \catcode`\|=\@@active +% \catcode`\"=\@@active +% \gdef\redefinetablebarandquote +% {\def|{\VL}% % \normalTABLEsimplebar +% \def\|##1{\VL[##1]}% % \normalTABLEcomplexbar +% \def"{\NC}} % \normalTABLEquote +% \egroup + +\let\redefinetablebarandquote\relax + +%D \startitemize[3*ruim] +%D \sym{\type{\DL}} +%D \sym{\type{\DV}} (\type{\VD}) +%D \sym{\type{\DC}} +%D \sym{\type{\DR}} +%D \stopitemize + +\newif\ifTABLEdivision + +% \def\defineTABLEdivisions +% {\global\TABLEdivisionfalse % in start +% \let\DL\TableDL +% \let\DC\TableDC +% \let\DV\TableDV +% \let\VD\TableDV +% \let\DR\TableDR} + +\def\defineTABLEdivisions + {\global\TABLEdivisionfalse % in start + \let\DL\TableDL + \let\DC\TableDC + \let\DV\TableDV + \let\DR\TableDR} + +\def\checkTABLEdivision + {\ifTABLEdivision \else + \chuckTABLEautorow + \global\currentTABLEcolumn\zerocount + \global\TABLEdivisiontrue + \fi} + +\def\TableDL + {\checkTABLEdivision + \complexorsimpleTable{DL}} + +\def\simpleTableDL + {\complexTableDL[1]} + +\def\complexTableDL[#1]% + {\ifnum\TABLEaction=\TABLErule + \writestatus\m!TABLE{skipping \string\DL}% + \else + \ifnum\TABLEaction=\TABLEmidrow + \writestatus\m!TABLE{change \string\MR\space into \string\LR/\string\SR}% + \else\ifnum\TABLEaction=\TABLEfirstrow + \writestatus\m!TABLE{change \string\MR\space into \string\SR}% + \fi\fi + \setTABLEaction=\TABLEunknown + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \fi + %\startHLcommand + \ifnum#1=\plusone + \global\advance\currentTABLEcolumn \plustwo + \let\next\normalTABLEsinglerule + \else + \ifnum#1<\maxTABLEcolumn + \global\advance\currentTABLEcolumn \plusone + \def\next{\normalTABLEmultirule{#1}}% + \else + \setTABLEerror\TABLEdivisionoverflow + \let\next\handleTABLEerror + \fi + \fi + \next + %\stopHLcommand + %\globalletempty\startHLcommand + %\globalletempty\stopHLcommand + \fi} + +\def\TableDV + {\TableDCV\normalTABLEsimplebar} + +\def\TableDC + {\TableDCV\normalTABLEquote} + +\def\TableDCV#1% + {\checkTABLEdivision + \checkTABLEautorow + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + \setTABLEerror\TABLEmissingrow + \handleTABLEerror + \else + \global\advance\currentTABLEcolumn \plusone + #1% + \fi} + +\def\TableDR + {\ifnum\currentTABLEcolumn<\maxTABLEcolumn % silent recovery + %\setTABLEerror\TABLEmissingcolumn % some day warning + %\handleTABLEerror + \finishTABLErow + \else + \global\currentTABLEcolumn\zerocount % nog check + \normalTABLElineending + \fi + \TABLEnoalign + {\nobreak + \global\TABLEdivisionfalse + \accountTABLElinewidth % temporary solution + \setTABLEaction\TABLErule}} + +\def\accountTABLElinewidth + {\scratchdimen\LineThicknessUnit} + +%D \startitemize[3*ruim] +%D \sym{\type{\BC}} +%D \sym{\type{\BR}} +%D \sym{\type{\BACKGROUND}} +%D \sym{\type{\CL}} +%D \sym{\type{\RL}} +%D \sym{\type{\BL}} +%D \sym{\type{\RASTER}} +%D \sym{\type{\COLOR}} +%D \stopitemize + +% definieer: \BC \BL +% herhaal: \BR +% definieer: \CL \RL (eerste \CL[green] = hele row! / \CL[1,green]) +% dus: \CL en \RL mix tussen \HL en \BL + +\def\defineTABLEbackgrounds + {\let\BC \TableBC + \let\BL \TableBL + \let\BR \TableBR + \let\BACKGROUND\TableBR + \let\CL \TableCL + \let\RL \TableRL + \let\COLOR \TableCOLOR + \let\RASTER \TableRASTER + \globallet\lastTABLEc\@@tibackgroundcolor + \globallet\lastTABLEr\@@tibackgroundscreen + \doifinsetelse\@@tibackground{c,color} % \v!color + {\global\chardef\TABLEcr\plusone} + {\global\chardef\TABLEcr\plustwo}} + +\def\TableBC + {\ifTABLEgrayline + \normalTABLEquote + \else + \TABLEnoalign\bgroup + \globallet\nextTABLEgrayline\executeTABLEgrayline + \globalletempty\TABLEgrayline % new + \let\BL\doTableBL + \let\BC\doTableBC + \expandafter\doTableBC + \fi} + +\def\doTableBC + {\addtoTABLEgrayline{\BC}% + \gobbleTableBCL} + +\def\TableBL + {\TABLEnoalign\bgroup + \globallet\nextTABLEgrayline\executeTABLEgrayline + \globalletempty\TABLEgrayline % new + \let\BL\doTableBL + \let\CL\doTableCL + \let\RL\doTableRL + \let\BC\doTableBC + \doTableBL} + +\def\doTableBL + {\complexorsimpleTable{BL}} + +\def\simpleTableBL + {\complexTableBL[,]} + +\def\complexTableBL[#1]% + {\analyzeTABLEcr[#1]% + \handleTABLEcr} + +\def\TableBR#1% + {\TABLEnoalign + {\globallet\nextTABLEgrayline\executeTABLEgrayline + \checkTABLEgrayline#1\BR + \global\TABLEgraylinetrue}} + +\def\analyzeTABLEcr[#1]% + {\doanalyzeTABLEcr[#1,,]} + +\def\doanalyzeTABLEcr[#1,#2,#3]% + {\doifnumberelse{#1x} % Is the x still needed here? + {\dodoanalyzeTABLEcr[#1,#2,#3]} + {\dodoanalyzeTABLEcr[1,#1,#2]}} + +\def\dodoanalyzeTABLEcr[#1,#2,#3]% + {\global\chardef\TABLEn#1\relax + \processaction + [#2] + [ c=>\global\chardef\TABLEcr1,% + color=>\global\chardef\TABLEcr1,% + r=>\global\chardef\TABLEcr2,% + raster=>\global\chardef\TABLEcr2]% + \ifcase\TABLEcr \or + \doifsomething{#3}{\xdef\lastTABLEc{#3}}% + \or + \doifsomething{#3}{\xdef\lastTABLEr{#3}}% + \fi} + +\def\handleTABLEcr + {\relax % else funny side effect + \ifcase\TABLEcr + % Can't happen! + \or + \addtoTABLEgrayline{\complexTableCOLOR[\the\TABLEn,\lastTABLEc]}% + \else + \addtoTABLEgrayline{\complexTableRASTER[\the\TABLEn,\lastTABLEr]}% + \fi + \gobbleTableBCL} + +\def\analyzeTABLEcrl#1[#2]% + {\doanalyzeTABLEcrl#1[#2,,]} + +\def\doanalyzeTABLEcrl#1[#2,#3,#4]% + {\doifnumberelse{#2x} % x ???????????????????? + {\dodoanalyzeTABLEcr[#2,#1,#3]} + {\dodoanalyzeTABLEcr[\ifTABLEgrayline1\else\maxTABLEcolumn\fi,#1,#2]}} + +\def\TableCL + {\TABLEnoalign\bgroup + \globallet\nextTABLEgrayline\executeTABLEgrayline + \globalletempty\TABLEgrayline % new + \let\BL\doTableBL + \let\CL\doTableCL + \let\RL\doTableRL + \let\BC\doTableBC + \doTableCL} + +\def\doTableCL + {\complexorsimpleTable{CL}} + +\def\simpleTableCL% nog eens \'e\'en lijn van maken + {\BL[\the\maxTABLEcolumn,c,\lastTABLEc]} + +\def\complexTableCL[#1]% + {\analyzeTABLEcrl{c}[#1]% + \handleTABLEcr} + +\def\TableRL + {\TABLEnoalign\bgroup + \globallet\nextTABLEgrayline\executeTABLEgrayline + \globalletempty\TABLEgrayline % new + \let\BL\doTableBL + \let\CL\doTableCL + \let\RL\doTableRL + \let\BC\doTableBC + \doTableRL} + +\def\doTableRL + {\complexorsimpleTable{RL}} + +\def\simpleTableRL + {\BL[\the\maxTABLEcolumn,r,\lastTABLEr]} + +\def\complexTableRL[#1]% + {\analyzeTABLEcrl{r}[#1]% + \handleTABLEcr} + +\def\checkTABLEgrayline#1#2% + {\!!doneatrue + \ifx#1\AR + \!!doneafalse + \else\ifx#1\SR\else\ifx#1\FR\else\ifx#1\MR\else\ifx#1\LR\else + \!!doneafalse + \fi\fi\fi\fi\fi + \if!!donea + \gdef\TABLEgraylinestatus + {[\string#1]}% + \gdef\TABLEendBCL + {#1}% + \else + \gdef\TABLEgraylineerror + {[\string#2\string#1->\string#2\string\SR]}% + \gdef\TABLEendBCL + {\SR}% + \fi} + +\def\endTABLErowGL#1#2#3% + {\ifcase#1\relax + % unknown + \or + \doPreTableGL\TABLErowfactor\TABLErowfactor + \or + \doPreTableGL\TABLErowfactor\TABLErowzero + \or + \ifnum\TABLEforce=\TABLEforcelastrow + \doPreTableGL\TABLErowzero\TABLErowfactor + \else\ifnum\TABLEforce=\TABLEforcefirstrow + \doPreTableGL\TABLErowfactor\TABLErowzero + \else + \doPreTableGL\TABLErowzero\TABLErowzero + \fi\fi + \or + \doPreTableGL\TABLErowzero\TABLErowfactor + \fi} + +\def\doPreTableGL#1#2% betere namen + {\xdef\OldLineThicknessFactor{\the\LineThicknessFactor}% + \xdef\OldLineThicknessUnit{\the\LineThicknessUnit}% + \global\LineThicknessFactor\plusone + \setbox0\hbox{\AugmentedTableStrut{#1}{#2}}% + \getboxheight\dimen0\of\box0\relax + \xdef\TABLEgraylineHeight{\the\dimen0}% + \global\LineThicknessUnit\TABLEgraylineHeight} + +\def\doPostTableGL + {\global\LineThicknessFactor\OldLineThicknessFactor + \global\LineThicknessUnit \OldLineThicknessUnit} + +% kan simpeler + +\def\docomplexTableCOLOR[#1]% + {\dodocomplexTableGL\startcolor \stopcolor [#1,\lastTABLEc,,]} + +\gdef\docomplexTableRASTER[#1]% + {\dodocomplexTableGL\startraster\stopraster[#1,\lastTABLEr,,]} + +\def\dodocomplexTableGL#1#2[#3,#4,#5,#6]% + {\doifelsenothing{#4}{#1[#5]}{#1[#4]}% + \doPreTableGL\TABLEendofrowheight\TABLEendofrowdepth + \ifnum#3=\plusone % else conflict with \omit in \= + \let\next\normalTABLEsinglerule + \else + \def\next{\normalTABLEmultirule{#3}}% + \fi + \next + \doPostTableGL + #2} + +\def\TableBACKGROUND + {\TableBR} + +\def\simpleTableRASTER #1{\docomplexTableRASTER[1]#1} +\def\complexTableRASTER[#1]{\docomplexTableRASTER[#1]} +\def\simpleTableCOLOR {\docomplexTableCOLOR [1]} +\def\complexTableCOLOR [#1]{\docomplexTableCOLOR [#1]} + +\def\TableRASTER{\complexorsimpleTable{RASTER}} +\def\TableCOLOR {\complexorsimpleTable{COLOR}} + +\def\addtoTABLEgrayline#1% + {\TABLEgraytoks\expandafter{\TABLEgrayline}% + \xdef\TABLEgrayline{\the\TABLEgraytoks\noexpand#1}} + +\def\setTableBCL#1#2% + {\ifx#1#2% + \gdef\TABLEgraylinestatus{[\string#1]}% + \gdef\TABLEendBCL{#1}% + \addtoTABLEgrayline{#1}% + \else + \gdef\TABLEgraylineerror{[\string#1->\string#2]}% + \gdef\TABLEendBCL{#2}% + \addtoTABLEgrayline{#2}% + \fi} + +\def\gobbleTableBCL#1% + {\ifx#1\BC \let\next\doTableBC \else + \ifx#1\BL \let\next\doTableBL \else + \ifx#1\SR \setTableBCL\SR\SR \let\next\egroup \else + \ifx#1\FR \setTableBCL\FR\FR \let\next\egroup \else + \ifx#1\MR \setTableBCL\MR\MR \let\next\egroup \else + \ifx#1\LR \setTableBCL\LR\LR \let\next\egroup \else + \setTableBCL #1\SR \let\next\egroup + \fi\fi\fi\fi\fi\fi + \next} + +\def\executeTABLEgrayline + {\TABLEnoalign + {\def\BC + {\advance\currentTABLEcolumn \plusone}% + \def\dodocomplexTableGL##1##2[##3,##4,##5,##6]% + {\BC\advance\currentTABLEcolumn ##3 }% + \let\endTABLErow\endTABLEgrayrow + \currentTABLEcolumn\zerocount + \TABLEgrayline\TABLEendBCL % determine n of columns and height + \advance\currentTABLEcolumn \minusone + \ifnum\currentTABLEcolumn>\maxTABLEcolumn + % error message too long line + \globalletempty\TABLEgrayline + \else + % \message{n of color columns: \the\currentTABLEcolumn}\wait + \global\TABLEgraylinetrue % vanaf hier nog checken + \fi + \global\currentTABLEcolumn\zerocount}% + \unskip\TABLEgrayline\TABLEendBCL + \TABLEnoalign + {\nobreak + \vskip-\TABLEgraylineHeight + \nobreak + \global\setTABLEactiontrue + \global\currentTABLEcolumn\zerocount + \globalletempty\nextTABLEgrayline + \global\TABLEgraydonetrue + \global\TABLEgraylinefalse}} + +\def\endTABLEgrayrow#1#2#3% + {\ifcase#1\relax + \global\chardef\TABLEendofrowheight\TABLErowfactor + \global\chardef\TABLEendofrowdepth \TABLErowfactor + \or + \global\chardef\TABLEendofrowheight\TABLErowfactor + \global\chardef\TABLEendofrowdepth \TABLErowfactor + \or + \global\chardef\TABLEendofrowheight\TABLErowfactor + \global\chardef\TABLEendofrowdepth \TABLErowzero + \or + \ifnum\TABLEforce=\TABLEforcelastrow + \global\chardef\TABLEendofrowheight\TABLErowzero + \global\chardef\TABLEendofrowdepth \TABLErowfactor + \else\ifnum\TABLEforce=\TABLEforcefirstrow + \global\chardef\TABLEendofrowheight\TABLErowfactor + \global\chardef\TABLEendofrowdepth \TABLErowzero + \else + \global\chardef\TABLEendofrowheight\TABLErowzero + \global\chardef\TABLEendofrowdepth \TABLErowzero + \fi\fi + \or + \global\chardef\TABLEendofrowheight\TABLErowzero + \global\chardef\TABLEendofrowdepth \TABLErowfactor + \fi} + +\def\defineTABLEshorthands% + {\def\SPAN##1{\use{##1}}% + \def\TWO {\use2}% + \def\THREE {\use3}% + \def\FOUR {\use4}% + \def\FIVE {\use5}% + \def\SIX {\use6}% + \def\REF {\ReFormat}} + +\def\defineTABLEunits + {\processaction + [\@@tidistance] + [ \v!none=>\OpenUp00\def\LOW{\Lower6 }, + \v!small=>\OpenUp00\def\LOW{\Lower6 }, % == baseline + \v!medium=>\OpenUp11\def\LOW{\Lower7 }, + \v!big=>\OpenUp22\def\LOW{\Lower8 }]% + \doifelse\@@tidistance\v!none + {\chardef\TABLErowfactor\zerocount} + {\chardef\TABLErowfactor\plustwo }} + +\def\dohandlebar % here ? + {\ifmmode + \@EA\domathmodebar + \else\ifintable + \@EAEAEA\domathmodebar + \else + \@EAEAEA\dotextmodebar + \fi\fi} + +% De macro's t.b.v. instellingen. + +\def\setuptables + {\dosingleargument\dosetuptables} + +\def\dosetuptables[#1]% + {\getparameters[\??ti][#1]% + \processaction + [\@@tialign] + [ \v!right=>\def\TABLEparalignment{\raggedright}, + \v!left=>\def\TABLEparalignment{\raggedleft}, + \v!middle=>\def\TABLEparalignment{\raggedcenter}, + \s!default=>\def\TABLEparalignment{\notragged}, + \s!unknown=>\def\TABLEparalignment{\notragged}]% + \assignalfadimension\@@tiVL\@@tiVLwidth 246% + \assignalfadimension\@@tiHL\@@tiHLheight246} + +\def\localTABLEsetup + {\@@ticommands\relax + \expanded{\switchtobodyfont[\@@tibodyfont]}% + \StrutHeightFactor 8 + \StrutDepthFactor 4 + \LineThicknessFactor4 + \NormalTLTU {.1pt}% + \NormalTSU {\normalbaselineskip\divide\StrutUnit 12 }% + \NormalTableUnits} + +%D And then I wrote the tabulate environment. That +%D alternative supports setting the rule thickness and color, +%D so here is the table alternative. + +\let\startglobalTABLEcolor\empty +\let\stopglobalTABLEcolor \empty + +\def\localTABLEsetup + {\@@ticommands\relax + % bodyfont + \expanded{\switchtobodyfont[\@@tibodyfont]}% + % linecolor + \doifsomething\@@tirulecolor + {\def\startglobalTABLEcolor{\startcolor[\@@tirulecolor]}% + \def\stopglobalTABLEcolor {\stopcolor}}% + % linethickness + \LineThicknessFactor4 + \scratchdimen\@@tirulethickness + \divide\scratchdimen \LineThicknessFactor + \expanded{\NormalTLTU{\the\scratchdimen}}% + % spacing, was depth=4 height=8 (counters, sigh, now macros) + \doifelse\@@tiheight\v!strut + {\let\StrutHeightFactor\@@itheight} + {\let\StrutHeightFactor\@@tiheight}% + \doifelse\@@tidepth\v!strut + {\let\StrutDepthFactor\@@itdepth} + {\let\StrutDepthFactor\@@tidepth}% + \scratchdimen\StrutHeightFactor\points \multiply\scratchdimen 10% + \edef\StrutHeightFactor{\withoutpt\the\scratchdimen}% + \scratchdimen\StrutDepthFactor \points \multiply\scratchdimen 10% + \edef\StrutDepthFactor{\withoutpt\the\scratchdimen}% + % units + \NormalTSU{\normalbaselineskip\divide\StrutUnit 12 }% + \NormalTableUnits} + +\def\OpenUp#1#2% + {\scratchdimen\StrutHeightFactor \points \advance\scratchdimen #1\points + \edef\StrutHeightFactor{\withoutpt\the\scratchdimen}% + \scratchdimen\StrutDepthFactor \points \advance\scratchdimen #2\points + \edef\StrutDepthFactor{\withoutpt\the\scratchdimen}} + +%D As one can see, we didn't only add color, but also more +%D control over spacing. +%D +%D \startbuffer[a] +%D \starttable[|c|] +%D \HL +%D \VL \strut test \VL \FR +%D \VL \strut test \VL \MR +%D \VL \strut test \VL \MR +%D \VL \strut test \VL \LR +%D \HL +%D \stoptable +%D \stopbuffer +%D +%D \startbuffer[b] +%D \starttabulate[|c|] +%D \HL +%D \NC test \NC \NR +%D \NC test \NC \NR +%D \NC test \NC \NR +%D \NC test \NC \NR +%D \HL +%D \stoptabulate +%D \stopbuffer +%D +%D In the next example, the first table is defined as: +%D +%D \typebuffer[a] +%D +%D and the second one as: +%D +%D \typebuffer[b] +%D +%D The first table is typeset using the default height and +%D depth factors .8 and .4. The second table has both factors +%D set to \type {strut}, and the third table shows what +%D happens when we set the values to zero. The rightmost table +%D is typeset using the tabulate environment. +%D +%D \startcombination[4*1] +%D {$\vcenter{\getbuffer[a]}$} +%D {\hbox{h=.8 d=.4}} +%D {\setuptables[height=strut,depth=strut]$\vcenter{\getbuffer[a]}$} +%D {\hbox{h=d=\type{strut}}} +%D {\setuptables[height=0,depth=0]$\vcenter{\getbuffer[a]}$} +%D {\hbox{h=d=0}} +%D {$\vcenter{\getbuffer[b]}$} +%D {\hbox{tabulate}} +%D \stopcombination + +\setuptables + [HL=\v!medium, + VL=\v!medium, + NL=\v!small, + \c!frame=, + \c!align=\v!right, + \c!depth=.40, % \v!strut + \c!height=.80, % \v!strut + \c!rulethickness=\linewidth, + \c!rulecolor=, + \c!distance=\v!medium, + \c!bodyfont=\the\bodyfontsize, + \c!commands=, + \c!background=\v!screen, + \c!backgroundscreen=\@@rsscreen, + \c!backgroundcolor=, + \c!split=\v!auto] + +\def\ifintabel{\ifintable} % upward compatible + +\protect \endinput diff --git a/tex/context/base/tabl-tab.tex b/tex/context/base/tabl-tab.tex deleted file mode 100644 index 361369ea2..000000000 --- a/tex/context/base/tabl-tab.tex +++ /dev/null @@ -1,2507 +0,0 @@ -%D \module -%D [ file=core-tab, -%D version=1997.10.10, -%D title=\CONTEXT\ Table Macros, -%D subtitle=\TABLE\ Embedding, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Table Macros / TaBlE Embedding} - -% By now it makes more sense to merge the patches into the original -% and clean that one up too. - -% Don't change the splitter: -% -% ... \NR -% \TABLEnoalign{\page}\TABLEhead -% \NC ... - -% e-tex: reverse rows or vadjust or ... in tables -% \ifalign -% \xhrule : calls for 'special' with width -% BUG: -% -% \starttable[|l|l|] -% \HL -% \RL\FR \VL Head 1 \VL Head 2 \VL\FR -% \RL\LR \VL Head A \VL Head B \VL\LR % niet grijs ?? -% \HL -% \VL 1 \VL 2 \VL\FR -% \VL a \VL b \VL\LR -% \HL -% \stoptable - -% melden als in kleur conflict, uitgestelde test op \SR\SR - -% verengelsen -% interface - -% footnotes flushen -% \......TABLE........ namen -% kolommen testen -% unbreakable kop definieren -% voetnoten -% meldingen -% als direct \use{max} dan fout -% \BREAKPOINT -% breedte lijn telt -% errors: ook gray in handle - -% \AR -> als in DL dan \DR - -% nieuw: -% -% \NL / \NL[blanko] is skip, nog default? -% geen \HL in a row -% \HL[n] -% \VL[n] + remembers -% c{colorspec} key -% \HC[color][width] -% \VC[color] -% meldingen row, column, use, advise -% \AR: UITSTELLEN / EXPERIMENTEEL - -% WAARDELOZE ERROR HANDLER -% THIS RENEWED MODULE WORKS OK BUT STILL LOOKS BAD - -%D We felt no need to write our own table building macros, -%D simply because Michael Wichura made a terrific one. This -%D package is quite complete and well documented. In \CONTEXT\ -%D we provide a shell for consistent spacing as well as color -%D support. Implementing these features without adapting the -%D original macros is not trivial. One easilly gets conflicts -%D with \type{\omit}, \type{\span} and \type{\noalign}, which -%D means that we end up postponing and overloading macros, -%D mostly global. Now, let's start with loading the main -%D macros: - -\doifundefined{BeginTable}{\doinputonce{table.tex}} - -\unprotect - -%D \macros -%D {inintable, ifsplittables} -%D -%D First we declare some variables. These show a bit what we -%D are dealing with. First we introdoce some booleans that -%D enable us, inside as well as outside this module, to -%D determine in what mode we are. - -\newif\ifintable -\newif\ifsplittables - -%D \macros -%D {tracetablestrue} -%D -%D When I documented this module, I felt the need for tracing -%D options. After implementing this feature, I also added -%D warnings, error recovery and automatic spacing. - -\newif\iftracetables - -%D We show this feature in an eample that also shows some of -%D the basic table typesetting commands. -%D -%D \startbuffer -%D \starttable[|||] -%D \HL -%D \VL first \VL second \VL\AR -%D \HL -%D \VL alfa \VL 1 \VL\AR -%D \VL beta \VL 2 \VL\AR -%D \VL gamma \VL 3 \VL\AR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \startcombination -%D {\tracetablesfalse\getbuffer} {\type{\tracetablesfalse}} -%D {\tracetablestrue\getbuffer} {\type{\tracetablestrue}} -%D \stopcombination -%D -%D This table is specified as: -%D -%D \typebuffer -%D -%D This examples shows about the minimum of commands needed to -%D typeset such a table. In this table, the \type {\AR} is -%D automatically translated into the more primitive (but more -%D verbose) commands \type {\SR}, \type {\FR}, \type {\MR} and -%D \type {\LR} commands. -%D -%D \startbuffer -%D \starttables[|||] -%D \HL -%D \VL first \VL second \VL\AR -%D \HL -%D \VL alfa \VL 1 \VL\AR -%D \VL beta \VL 2 \VL\AR -%D \VL gamma \VL 3 \VL\AR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D When we use the split table feature, we get a bit more -%D information. -%D -%D {\tracetablesfalse\getbuffer} -%D -%D Sometimes in tables information shows up that is not typed -%D in by the user. These messages give a cue in what aspect a -%D table definition is wrong. -%D -%D \startbuffer -%D \starttable[||||] -%D \HL -%D \VL first second \VL third \VL\AR -%D \HL -%D \VL alfa \VL 1 \VL a \VL\AR -%D \VL beta \VL 2 \VL b \VL -%D \VL gamma \VL \THREE{3} c \VL\AR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \typebuffer -%D -%D Those terrible table has three errors, which all show up in -%D typeset messages. Errors cannot always recovered 100\% and -%D therefore can result in two or more succesive messages, like -%D in the last row. -%D -%D \getbuffer - -%D Bringing color into tables is complicated by the mere fact -%D that color is not part of \TEX. The main complication is -%D that we don't know in advance how wide a column will be. I -%D implemented color support in tables in the early 90's -%D because I needed it for some articles on color. I have to -%D admit that I seldom use the mechanism. -%D -%D Most color support in \CONTEXT\ makes use of colored rules. -%D At first sight, one is tempted to implement colors in tables -%D in a similar way, but as said, we don't know the dimensions -%D in advance. It turns out however that we don't have to, -%D simply because alignments take care of stretching rules to -%D the appropritate dimensions. This means that we can provide -%D backgrounds by coloring rules with the height of a row, -%D skipping upwards and finally drawing the content, like in: -%D -%D \gdef\ShowExample -%D {\startfiguretext -%D {none} -%D {\getbuffer} -%D \typebuffer -%D \stopfiguretext} -%D -%D \startbuffer -%D \starttable[|c|c|] -%D \HL -%D \BL[2] \SR -%D \VL test \VL test \VL\SR -%D \HL -%D \VL test \VL test \VL\FR -%D \VL test \VL test \VL\MR -%D \VL test \VL test \VL\LR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \ShowExample -%D -%D Just to be complete we show how the other columns can be -%D given a background. Later we will provide more details over -%D the commands used. -%D -%D \startbuffer -%D \starttable[|c|c|c|] -%D \HL -%D \BL[3] \SR -%D \VL test \VL test \VL test \VL\SR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \ShowExample -%D -%D \startbuffer -%D \starttable[|c|c|c|] -%D \HL -%D \BC \BL[2] \SR -%D \VL test \VL test \VL test \VL\SR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \ShowExample -%D -%D \startbuffer -%D \starttable[|c|c|c|] -%D \HL -%D \BC \BC \BL \SR -%D \VL test \VL test \VL test \VL\SR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \ShowExample -%D -%D \startbuffer -%D \starttable[|c|c|c|] -%D \HL -%D \BC \BL \SR -%D \VL test \VL test \VL test \VL\SR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \ShowExample -%D -%D \startbuffer -%D \starttable[|c|c|c|] -%D \BL \BL \SR -%D \HL -%D \VL test \VL test \VL test \VL\SR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \ShowExample - -%D In these examples we can clearly see that for being a real -%D background, the color or gray specification has to precede -%D the content. Just to keep things simple, we can recall this -%D specification later on: -%D -%D \startbuffer -%D \starttable[|c|c|c|] -%D \BC \BL \SR -%D \HL -%D \VL test \VL test \VL test \VL\SR -%D \HL -%D \BR\FR -%D \VL test \VL test \VL test \VL\FR -%D \BR\MR -%D \VL test \VL test \VL test \VL\MR -%D \BR\LR -%D \VL test \VL test \VL test \VL\LR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \ShowExample -%D -%D Close study learns that we can put the specification -%D before or after the \type{\HL}, whatever suits best. Keeping -%D track of these specifications is taken care of by the next -%D variables: - -\newif \ifTABLEgrayline % executing gray line -\newif \ifTABLEgraydone % gray line executed -\newtoks \TABLEgraytoks % gray line specification - -\newif\ifTABLEinbreak - -%D Nog vervangen: - -\def\c!Table{Table} -\def\m!TABLE{TABLE} - -%D We already saw that the table macros report errors and -%D provide automatic spacing. These features can only be -%D implemented by keeping track of the state, often the last -%D command on a row. - -\chardef\TABLEunknown = 0 - -\chardef\TABLEseparaterow = 1 -\chardef\TABLEfirstrow = 2 -\chardef\TABLEmidrow = 3 -\chardef\TABLElastrow = 4 -\chardef\TABLErule = 5 -\chardef\TABLEskip = 6 -\chardef\TABLEautorow = 7 - -\chardef\TABLEforcefirstrow = 1 -\chardef\TABLEforcelastrow = 2 - -\chardef\TABLEmissingrow = 1 -\chardef\TABLEmissingcolumn = 2 -\chardef\TABLEspanoverflow = 3 -\chardef\TABLEdivisionoverflow = 4 - -%D We store these states using efficient \type {\chardef}'s. -%D Like most variables, these are global ones. When needed, -%D especially when we flush the backgrounds, we can temporary -%D disable the assignment. - -\newif\ifsetTABLEaction - -\def\setTABLEaction#1% - {\ifsetTABLEaction\global\chardef\TABLEaction#1\fi} - -\def\setTABLEforce#1% - {\ifsetTABLEaction\global\chardef\TABLEforce#1\fi} - -\def\setTABLEerror#1% - {\global\chardef\TABLEerror#1} - -%D Before we come to using these variables, we redefine and/or -%D adapt some \TABLE\ macros. Within \TABLE's the \type{|} and -%D \type{"} have special meanings in templates and are active -%D during. Their meaning can therefore conflict with those -%D elsewhere defined. To be compatible with traditional \TABLE\ -%D as well as \CONTEXT's \type{||} and the active \type{"} -%D extensions for my german friends, we do some catcode magic. - -\newif\ifForgetTableBarAndQuote \ForgetTableBarAndQuotetrue - -% \bgroup - -% \catcode`\|=\@@active -% \catcode`\"=\@@active -% -% \gdef\pushouterbarandquote -% {\ifForgetTableBarAndQuote -% \ifnum\catcode`\|=\@@active \let\outertablebar |\else\let\outertablebar \relax\fi -% \ifnum\catcode`\"=\@@active \let\outertablequote"\else\let\outertablequote\relax\fi -% \let|\letterbar -% \let"\letterdoublequote -% \fi} -% -% \gdef\popouterbarandquote -% {\ifForgetTableBarAndQuote -% \ifx\outertablebar \relax\else\let|\outertablebar \fi -% \ifx\outertablequote\relax\else\let"\outertablequote\fi -% \else -% \redefinetablebarandquote -% \fi} -% -% \egroup -% -% \def\ObeyTableBarAndQuote -% {\ForgetTableBarAndQuotefalse -% \ifintable -% \redefinetablebarandquote -% \fi} - -\let\ActivateBarAndQuote \relax -\let\ObeyTableBarAndQuote\relax -\let\pushouterbarandquote\relax -\let\popouterbarandquote \relax - -%D \macros -%D {ObeyTableBarAndQuote} -%D -%D As said, the \type{|} and \type{"} active characters are -%D often used for other purposes. By default, the outside -%D meanings are therefore preserved and available inside -%D tables. If for some reason one wants to use the \TABLE\ -%D primitives, one can say: -%D -%D \starttyping -%D \ObeyTableBarAndQuote -%D \stoptyping -%D -%D To keep things verbose, as well as to show what \TABLE\ -%D commands we affect, we show some meanings. - -\def\normalTABLEshortrule {\!ttShortHrule} % \- -\def\normalTABLElongrule {\!ttLongHrule} % \= -\def\normalTABLEfullrule {\!ttFullHrule} % \_ -\def\normalTABLEendofrow {\!ttEndOfRow} % \\ -\def\normalTABLEsimplebar {\unskip\!ttRightGlue&&} % | -\def\normalTABLEcomplexbar {\unskip\!ttRightGlue&\omit\!ttAlternateVrule} % \| -\def\normalTABLEquote {\unskip\!ttRightGlue&\omit&} % " -\def\normalTABLElineformat {\normalTABLEendofrow+} -\def\normalTABLElineending {\normalTABLEendofrow0 } -\def\normalTABLEsinglerule {&\normalTABLElongrule&} -\def\normalTABLEmultirule#1{&\use{#1}\normalTABLElongrule&} - -%D The next hack is dedicated to Tobias, who found out that -%D paragraph entries don't break well. - -\def\TABLEhack{\hskip\zeropoint} - -%D The first attemp to solve this problem was: -%D -%D \starttyping -%D \def\normalTABLEquote% -%D {\unskip\TABLEhack\!ttRightGlue&\omit&\TABLEhack} -%D \stoptyping -%D -%D But, as usual, this interfered with \type {\omit}. -%D -%D The next attempt is redefining some core \TABLE\ macro:. -%D This works ok, but breaks for instance the~\type{b} -%D key handling. -%D -%D \starttyping -%D \def\!tfAdjoinPriorColumn% -%D {\ifnum\!taColumnNumber=0 -%D \!taPreamble=\!taRuleColumnTemplate -%D ... -%D \if!taOnceOnlyTabskip -%D \!thToksEdef\!taDataColumnTemplate= -%D {\TABLEhack####\TABLEhack\tabskip\the\!taLastRegularTabskip} -%D \else -%D \!taDataColumnTemplate{\TABLEhack##\TABLEhack}% -%D \fi -%D ... -%D \ReadFormatKeys} -%D \stoptyping - -% \newdimen\TABLEparheight - -\def\BeginTableParBox#1% - {\setbox\scratchbox\vtop\bgroup % \setbox added - \hsize#1\relax - \dontcomplain - \restoretablelineskips - \normalbaselines - \let~\!ttTie - \let\-\!ttDH - \blank[\v!disable]% % added - \the\EveryTableParBox} - -\def\EndTableParBox - {\removelastskip % itemize or so - \endgraf - \ifnum\prevgraf>\zerocount % we want at least - \verticalstrut \nowhitespace \vskip-\struttotal % one line of text - \egroup - \ifdim\dp\scratchbox>\lineheight % see (*) for an - \getnoflines{\dp\scratchbox}% % example of where - \dp\scratchbox\zeropoint % saving can go - \setbox\scratchbox % terrible wrong - \vtop to \noflines\lineheight{\box\scratchbox}% - \fi % esp between rows - \else % of paragraphs - \egroup - \fi -% \getboxheight\scratchdimen\of\box\scratchbox\relax% compensate for -% \ifdim\scratchdimen>\TABLEparheight % funny depth of -% \global\TABLEparheight\scratchdimen % multi-line box -% \fi % i.e. vtop - \box\scratchbox} - -% We also need to patch away the interfering math switch: - -% \mathpunctuationtrue - -% test, test -% \starttable[|c|] -% \NC1,,10\NC\AR -% \stoptable -% test, test - -\def\!ttBeginTableA[#1]{% - \if #1u% % "unboxed" table - \ifmmode - \def\!ttEndTable{% % user had better be in display math mode - \relax}% % and have only one table at the outer level - \else % user had better be in vertical mode - \bgroup - \def\!ttEndTable{% - \egroup}% - \fi - \else - %\hbox\bgroup $ - %\def\!ttEndTable{% - % \egroup % for the \vtop, \vbox, or \vcenter, yet to come - % $% for math mode - % \egroup}% for the \hbox - %\if #1t% - % \vtop - %\else - % \if #1b% - % \vbox - % \else - % \vcenter % math mode was essential for this - % \fi - %\fi - % - \hbox\bgroup - \def\!ttEndTable{\egroup\egroup}% - \if#1t% - \vtop - \else\if#1b% - \vbox - \else - \def\!ttEndTable{\egroup$\egroup}% - %$\vcenter - \scratchtoks\everymath\everymath\emptytoks$\everymath\scratchtoks\vcenter - \fi\fi - % - \bgroup % for the \vtop, \vbox, or \vcenter - \fi - \advance\!taRecursionLevel 1 % RecursionLevel governs initialization - \let\!ttRightGlue=\relax % This may be changed by \JustCenter, etc - \everycr\emptytoks % ={} - \ifnum \!taRecursionLevel=1 - \!ttInitializeTable - \fi} - -%D The next redefinition is more robust than the original: - -\def\SetTableToWidth#1% - {\doifelsenothing{#1}{\!taTableSpread\emptytoks}{\!taTableSpread{to #1}}} - -% (*) Try this one with \type {direction} and {girection}; -% the \PPCHTEX\ manual is a nice testcase. -% -% \startoverlay -% {\starttable[ | l w(2cm) | w(8cm) | ] -% \HL -% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR -% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \MR -% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \LR -% \HL -% \stoptable} -% {\starttable[ | l w(2cm) | p(8cm) | ] -% \HL -% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR -% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \MR -% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \LR -% \HL -% \stoptable} -% \stopoverlay -% \vskip2cm -% \starttable[ | l w(2cm) | p(8cm) | ] -% \HL -% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR -% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \LR -% \HL -% \stoptable -% \vskip2cm -% \starttable[ | l w(2cm) | p(8cm) | ] -% \HL -% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \FR -% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \LR -% \HL -% \stoptable - -%D To give an impression of what the (well documented) source -%D of \TABLE\ looks like, we first implement an alternative for -%D the numeric keys. The quantity keys (\type{q} and \type{Q}) -%D support the more european way of writing numbers: -%D -%D \startnarrower -%D 100.000.000,00 instead of 100,000,000.00 -%D \stopnarrower -%D -%D The next table shows how to use these keys. We use braces -%D instead of brackets because we need brackets to specify the -%D format. -%D -%D \startbuffer -%D \starttable{|q[00,000]|Q[00,00]|} -%D \HL -%D \VL -1,2 \VL 12,35 \VL\FR -%D \VL 11,203 \VL 2,4 \VL\LR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \ShowExample -%D -%D Although a more efficient implementation is possible |<|we -%D can for instance share common macros|>| we just adapt a copy -%D of the numeric ones. To permit double loading of this -%D module, we check for the existence of one of the macros. - -\letvalue{!tk<\string q>}=\undefined -\letvalue{!tk<\string Q>}=\undefined - -%D We just copy the original {\em comments}. -%D -%D \em Key \type{q}: quantity item, non||math mode. - -\NewFormatKey q% - {\letempty\!tqStyle - \futurelet\!tnext\!tqTestForBracket} - -%D \em Key \type{Q}: quantity item, math mode. - -\NewFormatKey Q% - {\def\!tqStyle{$}% - \futurelet\!tnext\!tqTestForBracket} - -%D \em Note: the space between a quantity entry and the -%D following \type{|}, \type{"}, or \type{\|} is mandatory. -%D empty quantity entries are not allowed: use \type{{}} or -%D \type{\omit} instead. -%D -%D \em Test for bracket: invoked by the keys \type{q} and -%D \type{Q}. - -\def\!tqTestForBracket - {\ifx[\!tnext - \!thx\!tqGetArgument - \else - \!thx\!tqGetCode - \fi} - -%D \em Get code: e.g. \type{4}, or \type{4,0}, \type{0,4}, or -%D \type{10,2}. - -\def\!tqGetCode#1 % note the blank - {\!tqConvertCode #1,,!} - -%D \em Convert code: e.g. converts above to \type{[0000]}, -%D \type{[0000,]}, \type{[,0000]}, \type{[0000000000,00]}. - -\def\!tqConvertCode #1,#2,#3!% - {\begingroup - \aftergroup\edef - \aftergroup\!ttemp - \aftergroup{% - \aftergroup[% - \!taCountA #1 - \!thLoop - \ifnum \!taCountA>\zerocount - \advance\!taCountA \minusone - \aftergroup0 - \repeat - \def\!ttemp{#3}% - \ifx\!ttemp\empty - \else - \aftergroup, - \!taCountA #2 - \!thLoop - \ifnum\!taCountA>\zerocount - \advance\!taCountA \minusone - \aftergroup0 - \repeat - \fi - \aftergroup]\aftergroup}% - \endgroup\relax - \!thx\!tqGetArgument\!ttemp} - -%D \em Get argument: -%D -%D \starttyping -%D -%D \stoptyping - -\def\!tqGetArgument[#1]% - {\!tqMakeQuantityTemplate\!tqStyle#1,,!} - -%D \em Make quantity template. - -\def\!tqMakeQuantityTemplate#1#2,#3,#4!% #1= or $ - {\def\!ttemp{#4}% - \ifx\!ttemp\empty - \!taDimenC\zeropoint - \else - \setbox0\hbox{\mathsurround\zeropoint #1,#3#1}% - \!taDimenC\wd0 - \fi - \setbox0\hbox{\mathsurround\zeropoint #1#2#1}% - \!thToksEdef\!taDataColumnTemplate - ={\noexpand\!tqSetQuantityItem{\the\wd0 }{\the\!taDimenC}{#1}% - \the\!taDataColumnTemplate}% - \ReadFormatKeys} - -%D \em Set numeric item. - -\def\!tqSetQuantityItem #1#2#3#4 % - {\!tqSetQuantityItemA{#1}{#2}{#3}#4,,!} - -\def\!tqSetQuantityItemA #1#2#3#4,#5,#6!% - {\def\!ttemp{#6}% - \hbox to #1{\hss\mathsurround\zeropoint#3#4#3}% - \hbox to #2{\ifx\!ttemp\empty\else\mathsurround\zeropoint#3,#5#3\fi\hss}} - -%D Here ends the Q||extension. Did you watch the clever use -%D of aftergroup in \type{\!tqConvertCode}. - -% %D We also (have to) define a key for \type{\cap}: -% -% \letvalue{!tk<\string K>}=\undefined -% -% \NewFormatKey K% -% {\ReadFormatKeys b\smallcapped} - -%D A few pages back we saw backgrounds, further on we will see -%D colored rules, and here we provide a means to color the -%D entries in a column. (We can of course always use the normal -%D color commands for individual entries.) We could not use the -%D lowercase~\type{c}, because that one is used to force {\em -%D centering}. -%D -%D \startbuffer -%D \starttable[|C{red}|C{green}|C{blue}|] -%D \VL R(ed) \VL G(reen) \VL B(lue) \VL\SR -%D \stoptable -%D \stopbuffer -%D -%D \ShowExample - -\letvalue{!tk<\string C>}=\undefined - -\NewFormatKey C#1% - {\ReadFormatKeys b{\localstartcolor[#1]} a{\localstopcolor}} - -%D So now we have three new keys: -%D -%D \starttable[|||] -%D \HL -%D \NC \bf key \NC \bf meaning \NC\AR -%D \HL -%D \NC Q[x,y] \NC math mode formatted numbers \NC\AR -%D \NC q[x,y] \NC text mode formatted numbers \NC\AR -%D \NC C{identifier} \NC column entry color \NC\AR -%D \HL -%D \stoptable - -%D To be compatible with the tabulate environment, we also -%D support the \type {l}, \type {c} and \type {r} keys for -%D paragraph entries. - -\letvalue{!tk<\string l>}=\undefined -\letvalue{!tk<\string c>}=\undefined -\letvalue{!tk<\string r>}=\undefined -\letvalue{!tk<\string x>}=\undefined % not that needed - -\NewFormatKey c% - {\prependtoks\raggedcenter\to\!taDataColumnTemplate - \ReadFormatKeys \LeftGlue\hfil \RightGlue\hfil} - -\NewFormatKey l% - {\prependtoks\raggedright\to\!taDataColumnTemplate - \ReadFormatKeys \LeftGlue\empty \RightGlue\hfil} - -\NewFormatKey r% - {\prependtoks\raggedleft\to\!taDataColumnTemplate - \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty} - -\NewFormatKey x% - {\prependtoks\notragged\to\!taDataColumnTemplate - \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty} - -\appendtoks \TABLEparalignment \to \EveryTableParBox - -\def\!tfReFormat#1% - {\the \!taLeftGlue - \vbox{\forgetall\ialign{\span\the\!taDataColumnTemplate\cr#1\cr}}% - \the \!taRightGlue - \kern\zeropoint} % prevents \unskip / really needed - -%D Later on, we're going to implement multiple page table -%D support, therefore the next \TABLE\ macro needs to be -%D slightly adapted, i.c. the penalty is removed. We also -%D add basic color support. - -\def\!ttFullHruleA - {\!ttGetHalfRuleThickness - \startglobalTABLEcolor % added - \hrule\!thHeight\dimen0\!thDepth\dimen0 - \stopglobalTABLEcolor % added - %\penalty0 % removed - \egroup} - -%D We'll see that when we want to give a vertical rule a color, -%D we have to set and reset states. After heavy testing it -%D proved most useful to extend a \TABLE\ primitive with some -%D hooks. One thing to keep in mind is that \type{&} keeps -%D assignments local. Again, we add basic color support. - -\let\TABLEbeforebar\empty -\let\TABLEafterbar \empty - -\def\@VLn{1} -\def\@VLd{.125em} - -\def\do!ttInsertVrule % will be merged in 2005 - {\vrule \!thWidth - \ifnum\!tgCode=\plusone - \ifx\!tgValue\empty - \LineThicknessFactor - \else - \!tgValue - \fi - \LineThicknessUnit - \else - \!tgValue - \fi - \hskip\@VLd} - -\def\!ttInsertVrule - {\hfil - \TABLEbeforebar % added - \startglobalTABLEcolor % added - % we could do without this speedup, some day merge 'm - \ifcase\@VLn\or - \do!ttInsertVrule - \unskip - \else - \dorecurse\@VLn\do!ttInsertVrule - \gdef\@VLn{1}% - \unskip - \fi - \stopglobalTABLEcolor % added - \TABLEafterbar % added - \hfil - &} - -%D The next two macros are only adapted to basis rule -%D color support. - -\def\!tfSetVrule - {\!thToksEdef\!taRuleColumnTemplate= - {\noexpand\hfil - \noexpand\startglobalTABLEcolor % added - \noexpand\vrule - \noexpand\!thWidth - \ifnum\!tgCode=\plusone - \ifx\!tgValue\empty - \the\LineThicknessFactor - \else - \!tgValue - \fi - \!taLTU - \else - \!tgValue - \fi - ####% - \noexpand\hfil - \noexpand\stopglobalTABLEcolor % added - \the\!taRuleColumnTemplate}% - \!tfAdjoinPriorColumn} - -\def\!ttShortHruleA - {\!ttGetHalfRuleThickness - \startglobalTABLEcolor % added - \leaders\hrule\!thHeight\dimen0\!thDepth\dimen0\hfill - \stopglobalTABLEcolor % added - \null - \ignorespaces} - -%D We already showed the next one, but here we slightly adapt -%D the macro by adding an \type{\expandafter}. The space after -%D \type{#1} is crucial! - -\def\normalTABLEcomplexbar#1% - {\unskip\!ttRightGlue&\omit\expandafter\!ttAlternateVrule#1 } - -%D To get rid of interfering \type{\omit}'s when we are -%D checking the number of columns and reporting problems. The -%D extensions concern the second level check, the first -%D subbranch and advancing the column. - -\ifx\mscount\undefined \newcount\mscount \fi - -\def\!ttuse#1% - {\ifnum#1>\plusone - \omit - \global\TABLEdivisionfalse - \scratchcounter\currentTABLEcolumn % added - \advance\scratchcounter #1% % added - \advance\scratchcounter \minusone % added - \ifnum\scratchcounter>\maxTABLEcolumn % added - \def\next % added - {\setTABLEerror\TABLEspanoverflow % added - \handleTABLEerror}% % added - \else % added - \def\next % added - {\global\advance\currentTABLEcolumn #1% % added - \global\advance\currentTABLEcolumn \minusone % added - \mscount#1% \mscount is in Plain - \advance\mscount \minusone - \advance\mscount \mscount - \!thLoop - \ifnum\mscount>\plusone - \spanomit \advance\mscount\minusone - \repeat - \span}% - \fi % added - \else % added - \def\next % conflicts with possible next \omit % added - {\global\advance\currentTABLEcolumn \plusone}% % added - \fi - \next} % added - -% \starttable[|c|c|c|c|] -% \HL -% \VL {test} \VL \TWO{} \VL test \VL\FR -% \DL \DC \DL\DR -% \VL {test} \VL \TWO{} \VL test \VL\LR -% \HL -% \stoptable - -%D All commands that are executed between rows are to be put in -%D \type {\noalign}. We can however not verify if we (that is -%D \TABLE) does or did not enter this mode. A moderate dirty -%D but useful trick is using our own alternative:\footnote{Once -%D one has entered the stage of redefining \TEX\ primitives, -%D such hacks become a second nature. However, redefining \type -%D {\omit} and \type{\span} is not that easy.} - -\def\TABLEnoalign - {\noalign\bgroup\let\noalign\relax\let\next=} - -%D \macros -%D {starttable} -%D -%D The rest of this module is not easy to comprehend, mainly -%D because we have to take care of: -%D -%D \startitemize[packed] -%D \item \type{\startitemize[template]} -%D \item \type{\startitemize{template}} -%D \item \type{\startitemize[predefined]} -%D \stopitemize -%D -%D as well as: -%D -%D \startitemize[continue] -%D \item restart after table break -%D \stopitemize -%D -%D The official specification of the start command is: -%D -%D \showsetup{starttable} - -\newconditional\tablerepeathead -\newconditional\tablerepeattail - -\def\starttable - {\bgroup - \doif\@@tisplit\v!auto - {\ifinsidesplitfloat\let\@@tisplit\v!yes\fi}% - \doifinsetelse\@@tisplit{\v!yes,\v!repeat} - {\def\stoptable{\stoptables\egroup}% - \starttables} - {\doifelsenothing\@@tiframe - {\ifinsidefloat\else\startbaselinecorrection\fi} - {\startframedcontent[\@@tiframe]}% - \postponenotes - \firststagestartTABLE}} - -\def\stoptable - {\chuckTABLEautorow % before the tail, else noalign problem - \insertTABLEtail - \TABLEnoalign{\globalletempty\@@TABLEhead}% - \TABLEnoalign{\globalletempty\@@TABLEtail}% - \finishTABLE - \doifelsenothing\@@tiframe - {\ifinsidefloat\else - \stopbaselinecorrection - \goodbreak % compensates all the nobreaks - \fi} - \stopframedcontent - \egroup} - -%D Before we can grab the argument, we have to make sure that -%D the \CATCODES\ are set. The first stage takes care of that. - -\def\firststagestartTABLE - {\bgroup % kan-ie weg? - \global\intabletrue - \pushouterbarandquote - %catcode`\|=\@@other - \complexorsimple\secondstagestartTABLE} - -\def\simplesecondstagestartTABLE#1% - {\complexsecondstagestartTABLE[{#1}]} - -%D \macros -%D {definetabletemplate} -%D -%D The complex (and main) start macro first takes care of the -%D predefined case. Such a predefined setup looks like: -%D -%D \starttyping -%D \definetabletemplate[test][|||] -%D -%D \starttable[test] -%D \VL test \VL test \VL\AR -%D \VL test \VL test \VL\AR -%D \VL test \VL test \VL\AR -%D \stoptable -%D \stoptyping -%D -%D The implementation of the definition macro is not that -%D complicated: - -\def\definetabletemplate % to be redone - {\bgroup - \catcode`\|=\@@other - \doquadrupleempty\dodefinetabletemplate} - -\def\dodefinetabletemplate[#1][#2][#3][#4]% - {\ifsecondargument - \setgvalue{\c!Table#1}{\douseTABLEtemplate{#2}{#3}{#4}}% - \fi - \egroup} - -\def\douseTABLEtemplate#1#2#3% - {\gdef\TABLEhead{\getvalue{@@TABLEhead#2}}% - \gdef\TABLEtail{\getvalue{@@TABLEtail#3}}% - \complexsecondstagestartTABLE[#1]} - -%D The optional third and fourth arguments define which table -%D head and tail to use. -%D -%D \starttyping -%D \definetabletemplate[test][|||][before][after] -%D \stoptyping -%D -%D This also means that one can define table heads and tails -%D by name! -%D -%D \starttyping -%D \starttablehead[before] -%D \HL \VL first \VL second \VL \SR \HL -%D \stoptablehead -%D \stoptyping -%D -%D Templates defined this way get protected names, that cannot -%D conflict with existing commands. -%D -%D \showsetup{definetabletemplate} -%D -%D The second half of the next macro prepares table -%D splitting. - -\def\insertTABLEhead - {\TABLEnoalign{\global\settrue \preventTABLEbreak \global\setfalse\someTABLEhead}% - \TABLEhead - \TABLEnoalign{\global\setfalse\preventTABLEbreak}} - -\def\insertTABLEtail - {\TABLEnoalign{\global\settrue \preventTABLEbreak \global\setfalse\someTABLEtail}% - \TABLEtail - \TABLEnoalign{\global\setfalse\preventTABLEbreak}} - -% \def\dorestartTABLE#1% -% {\gdef\restartTABLE{#1}% -% \restartTABLE -% \insertTABLEhead -% \ifsplittables \ifconditional \tablerepeattail -% \TABLEnoalign{\goodbreak}% -% \insertTABLEtail -% \TABLEnoalign{\goodbreak}% -% \fi \fi} - -\def\verysimpleTableHL - {\TABLEnoalign{\expandafter\normalTABLEfullrule\@@tiHLheight}} - -\def\dorestartTABLE#1% - {\gdef\restartTABLE{#1}% - \restartTABLE - \TABLEnoalign{\globalpushmacro\simpleTableHL\global\let\simpleTableHL\verysimpleTableHL}% - \insertTABLEhead - \ifsplittables \ifconditional \tablerepeattail - \TABLEnoalign{\goodbreak}% - \insertTABLEtail - \TABLEnoalign{\goodbreak}% - \fi \fi - \TABLEnoalign{\globalpopmacro\simpleTableHL}} - -\bgroup \catcode`|=\@@other \catcode`"=\@@other - -\gdef\complexsecondstagestartTABLE#1[#2]% brr nested mess - {\bgroup - \@@useotherbar - \@@useotherquote - \global\setfalse\someTABLEhead - \global\setfalse\someTABLEtail - \expanded{\doifinstringelse{|}{#2}} - {\xdef\restartTABLE{\noexpand\dorestartTABLE{\noexpand\thirdstagestartTABLE{#2}}}} - {\doifdefinedelse{\c!Table#2} - {\gdef\restartTABLE{\getvalue{\c!Table#2}}} - {\gdef\restartTABLE{\dorestartTABLE{\getvalue{#2}}}}}% - \egroup - \restartTABLE} - -\egroup - -%D The third stage involves a lot of (re)sets, which we will -%D explain later. - -%D The next definition is convenient and more in tune with -%D \CONTEXT. - -\let \everytable \EveryTable - -%D We immediately use this register: - -\appendtoks - \fixedspaces - \let\_\normalunderscore -\to \everytable - -%D Now we can start the table. - -\def\thirdstagestartTABLE#1% - {\global\setTABLEactiontrue - \setTABLEaction\TABLEunknown - \setTABLEforce\TABLEunknown - \setTABLEerror\TABLEunknown - \global\TABLEgraylinefalse - \global\TABLEgraydonefalse - \globalletempty\TABLEgrayline - \globalletempty\nextTABLEgrayline - \globalletempty\TABLEgraylineerror - \globalletempty\TABLEgraylinestatus - \resetVLvalues - \appendtoks\popouterbarandquote\to\EveryTable - \appendtoks\localTABLEsetup\to\EveryTable - \BeginTable[\ifsplittables u\else b\fi]% - \defineTABLEunits - \defineTABLEsteps - \defineTABLErules - \defineTABLEdivisions - \defineTABLEshorthands - \defineTABLEbackgrounds - \defineTABLEendings - \forgetall % added - \doifsomething{#1} - {\def\TABLEformat{#1}% - \getTABLEnofcolumns\TABLEformat - % more modern is to use catcode tables - \expandafter\BeginFormat\TABLEformat\EndFormat}} - -\def\finishTABLE - {\chuckTABLEautorow - \unskip\crcr - \EndTable - \global\intablefalse - \egroup} - -%D \macros -%D {starttables} -%D -%D Split tables are specified using the plural form of the -%D start and stop commands. -%D -%D \showsetup{starttables} -%D -%D For example: -%D -%D \starttyping -%D \starttables[|||] -%D \HL -%D \VL element \VL atom weight \VL\AR -%D \HL -%D \VL ....... \VL ........... \VL\AR -%D \VL ....... \VL ........... \VL\AR -%D \HL -%D \stoptables -%D \stoptyping - -\newbox\tablecontentbox - -\def\starttables - {\bgroup - \splittablestrue - \doifelse\@@tisplit\v!repeat - {\settrue \tablerepeathead\settrue \tablerepeattail} - {\setfalse\tablerepeathead\setfalse\tablerepeattail}% - \flushnotes - \setbox\tablecontentbox\vbox\bgroup - \forgetall - \global\TABLEinbreakfalse - \firststagestartTABLE} - -% \def\stoptables -% {\ifconditional\tablerepeattail\else\insertTABLEtail\fi -% \finishTABLE -% \egroup -% \dosplittablebox\tablecontentbox -% \flushnotes -% \egroup} - -\def\stoptables - {\chuckTABLEautorow % AM: before the tail, else noalign problem - \ifconditional\tablerepeattail\else\insertTABLEtail\fi - \finishTABLE - \egroup -\dontcomplain - \dosplittablebox\tablecontentbox - \flushnotes - \egroup} - -\newdimen\TABLEcaptionheight % obsolete - -\def\dosplittablebox#1% - {\resettsplit - \def\tsplitminimumfreelines{2}% - \def\tsplitminimumfreespace{\TABLEcaptionheight}% - \setbox\tsplitcontent\box#1% - \ifconditional\tablerepeathead \ifconditional\someTABLEhead - \setbox\tsplithead\vsplit\tsplitcontent to \lineheight - \setbox\tsplithead\vbox{\unvbox\tsplithead}% - \fi \fi - \ifconditional\tablerepeattail \ifconditional\someTABLEtail - \setbox\tsplittail\vsplit\tsplitcontent to \lineheight - \setbox\tsplittail\vbox{\unvbox\tsplittail}% - \fi \fi - \ifinsidefloat\else - \def\tsplitbeforeresult{\startbaselinecorrection}% - \def\tsplitafterresult {\stopbaselinecorrection}% - \fi - \handletsplit} - -%D When the table in the previous example is split across -%D pages, only the first gets a head. We could have said -%D something like: -%D -%D \starttyping -%D \starttablekop -%D \HL -%D \VL element \VL atom weight \VL\AR -%D \HL -%D \stoptablekop -%D -%D \starttablestaart -%D \HL -%D \stoptablestaart -%D -%D \starttables[|||] -%D \VL ....... \VL ........... \VL\AR -%D \VL ....... \VL ........... \VL\AR -%D \stoptables -%D \stoptyping -%D -%D This time each split table gets a head line and ends with -%D a rule. Keep in mind that such heads also apply to the -%D unbroken ones and should be defined local (grouped) if -%D needed. The rather complicated definition below is due to -%D the fact that the stopcondition is interface language -%D dependant. - -\let\@@TABLEhead\empty \def\TABLEhead{\@@TABLEhead} -\let\@@TABLEtail\empty \def\TABLEtail{\@@TABLEtail} - -\letvalue{\e!start\v!tablehead}=\undefined -\letvalue{\e!stop \v!tablehead}=\undefined -\letvalue{\e!start\v!tabletail}=\undefined -\letvalue{\e!stop \v!tabletail}=\undefined - -\expanded - {\def\csname\e!start\v!tablehead\endcsname##1\csname\e!stop\v!tablehead\endcsname% - {\noexpand\setTABLEhead##1\noexpand\end}} - -\expanded - {\def\csname\e!start\v!tabletail\endcsname##1\csname\e!stop\v!tabletail\endcsname% - {\noexpand\setTABLEtail##1\noexpand\end}} - -%D The second argument is a dummy one, by scanning for it, we -%D get rid of interfering spaces. - -\def\setTABLEhead{\dodoubleempty\dosetTABLEhead} -\def\setTABLEtail{\dodoubleempty\dosetTABLEtail} - -\newconditional\preventTABLEbreak -\newconditional\someTABLEhead - -\def\dosetTABLEhead[#1][#2]#3\end{\setvalue{@@TABLEhead#1}{\TABLEnoalign{\global\settrue\someTABLEhead}#3}} -\def\dosetTABLEtail[#1][#2]#3\end{\setvalue{@@TABLEtail#1}{\TABLEnoalign{\global\settrue\someTABLEtail}#3}} - -%D Redudant \type{\HL}'s are removed automatically, so -%D mid||lines can be used without problems. - -%D We need an alternative for the normal complex or simple -%D commands, because assignments in these system commands -%D conflict with \type{\noalign}. This alternative is about -%D as efficient as possible. - -\def\complexorsimpleTable#1#2% - {\csname\if[\noexpand#2\s!complex\else\s!simple\fi\c!Table#1\endcsname#2} - -%D The next one is used in \type{\VL} cum suis and honours -%D the next grouping. - -\def\docomplexorsimpleTable#1#2% - {\ifx\next\bgroup\@EA#2\else\@EA\dodocomplexorsimpleTable\@EA#1\@EA#2\fi} - -\def\dodocomplexorsimpleTable#1#2#3% - {\if[\noexpand#3\@EA#1\else\@EA#2\fi#3} - -%D The order of the next macros is more or less random. First -%D we implement error recovery. Errors are reported to the -%D screen and log file as well as visualized in the table in -%D teletype. - -\def\handleTABLEerror - {\ifTABLEgrayline \else - \ifnum\TABLEerror=\TABLEunknown \else - \setTABLEaction\TABLEunknown - \globalletempty\checkTABLEautorow - \globalletempty\chuckTABLEautorow - \fi - \ifcase\TABLEerror - % no error - \or - % \TABLEmissingrow - \tttf [missing row]% - \writestatus\m!TABLE{missing row}% - \SR - \or - % \TABLEmissingcolumn - \fillTABLEcolumns - \tttf [missing column]% - \writestatus\m!TABLE{missing column}% - \SR - \or - % \TABLEspanoverflow - \fillTABLEcolumns - \tttf [columnspan too large]% - \writestatus\m!TABLE{columnspan too large}% - \SR - \or - % \TABLEdivisionoverflow - \fillTABLEcolumns - \tttf [division line too long]% - \writestatus\m!TABLE{division line too long}% - \SR - \fi - \fi - \ifnum\TABLEerror=\TABLEunknown \else - \finishTABLErow - \fi} - -\def\finishTABLErow - {\crcr - \TABLEnoalign - {\nobreak - \setTABLEaction\TABLEunknown - \setTABLEerror\TABLEunknown - \globalletempty\checkTABLEautorow - \globalletempty\chuckTABLEautorow - \global\currentTABLEcolumn\zerocount}} - -\def\fillTABLEcolumns - {\ifnum\currentTABLEcolumn>\maxTABLEcolumn \else - \global\advance\currentTABLEcolumn \plusone - \normalTABLEquote - \expandafter\fillTABLEcolumns - \fi} - -%D Next we enter the more complicated area of column and row -%D switching. I won't go into much detail from now on, but just -%D mention the general principles. -%D -%D \startitemize[3*ruim] -%D \sym{\type{\SR}} end a separate row (between rules) -%D \sym{\type{\FR}} end a first row (after a rule) -%D \sym{\type{\MR}} end a mid row (between text lines) -%D \sym{\type{\LR}} end a last row (before a rule) -%D \stopitemize -%D -%D and best of all: -%D -%D \startitemize[continue] -%D \sym{\type{\AR}} end a row with automatic spacing -%D \stopitemize -%D -%D As far as possible, we report confusing situations. In -%D most cases one can use \type{\AR}, which transfigurates -%D itself into one of the other types. -%D -%D \starttyping -%D \starttable[||] -%D \HL -%D \VL a separate row \VL\SR -%D \HL -%D \VL a first row \VL\FR -%D \VL a mid row \VL\MR -%D \VL a last row \VL\LR -%D \HL -%D \stoptable -%D \stoptyping -%D -%D In this example we could have used \type{\AR} without -%D problems. -%D -%D Color or gray scale backgrounds precede the content. They -%D are passed over horizontal (division) lines when needed. -%D Errors in the color template are traced elsewhere. Here we -%D only check for inconsistent spacing. Due to the way \TEX\ -%D handles alignments, we cannot automate spacing for colored -%D rows and columns. - -\chardef\TABLErowzero=0 - -\def\checkTABLErow#1% pure for message purposes - {\unskip % added - \ifTABLEgraydone - \defconvertedargument\asciia{#1}% - \defconvertedcommand \asciib\TABLEendBCL - \ifx\asciia\asciib \else - \writestatus\m!TABLE{confusing \asciia\space and \asciib}% - \gdef\TABLEgraylineerror% - {\globalletempty\TABLEgraylineerror - [\asciia\unskip<->\asciib\unskip]}% - \fi - \global\TABLEgraydonefalse - \fi} - -\def\defineTABLEendings - {\let\SR\TableSR - \let\FR\TableFR - \let\MR\TableMR - \let\LR\TableLR - \let\AR\TableAR} - -\def\TableSR - {\ifTABLEgrayline \else - \ifnum\TABLEaction=\TABLEfirstrow - \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}% - \else\ifnum\TABLEaction=\TABLEmidrow - \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}% - \else\ifnum\TABLEaction=\TABLEmidrow - \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}% - \fi\fi\fi - \fi - \checkTABLErow\SR - \endTABLErow\TABLEseparaterow\TABLErowfactor\TABLErowfactor} - -\def\TableFR - {\ifTABLEgrayline \else - \ifnum\TABLEaction=\TABLEmidrow - \writestatus\m!TABLE{change \string\FR\space into \string\MR/\string\LR}% - \else\ifnum\TABLEaction=\TABLElastrow - \writestatus\m!TABLE{change \string\FR\space into \string\MR/\string\LR}% - \fi\fi - \fi - \checkTABLErow\FR - \endTABLErow\TABLEfirstrow\TABLErowfactor\TABLErowzero} - -\def\TableMR - {\ifTABLEgrayline \else - \ifnum\TABLEaction=\TABLErule - \writestatus\m!TABLE{change \string\MR\space into \string\FR/\string\SR}% - \else\ifnum\TABLEaction=\TABLElastrow - \writestatus\m!TABLE{change \string\MR\space into \string\FR}% - \fi\fi - \fi - \checkTABLErow\MR - \endTABLErow\TABLEmidrow00} - -\def\TableLR - {\ifTABLEgrayline \else - \ifnum\TABLEaction=\TABLErule - \writestatus\m!TABLE{change \string\LR\space into \string\FR/\string\SR}% - \fi - \fi - \checkTABLErow\LR - \endTABLErow\TABLElastrow\TABLErowzero\TABLErowfactor} - -%D \macros -%D {ifcheckTABLEcolums} -%D -%D -%D The next macros handle the actual row ending. This macro -%D also take care of space corrections due to table splitting -%D when \type{\MR} and collegues are used. When tracing is -%D enabled, the corrections as well as the values used to -%D determine the available space are shown (in color). By default -%D checking is off. - -\newif\ifcheckTABLEcolumns - -\let\beforeTABLEline\empty -\let\afterTABLEline \empty - -\def\doendTABLErow#1#2#3% - {\handleTABLEbreak#2#3% - \beforeTABLEline - \ifcase#1\relax - % unknown - \or - \endofTABLEline[blue][\SR->\SR]\TABLErowfactor\TABLErowfactor - \or - \endofTABLEline[red][\FR->\FR]\TABLErowfactor\TABLErowzero - \or - \ifnum\TABLEforce=\TABLEforcelastrow - \endofTABLEline[red][\MR->\LR]\TABLErowzero\TABLErowfactor - \else\ifnum\TABLEforce=\TABLEforcefirstrow - \endofTABLEline[red][\MR->\FR]\TABLErowfactor\TABLErowzero - \else - \endofTABLEline[green][\MR->\MR]\TABLErowzero\TABLErowzero - \fi\fi - \or - \endofTABLEline[red][\LR->\LR]\TABLErowzero\TABLErowfactor - \fi - \TABLEnoalign - {\setTABLEforce\TABLEunknown - \global\currentTABLEcolumn\zerocount}% - \afterTABLEline} - -\def\endTABLErow#1#2#3% - {\setTABLEaction#1% - \ifTABLEgrayline - \finishTABLErow - \else - \ifnum\currentTABLEcolumn>\maxTABLEcolumn - \doendTABLErow{#1}{#2}{#3}% - \else\ifcheckTABLEcolumns - \setTABLEerror\TABLEmissingcolumn - \handleTABLEerror - \else - \doendTABLErow{#1}{#2}{#3}% - \fi\fi - \fi} - -%D Handling \type{\AR} is postponed till the next row. The -%D check takes care of the first and mid rows, the chuck macro -%D |<|how about that name|>| handles the last row. - -\def\TableAR - {\ifTABLEgraydone - \globalletempty\checkTABLEautorow - \globalletempty\chuckTABLEautorow - \global\TABLEgraydonefalse - \TABLEendBCL - \else - \globallet\checkTABLEautorow\docheckTABLEautorow - \globallet\chuckTABLEautorow\dochuckTABLEautorow - \fi} - -\let\checkTABLEautorow\empty -\let\chuckTABLEautorow\empty - -\def\docheckTABLEautorow - {\globallet\checkTABLEautorow\empty - \ifnum\TABLEaction=\TABLErule \FR - \else\ifnum\TABLEaction=\TABLEunknown \FR - \else \MR - \fi\fi} - -\def\dochuckTABLEautorow - {\globalletempty\checkTABLEautorow - \globalletempty\chuckTABLEautorow - \ifnum\TABLEaction=\TABLErule \SR - \else\ifnum\TABLEaction=\TABLEunknown \SR - \else \LR - \fi\fi} - -%D When a table is split, we also add a tail and when present -%D we repeat the table head. - -\def\handleTABLEbreak#1#2% - {\globalletempty\beforeTABLEline - \gdef\afterTABLEline{\TABLEnoalign{\ifconditional\preventTABLEbreak\nobreak\else\goodbreak\fi}}} - -%D When tables are split, the spacing before and after a -%D horizontal rule is corrected according to what we expect. - -\def\endofTABLEline[#1][#2->#3]#4#5% - {\ifx#2#3\else - \writestatus\m!TABLE{\string#2\space changed into \string#3}% - \fi - \iftracetables - \bgroup - \tttf\space - \ifnum\TABLEerror=\TABLEunknown - \ifx#2#3\else\string#2->\fi - \else - ->% - \fi - \color[#1]{\string#3}% - \ifx\TABLEgraylineerror\empty - \space\TABLEgraylinestatus - \else - \space\TABLEgraylineerror - \fi - \egroup - \else\ifx\TABLEgraylineerror\empty \else - % \bgroup - % \tttf\space\TABLEgraylineerror - % \egroup - \fi\fi - \globalletempty\TABLEgraylinestatus - \globalletempty\TABLEgraylineerror - \expandafter\normalTABLElineformat#4#5\crcr % \crcr nodig ? - \TABLEnoalign{\nobreak\global\setTABLEactiontrue}} - -%D In order to prevent (as good as possible) alignment overflow -%D and therefore \TEX\ error messages, we check the maximum -%D number of columns. We keep track of the current column and -%D maximum column by means of two \COUNTERS. Keep in mind that -%D the number of \type{|}'s and \type{\VL}'s or alike is always -%D one more than the number of columns. - -\newcount\currentTABLEcolumn -\newcount\maxTABLEcolumn - -%D While defining this macro we change the \CATCODE\ of -%D \type{|}. When counting the bars, we use a non active -%D representation of the bar, simply because we cannot be sure -%D if the bar is active or not.\footnote{Normally it is, but -%D \TABLE\ changes the catcode when needed.} - -\bgroup - \catcode`\|=\@@other \gdef\@@otherbar {|} - \catcode`\"=\@@other \gdef\@@otherquote {"} - \catcode`\|=\@@active \gdef\@@useotherbar {\let|\@@otherbar} - \catcode`\"=\@@active \gdef\@@useotherquote{\let"\@@otherquote} -\egroup - -\bgroup \catcode`\|=\@@other - -\gdef\getTABLEnofcolumns#1% - {\bgroup - \cleanupfeatures % needed ! - \@@useotherbar - \@@useotherquote - \expanded{\defconvertedargument\noexpand\ascii{#1}}% - \@EA\doglobal\@EA\counttoken\@EA|\@EA\in\ascii\to\maxTABLEcolumn - \global\advance\maxTABLEcolumn \minusone - % in case of & counting, divide by 2 - \egroup} - -\egroup - -\def\!ttDoHalign - {\edef\restoretablelineskips - {\baselineskip \the\baselineskip - \lineskiplimit\the\lineskiplimit - \lineskip \the\lineskip - \tabskip \the\tabskip}% - \baselineskip \zeropoint - \lineskiplimit\zeropoint - \lineskip \zeropoint - \tabskip \zeropoint - % does not work in normal tex - % \expanded{\getTABLEnofcolumns{\the\!taPreamble}}% added - \halign \the\!taTableSpread \bgroup - \span\the\!taPreamble - \ifx \!tfRowOfWidths \empty \else \!tfRowOfWidths \cr \fi} - -%D \startitemize[3*ruim] -%D \sym{\type{\VL}} a vertical line -%D \sym{\type{\VC}} a vertical colored line -%D \sym{\type{\HL}} a horizontal line -%D \sym{\type{\HC}} a horizontal colored line -%D \stopitemize - -% \def\defineTABLErules -% {\let\VL\TableVL -% \let\VC\TableVC -% \let\HL\TableHL -% \let\HC\TableHC} - -\def\defineTABLErules - {\let\VL\TableVL - \let\VC\TableVC - \let\HL\TableHL - \let\HC\TableHC - \let\VS\TableVS - \let\VD\TableVD - \let\VT\TableVT - \let\VN\TableVN} - -\def\TableVL - {\checkTABLEautorow - \nextTABLEgrayline - \ifnum\currentTABLEcolumn>\maxTABLEcolumn - \setTABLEerror\TABLEmissingrow - \handleTABLEerror - \else - \global\advance\currentTABLEcolumn \plusone - \expandafter\doTableVL - \fi} - -\def\doTableVL - {\futurelet\next\dodoTableVL} - -\def\dodoTableVL - {\docomplexorsimpleTable\complexTableVL\simpleTableVL} - -\def\complexTableVL[#1]% - {\scratchcounter=0#1% - \multiply\scratchcounter \@@tiVLwidth - \setxvalue{wVL\the\currentTABLEcolumn}{\the\scratchcounter}% - \simpleTableVL} - -\def\simpleTableVL - {\doifundefined{wVL\the\currentTABLEcolumn}% - {\setgvalue{wVL\the\currentTABLEcolumn}{\@@tiVLwidth}}% - \gdef\TABLEbeforebar - {\getvalue{bVL\the\currentTABLEcolumn}% - \letgvalueempty{bVL\the\currentTABLEcolumn}}% - \gdef\TABLEafterbar - {\getvalue{eVL\the\currentTABLEcolumn}% - \letgvalueempty{eVL\the\currentTABLEcolumn}}% - \edef\@@tiVLwidth{\getvalue{wVL\the\currentTABLEcolumn}}% - \expanded{\normalTABLEcomplexbar\@@tiVLwidth\space}}% \relax breaks \use - -% \starttable[|||] -% \HL -% \VL test \VS test \VL \FR -% \VL test \VD test \VL \MR -% \VL test \VT test \VL \LR -% \HL -% \stoptable - -\def\TableVS {\VN1} -\def\TableVD {\VN2} -\def\TableVT {\VN3} -\def\TableVN#1{\gdef\@VLn{#1}\VL} - -\def\resetVLvalues - {\dostepwiserecurse\zerocount\maxTABLEcolumn\plusone - {\setgvalue{wVL\recurselevel}{\@@tiVLwidth}% - \letgvalueempty{bVL\recurselevel}% - \letgvalueempty{eVL\recurselevel}}% - \global\currentTABLEcolumn\zerocount} - -\def\TableVC - {\checkTABLEautorow - \nextTABLEgrayline - \ifnum\currentTABLEcolumn>\maxTABLEcolumn - \setTABLEerror\TABLEmissingrow - \handleTABLEerror - \else - \global\advance\currentTABLEcolumn \plusone - \expandafter\doTableVC - \fi} - -\def\doTableVC - {\futurelet\next\dodoTableVC} - -\def\dodoTableVC - {\docomplexorsimpleTable\complexTableVC\simpleTableVC} - -\def\complexTableVC[#1]% - {\global\setvalue{bVC\the\currentTABLEcolumn}{\localstartcolor[#1]}% - \global\setvalue{eVC\the\currentTABLEcolumn}{\localstopcolor}% - \simpleTableVC} - -\def\simpleTableVC - {\global\setvalue{bVL\the\currentTABLEcolumn}% - {\getvalue{bVC\the\currentTABLEcolumn}}% - \global\setvalue{eVL\the\currentTABLEcolumn}% - {\getvalue{eVC\the\currentTABLEcolumn}}% - \doTableVL} - -\def\TableHL - {\ifnum\currentTABLEcolumn>\maxTABLEcolumn - \chuckTABLEautorow - \else\ifnum\currentTABLEcolumn=\zerocount - %\chuckTABLEautorow - \TABLEnoalign - {\globalletempty\checkTABLEautorow - \globalletempty\chuckTABLEautorow}% - \else - \setTABLEerror\TABLEmissingcolumn - \handleTABLEerror - \fi\fi - \complexorsimpleTable{HL}} - -\def\complexTableHL[#1]% - {\TABLEnoalign - {\scratchcounter0#1% - \multiply\scratchcounter \@@tiHLheight - \edef\@@tiHLheight{\the\scratchcounter}% - \simpleTableHL}} - -\def\simpleTableHL - {\TABLEnoalign - {\nobreak - \ifnum\TABLEaction=\TABLErule - \writestatus\m!TABLE{skipping \string\HL}% \statusmessage - \else - \ifnum\TABLEaction=\TABLEmidrow - \writestatus\m!TABLE{change \string\MR\space into \string\LR/\string\SR}% - \else\ifnum\TABLEaction=\TABLEfirstrow - \writestatus\m!TABLE{change \string\MR\space into \string\SR}% - \fi\fi - \startHLcommand - \expandafter\normalTABLEfullrule\@@tiHLheight - \stopHLcommand - \globalletempty\startHLcommand - \globalletempty\stopHLcommand - \accountTABLElinewidth - \fi - \setTABLEaction\TABLErule - \nobreak}} - -\let\startHLcommand\empty -\let\stopHLcommand \empty - -\def\TableHC - {\complexorsimpleTable{HC}} - -\def\complexTableHC[#1]% - {\TABLEnoalign - {\gdef\startHCcommand{\localstartcolor[#1]}% - \gdef\stopHCcommand {\localstopcolor}}% - \simpleTableHC} - -\def\simpleTableHC - {\TABLEnoalign - {\globallet\startHLcommand\startHCcommand - \globallet\stopHLcommand \stopHCcommand}% - \HL} - -%D \startitemize[3*ruim] -%D \sym{\type{\NL}} a vertical skip -%D \sym{\type{\NR}} goto the next row -%D \sym{\type{\NC}} goto the next column -%D \sym{\type{\FC}} a first column -%D \sym{\type{\MC}} a mid column -%D \sym{\type{\LC}} a last column -%D \stopitemize - -% n+1 uitleggen - -\def\defineTABLEsteps - {\let\NL\TableNL - \let\NR\TableNR - \let\NC\TableNC - \let\FC\TableNC - \let\MC\TableNC - \let\LC\TableNC} - -\def\TableNL - {\complexorsimpleTable{NL}} - -\def\complexTableNL[#1]% - {\TABLEnoalign - {\edef\@@tiNL{#1}% - \simpleTableNL}}% - -\def\simpleTableNL - {\TABLEnoalign - {\nobreak - \setbox0\vbox{\blank[\@@tiNL]}% - \vskip\ht0 - \nobreak}} - -\def\TableNR - {\ifnum\currentTABLEcolumn>\maxTABLEcolumn - \global\currentTABLEcolumn\zerocount - \normalTABLElineending - \else - \setTABLEerror\TABLEmissingcolumn - \handleTABLEerror - \fi - \TABLEnoalign - {\nobreak - \setTABLEaction\TABLEunknown}} - -\def\TableNC - {\checkTABLEautorow - \nextTABLEgrayline - \ifnum\currentTABLEcolumn>\maxTABLEcolumn - \setTABLEerror\TABLEmissingrow - \handleTABLEerror - \else - \global\advance\currentTABLEcolumn \plusone - \normalTABLEquote - \fi} - -% \bgroup -% \catcode`\|=\@@active -% \catcode`\"=\@@active -% \gdef\redefinetablebarandquote -% {\def|{\VL}% % \normalTABLEsimplebar -% \def\|##1{\VL[##1]}% % \normalTABLEcomplexbar -% \def"{\NC}} % \normalTABLEquote -% \egroup - -\let\redefinetablebarandquote\relax - -%D \startitemize[3*ruim] -%D \sym{\type{\DL}} -%D \sym{\type{\DV}} (\type{\VD}) -%D \sym{\type{\DC}} -%D \sym{\type{\DR}} -%D \stopitemize - -\newif\ifTABLEdivision - -% \def\defineTABLEdivisions -% {\global\TABLEdivisionfalse % in start -% \let\DL\TableDL -% \let\DC\TableDC -% \let\DV\TableDV -% \let\VD\TableDV -% \let\DR\TableDR} - -\def\defineTABLEdivisions - {\global\TABLEdivisionfalse % in start - \let\DL\TableDL - \let\DC\TableDC - \let\DV\TableDV - \let\DR\TableDR} - -\def\checkTABLEdivision - {\ifTABLEdivision \else - \chuckTABLEautorow - \global\currentTABLEcolumn\zerocount - \global\TABLEdivisiontrue - \fi} - -\def\TableDL - {\checkTABLEdivision - \complexorsimpleTable{DL}} - -\def\simpleTableDL - {\complexTableDL[1]} - -\def\complexTableDL[#1]% - {\ifnum\TABLEaction=\TABLErule - \writestatus\m!TABLE{skipping \string\DL}% - \else - \ifnum\TABLEaction=\TABLEmidrow - \writestatus\m!TABLE{change \string\MR\space into \string\LR/\string\SR}% - \else\ifnum\TABLEaction=\TABLEfirstrow - \writestatus\m!TABLE{change \string\MR\space into \string\SR}% - \fi\fi - \setTABLEaction=\TABLEunknown - \ifnum\currentTABLEcolumn>\maxTABLEcolumn - \setTABLEerror\TABLEmissingrow - \handleTABLEerror - \fi - %\startHLcommand - \ifnum#1=\plusone - \global\advance\currentTABLEcolumn \plustwo - \let\next\normalTABLEsinglerule - \else - \ifnum#1<\maxTABLEcolumn - \global\advance\currentTABLEcolumn \plusone - \def\next{\normalTABLEmultirule{#1}}% - \else - \setTABLEerror\TABLEdivisionoverflow - \let\next\handleTABLEerror - \fi - \fi - \next - %\stopHLcommand - %\globalletempty\startHLcommand - %\globalletempty\stopHLcommand - \fi} - -\def\TableDV - {\TableDCV\normalTABLEsimplebar} - -\def\TableDC - {\TableDCV\normalTABLEquote} - -\def\TableDCV#1% - {\checkTABLEdivision - \checkTABLEautorow - \ifnum\currentTABLEcolumn>\maxTABLEcolumn - \setTABLEerror\TABLEmissingrow - \handleTABLEerror - \else - \global\advance\currentTABLEcolumn \plusone - #1% - \fi} - -\def\TableDR - {\ifnum\currentTABLEcolumn<\maxTABLEcolumn % silent recovery - %\setTABLEerror\TABLEmissingcolumn % some day warning - %\handleTABLEerror - \finishTABLErow - \else - \global\currentTABLEcolumn\zerocount % nog check - \normalTABLElineending - \fi - \TABLEnoalign - {\nobreak - \global\TABLEdivisionfalse - \accountTABLElinewidth % temporary solution - \setTABLEaction\TABLErule}} - -\def\accountTABLElinewidth - {\scratchdimen\LineThicknessUnit} - -%D \startitemize[3*ruim] -%D \sym{\type{\BC}} -%D \sym{\type{\BR}} -%D \sym{\type{\BACKGROUND}} -%D \sym{\type{\CL}} -%D \sym{\type{\RL}} -%D \sym{\type{\BL}} -%D \sym{\type{\RASTER}} -%D \sym{\type{\COLOR}} -%D \stopitemize - -% definieer: \BC \BL -% herhaal: \BR -% definieer: \CL \RL (eerste \CL[green] = hele row! / \CL[1,green]) -% dus: \CL en \RL mix tussen \HL en \BL - -\def\defineTABLEbackgrounds - {\let\BC \TableBC - \let\BL \TableBL - \let\BR \TableBR - \let\BACKGROUND\TableBR - \let\CL \TableCL - \let\RL \TableRL - \let\COLOR \TableCOLOR - \let\RASTER \TableRASTER - \globallet\lastTABLEc\@@tibackgroundcolor - \globallet\lastTABLEr\@@tibackgroundscreen - \doifinsetelse\@@tibackground{c,color} % \v!color - {\global\chardef\TABLEcr\plusone} - {\global\chardef\TABLEcr\plustwo}} - -\def\TableBC - {\ifTABLEgrayline - \normalTABLEquote - \else - \TABLEnoalign\bgroup - \globallet\nextTABLEgrayline\executeTABLEgrayline - \globalletempty\TABLEgrayline % new - \let\BL\doTableBL - \let\BC\doTableBC - \expandafter\doTableBC - \fi} - -\def\doTableBC - {\addtoTABLEgrayline{\BC}% - \gobbleTableBCL} - -\def\TableBL - {\TABLEnoalign\bgroup - \globallet\nextTABLEgrayline\executeTABLEgrayline - \globalletempty\TABLEgrayline % new - \let\BL\doTableBL - \let\CL\doTableCL - \let\RL\doTableRL - \let\BC\doTableBC - \doTableBL} - -\def\doTableBL - {\complexorsimpleTable{BL}} - -\def\simpleTableBL - {\complexTableBL[,]} - -\def\complexTableBL[#1]% - {\analyzeTABLEcr[#1]% - \handleTABLEcr} - -\def\TableBR#1% - {\TABLEnoalign - {\globallet\nextTABLEgrayline\executeTABLEgrayline - \checkTABLEgrayline#1\BR - \global\TABLEgraylinetrue}} - -\def\analyzeTABLEcr[#1]% - {\doanalyzeTABLEcr[#1,,]} - -\def\doanalyzeTABLEcr[#1,#2,#3]% - {\doifnumberelse{#1x} % Is the x still needed here? - {\dodoanalyzeTABLEcr[#1,#2,#3]} - {\dodoanalyzeTABLEcr[1,#1,#2]}} - -\def\dodoanalyzeTABLEcr[#1,#2,#3]% - {\global\chardef\TABLEn#1\relax - \processaction - [#2] - [ c=>\global\chardef\TABLEcr1,% - color=>\global\chardef\TABLEcr1,% - r=>\global\chardef\TABLEcr2,% - raster=>\global\chardef\TABLEcr2]% - \ifcase\TABLEcr \or - \doifsomething{#3}{\xdef\lastTABLEc{#3}}% - \or - \doifsomething{#3}{\xdef\lastTABLEr{#3}}% - \fi} - -\def\handleTABLEcr - {\relax % else funny side effect - \ifcase\TABLEcr - % Can't happen! - \or - \addtoTABLEgrayline{\complexTableCOLOR[\the\TABLEn,\lastTABLEc]}% - \else - \addtoTABLEgrayline{\complexTableRASTER[\the\TABLEn,\lastTABLEr]}% - \fi - \gobbleTableBCL} - -\def\analyzeTABLEcrl#1[#2]% - {\doanalyzeTABLEcrl#1[#2,,]} - -\def\doanalyzeTABLEcrl#1[#2,#3,#4]% - {\doifnumberelse{#2x} % x ???????????????????? - {\dodoanalyzeTABLEcr[#2,#1,#3]} - {\dodoanalyzeTABLEcr[\ifTABLEgrayline1\else\maxTABLEcolumn\fi,#1,#2]}} - -\def\TableCL - {\TABLEnoalign\bgroup - \globallet\nextTABLEgrayline\executeTABLEgrayline - \globalletempty\TABLEgrayline % new - \let\BL\doTableBL - \let\CL\doTableCL - \let\RL\doTableRL - \let\BC\doTableBC - \doTableCL} - -\def\doTableCL - {\complexorsimpleTable{CL}} - -\def\simpleTableCL% nog eens \'e\'en lijn van maken - {\BL[\the\maxTABLEcolumn,c,\lastTABLEc]} - -\def\complexTableCL[#1]% - {\analyzeTABLEcrl{c}[#1]% - \handleTABLEcr} - -\def\TableRL - {\TABLEnoalign\bgroup - \globallet\nextTABLEgrayline\executeTABLEgrayline - \globalletempty\TABLEgrayline % new - \let\BL\doTableBL - \let\CL\doTableCL - \let\RL\doTableRL - \let\BC\doTableBC - \doTableRL} - -\def\doTableRL - {\complexorsimpleTable{RL}} - -\def\simpleTableRL - {\BL[\the\maxTABLEcolumn,r,\lastTABLEr]} - -\def\complexTableRL[#1]% - {\analyzeTABLEcrl{r}[#1]% - \handleTABLEcr} - -\def\checkTABLEgrayline#1#2% - {\!!doneatrue - \ifx#1\AR - \!!doneafalse - \else\ifx#1\SR\else\ifx#1\FR\else\ifx#1\MR\else\ifx#1\LR\else - \!!doneafalse - \fi\fi\fi\fi\fi - \if!!donea - \gdef\TABLEgraylinestatus - {[\string#1]}% - \gdef\TABLEendBCL - {#1}% - \else - \gdef\TABLEgraylineerror - {[\string#2\string#1->\string#2\string\SR]}% - \gdef\TABLEendBCL - {\SR}% - \fi} - -\def\endTABLErowGL#1#2#3% - {\ifcase#1\relax - % unknown - \or - \doPreTableGL\TABLErowfactor\TABLErowfactor - \or - \doPreTableGL\TABLErowfactor\TABLErowzero - \or - \ifnum\TABLEforce=\TABLEforcelastrow - \doPreTableGL\TABLErowzero\TABLErowfactor - \else\ifnum\TABLEforce=\TABLEforcefirstrow - \doPreTableGL\TABLErowfactor\TABLErowzero - \else - \doPreTableGL\TABLErowzero\TABLErowzero - \fi\fi - \or - \doPreTableGL\TABLErowzero\TABLErowfactor - \fi} - -\def\doPreTableGL#1#2% betere namen - {\xdef\OldLineThicknessFactor{\the\LineThicknessFactor}% - \xdef\OldLineThicknessUnit{\the\LineThicknessUnit}% - \global\LineThicknessFactor\plusone - \setbox0\hbox{\AugmentedTableStrut{#1}{#2}}% - \getboxheight\dimen0\of\box0\relax - \xdef\TABLEgraylineHeight{\the\dimen0}% - \global\LineThicknessUnit\TABLEgraylineHeight} - -\def\doPostTableGL - {\global\LineThicknessFactor\OldLineThicknessFactor - \global\LineThicknessUnit \OldLineThicknessUnit} - -% kan simpeler - -\def\docomplexTableCOLOR[#1]% - {\dodocomplexTableGL\localstartcolor \localstopcolor [#1,\lastTABLEc,,]} - -\gdef\docomplexTableRASTER[#1]% - {\dodocomplexTableGL\localstartraster\localstopraster[#1,\lastTABLEr,,]} - -\def\dodocomplexTableGL#1#2[#3,#4,#5,#6]% - {\doifelsenothing{#4}{#1[#5]}{#1[#4]}% - \doPreTableGL\TABLEendofrowheight\TABLEendofrowdepth - \ifnum#3=\plusone % else conflict with \omit in \= - \let\next\normalTABLEsinglerule - \else - \def\next{\normalTABLEmultirule{#3}}% - \fi - \next - \doPostTableGL - #2} - -\def\TableBACKGROUND - {\TableBR} - -\def\simpleTableRASTER #1{\docomplexTableRASTER[1]#1} -\def\complexTableRASTER[#1]{\docomplexTableRASTER[#1]} -\def\simpleTableCOLOR {\docomplexTableCOLOR [1]} -\def\complexTableCOLOR [#1]{\docomplexTableCOLOR [#1]} - -\def\TableRASTER{\complexorsimpleTable{RASTER}} -\def\TableCOLOR {\complexorsimpleTable{COLOR}} - -\def\addtoTABLEgrayline#1% - {\TABLEgraytoks\expandafter{\TABLEgrayline}% - \xdef\TABLEgrayline{\the\TABLEgraytoks\noexpand#1}} - -\def\setTableBCL#1#2% - {\ifx#1#2% - \gdef\TABLEgraylinestatus{[\string#1]}% - \gdef\TABLEendBCL{#1}% - \addtoTABLEgrayline{#1}% - \else - \gdef\TABLEgraylineerror{[\string#1->\string#2]}% - \gdef\TABLEendBCL{#2}% - \addtoTABLEgrayline{#2}% - \fi} - -\def\gobbleTableBCL#1% - {\ifx#1\BC \let\next\doTableBC \else - \ifx#1\BL \let\next\doTableBL \else - \ifx#1\SR \setTableBCL\SR\SR \let\next\egroup \else - \ifx#1\FR \setTableBCL\FR\FR \let\next\egroup \else - \ifx#1\MR \setTableBCL\MR\MR \let\next\egroup \else - \ifx#1\LR \setTableBCL\LR\LR \let\next\egroup \else - \setTableBCL #1\SR \let\next\egroup - \fi\fi\fi\fi\fi\fi - \next} - -\def\executeTABLEgrayline - {\TABLEnoalign - {\def\BC - {\advance\currentTABLEcolumn \plusone}% - \def\dodocomplexTableGL##1##2[##3,##4,##5,##6]% - {\BC\advance\currentTABLEcolumn ##3 }% - \let\endTABLErow\endTABLEgrayrow - \currentTABLEcolumn\zerocount - \TABLEgrayline\TABLEendBCL % determine n of columns and height - \advance\currentTABLEcolumn \minusone - \ifnum\currentTABLEcolumn>\maxTABLEcolumn - % error message too long line - \globalletempty\TABLEgrayline - \else - % \message{n of color columns: \the\currentTABLEcolumn}\wait - \global\TABLEgraylinetrue % vanaf hier nog checken - \fi - \global\currentTABLEcolumn\zerocount}% - \unskip\TABLEgrayline\TABLEendBCL - \TABLEnoalign - {\nobreak - \vskip-\TABLEgraylineHeight - \nobreak - \global\setTABLEactiontrue - \global\currentTABLEcolumn\zerocount - \globalletempty\nextTABLEgrayline - \global\TABLEgraydonetrue - \global\TABLEgraylinefalse}} - -\def\endTABLEgrayrow#1#2#3% - {\ifcase#1\relax - \global\chardef\TABLEendofrowheight\TABLErowfactor - \global\chardef\TABLEendofrowdepth \TABLErowfactor - \or - \global\chardef\TABLEendofrowheight\TABLErowfactor - \global\chardef\TABLEendofrowdepth \TABLErowfactor - \or - \global\chardef\TABLEendofrowheight\TABLErowfactor - \global\chardef\TABLEendofrowdepth \TABLErowzero - \or - \ifnum\TABLEforce=\TABLEforcelastrow - \global\chardef\TABLEendofrowheight\TABLErowzero - \global\chardef\TABLEendofrowdepth \TABLErowfactor - \else\ifnum\TABLEforce=\TABLEforcefirstrow - \global\chardef\TABLEendofrowheight\TABLErowfactor - \global\chardef\TABLEendofrowdepth \TABLErowzero - \else - \global\chardef\TABLEendofrowheight\TABLErowzero - \global\chardef\TABLEendofrowdepth \TABLErowzero - \fi\fi - \or - \global\chardef\TABLEendofrowheight\TABLErowzero - \global\chardef\TABLEendofrowdepth \TABLErowfactor - \fi} - -\def\defineTABLEshorthands% - {\def\SPAN##1{\use{##1}}% - \def\TWO {\use2}% - \def\THREE {\use3}% - \def\FOUR {\use4}% - \def\FIVE {\use5}% - \def\SIX {\use6}% - \def\REF {\ReFormat}} - -\def\defineTABLEunits - {\processaction - [\@@tidistance] - [ \v!none=>\OpenUp00\def\LOW{\Lower6 }, - \v!small=>\OpenUp00\def\LOW{\Lower6 }, % == baseline - \v!medium=>\OpenUp11\def\LOW{\Lower7 }, - \v!big=>\OpenUp22\def\LOW{\Lower8 }]% - \doifelse\@@tidistance\v!none - {\chardef\TABLErowfactor\zerocount} - {\chardef\TABLErowfactor\plustwo }} - -\def\dohandlebar % here ? - {\ifmmode - \@EA\domathmodebar - \else\ifintable - \@EAEAEA\domathmodebar - \else - \@EAEAEA\dotextmodebar - \fi\fi} - -% De macro's t.b.v. instellingen. - -\def\setuptables - {\dosingleargument\dosetuptables} - -\def\dosetuptables[#1]% - {\getparameters[\??ti][#1]% - \processaction - [\@@tialign] - [ \v!right=>\def\TABLEparalignment{\raggedright}, - \v!left=>\def\TABLEparalignment{\raggedleft}, - \v!middle=>\def\TABLEparalignment{\raggedcenter}, - \s!default=>\def\TABLEparalignment{\notragged}, - \s!unknown=>\def\TABLEparalignment{\notragged}]% - \assignalfadimension\@@tiVL\@@tiVLwidth 246% - \assignalfadimension\@@tiHL\@@tiHLheight246} - -\def\localTABLEsetup - {\@@ticommands\relax - \expanded{\switchtobodyfont[\@@tibodyfont]}% - \StrutHeightFactor 8 - \StrutDepthFactor 4 - \LineThicknessFactor4 - \NormalTLTU {.1pt}% - \NormalTSU {\normalbaselineskip\divide\StrutUnit 12 }% - \NormalTableUnits} - -%D And then I wrote the tabulate environment. That -%D alternative supports setting the rule thickness and color, -%D so here is the table alternative. - -\let\startglobalTABLEcolor\empty -\let\stopglobalTABLEcolor \empty - -\def\localTABLEsetup - {\@@ticommands\relax - % bodyfont - \expanded{\switchtobodyfont[\@@tibodyfont]}% - % linecolor - \doifsomething\@@tirulecolor - {\def\startglobalTABLEcolor{\localstartcolor[\@@tirulecolor]}% - \def\stopglobalTABLEcolor {\localstopcolor}}% - % linethickness - \LineThicknessFactor4 - \scratchdimen\@@tirulethickness - \divide\scratchdimen \LineThicknessFactor - \expanded{\NormalTLTU{\the\scratchdimen}}% - % spacing, was depth=4 height=8 (counters, sigh, now macros) - \doifelse\@@tiheight\v!strut - {\let\StrutHeightFactor\@@itheight} - {\let\StrutHeightFactor\@@tiheight}% - \doifelse\@@tidepth\v!strut - {\let\StrutDepthFactor\@@itdepth} - {\let\StrutDepthFactor\@@tidepth}% - \scratchdimen\StrutHeightFactor\points \multiply\scratchdimen 10% - \edef\StrutHeightFactor{\withoutpt\the\scratchdimen}% - \scratchdimen\StrutDepthFactor \points \multiply\scratchdimen 10% - \edef\StrutDepthFactor{\withoutpt\the\scratchdimen}% - % units - \NormalTSU{\normalbaselineskip\divide\StrutUnit 12 }% - \NormalTableUnits} - -\def\OpenUp#1#2% - {\scratchdimen\StrutHeightFactor \points \advance\scratchdimen #1\points - \edef\StrutHeightFactor{\withoutpt\the\scratchdimen}% - \scratchdimen\StrutDepthFactor \points \advance\scratchdimen #2\points - \edef\StrutDepthFactor{\withoutpt\the\scratchdimen}} - -%D As one can see, we didn't only add color, but also more -%D control over spacing. -%D -%D \startbuffer[a] -%D \starttable[|c|] -%D \HL -%D \VL \strut test \VL \FR -%D \VL \strut test \VL \MR -%D \VL \strut test \VL \MR -%D \VL \strut test \VL \LR -%D \HL -%D \stoptable -%D \stopbuffer -%D -%D \startbuffer[b] -%D \starttabulate[|c|] -%D \HL -%D \NC test \NC \NR -%D \NC test \NC \NR -%D \NC test \NC \NR -%D \NC test \NC \NR -%D \HL -%D \stoptabulate -%D \stopbuffer -%D -%D In the next example, the first table is defined as: -%D -%D \typebuffer[a] -%D -%D and the second one as: -%D -%D \typebuffer[b] -%D -%D The first table is typeset using the default height and -%D depth factors .8 and .4. The second table has both factors -%D set to \type {strut}, and the third table shows what -%D happens when we set the values to zero. The rightmost table -%D is typeset using the tabulate environment. -%D -%D \startcombination[4*1] -%D {$\vcenter{\getbuffer[a]}$} -%D {\hbox{h=.8 d=.4}} -%D {\setuptables[height=strut,depth=strut]$\vcenter{\getbuffer[a]}$} -%D {\hbox{h=d=\type{strut}}} -%D {\setuptables[height=0,depth=0]$\vcenter{\getbuffer[a]}$} -%D {\hbox{h=d=0}} -%D {$\vcenter{\getbuffer[b]}$} -%D {\hbox{tabulate}} -%D \stopcombination - -\setuptables - [HL=\v!medium, - VL=\v!medium, - NL=\v!small, - \c!frame=, - \c!align=\v!right, - \c!depth=.40, % \v!strut - \c!height=.80, % \v!strut - \c!rulethickness=\linewidth, - \c!rulecolor=, - \c!distance=\v!medium, - \c!bodyfont=\the\bodyfontsize, - \c!commands=, - \c!background=\v!screen, - \c!backgroundscreen=\@@rsscreen, - \c!backgroundcolor=, - \c!split=\v!auto] - -\def\ifintabel{\ifintable} % upward compatible - -\protect \endinput diff --git a/tex/context/base/tabl-tbl.mkii b/tex/context/base/tabl-tbl.mkii new file mode 100644 index 000000000..15e827e68 --- /dev/null +++ b/tex/context/base/tabl-tbl.mkii @@ -0,0 +1,1439 @@ +%D \module +%D [ file=core-tbl, +%D version=1998.11.03, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Text Flow Tabulation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Macros / Tabulation} + +% \processbetween gebruiken in head/tail macros + +\unprotect + +% WATCH OUT: don't change this model else trialtypesetting +% compatibility problems + +% watch out, cells expand pretty late on a per row basis + +% |p2|p3| 2:3 +% spanning + +% Be careful with changing the hsize calculation in p mode; +% the following code works quite well: +% +% \setupfield [line][location=low,height=1.2\lineheight,width=\hsize] +% \definefield [test] [line] [line] [] +% +% \starttabulate[|l|p|] +% \NC test \NC \field [test] \NC \NR +% \stoptabulate + +% In-text tabbing environment +% +% \starttabulate[| separated template] % eg [|l|p|] or [|l|p|p|] +% \NC ... \NC ... \NC\NR +% \stoptabulate +% +% with: two pass auto width calculation when no p-width +% specified, even with multiple p's, see examples. + +% TaBlE compatible specifications: +% +% l align column/paragraph left +% r align column/paragraph right +% c align column/paragraph center +% p p(dimen) of automatisch als alleen p +% w column width +% f font#1 +% B bold +% I italic +% S slanted +% T type +% R roman +% m math +% M display math +% h hook (inner level or par lines) +% b before (may be command#1) +% a after +% i i skip left of column +% j i skip right of column +% k i skip around column + +% s setups + +% g g{char} align at char +% . align at . +% , align at , + +% Still to be done + +% N math numbers (best hook into existing digits mechanism) +% n numbers (best hook into existing digits mechanism) +% Q math numbers (best hook into existing digits mechanism) +% q numbers (best hook into existing digits mechanism) +% ~ \hskip.5em +% | check + +% nesting + +% 10 evt auto stack; dan wel andere signal dan void nodig + +% present but not yet 100% ok +% +% \FL top hrule +% \ML mid hrule (with auto split) +% \LL bottom hrule +% \HL + +% \VL as soon as needed +% color as soon as needed + +% \EQ \RQ \HQ equal (raw, hook) +% \NC \RC \HC normal (raw, hook) +% +% \NR + +% \HR : rule with lineheight + +% \autotabulaterule : with lineheight, not first/last +% \autotabulateline : spaced, not first/last +% \tabulaterule : with lineheight +% \tabulateline : spaced + +% tricky: align scans ahead, over # and expands ones before +% while doing + +% new: +% +% \starttabulate[|cg{.}|cg{,}|cg{,}|] +% \NC period \NC comma \NC comma \NC\NR +% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR +% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR +% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR +% \NG 10 \NG 10 \NG 0,00 \NC\NR +% \stoptabulate +% +% \starttabulate[|c.|c,|c,|] +% \NC period \NC comma \NC comma \NC\NR +% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR +% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR +% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR +% \NG 10 \NG 10 \NG 0,00 \NC\NR +% \stoptabulate + +% nice demo (for BG) +% +% \starttabulate[|r|b{$\star$}|ra{\percent}|b{=}|r|] +% \NC 500 \NC \NC 60 \NC \NC 300 \NC \NR +% \NC 500 \NC \NC 55 \NC \NC 275 \NC \NR +% \NC 500 \NC \NC 50 \NC \NC 250 \NC \NR +% \NC 500 \NC \NC 45 \NC \NC 225 \NC \NR +% \NC 500 \NC \NC 40 \NC \NC 200 \NC \NR +% \NC 500 \NC \NC 35 \NC \NC 175 \NC \NR +% \NC 500 \NC \NC 30 \NC \NC 150 \NC \NR +% \NC 500 \NC \NC 25 \NC \NC 125 \NC \NR +% \NC 500 \NC \NC 20 \NC \NC 100 \NC \NR +% \stoptabulate + +\newtoks \tabulatepreamble +\newtoks \tabulatebefore +\newtoks \tabulateafter +\newtoks \tabulatebmath +\newtoks \tabulateemath +\newtoks \tabulatefont +\newtoks \tabulatesettings +\newtoks \tabulatedummy + +\newcount \nofautotabulate +\newcount \tabulatecolumns +\newcount \tabulatecolumn + +\newcount \tabulateminplines +\newcount \tabulatemaxplines + +\newif \ifautotabulate +\newif \ifsplittabulate \splittabulatetrue + +\newif \ifhandletabulatepbreak \handletabulatepbreaktrue +\newif \iftabulatenopbreak \tabulatenopbreakfalse + +\newif \iftabulateequal +\newif \iftracetabulate +\newif \ifframedtabulate + +\newdimen \tabulatepwidth +\newdimen \tabulatewidth +\newdimen \tabulateunit +\newdimen \tabulatemaxpheight + +\newbox \tabulatebox + +% [|lg{.}|] => \NG 12.34 \NC + +\gdef\handletabulatecharalign#1 % space delimited ! + {\edef\alignmentclass{\the\tabulatecolumn}% + \edef\alignmentcharacter{\getvalue{\@@tabalign@@\the\tabulatecolumn}}% + \ifcase\tabulatepass\or + \setfirstpasscharacteralign\checkalignment{#1}% + \fi % force hsize + \setsecondpasscharacteralign\checkalignment{#1}} + +\def\noftabcolumns{16} + +\def\@@tabbox@@ {@@tabbox@} +\def\@@tabhook@@ {@@tabhook@} +\def\@@tabalign@@ {@@tabalign@} +\def\@@tabsetups@@{@@tabsetups@} + +% \dorecurse\noftabcolumns % quick and dirty stack +% {\@EA\newbox\csname\@@tabbox@@\recurselevel\endcsname} + +\def\tablebox#1% + {\csname\@@tabbox@@\number#1\endcsname} + +% \def\checktablebox#1% +% {\ifundefinedelse{\@@tabbox@@\number#1}% +% \expandafter\newbox\csname\@@tabbox@@\number#1\endcsname +% \fi} + +\def\initializetablebox#1% also used elsewhere + {\ifcsname\@@tabbox@@\number#1\endcsname + \global\setbox\csname\@@tabbox@@\number#1\endcsname\emptybox + \else + \expandafter\newbox\csname\@@tabbox@@\number#1\endcsname + \fi} + +% \def\initializetableboxes#1% hm, not that efficient, best make a simple dedicated tail recurser +% {\dorecurse#1{\initializetablebox\recurselevel}} + +\def\initializetableboxes#1% + {\scratchcounter#1\relax + \doinitializetableboxes} + +\def\doinitializetableboxes + {\ifnum\scratchcounter>\zerocount + \initializetablebox\scratchcounter + \advance\scratchcounter\minusone + \expandafter\doinitializetableboxes + \fi} + +\initializetableboxes\noftabcolumns + +\def\dotabulatenobreak + {\noalign + {\nobreak + \iftracetabulate + \red\hrule\!!height.5\linewidth\!!depth.5\linewidth + \par + \kern-\linewidth + \nobreak + \fi}} + +\let\notabulatehook\empty + +\def\checktabulatehook + {\ifnum\tabulatetype<\plustwo + \global\let\tabulatehook\notabulatehook + \else + \global\let\tabulatehook\dotabulatehook + \fi} + +\def\checktabulatesetups + {\getvalue{\@@tabsetups@@\the\tabulatecolumn}} + +\let\pretabrule \donothing +\let\posttabrule\donothing + +\def\dodosettabulatepreamble#1#2% + {\ifzeropt\tabulatewidth + \ifcase\tabulatemodus\relax + \let\preamblebox\empty + \else + \def\preamblebox{\autotabulatetrue}% + \fi + \else + \ifcase\tabulatemodus\relax + \edef\preamblebox{\hbox to \the\tabulatewidth}% + \else + \edef\preamblebox{\hsize\the\tabulatewidth}% + \fi + \fi + % + % less bytes + % + %\edef\preamblebox% + % {\ifcase\tabulatewidth + % \ifcase\tabulatemodus\relax\else\noexpand\autotabulatetrue\fi + % \els + % \ifcase\tabulatemodus\relax\hbox to\else\hsize\fi\the\tabulatewidth + % \fi}% + % + % 0 = NC column next EQ equal column + % 1 = RC column raw RQ equal column raw + % 2 = HC column hook HQ equal column hook + % some entries can be left out if we test for them being set + \@EA\appendtoks \@EA&\@EA\hskip\pretabskip\pretabrule##&\to\!!toksa + \appendtoks \ignorespaces\to\!!toksa + \@EA\appendtoks\@EA\global\@EA\tabulatecolumn\the\tabulatecolumns\relax\to\!!toksa + \appendtoks \checktabulatesetups\to\!!toksa + \appendtoks \checktabulatehook\to\!!toksa + \@EA\appendtoks \preamblebox\to\!!toksa + \appendtoks \bgroup\bbskip\bgroup#1\to\!!toksa + \appendtoks\ifnum\tabulatetype=\plusone \else \to\!!toksa + \@EA\appendtoks \the\tabulatebmath\to\!!toksa + \@EA\appendtoks \the\tabulatefont\to\!!toksa + \@EA\appendtoks \the\tabulatesettings\to\!!toksa + \@EA\appendtoks \the\tabulatebefore\to\!!toksa + \appendtoks\fi \to\!!toksa + \appendtoks \bgroup\ignorespaces\to\!!toksa + % + \appendtoks \tabulatehook##\to\!!toksa + % + %%\doifdefinedelse{\@@tabalign@@\tabulatecolumns} + %\doifdefinedelse{\@@tabalign@@\the\tabulatecolumns} + % {\appendtoks\handletabulatecharalign## \to\!!toksa} + % {\appendtoks\tabulatehook ##\to \!!toksa}% + % waarom kan ik hier geen \xx{##} geven, om een of + % andere reden passeert dan tex de hele regel (incl \NC's) + % als argument; elke delimiter <> space gaat trouwens fout + \appendtoks \unskip\unskip\ifmmode\else\endgraf\fi\egroup\to\!!toksa + \appendtoks\ifnum\tabulatetype=1 \else \to\!!toksa + \@EA\appendtoks \the\tabulateafter\to\!!toksa + \@EA\appendtoks \the\tabulateemath\to\!!toksa + \appendtoks\fi \to\!!toksa + \appendtoks #2\egroup\egroup\to\!!toksa + \@EA\appendtoks \@EA&\@EA\posttabrule\@EA\hskip\postabskip##\to\!!toksa + \appendtoks\NC\to\tabulatedummy + \let\bbskip\empty + \def\pretabskip{.5\tabulateunit}% + \let\postabskip\pretabskip + \let\gettabulateexit\dogettabulateexit + \tabulatewidth\zeropoint} + +% todo: we can speed up this module a bit +% +% \expanded{\!!toksa{\the\!!toksa +% &\hskip\pretabskip\noexpand\pretabrule####& +% \ignorespaces +% \global\tabulatecolumn\the\tabulatecolumns +% \noexpand\checktabulatesetups +% \noexpand\checktabulatehook +% \preamblebox +% \bgroup\noexpand\bbskip\bgroup\normalunexpanded{#1}% +% \noexpand\ifnum\tabulatetype=\plusone \noexpand\else +% \the\tabulatebmath +% \the\tabulatefont +% \the\tabulatesettings +% \the\tabulatebefore +% \noexpand\fi +% \bgroup\ignorespaces +% \noexpand\tabulatehook####% +% \unskip\unskip\noexpand\ifmmode\noexpand\else\endgraf\noexpand\fi\egroup +% \noexpand\ifnum\noexpand\tabulatetype=1 \noexpand\else +% \the\tabulateafter +% \the\tabulateemath +% \noexpand\fi +% \normalunexpanded{#2}\egroup\egroup +% &\noexpand\posttabrule\hskip\noexpand\postabskip####}}% + +\def\dosettabulatepreamble + {\ifx\next\relax + \let\nextnext\relax % == \expandafter\gobbleoneargument + \else + \let\nextnext\settabulatepreamble + \ifx x\next \let\tabulatealign\zerocount % internal + \else\ifx l\next \let\tabulatealign\plusone + \else\ifx r\next \let\tabulatealign\plustwo + \else\ifx c\next \let\tabulatealign\plusthree + \else\ifx p\next \let\nextnext\gettabulateparagraph + \else\ifx s\next \let\nextnext\gettabulatesetups + \else\ifx w\next \let\nextnext\gettabulatewidth + \else\ifx f\next \let\nextnext\gettabulatefont + \else\ifx B\next \tabulatefont{\bf}% + \else\ifx I\next \tabulatefont{\it}% + \else\ifx S\next \tabulatefont{\sl}% + \else\ifx T\next \tabulatefont{\tt}% + \else\ifx R\next \tabulatefont{\rm}% + \else\ifx m\next \tabulatebmath{$}\tabulateemath{$}% + \else\ifx M\next \tabulatebmath{$\displaystyle}\tabulateemath{$}% + \else\ifx h\next \let\nextnext\gettabulatehook + \else\ifx b\next \let\nextnext\gettabulatebefore + \else\ifx a\next \let\nextnext\gettabulateafter + \else\ifx i\next \let\nextnext\gettabulatepreskip + \else\ifx j\next \let\nextnext\gettabulateposskip + \else\ifx k\next \let\nextnext\gettabulatepreposskip + \else\ifx X\next \let\nextnext\gettabulateexit % internal + \else\ifx e\next \appendtoks\global\tabulateequaltrue\to\tabulatesettings + \else\ifx ~\next \appendtoks\fixedspaces\to\tabulatesettings + \else\ifx g\next \let\nextnext\gettabulatealign + \else\ifx .\next \def\nextnext{\gettabulatealign.}% + \else\ifx ,\next \def\nextnext{\gettabulatealign,}% + \else \message{unknown preamble key [\meaning\next]}% + \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi + \fi + \nextnext} + +\def\dogettabulateexit + {\let\postabskip\!!zeropoint + \settabulatepreamble} + +\let\gettabulateexit\dogettabulateexit + +\def\gettabulatepreskip#1% + {\doifnumberelse{#1} + {\scratchdimen#1\tabulateunit\let\next\empty} + {\scratchdimen.5\tabulateunit\def\next{#1}}% + \edef\pretabskip{\the\scratchdimen}% + \@EA\settabulatepreamble\next} + +\def\gettabulateposskip#1% + {\doifnumberelse{#1} + {\scratchdimen#1\tabulateunit\let\next\empty} + {\scratchdimen.5\tabulateunit\def\next{#1}}% + \edef\postabskip{\the\scratchdimen}% + \let\gettabulateexit\settabulatepreamble + \@EA\settabulatepreamble\next} + +\def\gettabulatepreposskip#1% + {\doifnumberelse{#1} + {\scratchdimen#1\tabulateunit\let\next\empty} + {\scratchdimen.5\tabulateunit\def\next{#1}}% + \edef\pretabskip{\the\scratchdimen}% + \let\postabskip\pretabskip + \let\gettabulateexit\settabulatepreamble + \@EA\settabulatepreamble\next} + +\def\gettabulatesetups#1% + {\setvalue{\@@tabsetups@@\the\tabulatecolumns}{\setups[#1]}% + \settabulatepreamble} + +\def\gettabulatehook#1% + {\setvalue{\@@tabhook@@\the\tabulatecolumns}{#1}% + \settabulatepreamble} + +\def\gettabulatealign#1% + {\setvalue{\@@tabalign@@\the\tabulatecolumns}{#1}% + \settabulatepreamble} + +\def\gettabulatebefore#1% + {\tabulatebefore{#1}% + \settabulatepreamble} + +\def\gettabulateafter#1% + {\tabulateafter{#1}% + \settabulatepreamble} + +\def\gettabulatefont#1% + {\tabulatefont{#1}% + \settabulatepreamble} + +\def\gettabulatewidth + {\let\tabulatemodus\zerocount + \let\tabulatedimen\zerocount + \doifnextcharelse(\dogettabulatewidth\settabulatepreamble} + +\def\gettabulateparagraph + {\doifnextcharelse{(} + {\let\tabulatemodus\plusone + \let\tabulatedimen\plusone + \dogettabulatewidth} + {\let\tabulatemodus\plustwo + \let\tabulatedimen\zerocount + \settabulatepreamble}} + +% \def\dogettabulatewidth(#1)% +% {\tabulatewidth#1\relax +% \ifnum\tabulatedimen=\plusone +% \global\advance\tabulatepwidth\tabulatewidth +% \fi +% \settabulatepreamble} + +% \def\dogettabulatewidth(#1)% +% {\doifelse{#1}\v!passend +% {\let\tabulatemodus\plusthree} +% {\tabulatewidth#1\relax}% +% \ifnum\tabulatedimen=\plusone +% \global\advance\tabulatepwidth\tabulatewidth +% \fi +% \settabulatepreamble} + +% \startbuffer +% \toplinebox{\framed[width=3cm,height=2cm]{tufte}} +% \stopbuffer +% \starttabulate[|p(fixed)|p|] +% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR} +% \stoptabulate +% \starttabulate[|p(fit)|p|] +% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR} +% \stoptabulate + +\def\dogettabulatewidth(#1)% + {\processallactionsinset + [#1]% + [ \v!fit=>\let\tabulatemodus\plusthree, + \v!fixed=>\let\tabulatemodus\plusthree + \tabulatenopbreaktrue, + \s!unknown=>\tabulatewidth#1\relax]% + \ifnum\tabulatedimen=\plusone + \global\advance\tabulatepwidth\tabulatewidth + \fi + \settabulatepreamble} + +\def\settabulatepreamble + {\afterassignment\dosettabulatepreamble\let\next=} + +\def\tabulateraggedright {\ifnum\tabulatetype=\plusone \else\raggedright \fi} +\def\tabulateraggedcenter{\ifnum\tabulatetype=\plusone \else\raggedcenter\fi} +\def\tabulateraggedleft {\ifnum\tabulatetype=\plusone \else\raggedleft \fi} +\def\tabulatenotragged {\ifnum\tabulatetype=\plusone \else\notragged \fi} +\def\tabulatehss {\ifnum\tabulatetype=\plusone \else\hss \fi} % never change this to a fill + +\bgroup \catcode`\|=\@@other + +\gdef\nexttabulate#1|% + {\let\tabulatealign\@@tabulatealign + \let\tabulatemodus\zerocount + \let\tabulatedimen\zerocount + \tabulatebefore \emptytoks + \tabulateafter \emptytoks + \tabulatebmath \emptytoks + \tabulateemath \emptytoks + \tabulatefont \emptytoks + \tabulatesettings\emptytoks + \global\advance\tabulatecolumns\plusone + \letvalue{\@@tabsetups@@\the\tabulatecolumns}\donothing + \settabulatepreamble#1\relax\relax % permits i without n + \ifcase\tabulatemodus\relax + \ifcase\tabulatealign\relax + \dodosettabulatepreamble\empty \tabulatehss \or + \dodosettabulatepreamble\empty \tabulatehss \or + \dodosettabulatepreamble\tabulatehss\empty \or + \dodosettabulatepreamble\tabulatehss\tabulatehss \fi + \or % fixed width + \ifcase\tabulatealign\relax + \dodosettabulatepreamble \bskip \eskip \or + \dodosettabulatepreamble{\bskip\tabulateraggedright }\eskip \or + \dodosettabulatepreamble{\bskip\tabulateraggedleft }\eskip \or + \dodosettabulatepreamble{\bskip\tabulateraggedcenter}\eskip \fi + \or % auto width + \global\advance\nofautotabulate\plusone + \ifcase\tabulatealign\relax + \dodosettabulatepreamble \bskip \eskip \or + \dodosettabulatepreamble{\bskip\tabulateraggedright }\eskip \or + \dodosettabulatepreamble{\bskip\tabulateraggedleft }\eskip \or + \dodosettabulatepreamble{\bskip\tabulateraggedcenter}\eskip \fi + \or % simple + \dodosettabulatepreamble \xbskip \xeskip + \fi + \futurelet\next\donexttabulate} + +\egroup + +\def\donexttabulate + {\ifx\next\relax\else + \expandafter\nexttabulate + \fi} + +\def\splitofftabulatebox % overloaded in anch-pgr + {\dontcomplain + \global\setbox\tabulatebox % % % global ? % % % + \vsplit\tablebox\tabulatecolumn to \lineheight + \setbox\tabulatebox\normalvbox + {\unvbox\tabulatebox}% + \setbox\tabulatebox\hbox to \wd\tabulatebox + {\hss\dotabulatehook{\box\tabulatebox}\hss}% + \ht\tabulatebox\strutht + \dp\tabulatebox\strutdp + \box\tabulatebox} + +\def\dotabulatehook {\getvalue{\@@tabhook@@ \the\tabulatecolumn}} +\def\dotabulatealign {\getvalue{\@@tabalign@@ \the\tabulatecolumn}} + +\def\resettabulatepheight + {\global\tabulateminplines\plusone + \getnoflines\tabulatemaxpheight + \global\tabulatemaxplines\noflines + \global\tabulatemaxpheight\zeropoint} + +\def\settabulatepheight + {\scratchdimen\ht\tablebox\tabulatecolumn\relax + \ifdim\scratchdimen>\tabulatemaxpheight + \global\tabulatemaxpheight\scratchdimen + \fi} + +\def\handletabulatepbreak + {\TABLEnoalign + {\ifhandletabulatepbreak + \iftabulatenopbreak + \dotabulatenobreak + \else\ifnum\tabulatemaxplines>\plusone + \ifnum\tabulateminplines=\plusone + \dotabulatenobreak + \fi + \global\advance\tabulateminplines\plusone + \ifnum\tabulateminplines=\tabulatemaxplines\relax + \dotabulatenobreak + \fi + \fi \fi + \fi}} + +%D \startbuffer +%D \starttabulate[|c|p|p|] +%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR +%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR +%D \NC 2 \NC \thinrules[n=3] \NC \thinrules[n=3] \NC\NR +%D \NC 3 \NC oh yes \NC simply no \NC\NR +%D \NC 4 \NC very true \NC as false as can be \NC\NR +%D \NC 5 \NC \thinrules[n=5] \NC \thinrules[n=5] \NC\NR +%D \NC 6 \NC \thinrules[n=3] \NC \thinrules[n=4] \NC\NR +%D \stoptabulate +%D \stopbuffer +%D +%D \typebuffer {\tracetabulatetrue\getbuffer} +%D +%D \startbuffer +%D \starttabulate[|c|p|p|] +%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR +%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR +%D \NC 2 \NC oh yes \NC simply no \NC\NR +%D \NC 3 \NC very true \NC as false as can be \NC\NR +%D \NC 4 \NC the whole truth \NC but the truth \NC\NR +%D \stoptabulate +%D \stopbuffer +%D +%D \typebuffer {\tracetabulatetrue\getbuffer} + +% \definetabulate +% \redefinetabulate +% \starttabulate[preamble] +% \starttabulate -> \starttabulate[|l|p|] + +\bgroup \catcode`\|=\@@other + +\gdef\definetabulate + {\dotripleempty\dodefinetabulate} + +\gdef\dodefinetabulate[#1][#2][#3]% + {\ifthirdargument + \doifundefined{\??tt#1::\c!unit} + {\copyparameters + [\??tt#1::][\??tt\v!tabulate::]% + [\c!frame,\c!distance,\c!unit,\c!before,\c!bodyfont,\c!after, + \c!inner,\c!indenting,\c!margin,\c!align,\c!header,\c!title, + \c!rulecolor,\c!rulethickness,\c!split,EQ]}% + \copyparameters + [\??tt#1::#2][\??tt#1::]% + [\c!unit,\c!distance,\c!before,\c!bodyfont,\c!after, + \c!inner,\c!indenting,\c!frame,\c!split,\c!header,\c!title, + \c!margin,\c!align,\c!rulecolor,\c!rulethickness,EQ]% + \setvalue{\e!start#1::#2}{\dofinalstarttabulate[#1][#2][#3]}% + \setvalue{\e!start#1}{\bgroup\dosubstarttabulate[#1]}% + \letvalue{\??tt#1-\v!header}\empty + \letvalue{\??tt#1-\v!footer }\empty + \else\ifsecondargument + \definetabulate[#1][][#2]% + \else + \definetabulate[#1][][|l|p|]% + \fi\fi} + +\egroup + +\let\tabulateheadcontent\empty +\let\tabulatetailcontent\empty + +\newconditional\tabulatesomeamble + +\def\checkfulltabulatecontent % - needed, else confusion with \c!header + {\ifundefined{\??tt\currenttabulate-\v!header}% + \let\tabulateheadcontent\empty + \else + \def\tabulateheadcontent + {\TABLEnoalign{\global\settrue\tabulatesomeamble}% + \csname\??tt\currenttabulate-\v!header\endcsname + \TABLEnoalign{\global\setfalse\tabulatesomeamble}}% + \fi + \ifundefined{\??tt\currenttabulate-\v!footer}% + \let\tabulatetailcontent\empty + \else + \def\tabulatetailcontent + {\TABLEnoalign{\global\settrue\tabulatesomeamble}% + \csname\??tt\currenttabulate-\v!footer\endcsname + \TABLEnoalign{\global\setfalse\tabulatesomeamble}}% + \fi} + +% \def\fulltabulatecontent +% {\tabulateheadcontent +% \tabulatecontent +% \tabulatetailcontent} + +\def\fulltabulatecontent + {\tabulateheadcontent + \tabulatecontent + \tabulatetailcontent + \removefunnytabulateline} + +\def\removefunnytabulateline + {\ifhmode + \strut\crcr + \TABLEnoalign{\kern-\lineheight}% + \fi} + +\setvalue{\e!start\v!tabulatehead}% + {\dosingleempty\dostartstarttabulatehead} + +\def\dostartstarttabulatehead[#1]% + {\processcontent{\e!stop\v!tabulatehead}\next + {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!header}\next}} + +\setvalue{\e!start\v!tabulatetail}% + {\dosingleempty\dostartstarttabulatetail} + +\def\dostartstarttabulatetail[#1]% + {\processcontent{\e!stop\v!tabulatetail}\next + {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!footer}\next}} + +\def\dosubstarttabulate + {\dodoubleempty\dodosubstarttabulate} + +\def\dodosubstarttabulate[#1][#2]% + {\getvalue{\e!start#1::\ifundefined{\e!start#1::#2}\else#2\fi}} + +\setvalue{\e!start\v!tabulate}% + {\bgroup\dodoubleempty\donormalstarttabulate} + +\bgroup + +\gdef\donormalstarttabulate[#1][#2]% + {\ifsecondargument + \getparameters[\??tt\v!tabulate::][#2]% + \fi + \iffirstargument + \def\next{\dofinalstarttabulate[\v!tabulate][][#1]}% + \else + \def\next{\dofinalstarttabulate[\v!tabulate][][|l|p|]}% + \fi + \next} + +\egroup + +% The much neede hook: + +\newtoks\everytabulate + +% An example of its usage: + +\appendtoks \optimizeverbatimfalse \to \everytabulate +\appendtoks \let\recodeverbatimmode\plustwo \to \everytabulate + +% A status variable: + +\chardef\tabulatepass=0 + +\def\tabulateparameter#1{\csname\??tt\currenttabulate#1\endcsname} + +\bgroup + \catcode`\|=\@@other \gdef\@@otherbar{|} + \catcode`\|=\@@active \gdef\@@useotherbar{\let|\@@otherbar} +\egroup + +\def\dofinalstarttabulate[#1][#2][#3]% identifier sub preamble + {\edef\currenttabulate{#1::#2}% + \ifinsidefloat \else + \whitespace + \tabulateparameter\c!before + \fi + \bgroup + \resetcharacteralign + % todo: spacing around tabulate when bodyfont is set + % expansion en test needed ? + \splittabulatetrue + \processaction + [\tabulateparameter\c!split] + [% \v!yes=>\splittabulatetrue, + % \v!repeat=>\splittabulatetrue, % todo, default yes + \v!no=>\splittabulatefalse, + \v!auto=>\ifinsidefloat\ifinsidesplitfloat\else\splittabulatefalse\fi\fi]% + \doifvaluesomething{\??tt\currenttabulate\c!bodyfont} + {\expanded{\switchtobodyfont[\tabulateparameter\c!bodyfont]}}% + \postponenotes % new, to be tested / will be configurable + \let\tabulatepass\plusone + \widowpenalty\zerocount % otherwise lines are not broken + \clubpenalty \zerocount % but overlap in funny ways + \the\everytabulate + \tabulateparameter\c!inner + \scratchdimen\leftskip + \advance\scratchdimen \hangindent + \doifvalue{\??tt\currenttabulate\c!indenting}\v!yes + {\advance\scratchdimen \parindent}% \ctxparindent + \edef\tabulateindent{\the\scratchdimen}% + \!!toksb\emptytoks + \def\dorepeat*##1##2% + {\dorecurse{##1}{\appendtoks##2\to\!!toksb}\do}% + \def\do + {\futurelet\next\dodo}% + \def\dodo % \@EAEAEA gebruiken + {\ifx\next\relax + % exit + \else\ifx*\next + \let\next\dorepeat + \else\ifx\bgroup\next + \let\next\dododo + \else + \let\next\dodododo + \fi\fi\fi + \next}% + \def\dododo##1% + {\appendtoks{##1}\to\!!toksb\do}% + \def\dodododo##1% + {\appendtoks##1\to\!!toksb\do}% + \global\tabulatecolumn\zerocount +% \do#3\relax +\bgroup\@@useotherbar\expanded{\egroup\noexpand\do#3\relax}% + \processcontent + {\e!stop#1}% \currenttabulate} + \tabulatecontent + {\@EA\processtabulate\@EA[\the\!!toksb]}} + +\chardef\tabulatetype=0 + +% 0 = NC column next EQ equal column +% 1 = RC column raw RQ equal column raw +% 2 = HC column hook HQ equal column hook + +\newif\iftabulatefirstflushed + +\def\tabulateEQ + {\iftabulatefirstflushed\else\tabulateparameter{EQ}\fi + \global\tabulateequalfalse} + +% \def\tabulatenormalcolumn#1% +% {&\iftabulateequal\tabulateEQ\fi&\global\chardef\tabulatetype#1&} +% +% \def\tabulateequalcolumn#1% +% {&\tabulateEQ&\global\chardef\tabulatetype#1&} +% +% however, \unskip en \ignorespaces permit usage in complex XML/\starttabulate + +\def\tabulatenormalcolumn#1% + {\unskip&\iftabulateequal\tabulateEQ\fi&\global\chardef\tabulatetype#1&% + \ignorespaces} + +\def\tabulateequalcolumn#1% + {\unskip&\tabulateEQ&\global\chardef\tabulatetype#1&% + \ignorespaces} + +\def\tabulateautocolumn + {\tabulatenormalcolumn\zerocount + \ifnum\tabulatecolumn>\tabulatecolumns\relax + \expandafter\NR + \else + \expandafter\ignorespaces % interferes with the more tricky hooks + \fi} + +\def\setquicktabulate#1% see \startlegend \startgiven + {\let#1\tabulateautocolumn + \let\\\tabulateautocolumn} + +%\def\dotabulateruleseperator +% {\vskip\strutdp} + +\def\dotabulateruleseperator % can be sped up + {\bgroup + \let\factor\!!plusone + \scratchskip\strutdp + \ExpandFirstAfter\processallactionsinset + [\tabulateparameter\c!distance] + [ \v!blank=>\scratchskip\bigskipamount, + \v!depth=>\scratchskip\strutdp, + \v!small=>\def\factor{.25}, + \v!medium=>\def\factor{.5}, + \v!big=>, + \v!none=>\scratchskip\zeropoint\def\factor{0}, + \v!grid=>\scratchskip\zeropoint\def\factor{0}, + \s!unknown=>\scratchskip\commalistelement]% + \scratchdimen\factor\scratchskip + \ifconditional\tabulatesomeamble\kern\else\vskip\fi\scratchdimen % new + \egroup} + +\def\dodotabulaterule#1% + {\color + [\tabulateparameter\c!rulecolor] + {\scratchdimen\tabulateparameter\c!rulethickness#1}} + +\def\dotabulaterule + {\dodotabulaterule + {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax + \doifvalue{\??tt\currenttabulate\c!distance}\v!grid + {\kern-\scratchdimen}}} % experimental tm-prikkels + +\def\dotabulatelinerule + {\multispan\totaltabulatecolumns % \multispan is a plain macro + % for the moment this one + \strut\hskip\tabulateparameter\c!margin + % neg values are ok ! + \hskip\tabulateindent % new august 2003 + \dodotabulaterule + {\!!heighta.5\lineheight + \advance\!!heighta-\strutdepth + \!!deptha-\!!heighta + \advance\!!deptha\scratchdimen + \leaders\hrule\!!height\!!heighta\!!depth\!!deptha\hfill}% + \cr} + +%D When set to true, no (less) break optimization is done. + +\newif\iftolerantTABLEbreak + +%D The main processing macro is large but splitting it up +%D would make things less clear. + +\def\doregistertabulateparoptions + {\iftrialtypesetting \else + \registerparoptions + \ifinsidefloat + % that is, an unbreakable one + \global\let\registertabulateparoptions\empty + \else + % unsafe in crossing pages, at each b... + % \global\let\registertabulateparoptions\empty + \fi + \fi} + +\appendtoks + \global\let\registertabulateparoptions\doregistertabulateparoptions +\to \everytabulate + +\newtoks\everytabulaterow + +\appendtoks + \registertabulateparoptions +\to \everytabulaterow + +\def\flushtabulateindent + {\ifnum\tabulatecolumn=\zerocount + \hbox to \tabulateindent + {% we now have a local hsize, and since we want to + % register positional info (i.e. real hsizes) we + % need to reconstitute the original hsize + \advance\hsize\tabulateindent + % this is indeed rather messy and took a few hours + % to dis/uncover + \the\everytabulaterow + \hss}% + \fi} + +\def\totaltabulatecolumns{0} + +\def\handletabulatedigits{\digits} + +%D Beware, we cannot use \type {\unexpanded} on \type {\HL} +%D cum suis, since \TEX's hard coded noalign lookahead fails +%D on it! I mistakenly added this for a while. + +\chardef\tabulaterepeathead\zerocount + +\newcount\noftabulatelines +\newcount\totalnoftabulatelines +\newcount\minusnoftabulatelines + +\setvalue{\??tt:\c!align:\v!normal}{0} +\setvalue{\??tt:\c!align:\v!right }{1} +\setvalue{\??tt:\c!align:\v!left }{2} +\setvalue{\??tt:\c!align:\v!middle}{3} + +\setvalue{\??tt:\c!header:\v!repeat}{\plusone} +\setvalue{\??tt:\c!header:\v!text }{\plustwo} + +\bgroup \catcode`\|=\@@other + +\newtoks\everyaftertabulaterow + +\gdef\processtabulate[|#1|]% in the process of optimizing + {\tabulateunit\tabulateparameter\c!unit + \checkfulltabulatecontent + \globallet\tabulateruledepth \!!zeropoint + \globallet\tabulateruleheight\!!zeropoint + \edef\@@tabulatealign{\executeifdefined{\??tt:\c!align:\tabulateparameter\c!align}0}% +% \ExpandFirstAfter\processaction % use \setalignmentswitch instead +% [\tabulateparameter\c!align] +% [ \v!normal=>\def\@@tabulatealign{0},% = default value +% \v!right=>\def\@@tabulatealign{1},% chardefs gebruiken +% \v!left=>\def\@@tabulatealign{2},% +% \v!middle=>\def\@@tabulatealign{3},% +% \s!default=>\def\@@tabulatealign{0},% +% \s!unknown=>\def\@@tabulatealign{0}]% + \let\pretabskip\!!zeropoint + \def\postabskip{.5\tabulateunit}% + \global\tabulatecolumns\zerocount + \global\nofautotabulate\zerocount + \global\noftabulatelines\zerocount + \totalnoftabulatelines\noftabulatelines + \minusnoftabulatelines\noftabulatelines + \global\tabulatepwidth\zeropoint + \global\tabulateequalfalse + \resettabulatepheight + \ifinsidesplitfloat + \donetrue + \else\ifinsidefloat + \donefalse + \else + \donetrue + \fi\fi + \ifdone + \chardef\tabulaterepeathead\executeifdefined{\??tt:\c!header:\tabulateparameter\c!header}\zerocount +% \processaction +% [\tabulateparameter\c!header] +% [\v!repeat=>\let\tabulaterepeathead\plusone, +% \v!text=>\let\tabulaterepeathead\plustwo]% + \fi + \unexpanded \def\NC{\tabulatenormalcolumn0}% + \unexpanded \def\RC{\tabulatenormalcolumn1}% + \unexpanded \def\HC{\tabulatenormalcolumn2}% + \unexpanded \def\EQ{\tabulateequalcolumn 0}% + \unexpanded \def\RQ{\tabulateequalcolumn 1}% + \unexpanded \def\HQ{\tabulateequalcolumn 2}% + \unexpanded \def\NG{\NC\handletabulatecharalign}% + \unexpanded \def\NN{\NC\handletabulatedigits}% new, undocumented, test first + \unexpanded \def\ND{\NC\handletabulatedigits}% same, for old times sake + \def\tabulaterule{\HR}% a rule with lineheight + \def\tabulateline{\HL}% just a spaced rule + \def\tabulateautorule{\doHR\plusone}% + \def\tabulateautoline{\doHL\plusone}% + \def\HR{\doHR\zerocount} + \def\HL{\doHL\zerocount} + \unexpanded \def\NR % next row + {\global\advance\noftabulatelines\plusone + \global\tabulatefirstflushedfalse + \global\tabulateequalfalse + \global\tabulatecolumn\zerocount + \resettabulatepheight + \unskip\unskip\crcr\flushtabulated +\TABLEnoalign + {\the\everyaftertabulaterow}% + \TABLEnoalign + {\iftolerantTABLEbreak\else + \ifconditional\tabulatesomeamble \ifcase\tabulaterepeathead \else + \allowbreak + \fi \fi + \ifnum\noftabulatelines=\plusone + \dotabulatenobreak + \else\ifnum\noftabulatelines=\minusnoftabulatelines + \ifnum\tabulatemaxplines<\plustwo + \dotabulatenobreak + \else + \allowbreak % needed with pbreak prevention + \fi + \else + \allowbreak % needed with pbreak prevention + \fi\fi + \fi + \global\tabulatefirstflushedfalse}}% + \let\HL\empty % not needed + \let\SR\NR \let\AR\NR + \let\FL\empty \let\FR\NR + \let\ML\empty \let\MR\NR + \let\LL\empty \let\LR\NR + \let\doHR\gobbleoneargument + \let\doHL\gobbleoneargument + \global\let\flushtabulated\empty +% \let\savedbar|\let|\nexttabulate + \tabskip\zeropoint + \ifdim\tabulateparameter\c!margin>\zeropoint + \!!toksa{&\flushtabulateindent\strut##% + \tabskip\tabulateparameter\c!margin\strut + &##\tabskip\zeropoint}% + \else + \!!toksa{&\flushtabulateindent\strut##% + &##\tabskip\zeropoint}% + \fi + \tabulatewidth\zeropoint + % |#1X|\relax + \nexttabulate #1X|\relax + \scratchcounter\tabulatecolumns + \multiply\scratchcounter3% + \advance\scratchcounter4% + \edef\totaltabulatecolumns{\the\scratchcounter}% + \tabulatewidth\zeropoint + % \dorecurse\tabulatecolumns % can be made faster + % {\doifundefinedelse{\@@tabbox@@\recurselevel} + % {\expandafter\newbox\csname\@@tabbox@@\recurselevel\endcsname}% + % {\global\setbox\csname\@@tabbox@@\recurselevel\endcsname\emptybox}}% + \initializetableboxes\tabulatecolumns + \appendtoks&##\to\!!toksa + \appendtoks\global\advance\tabulatecolumn\plusone\to\!!toksa + \appendtoks\NC\unskip\unskip\crcr\flushtabulated\to\tabulatedummy % no count + \global\tabulatecolumn\zerocount + \resettabulatepheight + \def\bskip + {\setbox\tabulatebox\vbox\bgroup + \global\let\tabulatehook\notabulatehook}% + \def\eskip + {\par\egroup + \global\let\tabulatehook\dotabulatehook}% + \def\xbskip + {\hbox\bgroup\vbox\bgroup + \global\let\tabulatehook\notabulatehook}% + \def\xeskip + {\par\egroup\egroup + \global\let\tabulatehook\dotabulatehook}% + % \let|\savedbar + \global\let\tabulatehook\dotabulatehook + \doifvalue{\??tt\currenttabulate\c!indenting}\v!no\forgetparindent + \ifinsidefloat + \let\tabulateindent\!!zeropoint + \else + \setlocalhsize \hsize\localhsize + \fi + \dontcomplain + \forgetall % hm, interference with \forgetparindent ^^^ probably bug, to be solved + \setbox0\vbox % outside \if because of line counting + {\notesenabledfalse + \let\tabulateindent\!!zeropoint + \trialtypesettingtrue % very important + \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}}% + \ifnum\nofautotabulate>\zerocount + % so, even if the natural size is larger, in the final + % run, we force the calculated width + \tabulatewidth\hsize + \advance\tabulatewidth -\wd0 + \advance\tabulatewidth -\tabulatepwidth + \ifnum\nofautotabulate>\zerocount + \divide\tabulatewidth \nofautotabulate\relax + \fi + \fi + \def\xbskip{\bskip}% + \def\xeskip{\eskip}% + \ifsplittabulate + \splittopskip\strutht + \global\let\flushtabulatedindeed\empty + \long\def\bbskip + {\ifvoid\tablebox\tabulatecolumn + \ifx\flushtabulatedindeed\empty\else + \setbox0\hbox + \fi + \fi}% + \def\bskip + {\ifvoid\tablebox\tabulatecolumn + \global\setbox\tablebox\tabulatecolumn\vbox + \bgroup + \global\let\tabulatehook\notabulatehook + \ifautotabulate\hsize\tabulatewidth\fi + % \begstrut % interferes with pre-\pars + % evt: \appendtoks\begstrut\to\everypar + \ignorespaces + \def\eskip + {\par\egroup + \settabulatepheight + \global\let\tabulatehook\dotabulatehook + \splitofftabulatebox}% + \else + \let\eskip\empty + \dontcomplain + \global\let\tabulatehook\dotabulatehook + \expandafter\splitofftabulatebox + \fi}% + \gdef\flushtabulated + {\TABLEnoalign % noalign % no interference ! + {\global\let\flushtabulatedindeed\empty + \global\tabulatecolumn\zerocount + \handletabulatepbreak + \dorecurse\tabulatecolumns % was: \noftabcolumns + {\ifvoid\tablebox\recurselevel\else + \gdef\flushtabulatedindeed{\the\tabulatedummy}% + \fi}% + \global\tabulatefirstflushedtrue}% + \flushtabulatedindeed}% + \else + % tabhook op alles ? + \def\bskip + {\vtop\bgroup + \ifautotabulate\hsize\tabulatewidth\fi + % \begstrut % interferes with pre-\pars + % evt: \appendtoks\begstrut\to\everypar + \ignorespaces}% + \def\eskip % vertical strut added august 2003 + {\par\verticalstrut\vskip-\struttotal\egroup}% + \fi + \totalnoftabulatelines\noftabulatelines + \minusnoftabulatelines\numexpr\noftabulatelines+\minusone\relax + \global\noftabulatelines\zerocount + \def\doHL##1% ##1 ignored + {\TABLEnoalign + {\csname + \ifnum\noftabulatelines=\zerocount F\else + \ifnum\noftabulatelines=\totalnoftabulatelines L\else + M\fi\fi + L\endcsname}}% + \def\doHR##1% horizontal rule line (break untested) + {\TABLEnoalign + {\globallet\TABLEautoline\dotabulatelinerule + \ifcase##1\or + \ifnum\noftabulatelines=\zerocount + \gdef\TABLEautoline{\TABLEnoalign{}}% + \else\ifnum\noftabulatelines=\totalnoftabulatelines + \gdef\TABLEautoline{\TABLEnoalign{}}% + \fi\fi + \fi + \dotabulatenobreak}% + \TABLEautoline + \TABLEnoalign + {\nobreak + \ifx\TABLEautoline\dotabulatelinerule\kern-\lineheight\fi + \ifnum\noftabulatelines=\totalnoftabulatelines + \@EA\dotabulatenobreak + \else + \@EA\allowbreak + \fi}% + \TABLEautoline + \TABLEnoalign + {\dotabulatenobreak}}% + \doifelsevalue{\??tt\currenttabulate\c!rule}\v!line + {\let\HL \HR + \let\tabulateautoline\tabulateautorule + \let\tabulateline \tabulaterule}% + {\def\HL{\doHL\zerocount}}% + \def\tablebaselinecorrection + {\def\dobaselinecorrection + {\vskip-\prevdepth + \vskip\strutdp + \vskip\strutdp}% + \baselinecorrection}% + \def\FL{\TABLEnoalign + {\ifinsidefloat\else + \doifemptyvalue{\??tt\currenttabulate\c!before} % no expansion + {\tablebaselinecorrection}% + \fi + \dotabulaterule + \dotabulatenobreak + \dotabulateruleseperator + \prevdepth\strutdp + \dotabulatenobreak}}% + \def\ML{\TABLEnoalign + {\dotabulateruleseperator + \dotabulaterule + \ifnum\noftabulatelines>\plusone + \ifnum\noftabulatelines<\minusnoftabulatelines + \vskip\topskip\allowbreak\vskip-\topskip + \vskip-\tabulateparameter\c!rulethickness + \dotabulaterule + \fi + \fi + \dotabulateruleseperator}}% + \def\LL{\TABLEnoalign + {\dotabulatenobreak + \dotabulateruleseperator + \dotabulatenobreak + \dotabulaterule + \ifinsidefloat\else + \doifemptyvalue{\??tt\currenttabulate\c!after} % no expansion + {\vskip\strutdp + \verticalstrut + \vskip-\struttotal}% + \fi}}% + \let\tabulatepass\plustwo + % + \ifcase\tabulaterepeathead + \ifinsidesplitfloat + \setbox\tabulatebox\vbox \bgroup + \else + \startframedcontent[\tabulateparameter\c!frame]% + \fi + \else + \setbox\tabulatebox\vbox \bgroup + \fi + % + \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}% + \prevdepth\strutdp % nog eens beter, temporary hack + \doifvalue{\??tt\currenttabulate\c!distance}\v!grid + {\vskip-\strutdp}% experimental tm-prikkels + % + \ifcase\tabulaterepeathead + \ifinsidesplitfloat + \egroup \splittabulatebox\tabulatebox + \else + \stopframedcontent + \fi + \else + \egroup \splittabulatebox\tabulatebox + \fi + % + \egroup + \ifinsidefloat \else + \tabulateparameter\c!after + \fi + \egroup} + +\egroup + +% \setuptabulate[split=yes,header=text,title=Vervolg van Tabel] +% +% % \starttabulatehead +% % \NC test \NC hans\NC \NR +% % \stoptabulatehead +% +% \starttabulate +% \NC test \NC \input tufte \relax \NC \NR +% \NC test \NC \input knuth \relax \NC \NR +% \NC test \NC \input knuth \relax \NC \NR +% \NC test \NC \input tufte \relax \NC \NR +% \NC test \NC \input tufte \relax \NC \NR +% \NC test \NC \input tufte \relax \NC \NR +% \stoptabulate + +% \def\splittabulatebox#1% #1 <> 0/2 / derived from the one in core-ntb.tex +% {\ifinsidefloat +% \unvbox#1% +% \else +% \ifcase\tabulaterepeathead\or +% \setbox2\copy#1% +% \setbox2\vsplit2 to \lineheight +% \setbox2\vbox{\unvbox2}% +% \fi +% \doloop +% {\setbox0\vsplit#1 to \onepoint % \lineheight +% \ifdim\pagegoal<\maxdimen +% \donetrue +% \else\ifdim\pagetotal=\zeropoint +% \donetrue +% \else +% \donefalse +% \fi\fi +% \ifdone +% \setbox0\vbox{\unvbox0}% +% \dimen0\pagetotal +% \advance\dimen0\dp0 +% \advance\dimen0\ht0 +% \ifdim\dimen0>\pagegoal +% \bgroup \page \egroup % make sure that local vars are kept +% \ifcase\tabulaterepeathead\or +% \unvcopy2 +% \or +% \hbox{\strut\tabulateparameter\c!title}% +% \fi +% \fi +% \fi +% % test this on icare checklists / quite hacky ! ! ! +% \ifdim\ht0>\tabulateparameter\c!rulethickness\else +% \kern-2\ht0 % brrrr +% \fi +% % +% \unvbox0 +% \allowbreak +% \ifvoid#1 \exitloop \fi}% +% \fi} + +\def\splittabulatebox#1% #1 <> 0/2 / derived from the one in core-ntb.tex + {\ifinsidesplitfloat + \dosplittabulatebox#1% + \else\ifinsidefloat + \unvbox#1% + \else + \dosplittabulatebox#1% + \fi\fi} + +\def\dosplittabulatebox#1% + {\resettsplit + \def\tsplitminimumfreelines{2}% + \def\tsplitminimumfreespace{0pt}% + \setbox\tsplitcontent\box#1% + \ifcase\tabulaterepeathead\or + \setbox\tsplithead\vsplit\tsplitcontent to \lineheight + \setbox\tsplithead\vbox{\unvbox\tsplithead}% + \or + \setbox\tsplithead\vbox{\hbox{\strut\tabulateparameter\c!title}}% + \fi + \handletsplit} + +%D \starttyping +%D \setuptabulate[split=no,rule=line] +%D +%D \starttabulate +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \stoptabulate +%D \stoptyping + +% \starttabulatie[|mc|] +% \NC \digits{100.000,00} \NC\NR +% \NC \digits{@10.000,00} \NC\NR +% \NC \digits{@@@.100,00} \NC\NR +% \NC \digits{@@@.@10,@@} \NC\NR +% \NC \digits{@@@.@@1,@@} \NC\NR +% \stoptabulatie +% +% \starttabulatie[|mc|] +% \ND 100.000,00 \NC\NR +% \ND @10.000,00 \NC\NR +% \ND @@@.100,00 \NC\NR +% \ND @@@.@10,@@ \NC\NR +% \ND @@@.@@1,@@ \NC\NR +% \stoptabulatie +% +% \starttabulatie[|c|] +% \ND $100.000,00$ \NC\NR +% \ND $@10.000,00$ \NC\NR +% \ND $@@@.100,00$ \NC\NR +% \ND $@@@.@10,@@$ \NC\NR +% \ND $@@@.@@1,@@$ \NC\NR +% \stoptabulatie +% +% \starttabulatie[|c|] +% \NC $\digits 100.000,00 $ \NC\NR +% \NC $\digits @10.000,00 $ \NC\NR +% \NC $\digits @@@.100,00 $ \NC\NR +% \NC $\digits @@@.@10,@@ $ \NC\NR +% \NC $\digits @@@.@@1,@@ $ \NC\NR +% \stoptabulatie +% +% \starttabulatie[|c|] +% \NC \digits $100.000,00$ \NC\NR +% \NC \digits $@10.000,00$ \NC\NR +% \NC \digits $@@@.100,00$ \NC\NR +% \NC \digits $@@@.@10,@@$ \NC\NR +% \NC \digits $@@@.@@1,@@$ \NC\NR +% \stoptabulatie + +\def\setuptabulate + {\dotripleempty\dosetuptabulate} + +\def\dosetuptabulate[#1][#2][#3]% + {\ifthirdargument + \getparameters[\??tt#1::#2][#3]% + \else\ifsecondargument + \getparameters[\??tt#1::][#2]% + \else + \getparameters[\??tt\v!tabulate::][#1]% + \fi\fi} + +\setuptabulate + [\c!unit=1em, + EQ={:}, + \c!frame=\v!off, + \c!bodyfont=, + \c!rule=\v!normal, + \c!rulecolor=, + \c!rulethickness=\linewidth, + \c!inner=, + \c!before=\blank, + \c!after=\blank, + \c!distance={\v!depth,\v!medium}, + \c!align=\v!normal, + \c!margin=\!!zeropoint, + \c!split=\v!auto, + \c!header=\v!yes, + \c!title=, + \c!indenting=\v!no] + +\protect \endinput diff --git a/tex/context/base/tabl-tbl.mkiv b/tex/context/base/tabl-tbl.mkiv new file mode 100644 index 000000000..af2b50c86 --- /dev/null +++ b/tex/context/base/tabl-tbl.mkiv @@ -0,0 +1,1472 @@ +%D \module +%D [ file=core-tbl, +%D version=1998.11.03, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Text Flow Tabulation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Macros / Tabulation} + +% \processbetween gebruiken in head/tail macros + +\unprotect + +%D I can probably reimplement this using a \LUA||\TEX\ combination +%D but it does not pay of in development time. If I need something +%D else I will write it from scratch anyway. + +% watch out: don't change this model else trialtypesetting +% compatibility problems + +% watch out, cells expand pretty late on a per row basis + +% |p2|p3| 2:3 +% spanning + +% Be careful with changing the hsize calculation in p mode; +% the following code works quite well: +% +% \setupfield [line][location=low,height=1.2\lineheight,width=\hsize] +% \definefield [test] [line] [line] [] +% +% \starttabulate[|l|p|] +% \NC test \NC \field [test] \NC \NR +% \stoptabulate + +% In-text tabbing environment +% +% \starttabulate[| separated template] % eg [|l|p|] or [|l|p|p|] +% \NC ... \NC ... \NC\NR +% \stoptabulate +% +% with: two pass auto width calculation when no p-width +% specified, even with multiple p's, see examples. + +% TaBlE compatible specifications: +% +% l align column/paragraph left +% r align column/paragraph right +% c align column/paragraph center +% p p(dimen) of automatisch als alleen p +% w column width +% f font#1 +% B bold +% I italic +% S slanted +% T type +% R roman +% m math +% M display math +% h hook (inner level or par lines) +% b before (may be command#1) +% a after +% i i skip left of column +% j i skip right of column +% k i skip around column + +% s setups + +% g g{char} align at char +% . align at . +% , align at , + +% Still to be done + +% N math numbers (best hook into existing digits mechanism) +% n numbers (best hook into existing digits mechanism) +% Q math numbers (best hook into existing digits mechanism) +% q numbers (best hook into existing digits mechanism) +% ~ \hskip.5em +% | check + +% nesting + +% 10 evt auto stack; dan wel andere signal dan void nodig + +% present but not yet 100% ok +% +% \FL top hrule +% \ML mid hrule (with auto split) +% \LL bottom hrule +% \HL + +% \VL as soon as needed +% color as soon as needed + +% \EQ \RQ \HQ equal (raw, hook) +% \NC \RC \HC normal (raw, hook) +% +% \NR + +% \HR : rule with lineheight + +% \autotabulaterule : with lineheight, not first/last +% \autotabulateline : spaced, not first/last +% \tabulaterule : with lineheight +% \tabulateline : spaced + +% tricky: align scans ahead, over # and expands ones before +% while doing + +% new: +% +% \starttabulate[|cg{.}|cg{,}|cg{,}|] +% \NC period \NC comma \NC comma \NC\NR +% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR +% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR +% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR +% \NG 10 \NG 10 \NG 0,00 \NC\NR +% \stoptabulate +% +% \starttabulate[|c.|c,|c,|] +% \NC period \NC comma \NC comma \NC\NR +% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR +% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR +% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR +% \NG 10 \NG 10 \NG 0,00 \NC\NR +% \stoptabulate + +% nice demo (for BG) +% +% \starttabulate[|r|b{$\star$}|ra{\percent}|b{=}|r|] +% \NC 500 \NC \NC 60 \NC \NC 300 \NC \NR +% \NC 500 \NC \NC 55 \NC \NC 275 \NC \NR +% \NC 500 \NC \NC 50 \NC \NC 250 \NC \NR +% \NC 500 \NC \NC 45 \NC \NC 225 \NC \NR +% \NC 500 \NC \NC 40 \NC \NC 200 \NC \NR +% \NC 500 \NC \NC 35 \NC \NC 175 \NC \NR +% \NC 500 \NC \NC 30 \NC \NC 150 \NC \NR +% \NC 500 \NC \NC 25 \NC \NC 125 \NC \NR +% \NC 500 \NC \NC 20 \NC \NC 100 \NC \NR +% \stoptabulate + +\newtoks \tabulatepreamble +\newtoks \tabulatebefore +\newtoks \tabulateafter +\newtoks \tabulatebmath +\newtoks \tabulateemath +\newtoks \tabulatefont +\newtoks \tabulatesettings +\newtoks \tabulatedummy + +\newcount \nofautotabulate +\newcount \tabulatecolumns +\newcount \tabulatecolumn + +\newcount \tabulateminplines +\newcount \tabulatemaxplines + +\newif \ifautotabulate +\newif \ifsplittabulate \splittabulatetrue + +\newif \ifhandletabulatepbreak \handletabulatepbreaktrue +\newif \iftabulatenopbreak \tabulatenopbreakfalse + +\newif \iftabulateequal +\newif \iftracetabulate +\newif \ifframedtabulate + +\newdimen \tabulatepwidth +\newdimen \tabulatewidth +\newdimen \tabulateunit +\newdimen \tabulatemaxpheight + +\newbox \tabulatebox + +% [|lg{.}|] => \NG 12.34 \NC + +\gdef\handletabulatecharalign#1 % space delimited ! + {\edef\alignmentclass{\the\tabulatecolumn}% + \edef\alignmentcharacter{\csname\??tt:a:\the\tabulatecolumn\endcsname}% + \ifcase\tabulatepass\or + \setfirstpasscharacteralign\checkalignment{#1}% + \fi % force hsize + \setsecondpasscharacteralign\checkalignment{#1}} + +\def\noftabcolumns{16} + +\def\tablebox#1% + {\csname\??tt:b:\number#1\endcsname} + +\def\initializetablebox#1% also used elsewhere + {\ifcsname\??tt:b:\number#1\endcsname + \global\setbox\csname\??tt:b:\number#1\endcsname\emptybox + \else + \expandafter\newbox\csname\??tt:b:\number#1\endcsname + \fi} + +\def\initializetableboxes#1% + {\scratchcounter#1\relax + \doinitializetableboxes} + +\def\doinitializetableboxes + {\ifnum\scratchcounter>\zerocount + \initializetablebox\scratchcounter + \advance\scratchcounter\minusone + \expandafter\doinitializetableboxes + \fi} + +\initializetableboxes\noftabcolumns + +\def\dodotabulatenobreak + {\nobreak + \iftracetabulate + \red\hrule\!!height.5\linewidth\!!depth.5\linewidth + \par + \kern-\linewidth + \nobreak + \fi} + +\def\dotabulatenobreak + {\noalign{\dodotabulatenobreak}} + +\unexpanded\def\notabulatehook + {} + +\unexpanded\def\checktabulatehook + {\ifnum\tabulatetype<\plustwo + \glet\tabulatehook\notabulatehook + \else + \glet\tabulatehook\dotabulatehook + \fi} + +\unexpanded\def\checktabulatesetups + {\csname\??tt:s:\the\tabulatecolumn\endcsname} + +\let\pretabrule \donothing +\let\posttabrule\donothing + +% 0 = NC column next EQ equal column +% 1 = RC column raw RQ equal column raw +% 2 = HC column hook HQ equal column hook +% some entries can be left out if we test for them being set + +% \def\dodosettabulatepreamble#1#2% +% {\ifzeropt\tabulatewidth +% \ifcase\tabulatemodus\relax +% \let\preamblebox\empty +% \else +% \def\preamblebox{\autotabulatetrue}% +% \fi +% \else +% \ifcase\tabulatemodus\relax +% \edef\preamblebox{\hbox to \the\tabulatewidth}% +% \else +% \edef\preamblebox{\hsize\the\tabulatewidth}% +% \fi +% \fi +% % +% % less bytes +% % +% %\edef\preamblebox% +% % {\ifcase\tabulatewidth +% % \ifcase\tabulatemodus\relax\else\noexpand\autotabulatetrue\fi +% % \els +% % \ifcase\tabulatemodus\relax\hbox to\else\hsize\fi\the\tabulatewidth +% % \fi}% +% % +% \@EA\appendtoks \@EA&\@EA\hskip\pretabskip\pretabrule##&\to\!!toksa +% \appendtoks \ignorespaces\to\!!toksa +% \@EA\appendtoks\@EA\global\@EA\tabulatecolumn\the\tabulatecolumns\relax\to\!!toksa +% \appendtoks \checktabulatesetups\to\!!toksa +% \appendtoks \checktabulatehook\to\!!toksa +% \@EA\appendtoks \preamblebox\to\!!toksa +% \appendtoks \bgroup\bbskip\bgroup#1\to\!!toksa +% \appendtoks\ifnum\tabulatetype=\plusone \else \to\!!toksa +% \@EA\appendtoks \the\tabulatebmath\to\!!toksa +% \@EA\appendtoks \the\tabulatefont\to\!!toksa +% \@EA\appendtoks \the\tabulatesettings\to\!!toksa +% \@EA\appendtoks \the\tabulatebefore\to\!!toksa +% \appendtoks\fi \to\!!toksa +% \appendtoks \bgroup\ignorespaces\to\!!toksa +% % +% \appendtoks \tabulatehook##\to\!!toksa +% % +% %%\doifdefinedelse{\??tt:a:\tabulatecolumns} +% %\doifdefinedelse{\??tt:a:\the\tabulatecolumns} +% % {\appendtoks\handletabulatecharalign## \to\!!toksa} +% % {\appendtoks\tabulatehook ##\to \!!toksa}% +% % waarom kan ik hier geen \xx{##} geven, om een of +% % andere reden passeert dan tex de hele regel (incl \NC's) +% % als argument; elke delimiter <> space gaat trouwens fout +% \appendtoks \unskip\unskip\ifmmode\else\endgraf\fi\egroup\to\!!toksa +% \appendtoks\ifnum\tabulatetype=1 \else \to\!!toksa +% \@EA\appendtoks \the\tabulateafter\to\!!toksa +% \@EA\appendtoks \the\tabulateemath\to\!!toksa +% \appendtoks\fi \to\!!toksa +% \appendtoks #2\egroup\egroup\to\!!toksa +% \@EA\appendtoks \@EA&\@EA\posttabrule\@EA\hskip\postabskip##\to\!!toksa +% \appendtoks\NC\to\tabulatedummy +% \let\bbskip\empty +% \def\pretabskip{.5\tabulateunit}% +% \let\postabskip\pretabskip +% \let\gettabulateexit\dogettabulateexit +% \tabulatewidth\zeropoint} +% +% speedup: + +% is grouping really needed here? + +\unexpanded\def\beforetabulateentry{\ignorespaces\tabulatehook} +\unexpanded\def\aftertabulateentry {\unskip\unskip\ifmmode\else\endgraf\fi} + +\def\dodosettabulatepreamble#1#2% only makes sense for many tabulates + {\normalexpanded{\!!toksa{\the\!!toksa + &\hskip\pretabskip\noexpand\pretabrule##&% + % \ignorespaces + \global\tabulatecolumn\the\tabulatecolumns\relax + \checktabulatesetups % unexpandable + \checktabulatehook % unexpandable + \ifzeropt\tabulatewidth + \ifcase\tabulatemodus\else + \noexpand\autotabulatetrue + \fi + \else + \ifnum\tabulatemodus=\zeropoint + \hbox to + \else + \hsize + \fi + \the\tabulatewidth + \fi + \bgroup + \noexpand\bbskip + \bgroup % we cannot combine the if because a cell may have only one ## + \noexpand#1% + \noexpand\ifnum\noexpand\tabulatetype=\plusone\noexpand\else + \the\tabulatebmath + \the\tabulatefont + \the\tabulatesettings + \the\tabulatebefore + \noexpand\fi + % grouping needs to be outside macros (or expandable), nice test + % example \NC \string & \NC which will fail otherwise (mk) + \bgroup + \beforetabulateentry + ##% + \aftertabulateentry + \egroup + \noexpand\ifnum\noexpand\tabulatetype=\plusone\noexpand\else + \the\tabulateafter + \the\tabulateemath + \noexpand\fi + \noexpand#2% + \egroup + \egroup + &\noexpand\posttabrule\hskip\postabskip##% + }}% + \appendtoks\NC\to\tabulatedummy + \let\bbskip\empty % ? + \def\pretabskip{.5\tabulateunit}% + \let\postabskip\pretabskip + \let\gettabulateexit\dogettabulateexit + \tabulatewidth\zeropoint} + +\setvalue{\??tt>\meaning x}{\let\tabulatealign\zerocount\settabulatepreamble} % internal +\setvalue{\??tt>\meaning l}{\let\tabulatealign\plusone\settabulatepreamble} +\setvalue{\??tt>\meaning r}{\let\tabulatealign\plustwo\settabulatepreamble} +\setvalue{\??tt>\meaning c}{\let\tabulatealign\plusthree\settabulatepreamble} +\setvalue{\??tt>\meaning p}{\gettabulateparagraph} +\setvalue{\??tt>\meaning s}{\gettabulatesetups} +\setvalue{\??tt>\meaning w}{\gettabulatewidth} +\setvalue{\??tt>\meaning f}{\gettabulatefont} +\setvalue{\??tt>\meaning B}{\tabulatefont{\bf}\settabulatepreamble} +\setvalue{\??tt>\meaning I}{\tabulatefont{\it}\settabulatepreamble} +\setvalue{\??tt>\meaning S}{\tabulatefont{\sl}\settabulatepreamble} +\setvalue{\??tt>\meaning T}{\tabulatefont{\tt}\settabulatepreamble} +\setvalue{\??tt>\meaning R}{\tabulatefont{\rm}\settabulatepreamble} +\setvalue{\??tt>\meaning m}{\tabulatebmath{$}\tabulateemath{$}\settabulatepreamble} +\setvalue{\??tt>\meaning M}{\tabulatebmath{$\displaystyle}\tabulateemath{$}\settabulatepreamble} +\setvalue{\??tt>\meaning h}{\gettabulatehook} +\setvalue{\??tt>\meaning b}{\gettabulatebefore} +\setvalue{\??tt>\meaning a}{\gettabulateafter} +\setvalue{\??tt>\meaning i}{\gettabulatepreskip} +\setvalue{\??tt>\meaning j}{\gettabulateposskip} +\setvalue{\??tt>\meaning k}{\gettabulatepreposskip} +\setvalue{\??tt>\meaning X}{\gettabulateexit} % internal +\setvalue{\??tt>\meaning e}{\appendtoks\global\tabulateequaltrue\to\tabulatesettings\settabulatepreamble} +\setvalue{\??tt>\meaning ~}{\appendtoks\fixedspaces\to\tabulatesettings\settabulatepreamble} +\setvalue{\??tt>\meaning g}{\gettabulatealign} +\setvalue{\??tt>\meaning .}{\gettabulatealign.} +\setvalue{\??tt>\meaning ,}{\gettabulatealign,} + +\setvalue{\??tt>\s!unknown}{\message{unknown preamble key [\meaning\next]}\settabulatepreamble} +\letvalue{\??tt>\meaning\relax}\donothing + +\def\dosettabulatepreamble + {\csname\??tt>\ifcsname\??tt>\meaning\next\endcsname\meaning\next\else\s!unknown\fi\endcsname} + +\def\dogettabulateexit + {\let\postabskip\!!zeropoint + \settabulatepreamble} + +\let\gettabulateexit\dogettabulateexit + +\def\gettabulatepreskip#1% + {\doifnumberelse{#1} + {\edef\pretabskip{\the\dimenexpr#1\tabulateunit}\let\next\empty} + {\edef\pretabskip{\the\dimenexpr.5\tabulateunit}\def\next{#1}}% + \@EA\settabulatepreamble\next} + +\def\gettabulateposskip#1% + {\doifnumberelse{#1} + {\edef\postabskip{\the\dimexpr#1\tabulateunit}\let\next\empty} + {\edef\postabskip{\the\dimexpr.5\tabulateunit}\def\next{#1}}% + \let\gettabulateexit\settabulatepreamble + \@EA\settabulatepreamble\next} + +\def\gettabulatepreposskip#1% + {\doifnumberelse{#1} + {\edef\pretabskip{\the\dimenexpr#1\tabulateunit}\let\next\empty} + {\edef\pretabskip{\the\dimenexpr.5\tabulateunit}\def\next{#1}}% + \let\postabskip\pretabskip + \let\gettabulateexit\settabulatepreamble + \@EA\settabulatepreamble\next} + +\def\gettabulatesetups#1% + {\setvalue{\??tt:s:\the\tabulatecolumns}{\setups[#1]}% + \settabulatepreamble} + +\def\gettabulatehook#1% + {\setvalue{\??tt:h:\the\tabulatecolumns}{#1}% + \settabulatepreamble} + +\def\gettabulatealign#1% + {\setvalue{\??tt:a:\the\tabulatecolumns}{#1}% + \settabulatepreamble} + +\def\gettabulatebefore#1% + {\tabulatebefore{#1}% + \settabulatepreamble} + +\def\gettabulateafter#1% + {\tabulateafter{#1}% + \settabulatepreamble} + +\def\gettabulatefont#1% + {\tabulatefont{#1}% + \settabulatepreamble} + +\def\gettabulatewidth + {\let\tabulatemodus\zerocount + \let\tabulatedimen\zerocount + \doifnextparenthesiselse\dogettabulatewidth\settabulatepreamble} + +\def\gettabulateparagraph + {\doifnextparenthesiselse + {\let\tabulatemodus\plusone + \let\tabulatedimen\plusone + \dogettabulatewidth} + {\let\tabulatemodus\plustwo + \let\tabulatedimen\zerocount + \settabulatepreamble}} + +% \startbuffer +% \toplinebox{\framed[width=3cm,height=2cm]{tufte}} +% \stopbuffer +% \starttabulate[|p(fixed)|p|] +% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR} +% \stoptabulate +% \starttabulate[|p(fit)|p|] +% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR} +% \stoptabulate + +\def\dogettabulatewidth(#1)% + {\processallactionsinset % can be made faster + [#1]% + [ \v!fit=>\let\tabulatemodus\plusthree, + \v!fixed=>\let\tabulatemodus\plusthree + \tabulatenopbreaktrue, + \s!unknown=>\tabulatewidth#1\relax]% + \ifnum\tabulatedimen=\plusone + \global\advance\tabulatepwidth\tabulatewidth + \fi + \settabulatepreamble} + +\def\settabulatepreamble + {\afterassignment\dosettabulatepreamble\let\next=} + +\def\tabulateraggedright {\ifnum\tabulatetype=\plusone \else\raggedright \fi} +\def\tabulateraggedcenter{\ifnum\tabulatetype=\plusone \else\raggedcenter\fi} +\def\tabulateraggedleft {\ifnum\tabulatetype=\plusone \else\raggedleft \fi} +\def\tabulatenotragged {\ifnum\tabulatetype=\plusone \else\notragged \fi} +\def\tabulatehss {\ifnum\tabulatetype=\plusone \else\hss \fi} % never change this to a fill + +\def\tabulatebskipraggedright {\bskip\tabulateraggedright } +\def\tabulatebskipraggedleft {\bskip\tabulateraggedleft } +\def\tabulatebskipraggedcenter{\bskip\tabulateraggedcenter} + +\def\tabulatesetpreamblewidthnormal + {\ifcase\tabulatealign\relax + \dodosettabulatepreamble\empty \tabulatehss \or + \dodosettabulatepreamble\empty \tabulatehss \or + \dodosettabulatepreamble\tabulatehss\empty \or + \dodosettabulatepreamble\tabulatehss\tabulatehss \fi} + +\def\tabulatesetpreamblewidthfixed + {\ifcase\tabulatealign\relax + \dodosettabulatepreamble\bskip \eskip \or + \dodosettabulatepreamble\tabulatebskipraggedright \eskip \or + \dodosettabulatepreamble\tabulatebskipraggedleft \eskip \or + \dodosettabulatepreamble\tabulatebskipraggedcenter\eskip \fi} + +\def\tabulatesetpreamblewidthauto + {\global\advance\nofautotabulate\plusone + \ifcase\tabulatealign\relax + \dodosettabulatepreamble\bskip \eskip \or + \dodosettabulatepreamble\tabulatebskipraggedright \eskip \or + \dodosettabulatepreamble\tabulatebskipraggedleft \eskip \or + \dodosettabulatepreamble\tabulatebskipraggedcenter\eskip \fi} + +\def\tabulatesetpreamblewidthsimple + {\dodosettabulatepreamble\xbskip\xeskip} + +\bgroup \catcode`\|=\@@other + +\gdef\nexttabulate#1|% + {\let\tabulatealign\@@tabulatealign + \let\tabulatemodus\zerocount + \let\tabulatedimen\zerocount + \tabulatebefore \emptytoks + \tabulateafter \emptytoks + \tabulatebmath \emptytoks + \tabulateemath \emptytoks + \tabulatefont \emptytoks + \tabulatesettings\emptytoks + \global\advance\tabulatecolumns\plusone + \expandafter\let\csname\??tt:s:\the\tabulatecolumns\endcsname\donothing + \settabulatepreamble#1\relax\relax % permits i without n + \ifcase\tabulatemodus\relax + \tabulatesetpreamblewidthnormal + \or % fixed width + \tabulatesetpreamblewidthfixed + \or % auto width + \tabulatesetpreamblewidthauto + \or % simple + \tabulatesetpreamblewidthsimple + \fi + \futurelet\next\donexttabulate} + +\egroup + +\def\donexttabulate + {\ifx\next\relax\else + \expandafter\nexttabulate + \fi} + +\def\splitofftabulatebox % overloaded in anch-pgr + {\dontcomplain + \global\setbox\tabulatebox % % % global ? % % % + \vsplit\tablebox\tabulatecolumn to \lineheight + \setbox\tabulatebox\normalvbox + {\unvbox\tabulatebox}% + \setbox\tabulatebox\hbox to \wd\tabulatebox + {\hss\dotabulatehook{\box\tabulatebox}\hss}% + \ht\tabulatebox\strutht + \dp\tabulatebox\strutdp + \box\tabulatebox} + +\def\dotabulatehook {\csname\??tt:h:\the\tabulatecolumn\endcsname} +\def\dotabulatealign{\csname\??tt:a:\the\tabulatecolumn\endcsname} + +\def\resettabulatepheight + {\global\tabulateminplines\plusone + \ifdim\tabulatemaxpheight>\zeropoint + \getnoflines\tabulatemaxpheight + \global\tabulatemaxplines\noflines + \else + \global\tabulatemaxplines\zerocount + \fi + \global\tabulatemaxpheight\zeropoint} + +\def\settabulatepheight + {\scratchdimen\ht\tablebox\tabulatecolumn\relax + \ifdim\scratchdimen>\tabulatemaxpheight + \global\tabulatemaxpheight\scratchdimen + \fi} + +% \def\handletabulatepbreak +% {\TABLEnoalign +% {\ifhandletabulatepbreak +% \iftabulatenopbreak +% \dotabulatenobreak +% \else\ifnum\tabulatemaxplines>\plusone +% \ifnum\tabulateminplines=\plusone +% \dotabulatenobreak +% \fi +% \global\advance\tabulateminplines\plusone +% \ifnum\tabulateminplines=\tabulatemaxplines\relax +% \dotabulatenobreak +% \fi +% \fi \fi +% \fi}} + +\def\dohandletabulatepbreak + {\ifhandletabulatepbreak + \iftabulatenopbreak + \dotabulatenobreak + \else\ifnum\tabulatemaxplines>\plusone + \ifnum\tabulateminplines=\plusone + \dotabulatenobreak + \fi + \global\advance\tabulateminplines\plusone + \ifnum\tabulateminplines=\tabulatemaxplines\relax + \dotabulatenobreak + \fi + \fi \fi + \fi} + +\def\handletabulatepbreak + {\TABLEnoalign{\dohandletabulatepbreak}} + +%D \startbuffer +%D \starttabulate[|c|p|p|] +%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR +%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR +%D \NC 2 \NC \thinrules[n=3] \NC \thinrules[n=3] \NC\NR +%D \NC 3 \NC oh yes \NC simply no \NC\NR +%D \NC 4 \NC very true \NC as false as can be \NC\NR +%D \NC 5 \NC \thinrules[n=5] \NC \thinrules[n=5] \NC\NR +%D \NC 6 \NC \thinrules[n=3] \NC \thinrules[n=4] \NC\NR +%D \stoptabulate +%D \stopbuffer +%D +%D \typebuffer {\tracetabulatetrue\getbuffer} +%D +%D \startbuffer +%D \starttabulate[|c|p|p|] +%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR +%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR +%D \NC 2 \NC oh yes \NC simply no \NC\NR +%D \NC 3 \NC very true \NC as false as can be \NC\NR +%D \NC 4 \NC the whole truth \NC but the truth \NC\NR +%D \stoptabulate +%D \stopbuffer +%D +%D \typebuffer {\tracetabulatetrue\getbuffer} + +% \definetabulate +% \redefinetabulate +% \starttabulate[preamble] +% \starttabulate -> \starttabulate[|l|p|] + +\bgroup \catcode`\|=\@@other + +\gdef\definetabulate + {\dotripleempty\dodefinetabulate} + +\gdef\dodefinetabulate[#1][#2][#3]% + {\ifthirdargument + \ifcsname\??tt#1::\c!unit\endcsname \else + \copyparameters + [\??tt#1::][\??tt\v!tabulate::]% + [\c!frame,\c!distance,\c!unit,\c!before,\c!bodyfont,\c!after, + \c!inner,\c!indenting,\c!margin,\c!align,\c!header,\c!title, + \c!rulecolor,\c!rulethickness,\c!split,EQ]% + \fi + \copyparameters + [\??tt#1::#2][\??tt#1::]% + [\c!unit,\c!distance,\c!before,\c!bodyfont,\c!after, + \c!inner,\c!indenting,\c!frame,\c!split,\c!header,\c!title, + \c!margin,\c!align,\c!rulecolor,\c!rulethickness,EQ]% + \setvalue{\e!start#1::#2}{\dofinalstarttabulate[#1][#2][#3]}% + \setvalue{\e!start#1}{\bgroup\dosubstarttabulate[#1]}% + \letvalue{\??tt#1-\v!header}\empty + \letvalue{\??tt#1-\v!footer }\empty + \else\ifsecondargument + \definetabulate[#1][][#2]% + \else + \definetabulate[#1][][|l|p|]% + \fi\fi} + +\egroup + +\let\tabulateheadcontent\empty +\let\tabulatetailcontent\empty + +\newconditional\tabulatesomeamble + +\def\processtabulateheadcontent + {\TABLEnoalign{\global\settrue\tabulatesomeamble}% + \csname\??tt\currenttabulate-\v!header\endcsname + \TABLEnoalign{\global\setfalse\tabulatesomeamble}}% + +\def\processtabulatetailcontent + {\TABLEnoalign{\global\settrue\tabulatesomeamble}% + \csname\??tt\currenttabulate-\v!footer\endcsname + \TABLEnoalign{\global\setfalse\tabulatesomeamble}}% + +\def\checkfulltabulatecontent % - needed, else confusion with \c!header + {\ifcsname\??tt\currenttabulate-\v!header\endcsname + \let\tabulateheadcontent\processtabulateheadcontent + \else + \let\tabulateheadcontent\empty + \fi + \ifcsname\??tt\currenttabulate-\v!footer\endcsname + \let\tabulatetailcontent\processtabulatetailcontent + \else + \let\tabulatetailcontent\empty + \fi} + +% \def\fulltabulatecontent +% {\tabulateheadcontent +% \tabulatecontent +% \tabulatetailcontent} + +\def\fulltabulatecontent + {\tabulateheadcontent + \tabulatecontent + \tabulatetailcontent + \removefunnytabulateline} + +\def\removefunnytabulateline + {\ifhmode + \strut\crcr + \TABLEnoalign{\kern-\lineheight}% + \fi} + +\setvalue{\e!start\v!tabulatehead}% + {\dosingleempty\dostartstarttabulatehead} + +\def\dostartstarttabulatehead[#1]% + {\processcontent{\e!stop\v!tabulatehead}\next + {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!header}\next}} + +\setvalue{\e!start\v!tabulatetail}% + {\dosingleempty\dostartstarttabulatetail} + +\def\dostartstarttabulatetail[#1]% + {\processcontent{\e!stop\v!tabulatetail}\next + {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!footer}\next}} + +\def\dosubstarttabulate + {\dodoubleempty\dodosubstarttabulate} + +\def\dodosubstarttabulate[#1][#2]% + {\csname\e!start#1::\ifcsname\e!start#1::#2\endcsname#2\fi\endcsname} + +\setvalue{\e!start\v!tabulate}% + {\bgroup\dodoubleempty\donormalstarttabulate} + +\bgroup + +\gdef\donormalstarttabulate[#1][#2]% + {\ifsecondargument + \getparameters[\??tt\v!tabulate::][#2]% + \fi + \iffirstargument + \def\next{\dofinalstarttabulate[\v!tabulate][][#1]}% + \else + \def\next{\dofinalstarttabulate[\v!tabulate][][|l|p|]}% + \fi + \next} + +\egroup + +% The much neede hook: + +\newtoks\everytabulate + +% An example of its usage: + +\appendtoks \optimizeverbatimfalse \to \everytabulate +\appendtoks \let\recodeverbatimmode\plustwo \to \everytabulate + +% A status variable: + +\chardef\tabulatepass=0 + +\def\tabulateparameter#1{\csname\??tt\currenttabulate#1\endcsname} + +\bgroup + \catcode`\|=\@@other \gdef\@@otherbar{|} + \catcode`\|=\@@active \gdef\@@useotherbar{\let|\@@otherbar} +\egroup + +\def\doparsetabulate + {\futurelet\next\dodoparsetabulate} + +\def\dodoparsetabulate % \@EAEAEA gebruiken + {\ifx\next\relax + % exit + \else\ifx*\next + \let\next\dorepeatparsetabulate + \else\ifx\bgroup\next + \let\next\dododoparsetabulate + \else + \let\next\dodododoparsetabulate + \fi\fi\fi + \next}% + +\def\dorepeatparsetabulate*#1#2% + {\dorecurse{#1}{\!!toksb\expandafter{\the\!!toksb#2}}% \dorecurse{#1}{\appendtoks#2\to\!!toksb}% + \doparsetabulate} + +\def\dododoparsetabulate#1% + {\!!toksb\expandafter{\the\!!toksb{#1}}% \appendtoks{#1}\to\!!toksb + \doparsetabulate} + +\def\dodododoparsetabulate#1% + {\!!toksb\expandafter{\the\!!toksb#1}% \appendtoks#1\to\!!toksb + \doparsetabulate} + +\setvalue{\??tt:\c!split:\v!yes }{\splittabulatetrue} +\setvalue{\??tt:\c!split:\v!repeat}{\splittabulatetrue} +\setvalue{\??tt:\c!split:\v!no }{\splittabulatefalse} +\setvalue{\??tt:\c!split:\v!auto }{\ifinsidefloat\ifinsidesplitfloat\else\splittabulatefalse\fi\fi} + +\def\dofinalstarttabulate[#1][#2][#3]% identifier sub preamble + {\edef\currenttabulate{#1::#2}% + \ifinsidefloat \else + \whitespace + \tabulateparameter\c!before + \fi + \bgroup + \resetcharacteralign + % todo: spacing around tabulate when bodyfont is set + % expansion en test needed ? + \splittabulatetrue + \csname\??tt:\c!split:\tabulateparameter\c!split\endcsname + \doifvaluesomething{\??tt\currenttabulate\c!bodyfont} + {\expanded{\switchtobodyfont[\tabulateparameter\c!bodyfont]}}% + \postponenotes % new, to be tested / will be configurable + \let\tabulatepass\plusone + \widowpenalty\zerocount % otherwise lines are not broken + \clubpenalty \zerocount % but overlap in funny ways + \the\everytabulate + \tabulateparameter\c!inner + \doifelsevalue{\??tt\currenttabulate\c!indenting}\v!yes + {\edef\tabulateindent{\the\dimexpr\leftskip+\hangindent+\parindent}}% \ctxparindent + {\edef\tabulateindent{\the\dimexpr\leftskip+\hangindent }}% + \global\tabulatecolumn\zerocount + \!!toksb\emptytoks + \bgroup + \@@useotherbar + \normalexpanded{\egroup\noexpand\doparsetabulate#3\relax}% + \processcontent + {\e!stop#1}% \currenttabulate} + \tabulatecontent + {\@EA\processtabulate\@EA[\the\!!toksb]}} + +\chardef\tabulatetype=0 + +% 0 = NC column next EQ equal column +% 1 = RC column raw RQ equal column raw +% 2 = HC column hook HQ equal column hook + +\newif\iftabulatefirstflushed + +\def\tabulateEQ + {\iftabulatefirstflushed\else\tabulateparameter{EQ}\fi + \global\tabulateequalfalse} + +% \def\tabulatenormalcolumn#1% +% {&\iftabulateequal\tabulateEQ\fi&\global\chardef\tabulatetype#1&} +% +% \def\tabulateequalcolumn#1% +% {&\tabulateEQ&\global\chardef\tabulatetype#1&} +% +% however, \unskip en \ignorespaces permit usage in complex XML/\starttabulate + +\def\tabulatenormalcolumn#1% + {\unskip&\iftabulateequal\tabulateEQ\fi&\global\chardef\tabulatetype#1&% + \ignorespaces} + +\def\tabulateequalcolumn#1% + {\unskip&\tabulateEQ&\global\chardef\tabulatetype#1&% + \ignorespaces} + +\def\tabulateautocolumn + {\tabulatenormalcolumn\zerocount + \ifnum\tabulatecolumn>\tabulatecolumns\relax + \expandafter\NR + \else + \expandafter\ignorespaces % interferes with the more tricky hooks + \fi} + +\def\setquicktabulate#1% see \startlegend \startgiven + {\let#1\tabulateautocolumn + \let\\\tabulateautocolumn} + +\def\dotabulateruleseperator % can be sped up (will do when used frequently) + {\bgroup + \let\factor\!!plusone + \scratchskip\strutdp + \ExpandFirstAfter\processallactionsinset + [\tabulateparameter\c!distance] + [ \v!blank=>\scratchskip\bigskipamount, + \v!depth=>\scratchskip\strutdp, + \v!small=>\def\factor{.25}, + \v!medium=>\def\factor{.5}, + \v!big=>, + \v!none=>\scratchskip\zeropoint\def\factor{0}, + \v!grid=>\scratchskip\zeropoint\def\factor{0}, + \s!unknown=>\scratchskip\commalistelement]% + \scratchdimen\factor\scratchskip + \ifconditional\tabulatesomeamble\kern\else\vskip\fi\scratchdimen % new + \egroup} + +\def\dodotabulaterule#1% + {\color + [\tabulateparameter\c!rulecolor] + {\scratchdimen\tabulateparameter\c!rulethickness#1}} + +\def\dotabulaterule + {\dodotabulaterule + {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax + \doifvalue{\??tt\currenttabulate\c!distance}\v!grid + {\kern-\scratchdimen}}} % experimental tm-prikkels + +\def\dotabulatelinerule + {\multispan\totaltabulatecolumns % \multispan is a plain macro + % for the moment this one + \strut\hskip\tabulateparameter\c!margin + % neg values are ok ! + \hskip\tabulateindent % new august 2003 + \dodotabulaterule + {\!!heighta.5\lineheight + \advance\!!heighta-\strutdepth + \!!deptha-\!!heighta + \advance\!!deptha\scratchdimen + \leaders\hrule\!!height\!!heighta\!!depth\!!deptha\hfill}% + \cr} + +%D When set to true, no (less) break optimization is done. + +\newif\iftolerantTABLEbreak + +%D The main processing macro is large but splitting it up +%D would make things less clear. + +\def\doregistertabulateparoptions + {\iftrialtypesetting \else + \registerparoptions + \ifinsidefloat + % that is, an unbreakable one + \glet\registertabulateparoptions\empty + \else + % unsafe in crossing pages, at each b... + % \glet\registertabulateparoptions\empty + \fi + \fi} + +\appendtoks + \glet\registertabulateparoptions\doregistertabulateparoptions +\to \everytabulate + +\newtoks\everytabulaterow + +\appendtoks + \registertabulateparoptions +\to \everytabulaterow + +\def\flushtabulateindent + {\ifnum\tabulatecolumn=\zerocount + \hbox to \tabulateindent + {% we now have a local hsize, and since we want to + % register positional info (i.e. real hsizes) we + % need to reconstitute the original hsize + \advance\hsize\tabulateindent + % this is indeed rather messy and took a few hours + % to dis/uncover + \the\everytabulaterow + \hss}% + \fi} + +\def\totaltabulatecolumns{0} + +\def\handletabulatedigits{\digits} + +%D Beware, we cannot use \type {\unexpanded} on \type {\HL} +%D cum suis, since \TEX's hard coded noalign lookahead fails +%D on it! I mistakenly added this for a while. + +\chardef\tabulaterepeathead\zerocount + +\newcount\noftabulatelines +\newcount\totalnoftabulatelines +\newcount\minusnoftabulatelines + +\setvalue{\??tt:\c!align:\v!normal}{0} +\setvalue{\??tt:\c!align:\v!right }{1} +\setvalue{\??tt:\c!align:\v!left }{2} +\setvalue{\??tt:\c!align:\v!middle}{3} + +\setvalue{\??tt:\c!header:\v!repeat}{\plusone} +\setvalue{\??tt:\c!header:\v!text }{\plustwo} + +\newtoks\everyaftertabulaterow + +\def\tabulatebskipone {\setbox\tabulatebox\vbox\bgroup\glet\tabulatehook\notabulatehook} +\def\tabulateeskipone {\par\egroup\glet\tabulatehook\dotabulatehook} +\def\tabulatexbskipone{\hbox\bgroup\vbox\bgroup\glet\tabulatehook\notabulatehook} +\def\tabulatexeskipone{\par\egroup\egroup\glet\tabulatehook\dotabulatehook} + +\def\tabulatebaselinecorrection + {\def\dobaselinecorrection + {\vskip-\prevdepth + \vskip\strutdp + \vskip\strutdp}% + \baselinecorrection} + +\unexpanded\def\tabulateNCone{\tabulatenormalcolumn0} +\unexpanded\def\tabulateRCone{\tabulatenormalcolumn1} +\unexpanded\def\tabulateHCone{\tabulatenormalcolumn2} +\unexpanded\def\tabulateEQone{\tabulateequalcolumn 0} +\unexpanded\def\tabulateRQone{\tabulateequalcolumn 1} +\unexpanded\def\tabulateHQone{\tabulateequalcolumn 2} +\unexpanded\def\tabulateNGone{\NC\handletabulatecharalign} +\unexpanded\def\tabulateNNone{\NC\handletabulatedigits} % new, undocumented, test first +\unexpanded\def\tabulateNDone{\NC\handletabulatedigits} % same, for old times sake +\unexpanded\def\tabulateHRone{\doHR\zerocount} +\unexpanded\def\tabulateHLone{\doHL\zerocount} + +\unexpanded\def\tabulateNRone % next row + {\global\advance\noftabulatelines\plusone + \global\tabulatefirstflushedfalse + \global\tabulateequalfalse + \global\tabulatecolumn\zerocount + \resettabulatepheight + \unskip\unskip\crcr\flushtabulated + \TABLEnoalign + {\the\everyaftertabulaterow}% + \TABLEnoalign + {\iftolerantTABLEbreak\else + \ifconditional\tabulatesomeamble \ifcase\tabulaterepeathead \else + \allowbreak + \fi \fi + \ifnum\noftabulatelines=\plusone + \dotabulatenobreak + \else\ifnum\noftabulatelines=\minusnoftabulatelines + \ifnum\tabulatemaxplines<\plustwo + \dotabulatenobreak + \else + \allowbreak % needed with pbreak prevention + \fi + \else + \allowbreak % needed with pbreak prevention + \fi\fi + \fi + \global\tabulatefirstflushedfalse}} + +\def\tabulatebbskiptwo + {\ifvoid\tablebox\tabulatecolumn + \ifx\flushtabulatedindeed\empty\else + \setbox0\hbox + \fi + \fi} + +\def\tabulatebskiptwoeskip + {\par\egroup + \settabulatepheight + \glet\tabulatehook\dotabulatehook + \splitofftabulatebox} + +\def\tabulatebskiptwo + {\ifvoid\tablebox\tabulatecolumn + \global\setbox\tablebox\tabulatecolumn\vbox + \bgroup + \glet\tabulatehook\notabulatehook + \ifautotabulate\hsize\tabulatewidth\fi + % \begstrut % interferes with pre-\pars + % evt: \appendtoks\begstrut\to\everypar + \ignorespaces + \let\eskip\tabulatebskiptwoeskip + \else + \let\eskip\empty + \dontcomplain + \glet\tabulatehook\dotabulatehook + \expandafter\splitofftabulatebox + \fi} + +\def\tabulatexbskiptwo{\bskip} +\def\tabulatexeskiptwo{\eskip} + +% \def\tabulateflushtabulatedtwo +% {\TABLEnoalign % noalign % no interference ! +% {\glet\flushtabulatedindeed\empty +% \global\tabulatecolumn\zerocount +% \handletabulatepbreak +% \dorecurse\tabulatecolumns % was: \noftabcolumns +% {\ifvoid\tablebox\recurselevel\else +% \gdef\flushtabulatedindeed{\the\tabulatedummy}% +% \fi}% +% \global\tabulatefirstflushedtrue}% +% \flushtabulatedindeed} + +\def\dotabulateflushtabulatedtwo + {\glet\flushtabulatedindeed\empty + \global\tabulatecolumn\zerocount + \handletabulatepbreak + \dorecurse\tabulatecolumns % was: \noftabcolumns + {\ifvoid\tablebox\recurselevel\else + \gdef\flushtabulatedindeed{\the\tabulatedummy}% + \fi}% + \global\tabulatefirstflushedtrue} + +\def\tabulateflushtabulatedtwo + {\TABLEnoalign{\dotabulateflushtabulatedtwo}% + \flushtabulatedindeed} + +\def\tabulatebskipthree + {\vtop\bgroup + \ifautotabulate\hsize\tabulatewidth\fi + % \begstrut % interferes with pre-\pars + % evt: \appendtoks\begstrut\to\everypar + \ignorespaces} + +\def\tabulateeskipthree % vertical strut added august 2003 + {\par\verticalstrut\vskip-\struttotal\egroup} + +\def\tabulatedoHLfour#1% #1 ignored + {\TABLEnoalign + {\csname + \ifnum\noftabulatelines=\zerocount F\else + \ifnum\noftabulatelines=\totalnoftabulatelines L\else + M\fi\fi + L\endcsname}}% + +\def\tabulatedoHRfour#1% horizontal rule line (break untested) + {\TABLEnoalign + {\globallet\TABLEautoline\dotabulatelinerule + \ifcase#1\or + \ifnum\noftabulatelines=\zerocount + \gdef\TABLEautoline{\TABLEnoalign{}}% + \else\ifnum\noftabulatelines=\totalnoftabulatelines + \gdef\TABLEautoline{\TABLEnoalign{}}% + \fi\fi + \fi + \dotabulatenobreak}% + \TABLEautoline + \TABLEnoalign + {\nobreak + \ifx\TABLEautoline\dotabulatelinerule\kern-\lineheight\fi + \ifnum\noftabulatelines=\totalnoftabulatelines + \@EA\dotabulatenobreak + \else + \@EA\allowbreak + \fi}% + \TABLEautoline + \TABLEnoalign + {\dotabulatenobreak}} + +\def\tabulateFLfive{\TABLEnoalign + {\ifinsidefloat\else + \doifemptyvalue{\??tt\currenttabulate\c!before} % no expansion + {\tabulatebaselinecorrection}% + \fi + \dotabulaterule + \dotabulatenobreak + \dotabulateruleseperator + \prevdepth\strutdp + \dotabulatenobreak}} + +\def\tabulateMLfive{\TABLEnoalign + {\dotabulateruleseperator + \dotabulaterule + \ifnum\noftabulatelines>\plusone + \ifnum\noftabulatelines<\minusnoftabulatelines + \vskip\topskip\allowbreak\vskip-\topskip + \vskip-\tabulateparameter\c!rulethickness + \dotabulaterule + \fi + \fi + \dotabulateruleseperator}} + +\def\tabulateLLfive{\TABLEnoalign + {\dotabulatenobreak + \dotabulateruleseperator + \dotabulatenobreak + \dotabulaterule + \ifinsidefloat\else + \doifemptyvalue{\??tt\currenttabulate\c!after} % no expansion + {\vskip\strutdp + \verticalstrut + \vskip-\struttotal}% + \fi}} + +\def\tabulateHLfive + {\doHL\zerocount} + +\def\tabulaterule {\HR}% a rule with lineheight +\def\tabulateline {\HL}% just a spaced rule +\def\tabulateautorule{\doHR\plusone}% +\def\tabulateautoline{\doHL\plusone}% + +\bgroup \catcode`\|=\@@other + +\gdef\processtabulate[|#1|]% in the process of optimizing + {\tabulateunit\tabulateparameter\c!unit + \checkfulltabulatecontent + \globallet\tabulateruledepth \!!zeropoint + \globallet\tabulateruleheight\!!zeropoint + \edef\@@tabulatealign{\executeifdefined{\??tt:\c!align:\tabulateparameter\c!align}0}% + \let\pretabskip\!!zeropoint + \def\postabskip{.5\tabulateunit}% + \global\tabulatecolumns\zerocount + \global\nofautotabulate\zerocount + \global\noftabulatelines\zerocount + \totalnoftabulatelines\noftabulatelines + \minusnoftabulatelines\noftabulatelines + \global\tabulatepwidth\zeropoint + \global\tabulateequalfalse + \resettabulatepheight + \ifinsidesplitfloat + \donetrue + \else\ifinsidefloat + \donefalse + \else + \donetrue + \fi\fi + \ifdone + \chardef\tabulaterepeathead\executeifdefined{\??tt:\c!header:\tabulateparameter\c!header}\zerocount + \fi + \let\NC\tabulateNCone + \let\RC\tabulateRCone + \let\HC\tabulateHCone + \let\EQ\tabulateEQone + \let\RQ\tabulateRQone + \let\HQ\tabulateHQone + \let\NG\tabulateNGone + \let\NN\tabulateNNone + \let\ND\tabulateNDone + \let\HR\tabulateHRone + \let\HL\tabulateHLone + \let\NR\tabulateNRone + \let\HL\empty % not needed ? ? ? + \let\SR\NR \let\AR\NR + \let\FL\empty \let\FR\NR + \let\ML\empty \let\MR\NR + \let\LL\empty \let\LR\NR + \let\doHR\gobbleoneargument + \let\doHL\gobbleoneargument + \glet\flushtabulated\empty + \tabskip\zeropoint + \ifdim\tabulateparameter\c!margin>\zeropoint + \!!toksa{&\flushtabulateindent\strut##\tabskip\tabulateparameter\c!margin\strut&##\tabskip\zeropoint}% + \else + \!!toksa{&\flushtabulateindent\strut##&##\tabskip\zeropoint}% + \fi + \tabulatewidth\zeropoint + \nexttabulate #1X|\relax + \edef\totaltabulatecolumns{\the\numexpr3*\tabulatecolumns+4}% + \tabulatewidth\zeropoint + \initializetableboxes\tabulatecolumns + \appendtoks&##\global\advance\tabulatecolumn\plusone\to\!!toksa + \appendtoks\NC\unskip\unskip\crcr\flushtabulated\to\tabulatedummy % no count + \global\tabulatecolumn\zerocount + \resettabulatepheight + \let\bskip \tabulatebskipone + \let\eskip \tabulateeskipone + \let\xbskip\tabulatexbskipone + \let\xeskip\tabulatexeskipone + \glet\tabulatehook\dotabulatehook + \doifvalue{\??tt\currenttabulate\c!indenting}\v!no\forgetparindent + \ifinsidefloat + \let\tabulateindent\!!zeropoint + \else + \setlocalhsize \hsize\localhsize + \fi + \dontcomplain + \forgetall % hm, interference with \forgetparindent ^^^ probably bug, to be solved + \setbox0\vbox % outside \if because of line counting + {\notesenabledfalse + \let\tabulateindent\!!zeropoint + \trialtypesettingtrue % very important + \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}}% + \ifnum\nofautotabulate>\zerocount + % so, even if the natural size is larger, in the final + % run, we force the calculated width + \tabulatewidth\dimexpr\hsize-\wd0-\tabulatepwidth\relax + \ifnum\nofautotabulate>\zerocount + \divide\tabulatewidth \nofautotabulate\relax + \fi + \fi + \let\xbskip\tabulatexbskiptwo + \let\xeskip\tabulatexeskiptwo + \ifsplittabulate + \splittopskip\strutht + \glet\flushtabulatedindeed\empty + \let\bbskip\tabulatebbskiptwo + \let\bskip\tabulatebskiptwo + \glet\flushtabulated\tabulateflushtabulatedtwo + \else + % tabhook op alles ? + \let\bskip\tabulatebskipthree + \let\eskip\tabulateeskipthree + \fi + \totalnoftabulatelines\noftabulatelines + \minusnoftabulatelines\numexpr\noftabulatelines+\minusone\relax + \global\noftabulatelines\zerocount + \let\doHL\tabulatedoHLfour + \let\doHR\tabulatedoHRfour + \doifelsevalue{\??tt\currenttabulate\c!rule}\v!line + {\let\HL\HR + \let\tabulateautoline\tabulateautorule + \let\tabulateline\tabulaterule}% + {\let\HL\tabulateHLfive}% + \let\FL\tabulateFLfive + \let\ML\tabulateMLfive + \let\LL\tabulateLLfive + \let\tabulatepass\plustwo + % + \ifcase\tabulaterepeathead + \ifinsidesplitfloat + \setbox\tabulatebox\vbox \bgroup + \else + \startframedcontent[\tabulateparameter\c!frame]% + \fi + \else + \setbox\tabulatebox\vbox \bgroup + \fi + % + \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}% + \prevdepth\strutdp % nog eens beter, temporary hack + \doifvalue{\??tt\currenttabulate\c!distance}\v!grid{\vskip-\strutdp}% experimental tm-prikkels + % + \ifcase\tabulaterepeathead + \ifinsidesplitfloat + \egroup \splittabulatebox\tabulatebox + \else + \stopframedcontent + \fi + \else + \egroup \splittabulatebox\tabulatebox + \fi + % + \egroup + \ifinsidefloat \else + \tabulateparameter\c!after + \fi + \egroup} + +\egroup + +% \setuptabulate[split=yes,header=text,title=Vervolg van Tabel] +% +% % \starttabulatehead +% % \NC test \NC hans\NC \NR +% % \stoptabulatehead +% +% \starttabulate +% \NC test \NC \input tufte \relax \NC \NR +% \NC test \NC \input knuth \relax \NC \NR +% \NC test \NC \input knuth \relax \NC \NR +% \NC test \NC \input tufte \relax \NC \NR +% \NC test \NC \input tufte \relax \NC \NR +% \NC test \NC \input tufte \relax \NC \NR +% \stoptabulate + +\def\splittabulatebox#1% #1 <> 0/2 / derived from the one in core-ntb.tex + {\ifinsidesplitfloat + \dosplittabulatebox#1% + \else\ifinsidefloat + \unvbox#1% + \else + \dosplittabulatebox#1% + \fi\fi} + +\def\dosplittabulatebox#1% + {\resettsplit + \def\tsplitminimumfreelines{2}% + \def\tsplitminimumfreespace{0pt}% + \setbox\tsplitcontent\box#1% + \ifcase\tabulaterepeathead\or + \setbox\tsplithead\vsplit\tsplitcontent to \lineheight + \setbox\tsplithead\vbox{\unvbox\tsplithead}% + \or + \setbox\tsplithead\vbox{\hbox{\strut\tabulateparameter\c!title}}% + \fi + \handletsplit} + +%D \starttyping +%D \setuptabulate[split=no,rule=line] +%D +%D \starttabulate +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule +%D \stoptabulate +%D \stoptyping + +% \starttabulatie[|mc|] +% \NC \digits{100.000,00} \NC\NR +% \NC \digits{@10.000,00} \NC\NR +% \NC \digits{@@@.100,00} \NC\NR +% \NC \digits{@@@.@10,@@} \NC\NR +% \NC \digits{@@@.@@1,@@} \NC\NR +% \stoptabulatie +% +% \starttabulatie[|mc|] +% \ND 100.000,00 \NC\NR +% \ND @10.000,00 \NC\NR +% \ND @@@.100,00 \NC\NR +% \ND @@@.@10,@@ \NC\NR +% \ND @@@.@@1,@@ \NC\NR +% \stoptabulatie +% +% \starttabulatie[|c|] +% \ND $100.000,00$ \NC\NR +% \ND $@10.000,00$ \NC\NR +% \ND $@@@.100,00$ \NC\NR +% \ND $@@@.@10,@@$ \NC\NR +% \ND $@@@.@@1,@@$ \NC\NR +% \stoptabulatie +% +% \starttabulatie[|c|] +% \NC $\digits 100.000,00 $ \NC\NR +% \NC $\digits @10.000,00 $ \NC\NR +% \NC $\digits @@@.100,00 $ \NC\NR +% \NC $\digits @@@.@10,@@ $ \NC\NR +% \NC $\digits @@@.@@1,@@ $ \NC\NR +% \stoptabulatie +% +% \starttabulatie[|c|] +% \NC \digits $100.000,00$ \NC\NR +% \NC \digits $@10.000,00$ \NC\NR +% \NC \digits $@@@.100,00$ \NC\NR +% \NC \digits $@@@.@10,@@$ \NC\NR +% \NC \digits $@@@.@@1,@@$ \NC\NR +% \stoptabulatie + +\def\setuptabulate + {\dotripleempty\dosetuptabulate} + +\def\dosetuptabulate[#1][#2][#3]% + {\ifthirdargument + \getparameters[\??tt#1::#2][#3]% + \else\ifsecondargument + \getparameters[\??tt#1::][#2]% + \else + \getparameters[\??tt\v!tabulate::][#1]% + \fi\fi} + +\setuptabulate + [\c!unit=1em, + EQ={:}, + \c!frame=\v!off, + \c!bodyfont=, + \c!rule=\v!normal, + \c!rulecolor=, + \c!rulethickness=\linewidth, + \c!inner=, + \c!before=\blank, + \c!after=\blank, + \c!distance={\v!depth,\v!medium}, + \c!align=\v!normal, + \c!margin=\!!zeropoint, + \c!split=\v!auto, + \c!header=\v!yes, + \c!title=, + \c!indenting=\v!no] + +\protect \endinput diff --git a/tex/context/base/tabl-tbl.tex b/tex/context/base/tabl-tbl.tex deleted file mode 100644 index 15e827e68..000000000 --- a/tex/context/base/tabl-tbl.tex +++ /dev/null @@ -1,1439 +0,0 @@ -%D \module -%D [ file=core-tbl, -%D version=1998.11.03, -%D title=\CONTEXT\ Table Macros, -%D subtitle=Text Flow Tabulation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Table Macros / Tabulation} - -% \processbetween gebruiken in head/tail macros - -\unprotect - -% WATCH OUT: don't change this model else trialtypesetting -% compatibility problems - -% watch out, cells expand pretty late on a per row basis - -% |p2|p3| 2:3 -% spanning - -% Be careful with changing the hsize calculation in p mode; -% the following code works quite well: -% -% \setupfield [line][location=low,height=1.2\lineheight,width=\hsize] -% \definefield [test] [line] [line] [] -% -% \starttabulate[|l|p|] -% \NC test \NC \field [test] \NC \NR -% \stoptabulate - -% In-text tabbing environment -% -% \starttabulate[| separated template] % eg [|l|p|] or [|l|p|p|] -% \NC ... \NC ... \NC\NR -% \stoptabulate -% -% with: two pass auto width calculation when no p-width -% specified, even with multiple p's, see examples. - -% TaBlE compatible specifications: -% -% l align column/paragraph left -% r align column/paragraph right -% c align column/paragraph center -% p p(dimen) of automatisch als alleen p -% w column width -% f font#1 -% B bold -% I italic -% S slanted -% T type -% R roman -% m math -% M display math -% h hook (inner level or par lines) -% b before (may be command#1) -% a after -% i i skip left of column -% j i skip right of column -% k i skip around column - -% s setups - -% g g{char} align at char -% . align at . -% , align at , - -% Still to be done - -% N math numbers (best hook into existing digits mechanism) -% n numbers (best hook into existing digits mechanism) -% Q math numbers (best hook into existing digits mechanism) -% q numbers (best hook into existing digits mechanism) -% ~ \hskip.5em -% | check - -% nesting - -% 10 evt auto stack; dan wel andere signal dan void nodig - -% present but not yet 100% ok -% -% \FL top hrule -% \ML mid hrule (with auto split) -% \LL bottom hrule -% \HL - -% \VL as soon as needed -% color as soon as needed - -% \EQ \RQ \HQ equal (raw, hook) -% \NC \RC \HC normal (raw, hook) -% -% \NR - -% \HR : rule with lineheight - -% \autotabulaterule : with lineheight, not first/last -% \autotabulateline : spaced, not first/last -% \tabulaterule : with lineheight -% \tabulateline : spaced - -% tricky: align scans ahead, over # and expands ones before -% while doing - -% new: -% -% \starttabulate[|cg{.}|cg{,}|cg{,}|] -% \NC period \NC comma \NC comma \NC\NR -% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR -% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR -% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR -% \NG 10 \NG 10 \NG 0,00 \NC\NR -% \stoptabulate -% -% \starttabulate[|c.|c,|c,|] -% \NC period \NC comma \NC comma \NC\NR -% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR -% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR -% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR -% \NG 10 \NG 10 \NG 0,00 \NC\NR -% \stoptabulate - -% nice demo (for BG) -% -% \starttabulate[|r|b{$\star$}|ra{\percent}|b{=}|r|] -% \NC 500 \NC \NC 60 \NC \NC 300 \NC \NR -% \NC 500 \NC \NC 55 \NC \NC 275 \NC \NR -% \NC 500 \NC \NC 50 \NC \NC 250 \NC \NR -% \NC 500 \NC \NC 45 \NC \NC 225 \NC \NR -% \NC 500 \NC \NC 40 \NC \NC 200 \NC \NR -% \NC 500 \NC \NC 35 \NC \NC 175 \NC \NR -% \NC 500 \NC \NC 30 \NC \NC 150 \NC \NR -% \NC 500 \NC \NC 25 \NC \NC 125 \NC \NR -% \NC 500 \NC \NC 20 \NC \NC 100 \NC \NR -% \stoptabulate - -\newtoks \tabulatepreamble -\newtoks \tabulatebefore -\newtoks \tabulateafter -\newtoks \tabulatebmath -\newtoks \tabulateemath -\newtoks \tabulatefont -\newtoks \tabulatesettings -\newtoks \tabulatedummy - -\newcount \nofautotabulate -\newcount \tabulatecolumns -\newcount \tabulatecolumn - -\newcount \tabulateminplines -\newcount \tabulatemaxplines - -\newif \ifautotabulate -\newif \ifsplittabulate \splittabulatetrue - -\newif \ifhandletabulatepbreak \handletabulatepbreaktrue -\newif \iftabulatenopbreak \tabulatenopbreakfalse - -\newif \iftabulateequal -\newif \iftracetabulate -\newif \ifframedtabulate - -\newdimen \tabulatepwidth -\newdimen \tabulatewidth -\newdimen \tabulateunit -\newdimen \tabulatemaxpheight - -\newbox \tabulatebox - -% [|lg{.}|] => \NG 12.34 \NC - -\gdef\handletabulatecharalign#1 % space delimited ! - {\edef\alignmentclass{\the\tabulatecolumn}% - \edef\alignmentcharacter{\getvalue{\@@tabalign@@\the\tabulatecolumn}}% - \ifcase\tabulatepass\or - \setfirstpasscharacteralign\checkalignment{#1}% - \fi % force hsize - \setsecondpasscharacteralign\checkalignment{#1}} - -\def\noftabcolumns{16} - -\def\@@tabbox@@ {@@tabbox@} -\def\@@tabhook@@ {@@tabhook@} -\def\@@tabalign@@ {@@tabalign@} -\def\@@tabsetups@@{@@tabsetups@} - -% \dorecurse\noftabcolumns % quick and dirty stack -% {\@EA\newbox\csname\@@tabbox@@\recurselevel\endcsname} - -\def\tablebox#1% - {\csname\@@tabbox@@\number#1\endcsname} - -% \def\checktablebox#1% -% {\ifundefinedelse{\@@tabbox@@\number#1}% -% \expandafter\newbox\csname\@@tabbox@@\number#1\endcsname -% \fi} - -\def\initializetablebox#1% also used elsewhere - {\ifcsname\@@tabbox@@\number#1\endcsname - \global\setbox\csname\@@tabbox@@\number#1\endcsname\emptybox - \else - \expandafter\newbox\csname\@@tabbox@@\number#1\endcsname - \fi} - -% \def\initializetableboxes#1% hm, not that efficient, best make a simple dedicated tail recurser -% {\dorecurse#1{\initializetablebox\recurselevel}} - -\def\initializetableboxes#1% - {\scratchcounter#1\relax - \doinitializetableboxes} - -\def\doinitializetableboxes - {\ifnum\scratchcounter>\zerocount - \initializetablebox\scratchcounter - \advance\scratchcounter\minusone - \expandafter\doinitializetableboxes - \fi} - -\initializetableboxes\noftabcolumns - -\def\dotabulatenobreak - {\noalign - {\nobreak - \iftracetabulate - \red\hrule\!!height.5\linewidth\!!depth.5\linewidth - \par - \kern-\linewidth - \nobreak - \fi}} - -\let\notabulatehook\empty - -\def\checktabulatehook - {\ifnum\tabulatetype<\plustwo - \global\let\tabulatehook\notabulatehook - \else - \global\let\tabulatehook\dotabulatehook - \fi} - -\def\checktabulatesetups - {\getvalue{\@@tabsetups@@\the\tabulatecolumn}} - -\let\pretabrule \donothing -\let\posttabrule\donothing - -\def\dodosettabulatepreamble#1#2% - {\ifzeropt\tabulatewidth - \ifcase\tabulatemodus\relax - \let\preamblebox\empty - \else - \def\preamblebox{\autotabulatetrue}% - \fi - \else - \ifcase\tabulatemodus\relax - \edef\preamblebox{\hbox to \the\tabulatewidth}% - \else - \edef\preamblebox{\hsize\the\tabulatewidth}% - \fi - \fi - % - % less bytes - % - %\edef\preamblebox% - % {\ifcase\tabulatewidth - % \ifcase\tabulatemodus\relax\else\noexpand\autotabulatetrue\fi - % \els - % \ifcase\tabulatemodus\relax\hbox to\else\hsize\fi\the\tabulatewidth - % \fi}% - % - % 0 = NC column next EQ equal column - % 1 = RC column raw RQ equal column raw - % 2 = HC column hook HQ equal column hook - % some entries can be left out if we test for them being set - \@EA\appendtoks \@EA&\@EA\hskip\pretabskip\pretabrule##&\to\!!toksa - \appendtoks \ignorespaces\to\!!toksa - \@EA\appendtoks\@EA\global\@EA\tabulatecolumn\the\tabulatecolumns\relax\to\!!toksa - \appendtoks \checktabulatesetups\to\!!toksa - \appendtoks \checktabulatehook\to\!!toksa - \@EA\appendtoks \preamblebox\to\!!toksa - \appendtoks \bgroup\bbskip\bgroup#1\to\!!toksa - \appendtoks\ifnum\tabulatetype=\plusone \else \to\!!toksa - \@EA\appendtoks \the\tabulatebmath\to\!!toksa - \@EA\appendtoks \the\tabulatefont\to\!!toksa - \@EA\appendtoks \the\tabulatesettings\to\!!toksa - \@EA\appendtoks \the\tabulatebefore\to\!!toksa - \appendtoks\fi \to\!!toksa - \appendtoks \bgroup\ignorespaces\to\!!toksa - % - \appendtoks \tabulatehook##\to\!!toksa - % - %%\doifdefinedelse{\@@tabalign@@\tabulatecolumns} - %\doifdefinedelse{\@@tabalign@@\the\tabulatecolumns} - % {\appendtoks\handletabulatecharalign## \to\!!toksa} - % {\appendtoks\tabulatehook ##\to \!!toksa}% - % waarom kan ik hier geen \xx{##} geven, om een of - % andere reden passeert dan tex de hele regel (incl \NC's) - % als argument; elke delimiter <> space gaat trouwens fout - \appendtoks \unskip\unskip\ifmmode\else\endgraf\fi\egroup\to\!!toksa - \appendtoks\ifnum\tabulatetype=1 \else \to\!!toksa - \@EA\appendtoks \the\tabulateafter\to\!!toksa - \@EA\appendtoks \the\tabulateemath\to\!!toksa - \appendtoks\fi \to\!!toksa - \appendtoks #2\egroup\egroup\to\!!toksa - \@EA\appendtoks \@EA&\@EA\posttabrule\@EA\hskip\postabskip##\to\!!toksa - \appendtoks\NC\to\tabulatedummy - \let\bbskip\empty - \def\pretabskip{.5\tabulateunit}% - \let\postabskip\pretabskip - \let\gettabulateexit\dogettabulateexit - \tabulatewidth\zeropoint} - -% todo: we can speed up this module a bit -% -% \expanded{\!!toksa{\the\!!toksa -% &\hskip\pretabskip\noexpand\pretabrule####& -% \ignorespaces -% \global\tabulatecolumn\the\tabulatecolumns -% \noexpand\checktabulatesetups -% \noexpand\checktabulatehook -% \preamblebox -% \bgroup\noexpand\bbskip\bgroup\normalunexpanded{#1}% -% \noexpand\ifnum\tabulatetype=\plusone \noexpand\else -% \the\tabulatebmath -% \the\tabulatefont -% \the\tabulatesettings -% \the\tabulatebefore -% \noexpand\fi -% \bgroup\ignorespaces -% \noexpand\tabulatehook####% -% \unskip\unskip\noexpand\ifmmode\noexpand\else\endgraf\noexpand\fi\egroup -% \noexpand\ifnum\noexpand\tabulatetype=1 \noexpand\else -% \the\tabulateafter -% \the\tabulateemath -% \noexpand\fi -% \normalunexpanded{#2}\egroup\egroup -% &\noexpand\posttabrule\hskip\noexpand\postabskip####}}% - -\def\dosettabulatepreamble - {\ifx\next\relax - \let\nextnext\relax % == \expandafter\gobbleoneargument - \else - \let\nextnext\settabulatepreamble - \ifx x\next \let\tabulatealign\zerocount % internal - \else\ifx l\next \let\tabulatealign\plusone - \else\ifx r\next \let\tabulatealign\plustwo - \else\ifx c\next \let\tabulatealign\plusthree - \else\ifx p\next \let\nextnext\gettabulateparagraph - \else\ifx s\next \let\nextnext\gettabulatesetups - \else\ifx w\next \let\nextnext\gettabulatewidth - \else\ifx f\next \let\nextnext\gettabulatefont - \else\ifx B\next \tabulatefont{\bf}% - \else\ifx I\next \tabulatefont{\it}% - \else\ifx S\next \tabulatefont{\sl}% - \else\ifx T\next \tabulatefont{\tt}% - \else\ifx R\next \tabulatefont{\rm}% - \else\ifx m\next \tabulatebmath{$}\tabulateemath{$}% - \else\ifx M\next \tabulatebmath{$\displaystyle}\tabulateemath{$}% - \else\ifx h\next \let\nextnext\gettabulatehook - \else\ifx b\next \let\nextnext\gettabulatebefore - \else\ifx a\next \let\nextnext\gettabulateafter - \else\ifx i\next \let\nextnext\gettabulatepreskip - \else\ifx j\next \let\nextnext\gettabulateposskip - \else\ifx k\next \let\nextnext\gettabulatepreposskip - \else\ifx X\next \let\nextnext\gettabulateexit % internal - \else\ifx e\next \appendtoks\global\tabulateequaltrue\to\tabulatesettings - \else\ifx ~\next \appendtoks\fixedspaces\to\tabulatesettings - \else\ifx g\next \let\nextnext\gettabulatealign - \else\ifx .\next \def\nextnext{\gettabulatealign.}% - \else\ifx ,\next \def\nextnext{\gettabulatealign,}% - \else \message{unknown preamble key [\meaning\next]}% - \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi - \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi - \fi - \nextnext} - -\def\dogettabulateexit - {\let\postabskip\!!zeropoint - \settabulatepreamble} - -\let\gettabulateexit\dogettabulateexit - -\def\gettabulatepreskip#1% - {\doifnumberelse{#1} - {\scratchdimen#1\tabulateunit\let\next\empty} - {\scratchdimen.5\tabulateunit\def\next{#1}}% - \edef\pretabskip{\the\scratchdimen}% - \@EA\settabulatepreamble\next} - -\def\gettabulateposskip#1% - {\doifnumberelse{#1} - {\scratchdimen#1\tabulateunit\let\next\empty} - {\scratchdimen.5\tabulateunit\def\next{#1}}% - \edef\postabskip{\the\scratchdimen}% - \let\gettabulateexit\settabulatepreamble - \@EA\settabulatepreamble\next} - -\def\gettabulatepreposskip#1% - {\doifnumberelse{#1} - {\scratchdimen#1\tabulateunit\let\next\empty} - {\scratchdimen.5\tabulateunit\def\next{#1}}% - \edef\pretabskip{\the\scratchdimen}% - \let\postabskip\pretabskip - \let\gettabulateexit\settabulatepreamble - \@EA\settabulatepreamble\next} - -\def\gettabulatesetups#1% - {\setvalue{\@@tabsetups@@\the\tabulatecolumns}{\setups[#1]}% - \settabulatepreamble} - -\def\gettabulatehook#1% - {\setvalue{\@@tabhook@@\the\tabulatecolumns}{#1}% - \settabulatepreamble} - -\def\gettabulatealign#1% - {\setvalue{\@@tabalign@@\the\tabulatecolumns}{#1}% - \settabulatepreamble} - -\def\gettabulatebefore#1% - {\tabulatebefore{#1}% - \settabulatepreamble} - -\def\gettabulateafter#1% - {\tabulateafter{#1}% - \settabulatepreamble} - -\def\gettabulatefont#1% - {\tabulatefont{#1}% - \settabulatepreamble} - -\def\gettabulatewidth - {\let\tabulatemodus\zerocount - \let\tabulatedimen\zerocount - \doifnextcharelse(\dogettabulatewidth\settabulatepreamble} - -\def\gettabulateparagraph - {\doifnextcharelse{(} - {\let\tabulatemodus\plusone - \let\tabulatedimen\plusone - \dogettabulatewidth} - {\let\tabulatemodus\plustwo - \let\tabulatedimen\zerocount - \settabulatepreamble}} - -% \def\dogettabulatewidth(#1)% -% {\tabulatewidth#1\relax -% \ifnum\tabulatedimen=\plusone -% \global\advance\tabulatepwidth\tabulatewidth -% \fi -% \settabulatepreamble} - -% \def\dogettabulatewidth(#1)% -% {\doifelse{#1}\v!passend -% {\let\tabulatemodus\plusthree} -% {\tabulatewidth#1\relax}% -% \ifnum\tabulatedimen=\plusone -% \global\advance\tabulatepwidth\tabulatewidth -% \fi -% \settabulatepreamble} - -% \startbuffer -% \toplinebox{\framed[width=3cm,height=2cm]{tufte}} -% \stopbuffer -% \starttabulate[|p(fixed)|p|] -% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR} -% \stoptabulate -% \starttabulate[|p(fit)|p|] -% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR} -% \stoptabulate - -\def\dogettabulatewidth(#1)% - {\processallactionsinset - [#1]% - [ \v!fit=>\let\tabulatemodus\plusthree, - \v!fixed=>\let\tabulatemodus\plusthree - \tabulatenopbreaktrue, - \s!unknown=>\tabulatewidth#1\relax]% - \ifnum\tabulatedimen=\plusone - \global\advance\tabulatepwidth\tabulatewidth - \fi - \settabulatepreamble} - -\def\settabulatepreamble - {\afterassignment\dosettabulatepreamble\let\next=} - -\def\tabulateraggedright {\ifnum\tabulatetype=\plusone \else\raggedright \fi} -\def\tabulateraggedcenter{\ifnum\tabulatetype=\plusone \else\raggedcenter\fi} -\def\tabulateraggedleft {\ifnum\tabulatetype=\plusone \else\raggedleft \fi} -\def\tabulatenotragged {\ifnum\tabulatetype=\plusone \else\notragged \fi} -\def\tabulatehss {\ifnum\tabulatetype=\plusone \else\hss \fi} % never change this to a fill - -\bgroup \catcode`\|=\@@other - -\gdef\nexttabulate#1|% - {\let\tabulatealign\@@tabulatealign - \let\tabulatemodus\zerocount - \let\tabulatedimen\zerocount - \tabulatebefore \emptytoks - \tabulateafter \emptytoks - \tabulatebmath \emptytoks - \tabulateemath \emptytoks - \tabulatefont \emptytoks - \tabulatesettings\emptytoks - \global\advance\tabulatecolumns\plusone - \letvalue{\@@tabsetups@@\the\tabulatecolumns}\donothing - \settabulatepreamble#1\relax\relax % permits i without n - \ifcase\tabulatemodus\relax - \ifcase\tabulatealign\relax - \dodosettabulatepreamble\empty \tabulatehss \or - \dodosettabulatepreamble\empty \tabulatehss \or - \dodosettabulatepreamble\tabulatehss\empty \or - \dodosettabulatepreamble\tabulatehss\tabulatehss \fi - \or % fixed width - \ifcase\tabulatealign\relax - \dodosettabulatepreamble \bskip \eskip \or - \dodosettabulatepreamble{\bskip\tabulateraggedright }\eskip \or - \dodosettabulatepreamble{\bskip\tabulateraggedleft }\eskip \or - \dodosettabulatepreamble{\bskip\tabulateraggedcenter}\eskip \fi - \or % auto width - \global\advance\nofautotabulate\plusone - \ifcase\tabulatealign\relax - \dodosettabulatepreamble \bskip \eskip \or - \dodosettabulatepreamble{\bskip\tabulateraggedright }\eskip \or - \dodosettabulatepreamble{\bskip\tabulateraggedleft }\eskip \or - \dodosettabulatepreamble{\bskip\tabulateraggedcenter}\eskip \fi - \or % simple - \dodosettabulatepreamble \xbskip \xeskip - \fi - \futurelet\next\donexttabulate} - -\egroup - -\def\donexttabulate - {\ifx\next\relax\else - \expandafter\nexttabulate - \fi} - -\def\splitofftabulatebox % overloaded in anch-pgr - {\dontcomplain - \global\setbox\tabulatebox % % % global ? % % % - \vsplit\tablebox\tabulatecolumn to \lineheight - \setbox\tabulatebox\normalvbox - {\unvbox\tabulatebox}% - \setbox\tabulatebox\hbox to \wd\tabulatebox - {\hss\dotabulatehook{\box\tabulatebox}\hss}% - \ht\tabulatebox\strutht - \dp\tabulatebox\strutdp - \box\tabulatebox} - -\def\dotabulatehook {\getvalue{\@@tabhook@@ \the\tabulatecolumn}} -\def\dotabulatealign {\getvalue{\@@tabalign@@ \the\tabulatecolumn}} - -\def\resettabulatepheight - {\global\tabulateminplines\plusone - \getnoflines\tabulatemaxpheight - \global\tabulatemaxplines\noflines - \global\tabulatemaxpheight\zeropoint} - -\def\settabulatepheight - {\scratchdimen\ht\tablebox\tabulatecolumn\relax - \ifdim\scratchdimen>\tabulatemaxpheight - \global\tabulatemaxpheight\scratchdimen - \fi} - -\def\handletabulatepbreak - {\TABLEnoalign - {\ifhandletabulatepbreak - \iftabulatenopbreak - \dotabulatenobreak - \else\ifnum\tabulatemaxplines>\plusone - \ifnum\tabulateminplines=\plusone - \dotabulatenobreak - \fi - \global\advance\tabulateminplines\plusone - \ifnum\tabulateminplines=\tabulatemaxplines\relax - \dotabulatenobreak - \fi - \fi \fi - \fi}} - -%D \startbuffer -%D \starttabulate[|c|p|p|] -%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR -%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR -%D \NC 2 \NC \thinrules[n=3] \NC \thinrules[n=3] \NC\NR -%D \NC 3 \NC oh yes \NC simply no \NC\NR -%D \NC 4 \NC very true \NC as false as can be \NC\NR -%D \NC 5 \NC \thinrules[n=5] \NC \thinrules[n=5] \NC\NR -%D \NC 6 \NC \thinrules[n=3] \NC \thinrules[n=4] \NC\NR -%D \stoptabulate -%D \stopbuffer -%D -%D \typebuffer {\tracetabulatetrue\getbuffer} -%D -%D \startbuffer -%D \starttabulate[|c|p|p|] -%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR -%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR -%D \NC 2 \NC oh yes \NC simply no \NC\NR -%D \NC 3 \NC very true \NC as false as can be \NC\NR -%D \NC 4 \NC the whole truth \NC but the truth \NC\NR -%D \stoptabulate -%D \stopbuffer -%D -%D \typebuffer {\tracetabulatetrue\getbuffer} - -% \definetabulate -% \redefinetabulate -% \starttabulate[preamble] -% \starttabulate -> \starttabulate[|l|p|] - -\bgroup \catcode`\|=\@@other - -\gdef\definetabulate - {\dotripleempty\dodefinetabulate} - -\gdef\dodefinetabulate[#1][#2][#3]% - {\ifthirdargument - \doifundefined{\??tt#1::\c!unit} - {\copyparameters - [\??tt#1::][\??tt\v!tabulate::]% - [\c!frame,\c!distance,\c!unit,\c!before,\c!bodyfont,\c!after, - \c!inner,\c!indenting,\c!margin,\c!align,\c!header,\c!title, - \c!rulecolor,\c!rulethickness,\c!split,EQ]}% - \copyparameters - [\??tt#1::#2][\??tt#1::]% - [\c!unit,\c!distance,\c!before,\c!bodyfont,\c!after, - \c!inner,\c!indenting,\c!frame,\c!split,\c!header,\c!title, - \c!margin,\c!align,\c!rulecolor,\c!rulethickness,EQ]% - \setvalue{\e!start#1::#2}{\dofinalstarttabulate[#1][#2][#3]}% - \setvalue{\e!start#1}{\bgroup\dosubstarttabulate[#1]}% - \letvalue{\??tt#1-\v!header}\empty - \letvalue{\??tt#1-\v!footer }\empty - \else\ifsecondargument - \definetabulate[#1][][#2]% - \else - \definetabulate[#1][][|l|p|]% - \fi\fi} - -\egroup - -\let\tabulateheadcontent\empty -\let\tabulatetailcontent\empty - -\newconditional\tabulatesomeamble - -\def\checkfulltabulatecontent % - needed, else confusion with \c!header - {\ifundefined{\??tt\currenttabulate-\v!header}% - \let\tabulateheadcontent\empty - \else - \def\tabulateheadcontent - {\TABLEnoalign{\global\settrue\tabulatesomeamble}% - \csname\??tt\currenttabulate-\v!header\endcsname - \TABLEnoalign{\global\setfalse\tabulatesomeamble}}% - \fi - \ifundefined{\??tt\currenttabulate-\v!footer}% - \let\tabulatetailcontent\empty - \else - \def\tabulatetailcontent - {\TABLEnoalign{\global\settrue\tabulatesomeamble}% - \csname\??tt\currenttabulate-\v!footer\endcsname - \TABLEnoalign{\global\setfalse\tabulatesomeamble}}% - \fi} - -% \def\fulltabulatecontent -% {\tabulateheadcontent -% \tabulatecontent -% \tabulatetailcontent} - -\def\fulltabulatecontent - {\tabulateheadcontent - \tabulatecontent - \tabulatetailcontent - \removefunnytabulateline} - -\def\removefunnytabulateline - {\ifhmode - \strut\crcr - \TABLEnoalign{\kern-\lineheight}% - \fi} - -\setvalue{\e!start\v!tabulatehead}% - {\dosingleempty\dostartstarttabulatehead} - -\def\dostartstarttabulatehead[#1]% - {\processcontent{\e!stop\v!tabulatehead}\next - {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!header}\next}} - -\setvalue{\e!start\v!tabulatetail}% - {\dosingleempty\dostartstarttabulatetail} - -\def\dostartstarttabulatetail[#1]% - {\processcontent{\e!stop\v!tabulatetail}\next - {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!footer}\next}} - -\def\dosubstarttabulate - {\dodoubleempty\dodosubstarttabulate} - -\def\dodosubstarttabulate[#1][#2]% - {\getvalue{\e!start#1::\ifundefined{\e!start#1::#2}\else#2\fi}} - -\setvalue{\e!start\v!tabulate}% - {\bgroup\dodoubleempty\donormalstarttabulate} - -\bgroup - -\gdef\donormalstarttabulate[#1][#2]% - {\ifsecondargument - \getparameters[\??tt\v!tabulate::][#2]% - \fi - \iffirstargument - \def\next{\dofinalstarttabulate[\v!tabulate][][#1]}% - \else - \def\next{\dofinalstarttabulate[\v!tabulate][][|l|p|]}% - \fi - \next} - -\egroup - -% The much neede hook: - -\newtoks\everytabulate - -% An example of its usage: - -\appendtoks \optimizeverbatimfalse \to \everytabulate -\appendtoks \let\recodeverbatimmode\plustwo \to \everytabulate - -% A status variable: - -\chardef\tabulatepass=0 - -\def\tabulateparameter#1{\csname\??tt\currenttabulate#1\endcsname} - -\bgroup - \catcode`\|=\@@other \gdef\@@otherbar{|} - \catcode`\|=\@@active \gdef\@@useotherbar{\let|\@@otherbar} -\egroup - -\def\dofinalstarttabulate[#1][#2][#3]% identifier sub preamble - {\edef\currenttabulate{#1::#2}% - \ifinsidefloat \else - \whitespace - \tabulateparameter\c!before - \fi - \bgroup - \resetcharacteralign - % todo: spacing around tabulate when bodyfont is set - % expansion en test needed ? - \splittabulatetrue - \processaction - [\tabulateparameter\c!split] - [% \v!yes=>\splittabulatetrue, - % \v!repeat=>\splittabulatetrue, % todo, default yes - \v!no=>\splittabulatefalse, - \v!auto=>\ifinsidefloat\ifinsidesplitfloat\else\splittabulatefalse\fi\fi]% - \doifvaluesomething{\??tt\currenttabulate\c!bodyfont} - {\expanded{\switchtobodyfont[\tabulateparameter\c!bodyfont]}}% - \postponenotes % new, to be tested / will be configurable - \let\tabulatepass\plusone - \widowpenalty\zerocount % otherwise lines are not broken - \clubpenalty \zerocount % but overlap in funny ways - \the\everytabulate - \tabulateparameter\c!inner - \scratchdimen\leftskip - \advance\scratchdimen \hangindent - \doifvalue{\??tt\currenttabulate\c!indenting}\v!yes - {\advance\scratchdimen \parindent}% \ctxparindent - \edef\tabulateindent{\the\scratchdimen}% - \!!toksb\emptytoks - \def\dorepeat*##1##2% - {\dorecurse{##1}{\appendtoks##2\to\!!toksb}\do}% - \def\do - {\futurelet\next\dodo}% - \def\dodo % \@EAEAEA gebruiken - {\ifx\next\relax - % exit - \else\ifx*\next - \let\next\dorepeat - \else\ifx\bgroup\next - \let\next\dododo - \else - \let\next\dodododo - \fi\fi\fi - \next}% - \def\dododo##1% - {\appendtoks{##1}\to\!!toksb\do}% - \def\dodododo##1% - {\appendtoks##1\to\!!toksb\do}% - \global\tabulatecolumn\zerocount -% \do#3\relax -\bgroup\@@useotherbar\expanded{\egroup\noexpand\do#3\relax}% - \processcontent - {\e!stop#1}% \currenttabulate} - \tabulatecontent - {\@EA\processtabulate\@EA[\the\!!toksb]}} - -\chardef\tabulatetype=0 - -% 0 = NC column next EQ equal column -% 1 = RC column raw RQ equal column raw -% 2 = HC column hook HQ equal column hook - -\newif\iftabulatefirstflushed - -\def\tabulateEQ - {\iftabulatefirstflushed\else\tabulateparameter{EQ}\fi - \global\tabulateequalfalse} - -% \def\tabulatenormalcolumn#1% -% {&\iftabulateequal\tabulateEQ\fi&\global\chardef\tabulatetype#1&} -% -% \def\tabulateequalcolumn#1% -% {&\tabulateEQ&\global\chardef\tabulatetype#1&} -% -% however, \unskip en \ignorespaces permit usage in complex XML/\starttabulate - -\def\tabulatenormalcolumn#1% - {\unskip&\iftabulateequal\tabulateEQ\fi&\global\chardef\tabulatetype#1&% - \ignorespaces} - -\def\tabulateequalcolumn#1% - {\unskip&\tabulateEQ&\global\chardef\tabulatetype#1&% - \ignorespaces} - -\def\tabulateautocolumn - {\tabulatenormalcolumn\zerocount - \ifnum\tabulatecolumn>\tabulatecolumns\relax - \expandafter\NR - \else - \expandafter\ignorespaces % interferes with the more tricky hooks - \fi} - -\def\setquicktabulate#1% see \startlegend \startgiven - {\let#1\tabulateautocolumn - \let\\\tabulateautocolumn} - -%\def\dotabulateruleseperator -% {\vskip\strutdp} - -\def\dotabulateruleseperator % can be sped up - {\bgroup - \let\factor\!!plusone - \scratchskip\strutdp - \ExpandFirstAfter\processallactionsinset - [\tabulateparameter\c!distance] - [ \v!blank=>\scratchskip\bigskipamount, - \v!depth=>\scratchskip\strutdp, - \v!small=>\def\factor{.25}, - \v!medium=>\def\factor{.5}, - \v!big=>, - \v!none=>\scratchskip\zeropoint\def\factor{0}, - \v!grid=>\scratchskip\zeropoint\def\factor{0}, - \s!unknown=>\scratchskip\commalistelement]% - \scratchdimen\factor\scratchskip - \ifconditional\tabulatesomeamble\kern\else\vskip\fi\scratchdimen % new - \egroup} - -\def\dodotabulaterule#1% - {\color - [\tabulateparameter\c!rulecolor] - {\scratchdimen\tabulateparameter\c!rulethickness#1}} - -\def\dotabulaterule - {\dodotabulaterule - {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax - \doifvalue{\??tt\currenttabulate\c!distance}\v!grid - {\kern-\scratchdimen}}} % experimental tm-prikkels - -\def\dotabulatelinerule - {\multispan\totaltabulatecolumns % \multispan is a plain macro - % for the moment this one - \strut\hskip\tabulateparameter\c!margin - % neg values are ok ! - \hskip\tabulateindent % new august 2003 - \dodotabulaterule - {\!!heighta.5\lineheight - \advance\!!heighta-\strutdepth - \!!deptha-\!!heighta - \advance\!!deptha\scratchdimen - \leaders\hrule\!!height\!!heighta\!!depth\!!deptha\hfill}% - \cr} - -%D When set to true, no (less) break optimization is done. - -\newif\iftolerantTABLEbreak - -%D The main processing macro is large but splitting it up -%D would make things less clear. - -\def\doregistertabulateparoptions - {\iftrialtypesetting \else - \registerparoptions - \ifinsidefloat - % that is, an unbreakable one - \global\let\registertabulateparoptions\empty - \else - % unsafe in crossing pages, at each b... - % \global\let\registertabulateparoptions\empty - \fi - \fi} - -\appendtoks - \global\let\registertabulateparoptions\doregistertabulateparoptions -\to \everytabulate - -\newtoks\everytabulaterow - -\appendtoks - \registertabulateparoptions -\to \everytabulaterow - -\def\flushtabulateindent - {\ifnum\tabulatecolumn=\zerocount - \hbox to \tabulateindent - {% we now have a local hsize, and since we want to - % register positional info (i.e. real hsizes) we - % need to reconstitute the original hsize - \advance\hsize\tabulateindent - % this is indeed rather messy and took a few hours - % to dis/uncover - \the\everytabulaterow - \hss}% - \fi} - -\def\totaltabulatecolumns{0} - -\def\handletabulatedigits{\digits} - -%D Beware, we cannot use \type {\unexpanded} on \type {\HL} -%D cum suis, since \TEX's hard coded noalign lookahead fails -%D on it! I mistakenly added this for a while. - -\chardef\tabulaterepeathead\zerocount - -\newcount\noftabulatelines -\newcount\totalnoftabulatelines -\newcount\minusnoftabulatelines - -\setvalue{\??tt:\c!align:\v!normal}{0} -\setvalue{\??tt:\c!align:\v!right }{1} -\setvalue{\??tt:\c!align:\v!left }{2} -\setvalue{\??tt:\c!align:\v!middle}{3} - -\setvalue{\??tt:\c!header:\v!repeat}{\plusone} -\setvalue{\??tt:\c!header:\v!text }{\plustwo} - -\bgroup \catcode`\|=\@@other - -\newtoks\everyaftertabulaterow - -\gdef\processtabulate[|#1|]% in the process of optimizing - {\tabulateunit\tabulateparameter\c!unit - \checkfulltabulatecontent - \globallet\tabulateruledepth \!!zeropoint - \globallet\tabulateruleheight\!!zeropoint - \edef\@@tabulatealign{\executeifdefined{\??tt:\c!align:\tabulateparameter\c!align}0}% -% \ExpandFirstAfter\processaction % use \setalignmentswitch instead -% [\tabulateparameter\c!align] -% [ \v!normal=>\def\@@tabulatealign{0},% = default value -% \v!right=>\def\@@tabulatealign{1},% chardefs gebruiken -% \v!left=>\def\@@tabulatealign{2},% -% \v!middle=>\def\@@tabulatealign{3},% -% \s!default=>\def\@@tabulatealign{0},% -% \s!unknown=>\def\@@tabulatealign{0}]% - \let\pretabskip\!!zeropoint - \def\postabskip{.5\tabulateunit}% - \global\tabulatecolumns\zerocount - \global\nofautotabulate\zerocount - \global\noftabulatelines\zerocount - \totalnoftabulatelines\noftabulatelines - \minusnoftabulatelines\noftabulatelines - \global\tabulatepwidth\zeropoint - \global\tabulateequalfalse - \resettabulatepheight - \ifinsidesplitfloat - \donetrue - \else\ifinsidefloat - \donefalse - \else - \donetrue - \fi\fi - \ifdone - \chardef\tabulaterepeathead\executeifdefined{\??tt:\c!header:\tabulateparameter\c!header}\zerocount -% \processaction -% [\tabulateparameter\c!header] -% [\v!repeat=>\let\tabulaterepeathead\plusone, -% \v!text=>\let\tabulaterepeathead\plustwo]% - \fi - \unexpanded \def\NC{\tabulatenormalcolumn0}% - \unexpanded \def\RC{\tabulatenormalcolumn1}% - \unexpanded \def\HC{\tabulatenormalcolumn2}% - \unexpanded \def\EQ{\tabulateequalcolumn 0}% - \unexpanded \def\RQ{\tabulateequalcolumn 1}% - \unexpanded \def\HQ{\tabulateequalcolumn 2}% - \unexpanded \def\NG{\NC\handletabulatecharalign}% - \unexpanded \def\NN{\NC\handletabulatedigits}% new, undocumented, test first - \unexpanded \def\ND{\NC\handletabulatedigits}% same, for old times sake - \def\tabulaterule{\HR}% a rule with lineheight - \def\tabulateline{\HL}% just a spaced rule - \def\tabulateautorule{\doHR\plusone}% - \def\tabulateautoline{\doHL\plusone}% - \def\HR{\doHR\zerocount} - \def\HL{\doHL\zerocount} - \unexpanded \def\NR % next row - {\global\advance\noftabulatelines\plusone - \global\tabulatefirstflushedfalse - \global\tabulateequalfalse - \global\tabulatecolumn\zerocount - \resettabulatepheight - \unskip\unskip\crcr\flushtabulated -\TABLEnoalign - {\the\everyaftertabulaterow}% - \TABLEnoalign - {\iftolerantTABLEbreak\else - \ifconditional\tabulatesomeamble \ifcase\tabulaterepeathead \else - \allowbreak - \fi \fi - \ifnum\noftabulatelines=\plusone - \dotabulatenobreak - \else\ifnum\noftabulatelines=\minusnoftabulatelines - \ifnum\tabulatemaxplines<\plustwo - \dotabulatenobreak - \else - \allowbreak % needed with pbreak prevention - \fi - \else - \allowbreak % needed with pbreak prevention - \fi\fi - \fi - \global\tabulatefirstflushedfalse}}% - \let\HL\empty % not needed - \let\SR\NR \let\AR\NR - \let\FL\empty \let\FR\NR - \let\ML\empty \let\MR\NR - \let\LL\empty \let\LR\NR - \let\doHR\gobbleoneargument - \let\doHL\gobbleoneargument - \global\let\flushtabulated\empty -% \let\savedbar|\let|\nexttabulate - \tabskip\zeropoint - \ifdim\tabulateparameter\c!margin>\zeropoint - \!!toksa{&\flushtabulateindent\strut##% - \tabskip\tabulateparameter\c!margin\strut - &##\tabskip\zeropoint}% - \else - \!!toksa{&\flushtabulateindent\strut##% - &##\tabskip\zeropoint}% - \fi - \tabulatewidth\zeropoint - % |#1X|\relax - \nexttabulate #1X|\relax - \scratchcounter\tabulatecolumns - \multiply\scratchcounter3% - \advance\scratchcounter4% - \edef\totaltabulatecolumns{\the\scratchcounter}% - \tabulatewidth\zeropoint - % \dorecurse\tabulatecolumns % can be made faster - % {\doifundefinedelse{\@@tabbox@@\recurselevel} - % {\expandafter\newbox\csname\@@tabbox@@\recurselevel\endcsname}% - % {\global\setbox\csname\@@tabbox@@\recurselevel\endcsname\emptybox}}% - \initializetableboxes\tabulatecolumns - \appendtoks&##\to\!!toksa - \appendtoks\global\advance\tabulatecolumn\plusone\to\!!toksa - \appendtoks\NC\unskip\unskip\crcr\flushtabulated\to\tabulatedummy % no count - \global\tabulatecolumn\zerocount - \resettabulatepheight - \def\bskip - {\setbox\tabulatebox\vbox\bgroup - \global\let\tabulatehook\notabulatehook}% - \def\eskip - {\par\egroup - \global\let\tabulatehook\dotabulatehook}% - \def\xbskip - {\hbox\bgroup\vbox\bgroup - \global\let\tabulatehook\notabulatehook}% - \def\xeskip - {\par\egroup\egroup - \global\let\tabulatehook\dotabulatehook}% - % \let|\savedbar - \global\let\tabulatehook\dotabulatehook - \doifvalue{\??tt\currenttabulate\c!indenting}\v!no\forgetparindent - \ifinsidefloat - \let\tabulateindent\!!zeropoint - \else - \setlocalhsize \hsize\localhsize - \fi - \dontcomplain - \forgetall % hm, interference with \forgetparindent ^^^ probably bug, to be solved - \setbox0\vbox % outside \if because of line counting - {\notesenabledfalse - \let\tabulateindent\!!zeropoint - \trialtypesettingtrue % very important - \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}}% - \ifnum\nofautotabulate>\zerocount - % so, even if the natural size is larger, in the final - % run, we force the calculated width - \tabulatewidth\hsize - \advance\tabulatewidth -\wd0 - \advance\tabulatewidth -\tabulatepwidth - \ifnum\nofautotabulate>\zerocount - \divide\tabulatewidth \nofautotabulate\relax - \fi - \fi - \def\xbskip{\bskip}% - \def\xeskip{\eskip}% - \ifsplittabulate - \splittopskip\strutht - \global\let\flushtabulatedindeed\empty - \long\def\bbskip - {\ifvoid\tablebox\tabulatecolumn - \ifx\flushtabulatedindeed\empty\else - \setbox0\hbox - \fi - \fi}% - \def\bskip - {\ifvoid\tablebox\tabulatecolumn - \global\setbox\tablebox\tabulatecolumn\vbox - \bgroup - \global\let\tabulatehook\notabulatehook - \ifautotabulate\hsize\tabulatewidth\fi - % \begstrut % interferes with pre-\pars - % evt: \appendtoks\begstrut\to\everypar - \ignorespaces - \def\eskip - {\par\egroup - \settabulatepheight - \global\let\tabulatehook\dotabulatehook - \splitofftabulatebox}% - \else - \let\eskip\empty - \dontcomplain - \global\let\tabulatehook\dotabulatehook - \expandafter\splitofftabulatebox - \fi}% - \gdef\flushtabulated - {\TABLEnoalign % noalign % no interference ! - {\global\let\flushtabulatedindeed\empty - \global\tabulatecolumn\zerocount - \handletabulatepbreak - \dorecurse\tabulatecolumns % was: \noftabcolumns - {\ifvoid\tablebox\recurselevel\else - \gdef\flushtabulatedindeed{\the\tabulatedummy}% - \fi}% - \global\tabulatefirstflushedtrue}% - \flushtabulatedindeed}% - \else - % tabhook op alles ? - \def\bskip - {\vtop\bgroup - \ifautotabulate\hsize\tabulatewidth\fi - % \begstrut % interferes with pre-\pars - % evt: \appendtoks\begstrut\to\everypar - \ignorespaces}% - \def\eskip % vertical strut added august 2003 - {\par\verticalstrut\vskip-\struttotal\egroup}% - \fi - \totalnoftabulatelines\noftabulatelines - \minusnoftabulatelines\numexpr\noftabulatelines+\minusone\relax - \global\noftabulatelines\zerocount - \def\doHL##1% ##1 ignored - {\TABLEnoalign - {\csname - \ifnum\noftabulatelines=\zerocount F\else - \ifnum\noftabulatelines=\totalnoftabulatelines L\else - M\fi\fi - L\endcsname}}% - \def\doHR##1% horizontal rule line (break untested) - {\TABLEnoalign - {\globallet\TABLEautoline\dotabulatelinerule - \ifcase##1\or - \ifnum\noftabulatelines=\zerocount - \gdef\TABLEautoline{\TABLEnoalign{}}% - \else\ifnum\noftabulatelines=\totalnoftabulatelines - \gdef\TABLEautoline{\TABLEnoalign{}}% - \fi\fi - \fi - \dotabulatenobreak}% - \TABLEautoline - \TABLEnoalign - {\nobreak - \ifx\TABLEautoline\dotabulatelinerule\kern-\lineheight\fi - \ifnum\noftabulatelines=\totalnoftabulatelines - \@EA\dotabulatenobreak - \else - \@EA\allowbreak - \fi}% - \TABLEautoline - \TABLEnoalign - {\dotabulatenobreak}}% - \doifelsevalue{\??tt\currenttabulate\c!rule}\v!line - {\let\HL \HR - \let\tabulateautoline\tabulateautorule - \let\tabulateline \tabulaterule}% - {\def\HL{\doHL\zerocount}}% - \def\tablebaselinecorrection - {\def\dobaselinecorrection - {\vskip-\prevdepth - \vskip\strutdp - \vskip\strutdp}% - \baselinecorrection}% - \def\FL{\TABLEnoalign - {\ifinsidefloat\else - \doifemptyvalue{\??tt\currenttabulate\c!before} % no expansion - {\tablebaselinecorrection}% - \fi - \dotabulaterule - \dotabulatenobreak - \dotabulateruleseperator - \prevdepth\strutdp - \dotabulatenobreak}}% - \def\ML{\TABLEnoalign - {\dotabulateruleseperator - \dotabulaterule - \ifnum\noftabulatelines>\plusone - \ifnum\noftabulatelines<\minusnoftabulatelines - \vskip\topskip\allowbreak\vskip-\topskip - \vskip-\tabulateparameter\c!rulethickness - \dotabulaterule - \fi - \fi - \dotabulateruleseperator}}% - \def\LL{\TABLEnoalign - {\dotabulatenobreak - \dotabulateruleseperator - \dotabulatenobreak - \dotabulaterule - \ifinsidefloat\else - \doifemptyvalue{\??tt\currenttabulate\c!after} % no expansion - {\vskip\strutdp - \verticalstrut - \vskip-\struttotal}% - \fi}}% - \let\tabulatepass\plustwo - % - \ifcase\tabulaterepeathead - \ifinsidesplitfloat - \setbox\tabulatebox\vbox \bgroup - \else - \startframedcontent[\tabulateparameter\c!frame]% - \fi - \else - \setbox\tabulatebox\vbox \bgroup - \fi - % - \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}% - \prevdepth\strutdp % nog eens beter, temporary hack - \doifvalue{\??tt\currenttabulate\c!distance}\v!grid - {\vskip-\strutdp}% experimental tm-prikkels - % - \ifcase\tabulaterepeathead - \ifinsidesplitfloat - \egroup \splittabulatebox\tabulatebox - \else - \stopframedcontent - \fi - \else - \egroup \splittabulatebox\tabulatebox - \fi - % - \egroup - \ifinsidefloat \else - \tabulateparameter\c!after - \fi - \egroup} - -\egroup - -% \setuptabulate[split=yes,header=text,title=Vervolg van Tabel] -% -% % \starttabulatehead -% % \NC test \NC hans\NC \NR -% % \stoptabulatehead -% -% \starttabulate -% \NC test \NC \input tufte \relax \NC \NR -% \NC test \NC \input knuth \relax \NC \NR -% \NC test \NC \input knuth \relax \NC \NR -% \NC test \NC \input tufte \relax \NC \NR -% \NC test \NC \input tufte \relax \NC \NR -% \NC test \NC \input tufte \relax \NC \NR -% \stoptabulate - -% \def\splittabulatebox#1% #1 <> 0/2 / derived from the one in core-ntb.tex -% {\ifinsidefloat -% \unvbox#1% -% \else -% \ifcase\tabulaterepeathead\or -% \setbox2\copy#1% -% \setbox2\vsplit2 to \lineheight -% \setbox2\vbox{\unvbox2}% -% \fi -% \doloop -% {\setbox0\vsplit#1 to \onepoint % \lineheight -% \ifdim\pagegoal<\maxdimen -% \donetrue -% \else\ifdim\pagetotal=\zeropoint -% \donetrue -% \else -% \donefalse -% \fi\fi -% \ifdone -% \setbox0\vbox{\unvbox0}% -% \dimen0\pagetotal -% \advance\dimen0\dp0 -% \advance\dimen0\ht0 -% \ifdim\dimen0>\pagegoal -% \bgroup \page \egroup % make sure that local vars are kept -% \ifcase\tabulaterepeathead\or -% \unvcopy2 -% \or -% \hbox{\strut\tabulateparameter\c!title}% -% \fi -% \fi -% \fi -% % test this on icare checklists / quite hacky ! ! ! -% \ifdim\ht0>\tabulateparameter\c!rulethickness\else -% \kern-2\ht0 % brrrr -% \fi -% % -% \unvbox0 -% \allowbreak -% \ifvoid#1 \exitloop \fi}% -% \fi} - -\def\splittabulatebox#1% #1 <> 0/2 / derived from the one in core-ntb.tex - {\ifinsidesplitfloat - \dosplittabulatebox#1% - \else\ifinsidefloat - \unvbox#1% - \else - \dosplittabulatebox#1% - \fi\fi} - -\def\dosplittabulatebox#1% - {\resettsplit - \def\tsplitminimumfreelines{2}% - \def\tsplitminimumfreespace{0pt}% - \setbox\tsplitcontent\box#1% - \ifcase\tabulaterepeathead\or - \setbox\tsplithead\vsplit\tsplitcontent to \lineheight - \setbox\tsplithead\vbox{\unvbox\tsplithead}% - \or - \setbox\tsplithead\vbox{\hbox{\strut\tabulateparameter\c!title}}% - \fi - \handletsplit} - -%D \starttyping -%D \setuptabulate[split=no,rule=line] -%D -%D \starttabulate -%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule -%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule -%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule -%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule -%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule -%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule -%D \stoptabulate -%D \stoptyping - -% \starttabulatie[|mc|] -% \NC \digits{100.000,00} \NC\NR -% \NC \digits{@10.000,00} \NC\NR -% \NC \digits{@@@.100,00} \NC\NR -% \NC \digits{@@@.@10,@@} \NC\NR -% \NC \digits{@@@.@@1,@@} \NC\NR -% \stoptabulatie -% -% \starttabulatie[|mc|] -% \ND 100.000,00 \NC\NR -% \ND @10.000,00 \NC\NR -% \ND @@@.100,00 \NC\NR -% \ND @@@.@10,@@ \NC\NR -% \ND @@@.@@1,@@ \NC\NR -% \stoptabulatie -% -% \starttabulatie[|c|] -% \ND $100.000,00$ \NC\NR -% \ND $@10.000,00$ \NC\NR -% \ND $@@@.100,00$ \NC\NR -% \ND $@@@.@10,@@$ \NC\NR -% \ND $@@@.@@1,@@$ \NC\NR -% \stoptabulatie -% -% \starttabulatie[|c|] -% \NC $\digits 100.000,00 $ \NC\NR -% \NC $\digits @10.000,00 $ \NC\NR -% \NC $\digits @@@.100,00 $ \NC\NR -% \NC $\digits @@@.@10,@@ $ \NC\NR -% \NC $\digits @@@.@@1,@@ $ \NC\NR -% \stoptabulatie -% -% \starttabulatie[|c|] -% \NC \digits $100.000,00$ \NC\NR -% \NC \digits $@10.000,00$ \NC\NR -% \NC \digits $@@@.100,00$ \NC\NR -% \NC \digits $@@@.@10,@@$ \NC\NR -% \NC \digits $@@@.@@1,@@$ \NC\NR -% \stoptabulatie - -\def\setuptabulate - {\dotripleempty\dosetuptabulate} - -\def\dosetuptabulate[#1][#2][#3]% - {\ifthirdargument - \getparameters[\??tt#1::#2][#3]% - \else\ifsecondargument - \getparameters[\??tt#1::][#2]% - \else - \getparameters[\??tt\v!tabulate::][#1]% - \fi\fi} - -\setuptabulate - [\c!unit=1em, - EQ={:}, - \c!frame=\v!off, - \c!bodyfont=, - \c!rule=\v!normal, - \c!rulecolor=, - \c!rulethickness=\linewidth, - \c!inner=, - \c!before=\blank, - \c!after=\blank, - \c!distance={\v!depth,\v!medium}, - \c!align=\v!normal, - \c!margin=\!!zeropoint, - \c!split=\v!auto, - \c!header=\v!yes, - \c!title=, - \c!indenting=\v!no] - -\protect \endinput diff --git a/tex/context/base/tabl-tsp.mkii b/tex/context/base/tabl-tsp.mkii new file mode 100644 index 000000000..49bb7ad90 --- /dev/null +++ b/tex/context/base/tabl-tsp.mkii @@ -0,0 +1,427 @@ +%D \module +%D [ file=tabl-tsp, +%D version=2000.10.20, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Splitting, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Macros / Splitting} + +%D The code in this file is move here from other places. + +\unprotect + +% only to be used with single tokens (will be prim) + +\ifx\htdp\undefined \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi + +%D Although the name resembles floats, and therefore this should be +%D a page module, we decided to make it core functionality because the +%D table code depends on it. Othrwise there would be too much +%D overloading afterwards involved. Actually, the float part is rather +%D generic and not that related to floats. + +% \splitfloat [settings] {\placetable[optional args]{test}} {content} + +\definenumber + [\??si] + [\c!way=\v!by\v!text, + \c!conversion=\@@siconversion] + +\def\setupfloatsplitting + {\dodoubleargument\getparameters[\??si]} + +\newif\ifinsidesplitfloat % will become chardef + +\newtoks \everysplitfloatsetup + +\def\splitfloat + {\dosingleempty\dosplitfloat} + +\ifx\floatcaptionsuffix\undefined \else + \let\floatcaptionsuffix\empty % will become \splitfloatcaptionsuffix +\fi + +\def\extrasplitfloatlines{0} + +\def\dosplitfloat[#1]#2% nog dubbele refs + {\bgroup + \global\setfalse\splitfloatdone + \aftergroup\checksplitfloat + \insidefloattrue + \insidesplitfloattrue + \getparameters[\??si][#1]% + \resetnumber[\??si]% + \def\floatcaptionsuffix{\convertednumber[\??si]}% + \let\extrasplitfloatlines\@@silines + \the\everysplitfloatsetup + \def\splitfloatcommand{#2}% + \global\settrue \onlyonesplitofffloat + \global\setfalse\somenextplitofffloat + \dopushsavedfloats + \@@sibefore + \let\next} % \bgroup + +\def\checksplitfloat + {\ifconditional\splitfloatdone\else + \blank{\tttf \getmessage\m!floatblocks{13}\empty}\blank + \showmessage\m!floatblocks{13}\empty + \fi} + +\settrue \onlyonesplitofffloat +\setfalse\somenextplitofffloat + +%D When \type {inbetween} is made empty instead of the +%D default \type {\page}, we will get delayed flushing +%D and text may continue below the graphic. +%D +%D \starttyping +%D \dorecurse{2}{\input tufte } +%D +%D \splitfloat[lines=auto,inbetween=] +%D {\placetable{\dorecurse{5}{test\recurselevel\endgraf}}} +%D {\bTABLE[split=yes] +%D \bTR \bTD 11 \eTD \bTD \input tufte \eTD \eTR +%D \bTR \bTD 12 \eTD \bTD \input zapf \eTD \eTR +%D \bTR \bTD 13 \eTD \bTD \input bryson \eTD \eTR +%D \bTR \bTD 14 \eTD \bTD test \eTD \eTR +%D \bTR \bTD 21 \eTD \bTD \input tufte \eTD \eTR +%D \bTR \bTD 22 \eTD \bTD \input zapf \eTD \eTR +%D \bTR \bTD 23 \eTD \bTD \input bryson \eTD \eTR +%D \bTR \bTD 24 \eTD \bTD test \eTD \eTR +%D \bTR \bTD 31 \eTD \bTD \input tufte \eTD \eTR +%D \bTR \bTD 32 \eTD \bTD \input zapf \eTD \eTR +%D \bTR \bTD 33 \eTD \bTD \input bryson \eTD \eTR +%D \bTR \bTD 34 \eTD \bTD test \eTD \eTR +%D \eTABLE} +%D +%D \dorecurse{10}{\input tufte } +%D \stoptyping + +\newconditional\splitfloatdone + +\def\dodowithsplitofffloat + {\dowithnextbox + {\forgetall + \dontcomplain + \global\settrue\splitfloatdone + \chardef\nodelocationmode\zerocount % bypass auto-renumbering + \incrementnumber[\??si]% + \ifcase\rawnumber[\??si]\or \ifconditional\onlyonesplitofffloat + \let\floatcaptionsuffix\empty + \fi \fi + \bgroup + \ifconditional\somenextplitofffloat + \settrue\retainfloatnumber +\notesenabledfalse % best here, experimental, brrr; test with note in caption + \else + \setfalse\retainfloatnumber + \fi + \splitfloatcommand{\box\nextbox}% + \egroup + \ifconditional\somenextplitofffloat + \doifelsenothing\@@siinbetween + {\ifconditional\splitfloatfirstdone\else\page\fi} + \@@siinbetween + \else + \@@siafter + \dopopsavedfloats + \doflushsavedfloats + \fi + \global\settrue\splitfloatfirstdone}% + \vbox} + +\def\nodowithsplitofffloat + {\dowithnextbox + {\forgetall + \dontcomplain + \box\nextbox % maybe an option to unvbox + \global\settrue\splitfloatfirstdone}% + \vbox} + +\def\dochecksplitofffloat#1% box + {\ifinsidesplitfloat + \ifdim\ht#1=\zeropoint + \global\setfalse\somenextplitofffloat + \else + \global\settrue \somenextplitofffloat + \global\setfalse\onlyonesplitofffloat + \fi + \fi} + +\def\analyzesplitfloatcaption#1% depends on page-flt + {\doif\extrasplitfloatlines\v!auto + {\bgroup + \settrue\retainfloatnumber + \chardef\nodelocationmode\zerocount + \forcelocalfloats + \setuplocalfloats[\c!before=,\c!after=,\c!inbetween=]% + \splitfloatcommand{\hbox to \wd#1{\strut}}% dummy line + \setbox\scratchbox\vbox{\flushlocalfloats}% + \getnoflines{\ht\scratchbox}% + \resetlocalfloats + \advance\noflines\minusone % compensate dummy line + \expanded{\egroup\noexpand\edef\noexpand\extrasplitfloatlines{\the\noflines}}}} + +% \def\analyzesplitfloatcaption#1% +% {\edef\extrasplitfloatlines{11}} + +\def\dowithsplitofffloat % nextbox + {\ifinsidesplitfloat + \expandafter\dodowithsplitofffloat + \else + \expandafter\nodowithsplitofffloat + \fi} + +\def\doifnotinsidesplitfloat + {\ifinsidesplitfloat\expandafter\gobbleoneargument\fi} + +%D Some defaults: + +\setupfloatsplitting + [\c!conversion=\v!character, % \v!romannumerals + \c!lines=3, + \c!before=, + \c!inbetween=\page, + \c!after=] + +%D Table splitter, on top of previous code: + +\newbox\tsplitcontent +\newbox\tsplitresult +\newbox\tsplithead +\newbox\tsplitnext +\newbox\tsplittail + +\def\resettsplit{% only \def's starting a a new line are seen by the dep checker + \def\tsplitminimumfreelines{0}% + \def\tsplitminimumfreespace{0pt}% + \setbox\tsplitcontent \vbox{}% + \setbox\tsplitresult \vbox{}% + \setbox\tsplithead \vbox{}% + \setbox\tsplitnext \vbox{}% + \setbox\tsplittail \vbox{}% + \let\tsplitbeforeresult\donothing + \let\tsplitafterresult \donothing + \let\tsplitinbetween \donothing + \let\tsplitbefore \donothing + \let\tsplitafter \donothing + \let\postprocesstsplit \donothing +} + +\resettsplit + +% todo: keep tail to rest, so we need a lookahead + +\newconditional\splitfloatfirstdone + +\def\handletsplit + {\analyzesplitfloatcaption\tsplitcontent + \global\setfalse\splitfloatfirstdone + \testpagesync % new, sync, but still tricky + [\tsplitminimumfreelines] + [\dimexpr\tsplitminimumfreespace+\extrasplitfloatlines\lineheight\relax]% + \setbox\scratchbox\vbox{\tsplitinbetween}% + \edef\tsplitinbetweenheight{\the\htdp\scratchbox}% etex + \!!doneafalse + \doloop + {\ifinsidecolumns + % brrr, assumes empty columns + \global\setfalse\splitfloatfirstdone + \scratchdimen\textheight + \!!donectrue + \else + \ifconditional\splitfloatfirstdone + \scratchdimen\textheight + \!!donectrue + \else\ifdim\pagegoal<\maxdimen + \scratchdimen\dimexpr\pagegoal-\pagetotal\relax + \!!donecfalse + \else + \scratchdimen\textheight + \!!donectrue + \fi\fi + \fi + \scratchdimen\dimexpr\scratchdimen-\tsplitinbetweenheight-\tsplitminimumfreespace-\extrasplitfloatlines\lineheight\relax + \ifdim\htdp\tsplittail>\zeropoint + \advance\scratchdimen-\htdp\tsplittail + \fi + \setbox\tsplitresult\vbox + {\ifdim\ht\tsplithead>\zeropoint + \unvcopy\tsplithead + \tsplitinbetween + \fi}% + \if!!donea\else\ifdim\ht\tsplitnext>\zeropoint + \setbox\tsplithead\box\tsplitnext + \fi\fi + \!!doneatrue + \ifdim\ht\tsplitresult>\zeropoint + \!!donedtrue % table head + \else + \!!donedfalse % no tablehead + \fi + \splittopskip\zeropoint + \doloop + {\setbox\scratchbox\vsplit\tsplitcontent to \onepoint % \lineheight + \setbox\scratchbox\vbox{\unvbox\scratchbox}% + \ifdim\dimexpr\scratchdimen-\htdp\scratchbox-\htdp\tsplitresult\relax>\zeropoint + \setbox\tsplitresult\vbox + {\unvbox\tsplitresult + \tsplitinbetween + \unvbox\scratchbox}% + \ifvoid\tsplitcontent \exitloop \fi + \else\if!!doned + % we only have a tablehead so far + \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvbox\scratchbox}% + \exitloop + \else\if!!donec + % we have text height available, but the (one) cell is too + % large to fit, so, in order to avoid loops/deadcycles we do: + \setbox\tsplitresult\vbox + {\unvbox\tsplitresult + \tsplitinbetween + \unvbox\scratchbox}% + \exitloop + \else + \setbox\tsplitcontent\vbox + {\unvbox\scratchbox + \tsplitinbetween + \ifvoid\tsplitcontent\else\unvbox\tsplitcontent\fi}% + \exitloop + \fi\fi\fi + \!!donedfalse + \!!donecfalse}% + \postprocesstsplit + \dochecksplitofffloat\tsplitcontent + \ifvoid\tsplitcontent + \setbox\tsplitresult\vbox + {\unvbox\tsplitresult + \tsplitinbetween + \unvcopy\tsplittail}% + \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}% + \doifnotinsidesplitfloat\tsplitafter + \endgraf + \exitloop + \else + % hack + \ifdim\pagegoal<\maxdimen + \global\pagegoal\dimexpr\pagegoal+\lineheight\relax % etex + \fi + % brrr + \ifdim\ht\tsplitresult>\zeropoint + \setbox\tsplitresult\vbox + {\unvbox\tsplitresult + \tsplitinbetween + \unvcopy\tsplittail}% + \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}% + \doifnotinsidesplitfloat\tsplitafter + \endgraf + \fi + \ifinsidecolumns + \doifnotinsidesplitfloat\goodbreak + \else + \doifnotinsidesplitfloat\page + \fi + \fi}% + \global\setfalse\splitfloatfirstdone} % we can use this one for tests + +\protect \endinput + +% test cases + +% \setupTABLE[split=repeat] +% +% \input tufte \endgraf +% \splitfloat[lines=11] +% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}} +% {\bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE} +% \input tufte \page +% +% \input tufte \endgraf +% \splitfloat[lines=0] +% {} +% {\bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE} +% \input tufte \endgraf \page +% +% \input tufte \endgraf +% \bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE +% \input tufte \page + +% \setuptabulate[split=yes] +% +% \input tufte \endgraf +% \splitfloat[lines=11] +% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}} +% {\starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate} +% \input tufte \page +% +% \input tufte \endgraf +% \splitfloat[lines=0] +% {} +% {\starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate} +% \input tufte \page +% +% \input tufte \endgraf +% \starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate +% \input tufte \page + +% \setuptables[split=yes] +% +% \newtoks\TestToks +% +% \TestToks\emptytoks +% \appendtoks\starttablehead\to\TestToks +% \dorecurse{3}{\appendtoks\VL head \VL head \VL \SR\to\TestToks} +% \appendtoks\stoptablehead\to\TestToks +% \appendtoks\starttabletail\to\TestToks +% \dorecurse{3}{\appendtoks\VL tail \VL tail \VL \SR\to\TestToks} +% \appendtoks\stoptabletail\to\TestToks +% \appendtoks\starttables[|c|c|]\to\TestToks +% \dorecurse{100}{\appendtoks\VL test \VL test \VL \SR\to\TestToks} +% \appendtoks\stoptables\to\TestToks +% +% \input tufte \endgraf +% \splitfloat[lines=auto] % [lines=11] +% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}} +% {\the\TestToks} +% \input tufte \page +% +% \input tufte \endgraf +% \splitfloat[lines=0] +% {} +% {\the\TestToks} +% \input tufte \page +% +% \input tufte \endgraf +% \the\TestToks +% \input tufte \page +% +% multiple floats +% +% \starttext +% \dorecurse{3}{\input tufte } \endgraf +% \dorecurse{5}{\placefigure{}{\framed[height=.5\textheight]{}}} +% \splitfloat[lines=auto,inbetween=] +% {\placetable{\dorecurse{5}{test\recurselevel\endgraf}}} +% {\bTABLE[split=yes] +% \bTR \bTD 11 \eTD \bTD \input tufte \eTD \eTR +% \bTR \bTD 12 \eTD \bTD \input zapf \eTD \eTR +% \bTR \bTD 13 \eTD \bTD \input bryson \eTD \eTR +% \bTR \bTD 14 \eTD \bTD test \eTD \eTR +% \bTR \bTD 21 \eTD \bTD \input tufte \eTD \eTR +% \bTR \bTD 22 \eTD \bTD \input zapf \eTD \eTR +% \bTR \bTD 23 \eTD \bTD \input bryson \eTD \eTR +% \bTR \bTD 24 \eTD \bTD test \eTD \eTR +% \bTR \bTD 31 \eTD \bTD \input tufte \eTD \eTR +% \bTR \bTD 32 \eTD \bTD \input zapf \eTD \eTR +% \bTR \bTD 33 \eTD \bTD \input bryson \eTD \eTR +% \bTR \bTD 34 \eTD \bTD test \eTD \eTR +% \eTABLE} +% \dorecurse{10}{\input tufte } +% \stoptext diff --git a/tex/context/base/tabl-tsp.mkiv b/tex/context/base/tabl-tsp.mkiv new file mode 100644 index 000000000..49bb7ad90 --- /dev/null +++ b/tex/context/base/tabl-tsp.mkiv @@ -0,0 +1,427 @@ +%D \module +%D [ file=tabl-tsp, +%D version=2000.10.20, +%D title=\CONTEXT\ Table Macros, +%D subtitle=Splitting, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Table Macros / Splitting} + +%D The code in this file is move here from other places. + +\unprotect + +% only to be used with single tokens (will be prim) + +\ifx\htdp\undefined \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi + +%D Although the name resembles floats, and therefore this should be +%D a page module, we decided to make it core functionality because the +%D table code depends on it. Othrwise there would be too much +%D overloading afterwards involved. Actually, the float part is rather +%D generic and not that related to floats. + +% \splitfloat [settings] {\placetable[optional args]{test}} {content} + +\definenumber + [\??si] + [\c!way=\v!by\v!text, + \c!conversion=\@@siconversion] + +\def\setupfloatsplitting + {\dodoubleargument\getparameters[\??si]} + +\newif\ifinsidesplitfloat % will become chardef + +\newtoks \everysplitfloatsetup + +\def\splitfloat + {\dosingleempty\dosplitfloat} + +\ifx\floatcaptionsuffix\undefined \else + \let\floatcaptionsuffix\empty % will become \splitfloatcaptionsuffix +\fi + +\def\extrasplitfloatlines{0} + +\def\dosplitfloat[#1]#2% nog dubbele refs + {\bgroup + \global\setfalse\splitfloatdone + \aftergroup\checksplitfloat + \insidefloattrue + \insidesplitfloattrue + \getparameters[\??si][#1]% + \resetnumber[\??si]% + \def\floatcaptionsuffix{\convertednumber[\??si]}% + \let\extrasplitfloatlines\@@silines + \the\everysplitfloatsetup + \def\splitfloatcommand{#2}% + \global\settrue \onlyonesplitofffloat + \global\setfalse\somenextplitofffloat + \dopushsavedfloats + \@@sibefore + \let\next} % \bgroup + +\def\checksplitfloat + {\ifconditional\splitfloatdone\else + \blank{\tttf \getmessage\m!floatblocks{13}\empty}\blank + \showmessage\m!floatblocks{13}\empty + \fi} + +\settrue \onlyonesplitofffloat +\setfalse\somenextplitofffloat + +%D When \type {inbetween} is made empty instead of the +%D default \type {\page}, we will get delayed flushing +%D and text may continue below the graphic. +%D +%D \starttyping +%D \dorecurse{2}{\input tufte } +%D +%D \splitfloat[lines=auto,inbetween=] +%D {\placetable{\dorecurse{5}{test\recurselevel\endgraf}}} +%D {\bTABLE[split=yes] +%D \bTR \bTD 11 \eTD \bTD \input tufte \eTD \eTR +%D \bTR \bTD 12 \eTD \bTD \input zapf \eTD \eTR +%D \bTR \bTD 13 \eTD \bTD \input bryson \eTD \eTR +%D \bTR \bTD 14 \eTD \bTD test \eTD \eTR +%D \bTR \bTD 21 \eTD \bTD \input tufte \eTD \eTR +%D \bTR \bTD 22 \eTD \bTD \input zapf \eTD \eTR +%D \bTR \bTD 23 \eTD \bTD \input bryson \eTD \eTR +%D \bTR \bTD 24 \eTD \bTD test \eTD \eTR +%D \bTR \bTD 31 \eTD \bTD \input tufte \eTD \eTR +%D \bTR \bTD 32 \eTD \bTD \input zapf \eTD \eTR +%D \bTR \bTD 33 \eTD \bTD \input bryson \eTD \eTR +%D \bTR \bTD 34 \eTD \bTD test \eTD \eTR +%D \eTABLE} +%D +%D \dorecurse{10}{\input tufte } +%D \stoptyping + +\newconditional\splitfloatdone + +\def\dodowithsplitofffloat + {\dowithnextbox + {\forgetall + \dontcomplain + \global\settrue\splitfloatdone + \chardef\nodelocationmode\zerocount % bypass auto-renumbering + \incrementnumber[\??si]% + \ifcase\rawnumber[\??si]\or \ifconditional\onlyonesplitofffloat + \let\floatcaptionsuffix\empty + \fi \fi + \bgroup + \ifconditional\somenextplitofffloat + \settrue\retainfloatnumber +\notesenabledfalse % best here, experimental, brrr; test with note in caption + \else + \setfalse\retainfloatnumber + \fi + \splitfloatcommand{\box\nextbox}% + \egroup + \ifconditional\somenextplitofffloat + \doifelsenothing\@@siinbetween + {\ifconditional\splitfloatfirstdone\else\page\fi} + \@@siinbetween + \else + \@@siafter + \dopopsavedfloats + \doflushsavedfloats + \fi + \global\settrue\splitfloatfirstdone}% + \vbox} + +\def\nodowithsplitofffloat + {\dowithnextbox + {\forgetall + \dontcomplain + \box\nextbox % maybe an option to unvbox + \global\settrue\splitfloatfirstdone}% + \vbox} + +\def\dochecksplitofffloat#1% box + {\ifinsidesplitfloat + \ifdim\ht#1=\zeropoint + \global\setfalse\somenextplitofffloat + \else + \global\settrue \somenextplitofffloat + \global\setfalse\onlyonesplitofffloat + \fi + \fi} + +\def\analyzesplitfloatcaption#1% depends on page-flt + {\doif\extrasplitfloatlines\v!auto + {\bgroup + \settrue\retainfloatnumber + \chardef\nodelocationmode\zerocount + \forcelocalfloats + \setuplocalfloats[\c!before=,\c!after=,\c!inbetween=]% + \splitfloatcommand{\hbox to \wd#1{\strut}}% dummy line + \setbox\scratchbox\vbox{\flushlocalfloats}% + \getnoflines{\ht\scratchbox}% + \resetlocalfloats + \advance\noflines\minusone % compensate dummy line + \expanded{\egroup\noexpand\edef\noexpand\extrasplitfloatlines{\the\noflines}}}} + +% \def\analyzesplitfloatcaption#1% +% {\edef\extrasplitfloatlines{11}} + +\def\dowithsplitofffloat % nextbox + {\ifinsidesplitfloat + \expandafter\dodowithsplitofffloat + \else + \expandafter\nodowithsplitofffloat + \fi} + +\def\doifnotinsidesplitfloat + {\ifinsidesplitfloat\expandafter\gobbleoneargument\fi} + +%D Some defaults: + +\setupfloatsplitting + [\c!conversion=\v!character, % \v!romannumerals + \c!lines=3, + \c!before=, + \c!inbetween=\page, + \c!after=] + +%D Table splitter, on top of previous code: + +\newbox\tsplitcontent +\newbox\tsplitresult +\newbox\tsplithead +\newbox\tsplitnext +\newbox\tsplittail + +\def\resettsplit{% only \def's starting a a new line are seen by the dep checker + \def\tsplitminimumfreelines{0}% + \def\tsplitminimumfreespace{0pt}% + \setbox\tsplitcontent \vbox{}% + \setbox\tsplitresult \vbox{}% + \setbox\tsplithead \vbox{}% + \setbox\tsplitnext \vbox{}% + \setbox\tsplittail \vbox{}% + \let\tsplitbeforeresult\donothing + \let\tsplitafterresult \donothing + \let\tsplitinbetween \donothing + \let\tsplitbefore \donothing + \let\tsplitafter \donothing + \let\postprocesstsplit \donothing +} + +\resettsplit + +% todo: keep tail to rest, so we need a lookahead + +\newconditional\splitfloatfirstdone + +\def\handletsplit + {\analyzesplitfloatcaption\tsplitcontent + \global\setfalse\splitfloatfirstdone + \testpagesync % new, sync, but still tricky + [\tsplitminimumfreelines] + [\dimexpr\tsplitminimumfreespace+\extrasplitfloatlines\lineheight\relax]% + \setbox\scratchbox\vbox{\tsplitinbetween}% + \edef\tsplitinbetweenheight{\the\htdp\scratchbox}% etex + \!!doneafalse + \doloop + {\ifinsidecolumns + % brrr, assumes empty columns + \global\setfalse\splitfloatfirstdone + \scratchdimen\textheight + \!!donectrue + \else + \ifconditional\splitfloatfirstdone + \scratchdimen\textheight + \!!donectrue + \else\ifdim\pagegoal<\maxdimen + \scratchdimen\dimexpr\pagegoal-\pagetotal\relax + \!!donecfalse + \else + \scratchdimen\textheight + \!!donectrue + \fi\fi + \fi + \scratchdimen\dimexpr\scratchdimen-\tsplitinbetweenheight-\tsplitminimumfreespace-\extrasplitfloatlines\lineheight\relax + \ifdim\htdp\tsplittail>\zeropoint + \advance\scratchdimen-\htdp\tsplittail + \fi + \setbox\tsplitresult\vbox + {\ifdim\ht\tsplithead>\zeropoint + \unvcopy\tsplithead + \tsplitinbetween + \fi}% + \if!!donea\else\ifdim\ht\tsplitnext>\zeropoint + \setbox\tsplithead\box\tsplitnext + \fi\fi + \!!doneatrue + \ifdim\ht\tsplitresult>\zeropoint + \!!donedtrue % table head + \else + \!!donedfalse % no tablehead + \fi + \splittopskip\zeropoint + \doloop + {\setbox\scratchbox\vsplit\tsplitcontent to \onepoint % \lineheight + \setbox\scratchbox\vbox{\unvbox\scratchbox}% + \ifdim\dimexpr\scratchdimen-\htdp\scratchbox-\htdp\tsplitresult\relax>\zeropoint + \setbox\tsplitresult\vbox + {\unvbox\tsplitresult + \tsplitinbetween + \unvbox\scratchbox}% + \ifvoid\tsplitcontent \exitloop \fi + \else\if!!doned + % we only have a tablehead so far + \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvbox\scratchbox}% + \exitloop + \else\if!!donec + % we have text height available, but the (one) cell is too + % large to fit, so, in order to avoid loops/deadcycles we do: + \setbox\tsplitresult\vbox + {\unvbox\tsplitresult + \tsplitinbetween + \unvbox\scratchbox}% + \exitloop + \else + \setbox\tsplitcontent\vbox + {\unvbox\scratchbox + \tsplitinbetween + \ifvoid\tsplitcontent\else\unvbox\tsplitcontent\fi}% + \exitloop + \fi\fi\fi + \!!donedfalse + \!!donecfalse}% + \postprocesstsplit + \dochecksplitofffloat\tsplitcontent + \ifvoid\tsplitcontent + \setbox\tsplitresult\vbox + {\unvbox\tsplitresult + \tsplitinbetween + \unvcopy\tsplittail}% + \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}% + \doifnotinsidesplitfloat\tsplitafter + \endgraf + \exitloop + \else + % hack + \ifdim\pagegoal<\maxdimen + \global\pagegoal\dimexpr\pagegoal+\lineheight\relax % etex + \fi + % brrr + \ifdim\ht\tsplitresult>\zeropoint + \setbox\tsplitresult\vbox + {\unvbox\tsplitresult + \tsplitinbetween + \unvcopy\tsplittail}% + \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}% + \doifnotinsidesplitfloat\tsplitafter + \endgraf + \fi + \ifinsidecolumns + \doifnotinsidesplitfloat\goodbreak + \else + \doifnotinsidesplitfloat\page + \fi + \fi}% + \global\setfalse\splitfloatfirstdone} % we can use this one for tests + +\protect \endinput + +% test cases + +% \setupTABLE[split=repeat] +% +% \input tufte \endgraf +% \splitfloat[lines=11] +% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}} +% {\bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE} +% \input tufte \page +% +% \input tufte \endgraf +% \splitfloat[lines=0] +% {} +% {\bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE} +% \input tufte \endgraf \page +% +% \input tufte \endgraf +% \bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE +% \input tufte \page + +% \setuptabulate[split=yes] +% +% \input tufte \endgraf +% \splitfloat[lines=11] +% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}} +% {\starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate} +% \input tufte \page +% +% \input tufte \endgraf +% \splitfloat[lines=0] +% {} +% {\starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate} +% \input tufte \page +% +% \input tufte \endgraf +% \starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate +% \input tufte \page + +% \setuptables[split=yes] +% +% \newtoks\TestToks +% +% \TestToks\emptytoks +% \appendtoks\starttablehead\to\TestToks +% \dorecurse{3}{\appendtoks\VL head \VL head \VL \SR\to\TestToks} +% \appendtoks\stoptablehead\to\TestToks +% \appendtoks\starttabletail\to\TestToks +% \dorecurse{3}{\appendtoks\VL tail \VL tail \VL \SR\to\TestToks} +% \appendtoks\stoptabletail\to\TestToks +% \appendtoks\starttables[|c|c|]\to\TestToks +% \dorecurse{100}{\appendtoks\VL test \VL test \VL \SR\to\TestToks} +% \appendtoks\stoptables\to\TestToks +% +% \input tufte \endgraf +% \splitfloat[lines=auto] % [lines=11] +% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}} +% {\the\TestToks} +% \input tufte \page +% +% \input tufte \endgraf +% \splitfloat[lines=0] +% {} +% {\the\TestToks} +% \input tufte \page +% +% \input tufte \endgraf +% \the\TestToks +% \input tufte \page +% +% multiple floats +% +% \starttext +% \dorecurse{3}{\input tufte } \endgraf +% \dorecurse{5}{\placefigure{}{\framed[height=.5\textheight]{}}} +% \splitfloat[lines=auto,inbetween=] +% {\placetable{\dorecurse{5}{test\recurselevel\endgraf}}} +% {\bTABLE[split=yes] +% \bTR \bTD 11 \eTD \bTD \input tufte \eTD \eTR +% \bTR \bTD 12 \eTD \bTD \input zapf \eTD \eTR +% \bTR \bTD 13 \eTD \bTD \input bryson \eTD \eTR +% \bTR \bTD 14 \eTD \bTD test \eTD \eTR +% \bTR \bTD 21 \eTD \bTD \input tufte \eTD \eTR +% \bTR \bTD 22 \eTD \bTD \input zapf \eTD \eTR +% \bTR \bTD 23 \eTD \bTD \input bryson \eTD \eTR +% \bTR \bTD 24 \eTD \bTD test \eTD \eTR +% \bTR \bTD 31 \eTD \bTD \input tufte \eTD \eTR +% \bTR \bTD 32 \eTD \bTD \input zapf \eTD \eTR +% \bTR \bTD 33 \eTD \bTD \input bryson \eTD \eTR +% \bTR \bTD 34 \eTD \bTD test \eTD \eTR +% \eTABLE} +% \dorecurse{10}{\input tufte } +% \stoptext diff --git a/tex/context/base/tabl-tsp.tex b/tex/context/base/tabl-tsp.tex deleted file mode 100644 index 49bb7ad90..000000000 --- a/tex/context/base/tabl-tsp.tex +++ /dev/null @@ -1,427 +0,0 @@ -%D \module -%D [ file=tabl-tsp, -%D version=2000.10.20, -%D title=\CONTEXT\ Table Macros, -%D subtitle=Splitting, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Table Macros / Splitting} - -%D The code in this file is move here from other places. - -\unprotect - -% only to be used with single tokens (will be prim) - -\ifx\htdp\undefined \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi - -%D Although the name resembles floats, and therefore this should be -%D a page module, we decided to make it core functionality because the -%D table code depends on it. Othrwise there would be too much -%D overloading afterwards involved. Actually, the float part is rather -%D generic and not that related to floats. - -% \splitfloat [settings] {\placetable[optional args]{test}} {content} - -\definenumber - [\??si] - [\c!way=\v!by\v!text, - \c!conversion=\@@siconversion] - -\def\setupfloatsplitting - {\dodoubleargument\getparameters[\??si]} - -\newif\ifinsidesplitfloat % will become chardef - -\newtoks \everysplitfloatsetup - -\def\splitfloat - {\dosingleempty\dosplitfloat} - -\ifx\floatcaptionsuffix\undefined \else - \let\floatcaptionsuffix\empty % will become \splitfloatcaptionsuffix -\fi - -\def\extrasplitfloatlines{0} - -\def\dosplitfloat[#1]#2% nog dubbele refs - {\bgroup - \global\setfalse\splitfloatdone - \aftergroup\checksplitfloat - \insidefloattrue - \insidesplitfloattrue - \getparameters[\??si][#1]% - \resetnumber[\??si]% - \def\floatcaptionsuffix{\convertednumber[\??si]}% - \let\extrasplitfloatlines\@@silines - \the\everysplitfloatsetup - \def\splitfloatcommand{#2}% - \global\settrue \onlyonesplitofffloat - \global\setfalse\somenextplitofffloat - \dopushsavedfloats - \@@sibefore - \let\next} % \bgroup - -\def\checksplitfloat - {\ifconditional\splitfloatdone\else - \blank{\tttf \getmessage\m!floatblocks{13}\empty}\blank - \showmessage\m!floatblocks{13}\empty - \fi} - -\settrue \onlyonesplitofffloat -\setfalse\somenextplitofffloat - -%D When \type {inbetween} is made empty instead of the -%D default \type {\page}, we will get delayed flushing -%D and text may continue below the graphic. -%D -%D \starttyping -%D \dorecurse{2}{\input tufte } -%D -%D \splitfloat[lines=auto,inbetween=] -%D {\placetable{\dorecurse{5}{test\recurselevel\endgraf}}} -%D {\bTABLE[split=yes] -%D \bTR \bTD 11 \eTD \bTD \input tufte \eTD \eTR -%D \bTR \bTD 12 \eTD \bTD \input zapf \eTD \eTR -%D \bTR \bTD 13 \eTD \bTD \input bryson \eTD \eTR -%D \bTR \bTD 14 \eTD \bTD test \eTD \eTR -%D \bTR \bTD 21 \eTD \bTD \input tufte \eTD \eTR -%D \bTR \bTD 22 \eTD \bTD \input zapf \eTD \eTR -%D \bTR \bTD 23 \eTD \bTD \input bryson \eTD \eTR -%D \bTR \bTD 24 \eTD \bTD test \eTD \eTR -%D \bTR \bTD 31 \eTD \bTD \input tufte \eTD \eTR -%D \bTR \bTD 32 \eTD \bTD \input zapf \eTD \eTR -%D \bTR \bTD 33 \eTD \bTD \input bryson \eTD \eTR -%D \bTR \bTD 34 \eTD \bTD test \eTD \eTR -%D \eTABLE} -%D -%D \dorecurse{10}{\input tufte } -%D \stoptyping - -\newconditional\splitfloatdone - -\def\dodowithsplitofffloat - {\dowithnextbox - {\forgetall - \dontcomplain - \global\settrue\splitfloatdone - \chardef\nodelocationmode\zerocount % bypass auto-renumbering - \incrementnumber[\??si]% - \ifcase\rawnumber[\??si]\or \ifconditional\onlyonesplitofffloat - \let\floatcaptionsuffix\empty - \fi \fi - \bgroup - \ifconditional\somenextplitofffloat - \settrue\retainfloatnumber -\notesenabledfalse % best here, experimental, brrr; test with note in caption - \else - \setfalse\retainfloatnumber - \fi - \splitfloatcommand{\box\nextbox}% - \egroup - \ifconditional\somenextplitofffloat - \doifelsenothing\@@siinbetween - {\ifconditional\splitfloatfirstdone\else\page\fi} - \@@siinbetween - \else - \@@siafter - \dopopsavedfloats - \doflushsavedfloats - \fi - \global\settrue\splitfloatfirstdone}% - \vbox} - -\def\nodowithsplitofffloat - {\dowithnextbox - {\forgetall - \dontcomplain - \box\nextbox % maybe an option to unvbox - \global\settrue\splitfloatfirstdone}% - \vbox} - -\def\dochecksplitofffloat#1% box - {\ifinsidesplitfloat - \ifdim\ht#1=\zeropoint - \global\setfalse\somenextplitofffloat - \else - \global\settrue \somenextplitofffloat - \global\setfalse\onlyonesplitofffloat - \fi - \fi} - -\def\analyzesplitfloatcaption#1% depends on page-flt - {\doif\extrasplitfloatlines\v!auto - {\bgroup - \settrue\retainfloatnumber - \chardef\nodelocationmode\zerocount - \forcelocalfloats - \setuplocalfloats[\c!before=,\c!after=,\c!inbetween=]% - \splitfloatcommand{\hbox to \wd#1{\strut}}% dummy line - \setbox\scratchbox\vbox{\flushlocalfloats}% - \getnoflines{\ht\scratchbox}% - \resetlocalfloats - \advance\noflines\minusone % compensate dummy line - \expanded{\egroup\noexpand\edef\noexpand\extrasplitfloatlines{\the\noflines}}}} - -% \def\analyzesplitfloatcaption#1% -% {\edef\extrasplitfloatlines{11}} - -\def\dowithsplitofffloat % nextbox - {\ifinsidesplitfloat - \expandafter\dodowithsplitofffloat - \else - \expandafter\nodowithsplitofffloat - \fi} - -\def\doifnotinsidesplitfloat - {\ifinsidesplitfloat\expandafter\gobbleoneargument\fi} - -%D Some defaults: - -\setupfloatsplitting - [\c!conversion=\v!character, % \v!romannumerals - \c!lines=3, - \c!before=, - \c!inbetween=\page, - \c!after=] - -%D Table splitter, on top of previous code: - -\newbox\tsplitcontent -\newbox\tsplitresult -\newbox\tsplithead -\newbox\tsplitnext -\newbox\tsplittail - -\def\resettsplit{% only \def's starting a a new line are seen by the dep checker - \def\tsplitminimumfreelines{0}% - \def\tsplitminimumfreespace{0pt}% - \setbox\tsplitcontent \vbox{}% - \setbox\tsplitresult \vbox{}% - \setbox\tsplithead \vbox{}% - \setbox\tsplitnext \vbox{}% - \setbox\tsplittail \vbox{}% - \let\tsplitbeforeresult\donothing - \let\tsplitafterresult \donothing - \let\tsplitinbetween \donothing - \let\tsplitbefore \donothing - \let\tsplitafter \donothing - \let\postprocesstsplit \donothing -} - -\resettsplit - -% todo: keep tail to rest, so we need a lookahead - -\newconditional\splitfloatfirstdone - -\def\handletsplit - {\analyzesplitfloatcaption\tsplitcontent - \global\setfalse\splitfloatfirstdone - \testpagesync % new, sync, but still tricky - [\tsplitminimumfreelines] - [\dimexpr\tsplitminimumfreespace+\extrasplitfloatlines\lineheight\relax]% - \setbox\scratchbox\vbox{\tsplitinbetween}% - \edef\tsplitinbetweenheight{\the\htdp\scratchbox}% etex - \!!doneafalse - \doloop - {\ifinsidecolumns - % brrr, assumes empty columns - \global\setfalse\splitfloatfirstdone - \scratchdimen\textheight - \!!donectrue - \else - \ifconditional\splitfloatfirstdone - \scratchdimen\textheight - \!!donectrue - \else\ifdim\pagegoal<\maxdimen - \scratchdimen\dimexpr\pagegoal-\pagetotal\relax - \!!donecfalse - \else - \scratchdimen\textheight - \!!donectrue - \fi\fi - \fi - \scratchdimen\dimexpr\scratchdimen-\tsplitinbetweenheight-\tsplitminimumfreespace-\extrasplitfloatlines\lineheight\relax - \ifdim\htdp\tsplittail>\zeropoint - \advance\scratchdimen-\htdp\tsplittail - \fi - \setbox\tsplitresult\vbox - {\ifdim\ht\tsplithead>\zeropoint - \unvcopy\tsplithead - \tsplitinbetween - \fi}% - \if!!donea\else\ifdim\ht\tsplitnext>\zeropoint - \setbox\tsplithead\box\tsplitnext - \fi\fi - \!!doneatrue - \ifdim\ht\tsplitresult>\zeropoint - \!!donedtrue % table head - \else - \!!donedfalse % no tablehead - \fi - \splittopskip\zeropoint - \doloop - {\setbox\scratchbox\vsplit\tsplitcontent to \onepoint % \lineheight - \setbox\scratchbox\vbox{\unvbox\scratchbox}% - \ifdim\dimexpr\scratchdimen-\htdp\scratchbox-\htdp\tsplitresult\relax>\zeropoint - \setbox\tsplitresult\vbox - {\unvbox\tsplitresult - \tsplitinbetween - \unvbox\scratchbox}% - \ifvoid\tsplitcontent \exitloop \fi - \else\if!!doned - % we only have a tablehead so far - \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvbox\scratchbox}% - \exitloop - \else\if!!donec - % we have text height available, but the (one) cell is too - % large to fit, so, in order to avoid loops/deadcycles we do: - \setbox\tsplitresult\vbox - {\unvbox\tsplitresult - \tsplitinbetween - \unvbox\scratchbox}% - \exitloop - \else - \setbox\tsplitcontent\vbox - {\unvbox\scratchbox - \tsplitinbetween - \ifvoid\tsplitcontent\else\unvbox\tsplitcontent\fi}% - \exitloop - \fi\fi\fi - \!!donedfalse - \!!donecfalse}% - \postprocesstsplit - \dochecksplitofffloat\tsplitcontent - \ifvoid\tsplitcontent - \setbox\tsplitresult\vbox - {\unvbox\tsplitresult - \tsplitinbetween - \unvcopy\tsplittail}% - \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}% - \doifnotinsidesplitfloat\tsplitafter - \endgraf - \exitloop - \else - % hack - \ifdim\pagegoal<\maxdimen - \global\pagegoal\dimexpr\pagegoal+\lineheight\relax % etex - \fi - % brrr - \ifdim\ht\tsplitresult>\zeropoint - \setbox\tsplitresult\vbox - {\unvbox\tsplitresult - \tsplitinbetween - \unvcopy\tsplittail}% - \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}% - \doifnotinsidesplitfloat\tsplitafter - \endgraf - \fi - \ifinsidecolumns - \doifnotinsidesplitfloat\goodbreak - \else - \doifnotinsidesplitfloat\page - \fi - \fi}% - \global\setfalse\splitfloatfirstdone} % we can use this one for tests - -\protect \endinput - -% test cases - -% \setupTABLE[split=repeat] -% -% \input tufte \endgraf -% \splitfloat[lines=11] -% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}} -% {\bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE} -% \input tufte \page -% -% \input tufte \endgraf -% \splitfloat[lines=0] -% {} -% {\bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE} -% \input tufte \endgraf \page -% -% \input tufte \endgraf -% \bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE -% \input tufte \page - -% \setuptabulate[split=yes] -% -% \input tufte \endgraf -% \splitfloat[lines=11] -% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}} -% {\starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate} -% \input tufte \page -% -% \input tufte \endgraf -% \splitfloat[lines=0] -% {} -% {\starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate} -% \input tufte \page -% -% \input tufte \endgraf -% \starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate -% \input tufte \page - -% \setuptables[split=yes] -% -% \newtoks\TestToks -% -% \TestToks\emptytoks -% \appendtoks\starttablehead\to\TestToks -% \dorecurse{3}{\appendtoks\VL head \VL head \VL \SR\to\TestToks} -% \appendtoks\stoptablehead\to\TestToks -% \appendtoks\starttabletail\to\TestToks -% \dorecurse{3}{\appendtoks\VL tail \VL tail \VL \SR\to\TestToks} -% \appendtoks\stoptabletail\to\TestToks -% \appendtoks\starttables[|c|c|]\to\TestToks -% \dorecurse{100}{\appendtoks\VL test \VL test \VL \SR\to\TestToks} -% \appendtoks\stoptables\to\TestToks -% -% \input tufte \endgraf -% \splitfloat[lines=auto] % [lines=11] -% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}} -% {\the\TestToks} -% \input tufte \page -% -% \input tufte \endgraf -% \splitfloat[lines=0] -% {} -% {\the\TestToks} -% \input tufte \page -% -% \input tufte \endgraf -% \the\TestToks -% \input tufte \page -% -% multiple floats -% -% \starttext -% \dorecurse{3}{\input tufte } \endgraf -% \dorecurse{5}{\placefigure{}{\framed[height=.5\textheight]{}}} -% \splitfloat[lines=auto,inbetween=] -% {\placetable{\dorecurse{5}{test\recurselevel\endgraf}}} -% {\bTABLE[split=yes] -% \bTR \bTD 11 \eTD \bTD \input tufte \eTD \eTR -% \bTR \bTD 12 \eTD \bTD \input zapf \eTD \eTR -% \bTR \bTD 13 \eTD \bTD \input bryson \eTD \eTR -% \bTR \bTD 14 \eTD \bTD test \eTD \eTR -% \bTR \bTD 21 \eTD \bTD \input tufte \eTD \eTR -% \bTR \bTD 22 \eTD \bTD \input zapf \eTD \eTR -% \bTR \bTD 23 \eTD \bTD \input bryson \eTD \eTR -% \bTR \bTD 24 \eTD \bTD test \eTD \eTR -% \bTR \bTD 31 \eTD \bTD \input tufte \eTD \eTR -% \bTR \bTD 32 \eTD \bTD \input zapf \eTD \eTR -% \bTR \bTD 33 \eTD \bTD \input bryson \eTD \eTR -% \bTR \bTD 34 \eTD \bTD test \eTD \eTR -% \eTABLE} -% \dorecurse{10}{\input tufte } -% \stoptext diff --git a/tex/context/base/task-ini.lua b/tex/context/base/task-ini.lua index 0049cf512..7ba20fa20 100644 --- a/tex/context/base/task-ini.lua +++ b/tex/context/base/task-ini.lua @@ -9,37 +9,43 @@ if not modules then modules = { } end modules ['task-ini'] = { -- this is a temporary solution, we need to isolate some modules and then -- the load order can determine the trickery to be applied to node lists -tasks.appendaction("processors", "normalizers", "fonts.collections.process", nil) -tasks.appendaction("processors", "normalizers", "fonts.checkers.missing", nil) +tasks.appendaction("processors", "normalizers", "fonts.collections.process") +tasks.appendaction("processors", "normalizers", "fonts.checkers.missing") -tasks.appendaction("processors", "characters", "chars.handle_mirroring", nil, "notail") -tasks.appendaction("processors", "characters", "chars.handle_casing", nil, "notail") -tasks.appendaction("processors", "characters", "chars.handle_breakpoints", nil, "notail") -tasks.appendaction("processors", "characters", "scripts.preprocess", nil, "notail") -- this will be more generalized +tasks.appendaction("processors", "characters", "chars.handle_mirroring") +tasks.appendaction("processors", "characters", "chars.handle_casing") +tasks.appendaction("processors", "characters", "chars.handle_breakpoints") +tasks.appendaction("processors", "characters", "scripts.preprocess") -tasks.appendaction("processors", "words", "kernel.hyphenation", nil) -tasks.appendaction("processors", "words", "languages.words.check", nil, "notail") +tasks.appendaction("processors", "words", "kernel.hyphenation") +tasks.appendaction("processors", "words", "languages.words.check") -tasks.appendaction("processors", "fonts", "nodes.process_characters", nil, "notail") -tasks.appendaction("processors", "fonts", "nodes.inject_kerns", nil, "nohead") -tasks.appendaction("processors", "fonts", "nodes.protect_glyphs", nil, "nohead") -tasks.appendaction("processors", "fonts", "kernel.ligaturing", nil) -tasks.appendaction("processors", "fonts", "kernel.kerning", nil) +tasks.appendaction("processors", "fonts", "nodes.process_characters") +tasks.appendaction("processors", "fonts", "nodes.inject_kerns") +tasks.appendaction("processors", "fonts", "nodes.protect_glyphs", nil, "nohead") +tasks.appendaction("processors", "fonts", "kernel.ligaturing") +tasks.appendaction("processors", "fonts", "kernel.kerning") -tasks.appendaction("processors", "lists", "lists.handle_spacing", nil, "notail") -tasks.appendaction("processors", "lists", "lists.handle_kerning", nil, "notail") +tasks.appendaction("processors", "lists", "lists.handle_spacing") +tasks.appendaction("processors", "lists", "lists.handle_kerning") -tasks.appendaction("shipouts", "normalizers", "nodes.cleanup_page", nil, "notail") +tasks.appendaction("shipouts", "normalizers", "nodes.cleanup_page") +tasks.appendaction("shipouts", "normalizers", "nodes.add_references") +tasks.appendaction("shipouts", "normalizers", "nodes.add_destinations") -tasks.appendaction("shipouts", "finishers", "shipouts.handle_color", nil, "notail") -tasks.appendaction("shipouts", "finishers", "shipouts.handle_transparency", nil, "notail") -tasks.appendaction("shipouts", "finishers", "shipouts.handle_overprint", nil, "notail") -tasks.appendaction("shipouts", "finishers", "shipouts.handle_negative", nil, "notail") -tasks.appendaction("shipouts", "finishers", "shipouts.handle_effect", nil, "notail") -tasks.appendaction("shipouts", "finishers", "shipouts.handle_viewerlayer", nil, "notail") +tasks.appendaction("shipouts", "finishers", "shipouts.handle_color") +tasks.appendaction("shipouts", "finishers", "shipouts.handle_transparency") +tasks.appendaction("shipouts", "finishers", "shipouts.handle_overprint") +tasks.appendaction("shipouts", "finishers", "shipouts.handle_negative") +tasks.appendaction("shipouts", "finishers", "shipouts.handle_effect") +tasks.appendaction("shipouts", "finishers", "shipouts.handle_viewerlayer") -tasks.appendaction("math", "normalizers", "noads.relocate_characters", nil, "nohead") -tasks.appendaction("math", "normalizers", "noads.resize_characters", nil, "nohead") -tasks.appendaction("math", "normalizers", "noads.respace_characters", nil, "nohead") +tasks.appendaction("math", "normalizers", "noads.relocate_characters", nil, "nohead") +tasks.appendaction("math", "normalizers", "noads.resize_characters", nil, "nohead") +tasks.appendaction("math", "normalizers", "noads.respace_characters", nil, "nohead") -tasks.appendaction("math", "builders", "noads.mlist_to_hlist", nil, "notail") +tasks.appendaction("math", "builders", "noads.mlist_to_hlist") + +-- quite experimental + +tasks.appendaction("finalizers", "lists", "nodes.repackage_graphicvadjust") diff --git a/tex/context/base/thrd-ran.mkii b/tex/context/base/thrd-ran.mkii new file mode 100644 index 000000000..276a4f624 --- /dev/null +++ b/tex/context/base/thrd-ran.mkii @@ -0,0 +1,168 @@ +% Since we cannot be sure that this file is available at any +% system, we have copied the original in this file. These +% macros are encapsulates and extended in supp-ran.tex. +% +% This module is slightly recoded to bring it more in tune +% with \CONTEXT's scratch registers and protection mechanisms. + +% RANDOM.TEX v.1 (Donald Arseneau) +% Generating "random" numbers in TeX. +% +% Random integers are generated in the range 1 to 2147483646 by the +% macro \nextrandom. The result is returned in the counter \randomi. +% Do not change \randomi except, perhaps, to initialize it at some +% random value. If you do not initialize it, it will be initialized +% using the time and date. (This is a sparse initialization, giving +% fewer than a million different starting values, but you should use +% other sources of numbers if they are available--just remember that +% most of the numbers available to TeX are not at all random.) +% +% The \nextrandom command is not very useful by itself, unless you +% have exactly 2147483646 things to choose from. Much more useful +% is the \setrannum command which sets a given counter to a random +% value within a specified range. There are three parameters: +% \setrannum {} {} {}. For example, to +% simulate a die-roll: \setrannum{\die}{1}{6} \ifcase\die... . +% +% If you need random numbers that are not integers, you will have to +% use dimen registers and \setrandimen. For example, to set a random +% page width: \setrandimen \hsize{3in}{6.5in}. The "\pointless" macro +% will remove the "pt" that TeX gives so you can use the dimensions +% as pure `real' numbers. In that case, specify the range in pt units. +% For example, +% +% \setrandimen\answer{2.71828pt}{3.14159pt} +% The answer is \pointless\answer. +% +% The random number generator is the one by Lewis, Goodman, and Miller +% (1969) and used as "ran0" in "Numerical Recipies" using Schrage's +% method for avoiding overflows. The multiplier is 16807 (7^5), the +% added constant is 0, and the modulus is 2147483647 (2^{31}-1). The +% range of integers generated is 1 - 2147483646. A smaller range would +% reduce the complexity of the macros a bit, but not much--most of the +% code deals with initialization and type-conversion. On the other hand, +% the large range may be wasted due to the sparse seed initialization. + +% original code +% +% \newcount\randomi % the random number seed (while executing) +% \global\randomi\catcode`\@ % scratch variable during definitions +% \catcode`\@=11 +% +% \def\nextrandom{\begingroup +% \ifnum\randomi<\plusone % then initialize with time +% \global\randomi\time +% \global\multiply\randomi388 \global\advance\randomi\year +% \global\multiply\randomi31 \global\advance\randomi\day +% \global\multiply\randomi97 \global\advance\randomi\month +% \message{Randomizer initialized to \the\randomi.}% +% \nextrandom \nextrandom \nextrandom +% \fi +% \count@ii\randomi +% \divide\count@ii 127773 % modulus = multiplier * 127773 + 2836 +% \count@\count@ii +% \multiply\count@ii 127773 +% \global\advance\randomi-\count@ii % random mod 127773 +% \global\multiply\randomi 16807 +% \multiply\count@ 2836 +% \global\advance\randomi-\count@ +% \ifnum\randomi<\z@ \global\advance\randomi 2147483647\relax\fi +% \endgroup +% } +% +% \countdef\count@ii=2 % use only in boxes! +% \ifx\@tempcnta\undefined \csname newcount\endcsname \@tempcnta \fi +% \ifx\@tempcntb\undefined \csname newcount\endcsname \@tempcntb \fi +% +% \def\setrannum#1#2#3{% count register, minimum, maximum +% \@tempcnta#3\advance\@tempcnta-#2\advance\@tempcnta\@ne +% \@tempcntb 2147483645 % = m - 2 = 2^{31} - 3 +% \divide\@tempcntb\@tempcnta +% \getr@nval +% \advance\ranval#2\relax +% #1\ranval +% } +% +% \def\setrandim#1#2#3{% dimen register, minimum length, maximum length +% \dimen@#2\dimen@ii#3\relax +% \setrannum\ranval\dimen@\dimen@ii +% #1\ranval sp\relax +% } +% +% \def\getr@nval{% The values in \@tempcnta and \@tempcntb are parameters +% \nextrandom +% \ranval\randomi \advance\ranval\m@ne \divide\ranval\@tempcntb +% \ifnum\ranval<\@tempcnta\else \expandafter\getr@nval \fi +% } +% +% %D The next macro is not needed in \CONTEXT, which provides +% %D the \type {\withoutpt} macro. +% %D +% %D \starttyping +% %D \def\pointless{\expandafter\PoinTless\the} +% %D {\catcode`p=12 \catcode`t=12 \gdef\PoinTless#1pt{#1}} +% %D \stoptyping +% +% \catcode`\@=\randomi +% \global\randomi=0 +% \newcount\ranval + +% the recoded version, using \CONTEXT\ methods and variables; +% the magic is kept untouched + +\unprotect + +\newcount\randomi % the random number seed (while executing) +\newcount\ranval + +\ifx\m!systems\undefined \def\m!systems{systems} \fi + +\def\nextrandom + {\begingroup + \ifnum\randomi<\plusone % then initialize with time + \global\randomi\time + \global\multiply\randomi388 \global\advance\randomi\year + \global\multiply\randomi 31 \global\advance\randomi\day + \global\multiply\randomi 97 \global\advance\randomi\month + \writestatus\m!systems{randomizer starts with \the\randomi}% + \nextrandom \nextrandom \nextrandom + \fi + \!!countd\randomi + \divide\!!countd 127773 % modulus = multiplier * 127773 + 2836 + \!!countc\!!countd + \multiply\!!countd 127773 + \global\advance\randomi-\!!countd % random mod 127773 + \global\multiply\randomi 16807 + \multiply\!!countc 2836 + \global\advance\randomi-\!!countc\relax + \ifnum\randomi<\zerocount + \global\advance\randomi 2147483647 + \fi + \endgroup} + +\def\setrannum#1#2#3% count register, minimum, maximum + {\!!counta#3% + \advance\!!counta-#2% + \advance\!!counta\plusone + \!!countb 2147483645 % = m - 2 = 2^{31} - 3 + \divide\!!countb\!!counta + \getr@nval + \advance\ranval#2% + #1\ranval} + +\def\setrandim#1#2#3% dimen register, minimum length, maximum length + {\!!dimenc#2% + \!!dimend#3% + \setrannum\ranval\!!dimenc\!!dimend + #1\ranval\s!sp\relax} % \s!sp not needed + +\def\getr@nval % The values in \!!counta and \!!countb are parameters + {\nextrandom + \ranval\randomi + \advance\ranval\minusone + \divide\ranval\!!countb + \ifnum\ranval<\!!counta \else + \expandafter\getr@nval + \fi} + +\protect \endinput diff --git a/tex/context/base/thrd-ran.tex b/tex/context/base/thrd-ran.tex deleted file mode 100644 index 276a4f624..000000000 --- a/tex/context/base/thrd-ran.tex +++ /dev/null @@ -1,168 +0,0 @@ -% Since we cannot be sure that this file is available at any -% system, we have copied the original in this file. These -% macros are encapsulates and extended in supp-ran.tex. -% -% This module is slightly recoded to bring it more in tune -% with \CONTEXT's scratch registers and protection mechanisms. - -% RANDOM.TEX v.1 (Donald Arseneau) -% Generating "random" numbers in TeX. -% -% Random integers are generated in the range 1 to 2147483646 by the -% macro \nextrandom. The result is returned in the counter \randomi. -% Do not change \randomi except, perhaps, to initialize it at some -% random value. If you do not initialize it, it will be initialized -% using the time and date. (This is a sparse initialization, giving -% fewer than a million different starting values, but you should use -% other sources of numbers if they are available--just remember that -% most of the numbers available to TeX are not at all random.) -% -% The \nextrandom command is not very useful by itself, unless you -% have exactly 2147483646 things to choose from. Much more useful -% is the \setrannum command which sets a given counter to a random -% value within a specified range. There are three parameters: -% \setrannum {} {} {}. For example, to -% simulate a die-roll: \setrannum{\die}{1}{6} \ifcase\die... . -% -% If you need random numbers that are not integers, you will have to -% use dimen registers and \setrandimen. For example, to set a random -% page width: \setrandimen \hsize{3in}{6.5in}. The "\pointless" macro -% will remove the "pt" that TeX gives so you can use the dimensions -% as pure `real' numbers. In that case, specify the range in pt units. -% For example, -% -% \setrandimen\answer{2.71828pt}{3.14159pt} -% The answer is \pointless\answer. -% -% The random number generator is the one by Lewis, Goodman, and Miller -% (1969) and used as "ran0" in "Numerical Recipies" using Schrage's -% method for avoiding overflows. The multiplier is 16807 (7^5), the -% added constant is 0, and the modulus is 2147483647 (2^{31}-1). The -% range of integers generated is 1 - 2147483646. A smaller range would -% reduce the complexity of the macros a bit, but not much--most of the -% code deals with initialization and type-conversion. On the other hand, -% the large range may be wasted due to the sparse seed initialization. - -% original code -% -% \newcount\randomi % the random number seed (while executing) -% \global\randomi\catcode`\@ % scratch variable during definitions -% \catcode`\@=11 -% -% \def\nextrandom{\begingroup -% \ifnum\randomi<\plusone % then initialize with time -% \global\randomi\time -% \global\multiply\randomi388 \global\advance\randomi\year -% \global\multiply\randomi31 \global\advance\randomi\day -% \global\multiply\randomi97 \global\advance\randomi\month -% \message{Randomizer initialized to \the\randomi.}% -% \nextrandom \nextrandom \nextrandom -% \fi -% \count@ii\randomi -% \divide\count@ii 127773 % modulus = multiplier * 127773 + 2836 -% \count@\count@ii -% \multiply\count@ii 127773 -% \global\advance\randomi-\count@ii % random mod 127773 -% \global\multiply\randomi 16807 -% \multiply\count@ 2836 -% \global\advance\randomi-\count@ -% \ifnum\randomi<\z@ \global\advance\randomi 2147483647\relax\fi -% \endgroup -% } -% -% \countdef\count@ii=2 % use only in boxes! -% \ifx\@tempcnta\undefined \csname newcount\endcsname \@tempcnta \fi -% \ifx\@tempcntb\undefined \csname newcount\endcsname \@tempcntb \fi -% -% \def\setrannum#1#2#3{% count register, minimum, maximum -% \@tempcnta#3\advance\@tempcnta-#2\advance\@tempcnta\@ne -% \@tempcntb 2147483645 % = m - 2 = 2^{31} - 3 -% \divide\@tempcntb\@tempcnta -% \getr@nval -% \advance\ranval#2\relax -% #1\ranval -% } -% -% \def\setrandim#1#2#3{% dimen register, minimum length, maximum length -% \dimen@#2\dimen@ii#3\relax -% \setrannum\ranval\dimen@\dimen@ii -% #1\ranval sp\relax -% } -% -% \def\getr@nval{% The values in \@tempcnta and \@tempcntb are parameters -% \nextrandom -% \ranval\randomi \advance\ranval\m@ne \divide\ranval\@tempcntb -% \ifnum\ranval<\@tempcnta\else \expandafter\getr@nval \fi -% } -% -% %D The next macro is not needed in \CONTEXT, which provides -% %D the \type {\withoutpt} macro. -% %D -% %D \starttyping -% %D \def\pointless{\expandafter\PoinTless\the} -% %D {\catcode`p=12 \catcode`t=12 \gdef\PoinTless#1pt{#1}} -% %D \stoptyping -% -% \catcode`\@=\randomi -% \global\randomi=0 -% \newcount\ranval - -% the recoded version, using \CONTEXT\ methods and variables; -% the magic is kept untouched - -\unprotect - -\newcount\randomi % the random number seed (while executing) -\newcount\ranval - -\ifx\m!systems\undefined \def\m!systems{systems} \fi - -\def\nextrandom - {\begingroup - \ifnum\randomi<\plusone % then initialize with time - \global\randomi\time - \global\multiply\randomi388 \global\advance\randomi\year - \global\multiply\randomi 31 \global\advance\randomi\day - \global\multiply\randomi 97 \global\advance\randomi\month - \writestatus\m!systems{randomizer starts with \the\randomi}% - \nextrandom \nextrandom \nextrandom - \fi - \!!countd\randomi - \divide\!!countd 127773 % modulus = multiplier * 127773 + 2836 - \!!countc\!!countd - \multiply\!!countd 127773 - \global\advance\randomi-\!!countd % random mod 127773 - \global\multiply\randomi 16807 - \multiply\!!countc 2836 - \global\advance\randomi-\!!countc\relax - \ifnum\randomi<\zerocount - \global\advance\randomi 2147483647 - \fi - \endgroup} - -\def\setrannum#1#2#3% count register, minimum, maximum - {\!!counta#3% - \advance\!!counta-#2% - \advance\!!counta\plusone - \!!countb 2147483645 % = m - 2 = 2^{31} - 3 - \divide\!!countb\!!counta - \getr@nval - \advance\ranval#2% - #1\ranval} - -\def\setrandim#1#2#3% dimen register, minimum length, maximum length - {\!!dimenc#2% - \!!dimend#3% - \setrannum\ranval\!!dimenc\!!dimend - #1\ranval\s!sp\relax} % \s!sp not needed - -\def\getr@nval % The values in \!!counta and \!!countb are parameters - {\nextrandom - \ranval\randomi - \advance\ranval\minusone - \divide\ranval\!!countb - \ifnum\ranval<\!!counta \else - \expandafter\getr@nval - \fi} - -\protect \endinput diff --git a/tex/context/base/thrd-trg.mkii b/tex/context/base/thrd-trg.mkii new file mode 100644 index 000000000..c0106f5a3 --- /dev/null +++ b/tex/context/base/thrd-trg.mkii @@ -0,0 +1,127 @@ +%D In order to support rotation over arbitrary angles, we need a sine +%D and cosine calculator. For this purpose we borrow a few macros by +%D David Carlisle (his trig package). Because local variables are +%D used, I patched the macros a bit. Also, I used a few different names +%D for variabels and macros and use existing auxiliary macros. + +\unprotect + +% compare: \number 0.5 \number -0.5 \number 1.5 \number -1.5 +% +% so we need: + +\def\realnumber#1{\withoutpt\the\dimexpr#1\points\relax} % brrr + +\chardef \@iv = 4 +\chardef \@xc = 90 % was \nin@ty +\chardef \@clxx = 180 +\chardef \@lxxi = 71 +\mathchardef \@mmmmlxviii = 4068 +\mathchardef \@xvi@k = 16384 + +\chardef \tr@coeffz = 72 +\chardef \tr@coefb = 42 +\mathchardef \tr@coefc = 840 +\mathchardef \tr@coefd = 5040 + +\def\tg@series + {\!!dimena\@lxxi\!!dimena + \divide\!!dimena\@mmmmlxviii + \edef\!!stringa{\withoutpt\the\!!dimena}% + \!!dimena\!!stringa\!!dimena + \edef\!!stringb{\withoutpt\the\!!dimena}% + \divide\!!dimena\tr@coeffz + \advance\!!dimena\minusone\onepoint + \!!dimena\!!stringb\!!dimena + \advance\!!dimena \tr@coefb\onepoint + \!!dimena\!!stringb\!!dimena + \advance\!!dimena -\tr@coefc\onepoint + \!!dimena\!!stringb\!!dimena + \advance\!!dimena \tr@coefd\onepoint + \!!dimena\!!stringa\!!dimena + \divide\!!dimena \tr@coefd} + +\def\tg@reduce#1#2% + {\!!dimena#1#2\@xc\onepoint + \advance\!!dimena#2-\@clxx\onepoint + \!!dimena-\!!dimena + \tg@@sin} + +\def\tg@@sin + {\ifdim\tg@reduce>+\else\ifdim\tg@reduce<-\else + \tg@series + \fi\fi} + +%D Calculating a sine is a two step process: first a value is +%D calculated, and afterwards it can be used. This saves redundant +%D calculations. + +\def\calculatesin#1% + {{\expandafter\ifx\csname sin \realnumber{#1}\endcsname\relax + \!!dimena#1\onepoint + \tg@@sin + \expandafter\xdef\csname sin \realnumber{#1}\endcsname{\withoutpt\the\!!dimena}% + \fi}} + +\def\calculatecos#1% + {{\expandafter\ifx\csname cos \realnumber{#1}\endcsname\relax + \!!dimena\@xc\onepoint + \advance\!!dimena-#1\onepoint + \tg@@sin + \expandafter\xdef\csname cos \realnumber{#1}\endcsname{\withoutpt\the\!!dimena}% + \fi}} + +\def\calculatetan#1% + {{\expandafter\ifx\csname tan \realnumber{#1}\endcsname\relax + \calculatesin{#1}% + \calculatecos{#1}% + \!!dimena\calculatedcos{#1}\onepoint + \divide\!!dimena\@iv + \!!dimenb\calculatedsin{#1}\onepoint + \!!dimenb\@xvi@k\!!dimenb + \divide\!!dimenb\!!dimena + \expandafter\xdef\csname tan \realnumber{#1}\endcsname{\withoutpt\the\!!dimenb}% + \fi}} + +%D The results are accessed with: + +\def\calculatedsin#1{\csname sin \realnumber{#1}\endcsname} +\def\calculatedcos#1{\csname cos \realnumber{#1}\endcsname} +\def\calculatedtan#1{\csname tan \realnumber{#1}\endcsname} + +%D A more save implementation would be: + +\def\calculatedsin#1{\executeifdefined{sin \realnumber{#1}}\!!zerocount} +\def\calculatedcos#1{\executeifdefined{cos \realnumber{#1}}\!!plusone } +\def\calculatedtan#1{\executeifdefined{tan \realnumber{#1}}\!!zerocount} + +%D The following permits cleaner overloading (\MKIV\ will only have +%D these): + +\def\setcalculatedsin#1#2{\calculatesin{#2}\edef#1{\calculatedsin{#2}}} +\def\setcalculatedcos#1#2{\calculatecos{#2}\edef#1{\calculatedcos{#2}}} +\def\setcalculatedtan#1#2{\calculatetan{#2}\edef#1{\calculatedtan{#2}}} + +%D A few values are predefined, although, on todays systems there +%D is no real reason for that. I've added the 270 ones and changed +%D the -90 tan. Also, I prefer text (\type {\!!..} instead of +%D counters \type {\..}. + +\expandafter\let\csname sin \realnumber{ 0}\endcsname\!!zerocount +\expandafter\let\csname cos \realnumber{ 0}\endcsname\!!plusone +\expandafter\let\csname sin \realnumber{ 90}\endcsname\!!plusone +\expandafter\let\csname cos \realnumber{ 90}\endcsname\!!zerocount +\expandafter\let\csname sin \realnumber{180}\endcsname\!!zerocount +\expandafter\let\csname cos \realnumber{180}\endcsname\!!minusone +\expandafter\let\csname sin \realnumber{270}\endcsname\!!minusone +\expandafter\let\csname cos \realnumber{270}\endcsname\!!zerocount + +\expandafter\let\csname sin \realnumber{-90}\endcsname\!!minusone +\expandafter\let\csname cos \realnumber{-90}\endcsname\!!zerocount + +\expandafter\def\csname tan \realnumber{ 90}\endcsname{\writestatus\m!systems{infinite tan +90}} +\expandafter\def\csname tan \realnumber{-90}\endcsname{\writestatus\m!systems{infinite tan -90}} + +%D Usage: \type {\calculatesin{10}} and \type {\calculatedsin{10}} + +\protect \endinput diff --git a/tex/context/base/thrd-trg.tex b/tex/context/base/thrd-trg.tex deleted file mode 100644 index c0106f5a3..000000000 --- a/tex/context/base/thrd-trg.tex +++ /dev/null @@ -1,127 +0,0 @@ -%D In order to support rotation over arbitrary angles, we need a sine -%D and cosine calculator. For this purpose we borrow a few macros by -%D David Carlisle (his trig package). Because local variables are -%D used, I patched the macros a bit. Also, I used a few different names -%D for variabels and macros and use existing auxiliary macros. - -\unprotect - -% compare: \number 0.5 \number -0.5 \number 1.5 \number -1.5 -% -% so we need: - -\def\realnumber#1{\withoutpt\the\dimexpr#1\points\relax} % brrr - -\chardef \@iv = 4 -\chardef \@xc = 90 % was \nin@ty -\chardef \@clxx = 180 -\chardef \@lxxi = 71 -\mathchardef \@mmmmlxviii = 4068 -\mathchardef \@xvi@k = 16384 - -\chardef \tr@coeffz = 72 -\chardef \tr@coefb = 42 -\mathchardef \tr@coefc = 840 -\mathchardef \tr@coefd = 5040 - -\def\tg@series - {\!!dimena\@lxxi\!!dimena - \divide\!!dimena\@mmmmlxviii - \edef\!!stringa{\withoutpt\the\!!dimena}% - \!!dimena\!!stringa\!!dimena - \edef\!!stringb{\withoutpt\the\!!dimena}% - \divide\!!dimena\tr@coeffz - \advance\!!dimena\minusone\onepoint - \!!dimena\!!stringb\!!dimena - \advance\!!dimena \tr@coefb\onepoint - \!!dimena\!!stringb\!!dimena - \advance\!!dimena -\tr@coefc\onepoint - \!!dimena\!!stringb\!!dimena - \advance\!!dimena \tr@coefd\onepoint - \!!dimena\!!stringa\!!dimena - \divide\!!dimena \tr@coefd} - -\def\tg@reduce#1#2% - {\!!dimena#1#2\@xc\onepoint - \advance\!!dimena#2-\@clxx\onepoint - \!!dimena-\!!dimena - \tg@@sin} - -\def\tg@@sin - {\ifdim\tg@reduce>+\else\ifdim\tg@reduce<-\else - \tg@series - \fi\fi} - -%D Calculating a sine is a two step process: first a value is -%D calculated, and afterwards it can be used. This saves redundant -%D calculations. - -\def\calculatesin#1% - {{\expandafter\ifx\csname sin \realnumber{#1}\endcsname\relax - \!!dimena#1\onepoint - \tg@@sin - \expandafter\xdef\csname sin \realnumber{#1}\endcsname{\withoutpt\the\!!dimena}% - \fi}} - -\def\calculatecos#1% - {{\expandafter\ifx\csname cos \realnumber{#1}\endcsname\relax - \!!dimena\@xc\onepoint - \advance\!!dimena-#1\onepoint - \tg@@sin - \expandafter\xdef\csname cos \realnumber{#1}\endcsname{\withoutpt\the\!!dimena}% - \fi}} - -\def\calculatetan#1% - {{\expandafter\ifx\csname tan \realnumber{#1}\endcsname\relax - \calculatesin{#1}% - \calculatecos{#1}% - \!!dimena\calculatedcos{#1}\onepoint - \divide\!!dimena\@iv - \!!dimenb\calculatedsin{#1}\onepoint - \!!dimenb\@xvi@k\!!dimenb - \divide\!!dimenb\!!dimena - \expandafter\xdef\csname tan \realnumber{#1}\endcsname{\withoutpt\the\!!dimenb}% - \fi}} - -%D The results are accessed with: - -\def\calculatedsin#1{\csname sin \realnumber{#1}\endcsname} -\def\calculatedcos#1{\csname cos \realnumber{#1}\endcsname} -\def\calculatedtan#1{\csname tan \realnumber{#1}\endcsname} - -%D A more save implementation would be: - -\def\calculatedsin#1{\executeifdefined{sin \realnumber{#1}}\!!zerocount} -\def\calculatedcos#1{\executeifdefined{cos \realnumber{#1}}\!!plusone } -\def\calculatedtan#1{\executeifdefined{tan \realnumber{#1}}\!!zerocount} - -%D The following permits cleaner overloading (\MKIV\ will only have -%D these): - -\def\setcalculatedsin#1#2{\calculatesin{#2}\edef#1{\calculatedsin{#2}}} -\def\setcalculatedcos#1#2{\calculatecos{#2}\edef#1{\calculatedcos{#2}}} -\def\setcalculatedtan#1#2{\calculatetan{#2}\edef#1{\calculatedtan{#2}}} - -%D A few values are predefined, although, on todays systems there -%D is no real reason for that. I've added the 270 ones and changed -%D the -90 tan. Also, I prefer text (\type {\!!..} instead of -%D counters \type {\..}. - -\expandafter\let\csname sin \realnumber{ 0}\endcsname\!!zerocount -\expandafter\let\csname cos \realnumber{ 0}\endcsname\!!plusone -\expandafter\let\csname sin \realnumber{ 90}\endcsname\!!plusone -\expandafter\let\csname cos \realnumber{ 90}\endcsname\!!zerocount -\expandafter\let\csname sin \realnumber{180}\endcsname\!!zerocount -\expandafter\let\csname cos \realnumber{180}\endcsname\!!minusone -\expandafter\let\csname sin \realnumber{270}\endcsname\!!minusone -\expandafter\let\csname cos \realnumber{270}\endcsname\!!zerocount - -\expandafter\let\csname sin \realnumber{-90}\endcsname\!!minusone -\expandafter\let\csname cos \realnumber{-90}\endcsname\!!zerocount - -\expandafter\def\csname tan \realnumber{ 90}\endcsname{\writestatus\m!systems{infinite tan +90}} -\expandafter\def\csname tan \realnumber{-90}\endcsname{\writestatus\m!systems{infinite tan -90}} - -%D Usage: \type {\calculatesin{10}} and \type {\calculatedsin{10}} - -\protect \endinput diff --git a/tex/context/base/todo-mkii.tex b/tex/context/base/todo-mkii.tex deleted file mode 100644 index 5a0f340bd..000000000 --- a/tex/context/base/todo-mkii.tex +++ /dev/null @@ -1 +0,0 @@ -MKII Todo List diff --git a/tex/context/base/todo-mkiv.tex b/tex/context/base/todo-mkiv.tex deleted file mode 100644 index 94fd6d478..000000000 --- a/tex/context/base/todo-mkiv.tex +++ /dev/null @@ -1,6 +0,0 @@ -MKIV Todo List - --- language dependent case swapping (using char-map.lua) --- figures (locating and scaling) --- numbering --- cross references diff --git a/tex/context/base/trac-inf.lua b/tex/context/base/trac-inf.lua index 41a9e7b48..d83dc8d2f 100644 --- a/tex/context/base/trac-inf.lua +++ b/tex/context/base/trac-inf.lua @@ -107,6 +107,7 @@ function statistics.show(reporter) reporter(s[1],r,n) end end + texio.write_nl("") -- final newline statistics.enable = false end end diff --git a/tex/context/base/trac-log.lua b/tex/context/base/trac-log.lua index 1fb25c5c7..d05bc9fec 100644 --- a/tex/context/base/trac-log.lua +++ b/tex/context/base/trac-log.lua @@ -9,6 +9,7 @@ if not modules then modules = { } end modules ['luat-log'] = { -- this is old code that needs an overhaul local write_nl, write, format = texio.write_nl or print, texio.write or io.write, string.format +local texcount = tex and tex.count if texlua then write_nl = print @@ -88,10 +89,8 @@ function logs.tex.line(fmt,...) -- new end end -local texcount = tex and tex.count - function logs.tex.start_page_number() - local real, user, sub = texcount[0], texcount[1], texcount[2] + local real, user, sub = texcount.realpageno, texcount.userpageno, texcount.subpageno if real > 0 then if user > 0 then if sub > 0 then @@ -146,7 +145,7 @@ function logs.xml.stop_run() end function logs.xml.start_page_number() - write_nl(format("

1ex \vskip-\scratchdimen \vbox to \scratchdimen {\vss \hbox to 3em {\hss - \localstartcolor[\s!white]% + \startcolor[\s!white]% \ifdim##1\points=\zeropoint#1\else##1\fi - \localstopcolor + \stopcolor \hss}% \vss}% \fi}}% @@ -441,21 +441,21 @@ \c!m=##4##2\else0\fi, \c!y=##5##2\else0\fi, \c!k=##6##2\else0\fi]% - \localstartcolor[\s!dummy]% + \startcolor[\s!dummy]% \vrule \!!width \scratchdimen \!!height \colormarklength \!!depth \zeropoint - \localstopcolor + \stopcolor \ifdim\scratchdimen>2em \hskip-\scratchdimen \vbox to \colormarklength {\vss \hbox to \scratchdimen {\hss - \localstartcolor[\s!white]% + \startcolor[\s!white]% \ifdim##2\points=.5\points##2~\fi##1% - \localstopcolor + \stopcolor \hss} \vss}% \fi}% @@ -480,19 +480,19 @@ \divide\scratchdimen 14 \def\docommand##1% {\definecolor[\s!dummy][\c!s=##1]% - \localstartcolor[\s!dummy]% + \startcolor[\s!dummy]% \vrule \!!width \scratchdimen \!!height \colormarklength \!!depth \zeropoint - \localstopcolor + \stopcolor \ifdim\scratchdimen>2em \hskip-\scratchdimen \vbox to \colormarklength {\vss - \localstartcolor[\s!white]% + \startcolor[\s!white]% \hbox to \scratchdimen{\hss##1\hss} - \localstopcolor + \stopcolor \vss}% \fi}% \processcommalist[1,.95,.9,.85,.8,.75,.7,.6,.5,.4,.3,.2,.1,0]\docommand}} diff --git a/tex/context/base/type-akb.tex b/tex/context/base/type-akb.tex deleted file mode 100644 index 7c02144d5..000000000 --- a/tex/context/base/type-akb.tex +++ /dev/null @@ -1,253 +0,0 @@ -%D \module -%D [ file=type-akb, -%D version=2001.07.08, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Adobe's Famous Gang of Fonts, -%D author=Patrick Gundlach, -%D date=\currentdate, -%D copyright={Patrick Gundlach / PRAGMA}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Last Change: Tue Mar 18 16:01:03 2003 - -%D This module is written by Patrick Gundlach (patrick@gundla.ch) -%D and maps to the standard postscript fonts conforming the -%D psnfss system as used by \LaTeX. -%D -%D \starttyping -%D \setupencoding[default=texnansi] -%D \usetypescript[adobekb][\defaultencoding] -%D \stoptyping -%D -%D The following is not needed since the file is already -%D registered: -%D -%D \starttyping -%D \usetypescriptfile[akb] -%D \stoptyping - -\starttypescriptcollection[adobe kb mappings] - -\starttypescript [adobekb] [8r] - -\loadmapfile[8r-base.map] - -\definefontsynonym [8r-utmr8a] [ptmr8r] [encoding=8r] -\definefontsynonym [8r-utmri8a] [ptmri8r] [encoding=8r] -\definefontsynonym [8r-utmb8a] [ptmb8r] [encoding=8r] -\definefontsynonym [8r-utmbi8a] [ptmbi8r] [encoding=8r] - -\definefontsynonym [8r-utmr8a-slanted-167] [ptmro8r] [encoding=8r] -\definefontsynonym [8r-utmb8a-slanted-167] [ptmbo8r] [encoding=8r] - -\definefontsynonym [8r-uhvr8a] [phvr8r] [encoding=8r] -\definefontsynonym [8r-uhvro8a] [phvro8r] [encoding=8r] -\definefontsynonym [8r-uhvb8a] [phvb8r] [encoding=8r] -\definefontsynonym [8r-uhvbo8a] [phvbo8r] [encoding=8r] - -\definefontsynonym [8r-ucrr8a] [pcrr8r] [encoding=8r] -\definefontsynonym [8r-ucrb8a] [pcrb8r] [encoding=8r] -\definefontsynonym [8r-ucrro8a] [pcrro8r] [encoding=8r] -\definefontsynonym [8r-ucrbo8a] [pcrbo8r] [encoding=8r] - -\definefontsynonym [8r-uplr8a] [pplr8r] [encoding=8r] -\definefontsynonym [8r-uplri8a] [pplri8r] [encoding=8r] -\definefontsynonym [8r-uplb8a] [pplb8r] [encoding=8r] -\definefontsynonym [8r-uplbi8a] [pplbi8r] [encoding=8r] -\definefontsynonym [8r-uplr8a-slanted-167] [pplro8r] [encoding=8r] -\definefontsynonym [8r-uplb8a-slanted-167] [pplbo8r] [encoding=8r] -\definefontsynonym [8r-uplr8a-capitalized-800] [pplr8r] [encoding=8r] - -\definefontsynonym [8r-ubkl8a] [pbkl8r] [encoding=8r] -\definefontsynonym [8r-ubkli8a] [pbkli8r] [encoding=8r] -\definefontsynonym [8r-ubkd8a] [pbkd8r] [encoding=8r] -\definefontsynonym [8r-ubkdi8a] [pbkdi8r] [encoding=8r] -\definefontsynonym [8r-ubkl8a-slanted-167] [pbklo8r] [encoding=8r] -\definefontsynonym [8r-ubkd8a-slanted-167] [pbkdo8r] [encoding=8r] -\definefontsynonym [8r-ubkl8a-capitalized-800] [pbkl8r] [encoding=8r] - -\definefontsynonym [8r-uzcmi8a] [pzcmi8r] [encoding=8r] - -\definefontsynonym [8r-putr8a] [putr8r] [encoding=8r] -\definefontsynonym [8r-putri8a] [putri8r] [encoding=8r] -\definefontsynonym [8r-putb8a] [putr8r] [encoding=8r] -\definefontsynonym [8r-putbi8a] [putbi8r] [encoding=8r] -\definefontsynonym [8r-putr8a-slanted-167] [putro8r] [encoding=8r] -\definefontsynonym [8r-putb8a-slanted-167] [putbo8r] [encoding=8r] -\definefontsynonym [8r-putr8a-capitalized-800] [putr8r] [encoding=8r] - -\definefontsynonym [8r-bchr8a] [bchr8r] [encoding=8r] -\definefontsynonym [8r-bchri8a] [bchri8r] [encoding=8r] -\definefontsynonym [8r-bchb8a] [bchb8r] [encoding=8r] -\definefontsynonym [8r-bchbi8a] [bchbi8r] [encoding=8r] -\definefontsynonym [8r-bchr8a-slanted-167] [bchro8r] [encoding=8r] -\definefontsynonym [8r-bchb8a-slanted-167] [bchbo8r] [encoding=8r] -\definefontsynonym [8r-bchr8a-capitalized-800] [bchr8r] [encoding=8r] - -\stoptypescript - -\starttypescript [adobekb,berry] [ec] - -\loadmapfile[8r-base.map] -\loadmapfile[ec-base.map] - -\definefontsynonym [ec-utmr8a] [ptmr8t] [encoding=ec] -\definefontsynonym [ec-utmri8a] [ptmri8t] [encoding=ec] -\definefontsynonym [ec-utmb8a] [ptmb8t] [encoding=ec] -\definefontsynonym [ec-utmbi8a] [ptmbi8t] [encoding=ec] - -\definefontsynonym [ec-utmr8a-slanted-167] [ptmro8t] [encoding=ec] -\definefontsynonym [ec-utmb8a-slanted-167] [ptmbo8t] [encoding=ec] - -\definefontsynonym [ec-uhvr8a] [phvr8t] [encoding=ec] -\definefontsynonym [ec-uhvro8a] [phvro8t] [encoding=ec] -\definefontsynonym [ec-uhvb8a] [phvb8t] [encoding=ec] -\definefontsynonym [ec-uhvbo8a] [phvbo8t] [encoding=ec] - -\definefontsynonym [ec-ucrr8a] [pcrr8t] [encoding=ec] -\definefontsynonym [ec-ucrb8a] [pcrb8t] [encoding=ec] -\definefontsynonym [ec-ucrro8a] [pcrro8t] [encoding=ec] -\definefontsynonym [ec-ucrbo8a] [pcrbo8t] [encoding=ec] - -\definefontsynonym [ec-uplr8a] [pplr8t] [encoding=ec] -\definefontsynonym [ec-uplri8a] [pplri8t] [encoding=ec] -\definefontsynonym [ec-uplb8a] [pplb8t] [encoding=ec] -\definefontsynonym [ec-uplbi8a] [pplbi8t] [encoding=ec] -\definefontsynonym [ec-uplr8a-slanted-167] [pplro8t] [encoding=ec] -\definefontsynonym [ec-uplb8a-slanted-167] [pplbo8t] [encoding=ec] -\definefontsynonym [ec-uplr8a-capitalized-800] [pplr8t] [encoding=ec] - -\definefontsynonym [ec-ubkl8a] [pbkl8t] [encoding=ec] -\definefontsynonym [ec-ubkli8a] [pbkli8t] [encoding=ec] -\definefontsynonym [ec-ubkd8a] [pbkd8t] [encoding=ec] -\definefontsynonym [ec-ubkdi8a] [pbkdi8t] [encoding=ec] -\definefontsynonym [ec-ubkl8a-slanted-167] [pbklo8t] [encoding=ec] -\definefontsynonym [ec-ubkd8a-slanted-167] [pbkdo8t] [encoding=ec] -\definefontsynonym [ec-ubkl8a-capitalized-800] [pbkl8t] [encoding=ec] - -\definefontsynonym [ec-uzcmi8a] [pzcmi8t] [encoding=ec] - -\definefontsynonym [ec-putr8a] [putr8t] [encoding=ec] -\definefontsynonym [ec-putri8a] [putri8t] [encoding=ec] -\definefontsynonym [ec-putb8a] [putr8t] [encoding=ec] -\definefontsynonym [ec-putbi8a] [putbi8t] [encoding=ec] -\definefontsynonym [ec-putr8a-slanted-167] [putro8t] [encoding=ec] -\definefontsynonym [ec-putb8a-slanted-167] [putbo8t] [encoding=ec] -\definefontsynonym [ec-putr8a-capitalized-800] [putr8t] [encoding=ec] - -\definefontsynonym [ec-bchr8a] [bchr8t] [encoding=ec] -\definefontsynonym [ec-bchri8a] [bchri8t] [encoding=ec] -\definefontsynonym [ec-bchb8a] [bchb8t] [encoding=ec] -\definefontsynonym [ec-bchbi8a] [bchbi8t] [encoding=ec] -\definefontsynonym [ec-bchr8a-slanted-167] [bchro8t] [encoding=ec] -\definefontsynonym [ec-bchb8a-slanted-167] [bchbo8t] [encoding=ec] -\definefontsynonym [ec-bchr8a-capitalized-800] [bchr8t] [encoding=ec] - -\stoptypescript - -% the following fonts are normally not present on tex live - -\starttypescript [adobekb,berry] [texnansi] - -\loadmapfile[texnansi-base.map] - -\definefontsynonym [texnansi-utmr8a] [ptmr8y] [encoding=texnansi] -\definefontsynonym [texnansi-utmri8a] [ptmri8y] [encoding=texnansi] -\definefontsynonym [texnansi-utmb8a] [ptmb8y] [encoding=texnansi] -\definefontsynonym [texnansi-utmbi8a] [ptmbi8y] [encoding=texnansi] - -\definefontsynonym [texnansi-utmr8a-slanted-167] [ptmro8y] [encoding=texnansi] -\definefontsynonym [texnansi-utmb8a-slanted-167] [ptmbo8y] [encoding=texnansi] - -\definefontsynonym [texnansi-uhvr8a] [phvr8y] [encoding=texnansi] -\definefontsynonym [texnansi-uhvro8a] [phvro8y] [encoding=texnansi] -\definefontsynonym [texnansi-uhvb8a] [phvb8y] [encoding=texnansi] -\definefontsynonym [texnansi-uhvbo8a] [phvbo8y] [encoding=texnansi] - -\definefontsynonym [texnansi-ucrr8a] [pcrr8y] [encoding=texnansi] -\definefontsynonym [texnansi-ucrb8a] [pcrb8y] [encoding=texnansi] -\definefontsynonym [texnansi-ucrro8a] [pcrro8y] [encoding=texnansi] -\definefontsynonym [texnansi-ucrbo8a] [pcrbo8y] [encoding=texnansi] - -\definefontsynonym [texnansi-uplr8a] [pplr8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplri8a] [pplri8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplb8a] [pplb8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplbi8a] [pplbi8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplr8a-slanted-167] [pplro8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplb8a-slanted-167] [pplbo8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplr8a-capitalized-800] [pplr8y] [encoding=texnansi] - -\definefontsynonym [texnansi-ubkl8a] [pbkl8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkli8a] [pbkli8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkd8a] [pbkd8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkdi8a] [pbkdi8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkl8a-slanted-167] [pbklo8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkd8a-slanted-167] [pbkdo8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkl8a-capitalized-800] [pbkl8y] [encoding=texnansi] - -\definefontsynonym [texnansi-uzcmi8a] [pzcmi8y] [encoding=texnansi] - -\definefontsynonym [texnansi-putr8a] [putr8y] [encoding=texnansi] -\definefontsynonym [texnansi-putri8a] [putri8y] [encoding=texnansi] -\definefontsynonym [texnansi-putb8a] [putr8y] [encoding=texnansi] -\definefontsynonym [texnansi-putbi8a] [putbi8y] [encoding=texnansi] -\definefontsynonym [texnansi-putr8a-slanted-167] [putro8y] [encoding=texnansi] -\definefontsynonym [texnansi-putb8a-slanted-167] [putbo8y] [encoding=texnansi] -\definefontsynonym [texnansi-putr8a-capitalized-800] [putr8y] [encoding=texnansi] - -\definefontsynonym [texnansi-bchr8a] [bchr8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchri8a] [bchri8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchb8a] [bchb8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchbi8a] [bchbi8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchr8a-slanted-167] [bchro8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchb8a-slanted-167] [bchbo8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchr8a-capitalized-800] [bchr8y] [encoding=texnansi] - -\stoptypescript - -\starttypescript [adobekb,berry] [t5] % there are no adobe metrics - -\loadmapfile[t5-base.map] - -\definefontsynonym [t5-utmr8a] [utmr8v] [encoding=t5] -\definefontsynonym [t5-utmri8a] [utmri8v] [encoding=t5] -\definefontsynonym [t5-utmb8a] [utmb8v] [encoding=t5] -\definefontsynonym [t5-utmbi8a] [utmbi8v] [encoding=t5] - -\definefontsynonym [t5-utmr8a-slanted-167] [utmro8v] [encoding=t5] -\definefontsynonym [t5-utmb8a-slanted-167] [utmbo8v] [encoding=t5] - -\definefontsynonym [t5-uhvr8a] [uhvr8v] [encoding=t5] -\definefontsynonym [t5-uhvro8a] [uhvro8v] [encoding=t5] -\definefontsynonym [t5-uhvb8a] [uhvb8v] [encoding=t5] -\definefontsynonym [t5-uhvbo8a] [uhvbo8v] [encoding=t5] - -\definefontsynonym [t5-ucrr8a] [ucrr8v] [encoding=t5] -\definefontsynonym [t5-ucrb8a] [ucrb8v] [encoding=t5] -\definefontsynonym [t5-ucrro8a] [ucrro8v] [encoding=t5] -\definefontsynonym [t5-ucrbo8a] [ucrbo8v] [encoding=t5] - -\definefontsynonym [t5-uplr8a] [uplr8v] [encoding=t5] -\definefontsynonym [t5-uplri8a] [uplri8v] [encoding=t5] -\definefontsynonym [t5-uplb8a] [uplb8v] [encoding=t5] -\definefontsynonym [t5-uplbi8a] [uplbi8v] [encoding=t5] -\definefontsynonym [t5-uplr8a-slanted-167] [uplro8v] [encoding=t5] -\definefontsynonym [t5-uplb8a-slanted-167] [uplbo8v] [encoding=t5] -\definefontsynonym [t5-uplr8a-capitalized-800] [uplr8v] [encoding=t5] - -\definefontsynonym [t5-ubkl8a] [ubkl8v] [encoding=t5] -\definefontsynonym [t5-ubkli8a] [ubkli8v] [encoding=t5] -\definefontsynonym [t5-ubkd8a] [ubkd8v] [encoding=t5] -\definefontsynonym [t5-ubkdi8a] [ubkdi8v] [encoding=t5] -\definefontsynonym [t5-ubkl8a-slanted-167] [ubklo8v] [encoding=t5] -\definefontsynonym [t5-ubkd8a-slanted-167] [ubkdo8v] [encoding=t5] -\definefontsynonym [t5-ubkl8a-capitalized-800] [ubkl8v] [encoding=t5] - -\stoptypescript - -\stoptypescriptcollection - -\endinput diff --git a/tex/context/base/type-dis.tex b/tex/context/base/type-dis.tex deleted file mode 100644 index 55bee181b..000000000 --- a/tex/context/base/type-dis.tex +++ /dev/null @@ -1,241 +0,0 @@ -%D \module -%D [ file=type-dis, -%D version=2005.01.26, % moved from type-enc.tex 2001.04.12, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Distribution scripts, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D The next section is obsolete. Although we prefer the original metrics -%D it seems that distributions no longer ship the u-variants, which means -%D that users (if they want) need to fall back to the p-variants. The usual -%D font mess. - -\endinput - -\starttypescriptcollection[distributed fonts] - -\starttypescript [berry] [8r] - -% \setupencoding[default=8r] - -\definefontsynonym [8r-utmr8a] [utmr8r] [encoding=8r] -\definefontsynonym [8r-utmri8a] [utmri8r] [encoding=8r] -\definefontsynonym [8r-utmb8a] [utmb8r] [encoding=8r] -\definefontsynonym [8r-utmbi8a] [utmbi8r] [encoding=8r] - -\definefontsynonym [8r-utmr8a-slanted-167] [utmro8r] [encoding=8r] -\definefontsynonym [8r-utmb8a-slanted-167] [utmbo8r] [encoding=8r] - -\definefontsynonym [8r-uhvr8a] [uhvr8r] [encoding=8r] -\definefontsynonym [8r-uhvro8a] [uhvro8r] [encoding=8r] -\definefontsynonym [8r-uhvb8a] [uhvb8r] [encoding=8r] -\definefontsynonym [8r-uhvbo8a] [uhvbo8r] [encoding=8r] - -\definefontsynonym [8r-ucrr8a] [ucrr8r] [encoding=8r] -\definefontsynonym [8r-ucrb8a] [ucrb8r] [encoding=8r] -\definefontsynonym [8r-ucrro8a] [ucrro8r] [encoding=8r] -\definefontsynonym [8r-ucrbo8a] [ucrbo8r] [encoding=8r] - -\definefontsynonym [8r-uplr8a] [uplr8r] [encoding=8r] -\definefontsynonym [8r-uplri8a] [uplri8r] [encoding=8r] -\definefontsynonym [8r-uplb8a] [uplb8r] [encoding=8r] -\definefontsynonym [8r-uplbi8a] [uplbi8r] [encoding=8r] -\definefontsynonym [8r-uplr8a-slanted-167] [uplro8r] [encoding=8r] -\definefontsynonym [8r-uplb8a-slanted-167] [uplbo8r] [encoding=8r] -\definefontsynonym [8r-uplr8a-capitalized-800] [uplr8r] [encoding=8r] - -\definefontsynonym [8r-ubkl8a] [ubkl8r] [encoding=8r] -\definefontsynonym [8r-ubkli8a] [ubkli8r] [encoding=8r] -\definefontsynonym [8r-ubkd8a] [ubkd8r] [encoding=8r] -\definefontsynonym [8r-ubkdi8a] [ubkdi8r] [encoding=8r] -\definefontsynonym [8r-ubkl8a-slanted-167] [ubklo8r] [encoding=8r] -\definefontsynonym [8r-ubkd8a-slanted-167] [ubkdo8r] [encoding=8r] -\definefontsynonym [8r-ubkl8a-capitalized-800] [ubkl8r] [encoding=8r] - -\definefontsynonym [8r-uzcmi8a] [uzcmi8r] [encoding=8r] - -\definefontsynonym [8r-putr8a] [putr8r] [encoding=8r] -\definefontsynonym [8r-putri8a] [putri8r] [encoding=8r] -\definefontsynonym [8r-putb8a] [putr8r] [encoding=8r] -\definefontsynonym [8r-putbi8a] [putbi8r] [encoding=8r] -\definefontsynonym [8r-putr8a-slanted-167] [putro8r] [encoding=8r] -\definefontsynonym [8r-putb8a-slanted-167] [putbo8r] [encoding=8r] -\definefontsynonym [8r-putr8a-capitalized-800] [putr8r] [encoding=8r] - -\definefontsynonym [8r-bchr8a] [bchr8r] [encoding=8r] -\definefontsynonym [8r-bchri8a] [bchri8r] [encoding=8r] -\definefontsynonym [8r-bchb8a] [bchb8r] [encoding=8r] -\definefontsynonym [8r-bchbi8a] [bchbi8r] [encoding=8r] -\definefontsynonym [8r-bchr8a-slanted-167] [bchro8r] [encoding=8r] -\definefontsynonym [8r-bchb8a-slanted-167] [bchbo8r] [encoding=8r] -\definefontsynonym [8r-bchr8a-capitalized-800] [bchr8r] [encoding=8r] - -\stoptypescript - -\starttypescript [berry] [ec] - -% \setupencoding[default=ec] - -\definefontsynonym [ec-utmr8a] [utmr8t] [encoding=ec] -\definefontsynonym [ec-utmri8a] [utmri8t] [encoding=ec] -\definefontsynonym [ec-utmb8a] [utmb8t] [encoding=ec] -\definefontsynonym [ec-utmbi8a] [utmbi8t] [encoding=ec] - -\definefontsynonym [ec-utmr8a-slanted-167] [utmro8t] [encoding=ec] -\definefontsynonym [ec-utmb8a-slanted-167] [utmbo8t] [encoding=ec] - -\definefontsynonym [ec-uhvr8a] [uhvr8t] [encoding=ec] -\definefontsynonym [ec-uhvro8a] [uhvro8t] [encoding=ec] -\definefontsynonym [ec-uhvb8a] [uhvb8t] [encoding=ec] -\definefontsynonym [ec-uhvbo8a] [uhvbo8t] [encoding=ec] - -\definefontsynonym [ec-ucrr8a] [ucrr8t] [encoding=ec] -\definefontsynonym [ec-ucrb8a] [ucrb8t] [encoding=ec] -\definefontsynonym [ec-ucrro8a] [ucrro8t] [encoding=ec] -\definefontsynonym [ec-ucrbo8a] [ucrbo8t] [encoding=ec] - -\definefontsynonym [ec-uplr8a] [uplr8t] [encoding=ec] -\definefontsynonym [ec-uplri8a] [uplri8t] [encoding=ec] -\definefontsynonym [ec-uplb8a] [uplb8t] [encoding=ec] -\definefontsynonym [ec-uplbi8a] [uplbi8t] [encoding=ec] -\definefontsynonym [ec-uplr8a-slanted-167] [uplro8t] [encoding=ec] -\definefontsynonym [ec-uplb8a-slanted-167] [uplbo8t] [encoding=ec] -\definefontsynonym [ec-uplr8a-capitalized-800] [uplr8t] [encoding=ec] - -\definefontsynonym [ec-ubkl8a] [ubkl8t] [encoding=ec] -\definefontsynonym [ec-ubkli8a] [ubkli8t] [encoding=ec] -\definefontsynonym [ec-ubkd8a] [ubkd8t] [encoding=ec] -\definefontsynonym [ec-ubkdi8a] [ubkdi8t] [encoding=ec] -\definefontsynonym [ec-ubkl8a-slanted-167] [ubklo8t] [encoding=ec] -\definefontsynonym [ec-ubkd8a-slanted-167] [ubkdo8t] [encoding=ec] -\definefontsynonym [ec-ubkl8a-capitalized-800] [ubkl8t] [encoding=ec] - -\definefontsynonym [ec-uzcmi8a] [uzcmi8t] [encoding=ec] - -\definefontsynonym [ec-putr8a] [putr8t] [encoding=ec] -\definefontsynonym [ec-putri8a] [putri8t] [encoding=ec] -\definefontsynonym [ec-putb8a] [putr8t] [encoding=ec] -\definefontsynonym [ec-putbi8a] [putbi8t] [encoding=ec] -\definefontsynonym [ec-putr8a-slanted-167] [putro8t] [encoding=ec] -\definefontsynonym [ec-putb8a-slanted-167] [putbo8t] [encoding=ec] -\definefontsynonym [ec-putr8a-capitalized-800] [putr8t] [encoding=ec] - -\definefontsynonym [ec-bchr8a] [bchr8t] [encoding=ec] -\definefontsynonym [ec-bchri8a] [bchri8t] [encoding=ec] -\definefontsynonym [ec-bchb8a] [bchb8t] [encoding=ec] -\definefontsynonym [ec-bchbi8a] [bchbi8t] [encoding=ec] -\definefontsynonym [ec-bchr8a-slanted-167] [bchro8t] [encoding=ec] -\definefontsynonym [ec-bchb8a-slanted-167] [bchbo8t] [encoding=ec] -\definefontsynonym [ec-bchr8a-capitalized-800] [bchr8t] [encoding=ec] - -\stoptypescript - -% the following fonts are normally not present on tex live - -\starttypescript [berry] [texnansi] - -% \setupencoding[default=texnansi] - -\definefontsynonym [texnansi-utmr8a] [utmr8y] [encoding=texnansi] -\definefontsynonym [texnansi-utmri8a] [utmri8y] [encoding=texnansi] -\definefontsynonym [texnansi-utmb8a] [utmb8y] [encoding=texnansi] -\definefontsynonym [texnansi-utmbi8a] [utmbi8y] [encoding=texnansi] - -\definefontsynonym [texnansi-utmr8a-slanted-167] [ptmro8y] [encoding=texnansi] -\definefontsynonym [texnansi-utmb8a-slanted-167] [ptmbo8y] [encoding=texnansi] - -\definefontsynonym [texnansi-uhvr8a] [uhvr8y] [encoding=texnansi] -\definefontsynonym [texnansi-uhvro8a] [uhvro8y] [encoding=texnansi] -\definefontsynonym [texnansi-uhvb8a] [uhvb8y] [encoding=texnansi] -\definefontsynonym [texnansi-uhvbo8a] [uhvbo8y] [encoding=texnansi] - -\definefontsynonym [texnansi-ucrr8a] [pcrr8y] [encoding=texnansi] -\definefontsynonym [texnansi-ucrb8a] [pcrb8y] [encoding=texnansi] -\definefontsynonym [texnansi-ucrro8a] [pcrro8y] [encoding=texnansi] -\definefontsynonym [texnansi-ucrbo8a] [pcrbo8y] [encoding=texnansi] - -\definefontsynonym [texnansi-uplr8a] [uplr8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplri8a] [uplri8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplb8a] [uplb8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplbi8a] [uplbi8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplr8a-slanted-167] [uplro8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplb8a-slanted-167] [uplbo8y] [encoding=texnansi] -\definefontsynonym [texnansi-uplr8a-capitalized-800] [uplr8y] [encoding=texnansi] - -\definefontsynonym [texnansi-ubkl8a] [ubkl8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkli8a] [ubkli8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkd8a] [ubkd8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkdi8a] [ubkdi8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkl8a-slanted-167] [ubklo8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkd8a-slanted-167] [ubkdo8y] [encoding=texnansi] -\definefontsynonym [texnansi-ubkl8a-capitalized-800] [ubkl8y] [encoding=texnansi] - -\definefontsynonym [texnansi-uzcmi8a] [uzcmi8y] [encoding=texnansi] - -\definefontsynonym [texnansi-putr8a] [putr8y] [encoding=texnansi] -\definefontsynonym [texnansi-putri8a] [putri8y] [encoding=texnansi] -\definefontsynonym [texnansi-putb8a] [putr8y] [encoding=texnansi] -\definefontsynonym [texnansi-putbi8a] [putbi8y] [encoding=texnansi] -\definefontsynonym [texnansi-putr8a-slanted-167] [putro8y] [encoding=texnansi] -\definefontsynonym [texnansi-putb8a-slanted-167] [putbo8y] [encoding=texnansi] -\definefontsynonym [texnansi-putr8a-capitalized-800] [putr8y] [encoding=texnansi] - -\definefontsynonym [texnansi-bchr8a] [bchr8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchri8a] [bchri8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchb8a] [bchb8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchbi8a] [bchbi8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchr8a-slanted-167] [bchro8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchb8a-slanted-167] [bchbo8y] [encoding=texnansi] -\definefontsynonym [texnansi-bchr8a-capitalized-800] [bchr8y] [encoding=texnansi] - -\stoptypescript - -\starttypescript [berry] [t5] - -% \setupencoding[default=t5] - -\definefontsynonym [t5-utmr8a] [utmr8v] [encoding=t5] -\definefontsynonym [t5-utmri8a] [utmri8v] [encoding=t5] -\definefontsynonym [t5-utmb8a] [utmb8v] [encoding=t5] -\definefontsynonym [t5-utmbi8a] [utmbi8v] [encoding=t5] - -\definefontsynonym [t5-utmr8a-slanted-167] [utmro8v] [encoding=t5] -\definefontsynonym [t5-utmb8a-slanted-167] [utmbo8v] [encoding=t5] - -\definefontsynonym [t5-uhvr8a] [uhvr8v] [encoding=t5] -\definefontsynonym [t5-uhvro8a] [uhvro8v] [encoding=t5] -\definefontsynonym [t5-uhvb8a] [uhvb8v] [encoding=t5] -\definefontsynonym [t5-uhvbo8a] [uhvbo8v] [encoding=t5] - -\definefontsynonym [t5-ucrr8a] [ucrr8v] [encoding=t5] -\definefontsynonym [t5-ucrb8a] [ucrb8v] [encoding=t5] -\definefontsynonym [t5-ucrro8a] [ucrro8v] [encoding=t5] -\definefontsynonym [t5-ucrbo8a] [ucrbo8v] [encoding=t5] - -\definefontsynonym [t5-uplr8a] [uplr8v] [encoding=t5] -\definefontsynonym [t5-uplri8a] [uplri8v] [encoding=t5] -\definefontsynonym [t5-uplb8a] [uplb8v] [encoding=t5] -\definefontsynonym [t5-uplbi8a] [uplbi8v] [encoding=t5] -\definefontsynonym [t5-uplr8a-slanted-167] [uplro8v] [encoding=t5] -\definefontsynonym [t5-uplb8a-slanted-167] [uplbo8v] [encoding=t5] -\definefontsynonym [t5-uplr8a-capitalized-800] [uplr8v] [encoding=t5] - -\definefontsynonym [t5-ubkl8a] [ubkl8v] [encoding=t5] -\definefontsynonym [t5-ubkli8a] [ubkli8v] [encoding=t5] -\definefontsynonym [t5-ubkd8a] [ubkd8v] [encoding=t5] -\definefontsynonym [t5-ubkdi8a] [ubkdi8v] [encoding=t5] -\definefontsynonym [t5-ubkl8a-slanted-167] [ubklo8v] [encoding=t5] -\definefontsynonym [t5-ubkd8a-slanted-167] [ubkdo8v] [encoding=t5] -\definefontsynonym [t5-ubkl8a-capitalized-800] [ubkl8v] [encoding=t5] - -\stoptypescript - -\stoptypescriptcollection - -\endinput diff --git a/tex/context/base/type-enc.tex b/tex/context/base/type-enc.tex deleted file mode 100644 index d43f84326..000000000 --- a/tex/context/base/type-enc.tex +++ /dev/null @@ -1,1182 +0,0 @@ -%D \module -%D [ file=type-enc, -%D version=2001.04.12, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Encoding scripts, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% texfont --ven=public --col=antt --enc=ec --sou=auto -% texfont --ven=public --col=antp --enc=ec --sou=auto -% texfont --ven=urw --col=palatino --enc=ec --sou=auto -% texfont --ven-lucas --col=sun --enc=ec --sou=. - -% \usetypescript [all] [modern] [texnansi] -% \setupbodyfont[reset] \setupbodyfont[cmr] -% \starttext \showfont[Serif] \stoptext - -% done: in type-dis.tex we remap the missing encoding-lm* files onto old metrics -% todo: we should consider handling qx in the same maner, remap qx-* in type-dis.tex -% todo: cyr fonts should be handled in the same way: t2b-lmr10 -> lbrm1000 - -\starttypescriptcollection[encodings] - -\starttypescript[all][modern,latin-modern][all] - - % fallbacks, no math in latin modern - - \definefontsynonym[lmff10] [cmff10] - \definefontsynonym[lmfi10] [cmfi10] - \definefontsynonym[lmfib8] [cmfib8] - \definefontsynonym[lmtex10] [cmtex10] - \definefontsynonym[lmtex8] [cmtex8] - \definefontsynonym[lmtex9] [cmtex9] - -\stoptypescript - -\starttypescript [serif] [modern,latin-modern] [texnansi,ec,qx,t5] - - \definefontsynonym [LMRoman10-DemiOblique] [\typescriptthree-lmbo10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-Bold] [\typescriptthree-lmbx10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman12-Bold] [\typescriptthree-lmbx12] [encoding=\typescriptthree] - \definefontsynonym [LMRoman5-Bold] [\typescriptthree-lmbx5] [encoding=\typescriptthree] - \definefontsynonym [LMRoman6-Bold] [\typescriptthree-lmbx6] [encoding=\typescriptthree] - \definefontsynonym [LMRoman7-Bold] [\typescriptthree-lmbx7] [encoding=\typescriptthree] - \definefontsynonym [LMRoman8-Bold] [\typescriptthree-lmbx8] [encoding=\typescriptthree] - \definefontsynonym [LMRoman9-Bold] [\typescriptthree-lmbx9] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-BoldItalic] [\typescriptthree-lmbxi10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-BoldOblique] [\typescriptthree-lmbxo10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-CapsRegular] [\typescriptthree-lmcsc10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-CapsOblique] [\typescriptthree-lmcsco10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-Regular] [\typescriptthree-lmr10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman12-Regular] [\typescriptthree-lmr12] [encoding=\typescriptthree] - \definefontsynonym [LMRoman17-Regular] [\typescriptthree-lmr17] [encoding=\typescriptthree] - \definefontsynonym [LMRoman5-Regular] [\typescriptthree-lmr5] [encoding=\typescriptthree] - \definefontsynonym [LMRoman6-Regular] [\typescriptthree-lmr6] [encoding=\typescriptthree] - \definefontsynonym [LMRoman7-Regular] [\typescriptthree-lmr7] [encoding=\typescriptthree] - \definefontsynonym [LMRoman8-Regular] [\typescriptthree-lmr8] [encoding=\typescriptthree] - \definefontsynonym [LMRoman9-Regular] [\typescriptthree-lmr9] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-Italic] [\typescriptthree-lmri10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman12-Italic] [\typescriptthree-lmri12] [encoding=\typescriptthree] - \definefontsynonym [LMRoman7-Italic] [\typescriptthree-lmri7] [encoding=\typescriptthree] - \definefontsynonym [LMRoman8-Italic] [\typescriptthree-lmri8] [encoding=\typescriptthree] - \definefontsynonym [LMRoman9-Italic] [\typescriptthree-lmri9] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-Oblique] [\typescriptthree-lmro10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman12-Oblique] [\typescriptthree-lmro12] [encoding=\typescriptthree] - \definefontsynonym [LMRoman17-Oblique] [\typescriptthree-lmro17] [encoding=\typescriptthree] - \definefontsynonym [LMRoman8-Oblique] [\typescriptthree-lmro8] [encoding=\typescriptthree] - \definefontsynonym [LMRoman9-Oblique] [\typescriptthree-lmro9] [encoding=\typescriptthree] - - \definefontsynonym [LMRoman-DemiOblique] [LMRoman10-DemiOblique] [encoding=\typescriptthree] - \definefontsynonym [LMRoman-Bold] [LMRoman10-Bold] [encoding=\typescriptthree] - \definefontsynonym [LMRoman-BoldItalic] [LMRoman10-BoldItalic] [encoding=\typescriptthree] - \definefontsynonym [LMRoman-BoldOblique] [LMRoman10-BoldOblique] [encoding=\typescriptthree] - \definefontsynonym [LMRoman-CapsRegular] [LMRoman10-CapsRegular] [encoding=\typescriptthree] - \definefontsynonym [LMRoman-CapsOblique] [LMRoman10-CapsOblique] [encoding=\typescriptthree] - \definefontsynonym [LMRoman-Regular] [LMRoman10-Regular] [encoding=\typescriptthree] - \definefontsynonym [LMRoman-Italic] [LMRoman10-Italic] [encoding=\typescriptthree] - \definefontsynonym [LMRoman-Oblique] [LMRoman10-Oblique] [encoding=\typescriptthree] - -\stoptypescript - -\starttypescript [sans] [modern,latin-modern] [texnansi,ec,qx,t5] - - \definefontsynonym [LMSans10-Regular] [\typescriptthree-lmss10] [encoding=\typescriptthree] - \definefontsynonym [LMSans12-Regular] [\typescriptthree-lmss12] [encoding=\typescriptthree] - \definefontsynonym [LMSans17-Regular] [\typescriptthree-lmss17] [encoding=\typescriptthree] - \definefontsynonym [LMSans8-Regular] [\typescriptthree-lmss8] [encoding=\typescriptthree] - \definefontsynonym [LMSans9-Regular] [\typescriptthree-lmss9] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-BoldOblique] [\typescriptthree-lmssbo10] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-Bold] [\typescriptthree-lmssbx10] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-DemiCondensed] [\typescriptthree-lmssdc10] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-DemiCondensedOblique] [\typescriptthree-lmssdo10] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-Oblique] [\typescriptthree-lmsso10] [encoding=\typescriptthree] - \definefontsynonym [LMSans12-Oblique] [\typescriptthree-lmsso12] [encoding=\typescriptthree] - \definefontsynonym [LMSans17-Oblique] [\typescriptthree-lmsso17] [encoding=\typescriptthree] - \definefontsynonym [LMSans8-Oblique] [\typescriptthree-lmsso8] [encoding=\typescriptthree] - \definefontsynonym [LMSans9-Oblique] [\typescriptthree-lmsso9] [encoding=\typescriptthree] - \definefontsynonym [LMSansQuotation8-Regular] [\typescriptthree-lmssq8] [encoding=\typescriptthree] - \definefontsynonym [LMSansQuotation8-BoldOblique] [\typescriptthree-lmssqbo8] [encoding=\typescriptthree] - \definefontsynonym [LMSansQuotation8-Bold] [\typescriptthree-lmssqbx8] [encoding=\typescriptthree] - \definefontsynonym [LMSansQuotation8-Oblique] [\typescriptthree-lmssqo8] [encoding=\typescriptthree] - - \definefontsynonym [LMSans-Regular] [LMSans10-Regular] [encoding=\typescriptthree] - \definefontsynonym [LMSans-BoldOblique] [LMSans10-BoldOblique] [encoding=\typescriptthree] - \definefontsynonym [LMSans-Bold] [LMSans10-Bold] [encoding=\typescriptthree] - \definefontsynonym [LMSans-DemiCondensed] [LMSans10-DemiCondensed] [encoding=\typescriptthree] - \definefontsynonym [LMSans-DemiCondensedOblique] [LMSans10-DemiCondensedOblique] [encoding=\typescriptthree] - \definefontsynonym [LMSans-Oblique] [LMSans10-Oblique] [encoding=\typescriptthree] - -\stoptypescript - -\starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond] [texnansi,ec,qx,t5] - - \definefontsynonym [LMTypewriter10-CapsRegular] [\typescriptthree-lmtcsc10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-CapsOblique] [\typescriptthree-lmtcso10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Light] [\typescriptthree-lmtl10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-LightOblique] [\typescriptthree-lmtlo10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-LightCondensed] [\typescriptthree-lmtlc10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-LightCondensedOblique] [\typescriptthree-lmtlco10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Dark] [\typescriptthree-lmtk10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-DarkOblique] [\typescriptthree-lmtko10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Regular] [\typescriptthree-lmtt10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter12-Regular] [\typescriptthree-lmtt12] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter8-Regular] [\typescriptthree-lmtt8] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter9-Regular] [\typescriptthree-lmtt9] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Italic] [\typescriptthree-lmtti10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Oblique] [\typescriptthree-lmtto10] [encoding=\typescriptthree] - - \definefontsynonym [LMTypewriterVarWd10-Regular] [\typescriptthree-lmvtt10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-Oblique] [\typescriptthree-lmvtto10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-Light] [\typescriptthree-lmvtl10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-LightOblique] [\typescriptthree-lmvtlo10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-Dark] [\typescriptthree-lmvtk10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-DarkOblique] [\typescriptthree-lmvtko10] [encoding=\typescriptthree] - - \definefontsynonym [LMTypewriter-CapsRegular] [LMTypewriter10-CapsRegular] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-CapsOblique] [LMTypewriter10-CapsOblique] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-Light] [LMTypewriter10-Light] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-LightOblique] [LMTypewriter10-LightOblique] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-LightCondensed] [LMTypewriter10-LightCondensed] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-LightCondensedOblique] [LMTypewriter10-LightCondensedOblique][encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-Dark] [LMTypewriter10-Dark] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-DarkOblique] [LMTypewriter10-DarkOblique] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-Regular] [LMTypewriter10-Regular] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-Italic] [LMTypewriter10-Italic] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter-Oblique] [LMTypewriter10-Oblique] [encoding=\typescriptthree] - - \definefontsynonym [LMTypewriterVarWd-Regular] [LMTypewriterVarWd10-Regular] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd-Oblique] [LMTypewriterVarWd10-Oblique] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd-Light] [LMTypewriterVarWd10-Light] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd-LightOblique] [LMTypewriterVarWd10-LightOblique] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd-Dark] [LMTypewriterVarWd10-Dark] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd-DarkOblique] [LMTypewriterVarWd10-DarkOblique] [encoding=\typescriptthree] - -\stoptypescript - -\starttypescript [math] [modern,latin-modern] - - \definefontsynonym [LMMathSymbols5-BoldItalic] [lmbsy5] - \definefontsynonym [LMMathSymbols7-BoldItalic] [lmbsy7] - \definefontsynonym [LMMathSymbols10-BoldItalic][lmbsy10] - \definefontsynonym [LMMathSymbols5-Italic] [lmsy5] - \definefontsynonym [LMMathSymbols6-Italic] [lmsy6] - \definefontsynonym [LMMathSymbols7-Italic] [lmsy7] - \definefontsynonym [LMMathSymbols8-Italic] [lmsy8] - \definefontsynonym [LMMathSymbols9-Italic] [lmsy9] - \definefontsynonym [LMMathSymbols10-Italic] [lmsy10] - \definefontsynonym [LMMathExtension10-Regular] [lmex10] - \definefontsynonym [LMMathItalic5-Italic] [lmmi5] - \definefontsynonym [LMMathItalic6-Italic] [lmmi6] - \definefontsynonym [LMMathItalic7-Italic] [lmmi7] - \definefontsynonym [LMMathItalic8-Italic] [lmmi8] - \definefontsynonym [LMMathItalic9-Italic] [lmmi9] - \definefontsynonym [LMMathItalic10-Italic] [lmmi10] - \definefontsynonym [LMMathItalic12-Italic] [lmmi12] - \definefontsynonym [LMMathItalic5-BoldItalic] [lmmib5] - \definefontsynonym [LMMathItalic7-BoldItalic] [lmmib7] - \definefontsynonym [LMMathItalic10-BoldItalic] [lmmib10] - - \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic] - \definefontsynonym [LMMathSymbols-Italic] [LMMathSymbols10-Italic] - \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular] - \definefontsynonym [LMMathItalic-Italic] [LMMathItalic10-Italic] - \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic] - -\stoptypescript - -% todo: map these onto verbose names - -\starttypescript [serif] [modern,latin-modern,computer-modern] [texnansi,ec,qx,t5] - - \definefontsynonym [cmr5] [\typescriptthree-lmr5] [encoding=\typescriptthree] - \definefontsynonym [cmr6] [\typescriptthree-lmr6] [encoding=\typescriptthree] - \definefontsynonym [cmr7] [\typescriptthree-lmr7] [encoding=\typescriptthree] - \definefontsynonym [cmr8] [\typescriptthree-lmr8] [encoding=\typescriptthree] - \definefontsynonym [cmr9] [\typescriptthree-lmr9] [encoding=\typescriptthree] - \definefontsynonym [cmr10] [\typescriptthree-lmr10] [encoding=\typescriptthree] - \definefontsynonym [cmr12] [\typescriptthree-lmr12] [encoding=\typescriptthree] - \definefontsynonym [cmr17] [\typescriptthree-lmr17] [encoding=\typescriptthree] - - \definefontsynonym [cmbx5] [\typescriptthree-lmbx5] [encoding=\typescriptthree] - \definefontsynonym [cmbx6] [\typescriptthree-lmbx6] [encoding=\typescriptthree] - \definefontsynonym [cmbx7] [\typescriptthree-lmbx7] [encoding=\typescriptthree] - \definefontsynonym [cmbx8] [\typescriptthree-lmbx8] [encoding=\typescriptthree] - \definefontsynonym [cmbx9] [\typescriptthree-lmbx9] [encoding=\typescriptthree] - \definefontsynonym [cmbx10] [\typescriptthree-lmbx10] [encoding=\typescriptthree] - \definefontsynonym [cmbx12] [\typescriptthree-lmbx12] [encoding=\typescriptthree] - - \definefontsynonym [cmsl10] [\typescriptthree-lmro10] [encoding=\typescriptthree] - \definefontsynonym [cmsl12] [\typescriptthree-lmro12] [encoding=\typescriptthree] - \definefontsynonym [cmsl8] [\typescriptthree-lmro8] [encoding=\typescriptthree] - \definefontsynonym [cmsl9] [\typescriptthree-lmro9] [encoding=\typescriptthree] - - \definefontsynonym [cmti7] [\typescriptthree-lmri7] [encoding=\typescriptthree] - \definefontsynonym [cmti8] [\typescriptthree-lmri8] [encoding=\typescriptthree] - \definefontsynonym [cmti9] [\typescriptthree-lmri9] [encoding=\typescriptthree] - \definefontsynonym [cmti10] [\typescriptthree-lmri10] [encoding=\typescriptthree] - \definefontsynonym [cmti12] [\typescriptthree-lmri12] [encoding=\typescriptthree] - - \definefontsynonym [cmb10] [\typescriptthree-lmb10] [encoding=\typescriptthree] - \definefontsynonym [cmbsl10] [\typescriptthree-lmbo10] [encoding=\typescriptthree] - \definefontsynonym [cmbxsl10] [\typescriptthree-lmbxo10] [encoding=\typescriptthree] - \definefontsynonym [cmbxti10] [\typescriptthree-lmbxi10] [encoding=\typescriptthree] - - \definefontsynonym [cmcsc10] [\typescriptthree-lmcsc10] [encoding=\typescriptthree] - \definefontsynonym [cmcscsl10][\typescriptthree-lmcsco10] [encoding=\typescriptthree] - - \definefontsynonym [cmr12 ][rm-lmr12] % hack needed to fool math roman - \definefontsynonym [cmr10 ][rm-lmr10] % into not messing around with - \definefontsynonym [cmr9 ] [rm-lmr9] % encodings, probably no longer - \definefontsynonym [cmr8 ] [rm-lmr8] % needed now - \definefontsynonym [cmr7 ] [rm-lmr7] % - \definefontsynonym [cmr6 ] [rm-lmr6] % no space appended here, needs - \definefontsynonym [cmr5 ] [rm-lmr5] % some testing - -\stoptypescript - -\starttypescript [sans] [modern,latin-modern,computer-modern] [texnansi,ec,qx,t5] - - \definefontsynonym [cmss8] [\typescriptthree-lmss8] [encoding=\typescriptthree] - \definefontsynonym [cmss9] [\typescriptthree-lmss9] [encoding=\typescriptthree] - \definefontsynonym [cmss10] [\typescriptthree-lmss10] [encoding=\typescriptthree] - \definefontsynonym [cmss12] [\typescriptthree-lmss12] [encoding=\typescriptthree] - \definefontsynonym [cmss17] [\typescriptthree-lmss17] [encoding=\typescriptthree] - - \definefontsynonym [cmssi10] [\typescriptthree-lmsso10] [encoding=\typescriptthree] - \definefontsynonym [cmssi12] [\typescriptthree-lmsso12] [encoding=\typescriptthree] - \definefontsynonym [cmssi17] [\typescriptthree-lmsso17] [encoding=\typescriptthree] - \definefontsynonym [cmssi8] [\typescriptthree-lmsso8] [encoding=\typescriptthree] - \definefontsynonym [cmssi9] [\typescriptthree-lmsso9] [encoding=\typescriptthree] - - \definefontsynonym [cmssq8] [\typescriptthree-lmssq8] [encoding=\typescriptthree] - \definefontsynonym [cmssqb8] [\typescriptthree-lmssqbx8] [encoding=\typescriptthree] - \definefontsynonym [cmssqbi8] [\typescriptthree-lmssqbo8] [encoding=\typescriptthree] - \definefontsynonym [cmssqi8] [\typescriptthree-lmssqo8] [encoding=\typescriptthree] - - \definefontsynonym [cmssbx10] [\typescriptthree-lmssbx10] [encoding=\typescriptthree] - \definefontsynonym [cmssdc10] [\typescriptthree-lmssdc10] [encoding=\typescriptthree] - \definefontsynonym [cmssbi10] [\typescriptthree-lmssbo10] [encoding=\typescriptthree] - \definefontsynonym [cmssdi10] [\typescriptthree-lmssdo10] [encoding=\typescriptthree] - -\stoptypescript - -\starttypescript [mono] [modern,latin-modern,computer-modern] [texnansi,ec,qx,t5] - - \definefontsynonym [cmtt8] [\typescriptthree-lmtt8] [encoding=\typescriptthree] - \definefontsynonym [cmtt9] [\typescriptthree-lmtt9] [encoding=\typescriptthree] - \definefontsynonym [cmtt10] [\typescriptthree-lmtt10] [encoding=\typescriptthree] - \definefontsynonym [cmtt12] [\typescriptthree-lmtt12] [encoding=\typescriptthree] - - \definefontsynonym [cmitt10] [\typescriptthree-lmtti10] [encoding=\typescriptthree] - \definefontsynonym [cmsltt10] [\typescriptthree-lmtto10] [encoding=\typescriptthree] - - \definefontsynonym [cmvtt10] [\typescriptthree-lmvtt10] [encoding=\typescriptthree] - \definefontsynonym [cmvtti10] [\typescriptthree-lmvtto] [encoding=\typescriptthree] - - \definefontsynonym [cmtcsc10] [\typescriptthree-lmtcsc10] [encoding=\typescriptthree] - -\stoptypescript - -\starttypescript [math] [modern,latin-modern,computer-modern] - - \definefontsynonym [cmbsy5] [lmbsy5] - \definefontsynonym [cmbsy7] [lmbsy7] - \definefontsynonym [cmbsy10] [lmbsy10] - \definefontsynonym [cmsy5] [lmsy5] - \definefontsynonym [cmsy6] [lmsy6] - \definefontsynonym [cmsy7] [lmsy7] - \definefontsynonym [cmsy8] [lmsy8] - \definefontsynonym [cmsy9] [lmsy9] - \definefontsynonym [cmsy10] [lmsy10] - \definefontsynonym [cmex10] [lmex10] - \definefontsynonym [cmmi5] [lmmi5] - \definefontsynonym [cmmi6] [lmmi6] - \definefontsynonym [cmmi7] [lmmi7] - \definefontsynonym [cmmi8] [lmmi8] - \definefontsynonym [cmmi9] [lmmi9] - \definefontsynonym [cmmi10] [lmmi10] - \definefontsynonym [cmmi12] [lmmi12] - \definefontsynonym [cmmib5] [lmmib5] - \definefontsynonym [cmmib7] [lmmib7] - \definefontsynonym [cmmib10] [lmmib10] - -\stoptypescript - -%D {\em Comments by Victor Figurnov:} the wcmb10, wcmbx10, -%D \unknown\ fonts below are taken from the Paradissa -%D collection by Basil Malyshev. These fonts don't conform t2a -%D encoding but are in MS Windows Cyrillic codepage 1251 -%D encoding. These fonts contain only 33 russian letters in -%D upper and lower case, the number sign, and guillemots. But -%D even among these characters only the basic 32 russian -%D letters (in upper and lower case) will be typeset correctly -%D with this definition. The letters cyrillicYO and -%D cyrillicyo, as well as number sign (textnumero) and -%D guillemots won't be typeset properly, because these symbols -%D have different positions in t2a and MS CP1251 encodings. -%D -%D I think that the russian lh fonts and|/|or cm-super provide -%D better alternatives (type1). Therefore, the names below -%D match those of cm-super (\type {0NNN} instead of \type -%D {NNN}, i.e.\ four digit numbers). - -\starttypescript [serif] [computer-modern] [cyr] - \definefontsynonym [cmb10] [wcmb10] [encoding=t2a] - \definefontsynonym [cmbsy10] [wcmbsy10] [encoding=t2a] - \definefontsynonym [cmbx10] [wcmbx10] [encoding=t2a] - \definefontsynonym [cmbx12] [wcmbx12] [encoding=t2a] - \definefontsynonym [cmbx5] [wcmbx5] [encoding=t2a] - \definefontsynonym [cmbx6] [wcmbx6] [encoding=t2a] - \definefontsynonym [cmbx7] [wcmbx7] [encoding=t2a] - \definefontsynonym [cmbx8] [wcmbx8] [encoding=t2a] - \definefontsynonym [cmbx9] [wcmbx9] [encoding=t2a] - \definefontsynonym [cmbxsl10] [wcmbxsl10] [encoding=t2a] - \definefontsynonym [cmbxti10] [wcmbxti10] [encoding=t2a] - \definefontsynonym [cmcsc10] [wcmcsc10] [encoding=t2a] - %definefontsynonym [cmdunh10] [wcmdunh10] [encoding=t2a] - \definefontsynonym [cminch] [wcminch] [encoding=t2a] - \definefontsynonym [cmr10] [wcmr10] [encoding=t2a] - \definefontsynonym [cmr12] [wcmr12] [encoding=t2a] - \definefontsynonym [cmr17] [wcmr17] [encoding=t2a] - \definefontsynonym [cmr5] [wcmr5] [encoding=t2a] - \definefontsynonym [cmr6] [wcmr6] [encoding=t2a] - \definefontsynonym [cmr7] [wcmr7] [encoding=t2a] - \definefontsynonym [cmr8] [wcmr8] [encoding=t2a] - \definefontsynonym [cmr9] [wcmr9] [encoding=t2a] - \definefontsynonym [cmsl10] [wcmsl10] [encoding=t2a] - \definefontsynonym [cmsl12] [wcmsl12] [encoding=t2a] - \definefontsynonym [cmsl8] [wcmsl8] [encoding=t2a] - \definefontsynonym [cmsl9] [wcmsl9] [encoding=t2a] - \definefontsynonym [cmti10] [wcmti10] [encoding=t2a] - \definefontsynonym [cmti12] [wcmti12] [encoding=t2a] - \definefontsynonym [cmti7] [wcmti7] [encoding=t2a] - \definefontsynonym [cmti8] [wcmti8] [encoding=t2a] - \definefontsynonym [cmti9] [wcmti9] [encoding=t2a] - \definefontsynonym [cmu10] [wcmu10] [encoding=t2a] -\stoptypescript - -\starttypescript [sans] [computer-modern] [cyr] - \definefontsynonym [cmss10] [wcmss10] [encoding=t2a] - \definefontsynonym [cmss12] [wcmss12] [encoding=t2a] - \definefontsynonym [cmss17] [wcmss17] [encoding=t2a] - \definefontsynonym [cmss8] [wcmss8] [encoding=t2a] - \definefontsynonym [cmss9] [wcmss9] [encoding=t2a] - %definefontsynonym [cmssbi10] [wcmssbi10] [encoding=t2a] - \definefontsynonym [cmssbx10] [wcmssbx10] [encoding=t2a] - \definefontsynonym [cmssdc10] [wcmssdc10] [encoding=t2a] - \definefontsynonym [cmssi10] [wcmssi10] [encoding=t2a] - \definefontsynonym [cmssi12] [wcmssi12] [encoding=t2a] - \definefontsynonym [cmssi17] [wcmssi17] [encoding=t2a] - \definefontsynonym [cmssi8] [wcmssi8] [encoding=t2a] - \definefontsynonym [cmssi9] [wcmssi9] [encoding=t2a] - \definefontsynonym [cmssq8] [wcmssq8] [encoding=t2a] - \definefontsynonym [cmssqi8] [wcmssqi8] [encoding=t2a] -\stoptypescript - -\starttypescript [mono] [computer-modern] [cyr] - \definefontsynonym [cmitt10] [wcmitt10] [encoding=t2a] - \definefontsynonym [cmsltt10] [wcmsltt10] [encoding=t2a] - \definefontsynonym [cmtt10] [wcmtt10] [encoding=t2a] - \definefontsynonym [cmtt12] [wcmtt12] [encoding=t2a] - \definefontsynonym [cmtt8] [wcmtt8] [encoding=t2a] - \definefontsynonym [cmtt9] [wcmtt9] [encoding=t2a] - %definefontsynonym [cmvtt10] [wcmvtt10] [encoding=t2a] -\stoptypescript - -\definetypescriptprefix [c:t2a] [la] -\definetypescriptprefix [c:t2b] [lb] -\definetypescriptprefix [c:t2c] [lc] -\definetypescriptprefix [c:x2] [rx] - -\starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [cmb10] [\typescriptprefix{c:\typescriptthree}rb1000] [encoding=\typescriptthree] - \definefontsynonym [cmbx10] [\typescriptprefix{c:\typescriptthree}bx1000] [encoding=\typescriptthree] - \definefontsynonym [cmbx12] [\typescriptprefix{c:\typescriptthree}bx1200] [encoding=\typescriptthree] - \definefontsynonym [cmbx5] [\typescriptprefix{c:\typescriptthree}bx0500] [encoding=\typescriptthree] - \definefontsynonym [cmbx6] [\typescriptprefix{c:\typescriptthree}bx0600] [encoding=\typescriptthree] - \definefontsynonym [cmbx7] [\typescriptprefix{c:\typescriptthree}bx0700] [encoding=\typescriptthree] - \definefontsynonym [cmbx8] [\typescriptprefix{c:\typescriptthree}bx0800] [encoding=\typescriptthree] - \definefontsynonym [cmbx9] [\typescriptprefix{c:\typescriptthree}bx0900] [encoding=\typescriptthree] - \definefontsynonym [cmbxsl10] [\typescriptprefix{c:\typescriptthree}bl1000] [encoding=\typescriptthree] - \definefontsynonym [cmbxti10] [\typescriptprefix{c:\typescriptthree}bi1000] [encoding=\typescriptthree] - \definefontsynonym [cmcsc10] [\typescriptprefix{c:\typescriptthree}cc1000] [encoding=\typescriptthree] - \definefontsynonym [cmdunh10] [\typescriptprefix{c:\typescriptthree}dh1000] [encoding=\typescriptthree] - \definefontsynonym [cmff10] [\typescriptprefix{c:\typescriptthree}ff1000] [encoding=\typescriptthree] - \definefontsynonym [cmfi10] [\typescriptprefix{c:\typescriptthree}fi1000] [encoding=\typescriptthree] - \definefontsynonym [cmfib8] [\typescriptprefix{c:\typescriptthree}fb0800] [encoding=\typescriptthree] - %\definefontsynonym [cminch] [\typescriptprefix{c:\typescriptthree}inch00] [encoding=\typescriptthree] - \definefontsynonym [cmr10] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree] - \definefontsynonym [cmr12] [\typescriptprefix{c:\typescriptthree}rm1200] [encoding=\typescriptthree] - \definefontsynonym [cmr17] [\typescriptprefix{c:\typescriptthree}rm1700] [encoding=\typescriptthree] - \definefontsynonym [cmr5] [\typescriptprefix{c:\typescriptthree}rm0500] [encoding=\typescriptthree] - \definefontsynonym [cmr6] [\typescriptprefix{c:\typescriptthree}rm0600] [encoding=\typescriptthree] - \definefontsynonym [cmr7] [\typescriptprefix{c:\typescriptthree}rm0700] [encoding=\typescriptthree] - \definefontsynonym [cmr8] [\typescriptprefix{c:\typescriptthree}rm0800] [encoding=\typescriptthree] - \definefontsynonym [cmr9] [\typescriptprefix{c:\typescriptthree}rm0900] [encoding=\typescriptthree] - \definefontsynonym [cmsl10] [\typescriptprefix{c:\typescriptthree}sl1000] [encoding=\typescriptthree] - \definefontsynonym [cmsl12] [\typescriptprefix{c:\typescriptthree}sl1200] [encoding=\typescriptthree] - \definefontsynonym [cmsl8] [\typescriptprefix{c:\typescriptthree}sl0800] [encoding=\typescriptthree] - \definefontsynonym [cmsl9] [\typescriptprefix{c:\typescriptthree}sl0900] [encoding=\typescriptthree] - \definefontsynonym [cmtcsc10] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree] - \definefontsynonym [cmti10] [\typescriptprefix{c:\typescriptthree}ti1000] [encoding=\typescriptthree] - \definefontsynonym [cmti12] [\typescriptprefix{c:\typescriptthree}ti1200] [encoding=\typescriptthree] - \definefontsynonym [cmti7] [\typescriptprefix{c:\typescriptthree}ti0700] [encoding=\typescriptthree] - \definefontsynonym [cmti8] [\typescriptprefix{c:\typescriptthree}ti0800] [encoding=\typescriptthree] - \definefontsynonym [cmti9] [\typescriptprefix{c:\typescriptthree}ti0900] [encoding=\typescriptthree] - \definefontsynonym [cmu10] [\typescriptprefix{c:\typescriptthree}ui1000] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [sans] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [cmss10] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree] - \definefontsynonym [cmss12] [\typescriptprefix{c:\typescriptthree}ss1200] [encoding=\typescriptthree] - \definefontsynonym [cmss17] [\typescriptprefix{c:\typescriptthree}ss1700] [encoding=\typescriptthree] - \definefontsynonym [cmss8] [\typescriptprefix{c:\typescriptthree}ss0800] [encoding=\typescriptthree] - \definefontsynonym [cmss9] [\typescriptprefix{c:\typescriptthree}ss0900] [encoding=\typescriptthree] - \definefontsynonym [cmssbx10] [\typescriptprefix{c:\typescriptthree}sx1000] [encoding=\typescriptthree] - %\definefontsynonym [cmssdc10] [\typescriptprefix{c:\typescriptthree}ssdc1000] [encoding=\typescriptthree] - \definefontsynonym [cmssi10] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] - \definefontsynonym [cmssi12] [\typescriptprefix{c:\typescriptthree}si1200] [encoding=\typescriptthree] - \definefontsynonym [cmssi17] [\typescriptprefix{c:\typescriptthree}si1700] [encoding=\typescriptthree] - \definefontsynonym [cmssi8] [\typescriptprefix{c:\typescriptthree}si0800] [encoding=\typescriptthree] - \definefontsynonym [cmssi9] [\typescriptprefix{c:\typescriptthree}si0900] [encoding=\typescriptthree] - \definefontsynonym [cmssq8] [\typescriptprefix{c:\typescriptthree}ss0800] [encoding=\typescriptthree] - \definefontsynonym [cmssqi8] [\typescriptprefix{c:\typescriptthree}si0800] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [mono] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [cmitt10] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree] - \definefontsynonym [cmsltt10] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree] - \definefontsynonym [cmtt10] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree] - \definefontsynonym [cmtt12] [\typescriptprefix{c:\typescriptthree}tt1200] [encoding=\typescriptthree] - \definefontsynonym [cmtt8] [\typescriptprefix{c:\typescriptthree}tt0800] [encoding=\typescriptthree] - \definefontsynonym [cmtt9] [\typescriptprefix{c:\typescriptthree}tt0900] [encoding=\typescriptthree] - \definefontsynonym [cmvtt10] [\typescriptprefix{c:\typescriptthree}vt1000] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [serif] [computer-modern] [lcy] - \definefontsynonym [cmb10] [lhb10] [encoding=lcy] - \definefontsynonym [cmbx10] [lhbx10] [encoding=lcy] - \definefontsynonym [cmbx12] [lhbx12] [encoding=lcy] - \definefontsynonym [cmbx5] [lhbx5] [encoding=lcy] - \definefontsynonym [cmbx6] [lhbx6] [encoding=lcy] - \definefontsynonym [cmbx7] [lhbx7] [encoding=lcy] - \definefontsynonym [cmbx8] [lhbx8] [encoding=lcy] - \definefontsynonym [cmbx9] [lhbx9] [encoding=lcy] - \definefontsynonym [cmbxsl10] [lhbxsl10] [encoding=lcy] - \definefontsynonym [cmbxti10] [lhbxti10] [encoding=lcy] - \definefontsynonym [cmcsc10] [lhcsc10] [encoding=lcy] - \definefontsynonym [cmdunh10] [lhdunh10] [encoding=lcy] - \definefontsynonym [cmff10] [lhff10] [encoding=lcy] - \definefontsynonym [cmfi10] [lhfi10] [encoding=lcy] - \definefontsynonym [cmfib8] [lhfib8] [encoding=lcy] - \definefontsynonym [cminch] [lhinch] [encoding=lcy] - \definefontsynonym [cmr10] [lhr10] [encoding=lcy] - \definefontsynonym [cmr12] [lhr12] [encoding=lcy] - \definefontsynonym [cmr17] [lhr17] [encoding=lcy] - \definefontsynonym [cmr5] [lhr5] [encoding=lcy] - \definefontsynonym [cmr6] [lhr6] [encoding=lcy] - \definefontsynonym [cmr7] [lhr7] [encoding=lcy] - \definefontsynonym [cmr8] [lhr8] [encoding=lcy] - \definefontsynonym [cmr9] [lhr9] [encoding=lcy] - \definefontsynonym [cmsl10] [lhsl10] [encoding=lcy] - \definefontsynonym [cmsl12] [lhsl12] [encoding=lcy] - \definefontsynonym [cmsl8] [lhsl8] [encoding=lcy] - \definefontsynonym [cmsl9] [lhsl9] [encoding=lcy] - \definefontsynonym [cmtcsc10] [lhtcsc10] [encoding=lcy] - \definefontsynonym [cmtex10] [lhtex10] [encoding=lcy] - \definefontsynonym [cmtex8] [lhtex8] [encoding=lcy] - \definefontsynonym [cmtex9] [lhtex9] [encoding=lcy] - \definefontsynonym [cmti10] [lhti10] [encoding=lcy] - \definefontsynonym [cmti12] [lhti12] [encoding=lcy] - \definefontsynonym [cmti7] [lhti7] [encoding=lcy] - \definefontsynonym [cmti8] [lhti8] [encoding=lcy] - \definefontsynonym [cmti9] [lhti9] [encoding=lcy] - \definefontsynonym [cmu10] [lhu10] [encoding=lcy] -\stoptypescript - -\starttypescript [sans] [computer-modern] [lcy] - \definefontsynonym [cmss10] [lhss10] [encoding=lcy] - \definefontsynonym [cmss12] [lhss12] [encoding=lcy] - \definefontsynonym [cmss17] [lhss17] [encoding=lcy] - \definefontsynonym [cmss8] [lhss8] [encoding=lcy] - \definefontsynonym [cmss9] [lhss9] [encoding=lcy] - \definefontsynonym [cmssbi10] [lhssbi10] [encoding=lcy] - \definefontsynonym [cmssbx10] [lhssbx10] [encoding=lcy] - \definefontsynonym [cmssdc10] [lhssdc10] [encoding=lcy] - \definefontsynonym [cmssi10] [lhssi10] [encoding=lcy] - \definefontsynonym [cmssi12] [lhssi12] [encoding=lcy] - \definefontsynonym [cmssi17] [lhssi17] [encoding=lcy] - \definefontsynonym [cmssi8] [lhssi8] [encoding=lcy] - \definefontsynonym [cmssi9] [lhssi9] [encoding=lcy] - \definefontsynonym [cmssq8] [lhssq8] [encoding=lcy] - \definefontsynonym [cmssqi8] [lhssqi8] [encoding=lcy] -\stoptypescript - -\starttypescript [mono] [computer-modern] [lcy] - \definefontsynonym [cmitt10] [lhitt10] [encoding=lcy] - \definefontsynonym [cmsltt10] [lhsltt10] [encoding=lcy] - \definefontsynonym [cmtt10] [lhtt10] [encoding=lcy] - \definefontsynonym [cmtt12] [lhtt12] [encoding=lcy] - \definefontsynonym [cmtt8] [lhtt8] [encoding=lcy] - \definefontsynonym [cmtt9] [lhtt9] [encoding=lcy] - \definefontsynonym [cmvtt10] [lhvtt10] [encoding=lcy] -\stoptypescript - -\starttypescript [serif] [modern,computer-modern,latin-modern] [default] - \definefontsynonym [ComputerModern] [LMRoman-Regular] - \definefontsynonym [ComputerModern-Italic] [LMRoman-Italic] - \definefontsynonym [ComputerModern-Slanted] [LMRoman-Oblique] - \definefontsynonym [ComputerModern-Bold] [LMRoman-Bold] - \definefontsynonym [ComputerModern-BoldItalic] [LMRoman-BoldItalic] - \definefontsynonym [ComputerModern-BoldSlanted] [LMRoman-BoldOblique] - \definefontsynonym [ComputerModern-Caps] [LMRoman-CapsRegular] - \definefontsynonym [ComputerModern-CapsSlanted] [LMRoman-CapsOblique] -\stoptypescript - -\starttypescript [sans] [modern,computer-modern,latin-modern] % [default] - \definefontsynonym [ComputerModernSans] [LMSans-Regular] - \definefontsynonym [ComputerModernSans-Italic] [LMSans-Oblique] - \definefontsynonym [ComputerModernSans-Slanted] [LMSans-Oblique] - \definefontsynonym [ComputerModernSans-Bold] [LMSans-Bold] - \definefontsynonym [ComputerModernSans-BoldItalic] [LMSans-BoldOblique] - \definefontsynonym [ComputerModernSans-BoldSlanted] [LMSans-BoldOblique] - \definefontsynonym [ComputerModernSans-Caps] [LMSans-Regular] % [LMSans-CapsRegular] - \definefontsynonym [ComputerModernSans-CapsSlanted] [LMSans-Oblique] % [LMSans-CapsOblique] -\stoptypescript - -\starttypescript [mono] [modern,computer-modern,latin-modern] % [default] - \definefontsynonym [ComputerModernMono] [LMTypewriter-Regular] - \definefontsynonym [ComputerModernMono-Italic] [LMTypewriter-Italic] - \definefontsynonym [ComputerModernMono-Slanted] [LMTypewriter-Oblique] - \definefontsynonym [ComputerModernMono-Bold] [LMTypewriter-Dark] - \definefontsynonym [ComputerModernMono-BoldItalic] [LMTypewriter-DarkOblique] % ! - \definefontsynonym [ComputerModernMono-BoldSlanted] [LMTypewriter-DarkOblique] - \definefontsynonym [ComputerModernMono-Caps] [LMTypewriter-CapsRegular] - \definefontsynonym [ComputerModernMono-CapsSlanted] [LMTypewriter-CapsOblique] - \definefontsynonym [ComputerModernMono-Variable] [LMTypewriterVarWd-Regular] -\stoptypescript - -\starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] % [default] - \definefontsynonym [ComputerModernVariable] [LMTypewriterVarWd-Regular] - \definefontsynonym [ComputerModernVariable-Italic] [LMTypewriterVarWd-Oblique] - \definefontsynonym [ComputerModernVariable-Slanted] [LMTypewriterVarWd-Oblique] - \definefontsynonym [ComputerModernVariable-Bold] [LMTypewriterVarWd-Dark] - \definefontsynonym [ComputerModernVariable-BoldItalic] [LMTypewriterVarWd-DarkOblique] - \definefontsynonym [ComputerModernVariable-BoldSlanted] [LMTypewriterVarWd-DarkOblique] - \definefontsynonym [ComputerModernVariable-Caps] [LMTypewriterVarWd-Regular] - \definefontsynonym [ComputerModernVariable-CapsSlanted] [LMTypewriterVarWd-Oblique] -\stoptypescript - -\starttypescript [math] [modern,computer-modern,latin-modern] % [default] - % watch the space, it prevents remapping - \definefontsynonym [ComputerModernMath-Roman] [lmr10 ] - \definefontsynonym [ComputerModernMath-Extension] [lmex10] - \definefontsynonym [ComputerModernMath-Italic] [lmmi10] - \definefontsynonym [ComputerModernMath-Symbol] [lmsy10] -\stoptypescript - -\starttypescript [boldmath,bfmath] [modern,computer-modern,latin-modern] % [default] - % watch the space, it prevents remapping - \definefontsynonym [ComputerModernMath-Roman-Bold] [lmb10 ] - \definefontsynonym [ComputerModernMath-Extension] [lmex10] - \definefontsynonym [ComputerModernMath-Italic-Bold] [lmmib10] - \definefontsynonym [ComputerModernMath-Symbol-Bold] [lmbsy10] -\stoptypescript - -% Till we have cyrilic in lm: - -% \usetypescript[modern-base][t2a] -% \setupbodyfont[modern,10pt] - -\starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [ComputerModern] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModern-Italic] [\typescriptprefix{c:\typescriptthree}ti1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModern-Slanted] [\typescriptprefix{c:\typescriptthree}sl1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModern-Bold] [\typescriptprefix{c:\typescriptthree}bx1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModern-BoldItalic] [\typescriptprefix{c:\typescriptthree}bi1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModern-BoldSlanted] [\typescriptprefix{c:\typescriptthree}bl1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModern-Caps] [\typescriptprefix{c:\typescriptthree}cc1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModern-CapsSlanted] [\typescriptprefix{c:\typescriptthree}sc1000] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [sans] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [ComputerModernSans] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree] - %definefontsynonym [ComputerModernSans-Italic] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModernSans-Slanted] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModernSans-Bold] [\typescriptprefix{c:\typescriptthree}sx1000] [encoding=\typescriptthree] - %definefontsynonym [ComputerModernSans-BoldItalic] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModernSans-BoldSlanted] [\typescriptprefix{c:\typescriptthree}so1000] [encoding=\typescriptthree] - %definefontsynonym [ComputerModernSans-Caps] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree] - %definefontsynonym [ComputerModernSans-CapsSlanted] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [mono] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [ComputerModernMono] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModernMono-Italic] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModernMono-Slanted] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree] - %definefontsynonym [ComputerModernMono-Bold] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree] - %definefontsynonym [ComputerModernMono-BoldItalic] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree] - %definefontsynonym [ComputerModernMono-BoldSlanted] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree] - \definefontsynonym [ComputerModernMono-Caps] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree] - %definefontsynonym [ComputerModernMono-CapsSlanted] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree] -\stoptypescript - -% Computer Concrete (AMS) - -\starttypescript [serif] [concrete] [default] - \definefontsynonym [ComputerConcrete] [ccr10] - \definefontsynonym [ComputerConcrete-Italic] [ccti10] - \definefontsynonym [ComputerConcrete-Slanted] [ccsl10] - \definefontsynonym [ComputerConcrete-Bold] [ComputerConcrete] - \definefontsynonym [ComputerConcrete-BoldItalic] [ComputerConcrete-Italic] - \definefontsynonym [ComputerConcrete-BoldSlanted] [ComputerConcrete-Slanted] - \definefontsynonym [ComputerConcrete-Caps] [cccsc10] -\stoptypescript - -% Euler (AMS) - -\starttypescript [math] [euler] [default] - \definefontsynonym [Euler-Roman] [zeurm10] - \definefontsynonym [Euler-Extension] [zeuex10] - \definefontsynonym [Euler-Symbol] [zeusm10] - \definefontsynonym [Euler-Fraktur] [eufm10] -\stoptypescript - -\starttypescript [boldmath,bfmath] [euler] [default] - \definefontsynonym [Euler-Roman-Bold] [zeurb10] - \definefontsynonym [Euler-Extension] [zeuex10] - \definefontsynonym [Euler-Symbol-Bold] [zeusb10] - \definefontsynonym [Euler-Fraktur-Bold] [eufb10] -\stoptypescript - -% AMS (AMS) - -\starttypescript [math] [modern,computer-modern,latin-modern,ams] [default] - \definefontsynonym [AMS-SymbolA] [msam10] - \definefontsynonym [AMS-SymbolB] [msbm10] -\stoptypescript - -% Fourier (Utopia) - -\starttypescript [math] [fourier] [default,ec] - \definefontsynonym [Fourier-Math-Letters] [futr8t] [encoding=ec] - %\definefontsynonym [Fourier-Math-Letters] [futmi] - \definefontsynonym [Fourier-Math-Letters-Italic] [futmii] - \definefontsynonym [Fourier-Math-Symbols] [futsy] - \definefontsynonym [Fourier-Math-Extension] [fourier-mex] -\stoptypescript - -\starttypescript [serif] [fourier] [ec] - \definefontsynonym [Fourier-Regular] [futr8t] [encoding=ec] - \definefontsynonym [Fourier-Slanted] [futro8t] [encoding=ec] - \definefontsynonym [Fourier-Italic] [futri8t] [encoding=ec] - \definefontsynonym [Fourier-RegularCaps] [futrc8t] [encoding=ec] - \definefontsynonym [Fourier-Bold] [futb8t] [encoding=ec] - \definefontsynonym [Fourier-BoldSlanted] [futbo8t] [encoding=ec] - \definefontsynonym [Fourier-BoldItalic] [futbi8t] [encoding=ec] - \definefontsynonym [Fourier-BoldCaps] [futbc8t] [encoding=ec] - - \definefontsynonym [Fourier-Regular-Expert] [futr9e] [encoding=ec] - \definefontsynonym [Fourier-Slanted-Expert] [futro9e] [encoding=ec] - \definefontsynonym [Fourier-Italic-Expert] [futri9e] [encoding=ec] - \definefontsynonym [Fourier-RegularCaps-Expert] [futrc9e] [encoding=ec] - \definefontsynonym [Fourier-Semi-Expert] [futs9e] [encoding=ec] - \definefontsynonym [Fourier-SemiSlanted-Expert] [futso9e] [encoding=ec] - \definefontsynonym [Fourier-SemiItalic-Expert] [futsi9e] [encoding=ec] - \definefontsynonym [Fourier-SemiCaps-Expert] [futsc9e] [encoding=ec] - \definefontsynonym [Fourier-Bold-Expert] [futb9e] [encoding=ec] - \definefontsynonym [Fourier-BoldSlanted-Expert] [futbo9e] [encoding=ec] - \definefontsynonym [Fourier-BoldItalic-Expert] [futbi9e] [encoding=ec] - \definefontsynonym [Fourier-Black-Expert] [futc9e] [encoding=ec] - - \definefontsynonym [Fourier-Regular-OldStyle] [futr9d] [encoding=ec] - \definefontsynonym [Fourier-Slanted-OldStyle] [futro9d] [encoding=ec] - \definefontsynonym [Fourier-Italic-OldStyle] [futri9d] [encoding=ec] - \definefontsynonym [Fourier-RegularCaps-OldStyle] [futrc9d] [encoding=ec] - \definefontsynonym [Fourier-Semi-OldStyle] [futs9d] [encoding=ec] - \definefontsynonym [Fourier-SemiSlanted-OldStyle] [futso9d] [encoding=ec] - \definefontsynonym [Fourier-SemiItalic-OldStyle] [futsi9d] [encoding=ec] - \definefontsynonym [Fourier-SemiCaps-OldStyle] [futsc9d] [encoding=ec] - \definefontsynonym [Fourier-Bold-OldStyle] [futb9d] [encoding=ec] - \definefontsynonym [Fourier-BoldSlanted-OldStyle] [futbo9d] [encoding=ec] - \definefontsynonym [Fourier-BoldItalic-OldStyle] [futbi9d] [encoding=ec] - \definefontsynonym [Fourier-Black-OldStyle] [futc9d] [encoding=ec] -\stoptypescript - -% Courier (URW) - -\starttypescript [mono] [courier] [texnansi,ec,8r,t5] - \definefontsynonym [Courier] [\typescriptthree-ucrr8a] [encoding=\typescriptthree] - \definefontsynonym [Courier-Bold] [\typescriptthree-ucrb8a] [encoding=\typescriptthree] - \definefontsynonym [Courier-Oblique] [\typescriptthree-ucrro8a] [encoding=\typescriptthree] - \definefontsynonym [Courier-BoldOblique] [\typescriptthree-ucrbo8a] [encoding=\typescriptthree] -\stoptypescript - -% alternative 1 -% -% \definefontsynonym[qx-ucrr8a] [qcrr] -% \definefontsynonym[qx-ucrb8a] [qcrb] -% \definefontsynonym[qx-ucrr08a] [qcrri] -% \definefontsynonym[qx-ucrbo8a] [qcrbi] -% -% alternative 2 - -\starttypescript [mono] [courier] [qx] - \definefontsynonym [Courier] [qcrr] [encoding=qx] - \definefontsynonym [Courier-Bold] [qcrb] [encoding=qx] - \definefontsynonym [Courier-Oblique] [qcrri] [encoding=qx] - \definefontsynonym [Courier-BoldOblique] [qcrbi] [encoding=qx] -\stoptypescript - -% Helvetica (URW) - -\starttypescript [sans] [helvetica] [texnansi,ec,8r,t5] - \definefontsynonym [Helvetica] [\typescriptthree-uhvr8a] [encoding=\typescriptthree] - \definefontsynonym [Helvetica-Italic] [\typescriptthree-uhvri8a] [encoding=\typescriptthree] - \definefontsynonym [Helvetica-Oblique] [\typescriptthree-uhvro8a] [encoding=\typescriptthree] - \definefontsynonym [Helvetica-Bold] [\typescriptthree-uhvb8a] [encoding=\typescriptthree] - \definefontsynonym [Helvetica-BoldItalic] [\typescriptthree-uhvbi8a] [encoding=\typescriptthree] - \definefontsynonym [Helvetica-BoldOblique] [\typescriptthree-uhvbo8a] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [sans] [helvetica] [qx] % narrow - \definefontsynonym [Helvetica] [qhvr] [encoding=qx] % qhvcr - \definefontsynonym [Helvetica-Italic] [qhvri] [encoding=qx] % qhvcri - \definefontsynonym [Helvetica-Oblique] [qhvri] [encoding=qx] % qhvcri - \definefontsynonym [Helvetica-Bold] [qhvb] [encoding=qx] % qhvcb - \definefontsynonym [Helvetica-BoldItalic] [qhvbi] [encoding=qx] % qhvcbi - \definefontsynonym [Helvetica-BoldOblique] [qhvbi] [encoding=qx] % qhvcbi -\stoptypescript - -% Times Roman (URW) - -\starttypescript [serif] [times] [texnansi,ec,8r,t5] - \definefontsynonym [Times-Roman] [\typescriptthree-utmr8a] [encoding=\typescriptthree] - \definefontsynonym [Times-Italic] [\typescriptthree-utmri8a] [encoding=\typescriptthree] - \definefontsynonym [Times-Bold] [\typescriptthree-utmb8a] [encoding=\typescriptthree] - \definefontsynonym [Times-BoldItalic] [\typescriptthree-utmbi8a] [encoding=\typescriptthree] - - \definefontsynonym [Times-Slanted] [\typescriptthree-utmr8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Times-BoldSlanted] [\typescriptthree-utmb8a-slanted-167] [encoding=\typescriptthree] - - \definefontsynonym [Times] [Times-Roman] -\stoptypescript - -\starttypescript [serif] [times] [qx] - \definefontsynonym [Times-Roman] [qtmr] [encoding=qx] - \definefontsynonym [Times-Italic] [qtmri] [encoding=qx] - \definefontsynonym [Times-Bold] [qtmb] [encoding=qx] - \definefontsynonym [Times-BoldItalic] [qtmbi] [encoding=qx] - - \definefontsynonym [Times-Slanted] [Times-Italic] - \definefontsynonym [Times-BoldSlanted] [Times-BoldItalic] - - \definefontsynonym [Times] [Times-Roman] -\stoptypescript - -% Math Times (tx) - -\starttypescript [math] [times] [all] - \definefontsynonym [Times-Roman-Upright] [txr] - \definefontsynonym [Times-Roman-Italic] [txi] - \definefontsynonym [Times-Roman-Slanted] [txsl] - \definefontsynonym [Times-Roman-Caps] [txsc] - \definefontsynonym [Times-Companion-Upright] [tcxr] - \definefontsynonym [Times-Companion-Italic] [tcxi] - \definefontsynonym [Times-Companion-Slanted] [tcxsl] - \definefontsynonym [Times-Math-Italic] [txmi] - \definefontsynonym [Times-Math-Symbols] [txsy] - \definefontsynonym [Times-Math-Extension] [txex] - \definefontsynonym [Times-Math-SymbolsA] [txsya] - \definefontsynonym [Times-Math-SymbolsB] [txsyb] - \definefontsynonym [Times-Math-SymbolsC] [txsyc] - \definefontsynonym [Times-Math-Italic-A] [txmia] - \definefontsynonym [Times-Math-Extension-A] [txexa] -\stoptypescript - -% Antykwa Torunska (GUST) - -% \starttypescript [serif] [antykwa-torunska] [texnansi,ec,8r] -% \definefontsynonym [AntykwaTorunska-Regular] [\typescriptthree-anttr] [encoding=\typescriptthree] -% \definefontsynonym [AntykwaTorunska-Bold] [\typescriptthree-anttb] [encoding=\typescriptthree] -% \definefontsynonym [AntykwaTorunska-Italic] [\typescriptthree-anttri] [encoding=\typescriptthree] -% \stoptypescript - -\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,qx,t5,ec,t2a,t2b,t2c,greek] - \definefontsynonym [AntykwaTorunska-Bold] [\typescriptthree-anttb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-BoldItalic] [\typescriptthree-anttbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Light] [\typescriptthree-anttl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightItalic] [\typescriptthree-anttli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Medium] [\typescriptthree-anttm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MedItalic] [\typescriptthree-anttmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Regular] [\typescriptthree-anttr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Italic] [\typescriptthree-anttri] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBold] [\typescriptthree-anttcb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldItalic] [\typescriptthree-anttcbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLight] [\typescriptthree-anttcl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightItalic][\typescriptthree-anttcli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedium] [\typescriptthree-anttcm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedItalic] [\typescriptthree-anttcmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondRegular] [\typescriptthree-anttcr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondItalic] [\typescriptthree-anttcri] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,qx,t5,ec] - \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttbcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttlcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttlicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttmcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttrcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttricap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcbcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttclcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttclicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcmcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcrcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcricap] [encoding=\typescriptthree] -\stoptypescript - -% duplicates ? ? -% atl: no: fallbacks for the named variants - -\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [t2a,t2b,t2c,greek] - \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttri] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttcl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttcli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcri] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [t2a,t2b,t2c] - \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttri] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttcl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttcli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcri] [encoding=\typescriptthree] -\stoptypescript - -% mabye no -Regular etc -% dunny reverse of condlight lightcond - -\starttypescript [math] [antykwa-torunska] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-Regular] [rm-anttr] - \definefontsynonym [AntykwaTorunska-Math-Letters-RegularItalic] [mi-anttri] - \definefontsynonym [AntykwaTorunska-Math-Symbols-Regular] [sy-anttrz] - \definefontsynonym [AntykwaTorunska-Math-Extension-Regular] [ex-anttr] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-light] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-Light] [rm-anttl] - \definefontsynonym [AntykwaTorunska-Math-Letters-LightItalic] [mi-anttli] - \definefontsynonym [AntykwaTorunska-Math-Symbols-Light] [sy-anttlz] - \definefontsynonym [AntykwaTorunska-Math-Extension-Light] [ex-anttl] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-cond] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondRegular] [rm-anttcr] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondRegularItalic] [mi-anttcri] - \definefontsynonym [AntykwaTorunska-Math-Symbols-CondRegular] [sy-anttcrz] - \definefontsynonym [AntykwaTorunska-Math-Extension-CondRegular] [ex-anttcr] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-lightcond] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondLight] [rm-anttcl] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondLightItalic] [mi-anttcli] - \definefontsynonym [AntykwaTorunska-Math-Symbols-CondLight] [sy-anttclz] - \definefontsynonym [AntykwaTorunska-Math-Extension-CondLight] [ex-anttcl] -\stoptypescript - -% Antykwa Poltawskiego (GUST) - -\starttypescript [serif] [antykwa-poltawskiego] [texnansi,ec,8r] - \definefontsynonym [AntykwaPoltawskiego-Regular] [\typescriptthree-antpr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaPoltawskiego-Bold] [\typescriptthree-antpb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaPoltawskiego-Italic] [\typescriptthree-antpri] [encoding=\typescriptthree] - \definefontsynonym [AntykwaPoltawskiego-BoldItalic] [\typescriptthree-antpbi] [encoding=\typescriptthree] -\stoptypescript - -% Iwona (JMN) - -% maybe this will change in Iwona-Math-Letters and Iwona-Math-Letters-Italic - -\starttypescript [sans] [iwona-light,iwona,iwona-medium,iwona-heavy,iwona-light-cond,iwona-cond,iwona-medium-cond,iwona-heavy-cond] [texnansi,ec,el,qx,t5] - \definefontsynonym[Iwona-Light] [\typescriptthree-iwonal] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Regular] [\typescriptthree-iwonar] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Medium] [\typescriptthree-iwonam] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Bold] [\typescriptthree-iwonab] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Heavy] [\typescriptthree-iwonah] [encoding=\typescriptthree] - \definefontsynonym[Iwona-LightItalic] [\typescriptthree-iwonali] [encoding=\typescriptthree] - \definefontsynonym[Iwona-RegularItalic] [\typescriptthree-iwonari] [encoding=\typescriptthree] - \definefontsynonym[Iwona-MediumItalic] [\typescriptthree-iwonami] [encoding=\typescriptthree] - \definefontsynonym[Iwona-BoldItalic] [\typescriptthree-iwonabi] [encoding=\typescriptthree] - \definefontsynonym[Iwona-HeavyItalic] [\typescriptthree-iwonahi] [encoding=\typescriptthree] - - \definefontsynonym[Iwona-CapsLight] [\typescriptthree-iwonalcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsRegular] [\typescriptthree-iwonarcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsMedium] [\typescriptthree-iwonamcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsBold] [\typescriptthree-iwonabcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsHeavy] [\typescriptthree-iwonahcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsLightItalic] [\typescriptthree-iwonalicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsRegularItalic] [\typescriptthree-iwonaricap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsMediumItalic] [\typescriptthree-iwonamicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsBoldItalic] [\typescriptthree-iwonabicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsHeavyItalic] [\typescriptthree-iwonahicap] [encoding=\typescriptthree] - - \definefontsynonym[Iwona-CondLight] [\typescriptthree-iwonacl] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondRegular] [\typescriptthree-iwonacr] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondMedium] [\typescriptthree-iwonacm] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondBold] [\typescriptthree-iwonacb] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondHeavy] [\typescriptthree-iwonach] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondLightItalic] [\typescriptthree-iwonacli] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondRegularItalic] [\typescriptthree-iwonacri] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondMediumItalic] [\typescriptthree-iwonacmi] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondBoldItalic] [\typescriptthree-iwonacbi] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondHeavyItalic] [\typescriptthree-iwonachi] [encoding=\typescriptthree] - - \definefontsynonym[Iwona-CondCapsLight] [\typescriptthree-iwonaclcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondCapsRegular] [\typescriptthree-iwonacrcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondCapsMedium] [\typescriptthree-iwonacmcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondCapsBold] [\typescriptthree-iwonacbcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondCapsHeavy] [\typescriptthree-iwonachcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondCapsLightItalic] [\typescriptthree-iwonaclicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondCapsRegularItalic] [\typescriptthree-iwonacricap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondCapsMediumItalic] [\typescriptthree-iwonacmicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondCapsBoldItalic] [\typescriptthree-iwonacbicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondCapsHeavyItalic] [\typescriptthree-iwonachicap] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [math] [iwona] [default] - \definefontsynonym [Iwona-Math-Letters-Regular] [rm-iwonar] - \definefontsynonym [Iwona-Math-Letters-RegularItalic] [mi-iwonari] - \definefontsynonym [Iwona-Math-Symbols-Regular] [sy-iwonarz] - \definefontsynonym [Iwona-Math-Extension-Regular] [ex-iwonar] -\stoptypescript - -\starttypescript [math] [iwona-light] [default] - \definefontsynonym [Iwona-Math-Letters-Light] [rm-iwonal] - \definefontsynonym [Iwona-Math-Letters-LightItalic] [mi-iwonali] - \definefontsynonym [Iwona-Math-Symbols-Light] [sy-iwonalz] - \definefontsynonym [Iwona-Math-Extension-Light] [ex-iwonal] -\stoptypescript - -\starttypescript [math] [iwona-medium] [default] - \definefontsynonym [Iwona-Math-Letters-Medium] [rm-iwonam] - \definefontsynonym [Iwona-Math-Letters-MediumItalic] [mi-iwonami] - \definefontsynonym [Iwona-Math-Symbols-Medium] [sy-iwonamz] - \definefontsynonym [Iwona-Math-Extension-Medium] [ex-iwonam] -\stoptypescript - -\starttypescript [math] [iwona-heavy] [default] - \definefontsynonym [Iwona-Math-Letters-Heavy] [rm-iwonah] - \definefontsynonym [Iwona-Math-Letters-HeavyItalic] [mi-iwonahi] - \definefontsynonym [Iwona-Math-Symbols-Heavy] [sy-iwonahz] - \definefontsynonym [Iwona-Math-Extension-Heavy] [ex-iwonah] -\stoptypescript - -% Kurier (JMN) - -\starttypescript [sans] [kurier-light,kurier,kurier-medium] [texnansi,ec,qx,t5] - \definefontsynonym[Kurier-Light] [\typescriptthree-kurierl] [encoding=\typescriptthree] - \definefontsynonym[Kurier-Regular] [\typescriptthree-kurierr] [encoding=\typescriptthree] - \definefontsynonym[Kurier-Medium] [\typescriptthree-kurierm] [encoding=\typescriptthree] - \definefontsynonym[Kurier-Bold] [\typescriptthree-kurierb] [encoding=\typescriptthree] - \definefontsynonym[Kurier-Heavy] [\typescriptthree-kurierh] [encoding=\typescriptthree] - \definefontsynonym[Kurier-LightItalic] [\typescriptthree-kurierli] [encoding=\typescriptthree] - \definefontsynonym[Kurier-RegularItalic] [\typescriptthree-kurierri] [encoding=\typescriptthree] - \definefontsynonym[Kurier-MediumItalic] [\typescriptthree-kuriermi] [encoding=\typescriptthree] - \definefontsynonym[Kurier-BoldItalic] [\typescriptthree-kurierbi] [encoding=\typescriptthree] - \definefontsynonym[Kurier-HeavyItalic] [\typescriptthree-kurierhi] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [math] [kurier] [default] - \definefontsynonym [Kurier-Math-Letters-Regular] [rm-kurierr] - \definefontsynonym [Kurier-Math-Letters-RegularItalic] [mi-kurierri] - \definefontsynonym [Kurier-Math-Symbols-Regular] [sy-kurierrz] - \definefontsynonym [Kurier-Math-Extension-Regular] [ex-kurierr] -\stoptypescript - -\starttypescript [math] [kurier-light] [default] - \definefontsynonym [Kurier-Math-Letters-Light] [rm-kurierl] - \definefontsynonym [Kurier-Math-Letters-LightItalic] [mi-kurierli] - \definefontsynonym [Kurier-Math-Symbols-Light] [sy-kurierlz] - \definefontsynonym [Kurier-Math-Extension-Light] [ex-kurierl] -\stoptypescript - -\starttypescript [math] [kurier-medium] [default] - \definefontsynonym [Kurier-Math-Letters-Medium] [rm-kurierm] - \definefontsynonym [Kurier-Math-Letters-MediumItalic] [mi-kuriermi] - \definefontsynonym [Kurier-Math-Symbols-Medium] [sy-kuriermz] - \definefontsynonym [Kurier-Math-Extension-medium] [ex-kurierm] -\stoptypescript - -% Palatino (URW) - -\starttypescript [serif] [palatino] [texnansi,ec,8r,t5] - \definefontsynonym [Palatino] [\typescriptthree-uplr8a] [encoding=\typescriptthree] - \definefontsynonym [Palatino-Italic] [\typescriptthree-uplri8a] [encoding=\typescriptthree] - \definefontsynonym [Palatino-Bold] [\typescriptthree-uplb8a] [encoding=\typescriptthree] - \definefontsynonym [Palatino-BoldItalic] [\typescriptthree-uplbi8a] [encoding=\typescriptthree] - - \definefontsynonym [Palatino-Slanted] [\typescriptthree-uplr8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Palatino-BoldSlanted] [\typescriptthree-uplb8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Palatino-Caps] [\typescriptthree-uplr8a-capitalized-800] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [serif] [palatino] [qx] - \definefontsynonym [Palatino] [qplr] [encoding=qx] - \definefontsynonym [Palatino-Italic] [qplri] [encoding=qx] - \definefontsynonym [Palatino-Bold] [qplb] [encoding=qx] - \definefontsynonym [Palatino-BoldItalic] [qplbi] [encoding=qx] - - \definefontsynonym [Palatino-Slanted] [Palatino-Italic] - \definefontsynonym [Palatino-BoldSlanted] [Palatino-BoldItalic] - \definefontsynonym [Palatino-Caps] [Palatino] -\stoptypescript - -% bonus definitions - -% when these fonts are in tex live ... -% -% \definefontsynonym [Palatino-Caps] [TeXPalladioL-SC] [encoding=\typescriptthree] - -\starttypescript [serif] [palatino] [ec,texnansi,8r] - - \definefontsynonym[TeXPalladioL-BoldItalicOsF][\typescriptthree-fplbij8a][encoding=\typescriptthree] - \definefontsynonym[TeXPalladioL-BoldOsF] [\typescriptthree-fplbj8a] [encoding=\typescriptthree] - \definefontsynonym[TeXPalladioL-SC] [\typescriptthree-fplrc8a] [encoding=\typescriptthree] - \definefontsynonym[TeXPalladioL-ItalicOsF] [\typescriptthree-fplrij8a][encoding=\typescriptthree] - -\stoptypescript - -% Palatino Math (PX) - -\starttypescript [math] [palatino] [all] - \definefontsynonym [Palatino-Roman-Upright] [pxr] - \definefontsynonym [Palatino-Roman-Italic] [pxi] - \definefontsynonym [Palatino-Roman-Slanted] [pxsl] - \definefontsynonym [Palatino-Roman-Caps] [pxsc] - \definefontsynonym [Palatino-Companion-Upright] [pcxr] - \definefontsynonym [Palatino-Companion-Italic] [pcxi] - \definefontsynonym [Palatino-Companion-Slanted] [pcxsl] - \definefontsynonym [Palatino-Math-Italic] [pxmi] - \definefontsynonym [Palatino-Math-Symbols] [pxsy] - \definefontsynonym [Palatino-Math-Extension] [pxex] - \definefontsynonym [Palatino-Math-SymbolsA] [pxsya] - \definefontsynonym [Palatino-Math-SymbolsB] [pxsyb] - \definefontsynonym [Palatino-Math-SymbolsC] [pxsyc] - \definefontsynonym [Palatino-Math-Italic-A] [pxmia] - \definefontsynonym [Palatino-Math-Extension-A] [pxexa] -\stoptypescript - -% Bookman (URW) - -\starttypescript [serif] [bookman] [ec,texnansi,8r,t5] - \definefontsynonym [Bookman-Light] [\typescriptthree-ubkl8a] [encoding=\typescriptthree] - \definefontsynonym [Bookman-LightItalic] [\typescriptthree-ubkli8a] [encoding=\typescriptthree] - \definefontsynonym [Bookman-DemiBold] [\typescriptthree-ubkd8a] [encoding=\typescriptthree] - \definefontsynonym [Bookman-DemiBoldItalic] [\typescriptthree-ubkdi8a] [encoding=\typescriptthree] - \definefontsynonym [Bookman-LightSlanted] [\typescriptthree-ubkl8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Bookman-DemiBoldSlanted] [\typescriptthree-ubkd8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Bookman-Light-Caps] [\typescriptthree-ubkl8a-capitalized-800] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [serif] [bookman] [qx] - \definefontsynonym [Bookman-Light] [qbkr] [encoding=qx] - \definefontsynonym [Bookman-LightItalic] [qbkri] [encoding=qx] - \definefontsynonym [Bookman-DemiBold] [qbkb] [encoding=qx] - \definefontsynonym [Bookman-DemiBoldItalic] [qbkbi] [encoding=qx] - - \definefontsynonym [Bookman-LightSlanted] [Bookman-LightItalic] - \definefontsynonym [Bookman-DemiBoldSlanted] [Bookman-DemiBoldItalic] - \definefontsynonym [Bookman-Light-Caps] [Bookman-Light] -\stoptypescript - -% Chancery (URW) - -\starttypescript [calligraphy] [chancery] [ec,texnansi,8r] - \definefontsynonym [Chancery] [\typescriptthree-uzcmi8a] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [calligraphy] [chancery] [qx] - \definefontsynonym [Chancery] [qzcmi] [encoding=qx] -\stoptypescript - -% New Century Schoolbook (URW) - -\starttypescript [serif] [schoolbook] [ec,texnansi,8r,t5] - \definefontsynonym [Schoolbook-Roman] [\typescriptthree-uncr8a] [encoding=\typescriptthree] - \definefontsynonym [Schoolbook-Italic] [\typescriptthree-uncri8a] [encoding=\typescriptthree] - \definefontsynonym [Schoolbook-Bold] [\typescriptthree-uncb8a] [encoding=\typescriptthree] - \definefontsynonym [Schoolbook-BoldItalic] [\typescriptthree-uncbi8a] [encoding=\typescriptthree] - \definefontsynonym [Schoolbook-RomanSlanted] [\typescriptthree-uncr8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Schoolbook-BoldSlanted] [\typescriptthree-uncb8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Schoolbook-Roman-Caps] [\typescriptthree-uncr8a-capitalized-800] [encoding=\typescriptthree] -\stoptypescript - -% Utopia (Adobe) - -\starttypescript [serif] [utopia] [ec,texnansi] - \definefontsynonym [Utopia-Regular] [\typescriptthree-putr8a] [encoding=\typescriptthree] - \definefontsynonym [Utopia-Italic] [\typescriptthree-putri8a] [encoding=\typescriptthree] - \definefontsynonym [Utopia-Bold] [\typescriptthree-putb8a] [encoding=\typescriptthree] - \definefontsynonym [Utopia-BoldItalic] [\typescriptthree-putbi8a] [encoding=\typescriptthree] - \definefontsynonym [Utopia-Slanted] [\typescriptthree-putr8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Utopia-BoldSlanted] [\typescriptthree-putb8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Utopia-Regular-Caps][\typescriptthree-putr8a-capitalized-800] [encoding=\typescriptthree] -\stoptypescript - -% Charter (Bitstream) - -\starttypescript [serif] [charter] [ec,texnansi,8r] - \definefontsynonym [Charter-Roman] [\typescriptthree-bchr8a] [encoding=\typescriptthree] - \definefontsynonym [Charter-Italic] [\typescriptthree-bchri8a] [encoding=\typescriptthree] - \definefontsynonym [Charter-Bold] [\typescriptthree-bchb8a] [encoding=\typescriptthree] - \definefontsynonym [Charter-BoldItalic] [\typescriptthree-bchbi8a] [encoding=\typescriptthree] - \definefontsynonym [Charter-Slanted] [\typescriptthree-bchr8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Charter-BoldSlanted][\typescriptthree-bchb8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Charter-Roman-Caps] [\typescriptthree-bchr8a-capitalized-800] [encoding=\typescriptthree] -\stoptypescript - -% Whatever else we need: - -\starttypescript - \definefontsynonym [ZapfDingbats] [uzdr] - \definefontsynonym [RalfSmithFormalScript] [rsfs10] - \definefontsynonym [MartinVogel] [fmvr8x] -\stoptypescript - -\stoptypescriptcollection - -\endinput diff --git a/tex/context/base/type-exa.tex b/tex/context/base/type-exa.tex deleted file mode 100644 index 29f882f02..000000000 --- a/tex/context/base/type-exa.tex +++ /dev/null @@ -1,27 +0,0 @@ -%D \module -%D [ file=type-exa, -%D version=2001.04.12, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Example scripts, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D The examples are moved to \type {type-one}, \type {type-otf} and -%D \type {type-buy}. - -\starttypescript [fallback,modern,modern-base] [il2] - \usetypescript[\typescriptone][ec] - \enableregime[il2] -\stoptypescript - -\starttypescript [fallback,modern,modern-base] [pl0] - \usetypescript[\typescriptone][qx] - \enableregime[pl0] -\stoptypescript - -\endinput diff --git a/tex/context/base/type-ini.mkii b/tex/context/base/type-ini.mkii index fa7b7934f..9372f8dc3 100644 --- a/tex/context/base/type-ini.mkii +++ b/tex/context/base/type-ini.mkii @@ -84,8 +84,7 @@ \usetypescriptfile[\f!typeprefix xtx] \else \usetypescriptfile[\f!typeprefix one] - %usetypescriptfile[\f!typeprefix gyr] % to be merged into one - \usetypescriptfile[\f!typeprefix akb] % will go away when gyre is merged + %usetypescriptfile[\f!typeprefix akb] % we have gyre now \fi \usetypescriptfile[\f!typeprefix loc] @@ -591,10 +590,6 @@ % we can use \rawgetparameters or \rawgeteparameters -\ifx\mkdodefinetypeface\undefined - \let\mkdodefinetypeface\gobblefivearguments -\fi - \def\dodefinetypeface[#1][#2][#3][#4][#5][#6]% {\dododefinetypeface[#1][#2]% \iffifthargument % sixth is optional @@ -736,7 +731,7 @@ \the\scratchtoks \fi} -\fetchruntimecommand \typetypescript {\f!typeprefix\s!run} +\fetchruntimecommand \typetypescript {\f!typeprefix\s!run.mkii} % \usetypescript [berry] [ec] diff --git a/tex/context/base/type-ini.mkiv b/tex/context/base/type-ini.mkiv index 42c45bdaa..bffc220fa 100644 --- a/tex/context/base/type-ini.mkiv +++ b/tex/context/base/type-ini.mkiv @@ -201,75 +201,6 @@ \setfalse\quittingtypescript \fi} -% % not faster, unless maybe toks -% -% \newcount\nofloadedtypescripts -% -% \def\startloadedtypescript -% {\dotripleempty\dostartloadedtypescript} -% -% \let\stoploadedtypescript\relax -% -% \long\def\dostartloadedtypescript[#1][#2][#3]#4\stoptypescript -% {\global\advance\nofloadedtypescripts\plusone -% \long\setgvalue{\??ts=>\the\nofloadedtypescripts}{#4}% -% \edef\temp% -% {\iffirstargument [#1]\fi -% \ifsecondargument[#2]\fi -% \ifthirdargument [#3]\fi -% \noexpand\csname\??ts=>\the\nofloadedtypescripts\noexpand\endcsname}% -% \global\loadedtypescripts\@EA\@EA\@EA{\@EA\the\@EA\loadedtypescripts\@EA\starttypescript\temp\stoptypescript}} -% -% \def\startloadedtypescriptcollection -% {\dosingleempty\dostartloadedtypescriptcollection} -% -% \def\dostartloadedtypescriptcollection[#1]{} -% \def\stoploadedtypescriptcollection {} -% -% \def\dododousetypescript#1% -% {\setfalse\quittingtypescript -% \pushmacro\currenttypefile -% \def\currenttypefile{#1}% -% \ifconditional\preloadingtypescripts -% % load files once, and use saved data -% \def\loadedtypescripts{\csname\??ts:\c!file:#1\endcsname}% -% \@EAEAEA\ifx\loadedtypescripts\relax -% \@EAEAEA\newtoks\loadedtypescripts -% \bgroup -% % -% \let\starttypescript \startloadedtypescript -% \let\stoptypescript \stoploadedtypescript -% \let\starttypescriptcollection\startloadedtypescriptcollection -% \let\stoptypescriptcollection \stoploadedtypescriptcollection -% % -% \startreadingfile -% \pushendofline -% \unprotect -% \readfile\currenttypefile\donothing\donothing -% \protect -% \popendofline -% \stopreadingfile -% \egroup -% \fi -% %\message{[\space\currenttypefile}% -% \the\loadedtypescripts -% %\message{\ifconditional\quittingtypescript quit\space\fi]}% -% \else -% % process files each time -% \startreadingfile -% \pushendofline -% \unprotect -% \readfile\currenttypefile\donothing\donothing -% \protect -% \popendofline -% \stopreadingfile -% \fi -% \popmacro\currenttypefile -% \ifconditional\quittingtypescript -% \quitcommalist -% \setfalse\quittingtypescript -% \fi} - \def\usetypescriptonce {\dotripleempty\dousetypescriptonce} @@ -486,12 +417,9 @@ \def\dodoloadmapline[#1][#2]% {\loadallfontmapfiles % ! ! ! \ifsecondargument - \immediatewriteutilitycommand{\usedmapline{#1}{#2}}% \doloadmapline{#1}{#2}% special \else - \loadmapline[=][#1]% - %\immediatewriteutilitycommand{\usedmapline{=}{#2}}% - %\doloadmapline{=}{#1}% special + \doloadmapline{=}{#1}% special \fi} % since this is driver dependent, and since we may set map files @@ -506,16 +434,16 @@ % hm, the timing of when pdftex needs the map file info keeps changing; % it's really time to move to map line support -% \appendtoks \loadallfontmapfiles \to \everyPDFximage -% \appendtoks \loadallfontmapfiles \to \everystarttext -% \appendtoks \loadallfontmapfiles \to \everybeforepagebody +% \everybeforeshipout \expandafter % will move as it is backend dependent +% {\expandafter\appendtoks +% \expandafter\loadallfontmapfiles +% \expandafter\to +% \expandafter\pageboundsettings +% \the\everybeforeshipout} -\everybeforeshipout \expandafter - {\expandafter\appendtoks - \expandafter\loadallfontmapfiles - \expandafter\to - \expandafter\pageboundsettings - \the\everybeforeshipout} +\appendtoks + \loadallfontmapfiles +\to \pageboundsettings \newif\ifautoloadmapfiles @@ -577,13 +505,9 @@ % #1=main #2=rm #3=serif #4=fontname #5=size #6=settings -\def\typefaceencoding{\defaultencoding} - % we can use \rawgetparameters or \rawgeteparameters -\ifx\mkdodefinetypeface\undefined - \let\mkdodefinetypeface\gobblefivearguments -\fi +\def\typefaceencoding{\defaultencoding} \def\dodefinetypeface[#1][#2][#3][#4][#5][#6]% {\dododefinetypeface[#1][#2]% @@ -600,9 +524,14 @@ \letvalue{\fontclass\s!fallbacks}\@@tsfallbacks % new per 12/10/2008 \saverelativefontsize{#2}\relativefontsize % fall back \savemathtextstyle\@@tstext % math text style (new per 28/4/2006) - \iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4] / \typefaceencoding}\fi -% \usetypescript[#3,\t!map][#4][\t!name,\t!default,\typefaceencoding,\t!special]% map is needed for backward cmp - \usetypescript[#3][#4][\t!name,\t!default,\typefaceencoding]% typefaceencoding=empty forces [#3][#4] + \iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4]}\fi + % we need to keep typefaceencoding for a while as it can still be used to filter + % old scripts as we just strip the texnansi- prefix + \ifx\typefaceencoding\t!default + \usetypescript[#3][#4][\t!name,\t!default]% will be default some day + \else + \usetypescript[#3][#4][\t!name,\t!default,\typefaceencoding]% + \fi \usetypescript[#3][#5][\t!size]% \popmacro\fontclass \popmacro\typefaceencoding @@ -613,6 +542,32 @@ \getparameters[\??tf#1#2][#3]% \fi\fi\fi} +% will become (once we've adapted the typescripts): +% +% \def\dodefinetypeface[#1][#2][#3][#4][#5][#6]% +% {\dododefinetypeface[#1][#2]% +% \iffifthargument % sixth is optional +% % we need to expand since in #6 there can be a \typescripttwo +% \normalexpanded{\noexpand\getparameters[\??ts][\s!rscale=\plusone,\s!features=,\s!fallbacks=,\s!text=,#6]}% \geteparameters +% \pushmacro\relativefontsize +% \pushmacro\fontclass +% \let\relativefontsize\@@tsrscale +% \setcurrentfontclass{#1}% +% \letvalue{\fontclass\s!features }\@@tsfeatures % new per 16/6/2007 +% \letvalue{\fontclass\s!fallbacks}\@@tsfallbacks % new per 12/10/2008 +% \saverelativefontsize{#2}\relativefontsize % fall back +% \savemathtextstyle\@@tstext % math text style (new per 28/4/2006) +% \iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4]}\fi +% \usetypescript[#3][#4][\t!name,\t!default,\empty]% brr, this empty, no encoding +% \usetypescript[#3][#5][\t!size]% +% \popmacro\fontclass +% \popmacro\relativefontsize +% \else\iffourthargument +% \definetypeface[#1][#2][#3][#4][\s!default]% +% \else\ifthirdargument +% \getparameters[\??tf#1#2][#3]% +% \fi\fi\fi} + \def\dododefinetypeface[#1][#2]% saveguard against redefinition {\doifsomething{#1} {\ifcsname\??tf#1\s!default\endcsname \else @@ -639,11 +594,11 @@ #1[#4]% \else\ifx\fontclass\empty #1[\c!rm]% + \else\ifcsname\??tf\fontclass\s!default\endcsname + #1[\csname\??tf\fontclass\s!default\endcsname]% \else - \doifdefinedelse{\??tf\fontclass\s!default} - {#1[\getvalue{\??tf\fontclass\s!default}]} - {#1[\c!rm]}% - \fi \fi + #1[\c!rm]% + \fi \fi \fi \ifmmode\mr\else\tf\fi} % needed ? \def\usetypefile[#1]% recurses on path ! @@ -700,6 +655,6 @@ \the\scratchtoks \fi} -\fetchruntimecommand \typetypescript {\f!typeprefix\s!run} +\fetchruntimecommand \typetypescript {\f!typeprefix\s!run.mkiv} % will become module \protect \endinput diff --git a/tex/context/base/type-map.tex b/tex/context/base/type-map.tex deleted file mode 100644 index 5a581a78b..000000000 --- a/tex/context/base/type-map.tex +++ /dev/null @@ -1,197 +0,0 @@ -%D \module -%D [ file=type-map, -%D version=2001.04.12, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Mapfile scripts, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\starttypescriptcollection[map files] - -%D This one plays safe: - -\starttypescript [map] [base] [all] - \loadmapfile[original-base.map] - \loadmapfile[ec-base.map] - \loadmapfile[texnansi-base.map] - \loadmapfile[8r-base.map] - \loadmapfile[qx-base.map] - \loadmapfile[t5-base.map] -\stoptypescript - -\starttypescript [map] [base,euler,ams] [all] - \loadmapfile[original-ams-base.map] - %loadmapfile[original-ams-cmr.map] - \loadmapfile[original-ams-euler.map] - %loadmapfile[original-public-lm.map] -\stoptypescript - -% This is the base map file, load it to be sure. - -\starttypescript [map] [all] [ec,8r,texnansi,qx,t5] - \loadmapfile[original-base.map] - \loadmapfile[\typescriptthree-base.map] -\stoptypescript - -% if we were in full control, we could have -% -% \starttypescript [berry] [ec] -% \loadmapfile[ec-base.map] -% \stoptypescript - -% cmr and related - -\starttypescript [map] [cmr,lm,lmr] - %loadmapfile[original-public-lm.map] - \loadmapfile[original-ams-base.map] - \loadmapfile[original-ams-euler.map] -\stoptypescript - -% cyrillic - -\starttypescript [map] [computer-modern] [t2a,t2b,t2c,x2] - \loadmapfile[subset-cmsuper-\typescriptthree.map] - \loadmapfile[cm-super-\typescriptthree.map] -\stoptypescript - -% latin modern (watch the unfortunate \quote {lm-encoding} order -% in the name; for the moment we ship copies of the map files. - -\starttypescript [map] [modern,modern-vari,modern-cond,computer-modern,latin-modern,latin-modern-vari,latin-modern-cond,] [ec,texnansi,qx,t5] - % this was what we had at the start and what fits best into our naming scheme - % well, all those changes in lm gave too many user problem reports so i revert to: - % \loadmapfile[\typescriptthree-public-lm.map] - % this one also fits into the naming scheme but has been dropped by the distributers - % \loadmapfile[\typescriptthree-lm.map] - % this is what the latest distributions provide - \loadmapfile[lm-\typescriptthree.map] % maybe some day - \loadmapfile[lm-math.map] - \loadmapfile[lm-rm.map] -\stoptypescript - -% \usetypescript [map] [latin-modern-os] [ec] % lm is loaded under ec regime -% \starttext -% Is onze Frans nu 41, 52, 63, 74, 85 of 96 jaar \quote {old}? -% \stoptext - -\starttypescript [map] [latin-modern-os] [ec,texnansi,qx,t5] - \loadmapfile[\typescriptthree-os-public-lm.map] -\stoptypescript - -% the next applies to texfont generated metrics - -\starttypescript [map] [utopia] [ec,texnansi,t5,8r] - \loadmapfile[\typescriptthree-adobe-utopia.map] -\stoptypescript - -\starttypescript [map] [charter] [ec,texnansi,t5,8r] - \loadmapfile[\typescriptthree-bitstrea-charter.map] -\stoptypescript - -% \starttypescript [map] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,ec,qx,t5,t2a,t2b,t2c,default] -% \loadmapfile[\typescriptthree-antt.map] -% \loadmapfile[rm-antt.map] -% \loadmapfile[mi-antt.map] -% \loadmapfile[sy-antt.map] -% \loadmapfile[ex-antt.map] -% \stoptypescript - -\starttypescript [map] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,ec,qx,t5,t2a,t2b,t2c,default] - \loadmapfile[antt-\typescriptthree.map] - \loadmapfile[antt-rm.map] - \loadmapfile[antt-mi.map] - \loadmapfile[antt-sy.map] - \loadmapfile[antt-ex.map] -\stoptypescript - -\starttypescript [map] [antykwa-poltawskiego] [ec,texnansi,qx,t5] - \loadmapfile[\typescriptthree-public-antp.map] -\stoptypescript - -% \starttypescript [map] [iwona,iwona-light,iwona-medium,iwona-heavy] [ec,texnansi,qx,t5] -% \loadmapfile[\typescriptthree-iwona.map] -% \loadmapfile[rm-iwona.map] -% \loadmapfile[mi-iwona.map] -% \loadmapfile[sy-iwona.map] -% \loadmapfile[ex-iwona.map] -% \stoptypescript - -\starttypescript [map] [iwona,iwona-light,iwona-medium,iwona-heavy] [ec,texnansi,qx,t5] - \loadmapfile[iwona-\typescriptthree.map] - \loadmapfile[iwona-rm.map] - \loadmapfile[iwona-mi.map] - \loadmapfile[iwona-sy.map] - \loadmapfile[iwona-ex.map] -\stoptypescript - -% \starttypescript [map] [kurier,kurier-light,kurier-medium,kurier-heavy] [ec,texnansi,qx,t5,default] -% \loadmapfile[\typescriptthree-kurier.map] -% \loadmapfile[rm-kurier.map] -% \loadmapfile[mi-kurier.map] -% \loadmapfile[sy-kurier.map] -% \loadmapfile[ex-kurier.map] -% \stoptypescript - -\starttypescript [map] [kurier,kurier-light,kurier-medium,kurier-heavy] [ec,texnansi,qx,t5,default] - \loadmapfile[kurier-\typescriptthree.map] - \loadmapfile[kurier-rm.map] - \loadmapfile[kurier-mi.map] - \loadmapfile[kurier-sy.map] - \loadmapfile[kurier-ex.map] -\stoptypescript - -% \starttypescript [map] [bookman] [ec,texnansi,t5,8r] -% \loadmapfile[\typescriptthree-urw-bookman.map] -% \stoptypescript - -% \starttypescript [map] [courier] [ec,texnansi,t5,8r] -% \loadmapfile[\typescriptthree-urw-courier.map] -% \stoptypescript - -% \starttypescript [map] [helvetica] [ec,texnansi,t5,8r] -% \loadmapfile[\typescriptthree-urw-helvetica.map] -% \stoptypescript - -% \starttypescript [map] [palatino] [ec,texnansi,t5,8r] -% \loadmapfile[\typescriptthree-urw-palatino.map] -% %loadmapfile[\typescriptthree-public-pfl.map] -% \stoptypescript - -% \starttypescript [map] [times] [ec,texnansi,t5,8r] -% \loadmapfile[\typescriptthree-urw-times.map] -% \stoptypescript - -% \starttypescript [map] [chancery] [ec,texnansi,t5,8r] -% \loadmapfile[\typescriptthree-urw-zapfchan.map] -% \stoptypescript - -% \starttypescript [map] [schoolbook] [ec,texnansi,t5,8r] -% \loadmapfile[\typescriptthree-urw-ncntrsbk.map] -% \stoptypescript - -% once i can be sure that the map files are in the tree, i will -% use those instead of original (too many variants anyway) - -\starttypescript [map] [palatino] [default,ec,texnansi,t5,8r] - \loadmapfile[original-youngryu-px.map] -\stoptypescript - -\starttypescript [map] [times] [default,ec,texnansi,t5,8r] - \loadmapfile[original-youngryu-tx.map] -\stoptypescript - -% to do: maybe original, maybe not - -\starttypescript [map] [fourier] [ec] - \loadmapfile[fourier.map] - \loadmapfile[fourier-utopia-expert.map] -\stoptypescript - -\stoptypescriptcollection - -\endinput diff --git a/tex/context/base/type-old.tex b/tex/context/base/type-old.tex deleted file mode 100644 index 881deeefe..000000000 --- a/tex/context/base/type-old.tex +++ /dev/null @@ -1,320 +0,0 @@ -%D \module -%D [ file=type-old, -%D version=2005.09.07, % moved from type-*.tex -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Ghosts from the Past, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\endinput - -% \starttypescript[all][modern,latin-modern,computer-modern][pl0] -% -% \definefontsynonym[pl0-lmb10] [plb10] [encoding=pl0] -% \definefontsynonym[pl0-lmbo10] [plbsl10] [encoding=pl0] -% \definefontsynonym[pl0-lmbx10] [plbx10] [encoding=pl0] -% \definefontsynonym[pl0-lmbx12] [plbx12] [encoding=pl0] -% \definefontsynonym[pl0-lmbx5] [plbx5] [encoding=pl0] -% \definefontsynonym[pl0-lmbx6] [plbx6] [encoding=pl0] -% \definefontsynonym[pl0-lmbx7] [plbx7] [encoding=pl0] -% \definefontsynonym[pl0-lmbx8] [plbx8] [encoding=pl0] -% \definefontsynonym[pl0-lmbx9] [plbx9] [encoding=pl0] -% \definefontsynonym[pl0-lmbxi10] [plbxti10] [encoding=pl0] -% \definefontsynonym[pl0-lmbxo10] [plbxsl10] [encoding=pl0] -% \definefontsynonym[pl0-lmcsc10] [plcsc10] [encoding=pl0] -% \definefontsynonym[pl0-lmcsco10][plcscsl10][encoding=pl0] -% \definefontsynonym[pl0-lmr10] [plr10] [encoding=pl0] -% \definefontsynonym[pl0-lmr12] [plr12] [encoding=pl0] -% \definefontsynonym[pl0-lmr17] [plr17] [encoding=pl0] -% \definefontsynonym[pl0-lmr5] [plr5] [encoding=pl0] -% \definefontsynonym[pl0-lmr6] [plr6] [encoding=pl0] -% \definefontsynonym[pl0-lmr7] [plr7] [encoding=pl0] -% \definefontsynonym[pl0-lmr8] [plr8] [encoding=pl0] -% \definefontsynonym[pl0-lmr9] [plr9] [encoding=pl0] -% \definefontsynonym[pl0-lmri10] [plti10] [encoding=pl0] -% \definefontsynonym[pl0-lmri12] [plti12] [encoding=pl0] -% \definefontsynonym[pl0-lmri7] [plti7] [encoding=pl0] -% \definefontsynonym[pl0-lmri8] [plti8] [encoding=pl0] -% \definefontsynonym[pl0-lmri9] [plti9] [encoding=pl0] -% \definefontsynonym[pl0-lmro10] [plsl10] [encoding=pl0] -% \definefontsynonym[pl0-lmro12] [plsl12] [encoding=pl0] -% \definefontsynonym[pl0-lmro8] [plsl8] [encoding=pl0] -% \definefontsynonym[pl0-lmro9] [plsl9] [encoding=pl0] -% \definefontsynonym[pl0-lmss10] [plss10] [encoding=pl0] -% \definefontsynonym[pl0-lmss12] [plss12] [encoding=pl0] -% \definefontsynonym[pl0-lmss17] [plss17] [encoding=pl0] -% \definefontsynonym[pl0-lmss8] [plss8] [encoding=pl0] -% \definefontsynonym[pl0-lmss9] [plss9] [encoding=pl0] -% \definefontsynonym[pl0-lmssbo10][plssbi10] [encoding=pl0] -% \definefontsynonym[pl0-lmssbx10][plssbx10] [encoding=pl0] -% \definefontsynonym[pl0-lmssdc10][plssdc10] [encoding=pl0] -% \definefontsynonym[pl0-lmssdo10][plssdi10] [encoding=pl0] -% \definefontsynonym[pl0-lmsso10] [plssi10] [encoding=pl0] -% \definefontsynonym[pl0-lmsso12] [plssi12] [encoding=pl0] -% \definefontsynonym[pl0-lmsso17] [plssi17] [encoding=pl0] -% \definefontsynonym[pl0-lmsso8] [plssi8] [encoding=pl0] -% \definefontsynonym[pl0-lmsso9] [plssi9] [encoding=pl0] -% \definefontsynonym[pl0-lmssq8] [plssq8] [encoding=pl0] -% \definefontsynonym[pl0-lmssqbo8][plssqbi8] [encoding=pl0] -% \definefontsynonym[pl0-lmssqbx8][plssqb8] [encoding=pl0] -% \definefontsynonym[pl0-lmssqo8] [plssqi8] [encoding=pl0] -% \definefontsynonym[pl0-lmtcsc10][pltcsc10] [encoding=pl0] -% \definefontsynonym[pl0-lmtt10] [pltt10] [encoding=pl0] -% \definefontsynonym[pl0-lmtt12] [pltt12] [encoding=pl0] -% \definefontsynonym[pl0-lmtt8] [pltt8] [encoding=pl0] -% \definefontsynonym[pl0-lmtt9] [pltt9] [encoding=pl0] -% \definefontsynonym[pl0-lmtti10] [pltti10] [encoding=pl0] -% \definefontsynonym[pl0-lmtto10] [plsltt10] [encoding=pl0] -% \definefontsynonym[pl0-lmvtt10] [plvtt10] [encoding=pl0] -% \definefontsynonym[pl0-lmvtto10][plvtti10] [encoding=pl0] -% -% \stoptypescript - -% \starttypescript[all][modern,latin-modern,computer-modern][il2] -% -% \definefontsynonym[il2-lmb10] [csb10] [encoding=il2] -% \definefontsynonym[il2-lmbo10] [csbsl10] [encoding=il2] -% \definefontsynonym[il2-lmbx10] [csbx10] [encoding=il2] -% \definefontsynonym[il2-lmbx12] [csbx12] [encoding=il2] -% \definefontsynonym[il2-lmbx5] [csbx5] [encoding=il2] -% \definefontsynonym[il2-lmbx6] [csbx6] [encoding=il2] -% \definefontsynonym[il2-lmbx7] [csbx7] [encoding=il2] -% \definefontsynonym[il2-lmbx8] [csbx8] [encoding=il2] -% \definefontsynonym[il2-lmbx9] [csbx9] [encoding=il2] -% \definefontsynonym[il2-lmbxi10] [csbxti10] [encoding=il2] -% \definefontsynonym[il2-lmbxo10] [csbxsl10] [encoding=il2] -% \definefontsynonym[il2-lmcsc10] [cscsc10] [encoding=il2] -% \definefontsynonym[il2-lmcsco10][cscscls10][encoding=il2] -% \definefontsynonym[il2-lmr10] [csr10] [encoding=il2] -% \definefontsynonym[il2-lmr12] [csr12] [encoding=il2] -% \definefontsynonym[il2-lmr17] [csr17] [encoding=il2] -% \definefontsynonym[il2-lmr5] [csr5] [encoding=il2] -% \definefontsynonym[il2-lmr6] [csr6] [encoding=il2] -% \definefontsynonym[il2-lmr7] [csr7] [encoding=il2] -% \definefontsynonym[il2-lmr8] [csr8] [encoding=il2] -% \definefontsynonym[il2-lmr9] [csr9] [encoding=il2] -% \definefontsynonym[il2-lmri10] [csti10] [encoding=il2] -% \definefontsynonym[il2-lmri12] [csti12] [encoding=il2] -% \definefontsynonym[il2-lmri7] [csti7] [encoding=il2] -% \definefontsynonym[il2-lmri8] [csti8] [encoding=il2] -% \definefontsynonym[il2-lmri9] [csti9] [encoding=il2] -% \definefontsynonym[il2-lmro10] [cssl10] [encoding=il2] -% \definefontsynonym[il2-lmro12] [cssl12] [encoding=il2] -% \definefontsynonym[il2-lmro8] [cssl8] [encoding=il2] -% \definefontsynonym[il2-lmro9] [cssl9] [encoding=il2] -% \definefontsynonym[il2-lmss10] [csss10] [encoding=il2] -% \definefontsynonym[il2-lmss12] [csss12] [encoding=il2] -% \definefontsynonym[il2-lmss17] [csss17] [encoding=il2] -% \definefontsynonym[il2-lmss8] [csss8] [encoding=il2] -% \definefontsynonym[il2-lmss9] [csss9] [encoding=il2] -% \definefontsynonym[il2-lmssbo10][csssbi10] [encoding=il2] -% \definefontsynonym[il2-lmssbx10][csssbx10] [encoding=il2] -% \definefontsynonym[il2-lmssdc10][csssdc10] [encoding=il2] -% \definefontsynonym[il2-lmssdo10][csssdi10] [encoding=il2] -% \definefontsynonym[il2-lmsso10] [csssi10] [encoding=il2] -% \definefontsynonym[il2-lmsso12] [csssi12] [encoding=il2] -% \definefontsynonym[il2-lmsso17] [csssi17] [encoding=il2] -% \definefontsynonym[il2-lmsso8] [csssi8] [encoding=il2] -% \definefontsynonym[il2-lmsso9] [csssi9] [encoding=il2] -% \definefontsynonym[il2-lmssq8] [csssq8] [encoding=il2] -% \definefontsynonym[il2-lmssqbo8][csssqbi8] [encoding=il2] -% \definefontsynonym[il2-lmssqbx8][csssqb8] [encoding=il2] -% \definefontsynonym[il2-lmssqo8] [csssqi8] [encoding=il2] -% \definefontsynonym[il2-lmtcsc10][cstcsc10] [encoding=il2] -% \definefontsynonym[il2-lmtt10] [cstt10] [encoding=il2] -% \definefontsynonym[il2-lmtt12] [cstt12] [encoding=il2] -% \definefontsynonym[il2-lmtt8] [cstt8] [encoding=il2] -% \definefontsynonym[il2-lmtt9] [cstt9] [encoding=il2] -% \definefontsynonym[il2-lmtti10] [cstti10] [encoding=il2] -% \definefontsynonym[il2-lmtto10] [cssltt10] [encoding=il2] -% \definefontsynonym[il2-lmvtt10] [csvtt10] [encoding=il2] -% \definefontsynonym[il2-lmvtto10][csvtti10] [encoding=il2] -% -% \stoptypescript - -% \starttypescript[all][modern,latin-modern,computer-modern][t5] -% -% \definefontsynonym[t5-lmb10] [vnb10] [encoding=t5] -% \definefontsynonym[t5-lmbo10] [vnbsl10] [encoding=t5] -% \definefontsynonym[t5-lmbx10] [vnbx10] [encoding=t5] -% \definefontsynonym[t5-lmbx12] [vnbx12] [encoding=t5] -% \definefontsynonym[t5-lmbx5] [vnbx5] [encoding=t5] -% \definefontsynonym[t5-lmbx6] [vnbx6] [encoding=t5] -% \definefontsynonym[t5-lmbx7] [vnbx7] [encoding=t5] -% \definefontsynonym[t5-lmbx8] [vnbx8] [encoding=t5] -% \definefontsynonym[t5-lmbx9] [vnbx9] [encoding=t5] -% \definefontsynonym[t5-lmbxi10] [vnbxti10] [encoding=t5] -% \definefontsynonym[t5-lmbxo10] [vnbxsl10] [encoding=t5] -% \definefontsynonym[t5-lmcsc10] [vncsc10] [encoding=t5] -% \definefontsynonym[t5-lmcsco10][vncscsl10][encoding=t5] -% \definefontsynonym[t5-lmr10] [vnr10] [encoding=t5] -% \definefontsynonym[t5-lmr12] [vnr12] [encoding=t5] -% \definefontsynonym[t5-lmr17] [vnr17] [encoding=t5] -% \definefontsynonym[t5-lmr5] [vnr5] [encoding=t5] -% \definefontsynonym[t5-lmr6] [vnr6] [encoding=t5] -% \definefontsynonym[t5-lmr7] [vnr7] [encoding=t5] -% \definefontsynonym[t5-lmr8] [vnr8] [encoding=t5] -% \definefontsynonym[t5-lmr9] [vnr9] [encoding=t5] -% \definefontsynonym[t5-lmri10] [vnti10] [encoding=t5] -% \definefontsynonym[t5-lmri12] [vnti12] [encoding=t5] -% \definefontsynonym[t5-lmri7] [vnti7] [encoding=t5] -% \definefontsynonym[t5-lmri8] [vnti8] [encoding=t5] -% \definefontsynonym[t5-lmri9] [vnti9] [encoding=t5] -% \definefontsynonym[t5-lmro10] [vnsl10] [encoding=t5] -% \definefontsynonym[t5-lmro12] [vnsl12] [encoding=t5] -% \definefontsynonym[t5-lmro8] [vnsl8] [encoding=t5] -% \definefontsynonym[t5-lmro9] [vnsl9] [encoding=t5] -% \definefontsynonym[t5-lmss10] [vnss10] [encoding=t5] -% \definefontsynonym[t5-lmss12] [vnss12] [encoding=t5] -% \definefontsynonym[t5-lmss17] [vnss17] [encoding=t5] -% \definefontsynonym[t5-lmss8] [vnss8] [encoding=t5] -% \definefontsynonym[t5-lmss9] [vnss9] [encoding=t5] -% \definefontsynonym[t5-lmssbo10][vnssbi10] [encoding=t5] -% \definefontsynonym[t5-lmssbx10][vnssbx10] [encoding=t5] -% \definefontsynonym[t5-lmssdc10][vnssdc10] [encoding=t5] -% \definefontsynonym[t5-lmssdo10][vnssdi10] [encoding=t5] -% \definefontsynonym[t5-lmsso10] [vnssi10] [encoding=t5] -% \definefontsynonym[t5-lmsso12] [vnssi12] [encoding=t5] -% \definefontsynonym[t5-lmsso17] [vnssi17] [encoding=t5] -% \definefontsynonym[t5-lmsso8] [vnssi8] [encoding=t5] -% \definefontsynonym[t5-lmsso9] [vnssi9] [encoding=t5] -% \definefontsynonym[t5-lmssq8] [vnssq8] [encoding=t5] -% \definefontsynonym[t5-lmssqbo8][vnssqbi8] [encoding=t5] -% \definefontsynonym[t5-lmssqbx8][vnssqb8] [encoding=t5] -% \definefontsynonym[t5-lmssqo8] [vnssqi8] [encoding=t5] -% \definefontsynonym[t5-lmtcsc10][vntcsc10] [encoding=t5] -% \definefontsynonym[t5-lmtt10] [vntt10] [encoding=t5] -% \definefontsynonym[t5-lmtt12] [vntt12] [encoding=t5] -% \definefontsynonym[t5-lmtt8] [vntt8] [encoding=t5] -% \definefontsynonym[t5-lmtt9] [vntt9] [encoding=t5] -% \definefontsynonym[t5-lmtti10] [vntti10] [encoding=t5] -% \definefontsynonym[t5-lmtto10] [vnsltt10] [encoding=t5] -% \definefontsynonym[t5-lmvtt10] [vnvtt10] [encoding=t5] -% \definefontsynonym[t5-lmvtto10][vnvtti10] [encoding=t5] -% -% \stoptypescript - -% \starttypescript [cmr] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [aer] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size,ec] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [csr] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size,il2] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [plr] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size,pl0] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [vnr] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size,t5] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [map] [il2,csr] -% \loadmapfile[original-public-csr.map] -% \stoptypescript - -% \starttypescript [map] [pl0,plr] -% \loadmapfile[original-public-plr.map] -% \stoptypescript - -% \starttypescript [map] [vnr] -% \loadmapfile[original-public-vnr.map] -% \stoptypescript - -% \starttypescript [map] [il2,csr] -% \loadmapfile[il2-public-lm.map] -% \stoptypescript - -% \starttypescript [map] [pl0,plr] -% \loadmapfile[pl0-public-lm.map] -% \stoptypescript - -% \starttypescript [map] [t5,vnr] -% \loadmapfile[t5-public-lm.map] -% \stoptypescript - -% support for alternative shapes has been removed from latin modern -% -% \starttypescript [map] [latin-modern-var] [ec,texnansi,qx,t5,pl0,il2] -% \loadmapfile[\typescriptthree-var-exclusive-public-lm.map] -% \stoptypescript - -% \starttypescript [map] [cmr] -% \loadmapfile[original-ams-cmr.map] -% \loadmapfile[original-ams-euler.map] -% \stoptypescript -% \starttypescript [map] [lm,lmr] -% \loadmapfile[original-public-lm.map] -% \stoptypescript - -% per 20050201 we moved to latin modern for plr/csr/vnr -% -% \starttypescript [map] [base] [all] -% \loadmapfile[original-public-plr.map] -% \loadmapfile[original-public-csr.map] -% \loadmapfile[original-public-vnr.map] -% \stoptypescript - -% \starttypescript [cmr] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [plr] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size,pl0] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [csr] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size,il2] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [aer] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size,ec] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [vnr] -% \usetypescript [serif,sans,mono,math] [computer-modern,latin-modern] [default,name,size,t5] -% \usemathcollection[default] -% \stoptypescript - -% \starttypescript [ant] -% \usetypescript [serif] [antykwa-torunska] [name,\defaultencoding] -% \usetypescript [serif] [default] [size] -% \usetypescript [all] [antykwa-torunska] [\defaultencoding] -% \stoptypescript - -% \starttypescript [ppl] -% \usetypescript [serif] [palatino] [name,\defaultencoding] -% \usetypescript [serif] [default] [size] -% \usetypescript [all] [palatino] [\defaultencoding] -% \stoptypescript - -% %D With thanks to Berthold Horn from YandY for providing me -% %D evaluation copies of the MathTimePlus fonts. -% -% \starttypescript [tim] -% \usetypescript [math] [times] [all] -% \usetypescript [math] [default] [size] -% \usemathcollection[tim] -% \usetypescript [all] [times] [\defaultencoding] -% \stoptypescript - -\endinput diff --git a/tex/context/base/type-omg.tex b/tex/context/base/type-omg.tex deleted file mode 100644 index 606b8449b..000000000 --- a/tex/context/base/type-omg.tex +++ /dev/null @@ -1,204 +0,0 @@ -%D \module -%D [ file=type-omg, -%D version=2002.05.15, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Basic \OMEGA\ Gamma Definitions, -%D author={Idris Samawi Hamid, Hans Hagen}, -%D date=\currentdate, -%D copyright={PRAGMA-ADE, Idris Samawi Hamid}] -% -%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 need to document this module a bit. See \type {m-gamma} -%D for more information. - -\definestyle [normalvariant] [\nv] [] % so we can get ucvtt (Unicode Variable Typewriter) - -%D omarab: - -\starttypescriptcollection[omega] - -\starttypescript [naskh] [omega] [name] - - \definefontsynonym [OmegaArabic] [omarab] - \definefontsynonym [OmegaArabic-Bold] [omarabb] - - \definefontsynonym [Naskh] [OmegaArabic] - \definefontsynonym [NaskhBold] [OmegaArabic-Bold] - -\stoptypescript - -\starttypescript [naskh] [omega] [size] - - \definebodyfont - [20.7pt,17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt] - [rm] - [tf=Naskh sa 1, - bf=NaskhBold sa 1, - it=Naskh sa 1, - sl=Naskh sa 1, - bi=NaskhBold sa 1, - bs=NaskhBold sa 1, - sc=Naskh sa 1] - -\usetypescript [math] [computer-modern] [size] - -\stoptypescript - -\starttypescript [OmegaArab] - - \definebodyfontenvironment - [omarb] - [default] - [interlinespace=3ex] - - \definetypeface [omarb] [rm] [naskh] [omega] [omega] - -\stoptypescript - -%D omlgc: - -\starttypescript [serif] [omega] [name] - - \definefontsynonym [OmegaSerif] [omlgc] - \definefontsynonym [OmegaSerif-Bold] [omlgcb] - \definefontsynonym [OmegaSerif-Italic] [omlgci] - \definefontsynonym [OmegaSerif-Slanted] [omlgci] - \definefontsynonym [OmegaSerif-BoldItalic] [omlgcbi] - \definefontsynonym [OmegaSerif-BoldSlanted][omlgcbi] - \definefontsynonym [OmegaSerif-Caps] [omlgc] - - \definefontsynonym [Serif] [OmegaSerif] - \definefontsynonym [SerifBold] [OmegaSerif-Bold] - \definefontsynonym [SerifItalic] [OmegaSerif-Italic] - \definefontsynonym [SerifSlanted] [OmegaSerif-Slanted] - \definefontsynonym [SerifBoldItalic] [OmegaSerif-BoldItalic] - \definefontsynonym [SerifBoldSlanted] [OmegaSerif-BoldSlanted] - \definefontsynonym [SerifCaps] [OmegaSerif-Caps] - -\stoptypescript - -\starttypescript [mono] [omega] [name] - - \definefontsynonym [OmegaMono] [uctt10] - \definefontsynonym [OmegaMono-Italic] [ucitt10] - \definefontsynonym [OmegaMono-Slanted] [ucsltt10] - \definefontsynonym [OmegaMono-Bold] [uctt10] - \definefontsynonym [OmegaMono-BoldItalic] [ucitt10] - \definefontsynonym [OmegaMono-BoldSlanted] [ucsltt10] - \definefontsynonym [OmegaMono-Caps] [uctt10] - \definefontsynonym [OmegaMono-Variable] [ucvtt10] - - \definefontsynonym [Mono] [OmegaMono] - \definefontsynonym [MonoBold] [OmegaMono-Bold] - \definefontsynonym [MonoItalic] [OmegaMono-Italic] - \definefontsynonym [MonoSlanted] [OmegaMono-Slanted] - \definefontsynonym [MonoBoldItalic] [OmegaMono-BoldItalic] - \definefontsynonym [MonoBoldSlanted] [OmegaMono-BoldSlanted] - \definefontsynonym [MonoCaps] [OmegaMono-Caps] - \definefontsynonym [MonoVariable] [OmegaMono-Variable] - -\stoptypescript - -\starttypescript [serif] [omega] [size] - - \definebodyfont - [20.7pt,17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] - [rm] - [tf=Serif sa 1, - bf=SerifBold sa 1, - it=SerifItalic sa 1, - sl=SerifSlanted sa 1, - bi=SerifBoldItalic sa 1, - bs=SerifBoldSlanted sa 1, - sc=SerifCaps sa 1] - -\usetypescript [math,sans] [computer-modern] [size] - -\stoptypescript - -%D In order to get default Unicode Variable Typewriter, -%D uncomment the first \type {\definebodyfont} and then -%D comment the rest of this typescript. - -\starttypescript [mono] [omega] [size] - -% \definebodyfont -% [20.7pt,17.3pt,14.4pt,12pt,11pt,10pt,9pt,8pt,7pt,6pt,5pt,4pt] -% [rm] -% [tf=MonoVariable sa 1, -% bf=MonoBold sa 1 -% it=MonoItalic sa 1, -% sl=MonoSlanted sa 1, -% bi=MonoBoldItali sa 1, -% bs=MonoBoldSlanted sa 1, -% sc=MonoCaps sa 1] - - \definebodyfont - [20.7pt,17.3pt,14.4pt,12pt,11pt] - [tt] - [tf=uctt12 sa 1, - bf=uctt12 sa 1, - it=ucitt10 sa 1, - sl=ucsltt10 sa 1, - bi=ucitt10 sa 1, - bs=ucsltt10 sa 1, - sc=uctt10 sa 1, - nv=ucvtt10 sa 1] - - \definebodyfont - [10pt] - [tt] - [tf=uctt10 at 10pt, - bf=uctt10 at 10pt, - it=ucitt10 at 10pt, - sl=ucsltt10 at 10pt, - bi=ucitt10 at 10pt, - bs=ucsltt10 at 10pt, - sc=uctt10 at 10pt, - nv=ucvtt10 at 10pt] - - \definebodyfont - [9pt] - [tt] - [tf=uctt9 at 9pt, - bf=uctt9 at 9pt, - it=ucitt10 at 9pt, - sl=ucsltt10 at 9pt, - bi=ucitt10 at 9pt, - bs=ucsltt10 at 9pt, - sc=uctt10 at 9pt, - nv=ucvtt10 at 9pt] - - \definebodyfont - [8pt,7pt,6pt,5pt,4pt] - [tt] - [tf=uctt8 sa 1, - bf=uctt8 sa 1, - it=ucitt10 sa 1, - sl=ucsltt10 sa 1, - bi=ucitt10 sa 1, - bs=ucsltt10 sa 1, - sc=uctt10 sa 1, - nv=ucvtt10 sa 1] - -\stoptypescript - -\starttypescript [OmegaLGC] - - \definebodyfontenvironment - [omlgc] - [default] - [interlinespace=2.8ex] - - \definetypeface [omlgc] [rm] [serif] [omega] [omega] - \definetypeface [omlgc] [tt] [mono] [omega] [omega] - -\stoptypescript - -\stoptypescriptcollection - -\endinput diff --git a/tex/context/base/type-one.mkii b/tex/context/base/type-one.mkii new file mode 100644 index 000000000..b456d7e64 --- /dev/null +++ b/tex/context/base/type-one.mkii @@ -0,0 +1,1185 @@ +%D \module +%D [ file=type-one, +%D version=2007.07.30, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Type One Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 merges the traditional enc, syn and map files into one. If +%D you think that it looks messy you're right. It shows some history of +%D \TEX\ fonts and the development towards latin modern. + +% texfont --ven=public --col=antt --enc=ec --sou=auto +% texfont --ven=public --col=antp --enc=ec --sou=auto +% texfont --ven=urw --col=palatino --enc=ec --sou=auto +% texfont --ven-lucas --col=sun --enc=ec --sou=. + +% \usetypescript [all] [modern] [texnansi] +% \setupbodyfont[reset] \setupbodyfont[cmr] +% \starttext \showfont[Serif] \stoptext + +\starttypescriptcollection[examples] + +\starttypescript [fallback] [texnansi,ec,qx,t5,default] + \definetypeface [] [rm] [serif] [modern] [computer-modern] [encoding=\typescripttwo] + \definetypeface [] [ss] [sans] [modern] [computer-modern] [encoding=\typescripttwo] + \definetypeface [] [tt] [mono] [modern] [computer-modern] [encoding=\typescripttwo] + \definetypeface [] [mm] [math] [modern] [computer-modern] [encoding=\typescripttwo] + \quittypescriptscanning +\stoptypescript + +\starttypescript [modern] [texnansi,ec,qx,t5,default] + \definetypeface [modern] [rm] [serif] [modern] [computer-modern] [encoding=\typescripttwo] + \definetypeface [modern] [ss] [sans] [modern] [computer-modern] [encoding=\typescripttwo] + \definetypeface [modern] [tt] [mono] [modern] [computer-modern] [encoding=\typescripttwo] + \definetypeface [modern] [mm] [math] [modern] [computer-modern] [encoding=\typescripttwo] + \quittypescriptscanning +\stoptypescript + +\starttypescript [modern-base] [texnansi,ec,qx,t5,default] + \definetypeface [modern] [rm] [serif] [modern] [default] [encoding=\typescripttwo] + \definetypeface [modern] [ss] [sans] [modern] [default] [encoding=\typescripttwo] + \definetypeface [modern] [tt] [mono] [modern] [default] [encoding=\typescripttwo] + \definetypeface [modern] [mm] [math] [modern] [default] [encoding=\typescripttwo] + \quittypescriptscanning +\stoptypescript + +\starttypescript [modern-base] [t2a,t2b,t2c,x2] + \definetypeface [modern] [rm] [serif] [computer-modern] [default] [encoding=\typescripttwo] + \definetypeface [modern] [ss] [sans] [computer-modern] [default] [encoding=\typescripttwo] + \definetypeface [modern] [tt] [mono] [computer-modern] [default] [encoding=\typescripttwo] + \definetypeface [modern] [mm] [math] [computer-modern] [default] [encoding=\typescripttwo] + \quittypescriptscanning +\stoptypescript + +\starttypescript [postscript] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definetypeface [postscript] [rm] [serif] [times] [default] [encoding=\typescripttwo] + \definetypeface [postscript] [ss] [sans] [helvetica] [default] [encoding=\typescripttwo,rscale=0.9] + \definetypeface [postscript] [tt] [mono] [courier] [default] [encoding=\typescripttwo,rscale=1.1] + \definetypeface [postscript] [mm] [math] [times] [default] [encoding=\typescripttwo] + \quittypescriptscanning +\stoptypescript + +\starttypescript [times,termes] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [ss] [sans] [helvetica] [default] [encoding=\typescripttwo,rscale=0.9] + \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.05] + \definetypeface [\typescriptone] [mm] [math] [times] [default] [encoding=\typescripttwo] + \quittypescriptscanning +\stoptypescript + +\starttypescript [palatino,pagella] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo,rscale=1.075] + \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.075] + \definetypeface [\typescriptone] [mm] [math] [palatino] [default] [encoding=default] + \quittypescriptscanning +\stoptypescript + +\starttypescript [fourier] [ec] + \definetypeface [fourier] [rm] [serif] [fourier] [default] [encoding=ec] + \definetypeface [fourier] [ss] [sans] [modern] [default] [encoding=ec,rscale=1.07] + \definetypeface [fourier] [tt] [mono] [modern] [default] [encoding=ec,rscale=1.07] + \definetypeface [fourier] [mm] [math] [fourier] [default] [encoding=default] + \quittypescriptscanning +\stoptypescript + +% handy + +\starttypescript [serif] [simple] [name] % bad, will be changed but in sycn with manuals that use it + \definefontsynonym [Simple] [cmvtt10] + \setupfontsynonym [Simple] [handling=pure] +\stoptypescript + +\starttypescript [modernvariable] [texnansi,ec,qx,8r,t5] + \definetypeface [modernvariable] [rm] [serif] [simple] [default] [encoding=\typescripttwo] + \definetypeface [modernvariable] [ss] [sans] [modern] [default] [encoding=\typescripttwo] + \definetypeface [modernvariable] [tt] [mono] [modern] [default] [encoding=\typescripttwo] + \definetypeface [modernvariable] [mm] [math] [modern] [default] + \quittypescriptscanning +\stoptypescript + +\starttypescript [optima] [texnansi,ec,qx] + \definetypeface[optima][ss][sans] [optima-nova][default][encoding=\typescripttwo] + \definetypeface[optima][rm][serif][palatino] [default][encoding=\typescripttwo] + \definetypeface[optima][tt][mono] [modern] [default][encoding=\typescripttwo,rscale=1.1] + \definetypeface[optima][mm][math] [palatino] [default][encoding=\typescripttwo] + \quittypescriptscanning +\stoptypescript + +\starttypescript [antykwa-torunska] [texnansi,ec,8r,uc,t5,t2a] + \definetypeface[antykwa][rm][serif][antykwa-torunska] [default][encoding=\typescripttwo] + \definetypeface[antykwa][ss][sans] [modern] [default][encoding=\typescripttwo,rscale=1.05] + \definetypeface[antykwa][tt][mono] [modern] [default][encoding=\typescripttwo,rscale=1.1] + \definetypeface[antykwa][mm][math] [antykwa-torunska] [default][encoding=\typescripttwo] + \quittypescriptscanning +\stoptypescript + +\starttypescript [schoolbook,schola] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] + \quittypescriptscanning +\stoptypescript + +\starttypescript [bookman,bonum] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] + \quittypescriptscanning +\stoptypescript + +\starttypescript [chancery,chorus] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] + \quittypescriptscanning +\stoptypescript + +\starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium] [texnansi,ec,8r,uc,t2a] + \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default][encoding=\typescripttwo] + \definetypeface[\typescriptone][rm][serif][modern] [default][encoding=\typescripttwo] + \definetypeface[\typescriptone][tt][mono] [modern] [default][encoding=\typescripttwo] + \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][encoding=\typescripttwo,text=ss] + \quittypescriptscanning +\stoptypescript + +\starttypescript [helvetica,heros] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [encoding=\typescripttwo,rscale=1.15] + \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.15] + \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default,rscale=1.15] + \quittypescriptscanning +\stoptypescript + +\starttypescript [avantgarde,adventor] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definetypeface [\typescriptone] [ss] [sans] [adventor] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [encoding=\typescripttwo,rscale=1.15] + \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.15] + \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] + \quittypescriptscanning +\stoptypescript + +\starttypescript [courier,cursor] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo] + \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] + \quittypescriptscanning +\stoptypescript + +\stoptypescriptcollection + +\starttypescriptcollection[typeone] + +\starttypescript [map] [all] + \loadmapfile[original-base.map] + \loadmapfile[original-ams-base.map] +\stoptypescript + +\starttypescript[all][modern,latin-modern][all] + % fallbacks, no math in latin modern + \definefontsynonym[lmdunh10][cmdunh10] + \definefontsynonym[lmff10] [cmff10] + \definefontsynonym[lmfi10] [cmfi10] + \definefontsynonym[lmfib8] [cmfib8] + \definefontsynonym[lmtex10] [cmtex10] + \definefontsynonym[lmtex8] [cmtex8] + \definefontsynonym[lmtex9] [cmtex9] + \loadmapfile[original-public-lm.map] +\stoptypescript + +\starttypescript [serif] [modern,latin-modern] [texnansi,ec,qx,t5] + \definefontsynonym [LMRoman5-Regular] [\typescriptthree-lmr5] [encoding=\typescriptthree] + \definefontsynonym [LMRoman6-Regular] [\typescriptthree-lmr6] [encoding=\typescriptthree] + \definefontsynonym [LMRoman7-Regular] [\typescriptthree-lmr7] [encoding=\typescriptthree] + \definefontsynonym [LMRoman8-Regular] [\typescriptthree-lmr8] [encoding=\typescriptthree] + \definefontsynonym [LMRoman9-Regular] [\typescriptthree-lmr9] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-Regular] [\typescriptthree-lmr10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman12-Regular] [\typescriptthree-lmr12] [encoding=\typescriptthree] + \definefontsynonym [LMRoman17-Regular] [\typescriptthree-lmr17] [encoding=\typescriptthree] + \definefontsynonym [LMRoman5-Bold] [\typescriptthree-lmbx5] [encoding=\typescriptthree] + \definefontsynonym [LMRoman6-Bold] [\typescriptthree-lmbx6] [encoding=\typescriptthree] + \definefontsynonym [LMRoman7-Bold] [\typescriptthree-lmbx7] [encoding=\typescriptthree] + \definefontsynonym [LMRoman8-Bold] [\typescriptthree-lmbx8] [encoding=\typescriptthree] + \definefontsynonym [LMRoman9-Bold] [\typescriptthree-lmbx9] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-Bold] [\typescriptthree-lmbx10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman12-Bold] [\typescriptthree-lmbx12] [encoding=\typescriptthree] + \definefontsynonym [LMRoman7-Italic] [\typescriptthree-lmri7] [encoding=\typescriptthree] + \definefontsynonym [LMRoman8-Italic] [\typescriptthree-lmri8] [encoding=\typescriptthree] + \definefontsynonym [LMRoman9-Italic] [\typescriptthree-lmri9] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-Italic] [\typescriptthree-lmri10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman12-Italic] [\typescriptthree-lmri12] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-BoldItalic] [\typescriptthree-lmbxi10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman8-Oblique] [\typescriptthree-lmro8] [encoding=\typescriptthree] + \definefontsynonym [LMRoman9-Oblique] [\typescriptthree-lmro9] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-Oblique] [\typescriptthree-lmro10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman12-Oblique] [\typescriptthree-lmro12] [encoding=\typescriptthree] + \definefontsynonym [LMRoman17-Oblique] [\typescriptthree-lmro17] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-BoldOblique] [\typescriptthree-lmbxo10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-Demi] [\typescriptthree-lmb10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-DemiOblique] [\typescriptthree-lmbo10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-CapsRegular] [\typescriptthree-lmcsc10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-CapsOblique] [\typescriptthree-lmcsco10] [encoding=\typescriptthree] + + \definefontsynonym [LMRoman10-Dunhill] [\typescriptthree-lmdunh10] [encoding=\typescriptthree] + \definefontsynonym [LMRoman10-DunhillOblique] [\typescriptthree-lmduno10] [encoding=\typescriptthree] + \loadmapfile[lm-\typescriptthree.map] +\stoptypescript + +\starttypescript [sans] [modern,latin-modern] [texnansi,ec,qx,t5] + \definefontsynonym [LMSans8-Regular] [\typescriptthree-lmss8] [encoding=\typescriptthree] + \definefontsynonym [LMSans9-Regular] [\typescriptthree-lmss9] [encoding=\typescriptthree] + \definefontsynonym [LMSans10-Regular] [\typescriptthree-lmss10] [encoding=\typescriptthree] + \definefontsynonym [LMSans12-Regular] [\typescriptthree-lmss12] [encoding=\typescriptthree] + \definefontsynonym [LMSans17-Regular] [\typescriptthree-lmss17] [encoding=\typescriptthree] + \definefontsynonym [LMSans10-Bold] [\typescriptthree-lmssbx10] [encoding=\typescriptthree] + \definefontsynonym [LMSans8-Oblique] [\typescriptthree-lmsso8] [encoding=\typescriptthree] + \definefontsynonym [LMSans9-Oblique] [\typescriptthree-lmsso9] [encoding=\typescriptthree] + \definefontsynonym [LMSans10-Oblique] [\typescriptthree-lmsso10] [encoding=\typescriptthree] + \definefontsynonym [LMSans12-Oblique] [\typescriptthree-lmsso12] [encoding=\typescriptthree] + \definefontsynonym [LMSans17-Oblique] [\typescriptthree-lmsso17] [encoding=\typescriptthree] + \definefontsynonym [LMSans10-BoldOblique] [\typescriptthree-lmssbo10] [encoding=\typescriptthree] + \definefontsynonym [LMSans10-DemiCondensed] [\typescriptthree-lmssdc10] [encoding=\typescriptthree] + \definefontsynonym [LMSans10-DemiCondensedOblique] [\typescriptthree-lmssdo10] [encoding=\typescriptthree] + \definefontsynonym [LMSansQuotation8-Regular] [\typescriptthree-lmssq8] [encoding=\typescriptthree] + \definefontsynonym [LMSansQuotation8-Bold] [\typescriptthree-lmssqbx8] [encoding=\typescriptthree] + \definefontsynonym [LMSansQuotation8-Oblique] [\typescriptthree-lmssqo8] [encoding=\typescriptthree] + \definefontsynonym [LMSansQuotation8-BoldOblique] [\typescriptthree-lmssqbo8] [encoding=\typescriptthree] + \loadmapfile[lm-\typescriptthree.map] +\stoptypescript + +\starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond] [texnansi,ec,qx,t5] + \definefontsynonym [LMTypewriter8-Regular] [\typescriptthree-lmtt8] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter9-Regular] [\typescriptthree-lmtt9] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-Regular] [\typescriptthree-lmtt10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter12-Regular] [\typescriptthree-lmtt12] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-Italic] [\typescriptthree-lmtti10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-Oblique] [\typescriptthree-lmtto10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-CapsRegular] [\typescriptthree-lmtcsc10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-CapsOblique] [\typescriptthree-lmtcso10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-Light] [\typescriptthree-lmtl10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-LightOblique] [\typescriptthree-lmtlo10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-LightCondensed] [\typescriptthree-lmtlc10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-LightCondensedOblique] [\typescriptthree-lmtlco10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-Dark] [\typescriptthree-lmtk10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-DarkOblique] [\typescriptthree-lmtko10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriter10-Unslanted] [\typescriptthree-lmu10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriterVarWd10-Regular] [\typescriptthree-lmvtt10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriterVarWd10-Oblique] [\typescriptthree-lmvtto10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriterVarWd10-Light] [\typescriptthree-lmvtl10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriterVarWd10-LightOblique] [\typescriptthree-lmvtlo10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriterVarWd10-Dark] [\typescriptthree-lmvtk10] [encoding=\typescriptthree] + \definefontsynonym [LMTypewriterVarWd10-DarkOblique] [\typescriptthree-lmvtko10] [encoding=\typescriptthree] + \loadmapfile[lm-\typescriptthree.map] +\stoptypescript + +\starttypescript [math] [modern,latin-modern] + \definefontsynonym [LMMathRoman5-Regular] [rm-lmr5] + \definefontsynonym [LMMathRoman6-Regular] [rm-lmr6] + \definefontsynonym [LMMathRoman7-Regular] [rm-lmr7] + \definefontsynonym [LMMathRoman8-Regular] [rm-lmr8] + \definefontsynonym [LMMathRoman9-Regular] [rm-lmr9] + \definefontsynonym [LMMathRoman10-Regular] [rm-lmr10] + \definefontsynonym [LMMathRoman12-Regular] [rm-lmr12] + \definefontsynonym [LMMathRoman17-Regular] [rm-lmr17] + \definefontsynonym [LMMathRoman5-Bold] [rm-lmbx5] + \definefontsynonym [LMMathRoman6-Bold] [rm-lmbx6] + \definefontsynonym [LMMathRoman7-Bold] [rm-lmbx7] + \definefontsynonym [LMMathRoman8-Bold] [rm-lmbx8] + \definefontsynonym [LMMathRoman9-Bold] [rm-lmbx9] + \definefontsynonym [LMMathRoman10-Bold] [rm-lmbx10] + \definefontsynonym [LMMathRoman12-Bold] [rm-lmbx12] + \definefontsynonym [LMMathSymbols5-BoldItalic] [lmbsy5] + \definefontsynonym [LMMathSymbols7-BoldItalic] [lmbsy7] + \definefontsynonym [LMMathSymbols10-BoldItalic][lmbsy10] + \definefontsynonym [LMMathSymbols5-Italic] [lmsy5] + \definefontsynonym [LMMathSymbols6-Italic] [lmsy6] + \definefontsynonym [LMMathSymbols7-Italic] [lmsy7] + \definefontsynonym [LMMathSymbols8-Italic] [lmsy8] + \definefontsynonym [LMMathSymbols9-Italic] [lmsy9] + \definefontsynonym [LMMathSymbols10-Italic] [lmsy10] + \definefontsynonym [LMMathExtension10-Regular] [lmex10] + \definefontsynonym [LMMathItalic5-Italic] [lmmi5] + \definefontsynonym [LMMathItalic6-Italic] [lmmi6] + \definefontsynonym [LMMathItalic7-Italic] [lmmi7] + \definefontsynonym [LMMathItalic8-Italic] [lmmi8] + \definefontsynonym [LMMathItalic9-Italic] [lmmi9] + \definefontsynonym [LMMathItalic10-Italic] [lmmi10] + \definefontsynonym [LMMathItalic12-Italic] [lmmi12] + \definefontsynonym [LMMathItalic5-BoldItalic] [lmmib5] + \definefontsynonym [LMMathItalic7-BoldItalic] [lmmib7] + \definefontsynonym [LMMathItalic10-BoldItalic] [lmmib10] + \usemathcollection[default] + \loadmapfile[lm-math.map] + \loadmapfile[lm-rm.map] +\stoptypescript + +%D {\em Comments by Victor Figurnov:} the wcmb10, wcmbx10, +%D \unknown\ fonts below are taken from the Paradissa +%D collection by Basil Malyshev. These fonts don't conform t2a +%D encoding but are in MS Windows Cyrillic codepage 1251 +%D encoding. These fonts contain only 33 russian letters in +%D upper and lower case, the number sign, and guillemots. But +%D even among these characters only the basic 32 russian +%D letters (in upper and lower case) will be typeset correctly +%D with this definition. The letters cyrillicYO and +%D cyrillicyo, as well as number sign (textnumero) and +%D guillemots won't be typeset properly, because these symbols +%D have different positions in t2a and MS CP1251 encodings. +%D +%D I think that the russian lh fonts and|/|or cm-super provide +%D better alternatives (type1). Therefore, the names below +%D match those of cm-super (\type {0NNN} instead of \type +%D {NNN}, i.e.\ four digit numbers). + +\starttypescript [serif] [computer-modern] [cyr] + \definefontsynonym [cmb10] [wcmb10] [encoding=t2a] + \definefontsynonym [cmbsy10] [wcmbsy10] [encoding=t2a] + \definefontsynonym [cmbx10] [wcmbx10] [encoding=t2a] + \definefontsynonym [cmbx12] [wcmbx12] [encoding=t2a] + \definefontsynonym [cmbx5] [wcmbx5] [encoding=t2a] + \definefontsynonym [cmbx6] [wcmbx6] [encoding=t2a] + \definefontsynonym [cmbx7] [wcmbx7] [encoding=t2a] + \definefontsynonym [cmbx8] [wcmbx8] [encoding=t2a] + \definefontsynonym [cmbx9] [wcmbx9] [encoding=t2a] + \definefontsynonym [cmbxsl10] [wcmbxsl10] [encoding=t2a] + \definefontsynonym [cmbxti10] [wcmbxti10] [encoding=t2a] + \definefontsynonym [cmcsc10] [wcmcsc10] [encoding=t2a] + %definefontsynonym [cmdunh10] [wcmdunh10] [encoding=t2a] + \definefontsynonym [cminch] [wcminch] [encoding=t2a] + \definefontsynonym [cmr10] [wcmr10] [encoding=t2a] + \definefontsynonym [cmr12] [wcmr12] [encoding=t2a] + \definefontsynonym [cmr17] [wcmr17] [encoding=t2a] + \definefontsynonym [cmr5] [wcmr5] [encoding=t2a] + \definefontsynonym [cmr6] [wcmr6] [encoding=t2a] + \definefontsynonym [cmr7] [wcmr7] [encoding=t2a] + \definefontsynonym [cmr8] [wcmr8] [encoding=t2a] + \definefontsynonym [cmr9] [wcmr9] [encoding=t2a] + \definefontsynonym [cmsl10] [wcmsl10] [encoding=t2a] + \definefontsynonym [cmsl12] [wcmsl12] [encoding=t2a] + \definefontsynonym [cmsl8] [wcmsl8] [encoding=t2a] + \definefontsynonym [cmsl9] [wcmsl9] [encoding=t2a] + \definefontsynonym [cmti10] [wcmti10] [encoding=t2a] + \definefontsynonym [cmti12] [wcmti12] [encoding=t2a] + \definefontsynonym [cmti7] [wcmti7] [encoding=t2a] + \definefontsynonym [cmti8] [wcmti8] [encoding=t2a] + \definefontsynonym [cmti9] [wcmti9] [encoding=t2a] + \definefontsynonym [cmu10] [wcmu10] [encoding=t2a] +\stoptypescript + +\starttypescript [sans] [computer-modern] [cyr] + \definefontsynonym [cmss10] [wcmss10] [encoding=t2a] + \definefontsynonym [cmss12] [wcmss12] [encoding=t2a] + \definefontsynonym [cmss17] [wcmss17] [encoding=t2a] + \definefontsynonym [cmss8] [wcmss8] [encoding=t2a] + \definefontsynonym [cmss9] [wcmss9] [encoding=t2a] + %definefontsynonym [cmssbi10] [wcmssbi10] [encoding=t2a] + \definefontsynonym [cmssbx10] [wcmssbx10] [encoding=t2a] + \definefontsynonym [cmssdc10] [wcmssdc10] [encoding=t2a] + \definefontsynonym [cmssi10] [wcmssi10] [encoding=t2a] + \definefontsynonym [cmssi12] [wcmssi12] [encoding=t2a] + \definefontsynonym [cmssi17] [wcmssi17] [encoding=t2a] + \definefontsynonym [cmssi8] [wcmssi8] [encoding=t2a] + \definefontsynonym [cmssi9] [wcmssi9] [encoding=t2a] + \definefontsynonym [cmssq8] [wcmssq8] [encoding=t2a] + \definefontsynonym [cmssqi8] [wcmssqi8] [encoding=t2a] +\stoptypescript + +\starttypescript [mono] [computer-modern] [cyr] + \definefontsynonym [cmitt10] [wcmitt10] [encoding=t2a] + \definefontsynonym [cmsltt10] [wcmsltt10] [encoding=t2a] + \definefontsynonym [cmtt10] [wcmtt10] [encoding=t2a] + \definefontsynonym [cmtt12] [wcmtt12] [encoding=t2a] + \definefontsynonym [cmtt8] [wcmtt8] [encoding=t2a] + \definefontsynonym [cmtt9] [wcmtt9] [encoding=t2a] + %definefontsynonym [cmvtt10] [wcmvtt10] [encoding=t2a] +\stoptypescript + +\definetypescriptprefix [c:t2a] [la] +\definetypescriptprefix [c:t2b] [lb] +\definetypescriptprefix [c:t2c] [lc] +\definetypescriptprefix [c:x2] [rx] + +\starttypescript [all] [computer-modern] [t2a,t2b,t2c,x2] + \loadmapfile[subset-cmsuper-\typescriptthree.map] + \loadmapfile[subset-cmsuper-\typescriptthree.map] + \loadmapfile[cm-super-\typescriptthree.map] +\stoptypescript + +\starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2] + \definefontsynonym [cmb10] [\typescriptprefix{c:\typescriptthree}rb1000] [encoding=\typescriptthree] + \definefontsynonym [cmbx10] [\typescriptprefix{c:\typescriptthree}bx1000] [encoding=\typescriptthree] + \definefontsynonym [cmbx12] [\typescriptprefix{c:\typescriptthree}bx1200] [encoding=\typescriptthree] + \definefontsynonym [cmbx5] [\typescriptprefix{c:\typescriptthree}bx0500] [encoding=\typescriptthree] + \definefontsynonym [cmbx6] [\typescriptprefix{c:\typescriptthree}bx0600] [encoding=\typescriptthree] + \definefontsynonym [cmbx7] [\typescriptprefix{c:\typescriptthree}bx0700] [encoding=\typescriptthree] + \definefontsynonym [cmbx8] [\typescriptprefix{c:\typescriptthree}bx0800] [encoding=\typescriptthree] + \definefontsynonym [cmbx9] [\typescriptprefix{c:\typescriptthree}bx0900] [encoding=\typescriptthree] + \definefontsynonym [cmbxsl10] [\typescriptprefix{c:\typescriptthree}bl1000] [encoding=\typescriptthree] + \definefontsynonym [cmbxti10] [\typescriptprefix{c:\typescriptthree}bi1000] [encoding=\typescriptthree] + \definefontsynonym [cmcsc10] [\typescriptprefix{c:\typescriptthree}cc1000] [encoding=\typescriptthree] + \definefontsynonym [cmdunh10] [\typescriptprefix{c:\typescriptthree}dh1000] [encoding=\typescriptthree] + \definefontsynonym [cmff10] [\typescriptprefix{c:\typescriptthree}ff1000] [encoding=\typescriptthree] + \definefontsynonym [cmfi10] [\typescriptprefix{c:\typescriptthree}fi1000] [encoding=\typescriptthree] + \definefontsynonym [cmfib8] [\typescriptprefix{c:\typescriptthree}fb0800] [encoding=\typescriptthree] + %\definefontsynonym [cminch] [\typescriptprefix{c:\typescriptthree}inch00] [encoding=\typescriptthree] + \definefontsynonym [cmr10] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree] + \definefontsynonym [cmr12] [\typescriptprefix{c:\typescriptthree}rm1200] [encoding=\typescriptthree] + \definefontsynonym [cmr17] [\typescriptprefix{c:\typescriptthree}rm1700] [encoding=\typescriptthree] + \definefontsynonym [cmr5] [\typescriptprefix{c:\typescriptthree}rm0500] [encoding=\typescriptthree] + \definefontsynonym [cmr6] [\typescriptprefix{c:\typescriptthree}rm0600] [encoding=\typescriptthree] + \definefontsynonym [cmr7] [\typescriptprefix{c:\typescriptthree}rm0700] [encoding=\typescriptthree] + \definefontsynonym [cmr8] [\typescriptprefix{c:\typescriptthree}rm0800] [encoding=\typescriptthree] + \definefontsynonym [cmr9] [\typescriptprefix{c:\typescriptthree}rm0900] [encoding=\typescriptthree] + \definefontsynonym [cmsl10] [\typescriptprefix{c:\typescriptthree}sl1000] [encoding=\typescriptthree] + \definefontsynonym [cmsl12] [\typescriptprefix{c:\typescriptthree}sl1200] [encoding=\typescriptthree] + \definefontsynonym [cmsl8] [\typescriptprefix{c:\typescriptthree}sl0800] [encoding=\typescriptthree] + \definefontsynonym [cmsl9] [\typescriptprefix{c:\typescriptthree}sl0900] [encoding=\typescriptthree] + \definefontsynonym [cmtcsc10] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree] + \definefontsynonym [cmti10] [\typescriptprefix{c:\typescriptthree}ti1000] [encoding=\typescriptthree] + \definefontsynonym [cmti12] [\typescriptprefix{c:\typescriptthree}ti1200] [encoding=\typescriptthree] + \definefontsynonym [cmti7] [\typescriptprefix{c:\typescriptthree}ti0700] [encoding=\typescriptthree] + \definefontsynonym [cmti8] [\typescriptprefix{c:\typescriptthree}ti0800] [encoding=\typescriptthree] + \definefontsynonym [cmti9] [\typescriptprefix{c:\typescriptthree}ti0900] [encoding=\typescriptthree] + \definefontsynonym [cmu10] [\typescriptprefix{c:\typescriptthree}ui1000] [encoding=\typescriptthree] +\stoptypescript + +\starttypescript [sans] [computer-modern] [t2a,t2b,t2c,x2] + \definefontsynonym [cmss10] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree] + \definefontsynonym [cmss12] [\typescriptprefix{c:\typescriptthree}ss1200] [encoding=\typescriptthree] + \definefontsynonym [cmss17] [\typescriptprefix{c:\typescriptthree}ss1700] [encoding=\typescriptthree] + \definefontsynonym [cmss8] [\typescriptprefix{c:\typescriptthree}ss0800] [encoding=\typescriptthree] + \definefontsynonym [cmss9] [\typescriptprefix{c:\typescriptthree}ss0900] [encoding=\typescriptthree] + \definefontsynonym [cmssbx10] [\typescriptprefix{c:\typescriptthree}sx1000] [encoding=\typescriptthree] + %\definefontsynonym [cmssdc10] [\typescriptprefix{c:\typescriptthree}ssdc1000] [encoding=\typescriptthree] + \definefontsynonym [cmssi10] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] + \definefontsynonym [cmssi12] [\typescriptprefix{c:\typescriptthree}si1200] [encoding=\typescriptthree] + \definefontsynonym [cmssi17] [\typescriptprefix{c:\typescriptthree}si1700] [encoding=\typescriptthree] + \definefontsynonym [cmssi8] [\typescriptprefix{c:\typescriptthree}si0800] [encoding=\typescriptthree] + \definefontsynonym [cmssi9] [\typescriptprefix{c:\typescriptthree}si0900] [encoding=\typescriptthree] + \definefontsynonym [cmssq8] [\typescriptprefix{c:\typescriptthree}ss0800] [encoding=\typescriptthree] + \definefontsynonym [cmssqi8] [\typescriptprefix{c:\typescriptthree}si0800] [encoding=\typescriptthree] +\stoptypescript + +\starttypescript [mono] [computer-modern] [t2a,t2b,t2c,x2] + \definefontsynonym [cmitt10] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree] + \definefontsynonym [cmsltt10] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree] + \definefontsynonym [cmtt10] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree] + \definefontsynonym [cmtt12] [\typescriptprefix{c:\typescriptthree}tt1200] [encoding=\typescriptthree] + \definefontsynonym [cmtt8] [\typescriptprefix{c:\typescriptthree}tt0800] [encoding=\typescriptthree] + \definefontsynonym [cmtt9] [\typescriptprefix{c:\typescriptthree}tt0900] [encoding=\typescriptthree] + \definefontsynonym [cmvtt10] [\typescriptprefix{c:\typescriptthree}vt1000] [encoding=\typescriptthree] +\stoptypescript + +\starttypescript [serif] [computer-modern] [lcy] + \definefontsynonym [cmb10] [lhb10] [encoding=lcy] + \definefontsynonym [cmbx10] [lhbx10] [encoding=lcy] + \definefontsynonym [cmbx12] [lhbx12] [encoding=lcy] + \definefontsynonym [cmbx5] [lhbx5] [encoding=lcy] + \definefontsynonym [cmbx6] [lhbx6] [encoding=lcy] + \definefontsynonym [cmbx7] [lhbx7] [encoding=lcy] + \definefontsynonym [cmbx8] [lhbx8] [encoding=lcy] + \definefontsynonym [cmbx9] [lhbx9] [encoding=lcy] + \definefontsynonym [cmbxsl10] [lhbxsl10] [encoding=lcy] + \definefontsynonym [cmbxti10] [lhbxti10] [encoding=lcy] + \definefontsynonym [cmcsc10] [lhcsc10] [encoding=lcy] + \definefontsynonym [cmdunh10] [lhdunh10] [encoding=lcy] + \definefontsynonym [cmff10] [lhff10] [encoding=lcy] + \definefontsynonym [cmfi10] [lhfi10] [encoding=lcy] + \definefontsynonym [cmfib8] [lhfib8] [encoding=lcy] + \definefontsynonym [cminch] [lhinch] [encoding=lcy] + \definefontsynonym [cmr10] [lhr10] [encoding=lcy] + \definefontsynonym [cmr12] [lhr12] [encoding=lcy] + \definefontsynonym [cmr17] [lhr17] [encoding=lcy] + \definefontsynonym [cmr5] [lhr5] [encoding=lcy] + \definefontsynonym [cmr6] [lhr6] [encoding=lcy] + \definefontsynonym [cmr7] [lhr7] [encoding=lcy] + \definefontsynonym [cmr8] [lhr8] [encoding=lcy] + \definefontsynonym [cmr9] [lhr9] [encoding=lcy] + \definefontsynonym [cmsl10] [lhsl10] [encoding=lcy] + \definefontsynonym [cmsl12] [lhsl12] [encoding=lcy] + \definefontsynonym [cmsl8] [lhsl8] [encoding=lcy] + \definefontsynonym [cmsl9] [lhsl9] [encoding=lcy] + \definefontsynonym [cmtcsc10] [lhtcsc10] [encoding=lcy] + \definefontsynonym [cmtex10] [lhtex10] [encoding=lcy] + \definefontsynonym [cmtex8] [lhtex8] [encoding=lcy] + \definefontsynonym [cmtex9] [lhtex9] [encoding=lcy] + \definefontsynonym [cmti10] [lhti10] [encoding=lcy] + \definefontsynonym [cmti12] [lhti12] [encoding=lcy] + \definefontsynonym [cmti7] [lhti7] [encoding=lcy] + \definefontsynonym [cmti8] [lhti8] [encoding=lcy] + \definefontsynonym [cmti9] [lhti9] [encoding=lcy] + \definefontsynonym [cmu10] [lhu10] [encoding=lcy] +\stoptypescript + +\starttypescript [sans] [computer-modern] [lcy] + \definefontsynonym [cmss10] [lhss10] [encoding=lcy] + \definefontsynonym [cmss12] [lhss12] [encoding=lcy] + \definefontsynonym [cmss17] [lhss17] [encoding=lcy] + \definefontsynonym [cmss8] [lhss8] [encoding=lcy] + \definefontsynonym [cmss9] [lhss9] [encoding=lcy] + \definefontsynonym [cmssbi10] [lhssbi10] [encoding=lcy] + \definefontsynonym [cmssbx10] [lhssbx10] [encoding=lcy] + \definefontsynonym [cmssdc10] [lhssdc10] [encoding=lcy] + \definefontsynonym [cmssi10] [lhssi10] [encoding=lcy] + \definefontsynonym [cmssi12] [lhssi12] [encoding=lcy] + \definefontsynonym [cmssi17] [lhssi17] [encoding=lcy] + \definefontsynonym [cmssi8] [lhssi8] [encoding=lcy] + \definefontsynonym [cmssi9] [lhssi9] [encoding=lcy] + \definefontsynonym [cmssq8] [lhssq8] [encoding=lcy] + \definefontsynonym [cmssqi8] [lhssqi8] [encoding=lcy] +\stoptypescript + +\starttypescript [mono] [computer-modern] [lcy] + \definefontsynonym [cmitt10] [lhitt10] [encoding=lcy] + \definefontsynonym [cmsltt10] [lhsltt10] [encoding=lcy] + \definefontsynonym [cmtt10] [lhtt10] [encoding=lcy] + \definefontsynonym [cmtt12] [lhtt12] [encoding=lcy] + \definefontsynonym [cmtt8] [lhtt8] [encoding=lcy] + \definefontsynonym [cmtt9] [lhtt9] [encoding=lcy] + \definefontsynonym [cmvtt10] [lhvtt10] [encoding=lcy] +\stoptypescript + +% + +\starttypescript [math] [modern,computer-modern,latin-modern] % [default] + % watch the space, it prevents remapping + \definefontsynonym [ComputerModernMath-Roman] [rm-lmr10]% [lmr10 ] + \definefontsynonym [ComputerModernMath-Extension] [lmex10] + \definefontsynonym [ComputerModernMath-Italic] [lmmi10] + \definefontsynonym [ComputerModernMath-Symbol] [lmsy10] +\stoptypescript + +\starttypescript [boldmath,bfmath] [modern,computer-modern,latin-modern] % [default] + % watch the space, it prevents remapping + \definefontsynonym [ComputerModernMath-Roman-Bold] [rm-lmb10] % [lmb10 ] + \definefontsynonym [ComputerModernMath-Extension] [lmex10] + \definefontsynonym [ComputerModernMath-Italic-Bold] [lmmib10] + \definefontsynonym [ComputerModernMath-Symbol-Bold] [lmbsy10] +\stoptypescript + +% Till we have cyrilic in lm: + +% \usetypescript[modern-base][t2a] +% \setupbodyfont[modern,10pt] + +\starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2] + \definefontsynonym [Serif] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree] + \definefontsynonym [SerifItalic] [\typescriptprefix{c:\typescriptthree}ti1000] [encoding=\typescriptthree] + \definefontsynonym [SerifSlanted] [\typescriptprefix{c:\typescriptthree}sl1000] [encoding=\typescriptthree] + \definefontsynonym [SerifBold] [\typescriptprefix{c:\typescriptthree}bx1000] [encoding=\typescriptthree] + \definefontsynonym [SerifBoldItalic] [\typescriptprefix{c:\typescriptthree}bi1000] [encoding=\typescriptthree] + \definefontsynonym [SerifBoldSlanted] [\typescriptprefix{c:\typescriptthree}bl1000] [encoding=\typescriptthree] + \definefontsynonym [SerifCaps] [\typescriptprefix{c:\typescriptthree}cc1000] [encoding=\typescriptthree] + \definefontsynonym [SerifCapsSlanted] [\typescriptprefix{c:\typescriptthree}sc1000] [encoding=\typescriptthree] +\stoptypescript + +\starttypescript [sans] [computer-modern] [t2a,t2b,t2c,x2] + \definefontsynonym [Sans] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree] + \definefontsynonym [SansItalic] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] + \definefontsynonym [SansSlanted] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] + \definefontsynonym [SansBold] [\typescriptprefix{c:\typescriptthree}sx1000] [encoding=\typescriptthree] + \definefontsynonym [SansBoldItalic] [\typescriptprefix{c:\typescriptthree}so1000] [encoding=\typescriptthree] + \definefontsynonym [SansBoldSlanted] [\typescriptprefix{c:\typescriptthree}so1000] [encoding=\typescriptthree] + \definefontsynonym [SansCaps] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree] + \definefontsynonym [SansCapsSlanted] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] +\stoptypescript + +\starttypescript [mono] [computer-modern] [t2a,t2b,t2c,x2] + \definefontsynonym [Mono] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree] + \definefontsynonym [MonoItalic] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree] + \definefontsynonym [MonoSlanted] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree] + \definefontsynonym [MonoBold] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree] + \definefontsynonym [MonoBoldItalic] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree] + \definefontsynonym [MonoBoldSlanted] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree] + \definefontsynonym [MonoCaps] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree] + \definefontsynonym [MonoCapsSlanted] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree] +\stoptypescript + +% Computer Concrete (AMS) + +\starttypescript [serif] [concrete] [default] + \definefontsynonym [ComputerConcrete] [ccr10] + \definefontsynonym [ComputerConcrete-Italic] [ccti10] + \definefontsynonym [ComputerConcrete-Slanted] [ccsl10] + \definefontsynonym [ComputerConcrete-Bold] [ComputerConcrete] + \definefontsynonym [ComputerConcrete-BoldItalic] [ComputerConcrete-Italic] + \definefontsynonym [ComputerConcrete-BoldSlanted] [ComputerConcrete-Slanted] + \definefontsynonym [ComputerConcrete-Caps] [cccsc10] +\stoptypescript + +% Euler (AMS) + +\starttypescript [math] [euler] [default] + \definefontsynonym [Euler-Roman] [zeurm10] + \definefontsynonym [Euler-Extension] [zeuex10] + \definefontsynonym [Euler-Symbol] [zeusm10] + \definefontsynonym [Euler-Fraktur] [eufm10] + \usemathcollection[eul] + \loadmapfile[original-ams-euler.map] +\stoptypescript + +\starttypescript [boldmath,bfmath] [euler] [default] + \definefontsynonym [Euler-Roman-Bold] [zeurb10] + \definefontsynonym [Euler-Extension] [zeuex10] + \definefontsynonym [Euler-Symbol-Bold] [zeusb10] + \definefontsynonym [Euler-Fraktur-Bold] [eufb10] + \usemathcollection[eul] + \loadmapfile[original-ams-euler.map] +\stoptypescript + +% AMS (AMS) + +\starttypescript [math] [modern,computer-modern,latin-modern,ams] [default] + \definefontsynonym [AMS-SymbolA] [msam10] + \definefontsynonym [AMS-SymbolB] [msbm10] + \usemathcollection[default] +\stoptypescript + +% Fourier (Utopia) + +\starttypescript [math] [fourier] [default,ec] + \definefontsynonym [Fourier-Math-Letters] [futr8t] [encoding=ec] + %definefontsynonym [Fourier-Math-Letters] [futmi] + \definefontsynonym [Fourier-Math-Letters-Italic] [futmii] + \definefontsynonym [Fourier-Math-Symbols] [futsy] + \definefontsynonym [Fourier-Math-Extension] [fourier-mex] + \usemathcollection[fou] + \loadmapfile[fourier.map] +\stoptypescript + +\starttypescript [serif] [fourier] [ec] + \definefontsynonym [Fourier-Regular] [futr8t] [encoding=ec] + \definefontsynonym [Fourier-Slanted] [futro8t] [encoding=ec] + \definefontsynonym [Fourier-Italic] [futri8t] [encoding=ec] + \definefontsynonym [Fourier-RegularCaps] [futrc8t] [encoding=ec] + \definefontsynonym [Fourier-Bold] [futb8t] [encoding=ec] + \definefontsynonym [Fourier-BoldSlanted] [futbo8t] [encoding=ec] + \definefontsynonym [Fourier-BoldItalic] [futbi8t] [encoding=ec] + \definefontsynonym [Fourier-BoldCaps] [futbc8t] [encoding=ec] + \definefontsynonym [Fourier-Regular-Expert] [futr9e] [encoding=ec] + \definefontsynonym [Fourier-Slanted-Expert] [futro9e] [encoding=ec] + \definefontsynonym [Fourier-Italic-Expert] [futri9e] [encoding=ec] + \definefontsynonym [Fourier-RegularCaps-Expert] [futrc9e] [encoding=ec] + \definefontsynonym [Fourier-Semi-Expert] [futs9e] [encoding=ec] + \definefontsynonym [Fourier-SemiSlanted-Expert] [futso9e] [encoding=ec] + \definefontsynonym [Fourier-SemiItalic-Expert] [futsi9e] [encoding=ec] + \definefontsynonym [Fourier-SemiCaps-Expert] [futsc9e] [encoding=ec] + \definefontsynonym [Fourier-Bold-Expert] [futb9e] [encoding=ec] + \definefontsynonym [Fourier-BoldSlanted-Expert] [futbo9e] [encoding=ec] + \definefontsynonym [Fourier-BoldItalic-Expert] [futbi9e] [encoding=ec] + \definefontsynonym [Fourier-Black-Expert] [futc9e] [encoding=ec] + \definefontsynonym [Fourier-Regular-OldStyle] [futr9d] [encoding=ec] + \definefontsynonym [Fourier-Slanted-OldStyle] [futro9d] [encoding=ec] + \definefontsynonym [Fourier-Italic-OldStyle] [futri9d] [encoding=ec] + \definefontsynonym [Fourier-RegularCaps-OldStyle] [futrc9d] [encoding=ec] + \definefontsynonym [Fourier-Semi-OldStyle] [futs9d] [encoding=ec] + \definefontsynonym [Fourier-SemiSlanted-OldStyle] [futso9d] [encoding=ec] + \definefontsynonym [Fourier-SemiItalic-OldStyle] [futsi9d] [encoding=ec] + \definefontsynonym [Fourier-SemiCaps-OldStyle] [futsc9d] [encoding=ec] + \definefontsynonym [Fourier-Bold-OldStyle] [futb9d] [encoding=ec] + \definefontsynonym [Fourier-BoldSlanted-OldStyle] [futbo9d] [encoding=ec] + \definefontsynonym [Fourier-BoldItalic-OldStyle] [futbi9d] [encoding=ec] + \definefontsynonym [Fourier-Black-OldStyle] [futc9d] [encoding=ec] + \loadmapfile[fourier.map] + \loadmapfile[fourier-utopia-expert.map] +\stoptypescript + +% Antykwa Torunska (GUST) + +% \starttypescript [serif] [antykwa-torunska] [texnansi,ec,8r] +% \definefontsynonym [AntykwaTorunska-Regular] [\typescriptthree-anttr] [encoding=\typescriptthree] +% \definefontsynonym [AntykwaTorunska-Bold] [\typescriptthree-anttb] [encoding=\typescriptthree] +% \definefontsynonym [AntykwaTorunska-Italic] [\typescriptthree-anttri] [encoding=\typescriptthree] +% \stoptypescript + +\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,qx,t5,ec,t2a,t2b,t2c,greek] + \definefontsynonym [AntykwaTorunska-Regular] [\typescriptthree-anttr] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-Italic] [\typescriptthree-anttri] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-Bold] [\typescriptthree-anttb] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-BoldItalic] [\typescriptthree-anttbi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-Light] [\typescriptthree-anttl] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-LightItalic] [\typescriptthree-anttli] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-Medium] [\typescriptthree-anttm] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-MedItalic] [\typescriptthree-anttmi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondRegular] [\typescriptthree-anttcr] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondItalic] [\typescriptthree-anttcri] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondBold] [\typescriptthree-anttcb] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondBoldItalic] [\typescriptthree-anttcbi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondLight] [\typescriptthree-anttcl] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondLightItalic][\typescriptthree-anttcli] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondMedium] [\typescriptthree-anttcm] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondMedItalic] [\typescriptthree-anttcmi] [encoding=\typescriptthree] + \loadmapfile[antt-\typescriptthree.map] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,qx,t5,ec] + \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttrcap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttricap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttbcap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbicap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttlcap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttlicap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttmcap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmicap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcrcap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcricap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcbcap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbicap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttclcap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttclicap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcmcap] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmicap] [encoding=\typescriptthree] + \loadmapfile[antt-\typescriptthree.map] +\stoptypescript + +% duplicates ? ? +% atl: no: fallbacks for the named variants + +\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [t2a,t2b,t2c,greek] + \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttb] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttl] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttli] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttm] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttr] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttri] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcb] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttcl] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttcli] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcm] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcr] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcri] [encoding=\typescriptthree] + \loadmapfile[antt-\typescriptthree.map] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [t2a,t2b,t2c] + \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttb] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttl] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttli] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttm] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttr] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttri] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcb] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttcl] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttcli] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcm] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmi] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcr] [encoding=\typescriptthree] + \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcri] [encoding=\typescriptthree] + \loadmapfile[antt-\typescriptthree.map] +\stoptypescript + +% mabye no -Regular etc +% dunny reverse of condlight lightcond + +\starttypescript [math] [antykwa-torunska] [default] + \definefontsynonym [AntykwaTorunska-Math-Letters-Regular] [rm-anttr] + \definefontsynonym [AntykwaTorunska-Math-Letters-Italic] [mi-anttri] + \definefontsynonym [AntykwaTorunska-Math-Symbols-Regular] [sy-anttrz] + \definefontsynonym [AntykwaTorunska-Math-Extension-Regular] [ex-anttr] +\stoptypescript + +\starttypescript [math] [antykwa-torunska-light] [default] + \definefontsynonym [AntykwaTorunska-Math-Letters-Light] [rm-anttl] + \definefontsynonym [AntykwaTorunska-Math-Letters-LightItalic] [mi-anttli] + \definefontsynonym [AntykwaTorunska-Math-Symbols-Light] [sy-anttlz] + \definefontsynonym [AntykwaTorunska-Math-Extension-Light] [ex-anttl] +\stoptypescript + +\starttypescript [math] [antykwa-torunska-cond] [default] + \definefontsynonym [AntykwaTorunska-Math-Letters-CondRegular] [rm-anttcr] + \definefontsynonym [AntykwaTorunska-Math-Letters-CondItalic] [mi-anttcri] + \definefontsynonym [AntykwaTorunska-Math-Symbols-CondRegular] [sy-anttcrz] + \definefontsynonym [AntykwaTorunska-Math-Extension-CondRegular] [ex-anttcr] +\stoptypescript + +\starttypescript [math] [antykwa-torunska-lightcond] [default] + \definefontsynonym [AntykwaTorunska-Math-Letters-CondLight] [rm-anttcl] + \definefontsynonym [AntykwaTorunska-Math-Letters-CondLightItalic] [mi-anttcli] + \definefontsynonym [AntykwaTorunska-Math-Symbols-CondLight] [sy-anttclz] + \definefontsynonym [AntykwaTorunska-Math-Extension-CondLight] [ex-anttcl] +\stoptypescript + +\starttypescript [math] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [default] + \usemathcollection[default] + \loadmapfile[antt-rm.map] + \loadmapfile[antt-mi.map] + \loadmapfile[antt-sy.map] + \loadmapfile[antt-ex.map] +\stoptypescript + +% Antykwa Poltawskiego (GUST) + +\starttypescript [serif] [antykwa-poltawskiego] [texnansi,ec,8r] + \definefontsynonym [AntykwaPoltawskiego-Regular] [\typescriptthree-antpr] [encoding=\typescriptthree] + \definefontsynonym [AntykwaPoltawskiego-Bold] [\typescriptthree-antpb] [encoding=\typescriptthree] + \definefontsynonym [AntykwaPoltawskiego-Italic] [\typescriptthree-antpri] [encoding=\typescriptthree] + \definefontsynonym [AntykwaPoltawskiego-BoldItalic] [\typescriptthree-antpbi] [encoding=\typescriptthree] + \loadmapfile[\typescriptthree-public-antp.map] +\stoptypescript + +% Iwona (JMN) + +% maybe this will change in Iwona-Math-Letters and Iwona-Math-Letters-Italic + +\starttypescript [sans] [iwona-light,iwona,iwona-medium,iwona-heavy,iwona-light-cond,iwona-cond,iwona-medium-cond,iwona-heavy-cond] [texnansi,ec,el,qx,t5] + \definefontsynonym[Iwona-Regular] [\typescriptthree-iwonar] [encoding=\typescriptthree] + \definefontsynonym[Iwona-Italic] [\typescriptthree-iwonari] [encoding=\typescriptthree] + \definefontsynonym[Iwona-Bold] [\typescriptthree-iwonab] [encoding=\typescriptthree] + \definefontsynonym[Iwona-BoldItalic] [\typescriptthree-iwonabi] [encoding=\typescriptthree] + \definefontsynonym[Iwona-Light-Regular] [\typescriptthree-iwonal] [encoding=\typescriptthree] + \definefontsynonym[Iwona-Light-Italic] [\typescriptthree-iwonali] [encoding=\typescriptthree] + \definefontsynonym[Iwona-Medium-Regular] [\typescriptthree-iwonam] [encoding=\typescriptthree] + \definefontsynonym[Iwona-Medium-Italic] [\typescriptthree-iwonami] [encoding=\typescriptthree] + \definefontsynonym[Iwona-Heavy-Regular] [\typescriptthree-iwonah] [encoding=\typescriptthree] + \definefontsynonym[Iwona-Heavy-Italic] [\typescriptthree-iwonahi] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsRegular] [\typescriptthree-iwonarcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsItalic] [\typescriptthree-iwonaricap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsBold] [\typescriptthree-iwonabcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsBoldItalic] [\typescriptthree-iwonabicap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsLight-Regular] [\typescriptthree-iwonalcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsLight-Italic] [\typescriptthree-iwonalicap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsMedium-Regular] [\typescriptthree-iwonamcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsMedium-Italic] [\typescriptthree-iwonamicap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsHeavy-Regular] [\typescriptthree-iwonahcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsHeavy-Italic] [\typescriptthree-iwonahicap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondRegular] [\typescriptthree-iwonacr] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondItalic] [\typescriptthree-iwonacri] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondBold] [\typescriptthree-iwonacb] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondBoldItalic] [\typescriptthree-iwonacbi] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondLight-Regular] [\typescriptthree-iwonacl] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondLight-Italic] [\typescriptthree-iwonacli] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondMedium-Regular] [\typescriptthree-iwonacm] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondMedium-Italic] [\typescriptthree-iwonacmi] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondHeavy-Regular] [\typescriptthree-iwonach] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CondHeavy-Italic] [\typescriptthree-iwonachi] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondRegular] [\typescriptthree-iwonacrcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondItalic] [\typescriptthree-iwonacricap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondBold] [\typescriptthree-iwonacbcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondBoldItalic] [\typescriptthree-iwonacbicap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondLight-Regular] [\typescriptthree-iwonaclcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondLight-Italic] [\typescriptthree-iwonaclicap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondMedium-Regular][\typescriptthree-iwonacmcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondMedium-Italic] [\typescriptthree-iwonacmicap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondHeavy-Regular] [\typescriptthree-iwonachcap] [encoding=\typescriptthree] + \definefontsynonym[Iwona-CapsCondHeavy-Italic] [\typescriptthree-iwonachicap] [encoding=\typescriptthree] + \loadmapfile[iwona-\typescriptthree.map] +\stoptypescript + +\starttypescript [math] [iwona] [default] + \definefontsynonym [Iwona-Math-Letters-Regular] [rm-iwonar] + \definefontsynonym [Iwona-Math-Letters-Italic] [mi-iwonari] + \definefontsynonym [Iwona-Math-Symbols-Regular] [sy-iwonarz] + \definefontsynonym [Iwona-Math-Extension-Regular] [ex-iwonar] +\stoptypescript + +\starttypescript [math] [iwona-light] [default] + \definefontsynonym [Iwona-Math-Letters-Light-Regular] [rm-iwonal] + \definefontsynonym [Iwona-Math-Letters-Light-Italic] [mi-iwonali] + \definefontsynonym [Iwona-Math-Symbols-Light] [sy-iwonalz] + \definefontsynonym [Iwona-Math-Extension-Light] [ex-iwonal] +\stoptypescript + +\starttypescript [math] [iwona-medium] [default] + \definefontsynonym [Iwona-Math-Letters-Medium-Regular][rm-iwonam] + \definefontsynonym [Iwona-Math-Letters-Medium-Italic] [mi-iwonami] + \definefontsynonym [Iwona-Math-Symbols-Medium] [sy-iwonamz] + \definefontsynonym [Iwona-Math-Extension-Medium] [ex-iwonam] +\stoptypescript + +\starttypescript [math] [iwona-heavy] [default] + \definefontsynonym [Iwona-Math-Letters-Heavy-Regular] [rm-iwonah] + \definefontsynonym [Iwona-Math-Letters-Heavy-Italic] [mi-iwonahi] + \definefontsynonym [Iwona-Math-Symbols-Heavy] [sy-iwonahz] + \definefontsynonym [Iwona-Math-Extension-Heavy] [ex-iwonah] +\stoptypescript + +\starttypescript [math] [iwona,iwona-light,iwona-medium,iwona-heavy] [default] + \usemathcollection[default] + \loadmapfile[iwona-rm.map] + \loadmapfile[iwona-mi.map] + \loadmapfile[iwona-sy.map] + \loadmapfile[iwona-ex.map] +\stoptypescript + +% Kurier (JMN) + +\starttypescript [sans] [kurier-light,kurier,kurier-medium] [texnansi,ec,qx,t5] + \definefontsynonym[Kurier-Regular] [\typescriptthree-kurierr] [encoding=\typescriptthree] + \definefontsynonym[Kurier-Italic] [\typescriptthree-kurierri] [encoding=\typescriptthree] + \definefontsynonym[Kurier-RegularItalic] [Kurier-Italic] + \definefontsynonym[Kurier-Bold] [\typescriptthree-kurierb] [encoding=\typescriptthree] + \definefontsynonym[Kurier-BoldItalic] [\typescriptthree-kurierbi] [encoding=\typescriptthree] + \definefontsynonym[Kurier-Light] [\typescriptthree-kurierl] [encoding=\typescriptthree] + \definefontsynonym[Kurier-LightItalic] [\typescriptthree-kurierli] [encoding=\typescriptthree] + \definefontsynonym[Kurier-Medium] [\typescriptthree-kurierm] [encoding=\typescriptthree] + \definefontsynonym[Kurier-MediumItalic] [\typescriptthree-kuriermi] [encoding=\typescriptthree] + \definefontsynonym[Kurier-Heavy] [\typescriptthree-kurierh] [encoding=\typescriptthree] + \definefontsynonym[Kurier-HeavyItalic] [\typescriptthree-kurierhi] [encoding=\typescriptthree] + \loadmapfile[kurier-\typescriptthree.map] +\stoptypescript + +\starttypescript [math] [kurier] [default] + \definefontsynonym [Kurier-Math-Letters-Regular] [rm-kurierr] + \definefontsynonym [Kurier-Math-Letters-Italic] [mi-kurierri] + \definefontsynonym [Kurier-Math-Symbols-Regular] [sy-kurierrz] + \definefontsynonym [Kurier-Math-Extension-Regular] [ex-kurierr] +\stoptypescript + +\starttypescript [math] [kurier-light] [default] + \definefontsynonym [Kurier-Math-Letters-Light-Regular] [rm-kurierl] + \definefontsynonym [Kurier-Math-Letters-Light-Italic] [mi-kurierli] + \definefontsynonym [Kurier-Math-Symbols-Light] [sy-kurierlz] + \definefontsynonym [Kurier-Math-Extension-Light] [ex-kurierl] +\stoptypescript + +\starttypescript [math] [kurier-medium] [default] + \definefontsynonym [Kurier-Math-Letters-Medium-Regular][rm-kurierm] + \definefontsynonym [Kurier-Math-Letters-Medium-Italic] [mi-kuriermi] + \definefontsynonym [Kurier-Math-Symbols-Medium] [sy-kuriermz] + \definefontsynonym [Kurier-Math-Extension-medium] [ex-kurierm] +\stoptypescript + +\starttypescript [math] [kurier,kurier-light,kurier-medium] [default] + \usemathcollection[default] + \loadmapfile[kurier-rm.map] + \loadmapfile[kurier-mi.map] + \loadmapfile[kurier-sy.map] + \loadmapfile[kurier-ex.map] +\stoptypescript + +\starttypescript [kurier-light,kurier,kurier-medium] [texnansi,ec,qx,t5] + \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default][encoding=\typescripttwo] + \definetypeface[\typescriptone][rm][serif][modern] [default][encoding=\typescripttwo] + \definetypeface[\typescriptone][tt][mono] [modern] [default][encoding=\typescripttwo,rscale=1.05] + \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][encoding=\typescripttwo,text=ss] + \quittypescriptscanning +\stoptypescript + +% Utopia (Adobe) + +\starttypescript [serif] [utopia] [ec,texnansi] + \definefontsynonym [Utopia-Regular] [\typescriptthree-putr8a] [encoding=\typescriptthree] + \definefontsynonym [Utopia-Italic] [\typescriptthree-putri8a] [encoding=\typescriptthree] + \definefontsynonym [Utopia-Bold] [\typescriptthree-putb8a] [encoding=\typescriptthree] + \definefontsynonym [Utopia-BoldItalic] [\typescriptthree-putbi8a] [encoding=\typescriptthree] + \definefontsynonym [Utopia-Slanted] [\typescriptthree-putr8a-slanted-167] [encoding=\typescriptthree] + \definefontsynonym [Utopia-BoldSlanted] [\typescriptthree-putb8a-slanted-167] [encoding=\typescriptthree] + \definefontsynonym [Utopia-Regular-Caps][\typescriptthree-putr8a-capitalized-800] [encoding=\typescriptthree] + \loadmapfile[\typescriptthree-adobe-utopia.map] +\stoptypescript + +% Charter (Bitstream) + +\starttypescript [serif] [charter] [ec,texnansi,8r] + \definefontsynonym [Charter-Roman] [\typescriptthree-bchr8a] [encoding=\typescriptthree] + \definefontsynonym [Charter-Italic] [\typescriptthree-bchri8a] [encoding=\typescriptthree] + \definefontsynonym [Charter-Bold] [\typescriptthree-bchb8a] [encoding=\typescriptthree] + \definefontsynonym [Charter-BoldItalic] [\typescriptthree-bchbi8a] [encoding=\typescriptthree] + \definefontsynonym [Charter-Slanted] [\typescriptthree-bchr8a-slanted-167] [encoding=\typescriptthree] + \definefontsynonym [Charter-BoldSlanted][\typescriptthree-bchb8a-slanted-167] [encoding=\typescriptthree] + \definefontsynonym [Charter-Roman-Caps] [\typescriptthree-bchr8a-capitalized-800] [encoding=\typescriptthree] + \loadmapfile[\typescriptthree-bitstrea-charter.map] +\stoptypescript + +% Whatever else we need: + +\starttypescript + \definefontsynonym [ZapfDingbats] [uzdr] + \definefontsynonym [RalfSmithFormalScript] [rsfs10] + \definefontsynonym [MartinVogel] [fmvr8x] +\stoptypescript + +% +% TeXGyre +% +% We now use tex-gyre fonts by default ... + +\definetypescriptprefix [f:pagella] [pl] \definetypescriptprefix [f:palatino] [pl] +\definetypescriptprefix [f:termes] [tm] \definetypescriptprefix [f:times] [tm] +\definetypescriptprefix [f:heros] [hv] \definetypescriptprefix [f:helvetica] [hv] +\definetypescriptprefix [f:bonum] [bk] \definetypescriptprefix [f:bookman] [bk] +\definetypescriptprefix [f:schola] [cs] \definetypescriptprefix [f:schoolbook] [cs] +\definetypescriptprefix [f:adventor][ag] %definetypescriptprefix [f:adventor] [ag] +\definetypescriptprefix [f:cursor] [cr] \definetypescriptprefix [f:courier] [cr] +\definetypescriptprefix [f:chorus] [zc] \definetypescriptprefix [f:chancery] [zc] % not the full set + +\starttypescript [serif,sans,mono] [pagella,palatino,termes,times,adventor,bonum,bookman,cursor,courier,heros,helvetica,schola,schoolbook] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}r] [encoding=\typescriptthree] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}ri] [encoding=\typescriptthree] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}b] [encoding=\typescriptthree] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}bi] [encoding=\typescriptthree] + \loadmapfile[q\typescriptprefix{f:\typescripttwo}-\typescriptthree.map] +\stoptypescript + +\starttypescript [serif,sans,mono] [pagella,palatino,termes,times,adventor,bonum,bookman,cursor,courier,heros,helvetica,schola,schoolbook] [ec,texnansi,cs,qx,rm,t5,l7x] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Caps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}r-sc] [encoding=\typescriptthree] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-ItalicCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}ri-sc] [encoding=\typescriptthree] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}b-sc] [encoding=\typescriptthree] + \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}bi-sc] [encoding=\typescriptthree] + \loadmapfile[q\typescriptprefix{f:\typescripttwo}-\typescriptthree.map] +\stoptypescript + +\starttypescript [serif] [chorus,chancery] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] + \definefontsynonym [TeXGyreChorus-MediumItalic] [\typescriptthree-qzcmi] [encoding=\typescriptthree] + \loadmapfile[qzc-\typescriptthree.map] +\stoptypescript + +% bonus definitions + +% when these fonts are in tex live ... +% +% \definefontsynonym [Palatino-Caps] [TeXPalladioL-SC] [encoding=\typescriptthree] +% +% \starttypescript [serif] [palatino] [ec,texnansi] +% \definefontsynonym[TeXPalladioL-BoldItalicOsF][\typescriptthree-fplbij8a][encoding=\typescriptthree] +% \definefontsynonym[TeXPalladioL-BoldOsF] [\typescriptthree-fplbj8a] [encoding=\typescriptthree] +% \definefontsynonym[TeXPalladioL-SC] [\typescriptthree-fplrc8a] [encoding=\typescriptthree] +% \definefontsynonym[TeXPalladioL-ItalicOsF] [\typescriptthree-fplrij8a][encoding=\typescriptthree] +% \loadmapfile[\typescriptthree-urw-palatino.map] +% \stoptypescript + +% Palatino Math (px) + +\starttypescript [math] [palatino] [all] + \definefontsynonym [Palatino-Roman-Upright] [pxr] + \definefontsynonym [Palatino-Roman-Italic] [pxi] + \definefontsynonym [Palatino-Roman-Slanted] [pxsl] + \definefontsynonym [Palatino-Roman-Caps] [pxsc] + \definefontsynonym [Palatino-Companion-Upright] [pcxr] + \definefontsynonym [Palatino-Companion-Italic] [pcxi] + \definefontsynonym [Palatino-Companion-Slanted] [pcxsl] + \definefontsynonym [Palatino-Math-Italic] [pxmi] + \definefontsynonym [Palatino-Math-Symbols] [pxsy] + \definefontsynonym [Palatino-Math-Extension] [pxex] + \definefontsynonym [Palatino-Math-SymbolsA] [pxsya] + \definefontsynonym [Palatino-Math-SymbolsB] [pxsyb] + \definefontsynonym [Palatino-Math-SymbolsC] [pxsyc] + \definefontsynonym [Palatino-Math-Italic-A] [pxmia] + \definefontsynonym [Palatino-Math-Extension-A] [pxexa] + \usemathcollection[default] + \loadmapfile[original-youngryu-px.map] +\stoptypescript + +% Times Math (tx) + +\starttypescript [math] [times] [all] + \definefontsynonym [Times-Roman-Upright] [txr] + \definefontsynonym [Times-Roman-Italic] [txi] + \definefontsynonym [Times-Roman-Slanted] [txsl] + \definefontsynonym [Times-Roman-Caps] [txsc] + \definefontsynonym [Times-Companion-Upright] [tcxr] + \definefontsynonym [Times-Companion-Italic] [tcxi] + \definefontsynonym [Times-Companion-Slanted] [tcxsl] + \definefontsynonym [Times-Math-Italic] [txmi] + \definefontsynonym [Times-Math-Symbols] [txsy] + \definefontsynonym [Times-Math-Extension] [txex] + \definefontsynonym [Times-Math-SymbolsA] [txsya] + \definefontsynonym [Times-Math-SymbolsB] [txsyb] + \definefontsynonym [Times-Math-SymbolsC] [txsyc] + \definefontsynonym [Times-Math-Italic-A] [txmia] + \definefontsynonym [Times-Math-Extension-A] [txexa] + \usemathcollection[default] + \loadmapfile[original-youngryu-tx.map] +\stoptypescript + +%D These are just fallbacks in case anyone stil uses the old names (might also be removed?). + +% +% TeXGyrePagella +% +\starttypescript [serif] [palatino] + \definefontsynonym [Palatino] [TeXGyrePagella-Regular] + \definefontsynonym [Palatino-Italic] [TeXGyrePagella-Italic] + \definefontsynonym [Palatino-Bold] [TeXGyrePagella-Bold] + \definefontsynonym [Palatino-BoldItalic] [TeXGyrePagella-BoldItalic] + \definefontsynonym [Palatino-Slanted] [TeXGyrePagella-Italic] + \definefontsynonym [Palatino-BoldSlanted] [TeXGyrePagella-BoldItalic] + \definefontsynonym [Palatino-Caps] [TeXGyrePagella-Caps] +\stoptypescript +% +% TeXGyreTermes +% +\starttypescript [serif] [times] + \definefontsynonym [Times-Roman] [TeXGyreTermes-Regular] + \definefontsynonym [Times-Italic] [TeXGyreTermes-Italic] + \definefontsynonym [Times-Bold] [TeXGyreTermes-Bold] + \definefontsynonym [Times-BoldItalic] [TeXGyreTermes-BoldItalic] + \definefontsynonym [Times-Slanted] [TeXGyreTermes-Italic] + \definefontsynonym [Times-BoldSlanted] [TeXGyreTermes-BoldItalic] + \definefontsynonym [Times-Caps] [TeXGyreTermes-Caps] +\stoptypescript +% +% TeXGyreHeros +% +\starttypescript [sans] [helvetica] + \definefontsynonym [Helvetica] [TeXGyreHeros-Regular] + \definefontsynonym [Helvetica-Oblique] [TeXGyreHeros-Italic] + \definefontsynonym [Helvetica-Bold] [TeXGyreHeros-Bold] + \definefontsynonym [Helvetica-BoldOblique] [TeXGyreHeros-BoldItalic] + \definefontsynonym [Helvetica-Caps] [TeXGyreHeros-Caps] +\stoptypescript +% +% TeXGyreBonum +% +\starttypescript [serif] [bookman] + \definefontsynonym [Bookman-Light] [TeXGyreBonum-Regular] + \definefontsynonym [Bookman-LightItalic] [TeXGyreBonum-Italic] + \definefontsynonym [Bookman-DemiBold] [TeXGyreBonum-Bold] + \definefontsynonym [Bookman-DemiBoldItalic] [TeXGyreBonum-BoldItalic] + \definefontsynonym [Bookman-LightSlanted] [TeXGyreBonum-Italic] + \definefontsynonym [Bookman-DemiBoldSlanted] [TeXGyreBonum-BoldItalic] + \definefontsynonym [Bookman-Light-Caps] [TeXGyreBonum-Caps] +\stoptypescript +% +% TeXGyreScola +% +\starttypescript [serif] [schoolbook] + \definefontsynonym [Schoolbook-Roman] [TeXGyreScola-Regular] + \definefontsynonym [Schoolbook-Italic] [TeXGyreScola-Italic] + \definefontsynonym [Schoolbook-Bold] [TeXGyreScola-Bold] + \definefontsynonym [Schoolbook-BoldItalic] [TeXGyreScola-BoldItalic] + \definefontsynonym [Schoolbook-Slanted] [TeXGyreScola-Italic] + \definefontsynonym [Schoolbook-BoldSlanted] [TeXGyreScola-BoldItalic] + \definefontsynonym [Schoolbook-Roman-Caps] [TeXGyreScola-Caps] +\stoptypescript +% +% TeXGyreAdventor +% +% +% TeXGyreCursor +% +\starttypescript [mono] [courier] + \definefontsynonym [Courier] [TeXGyreCursor-Regular] + \definefontsynonym [Courier-Bold] [TeXGyreCursor-Bold] + \definefontsynonym [Courier-Oblique] [TeXGyreCursor-Italic] + \definefontsynonym [Courier-BoldOblique] [TeXGyreCursor-BoldItalic] + \fakecontrolspace +\stoptypescript +% +% TeXGyreChorus +% +\starttypescript [calligraphy] [chancery] + \definefontsynonym [Chancery] [TeXGyreChorus-MediumItalic] +\stoptypescript + +\stoptypescriptcollection + +\endinput diff --git a/tex/context/base/type-one.mkiv b/tex/context/base/type-one.mkiv new file mode 100644 index 000000000..6f64dff0a --- /dev/null +++ b/tex/context/base/type-one.mkiv @@ -0,0 +1,16 @@ +%D \module +%D [ file=type-one, +%D version=2007.07.30, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Type One Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 use open type fonts in \MKIV. + +\endinput diff --git a/tex/context/base/type-one.tex b/tex/context/base/type-one.tex index b456d7e64..bd18eb281 100644 --- a/tex/context/base/type-one.tex +++ b/tex/context/base/type-one.tex @@ -11,1175 +11,6 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D This file merges the traditional enc, syn and map files into one. If -%D you think that it looks messy you're right. It shows some history of -%D \TEX\ fonts and the development towards latin modern. - -% texfont --ven=public --col=antt --enc=ec --sou=auto -% texfont --ven=public --col=antp --enc=ec --sou=auto -% texfont --ven=urw --col=palatino --enc=ec --sou=auto -% texfont --ven-lucas --col=sun --enc=ec --sou=. - -% \usetypescript [all] [modern] [texnansi] -% \setupbodyfont[reset] \setupbodyfont[cmr] -% \starttext \showfont[Serif] \stoptext - -\starttypescriptcollection[examples] - -\starttypescript [fallback] [texnansi,ec,qx,t5,default] - \definetypeface [] [rm] [serif] [modern] [computer-modern] [encoding=\typescripttwo] - \definetypeface [] [ss] [sans] [modern] [computer-modern] [encoding=\typescripttwo] - \definetypeface [] [tt] [mono] [modern] [computer-modern] [encoding=\typescripttwo] - \definetypeface [] [mm] [math] [modern] [computer-modern] [encoding=\typescripttwo] - \quittypescriptscanning -\stoptypescript - -\starttypescript [modern] [texnansi,ec,qx,t5,default] - \definetypeface [modern] [rm] [serif] [modern] [computer-modern] [encoding=\typescripttwo] - \definetypeface [modern] [ss] [sans] [modern] [computer-modern] [encoding=\typescripttwo] - \definetypeface [modern] [tt] [mono] [modern] [computer-modern] [encoding=\typescripttwo] - \definetypeface [modern] [mm] [math] [modern] [computer-modern] [encoding=\typescripttwo] - \quittypescriptscanning -\stoptypescript - -\starttypescript [modern-base] [texnansi,ec,qx,t5,default] - \definetypeface [modern] [rm] [serif] [modern] [default] [encoding=\typescripttwo] - \definetypeface [modern] [ss] [sans] [modern] [default] [encoding=\typescripttwo] - \definetypeface [modern] [tt] [mono] [modern] [default] [encoding=\typescripttwo] - \definetypeface [modern] [mm] [math] [modern] [default] [encoding=\typescripttwo] - \quittypescriptscanning -\stoptypescript - -\starttypescript [modern-base] [t2a,t2b,t2c,x2] - \definetypeface [modern] [rm] [serif] [computer-modern] [default] [encoding=\typescripttwo] - \definetypeface [modern] [ss] [sans] [computer-modern] [default] [encoding=\typescripttwo] - \definetypeface [modern] [tt] [mono] [computer-modern] [default] [encoding=\typescripttwo] - \definetypeface [modern] [mm] [math] [computer-modern] [default] [encoding=\typescripttwo] - \quittypescriptscanning -\stoptypescript - -\starttypescript [postscript] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definetypeface [postscript] [rm] [serif] [times] [default] [encoding=\typescripttwo] - \definetypeface [postscript] [ss] [sans] [helvetica] [default] [encoding=\typescripttwo,rscale=0.9] - \definetypeface [postscript] [tt] [mono] [courier] [default] [encoding=\typescripttwo,rscale=1.1] - \definetypeface [postscript] [mm] [math] [times] [default] [encoding=\typescripttwo] - \quittypescriptscanning -\stoptypescript - -\starttypescript [times,termes] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [ss] [sans] [helvetica] [default] [encoding=\typescripttwo,rscale=0.9] - \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.05] - \definetypeface [\typescriptone] [mm] [math] [times] [default] [encoding=\typescripttwo] - \quittypescriptscanning -\stoptypescript - -\starttypescript [palatino,pagella] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo,rscale=1.075] - \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.075] - \definetypeface [\typescriptone] [mm] [math] [palatino] [default] [encoding=default] - \quittypescriptscanning -\stoptypescript - -\starttypescript [fourier] [ec] - \definetypeface [fourier] [rm] [serif] [fourier] [default] [encoding=ec] - \definetypeface [fourier] [ss] [sans] [modern] [default] [encoding=ec,rscale=1.07] - \definetypeface [fourier] [tt] [mono] [modern] [default] [encoding=ec,rscale=1.07] - \definetypeface [fourier] [mm] [math] [fourier] [default] [encoding=default] - \quittypescriptscanning -\stoptypescript - -% handy - -\starttypescript [serif] [simple] [name] % bad, will be changed but in sycn with manuals that use it - \definefontsynonym [Simple] [cmvtt10] - \setupfontsynonym [Simple] [handling=pure] -\stoptypescript - -\starttypescript [modernvariable] [texnansi,ec,qx,8r,t5] - \definetypeface [modernvariable] [rm] [serif] [simple] [default] [encoding=\typescripttwo] - \definetypeface [modernvariable] [ss] [sans] [modern] [default] [encoding=\typescripttwo] - \definetypeface [modernvariable] [tt] [mono] [modern] [default] [encoding=\typescripttwo] - \definetypeface [modernvariable] [mm] [math] [modern] [default] - \quittypescriptscanning -\stoptypescript - -\starttypescript [optima] [texnansi,ec,qx] - \definetypeface[optima][ss][sans] [optima-nova][default][encoding=\typescripttwo] - \definetypeface[optima][rm][serif][palatino] [default][encoding=\typescripttwo] - \definetypeface[optima][tt][mono] [modern] [default][encoding=\typescripttwo,rscale=1.1] - \definetypeface[optima][mm][math] [palatino] [default][encoding=\typescripttwo] - \quittypescriptscanning -\stoptypescript - -\starttypescript [antykwa-torunska] [texnansi,ec,8r,uc,t5,t2a] - \definetypeface[antykwa][rm][serif][antykwa-torunska] [default][encoding=\typescripttwo] - \definetypeface[antykwa][ss][sans] [modern] [default][encoding=\typescripttwo,rscale=1.05] - \definetypeface[antykwa][tt][mono] [modern] [default][encoding=\typescripttwo,rscale=1.1] - \definetypeface[antykwa][mm][math] [antykwa-torunska] [default][encoding=\typescripttwo] - \quittypescriptscanning -\stoptypescript - -\starttypescript [schoolbook,schola] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] - \quittypescriptscanning -\stoptypescript - -\starttypescript [bookman,bonum] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] - \quittypescriptscanning -\stoptypescript - -\starttypescript [chancery,chorus] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] - \quittypescriptscanning -\stoptypescript - -\starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium] [texnansi,ec,8r,uc,t2a] - \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default][encoding=\typescripttwo] - \definetypeface[\typescriptone][rm][serif][modern] [default][encoding=\typescripttwo] - \definetypeface[\typescriptone][tt][mono] [modern] [default][encoding=\typescripttwo] - \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][encoding=\typescripttwo,text=ss] - \quittypescriptscanning -\stoptypescript - -\starttypescript [helvetica,heros] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [encoding=\typescripttwo,rscale=1.15] - \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.15] - \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default,rscale=1.15] - \quittypescriptscanning -\stoptypescript - -\starttypescript [avantgarde,adventor] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definetypeface [\typescriptone] [ss] [sans] [adventor] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [encoding=\typescripttwo,rscale=1.15] - \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.15] - \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] - \quittypescriptscanning -\stoptypescript - -\starttypescript [courier,cursor] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo] - \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default] - \quittypescriptscanning -\stoptypescript - -\stoptypescriptcollection - -\starttypescriptcollection[typeone] - -\starttypescript [map] [all] - \loadmapfile[original-base.map] - \loadmapfile[original-ams-base.map] -\stoptypescript - -\starttypescript[all][modern,latin-modern][all] - % fallbacks, no math in latin modern - \definefontsynonym[lmdunh10][cmdunh10] - \definefontsynonym[lmff10] [cmff10] - \definefontsynonym[lmfi10] [cmfi10] - \definefontsynonym[lmfib8] [cmfib8] - \definefontsynonym[lmtex10] [cmtex10] - \definefontsynonym[lmtex8] [cmtex8] - \definefontsynonym[lmtex9] [cmtex9] - \loadmapfile[original-public-lm.map] -\stoptypescript - -\starttypescript [serif] [modern,latin-modern] [texnansi,ec,qx,t5] - \definefontsynonym [LMRoman5-Regular] [\typescriptthree-lmr5] [encoding=\typescriptthree] - \definefontsynonym [LMRoman6-Regular] [\typescriptthree-lmr6] [encoding=\typescriptthree] - \definefontsynonym [LMRoman7-Regular] [\typescriptthree-lmr7] [encoding=\typescriptthree] - \definefontsynonym [LMRoman8-Regular] [\typescriptthree-lmr8] [encoding=\typescriptthree] - \definefontsynonym [LMRoman9-Regular] [\typescriptthree-lmr9] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-Regular] [\typescriptthree-lmr10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman12-Regular] [\typescriptthree-lmr12] [encoding=\typescriptthree] - \definefontsynonym [LMRoman17-Regular] [\typescriptthree-lmr17] [encoding=\typescriptthree] - \definefontsynonym [LMRoman5-Bold] [\typescriptthree-lmbx5] [encoding=\typescriptthree] - \definefontsynonym [LMRoman6-Bold] [\typescriptthree-lmbx6] [encoding=\typescriptthree] - \definefontsynonym [LMRoman7-Bold] [\typescriptthree-lmbx7] [encoding=\typescriptthree] - \definefontsynonym [LMRoman8-Bold] [\typescriptthree-lmbx8] [encoding=\typescriptthree] - \definefontsynonym [LMRoman9-Bold] [\typescriptthree-lmbx9] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-Bold] [\typescriptthree-lmbx10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman12-Bold] [\typescriptthree-lmbx12] [encoding=\typescriptthree] - \definefontsynonym [LMRoman7-Italic] [\typescriptthree-lmri7] [encoding=\typescriptthree] - \definefontsynonym [LMRoman8-Italic] [\typescriptthree-lmri8] [encoding=\typescriptthree] - \definefontsynonym [LMRoman9-Italic] [\typescriptthree-lmri9] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-Italic] [\typescriptthree-lmri10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman12-Italic] [\typescriptthree-lmri12] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-BoldItalic] [\typescriptthree-lmbxi10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman8-Oblique] [\typescriptthree-lmro8] [encoding=\typescriptthree] - \definefontsynonym [LMRoman9-Oblique] [\typescriptthree-lmro9] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-Oblique] [\typescriptthree-lmro10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman12-Oblique] [\typescriptthree-lmro12] [encoding=\typescriptthree] - \definefontsynonym [LMRoman17-Oblique] [\typescriptthree-lmro17] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-BoldOblique] [\typescriptthree-lmbxo10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-Demi] [\typescriptthree-lmb10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-DemiOblique] [\typescriptthree-lmbo10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-CapsRegular] [\typescriptthree-lmcsc10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-CapsOblique] [\typescriptthree-lmcsco10] [encoding=\typescriptthree] - - \definefontsynonym [LMRoman10-Dunhill] [\typescriptthree-lmdunh10] [encoding=\typescriptthree] - \definefontsynonym [LMRoman10-DunhillOblique] [\typescriptthree-lmduno10] [encoding=\typescriptthree] - \loadmapfile[lm-\typescriptthree.map] -\stoptypescript - -\starttypescript [sans] [modern,latin-modern] [texnansi,ec,qx,t5] - \definefontsynonym [LMSans8-Regular] [\typescriptthree-lmss8] [encoding=\typescriptthree] - \definefontsynonym [LMSans9-Regular] [\typescriptthree-lmss9] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-Regular] [\typescriptthree-lmss10] [encoding=\typescriptthree] - \definefontsynonym [LMSans12-Regular] [\typescriptthree-lmss12] [encoding=\typescriptthree] - \definefontsynonym [LMSans17-Regular] [\typescriptthree-lmss17] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-Bold] [\typescriptthree-lmssbx10] [encoding=\typescriptthree] - \definefontsynonym [LMSans8-Oblique] [\typescriptthree-lmsso8] [encoding=\typescriptthree] - \definefontsynonym [LMSans9-Oblique] [\typescriptthree-lmsso9] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-Oblique] [\typescriptthree-lmsso10] [encoding=\typescriptthree] - \definefontsynonym [LMSans12-Oblique] [\typescriptthree-lmsso12] [encoding=\typescriptthree] - \definefontsynonym [LMSans17-Oblique] [\typescriptthree-lmsso17] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-BoldOblique] [\typescriptthree-lmssbo10] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-DemiCondensed] [\typescriptthree-lmssdc10] [encoding=\typescriptthree] - \definefontsynonym [LMSans10-DemiCondensedOblique] [\typescriptthree-lmssdo10] [encoding=\typescriptthree] - \definefontsynonym [LMSansQuotation8-Regular] [\typescriptthree-lmssq8] [encoding=\typescriptthree] - \definefontsynonym [LMSansQuotation8-Bold] [\typescriptthree-lmssqbx8] [encoding=\typescriptthree] - \definefontsynonym [LMSansQuotation8-Oblique] [\typescriptthree-lmssqo8] [encoding=\typescriptthree] - \definefontsynonym [LMSansQuotation8-BoldOblique] [\typescriptthree-lmssqbo8] [encoding=\typescriptthree] - \loadmapfile[lm-\typescriptthree.map] -\stoptypescript - -\starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond] [texnansi,ec,qx,t5] - \definefontsynonym [LMTypewriter8-Regular] [\typescriptthree-lmtt8] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter9-Regular] [\typescriptthree-lmtt9] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Regular] [\typescriptthree-lmtt10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter12-Regular] [\typescriptthree-lmtt12] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Italic] [\typescriptthree-lmtti10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Oblique] [\typescriptthree-lmtto10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-CapsRegular] [\typescriptthree-lmtcsc10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-CapsOblique] [\typescriptthree-lmtcso10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Light] [\typescriptthree-lmtl10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-LightOblique] [\typescriptthree-lmtlo10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-LightCondensed] [\typescriptthree-lmtlc10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-LightCondensedOblique] [\typescriptthree-lmtlco10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Dark] [\typescriptthree-lmtk10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-DarkOblique] [\typescriptthree-lmtko10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriter10-Unslanted] [\typescriptthree-lmu10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-Regular] [\typescriptthree-lmvtt10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-Oblique] [\typescriptthree-lmvtto10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-Light] [\typescriptthree-lmvtl10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-LightOblique] [\typescriptthree-lmvtlo10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-Dark] [\typescriptthree-lmvtk10] [encoding=\typescriptthree] - \definefontsynonym [LMTypewriterVarWd10-DarkOblique] [\typescriptthree-lmvtko10] [encoding=\typescriptthree] - \loadmapfile[lm-\typescriptthree.map] -\stoptypescript - -\starttypescript [math] [modern,latin-modern] - \definefontsynonym [LMMathRoman5-Regular] [rm-lmr5] - \definefontsynonym [LMMathRoman6-Regular] [rm-lmr6] - \definefontsynonym [LMMathRoman7-Regular] [rm-lmr7] - \definefontsynonym [LMMathRoman8-Regular] [rm-lmr8] - \definefontsynonym [LMMathRoman9-Regular] [rm-lmr9] - \definefontsynonym [LMMathRoman10-Regular] [rm-lmr10] - \definefontsynonym [LMMathRoman12-Regular] [rm-lmr12] - \definefontsynonym [LMMathRoman17-Regular] [rm-lmr17] - \definefontsynonym [LMMathRoman5-Bold] [rm-lmbx5] - \definefontsynonym [LMMathRoman6-Bold] [rm-lmbx6] - \definefontsynonym [LMMathRoman7-Bold] [rm-lmbx7] - \definefontsynonym [LMMathRoman8-Bold] [rm-lmbx8] - \definefontsynonym [LMMathRoman9-Bold] [rm-lmbx9] - \definefontsynonym [LMMathRoman10-Bold] [rm-lmbx10] - \definefontsynonym [LMMathRoman12-Bold] [rm-lmbx12] - \definefontsynonym [LMMathSymbols5-BoldItalic] [lmbsy5] - \definefontsynonym [LMMathSymbols7-BoldItalic] [lmbsy7] - \definefontsynonym [LMMathSymbols10-BoldItalic][lmbsy10] - \definefontsynonym [LMMathSymbols5-Italic] [lmsy5] - \definefontsynonym [LMMathSymbols6-Italic] [lmsy6] - \definefontsynonym [LMMathSymbols7-Italic] [lmsy7] - \definefontsynonym [LMMathSymbols8-Italic] [lmsy8] - \definefontsynonym [LMMathSymbols9-Italic] [lmsy9] - \definefontsynonym [LMMathSymbols10-Italic] [lmsy10] - \definefontsynonym [LMMathExtension10-Regular] [lmex10] - \definefontsynonym [LMMathItalic5-Italic] [lmmi5] - \definefontsynonym [LMMathItalic6-Italic] [lmmi6] - \definefontsynonym [LMMathItalic7-Italic] [lmmi7] - \definefontsynonym [LMMathItalic8-Italic] [lmmi8] - \definefontsynonym [LMMathItalic9-Italic] [lmmi9] - \definefontsynonym [LMMathItalic10-Italic] [lmmi10] - \definefontsynonym [LMMathItalic12-Italic] [lmmi12] - \definefontsynonym [LMMathItalic5-BoldItalic] [lmmib5] - \definefontsynonym [LMMathItalic7-BoldItalic] [lmmib7] - \definefontsynonym [LMMathItalic10-BoldItalic] [lmmib10] - \usemathcollection[default] - \loadmapfile[lm-math.map] - \loadmapfile[lm-rm.map] -\stoptypescript - -%D {\em Comments by Victor Figurnov:} the wcmb10, wcmbx10, -%D \unknown\ fonts below are taken from the Paradissa -%D collection by Basil Malyshev. These fonts don't conform t2a -%D encoding but are in MS Windows Cyrillic codepage 1251 -%D encoding. These fonts contain only 33 russian letters in -%D upper and lower case, the number sign, and guillemots. But -%D even among these characters only the basic 32 russian -%D letters (in upper and lower case) will be typeset correctly -%D with this definition. The letters cyrillicYO and -%D cyrillicyo, as well as number sign (textnumero) and -%D guillemots won't be typeset properly, because these symbols -%D have different positions in t2a and MS CP1251 encodings. -%D -%D I think that the russian lh fonts and|/|or cm-super provide -%D better alternatives (type1). Therefore, the names below -%D match those of cm-super (\type {0NNN} instead of \type -%D {NNN}, i.e.\ four digit numbers). - -\starttypescript [serif] [computer-modern] [cyr] - \definefontsynonym [cmb10] [wcmb10] [encoding=t2a] - \definefontsynonym [cmbsy10] [wcmbsy10] [encoding=t2a] - \definefontsynonym [cmbx10] [wcmbx10] [encoding=t2a] - \definefontsynonym [cmbx12] [wcmbx12] [encoding=t2a] - \definefontsynonym [cmbx5] [wcmbx5] [encoding=t2a] - \definefontsynonym [cmbx6] [wcmbx6] [encoding=t2a] - \definefontsynonym [cmbx7] [wcmbx7] [encoding=t2a] - \definefontsynonym [cmbx8] [wcmbx8] [encoding=t2a] - \definefontsynonym [cmbx9] [wcmbx9] [encoding=t2a] - \definefontsynonym [cmbxsl10] [wcmbxsl10] [encoding=t2a] - \definefontsynonym [cmbxti10] [wcmbxti10] [encoding=t2a] - \definefontsynonym [cmcsc10] [wcmcsc10] [encoding=t2a] - %definefontsynonym [cmdunh10] [wcmdunh10] [encoding=t2a] - \definefontsynonym [cminch] [wcminch] [encoding=t2a] - \definefontsynonym [cmr10] [wcmr10] [encoding=t2a] - \definefontsynonym [cmr12] [wcmr12] [encoding=t2a] - \definefontsynonym [cmr17] [wcmr17] [encoding=t2a] - \definefontsynonym [cmr5] [wcmr5] [encoding=t2a] - \definefontsynonym [cmr6] [wcmr6] [encoding=t2a] - \definefontsynonym [cmr7] [wcmr7] [encoding=t2a] - \definefontsynonym [cmr8] [wcmr8] [encoding=t2a] - \definefontsynonym [cmr9] [wcmr9] [encoding=t2a] - \definefontsynonym [cmsl10] [wcmsl10] [encoding=t2a] - \definefontsynonym [cmsl12] [wcmsl12] [encoding=t2a] - \definefontsynonym [cmsl8] [wcmsl8] [encoding=t2a] - \definefontsynonym [cmsl9] [wcmsl9] [encoding=t2a] - \definefontsynonym [cmti10] [wcmti10] [encoding=t2a] - \definefontsynonym [cmti12] [wcmti12] [encoding=t2a] - \definefontsynonym [cmti7] [wcmti7] [encoding=t2a] - \definefontsynonym [cmti8] [wcmti8] [encoding=t2a] - \definefontsynonym [cmti9] [wcmti9] [encoding=t2a] - \definefontsynonym [cmu10] [wcmu10] [encoding=t2a] -\stoptypescript - -\starttypescript [sans] [computer-modern] [cyr] - \definefontsynonym [cmss10] [wcmss10] [encoding=t2a] - \definefontsynonym [cmss12] [wcmss12] [encoding=t2a] - \definefontsynonym [cmss17] [wcmss17] [encoding=t2a] - \definefontsynonym [cmss8] [wcmss8] [encoding=t2a] - \definefontsynonym [cmss9] [wcmss9] [encoding=t2a] - %definefontsynonym [cmssbi10] [wcmssbi10] [encoding=t2a] - \definefontsynonym [cmssbx10] [wcmssbx10] [encoding=t2a] - \definefontsynonym [cmssdc10] [wcmssdc10] [encoding=t2a] - \definefontsynonym [cmssi10] [wcmssi10] [encoding=t2a] - \definefontsynonym [cmssi12] [wcmssi12] [encoding=t2a] - \definefontsynonym [cmssi17] [wcmssi17] [encoding=t2a] - \definefontsynonym [cmssi8] [wcmssi8] [encoding=t2a] - \definefontsynonym [cmssi9] [wcmssi9] [encoding=t2a] - \definefontsynonym [cmssq8] [wcmssq8] [encoding=t2a] - \definefontsynonym [cmssqi8] [wcmssqi8] [encoding=t2a] -\stoptypescript - -\starttypescript [mono] [computer-modern] [cyr] - \definefontsynonym [cmitt10] [wcmitt10] [encoding=t2a] - \definefontsynonym [cmsltt10] [wcmsltt10] [encoding=t2a] - \definefontsynonym [cmtt10] [wcmtt10] [encoding=t2a] - \definefontsynonym [cmtt12] [wcmtt12] [encoding=t2a] - \definefontsynonym [cmtt8] [wcmtt8] [encoding=t2a] - \definefontsynonym [cmtt9] [wcmtt9] [encoding=t2a] - %definefontsynonym [cmvtt10] [wcmvtt10] [encoding=t2a] -\stoptypescript - -\definetypescriptprefix [c:t2a] [la] -\definetypescriptprefix [c:t2b] [lb] -\definetypescriptprefix [c:t2c] [lc] -\definetypescriptprefix [c:x2] [rx] - -\starttypescript [all] [computer-modern] [t2a,t2b,t2c,x2] - \loadmapfile[subset-cmsuper-\typescriptthree.map] - \loadmapfile[subset-cmsuper-\typescriptthree.map] - \loadmapfile[cm-super-\typescriptthree.map] -\stoptypescript - -\starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [cmb10] [\typescriptprefix{c:\typescriptthree}rb1000] [encoding=\typescriptthree] - \definefontsynonym [cmbx10] [\typescriptprefix{c:\typescriptthree}bx1000] [encoding=\typescriptthree] - \definefontsynonym [cmbx12] [\typescriptprefix{c:\typescriptthree}bx1200] [encoding=\typescriptthree] - \definefontsynonym [cmbx5] [\typescriptprefix{c:\typescriptthree}bx0500] [encoding=\typescriptthree] - \definefontsynonym [cmbx6] [\typescriptprefix{c:\typescriptthree}bx0600] [encoding=\typescriptthree] - \definefontsynonym [cmbx7] [\typescriptprefix{c:\typescriptthree}bx0700] [encoding=\typescriptthree] - \definefontsynonym [cmbx8] [\typescriptprefix{c:\typescriptthree}bx0800] [encoding=\typescriptthree] - \definefontsynonym [cmbx9] [\typescriptprefix{c:\typescriptthree}bx0900] [encoding=\typescriptthree] - \definefontsynonym [cmbxsl10] [\typescriptprefix{c:\typescriptthree}bl1000] [encoding=\typescriptthree] - \definefontsynonym [cmbxti10] [\typescriptprefix{c:\typescriptthree}bi1000] [encoding=\typescriptthree] - \definefontsynonym [cmcsc10] [\typescriptprefix{c:\typescriptthree}cc1000] [encoding=\typescriptthree] - \definefontsynonym [cmdunh10] [\typescriptprefix{c:\typescriptthree}dh1000] [encoding=\typescriptthree] - \definefontsynonym [cmff10] [\typescriptprefix{c:\typescriptthree}ff1000] [encoding=\typescriptthree] - \definefontsynonym [cmfi10] [\typescriptprefix{c:\typescriptthree}fi1000] [encoding=\typescriptthree] - \definefontsynonym [cmfib8] [\typescriptprefix{c:\typescriptthree}fb0800] [encoding=\typescriptthree] - %\definefontsynonym [cminch] [\typescriptprefix{c:\typescriptthree}inch00] [encoding=\typescriptthree] - \definefontsynonym [cmr10] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree] - \definefontsynonym [cmr12] [\typescriptprefix{c:\typescriptthree}rm1200] [encoding=\typescriptthree] - \definefontsynonym [cmr17] [\typescriptprefix{c:\typescriptthree}rm1700] [encoding=\typescriptthree] - \definefontsynonym [cmr5] [\typescriptprefix{c:\typescriptthree}rm0500] [encoding=\typescriptthree] - \definefontsynonym [cmr6] [\typescriptprefix{c:\typescriptthree}rm0600] [encoding=\typescriptthree] - \definefontsynonym [cmr7] [\typescriptprefix{c:\typescriptthree}rm0700] [encoding=\typescriptthree] - \definefontsynonym [cmr8] [\typescriptprefix{c:\typescriptthree}rm0800] [encoding=\typescriptthree] - \definefontsynonym [cmr9] [\typescriptprefix{c:\typescriptthree}rm0900] [encoding=\typescriptthree] - \definefontsynonym [cmsl10] [\typescriptprefix{c:\typescriptthree}sl1000] [encoding=\typescriptthree] - \definefontsynonym [cmsl12] [\typescriptprefix{c:\typescriptthree}sl1200] [encoding=\typescriptthree] - \definefontsynonym [cmsl8] [\typescriptprefix{c:\typescriptthree}sl0800] [encoding=\typescriptthree] - \definefontsynonym [cmsl9] [\typescriptprefix{c:\typescriptthree}sl0900] [encoding=\typescriptthree] - \definefontsynonym [cmtcsc10] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree] - \definefontsynonym [cmti10] [\typescriptprefix{c:\typescriptthree}ti1000] [encoding=\typescriptthree] - \definefontsynonym [cmti12] [\typescriptprefix{c:\typescriptthree}ti1200] [encoding=\typescriptthree] - \definefontsynonym [cmti7] [\typescriptprefix{c:\typescriptthree}ti0700] [encoding=\typescriptthree] - \definefontsynonym [cmti8] [\typescriptprefix{c:\typescriptthree}ti0800] [encoding=\typescriptthree] - \definefontsynonym [cmti9] [\typescriptprefix{c:\typescriptthree}ti0900] [encoding=\typescriptthree] - \definefontsynonym [cmu10] [\typescriptprefix{c:\typescriptthree}ui1000] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [sans] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [cmss10] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree] - \definefontsynonym [cmss12] [\typescriptprefix{c:\typescriptthree}ss1200] [encoding=\typescriptthree] - \definefontsynonym [cmss17] [\typescriptprefix{c:\typescriptthree}ss1700] [encoding=\typescriptthree] - \definefontsynonym [cmss8] [\typescriptprefix{c:\typescriptthree}ss0800] [encoding=\typescriptthree] - \definefontsynonym [cmss9] [\typescriptprefix{c:\typescriptthree}ss0900] [encoding=\typescriptthree] - \definefontsynonym [cmssbx10] [\typescriptprefix{c:\typescriptthree}sx1000] [encoding=\typescriptthree] - %\definefontsynonym [cmssdc10] [\typescriptprefix{c:\typescriptthree}ssdc1000] [encoding=\typescriptthree] - \definefontsynonym [cmssi10] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] - \definefontsynonym [cmssi12] [\typescriptprefix{c:\typescriptthree}si1200] [encoding=\typescriptthree] - \definefontsynonym [cmssi17] [\typescriptprefix{c:\typescriptthree}si1700] [encoding=\typescriptthree] - \definefontsynonym [cmssi8] [\typescriptprefix{c:\typescriptthree}si0800] [encoding=\typescriptthree] - \definefontsynonym [cmssi9] [\typescriptprefix{c:\typescriptthree}si0900] [encoding=\typescriptthree] - \definefontsynonym [cmssq8] [\typescriptprefix{c:\typescriptthree}ss0800] [encoding=\typescriptthree] - \definefontsynonym [cmssqi8] [\typescriptprefix{c:\typescriptthree}si0800] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [mono] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [cmitt10] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree] - \definefontsynonym [cmsltt10] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree] - \definefontsynonym [cmtt10] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree] - \definefontsynonym [cmtt12] [\typescriptprefix{c:\typescriptthree}tt1200] [encoding=\typescriptthree] - \definefontsynonym [cmtt8] [\typescriptprefix{c:\typescriptthree}tt0800] [encoding=\typescriptthree] - \definefontsynonym [cmtt9] [\typescriptprefix{c:\typescriptthree}tt0900] [encoding=\typescriptthree] - \definefontsynonym [cmvtt10] [\typescriptprefix{c:\typescriptthree}vt1000] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [serif] [computer-modern] [lcy] - \definefontsynonym [cmb10] [lhb10] [encoding=lcy] - \definefontsynonym [cmbx10] [lhbx10] [encoding=lcy] - \definefontsynonym [cmbx12] [lhbx12] [encoding=lcy] - \definefontsynonym [cmbx5] [lhbx5] [encoding=lcy] - \definefontsynonym [cmbx6] [lhbx6] [encoding=lcy] - \definefontsynonym [cmbx7] [lhbx7] [encoding=lcy] - \definefontsynonym [cmbx8] [lhbx8] [encoding=lcy] - \definefontsynonym [cmbx9] [lhbx9] [encoding=lcy] - \definefontsynonym [cmbxsl10] [lhbxsl10] [encoding=lcy] - \definefontsynonym [cmbxti10] [lhbxti10] [encoding=lcy] - \definefontsynonym [cmcsc10] [lhcsc10] [encoding=lcy] - \definefontsynonym [cmdunh10] [lhdunh10] [encoding=lcy] - \definefontsynonym [cmff10] [lhff10] [encoding=lcy] - \definefontsynonym [cmfi10] [lhfi10] [encoding=lcy] - \definefontsynonym [cmfib8] [lhfib8] [encoding=lcy] - \definefontsynonym [cminch] [lhinch] [encoding=lcy] - \definefontsynonym [cmr10] [lhr10] [encoding=lcy] - \definefontsynonym [cmr12] [lhr12] [encoding=lcy] - \definefontsynonym [cmr17] [lhr17] [encoding=lcy] - \definefontsynonym [cmr5] [lhr5] [encoding=lcy] - \definefontsynonym [cmr6] [lhr6] [encoding=lcy] - \definefontsynonym [cmr7] [lhr7] [encoding=lcy] - \definefontsynonym [cmr8] [lhr8] [encoding=lcy] - \definefontsynonym [cmr9] [lhr9] [encoding=lcy] - \definefontsynonym [cmsl10] [lhsl10] [encoding=lcy] - \definefontsynonym [cmsl12] [lhsl12] [encoding=lcy] - \definefontsynonym [cmsl8] [lhsl8] [encoding=lcy] - \definefontsynonym [cmsl9] [lhsl9] [encoding=lcy] - \definefontsynonym [cmtcsc10] [lhtcsc10] [encoding=lcy] - \definefontsynonym [cmtex10] [lhtex10] [encoding=lcy] - \definefontsynonym [cmtex8] [lhtex8] [encoding=lcy] - \definefontsynonym [cmtex9] [lhtex9] [encoding=lcy] - \definefontsynonym [cmti10] [lhti10] [encoding=lcy] - \definefontsynonym [cmti12] [lhti12] [encoding=lcy] - \definefontsynonym [cmti7] [lhti7] [encoding=lcy] - \definefontsynonym [cmti8] [lhti8] [encoding=lcy] - \definefontsynonym [cmti9] [lhti9] [encoding=lcy] - \definefontsynonym [cmu10] [lhu10] [encoding=lcy] -\stoptypescript - -\starttypescript [sans] [computer-modern] [lcy] - \definefontsynonym [cmss10] [lhss10] [encoding=lcy] - \definefontsynonym [cmss12] [lhss12] [encoding=lcy] - \definefontsynonym [cmss17] [lhss17] [encoding=lcy] - \definefontsynonym [cmss8] [lhss8] [encoding=lcy] - \definefontsynonym [cmss9] [lhss9] [encoding=lcy] - \definefontsynonym [cmssbi10] [lhssbi10] [encoding=lcy] - \definefontsynonym [cmssbx10] [lhssbx10] [encoding=lcy] - \definefontsynonym [cmssdc10] [lhssdc10] [encoding=lcy] - \definefontsynonym [cmssi10] [lhssi10] [encoding=lcy] - \definefontsynonym [cmssi12] [lhssi12] [encoding=lcy] - \definefontsynonym [cmssi17] [lhssi17] [encoding=lcy] - \definefontsynonym [cmssi8] [lhssi8] [encoding=lcy] - \definefontsynonym [cmssi9] [lhssi9] [encoding=lcy] - \definefontsynonym [cmssq8] [lhssq8] [encoding=lcy] - \definefontsynonym [cmssqi8] [lhssqi8] [encoding=lcy] -\stoptypescript - -\starttypescript [mono] [computer-modern] [lcy] - \definefontsynonym [cmitt10] [lhitt10] [encoding=lcy] - \definefontsynonym [cmsltt10] [lhsltt10] [encoding=lcy] - \definefontsynonym [cmtt10] [lhtt10] [encoding=lcy] - \definefontsynonym [cmtt12] [lhtt12] [encoding=lcy] - \definefontsynonym [cmtt8] [lhtt8] [encoding=lcy] - \definefontsynonym [cmtt9] [lhtt9] [encoding=lcy] - \definefontsynonym [cmvtt10] [lhvtt10] [encoding=lcy] -\stoptypescript - -% - -\starttypescript [math] [modern,computer-modern,latin-modern] % [default] - % watch the space, it prevents remapping - \definefontsynonym [ComputerModernMath-Roman] [rm-lmr10]% [lmr10 ] - \definefontsynonym [ComputerModernMath-Extension] [lmex10] - \definefontsynonym [ComputerModernMath-Italic] [lmmi10] - \definefontsynonym [ComputerModernMath-Symbol] [lmsy10] -\stoptypescript - -\starttypescript [boldmath,bfmath] [modern,computer-modern,latin-modern] % [default] - % watch the space, it prevents remapping - \definefontsynonym [ComputerModernMath-Roman-Bold] [rm-lmb10] % [lmb10 ] - \definefontsynonym [ComputerModernMath-Extension] [lmex10] - \definefontsynonym [ComputerModernMath-Italic-Bold] [lmmib10] - \definefontsynonym [ComputerModernMath-Symbol-Bold] [lmbsy10] -\stoptypescript - -% Till we have cyrilic in lm: - -% \usetypescript[modern-base][t2a] -% \setupbodyfont[modern,10pt] - -\starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [Serif] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree] - \definefontsynonym [SerifItalic] [\typescriptprefix{c:\typescriptthree}ti1000] [encoding=\typescriptthree] - \definefontsynonym [SerifSlanted] [\typescriptprefix{c:\typescriptthree}sl1000] [encoding=\typescriptthree] - \definefontsynonym [SerifBold] [\typescriptprefix{c:\typescriptthree}bx1000] [encoding=\typescriptthree] - \definefontsynonym [SerifBoldItalic] [\typescriptprefix{c:\typescriptthree}bi1000] [encoding=\typescriptthree] - \definefontsynonym [SerifBoldSlanted] [\typescriptprefix{c:\typescriptthree}bl1000] [encoding=\typescriptthree] - \definefontsynonym [SerifCaps] [\typescriptprefix{c:\typescriptthree}cc1000] [encoding=\typescriptthree] - \definefontsynonym [SerifCapsSlanted] [\typescriptprefix{c:\typescriptthree}sc1000] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [sans] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [Sans] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree] - \definefontsynonym [SansItalic] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] - \definefontsynonym [SansSlanted] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] - \definefontsynonym [SansBold] [\typescriptprefix{c:\typescriptthree}sx1000] [encoding=\typescriptthree] - \definefontsynonym [SansBoldItalic] [\typescriptprefix{c:\typescriptthree}so1000] [encoding=\typescriptthree] - \definefontsynonym [SansBoldSlanted] [\typescriptprefix{c:\typescriptthree}so1000] [encoding=\typescriptthree] - \definefontsynonym [SansCaps] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree] - \definefontsynonym [SansCapsSlanted] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree] -\stoptypescript - -\starttypescript [mono] [computer-modern] [t2a,t2b,t2c,x2] - \definefontsynonym [Mono] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree] - \definefontsynonym [MonoItalic] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree] - \definefontsynonym [MonoSlanted] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree] - \definefontsynonym [MonoBold] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree] - \definefontsynonym [MonoBoldItalic] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree] - \definefontsynonym [MonoBoldSlanted] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree] - \definefontsynonym [MonoCaps] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree] - \definefontsynonym [MonoCapsSlanted] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree] -\stoptypescript - -% Computer Concrete (AMS) - -\starttypescript [serif] [concrete] [default] - \definefontsynonym [ComputerConcrete] [ccr10] - \definefontsynonym [ComputerConcrete-Italic] [ccti10] - \definefontsynonym [ComputerConcrete-Slanted] [ccsl10] - \definefontsynonym [ComputerConcrete-Bold] [ComputerConcrete] - \definefontsynonym [ComputerConcrete-BoldItalic] [ComputerConcrete-Italic] - \definefontsynonym [ComputerConcrete-BoldSlanted] [ComputerConcrete-Slanted] - \definefontsynonym [ComputerConcrete-Caps] [cccsc10] -\stoptypescript - -% Euler (AMS) - -\starttypescript [math] [euler] [default] - \definefontsynonym [Euler-Roman] [zeurm10] - \definefontsynonym [Euler-Extension] [zeuex10] - \definefontsynonym [Euler-Symbol] [zeusm10] - \definefontsynonym [Euler-Fraktur] [eufm10] - \usemathcollection[eul] - \loadmapfile[original-ams-euler.map] -\stoptypescript - -\starttypescript [boldmath,bfmath] [euler] [default] - \definefontsynonym [Euler-Roman-Bold] [zeurb10] - \definefontsynonym [Euler-Extension] [zeuex10] - \definefontsynonym [Euler-Symbol-Bold] [zeusb10] - \definefontsynonym [Euler-Fraktur-Bold] [eufb10] - \usemathcollection[eul] - \loadmapfile[original-ams-euler.map] -\stoptypescript - -% AMS (AMS) - -\starttypescript [math] [modern,computer-modern,latin-modern,ams] [default] - \definefontsynonym [AMS-SymbolA] [msam10] - \definefontsynonym [AMS-SymbolB] [msbm10] - \usemathcollection[default] -\stoptypescript - -% Fourier (Utopia) - -\starttypescript [math] [fourier] [default,ec] - \definefontsynonym [Fourier-Math-Letters] [futr8t] [encoding=ec] - %definefontsynonym [Fourier-Math-Letters] [futmi] - \definefontsynonym [Fourier-Math-Letters-Italic] [futmii] - \definefontsynonym [Fourier-Math-Symbols] [futsy] - \definefontsynonym [Fourier-Math-Extension] [fourier-mex] - \usemathcollection[fou] - \loadmapfile[fourier.map] -\stoptypescript - -\starttypescript [serif] [fourier] [ec] - \definefontsynonym [Fourier-Regular] [futr8t] [encoding=ec] - \definefontsynonym [Fourier-Slanted] [futro8t] [encoding=ec] - \definefontsynonym [Fourier-Italic] [futri8t] [encoding=ec] - \definefontsynonym [Fourier-RegularCaps] [futrc8t] [encoding=ec] - \definefontsynonym [Fourier-Bold] [futb8t] [encoding=ec] - \definefontsynonym [Fourier-BoldSlanted] [futbo8t] [encoding=ec] - \definefontsynonym [Fourier-BoldItalic] [futbi8t] [encoding=ec] - \definefontsynonym [Fourier-BoldCaps] [futbc8t] [encoding=ec] - \definefontsynonym [Fourier-Regular-Expert] [futr9e] [encoding=ec] - \definefontsynonym [Fourier-Slanted-Expert] [futro9e] [encoding=ec] - \definefontsynonym [Fourier-Italic-Expert] [futri9e] [encoding=ec] - \definefontsynonym [Fourier-RegularCaps-Expert] [futrc9e] [encoding=ec] - \definefontsynonym [Fourier-Semi-Expert] [futs9e] [encoding=ec] - \definefontsynonym [Fourier-SemiSlanted-Expert] [futso9e] [encoding=ec] - \definefontsynonym [Fourier-SemiItalic-Expert] [futsi9e] [encoding=ec] - \definefontsynonym [Fourier-SemiCaps-Expert] [futsc9e] [encoding=ec] - \definefontsynonym [Fourier-Bold-Expert] [futb9e] [encoding=ec] - \definefontsynonym [Fourier-BoldSlanted-Expert] [futbo9e] [encoding=ec] - \definefontsynonym [Fourier-BoldItalic-Expert] [futbi9e] [encoding=ec] - \definefontsynonym [Fourier-Black-Expert] [futc9e] [encoding=ec] - \definefontsynonym [Fourier-Regular-OldStyle] [futr9d] [encoding=ec] - \definefontsynonym [Fourier-Slanted-OldStyle] [futro9d] [encoding=ec] - \definefontsynonym [Fourier-Italic-OldStyle] [futri9d] [encoding=ec] - \definefontsynonym [Fourier-RegularCaps-OldStyle] [futrc9d] [encoding=ec] - \definefontsynonym [Fourier-Semi-OldStyle] [futs9d] [encoding=ec] - \definefontsynonym [Fourier-SemiSlanted-OldStyle] [futso9d] [encoding=ec] - \definefontsynonym [Fourier-SemiItalic-OldStyle] [futsi9d] [encoding=ec] - \definefontsynonym [Fourier-SemiCaps-OldStyle] [futsc9d] [encoding=ec] - \definefontsynonym [Fourier-Bold-OldStyle] [futb9d] [encoding=ec] - \definefontsynonym [Fourier-BoldSlanted-OldStyle] [futbo9d] [encoding=ec] - \definefontsynonym [Fourier-BoldItalic-OldStyle] [futbi9d] [encoding=ec] - \definefontsynonym [Fourier-Black-OldStyle] [futc9d] [encoding=ec] - \loadmapfile[fourier.map] - \loadmapfile[fourier-utopia-expert.map] -\stoptypescript - -% Antykwa Torunska (GUST) - -% \starttypescript [serif] [antykwa-torunska] [texnansi,ec,8r] -% \definefontsynonym [AntykwaTorunska-Regular] [\typescriptthree-anttr] [encoding=\typescriptthree] -% \definefontsynonym [AntykwaTorunska-Bold] [\typescriptthree-anttb] [encoding=\typescriptthree] -% \definefontsynonym [AntykwaTorunska-Italic] [\typescriptthree-anttri] [encoding=\typescriptthree] -% \stoptypescript - -\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,qx,t5,ec,t2a,t2b,t2c,greek] - \definefontsynonym [AntykwaTorunska-Regular] [\typescriptthree-anttr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Italic] [\typescriptthree-anttri] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Bold] [\typescriptthree-anttb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-BoldItalic] [\typescriptthree-anttbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Light] [\typescriptthree-anttl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightItalic] [\typescriptthree-anttli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Medium] [\typescriptthree-anttm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MedItalic] [\typescriptthree-anttmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondRegular] [\typescriptthree-anttcr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondItalic] [\typescriptthree-anttcri] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBold] [\typescriptthree-anttcb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldItalic] [\typescriptthree-anttcbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLight] [\typescriptthree-anttcl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightItalic][\typescriptthree-anttcli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedium] [\typescriptthree-anttcm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedItalic] [\typescriptthree-anttcmi] [encoding=\typescriptthree] - \loadmapfile[antt-\typescriptthree.map] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,qx,t5,ec] - \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttrcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttricap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttbcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttlcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttlicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttmcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcrcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcricap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcbcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttclcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttclicap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcmcap] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmicap] [encoding=\typescriptthree] - \loadmapfile[antt-\typescriptthree.map] -\stoptypescript - -% duplicates ? ? -% atl: no: fallbacks for the named variants - -\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [t2a,t2b,t2c,greek] - \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttri] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttcl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttcli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcri] [encoding=\typescriptthree] - \loadmapfile[antt-\typescriptthree.map] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [t2a,t2b,t2c] - \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttri] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttcl] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttcli] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcm] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmi] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcri] [encoding=\typescriptthree] - \loadmapfile[antt-\typescriptthree.map] -\stoptypescript - -% mabye no -Regular etc -% dunny reverse of condlight lightcond - -\starttypescript [math] [antykwa-torunska] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-Regular] [rm-anttr] - \definefontsynonym [AntykwaTorunska-Math-Letters-Italic] [mi-anttri] - \definefontsynonym [AntykwaTorunska-Math-Symbols-Regular] [sy-anttrz] - \definefontsynonym [AntykwaTorunska-Math-Extension-Regular] [ex-anttr] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-light] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-Light] [rm-anttl] - \definefontsynonym [AntykwaTorunska-Math-Letters-LightItalic] [mi-anttli] - \definefontsynonym [AntykwaTorunska-Math-Symbols-Light] [sy-anttlz] - \definefontsynonym [AntykwaTorunska-Math-Extension-Light] [ex-anttl] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-cond] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondRegular] [rm-anttcr] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondItalic] [mi-anttcri] - \definefontsynonym [AntykwaTorunska-Math-Symbols-CondRegular] [sy-anttcrz] - \definefontsynonym [AntykwaTorunska-Math-Extension-CondRegular] [ex-anttcr] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-lightcond] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondLight] [rm-anttcl] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondLightItalic] [mi-anttcli] - \definefontsynonym [AntykwaTorunska-Math-Symbols-CondLight] [sy-anttclz] - \definefontsynonym [AntykwaTorunska-Math-Extension-CondLight] [ex-anttcl] -\stoptypescript - -\starttypescript [math] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [default] - \usemathcollection[default] - \loadmapfile[antt-rm.map] - \loadmapfile[antt-mi.map] - \loadmapfile[antt-sy.map] - \loadmapfile[antt-ex.map] -\stoptypescript - -% Antykwa Poltawskiego (GUST) - -\starttypescript [serif] [antykwa-poltawskiego] [texnansi,ec,8r] - \definefontsynonym [AntykwaPoltawskiego-Regular] [\typescriptthree-antpr] [encoding=\typescriptthree] - \definefontsynonym [AntykwaPoltawskiego-Bold] [\typescriptthree-antpb] [encoding=\typescriptthree] - \definefontsynonym [AntykwaPoltawskiego-Italic] [\typescriptthree-antpri] [encoding=\typescriptthree] - \definefontsynonym [AntykwaPoltawskiego-BoldItalic] [\typescriptthree-antpbi] [encoding=\typescriptthree] - \loadmapfile[\typescriptthree-public-antp.map] -\stoptypescript - -% Iwona (JMN) - -% maybe this will change in Iwona-Math-Letters and Iwona-Math-Letters-Italic - -\starttypescript [sans] [iwona-light,iwona,iwona-medium,iwona-heavy,iwona-light-cond,iwona-cond,iwona-medium-cond,iwona-heavy-cond] [texnansi,ec,el,qx,t5] - \definefontsynonym[Iwona-Regular] [\typescriptthree-iwonar] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Italic] [\typescriptthree-iwonari] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Bold] [\typescriptthree-iwonab] [encoding=\typescriptthree] - \definefontsynonym[Iwona-BoldItalic] [\typescriptthree-iwonabi] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Light-Regular] [\typescriptthree-iwonal] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Light-Italic] [\typescriptthree-iwonali] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Medium-Regular] [\typescriptthree-iwonam] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Medium-Italic] [\typescriptthree-iwonami] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Heavy-Regular] [\typescriptthree-iwonah] [encoding=\typescriptthree] - \definefontsynonym[Iwona-Heavy-Italic] [\typescriptthree-iwonahi] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsRegular] [\typescriptthree-iwonarcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsItalic] [\typescriptthree-iwonaricap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsBold] [\typescriptthree-iwonabcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsBoldItalic] [\typescriptthree-iwonabicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsLight-Regular] [\typescriptthree-iwonalcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsLight-Italic] [\typescriptthree-iwonalicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsMedium-Regular] [\typescriptthree-iwonamcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsMedium-Italic] [\typescriptthree-iwonamicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsHeavy-Regular] [\typescriptthree-iwonahcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsHeavy-Italic] [\typescriptthree-iwonahicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondRegular] [\typescriptthree-iwonacr] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondItalic] [\typescriptthree-iwonacri] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondBold] [\typescriptthree-iwonacb] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondBoldItalic] [\typescriptthree-iwonacbi] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondLight-Regular] [\typescriptthree-iwonacl] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondLight-Italic] [\typescriptthree-iwonacli] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondMedium-Regular] [\typescriptthree-iwonacm] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondMedium-Italic] [\typescriptthree-iwonacmi] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondHeavy-Regular] [\typescriptthree-iwonach] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CondHeavy-Italic] [\typescriptthree-iwonachi] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondRegular] [\typescriptthree-iwonacrcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondItalic] [\typescriptthree-iwonacricap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondBold] [\typescriptthree-iwonacbcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondBoldItalic] [\typescriptthree-iwonacbicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondLight-Regular] [\typescriptthree-iwonaclcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondLight-Italic] [\typescriptthree-iwonaclicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondMedium-Regular][\typescriptthree-iwonacmcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondMedium-Italic] [\typescriptthree-iwonacmicap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondHeavy-Regular] [\typescriptthree-iwonachcap] [encoding=\typescriptthree] - \definefontsynonym[Iwona-CapsCondHeavy-Italic] [\typescriptthree-iwonachicap] [encoding=\typescriptthree] - \loadmapfile[iwona-\typescriptthree.map] -\stoptypescript - -\starttypescript [math] [iwona] [default] - \definefontsynonym [Iwona-Math-Letters-Regular] [rm-iwonar] - \definefontsynonym [Iwona-Math-Letters-Italic] [mi-iwonari] - \definefontsynonym [Iwona-Math-Symbols-Regular] [sy-iwonarz] - \definefontsynonym [Iwona-Math-Extension-Regular] [ex-iwonar] -\stoptypescript - -\starttypescript [math] [iwona-light] [default] - \definefontsynonym [Iwona-Math-Letters-Light-Regular] [rm-iwonal] - \definefontsynonym [Iwona-Math-Letters-Light-Italic] [mi-iwonali] - \definefontsynonym [Iwona-Math-Symbols-Light] [sy-iwonalz] - \definefontsynonym [Iwona-Math-Extension-Light] [ex-iwonal] -\stoptypescript - -\starttypescript [math] [iwona-medium] [default] - \definefontsynonym [Iwona-Math-Letters-Medium-Regular][rm-iwonam] - \definefontsynonym [Iwona-Math-Letters-Medium-Italic] [mi-iwonami] - \definefontsynonym [Iwona-Math-Symbols-Medium] [sy-iwonamz] - \definefontsynonym [Iwona-Math-Extension-Medium] [ex-iwonam] -\stoptypescript - -\starttypescript [math] [iwona-heavy] [default] - \definefontsynonym [Iwona-Math-Letters-Heavy-Regular] [rm-iwonah] - \definefontsynonym [Iwona-Math-Letters-Heavy-Italic] [mi-iwonahi] - \definefontsynonym [Iwona-Math-Symbols-Heavy] [sy-iwonahz] - \definefontsynonym [Iwona-Math-Extension-Heavy] [ex-iwonah] -\stoptypescript - -\starttypescript [math] [iwona,iwona-light,iwona-medium,iwona-heavy] [default] - \usemathcollection[default] - \loadmapfile[iwona-rm.map] - \loadmapfile[iwona-mi.map] - \loadmapfile[iwona-sy.map] - \loadmapfile[iwona-ex.map] -\stoptypescript - -% Kurier (JMN) - -\starttypescript [sans] [kurier-light,kurier,kurier-medium] [texnansi,ec,qx,t5] - \definefontsynonym[Kurier-Regular] [\typescriptthree-kurierr] [encoding=\typescriptthree] - \definefontsynonym[Kurier-Italic] [\typescriptthree-kurierri] [encoding=\typescriptthree] - \definefontsynonym[Kurier-RegularItalic] [Kurier-Italic] - \definefontsynonym[Kurier-Bold] [\typescriptthree-kurierb] [encoding=\typescriptthree] - \definefontsynonym[Kurier-BoldItalic] [\typescriptthree-kurierbi] [encoding=\typescriptthree] - \definefontsynonym[Kurier-Light] [\typescriptthree-kurierl] [encoding=\typescriptthree] - \definefontsynonym[Kurier-LightItalic] [\typescriptthree-kurierli] [encoding=\typescriptthree] - \definefontsynonym[Kurier-Medium] [\typescriptthree-kurierm] [encoding=\typescriptthree] - \definefontsynonym[Kurier-MediumItalic] [\typescriptthree-kuriermi] [encoding=\typescriptthree] - \definefontsynonym[Kurier-Heavy] [\typescriptthree-kurierh] [encoding=\typescriptthree] - \definefontsynonym[Kurier-HeavyItalic] [\typescriptthree-kurierhi] [encoding=\typescriptthree] - \loadmapfile[kurier-\typescriptthree.map] -\stoptypescript - -\starttypescript [math] [kurier] [default] - \definefontsynonym [Kurier-Math-Letters-Regular] [rm-kurierr] - \definefontsynonym [Kurier-Math-Letters-Italic] [mi-kurierri] - \definefontsynonym [Kurier-Math-Symbols-Regular] [sy-kurierrz] - \definefontsynonym [Kurier-Math-Extension-Regular] [ex-kurierr] -\stoptypescript - -\starttypescript [math] [kurier-light] [default] - \definefontsynonym [Kurier-Math-Letters-Light-Regular] [rm-kurierl] - \definefontsynonym [Kurier-Math-Letters-Light-Italic] [mi-kurierli] - \definefontsynonym [Kurier-Math-Symbols-Light] [sy-kurierlz] - \definefontsynonym [Kurier-Math-Extension-Light] [ex-kurierl] -\stoptypescript - -\starttypescript [math] [kurier-medium] [default] - \definefontsynonym [Kurier-Math-Letters-Medium-Regular][rm-kurierm] - \definefontsynonym [Kurier-Math-Letters-Medium-Italic] [mi-kuriermi] - \definefontsynonym [Kurier-Math-Symbols-Medium] [sy-kuriermz] - \definefontsynonym [Kurier-Math-Extension-medium] [ex-kurierm] -\stoptypescript - -\starttypescript [math] [kurier,kurier-light,kurier-medium] [default] - \usemathcollection[default] - \loadmapfile[kurier-rm.map] - \loadmapfile[kurier-mi.map] - \loadmapfile[kurier-sy.map] - \loadmapfile[kurier-ex.map] -\stoptypescript - -\starttypescript [kurier-light,kurier,kurier-medium] [texnansi,ec,qx,t5] - \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default][encoding=\typescripttwo] - \definetypeface[\typescriptone][rm][serif][modern] [default][encoding=\typescripttwo] - \definetypeface[\typescriptone][tt][mono] [modern] [default][encoding=\typescripttwo,rscale=1.05] - \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][encoding=\typescripttwo,text=ss] - \quittypescriptscanning -\stoptypescript - -% Utopia (Adobe) - -\starttypescript [serif] [utopia] [ec,texnansi] - \definefontsynonym [Utopia-Regular] [\typescriptthree-putr8a] [encoding=\typescriptthree] - \definefontsynonym [Utopia-Italic] [\typescriptthree-putri8a] [encoding=\typescriptthree] - \definefontsynonym [Utopia-Bold] [\typescriptthree-putb8a] [encoding=\typescriptthree] - \definefontsynonym [Utopia-BoldItalic] [\typescriptthree-putbi8a] [encoding=\typescriptthree] - \definefontsynonym [Utopia-Slanted] [\typescriptthree-putr8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Utopia-BoldSlanted] [\typescriptthree-putb8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Utopia-Regular-Caps][\typescriptthree-putr8a-capitalized-800] [encoding=\typescriptthree] - \loadmapfile[\typescriptthree-adobe-utopia.map] -\stoptypescript - -% Charter (Bitstream) - -\starttypescript [serif] [charter] [ec,texnansi,8r] - \definefontsynonym [Charter-Roman] [\typescriptthree-bchr8a] [encoding=\typescriptthree] - \definefontsynonym [Charter-Italic] [\typescriptthree-bchri8a] [encoding=\typescriptthree] - \definefontsynonym [Charter-Bold] [\typescriptthree-bchb8a] [encoding=\typescriptthree] - \definefontsynonym [Charter-BoldItalic] [\typescriptthree-bchbi8a] [encoding=\typescriptthree] - \definefontsynonym [Charter-Slanted] [\typescriptthree-bchr8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Charter-BoldSlanted][\typescriptthree-bchb8a-slanted-167] [encoding=\typescriptthree] - \definefontsynonym [Charter-Roman-Caps] [\typescriptthree-bchr8a-capitalized-800] [encoding=\typescriptthree] - \loadmapfile[\typescriptthree-bitstrea-charter.map] -\stoptypescript - -% Whatever else we need: - -\starttypescript - \definefontsynonym [ZapfDingbats] [uzdr] - \definefontsynonym [RalfSmithFormalScript] [rsfs10] - \definefontsynonym [MartinVogel] [fmvr8x] -\stoptypescript - -% -% TeXGyre -% -% We now use tex-gyre fonts by default ... - -\definetypescriptprefix [f:pagella] [pl] \definetypescriptprefix [f:palatino] [pl] -\definetypescriptprefix [f:termes] [tm] \definetypescriptprefix [f:times] [tm] -\definetypescriptprefix [f:heros] [hv] \definetypescriptprefix [f:helvetica] [hv] -\definetypescriptprefix [f:bonum] [bk] \definetypescriptprefix [f:bookman] [bk] -\definetypescriptprefix [f:schola] [cs] \definetypescriptprefix [f:schoolbook] [cs] -\definetypescriptprefix [f:adventor][ag] %definetypescriptprefix [f:adventor] [ag] -\definetypescriptprefix [f:cursor] [cr] \definetypescriptprefix [f:courier] [cr] -\definetypescriptprefix [f:chorus] [zc] \definetypescriptprefix [f:chancery] [zc] % not the full set - -\starttypescript [serif,sans,mono] [pagella,palatino,termes,times,adventor,bonum,bookman,cursor,courier,heros,helvetica,schola,schoolbook] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}r] [encoding=\typescriptthree] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}ri] [encoding=\typescriptthree] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}b] [encoding=\typescriptthree] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}bi] [encoding=\typescriptthree] - \loadmapfile[q\typescriptprefix{f:\typescripttwo}-\typescriptthree.map] -\stoptypescript - -\starttypescript [serif,sans,mono] [pagella,palatino,termes,times,adventor,bonum,bookman,cursor,courier,heros,helvetica,schola,schoolbook] [ec,texnansi,cs,qx,rm,t5,l7x] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Caps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}r-sc] [encoding=\typescriptthree] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-ItalicCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}ri-sc] [encoding=\typescriptthree] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}b-sc] [encoding=\typescriptthree] - \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}bi-sc] [encoding=\typescriptthree] - \loadmapfile[q\typescriptprefix{f:\typescripttwo}-\typescriptthree.map] -\stoptypescript - -\starttypescript [serif] [chorus,chancery] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x] - \definefontsynonym [TeXGyreChorus-MediumItalic] [\typescriptthree-qzcmi] [encoding=\typescriptthree] - \loadmapfile[qzc-\typescriptthree.map] -\stoptypescript - -% bonus definitions - -% when these fonts are in tex live ... -% -% \definefontsynonym [Palatino-Caps] [TeXPalladioL-SC] [encoding=\typescriptthree] -% -% \starttypescript [serif] [palatino] [ec,texnansi] -% \definefontsynonym[TeXPalladioL-BoldItalicOsF][\typescriptthree-fplbij8a][encoding=\typescriptthree] -% \definefontsynonym[TeXPalladioL-BoldOsF] [\typescriptthree-fplbj8a] [encoding=\typescriptthree] -% \definefontsynonym[TeXPalladioL-SC] [\typescriptthree-fplrc8a] [encoding=\typescriptthree] -% \definefontsynonym[TeXPalladioL-ItalicOsF] [\typescriptthree-fplrij8a][encoding=\typescriptthree] -% \loadmapfile[\typescriptthree-urw-palatino.map] -% \stoptypescript - -% Palatino Math (px) - -\starttypescript [math] [palatino] [all] - \definefontsynonym [Palatino-Roman-Upright] [pxr] - \definefontsynonym [Palatino-Roman-Italic] [pxi] - \definefontsynonym [Palatino-Roman-Slanted] [pxsl] - \definefontsynonym [Palatino-Roman-Caps] [pxsc] - \definefontsynonym [Palatino-Companion-Upright] [pcxr] - \definefontsynonym [Palatino-Companion-Italic] [pcxi] - \definefontsynonym [Palatino-Companion-Slanted] [pcxsl] - \definefontsynonym [Palatino-Math-Italic] [pxmi] - \definefontsynonym [Palatino-Math-Symbols] [pxsy] - \definefontsynonym [Palatino-Math-Extension] [pxex] - \definefontsynonym [Palatino-Math-SymbolsA] [pxsya] - \definefontsynonym [Palatino-Math-SymbolsB] [pxsyb] - \definefontsynonym [Palatino-Math-SymbolsC] [pxsyc] - \definefontsynonym [Palatino-Math-Italic-A] [pxmia] - \definefontsynonym [Palatino-Math-Extension-A] [pxexa] - \usemathcollection[default] - \loadmapfile[original-youngryu-px.map] -\stoptypescript - -% Times Math (tx) - -\starttypescript [math] [times] [all] - \definefontsynonym [Times-Roman-Upright] [txr] - \definefontsynonym [Times-Roman-Italic] [txi] - \definefontsynonym [Times-Roman-Slanted] [txsl] - \definefontsynonym [Times-Roman-Caps] [txsc] - \definefontsynonym [Times-Companion-Upright] [tcxr] - \definefontsynonym [Times-Companion-Italic] [tcxi] - \definefontsynonym [Times-Companion-Slanted] [tcxsl] - \definefontsynonym [Times-Math-Italic] [txmi] - \definefontsynonym [Times-Math-Symbols] [txsy] - \definefontsynonym [Times-Math-Extension] [txex] - \definefontsynonym [Times-Math-SymbolsA] [txsya] - \definefontsynonym [Times-Math-SymbolsB] [txsyb] - \definefontsynonym [Times-Math-SymbolsC] [txsyc] - \definefontsynonym [Times-Math-Italic-A] [txmia] - \definefontsynonym [Times-Math-Extension-A] [txexa] - \usemathcollection[default] - \loadmapfile[original-youngryu-tx.map] -\stoptypescript - -%D These are just fallbacks in case anyone stil uses the old names (might also be removed?). - -% -% TeXGyrePagella -% -\starttypescript [serif] [palatino] - \definefontsynonym [Palatino] [TeXGyrePagella-Regular] - \definefontsynonym [Palatino-Italic] [TeXGyrePagella-Italic] - \definefontsynonym [Palatino-Bold] [TeXGyrePagella-Bold] - \definefontsynonym [Palatino-BoldItalic] [TeXGyrePagella-BoldItalic] - \definefontsynonym [Palatino-Slanted] [TeXGyrePagella-Italic] - \definefontsynonym [Palatino-BoldSlanted] [TeXGyrePagella-BoldItalic] - \definefontsynonym [Palatino-Caps] [TeXGyrePagella-Caps] -\stoptypescript -% -% TeXGyreTermes -% -\starttypescript [serif] [times] - \definefontsynonym [Times-Roman] [TeXGyreTermes-Regular] - \definefontsynonym [Times-Italic] [TeXGyreTermes-Italic] - \definefontsynonym [Times-Bold] [TeXGyreTermes-Bold] - \definefontsynonym [Times-BoldItalic] [TeXGyreTermes-BoldItalic] - \definefontsynonym [Times-Slanted] [TeXGyreTermes-Italic] - \definefontsynonym [Times-BoldSlanted] [TeXGyreTermes-BoldItalic] - \definefontsynonym [Times-Caps] [TeXGyreTermes-Caps] -\stoptypescript -% -% TeXGyreHeros -% -\starttypescript [sans] [helvetica] - \definefontsynonym [Helvetica] [TeXGyreHeros-Regular] - \definefontsynonym [Helvetica-Oblique] [TeXGyreHeros-Italic] - \definefontsynonym [Helvetica-Bold] [TeXGyreHeros-Bold] - \definefontsynonym [Helvetica-BoldOblique] [TeXGyreHeros-BoldItalic] - \definefontsynonym [Helvetica-Caps] [TeXGyreHeros-Caps] -\stoptypescript -% -% TeXGyreBonum -% -\starttypescript [serif] [bookman] - \definefontsynonym [Bookman-Light] [TeXGyreBonum-Regular] - \definefontsynonym [Bookman-LightItalic] [TeXGyreBonum-Italic] - \definefontsynonym [Bookman-DemiBold] [TeXGyreBonum-Bold] - \definefontsynonym [Bookman-DemiBoldItalic] [TeXGyreBonum-BoldItalic] - \definefontsynonym [Bookman-LightSlanted] [TeXGyreBonum-Italic] - \definefontsynonym [Bookman-DemiBoldSlanted] [TeXGyreBonum-BoldItalic] - \definefontsynonym [Bookman-Light-Caps] [TeXGyreBonum-Caps] -\stoptypescript -% -% TeXGyreScola -% -\starttypescript [serif] [schoolbook] - \definefontsynonym [Schoolbook-Roman] [TeXGyreScola-Regular] - \definefontsynonym [Schoolbook-Italic] [TeXGyreScola-Italic] - \definefontsynonym [Schoolbook-Bold] [TeXGyreScola-Bold] - \definefontsynonym [Schoolbook-BoldItalic] [TeXGyreScola-BoldItalic] - \definefontsynonym [Schoolbook-Slanted] [TeXGyreScola-Italic] - \definefontsynonym [Schoolbook-BoldSlanted] [TeXGyreScola-BoldItalic] - \definefontsynonym [Schoolbook-Roman-Caps] [TeXGyreScola-Caps] -\stoptypescript -% -% TeXGyreAdventor -% -% -% TeXGyreCursor -% -\starttypescript [mono] [courier] - \definefontsynonym [Courier] [TeXGyreCursor-Regular] - \definefontsynonym [Courier-Bold] [TeXGyreCursor-Bold] - \definefontsynonym [Courier-Oblique] [TeXGyreCursor-Italic] - \definefontsynonym [Courier-BoldOblique] [TeXGyreCursor-BoldItalic] - \fakecontrolspace -\stoptypescript -% -% TeXGyreChorus -% -\starttypescript [calligraphy] [chancery] - \definefontsynonym [Chancery] [TeXGyreChorus-MediumItalic] -\stoptypescript - -\stoptypescriptcollection +\loadmarkfile{type-one} \endinput diff --git a/tex/context/base/type-otf.mkiv b/tex/context/base/type-otf.mkiv index 09ec22856..7ca3e62fb 100644 --- a/tex/context/base/type-otf.mkiv +++ b/tex/context/base/type-otf.mkiv @@ -115,60 +115,6 @@ \definefontsynonym [LMTypewriterVarWd10-DarkOblique] [file:lmmonoproplt10-boldoblique] [features=default] \stoptypescript -% \starttypescript [math] [modern,latin-modern] -% \definefontsynonym [LMMathRoman5-Regular] [rm-lmr5] -% \definefontsynonym [LMMathRoman6-Regular] [rm-lmr6] -% \definefontsynonym [LMMathRoman7-Regular] [rm-lmr7] -% \definefontsynonym [LMMathRoman8-Regular] [rm-lmr8] -% \definefontsynonym [LMMathRoman9-Regular] [rm-lmr9] -% \definefontsynonym [LMMathRoman10-Regular] [rm-lmr10] -% \definefontsynonym [LMMathRoman12-Regular] [rm-lmr12] -% \definefontsynonym [LMMathRoman17-Regular] [rm-lmr17] -% \definefontsynonym [LMMathRoman5-Bold] [rm-lmbx5] -% \definefontsynonym [LMMathRoman6-Bold] [rm-lmbx6] -% \definefontsynonym [LMMathRoman7-Bold] [rm-lmbx7] -% \definefontsynonym [LMMathRoman8-Bold] [rm-lmbx8] -% \definefontsynonym [LMMathRoman9-Bold] [rm-lmbx9] -% \definefontsynonym [LMMathRoman10-Bold] [rm-lmbx10] -% \definefontsynonym [LMMathRoman12-Bold] [rm-lmbx12] -% \definefontsynonym [LMMathSymbols5-BoldItalic] [lmbsy5] -% \definefontsynonym [LMMathSymbols7-BoldItalic] [lmbsy7] -% \definefontsynonym [LMMathSymbols10-BoldItalic][lmbsy10] -% \definefontsynonym [LMMathSymbols5-Italic] [lmsy5] -% \definefontsynonym [LMMathSymbols6-Italic] [lmsy6] -% \definefontsynonym [LMMathSymbols7-Italic] [lmsy7] -% \definefontsynonym [LMMathSymbols8-Italic] [lmsy8] -% \definefontsynonym [LMMathSymbols9-Italic] [lmsy9] -% \definefontsynonym [LMMathSymbols10-Italic] [lmsy10] -% \definefontsynonym [LMMathExtension10-Regular] [lmex10] -% \definefontsynonym [LMMathItalic5-Italic] [lmmi5] -% \definefontsynonym [LMMathItalic6-Italic] [lmmi6] -% \definefontsynonym [LMMathItalic7-Italic] [lmmi7] -% \definefontsynonym [LMMathItalic8-Italic] [lmmi8] -% \definefontsynonym [LMMathItalic9-Italic] [lmmi9] -% \definefontsynonym [LMMathItalic10-Italic] [lmmi10] -% \definefontsynonym [LMMathItalic12-Italic] [lmmi12] -% \definefontsynonym [LMMathItalic5-BoldItalic] [lmmib5] -% \definefontsynonym [LMMathItalic7-BoldItalic] [lmmib7] -% \definefontsynonym [LMMathItalic10-BoldItalic] [lmmib10] -% \loadmapfile[lm-math.map] -% \loadmapfile[lm-rm.map] -% \stoptypescript - -% \starttypescript [math] [modern,computer-modern,latin-modern] -% \definefontsynonym [ComputerModernMath-Roman] [rm-lmr10] -% \definefontsynonym [ComputerModernMath-Extension] [lmex10] -% \definefontsynonym [ComputerModernMath-Italic] [lmmi10] -% \definefontsynonym [ComputerModernMath-Symbol] [lmsy10] -% \stoptypescript - -% \starttypescript [boldmath,bfmath] [modern,computer-modern,latin-modern] -% \definefontsynonym [ComputerModernMath-Roman-Bold] [rm-lmb10] -% \definefontsynonym [ComputerModernMath-Extension] [lmex10] -% \definefontsynonym [ComputerModernMath-Italic-Bold] [lmmib10] -% \definefontsynonym [ComputerModernMath-Symbol-Bold] [lmbsy10] -% \stoptypescript - \starttypescript [math] [modern,latin-modern,computer-modern] \definefontsynonym[LMMathRoman5-Regular] [LMMath5-Regular@lmroman5-math] \definefontsynonym[LMMathRoman6-Regular] [LMMath6-Regular@lmroman6-math] @@ -179,49 +125,24 @@ \definefontsynonym[LMMathRoman12-Regular][LMMath12-Regular@lmroman12-math] \definefontsynonym[LMMathRoman17-Regular][LMMath17-Regular@lmroman17-math] -% \definefontsynonym[LMMathRoman-Regular] [LMMath10-Regular@lmroman10-math] - - \definefontsynonym[MathRoman] [LMMath10-Regular@lmroman10-math] + \definefontsynonym[LMMathRoman5-Bold] [LMMath10-Bold@lmroman10-boldmath] + \definefontsynonym[LMMathRoman6-Bold] [LMMath10-Bold@lmroman10-boldmath] + \definefontsynonym[LMMathRoman7-Bold] [LMMath10-Bold@lmroman10-boldmath] + \definefontsynonym[LMMathRoman8-Bold] [LMMath10-Bold@lmroman10-boldmath] + \definefontsynonym[LMMathRoman9-Bold] [LMMath10-Bold@lmroman10-boldmath] + \definefontsynonym[LMMathRoman10-Bold] [LMMath10-Bold@lmroman10-boldmath] + \definefontsynonym[LMMathRoman12-Bold] [LMMath10-Bold@lmroman10-boldmath] + \definefontsynonym[LMMathRoman17-Bold] [LMMath10-Bold@lmroman10-boldmath] - \definefontsynonym[xcmr12][LMMath12-Regular@lmroman12-math] - \definefontsynonym[xcmr10][LMMath10-Regular@lmroman10-math] - \definefontsynonym[xcmr9] [LMMath9-Regular@lmroman9-math] - \definefontsynonym[xcmr8] [LMMath8-Regular@lmroman8-math] - \definefontsynonym[xcmr7] [LMMath7-Regular@lmroman7-math] - \definefontsynonym[xcmr6] [LMMath6-Regular@lmroman6-math] - \definefontsynonym[xcmr5] [LMMath5-Regular@lmroman5-math] + % are these needed? + % + % \definefontsynonym[MathRoman][LMMath10-Regular@lmroman10-math] + % \definefontsynonym[MathBold] [LMMath10-Bold@lmroman10-boldmath] \loadmapfile[lm-math.map] \loadmapfile[lm-rm.map] \stoptypescript -% Euler (AMS) - -\starttypescript [math] [euler] - \definefontsynonym [Euler-Roman] [zeurm10] - \definefontsynonym [Euler-Extension] [zeuex10] - \definefontsynonym [Euler-Symbol] [zeusm10] - \definefontsynonym [Euler-Fraktur] [eufm10] - - \loadmapfile[original-ams-euler.map] -\stoptypescript - -\starttypescript [boldmath,bfmath] [euler] - \definefontsynonym [Euler-Roman-Bold] [zeurb10] - \definefontsynonym [Euler-Extension] [zeuex10] - \definefontsynonym [Euler-Symbol-Bold] [zeusb10] - \definefontsynonym [Euler-Fraktur-Bold] [eufb10] - - \loadmapfile[original-ams-euler.map] -\stoptypescript - -% AMS (AMS) - -\starttypescript [math] [modern,computer-modern,latin-modern,ams] - \definefontsynonym [AMS-SymbolA] [msam10] - \definefontsynonym [AMS-SymbolB] [msbm10] -\stoptypescript - % TeXGyre \definetypescriptprefix [f:pagella] [pagella] \definetypescriptprefix [f:palatino] [pagella] @@ -254,26 +175,6 @@ % Times Math (tx) -% \starttypescript [math] [times] [all] -% \definefontsynonym [Times-Roman-Upright] [txr] -% \definefontsynonym [Times-Roman-Italic] [txi] -% \definefontsynonym [Times-Roman-Slanted] [txsl] -% \definefontsynonym [Times-Roman-Caps] [txsc] -% \definefontsynonym [Times-Companion-Upright] [tcxr] -% \definefontsynonym [Times-Companion-Italic] [tcxi] -% \definefontsynonym [Times-Companion-Slanted] [tcxsl] -% \definefontsynonym [Times-Math-Italic] [txmi] -% \definefontsynonym [Times-Math-Symbols] [txsy] -% \definefontsynonym [Times-Math-Extension] [txex] -% \definefontsynonym [Times-Math-SymbolsA] [txsya] -% \definefontsynonym [Times-Math-SymbolsB] [txsyb] -% \definefontsynonym [Times-Math-SymbolsC] [txsyc] -% \definefontsynonym [Times-Math-Italic-A] [txmia] -% \definefontsynonym [Times-Math-Extension-A] [txexa] -% \loadmapfile[original-youngryu-tx.map] -% \usemathcollection[default] -% \stoptypescript - \starttypescript [math][times][all] \definefontsynonym[MathRoman][txmath@tx-math] \loadmapfile[original-youngryu-tx.map] @@ -281,26 +182,6 @@ % Palatino Math (px) -% \starttypescript [math] [palatino] [all] -% \definefontsynonym [Palatino-Roman-Upright] [pxr] -% \definefontsynonym [Palatino-Roman-Italic] [pxi] -% \definefontsynonym [Palatino-Roman-Slanted] [pxsl] -% \definefontsynonym [Palatino-Roman-Caps] [pxsc] -% \definefontsynonym [Palatino-Companion-Upright] [pcxr] -% \definefontsynonym [Palatino-Companion-Italic] [pcxi] -% \definefontsynonym [Palatino-Companion-Slanted] [pcxsl] -% \definefontsynonym [Palatino-Math-Italic] [pxmi] -% \definefontsynonym [Palatino-Math-Symbols] [pxsy] -% \definefontsynonym [Palatino-Math-Extension] [pxex] -% \definefontsynonym [Palatino-Math-SymbolsA] [pxsya] -% \definefontsynonym [Palatino-Math-SymbolsB] [pxsyb] -% \definefontsynonym [Palatino-Math-SymbolsC] [pxsyc] -% \definefontsynonym [Palatino-Math-Italic-A] [pxmia] -% \definefontsynonym [Palatino-Math-Extension-A] [pxexa] -% \loadmapfile[original-youngryu-px.map] -% \usemathcollection[default] -% \stoptypescript - \starttypescript [math][palatino][all] \definefontsynonym[MathRoman][pxmath@px-math] \loadmapfile[original-youngryu-px.map] @@ -344,41 +225,41 @@ \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [file:AntykwaTorunskaCondMed-Italic] [features=smallcaps] \stoptypescript -\starttypescript [math] [antykwa-torunska] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-Regular] [rm-anttr] - \definefontsynonym [AntykwaTorunska-Math-Letters-Italic] [mi-anttri] - \definefontsynonym [AntykwaTorunska-Math-Symbols-Regular] [sy-anttrz] - \definefontsynonym [AntykwaTorunska-Math-Extension-Regular] [ex-anttr] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-light] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-Light] [rm-anttl] - \definefontsynonym [AntykwaTorunska-Math-Letters-LightItalic] [mi-anttli] - \definefontsynonym [AntykwaTorunska-Math-Symbols-Light] [sy-anttlz] - \definefontsynonym [AntykwaTorunska-Math-Extension-Light] [ex-anttl] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-cond] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondRegular] [rm-anttcr] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondItalic] [mi-anttcri] - \definefontsynonym [AntykwaTorunska-Math-Symbols-CondRegular] [sy-anttcrz] - \definefontsynonym [AntykwaTorunska-Math-Extension-CondRegular] [ex-anttcr] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-lightcond] [default] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondLight] [rm-anttcl] - \definefontsynonym [AntykwaTorunska-Math-Letters-CondLightItalic] [mi-anttcli] - \definefontsynonym [AntykwaTorunska-Math-Symbols-CondLight] [sy-anttclz] - \definefontsynonym [AntykwaTorunska-Math-Extension-CondLight] [ex-anttcl] -\stoptypescript - -\starttypescript [math] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] - \usemathcollection[default] - \loadmapfile[antt-rm.map] - \loadmapfile[antt-mi.map] - \loadmapfile[antt-sy.map] - \loadmapfile[antt-ex.map] -\stoptypescript +% \starttypescript [math] [antykwa-torunska] [default] +% \definefontsynonym [AntykwaTorunska-Math-Letters-Regular] [rm-anttr] +% \definefontsynonym [AntykwaTorunska-Math-Letters-Italic] [mi-anttri] +% \definefontsynonym [AntykwaTorunska-Math-Symbols-Regular] [sy-anttrz] +% \definefontsynonym [AntykwaTorunska-Math-Extension-Regular] [ex-anttr] +% \stoptypescript +% +% \starttypescript [math] [antykwa-torunska-light] [default] +% \definefontsynonym [AntykwaTorunska-Math-Letters-Light] [rm-anttl] +% \definefontsynonym [AntykwaTorunska-Math-Letters-LightItalic] [mi-anttli] +% \definefontsynonym [AntykwaTorunska-Math-Symbols-Light] [sy-anttlz] +% \definefontsynonym [AntykwaTorunska-Math-Extension-Light] [ex-anttl] +% \stoptypescript +% +% \starttypescript [math] [antykwa-torunska-cond] [default] +% \definefontsynonym [AntykwaTorunska-Math-Letters-CondRegular] [rm-anttcr] +% \definefontsynonym [AntykwaTorunska-Math-Letters-CondItalic] [mi-anttcri] +% \definefontsynonym [AntykwaTorunska-Math-Symbols-CondRegular] [sy-anttcrz] +% \definefontsynonym [AntykwaTorunska-Math-Extension-CondRegular] [ex-anttcr] +% \stoptypescript +% +% \starttypescript [math] [antykwa-torunska-lightcond] [default] +% \definefontsynonym [AntykwaTorunska-Math-Letters-CondLight] [rm-anttcl] +% \definefontsynonym [AntykwaTorunska-Math-Letters-CondLightItalic] [mi-anttcli] +% \definefontsynonym [AntykwaTorunska-Math-Symbols-CondLight] [sy-anttclz] +% \definefontsynonym [AntykwaTorunska-Math-Extension-CondLight] [ex-anttcl] +% \stoptypescript +% +% \starttypescript [math] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] +% \usemathcollection[default] +% \loadmapfile[antt-rm.map] +% \loadmapfile[antt-mi.map] +% \loadmapfile[antt-sy.map] +% \loadmapfile[antt-ex.map] +% \stoptypescript % Antykwa Poltawskiego (GUST) @@ -444,34 +325,6 @@ \stoptypescript -% \starttypescript [math] [iwona] [default] -% \definefontsynonym [Iwona-Math-Letters-Regular] [rm-iwonar] -% \definefontsynonym [Iwona-Math-Letters-Italic] [mi-iwonari] -% \definefontsynonym [Iwona-Math-Symbols-Regular] [sy-iwonarz] -% \definefontsynonym [Iwona-Math-Extension-Regular] [ex-iwonar] -% \stoptypescript - -% \starttypescript [math] [iwona-light] [default] -% \definefontsynonym [Iwona-Math-Letters-Light-Regular] [rm-iwonal] -% \definefontsynonym [Iwona-Math-Letters-Light-Italic] [mi-iwonali] -% \definefontsynonym [Iwona-Math-Symbols-Light] [sy-iwonalz] -% \definefontsynonym [Iwona-Math-Extension-Light] [ex-iwonal] -% \stoptypescript - -% \starttypescript [math] [iwona-medium] [default] -% \definefontsynonym [Iwona-Math-Letters-Medium-Regular][rm-iwonam] -% \definefontsynonym [Iwona-Math-Letters-Medium-Italic] [mi-iwonami] -% \definefontsynonym [Iwona-Math-Symbols-Medium] [sy-iwonamz] -% \definefontsynonym [Iwona-Math-Extension-Medium] [ex-iwonam] -% \stoptypescript - -% \starttypescript [math] [iwona-heavy] [default] -% \definefontsynonym [Iwona-Math-Letters-Heavy-Regular] [rm-iwonah] -% \definefontsynonym [Iwona-Math-Letters-Heavy-Italic] [mi-iwonahi] -% \definefontsynonym [Iwona-Math-Symbols-Heavy] [sy-iwonahz] -% \definefontsynonym [Iwona-Math-Extension-Heavy] [ex-iwonah] -% \stoptypescript - % [all] is redundant \starttypescript [math][iwona][all] @@ -610,9 +463,6 @@ \starttypescript [math] [mathtimes] [all] \definefontsynonym[MathRoman][mathtimes@mathtimes-math] \loadmapfile[mathtime.map] -% \pdfmapline{=mtsyn < mtsyn.pfb} -% \pdfmapline{=mtmiz < mtmiz.pfb} -% \pdfmapline{=mtex < mtex.pfb} \stoptypescript \starttypescript [mathtimes] diff --git a/tex/context/base/type-run.mkii b/tex/context/base/type-run.mkii new file mode 100644 index 000000000..1b64c102e --- /dev/null +++ b/tex/context/base/type-run.mkii @@ -0,0 +1,51 @@ +%D \module +%D [ file=type-run, +%D version=2001.04.20, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\gdef\typetypescript + {\dotripleempty\dotypetypescript} + +\gdef\dotypetypescript[#1][#2][#3]% + {\bgroup + \def\dochecktypescript##1##2% script use + {\doifelsenothing{##1##2} + {\donetrue} + {\ExpandBothAfter\doifcommonelse{##1}{##2}\donetrue\donefalse}} + \edef\typescriptone {\truetypescript{#1}}% + \edef\typescripttwo {\truetypescript{#2}}% + \edef\typescriptthree{\truetypescript{#3}}% + \def\starttypescript + {\bgroup + \obeylines % else we loose the first line due to lookahead + \dotripleempty\dostarttypescript} + \def\dostarttypescript[##1][##2][##3]% + {\long\def\next####1\stoptypescript{\egroup} + \dochecktypescript{##1}\typescriptone \ifdone + \dochecktypescript{##2}\typescripttwo \ifdone + \dochecktypescript{##3}\typescriptthree\ifdone + \def\next% + {\def\stoptypescript{\egroup\type{\stoptypescript}} + % what follows now is quite ugly + \skipfirstverbatimlinefalse + \type{\starttypescript} + \doifsomething{##1}{\type{[##1]}} + \doifsomething{##2}{\type{[##2]}} + \doifsomething{##3}{\type{[##3]}} + \processdisplayverbatim{\stoptypescript}}% + \fi\fi\fi + \next} + \processcommacommand[\typescriptfiles]\ReadFile % \dodousetypescript + \egroup} + +\protect \endinput diff --git a/tex/context/base/type-run.mkiv b/tex/context/base/type-run.mkiv new file mode 100644 index 000000000..1b64c102e --- /dev/null +++ b/tex/context/base/type-run.mkiv @@ -0,0 +1,51 @@ +%D \module +%D [ file=type-run, +%D version=2001.04.20, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Runtime Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\gdef\typetypescript + {\dotripleempty\dotypetypescript} + +\gdef\dotypetypescript[#1][#2][#3]% + {\bgroup + \def\dochecktypescript##1##2% script use + {\doifelsenothing{##1##2} + {\donetrue} + {\ExpandBothAfter\doifcommonelse{##1}{##2}\donetrue\donefalse}} + \edef\typescriptone {\truetypescript{#1}}% + \edef\typescripttwo {\truetypescript{#2}}% + \edef\typescriptthree{\truetypescript{#3}}% + \def\starttypescript + {\bgroup + \obeylines % else we loose the first line due to lookahead + \dotripleempty\dostarttypescript} + \def\dostarttypescript[##1][##2][##3]% + {\long\def\next####1\stoptypescript{\egroup} + \dochecktypescript{##1}\typescriptone \ifdone + \dochecktypescript{##2}\typescripttwo \ifdone + \dochecktypescript{##3}\typescriptthree\ifdone + \def\next% + {\def\stoptypescript{\egroup\type{\stoptypescript}} + % what follows now is quite ugly + \skipfirstverbatimlinefalse + \type{\starttypescript} + \doifsomething{##1}{\type{[##1]}} + \doifsomething{##2}{\type{[##2]}} + \doifsomething{##3}{\type{[##3]}} + \processdisplayverbatim{\stoptypescript}}% + \fi\fi\fi + \next} + \processcommacommand[\typescriptfiles]\ReadFile % \dodousetypescript + \egroup} + +\protect \endinput diff --git a/tex/context/base/type-run.tex b/tex/context/base/type-run.tex deleted file mode 100644 index 1b64c102e..000000000 --- a/tex/context/base/type-run.tex +++ /dev/null @@ -1,51 +0,0 @@ -%D \module -%D [ file=type-run, -%D version=2001.04.20, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Runtime Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\gdef\typetypescript - {\dotripleempty\dotypetypescript} - -\gdef\dotypetypescript[#1][#2][#3]% - {\bgroup - \def\dochecktypescript##1##2% script use - {\doifelsenothing{##1##2} - {\donetrue} - {\ExpandBothAfter\doifcommonelse{##1}{##2}\donetrue\donefalse}} - \edef\typescriptone {\truetypescript{#1}}% - \edef\typescripttwo {\truetypescript{#2}}% - \edef\typescriptthree{\truetypescript{#3}}% - \def\starttypescript - {\bgroup - \obeylines % else we loose the first line due to lookahead - \dotripleempty\dostarttypescript} - \def\dostarttypescript[##1][##2][##3]% - {\long\def\next####1\stoptypescript{\egroup} - \dochecktypescript{##1}\typescriptone \ifdone - \dochecktypescript{##2}\typescripttwo \ifdone - \dochecktypescript{##3}\typescriptthree\ifdone - \def\next% - {\def\stoptypescript{\egroup\type{\stoptypescript}} - % what follows now is quite ugly - \skipfirstverbatimlinefalse - \type{\starttypescript} - \doifsomething{##1}{\type{[##1]}} - \doifsomething{##2}{\type{[##2]}} - \doifsomething{##3}{\type{[##3]}} - \processdisplayverbatim{\stoptypescript}}% - \fi\fi\fi - \next} - \processcommacommand[\typescriptfiles]\ReadFile % \dodousetypescript - \egroup} - -\protect \endinput diff --git a/tex/context/base/type-siz.mkii b/tex/context/base/type-siz.mkii index 0ad737cf2..6bf7f01f4 100644 --- a/tex/context/base/type-siz.mkii +++ b/tex/context/base/type-siz.mkii @@ -245,8 +245,8 @@ % hack to prevent mapping of filenames, watch the space! before % latin modern came aroudn we needed this trick to make sure that % we loaded the raw cmr12 etc instead of the ones mapped onto - % an encoding - + % an encoding (this trick is no longer needed with lm) + % % \definefontsynonym[xcmr12][cmr12 ] % \definefontsynonym[xcmr10][cmr10 ] % \definefontsynonym[xcmr9] [cmr9 ] @@ -255,6 +255,14 @@ % \definefontsynonym[xcmr6] [cmr6 ] % \definefontsynonym[xcmr5] [cmr5 ] + \definefontsynonym[xcmr12][rm-lmr12] + \definefontsynonym[xcmr10][rm-lmr10] + \definefontsynonym[xcmr9] [rm-lmr9] + \definefontsynonym[xcmr8] [rm-lmr8] + \definefontsynonym[xcmr7] [rm-lmr7] + \definefontsynonym[xcmr6] [rm-lmr6] + \definefontsynonym[xcmr5] [rm-lmr5] + \definebodyfont [12pt] [mm] [mr=xcmr12, ex=cmex10 at 12pt, diff --git a/tex/context/base/type-siz.mkiv b/tex/context/base/type-siz.mkiv index 2c234e86a..ab31c415f 100644 --- a/tex/context/base/type-siz.mkiv +++ b/tex/context/base/type-siz.mkiv @@ -13,360 +13,224 @@ \starttypescriptcollection[size-mkiv] -% todo: instead of assuming designsize we will set it explicitly (saves these -% -1000 problems at the lua end) - -% cmr - \starttypescript [serif] [computer-modern] [size] \definebodyfont [12pt] [rm] - [tf=cmr12, - bf=cmbx12, - it=cmti12, - sl=cmsl12, - bi=cmbxti10 at 12pt, - bs=cmbxsl10 at 12pt, - sc=cmcsc10 at 12pt] + [tf=LMRoman12-Regular, + bf=LMRoman12-Bold, + it=LMRoman12-Italic, + sl=LMRoman12-Oblique, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \definebodyfont [11pt] [rm] - [tf=cmr10 at 11pt, - bf=cmbx10 at 11pt, - sl=cmsl10 at 11pt, - it=cmti10 at 11pt, - bi=cmbxti10 at 11pt, - bs=cmbxsl10 at 11pt, - sc=cmcsc10 at 11pt] + [tf=LMRoman10-Regular sa 1, + bf=LMRoman10-Bold sa 1, + it=LMRoman10-Italic sa 1, + sl=LMRoman10-Oblique sa 1, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \definebodyfont [10pt] [rm] - [tf=cmr10, - bf=cmbx10, - it=cmti10, - sl=cmsl10, - bi=cmbxti10, - bs=cmbxsl10, - sc=cmcsc10] + [tf=LMRoman10-Regular, + bf=LMRoman10-Bold, + it=LMRoman10-Italic, + sl=LMRoman10-Oblique, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \definebodyfont [9pt] [rm] - [tf=cmr9, - bf=cmbx9, - it=cmti9, - sl=cmsl9, - bi=cmbxti10 at 9pt, - bs=cmbxsl10 at 9pt, - sc=cmcsc10 at 9pt] + [tf=LMRoman9-Regular, + bf=LMRoman9-Bold, + it=LMRoman9-Italic, + sl=LMRoman9-Oblique, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \definebodyfont [8pt] [rm] - [tf=cmr8, - bf=cmbx8, - it=cmti8, - sl=cmsl8, - bi=cmbxti10 at 8pt, - bs=cmbxsl10 at 8pt, - sc=cmcsc10 at 8pt] + [tf=LMRoman8-Regular, + bf=LMRoman8-Bold, + it=LMRoman8-Italic, + sl=LMRoman8-Oblique, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \definebodyfont [7pt] [rm] - [tf=cmr7, - bf=cmbx7, - it=cmti10 at 7pt, - sl=cmsl10 at 7pt, - bi=cmbxti10 at 7pt, - bs=cmbxsl10 at 7pt, - sc=cmcsc10 at 7pt] + [tf=LMRoman7-Regular, + bf=LMRoman7-Bold, + it=LMRoman7-Italic sa 1, + sl=LMRoman8-Oblique sa 1, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \definebodyfont [6pt] [rm] - [tf=cmr6, - bf=cmbx6, - it=cmti10 at 6pt, - sl=cmsl10 at 6pt, - bi=cmbxti10 at 6pt, - bs=cmbxsl10 at 6pt, - sc=cmcsc10 at 6pt] + [tf=LMRoman6-Regular, + bf=LMRoman6-Bold, + it=LMRoman7-Italic sa 1, + sl=LMRoman8-Oblique sa 1, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \definebodyfont [5pt] [rm] - [tf=cmr5, - bf=cmbx5, - it=cmti10 at 5pt, - sl=cmsl10 at 5pt, - bi=cmbxti10 at 5pt, - bs=cmbxsl10 at 5pt, - sc=cmcsc10 at 5pt] + [tf=LMRoman5-Regular, + bf=LMRoman5-Bold, + it=LMRoman7-Italic sa 1, + sl=LMRoman8-Oblique sa 1, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \definebodyfont [4pt] [rm] - [tf=cmr10 at 4pt, - bf=cmbx10 at 4pt, - it=cmti10 at 4pt, - sl=cmsl10 at 4pt, - bi=cmbxti10 at 4pt, - bs=cmbxsl10 at 4pt, - sc=cmr10 at 4pt] + [tf=LMRoman5-Regular sa 1, + bf=LMRoman5-Bold sa 1, + it=LMRoman7-Italic sa 1, + sl=LMRoman8-Oblique sa 1, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \definebodyfont [14.4pt,17.3pt,20.7pt] [rm] - [tf=cmr12 sa 1, - bf=cmbx12 sa 1, - it=cmti12 sa 1, - sl=cmsl12 sa 1, - bi=cmbxti10 sa 1, - bs=cmbxsl10 sa 1, - sc=cmcsc10 sa 1] + [tf=LMRoman12-Regular sa 1, + bf=LMRoman12-Bold sa 1, + it=LMRoman12-Italic sa 1, + sl=LMRoman12-Oblique sa 1, + bi=LMRoman10-BoldItalic sa 1, + bs=LMRoman10-BoldObliqu sa 1, + sc=LMRoman10-CapsRegular sa 1] \stoptypescript \starttypescript [sans] [computer-modern] [size] \definebodyfont [12pt] [ss] - [tf=cmss12, - bf=cmssbx10 at 12pt, - it=cmssi12, - sl=cmssi12, - bi=cmssbx10 at 12pt, - bs=cmssbx10 at 12pt, - sc=cmss10 at 12pt] + [tf=LMSans12-Regular, + bf=LMSans10-Bold sa 1, + it=LMSans12-Oblique, + sl=LMSans12-Oblique, + bi=LMSans10-BoldOblique sa 1, + bs=LMSans10-BoldOblique sa 1, + sc=LMSans12-Regular] \definebodyfont [11pt] [ss] - [tf=cmss10 at 11pt, - bf=cmssbx10 at 11pt, - it=cmssi10 at 11pt, - sl=cmssi10 at 11pt, - bi=cmssbx10 at 11pt, - bs=cmssbx10 at 11pt, - sc=cmss10 at 11pt] + [tf=LMSans10-Regular sa 1, + bf=LMSans10-Bold sa 1, + it=LMSans10-Oblique sa 1, + sl=LMSans10-Oblique sa 1, + bi=LMSans10-BoldOblique sa 1, + bs=LMSans10-BoldOblique sa 1, + sc=LMSans10-Regular sa 1] \definebodyfont [10pt] [ss] - [tf=cmss10, - bf=cmssbx10, - it=cmssi10, - sl=cmssi10, - bi=cmssbx10, - bs=cmssbx10, - sc=cmss10] + [tf=LMSans10-Regular, + bf=LMSans10-Bold, + it=LMSans10-Oblique, + sl=LMSans10-Oblique, + bi=LMSans10-BoldOblique, + bs=LMSans10-BoldOblique, + sc=LMSans10-Regular] \definebodyfont [9pt] [ss] - [tf=cmss9, - bf=cmssbx10 at 9pt, - it=cmssi9, - sl=cmssi9, - bi=cmssbx10 at 9pt, - bs=cmssbx10 at 9pt, - sc=cmss9] + [tf=LMSans9-Regular, + bf=LMSans10-Bold sa 1, + it=LMSans9-Oblique sa 1, + sl=LMSans9-Oblique sa 1, + bi=LMSans10-BoldOblique sa 1, + bs=LMSans10-BoldOblique sa 1, + sc=LMSans9-Regular] \definebodyfont [8pt] [ss] - [tf=cmss8, - bf=cmssbx10 at 8pt, - it=cmssi8, - sl=cmssi8, - bi=cmssbx10 at 8pt, - bs=cmssbx10 at 8pt, - sc=cmss8] - - \definebodyfont [7pt] [ss] - [tf=cmss10 at 7pt, - bf=cmssbx10 at 7pt, - it=cmssi10 at 7pt, - sl=cmssi10 at 7pt, - bs=cmssbx10 at 7pt, - bi=cmssbx10 at 7pt, - sc=cmss10 at 7pt] - - \definebodyfont [6pt] [ss] - [tf=cmss10 at 6pt, - bf=cmssbx10 at 6pt, - it=cmssi10 at 6pt, - sl=cmssi10 at 6pt, - bs=cmssbx10 at 6pt, - bi=cmssbx10 at 6pt, - sc=cmss10 at 6pt] - - \definebodyfont [5pt] [ss] - [tf=cmss10 at 5pt, - bf=cmssbx10 at 5pt, - it=cmssi10 at 5pt, - sl=cmssi10 at 5pt, - bs=cmssbx10 at 5pt, - bi=cmssbx10 at 5pt, - sc=cmss10 at 5pt] - - \definebodyfont [4pt] [ss] - [tf=cmss10 at 4pt, - bf=cmssbx10 at 4pt, - it=cmssi10 at 4pt, - sl=cmssi10 at 4pt, - bs=cmssbx10 at 4pt, - bi=cmssbx10 at 4pt, - sc=cmss10 at 4pt] + [tf=LMSans8-Regular, + bf=LMSans10-Bold sa 1, + it=LMSans8-Oblique, + sl=LMSans8-Oblique, + bi=LMSans10-BoldOblique sa 1, + bs=LMSans10-BoldOblique sa 1, + sc=LMSans8-Regular] + + \definebodyfont [7pt,6pt,5pt,4pt] [ss] + [tf=LMSans8-Regular sa 1, + bf=LMSans10-Bold sa 1, + it=LMSans8-Oblique sa 1, + sl=LMSans8-Oblique sa 1, + bi=LMSans10-BoldOblique sa 1, + bs=LMSans10-BoldOblique sa 1, + sc=LMSans8-Regular sa 1] \definebodyfont [14.4pt,17.3pt,20.7pt] [ss] - [tf=cmss12 sa 1, - bf=cmssbx10 sa 1, - it=cmssi12 sa 1, - sl=cmssi12 sa 1, - bi=cmssbx10 sa 1, - bs=cmssbx10 sa 1, - sc=cmss12 sa 1] + [tf=LMSans12-Regular sa 1, + bf=LMSans10-Bold sa 1, + it=LMSans12-Oblique sa 1, + sl=LMSans12-Oblique sa 1, + bi=LMSans10-BoldOblique sa 1, + bs=LMSans10-BoldOblique sa 1, + sc=LMSans12-Regular sa 1] \stoptypescript \starttypescript [mono] [computer-modern] [size] \definebodyfont [12pt] [tt] - [tf=cmtt12, - sl=cmsltt10 at 12pt, - it=cmitt10 at 12pt, - sc=cmtcsc10 at 12pt] + [tf=LMTypewriter12-Regular, + it=LMTypewriter10-Italic sa 1, + sl=LMTypewriter10-Oblique sa 1, + bf=LMTypewriter10-Dark sa 1, + bs=LMTypewriter10-DarkOblique sa 1, + sc=LMTypewriter10-CapsRegular sa 1] \definebodyfont [9pt] [tt] - [tf=cmtt9, - sl=cmsltt10 at 9pt, - it=cmitt10 at 9pt, - sc=cmtcsc10 at 9pt] + [tf=LMTypewriter9-Regular, + it=LMTypewriter10-Italic sa 1, + sl=LMTypewriter10-Oblique sa 1, + bf=LMTypewriter10-Dark sa 1, + bs=LMTypewriter10-DarkOblique sa 1, + sc=LMTypewriter10-CapsRegular sa 1] \definebodyfont [8pt] [tt] - [tf=cmtt8, - sl=cmsltt10 at 8pt, - it=cmitt10 at 8pt, - sc=cmtcsc10 at 8pt] + [tf=LMTypewriter8-Regular, + it=LMTypewriter10-Italic sa 1, + sl=LMTypewriter10-Oblique sa 1, + bf=LMTypewriter10-Dark sa 1, + bs=LMTypewriter10-DarkOblique sa 1, + sc=LMTypewriter10-CapsRegular sa 1] \definebodyfont [11pt,10pt,7pt,6pt,5pt,4pt] [tt] - [tf=cmtt10 sa 1, - sl=cmsltt10 sa 1, - it=cmitt10 sa 1, - sc=cmtcsc10 sa 1] + [tf=LMTypewriter10-Regular sa 1, + it=LMTypewriter10-Italic sa 1, + sl=LMTypewriter10-Oblique sa 1, + bf=LMTypewriter10-Dark sa 1, + bs=LMTypewriter10-DarkOblique sa 1, + sc=LMTypewriter10-CapsRegular sa 1] \definebodyfont [14.4pt,17.3pt,20.7pt] [tt] - [tf=cmtt12 sa 1, - sl=cmsltt10 sa 1, - it=cmitt10 sa 1, - sc=cmtcsc10 sa 1] + [tf=LMTypewriter12-Regular sa 1, + it=LMTypewriter10-Italic sa 1, + sl=LMTypewriter10-Oblique sa 1, + bf=LMTypewriter10-Dark sa 1, + bs=LMTypewriter10-DarkOblique sa 1, + sc=LMTypewriter10-CapsRegular sa 1] \stoptypescript \starttypescript [math] [modern,computer-modern,latin-modern] [size] - \definebodyfont [12pt] [mm] - [mr=xcmr12] - - \definebodyfont [11pt] [mm] - [mr=xcmr10 at 11pt] - - \definebodyfont [10pt] [mm] - [mr=xcmr10] - - \definebodyfont [9pt] [mm] - [mr=xcmr9] - - \definebodyfont [8pt] [mm] - [mr=xcmr8] - - \definebodyfont [7pt] [mm] - [mr=xcmr7] - - \definebodyfont [6pt] [mm] - [mr=xcmr6] - - \definebodyfont [5pt] [mm] - [mr=xcmr5] - - \definebodyfont [4pt] [mm] - [mr=xcmr5 at 4pt] - - \definebodyfont [14.4pt,17.3pt,20.7pt] [mm] - [mr=xcmr12 sa 1] - -\stoptypescript - -\starttypescript [boldmath] [modern,computer-modern,latin-modern] [size] - - \definebodyfont [12pt] [mm] [mr=xcmb12] - \definebodyfont [11pt] [mm] [mr=xcmb10 at 11pt] - \definebodyfont [10pt] [mm] [mr=xcmb10] - \definebodyfont [9pt] [mm] [mr=xcmb9] - \definebodyfont [8pt] [mm] [mr=xcmb8] - \definebodyfont [7pt] [mm] [mr=xcmb7] - \definebodyfont [6pt] [mm] [mr=xcmb6] - \definebodyfont [5pt] [mm] [mr=xcmb5] - \definebodyfont [4pt] [mm] [mr=xcmb5 at 4pt] - - \definebodyfont [14.4pt,17.3pt,20.7pt] [mm] [mr=xcmb12 sa 1] - -\stoptypescript - -\starttypescript [math] [euler] [size] - - \definebodyfont [9pt,10pt,11pt,12pt,14.4pt,17.3pt,20.7pt] [mm] - [mr=zeurm10 sa 1, - ex=zeuex10 sa 1, - sy=zeusm10 sa 1, - mi=eufm10 sa 1] - - \definebodyfont [6pt,7pt,8pt] [mm] - [mr=zeurm7 sa 1, - sy=zeusm7 sa 1, - mi=eufm7 sa 1, - ex=zeuex10 sa 1] - - \definebodyfont [5pt] [mm] - [mr=zeurm5, - sy=zeusm5, - mi=eufm5, - ex=zeuex10 at 5pt] - -\stoptypescript - -\starttypescript [bfmath] [euler] [size] - - \definebodyfont [9pt,10pt,11pt,12pt,14.4pt,17.3pt,20.7pt] [mm] - [mrbf=zeurb10 sa 1, - exbf=zeuex10 sa 1, - sybf=zeusb10 sa 1, - mibf=eufb10 sa 1] - - \definebodyfont [6pt,7pt,8pt] [mm] - [mrbf=zeurb7 sa 1, - sybf=zeusb7 sa 1, - mibf=eufb7 sa 1, - exbf=zeuex10 sa 1] - - \definebodyfont [5pt] [mm] - [mrbf=zeurb5, - sybf=zeusb5, - mibf=eufb5, - exbf=zeuex10 at 5pt] - -\stoptypescript - -\starttypescript [boldmath] [euler] [size] - - \definebodyfont [9pt,10pt,11pt,12pt,14.4pt,17.3pt,20.7pt] [mm] - [mr=zeurb10 sa 1, - ex=zeuex10 sa 1, - sy=zeusb10 sa 1, - mi=eufb10 sa 1] - - \definebodyfont [6pt,7pt,8pt] [mm] - [mr=zeurb7 sa 1, - sy=zeusb7 sa 1, - mi=eufb7 sa 1, - ex=zeuex10 sa 1] - - \definebodyfont [5pt] [mm] - [mr=zeurb5, - sy=zeusb5, - mi=eufb5, - ex=zeuex10 at 5pt] - -\stoptypescript - -\starttypescript [math] [times] [size] - - \mapfontsize [5pt] [6.0pt] - \mapfontsize [6pt] [6.8pt] - \mapfontsize [7pt] [7.6pt] - \mapfontsize [8pt] [8.4pt] - \mapfontsize [9pt] [9.2pt] - \mapfontsize [10pt] [10pt] - \mapfontsize [11pt] [10.8pt] - \mapfontsize [12pt] [11.6pt] - \mapfontsize [14.4pt] [13.2pt] + \definebodyfont [12pt] [mm] [mr=LMMathRoman12-Regular sa 1, mb=LMMathRoman12-Bold sa 1] + \definebodyfont [11pt] [mm] [mr=LMMathRoman10-Regular sa 1, mb=LMMathRoman10-Bold sa 1] + \definebodyfont [10pt] [mm] [mr=LMMathRoman10-Regular sa 1, mb=LMMathRoman10-Bold sa 1] + \definebodyfont [9pt] [mm] [mr=LMMathRoman9-Regular sa 1, mb=LMMathRoman9-Bold sa 1] + \definebodyfont [8pt] [mm] [mr=LMMathRoman8-Regular sa 1, mb=LMMathRoman8-Bold sa 1] + \definebodyfont [7pt] [mm] [mr=LMMathRoman7-Regular sa 1, mb=LMMathRoman7-Bold sa 1] + \definebodyfont [6pt] [mm] [mr=LMMathRoman6-Regular sa 1, mb=LMMathRoman6-Bold sa 1] + \definebodyfont [5pt] [mm] [mr=LMMathRoman5-Regular sa 1, mb=LMMathRoman5-Bold sa 1] + \definebodyfont [4pt] [mm] [mr=LMMathRoman5-Regular sa 1, mb=LMMathRoman5-Bold sa 1] + + \definebodyfont [14.4pt,17.3pt,20.7pt] [mm] [mr=LMMathRoman12-Regular sa 1, mb=LMMathRoman12-Bold sa 1] \stoptypescript diff --git a/tex/context/base/type-spe.tex b/tex/context/base/type-spe.tex deleted file mode 100644 index 0fd2abadd..000000000 --- a/tex/context/base/type-spe.tex +++ /dev/null @@ -1,49 +0,0 @@ -%D \module -%D [ file=type-spe, -%D version=2001.04.12, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Special scripts, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% \controlspace -> enco files -% no special, always - -\starttypescriptcollection[special features] - -\starttypescript [mono] [courier,lucida] [special] - \def\controlspace{\getglyph{ComputerModernMono}{\char32}} -\stoptypescript - -\starttypescript [math] [modern,computer-modern,latin-modern,ams] [special] - \usemathcollection[default] -\stoptypescript - -\starttypescript [math,boldmath] [lucida] [special] - \usemathcollection[lbr] -\stoptypescript - -\starttypescript [math] [times] [special] - \usemathcollection[default] -\stoptypescript - -\starttypescript [math] [palatino] [special] - \usemathcollection[default] -\stoptypescript - -\starttypescript [math] [fourier] [special] - \usemathcollection[fou] -\stoptypescript - -\starttypescript [math,boldmath] [euler] [special] - \usemathcollection[eul] -\stoptypescript - -\stoptypescriptcollection - -\endinput diff --git a/tex/context/base/type-syn.tex b/tex/context/base/type-syn.tex deleted file mode 100644 index 554694c6e..000000000 --- a/tex/context/base/type-syn.tex +++ /dev/null @@ -1,880 +0,0 @@ -%D \module -%D [ file=type-syn, -%D version=2001.04.12, -%D title=\CONTEXT\ Typescript Macros, -%D subtitle=Filename scripts, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\starttypescriptcollection[synonyms] - -% Computer Modern Roman : Donald Knuth -% Latin Modern: LM Font Revision Team - -% LM math vs CM math (analysis by Taco): -% -% lmex10.tfm % identical -% lmmi5.tfm % identical -% lmmi6.tfm % identical -% lmmi7.tfm % identical -% lmmi8.tfm % identical -% lmmi9.tfm % identical -% lmmi10.tfm % identical -% lmmi12.tfm % identical -% lmmib10.tfm % identical -% lmsy5.tfm % extra chars: 254,255 (octal) -% lmsy6.tfm % extra chars: 254,255 (octal) -% lmsy7.tfm % extra chars: 254,255 (octal) -% lmsy8.tfm % extra chars: 254,255 (octal) -% lmsy9.tfm % extra chars: 254,255 (octal) -% lmsy10.tfm % extra chars: 254,255 (octal) -% lmbsy10.tfm % extra chars: 254,255 (octal) -% -% From the 'AMS' set: -% -% lmmib5.tfm % identical -% lmmib7.tfm % identical -% lmbsy5.tfm % extra chars: 254,255 (octal) -% lmbsy7.tfm % extra chars: 254,255 (octal) -% -% The two extra characters are: -% -% /lessorequalslant -% /greaterorequalslant - -\starttypescript [serif] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [Serif] [LMRoman-Regular] - \definefontsynonym [SerifBold] [LMRoman-Bold] - \definefontsynonym [SerifItalic] [LMRoman-Italic] - \definefontsynonym [SerifSlanted] [LMRoman-Oblique] - \definefontsynonym [SerifBoldItalic] [LMRoman-BoldItalic] - \definefontsynonym [SerifBoldSlanted] [LMRoman-BoldOblique] - \definefontsynonym [SerifCaps] [LMRoman-CapsRegular] - \definefontsynonym [SerifCapsSlanted] [LMRoman-CapsOblique] -\stoptypescript - -\starttypescript [sans] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [Sans] [LMSans-Regular] - \definefontsynonym [SansBold] [LMSans-Bold] - \definefontsynonym [SansItalic] [LMSans-Oblique] - \definefontsynonym [SansSlanted] [LMSans-Oblique] - \definefontsynonym [SansBoldItalic] [LMSans-BoldOblique] - \definefontsynonym [SansBoldSlanted] [LMSans-BoldOblique] - \definefontsynonym [SansCaps] [LMSans-Regular] - \definefontsynonym [SansCapsSlanted] [LMSans-Oblique] -\stoptypescript - -\starttypescript [mono] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [Mono] [LMTypewriter-Regular] - \definefontsynonym [MonoBold] [LMTypewriter-Dark] - \definefontsynonym [MonoItalic] [LMTypewriter-Italic] - \definefontsynonym [MonoSlanted] [LMTypewriter-Oblique] - \definefontsynonym [MonoBoldItalic] [LMTypewriter-DarkOblique] - \definefontsynonym [MonoBoldSlanted] [LMTypewriter-DarkOblique] - \definefontsynonym [MonoCaps] [LMTypewriter-CapsRegular] - \definefontsynonym [MonoCapsSlanted] [LMTypewriter-CapsOblique] - \definefontsynonym [MonoVariable] [LMTypewriterVarWd-Regular] -\stoptypescript - -\starttypescript [math] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [MathRoman] [LMRoman-Regular] - \definefontsynonym [MathExtension] [LMMathExtension-Regular] - \definefontsynonym [MathItalic] [LMMathItalic-Italic] - \definefontsynonym [MathSymbol] [LMMathSymbols-Italic] -\stoptypescript - -\starttypescript [boldmath] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [MathRoman] [LMRoman-Bold] - \definefontsynonym [MathExtension] [LMMathExtension-Regular] - \definefontsynonym [MathItalic] [LMMathItalic-BoldItalic] - \definefontsynonym [MathSymbol] [LMMathSymbols-BoldItalic] -\stoptypescript - -\starttypescript [bfmath] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [MathRomanBold] [LMRoman-Bold] - \definefontsynonym [MathExtension] [LMMathExtension-Regular] - \definefontsynonym [MathItalicBold] [LMMathItalic-BoldItalic] - \definefontsynonym [MathSymbolBold] [LMMathSymbols-BoldItalic] -\stoptypescript - -\starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] [name] - \definefontsynonym [Serif] [LMTypewriterVarWd-Regular] - \definefontsynonym [SerifBold] [LMTypewriterVarWd-Oblique] - \definefontsynonym [SerifItalic] [LMTypewriterVarWd-Oblique] - \definefontsynonym [SerifSlanted] [LMTypewriterVarWd-Dark] - \definefontsynonym [SerifBoldItalic] [LMTypewriterVarWd-DarkOblique] - \definefontsynonym [SerifBoldSlanted] [LMTypewriterVarWd-DarkOblique] - \definefontsynonym [SerifCaps] [LMTypewriterVarWd-Regular] - \definefontsynonym [SerifCapsSlanted] [LMTypewriterVarWd-Oblique] -\stoptypescript - -\starttypescript [mono] [modern-cond,computer-modern-cond,latin-modern-cond,modern-lightcond,computer-modern-lightcond,latin-modern-lightcond] [name] - \definefontsynonym [Mono] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoBold] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoItalic] [LMTypewriter-LightCondensedOblique] - \definefontsynonym [MonoSlanted] [LMTypewriter-LightCondensedOblique] - \definefontsynonym [MonoBoldItalic] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoBoldSlanted] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoCaps] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoCapsSlanted] [LMTypewriter-LightCondensed] -\stoptypescript - -\starttypescript [mono] [modern-light,computer-modern-light,latin-modern-light] [name] - \definefontsynonym [Mono] [LMTypewriter-Light] - \definefontsynonym [MonoBold] [LMTypewriter-Light] - \definefontsynonym [MonoItalic] [LMTypewriter-LightOblique] - \definefontsynonym [MonoSlanted] [LMTypewriter-LightOblique] - \definefontsynonym [MonoBoldItalic] [LMTypewriter-Light] - \definefontsynonym [MonoBoldSlanted] [LMTypewriter-Light] - \definefontsynonym [MonoCaps] [LMTypewriter-Light] - \definefontsynonym [MonoCapsSlanted] [LMTypewriter-Light] -\stoptypescript - -% This will change some day. - -\starttypescript [math] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [OldStyle] [MathItalic] - \definefontsynonym [Fraktur] [eufm10] - \definefontsynonym [Blackboard] [msbm10] - \definefontsynonym [Gothic] [eufm10] - \definefontsynonym [Calligraphic] [cmsy10] -\stoptypescript - -% Concrete Modern Roman : Donald Knuth - -\starttypescript [serif] [concrete] [name] - \definefontsynonym [Serif] [ComputerConcrete] - \definefontsynonym [SerifBold] [ComputerConcrete] - \definefontsynonym [SerifItalic] [ComputerConcrete-Italic] - \definefontsynonym [SerifSlanted] [ComputerConcrete-Slanted] - \definefontsynonym [SerifBoldItalic] [ComputerConcrete-Italic] - \definefontsynonym [SerifBoldSlanted] [ComputerConcrete-Slanted] - \definefontsynonym [SerifCaps] [ComputerConcrete-Caps] -\stoptypescript - -% Euler : Hermann Zapf - -\starttypescript [math] [euler] [name] - \definefontsynonym [MathRoman] [Euler-Roman] % mr - \definefontsynonym [MathItalic] [Euler-Fraktur] % mi - \definefontsynonym [MathExtension] [Euler-Extension] % ex - \definefontsynonym [MathSymbol] [Euler-Symbol] % sy -\stoptypescript - -\starttypescript [boldmath] [euler] [name] - \definefontsynonym [MathRoman] [Euler-Roman-Bold] % mr - \definefontsynonym [MathItalic] [Euler-Fraktur-Bold] % mi - \definefontsynonym [MathExtension] [Euler-Extension] % ex - \definefontsynonym [MathSymbol] [Euler-Symbol-Bold] % sy -\stoptypescript - -\starttypescript [bfmath] [euler] [name] - \definefontsynonym [MathRomanBold] [Euler-Roman-Bold] % mr - \definefontsynonym [MathItalicBold] [Euler-Fraktur-Bold] % mi - \definefontsynonym [MathExtension] [Euler-Extension] % ex - \definefontsynonym [MathSymbolBold] [Euler-Symbol-Bold] % sy -\stoptypescript - -\starttypescript [math] [euler] [name] - \definefontsynonym [OldStyle] [MathItalic] - \definefontsynonym [Fraktur] [MathItalic] - \definefontsynonym [Gothic] [MathItalic] - \definefontsynonym [Calligraphic] [MathSymbol] -\stoptypescript - -\starttypescript [boldmath] [euler] [name] - \definefontsynonym [OldStyle] [MathItalicBold] - \definefontsynonym [Fraktur] [MathItalicBold] - \definefontsynonym [Gothic] [MathItalicBold] - \definefontsynonym [Calligraphic] [MathSymbolBold] -\stoptypescript - -% American Math Society : Michael Spivak - -\starttypescript [math] [modern,computer-modern,latin-modern,ams] [name] - \definefontsynonym [MathAlpha] [AMS-SymbolA] - \definefontsynonym [MathBeta] [AMS-SymbolB] -\stoptypescript - -% Antykwa Torunska : - -\starttypescript [serif] [antykwa-torunska] [name] - \definefontsynonym [Serif] [AntykwaTorunska-Regular] - \definefontsynonym [SerifBold] [AntykwaTorunska-Bold] - \definefontsynonym [SerifItalic] [AntykwaTorunska-Italic] - \definefontsynonym [SerifSlanted] [AntykwaTorunska-Italic] - \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifCaps] [AntykwaTorunska-Cap] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-light] [name] - \definefontsynonym [Serif] [AntykwaTorunska-Light] - \definefontsynonym [SerifBold] [AntykwaTorunska-Medium] - \definefontsynonym [SerifItalic] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifSlanted] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifCaps] [AntykwaTorunska-LightCap] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-cond] [name] - \definefontsynonym [Serif] [AntykwaTorunska-CondRegular] - \definefontsynonym [SerifBold] [AntykwaTorunska-CondBold] - \definefontsynonym [SerifItalic] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifCaps] [AntykwaTorunska-CondCap] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-lightcond] [name] - \definefontsynonym [Serif] [AntykwaTorunska-CondLight] - \definefontsynonym [SerifBold] [AntykwaTorunska-CondMedium] - \definefontsynonym [SerifItalic] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifCaps] [AntykwaTorunska-CondLightCap] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-Cap] - \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-BoldCap] - \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-ItalicCap] - \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-ItalicCap] - \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-BoldItalicCap] - \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-BoldItalicCap] - \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-Cap] - - \definefontvariant [Serif][osf][Caps] - \definefontvariant [Serif][sc] [Caps] - - \definefontsynonym [SerifRegularLight] [AntykwaTorunska-Light] - \definefontsynonym [SerifBoldLight] [AntykwaTorunska-Medium] - \definefontsynonym [SerifItalicLight] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifCapsLight] [AntykwaTorunska-LightCap] - - \definefontvariant [Serif][lt][Light] - - \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondRegular] - \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondBold] - \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondCap] - - \definefontvariant [Serif][cond][Cond] - -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-light] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-LightCap] - \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-MediumCap] - \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-LightItalicCap] - \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-LightItalicCap] - \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-MedItalicCap] - \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-MedItalicCap] - \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-LightCap] - - \definefontvariant [Serif][osf][Caps] - \definefontvariant [Serif][sc] [Caps] - - \definefontsynonym [SerifRegularDark] [AntykwaTorunska-Regular] - \definefontsynonym [SerifBoldDark] [AntykwaTorunska-Bold] - \definefontsynonym [SerifItalicDark] [AntykwaTorunska-Italic] - \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-Italic] - \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifCapsDark] [AntykwaTorunska-Cap] - - \definefontvariant [Serif][dk][Dark] - - \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondLight] - \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondMedium] - \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondLightCap] - - \definefontvariant [Serif][cond][Cond] - -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-cond] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondCap] - \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondBoldCap] - \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondItalicCap] - \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondItalicCap] - \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondBoldItalicCap] - \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondBoldItalicCap] - \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondCap] - - \definefontvariant [Serif][osf][Caps] - \definefontvariant [Serif][sc] [Caps] - - \definefontsynonym [SerifRegularLight] [AntykwaTorunska-CondLight] - \definefontsynonym [SerifBoldLight] [AntykwaTorunska-CondMedium] - \definefontsynonym [SerifItalicLight] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifCapsLight] [AntykwaTorunska-CondLightCap] - - \definefontvariant [Serif][lt][Light] - - \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Regular] - \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Bold] - \definefontsynonym [SerifItalicExp] [AntykwaTorunska-Italic] - \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-Italic] - \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifCapsExp] [AntykwaTorunska-Cap] - - \definefontvariant [Serif][exp][Exp] - -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-lightcond] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondLightCap] - \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondMediumCap] - \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondLightItalicCap] - \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondLightItalicCap] - \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondMedItalicCap] - \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondMedItalicCap] - \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondLightCap] - - \definefontvariant [Serif][osf][Caps] - \definefontvariant [Serif][sc] [Caps] - - \definefontsynonym [SerifRegularDark] [AntykwaTorunska-CondRegular] - \definefontsynonym [SerifBoldDark] [AntykwaTorunska-CondBold] - \definefontsynonym [SerifItalicDark] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifCapsDark] [AntykwaTorunska-CondCap] - - \definefontvariant [Serif][dk][Dark] - - \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Light] - \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Medium] - \definefontsynonym [SerifItalicExp] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifCapsExp] [AntykwaTorunska-LightCap] - - \definefontvariant [Serif][exp][Exp] - -\stoptypescript - -% maybe no -Regular etc - -\starttypescript [math] [antykwa-torunska-light] [name] - \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Light] - \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-LightItalic] - \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Light] - \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Light] -\stoptypescript - -\starttypescript [math] [antykwa-torunska] [name] - \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Regular] - \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-RegularItalic] - \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Regular] - \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Regular] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-cond] [name] - \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondRegular] - \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondRegularItalic] - \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondRegular] - \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondRegular] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-lightcond] [name] - \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondLight] - \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondLightItalic] - \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondLight] - \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondLight] -\stoptypescript - -% Antykwa Poltawskiego : - -\starttypescript [serif] [antykwa-poltawskiego] [name] - \definefontsynonym [Serif] [AntykwaPoltawskiego-Regular] - \definefontsynonym [SerifBold] [AntykwaPoltawskiego-Bold] - \definefontsynonym [SerifItalic] [AntykwaPoltawskiego-Italic] - \definefontsynonym [SerifSlanted] [AntykwaPoltawskiego-Italic] - \definefontsynonym [SerifBoldItalic] [AntykwaPoltawskiego-Bold] - \definefontsynonym [SerifBoldSlanted] [AntykwaPoltawskiego-Bold] - \definefontsynonym [SerifCaps] [AntykwaPoltawskiego-Regular] -\stoptypescript - -% Baskerville : -% -% \starttypescript [serif] [baskerville] [name] -% \definefontsynonym [Serif] [Baskerville] -% \definefontsynonym [SerifBold] [Baskerville-Bold] -% \definefontsynonym [SerifItalic] [Baskerville-Italic] -% \definefontsynonym [SerifSlanted] [Baskerville-Italic] -% \definefontsynonym [SerifBoldItalic] [Baskerville-BoldItalic] -% \definefontsynonym [SerifBoldSlanted] [Baskerville-BoldItalic] -% \definefontsynonym [SerifCaps] [Baskerville] -% \stoptypescript -% -% % Garamond : -% -% \starttypescript [serif] [garamond] [name] -% \definefontsynonym [Serif] [Garamond-Normal] -% \definefontsynonym [SerifBold] [Garamond] -% \definefontsynonym [SerifItalic] [Garamond-Medium-Italic] -% \definefontsynonym [SerifSlanted] [Garamond-Medium-Italic] -% \definefontsynonym [SerifBoldItalic] [Garamond-Medium-Italic] -% \definefontsynonym [SerifBoldSlanted] [Garamond-Medium-Italic] -% \definefontsynonym [SerifCaps] [Garamond] -% \stoptypescript - -% Iwona - -\starttypescript [sans] [iwona-light] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-Light] - \definefontsynonym [SansItalic] [Iwona-LightItalic] - \definefontsynonym [SansBold] [Iwona-Medium] - \definefontsynonym [SansBoldItalic] [Iwona-MediumItalic] - \definefontsynonym [SansCaps] [Iwona-CapsLight] - \definefontsynonym [SansItalicCaps] [Iwona-CapsLightItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsMedium] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsMediumItalic] -\stoptypescript - -\starttypescript [sans] [iwona-light-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CapsLight] - \definefontsynonym [SansItalic] [Iwona-CapsLightItalic] - \definefontsynonym [SansBold] [Iwona-CapsMedium] - \definefontsynonym [SansBoldItalic] [Iwona-CapsMediumItalic] -\stoptypescript - -\starttypescript [sans] [iwona] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-Regular] - \definefontsynonym [SansItalic] [Iwona-RegularItalic] - \definefontsynonym [SansBold] [Iwona-Bold] - \definefontsynonym [SansBoldItalic] [Iwona-BoldItalic] - \definefontsynonym [SansCaps] [Iwona-CapsRegular] - \definefontsynonym [SansItalicCaps] [Iwona-CapsRegularItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsBold] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsBoldItalic] -\stoptypescript - -\starttypescript [sans] [iwona-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CapsRegular] - \definefontsynonym [SansItalic] [Iwona-CapsRegularItalic] - \definefontsynonym [SansBold] [Iwona-CapsBold] - \definefontsynonym [SansBoldItalic] [Iwona-CapsBoldItalic] -\stoptypescript - -\starttypescript [sans] [iwona-medium] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-Medium] - \definefontsynonym [SansItalic] [Iwona-MediumItalic] - \definefontsynonym [SansBold] [Iwona-Heavy] - \definefontsynonym [SansBoldItalic] [Iwona-HeavyItalic] - \definefontsynonym [SansCaps] [Iwona-CapsHeavy] - \definefontsynonym [SansItalicCaps] [Iwona-CapsMediumItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavyItalic] -\stoptypescript - -\starttypescript [sans] [iwona-medium-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CapsHeavy] - \definefontsynonym [SansItalic] [Iwona-CapsMediumItalic] - \definefontsynonym [SansBold] [Iwona-CapsHeavy] - \definefontsynonym [SansBoldItalic] [Iwona-CapsHeavyItalic] -\stoptypescript - -\starttypescript [sans] [iwona-heavy] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-Heavy] - \definefontsynonym [SansItalic] [Iwona-HeavyItalic] - \definefontsynonym [SansBold] [Iwona-Heavy] - \definefontsynonym [SansBoldItalic] [Iwona-HeavyItalic] - \definefontsynonym [SansCaps] [Iwona-CapsHeavy] - \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavyItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavyItalic] -\stoptypescript - -\starttypescript [sans] [iwona-heavy-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [SansCaps] [Iwona-CapsHeavy] - \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavyItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavyItalic] -\stoptypescript - -\starttypescript [sans] [iwona-light-cond] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CondLight] - \definefontsynonym [SansItalic] [Iwona-CondLightItalic] - \definefontsynonym [SansBold] [Iwona-CondMedium] - \definefontsynonym [SansBoldItalic] [Iwona-CondMediumItalic] - \definefontsynonym [SansCaps] [Iwona-CondCapsLight] - \definefontsynonym [SansItalicCaps] [Iwona-CondCapsLightItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CondCapsMedium] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CondCapsMediumItalic] -\stoptypescript - -\starttypescript [sans] [iwona-light-cond-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CondCapsLight] - \definefontsynonym [SansItalic] [Iwona-CondCapsLightItalic] - \definefontsynonym [SansBold] [Iwona-CondCapsMedium] - \definefontsynonym [SansBoldItalic] [Iwona-CondCapsMediumItalic] -\stoptypescript - -\starttypescript [sans] [iwona-cond] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CondRegular] - \definefontsynonym [SansItalic] [Iwona-CondRegularItalic] - \definefontsynonym [SansBold] [Iwona-CondBold] - \definefontsynonym [SansBoldItalic] [Iwona-CondBoldItalic] - \definefontsynonym [SansCaps] [Iwona-CondCapsRegular] - \definefontsynonym [SansItalicCaps] [Iwona-CondCapsRegularItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CondCapsBold] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CondCapsBoldItalic] -\stoptypescript - -\starttypescript [sans] [iwona-cond-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CondCapsRegular] - \definefontsynonym [SansItalic] [Iwona-CondCapsRegularItalic] - \definefontsynonym [SansBold] [Iwona-CondCapsBold] - \definefontsynonym [SansBoldItalic] [Iwona-CondCapsBoldItalic] -\stoptypescript - -\starttypescript [sans] [iwona-medium-cond] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CondMedium] - \definefontsynonym [SansItalic] [Iwona-CondMediumItalic] - \definefontsynonym [SansBold] [Iwona-CondHeavy] - \definefontsynonym [SansBoldItalic] [Iwona-CondHeavyItalic] - \definefontsynonym [SansCaps] [Iwona-CondCapsHeavy] - \definefontsynonym [SansItalicCaps] [Iwona-CondCapsMediumItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CondCapsHeavy] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CondCapsHeavyItalic] -\stoptypescript - -\starttypescript [sans] [iwona-medium-cond-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CondCapsHeavy] - \definefontsynonym [SansItalic] [Iwona-CondCapsMediumItalic] - \definefontsynonym [SansBold] [Iwona-CondCapsHeavy] - \definefontsynonym [SansBoldItalic] [Iwona-CondCapsHeavyItalic] -\stoptypescript - -\starttypescript [math] [iwona-light] [name] - \definefontsynonym [MathRoman] [Iwona-Math-Letters-Light] - \definefontsynonym [MathItalic] [Iwona-Math-Letters-LightItalic] - \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Light] - \definefontsynonym [MathExtension] [Iwona-Math-Extension-Light] -\stoptypescript - -\starttypescript [math] [iwona] [name] - \definefontsynonym [MathRoman] [Iwona-Math-Letters-Regular] - \definefontsynonym [MathItalic] [Iwona-Math-Letters-RegularItalic] - \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Regular] - \definefontsynonym [MathExtension] [Iwona-Math-Extension-Regular] -\stoptypescript - -\starttypescript [math] [iwona-medium] [name] - \definefontsynonym [MathRoman] [Iwona-Math-Letters-Medium] - \definefontsynonym [MathItalic] [Iwona-Math-Letters-MediumItalic] - \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Medium] - \definefontsynonym [MathExtension] [Iwona-Math-Extension-Medium] -\stoptypescript - -\starttypescript [math] [iwona-heavy] [name] - \definefontsynonym [MathRoman] [Iwona-Math-Letters-Heavy] - \definefontsynonym [MathItalic] [Iwona-Math-Letters-HeavyItalic] - \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Heavy] - \definefontsynonym [MathExtension] [Iwona-Math-Extension-Heavy] -\stoptypescript - -% Kurier - -\starttypescript [sans] [kurier-light] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Kurier-Light] - \definefontsynonym [SansItalic] [Kurier-LightItalic] - \definefontsynonym [SansBold] [Kurier-Medium] - \definefontsynonym [SansBoldItalic] [Kurier-MediumItalic] -\stoptypescript - -\starttypescript [sans] [kurier] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Kurier-Regular] - \definefontsynonym [SansItalic] [Kurier-RegularItalic] - \definefontsynonym [SansBold] [Kurier-Bold] - \definefontsynonym [SansBoldItalic] [Kurier-BoldItalic] -\stoptypescript - -\starttypescript [sans] [kurier-medium] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Kurier-Medium] - \definefontsynonym [SansItalic] [Kurier-MediumItalic] - \definefontsynonym [SansBold] [Kurier-Heavy] - \definefontsynonym [SansBoldItalic] [Kurier-HeavyItalic] -\stoptypescript - -\starttypescript [math] [kurier-light] [name] - \definefontsynonym [MathRoman] [Kurier-Math-Letters-Light] - \definefontsynonym [MathItalic] [Kurier-Math-Letters-LightItalic] - \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Light] - \definefontsynonym [MathExtension] [Kurier-Math-Extension-Light] -\stoptypescript - -\starttypescript [math] [kurier] [name] - \definefontsynonym [MathRoman] [Kurier-Math-Letters-Regular] - \definefontsynonym [MathItalic] [Kurier-Math-Letters-RegularItalic] - \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Regular] - \definefontsynonym [MathExtension] [Kurier-Math-Extension-Regular] -\stoptypescript - -\starttypescript [math] [kurier-medium] [name] - \definefontsynonym [MathRoman] [Kurier-Math-Letters-Medium] - \definefontsynonym [MathItalic] [Kurier-Math-Letters-MediumItalic] - \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Medium] - \definefontsynonym [MathExtension] [Kurier-Math-Extension-Medium] -\stoptypescript - -% Bookman : - -\starttypescript [serif] [bookman] [name] - \definefontsynonym [Serif] [Bookman-Light] - \definefontsynonym [SerifItalic] [Bookman-LightItalic] - \definefontsynonym [SerifBold] [Bookman-DemiBold] - \definefontsynonym [SerifBoldItalic] [Bookman-DemiBoldItalic] - \definefontsynonym [SerifSlanted] [Bookman-LightSlanted] - \definefontsynonym [SerifBoldSlanted] [Bookman-DemiBoldSlanted] - \definefontsynonym [SerifCaps] [Bookman-Light-Caps] -\stoptypescript - -% Chancery : Zapf - -\starttypescript [calligraphy] [chancery] [name] - \definefontsynonym [Calligraphy] [Chancery] -\stoptypescript - -% Schoolbook : - -\starttypescript [serif] [schoolbook] [name] - \definefontsynonym [Serif] [Schoolbook-Roman] - \definefontsynonym [SerifItalic] [Schoolbook-Italic] - \definefontsynonym [SerifBold] [Schoolbook-Bold] - \definefontsynonym [SerifBoldItalic] [Schoolbook-BoldItalic] - \definefontsynonym [SerifSlanted] [Schoolbook-RomanSlanted] - \definefontsynonym [SerifBoldSlanted] [Schoolbook-BoldSlanted] - \definefontsynonym [SerifCaps] [Schoolbook-Roman-Caps] -\stoptypescript - -% Utopia : Adobe - -\starttypescript [serif] [utopia] [name] - \definefontsynonym [Serif] [Utopia-Regular] - \definefontsynonym [SerifItalic] [Utopia-Italic] - \definefontsynonym [SerifBold] [Utopia-Bold] - \definefontsynonym [SerifBoldItalic] [Utopia-BoldItalic] - \definefontsynonym [SerifSlanted] [Utopia-Slanted] - \definefontsynonym [SerifBoldSlanted] [Utopia-BoldSlanted] - \definefontsynonym [SerifCaps] [Utopia-Regular-Caps] -\stoptypescript - -% Fourier : Michael Bovani - -\starttypescript [serif] [fourier] [name] - \definefontsynonym [Serif] [Fourier-Regular] - \definefontsynonym [SerifSlanted] [Fourier-Slanted] - \definefontsynonym [SerifItalic] [Fourier-Italic] - \definefontsynonym [SerifCaps] [Fourier-RegularCaps] - \definefontsynonym [SerifBold] [Fourier-Bold] - \definefontsynonym [SerifBoldSlanted] [Fourier-BoldSlanted] - \definefontsynonym [SerifBoldItalic] [Fourier-BoldItalic] - \definefontsynonym [SerifBoldCaps] [Fourier-BoldCaps] - - \definefontsynonym [Serif-Expert] [Fourier-Regular-Expert] - \definefontsynonym [SerifSlanted-Expert] [Fourier-Slanted-Expert] - \definefontsynonym [SerifItalic-Expert] [Fourier-Italic-Expert] - \definefontsynonym [SerifCaps-Expert] [Fourier-RegularCaps-Expert] - \definefontsynonym [SerifSemiBold-Expert] [Fourier-Semi-Expert] - \definefontsynonym [SerifSemiSlanted-Expert] [Fourier-SemiSlanted-Expert] - \definefontsynonym [SerifSemiItalic-Expert] [Fourier-SemiItalic-Expert] - \definefontsynonym [SerifSemiCaps-Expert] [Fourier-SemiCaps-Expert] - \definefontsynonym [SerifBold-Expert] [Fourier-Bold-Expert] - \definefontsynonym [SerifBoldSlanted-Expert] [Fourier-BoldSlanted-Expert] - \definefontsynonym [SerifBoldItalic-Expert] [Fourier-BoldItalic-Expert] - \definefontsynonym [SerifBlack-Expert] [Fourier-Black-Expert] - - \definefontsynonym [Serif-OldStyle] [Fourier-Regular-OldStyle] - \definefontsynonym [SerifSlanted-OldStyle] [Fourier-Slanted-OldStyle] - \definefontsynonym [SerifItalic-OldStyle] [Fourier-Italic-OldStyle] - \definefontsynonym [SerifCaps-OldStyle] [Fourier-RegularCaps-OldStyle] - \definefontsynonym [SerifSemiBold-OldStyle] [Fourier-Semi-OldStyle] - \definefontsynonym [SerifSemiSlanted-OldStyle] [Fourier-SemiSlanted-OldStyle] - \definefontsynonym [SerifSemiItalic-OldStyle] [Fourier-SemiItalic-OldStyle] - \definefontsynonym [SerifSemiCaps-OldStyle] [Fourier-SemiCaps-OldStyle] - \definefontsynonym [SerifBold-OldStyle] [Fourier-Bold-OldStyle] - \definefontsynonym [SerifBoldSlanted-OldStyle] [Fourier-BoldSlanted-OldStyle] - \definefontsynonym [SerifBoldItalic-OldStyle] [Fourier-BoldItalic-OldStyle] - \definefontsynonym [SerifBlack-OldStyle] [Fourier-Black-OldStyle] - \definefontsynonym [SerifBlackSlanted-OldStyle] [Fourier-BlackSlanted-OldStyle] -\stoptypescript - -\starttypescript [math] [fourier] [name] - \definefontsynonym [MathRoman] [Fourier-Math-Letters] - \definefontsynonym [MathItalic] [Fourier-Math-Letters-Italic] - \definefontsynonym [MathSymbol] [Fourier-Math-Symbols] - \definefontsynonym [MathExtension] [Fourier-Math-Extension] -\stoptypescript - -\starttypescript [math] [fourier] [name] % todo - \definefontsynonym [OldStyle] [Serif-OldStyle] % strange, no oldstyles - \definefontsynonym [Fraktur] [eufm10] - \definefontsynonym [Blackboard] [msbm10] - \definefontsynonym [Gothic] [eufm10] - \definefontsynonym [Calligraphic] [eusm10] -\stoptypescript - -% Charter : - -\starttypescript [serif] [charter] [name] - \definefontsynonym [Serif] [Charter-Roman] - \definefontsynonym [SerifItalic] [Charter-Italic] - \definefontsynonym [SerifBold] [Charter-Bold] - \definefontsynonym [SerifBoldItalic] [Charter-BoldItalic] - \definefontsynonym [SerifSlanted] [Charter-Slanted] - \definefontsynonym [SerifBoldSlanted] [Charter-BoldSlanted] - \definefontsynonym [SerifCaps] [Charter-Roman-Caps] -\stoptypescript - -% Times : - -\starttypescript [serif] [times] [name] - \definefontsynonym [Serif] [Times-Roman] - \definefontsynonym [SerifBold] [Times-Bold] - \definefontsynonym [SerifItalic] [Times-Italic] - \definefontsynonym [SerifSlanted] [Times-Italic] - \definefontsynonym [SerifBoldItalic] [Times-BoldItalic] - \definefontsynonym [SerifBoldSlanted] [Times-BoldItalic] - \definefontsynonym [SerifCaps] [Times-Roman] -\stoptypescript - -\starttypescript [math] [times] [name] - \definefontsynonym [MathRoman] [Times-Roman-Upright] - \definefontsynonym [MathExtension] [Times-Math-Extension] - \definefontsynonym [MathItalic] [Times-Math-Italic] - \definefontsynonym [MathSymbol] [Times-Math-Symbols] - \definefontsynonym [MathAlpha] [Times-Math-SymbolsA] - \definefontsynonym [MathBeta] [Times-Math-SymbolsB] -\stoptypescript - -\starttypescript [math] [times] [name] - \definefontsynonym [OldStyle] [MathItalic] - \definefontsynonym [Fraktur] [eufm10] - \definefontsynonym [Blackboard] [MathBeta] - \definefontsynonym [Gothic] [eufm10] - \definefontsynonym [Calligraphic] [eusm10] -\stoptypescript - -% Helvetica : - -\starttypescript [sans] [helvetica] [name] - \definefontsynonym [Sans] [Helvetica] - \definefontsynonym [SansBold] [Helvetica-Bold] - \definefontsynonym [SansItalic] [Helvetica-Oblique] - \definefontsynonym [SansSlanted] [Helvetica-Oblique] - \definefontsynonym [SansBoldItalic] [Helvetica-BoldOblique] - \definefontsynonym [SansBoldSlanted] [Helvetica-BoldOblique] - \definefontsynonym [SansCaps] [Helvetica] -\stoptypescript - -\starttypescript [math] [helvetica] [name] - \definefontsynonym [MathRoman] [Helvetica-MathRoman] - \definefontsynonym [MathExtension] [Helvetica-MathExtendedSymbols] - \definefontsynonym [MathItalic] [Helvetica-MathItalics] - \definefontsynonym [MathSymbol] [Helvetica-MathSymbols] -\stoptypescript - -% Courier : - -\starttypescript [mono] [courier] [name] - \definefontsynonym [Mono] [Courier] - \definefontsynonym [MonoBold] [Courier-Bold] - \definefontsynonym [MonoItalic] [Courier-Oblique] - \definefontsynonym [MonoSlanted] [Courier-Oblique] - \definefontsynonym [MonoBoldItalic] [Courier-BoldOblique] - \definefontsynonym [MonoBoldSlanted] [Courier-BoldOblique] - \definefontsynonym [MonoCaps] [Courier] -\stoptypescript - -% Palatino : Hermann Zapf / URW - -\starttypescript [serif] [palatino] [name] - \definefontsynonym [Serif] [Palatino] - \definefontsynonym [SerifBold] [Palatino-Bold] - \definefontsynonym [SerifItalic] [Palatino-Italic] - \definefontsynonym [SerifSlanted] [Palatino-Slanted] - \definefontsynonym [SerifBoldItalic] [Palatino-BoldItalic] - \definefontsynonym [SerifBoldSlanted] [Palatino-BoldSlanted] - \definefontsynonym [SerifCaps] [Palatino-Caps] -\stoptypescript - -\starttypescript [math] [palatino] [name] - \definefontsynonym [MathRoman] [Palatino-Roman-Upright] - \definefontsynonym [MathExtension] [Palatino-Math-Extension] - \definefontsynonym [MathItalic] [Palatino-Math-Italic] - \definefontsynonym [MathSymbol] [Palatino-Math-Symbols] - \definefontsynonym [MathAlpha] [Palatino-Math-SymbolsA] - \definefontsynonym [MathBeta] [Palatino-Math-SymbolsB] -\stoptypescript - -\starttypescript [math] [palatino] [name] - \definefontsynonym [OldStyle] [MathItalic] - \definefontsynonym [Fraktur] [eufm10] - \definefontsynonym [Blackboard] [MathBeta] - \definefontsynonym [Gothic] [eufm10] - \definefontsynonym [Calligraphic] [eusm10] -\stoptypescript - -% bonus definitions - -\starttypescript [serif] [palatino] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularOsF] [TeXPalladioL-SC] - \definefontsynonym [SerifItalicOsF] [TeXPalladioL-ItalicOsF] - \definefontsynonym [SerifBoldOsF] [TeXPalladioL-BoldOsF] - \definefontsynonym [SerifBoldItalicOsF][TeXPalladioL-BoldItalicOsF] - \definefontsynonym [SerifCapsOsF] [TeXPalladioL-SC] -\stoptypescript - -\stoptypescriptcollection - -\endinput diff --git a/tex/context/base/type-tmf.mkii b/tex/context/base/type-tmf.mkii new file mode 100644 index 000000000..3c17b0308 --- /dev/null +++ b/tex/context/base/type-tmf.mkii @@ -0,0 +1,1161 @@ +%D \module +%D [ file=type-tmf, +%D version=2007.07.30, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Core \TEX\ Fonts, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\starttypescriptcollection[synonyms] + +% Computer Modern Roman : Donald Knuth +% Latin Modern: LM Font Revision Team + +% LM math vs CM math (analysis by Taco): +% +% lmex10.tfm % identical +% lmmi5.tfm % identical +% lmmi6.tfm % identical +% lmmi7.tfm % identical +% lmmi8.tfm % identical +% lmmi9.tfm % identical +% lmmi10.tfm % identical +% lmmi12.tfm % identical +% lmmib10.tfm % identical +% lmsy5.tfm % extra chars: 254,255 (octal) +% lmsy6.tfm % extra chars: 254,255 (octal) +% lmsy7.tfm % extra chars: 254,255 (octal) +% lmsy8.tfm % extra chars: 254,255 (octal) +% lmsy9.tfm % extra chars: 254,255 (octal) +% lmsy10.tfm % extra chars: 254,255 (octal) +% lmbsy10.tfm % extra chars: 254,255 (octal) +% +% From the 'AMS' set: +% +% lmmib5.tfm % identical +% lmmib7.tfm % identical +% lmbsy5.tfm % extra chars: 254,255 (octal) +% lmbsy7.tfm % extra chars: 254,255 (octal) +% +% The two extra characters are: +% +% /lessorequalslant +% /greaterorequalslant + +\starttypescript [serif] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [Serif] [LMRoman-Regular] + \definefontsynonym [SerifBold] [LMRoman-Bold] + \definefontsynonym [SerifItalic] [LMRoman-Italic] + \definefontsynonym [SerifSlanted] [LMRoman-Oblique] + \definefontsynonym [SerifBoldItalic] [LMRoman-BoldItalic] + \definefontsynonym [SerifBoldSlanted] [LMRoman-BoldOblique] + \definefontsynonym [SerifCaps] [LMRoman-CapsRegular] + \definefontsynonym [SerifCapsSlanted] [LMRoman-CapsOblique] +\stoptypescript + +\starttypescript [sans] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [Sans] [LMSans-Regular] + \definefontsynonym [SansBold] [LMSans-Bold] + \definefontsynonym [SansItalic] [LMSans-Oblique] + \definefontsynonym [SansSlanted] [LMSans-Oblique] + \definefontsynonym [SansBoldItalic] [LMSans-BoldOblique] + \definefontsynonym [SansBoldSlanted] [LMSans-BoldOblique] + \definefontsynonym [SansCaps] [LMSans-Regular] + \definefontsynonym [SansCapsSlanted] [LMSans-Oblique] +\stoptypescript + +\starttypescript [mono] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [Mono] [LMTypewriter-Regular] + \definefontsynonym [MonoBold] [LMTypewriter-Dark] + \definefontsynonym [MonoItalic] [LMTypewriter-Italic] + \definefontsynonym [MonoSlanted] [LMTypewriter-Oblique] + \definefontsynonym [MonoBoldItalic] [LMTypewriter-DarkOblique] + \definefontsynonym [MonoBoldSlanted] [LMTypewriter-DarkOblique] + \definefontsynonym [MonoCaps] [LMTypewriter-CapsRegular] + \definefontsynonym [MonoCapsSlanted] [LMTypewriter-CapsOblique] + \definefontsynonym [MonoVariable] [LMTypewriterVarWd-Regular] +\stoptypescript + +\starttypescript [math] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [MathRoman] [LMMathRoman-Regular] + \definefontsynonym [MathExtension] [LMMathExtension-Regular] + \definefontsynonym [MathItalic] [LMMathItalic-Italic] + \definefontsynonym [MathSymbol] [LMMathSymbols-Italic] +\stoptypescript + +\starttypescript [boldmath] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [MathRoman] [LMMathRoman-Bold] + \definefontsynonym [MathExtension] [LMMathExtension-Regular] + \definefontsynonym [MathItalic] [LMMathItalic-BoldItalic] + \definefontsynonym [MathSymbol] [LMMathSymbols-BoldItalic] +\stoptypescript + +\starttypescript [bfmath] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [MathRomanBold] [LMMathRoman-Bold] + \definefontsynonym [MathExtension] [LMMathExtension-Regular] + \definefontsynonym [MathItalicBold] [LMMathItalic-BoldItalic] + \definefontsynonym [MathSymbolBold] [LMMathSymbols-BoldItalic] +\stoptypescript + +\starttypescript [math,boldmath,bfmath] [modern,computer-modern,latin-modern] [name] + \usemathcollection[default] +\stoptypescript + +\starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] [name] + \definefontsynonym [Serif] [LMTypewriterVarWd-Regular] + \definefontsynonym [SerifBold] [LMTypewriterVarWd-Oblique] + \definefontsynonym [SerifItalic] [LMTypewriterVarWd-Oblique] + \definefontsynonym [SerifSlanted] [LMTypewriterVarWd-Dark] + \definefontsynonym [SerifBoldItalic] [LMTypewriterVarWd-DarkOblique] + \definefontsynonym [SerifBoldSlanted] [LMTypewriterVarWd-DarkOblique] + \definefontsynonym [SerifCaps] [LMTypewriterVarWd-Regular] + \definefontsynonym [SerifCapsSlanted] [LMTypewriterVarWd-Oblique] +\stoptypescript + +\starttypescript [mono] [modern-cond,computer-modern-cond,latin-modern-cond,modern-lightcond,computer-modern-lightcond,latin-modern-lightcond] [name] + \definefontsynonym [Mono] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoBold] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoItalic] [LMTypewriter-LightCondensedOblique] + \definefontsynonym [MonoSlanted] [LMTypewriter-LightCondensedOblique] + \definefontsynonym [MonoBoldItalic] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoBoldSlanted] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoCaps] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoCapsSlanted] [LMTypewriter-LightCondensed] +\stoptypescript + +\starttypescript [mono] [modern-light,computer-modern-light,latin-modern-light] [name] + \definefontsynonym [Mono] [LMTypewriter-Light] + \definefontsynonym [MonoBold] [LMTypewriter-Light] + \definefontsynonym [MonoItalic] [LMTypewriter-LightOblique] + \definefontsynonym [MonoSlanted] [LMTypewriter-LightOblique] + \definefontsynonym [MonoBoldItalic] [LMTypewriter-Light] + \definefontsynonym [MonoBoldSlanted] [LMTypewriter-Light] + \definefontsynonym [MonoCaps] [LMTypewriter-Light] + \definefontsynonym [MonoCapsSlanted] [LMTypewriter-Light] +\stoptypescript + +% Later we will map the real fonts, here we just map synonyms. + +\starttypescript [serif] [modern,latin-modern] + \definefontsynonym [LMRoman-DemiOblique] [LMRoman10-DemiOblique] + \definefontsynonym [LMRoman-Bold] [LMRoman10-Bold] + \definefontsynonym [LMRoman-BoldItalic] [LMRoman10-BoldItalic] + \definefontsynonym [LMRoman-BoldOblique] [LMRoman10-BoldOblique] + \definefontsynonym [LMRoman-CapsRegular] [LMRoman10-CapsRegular] + \definefontsynonym [LMRoman-CapsOblique] [LMRoman10-CapsOblique] + \definefontsynonym [LMRoman-Regular] [LMRoman10-Regular] + \definefontsynonym [LMRoman-Italic] [LMRoman10-Italic] + \definefontsynonym [LMRoman-Oblique] [LMRoman10-Oblique] +\stoptypescript + +\starttypescript [sans] [modern,latin-modern] + \definefontsynonym [LMSans-Regular] [LMSans10-Regular] + \definefontsynonym [LMSans-BoldOblique] [LMSans10-BoldOblique] + \definefontsynonym [LMSans-Bold] [LMSans10-Bold] + \definefontsynonym [LMSans-DemiCondensed] [LMSans10-DemiCondensed] + \definefontsynonym [LMSans-DemiCondensedOblique] [LMSans10-DemiCondensedOblique] + \definefontsynonym [LMSans-Oblique] [LMSans10-Oblique] +\stoptypescript + +\starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond] + \definefontsynonym [LMTypewriter-CapsRegular] [LMTypewriter10-CapsRegular] + \definefontsynonym [LMTypewriter-CapsOblique] [LMTypewriter10-CapsOblique] + \definefontsynonym [LMTypewriter-Light] [LMTypewriter10-Light] + \definefontsynonym [LMTypewriter-LightOblique] [LMTypewriter10-LightOblique] + \definefontsynonym [LMTypewriter-LightCondensed] [LMTypewriter10-LightCondensed] + \definefontsynonym [LMTypewriter-LightCondensedOblique] [LMTypewriter10-LightCondensedOblique] + \definefontsynonym [LMTypewriter-Dark] [LMTypewriter10-Dark] + \definefontsynonym [LMTypewriter-DarkOblique] [LMTypewriter10-DarkOblique] + \definefontsynonym [LMTypewriter-Regular] [LMTypewriter10-Regular] + \definefontsynonym [LMTypewriter-Italic] [LMTypewriter10-Italic] + \definefontsynonym [LMTypewriter-Oblique] [LMTypewriter10-Oblique] + \definefontsynonym [LMTypewriterVarWd-Regular] [LMTypewriterVarWd10-Regular] + \definefontsynonym [LMTypewriterVarWd-Oblique] [LMTypewriterVarWd10-Oblique] + \definefontsynonym [LMTypewriterVarWd-Light] [LMTypewriterVarWd10-Light] + \definefontsynonym [LMTypewriterVarWd-LightOblique] [LMTypewriterVarWd10-LightOblique] + \definefontsynonym [LMTypewriterVarWd-Dark] [LMTypewriterVarWd10-Dark] + \definefontsynonym [LMTypewriterVarWd-DarkOblique] [LMTypewriterVarWd10-DarkOblique] +\stoptypescript + +\starttypescript [serif] [modern,computer-modern,latin-modern] + \definefontsynonym [ComputerModern] [LMRoman-Regular] + \definefontsynonym [ComputerModern-Italic] [LMRoman-Italic] + \definefontsynonym [ComputerModern-Slanted] [LMRoman-Oblique] + \definefontsynonym [ComputerModern-Bold] [LMRoman-Bold] + \definefontsynonym [ComputerModern-BoldItalic] [LMRoman-BoldItalic] + \definefontsynonym [ComputerModern-BoldSlanted] [LMRoman-BoldOblique] + \definefontsynonym [ComputerModern-Caps] [LMRoman-CapsRegular] + \definefontsynonym [ComputerModern-CapsSlanted] [LMRoman-CapsOblique] +\stoptypescript + +\starttypescript [sans] [modern,computer-modern,latin-modern] + \definefontsynonym [ComputerModernSans] [LMSans-Regular] + \definefontsynonym [ComputerModernSans-Italic] [LMSans-Oblique] + \definefontsynonym [ComputerModernSans-Slanted] [LMSans-Oblique] + \definefontsynonym [ComputerModernSans-Bold] [LMSans-Bold] + \definefontsynonym [ComputerModernSans-BoldItalic] [LMSans-BoldOblique] + \definefontsynonym [ComputerModernSans-BoldSlanted] [LMSans-BoldOblique] + \definefontsynonym [ComputerModernSans-Caps] [LMSans-Regular] % [LMSans-CapsRegular] + \definefontsynonym [ComputerModernSans-CapsSlanted] [LMSans-Oblique] % [LMSans-CapsOblique] +\stoptypescript + +\starttypescript [mono] [modern,computer-modern,latin-modern] + \definefontsynonym [ComputerModernMono] [LMTypewriter-Regular] + \definefontsynonym [ComputerModernMono-Italic] [LMTypewriter-Italic] + \definefontsynonym [ComputerModernMono-Slanted] [LMTypewriter-Oblique] + \definefontsynonym [ComputerModernMono-Bold] [LMTypewriter-Dark] + \definefontsynonym [ComputerModernMono-BoldItalic] [LMTypewriter-DarkOblique] % ! + \definefontsynonym [ComputerModernMono-BoldSlanted] [LMTypewriter-DarkOblique] + \definefontsynonym [ComputerModernMono-Caps] [LMTypewriter-CapsRegular] + \definefontsynonym [ComputerModernMono-CapsSlanted] [LMTypewriter-CapsOblique] + \definefontsynonym [ComputerModernMono-Variable] [LMTypewriterVarWd-Regular] +\stoptypescript + +\starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] + \definefontsynonym [ComputerModernVariable] [LMTypewriterVarWd-Regular] + \definefontsynonym [ComputerModernVariable-Italic] [LMTypewriterVarWd-Oblique] + \definefontsynonym [ComputerModernVariable-Slanted] [LMTypewriterVarWd-Oblique] + \definefontsynonym [ComputerModernVariable-Bold] [LMTypewriterVarWd-Dark] + \definefontsynonym [ComputerModernVariable-BoldItalic] [LMTypewriterVarWd-DarkOblique] + \definefontsynonym [ComputerModernVariable-BoldSlanted] [LMTypewriterVarWd-DarkOblique] + \definefontsynonym [ComputerModernVariable-Caps] [LMTypewriterVarWd-Regular] + \definefontsynonym [ComputerModernVariable-CapsSlanted] [LMTypewriterVarWd-Oblique] +\stoptypescript + +\starttypescript [math] [modern,latin-modern] + \definefontsynonym [LMMathRoman-Regular] [LMMathRoman10-Regular] + \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold] + \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic] + \definefontsynonym [LMMathSymbols-Italic] [LMMathSymbols10-Italic] + \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular] + \definefontsynonym [LMMathItalic-Italic] [LMMathItalic10-Italic] + \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic] +\stoptypescript + +% can boldmath and bfmath be joined? +\starttypescript [boldmath] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold] + \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular] + \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic] + \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic] +\stoptypescript + +\starttypescript [bfmath] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold] + \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular] + \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic] + \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic] +\stoptypescript + +\starttypescript [serif] [modern,latin-modern,computer-modern] + \definefontsynonym [cmr5] [LMRoman5-Regular] + \definefontsynonym [cmr6] [LMRoman6-Regular] + \definefontsynonym [cmr7] [LMRoman7-Regular] + \definefontsynonym [cmr8] [LMRoman8-Regular] + \definefontsynonym [cmr9] [LMRoman9-Regular] + \definefontsynonym [cmr10] [LMRoman10-Regular] + \definefontsynonym [cmr12] [LMRoman12-Regular] + \definefontsynonym [cmr17] [LMRoman17-Regular] + \definefontsynonym [cmbx5] [LMRoman5-Bold] + \definefontsynonym [cmbx6] [LMRoman6-Bold] + \definefontsynonym [cmbx7] [LMRoman7-Bold] + \definefontsynonym [cmbx8] [LMRoman8-Bold] + \definefontsynonym [cmbx9] [LMRoman9-Bold] + \definefontsynonym [cmbx10] [LMRoman10-Bold] + \definefontsynonym [cmbx12] [LMRoman12-Bold] + \definefontsynonym [cmsl10] [LMRoman10-Oblique] + \definefontsynonym [cmsl12] [LMRoman12-Oblique] + \definefontsynonym [cmsl17] [LMRoman17-Oblique] + \definefontsynonym [cmsl8] [LMRoman8-Oblique] + \definefontsynonym [cmsl9] [LMRoman9-Oblique] + \definefontsynonym [cmti7] [LMRoman7-Italic] + \definefontsynonym [cmti8] [LMRoman8-Italic] + \definefontsynonym [cmti9] [LMRoman9-Italic] + \definefontsynonym [cmti10] [LMRoman10-Italic] + \definefontsynonym [cmti12] [LMRoman12-Italic] + \definefontsynonym [cmbsl10] [LMRoman10-DemiOblique] + \definefontsynonym [cmbxsl10] [LMRoman10-BoldOblique] + \definefontsynonym [cmbxti10] [LMRoman10-BoldItalic] + \definefontsynonym [cmcsc10] [LMRoman10-CapsRegular] + \definefontsynonym [cmcscsl10][LMRoman10-CapsOblique] + + %definefontsynonym [cmb10] +\stoptypescript + +\starttypescript [sans] [modern,latin-modern,computer-modern] + \definefontsynonym [cmss8] [LMSans8-Regular] + \definefontsynonym [cmss9] [LMSans9-Regular] + \definefontsynonym [cmss10] [LMSans10-Regular] + \definefontsynonym [cmss12] [LMSans12-Regular] + \definefontsynonym [cmss17] [LMSans17-Regular] + \definefontsynonym [cmssi10] [LMSans10-Oblique] + \definefontsynonym [cmssi12] [LMSans12-Oblique] + \definefontsynonym [cmssi17] [LMSans17-Oblique] + \definefontsynonym [cmssi8] [LMSans8-Oblique] + \definefontsynonym [cmssi9] [LMSans9-Oblique] + \definefontsynonym [cmssq8] [LMSansQuotation8-Regular] + \definefontsynonym [cmssqb8] [LMSansQuotation8-Bold] + \definefontsynonym [cmssqbi8] [LMSansQuotation8-BoldOblique] + \definefontsynonym [cmssqi8] [LMSansQuotation8-Oblique] + \definefontsynonym [cmssbx10] [LMSans10-Bold] + \definefontsynonym [cmssdc10] [LMSans10-DemiCondensed] + \definefontsynonym [cmssbi10] [LMSans10-BoldOblique] + \definefontsynonym [cmssdi10] [LMSans10-DemiCondensedOblique] +\stoptypescript + +\starttypescript [mono] [modern,latin-modern,computer-modern] + \definefontsynonym [cmtt8] [LMTypewriter8-Regular] + \definefontsynonym [cmtt9] [LMTypewriter9-Regular] + \definefontsynonym [cmtt10] [LMTypewriter10-Regular] + \definefontsynonym [cmtt12] [LMTypewriter12-Regular] + \definefontsynonym [cmitt10] [LMTypewriter10-Italic] + \definefontsynonym [cmsltt10] [LMTypewriter10-Oblique] + \definefontsynonym [cmvtt10] [LMTypewriterVarWd10-Regular] + \definefontsynonym [cmvtti10] [LMTypewriterVarWd10-Oblique] + \definefontsynonym [cmtcsc10] [LMTypewriter10-CapsRegular] +\stoptypescript + +\starttypescript [math] [modern,latin-modern,computer-modern] + \definefontsynonym [cmbsy5] [LMMathSymbols5-BoldItalic] + \definefontsynonym [cmbsy7] [LMMathSymbols7-BoldItalic] + \definefontsynonym [cmbsy10] [LMMathSymbols10-BoldItalic] + \definefontsynonym [cmsy5] [LMMathSymbols5-Italic] + \definefontsynonym [cmsy6] [LMMathSymbols6-Italic] + \definefontsynonym [cmsy7] [LMMathSymbols7-Italic] + \definefontsynonym [cmsy8] [LMMathSymbols8-Italic] + \definefontsynonym [cmsy9] [LMMathSymbols9-Italic] + \definefontsynonym [cmsy10] [LMMathSymbols10-Italic] + \definefontsynonym [cmex10] [LMMathExtension10-Regular] + \definefontsynonym [cmmi5] [LMMathItalic5-Italic] + \definefontsynonym [cmmi6] [LMMathItalic6-Italic] + \definefontsynonym [cmmi7] [LMMathItalic7-Italic] + \definefontsynonym [cmmi8] [LMMathItalic8-Italic] + \definefontsynonym [cmmi9] [LMMathItalic9-Italic] + \definefontsynonym [cmmi10] [LMMathItalic10-Italic] + \definefontsynonym [cmmi12] [LMMathItalic12-Italic] + \definefontsynonym [cmmib5] [LMMathItalic5-BoldItalic] + \definefontsynonym [cmmib7] [LMMathItalic7-BoldItalic] + \definefontsynonym [cmmib10] [LMMathItalic10-BoldItalic] +\stoptypescript + +% This will change some day. + +\starttypescript [math] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [OldStyle] [MathItalic] + \definefontsynonym [Fraktur] [eufm10] + \definefontsynonym [Blackboard] [msbm10] + \definefontsynonym [Gothic] [eufm10] + \definefontsynonym [Calligraphic] [cmsy10] +\stoptypescript + +% Concrete Modern Roman : Donald Knuth + +\starttypescript [serif] [concrete] [name] + \definefontsynonym [Serif] [ComputerConcrete] + \definefontsynonym [SerifBold] [ComputerConcrete] + \definefontsynonym [SerifItalic] [ComputerConcrete-Italic] + \definefontsynonym [SerifSlanted] [ComputerConcrete-Slanted] + \definefontsynonym [SerifBoldItalic] [ComputerConcrete-Italic] + \definefontsynonym [SerifBoldSlanted] [ComputerConcrete-Slanted] + \definefontsynonym [SerifCaps] [ComputerConcrete-Caps] +\stoptypescript + +% Euler : Hermann Zapf + +\starttypescript [math] [euler] [name] + \definefontsynonym [MathRoman] [Euler-Roman] % mr + \definefontsynonym [MathItalic] [Euler-Fraktur] % mi + \definefontsynonym [MathExtension] [Euler-Extension] % ex + \definefontsynonym [MathSymbol] [Euler-Symbol] % sy +\stoptypescript + +\starttypescript [boldmath] [euler] [name] + \definefontsynonym [MathRoman] [Euler-Roman-Bold] % mr + \definefontsynonym [MathItalic] [Euler-Fraktur-Bold] % mi + \definefontsynonym [MathExtension] [Euler-Extension] % ex + \definefontsynonym [MathSymbol] [Euler-Symbol-Bold] % sy +\stoptypescript + +\starttypescript [bfmath] [euler] [name] + \definefontsynonym [MathRomanBold] [Euler-Roman-Bold] % mr + \definefontsynonym [MathItalicBold] [Euler-Fraktur-Bold] % mi + \definefontsynonym [MathExtension] [Euler-Extension] % ex + \definefontsynonym [MathSymbolBold] [Euler-Symbol-Bold] % sy +\stoptypescript + +\starttypescript [math] [euler] [name] + \definefontsynonym [OldStyle] [MathItalic] + \definefontsynonym [Fraktur] [MathItalic] + \definefontsynonym [Gothic] [MathItalic] + \definefontsynonym [Calligraphic] [MathSymbol] +\stoptypescript + +\starttypescript [boldmath] [euler] [name] + \definefontsynonym [OldStyle] [MathItalicBold] + \definefontsynonym [Fraktur] [MathItalicBold] + \definefontsynonym [Gothic] [MathItalicBold] + \definefontsynonym [Calligraphic] [MathSymbolBold] +\stoptypescript + +\starttypescript [math,boldmath,bfmath] [euler] [name] + \usemathcollection[eul] +\stoptypescript + +% American Math Society : Michael Spivak + +\starttypescript [math] [modern,computer-modern,latin-modern,ams] [name] + \definefontsynonym [MathAlpha] [AMS-SymbolA] + \definefontsynonym [MathBeta] [AMS-SymbolB] +\stoptypescript + +% Antykwa Torunska : + +\starttypescript [serif] [antykwa-torunska] [name] + \definefontsynonym [Serif] [AntykwaTorunska-Regular] + \definefontsynonym [SerifBold] [AntykwaTorunska-Bold] + \definefontsynonym [SerifItalic] [AntykwaTorunska-Italic] + \definefontsynonym [SerifSlanted] [AntykwaTorunska-Italic] + \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifCaps] [AntykwaTorunska-Cap] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-light] [name] + \definefontsynonym [Serif] [AntykwaTorunska-Light] + \definefontsynonym [SerifBold] [AntykwaTorunska-Medium] + \definefontsynonym [SerifItalic] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifSlanted] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifCaps] [AntykwaTorunska-LightCap] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-cond] [name] + \definefontsynonym [Serif] [AntykwaTorunska-CondRegular] + \definefontsynonym [SerifBold] [AntykwaTorunska-CondBold] + \definefontsynonym [SerifItalic] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifCaps] [AntykwaTorunska-CondCap] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-lightcond] [name] + \definefontsynonym [Serif] [AntykwaTorunska-CondLight] + \definefontsynonym [SerifBold] [AntykwaTorunska-CondMedium] + \definefontsynonym [SerifItalic] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifCaps] [AntykwaTorunska-CondLightCap] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-Cap] + \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-BoldCap] + \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-ItalicCap] + \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-ItalicCap] + \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-BoldItalicCap] + \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-BoldItalicCap] + \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-Cap] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegularLight] [AntykwaTorunska-Light] + \definefontsynonym [SerifBoldLight] [AntykwaTorunska-Medium] + \definefontsynonym [SerifItalicLight] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifCapsLight] [AntykwaTorunska-LightCap] + + \definefontvariant [Serif][lt][Light] + + \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondRegular] + \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondBold] + \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondCap] + + \definefontvariant [Serif][cond][Cond] + +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-light] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-LightCap] + \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-MediumCap] + \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-LightItalicCap] + \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-LightItalicCap] + \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-MedItalicCap] + \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-MedItalicCap] + \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-LightCap] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegularDark] [AntykwaTorunska-Regular] + \definefontsynonym [SerifBoldDark] [AntykwaTorunska-Bold] + \definefontsynonym [SerifItalicDark] [AntykwaTorunska-Italic] + \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-Italic] + \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifCapsDark] [AntykwaTorunska-Cap] + + \definefontvariant [Serif][dk][Dark] + + \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondLight] + \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondMedium] + \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondLightCap] + + \definefontvariant [Serif][cond][Cond] + +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-cond] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondCap] + \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondBoldCap] + \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondItalicCap] + \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondItalicCap] + \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondBoldItalicCap] + \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondBoldItalicCap] + \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondCap] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegularLight] [AntykwaTorunska-CondLight] + \definefontsynonym [SerifBoldLight] [AntykwaTorunska-CondMedium] + \definefontsynonym [SerifItalicLight] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifCapsLight] [AntykwaTorunska-CondLightCap] + + \definefontvariant [Serif][lt][Light] + + \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Regular] + \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Bold] + \definefontsynonym [SerifItalicExp] [AntykwaTorunska-Italic] + \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-Italic] + \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifCapsExp] [AntykwaTorunska-Cap] + + \definefontvariant [Serif][exp][Exp] + +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-lightcond] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondLightCap] + \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondMediumCap] + \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondLightItalicCap] + \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondLightItalicCap] + \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondMedItalicCap] + \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondMedItalicCap] + \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondLightCap] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegularDark] [AntykwaTorunska-CondRegular] + \definefontsynonym [SerifBoldDark] [AntykwaTorunska-CondBold] + \definefontsynonym [SerifItalicDark] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifCapsDark] [AntykwaTorunska-CondCap] + + \definefontvariant [Serif][dk][Dark] + + \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Light] + \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Medium] + \definefontsynonym [SerifItalicExp] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifCapsExp] [AntykwaTorunska-LightCap] + + \definefontvariant [Serif][exp][Exp] + +\stoptypescript + +% maybe no -Regular etc + +\starttypescript [math] [antykwa-torunska-light] [name] + \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Light] + \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-LightItalic] + \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Light] + \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Light] +\stoptypescript + +\starttypescript [math] [antykwa-torunska] [name] + \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Regular] + \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-Italic] + \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Regular] + \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Regular] +\stoptypescript + +\starttypescript [math] [antykwa-torunska-cond] [name] + \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondRegular] + \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondItalic] + \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondRegular] + \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondRegular] +\stoptypescript + +\starttypescript [math] [antykwa-torunska-lightcond] [name] + \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondLight] + \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondLightItalic] + \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondLight] + \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondLight] +\stoptypescript + +% Antykwa Poltawskiego : + +\starttypescript [serif] [antykwa-poltawskiego] [name] + \definefontsynonym [Serif] [AntykwaPoltawskiego-Regular] + \definefontsynonym [SerifBold] [AntykwaPoltawskiego-Bold] + \definefontsynonym [SerifItalic] [AntykwaPoltawskiego-Italic] + \definefontsynonym [SerifSlanted] [AntykwaPoltawskiego-Italic] + \definefontsynonym [SerifBoldItalic] [AntykwaPoltawskiego-Bold] + \definefontsynonym [SerifBoldSlanted] [AntykwaPoltawskiego-Bold] + \definefontsynonym [SerifCaps] [AntykwaPoltawskiego-Regular] +\stoptypescript + +% Iwona + +\starttypescript [sans] [iwona-light] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-Light-Regular] + \definefontsynonym [SansItalic] [Iwona-Light-Italic] + \definefontsynonym [SansBold] [Iwona-Medium-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-Medium-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsLight] + \definefontsynonym [SansItalicCaps] [Iwona-CapsLightItalic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsMedium] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsMediumItalic] +\stoptypescript + +\starttypescript [sans] [iwona-light-caps] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsLight-Regular] + \definefontsynonym [SansItalic] [Iwona-CapsLight-Italic] + \definefontsynonym [SansBold] [Iwona-CapsMedium-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CapsMedium-Italic] +\stoptypescript + +\starttypescript [sans] [iwona] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-Regular] + \definefontsynonym [SansItalic] [Iwona-Italic] + \definefontsynonym [SansBold] [Iwona-Bold] + \definefontsynonym [SansBoldItalic] [Iwona-BoldItalic] + \definefontsynonym [SansCaps] [Iwona-CapsRegular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsItalic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsBold] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsBoldItalic] +\stoptypescript + +\starttypescript [sans] [iwona-caps] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsRegular] + \definefontsynonym [SansItalic] [Iwona-CapsItalic] + \definefontsynonym [SansBold] [Iwona-CapsBold] + \definefontsynonym [SansBoldItalic] [Iwona-CapsBoldItalic] +\stoptypescript + +\starttypescript [sans] [iwona-medium] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-Medium-Regular] + \definefontsynonym [SansItalic] [Iwona-Medium-Italic] + \definefontsynonym [SansBold] [Iwona-Heavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsMedium-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-medium-caps] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansItalic] [Iwona-CapsMedium-Italic] + \definefontsynonym [SansBold] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CapsHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-heavy] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-Heavy-Regular] + \definefontsynonym [SansItalic] [Iwona-Heavy-Italic] + \definefontsynonym [SansBold] [Iwona-Heavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-heavy-caps] [name] + \setups[font:fallback:sans] + \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-light-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CondLight-Regular] + \definefontsynonym [SansItalic] [Iwona-CondLight-Italic] + \definefontsynonym [SansBold] [Iwona-CondMedium-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CondMedium-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsCondLight-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsCondLight-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsCondMedium-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondMedium-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-light-cond-caps,iwona-light-caps-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsCondLight-Regular] + \definefontsynonym [SansItalic] [Iwona-CapsCondLight-Italic] + \definefontsynonym [SansBold] [Iwona-CapsCondMedium-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CapsCondMedium-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CondRegular] + \definefontsynonym [SansItalic] [Iwona-CondItalic] + \definefontsynonym [SansBold] [Iwona-CondBold] + \definefontsynonym [SansBoldItalic] [Iwona-CondBoldItalic] + \definefontsynonym [SansCaps] [Iwona-CapsCondRegular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsCondItalic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsCondBold] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondBoldItalic] +\stoptypescript + +\starttypescript [sans] [iwona-cond-caps,iwona-caps-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsCondRegular] + \definefontsynonym [SansItalic] [Iwona-CapsCondItalic] + \definefontsynonym [SansBold] [Iwona-CapsCondBold] + \definefontsynonym [SansBoldItalic] [Iwona-CapsCondBoldItalic] +\stoptypescript + +\starttypescript [sans] [iwona-medium-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CondMedium-Regular] + \definefontsynonym [SansItalic] [Iwona-CondMedium-Italic] + \definefontsynonym [SansBold] [Iwona-CondHeavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CondHeavy-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsCondHeavy-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsCondMedium-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsCondHeavy-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-medium-cond-caps,iwona-medium-caps-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsCondHeavy-Regular] + \definefontsynonym [SansItalic] [Iwona-CapsCondMedium-Italic] + \definefontsynonym [SansBold] [Iwona-CapsCondHeavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CapsCondHeavy-Italic] +\stoptypescript + +\starttypescript [math] [iwona-light] [name] + \definefontsynonym [MathRoman] [Iwona-Math-Letters-Light-Regular] + \definefontsynonym [MathItalic] [Iwona-Math-Letters-Light-Italic] + \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Light] + \definefontsynonym [MathExtension] [Iwona-Math-Extension-Light] +\stoptypescript + +\starttypescript [math] [iwona] [name] + \definefontsynonym [MathRoman] [Iwona-Math-Letters-Regular] + \definefontsynonym [MathItalic] [Iwona-Math-Letters-Italic] + \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Regular] + \definefontsynonym [MathExtension] [Iwona-Math-Extension-Regular] +\stoptypescript + +\starttypescript [math] [iwona-medium] [name] + \definefontsynonym [MathRoman] [Iwona-Math-Letters-Medium-Regular] + \definefontsynonym [MathItalic] [Iwona-Math-Letters-Medium-Italic] + \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Medium] + \definefontsynonym [MathExtension] [Iwona-Math-Extension-Medium] +\stoptypescript + +\starttypescript [math] [iwona-heavy] [name] + \definefontsynonym [MathRoman] [Iwona-Math-Letters-Heavy-Regular] + \definefontsynonym [MathItalic] [Iwona-Math-Letters-Heavy-Italic] + \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Heavy] + \definefontsynonym [MathExtension] [Iwona-Math-Extension-Heavy] +\stoptypescript + +% Kurier + +\starttypescript [sans] [kurier-light] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Kurier-Light-Regular] + \definefontsynonym [SansItalic] [Kurier-Light-Italic] + \definefontsynonym [SansBold] [Kurier-Medium-Regular] + \definefontsynonym [SansBoldItalic] [Kurier-Medium-Italic] +\stoptypescript + +\starttypescript [sans] [kurier] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Kurier-Regular] + \definefontsynonym [SansItalic] [Kurier-Italic] + \definefontsynonym [SansBold] [Kurier-Bold] + \definefontsynonym [SansBoldItalic] [Kurier-BoldItalic] +\stoptypescript + +\starttypescript [sans] [kurier-medium] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Kurier-Medium-Regular] + \definefontsynonym [SansItalic] [Kurier-Medium-Italic] + \definefontsynonym [SansBold] [Kurier-Heavy-Regular] + \definefontsynonym [SansBoldItalic] [Kurier-Heavy-Italic] +\stoptypescript + +\starttypescript [math] [kurier-light] [name] + \definefontsynonym [MathRoman] [Kurier-Math-Letters-Light-Regular] + \definefontsynonym [MathItalic] [Kurier-Math-Letters-Light-Italic] + \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Light] + \definefontsynonym [MathExtension] [Kurier-Math-Extension-Light] +\stoptypescript + +\starttypescript [math] [kurier] [name] + \definefontsynonym [MathRoman] [Kurier-Math-Letters-Regular] + \definefontsynonym [MathItalic] [Kurier-Math-Letters-Italic] + \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Regular] + \definefontsynonym [MathExtension] [Kurier-Math-Extension-Regular] +\stoptypescript + +\starttypescript [math] [kurier-medium] [name] + \definefontsynonym [MathRoman] [Kurier-Math-Letters-Medium-Regular] + \definefontsynonym [MathItalic] [Kurier-Math-Letters-Medium-Italic] + \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Medium] + \definefontsynonym [MathExtension] [Kurier-Math-Extension-Medium] +\stoptypescript + +% Bookman : + +\starttypescript [serif] [bookman] [name] + \definefontsynonym [Serif] [Bookman-Light] + \definefontsynonym [SerifItalic] [Bookman-LightItalic] + \definefontsynonym [SerifBold] [Bookman-DemiBold] + \definefontsynonym [SerifBoldItalic] [Bookman-DemiBoldItalic] + \definefontsynonym [SerifSlanted] [Bookman-LightSlanted] + \definefontsynonym [SerifBoldSlanted] [Bookman-DemiBoldSlanted] + \definefontsynonym [SerifCaps] [Bookman-Light-Caps] +\stoptypescript + +% Chancery : Zapf + +\starttypescript [calligraphy] [chancery] [name] + \definefontsynonym [Calligraphy] [Chancery] +\stoptypescript + +% Schoolbook : + +\starttypescript [serif] [schoolbook] [name] + \definefontsynonym [Serif] [Schoolbook-Roman] + \definefontsynonym [SerifItalic] [Schoolbook-Italic] + \definefontsynonym [SerifBold] [Schoolbook-Bold] + \definefontsynonym [SerifBoldItalic] [Schoolbook-BoldItalic] + \definefontsynonym [SerifSlanted] [Schoolbook-RomanSlanted] + \definefontsynonym [SerifBoldSlanted] [Schoolbook-BoldSlanted] + \definefontsynonym [SerifCaps] [Schoolbook-Roman-Caps] +\stoptypescript + +% Utopia : Adobe + +\starttypescript [serif] [utopia] [name] + \definefontsynonym [Serif] [Utopia-Regular] + \definefontsynonym [SerifItalic] [Utopia-Italic] + \definefontsynonym [SerifBold] [Utopia-Bold] + \definefontsynonym [SerifBoldItalic] [Utopia-BoldItalic] + \definefontsynonym [SerifSlanted] [Utopia-Slanted] + \definefontsynonym [SerifBoldSlanted] [Utopia-BoldSlanted] + \definefontsynonym [SerifCaps] [Utopia-Regular-Caps] +\stoptypescript + +% Fourier : Michael Bovani + +\starttypescript [serif] [fourier] [name] + \definefontsynonym [Serif] [Fourier-Regular] + \definefontsynonym [SerifSlanted] [Fourier-Slanted] + \definefontsynonym [SerifItalic] [Fourier-Italic] + \definefontsynonym [SerifCaps] [Fourier-RegularCaps] + \definefontsynonym [SerifBold] [Fourier-Bold] + \definefontsynonym [SerifBoldSlanted] [Fourier-BoldSlanted] + \definefontsynonym [SerifBoldItalic] [Fourier-BoldItalic] + \definefontsynonym [SerifBoldCaps] [Fourier-BoldCaps] + + \definefontsynonym [Serif-Expert] [Fourier-Regular-Expert] + \definefontsynonym [SerifSlanted-Expert] [Fourier-Slanted-Expert] + \definefontsynonym [SerifItalic-Expert] [Fourier-Italic-Expert] + \definefontsynonym [SerifCaps-Expert] [Fourier-RegularCaps-Expert] + \definefontsynonym [SerifSemiBold-Expert] [Fourier-Semi-Expert] + \definefontsynonym [SerifSemiSlanted-Expert] [Fourier-SemiSlanted-Expert] + \definefontsynonym [SerifSemiItalic-Expert] [Fourier-SemiItalic-Expert] + \definefontsynonym [SerifSemiCaps-Expert] [Fourier-SemiCaps-Expert] + \definefontsynonym [SerifBold-Expert] [Fourier-Bold-Expert] + \definefontsynonym [SerifBoldSlanted-Expert] [Fourier-BoldSlanted-Expert] + \definefontsynonym [SerifBoldItalic-Expert] [Fourier-BoldItalic-Expert] + \definefontsynonym [SerifBlack-Expert] [Fourier-Black-Expert] + + \definefontsynonym [Serif-OldStyle] [Fourier-Regular-OldStyle] + \definefontsynonym [SerifSlanted-OldStyle] [Fourier-Slanted-OldStyle] + \definefontsynonym [SerifItalic-OldStyle] [Fourier-Italic-OldStyle] + \definefontsynonym [SerifCaps-OldStyle] [Fourier-RegularCaps-OldStyle] + \definefontsynonym [SerifSemiBold-OldStyle] [Fourier-Semi-OldStyle] + \definefontsynonym [SerifSemiSlanted-OldStyle] [Fourier-SemiSlanted-OldStyle] + \definefontsynonym [SerifSemiItalic-OldStyle] [Fourier-SemiItalic-OldStyle] + \definefontsynonym [SerifSemiCaps-OldStyle] [Fourier-SemiCaps-OldStyle] + \definefontsynonym [SerifBold-OldStyle] [Fourier-Bold-OldStyle] + \definefontsynonym [SerifBoldSlanted-OldStyle] [Fourier-BoldSlanted-OldStyle] + \definefontsynonym [SerifBoldItalic-OldStyle] [Fourier-BoldItalic-OldStyle] + \definefontsynonym [SerifBlack-OldStyle] [Fourier-Black-OldStyle] + \definefontsynonym [SerifBlackSlanted-OldStyle] [Fourier-BlackSlanted-OldStyle] +\stoptypescript + +\starttypescript [math] [fourier] [name] + \definefontsynonym [MathRoman] [Fourier-Math-Letters] + \definefontsynonym [MathItalic] [Fourier-Math-Letters-Italic] + \definefontsynonym [MathSymbol] [Fourier-Math-Symbols] + \definefontsynonym [MathExtension] [Fourier-Math-Extension] +\stoptypescript + +\starttypescript [math] [fourier] [name] % todo + \definefontsynonym [OldStyle] [Serif-OldStyle] % strange, no oldstyles + \definefontsynonym [Fraktur] [eufm10] + \definefontsynonym [Blackboard] [msbm10] + \definefontsynonym [Gothic] [eufm10] + \definefontsynonym [Calligraphic] [eusm10] +\stoptypescript + +% Charter : + +\starttypescript [serif] [charter] [name] + \definefontsynonym [Serif] [Charter-Roman] + \definefontsynonym [SerifItalic] [Charter-Italic] + \definefontsynonym [SerifBold] [Charter-Bold] + \definefontsynonym [SerifBoldItalic] [Charter-BoldItalic] + \definefontsynonym [SerifSlanted] [Charter-Slanted] + \definefontsynonym [SerifBoldSlanted] [Charter-BoldSlanted] + \definefontsynonym [SerifCaps] [Charter-Roman-Caps] +\stoptypescript + +% Times : + +\starttypescript [serif] [times] [name] + \definefontsynonym [Serif] [Times-Roman] + \definefontsynonym [SerifBold] [Times-Bold] + \definefontsynonym [SerifItalic] [Times-Italic] + \definefontsynonym [SerifSlanted] [Times-Italic] + \definefontsynonym [SerifBoldItalic] [Times-BoldItalic] + \definefontsynonym [SerifBoldSlanted] [Times-BoldItalic] + \definefontsynonym [SerifCaps] [Times-Caps] +\stoptypescript + +\starttypescript [math] [times] [name] + \definefontsynonym [MathRoman] [Times-Roman-Upright] + \definefontsynonym [MathExtension] [Times-Math-Extension] + \definefontsynonym [MathItalic] [Times-Math-Italic] + \definefontsynonym [MathSymbol] [Times-Math-Symbols] + \definefontsynonym [MathAlpha] [Times-Math-SymbolsA] + \definefontsynonym [MathBeta] [Times-Math-SymbolsB] +\stoptypescript + +\starttypescript [math] [times] [name] + \definefontsynonym [OldStyle] [MathItalic] + \definefontsynonym [Fraktur] [eufm10] + \definefontsynonym [Blackboard] [MathBeta] + \definefontsynonym [Gothic] [eufm10] + \definefontsynonym [Calligraphic] [eusm10] +\stoptypescript + +% Helvetica : + +\starttypescript [sans] [helvetica] [name] + \definefontsynonym [Sans] [Helvetica] + \definefontsynonym [SansBold] [Helvetica-Bold] + \definefontsynonym [SansItalic] [Helvetica-Oblique] + \definefontsynonym [SansSlanted] [Helvetica-Oblique] + \definefontsynonym [SansBoldItalic] [Helvetica-BoldOblique] + \definefontsynonym [SansBoldSlanted] [Helvetica-BoldOblique] + \definefontsynonym [SansCaps] [Helvetica-Caps] +\stoptypescript + +\starttypescript [math] [helvetica] [name] + \definefontsynonym [MathRoman] [Helvetica-MathRoman] + \definefontsynonym [MathExtension] [Helvetica-MathExtendedSymbols] + \definefontsynonym [MathItalic] [Helvetica-MathItalics] + \definefontsynonym [MathSymbol] [Helvetica-MathSymbols] +\stoptypescript + +% Courier : + +\starttypescript [mono] [courier] [name] + \definefontsynonym [Mono] [Courier] + \definefontsynonym [MonoBold] [Courier-Bold] + \definefontsynonym [MonoItalic] [Courier-Oblique] + \definefontsynonym [MonoSlanted] [Courier-Oblique] + \definefontsynonym [MonoBoldItalic] [Courier-BoldOblique] + \definefontsynonym [MonoBoldSlanted] [Courier-BoldOblique] + \definefontsynonym [MonoCaps] [Courier] +\stoptypescript + +% Palatino : Hermann Zapf / URW + +\starttypescript [serif] [palatino] [name] + \definefontsynonym [Serif] [Palatino] + \definefontsynonym [SerifBold] [Palatino-Bold] + \definefontsynonym [SerifItalic] [Palatino-Italic] + \definefontsynonym [SerifSlanted] [Palatino-Slanted] + \definefontsynonym [SerifBoldItalic] [Palatino-BoldItalic] + \definefontsynonym [SerifBoldSlanted] [Palatino-BoldSlanted] + \definefontsynonym [SerifCaps] [Palatino-Caps] +\stoptypescript + +\starttypescript [math] [palatino] [name] + \definefontsynonym [MathRoman] [Palatino-Roman-Upright] + \definefontsynonym [MathExtension] [Palatino-Math-Extension] + \definefontsynonym [MathItalic] [Palatino-Math-Italic] + \definefontsynonym [MathSymbol] [Palatino-Math-Symbols] + \definefontsynonym [MathAlpha] [Palatino-Math-SymbolsA] + \definefontsynonym [MathBeta] [Palatino-Math-SymbolsB] +\stoptypescript + +\starttypescript [math] [palatino] [name] + \definefontsynonym [OldStyle] [MathItalic] + \definefontsynonym [Fraktur] [eufm10] + \definefontsynonym [Blackboard] [MathBeta] + \definefontsynonym [Gothic] [eufm10] + \definefontsynonym [Calligraphic] [eusm10] +\stoptypescript + +% bonus definitions / will disappear + +\starttypescript [serif] [palatino] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularOsF] [TeXPalladioL-SC] + \definefontsynonym [SerifItalicOsF] [TeXPalladioL-ItalicOsF] + \definefontsynonym [SerifBoldOsF] [TeXPalladioL-BoldOsF] + \definefontsynonym [SerifBoldItalicOsF][TeXPalladioL-BoldItalicOsF] + \definefontsynonym [SerifCapsOsF] [TeXPalladioL-SC] +\stoptypescript + +% TeXGyre + +% name definitions & prefixes + +\definetypescriptprefix [n:pagella] [TeXGyrePagella] \definetypescriptprefix [n:palatino] [TeXGyrePagella] +\definetypescriptprefix [n:termes] [TeXGyreTermes] \definetypescriptprefix [n:times] [TeXGyreTermes] +\definetypescriptprefix [n:heros] [TeXGyreHeros] \definetypescriptprefix [n:helvetica] [TeXGyreHeros] +\definetypescriptprefix [n:bonum] [TeXGyreBonum] \definetypescriptprefix [n:bookman] [TeXGyreBonum] +\definetypescriptprefix [n:schola] [TeXGyreSchola] \definetypescriptprefix [n:schoolbook] [TeXGyreSchola] +\definetypescriptprefix [n:adventor] [TeXGyreAdventor] %definetypescriptprefix [n:adventor] [TeXGyreAdventor] +\definetypescriptprefix [n:cursor] [TeXGyreCursor] \definetypescriptprefix [n:courier] [TeXGyreCursor] +\definetypescriptprefix [n:chorus] [TeXGyreChorus] \definetypescriptprefix [n:chancery] [TeXGyreChorus] % not the full set + +\starttypescript [serif] [pagella,palatino,termes,times,bonum,bookman,schola,schoolbook] [name] + \definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular] + \definefontsynonym [SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic] + \definefontsynonym [SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold] + \definefontsynonym [SerifBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] + \definefontsynonym [SerifSlanted] [SerifItalic] + \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic] + \definefontsynonym [SerifCaps] [\typescriptprefix{n:\typescripttwo}-Caps] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [SerifCaps] + \definefontsynonym [SerifItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps] + \definefontsynonym [SerifBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps] + \definefontsynonym [SerifBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] + \definefontsynonym [SerifSlantedCaps] [SerifItalicCaps] + \definefontsynonym [SerifBoldSlantedCaps] [SerifBoldItalicCaps] + \definefontsynonym [SerifCapsCaps] [SerifCaps] +\stoptypescript + +\starttypescript [serif] [chorus,chancery] [name] + \definefontsynonym [SerifMediumItalic] [TeXGyreChorus-MediumItalic] + \definefontsynonym [Serif] [SerifMediumItalic] + \definefontsynonym [SerifItalic] [SerifMediumItalic] + \definefontsynonym [SerifBold] [SerifMediumItalic] + \definefontsynonym [SerifBoldItalic] [SerifMediumItalic] + \definefontsynonym [SerifSlanted] [SerifMediumItalic] + \definefontsynonym [SerifBoldSlanted] [SerifMediumItalic] + \definefontsynonym [SerifCaps] [SerifMediumItalic] +\stoptypescript + +\starttypescript [calligraphy] [chorus,chancery] [name] + \definefontsynonym [Calligraphy] [TeXGyreChorus-MediumItalic] +\stoptypescript + +\starttypescript [sans] [heros,helvetica,adventor] [name] + \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular] + \definefontsynonym [SansItalic] [\typescriptprefix{n:\typescripttwo}-Italic] + \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold] + \definefontsynonym [SansBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] + \definefontsynonym [SansSlanted] [SansItalic] + \definefontsynonym [SansBoldSlanted] [SansBoldItalic] + \definefontsynonym [SansCaps] [\typescriptprefix{n:\typescripttwo}-Caps] + + \definefontvariant [Sans][osf][Caps] + \definefontvariant [Sans][sc] [Caps] + + \definefontsynonym [SansRegular] [Sans] + \definefontsynonym [SansRegularCaps] [SansCaps] + \definefontsynonym [SansItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps] + \definefontsynonym [SansBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps] + \definefontsynonym [SansBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] + \definefontsynonym [SansSlantedCaps] [SansItalicCaps] + \definefontsynonym [SansBoldSlantedCaps] [SansBoldItalicCaps] + \definefontsynonym [SansCapsCaps] [SansCaps] +\stoptypescript + +\starttypescript [mono] [cursor,courier] [name] + \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular] + \definefontsynonym [MonoItalic] [\typescriptprefix{n:\typescripttwo}-Italic] + \definefontsynonym [MonoBold] [\typescriptprefix{n:\typescripttwo}-Bold] + \definefontsynonym [MonoBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] + \definefontsynonym [MonoSlanted] [MonoItalic] + \definefontsynonym [MonoBoldSlanted] [MonoBoldItalic] + + \definefontvariant [Mono][osf][Caps] + \definefontvariant [Mono][sc] [Caps] + + \definefontsynonym [MonoRegular] [Mono] + \definefontsynonym [MonoRegularCaps] [MonoCaps] + \definefontsynonym [MonoItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps] + \definefontsynonym [MonoBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps] + \definefontsynonym [MonoBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] + \definefontsynonym [MonoSlantedCaps] [MonoItalicCaps] + \definefontsynonym [MonoBoldSlantedCaps] [MonoBoldItalicCaps] + \definefontsynonym [MonoCapsCaps] [MonoCaps] +\stoptypescript + +\stoptypescriptcollection + +\endinput diff --git a/tex/context/base/type-tmf.mkiv b/tex/context/base/type-tmf.mkiv new file mode 100644 index 000000000..df7a180f0 --- /dev/null +++ b/tex/context/base/type-tmf.mkiv @@ -0,0 +1,933 @@ +%D \module +%D [ file=type-tmf, +%D version=2007.07.30, +%D title=\CONTEXT\ Typescript Macros, +%D subtitle=Core \TEX\ Fonts, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\starttypescriptcollection[synonyms] + +\starttypescript [serif] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [Serif] [LMRoman-Regular] + \definefontsynonym [SerifBold] [LMRoman-Bold] + \definefontsynonym [SerifItalic] [LMRoman-Italic] + \definefontsynonym [SerifSlanted] [LMRoman-Oblique] + \definefontsynonym [SerifBoldItalic] [LMRoman-BoldItalic] + \definefontsynonym [SerifBoldSlanted] [LMRoman-BoldOblique] + \definefontsynonym [SerifCaps] [LMRoman-CapsRegular] + \definefontsynonym [SerifCapsSlanted] [LMRoman-CapsOblique] +\stoptypescript + +\starttypescript [sans] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [Sans] [LMSans-Regular] + \definefontsynonym [SansBold] [LMSans-Bold] + \definefontsynonym [SansItalic] [LMSans-Oblique] + \definefontsynonym [SansSlanted] [LMSans-Oblique] + \definefontsynonym [SansBoldItalic] [LMSans-BoldOblique] + \definefontsynonym [SansBoldSlanted] [LMSans-BoldOblique] + \definefontsynonym [SansCaps] [LMSans-Regular] + \definefontsynonym [SansCapsSlanted] [LMSans-Oblique] +\stoptypescript + +\starttypescript [mono] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [Mono] [LMTypewriter-Regular] + \definefontsynonym [MonoBold] [LMTypewriter-Dark] + \definefontsynonym [MonoItalic] [LMTypewriter-Italic] + \definefontsynonym [MonoSlanted] [LMTypewriter-Oblique] + \definefontsynonym [MonoBoldItalic] [LMTypewriter-DarkOblique] + \definefontsynonym [MonoBoldSlanted] [LMTypewriter-DarkOblique] + \definefontsynonym [MonoCaps] [LMTypewriter-CapsRegular] + \definefontsynonym [MonoCapsSlanted] [LMTypewriter-CapsOblique] + \definefontsynonym [MonoVariable] [LMTypewriterVarWd-Regular] +\stoptypescript + +\starttypescript [math] [modern,computer-modern,latin-modern] [name] + \definefontsynonym [MathRoman] [LMMathRoman-Regular] + %definefontsynonym [MathExtension] [LMMathExtension-Regular] + %definefontsynonym [MathItalic] [LMMathItalic-Italic] + %definefontsynonym [MathSymbol] [LMMathSymbols-Italic] +\stoptypescript + +\starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] [name] + \definefontsynonym [Serif] [LMTypewriterVarWd-Regular] + \definefontsynonym [SerifBold] [LMTypewriterVarWd-Oblique] + \definefontsynonym [SerifItalic] [LMTypewriterVarWd-Oblique] + \definefontsynonym [SerifSlanted] [LMTypewriterVarWd-Dark] + \definefontsynonym [SerifBoldItalic] [LMTypewriterVarWd-DarkOblique] + \definefontsynonym [SerifBoldSlanted] [LMTypewriterVarWd-DarkOblique] + \definefontsynonym [SerifCaps] [LMTypewriterVarWd-Regular] + \definefontsynonym [SerifCapsSlanted] [LMTypewriterVarWd-Oblique] +\stoptypescript + +\starttypescript [mono] [modern-cond,computer-modern-cond,latin-modern-cond,modern-lightcond,computer-modern-lightcond,latin-modern-lightcond] [name] + \definefontsynonym [Mono] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoBold] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoItalic] [LMTypewriter-LightCondensedOblique] + \definefontsynonym [MonoSlanted] [LMTypewriter-LightCondensedOblique] + \definefontsynonym [MonoBoldItalic] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoBoldSlanted] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoCaps] [LMTypewriter-LightCondensed] + \definefontsynonym [MonoCapsSlanted] [LMTypewriter-LightCondensed] +\stoptypescript + +\starttypescript [mono] [modern-light,computer-modern-light,latin-modern-light] [name] + \definefontsynonym [Mono] [LMTypewriter-Light] + \definefontsynonym [MonoBold] [LMTypewriter-Light] + \definefontsynonym [MonoItalic] [LMTypewriter-LightOblique] + \definefontsynonym [MonoSlanted] [LMTypewriter-LightOblique] + \definefontsynonym [MonoBoldItalic] [LMTypewriter-Light] + \definefontsynonym [MonoBoldSlanted] [LMTypewriter-Light] + \definefontsynonym [MonoCaps] [LMTypewriter-Light] + \definefontsynonym [MonoCapsSlanted] [LMTypewriter-Light] +\stoptypescript + +% Later we will map the real fonts, here we just map synonyms. + +\starttypescript [serif] [modern,latin-modern] + \definefontsynonym [LMRoman-DemiOblique] [LMRoman10-DemiOblique] + \definefontsynonym [LMRoman-Bold] [LMRoman10-Bold] + \definefontsynonym [LMRoman-BoldItalic] [LMRoman10-BoldItalic] + \definefontsynonym [LMRoman-BoldOblique] [LMRoman10-BoldOblique] + \definefontsynonym [LMRoman-CapsRegular] [LMRoman10-CapsRegular] + \definefontsynonym [LMRoman-CapsOblique] [LMRoman10-CapsOblique] + \definefontsynonym [LMRoman-Regular] [LMRoman10-Regular] + \definefontsynonym [LMRoman-Italic] [LMRoman10-Italic] + \definefontsynonym [LMRoman-Oblique] [LMRoman10-Oblique] +\stoptypescript + +\starttypescript [sans] [modern,latin-modern] + \definefontsynonym [LMSans-Regular] [LMSans10-Regular] + \definefontsynonym [LMSans-BoldOblique] [LMSans10-BoldOblique] + \definefontsynonym [LMSans-Bold] [LMSans10-Bold] + \definefontsynonym [LMSans-DemiCondensed] [LMSans10-DemiCondensed] + \definefontsynonym [LMSans-DemiCondensedOblique] [LMSans10-DemiCondensedOblique] + \definefontsynonym [LMSans-Oblique] [LMSans10-Oblique] +\stoptypescript + +\starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond] + \definefontsynonym [LMTypewriter-CapsRegular] [LMTypewriter10-CapsRegular] + \definefontsynonym [LMTypewriter-CapsOblique] [LMTypewriter10-CapsOblique] + \definefontsynonym [LMTypewriter-Light] [LMTypewriter10-Light] + \definefontsynonym [LMTypewriter-LightOblique] [LMTypewriter10-LightOblique] + \definefontsynonym [LMTypewriter-LightCondensed] [LMTypewriter10-LightCondensed] + \definefontsynonym [LMTypewriter-LightCondensedOblique] [LMTypewriter10-LightCondensedOblique] + \definefontsynonym [LMTypewriter-Dark] [LMTypewriter10-Dark] + \definefontsynonym [LMTypewriter-DarkOblique] [LMTypewriter10-DarkOblique] + \definefontsynonym [LMTypewriter-Regular] [LMTypewriter10-Regular] + \definefontsynonym [LMTypewriter-Italic] [LMTypewriter10-Italic] + \definefontsynonym [LMTypewriter-Oblique] [LMTypewriter10-Oblique] + \definefontsynonym [LMTypewriterVarWd-Regular] [LMTypewriterVarWd10-Regular] + \definefontsynonym [LMTypewriterVarWd-Oblique] [LMTypewriterVarWd10-Oblique] + \definefontsynonym [LMTypewriterVarWd-Light] [LMTypewriterVarWd10-Light] + \definefontsynonym [LMTypewriterVarWd-LightOblique] [LMTypewriterVarWd10-LightOblique] + \definefontsynonym [LMTypewriterVarWd-Dark] [LMTypewriterVarWd10-Dark] + \definefontsynonym [LMTypewriterVarWd-DarkOblique] [LMTypewriterVarWd10-DarkOblique] +\stoptypescript + +\starttypescript [serif] [modern,computer-modern,latin-modern] + \definefontsynonym [ComputerModern] [LMRoman-Regular] + \definefontsynonym [ComputerModern-Italic] [LMRoman-Italic] + \definefontsynonym [ComputerModern-Slanted] [LMRoman-Oblique] + \definefontsynonym [ComputerModern-Bold] [LMRoman-Bold] + \definefontsynonym [ComputerModern-BoldItalic] [LMRoman-BoldItalic] + \definefontsynonym [ComputerModern-BoldSlanted] [LMRoman-BoldOblique] + \definefontsynonym [ComputerModern-Caps] [LMRoman-CapsRegular] + \definefontsynonym [ComputerModern-CapsSlanted] [LMRoman-CapsOblique] +\stoptypescript + +\starttypescript [sans] [modern,computer-modern,latin-modern] + \definefontsynonym [ComputerModernSans] [LMSans-Regular] + \definefontsynonym [ComputerModernSans-Italic] [LMSans-Oblique] + \definefontsynonym [ComputerModernSans-Slanted] [LMSans-Oblique] + \definefontsynonym [ComputerModernSans-Bold] [LMSans-Bold] + \definefontsynonym [ComputerModernSans-BoldItalic] [LMSans-BoldOblique] + \definefontsynonym [ComputerModernSans-BoldSlanted] [LMSans-BoldOblique] + \definefontsynonym [ComputerModernSans-Caps] [LMSans-Regular] % [LMSans-CapsRegular] + \definefontsynonym [ComputerModernSans-CapsSlanted] [LMSans-Oblique] % [LMSans-CapsOblique] +\stoptypescript + +\starttypescript [mono] [modern,computer-modern,latin-modern] + \definefontsynonym [ComputerModernMono] [LMTypewriter-Regular] + \definefontsynonym [ComputerModernMono-Italic] [LMTypewriter-Italic] + \definefontsynonym [ComputerModernMono-Slanted] [LMTypewriter-Oblique] + \definefontsynonym [ComputerModernMono-Bold] [LMTypewriter-Dark] + \definefontsynonym [ComputerModernMono-BoldItalic] [LMTypewriter-DarkOblique] % ! + \definefontsynonym [ComputerModernMono-BoldSlanted] [LMTypewriter-DarkOblique] + \definefontsynonym [ComputerModernMono-Caps] [LMTypewriter-CapsRegular] + \definefontsynonym [ComputerModernMono-CapsSlanted] [LMTypewriter-CapsOblique] + \definefontsynonym [ComputerModernMono-Variable] [LMTypewriterVarWd-Regular] +\stoptypescript + +\starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] + \definefontsynonym [ComputerModernVariable] [LMTypewriterVarWd-Regular] + \definefontsynonym [ComputerModernVariable-Italic] [LMTypewriterVarWd-Oblique] + \definefontsynonym [ComputerModernVariable-Slanted] [LMTypewriterVarWd-Oblique] + \definefontsynonym [ComputerModernVariable-Bold] [LMTypewriterVarWd-Dark] + \definefontsynonym [ComputerModernVariable-BoldItalic] [LMTypewriterVarWd-DarkOblique] + \definefontsynonym [ComputerModernVariable-BoldSlanted] [LMTypewriterVarWd-DarkOblique] + \definefontsynonym [ComputerModernVariable-Caps] [LMTypewriterVarWd-Regular] + \definefontsynonym [ComputerModernVariable-CapsSlanted] [LMTypewriterVarWd-Oblique] +\stoptypescript + +\starttypescript [math] [modern,latin-modern] + \definefontsynonym [LMMathRoman-Regular] [LMMathRoman10-Regular] + \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold] + %definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic] + %definefontsynonym [LMMathSymbols-Italic] [LMMathSymbols10-Italic] + %definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular] + %definefontsynonym [LMMathItalic-Italic] [LMMathItalic10-Italic] + %definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic] +\stoptypescript + +% Antykwa Torunska : + +\starttypescript [serif] [antykwa-torunska] [name] + \definefontsynonym [Serif] [AntykwaTorunska-Regular] + \definefontsynonym [SerifBold] [AntykwaTorunska-Bold] + \definefontsynonym [SerifItalic] [AntykwaTorunska-Italic] + \definefontsynonym [SerifSlanted] [AntykwaTorunska-Italic] + \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifCaps] [AntykwaTorunska-Cap] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-light] [name] + \definefontsynonym [Serif] [AntykwaTorunska-Light] + \definefontsynonym [SerifBold] [AntykwaTorunska-Medium] + \definefontsynonym [SerifItalic] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifSlanted] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifCaps] [AntykwaTorunska-LightCap] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-cond] [name] + \definefontsynonym [Serif] [AntykwaTorunska-CondRegular] + \definefontsynonym [SerifBold] [AntykwaTorunska-CondBold] + \definefontsynonym [SerifItalic] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifCaps] [AntykwaTorunska-CondCap] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-lightcond] [name] + \definefontsynonym [Serif] [AntykwaTorunska-CondLight] + \definefontsynonym [SerifBold] [AntykwaTorunska-CondMedium] + \definefontsynonym [SerifItalic] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifCaps] [AntykwaTorunska-CondLightCap] +\stoptypescript + +\starttypescript [serif] [antykwa-torunska] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-Cap] + \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-BoldCap] + \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-ItalicCap] + \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-ItalicCap] + \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-BoldItalicCap] + \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-BoldItalicCap] + \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-Cap] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegularLight] [AntykwaTorunska-Light] + \definefontsynonym [SerifBoldLight] [AntykwaTorunska-Medium] + \definefontsynonym [SerifItalicLight] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifCapsLight] [AntykwaTorunska-LightCap] + + \definefontvariant [Serif][lt][Light] + + \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondRegular] + \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondBold] + \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondCap] + + \definefontvariant [Serif][cond][Cond] + +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-light] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-LightCap] + \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-MediumCap] + \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-LightItalicCap] + \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-LightItalicCap] + \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-MedItalicCap] + \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-MedItalicCap] + \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-LightCap] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegularDark] [AntykwaTorunska-Regular] + \definefontsynonym [SerifBoldDark] [AntykwaTorunska-Bold] + \definefontsynonym [SerifItalicDark] [AntykwaTorunska-Italic] + \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-Italic] + \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifCapsDark] [AntykwaTorunska-Cap] + + \definefontvariant [Serif][dk][Dark] + + \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondLight] + \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondMedium] + \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondLightCap] + + \definefontvariant [Serif][cond][Cond] + +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-cond] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondCap] + \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondBoldCap] + \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondItalicCap] + \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondItalicCap] + \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondBoldItalicCap] + \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondBoldItalicCap] + \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondCap] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegularLight] [AntykwaTorunska-CondLight] + \definefontsynonym [SerifBoldLight] [AntykwaTorunska-CondMedium] + \definefontsynonym [SerifItalicLight] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-CondLightItalic] + \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-CondMedItalic] + \definefontsynonym [SerifCapsLight] [AntykwaTorunska-CondLightCap] + + \definefontvariant [Serif][lt][Light] + + \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Regular] + \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Bold] + \definefontsynonym [SerifItalicExp] [AntykwaTorunska-Italic] + \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-Italic] + \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-BoldItalic] + \definefontsynonym [SerifCapsExp] [AntykwaTorunska-Cap] + + \definefontvariant [Serif][exp][Exp] + +\stoptypescript + +\starttypescript [serif] [antykwa-torunska-lightcond] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondLightCap] + \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondMediumCap] + \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondLightItalicCap] + \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondLightItalicCap] + \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondMedItalicCap] + \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondMedItalicCap] + \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondLightCap] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegularDark] [AntykwaTorunska-CondRegular] + \definefontsynonym [SerifBoldDark] [AntykwaTorunska-CondBold] + \definefontsynonym [SerifItalicDark] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-CondItalic] + \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-CondBoldItalic] + \definefontsynonym [SerifCapsDark] [AntykwaTorunska-CondCap] + + \definefontvariant [Serif][dk][Dark] + + \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Light] + \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Medium] + \definefontsynonym [SerifItalicExp] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-LightItalic] + \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-MedItalic] + \definefontsynonym [SerifCapsExp] [AntykwaTorunska-LightCap] + + \definefontvariant [Serif][exp][Exp] + +\stoptypescript + +% maybe no -Regular etc + +\starttypescript [math] [antykwa-torunska-light] [name] + \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Light] + %definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-LightItalic] + %definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Light] + %definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Light] +\stoptypescript + +\starttypescript [math] [antykwa-torunska] [name] + \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Regular] + %definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-Italic] + %definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Regular] + %definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Regular] +\stoptypescript + +\starttypescript [math] [antykwa-torunska-cond] [name] + \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondRegular] + %definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondItalic] + %definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondRegular] + %definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondRegular] +\stoptypescript + +\starttypescript [math] [antykwa-torunska-lightcond] [name] + \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondLight] + %definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondLightItalic] + %definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondLight] + %definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondLight] +\stoptypescript + +% Antykwa Poltawskiego : + +\starttypescript [serif] [antykwa-poltawskiego] [name] + \definefontsynonym [Serif] [AntykwaPoltawskiego-Regular] + \definefontsynonym [SerifBold] [AntykwaPoltawskiego-Bold] + \definefontsynonym [SerifItalic] [AntykwaPoltawskiego-Italic] + \definefontsynonym [SerifSlanted] [AntykwaPoltawskiego-Italic] + \definefontsynonym [SerifBoldItalic] [AntykwaPoltawskiego-Bold] + \definefontsynonym [SerifBoldSlanted] [AntykwaPoltawskiego-Bold] + \definefontsynonym [SerifCaps] [AntykwaPoltawskiego-Regular] +\stoptypescript + +% Iwona + +\starttypescript [sans] [iwona-light] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-Light-Regular] + \definefontsynonym [SansItalic] [Iwona-Light-Italic] + \definefontsynonym [SansBold] [Iwona-Medium-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-Medium-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsLight] + \definefontsynonym [SansItalicCaps] [Iwona-CapsLightItalic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsMedium] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsMediumItalic] +\stoptypescript + +\starttypescript [sans] [iwona-light-caps] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsLight-Regular] + \definefontsynonym [SansItalic] [Iwona-CapsLight-Italic] + \definefontsynonym [SansBold] [Iwona-CapsMedium-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CapsMedium-Italic] +\stoptypescript + +\starttypescript [sans] [iwona] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-Regular] + \definefontsynonym [SansItalic] [Iwona-Italic] + \definefontsynonym [SansBold] [Iwona-Bold] + \definefontsynonym [SansBoldItalic] [Iwona-BoldItalic] + \definefontsynonym [SansCaps] [Iwona-CapsRegular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsItalic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsBold] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsBoldItalic] +\stoptypescript + +\starttypescript [sans] [iwona-caps] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsRegular] + \definefontsynonym [SansItalic] [Iwona-CapsItalic] + \definefontsynonym [SansBold] [Iwona-CapsBold] + \definefontsynonym [SansBoldItalic] [Iwona-CapsBoldItalic] +\stoptypescript + +\starttypescript [sans] [iwona-medium] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-Medium-Regular] + \definefontsynonym [SansItalic] [Iwona-Medium-Italic] + \definefontsynonym [SansBold] [Iwona-Heavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsMedium-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-medium-caps] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansItalic] [Iwona-CapsMedium-Italic] + \definefontsynonym [SansBold] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CapsHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-heavy] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-Heavy-Regular] + \definefontsynonym [SansItalic] [Iwona-Heavy-Italic] + \definefontsynonym [SansBold] [Iwona-Heavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-heavy-caps] [name] + \setups[font:fallback:sans] + \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-light-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CondLight-Regular] + \definefontsynonym [SansItalic] [Iwona-CondLight-Italic] + \definefontsynonym [SansBold] [Iwona-CondMedium-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CondMedium-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsCondLight-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsCondLight-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsCondMedium-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondMedium-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-light-cond-caps,iwona-light-caps-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsCondLight-Regular] + \definefontsynonym [SansItalic] [Iwona-CapsCondLight-Italic] + \definefontsynonym [SansBold] [Iwona-CapsCondMedium-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CapsCondMedium-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CondRegular] + \definefontsynonym [SansItalic] [Iwona-CondItalic] + \definefontsynonym [SansBold] [Iwona-CondBold] + \definefontsynonym [SansBoldItalic] [Iwona-CondBoldItalic] + \definefontsynonym [SansCaps] [Iwona-CapsCondRegular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsCondItalic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsCondBold] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondBoldItalic] +\stoptypescript + +\starttypescript [sans] [iwona-cond-caps,iwona-caps-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsCondRegular] + \definefontsynonym [SansItalic] [Iwona-CapsCondItalic] + \definefontsynonym [SansBold] [Iwona-CapsCondBold] + \definefontsynonym [SansBoldItalic] [Iwona-CapsCondBoldItalic] +\stoptypescript + +\starttypescript [sans] [iwona-medium-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CondMedium-Regular] + \definefontsynonym [SansItalic] [Iwona-CondMedium-Italic] + \definefontsynonym [SansBold] [Iwona-CondHeavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CondHeavy-Italic] + \definefontsynonym [SansCaps] [Iwona-CapsCondHeavy-Regular] + \definefontsynonym [SansItalicCaps] [Iwona-CapsCondMedium-Italic] + \definefontsynonym [SansBoldCaps] [Iwona-CapsCondHeavy-Regular] + \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondHeavy-Italic] +\stoptypescript + +\starttypescript [sans] [iwona-medium-cond-caps,iwona-medium-caps-cond] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Iwona-CapsCondHeavy-Regular] + \definefontsynonym [SansItalic] [Iwona-CapsCondMedium-Italic] + \definefontsynonym [SansBold] [Iwona-CapsCondHeavy-Regular] + \definefontsynonym [SansBoldItalic] [Iwona-CapsCondHeavy-Italic] +\stoptypescript + +\starttypescript [math] [iwona-light] [name] + \definefontsynonym [MathRoman] [Iwona-Math-Letters-Light-Regular] + %definefontsynonym [MathItalic] [Iwona-Math-Letters-Light-Italic] + %definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Light] + %definefontsynonym [MathExtension] [Iwona-Math-Extension-Light] +\stoptypescript + +\starttypescript [math] [iwona] [name] + \definefontsynonym [MathRoman] [Iwona-Math-Letters-Regular] + %definefontsynonym [MathItalic] [Iwona-Math-Letters-Italic] + %definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Regular] + %definefontsynonym [MathExtension] [Iwona-Math-Extension-Regular] +\stoptypescript + +\starttypescript [math] [iwona-medium] [name] + \definefontsynonym [MathRoman] [Iwona-Math-Letters-Medium-Regular] + %definefontsynonym [MathItalic] [Iwona-Math-Letters-Medium-Italic] + %definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Medium] + %definefontsynonym [MathExtension] [Iwona-Math-Extension-Medium] +\stoptypescript + +\starttypescript [math] [iwona-heavy] [name] + \definefontsynonym [MathRoman] [Iwona-Math-Letters-Heavy-Regular] + %definefontsynonym [MathItalic] [Iwona-Math-Letters-Heavy-Italic] + %definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Heavy] + %definefontsynonym [MathExtension] [Iwona-Math-Extension-Heavy] +\stoptypescript + +% Kurier + +\starttypescript [sans] [kurier-light] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Kurier-Light-Regular] + \definefontsynonym [SansItalic] [Kurier-Light-Italic] + \definefontsynonym [SansBold] [Kurier-Medium-Regular] + \definefontsynonym [SansBoldItalic] [Kurier-Medium-Italic] +\stoptypescript + +\starttypescript [sans] [kurier] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Kurier-Regular] + \definefontsynonym [SansItalic] [Kurier-Italic] + \definefontsynonym [SansBold] [Kurier-Bold] + \definefontsynonym [SansBoldItalic] [Kurier-BoldItalic] +\stoptypescript + +\starttypescript [sans] [kurier-medium] [name] + \setups[font:fallback:sans] + \definefontsynonym [Sans] [Kurier-Medium-Regular] + \definefontsynonym [SansItalic] [Kurier-Medium-Italic] + \definefontsynonym [SansBold] [Kurier-Heavy-Regular] + \definefontsynonym [SansBoldItalic] [Kurier-Heavy-Italic] +\stoptypescript + +\starttypescript [math] [kurier-light] [name] + \definefontsynonym [MathRoman] [Kurier-Math-Letters-Light-Regular] + %definefontsynonym [MathItalic] [Kurier-Math-Letters-Light-Italic] + %definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Light] + %definefontsynonym [MathExtension] [Kurier-Math-Extension-Light] +\stoptypescript + +\starttypescript [math] [kurier] [name] + \definefontsynonym [MathRoman] [Kurier-Math-Letters-Regular] + %definefontsynonym [MathItalic] [Kurier-Math-Letters-Italic] + %definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Regular] + %definefontsynonym [MathExtension] [Kurier-Math-Extension-Regular] +\stoptypescript + +\starttypescript [math] [kurier-medium] [name] + \definefontsynonym [MathRoman] [Kurier-Math-Letters-Medium-Regular] + %definefontsynonym [MathItalic] [Kurier-Math-Letters-Medium-Italic] + %definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Medium] + %definefontsynonym [MathExtension] [Kurier-Math-Extension-Medium] +\stoptypescript + +% Bookman : + +\starttypescript [serif] [bookman] [name] + \definefontsynonym [Serif] [Bookman-Light] + \definefontsynonym [SerifItalic] [Bookman-LightItalic] + \definefontsynonym [SerifBold] [Bookman-DemiBold] + \definefontsynonym [SerifBoldItalic] [Bookman-DemiBoldItalic] + \definefontsynonym [SerifSlanted] [Bookman-LightSlanted] + \definefontsynonym [SerifBoldSlanted] [Bookman-DemiBoldSlanted] + \definefontsynonym [SerifCaps] [Bookman-Light-Caps] +\stoptypescript + +% Chancery : Zapf + +\starttypescript [calligraphy] [chancery] [name] + \definefontsynonym [Calligraphy] [Chancery] +\stoptypescript + +% Schoolbook : + +\starttypescript [serif] [schoolbook] [name] + \definefontsynonym [Serif] [Schoolbook-Roman] + \definefontsynonym [SerifItalic] [Schoolbook-Italic] + \definefontsynonym [SerifBold] [Schoolbook-Bold] + \definefontsynonym [SerifBoldItalic] [Schoolbook-BoldItalic] + \definefontsynonym [SerifSlanted] [Schoolbook-RomanSlanted] + \definefontsynonym [SerifBoldSlanted] [Schoolbook-BoldSlanted] + \definefontsynonym [SerifCaps] [Schoolbook-Roman-Caps] +\stoptypescript + +% Utopia : Adobe + +\starttypescript [serif] [utopia] [name] + \definefontsynonym [Serif] [Utopia-Regular] + \definefontsynonym [SerifItalic] [Utopia-Italic] + \definefontsynonym [SerifBold] [Utopia-Bold] + \definefontsynonym [SerifBoldItalic] [Utopia-BoldItalic] + \definefontsynonym [SerifSlanted] [Utopia-Slanted] + \definefontsynonym [SerifBoldSlanted] [Utopia-BoldSlanted] + \definefontsynonym [SerifCaps] [Utopia-Regular-Caps] +\stoptypescript + +% Fourier : Michael Bovani + +% \starttypescript [serif] [fourier] [name] +% \definefontsynonym [Serif] [Fourier-Regular] +% \definefontsynonym [SerifSlanted] [Fourier-Slanted] +% \definefontsynonym [SerifItalic] [Fourier-Italic] +% \definefontsynonym [SerifCaps] [Fourier-RegularCaps] +% \definefontsynonym [SerifBold] [Fourier-Bold] +% \definefontsynonym [SerifBoldSlanted] [Fourier-BoldSlanted] +% \definefontsynonym [SerifBoldItalic] [Fourier-BoldItalic] +% \definefontsynonym [SerifBoldCaps] [Fourier-BoldCaps] +% +% \definefontsynonym [Serif-Expert] [Fourier-Regular-Expert] +% \definefontsynonym [SerifSlanted-Expert] [Fourier-Slanted-Expert] +% \definefontsynonym [SerifItalic-Expert] [Fourier-Italic-Expert] +% \definefontsynonym [SerifCaps-Expert] [Fourier-RegularCaps-Expert] +% \definefontsynonym [SerifSemiBold-Expert] [Fourier-Semi-Expert] +% \definefontsynonym [SerifSemiSlanted-Expert] [Fourier-SemiSlanted-Expert] +% \definefontsynonym [SerifSemiItalic-Expert] [Fourier-SemiItalic-Expert] +% \definefontsynonym [SerifSemiCaps-Expert] [Fourier-SemiCaps-Expert] +% \definefontsynonym [SerifBold-Expert] [Fourier-Bold-Expert] +% \definefontsynonym [SerifBoldSlanted-Expert] [Fourier-BoldSlanted-Expert] +% \definefontsynonym [SerifBoldItalic-Expert] [Fourier-BoldItalic-Expert] +% \definefontsynonym [SerifBlack-Expert] [Fourier-Black-Expert] +% +% \definefontsynonym [Serif-OldStyle] [Fourier-Regular-OldStyle] +% \definefontsynonym [SerifSlanted-OldStyle] [Fourier-Slanted-OldStyle] +% \definefontsynonym [SerifItalic-OldStyle] [Fourier-Italic-OldStyle] +% \definefontsynonym [SerifCaps-OldStyle] [Fourier-RegularCaps-OldStyle] +% \definefontsynonym [SerifSemiBold-OldStyle] [Fourier-Semi-OldStyle] +% \definefontsynonym [SerifSemiSlanted-OldStyle] [Fourier-SemiSlanted-OldStyle] +% \definefontsynonym [SerifSemiItalic-OldStyle] [Fourier-SemiItalic-OldStyle] +% \definefontsynonym [SerifSemiCaps-OldStyle] [Fourier-SemiCaps-OldStyle] +% \definefontsynonym [SerifBold-OldStyle] [Fourier-Bold-OldStyle] +% \definefontsynonym [SerifBoldSlanted-OldStyle] [Fourier-BoldSlanted-OldStyle] +% \definefontsynonym [SerifBoldItalic-OldStyle] [Fourier-BoldItalic-OldStyle] +% \definefontsynonym [SerifBlack-OldStyle] [Fourier-Black-OldStyle] +% \definefontsynonym [SerifBlackSlanted-OldStyle] [Fourier-BlackSlanted-OldStyle] +% \stoptypescript +% +% \starttypescript [math] [fourier] [name] +% \definefontsynonym [MathRoman] [Fourier-Math-Letters] +% \definefontsynonym [MathItalic] [Fourier-Math-Letters-Italic] +% \definefontsynonym [MathSymbol] [Fourier-Math-Symbols] +% \definefontsynonym [MathExtension] [Fourier-Math-Extension] +% \stoptypescript +% +% \starttypescript [math] [fourier] [name] % todo +% \definefontsynonym [OldStyle] [Serif-OldStyle] % strange, no oldstyles +% \definefontsynonym [Fraktur] [eufm10] +% \definefontsynonym [Blackboard] [msbm10] +% \definefontsynonym [Gothic] [eufm10] +% \definefontsynonym [Calligraphic] [eusm10] +% \stoptypescript + +% Charter : + +\starttypescript [serif] [charter] [name] + \definefontsynonym [Serif] [Charter-Roman] + \definefontsynonym [SerifItalic] [Charter-Italic] + \definefontsynonym [SerifBold] [Charter-Bold] + \definefontsynonym [SerifBoldItalic] [Charter-BoldItalic] + \definefontsynonym [SerifSlanted] [Charter-Slanted] + \definefontsynonym [SerifBoldSlanted] [Charter-BoldSlanted] + \definefontsynonym [SerifCaps] [Charter-Roman-Caps] +\stoptypescript + +% Times : + +\starttypescript [serif] [times] [name] + \definefontsynonym [Serif] [Times-Roman] + \definefontsynonym [SerifBold] [Times-Bold] + \definefontsynonym [SerifItalic] [Times-Italic] + \definefontsynonym [SerifSlanted] [Times-Italic] + \definefontsynonym [SerifBoldItalic] [Times-BoldItalic] + \definefontsynonym [SerifBoldSlanted] [Times-BoldItalic] + \definefontsynonym [SerifCaps] [Times-Caps] +\stoptypescript + +% \starttypescript [math] [times] [name] +% \definefontsynonym [MathRoman] [Times-Roman-Upright] +% \definefontsynonym [MathExtension] [Times-Math-Extension] +% \definefontsynonym [MathItalic] [Times-Math-Italic] +% \definefontsynonym [MathSymbol] [Times-Math-Symbols] +% \definefontsynonym [MathAlpha] [Times-Math-SymbolsA] +% \definefontsynonym [MathBeta] [Times-Math-SymbolsB] +% \stoptypescript + +% \starttypescript [math] [times] [name] +% \definefontsynonym [OldStyle] [MathItalic] +% \definefontsynonym [Fraktur] [eufm10] +% \definefontsynonym [Blackboard] [MathBeta] +% \definefontsynonym [Gothic] [eufm10] +% \definefontsynonym [Calligraphic] [eusm10] +% \stoptypescript + +% Helvetica : + +\starttypescript [sans] [helvetica] [name] + \definefontsynonym [Sans] [Helvetica] + \definefontsynonym [SansBold] [Helvetica-Bold] + \definefontsynonym [SansItalic] [Helvetica-Oblique] + \definefontsynonym [SansSlanted] [Helvetica-Oblique] + \definefontsynonym [SansBoldItalic] [Helvetica-BoldOblique] + \definefontsynonym [SansBoldSlanted] [Helvetica-BoldOblique] + \definefontsynonym [SansCaps] [Helvetica-Caps] +\stoptypescript + +\starttypescript [math] [helvetica] [name] + \definefontsynonym [MathRoman] [Helvetica-MathRoman] + \definefontsynonym [MathExtension] [Helvetica-MathExtendedSymbols] + \definefontsynonym [MathItalic] [Helvetica-MathItalics] + \definefontsynonym [MathSymbol] [Helvetica-MathSymbols] +\stoptypescript + +% Courier : + +\starttypescript [mono] [courier] [name] + \definefontsynonym [Mono] [Courier] + \definefontsynonym [MonoBold] [Courier-Bold] + \definefontsynonym [MonoItalic] [Courier-Oblique] + \definefontsynonym [MonoSlanted] [Courier-Oblique] + \definefontsynonym [MonoBoldItalic] [Courier-BoldOblique] + \definefontsynonym [MonoBoldSlanted] [Courier-BoldOblique] + \definefontsynonym [MonoCaps] [Courier] +\stoptypescript + +% Palatino : Hermann Zapf / URW + +\starttypescript [serif] [palatino] [name] + \definefontsynonym [Serif] [Palatino] + \definefontsynonym [SerifBold] [Palatino-Bold] + \definefontsynonym [SerifItalic] [Palatino-Italic] + \definefontsynonym [SerifSlanted] [Palatino-Slanted] + \definefontsynonym [SerifBoldItalic] [Palatino-BoldItalic] + \definefontsynonym [SerifBoldSlanted] [Palatino-BoldSlanted] + \definefontsynonym [SerifCaps] [Palatino-Caps] +\stoptypescript + +% \starttypescript [math] [palatino] [name] +% \definefontsynonym [MathRoman] [Palatino-Roman-Upright] +% \definefontsynonym [MathExtension] [Palatino-Math-Extension] +% \definefontsynonym [MathItalic] [Palatino-Math-Italic] +% \definefontsynonym [MathSymbol] [Palatino-Math-Symbols] +% \definefontsynonym [MathAlpha] [Palatino-Math-SymbolsA] +% \definefontsynonym [MathBeta] [Palatino-Math-SymbolsB] +% \stoptypescript + +% \starttypescript [math] [palatino] [name] +% \definefontsynonym [OldStyle] [MathItalic] +% \definefontsynonym [Fraktur] [eufm10] +% \definefontsynonym [Blackboard] [MathBeta] +% \definefontsynonym [Gothic] [eufm10] +% \definefontsynonym [Calligraphic] [eusm10] +% \stoptypescript + +% bonus definitions / will disappear + +\starttypescript [serif] [palatino] [name] + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularOsF] [TeXPalladioL-SC] + \definefontsynonym [SerifItalicOsF] [TeXPalladioL-ItalicOsF] + \definefontsynonym [SerifBoldOsF] [TeXPalladioL-BoldOsF] + \definefontsynonym [SerifBoldItalicOsF][TeXPalladioL-BoldItalicOsF] + \definefontsynonym [SerifCapsOsF] [TeXPalladioL-SC] +\stoptypescript + +% TeXGyre + +% name definitions & prefixes + +\definetypescriptprefix [n:pagella] [TeXGyrePagella] \definetypescriptprefix [n:palatino] [TeXGyrePagella] +\definetypescriptprefix [n:termes] [TeXGyreTermes] \definetypescriptprefix [n:times] [TeXGyreTermes] +\definetypescriptprefix [n:heros] [TeXGyreHeros] \definetypescriptprefix [n:helvetica] [TeXGyreHeros] +\definetypescriptprefix [n:bonum] [TeXGyreBonum] \definetypescriptprefix [n:bookman] [TeXGyreBonum] +\definetypescriptprefix [n:schola] [TeXGyreSchola] \definetypescriptprefix [n:schoolbook] [TeXGyreSchola] +\definetypescriptprefix [n:adventor] [TeXGyreAdventor] %definetypescriptprefix [n:adventor] [TeXGyreAdventor] +\definetypescriptprefix [n:cursor] [TeXGyreCursor] \definetypescriptprefix [n:courier] [TeXGyreCursor] +\definetypescriptprefix [n:chorus] [TeXGyreChorus] \definetypescriptprefix [n:chancery] [TeXGyreChorus] % not the full set + +\starttypescript [serif] [pagella,palatino,termes,times,bonum,bookman,schola,schoolbook] [name] + \definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular] + \definefontsynonym [SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic] + \definefontsynonym [SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold] + \definefontsynonym [SerifBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] + \definefontsynonym [SerifSlanted] [SerifItalic] + \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic] + \definefontsynonym [SerifCaps] [\typescriptprefix{n:\typescripttwo}-Caps] + + \definefontvariant [Serif][osf][Caps] + \definefontvariant [Serif][sc] [Caps] + + \definefontsynonym [SerifRegular] [Serif] + \definefontsynonym [SerifRegularCaps] [SerifCaps] + \definefontsynonym [SerifItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps] + \definefontsynonym [SerifBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps] + \definefontsynonym [SerifBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] + \definefontsynonym [SerifSlantedCaps] [SerifItalicCaps] + \definefontsynonym [SerifBoldSlantedCaps] [SerifBoldItalicCaps] + \definefontsynonym [SerifCapsCaps] [SerifCaps] +\stoptypescript + +\starttypescript [serif] [chorus,chancery] [name] + \definefontsynonym [SerifMediumItalic] [TeXGyreChorus-MediumItalic] + \definefontsynonym [Serif] [SerifMediumItalic] + \definefontsynonym [SerifItalic] [SerifMediumItalic] + \definefontsynonym [SerifBold] [SerifMediumItalic] + \definefontsynonym [SerifBoldItalic] [SerifMediumItalic] + \definefontsynonym [SerifSlanted] [SerifMediumItalic] + \definefontsynonym [SerifBoldSlanted] [SerifMediumItalic] + \definefontsynonym [SerifCaps] [SerifMediumItalic] +\stoptypescript + +\starttypescript [calligraphy] [chorus,chancery] [name] + \definefontsynonym [Calligraphy] [TeXGyreChorus-MediumItalic] +\stoptypescript + +\starttypescript [sans] [heros,helvetica,adventor] [name] + \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular] + \definefontsynonym [SansItalic] [\typescriptprefix{n:\typescripttwo}-Italic] + \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold] + \definefontsynonym [SansBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] + \definefontsynonym [SansSlanted] [SansItalic] + \definefontsynonym [SansBoldSlanted] [SansBoldItalic] + \definefontsynonym [SansCaps] [\typescriptprefix{n:\typescripttwo}-Caps] + + \definefontvariant [Sans][osf][Caps] + \definefontvariant [Sans][sc] [Caps] + + \definefontsynonym [SansRegular] [Sans] + \definefontsynonym [SansRegularCaps] [SansCaps] + \definefontsynonym [SansItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps] + \definefontsynonym [SansBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps] + \definefontsynonym [SansBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] + \definefontsynonym [SansSlantedCaps] [SansItalicCaps] + \definefontsynonym [SansBoldSlantedCaps] [SansBoldItalicCaps] + \definefontsynonym [SansCapsCaps] [SansCaps] +\stoptypescript + +\starttypescript [mono] [cursor,courier] [name] + \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular] + \definefontsynonym [MonoItalic] [\typescriptprefix{n:\typescripttwo}-Italic] + \definefontsynonym [MonoBold] [\typescriptprefix{n:\typescripttwo}-Bold] + \definefontsynonym [MonoBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] + \definefontsynonym [MonoSlanted] [MonoItalic] + \definefontsynonym [MonoBoldSlanted] [MonoBoldItalic] + + \definefontvariant [Mono][osf][Caps] + \definefontvariant [Mono][sc] [Caps] + + \definefontsynonym [MonoRegular] [Mono] + \definefontsynonym [MonoRegularCaps] [MonoCaps] + \definefontsynonym [MonoItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps] + \definefontsynonym [MonoBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps] + \definefontsynonym [MonoBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] + \definefontsynonym [MonoSlantedCaps] [MonoItalicCaps] + \definefontsynonym [MonoBoldSlantedCaps] [MonoBoldItalicCaps] + \definefontsynonym [MonoCapsCaps] [MonoCaps] +\stoptypescript + +\stoptypescriptcollection + +\endinput diff --git a/tex/context/base/type-tmf.tex b/tex/context/base/type-tmf.tex index c2deb8187..78ed89cf9 100644 --- a/tex/context/base/type-tmf.tex +++ b/tex/context/base/type-tmf.tex @@ -11,1163 +11,6 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\starttypescriptcollection[synonyms] - -% Computer Modern Roman : Donald Knuth -% Latin Modern: LM Font Revision Team - -% LM math vs CM math (analysis by Taco): -% -% lmex10.tfm % identical -% lmmi5.tfm % identical -% lmmi6.tfm % identical -% lmmi7.tfm % identical -% lmmi8.tfm % identical -% lmmi9.tfm % identical -% lmmi10.tfm % identical -% lmmi12.tfm % identical -% lmmib10.tfm % identical -% lmsy5.tfm % extra chars: 254,255 (octal) -% lmsy6.tfm % extra chars: 254,255 (octal) -% lmsy7.tfm % extra chars: 254,255 (octal) -% lmsy8.tfm % extra chars: 254,255 (octal) -% lmsy9.tfm % extra chars: 254,255 (octal) -% lmsy10.tfm % extra chars: 254,255 (octal) -% lmbsy10.tfm % extra chars: 254,255 (octal) -% -% From the 'AMS' set: -% -% lmmib5.tfm % identical -% lmmib7.tfm % identical -% lmbsy5.tfm % extra chars: 254,255 (octal) -% lmbsy7.tfm % extra chars: 254,255 (octal) -% -% The two extra characters are: -% -% /lessorequalslant -% /greaterorequalslant - -\starttypescript [serif] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [Serif] [LMRoman-Regular] - \definefontsynonym [SerifBold] [LMRoman-Bold] - \definefontsynonym [SerifItalic] [LMRoman-Italic] - \definefontsynonym [SerifSlanted] [LMRoman-Oblique] - \definefontsynonym [SerifBoldItalic] [LMRoman-BoldItalic] - \definefontsynonym [SerifBoldSlanted] [LMRoman-BoldOblique] - \definefontsynonym [SerifCaps] [LMRoman-CapsRegular] - \definefontsynonym [SerifCapsSlanted] [LMRoman-CapsOblique] -\stoptypescript - -\starttypescript [sans] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [Sans] [LMSans-Regular] - \definefontsynonym [SansBold] [LMSans-Bold] - \definefontsynonym [SansItalic] [LMSans-Oblique] - \definefontsynonym [SansSlanted] [LMSans-Oblique] - \definefontsynonym [SansBoldItalic] [LMSans-BoldOblique] - \definefontsynonym [SansBoldSlanted] [LMSans-BoldOblique] - \definefontsynonym [SansCaps] [LMSans-Regular] - \definefontsynonym [SansCapsSlanted] [LMSans-Oblique] -\stoptypescript - -\starttypescript [mono] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [Mono] [LMTypewriter-Regular] - \definefontsynonym [MonoBold] [LMTypewriter-Dark] - \definefontsynonym [MonoItalic] [LMTypewriter-Italic] - \definefontsynonym [MonoSlanted] [LMTypewriter-Oblique] - \definefontsynonym [MonoBoldItalic] [LMTypewriter-DarkOblique] - \definefontsynonym [MonoBoldSlanted] [LMTypewriter-DarkOblique] - \definefontsynonym [MonoCaps] [LMTypewriter-CapsRegular] - \definefontsynonym [MonoCapsSlanted] [LMTypewriter-CapsOblique] - \definefontsynonym [MonoVariable] [LMTypewriterVarWd-Regular] -\stoptypescript - -\starttypescript [math] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [MathRoman] [LMMathRoman-Regular] - \definefontsynonym [MathExtension] [LMMathExtension-Regular] - \definefontsynonym [MathItalic] [LMMathItalic-Italic] - \definefontsynonym [MathSymbol] [LMMathSymbols-Italic] -\stoptypescript - -% maybe we can by now just use: (to be tested first) - -\starttypescript [math] [modern,computer-modern,latin-modern] [name] - \definefontsynonym[xcmr12][rm-lmr12] - \definefontsynonym[xcmr10][rm-lmr10] - \definefontsynonym[xcmr9] [rm-lmr9] - \definefontsynonym[xcmr8] [rm-lmr8] - \definefontsynonym[xcmr7] [rm-lmr7] - \definefontsynonym[xcmr6] [rm-lmr6] - \definefontsynonym[xcmr5] [rm-lmr5] -\stoptypescript - -\starttypescript [boldmath] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [MathRoman] [LMMathRoman-Bold] - \definefontsynonym [MathExtension] [LMMathExtension-Regular] - \definefontsynonym [MathItalic] [LMMathItalic-BoldItalic] - \definefontsynonym [MathSymbol] [LMMathSymbols-BoldItalic] -\stoptypescript - -\starttypescript [bfmath] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [MathRomanBold] [LMMathRoman-Bold] - \definefontsynonym [MathExtension] [LMMathExtension-Regular] - \definefontsynonym [MathItalicBold] [LMMathItalic-BoldItalic] - \definefontsynonym [MathSymbolBold] [LMMathSymbols-BoldItalic] -\stoptypescript - -\starttypescript [math,boldmath,bfmath] [modern,computer-modern,latin-modern] [name] - \usemathcollection[default] -\stoptypescript - -\starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] [name] - \definefontsynonym [Serif] [LMTypewriterVarWd-Regular] - \definefontsynonym [SerifBold] [LMTypewriterVarWd-Oblique] - \definefontsynonym [SerifItalic] [LMTypewriterVarWd-Oblique] - \definefontsynonym [SerifSlanted] [LMTypewriterVarWd-Dark] - \definefontsynonym [SerifBoldItalic] [LMTypewriterVarWd-DarkOblique] - \definefontsynonym [SerifBoldSlanted] [LMTypewriterVarWd-DarkOblique] - \definefontsynonym [SerifCaps] [LMTypewriterVarWd-Regular] - \definefontsynonym [SerifCapsSlanted] [LMTypewriterVarWd-Oblique] -\stoptypescript - -\starttypescript [mono] [modern-cond,computer-modern-cond,latin-modern-cond,modern-lightcond,computer-modern-lightcond,latin-modern-lightcond] [name] - \definefontsynonym [Mono] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoBold] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoItalic] [LMTypewriter-LightCondensedOblique] - \definefontsynonym [MonoSlanted] [LMTypewriter-LightCondensedOblique] - \definefontsynonym [MonoBoldItalic] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoBoldSlanted] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoCaps] [LMTypewriter-LightCondensed] - \definefontsynonym [MonoCapsSlanted] [LMTypewriter-LightCondensed] -\stoptypescript - -\starttypescript [mono] [modern-light,computer-modern-light,latin-modern-light] [name] - \definefontsynonym [Mono] [LMTypewriter-Light] - \definefontsynonym [MonoBold] [LMTypewriter-Light] - \definefontsynonym [MonoItalic] [LMTypewriter-LightOblique] - \definefontsynonym [MonoSlanted] [LMTypewriter-LightOblique] - \definefontsynonym [MonoBoldItalic] [LMTypewriter-Light] - \definefontsynonym [MonoBoldSlanted] [LMTypewriter-Light] - \definefontsynonym [MonoCaps] [LMTypewriter-Light] - \definefontsynonym [MonoCapsSlanted] [LMTypewriter-Light] -\stoptypescript - -% Later we will map the real fonts, here we just map synonyms. - -\starttypescript [serif] [modern,latin-modern] - \definefontsynonym [LMRoman-DemiOblique] [LMRoman10-DemiOblique] - \definefontsynonym [LMRoman-Bold] [LMRoman10-Bold] - \definefontsynonym [LMRoman-BoldItalic] [LMRoman10-BoldItalic] - \definefontsynonym [LMRoman-BoldOblique] [LMRoman10-BoldOblique] - \definefontsynonym [LMRoman-CapsRegular] [LMRoman10-CapsRegular] - \definefontsynonym [LMRoman-CapsOblique] [LMRoman10-CapsOblique] - \definefontsynonym [LMRoman-Regular] [LMRoman10-Regular] - \definefontsynonym [LMRoman-Italic] [LMRoman10-Italic] - \definefontsynonym [LMRoman-Oblique] [LMRoman10-Oblique] -\stoptypescript - -\starttypescript [sans] [modern,latin-modern] - \definefontsynonym [LMSans-Regular] [LMSans10-Regular] - \definefontsynonym [LMSans-BoldOblique] [LMSans10-BoldOblique] - \definefontsynonym [LMSans-Bold] [LMSans10-Bold] - \definefontsynonym [LMSans-DemiCondensed] [LMSans10-DemiCondensed] - \definefontsynonym [LMSans-DemiCondensedOblique] [LMSans10-DemiCondensedOblique] - \definefontsynonym [LMSans-Oblique] [LMSans10-Oblique] -\stoptypescript - -\starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond] - \definefontsynonym [LMTypewriter-CapsRegular] [LMTypewriter10-CapsRegular] - \definefontsynonym [LMTypewriter-CapsOblique] [LMTypewriter10-CapsOblique] - \definefontsynonym [LMTypewriter-Light] [LMTypewriter10-Light] - \definefontsynonym [LMTypewriter-LightOblique] [LMTypewriter10-LightOblique] - \definefontsynonym [LMTypewriter-LightCondensed] [LMTypewriter10-LightCondensed] - \definefontsynonym [LMTypewriter-LightCondensedOblique] [LMTypewriter10-LightCondensedOblique] - \definefontsynonym [LMTypewriter-Dark] [LMTypewriter10-Dark] - \definefontsynonym [LMTypewriter-DarkOblique] [LMTypewriter10-DarkOblique] - \definefontsynonym [LMTypewriter-Regular] [LMTypewriter10-Regular] - \definefontsynonym [LMTypewriter-Italic] [LMTypewriter10-Italic] - \definefontsynonym [LMTypewriter-Oblique] [LMTypewriter10-Oblique] - \definefontsynonym [LMTypewriterVarWd-Regular] [LMTypewriterVarWd10-Regular] - \definefontsynonym [LMTypewriterVarWd-Oblique] [LMTypewriterVarWd10-Oblique] - \definefontsynonym [LMTypewriterVarWd-Light] [LMTypewriterVarWd10-Light] - \definefontsynonym [LMTypewriterVarWd-LightOblique] [LMTypewriterVarWd10-LightOblique] - \definefontsynonym [LMTypewriterVarWd-Dark] [LMTypewriterVarWd10-Dark] - \definefontsynonym [LMTypewriterVarWd-DarkOblique] [LMTypewriterVarWd10-DarkOblique] -\stoptypescript - -\starttypescript [serif] [modern,computer-modern,latin-modern] - \definefontsynonym [ComputerModern] [LMRoman-Regular] - \definefontsynonym [ComputerModern-Italic] [LMRoman-Italic] - \definefontsynonym [ComputerModern-Slanted] [LMRoman-Oblique] - \definefontsynonym [ComputerModern-Bold] [LMRoman-Bold] - \definefontsynonym [ComputerModern-BoldItalic] [LMRoman-BoldItalic] - \definefontsynonym [ComputerModern-BoldSlanted] [LMRoman-BoldOblique] - \definefontsynonym [ComputerModern-Caps] [LMRoman-CapsRegular] - \definefontsynonym [ComputerModern-CapsSlanted] [LMRoman-CapsOblique] -\stoptypescript - -\starttypescript [sans] [modern,computer-modern,latin-modern] - \definefontsynonym [ComputerModernSans] [LMSans-Regular] - \definefontsynonym [ComputerModernSans-Italic] [LMSans-Oblique] - \definefontsynonym [ComputerModernSans-Slanted] [LMSans-Oblique] - \definefontsynonym [ComputerModernSans-Bold] [LMSans-Bold] - \definefontsynonym [ComputerModernSans-BoldItalic] [LMSans-BoldOblique] - \definefontsynonym [ComputerModernSans-BoldSlanted] [LMSans-BoldOblique] - \definefontsynonym [ComputerModernSans-Caps] [LMSans-Regular] % [LMSans-CapsRegular] - \definefontsynonym [ComputerModernSans-CapsSlanted] [LMSans-Oblique] % [LMSans-CapsOblique] -\stoptypescript - -\starttypescript [mono] [modern,computer-modern,latin-modern] - \definefontsynonym [ComputerModernMono] [LMTypewriter-Regular] - \definefontsynonym [ComputerModernMono-Italic] [LMTypewriter-Italic] - \definefontsynonym [ComputerModernMono-Slanted] [LMTypewriter-Oblique] - \definefontsynonym [ComputerModernMono-Bold] [LMTypewriter-Dark] - \definefontsynonym [ComputerModernMono-BoldItalic] [LMTypewriter-DarkOblique] % ! - \definefontsynonym [ComputerModernMono-BoldSlanted] [LMTypewriter-DarkOblique] - \definefontsynonym [ComputerModernMono-Caps] [LMTypewriter-CapsRegular] - \definefontsynonym [ComputerModernMono-CapsSlanted] [LMTypewriter-CapsOblique] - \definefontsynonym [ComputerModernMono-Variable] [LMTypewriterVarWd-Regular] -\stoptypescript - -\starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] - \definefontsynonym [ComputerModernVariable] [LMTypewriterVarWd-Regular] - \definefontsynonym [ComputerModernVariable-Italic] [LMTypewriterVarWd-Oblique] - \definefontsynonym [ComputerModernVariable-Slanted] [LMTypewriterVarWd-Oblique] - \definefontsynonym [ComputerModernVariable-Bold] [LMTypewriterVarWd-Dark] - \definefontsynonym [ComputerModernVariable-BoldItalic] [LMTypewriterVarWd-DarkOblique] - \definefontsynonym [ComputerModernVariable-BoldSlanted] [LMTypewriterVarWd-DarkOblique] - \definefontsynonym [ComputerModernVariable-Caps] [LMTypewriterVarWd-Regular] - \definefontsynonym [ComputerModernVariable-CapsSlanted] [LMTypewriterVarWd-Oblique] -\stoptypescript - -\starttypescript [math] [modern,latin-modern] - \definefontsynonym [LMMathRoman-Regular] [LMMathRoman10-Regular] - \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold] - \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic] - \definefontsynonym [LMMathSymbols-Italic] [LMMathSymbols10-Italic] - \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular] - \definefontsynonym [LMMathItalic-Italic] [LMMathItalic10-Italic] - \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic] -\stoptypescript - -% can boldmath and bfmath be joined? -\starttypescript [boldmath] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold] - \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular] - \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic] - \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic] -\stoptypescript - -\starttypescript [bfmath] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold] - \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular] - \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic] - \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic] -\stoptypescript - -\starttypescript [serif] [modern,latin-modern,computer-modern] - \definefontsynonym [cmr5] [LMRoman5-Regular] - \definefontsynonym [cmr6] [LMRoman6-Regular] - \definefontsynonym [cmr7] [LMRoman7-Regular] - \definefontsynonym [cmr8] [LMRoman8-Regular] - \definefontsynonym [cmr9] [LMRoman9-Regular] - \definefontsynonym [cmr10] [LMRoman10-Regular] - \definefontsynonym [cmr12] [LMRoman12-Regular] - \definefontsynonym [cmr17] [LMRoman17-Regular] - \definefontsynonym [cmbx5] [LMRoman5-Bold] - \definefontsynonym [cmbx6] [LMRoman6-Bold] - \definefontsynonym [cmbx7] [LMRoman7-Bold] - \definefontsynonym [cmbx8] [LMRoman8-Bold] - \definefontsynonym [cmbx9] [LMRoman9-Bold] - \definefontsynonym [cmbx10] [LMRoman10-Bold] - \definefontsynonym [cmbx12] [LMRoman12-Bold] - \definefontsynonym [cmsl10] [LMRoman10-Oblique] - \definefontsynonym [cmsl12] [LMRoman12-Oblique] - \definefontsynonym [cmsl17] [LMRoman17-Oblique] - \definefontsynonym [cmsl8] [LMRoman8-Oblique] - \definefontsynonym [cmsl9] [LMRoman9-Oblique] - \definefontsynonym [cmti7] [LMRoman7-Italic] - \definefontsynonym [cmti8] [LMRoman8-Italic] - \definefontsynonym [cmti9] [LMRoman9-Italic] - \definefontsynonym [cmti10] [LMRoman10-Italic] - \definefontsynonym [cmti12] [LMRoman12-Italic] - \definefontsynonym [cmbsl10] [LMRoman10-DemiOblique] - \definefontsynonym [cmbxsl10] [LMRoman10-BoldOblique] - \definefontsynonym [cmbxti10] [LMRoman10-BoldItalic] - \definefontsynonym [cmcsc10] [LMRoman10-CapsRegular] - \definefontsynonym [cmcscsl10][LMRoman10-CapsOblique] - - %definefontsynonym [cmb10] -\stoptypescript - -\starttypescript [sans] [modern,latin-modern,computer-modern] - \definefontsynonym [cmss8] [LMSans8-Regular] - \definefontsynonym [cmss9] [LMSans9-Regular] - \definefontsynonym [cmss10] [LMSans10-Regular] - \definefontsynonym [cmss12] [LMSans12-Regular] - \definefontsynonym [cmss17] [LMSans17-Regular] - \definefontsynonym [cmssi10] [LMSans10-Oblique] - \definefontsynonym [cmssi12] [LMSans12-Oblique] - \definefontsynonym [cmssi17] [LMSans17-Oblique] - \definefontsynonym [cmssi8] [LMSans8-Oblique] - \definefontsynonym [cmssi9] [LMSans9-Oblique] - \definefontsynonym [cmssq8] [LMSansQuotation8-Regular] - \definefontsynonym [cmssqb8] [LMSansQuotation8-Bold] - \definefontsynonym [cmssqbi8] [LMSansQuotation8-BoldOblique] - \definefontsynonym [cmssqi8] [LMSansQuotation8-Oblique] - \definefontsynonym [cmssbx10] [LMSans10-Bold] - \definefontsynonym [cmssdc10] [LMSans10-DemiCondensed] - \definefontsynonym [cmssbi10] [LMSans10-BoldOblique] - \definefontsynonym [cmssdi10] [LMSans10-DemiCondensedOblique] -\stoptypescript - -\starttypescript [mono] [modern,latin-modern,computer-modern] - \definefontsynonym [cmtt8] [LMTypewriter8-Regular] - \definefontsynonym [cmtt9] [LMTypewriter9-Regular] - \definefontsynonym [cmtt10] [LMTypewriter10-Regular] - \definefontsynonym [cmtt12] [LMTypewriter12-Regular] - \definefontsynonym [cmitt10] [LMTypewriter10-Italic] - \definefontsynonym [cmsltt10] [LMTypewriter10-Oblique] - \definefontsynonym [cmvtt10] [LMTypewriterVarWd10-Regular] - \definefontsynonym [cmvtti10] [LMTypewriterVarWd10-Oblique] - \definefontsynonym [cmtcsc10] [LMTypewriter10-CapsRegular] -\stoptypescript - -\starttypescript [math] [modern,latin-modern,computer-modern] - \definefontsynonym [cmbsy5] [LMMathSymbols5-BoldItalic] - \definefontsynonym [cmbsy7] [LMMathSymbols7-BoldItalic] - \definefontsynonym [cmbsy10] [LMMathSymbols10-BoldItalic] - \definefontsynonym [cmsy5] [LMMathSymbols5-Italic] - \definefontsynonym [cmsy6] [LMMathSymbols6-Italic] - \definefontsynonym [cmsy7] [LMMathSymbols7-Italic] - \definefontsynonym [cmsy8] [LMMathSymbols8-Italic] - \definefontsynonym [cmsy9] [LMMathSymbols9-Italic] - \definefontsynonym [cmsy10] [LMMathSymbols10-Italic] - \definefontsynonym [cmex10] [LMMathExtension10-Regular] - \definefontsynonym [cmmi5] [LMMathItalic5-Italic] - \definefontsynonym [cmmi6] [LMMathItalic6-Italic] - \definefontsynonym [cmmi7] [LMMathItalic7-Italic] - \definefontsynonym [cmmi8] [LMMathItalic8-Italic] - \definefontsynonym [cmmi9] [LMMathItalic9-Italic] - \definefontsynonym [cmmi10] [LMMathItalic10-Italic] - \definefontsynonym [cmmi12] [LMMathItalic12-Italic] - \definefontsynonym [cmmib5] [LMMathItalic5-BoldItalic] - \definefontsynonym [cmmib7] [LMMathItalic7-BoldItalic] - \definefontsynonym [cmmib10] [LMMathItalic10-BoldItalic] -\stoptypescript - -% This will change some day. - -\starttypescript [math] [modern,computer-modern,latin-modern] [name] - \definefontsynonym [OldStyle] [MathItalic] - \definefontsynonym [Fraktur] [eufm10] - \definefontsynonym [Blackboard] [msbm10] - \definefontsynonym [Gothic] [eufm10] - \definefontsynonym [Calligraphic] [cmsy10] -\stoptypescript - -% Concrete Modern Roman : Donald Knuth - -\starttypescript [serif] [concrete] [name] - \definefontsynonym [Serif] [ComputerConcrete] - \definefontsynonym [SerifBold] [ComputerConcrete] - \definefontsynonym [SerifItalic] [ComputerConcrete-Italic] - \definefontsynonym [SerifSlanted] [ComputerConcrete-Slanted] - \definefontsynonym [SerifBoldItalic] [ComputerConcrete-Italic] - \definefontsynonym [SerifBoldSlanted] [ComputerConcrete-Slanted] - \definefontsynonym [SerifCaps] [ComputerConcrete-Caps] -\stoptypescript - -% Euler : Hermann Zapf - -\starttypescript [math] [euler] [name] - \definefontsynonym [MathRoman] [Euler-Roman] % mr - \definefontsynonym [MathItalic] [Euler-Fraktur] % mi - \definefontsynonym [MathExtension] [Euler-Extension] % ex - \definefontsynonym [MathSymbol] [Euler-Symbol] % sy -\stoptypescript - -\starttypescript [boldmath] [euler] [name] - \definefontsynonym [MathRoman] [Euler-Roman-Bold] % mr - \definefontsynonym [MathItalic] [Euler-Fraktur-Bold] % mi - \definefontsynonym [MathExtension] [Euler-Extension] % ex - \definefontsynonym [MathSymbol] [Euler-Symbol-Bold] % sy -\stoptypescript - -\starttypescript [bfmath] [euler] [name] - \definefontsynonym [MathRomanBold] [Euler-Roman-Bold] % mr - \definefontsynonym [MathItalicBold] [Euler-Fraktur-Bold] % mi - \definefontsynonym [MathExtension] [Euler-Extension] % ex - \definefontsynonym [MathSymbolBold] [Euler-Symbol-Bold] % sy -\stoptypescript - -\starttypescript [math] [euler] [name] - \definefontsynonym [OldStyle] [MathItalic] - \definefontsynonym [Fraktur] [MathItalic] - \definefontsynonym [Gothic] [MathItalic] - \definefontsynonym [Calligraphic] [MathSymbol] -\stoptypescript - -\starttypescript [boldmath] [euler] [name] - \definefontsynonym [OldStyle] [MathItalicBold] - \definefontsynonym [Fraktur] [MathItalicBold] - \definefontsynonym [Gothic] [MathItalicBold] - \definefontsynonym [Calligraphic] [MathSymbolBold] -\stoptypescript - -\starttypescript [math,boldmath,bfmath] [euler] [name] - \usemathcollection[eul] -\stoptypescript - -% American Math Society : Michael Spivak - -\starttypescript [math] [modern,computer-modern,latin-modern,ams] [name] - \definefontsynonym [MathAlpha] [AMS-SymbolA] - \definefontsynonym [MathBeta] [AMS-SymbolB] -\stoptypescript - -% Antykwa Torunska : - -\starttypescript [serif] [antykwa-torunska] [name] - \definefontsynonym [Serif] [AntykwaTorunska-Regular] - \definefontsynonym [SerifBold] [AntykwaTorunska-Bold] - \definefontsynonym [SerifItalic] [AntykwaTorunska-Italic] - \definefontsynonym [SerifSlanted] [AntykwaTorunska-Italic] - \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifCaps] [AntykwaTorunska-Cap] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-light] [name] - \definefontsynonym [Serif] [AntykwaTorunska-Light] - \definefontsynonym [SerifBold] [AntykwaTorunska-Medium] - \definefontsynonym [SerifItalic] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifSlanted] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifCaps] [AntykwaTorunska-LightCap] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-cond] [name] - \definefontsynonym [Serif] [AntykwaTorunska-CondRegular] - \definefontsynonym [SerifBold] [AntykwaTorunska-CondBold] - \definefontsynonym [SerifItalic] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifCaps] [AntykwaTorunska-CondCap] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-lightcond] [name] - \definefontsynonym [Serif] [AntykwaTorunska-CondLight] - \definefontsynonym [SerifBold] [AntykwaTorunska-CondMedium] - \definefontsynonym [SerifItalic] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifCaps] [AntykwaTorunska-CondLightCap] -\stoptypescript - -\starttypescript [serif] [antykwa-torunska] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-Cap] - \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-BoldCap] - \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-ItalicCap] - \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-ItalicCap] - \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-BoldItalicCap] - \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-BoldItalicCap] - \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-Cap] - - \definefontvariant [Serif][osf][Caps] - \definefontvariant [Serif][sc] [Caps] - - \definefontsynonym [SerifRegularLight] [AntykwaTorunska-Light] - \definefontsynonym [SerifBoldLight] [AntykwaTorunska-Medium] - \definefontsynonym [SerifItalicLight] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifCapsLight] [AntykwaTorunska-LightCap] - - \definefontvariant [Serif][lt][Light] - - \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondRegular] - \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondBold] - \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondCap] - - \definefontvariant [Serif][cond][Cond] - -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-light] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-LightCap] - \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-MediumCap] - \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-LightItalicCap] - \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-LightItalicCap] - \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-MedItalicCap] - \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-MedItalicCap] - \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-LightCap] - - \definefontvariant [Serif][osf][Caps] - \definefontvariant [Serif][sc] [Caps] - - \definefontsynonym [SerifRegularDark] [AntykwaTorunska-Regular] - \definefontsynonym [SerifBoldDark] [AntykwaTorunska-Bold] - \definefontsynonym [SerifItalicDark] [AntykwaTorunska-Italic] - \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-Italic] - \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifCapsDark] [AntykwaTorunska-Cap] - - \definefontvariant [Serif][dk][Dark] - - \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondLight] - \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondMedium] - \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondLightCap] - - \definefontvariant [Serif][cond][Cond] - -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-cond] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondCap] - \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondBoldCap] - \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondItalicCap] - \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondItalicCap] - \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondBoldItalicCap] - \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondBoldItalicCap] - \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondCap] - - \definefontvariant [Serif][osf][Caps] - \definefontvariant [Serif][sc] [Caps] - - \definefontsynonym [SerifRegularLight] [AntykwaTorunska-CondLight] - \definefontsynonym [SerifBoldLight] [AntykwaTorunska-CondMedium] - \definefontsynonym [SerifItalicLight] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-CondLightItalic] - \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-CondMedItalic] - \definefontsynonym [SerifCapsLight] [AntykwaTorunska-CondLightCap] - - \definefontvariant [Serif][lt][Light] - - \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Regular] - \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Bold] - \definefontsynonym [SerifItalicExp] [AntykwaTorunska-Italic] - \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-Italic] - \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-BoldItalic] - \definefontsynonym [SerifCapsExp] [AntykwaTorunska-Cap] - - \definefontvariant [Serif][exp][Exp] - -\stoptypescript - -\starttypescript [serif] [antykwa-torunska-lightcond] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondLightCap] - \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondMediumCap] - \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondLightItalicCap] - \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondLightItalicCap] - \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondMedItalicCap] - \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondMedItalicCap] - \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondLightCap] - - \definefontvariant [Serif][osf][Caps] - \definefontvariant [Serif][sc] [Caps] - - \definefontsynonym [SerifRegularDark] [AntykwaTorunska-CondRegular] - \definefontsynonym [SerifBoldDark] [AntykwaTorunska-CondBold] - \definefontsynonym [SerifItalicDark] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-CondItalic] - \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-CondBoldItalic] - \definefontsynonym [SerifCapsDark] [AntykwaTorunska-CondCap] - - \definefontvariant [Serif][dk][Dark] - - \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Light] - \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Medium] - \definefontsynonym [SerifItalicExp] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-LightItalic] - \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-MedItalic] - \definefontsynonym [SerifCapsExp] [AntykwaTorunska-LightCap] - - \definefontvariant [Serif][exp][Exp] - -\stoptypescript - -% maybe no -Regular etc - -\starttypescript [math] [antykwa-torunska-light] [name] - \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Light] - \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-LightItalic] - \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Light] - \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Light] -\stoptypescript - -\starttypescript [math] [antykwa-torunska] [name] - \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Regular] - \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-Italic] - \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Regular] - \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Regular] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-cond] [name] - \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondRegular] - \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondItalic] - \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondRegular] - \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondRegular] -\stoptypescript - -\starttypescript [math] [antykwa-torunska-lightcond] [name] - \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondLight] - \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondLightItalic] - \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondLight] - \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondLight] -\stoptypescript - -% Antykwa Poltawskiego : - -\starttypescript [serif] [antykwa-poltawskiego] [name] - \definefontsynonym [Serif] [AntykwaPoltawskiego-Regular] - \definefontsynonym [SerifBold] [AntykwaPoltawskiego-Bold] - \definefontsynonym [SerifItalic] [AntykwaPoltawskiego-Italic] - \definefontsynonym [SerifSlanted] [AntykwaPoltawskiego-Italic] - \definefontsynonym [SerifBoldItalic] [AntykwaPoltawskiego-Bold] - \definefontsynonym [SerifBoldSlanted] [AntykwaPoltawskiego-Bold] - \definefontsynonym [SerifCaps] [AntykwaPoltawskiego-Regular] -\stoptypescript - -% Iwona - -\starttypescript [sans] [iwona-light] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-Light-Regular] - \definefontsynonym [SansItalic] [Iwona-Light-Italic] - \definefontsynonym [SansBold] [Iwona-Medium-Regular] - \definefontsynonym [SansBoldItalic] [Iwona-Medium-Italic] - \definefontsynonym [SansCaps] [Iwona-CapsLight] - \definefontsynonym [SansItalicCaps] [Iwona-CapsLightItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsMedium] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsMediumItalic] -\stoptypescript - -\starttypescript [sans] [iwona-light-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CapsLight-Regular] - \definefontsynonym [SansItalic] [Iwona-CapsLight-Italic] - \definefontsynonym [SansBold] [Iwona-CapsMedium-Regular] - \definefontsynonym [SansBoldItalic] [Iwona-CapsMedium-Italic] -\stoptypescript - -\starttypescript [sans] [iwona] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-Regular] - \definefontsynonym [SansItalic] [Iwona-Italic] - \definefontsynonym [SansBold] [Iwona-Bold] - \definefontsynonym [SansBoldItalic] [Iwona-BoldItalic] - \definefontsynonym [SansCaps] [Iwona-CapsRegular] - \definefontsynonym [SansItalicCaps] [Iwona-CapsItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsBold] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsBoldItalic] -\stoptypescript - -\starttypescript [sans] [iwona-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CapsRegular] - \definefontsynonym [SansItalic] [Iwona-CapsItalic] - \definefontsynonym [SansBold] [Iwona-CapsBold] - \definefontsynonym [SansBoldItalic] [Iwona-CapsBoldItalic] -\stoptypescript - -\starttypescript [sans] [iwona-medium] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-Medium-Regular] - \definefontsynonym [SansItalic] [Iwona-Medium-Italic] - \definefontsynonym [SansBold] [Iwona-Heavy-Regular] - \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic] - \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular] - \definefontsynonym [SansItalicCaps] [Iwona-CapsMedium-Italic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic] -\stoptypescript - -\starttypescript [sans] [iwona-medium-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CapsHeavy-Regular] - \definefontsynonym [SansItalic] [Iwona-CapsMedium-Italic] - \definefontsynonym [SansBold] [Iwona-CapsHeavy-Regular] - \definefontsynonym [SansBoldItalic] [Iwona-CapsHeavy-Italic] -\stoptypescript - -\starttypescript [sans] [iwona-heavy] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-Heavy-Regular] - \definefontsynonym [SansItalic] [Iwona-Heavy-Italic] - \definefontsynonym [SansBold] [Iwona-Heavy-Regular] - \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic] - \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular] - \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic] -\stoptypescript - -\starttypescript [sans] [iwona-heavy-caps] [name] - \setups[font:fallback:sans] - \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular] - \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic] -\stoptypescript - -\starttypescript [sans] [iwona-light-cond] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CondLight-Regular] - \definefontsynonym [SansItalic] [Iwona-CondLight-Italic] - \definefontsynonym [SansBold] [Iwona-CondMedium-Regular] - \definefontsynonym [SansBoldItalic] [Iwona-CondMedium-Italic] - \definefontsynonym [SansCaps] [Iwona-CapsCondLight-Regular] - \definefontsynonym [SansItalicCaps] [Iwona-CapsCondLight-Italic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsCondMedium-Regular] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondMedium-Italic] -\stoptypescript - -\starttypescript [sans] [iwona-light-cond-caps,iwona-light-caps-cond] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CapsCondLight-Regular] - \definefontsynonym [SansItalic] [Iwona-CapsCondLight-Italic] - \definefontsynonym [SansBold] [Iwona-CapsCondMedium-Regular] - \definefontsynonym [SansBoldItalic] [Iwona-CapsCondMedium-Italic] -\stoptypescript - -\starttypescript [sans] [iwona-cond] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CondRegular] - \definefontsynonym [SansItalic] [Iwona-CondItalic] - \definefontsynonym [SansBold] [Iwona-CondBold] - \definefontsynonym [SansBoldItalic] [Iwona-CondBoldItalic] - \definefontsynonym [SansCaps] [Iwona-CapsCondRegular] - \definefontsynonym [SansItalicCaps] [Iwona-CapsCondItalic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsCondBold] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondBoldItalic] -\stoptypescript - -\starttypescript [sans] [iwona-cond-caps,iwona-caps-cond] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CapsCondRegular] - \definefontsynonym [SansItalic] [Iwona-CapsCondItalic] - \definefontsynonym [SansBold] [Iwona-CapsCondBold] - \definefontsynonym [SansBoldItalic] [Iwona-CapsCondBoldItalic] -\stoptypescript - -\starttypescript [sans] [iwona-medium-cond] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CondMedium-Regular] - \definefontsynonym [SansItalic] [Iwona-CondMedium-Italic] - \definefontsynonym [SansBold] [Iwona-CondHeavy-Regular] - \definefontsynonym [SansBoldItalic] [Iwona-CondHeavy-Italic] - \definefontsynonym [SansCaps] [Iwona-CapsCondHeavy-Regular] - \definefontsynonym [SansItalicCaps] [Iwona-CapsCondMedium-Italic] - \definefontsynonym [SansBoldCaps] [Iwona-CapsCondHeavy-Regular] - \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondHeavy-Italic] -\stoptypescript - -\starttypescript [sans] [iwona-medium-cond-caps,iwona-medium-caps-cond] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Iwona-CapsCondHeavy-Regular] - \definefontsynonym [SansItalic] [Iwona-CapsCondMedium-Italic] - \definefontsynonym [SansBold] [Iwona-CapsCondHeavy-Regular] - \definefontsynonym [SansBoldItalic] [Iwona-CapsCondHeavy-Italic] -\stoptypescript - -\starttypescript [math] [iwona-light] [name] - \definefontsynonym [MathRoman] [Iwona-Math-Letters-Light-Regular] - \definefontsynonym [MathItalic] [Iwona-Math-Letters-Light-Italic] - \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Light] - \definefontsynonym [MathExtension] [Iwona-Math-Extension-Light] -\stoptypescript - -\starttypescript [math] [iwona] [name] - \definefontsynonym [MathRoman] [Iwona-Math-Letters-Regular] - \definefontsynonym [MathItalic] [Iwona-Math-Letters-Italic] - \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Regular] - \definefontsynonym [MathExtension] [Iwona-Math-Extension-Regular] -\stoptypescript - -\starttypescript [math] [iwona-medium] [name] - \definefontsynonym [MathRoman] [Iwona-Math-Letters-Medium-Regular] - \definefontsynonym [MathItalic] [Iwona-Math-Letters-Medium-Italic] - \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Medium] - \definefontsynonym [MathExtension] [Iwona-Math-Extension-Medium] -\stoptypescript - -\starttypescript [math] [iwona-heavy] [name] - \definefontsynonym [MathRoman] [Iwona-Math-Letters-Heavy-Regular] - \definefontsynonym [MathItalic] [Iwona-Math-Letters-Heavy-Italic] - \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Heavy] - \definefontsynonym [MathExtension] [Iwona-Math-Extension-Heavy] -\stoptypescript - -% Kurier - -\starttypescript [sans] [kurier-light] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Kurier-Light-Regular] - \definefontsynonym [SansItalic] [Kurier-Light-Italic] - \definefontsynonym [SansBold] [Kurier-Medium-Regular] - \definefontsynonym [SansBoldItalic] [Kurier-Medium-Italic] -\stoptypescript - -\starttypescript [sans] [kurier] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Kurier-Regular] - \definefontsynonym [SansItalic] [Kurier-Italic] - \definefontsynonym [SansBold] [Kurier-Bold] - \definefontsynonym [SansBoldItalic] [Kurier-BoldItalic] -\stoptypescript - -\starttypescript [sans] [kurier-medium] [name] - \setups[font:fallback:sans] - \definefontsynonym [Sans] [Kurier-Medium-Regular] - \definefontsynonym [SansItalic] [Kurier-Medium-Italic] - \definefontsynonym [SansBold] [Kurier-Heavy-Regular] - \definefontsynonym [SansBoldItalic] [Kurier-Heavy-Italic] -\stoptypescript - -\starttypescript [math] [kurier-light] [name] - \definefontsynonym [MathRoman] [Kurier-Math-Letters-Light-Regular] - \definefontsynonym [MathItalic] [Kurier-Math-Letters-Light-Italic] - \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Light] - \definefontsynonym [MathExtension] [Kurier-Math-Extension-Light] -\stoptypescript - -\starttypescript [math] [kurier] [name] - \definefontsynonym [MathRoman] [Kurier-Math-Letters-Regular] - \definefontsynonym [MathItalic] [Kurier-Math-Letters-Italic] - \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Regular] - \definefontsynonym [MathExtension] [Kurier-Math-Extension-Regular] -\stoptypescript - -\starttypescript [math] [kurier-medium] [name] - \definefontsynonym [MathRoman] [Kurier-Math-Letters-Medium-Regular] - \definefontsynonym [MathItalic] [Kurier-Math-Letters-Medium-Italic] - \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Medium] - \definefontsynonym [MathExtension] [Kurier-Math-Extension-Medium] -\stoptypescript - -% Bookman : - -\starttypescript [serif] [bookman] [name] - \definefontsynonym [Serif] [Bookman-Light] - \definefontsynonym [SerifItalic] [Bookman-LightItalic] - \definefontsynonym [SerifBold] [Bookman-DemiBold] - \definefontsynonym [SerifBoldItalic] [Bookman-DemiBoldItalic] - \definefontsynonym [SerifSlanted] [Bookman-LightSlanted] - \definefontsynonym [SerifBoldSlanted] [Bookman-DemiBoldSlanted] - \definefontsynonym [SerifCaps] [Bookman-Light-Caps] -\stoptypescript - -% Chancery : Zapf - -\starttypescript [calligraphy] [chancery] [name] - \definefontsynonym [Calligraphy] [Chancery] -\stoptypescript - -% Schoolbook : - -\starttypescript [serif] [schoolbook] [name] - \definefontsynonym [Serif] [Schoolbook-Roman] - \definefontsynonym [SerifItalic] [Schoolbook-Italic] - \definefontsynonym [SerifBold] [Schoolbook-Bold] - \definefontsynonym [SerifBoldItalic] [Schoolbook-BoldItalic] - \definefontsynonym [SerifSlanted] [Schoolbook-RomanSlanted] - \definefontsynonym [SerifBoldSlanted] [Schoolbook-BoldSlanted] - \definefontsynonym [SerifCaps] [Schoolbook-Roman-Caps] -\stoptypescript - -% Utopia : Adobe - -\starttypescript [serif] [utopia] [name] - \definefontsynonym [Serif] [Utopia-Regular] - \definefontsynonym [SerifItalic] [Utopia-Italic] - \definefontsynonym [SerifBold] [Utopia-Bold] - \definefontsynonym [SerifBoldItalic] [Utopia-BoldItalic] - \definefontsynonym [SerifSlanted] [Utopia-Slanted] - \definefontsynonym [SerifBoldSlanted] [Utopia-BoldSlanted] - \definefontsynonym [SerifCaps] [Utopia-Regular-Caps] -\stoptypescript - -% Fourier : Michael Bovani - -\starttypescript [serif] [fourier] [name] - \definefontsynonym [Serif] [Fourier-Regular] - \definefontsynonym [SerifSlanted] [Fourier-Slanted] - \definefontsynonym [SerifItalic] [Fourier-Italic] - \definefontsynonym [SerifCaps] [Fourier-RegularCaps] - \definefontsynonym [SerifBold] [Fourier-Bold] - \definefontsynonym [SerifBoldSlanted] [Fourier-BoldSlanted] - \definefontsynonym [SerifBoldItalic] [Fourier-BoldItalic] - \definefontsynonym [SerifBoldCaps] [Fourier-BoldCaps] - - \definefontsynonym [Serif-Expert] [Fourier-Regular-Expert] - \definefontsynonym [SerifSlanted-Expert] [Fourier-Slanted-Expert] - \definefontsynonym [SerifItalic-Expert] [Fourier-Italic-Expert] - \definefontsynonym [SerifCaps-Expert] [Fourier-RegularCaps-Expert] - \definefontsynonym [SerifSemiBold-Expert] [Fourier-Semi-Expert] - \definefontsynonym [SerifSemiSlanted-Expert] [Fourier-SemiSlanted-Expert] - \definefontsynonym [SerifSemiItalic-Expert] [Fourier-SemiItalic-Expert] - \definefontsynonym [SerifSemiCaps-Expert] [Fourier-SemiCaps-Expert] - \definefontsynonym [SerifBold-Expert] [Fourier-Bold-Expert] - \definefontsynonym [SerifBoldSlanted-Expert] [Fourier-BoldSlanted-Expert] - \definefontsynonym [SerifBoldItalic-Expert] [Fourier-BoldItalic-Expert] - \definefontsynonym [SerifBlack-Expert] [Fourier-Black-Expert] - - \definefontsynonym [Serif-OldStyle] [Fourier-Regular-OldStyle] - \definefontsynonym [SerifSlanted-OldStyle] [Fourier-Slanted-OldStyle] - \definefontsynonym [SerifItalic-OldStyle] [Fourier-Italic-OldStyle] - \definefontsynonym [SerifCaps-OldStyle] [Fourier-RegularCaps-OldStyle] - \definefontsynonym [SerifSemiBold-OldStyle] [Fourier-Semi-OldStyle] - \definefontsynonym [SerifSemiSlanted-OldStyle] [Fourier-SemiSlanted-OldStyle] - \definefontsynonym [SerifSemiItalic-OldStyle] [Fourier-SemiItalic-OldStyle] - \definefontsynonym [SerifSemiCaps-OldStyle] [Fourier-SemiCaps-OldStyle] - \definefontsynonym [SerifBold-OldStyle] [Fourier-Bold-OldStyle] - \definefontsynonym [SerifBoldSlanted-OldStyle] [Fourier-BoldSlanted-OldStyle] - \definefontsynonym [SerifBoldItalic-OldStyle] [Fourier-BoldItalic-OldStyle] - \definefontsynonym [SerifBlack-OldStyle] [Fourier-Black-OldStyle] - \definefontsynonym [SerifBlackSlanted-OldStyle] [Fourier-BlackSlanted-OldStyle] -\stoptypescript - -\starttypescript [math] [fourier] [name] - \definefontsynonym [MathRoman] [Fourier-Math-Letters] - \definefontsynonym [MathItalic] [Fourier-Math-Letters-Italic] - \definefontsynonym [MathSymbol] [Fourier-Math-Symbols] - \definefontsynonym [MathExtension] [Fourier-Math-Extension] -\stoptypescript - -\starttypescript [math] [fourier] [name] % todo - \definefontsynonym [OldStyle] [Serif-OldStyle] % strange, no oldstyles - \definefontsynonym [Fraktur] [eufm10] - \definefontsynonym [Blackboard] [msbm10] - \definefontsynonym [Gothic] [eufm10] - \definefontsynonym [Calligraphic] [eusm10] -\stoptypescript - -% Charter : - -\starttypescript [serif] [charter] [name] - \definefontsynonym [Serif] [Charter-Roman] - \definefontsynonym [SerifItalic] [Charter-Italic] - \definefontsynonym [SerifBold] [Charter-Bold] - \definefontsynonym [SerifBoldItalic] [Charter-BoldItalic] - \definefontsynonym [SerifSlanted] [Charter-Slanted] - \definefontsynonym [SerifBoldSlanted] [Charter-BoldSlanted] - \definefontsynonym [SerifCaps] [Charter-Roman-Caps] -\stoptypescript - -% Times : - -\starttypescript [serif] [times] [name] - \definefontsynonym [Serif] [Times-Roman] - \definefontsynonym [SerifBold] [Times-Bold] - \definefontsynonym [SerifItalic] [Times-Italic] - \definefontsynonym [SerifSlanted] [Times-Italic] - \definefontsynonym [SerifBoldItalic] [Times-BoldItalic] - \definefontsynonym [SerifBoldSlanted] [Times-BoldItalic] - \definefontsynonym [SerifCaps] [Times-Caps] -\stoptypescript - -\starttypescript [math] [times] [name] - \definefontsynonym [MathRoman] [Times-Roman-Upright] - \definefontsynonym [MathExtension] [Times-Math-Extension] - \definefontsynonym [MathItalic] [Times-Math-Italic] - \definefontsynonym [MathSymbol] [Times-Math-Symbols] - \definefontsynonym [MathAlpha] [Times-Math-SymbolsA] - \definefontsynonym [MathBeta] [Times-Math-SymbolsB] -\stoptypescript - -\starttypescript [math] [times] [name] - \definefontsynonym [OldStyle] [MathItalic] - \definefontsynonym [Fraktur] [eufm10] - \definefontsynonym [Blackboard] [MathBeta] - \definefontsynonym [Gothic] [eufm10] - \definefontsynonym [Calligraphic] [eusm10] -\stoptypescript - -% Helvetica : - -\starttypescript [sans] [helvetica] [name] - \definefontsynonym [Sans] [Helvetica] - \definefontsynonym [SansBold] [Helvetica-Bold] - \definefontsynonym [SansItalic] [Helvetica-Oblique] - \definefontsynonym [SansSlanted] [Helvetica-Oblique] - \definefontsynonym [SansBoldItalic] [Helvetica-BoldOblique] - \definefontsynonym [SansBoldSlanted] [Helvetica-BoldOblique] - \definefontsynonym [SansCaps] [Helvetica-Caps] -\stoptypescript - -\starttypescript [math] [helvetica] [name] - \definefontsynonym [MathRoman] [Helvetica-MathRoman] - \definefontsynonym [MathExtension] [Helvetica-MathExtendedSymbols] - \definefontsynonym [MathItalic] [Helvetica-MathItalics] - \definefontsynonym [MathSymbol] [Helvetica-MathSymbols] -\stoptypescript - -% Courier : - -\starttypescript [mono] [courier] [name] - \definefontsynonym [Mono] [Courier] - \definefontsynonym [MonoBold] [Courier-Bold] - \definefontsynonym [MonoItalic] [Courier-Oblique] - \definefontsynonym [MonoSlanted] [Courier-Oblique] - \definefontsynonym [MonoBoldItalic] [Courier-BoldOblique] - \definefontsynonym [MonoBoldSlanted] [Courier-BoldOblique] - \definefontsynonym [MonoCaps] [Courier] -\stoptypescript - -% Palatino : Hermann Zapf / URW - -\starttypescript [serif] [palatino] [name] - \definefontsynonym [Serif] [Palatino] - \definefontsynonym [SerifBold] [Palatino-Bold] - \definefontsynonym [SerifItalic] [Palatino-Italic] - \definefontsynonym [SerifSlanted] [Palatino-Slanted] - \definefontsynonym [SerifBoldItalic] [Palatino-BoldItalic] - \definefontsynonym [SerifBoldSlanted] [Palatino-BoldSlanted] - \definefontsynonym [SerifCaps] [Palatino-Caps] -\stoptypescript - -\starttypescript [math] [palatino] [name] - \definefontsynonym [MathRoman] [Palatino-Roman-Upright] - \definefontsynonym [MathExtension] [Palatino-Math-Extension] - \definefontsynonym [MathItalic] [Palatino-Math-Italic] - \definefontsynonym [MathSymbol] [Palatino-Math-Symbols] - \definefontsynonym [MathAlpha] [Palatino-Math-SymbolsA] - \definefontsynonym [MathBeta] [Palatino-Math-SymbolsB] -\stoptypescript - -\starttypescript [math] [palatino] [name] - \definefontsynonym [OldStyle] [MathItalic] - \definefontsynonym [Fraktur] [eufm10] - \definefontsynonym [Blackboard] [MathBeta] - \definefontsynonym [Gothic] [eufm10] - \definefontsynonym [Calligraphic] [eusm10] -\stoptypescript - -% bonus definitions / will disappear - -\starttypescript [serif] [palatino] [name] - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularOsF] [TeXPalladioL-SC] - \definefontsynonym [SerifItalicOsF] [TeXPalladioL-ItalicOsF] - \definefontsynonym [SerifBoldOsF] [TeXPalladioL-BoldOsF] - \definefontsynonym [SerifBoldItalicOsF][TeXPalladioL-BoldItalicOsF] - \definefontsynonym [SerifCapsOsF] [TeXPalladioL-SC] -\stoptypescript - -% TeXGyre - -% name definitions & prefixes - -\definetypescriptprefix [n:pagella] [TeXGyrePagella] \definetypescriptprefix [n:palatino] [TeXGyrePagella] -\definetypescriptprefix [n:termes] [TeXGyreTermes] \definetypescriptprefix [n:times] [TeXGyreTermes] -\definetypescriptprefix [n:heros] [TeXGyreHeros] \definetypescriptprefix [n:helvetica] [TeXGyreHeros] -\definetypescriptprefix [n:bonum] [TeXGyreBonum] \definetypescriptprefix [n:bookman] [TeXGyreBonum] -\definetypescriptprefix [n:schola] [TeXGyreSchola] \definetypescriptprefix [n:schoolbook] [TeXGyreSchola] -\definetypescriptprefix [n:adventor] [TeXGyreAdventor] %definetypescriptprefix [n:adventor] [TeXGyreAdventor] -\definetypescriptprefix [n:cursor] [TeXGyreCursor] \definetypescriptprefix [n:courier] [TeXGyreCursor] -\definetypescriptprefix [n:chorus] [TeXGyreChorus] \definetypescriptprefix [n:chancery] [TeXGyreChorus] % not the full set - -\starttypescript [serif] [pagella,palatino,termes,times,bonum,bookman,schola,schoolbook] [name] - \definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular] - \definefontsynonym [SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic] - \definefontsynonym [SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold] - \definefontsynonym [SerifBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] - \definefontsynonym [SerifSlanted] [SerifItalic] - \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic] - \definefontsynonym [SerifCaps] [\typescriptprefix{n:\typescripttwo}-Caps] - - \definefontvariant [Serif][osf][Caps] - \definefontvariant [Serif][sc] [Caps] - - \definefontsynonym [SerifRegular] [Serif] - \definefontsynonym [SerifRegularCaps] [SerifCaps] - \definefontsynonym [SerifItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps] - \definefontsynonym [SerifBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps] - \definefontsynonym [SerifBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] - \definefontsynonym [SerifSlantedCaps] [SerifItalicCaps] - \definefontsynonym [SerifBoldSlantedCaps] [SerifBoldItalicCaps] - \definefontsynonym [SerifCapsCaps] [SerifCaps] -\stoptypescript - -\starttypescript [serif] [chorus,chancery] [name] - \definefontsynonym [SerifMediumItalic] [TeXGyreChorus-MediumItalic] - \definefontsynonym [Serif] [SerifMediumItalic] - \definefontsynonym [SerifItalic] [SerifMediumItalic] - \definefontsynonym [SerifBold] [SerifMediumItalic] - \definefontsynonym [SerifBoldItalic] [SerifMediumItalic] - \definefontsynonym [SerifSlanted] [SerifMediumItalic] - \definefontsynonym [SerifBoldSlanted] [SerifMediumItalic] - \definefontsynonym [SerifCaps] [SerifMediumItalic] -\stoptypescript - -\starttypescript [calligraphy] [chorus,chancery] [name] - \definefontsynonym [Calligraphy] [TeXGyreChorus-MediumItalic] -\stoptypescript - -\starttypescript [sans] [heros,helvetica,adventor] [name] - \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular] - \definefontsynonym [SansItalic] [\typescriptprefix{n:\typescripttwo}-Italic] - \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold] - \definefontsynonym [SansBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] - \definefontsynonym [SansSlanted] [SansItalic] - \definefontsynonym [SansBoldSlanted] [SansBoldItalic] - \definefontsynonym [SansCaps] [\typescriptprefix{n:\typescripttwo}-Caps] - - \definefontvariant [Sans][osf][Caps] - \definefontvariant [Sans][sc] [Caps] - - \definefontsynonym [SansRegular] [Sans] - \definefontsynonym [SansRegularCaps] [SansCaps] - \definefontsynonym [SansItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps] - \definefontsynonym [SansBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps] - \definefontsynonym [SansBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] - \definefontsynonym [SansSlantedCaps] [SansItalicCaps] - \definefontsynonym [SansBoldSlantedCaps] [SansBoldItalicCaps] - \definefontsynonym [SansCapsCaps] [SansCaps] -\stoptypescript - -\starttypescript [mono] [cursor,courier] [name] - \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular] - \definefontsynonym [MonoItalic] [\typescriptprefix{n:\typescripttwo}-Italic] - \definefontsynonym [MonoBold] [\typescriptprefix{n:\typescripttwo}-Bold] - \definefontsynonym [MonoBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic] - \definefontsynonym [MonoSlanted] [MonoItalic] - \definefontsynonym [MonoBoldSlanted] [MonoBoldItalic] - - \definefontvariant [Mono][osf][Caps] - \definefontvariant [Mono][sc] [Caps] - - \definefontsynonym [MonoRegular] [Mono] - \definefontsynonym [MonoRegularCaps] [MonoCaps] - \definefontsynonym [MonoItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps] - \definefontsynonym [MonoBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps] - \definefontsynonym [MonoBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] - \definefontsynonym [MonoSlantedCaps] [MonoItalicCaps] - \definefontsynonym [MonoBoldSlantedCaps] [MonoBoldItalicCaps] - \definefontsynonym [MonoCapsCaps] [MonoCaps] -\stoptypescript - -\stoptypescriptcollection +\loadmarkfile{type-tmf} \endinput diff --git a/tex/context/base/typo-krn.lua b/tex/context/base/typo-krn.lua index 598db6c27..ea416477f 100644 --- a/tex/context/base/typo-krn.lua +++ b/tex/context/base/typo-krn.lua @@ -13,7 +13,7 @@ local utfchar = utf.char local has_attribute = node.has_attribute local unset_attribute = node.unset_attribute -local slide_node_list = node.slide +local find_node_tail = node.tail or node.slide local free_node = node.free local copy_node = node.copy local insert_node_before = node.insert_before @@ -66,7 +66,7 @@ local function process(namespace,attribute,head,force) local c = start.components if c then local s = start - local tail = slide_node_list(c) + local tail = find_node_tail(c) if s.prev then s.prev.next = c c.prev = s.prev @@ -128,7 +128,7 @@ local function process(namespace,attribute,head,force) end if post then -- must pair with start local after = copy_node(disc.next) - local tail = slide_node_list(post) + local tail = find_node_tail(post) tail.next = after after.prev = tail after.next = nil @@ -140,7 +140,7 @@ local function process(namespace,attribute,head,force) if replace then -- must pair with start and start.prev local before = copy_node(disc.prev) local after = copy_node(disc.next) - local tail = slide_node_list(replace) + local tail = find_node_tail(replace) replace.prev = before before.next = replace before.prev = nil diff --git a/tex/context/base/typo-mir.lua b/tex/context/base/typo-mir.lua index fb575d093..f2cbbb4fa 100644 --- a/tex/context/base/typo-mir.lua +++ b/tex/context/base/typo-mir.lua @@ -172,7 +172,7 @@ function mirror.process(namespace,attribute,start) -- todo: make faster local attr = has_attribute(current,attribute) if attr and attr > 0 then unset_attribute(current,attribute) -- slow, needed? - --~ set_attribute(current,attribute,0) -- might be faster +--~ set_attribute(current,attribute,0) -- might be faster if attr == 1 then -- bidi parsing mode elseif attr ~= prevattr then @@ -319,8 +319,8 @@ function mirror.process(namespace,attribute,start) -- todo: make faster local subtype = current.subtype if subtype == 6 then local dir = current.dir - local d = dir:sub(2,2) - if dir:find(".R.") then + local d = dir:sub(2,2) -- -- -- -- -- why is this not used + if dir:find(".R.") then -- -- d == "R" or just dir == "TRT" autodir = -1 else autodir = 1 diff --git a/tex/context/base/unic-000.mkii b/tex/context/base/unic-000.mkii new file mode 100644 index 000000000..cb4c1fe8a --- /dev/null +++ b/tex/context/base/unic-000.mkii @@ -0,0 +1,135 @@ +%D \module +%D [ file=unic-000, +%D version=2002.12.03, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 0, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 + +% \startunicodevector 0 +% \ifcase\numexpr(#1-159) +% \@@unknownchar\or +% \@@unknownchar\or +% exclamdown\or +% textcent\or +% textsterling\or +% textcurrency\or +% ydiaeresis\else +% \@@unknownchar +% \fi +% \stopunicodevector +% +% 20\% faster: + +\startunicodevector 0 + \expandafter\strippedcsname + \ifcase\numexpr#1-159\relax + \unknownchar \or + \nonbreakablespace \or + \exclamdown \or + \textcent \or + \textsterling \or + \textcurrency \or + \textyen \or + \textbrokenbar \or + \sectionmark \or + \textdiaeresis \or + \copyright \or + \ordfeminine \or % FEMININE ORDINAL INDICATOR + \leftguillemot \or % LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + \textlognot \or + \softhyphen \or + \registered \or + \textmacron \or + \textdegree \or + \textpm \or + \twosuperior \or + \threesuperior \or + \textacute \or + \textmu \or % MICRO SIGN + \paragraphmark \or % PILCROW SIGN + \periodcentered \or + \textcedilla \or + \onesuperior \or + \ordmasculine \or % MASCULINE ORDINAL INDICATOR + \rightguillemot \or % RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + \onequarter \or + \onehalf \or + \threequarter \or + \questiondown \or + \Agrave \or + \Aacute \or + \Acircumflex \or + \Atilde \or + \Adiaeresis \or + \Aring \or + \AEligature \or + \Ccedilla \or + \Egrave \or + \Eacute \or + \Ecircumflex \or + \Ediaeresis \or + \Igrave \or + \Iacute \or + \Icircumflex \or + \Idiaeresis \or + \Eth \or % \Eth \or + \Ntilde \or + \Ograve \or + \Oacute \or + \Ocircumflex \or + \Otilde \or + \Odiaeresis \or + \textmultiply \or + \Ostroke \or + \Ugrave \or + \Uacute \or + \Ucircumflex \or + \Udiaeresis \or + \Yacute \or + \Thorn \or + \ssharp \or + \agrave \or + \aacute \or + \acircumflex \or + \atilde \or + \adiaeresis \or + \aring \or + \aeligature \or + \ccedilla \or + \egrave \or + \eacute \or + \ecircumflex \or + \ediaeresis \or + \igrave \or + \iacute \or + \icircumflex \or + \idiaeresis \or + \eth \or % \eth \or + \ntilde \or + \ograve \or + \oacute \or + \ocircumflex \or + \otilde \or + \odiaeresis \or + \textdiv \or + \ostroke \or + \ugrave \or + \uacute \or + \ucircumflex \or + \udiaeresis \or + \yacute \or + \thorn \or + \ydiaeresis \else + \unknownchar + \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-000.tex b/tex/context/base/unic-000.tex deleted file mode 100644 index cb4c1fe8a..000000000 --- a/tex/context/base/unic-000.tex +++ /dev/null @@ -1,135 +0,0 @@ -%D \module -%D [ file=unic-000, -%D version=2002.12.03, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 0, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 - -% \startunicodevector 0 -% \ifcase\numexpr(#1-159) -% \@@unknownchar\or -% \@@unknownchar\or -% exclamdown\or -% textcent\or -% textsterling\or -% textcurrency\or -% ydiaeresis\else -% \@@unknownchar -% \fi -% \stopunicodevector -% -% 20\% faster: - -\startunicodevector 0 - \expandafter\strippedcsname - \ifcase\numexpr#1-159\relax - \unknownchar \or - \nonbreakablespace \or - \exclamdown \or - \textcent \or - \textsterling \or - \textcurrency \or - \textyen \or - \textbrokenbar \or - \sectionmark \or - \textdiaeresis \or - \copyright \or - \ordfeminine \or % FEMININE ORDINAL INDICATOR - \leftguillemot \or % LEFT-POINTING DOUBLE ANGLE QUOTATION MARK - \textlognot \or - \softhyphen \or - \registered \or - \textmacron \or - \textdegree \or - \textpm \or - \twosuperior \or - \threesuperior \or - \textacute \or - \textmu \or % MICRO SIGN - \paragraphmark \or % PILCROW SIGN - \periodcentered \or - \textcedilla \or - \onesuperior \or - \ordmasculine \or % MASCULINE ORDINAL INDICATOR - \rightguillemot \or % RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK - \onequarter \or - \onehalf \or - \threequarter \or - \questiondown \or - \Agrave \or - \Aacute \or - \Acircumflex \or - \Atilde \or - \Adiaeresis \or - \Aring \or - \AEligature \or - \Ccedilla \or - \Egrave \or - \Eacute \or - \Ecircumflex \or - \Ediaeresis \or - \Igrave \or - \Iacute \or - \Icircumflex \or - \Idiaeresis \or - \Eth \or % \Eth \or - \Ntilde \or - \Ograve \or - \Oacute \or - \Ocircumflex \or - \Otilde \or - \Odiaeresis \or - \textmultiply \or - \Ostroke \or - \Ugrave \or - \Uacute \or - \Ucircumflex \or - \Udiaeresis \or - \Yacute \or - \Thorn \or - \ssharp \or - \agrave \or - \aacute \or - \acircumflex \or - \atilde \or - \adiaeresis \or - \aring \or - \aeligature \or - \ccedilla \or - \egrave \or - \eacute \or - \ecircumflex \or - \ediaeresis \or - \igrave \or - \iacute \or - \icircumflex \or - \idiaeresis \or - \eth \or % \eth \or - \ntilde \or - \ograve \or - \oacute \or - \ocircumflex \or - \otilde \or - \odiaeresis \or - \textdiv \or - \ostroke \or - \ugrave \or - \uacute \or - \ucircumflex \or - \udiaeresis \or - \yacute \or - \thorn \or - \ydiaeresis \else - \unknownchar - \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-001.mkii b/tex/context/base/unic-001.mkii new file mode 100644 index 000000000..e37de9136 --- /dev/null +++ b/tex/context/base/unic-001.mkii @@ -0,0 +1,220 @@ +%D \module +%D [ file=unic-001, +%D version=2002.12.03, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 1, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Readable: +%D +%D \starttyping +%D \startunicodevector 1 +%D \ifcase#1\or +%D unknownchar\or Abreve\or abreve\or +%D .... +%D Zcaron\or zcaron\else unknownchar\fi +%D \stopunicodevector +%D +%D \stoptyping +%D But we can speed things up, watch how we avoid zero and \TEX's +%D automatically added \type {\relax}. + +% remark: +% - gcommaaccent, kcomaaccent, lcomaaccent, ncomaaccent, rcomaaccent +% bear the name "WITH CEDILLA" in Unicode +% - scomaaccent and tcomaaccent point to the "WITH CEDILLA" in the +% Adobe Glyph List + +\startunicodevector 1 + \expandafter\strippedcsname + \ifcase\numexpr#1\relax + \Amacron \or + \amacron \or + \Abreve \or + \abreve \or + \Aogonek \or + \aogonek \or + \Cacute \or + \cacute \or + \Ccircumflex \or + \ccircumflex \or + \Cdotaccent \or + \cdotaccent \or + \Ccaron \or + \ccaron \or + \Dcaron \or + \dcaron \or + \Dstroke \or + \dstroke \or + \Emacron \or + \emacron \or + \Ebreve \or + \ebreve \or + \Edotaccent \or + \edotaccent \or + \Eogonek \or + \eogonek \or + \Ecaron \or + \ecaron \or + \Gcircumflex \or + \gcircumflex \or + \Gbreve \or + \gbreve \or + \Gdotaccent \or + \gdotaccent \or + \Gcommaaccent \or % WITH CEDILLA + \gcommaaccent \or % WITH CEDILLA + \Hcircumflex \or + \hcircumflex \or + \Hstroke \or + \hstroke \or + \Itilde \or + \itilde \or + \Imacron \or + \imacron \or + \Ibreve \or + \ibreve \or + \Iogonek \or + \iogonek \or + \Idotaccent \or + \dotlessi \or + \IJligature \or + \ijligature \or + \Jcircumflex \or + \jcircumflex \or + \Kcommaaccent \or % WITH CEDILLA + \kcommaaccent \or % WITH CEDILLA + \kkra \or % \kkra \or + \Lacute \or + \lacute \or + \Lcommaaccent \or % WITH CEDILLA + \lcommaaccent \or % WITH CEDILLA + \Lcaron \or + \lcaron \or + \Ldotmiddle \or % \Ldotmiddle \or + \ldotmiddle \or % \ldotmiddle \or + \Lstroke \or + \lstroke \or + \Nacute \or + \nacute \or + \Ncommaaccent \or % WITH CEDILLA + \ncommaaccent \or % WITH CEDILLA + \Ncaron \or + \ncaron \or + \napostrophe \or + \Neng \or + \neng \or + \Omacron \or + \omacron \or + \Obreve \or + \obreve \or + \Ohungarumlaut \or + \ohungarumlaut \or + \OEligature \or + \oeligature \or + \Racute \or + \racute \or + \Rcommaaccent \or % WITH CEDILLA + \rcommaaccent \or % WITH CEDILLA + \Rcaron \or + \rcaron \or + \Sacute \or + \sacute \or + \Scircumflex \or + \scircumflex \or + \Scedilla \or + \scedilla \or + \Scaron \or + \scaron \or + \Tcedilla \or + \tcedilla \or + \Tcaron \or + \tcaron \or + \Tstroke \or + \tstroke \or + \Utilde \or + \utilde \or + \Umacron \or + \umacron \or + \Ubreve \or + \ubreve \or + \Uring \or + \uring \or + \Uhungarumlaut \or + \uhungarumlaut \or + \Uogonek \or + \uogonek \or + \Wcircumflex \or + \wcircumflex \or + \Ycircumflex \or + \ycircumflex \or + \Ydiaeresis \or + \Zacute \or + \zacute \or + \Zdotaccent \or + \zdotaccent \or + \Zcaron \or + \zcaron \or + \slong \or % 127 \slong \else + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \textflorin \or % 146 + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \Ohorn \or % 160 + \ohorn \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \unknownchar \or + \Uhorn \or % 175 + \uhorn \else + \unknownchar + \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-001.tex b/tex/context/base/unic-001.tex deleted file mode 100644 index e37de9136..000000000 --- a/tex/context/base/unic-001.tex +++ /dev/null @@ -1,220 +0,0 @@ -%D \module -%D [ file=unic-001, -%D version=2002.12.03, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 1, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Readable: -%D -%D \starttyping -%D \startunicodevector 1 -%D \ifcase#1\or -%D unknownchar\or Abreve\or abreve\or -%D .... -%D Zcaron\or zcaron\else unknownchar\fi -%D \stopunicodevector -%D -%D \stoptyping -%D But we can speed things up, watch how we avoid zero and \TEX's -%D automatically added \type {\relax}. - -% remark: -% - gcommaaccent, kcomaaccent, lcomaaccent, ncomaaccent, rcomaaccent -% bear the name "WITH CEDILLA" in Unicode -% - scomaaccent and tcomaaccent point to the "WITH CEDILLA" in the -% Adobe Glyph List - -\startunicodevector 1 - \expandafter\strippedcsname - \ifcase\numexpr#1\relax - \Amacron \or - \amacron \or - \Abreve \or - \abreve \or - \Aogonek \or - \aogonek \or - \Cacute \or - \cacute \or - \Ccircumflex \or - \ccircumflex \or - \Cdotaccent \or - \cdotaccent \or - \Ccaron \or - \ccaron \or - \Dcaron \or - \dcaron \or - \Dstroke \or - \dstroke \or - \Emacron \or - \emacron \or - \Ebreve \or - \ebreve \or - \Edotaccent \or - \edotaccent \or - \Eogonek \or - \eogonek \or - \Ecaron \or - \ecaron \or - \Gcircumflex \or - \gcircumflex \or - \Gbreve \or - \gbreve \or - \Gdotaccent \or - \gdotaccent \or - \Gcommaaccent \or % WITH CEDILLA - \gcommaaccent \or % WITH CEDILLA - \Hcircumflex \or - \hcircumflex \or - \Hstroke \or - \hstroke \or - \Itilde \or - \itilde \or - \Imacron \or - \imacron \or - \Ibreve \or - \ibreve \or - \Iogonek \or - \iogonek \or - \Idotaccent \or - \dotlessi \or - \IJligature \or - \ijligature \or - \Jcircumflex \or - \jcircumflex \or - \Kcommaaccent \or % WITH CEDILLA - \kcommaaccent \or % WITH CEDILLA - \kkra \or % \kkra \or - \Lacute \or - \lacute \or - \Lcommaaccent \or % WITH CEDILLA - \lcommaaccent \or % WITH CEDILLA - \Lcaron \or - \lcaron \or - \Ldotmiddle \or % \Ldotmiddle \or - \ldotmiddle \or % \ldotmiddle \or - \Lstroke \or - \lstroke \or - \Nacute \or - \nacute \or - \Ncommaaccent \or % WITH CEDILLA - \ncommaaccent \or % WITH CEDILLA - \Ncaron \or - \ncaron \or - \napostrophe \or - \Neng \or - \neng \or - \Omacron \or - \omacron \or - \Obreve \or - \obreve \or - \Ohungarumlaut \or - \ohungarumlaut \or - \OEligature \or - \oeligature \or - \Racute \or - \racute \or - \Rcommaaccent \or % WITH CEDILLA - \rcommaaccent \or % WITH CEDILLA - \Rcaron \or - \rcaron \or - \Sacute \or - \sacute \or - \Scircumflex \or - \scircumflex \or - \Scedilla \or - \scedilla \or - \Scaron \or - \scaron \or - \Tcedilla \or - \tcedilla \or - \Tcaron \or - \tcaron \or - \Tstroke \or - \tstroke \or - \Utilde \or - \utilde \or - \Umacron \or - \umacron \or - \Ubreve \or - \ubreve \or - \Uring \or - \uring \or - \Uhungarumlaut \or - \uhungarumlaut \or - \Uogonek \or - \uogonek \or - \Wcircumflex \or - \wcircumflex \or - \Ycircumflex \or - \ycircumflex \or - \Ydiaeresis \or - \Zacute \or - \zacute \or - \Zdotaccent \or - \zdotaccent \or - \Zcaron \or - \zcaron \or - \slong \or % 127 \slong \else - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \textflorin \or % 146 - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \Ohorn \or % 160 - \ohorn \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \unknownchar \or - \Uhorn \or % 175 - \uhorn \else - \unknownchar - \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-002.mkii b/tex/context/base/unic-002.mkii new file mode 100644 index 000000000..ae7deb12a --- /dev/null +++ b/tex/context/base/unic-002.mkii @@ -0,0 +1,104 @@ +%D \module +%D [ file=unic-002, +%D version=2006.08.02, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 2, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 + +\startunicodevector 2 + \expandafter\strippedcsname + \ifcase\numexpr#1\relax + \Adoublegrave \or + \adoublegrave \or + \Ainvertedbreve \or + \ainvertedbreve \or + \Edoublegrave \or + \edoublegrave \or + \Einvertedbreve \or + \einvertedbreve \or + \Idoublegrave \or + \idoublegrave \or + \Iinvertedbreve \or + \iinvertedbreve \or + \Odoublegrave \or + \odoublegrave \or + \Oinvertedbreve \or + \oinvertedbreve \or + \Rdoublegrave \or + \rdoublegrave \or + \Rinvertedbreve \or + \rinvertedbreve \or + \Udoublegrave \or + \udoublegrave \or + \Uinvertedbreve \or + \uinvertedbreve \or + \Scommaaccent \or + \scommaaccent \or + \Tcommaaccent \or + \tcommaaccent \or + \unknownchar \or % Yogh + \unknownchar \or % yogh + \Hcaron \or + \hcaron \or + \unknownchar \or % n with long right leg + \dcurl \or + \unknownchar \or % Ou + \unknownchar \or % ou + \Zhook \or + \zhook \or + \Adotaccent \or + \adotaccent \or + \Ecedilla \or + \ecedilla \or + \Odiaeresismacron \or + \odiaeresismacron \or + \Otildemacron \or + \otildemacron \or + \Odotaccent \or + \odotaccent \or + \Odotaccentmacron \or + \odotaccentmacron \or + \Ymacron \or + \ymacron \or + \lcurl \or + \ncurl \or + \tcurl \or + \dotlessj \or + \unknownchar \or % db digraph + \unknownchar \or % qp digraph + \Astroke \or + \Cstroke \or + \cstroke \or + \Lbar \else + \ifcase\numexpr#1-83\relax + \bhook \or + \unknownchar \or % open o + \ccurl \or + \dtail \or + \dhook \or + \unknownchar \or % reversed e + \schwa \or + \schwahook \else + \ifcase\numexpr#1-198\relax + \textcircumflex \or + \textcaron \else + \ifcase\numexpr#1-216\relax + \textbreve \or + \textdotaccent \or + \textring \or + \textogonek \or + \texttilde \or + \texthungarumlaut \else + \unknownchar + \fi\fi\fi\fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-002.tex b/tex/context/base/unic-002.tex deleted file mode 100644 index ae7deb12a..000000000 --- a/tex/context/base/unic-002.tex +++ /dev/null @@ -1,104 +0,0 @@ -%D \module -%D [ file=unic-002, -%D version=2006.08.02, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 2, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 - -\startunicodevector 2 - \expandafter\strippedcsname - \ifcase\numexpr#1\relax - \Adoublegrave \or - \adoublegrave \or - \Ainvertedbreve \or - \ainvertedbreve \or - \Edoublegrave \or - \edoublegrave \or - \Einvertedbreve \or - \einvertedbreve \or - \Idoublegrave \or - \idoublegrave \or - \Iinvertedbreve \or - \iinvertedbreve \or - \Odoublegrave \or - \odoublegrave \or - \Oinvertedbreve \or - \oinvertedbreve \or - \Rdoublegrave \or - \rdoublegrave \or - \Rinvertedbreve \or - \rinvertedbreve \or - \Udoublegrave \or - \udoublegrave \or - \Uinvertedbreve \or - \uinvertedbreve \or - \Scommaaccent \or - \scommaaccent \or - \Tcommaaccent \or - \tcommaaccent \or - \unknownchar \or % Yogh - \unknownchar \or % yogh - \Hcaron \or - \hcaron \or - \unknownchar \or % n with long right leg - \dcurl \or - \unknownchar \or % Ou - \unknownchar \or % ou - \Zhook \or - \zhook \or - \Adotaccent \or - \adotaccent \or - \Ecedilla \or - \ecedilla \or - \Odiaeresismacron \or - \odiaeresismacron \or - \Otildemacron \or - \otildemacron \or - \Odotaccent \or - \odotaccent \or - \Odotaccentmacron \or - \odotaccentmacron \or - \Ymacron \or - \ymacron \or - \lcurl \or - \ncurl \or - \tcurl \or - \dotlessj \or - \unknownchar \or % db digraph - \unknownchar \or % qp digraph - \Astroke \or - \Cstroke \or - \cstroke \or - \Lbar \else - \ifcase\numexpr#1-83\relax - \bhook \or - \unknownchar \or % open o - \ccurl \or - \dtail \or - \dhook \or - \unknownchar \or % reversed e - \schwa \or - \schwahook \else - \ifcase\numexpr#1-198\relax - \textcircumflex \or - \textcaron \else - \ifcase\numexpr#1-216\relax - \textbreve \or - \textdotaccent \or - \textring \or - \textogonek \or - \texttilde \or - \texthungarumlaut \else - \unknownchar - \fi\fi\fi\fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-003.mkii b/tex/context/base/unic-003.mkii new file mode 100644 index 000000000..d37563d26 --- /dev/null +++ b/tex/context/base/unic-003.mkii @@ -0,0 +1,147 @@ +%D \module +%D [ file=unic-003, +%D version=2005.01.26, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 3, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 + +\startunicodevector 3 + \ifcase\numexpr#1-126\relax + % special greek + \strippedcsname \greekquestionmark \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \greektonos \or + \strippedcsname \greekdialytikatonos \or + \strippedcsname \greekAlphatonos \or + \strippedcsname \greekanoteleia \or + \strippedcsname \greekEpsilontonos \or + \strippedcsname \greekEtatonos \or + \strippedcsname \greekIotatonos \or + \strippedcsname \unknownchar \or + \strippedcsname \greekOmicrontonos \or + \strippedcsname \unknownchar \or + \strippedcsname \greekUpsilontonos \or + \strippedcsname \greekOmegatonos \or + \strippedcsname \greekiotadialytikatonos \or + % normal greek + \strippedcsname \greekAlpha \or + \strippedcsname \greekBeta \or + \strippedcsname \greekGamma \or + \strippedcsname \greekDelta \or + \strippedcsname \greekEpsilon \or + \strippedcsname \greekZeta \or + \strippedcsname \greekEta \or + \strippedcsname \greekTheta \or + \strippedcsname \greekIota \or + \strippedcsname \greekKappa \or + \strippedcsname \greekLambda \or + \strippedcsname \greekMu \or + \strippedcsname \greekNu \or + \strippedcsname \greekXi \or + \strippedcsname \greekOmicron \or + \strippedcsname \greekPi \or + \strippedcsname \greekRho \or + \strippedcsname \unknownchar \or + \strippedcsname \greekSigma \or + \strippedcsname \greekTau \or + \strippedcsname \greekUpsilon \or + \strippedcsname \greekPhi \or + \strippedcsname \greekChi \or + \strippedcsname \greekPsi \or + \strippedcsname \greekOmega \or + % special greek + \strippedcsname \greekIotadialytika \or + \strippedcsname \greekUpsilondialytika \or + \strippedcsname \greekalphatonos \or + \strippedcsname \greekepsilontonos \or + \strippedcsname \greeketatonos \or + \strippedcsname \greekiotatonos \or + \strippedcsname \greekupsilondialytikatonos \or + % normal greek + \strippedcsname \greekalpha \or + \strippedcsname \greekbeta \or + \strippedcsname \greekgamma \or + \strippedcsname \greekdelta \or + \strippedcsname \greekepsilon \or + \strippedcsname \greekzeta \or + \strippedcsname \greeketa \or + \strippedcsname \greektheta \or + \strippedcsname \greekiota \or + \strippedcsname \greekkappa \or + \strippedcsname \greeklambda \or + \strippedcsname \greekmu \or + \strippedcsname \greeknu \or + \strippedcsname \greekxi \or + \strippedcsname \greekomicron \or + \strippedcsname \greekpi \or + \strippedcsname \greekrho \or + \strippedcsname \greekfinalsigma \or + \strippedcsname \greeksigma \or + \strippedcsname \greektau \or + \strippedcsname \greekupsilon \or + \strippedcsname \greekphi \or + \strippedcsname \greekchi \or + \strippedcsname \greekpsi \or + \strippedcsname \greekomega \or + % special greek + \strippedcsname \greekiotadialytika \or + \strippedcsname \greekupsilondialytika \or + \strippedcsname \greekomicrontonos \or + \strippedcsname \greekupsilontonos \or + \strippedcsname \greekomegatonos \or % was greeek! + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or % beta alt + \strippedcsname \greekthetaalt \or + \strippedcsname \unknownchar \or % upsilon hook + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \greekphialt \or + \strippedcsname \greekpialt \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or % Sampi + \strippedcsname \unknownchar \or % sampi + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or % kappa alt + \strippedcsname \greekrhoalt \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \unknownchar \or + \strippedcsname \greekepsilonalt \else + \strippedcsname \unknownchar + \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-003.tex b/tex/context/base/unic-003.tex deleted file mode 100644 index d37563d26..000000000 --- a/tex/context/base/unic-003.tex +++ /dev/null @@ -1,147 +0,0 @@ -%D \module -%D [ file=unic-003, -%D version=2005.01.26, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 3, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 - -\startunicodevector 3 - \ifcase\numexpr#1-126\relax - % special greek - \strippedcsname \greekquestionmark \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \greektonos \or - \strippedcsname \greekdialytikatonos \or - \strippedcsname \greekAlphatonos \or - \strippedcsname \greekanoteleia \or - \strippedcsname \greekEpsilontonos \or - \strippedcsname \greekEtatonos \or - \strippedcsname \greekIotatonos \or - \strippedcsname \unknownchar \or - \strippedcsname \greekOmicrontonos \or - \strippedcsname \unknownchar \or - \strippedcsname \greekUpsilontonos \or - \strippedcsname \greekOmegatonos \or - \strippedcsname \greekiotadialytikatonos \or - % normal greek - \strippedcsname \greekAlpha \or - \strippedcsname \greekBeta \or - \strippedcsname \greekGamma \or - \strippedcsname \greekDelta \or - \strippedcsname \greekEpsilon \or - \strippedcsname \greekZeta \or - \strippedcsname \greekEta \or - \strippedcsname \greekTheta \or - \strippedcsname \greekIota \or - \strippedcsname \greekKappa \or - \strippedcsname \greekLambda \or - \strippedcsname \greekMu \or - \strippedcsname \greekNu \or - \strippedcsname \greekXi \or - \strippedcsname \greekOmicron \or - \strippedcsname \greekPi \or - \strippedcsname \greekRho \or - \strippedcsname \unknownchar \or - \strippedcsname \greekSigma \or - \strippedcsname \greekTau \or - \strippedcsname \greekUpsilon \or - \strippedcsname \greekPhi \or - \strippedcsname \greekChi \or - \strippedcsname \greekPsi \or - \strippedcsname \greekOmega \or - % special greek - \strippedcsname \greekIotadialytika \or - \strippedcsname \greekUpsilondialytika \or - \strippedcsname \greekalphatonos \or - \strippedcsname \greekepsilontonos \or - \strippedcsname \greeketatonos \or - \strippedcsname \greekiotatonos \or - \strippedcsname \greekupsilondialytikatonos \or - % normal greek - \strippedcsname \greekalpha \or - \strippedcsname \greekbeta \or - \strippedcsname \greekgamma \or - \strippedcsname \greekdelta \or - \strippedcsname \greekepsilon \or - \strippedcsname \greekzeta \or - \strippedcsname \greeketa \or - \strippedcsname \greektheta \or - \strippedcsname \greekiota \or - \strippedcsname \greekkappa \or - \strippedcsname \greeklambda \or - \strippedcsname \greekmu \or - \strippedcsname \greeknu \or - \strippedcsname \greekxi \or - \strippedcsname \greekomicron \or - \strippedcsname \greekpi \or - \strippedcsname \greekrho \or - \strippedcsname \greekfinalsigma \or - \strippedcsname \greeksigma \or - \strippedcsname \greektau \or - \strippedcsname \greekupsilon \or - \strippedcsname \greekphi \or - \strippedcsname \greekchi \or - \strippedcsname \greekpsi \or - \strippedcsname \greekomega \or - % special greek - \strippedcsname \greekiotadialytika \or - \strippedcsname \greekupsilondialytika \or - \strippedcsname \greekomicrontonos \or - \strippedcsname \greekupsilontonos \or - \strippedcsname \greekomegatonos \or % was greeek! - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or % beta alt - \strippedcsname \greekthetaalt \or - \strippedcsname \unknownchar \or % upsilon hook - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \greekphialt \or - \strippedcsname \greekpialt \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or % Sampi - \strippedcsname \unknownchar \or % sampi - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or % kappa alt - \strippedcsname \greekrhoalt \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \unknownchar \or - \strippedcsname \greekepsilonalt \else - \strippedcsname \unknownchar - \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-004.mkii b/tex/context/base/unic-004.mkii new file mode 100644 index 000000000..b6e210193 --- /dev/null +++ b/tex/context/base/unic-004.mkii @@ -0,0 +1,291 @@ +%D \module +%D [ file=unic-004, +%D version=2005.01.27, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 4, +%D author=Mikael Persson \& Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 + +\startunicodevector 4 + \expandafter\strippedcsname + \ifcase\numexpr#1\relax + \cyrillicEgrave \or % 04-00 \uchar0{200} aswell + \cyrillicYO \or % 04-01 Capital YO (or IO) + \cyrillicDJE \or % 04-02 + \cyrillicGJE \or % 04-03 not in enco-uc.tex + \cyrillicIE \or % 04-04 Ukrainian IE + \cyrillicDZE \or % 04-05 + \cyrillicII \or % 04-06 Byelorussian-ukrainian I + \cyrillicYI \or % 04-07 + \cyrillicJE \or % 04-08 same letter as latin J? + \cyrillicLJE \or % 04-09 + \cyrillicNJE \or % 04-0A + \cyrillicTSHE \or % 04-0B + \cyrillicKJE \or % 04-0C + \cyrillicIgrave \or % 04-0D I with grave + \cyrillicUSHRT \or % 04-0E + \cyrillicDZHE \or % 04-0F + \cyrillicA \or % 04-10 + \cyrillicB \or + \cyrillicV \or + \cyrillicG \or + \cyrillicD \or + \cyrillicE \or + \cyrillicZH \or + \cyrillicZ \or + \cyrillicI \or + \cyrillicISHRT \or + \cyrillicK \or + \cyrillicL \or + \cyrillicM \or + \cyrillicN \or + \cyrillicO \or + \cyrillicP \or + \cyrillicR \or + \cyrillicS \or + \cyrillicT \or + \cyrillicU \or + \cyrillicF \or + \cyrillicH \or + \cyrillicC \or + \cyrillicCH \or + \cyrillicSH \or + \cyrillicSHCH \or + \cyrillicHRDSN \or + \cyrillicERY \or + \cyrillicSFTSN \or + \cyrillicEREV \or + \cyrillicYU \or + \cyrillicYA \or + \cyrillica \or % 04-30 + \cyrillicb \or + \cyrillicv \or + \cyrillicg \or + \cyrillicd \or + \cyrillice \or + \cyrilliczh \or + \cyrillicz \or + \cyrillici \or + \cyrillicishrt \or + \cyrillick \or + \cyrillicl \or + \cyrillicm \or + \cyrillicn \or + \cyrillico \or + \cyrillicp \or + \cyrillicr \or + \cyrillics \or + \cyrillict \or + \cyrillicu \or + \cyrillicf \or + \cyrillich \or + \cyrillicc \or + \cyrillicch \or + \cyrillicsh \or + \cyrillicshch \or + \cyrillichrdsn \or + \cyrillicery \or + \cyrillicsftsn \or + \cyrillicerev \or + \cyrillicyu \or + \cyrillicya \or % 044F + \cyrillicegrave \or % 0450 not i enco-uc.tex but same as \uchar0{232} + \cyrillicyo \or % 0451 small yo (or io) + \cyrillicdje \or % 0452 serbian letter + \cyrillicgje \or % 0453 macedonian letter not in enco-uc.tex + \cyrillicie \or % 0454 ukrainian ie + \cyrillicdze \or % 0455 macedonian zelo + \cyrillicii \or % 0456 byelorussian-ukrainian i. + \cyrillicyi \or % 0457 + \cyrillicje \or % 0458 not in enco-uc.tex same as latin j? + \cyrilliclje \or % 0459 + \cyrillicnje \or % 045A + \cyrillictshe \or % 045B + \cyrillickje \or % 045C macedonian, not in enco-uc.tex + \cyrillicigrave \or % 045D macedonian, cyr i with grave not in enco-uc.tex + \cyrillicushrt \or % 045E + \cyrillicdzhe \or % 045F + \cyrillicOMEGA \or % 0460 Omega not in enco-uc.tex + \cyrillicomega \or % 0461 omega not in enco-uc.tex + \cyrillicYAT \or % 0462 Yat not in enco-uc.tex + \cyrillicyat \or % 0463 Yat not in enco-uc.tex + \cyrillicEiotified \or % 0464 iotified E not in enco-uc.tex + \cyrilliceiotified \or % 0465 iotified e not in enco-uc.tex + \cyrillicLITTLEYUS \or % 0466 Little Yus not in enco-enc.tex + \cyrilliclittleyus \or % 0467 Little yus not in enco-enc.tex + \cyrillicLITTLEYUSiotified \or % 0468 Little Yus iotified not in enco-enc.tex + \cyrilliclittleyusiotified \or % 0469 Little yus iotified not in enco-enc.tex + \cyrillicBIGYUS \or % 046A Big Yus not in enco-enc.tex + \cyrillicbigyus \or % 046B Big yus not in enco-enc.tex + \cyrillicBIGYUSiotified \or % 046C Big Yus iotified not in enco-enc.tex + \cyrillicbigyusiotified \or % 046D Big yus iotified not in enco-enc.tex + \cyrillicKSI \or % 046E Ksi not in enco-enc.tex + \cyrillicksi \or % 046F ksi not in enco-enc.tex + \cyrillicPSI \or % 0470 Psi not in enco-enc.tex + \cyrillicpsi \or % 0471 psi not in enco-enc.tex + \cyrillicFITA \or % 0472 Fita not in enco-enc.tex + \cyrillicfita \or % 0473 fita not in enco-enc.tex + \cyrillicIZHITSA \or % 0474 Izhitsa not in enco-enc.tex + \cyrillicizhitsa \or % 0475 izhitsa not in enco-enc.tex + \cyrillicIZHITSAdoublegrave \or % 0476 Izhitsa double grave not in enco-enc.tex + \cyrillicizhitsadoublegrave \or % 0477 izhitsa double grave not in enco-enc.tex + \cyrillicUK \or % 0478 UK not in enco-enc.tex + \cyrillicuk \or % 0479 uk not in enco-enc.tex + \cyrillicOMEGAround \or % 047A Round Omega not in enco-enc.tex + \cyrillicomegaround \or % 047B Round omega not in enco-enc.tex + \cyrillicOMEGAtitlo \or % 047C Omega with titlo not in enco-enc.tex + \cyrillicomegatitlo \or % 047D omega with titlo not in enco-enc.tex + \cyrillicOT \or % 047E OT not in enco-enc.tex + \cyrillicot \or % 047F ot not in enco-enc.tex + \cyrillicKOPPA \or % 0480 KOPPA not in enco-enc.tex + \cyrillickoppa \or % 0481 koppa not in enco-enc.tex + \unknownchar \or % 0482 + \cyrillicTITLO \or % 0483 TITLO not in enco-enc.tex + \cyrillicPALATALIZATION \or % 0484 PALATALIZATION not in enco-enc.tex + \cyrillicDASIAPNEUMATA \or % 0485 DASIA PNEUMATA not in enco-enc.tex + \cyrillicPSILIPNEUMATA \or % 0486 PSILI PNEUMATA not in enco-enc.tex + \unknownchar \or % 0487 + \unknownchar \or % 0488 + \unknownchar \or % 0489 + \cyrillicISHRTtail \or % 048A ISHRT with tail not in enco-enc.tex + \cyrillicishrttail \or % 048B ishrt with tail not in enco-enc.tex + \cyrillicSEMISOFT \or % 048C SEMISOFT not in enco-enc.tex + \cyrillicsemisoft \or % 048D semisoft not in enco-enc.tex + \cyrillicERtick \or % 048E ER with tick not in enco-enc.tex + \cyrillicertick \or % 048F er with tick not in enco-enc.tex + \cyrillicGHEupturn \or % 0490 GHE with upturn not in enco-enc.tex + \cyrillicgheupturn \or % 0491 ghe with upturn not in enco-enc.tex + \cyrillicGHEstroke \or % 0492 GHE with stroke not in enco-enc.tex + \cyrillicghestroke \or % 0493 ghe with stroke not in enco-enc.tex + \cyrillicGHEmidhook \or % 0494 GHE with middle hook + \cyrillicghemidhook \or % 0495 ghe with middle hook + \cyrillicZHEdescender \or % 0496 ZHE with descender + \cyrilliczhedescender \or % 0497 zhe with descender + \cyrillicZDSC \or % 0498 ZE with descender + \cyrilliczdsc \or % 0499 ze with descender + \cyrillicKADC \or % 049A KA with descender + \cyrillickadc \or % 049B ka with descender + \cyrillicKAvertstroke \or % 049C KA with vertical stroke + \cyrillickavertstroke \or % 049D ka with vertical stroke + \cyrillicKAstroke \or % 049E KA with stroke + \cyrillickastroke \or % 049F ka with stroke + \cyrillicKAbashkir \or % 04A0 KA bashkir + \cyrillickabashkir \or % 04A1 ka bashkir + \cyrillicENDC \or % 04A2 EN with descender + \cyrillicendc \or % 04A3 en with descender + \cyrillicENGHE \or % 04A4 EN GHE + \cyrillicenghe \or % 04A5 en ghe + \cyrillicPEmidhook \or % 04A6 PE with middle hook + \cyrillicpemidhook \or % 04A7 pe with middle hook + \cyrillicHA \or % 04A8 Abkhasian HA + \cyrillicha \or % 04A9 Abkhasian ha + \cyrillicSDSC \or % 04AA S with descender + \cyrilliccdsc \or % 04AB s with descender + \cyrillicTEDC \or % 04AC TE with descender + \cyrillictedc \or % 04AD te with descender + \cyrillicYstr \or % 04AE Y straight + \cyrillicystr \or % 04AF y straight + \cyrillicYstrstroke \or % 04B0 Y straight with stroke + \cyrillicystrstroke \or % 04B1 y straight with stroke + \cyrillicHADC \or % 04B2 HA with descender + \cyrillichadc \or % 04B3 ha with descender + \cyrillicTETSE \or % 04B4 TE TSE + \cyrillictetse \or % 04B5 te tse + \cyrillicCHEDC \or % 04B6 CHE with descender + \cyrillicchedc \or % 04B7 che with descender + \cyrillicCHEvertstroke \or % 04B8 CHE with vertical stroke + \cyrillicchevertstroke \or % 04B9 che with vertical stroke + \cyrillicSHHA \or % 04BA SHHA + \cyrillicshha \or % 04BB + \cyrillicCHEabkhasian \or % 04BC Abkhasian CHE + \cyrilliccheabkhasian \or % 04BD Abkhasian che + \cyrillicCHEDCabkhasian \or % 04BE Abkhasian CHE with descender + \cyrillicchedcabkhasian \or % 04BF Abkhasian che with descender + \cyrillicPALOCHKA \or % 04C0 PALOCHKA + \cyrillicZHEbreve \or % 04C1 ZHE with breve + \cyrilliczhebreve \or % 04C2 zhe with breve + \cyrillicKAhook \or % 04C3 KA with hook + \cyrillickahook \or % 04C4 ka with hook + \cyrillicELtail \or % 04C5 EL with tail + \cyrilliceltail \or % 04C6 el with tail + \cyrillicENhook \or % 04C7 EN with hook + \cyrillicenhook \or % 04C8 en with hook + \cyrillicENtail \or % 04C9 EN with tail + \cyrillicentail \or % 04CA en with tail + \cyrillicCHEkhakassian \or % 04CB Khakassian CHE + \cyrillicchekhakassian \or % 04CC Khakassian che + \cyrillicEMtail \or % 04CD EM with tail + \cyrillicemtail \or % 04CE em with tail + \unknownchar \or % 04CF Added to fix off-by-1 error + \cyrillicAbreve \or % 04D0 A with breve (\uchar1{2}) + \cyrillicabreve \or % 04D1 a with breve (\uchar1{3}) + \cyrillicAdiaeresis \or % 04D2 A with diaeresis (\uchar0{196}) + \cyrillicadiaeresis \or % 04D3 a with diaeresis (\uchar0{228}) + \cyrillicAE \or % 04D4 AE (\uchar0{198}) + \cyrillicae \or % 04D5 ae (\uchar0{230}) + \cyrillicEbreve \or % 04D6 + \cyrillicebreve \or % 04D7 + \cyrillicSCHWA \or % 04D8 + \cyrillicschwa \or % 04D9 + \cyrillicSCHWAdiaeresis \or % 04DA + \cyrillicschwadiaeresis \or % 04DB + \cyrillicZHEdiaeresis \or % 04DC + \cyrilliczhediaeresis \or % 04DD + \cyrillicZEdiaeresis \or % 04DE + \cyrilliczediaeresis \or % 04DF + \cyrillicDZEabkhasian \or % 04E0 + \cyrillicdzeabkhasian \or % 04E1 + \cyrillicImacron \or % 04E2 + \cyrillicimacron \or % 04E3 + \cyrillicIdiaeresis \or % 04E4 + \cyrillicidiaeresis \or % 04E5 + \cyrillicOdiaeresis \or % 04E6 + \cyrillicodiaeresis \or % 04E7 + \cyrillicObarred \or % 04E8 + \cyrillicobarred \or % 04E9 + \cyrillicObarreddiaeresis \or % 04EA + \cyrillicobarreddiaeresis \or % 04EB + \cyrillicEdiaeresis \or % 04EC + \cyrillicediaeresis \or % 04ED + \cyrillicUmacron \or % 04EE + \cyrillicumacron \or % 04EF + \cyrillicUdiaeresis \or % 04F0 + \cyrillicudiaeresis \or % 04F1 + \cyrillicUdoubleacute \or % 04F2 + \cyrillicudoubleacute \or % 04F3 + \cyrillicCHEdiaeresis \or % 04F4 + \cyrillicchediaeresis \or % 04F5 + \unknownchar \or % 04F6 + \unknownchar \or % 04F7 + \cyrillicYERUdiaeresis \or % 04F8 + \cyrillicyerudiaeresis \else + \unknownchar + \fi +\stopunicodevector + +\protect \endinput + +% \enableregime[utf] +% +% \definetypeface [russian] [rm] [serif] [computer-modern] [default] [encoding=t2a] +% +% \setupbodyfont[russian] +% +% \starttext +% +% \startbuffer +% Мама и Папа % Some russian characters +% \stopbuffer +% +% \chardef\utfunicodetracer=0 \blank \getbuffer \blank +% \chardef\utfunicodetracer=2 \blank \getbuffer \blank +% \chardef\utfunicodetracer=7 \blank \getbuffer \blank +% +% \stoptext diff --git a/tex/context/base/unic-004.tex b/tex/context/base/unic-004.tex deleted file mode 100644 index b6e210193..000000000 --- a/tex/context/base/unic-004.tex +++ /dev/null @@ -1,291 +0,0 @@ -%D \module -%D [ file=unic-004, -%D version=2005.01.27, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 4, -%D author=Mikael Persson \& Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 - -\startunicodevector 4 - \expandafter\strippedcsname - \ifcase\numexpr#1\relax - \cyrillicEgrave \or % 04-00 \uchar0{200} aswell - \cyrillicYO \or % 04-01 Capital YO (or IO) - \cyrillicDJE \or % 04-02 - \cyrillicGJE \or % 04-03 not in enco-uc.tex - \cyrillicIE \or % 04-04 Ukrainian IE - \cyrillicDZE \or % 04-05 - \cyrillicII \or % 04-06 Byelorussian-ukrainian I - \cyrillicYI \or % 04-07 - \cyrillicJE \or % 04-08 same letter as latin J? - \cyrillicLJE \or % 04-09 - \cyrillicNJE \or % 04-0A - \cyrillicTSHE \or % 04-0B - \cyrillicKJE \or % 04-0C - \cyrillicIgrave \or % 04-0D I with grave - \cyrillicUSHRT \or % 04-0E - \cyrillicDZHE \or % 04-0F - \cyrillicA \or % 04-10 - \cyrillicB \or - \cyrillicV \or - \cyrillicG \or - \cyrillicD \or - \cyrillicE \or - \cyrillicZH \or - \cyrillicZ \or - \cyrillicI \or - \cyrillicISHRT \or - \cyrillicK \or - \cyrillicL \or - \cyrillicM \or - \cyrillicN \or - \cyrillicO \or - \cyrillicP \or - \cyrillicR \or - \cyrillicS \or - \cyrillicT \or - \cyrillicU \or - \cyrillicF \or - \cyrillicH \or - \cyrillicC \or - \cyrillicCH \or - \cyrillicSH \or - \cyrillicSHCH \or - \cyrillicHRDSN \or - \cyrillicERY \or - \cyrillicSFTSN \or - \cyrillicEREV \or - \cyrillicYU \or - \cyrillicYA \or - \cyrillica \or % 04-30 - \cyrillicb \or - \cyrillicv \or - \cyrillicg \or - \cyrillicd \or - \cyrillice \or - \cyrilliczh \or - \cyrillicz \or - \cyrillici \or - \cyrillicishrt \or - \cyrillick \or - \cyrillicl \or - \cyrillicm \or - \cyrillicn \or - \cyrillico \or - \cyrillicp \or - \cyrillicr \or - \cyrillics \or - \cyrillict \or - \cyrillicu \or - \cyrillicf \or - \cyrillich \or - \cyrillicc \or - \cyrillicch \or - \cyrillicsh \or - \cyrillicshch \or - \cyrillichrdsn \or - \cyrillicery \or - \cyrillicsftsn \or - \cyrillicerev \or - \cyrillicyu \or - \cyrillicya \or % 044F - \cyrillicegrave \or % 0450 not i enco-uc.tex but same as \uchar0{232} - \cyrillicyo \or % 0451 small yo (or io) - \cyrillicdje \or % 0452 serbian letter - \cyrillicgje \or % 0453 macedonian letter not in enco-uc.tex - \cyrillicie \or % 0454 ukrainian ie - \cyrillicdze \or % 0455 macedonian zelo - \cyrillicii \or % 0456 byelorussian-ukrainian i. - \cyrillicyi \or % 0457 - \cyrillicje \or % 0458 not in enco-uc.tex same as latin j? - \cyrilliclje \or % 0459 - \cyrillicnje \or % 045A - \cyrillictshe \or % 045B - \cyrillickje \or % 045C macedonian, not in enco-uc.tex - \cyrillicigrave \or % 045D macedonian, cyr i with grave not in enco-uc.tex - \cyrillicushrt \or % 045E - \cyrillicdzhe \or % 045F - \cyrillicOMEGA \or % 0460 Omega not in enco-uc.tex - \cyrillicomega \or % 0461 omega not in enco-uc.tex - \cyrillicYAT \or % 0462 Yat not in enco-uc.tex - \cyrillicyat \or % 0463 Yat not in enco-uc.tex - \cyrillicEiotified \or % 0464 iotified E not in enco-uc.tex - \cyrilliceiotified \or % 0465 iotified e not in enco-uc.tex - \cyrillicLITTLEYUS \or % 0466 Little Yus not in enco-enc.tex - \cyrilliclittleyus \or % 0467 Little yus not in enco-enc.tex - \cyrillicLITTLEYUSiotified \or % 0468 Little Yus iotified not in enco-enc.tex - \cyrilliclittleyusiotified \or % 0469 Little yus iotified not in enco-enc.tex - \cyrillicBIGYUS \or % 046A Big Yus not in enco-enc.tex - \cyrillicbigyus \or % 046B Big yus not in enco-enc.tex - \cyrillicBIGYUSiotified \or % 046C Big Yus iotified not in enco-enc.tex - \cyrillicbigyusiotified \or % 046D Big yus iotified not in enco-enc.tex - \cyrillicKSI \or % 046E Ksi not in enco-enc.tex - \cyrillicksi \or % 046F ksi not in enco-enc.tex - \cyrillicPSI \or % 0470 Psi not in enco-enc.tex - \cyrillicpsi \or % 0471 psi not in enco-enc.tex - \cyrillicFITA \or % 0472 Fita not in enco-enc.tex - \cyrillicfita \or % 0473 fita not in enco-enc.tex - \cyrillicIZHITSA \or % 0474 Izhitsa not in enco-enc.tex - \cyrillicizhitsa \or % 0475 izhitsa not in enco-enc.tex - \cyrillicIZHITSAdoublegrave \or % 0476 Izhitsa double grave not in enco-enc.tex - \cyrillicizhitsadoublegrave \or % 0477 izhitsa double grave not in enco-enc.tex - \cyrillicUK \or % 0478 UK not in enco-enc.tex - \cyrillicuk \or % 0479 uk not in enco-enc.tex - \cyrillicOMEGAround \or % 047A Round Omega not in enco-enc.tex - \cyrillicomegaround \or % 047B Round omega not in enco-enc.tex - \cyrillicOMEGAtitlo \or % 047C Omega with titlo not in enco-enc.tex - \cyrillicomegatitlo \or % 047D omega with titlo not in enco-enc.tex - \cyrillicOT \or % 047E OT not in enco-enc.tex - \cyrillicot \or % 047F ot not in enco-enc.tex - \cyrillicKOPPA \or % 0480 KOPPA not in enco-enc.tex - \cyrillickoppa \or % 0481 koppa not in enco-enc.tex - \unknownchar \or % 0482 - \cyrillicTITLO \or % 0483 TITLO not in enco-enc.tex - \cyrillicPALATALIZATION \or % 0484 PALATALIZATION not in enco-enc.tex - \cyrillicDASIAPNEUMATA \or % 0485 DASIA PNEUMATA not in enco-enc.tex - \cyrillicPSILIPNEUMATA \or % 0486 PSILI PNEUMATA not in enco-enc.tex - \unknownchar \or % 0487 - \unknownchar \or % 0488 - \unknownchar \or % 0489 - \cyrillicISHRTtail \or % 048A ISHRT with tail not in enco-enc.tex - \cyrillicishrttail \or % 048B ishrt with tail not in enco-enc.tex - \cyrillicSEMISOFT \or % 048C SEMISOFT not in enco-enc.tex - \cyrillicsemisoft \or % 048D semisoft not in enco-enc.tex - \cyrillicERtick \or % 048E ER with tick not in enco-enc.tex - \cyrillicertick \or % 048F er with tick not in enco-enc.tex - \cyrillicGHEupturn \or % 0490 GHE with upturn not in enco-enc.tex - \cyrillicgheupturn \or % 0491 ghe with upturn not in enco-enc.tex - \cyrillicGHEstroke \or % 0492 GHE with stroke not in enco-enc.tex - \cyrillicghestroke \or % 0493 ghe with stroke not in enco-enc.tex - \cyrillicGHEmidhook \or % 0494 GHE with middle hook - \cyrillicghemidhook \or % 0495 ghe with middle hook - \cyrillicZHEdescender \or % 0496 ZHE with descender - \cyrilliczhedescender \or % 0497 zhe with descender - \cyrillicZDSC \or % 0498 ZE with descender - \cyrilliczdsc \or % 0499 ze with descender - \cyrillicKADC \or % 049A KA with descender - \cyrillickadc \or % 049B ka with descender - \cyrillicKAvertstroke \or % 049C KA with vertical stroke - \cyrillickavertstroke \or % 049D ka with vertical stroke - \cyrillicKAstroke \or % 049E KA with stroke - \cyrillickastroke \or % 049F ka with stroke - \cyrillicKAbashkir \or % 04A0 KA bashkir - \cyrillickabashkir \or % 04A1 ka bashkir - \cyrillicENDC \or % 04A2 EN with descender - \cyrillicendc \or % 04A3 en with descender - \cyrillicENGHE \or % 04A4 EN GHE - \cyrillicenghe \or % 04A5 en ghe - \cyrillicPEmidhook \or % 04A6 PE with middle hook - \cyrillicpemidhook \or % 04A7 pe with middle hook - \cyrillicHA \or % 04A8 Abkhasian HA - \cyrillicha \or % 04A9 Abkhasian ha - \cyrillicSDSC \or % 04AA S with descender - \cyrilliccdsc \or % 04AB s with descender - \cyrillicTEDC \or % 04AC TE with descender - \cyrillictedc \or % 04AD te with descender - \cyrillicYstr \or % 04AE Y straight - \cyrillicystr \or % 04AF y straight - \cyrillicYstrstroke \or % 04B0 Y straight with stroke - \cyrillicystrstroke \or % 04B1 y straight with stroke - \cyrillicHADC \or % 04B2 HA with descender - \cyrillichadc \or % 04B3 ha with descender - \cyrillicTETSE \or % 04B4 TE TSE - \cyrillictetse \or % 04B5 te tse - \cyrillicCHEDC \or % 04B6 CHE with descender - \cyrillicchedc \or % 04B7 che with descender - \cyrillicCHEvertstroke \or % 04B8 CHE with vertical stroke - \cyrillicchevertstroke \or % 04B9 che with vertical stroke - \cyrillicSHHA \or % 04BA SHHA - \cyrillicshha \or % 04BB - \cyrillicCHEabkhasian \or % 04BC Abkhasian CHE - \cyrilliccheabkhasian \or % 04BD Abkhasian che - \cyrillicCHEDCabkhasian \or % 04BE Abkhasian CHE with descender - \cyrillicchedcabkhasian \or % 04BF Abkhasian che with descender - \cyrillicPALOCHKA \or % 04C0 PALOCHKA - \cyrillicZHEbreve \or % 04C1 ZHE with breve - \cyrilliczhebreve \or % 04C2 zhe with breve - \cyrillicKAhook \or % 04C3 KA with hook - \cyrillickahook \or % 04C4 ka with hook - \cyrillicELtail \or % 04C5 EL with tail - \cyrilliceltail \or % 04C6 el with tail - \cyrillicENhook \or % 04C7 EN with hook - \cyrillicenhook \or % 04C8 en with hook - \cyrillicENtail \or % 04C9 EN with tail - \cyrillicentail \or % 04CA en with tail - \cyrillicCHEkhakassian \or % 04CB Khakassian CHE - \cyrillicchekhakassian \or % 04CC Khakassian che - \cyrillicEMtail \or % 04CD EM with tail - \cyrillicemtail \or % 04CE em with tail - \unknownchar \or % 04CF Added to fix off-by-1 error - \cyrillicAbreve \or % 04D0 A with breve (\uchar1{2}) - \cyrillicabreve \or % 04D1 a with breve (\uchar1{3}) - \cyrillicAdiaeresis \or % 04D2 A with diaeresis (\uchar0{196}) - \cyrillicadiaeresis \or % 04D3 a with diaeresis (\uchar0{228}) - \cyrillicAE \or % 04D4 AE (\uchar0{198}) - \cyrillicae \or % 04D5 ae (\uchar0{230}) - \cyrillicEbreve \or % 04D6 - \cyrillicebreve \or % 04D7 - \cyrillicSCHWA \or % 04D8 - \cyrillicschwa \or % 04D9 - \cyrillicSCHWAdiaeresis \or % 04DA - \cyrillicschwadiaeresis \or % 04DB - \cyrillicZHEdiaeresis \or % 04DC - \cyrilliczhediaeresis \or % 04DD - \cyrillicZEdiaeresis \or % 04DE - \cyrilliczediaeresis \or % 04DF - \cyrillicDZEabkhasian \or % 04E0 - \cyrillicdzeabkhasian \or % 04E1 - \cyrillicImacron \or % 04E2 - \cyrillicimacron \or % 04E3 - \cyrillicIdiaeresis \or % 04E4 - \cyrillicidiaeresis \or % 04E5 - \cyrillicOdiaeresis \or % 04E6 - \cyrillicodiaeresis \or % 04E7 - \cyrillicObarred \or % 04E8 - \cyrillicobarred \or % 04E9 - \cyrillicObarreddiaeresis \or % 04EA - \cyrillicobarreddiaeresis \or % 04EB - \cyrillicEdiaeresis \or % 04EC - \cyrillicediaeresis \or % 04ED - \cyrillicUmacron \or % 04EE - \cyrillicumacron \or % 04EF - \cyrillicUdiaeresis \or % 04F0 - \cyrillicudiaeresis \or % 04F1 - \cyrillicUdoubleacute \or % 04F2 - \cyrillicudoubleacute \or % 04F3 - \cyrillicCHEdiaeresis \or % 04F4 - \cyrillicchediaeresis \or % 04F5 - \unknownchar \or % 04F6 - \unknownchar \or % 04F7 - \cyrillicYERUdiaeresis \or % 04F8 - \cyrillicyerudiaeresis \else - \unknownchar - \fi -\stopunicodevector - -\protect \endinput - -% \enableregime[utf] -% -% \definetypeface [russian] [rm] [serif] [computer-modern] [default] [encoding=t2a] -% -% \setupbodyfont[russian] -% -% \starttext -% -% \startbuffer -% Мама и Папа % Some russian characters -% \stopbuffer -% -% \chardef\utfunicodetracer=0 \blank \getbuffer \blank -% \chardef\utfunicodetracer=2 \blank \getbuffer \blank -% \chardef\utfunicodetracer=7 \blank \getbuffer \blank -% -% \stoptext diff --git a/tex/context/base/unic-005.mkii b/tex/context/base/unic-005.mkii new file mode 100644 index 000000000..d15b74dbe --- /dev/null +++ b/tex/context/base/unic-005.mkii @@ -0,0 +1,50 @@ +%D \module +%D [ file=unic-005, +%D version=2005.01.27, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 5, +%D author=Adam Lindsay, +%D date=\currentdate, +%D copyright=\PRAGMA] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\startunicodevector 5 + \expandafter\strippedcsname + \ifcase\numexpr#1-208\relax % Was 224 - changed to fix off-by-16 error + \hebrewAlef \or % 05D0 + \hebrewBet \or + \hebrewGimel \or + \hebrewDalet \or + \hebrewHe \or + \hebrewVav \or + \hebrewZayin \or + \hebrewHet \or + \hebrewTet \or + \hebrewYod \or + \hebrewKaffinal \or + \hebrewKaf \or + \hebrewLamed \or + \hebrewMemfinal \or + \hebrewMem \or + \hebrewNunfinal \or + \hebrewNun \or + \hebrewSamekh \or + \hebrewAyin \or + \hebrewPefinal \or + \hebrewPe \or + \hebrewTsadifinal \or + \hebrewTsadi \or + \hebrewQof \or + \hebrewResh \or + \hebrewShin \or + \hebrewTav \else % 05EA + \unknownchar + \fi +\stopunicodevector + +\protect \endinput \ No newline at end of file diff --git a/tex/context/base/unic-005.tex b/tex/context/base/unic-005.tex deleted file mode 100644 index d15b74dbe..000000000 --- a/tex/context/base/unic-005.tex +++ /dev/null @@ -1,50 +0,0 @@ -%D \module -%D [ file=unic-005, -%D version=2005.01.27, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 5, -%D author=Adam Lindsay, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\startunicodevector 5 - \expandafter\strippedcsname - \ifcase\numexpr#1-208\relax % Was 224 - changed to fix off-by-16 error - \hebrewAlef \or % 05D0 - \hebrewBet \or - \hebrewGimel \or - \hebrewDalet \or - \hebrewHe \or - \hebrewVav \or - \hebrewZayin \or - \hebrewHet \or - \hebrewTet \or - \hebrewYod \or - \hebrewKaffinal \or - \hebrewKaf \or - \hebrewLamed \or - \hebrewMemfinal \or - \hebrewMem \or - \hebrewNunfinal \or - \hebrewNun \or - \hebrewSamekh \or - \hebrewAyin \or - \hebrewPefinal \or - \hebrewPe \or - \hebrewTsadifinal \or - \hebrewTsadi \or - \hebrewQof \or - \hebrewResh \or - \hebrewShin \or - \hebrewTav \else % 05EA - \unknownchar - \fi -\stopunicodevector - -\protect \endinput \ No newline at end of file diff --git a/tex/context/base/unic-030.mkii b/tex/context/base/unic-030.mkii new file mode 100644 index 000000000..ef42c807a --- /dev/null +++ b/tex/context/base/unic-030.mkii @@ -0,0 +1,113 @@ +%D \module +%D [ file=unic-030, +%D version=2004.11.18, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 30, +%D author=Adam Lindsay, +%D date=\currentdate, +%D copyright={PRAGMA / Adam Lindsay}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\startunicodevector 30 + \expandafter\strippedcsname + \ifcase\numexpr#1-160\relax + \Adotbelow \or + \adotbelow \or + \Ahook \or + \ahook \or + \Acircumflexacute \or + \acircumflexacute \or + \Acircumflexgrave \or + \acircumflexgrave \or + \Acircumflexhook \or + \acircumflexhook \or + \Acircumflextilde \or + \acircumflextilde \or + \Acircumflexdotbelow \or + \acircumflexdotbelow \or + \Abreveacute \or + \abreveacute \or + \Abrevegrave \or + \abrevegrave \or + \Abrevehook \or + \abrevehook \or + \Abrevetilde \or + \abrevetilde \or + \Abrevedotbelow \or + \abrevedotbelow \or + \Edotbelow \or + \edotbelow \or + \Ehook \or + \ehook \or + \Etilde \or + \etilde \or + \Ecircumflexacute \or + \ecircumflexacute \or + \Ecircumflexgrave \or + \ecircumflexgrave \or + \Ecircumflexhook \or + \ecircumflexhook \or + \Ecircumflextilde \or + \ecircumflextilde \or + \Ecircumflexdotbelow \or + \ecircumflexdotbelow \or + \Ihook \or + \ihook \or + \Idotbelow \or + \idotbelow \or + \Odotbelow \or + \odotbelow \or + \Ohook \or + \ohook \or + \Ocircumflexacute \or + \ocircumflexacute \or + \Ocircumflexgrave \or + \ocircumflexgrave \or + \Ocircumflexhook \or + \ocircumflexhook \or + \Ocircumflextilde \or + \ocircumflextilde \or + \Ocircumflexdotbelow \or + \ocircumflexdotbelow \or + \Ohornacute \or + \ohornacute \or + \Ohorngrave \or + \ohorngrave \or + \Ohornhook \or + \ohornhook \or + \Ohorntilde \or + \ohorntilde \or + \Ohorndotbelow \or + \ohorndotbelow \or + \Udotbelow \or + \udotbelow \or + \Uhook \or + \uhook \or + \Uhornacute \or + \uhornacute \or + \Uhorngrave \or + \uhorngrave \or + \Uhornhook \or + \uhornhook \or + \Uhorntilde \or + \uhorntilde \or + \Uhorndotbelow \or + \uhorndotbelow \or + \Ygrave \or + \ygrave \or + \Ydotbelow \or + \ydotbelow \or + \Yhook \or + \yhook \or + \Ytilde \or + \ytilde \else + \unknownchar + \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-030.tex b/tex/context/base/unic-030.tex deleted file mode 100644 index ef42c807a..000000000 --- a/tex/context/base/unic-030.tex +++ /dev/null @@ -1,113 +0,0 @@ -%D \module -%D [ file=unic-030, -%D version=2004.11.18, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 30, -%D author=Adam Lindsay, -%D date=\currentdate, -%D copyright={PRAGMA / Adam Lindsay}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\startunicodevector 30 - \expandafter\strippedcsname - \ifcase\numexpr#1-160\relax - \Adotbelow \or - \adotbelow \or - \Ahook \or - \ahook \or - \Acircumflexacute \or - \acircumflexacute \or - \Acircumflexgrave \or - \acircumflexgrave \or - \Acircumflexhook \or - \acircumflexhook \or - \Acircumflextilde \or - \acircumflextilde \or - \Acircumflexdotbelow \or - \acircumflexdotbelow \or - \Abreveacute \or - \abreveacute \or - \Abrevegrave \or - \abrevegrave \or - \Abrevehook \or - \abrevehook \or - \Abrevetilde \or - \abrevetilde \or - \Abrevedotbelow \or - \abrevedotbelow \or - \Edotbelow \or - \edotbelow \or - \Ehook \or - \ehook \or - \Etilde \or - \etilde \or - \Ecircumflexacute \or - \ecircumflexacute \or - \Ecircumflexgrave \or - \ecircumflexgrave \or - \Ecircumflexhook \or - \ecircumflexhook \or - \Ecircumflextilde \or - \ecircumflextilde \or - \Ecircumflexdotbelow \or - \ecircumflexdotbelow \or - \Ihook \or - \ihook \or - \Idotbelow \or - \idotbelow \or - \Odotbelow \or - \odotbelow \or - \Ohook \or - \ohook \or - \Ocircumflexacute \or - \ocircumflexacute \or - \Ocircumflexgrave \or - \ocircumflexgrave \or - \Ocircumflexhook \or - \ocircumflexhook \or - \Ocircumflextilde \or - \ocircumflextilde \or - \Ocircumflexdotbelow \or - \ocircumflexdotbelow \or - \Ohornacute \or - \ohornacute \or - \Ohorngrave \or - \ohorngrave \or - \Ohornhook \or - \ohornhook \or - \Ohorntilde \or - \ohorntilde \or - \Ohorndotbelow \or - \ohorndotbelow \or - \Udotbelow \or - \udotbelow \or - \Uhook \or - \uhook \or - \Uhornacute \or - \uhornacute \or - \Uhorngrave \or - \uhorngrave \or - \Uhornhook \or - \uhornhook \or - \Uhorntilde \or - \uhorntilde \or - \Uhorndotbelow \or - \uhorndotbelow \or - \Ygrave \or - \ygrave \or - \Ydotbelow \or - \ydotbelow \or - \Yhook \or - \yhook \or - \Ytilde \or - \ytilde \else - \unknownchar - \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-031.mkii b/tex/context/base/unic-031.mkii new file mode 100644 index 000000000..ae6bc1b8e --- /dev/null +++ b/tex/context/base/unic-031.mkii @@ -0,0 +1,283 @@ +%D \module +%D [ file=unic-031, +%D version=2005.02.20, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 31, +%D author=Thomas A. Schmitz, +%D date=\currentdate] + +\unprotect + +\startunicodevector 31 + \expandafter\strippedcsname + \ifcase\numexpr#1\relax + \greekalphapsili \or %1f00 + \greekalphadasia \or + \greekalphapsilivaria \or + \greekalphadasiavaria \or + \greekalphapsilitonos \or + \greekalphadasiatonos \or + \greekalphapsiliperispomeni \or + \greekalphadasiaperispomeni \or + \greekAlphapsili \or + \greekAlphadasia \or + \greekAlphapsilivaria \or + \greekAlphadasiavaria \or + \greekAlphapsilitonos \or + \greekAlphadasiatonos \or + \greekAlphapsiliperispomeni \or + \greekAlphadasiaperispomeni \or + \greekepsilonpsili \or %1f10 + \greekepsilondasia \or + \greekepsilonpsilivaria \or + \greekepsilondasiavaria \or + \greekepsilonpsilitonos \or + \greekepsilondasiatonos \or + \unknownchar \or + \unknownchar \or + \greekEpsilonpsili \or + \greekEpsilondasia \or + \greekEpsilonpsilivaria \or + \greekEpsilondasiavaria \or + \greekEpsilonpsilitonos \or + \greekEpsilondasiatonos \or + \unknownchar \or + \unknownchar \or + \greeketapsili \or %1f20 + \greeketadasia \or + \greeketapsilivaria \or + \greeketadasiavaria \or + \greeketapsilitonos \or + \greeketadasiatonos \or + \greeketapsiliperispomeni \or + \greeketadasiaperispomeni \or + \greekEtapsili \or + \greekEtadasia \or + \greekEtapsilivaria \or + \greekEtadasiavaria \or + \greekEtapsilitonos \or + \greekEtadasiatonos \or + \greekEtapsiliperispomeni \or + \greekEtadasiaperispomeni \or + \greekiotapsili \or %1f30 + \greekiotadasia \or + \greekiotapsilivaria \or + \greekiotadasiavaria \or + \greekiotapsilitonos \or + \greekiotadasiatonos \or + \greekiotapsiliperispomeni \or + \greekiotadasiaperispomeni \or + \greekIotapsili \or + \greekIotadasia \or + \greekIotapsilivaria \or + \greekIotadasiavaria \or + \greekIotapsilitonos \or + \greekIotadasiatonos \or + \greekIotapsiliperispomeni \or + \greekIotadasiaperispomeni \or + \greekomicronpsili \or %1f40 + \greekomicrondasia \or + \greekomicronpsilivaria \or + \greekomicrondasiavaria \or + \greekomicronpsilitonos \or + \greekomicrondasiatonos \or + \unknownchar \or + \unknownchar \or + \greekOmicronpsili \or + \greekOmicrondasia \or + \greekOmicronpsilivaria \or + \greekOmicrondasiavaria \or + \greekOmicronpsilitonos \or + \greekOmicrondasiatonos \or + \unknownchar \or + \unknownchar \or + \greekupsilonpsili \or %1f50 + \greekupsilondasia \or + \greekupsilonpsilivaria \or + \greekupsilondasiavaria \or + \greekupsilonpsilitonos \or + \greekupsilondasiatonos \or + \greekupsilonpsiliperispomeni \or + \greekupsilondasiaperispomeni \or + \unknownchar \or + \greekUpsilondasia \or + \unknownchar \or + \greekUpsilondasiavaria \or + \unknownchar \or + \greekUpsilondasiatonos \or + \unknownchar \or + \greekUpsilondasiaperispomeni \or + \greekomegapsili \or %1f60 + \greekomegadasia \or + \greekomegapsilivaria \or + \greekomegadasiavaria \or + \greekomegapsilitonos \or + \greekomegadasiatonos \or + \greekomegapsiliperispomeni \or + \greekomegadasiaperispomeni \or + \greekOmegapsili \or + \greekOmegadasia \or + \greekOmegapsilivaria \or + \greekOmegadasiavaria \or + \greekOmegapsilitonos \or + \greekOmegadasiatonos \or + \greekOmegapsiliperispomeni \or + \greekOmegadasiaperispomeni \or + \greekalphavaria \or %1f70 + \greekalphaoxia \or + \greekepsilonvaria \or + \greekepsilonoxia \or + \greeketavaria \or + \greeketaoxia \or + \greekiotavaria \or + \greekiotaoxia \or + \greekomicronvaria \or + \greekomicronoxia \or + \greekupsilonvaria \or + \greekupsilonoxia \or + \greekomegavaria \or + \greekomegaoxia \or + \unknownchar \or + \unknownchar \or + \greekalphaiotasubpsili \or %1f80 + \greekalphaiotasubdasia \or + \greekalphaiotasubpsilivaria \or + \greekalphaiotasubdasiavaria \or + \greekalphaiotasubpsilitonos \or + \greekalphaiotasubdasiatonos \or + \greekalphaiotasubpsiliperispomeni \or + \greekalphaiotasubdasiaperispomeni \or + \greekAlphaiotasubpsili \or + \greekAlphaiotasubdasia \or + \greekAlphaiotasubpsilivaria \or + \greekAlphaiotasubdasiavaria \or + \greekAlphaiotasubpsilitonos \or + \greekAlphaiotasubdasiatonos \or + \greekAlphaiotasubpsiliperispomeni \or + \greekAlphaiotasubdasiaperispomeni \or + \greeketaiotasubpsili \or %1f90 + \greeketaiotasubdasia \or + \greeketaiotasubpsilivaria \or + \greeketaiotasubdasiavaria \or + \greeketaiotasubpsilitonos \or + \greeketaiotasubdasiatonos \or + \greeketaiotasubpsiliperispomeni \or + \greeketaiotasubdasiaperispomeni \or + \greekEtaiotasubpsili \or + \greekEtaiotasubdasia \or + \greekEtaiotasubpsilivaria \or + \greekEtaiotasubdasiavaria \or + \greekEtaiotasubpsilitonos \or + \greekEtaiotasubdasiatonos \or + \greekEtaiotasubpsiliperispomeni \or + \greekEtaiotasubdasiaperispomeni \or + \greekomegaiotasubpsili \or %1fa0 + \greekomegaiotasubdasia \or + \greekomegaiotasubpsilivaria \or + \greekomegaiotasubdasiavaria \or + \greekomegaiotasubpsilitonos \or + \greekomegaiotasubdasiatonos \or + \greekomegaiotasubpsiliperispomeni \or + \greekomegaiotasubdasiaperispomeni \or + \greekOmegaiotasubpsili \or + \greekOmegaiotasubdasia \or + \greekOmegaiotasubpsilivaria \or + \greekOmegaiotasubdasiavaria \or + \greekOmegaiotasubpsilitonos \or + \greekOmegaiotasubdasiatonos \or + \greekOmegaiotasubpsiliperispomeni \or + \greekOmegaiotasubdasiaperispomeni \or + \greekalphavrachy \or %1fb0 + \greekalphamacron \or + \greekalphaiotasubvaria \or + \greekalphaiotasub \or + \greekalphaiotasubtonos \or + \unknownchar \or + \greekalphaperispomeni \or + \greekalphaiotasubperispomeni \or + \greekAlphavrachy \or + \greekAlphamacron \or + \greekAlphavaria \or + \greekAlphaoxia \or + \greekAlphaiotasub \or + \greekCoronis \or + \greekprosgegrammeni \or + \greekpsili \or + \greekperispomeni \or %1fc0 + \greekdialytikaperispomeni \or + \greeketaiotasubvaria \or + \greeketaiotasub \or + \greeketaiotasubtonos \or + \unknownchar \or + \greeketaperispomeni \or + \greeketaiotasubperispomeni \or + \greekEpsilonvaria \or + \greekEpsilonoxia \or + \greekEtavaria \or + \greekEtaoxia \or + \greekEtaiotasub \or + \greekpsilivaria \or + \greekpsilitonos \or + \greekpsiliperispomeni \or + \greekiotavrachy \or %1fd0 + \greekiotamacron \or + \greekiotadialytikavaria \or + \greekiotadialytikatonos \or + \unknownchar \or + \unknownchar \or + \greekiotaperispomeni \or + \greekiotadialytikaperispomeni \or + \greekIotavrachy \or + \greekIotamacron \or + \greekIotavaria \or + \greekIotaoxia \or + \unknownchar \or + \greekdasiavaria \or + \greekdasiatonos \or + \greekdasiaperispomeni \or + \greekupsilonvrachy \or %1fe0 + \greekupsilonmacron \or + \greekupsilondialytikavaria \or + \greekupsilondialytikatonos \or + \greekrhopsili \or + \greekrhodasia \or + \greekupsilonperispomeni \or + \greekupsilondialytikaperispomeni \or + \greekUpsilonvrachy \or + \greekUpsilonmacron \or + \greekUpsilonvaria \or + \greekUpsilonoxia \or + \greekRhodasia \or + \greekdialytikavaria \or + \greekdialytikaoxia \or + \greekvaria \or + \unknownchar \or %1ff0 + \unknownchar \or + \greekomegaiotasubvaria \or + \greekomegaiotasub \or + \greekomegaiotasubtonos \or + \unknownchar \or + \greekomegaperispomeni \or + \greekomegaiotasubperispomeni \or + \greekOmicronvaria \or + \greekOmicronoxia \or + \greekOmegavaria \or + \greekOmegaoxia \or + \greekOmegaiotasub \or + \greekoxia \or + \greekdasia \else + \unknownchar + \fi +\stopunicodevector + +\protect \endinput + + + + + + + + + + diff --git a/tex/context/base/unic-031.tex b/tex/context/base/unic-031.tex deleted file mode 100644 index ae6bc1b8e..000000000 --- a/tex/context/base/unic-031.tex +++ /dev/null @@ -1,283 +0,0 @@ -%D \module -%D [ file=unic-031, -%D version=2005.02.20, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 31, -%D author=Thomas A. Schmitz, -%D date=\currentdate] - -\unprotect - -\startunicodevector 31 - \expandafter\strippedcsname - \ifcase\numexpr#1\relax - \greekalphapsili \or %1f00 - \greekalphadasia \or - \greekalphapsilivaria \or - \greekalphadasiavaria \or - \greekalphapsilitonos \or - \greekalphadasiatonos \or - \greekalphapsiliperispomeni \or - \greekalphadasiaperispomeni \or - \greekAlphapsili \or - \greekAlphadasia \or - \greekAlphapsilivaria \or - \greekAlphadasiavaria \or - \greekAlphapsilitonos \or - \greekAlphadasiatonos \or - \greekAlphapsiliperispomeni \or - \greekAlphadasiaperispomeni \or - \greekepsilonpsili \or %1f10 - \greekepsilondasia \or - \greekepsilonpsilivaria \or - \greekepsilondasiavaria \or - \greekepsilonpsilitonos \or - \greekepsilondasiatonos \or - \unknownchar \or - \unknownchar \or - \greekEpsilonpsili \or - \greekEpsilondasia \or - \greekEpsilonpsilivaria \or - \greekEpsilondasiavaria \or - \greekEpsilonpsilitonos \or - \greekEpsilondasiatonos \or - \unknownchar \or - \unknownchar \or - \greeketapsili \or %1f20 - \greeketadasia \or - \greeketapsilivaria \or - \greeketadasiavaria \or - \greeketapsilitonos \or - \greeketadasiatonos \or - \greeketapsiliperispomeni \or - \greeketadasiaperispomeni \or - \greekEtapsili \or - \greekEtadasia \or - \greekEtapsilivaria \or - \greekEtadasiavaria \or - \greekEtapsilitonos \or - \greekEtadasiatonos \or - \greekEtapsiliperispomeni \or - \greekEtadasiaperispomeni \or - \greekiotapsili \or %1f30 - \greekiotadasia \or - \greekiotapsilivaria \or - \greekiotadasiavaria \or - \greekiotapsilitonos \or - \greekiotadasiatonos \or - \greekiotapsiliperispomeni \or - \greekiotadasiaperispomeni \or - \greekIotapsili \or - \greekIotadasia \or - \greekIotapsilivaria \or - \greekIotadasiavaria \or - \greekIotapsilitonos \or - \greekIotadasiatonos \or - \greekIotapsiliperispomeni \or - \greekIotadasiaperispomeni \or - \greekomicronpsili \or %1f40 - \greekomicrondasia \or - \greekomicronpsilivaria \or - \greekomicrondasiavaria \or - \greekomicronpsilitonos \or - \greekomicrondasiatonos \or - \unknownchar \or - \unknownchar \or - \greekOmicronpsili \or - \greekOmicrondasia \or - \greekOmicronpsilivaria \or - \greekOmicrondasiavaria \or - \greekOmicronpsilitonos \or - \greekOmicrondasiatonos \or - \unknownchar \or - \unknownchar \or - \greekupsilonpsili \or %1f50 - \greekupsilondasia \or - \greekupsilonpsilivaria \or - \greekupsilondasiavaria \or - \greekupsilonpsilitonos \or - \greekupsilondasiatonos \or - \greekupsilonpsiliperispomeni \or - \greekupsilondasiaperispomeni \or - \unknownchar \or - \greekUpsilondasia \or - \unknownchar \or - \greekUpsilondasiavaria \or - \unknownchar \or - \greekUpsilondasiatonos \or - \unknownchar \or - \greekUpsilondasiaperispomeni \or - \greekomegapsili \or %1f60 - \greekomegadasia \or - \greekomegapsilivaria \or - \greekomegadasiavaria \or - \greekomegapsilitonos \or - \greekomegadasiatonos \or - \greekomegapsiliperispomeni \or - \greekomegadasiaperispomeni \or - \greekOmegapsili \or - \greekOmegadasia \or - \greekOmegapsilivaria \or - \greekOmegadasiavaria \or - \greekOmegapsilitonos \or - \greekOmegadasiatonos \or - \greekOmegapsiliperispomeni \or - \greekOmegadasiaperispomeni \or - \greekalphavaria \or %1f70 - \greekalphaoxia \or - \greekepsilonvaria \or - \greekepsilonoxia \or - \greeketavaria \or - \greeketaoxia \or - \greekiotavaria \or - \greekiotaoxia \or - \greekomicronvaria \or - \greekomicronoxia \or - \greekupsilonvaria \or - \greekupsilonoxia \or - \greekomegavaria \or - \greekomegaoxia \or - \unknownchar \or - \unknownchar \or - \greekalphaiotasubpsili \or %1f80 - \greekalphaiotasubdasia \or - \greekalphaiotasubpsilivaria \or - \greekalphaiotasubdasiavaria \or - \greekalphaiotasubpsilitonos \or - \greekalphaiotasubdasiatonos \or - \greekalphaiotasubpsiliperispomeni \or - \greekalphaiotasubdasiaperispomeni \or - \greekAlphaiotasubpsili \or - \greekAlphaiotasubdasia \or - \greekAlphaiotasubpsilivaria \or - \greekAlphaiotasubdasiavaria \or - \greekAlphaiotasubpsilitonos \or - \greekAlphaiotasubdasiatonos \or - \greekAlphaiotasubpsiliperispomeni \or - \greekAlphaiotasubdasiaperispomeni \or - \greeketaiotasubpsili \or %1f90 - \greeketaiotasubdasia \or - \greeketaiotasubpsilivaria \or - \greeketaiotasubdasiavaria \or - \greeketaiotasubpsilitonos \or - \greeketaiotasubdasiatonos \or - \greeketaiotasubpsiliperispomeni \or - \greeketaiotasubdasiaperispomeni \or - \greekEtaiotasubpsili \or - \greekEtaiotasubdasia \or - \greekEtaiotasubpsilivaria \or - \greekEtaiotasubdasiavaria \or - \greekEtaiotasubpsilitonos \or - \greekEtaiotasubdasiatonos \or - \greekEtaiotasubpsiliperispomeni \or - \greekEtaiotasubdasiaperispomeni \or - \greekomegaiotasubpsili \or %1fa0 - \greekomegaiotasubdasia \or - \greekomegaiotasubpsilivaria \or - \greekomegaiotasubdasiavaria \or - \greekomegaiotasubpsilitonos \or - \greekomegaiotasubdasiatonos \or - \greekomegaiotasubpsiliperispomeni \or - \greekomegaiotasubdasiaperispomeni \or - \greekOmegaiotasubpsili \or - \greekOmegaiotasubdasia \or - \greekOmegaiotasubpsilivaria \or - \greekOmegaiotasubdasiavaria \or - \greekOmegaiotasubpsilitonos \or - \greekOmegaiotasubdasiatonos \or - \greekOmegaiotasubpsiliperispomeni \or - \greekOmegaiotasubdasiaperispomeni \or - \greekalphavrachy \or %1fb0 - \greekalphamacron \or - \greekalphaiotasubvaria \or - \greekalphaiotasub \or - \greekalphaiotasubtonos \or - \unknownchar \or - \greekalphaperispomeni \or - \greekalphaiotasubperispomeni \or - \greekAlphavrachy \or - \greekAlphamacron \or - \greekAlphavaria \or - \greekAlphaoxia \or - \greekAlphaiotasub \or - \greekCoronis \or - \greekprosgegrammeni \or - \greekpsili \or - \greekperispomeni \or %1fc0 - \greekdialytikaperispomeni \or - \greeketaiotasubvaria \or - \greeketaiotasub \or - \greeketaiotasubtonos \or - \unknownchar \or - \greeketaperispomeni \or - \greeketaiotasubperispomeni \or - \greekEpsilonvaria \or - \greekEpsilonoxia \or - \greekEtavaria \or - \greekEtaoxia \or - \greekEtaiotasub \or - \greekpsilivaria \or - \greekpsilitonos \or - \greekpsiliperispomeni \or - \greekiotavrachy \or %1fd0 - \greekiotamacron \or - \greekiotadialytikavaria \or - \greekiotadialytikatonos \or - \unknownchar \or - \unknownchar \or - \greekiotaperispomeni \or - \greekiotadialytikaperispomeni \or - \greekIotavrachy \or - \greekIotamacron \or - \greekIotavaria \or - \greekIotaoxia \or - \unknownchar \or - \greekdasiavaria \or - \greekdasiatonos \or - \greekdasiaperispomeni \or - \greekupsilonvrachy \or %1fe0 - \greekupsilonmacron \or - \greekupsilondialytikavaria \or - \greekupsilondialytikatonos \or - \greekrhopsili \or - \greekrhodasia \or - \greekupsilonperispomeni \or - \greekupsilondialytikaperispomeni \or - \greekUpsilonvrachy \or - \greekUpsilonmacron \or - \greekUpsilonvaria \or - \greekUpsilonoxia \or - \greekRhodasia \or - \greekdialytikavaria \or - \greekdialytikaoxia \or - \greekvaria \or - \unknownchar \or %1ff0 - \unknownchar \or - \greekomegaiotasubvaria \or - \greekomegaiotasub \or - \greekomegaiotasubtonos \or - \unknownchar \or - \greekomegaperispomeni \or - \greekomegaiotasubperispomeni \or - \greekOmicronvaria \or - \greekOmicronoxia \or - \greekOmegavaria \or - \greekOmegaoxia \or - \greekOmegaiotasub \or - \greekoxia \or - \greekdasia \else - \unknownchar - \fi -\stopunicodevector - -\protect \endinput - - - - - - - - - - diff --git a/tex/context/base/unic-032.mkii b/tex/context/base/unic-032.mkii new file mode 100644 index 000000000..32c25e4e2 --- /dev/null +++ b/tex/context/base/unic-032.mkii @@ -0,0 +1,278 @@ +%D \module +%D [ file=unic-032, +%D version=2006.03.30, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 32, +%D author={Hans Hagen \& Taco Hoekwater}, +%D date=\currentdate, +%D copyright={PRAGMA / 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 + +\startunicodevector 32 + \expandafter\strippedcsname + \ifcase\numexpr#1\relax + \enspace \or % U+2000 EN QUAD + \emspace \or % U+2001 EM QUAD + \enspace \or % U+2002 EN SPACE + \emspace \or % U+2003 EM SPACE + \unic@threeperemspace \or % U+2004 THREE-PER-EM SPACE + \unic@fourperemspace \or % U+2005 FOUR-PER-EM SPACE + \unic@sixperemspace \or % U+2006 SIX-PER-EM SPACE + \unic@figurespace \or % U+2007 FIGURE SPACE + \unmic@punctiationspace \or % U+2008 PUNCTUATION SPACE + \thinspace \or % U+2009 THIN SPACE + \unic@hairspace \or % U+200A HAIR SPACE + \unic@zerowidthspace \or % U+200B ZERO WIDTH SPACE + \unic@zerowidthnonjoiner \or % U+200C ZERO WIDTH NON-JOINER + \unic@zerowidthjoiner \or % U+200D ZERO WIDTH JOINER + \unknownchar \or % U+200E LEFT-TO-RIGHT MARK + \unknownchar \or % U+200F RIGHT-TO-LEFT MARK + \breakinghyphen \or % U+2010 HYPHEN + \nonbreakinghyphen \or % U+2011 NON-BREAKING HYPHEN + \endash \or % U+2012 FIGURE DASH + \endash \or % U+2013 EN DASH + \emdash \or % U+2014 EM DASH + \emdash \or % U+2015 HORIZONTAL BAR + \unic@doubleverticalline \or % U+2016 DOUBLE VERTICAL LINE + \unic@doublelowline \or % U+2017 DOUBLE LOW LINE + \quoteleft \or % U+2018 LEFT SINGLE QUOTATION MARK + \quoteright \or % U+2019 RIGHT SINGLE QUOTATION MARK + \quotesinglebase \or % U+201A SINGLE LOW-9 QUOTATION MARK + \unic@quoteleftreversed \or % U+201B SINGLE HIGH-REVERSED-9 QUOTATION MARK + \quotedblleft \or % U+201C LEFT DOUBLE QUOTATION MARK + \quotedblright \or % U+201D RIGHT DOUBLE QUOTATION MARK + \quotedblbase \or % U+201E DOUBLE LOW-9 QUOTATION MARK + \unic@quotedblleftreversed \or % U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK + \textdag \or % U+2020 DAGGER + \textddag \or % U+2021 DOUBLE DAGGER + \textbullet \or % U+2022 BULLET + \blacktriangleright \or % U+2023 TRIANGULAR BULLET + \unic@onedotleader \or % U+2024 ONE DOT LEADER + \unic@twodotleader \or % U+2025 TWO DOT LEADER + \periods \or % U+2026 HORIZONTAL ELLIPSIS % was: \textellipsis + \unic@hyphenationpoint \or % U+2027 HYPHENATION POINT + \crlf \or % U+2028 LINE SEPARATOR + \endgraf \or % U+2029 PARAGRAPH SEPARATOR + \unknownchar \or % U+202A LEFT-TO-RIGHT EMBEDDING + \unknownchar \or % U+202B RIGHT-TO-LEFT EMBEDDING + \unknownchar \or % U+202C POP DIRECTIONAL FORMATTING + \unknownchar \or % U+202D LEFT-TO-RIGHT OVERRIDE + \unknownchar \or % U+202E RIGHT-TO-LEFT OVERRIDE + \ \or % U+202F NARROW NO-BREAK SPACE + \perthousand \or % U+2030 PER MILLE SIGN + \unknownchar \or % U+2031 PER TEN THOUSAND SIGN + \prime \or % U+2032 PRIME + \unic@doubleprime \or % U+2033 DOUBLE PRIME + \unic@tripleprime \or % U+2034 TRIPLE PRIME + \backprime \or % U+2035 REVERSED PRIME + \unic@reverseddoubleprime \or % U+2036 REVERSED DOUBLE PRIME + \unic@reversedtripleprime \or % U+2037 REVERSED TRIPLE PRIME + \unknownchar \or % U+2038 CARET + \guilsingleleft \or % U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK + \guilsingleright \or % U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK + \unknownchar \or % U+203B REFERENCE MARK + \unic@doubleexclamationmark \or % U+203C DOUBLE EXCLAMATION MARK + \unknownchar \or % U+203D INTERROBANG + \unknownchar \or % U+203E OVERLINE + \unknownchar \or % U+203F UNDERTIE + \unknownchar \or % U+2040 CHARACTER TIE + \unknownchar \or % U+2041 CARET INSERTION POINT + \unknownchar \or % U+2042 ASTERISM + \unknownchar \or % U+2043 HYPHEN BULLET + \unic@fractionslash \or % U+2044 FRACTION SLASH + \unknownchar \or % U+2045 LEFT SQUARE BRACKET WITH QUILL + \unknownchar \or % U+2046 RIGHT SQUARE BRACKET WITH QUILL + \unic@doublequestionmark \or % U+2047 DOUBLE QUESTION MARK + \unic@exclamationquestionmark\or % U+2048 QUESTION EXCLAMATION MARK + \unic@questionexclamationmark\or % U+2049 EXCLAMATION QUESTION MARK + \unknownchar \or % U+204A TIRONIAN SIGN ET + \unic@reversedpilcrowsign \or % U+204B REVERSED PILCROW SIGN + \unknownchar \or % U+204C BLACK LEFTWARDS BULLET + \unknownchar \or % U+204D BLACK RIGHTWARDS BULLET + \unic@lowasterisk \or % U+204E LOW ASTERISK + \unic@reversedsemicolon \or % U+204F REVERSED SEMICOLON + \unknownchar \or % U+2050 CLOSE UP + \unknownchar \or % U+2051 TWO ASTERISKS ALIGNED VERTICALLY + \unknownchar \or % U+2052 COMMERCIAL MINUS SIGN + \unknownchar \or % U+2053 SWUNG DASH + \unknownchar \or % U+2054 INVERTED UNDERTIE + \unknownchar \or % U+2055 FLOWER PUNCTUATION MARK + \unknownchar \or % U+2056 THREE DOT PUNCTUATION + \unknownchar \or % U+2057 QUADRUPLE PRIME + \unknownchar \or % U+2058 FOUR DOT PUNCTUATION + \unknownchar \or % U+2059 FIVE DOT PUNCTUATION + \unknownchar \or % U+205A TWO DOT PUNCTUATION + \unknownchar \or % U+205B FOUR DOT MARK + \unknownchar \or % U+205C DOTTED CROSS + \unknownchar \or % U+205D TRICOLON + \unknownchar \or % U+205E VERTICAL FOUR DOTS + \thickspace \or % U+205F MEDIUM MATHEMATICAL SPACE + \relax \or % U+2060 WORD JOINER + \unic@functionapplication \or % U+2061 FUNCTION APPLICATION + \unic@invisibletimes \or % U+2062 INVISIBLE TIMES + \unic@invisibleseparator \or % U+2063 INVISIBLE SEPARATOR (COMMA) + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \relax \or % U+206A INHIBIT SYMMETRIC SWAPPING + \relax \or % U+206B ACTIVATE SYMMETRIC SWAPPING + \relax \or % U+206C INHIBIT ARABIC FORM SHAPING + \relax \or % U+206D ACTIVATE ARABIC FORM SHAPING + \relax \or % U+206E NATIONAL DIGIT SHAPES + \relax \or % U+206F NOMINAL DIGIT SHAPES + \unic@superscriptzero \or % U+2070 SUPERSCRIPT ZERO + \unic@superscripti \or % U+2071 SUPERSCRIPT LATIN SMALL LETTER I + \unknownchar \or % U+2072 + \unknownchar \or % U+2073 + \unic@superscriptfour \or % U+2074 SUPERSCRIPT FOUR + \unic@superscriptfive \or % U+2075 SUPERSCRIPT FIVE + \unic@superscriptsix \or % U+2076 SUPERSCRIPT SIX + \unic@superscriptseven \or % U+2077 SUPERSCRIPT SEVEN + \unic@superscripteight \or % U+2078 SUPERSCRIPT EIGHT + \unic@superscriptnine \or % U+2079 SUPERSCRIPT NINE + \unic@superscriptplus \or % U+207A SUPERSCRIPT PLUS SIGN + \unic@superscriptminus \or % U+207B SUPERSCRIPT MINUS + \unic@superscriptequals \or % U+207C SUPERSCRIPT EQUALS SIGN + \unic@superscriptleft \or % U+207D SUPERSCRIPT LEFT PARENTHESIS + \unic@superscriptright \or % U+207E SUPERSCRIPT RIGHT PARENTHESIS + \unic@superscriptn \or % U+207F SUBSCRIPT LATIN SMALL LETTER N + \unic@subscriptzero \or % U+2080 SUBSCRIPT ZERO + \unic@subscriptone \or % U+2081 SUBSCRIPT ONE + \unic@subscripttwo \or % U+2082 SUBSCRIPT TWO + \unic@subscriptthree \or % U+2083 SUBSCRIPT THREE + \unic@subscriptfour \or % U+2084 SUBSCRIPT FOUR + \unic@subscriptfive \or % U+2085 SUBSCRIPT FIVE + \unic@subscriptsix \or % U+2086 SUBSCRIPT SIX + \unic@subscriptseven \or % U+2087 SUBSCRIPT SEVEN + \unic@subscripteight \or % U+2088 SUBSCRIPT EIGHT + \unic@subscriptnine \or % U+2089 SUBSCRIPT NINE + \unic@subscriptplus \or % U+208A SUBSCRIPT PLUS SIGN + \unic@subscriptminus \or % U+208B SUBSCRIPT MINUS + \unic@subscriptequals \or % U+208C SUBSCRIPT EQUALS SIGN + \unic@subscriptleft \or % U+208D SUBSCRIPT LEFT PARENTHESIS + \unic@subscriptright \or % U+208E SUBSCRIPT RIGHT PARENTHESIS + \unknownchar \or % + \unic@subscripta \or % U+2090 LATIN SUBSCRIPT SMALL LETTER A + \unic@subscripte \or % U+2091 LATIN SUBSCRIPT SMALL LETTER E + \unic@subscripto \or % U+2092 LATIN SUBSCRIPT SMALL LETTER O + \unic@subscriptx \or % U+2093 LATIN SUBSCRIPT SMALL LETTER X + \unic@subscriptschwa \or % U+2094 LATIN SUBSCRIPT SMALL LETTER SCHWA + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % U+20A0 EURO-CURRENCY SIGN + \unknownchar \or % U+20A1 COLON SIGN + \unknownchar \or % U+20A2 CRUZEIRO SIGN + \unknownchar \or % U+20A3 FRENCH FRANC SIGN + \unknownchar \or % U+20A4 LIRA SIGN + \unknownchar \or % U+20A5 MILL SIGN + \unknownchar \or % U+20A6 NAIRA SIGN + \unknownchar \or % U+20A7 PESETA SIGN + \unknownchar \or % U+20A8 RUPEE SIGN + \unknownchar \or % U+20A9 WON SIGN + \unknownchar \or % U+20AA NEW SHEQEL SIGN + \textdong \or % U+20AB DONG SIGN + \texteuro \or % U+20AC EURO SIGN + \unknownchar \or % U+20AD KIP SIGN + \unknownchar \or % U+20AE TUGRIK SIGN + \unknownchar \or % U+20AF DRACHMA SIGN + \unknownchar \or % U+20B0 GERMAN PENNY SIGN + \unknownchar \or % U+20B1 PESO SIGN + \unknownchar \or % U+20B2 GUARANI SIGN + \unknownchar \or % U+20B3 AUSTRAL SIGN + \unknownchar \or % U+20B4 HRYVNIA SIGN + \unknownchar \or % U+20B5 CEDI SIGN + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % U+20D0 COMBINING LEFT HARPOON ABOVE + \unknownchar \or % U+20D1 COMBINING RIGHT HARPOON ABOVE + \unknownchar \or % U+20D2 COMBINING LONG VERTICAL LINE OVERLAY + \unknownchar \or % U+20D3 COMBINING SHORT VERTICAL LINE OVERLAY + \unknownchar \or % U+20D4 COMBINING ANTICLOCKWISE ARROW ABOVE + \unknownchar \or % U+20D5 COMBINING CLOCKWISE ARROW ABOVE + \unknownchar \or % U+20D6 COMBINING LEFT ARROW ABOVE + \unknownchar \or % U+20D7 COMBINING RIGHT ARROW ABOVE + \unknownchar \or % U+20D8 COMBINING RING OVERLAY + \unknownchar \or % U+20D9 COMBINING CLOCKWISE RING OVERLAY + \unknownchar \or % U+20DA COMBINING ANTICLOCKWISE RING OVERLAY + \unknownchar \or % U+20DB COMBINING THREE DOTS ABOVE + \unknownchar \or % U+20DC COMBINING FOUR DOTS ABOVE + \unknownchar \or % U+20DD COMBINING ENCLOSING CIRCLE + \unknownchar \or % U+20DE COMBINING ENCLOSING SQUARE + \unknownchar \or % U+20DF COMBINING ENCLOSING DIAMOND + \unknownchar \or % U+20E0 COMBINING ENCLOSING CIRCLE BACKSLASH + \unknownchar \or % U+20E1 COMBINING LEFT RIGHT ARROW ABOVE + \unknownchar \or % U+20E2 COMBINING ENCLOSING SCREEN + \unknownchar \or % U+20E3 COMBINING ENCLOSING KEYCAP + \unknownchar \or % U+20E4 COMBINING ENCLOSING UPWARD POINTING TRIANGLE + \unknownchar \or % U+20E5 COMBINING REVERSE SOLIDUS OVERLAY + \unknownchar \or % U+20E6 COMBINING DOUBLE VERTICAL STROKE OVERLAY + \unknownchar \or % U+20E7 COMBINING ANNUITY SYMBOL + \unknownchar \or % U+20E8 COMBINING TRIPLE UNDERDOT + \unknownchar \or % U+20E9 COMBINING WIDE BRIDGE ABOVE + \unknownchar \or % U+20EA COMBINING LEFTWARDS ARROW OVERLAY + \unknownchar \or % U+20EB COMBINING LONG DOUBLE SOLIDUS OVERLAY + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \else % + \unknownchar \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-032.tex b/tex/context/base/unic-032.tex deleted file mode 100644 index 32c25e4e2..000000000 --- a/tex/context/base/unic-032.tex +++ /dev/null @@ -1,278 +0,0 @@ -%D \module -%D [ file=unic-032, -%D version=2006.03.30, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 32, -%D author={Hans Hagen \& Taco Hoekwater}, -%D date=\currentdate, -%D copyright={PRAGMA / 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 - -\startunicodevector 32 - \expandafter\strippedcsname - \ifcase\numexpr#1\relax - \enspace \or % U+2000 EN QUAD - \emspace \or % U+2001 EM QUAD - \enspace \or % U+2002 EN SPACE - \emspace \or % U+2003 EM SPACE - \unic@threeperemspace \or % U+2004 THREE-PER-EM SPACE - \unic@fourperemspace \or % U+2005 FOUR-PER-EM SPACE - \unic@sixperemspace \or % U+2006 SIX-PER-EM SPACE - \unic@figurespace \or % U+2007 FIGURE SPACE - \unmic@punctiationspace \or % U+2008 PUNCTUATION SPACE - \thinspace \or % U+2009 THIN SPACE - \unic@hairspace \or % U+200A HAIR SPACE - \unic@zerowidthspace \or % U+200B ZERO WIDTH SPACE - \unic@zerowidthnonjoiner \or % U+200C ZERO WIDTH NON-JOINER - \unic@zerowidthjoiner \or % U+200D ZERO WIDTH JOINER - \unknownchar \or % U+200E LEFT-TO-RIGHT MARK - \unknownchar \or % U+200F RIGHT-TO-LEFT MARK - \breakinghyphen \or % U+2010 HYPHEN - \nonbreakinghyphen \or % U+2011 NON-BREAKING HYPHEN - \endash \or % U+2012 FIGURE DASH - \endash \or % U+2013 EN DASH - \emdash \or % U+2014 EM DASH - \emdash \or % U+2015 HORIZONTAL BAR - \unic@doubleverticalline \or % U+2016 DOUBLE VERTICAL LINE - \unic@doublelowline \or % U+2017 DOUBLE LOW LINE - \quoteleft \or % U+2018 LEFT SINGLE QUOTATION MARK - \quoteright \or % U+2019 RIGHT SINGLE QUOTATION MARK - \quotesinglebase \or % U+201A SINGLE LOW-9 QUOTATION MARK - \unic@quoteleftreversed \or % U+201B SINGLE HIGH-REVERSED-9 QUOTATION MARK - \quotedblleft \or % U+201C LEFT DOUBLE QUOTATION MARK - \quotedblright \or % U+201D RIGHT DOUBLE QUOTATION MARK - \quotedblbase \or % U+201E DOUBLE LOW-9 QUOTATION MARK - \unic@quotedblleftreversed \or % U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK - \textdag \or % U+2020 DAGGER - \textddag \or % U+2021 DOUBLE DAGGER - \textbullet \or % U+2022 BULLET - \blacktriangleright \or % U+2023 TRIANGULAR BULLET - \unic@onedotleader \or % U+2024 ONE DOT LEADER - \unic@twodotleader \or % U+2025 TWO DOT LEADER - \periods \or % U+2026 HORIZONTAL ELLIPSIS % was: \textellipsis - \unic@hyphenationpoint \or % U+2027 HYPHENATION POINT - \crlf \or % U+2028 LINE SEPARATOR - \endgraf \or % U+2029 PARAGRAPH SEPARATOR - \unknownchar \or % U+202A LEFT-TO-RIGHT EMBEDDING - \unknownchar \or % U+202B RIGHT-TO-LEFT EMBEDDING - \unknownchar \or % U+202C POP DIRECTIONAL FORMATTING - \unknownchar \or % U+202D LEFT-TO-RIGHT OVERRIDE - \unknownchar \or % U+202E RIGHT-TO-LEFT OVERRIDE - \ \or % U+202F NARROW NO-BREAK SPACE - \perthousand \or % U+2030 PER MILLE SIGN - \unknownchar \or % U+2031 PER TEN THOUSAND SIGN - \prime \or % U+2032 PRIME - \unic@doubleprime \or % U+2033 DOUBLE PRIME - \unic@tripleprime \or % U+2034 TRIPLE PRIME - \backprime \or % U+2035 REVERSED PRIME - \unic@reverseddoubleprime \or % U+2036 REVERSED DOUBLE PRIME - \unic@reversedtripleprime \or % U+2037 REVERSED TRIPLE PRIME - \unknownchar \or % U+2038 CARET - \guilsingleleft \or % U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK - \guilsingleright \or % U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK - \unknownchar \or % U+203B REFERENCE MARK - \unic@doubleexclamationmark \or % U+203C DOUBLE EXCLAMATION MARK - \unknownchar \or % U+203D INTERROBANG - \unknownchar \or % U+203E OVERLINE - \unknownchar \or % U+203F UNDERTIE - \unknownchar \or % U+2040 CHARACTER TIE - \unknownchar \or % U+2041 CARET INSERTION POINT - \unknownchar \or % U+2042 ASTERISM - \unknownchar \or % U+2043 HYPHEN BULLET - \unic@fractionslash \or % U+2044 FRACTION SLASH - \unknownchar \or % U+2045 LEFT SQUARE BRACKET WITH QUILL - \unknownchar \or % U+2046 RIGHT SQUARE BRACKET WITH QUILL - \unic@doublequestionmark \or % U+2047 DOUBLE QUESTION MARK - \unic@exclamationquestionmark\or % U+2048 QUESTION EXCLAMATION MARK - \unic@questionexclamationmark\or % U+2049 EXCLAMATION QUESTION MARK - \unknownchar \or % U+204A TIRONIAN SIGN ET - \unic@reversedpilcrowsign \or % U+204B REVERSED PILCROW SIGN - \unknownchar \or % U+204C BLACK LEFTWARDS BULLET - \unknownchar \or % U+204D BLACK RIGHTWARDS BULLET - \unic@lowasterisk \or % U+204E LOW ASTERISK - \unic@reversedsemicolon \or % U+204F REVERSED SEMICOLON - \unknownchar \or % U+2050 CLOSE UP - \unknownchar \or % U+2051 TWO ASTERISKS ALIGNED VERTICALLY - \unknownchar \or % U+2052 COMMERCIAL MINUS SIGN - \unknownchar \or % U+2053 SWUNG DASH - \unknownchar \or % U+2054 INVERTED UNDERTIE - \unknownchar \or % U+2055 FLOWER PUNCTUATION MARK - \unknownchar \or % U+2056 THREE DOT PUNCTUATION - \unknownchar \or % U+2057 QUADRUPLE PRIME - \unknownchar \or % U+2058 FOUR DOT PUNCTUATION - \unknownchar \or % U+2059 FIVE DOT PUNCTUATION - \unknownchar \or % U+205A TWO DOT PUNCTUATION - \unknownchar \or % U+205B FOUR DOT MARK - \unknownchar \or % U+205C DOTTED CROSS - \unknownchar \or % U+205D TRICOLON - \unknownchar \or % U+205E VERTICAL FOUR DOTS - \thickspace \or % U+205F MEDIUM MATHEMATICAL SPACE - \relax \or % U+2060 WORD JOINER - \unic@functionapplication \or % U+2061 FUNCTION APPLICATION - \unic@invisibletimes \or % U+2062 INVISIBLE TIMES - \unic@invisibleseparator \or % U+2063 INVISIBLE SEPARATOR (COMMA) - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \relax \or % U+206A INHIBIT SYMMETRIC SWAPPING - \relax \or % U+206B ACTIVATE SYMMETRIC SWAPPING - \relax \or % U+206C INHIBIT ARABIC FORM SHAPING - \relax \or % U+206D ACTIVATE ARABIC FORM SHAPING - \relax \or % U+206E NATIONAL DIGIT SHAPES - \relax \or % U+206F NOMINAL DIGIT SHAPES - \unic@superscriptzero \or % U+2070 SUPERSCRIPT ZERO - \unic@superscripti \or % U+2071 SUPERSCRIPT LATIN SMALL LETTER I - \unknownchar \or % U+2072 - \unknownchar \or % U+2073 - \unic@superscriptfour \or % U+2074 SUPERSCRIPT FOUR - \unic@superscriptfive \or % U+2075 SUPERSCRIPT FIVE - \unic@superscriptsix \or % U+2076 SUPERSCRIPT SIX - \unic@superscriptseven \or % U+2077 SUPERSCRIPT SEVEN - \unic@superscripteight \or % U+2078 SUPERSCRIPT EIGHT - \unic@superscriptnine \or % U+2079 SUPERSCRIPT NINE - \unic@superscriptplus \or % U+207A SUPERSCRIPT PLUS SIGN - \unic@superscriptminus \or % U+207B SUPERSCRIPT MINUS - \unic@superscriptequals \or % U+207C SUPERSCRIPT EQUALS SIGN - \unic@superscriptleft \or % U+207D SUPERSCRIPT LEFT PARENTHESIS - \unic@superscriptright \or % U+207E SUPERSCRIPT RIGHT PARENTHESIS - \unic@superscriptn \or % U+207F SUBSCRIPT LATIN SMALL LETTER N - \unic@subscriptzero \or % U+2080 SUBSCRIPT ZERO - \unic@subscriptone \or % U+2081 SUBSCRIPT ONE - \unic@subscripttwo \or % U+2082 SUBSCRIPT TWO - \unic@subscriptthree \or % U+2083 SUBSCRIPT THREE - \unic@subscriptfour \or % U+2084 SUBSCRIPT FOUR - \unic@subscriptfive \or % U+2085 SUBSCRIPT FIVE - \unic@subscriptsix \or % U+2086 SUBSCRIPT SIX - \unic@subscriptseven \or % U+2087 SUBSCRIPT SEVEN - \unic@subscripteight \or % U+2088 SUBSCRIPT EIGHT - \unic@subscriptnine \or % U+2089 SUBSCRIPT NINE - \unic@subscriptplus \or % U+208A SUBSCRIPT PLUS SIGN - \unic@subscriptminus \or % U+208B SUBSCRIPT MINUS - \unic@subscriptequals \or % U+208C SUBSCRIPT EQUALS SIGN - \unic@subscriptleft \or % U+208D SUBSCRIPT LEFT PARENTHESIS - \unic@subscriptright \or % U+208E SUBSCRIPT RIGHT PARENTHESIS - \unknownchar \or % - \unic@subscripta \or % U+2090 LATIN SUBSCRIPT SMALL LETTER A - \unic@subscripte \or % U+2091 LATIN SUBSCRIPT SMALL LETTER E - \unic@subscripto \or % U+2092 LATIN SUBSCRIPT SMALL LETTER O - \unic@subscriptx \or % U+2093 LATIN SUBSCRIPT SMALL LETTER X - \unic@subscriptschwa \or % U+2094 LATIN SUBSCRIPT SMALL LETTER SCHWA - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % U+20A0 EURO-CURRENCY SIGN - \unknownchar \or % U+20A1 COLON SIGN - \unknownchar \or % U+20A2 CRUZEIRO SIGN - \unknownchar \or % U+20A3 FRENCH FRANC SIGN - \unknownchar \or % U+20A4 LIRA SIGN - \unknownchar \or % U+20A5 MILL SIGN - \unknownchar \or % U+20A6 NAIRA SIGN - \unknownchar \or % U+20A7 PESETA SIGN - \unknownchar \or % U+20A8 RUPEE SIGN - \unknownchar \or % U+20A9 WON SIGN - \unknownchar \or % U+20AA NEW SHEQEL SIGN - \textdong \or % U+20AB DONG SIGN - \texteuro \or % U+20AC EURO SIGN - \unknownchar \or % U+20AD KIP SIGN - \unknownchar \or % U+20AE TUGRIK SIGN - \unknownchar \or % U+20AF DRACHMA SIGN - \unknownchar \or % U+20B0 GERMAN PENNY SIGN - \unknownchar \or % U+20B1 PESO SIGN - \unknownchar \or % U+20B2 GUARANI SIGN - \unknownchar \or % U+20B3 AUSTRAL SIGN - \unknownchar \or % U+20B4 HRYVNIA SIGN - \unknownchar \or % U+20B5 CEDI SIGN - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % U+20D0 COMBINING LEFT HARPOON ABOVE - \unknownchar \or % U+20D1 COMBINING RIGHT HARPOON ABOVE - \unknownchar \or % U+20D2 COMBINING LONG VERTICAL LINE OVERLAY - \unknownchar \or % U+20D3 COMBINING SHORT VERTICAL LINE OVERLAY - \unknownchar \or % U+20D4 COMBINING ANTICLOCKWISE ARROW ABOVE - \unknownchar \or % U+20D5 COMBINING CLOCKWISE ARROW ABOVE - \unknownchar \or % U+20D6 COMBINING LEFT ARROW ABOVE - \unknownchar \or % U+20D7 COMBINING RIGHT ARROW ABOVE - \unknownchar \or % U+20D8 COMBINING RING OVERLAY - \unknownchar \or % U+20D9 COMBINING CLOCKWISE RING OVERLAY - \unknownchar \or % U+20DA COMBINING ANTICLOCKWISE RING OVERLAY - \unknownchar \or % U+20DB COMBINING THREE DOTS ABOVE - \unknownchar \or % U+20DC COMBINING FOUR DOTS ABOVE - \unknownchar \or % U+20DD COMBINING ENCLOSING CIRCLE - \unknownchar \or % U+20DE COMBINING ENCLOSING SQUARE - \unknownchar \or % U+20DF COMBINING ENCLOSING DIAMOND - \unknownchar \or % U+20E0 COMBINING ENCLOSING CIRCLE BACKSLASH - \unknownchar \or % U+20E1 COMBINING LEFT RIGHT ARROW ABOVE - \unknownchar \or % U+20E2 COMBINING ENCLOSING SCREEN - \unknownchar \or % U+20E3 COMBINING ENCLOSING KEYCAP - \unknownchar \or % U+20E4 COMBINING ENCLOSING UPWARD POINTING TRIANGLE - \unknownchar \or % U+20E5 COMBINING REVERSE SOLIDUS OVERLAY - \unknownchar \or % U+20E6 COMBINING DOUBLE VERTICAL STROKE OVERLAY - \unknownchar \or % U+20E7 COMBINING ANNUITY SYMBOL - \unknownchar \or % U+20E8 COMBINING TRIPLE UNDERDOT - \unknownchar \or % U+20E9 COMBINING WIDE BRIDGE ABOVE - \unknownchar \or % U+20EA COMBINING LEFTWARDS ARROW OVERLAY - \unknownchar \or % U+20EB COMBINING LONG DOUBLE SOLIDUS OVERLAY - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \else % - \unknownchar \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-033.mkii b/tex/context/base/unic-033.mkii new file mode 100644 index 000000000..91311a029 --- /dev/null +++ b/tex/context/base/unic-033.mkii @@ -0,0 +1,275 @@ +%D \module +%D [ file=unic-033, +%D version=2006.03.29, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 33, +%D author={Nikolai Weibull \& Hans Hagen \& Taco Hoekwater}, +%D date=\currentdate, +%D copyright={PRAGMA / Nikolai Weibull}] + +\unprotect + +\startunicodevector 33 + \expandafter\strippedcsname + \ifcase\numexpr#1\relax + \unic@accountof \or % 2100 ACCOUNT OF + \unic@addressedtothesubject \or % 2101 ADDRESSED TO THE SUBJECT + \unic@doublestruckC \or % 2102 DOUBLE-STRUCK CAPITAL C + \unic@degreecelsius \or % 2103 DEGREE CELSIUS + \unic@centrelinesymbol \or % 2104 CENTRE LINE SYMBOL + \unic@careof \or % 2105 CARE OF + \unic@cadauna \or % 2106 CADA UNA + \unic@eulerconstant \or % 2107 EULER CONSTANT + \unic@scruple \or % 2108 SCRUPLE + \unic@degreefahrenheit \or % 2109 DEGREE FAHRENHEIT + \unic@scriptg \or % 210A SCRIPT SMALL G + \unic@scriptH \or % 210B SCRIPT CAPITAL H + \unic@blackletterH \or % 210C BLACK-LETTER CAPITAL H + \unic@doublestruckH \or % 210D DOUBLE-STRUCK CAPITAL H + \unic@planckconstant \or % 210E PLANCK CONSTANT + \unic@planckconstantovertwopi \or % 210F PLANCK CONSTANT OVER TWO PI + \unic@scriptI \or % 2110 SCRIPT CAPITAL I + \unic@blackletterI \or % 2111 BLACK-LETTER CAPITAL I + \unic@scriptL \or % 2112 SCRIPT CAPITAL L + \unic@scriptl \or % 2113 SCRIPT SMALL L + \unic@lbbarsymbol \or % 2114 L B BAR SYMBOL + \unic@doublestruckN \or % 2115 DOUBLE-STRUCK CAPITAL N + \unic@numerosign \or % 2116 NUMERO SIGN + \unic@soundrecordingcopyright \or % 2117 SOUND RECORDING COPYRIGHT + \unic@scriptP \or % 2118 SCRIPT CAPITAL P + \unic@doublestruckP \or % 2119 DOUBLE-STRUCK CAPITAL P + \unic@doublestruckQ \or % 211A DOUBLE-STRUCK CAPITAL Q + \unic@scriptR \or % 211B SCRIPT CAPITAL R + \unic@blackletterR \or % 211C BLACK-LETTER CAPITAL R + \unic@doublestruckR \or % 211D DOUBLE-STRUCK CAPITAL R + \unic@prescriptiontake \or % 211E PRESCRIPTION TAKE + \unic@response \or % 211F RESPONSE + \unic@servicemark \or % 2120 SERVICE MARK + \unic@telephonesign \or % 2121 TELEPHONE SIGN + \unic@trademarksign \or % 2122 TRADE MARK SIGN + \unic@versickle \or % 2123 VERSICLE + \unic@doublestruckZ \or % 2124 DOUBLE-STRUCK CAPITAL Z + \unic@ouncesign \or % 2125 OUNCE SIGN + \unic@ohmsign \or % 2126 OHM SIGN + \unic@invertedohmsign \or % 2127 INVERTED OHM SIGN + \unic@blackletterZ \or % 2128 BLACK-LETTER CAPITAL Z + \unic@turnedgreekletteriota \or % 2129 TURNED GREEK SMALL LETTER IOTA + \unic@kelvinsign \or % 212A KELVIN SIGN + \unic@angstromsign \or % 212B ANGSTROM SIGN + \unic@scriptB \or % 212C SCRIPT CAPITAL B + \unic@blackletterC \or % 212D BLACK-LETTER CAPITAL C + \unic@estimatedsymbol \or % 212E ESTIMATED SYMBOL + \unic@scripte \or % 212F SCRIPT SMALL E + \unic@scriptE \or % 2130 SCRIPT CAPITAL E + \unic@scriptF \or % 2131 SCRIPT CAPITAL F + \unic@turnedF \or % 2132 TURNED CAPITAL F + \unic@scriptM \or % 2133 SCRIPT CAPITAL M + \unic@scripto \or % 2134 SCRIPT SMALL O + \aleph \or % 2135 ALEF SYMBOL + \beth \or % 2136 BET SYMBOL + \gimel \or % 2137 GIMEL SYMBOL + \daleth \or % 2138 DALET SYMBOL + \unic@informationsource \or % 2139 INFORMATION SOURCE + \unic@rotatedQ \or % 213A ROTATED CAPITAL Q + \unic@facsimilesign \or % 213B FACSIMILE SIGN + \unic@doublestruckpi \or % 213C DOUBLE-STRUCK SMALL PI + \unic@doublestruckgamma \or % 213D DOUBLE-STRUCK SMALL GAMMA + \unic@doublestruckGamma \or % 213E DOUBLE-STRUCK CAPITAL GAMMA + \unic@doublestruckPi \or % 213F DOUBLE-STRUCK CAPITAL PI + \unic@doublestrucknarysummation \or % 2140 DOUBLE-STRUCK N-ARY SUMMATION + \unic@turnedsansserifG \or % 2141 TURNED SANS-SERIF CAPITAL G + \unic@turnedsansserifL \or % 2142 TURNED SANS-SERIF CAPITAL L + \unic@reversedsansserifL \or % 2143 REVERSED SANS-SERIF CAPITAL L + \unic@turnedsansserifY \or % 2144 TURNED SANS-SERIF CAPITAL Y + \unic@doublestruckitalicD \or % 2145 DOUBLE-STRUCK ITALIC CAPITAL D + \unic@doublestruckitalicd \or % 2146 DOUBLE-STRUCK ITALIC SMALL D + \unic@doublestruckitalice \or % 2147 DOUBLE-STRUCK ITALIC SMALL E + \unic@doublestruckitalici \or % 2148 DOUBLE-STRUCK ITALIC SMALL I + \unic@doublestruckitalicj \or % 2149 DOUBLE-STRUCK ITALIC SMALL J + \unic@propertyline \or % 214A PROPERTY LINE + \unic@turnedampersand \or % 214B TURNED AMPERSAND + \unic@persign \or % 214C PER SIGN + \unknownchar \or % 214D + \unknownchar \or % 214E + \unknownchar \or % 214F + \unknownchar \or % 2150 + \unknownchar \or % 2151 + \unknownchar \or % 2152 + \unic@fractiononethird \or % 2153 VULGAR FRACTION ONE THIRD + \unic@fractiontwothirds \or % 2154 VULGAR FRACTION TWO THIRDS + \unic@fractiononefifth \or % 2155 VULGAR FRACTION ONE FIFTH + \unic@fractiontwofifths \or % 2156 VULGAR FRACTION TWO FIFTHS + \unic@fractionthreefifths \or % 2157 VULGAR FRACTION THREE FIFTHS + \unic@fractionfourfifths \or % 2158 VULGAR FRACTION FOUR FIFTHS + \unic@fractiononesixth \or % 2159 VULGAR FRACTION ONE SIXTH + \unic@fractionfivesixths \or % 215A VULGAR FRACTION FIVE SIXTHS + \unic@fractiononeeighth \or % 215B VULGAR FRACTION ONE EIGHTH + \unic@fractionthreeeighths \or % 215C VULGAR FRACTION THREE EIGHTHS + \unic@fractionfiveeighths \or % 215D VULGAR FRACTION FIVE EIGHTHS + \unic@fractionseveneighths \or % 215E VULGAR FRACTION SEVEN EIGHTHS + \unic@fractionnumeratorone \or % 215F FRACTION NUMERATOR ONE + \unic@romannumeralOne \or % 2160 ROMAN NUMERAL ONE + \unic@romannumeralTwo \or % 2161 ROMAN NUMERAL TWO + \unic@romannumeralThree \or % 2162 ROMAN NUMERAL THREE + \unic@romannumeralFour \or % 2163 ROMAN NUMERAL FOUR + \unic@romannumeralFive \or % 2164 ROMAN NUMERAL FIVE + \unic@romannumeralSix \or % 2165 ROMAN NUMERAL SIX + \unic@romannumeralSeven \or % 2166 ROMAN NUMERAL SEVEN + \unic@romannumeralEight \or % 2167 ROMAN NUMERAL EIGHT + \unic@romannumeralNine \or % 2168 ROMAN NUMERAL NINE + \unic@romannumeralTen \or % 2169 ROMAN NUMERAL TEN + \unic@romannumeralEleven \or % 216A ROMAN NUMERAL ELEVEN + \unic@romannumeralTwelve \or % 216B ROMAN NUMERAL TWELVE + \unic@romannumeralFifty \or % 216C ROMAN NUMERAL FIFTY + \unic@romannumeralOnehundred \or % 216D ROMAN NUMERAL ONE HUNDRED + \unic@romannumeralFivehundred \or % 216E ROMAN NUMERAL FIVE HUNDRED + \unic@romannumeralOnethousand \or % 216F ROMAN NUMERAL ONE THOUSAND + \unic@romannumeralone \or % 2170 SMALL ROMAN NUMERAL ONE + \unic@romannumeraltwo \or % 2171 SMALL ROMAN NUMERAL TWO + \unic@romannumeralthree \or % 2172 SMALL ROMAN NUMERAL THREE + \unic@romannumeralfour \or % 2173 SMALL ROMAN NUMERAL FOUR + \unic@romannumeralfive \or % 2174 SMALL ROMAN NUMERAL FIVE + \unic@romannumeralsix \or % 2175 SMALL ROMAN NUMERAL SIX + \unic@romannumeralseven \or % 2176 SMALL ROMAN NUMERAL SEVEN + \unic@romannumeraleight \or % 2177 SMALL ROMAN NUMERAL EIGHT + \unic@romannumeralnine \or % 2178 SMALL ROMAN NUMERAL NINE + \unic@romannumeralten \or % 2179 SMALL ROMAN NUMERAL TEN + \unic@romannumeraleleven \or % 217A SMALL ROMAN NUMERAL ELEVEN + \unic@romannumeraltwelve \or % 217B SMALL ROMAN NUMERAL TWELVE + \unic@romannumeralfifty \or % 217C SMALL ROMAN NUMERAL FIFTY + \unic@romannumeralonehundred \or % 217D SMALL ROMAN NUMERAL ONE HUNDRED + \unic@romannumeralfivehundred \or % 217E SMALL ROMAN NUMERAL FIVE HUNDRED + \unic@romannumeralonethousand \or % 217F SMALL ROMAN NUMERAL ONE THOUSAND + \unic@romannumeralonethousandCD \or % 2180 ROMAN NUMERAL ONE THOUSAND C D + \unic@romannumeralfivethousand \or % 2181 ROMAN NUMERAL FIVE THOUSAND + \unic@romannumeraltenthousand \or % 2182 ROMAN NUMERAL TEN THOUSAND + \unic@romannumeralreversedonehundred\or % 2183 ROMAN NUMERAL REVERSED ONE HUNDRED + \unknownchar \or % 2184 + \unknownchar \or % 2185 + \unknownchar \or % 2186 + \unknownchar \or % 2187 + \unknownchar \or % 2188 + \unknownchar \or % 2189 + \unknownchar \or % 218A + \unknownchar \or % 218B + \unknownchar \or % 218C + \unknownchar \or % 218D + \unknownchar \or % 218E + \unknownchar \or % 218F + \leftarrow \or % LEFTWARDS ARROW + \uparrow \or % UPWARDS ARROW + \rightarrow \or % RIGHTWARDS ARROW + \downarrow \or % DOWNWARDS ARROW + \leftrightarrow \or % LEFT RIGHT ARROW + \updownarrow \or % UP DOWN ARROW + \nwarrow \or % NORTH WEST ARROW + \nearrow \or % NORTH EAST ARROW + \searrow \or % SOUTH EAST ARROW + \swarrow \or % SOUTH WEST ARROW + \nleftarrow \or % LEFTWARDS ARROW WITH STROKE + \nrightarrow \or % RIGHTWARDS ARROW WITH STROKE + \unknownchar \or % LEFTWARDS WAVE ARROW + \unknownchar \or % RIGHTWARDS WAVE ARROW + \twoheadedleftarrow \or % LEFTWARDS TWO HEADED ARROW + \unknownchar \or % UPWARDS TWO HEADED ARROW + \twoheadedrightarrow \or % RIGHTWARDS TWO HEADED ARROW + \unknownchar \or % DOWNWARDS TWO HEADED ARROW + \leftarrowtail \or % LEFTWARDS ARROW WITH TAIL + \rightarrowtail \or % RIGHTWARDS ARROW WITH TAIL + \mapsfrom \or % LEFTWARDS ARROW FROM BAR + \unknownchar \or % UPWARDS ARROW FROM BAR + \mapsto \or % RIGHTWARDS ARROW FROM BAR + \unknownchar \or % DOWNWARDS ARROW FROM BAR + \unknownchar \or % UP DOWN ARROW WITH BASE + \hookleftarrow \or % LEFTWARDS ARROW WITH HOOK + \hookrightarrow \or % RIGHTWARDS ARROW WITH HOOK + \loopleftarrow \or % LEFTWARDS ARROW WITH LOOP + \looprightarrow \or % RIGHTWARDS ARROW WITH LOOP + \unknownchar \or % LEFT RIGHT WAVE ARROW + \nleftrightarrow \or % LEFT RIGHT ARROW WITH STROKE + \lightning \or % DOWNWARDS ZIGZAG ARROW + \Lsh \or % UPWARDS ARROW WITH TIP LEFTWARDS + \Rsh \or % UPWARDS ARROW WITH TIP RIGHTWARDS + \unknownchar \or % DOWNWARDS ARROW WITH TIP LEFTWARDS + \unknownchar \or % DOWNWARDS ARROW WITH TIP RIGHTWARDS + \unknownchar \or % RIGHTWARDS ARROW WITH CORNER DOWNWARDS + \unknownchar \or % DOWNWARDS ARROW WITH CORNER LEFTWARDS + \curveleftarrow \or % ANTICLOCKWISE TOP SEMICIRCLE ARROW + \curverightarrow \or % CLOCKWISE TOP SEMICIRCLE ARROW + \unknownchar \or % NORTH WEST ARROW TO LONG BAR + \unknownchar \or % LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR + \circlearrowleft \or % ANTICLOCKWISE OPEN CIRCLE ARROW + \circlearrowright \or % CLOCKWISE OPEN CIRCLE ARROW + \leftharpoonup \or % LEFTWARDS HARPOON WITH BARB UPWARDS + \leftharpoondown \or % LEFTWARDS HARPOON WITH BARB DOWNWARDS + \upharpoonright \or % UPWARDS HARPOON WITH BARB RIGHTWARDS + \upharpoonleft \or % UPWARDS HARPOON WITH BARB LEFTWARDS + \rightharpoonup \or % RIGHTWARDS HARPOON WITH BARB UPWARDS + \rightharpoondown \or % RIGHTWARDS HARPOON WITH BARB DOWNWARDS + \downharpoonright \or % DOWNWARDS HARPOON WITH BARB RIGHTWARDS + \downharpoonleft \or % DOWNWARDS HARPOON WITH BARB LEFTWARDS + \rightleftarrows \or % RIGHTWARDS ARROW OVER LEFTWARDS ARROW + \unknownchar \or % UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW + \leftrightarrows \or % LEFTWARDS ARROW OVER RIGHTWARDS ARROW + \leftleftarrows \or % LEFTWARDS PAIRED ARROWS + \upuparrows \or % UPWARDS PAIRED ARROWS + \rightrightarrows \or % RIGHTWARDS PAIRED ARROWS + \downdownarrows \or % DOWNWARDS PAIRED ARROWS + \leftrightharpoons \or % LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON + \rightleftharpoons \or % RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON + \nLeftarrow \or % LEFTWARDS DOUBLE ARROW WITH STROKE + \nLeftrightarrow \or % LEFT RIGHT DOUBLE ARROW WITH STROKE + \nRightarrow \or % RIGHTWARDS DOUBLE ARROW WITH STROKE + \Leftarrow \or % LEFTWARDS DOUBLE ARROW + \Uparrow \or % UPWARDS DOUBLE ARROW + \Rightarrow \or % RIGHTWARDS DOUBLE ARROW + \Downarrow \or % DOWNWARDS DOUBLE ARROW + \Leftrightarrow \or % LEFT RIGHT DOUBLE ARROW + \Updownarrow \or % UP DOWN DOUBLE ARROW + \unknownchar \or % NORTH WEST DOUBLE ARROW + \unknownchar \or % NORTH EAST DOUBLE ARROW + \unknownchar \or % SOUTH EAST DOUBLE ARROW + \unknownchar \or % SOUTH WEST DOUBLE ARROW + \Lleftarrow \or % LEFTWARDS TRIPLE ARROW + \unknownchar \or % RIGHTWARDS TRIPLE ARROW + \leftsquidarrow \or % LEFTWARDS SQUIGGLE ARROW + \rightsquidarrow \or % RIGHTWARDS SQUIGGLE ARROW + \unknownchar \or % UPWARDS ARROW WITH DOUBLE STROKE + \unknownchar \or % DOWNWARDS ARROW WITH DOUBLE STROKE + \dashleftarrow \or % LEFTWARDS DASHED ARROW + \unknownchar \or % UPWARDS DASHED ARROW + \dashrightarrow \or % RIGHTWARDS DASHED ARROW + \unknownchar \or % DOWNWARDS DASHED ARROW + \unic@leftarrowtobar \or % LEFTWARDS ARROW TO BAR + \unknownchar \or % RIGHTWARDS ARROW TO BAR + \unknownchar \or % LEFTWARDS WHITE ARROW + \unknownchar \or % UPWARDS WHITE ARROW + \unknownchar \or % RIGHTWARDS WHITE ARROW + \unknownchar \or % DOWNWARDS WHITE ARROW + \unknownchar \or % UPWARDS WHITE ARROW FROM BAR + \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL + \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL WITH HORIZONTAL BAR + \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL WITH VERTICAL BAR + \unknownchar \or % UPWARDS WHITE DOUBLE ARROW + \unknownchar \or % UPWARDS WHITE DOUBLE ARROW ON PEDESTAL + \unknownchar \or % RIGHTWARDS WHITE ARROW FROM WALL + \unknownchar \or % NORTH WEST ARROW TO CORNER + \unknownchar \or % SOUTH EAST ARROW TO CORNER + \unknownchar \or % UP DOWN WHITE ARROW + \unknownchar \or % RIGHT ARROW WITH SMALL CIRCLE + \unknownchar \or % DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW + \unknownchar \or % THREE RIGHTWARDS ARROWS + \unknownchar \or % LEFTWARDS ARROW WITH VERTICAL STROKE + \unknownchar \or % RIGHTWARDS ARROW WITH VERTICAL STROKE + \unknownchar \or % LEFT RIGHT ARROW WITH VERTICAL STROKE + \unknownchar \or % LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE + \unknownchar \or % RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE + \unknownchar \or % LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE + \leftarrowtriangle \or % LEFTWARDS OPEN-HEADED ARROW + \rightarrowtriangle \or % RIGHTWARDS OPEN-HEADED ARROW + \leftrightarrowtriangle \else % LEFT RIGHT OPEN-HEADED ARROW + \unknowncharacter + \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-033.tex b/tex/context/base/unic-033.tex deleted file mode 100644 index 91311a029..000000000 --- a/tex/context/base/unic-033.tex +++ /dev/null @@ -1,275 +0,0 @@ -%D \module -%D [ file=unic-033, -%D version=2006.03.29, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 33, -%D author={Nikolai Weibull \& Hans Hagen \& Taco Hoekwater}, -%D date=\currentdate, -%D copyright={PRAGMA / Nikolai Weibull}] - -\unprotect - -\startunicodevector 33 - \expandafter\strippedcsname - \ifcase\numexpr#1\relax - \unic@accountof \or % 2100 ACCOUNT OF - \unic@addressedtothesubject \or % 2101 ADDRESSED TO THE SUBJECT - \unic@doublestruckC \or % 2102 DOUBLE-STRUCK CAPITAL C - \unic@degreecelsius \or % 2103 DEGREE CELSIUS - \unic@centrelinesymbol \or % 2104 CENTRE LINE SYMBOL - \unic@careof \or % 2105 CARE OF - \unic@cadauna \or % 2106 CADA UNA - \unic@eulerconstant \or % 2107 EULER CONSTANT - \unic@scruple \or % 2108 SCRUPLE - \unic@degreefahrenheit \or % 2109 DEGREE FAHRENHEIT - \unic@scriptg \or % 210A SCRIPT SMALL G - \unic@scriptH \or % 210B SCRIPT CAPITAL H - \unic@blackletterH \or % 210C BLACK-LETTER CAPITAL H - \unic@doublestruckH \or % 210D DOUBLE-STRUCK CAPITAL H - \unic@planckconstant \or % 210E PLANCK CONSTANT - \unic@planckconstantovertwopi \or % 210F PLANCK CONSTANT OVER TWO PI - \unic@scriptI \or % 2110 SCRIPT CAPITAL I - \unic@blackletterI \or % 2111 BLACK-LETTER CAPITAL I - \unic@scriptL \or % 2112 SCRIPT CAPITAL L - \unic@scriptl \or % 2113 SCRIPT SMALL L - \unic@lbbarsymbol \or % 2114 L B BAR SYMBOL - \unic@doublestruckN \or % 2115 DOUBLE-STRUCK CAPITAL N - \unic@numerosign \or % 2116 NUMERO SIGN - \unic@soundrecordingcopyright \or % 2117 SOUND RECORDING COPYRIGHT - \unic@scriptP \or % 2118 SCRIPT CAPITAL P - \unic@doublestruckP \or % 2119 DOUBLE-STRUCK CAPITAL P - \unic@doublestruckQ \or % 211A DOUBLE-STRUCK CAPITAL Q - \unic@scriptR \or % 211B SCRIPT CAPITAL R - \unic@blackletterR \or % 211C BLACK-LETTER CAPITAL R - \unic@doublestruckR \or % 211D DOUBLE-STRUCK CAPITAL R - \unic@prescriptiontake \or % 211E PRESCRIPTION TAKE - \unic@response \or % 211F RESPONSE - \unic@servicemark \or % 2120 SERVICE MARK - \unic@telephonesign \or % 2121 TELEPHONE SIGN - \unic@trademarksign \or % 2122 TRADE MARK SIGN - \unic@versickle \or % 2123 VERSICLE - \unic@doublestruckZ \or % 2124 DOUBLE-STRUCK CAPITAL Z - \unic@ouncesign \or % 2125 OUNCE SIGN - \unic@ohmsign \or % 2126 OHM SIGN - \unic@invertedohmsign \or % 2127 INVERTED OHM SIGN - \unic@blackletterZ \or % 2128 BLACK-LETTER CAPITAL Z - \unic@turnedgreekletteriota \or % 2129 TURNED GREEK SMALL LETTER IOTA - \unic@kelvinsign \or % 212A KELVIN SIGN - \unic@angstromsign \or % 212B ANGSTROM SIGN - \unic@scriptB \or % 212C SCRIPT CAPITAL B - \unic@blackletterC \or % 212D BLACK-LETTER CAPITAL C - \unic@estimatedsymbol \or % 212E ESTIMATED SYMBOL - \unic@scripte \or % 212F SCRIPT SMALL E - \unic@scriptE \or % 2130 SCRIPT CAPITAL E - \unic@scriptF \or % 2131 SCRIPT CAPITAL F - \unic@turnedF \or % 2132 TURNED CAPITAL F - \unic@scriptM \or % 2133 SCRIPT CAPITAL M - \unic@scripto \or % 2134 SCRIPT SMALL O - \aleph \or % 2135 ALEF SYMBOL - \beth \or % 2136 BET SYMBOL - \gimel \or % 2137 GIMEL SYMBOL - \daleth \or % 2138 DALET SYMBOL - \unic@informationsource \or % 2139 INFORMATION SOURCE - \unic@rotatedQ \or % 213A ROTATED CAPITAL Q - \unic@facsimilesign \or % 213B FACSIMILE SIGN - \unic@doublestruckpi \or % 213C DOUBLE-STRUCK SMALL PI - \unic@doublestruckgamma \or % 213D DOUBLE-STRUCK SMALL GAMMA - \unic@doublestruckGamma \or % 213E DOUBLE-STRUCK CAPITAL GAMMA - \unic@doublestruckPi \or % 213F DOUBLE-STRUCK CAPITAL PI - \unic@doublestrucknarysummation \or % 2140 DOUBLE-STRUCK N-ARY SUMMATION - \unic@turnedsansserifG \or % 2141 TURNED SANS-SERIF CAPITAL G - \unic@turnedsansserifL \or % 2142 TURNED SANS-SERIF CAPITAL L - \unic@reversedsansserifL \or % 2143 REVERSED SANS-SERIF CAPITAL L - \unic@turnedsansserifY \or % 2144 TURNED SANS-SERIF CAPITAL Y - \unic@doublestruckitalicD \or % 2145 DOUBLE-STRUCK ITALIC CAPITAL D - \unic@doublestruckitalicd \or % 2146 DOUBLE-STRUCK ITALIC SMALL D - \unic@doublestruckitalice \or % 2147 DOUBLE-STRUCK ITALIC SMALL E - \unic@doublestruckitalici \or % 2148 DOUBLE-STRUCK ITALIC SMALL I - \unic@doublestruckitalicj \or % 2149 DOUBLE-STRUCK ITALIC SMALL J - \unic@propertyline \or % 214A PROPERTY LINE - \unic@turnedampersand \or % 214B TURNED AMPERSAND - \unic@persign \or % 214C PER SIGN - \unknownchar \or % 214D - \unknownchar \or % 214E - \unknownchar \or % 214F - \unknownchar \or % 2150 - \unknownchar \or % 2151 - \unknownchar \or % 2152 - \unic@fractiononethird \or % 2153 VULGAR FRACTION ONE THIRD - \unic@fractiontwothirds \or % 2154 VULGAR FRACTION TWO THIRDS - \unic@fractiononefifth \or % 2155 VULGAR FRACTION ONE FIFTH - \unic@fractiontwofifths \or % 2156 VULGAR FRACTION TWO FIFTHS - \unic@fractionthreefifths \or % 2157 VULGAR FRACTION THREE FIFTHS - \unic@fractionfourfifths \or % 2158 VULGAR FRACTION FOUR FIFTHS - \unic@fractiononesixth \or % 2159 VULGAR FRACTION ONE SIXTH - \unic@fractionfivesixths \or % 215A VULGAR FRACTION FIVE SIXTHS - \unic@fractiononeeighth \or % 215B VULGAR FRACTION ONE EIGHTH - \unic@fractionthreeeighths \or % 215C VULGAR FRACTION THREE EIGHTHS - \unic@fractionfiveeighths \or % 215D VULGAR FRACTION FIVE EIGHTHS - \unic@fractionseveneighths \or % 215E VULGAR FRACTION SEVEN EIGHTHS - \unic@fractionnumeratorone \or % 215F FRACTION NUMERATOR ONE - \unic@romannumeralOne \or % 2160 ROMAN NUMERAL ONE - \unic@romannumeralTwo \or % 2161 ROMAN NUMERAL TWO - \unic@romannumeralThree \or % 2162 ROMAN NUMERAL THREE - \unic@romannumeralFour \or % 2163 ROMAN NUMERAL FOUR - \unic@romannumeralFive \or % 2164 ROMAN NUMERAL FIVE - \unic@romannumeralSix \or % 2165 ROMAN NUMERAL SIX - \unic@romannumeralSeven \or % 2166 ROMAN NUMERAL SEVEN - \unic@romannumeralEight \or % 2167 ROMAN NUMERAL EIGHT - \unic@romannumeralNine \or % 2168 ROMAN NUMERAL NINE - \unic@romannumeralTen \or % 2169 ROMAN NUMERAL TEN - \unic@romannumeralEleven \or % 216A ROMAN NUMERAL ELEVEN - \unic@romannumeralTwelve \or % 216B ROMAN NUMERAL TWELVE - \unic@romannumeralFifty \or % 216C ROMAN NUMERAL FIFTY - \unic@romannumeralOnehundred \or % 216D ROMAN NUMERAL ONE HUNDRED - \unic@romannumeralFivehundred \or % 216E ROMAN NUMERAL FIVE HUNDRED - \unic@romannumeralOnethousand \or % 216F ROMAN NUMERAL ONE THOUSAND - \unic@romannumeralone \or % 2170 SMALL ROMAN NUMERAL ONE - \unic@romannumeraltwo \or % 2171 SMALL ROMAN NUMERAL TWO - \unic@romannumeralthree \or % 2172 SMALL ROMAN NUMERAL THREE - \unic@romannumeralfour \or % 2173 SMALL ROMAN NUMERAL FOUR - \unic@romannumeralfive \or % 2174 SMALL ROMAN NUMERAL FIVE - \unic@romannumeralsix \or % 2175 SMALL ROMAN NUMERAL SIX - \unic@romannumeralseven \or % 2176 SMALL ROMAN NUMERAL SEVEN - \unic@romannumeraleight \or % 2177 SMALL ROMAN NUMERAL EIGHT - \unic@romannumeralnine \or % 2178 SMALL ROMAN NUMERAL NINE - \unic@romannumeralten \or % 2179 SMALL ROMAN NUMERAL TEN - \unic@romannumeraleleven \or % 217A SMALL ROMAN NUMERAL ELEVEN - \unic@romannumeraltwelve \or % 217B SMALL ROMAN NUMERAL TWELVE - \unic@romannumeralfifty \or % 217C SMALL ROMAN NUMERAL FIFTY - \unic@romannumeralonehundred \or % 217D SMALL ROMAN NUMERAL ONE HUNDRED - \unic@romannumeralfivehundred \or % 217E SMALL ROMAN NUMERAL FIVE HUNDRED - \unic@romannumeralonethousand \or % 217F SMALL ROMAN NUMERAL ONE THOUSAND - \unic@romannumeralonethousandCD \or % 2180 ROMAN NUMERAL ONE THOUSAND C D - \unic@romannumeralfivethousand \or % 2181 ROMAN NUMERAL FIVE THOUSAND - \unic@romannumeraltenthousand \or % 2182 ROMAN NUMERAL TEN THOUSAND - \unic@romannumeralreversedonehundred\or % 2183 ROMAN NUMERAL REVERSED ONE HUNDRED - \unknownchar \or % 2184 - \unknownchar \or % 2185 - \unknownchar \or % 2186 - \unknownchar \or % 2187 - \unknownchar \or % 2188 - \unknownchar \or % 2189 - \unknownchar \or % 218A - \unknownchar \or % 218B - \unknownchar \or % 218C - \unknownchar \or % 218D - \unknownchar \or % 218E - \unknownchar \or % 218F - \leftarrow \or % LEFTWARDS ARROW - \uparrow \or % UPWARDS ARROW - \rightarrow \or % RIGHTWARDS ARROW - \downarrow \or % DOWNWARDS ARROW - \leftrightarrow \or % LEFT RIGHT ARROW - \updownarrow \or % UP DOWN ARROW - \nwarrow \or % NORTH WEST ARROW - \nearrow \or % NORTH EAST ARROW - \searrow \or % SOUTH EAST ARROW - \swarrow \or % SOUTH WEST ARROW - \nleftarrow \or % LEFTWARDS ARROW WITH STROKE - \nrightarrow \or % RIGHTWARDS ARROW WITH STROKE - \unknownchar \or % LEFTWARDS WAVE ARROW - \unknownchar \or % RIGHTWARDS WAVE ARROW - \twoheadedleftarrow \or % LEFTWARDS TWO HEADED ARROW - \unknownchar \or % UPWARDS TWO HEADED ARROW - \twoheadedrightarrow \or % RIGHTWARDS TWO HEADED ARROW - \unknownchar \or % DOWNWARDS TWO HEADED ARROW - \leftarrowtail \or % LEFTWARDS ARROW WITH TAIL - \rightarrowtail \or % RIGHTWARDS ARROW WITH TAIL - \mapsfrom \or % LEFTWARDS ARROW FROM BAR - \unknownchar \or % UPWARDS ARROW FROM BAR - \mapsto \or % RIGHTWARDS ARROW FROM BAR - \unknownchar \or % DOWNWARDS ARROW FROM BAR - \unknownchar \or % UP DOWN ARROW WITH BASE - \hookleftarrow \or % LEFTWARDS ARROW WITH HOOK - \hookrightarrow \or % RIGHTWARDS ARROW WITH HOOK - \loopleftarrow \or % LEFTWARDS ARROW WITH LOOP - \looprightarrow \or % RIGHTWARDS ARROW WITH LOOP - \unknownchar \or % LEFT RIGHT WAVE ARROW - \nleftrightarrow \or % LEFT RIGHT ARROW WITH STROKE - \lightning \or % DOWNWARDS ZIGZAG ARROW - \Lsh \or % UPWARDS ARROW WITH TIP LEFTWARDS - \Rsh \or % UPWARDS ARROW WITH TIP RIGHTWARDS - \unknownchar \or % DOWNWARDS ARROW WITH TIP LEFTWARDS - \unknownchar \or % DOWNWARDS ARROW WITH TIP RIGHTWARDS - \unknownchar \or % RIGHTWARDS ARROW WITH CORNER DOWNWARDS - \unknownchar \or % DOWNWARDS ARROW WITH CORNER LEFTWARDS - \curveleftarrow \or % ANTICLOCKWISE TOP SEMICIRCLE ARROW - \curverightarrow \or % CLOCKWISE TOP SEMICIRCLE ARROW - \unknownchar \or % NORTH WEST ARROW TO LONG BAR - \unknownchar \or % LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR - \circlearrowleft \or % ANTICLOCKWISE OPEN CIRCLE ARROW - \circlearrowright \or % CLOCKWISE OPEN CIRCLE ARROW - \leftharpoonup \or % LEFTWARDS HARPOON WITH BARB UPWARDS - \leftharpoondown \or % LEFTWARDS HARPOON WITH BARB DOWNWARDS - \upharpoonright \or % UPWARDS HARPOON WITH BARB RIGHTWARDS - \upharpoonleft \or % UPWARDS HARPOON WITH BARB LEFTWARDS - \rightharpoonup \or % RIGHTWARDS HARPOON WITH BARB UPWARDS - \rightharpoondown \or % RIGHTWARDS HARPOON WITH BARB DOWNWARDS - \downharpoonright \or % DOWNWARDS HARPOON WITH BARB RIGHTWARDS - \downharpoonleft \or % DOWNWARDS HARPOON WITH BARB LEFTWARDS - \rightleftarrows \or % RIGHTWARDS ARROW OVER LEFTWARDS ARROW - \unknownchar \or % UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW - \leftrightarrows \or % LEFTWARDS ARROW OVER RIGHTWARDS ARROW - \leftleftarrows \or % LEFTWARDS PAIRED ARROWS - \upuparrows \or % UPWARDS PAIRED ARROWS - \rightrightarrows \or % RIGHTWARDS PAIRED ARROWS - \downdownarrows \or % DOWNWARDS PAIRED ARROWS - \leftrightharpoons \or % LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON - \rightleftharpoons \or % RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON - \nLeftarrow \or % LEFTWARDS DOUBLE ARROW WITH STROKE - \nLeftrightarrow \or % LEFT RIGHT DOUBLE ARROW WITH STROKE - \nRightarrow \or % RIGHTWARDS DOUBLE ARROW WITH STROKE - \Leftarrow \or % LEFTWARDS DOUBLE ARROW - \Uparrow \or % UPWARDS DOUBLE ARROW - \Rightarrow \or % RIGHTWARDS DOUBLE ARROW - \Downarrow \or % DOWNWARDS DOUBLE ARROW - \Leftrightarrow \or % LEFT RIGHT DOUBLE ARROW - \Updownarrow \or % UP DOWN DOUBLE ARROW - \unknownchar \or % NORTH WEST DOUBLE ARROW - \unknownchar \or % NORTH EAST DOUBLE ARROW - \unknownchar \or % SOUTH EAST DOUBLE ARROW - \unknownchar \or % SOUTH WEST DOUBLE ARROW - \Lleftarrow \or % LEFTWARDS TRIPLE ARROW - \unknownchar \or % RIGHTWARDS TRIPLE ARROW - \leftsquidarrow \or % LEFTWARDS SQUIGGLE ARROW - \rightsquidarrow \or % RIGHTWARDS SQUIGGLE ARROW - \unknownchar \or % UPWARDS ARROW WITH DOUBLE STROKE - \unknownchar \or % DOWNWARDS ARROW WITH DOUBLE STROKE - \dashleftarrow \or % LEFTWARDS DASHED ARROW - \unknownchar \or % UPWARDS DASHED ARROW - \dashrightarrow \or % RIGHTWARDS DASHED ARROW - \unknownchar \or % DOWNWARDS DASHED ARROW - \unic@leftarrowtobar \or % LEFTWARDS ARROW TO BAR - \unknownchar \or % RIGHTWARDS ARROW TO BAR - \unknownchar \or % LEFTWARDS WHITE ARROW - \unknownchar \or % UPWARDS WHITE ARROW - \unknownchar \or % RIGHTWARDS WHITE ARROW - \unknownchar \or % DOWNWARDS WHITE ARROW - \unknownchar \or % UPWARDS WHITE ARROW FROM BAR - \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL - \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL WITH HORIZONTAL BAR - \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL WITH VERTICAL BAR - \unknownchar \or % UPWARDS WHITE DOUBLE ARROW - \unknownchar \or % UPWARDS WHITE DOUBLE ARROW ON PEDESTAL - \unknownchar \or % RIGHTWARDS WHITE ARROW FROM WALL - \unknownchar \or % NORTH WEST ARROW TO CORNER - \unknownchar \or % SOUTH EAST ARROW TO CORNER - \unknownchar \or % UP DOWN WHITE ARROW - \unknownchar \or % RIGHT ARROW WITH SMALL CIRCLE - \unknownchar \or % DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW - \unknownchar \or % THREE RIGHTWARDS ARROWS - \unknownchar \or % LEFTWARDS ARROW WITH VERTICAL STROKE - \unknownchar \or % RIGHTWARDS ARROW WITH VERTICAL STROKE - \unknownchar \or % LEFT RIGHT ARROW WITH VERTICAL STROKE - \unknownchar \or % LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE - \unknownchar \or % RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE - \unknownchar \or % LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE - \leftarrowtriangle \or % LEFTWARDS OPEN-HEADED ARROW - \rightarrowtriangle \or % RIGHTWARDS OPEN-HEADED ARROW - \leftrightarrowtriangle \else % LEFT RIGHT OPEN-HEADED ARROW - \unknowncharacter - \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-034.mkii b/tex/context/base/unic-034.mkii new file mode 100644 index 000000000..fece26bff --- /dev/null +++ b/tex/context/base/unic-034.mkii @@ -0,0 +1,274 @@ +%D \module +%D [ file=unic-034, +%D version=2005.06.11, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 34, +%D author=Nikolai Weibull, +%D date=\currentdate, +%D copyright={PRAGMA / Nikolai Weibull}] + +\unprotect + +\startunicodevector 34 + \expandafter\strippedcsname + \ifcase\numexpr#1\relax + \forall \or % FOR ALL + \complement \or % COMPLEMENT + \partial \or % PARTIAL DIFFERENTIAL + \exists \or % THERE EXISTS + \nexists \or % THERE DOES NOT EXIST + \emptyset \or % EMPTY SET + \vartriangle \or % INCREMENT + \nabla \or % NABLA + \unic@in \or % ELEMENT OF + \unic@nin \or % NOT AN ELEMENT OF + \unknownchar \or % SMALL ELEMENT OF + \ni \or % CONTAINS AS MEMBER + \unic@nni \or % DOES NOT CONTAIN AS MEMBER + \unknownchar \or % SMALL CONTAINS AS MEMBER + \QED \or % END OF PROOF + \prod \or % N-ARY PRODUCT + \coprod \or % N-ARY COPRODUCT + \sum \or % N-ARY SUMMATION + \unic@minus \or % MINUS SIGN + \mp \or % MINUS-OR-PLUS SIGN + \dotplus \or % DOT PLUS + \unic@divisionslash \or % DIVISION SLASH + \setminus \or % SET MINUS + \ast \or % ASTERISK OPERATOR + \circ \or % RING OPERATOR + \bullet \or % BULLET OPERATOR + \unic@sqrt \or % SQUARE ROOT + \unic@cubesqrt \or % CUBE ROOT + \unic@fourthsqrt \or % FOURTH ROOT + \propto \or % PROPORTIONAL TO + \infty \or % INFINITY + \unknownchar \or % RIGHT ANGLE + \angle \or % ANGLE + \measuredangle \or % MEASURED ANGLE + \sphericalangle \or % SPHERICAL ANGLE + \unic@divides \or % DIVIDES + \unic@ndivides \or % DOES NOT DIVIDE + \parallel \or % PARALLEL TO + \nparallel \or % NOT PARALLEL TO + \land \or % LOGICAL AND + \lor \or % LOGICAL OR + \unic@cap \or % INTERSECTION + \cup \or % UNION + \int \or % INTEGRAL + \unic@dblint \or % DOUBLE INTEGRAL + \unic@triint \or % TRIPLE INTEGRAL + \oint \or % CONTOUR INTEGRAL + \unknownchar \or % SURFACE INTEGRAL + \unknownchar \or % VOLUME INTEGRAL + \unknownchar \or % CLOCKWISE INTEGRAL + \unknownchar \or % CLOCKWISE CONTOUR INTEGRAL + \unknownchar \or % ANTICLOCKWISE CONTOUR INTEGRAL + \therefore \or % THEREFORE + \because \or % BECAUSE + \unic@ratio \or % RATIO + \unic@proportion \or % PROPORTION + \unknownchar \or % DOT MINUS + \unic@excess \or % EXCESS + \unic@geompropr \or % GEOMETRIC PROPORTION + \unic@homothetic \or % HOMOTHETIC + \sim \or % TILDE OPERATOR + \backsim \or % REVERSED TILDE + \unknownchar \or % INVERTED LAZY S + \unknownchar \or % SINE WAVE + \wr \or % WREATH PRODUCT + \nsim \or % NOT TILDE + \eqsim \or % MINUS TILDE + \simeq \or % ASYMPTOTICALLY EQUAL TO + \nsimeq \or % NOT ASYMPTOTICALLY EQUAL TO + \approxeq \or % APPROXIMATELY EQUAL TO + \unic@cong \or % APPROXIMATELY BUT NOT ACTUALLY EQUAL TO + \unic@napproxeq \or % NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO + \approx \or % ALMOST EQUAL TO + \unic@napprox \or % NOT ALMOST EQUAL TO + \approxeq \or % ALMOST EQUAL OR EQUAL TO + \unknownchar \or % TRIPLE TILDE + \unknownchar \or % ALL EQUAL TO + \asymp \or % EQUIVALENT TO + \Bumpeq \or % GEOMETRICALLY EQUIVALENT TO + \bumpeq \or % DIFFERENCE BETWEEN + \unic@doteq \or % APPROACHES THE LIMIT + \doteqdot \or % GEOMETRICALLY EQUAL TO + \fallingdotseq \or % APPROXIMATELY EQUAL TO OR THE IMAGE OF + \risingdotseq \or % IMAGE OF OR APPROXIMATELY EQUAL TO + \unknownchar \or % COLON EQUALS + \unknownchar \or % EQUALS COLON + \eqcirc \or % RING IN EQUAL TO + \circeq \or % RING EQUAL TO + \unic@correspondsto \or % CORRESPONDS TO + \unic@estimates \or % ESTIMATES + \unic@equiangularto \or % EQUIANGULAR TO + \unic@stareq \or % STAR EQUALS + \unic@triangleq \or % DELTA EQUAL TO + \unic@eqbydef \or % EQUAL TO BY DEFINITION + \unic@measuredby \or % MEASURED BY + \unic@questionedeq \or % QUESTIONED EQUAL TO + \neq \or % NOT EQUAL TO + \equiv \or % IDENTICAL TO + \unic@nequiv \or % NOT IDENTICAL TO + \unknownchar \or % STRICTLY EQUIVALENT TO + \leq \or % LESS-THAN OR EQUAL TO + \geq \or % GREATER-THAN OR EQUAL TO + \leqq \or % LESS-THAN OVER EQUAL TO + \geqq \or % GREATER-THAN OVER EQUAL TO + \lneqq \or % LESS-THAN BUT NOT EQUAL TO + \gneqq \or % GREATER-THAN BUT NOT EQUAL TO + \ll \or % MUCH LESS-THAN + \gg \or % MUCH GREATER-THAN + \between \or % BETWEEN + \nasymp \or % NOT EQUIVALENT TO + \nless \or % NOT LESS-THAN + \ngtr \or % NOT GREATER-THAN + \nleq \or % NEITHER LESS-THAN NOR EQUAL TO + \ngeq \or % NEITHER GREATER-THAN NOR EQUAL TO + \lesssim \or % LESS-THAN OR EQUIVALENT TO + \gtrsim \or % GREATER-THAN OR EQUIVALENT TO + \unic@nlesssim \or % NEITHER LESS-THAN NOR EQUIVALENT TO + \unic@ngtrsim \or % NEITHER GREATER-THAN NOR EQUIVALENT TO + \lessgtr \or % LESS-THAN OR GREATER-THAN + \gtrless \or % GREATER-THAN OR LESS-THAN + \unic@nlessgtr \or % NEITHER LESS-THAN NOR GREATER-THAN + \unic@ngtrless \or % NEITHER GREATER-THAN NOR LESS-THAN + \prec \or % PRECEDES + \succ \or % SUCCEEDS + \preceq \or % PRECEDES OR EQUAL TO + \succeq \or % SUCCEEDS OR EQUAL TO + \precsim \or % PRECEDES OR EQUIVALENT TO + \succsim \or % SUCCEEDS OR EQUIVALENT TO + \nprec \or % DOES NOT PRECEDE + \nsucc \or % DOES NOT SUCCEED + \subset \or % SUBSET OF + \supset \or % SUPERSET OF + \unic@nsubset \or % NOT A SUBSET OF + \unic@nsupset \or % NOT A SUPERSET OF + \subseteq \or % SUBSET OF OR EQUAL TO + \supseteq \or % SUPERSET OF OR EQUAL TO + \nsubseteq \or % NEITHER A SUBSET OF NOR EQUAL TO + \nsupseteq \or % NEITHER A SUPERSET OF NOR EQUAL TO + \subsetneq \or % SUBSET OF WITH NOT EQUAL TO + \supsetneq \or % SUPERSET OF WITH NOT EQUAL TO + \unknownchar \or % MULTISET + \unknownchar \or % MULTISET MULTIPLICATION + \biguplus \or % MULTISET UNION + \sqsubset \or % SQUARE IMAGE OF + \sqsupset \or % SQUARE ORIGINAL OF + \sqsubseteq \or % SQUARE IMAGE OF OR EQUAL TO + \sqsupseteq \or % SQUARE ORIGINAL OF OR EQUAL TO + \sqcap \or % SQUARE CAP + \sqcup \or % SQUARE CUP + \oplus \or % CIRCLED PLUS + \ominus \or % CIRCLED MINUS + \otimes \or % CIRCLED TIMES + \oslash \or % CIRCLED DIVISION SLASH + \odot \or % CIRCLED DOT OPERATOR + \circledcirc \or % CIRCLED RING OPERATOR + \circledast \or % CIRCLED ASTERISK OPERATOR + \unknownchar \or % CIRCLED EQUALS + \circleddash \or % CIRCLED DASH + \boxplus \or % SQUARED PLUS + \boxminus \or % SQUARED MINUS + \boxtimes \or % SQUARED TIMES + \boxdot \or % SQUARED DOT OPERATOR + \vdash \or % RIGHT TACK + \dashv \or % LEFT TACK + \top \or % DOWN TACK + \bot \or % UP TACK + \unknownchar \or % ASSERTION + \models \or % MODELS + \vDash \or % TRUE + \unknownchar \or % FORCES + \Vvdash \or % TRIPLE VERTICAL BAR RIGHT TURNSTILE + \unknownchar \or % DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE + \nvdash \or % DOES NOT PROVE + \nvDash \or % NOT TRUE + \unknownchar \or % DOES NOT FORCE + \unknownchar \or % NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE + \unknownchar \or % PRECEDES UNDER RELATION + \unknownchar \or % SUCCEEDS UNDER RELATION + \lhd \or % NORMAL SUBGROUP OF + \rhd \or % CONTAINS AS NORMAL SUBGROUP + \unlhd \or % NORMAL SUBGROUP OF OR EQUAL TO + \unrhd \or % CONTAINS AS NORMAL SUBGROUP OR EQUAL TO + \unknownchar \or % ORIGINAL OF + \unknownchar \or % IMAGE OF + \unknownchar \or % MULTIMAP + \unknownchar \or % HERMITIAN CONJUGATE MATRIX + \unknownchar \or % INTERCALATE + \veebar \or % XOR + \barwedge \or % NAND + \unknownchar \or % NOR + \unknownchar \or % RIGHT ANGLE WITH ARC + \unknownchar \or % RIGHT TRIANGLE + \bigwedge \or % N-ARY LOGICAL AND + \bigvee \or % N-ARY LOGICAL OR + \bigcap \or % N-ARY INTERSECTION + \bigcup \or % N-ARY UNION + \diamond \or % DIAMOND OPERATOR + \cdot \or % DOT OPERATOR + \star \or % STAR OPERATOR + \divideontimes \or % DIVISION TIMES + \bowtie \or % BOWTIE + \ltimes \or % LEFT NORMAL FACTOR SEMIDIRECT PRODUCT + \rtimes \or % RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT + \leftthreetimes \or % LEFT SEMIDIRECT PRODUCT + \rightthreetimes \or % RIGHT SEMIDIRECT PRODUCT + \backsimeq \or % REVERSED TILDE EQUALS + \unknownchar \or % CURLY LOGICAL OR + \unknownchar \or % CURLY LOGICAL AND + \Subset \or % DOUBLE SUBSET + \Supset \or % DOUBLE SUPERSET + \Cap \or % DOUBLE INTERSECTION + \Cup \or % DOUBLE UNION + \pitchfork \or % PITCHFORK + \unknownchar \or % EQUAL AND PARALLEL TO + \unknownchar \or % LESS-THAN WITH DOT + \unknownchar \or % GREATER-THAN WITH DOT + \lll \or % VERY MUCH LESS-THAN + \ggg \or % VERY MUCH GREATER-THAN + \lesseqgtr \or % LESS-THAN EQUAL TO OR GREATER-THAN + \gtreqless \or % GREATER-THAN EQUAL TO OR LESS-THAN + \unknownchar \or % EQUAL TO OR LESS-THAN + \unknownchar \or % EQUAL TO OR GREATER-THAN + \curlyeqprec \or % EQUAL TO OR PRECEDES + \curlyeqsucc \or % EQUAL TO OR SUCCEEDS + \npreceq \or % DOES NOT PRECEDE OR EQUAL + \nsucceq \or % DOES NOT SUCCEED OR EQUAL + \unic@nsqsubseteq \or % NOT SQUARE IMAGE OF OR EQUAL TO + \unic@nsqsupseteq \or % NOT SQUARE ORIGINAL OF OR EQUAL TO + \unknownchar \or % SQUARE IMAGE OF OR NOT EQUAL TO + \unknownchar \or % SQUARE ORIGINAL OF OR NOT EQUAL TO + \lnsim \or % LESS-THAN BUT NOT EQUIVALENT TO + \gnsim \or % GREATER-THAN BUT NOT EQUIVALENT TO + \precnsim \or % PRECEDES BUT NOT EQUIVALENT TO + \succnsim \or % SUCCEEDS BUT NOT EQUIVALENT TO + \ntriangleleft \or % NOT NORMAL SUBGROUP OF + \ntriangleright \or % DOES NOT CONTAIN AS NORMAL SUBGROUP + \ntrianglelefteq \or % NOT NORMAL SUBGROUP OF OR EQUAL TO + \ntrianglerighteq \or % DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL + \vdots \or % VERTICAL ELLIPSIS + \cdots \or % MIDLINE HORIZONTAL ELLIPSIS + \unknownchar \or % UP RIGHT DIAGONAL ELLIPSIS + \ddots \or % DOWN RIGHT DIAGONAL ELLIPSIS + \unknownchar \or % ELEMENT OF WITH LONG HORIZONTAL STROKE + \unknownchar \or % ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE + \unknownchar \or % SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE + \unknownchar \or % ELEMENT OF WITH DOT ABOVE + \unknownchar \or % ELEMENT OF WITH OVERBAR + \unknownchar \or % SMALL ELEMENT OF WITH OVERBAR + \unknownchar \or % ELEMENT OF WITH UNDERBAR + \unknownchar \or % ELEMENT OF WITH TWO HORIZONTAL STROKES + \unknownchar \or % CONTAINS WITH LONG HORIZONTAL STROKE + \unknownchar \or % CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE + \unknownchar \or % SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE + \unknownchar \or % CONTAINS WITH OVERBAR + \unknownchar \else % SMALL CONTAINS WITH OVERBAR + \unknownchar % Z NOTATION BAG MEMBERSHIP + \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-034.tex b/tex/context/base/unic-034.tex deleted file mode 100644 index fece26bff..000000000 --- a/tex/context/base/unic-034.tex +++ /dev/null @@ -1,274 +0,0 @@ -%D \module -%D [ file=unic-034, -%D version=2005.06.11, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 34, -%D author=Nikolai Weibull, -%D date=\currentdate, -%D copyright={PRAGMA / Nikolai Weibull}] - -\unprotect - -\startunicodevector 34 - \expandafter\strippedcsname - \ifcase\numexpr#1\relax - \forall \or % FOR ALL - \complement \or % COMPLEMENT - \partial \or % PARTIAL DIFFERENTIAL - \exists \or % THERE EXISTS - \nexists \or % THERE DOES NOT EXIST - \emptyset \or % EMPTY SET - \vartriangle \or % INCREMENT - \nabla \or % NABLA - \unic@in \or % ELEMENT OF - \unic@nin \or % NOT AN ELEMENT OF - \unknownchar \or % SMALL ELEMENT OF - \ni \or % CONTAINS AS MEMBER - \unic@nni \or % DOES NOT CONTAIN AS MEMBER - \unknownchar \or % SMALL CONTAINS AS MEMBER - \QED \or % END OF PROOF - \prod \or % N-ARY PRODUCT - \coprod \or % N-ARY COPRODUCT - \sum \or % N-ARY SUMMATION - \unic@minus \or % MINUS SIGN - \mp \or % MINUS-OR-PLUS SIGN - \dotplus \or % DOT PLUS - \unic@divisionslash \or % DIVISION SLASH - \setminus \or % SET MINUS - \ast \or % ASTERISK OPERATOR - \circ \or % RING OPERATOR - \bullet \or % BULLET OPERATOR - \unic@sqrt \or % SQUARE ROOT - \unic@cubesqrt \or % CUBE ROOT - \unic@fourthsqrt \or % FOURTH ROOT - \propto \or % PROPORTIONAL TO - \infty \or % INFINITY - \unknownchar \or % RIGHT ANGLE - \angle \or % ANGLE - \measuredangle \or % MEASURED ANGLE - \sphericalangle \or % SPHERICAL ANGLE - \unic@divides \or % DIVIDES - \unic@ndivides \or % DOES NOT DIVIDE - \parallel \or % PARALLEL TO - \nparallel \or % NOT PARALLEL TO - \land \or % LOGICAL AND - \lor \or % LOGICAL OR - \unic@cap \or % INTERSECTION - \cup \or % UNION - \int \or % INTEGRAL - \unic@dblint \or % DOUBLE INTEGRAL - \unic@triint \or % TRIPLE INTEGRAL - \oint \or % CONTOUR INTEGRAL - \unknownchar \or % SURFACE INTEGRAL - \unknownchar \or % VOLUME INTEGRAL - \unknownchar \or % CLOCKWISE INTEGRAL - \unknownchar \or % CLOCKWISE CONTOUR INTEGRAL - \unknownchar \or % ANTICLOCKWISE CONTOUR INTEGRAL - \therefore \or % THEREFORE - \because \or % BECAUSE - \unic@ratio \or % RATIO - \unic@proportion \or % PROPORTION - \unknownchar \or % DOT MINUS - \unic@excess \or % EXCESS - \unic@geompropr \or % GEOMETRIC PROPORTION - \unic@homothetic \or % HOMOTHETIC - \sim \or % TILDE OPERATOR - \backsim \or % REVERSED TILDE - \unknownchar \or % INVERTED LAZY S - \unknownchar \or % SINE WAVE - \wr \or % WREATH PRODUCT - \nsim \or % NOT TILDE - \eqsim \or % MINUS TILDE - \simeq \or % ASYMPTOTICALLY EQUAL TO - \nsimeq \or % NOT ASYMPTOTICALLY EQUAL TO - \approxeq \or % APPROXIMATELY EQUAL TO - \unic@cong \or % APPROXIMATELY BUT NOT ACTUALLY EQUAL TO - \unic@napproxeq \or % NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO - \approx \or % ALMOST EQUAL TO - \unic@napprox \or % NOT ALMOST EQUAL TO - \approxeq \or % ALMOST EQUAL OR EQUAL TO - \unknownchar \or % TRIPLE TILDE - \unknownchar \or % ALL EQUAL TO - \asymp \or % EQUIVALENT TO - \Bumpeq \or % GEOMETRICALLY EQUIVALENT TO - \bumpeq \or % DIFFERENCE BETWEEN - \unic@doteq \or % APPROACHES THE LIMIT - \doteqdot \or % GEOMETRICALLY EQUAL TO - \fallingdotseq \or % APPROXIMATELY EQUAL TO OR THE IMAGE OF - \risingdotseq \or % IMAGE OF OR APPROXIMATELY EQUAL TO - \unknownchar \or % COLON EQUALS - \unknownchar \or % EQUALS COLON - \eqcirc \or % RING IN EQUAL TO - \circeq \or % RING EQUAL TO - \unic@correspondsto \or % CORRESPONDS TO - \unic@estimates \or % ESTIMATES - \unic@equiangularto \or % EQUIANGULAR TO - \unic@stareq \or % STAR EQUALS - \unic@triangleq \or % DELTA EQUAL TO - \unic@eqbydef \or % EQUAL TO BY DEFINITION - \unic@measuredby \or % MEASURED BY - \unic@questionedeq \or % QUESTIONED EQUAL TO - \neq \or % NOT EQUAL TO - \equiv \or % IDENTICAL TO - \unic@nequiv \or % NOT IDENTICAL TO - \unknownchar \or % STRICTLY EQUIVALENT TO - \leq \or % LESS-THAN OR EQUAL TO - \geq \or % GREATER-THAN OR EQUAL TO - \leqq \or % LESS-THAN OVER EQUAL TO - \geqq \or % GREATER-THAN OVER EQUAL TO - \lneqq \or % LESS-THAN BUT NOT EQUAL TO - \gneqq \or % GREATER-THAN BUT NOT EQUAL TO - \ll \or % MUCH LESS-THAN - \gg \or % MUCH GREATER-THAN - \between \or % BETWEEN - \nasymp \or % NOT EQUIVALENT TO - \nless \or % NOT LESS-THAN - \ngtr \or % NOT GREATER-THAN - \nleq \or % NEITHER LESS-THAN NOR EQUAL TO - \ngeq \or % NEITHER GREATER-THAN NOR EQUAL TO - \lesssim \or % LESS-THAN OR EQUIVALENT TO - \gtrsim \or % GREATER-THAN OR EQUIVALENT TO - \unic@nlesssim \or % NEITHER LESS-THAN NOR EQUIVALENT TO - \unic@ngtrsim \or % NEITHER GREATER-THAN NOR EQUIVALENT TO - \lessgtr \or % LESS-THAN OR GREATER-THAN - \gtrless \or % GREATER-THAN OR LESS-THAN - \unic@nlessgtr \or % NEITHER LESS-THAN NOR GREATER-THAN - \unic@ngtrless \or % NEITHER GREATER-THAN NOR LESS-THAN - \prec \or % PRECEDES - \succ \or % SUCCEEDS - \preceq \or % PRECEDES OR EQUAL TO - \succeq \or % SUCCEEDS OR EQUAL TO - \precsim \or % PRECEDES OR EQUIVALENT TO - \succsim \or % SUCCEEDS OR EQUIVALENT TO - \nprec \or % DOES NOT PRECEDE - \nsucc \or % DOES NOT SUCCEED - \subset \or % SUBSET OF - \supset \or % SUPERSET OF - \unic@nsubset \or % NOT A SUBSET OF - \unic@nsupset \or % NOT A SUPERSET OF - \subseteq \or % SUBSET OF OR EQUAL TO - \supseteq \or % SUPERSET OF OR EQUAL TO - \nsubseteq \or % NEITHER A SUBSET OF NOR EQUAL TO - \nsupseteq \or % NEITHER A SUPERSET OF NOR EQUAL TO - \subsetneq \or % SUBSET OF WITH NOT EQUAL TO - \supsetneq \or % SUPERSET OF WITH NOT EQUAL TO - \unknownchar \or % MULTISET - \unknownchar \or % MULTISET MULTIPLICATION - \biguplus \or % MULTISET UNION - \sqsubset \or % SQUARE IMAGE OF - \sqsupset \or % SQUARE ORIGINAL OF - \sqsubseteq \or % SQUARE IMAGE OF OR EQUAL TO - \sqsupseteq \or % SQUARE ORIGINAL OF OR EQUAL TO - \sqcap \or % SQUARE CAP - \sqcup \or % SQUARE CUP - \oplus \or % CIRCLED PLUS - \ominus \or % CIRCLED MINUS - \otimes \or % CIRCLED TIMES - \oslash \or % CIRCLED DIVISION SLASH - \odot \or % CIRCLED DOT OPERATOR - \circledcirc \or % CIRCLED RING OPERATOR - \circledast \or % CIRCLED ASTERISK OPERATOR - \unknownchar \or % CIRCLED EQUALS - \circleddash \or % CIRCLED DASH - \boxplus \or % SQUARED PLUS - \boxminus \or % SQUARED MINUS - \boxtimes \or % SQUARED TIMES - \boxdot \or % SQUARED DOT OPERATOR - \vdash \or % RIGHT TACK - \dashv \or % LEFT TACK - \top \or % DOWN TACK - \bot \or % UP TACK - \unknownchar \or % ASSERTION - \models \or % MODELS - \vDash \or % TRUE - \unknownchar \or % FORCES - \Vvdash \or % TRIPLE VERTICAL BAR RIGHT TURNSTILE - \unknownchar \or % DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE - \nvdash \or % DOES NOT PROVE - \nvDash \or % NOT TRUE - \unknownchar \or % DOES NOT FORCE - \unknownchar \or % NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE - \unknownchar \or % PRECEDES UNDER RELATION - \unknownchar \or % SUCCEEDS UNDER RELATION - \lhd \or % NORMAL SUBGROUP OF - \rhd \or % CONTAINS AS NORMAL SUBGROUP - \unlhd \or % NORMAL SUBGROUP OF OR EQUAL TO - \unrhd \or % CONTAINS AS NORMAL SUBGROUP OR EQUAL TO - \unknownchar \or % ORIGINAL OF - \unknownchar \or % IMAGE OF - \unknownchar \or % MULTIMAP - \unknownchar \or % HERMITIAN CONJUGATE MATRIX - \unknownchar \or % INTERCALATE - \veebar \or % XOR - \barwedge \or % NAND - \unknownchar \or % NOR - \unknownchar \or % RIGHT ANGLE WITH ARC - \unknownchar \or % RIGHT TRIANGLE - \bigwedge \or % N-ARY LOGICAL AND - \bigvee \or % N-ARY LOGICAL OR - \bigcap \or % N-ARY INTERSECTION - \bigcup \or % N-ARY UNION - \diamond \or % DIAMOND OPERATOR - \cdot \or % DOT OPERATOR - \star \or % STAR OPERATOR - \divideontimes \or % DIVISION TIMES - \bowtie \or % BOWTIE - \ltimes \or % LEFT NORMAL FACTOR SEMIDIRECT PRODUCT - \rtimes \or % RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT - \leftthreetimes \or % LEFT SEMIDIRECT PRODUCT - \rightthreetimes \or % RIGHT SEMIDIRECT PRODUCT - \backsimeq \or % REVERSED TILDE EQUALS - \unknownchar \or % CURLY LOGICAL OR - \unknownchar \or % CURLY LOGICAL AND - \Subset \or % DOUBLE SUBSET - \Supset \or % DOUBLE SUPERSET - \Cap \or % DOUBLE INTERSECTION - \Cup \or % DOUBLE UNION - \pitchfork \or % PITCHFORK - \unknownchar \or % EQUAL AND PARALLEL TO - \unknownchar \or % LESS-THAN WITH DOT - \unknownchar \or % GREATER-THAN WITH DOT - \lll \or % VERY MUCH LESS-THAN - \ggg \or % VERY MUCH GREATER-THAN - \lesseqgtr \or % LESS-THAN EQUAL TO OR GREATER-THAN - \gtreqless \or % GREATER-THAN EQUAL TO OR LESS-THAN - \unknownchar \or % EQUAL TO OR LESS-THAN - \unknownchar \or % EQUAL TO OR GREATER-THAN - \curlyeqprec \or % EQUAL TO OR PRECEDES - \curlyeqsucc \or % EQUAL TO OR SUCCEEDS - \npreceq \or % DOES NOT PRECEDE OR EQUAL - \nsucceq \or % DOES NOT SUCCEED OR EQUAL - \unic@nsqsubseteq \or % NOT SQUARE IMAGE OF OR EQUAL TO - \unic@nsqsupseteq \or % NOT SQUARE ORIGINAL OF OR EQUAL TO - \unknownchar \or % SQUARE IMAGE OF OR NOT EQUAL TO - \unknownchar \or % SQUARE ORIGINAL OF OR NOT EQUAL TO - \lnsim \or % LESS-THAN BUT NOT EQUIVALENT TO - \gnsim \or % GREATER-THAN BUT NOT EQUIVALENT TO - \precnsim \or % PRECEDES BUT NOT EQUIVALENT TO - \succnsim \or % SUCCEEDS BUT NOT EQUIVALENT TO - \ntriangleleft \or % NOT NORMAL SUBGROUP OF - \ntriangleright \or % DOES NOT CONTAIN AS NORMAL SUBGROUP - \ntrianglelefteq \or % NOT NORMAL SUBGROUP OF OR EQUAL TO - \ntrianglerighteq \or % DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL - \vdots \or % VERTICAL ELLIPSIS - \cdots \or % MIDLINE HORIZONTAL ELLIPSIS - \unknownchar \or % UP RIGHT DIAGONAL ELLIPSIS - \ddots \or % DOWN RIGHT DIAGONAL ELLIPSIS - \unknownchar \or % ELEMENT OF WITH LONG HORIZONTAL STROKE - \unknownchar \or % ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE - \unknownchar \or % SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE - \unknownchar \or % ELEMENT OF WITH DOT ABOVE - \unknownchar \or % ELEMENT OF WITH OVERBAR - \unknownchar \or % SMALL ELEMENT OF WITH OVERBAR - \unknownchar \or % ELEMENT OF WITH UNDERBAR - \unknownchar \or % ELEMENT OF WITH TWO HORIZONTAL STROKES - \unknownchar \or % CONTAINS WITH LONG HORIZONTAL STROKE - \unknownchar \or % CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE - \unknownchar \or % SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE - \unknownchar \or % CONTAINS WITH OVERBAR - \unknownchar \else % SMALL CONTAINS WITH OVERBAR - \unknownchar % Z NOTATION BAG MEMBERSHIP - \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-035.mkii b/tex/context/base/unic-035.mkii new file mode 100644 index 000000000..272799512 --- /dev/null +++ b/tex/context/base/unic-035.mkii @@ -0,0 +1,32 @@ +%D \module +%D [ file=unic-035, +%D version=2009.05.25, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 35, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] + +\unprotect + +\startunicodevector 35 + \expandafter\strippedcsname + \ifcase\numexpr#1\relax + \varnothing \or % DIAMETER SIGN + \unknownchar \or % ELECTRIC ARROW + \unknownchar \or % HOUSE + \unknownchar \or % UP ARROWHEAD + \unknownchar \or % DOWN ARROWHEAD + \unknownchar \or % PROJECTIVE + \unknownchar \or % PERSPECTIVE + \unknownchar \or % WAVY LINE + \lceil \or % LEFT CEILING + \rceil \or % RIGHT CEILING + \lfloor \or % LEFT FLOOR + \rfloor \or % RIGHT FLOOR + \unknownchar \else + \unknownchar % + \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-035.tex b/tex/context/base/unic-035.tex deleted file mode 100644 index 272799512..000000000 --- a/tex/context/base/unic-035.tex +++ /dev/null @@ -1,32 +0,0 @@ -%D \module -%D [ file=unic-035, -%D version=2009.05.25, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 35, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] - -\unprotect - -\startunicodevector 35 - \expandafter\strippedcsname - \ifcase\numexpr#1\relax - \varnothing \or % DIAMETER SIGN - \unknownchar \or % ELECTRIC ARROW - \unknownchar \or % HOUSE - \unknownchar \or % UP ARROWHEAD - \unknownchar \or % DOWN ARROWHEAD - \unknownchar \or % PROJECTIVE - \unknownchar \or % PERSPECTIVE - \unknownchar \or % WAVY LINE - \lceil \or % LEFT CEILING - \rceil \or % RIGHT CEILING - \lfloor \or % LEFT FLOOR - \rfloor \or % RIGHT FLOOR - \unknownchar \else - \unknownchar % - \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-037.mkii b/tex/context/base/unic-037.mkii new file mode 100644 index 000000000..87f655a68 --- /dev/null +++ b/tex/context/base/unic-037.mkii @@ -0,0 +1,278 @@ +%D \module +%D [ file=unic-037, +%D version=2006.02.13, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 37, +%D author=Luigi Scarso, +%D date=\currentdate, +%D copyright={PRAGMA}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect + +\startunicodevector 37 + \expandafter\strippedcsname + \ifcase\numexpr #1+1\relax\or %% + \UnicodeLightHorizontal\or + \UnicodeHeavyHorizontal\or + \UnicodeLightVertical\or + \UnicodeHeavyVertical\or + \UnicodeLightTripleDashHorizontal\or + \UnicodeHeavyTripleDashHorizontal\or + \UnicodeLightTripleDashVertical\or + \UnicodeHeavyTripleDashVertical\or + \UnicodeLightQuadrupleDashHorizontal\or + \UnicodeHeavyQuadrupleDashHorizontal\or + \UnicodeLightQuadrupleDashVertical\or + \UnicodeHeavyQuadrupleDashVertical\or + \UnicodeLightDownAndRight\or + \UnicodeDownLightAndRightHeavy\or + \UnicodeDownHeavyAndRightLight\or + \UnicodeHeavyDownAndRight\or + \UnicodeLightDownAndLeft\or + \UnicodeDownLightAndLeftHeavy\or + \UnicodeDownHeavyAndLeftLight\or + \UnicodeHeavyDownAndLeft\or + \UnicodeLightUpAndRight\or + \UnicodeUpLightAndRightHeavy\or + \UnicodeUpHeavyAndRightLight\or + \UnicodeHeavyUpAndRight\or + \UnicodeLightUpAndLeft\or + \UnicodeUpLightAndLeftHeavy\or + \UnicodeUpHeavyAndLeftLight\or + \UnicodeHeavyUpAndLeft\or + \UnicodeLightVerticalAndRight\or + \UnicodeVerticalLightAndRightHeavy\or + \UnicodeUpHeavyAndRightDownLight\or + \UnicodeDownHeavyAndRightUpLight\or + \UnicodeVerticalHeavyAndRightLight\or + \UnicodeDownLightAndRightUpHeavy\or + \UnicodeUpLightAndRightDownHeavy\or + \UnicodeHeavyVerticalAndRight\or + \UnicodeLightVerticalAndLeft\or + \UnicodeVerticalLightAndLeftHeavy\or + \UnicodeUpHeavyAndLeftDownLight\or + \UnicodeDownHeavyAndLeftUpLight\or + \UnicodeVerticalHeavyAndLeftLight\or + \UnicodeDownLightAndLeftUpHeavy\or + \UnicodeUpLightAndLeftDownHeavy\or + \UnicodeHeavyVerticalAndLeft\or + \UnicodeLightDownAndHorizontal\or + \UnicodeLeftHeavyAndRightDownLight\or + \UnicodeRightHeavyAndLeftDownLight\or + \UnicodeDownLightAndHorizontalHeavy\or + \UnicodeDownHeavyAndHorizontalLight\or + \UnicodeRightLightAndLeftDownHeavy\or + \UnicodeLeftLightAndRightDownHeavy\or + \UnicodeHeavyDownAndHorizontal\or + \UnicodeLightUpAndHorizontal\or + \UnicodeLeftHeavyAndRightUpLight\or + \UnicodeRightHeavyAndLeftUpLight\or + \UnicodeUpLightAndHorizontalHeavy\or + \UnicodeUpHeavyAndHorizontalLight\or + \UnicodeRightLightAndLeftUpHeavy\or + \UnicodeLeftLightAndRightUpHeavy\or + \UnicodeHeavyUpAndHorizontal\or + \UnicodeLightVerticalAndHorizontal\or + \UnicodeLeftHeavyAndRightVerticalLight\or + \UnicodeRightHeavyAndLeftVerticalLight\or + \UnicodeVerticalLightAndHorizontalHeavy\or + \UnicodeUpHeavyAndDownHorizontalLight\or + \UnicodeDownHeavyAndUpHorizontalLight\or + \UnicodeVerticalHeavyAndHorizontalLight\or + \UnicodeLeftUpHeavyAndRightDownLight\or + \UnicodeRightUpHeavyAndLeftDownLight\or + \UnicodeLeftDownHeavyAndRightUpLight\or + \UnicodeRightDownHeavyAndLeftUpLight\or + \UnicodeDownLightAndUpHorizontalHeavy\or + \UnicodeUpLightAndDownHorizontalHeavy\or + \UnicodeRightLightAndLeftVerticalHeavy\or + \UnicodeLeftLightAndRightVerticalHeavy\or + \UnicodeHeavyVerticalAndHorizontal\or + \UnicodeLightDoubleDashHorizontal\or + \UnicodeHeavyDoubleDashHorizontal\or + \UnicodeLightDoubleDashVertical\or + \UnicodeHeavyDoubleDashVertical\or + \UnicodeDoubleHorizontal\or + \UnicodeDoubleVertical\or + \UnicodeDownSingleAndRightDouble\or + \UnicodeDownDoubleAndRightSingle\or + \UnicodeDoubleDownAndRight\or + \UnicodeDownSingleAndLeftDouble\or + \UnicodeDownDoubleAndLeftSingle\or + \UnicodeDoubleDownAndLeft\or + \UnicodeUpSingleAndRightDouble\or + \UnicodeUpDoubleAndRightSingle\or + \UnicodeDoubleUpAndRight\or + \UnicodeUpSingleAndLeftDouble\or + \UnicodeUpDoubleAndLeftSingle\or + \UnicodeDoubleUpAndLeft\or + \UnicodeVerticalSingleAndRightDouble\or + \UnicodeVerticalDoubleAndRightSingle\or + \UnicodeDoubleVerticalAndRight\or + \UnicodeVerticalSingleAndLeftDouble\or + \UnicodeVerticalDoubleAndLeftSingle\or + \UnicodeDoubleVerticalAndLeft\or + \UnicodeDownSingleAndHorizontalDouble\or + \UnicodeDownDoubleAndHorizontalSingle\or + \UnicodeDoubleDownAndHorizontal\or + \UnicodeUpSingleAndHorizontalDouble\or + \UnicodeUpDoubleAndHorizontalSingle\or + \UnicodeDoubleUpAndHorizontal\or + \UnicodeVerticalSingleAndHorizontalDouble\or + \UnicodeVerticalDoubleAndHorizontalSingle\or + \UnicodeDoubleVerticalAndHorizontal\or + \UnicodeLightArcDownAndRight\or + \UnicodeLightArcDownAndLeft\or + \UnicodeLightArcUpAndLeft\or + \UnicodeLightArcUpAndRight\or + \UnicodeLightDiagonalUpperRightToLowerLeft\or + \UnicodeLightDiagonalUpperLeftToLowerRight\or + \UnicodeLightDiagonalCross\or + \UnicodeLightLeft\or + \UnicodeLightUp\or + \UnicodeLightRight\or + \UnicodeLightDown\or + \UnicodeHeavyLeft\or + \UnicodeHeavyUp\or + \UnicodeHeavyRight\or + \UnicodeHeavyDown\or + \UnicodeLightLeftAndHeavyRight\or + \UnicodeLightUpAndHeavyDown\or + \UnicodeHeavyLeftAndLightRight\or + \UnicodeHeavyUpAndLightDown\or + \UnicodeUpperHalfBlock\or + \UnicodeLowerOneEighthBlock\or + \UnicodeLowerOneQuarterBlock\or + \UnicodeLowerThreeEighthsBlock\or + \UnicodeLowerHalfBlock\or + \UnicodeLowerFiveEighthsBlock\or + \UnicodeLowerThreeQuartersBlock\or + \UnicodeLowerSevenEighthsBlock\or + \UnicodeFullBlock\or + \UnicodeLeftSevenEighthsBlock\or + \UnicodeLeftThreeQuartersBlock\or + \UnicodeLeftFiveEighthsBlock\or + \UnicodeLeftHalfBlock\or + \UnicodeLeftThreeEighthsBlock\or + \UnicodeLeftOneQuarterBlock\or + \UnicodeLeftOneEighthBlock\or + \UnicodeRightHalfBlock\or + \UnicodeLightShade\or + \UnicodeMediumShade\or + \UnicodeDarkShade\or + \UnicodeUpperOneEighthBlock\or + \UnicodeRightOneEighthBlock\or + \UnicodeQuadrantLowerLeft\or + \UnicodeQuadrantLowerRight\or + \UnicodeQuadrantUpperLeft\or + \UnicodeQuadrantUpperLeftAndLowerLeftAndLowerRight\or + \UnicodeQuadrantUpperLeftAndLowerRight\or + \UnicodeQuadrantUpperLeftAndUpperRightandLowerLeft\or + \UnicodeQuadrantUpperLeftAndUpperRightAndLowerRight\or + \UnicodeQuadrantUpperRight\or + \UnicodeQuadrantUpperRightAndLowerLeft\or + \UnicodeQuadrantUpperRightAndLowerLeftAndLowerRight\or + \UnicodeBlackSquare\or + \UnicodeWhiteSquare\or + \UnicodeWhiteSquareWithRoundedCorners\or + \UnicodeWhiteSquareContainingBlackSmallSquare\or + \UnicodeSquareWithHorizontalFill\or + \UnicodeSquareWithVerticalFill\or + \UnicodeSquareWithOrthogonalCrosshatchFill\or + \UnicodeSquareWithUpperLeftToLowerRightFill\or + \UnicodeSquareWithUpperRightToLowerLeftFill\or + \UnicodeSquareWithDiagonalCrosshatchFill\or + \UnicodeBlackSmallSquare\or + \UnicodeWhiteSmallSquare\or + \UnicodeBlackRectangle\or + \UnicodeWhiteRectangle\or + \UnicodeBlackVerticalRectangle\or + \UnicodeWhiteVerticalRectangle\or + \UnicodeBlackParallelogram\or + \UnicodeWhiteParallelogram\or + \UnicodeBlackUpPointingTriangle\or + \UnicodeWhiteUpPointingTriangle\or + \UnicodeBlackUpPointingSmallTriangle\or + \UnicodeWhiteUpPointingSmallTriangle\or + \UnicodeBlackRightPointingTriangle\or + \UnicodeWhiteRightPointingTriangle\or + \UnicodeBlackRightPointingSmallTriangle\or + \UnicodeWhiteRightPointingSmallTriangle\or + \UnicodeBlackRightPointingPointer\or + \UnicodeWhiteRightPointingPointer\or + \UnicodeBlackDownPointingTriangle\or + \UnicodeWhiteDownPointingTriangle\or + \UnicodeBlackDownPointingSmallTriangle\or + \UnicodeWhiteDownPointingSmallTriangle\or + \UnicodeBlackLeftPointingTriangle\or + \UnicodeWhiteLeftPointingTriangle\or + \UnicodeBlackLeftPointingSmallTriangle\or + \UnicodeWhiteLeftPointingSmallTriangle\or + \UnicodeBlackLeftPointingPointer\or + \UnicodeWhiteLeftPointingPointer\or + \UnicodeBlackDiamond\or + \UnicodeWhiteDiamond\or + \UnicodeWhiteDiamondContainingBlackSmallDiamond\or + \UnicodeFisheye\or + \UnicodeLozenge\or + \UnicodeWhiteCircle\or + \UnicodeDottedCircle\or + \UnicodeCircleWithVerticalFill\or + \UnicodeBullseye\or + \UnicodeBlackCircle\or + \UnicodeCircleWithLeftHalfBlack\or + \UnicodeCircleWithRightHalfBlack\or + \UnicodeCircleWithLowerHalfBlack\or + \UnicodeCircleWithUpperHalfBlack\or + \UnicodeCircleWithUpperRightQuadrantBlack\or + \UnicodeCircleWithAllButUpperLeftQuadrantBlack\or + \UnicodeLeftHalfBlackCircle\or + \UnicodeRightHalfBlackCircle\or + \UnicodeInverseBullet\or + \UnicodeInverseWhiteCircle\or + \UnicodeUpperHalfInverseWhiteCircle\or + \UnicodeLowerHalfInverseWhiteCircle\or + \UnicodeUpperLeftQuadrantCircularArc\or + \UnicodeUpperRightQuadrantCircularArc\or + \UnicodeLowerRightQuadrantCircularArc\or + \UnicodeLowerLeftQuadrantCircularArc\or + \UnicodeUpperHalfCircle\or + \UnicodeLowerHalfCircle\or + \UnicodeBlackLowerRightTriangle\or + \UnicodeBlackLowerLeftTriangle\or + \UnicodeBlackUpperLeftTriangle\or + \UnicodeBlackUpperRightTriangle\or + \UnicodeWhiteBullet\or + \UnicodeSquareWithLeftHalfBlack\or + \UnicodeSquareWithRightHalfBlack\or + \UnicodeSquareWithUpperLeftDiagonalHalfBlack\or + \UnicodeSquareWithLowerRightDiagonalHalfBlack\or + \UnicodeWhiteSquareWithVerticalBisectingLine\or + \UnicodeWhiteUpPointingTriangleWithDot\or + \UnicodeUpPointingTriangleWithLeftHalfBlack\or + \UnicodeUpPointingTriangleWithRightHalfBlack\or + \UnicodeLargeCircle\or + \UnicodeWhiteSquareWithUpperLeftQuadrant\or + \UnicodeWhiteSquareWithLowerLeftQuadrant\or + \UnicodeWhiteSquareWithLowerRightQuadrant\or + \UnicodeWhiteSquareWithUpperRightQuadrant\or + \UnicodeWhiteCircleWithUpperLeftQuadrant\or + \UnicodeWhiteCircleWithLowerLeftQuadrant\or + \UnicodeWhiteCircleWithLowerRightQuadrant\or + \UnicodeWhiteCircleWithUpperRightQuadrant\or + \UnicodeUpperLeftTriangle\or + \UnicodeUpperRightTriangle\or + \UnicodeLowerLeftTriangle\or + \UnicodeWhiteMediumSquare\or + \UnicodeBlackMediumSquare\or + \UnicodeWhiteMediumSmallSquare\or + \UnicodeBlackMediumSmallSquare\or + \UnicodeLowerRightTriangle\else% + \unknownchar\fi +\stopunicodevector +\protect \endinput + diff --git a/tex/context/base/unic-037.tex b/tex/context/base/unic-037.tex deleted file mode 100644 index 87f655a68..000000000 --- a/tex/context/base/unic-037.tex +++ /dev/null @@ -1,278 +0,0 @@ -%D \module -%D [ file=unic-037, -%D version=2006.02.13, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 37, -%D author=Luigi Scarso, -%D date=\currentdate, -%D copyright={PRAGMA}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect - -\startunicodevector 37 - \expandafter\strippedcsname - \ifcase\numexpr #1+1\relax\or %% - \UnicodeLightHorizontal\or - \UnicodeHeavyHorizontal\or - \UnicodeLightVertical\or - \UnicodeHeavyVertical\or - \UnicodeLightTripleDashHorizontal\or - \UnicodeHeavyTripleDashHorizontal\or - \UnicodeLightTripleDashVertical\or - \UnicodeHeavyTripleDashVertical\or - \UnicodeLightQuadrupleDashHorizontal\or - \UnicodeHeavyQuadrupleDashHorizontal\or - \UnicodeLightQuadrupleDashVertical\or - \UnicodeHeavyQuadrupleDashVertical\or - \UnicodeLightDownAndRight\or - \UnicodeDownLightAndRightHeavy\or - \UnicodeDownHeavyAndRightLight\or - \UnicodeHeavyDownAndRight\or - \UnicodeLightDownAndLeft\or - \UnicodeDownLightAndLeftHeavy\or - \UnicodeDownHeavyAndLeftLight\or - \UnicodeHeavyDownAndLeft\or - \UnicodeLightUpAndRight\or - \UnicodeUpLightAndRightHeavy\or - \UnicodeUpHeavyAndRightLight\or - \UnicodeHeavyUpAndRight\or - \UnicodeLightUpAndLeft\or - \UnicodeUpLightAndLeftHeavy\or - \UnicodeUpHeavyAndLeftLight\or - \UnicodeHeavyUpAndLeft\or - \UnicodeLightVerticalAndRight\or - \UnicodeVerticalLightAndRightHeavy\or - \UnicodeUpHeavyAndRightDownLight\or - \UnicodeDownHeavyAndRightUpLight\or - \UnicodeVerticalHeavyAndRightLight\or - \UnicodeDownLightAndRightUpHeavy\or - \UnicodeUpLightAndRightDownHeavy\or - \UnicodeHeavyVerticalAndRight\or - \UnicodeLightVerticalAndLeft\or - \UnicodeVerticalLightAndLeftHeavy\or - \UnicodeUpHeavyAndLeftDownLight\or - \UnicodeDownHeavyAndLeftUpLight\or - \UnicodeVerticalHeavyAndLeftLight\or - \UnicodeDownLightAndLeftUpHeavy\or - \UnicodeUpLightAndLeftDownHeavy\or - \UnicodeHeavyVerticalAndLeft\or - \UnicodeLightDownAndHorizontal\or - \UnicodeLeftHeavyAndRightDownLight\or - \UnicodeRightHeavyAndLeftDownLight\or - \UnicodeDownLightAndHorizontalHeavy\or - \UnicodeDownHeavyAndHorizontalLight\or - \UnicodeRightLightAndLeftDownHeavy\or - \UnicodeLeftLightAndRightDownHeavy\or - \UnicodeHeavyDownAndHorizontal\or - \UnicodeLightUpAndHorizontal\or - \UnicodeLeftHeavyAndRightUpLight\or - \UnicodeRightHeavyAndLeftUpLight\or - \UnicodeUpLightAndHorizontalHeavy\or - \UnicodeUpHeavyAndHorizontalLight\or - \UnicodeRightLightAndLeftUpHeavy\or - \UnicodeLeftLightAndRightUpHeavy\or - \UnicodeHeavyUpAndHorizontal\or - \UnicodeLightVerticalAndHorizontal\or - \UnicodeLeftHeavyAndRightVerticalLight\or - \UnicodeRightHeavyAndLeftVerticalLight\or - \UnicodeVerticalLightAndHorizontalHeavy\or - \UnicodeUpHeavyAndDownHorizontalLight\or - \UnicodeDownHeavyAndUpHorizontalLight\or - \UnicodeVerticalHeavyAndHorizontalLight\or - \UnicodeLeftUpHeavyAndRightDownLight\or - \UnicodeRightUpHeavyAndLeftDownLight\or - \UnicodeLeftDownHeavyAndRightUpLight\or - \UnicodeRightDownHeavyAndLeftUpLight\or - \UnicodeDownLightAndUpHorizontalHeavy\or - \UnicodeUpLightAndDownHorizontalHeavy\or - \UnicodeRightLightAndLeftVerticalHeavy\or - \UnicodeLeftLightAndRightVerticalHeavy\or - \UnicodeHeavyVerticalAndHorizontal\or - \UnicodeLightDoubleDashHorizontal\or - \UnicodeHeavyDoubleDashHorizontal\or - \UnicodeLightDoubleDashVertical\or - \UnicodeHeavyDoubleDashVertical\or - \UnicodeDoubleHorizontal\or - \UnicodeDoubleVertical\or - \UnicodeDownSingleAndRightDouble\or - \UnicodeDownDoubleAndRightSingle\or - \UnicodeDoubleDownAndRight\or - \UnicodeDownSingleAndLeftDouble\or - \UnicodeDownDoubleAndLeftSingle\or - \UnicodeDoubleDownAndLeft\or - \UnicodeUpSingleAndRightDouble\or - \UnicodeUpDoubleAndRightSingle\or - \UnicodeDoubleUpAndRight\or - \UnicodeUpSingleAndLeftDouble\or - \UnicodeUpDoubleAndLeftSingle\or - \UnicodeDoubleUpAndLeft\or - \UnicodeVerticalSingleAndRightDouble\or - \UnicodeVerticalDoubleAndRightSingle\or - \UnicodeDoubleVerticalAndRight\or - \UnicodeVerticalSingleAndLeftDouble\or - \UnicodeVerticalDoubleAndLeftSingle\or - \UnicodeDoubleVerticalAndLeft\or - \UnicodeDownSingleAndHorizontalDouble\or - \UnicodeDownDoubleAndHorizontalSingle\or - \UnicodeDoubleDownAndHorizontal\or - \UnicodeUpSingleAndHorizontalDouble\or - \UnicodeUpDoubleAndHorizontalSingle\or - \UnicodeDoubleUpAndHorizontal\or - \UnicodeVerticalSingleAndHorizontalDouble\or - \UnicodeVerticalDoubleAndHorizontalSingle\or - \UnicodeDoubleVerticalAndHorizontal\or - \UnicodeLightArcDownAndRight\or - \UnicodeLightArcDownAndLeft\or - \UnicodeLightArcUpAndLeft\or - \UnicodeLightArcUpAndRight\or - \UnicodeLightDiagonalUpperRightToLowerLeft\or - \UnicodeLightDiagonalUpperLeftToLowerRight\or - \UnicodeLightDiagonalCross\or - \UnicodeLightLeft\or - \UnicodeLightUp\or - \UnicodeLightRight\or - \UnicodeLightDown\or - \UnicodeHeavyLeft\or - \UnicodeHeavyUp\or - \UnicodeHeavyRight\or - \UnicodeHeavyDown\or - \UnicodeLightLeftAndHeavyRight\or - \UnicodeLightUpAndHeavyDown\or - \UnicodeHeavyLeftAndLightRight\or - \UnicodeHeavyUpAndLightDown\or - \UnicodeUpperHalfBlock\or - \UnicodeLowerOneEighthBlock\or - \UnicodeLowerOneQuarterBlock\or - \UnicodeLowerThreeEighthsBlock\or - \UnicodeLowerHalfBlock\or - \UnicodeLowerFiveEighthsBlock\or - \UnicodeLowerThreeQuartersBlock\or - \UnicodeLowerSevenEighthsBlock\or - \UnicodeFullBlock\or - \UnicodeLeftSevenEighthsBlock\or - \UnicodeLeftThreeQuartersBlock\or - \UnicodeLeftFiveEighthsBlock\or - \UnicodeLeftHalfBlock\or - \UnicodeLeftThreeEighthsBlock\or - \UnicodeLeftOneQuarterBlock\or - \UnicodeLeftOneEighthBlock\or - \UnicodeRightHalfBlock\or - \UnicodeLightShade\or - \UnicodeMediumShade\or - \UnicodeDarkShade\or - \UnicodeUpperOneEighthBlock\or - \UnicodeRightOneEighthBlock\or - \UnicodeQuadrantLowerLeft\or - \UnicodeQuadrantLowerRight\or - \UnicodeQuadrantUpperLeft\or - \UnicodeQuadrantUpperLeftAndLowerLeftAndLowerRight\or - \UnicodeQuadrantUpperLeftAndLowerRight\or - \UnicodeQuadrantUpperLeftAndUpperRightandLowerLeft\or - \UnicodeQuadrantUpperLeftAndUpperRightAndLowerRight\or - \UnicodeQuadrantUpperRight\or - \UnicodeQuadrantUpperRightAndLowerLeft\or - \UnicodeQuadrantUpperRightAndLowerLeftAndLowerRight\or - \UnicodeBlackSquare\or - \UnicodeWhiteSquare\or - \UnicodeWhiteSquareWithRoundedCorners\or - \UnicodeWhiteSquareContainingBlackSmallSquare\or - \UnicodeSquareWithHorizontalFill\or - \UnicodeSquareWithVerticalFill\or - \UnicodeSquareWithOrthogonalCrosshatchFill\or - \UnicodeSquareWithUpperLeftToLowerRightFill\or - \UnicodeSquareWithUpperRightToLowerLeftFill\or - \UnicodeSquareWithDiagonalCrosshatchFill\or - \UnicodeBlackSmallSquare\or - \UnicodeWhiteSmallSquare\or - \UnicodeBlackRectangle\or - \UnicodeWhiteRectangle\or - \UnicodeBlackVerticalRectangle\or - \UnicodeWhiteVerticalRectangle\or - \UnicodeBlackParallelogram\or - \UnicodeWhiteParallelogram\or - \UnicodeBlackUpPointingTriangle\or - \UnicodeWhiteUpPointingTriangle\or - \UnicodeBlackUpPointingSmallTriangle\or - \UnicodeWhiteUpPointingSmallTriangle\or - \UnicodeBlackRightPointingTriangle\or - \UnicodeWhiteRightPointingTriangle\or - \UnicodeBlackRightPointingSmallTriangle\or - \UnicodeWhiteRightPointingSmallTriangle\or - \UnicodeBlackRightPointingPointer\or - \UnicodeWhiteRightPointingPointer\or - \UnicodeBlackDownPointingTriangle\or - \UnicodeWhiteDownPointingTriangle\or - \UnicodeBlackDownPointingSmallTriangle\or - \UnicodeWhiteDownPointingSmallTriangle\or - \UnicodeBlackLeftPointingTriangle\or - \UnicodeWhiteLeftPointingTriangle\or - \UnicodeBlackLeftPointingSmallTriangle\or - \UnicodeWhiteLeftPointingSmallTriangle\or - \UnicodeBlackLeftPointingPointer\or - \UnicodeWhiteLeftPointingPointer\or - \UnicodeBlackDiamond\or - \UnicodeWhiteDiamond\or - \UnicodeWhiteDiamondContainingBlackSmallDiamond\or - \UnicodeFisheye\or - \UnicodeLozenge\or - \UnicodeWhiteCircle\or - \UnicodeDottedCircle\or - \UnicodeCircleWithVerticalFill\or - \UnicodeBullseye\or - \UnicodeBlackCircle\or - \UnicodeCircleWithLeftHalfBlack\or - \UnicodeCircleWithRightHalfBlack\or - \UnicodeCircleWithLowerHalfBlack\or - \UnicodeCircleWithUpperHalfBlack\or - \UnicodeCircleWithUpperRightQuadrantBlack\or - \UnicodeCircleWithAllButUpperLeftQuadrantBlack\or - \UnicodeLeftHalfBlackCircle\or - \UnicodeRightHalfBlackCircle\or - \UnicodeInverseBullet\or - \UnicodeInverseWhiteCircle\or - \UnicodeUpperHalfInverseWhiteCircle\or - \UnicodeLowerHalfInverseWhiteCircle\or - \UnicodeUpperLeftQuadrantCircularArc\or - \UnicodeUpperRightQuadrantCircularArc\or - \UnicodeLowerRightQuadrantCircularArc\or - \UnicodeLowerLeftQuadrantCircularArc\or - \UnicodeUpperHalfCircle\or - \UnicodeLowerHalfCircle\or - \UnicodeBlackLowerRightTriangle\or - \UnicodeBlackLowerLeftTriangle\or - \UnicodeBlackUpperLeftTriangle\or - \UnicodeBlackUpperRightTriangle\or - \UnicodeWhiteBullet\or - \UnicodeSquareWithLeftHalfBlack\or - \UnicodeSquareWithRightHalfBlack\or - \UnicodeSquareWithUpperLeftDiagonalHalfBlack\or - \UnicodeSquareWithLowerRightDiagonalHalfBlack\or - \UnicodeWhiteSquareWithVerticalBisectingLine\or - \UnicodeWhiteUpPointingTriangleWithDot\or - \UnicodeUpPointingTriangleWithLeftHalfBlack\or - \UnicodeUpPointingTriangleWithRightHalfBlack\or - \UnicodeLargeCircle\or - \UnicodeWhiteSquareWithUpperLeftQuadrant\or - \UnicodeWhiteSquareWithLowerLeftQuadrant\or - \UnicodeWhiteSquareWithLowerRightQuadrant\or - \UnicodeWhiteSquareWithUpperRightQuadrant\or - \UnicodeWhiteCircleWithUpperLeftQuadrant\or - \UnicodeWhiteCircleWithLowerLeftQuadrant\or - \UnicodeWhiteCircleWithLowerRightQuadrant\or - \UnicodeWhiteCircleWithUpperRightQuadrant\or - \UnicodeUpperLeftTriangle\or - \UnicodeUpperRightTriangle\or - \UnicodeLowerLeftTriangle\or - \UnicodeWhiteMediumSquare\or - \UnicodeBlackMediumSquare\or - \UnicodeWhiteMediumSmallSquare\or - \UnicodeBlackMediumSmallSquare\or - \UnicodeLowerRightTriangle\else% - \unknownchar\fi -\stopunicodevector -\protect \endinput - diff --git a/tex/context/base/unic-039.mkii b/tex/context/base/unic-039.mkii new file mode 100644 index 000000000..bcf649090 --- /dev/null +++ b/tex/context/base/unic-039.mkii @@ -0,0 +1,68 @@ +%D \module +%D [ file=unic-039, +%D version=2005.06.16, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 39, +%D author=Nikolai Weibull, +%D date=\currentdate, +%D copyright={PRAGMA / Nikolai Weibull}] + +\unprotect + +\startunicodevector 39 + \expandafter\strippedcsname + \ifcase\numexpr#1-192\relax + \unknownchar \or % THREE DIMENSIONAL ANGLE + \unknownchar \or % WHITE TRIANGLE CONTAINING SMALL WHITE TRIANGLE + \perp \or % PERPENDICULAR + \unknownchar \or % OPEN SUBSET + \unknownchar \or % OPEN SUPERSET + \lbag \or % LEFT S-SHAPED BAG DELIMITER + \rbag \or % RIGHT S-SHAPED BAG DELIMITER + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % WHITE DIAMOND WITH CENTRED DOT + \unknownchar \or % AND WITH DOT + \unknownchar \or % ELEMENT OF OPENING UPWARDS + \unknownchar \or % LOWER RIGHT CORNER WITH DOT + \unknownchar \or % UPPER LEFT CORNER WITH DOT + \unknownchar \or % LEFT OUTER JOIN + \unknownchar \or % RIGHT OUTER JOIN + \unknownchar \or % FULL OUTER JOIN + \unknownchar \or % LARGE UP TACK + \unknownchar \or % LARGE DOWN TACK + \unknownchar \or % LEFT AND RIGHT DOUBLE TURNSTILE + \unknownchar \or % LEFT AND RIGHT TACK + \unknownchar \or % LEFT MULTIMAP + \unknownchar \or % LONG RIGHT TACK + \unknownchar \or % LONG LEFT TACK + \unknownchar \or % UP TACK WITH CIRCLE ABOVE + \unknownchar \or % LOZENGE DIVIDED BY HORIZONTAL RULE + \unknownchar \or % WHITE CONCAVE-SIDED DIAMOND + \unknownchar \or % WHITE CONCAVE-SIDED DIAMOND WITH LEFTWARDS TICK + \unknownchar \or % WHITE CONCAVE-SIDED DIAMOND WITH RIGHTWARDS TICK + \unknownchar \or % WHITE SQUARE WITH LEFTWARDS TICK + \unknownchar \or % WHITE SQUARE WITH RIGHTWARDS TICK + \unic@Lbracket \or % MATHEMATICAL LEFT WHITE SQUARE BRACKET + \unic@Rbracket \or % MATHEMATICAL RIGHT WHITE SQUARE BRACKET + \langle \or % MATHEMATICAL LEFT ANGLE BRACKET + \rangle \or % MATHEMATICAL RIGHT ANGLE BRACKET + \unic@Langle \or % MATHEMATICAL LEFT DOUBLE ANGLE BRACKET + \unic@Rangle \or % MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \or % + \unknownchar \else % + \unknownchar + \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-039.tex b/tex/context/base/unic-039.tex deleted file mode 100644 index bcf649090..000000000 --- a/tex/context/base/unic-039.tex +++ /dev/null @@ -1,68 +0,0 @@ -%D \module -%D [ file=unic-039, -%D version=2005.06.16, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 39, -%D author=Nikolai Weibull, -%D date=\currentdate, -%D copyright={PRAGMA / Nikolai Weibull}] - -\unprotect - -\startunicodevector 39 - \expandafter\strippedcsname - \ifcase\numexpr#1-192\relax - \unknownchar \or % THREE DIMENSIONAL ANGLE - \unknownchar \or % WHITE TRIANGLE CONTAINING SMALL WHITE TRIANGLE - \perp \or % PERPENDICULAR - \unknownchar \or % OPEN SUBSET - \unknownchar \or % OPEN SUPERSET - \lbag \or % LEFT S-SHAPED BAG DELIMITER - \rbag \or % RIGHT S-SHAPED BAG DELIMITER - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % WHITE DIAMOND WITH CENTRED DOT - \unknownchar \or % AND WITH DOT - \unknownchar \or % ELEMENT OF OPENING UPWARDS - \unknownchar \or % LOWER RIGHT CORNER WITH DOT - \unknownchar \or % UPPER LEFT CORNER WITH DOT - \unknownchar \or % LEFT OUTER JOIN - \unknownchar \or % RIGHT OUTER JOIN - \unknownchar \or % FULL OUTER JOIN - \unknownchar \or % LARGE UP TACK - \unknownchar \or % LARGE DOWN TACK - \unknownchar \or % LEFT AND RIGHT DOUBLE TURNSTILE - \unknownchar \or % LEFT AND RIGHT TACK - \unknownchar \or % LEFT MULTIMAP - \unknownchar \or % LONG RIGHT TACK - \unknownchar \or % LONG LEFT TACK - \unknownchar \or % UP TACK WITH CIRCLE ABOVE - \unknownchar \or % LOZENGE DIVIDED BY HORIZONTAL RULE - \unknownchar \or % WHITE CONCAVE-SIDED DIAMOND - \unknownchar \or % WHITE CONCAVE-SIDED DIAMOND WITH LEFTWARDS TICK - \unknownchar \or % WHITE CONCAVE-SIDED DIAMOND WITH RIGHTWARDS TICK - \unknownchar \or % WHITE SQUARE WITH LEFTWARDS TICK - \unknownchar \or % WHITE SQUARE WITH RIGHTWARDS TICK - \unic@Lbracket \or % MATHEMATICAL LEFT WHITE SQUARE BRACKET - \unic@Rbracket \or % MATHEMATICAL RIGHT WHITE SQUARE BRACKET - \langle \or % MATHEMATICAL LEFT ANGLE BRACKET - \rangle \or % MATHEMATICAL RIGHT ANGLE BRACKET - \unic@Langle \or % MATHEMATICAL LEFT DOUBLE ANGLE BRACKET - \unic@Rangle \or % MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \or % - \unknownchar \else % - \unknownchar - \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-251.mkii b/tex/context/base/unic-251.mkii new file mode 100644 index 000000000..150ade456 --- /dev/null +++ b/tex/context/base/unic-251.mkii @@ -0,0 +1,34 @@ +%D \module +%D [ file=unic-251, +%D version=2006.04.20, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=Vector 251, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] + +\unprotect + +\def\ffligature {ff} +\def\filigature {fi} +\def\flligature {fl} +\def\ffiligature {ffi} +\def\fflligature {ffl} +\def\ftligature {ft} +\def\stligature {st} + +\startunicodevector 251 + \expandafter\strippedcsname + \ifcase\numexpr#1\relax + \ffligature \or % LATIN SMALL LIGATURE FF + \filigature \or % LATIN SMALL LIGATURE FI + \flligature \or % LATIN SMALL LIGATURE FL + \ffiligature \or % LATIN SMALL LIGATURE FFI + \fflligature \or % LATIN SMALL LIGATURE FFL + \ftligature \or % LATIN SMALL LIGATURE FT + \stligature \else % LATIN SMALL LIGATURE ST + \unknownchar + \fi +\stopunicodevector + +\protect \endinput diff --git a/tex/context/base/unic-251.tex b/tex/context/base/unic-251.tex deleted file mode 100644 index 150ade456..000000000 --- a/tex/context/base/unic-251.tex +++ /dev/null @@ -1,34 +0,0 @@ -%D \module -%D [ file=unic-251, -%D version=2006.04.20, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=Vector 251, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] - -\unprotect - -\def\ffligature {ff} -\def\filigature {fi} -\def\flligature {fl} -\def\ffiligature {ffi} -\def\fflligature {ffl} -\def\ftligature {ft} -\def\stligature {st} - -\startunicodevector 251 - \expandafter\strippedcsname - \ifcase\numexpr#1\relax - \ffligature \or % LATIN SMALL LIGATURE FF - \filigature \or % LATIN SMALL LIGATURE FI - \flligature \or % LATIN SMALL LIGATURE FL - \ffiligature \or % LATIN SMALL LIGATURE FFI - \fflligature \or % LATIN SMALL LIGATURE FFL - \ftligature \or % LATIN SMALL LIGATURE FT - \stligature \else % LATIN SMALL LIGATURE ST - \unknownchar - \fi -\stopunicodevector - -\protect \endinput diff --git a/tex/context/base/unic-cjk.mkii b/tex/context/base/unic-cjk.mkii new file mode 100644 index 000000000..786546318 --- /dev/null +++ b/tex/context/base/unic-cjk.mkii @@ -0,0 +1,22 @@ +%D \module +%D [ file=unic-cjk, +%D version=2005.12.14, +%D title=\CONTEXT\ \UNICODE\ Macros, +%D subtitle=CJK Vectors, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\dostepwiserecurse {40}{159}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}} +\dostepwiserecurse{172}{215}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}} +\dostepwiserecurse{249}{250}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}} + +% special chars + +\dostepwiserecurse{255}{255}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}} + +\endinput diff --git a/tex/context/base/unic-cjk.tex b/tex/context/base/unic-cjk.tex deleted file mode 100644 index 786546318..000000000 --- a/tex/context/base/unic-cjk.tex +++ /dev/null @@ -1,22 +0,0 @@ -%D \module -%D [ file=unic-cjk, -%D version=2005.12.14, -%D title=\CONTEXT\ \UNICODE\ Macros, -%D subtitle=CJK Vectors, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\dostepwiserecurse {40}{159}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}} -\dostepwiserecurse{172}{215}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}} -\dostepwiserecurse{249}{250}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}} - -% special chars - -\dostepwiserecurse{255}{255}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}} - -\endinput diff --git a/tex/context/base/unic-exp.mkii b/tex/context/base/unic-exp.mkii new file mode 100644 index 000000000..027aedab8 --- /dev/null +++ b/tex/context/base/unic-exp.mkii @@ -0,0 +1,82 @@ +%D \module +%D [ file=unic-exp, +%D version=2002.12.05, +%D title=\CONTEXT\ \UNICODE\ Support, +%D subtitle=Expansion, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Unicode Support / Expansion)} + +%D \macros +%D {expandunivector} +%D +%D The \type {\expandunivector} macro can be used to expand +%D vectors, which leads to a faster run in case of documents +%D with lots of \UTF-8 code. + +\unprotect + +\def\expandunivector[#1]% + {\processcommalist[#1]\doexpandunivector} + +\def\doexpandunivector#1% + {\ifcsname\@@univector#1\endcsname + \ifcsname\@@univector\@@univector#1\endcsname\else + \writestatus{unicode}{expanding vector #1}% + \setvalue{\@@univector\@@univector#1}{\expandedunivector{#1}}% + \dorecurse{255} + {\@EA\ifx\csname\csname\@@univector#1\endcsname\recurselevel\endcsname\unknownchar + % skip + \else + \@EA\let\csname\@@univector\@@univector#1:\recurselevel\@EA\endcsname + \csname\csname\@@univector#1\endcsname\recurselevel\endcsname + \fi}% + \letbeundefined{\@@univector#1}% + \fi + \fi} + +\def\expandedunivector#1#2% + {\ifcsname\@@univector\@@univector#1:\number#2\endcsname + \@@univector\@@univector#1:\number#2% + \else + \@@unknownchar + \fi} + +%D For this purpose, we need to redefine the resolver. + +\def\doutfunihash#1#2% + {\csname \@@univector + \ifcsname\@@univector\@@univector#1\endcsname \@@univector#1\else + \ifcsname\@@univector #1\endcsname #1\else + \s!unknown\fi\fi + \endcsname{\utfmod{#2}}} + +\setvalue{\@@univector\s!unknown}#1% + {\@@unknownchar} + +\def\doutfunihashglyph#1#2#3% div mod raw + {\csname utf!\ifnum#3<\utf@i1\else + \ifcsname\@@unicommand#1\endcsname2\else + \ifcsname\@@univector\@@univector#1\endcsname3\else + \ifcsname\@@univector #1\endcsname4\else + 5\fi\fi\fi\fi !\endcsname{#1}{#2}} + +\setvalue{utf!1!}#1{\unicodeasciicharacter} % {#2} +\setvalue{utf!2!}#1{\csname\@@unicommand#1\endcsname} % {#2} +\setvalue{utf!3!}#1#2{\csname\csname\@@univector\@@univector#1\endcsname{#2}\endcsname} % watch the nested csname; it's a speed up +\setvalue{utf!4!}#1#2{\csname\csname\@@univector#1\endcsname{#2}\endcsname} % watch the nested csname; it's a speed up +\setvalue{utf!5!}#1#2{\unicodeunknowncharacter} + +% \let\utfunihash\utfunihashglyph + +%D Let's use it: + +\expandunivector[0,1,2,3,4,5,30,31,32,33,34,37,39] + +\protect \endinput diff --git a/tex/context/base/unic-exp.tex b/tex/context/base/unic-exp.tex deleted file mode 100644 index 027aedab8..000000000 --- a/tex/context/base/unic-exp.tex +++ /dev/null @@ -1,82 +0,0 @@ -%D \module -%D [ file=unic-exp, -%D version=2002.12.05, -%D title=\CONTEXT\ \UNICODE\ Support, -%D subtitle=Expansion, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Unicode Support / Expansion)} - -%D \macros -%D {expandunivector} -%D -%D The \type {\expandunivector} macro can be used to expand -%D vectors, which leads to a faster run in case of documents -%D with lots of \UTF-8 code. - -\unprotect - -\def\expandunivector[#1]% - {\processcommalist[#1]\doexpandunivector} - -\def\doexpandunivector#1% - {\ifcsname\@@univector#1\endcsname - \ifcsname\@@univector\@@univector#1\endcsname\else - \writestatus{unicode}{expanding vector #1}% - \setvalue{\@@univector\@@univector#1}{\expandedunivector{#1}}% - \dorecurse{255} - {\@EA\ifx\csname\csname\@@univector#1\endcsname\recurselevel\endcsname\unknownchar - % skip - \else - \@EA\let\csname\@@univector\@@univector#1:\recurselevel\@EA\endcsname - \csname\csname\@@univector#1\endcsname\recurselevel\endcsname - \fi}% - \letbeundefined{\@@univector#1}% - \fi - \fi} - -\def\expandedunivector#1#2% - {\ifcsname\@@univector\@@univector#1:\number#2\endcsname - \@@univector\@@univector#1:\number#2% - \else - \@@unknownchar - \fi} - -%D For this purpose, we need to redefine the resolver. - -\def\doutfunihash#1#2% - {\csname \@@univector - \ifcsname\@@univector\@@univector#1\endcsname \@@univector#1\else - \ifcsname\@@univector #1\endcsname #1\else - \s!unknown\fi\fi - \endcsname{\utfmod{#2}}} - -\setvalue{\@@univector\s!unknown}#1% - {\@@unknownchar} - -\def\doutfunihashglyph#1#2#3% div mod raw - {\csname utf!\ifnum#3<\utf@i1\else - \ifcsname\@@unicommand#1\endcsname2\else - \ifcsname\@@univector\@@univector#1\endcsname3\else - \ifcsname\@@univector #1\endcsname4\else - 5\fi\fi\fi\fi !\endcsname{#1}{#2}} - -\setvalue{utf!1!}#1{\unicodeasciicharacter} % {#2} -\setvalue{utf!2!}#1{\csname\@@unicommand#1\endcsname} % {#2} -\setvalue{utf!3!}#1#2{\csname\csname\@@univector\@@univector#1\endcsname{#2}\endcsname} % watch the nested csname; it's a speed up -\setvalue{utf!4!}#1#2{\csname\csname\@@univector#1\endcsname{#2}\endcsname} % watch the nested csname; it's a speed up -\setvalue{utf!5!}#1#2{\unicodeunknowncharacter} - -% \let\utfunihash\utfunihashglyph - -%D Let's use it: - -\expandunivector[0,1,2,3,4,5,30,31,32,33,34,37,39] - -\protect \endinput diff --git a/tex/context/base/unic-ini.mkii b/tex/context/base/unic-ini.mkii index 0e4d9d391..f386494f2 100644 --- a/tex/context/base/unic-ini.mkii +++ b/tex/context/base/unic-ini.mkii @@ -533,7 +533,7 @@ \def\douseunicodevector#1% {\ifundefined{\@@univector#1}% % \readsysfile{\f!unicprefix\threedigits{#1}} - \readsysfile{\f!unicprefix\doifnumberelse{#1}{\threedigits{#1}}{#1}} + \readsysfile{\f!unicprefix\doifnumberelse{#1}{\threedigits{#1}}{#1}.mkii} {\writestatus{unicode}{loading vector #1}} {\writestatus{unicode}{unknown vector #1}}% \fi} @@ -761,8 +761,8 @@ %D Goodies: -\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run} -\fetchruntimecommand \showunicodetable {\f!unicprefix\s!run} +\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run.mkii} +\fetchruntimecommand \showunicodetable {\f!unicprefix\s!run.mkii} %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/unic-run.mkii b/tex/context/base/unic-run.mkii new file mode 100644 index 000000000..b8e154fd4 --- /dev/null +++ b/tex/context/base/unic-run.mkii @@ -0,0 +1,130 @@ +%D \module +%D [ file=unic-run, +%D version=2005.06.22, +%D title=\CONTEXT\ \UNICODE\ Support, +%D subtitle=Goodies, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 \macros +%D {showunicodevector} +%D +%D Original version by Nikolai Weibull. Adapted a bit (no local count +%D definitions, stepwiserecurse instead of -1 calculations, a bit less +%D code and such). BTW, this is kind of tricky and somehow we don't +%D have align interference. + +\gdef\doshowunicodevectorrow#1#2% + {\NC + \ttx\uchexnumber{#2}% + \VL + \dostepwiserecurse{0}{15}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}% + \AR} + +\gdef\showunicodevector[#1]% + {\starttable[|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|] + \NC\NC\dostepwiserecurse{0}{15}{1}{\ttx\uchexnumber\recurselevel\NC}\AR + \DC\DL[16]\DR + \dostepwiserecurse{0}{15}{1} + {\expanded{\doshowunicodevectorrow{#1}{\recurselevel}}% + \DC\DL[16]\DR} + \NC \use{17}{\hfill \ttx unicode table hex:\uchexnumbers{#1} dec:\threedigits{#1}\kern-.25em}\NC \AR + \stoptable} + +%D \starttyping +%D \chardef\utfunicodetracer=0 +%D \chardef\utfunicodetracer=7 +%D +%D \showunicodevector[000] +%D \showunicodevector[001] +%D \showunicodevector[002] +%D \showunicodevector[003] +%D \showunicodevector[004] +%D \showunicodevector[005] +%D \showunicodevector[030] +%D \showunicodevector[031] +%D \showunicodevector[032] +%D \showunicodevector[033] +%D \showunicodevector[034] +%D \stoptyping + +%D \macros +%D {showunicodetable} +%D +%D A more verbose variant: + +\gdef\doshowunicodetablerow#1#2% + {\bTR + \bTD\uchexnumber{#2}\eTD + \dostepwiserecurse{0}{15}{1} + {\bTD + \edef\entrypoint{\the\numexpr#1*256+#2+##1*16\relax}% + \chardef\utfunicodetracer0{\dontleavehmode \strut\unicodechar\entrypoint\endgraf}% + \tt + \chardef\utfunicodetracer7{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}% + \chardef\utfunicodetracer3{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}% + \chardef\utfunicodetracer8{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}% + \eTD}% + \bTD\uchexnumber{#2}\eTD + \eTR} + +\gdef\showunicodetable[#1]% + {\vbox\bgroup + \setupcolors[\c!state=\v!start]% + \setupTABLE[\c!background=\v!screen,\c!backgroundscreen=.90,\c!frame=\v!off,\c!frameoffset=0pt,\c!width=8em,\c!height=6em]% + \setupTABLE[c] [\v!each] [\c!align={middle,lohi}]% + \setupTABLE[c] [\v!first][\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]% + \setupTABLE[c] [\v!last] [\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]% + \setupTABLE[r] [\v!first][\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]% + \setupTABLE[r] [\v!last] [\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]% + \setupTABLE[r] [\v!odd] [\c!background=\v!screen,\c!backgroundscreen=.80]% + \setupTABLE[c] [\v!odd] [\c!background=\v!screen,\c!backgroundscreen=.80]% + \setupTABLE[\v!odd][\v!odd] [\c!background=\v!screen,\c!backgroundscreen=.90]% + \bTABLE + \bTR + \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD + \dostepwiserecurse{0}{15}{1}{\bTD\uchexnumber{##1}\eTD}% + \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD + \eTR + \dostepwiserecurse{0}{15}{1}{\doshowunicodetablerow{#1}{##1}}% + \bTR + \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD + \dostepwiserecurse{0}{15}{1}{\bTD\uchexnumber{##1}\eTD}% + \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD + \eTR + \eTABLE + \egroup} + +\protect \endinput + +% alternative +% +% \gdef\doshowunicodevectorrowa#1#2#3#4% +% {\NC +% \ttx\uchexnumber{#2}% +% \VL +% \dostepwiserecurse{#3}{#4}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}% +% \AR} +% +% \gdef\doshowunicodevectorrowb#1#2#3#4% +% {\NC +% \relax +% \VL +% \dostepwiserecurse{#3}{#4}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}% +% \AR} +% +% \gdef\showunicodevector#1% +% {\starttable[|c|c|c|c|c|c|c|c|c|] +% \NC\NC\dostepwiserecurse{0}{7}{1}{\ttx\uchexnumber\recurselevel/\uchexnumber{\the\numexpr2*\recurselevel\relax}\NC}\AR\DC\DL[8]\DR +% \dostepwiserecurse{0}{15}{1} +% {\expanded{\doshowunicodevectorrowa{#1}{\recurselevel}{0} {7}}\DC\DL[8]\DR% +% \expanded{\doshowunicodevectorrowb{#1}{\recurselevel}{8}{15}}\DC\DL[8]\DR}% +% \NC \use{9}{\hfill \ttx unicode table hex:\uchexnumbers{#1} dec:\threedigits{#1}\kern-.25em}\NC \AR +% \stoptable} diff --git a/tex/context/base/unic-run.tex b/tex/context/base/unic-run.tex deleted file mode 100644 index b8e154fd4..000000000 --- a/tex/context/base/unic-run.tex +++ /dev/null @@ -1,130 +0,0 @@ -%D \module -%D [ file=unic-run, -%D version=2005.06.22, -%D title=\CONTEXT\ \UNICODE\ Support, -%D subtitle=Goodies, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 \macros -%D {showunicodevector} -%D -%D Original version by Nikolai Weibull. Adapted a bit (no local count -%D definitions, stepwiserecurse instead of -1 calculations, a bit less -%D code and such). BTW, this is kind of tricky and somehow we don't -%D have align interference. - -\gdef\doshowunicodevectorrow#1#2% - {\NC - \ttx\uchexnumber{#2}% - \VL - \dostepwiserecurse{0}{15}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}% - \AR} - -\gdef\showunicodevector[#1]% - {\starttable[|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|] - \NC\NC\dostepwiserecurse{0}{15}{1}{\ttx\uchexnumber\recurselevel\NC}\AR - \DC\DL[16]\DR - \dostepwiserecurse{0}{15}{1} - {\expanded{\doshowunicodevectorrow{#1}{\recurselevel}}% - \DC\DL[16]\DR} - \NC \use{17}{\hfill \ttx unicode table hex:\uchexnumbers{#1} dec:\threedigits{#1}\kern-.25em}\NC \AR - \stoptable} - -%D \starttyping -%D \chardef\utfunicodetracer=0 -%D \chardef\utfunicodetracer=7 -%D -%D \showunicodevector[000] -%D \showunicodevector[001] -%D \showunicodevector[002] -%D \showunicodevector[003] -%D \showunicodevector[004] -%D \showunicodevector[005] -%D \showunicodevector[030] -%D \showunicodevector[031] -%D \showunicodevector[032] -%D \showunicodevector[033] -%D \showunicodevector[034] -%D \stoptyping - -%D \macros -%D {showunicodetable} -%D -%D A more verbose variant: - -\gdef\doshowunicodetablerow#1#2% - {\bTR - \bTD\uchexnumber{#2}\eTD - \dostepwiserecurse{0}{15}{1} - {\bTD - \edef\entrypoint{\the\numexpr#1*256+#2+##1*16\relax}% - \chardef\utfunicodetracer0{\dontleavehmode \strut\unicodechar\entrypoint\endgraf}% - \tt - \chardef\utfunicodetracer7{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}% - \chardef\utfunicodetracer3{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}% - \chardef\utfunicodetracer8{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}% - \eTD}% - \bTD\uchexnumber{#2}\eTD - \eTR} - -\gdef\showunicodetable[#1]% - {\vbox\bgroup - \setupcolors[\c!state=\v!start]% - \setupTABLE[\c!background=\v!screen,\c!backgroundscreen=.90,\c!frame=\v!off,\c!frameoffset=0pt,\c!width=8em,\c!height=6em]% - \setupTABLE[c] [\v!each] [\c!align={middle,lohi}]% - \setupTABLE[c] [\v!first][\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]% - \setupTABLE[c] [\v!last] [\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]% - \setupTABLE[r] [\v!first][\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]% - \setupTABLE[r] [\v!last] [\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]% - \setupTABLE[r] [\v!odd] [\c!background=\v!screen,\c!backgroundscreen=.80]% - \setupTABLE[c] [\v!odd] [\c!background=\v!screen,\c!backgroundscreen=.80]% - \setupTABLE[\v!odd][\v!odd] [\c!background=\v!screen,\c!backgroundscreen=.90]% - \bTABLE - \bTR - \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD - \dostepwiserecurse{0}{15}{1}{\bTD\uchexnumber{##1}\eTD}% - \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD - \eTR - \dostepwiserecurse{0}{15}{1}{\doshowunicodetablerow{#1}{##1}}% - \bTR - \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD - \dostepwiserecurse{0}{15}{1}{\bTD\uchexnumber{##1}\eTD}% - \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD - \eTR - \eTABLE - \egroup} - -\protect \endinput - -% alternative -% -% \gdef\doshowunicodevectorrowa#1#2#3#4% -% {\NC -% \ttx\uchexnumber{#2}% -% \VL -% \dostepwiserecurse{#3}{#4}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}% -% \AR} -% -% \gdef\doshowunicodevectorrowb#1#2#3#4% -% {\NC -% \relax -% \VL -% \dostepwiserecurse{#3}{#4}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}% -% \AR} -% -% \gdef\showunicodevector#1% -% {\starttable[|c|c|c|c|c|c|c|c|c|] -% \NC\NC\dostepwiserecurse{0}{7}{1}{\ttx\uchexnumber\recurselevel/\uchexnumber{\the\numexpr2*\recurselevel\relax}\NC}\AR\DC\DL[8]\DR -% \dostepwiserecurse{0}{15}{1} -% {\expanded{\doshowunicodevectorrowa{#1}{\recurselevel}{0} {7}}\DC\DL[8]\DR% -% \expanded{\doshowunicodevectorrowb{#1}{\recurselevel}{8}{15}}\DC\DL[8]\DR}% -% \NC \use{9}{\hfill \ttx unicode table hex:\uchexnumbers{#1} dec:\threedigits{#1}\kern-.25em}\NC \AR -% \stoptable} diff --git a/tex/context/base/verb-c.mkii b/tex/context/base/verb-c.mkii new file mode 100644 index 000000000..1ecb0afc2 --- /dev/null +++ b/tex/context/base/verb-c.mkii @@ -0,0 +1,484 @@ +%D \module +%D [ file=verb-c, +%D version=2006.04.17, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty C Verbatim, +%D author=Nikolai Weibull, +%D date=\currentdate, +%D copyright={PRAGMA ADE}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Verbatim Macros / Pretty C Verbatim} + +% HH: +% +% - extra !!pretty definitions moved to verb-ini +% - added a c! +% - did a few small cosmetic things + +\unprotect + +\doglobal\newif\ifinCsingle +\doglobal\newif\ifinCdouble +\doglobal\newif\ifinCcomment +\doglobal\newif\ifinCsinglelinecomment +\doglobal\newif\ifinCmultilinecomment +\doglobal\newif\ifcontinueCsinglelinecomment + +\gdef\Csetcontrols + {\saveprettycontrols + \def\obeyedspace + {\endCtypesix + \oldobeyedspace}% + \def\flushrestofverbatimline + {\endCtypesix + \ifinCsinglelinecomment + \ifcontinueCsinglelinecomment + \continueCsinglelinecommentfalse + \else + \tttf + \endofpretty + \global\inCsinglelinecommentfalse + \global\inCcommentfalse + \fi + \fi}% + \def\obeyedline + {\oldobeyedline}% + \let\obeytabs\ignoretabs} + +\gdef\setupprettyCtype + {\def\prettyidentifier{C}% + \Csetvariables + \Csetcontrols + \Csethandlers + \Csetspecials + \Csetdiagnostics} + +\gdef\Csetvariables + {\global\inCsinglefalse + \global\inCdoublefalse + \global\inCcommentfalse + \global\continueCsinglelinecommentfalse + \global\naturaltextexttrue + \global\let\Csequence\empty + \global\let\Cprefix\empty} + +% TODO: should handle -> as well + +\gdef\Csetspecials + {\setpretty`\{=10 \setpretty`\}=10 + \setpretty`\$=20 \setpretty`\@=20 + \setpretty`\[=30 \setpretty`\]=30 \setpretty`\(=30 \setpretty`\)=30 + \setpretty`\==30 \setpretty`\~=30 \setpretty`\<=30 \setpretty`\>=30 + \setpretty`\%=30 + \setpretty`\-=41 \setpretty`\+=41 + \setpretty`\|=41 \setpretty`\`=41 \setpretty`\!=41 \setpretty`\?=41 + \setpretty`\^=41 \setpretty`\&=41 + \setpretty`\/=43 \setpretty`\*=44 + \setpretty`\#=45 + \setpretty`\\=50 + \setpretty`\1=61 \setpretty`\2=61 \setpretty`\3=61 \setpretty`\4=61 \setpretty`\5=61 + \setpretty`\6=61 \setpretty`\7=61 \setpretty`\8=61 \setpretty`\9=61 \setpretty`\0=61 + \setpretty`\A=62 \setpretty`\B=62 \setpretty`\C=62 \setpretty`\D=62 \setpretty`\E=62 + \setpretty`\F=62 \setpretty`\G=62 \setpretty`\H=62 \setpretty`\I=62 \setpretty`\J=62 + \setpretty`\K=62 \setpretty`\L=62 \setpretty`\M=62 \setpretty`\N=62 \setpretty`\O=62 + \setpretty`\P=62 \setpretty`\Q=62 \setpretty`\R=62 \setpretty`\S=62 \setpretty`\T=62 + \setpretty`\U=62 \setpretty`\V=62 \setpretty`\W=62 \setpretty`\X=62 \setpretty`\Y=62 + \setpretty`\Z=62 + \setpretty`\a=62 \setpretty`\b=62 \setpretty`\c=62 \setpretty`\d=62 \setpretty`\e=62 + \setpretty`\f=62 \setpretty`\g=62 \setpretty`\h=62 \setpretty`\i=62 \setpretty`\j=62 + \setpretty`\k=62 \setpretty`\l=62 \setpretty`\m=62 \setpretty`\n=62 \setpretty`\o=62 + \setpretty`\p=62 \setpretty`\q=62 \setpretty`\r=62 \setpretty`\s=62 \setpretty`\t=62 + \setpretty`\u=62 \setpretty`\v=62 \setpretty`\w=62 \setpretty`\x=62 \setpretty`\y=62 + \setpretty`\z=62 + \setpretty`\_=62 + \setpretty`\;=70 \setpretty`\:=70 \setpretty`\,=70 \setpretty`\.=70 + \setpretty`\'=80 + \setpretty`\"=90 } + +\gdef\Csethandlers + {\installprettyhandler 10 \Ctypeone + \installprettyhandler 20 \Ctypetwo + \installprettyhandler 30 \Ctypethree + \installprettyhandler 41 \Ctypefourone + \installprettyhandler 43 \Ctypefourthree + \installprettyhandler 44 \Ctypefourfour + \installprettyhandler 45 \Ctypefourfive + \installprettyhandler 50 \Ctypefive + \installprettyhandler 61 \Ctypesixone + \installprettyhandler 62 \Ctypesixtwo + \installprettyhandler 70 \Ctypeseven + \installprettyhandler 80 \Ctypeeight + \installprettyhandler 90 \Ctypenine} + +\gdef\Ctypeone#1% + {\ifinCdouble + \ifinCcomment + \endCtypesix + \getpretty{#1}% + \else\ifx\Cprefix\empty + \endCtypesix + \getpretty{#1}% + \else + \endCtypesix + \xdef\Cprefix{\getpretty{#1}}% + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \fi\fi + \else + \endCtypesix + \ifinCcomment + \getpretty{#1}% + \else\ifinCsingle + \getpretty{#1}% + \else + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \fi\fi + \fi} + +\gdef\Ctypetwo#1% + {\endCtypesix + \getpretty{#1}} + +\gdef\Ctypethree#1% + {\endCtypesix + \ifinCcomment + \getpretty{#1}% + \else\ifinCsingle + \getpretty{#1}% + \else\ifinCdouble + \getprettydata{#1}% + \ifx\Cprefix\empty + \getpretty{#1}% + \else + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \fi + \else + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \fi\fi\fi} + +\gdef\Ctypefourone#1% + {\endCtypesix + \ifinCcomment + \getpretty{#1}% + \else\ifinCsingle + \getpretty{#1}% + \else\ifinCdouble + \getpretty{#1}% + \else + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \fi\fi\fi} + +\gdef\doCtypefourtwo#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=62 + \expandafter\Ctypetwo + \else + \expandafter\Ctypefourone + \fi + {#1}#2} + +\gdef\Ctypefourtwo + {\handlenextnextpretty\doCtypefourtwo\Ctypefourone} + +\gdef\Ctypefourthree + {\handlenextnextpretty\doCtypefourthree\Ctypefourtwo} + +\gdef\doCtypefourthree#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \let\next\dodoCtypefourthree + \else\ifnum\prettytype=44 + \global\inCcommenttrue + \global\inCmultilinecommenttrue + \let\next\Cstartcomment + \else + \let\next\Ctypefourtwo + \fi\fi + \next{#1}#2} + +\gdef\Cstartcomment#1#2% + {\beginofpretty[\!!prettyfourthree]\ttsl\getpretties{#1}{#2}} + +\gdef\dodoCtypefourthree% #1% + {\endCtypesix + \handlenextnextpretty\dododoCtypefourthree\dodododoCtypefourthree} + +\gdef\dododoCtypefourthree + {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoCtypefourthree} + +\gdef\dodododoCtypefourthree#1#2% + {\ifinCcomment + \getpretties{#1}{#2}% + \else + \global\inCcommenttrue + \global\inCsinglelinecommenttrue + \def\next{\beginofpretty[\!!prettyfourthree]\ttsl\getpretties{#1}{#2}}% + \expandafter\next + \fi} + +\gdef\Ctypefourfour + {\handlenextnextpretty\doCtypefourfour\Ctypefourtwo} + +\gdef\doCtypefourfour#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=44 + % \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \ifinCcomment + \getpretty{#1}% + \else + \endCtypesix + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \fi + \expandafter#2% + \else\ifnum\prettytype=43 + \getpretties{#1}{#2}% + \tttf + \endofpretty + \global\inCcommentfalse + \global\inCmultilinecommentfalse + \else\ifinCcomment + \getpretty{#1}% + \expandafter#2% + \else\ifinCsingle + \getpretty{#1}% + \expandafter#2% + \else\ifinCdouble + \getpretty{#1}% + \expandafter#2% + \else + \endCtypesix + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \expandafter#2% + \fi\fi\fi\fi\fi} + +\gdef\Ctypefourfive#1% + {\ifinCcomment + \getpretty{#1}% + \else\ifinCsingle + \getpretty{#1}% + \else\ifinCdouble + \getpretty{#1}% + \else + \endCtypesix + \global\inCcommenttrue + \global\inCsinglelinecommenttrue + \def\next{\beginofpretty[\!!prettyfourthree]\ttsl\getpretty{#1}}% + \expandafter\next + \fi\fi\fi} + +\gdef\doCtypefiveA#1#2% + {\endCtypesix + \ifinCcomment + \getpretties{#1}{#2}% + \else\ifinCsingle + \getprettydata{#2}% + \ifnum\prettytype=50 + \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty\beginofpretty[\!!prettyeight]% + \else\ifnum\prettytype=80 + \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty\beginofpretty[\!!prettyeight]% + \else + \getpretties{#1}{#2}% + \fi\fi + \else\ifinCdouble + \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty\beginofpretty[\!!prettynine]% + \else + \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty + \fi\fi\fi} + +\gdef\doCtypefiveB#1% + {\endCtypesix + \ifinCcomment + \ifcat#1\relax + \continueCsinglelinecommenttrue + \getpretty{#1}% + \else + \getpretty{#1}% + \fi + \else\ifinCsingle + \getpretty{#1}% + \else\ifinCdouble + \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty\beginofpretty[\!!prettynine]% + \else + \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty + \fi\fi\fi} + +\gdef\Ctypefive + {\expandafter\handlenextnextpretty\expandafter\doCtypefiveA\expandafter\doCtypefiveB} + +\gdef\endCtypesix + {\ifx\Csequence\empty\else + \ifinCcomment + \Csequence + \else\ifinCsingle + \Csequence + \else\ifinCdouble + \Csequence + \else\ifx\Cprefix\empty + \doendCtypesix\!!prettytwo + \else + \doendCtypesixtype\!!prettytwo + \fi\fi\fi\fi + \global\let\Csequence\empty + \global\let\Cprefix\empty + \fi} + +\gdef\doendCtypesix#1% + {\doifprettyidentifierelse{\Csequence}{\Ckeywords} + {\beginofpretty[#1]% + {\prettyidentifierfont\Csequence}% + \endofpretty} + {\doifprettyidentifierelse{\Csequence}{\Ctypes} + {\beginofpretty[\!!prettytwoone]% + {\prettyvariablefont\Csequence}% + \endofpretty} + {\Csequence}}} + +\gdef\doendCtypesixtype#1% + {\doifprettyidentifierelse{\Cprefix\Csequence}{\Ctypes} + {\beginofpretty[#1]% + {\prettyvariablefont\Csequence}% + \endofpretty} + {\Csequence}} + +\gdef\Ctypesixone#1% + {\ifinCcomment + \def\next{\getpretty{#1}}% + \else\ifinCsingle + \def\next{\getpretty{#1}}% + \else\ifinCdouble + \def\next{\getpretty{#1}}% + \else\ifx\Csequence\empty + \def\next{\beginofpretty[\!!prettyeight]\getpretty{#1}\endofpretty}% + \else + \def\next{\Ctypesixtwo{#1}}% + \fi\fi\fi\fi + \expandafter\next} + +\gdef\Ctypesixtwo#1% + {\ifinCcomment + \getpretty{#1}% + \else\ifinCsingle + \getpretty{#1}% + \else\ifinCdouble + \ifx\Cprefix\empty + \getpretty{#1}% + \else + \xdef\Csequence{\Csequence\getpretty{#1}}% + \fi + \else + \xdef\Csequence{\Csequence\getpretty{#1}}% + \fi\fi\fi} + +\gdef\Ctypeseven#1% + {\endCtypesix + \getpretty{#1}} + +\gdef\Ctypeeight#1% single quote + {\endCtypesix + \ifinCcomment + \getpretty{#1}% + \else\ifinCdouble + \getpretty{#1}% + \else\ifinCsingle + \global\inCsinglefalse + \getpretty{#1}% + \endofpretty + \else + \global\inCsingletrue + \beginofpretty[\!!prettyeight]\getpretty{#1} + \fi\fi\fi} + +\gdef\Ctypenine#1% double quote + {\endCtypesix + \ifinCcomment + \getpretty{#1}% + \else\ifinCsingle + \getpretty{#1}% + \else\ifinCdouble + \global\inCdoublefalse + \getpretty{#1}% + \endofpretty + \else + \global\inCdoubletrue + \beginofpretty[\!!prettynine]\getpretty{#1} + \fi\fi\fi} + +\gdef\doreportprettyCtype#1#2#3#4% + {#1% + [C \string#2 typing conflict, use \string#3 instead] + \writestatus + {C typing} + {use \string#3 instead of \string#2 to enable propper visualization}% + \global#4% + \expandafter\doemptyverbatimline + \fi} + +\gdef\reportprettyCtype + {\doreportprettyCtype\ifinCsingle'\'\inCsinglefalse + \doreportprettyCtype\ifinCdouble"\"\inCdoublefalse} + +\gdef\Csetdiagnostics + {\let\normaldoemptyverbatimline\doemptyverbatimline + \def\doemptyverbatimline + {\normaldoemptyverbatimline + \reportprettyCtype}} + +\useprettyidentifiers \Ckeywords \Csetspecials + break case continue default do else for goto if return sizeof switch while + +\useprettyidentifiers \Ctypes \Csetspecials + auto char const double enum extern float int long register restrict short + signed static struct typedef union unsigned void volatile bool + +\installprettytype [C] [C] + +\definetyping[C][\c!option=C] + +\definecolor [colorprettyone] [black] +\definecolor [colorprettytwo] [r=.46, g=.38, b=.13] +\definecolor [colorprettytwoone] [r=.38, g=.18, b=.5] +\definecolor [colorprettythree] [black] +\definecolor [colorprettyfour] [black] +\definecolor [colorprettyfourthree] [r=.15, g=.45, r=.15] +\definecolor [colorprettyfive] [r=.94, g=.15, b=.15] +\definecolor [colorprettyeight] [r=.58, g=.09, b=.09] +\definecolor [colorprettynine] [r=.58, g=.09, b=.09] + +\definecolor [grayprettyone] [s=.30] +\definecolor [grayprettytwo] [s=.45] +\definecolor [grayprettythree] [s=.60] +\definecolor [grayprettyfour] [s=.75] +\definecolor [grayprettyfourthree] [s=.70] + +\definepalet + [colorpretty] + [ prettyone=colorprettyone, + prettytwo=colorprettytwo, + prettytwoone=colorprettytwoone, + prettythree=colorprettythree, + prettyfour=colorprettyfour, + prettyfourthree=colorprettyfourthree, + prettyfive=colorprettyfive, + prettyeight=colorprettyeight, + prettynine=colorprettynine] + +\definepalet + [graypretty] + [ prettyone=grayprettyone, + prettytwo=grayprettytwo, + prettythree=grayprettythree, + prettyfour=grayprettyfour, + prettyfourthree=grayprettyfourthree] + +\definepalet [Ccolorpretty] [colorpretty] +\definepalet [Cgraypretty] [graypretty] + +\setuptyping + [C] + [\c!icommand=\tttf] + +\protect \endinput + diff --git a/tex/context/base/verb-c.tex b/tex/context/base/verb-c.tex deleted file mode 100644 index 1ecb0afc2..000000000 --- a/tex/context/base/verb-c.tex +++ /dev/null @@ -1,484 +0,0 @@ -%D \module -%D [ file=verb-c, -%D version=2006.04.17, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty C Verbatim, -%D author=Nikolai Weibull, -%D date=\currentdate, -%D copyright={PRAGMA ADE}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Verbatim Macros / Pretty C Verbatim} - -% HH: -% -% - extra !!pretty definitions moved to verb-ini -% - added a c! -% - did a few small cosmetic things - -\unprotect - -\doglobal\newif\ifinCsingle -\doglobal\newif\ifinCdouble -\doglobal\newif\ifinCcomment -\doglobal\newif\ifinCsinglelinecomment -\doglobal\newif\ifinCmultilinecomment -\doglobal\newif\ifcontinueCsinglelinecomment - -\gdef\Csetcontrols - {\saveprettycontrols - \def\obeyedspace - {\endCtypesix - \oldobeyedspace}% - \def\flushrestofverbatimline - {\endCtypesix - \ifinCsinglelinecomment - \ifcontinueCsinglelinecomment - \continueCsinglelinecommentfalse - \else - \tttf - \endofpretty - \global\inCsinglelinecommentfalse - \global\inCcommentfalse - \fi - \fi}% - \def\obeyedline - {\oldobeyedline}% - \let\obeytabs\ignoretabs} - -\gdef\setupprettyCtype - {\def\prettyidentifier{C}% - \Csetvariables - \Csetcontrols - \Csethandlers - \Csetspecials - \Csetdiagnostics} - -\gdef\Csetvariables - {\global\inCsinglefalse - \global\inCdoublefalse - \global\inCcommentfalse - \global\continueCsinglelinecommentfalse - \global\naturaltextexttrue - \global\let\Csequence\empty - \global\let\Cprefix\empty} - -% TODO: should handle -> as well - -\gdef\Csetspecials - {\setpretty`\{=10 \setpretty`\}=10 - \setpretty`\$=20 \setpretty`\@=20 - \setpretty`\[=30 \setpretty`\]=30 \setpretty`\(=30 \setpretty`\)=30 - \setpretty`\==30 \setpretty`\~=30 \setpretty`\<=30 \setpretty`\>=30 - \setpretty`\%=30 - \setpretty`\-=41 \setpretty`\+=41 - \setpretty`\|=41 \setpretty`\`=41 \setpretty`\!=41 \setpretty`\?=41 - \setpretty`\^=41 \setpretty`\&=41 - \setpretty`\/=43 \setpretty`\*=44 - \setpretty`\#=45 - \setpretty`\\=50 - \setpretty`\1=61 \setpretty`\2=61 \setpretty`\3=61 \setpretty`\4=61 \setpretty`\5=61 - \setpretty`\6=61 \setpretty`\7=61 \setpretty`\8=61 \setpretty`\9=61 \setpretty`\0=61 - \setpretty`\A=62 \setpretty`\B=62 \setpretty`\C=62 \setpretty`\D=62 \setpretty`\E=62 - \setpretty`\F=62 \setpretty`\G=62 \setpretty`\H=62 \setpretty`\I=62 \setpretty`\J=62 - \setpretty`\K=62 \setpretty`\L=62 \setpretty`\M=62 \setpretty`\N=62 \setpretty`\O=62 - \setpretty`\P=62 \setpretty`\Q=62 \setpretty`\R=62 \setpretty`\S=62 \setpretty`\T=62 - \setpretty`\U=62 \setpretty`\V=62 \setpretty`\W=62 \setpretty`\X=62 \setpretty`\Y=62 - \setpretty`\Z=62 - \setpretty`\a=62 \setpretty`\b=62 \setpretty`\c=62 \setpretty`\d=62 \setpretty`\e=62 - \setpretty`\f=62 \setpretty`\g=62 \setpretty`\h=62 \setpretty`\i=62 \setpretty`\j=62 - \setpretty`\k=62 \setpretty`\l=62 \setpretty`\m=62 \setpretty`\n=62 \setpretty`\o=62 - \setpretty`\p=62 \setpretty`\q=62 \setpretty`\r=62 \setpretty`\s=62 \setpretty`\t=62 - \setpretty`\u=62 \setpretty`\v=62 \setpretty`\w=62 \setpretty`\x=62 \setpretty`\y=62 - \setpretty`\z=62 - \setpretty`\_=62 - \setpretty`\;=70 \setpretty`\:=70 \setpretty`\,=70 \setpretty`\.=70 - \setpretty`\'=80 - \setpretty`\"=90 } - -\gdef\Csethandlers - {\installprettyhandler 10 \Ctypeone - \installprettyhandler 20 \Ctypetwo - \installprettyhandler 30 \Ctypethree - \installprettyhandler 41 \Ctypefourone - \installprettyhandler 43 \Ctypefourthree - \installprettyhandler 44 \Ctypefourfour - \installprettyhandler 45 \Ctypefourfive - \installprettyhandler 50 \Ctypefive - \installprettyhandler 61 \Ctypesixone - \installprettyhandler 62 \Ctypesixtwo - \installprettyhandler 70 \Ctypeseven - \installprettyhandler 80 \Ctypeeight - \installprettyhandler 90 \Ctypenine} - -\gdef\Ctypeone#1% - {\ifinCdouble - \ifinCcomment - \endCtypesix - \getpretty{#1}% - \else\ifx\Cprefix\empty - \endCtypesix - \getpretty{#1}% - \else - \endCtypesix - \xdef\Cprefix{\getpretty{#1}}% - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \fi\fi - \else - \endCtypesix - \ifinCcomment - \getpretty{#1}% - \else\ifinCsingle - \getpretty{#1}% - \else - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \fi\fi - \fi} - -\gdef\Ctypetwo#1% - {\endCtypesix - \getpretty{#1}} - -\gdef\Ctypethree#1% - {\endCtypesix - \ifinCcomment - \getpretty{#1}% - \else\ifinCsingle - \getpretty{#1}% - \else\ifinCdouble - \getprettydata{#1}% - \ifx\Cprefix\empty - \getpretty{#1}% - \else - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \fi - \else - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \fi\fi\fi} - -\gdef\Ctypefourone#1% - {\endCtypesix - \ifinCcomment - \getpretty{#1}% - \else\ifinCsingle - \getpretty{#1}% - \else\ifinCdouble - \getpretty{#1}% - \else - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \fi\fi\fi} - -\gdef\doCtypefourtwo#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=62 - \expandafter\Ctypetwo - \else - \expandafter\Ctypefourone - \fi - {#1}#2} - -\gdef\Ctypefourtwo - {\handlenextnextpretty\doCtypefourtwo\Ctypefourone} - -\gdef\Ctypefourthree - {\handlenextnextpretty\doCtypefourthree\Ctypefourtwo} - -\gdef\doCtypefourthree#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=43 - \let\next\dodoCtypefourthree - \else\ifnum\prettytype=44 - \global\inCcommenttrue - \global\inCmultilinecommenttrue - \let\next\Cstartcomment - \else - \let\next\Ctypefourtwo - \fi\fi - \next{#1}#2} - -\gdef\Cstartcomment#1#2% - {\beginofpretty[\!!prettyfourthree]\ttsl\getpretties{#1}{#2}} - -\gdef\dodoCtypefourthree% #1% - {\endCtypesix - \handlenextnextpretty\dododoCtypefourthree\dodododoCtypefourthree} - -\gdef\dododoCtypefourthree - {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoCtypefourthree} - -\gdef\dodododoCtypefourthree#1#2% - {\ifinCcomment - \getpretties{#1}{#2}% - \else - \global\inCcommenttrue - \global\inCsinglelinecommenttrue - \def\next{\beginofpretty[\!!prettyfourthree]\ttsl\getpretties{#1}{#2}}% - \expandafter\next - \fi} - -\gdef\Ctypefourfour - {\handlenextnextpretty\doCtypefourfour\Ctypefourtwo} - -\gdef\doCtypefourfour#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=44 - % \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \ifinCcomment - \getpretty{#1}% - \else - \endCtypesix - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \fi - \expandafter#2% - \else\ifnum\prettytype=43 - \getpretties{#1}{#2}% - \tttf - \endofpretty - \global\inCcommentfalse - \global\inCmultilinecommentfalse - \else\ifinCcomment - \getpretty{#1}% - \expandafter#2% - \else\ifinCsingle - \getpretty{#1}% - \expandafter#2% - \else\ifinCdouble - \getpretty{#1}% - \expandafter#2% - \else - \endCtypesix - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \expandafter#2% - \fi\fi\fi\fi\fi} - -\gdef\Ctypefourfive#1% - {\ifinCcomment - \getpretty{#1}% - \else\ifinCsingle - \getpretty{#1}% - \else\ifinCdouble - \getpretty{#1}% - \else - \endCtypesix - \global\inCcommenttrue - \global\inCsinglelinecommenttrue - \def\next{\beginofpretty[\!!prettyfourthree]\ttsl\getpretty{#1}}% - \expandafter\next - \fi\fi\fi} - -\gdef\doCtypefiveA#1#2% - {\endCtypesix - \ifinCcomment - \getpretties{#1}{#2}% - \else\ifinCsingle - \getprettydata{#2}% - \ifnum\prettytype=50 - \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty\beginofpretty[\!!prettyeight]% - \else\ifnum\prettytype=80 - \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty\beginofpretty[\!!prettyeight]% - \else - \getpretties{#1}{#2}% - \fi\fi - \else\ifinCdouble - \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty\beginofpretty[\!!prettynine]% - \else - \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty - \fi\fi\fi} - -\gdef\doCtypefiveB#1% - {\endCtypesix - \ifinCcomment - \ifcat#1\relax - \continueCsinglelinecommenttrue - \getpretty{#1}% - \else - \getpretty{#1}% - \fi - \else\ifinCsingle - \getpretty{#1}% - \else\ifinCdouble - \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty\beginofpretty[\!!prettynine]% - \else - \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty - \fi\fi\fi} - -\gdef\Ctypefive - {\expandafter\handlenextnextpretty\expandafter\doCtypefiveA\expandafter\doCtypefiveB} - -\gdef\endCtypesix - {\ifx\Csequence\empty\else - \ifinCcomment - \Csequence - \else\ifinCsingle - \Csequence - \else\ifinCdouble - \Csequence - \else\ifx\Cprefix\empty - \doendCtypesix\!!prettytwo - \else - \doendCtypesixtype\!!prettytwo - \fi\fi\fi\fi - \global\let\Csequence\empty - \global\let\Cprefix\empty - \fi} - -\gdef\doendCtypesix#1% - {\doifprettyidentifierelse{\Csequence}{\Ckeywords} - {\beginofpretty[#1]% - {\prettyidentifierfont\Csequence}% - \endofpretty} - {\doifprettyidentifierelse{\Csequence}{\Ctypes} - {\beginofpretty[\!!prettytwoone]% - {\prettyvariablefont\Csequence}% - \endofpretty} - {\Csequence}}} - -\gdef\doendCtypesixtype#1% - {\doifprettyidentifierelse{\Cprefix\Csequence}{\Ctypes} - {\beginofpretty[#1]% - {\prettyvariablefont\Csequence}% - \endofpretty} - {\Csequence}} - -\gdef\Ctypesixone#1% - {\ifinCcomment - \def\next{\getpretty{#1}}% - \else\ifinCsingle - \def\next{\getpretty{#1}}% - \else\ifinCdouble - \def\next{\getpretty{#1}}% - \else\ifx\Csequence\empty - \def\next{\beginofpretty[\!!prettyeight]\getpretty{#1}\endofpretty}% - \else - \def\next{\Ctypesixtwo{#1}}% - \fi\fi\fi\fi - \expandafter\next} - -\gdef\Ctypesixtwo#1% - {\ifinCcomment - \getpretty{#1}% - \else\ifinCsingle - \getpretty{#1}% - \else\ifinCdouble - \ifx\Cprefix\empty - \getpretty{#1}% - \else - \xdef\Csequence{\Csequence\getpretty{#1}}% - \fi - \else - \xdef\Csequence{\Csequence\getpretty{#1}}% - \fi\fi\fi} - -\gdef\Ctypeseven#1% - {\endCtypesix - \getpretty{#1}} - -\gdef\Ctypeeight#1% single quote - {\endCtypesix - \ifinCcomment - \getpretty{#1}% - \else\ifinCdouble - \getpretty{#1}% - \else\ifinCsingle - \global\inCsinglefalse - \getpretty{#1}% - \endofpretty - \else - \global\inCsingletrue - \beginofpretty[\!!prettyeight]\getpretty{#1} - \fi\fi\fi} - -\gdef\Ctypenine#1% double quote - {\endCtypesix - \ifinCcomment - \getpretty{#1}% - \else\ifinCsingle - \getpretty{#1}% - \else\ifinCdouble - \global\inCdoublefalse - \getpretty{#1}% - \endofpretty - \else - \global\inCdoubletrue - \beginofpretty[\!!prettynine]\getpretty{#1} - \fi\fi\fi} - -\gdef\doreportprettyCtype#1#2#3#4% - {#1% - [C \string#2 typing conflict, use \string#3 instead] - \writestatus - {C typing} - {use \string#3 instead of \string#2 to enable propper visualization}% - \global#4% - \expandafter\doemptyverbatimline - \fi} - -\gdef\reportprettyCtype - {\doreportprettyCtype\ifinCsingle'\'\inCsinglefalse - \doreportprettyCtype\ifinCdouble"\"\inCdoublefalse} - -\gdef\Csetdiagnostics - {\let\normaldoemptyverbatimline\doemptyverbatimline - \def\doemptyverbatimline - {\normaldoemptyverbatimline - \reportprettyCtype}} - -\useprettyidentifiers \Ckeywords \Csetspecials - break case continue default do else for goto if return sizeof switch while - -\useprettyidentifiers \Ctypes \Csetspecials - auto char const double enum extern float int long register restrict short - signed static struct typedef union unsigned void volatile bool - -\installprettytype [C] [C] - -\definetyping[C][\c!option=C] - -\definecolor [colorprettyone] [black] -\definecolor [colorprettytwo] [r=.46, g=.38, b=.13] -\definecolor [colorprettytwoone] [r=.38, g=.18, b=.5] -\definecolor [colorprettythree] [black] -\definecolor [colorprettyfour] [black] -\definecolor [colorprettyfourthree] [r=.15, g=.45, r=.15] -\definecolor [colorprettyfive] [r=.94, g=.15, b=.15] -\definecolor [colorprettyeight] [r=.58, g=.09, b=.09] -\definecolor [colorprettynine] [r=.58, g=.09, b=.09] - -\definecolor [grayprettyone] [s=.30] -\definecolor [grayprettytwo] [s=.45] -\definecolor [grayprettythree] [s=.60] -\definecolor [grayprettyfour] [s=.75] -\definecolor [grayprettyfourthree] [s=.70] - -\definepalet - [colorpretty] - [ prettyone=colorprettyone, - prettytwo=colorprettytwo, - prettytwoone=colorprettytwoone, - prettythree=colorprettythree, - prettyfour=colorprettyfour, - prettyfourthree=colorprettyfourthree, - prettyfive=colorprettyfive, - prettyeight=colorprettyeight, - prettynine=colorprettynine] - -\definepalet - [graypretty] - [ prettyone=grayprettyone, - prettytwo=grayprettytwo, - prettythree=grayprettythree, - prettyfour=grayprettyfour, - prettyfourthree=grayprettyfourthree] - -\definepalet [Ccolorpretty] [colorpretty] -\definepalet [Cgraypretty] [graypretty] - -\setuptyping - [C] - [\c!icommand=\tttf] - -\protect \endinput - diff --git a/tex/context/base/verb-eif.mkii b/tex/context/base/verb-eif.mkii new file mode 100644 index 000000000..5904abc6e --- /dev/null +++ b/tex/context/base/verb-eif.mkii @@ -0,0 +1,211 @@ +%D \module +%D [ file=verb-eif, +%D version=2000.08.23, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty Eiffel Verbatim, +%D author={Berend de Boer \& Hans Hagen}, +%D date=\currentdate, +%D copyright={Berend de Boer \& Hans Hagen}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% This module will be cleaned up a bit in the process of more +% flexible verbatim options. + +\writestatus{loading}{ConTeXt Verbatim Macros / Pretty EIFFEL Verbatim} + +%D \startbuffer +%D \startEIFFEL +%D class TEST +%D +%D creation +%D make +%D +%D feature -- creation +%D +%D make is +%D do +%D print ("hello world") +%D end +%D +%D end +%D \stopEIFFEL +%D \stopbuffer +%D +%D +%D If a variable in a comment is quoted with `..', it is typeset +%D as a variable (common Eiffel convention for pretty typesetters): +%D +%D \startbuffer +%D \startEIFFEL +%D class TEST +%D +%D feature +%D +%D say (something: STRING) is +%D -- say `something' to stdout +%D do +%D print (something) +%D end +%D +%D end -- class TEST +%D \stopEIFFEL +%D \stopbuffer +%D +%D +%D Recommended, OOSC2 style setting is: +%D +%D \setuptyping +%D [EIFFEL] +%D [margin=1em,palet=,color=blue,style=\it,icommand=\bf,ccommand=\tf] +%D + +%D We borrow most of the macros from the \PERL\ driver. + +\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi + +\unprotect + +%D \EIFFEL\ has only the one line comment sequence \type{--}. + +\gdef\EIFsetspecials% + {\PLsetspecials + \setpretty`\#=32 + \setpretty`\{=33 \setpretty`\}=33 + \setpretty`\[=33 \setpretty`\]=33 \setpretty`\(=33 \setpretty`\)=33 + \setpretty`\;=33 \setpretty`\:=33 + \setpretty`\!=33 \setpretty`\?=33 + \setpretty`\==33 \setpretty`\~=33 \setpretty`\<=33 \setpretty`\>=33 + \setpretty`\-=33 \setpretty`\+=33 \setpretty`\/=33 \setpretty`\*=33 + \setpretty`\^=33 + \setpretty`\%=41 \setpretty`\-=45 + \setpretty`\`=81 \setpretty`\'=82 } + +\gdef\EIFsethandlers% + {\PLsethandlers + \installprettyhandler 33 \EIFtypesymbol + \installprettyhandler 45 \EIFtypefourfive + \installprettyhandler 81 \EIFtypeeightone + \installprettyhandler 82 \EIFtypeeighttwo + \installprettyhandler 90 \EIFtypenine } + +\gdef\EIFsetcontrols% + {\PLsetcontrols + \def\flushrestofverbatimline% + {\endPLtypesix + \inPLcommentfalse + \verbatimfont + \PLverbosefalse + \PLverboseskipped=0}} + +\gdef\EIFsetvariables + {\PLsetvariables} + +\gdef\setupprettyEIFtype% + {\def\prettyidentifier{EIF}% + \let\PLidentifiers=\EIFidentifiers + \let\PLvariables=\EIFvariables + \EIFsetvariables + \EIFsetcontrols + \EIFsethandlers + \EIFsetspecials + \PLsetdiagnostics} + +% symbols should appear in roman + +\gdef\EIFtypesymbol#1% + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else + {\prettynaturalfont\/% + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% + \fi} + +% recognize comments + +\gdef\EIFtypefourfive% + {\handlenextnextpretty\doEIFtypefourfive\PLtypefourtwo} + +\gdef\doEIFtypefourfive#1#2% + {\endPLtypesix + \getprettydata{#2}% + \ifnum\prettytype=45 + \let\next=\dodoEIFtypefourfive + \else + \let\next=\PLtypefourtwo + \fi + \next{#1}#2} + +\gdef\dodoEIFtypefourfive% #1% + {\endPLtypesix + \handlenextnextpretty\dododoEIFtypefourfive\dodododoPLtypefourfive} + +\gdef\dododoEIFtypefourfive% + {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoEIFtypefourfive} + +\gdef\dodododoEIFtypefourfive#1#2% + {\ifinPLcomment + \getpretties{#1}{#2}% + \else + \ifinPLdouble + \getpretties{#1}{#2}% + \else + \global\inPLcommenttrue + \PLverbosecorrection + \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty\prettynaturalfont}% + \expandafter\next + \fi + \fi} + +% recognize `name' in comments and format them like variables + +\gdef\EIFtypeeightone#1% + {\endPLtypesix + \ifinPLcomment + \verbatimfont + \else + \getpretty{#1}% + \fi} + +\gdef\EIFtypeeighttwo#1% + {\endPLtypesix + \ifinPLcomment + \prettynaturalfont + \else + {\prettynaturalfont\/% + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% + \fi} + +% double quote + +\gdef\EIFtypenine#1% + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else\ifinPLsingle + \getpretty{#1}% + \else\ifinPLdouble + \global\inPLdoublefalse + {\prettynaturalfont\/% + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% + \else + \global\inPLdoubletrue + {\prettynaturalfont + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% + \fi\fi\fi} + +\useprettyidentifiers \EIFidentifiers \EIFsetspecials + alias all and as check class create creation debug deferred do else + elseif end ensure expanded export external false feature from frozen + if implies indexing infix inherit inspect invariant is like local + loop not obsolete old once or prefix redefine rename require rescue + precursor retry select separate strip then true undefine unique + until variant when xor + +\useprettyidentifiers \EIFvariables \EIFsetspecials + not-yet-defined + +\protect \endinput diff --git a/tex/context/base/verb-eif.tex b/tex/context/base/verb-eif.tex deleted file mode 100644 index 5904abc6e..000000000 --- a/tex/context/base/verb-eif.tex +++ /dev/null @@ -1,211 +0,0 @@ -%D \module -%D [ file=verb-eif, -%D version=2000.08.23, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty Eiffel Verbatim, -%D author={Berend de Boer \& Hans Hagen}, -%D date=\currentdate, -%D copyright={Berend de Boer \& Hans Hagen}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% This module will be cleaned up a bit in the process of more -% flexible verbatim options. - -\writestatus{loading}{ConTeXt Verbatim Macros / Pretty EIFFEL Verbatim} - -%D \startbuffer -%D \startEIFFEL -%D class TEST -%D -%D creation -%D make -%D -%D feature -- creation -%D -%D make is -%D do -%D print ("hello world") -%D end -%D -%D end -%D \stopEIFFEL -%D \stopbuffer -%D -%D -%D If a variable in a comment is quoted with `..', it is typeset -%D as a variable (common Eiffel convention for pretty typesetters): -%D -%D \startbuffer -%D \startEIFFEL -%D class TEST -%D -%D feature -%D -%D say (something: STRING) is -%D -- say `something' to stdout -%D do -%D print (something) -%D end -%D -%D end -- class TEST -%D \stopEIFFEL -%D \stopbuffer -%D -%D -%D Recommended, OOSC2 style setting is: -%D -%D \setuptyping -%D [EIFFEL] -%D [margin=1em,palet=,color=blue,style=\it,icommand=\bf,ccommand=\tf] -%D - -%D We borrow most of the macros from the \PERL\ driver. - -\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi - -\unprotect - -%D \EIFFEL\ has only the one line comment sequence \type{--}. - -\gdef\EIFsetspecials% - {\PLsetspecials - \setpretty`\#=32 - \setpretty`\{=33 \setpretty`\}=33 - \setpretty`\[=33 \setpretty`\]=33 \setpretty`\(=33 \setpretty`\)=33 - \setpretty`\;=33 \setpretty`\:=33 - \setpretty`\!=33 \setpretty`\?=33 - \setpretty`\==33 \setpretty`\~=33 \setpretty`\<=33 \setpretty`\>=33 - \setpretty`\-=33 \setpretty`\+=33 \setpretty`\/=33 \setpretty`\*=33 - \setpretty`\^=33 - \setpretty`\%=41 \setpretty`\-=45 - \setpretty`\`=81 \setpretty`\'=82 } - -\gdef\EIFsethandlers% - {\PLsethandlers - \installprettyhandler 33 \EIFtypesymbol - \installprettyhandler 45 \EIFtypefourfive - \installprettyhandler 81 \EIFtypeeightone - \installprettyhandler 82 \EIFtypeeighttwo - \installprettyhandler 90 \EIFtypenine } - -\gdef\EIFsetcontrols% - {\PLsetcontrols - \def\flushrestofverbatimline% - {\endPLtypesix - \inPLcommentfalse - \verbatimfont - \PLverbosefalse - \PLverboseskipped=0}} - -\gdef\EIFsetvariables - {\PLsetvariables} - -\gdef\setupprettyEIFtype% - {\def\prettyidentifier{EIF}% - \let\PLidentifiers=\EIFidentifiers - \let\PLvariables=\EIFvariables - \EIFsetvariables - \EIFsetcontrols - \EIFsethandlers - \EIFsetspecials - \PLsetdiagnostics} - -% symbols should appear in roman - -\gdef\EIFtypesymbol#1% - {\endPLtypesix - \ifinPLcomment - \getpretty{#1}% - \else - {\prettynaturalfont\/% - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% - \fi} - -% recognize comments - -\gdef\EIFtypefourfive% - {\handlenextnextpretty\doEIFtypefourfive\PLtypefourtwo} - -\gdef\doEIFtypefourfive#1#2% - {\endPLtypesix - \getprettydata{#2}% - \ifnum\prettytype=45 - \let\next=\dodoEIFtypefourfive - \else - \let\next=\PLtypefourtwo - \fi - \next{#1}#2} - -\gdef\dodoEIFtypefourfive% #1% - {\endPLtypesix - \handlenextnextpretty\dododoEIFtypefourfive\dodododoPLtypefourfive} - -\gdef\dododoEIFtypefourfive% - {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoEIFtypefourfive} - -\gdef\dodododoEIFtypefourfive#1#2% - {\ifinPLcomment - \getpretties{#1}{#2}% - \else - \ifinPLdouble - \getpretties{#1}{#2}% - \else - \global\inPLcommenttrue - \PLverbosecorrection - \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty\prettynaturalfont}% - \expandafter\next - \fi - \fi} - -% recognize `name' in comments and format them like variables - -\gdef\EIFtypeeightone#1% - {\endPLtypesix - \ifinPLcomment - \verbatimfont - \else - \getpretty{#1}% - \fi} - -\gdef\EIFtypeeighttwo#1% - {\endPLtypesix - \ifinPLcomment - \prettynaturalfont - \else - {\prettynaturalfont\/% - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% - \fi} - -% double quote - -\gdef\EIFtypenine#1% - {\endPLtypesix - \ifinPLcomment - \getpretty{#1}% - \else\ifinPLsingle - \getpretty{#1}% - \else\ifinPLdouble - \global\inPLdoublefalse - {\prettynaturalfont\/% - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% - \else - \global\inPLdoubletrue - {\prettynaturalfont - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% - \fi\fi\fi} - -\useprettyidentifiers \EIFidentifiers \EIFsetspecials - alias all and as check class create creation debug deferred do else - elseif end ensure expanded export external false feature from frozen - if implies indexing infix inherit inspect invariant is like local - loop not obsolete old once or prefix redefine rename require rescue - precursor retry select separate strip then true undefine unique - until variant when xor - -\useprettyidentifiers \EIFvariables \EIFsetspecials - not-yet-defined - -\protect \endinput diff --git a/tex/context/base/verb-ini.mkii b/tex/context/base/verb-ini.mkii new file mode 100644 index 000000000..4726d0eac --- /dev/null +++ b/tex/context/base/verb-ini.mkii @@ -0,0 +1,1810 @@ +%D \module +%D [ file=verb-ini, +%D version=1997.12.22, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Today I would implement the pretty handler slightly +%D different, using stack and intermediate flushing. Maybe +%D even without active chars. So, someday \unknown. Also +%D I think that there are better ways (the current approach +%D is an accumulation; for instance, we could save a second +%D argument by turning chars into numbers and vise versa. + +%D Because this module is quite independant of system macros, +%D it can be used as a stand||alone verbatim environment. +%D +%D This is a sort of second release of \type{supp-ver} and +%D therefore differs in some aspects from the implementation +%D published in the \MAPS. The first change concern +%D optimization of breaks, that is, the first and last two +%D lines of verbatim blocks are kept together. The second +%D adaption is due to the fact that I wanted to support pretty +%D printing not only for \TEX\ sources, but also for \PERL, +%D \METAPOST\ and probably more. The \JAVASCRIPT\ module is +%D closely related to \PERL, so we will not mention that one +%D again. + +\ifx \undefined \writestatus \input supp-mis.tex \fi + +%D Verbatim typesetting, especially of \TEX\ sources, is a +%D non||trivial task. This is a direct results of the fact that +%D characters can have \CATCODES\ other than~11 and such +%D characters needs a special treatment. What for instance is +%D \TEX\ supposed to do when it encounters a \type{$} or an +%D \type{#}? This module deals with these matters. + +\writestatus{loading}{ConTeXt Verbatim Macros / Initialization} + +%D The verbatim environment has some features, like coloring +%D \TEX\ text, seldom found in other environments. Especially +%D when the output of \TEX\ is viewed on an electronic medium, +%D coloring has a positive influence on the readability of +%D \TEX\ sources, so we found it very acceptable to dedicate +%D half of this module to typesetting \TEX\ specific character +%D sequences in color. In this module we'll also present some +%D macro's for typesetting inline, display and file verbatim. +%D The macro's are capable of handling \TAB\ too. +%D +%D This module shows a few tricks that are often overseen by +%D novice, like the use of the \TEX\ primitive \type{\meaning}. +%D First I'll show in what way the users are confronted with +%D verbatim typesetting. Because we want to be able to test for +%D symmetry and because we hate the method of closing down the +%D verbatim mode with some strange active character, we will +%D use the following construction for display verbatim: +%D +%D \starttyping +%D The Dutch word 'typen' stands for 'typing', therefore in the Dutch version +%D one will not find the word 'verbatim'. +%D \stoptyping +%D +%D In \CONTEXT\ files can be typed with \type{\typefile} and +%D inline verbatim can be accomplished with \type{\type}. This +%D last command comes in many flavors: +%D +%D \starttyping +%D We can say \type<> or \type{something}. The first one is a bit +%D longer but also supports slanted typing, which accomplished by typing +%D \type<> word>>. We can also use commands to enhance the text +%D \type<> text>>. Just to be complete, we decided +%D to accept also \LaTeX\ alike verbatim, which means that \type+something+ +%D and \type|something| are valid commands too. Of course we want the grouped +%D alternatives to process \type{hello {\bf big} world} with braces. +%D \stoptyping +%D +%D In the core modules, we will build this support on top of +%D this module. There these commands can be tuned with +%D accompanying setup commands. There we can enable commands, +%D slanted typing, control spaces, \TAB||handling and (here we +%D are:) coloring. We can also setup surrounding white space +%D and indenting. Here we'll only show some examples. + +\unprotect + +%D \macros +%D {verbatimfont} +%D +%D When we are typesetting verbatim we use a non||proportional +%D (mono spaced) font. Normally this font is available by +%D calling \type{\tt}. In \CONTEXT\ this command does a +%D complete font||style switch. There we could have stuck with +%D \type{\tttf}. + +\ifx\verbatimfont\undefined \def\verbatimfont{\tt\normalnoligatures\font} \fi + +\ifx\normalnoligatures\undefined \let\normalnoligatures\gobbleoneargument \fi + +%D \macros +%D {obeyedspace, obeyedtab, obeyedline, obeyedpage} +%D +%D We have followed Knuth in naming macros that make \SPACE, +%D \NEWLINE\ and \NEWPAGE\ active and assigning them +%D \type{\obeysomething}, but first we set some default values. + +\def\obeyedspace {\hbox{ }} +\def\obeyedtab {\obeyedspace} +\def\obeyedline {\par} +\def\obeyedpage {\vfill\eject} + +%D Because we will introduce a status variable, we can define +%D a better \type {\obeyedspace}. + +\def\obeyedspace {\ifprocessingverbatim\hbox{ }\else\space\fi} + +%D \macros +%D {controlspace,setcontrolspaces} +%D +%D First we define \type{\obeyspaces}. When we want visible +%D spaces (control spaces) we only have to adapt the definition +%D of \type{\obeyedspace} to: + +\def\controlspace{\hbox{\char32}} +\def\normalspace { } +\def\normalspaces{\catcode`\ =\@@space} + +\bgroup +\catcode`\ =\@@active +\gdef\obeyspaces{\catcode`\ =\@@active\def {\obeyedspace}} +\gdef\setcontrolspaces{\catcode`\ =\@@active\def {\controlspace}} +\egroup + +%D \macros +%D {obeytabs, obeylines, obeypages, +%D ignoretabs, ignorelines, ignorepages} +%D +%D Next we take care of \NEWLINE\ and \NEWPAGE\ and because we +%D want to be able to typeset listings that contain \TAB, we +%D have to handle those too. Because we have to redefine the +%D \NEWPAGE\ character locally, we redefine the meaning of +%D this (often already) active character. + +\catcode`\^^L=\@@active \def^^L{\par} + +%D The following indirect definitions enable us to implement +%D all kind of \type{\obeyed} handlers. + +\bgroup + +\catcode`\^^I=\@@active +\catcode`\^^M=\@@active +\catcode`\^^L=\@@active + +\gdef\obeytabs {\catcode`\^^I=\@@active\def^^I{\obeyedtab}} +\gdef\obeylines {\catcode`\^^M=\@@active\def^^M{\obeyedline}} +\gdef\obeypages {\catcode`\^^L=\@@active\def^^L{\obeyedpage}} + +\gdef\ignoretabs {\catcode`\^^I=\@@active\def^^I{\obeyedspace}} +\gdef\ignorelines {\catcode`\^^M=\@@active\def^^M{\obeyedspace}} +\gdef\ignorepages {\catcode`\^^L=\@@ignore} % \@@active\def^^L{\obeyedline}} +\gdef\ignoreeofs {\catcode`\^^Z=\@@ignore} + +%D For testing (see digit parser) we need an indirect macro +%D in order to compare the next (\type {\next}) token +%D (possibly \type {^^M}) being \type {\obeyedline}. + +\gdef\nextobeyedline{\obeyedline} + +\egroup + +%D \macros +%D {obeycharacters} +%D +%D We also predefine \type{\obeycharacters}, which will +%D enable us to implement character||specific behavior, like +%D colored verbatim. + +\let\obeycharacters=\relax + +%D \macros +%D {settabskips} +%D +%D The macro \type{\settabskip} can be used to enable tab +%D handling. Processing tabs is sometimes needed when one +%D processes a plain \ASCII\ listing. Tab handling slows down +%D verbatim typesetting considerably. + +\bgroup + +\catcode`\^^I=\@@active + +\gdef\settabskips + {\let\processverbatimline\doprocesstabskipline + \catcode`\^^I\@@active + \let^^I\doprocesstabskip} + +\gdef\setfixedtabskips#1% + {\catcode`\^^I\@@active + \def^^I{\kern#1\spaceskip}} + +\egroup + +%D \macros +%D {processingverbatim} +%D +%D Typesetting a file in most cases results in more than one +%D page. Because we don't want problems with files that are +%D read in during the construction of the page, we set \type +%D {\ifprocessingverbatim}, so the output routine can adapt +%D its behavior. Originally we used \type {\scratchread}, but +%D because we want to support nesting, we decided to use a +%D separate input file. + +\newif\ifprocessingverbatim + +%D \macros +%D {processinlineverbatim} +%D +%D Although the inline verbatim commands presented here will be +%D extended and embedded in the core modules of \CONTEXT, +%D they can be used separately. Both grouped and character +%D alternatives are provided but \type{<<} and nested +%D braces are implemented in the core module. This commands +%D takes one argument: the closing command. +%D +%D \starttyping +%D \processinlineverbatim{\closingcommand} +%D \stoptyping +%D +%D One can define his own verbatim commands, which can be very +%D simple: +%D +%D \starttyping +%D \def\Verbatim {\processinlineverbatim\relax} +%D \stoptyping +%D +%D or a bit more more complex: +%D +%D \starttyping +%D \def\GroupedVerbatim% +%D {\bgroup +%D \dosomeusefullthings +%D \processinlineverbatim\egroup} +%D \stoptyping +%D +%D Before entering inline verbatim mode, we take care of the +%D unwanted \TAB, \NEWLINE\ and \NEWPAGE\ characters and +%D turn them into \SPACE. We need the double \type{\bgroup} +%D construction to keep the closing command local. + +\def\setverbatimspaceskip + {\setbox\scratchbox\hbox{x}% + \spaceskip\wd\scratchbox + \xspaceskip\spaceskip} + +\def\setupinlineverbatim + {\verbatimfont + \setverbatimspaceskip + \let\obeytabs\ignoretabs + \let\obeylines\ignorelines + \let\obeypages\ignorepages + \setupcopyverbatim} + +\def\doprocessinlineverbatim + {\ifx\next\bgroup + \setupinlineverbatim + \catcode`\{\@@begingroup + \catcode`\}\@@endgroup + \def\next{\let\next=}% + \else + \setupinlineverbatim + \def\next##1{\catcode`##1=\@@endgroup}% + \fi + \next} + +\def\processinlineverbatim#1% + {\bgroup + \processingverbatimtrue + \localcatcodestrue % TeX processes paragraph's + \def\endofverbatimcommand{#1\egroup}% + \bgroup + \aftergroup\endofverbatimcommand + \futurelet\next\doprocessinlineverbatim} + +%D The closing command is executed afterwards as an internal +%D command and therefore should not be given explicitly when +%D typesetting inline verbatim. + +%D \macros +%D {optimizeverbatim} +%D +%D One day, a collegue asked me why I didn't prevent breaking +%D after a first or before a last verbatim line. At first sight +%D I thought of using the two pass mechanism, but because we're +%D already keeping track of individual lines, a more direct +%D solution is possible: we just keep track of in what line +%D we are. One can turn this feature off. + +\newif\ifoptimizeverbatim \optimizeverbatimtrue + +%D Before we implement display and file verbatim, we define +%D some macros that deal with typesetting the individual lines. +%D We keep track of the status by means of a character +%D specification. This status variable tells us if we're +%D skipping a first line or placing a first or last line. +%D The next few examples show us where breaks are inserted. +%D +%D \bgroup +%D +%D \def\doverbatimnobreak +%D {\nobreak\hrule width 10cm\par\penalty500} % == \nobreak +%D +%D \def\doverbatimgoodbreak +%D {\nobreak\hrule width 3cm \par\penalty\linepenalty} +%D +%D \starttyping +%D test +%D test +%D \stoptyping +%D +%D or +%D +%D \starttyping +%D test +%D test +%D test +%D test +%D \stoptyping +%D +%D or +%D +%D \starttyping +%D test +%D +%D test +%D test +%D test +%D \stoptyping +%D +%D \egroup +%D +%D The long ones are \type{\nobreaks} and the short ones +%D \type{\goodbreaks}. And this is how it's done: + +\def\doverbatimnobreak + {\ifoptimizeverbatim\penalty500 \fi} + +\def\doverbatimgoodbreak + {\ifoptimizeverbatim\penalty\linepenalty\fi} + +\def\doflushverbatimline + {\expandafter\dodoverbatimline\expandafter{\savedverbatimline}} + +\def\doverbatimbeginofline#1% linenumber (optional provided by mkiv / todo) + {\dontleavehmode + \strut + \the\everyline} + +\def\doverbatimendofline + {\par} + +\def\doverbatimemptyline + {\strut + \par} + +\let\handleverbatimline=\relax + +% \def\initializeverbatimline% +% {\global\let\savedverbatimline=\empty +% \ifskipfirstverbatimline +% \global\chardef\verbatimstatus=0 +% \else +% \global\chardef\verbatimstatus=1 +% \fi} +% +% more efficient + +\global\chardef\verbatimstatus0 + +\def\initializeverbatimline + {\global\let\savedverbatimline\empty + \global\chardef\verbatimstatus\ifskipfirstverbatimline0 \else1 \fi} + +\chardef\verbatimemptylinemode\zerocount + +\def\presetemptyverbatimline + {\ifcase\verbatimstatus + \global\chardef\verbatimstatus\plusone + \or + \ifcase\verbatimemptylinemode\or\or + \doemptyverbatimline + \fi + \or + \ifcase\verbatimemptylinemode\else + \doemptyverbatimline + \fi + \or + \doflushverbatimline + \global\let\savedverbatimline\empty + \doemptyverbatimline + \global\chardef\verbatimstatus\plustwo + \else + \kern\zeropoint + \doverbatimnobreak + \doflushverbatimline + \global\let\savedverbatimline\empty + \doemptyverbatimline + \global\chardef\verbatimstatus\plustwo + \fi} + +\def\presetnormalverbatimline + {\ifcase\verbatimstatus + \global\chardef\verbatimstatus\plustwo + \or + \global\chardef\verbatimstatus\plusthree + \or + \global\chardef\verbatimstatus\plusthree + \or + \doflushverbatimline + \global\chardef\verbatimstatus\plusfour + \or + \kern\zeropoint + \doverbatimnobreak + \doflushverbatimline + \global\chardef\verbatimstatus\plusfive + \or + \doverbatimgoodbreak + \doflushverbatimline + \fi + \global\let\savedverbatimline\verbatimline} + +\def\presetlastverbatimline + {\ifcase \verbatimstatus + \or + \or + \or + \doflushverbatimline + \else + \kern \zeropoint + \doverbatimnobreak + \doflushverbatimline + \fi + \ifcase\verbatimemptylinemode\or\else + \kern \zeropoint + \fi} + +%D \macros +%D {skipfirstverbatimline} +%D +%D By default the rest of the first line is ignored. We can +%D turn this feature off by saying: +%D +%D \starttyping +%D \skipfirstverbatimlinefalse +%D \stoptyping + +\newif\ifskipfirstverbatimline \skipfirstverbatimlinetrue + +%D \macros +%D {processdisplayverbatim} +%D +%D We can define a display verbatim environment with the +%D command \type{\processdisplayverbatim} in the following way: +%D +%D \starttyping +%D \processdisplayverbatim{\closingcommand} +%D \stoptyping +%D +%D \noindent For instance, we can define a simple command like: +%D +%D \starttyping +%D \def\BeginVerbatim {\processdisplayverbatim{EndVerbatim}} +%D \stoptyping +%D +%D \noindent But we can also do more advance things like: +%D +%D \starttyping +%D \def\BeginVerbatim {\bigskip \processdisplayverbatim{\EndVerbatim}} +%D \def\EndVerbatim {\bigskip} +%D \stoptyping +%D +%D When we compare these examples, we see that the backslash in +%D the closing command is optional. One is free in actually +%D defining a closing command. If one is defined, the command +%D is executed after ending verbatim mode. + +\def\processdisplayverbatim#1% + {\par + \bgroup + \escapechar=-1 + \xdef\verbatimname{\string#1}% + \egroup + \def\endofdisplayverbatim{\csname\verbatimname\endcsname}% + \bgroup + \parindent\zeropoint + \ifdim\lastskip<\parskip + \removelastskip + \vskip\parskip + \fi + \parskip\zeropoint + \processingverbatimtrue + \global\linepartrue + \expandafter\let\csname\verbatimname\endcsname\relax + \edef\endofverbatimcommand{\csname\verbatimname\endcsname}% + \edef\endofverbatimcommand{\meaning\endofverbatimcommand}% + \verbatimfont + \setverbatimspaceskip + \global\linepartrue % needed for paragraph numbering + \setupcopyverbatim + \initializeverbatimline + \copyverbatimline} + +%D We save the closing sequence in \type{\endofverbatimcommand} +%D in such a way that it can be compared on a line by line +%D basis. For the conversion we use \type{\meaning}, which +%D converts the line to non||expandable tokens. We reset +%D \type{\parskip}, because we don't want inter||paragraph +%D skips to creep into the verbatim source. Furthermore we +%D \type{\relax} the line||processing macro while getting the +%D rest of the first line. The initialization command +%D \type{\setupcopyverbatim} does just what we expect it to do: +%D it assigns all characters \CATCODE~11. Next we switch to +%D french spacing and call for obeyance. + +\newevery \everysetupverbatim \relax + +\def\setupcopyverbatim + {\uncatcodecharacters + \frenchspacing + \obeyspaces + \obeytabs + \obeylines + \obeypages + \obeycharacters + \the\everysetupverbatim} + +%D The main copying routine of display verbatim does an +%D ordinary string||compare on the saved closing command and +%D the current line. The space after \type{#1} in the +%D definition of \type{\next} is essential! As a result of +%D using \type{\obeylines}, we have to use \type{%}'s after +%D each line but none after the first \type{#1}. + +{\obeylines% + \long\gdef\copyverbatimline#1 + {\def\next{#1 }% + \gdef\verbatimline{#1}% + \ifx\next\emptyspace% + \presetemptyverbatimline% + \else% + \edef\next{\meaning\next}% + \ifx\next\endofverbatimcommand% + \presetlastverbatimline% + \def\copyverbatimline{\egroup\endofdisplayverbatim}% + \else% + \presetnormalverbatimline% + \fi% + \fi% + \handleverbatimline% + \copyverbatimline}} + +%D The actual typesetting of a line is done by a separate +%D macro, which enables us to implement \TAB\ handling. The +%D \type{\do} and \type{\dodo} macros take care of the +%D preceding \type{\parskip}, while skipping the rest of the +%D first line. The \type{\relax} is used as an signal. + +%D \macros +%D {iflinepar} +%D +%D A careful reader will see that \type{\linepar} is reset. +%D This boolean can be used to determine if the current line is +%D the first line in a pseudo paragraph and this boolean is set +%D after each empty line. The \type{\relax} can be used to +%D determine the end of the line when one implements a scanner +%D routine. + +\newif\iflinepar + +\let\doopenupverbatimline=\empty + +\let\beginverbatimline\relax +\let\endverbatimline \relax + +\long\def\dodoverbatimline#1% we don't want to group + {\bgroup % due to pretty status + \iflinepar\else\EveryPar{}\fi + \dontleavehmode % \leavevmode + \xdef\dokeepverbatimlinedata % why was this? + {\parindent \the\parindent + \hangindent\the\hangindent + \hangafter \the\hangafter + \leftskip \the\leftskip + \rightskip \the\rightskip}% + \egroup + \dokeepverbatimlinedata + \doopenupverbatimline + \the\everyline\strut + \beginverbatimline + \processverbatimline{#1\relax\flushrestofverbatimline}% + \endverbatimline + \global\lineparfalse + \obeyedline\par} + +%D \macros +%D {flushrestofverbatimline} +%D +%D Some pretty drivers will collect tokens for the sake of +%D testing on keywords. This collected string needs to be +%D flushed. The \type {\relax} can serve as signal that there +%D is nothing more to be interpreted. + +\let\flushrestofverbatimline\empty + +%D \macros +%D {obeyemptylines,verbatimbaselineskip} +%D +%D Empty lines in verbatim can lead to white space on top of +%D a new page. Because this is not what we want, we turn +%D them into vertical skips. This default behavior can be +%D overruled by: +%D +%D \starttyping +%D \obeyemptylines +%D \stoptyping +%D +%D Although it would cost us only a few lines of code, we +%D decided not to take care of multiple empty lines. When a +%D (display) verbatim text contains more successive empty +%D lines, this probably suits some purpose. When applicable, +%D one can set the verbatim baselineskip. + +\bgroup +\catcode`\^^L=\@@active \gdef\emptypage {^^L} +\catcode`\^^M=\@@active \gdef\emptyline {^^M} + \gdef\emptyspace { } +\egroup + +\def\verbatimbaselineskip% We don't use \let here! + {\baselineskip} + +\def\doemptyverbatimline + {\vskip\verbatimbaselineskip + {\setbox0\hbox{\the\everyline}}% + \global\linepartrue} + +% \def\obeyemptylines +% {\let\donextemptyverbatimline\doemptyverbatimline} + +\def\obeyemptylines % tricky, only in verbatim (should be token list)! + {\chardef\verbatimemptylinemode\plusone} + +\def\obeyallemptylines % tricky, only in verbatim (should be token list)! + {\chardef\verbatimemptylinemode\plustwo} + +%D \TEX\ does not offer \type{\everyline}, which is a direct +%D result of its advanced multi||pass paragraph typesetting +%D mechanism. Because in verbatim mode paragraphs and lines are +%D more or less equal, we can easily implement our own simple +%D \type{\everyline} support. + +%D \macros +%D {EveryPar, EveryLine} +%D +%D In this module we've reserved \type{\everypar} for the +%D things to be done with paragraphs and \type{\everyline} for +%D line specific actions. In \CONTEXT\ however, we use +%D \type{\everypar} for placing side- and columnfloats, +%D inhibiting indentation and some other purposes. In verbatim +%D mode, every line becomes a paragraph, which means that +%D \type{\everypar} is executed frequently. To be sure, the +%D user specific use of both \type{\everyline} and +%D \type{\everypar} is implemented by means of +%D \type{\EveryLine} and \type{\EveryPar}. +%D +%D We still have to take care of the \TAB. A \TAB\ takes eight +%D spaces and a \SPACE\ normally has a width of 0.5~em. Because +%D we can be halfway a tabulation, we must keep track of the +%D position. This takes time, especially when we print complete +%D files, therefore we \type{\relax} this mechanism by default. + +\chardef\spacespertab=7 + +\def\doprocesstabskip + {\obeyedspace % \hskip.5em or \hbox to .5em{} + \ifdone + \donefalse + \advance\scratchcounter \plusone + \@EA\doprocesstabskip + \else\ifnum\scratchcounter>\spacespertab + % nothing + \else + \advance\scratchcounter \plusone + \@EAEAEA\doprocesstabskip + \fi\fi} + +\let\endoftabskipping=\relax % will become obsolete + +\def\doprocesstabskipline#1% + {\bgroup + \scratchcounter\plusone + \dodoprocesstabskipline#1\relax + \egroup} + +\def\dodoprocesstabskipline#1% + {\ifnum\scratchcounter>\spacespertab\relax + \donetrue \else \donefalse \advance + \fi \scratchcounter \plusone + \ifx#1\relax \else + \ifcase\tabskipmode + % can't happen + \or + % go on + \else\ifnum`#1<128 + % ok, no special character + \else\ifnum\catcode`#1=\active + % quits parsing, else utf lookahead problems + \chardef\tabskipmode\zerocount + \fi\fi\fi + \ifcase\tabskipmode + \@EAEAEA#1% + \else + \@EAEAEA#1\@EAEAEA\dodoprocesstabskipline + \fi + \fi} + +% ^ will be replaced + +\chardef\tabskipmode=1 % 0=quit 1=no test 2=test on active>128 + +\long\def\processverbatimline#1{#1} % remove the fake grouping + +%D \macros +%D {processfileverbatim} +%D +%D The verbatim typesetting of files is done on a bit different +%D basis. This time we don't check for a closing command, but +%D look for \EOF\ and when we've met, we make sure it does not +%D turn into an empty line. +%D +%D \starttyping +%D \processfileverbatim{filename} +%D \stoptyping +%D +%D We reserve a dedicated file handle. + +\newread\verbatiminput + +\newcount\verbatimlinenumber + +\let \beginofverbatimlines \relax +\let \endofverbatimlines \relax + +\def\processfileverbatim#1% + {\par + \bgroup + \processingverbatimtrue + \global\verbatimlinenumber\zerocount + \global\linepartrue + \beginofverbatimlines + \bgroup + \parindent\zeropoint + \ifdim\lastskip<\parskip + \removelastskip + \vskip\parskip + \fi + \parskip\zeropoint + \verbatimfont + \uncatcodecharacters + \setverbatimspaceskip + \frenchspacing + \obeyspaces + \obeytabs + \obeylines + \obeypages + \obeycharacters + \ignoreeofs + \catcode`\^^M=\@@ignore % \par is already taken care of +% \openin\verbatiminput=#1\relax + \openinputfile\verbatiminput{#1}% + \skipfirstverbatimlinefalse + \initializeverbatimline + \def\readline% + {\ifeof\verbatiminput \else + \ifx\firstverbatimfileline\empty + \global\advance\verbatimlinenumber\plusone + \read\verbatiminput to \verbatimline + \else + \let\verbatimline\firstverbatimfileline + \let\firstverbatimfileline\empty + \fi + \fi + \ifeof\verbatiminput + \ifx\lastverbatimfileline\empty + \presetlastverbatimline + \let\readline\relax + \else % we will re-enter the \ifeof branch twice + \presetnormalverbatimline + \def\readline% + {\let\verbatimline\lastverbatimfileline + \let\lastverbatimfileline\empty}% + \fi + \else\ifx\verbatimline\empty + \presetemptyverbatimline + \else\ifx\verbatimline\emptyline + \presetemptyverbatimline + \else\ifx\verbatimline\emptypage + \presetemptyverbatimline + \else + \presetnormalverbatimline + \fi\fi\fi\fi + \handleverbatimline + \readline}% + \ifeof\verbatiminput \else + \expandafter\readline + \fi + \closein\verbatiminput + \egroup + \endofverbatimlines + \egroup + \ignorespaces} + +%D Something new: + +\def\processfilelinesverbatim#1#2#3% + {\bgroup + \let\saveddoflushverbatimline\doflushverbatimline + \let\saveddoemptyverbatimline\doemptyverbatimline + \def\checkverbatimfileline##1% + {\ifnum\verbatimlinenumber<#2\else + \ifnum\verbatimlinenumber>#3\else + ##1% + \fi\fi}% + \def\doflushverbatimline + {\checkverbatimfileline\saveddoflushverbatimline}% + \def\doemptyverbatimline + {\checkverbatimfileline\saveddoemptyverbatimline}% + \processfileverbatim{#1}% + \egroup} + +%D \macros +%D {firstverbatimfileline, lastverbatimfileline} +%D +%D The following two macros can be set to achieve special +%D effects, like: +%D +%D \starttyping +%D \convertargument\StartFake{something}\to\firstverbatimfileline +%D \convertargument\StopFake\to\firstverbatimfileline +%D \stoptyping +%D +%D These hooks were needed for typesetting flowchart +%D definitions verbatim, since the temporary files does not +%D have the start and stop commands embedded. + +\let\firstverbatimfileline\empty +\let\lastverbatimfileline \empty + +%D One can use the different \type{\obeysomething} commands to +%D influence the behavior of these macro's. We use for instance +%D \type{\obeycharacters} for making \type{/} an active +%D character when we want to include typesetting commands. + +%D The next part of this module deals with pretty printing. The +%D best way to understand how pretty verbatim typeseting works +%D is to take a look at the output produced by the \TEX, \PERL\ +%D and \METAPOST\ modules first. Each of these modules has a +%D few setup macros that tag the individual characters with a +%D number that itself is associated to a interpretation macro. +%D A previous implementation linked characters (after making +%D them active) directly to such interpreters, but the more +%D indirect way makes it possible to inspect the next +%D character(s) without much expansion problems and/or +%D increasing run time. + +%D By the way, \TEX\ defines \type{\+} as an outer macro, so we +%D have to redefine this one to keep ourselves out of complaints. + +\def\+{\tabalign} + +%D Just to keep things consistant and to speed up some macros a +%D but, we define a few private constants. + +\def\!!PRETTY {PRETTY} + +\def\!!prettyone {prettyone} +\def\!!prettytwo {prettytwo} +\def\!!prettythree {prettythree} +\def\!!prettyfour {prettyfour} +\def\!!prettyfive {prettyfive} +\def\!!prettynine {prettynine} +\def\!!prettyeight {prettyeight} +\def\!!prettytwoone {prettytwoone} +\def\!!prettyfourthree {prettyfourthree} + +%D The first step in defining a pretty interpreter is to assign +%D each character that needs special attention a number, like: +%D +%D \starttyping +%D \setpretty \`A 21 +%D \stoptyping +%D +%D Here the macro \type{\setpretty} makes the character +%D \type{A} active, and sets it meaning to the auxiliary macro +%D \type{\handleprettytoken}. This auxiliary macro takes the +%D character code (a number) and the interpretation number. The +%D three step implementation uses the \TEX book \type{~} trick. + +\def\dodosetpretty + {\!!countb=\uccode`~\relax + \catcode\!!countb=\@@active + \uppercase{\edef~{\noexpand\handleprettytoken{\the\!!counta}{\the\!!countb}}}} + +\def\dosetpretty + {\afterassignment\dodosetpretty\!!counta} + +\def\setpretty + {\afterassignment\dosetpretty\uccode`~=} + +%D The macro \type{\handleprettytoken} is rather trivial and +%D calls for an interpreter macro. + +\def\handleprettytoken#1% + {\csname\!!PRETTY#1\endcsname} % \getvalue{\!!PRETTY#1}} + +%D This interpreter is installed by saying +%D +%D \starttyping +%D \installprettyhandler 21 \SOMEprettyone +%D \stoptyping + +\def\installprettyhandler#1 #2% + {\letvalue{\!!PRETTY#1}#2} + +%D Such an interpreter gets the character number: +%D +%D \starttyping +%D \def\SOMEprettyone#1{...\getpretty{#1}...} +%D \stoptyping +%D +%D where \type{\getpretty} equals \type{\char}. We can't +%D use \type{\let} here because we have to get rid of the +%D braces. + +\def\getpretty#1% + {\char#1} + +%D Sometimes the action depends on the next token. This token +%D can be passed to the macro \type{\getprettydata}, that sets +%D \type{\prettytype} to the interpreter code. The character +%D code is saved in \type{\prettychar}. + +\def\setprettydata#1#2% + {\global\chardef\prettytype#1% + \global\chardef\prettychar#2\relax} + +\def\getprettydata#1% + {\global\chardef\prettytype\zerocount + \global\chardef\prettychar\zerocount + \bgroup + \let\handleprettytoken\setprettydata + \setbox0\hbox{#1}% expands #1 and ignores space + \egroup} + +%D If needed the current and next token can be handled alongside: + +\def\getpretties#1#2% + {\char#1\bgroup\let\handleprettytoken\getsecondpretty#2\egroup} + +\def\getsecondpretty#1#2% + {\char#2} + +%D When needed, one can reassign an interpreter by using +%D \type{\newpretty} and its associates. +%D +%D \bgroup +%D \setuptyping[file][optionoptie=tex,paletpalet=colorpretty] +%D +%D \startbuffer +%D \bgroup +%D \catcode`\|=\@@escape %%\|\ +%D \catcode`\\=\@@active %%\\+ +%D |gdef|dohandlenewpretty#1% +%D {|def|dodohandlenewpretty##1% +%D {|def|oldprettychar{#1}% +%D |getprettydata{##1}% +%D |ifnum|oldprettychar=|prettychar +%D |def|dododohandlenewpretty####1% +%D {|getprettydata{\}% +%D |let|oldprettytype=|prettytype +%D |getprettydata{####1}% +%D |ifnum|prettytype=|oldprettytype +%D |let|next=|newpretty +%D |else +%D |def|next{|newprettycommand{#1}##1####1}% +%D |fi +%D |next}% +%D |let|next=|dododohandlenewpretty +%D |else +%D |def|next{|newprettycommand{#1}##1}% +%D |fi +%D |next}% +%D |def|donohandlenewpretty##1% +%D {|newprettycommand{#1}##1}% +%D |handlenextnextpretty|dodohandlenewpretty|donohandlenewpretty} +%D |egroup +%D \stopbuffer +%D +%D {\newprettytrue\typebuffer} +%D +%D In this example we see that the colors differ from what we +%D expect, but conform the definitions in the macro. This kind +%D of recoloring can be achieved by saying: +%D +%D \typebuffer +%D +%D We'll show some more examples: +%D +%D \startbuffer[pretty] +%D \installnewpretty r \red +%D \installnewpretty g \green +%D \installnewpretty b \blue +%D \stopbuffer +%D +%D \getbuffer[pretty] +%D +%D \startbuffer +%D %%\ r{Red +%D %%\ g\Green +%D %%\ b[Blue +%D \stopbuffer +%D +%D {\newprettytrue\typebuffer} +%D +%D Watch the green \type{\Green}! This lines are specified as: +%D +%D \typebuffer +%D +%D along with: +%D +%D \typebuffer[pretty] +%D +%D When needed, one can use grouping. +%D +%D \startbuffer +%D {yes} %%\ B %%\{[ %%\}] +%D {no} +%D {no} %%\ E +%D {yes} +%D \stopbuffer +%D +%D \typebuffer +%D +%D Here we tell the visualizer that the \type +{+ should be +%D treated like a \type +[+ so we get: +%D +%D {\newprettytrue\typebuffer} +%D +%D I won't explain the details of this mechanism. Those who +%D want to build their own pretty interpreters have to close +%D read the source anyway. +%D +%D Last we show an example of mixed pretty typesetting: +%D +%D \startbuffer +%D \ziezo{test} %%\ P ##\ B##\ T % enter PERL mode %%\ E +%D if $test eq "test" ##\ B ##\ B##\ T % begin group (\bgroup) %%\ E +%D if $test eq "test"; ##\ T %%\ B%%\ T % enter TEX mode %%\ E +%D \ziezo{test} %%\ M %%\ B%%\ T % enter METAPOST mode %%\ E +%D draw (0,0)--(10,10); %%\ E ##\ B##\ T % end group (\egroup) %%\ E +%D if $test eq "test"; +%D \stopbuffer +%D +%D \typebuffer +%D +%D Here we use \type{%%\ T}, \type{%%\ P} and \type{%%\ M} for +%D switching between \TEX, \PERL\ and \METAPOST\ mode. +%D +%D {\newprettytrue\typebuffer} +%D +%D \egroup +%D +%D Don't forget to set: + +\newif\ifnewpretty + +\def\installnewpretty + {\def\doinstallnewpretty##1% + {\setvalue{NP::\the\scratchcounter}{##1}}% + \afterassignment\doinstallnewpretty\scratchcounter=`} + +%D Let's define the options we used here: + +\newevery\everyprettyend\relax + +\let\prettyend=\relax + +\def\prettybegin + {\bgroup\def\prettyend{\the\everyprettyend\egroup}} + +\installnewpretty B \prettybegin +\installnewpretty E \prettyend + +\installnewpretty J \setupprettyJVtype +\installnewpretty M \setupprettyMPtype +\installnewpretty P \setupprettyPLtype +\installnewpretty T \setupprettyTEXtype + +%D \macros +%D {ifnaturaltextext} +%D +%D When one uses \ETEX, switching to normal \TEX\ is possible +%D too. We also introduce a switch that can be used in the +%D drivers and set in higher level shell macros. + +\newif\ifnaturaltextext + +% \starttyping +% test /naturaltextext\hpos{word}{test}/relax test +% \stoptyping +% +% \MPxy{word} + +\def\naturaltextext#1\relax + {\bgroup + \prettynaturalfont{\restorecatcodes\scantokens{\ignorespaces#1}}% + \egroup} + +\def\naturaltextext#1\relax + {\bgroup + \def\ascii{#1}% + \setnormalcatcodes + \restorecatcodes + \prettynaturalfont{\scantokens\expandafter{\ascii}\ifhmode\unskip\fi}% + \egroup} + +\installnewpretty N \naturaltextext + +%D When seen in action this gives: +%D +%D \startbuffer +%D \startTEX +%D \def\mathematics#1% %%\ N usage: \type {\mathematics{x^2}} +%D {\ifmmode#1\else$#1$\fi} %%\ N becomes: \mathematics{X^2} +%D \stopTEX +%D \stopbuffer +%D +%D \getbuffer +%D +%D This is keyed in as: +%D +%D \typebuffer + +%D This means that when the interpreter modules support this +%D mechanism, by default we have some keys already available. + +\def\newpretty#1% + {\getprettydata{#1}% + \ifcase\prettytype + \expandafter\nonewpretty + \else + \expandafter\donewpretty + \fi + #1} + +\def\nonewpretty#1#2% + {\getprettydata{#2}% + \getvalue{NP::\the\prettychar}} + +\def\donewpretty#1% + {\bgroup + \def\handleprettytoken##1##2##3% + {\getprettydata{##3}% + \egroup + \ifcase\prettytype\else + \setpretty##2=\prettytype\relax + \fi}% + #1} + +%D When implementing new pretty macros, one only needs to +%D define something like: +%D +%D \starttyping +%D \def\TEXtypezero% +%D {\handlenewpretty\TEXtypethree} +%D \stoptyping +%D +%D Here the number states the category (in our examples the +%D backslash). The second argument takes care of normal +%D situations. + +\def\handlenewpretty#1% + {\let\newprettycommand=#1% + \handlenextnextpretty\dohandlenewpretty\newprettycommand} + +%D The previous shown implementation only interprets single +%D comments, but the final one also accepts double ones. The +%D main reason for this is that in \JAVA\ we have to deal with +%D \type{//}. Personally I prefer the double \type{%%} because +%D is stands out and is more symmetrical with the double +%D slash. + +\bgroup +\catcode`\|=\@@escape +\catcode`\\=\@@active +|gdef|dohandlenewpretty#1% + {|def|dodohandlenewpretty##1% + {|def|oldprettychar{#1}% + |getprettydata{##1}% + |ifnum|oldprettychar=|prettychar + |def|dododohandlenewpretty####1% + {|getprettydata{\}% + |let|oldprettytype=|prettytype + |getprettydata{####1}% + |ifnum|prettytype=|oldprettytype + |let|next|newpretty + |else + |def|next{|newprettycommand{#1}##1####1}% + |fi + |next}% + |let|next|dododohandlenewpretty + |else + |def|next{|newprettycommand{#1}##1}% + |fi + |next}% + |def|donohandlenewpretty##1% + {|newprettycommand{#1}##1}% + |handlenextnextpretty|dodohandlenewpretty|donohandlenewpretty} +|egroup + +%D The `nextnext' macro we used in the previous definition +%D looks ahead. This is needed because individual lines are +%D handles by macro's and the next character can be something +%D that ends the line and/or does not belong to the verbatim +%D data. + +\def\handlenextnextpretty#1#2#3% + {\def\dohandlenextnextpretty% + {\ifx\next\bgroup % something {} + \@EA#2% + \else\ifx\next\relax % end of line / signal + \@EAEAEA#2% + \else + \@EAEAEA#1% + \fi\fi + {#3}}% + \futurelet\next\dohandlenextnextpretty} + +%D The pretty interpreters can (and will) change the meaning of +%D some controls. To enable them calling the originals we save +%D their meanings and to enable nesting we permit this only +%D once. + +\def\saveprettycontrols + {\global\let\oldobeyedspace \obeyedspace + \global\let\oldobeyedline \obeyedline + \global\let\oldobeyedpage \obeyedpage + \let\saveprettycontrols \relax} + +%D The \PERL\ and \METAPOST\ interpreters will also handle +%D reserved words. Sets of identifiers are defined like: +%D +%D \starttyping +%D \useprettyidentifiers \MODULAidentifiers \MODULAsetspecials +%D if then else elsif case while do repeat until ... +%D \stoptyping +%D +%D New entries can be added to existing sets by repeatedly +%D using this command. + +\def\useprettyidentifiers#1#2% \variable \presetcatcodes + {\bgroup + \ifx#1\undefined + \global\let#1=\empty + \fi + \def\handleprettytoken##1##2{\char##2}% + #2\relax + \def\douseprettyidentifiers##1\par% + {\xdef#1{\space#1\space##1}% + \egroup}% + \douseprettyidentifiers} + +%D We can test om identifiers with: + +\def\doifprettyidentifierelse#1% + {\doifincsnameelse{\space#1\space}} + +%D \macros +%D {prettyidentifierfont,prettyvariablefont,prettynaturalfont} +%D +%D When one want to typeset identifiers and system variables +%D in a different typeface, one has to set the next two +%D variables. + +\let\prettyidentifierfont=\relax +\let\prettyvariablefont =\relax +\let\prettynaturalfont =\relax + +%D The interpreter macros are loaded at run time. The main +%D reason lays in the fact that we don't want to have the +%D identifier lists hard coded in the format file. To prevent +%D repetitive loading, one should load the modules before the +%D first call to the macros. +%D +%D \starttyping +%D \input verb-tex.tex +%D \input verb-pl.tex +%D \input verb-mp.tex +%D \input verb-jv.tex +%D \stoptyping +%D +%D In \CONTEXT\ we follow a different thread, and therefore all +%D macros in the additional modules use \type {\gdef}'s and +%D \type {\doglobal}'s. Manipulating \type {\globaldef} is +%D possible but leads to fuzzy situations. + +%D \macros +%D {ifdisablepretty,disableprettynow,disableprettyafterwards} +%D +%D Although for pretty printing \PERL\ and \JAVASCRIPT\ code +%D one has to implement a bit more clever mechanism, the next +%D switches can be used to turn off pretty printing. The +%D boolean turns on this feature. + +\newif\ifdisablepretty \disableprettyfalse +\newif\ifprettydisabled \prettydisabledfalse + +\def\disableprettynow + {\ifdisablepretty\ifprettydisabled\else + \let\prettyidentifierfont\relax + \let\prettyvariablefont\relax + \let\prettycomment\relax + \def\beginofpretty[##1]{}% + \let\endofpretty\relax + \prettydisabledtrue + \fi\fi} + +\def\disableprettyafterwards + {\ifdisablepretty\ifprettydisabled\else + \def\endofpretty{\normalendofpretty\disableprettynow}% + \fi\fi} + +\def\enableprettynow + {\prettydisabledfalse + \let\prettyidentifierfont\normalprettyidentifierfont + \let\prettyvariablefont \normalprettyvariablefont + \let\prettynaturalfont \normalprettynaturalfont + \let\beginofpretty \normalbeginofpretty + \let\endofpretty \normalendofpretty} + +%D This feature is hooked into the verbatim line handling +%D routine with: + +\def\beginverbatimline + {\prettydisabledfalse + \ifnewpretty\else\let\handlenewpretty\empty\fi % moved + \let\normalprettyidentifierfont\prettyidentifierfont + \let\normalprettyvariablefont \prettyvariablefont + \let\normalprettynaturalfont \prettynaturalfont + \let\normalbeginofpretty \beginofpretty + \let\normalendofpretty \endofpretty} + +\def\endverbatimline + {\enableprettynow} + +%D The rest of this module is dedicated to non \CONTEXT\ users +%D and shows an example of an verbatim environment based on the +%D previous macros. +%D +%D The macro's can be used to construct the commands we +%D mentioned in the beginning of this documentation. We leave +%D this to the fantasy of the reader and only show some \PLAIN\ +%D \TEX\ alternatives for display verbatim and listings. We +%D define three commands for typesetting inline text, display +%D text and files verbatim. The inline alternative also accepts +%D user supplied delimiters. +%D +%D +%D \type{text} +%D +%D \starttyping +%D ... verbatim text ... +%D \stoptyping +%D +%D \typefile{filename} +%D +%D We can turn on the options by: +%D +%D \starttyping +%D \controlspacetrue +%D \verbatimtabstrue +%D \prettyverbatimtrue +%D \stoptyping +%D +%D Here is the implementation: + +\newif\ifcontrolspace +\newif\ifverbatimtabs +\newif\ifprettyverbatim + +\ifCONTEXT \else + + \def\presettyping + {\ifcontrolspace \let\obeyspace \setcontrolspace \fi + \ifverbatimtabs \let\obeytabs \settabskips \fi + \ifprettyverbatim \let\obeycharacters\setupprettytype \fi} + + \def\type + {\bgroup + \def\_{\string_}% + \def\^{\string^}% + \presettyping + \processinlineverbatim\egroup} + + \def\starttyping + {\bgroup + \presettyping + \processdisplayverbatim\stoptyping} + + \def\stoptyping + {\egroup} + + \def\typefile#1% + {\bgroup + \presettyping + \processfileverbatim{#1}% + \egroup} + +\fi + +%D In \CONTEXT\ users say things like: +%D +%D \starttyping +%D \definetyping [TEX] [option=TEX] +%D \definetyping [MP] [option=MP] +%D \definetyping [PL] [option=PL] +%D \definetyping [JV] [option=JV] +%D \stoptyping +%D +%D or +%D +%D \starttyping +%D \setuptyping[file][option=color] +%D \stoptyping +%D +%D That way \CONTEXT\ selects the appropriate interpreter +%D itself, but more on that in another module. In other +%D packages one can define: + +\ifCONTEXT \else + + \input verb-tex + \input verb-mp + \input verb-pl + \input verb-jv + \input verb-sql + + \def\startTEX + {\bgroup \everypar{}% + \let\obeycharacters\setupprettyTEXtype + \processdisplayverbatim{\stopTEX}} + + \def\startMP + {\bgroup \everypar{}% + \let\obeycharacters\setupprettyMPtype + \processdisplayverbatim{\stopMP}} + + \def\startPL + {\bgroup \everypar{}% + \let\obeycharacters\setupprettyPLtype + \processdisplayverbatim{\stopPL}} + + \def\startJV + {\bgroup \everypar{}% + \let\obeycharacters\setupprettyJVtype + \processdisplayverbatim{\stopJV}} + + \def\startSQL + {\bgroup \everypar{}% + \let\obeycharacters\setupprettySQLtype + \processdisplayverbatim{\stopSQL}} + + \let\stopTEX=\egroup + \let\stopMP =\egroup + \let\stopPL =\egroup + \let\stopJV =\egroup + \let\stopSQL=\egroup + +\fi + +%D This following poor mans implementation of color is based on +%D PostScript. One can of course use grayscales too. In the +%D core modules these macros are redefined to using the color +%D mechanism present in \CONTEXT. + +\ifCONTEXT \else + + \def\setcolorverbatim + {\def\prettyone {.9 .0 .0 } % red + \def\prettytwo {.0 .8 .0 } % green + \def\prettythree {.0 .0 .9 } % blue + \def\prettyfour {.8 .8 .6 } % yellow + \def\beginofpretty[##1]% + {\special{ps:: \csname##1\endcsname setrgbcolor}} + \def\endofpretty% + {\special{ps:: 0 0 0 setrgbcolor}}} % black + + \def\setgrayverbatim + {\def\prettyone {.30 } % gray + \def\prettytwo {.45 } % gray + \def\prettythree {.60 } % gray + \def\prettyfour {.75 } % gray + \def\beginofpretty[##1]% + {\special{ps:: \csname##1\endcsname setgray}} + \def\endofpretty% + {\special{ps:: 0 setgray}}} % black + +\fi + +%D One can redefine these two commands after loading this +%D module. When available, one can also use appropriate +%D font||switch macro's. We default to color. + +\ifCONTEXT \else \setcolorverbatim \fi + +%D Here come the commands that are responsible for entering and +%D leaving the two states. As we can see, they've got much in +%D common. + +%D The previous version of this module was published in the +%D \MAPS\ of the dutch \TEX\ users group \NTG. In that article, +%D the verbatim part of the text was typeset with the following +%D commands for the examples: +%D +%D \starttyping +%D \def\starttyping% We simplify the \ConTeXt\ macro. +%D {\bgroup +%D \everypar{} % We disable some troublesome mechanisms. +%D \advance\leftskip by 1em +%D \processdisplayverbatim{\stoptyping}} +%D +%D \let\stoptyping=\egroup +%D \stoptyping +%D +%D We also used: +%D +%D \starttyping +%D \def\startdefinition% +%D {\bgroup +%D \everypar{} % Again we disable some troublesome mechanisms. +%D \let\obeycharacters=\setupprettyTEXtype % See verb-tex.tex! +%D \EveryPar{\showparagraphcounter}% +%D \EveryLine{\showlinecounter}% +%D \verbatimbodyfont +%D \processdisplayverbatim{\stopdefinition}} +%D +%D \def\stopdefinition% +%D {\egroup} +%D \stoptyping +%D +%D And because we have both \type{\EveryPar} and +%D \type{\EveryLine} available, we can implement a dual +%D numbering mechanism: +%D +%D \starttyping +%D \newcount\paragraphcounter +%D \newcount\linecounter +%D +%D \def\showparagraphcounter% +%D {\llap +%D {\bgroup +%D \counterfont +%D \hbox to 4em +%D {\global\advance\paragraphcounter by 1 +%D \hss \the\paragraphcounter \hskip2em}% +%D \egroup +%D \hskip1em}} +%D +%D \def\showlinecounter% +%D {\llap +%D {\bgroup +%D \counterfont +%D \hbox to 2em +%D {\global\advance\linecounter by 1 +%D \hss \the\linecounter}% +%D \egroup +%D \hskip1em}} +%D \stoptyping +%D +%D One may have noticed that the \type{\EveryPar} is only +%D executed once, because we consider each piece of verbatim +%D as one paragraph. When one wants to take the empty lines +%D into account, the following assignments are appropriate: +%D +%D \starttyping +%D \EveryLine +%D {\iflinepar +%D \showparagraphcounter +%D \fi +%D \showlinecounter} +%D \stoptyping +%D +%D In this case, nothing has to be assigned to \type{\EveryPar}, +%D maybe except of just another extra numbering scheme. The +%D macros used to typeset this documentation are a bit more +%D complicated, because we have to take take 'long' margin +%D lists into account. When such a list exceeds the previous +%D pargraph we postpone placement of the paragraph number till +%D there's room. This way so it does not clash with the margin +%D words. + +%D Normally such commands have to be embedded in a decent setup +%D structure, where options can be set at will. +%D +%D Now let's summarize the most important commands. +%D +%D \starttyping +%D \processinlineverbatim{\closingcommand} +%D \processdisplayverbatim{\closingcommand} +%D \processfileverbatim{filename} +%D \stoptyping +%D +%D We can satisfy our own specific needs with the following +%D interfacing macro's: +%D +%D \starttyping +%D \obeyspaces \obeytabs \obeylines \obeypages \obeycharacters +%D \stoptyping +%D +%D We can influence the verbatim environment with the following +%D macro: +%D +%D \starttyping +%D \obeyemptylines +%D \stoptyping +%D +%D Some needs are fulfilled already with: +%D +%D \starttyping +%D \setcontrolspace \settabskips +%D \stoptyping +%D +%D lines can be enhanced with ornaments using: +%D +%D \starttyping +%D \everypar \everyline \iflinepar +%D \stoptyping +%D +%D and pretty verbatim support is implemented by: +%D +%D \starttyping +%D \beginofpretty[#1] ... \endofpretty +%D \stoptyping +%D +%D and some setup macro, like: +%D +%D \starttyping +%D \setupprettyIDENTIFIERtype +%D \stoptyping +%D +%D The color support macro can be redefined by the user. The +%D parameter \type{#1} can be one of the four 'fixed' +%D identifiers {\em prettyone}, {\em prettytwo}, {\em +%D prettythree} and {\em prettyfour}. We have implemented a +%D more or less general PostScript color support mechanism, +%D using \type{specials}. One can toggle between color and +%D grayscale with: +%D +%D \starttyping +%D \setgrayverbatim \setcolorverbatim +%D \stoptyping + +%D \macros +%D {permitshiftedendofverbatim} +%D +%D We did not mention one drawback of the mechanism described +%D here. The closing command must start at the first position +%D of the line. In \CONTEXT\ we will not have this drawback, +%D because we can test if the end command is a substring of the +%D current line. The testing is done by two of the support +%D macros, which of course are not available in a stand alone +%D application of this module. + +\ifCONTEXT + + \let\doifendofverbatim=\doifelse + + \def\permitshiftedendofverbatim + {\let\doifendofverbatim\doifinstringelse} + + {\obeylines% + \long\gdef\copyverbatimline#1 + {\convertargument#1 \to\next% + \gdef\verbatimline{#1}% + \ifx\next\emptyspace% + \presetemptyverbatimline% + \else% + \doifendofverbatim{\endofverbatimcommand}{\next}% + {\presetlastverbatimline% + \def\copyverbatimline{\egroup\endofdisplayverbatim}}% + {\presetnormalverbatimline}% + \fi% + \handleverbatimline% + \copyverbatimline}} + +%D As a bonus, we provide the next alternative, which takes +%D end tags like \type {Hello World!}. + + \def\doprocessdisplayverbatim#1#2% + {\par + \beginofverbatimlines + \bgroup + \escapechar-1 + \xdef\verbatimname{\string#2}% + \egroup + \ifcase#1% + \let\endofdisplayverbatim\relax + \else + \def\endofdisplayverbatim{\endofverbatimlines\csname\verbatimname\endcsname}% + \fi + \bgroup + \parindent\zeropoint + \ifdim\lastskip<\parskip + \removelastskip + \vskip\parskip + \fi + \parskip\zeropoint + \processingverbatimtrue + \ifcase#1% + \convertargument#2\to\endofverbatimcommand + \else + \expandafter\let\csname\verbatimname\endcsname=\relax + \expandafter\convertargument\csname\verbatimname\endcsname + \to\endofverbatimcommand + \fi + \verbatimfont + \setverbatimspaceskip + \global\linepartrue % needed for paragraph numbering + \setupcopyverbatim + \initializeverbatimline + \copyverbatimline} + + \def\processdisplayverbatim {\doprocessdisplayverbatim1} + \def\processtaggeddisplayverbatim{\doprocessdisplayverbatim0} + +\fi + +%D \macros +%D {installprettyescape} +%D +%D The next feature is dedicated to Fabrice Popineau who +%D wanted math inside verbatim. + +\def\prettyescapecnt{255} + +\def\installprettyescape + {\dodoubleempty\doinstallprettyescape} + +\def\doinstallprettyescape[#1][#2]#3 #4% + {\bgroup + \doglobal\decrement\prettyescapecnt + \def\docommand##1% + {\def\next{\dodoinstallprettyescape{##1}{#3}{#4}}% + \catcode`#3=\@@active + \@EA\scantokens\@EA{\next}}% + \iffirstargument + \processcommalist[#1]\docommand + \else + \docommand\empty + \fi} + +\def\dodoinstallprettyescape#1#2#3% + {\unexpanded\setgvalue{PRETTY@#1@\prettyescapecnt}##1##2#2{#3{##2}}% + \expanded % we need to freeze the counter + {\doglobal\noexpand\appendtoks + \noexpand\doif{#1}\noexpand\prettyidentifier + {\noexpand\setpretty`\string#2=\prettyescapecnt + \noexpand\installprettyhandler \prettyescapecnt\space\getvalue{PRETTY@#1@\prettyescapecnt}}% + }\to \everysetupverbatim + \egroup} + +%D An example of its usage is: +%D +%D \startbuffer +%D \def\xverbatimmath#1#2{\naturaltextext\mathematics{#1}\relax} +%D \def\yverbatimmath#1#2{\naturaltextext\mathematics{[[#1]]}\relax} +%D \def\zverbatimmath#1#2{\naturaltextext\mathematics{(#1)}\relax} +%D +%D \installprettyescape [MP] $ \xverbatimmath +%D \installprettyescape [MP] ~ \yverbatimmath +%D \installprettyescape [MP] * \zverbatimmath +%D +%D \startMP +%D if $x>10$ : +%D $x := 20$ +%D ~x := 20~ +%D *x := 20* +%D end +%D \stopMP +%D \stopbuffer +%D +%D \typebuffer \getbuffer + +\protect \endinput diff --git a/tex/context/base/verb-ini.tex b/tex/context/base/verb-ini.tex deleted file mode 100644 index 4726d0eac..000000000 --- a/tex/context/base/verb-ini.tex +++ /dev/null @@ -1,1810 +0,0 @@ -%D \module -%D [ file=verb-ini, -%D version=1997.12.22, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Initialization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Today I would implement the pretty handler slightly -%D different, using stack and intermediate flushing. Maybe -%D even without active chars. So, someday \unknown. Also -%D I think that there are better ways (the current approach -%D is an accumulation; for instance, we could save a second -%D argument by turning chars into numbers and vise versa. - -%D Because this module is quite independant of system macros, -%D it can be used as a stand||alone verbatim environment. -%D -%D This is a sort of second release of \type{supp-ver} and -%D therefore differs in some aspects from the implementation -%D published in the \MAPS. The first change concern -%D optimization of breaks, that is, the first and last two -%D lines of verbatim blocks are kept together. The second -%D adaption is due to the fact that I wanted to support pretty -%D printing not only for \TEX\ sources, but also for \PERL, -%D \METAPOST\ and probably more. The \JAVASCRIPT\ module is -%D closely related to \PERL, so we will not mention that one -%D again. - -\ifx \undefined \writestatus \input supp-mis.tex \fi - -%D Verbatim typesetting, especially of \TEX\ sources, is a -%D non||trivial task. This is a direct results of the fact that -%D characters can have \CATCODES\ other than~11 and such -%D characters needs a special treatment. What for instance is -%D \TEX\ supposed to do when it encounters a \type{$} or an -%D \type{#}? This module deals with these matters. - -\writestatus{loading}{ConTeXt Verbatim Macros / Initialization} - -%D The verbatim environment has some features, like coloring -%D \TEX\ text, seldom found in other environments. Especially -%D when the output of \TEX\ is viewed on an electronic medium, -%D coloring has a positive influence on the readability of -%D \TEX\ sources, so we found it very acceptable to dedicate -%D half of this module to typesetting \TEX\ specific character -%D sequences in color. In this module we'll also present some -%D macro's for typesetting inline, display and file verbatim. -%D The macro's are capable of handling \TAB\ too. -%D -%D This module shows a few tricks that are often overseen by -%D novice, like the use of the \TEX\ primitive \type{\meaning}. -%D First I'll show in what way the users are confronted with -%D verbatim typesetting. Because we want to be able to test for -%D symmetry and because we hate the method of closing down the -%D verbatim mode with some strange active character, we will -%D use the following construction for display verbatim: -%D -%D \starttyping -%D The Dutch word 'typen' stands for 'typing', therefore in the Dutch version -%D one will not find the word 'verbatim'. -%D \stoptyping -%D -%D In \CONTEXT\ files can be typed with \type{\typefile} and -%D inline verbatim can be accomplished with \type{\type}. This -%D last command comes in many flavors: -%D -%D \starttyping -%D We can say \type<> or \type{something}. The first one is a bit -%D longer but also supports slanted typing, which accomplished by typing -%D \type<> word>>. We can also use commands to enhance the text -%D \type<> text>>. Just to be complete, we decided -%D to accept also \LaTeX\ alike verbatim, which means that \type+something+ -%D and \type|something| are valid commands too. Of course we want the grouped -%D alternatives to process \type{hello {\bf big} world} with braces. -%D \stoptyping -%D -%D In the core modules, we will build this support on top of -%D this module. There these commands can be tuned with -%D accompanying setup commands. There we can enable commands, -%D slanted typing, control spaces, \TAB||handling and (here we -%D are:) coloring. We can also setup surrounding white space -%D and indenting. Here we'll only show some examples. - -\unprotect - -%D \macros -%D {verbatimfont} -%D -%D When we are typesetting verbatim we use a non||proportional -%D (mono spaced) font. Normally this font is available by -%D calling \type{\tt}. In \CONTEXT\ this command does a -%D complete font||style switch. There we could have stuck with -%D \type{\tttf}. - -\ifx\verbatimfont\undefined \def\verbatimfont{\tt\normalnoligatures\font} \fi - -\ifx\normalnoligatures\undefined \let\normalnoligatures\gobbleoneargument \fi - -%D \macros -%D {obeyedspace, obeyedtab, obeyedline, obeyedpage} -%D -%D We have followed Knuth in naming macros that make \SPACE, -%D \NEWLINE\ and \NEWPAGE\ active and assigning them -%D \type{\obeysomething}, but first we set some default values. - -\def\obeyedspace {\hbox{ }} -\def\obeyedtab {\obeyedspace} -\def\obeyedline {\par} -\def\obeyedpage {\vfill\eject} - -%D Because we will introduce a status variable, we can define -%D a better \type {\obeyedspace}. - -\def\obeyedspace {\ifprocessingverbatim\hbox{ }\else\space\fi} - -%D \macros -%D {controlspace,setcontrolspaces} -%D -%D First we define \type{\obeyspaces}. When we want visible -%D spaces (control spaces) we only have to adapt the definition -%D of \type{\obeyedspace} to: - -\def\controlspace{\hbox{\char32}} -\def\normalspace { } -\def\normalspaces{\catcode`\ =\@@space} - -\bgroup -\catcode`\ =\@@active -\gdef\obeyspaces{\catcode`\ =\@@active\def {\obeyedspace}} -\gdef\setcontrolspaces{\catcode`\ =\@@active\def {\controlspace}} -\egroup - -%D \macros -%D {obeytabs, obeylines, obeypages, -%D ignoretabs, ignorelines, ignorepages} -%D -%D Next we take care of \NEWLINE\ and \NEWPAGE\ and because we -%D want to be able to typeset listings that contain \TAB, we -%D have to handle those too. Because we have to redefine the -%D \NEWPAGE\ character locally, we redefine the meaning of -%D this (often already) active character. - -\catcode`\^^L=\@@active \def^^L{\par} - -%D The following indirect definitions enable us to implement -%D all kind of \type{\obeyed} handlers. - -\bgroup - -\catcode`\^^I=\@@active -\catcode`\^^M=\@@active -\catcode`\^^L=\@@active - -\gdef\obeytabs {\catcode`\^^I=\@@active\def^^I{\obeyedtab}} -\gdef\obeylines {\catcode`\^^M=\@@active\def^^M{\obeyedline}} -\gdef\obeypages {\catcode`\^^L=\@@active\def^^L{\obeyedpage}} - -\gdef\ignoretabs {\catcode`\^^I=\@@active\def^^I{\obeyedspace}} -\gdef\ignorelines {\catcode`\^^M=\@@active\def^^M{\obeyedspace}} -\gdef\ignorepages {\catcode`\^^L=\@@ignore} % \@@active\def^^L{\obeyedline}} -\gdef\ignoreeofs {\catcode`\^^Z=\@@ignore} - -%D For testing (see digit parser) we need an indirect macro -%D in order to compare the next (\type {\next}) token -%D (possibly \type {^^M}) being \type {\obeyedline}. - -\gdef\nextobeyedline{\obeyedline} - -\egroup - -%D \macros -%D {obeycharacters} -%D -%D We also predefine \type{\obeycharacters}, which will -%D enable us to implement character||specific behavior, like -%D colored verbatim. - -\let\obeycharacters=\relax - -%D \macros -%D {settabskips} -%D -%D The macro \type{\settabskip} can be used to enable tab -%D handling. Processing tabs is sometimes needed when one -%D processes a plain \ASCII\ listing. Tab handling slows down -%D verbatim typesetting considerably. - -\bgroup - -\catcode`\^^I=\@@active - -\gdef\settabskips - {\let\processverbatimline\doprocesstabskipline - \catcode`\^^I\@@active - \let^^I\doprocesstabskip} - -\gdef\setfixedtabskips#1% - {\catcode`\^^I\@@active - \def^^I{\kern#1\spaceskip}} - -\egroup - -%D \macros -%D {processingverbatim} -%D -%D Typesetting a file in most cases results in more than one -%D page. Because we don't want problems with files that are -%D read in during the construction of the page, we set \type -%D {\ifprocessingverbatim}, so the output routine can adapt -%D its behavior. Originally we used \type {\scratchread}, but -%D because we want to support nesting, we decided to use a -%D separate input file. - -\newif\ifprocessingverbatim - -%D \macros -%D {processinlineverbatim} -%D -%D Although the inline verbatim commands presented here will be -%D extended and embedded in the core modules of \CONTEXT, -%D they can be used separately. Both grouped and character -%D alternatives are provided but \type{<<} and nested -%D braces are implemented in the core module. This commands -%D takes one argument: the closing command. -%D -%D \starttyping -%D \processinlineverbatim{\closingcommand} -%D \stoptyping -%D -%D One can define his own verbatim commands, which can be very -%D simple: -%D -%D \starttyping -%D \def\Verbatim {\processinlineverbatim\relax} -%D \stoptyping -%D -%D or a bit more more complex: -%D -%D \starttyping -%D \def\GroupedVerbatim% -%D {\bgroup -%D \dosomeusefullthings -%D \processinlineverbatim\egroup} -%D \stoptyping -%D -%D Before entering inline verbatim mode, we take care of the -%D unwanted \TAB, \NEWLINE\ and \NEWPAGE\ characters and -%D turn them into \SPACE. We need the double \type{\bgroup} -%D construction to keep the closing command local. - -\def\setverbatimspaceskip - {\setbox\scratchbox\hbox{x}% - \spaceskip\wd\scratchbox - \xspaceskip\spaceskip} - -\def\setupinlineverbatim - {\verbatimfont - \setverbatimspaceskip - \let\obeytabs\ignoretabs - \let\obeylines\ignorelines - \let\obeypages\ignorepages - \setupcopyverbatim} - -\def\doprocessinlineverbatim - {\ifx\next\bgroup - \setupinlineverbatim - \catcode`\{\@@begingroup - \catcode`\}\@@endgroup - \def\next{\let\next=}% - \else - \setupinlineverbatim - \def\next##1{\catcode`##1=\@@endgroup}% - \fi - \next} - -\def\processinlineverbatim#1% - {\bgroup - \processingverbatimtrue - \localcatcodestrue % TeX processes paragraph's - \def\endofverbatimcommand{#1\egroup}% - \bgroup - \aftergroup\endofverbatimcommand - \futurelet\next\doprocessinlineverbatim} - -%D The closing command is executed afterwards as an internal -%D command and therefore should not be given explicitly when -%D typesetting inline verbatim. - -%D \macros -%D {optimizeverbatim} -%D -%D One day, a collegue asked me why I didn't prevent breaking -%D after a first or before a last verbatim line. At first sight -%D I thought of using the two pass mechanism, but because we're -%D already keeping track of individual lines, a more direct -%D solution is possible: we just keep track of in what line -%D we are. One can turn this feature off. - -\newif\ifoptimizeverbatim \optimizeverbatimtrue - -%D Before we implement display and file verbatim, we define -%D some macros that deal with typesetting the individual lines. -%D We keep track of the status by means of a character -%D specification. This status variable tells us if we're -%D skipping a first line or placing a first or last line. -%D The next few examples show us where breaks are inserted. -%D -%D \bgroup -%D -%D \def\doverbatimnobreak -%D {\nobreak\hrule width 10cm\par\penalty500} % == \nobreak -%D -%D \def\doverbatimgoodbreak -%D {\nobreak\hrule width 3cm \par\penalty\linepenalty} -%D -%D \starttyping -%D test -%D test -%D \stoptyping -%D -%D or -%D -%D \starttyping -%D test -%D test -%D test -%D test -%D \stoptyping -%D -%D or -%D -%D \starttyping -%D test -%D -%D test -%D test -%D test -%D \stoptyping -%D -%D \egroup -%D -%D The long ones are \type{\nobreaks} and the short ones -%D \type{\goodbreaks}. And this is how it's done: - -\def\doverbatimnobreak - {\ifoptimizeverbatim\penalty500 \fi} - -\def\doverbatimgoodbreak - {\ifoptimizeverbatim\penalty\linepenalty\fi} - -\def\doflushverbatimline - {\expandafter\dodoverbatimline\expandafter{\savedverbatimline}} - -\def\doverbatimbeginofline#1% linenumber (optional provided by mkiv / todo) - {\dontleavehmode - \strut - \the\everyline} - -\def\doverbatimendofline - {\par} - -\def\doverbatimemptyline - {\strut - \par} - -\let\handleverbatimline=\relax - -% \def\initializeverbatimline% -% {\global\let\savedverbatimline=\empty -% \ifskipfirstverbatimline -% \global\chardef\verbatimstatus=0 -% \else -% \global\chardef\verbatimstatus=1 -% \fi} -% -% more efficient - -\global\chardef\verbatimstatus0 - -\def\initializeverbatimline - {\global\let\savedverbatimline\empty - \global\chardef\verbatimstatus\ifskipfirstverbatimline0 \else1 \fi} - -\chardef\verbatimemptylinemode\zerocount - -\def\presetemptyverbatimline - {\ifcase\verbatimstatus - \global\chardef\verbatimstatus\plusone - \or - \ifcase\verbatimemptylinemode\or\or - \doemptyverbatimline - \fi - \or - \ifcase\verbatimemptylinemode\else - \doemptyverbatimline - \fi - \or - \doflushverbatimline - \global\let\savedverbatimline\empty - \doemptyverbatimline - \global\chardef\verbatimstatus\plustwo - \else - \kern\zeropoint - \doverbatimnobreak - \doflushverbatimline - \global\let\savedverbatimline\empty - \doemptyverbatimline - \global\chardef\verbatimstatus\plustwo - \fi} - -\def\presetnormalverbatimline - {\ifcase\verbatimstatus - \global\chardef\verbatimstatus\plustwo - \or - \global\chardef\verbatimstatus\plusthree - \or - \global\chardef\verbatimstatus\plusthree - \or - \doflushverbatimline - \global\chardef\verbatimstatus\plusfour - \or - \kern\zeropoint - \doverbatimnobreak - \doflushverbatimline - \global\chardef\verbatimstatus\plusfive - \or - \doverbatimgoodbreak - \doflushverbatimline - \fi - \global\let\savedverbatimline\verbatimline} - -\def\presetlastverbatimline - {\ifcase \verbatimstatus - \or - \or - \or - \doflushverbatimline - \else - \kern \zeropoint - \doverbatimnobreak - \doflushverbatimline - \fi - \ifcase\verbatimemptylinemode\or\else - \kern \zeropoint - \fi} - -%D \macros -%D {skipfirstverbatimline} -%D -%D By default the rest of the first line is ignored. We can -%D turn this feature off by saying: -%D -%D \starttyping -%D \skipfirstverbatimlinefalse -%D \stoptyping - -\newif\ifskipfirstverbatimline \skipfirstverbatimlinetrue - -%D \macros -%D {processdisplayverbatim} -%D -%D We can define a display verbatim environment with the -%D command \type{\processdisplayverbatim} in the following way: -%D -%D \starttyping -%D \processdisplayverbatim{\closingcommand} -%D \stoptyping -%D -%D \noindent For instance, we can define a simple command like: -%D -%D \starttyping -%D \def\BeginVerbatim {\processdisplayverbatim{EndVerbatim}} -%D \stoptyping -%D -%D \noindent But we can also do more advance things like: -%D -%D \starttyping -%D \def\BeginVerbatim {\bigskip \processdisplayverbatim{\EndVerbatim}} -%D \def\EndVerbatim {\bigskip} -%D \stoptyping -%D -%D When we compare these examples, we see that the backslash in -%D the closing command is optional. One is free in actually -%D defining a closing command. If one is defined, the command -%D is executed after ending verbatim mode. - -\def\processdisplayverbatim#1% - {\par - \bgroup - \escapechar=-1 - \xdef\verbatimname{\string#1}% - \egroup - \def\endofdisplayverbatim{\csname\verbatimname\endcsname}% - \bgroup - \parindent\zeropoint - \ifdim\lastskip<\parskip - \removelastskip - \vskip\parskip - \fi - \parskip\zeropoint - \processingverbatimtrue - \global\linepartrue - \expandafter\let\csname\verbatimname\endcsname\relax - \edef\endofverbatimcommand{\csname\verbatimname\endcsname}% - \edef\endofverbatimcommand{\meaning\endofverbatimcommand}% - \verbatimfont - \setverbatimspaceskip - \global\linepartrue % needed for paragraph numbering - \setupcopyverbatim - \initializeverbatimline - \copyverbatimline} - -%D We save the closing sequence in \type{\endofverbatimcommand} -%D in such a way that it can be compared on a line by line -%D basis. For the conversion we use \type{\meaning}, which -%D converts the line to non||expandable tokens. We reset -%D \type{\parskip}, because we don't want inter||paragraph -%D skips to creep into the verbatim source. Furthermore we -%D \type{\relax} the line||processing macro while getting the -%D rest of the first line. The initialization command -%D \type{\setupcopyverbatim} does just what we expect it to do: -%D it assigns all characters \CATCODE~11. Next we switch to -%D french spacing and call for obeyance. - -\newevery \everysetupverbatim \relax - -\def\setupcopyverbatim - {\uncatcodecharacters - \frenchspacing - \obeyspaces - \obeytabs - \obeylines - \obeypages - \obeycharacters - \the\everysetupverbatim} - -%D The main copying routine of display verbatim does an -%D ordinary string||compare on the saved closing command and -%D the current line. The space after \type{#1} in the -%D definition of \type{\next} is essential! As a result of -%D using \type{\obeylines}, we have to use \type{%}'s after -%D each line but none after the first \type{#1}. - -{\obeylines% - \long\gdef\copyverbatimline#1 - {\def\next{#1 }% - \gdef\verbatimline{#1}% - \ifx\next\emptyspace% - \presetemptyverbatimline% - \else% - \edef\next{\meaning\next}% - \ifx\next\endofverbatimcommand% - \presetlastverbatimline% - \def\copyverbatimline{\egroup\endofdisplayverbatim}% - \else% - \presetnormalverbatimline% - \fi% - \fi% - \handleverbatimline% - \copyverbatimline}} - -%D The actual typesetting of a line is done by a separate -%D macro, which enables us to implement \TAB\ handling. The -%D \type{\do} and \type{\dodo} macros take care of the -%D preceding \type{\parskip}, while skipping the rest of the -%D first line. The \type{\relax} is used as an signal. - -%D \macros -%D {iflinepar} -%D -%D A careful reader will see that \type{\linepar} is reset. -%D This boolean can be used to determine if the current line is -%D the first line in a pseudo paragraph and this boolean is set -%D after each empty line. The \type{\relax} can be used to -%D determine the end of the line when one implements a scanner -%D routine. - -\newif\iflinepar - -\let\doopenupverbatimline=\empty - -\let\beginverbatimline\relax -\let\endverbatimline \relax - -\long\def\dodoverbatimline#1% we don't want to group - {\bgroup % due to pretty status - \iflinepar\else\EveryPar{}\fi - \dontleavehmode % \leavevmode - \xdef\dokeepverbatimlinedata % why was this? - {\parindent \the\parindent - \hangindent\the\hangindent - \hangafter \the\hangafter - \leftskip \the\leftskip - \rightskip \the\rightskip}% - \egroup - \dokeepverbatimlinedata - \doopenupverbatimline - \the\everyline\strut - \beginverbatimline - \processverbatimline{#1\relax\flushrestofverbatimline}% - \endverbatimline - \global\lineparfalse - \obeyedline\par} - -%D \macros -%D {flushrestofverbatimline} -%D -%D Some pretty drivers will collect tokens for the sake of -%D testing on keywords. This collected string needs to be -%D flushed. The \type {\relax} can serve as signal that there -%D is nothing more to be interpreted. - -\let\flushrestofverbatimline\empty - -%D \macros -%D {obeyemptylines,verbatimbaselineskip} -%D -%D Empty lines in verbatim can lead to white space on top of -%D a new page. Because this is not what we want, we turn -%D them into vertical skips. This default behavior can be -%D overruled by: -%D -%D \starttyping -%D \obeyemptylines -%D \stoptyping -%D -%D Although it would cost us only a few lines of code, we -%D decided not to take care of multiple empty lines. When a -%D (display) verbatim text contains more successive empty -%D lines, this probably suits some purpose. When applicable, -%D one can set the verbatim baselineskip. - -\bgroup -\catcode`\^^L=\@@active \gdef\emptypage {^^L} -\catcode`\^^M=\@@active \gdef\emptyline {^^M} - \gdef\emptyspace { } -\egroup - -\def\verbatimbaselineskip% We don't use \let here! - {\baselineskip} - -\def\doemptyverbatimline - {\vskip\verbatimbaselineskip - {\setbox0\hbox{\the\everyline}}% - \global\linepartrue} - -% \def\obeyemptylines -% {\let\donextemptyverbatimline\doemptyverbatimline} - -\def\obeyemptylines % tricky, only in verbatim (should be token list)! - {\chardef\verbatimemptylinemode\plusone} - -\def\obeyallemptylines % tricky, only in verbatim (should be token list)! - {\chardef\verbatimemptylinemode\plustwo} - -%D \TEX\ does not offer \type{\everyline}, which is a direct -%D result of its advanced multi||pass paragraph typesetting -%D mechanism. Because in verbatim mode paragraphs and lines are -%D more or less equal, we can easily implement our own simple -%D \type{\everyline} support. - -%D \macros -%D {EveryPar, EveryLine} -%D -%D In this module we've reserved \type{\everypar} for the -%D things to be done with paragraphs and \type{\everyline} for -%D line specific actions. In \CONTEXT\ however, we use -%D \type{\everypar} for placing side- and columnfloats, -%D inhibiting indentation and some other purposes. In verbatim -%D mode, every line becomes a paragraph, which means that -%D \type{\everypar} is executed frequently. To be sure, the -%D user specific use of both \type{\everyline} and -%D \type{\everypar} is implemented by means of -%D \type{\EveryLine} and \type{\EveryPar}. -%D -%D We still have to take care of the \TAB. A \TAB\ takes eight -%D spaces and a \SPACE\ normally has a width of 0.5~em. Because -%D we can be halfway a tabulation, we must keep track of the -%D position. This takes time, especially when we print complete -%D files, therefore we \type{\relax} this mechanism by default. - -\chardef\spacespertab=7 - -\def\doprocesstabskip - {\obeyedspace % \hskip.5em or \hbox to .5em{} - \ifdone - \donefalse - \advance\scratchcounter \plusone - \@EA\doprocesstabskip - \else\ifnum\scratchcounter>\spacespertab - % nothing - \else - \advance\scratchcounter \plusone - \@EAEAEA\doprocesstabskip - \fi\fi} - -\let\endoftabskipping=\relax % will become obsolete - -\def\doprocesstabskipline#1% - {\bgroup - \scratchcounter\plusone - \dodoprocesstabskipline#1\relax - \egroup} - -\def\dodoprocesstabskipline#1% - {\ifnum\scratchcounter>\spacespertab\relax - \donetrue \else \donefalse \advance - \fi \scratchcounter \plusone - \ifx#1\relax \else - \ifcase\tabskipmode - % can't happen - \or - % go on - \else\ifnum`#1<128 - % ok, no special character - \else\ifnum\catcode`#1=\active - % quits parsing, else utf lookahead problems - \chardef\tabskipmode\zerocount - \fi\fi\fi - \ifcase\tabskipmode - \@EAEAEA#1% - \else - \@EAEAEA#1\@EAEAEA\dodoprocesstabskipline - \fi - \fi} - -% ^ will be replaced - -\chardef\tabskipmode=1 % 0=quit 1=no test 2=test on active>128 - -\long\def\processverbatimline#1{#1} % remove the fake grouping - -%D \macros -%D {processfileverbatim} -%D -%D The verbatim typesetting of files is done on a bit different -%D basis. This time we don't check for a closing command, but -%D look for \EOF\ and when we've met, we make sure it does not -%D turn into an empty line. -%D -%D \starttyping -%D \processfileverbatim{filename} -%D \stoptyping -%D -%D We reserve a dedicated file handle. - -\newread\verbatiminput - -\newcount\verbatimlinenumber - -\let \beginofverbatimlines \relax -\let \endofverbatimlines \relax - -\def\processfileverbatim#1% - {\par - \bgroup - \processingverbatimtrue - \global\verbatimlinenumber\zerocount - \global\linepartrue - \beginofverbatimlines - \bgroup - \parindent\zeropoint - \ifdim\lastskip<\parskip - \removelastskip - \vskip\parskip - \fi - \parskip\zeropoint - \verbatimfont - \uncatcodecharacters - \setverbatimspaceskip - \frenchspacing - \obeyspaces - \obeytabs - \obeylines - \obeypages - \obeycharacters - \ignoreeofs - \catcode`\^^M=\@@ignore % \par is already taken care of -% \openin\verbatiminput=#1\relax - \openinputfile\verbatiminput{#1}% - \skipfirstverbatimlinefalse - \initializeverbatimline - \def\readline% - {\ifeof\verbatiminput \else - \ifx\firstverbatimfileline\empty - \global\advance\verbatimlinenumber\plusone - \read\verbatiminput to \verbatimline - \else - \let\verbatimline\firstverbatimfileline - \let\firstverbatimfileline\empty - \fi - \fi - \ifeof\verbatiminput - \ifx\lastverbatimfileline\empty - \presetlastverbatimline - \let\readline\relax - \else % we will re-enter the \ifeof branch twice - \presetnormalverbatimline - \def\readline% - {\let\verbatimline\lastverbatimfileline - \let\lastverbatimfileline\empty}% - \fi - \else\ifx\verbatimline\empty - \presetemptyverbatimline - \else\ifx\verbatimline\emptyline - \presetemptyverbatimline - \else\ifx\verbatimline\emptypage - \presetemptyverbatimline - \else - \presetnormalverbatimline - \fi\fi\fi\fi - \handleverbatimline - \readline}% - \ifeof\verbatiminput \else - \expandafter\readline - \fi - \closein\verbatiminput - \egroup - \endofverbatimlines - \egroup - \ignorespaces} - -%D Something new: - -\def\processfilelinesverbatim#1#2#3% - {\bgroup - \let\saveddoflushverbatimline\doflushverbatimline - \let\saveddoemptyverbatimline\doemptyverbatimline - \def\checkverbatimfileline##1% - {\ifnum\verbatimlinenumber<#2\else - \ifnum\verbatimlinenumber>#3\else - ##1% - \fi\fi}% - \def\doflushverbatimline - {\checkverbatimfileline\saveddoflushverbatimline}% - \def\doemptyverbatimline - {\checkverbatimfileline\saveddoemptyverbatimline}% - \processfileverbatim{#1}% - \egroup} - -%D \macros -%D {firstverbatimfileline, lastverbatimfileline} -%D -%D The following two macros can be set to achieve special -%D effects, like: -%D -%D \starttyping -%D \convertargument\StartFake{something}\to\firstverbatimfileline -%D \convertargument\StopFake\to\firstverbatimfileline -%D \stoptyping -%D -%D These hooks were needed for typesetting flowchart -%D definitions verbatim, since the temporary files does not -%D have the start and stop commands embedded. - -\let\firstverbatimfileline\empty -\let\lastverbatimfileline \empty - -%D One can use the different \type{\obeysomething} commands to -%D influence the behavior of these macro's. We use for instance -%D \type{\obeycharacters} for making \type{/} an active -%D character when we want to include typesetting commands. - -%D The next part of this module deals with pretty printing. The -%D best way to understand how pretty verbatim typeseting works -%D is to take a look at the output produced by the \TEX, \PERL\ -%D and \METAPOST\ modules first. Each of these modules has a -%D few setup macros that tag the individual characters with a -%D number that itself is associated to a interpretation macro. -%D A previous implementation linked characters (after making -%D them active) directly to such interpreters, but the more -%D indirect way makes it possible to inspect the next -%D character(s) without much expansion problems and/or -%D increasing run time. - -%D By the way, \TEX\ defines \type{\+} as an outer macro, so we -%D have to redefine this one to keep ourselves out of complaints. - -\def\+{\tabalign} - -%D Just to keep things consistant and to speed up some macros a -%D but, we define a few private constants. - -\def\!!PRETTY {PRETTY} - -\def\!!prettyone {prettyone} -\def\!!prettytwo {prettytwo} -\def\!!prettythree {prettythree} -\def\!!prettyfour {prettyfour} -\def\!!prettyfive {prettyfive} -\def\!!prettynine {prettynine} -\def\!!prettyeight {prettyeight} -\def\!!prettytwoone {prettytwoone} -\def\!!prettyfourthree {prettyfourthree} - -%D The first step in defining a pretty interpreter is to assign -%D each character that needs special attention a number, like: -%D -%D \starttyping -%D \setpretty \`A 21 -%D \stoptyping -%D -%D Here the macro \type{\setpretty} makes the character -%D \type{A} active, and sets it meaning to the auxiliary macro -%D \type{\handleprettytoken}. This auxiliary macro takes the -%D character code (a number) and the interpretation number. The -%D three step implementation uses the \TEX book \type{~} trick. - -\def\dodosetpretty - {\!!countb=\uccode`~\relax - \catcode\!!countb=\@@active - \uppercase{\edef~{\noexpand\handleprettytoken{\the\!!counta}{\the\!!countb}}}} - -\def\dosetpretty - {\afterassignment\dodosetpretty\!!counta} - -\def\setpretty - {\afterassignment\dosetpretty\uccode`~=} - -%D The macro \type{\handleprettytoken} is rather trivial and -%D calls for an interpreter macro. - -\def\handleprettytoken#1% - {\csname\!!PRETTY#1\endcsname} % \getvalue{\!!PRETTY#1}} - -%D This interpreter is installed by saying -%D -%D \starttyping -%D \installprettyhandler 21 \SOMEprettyone -%D \stoptyping - -\def\installprettyhandler#1 #2% - {\letvalue{\!!PRETTY#1}#2} - -%D Such an interpreter gets the character number: -%D -%D \starttyping -%D \def\SOMEprettyone#1{...\getpretty{#1}...} -%D \stoptyping -%D -%D where \type{\getpretty} equals \type{\char}. We can't -%D use \type{\let} here because we have to get rid of the -%D braces. - -\def\getpretty#1% - {\char#1} - -%D Sometimes the action depends on the next token. This token -%D can be passed to the macro \type{\getprettydata}, that sets -%D \type{\prettytype} to the interpreter code. The character -%D code is saved in \type{\prettychar}. - -\def\setprettydata#1#2% - {\global\chardef\prettytype#1% - \global\chardef\prettychar#2\relax} - -\def\getprettydata#1% - {\global\chardef\prettytype\zerocount - \global\chardef\prettychar\zerocount - \bgroup - \let\handleprettytoken\setprettydata - \setbox0\hbox{#1}% expands #1 and ignores space - \egroup} - -%D If needed the current and next token can be handled alongside: - -\def\getpretties#1#2% - {\char#1\bgroup\let\handleprettytoken\getsecondpretty#2\egroup} - -\def\getsecondpretty#1#2% - {\char#2} - -%D When needed, one can reassign an interpreter by using -%D \type{\newpretty} and its associates. -%D -%D \bgroup -%D \setuptyping[file][optionoptie=tex,paletpalet=colorpretty] -%D -%D \startbuffer -%D \bgroup -%D \catcode`\|=\@@escape %%\|\ -%D \catcode`\\=\@@active %%\\+ -%D |gdef|dohandlenewpretty#1% -%D {|def|dodohandlenewpretty##1% -%D {|def|oldprettychar{#1}% -%D |getprettydata{##1}% -%D |ifnum|oldprettychar=|prettychar -%D |def|dododohandlenewpretty####1% -%D {|getprettydata{\}% -%D |let|oldprettytype=|prettytype -%D |getprettydata{####1}% -%D |ifnum|prettytype=|oldprettytype -%D |let|next=|newpretty -%D |else -%D |def|next{|newprettycommand{#1}##1####1}% -%D |fi -%D |next}% -%D |let|next=|dododohandlenewpretty -%D |else -%D |def|next{|newprettycommand{#1}##1}% -%D |fi -%D |next}% -%D |def|donohandlenewpretty##1% -%D {|newprettycommand{#1}##1}% -%D |handlenextnextpretty|dodohandlenewpretty|donohandlenewpretty} -%D |egroup -%D \stopbuffer -%D -%D {\newprettytrue\typebuffer} -%D -%D In this example we see that the colors differ from what we -%D expect, but conform the definitions in the macro. This kind -%D of recoloring can be achieved by saying: -%D -%D \typebuffer -%D -%D We'll show some more examples: -%D -%D \startbuffer[pretty] -%D \installnewpretty r \red -%D \installnewpretty g \green -%D \installnewpretty b \blue -%D \stopbuffer -%D -%D \getbuffer[pretty] -%D -%D \startbuffer -%D %%\ r{Red -%D %%\ g\Green -%D %%\ b[Blue -%D \stopbuffer -%D -%D {\newprettytrue\typebuffer} -%D -%D Watch the green \type{\Green}! This lines are specified as: -%D -%D \typebuffer -%D -%D along with: -%D -%D \typebuffer[pretty] -%D -%D When needed, one can use grouping. -%D -%D \startbuffer -%D {yes} %%\ B %%\{[ %%\}] -%D {no} -%D {no} %%\ E -%D {yes} -%D \stopbuffer -%D -%D \typebuffer -%D -%D Here we tell the visualizer that the \type +{+ should be -%D treated like a \type +[+ so we get: -%D -%D {\newprettytrue\typebuffer} -%D -%D I won't explain the details of this mechanism. Those who -%D want to build their own pretty interpreters have to close -%D read the source anyway. -%D -%D Last we show an example of mixed pretty typesetting: -%D -%D \startbuffer -%D \ziezo{test} %%\ P ##\ B##\ T % enter PERL mode %%\ E -%D if $test eq "test" ##\ B ##\ B##\ T % begin group (\bgroup) %%\ E -%D if $test eq "test"; ##\ T %%\ B%%\ T % enter TEX mode %%\ E -%D \ziezo{test} %%\ M %%\ B%%\ T % enter METAPOST mode %%\ E -%D draw (0,0)--(10,10); %%\ E ##\ B##\ T % end group (\egroup) %%\ E -%D if $test eq "test"; -%D \stopbuffer -%D -%D \typebuffer -%D -%D Here we use \type{%%\ T}, \type{%%\ P} and \type{%%\ M} for -%D switching between \TEX, \PERL\ and \METAPOST\ mode. -%D -%D {\newprettytrue\typebuffer} -%D -%D \egroup -%D -%D Don't forget to set: - -\newif\ifnewpretty - -\def\installnewpretty - {\def\doinstallnewpretty##1% - {\setvalue{NP::\the\scratchcounter}{##1}}% - \afterassignment\doinstallnewpretty\scratchcounter=`} - -%D Let's define the options we used here: - -\newevery\everyprettyend\relax - -\let\prettyend=\relax - -\def\prettybegin - {\bgroup\def\prettyend{\the\everyprettyend\egroup}} - -\installnewpretty B \prettybegin -\installnewpretty E \prettyend - -\installnewpretty J \setupprettyJVtype -\installnewpretty M \setupprettyMPtype -\installnewpretty P \setupprettyPLtype -\installnewpretty T \setupprettyTEXtype - -%D \macros -%D {ifnaturaltextext} -%D -%D When one uses \ETEX, switching to normal \TEX\ is possible -%D too. We also introduce a switch that can be used in the -%D drivers and set in higher level shell macros. - -\newif\ifnaturaltextext - -% \starttyping -% test /naturaltextext\hpos{word}{test}/relax test -% \stoptyping -% -% \MPxy{word} - -\def\naturaltextext#1\relax - {\bgroup - \prettynaturalfont{\restorecatcodes\scantokens{\ignorespaces#1}}% - \egroup} - -\def\naturaltextext#1\relax - {\bgroup - \def\ascii{#1}% - \setnormalcatcodes - \restorecatcodes - \prettynaturalfont{\scantokens\expandafter{\ascii}\ifhmode\unskip\fi}% - \egroup} - -\installnewpretty N \naturaltextext - -%D When seen in action this gives: -%D -%D \startbuffer -%D \startTEX -%D \def\mathematics#1% %%\ N usage: \type {\mathematics{x^2}} -%D {\ifmmode#1\else$#1$\fi} %%\ N becomes: \mathematics{X^2} -%D \stopTEX -%D \stopbuffer -%D -%D \getbuffer -%D -%D This is keyed in as: -%D -%D \typebuffer - -%D This means that when the interpreter modules support this -%D mechanism, by default we have some keys already available. - -\def\newpretty#1% - {\getprettydata{#1}% - \ifcase\prettytype - \expandafter\nonewpretty - \else - \expandafter\donewpretty - \fi - #1} - -\def\nonewpretty#1#2% - {\getprettydata{#2}% - \getvalue{NP::\the\prettychar}} - -\def\donewpretty#1% - {\bgroup - \def\handleprettytoken##1##2##3% - {\getprettydata{##3}% - \egroup - \ifcase\prettytype\else - \setpretty##2=\prettytype\relax - \fi}% - #1} - -%D When implementing new pretty macros, one only needs to -%D define something like: -%D -%D \starttyping -%D \def\TEXtypezero% -%D {\handlenewpretty\TEXtypethree} -%D \stoptyping -%D -%D Here the number states the category (in our examples the -%D backslash). The second argument takes care of normal -%D situations. - -\def\handlenewpretty#1% - {\let\newprettycommand=#1% - \handlenextnextpretty\dohandlenewpretty\newprettycommand} - -%D The previous shown implementation only interprets single -%D comments, but the final one also accepts double ones. The -%D main reason for this is that in \JAVA\ we have to deal with -%D \type{//}. Personally I prefer the double \type{%%} because -%D is stands out and is more symmetrical with the double -%D slash. - -\bgroup -\catcode`\|=\@@escape -\catcode`\\=\@@active -|gdef|dohandlenewpretty#1% - {|def|dodohandlenewpretty##1% - {|def|oldprettychar{#1}% - |getprettydata{##1}% - |ifnum|oldprettychar=|prettychar - |def|dododohandlenewpretty####1% - {|getprettydata{\}% - |let|oldprettytype=|prettytype - |getprettydata{####1}% - |ifnum|prettytype=|oldprettytype - |let|next|newpretty - |else - |def|next{|newprettycommand{#1}##1####1}% - |fi - |next}% - |let|next|dododohandlenewpretty - |else - |def|next{|newprettycommand{#1}##1}% - |fi - |next}% - |def|donohandlenewpretty##1% - {|newprettycommand{#1}##1}% - |handlenextnextpretty|dodohandlenewpretty|donohandlenewpretty} -|egroup - -%D The `nextnext' macro we used in the previous definition -%D looks ahead. This is needed because individual lines are -%D handles by macro's and the next character can be something -%D that ends the line and/or does not belong to the verbatim -%D data. - -\def\handlenextnextpretty#1#2#3% - {\def\dohandlenextnextpretty% - {\ifx\next\bgroup % something {} - \@EA#2% - \else\ifx\next\relax % end of line / signal - \@EAEAEA#2% - \else - \@EAEAEA#1% - \fi\fi - {#3}}% - \futurelet\next\dohandlenextnextpretty} - -%D The pretty interpreters can (and will) change the meaning of -%D some controls. To enable them calling the originals we save -%D their meanings and to enable nesting we permit this only -%D once. - -\def\saveprettycontrols - {\global\let\oldobeyedspace \obeyedspace - \global\let\oldobeyedline \obeyedline - \global\let\oldobeyedpage \obeyedpage - \let\saveprettycontrols \relax} - -%D The \PERL\ and \METAPOST\ interpreters will also handle -%D reserved words. Sets of identifiers are defined like: -%D -%D \starttyping -%D \useprettyidentifiers \MODULAidentifiers \MODULAsetspecials -%D if then else elsif case while do repeat until ... -%D \stoptyping -%D -%D New entries can be added to existing sets by repeatedly -%D using this command. - -\def\useprettyidentifiers#1#2% \variable \presetcatcodes - {\bgroup - \ifx#1\undefined - \global\let#1=\empty - \fi - \def\handleprettytoken##1##2{\char##2}% - #2\relax - \def\douseprettyidentifiers##1\par% - {\xdef#1{\space#1\space##1}% - \egroup}% - \douseprettyidentifiers} - -%D We can test om identifiers with: - -\def\doifprettyidentifierelse#1% - {\doifincsnameelse{\space#1\space}} - -%D \macros -%D {prettyidentifierfont,prettyvariablefont,prettynaturalfont} -%D -%D When one want to typeset identifiers and system variables -%D in a different typeface, one has to set the next two -%D variables. - -\let\prettyidentifierfont=\relax -\let\prettyvariablefont =\relax -\let\prettynaturalfont =\relax - -%D The interpreter macros are loaded at run time. The main -%D reason lays in the fact that we don't want to have the -%D identifier lists hard coded in the format file. To prevent -%D repetitive loading, one should load the modules before the -%D first call to the macros. -%D -%D \starttyping -%D \input verb-tex.tex -%D \input verb-pl.tex -%D \input verb-mp.tex -%D \input verb-jv.tex -%D \stoptyping -%D -%D In \CONTEXT\ we follow a different thread, and therefore all -%D macros in the additional modules use \type {\gdef}'s and -%D \type {\doglobal}'s. Manipulating \type {\globaldef} is -%D possible but leads to fuzzy situations. - -%D \macros -%D {ifdisablepretty,disableprettynow,disableprettyafterwards} -%D -%D Although for pretty printing \PERL\ and \JAVASCRIPT\ code -%D one has to implement a bit more clever mechanism, the next -%D switches can be used to turn off pretty printing. The -%D boolean turns on this feature. - -\newif\ifdisablepretty \disableprettyfalse -\newif\ifprettydisabled \prettydisabledfalse - -\def\disableprettynow - {\ifdisablepretty\ifprettydisabled\else - \let\prettyidentifierfont\relax - \let\prettyvariablefont\relax - \let\prettycomment\relax - \def\beginofpretty[##1]{}% - \let\endofpretty\relax - \prettydisabledtrue - \fi\fi} - -\def\disableprettyafterwards - {\ifdisablepretty\ifprettydisabled\else - \def\endofpretty{\normalendofpretty\disableprettynow}% - \fi\fi} - -\def\enableprettynow - {\prettydisabledfalse - \let\prettyidentifierfont\normalprettyidentifierfont - \let\prettyvariablefont \normalprettyvariablefont - \let\prettynaturalfont \normalprettynaturalfont - \let\beginofpretty \normalbeginofpretty - \let\endofpretty \normalendofpretty} - -%D This feature is hooked into the verbatim line handling -%D routine with: - -\def\beginverbatimline - {\prettydisabledfalse - \ifnewpretty\else\let\handlenewpretty\empty\fi % moved - \let\normalprettyidentifierfont\prettyidentifierfont - \let\normalprettyvariablefont \prettyvariablefont - \let\normalprettynaturalfont \prettynaturalfont - \let\normalbeginofpretty \beginofpretty - \let\normalendofpretty \endofpretty} - -\def\endverbatimline - {\enableprettynow} - -%D The rest of this module is dedicated to non \CONTEXT\ users -%D and shows an example of an verbatim environment based on the -%D previous macros. -%D -%D The macro's can be used to construct the commands we -%D mentioned in the beginning of this documentation. We leave -%D this to the fantasy of the reader and only show some \PLAIN\ -%D \TEX\ alternatives for display verbatim and listings. We -%D define three commands for typesetting inline text, display -%D text and files verbatim. The inline alternative also accepts -%D user supplied delimiters. -%D -%D -%D \type{text} -%D -%D \starttyping -%D ... verbatim text ... -%D \stoptyping -%D -%D \typefile{filename} -%D -%D We can turn on the options by: -%D -%D \starttyping -%D \controlspacetrue -%D \verbatimtabstrue -%D \prettyverbatimtrue -%D \stoptyping -%D -%D Here is the implementation: - -\newif\ifcontrolspace -\newif\ifverbatimtabs -\newif\ifprettyverbatim - -\ifCONTEXT \else - - \def\presettyping - {\ifcontrolspace \let\obeyspace \setcontrolspace \fi - \ifverbatimtabs \let\obeytabs \settabskips \fi - \ifprettyverbatim \let\obeycharacters\setupprettytype \fi} - - \def\type - {\bgroup - \def\_{\string_}% - \def\^{\string^}% - \presettyping - \processinlineverbatim\egroup} - - \def\starttyping - {\bgroup - \presettyping - \processdisplayverbatim\stoptyping} - - \def\stoptyping - {\egroup} - - \def\typefile#1% - {\bgroup - \presettyping - \processfileverbatim{#1}% - \egroup} - -\fi - -%D In \CONTEXT\ users say things like: -%D -%D \starttyping -%D \definetyping [TEX] [option=TEX] -%D \definetyping [MP] [option=MP] -%D \definetyping [PL] [option=PL] -%D \definetyping [JV] [option=JV] -%D \stoptyping -%D -%D or -%D -%D \starttyping -%D \setuptyping[file][option=color] -%D \stoptyping -%D -%D That way \CONTEXT\ selects the appropriate interpreter -%D itself, but more on that in another module. In other -%D packages one can define: - -\ifCONTEXT \else - - \input verb-tex - \input verb-mp - \input verb-pl - \input verb-jv - \input verb-sql - - \def\startTEX - {\bgroup \everypar{}% - \let\obeycharacters\setupprettyTEXtype - \processdisplayverbatim{\stopTEX}} - - \def\startMP - {\bgroup \everypar{}% - \let\obeycharacters\setupprettyMPtype - \processdisplayverbatim{\stopMP}} - - \def\startPL - {\bgroup \everypar{}% - \let\obeycharacters\setupprettyPLtype - \processdisplayverbatim{\stopPL}} - - \def\startJV - {\bgroup \everypar{}% - \let\obeycharacters\setupprettyJVtype - \processdisplayverbatim{\stopJV}} - - \def\startSQL - {\bgroup \everypar{}% - \let\obeycharacters\setupprettySQLtype - \processdisplayverbatim{\stopSQL}} - - \let\stopTEX=\egroup - \let\stopMP =\egroup - \let\stopPL =\egroup - \let\stopJV =\egroup - \let\stopSQL=\egroup - -\fi - -%D This following poor mans implementation of color is based on -%D PostScript. One can of course use grayscales too. In the -%D core modules these macros are redefined to using the color -%D mechanism present in \CONTEXT. - -\ifCONTEXT \else - - \def\setcolorverbatim - {\def\prettyone {.9 .0 .0 } % red - \def\prettytwo {.0 .8 .0 } % green - \def\prettythree {.0 .0 .9 } % blue - \def\prettyfour {.8 .8 .6 } % yellow - \def\beginofpretty[##1]% - {\special{ps:: \csname##1\endcsname setrgbcolor}} - \def\endofpretty% - {\special{ps:: 0 0 0 setrgbcolor}}} % black - - \def\setgrayverbatim - {\def\prettyone {.30 } % gray - \def\prettytwo {.45 } % gray - \def\prettythree {.60 } % gray - \def\prettyfour {.75 } % gray - \def\beginofpretty[##1]% - {\special{ps:: \csname##1\endcsname setgray}} - \def\endofpretty% - {\special{ps:: 0 setgray}}} % black - -\fi - -%D One can redefine these two commands after loading this -%D module. When available, one can also use appropriate -%D font||switch macro's. We default to color. - -\ifCONTEXT \else \setcolorverbatim \fi - -%D Here come the commands that are responsible for entering and -%D leaving the two states. As we can see, they've got much in -%D common. - -%D The previous version of this module was published in the -%D \MAPS\ of the dutch \TEX\ users group \NTG. In that article, -%D the verbatim part of the text was typeset with the following -%D commands for the examples: -%D -%D \starttyping -%D \def\starttyping% We simplify the \ConTeXt\ macro. -%D {\bgroup -%D \everypar{} % We disable some troublesome mechanisms. -%D \advance\leftskip by 1em -%D \processdisplayverbatim{\stoptyping}} -%D -%D \let\stoptyping=\egroup -%D \stoptyping -%D -%D We also used: -%D -%D \starttyping -%D \def\startdefinition% -%D {\bgroup -%D \everypar{} % Again we disable some troublesome mechanisms. -%D \let\obeycharacters=\setupprettyTEXtype % See verb-tex.tex! -%D \EveryPar{\showparagraphcounter}% -%D \EveryLine{\showlinecounter}% -%D \verbatimbodyfont -%D \processdisplayverbatim{\stopdefinition}} -%D -%D \def\stopdefinition% -%D {\egroup} -%D \stoptyping -%D -%D And because we have both \type{\EveryPar} and -%D \type{\EveryLine} available, we can implement a dual -%D numbering mechanism: -%D -%D \starttyping -%D \newcount\paragraphcounter -%D \newcount\linecounter -%D -%D \def\showparagraphcounter% -%D {\llap -%D {\bgroup -%D \counterfont -%D \hbox to 4em -%D {\global\advance\paragraphcounter by 1 -%D \hss \the\paragraphcounter \hskip2em}% -%D \egroup -%D \hskip1em}} -%D -%D \def\showlinecounter% -%D {\llap -%D {\bgroup -%D \counterfont -%D \hbox to 2em -%D {\global\advance\linecounter by 1 -%D \hss \the\linecounter}% -%D \egroup -%D \hskip1em}} -%D \stoptyping -%D -%D One may have noticed that the \type{\EveryPar} is only -%D executed once, because we consider each piece of verbatim -%D as one paragraph. When one wants to take the empty lines -%D into account, the following assignments are appropriate: -%D -%D \starttyping -%D \EveryLine -%D {\iflinepar -%D \showparagraphcounter -%D \fi -%D \showlinecounter} -%D \stoptyping -%D -%D In this case, nothing has to be assigned to \type{\EveryPar}, -%D maybe except of just another extra numbering scheme. The -%D macros used to typeset this documentation are a bit more -%D complicated, because we have to take take 'long' margin -%D lists into account. When such a list exceeds the previous -%D pargraph we postpone placement of the paragraph number till -%D there's room. This way so it does not clash with the margin -%D words. - -%D Normally such commands have to be embedded in a decent setup -%D structure, where options can be set at will. -%D -%D Now let's summarize the most important commands. -%D -%D \starttyping -%D \processinlineverbatim{\closingcommand} -%D \processdisplayverbatim{\closingcommand} -%D \processfileverbatim{filename} -%D \stoptyping -%D -%D We can satisfy our own specific needs with the following -%D interfacing macro's: -%D -%D \starttyping -%D \obeyspaces \obeytabs \obeylines \obeypages \obeycharacters -%D \stoptyping -%D -%D We can influence the verbatim environment with the following -%D macro: -%D -%D \starttyping -%D \obeyemptylines -%D \stoptyping -%D -%D Some needs are fulfilled already with: -%D -%D \starttyping -%D \setcontrolspace \settabskips -%D \stoptyping -%D -%D lines can be enhanced with ornaments using: -%D -%D \starttyping -%D \everypar \everyline \iflinepar -%D \stoptyping -%D -%D and pretty verbatim support is implemented by: -%D -%D \starttyping -%D \beginofpretty[#1] ... \endofpretty -%D \stoptyping -%D -%D and some setup macro, like: -%D -%D \starttyping -%D \setupprettyIDENTIFIERtype -%D \stoptyping -%D -%D The color support macro can be redefined by the user. The -%D parameter \type{#1} can be one of the four 'fixed' -%D identifiers {\em prettyone}, {\em prettytwo}, {\em -%D prettythree} and {\em prettyfour}. We have implemented a -%D more or less general PostScript color support mechanism, -%D using \type{specials}. One can toggle between color and -%D grayscale with: -%D -%D \starttyping -%D \setgrayverbatim \setcolorverbatim -%D \stoptyping - -%D \macros -%D {permitshiftedendofverbatim} -%D -%D We did not mention one drawback of the mechanism described -%D here. The closing command must start at the first position -%D of the line. In \CONTEXT\ we will not have this drawback, -%D because we can test if the end command is a substring of the -%D current line. The testing is done by two of the support -%D macros, which of course are not available in a stand alone -%D application of this module. - -\ifCONTEXT - - \let\doifendofverbatim=\doifelse - - \def\permitshiftedendofverbatim - {\let\doifendofverbatim\doifinstringelse} - - {\obeylines% - \long\gdef\copyverbatimline#1 - {\convertargument#1 \to\next% - \gdef\verbatimline{#1}% - \ifx\next\emptyspace% - \presetemptyverbatimline% - \else% - \doifendofverbatim{\endofverbatimcommand}{\next}% - {\presetlastverbatimline% - \def\copyverbatimline{\egroup\endofdisplayverbatim}}% - {\presetnormalverbatimline}% - \fi% - \handleverbatimline% - \copyverbatimline}} - -%D As a bonus, we provide the next alternative, which takes -%D end tags like \type {Hello World!}. - - \def\doprocessdisplayverbatim#1#2% - {\par - \beginofverbatimlines - \bgroup - \escapechar-1 - \xdef\verbatimname{\string#2}% - \egroup - \ifcase#1% - \let\endofdisplayverbatim\relax - \else - \def\endofdisplayverbatim{\endofverbatimlines\csname\verbatimname\endcsname}% - \fi - \bgroup - \parindent\zeropoint - \ifdim\lastskip<\parskip - \removelastskip - \vskip\parskip - \fi - \parskip\zeropoint - \processingverbatimtrue - \ifcase#1% - \convertargument#2\to\endofverbatimcommand - \else - \expandafter\let\csname\verbatimname\endcsname=\relax - \expandafter\convertargument\csname\verbatimname\endcsname - \to\endofverbatimcommand - \fi - \verbatimfont - \setverbatimspaceskip - \global\linepartrue % needed for paragraph numbering - \setupcopyverbatim - \initializeverbatimline - \copyverbatimline} - - \def\processdisplayverbatim {\doprocessdisplayverbatim1} - \def\processtaggeddisplayverbatim{\doprocessdisplayverbatim0} - -\fi - -%D \macros -%D {installprettyescape} -%D -%D The next feature is dedicated to Fabrice Popineau who -%D wanted math inside verbatim. - -\def\prettyescapecnt{255} - -\def\installprettyescape - {\dodoubleempty\doinstallprettyescape} - -\def\doinstallprettyescape[#1][#2]#3 #4% - {\bgroup - \doglobal\decrement\prettyescapecnt - \def\docommand##1% - {\def\next{\dodoinstallprettyescape{##1}{#3}{#4}}% - \catcode`#3=\@@active - \@EA\scantokens\@EA{\next}}% - \iffirstargument - \processcommalist[#1]\docommand - \else - \docommand\empty - \fi} - -\def\dodoinstallprettyescape#1#2#3% - {\unexpanded\setgvalue{PRETTY@#1@\prettyescapecnt}##1##2#2{#3{##2}}% - \expanded % we need to freeze the counter - {\doglobal\noexpand\appendtoks - \noexpand\doif{#1}\noexpand\prettyidentifier - {\noexpand\setpretty`\string#2=\prettyescapecnt - \noexpand\installprettyhandler \prettyescapecnt\space\getvalue{PRETTY@#1@\prettyescapecnt}}% - }\to \everysetupverbatim - \egroup} - -%D An example of its usage is: -%D -%D \startbuffer -%D \def\xverbatimmath#1#2{\naturaltextext\mathematics{#1}\relax} -%D \def\yverbatimmath#1#2{\naturaltextext\mathematics{[[#1]]}\relax} -%D \def\zverbatimmath#1#2{\naturaltextext\mathematics{(#1)}\relax} -%D -%D \installprettyescape [MP] $ \xverbatimmath -%D \installprettyescape [MP] ~ \yverbatimmath -%D \installprettyescape [MP] * \zverbatimmath -%D -%D \startMP -%D if $x>10$ : -%D $x := 20$ -%D ~x := 20~ -%D *x := 20* -%D end -%D \stopMP -%D \stopbuffer -%D -%D \typebuffer \getbuffer - -\protect \endinput diff --git a/tex/context/base/verb-js.mkii b/tex/context/base/verb-js.mkii new file mode 100644 index 000000000..3d1b69f8b --- /dev/null +++ b/tex/context/base/verb-js.mkii @@ -0,0 +1,171 @@ +%D \module +%D [ file=verb-js, +%D version=1998.02.07, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty \JAVASCRIPT\ Verbatim, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Verbatim Macros / Pretty JavaScript Verbatim} + +%D In \CONTEXT\ we support \JAVASCRIPT\ inclusion in \PDF\ +%D documents and thereby enter the field of authoring. Of +%D course we also want to pretty print such scripts, that look +%D like: +%D +%D \startJS +%D alfa = beta*2 ; // both alfa and beta are numbers // indeed +%D if (odd(alfa)) +%D { do_something() } +%D else +%D { do_nothing() } /* As we can see /* in this example */ there +%D how_about(alfa) ; is no fi needed. Also no semicolons are +%D or_about(beta) ; needed after a right brace. */ +%D \stopJS +%D +%D Because \JAVASCRIPT\ looks much like \PERL, we will use +%D a slightly adapted \PERL\ visualization. First we load the +%D \PERL\ module: + +\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi + +\unprotect + +%D The main difference between the \JAVASCRIPT\ and \PERL\ +%D interpreters concern comments. Where \TEX, \METAPOST\ and +%D \PERL\ have one comment symbol (\type{%}, \type{%} and +%D \type{#}), \JAVA\ has the one line comment sequence +%D \type{//} and the multi line comment delimiters \type{/*} +%D and \type{*/}. +%D +%D We need a counter to keep track of multi line comment +%D nesting. + +\newcount\JScommentlevel + +%D We handle both \type{%} and \type{#} a bit different: + +\gdef\JSsetspecials% + {\PLsetspecials + \setpretty`\#=32 + \setpretty`\%=41 + \setpretty`\/=43 + \setpretty`\*=44 } + +%D We also need a few more handlers: one for \type{//} and +%D \type{/*} and one for \type{*/}. + +\gdef\JSsethandlers% + {\PLsethandlers + \installprettyhandler 43 \JStypefourthree + \installprettyhandler 44 \JStypefourfour } + +%D We can inherit most of the settings: + +\gdef\JSsetcontrols% + {\PLsetcontrols + \def\flushrestofverbatimline% + {\endPLtypesix + \ifcase\JScommentlevel \inPLcommentfalse \fi + \PLverbosefalse + \PLverboseskipped=0}} + +\gdef\JSsetvariables + {\PLsetvariables + \global\JScommentlevel=0 } + +\gdef\setupprettyJStype% + {\def\prettyidentifier{JS}% + \let\PLidentifiers=\JSidentifiers + \let\PLvariables=\JSvariables + \JSsetvariables + \JSsetcontrols + \JSsethandlers + \JSsetspecials + \PLsetdiagnostics} + +%D The main complication is that we have to look upto four +%D characters ahead. Such macros are hard to understand but +%D they do work! + +\gdef\JStypefourthree% + {\handlenextnextpretty\doJStypefourthree\PLtypefourtwo} + +\gdef\doJStypefourthree#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \let\next=\dodoJStypefourthree + \else\ifnum\prettytype=44 + \global\advance\JScommentlevel by 1 + \global\inPLcommenttrue + \PLverbosecorrection + \let\next=\JStogglecomment + \else + \let\next=\PLtypefourtwo + \fi\fi + \next{#1}#2} + +\gdef\JStogglecomment#1#2% + {\ifnum\JScommentlevel=1 + \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty + \else + \getpretties{#1}{#2}% + \fi} + +\gdef\dodoJStypefourthree% #1% + {\endPLtypesix + \handlenextnextpretty\dododoJStypefourthree\dodododoPLtypefourthree} + +\gdef\dododoJStypefourthree% + {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoJStypefourthree} + +\gdef\dodododoJStypefourthree#1#2% + {\ifinPLcomment + \getpretties{#1}{#2}% + \else + \global\inPLcommenttrue + \PLverbosecorrection + \ifnaturaltextext + \let\next\naturaltextext + \else + \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}% + \fi + \expandafter\next + \fi} + +\gdef\JStypefourfour% + {\handlenextnextpretty\doJStypefourfour\PLtypefourtwo} + +\gdef\doJStypefourfour#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \JStogglecomment{#1}#2% + \global\advance\JScommentlevel by -1 + \ifcase\JScommentlevel \global\inPLcommentfalse \fi + \else + \endPLtypesix + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \expandafter#2% + \fi} + +%D We need different (less) reserved words. This list replaces +%D the \PERL\ one. + +\useprettyidentifiers \JSidentifiers \JSsetspecials + abstract boolean break byte case catch char class const + continue default delete do double else extends false final + finally float for function goto if implements import in + instanceof int interface long native new null package + private protected public return short static super switch + synchronized this throw throws transient true try var void + while with + +\useprettyidentifiers \JSvariables \JSsetspecials + not-yet-defined + +\protect \endinput diff --git a/tex/context/base/verb-js.tex b/tex/context/base/verb-js.tex deleted file mode 100644 index 3d1b69f8b..000000000 --- a/tex/context/base/verb-js.tex +++ /dev/null @@ -1,171 +0,0 @@ -%D \module -%D [ file=verb-js, -%D version=1998.02.07, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty \JAVASCRIPT\ Verbatim, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Verbatim Macros / Pretty JavaScript Verbatim} - -%D In \CONTEXT\ we support \JAVASCRIPT\ inclusion in \PDF\ -%D documents and thereby enter the field of authoring. Of -%D course we also want to pretty print such scripts, that look -%D like: -%D -%D \startJS -%D alfa = beta*2 ; // both alfa and beta are numbers // indeed -%D if (odd(alfa)) -%D { do_something() } -%D else -%D { do_nothing() } /* As we can see /* in this example */ there -%D how_about(alfa) ; is no fi needed. Also no semicolons are -%D or_about(beta) ; needed after a right brace. */ -%D \stopJS -%D -%D Because \JAVASCRIPT\ looks much like \PERL, we will use -%D a slightly adapted \PERL\ visualization. First we load the -%D \PERL\ module: - -\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi - -\unprotect - -%D The main difference between the \JAVASCRIPT\ and \PERL\ -%D interpreters concern comments. Where \TEX, \METAPOST\ and -%D \PERL\ have one comment symbol (\type{%}, \type{%} and -%D \type{#}), \JAVA\ has the one line comment sequence -%D \type{//} and the multi line comment delimiters \type{/*} -%D and \type{*/}. -%D -%D We need a counter to keep track of multi line comment -%D nesting. - -\newcount\JScommentlevel - -%D We handle both \type{%} and \type{#} a bit different: - -\gdef\JSsetspecials% - {\PLsetspecials - \setpretty`\#=32 - \setpretty`\%=41 - \setpretty`\/=43 - \setpretty`\*=44 } - -%D We also need a few more handlers: one for \type{//} and -%D \type{/*} and one for \type{*/}. - -\gdef\JSsethandlers% - {\PLsethandlers - \installprettyhandler 43 \JStypefourthree - \installprettyhandler 44 \JStypefourfour } - -%D We can inherit most of the settings: - -\gdef\JSsetcontrols% - {\PLsetcontrols - \def\flushrestofverbatimline% - {\endPLtypesix - \ifcase\JScommentlevel \inPLcommentfalse \fi - \PLverbosefalse - \PLverboseskipped=0}} - -\gdef\JSsetvariables - {\PLsetvariables - \global\JScommentlevel=0 } - -\gdef\setupprettyJStype% - {\def\prettyidentifier{JS}% - \let\PLidentifiers=\JSidentifiers - \let\PLvariables=\JSvariables - \JSsetvariables - \JSsetcontrols - \JSsethandlers - \JSsetspecials - \PLsetdiagnostics} - -%D The main complication is that we have to look upto four -%D characters ahead. Such macros are hard to understand but -%D they do work! - -\gdef\JStypefourthree% - {\handlenextnextpretty\doJStypefourthree\PLtypefourtwo} - -\gdef\doJStypefourthree#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=43 - \let\next=\dodoJStypefourthree - \else\ifnum\prettytype=44 - \global\advance\JScommentlevel by 1 - \global\inPLcommenttrue - \PLverbosecorrection - \let\next=\JStogglecomment - \else - \let\next=\PLtypefourtwo - \fi\fi - \next{#1}#2} - -\gdef\JStogglecomment#1#2% - {\ifnum\JScommentlevel=1 - \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty - \else - \getpretties{#1}{#2}% - \fi} - -\gdef\dodoJStypefourthree% #1% - {\endPLtypesix - \handlenextnextpretty\dododoJStypefourthree\dodododoPLtypefourthree} - -\gdef\dododoJStypefourthree% - {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoJStypefourthree} - -\gdef\dodododoJStypefourthree#1#2% - {\ifinPLcomment - \getpretties{#1}{#2}% - \else - \global\inPLcommenttrue - \PLverbosecorrection - \ifnaturaltextext - \let\next\naturaltextext - \else - \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}% - \fi - \expandafter\next - \fi} - -\gdef\JStypefourfour% - {\handlenextnextpretty\doJStypefourfour\PLtypefourtwo} - -\gdef\doJStypefourfour#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=43 - \JStogglecomment{#1}#2% - \global\advance\JScommentlevel by -1 - \ifcase\JScommentlevel \global\inPLcommentfalse \fi - \else - \endPLtypesix - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \expandafter#2% - \fi} - -%D We need different (less) reserved words. This list replaces -%D the \PERL\ one. - -\useprettyidentifiers \JSidentifiers \JSsetspecials - abstract boolean break byte case catch char class const - continue default delete do double else extends false final - finally float for function goto if implements import in - instanceof int interface long native new null package - private protected public return short static super switch - synchronized this throw throws transient true try var void - while with - -\useprettyidentifiers \JSvariables \JSsetspecials - not-yet-defined - -\protect \endinput diff --git a/tex/context/base/verb-jv.mkii b/tex/context/base/verb-jv.mkii new file mode 100644 index 000000000..197b37ee7 --- /dev/null +++ b/tex/context/base/verb-jv.mkii @@ -0,0 +1,222 @@ +%D \module +%D [ file=verb-jv, +%D version=2002.02.27, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty \JAVA\ Verbatim, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Verbatim Macros / Pretty Java Verbatim} + +%D This module differs from the \JAVASCRIPT\ driver in its +%D handling of comments. We also need a few more handlers: one +%D for \type {//} and \type {/*} and one for \type {*/} as +%D well as the \JAVA doc trigger \type {/**}. + +%D We build this driver on top of the \PERL\ one. Since this +%D driver looks much like the \JAVASCRIPT\ one, we don't +%D comment it extensively. + +\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi + +\unprotect + +\newcount\JVcommentlevel + +\gdef\JVsetspecials + {\PLsetspecials + \setpretty`\#=32 + \setpretty`\%=41 + \setpretty`\-=45 + \setpretty`\/=43 + \setpretty`\*=44 } + +\gdef\JVsethandlers + {\PLsethandlers + \installprettyhandler 43 \JVtypefourthree + \installprettyhandler 44 \JVtypefourfour + \installprettyhandler 45 \JVtypefourfive } + +\gdef\JVsetcontrols + {\PLsetcontrols + \def\flushrestofverbatimline + {\endPLtypesix + \ifcase\JVcommentlevel \inPLcommentfalse \fi + \PLverbosefalse + \PLverboseskipped=0}} + +\gdef\JVsetvariables + {\PLsetvariables + \global\JVcommentlevel=0 } + +\gdef\setupprettyJVtype + {\def\prettyidentifier{JV}% + \let\PLidentifiers\JVidentifiers + \let\PLvariables\JVvariables + \JVsetvariables + \JVsetcontrols + \JVsethandlers + \JVsetspecials + \PLsetdiagnostics} + +\gdef\JVtypefourthree + {\handlenextnextpretty\doJVtypefourthree\PLtypefourtwo} + +\gdef\doJVtypefourthree#1#2#3% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \let\next\dodoJVtypefourthree + \else\ifnum\prettytype=44 + \global\advance\JVcommentlevel 1 + \global\inPLcommenttrue + \PLverbosecorrection + \getprettydata{#3}% + \ifnum\prettytype=44 + \inPLdoctrue + \fi + \let\next\JVtogglecomment + \else + \let\next\PLtypefourtwo + \fi\fi + \next{#1}#2#3} + +\gdef\JVtogglecomment#1#2% + {\ifnum\JVcommentlevel=1 + \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty + \else + \getpretties{#1}{#2}% + \fi} + +\gdef\dodoJVtypefourthree + {\endPLtypesix + \handlenextnextpretty\dododoJVtypefourthree\dodododoPLtypefourthree} + +\gdef\dododoJVtypefourthree + {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoJVtypefourthree} + +\gdef\dodododoJVtypefourthree#1#2% + {\ifinPLcomment + \getpretties{#1}{#2}% + \else + \global\inPLcommenttrue + \PLverbosecorrection + \ifnaturaltextext + \let\next\naturaltextext + \else + \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}% + \fi + \expandafter\next + \fi} + +\gdef\JVtypefourfour + {\ifinPLdoc + \@EA\noJVtypefourfour + \else + \@EA\handlenextnextpretty\@EA\doJVtypefourfour\@EA\PLtypefourtwo + \fi} + +\gdef\noJVtypefourfour#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \JVtogglecomment{#1}#2% + \inPLdocfalse + \global\advance\JVcommentlevel -1 + \ifcase\JVcommentlevel \global\inPLcommentfalse \fi + \else + \ifPLdocdone + \getpretty{#1}% + \else + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \PLdocdonetrue + \fi + \expandafter#2% + \fi} + +\gdef\doJVtypefourfour#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \JVtogglecomment{#1}#2% + \inPLdocfalse + \global\advance\JVcommentlevel -1 + \ifcase\JVcommentlevel \global\inPLcommentfalse \fi + \else + \endPLtypesix + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \expandafter#2% + \fi} + +\gdef\JVtypefourfive % permit - in javadoc @tags + {\ifinPLdoc + \@EA\PLtypesixtwo + \else + \@EA\PLtypefourone + \fi} + +\useprettyidentifiers \JVidentifiers \JVsetspecials + abstract assert boolean break byte case catch char class const + continue default do double else extends false final + finally float for goto if implements import instanceof + int interface long native new null package private protected + public return short static strictfp super switch synchronized + this throw throws transient true try void volatile while + +\useprettyidentifiers \JVvariables \JVsetspecials + @author @docRoot @deprecated @exception @inheritDoc @link + @linkplain @param @return @see @serial @serialData @serialField + @since @throws @value @version + +%D The \JAVA doc feature was requested by Robert F.~Beeger, +%D who also provided this test class: +%D +%D \startJV +%D package de.jwamalpha.handling.web.rbdipl; +%D +%D import java.io.IOException; +%D import java.io.PrintWriter; +%D import javax.servlet.http.HttpServlet; +%D import javax.servlet.http.HttpServletRequest; +%D import javax.servlet.http.HttpServletResponse; +%D import javax.servlet.ServletException; +%D +%D /** +%D * The simple login servlet +%D * +%D * @author Robert F. Beeger +%D * @version 1.0 +%D */ +%D +%D public class LoginServlet extends HttpServlet +%D { +%D // +%D // public interface +%D // +%D /** +%D * Process the get-request. +%D * +%D * @param request the request +%D * @param response the response. +%D */ +%D protected void doGet (HttpServletRequest request, HttpServletResponse response) +%D throws ServletException, IOException +%D { +%D response.setContentType("text/html"); +%D PrintWriter writer = response.getWriter(); +%D writer.println(""); +%D writer.println(" "); +%D writer.println(" Login"); +%D writer.println(" "); +%D writer.println(" "); +%D writer.println(" Hallo, Benutzer " + request.getParameter("username") + "!"); +%D writer.println(" "); +%D writer.println(""); +%D writer.flush(); +%D } +%D } +%D \stopJV + +\protect \endinput diff --git a/tex/context/base/verb-jv.tex b/tex/context/base/verb-jv.tex deleted file mode 100644 index 197b37ee7..000000000 --- a/tex/context/base/verb-jv.tex +++ /dev/null @@ -1,222 +0,0 @@ -%D \module -%D [ file=verb-jv, -%D version=2002.02.27, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty \JAVA\ Verbatim, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Verbatim Macros / Pretty Java Verbatim} - -%D This module differs from the \JAVASCRIPT\ driver in its -%D handling of comments. We also need a few more handlers: one -%D for \type {//} and \type {/*} and one for \type {*/} as -%D well as the \JAVA doc trigger \type {/**}. - -%D We build this driver on top of the \PERL\ one. Since this -%D driver looks much like the \JAVASCRIPT\ one, we don't -%D comment it extensively. - -\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi - -\unprotect - -\newcount\JVcommentlevel - -\gdef\JVsetspecials - {\PLsetspecials - \setpretty`\#=32 - \setpretty`\%=41 - \setpretty`\-=45 - \setpretty`\/=43 - \setpretty`\*=44 } - -\gdef\JVsethandlers - {\PLsethandlers - \installprettyhandler 43 \JVtypefourthree - \installprettyhandler 44 \JVtypefourfour - \installprettyhandler 45 \JVtypefourfive } - -\gdef\JVsetcontrols - {\PLsetcontrols - \def\flushrestofverbatimline - {\endPLtypesix - \ifcase\JVcommentlevel \inPLcommentfalse \fi - \PLverbosefalse - \PLverboseskipped=0}} - -\gdef\JVsetvariables - {\PLsetvariables - \global\JVcommentlevel=0 } - -\gdef\setupprettyJVtype - {\def\prettyidentifier{JV}% - \let\PLidentifiers\JVidentifiers - \let\PLvariables\JVvariables - \JVsetvariables - \JVsetcontrols - \JVsethandlers - \JVsetspecials - \PLsetdiagnostics} - -\gdef\JVtypefourthree - {\handlenextnextpretty\doJVtypefourthree\PLtypefourtwo} - -\gdef\doJVtypefourthree#1#2#3% - {\getprettydata{#2}% - \ifnum\prettytype=43 - \let\next\dodoJVtypefourthree - \else\ifnum\prettytype=44 - \global\advance\JVcommentlevel 1 - \global\inPLcommenttrue - \PLverbosecorrection - \getprettydata{#3}% - \ifnum\prettytype=44 - \inPLdoctrue - \fi - \let\next\JVtogglecomment - \else - \let\next\PLtypefourtwo - \fi\fi - \next{#1}#2#3} - -\gdef\JVtogglecomment#1#2% - {\ifnum\JVcommentlevel=1 - \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty - \else - \getpretties{#1}{#2}% - \fi} - -\gdef\dodoJVtypefourthree - {\endPLtypesix - \handlenextnextpretty\dododoJVtypefourthree\dodododoPLtypefourthree} - -\gdef\dododoJVtypefourthree - {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoJVtypefourthree} - -\gdef\dodododoJVtypefourthree#1#2% - {\ifinPLcomment - \getpretties{#1}{#2}% - \else - \global\inPLcommenttrue - \PLverbosecorrection - \ifnaturaltextext - \let\next\naturaltextext - \else - \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}% - \fi - \expandafter\next - \fi} - -\gdef\JVtypefourfour - {\ifinPLdoc - \@EA\noJVtypefourfour - \else - \@EA\handlenextnextpretty\@EA\doJVtypefourfour\@EA\PLtypefourtwo - \fi} - -\gdef\noJVtypefourfour#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=43 - \JVtogglecomment{#1}#2% - \inPLdocfalse - \global\advance\JVcommentlevel -1 - \ifcase\JVcommentlevel \global\inPLcommentfalse \fi - \else - \ifPLdocdone - \getpretty{#1}% - \else - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \PLdocdonetrue - \fi - \expandafter#2% - \fi} - -\gdef\doJVtypefourfour#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=43 - \JVtogglecomment{#1}#2% - \inPLdocfalse - \global\advance\JVcommentlevel -1 - \ifcase\JVcommentlevel \global\inPLcommentfalse \fi - \else - \endPLtypesix - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \expandafter#2% - \fi} - -\gdef\JVtypefourfive % permit - in javadoc @tags - {\ifinPLdoc - \@EA\PLtypesixtwo - \else - \@EA\PLtypefourone - \fi} - -\useprettyidentifiers \JVidentifiers \JVsetspecials - abstract assert boolean break byte case catch char class const - continue default do double else extends false final - finally float for goto if implements import instanceof - int interface long native new null package private protected - public return short static strictfp super switch synchronized - this throw throws transient true try void volatile while - -\useprettyidentifiers \JVvariables \JVsetspecials - @author @docRoot @deprecated @exception @inheritDoc @link - @linkplain @param @return @see @serial @serialData @serialField - @since @throws @value @version - -%D The \JAVA doc feature was requested by Robert F.~Beeger, -%D who also provided this test class: -%D -%D \startJV -%D package de.jwamalpha.handling.web.rbdipl; -%D -%D import java.io.IOException; -%D import java.io.PrintWriter; -%D import javax.servlet.http.HttpServlet; -%D import javax.servlet.http.HttpServletRequest; -%D import javax.servlet.http.HttpServletResponse; -%D import javax.servlet.ServletException; -%D -%D /** -%D * The simple login servlet -%D * -%D * @author Robert F. Beeger -%D * @version 1.0 -%D */ -%D -%D public class LoginServlet extends HttpServlet -%D { -%D // -%D // public interface -%D // -%D /** -%D * Process the get-request. -%D * -%D * @param request the request -%D * @param response the response. -%D */ -%D protected void doGet (HttpServletRequest request, HttpServletResponse response) -%D throws ServletException, IOException -%D { -%D response.setContentType("text/html"); -%D PrintWriter writer = response.getWriter(); -%D writer.println(""); -%D writer.println(" "); -%D writer.println(" Login"); -%D writer.println(" "); -%D writer.println(" "); -%D writer.println(" Hallo, Benutzer " + request.getParameter("username") + "!"); -%D writer.println(" "); -%D writer.println(""); -%D writer.flush(); -%D } -%D } -%D \stopJV - -\protect \endinput diff --git a/tex/context/base/verb-mp.mkii b/tex/context/base/verb-mp.mkii new file mode 100644 index 000000000..7affaf0c4 --- /dev/null +++ b/tex/context/base/verb-mp.mkii @@ -0,0 +1,364 @@ +%D \module +%D [ file=verb-mp, +%D version=1997.12.22, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty \METAPOST\ Verbatim, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Verbatim Macros / Pretty METAPOST Verbatim} + +% bug: in mp-char.mp the char should not be highlighted + +% can be simplified + +%D This module was first used when I documented our new +%D company logo. This interpreter is modeled after the \PERL\ +%D one. +%D +%D \startMP +%D beginfig(1); +%D z1 = (0,0); +%D z2 = (100,0); +%D z3 = (0,100); +%D draw z1--z2--z3--cycle; +%D endfig; +%D \stopMP +%D +%D Of course we cannot (yet) provide a nice layout, so some +%D formatting is still needed. + +\unprotect + +%D \macros +%D {prettyMPvariables} +%D +%D Identifiers and system variables are typeset in a different +%D style. One can turn of this mechanism for the variables by +%D setting th enext boolean. +%D + +\doglobal\newif\ifprettyMPvariables + +\global\prettyMPvariablestrue + +%D We support \METAFONT\ as well as \METAPOST. + +\gdef\MPsetcontrols + {\saveprettycontrols + \everyprettyend + {\endMPtypesix}% + \def\obeyedspace% + {\endMPtypesix + \oldobeyedspace}% + \def\flushrestofverbatimline% + {\endMPtypesix}% + \let\obeytabs=\ignoretabs} + +\gdef\setupprettyMPtype + {\def\prettyidentifier{MP}% + \global\inMPtexmodefalse + \MPsetvariables + \MPsetcontrols + \MPsethandlers + \MPsetspecials} + +\doglobal\newif\ifinMPtexmode + +\gdef\MPsetvariables + {\global\inMPtexmodefalse + \global\let\MPsequence=\empty} + +\gdef\MPsetspecials + {\setpretty`\;=11 \setpretty`\$=12 \setpretty`\@=12 \setpretty`\#=12 + \setpretty`\%=20 + \setpretty`\[=31 \setpretty`\]=31 \setpretty`\(=32 \setpretty`\)=32 + \setpretty`\:=33 \setpretty`\==34 \setpretty`\<=34 \setpretty`\>=34 + \setpretty`\-=41 \setpretty`\+=41 \setpretty`\/=41 \setpretty`\*=41 + \setpretty`\|=41 \setpretty`\`=41 \setpretty`\!=41 \setpretty`\?=41 + \setpretty`\^=41 \setpretty`\&=42 + \setpretty`\\=50 + \setpretty`\1=61 \setpretty`\2=61 \setpretty`\3=61 \setpretty`\4=61 + \setpretty`\5=61 \setpretty`\6=61 \setpretty`\7=61 \setpretty`\8=61 + \setpretty`\9=61 \setpretty`\0=61 + \setpretty`\A=62 \setpretty`\B=62 \setpretty`\C=62 \setpretty`\D=62 \setpretty`\E=62 + \setpretty`\F=62 \setpretty`\G=62 \setpretty`\H=62 \setpretty`\I=62 \setpretty`\J=62 + \setpretty`\K=62 \setpretty`\L=62 \setpretty`\M=62 \setpretty`\N=62 \setpretty`\O=62 + \setpretty`\P=62 \setpretty`\Q=62 \setpretty`\R=62 \setpretty`\S=62 \setpretty`\T=62 + \setpretty`\U=62 \setpretty`\V=62 \setpretty`\W=62 \setpretty`\X=62 \setpretty`\Y=62 + \setpretty`\Z=62 + \setpretty`\a=62 \setpretty`\b=62 \setpretty`\c=62 \setpretty`\d=62 \setpretty`\e=62 + \setpretty`\f=62 \setpretty`\g=62 \setpretty`\h=62 \setpretty`\i=62 \setpretty`\j=62 + \setpretty`\k=62 \setpretty`\l=62 \setpretty`\m=62 \setpretty`\n=62 \setpretty`\o=62 + \setpretty`\p=62 \setpretty`\q=62 \setpretty`\r=62 \setpretty`\s=62 \setpretty`\t=62 + \setpretty`\u=62 \setpretty`\v=62 \setpretty`\w=62 \setpretty`\x=62 \setpretty`\y=62 + \setpretty`\z=62 + \setpretty`\_=62 + \setpretty`\,=70 \setpretty`\.=70 + \setpretty`\'=81 \setpretty`\"=82 + \setpretty`\{=90 \setpretty`\}=90 } + +\gdef\MPsethandlers + {\installprettyhandler 11 \MPtypeone + \installprettyhandler 12 \MPtypeone + \installprettyhandler 20 \MPtypetwo + \installprettyhandler 31 \MPtypethreeA + \installprettyhandler 32 \MPtypethreeA + \installprettyhandler 33 \MPtypethreeB + \installprettyhandler 34 \MPtypethreeB + \installprettyhandler 41 \MPtypefour + \installprettyhandler 42 \MPtypefour + \installprettyhandler 50 \MPtypefive + \installprettyhandler 61 \MPtypesixone + \installprettyhandler 62 \MPtypesixtwo + \installprettyhandler 70 \MPtypeseven + \installprettyhandler 81 \MPtypeeightone + \installprettyhandler 82 \MPtypeeighttwo + \installprettyhandler 90 \MPtypenine } + +\gdef\MPtypeone#1% + {\endMPtypesix + \ifinMPtexmode + \getpretty{#1}% + \else + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty% + \fi} + +\gdef\doMPtypetwo#1% + {\ifnaturaltextext + \let\next\naturaltextext + \else + \disableprettytrue\disableprettyafterwards + \def\next{\beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty}% + \fi + \next} + +\gdef\MPtypetwo + {\endMPtypesix + \ifnewpretty\expandafter\handlenewpretty\fi\doMPtypetwo} + +\gdef\MPtypethreeA#1% + {\endMPtypesix + \ifinMPtexmode + \getpretty{#1}% + \else + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \fi} + +\gdef\MPtypethreeB#1% + {\endMPtypesix + \ifinMPtexmode + \getpretty{#1}% + \else + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \fi} + +\gdef\MPtypefour#1% + {\endMPtypesix + \ifinMPtexmode + \getpretty{#1}% + \else + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \fi} + +\gdef\MPtypefive#1% + {\endMPtypesix + \ifinMPtexmode + \getpretty{#1}% + \else + \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty + \fi} + +\gdef\endMPtypesix + {\ifx\MPsequence\empty\else + \doifprettyidentifierelse{\MPsequence}{\MPidentifiers} + {\doifprettyidentifierelse{\MPsequence}{\MPbtex} + {\beginofpretty[\!!prettytwo]% + {\prettyidentifierfont\MPsequence}% + \endofpretty + \global\inMPtexmodetrue} + {\ifinMPtexmode + \doifprettyidentifierelse{\MPsequence}{\MPetex} + {\global\inMPtexmodefalse}{}% + \fi + \beginofpretty[\!!prettytwo]% + {\prettyidentifierfont\MPsequence}% + \endofpretty}} + {\ifprettyMPvariables + \doifprettyidentifierelse{\MPsequence}{\MPvariables} + {\beginofpretty[\!!prettytwo]% + {\prettyvariablefont\MPsequence}% + \endofpretty} + {\MPsequence}% + \else + \MPsequence + \fi}% + \global\let\MPsequence=\empty + \fi} + +\gdef\MPtypesixone + {\endMPtypesix + \getpretty} + +\gdef\MPtypesixtwo#1% + {\xdef\MPsequence{\MPsequence\getpretty{#1}}} + +\gdef\MPtypeseven#1% + {\endMPtypesix + \ifinMPtexmode + \getpretty{#1}% + \else + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \fi} + +\gdef\MPtypeeightone#1% + {\endMPtypesix + \ifinMPtexmode + \getpretty{#1}% + \else + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \fi} + +\gdef\MPtypeeighttwo#1% + {\endMPtypesix + \ifinMPtexmode + \getpretty{#1}% + \else + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \fi} + +\gdef\MPtypenine#1% + {\endMPtypesix + \ifinMPtexmode + \getpretty{#1}% + \else + \getpretty{#1}% + \fi} + +%D \METAPOST\ \TEX||ies: + +\useprettyidentifiers \MPbtex \MPsetspecials + btex verbatimtex + +\useprettyidentifiers \MPetex \MPsetspecials + etex + +\useprettyidentifiers \MPidentifiers \MPsetspecials + btex etex verbatimtex + +%D \METAPOST\ internal variables \& predefined variables: + +\useprettyidentifiers \MPidentifiers \MPsetspecials + charcode day linecap linejoin miterlimit month pausing + prologues showstopping time tracingcapsules tracingchoices mpprocset + tracingcommands tracingequations tracinglostchars + tracingmacros tracingonline tracingoutput tracingrestores + tracingspecs tracingstats tracingtitles truecorners + warningcheck year + +\useprettyidentifiers \MPvariables \MPsetspecials + ahangle ahlength bboxmargin defaultpen defaultscale + labeloffset background currentpen currentpicture cuttings + defaultfont extra_beginfig extra_endfig + +%D \METAPOST\ predefined constants: + +\useprettyidentifiers \MPidentifiers \MPsetspecials + false nullpicture pencircle true + +\useprettyidentifiers \MPvariables \MPsetspecials + beveled black blue bp butt cc cm dd ditto down epsilon + evenly fullcircle green halfcircle identity in infinity left + mitered mm origin pensquare pt quartercircle red right + rounded squared unitsquare up white withdots + +%D \METAPOST\ operators: + +\useprettyidentifiers \MPidentifiers \MPsetspecials + and angle arclength arctime ASCII bluepart boolean bot + char color cosd cycle decimal directiontime floor fontsize + greenpart hex infont intersectiontimes known length llcorner + lrcorner makepath makepen mexp mlog normaldeviate not + numeric oct odd or path pair pen penoffset picture point + postcontrol precontrol redpart reverse rotated scaled + shifted sind slanted sqrt str string subpath substring + transform transformed ulcorner uniformdeviate unknown + urcorner xpart xscaled xxpart xypart ypart yscaled yxpart + yypart zscaled + +\useprettyidentifiers \MPvariables \MPsetspecials + abs bbox ceiling center cutafter cutbefore dir + directionpoint div dotprod intersectionpoint inverse mod lft + round rt unitvector whatever + +%D \METAPOST\ commands: + +\useprettyidentifiers \MPidentifiers \MPsetspecials + addto clip input interim let newinternal save setbounds + shipout show showdependencies showtoken showvariable + special + +\useprettyidentifiers \MPvariables \MPsetspecials + cutdraw draw drawarrow drawdblarrow fill filldraw + loggingall pickup tracingall tracingnone undraw unfill + unfilldraw drawdot + +%D \METAPOST\ macro||like functions: + +\useprettyidentifiers \MPvariables \MPsetspecials + buildcycle dashpattern decr dotlabel dotlabels drawoptions + incr label labels max min thelabel z + +%D More \METAPOST: + +\useprettyidentifiers \MPidentifiers \MPsetspecials + begingroup endgroup of curl tension and controls + reflectedabout rotatedaround interpath on off beginfig + endfig def vardef enddef epxr suffix text primary secondary + tertiary primarydef secondarydef tertiarydef top bottom + ulft urt llft lrt randomseed also contour doublepath + withcolor withpen dashed if else elseif fi for endfor + forsuffixes forever downto upto step until end + +%D \METAFONT\ stuff: + +\useprettyidentifiers \MPidentifiers \MPsetspecials + charlist extensible fontdimen headerbyte kern ligtable + boundarychar chardp charext charht charic charwd designsize + fontmaking charexists + +\useprettyidentifiers \MPvariables \MPsetspecials + beginchar blacker capsule_end change_width + define_blacker_pixels define_corrected_pixels + define_good_x_pixels define_good_y_pixels + define_horizontal_corrected_pixels define_pixels + define_whole_blacker_pixels define_whole_pixels + define_whole_vertical_blacker_pixels + define_whole_vertical_pixels endchar extra_beginchar + extra_endchar extra_setup font_coding_scheme + font_extra_space + +%D \METAFONT\ no||op stuff: + +\useprettyidentifiers \MPidentifiers \MPsetspecials + cullit currenttransform gfcorners grayfont hround + imagerules lowres_fix nodisplays notransforms openit + displaying currentwindow screen_rows screen_cols + pixels_per_inch cull display openwindow numspecial + totalweight autorounding fillin proofing tracingpens + xoffset chardx granularity smoothing turningcheck yoffset + chardy hppp tracingedges vppp + +%D \METAPOST\ goodies: + +\useprettyidentifiers \MPidentifiers \MPsetspecials + extra_beginfig extra_endfig mpxbreak + +\protect + +\endinput diff --git a/tex/context/base/verb-mp.tex b/tex/context/base/verb-mp.tex deleted file mode 100644 index 7affaf0c4..000000000 --- a/tex/context/base/verb-mp.tex +++ /dev/null @@ -1,364 +0,0 @@ -%D \module -%D [ file=verb-mp, -%D version=1997.12.22, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty \METAPOST\ Verbatim, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Verbatim Macros / Pretty METAPOST Verbatim} - -% bug: in mp-char.mp the char should not be highlighted - -% can be simplified - -%D This module was first used when I documented our new -%D company logo. This interpreter is modeled after the \PERL\ -%D one. -%D -%D \startMP -%D beginfig(1); -%D z1 = (0,0); -%D z2 = (100,0); -%D z3 = (0,100); -%D draw z1--z2--z3--cycle; -%D endfig; -%D \stopMP -%D -%D Of course we cannot (yet) provide a nice layout, so some -%D formatting is still needed. - -\unprotect - -%D \macros -%D {prettyMPvariables} -%D -%D Identifiers and system variables are typeset in a different -%D style. One can turn of this mechanism for the variables by -%D setting th enext boolean. -%D - -\doglobal\newif\ifprettyMPvariables - -\global\prettyMPvariablestrue - -%D We support \METAFONT\ as well as \METAPOST. - -\gdef\MPsetcontrols - {\saveprettycontrols - \everyprettyend - {\endMPtypesix}% - \def\obeyedspace% - {\endMPtypesix - \oldobeyedspace}% - \def\flushrestofverbatimline% - {\endMPtypesix}% - \let\obeytabs=\ignoretabs} - -\gdef\setupprettyMPtype - {\def\prettyidentifier{MP}% - \global\inMPtexmodefalse - \MPsetvariables - \MPsetcontrols - \MPsethandlers - \MPsetspecials} - -\doglobal\newif\ifinMPtexmode - -\gdef\MPsetvariables - {\global\inMPtexmodefalse - \global\let\MPsequence=\empty} - -\gdef\MPsetspecials - {\setpretty`\;=11 \setpretty`\$=12 \setpretty`\@=12 \setpretty`\#=12 - \setpretty`\%=20 - \setpretty`\[=31 \setpretty`\]=31 \setpretty`\(=32 \setpretty`\)=32 - \setpretty`\:=33 \setpretty`\==34 \setpretty`\<=34 \setpretty`\>=34 - \setpretty`\-=41 \setpretty`\+=41 \setpretty`\/=41 \setpretty`\*=41 - \setpretty`\|=41 \setpretty`\`=41 \setpretty`\!=41 \setpretty`\?=41 - \setpretty`\^=41 \setpretty`\&=42 - \setpretty`\\=50 - \setpretty`\1=61 \setpretty`\2=61 \setpretty`\3=61 \setpretty`\4=61 - \setpretty`\5=61 \setpretty`\6=61 \setpretty`\7=61 \setpretty`\8=61 - \setpretty`\9=61 \setpretty`\0=61 - \setpretty`\A=62 \setpretty`\B=62 \setpretty`\C=62 \setpretty`\D=62 \setpretty`\E=62 - \setpretty`\F=62 \setpretty`\G=62 \setpretty`\H=62 \setpretty`\I=62 \setpretty`\J=62 - \setpretty`\K=62 \setpretty`\L=62 \setpretty`\M=62 \setpretty`\N=62 \setpretty`\O=62 - \setpretty`\P=62 \setpretty`\Q=62 \setpretty`\R=62 \setpretty`\S=62 \setpretty`\T=62 - \setpretty`\U=62 \setpretty`\V=62 \setpretty`\W=62 \setpretty`\X=62 \setpretty`\Y=62 - \setpretty`\Z=62 - \setpretty`\a=62 \setpretty`\b=62 \setpretty`\c=62 \setpretty`\d=62 \setpretty`\e=62 - \setpretty`\f=62 \setpretty`\g=62 \setpretty`\h=62 \setpretty`\i=62 \setpretty`\j=62 - \setpretty`\k=62 \setpretty`\l=62 \setpretty`\m=62 \setpretty`\n=62 \setpretty`\o=62 - \setpretty`\p=62 \setpretty`\q=62 \setpretty`\r=62 \setpretty`\s=62 \setpretty`\t=62 - \setpretty`\u=62 \setpretty`\v=62 \setpretty`\w=62 \setpretty`\x=62 \setpretty`\y=62 - \setpretty`\z=62 - \setpretty`\_=62 - \setpretty`\,=70 \setpretty`\.=70 - \setpretty`\'=81 \setpretty`\"=82 - \setpretty`\{=90 \setpretty`\}=90 } - -\gdef\MPsethandlers - {\installprettyhandler 11 \MPtypeone - \installprettyhandler 12 \MPtypeone - \installprettyhandler 20 \MPtypetwo - \installprettyhandler 31 \MPtypethreeA - \installprettyhandler 32 \MPtypethreeA - \installprettyhandler 33 \MPtypethreeB - \installprettyhandler 34 \MPtypethreeB - \installprettyhandler 41 \MPtypefour - \installprettyhandler 42 \MPtypefour - \installprettyhandler 50 \MPtypefive - \installprettyhandler 61 \MPtypesixone - \installprettyhandler 62 \MPtypesixtwo - \installprettyhandler 70 \MPtypeseven - \installprettyhandler 81 \MPtypeeightone - \installprettyhandler 82 \MPtypeeighttwo - \installprettyhandler 90 \MPtypenine } - -\gdef\MPtypeone#1% - {\endMPtypesix - \ifinMPtexmode - \getpretty{#1}% - \else - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty% - \fi} - -\gdef\doMPtypetwo#1% - {\ifnaturaltextext - \let\next\naturaltextext - \else - \disableprettytrue\disableprettyafterwards - \def\next{\beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty}% - \fi - \next} - -\gdef\MPtypetwo - {\endMPtypesix - \ifnewpretty\expandafter\handlenewpretty\fi\doMPtypetwo} - -\gdef\MPtypethreeA#1% - {\endMPtypesix - \ifinMPtexmode - \getpretty{#1}% - \else - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \fi} - -\gdef\MPtypethreeB#1% - {\endMPtypesix - \ifinMPtexmode - \getpretty{#1}% - \else - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \fi} - -\gdef\MPtypefour#1% - {\endMPtypesix - \ifinMPtexmode - \getpretty{#1}% - \else - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \fi} - -\gdef\MPtypefive#1% - {\endMPtypesix - \ifinMPtexmode - \getpretty{#1}% - \else - \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty - \fi} - -\gdef\endMPtypesix - {\ifx\MPsequence\empty\else - \doifprettyidentifierelse{\MPsequence}{\MPidentifiers} - {\doifprettyidentifierelse{\MPsequence}{\MPbtex} - {\beginofpretty[\!!prettytwo]% - {\prettyidentifierfont\MPsequence}% - \endofpretty - \global\inMPtexmodetrue} - {\ifinMPtexmode - \doifprettyidentifierelse{\MPsequence}{\MPetex} - {\global\inMPtexmodefalse}{}% - \fi - \beginofpretty[\!!prettytwo]% - {\prettyidentifierfont\MPsequence}% - \endofpretty}} - {\ifprettyMPvariables - \doifprettyidentifierelse{\MPsequence}{\MPvariables} - {\beginofpretty[\!!prettytwo]% - {\prettyvariablefont\MPsequence}% - \endofpretty} - {\MPsequence}% - \else - \MPsequence - \fi}% - \global\let\MPsequence=\empty - \fi} - -\gdef\MPtypesixone - {\endMPtypesix - \getpretty} - -\gdef\MPtypesixtwo#1% - {\xdef\MPsequence{\MPsequence\getpretty{#1}}} - -\gdef\MPtypeseven#1% - {\endMPtypesix - \ifinMPtexmode - \getpretty{#1}% - \else - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \fi} - -\gdef\MPtypeeightone#1% - {\endMPtypesix - \ifinMPtexmode - \getpretty{#1}% - \else - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \fi} - -\gdef\MPtypeeighttwo#1% - {\endMPtypesix - \ifinMPtexmode - \getpretty{#1}% - \else - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \fi} - -\gdef\MPtypenine#1% - {\endMPtypesix - \ifinMPtexmode - \getpretty{#1}% - \else - \getpretty{#1}% - \fi} - -%D \METAPOST\ \TEX||ies: - -\useprettyidentifiers \MPbtex \MPsetspecials - btex verbatimtex - -\useprettyidentifiers \MPetex \MPsetspecials - etex - -\useprettyidentifiers \MPidentifiers \MPsetspecials - btex etex verbatimtex - -%D \METAPOST\ internal variables \& predefined variables: - -\useprettyidentifiers \MPidentifiers \MPsetspecials - charcode day linecap linejoin miterlimit month pausing - prologues showstopping time tracingcapsules tracingchoices mpprocset - tracingcommands tracingequations tracinglostchars - tracingmacros tracingonline tracingoutput tracingrestores - tracingspecs tracingstats tracingtitles truecorners - warningcheck year - -\useprettyidentifiers \MPvariables \MPsetspecials - ahangle ahlength bboxmargin defaultpen defaultscale - labeloffset background currentpen currentpicture cuttings - defaultfont extra_beginfig extra_endfig - -%D \METAPOST\ predefined constants: - -\useprettyidentifiers \MPidentifiers \MPsetspecials - false nullpicture pencircle true - -\useprettyidentifiers \MPvariables \MPsetspecials - beveled black blue bp butt cc cm dd ditto down epsilon - evenly fullcircle green halfcircle identity in infinity left - mitered mm origin pensquare pt quartercircle red right - rounded squared unitsquare up white withdots - -%D \METAPOST\ operators: - -\useprettyidentifiers \MPidentifiers \MPsetspecials - and angle arclength arctime ASCII bluepart boolean bot - char color cosd cycle decimal directiontime floor fontsize - greenpart hex infont intersectiontimes known length llcorner - lrcorner makepath makepen mexp mlog normaldeviate not - numeric oct odd or path pair pen penoffset picture point - postcontrol precontrol redpart reverse rotated scaled - shifted sind slanted sqrt str string subpath substring - transform transformed ulcorner uniformdeviate unknown - urcorner xpart xscaled xxpart xypart ypart yscaled yxpart - yypart zscaled - -\useprettyidentifiers \MPvariables \MPsetspecials - abs bbox ceiling center cutafter cutbefore dir - directionpoint div dotprod intersectionpoint inverse mod lft - round rt unitvector whatever - -%D \METAPOST\ commands: - -\useprettyidentifiers \MPidentifiers \MPsetspecials - addto clip input interim let newinternal save setbounds - shipout show showdependencies showtoken showvariable - special - -\useprettyidentifiers \MPvariables \MPsetspecials - cutdraw draw drawarrow drawdblarrow fill filldraw - loggingall pickup tracingall tracingnone undraw unfill - unfilldraw drawdot - -%D \METAPOST\ macro||like functions: - -\useprettyidentifiers \MPvariables \MPsetspecials - buildcycle dashpattern decr dotlabel dotlabels drawoptions - incr label labels max min thelabel z - -%D More \METAPOST: - -\useprettyidentifiers \MPidentifiers \MPsetspecials - begingroup endgroup of curl tension and controls - reflectedabout rotatedaround interpath on off beginfig - endfig def vardef enddef epxr suffix text primary secondary - tertiary primarydef secondarydef tertiarydef top bottom - ulft urt llft lrt randomseed also contour doublepath - withcolor withpen dashed if else elseif fi for endfor - forsuffixes forever downto upto step until end - -%D \METAFONT\ stuff: - -\useprettyidentifiers \MPidentifiers \MPsetspecials - charlist extensible fontdimen headerbyte kern ligtable - boundarychar chardp charext charht charic charwd designsize - fontmaking charexists - -\useprettyidentifiers \MPvariables \MPsetspecials - beginchar blacker capsule_end change_width - define_blacker_pixels define_corrected_pixels - define_good_x_pixels define_good_y_pixels - define_horizontal_corrected_pixels define_pixels - define_whole_blacker_pixels define_whole_pixels - define_whole_vertical_blacker_pixels - define_whole_vertical_pixels endchar extra_beginchar - extra_endchar extra_setup font_coding_scheme - font_extra_space - -%D \METAFONT\ no||op stuff: - -\useprettyidentifiers \MPidentifiers \MPsetspecials - cullit currenttransform gfcorners grayfont hround - imagerules lowres_fix nodisplays notransforms openit - displaying currentwindow screen_rows screen_cols - pixels_per_inch cull display openwindow numspecial - totalweight autorounding fillin proofing tracingpens - xoffset chardx granularity smoothing turningcheck yoffset - chardy hppp tracingedges vppp - -%D \METAPOST\ goodies: - -\useprettyidentifiers \MPidentifiers \MPsetspecials - extra_beginfig extra_endfig mpxbreak - -\protect - -\endinput diff --git a/tex/context/base/verb-pas.mkii b/tex/context/base/verb-pas.mkii new file mode 100644 index 000000000..0c9850abf --- /dev/null +++ b/tex/context/base/verb-pas.mkii @@ -0,0 +1,266 @@ +%D \module +%D [ file=verb-pas, +%D version=1999.12.09, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty \PASCAL\ and \MODULA\ Verbatim, +%D author=Berend de Boer, +%D date=\currentdate, +%D copyright={Berend de Boer \& Hans Hagen}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% This module will be cleaned up a bit in the process of more +% flexible verbatim options. + +\writestatus{loading}{ConTeXt Verbatim Macros / Pretty PASCAL Verbatim} + +%D Typeset Pascal(-like) code: +%D +%D \startbuffer +%D \startPAS +%D program Hello; +%D +%D begin +%D writeln('hello world.'); +%D end. +%D \stopPAS +%D \stopbuffer +%D +%D Berend's preferences: +%D +%D \startbuffer[setup] +%D \setuptyping +%D [DELPHI] +%D [palet=,icommand=\bf,vcommand=,ccommand=\it] +%D \stopbuffer + +\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi + +\unprotect + +\doglobal\newif\ifinPASbracketcomment +\doglobal\newif\ifinPASslashstarcomment +\doglobal\newif\ifinPASslashslashcomment + + +\gdef\PASsetspecials% + {\PLsetspecials + \setpretty`\#=32 + \setpretty`\%=41 + \setpretty`\:=41 + \setpretty`\/=43 + \setpretty`\*=44 + \setpretty`\{=45 \setpretty`\}=46 } + +\gdef\PASsethandlers% + {\PLsethandlers + \installprettyhandler 43 \PAStypefourthree + \installprettyhandler 44 \PAStypefourfour + \installprettyhandler 45 \PAStypefourfive + \installprettyhandler 46 \PAStypefoursix } + +\gdef\PASsetcontrols% + {\PLsetcontrols + \def\flushrestofverbatimline% + {\endPLtypesix + \ifinPASslashslashcomment + \PASstopslashslashcomment + \fi + \PLverbosefalse + \PLverboseskipped=0}} + +\gdef\PASsetvariables + {\PLsetvariables + \global\inPASbracketcommentfalse + \global\inPASslashstarcommentfalse + \global\inPASslashslashcommentfalse} + +\gdef\setupprettyPAStype% + {\def\prettyidentifier{PAS}% + \let\PLidentifiers=\PASidentifiers + \let\PLvariables=\PASvariables + \PASsetvariables + \PASsetcontrols + \PASsethandlers + \PASsetspecials + \PLsetdiagnostics} + +% the // and /* comments + +\gdef\PAStypefourthree% + {\handlenextnextpretty\doPAStypefourthree\PLtypefourtwo} + +\gdef\doPAStypefourthree#1#2% + {\endPLtypesix + \ifinPLcomment + \let\next=\PLtypefourtwo + \else + \ifinPLsingle + \let\next=\PLtypefourtwo + \else + \getprettydata{#2}% + \ifnum\prettytype=43 + \PLverbosecorrection + \let\next=\PASstartslashslashcomment + \else\ifnum\prettytype=44 + \PLverbosecorrection + \let\next=\PASstartslashstarcomment + \else + \let\next=\PLtypefourtwo + \fi\fi + \fi + \fi + \next{#1}#2} + +\gdef\PASstartslashstarcomment#1#2% + {\global\inPLcommenttrue + \global\inPASslashstarcommenttrue + \prettynaturalfont + \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty} + +\gdef\PASstopslashstarcomment#1#2% + {\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty + \verbatimfont + \global\inPLcommentfalse + \global\inPASslashstarcommentfalse} + +\gdef\PASstartslashslashcomment#1#2% + {\global\inPLcommenttrue + \global\inPASslashslashcommenttrue + \prettynaturalfont + \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty} + +\gdef\PASstopslashslashcomment% + {\verbatimfont + \inPLcommentfalse + \inPASslashslashcommentfalse} + +% \gdef\dodoPAStypefourthree% #1% +% {\endPLtypesix +% \handlenextnextpretty\dododoPAStypefourthree\dodododoPLtypefourthree} + +% \gdef\dododoPAStypefourthree% +% {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoPAStypefourthree} + +% \gdef\dodododoPAStypefourthree#1#2% +% {\ifinPLcomment +% \getpretties{#1}{#2}% +% \else +% \global\inPLcommenttrue +% \PLverbosecorrection +% \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty +% \fi} + +\gdef\PAStypefourfour% + {\handlenextnextpretty\doPAStypefourfour\PLtypefourtwo} + +\gdef\doPAStypefourfour#1#2% + {\ifinPASslashstarcomment + \getprettydata{#2}% + \ifnum\prettytype=43 + \PASstopslashstarcomment{#1}#2% + \else + \endPLtypesix + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \expandafter#2% + \fi + \else + \endPLtypesix + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \expandafter#2% + \fi} + + +% the { and } comments +% we assume { is closed by } and do not follow the braindead Standard +% Pascal standard in this respect +% Note: brackets are not output correctly if natural font is \tf. +% Therefore natural font is default to \tttf now (Hans is this ok??) +% You have to use postscript fonts it seems to get brackets in that case. + +\gdef\PAStypefourfive#1% + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else + \ifinPLsingle + \getpretty{#1}% + \else + \global\inPLcommenttrue + \global\inPASbracketcommenttrue + \prettynaturalfont + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \fi + \fi} + +\gdef\PAStypefoursix#1% + {\endPLtypesix + \ifinPASbracketcomment + \prettynaturalfont\beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \verbatimfont + \global\inPLcommentfalse + \global\inPASbracketcommentfalse + \else + \getpretty{#1}% + \fi} + + +% Standard Pascal keywords (ISO/IEC 7185) + +\useprettyidentifiers \PASidentifiers \PASsetspecials + and array begin case const div do downto else end file + for function goto if in label mod nil not of or packed + procedure program record repeat set then to type until + var while with + +% Standard Pascal directives (ISO/IEC 7185) + +\useprettyidentifiers \PASidentifiers \PASsetspecials + forward + +% Extended Pascal keywords (ISO/IEC 10206) + +\useprettyidentifiers \PASidentifiers \PASsetspecials + and_then bindable export import module only or_else + otherwise pow protected qualified restricted + +% Extended Pascal directives (ISO/IEC 10206) + +\useprettyidentifiers \PASidentifiers \PASsetspecials + implementation interface + +% Object Pascal keywords (draft September 20, 1993) + +\useprettyidentifiers \PASidentifiers \PASsetspecials + abstract class constructor destructor inherited is + property view + +% Object Pascal directives (draft September 20, 1993) + +\useprettyidentifiers \PASidentifiers \PASsetspecials + override + +% Delphi keywords + +\useprettyidentifiers \PASidentifiers \PASsetspecials + as asm dispinterface except exports finalization finally + initialization inline library object out raise resourcestring + shl shr string threadvar try unit uses xor + +% Delphi directives +% the read and write directive have been skipped +% as they're pretty common procedure calls too + +\useprettyidentifiers \PASidentifiers \PASsetspecials + absolute assembler automated cdecl contains default dispid + dynamic external far implements index message name near + nodefault overload override package pascal private protected + public published readonly register reintroduce requires + resident safecall stdcall stored virtual writeonly + +\useprettyidentifiers \PASvariables \PASsetspecials + not-yet-defined + +\protect \endinput diff --git a/tex/context/base/verb-pas.tex b/tex/context/base/verb-pas.tex deleted file mode 100644 index 0c9850abf..000000000 --- a/tex/context/base/verb-pas.tex +++ /dev/null @@ -1,266 +0,0 @@ -%D \module -%D [ file=verb-pas, -%D version=1999.12.09, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty \PASCAL\ and \MODULA\ Verbatim, -%D author=Berend de Boer, -%D date=\currentdate, -%D copyright={Berend de Boer \& Hans Hagen}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% This module will be cleaned up a bit in the process of more -% flexible verbatim options. - -\writestatus{loading}{ConTeXt Verbatim Macros / Pretty PASCAL Verbatim} - -%D Typeset Pascal(-like) code: -%D -%D \startbuffer -%D \startPAS -%D program Hello; -%D -%D begin -%D writeln('hello world.'); -%D end. -%D \stopPAS -%D \stopbuffer -%D -%D Berend's preferences: -%D -%D \startbuffer[setup] -%D \setuptyping -%D [DELPHI] -%D [palet=,icommand=\bf,vcommand=,ccommand=\it] -%D \stopbuffer - -\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi - -\unprotect - -\doglobal\newif\ifinPASbracketcomment -\doglobal\newif\ifinPASslashstarcomment -\doglobal\newif\ifinPASslashslashcomment - - -\gdef\PASsetspecials% - {\PLsetspecials - \setpretty`\#=32 - \setpretty`\%=41 - \setpretty`\:=41 - \setpretty`\/=43 - \setpretty`\*=44 - \setpretty`\{=45 \setpretty`\}=46 } - -\gdef\PASsethandlers% - {\PLsethandlers - \installprettyhandler 43 \PAStypefourthree - \installprettyhandler 44 \PAStypefourfour - \installprettyhandler 45 \PAStypefourfive - \installprettyhandler 46 \PAStypefoursix } - -\gdef\PASsetcontrols% - {\PLsetcontrols - \def\flushrestofverbatimline% - {\endPLtypesix - \ifinPASslashslashcomment - \PASstopslashslashcomment - \fi - \PLverbosefalse - \PLverboseskipped=0}} - -\gdef\PASsetvariables - {\PLsetvariables - \global\inPASbracketcommentfalse - \global\inPASslashstarcommentfalse - \global\inPASslashslashcommentfalse} - -\gdef\setupprettyPAStype% - {\def\prettyidentifier{PAS}% - \let\PLidentifiers=\PASidentifiers - \let\PLvariables=\PASvariables - \PASsetvariables - \PASsetcontrols - \PASsethandlers - \PASsetspecials - \PLsetdiagnostics} - -% the // and /* comments - -\gdef\PAStypefourthree% - {\handlenextnextpretty\doPAStypefourthree\PLtypefourtwo} - -\gdef\doPAStypefourthree#1#2% - {\endPLtypesix - \ifinPLcomment - \let\next=\PLtypefourtwo - \else - \ifinPLsingle - \let\next=\PLtypefourtwo - \else - \getprettydata{#2}% - \ifnum\prettytype=43 - \PLverbosecorrection - \let\next=\PASstartslashslashcomment - \else\ifnum\prettytype=44 - \PLverbosecorrection - \let\next=\PASstartslashstarcomment - \else - \let\next=\PLtypefourtwo - \fi\fi - \fi - \fi - \next{#1}#2} - -\gdef\PASstartslashstarcomment#1#2% - {\global\inPLcommenttrue - \global\inPASslashstarcommenttrue - \prettynaturalfont - \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty} - -\gdef\PASstopslashstarcomment#1#2% - {\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty - \verbatimfont - \global\inPLcommentfalse - \global\inPASslashstarcommentfalse} - -\gdef\PASstartslashslashcomment#1#2% - {\global\inPLcommenttrue - \global\inPASslashslashcommenttrue - \prettynaturalfont - \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty} - -\gdef\PASstopslashslashcomment% - {\verbatimfont - \inPLcommentfalse - \inPASslashslashcommentfalse} - -% \gdef\dodoPAStypefourthree% #1% -% {\endPLtypesix -% \handlenextnextpretty\dododoPAStypefourthree\dodododoPLtypefourthree} - -% \gdef\dododoPAStypefourthree% -% {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoPAStypefourthree} - -% \gdef\dodododoPAStypefourthree#1#2% -% {\ifinPLcomment -% \getpretties{#1}{#2}% -% \else -% \global\inPLcommenttrue -% \PLverbosecorrection -% \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty -% \fi} - -\gdef\PAStypefourfour% - {\handlenextnextpretty\doPAStypefourfour\PLtypefourtwo} - -\gdef\doPAStypefourfour#1#2% - {\ifinPASslashstarcomment - \getprettydata{#2}% - \ifnum\prettytype=43 - \PASstopslashstarcomment{#1}#2% - \else - \endPLtypesix - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \expandafter#2% - \fi - \else - \endPLtypesix - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \expandafter#2% - \fi} - - -% the { and } comments -% we assume { is closed by } and do not follow the braindead Standard -% Pascal standard in this respect -% Note: brackets are not output correctly if natural font is \tf. -% Therefore natural font is default to \tttf now (Hans is this ok??) -% You have to use postscript fonts it seems to get brackets in that case. - -\gdef\PAStypefourfive#1% - {\endPLtypesix - \ifinPLcomment - \getpretty{#1}% - \else - \ifinPLsingle - \getpretty{#1}% - \else - \global\inPLcommenttrue - \global\inPASbracketcommenttrue - \prettynaturalfont - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \fi - \fi} - -\gdef\PAStypefoursix#1% - {\endPLtypesix - \ifinPASbracketcomment - \prettynaturalfont\beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \verbatimfont - \global\inPLcommentfalse - \global\inPASbracketcommentfalse - \else - \getpretty{#1}% - \fi} - - -% Standard Pascal keywords (ISO/IEC 7185) - -\useprettyidentifiers \PASidentifiers \PASsetspecials - and array begin case const div do downto else end file - for function goto if in label mod nil not of or packed - procedure program record repeat set then to type until - var while with - -% Standard Pascal directives (ISO/IEC 7185) - -\useprettyidentifiers \PASidentifiers \PASsetspecials - forward - -% Extended Pascal keywords (ISO/IEC 10206) - -\useprettyidentifiers \PASidentifiers \PASsetspecials - and_then bindable export import module only or_else - otherwise pow protected qualified restricted - -% Extended Pascal directives (ISO/IEC 10206) - -\useprettyidentifiers \PASidentifiers \PASsetspecials - implementation interface - -% Object Pascal keywords (draft September 20, 1993) - -\useprettyidentifiers \PASidentifiers \PASsetspecials - abstract class constructor destructor inherited is - property view - -% Object Pascal directives (draft September 20, 1993) - -\useprettyidentifiers \PASidentifiers \PASsetspecials - override - -% Delphi keywords - -\useprettyidentifiers \PASidentifiers \PASsetspecials - as asm dispinterface except exports finalization finally - initialization inline library object out raise resourcestring - shl shr string threadvar try unit uses xor - -% Delphi directives -% the read and write directive have been skipped -% as they're pretty common procedure calls too - -\useprettyidentifiers \PASidentifiers \PASsetspecials - absolute assembler automated cdecl contains default dispid - dynamic external far implements index message name near - nodefault overload override package pascal private protected - public published readonly register reintroduce requires - resident safecall stdcall stored virtual writeonly - -\useprettyidentifiers \PASvariables \PASsetspecials - not-yet-defined - -\protect \endinput diff --git a/tex/context/base/verb-pl.mkii b/tex/context/base/verb-pl.mkii new file mode 100644 index 000000000..47ce9a54f --- /dev/null +++ b/tex/context/base/verb-pl.mkii @@ -0,0 +1,547 @@ +%D \module +%D [ file=verb-pl, +%D version=1997.12.22, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty \PERL\ Verbatim, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Verbatim Macros / Pretty PERL Verbatim} + +%D When I rewrote \TEXUTIL\ in \PERL\ I decided to write a +%D pretty \PERL\ interpreter too. In fact, this was the main +%D reason for rewriting the pretty verbatim mechanisms to +%D handle more that \TEX. +%D +%D \startPL +%D $alfa = $beta{gamma}; +%D if ($alfa="delta") +%D { print "epsilon" } +%D \stopPL +%D +%D When looking at the macros, watch the \type{\doglobal}'s! +%D They're something \CONTEXT\ specific. + +\unprotect + +%D \macros +%D {prettyPLvariables} +%D +%D Identifiers and system variables get a special treatment. +%D One can disable this option for the variables by resetting +%D the next switch. + +\doglobal\newif\ifprettyPLvariables + +\global\prettyPLvariablestrue + +%D As said before, the global assignment is needed in +%D \CONTEXT\ (for once||only loading on demand). + +\doglobal\newif\ifinPLsingle +\doglobal\newif\ifinPLdouble +\doglobal\newif\ifinPLcomment +\doglobal\newif\ifinPLdoc % only used in java filter +\doglobal\newif\ifPLdocdone % only used in java filter +\doglobal\newif\ifPLverbose + +\newcount\PLverboseskipped + +\gdef\PLverbosecorrection% + {\ifnum\PLverboseskipped>0 + \obeyedspace + \advance\PLverboseskipped -1 + \@EA\PLverbosecorrection + \fi} + +\gdef\PLsetcontrols% + {\saveprettycontrols + \def\obeyedspace% + {\endPLtypesix + \ifPLverbose + \advance\PLverboseskipped 1 + \else + \oldobeyedspace + \fi}% + \def\flushrestofverbatimline% + {\endPLtypesix + \global\inPLcommentfalse}% + \def\obeyedline% + {\PLverbosefalse + \PLverboseskipped=0 + \PLdocdonefalse + \oldobeyedline}% + \let\obeytabs=\ignoretabs} + +\gdef\JVsetcontrols% + {\PLsetcontrols + {\endPLtypesix + \ifcase\JVcommentlevel \inPLcommentfalse \fi + \PLverbosefalse + \PLverboseskipped=0}} + +\gdef\setupprettyPLtype% + {\def\prettyidentifier{PL}% + \PLsetvariables + \PLsetcontrols + \PLsethandlers + \PLsetspecials + \PLsetdiagnostics} + +\gdef\PLsetvariables% + {\global\inPLsinglefalse + \global\inPLdoublefalse + \global\inPLcommentfalse + \global\let\PLsequence=\empty + \global\let\PLprefix=\empty} + +\gdef\PLsetspecials% + {\setpretty`\{=10 \setpretty`\}=10 + \setpretty`\$=21 \setpretty`\@=21 \setpretty`\%=22 + \setpretty`\[=31 \setpretty`\]=31 \setpretty`\(=32 \setpretty`\)=32 + \setpretty`\==32 \setpretty`\~=32 \setpretty`\<=32 \setpretty`\>=32 + \setpretty`\-=41 \setpretty`\+=41 \setpretty`\/=41 \setpretty`\*=41 + \setpretty`\|=41 \setpretty`\`=41 \setpretty`\!=41 \setpretty`\?=41 + \setpretty`\^=41 \setpretty`\&=42 + \setpretty`\\=50 + \setpretty`\1=61 \setpretty`\2=61 \setpretty`\3=61 \setpretty`\4=61 + \setpretty`\5=61 \setpretty`\6=61 \setpretty`\7=61 \setpretty`\8=61 + \setpretty`\9=61 \setpretty`\0=61 \setpretty`\_=61 + \setpretty`\A=62 \setpretty`\B=62 \setpretty`\C=62 \setpretty`\D=62 \setpretty`\E=62 + \setpretty`\F=62 \setpretty`\G=62 \setpretty`\H=62 \setpretty`\I=62 \setpretty`\J=62 + \setpretty`\K=62 \setpretty`\L=62 \setpretty`\M=62 \setpretty`\N=62 \setpretty`\O=62 + \setpretty`\P=62 \setpretty`\Q=62 \setpretty`\R=62 \setpretty`\S=62 \setpretty`\T=62 + \setpretty`\U=62 \setpretty`\V=62 \setpretty`\W=62 \setpretty`\X=62 \setpretty`\Y=62 + \setpretty`\Z=62 + \setpretty`\a=62 \setpretty`\b=62 \setpretty`\c=62 \setpretty`\d=62 \setpretty`\e=62 + \setpretty`\f=62 \setpretty`\g=62 \setpretty`\h=62 \setpretty`\i=62 \setpretty`\j=62 + \setpretty`\k=62 \setpretty`\l=62 \setpretty`\m=62 \setpretty`\n=62 \setpretty`\o=62 + \setpretty`\p=62 \setpretty`\q=62 \setpretty`\r=62 \setpretty`\s=62 \setpretty`\t=62 + \setpretty`\u=62 \setpretty`\v=62 \setpretty`\w=62 \setpretty`\x=62 \setpretty`\y=62 + \setpretty`\z=62 + \setpretty`\;=71 \setpretty`\:=72 \setpretty`\,=71 \setpretty`\.=71 + \setpretty`\'=80 + \setpretty`\"=90 + \setpretty`\#= 0 } + +\gdef\PLsethandlers% + {\installprettyhandler 10 \PLtypeone + \installprettyhandler 21 \PLtypetwo + \installprettyhandler 22 \PLtypetwo + \installprettyhandler 31 \PLtypethree + \installprettyhandler 32 \PLtypethree + \installprettyhandler 41 \PLtypefourone + \installprettyhandler 42 \PLtypefourtwo + \installprettyhandler 50 \PLtypefive + \installprettyhandler 61 \PLtypesixone + \installprettyhandler 62 \PLtypesixtwo + \installprettyhandler 71 \PLtypesevenone + \installprettyhandler 72 \PLtypeseventwo + \installprettyhandler 80 \PLtypeeight + \installprettyhandler 90 \PLtypenine + \installprettyhandler 0 \PLtypezero} + +\gdef\PLtypeone#1% + {\ifinPLdouble + \PLverbosefalse + \ifinPLcomment + \endPLtypesix + \getpretty{#1}% + \else\ifx\PLprefix\empty + \endPLtypesix + \getpretty{#1}% + \else + \endPLtypesix + \xdef\PLprefix{\getpretty{#1}}% + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \fi\fi + \else + \endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else\ifinPLsingle + \getpretty{#1}% + \else + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \fi\fi + \fi} + +% \gdef\PLtypetwo#1% +% {\endPLtypesix +% \xdef\PLprefix{\getpretty{#1}}% +% \ifinPLcomment +% \getpretty{#1}% +% \else\ifinPLsingle +% \getpretty{#1}% +% \else\ifinPLdouble +% \getprettydata{#1}% +% \ifnum\prettytype=21 +% \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty +% \else +% \getpretty{#1}% +% \fi +% \else +% \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty +% \fi\fi\fi} + +\gdef\PLtypetwo#1% + {\endPLtypesix + \ifinPLdoc + \xdef\PLsequence{\PLsequence\getpretty{#1}}% + \else\ifinPLcomment + \getpretty{#1}% + \else\ifinPLsingle + \getpretty{#1}% + \else\ifinPLdouble + \getprettydata{#1}% + \ifnum\prettytype=21 + \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty + \else + \getpretty{#1}% + \fi + \else + \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty + \fi\fi\fi\fi} + +\gdef\PLtypethree#1% + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else\ifinPLsingle + \getpretty{#1}% + \else\ifinPLdouble + \getprettydata{#1}% + \ifnum\prettytype=31 + \ifx\PLprefix\empty + \getpretty{#1}% + \else + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \fi + \else + \getpretty{#1}% + \fi + \else + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \fi\fi\fi} + +\gdef\PLtypefourone#1% + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else\ifinPLsingle + \getpretty{#1}% + \else\ifinPLdouble + \getpretty{#1}% + \else + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \fi\fi\fi} + +\gdef\doPLtypefourtwo#1#2% + {\PLverbosefalse + \getprettydata{#2}% + \ifnum\prettytype=62 + \expandafter\PLtypetwo + \else + \expandafter\PLtypefourone + \fi + {#1}#2} + +\gdef\PLtypefourtwo% + {\handlenextnextpretty\doPLtypefourtwo\PLtypefourone} + +\gdef\doPLtypefiveA#1#2% + {\endPLtypesix + \ifinPLcomment + \getpretties{#1}{#2}% + \else\ifinPLsingle + \getprettydata{#2}% + \ifnum\prettytype=50 + \beginofpretty[\!!prettytwo]\getpretties{#1}{#2}\endofpretty + \else\ifnum\prettytype=80 + \beginofpretty[\!!prettytwo]\getpretties{#1}{#2}\endofpretty + \else + \getpretties{#1}{#2}% + \fi\fi + \else + \beginofpretty[\!!prettytwo]\getpretties{#1}{#2}\endofpretty + \fi\fi} + +\gdef\doPLtypefiveB#1% + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else\ifinPLsingle + \getpretty{#1}% + \else + \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty + \fi\fi} + +\gdef\PLtypefive% + {\ifPLverbose + \expandafter\PLtypesixtwo + \else + \expandafter\handlenextnextpretty\expandafter\doPLtypefiveA\expandafter\doPLtypefiveB + \fi} + +% \gdef\endPLtypesix% +% {\ifx\PLsequence\empty\else +% \ifinPLcomment +% \PLsequence +% \else\ifinPLsingle +% \PLsequence +% \else\ifinPLdouble +% \PLsequence +% \else\ifPLverbose +% \beginofpretty[\!!prettytwo]\PLsequence\endofpretty +% \PLverbosefalse +% \else\ifx\PLprefix\empty +% \doifprettyidentifierelse{\PLsequence}{\PLverboses} +% {\PLverbosetrue\PLverboseskipped=3 } +% {\doifprettyidentifierelse{\PLsequence}{\PLidentifiers} +% {\beginofpretty[\!!prettytwo]% +% {\prettyidentifierfont\PLsequence}% +% \endofpretty} +% {\ifprettyPLvariables +% \doifprettyidentifierelse{\PLsequence}{\PLvariables} +% {\beginofpretty[\!!prettytwo]% +% {\prettyvariablefont\PLsequence}% +% \endofpretty} +% {\PLsequence}% +% \else +% \PLsequence +% \fi}}% +% \else\ifprettyPLvariables +% \doifprettyidentifierelse{\PLprefix\PLsequence}{\PLvariables} +% {\beginofpretty[\!!prettytwo]% +% {\prettyvariablefont\PLsequence}% +% \endofpretty} +% {\PLsequence}% +% \else +% \PLsequence +% \fi\fi\fi\fi\fi\fi +% \global\let\PLsequence=\empty +% \global\let\PLprefix=\empty +% \fi} + +\gdef\endPLtypesix + {\ifx\PLsequence\empty\else + \ifinPLdoc + \doendPLtypesixvar\!!prettythree + \else\ifinPLcomment + \PLsequence + \else\ifinPLsingle + \PLsequence + \else\ifinPLdouble + \PLsequence + \else\ifPLverbose + \beginofpretty[\!!prettytwo]\PLsequence\endofpretty + \PLverbosefalse + \else\ifx\PLprefix\empty + \doendPLtypesix\!!prettytwo + \else\ifprettyPLvariables + \doendPLtypesixvar\!!prettytwo + \else + \PLsequence + \fi\fi\fi\fi\fi\fi\fi + \global\let\PLsequence\empty + \global\let\PLprefix\empty + \fi} + +\gdef\doendPLtypesix#1% + {\doifprettyidentifierelse{\PLsequence}{\PLverboses} + {\PLverbosetrue\PLverboseskipped=3 } + {\doifprettyidentifierelse{\PLsequence}{\PLidentifiers} + {\beginofpretty[#1]% + {\prettyidentifierfont\PLsequence}% + \endofpretty} + {\ifprettyPLvariables + \doifprettyidentifierelse{\PLsequence}{\PLvariables} + {\beginofpretty[#1]% + {\prettyvariablefont\PLsequence}% + \endofpretty} + {\PLsequence}% + \else + \PLsequence + \fi}}} + +\gdef\doendPLtypesixvar#1% + {\doifprettyidentifierelse{\PLprefix\PLsequence}{\PLvariables} + {\beginofpretty[#1]% + {\prettyvariablefont\PLsequence}% + \endofpretty} + {\PLsequence}} + +\gdef\PLtypesixone + {\ifx\PLsequence\empty + \expandafter\getpretty + \else + \expandafter\PLtypesixtwo + \fi} + +% \gdef\PLtypesixtwo#1% +% {\ifinPLcomment +% \getpretty{#1}% +% \else\ifinPLsingle +% \getpretty{#1}% +% \else\ifinPLdouble +% \ifx\PLprefix\empty +% \getpretty{#1}% +% \else +% \xdef\PLsequence{\PLsequence\getpretty{#1}}% +% \fi +% \else +% \xdef\PLsequence{\PLsequence\getpretty{#1}}% +% \fi\fi\fi} + +\gdef\PLtypesixtwo#1% + {\ifinPLdoc + \xdef\PLsequence{\PLsequence\getpretty{#1}}% + \else\ifinPLcomment + \getpretty{#1}% + \else\ifinPLsingle + \getpretty{#1}% + \else\ifinPLdouble + \ifx\PLprefix\empty + \getpretty{#1}% + \else + \xdef\PLsequence{\PLsequence\getpretty{#1}}% + \fi + \else + \xdef\PLsequence{\PLsequence\getpretty{#1}}% + \fi\fi\fi\fi} + +\gdef\PLtypesevenone#1% + {\endPLtypesix + \getpretty{#1}} + +\gdef\PLtypeseventwo% + {\handlenextnextpretty\doPLtypeseventwo\PLtypesevenone} + +\gdef\doPLtypeseventwo#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=72 + \PLtypesixtwo{#1}\PLtypesixtwo{#1}% + \else + \PLtypesevenone{#1}\expandafter#2% + \fi} + +\gdef\PLtypeeight#1% single quote + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else\ifinPLdouble + \getpretty{#1}% + \else\ifinPLsingle + \global\inPLsinglefalse + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \else + \global\inPLsingletrue + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \fi\fi\fi} + +\gdef\PLtypenine#1% double quote + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else\ifinPLsingle + \getpretty{#1}% + \else\ifinPLdouble + \global\inPLdoublefalse + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \else + \global\inPLdoubletrue + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \fi\fi\fi} + +\gdef\PLtypezero% + {\endPLtypesix + \ifnewpretty\expandafter\handlenewpretty\fi\doPLtypezero} + +\gdef\doPLtypezero#1% + {\ifinPLcomment + \getpretty{#1}% + \else + \global\inPLcommenttrue + \PLverbosecorrection + \ifnaturaltextext % non tested yet + \let\next\naturaltextext + \else + \def\next{\beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% + \fi + \expandafter\next + \fi} + +\gdef\doreportprettyPLtype#1#2#3#4% + {#1% + [PERL \string#2 typing conflict, use \string#3 instead] + \writestatus + {PERL typing} + {use \string#3 instead of \string#2 to enable propper visualization}% + \global#4% + \expandafter\doemptyverbatimline + \fi} + +\gdef\reportprettyPLtype% + {\doreportprettyPLtype\ifinPLsingle'\'\inPLsinglefalse + \doreportprettyPLtype\ifinPLdouble"\"\inPLdoublefalse} + +\gdef\PLsetdiagnostics% + {\let\normaldoemptyverbatimline=\doemptyverbatimline + \def\doemptyverbatimline% + {\normaldoemptyverbatimline + \reportprettyPLtype}} + +%D The official \PERL\ version 5 keywords: + +\useprettyidentifiers \PLidentifiers \PLsetspecials + abs accept alarm and atan atan2 bind binmode bless caller + chdir chmod chomp chop chown chr chroot close closedir cmp + connect continue cos crypt dbmclose dbmopen defined delete + die do dump each echo else elsif endgrent endhostent + endnetent endprotoend endpwent endservent eof eq eval exec + exists exit exp fcntl fileno flock for foreach fork format + formline getc getgrent getgrgid getgrnam gethostbyaddr + gethostbyname gethostent getlogin getnetbyaddr getnetbyname + getnetent getpeername getpgrp getppid getpriority + getprotobyname getprotobynumber getprotoent getpwent + getpwnam getpwuid getservbyname getservbyport getservent + getsockname getsockopt glob gmtime goto grep gt hex if + import index int integer ioctl join keys kill last lc + lcfirst le length lib link listen local localtime log lstat + lt map method mkdir msgctl msgget msgrcv msgsnd my ne next + no not oct open opendir or ord pack package pipe pop pos + print printf process prompt push quotemeta rand read readdir + readlink recv redo ref rename require reset return reverse + rewinddir rindex rmdir scalar seek seekdir select semctl + semget semop send setgrent sethostent setnetent setpgrp + setpriority setprotoent setpwent setservent setsockopt shift + shmctl shmget shmread shmwrite shutdown sin sleep socket + socketpair sort splice split sprintf sqrt srand stat strict + study sub subs substr symlink syscall sysopen sysread system + syswrite tell telldir tie tied time times times truncate uc + ucfirst ucmask umask unary undef unless unlink unpack + unshift untie until use utime values vars vec wait waitpid + wantarray warn warn while write xor + +%D Additional module keywords (still incomplete): + +\useprettyidentifiers \PLvariables \PLsetspecials + Getopt::Long + $Getopt::Long::passthrough + $Getopt::Long::autoabbrev + &GetOptions + +%D A funny hack. When prefixes by \type{TEX}, a \type{\csname} +%D is typeset as \TEX\ sequence. + +\useprettyidentifiers \PLverboses \PLsetspecials + TEX + +\protect + +\endinput diff --git a/tex/context/base/verb-pl.tex b/tex/context/base/verb-pl.tex deleted file mode 100644 index 47ce9a54f..000000000 --- a/tex/context/base/verb-pl.tex +++ /dev/null @@ -1,547 +0,0 @@ -%D \module -%D [ file=verb-pl, -%D version=1997.12.22, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty \PERL\ Verbatim, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Verbatim Macros / Pretty PERL Verbatim} - -%D When I rewrote \TEXUTIL\ in \PERL\ I decided to write a -%D pretty \PERL\ interpreter too. In fact, this was the main -%D reason for rewriting the pretty verbatim mechanisms to -%D handle more that \TEX. -%D -%D \startPL -%D $alfa = $beta{gamma}; -%D if ($alfa="delta") -%D { print "epsilon" } -%D \stopPL -%D -%D When looking at the macros, watch the \type{\doglobal}'s! -%D They're something \CONTEXT\ specific. - -\unprotect - -%D \macros -%D {prettyPLvariables} -%D -%D Identifiers and system variables get a special treatment. -%D One can disable this option for the variables by resetting -%D the next switch. - -\doglobal\newif\ifprettyPLvariables - -\global\prettyPLvariablestrue - -%D As said before, the global assignment is needed in -%D \CONTEXT\ (for once||only loading on demand). - -\doglobal\newif\ifinPLsingle -\doglobal\newif\ifinPLdouble -\doglobal\newif\ifinPLcomment -\doglobal\newif\ifinPLdoc % only used in java filter -\doglobal\newif\ifPLdocdone % only used in java filter -\doglobal\newif\ifPLverbose - -\newcount\PLverboseskipped - -\gdef\PLverbosecorrection% - {\ifnum\PLverboseskipped>0 - \obeyedspace - \advance\PLverboseskipped -1 - \@EA\PLverbosecorrection - \fi} - -\gdef\PLsetcontrols% - {\saveprettycontrols - \def\obeyedspace% - {\endPLtypesix - \ifPLverbose - \advance\PLverboseskipped 1 - \else - \oldobeyedspace - \fi}% - \def\flushrestofverbatimline% - {\endPLtypesix - \global\inPLcommentfalse}% - \def\obeyedline% - {\PLverbosefalse - \PLverboseskipped=0 - \PLdocdonefalse - \oldobeyedline}% - \let\obeytabs=\ignoretabs} - -\gdef\JVsetcontrols% - {\PLsetcontrols - {\endPLtypesix - \ifcase\JVcommentlevel \inPLcommentfalse \fi - \PLverbosefalse - \PLverboseskipped=0}} - -\gdef\setupprettyPLtype% - {\def\prettyidentifier{PL}% - \PLsetvariables - \PLsetcontrols - \PLsethandlers - \PLsetspecials - \PLsetdiagnostics} - -\gdef\PLsetvariables% - {\global\inPLsinglefalse - \global\inPLdoublefalse - \global\inPLcommentfalse - \global\let\PLsequence=\empty - \global\let\PLprefix=\empty} - -\gdef\PLsetspecials% - {\setpretty`\{=10 \setpretty`\}=10 - \setpretty`\$=21 \setpretty`\@=21 \setpretty`\%=22 - \setpretty`\[=31 \setpretty`\]=31 \setpretty`\(=32 \setpretty`\)=32 - \setpretty`\==32 \setpretty`\~=32 \setpretty`\<=32 \setpretty`\>=32 - \setpretty`\-=41 \setpretty`\+=41 \setpretty`\/=41 \setpretty`\*=41 - \setpretty`\|=41 \setpretty`\`=41 \setpretty`\!=41 \setpretty`\?=41 - \setpretty`\^=41 \setpretty`\&=42 - \setpretty`\\=50 - \setpretty`\1=61 \setpretty`\2=61 \setpretty`\3=61 \setpretty`\4=61 - \setpretty`\5=61 \setpretty`\6=61 \setpretty`\7=61 \setpretty`\8=61 - \setpretty`\9=61 \setpretty`\0=61 \setpretty`\_=61 - \setpretty`\A=62 \setpretty`\B=62 \setpretty`\C=62 \setpretty`\D=62 \setpretty`\E=62 - \setpretty`\F=62 \setpretty`\G=62 \setpretty`\H=62 \setpretty`\I=62 \setpretty`\J=62 - \setpretty`\K=62 \setpretty`\L=62 \setpretty`\M=62 \setpretty`\N=62 \setpretty`\O=62 - \setpretty`\P=62 \setpretty`\Q=62 \setpretty`\R=62 \setpretty`\S=62 \setpretty`\T=62 - \setpretty`\U=62 \setpretty`\V=62 \setpretty`\W=62 \setpretty`\X=62 \setpretty`\Y=62 - \setpretty`\Z=62 - \setpretty`\a=62 \setpretty`\b=62 \setpretty`\c=62 \setpretty`\d=62 \setpretty`\e=62 - \setpretty`\f=62 \setpretty`\g=62 \setpretty`\h=62 \setpretty`\i=62 \setpretty`\j=62 - \setpretty`\k=62 \setpretty`\l=62 \setpretty`\m=62 \setpretty`\n=62 \setpretty`\o=62 - \setpretty`\p=62 \setpretty`\q=62 \setpretty`\r=62 \setpretty`\s=62 \setpretty`\t=62 - \setpretty`\u=62 \setpretty`\v=62 \setpretty`\w=62 \setpretty`\x=62 \setpretty`\y=62 - \setpretty`\z=62 - \setpretty`\;=71 \setpretty`\:=72 \setpretty`\,=71 \setpretty`\.=71 - \setpretty`\'=80 - \setpretty`\"=90 - \setpretty`\#= 0 } - -\gdef\PLsethandlers% - {\installprettyhandler 10 \PLtypeone - \installprettyhandler 21 \PLtypetwo - \installprettyhandler 22 \PLtypetwo - \installprettyhandler 31 \PLtypethree - \installprettyhandler 32 \PLtypethree - \installprettyhandler 41 \PLtypefourone - \installprettyhandler 42 \PLtypefourtwo - \installprettyhandler 50 \PLtypefive - \installprettyhandler 61 \PLtypesixone - \installprettyhandler 62 \PLtypesixtwo - \installprettyhandler 71 \PLtypesevenone - \installprettyhandler 72 \PLtypeseventwo - \installprettyhandler 80 \PLtypeeight - \installprettyhandler 90 \PLtypenine - \installprettyhandler 0 \PLtypezero} - -\gdef\PLtypeone#1% - {\ifinPLdouble - \PLverbosefalse - \ifinPLcomment - \endPLtypesix - \getpretty{#1}% - \else\ifx\PLprefix\empty - \endPLtypesix - \getpretty{#1}% - \else - \endPLtypesix - \xdef\PLprefix{\getpretty{#1}}% - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \fi\fi - \else - \endPLtypesix - \ifinPLcomment - \getpretty{#1}% - \else\ifinPLsingle - \getpretty{#1}% - \else - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \fi\fi - \fi} - -% \gdef\PLtypetwo#1% -% {\endPLtypesix -% \xdef\PLprefix{\getpretty{#1}}% -% \ifinPLcomment -% \getpretty{#1}% -% \else\ifinPLsingle -% \getpretty{#1}% -% \else\ifinPLdouble -% \getprettydata{#1}% -% \ifnum\prettytype=21 -% \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty -% \else -% \getpretty{#1}% -% \fi -% \else -% \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty -% \fi\fi\fi} - -\gdef\PLtypetwo#1% - {\endPLtypesix - \ifinPLdoc - \xdef\PLsequence{\PLsequence\getpretty{#1}}% - \else\ifinPLcomment - \getpretty{#1}% - \else\ifinPLsingle - \getpretty{#1}% - \else\ifinPLdouble - \getprettydata{#1}% - \ifnum\prettytype=21 - \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty - \else - \getpretty{#1}% - \fi - \else - \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty - \fi\fi\fi\fi} - -\gdef\PLtypethree#1% - {\endPLtypesix - \ifinPLcomment - \getpretty{#1}% - \else\ifinPLsingle - \getpretty{#1}% - \else\ifinPLdouble - \getprettydata{#1}% - \ifnum\prettytype=31 - \ifx\PLprefix\empty - \getpretty{#1}% - \else - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \fi - \else - \getpretty{#1}% - \fi - \else - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \fi\fi\fi} - -\gdef\PLtypefourone#1% - {\endPLtypesix - \ifinPLcomment - \getpretty{#1}% - \else\ifinPLsingle - \getpretty{#1}% - \else\ifinPLdouble - \getpretty{#1}% - \else - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \fi\fi\fi} - -\gdef\doPLtypefourtwo#1#2% - {\PLverbosefalse - \getprettydata{#2}% - \ifnum\prettytype=62 - \expandafter\PLtypetwo - \else - \expandafter\PLtypefourone - \fi - {#1}#2} - -\gdef\PLtypefourtwo% - {\handlenextnextpretty\doPLtypefourtwo\PLtypefourone} - -\gdef\doPLtypefiveA#1#2% - {\endPLtypesix - \ifinPLcomment - \getpretties{#1}{#2}% - \else\ifinPLsingle - \getprettydata{#2}% - \ifnum\prettytype=50 - \beginofpretty[\!!prettytwo]\getpretties{#1}{#2}\endofpretty - \else\ifnum\prettytype=80 - \beginofpretty[\!!prettytwo]\getpretties{#1}{#2}\endofpretty - \else - \getpretties{#1}{#2}% - \fi\fi - \else - \beginofpretty[\!!prettytwo]\getpretties{#1}{#2}\endofpretty - \fi\fi} - -\gdef\doPLtypefiveB#1% - {\endPLtypesix - \ifinPLcomment - \getpretty{#1}% - \else\ifinPLsingle - \getpretty{#1}% - \else - \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty - \fi\fi} - -\gdef\PLtypefive% - {\ifPLverbose - \expandafter\PLtypesixtwo - \else - \expandafter\handlenextnextpretty\expandafter\doPLtypefiveA\expandafter\doPLtypefiveB - \fi} - -% \gdef\endPLtypesix% -% {\ifx\PLsequence\empty\else -% \ifinPLcomment -% \PLsequence -% \else\ifinPLsingle -% \PLsequence -% \else\ifinPLdouble -% \PLsequence -% \else\ifPLverbose -% \beginofpretty[\!!prettytwo]\PLsequence\endofpretty -% \PLverbosefalse -% \else\ifx\PLprefix\empty -% \doifprettyidentifierelse{\PLsequence}{\PLverboses} -% {\PLverbosetrue\PLverboseskipped=3 } -% {\doifprettyidentifierelse{\PLsequence}{\PLidentifiers} -% {\beginofpretty[\!!prettytwo]% -% {\prettyidentifierfont\PLsequence}% -% \endofpretty} -% {\ifprettyPLvariables -% \doifprettyidentifierelse{\PLsequence}{\PLvariables} -% {\beginofpretty[\!!prettytwo]% -% {\prettyvariablefont\PLsequence}% -% \endofpretty} -% {\PLsequence}% -% \else -% \PLsequence -% \fi}}% -% \else\ifprettyPLvariables -% \doifprettyidentifierelse{\PLprefix\PLsequence}{\PLvariables} -% {\beginofpretty[\!!prettytwo]% -% {\prettyvariablefont\PLsequence}% -% \endofpretty} -% {\PLsequence}% -% \else -% \PLsequence -% \fi\fi\fi\fi\fi\fi -% \global\let\PLsequence=\empty -% \global\let\PLprefix=\empty -% \fi} - -\gdef\endPLtypesix - {\ifx\PLsequence\empty\else - \ifinPLdoc - \doendPLtypesixvar\!!prettythree - \else\ifinPLcomment - \PLsequence - \else\ifinPLsingle - \PLsequence - \else\ifinPLdouble - \PLsequence - \else\ifPLverbose - \beginofpretty[\!!prettytwo]\PLsequence\endofpretty - \PLverbosefalse - \else\ifx\PLprefix\empty - \doendPLtypesix\!!prettytwo - \else\ifprettyPLvariables - \doendPLtypesixvar\!!prettytwo - \else - \PLsequence - \fi\fi\fi\fi\fi\fi\fi - \global\let\PLsequence\empty - \global\let\PLprefix\empty - \fi} - -\gdef\doendPLtypesix#1% - {\doifprettyidentifierelse{\PLsequence}{\PLverboses} - {\PLverbosetrue\PLverboseskipped=3 } - {\doifprettyidentifierelse{\PLsequence}{\PLidentifiers} - {\beginofpretty[#1]% - {\prettyidentifierfont\PLsequence}% - \endofpretty} - {\ifprettyPLvariables - \doifprettyidentifierelse{\PLsequence}{\PLvariables} - {\beginofpretty[#1]% - {\prettyvariablefont\PLsequence}% - \endofpretty} - {\PLsequence}% - \else - \PLsequence - \fi}}} - -\gdef\doendPLtypesixvar#1% - {\doifprettyidentifierelse{\PLprefix\PLsequence}{\PLvariables} - {\beginofpretty[#1]% - {\prettyvariablefont\PLsequence}% - \endofpretty} - {\PLsequence}} - -\gdef\PLtypesixone - {\ifx\PLsequence\empty - \expandafter\getpretty - \else - \expandafter\PLtypesixtwo - \fi} - -% \gdef\PLtypesixtwo#1% -% {\ifinPLcomment -% \getpretty{#1}% -% \else\ifinPLsingle -% \getpretty{#1}% -% \else\ifinPLdouble -% \ifx\PLprefix\empty -% \getpretty{#1}% -% \else -% \xdef\PLsequence{\PLsequence\getpretty{#1}}% -% \fi -% \else -% \xdef\PLsequence{\PLsequence\getpretty{#1}}% -% \fi\fi\fi} - -\gdef\PLtypesixtwo#1% - {\ifinPLdoc - \xdef\PLsequence{\PLsequence\getpretty{#1}}% - \else\ifinPLcomment - \getpretty{#1}% - \else\ifinPLsingle - \getpretty{#1}% - \else\ifinPLdouble - \ifx\PLprefix\empty - \getpretty{#1}% - \else - \xdef\PLsequence{\PLsequence\getpretty{#1}}% - \fi - \else - \xdef\PLsequence{\PLsequence\getpretty{#1}}% - \fi\fi\fi\fi} - -\gdef\PLtypesevenone#1% - {\endPLtypesix - \getpretty{#1}} - -\gdef\PLtypeseventwo% - {\handlenextnextpretty\doPLtypeseventwo\PLtypesevenone} - -\gdef\doPLtypeseventwo#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=72 - \PLtypesixtwo{#1}\PLtypesixtwo{#1}% - \else - \PLtypesevenone{#1}\expandafter#2% - \fi} - -\gdef\PLtypeeight#1% single quote - {\endPLtypesix - \ifinPLcomment - \getpretty{#1}% - \else\ifinPLdouble - \getpretty{#1}% - \else\ifinPLsingle - \global\inPLsinglefalse - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \else - \global\inPLsingletrue - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \fi\fi\fi} - -\gdef\PLtypenine#1% double quote - {\endPLtypesix - \ifinPLcomment - \getpretty{#1}% - \else\ifinPLsingle - \getpretty{#1}% - \else\ifinPLdouble - \global\inPLdoublefalse - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \else - \global\inPLdoubletrue - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \fi\fi\fi} - -\gdef\PLtypezero% - {\endPLtypesix - \ifnewpretty\expandafter\handlenewpretty\fi\doPLtypezero} - -\gdef\doPLtypezero#1% - {\ifinPLcomment - \getpretty{#1}% - \else - \global\inPLcommenttrue - \PLverbosecorrection - \ifnaturaltextext % non tested yet - \let\next\naturaltextext - \else - \def\next{\beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% - \fi - \expandafter\next - \fi} - -\gdef\doreportprettyPLtype#1#2#3#4% - {#1% - [PERL \string#2 typing conflict, use \string#3 instead] - \writestatus - {PERL typing} - {use \string#3 instead of \string#2 to enable propper visualization}% - \global#4% - \expandafter\doemptyverbatimline - \fi} - -\gdef\reportprettyPLtype% - {\doreportprettyPLtype\ifinPLsingle'\'\inPLsinglefalse - \doreportprettyPLtype\ifinPLdouble"\"\inPLdoublefalse} - -\gdef\PLsetdiagnostics% - {\let\normaldoemptyverbatimline=\doemptyverbatimline - \def\doemptyverbatimline% - {\normaldoemptyverbatimline - \reportprettyPLtype}} - -%D The official \PERL\ version 5 keywords: - -\useprettyidentifiers \PLidentifiers \PLsetspecials - abs accept alarm and atan atan2 bind binmode bless caller - chdir chmod chomp chop chown chr chroot close closedir cmp - connect continue cos crypt dbmclose dbmopen defined delete - die do dump each echo else elsif endgrent endhostent - endnetent endprotoend endpwent endservent eof eq eval exec - exists exit exp fcntl fileno flock for foreach fork format - formline getc getgrent getgrgid getgrnam gethostbyaddr - gethostbyname gethostent getlogin getnetbyaddr getnetbyname - getnetent getpeername getpgrp getppid getpriority - getprotobyname getprotobynumber getprotoent getpwent - getpwnam getpwuid getservbyname getservbyport getservent - getsockname getsockopt glob gmtime goto grep gt hex if - import index int integer ioctl join keys kill last lc - lcfirst le length lib link listen local localtime log lstat - lt map method mkdir msgctl msgget msgrcv msgsnd my ne next - no not oct open opendir or ord pack package pipe pop pos - print printf process prompt push quotemeta rand read readdir - readlink recv redo ref rename require reset return reverse - rewinddir rindex rmdir scalar seek seekdir select semctl - semget semop send setgrent sethostent setnetent setpgrp - setpriority setprotoent setpwent setservent setsockopt shift - shmctl shmget shmread shmwrite shutdown sin sleep socket - socketpair sort splice split sprintf sqrt srand stat strict - study sub subs substr symlink syscall sysopen sysread system - syswrite tell telldir tie tied time times times truncate uc - ucfirst ucmask umask unary undef unless unlink unpack - unshift untie until use utime values vars vec wait waitpid - wantarray warn warn while write xor - -%D Additional module keywords (still incomplete): - -\useprettyidentifiers \PLvariables \PLsetspecials - Getopt::Long - $Getopt::Long::passthrough - $Getopt::Long::autoabbrev - &GetOptions - -%D A funny hack. When prefixes by \type{TEX}, a \type{\csname} -%D is typeset as \TEX\ sequence. - -\useprettyidentifiers \PLverboses \PLsetspecials - TEX - -\protect - -\endinput diff --git a/tex/context/base/verb-raw.mkii b/tex/context/base/verb-raw.mkii new file mode 100644 index 000000000..32903db77 --- /dev/null +++ b/tex/context/base/verb-raw.mkii @@ -0,0 +1,7 @@ +\ifx\undefined\setupprettyTEXtype \input verb-tex \relax \fi + +\gdef\setupprettyRAWtype% + {\setupprettyTEXtype + \def\prettyidentifier{RAW}} + +\endinput diff --git a/tex/context/base/verb-raw.tex b/tex/context/base/verb-raw.tex deleted file mode 100644 index 32903db77..000000000 --- a/tex/context/base/verb-raw.tex +++ /dev/null @@ -1,7 +0,0 @@ -\ifx\undefined\setupprettyTEXtype \input verb-tex \relax \fi - -\gdef\setupprettyRAWtype% - {\setupprettyTEXtype - \def\prettyidentifier{RAW}} - -\endinput diff --git a/tex/context/base/verb-sql.mkii b/tex/context/base/verb-sql.mkii new file mode 100644 index 000000000..a00841d73 --- /dev/null +++ b/tex/context/base/verb-sql.mkii @@ -0,0 +1,230 @@ +%D \module +%D [ file=verb-sql, +%D version=2000.05.09, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty \SQL\ Verbatim, +%D author={Berend de Boer \& Hans Hagen}, +%D date=\currentdate, +%D copyright={Berend de Boer \& Hans Hagen}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Verbatim Macros / Pretty SQL Verbatim} + +%D \quotation {He, I want pretty pretting too!}, Berend cried out +%D one day, \quotation {But now for \SQL.}. This query language +%D shows code like: +%D +%D \startbuffer +%D \startSQL +%D select * -- some comment +%D from tableA +%D where 1 = 2 +%D \stopSQL +%D \stopbuffer +%D +%D \typebuffer +%D +%D and this should become something pretty like: +%D +%D \getbuffer +%D +%D or, with Berend's preferences: +%D +%D \startbuffer[setup] +%D \setuptyping +%D [SQL] +%D [text=yes,palet=,icommand=\bf,vcommand=,ccommand=\it] +%D \stopbuffer +%D +%D \getbuffer[setup] +%D \getbuffer +%D +%D This kind of pretty printing is accomplished by: +%D +%D \typebuffer + +%D Like we did with the \JAVASCRIPT\ driver, we will borrow +%D most of the macros from the \PERL\ driver. + +\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi + +\unprotect + +%D \SQL\ has the one line comment sequence \type{--} and the +%D multi line comment delimiters \type{/*} and \type{*/}. The +%D next counter keeps track of multi line comment nesting. + +\newcount\SQLcommentlevel + +%D We need to handle \type{%}, \type{#} and \type{-} a bit +%D different than in the \PERL\ driver. Compared to the +%D \JAVASCRIPT\ driver |<|we copied most of the code from +%D that one|>|, we now also have type~45. + +\gdef\SQLsetspecials% + {\PLsetspecials + \setpretty`\#=32 + \setpretty`\:=41 + \setpretty`\%=41 + \setpretty`\/=43 + \setpretty`\*=44 + \setpretty`\-=45 } + +%D We need three additional handlers: + +\gdef\SQLsethandlers% + {\PLsethandlers + \installprettyhandler 43 \SQLtypefourthree + \installprettyhandler 44 \SQLtypefourfour + \installprettyhandler 45 \SQLtypefourfive } + +%D Next we have to do some general housekeeping. + +\gdef\SQLsetcontrols% + {\PLsetcontrols + \def\flushrestofverbatimline% + {\endPLtypesix + \ifcase\SQLcommentlevel + \inPLcommentfalse + \verbatimfont + \fi + \PLverbosefalse + \PLverboseskipped=0}} + +\gdef\SQLsetvariables + {\PLsetvariables + \global\SQLcommentlevel=0 } + +\gdef\setupprettySQLtype% + {\def\prettyidentifier{SQL}% + \let\PLidentifiers=\SQLidentifiers + \let\PLvariables=\SQLvariables + \SQLsetvariables + \SQLsetcontrols + \SQLsethandlers + \SQLsetspecials + \PLsetdiagnostics} + +%D We have to look upto four characters ahead. If you don't +%D grab the picture, just skip reading these macros. + +\gdef\SQLtypefourthree% + {\handlenextnextpretty\doSQLtypefourthree\PLtypefourtwo} + +\gdef\doSQLtypefourthree#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \let\next=\dodoSQLtypefourthree + \else\ifnum\prettytype=44 + \global\advance\SQLcommentlevel by 1 + \global\inPLcommenttrue + \PLverbosecorrection + \let\next=\SQLtogglecomment + \else + \let\next=\PLtypefourtwo + \fi\fi + \next{#1}#2} + +\gdef\SQLtogglecomment#1#2% + {\ifnum\SQLcommentlevel=1 + \prettynaturalfont + \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty + \else + \getpretties{#1}{#2}% + \fi} + +\gdef\dodoSQLtypefourthree% #1% + {\endPLtypesix + \handlenextnextpretty\dododoSQLtypefourthree\dodododoPLtypefourthree} + +\gdef\dododoSQLtypefourthree% + {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoSQLtypefourthree} + +\gdef\dodododoSQLtypefourthree#1#2% + {\ifinPLcomment + \getpretties{#1}{#2}% + \else + \global\inPLcommenttrue + \PLverbosecorrection + \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty + \fi} + +\gdef\SQLtypefourfour% + {\handlenextnextpretty\doSQLtypefourfour\PLtypefourtwo} + +\gdef\doSQLtypefourfour#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=43 + \SQLtogglecomment{#1}#2% + \global\advance\SQLcommentlevel by -1 + \ifcase\SQLcommentlevel + \global\inPLcommentfalse + \prettyverbatimfont + \fi + \else + \endPLtypesix + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \expandafter#2% + \fi} + +%D Much of the indirect calls (\type {dodo..}) is due to +%D looking ahead as well as midway pretty print changing. + +\gdef\SQLtypefourfive% + {\handlenextnextpretty\doSQLtypefourfive\PLtypefourtwo} + +\gdef\doSQLtypefourfive#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=45 + \let\next=\dodoSQLtypefourfive + \else + \let\next=\PLtypefourtwo + \fi + \next{#1}#2} + +\gdef\dodoSQLtypefourfive% #1% + {\endPLtypesix + \handlenextnextpretty\dododoSQLtypefourfive\dodododoPLtypefourfive} + +\gdef\dododoSQLtypefourfive% + {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoSQLtypefourfive} + +\gdef\dodododoSQLtypefourfive#1#2% + {\ifinPLcomment + \getpretties{#1}{#2}% + \else + \global\inPLcommenttrue + \PLverbosecorrection + \ifnaturaltextext + \let\next\naturaltextext + \else + \prettynaturalfont + \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}% + \fi + \expandafter\next + \fi} + +%D We need a different list of reserved words. This list +%D replaces the \PERL\ one. + +\useprettyidentifiers \SQLidentifiers \SQLsetspecials + add all alter and any as asc avg begin between break + browse bulk by cascade case check close clustered coalesce + column commit constraint contains count create cross + cursor database default delete desc distinct drop else end + exec execute exists exit fetch for foreign from grant + group having if in index inner insert into is join key + left like max min nocheck nonclustered not null of on open + or order outer over plan prepare proc procedure public + references return revoce right rollback rule select set + sum table then to tran transaction trigger truncate + uncommited union unique update use values varying view + when where while with work primary + +\useprettyidentifiers \SQLvariables \SQLsetspecials + not-yet-defined + +\protect \endinput diff --git a/tex/context/base/verb-sql.tex b/tex/context/base/verb-sql.tex deleted file mode 100644 index a00841d73..000000000 --- a/tex/context/base/verb-sql.tex +++ /dev/null @@ -1,230 +0,0 @@ -%D \module -%D [ file=verb-sql, -%D version=2000.05.09, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty \SQL\ Verbatim, -%D author={Berend de Boer \& Hans Hagen}, -%D date=\currentdate, -%D copyright={Berend de Boer \& Hans Hagen}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Verbatim Macros / Pretty SQL Verbatim} - -%D \quotation {He, I want pretty pretting too!}, Berend cried out -%D one day, \quotation {But now for \SQL.}. This query language -%D shows code like: -%D -%D \startbuffer -%D \startSQL -%D select * -- some comment -%D from tableA -%D where 1 = 2 -%D \stopSQL -%D \stopbuffer -%D -%D \typebuffer -%D -%D and this should become something pretty like: -%D -%D \getbuffer -%D -%D or, with Berend's preferences: -%D -%D \startbuffer[setup] -%D \setuptyping -%D [SQL] -%D [text=yes,palet=,icommand=\bf,vcommand=,ccommand=\it] -%D \stopbuffer -%D -%D \getbuffer[setup] -%D \getbuffer -%D -%D This kind of pretty printing is accomplished by: -%D -%D \typebuffer - -%D Like we did with the \JAVASCRIPT\ driver, we will borrow -%D most of the macros from the \PERL\ driver. - -\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi - -\unprotect - -%D \SQL\ has the one line comment sequence \type{--} and the -%D multi line comment delimiters \type{/*} and \type{*/}. The -%D next counter keeps track of multi line comment nesting. - -\newcount\SQLcommentlevel - -%D We need to handle \type{%}, \type{#} and \type{-} a bit -%D different than in the \PERL\ driver. Compared to the -%D \JAVASCRIPT\ driver |<|we copied most of the code from -%D that one|>|, we now also have type~45. - -\gdef\SQLsetspecials% - {\PLsetspecials - \setpretty`\#=32 - \setpretty`\:=41 - \setpretty`\%=41 - \setpretty`\/=43 - \setpretty`\*=44 - \setpretty`\-=45 } - -%D We need three additional handlers: - -\gdef\SQLsethandlers% - {\PLsethandlers - \installprettyhandler 43 \SQLtypefourthree - \installprettyhandler 44 \SQLtypefourfour - \installprettyhandler 45 \SQLtypefourfive } - -%D Next we have to do some general housekeeping. - -\gdef\SQLsetcontrols% - {\PLsetcontrols - \def\flushrestofverbatimline% - {\endPLtypesix - \ifcase\SQLcommentlevel - \inPLcommentfalse - \verbatimfont - \fi - \PLverbosefalse - \PLverboseskipped=0}} - -\gdef\SQLsetvariables - {\PLsetvariables - \global\SQLcommentlevel=0 } - -\gdef\setupprettySQLtype% - {\def\prettyidentifier{SQL}% - \let\PLidentifiers=\SQLidentifiers - \let\PLvariables=\SQLvariables - \SQLsetvariables - \SQLsetcontrols - \SQLsethandlers - \SQLsetspecials - \PLsetdiagnostics} - -%D We have to look upto four characters ahead. If you don't -%D grab the picture, just skip reading these macros. - -\gdef\SQLtypefourthree% - {\handlenextnextpretty\doSQLtypefourthree\PLtypefourtwo} - -\gdef\doSQLtypefourthree#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=43 - \let\next=\dodoSQLtypefourthree - \else\ifnum\prettytype=44 - \global\advance\SQLcommentlevel by 1 - \global\inPLcommenttrue - \PLverbosecorrection - \let\next=\SQLtogglecomment - \else - \let\next=\PLtypefourtwo - \fi\fi - \next{#1}#2} - -\gdef\SQLtogglecomment#1#2% - {\ifnum\SQLcommentlevel=1 - \prettynaturalfont - \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty - \else - \getpretties{#1}{#2}% - \fi} - -\gdef\dodoSQLtypefourthree% #1% - {\endPLtypesix - \handlenextnextpretty\dododoSQLtypefourthree\dodododoPLtypefourthree} - -\gdef\dododoSQLtypefourthree% - {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoSQLtypefourthree} - -\gdef\dodododoSQLtypefourthree#1#2% - {\ifinPLcomment - \getpretties{#1}{#2}% - \else - \global\inPLcommenttrue - \PLverbosecorrection - \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty - \fi} - -\gdef\SQLtypefourfour% - {\handlenextnextpretty\doSQLtypefourfour\PLtypefourtwo} - -\gdef\doSQLtypefourfour#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=43 - \SQLtogglecomment{#1}#2% - \global\advance\SQLcommentlevel by -1 - \ifcase\SQLcommentlevel - \global\inPLcommentfalse - \prettyverbatimfont - \fi - \else - \endPLtypesix - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \expandafter#2% - \fi} - -%D Much of the indirect calls (\type {dodo..}) is due to -%D looking ahead as well as midway pretty print changing. - -\gdef\SQLtypefourfive% - {\handlenextnextpretty\doSQLtypefourfive\PLtypefourtwo} - -\gdef\doSQLtypefourfive#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=45 - \let\next=\dodoSQLtypefourfive - \else - \let\next=\PLtypefourtwo - \fi - \next{#1}#2} - -\gdef\dodoSQLtypefourfive% #1% - {\endPLtypesix - \handlenextnextpretty\dododoSQLtypefourfive\dodododoPLtypefourfive} - -\gdef\dododoSQLtypefourfive% - {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoSQLtypefourfive} - -\gdef\dodododoSQLtypefourfive#1#2% - {\ifinPLcomment - \getpretties{#1}{#2}% - \else - \global\inPLcommenttrue - \PLverbosecorrection - \ifnaturaltextext - \let\next\naturaltextext - \else - \prettynaturalfont - \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}% - \fi - \expandafter\next - \fi} - -%D We need a different list of reserved words. This list -%D replaces the \PERL\ one. - -\useprettyidentifiers \SQLidentifiers \SQLsetspecials - add all alter and any as asc avg begin between break - browse bulk by cascade case check close clustered coalesce - column commit constraint contains count create cross - cursor database default delete desc distinct drop else end - exec execute exists exit fetch for foreign from grant - group having if in index inner insert into is join key - left like max min nocheck nonclustered not null of on open - or order outer over plan prepare proc procedure public - references return revoce right rollback rule select set - sum table then to tran transaction trigger truncate - uncommited union unique update use values varying view - when where while with work primary - -\useprettyidentifiers \SQLvariables \SQLsetspecials - not-yet-defined - -\protect \endinput diff --git a/tex/context/base/verb-tex.mkii b/tex/context/base/verb-tex.mkii new file mode 100644 index 000000000..75e99fcef --- /dev/null +++ b/tex/context/base/verb-tex.mkii @@ -0,0 +1,294 @@ +%D \module +%D [ file=verb-tex, +%D version=1997.12.22, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty \TEX\ verbatim, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Verbatim Macros / Pretty TEX Verbatim} + +%D The original module \type{supp-ver} had the \TEX\ +%D interpreter built in. The current implementation is more +%D natural and less complicated. + +%D \startTEX +%D \definetyping[niceTEX][option=TEX,paletpalet=graypretty] +%D +%D \startniceTEX +%D \message{A vivid look at TeX} +%D \stopniceTEX +%D \stopTEX + +\unprotect + +%D \macros +%D {ifsplitTEXparameters} +%D +%D The mechanism described here, is meant to be used with +%D color. It is nevertheless possible to use different fonts +%D instead of distinctive colors. When using color, it's better +%D to end parameter mode after the \type{#}. When on the +%D other hand we use a slanted typeface for the hashmark, then +%D a slanted number looks better. + +\doglobal\newif\ifsplitTEXparameters \global\splitTEXparameterstrue + +%D \macros +%D {ifsplitTEXcontrols} +%D +%D With \type{\splittexcontrols} we can influence the way +%D control characters are processed in macro names. By default, +%D the \type{^^} part is uncolored. When this boolean is set to +%D false, they get the same color as the other characters. + +\doglobal\newif\ifsplitTEXcontrols \global\splitTEXcontrolstrue + +%D The next boolean is used for internal purposes only and +%D keeps track of the length of the name. Because two||character +%D sequences starting with a backslash are always seen as a +%D command. + +\doglobal\newif\iffirstinTEXcommand + +%D We use a maximum of four colors because more colors will +%D distract too much. In the following table we show the +%D logical names of the colors, their color and \cap{RGB} values. +%D +%D \placetable{geen} +%D \starttable[|l|l|c|c|c|c|] +%D \HL +%D \FC\bf identifier \MC\bf color \MC\bf r \MC\bf g \MC\bf b \MC\bf bw \LC\SR +%D \HL +%D \FC prettyone \MC red \MC 0.9 \MC 0.0 \MC 0.0 \MC 0.30 \LC\FR +%D \FC prettytwo \MC green \MC 0.0 \MC 0.8 \MC 0.0 \MC 0.45 \LC\MR +%D \FC prettythree \MC yellow \MC 0.0 \MC 0.0 \MC 0.9 \MC 0.60 \LC\MR +%D \FC prettyfour \MC blue \MC 0.8 \MC 0.8 \MC 0.6 \MC 0.75 \LC\LR +%D \HL +%D \stoptable +%D +%D Outside \CONTEXT\ these colors are defined in +%D \type{verb-ini}, in \CONTEXT\ their definitions can be found +%D in \type{core-ver}, where in fact we use the color palet +%D mechanism. That way we can use different schemes i a quite +%D natural way. + +\gdef\setupprettyTEXtype + {\def\prettyidentifier{TEX}% + \global\inTEXcommandfalse + \global\firstinTEXcommandfalse + \global\inTEXparameterfalse + \TEXsetcontrols + \TEXsethandlers + \TEXsetspecials} + +\gdef\TEXsetcontrols + {\saveprettycontrols + \everyprettyend + {\TEXendofcommand + \TEXendofparameter}% + \def\obeyedspace + {\TEXendofcommand + \TEXendofparameter + \oldobeyedspace}% + \def\flushrestofverbatimline + {\TEXendofcommand + \TEXendofparameter}% + \let\obeytabs=\ignoretabs} + +\gdef\TEXsetspecials + {\setpretty`\$=1 \setpretty`\{=1 \setpretty`\}=1 + \setpretty`\[=2 \setpretty`\]=2 \setpretty`\(=2 \setpretty`\)=2 + \setpretty`\==2 \setpretty`\<=2 \setpretty`\>=2 \setpretty`\"=2 + \setpretty`\-=3 \setpretty`\+=3 \setpretty`\/=3 + \setpretty`\|=3 \setpretty`\%=3 \setpretty`\'=3 \setpretty`\`=3 + \setpretty`\_=3 \setpretty`\&=3 \setpretty`\~=3 + \setpretty`\.=4 \setpretty`\,=4 \setpretty`\:=4 \setpretty`\;=4 \setpretty`\*=4 + \setpretty`\#=5 + \setpretty`\1=6 \setpretty`\2=6 \setpretty`\3=6 \setpretty`\4=6 \setpretty`\5=6 + \setpretty`\6=6 \setpretty`\7=6 \setpretty`\8=6 \setpretty`\9=6 \setpretty`\0=6 + \setpretty`\\=7 + \setpretty`\^=8 + \setpretty`\A=9 \setpretty`\B=9 \setpretty`\C=9 \setpretty`\D=9 \setpretty`\E=9 + \setpretty`\F=9 \setpretty`\G=9 \setpretty`\H=9 \setpretty`\I=9 \setpretty`\J=9 + \setpretty`\K=9 \setpretty`\L=9 \setpretty`\M=9 \setpretty`\N=9 \setpretty`\O=9 + \setpretty`\P=9 \setpretty`\Q=9 \setpretty`\R=9 \setpretty`\S=9 \setpretty`\T=9 + \setpretty`\U=9 \setpretty`\V=9 \setpretty`\W=9 \setpretty`\X=9 \setpretty`\Y=9 + \setpretty`\Z=9 + \setpretty`\a=9 \setpretty`\b=9 \setpretty`\c=9 \setpretty`\d=9 \setpretty`\e=9 + \setpretty`\f=9 \setpretty`\g=9 \setpretty`\h=9 \setpretty`\i=9 \setpretty`\j=9 + \setpretty`\k=9 \setpretty`\l=9 \setpretty`\m=9 \setpretty`\n=9 \setpretty`\o=9 + \setpretty`\p=9 \setpretty`\q=9 \setpretty`\r=9 \setpretty`\s=9 \setpretty`\t=9 + \setpretty`\u=9 \setpretty`\v=9 \setpretty`\w=9 \setpretty`\x=9 \setpretty`\y=9 + \setpretty`\z=9 + \setpretty`\?=9 \setpretty`\!=9 \setpretty`\@=9 + \setpretty`\%=0 } + +\gdef\TEXsethandlers + {\installprettyhandler 1 \TEXtypeone + \installprettyhandler 2 \TEXtypetwo + \installprettyhandler 3 \TEXtypethree + \installprettyhandler 4 \TEXtypefour + \installprettyhandler 5 \TEXtypefive + \installprettyhandler 6 \TEXtypesix + \installprettyhandler 7 \TEXtypeseven + \installprettyhandler 8 \TEXtypeeight + \installprettyhandler 9 \TEXtypenine + \installprettyhandler 0 \TEXtypezero} + +\doglobal\newif\ifinTEXcommand +\doglobal\newif\ifinTEXparameter + +\gdef\TEXbeginofcommand + {\TEXendofparameter + \ifinTEXcommand + \else + \global\inTEXcommandtrue + \global\firstinTEXcommandtrue + \beginofpretty[\!!prettytwo]% + \fi} + +\gdef\TEXendofcommand + {\ifinTEXcommand + \endofpretty + \global\inTEXcommandfalse + \global\firstinTEXcommandfalse + \fi} + +\gdef\TEXbeginofparameter + {\TEXendofcommand + \ifinTEXparameter + \else + \global\inTEXparametertrue + \beginofpretty[\!!prettythree]% + \fi} + +\gdef\TEXendofparameter + {\ifinTEXparameter + \endofpretty + \global\inTEXparameterfalse + \fi} + +\gdef\ifnotfirstinTEXcommand#1 + {\iffirstinTEXcommand + \getpretty{#1}% + \TEXendofcommand + \else} + +\gdef\TEXtypeone#1% + {\ifnotfirstinTEXcommand#1 + \TEXendofcommand + \TEXendofparameter + \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty + \fi} + +\gdef\TEXtypetwo#1% + {\ifnotfirstinTEXcommand#1 + \TEXendofcommand + \TEXendofparameter + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \fi} + +\gdef\TEXtypethree#1% + {\ifnotfirstinTEXcommand#1 + \TEXendofcommand + \TEXendofparameter + \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty + \fi} + +\gdef\TEXtypefour#1% + {\ifnotfirstinTEXcommand#1 + \TEXendofcommand + \TEXendofparameter + \getpretty{#1}% + \fi} + +\gdef\TEXtypefive#1% + {\ifnotfirstinTEXcommand#1 + \TEXbeginofparameter + \getpretty{#1}% + \fi} + +\gdef\TEXtypesix#1% + {\ifnotfirstinTEXcommand#1 + \ifinTEXparameter + \ifsplitTEXparameters + \TEXendofparameter + \getpretty{#1}% + \else + \getpretty{#1}% + \TEXendofparameter + \fi + \else + \TEXendofcommand + \getpretty{#1}% + \fi + \fi} + +\gdef\TEXtypeseven#1% + {\ifnotfirstinTEXcommand#1 + \TEXbeginofcommand + \getpretty{#1}% + \fi} + +\gdef\TEXtypeeightA#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=80 + \TEXendofparameter + \ifsplitTEXcontrols + \ifinTEXcommand + \def\next{\TEXendofcommand\getpretty{#1}\getpretty{#1}\TEXbeginofcommand}% + \else + \def\next{\getpretty{#1}\getpretty{#1}}% + \fi + \else + \def\next{\getpretty{#1}\getpretty{#1}}% + \fi + \else + \def\next{\TEXtypeeightB{#1}#2}% + \fi + \next} + +\gdef\TEXtypeeightB + {\TEXendofparameter + \ifinTEXcommand + \firstinTEXcommandfalse + \expandafter\getpretty + \else + \expandafter\TEXtypethree + \fi} + +\gdef\TEXtypeeight + {\handlenextnextpretty\TEXtypeeightA\TEXtypeeightB} + +\gdef\TEXtypenine + {\TEXendofparameter + \global\firstinTEXcommandfalse + \getpretty} + +%\gdef\TEXtypezero +% {\disableprettyafterwards % only when enabled of course +% \ifnewpretty\expandafter\handlenewpretty\fi\TEXtypethree} + +\long\gdef\naturalTEXtext#1#2\relax% local alternative for \naturaltextext + {\convertargument#2\to\ascii + \doifinstringelse{\letterpercent}{\ascii} + {\long\def\next{\TEXtypethree{#1}#2\relax}} + %{\long\def\next{\bgroup\prettynaturalfont\restorecatcodes\scantokens{\ignorespaces#2}\egroup}}% + {\long\def\next{\bgroup\prettynaturalfont{\restorecatcodes\scantokens{\ignorespaces#2}}\egroup}}% + \next} + +\gdef\TEXtypezero + {\ifnaturaltextext + \expandafter\naturalTEXtext + \else + \disableprettyafterwards % only when enabled of course + \expandafter\handlenewpretty\expandafter\TEXtypethree + \fi} + +\protect \endinput diff --git a/tex/context/base/verb-tex.tex b/tex/context/base/verb-tex.tex deleted file mode 100644 index 75e99fcef..000000000 --- a/tex/context/base/verb-tex.tex +++ /dev/null @@ -1,294 +0,0 @@ -%D \module -%D [ file=verb-tex, -%D version=1997.12.22, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty \TEX\ verbatim, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Verbatim Macros / Pretty TEX Verbatim} - -%D The original module \type{supp-ver} had the \TEX\ -%D interpreter built in. The current implementation is more -%D natural and less complicated. - -%D \startTEX -%D \definetyping[niceTEX][option=TEX,paletpalet=graypretty] -%D -%D \startniceTEX -%D \message{A vivid look at TeX} -%D \stopniceTEX -%D \stopTEX - -\unprotect - -%D \macros -%D {ifsplitTEXparameters} -%D -%D The mechanism described here, is meant to be used with -%D color. It is nevertheless possible to use different fonts -%D instead of distinctive colors. When using color, it's better -%D to end parameter mode after the \type{#}. When on the -%D other hand we use a slanted typeface for the hashmark, then -%D a slanted number looks better. - -\doglobal\newif\ifsplitTEXparameters \global\splitTEXparameterstrue - -%D \macros -%D {ifsplitTEXcontrols} -%D -%D With \type{\splittexcontrols} we can influence the way -%D control characters are processed in macro names. By default, -%D the \type{^^} part is uncolored. When this boolean is set to -%D false, they get the same color as the other characters. - -\doglobal\newif\ifsplitTEXcontrols \global\splitTEXcontrolstrue - -%D The next boolean is used for internal purposes only and -%D keeps track of the length of the name. Because two||character -%D sequences starting with a backslash are always seen as a -%D command. - -\doglobal\newif\iffirstinTEXcommand - -%D We use a maximum of four colors because more colors will -%D distract too much. In the following table we show the -%D logical names of the colors, their color and \cap{RGB} values. -%D -%D \placetable{geen} -%D \starttable[|l|l|c|c|c|c|] -%D \HL -%D \FC\bf identifier \MC\bf color \MC\bf r \MC\bf g \MC\bf b \MC\bf bw \LC\SR -%D \HL -%D \FC prettyone \MC red \MC 0.9 \MC 0.0 \MC 0.0 \MC 0.30 \LC\FR -%D \FC prettytwo \MC green \MC 0.0 \MC 0.8 \MC 0.0 \MC 0.45 \LC\MR -%D \FC prettythree \MC yellow \MC 0.0 \MC 0.0 \MC 0.9 \MC 0.60 \LC\MR -%D \FC prettyfour \MC blue \MC 0.8 \MC 0.8 \MC 0.6 \MC 0.75 \LC\LR -%D \HL -%D \stoptable -%D -%D Outside \CONTEXT\ these colors are defined in -%D \type{verb-ini}, in \CONTEXT\ their definitions can be found -%D in \type{core-ver}, where in fact we use the color palet -%D mechanism. That way we can use different schemes i a quite -%D natural way. - -\gdef\setupprettyTEXtype - {\def\prettyidentifier{TEX}% - \global\inTEXcommandfalse - \global\firstinTEXcommandfalse - \global\inTEXparameterfalse - \TEXsetcontrols - \TEXsethandlers - \TEXsetspecials} - -\gdef\TEXsetcontrols - {\saveprettycontrols - \everyprettyend - {\TEXendofcommand - \TEXendofparameter}% - \def\obeyedspace - {\TEXendofcommand - \TEXendofparameter - \oldobeyedspace}% - \def\flushrestofverbatimline - {\TEXendofcommand - \TEXendofparameter}% - \let\obeytabs=\ignoretabs} - -\gdef\TEXsetspecials - {\setpretty`\$=1 \setpretty`\{=1 \setpretty`\}=1 - \setpretty`\[=2 \setpretty`\]=2 \setpretty`\(=2 \setpretty`\)=2 - \setpretty`\==2 \setpretty`\<=2 \setpretty`\>=2 \setpretty`\"=2 - \setpretty`\-=3 \setpretty`\+=3 \setpretty`\/=3 - \setpretty`\|=3 \setpretty`\%=3 \setpretty`\'=3 \setpretty`\`=3 - \setpretty`\_=3 \setpretty`\&=3 \setpretty`\~=3 - \setpretty`\.=4 \setpretty`\,=4 \setpretty`\:=4 \setpretty`\;=4 \setpretty`\*=4 - \setpretty`\#=5 - \setpretty`\1=6 \setpretty`\2=6 \setpretty`\3=6 \setpretty`\4=6 \setpretty`\5=6 - \setpretty`\6=6 \setpretty`\7=6 \setpretty`\8=6 \setpretty`\9=6 \setpretty`\0=6 - \setpretty`\\=7 - \setpretty`\^=8 - \setpretty`\A=9 \setpretty`\B=9 \setpretty`\C=9 \setpretty`\D=9 \setpretty`\E=9 - \setpretty`\F=9 \setpretty`\G=9 \setpretty`\H=9 \setpretty`\I=9 \setpretty`\J=9 - \setpretty`\K=9 \setpretty`\L=9 \setpretty`\M=9 \setpretty`\N=9 \setpretty`\O=9 - \setpretty`\P=9 \setpretty`\Q=9 \setpretty`\R=9 \setpretty`\S=9 \setpretty`\T=9 - \setpretty`\U=9 \setpretty`\V=9 \setpretty`\W=9 \setpretty`\X=9 \setpretty`\Y=9 - \setpretty`\Z=9 - \setpretty`\a=9 \setpretty`\b=9 \setpretty`\c=9 \setpretty`\d=9 \setpretty`\e=9 - \setpretty`\f=9 \setpretty`\g=9 \setpretty`\h=9 \setpretty`\i=9 \setpretty`\j=9 - \setpretty`\k=9 \setpretty`\l=9 \setpretty`\m=9 \setpretty`\n=9 \setpretty`\o=9 - \setpretty`\p=9 \setpretty`\q=9 \setpretty`\r=9 \setpretty`\s=9 \setpretty`\t=9 - \setpretty`\u=9 \setpretty`\v=9 \setpretty`\w=9 \setpretty`\x=9 \setpretty`\y=9 - \setpretty`\z=9 - \setpretty`\?=9 \setpretty`\!=9 \setpretty`\@=9 - \setpretty`\%=0 } - -\gdef\TEXsethandlers - {\installprettyhandler 1 \TEXtypeone - \installprettyhandler 2 \TEXtypetwo - \installprettyhandler 3 \TEXtypethree - \installprettyhandler 4 \TEXtypefour - \installprettyhandler 5 \TEXtypefive - \installprettyhandler 6 \TEXtypesix - \installprettyhandler 7 \TEXtypeseven - \installprettyhandler 8 \TEXtypeeight - \installprettyhandler 9 \TEXtypenine - \installprettyhandler 0 \TEXtypezero} - -\doglobal\newif\ifinTEXcommand -\doglobal\newif\ifinTEXparameter - -\gdef\TEXbeginofcommand - {\TEXendofparameter - \ifinTEXcommand - \else - \global\inTEXcommandtrue - \global\firstinTEXcommandtrue - \beginofpretty[\!!prettytwo]% - \fi} - -\gdef\TEXendofcommand - {\ifinTEXcommand - \endofpretty - \global\inTEXcommandfalse - \global\firstinTEXcommandfalse - \fi} - -\gdef\TEXbeginofparameter - {\TEXendofcommand - \ifinTEXparameter - \else - \global\inTEXparametertrue - \beginofpretty[\!!prettythree]% - \fi} - -\gdef\TEXendofparameter - {\ifinTEXparameter - \endofpretty - \global\inTEXparameterfalse - \fi} - -\gdef\ifnotfirstinTEXcommand#1 - {\iffirstinTEXcommand - \getpretty{#1}% - \TEXendofcommand - \else} - -\gdef\TEXtypeone#1% - {\ifnotfirstinTEXcommand#1 - \TEXendofcommand - \TEXendofparameter - \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty - \fi} - -\gdef\TEXtypetwo#1% - {\ifnotfirstinTEXcommand#1 - \TEXendofcommand - \TEXendofparameter - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \fi} - -\gdef\TEXtypethree#1% - {\ifnotfirstinTEXcommand#1 - \TEXendofcommand - \TEXendofparameter - \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty - \fi} - -\gdef\TEXtypefour#1% - {\ifnotfirstinTEXcommand#1 - \TEXendofcommand - \TEXendofparameter - \getpretty{#1}% - \fi} - -\gdef\TEXtypefive#1% - {\ifnotfirstinTEXcommand#1 - \TEXbeginofparameter - \getpretty{#1}% - \fi} - -\gdef\TEXtypesix#1% - {\ifnotfirstinTEXcommand#1 - \ifinTEXparameter - \ifsplitTEXparameters - \TEXendofparameter - \getpretty{#1}% - \else - \getpretty{#1}% - \TEXendofparameter - \fi - \else - \TEXendofcommand - \getpretty{#1}% - \fi - \fi} - -\gdef\TEXtypeseven#1% - {\ifnotfirstinTEXcommand#1 - \TEXbeginofcommand - \getpretty{#1}% - \fi} - -\gdef\TEXtypeeightA#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=80 - \TEXendofparameter - \ifsplitTEXcontrols - \ifinTEXcommand - \def\next{\TEXendofcommand\getpretty{#1}\getpretty{#1}\TEXbeginofcommand}% - \else - \def\next{\getpretty{#1}\getpretty{#1}}% - \fi - \else - \def\next{\getpretty{#1}\getpretty{#1}}% - \fi - \else - \def\next{\TEXtypeeightB{#1}#2}% - \fi - \next} - -\gdef\TEXtypeeightB - {\TEXendofparameter - \ifinTEXcommand - \firstinTEXcommandfalse - \expandafter\getpretty - \else - \expandafter\TEXtypethree - \fi} - -\gdef\TEXtypeeight - {\handlenextnextpretty\TEXtypeeightA\TEXtypeeightB} - -\gdef\TEXtypenine - {\TEXendofparameter - \global\firstinTEXcommandfalse - \getpretty} - -%\gdef\TEXtypezero -% {\disableprettyafterwards % only when enabled of course -% \ifnewpretty\expandafter\handlenewpretty\fi\TEXtypethree} - -\long\gdef\naturalTEXtext#1#2\relax% local alternative for \naturaltextext - {\convertargument#2\to\ascii - \doifinstringelse{\letterpercent}{\ascii} - {\long\def\next{\TEXtypethree{#1}#2\relax}} - %{\long\def\next{\bgroup\prettynaturalfont\restorecatcodes\scantokens{\ignorespaces#2}\egroup}}% - {\long\def\next{\bgroup\prettynaturalfont{\restorecatcodes\scantokens{\ignorespaces#2}}\egroup}}% - \next} - -\gdef\TEXtypezero - {\ifnaturaltextext - \expandafter\naturalTEXtext - \else - \disableprettyafterwards % only when enabled of course - \expandafter\handlenewpretty\expandafter\TEXtypethree - \fi} - -\protect \endinput diff --git a/tex/context/base/verb-xml.mkii b/tex/context/base/verb-xml.mkii new file mode 100644 index 000000000..dbf6635f6 --- /dev/null +++ b/tex/context/base/verb-xml.mkii @@ -0,0 +1,441 @@ +%D \module +%D [ file=verb-xml, +%D version=2000.05.09, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty XML verbatim, +%D author=Berend de Boer, +%D date=2000.05.08, +%D copyright={Berend de Boer \& Hans Hagen}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% This module will be cleaned up a bit in the process of more +% flexible verbatim options. + +\writestatus{loading}{ConTeXt Verbatim Macros / Pretty XML Verbatim} + +\unprotect + +%D Formats XML more or less like XMLWriter (http://XMLwriter.net) +%D does. +%D +%D Known bugs: +%D - CDATA not handled yet. +%D +%D Expects well-formed XML. Else parsing errors may occur, because +%D this XML state machine is not robust. +%D +%D Examples: +%D +%D \startXML +%D +%D +%D +%D +%D +%D 1 +%D 100 +%D +%D +%D +%D \stopXML +%D +%D Another format: +%D +%D \startXML +%D +%D

+%D \stopXML +%D +%D A typical setup: +%D +%D \setuptyping[XML] +%D [margin=1cm, +%D before={\switchtobodyfont[9pt]\blank[medium]}, +%D after={\switchtobodyfont[11pt]\blank[medium]}, +%D style=\ss] +%D + +\ifx\XMLlinebreak\undefined + \gdef\XMLlinebreak{\ifhmode\allowbreak\fi} % new, often long lines +\fi + +\doglobal\newif\ifXMLmarkkeys \global\XMLmarkkeystrue + +\gdef\setupprettyXMLtype% + {\def\prettyidentifier{XML}% + \XMLsetvariables + \XMLsetcontrols + \XMLsetspecials + \XMLsethandlers} + +\gdef\XMLsetvariables + {\global\inXMLpifalse + \global\inXMLtagfalse + \global\inXMLvaluefalse + \global\inXMLspecialfalse + \global\inXMLcommentfalse + \global\inXMLtagnamefalse + \global\inXMLattributefalse + \global\inXMLentityfalse} + +\gdef\XMLsetcontrols% + {\saveprettycontrols + \def\obeyedspace% + {\ifinXMLvalue + \else % more tests ? + \XMLstartattribute + \fi + \oldobeyedspace + \XMLlinebreak}% + \def\flushrestofverbatimline% + {\endXMLtagname}% + \let\obeytabs=\ignoretabs} + +\gdef\XMLsetspecials% + {\setpretty`\<=10 \setpretty`\>=11 + \setpretty`\?=12 \setpretty`\/=13 + \setpretty`\!=14 \setpretty`\-=15 + \setpretty`\\=17 + \setpretty`\0=17 + \setpretty`\1=17 \setpretty`\2=17 \setpretty`\3=17 + \setpretty`\4=17 \setpretty`\5=17 \setpretty`\6=17 + \setpretty`\7=17 \setpretty`\8=17 \setpretty`\9=17 + \setpretty`\==16 + \setpretty`\"=20 + \setpretty`\(=31 \setpretty`\)=31 \setpretty`\,=31 + \setpretty`\*=31 \setpretty`\+=31 \setpretty`\#=31 + \setpretty`\:=32 + \setpretty`\&=41 \setpretty`\;=42 } + +\gdef\XMLsethandlers% + {\installprettyhandler 17 \XMLnormal + \installprettyhandler 10 \XMLwhattag + \installprettyhandler 11 \XMLstoptag + \installprettyhandler 12 \XMLtypeonetwo + \installprettyhandler 13 \XMLtypeonethree + \installprettyhandler 14 \XMLtypeonefour + \installprettyhandler 15 \XMLtypeonefive + \installprettyhandler 16 \XMLtypeonesix + \installprettyhandler 20 \XMLdoublequote + \installprettyhandler 31 \XMLtypethreeone + \installprettyhandler 32 \XMLtypethreetwo + \installprettyhandler 41 \XMLbampersand + \installprettyhandler 42 \XMLeampersand } + +\doglobal\newif\ifinXMLpi +\doglobal\newif\ifinXMLtag +\doglobal\newif\ifinXMLvalue +\doglobal\newif\ifinXMLspecial +\doglobal\newif\ifinXMLcomment +\doglobal\newif\ifinXMLtagname +\doglobal\newif\ifinXMLattribute +\doglobal\newif\ifinXMLentity + +% the list of actions to be executed per state + +% test if we have a normal tag, processing instruction or a special, +% i.e. <, + +\gdef\XMLstoptag#1% + {\ifinXMLcomment + \getpretty{#1}% + \else + \ifinXMLvalue + \getpretty{#1}% + \else + \endXMLtagname + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \doXMLstoptag + \XMLlinebreak + \fi + \fi} + +\gdef\doXMLstoptag% + {\global\inXMLpifalse % either end process instruction + \global\inXMLspecialfalse % or special + \global\inXMLtagfalse % tag ends always + \global\inXMLtagnamefalse} % just to be sure + +% end typeset name of tag +% because called often, we also use it to end the default +% attribute color. + +\gdef\endXMLtagname% + {\ifinXMLtagname + \endofpretty + \inXMLtagnamefalse + \else + \XMLstopattribute + \fi} + +% start attribute formatting inside a tag if applicable + +\gdef\XMLstartattribute% + {\ifinXMLcomment \else + \ifinXMLpi + \ifXMLmarkkeys\else\endXMLtagname\fi % option + \else + \endXMLtagname + \ifinXMLtag + \doXMLstartattribute + \fi + \fi + \fi} + +\gdef\XMLstopattribute% + {\ifinXMLattribute + \endofpretty + \inXMLattributefalse + \fi} + +\gdef\doXMLstartattribute + {\inXMLattributetrue + \beginofpretty[\!!prettythree]} + +% `?' character, needed to recognize ?> + +\gdef\XMLtypeonetwo% + {\endXMLtagname + \handlenextnextpretty\doXMLtypeonetwo\doXMLout} + +\gdef\doXMLtypeonetwo#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=11 % > + \expandafter\dododoXMLtypeonetwo + \else % treat as `green' character + \expandafter\XMLtypethreeone + \fi + {#1}#2} + +\gdef\dododoXMLtypeonetwo#1#2% + {\ifinXMLcomment + \getpretties{#1}{#2}% + \else + \ifinXMLtag + \ifinXMLvalue + \getpretties{#1}{#2}% + \else + \ifinXMLpi + \beginofpretty[\!!prettythree]\getpretties{#1}{#2}\endofpretty + \else % treat as green character + \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty + \beginofpretty[\!!prettythree]#2\endofpretty + \fi + \doXMLstoptag + \fi + \else + \getpretties{#1}{#2}% + \fi + \fi} + +% '/' character, catch /> and +% when is ahead +% so the comment can stop. + +\gdef\XMLtypeonefive% + {\handlenextnextpretty\doXMLtypeonefive\doXMLout} + +\gdef\doXMLtypeonefive#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=15 + \ifinXMLcomment + \let\next=\dodoXMLtypeonefive + \else + \ifinXMLspecial + \let\next=\startXMLcomment + \else + \let\next=\doXMLouttwo + \fi + \fi + \else + \let\next=\doXMLouttwo + \fi + \next{#1}#2} + +\gdef\startXMLcomment#1#2% + {\beginofpretty[\!!prettythree]\getpretties{#1}{#2}\endofpretty + \beginofpretty[\!!prettyfour]% + \global\inXMLcommenttrue} + +\gdef\dodoXMLtypeonefive#1% encountered - + {\def\prev{#1}\handlenextnextpretty\dododoXMLtypeonefive\doXMLout} + +\gdef\nodoXMLtypeonefive% encountered - + {\getpretty{\prev}\doXMLout} + +\gdef\dododoXMLtypeonefive#1#2% + {\getprettydata{#2}% + \ifnum\prettytype=11 + \endofpretty\getpretty{\prev}#1\empty\global\inXMLcommentfalse#2% + \else + \getpretty{\prev}#1#2% + \fi} + +\global\let\doXMLout \getpretty +\global\let\doXMLouttwo\getpretties + +% '=' inside tags needs to be blue + +\gdef\XMLtypeonesix#1% + {\ifinXMLtag + \endofpretty + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \beginofpretty[\!!prettyone]% + \else + \getpretty{#1}% + \fi} + +% catch attribute value parts + +\gdef\XMLdoublequote#1% + {\ifinXMLcomment + \getpretty{#1}% + \else + \ifinXMLtag + \ifinXMLvalue + \global\inXMLvaluefalse + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \ifXMLmarkkeys\beginofpretty[\!!prettyone]\fi + \else + \endofpretty + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty + \global\inXMLvaluetrue + \fi + \else + \getpretty{#1}% + \fi + \fi} + +% symbols like `(', `)' and `,' should be green + +\gdef\XMLtypethreeone#1% + {\ifinXMLcomment + \getpretty{#1}% + \else + \ifinXMLtag + \endXMLtagname + \ifinXMLvalue + \getpretty{#1}% + \else + \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty + \XMLstartattribute% again + \fi + \else + \getpretty{#1}% + \fi + \fi} + +% \gdef\XMLtypethreetwo#1% +% {\ifinXMLcomment +% \getpretty{#1}% +% \else +% \ifinXMLtagname +% \endofpretty +% \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty +% \beginofpretty[\!!prettyone]% +% \else +% \getpretty{#1}% +% \fi +% \fi} + +\gdef\XMLtypethreetwo#1% + {\getpretty{#1}} + +% special characters with `&' + +\gdef\XMLbampersand#1% + {\ifinXMLcomment + \getpretty{#1}% + \else + \endXMLtagname + \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty + \global\inXMLentitytrue + \fi} + +\gdef\XMLeampersand#1% + {\ifinXMLcomment + \getpretty{#1}% + \else + \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty + \global\inXMLentityfalse + \fi} + +\protect \endinput diff --git a/tex/context/base/verb-xml.tex b/tex/context/base/verb-xml.tex deleted file mode 100644 index dbf6635f6..000000000 --- a/tex/context/base/verb-xml.tex +++ /dev/null @@ -1,441 +0,0 @@ -%D \module -%D [ file=verb-xml, -%D version=2000.05.09, -%D title=\CONTEXT\ Verbatim Macros, -%D subtitle=Pretty XML verbatim, -%D author=Berend de Boer, -%D date=2000.05.08, -%D copyright={Berend de Boer \& Hans Hagen}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% This module will be cleaned up a bit in the process of more -% flexible verbatim options. - -\writestatus{loading}{ConTeXt Verbatim Macros / Pretty XML Verbatim} - -\unprotect - -%D Formats XML more or less like XMLWriter (http://XMLwriter.net) -%D does. -%D -%D Known bugs: -%D - CDATA not handled yet. -%D -%D Expects well-formed XML. Else parsing errors may occur, because -%D this XML state machine is not robust. -%D -%D Examples: -%D -%D \startXML -%D -%D -%D -%D -%D -%D 1 -%D 100 -%D -%D -%D -%D \stopXML -%D -%D Another format: -%D -%D \startXML -%D -%D
-%D \stopXML -%D -%D A typical setup: -%D -%D \setuptyping[XML] -%D [margin=1cm, -%D before={\switchtobodyfont[9pt]\blank[medium]}, -%D after={\switchtobodyfont[11pt]\blank[medium]}, -%D style=\ss] -%D - -\ifx\XMLlinebreak\undefined - \gdef\XMLlinebreak{\ifhmode\allowbreak\fi} % new, often long lines -\fi - -\doglobal\newif\ifXMLmarkkeys \global\XMLmarkkeystrue - -\gdef\setupprettyXMLtype% - {\def\prettyidentifier{XML}% - \XMLsetvariables - \XMLsetcontrols - \XMLsetspecials - \XMLsethandlers} - -\gdef\XMLsetvariables - {\global\inXMLpifalse - \global\inXMLtagfalse - \global\inXMLvaluefalse - \global\inXMLspecialfalse - \global\inXMLcommentfalse - \global\inXMLtagnamefalse - \global\inXMLattributefalse - \global\inXMLentityfalse} - -\gdef\XMLsetcontrols% - {\saveprettycontrols - \def\obeyedspace% - {\ifinXMLvalue - \else % more tests ? - \XMLstartattribute - \fi - \oldobeyedspace - \XMLlinebreak}% - \def\flushrestofverbatimline% - {\endXMLtagname}% - \let\obeytabs=\ignoretabs} - -\gdef\XMLsetspecials% - {\setpretty`\<=10 \setpretty`\>=11 - \setpretty`\?=12 \setpretty`\/=13 - \setpretty`\!=14 \setpretty`\-=15 - \setpretty`\\=17 - \setpretty`\0=17 - \setpretty`\1=17 \setpretty`\2=17 \setpretty`\3=17 - \setpretty`\4=17 \setpretty`\5=17 \setpretty`\6=17 - \setpretty`\7=17 \setpretty`\8=17 \setpretty`\9=17 - \setpretty`\==16 - \setpretty`\"=20 - \setpretty`\(=31 \setpretty`\)=31 \setpretty`\,=31 - \setpretty`\*=31 \setpretty`\+=31 \setpretty`\#=31 - \setpretty`\:=32 - \setpretty`\&=41 \setpretty`\;=42 } - -\gdef\XMLsethandlers% - {\installprettyhandler 17 \XMLnormal - \installprettyhandler 10 \XMLwhattag - \installprettyhandler 11 \XMLstoptag - \installprettyhandler 12 \XMLtypeonetwo - \installprettyhandler 13 \XMLtypeonethree - \installprettyhandler 14 \XMLtypeonefour - \installprettyhandler 15 \XMLtypeonefive - \installprettyhandler 16 \XMLtypeonesix - \installprettyhandler 20 \XMLdoublequote - \installprettyhandler 31 \XMLtypethreeone - \installprettyhandler 32 \XMLtypethreetwo - \installprettyhandler 41 \XMLbampersand - \installprettyhandler 42 \XMLeampersand } - -\doglobal\newif\ifinXMLpi -\doglobal\newif\ifinXMLtag -\doglobal\newif\ifinXMLvalue -\doglobal\newif\ifinXMLspecial -\doglobal\newif\ifinXMLcomment -\doglobal\newif\ifinXMLtagname -\doglobal\newif\ifinXMLattribute -\doglobal\newif\ifinXMLentity - -% the list of actions to be executed per state - -% test if we have a normal tag, processing instruction or a special, -% i.e. <, - -\gdef\XMLstoptag#1% - {\ifinXMLcomment - \getpretty{#1}% - \else - \ifinXMLvalue - \getpretty{#1}% - \else - \endXMLtagname - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \doXMLstoptag - \XMLlinebreak - \fi - \fi} - -\gdef\doXMLstoptag% - {\global\inXMLpifalse % either end process instruction - \global\inXMLspecialfalse % or special - \global\inXMLtagfalse % tag ends always - \global\inXMLtagnamefalse} % just to be sure - -% end typeset name of tag -% because called often, we also use it to end the default -% attribute color. - -\gdef\endXMLtagname% - {\ifinXMLtagname - \endofpretty - \inXMLtagnamefalse - \else - \XMLstopattribute - \fi} - -% start attribute formatting inside a tag if applicable - -\gdef\XMLstartattribute% - {\ifinXMLcomment \else - \ifinXMLpi - \ifXMLmarkkeys\else\endXMLtagname\fi % option - \else - \endXMLtagname - \ifinXMLtag - \doXMLstartattribute - \fi - \fi - \fi} - -\gdef\XMLstopattribute% - {\ifinXMLattribute - \endofpretty - \inXMLattributefalse - \fi} - -\gdef\doXMLstartattribute - {\inXMLattributetrue - \beginofpretty[\!!prettythree]} - -% `?' character, needed to recognize ?> - -\gdef\XMLtypeonetwo% - {\endXMLtagname - \handlenextnextpretty\doXMLtypeonetwo\doXMLout} - -\gdef\doXMLtypeonetwo#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=11 % > - \expandafter\dododoXMLtypeonetwo - \else % treat as `green' character - \expandafter\XMLtypethreeone - \fi - {#1}#2} - -\gdef\dododoXMLtypeonetwo#1#2% - {\ifinXMLcomment - \getpretties{#1}{#2}% - \else - \ifinXMLtag - \ifinXMLvalue - \getpretties{#1}{#2}% - \else - \ifinXMLpi - \beginofpretty[\!!prettythree]\getpretties{#1}{#2}\endofpretty - \else % treat as green character - \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty - \beginofpretty[\!!prettythree]#2\endofpretty - \fi - \doXMLstoptag - \fi - \else - \getpretties{#1}{#2}% - \fi - \fi} - -% '/' character, catch /> and -% when is ahead -% so the comment can stop. - -\gdef\XMLtypeonefive% - {\handlenextnextpretty\doXMLtypeonefive\doXMLout} - -\gdef\doXMLtypeonefive#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=15 - \ifinXMLcomment - \let\next=\dodoXMLtypeonefive - \else - \ifinXMLspecial - \let\next=\startXMLcomment - \else - \let\next=\doXMLouttwo - \fi - \fi - \else - \let\next=\doXMLouttwo - \fi - \next{#1}#2} - -\gdef\startXMLcomment#1#2% - {\beginofpretty[\!!prettythree]\getpretties{#1}{#2}\endofpretty - \beginofpretty[\!!prettyfour]% - \global\inXMLcommenttrue} - -\gdef\dodoXMLtypeonefive#1% encountered - - {\def\prev{#1}\handlenextnextpretty\dododoXMLtypeonefive\doXMLout} - -\gdef\nodoXMLtypeonefive% encountered - - {\getpretty{\prev}\doXMLout} - -\gdef\dododoXMLtypeonefive#1#2% - {\getprettydata{#2}% - \ifnum\prettytype=11 - \endofpretty\getpretty{\prev}#1\empty\global\inXMLcommentfalse#2% - \else - \getpretty{\prev}#1#2% - \fi} - -\global\let\doXMLout \getpretty -\global\let\doXMLouttwo\getpretties - -% '=' inside tags needs to be blue - -\gdef\XMLtypeonesix#1% - {\ifinXMLtag - \endofpretty - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \beginofpretty[\!!prettyone]% - \else - \getpretty{#1}% - \fi} - -% catch attribute value parts - -\gdef\XMLdoublequote#1% - {\ifinXMLcomment - \getpretty{#1}% - \else - \ifinXMLtag - \ifinXMLvalue - \global\inXMLvaluefalse - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \ifXMLmarkkeys\beginofpretty[\!!prettyone]\fi - \else - \endofpretty - \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty - \global\inXMLvaluetrue - \fi - \else - \getpretty{#1}% - \fi - \fi} - -% symbols like `(', `)' and `,' should be green - -\gdef\XMLtypethreeone#1% - {\ifinXMLcomment - \getpretty{#1}% - \else - \ifinXMLtag - \endXMLtagname - \ifinXMLvalue - \getpretty{#1}% - \else - \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty - \XMLstartattribute% again - \fi - \else - \getpretty{#1}% - \fi - \fi} - -% \gdef\XMLtypethreetwo#1% -% {\ifinXMLcomment -% \getpretty{#1}% -% \else -% \ifinXMLtagname -% \endofpretty -% \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty -% \beginofpretty[\!!prettyone]% -% \else -% \getpretty{#1}% -% \fi -% \fi} - -\gdef\XMLtypethreetwo#1% - {\getpretty{#1}} - -% special characters with `&' - -\gdef\XMLbampersand#1% - {\ifinXMLcomment - \getpretty{#1}% - \else - \endXMLtagname - \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty - \global\inXMLentitytrue - \fi} - -\gdef\XMLeampersand#1% - {\ifinXMLcomment - \getpretty{#1}% - \else - \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty - \global\inXMLentityfalse - \fi} - -\protect \endinput diff --git a/tex/context/base/xetx-chr.mkii b/tex/context/base/xetx-chr.mkii new file mode 100644 index 000000000..31f15a0cb --- /dev/null +++ b/tex/context/base/xetx-chr.mkii @@ -0,0 +1,1167 @@ +% filename : xetx-chr.tex +% comment : generated by mtxrun --script chars --xtx +% author : Hans Hagen, PRAGMA-ADE, Hasselt NL +% copyright: PRAGMA ADE / ConTeXt Development Team +% license : see context related readme files + +% named characters mapped onto utf (\\char is needed for accents) + +\def\textbackslash {\char"0005C } % REVERSE SOLIDUS: \ +\def\textasciicircum {\char"0005E } % CIRCUMFLEX ACCENT: ^ +\def\textunderscore {\char"0005F } % LOW LINE: _ +\def\textgrave {\char"00060 } % GRAVE ACCENT: ` +\def\idotaccent {\char"00069 } % LATIN SMALL LETTER I: i +\def\textbraceleft {\char"0007B } % LEFT CURLY BRACKET: { +\def\textbar {\char"0007C } % VERTICAL LINE: | +\def\textbraceright {\char"0007D } % RIGHT CURLY BRACKET: } +\def\textasciitilde {\char"0007E } % TILDE: ~ +\def\nobreakspace {\char"000A0 } % NO-BREAK SPACE:   +\def\exclamdown {\char"000A1 } % INVERTED EXCLAMATION MARK: ¡ +\def\textcent {\char"000A2 } % CENT SIGN: ¢ +\def\textsterling {\char"000A3 } % POUND SIGN: £ +\def\textcurrency {\char"000A4 } % CURRENCY SIGN: ¤ +\def\textyen {\char"000A5 } % YEN SIGN: ¥ +\def\textbrokenbar {\char"000A6 } % BROKEN BAR: ¦ +\def\sectionmark {\char"000A7 } % SECTION SIGN: § +\def\textdiaeresis {\char"000A8 } % DIAERESIS: ¨ +\def\copyright {\char"000A9 } % COPYRIGHT SIGN: © +\def\ordfeminine {\char"000AA } % FEMININE ORDINAL INDICATOR: ª +\def\leftguillemot {\char"000AB } % LEFT-POINTING DOUBLE ANGLE QUOTATION MARK: « +\def\textlognot {\char"000AC } % NOT SIGN: ¬ +\def\softhyphen {\char"000AD } % SOFT HYPHEN: ­ +\def\registered {\char"000AE } % REGISTERED SIGN: ® +\def\textmacron {\char"000AF } % MACRON: ¯ +\def\textdegree {\char"000B0 } % DEGREE SIGN: ° +\def\textpm {\char"000B1 } % PLUS-MINUS SIGN: ± +\def\twosuperior {\char"000B2 } % SUPERSCRIPT TWO: ² +\def\threesuperior {\char"000B3 } % SUPERSCRIPT THREE: ³ +\def\textacute {\char"000B4 } % ACUTE ACCENT: ´ +\def\textmu {\char"000B5 } % MICRO SIGN: µ +\def\paragraphmark {\char"000B6 } % PILCROW SIGN: ¶ +\def\periodcentered {\char"000B7 } % MIDDLE DOT: · +\def\textcedilla {\char"000B8 } % CEDILLA: ¸ +\def\onesuperior {\char"000B9 } % SUPERSCRIPT ONE: ¹ +\def\ordmasculine {\char"000BA } % MASCULINE ORDINAL INDICATOR: º +\def\rightguillemot {\char"000BB } % RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK: » +\def\onequarter {\char"000BC } % VULGAR FRACTION ONE QUARTER: ¼ +\def\onehalf {\char"000BD } % VULGAR FRACTION ONE HALF: ½ +\def\threequarter {\char"000BE } % VULGAR FRACTION THREE QUARTERS: ¾ +\def\questiondown {\char"000BF } % INVERTED QUESTION MARK: ¿ +\def\Agrave {\char"000C0 } % LATIN CAPITAL LETTER A WITH GRAVE: À +\def\Aacute {\char"000C1 } % LATIN CAPITAL LETTER A WITH ACUTE: Á +\def\Acircumflex {\char"000C2 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX:  +\def\Atilde {\char"000C3 } % LATIN CAPITAL LETTER A WITH TILDE: à +\def\Adiaeresis {\char"000C4 } % LATIN CAPITAL LETTER A WITH DIAERESIS: Ä +\def\Aring {\char"000C5 } % LATIN CAPITAL LETTER A WITH RING ABOVE: Å +\def\AEligature {\char"000C6 } % LATIN CAPITAL LETTER AE: Æ +\def\Ccedilla {\char"000C7 } % LATIN CAPITAL LETTER C WITH CEDILLA: Ç +\def\Egrave {\char"000C8 } % LATIN CAPITAL LETTER E WITH GRAVE: È +\def\Eacute {\char"000C9 } % LATIN CAPITAL LETTER E WITH ACUTE: É +\def\Ecircumflex {\char"000CA } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX: Ê +\def\Ediaeresis {\char"000CB } % LATIN CAPITAL LETTER E WITH DIAERESIS: Ë +\def\Igrave {\char"000CC } % LATIN CAPITAL LETTER I WITH GRAVE: Ì +\def\Iacute {\char"000CD } % LATIN CAPITAL LETTER I WITH ACUTE: Í +\def\Icircumflex {\char"000CE } % LATIN CAPITAL LETTER I WITH CIRCUMFLEX: Î +\def\Idiaeresis {\char"000CF } % LATIN CAPITAL LETTER I WITH DIAERESIS: Ï +\def\Eth {\char"000D0 } % LATIN CAPITAL LETTER ETH: Ð +\def\Ntilde {\char"000D1 } % LATIN CAPITAL LETTER N WITH TILDE: Ñ +\def\Ograve {\char"000D2 } % LATIN CAPITAL LETTER O WITH GRAVE: Ò +\def\Oacute {\char"000D3 } % LATIN CAPITAL LETTER O WITH ACUTE: Ó +\def\Ocircumflex {\char"000D4 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX: Ô +\def\Otilde {\char"000D5 } % LATIN CAPITAL LETTER O WITH TILDE: Õ +\def\Odiaeresis {\char"000D6 } % LATIN CAPITAL LETTER O WITH DIAERESIS: Ö +\def\textmultiply {\char"000D7 } % MULTIPLICATION SIGN: × +\def\Ostroke {\char"000D8 } % LATIN CAPITAL LETTER O WITH STROKE: Ø +\def\Ugrave {\char"000D9 } % LATIN CAPITAL LETTER U WITH GRAVE: Ù +\def\Uacute {\char"000DA } % LATIN CAPITAL LETTER U WITH ACUTE: Ú +\def\Ucircumflex {\char"000DB } % LATIN CAPITAL LETTER U WITH CIRCUMFLEX: Û +\def\Udiaeresis {\char"000DC } % LATIN CAPITAL LETTER U WITH DIAERESIS: Ü +\def\Yacute {\char"000DD } % LATIN CAPITAL LETTER Y WITH ACUTE: Ý +\def\Thorn {\char"000DE } % LATIN CAPITAL LETTER THORN: Þ +\def\ssharp {\char"000DF } % LATIN SMALL LETTER SHARP S: ß +\def\agrave {\char"000E0 } % LATIN SMALL LETTER A WITH GRAVE: à +\def\aacute {\char"000E1 } % LATIN SMALL LETTER A WITH ACUTE: á +\def\acircumflex {\char"000E2 } % LATIN SMALL LETTER A WITH CIRCUMFLEX: â +\def\atilde {\char"000E3 } % LATIN SMALL LETTER A WITH TILDE: ã +\def\adiaeresis {\char"000E4 } % LATIN SMALL LETTER A WITH DIAERESIS: ä +\def\aring {\char"000E5 } % LATIN SMALL LETTER A WITH RING ABOVE: å +\def\aeligature {\char"000E6 } % LATIN SMALL LETTER AE: æ +\def\ccedilla {\char"000E7 } % LATIN SMALL LETTER C WITH CEDILLA: ç +\def\egrave {\char"000E8 } % LATIN SMALL LETTER E WITH GRAVE: è +\def\eacute {\char"000E9 } % LATIN SMALL LETTER E WITH ACUTE: é +\def\ecircumflex {\char"000EA } % LATIN SMALL LETTER E WITH CIRCUMFLEX: ê +\def\ediaeresis {\char"000EB } % LATIN SMALL LETTER E WITH DIAERESIS: ë +\def\igrave {\char"000EC } % LATIN SMALL LETTER I WITH GRAVE: ì +\def\iacute {\char"000ED } % LATIN SMALL LETTER I WITH ACUTE: í +\def\icircumflex {\char"000EE } % LATIN SMALL LETTER I WITH CIRCUMFLEX: î +\def\idiaeresis {\char"000EF } % LATIN SMALL LETTER I WITH DIAERESIS: ï +\def\ntilde {\char"000F1 } % LATIN SMALL LETTER N WITH TILDE: ñ +\def\ograve {\char"000F2 } % LATIN SMALL LETTER O WITH GRAVE: ò +\def\oacute {\char"000F3 } % LATIN SMALL LETTER O WITH ACUTE: ó +\def\ocircumflex {\char"000F4 } % LATIN SMALL LETTER O WITH CIRCUMFLEX: ô +\def\otilde {\char"000F5 } % LATIN SMALL LETTER O WITH TILDE: õ +\def\odiaeresis {\char"000F6 } % LATIN SMALL LETTER O WITH DIAERESIS: ö +\def\textdiv {\char"000F7 } % DIVISION SIGN: ÷ +\def\ostroke {\char"000F8 } % LATIN SMALL LETTER O WITH STROKE: ø +\def\ugrave {\char"000F9 } % LATIN SMALL LETTER U WITH GRAVE: ù +\def\uacute {\char"000FA } % LATIN SMALL LETTER U WITH ACUTE: ú +\def\ucircumflex {\char"000FB } % LATIN SMALL LETTER U WITH CIRCUMFLEX: û +\def\udiaeresis {\char"000FC } % LATIN SMALL LETTER U WITH DIAERESIS: ü +\def\yacute {\char"000FD } % LATIN SMALL LETTER Y WITH ACUTE: ý +\def\thorn {\char"000FE } % LATIN SMALL LETTER THORN: þ +\def\ydiaeresis {\char"000FF } % LATIN SMALL LETTER Y WITH DIAERESIS: ÿ +\def\Amacron {\char"00100 } % LATIN CAPITAL LETTER A WITH MACRON: Ā +\def\amacron {\char"00101 } % LATIN SMALL LETTER A WITH MACRON: ā +\def\Abreve {\char"00102 } % LATIN CAPITAL LETTER A WITH BREVE: Ă +\def\abreve {\char"00103 } % LATIN SMALL LETTER A WITH BREVE: ă +\def\Aogonek {\char"00104 } % LATIN CAPITAL LETTER A WITH OGONEK: Ą +\def\aogonek {\char"00105 } % LATIN SMALL LETTER A WITH OGONEK: ą +\def\Cacute {\char"00106 } % LATIN CAPITAL LETTER C WITH ACUTE: Ć +\def\cacute {\char"00107 } % LATIN SMALL LETTER C WITH ACUTE: ć +\def\Ccircumflex {\char"00108 } % LATIN CAPITAL LETTER C WITH CIRCUMFLEX: Ĉ +\def\ccircumflex {\char"00109 } % LATIN SMALL LETTER C WITH CIRCUMFLEX: ĉ +\def\Cdotaccent {\char"0010A } % LATIN CAPITAL LETTER C WITH DOT ABOVE: Ċ +\def\cdotaccent {\char"0010B } % LATIN SMALL LETTER C WITH DOT ABOVE: ċ +\def\Ccaron {\char"0010C } % LATIN CAPITAL LETTER C WITH CARON: Č +\def\ccaron {\char"0010D } % LATIN SMALL LETTER C WITH CARON: č +\def\Dcaron {\char"0010E } % LATIN CAPITAL LETTER D WITH CARON: Ď +\def\dcaron {\char"0010F } % LATIN SMALL LETTER D WITH CARON: ď +\def\Dstroke {\char"00110 } % LATIN CAPITAL LETTER D WITH STROKE: Đ +\def\dstroke {\char"00111 } % LATIN SMALL LETTER D WITH STROKE: đ +\def\Emacron {\char"00112 } % LATIN CAPITAL LETTER E WITH MACRON: Ē +\def\emacron {\char"00113 } % LATIN SMALL LETTER E WITH MACRON: ē +\def\Ebreve {\char"00114 } % LATIN CAPITAL LETTER E WITH BREVE: Ĕ +\def\ebreve {\char"00115 } % LATIN SMALL LETTER E WITH BREVE: ĕ +\def\Edotaccent {\char"00116 } % LATIN CAPITAL LETTER E WITH DOT ABOVE: Ė +\def\edotaccent {\char"00117 } % LATIN SMALL LETTER E WITH DOT ABOVE: ė +\def\Eogonek {\char"00118 } % LATIN CAPITAL LETTER E WITH OGONEK: Ę +\def\eogonek {\char"00119 } % LATIN SMALL LETTER E WITH OGONEK: ę +\def\Ecaron {\char"0011A } % LATIN CAPITAL LETTER E WITH CARON: Ě +\def\ecaron {\char"0011B } % LATIN SMALL LETTER E WITH CARON: ě +\def\Gcircumflex {\char"0011C } % LATIN CAPITAL LETTER G WITH CIRCUMFLEX: Ĝ +\def\gcircumflex {\char"0011D } % LATIN SMALL LETTER G WITH CIRCUMFLEX: ĝ +\def\Gbreve {\char"0011E } % LATIN CAPITAL LETTER G WITH BREVE: Ğ +\def\gbreve {\char"0011F } % LATIN SMALL LETTER G WITH BREVE: ğ +\def\Gdotaccent {\char"00120 } % LATIN CAPITAL LETTER G WITH DOT ABOVE: Ġ +\def\gdotaccent {\char"00121 } % LATIN SMALL LETTER G WITH DOT ABOVE: ġ +\def\Gcommaaccent {\char"00122 } % LATIN CAPITAL LETTER G WITH CEDILLA: Ģ +\def\gcommaaccent {\char"00123 } % LATIN SMALL LETTER G WITH CEDILLA: ģ +\def\Hcircumflex {\char"00124 } % LATIN CAPITAL LETTER H WITH CIRCUMFLEX: Ĥ +\def\hcircumflex {\char"00125 } % LATIN SMALL LETTER H WITH CIRCUMFLEX: ĥ +\def\Hstroke {\char"00126 } % LATIN CAPITAL LETTER H WITH STROKE: Ħ +\def\hstroke {\char"00127 } % LATIN SMALL LETTER H WITH STROKE: ħ +\def\Itilde {\char"00128 } % LATIN CAPITAL LETTER I WITH TILDE: Ĩ +\def\itilde {\char"00129 } % LATIN SMALL LETTER I WITH TILDE: ĩ +\def\Imacron {\char"0012A } % LATIN CAPITAL LETTER I WITH MACRON: Ī +\def\imacron {\char"0012B } % LATIN SMALL LETTER I WITH MACRON: ī +\def\Ibreve {\char"0012C } % LATIN CAPITAL LETTER I WITH BREVE: Ĭ +\def\ibreve {\char"0012D } % LATIN SMALL LETTER I WITH BREVE: ĭ +\def\Iogonek {\char"0012E } % LATIN CAPITAL LETTER I WITH OGONEK: Į +\def\iogonek {\char"0012F } % LATIN SMALL LETTER I WITH OGONEK: į +\def\Idotaccent {\char"00130 } % LATIN CAPITAL LETTER I WITH DOT ABOVE: İ +\def\dotlessi {\char"00131 } % LATIN SMALL LETTER DOTLESS I: ı +\def\IJligature {\char"00132 } % LATIN CAPITAL LIGATURE IJ: IJ +\def\ijligature {\char"00133 } % LATIN SMALL LIGATURE IJ: ij +\def\Jcircumflex {\char"00134 } % LATIN CAPITAL LETTER J WITH CIRCUMFLEX: Ĵ +\def\jcircumflex {\char"00135 } % LATIN SMALL LETTER J WITH CIRCUMFLEX: ĵ +\def\Kcommaaccent {\char"00136 } % LATIN CAPITAL LETTER K WITH CEDILLA: Ķ +\def\kcommaaccent {\char"00137 } % LATIN SMALL LETTER K WITH CEDILLA: ķ +\def\kkra {\char"00138 } % LATIN SMALL LETTER KRA: ĸ +\def\Lacute {\char"00139 } % LATIN CAPITAL LETTER L WITH ACUTE: Ĺ +\def\lacute {\char"0013A } % LATIN SMALL LETTER L WITH ACUTE: ĺ +\def\Lcommaaccent {\char"0013B } % LATIN CAPITAL LETTER L WITH CEDILLA: Ļ +\def\lcommaaccent {\char"0013C } % LATIN SMALL LETTER L WITH CEDILLA: ļ +\def\Lcaron {\char"0013D } % LATIN CAPITAL LETTER L WITH CARON: Ľ +\def\lcaron {\char"0013E } % LATIN SMALL LETTER L WITH CARON: ľ +\def\Ldotmiddle {\char"0013F } % LATIN CAPITAL LETTER L WITH MIDDLE DOT: Ŀ +\def\ldotmiddle {\char"00140 } % LATIN SMALL LETTER L WITH MIDDLE DOT: ŀ +\def\Lstroke {\char"00141 } % LATIN CAPITAL LETTER L WITH STROKE: Ł +\def\lstroke {\char"00142 } % LATIN SMALL LETTER L WITH STROKE: ł +\def\Nacute {\char"00143 } % LATIN CAPITAL LETTER N WITH ACUTE: Ń +\def\nacute {\char"00144 } % LATIN SMALL LETTER N WITH ACUTE: ń +\def\Ncommaaccent {\char"00145 } % LATIN CAPITAL LETTER N WITH CEDILLA: Ņ +\def\ncommaaccent {\char"00146 } % LATIN SMALL LETTER N WITH CEDILLA: ņ +\def\Ncaron {\char"00147 } % LATIN CAPITAL LETTER N WITH CARON: Ň +\def\ncaron {\char"00148 } % LATIN SMALL LETTER N WITH CARON: ň +\def\napostrophe {\char"00149 } % LATIN SMALL LETTER N PRECEDED BY APOSTROPHE: ʼn +\def\Neng {\char"0014A } % LATIN CAPITAL LETTER ENG: Ŋ +\def\neng {\char"0014B } % LATIN SMALL LETTER ENG: ŋ +\def\Omacron {\char"0014C } % LATIN CAPITAL LETTER O WITH MACRON: Ō +\def\omacron {\char"0014D } % LATIN SMALL LETTER O WITH MACRON: ō +\def\Obreve {\char"0014E } % LATIN CAPITAL LETTER O WITH BREVE: Ŏ +\def\obreve {\char"0014F } % LATIN SMALL LETTER O WITH BREVE: ŏ +\def\Ohungarumlaut {\char"00150 } % LATIN CAPITAL LETTER O WITH DOUBLE ACUTE: Ő +\def\ohungarumlaut {\char"00151 } % LATIN SMALL LETTER O WITH DOUBLE ACUTE: ő +\def\OEligature {\char"00152 } % LATIN CAPITAL LIGATURE OE: Œ +\def\oeligature {\char"00153 } % LATIN SMALL LIGATURE OE: œ +\def\Racute {\char"00154 } % LATIN CAPITAL LETTER R WITH ACUTE: Ŕ +\def\racute {\char"00155 } % LATIN SMALL LETTER R WITH ACUTE: ŕ +\def\Rcommaaccent {\char"00156 } % LATIN CAPITAL LETTER R WITH CEDILLA: Ŗ +\def\rcommaaccent {\char"00157 } % LATIN SMALL LETTER R WITH CEDILLA: ŗ +\def\Rcaron {\char"00158 } % LATIN CAPITAL LETTER R WITH CARON: Ř +\def\rcaron {\char"00159 } % LATIN SMALL LETTER R WITH CARON: ř +\def\Sacute {\char"0015A } % LATIN CAPITAL LETTER S WITH ACUTE: Ś +\def\sacute {\char"0015B } % LATIN SMALL LETTER S WITH ACUTE: ś +\def\Scircumflex {\char"0015C } % LATIN CAPITAL LETTER S WITH CIRCUMFLEX: Ŝ +\def\scircumflex {\char"0015D } % LATIN SMALL LETTER S WITH CIRCUMFLEX: ŝ +\def\Scedilla {\char"0015E } % LATIN CAPITAL LETTER S WITH CEDILLA: Ş +\def\scedilla {\char"0015F } % LATIN SMALL LETTER S WITH CEDILLA: ş +\def\Scaron {\char"00160 } % LATIN CAPITAL LETTER S WITH CARON: Š +\def\scaron {\char"00161 } % LATIN SMALL LETTER S WITH CARON: š +\def\Tcedilla {\char"00162 } % LATIN CAPITAL LETTER T WITH CEDILLA: Ţ +\def\tcedilla {\char"00163 } % LATIN SMALL LETTER T WITH CEDILLA: ţ +\def\Tcaron {\char"00164 } % LATIN CAPITAL LETTER T WITH CARON: Ť +\def\tcaron {\char"00165 } % LATIN SMALL LETTER T WITH CARON: ť +\def\Tstroke {\char"00166 } % LATIN CAPITAL LETTER T WITH STROKE: Ŧ +\def\tstroke {\char"00167 } % LATIN SMALL LETTER T WITH STROKE: ŧ +\def\Utilde {\char"00168 } % LATIN CAPITAL LETTER U WITH TILDE: Ũ +\def\utilde {\char"00169 } % LATIN SMALL LETTER U WITH TILDE: ũ +\def\Umacron {\char"0016A } % LATIN CAPITAL LETTER U WITH MACRON: Ū +\def\umacron {\char"0016B } % LATIN SMALL LETTER U WITH MACRON: ū +\def\Ubreve {\char"0016C } % LATIN CAPITAL LETTER U WITH BREVE: Ŭ +\def\ubreve {\char"0016D } % LATIN SMALL LETTER U WITH BREVE: ŭ +\def\Uring {\char"0016E } % LATIN CAPITAL LETTER U WITH RING ABOVE: Ů +\def\uring {\char"0016F } % LATIN SMALL LETTER U WITH RING ABOVE: ů +\def\Uhungarumlaut {\char"00170 } % LATIN CAPITAL LETTER U WITH DOUBLE ACUTE: Ű +\def\uhungarumlaut {\char"00171 } % LATIN SMALL LETTER U WITH DOUBLE ACUTE: ű +\def\Uogonek {\char"00172 } % LATIN CAPITAL LETTER U WITH OGONEK: Ų +\def\uogonek {\char"00173 } % LATIN SMALL LETTER U WITH OGONEK: ų +\def\Wcircumflex {\char"00174 } % LATIN CAPITAL LETTER W WITH CIRCUMFLEX: Ŵ +\def\wcircumflex {\char"00175 } % LATIN SMALL LETTER W WITH CIRCUMFLEX: ŵ +\def\Ycircumflex {\char"00176 } % LATIN CAPITAL LETTER Y WITH CIRCUMFLEX: Ŷ +\def\ycircumflex {\char"00177 } % LATIN SMALL LETTER Y WITH CIRCUMFLEX: ŷ +\def\Ydiaeresis {\char"00178 } % LATIN CAPITAL LETTER Y WITH DIAERESIS: Ÿ +\def\Zacute {\char"00179 } % LATIN CAPITAL LETTER Z WITH ACUTE: Ź +\def\zacute {\char"0017A } % LATIN SMALL LETTER Z WITH ACUTE: ź +\def\Zdotaccent {\char"0017B } % LATIN CAPITAL LETTER Z WITH DOT ABOVE: Ż +\def\zdotaccent {\char"0017C } % LATIN SMALL LETTER Z WITH DOT ABOVE: ż +\def\Zcaron {\char"0017D } % LATIN CAPITAL LETTER Z WITH CARON: Ž +\def\zcaron {\char"0017E } % LATIN SMALL LETTER Z WITH CARON: ž +\def\slong {\char"0017F } % LATIN SMALL LETTER LONG S: ſ +\def\bstroke {\char"00180 } % LATIN SMALL LETTER B WITH STROKE: ƀ +\def\Bhook {\char"00181 } % LATIN CAPITAL LETTER B WITH HOOK: Ɓ +\def\Chook {\char"00187 } % LATIN CAPITAL LETTER C WITH HOOK: Ƈ +\def\chook {\char"00188 } % LATIN SMALL LETTER C WITH HOOK: ƈ +\def\Dafrican {\char"00189 } % LATIN CAPITAL LETTER AFRICAN D: Ɖ +\def\Dhook {\char"0018A } % LATIN CAPITAL LETTER D WITH HOOK: Ɗ +\def\Schwa {\char"0018F } % LATIN CAPITAL LETTER SCHWA: Ə +\def\Fhook {\char"00191 } % LATIN CAPITAL LETTER F WITH HOOK: Ƒ +\def\fhook {\char"00192 } % LATIN SMALL LETTER F WITH HOOK: ƒ +\def\Ghook {\char"00193 } % LATIN CAPITAL LETTER G WITH HOOK: Ɠ +\def\Istroke {\char"00197 } % LATIN CAPITAL LETTER I WITH STROKE: Ɨ +\def\Khook {\char"00198 } % LATIN CAPITAL LETTER K WITH HOOK: Ƙ +\def\khook {\char"00199 } % LATIN SMALL LETTER K WITH HOOK: ƙ +\def\lbar {\char"0019A } % LATIN SMALL LETTER L WITH BAR: ƚ +\def\Ohorn {\char"001A0 } % LATIN CAPITAL LETTER O WITH HORN: Ơ +\def\ohorn {\char"001A1 } % LATIN SMALL LETTER O WITH HORN: ơ +\def\Phook {\char"001A4 } % LATIN CAPITAL LETTER P WITH HOOK: Ƥ +\def\phook {\char"001A5 } % LATIN SMALL LETTER P WITH HOOK: ƥ +\def\Thook {\char"001AC } % LATIN CAPITAL LETTER T WITH HOOK: Ƭ +\def\thook {\char"001AD } % LATIN SMALL LETTER T WITH HOOK: ƭ +\def\Uhorn {\char"001AF } % LATIN CAPITAL LETTER U WITH HORN: Ư +\def\uhorn {\char"001B0 } % LATIN SMALL LETTER U WITH HORN: ư +\def\Uhook {\char"001B2 } % LATIN CAPITAL LETTER V WITH HOOK: Ʋ +\def\Yhook {\char"001B3 } % LATIN CAPITAL LETTER Y WITH HOOK: Ƴ +\def\yhook {\char"001B4 } % LATIN SMALL LETTER Y WITH HOOK: ƴ +\def\Zstroke {\char"001B5 } % LATIN CAPITAL LETTER Z WITH STROKE: Ƶ +\def\zstroke {\char"001B6 } % LATIN SMALL LETTER Z WITH STROKE: ƶ +\def\DZcaronligature {\char"001C4 } % LATIN CAPITAL LETTER DZ WITH CARON: DŽ +\def\Dzcaronligature {\char"001C5 } % LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON: Dž +\def\dzcaronligature {\char"001C6 } % LATIN SMALL LETTER DZ WITH CARON: dž +\def\LJligature {\char"001C7 } % LATIN CAPITAL LETTER LJ: LJ +\def\Ljligature {\char"001C8 } % LATIN CAPITAL LETTER L WITH SMALL LETTER J: Lj +\def\ljligature {\char"001C9 } % LATIN SMALL LETTER LJ: lj +\def\NJligature {\char"001CA } % LATIN CAPITAL LETTER NJ: NJ +\def\Njligature {\char"001CB } % LATIN CAPITAL LETTER N WITH SMALL LETTER J: Nj +\def\njligature {\char"001CC } % LATIN SMALL LETTER NJ: nj +\def\Acaron {\char"001CD } % LATIN CAPITAL LETTER A WITH CARON: Ǎ +\def\acaron {\char"001CE } % LATIN SMALL LETTER A WITH CARON: ǎ +\def\Icaron {\char"001CF } % LATIN CAPITAL LETTER I WITH CARON: Ǐ +\def\icaron {\char"001D0 } % LATIN SMALL LETTER I WITH CARON: ǐ +\def\Ocaron {\char"001D1 } % LATIN CAPITAL LETTER O WITH CARON: Ǒ +\def\ocaron {\char"001D2 } % LATIN SMALL LETTER O WITH CARON: ǒ +\def\Ucaron {\char"001D3 } % LATIN CAPITAL LETTER U WITH CARON: Ǔ +\def\ucaron {\char"001D4 } % LATIN SMALL LETTER U WITH CARON: ǔ +\def\Udiaeresismacron {\char"001D5 } % LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON: Ǖ +\def\udiaeresismacron {\char"001D6 } % LATIN SMALL LETTER U WITH DIAERESIS AND MACRON: ǖ +\def\Udiaeresisacute {\char"001D7 } % LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE: Ǘ +\def\udiaeresisacute {\char"001D8 } % LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE: ǘ +\def\Udiaeresiscaron {\char"001D9 } % LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON: Ǚ +\def\udiaeresiscaron {\char"001DA } % LATIN SMALL LETTER U WITH DIAERESIS AND CARON: ǚ +\def\Udiaeresisgrave {\char"001DB } % LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE: Ǜ +\def\udiaeresisgrave {\char"001DC } % LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE: ǜ +\def\Adiaeresismacron {\char"001DE } % LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON: Ǟ +\def\adiaeresismacron {\char"001DF } % LATIN SMALL LETTER A WITH DIAERESIS AND MACRON: ǟ +\def\Adotaccentmacron {\char"001E0 } % LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON: Ǡ +\def\adotaccentmacron {\char"001E1 } % LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON: ǡ +\def\AEmacron {\char"001E2 } % LATIN CAPITAL LETTER AE WITH MACRON: Ǣ +\def\aemacron {\char"001E3 } % LATIN SMALL LETTER AE WITH MACRON: ǣ +\def\Gstroke {\char"001E4 } % LATIN CAPITAL LETTER G WITH STROKE: Ǥ +\def\gstroke {\char"001E5 } % LATIN SMALL LETTER G WITH STROKE: ǥ +\def\Gcaron {\char"001E6 } % LATIN CAPITAL LETTER G WITH CARON: Ǧ +\def\gcaron {\char"001E7 } % LATIN SMALL LETTER G WITH CARON: ǧ +\def\Kcaron {\char"001E8 } % LATIN CAPITAL LETTER K WITH CARON: Ǩ +\def\kcaron {\char"001E9 } % LATIN SMALL LETTER K WITH CARON: ǩ +\def\Oogonek {\char"001EA } % LATIN CAPITAL LETTER O WITH OGONEK: Ǫ +\def\oogonek {\char"001EB } % LATIN SMALL LETTER O WITH OGONEK: ǫ +\def\Oogonekmacron {\char"001EC } % LATIN CAPITAL LETTER O WITH OGONEK AND MACRON: Ǭ +\def\oogonekmacron {\char"001ED } % LATIN SMALL LETTER O WITH OGONEK AND MACRON: ǭ +\def\jcaron {\char"001F0 } % LATIN SMALL LETTER J WITH CARON: ǰ +\def\DZligature {\char"001F1 } % LATIN CAPITAL LETTER DZ: DZ +\def\Dzligature {\char"001F2 } % LATIN CAPITAL LETTER D WITH SMALL LETTER Z: Dz +\def\dzligature {\char"001F3 } % LATIN SMALL LETTER DZ: dz +\def\Gacute {\char"001F4 } % LATIN CAPITAL LETTER G WITH ACUTE: Ǵ +\def\gacute {\char"001F5 } % LATIN SMALL LETTER G WITH ACUTE: ǵ +\def\Ngrave {\char"001F8 } % LATIN CAPITAL LETTER N WITH GRAVE: Ǹ +\def\ngrave {\char"001F9 } % LATIN SMALL LETTER N WITH GRAVE: ǹ +\def\Aringacute {\char"001FA } % LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE: Ǻ +\def\aringacute {\char"001FB } % LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE: ǻ +\def\AEacute {\char"001FC } % LATIN CAPITAL LETTER AE WITH ACUTE: Ǽ +\def\aeacute {\char"001FD } % LATIN SMALL LETTER AE WITH ACUTE: ǽ +\def\Ostrokeacute {\char"001FE } % LATIN CAPITAL LETTER O WITH STROKE AND ACUTE: Ǿ +\def\ostrokeacute {\char"001FF } % LATIN SMALL LETTER O WITH STROKE AND ACUTE: ǿ +\def\Adoublegrave {\char"00200 } % LATIN CAPITAL LETTER A WITH DOUBLE GRAVE: Ȁ +\def\adoublegrave {\char"00201 } % LATIN SMALL LETTER A WITH DOUBLE GRAVE: ȁ +\def\Ainvertedbreve {\char"00202 } % LATIN CAPITAL LETTER A WITH INVERTED BREVE: Ȃ +\def\ainvertedbreve {\char"00203 } % LATIN SMALL LETTER A WITH INVERTED BREVE: ȃ +\def\Edoublegrave {\char"00204 } % LATIN CAPITAL LETTER E WITH DOUBLE GRAVE: Ȅ +\def\edoublegrave {\char"00205 } % LATIN SMALL LETTER E WITH DOUBLE GRAVE: ȅ +\def\Einvertedbreve {\char"00206 } % LATIN CAPITAL LETTER E WITH INVERTED BREVE: Ȇ +\def\einvertedbreve {\char"00207 } % LATIN SMALL LETTER E WITH INVERTED BREVE: ȇ +\def\Idoublegrave {\char"00208 } % LATIN CAPITAL LETTER I WITH DOUBLE GRAVE: Ȉ +\def\idoublegrave {\char"00209 } % LATIN SMALL LETTER I WITH DOUBLE GRAVE: ȉ +\def\Iinvertedbreve {\char"0020A } % LATIN CAPITAL LETTER I WITH INVERTED BREVE: Ȋ +\def\iinvertedbreve {\char"0020B } % LATIN SMALL LETTER I WITH INVERTED BREVE: ȋ +\def\Odoublegrave {\char"0020C } % LATIN CAPITAL LETTER O WITH DOUBLE GRAVE: Ȍ +\def\odoublegrave {\char"0020D } % LATIN SMALL LETTER O WITH DOUBLE GRAVE: ȍ +\def\Oinvertedbreve {\char"0020E } % LATIN CAPITAL LETTER O WITH INVERTED BREVE: Ȏ +\def\oinvertedbreve {\char"0020F } % LATIN SMALL LETTER O WITH INVERTED BREVE: ȏ +\def\Rdoublegrave {\char"00210 } % LATIN CAPITAL LETTER R WITH DOUBLE GRAVE: Ȑ +\def\rdoublegrave {\char"00211 } % LATIN SMALL LETTER R WITH DOUBLE GRAVE: ȑ +\def\Rinvertedbreve {\char"00212 } % LATIN CAPITAL LETTER R WITH INVERTED BREVE: Ȓ +\def\rinvertedbreve {\char"00213 } % LATIN SMALL LETTER R WITH INVERTED BREVE: ȓ +\def\Udoublegrave {\char"00214 } % LATIN CAPITAL LETTER U WITH DOUBLE GRAVE: Ȕ +\def\udoublegrave {\char"00215 } % LATIN SMALL LETTER U WITH DOUBLE GRAVE: ȕ +\def\Uinvertedbreve {\char"00216 } % LATIN CAPITAL LETTER U WITH INVERTED BREVE: Ȗ +\def\uinvertedbreve {\char"00217 } % LATIN SMALL LETTER U WITH INVERTED BREVE: ȗ +\def\Scommaaccent {\char"00218 } % LATIN CAPITAL LETTER S WITH COMMA BELOW: Ș +\def\scommaaccent {\char"00219 } % LATIN SMALL LETTER S WITH COMMA BELOW: ș +\def\Tcommaaccent {\char"0021A } % LATIN CAPITAL LETTER T WITH COMMA BELOW: Ț +\def\tcommaaccent {\char"0021B } % LATIN SMALL LETTER T WITH COMMA BELOW: ț +\def\Hcaron {\char"0021E } % LATIN CAPITAL LETTER H WITH CARON: Ȟ +\def\hcaron {\char"0021F } % LATIN SMALL LETTER H WITH CARON: ȟ +\def\dcurl {\char"00221 } % LATIN SMALL LETTER D WITH CURL: ȡ +\def\Zhook {\char"00224 } % LATIN CAPITAL LETTER Z WITH HOOK: Ȥ +\def\zhook {\char"00225 } % LATIN SMALL LETTER Z WITH HOOK: ȥ +\def\Adotaccent {\char"00226 } % LATIN CAPITAL LETTER A WITH DOT ABOVE: Ȧ +\def\adotaccent {\char"00227 } % LATIN SMALL LETTER A WITH DOT ABOVE: ȧ +\def\Ecedilla {\char"00228 } % LATIN CAPITAL LETTER E WITH CEDILLA: Ȩ +\def\ecedilla {\char"00229 } % LATIN SMALL LETTER E WITH CEDILLA: ȩ +\def\Odiaeresismacron {\char"0022A } % LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON: Ȫ +\def\odiaeresismacron {\char"0022B } % LATIN SMALL LETTER O WITH DIAERESIS AND MACRON: ȫ +\def\Otildemacron {\char"0022C } % LATIN CAPITAL LETTER O WITH TILDE AND MACRON: Ȭ +\def\otildemacron {\char"0022D } % LATIN SMALL LETTER O WITH TILDE AND MACRON: ȭ +\def\Odotaccent {\char"0022E } % LATIN CAPITAL LETTER O WITH DOT ABOVE: Ȯ +\def\odotaccent {\char"0022F } % LATIN SMALL LETTER O WITH DOT ABOVE: ȯ +\def\Odotaccentmacron {\char"00230 } % LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON: Ȱ +\def\odotaccentmacron {\char"00231 } % LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON: ȱ +\def\Ymacron {\char"00232 } % LATIN CAPITAL LETTER Y WITH MACRON: Ȳ +\def\ymacron {\char"00233 } % LATIN SMALL LETTER Y WITH MACRON: ȳ +\def\lcurl {\char"00234 } % LATIN SMALL LETTER L WITH CURL: ȴ +\def\ncurl {\char"00235 } % LATIN SMALL LETTER N WITH CURL: ȵ +\def\tcurl {\char"00236 } % LATIN SMALL LETTER T WITH CURL: ȶ +\def\dotlessj {\char"00237 } % LATIN SMALL LETTER DOTLESS J: ȷ +\def\Astroke {\char"0023A } % LATIN CAPITAL LETTER A WITH STROKE: Ⱥ +\def\Cstroke {\char"0023B } % LATIN CAPITAL LETTER C WITH STROKE: Ȼ +\def\cstroke {\char"0023C } % LATIN SMALL LETTER C WITH STROKE: ȼ +\def\Lbar {\char"0023D } % LATIN CAPITAL LETTER L WITH BAR: Ƚ +\def\bhook {\char"00253 } % LATIN SMALL LETTER B WITH HOOK: ɓ +\def\ccurl {\char"00255 } % LATIN SMALL LETTER C WITH CURL: ɕ +\def\dtail {\char"00256 } % LATIN SMALL LETTER D WITH TAIL: ɖ +\def\dhook {\char"00257 } % LATIN SMALL LETTER D WITH HOOK: ɗ +\def\schwa {\char"00259 } % LATIN SMALL LETTER SCHWA: ə +\def\schwahook {\char"0025A } % LATIN SMALL LETTER SCHWA WITH HOOK: ɚ +\def\dotlessjstroke {\char"0025F } % LATIN SMALL LETTER DOTLESS J WITH STROKE: ɟ +\def\textcircumflex {\char"002C6 } % MODIFIER LETTER CIRCUMFLEX ACCENT: ˆ +\def\textcaron {\char"002C7 } % CARON: ˇ +\def\textbreve {\char"002D8 } % BREVE: ˘ +\def\textdotaccent {\char"002D9 } % DOT ABOVE: ˙ +\def\textring {\char"002DA } % RING ABOVE: ˚ +\def\textogonek {\char"002DB } % OGONEK: ˛ +\def\texttilde {\char"002DC } % SMALL TILDE: ˜ +\def\texthungarumlaut {\char"002DD } % DOUBLE ACUTE ACCENT: ˝ +\def\textbottomdot {\char"00323 } % COMBINING DOT BELOW: ̣ +\def\textbottomcomma {\char"00326 } % COMBINING COMMA BELOW: ̦ +\def\greektonos {\char"00384 } % GREEK TONOS: ΄ +\def\greekdialytikatonos {\char"00385 } % GREEK DIALYTIKA TONOS: ΅ +\def\greekAlphatonos {\char"00386 } % GREEK CAPITAL LETTER ALPHA WITH TONOS: Ά +\def\greekEpsilontonos {\char"00388 } % GREEK CAPITAL LETTER EPSILON WITH TONOS: Έ +\def\greekEtatonos {\char"00389 } % GREEK CAPITAL LETTER ETA WITH TONOS: Ή +\def\greekIotatonos {\char"0038A } % GREEK CAPITAL LETTER IOTA WITH TONOS: Ί +\def\greekOmicrontonos {\char"0038C } % GREEK CAPITAL LETTER OMICRON WITH TONOS: Ό +\def\greekUpsilontonos {\char"0038E } % GREEK CAPITAL LETTER UPSILON WITH TONOS: Ύ +\def\greekOmegatonos {\char"0038F } % GREEK CAPITAL LETTER OMEGA WITH TONOS: Ώ +\def\greekiotadialytikatonos {\char"00390 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS: ΐ +\def\greekAlpha {\char"00391 } % GREEK CAPITAL LETTER ALPHA: Α +\def\greekBeta {\char"00392 } % GREEK CAPITAL LETTER BETA: Β +\def\greekGamma {\char"00393 } % GREEK CAPITAL LETTER GAMMA: Γ +\def\greekDelta {\char"00394 } % GREEK CAPITAL LETTER DELTA: Δ +\def\greekEpsilon {\char"00395 } % GREEK CAPITAL LETTER EPSILON: Ε +\def\greekZeta {\char"00396 } % GREEK CAPITAL LETTER ZETA: Ζ +\def\greekEta {\char"00397 } % GREEK CAPITAL LETTER ETA: Η +\def\greekTheta {\char"00398 } % GREEK CAPITAL LETTER THETA: Θ +\def\greekIota {\char"00399 } % GREEK CAPITAL LETTER IOTA: Ι +\def\greekKappa {\char"0039A } % GREEK CAPITAL LETTER KAPPA: Κ +\def\greekLambda {\char"0039B } % GREEK CAPITAL LETTER LAMDA: Λ +\def\greekMu {\char"0039C } % GREEK CAPITAL LETTER MU: Μ +\def\greekNu {\char"0039D } % GREEK CAPITAL LETTER NU: Ν +\def\greekXi {\char"0039E } % GREEK CAPITAL LETTER XI: Ξ +\def\greekOmicron {\char"0039F } % GREEK CAPITAL LETTER OMICRON: Ο +\def\greekPi {\char"003A0 } % GREEK CAPITAL LETTER PI: Π +\def\greekRho {\char"003A1 } % GREEK CAPITAL LETTER RHO: Ρ +\def\greekSigma {\char"003A3 } % GREEK CAPITAL LETTER SIGMA: Σ +\def\greekTau {\char"003A4 } % GREEK CAPITAL LETTER TAU: Τ +\def\greekUpsilon {\char"003A5 } % GREEK CAPITAL LETTER UPSILON: Υ +\def\greekPhi {\char"003A6 } % GREEK CAPITAL LETTER PHI: Φ +\def\greekChi {\char"003A7 } % GREEK CAPITAL LETTER CHI: Χ +\def\greekPsi {\char"003A8 } % GREEK CAPITAL LETTER PSI: Ψ +\def\greekOmega {\char"003A9 } % GREEK CAPITAL LETTER OMEGA: Ω +\def\greekIotadialytika {\char"003AA } % GREEK CAPITAL LETTER IOTA WITH DIALYTIKA: Ϊ +\def\greekUpsilondialytika {\char"003AB } % GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA: Ϋ +\def\greekalphatonos {\char"003AC } % GREEK SMALL LETTER ALPHA WITH TONOS: ά +\def\greekepsilontonos {\char"003AD } % GREEK SMALL LETTER EPSILON WITH TONOS: έ +\def\greeketatonos {\char"003AE } % GREEK SMALL LETTER ETA WITH TONOS: ή +\def\greekiotatonos {\char"003AF } % GREEK SMALL LETTER IOTA WITH TONOS: ί +\def\greekupsilondialytikatonos {\char"003B0 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS: ΰ +\def\greekalpha {\char"003B1 } % GREEK SMALL LETTER ALPHA: α +\def\greekbeta {\char"003B2 } % GREEK SMALL LETTER BETA: β +\def\greekgamma {\char"003B3 } % GREEK SMALL LETTER GAMMA: γ +\def\greekdelta {\char"003B4 } % GREEK SMALL LETTER DELTA: δ +\def\greekepsilon {\char"003B5 } % GREEK SMALL LETTER EPSILON: ε +\def\greekzeta {\char"003B6 } % GREEK SMALL LETTER ZETA: ζ +\def\greeketa {\char"003B7 } % GREEK SMALL LETTER ETA: η +\def\greektheta {\char"003B8 } % GREEK SMALL LETTER THETA: θ +\def\greekiota {\char"003B9 } % GREEK SMALL LETTER IOTA: ι +\def\greekkappa {\char"003BA } % GREEK SMALL LETTER KAPPA: κ +\def\greeklambda {\char"003BB } % GREEK SMALL LETTER LAMDA: λ +\def\greekmu {\char"003BC } % GREEK SMALL LETTER MU: μ +\def\greeknu {\char"003BD } % GREEK SMALL LETTER NU: ν +\def\greekxi {\char"003BE } % GREEK SMALL LETTER XI: ξ +\def\greekomicron {\char"003BF } % GREEK SMALL LETTER OMICRON: ο +\def\greekpi {\char"003C0 } % GREEK SMALL LETTER PI: π +\def\greekrho {\char"003C1 } % GREEK SMALL LETTER RHO: ρ +\def\greekfinalsigma {\char"003C2 } % GREEK SMALL LETTER FINAL SIGMA: ς +\def\greeksigma {\char"003C3 } % GREEK SMALL LETTER SIGMA: σ +\def\greektau {\char"003C4 } % GREEK SMALL LETTER TAU: τ +\def\greekupsilon {\char"003C5 } % GREEK SMALL LETTER UPSILON: υ +\def\greekphi {\char"003C6 } % GREEK SMALL LETTER PHI: φ +\def\greekchi {\char"003C7 } % GREEK SMALL LETTER CHI: χ +\def\greekpsi {\char"003C8 } % GREEK SMALL LETTER PSI: ψ +\def\greekomega {\char"003C9 } % GREEK SMALL LETTER OMEGA: ω +\def\greekiotadialytika {\char"003CA } % GREEK SMALL LETTER IOTA WITH DIALYTIKA: ϊ +\def\greekupsilondiaeresis {\char"003CB } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA: ϋ +\def\greekomicrontonos {\char"003CC } % GREEK SMALL LETTER OMICRON WITH TONOS: ό +\def\greekupsilontonos {\char"003CD } % GREEK SMALL LETTER UPSILON WITH TONOS: ύ +\def\greekomegatonos {\char"003CE } % GREEK SMALL LETTER OMEGA WITH TONOS: ώ +\def\greekthetaalt {\char"003D1 } % GREEK THETA SYMBOL: ϑ +\def\greekphialt {\char"003D5 } % GREEK PHI SYMBOL: ϕ +\def\greekpialt {\char"003D6 } % GREEK PI SYMBOL: ϖ +\def\greekkoppa {\char"003D9 } % GREEK SMALL LETTER ARCHAIC KOPPA: ϙ +\def\greekstigma {\char"003DB } % GREEK SMALL LETTER STIGMA: ϛ +\def\greekdigamma {\char"003DD } % GREEK SMALL LETTER DIGAMMA: ϝ +\def\greeknumkoppa {\char"003DF } % GREEK SMALL LETTER KOPPA: ϟ +\def\greeksampi {\char"003E1 } % GREEK SMALL LETTER SAMPI: ϡ +\def\greekrhoalt {\char"003F1 } % GREEK RHO SYMBOL: ϱ +\def\greeksigmalunate {\char"003F2 } % GREEK LUNATE SIGMA SYMBOL: ϲ +\def\greekepsilonalt {\char"003F5 } % GREEK LUNATE EPSILON SYMBOL: ϵ +\def\greekSigmalunate {\char"003F9 } % GREEK CAPITAL LUNATE SIGMA SYMBOL: Ϲ +\def\cyrillicEgrave {\char"00400 } % CYRILLIC CAPITAL LETTER IE WITH GRAVE: Ѐ +\def\cyrillicYO {\char"00401 } % CYRILLIC CAPITAL LETTER IO: Ё +\def\cyrillicDJE {\char"00402 } % CYRILLIC CAPITAL LETTER DJE: Ђ +\def\cyrillicGJE {\char"00403 } % CYRILLIC CAPITAL LETTER GJE: Ѓ +\def\cyrillicIE {\char"00404 } % CYRILLIC CAPITAL LETTER UKRAINIAN IE: Є +\def\cyrillicDZE {\char"00405 } % CYRILLIC CAPITAL LETTER DZE: Ѕ +\def\cyrillicII {\char"00406 } % CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I: І +\def\cyrillicYI {\char"00407 } % CYRILLIC CAPITAL LETTER YI: Ї +\def\cyrillicJE {\char"00408 } % CYRILLIC CAPITAL LETTER JE: Ј +\def\cyrillicLJE {\char"00409 } % CYRILLIC CAPITAL LETTER LJE: Љ +\def\cyrillicNJE {\char"0040A } % CYRILLIC CAPITAL LETTER NJE: Њ +\def\cyrillicTSHE {\char"0040B } % CYRILLIC CAPITAL LETTER TSHE: Ћ +\def\cyrillicKJE {\char"0040C } % CYRILLIC CAPITAL LETTER KJE: Ќ +\def\cyrillicIgrave {\char"0040D } % CYRILLIC CAPITAL LETTER I WITH GRAVE: Ѝ +\def\cyrillicUSHRT {\char"0040E } % CYRILLIC CAPITAL LETTER SHORT U: Ў +\def\cyrillicDZHE {\char"0040F } % CYRILLIC CAPITAL LETTER DZHE: Џ +\def\cyrillicA {\char"00410 } % CYRILLIC CAPITAL LETTER A: А +\def\cyrillicB {\char"00411 } % CYRILLIC CAPITAL LETTER BE: Б +\def\cyrillicV {\char"00412 } % CYRILLIC CAPITAL LETTER VE: В +\def\cyrillicG {\char"00413 } % CYRILLIC CAPITAL LETTER GHE: Г +\def\cyrillicD {\char"00414 } % CYRILLIC CAPITAL LETTER DE: Д +\def\cyrillicE {\char"00415 } % CYRILLIC CAPITAL LETTER IE: Е +\def\cyrillicZH {\char"00416 } % CYRILLIC CAPITAL LETTER ZHE: Ж +\def\cyrillicZ {\char"00417 } % CYRILLIC CAPITAL LETTER ZE: З +\def\cyrillicI {\char"00418 } % CYRILLIC CAPITAL LETTER I: И +\def\cyrillicISHRT {\char"00419 } % CYRILLIC CAPITAL LETTER SHORT I: Й +\def\cyrillicK {\char"0041A } % CYRILLIC CAPITAL LETTER KA: К +\def\cyrillicL {\char"0041B } % CYRILLIC CAPITAL LETTER EL: Л +\def\cyrillicM {\char"0041C } % CYRILLIC CAPITAL LETTER EM: М +\def\cyrillicN {\char"0041D } % CYRILLIC CAPITAL LETTER EN: Н +\def\cyrillicO {\char"0041E } % CYRILLIC CAPITAL LETTER O: О +\def\cyrillicP {\char"0041F } % CYRILLIC CAPITAL LETTER PE: П +\def\cyrillicR {\char"00420 } % CYRILLIC CAPITAL LETTER ER: Р +\def\cyrillicS {\char"00421 } % CYRILLIC CAPITAL LETTER ES: С +\def\cyrillicT {\char"00422 } % CYRILLIC CAPITAL LETTER TE: Т +\def\cyrillicU {\char"00423 } % CYRILLIC CAPITAL LETTER U: У +\def\cyrillicF {\char"00424 } % CYRILLIC CAPITAL LETTER EF: Ф +\def\cyrillicH {\char"00425 } % CYRILLIC CAPITAL LETTER HA: Х +\def\cyrillicC {\char"00426 } % CYRILLIC CAPITAL LETTER TSE: Ц +\def\cyrillicCH {\char"00427 } % CYRILLIC CAPITAL LETTER CHE: Ч +\def\cyrillicSH {\char"00428 } % CYRILLIC CAPITAL LETTER SHA: Ш +\def\cyrillicSHCH {\char"00429 } % CYRILLIC CAPITAL LETTER SHCHA: Щ +\def\cyrillicHRDSN {\char"0042A } % CYRILLIC CAPITAL LETTER HARD SIGN: Ъ +\def\cyrillicERY {\char"0042B } % CYRILLIC CAPITAL LETTER YERU: Ы +\def\cyrillicSFTSN {\char"0042C } % CYRILLIC CAPITAL LETTER SOFT SIGN: Ь +\def\cyrillicEREV {\char"0042D } % CYRILLIC CAPITAL LETTER E: Э +\def\cyrillicYU {\char"0042E } % CYRILLIC CAPITAL LETTER YU: Ю +\def\cyrillicYA {\char"0042F } % CYRILLIC CAPITAL LETTER YA: Я +\def\cyrillica {\char"00430 } % CYRILLIC SMALL LETTER A: а +\def\cyrillicb {\char"00431 } % CYRILLIC SMALL LETTER BE: б +\def\cyrillicv {\char"00432 } % CYRILLIC SMALL LETTER VE: в +\def\cyrillicg {\char"00433 } % CYRILLIC SMALL LETTER GHE: г +\def\cyrillicd {\char"00434 } % CYRILLIC SMALL LETTER DE: д +\def\cyrillice {\char"00435 } % CYRILLIC SMALL LETTER IE: е +\def\cyrilliczh {\char"00436 } % CYRILLIC SMALL LETTER ZHE: ж +\def\cyrillicz {\char"00437 } % CYRILLIC SMALL LETTER ZE: з +\def\cyrillici {\char"00438 } % CYRILLIC SMALL LETTER I: и +\def\cyrillicishrt {\char"00439 } % CYRILLIC SMALL LETTER SHORT I: й +\def\cyrillick {\char"0043A } % CYRILLIC SMALL LETTER KA: к +\def\cyrillicl {\char"0043B } % CYRILLIC SMALL LETTER EL: л +\def\cyrillicm {\char"0043C } % CYRILLIC SMALL LETTER EM: м +\def\cyrillicn {\char"0043D } % CYRILLIC SMALL LETTER EN: н +\def\cyrillico {\char"0043E } % CYRILLIC SMALL LETTER O: о +\def\cyrillicp {\char"0043F } % CYRILLIC SMALL LETTER PE: п +\def\cyrillicr {\char"00440 } % CYRILLIC SMALL LETTER ER: р +\def\cyrillics {\char"00441 } % CYRILLIC SMALL LETTER ES: с +\def\cyrillict {\char"00442 } % CYRILLIC SMALL LETTER TE: т +\def\cyrillicu {\char"00443 } % CYRILLIC SMALL LETTER U: у +\def\cyrillicf {\char"00444 } % CYRILLIC SMALL LETTER EF: ф +\def\cyrillich {\char"00445 } % CYRILLIC SMALL LETTER HA: х +\def\cyrillicc {\char"00446 } % CYRILLIC SMALL LETTER TSE: ц +\def\cyrillicch {\char"00447 } % CYRILLIC SMALL LETTER CHE: ч +\def\cyrillicsh {\char"00448 } % CYRILLIC SMALL LETTER SHA: ш +\def\cyrillicshch {\char"00449 } % CYRILLIC SMALL LETTER SHCHA: щ +\def\cyrillichrdsn {\char"0044A } % CYRILLIC SMALL LETTER HARD SIGN: ъ +\def\cyrillicery {\char"0044B } % CYRILLIC SMALL LETTER YERU: ы +\def\cyrillicsftsn {\char"0044C } % CYRILLIC SMALL LETTER SOFT SIGN: ь +\def\cyrillicerev {\char"0044D } % CYRILLIC SMALL LETTER E: э +\def\cyrillicyu {\char"0044E } % CYRILLIC SMALL LETTER YU: ю +\def\cyrillicya {\char"0044F } % CYRILLIC SMALL LETTER YA: я +\def\cyrillicegrave {\char"00450 } % CYRILLIC SMALL LETTER IE WITH GRAVE: ѐ +\def\cyrillicyo {\char"00451 } % CYRILLIC SMALL LETTER IO: ё +\def\cyrillicdje {\char"00452 } % CYRILLIC SMALL LETTER DJE: ђ +\def\cyrillicgje {\char"00453 } % CYRILLIC SMALL LETTER GJE: ѓ +\def\cyrillicie {\char"00454 } % CYRILLIC SMALL LETTER UKRAINIAN IE: є +\def\cyrillicdze {\char"00455 } % CYRILLIC SMALL LETTER DZE: ѕ +\def\cyrillicii {\char"00456 } % CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I: і +\def\cyrillicyi {\char"00457 } % CYRILLIC SMALL LETTER YI: ї +\def\cyrillicje {\char"00458 } % CYRILLIC SMALL LETTER JE: ј +\def\cyrilliclje {\char"00459 } % CYRILLIC SMALL LETTER LJE: љ +\def\cyrillicnje {\char"0045A } % CYRILLIC SMALL LETTER NJE: њ +\def\cyrillictshe {\char"0045B } % CYRILLIC SMALL LETTER TSHE: ћ +\def\cyrillickje {\char"0045C } % CYRILLIC SMALL LETTER KJE: ќ +\def\cyrillicigrave {\char"0045D } % CYRILLIC SMALL LETTER I WITH GRAVE: ѝ +\def\cyrillicushrt {\char"0045E } % CYRILLIC SMALL LETTER SHORT U: ў +\def\cyrillicdzhe {\char"0045F } % CYRILLIC SMALL LETTER DZHE: џ +\def\cyrillicOMEGA {\char"00460 } % CYRILLIC CAPITAL LETTER OMEGA: Ѡ +\def\cyrillicomega {\char"00461 } % CYRILLIC SMALL LETTER OMEGA: ѡ +\def\cyrillicYAT {\char"00462 } % CYRILLIC CAPITAL LETTER YAT: Ѣ +\def\cyrillicyat {\char"00463 } % CYRILLIC SMALL LETTER YAT: ѣ +\def\cyrillicEiotified {\char"00464 } % CYRILLIC CAPITAL LETTER IOTIFIED E: Ѥ +\def\cyrilliceiotified {\char"00465 } % CYRILLIC SMALL LETTER IOTIFIED E: ѥ +\def\cyrillicLITTLEYUS {\char"00466 } % CYRILLIC CAPITAL LETTER LITTLE YUS: Ѧ +\def\cyrilliclittleyus {\char"00467 } % CYRILLIC SMALL LETTER LITTLE YUS: ѧ +\def\cyrillicLITTLEYUSiotified {\char"00468 } % CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS: Ѩ +\def\cyrilliclittleyusiotified {\char"00469 } % CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS: ѩ +\def\cyrillicBIGYUS {\char"0046A } % CYRILLIC CAPITAL LETTER BIG YUS: Ѫ +\def\cyrillicbigyus {\char"0046B } % CYRILLIC SMALL LETTER BIG YUS: ѫ +\def\cyrillicBIGYUSiotified {\char"0046C } % CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS: Ѭ +\def\cyrillicbigyusiotified {\char"0046D } % CYRILLIC SMALL LETTER IOTIFIED BIG YUS: ѭ +\def\cyrillicKSI {\char"0046E } % CYRILLIC CAPITAL LETTER KSI: Ѯ +\def\cyrillicksi {\char"0046F } % CYRILLIC SMALL LETTER KSI: ѯ +\def\cyrillicPSI {\char"00470 } % CYRILLIC CAPITAL LETTER PSI: Ѱ +\def\cyrillicpsi {\char"00471 } % CYRILLIC SMALL LETTER PSI: ѱ +\def\cyrillicFITA {\char"00472 } % CYRILLIC CAPITAL LETTER FITA: Ѳ +\def\cyrillicfita {\char"00473 } % CYRILLIC SMALL LETTER FITA: ѳ +\def\cyrillicIZHITSA {\char"00474 } % CYRILLIC CAPITAL LETTER IZHITSA: Ѵ +\def\cyrillicizhitsa {\char"00475 } % CYRILLIC SMALL LETTER IZHITSA: ѵ +\def\cyrillicIZHITSAdoublegrave {\char"00476 } % CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT: Ѷ +\def\cyrillicizhitsadoublegrave {\char"00477 } % CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT: ѷ +\def\cyrillicUK {\char"00478 } % CYRILLIC CAPITAL LETTER UK: Ѹ +\def\cyrillicuk {\char"00479 } % CYRILLIC SMALL LETTER UK: ѹ +\def\cyrillicOMEGAround {\char"0047A } % CYRILLIC CAPITAL LETTER ROUND OMEGA: Ѻ +\def\cyrillicomegaround {\char"0047B } % CYRILLIC SMALL LETTER ROUND OMEGA: ѻ +\def\cyrillicOMEGAtitlo {\char"0047C } % CYRILLIC CAPITAL LETTER OMEGA WITH TITLO: Ѽ +\def\cyrillicomegatitlo {\char"0047D } % CYRILLIC SMALL LETTER OMEGA WITH TITLO: ѽ +\def\cyrillicOT {\char"0047E } % CYRILLIC CAPITAL LETTER OT: Ѿ +\def\cyrillicot {\char"0047F } % CYRILLIC SMALL LETTER OT: ѿ +\def\cyrillicKOPPA {\char"00480 } % CYRILLIC CAPITAL LETTER KOPPA: Ҁ +\def\cyrillickoppa {\char"00481 } % CYRILLIC SMALL LETTER KOPPA: ҁ +\def\cyrillicTITLO {\char"00483 } % COMBINING CYRILLIC TITLO: ҃ +\def\cyrillicPALATALIZATION {\char"00484 } % COMBINING CYRILLIC PALATALIZATION: ҄ +\def\cyrillicDASIAPNEUMATA {\char"00485 } % COMBINING CYRILLIC DASIA PNEUMATA: ҅ +\def\cyrillicPSILIPNEUMATA {\char"00486 } % COMBINING CYRILLIC PSILI PNEUMATA: ҆ +\def\cyrillicISHRTtail {\char"0048A } % CYRILLIC CAPITAL LETTER SHORT I WITH TAIL: Ҋ +\def\cyrillicishrttail {\char"0048B } % CYRILLIC SMALL LETTER SHORT I WITH TAIL: ҋ +\def\cyrillicSEMISOFT {\char"0048C } % CYRILLIC CAPITAL LETTER SEMISOFT SIGN: Ҍ +\def\cyrillicsemisoft {\char"0048D } % CYRILLIC SMALL LETTER SEMISOFT SIGN: ҍ +\def\cyrillicERtick {\char"0048E } % CYRILLIC CAPITAL LETTER ER WITH TICK: Ҏ +\def\cyrillicertick {\char"0048F } % CYRILLIC SMALL LETTER ER WITH TICK: ҏ +\def\cyrillicGHEupturn {\char"00490 } % CYRILLIC CAPITAL LETTER GHE WITH UPTURN: Ґ +\def\cyrillicgheupturn {\char"00491 } % CYRILLIC SMALL LETTER GHE WITH UPTURN: ґ +\def\cyrillicGHEstroke {\char"00492 } % CYRILLIC CAPITAL LETTER GHE WITH STROKE: Ғ +\def\cyrillicghestroke {\char"00493 } % CYRILLIC SMALL LETTER GHE WITH STROKE: ғ +\def\cyrillicGHEmidhook {\char"00494 } % CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK: Ҕ +\def\cyrillicghemidhook {\char"00495 } % CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK: ҕ +\def\cyrillicZHEdescender {\char"00496 } % CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER: Җ +\def\cyrilliczhedescender {\char"00497 } % CYRILLIC SMALL LETTER ZHE WITH DESCENDER: җ +\def\cyrillicZDSC {\char"00498 } % CYRILLIC CAPITAL LETTER ZE WITH DESCENDER: Ҙ +\def\cyrilliczdsc {\char"00499 } % CYRILLIC SMALL LETTER ZE WITH DESCENDER: ҙ +\def\cyrillicKADC {\char"0049A } % CYRILLIC CAPITAL LETTER KA WITH DESCENDER: Қ +\def\cyrillickadc {\char"0049B } % CYRILLIC SMALL LETTER KA WITH DESCENDER: қ +\def\cyrillicKAvertstroke {\char"0049C } % CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE: Ҝ +\def\cyrillickavertstroke {\char"0049D } % CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE: ҝ +\def\cyrillicKAstroke {\char"0049E } % CYRILLIC CAPITAL LETTER KA WITH STROKE: Ҟ +\def\cyrillickastroke {\char"0049F } % CYRILLIC SMALL LETTER KA WITH STROKE: ҟ +\def\cyrillicKAbashkir {\char"004A0 } % CYRILLIC CAPITAL LETTER BASHKIR KA: Ҡ +\def\cyrillickabashkir {\char"004A1 } % CYRILLIC SMALL LETTER BASHKIR KA: ҡ +\def\cyrillicENDC {\char"004A2 } % CYRILLIC CAPITAL LETTER EN WITH DESCENDER: Ң +\def\cyrillicendc {\char"004A3 } % CYRILLIC SMALL LETTER EN WITH DESCENDER: ң +\def\cyrillicENGHE {\char"004A4 } % CYRILLIC CAPITAL LIGATURE EN GHE: Ҥ +\def\cyrillicenghe {\char"004A5 } % CYRILLIC SMALL LIGATURE EN GHE: ҥ +\def\cyrillicPEmidhook {\char"004A6 } % CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK: Ҧ +\def\cyrillicpemidhook {\char"004A7 } % CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK: ҧ +\def\cyrillicHA {\char"004A8 } % CYRILLIC CAPITAL LETTER ABKHASIAN HA: Ҩ +\def\cyrillicha {\char"004A9 } % CYRILLIC SMALL LETTER ABKHASIAN HA: ҩ +\def\cyrillicSDSC {\char"004AA } % CYRILLIC CAPITAL LETTER ES WITH DESCENDER: Ҫ +\def\cyrillicsdsc {\char"004AB } % CYRILLIC SMALL LETTER ES WITH DESCENDER: ҫ +\def\cyrillicTEDC {\char"004AC } % CYRILLIC CAPITAL LETTER TE WITH DESCENDER: Ҭ +\def\cyrillictedc {\char"004AD } % CYRILLIC SMALL LETTER TE WITH DESCENDER: ҭ +\def\cyrillicYstr {\char"004AE } % CYRILLIC CAPITAL LETTER STRAIGHT U: Ү +\def\cyrillicystr {\char"004AF } % CYRILLIC SMALL LETTER STRAIGHT U: ү +\def\cyrillicYstrstroke {\char"004B0 } % CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE: Ұ +\def\cyrillicystrstroke {\char"004B1 } % CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE: ұ +\def\cyrillicHADC {\char"004B2 } % CYRILLIC CAPITAL LETTER HA WITH DESCENDER: Ҳ +\def\cyrillichadc {\char"004B3 } % CYRILLIC SMALL LETTER HA WITH DESCENDER: ҳ +\def\cyrillicTETSE {\char"004B4 } % CYRILLIC CAPITAL LIGATURE TE TSE: Ҵ +\def\cyrillictetse {\char"004B5 } % CYRILLIC SMALL LIGATURE TE TSE: ҵ +\def\cyrillicCHEDC {\char"004B6 } % CYRILLIC CAPITAL LETTER CHE WITH DESCENDER: Ҷ +\def\cyrillicchedc {\char"004B7 } % CYRILLIC SMALL LETTER CHE WITH DESCENDER: ҷ +\def\cyrillicCHEvertstroke {\char"004B8 } % CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE: Ҹ +\def\cyrillicchevertstroke {\char"004B9 } % CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE: ҹ +\def\cyrillicSHHA {\char"004BA } % CYRILLIC CAPITAL LETTER SHHA: Һ +\def\cyrillicshha {\char"004BB } % CYRILLIC SMALL LETTER SHHA: һ +\def\cyrillicCHEabkhasian {\char"004BC } % CYRILLIC CAPITAL LETTER ABKHASIAN CHE: Ҽ +\def\cyrilliccheabkhasian {\char"004BD } % CYRILLIC SMALL LETTER ABKHASIAN CHE: ҽ +\def\cyrillicCHEDCabkhasian {\char"004BE } % CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER: Ҿ +\def\cyrillicchedcabkhasian {\char"004BF } % CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER: ҿ +\def\cyrillicPALOCHKA {\char"004C0 } % CYRILLIC LETTER PALOCHKA: Ӏ +\def\cyrillicZHEbreve {\char"004C1 } % CYRILLIC CAPITAL LETTER ZHE WITH BREVE: Ӂ +\def\cyrilliczhebreve {\char"004C2 } % CYRILLIC SMALL LETTER ZHE WITH BREVE: ӂ +\def\cyrillicKAhook {\char"004C3 } % CYRILLIC CAPITAL LETTER KA WITH HOOK: Ӄ +\def\cyrillickahook {\char"004C4 } % CYRILLIC SMALL LETTER KA WITH HOOK: ӄ +\def\cyrillicELtail {\char"004C5 } % CYRILLIC CAPITAL LETTER EL WITH TAIL: Ӆ +\def\cyrilliceltail {\char"004C6 } % CYRILLIC SMALL LETTER EL WITH TAIL: ӆ +\def\cyrillicENhook {\char"004C7 } % CYRILLIC CAPITAL LETTER EN WITH HOOK: Ӈ +\def\cyrillicenhook {\char"004C8 } % CYRILLIC SMALL LETTER EN WITH HOOK: ӈ +\def\cyrillicENtail {\char"004C9 } % CYRILLIC CAPITAL LETTER EN WITH TAIL: Ӊ +\def\cyrillicentail {\char"004CA } % CYRILLIC SMALL LETTER EN WITH TAIL: ӊ +\def\cyrillicCHEkhakassian {\char"004CB } % CYRILLIC CAPITAL LETTER KHAKASSIAN CHE: Ӌ +\def\cyrillicchekhakassian {\char"004CC } % CYRILLIC SMALL LETTER KHAKASSIAN CHE: ӌ +\def\cyrillicEMtail {\char"004CD } % CYRILLIC CAPITAL LETTER EM WITH TAIL: Ӎ +\def\cyrillicemtail {\char"004CE } % CYRILLIC SMALL LETTER EM WITH TAIL: ӎ +\def\cyrillicAbreve {\char"004D0 } % CYRILLIC CAPITAL LETTER A WITH BREVE: Ӑ +\def\cyrillicabreve {\char"004D1 } % CYRILLIC SMALL LETTER A WITH BREVE: ӑ +\def\cyrillicAdiaeresis {\char"004D2 } % CYRILLIC CAPITAL LETTER A WITH DIAERESIS: Ӓ +\def\cyrillicadiaeresis {\char"004D3 } % CYRILLIC SMALL LETTER A WITH DIAERESIS: ӓ +\def\cyrillicAE {\char"004D4 } % CYRILLIC CAPITAL LIGATURE A IE: Ӕ +\def\cyrillicae {\char"004D5 } % CYRILLIC SMALL LIGATURE A IE: ӕ +\def\cyrillicEbreve {\char"004D6 } % CYRILLIC CAPITAL LETTER IE WITH BREVE: Ӗ +\def\cyrillicebreve {\char"004D7 } % CYRILLIC SMALL LETTER IE WITH BREVE: ӗ +\def\cyrillicSCHWA {\char"004D8 } % CYRILLIC CAPITAL LETTER SCHWA: Ә +\def\cyrillicschwa {\char"004D9 } % CYRILLIC SMALL LETTER SCHWA: ә +\def\cyrillicSCHWAdiaeresis {\char"004DA } % CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS: Ӛ +\def\cyrillicschwadiaeresis {\char"004DB } % CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS: ӛ +\def\cyrillicZHEdiaeresis {\char"004DC } % CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS: Ӝ +\def\cyrilliczhediaeresis {\char"004DD } % CYRILLIC SMALL LETTER ZHE WITH DIAERESIS: ӝ +\def\cyrillicZEdiaeresis {\char"004DE } % CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS: Ӟ +\def\cyrilliczediaeresis {\char"004DF } % CYRILLIC SMALL LETTER ZE WITH DIAERESIS: ӟ +\def\cyrillicDZEabkhasian {\char"004E0 } % CYRILLIC CAPITAL LETTER ABKHASIAN DZE: Ӡ +\def\cyrillicdzeabkhasian {\char"004E1 } % CYRILLIC SMALL LETTER ABKHASIAN DZE: ӡ +\def\cyrillicImacron {\char"004E2 } % CYRILLIC CAPITAL LETTER I WITH MACRON: Ӣ +\def\cyrillicimacron {\char"004E3 } % CYRILLIC SMALL LETTER I WITH MACRON: ӣ +\def\cyrillicIdiaeresis {\char"004E4 } % CYRILLIC CAPITAL LETTER I WITH DIAERESIS: Ӥ +\def\cyrillicidiaeresis {\char"004E5 } % CYRILLIC SMALL LETTER I WITH DIAERESIS: ӥ +\def\cyrillicOdiaeresis {\char"004E6 } % CYRILLIC CAPITAL LETTER O WITH DIAERESIS: Ӧ +\def\cyrillicodiaeresis {\char"004E7 } % CYRILLIC SMALL LETTER O WITH DIAERESIS: ӧ +\def\cyrillicObarred {\char"004E8 } % CYRILLIC CAPITAL LETTER BARRED O: Ө +\def\cyrillicobarred {\char"004E9 } % CYRILLIC SMALL LETTER BARRED O: ө +\def\cyrillicObarreddiaeresis {\char"004EA } % CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS: Ӫ +\def\cyrillicobarreddiaeresis {\char"004EB } % CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS: ӫ +\def\cyrillicEdiaeresis {\char"004EC } % CYRILLIC CAPITAL LETTER E WITH DIAERESIS: Ӭ +\def\cyrillicediaeresis {\char"004ED } % CYRILLIC SMALL LETTER E WITH DIAERESIS: ӭ +\def\cyrillicUmacron {\char"004EE } % CYRILLIC CAPITAL LETTER U WITH MACRON: Ӯ +\def\cyrillicumacron {\char"004EF } % CYRILLIC SMALL LETTER U WITH MACRON: ӯ +\def\cyrillicUdiaeresis {\char"004F0 } % CYRILLIC CAPITAL LETTER U WITH DIAERESIS: Ӱ +\def\cyrillicudiaeresis {\char"004F1 } % CYRILLIC SMALL LETTER U WITH DIAERESIS: ӱ +\def\cyrillicUdoubleacute {\char"004F2 } % CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE: Ӳ +\def\cyrillicudoubleacute {\char"004F3 } % CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE: ӳ +\def\cyrillicCHEdiaeresis {\char"004F4 } % CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS: Ӵ +\def\cyrillicchediaeresis {\char"004F5 } % CYRILLIC SMALL LETTER CHE WITH DIAERESIS: ӵ +\def\cyrillicYERUdiaeresis {\char"004F8 } % CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS: Ӹ +\def\cyrillicyerudiaeresis {\char"004F9 } % CYRILLIC SMALL LETTER YERU WITH DIAERESIS: ӹ +\def\hebrewAlef {\char"005D0 } % HEBREW LETTER ALEF: א +\def\hebrewBet {\char"005D1 } % HEBREW LETTER BET: ב +\def\hebrewGimel {\char"005D2 } % HEBREW LETTER GIMEL: ג +\def\hebrewDalet {\char"005D3 } % HEBREW LETTER DALET: ד +\def\hebrewHe {\char"005D4 } % HEBREW LETTER HE: ה +\def\hebrewVav {\char"005D5 } % HEBREW LETTER VAV: ו +\def\hebrewZayin {\char"005D6 } % HEBREW LETTER ZAYIN: ז +\def\hebrewHet {\char"005D7 } % HEBREW LETTER HET: ח +\def\hebrewTet {\char"005D8 } % HEBREW LETTER TET: ט +\def\hebrewYod {\char"005D9 } % HEBREW LETTER YOD: י +\def\hebrewKaffinal {\char"005DA } % HEBREW LETTER FINAL KAF: ך +\def\hebrewKaf {\char"005DB } % HEBREW LETTER KAF: כ +\def\hebrewLamed {\char"005DC } % HEBREW LETTER LAMED: ל +\def\hebrewMemfinal {\char"005DD } % HEBREW LETTER FINAL MEM: ם +\def\hebrewMem {\char"005DE } % HEBREW LETTER MEM: מ +\def\hebrewNunfinal {\char"005DF } % HEBREW LETTER FINAL NUN: ן +\def\hebrewNun {\char"005E0 } % HEBREW LETTER NUN: נ +\def\hebrewSamekh {\char"005E1 } % HEBREW LETTER SAMEKH: ס +\def\hebrewAyin {\char"005E2 } % HEBREW LETTER AYIN: ע +\def\hebrewPefinal {\char"005E3 } % HEBREW LETTER FINAL PE: ף +\def\hebrewPe {\char"005E4 } % HEBREW LETTER PE: פ +\def\hebrewTsadifinal {\char"005E5 } % HEBREW LETTER FINAL TSADI: ץ +\def\hebrewTsadi {\char"005E6 } % HEBREW LETTER TSADI: צ +\def\hebrewQof {\char"005E7 } % HEBREW LETTER QOF: ק +\def\hebrewResh {\char"005E8 } % HEBREW LETTER RESH: ר +\def\hebrewShin {\char"005E9 } % HEBREW LETTER SHIN: ש +\def\hebrewTav {\char"005EA } % HEBREW LETTER TAV: ת +\def\Adotbelow {\char"01EA0 } % LATIN CAPITAL LETTER A WITH DOT BELOW: Ạ +\def\adotbelow {\char"01EA1 } % LATIN SMALL LETTER A WITH DOT BELOW: ạ +\def\Ahook {\char"01EA2 } % LATIN CAPITAL LETTER A WITH HOOK ABOVE: Ả +\def\ahook {\char"01EA3 } % LATIN SMALL LETTER A WITH HOOK ABOVE: ả +\def\Acircumflexacute {\char"01EA4 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE: Ấ +\def\acircumflexacute {\char"01EA5 } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE: ấ +\def\Acircumflexgrave {\char"01EA6 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE: Ầ +\def\acircumflexgrave {\char"01EA7 } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE: ầ +\def\Acircumflexhook {\char"01EA8 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE: Ẩ +\def\acircumflexhook {\char"01EA9 } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE: ẩ +\def\Acircumflextilde {\char"01EAA } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE: Ẫ +\def\acircumflextilde {\char"01EAB } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE: ẫ +\def\Acircumflexdotbelow {\char"01EAC } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW: Ậ +\def\acircumflexdotbelow {\char"01EAD } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW: ậ +\def\Abreveacute {\char"01EAE } % LATIN CAPITAL LETTER A WITH BREVE AND ACUTE: Ắ +\def\abreveacute {\char"01EAF } % LATIN SMALL LETTER A WITH BREVE AND ACUTE: ắ +\def\Abrevegrave {\char"01EB0 } % LATIN CAPITAL LETTER A WITH BREVE AND GRAVE: Ằ +\def\abrevegrave {\char"01EB1 } % LATIN SMALL LETTER A WITH BREVE AND GRAVE: ằ +\def\Abrevehook {\char"01EB2 } % LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE: Ẳ +\def\abrevehook {\char"01EB3 } % LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE: ẳ +\def\Abrevetilde {\char"01EB4 } % LATIN CAPITAL LETTER A WITH BREVE AND TILDE: Ẵ +\def\abrevetilde {\char"01EB5 } % LATIN SMALL LETTER A WITH BREVE AND TILDE: ẵ +\def\Abrevedotbelow {\char"01EB6 } % LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW: Ặ +\def\abrevedotbelow {\char"01EB7 } % LATIN SMALL LETTER A WITH BREVE AND DOT BELOW: ặ +\def\Edotbelow {\char"01EB8 } % LATIN CAPITAL LETTER E WITH DOT BELOW: Ẹ +\def\edotbelow {\char"01EB9 } % LATIN SMALL LETTER E WITH DOT BELOW: ẹ +\def\Ehook {\char"01EBA } % LATIN CAPITAL LETTER E WITH HOOK ABOVE: Ẻ +\def\ehook {\char"01EBB } % LATIN SMALL LETTER E WITH HOOK ABOVE: ẻ +\def\Etilde {\char"01EBC } % LATIN CAPITAL LETTER E WITH TILDE: Ẽ +\def\etilde {\char"01EBD } % LATIN SMALL LETTER E WITH TILDE: ẽ +\def\Ecircumflexacute {\char"01EBE } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE: Ế +\def\ecircumflexacute {\char"01EBF } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE: ế +\def\Ecircumflexgrave {\char"01EC0 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE: Ề +\def\ecircumflexgrave {\char"01EC1 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE: ề +\def\Ecircumflexhook {\char"01EC2 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE: Ể +\def\ecircumflexhook {\char"01EC3 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE: ể +\def\Ecircumflextilde {\char"01EC4 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE: Ễ +\def\ecircumflextilde {\char"01EC5 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE: ễ +\def\Ecircumflexdotbelow {\char"01EC6 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW: Ệ +\def\ecircumflexdotbelow {\char"01EC7 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW: ệ +\def\Ihook {\char"01EC8 } % LATIN CAPITAL LETTER I WITH HOOK ABOVE: Ỉ +\def\ihook {\char"01EC9 } % LATIN SMALL LETTER I WITH HOOK ABOVE: ỉ +\def\Idotbelow {\char"01ECA } % LATIN CAPITAL LETTER I WITH DOT BELOW: Ị +\def\idotbelow {\char"01ECB } % LATIN SMALL LETTER I WITH DOT BELOW: ị +\def\Odotbelow {\char"01ECC } % LATIN CAPITAL LETTER O WITH DOT BELOW: Ọ +\def\odotbelow {\char"01ECD } % LATIN SMALL LETTER O WITH DOT BELOW: ọ +\def\Ohook {\char"01ECE } % LATIN CAPITAL LETTER O WITH HOOK ABOVE: Ỏ +\def\ohook {\char"01ECF } % LATIN SMALL LETTER O WITH HOOK ABOVE: ỏ +\def\Ocircumflexacute {\char"01ED0 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE: Ố +\def\ocircumflexacute {\char"01ED1 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE: ố +\def\Ocircumflexgrave {\char"01ED2 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE: Ồ +\def\ocircumflexgrave {\char"01ED3 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE: ồ +\def\Ocircumflexhook {\char"01ED4 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE: Ổ +\def\ocircumflexhook {\char"01ED5 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE: ổ +\def\Ocircumflextilde {\char"01ED6 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE: Ỗ +\def\ocircumflextilde {\char"01ED7 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE: ỗ +\def\Ocircumflexdotbelow {\char"01ED8 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW: Ộ +\def\ocircumflexdotbelow {\char"01ED9 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW: ộ +\def\Ohornacute {\char"01EDA } % LATIN CAPITAL LETTER O WITH HORN AND ACUTE: Ớ +\def\ohornacute {\char"01EDB } % LATIN SMALL LETTER O WITH HORN AND ACUTE: ớ +\def\Ohorngrave {\char"01EDC } % LATIN CAPITAL LETTER O WITH HORN AND GRAVE: Ờ +\def\ohorngrave {\char"01EDD } % LATIN SMALL LETTER O WITH HORN AND GRAVE: ờ +\def\Ohornhook {\char"01EDE } % LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE: Ở +\def\ohornhook {\char"01EDF } % LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE: ở +\def\Ohorntilde {\char"01EE0 } % LATIN CAPITAL LETTER O WITH HORN AND TILDE: Ỡ +\def\ohorntilde {\char"01EE1 } % LATIN SMALL LETTER O WITH HORN AND TILDE: ỡ +\def\Ohorndotbelow {\char"01EE2 } % LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW: Ợ +\def\ohorndotbelow {\char"01EE3 } % LATIN SMALL LETTER O WITH HORN AND DOT BELOW: ợ +\def\Udotbelow {\char"01EE4 } % LATIN CAPITAL LETTER U WITH DOT BELOW: Ụ +\def\udotbelow {\char"01EE5 } % LATIN SMALL LETTER U WITH DOT BELOW: ụ +\def\Uhook {\char"01EE6 } % LATIN CAPITAL LETTER U WITH HOOK ABOVE: Ủ +\def\uhook {\char"01EE7 } % LATIN SMALL LETTER U WITH HOOK ABOVE: ủ +\def\Uhornacute {\char"01EE8 } % LATIN CAPITAL LETTER U WITH HORN AND ACUTE: Ứ +\def\uhornacute {\char"01EE9 } % LATIN SMALL LETTER U WITH HORN AND ACUTE: ứ +\def\Uhorngrave {\char"01EEA } % LATIN CAPITAL LETTER U WITH HORN AND GRAVE: Ừ +\def\uhorngrave {\char"01EEB } % LATIN SMALL LETTER U WITH HORN AND GRAVE: ừ +\def\Uhornhook {\char"01EEC } % LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE: Ử +\def\uhornhook {\char"01EED } % LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE: ử +\def\Uhorntilde {\char"01EEE } % LATIN CAPITAL LETTER U WITH HORN AND TILDE: Ữ +\def\uhorntilde {\char"01EEF } % LATIN SMALL LETTER U WITH HORN AND TILDE: ữ +\def\Uhorndotbelow {\char"01EF0 } % LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW: Ự +\def\uhorndotbelow {\char"01EF1 } % LATIN SMALL LETTER U WITH HORN AND DOT BELOW: ự +\def\Ygrave {\char"01EF2 } % LATIN CAPITAL LETTER Y WITH GRAVE: Ỳ +\def\ygrave {\char"01EF3 } % LATIN SMALL LETTER Y WITH GRAVE: ỳ +\def\Ydotbelow {\char"01EF4 } % LATIN CAPITAL LETTER Y WITH DOT BELOW: Ỵ +\def\ydotbelow {\char"01EF5 } % LATIN SMALL LETTER Y WITH DOT BELOW: ỵ +\def\Yhook {\char"01EF6 } % LATIN CAPITAL LETTER Y WITH HOOK ABOVE: Ỷ +\def\yhook {\char"01EF7 } % LATIN SMALL LETTER Y WITH HOOK ABOVE: ỷ +\def\Ytilde {\char"01EF8 } % LATIN CAPITAL LETTER Y WITH TILDE: Ỹ +\def\ytilde {\char"01EF9 } % LATIN SMALL LETTER Y WITH TILDE: ỹ +\def\greekalphapsili {\char"01F00 } % GREEK SMALL LETTER ALPHA WITH PSILI: ἀ +\def\greekalphadasia {\char"01F01 } % GREEK SMALL LETTER ALPHA WITH DASIA: ἁ +\def\greekalphapsilivaria {\char"01F02 } % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA: ἂ +\def\greekalphadasiavaria {\char"01F03 } % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA: ἃ +\def\greekalphapsilitonos {\char"01F04 } % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA: ἄ +\def\greekalphadasiatonos {\char"01F05 } % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA: ἅ +\def\greekalphapsiliperispomeni {\char"01F06 } % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI: ἆ +\def\greekalphadasiaperispomeni {\char"01F07 } % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI: ἇ +\def\greekAlphapsili {\char"01F08 } % GREEK CAPITAL LETTER ALPHA WITH PSILI: Ἀ +\def\greekAlphadasia {\char"01F09 } % GREEK CAPITAL LETTER ALPHA WITH DASIA: Ἁ +\def\greekAlphapsilivaria {\char"01F0A } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA: Ἂ +\def\greekAlphadasiavaria {\char"01F0B } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA: Ἃ +\def\greekAlphapsilitonos {\char"01F0C } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA: Ἄ +\def\greekAlphadasiatonos {\char"01F0D } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA: Ἅ +\def\greekAlphapsiliperispomeni {\char"01F0E } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI: Ἆ +\def\greekAlphadasiaperispomeni {\char"01F0F } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI: Ἇ +\def\greekepsilonpsili {\char"01F10 } % GREEK SMALL LETTER EPSILON WITH PSILI: ἐ +\def\greekepsilondasia {\char"01F11 } % GREEK SMALL LETTER EPSILON WITH DASIA: ἑ +\def\greekepsilonpsilivaria {\char"01F12 } % GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA: ἒ +\def\greekepsilondasiavaria {\char"01F13 } % GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA: ἓ +\def\greekepsilonpsilitonos {\char"01F14 } % GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA: ἔ +\def\greekepsilondasiatonos {\char"01F15 } % GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA: ἕ +\def\greekEpsilonpsili {\char"01F18 } % GREEK CAPITAL LETTER EPSILON WITH PSILI: Ἐ +\def\greekEpsilondasia {\char"01F19 } % GREEK CAPITAL LETTER EPSILON WITH DASIA: Ἑ +\def\greekEpsilonpsilivaria {\char"01F1A } % GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA: Ἒ +\def\greekEpsilondasiavaria {\char"01F1B } % GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA: Ἓ +\def\greekEpsilonpsilitonos {\char"01F1C } % GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA: Ἔ +\def\greekEpsilondasiatonos {\char"01F1D } % GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA: Ἕ +\def\greeketapsili {\char"01F20 } % GREEK SMALL LETTER ETA WITH PSILI: ἠ +\def\greeketadasia {\char"01F21 } % GREEK SMALL LETTER ETA WITH DASIA: ἡ +\def\greeketapsilivaria {\char"01F22 } % GREEK SMALL LETTER ETA WITH PSILI AND VARIA: ἢ +\def\greeketadasiavaria {\char"01F23 } % GREEK SMALL LETTER ETA WITH DASIA AND VARIA: ἣ +\def\greeketapsilitonos {\char"01F24 } % GREEK SMALL LETTER ETA WITH PSILI AND OXIA: ἤ +\def\greeketadasiatonos {\char"01F25 } % GREEK SMALL LETTER ETA WITH DASIA AND OXIA: ἥ +\def\greeketapsiliperispomeni {\char"01F26 } % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI: ἦ +\def\greeketadasiaperispomeni {\char"01F27 } % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI: ἧ +\def\greekEtapsili {\char"01F28 } % GREEK CAPITAL LETTER ETA WITH PSILI: Ἠ +\def\greekEtadasia {\char"01F29 } % GREEK CAPITAL LETTER ETA WITH DASIA: Ἡ +\def\greekEtapsilivaria {\char"01F2A } % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA: Ἢ +\def\greekEtadasiavaria {\char"01F2B } % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA: Ἣ +\def\greekEtapsilitonos {\char"01F2C } % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA: Ἤ +\def\greekEtadasiatonos {\char"01F2D } % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA: Ἥ +\def\greekEtapsiliperispomeni {\char"01F2E } % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI: Ἦ +\def\greekEtadasiaperispomeni {\char"01F2F } % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI: Ἧ +\def\greekiotapsili {\char"01F30 } % GREEK SMALL LETTER IOTA WITH PSILI: ἰ +\def\greekiotadasia {\char"01F31 } % GREEK SMALL LETTER IOTA WITH DASIA: ἱ +\def\greekiotapsilivaria {\char"01F32 } % GREEK SMALL LETTER IOTA WITH PSILI AND VARIA: ἲ +\def\greekiotadasiavaria {\char"01F33 } % GREEK SMALL LETTER IOTA WITH DASIA AND VARIA: ἳ +\def\greekiotapsilitonos {\char"01F34 } % GREEK SMALL LETTER IOTA WITH PSILI AND OXIA: ἴ +\def\greekiotadasiatonos {\char"01F35 } % GREEK SMALL LETTER IOTA WITH DASIA AND OXIA: ἵ +\def\greekiotapsiliperispomeni {\char"01F36 } % GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI: ἶ +\def\greekiotadasiaperispomeni {\char"01F37 } % GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI: ἷ +\def\greekIotapsili {\char"01F38 } % GREEK CAPITAL LETTER IOTA WITH PSILI: Ἰ +\def\greekIotadasia {\char"01F39 } % GREEK CAPITAL LETTER IOTA WITH DASIA: Ἱ +\def\greekIotapsilivaria {\char"01F3A } % GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA: Ἲ +\def\greekIotadasiavaria {\char"01F3B } % GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA: Ἳ +\def\greekIotapsilitonos {\char"01F3C } % GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA: Ἴ +\def\greekIotadasiatonos {\char"01F3D } % GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA: Ἵ +\def\greekIotapsiliperispomeni {\char"01F3E } % GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI: Ἶ +\def\greekIotadasiaperispomeni {\char"01F3F } % GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI: Ἷ +\def\greekomicronpsili {\char"01F40 } % GREEK SMALL LETTER OMICRON WITH PSILI: ὀ +\def\greekomicrondasia {\char"01F41 } % GREEK SMALL LETTER OMICRON WITH DASIA: ὁ +\def\greekomicronpsilivaria {\char"01F42 } % GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA: ὂ +\def\greekomicrondasiavaria {\char"01F43 } % GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA: ὃ +\def\greekomicronpsilitonos {\char"01F44 } % GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA: ὄ +\def\greekomicrondasiatonos {\char"01F45 } % GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA: ὅ +\def\greekOmicronpsili {\char"01F48 } % GREEK CAPITAL LETTER OMICRON WITH PSILI: Ὀ +\def\greekOmicrondasia {\char"01F49 } % GREEK CAPITAL LETTER OMICRON WITH DASIA: Ὁ +\def\greekOmicronpsilivaria {\char"01F4A } % GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA: Ὂ +\def\greekOmicrondasiavaria {\char"01F4B } % GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA: Ὃ +\def\greekOmicronpsilitonos {\char"01F4C } % GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA: Ὄ +\def\greekOmicrondasiatonos {\char"01F4D } % GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA: Ὅ +\def\greekupsilonpsili {\char"01F50 } % GREEK SMALL LETTER UPSILON WITH PSILI: ὐ +\def\greekupsilondasia {\char"01F51 } % GREEK SMALL LETTER UPSILON WITH DASIA: ὑ +\def\greekupsilonpsilivaria {\char"01F52 } % GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA: ὒ +\def\greekupsilondasiavaria {\char"01F53 } % GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA: ὓ +\def\greekupsilonpsilitonos {\char"01F54 } % GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA: ὔ +\def\greekupsilondasiatonos {\char"01F55 } % GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA: ὕ +\def\greekupsilonpsiliperispomeni {\char"01F56 } % GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI: ὖ +\def\greekupsilondasiaperispomeni {\char"01F57 } % GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI: ὗ +\def\greekUpsilondasia {\char"01F59 } % GREEK CAPITAL LETTER UPSILON WITH DASIA: Ὑ +\def\greekUpsilondasiavaria {\char"01F5B } % GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA: Ὓ +\def\greekUpsilondasiatonos {\char"01F5D } % GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA: Ὕ +\def\greekUpsilondasiaperispomeni {\char"01F5F } % GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI: Ὗ +\def\greekomegapsili {\char"01F60 } % GREEK SMALL LETTER OMEGA WITH PSILI: ὠ +\def\greekomegadasia {\char"01F61 } % GREEK SMALL LETTER OMEGA WITH DASIA: ὡ +\def\greekomegapsilivaria {\char"01F62 } % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA: ὢ +\def\greekomegadasiavaria {\char"01F63 } % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA: ὣ +\def\greekomegapsilitonos {\char"01F64 } % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA: ὤ +\def\greekomegadasiatonos {\char"01F65 } % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA: ὥ +\def\greekomegapsiliperispomeni {\char"01F66 } % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI: ὦ +\def\greekomegadasiaperispomeni {\char"01F67 } % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI: ὧ +\def\greekOmegapsili {\char"01F68 } % GREEK CAPITAL LETTER OMEGA WITH PSILI: Ὠ +\def\greekOmegadasia {\char"01F69 } % GREEK CAPITAL LETTER OMEGA WITH DASIA: Ὡ +\def\greekOmegapsilivaria {\char"01F6A } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA: Ὢ +\def\greekOmegadasiavaria {\char"01F6B } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA: Ὣ +\def\greekOmegapsilitonos {\char"01F6C } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA: Ὤ +\def\greekOmegadasiatonos {\char"01F6D } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA: Ὥ +\def\greekOmegapsiliperispomeni {\char"01F6E } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI: Ὦ +\def\greekOmegadasiaperispomeni {\char"01F6F } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI: Ὧ +\def\greekalphavaria {\char"01F70 } % GREEK SMALL LETTER ALPHA WITH VARIA: ὰ +\def\greekalphaoxia {\char"01F71 } % GREEK SMALL LETTER ALPHA WITH OXIA: ά +\def\greekepsilonvaria {\char"01F72 } % GREEK SMALL LETTER EPSILON WITH VARIA: ὲ +\def\greekepsilonoxia {\char"01F73 } % GREEK SMALL LETTER EPSILON WITH OXIA: έ +\def\greeketavaria {\char"01F74 } % GREEK SMALL LETTER ETA WITH VARIA: ὴ +\def\greeketaoxia {\char"01F75 } % GREEK SMALL LETTER ETA WITH OXIA: ή +\def\greekiotavaria {\char"01F76 } % GREEK SMALL LETTER IOTA WITH VARIA: ὶ +\def\greekiotaoxia {\char"01F77 } % GREEK SMALL LETTER IOTA WITH OXIA: ί +\def\greekomicronvaria {\char"01F78 } % GREEK SMALL LETTER OMICRON WITH VARIA: ὸ +\def\greekomicronoxia {\char"01F79 } % GREEK SMALL LETTER OMICRON WITH OXIA: ό +\def\greekupsilonvaria {\char"01F7A } % GREEK SMALL LETTER UPSILON WITH VARIA: ὺ +\def\greekupsilonoxia {\char"01F7B } % GREEK SMALL LETTER UPSILON WITH OXIA: ύ +\def\greekomegavaria {\char"01F7C } % GREEK SMALL LETTER OMEGA WITH VARIA: ὼ +\def\greekomegaoxia {\char"01F7D } % GREEK SMALL LETTER OMEGA WITH OXIA: ώ +\def\greekalphaiotasubpsili {\char"01F80 } % GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI: ᾀ +\def\greekalphaiotasubdasia {\char"01F81 } % GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI: ᾁ +\def\greekalphaiotasubpsilivaria {\char"01F82 } % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI: ᾂ +\def\greekalphaiotasubdasiavaria {\char"01F83 } % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI: ᾃ +\def\greekalphaiotasubpsilitonos {\char"01F84 } % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI: ᾄ +\def\greekalphaiotasubdasiatonos {\char"01F85 } % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI: ᾅ +\def\greekalphaiotasubpsiliperispomeni{\char"01F86 } % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI: ᾆ +\def\greekalphaiotasubdasiaperispomeni{\char"01F87 } % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI: ᾇ +\def\greekAlphaiotasubpsili {\char"01F88 } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI: ᾈ +\def\greekAlphaiotasubdasia {\char"01F89 } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI: ᾉ +\def\greekAlphaiotasubpsilivaria {\char"01F8A } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI: ᾊ +\def\greekAlphaiotasubdasiavaria {\char"01F8B } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI: ᾋ +\def\greekAlphaiotasubpsilitonos {\char"01F8C } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI: ᾌ +\def\greekAlphaiotasubdasiatonos {\char"01F8D } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI: ᾍ +\def\greekAlphaiotasubpsiliperispomeni{\char"01F8E } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI: ᾎ +\def\greekAlphaiotasubdasiaperispomeni{\char"01F8F } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI: ᾏ +\def\greeketaiotasubpsili {\char"01F90 } % GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI: ᾐ +\def\greeketaiotasubdasia {\char"01F91 } % GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI: ᾑ +\def\greeketaiotasubpsilivaria {\char"01F92 } % GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI: ᾒ +\def\greeketaiotasubdasiavaria {\char"01F93 } % GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI: ᾓ +\def\greeketaiotasubpsilitonos {\char"01F94 } % GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI: ᾔ +\def\greeketaiotasubdasiatonos {\char"01F95 } % GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI: ᾕ +\def\greeketaiotasubpsiliperispomeni {\char"01F96 } % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI: ᾖ +\def\greeketaiotasubdasiaperispomeni {\char"01F97 } % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI: ᾗ +\def\greekEtaiotasubpsili {\char"01F98 } % GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI: ᾘ +\def\greekEtaiotasubdasia {\char"01F99 } % GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI: ᾙ +\def\greekEtaiotasubpsilivaria {\char"01F9A } % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI: ᾚ +\def\greekEtaiotasubdasiavaria {\char"01F9B } % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI: ᾛ +\def\greekEtaiotasubpsilitonos {\char"01F9C } % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI: ᾜ +\def\greekEtaiotasubdasiatonos {\char"01F9D } % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI: ᾝ +\def\greekEtaiotasubpsiliperispomeni {\char"01F9E } % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI: ᾞ +\def\greekEtaiotasubdasiaperispomeni {\char"01F9F } % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI: ᾟ +\def\greekomegaiotasubpsili {\char"01FA0 } % GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI: ᾠ +\def\greekomegaiotasubdasia {\char"01FA1 } % GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI: ᾡ +\def\greekomegaiotasubpsilivaria {\char"01FA2 } % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI: ᾢ +\def\greekomegaiotasubdasiavaria {\char"01FA3 } % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI: ᾣ +\def\greekomegaiotasubpsilitonos {\char"01FA4 } % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI: ᾤ +\def\greekomegaiotasubdasiatonos {\char"01FA5 } % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI: ᾥ +\def\greekomegaiotasubpsiliperispomeni{\char"01FA6 } % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI: ᾦ +\def\greekomegaiotasubdasiaperispomeni{\char"01FA7 } % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI: ᾧ +\def\greekOmegaiotasubpsili {\char"01FA8 } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI: ᾨ +\def\greekOmegaiotasubdasia {\char"01FA9 } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI: ᾩ +\def\greekOmegaiotasubpsilivaria {\char"01FAA } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI: ᾪ +\def\greekOmegaiotasubdasiavaria {\char"01FAB } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI: ᾫ +\def\greekOmegaiotasubpsilitonos {\char"01FAC } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI: ᾬ +\def\greekOmegaiotasubdasiatonos {\char"01FAD } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI: ᾭ +\def\greekOmegaiotasubpsiliperispomeni{\char"01FAE } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI: ᾮ +\def\greekOmegaiotasubdasiaperispomeni{\char"01FAF } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI: ᾯ +\def\greekalphavrachy {\char"01FB0 } % GREEK SMALL LETTER ALPHA WITH VRACHY: ᾰ +\def\greekalphamacron {\char"01FB1 } % GREEK SMALL LETTER ALPHA WITH MACRON: ᾱ +\def\greekalphaiotasubvaria {\char"01FB2 } % GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI: ᾲ +\def\greekalphaiotasub {\char"01FB3 } % GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI: ᾳ +\def\greekalphaiotasubtonos {\char"01FB4 } % GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI: ᾴ +\def\greekalphaperispomeni {\char"01FB6 } % GREEK SMALL LETTER ALPHA WITH PERISPOMENI: ᾶ +\def\greekalphaiotasubperispomeni {\char"01FB7 } % GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI: ᾷ +\def\greekAlphavrachy {\char"01FB8 } % GREEK CAPITAL LETTER ALPHA WITH VRACHY: Ᾰ +\def\greekAlphamacron {\char"01FB9 } % GREEK CAPITAL LETTER ALPHA WITH MACRON: Ᾱ +\def\greekAlphavaria {\char"01FBA } % GREEK CAPITAL LETTER ALPHA WITH VARIA: Ὰ +\def\greekAlphatonos {\char"01FBB } % GREEK CAPITAL LETTER ALPHA WITH OXIA: Ά +\def\greekAlphaiotasub {\char"01FBC } % GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI: ᾼ +\def\greekCoronis {\char"01FBD } % GREEK KORONIS: ᾽ +\def\greekprosgegrammeni {\char"01FBE } % GREEK PROSGEGRAMMENI: ι +\def\greekpsili {\char"01FBF } % GREEK PSILI: ᾿ +\def\greekperispomeni {\char"01FC0 } % GREEK PERISPOMENI: ῀ +\def\greekdialytikaperispomeni {\char"01FC1 } % GREEK DIALYTIKA AND PERISPOMENI: ῁ +\def\greeketaiotasubvaria {\char"01FC2 } % GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI: ῂ +\def\greeketaiotasub {\char"01FC3 } % GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI: ῃ +\def\greeketaiotasubtonos {\char"01FC4 } % GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI: ῄ +\def\greeketaperispomeni {\char"01FC6 } % GREEK SMALL LETTER ETA WITH PERISPOMENI: ῆ +\def\greeketaiotasubperispomeni {\char"01FC7 } % GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI: ῇ +\def\greekEpsilonvaria {\char"01FC8 } % GREEK CAPITAL LETTER EPSILON WITH VARIA: Ὲ +\def\greekEpsilontonos {\char"01FC9 } % GREEK CAPITAL LETTER EPSILON WITH OXIA: Έ +\def\greekEtavaria {\char"01FCA } % GREEK CAPITAL LETTER ETA WITH VARIA: Ὴ +\def\greekEtatonos {\char"01FCB } % GREEK CAPITAL LETTER ETA WITH OXIA: Ή +\def\greekEtaiotasub {\char"01FCC } % GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI: ῌ +\def\greekpsilivaria {\char"01FCD } % GREEK PSILI AND VARIA: ῍ +\def\greekpsilitonos {\char"01FCE } % GREEK PSILI AND OXIA: ῎ +\def\greekpsiliperispomeni {\char"01FCF } % GREEK PSILI AND PERISPOMENI: ῏ +\def\greekiotavrachy {\char"01FD0 } % GREEK SMALL LETTER IOTA WITH VRACHY: ῐ +\def\greekiotamacron {\char"01FD1 } % GREEK SMALL LETTER IOTA WITH MACRON: ῑ +\def\greekiotadialytikavaria {\char"01FD2 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA: ῒ +\def\greekiotadialytikatonos {\char"01FD3 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA: ΐ +\def\greekiotaperispomeni {\char"01FD6 } % GREEK SMALL LETTER IOTA WITH PERISPOMENI: ῖ +\def\greekiotadialytikaperispomeni {\char"01FD7 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI: ῗ +\def\greekIotavrachy {\char"01FD8 } % GREEK CAPITAL LETTER IOTA WITH VRACHY: Ῐ +\def\greekIotamacron {\char"01FD9 } % GREEK CAPITAL LETTER IOTA WITH MACRON: Ῑ +\def\greekIotavaria {\char"01FDA } % GREEK CAPITAL LETTER IOTA WITH VARIA: Ὶ +\def\greekIotatonos {\char"01FDB } % GREEK CAPITAL LETTER IOTA WITH OXIA: Ί +\def\greekdasiavaria {\char"01FDD } % GREEK DASIA AND VARIA: ῝ +\def\greekdasiatonos {\char"01FDE } % GREEK DASIA AND OXIA: ῞ +\def\greekdasiaperispomeni {\char"01FDF } % GREEK DASIA AND PERISPOMENI: ῟ +\def\greekupsilonvrachy {\char"01FE0 } % GREEK SMALL LETTER UPSILON WITH VRACHY: ῠ +\def\greekupsilonmacron {\char"01FE1 } % GREEK SMALL LETTER UPSILON WITH MACRON: ῡ +\def\greekupsilondialytikavaria {\char"01FE2 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA: ῢ +\def\greekupsilondialytikatonos {\char"01FE3 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA: ΰ +\def\greekrhopsili {\char"01FE4 } % GREEK SMALL LETTER RHO WITH PSILI: ῤ +\def\greekrhodasia {\char"01FE5 } % GREEK SMALL LETTER RHO WITH DASIA: ῥ +\def\greekupsilonperispomeni {\char"01FE6 } % GREEK SMALL LETTER UPSILON WITH PERISPOMENI: ῦ +\def\greekupsilondialytikaperispomeni {\char"01FE7 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI: ῧ +\def\greekUpsilonvrachy {\char"01FE8 } % GREEK CAPITAL LETTER UPSILON WITH VRACHY: Ῠ +\def\greekUpsilonmacron {\char"01FE9 } % GREEK CAPITAL LETTER UPSILON WITH MACRON: Ῡ +\def\greekUpsilonvaria {\char"01FEA } % GREEK CAPITAL LETTER UPSILON WITH VARIA: Ὺ +\def\greekUpsilontonos {\char"01FEB } % GREEK CAPITAL LETTER UPSILON WITH OXIA: Ύ +\def\greekRhodasia {\char"01FEC } % GREEK CAPITAL LETTER RHO WITH DASIA: Ῥ +\def\greekdialytikavaria {\char"01FED } % GREEK DIALYTIKA AND VARIA: ῭ +\def\greekdialytikatonos {\char"01FEE } % GREEK DIALYTIKA AND OXIA: ΅ +\def\greekvaria {\char"01FEF } % GREEK VARIA: ` +\def\greekomegaiotasubvaria {\char"01FF2 } % GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI: ῲ +\def\greekomegaiotasub {\char"01FF3 } % GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI: ῳ +\def\greekomegaiotasubtonos {\char"01FF4 } % GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI: ῴ +\def\greekomegaperispomeni {\char"01FF6 } % GREEK SMALL LETTER OMEGA WITH PERISPOMENI: ῶ +\def\greekomegaiotasubperispomeni {\char"01FF7 } % GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI: ῷ +\def\greekOmicronvaria {\char"01FF8 } % GREEK CAPITAL LETTER OMICRON WITH VARIA: Ὸ +\def\greekOmicrontonos {\char"01FF9 } % GREEK CAPITAL LETTER OMICRON WITH OXIA: Ό +\def\greekOmegavaria {\char"01FFA } % GREEK CAPITAL LETTER OMEGA WITH VARIA: Ὼ +\def\greekOmegatonos {\char"01FFB } % GREEK CAPITAL LETTER OMEGA WITH OXIA: Ώ +\def\greekOmegaiotasub {\char"01FFC } % GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI: ῼ +\def\greekoxia {\char"01FFD } % GREEK OXIA: ´ +\def\greekdasia {\char"01FFE } % GREEK DASIA: ῾ +\def\enspace {\char"02002 } % EN SPACE:   +\def\emspace {\char"02003 } % EM SPACE:   +\def\threeperemspace {\char"02004 } % THREE-PER-EM SPACE:   +\def\fourperemspace {\char"02005 } % FOUR-PER-EM SPACE:   +\def\sixperemspace {\char"02006 } % SIX-PER-EM SPACE:   +\def\figurespace {\char"02007 } % FIGURE SPACE:   +\def\punctuationspace {\char"02008 } % PUNCTUATION SPACE:   +\def\thinspace {\char"02009 } % THIN SPACE:   +\def\figurespace {\char"0200A } % HAIR SPACE:   +\def\zerowidthspace {\char"0200B } % ZERO WIDTH SPACE: ​ +\def\textminus {\char"02012 } % FIGURE DASH: ‒ +\def\endash {\char"02013 } % EN DASH: – +\def\emdash {\char"02014 } % EM DASH: — +\def\texthorizontalbar {\char"02015 } % HORIZONTAL BAR: ― +\def\quoteleft {\char"02018 } % LEFT SINGLE QUOTATION MARK: ‘ +\def\quoteright {\char"02019 } % RIGHT SINGLE QUOTATION MARK: ’ +\def\quotesinglebase {\char"0201A } % SINGLE LOW-0x0009 QUOTATION MARK: ‚ +\def\quotedblleft {\char"0201C } % LEFT DOUBLE QUOTATION MARK: “ +\def\quotedblright {\char"0201D } % RIGHT DOUBLE QUOTATION MARK: ” +\def\quotedblbase {\char"0201E } % DOUBLE LOW-0x0009 QUOTATION MARK: „ +\def\textdag {\char"02020 } % DAGGER: † +\def\textddag {\char"02021 } % DOUBLE DAGGER: ‡ +\def\textbullet {\char"02022 } % BULLET: • +\def\textellipsis {\char"02026 } % HORIZONTAL ELLIPSIS: … +\def\narrownobreakspace {\char"0202F } % NARROW NO-BREAK SPACE:   +\def\perthousand {\char"02030 } % PER MILLE SIGN: ‰ +\def\guilsingleleft {\char"02039 } % SINGLE LEFT-POINTING ANGLE QUOTATION MARK: ‹ +\def\guilsingleright {\char"0203A } % SINGLE RIGHT-POINTING ANGLE QUOTATION MARK: › +\def\textfraction {\char"02044 } % FRACTION SLASH: ⁄ +\def\medspace {\char"0205F } % MEDIUM MATHEMATICAL SPACE:   +\def\textdong {\char"020AB } % DONG SIGN: ₫ +\def\texteuro {\char"020AC } % EURO SIGN: € +\def\textcelsius {\char"02103 } % DEGREE CELSIUS: ℃ +\def\textnumero {\char"02116 } % NUMERO SIGN: № +\def\textcircledP {\char"02117 } % SOUND RECORDING COPYRIGHT: ℗ +\def\trademark {\char"02122 } % TRADE MARK SIGN: ™ +\def\textounce {\char"02125 } % OUNCE SIGN: ℥ +\def\textohm {\char"02126 } % OHM SIGN: Ω +\def\textmho {\char"02127 } % INVERTED OHM SIGN: ℧ +\def\textkelvin {\char"0212A } % KELVIN SIGN: K +\def\textAngstrom {\char"0212B } % ANGSTROM SIGN: Å +\def\onethird {\char"02153 } % VULGAR FRACTION ONE THIRD: ⅓ +\def\twothirds {\char"02154 } % VULGAR FRACTION TWO THIRDS: ⅔ +\def\onefifth {\char"02155 } % VULGAR FRACTION ONE FIFTH: ⅕ +\def\twofifths {\char"02156 } % VULGAR FRACTION TWO FIFTHS: ⅖ +\def\threefifths {\char"02157 } % VULGAR FRACTION THREE FIFTHS: ⅗ +\def\fourfifths {\char"02158 } % VULGAR FRACTION FOUR FIFTHS: ⅘ +\def\onesixth {\char"02159 } % VULGAR FRACTION ONE SIXTH: ⅙ +\def\fivesixths {\char"0215A } % VULGAR FRACTION FIVE SIXTHS: ⅚ +\def\oneeighth {\char"0215B } % VULGAR FRACTION ONE EIGHTH: ⅛ +\def\threeeighths {\char"0215C } % VULGAR FRACTION THREE EIGHTHS: ⅜ +\def\fiveeighths {\char"0215D } % VULGAR FRACTION FIVE EIGHTHS: ⅝ +\def\seveneighths {\char"0215E } % VULGAR FRACTION SEVEN EIGHTHS: ⅞ +\def\romanI {\char"02160 } % ROMAN NUMERAL ONE: Ⅰ +\def\romanII {\char"02161 } % ROMAN NUMERAL TWO: Ⅱ +\def\romanIII {\char"02162 } % ROMAN NUMERAL THREE: Ⅲ +\def\romanIV {\char"02163 } % ROMAN NUMERAL FOUR: Ⅳ +\def\romanV {\char"02164 } % ROMAN NUMERAL FIVE: Ⅴ +\def\romanVI {\char"02165 } % ROMAN NUMERAL SIX: Ⅵ +\def\romanVII {\char"02166 } % ROMAN NUMERAL SEVEN: Ⅶ +\def\romanVIII {\char"02167 } % ROMAN NUMERAL EIGHT: Ⅷ +\def\romanIX {\char"02168 } % ROMAN NUMERAL NINE: Ⅸ +\def\romanX {\char"02169 } % ROMAN NUMERAL TEN: Ⅹ +\def\romanXI {\char"0216A } % ROMAN NUMERAL ELEVEN: Ⅺ +\def\romanXII {\char"0216B } % ROMAN NUMERAL TWELVE: Ⅻ +\def\romanL {\char"0216C } % ROMAN NUMERAL FIFTY: Ⅼ +\def\romanC {\char"0216D } % ROMAN NUMERAL ONE HUNDRED: Ⅽ +\def\romanD {\char"0216E } % ROMAN NUMERAL FIVE HUNDRED: Ⅾ +\def\romanM {\char"0216F } % ROMAN NUMERAL ONE THOUSAND: Ⅿ +\def\romani {\char"02170 } % SMALL ROMAN NUMERAL ONE: ⅰ +\def\romanii {\char"02171 } % SMALL ROMAN NUMERAL TWO: ⅱ +\def\romaniii {\char"02172 } % SMALL ROMAN NUMERAL THREE: ⅲ +\def\romaniv {\char"02173 } % SMALL ROMAN NUMERAL FOUR: ⅳ +\def\romanv {\char"02174 } % SMALL ROMAN NUMERAL FIVE: ⅴ +\def\romanvi {\char"02175 } % SMALL ROMAN NUMERAL SIX: ⅵ +\def\romanvii {\char"02176 } % SMALL ROMAN NUMERAL SEVEN: ⅶ +\def\romanviii {\char"02177 } % SMALL ROMAN NUMERAL EIGHT: ⅷ +\def\romanix {\char"02178 } % SMALL ROMAN NUMERAL NINE: ⅸ +\def\romanx {\char"02179 } % SMALL ROMAN NUMERAL TEN: ⅹ +\def\romanxi {\char"0217A } % SMALL ROMAN NUMERAL ELEVEN: ⅺ +\def\romanxii {\char"0217B } % SMALL ROMAN NUMERAL TWELVE: ⅻ +\def\romanl {\char"0217C } % SMALL ROMAN NUMERAL FIFTY: ⅼ +\def\romanc {\char"0217D } % SMALL ROMAN NUMERAL ONE HUNDRED: ⅽ +\def\romand {\char"0217E } % SMALL ROMAN NUMERAL FIVE HUNDRED: ⅾ +\def\romanm {\char"0217F } % SMALL ROMAN NUMERAL ONE THOUSAND: ⅿ +\def\carriagereturn {\char"021B5 } % DOWNWARDS ARROW WITH CORNER LEFTWARDS: ↵ +\def\ideographicspace {\char"03000 } % IDEOGRAPHIC SPACE:   +\def\ideographichalffillspace {\char"0303F } % IDEOGRAPHIC HALF FILL SPACE: 〿 +\def\ffligature {\char"0FB00 } % LATIN SMALL LIGATURE FF: ff +\def\filigature {\char"0FB01 } % LATIN SMALL LIGATURE FI: fi +\def\flligature {\char"0FB02 } % LATIN SMALL LIGATURE FL: fl +\def\ffiligature {\char"0FB03 } % LATIN SMALL LIGATURE FFI: ffi +\def\fflligature {\char"0FB04 } % LATIN SMALL LIGATURE FFL: ffl +\def\stligature {\char"0FB06 } % LATIN SMALL LIGATURE ST: st +\def\zerowidthnobreakspace {\char"0FEFF } % ZERO WIDTH NO-BREAK SPACE:  + +\endinput diff --git a/tex/context/base/xetx-chr.tex b/tex/context/base/xetx-chr.tex deleted file mode 100644 index 31f15a0cb..000000000 --- a/tex/context/base/xetx-chr.tex +++ /dev/null @@ -1,1167 +0,0 @@ -% filename : xetx-chr.tex -% comment : generated by mtxrun --script chars --xtx -% author : Hans Hagen, PRAGMA-ADE, Hasselt NL -% copyright: PRAGMA ADE / ConTeXt Development Team -% license : see context related readme files - -% named characters mapped onto utf (\\char is needed for accents) - -\def\textbackslash {\char"0005C } % REVERSE SOLIDUS: \ -\def\textasciicircum {\char"0005E } % CIRCUMFLEX ACCENT: ^ -\def\textunderscore {\char"0005F } % LOW LINE: _ -\def\textgrave {\char"00060 } % GRAVE ACCENT: ` -\def\idotaccent {\char"00069 } % LATIN SMALL LETTER I: i -\def\textbraceleft {\char"0007B } % LEFT CURLY BRACKET: { -\def\textbar {\char"0007C } % VERTICAL LINE: | -\def\textbraceright {\char"0007D } % RIGHT CURLY BRACKET: } -\def\textasciitilde {\char"0007E } % TILDE: ~ -\def\nobreakspace {\char"000A0 } % NO-BREAK SPACE:   -\def\exclamdown {\char"000A1 } % INVERTED EXCLAMATION MARK: ¡ -\def\textcent {\char"000A2 } % CENT SIGN: ¢ -\def\textsterling {\char"000A3 } % POUND SIGN: £ -\def\textcurrency {\char"000A4 } % CURRENCY SIGN: ¤ -\def\textyen {\char"000A5 } % YEN SIGN: ¥ -\def\textbrokenbar {\char"000A6 } % BROKEN BAR: ¦ -\def\sectionmark {\char"000A7 } % SECTION SIGN: § -\def\textdiaeresis {\char"000A8 } % DIAERESIS: ¨ -\def\copyright {\char"000A9 } % COPYRIGHT SIGN: © -\def\ordfeminine {\char"000AA } % FEMININE ORDINAL INDICATOR: ª -\def\leftguillemot {\char"000AB } % LEFT-POINTING DOUBLE ANGLE QUOTATION MARK: « -\def\textlognot {\char"000AC } % NOT SIGN: ¬ -\def\softhyphen {\char"000AD } % SOFT HYPHEN: ­ -\def\registered {\char"000AE } % REGISTERED SIGN: ® -\def\textmacron {\char"000AF } % MACRON: ¯ -\def\textdegree {\char"000B0 } % DEGREE SIGN: ° -\def\textpm {\char"000B1 } % PLUS-MINUS SIGN: ± -\def\twosuperior {\char"000B2 } % SUPERSCRIPT TWO: ² -\def\threesuperior {\char"000B3 } % SUPERSCRIPT THREE: ³ -\def\textacute {\char"000B4 } % ACUTE ACCENT: ´ -\def\textmu {\char"000B5 } % MICRO SIGN: µ -\def\paragraphmark {\char"000B6 } % PILCROW SIGN: ¶ -\def\periodcentered {\char"000B7 } % MIDDLE DOT: · -\def\textcedilla {\char"000B8 } % CEDILLA: ¸ -\def\onesuperior {\char"000B9 } % SUPERSCRIPT ONE: ¹ -\def\ordmasculine {\char"000BA } % MASCULINE ORDINAL INDICATOR: º -\def\rightguillemot {\char"000BB } % RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK: » -\def\onequarter {\char"000BC } % VULGAR FRACTION ONE QUARTER: ¼ -\def\onehalf {\char"000BD } % VULGAR FRACTION ONE HALF: ½ -\def\threequarter {\char"000BE } % VULGAR FRACTION THREE QUARTERS: ¾ -\def\questiondown {\char"000BF } % INVERTED QUESTION MARK: ¿ -\def\Agrave {\char"000C0 } % LATIN CAPITAL LETTER A WITH GRAVE: À -\def\Aacute {\char"000C1 } % LATIN CAPITAL LETTER A WITH ACUTE: Á -\def\Acircumflex {\char"000C2 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX:  -\def\Atilde {\char"000C3 } % LATIN CAPITAL LETTER A WITH TILDE: à -\def\Adiaeresis {\char"000C4 } % LATIN CAPITAL LETTER A WITH DIAERESIS: Ä -\def\Aring {\char"000C5 } % LATIN CAPITAL LETTER A WITH RING ABOVE: Å -\def\AEligature {\char"000C6 } % LATIN CAPITAL LETTER AE: Æ -\def\Ccedilla {\char"000C7 } % LATIN CAPITAL LETTER C WITH CEDILLA: Ç -\def\Egrave {\char"000C8 } % LATIN CAPITAL LETTER E WITH GRAVE: È -\def\Eacute {\char"000C9 } % LATIN CAPITAL LETTER E WITH ACUTE: É -\def\Ecircumflex {\char"000CA } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX: Ê -\def\Ediaeresis {\char"000CB } % LATIN CAPITAL LETTER E WITH DIAERESIS: Ë -\def\Igrave {\char"000CC } % LATIN CAPITAL LETTER I WITH GRAVE: Ì -\def\Iacute {\char"000CD } % LATIN CAPITAL LETTER I WITH ACUTE: Í -\def\Icircumflex {\char"000CE } % LATIN CAPITAL LETTER I WITH CIRCUMFLEX: Î -\def\Idiaeresis {\char"000CF } % LATIN CAPITAL LETTER I WITH DIAERESIS: Ï -\def\Eth {\char"000D0 } % LATIN CAPITAL LETTER ETH: Ð -\def\Ntilde {\char"000D1 } % LATIN CAPITAL LETTER N WITH TILDE: Ñ -\def\Ograve {\char"000D2 } % LATIN CAPITAL LETTER O WITH GRAVE: Ò -\def\Oacute {\char"000D3 } % LATIN CAPITAL LETTER O WITH ACUTE: Ó -\def\Ocircumflex {\char"000D4 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX: Ô -\def\Otilde {\char"000D5 } % LATIN CAPITAL LETTER O WITH TILDE: Õ -\def\Odiaeresis {\char"000D6 } % LATIN CAPITAL LETTER O WITH DIAERESIS: Ö -\def\textmultiply {\char"000D7 } % MULTIPLICATION SIGN: × -\def\Ostroke {\char"000D8 } % LATIN CAPITAL LETTER O WITH STROKE: Ø -\def\Ugrave {\char"000D9 } % LATIN CAPITAL LETTER U WITH GRAVE: Ù -\def\Uacute {\char"000DA } % LATIN CAPITAL LETTER U WITH ACUTE: Ú -\def\Ucircumflex {\char"000DB } % LATIN CAPITAL LETTER U WITH CIRCUMFLEX: Û -\def\Udiaeresis {\char"000DC } % LATIN CAPITAL LETTER U WITH DIAERESIS: Ü -\def\Yacute {\char"000DD } % LATIN CAPITAL LETTER Y WITH ACUTE: Ý -\def\Thorn {\char"000DE } % LATIN CAPITAL LETTER THORN: Þ -\def\ssharp {\char"000DF } % LATIN SMALL LETTER SHARP S: ß -\def\agrave {\char"000E0 } % LATIN SMALL LETTER A WITH GRAVE: à -\def\aacute {\char"000E1 } % LATIN SMALL LETTER A WITH ACUTE: á -\def\acircumflex {\char"000E2 } % LATIN SMALL LETTER A WITH CIRCUMFLEX: â -\def\atilde {\char"000E3 } % LATIN SMALL LETTER A WITH TILDE: ã -\def\adiaeresis {\char"000E4 } % LATIN SMALL LETTER A WITH DIAERESIS: ä -\def\aring {\char"000E5 } % LATIN SMALL LETTER A WITH RING ABOVE: å -\def\aeligature {\char"000E6 } % LATIN SMALL LETTER AE: æ -\def\ccedilla {\char"000E7 } % LATIN SMALL LETTER C WITH CEDILLA: ç -\def\egrave {\char"000E8 } % LATIN SMALL LETTER E WITH GRAVE: è -\def\eacute {\char"000E9 } % LATIN SMALL LETTER E WITH ACUTE: é -\def\ecircumflex {\char"000EA } % LATIN SMALL LETTER E WITH CIRCUMFLEX: ê -\def\ediaeresis {\char"000EB } % LATIN SMALL LETTER E WITH DIAERESIS: ë -\def\igrave {\char"000EC } % LATIN SMALL LETTER I WITH GRAVE: ì -\def\iacute {\char"000ED } % LATIN SMALL LETTER I WITH ACUTE: í -\def\icircumflex {\char"000EE } % LATIN SMALL LETTER I WITH CIRCUMFLEX: î -\def\idiaeresis {\char"000EF } % LATIN SMALL LETTER I WITH DIAERESIS: ï -\def\ntilde {\char"000F1 } % LATIN SMALL LETTER N WITH TILDE: ñ -\def\ograve {\char"000F2 } % LATIN SMALL LETTER O WITH GRAVE: ò -\def\oacute {\char"000F3 } % LATIN SMALL LETTER O WITH ACUTE: ó -\def\ocircumflex {\char"000F4 } % LATIN SMALL LETTER O WITH CIRCUMFLEX: ô -\def\otilde {\char"000F5 } % LATIN SMALL LETTER O WITH TILDE: õ -\def\odiaeresis {\char"000F6 } % LATIN SMALL LETTER O WITH DIAERESIS: ö -\def\textdiv {\char"000F7 } % DIVISION SIGN: ÷ -\def\ostroke {\char"000F8 } % LATIN SMALL LETTER O WITH STROKE: ø -\def\ugrave {\char"000F9 } % LATIN SMALL LETTER U WITH GRAVE: ù -\def\uacute {\char"000FA } % LATIN SMALL LETTER U WITH ACUTE: ú -\def\ucircumflex {\char"000FB } % LATIN SMALL LETTER U WITH CIRCUMFLEX: û -\def\udiaeresis {\char"000FC } % LATIN SMALL LETTER U WITH DIAERESIS: ü -\def\yacute {\char"000FD } % LATIN SMALL LETTER Y WITH ACUTE: ý -\def\thorn {\char"000FE } % LATIN SMALL LETTER THORN: þ -\def\ydiaeresis {\char"000FF } % LATIN SMALL LETTER Y WITH DIAERESIS: ÿ -\def\Amacron {\char"00100 } % LATIN CAPITAL LETTER A WITH MACRON: Ā -\def\amacron {\char"00101 } % LATIN SMALL LETTER A WITH MACRON: ā -\def\Abreve {\char"00102 } % LATIN CAPITAL LETTER A WITH BREVE: Ă -\def\abreve {\char"00103 } % LATIN SMALL LETTER A WITH BREVE: ă -\def\Aogonek {\char"00104 } % LATIN CAPITAL LETTER A WITH OGONEK: Ą -\def\aogonek {\char"00105 } % LATIN SMALL LETTER A WITH OGONEK: ą -\def\Cacute {\char"00106 } % LATIN CAPITAL LETTER C WITH ACUTE: Ć -\def\cacute {\char"00107 } % LATIN SMALL LETTER C WITH ACUTE: ć -\def\Ccircumflex {\char"00108 } % LATIN CAPITAL LETTER C WITH CIRCUMFLEX: Ĉ -\def\ccircumflex {\char"00109 } % LATIN SMALL LETTER C WITH CIRCUMFLEX: ĉ -\def\Cdotaccent {\char"0010A } % LATIN CAPITAL LETTER C WITH DOT ABOVE: Ċ -\def\cdotaccent {\char"0010B } % LATIN SMALL LETTER C WITH DOT ABOVE: ċ -\def\Ccaron {\char"0010C } % LATIN CAPITAL LETTER C WITH CARON: Č -\def\ccaron {\char"0010D } % LATIN SMALL LETTER C WITH CARON: č -\def\Dcaron {\char"0010E } % LATIN CAPITAL LETTER D WITH CARON: Ď -\def\dcaron {\char"0010F } % LATIN SMALL LETTER D WITH CARON: ď -\def\Dstroke {\char"00110 } % LATIN CAPITAL LETTER D WITH STROKE: Đ -\def\dstroke {\char"00111 } % LATIN SMALL LETTER D WITH STROKE: đ -\def\Emacron {\char"00112 } % LATIN CAPITAL LETTER E WITH MACRON: Ē -\def\emacron {\char"00113 } % LATIN SMALL LETTER E WITH MACRON: ē -\def\Ebreve {\char"00114 } % LATIN CAPITAL LETTER E WITH BREVE: Ĕ -\def\ebreve {\char"00115 } % LATIN SMALL LETTER E WITH BREVE: ĕ -\def\Edotaccent {\char"00116 } % LATIN CAPITAL LETTER E WITH DOT ABOVE: Ė -\def\edotaccent {\char"00117 } % LATIN SMALL LETTER E WITH DOT ABOVE: ė -\def\Eogonek {\char"00118 } % LATIN CAPITAL LETTER E WITH OGONEK: Ę -\def\eogonek {\char"00119 } % LATIN SMALL LETTER E WITH OGONEK: ę -\def\Ecaron {\char"0011A } % LATIN CAPITAL LETTER E WITH CARON: Ě -\def\ecaron {\char"0011B } % LATIN SMALL LETTER E WITH CARON: ě -\def\Gcircumflex {\char"0011C } % LATIN CAPITAL LETTER G WITH CIRCUMFLEX: Ĝ -\def\gcircumflex {\char"0011D } % LATIN SMALL LETTER G WITH CIRCUMFLEX: ĝ -\def\Gbreve {\char"0011E } % LATIN CAPITAL LETTER G WITH BREVE: Ğ -\def\gbreve {\char"0011F } % LATIN SMALL LETTER G WITH BREVE: ğ -\def\Gdotaccent {\char"00120 } % LATIN CAPITAL LETTER G WITH DOT ABOVE: Ġ -\def\gdotaccent {\char"00121 } % LATIN SMALL LETTER G WITH DOT ABOVE: ġ -\def\Gcommaaccent {\char"00122 } % LATIN CAPITAL LETTER G WITH CEDILLA: Ģ -\def\gcommaaccent {\char"00123 } % LATIN SMALL LETTER G WITH CEDILLA: ģ -\def\Hcircumflex {\char"00124 } % LATIN CAPITAL LETTER H WITH CIRCUMFLEX: Ĥ -\def\hcircumflex {\char"00125 } % LATIN SMALL LETTER H WITH CIRCUMFLEX: ĥ -\def\Hstroke {\char"00126 } % LATIN CAPITAL LETTER H WITH STROKE: Ħ -\def\hstroke {\char"00127 } % LATIN SMALL LETTER H WITH STROKE: ħ -\def\Itilde {\char"00128 } % LATIN CAPITAL LETTER I WITH TILDE: Ĩ -\def\itilde {\char"00129 } % LATIN SMALL LETTER I WITH TILDE: ĩ -\def\Imacron {\char"0012A } % LATIN CAPITAL LETTER I WITH MACRON: Ī -\def\imacron {\char"0012B } % LATIN SMALL LETTER I WITH MACRON: ī -\def\Ibreve {\char"0012C } % LATIN CAPITAL LETTER I WITH BREVE: Ĭ -\def\ibreve {\char"0012D } % LATIN SMALL LETTER I WITH BREVE: ĭ -\def\Iogonek {\char"0012E } % LATIN CAPITAL LETTER I WITH OGONEK: Į -\def\iogonek {\char"0012F } % LATIN SMALL LETTER I WITH OGONEK: į -\def\Idotaccent {\char"00130 } % LATIN CAPITAL LETTER I WITH DOT ABOVE: İ -\def\dotlessi {\char"00131 } % LATIN SMALL LETTER DOTLESS I: ı -\def\IJligature {\char"00132 } % LATIN CAPITAL LIGATURE IJ: IJ -\def\ijligature {\char"00133 } % LATIN SMALL LIGATURE IJ: ij -\def\Jcircumflex {\char"00134 } % LATIN CAPITAL LETTER J WITH CIRCUMFLEX: Ĵ -\def\jcircumflex {\char"00135 } % LATIN SMALL LETTER J WITH CIRCUMFLEX: ĵ -\def\Kcommaaccent {\char"00136 } % LATIN CAPITAL LETTER K WITH CEDILLA: Ķ -\def\kcommaaccent {\char"00137 } % LATIN SMALL LETTER K WITH CEDILLA: ķ -\def\kkra {\char"00138 } % LATIN SMALL LETTER KRA: ĸ -\def\Lacute {\char"00139 } % LATIN CAPITAL LETTER L WITH ACUTE: Ĺ -\def\lacute {\char"0013A } % LATIN SMALL LETTER L WITH ACUTE: ĺ -\def\Lcommaaccent {\char"0013B } % LATIN CAPITAL LETTER L WITH CEDILLA: Ļ -\def\lcommaaccent {\char"0013C } % LATIN SMALL LETTER L WITH CEDILLA: ļ -\def\Lcaron {\char"0013D } % LATIN CAPITAL LETTER L WITH CARON: Ľ -\def\lcaron {\char"0013E } % LATIN SMALL LETTER L WITH CARON: ľ -\def\Ldotmiddle {\char"0013F } % LATIN CAPITAL LETTER L WITH MIDDLE DOT: Ŀ -\def\ldotmiddle {\char"00140 } % LATIN SMALL LETTER L WITH MIDDLE DOT: ŀ -\def\Lstroke {\char"00141 } % LATIN CAPITAL LETTER L WITH STROKE: Ł -\def\lstroke {\char"00142 } % LATIN SMALL LETTER L WITH STROKE: ł -\def\Nacute {\char"00143 } % LATIN CAPITAL LETTER N WITH ACUTE: Ń -\def\nacute {\char"00144 } % LATIN SMALL LETTER N WITH ACUTE: ń -\def\Ncommaaccent {\char"00145 } % LATIN CAPITAL LETTER N WITH CEDILLA: Ņ -\def\ncommaaccent {\char"00146 } % LATIN SMALL LETTER N WITH CEDILLA: ņ -\def\Ncaron {\char"00147 } % LATIN CAPITAL LETTER N WITH CARON: Ň -\def\ncaron {\char"00148 } % LATIN SMALL LETTER N WITH CARON: ň -\def\napostrophe {\char"00149 } % LATIN SMALL LETTER N PRECEDED BY APOSTROPHE: ʼn -\def\Neng {\char"0014A } % LATIN CAPITAL LETTER ENG: Ŋ -\def\neng {\char"0014B } % LATIN SMALL LETTER ENG: ŋ -\def\Omacron {\char"0014C } % LATIN CAPITAL LETTER O WITH MACRON: Ō -\def\omacron {\char"0014D } % LATIN SMALL LETTER O WITH MACRON: ō -\def\Obreve {\char"0014E } % LATIN CAPITAL LETTER O WITH BREVE: Ŏ -\def\obreve {\char"0014F } % LATIN SMALL LETTER O WITH BREVE: ŏ -\def\Ohungarumlaut {\char"00150 } % LATIN CAPITAL LETTER O WITH DOUBLE ACUTE: Ő -\def\ohungarumlaut {\char"00151 } % LATIN SMALL LETTER O WITH DOUBLE ACUTE: ő -\def\OEligature {\char"00152 } % LATIN CAPITAL LIGATURE OE: Œ -\def\oeligature {\char"00153 } % LATIN SMALL LIGATURE OE: œ -\def\Racute {\char"00154 } % LATIN CAPITAL LETTER R WITH ACUTE: Ŕ -\def\racute {\char"00155 } % LATIN SMALL LETTER R WITH ACUTE: ŕ -\def\Rcommaaccent {\char"00156 } % LATIN CAPITAL LETTER R WITH CEDILLA: Ŗ -\def\rcommaaccent {\char"00157 } % LATIN SMALL LETTER R WITH CEDILLA: ŗ -\def\Rcaron {\char"00158 } % LATIN CAPITAL LETTER R WITH CARON: Ř -\def\rcaron {\char"00159 } % LATIN SMALL LETTER R WITH CARON: ř -\def\Sacute {\char"0015A } % LATIN CAPITAL LETTER S WITH ACUTE: Ś -\def\sacute {\char"0015B } % LATIN SMALL LETTER S WITH ACUTE: ś -\def\Scircumflex {\char"0015C } % LATIN CAPITAL LETTER S WITH CIRCUMFLEX: Ŝ -\def\scircumflex {\char"0015D } % LATIN SMALL LETTER S WITH CIRCUMFLEX: ŝ -\def\Scedilla {\char"0015E } % LATIN CAPITAL LETTER S WITH CEDILLA: Ş -\def\scedilla {\char"0015F } % LATIN SMALL LETTER S WITH CEDILLA: ş -\def\Scaron {\char"00160 } % LATIN CAPITAL LETTER S WITH CARON: Š -\def\scaron {\char"00161 } % LATIN SMALL LETTER S WITH CARON: š -\def\Tcedilla {\char"00162 } % LATIN CAPITAL LETTER T WITH CEDILLA: Ţ -\def\tcedilla {\char"00163 } % LATIN SMALL LETTER T WITH CEDILLA: ţ -\def\Tcaron {\char"00164 } % LATIN CAPITAL LETTER T WITH CARON: Ť -\def\tcaron {\char"00165 } % LATIN SMALL LETTER T WITH CARON: ť -\def\Tstroke {\char"00166 } % LATIN CAPITAL LETTER T WITH STROKE: Ŧ -\def\tstroke {\char"00167 } % LATIN SMALL LETTER T WITH STROKE: ŧ -\def\Utilde {\char"00168 } % LATIN CAPITAL LETTER U WITH TILDE: Ũ -\def\utilde {\char"00169 } % LATIN SMALL LETTER U WITH TILDE: ũ -\def\Umacron {\char"0016A } % LATIN CAPITAL LETTER U WITH MACRON: Ū -\def\umacron {\char"0016B } % LATIN SMALL LETTER U WITH MACRON: ū -\def\Ubreve {\char"0016C } % LATIN CAPITAL LETTER U WITH BREVE: Ŭ -\def\ubreve {\char"0016D } % LATIN SMALL LETTER U WITH BREVE: ŭ -\def\Uring {\char"0016E } % LATIN CAPITAL LETTER U WITH RING ABOVE: Ů -\def\uring {\char"0016F } % LATIN SMALL LETTER U WITH RING ABOVE: ů -\def\Uhungarumlaut {\char"00170 } % LATIN CAPITAL LETTER U WITH DOUBLE ACUTE: Ű -\def\uhungarumlaut {\char"00171 } % LATIN SMALL LETTER U WITH DOUBLE ACUTE: ű -\def\Uogonek {\char"00172 } % LATIN CAPITAL LETTER U WITH OGONEK: Ų -\def\uogonek {\char"00173 } % LATIN SMALL LETTER U WITH OGONEK: ų -\def\Wcircumflex {\char"00174 } % LATIN CAPITAL LETTER W WITH CIRCUMFLEX: Ŵ -\def\wcircumflex {\char"00175 } % LATIN SMALL LETTER W WITH CIRCUMFLEX: ŵ -\def\Ycircumflex {\char"00176 } % LATIN CAPITAL LETTER Y WITH CIRCUMFLEX: Ŷ -\def\ycircumflex {\char"00177 } % LATIN SMALL LETTER Y WITH CIRCUMFLEX: ŷ -\def\Ydiaeresis {\char"00178 } % LATIN CAPITAL LETTER Y WITH DIAERESIS: Ÿ -\def\Zacute {\char"00179 } % LATIN CAPITAL LETTER Z WITH ACUTE: Ź -\def\zacute {\char"0017A } % LATIN SMALL LETTER Z WITH ACUTE: ź -\def\Zdotaccent {\char"0017B } % LATIN CAPITAL LETTER Z WITH DOT ABOVE: Ż -\def\zdotaccent {\char"0017C } % LATIN SMALL LETTER Z WITH DOT ABOVE: ż -\def\Zcaron {\char"0017D } % LATIN CAPITAL LETTER Z WITH CARON: Ž -\def\zcaron {\char"0017E } % LATIN SMALL LETTER Z WITH CARON: ž -\def\slong {\char"0017F } % LATIN SMALL LETTER LONG S: ſ -\def\bstroke {\char"00180 } % LATIN SMALL LETTER B WITH STROKE: ƀ -\def\Bhook {\char"00181 } % LATIN CAPITAL LETTER B WITH HOOK: Ɓ -\def\Chook {\char"00187 } % LATIN CAPITAL LETTER C WITH HOOK: Ƈ -\def\chook {\char"00188 } % LATIN SMALL LETTER C WITH HOOK: ƈ -\def\Dafrican {\char"00189 } % LATIN CAPITAL LETTER AFRICAN D: Ɖ -\def\Dhook {\char"0018A } % LATIN CAPITAL LETTER D WITH HOOK: Ɗ -\def\Schwa {\char"0018F } % LATIN CAPITAL LETTER SCHWA: Ə -\def\Fhook {\char"00191 } % LATIN CAPITAL LETTER F WITH HOOK: Ƒ -\def\fhook {\char"00192 } % LATIN SMALL LETTER F WITH HOOK: ƒ -\def\Ghook {\char"00193 } % LATIN CAPITAL LETTER G WITH HOOK: Ɠ -\def\Istroke {\char"00197 } % LATIN CAPITAL LETTER I WITH STROKE: Ɨ -\def\Khook {\char"00198 } % LATIN CAPITAL LETTER K WITH HOOK: Ƙ -\def\khook {\char"00199 } % LATIN SMALL LETTER K WITH HOOK: ƙ -\def\lbar {\char"0019A } % LATIN SMALL LETTER L WITH BAR: ƚ -\def\Ohorn {\char"001A0 } % LATIN CAPITAL LETTER O WITH HORN: Ơ -\def\ohorn {\char"001A1 } % LATIN SMALL LETTER O WITH HORN: ơ -\def\Phook {\char"001A4 } % LATIN CAPITAL LETTER P WITH HOOK: Ƥ -\def\phook {\char"001A5 } % LATIN SMALL LETTER P WITH HOOK: ƥ -\def\Thook {\char"001AC } % LATIN CAPITAL LETTER T WITH HOOK: Ƭ -\def\thook {\char"001AD } % LATIN SMALL LETTER T WITH HOOK: ƭ -\def\Uhorn {\char"001AF } % LATIN CAPITAL LETTER U WITH HORN: Ư -\def\uhorn {\char"001B0 } % LATIN SMALL LETTER U WITH HORN: ư -\def\Uhook {\char"001B2 } % LATIN CAPITAL LETTER V WITH HOOK: Ʋ -\def\Yhook {\char"001B3 } % LATIN CAPITAL LETTER Y WITH HOOK: Ƴ -\def\yhook {\char"001B4 } % LATIN SMALL LETTER Y WITH HOOK: ƴ -\def\Zstroke {\char"001B5 } % LATIN CAPITAL LETTER Z WITH STROKE: Ƶ -\def\zstroke {\char"001B6 } % LATIN SMALL LETTER Z WITH STROKE: ƶ -\def\DZcaronligature {\char"001C4 } % LATIN CAPITAL LETTER DZ WITH CARON: DŽ -\def\Dzcaronligature {\char"001C5 } % LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON: Dž -\def\dzcaronligature {\char"001C6 } % LATIN SMALL LETTER DZ WITH CARON: dž -\def\LJligature {\char"001C7 } % LATIN CAPITAL LETTER LJ: LJ -\def\Ljligature {\char"001C8 } % LATIN CAPITAL LETTER L WITH SMALL LETTER J: Lj -\def\ljligature {\char"001C9 } % LATIN SMALL LETTER LJ: lj -\def\NJligature {\char"001CA } % LATIN CAPITAL LETTER NJ: NJ -\def\Njligature {\char"001CB } % LATIN CAPITAL LETTER N WITH SMALL LETTER J: Nj -\def\njligature {\char"001CC } % LATIN SMALL LETTER NJ: nj -\def\Acaron {\char"001CD } % LATIN CAPITAL LETTER A WITH CARON: Ǎ -\def\acaron {\char"001CE } % LATIN SMALL LETTER A WITH CARON: ǎ -\def\Icaron {\char"001CF } % LATIN CAPITAL LETTER I WITH CARON: Ǐ -\def\icaron {\char"001D0 } % LATIN SMALL LETTER I WITH CARON: ǐ -\def\Ocaron {\char"001D1 } % LATIN CAPITAL LETTER O WITH CARON: Ǒ -\def\ocaron {\char"001D2 } % LATIN SMALL LETTER O WITH CARON: ǒ -\def\Ucaron {\char"001D3 } % LATIN CAPITAL LETTER U WITH CARON: Ǔ -\def\ucaron {\char"001D4 } % LATIN SMALL LETTER U WITH CARON: ǔ -\def\Udiaeresismacron {\char"001D5 } % LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON: Ǖ -\def\udiaeresismacron {\char"001D6 } % LATIN SMALL LETTER U WITH DIAERESIS AND MACRON: ǖ -\def\Udiaeresisacute {\char"001D7 } % LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE: Ǘ -\def\udiaeresisacute {\char"001D8 } % LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE: ǘ -\def\Udiaeresiscaron {\char"001D9 } % LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON: Ǚ -\def\udiaeresiscaron {\char"001DA } % LATIN SMALL LETTER U WITH DIAERESIS AND CARON: ǚ -\def\Udiaeresisgrave {\char"001DB } % LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE: Ǜ -\def\udiaeresisgrave {\char"001DC } % LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE: ǜ -\def\Adiaeresismacron {\char"001DE } % LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON: Ǟ -\def\adiaeresismacron {\char"001DF } % LATIN SMALL LETTER A WITH DIAERESIS AND MACRON: ǟ -\def\Adotaccentmacron {\char"001E0 } % LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON: Ǡ -\def\adotaccentmacron {\char"001E1 } % LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON: ǡ -\def\AEmacron {\char"001E2 } % LATIN CAPITAL LETTER AE WITH MACRON: Ǣ -\def\aemacron {\char"001E3 } % LATIN SMALL LETTER AE WITH MACRON: ǣ -\def\Gstroke {\char"001E4 } % LATIN CAPITAL LETTER G WITH STROKE: Ǥ -\def\gstroke {\char"001E5 } % LATIN SMALL LETTER G WITH STROKE: ǥ -\def\Gcaron {\char"001E6 } % LATIN CAPITAL LETTER G WITH CARON: Ǧ -\def\gcaron {\char"001E7 } % LATIN SMALL LETTER G WITH CARON: ǧ -\def\Kcaron {\char"001E8 } % LATIN CAPITAL LETTER K WITH CARON: Ǩ -\def\kcaron {\char"001E9 } % LATIN SMALL LETTER K WITH CARON: ǩ -\def\Oogonek {\char"001EA } % LATIN CAPITAL LETTER O WITH OGONEK: Ǫ -\def\oogonek {\char"001EB } % LATIN SMALL LETTER O WITH OGONEK: ǫ -\def\Oogonekmacron {\char"001EC } % LATIN CAPITAL LETTER O WITH OGONEK AND MACRON: Ǭ -\def\oogonekmacron {\char"001ED } % LATIN SMALL LETTER O WITH OGONEK AND MACRON: ǭ -\def\jcaron {\char"001F0 } % LATIN SMALL LETTER J WITH CARON: ǰ -\def\DZligature {\char"001F1 } % LATIN CAPITAL LETTER DZ: DZ -\def\Dzligature {\char"001F2 } % LATIN CAPITAL LETTER D WITH SMALL LETTER Z: Dz -\def\dzligature {\char"001F3 } % LATIN SMALL LETTER DZ: dz -\def\Gacute {\char"001F4 } % LATIN CAPITAL LETTER G WITH ACUTE: Ǵ -\def\gacute {\char"001F5 } % LATIN SMALL LETTER G WITH ACUTE: ǵ -\def\Ngrave {\char"001F8 } % LATIN CAPITAL LETTER N WITH GRAVE: Ǹ -\def\ngrave {\char"001F9 } % LATIN SMALL LETTER N WITH GRAVE: ǹ -\def\Aringacute {\char"001FA } % LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE: Ǻ -\def\aringacute {\char"001FB } % LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE: ǻ -\def\AEacute {\char"001FC } % LATIN CAPITAL LETTER AE WITH ACUTE: Ǽ -\def\aeacute {\char"001FD } % LATIN SMALL LETTER AE WITH ACUTE: ǽ -\def\Ostrokeacute {\char"001FE } % LATIN CAPITAL LETTER O WITH STROKE AND ACUTE: Ǿ -\def\ostrokeacute {\char"001FF } % LATIN SMALL LETTER O WITH STROKE AND ACUTE: ǿ -\def\Adoublegrave {\char"00200 } % LATIN CAPITAL LETTER A WITH DOUBLE GRAVE: Ȁ -\def\adoublegrave {\char"00201 } % LATIN SMALL LETTER A WITH DOUBLE GRAVE: ȁ -\def\Ainvertedbreve {\char"00202 } % LATIN CAPITAL LETTER A WITH INVERTED BREVE: Ȃ -\def\ainvertedbreve {\char"00203 } % LATIN SMALL LETTER A WITH INVERTED BREVE: ȃ -\def\Edoublegrave {\char"00204 } % LATIN CAPITAL LETTER E WITH DOUBLE GRAVE: Ȅ -\def\edoublegrave {\char"00205 } % LATIN SMALL LETTER E WITH DOUBLE GRAVE: ȅ -\def\Einvertedbreve {\char"00206 } % LATIN CAPITAL LETTER E WITH INVERTED BREVE: Ȇ -\def\einvertedbreve {\char"00207 } % LATIN SMALL LETTER E WITH INVERTED BREVE: ȇ -\def\Idoublegrave {\char"00208 } % LATIN CAPITAL LETTER I WITH DOUBLE GRAVE: Ȉ -\def\idoublegrave {\char"00209 } % LATIN SMALL LETTER I WITH DOUBLE GRAVE: ȉ -\def\Iinvertedbreve {\char"0020A } % LATIN CAPITAL LETTER I WITH INVERTED BREVE: Ȋ -\def\iinvertedbreve {\char"0020B } % LATIN SMALL LETTER I WITH INVERTED BREVE: ȋ -\def\Odoublegrave {\char"0020C } % LATIN CAPITAL LETTER O WITH DOUBLE GRAVE: Ȍ -\def\odoublegrave {\char"0020D } % LATIN SMALL LETTER O WITH DOUBLE GRAVE: ȍ -\def\Oinvertedbreve {\char"0020E } % LATIN CAPITAL LETTER O WITH INVERTED BREVE: Ȏ -\def\oinvertedbreve {\char"0020F } % LATIN SMALL LETTER O WITH INVERTED BREVE: ȏ -\def\Rdoublegrave {\char"00210 } % LATIN CAPITAL LETTER R WITH DOUBLE GRAVE: Ȑ -\def\rdoublegrave {\char"00211 } % LATIN SMALL LETTER R WITH DOUBLE GRAVE: ȑ -\def\Rinvertedbreve {\char"00212 } % LATIN CAPITAL LETTER R WITH INVERTED BREVE: Ȓ -\def\rinvertedbreve {\char"00213 } % LATIN SMALL LETTER R WITH INVERTED BREVE: ȓ -\def\Udoublegrave {\char"00214 } % LATIN CAPITAL LETTER U WITH DOUBLE GRAVE: Ȕ -\def\udoublegrave {\char"00215 } % LATIN SMALL LETTER U WITH DOUBLE GRAVE: ȕ -\def\Uinvertedbreve {\char"00216 } % LATIN CAPITAL LETTER U WITH INVERTED BREVE: Ȗ -\def\uinvertedbreve {\char"00217 } % LATIN SMALL LETTER U WITH INVERTED BREVE: ȗ -\def\Scommaaccent {\char"00218 } % LATIN CAPITAL LETTER S WITH COMMA BELOW: Ș -\def\scommaaccent {\char"00219 } % LATIN SMALL LETTER S WITH COMMA BELOW: ș -\def\Tcommaaccent {\char"0021A } % LATIN CAPITAL LETTER T WITH COMMA BELOW: Ț -\def\tcommaaccent {\char"0021B } % LATIN SMALL LETTER T WITH COMMA BELOW: ț -\def\Hcaron {\char"0021E } % LATIN CAPITAL LETTER H WITH CARON: Ȟ -\def\hcaron {\char"0021F } % LATIN SMALL LETTER H WITH CARON: ȟ -\def\dcurl {\char"00221 } % LATIN SMALL LETTER D WITH CURL: ȡ -\def\Zhook {\char"00224 } % LATIN CAPITAL LETTER Z WITH HOOK: Ȥ -\def\zhook {\char"00225 } % LATIN SMALL LETTER Z WITH HOOK: ȥ -\def\Adotaccent {\char"00226 } % LATIN CAPITAL LETTER A WITH DOT ABOVE: Ȧ -\def\adotaccent {\char"00227 } % LATIN SMALL LETTER A WITH DOT ABOVE: ȧ -\def\Ecedilla {\char"00228 } % LATIN CAPITAL LETTER E WITH CEDILLA: Ȩ -\def\ecedilla {\char"00229 } % LATIN SMALL LETTER E WITH CEDILLA: ȩ -\def\Odiaeresismacron {\char"0022A } % LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON: Ȫ -\def\odiaeresismacron {\char"0022B } % LATIN SMALL LETTER O WITH DIAERESIS AND MACRON: ȫ -\def\Otildemacron {\char"0022C } % LATIN CAPITAL LETTER O WITH TILDE AND MACRON: Ȭ -\def\otildemacron {\char"0022D } % LATIN SMALL LETTER O WITH TILDE AND MACRON: ȭ -\def\Odotaccent {\char"0022E } % LATIN CAPITAL LETTER O WITH DOT ABOVE: Ȯ -\def\odotaccent {\char"0022F } % LATIN SMALL LETTER O WITH DOT ABOVE: ȯ -\def\Odotaccentmacron {\char"00230 } % LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON: Ȱ -\def\odotaccentmacron {\char"00231 } % LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON: ȱ -\def\Ymacron {\char"00232 } % LATIN CAPITAL LETTER Y WITH MACRON: Ȳ -\def\ymacron {\char"00233 } % LATIN SMALL LETTER Y WITH MACRON: ȳ -\def\lcurl {\char"00234 } % LATIN SMALL LETTER L WITH CURL: ȴ -\def\ncurl {\char"00235 } % LATIN SMALL LETTER N WITH CURL: ȵ -\def\tcurl {\char"00236 } % LATIN SMALL LETTER T WITH CURL: ȶ -\def\dotlessj {\char"00237 } % LATIN SMALL LETTER DOTLESS J: ȷ -\def\Astroke {\char"0023A } % LATIN CAPITAL LETTER A WITH STROKE: Ⱥ -\def\Cstroke {\char"0023B } % LATIN CAPITAL LETTER C WITH STROKE: Ȼ -\def\cstroke {\char"0023C } % LATIN SMALL LETTER C WITH STROKE: ȼ -\def\Lbar {\char"0023D } % LATIN CAPITAL LETTER L WITH BAR: Ƚ -\def\bhook {\char"00253 } % LATIN SMALL LETTER B WITH HOOK: ɓ -\def\ccurl {\char"00255 } % LATIN SMALL LETTER C WITH CURL: ɕ -\def\dtail {\char"00256 } % LATIN SMALL LETTER D WITH TAIL: ɖ -\def\dhook {\char"00257 } % LATIN SMALL LETTER D WITH HOOK: ɗ -\def\schwa {\char"00259 } % LATIN SMALL LETTER SCHWA: ə -\def\schwahook {\char"0025A } % LATIN SMALL LETTER SCHWA WITH HOOK: ɚ -\def\dotlessjstroke {\char"0025F } % LATIN SMALL LETTER DOTLESS J WITH STROKE: ɟ -\def\textcircumflex {\char"002C6 } % MODIFIER LETTER CIRCUMFLEX ACCENT: ˆ -\def\textcaron {\char"002C7 } % CARON: ˇ -\def\textbreve {\char"002D8 } % BREVE: ˘ -\def\textdotaccent {\char"002D9 } % DOT ABOVE: ˙ -\def\textring {\char"002DA } % RING ABOVE: ˚ -\def\textogonek {\char"002DB } % OGONEK: ˛ -\def\texttilde {\char"002DC } % SMALL TILDE: ˜ -\def\texthungarumlaut {\char"002DD } % DOUBLE ACUTE ACCENT: ˝ -\def\textbottomdot {\char"00323 } % COMBINING DOT BELOW: ̣ -\def\textbottomcomma {\char"00326 } % COMBINING COMMA BELOW: ̦ -\def\greektonos {\char"00384 } % GREEK TONOS: ΄ -\def\greekdialytikatonos {\char"00385 } % GREEK DIALYTIKA TONOS: ΅ -\def\greekAlphatonos {\char"00386 } % GREEK CAPITAL LETTER ALPHA WITH TONOS: Ά -\def\greekEpsilontonos {\char"00388 } % GREEK CAPITAL LETTER EPSILON WITH TONOS: Έ -\def\greekEtatonos {\char"00389 } % GREEK CAPITAL LETTER ETA WITH TONOS: Ή -\def\greekIotatonos {\char"0038A } % GREEK CAPITAL LETTER IOTA WITH TONOS: Ί -\def\greekOmicrontonos {\char"0038C } % GREEK CAPITAL LETTER OMICRON WITH TONOS: Ό -\def\greekUpsilontonos {\char"0038E } % GREEK CAPITAL LETTER UPSILON WITH TONOS: Ύ -\def\greekOmegatonos {\char"0038F } % GREEK CAPITAL LETTER OMEGA WITH TONOS: Ώ -\def\greekiotadialytikatonos {\char"00390 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS: ΐ -\def\greekAlpha {\char"00391 } % GREEK CAPITAL LETTER ALPHA: Α -\def\greekBeta {\char"00392 } % GREEK CAPITAL LETTER BETA: Β -\def\greekGamma {\char"00393 } % GREEK CAPITAL LETTER GAMMA: Γ -\def\greekDelta {\char"00394 } % GREEK CAPITAL LETTER DELTA: Δ -\def\greekEpsilon {\char"00395 } % GREEK CAPITAL LETTER EPSILON: Ε -\def\greekZeta {\char"00396 } % GREEK CAPITAL LETTER ZETA: Ζ -\def\greekEta {\char"00397 } % GREEK CAPITAL LETTER ETA: Η -\def\greekTheta {\char"00398 } % GREEK CAPITAL LETTER THETA: Θ -\def\greekIota {\char"00399 } % GREEK CAPITAL LETTER IOTA: Ι -\def\greekKappa {\char"0039A } % GREEK CAPITAL LETTER KAPPA: Κ -\def\greekLambda {\char"0039B } % GREEK CAPITAL LETTER LAMDA: Λ -\def\greekMu {\char"0039C } % GREEK CAPITAL LETTER MU: Μ -\def\greekNu {\char"0039D } % GREEK CAPITAL LETTER NU: Ν -\def\greekXi {\char"0039E } % GREEK CAPITAL LETTER XI: Ξ -\def\greekOmicron {\char"0039F } % GREEK CAPITAL LETTER OMICRON: Ο -\def\greekPi {\char"003A0 } % GREEK CAPITAL LETTER PI: Π -\def\greekRho {\char"003A1 } % GREEK CAPITAL LETTER RHO: Ρ -\def\greekSigma {\char"003A3 } % GREEK CAPITAL LETTER SIGMA: Σ -\def\greekTau {\char"003A4 } % GREEK CAPITAL LETTER TAU: Τ -\def\greekUpsilon {\char"003A5 } % GREEK CAPITAL LETTER UPSILON: Υ -\def\greekPhi {\char"003A6 } % GREEK CAPITAL LETTER PHI: Φ -\def\greekChi {\char"003A7 } % GREEK CAPITAL LETTER CHI: Χ -\def\greekPsi {\char"003A8 } % GREEK CAPITAL LETTER PSI: Ψ -\def\greekOmega {\char"003A9 } % GREEK CAPITAL LETTER OMEGA: Ω -\def\greekIotadialytika {\char"003AA } % GREEK CAPITAL LETTER IOTA WITH DIALYTIKA: Ϊ -\def\greekUpsilondialytika {\char"003AB } % GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA: Ϋ -\def\greekalphatonos {\char"003AC } % GREEK SMALL LETTER ALPHA WITH TONOS: ά -\def\greekepsilontonos {\char"003AD } % GREEK SMALL LETTER EPSILON WITH TONOS: έ -\def\greeketatonos {\char"003AE } % GREEK SMALL LETTER ETA WITH TONOS: ή -\def\greekiotatonos {\char"003AF } % GREEK SMALL LETTER IOTA WITH TONOS: ί -\def\greekupsilondialytikatonos {\char"003B0 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS: ΰ -\def\greekalpha {\char"003B1 } % GREEK SMALL LETTER ALPHA: α -\def\greekbeta {\char"003B2 } % GREEK SMALL LETTER BETA: β -\def\greekgamma {\char"003B3 } % GREEK SMALL LETTER GAMMA: γ -\def\greekdelta {\char"003B4 } % GREEK SMALL LETTER DELTA: δ -\def\greekepsilon {\char"003B5 } % GREEK SMALL LETTER EPSILON: ε -\def\greekzeta {\char"003B6 } % GREEK SMALL LETTER ZETA: ζ -\def\greeketa {\char"003B7 } % GREEK SMALL LETTER ETA: η -\def\greektheta {\char"003B8 } % GREEK SMALL LETTER THETA: θ -\def\greekiota {\char"003B9 } % GREEK SMALL LETTER IOTA: ι -\def\greekkappa {\char"003BA } % GREEK SMALL LETTER KAPPA: κ -\def\greeklambda {\char"003BB } % GREEK SMALL LETTER LAMDA: λ -\def\greekmu {\char"003BC } % GREEK SMALL LETTER MU: μ -\def\greeknu {\char"003BD } % GREEK SMALL LETTER NU: ν -\def\greekxi {\char"003BE } % GREEK SMALL LETTER XI: ξ -\def\greekomicron {\char"003BF } % GREEK SMALL LETTER OMICRON: ο -\def\greekpi {\char"003C0 } % GREEK SMALL LETTER PI: π -\def\greekrho {\char"003C1 } % GREEK SMALL LETTER RHO: ρ -\def\greekfinalsigma {\char"003C2 } % GREEK SMALL LETTER FINAL SIGMA: ς -\def\greeksigma {\char"003C3 } % GREEK SMALL LETTER SIGMA: σ -\def\greektau {\char"003C4 } % GREEK SMALL LETTER TAU: τ -\def\greekupsilon {\char"003C5 } % GREEK SMALL LETTER UPSILON: υ -\def\greekphi {\char"003C6 } % GREEK SMALL LETTER PHI: φ -\def\greekchi {\char"003C7 } % GREEK SMALL LETTER CHI: χ -\def\greekpsi {\char"003C8 } % GREEK SMALL LETTER PSI: ψ -\def\greekomega {\char"003C9 } % GREEK SMALL LETTER OMEGA: ω -\def\greekiotadialytika {\char"003CA } % GREEK SMALL LETTER IOTA WITH DIALYTIKA: ϊ -\def\greekupsilondiaeresis {\char"003CB } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA: ϋ -\def\greekomicrontonos {\char"003CC } % GREEK SMALL LETTER OMICRON WITH TONOS: ό -\def\greekupsilontonos {\char"003CD } % GREEK SMALL LETTER UPSILON WITH TONOS: ύ -\def\greekomegatonos {\char"003CE } % GREEK SMALL LETTER OMEGA WITH TONOS: ώ -\def\greekthetaalt {\char"003D1 } % GREEK THETA SYMBOL: ϑ -\def\greekphialt {\char"003D5 } % GREEK PHI SYMBOL: ϕ -\def\greekpialt {\char"003D6 } % GREEK PI SYMBOL: ϖ -\def\greekkoppa {\char"003D9 } % GREEK SMALL LETTER ARCHAIC KOPPA: ϙ -\def\greekstigma {\char"003DB } % GREEK SMALL LETTER STIGMA: ϛ -\def\greekdigamma {\char"003DD } % GREEK SMALL LETTER DIGAMMA: ϝ -\def\greeknumkoppa {\char"003DF } % GREEK SMALL LETTER KOPPA: ϟ -\def\greeksampi {\char"003E1 } % GREEK SMALL LETTER SAMPI: ϡ -\def\greekrhoalt {\char"003F1 } % GREEK RHO SYMBOL: ϱ -\def\greeksigmalunate {\char"003F2 } % GREEK LUNATE SIGMA SYMBOL: ϲ -\def\greekepsilonalt {\char"003F5 } % GREEK LUNATE EPSILON SYMBOL: ϵ -\def\greekSigmalunate {\char"003F9 } % GREEK CAPITAL LUNATE SIGMA SYMBOL: Ϲ -\def\cyrillicEgrave {\char"00400 } % CYRILLIC CAPITAL LETTER IE WITH GRAVE: Ѐ -\def\cyrillicYO {\char"00401 } % CYRILLIC CAPITAL LETTER IO: Ё -\def\cyrillicDJE {\char"00402 } % CYRILLIC CAPITAL LETTER DJE: Ђ -\def\cyrillicGJE {\char"00403 } % CYRILLIC CAPITAL LETTER GJE: Ѓ -\def\cyrillicIE {\char"00404 } % CYRILLIC CAPITAL LETTER UKRAINIAN IE: Є -\def\cyrillicDZE {\char"00405 } % CYRILLIC CAPITAL LETTER DZE: Ѕ -\def\cyrillicII {\char"00406 } % CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I: І -\def\cyrillicYI {\char"00407 } % CYRILLIC CAPITAL LETTER YI: Ї -\def\cyrillicJE {\char"00408 } % CYRILLIC CAPITAL LETTER JE: Ј -\def\cyrillicLJE {\char"00409 } % CYRILLIC CAPITAL LETTER LJE: Љ -\def\cyrillicNJE {\char"0040A } % CYRILLIC CAPITAL LETTER NJE: Њ -\def\cyrillicTSHE {\char"0040B } % CYRILLIC CAPITAL LETTER TSHE: Ћ -\def\cyrillicKJE {\char"0040C } % CYRILLIC CAPITAL LETTER KJE: Ќ -\def\cyrillicIgrave {\char"0040D } % CYRILLIC CAPITAL LETTER I WITH GRAVE: Ѝ -\def\cyrillicUSHRT {\char"0040E } % CYRILLIC CAPITAL LETTER SHORT U: Ў -\def\cyrillicDZHE {\char"0040F } % CYRILLIC CAPITAL LETTER DZHE: Џ -\def\cyrillicA {\char"00410 } % CYRILLIC CAPITAL LETTER A: А -\def\cyrillicB {\char"00411 } % CYRILLIC CAPITAL LETTER BE: Б -\def\cyrillicV {\char"00412 } % CYRILLIC CAPITAL LETTER VE: В -\def\cyrillicG {\char"00413 } % CYRILLIC CAPITAL LETTER GHE: Г -\def\cyrillicD {\char"00414 } % CYRILLIC CAPITAL LETTER DE: Д -\def\cyrillicE {\char"00415 } % CYRILLIC CAPITAL LETTER IE: Е -\def\cyrillicZH {\char"00416 } % CYRILLIC CAPITAL LETTER ZHE: Ж -\def\cyrillicZ {\char"00417 } % CYRILLIC CAPITAL LETTER ZE: З -\def\cyrillicI {\char"00418 } % CYRILLIC CAPITAL LETTER I: И -\def\cyrillicISHRT {\char"00419 } % CYRILLIC CAPITAL LETTER SHORT I: Й -\def\cyrillicK {\char"0041A } % CYRILLIC CAPITAL LETTER KA: К -\def\cyrillicL {\char"0041B } % CYRILLIC CAPITAL LETTER EL: Л -\def\cyrillicM {\char"0041C } % CYRILLIC CAPITAL LETTER EM: М -\def\cyrillicN {\char"0041D } % CYRILLIC CAPITAL LETTER EN: Н -\def\cyrillicO {\char"0041E } % CYRILLIC CAPITAL LETTER O: О -\def\cyrillicP {\char"0041F } % CYRILLIC CAPITAL LETTER PE: П -\def\cyrillicR {\char"00420 } % CYRILLIC CAPITAL LETTER ER: Р -\def\cyrillicS {\char"00421 } % CYRILLIC CAPITAL LETTER ES: С -\def\cyrillicT {\char"00422 } % CYRILLIC CAPITAL LETTER TE: Т -\def\cyrillicU {\char"00423 } % CYRILLIC CAPITAL LETTER U: У -\def\cyrillicF {\char"00424 } % CYRILLIC CAPITAL LETTER EF: Ф -\def\cyrillicH {\char"00425 } % CYRILLIC CAPITAL LETTER HA: Х -\def\cyrillicC {\char"00426 } % CYRILLIC CAPITAL LETTER TSE: Ц -\def\cyrillicCH {\char"00427 } % CYRILLIC CAPITAL LETTER CHE: Ч -\def\cyrillicSH {\char"00428 } % CYRILLIC CAPITAL LETTER SHA: Ш -\def\cyrillicSHCH {\char"00429 } % CYRILLIC CAPITAL LETTER SHCHA: Щ -\def\cyrillicHRDSN {\char"0042A } % CYRILLIC CAPITAL LETTER HARD SIGN: Ъ -\def\cyrillicERY {\char"0042B } % CYRILLIC CAPITAL LETTER YERU: Ы -\def\cyrillicSFTSN {\char"0042C } % CYRILLIC CAPITAL LETTER SOFT SIGN: Ь -\def\cyrillicEREV {\char"0042D } % CYRILLIC CAPITAL LETTER E: Э -\def\cyrillicYU {\char"0042E } % CYRILLIC CAPITAL LETTER YU: Ю -\def\cyrillicYA {\char"0042F } % CYRILLIC CAPITAL LETTER YA: Я -\def\cyrillica {\char"00430 } % CYRILLIC SMALL LETTER A: а -\def\cyrillicb {\char"00431 } % CYRILLIC SMALL LETTER BE: б -\def\cyrillicv {\char"00432 } % CYRILLIC SMALL LETTER VE: в -\def\cyrillicg {\char"00433 } % CYRILLIC SMALL LETTER GHE: г -\def\cyrillicd {\char"00434 } % CYRILLIC SMALL LETTER DE: д -\def\cyrillice {\char"00435 } % CYRILLIC SMALL LETTER IE: е -\def\cyrilliczh {\char"00436 } % CYRILLIC SMALL LETTER ZHE: ж -\def\cyrillicz {\char"00437 } % CYRILLIC SMALL LETTER ZE: з -\def\cyrillici {\char"00438 } % CYRILLIC SMALL LETTER I: и -\def\cyrillicishrt {\char"00439 } % CYRILLIC SMALL LETTER SHORT I: й -\def\cyrillick {\char"0043A } % CYRILLIC SMALL LETTER KA: к -\def\cyrillicl {\char"0043B } % CYRILLIC SMALL LETTER EL: л -\def\cyrillicm {\char"0043C } % CYRILLIC SMALL LETTER EM: м -\def\cyrillicn {\char"0043D } % CYRILLIC SMALL LETTER EN: н -\def\cyrillico {\char"0043E } % CYRILLIC SMALL LETTER O: о -\def\cyrillicp {\char"0043F } % CYRILLIC SMALL LETTER PE: п -\def\cyrillicr {\char"00440 } % CYRILLIC SMALL LETTER ER: р -\def\cyrillics {\char"00441 } % CYRILLIC SMALL LETTER ES: с -\def\cyrillict {\char"00442 } % CYRILLIC SMALL LETTER TE: т -\def\cyrillicu {\char"00443 } % CYRILLIC SMALL LETTER U: у -\def\cyrillicf {\char"00444 } % CYRILLIC SMALL LETTER EF: ф -\def\cyrillich {\char"00445 } % CYRILLIC SMALL LETTER HA: х -\def\cyrillicc {\char"00446 } % CYRILLIC SMALL LETTER TSE: ц -\def\cyrillicch {\char"00447 } % CYRILLIC SMALL LETTER CHE: ч -\def\cyrillicsh {\char"00448 } % CYRILLIC SMALL LETTER SHA: ш -\def\cyrillicshch {\char"00449 } % CYRILLIC SMALL LETTER SHCHA: щ -\def\cyrillichrdsn {\char"0044A } % CYRILLIC SMALL LETTER HARD SIGN: ъ -\def\cyrillicery {\char"0044B } % CYRILLIC SMALL LETTER YERU: ы -\def\cyrillicsftsn {\char"0044C } % CYRILLIC SMALL LETTER SOFT SIGN: ь -\def\cyrillicerev {\char"0044D } % CYRILLIC SMALL LETTER E: э -\def\cyrillicyu {\char"0044E } % CYRILLIC SMALL LETTER YU: ю -\def\cyrillicya {\char"0044F } % CYRILLIC SMALL LETTER YA: я -\def\cyrillicegrave {\char"00450 } % CYRILLIC SMALL LETTER IE WITH GRAVE: ѐ -\def\cyrillicyo {\char"00451 } % CYRILLIC SMALL LETTER IO: ё -\def\cyrillicdje {\char"00452 } % CYRILLIC SMALL LETTER DJE: ђ -\def\cyrillicgje {\char"00453 } % CYRILLIC SMALL LETTER GJE: ѓ -\def\cyrillicie {\char"00454 } % CYRILLIC SMALL LETTER UKRAINIAN IE: є -\def\cyrillicdze {\char"00455 } % CYRILLIC SMALL LETTER DZE: ѕ -\def\cyrillicii {\char"00456 } % CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I: і -\def\cyrillicyi {\char"00457 } % CYRILLIC SMALL LETTER YI: ї -\def\cyrillicje {\char"00458 } % CYRILLIC SMALL LETTER JE: ј -\def\cyrilliclje {\char"00459 } % CYRILLIC SMALL LETTER LJE: љ -\def\cyrillicnje {\char"0045A } % CYRILLIC SMALL LETTER NJE: њ -\def\cyrillictshe {\char"0045B } % CYRILLIC SMALL LETTER TSHE: ћ -\def\cyrillickje {\char"0045C } % CYRILLIC SMALL LETTER KJE: ќ -\def\cyrillicigrave {\char"0045D } % CYRILLIC SMALL LETTER I WITH GRAVE: ѝ -\def\cyrillicushrt {\char"0045E } % CYRILLIC SMALL LETTER SHORT U: ў -\def\cyrillicdzhe {\char"0045F } % CYRILLIC SMALL LETTER DZHE: џ -\def\cyrillicOMEGA {\char"00460 } % CYRILLIC CAPITAL LETTER OMEGA: Ѡ -\def\cyrillicomega {\char"00461 } % CYRILLIC SMALL LETTER OMEGA: ѡ -\def\cyrillicYAT {\char"00462 } % CYRILLIC CAPITAL LETTER YAT: Ѣ -\def\cyrillicyat {\char"00463 } % CYRILLIC SMALL LETTER YAT: ѣ -\def\cyrillicEiotified {\char"00464 } % CYRILLIC CAPITAL LETTER IOTIFIED E: Ѥ -\def\cyrilliceiotified {\char"00465 } % CYRILLIC SMALL LETTER IOTIFIED E: ѥ -\def\cyrillicLITTLEYUS {\char"00466 } % CYRILLIC CAPITAL LETTER LITTLE YUS: Ѧ -\def\cyrilliclittleyus {\char"00467 } % CYRILLIC SMALL LETTER LITTLE YUS: ѧ -\def\cyrillicLITTLEYUSiotified {\char"00468 } % CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS: Ѩ -\def\cyrilliclittleyusiotified {\char"00469 } % CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS: ѩ -\def\cyrillicBIGYUS {\char"0046A } % CYRILLIC CAPITAL LETTER BIG YUS: Ѫ -\def\cyrillicbigyus {\char"0046B } % CYRILLIC SMALL LETTER BIG YUS: ѫ -\def\cyrillicBIGYUSiotified {\char"0046C } % CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS: Ѭ -\def\cyrillicbigyusiotified {\char"0046D } % CYRILLIC SMALL LETTER IOTIFIED BIG YUS: ѭ -\def\cyrillicKSI {\char"0046E } % CYRILLIC CAPITAL LETTER KSI: Ѯ -\def\cyrillicksi {\char"0046F } % CYRILLIC SMALL LETTER KSI: ѯ -\def\cyrillicPSI {\char"00470 } % CYRILLIC CAPITAL LETTER PSI: Ѱ -\def\cyrillicpsi {\char"00471 } % CYRILLIC SMALL LETTER PSI: ѱ -\def\cyrillicFITA {\char"00472 } % CYRILLIC CAPITAL LETTER FITA: Ѳ -\def\cyrillicfita {\char"00473 } % CYRILLIC SMALL LETTER FITA: ѳ -\def\cyrillicIZHITSA {\char"00474 } % CYRILLIC CAPITAL LETTER IZHITSA: Ѵ -\def\cyrillicizhitsa {\char"00475 } % CYRILLIC SMALL LETTER IZHITSA: ѵ -\def\cyrillicIZHITSAdoublegrave {\char"00476 } % CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT: Ѷ -\def\cyrillicizhitsadoublegrave {\char"00477 } % CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT: ѷ -\def\cyrillicUK {\char"00478 } % CYRILLIC CAPITAL LETTER UK: Ѹ -\def\cyrillicuk {\char"00479 } % CYRILLIC SMALL LETTER UK: ѹ -\def\cyrillicOMEGAround {\char"0047A } % CYRILLIC CAPITAL LETTER ROUND OMEGA: Ѻ -\def\cyrillicomegaround {\char"0047B } % CYRILLIC SMALL LETTER ROUND OMEGA: ѻ -\def\cyrillicOMEGAtitlo {\char"0047C } % CYRILLIC CAPITAL LETTER OMEGA WITH TITLO: Ѽ -\def\cyrillicomegatitlo {\char"0047D } % CYRILLIC SMALL LETTER OMEGA WITH TITLO: ѽ -\def\cyrillicOT {\char"0047E } % CYRILLIC CAPITAL LETTER OT: Ѿ -\def\cyrillicot {\char"0047F } % CYRILLIC SMALL LETTER OT: ѿ -\def\cyrillicKOPPA {\char"00480 } % CYRILLIC CAPITAL LETTER KOPPA: Ҁ -\def\cyrillickoppa {\char"00481 } % CYRILLIC SMALL LETTER KOPPA: ҁ -\def\cyrillicTITLO {\char"00483 } % COMBINING CYRILLIC TITLO: ҃ -\def\cyrillicPALATALIZATION {\char"00484 } % COMBINING CYRILLIC PALATALIZATION: ҄ -\def\cyrillicDASIAPNEUMATA {\char"00485 } % COMBINING CYRILLIC DASIA PNEUMATA: ҅ -\def\cyrillicPSILIPNEUMATA {\char"00486 } % COMBINING CYRILLIC PSILI PNEUMATA: ҆ -\def\cyrillicISHRTtail {\char"0048A } % CYRILLIC CAPITAL LETTER SHORT I WITH TAIL: Ҋ -\def\cyrillicishrttail {\char"0048B } % CYRILLIC SMALL LETTER SHORT I WITH TAIL: ҋ -\def\cyrillicSEMISOFT {\char"0048C } % CYRILLIC CAPITAL LETTER SEMISOFT SIGN: Ҍ -\def\cyrillicsemisoft {\char"0048D } % CYRILLIC SMALL LETTER SEMISOFT SIGN: ҍ -\def\cyrillicERtick {\char"0048E } % CYRILLIC CAPITAL LETTER ER WITH TICK: Ҏ -\def\cyrillicertick {\char"0048F } % CYRILLIC SMALL LETTER ER WITH TICK: ҏ -\def\cyrillicGHEupturn {\char"00490 } % CYRILLIC CAPITAL LETTER GHE WITH UPTURN: Ґ -\def\cyrillicgheupturn {\char"00491 } % CYRILLIC SMALL LETTER GHE WITH UPTURN: ґ -\def\cyrillicGHEstroke {\char"00492 } % CYRILLIC CAPITAL LETTER GHE WITH STROKE: Ғ -\def\cyrillicghestroke {\char"00493 } % CYRILLIC SMALL LETTER GHE WITH STROKE: ғ -\def\cyrillicGHEmidhook {\char"00494 } % CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK: Ҕ -\def\cyrillicghemidhook {\char"00495 } % CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK: ҕ -\def\cyrillicZHEdescender {\char"00496 } % CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER: Җ -\def\cyrilliczhedescender {\char"00497 } % CYRILLIC SMALL LETTER ZHE WITH DESCENDER: җ -\def\cyrillicZDSC {\char"00498 } % CYRILLIC CAPITAL LETTER ZE WITH DESCENDER: Ҙ -\def\cyrilliczdsc {\char"00499 } % CYRILLIC SMALL LETTER ZE WITH DESCENDER: ҙ -\def\cyrillicKADC {\char"0049A } % CYRILLIC CAPITAL LETTER KA WITH DESCENDER: Қ -\def\cyrillickadc {\char"0049B } % CYRILLIC SMALL LETTER KA WITH DESCENDER: қ -\def\cyrillicKAvertstroke {\char"0049C } % CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE: Ҝ -\def\cyrillickavertstroke {\char"0049D } % CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE: ҝ -\def\cyrillicKAstroke {\char"0049E } % CYRILLIC CAPITAL LETTER KA WITH STROKE: Ҟ -\def\cyrillickastroke {\char"0049F } % CYRILLIC SMALL LETTER KA WITH STROKE: ҟ -\def\cyrillicKAbashkir {\char"004A0 } % CYRILLIC CAPITAL LETTER BASHKIR KA: Ҡ -\def\cyrillickabashkir {\char"004A1 } % CYRILLIC SMALL LETTER BASHKIR KA: ҡ -\def\cyrillicENDC {\char"004A2 } % CYRILLIC CAPITAL LETTER EN WITH DESCENDER: Ң -\def\cyrillicendc {\char"004A3 } % CYRILLIC SMALL LETTER EN WITH DESCENDER: ң -\def\cyrillicENGHE {\char"004A4 } % CYRILLIC CAPITAL LIGATURE EN GHE: Ҥ -\def\cyrillicenghe {\char"004A5 } % CYRILLIC SMALL LIGATURE EN GHE: ҥ -\def\cyrillicPEmidhook {\char"004A6 } % CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK: Ҧ -\def\cyrillicpemidhook {\char"004A7 } % CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK: ҧ -\def\cyrillicHA {\char"004A8 } % CYRILLIC CAPITAL LETTER ABKHASIAN HA: Ҩ -\def\cyrillicha {\char"004A9 } % CYRILLIC SMALL LETTER ABKHASIAN HA: ҩ -\def\cyrillicSDSC {\char"004AA } % CYRILLIC CAPITAL LETTER ES WITH DESCENDER: Ҫ -\def\cyrillicsdsc {\char"004AB } % CYRILLIC SMALL LETTER ES WITH DESCENDER: ҫ -\def\cyrillicTEDC {\char"004AC } % CYRILLIC CAPITAL LETTER TE WITH DESCENDER: Ҭ -\def\cyrillictedc {\char"004AD } % CYRILLIC SMALL LETTER TE WITH DESCENDER: ҭ -\def\cyrillicYstr {\char"004AE } % CYRILLIC CAPITAL LETTER STRAIGHT U: Ү -\def\cyrillicystr {\char"004AF } % CYRILLIC SMALL LETTER STRAIGHT U: ү -\def\cyrillicYstrstroke {\char"004B0 } % CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE: Ұ -\def\cyrillicystrstroke {\char"004B1 } % CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE: ұ -\def\cyrillicHADC {\char"004B2 } % CYRILLIC CAPITAL LETTER HA WITH DESCENDER: Ҳ -\def\cyrillichadc {\char"004B3 } % CYRILLIC SMALL LETTER HA WITH DESCENDER: ҳ -\def\cyrillicTETSE {\char"004B4 } % CYRILLIC CAPITAL LIGATURE TE TSE: Ҵ -\def\cyrillictetse {\char"004B5 } % CYRILLIC SMALL LIGATURE TE TSE: ҵ -\def\cyrillicCHEDC {\char"004B6 } % CYRILLIC CAPITAL LETTER CHE WITH DESCENDER: Ҷ -\def\cyrillicchedc {\char"004B7 } % CYRILLIC SMALL LETTER CHE WITH DESCENDER: ҷ -\def\cyrillicCHEvertstroke {\char"004B8 } % CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE: Ҹ -\def\cyrillicchevertstroke {\char"004B9 } % CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE: ҹ -\def\cyrillicSHHA {\char"004BA } % CYRILLIC CAPITAL LETTER SHHA: Һ -\def\cyrillicshha {\char"004BB } % CYRILLIC SMALL LETTER SHHA: һ -\def\cyrillicCHEabkhasian {\char"004BC } % CYRILLIC CAPITAL LETTER ABKHASIAN CHE: Ҽ -\def\cyrilliccheabkhasian {\char"004BD } % CYRILLIC SMALL LETTER ABKHASIAN CHE: ҽ -\def\cyrillicCHEDCabkhasian {\char"004BE } % CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER: Ҿ -\def\cyrillicchedcabkhasian {\char"004BF } % CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER: ҿ -\def\cyrillicPALOCHKA {\char"004C0 } % CYRILLIC LETTER PALOCHKA: Ӏ -\def\cyrillicZHEbreve {\char"004C1 } % CYRILLIC CAPITAL LETTER ZHE WITH BREVE: Ӂ -\def\cyrilliczhebreve {\char"004C2 } % CYRILLIC SMALL LETTER ZHE WITH BREVE: ӂ -\def\cyrillicKAhook {\char"004C3 } % CYRILLIC CAPITAL LETTER KA WITH HOOK: Ӄ -\def\cyrillickahook {\char"004C4 } % CYRILLIC SMALL LETTER KA WITH HOOK: ӄ -\def\cyrillicELtail {\char"004C5 } % CYRILLIC CAPITAL LETTER EL WITH TAIL: Ӆ -\def\cyrilliceltail {\char"004C6 } % CYRILLIC SMALL LETTER EL WITH TAIL: ӆ -\def\cyrillicENhook {\char"004C7 } % CYRILLIC CAPITAL LETTER EN WITH HOOK: Ӈ -\def\cyrillicenhook {\char"004C8 } % CYRILLIC SMALL LETTER EN WITH HOOK: ӈ -\def\cyrillicENtail {\char"004C9 } % CYRILLIC CAPITAL LETTER EN WITH TAIL: Ӊ -\def\cyrillicentail {\char"004CA } % CYRILLIC SMALL LETTER EN WITH TAIL: ӊ -\def\cyrillicCHEkhakassian {\char"004CB } % CYRILLIC CAPITAL LETTER KHAKASSIAN CHE: Ӌ -\def\cyrillicchekhakassian {\char"004CC } % CYRILLIC SMALL LETTER KHAKASSIAN CHE: ӌ -\def\cyrillicEMtail {\char"004CD } % CYRILLIC CAPITAL LETTER EM WITH TAIL: Ӎ -\def\cyrillicemtail {\char"004CE } % CYRILLIC SMALL LETTER EM WITH TAIL: ӎ -\def\cyrillicAbreve {\char"004D0 } % CYRILLIC CAPITAL LETTER A WITH BREVE: Ӑ -\def\cyrillicabreve {\char"004D1 } % CYRILLIC SMALL LETTER A WITH BREVE: ӑ -\def\cyrillicAdiaeresis {\char"004D2 } % CYRILLIC CAPITAL LETTER A WITH DIAERESIS: Ӓ -\def\cyrillicadiaeresis {\char"004D3 } % CYRILLIC SMALL LETTER A WITH DIAERESIS: ӓ -\def\cyrillicAE {\char"004D4 } % CYRILLIC CAPITAL LIGATURE A IE: Ӕ -\def\cyrillicae {\char"004D5 } % CYRILLIC SMALL LIGATURE A IE: ӕ -\def\cyrillicEbreve {\char"004D6 } % CYRILLIC CAPITAL LETTER IE WITH BREVE: Ӗ -\def\cyrillicebreve {\char"004D7 } % CYRILLIC SMALL LETTER IE WITH BREVE: ӗ -\def\cyrillicSCHWA {\char"004D8 } % CYRILLIC CAPITAL LETTER SCHWA: Ә -\def\cyrillicschwa {\char"004D9 } % CYRILLIC SMALL LETTER SCHWA: ә -\def\cyrillicSCHWAdiaeresis {\char"004DA } % CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS: Ӛ -\def\cyrillicschwadiaeresis {\char"004DB } % CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS: ӛ -\def\cyrillicZHEdiaeresis {\char"004DC } % CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS: Ӝ -\def\cyrilliczhediaeresis {\char"004DD } % CYRILLIC SMALL LETTER ZHE WITH DIAERESIS: ӝ -\def\cyrillicZEdiaeresis {\char"004DE } % CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS: Ӟ -\def\cyrilliczediaeresis {\char"004DF } % CYRILLIC SMALL LETTER ZE WITH DIAERESIS: ӟ -\def\cyrillicDZEabkhasian {\char"004E0 } % CYRILLIC CAPITAL LETTER ABKHASIAN DZE: Ӡ -\def\cyrillicdzeabkhasian {\char"004E1 } % CYRILLIC SMALL LETTER ABKHASIAN DZE: ӡ -\def\cyrillicImacron {\char"004E2 } % CYRILLIC CAPITAL LETTER I WITH MACRON: Ӣ -\def\cyrillicimacron {\char"004E3 } % CYRILLIC SMALL LETTER I WITH MACRON: ӣ -\def\cyrillicIdiaeresis {\char"004E4 } % CYRILLIC CAPITAL LETTER I WITH DIAERESIS: Ӥ -\def\cyrillicidiaeresis {\char"004E5 } % CYRILLIC SMALL LETTER I WITH DIAERESIS: ӥ -\def\cyrillicOdiaeresis {\char"004E6 } % CYRILLIC CAPITAL LETTER O WITH DIAERESIS: Ӧ -\def\cyrillicodiaeresis {\char"004E7 } % CYRILLIC SMALL LETTER O WITH DIAERESIS: ӧ -\def\cyrillicObarred {\char"004E8 } % CYRILLIC CAPITAL LETTER BARRED O: Ө -\def\cyrillicobarred {\char"004E9 } % CYRILLIC SMALL LETTER BARRED O: ө -\def\cyrillicObarreddiaeresis {\char"004EA } % CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS: Ӫ -\def\cyrillicobarreddiaeresis {\char"004EB } % CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS: ӫ -\def\cyrillicEdiaeresis {\char"004EC } % CYRILLIC CAPITAL LETTER E WITH DIAERESIS: Ӭ -\def\cyrillicediaeresis {\char"004ED } % CYRILLIC SMALL LETTER E WITH DIAERESIS: ӭ -\def\cyrillicUmacron {\char"004EE } % CYRILLIC CAPITAL LETTER U WITH MACRON: Ӯ -\def\cyrillicumacron {\char"004EF } % CYRILLIC SMALL LETTER U WITH MACRON: ӯ -\def\cyrillicUdiaeresis {\char"004F0 } % CYRILLIC CAPITAL LETTER U WITH DIAERESIS: Ӱ -\def\cyrillicudiaeresis {\char"004F1 } % CYRILLIC SMALL LETTER U WITH DIAERESIS: ӱ -\def\cyrillicUdoubleacute {\char"004F2 } % CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE: Ӳ -\def\cyrillicudoubleacute {\char"004F3 } % CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE: ӳ -\def\cyrillicCHEdiaeresis {\char"004F4 } % CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS: Ӵ -\def\cyrillicchediaeresis {\char"004F5 } % CYRILLIC SMALL LETTER CHE WITH DIAERESIS: ӵ -\def\cyrillicYERUdiaeresis {\char"004F8 } % CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS: Ӹ -\def\cyrillicyerudiaeresis {\char"004F9 } % CYRILLIC SMALL LETTER YERU WITH DIAERESIS: ӹ -\def\hebrewAlef {\char"005D0 } % HEBREW LETTER ALEF: א -\def\hebrewBet {\char"005D1 } % HEBREW LETTER BET: ב -\def\hebrewGimel {\char"005D2 } % HEBREW LETTER GIMEL: ג -\def\hebrewDalet {\char"005D3 } % HEBREW LETTER DALET: ד -\def\hebrewHe {\char"005D4 } % HEBREW LETTER HE: ה -\def\hebrewVav {\char"005D5 } % HEBREW LETTER VAV: ו -\def\hebrewZayin {\char"005D6 } % HEBREW LETTER ZAYIN: ז -\def\hebrewHet {\char"005D7 } % HEBREW LETTER HET: ח -\def\hebrewTet {\char"005D8 } % HEBREW LETTER TET: ט -\def\hebrewYod {\char"005D9 } % HEBREW LETTER YOD: י -\def\hebrewKaffinal {\char"005DA } % HEBREW LETTER FINAL KAF: ך -\def\hebrewKaf {\char"005DB } % HEBREW LETTER KAF: כ -\def\hebrewLamed {\char"005DC } % HEBREW LETTER LAMED: ל -\def\hebrewMemfinal {\char"005DD } % HEBREW LETTER FINAL MEM: ם -\def\hebrewMem {\char"005DE } % HEBREW LETTER MEM: מ -\def\hebrewNunfinal {\char"005DF } % HEBREW LETTER FINAL NUN: ן -\def\hebrewNun {\char"005E0 } % HEBREW LETTER NUN: נ -\def\hebrewSamekh {\char"005E1 } % HEBREW LETTER SAMEKH: ס -\def\hebrewAyin {\char"005E2 } % HEBREW LETTER AYIN: ע -\def\hebrewPefinal {\char"005E3 } % HEBREW LETTER FINAL PE: ף -\def\hebrewPe {\char"005E4 } % HEBREW LETTER PE: פ -\def\hebrewTsadifinal {\char"005E5 } % HEBREW LETTER FINAL TSADI: ץ -\def\hebrewTsadi {\char"005E6 } % HEBREW LETTER TSADI: צ -\def\hebrewQof {\char"005E7 } % HEBREW LETTER QOF: ק -\def\hebrewResh {\char"005E8 } % HEBREW LETTER RESH: ר -\def\hebrewShin {\char"005E9 } % HEBREW LETTER SHIN: ש -\def\hebrewTav {\char"005EA } % HEBREW LETTER TAV: ת -\def\Adotbelow {\char"01EA0 } % LATIN CAPITAL LETTER A WITH DOT BELOW: Ạ -\def\adotbelow {\char"01EA1 } % LATIN SMALL LETTER A WITH DOT BELOW: ạ -\def\Ahook {\char"01EA2 } % LATIN CAPITAL LETTER A WITH HOOK ABOVE: Ả -\def\ahook {\char"01EA3 } % LATIN SMALL LETTER A WITH HOOK ABOVE: ả -\def\Acircumflexacute {\char"01EA4 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE: Ấ -\def\acircumflexacute {\char"01EA5 } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE: ấ -\def\Acircumflexgrave {\char"01EA6 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE: Ầ -\def\acircumflexgrave {\char"01EA7 } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE: ầ -\def\Acircumflexhook {\char"01EA8 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE: Ẩ -\def\acircumflexhook {\char"01EA9 } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE: ẩ -\def\Acircumflextilde {\char"01EAA } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE: Ẫ -\def\acircumflextilde {\char"01EAB } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE: ẫ -\def\Acircumflexdotbelow {\char"01EAC } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW: Ậ -\def\acircumflexdotbelow {\char"01EAD } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW: ậ -\def\Abreveacute {\char"01EAE } % LATIN CAPITAL LETTER A WITH BREVE AND ACUTE: Ắ -\def\abreveacute {\char"01EAF } % LATIN SMALL LETTER A WITH BREVE AND ACUTE: ắ -\def\Abrevegrave {\char"01EB0 } % LATIN CAPITAL LETTER A WITH BREVE AND GRAVE: Ằ -\def\abrevegrave {\char"01EB1 } % LATIN SMALL LETTER A WITH BREVE AND GRAVE: ằ -\def\Abrevehook {\char"01EB2 } % LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE: Ẳ -\def\abrevehook {\char"01EB3 } % LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE: ẳ -\def\Abrevetilde {\char"01EB4 } % LATIN CAPITAL LETTER A WITH BREVE AND TILDE: Ẵ -\def\abrevetilde {\char"01EB5 } % LATIN SMALL LETTER A WITH BREVE AND TILDE: ẵ -\def\Abrevedotbelow {\char"01EB6 } % LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW: Ặ -\def\abrevedotbelow {\char"01EB7 } % LATIN SMALL LETTER A WITH BREVE AND DOT BELOW: ặ -\def\Edotbelow {\char"01EB8 } % LATIN CAPITAL LETTER E WITH DOT BELOW: Ẹ -\def\edotbelow {\char"01EB9 } % LATIN SMALL LETTER E WITH DOT BELOW: ẹ -\def\Ehook {\char"01EBA } % LATIN CAPITAL LETTER E WITH HOOK ABOVE: Ẻ -\def\ehook {\char"01EBB } % LATIN SMALL LETTER E WITH HOOK ABOVE: ẻ -\def\Etilde {\char"01EBC } % LATIN CAPITAL LETTER E WITH TILDE: Ẽ -\def\etilde {\char"01EBD } % LATIN SMALL LETTER E WITH TILDE: ẽ -\def\Ecircumflexacute {\char"01EBE } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE: Ế -\def\ecircumflexacute {\char"01EBF } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE: ế -\def\Ecircumflexgrave {\char"01EC0 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE: Ề -\def\ecircumflexgrave {\char"01EC1 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE: ề -\def\Ecircumflexhook {\char"01EC2 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE: Ể -\def\ecircumflexhook {\char"01EC3 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE: ể -\def\Ecircumflextilde {\char"01EC4 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE: Ễ -\def\ecircumflextilde {\char"01EC5 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE: ễ -\def\Ecircumflexdotbelow {\char"01EC6 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW: Ệ -\def\ecircumflexdotbelow {\char"01EC7 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW: ệ -\def\Ihook {\char"01EC8 } % LATIN CAPITAL LETTER I WITH HOOK ABOVE: Ỉ -\def\ihook {\char"01EC9 } % LATIN SMALL LETTER I WITH HOOK ABOVE: ỉ -\def\Idotbelow {\char"01ECA } % LATIN CAPITAL LETTER I WITH DOT BELOW: Ị -\def\idotbelow {\char"01ECB } % LATIN SMALL LETTER I WITH DOT BELOW: ị -\def\Odotbelow {\char"01ECC } % LATIN CAPITAL LETTER O WITH DOT BELOW: Ọ -\def\odotbelow {\char"01ECD } % LATIN SMALL LETTER O WITH DOT BELOW: ọ -\def\Ohook {\char"01ECE } % LATIN CAPITAL LETTER O WITH HOOK ABOVE: Ỏ -\def\ohook {\char"01ECF } % LATIN SMALL LETTER O WITH HOOK ABOVE: ỏ -\def\Ocircumflexacute {\char"01ED0 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE: Ố -\def\ocircumflexacute {\char"01ED1 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE: ố -\def\Ocircumflexgrave {\char"01ED2 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE: Ồ -\def\ocircumflexgrave {\char"01ED3 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE: ồ -\def\Ocircumflexhook {\char"01ED4 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE: Ổ -\def\ocircumflexhook {\char"01ED5 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE: ổ -\def\Ocircumflextilde {\char"01ED6 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE: Ỗ -\def\ocircumflextilde {\char"01ED7 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE: ỗ -\def\Ocircumflexdotbelow {\char"01ED8 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW: Ộ -\def\ocircumflexdotbelow {\char"01ED9 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW: ộ -\def\Ohornacute {\char"01EDA } % LATIN CAPITAL LETTER O WITH HORN AND ACUTE: Ớ -\def\ohornacute {\char"01EDB } % LATIN SMALL LETTER O WITH HORN AND ACUTE: ớ -\def\Ohorngrave {\char"01EDC } % LATIN CAPITAL LETTER O WITH HORN AND GRAVE: Ờ -\def\ohorngrave {\char"01EDD } % LATIN SMALL LETTER O WITH HORN AND GRAVE: ờ -\def\Ohornhook {\char"01EDE } % LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE: Ở -\def\ohornhook {\char"01EDF } % LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE: ở -\def\Ohorntilde {\char"01EE0 } % LATIN CAPITAL LETTER O WITH HORN AND TILDE: Ỡ -\def\ohorntilde {\char"01EE1 } % LATIN SMALL LETTER O WITH HORN AND TILDE: ỡ -\def\Ohorndotbelow {\char"01EE2 } % LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW: Ợ -\def\ohorndotbelow {\char"01EE3 } % LATIN SMALL LETTER O WITH HORN AND DOT BELOW: ợ -\def\Udotbelow {\char"01EE4 } % LATIN CAPITAL LETTER U WITH DOT BELOW: Ụ -\def\udotbelow {\char"01EE5 } % LATIN SMALL LETTER U WITH DOT BELOW: ụ -\def\Uhook {\char"01EE6 } % LATIN CAPITAL LETTER U WITH HOOK ABOVE: Ủ -\def\uhook {\char"01EE7 } % LATIN SMALL LETTER U WITH HOOK ABOVE: ủ -\def\Uhornacute {\char"01EE8 } % LATIN CAPITAL LETTER U WITH HORN AND ACUTE: Ứ -\def\uhornacute {\char"01EE9 } % LATIN SMALL LETTER U WITH HORN AND ACUTE: ứ -\def\Uhorngrave {\char"01EEA } % LATIN CAPITAL LETTER U WITH HORN AND GRAVE: Ừ -\def\uhorngrave {\char"01EEB } % LATIN SMALL LETTER U WITH HORN AND GRAVE: ừ -\def\Uhornhook {\char"01EEC } % LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE: Ử -\def\uhornhook {\char"01EED } % LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE: ử -\def\Uhorntilde {\char"01EEE } % LATIN CAPITAL LETTER U WITH HORN AND TILDE: Ữ -\def\uhorntilde {\char"01EEF } % LATIN SMALL LETTER U WITH HORN AND TILDE: ữ -\def\Uhorndotbelow {\char"01EF0 } % LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW: Ự -\def\uhorndotbelow {\char"01EF1 } % LATIN SMALL LETTER U WITH HORN AND DOT BELOW: ự -\def\Ygrave {\char"01EF2 } % LATIN CAPITAL LETTER Y WITH GRAVE: Ỳ -\def\ygrave {\char"01EF3 } % LATIN SMALL LETTER Y WITH GRAVE: ỳ -\def\Ydotbelow {\char"01EF4 } % LATIN CAPITAL LETTER Y WITH DOT BELOW: Ỵ -\def\ydotbelow {\char"01EF5 } % LATIN SMALL LETTER Y WITH DOT BELOW: ỵ -\def\Yhook {\char"01EF6 } % LATIN CAPITAL LETTER Y WITH HOOK ABOVE: Ỷ -\def\yhook {\char"01EF7 } % LATIN SMALL LETTER Y WITH HOOK ABOVE: ỷ -\def\Ytilde {\char"01EF8 } % LATIN CAPITAL LETTER Y WITH TILDE: Ỹ -\def\ytilde {\char"01EF9 } % LATIN SMALL LETTER Y WITH TILDE: ỹ -\def\greekalphapsili {\char"01F00 } % GREEK SMALL LETTER ALPHA WITH PSILI: ἀ -\def\greekalphadasia {\char"01F01 } % GREEK SMALL LETTER ALPHA WITH DASIA: ἁ -\def\greekalphapsilivaria {\char"01F02 } % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA: ἂ -\def\greekalphadasiavaria {\char"01F03 } % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA: ἃ -\def\greekalphapsilitonos {\char"01F04 } % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA: ἄ -\def\greekalphadasiatonos {\char"01F05 } % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA: ἅ -\def\greekalphapsiliperispomeni {\char"01F06 } % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI: ἆ -\def\greekalphadasiaperispomeni {\char"01F07 } % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI: ἇ -\def\greekAlphapsili {\char"01F08 } % GREEK CAPITAL LETTER ALPHA WITH PSILI: Ἀ -\def\greekAlphadasia {\char"01F09 } % GREEK CAPITAL LETTER ALPHA WITH DASIA: Ἁ -\def\greekAlphapsilivaria {\char"01F0A } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA: Ἂ -\def\greekAlphadasiavaria {\char"01F0B } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA: Ἃ -\def\greekAlphapsilitonos {\char"01F0C } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA: Ἄ -\def\greekAlphadasiatonos {\char"01F0D } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA: Ἅ -\def\greekAlphapsiliperispomeni {\char"01F0E } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI: Ἆ -\def\greekAlphadasiaperispomeni {\char"01F0F } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI: Ἇ -\def\greekepsilonpsili {\char"01F10 } % GREEK SMALL LETTER EPSILON WITH PSILI: ἐ -\def\greekepsilondasia {\char"01F11 } % GREEK SMALL LETTER EPSILON WITH DASIA: ἑ -\def\greekepsilonpsilivaria {\char"01F12 } % GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA: ἒ -\def\greekepsilondasiavaria {\char"01F13 } % GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA: ἓ -\def\greekepsilonpsilitonos {\char"01F14 } % GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA: ἔ -\def\greekepsilondasiatonos {\char"01F15 } % GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA: ἕ -\def\greekEpsilonpsili {\char"01F18 } % GREEK CAPITAL LETTER EPSILON WITH PSILI: Ἐ -\def\greekEpsilondasia {\char"01F19 } % GREEK CAPITAL LETTER EPSILON WITH DASIA: Ἑ -\def\greekEpsilonpsilivaria {\char"01F1A } % GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA: Ἒ -\def\greekEpsilondasiavaria {\char"01F1B } % GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA: Ἓ -\def\greekEpsilonpsilitonos {\char"01F1C } % GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA: Ἔ -\def\greekEpsilondasiatonos {\char"01F1D } % GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA: Ἕ -\def\greeketapsili {\char"01F20 } % GREEK SMALL LETTER ETA WITH PSILI: ἠ -\def\greeketadasia {\char"01F21 } % GREEK SMALL LETTER ETA WITH DASIA: ἡ -\def\greeketapsilivaria {\char"01F22 } % GREEK SMALL LETTER ETA WITH PSILI AND VARIA: ἢ -\def\greeketadasiavaria {\char"01F23 } % GREEK SMALL LETTER ETA WITH DASIA AND VARIA: ἣ -\def\greeketapsilitonos {\char"01F24 } % GREEK SMALL LETTER ETA WITH PSILI AND OXIA: ἤ -\def\greeketadasiatonos {\char"01F25 } % GREEK SMALL LETTER ETA WITH DASIA AND OXIA: ἥ -\def\greeketapsiliperispomeni {\char"01F26 } % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI: ἦ -\def\greeketadasiaperispomeni {\char"01F27 } % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI: ἧ -\def\greekEtapsili {\char"01F28 } % GREEK CAPITAL LETTER ETA WITH PSILI: Ἠ -\def\greekEtadasia {\char"01F29 } % GREEK CAPITAL LETTER ETA WITH DASIA: Ἡ -\def\greekEtapsilivaria {\char"01F2A } % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA: Ἢ -\def\greekEtadasiavaria {\char"01F2B } % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA: Ἣ -\def\greekEtapsilitonos {\char"01F2C } % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA: Ἤ -\def\greekEtadasiatonos {\char"01F2D } % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA: Ἥ -\def\greekEtapsiliperispomeni {\char"01F2E } % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI: Ἦ -\def\greekEtadasiaperispomeni {\char"01F2F } % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI: Ἧ -\def\greekiotapsili {\char"01F30 } % GREEK SMALL LETTER IOTA WITH PSILI: ἰ -\def\greekiotadasia {\char"01F31 } % GREEK SMALL LETTER IOTA WITH DASIA: ἱ -\def\greekiotapsilivaria {\char"01F32 } % GREEK SMALL LETTER IOTA WITH PSILI AND VARIA: ἲ -\def\greekiotadasiavaria {\char"01F33 } % GREEK SMALL LETTER IOTA WITH DASIA AND VARIA: ἳ -\def\greekiotapsilitonos {\char"01F34 } % GREEK SMALL LETTER IOTA WITH PSILI AND OXIA: ἴ -\def\greekiotadasiatonos {\char"01F35 } % GREEK SMALL LETTER IOTA WITH DASIA AND OXIA: ἵ -\def\greekiotapsiliperispomeni {\char"01F36 } % GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI: ἶ -\def\greekiotadasiaperispomeni {\char"01F37 } % GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI: ἷ -\def\greekIotapsili {\char"01F38 } % GREEK CAPITAL LETTER IOTA WITH PSILI: Ἰ -\def\greekIotadasia {\char"01F39 } % GREEK CAPITAL LETTER IOTA WITH DASIA: Ἱ -\def\greekIotapsilivaria {\char"01F3A } % GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA: Ἲ -\def\greekIotadasiavaria {\char"01F3B } % GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA: Ἳ -\def\greekIotapsilitonos {\char"01F3C } % GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA: Ἴ -\def\greekIotadasiatonos {\char"01F3D } % GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA: Ἵ -\def\greekIotapsiliperispomeni {\char"01F3E } % GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI: Ἶ -\def\greekIotadasiaperispomeni {\char"01F3F } % GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI: Ἷ -\def\greekomicronpsili {\char"01F40 } % GREEK SMALL LETTER OMICRON WITH PSILI: ὀ -\def\greekomicrondasia {\char"01F41 } % GREEK SMALL LETTER OMICRON WITH DASIA: ὁ -\def\greekomicronpsilivaria {\char"01F42 } % GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA: ὂ -\def\greekomicrondasiavaria {\char"01F43 } % GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA: ὃ -\def\greekomicronpsilitonos {\char"01F44 } % GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA: ὄ -\def\greekomicrondasiatonos {\char"01F45 } % GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA: ὅ -\def\greekOmicronpsili {\char"01F48 } % GREEK CAPITAL LETTER OMICRON WITH PSILI: Ὀ -\def\greekOmicrondasia {\char"01F49 } % GREEK CAPITAL LETTER OMICRON WITH DASIA: Ὁ -\def\greekOmicronpsilivaria {\char"01F4A } % GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA: Ὂ -\def\greekOmicrondasiavaria {\char"01F4B } % GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA: Ὃ -\def\greekOmicronpsilitonos {\char"01F4C } % GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA: Ὄ -\def\greekOmicrondasiatonos {\char"01F4D } % GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA: Ὅ -\def\greekupsilonpsili {\char"01F50 } % GREEK SMALL LETTER UPSILON WITH PSILI: ὐ -\def\greekupsilondasia {\char"01F51 } % GREEK SMALL LETTER UPSILON WITH DASIA: ὑ -\def\greekupsilonpsilivaria {\char"01F52 } % GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA: ὒ -\def\greekupsilondasiavaria {\char"01F53 } % GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA: ὓ -\def\greekupsilonpsilitonos {\char"01F54 } % GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA: ὔ -\def\greekupsilondasiatonos {\char"01F55 } % GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA: ὕ -\def\greekupsilonpsiliperispomeni {\char"01F56 } % GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI: ὖ -\def\greekupsilondasiaperispomeni {\char"01F57 } % GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI: ὗ -\def\greekUpsilondasia {\char"01F59 } % GREEK CAPITAL LETTER UPSILON WITH DASIA: Ὑ -\def\greekUpsilondasiavaria {\char"01F5B } % GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA: Ὓ -\def\greekUpsilondasiatonos {\char"01F5D } % GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA: Ὕ -\def\greekUpsilondasiaperispomeni {\char"01F5F } % GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI: Ὗ -\def\greekomegapsili {\char"01F60 } % GREEK SMALL LETTER OMEGA WITH PSILI: ὠ -\def\greekomegadasia {\char"01F61 } % GREEK SMALL LETTER OMEGA WITH DASIA: ὡ -\def\greekomegapsilivaria {\char"01F62 } % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA: ὢ -\def\greekomegadasiavaria {\char"01F63 } % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA: ὣ -\def\greekomegapsilitonos {\char"01F64 } % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA: ὤ -\def\greekomegadasiatonos {\char"01F65 } % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA: ὥ -\def\greekomegapsiliperispomeni {\char"01F66 } % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI: ὦ -\def\greekomegadasiaperispomeni {\char"01F67 } % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI: ὧ -\def\greekOmegapsili {\char"01F68 } % GREEK CAPITAL LETTER OMEGA WITH PSILI: Ὠ -\def\greekOmegadasia {\char"01F69 } % GREEK CAPITAL LETTER OMEGA WITH DASIA: Ὡ -\def\greekOmegapsilivaria {\char"01F6A } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA: Ὢ -\def\greekOmegadasiavaria {\char"01F6B } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA: Ὣ -\def\greekOmegapsilitonos {\char"01F6C } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA: Ὤ -\def\greekOmegadasiatonos {\char"01F6D } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA: Ὥ -\def\greekOmegapsiliperispomeni {\char"01F6E } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI: Ὦ -\def\greekOmegadasiaperispomeni {\char"01F6F } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI: Ὧ -\def\greekalphavaria {\char"01F70 } % GREEK SMALL LETTER ALPHA WITH VARIA: ὰ -\def\greekalphaoxia {\char"01F71 } % GREEK SMALL LETTER ALPHA WITH OXIA: ά -\def\greekepsilonvaria {\char"01F72 } % GREEK SMALL LETTER EPSILON WITH VARIA: ὲ -\def\greekepsilonoxia {\char"01F73 } % GREEK SMALL LETTER EPSILON WITH OXIA: έ -\def\greeketavaria {\char"01F74 } % GREEK SMALL LETTER ETA WITH VARIA: ὴ -\def\greeketaoxia {\char"01F75 } % GREEK SMALL LETTER ETA WITH OXIA: ή -\def\greekiotavaria {\char"01F76 } % GREEK SMALL LETTER IOTA WITH VARIA: ὶ -\def\greekiotaoxia {\char"01F77 } % GREEK SMALL LETTER IOTA WITH OXIA: ί -\def\greekomicronvaria {\char"01F78 } % GREEK SMALL LETTER OMICRON WITH VARIA: ὸ -\def\greekomicronoxia {\char"01F79 } % GREEK SMALL LETTER OMICRON WITH OXIA: ό -\def\greekupsilonvaria {\char"01F7A } % GREEK SMALL LETTER UPSILON WITH VARIA: ὺ -\def\greekupsilonoxia {\char"01F7B } % GREEK SMALL LETTER UPSILON WITH OXIA: ύ -\def\greekomegavaria {\char"01F7C } % GREEK SMALL LETTER OMEGA WITH VARIA: ὼ -\def\greekomegaoxia {\char"01F7D } % GREEK SMALL LETTER OMEGA WITH OXIA: ώ -\def\greekalphaiotasubpsili {\char"01F80 } % GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI: ᾀ -\def\greekalphaiotasubdasia {\char"01F81 } % GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI: ᾁ -\def\greekalphaiotasubpsilivaria {\char"01F82 } % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI: ᾂ -\def\greekalphaiotasubdasiavaria {\char"01F83 } % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI: ᾃ -\def\greekalphaiotasubpsilitonos {\char"01F84 } % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI: ᾄ -\def\greekalphaiotasubdasiatonos {\char"01F85 } % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI: ᾅ -\def\greekalphaiotasubpsiliperispomeni{\char"01F86 } % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI: ᾆ -\def\greekalphaiotasubdasiaperispomeni{\char"01F87 } % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI: ᾇ -\def\greekAlphaiotasubpsili {\char"01F88 } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI: ᾈ -\def\greekAlphaiotasubdasia {\char"01F89 } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI: ᾉ -\def\greekAlphaiotasubpsilivaria {\char"01F8A } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI: ᾊ -\def\greekAlphaiotasubdasiavaria {\char"01F8B } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI: ᾋ -\def\greekAlphaiotasubpsilitonos {\char"01F8C } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI: ᾌ -\def\greekAlphaiotasubdasiatonos {\char"01F8D } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI: ᾍ -\def\greekAlphaiotasubpsiliperispomeni{\char"01F8E } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI: ᾎ -\def\greekAlphaiotasubdasiaperispomeni{\char"01F8F } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI: ᾏ -\def\greeketaiotasubpsili {\char"01F90 } % GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI: ᾐ -\def\greeketaiotasubdasia {\char"01F91 } % GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI: ᾑ -\def\greeketaiotasubpsilivaria {\char"01F92 } % GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI: ᾒ -\def\greeketaiotasubdasiavaria {\char"01F93 } % GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI: ᾓ -\def\greeketaiotasubpsilitonos {\char"01F94 } % GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI: ᾔ -\def\greeketaiotasubdasiatonos {\char"01F95 } % GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI: ᾕ -\def\greeketaiotasubpsiliperispomeni {\char"01F96 } % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI: ᾖ -\def\greeketaiotasubdasiaperispomeni {\char"01F97 } % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI: ᾗ -\def\greekEtaiotasubpsili {\char"01F98 } % GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI: ᾘ -\def\greekEtaiotasubdasia {\char"01F99 } % GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI: ᾙ -\def\greekEtaiotasubpsilivaria {\char"01F9A } % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI: ᾚ -\def\greekEtaiotasubdasiavaria {\char"01F9B } % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI: ᾛ -\def\greekEtaiotasubpsilitonos {\char"01F9C } % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI: ᾜ -\def\greekEtaiotasubdasiatonos {\char"01F9D } % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI: ᾝ -\def\greekEtaiotasubpsiliperispomeni {\char"01F9E } % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI: ᾞ -\def\greekEtaiotasubdasiaperispomeni {\char"01F9F } % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI: ᾟ -\def\greekomegaiotasubpsili {\char"01FA0 } % GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI: ᾠ -\def\greekomegaiotasubdasia {\char"01FA1 } % GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI: ᾡ -\def\greekomegaiotasubpsilivaria {\char"01FA2 } % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI: ᾢ -\def\greekomegaiotasubdasiavaria {\char"01FA3 } % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI: ᾣ -\def\greekomegaiotasubpsilitonos {\char"01FA4 } % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI: ᾤ -\def\greekomegaiotasubdasiatonos {\char"01FA5 } % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI: ᾥ -\def\greekomegaiotasubpsiliperispomeni{\char"01FA6 } % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI: ᾦ -\def\greekomegaiotasubdasiaperispomeni{\char"01FA7 } % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI: ᾧ -\def\greekOmegaiotasubpsili {\char"01FA8 } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI: ᾨ -\def\greekOmegaiotasubdasia {\char"01FA9 } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI: ᾩ -\def\greekOmegaiotasubpsilivaria {\char"01FAA } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI: ᾪ -\def\greekOmegaiotasubdasiavaria {\char"01FAB } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI: ᾫ -\def\greekOmegaiotasubpsilitonos {\char"01FAC } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI: ᾬ -\def\greekOmegaiotasubdasiatonos {\char"01FAD } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI: ᾭ -\def\greekOmegaiotasubpsiliperispomeni{\char"01FAE } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI: ᾮ -\def\greekOmegaiotasubdasiaperispomeni{\char"01FAF } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI: ᾯ -\def\greekalphavrachy {\char"01FB0 } % GREEK SMALL LETTER ALPHA WITH VRACHY: ᾰ -\def\greekalphamacron {\char"01FB1 } % GREEK SMALL LETTER ALPHA WITH MACRON: ᾱ -\def\greekalphaiotasubvaria {\char"01FB2 } % GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI: ᾲ -\def\greekalphaiotasub {\char"01FB3 } % GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI: ᾳ -\def\greekalphaiotasubtonos {\char"01FB4 } % GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI: ᾴ -\def\greekalphaperispomeni {\char"01FB6 } % GREEK SMALL LETTER ALPHA WITH PERISPOMENI: ᾶ -\def\greekalphaiotasubperispomeni {\char"01FB7 } % GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI: ᾷ -\def\greekAlphavrachy {\char"01FB8 } % GREEK CAPITAL LETTER ALPHA WITH VRACHY: Ᾰ -\def\greekAlphamacron {\char"01FB9 } % GREEK CAPITAL LETTER ALPHA WITH MACRON: Ᾱ -\def\greekAlphavaria {\char"01FBA } % GREEK CAPITAL LETTER ALPHA WITH VARIA: Ὰ -\def\greekAlphatonos {\char"01FBB } % GREEK CAPITAL LETTER ALPHA WITH OXIA: Ά -\def\greekAlphaiotasub {\char"01FBC } % GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI: ᾼ -\def\greekCoronis {\char"01FBD } % GREEK KORONIS: ᾽ -\def\greekprosgegrammeni {\char"01FBE } % GREEK PROSGEGRAMMENI: ι -\def\greekpsili {\char"01FBF } % GREEK PSILI: ᾿ -\def\greekperispomeni {\char"01FC0 } % GREEK PERISPOMENI: ῀ -\def\greekdialytikaperispomeni {\char"01FC1 } % GREEK DIALYTIKA AND PERISPOMENI: ῁ -\def\greeketaiotasubvaria {\char"01FC2 } % GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI: ῂ -\def\greeketaiotasub {\char"01FC3 } % GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI: ῃ -\def\greeketaiotasubtonos {\char"01FC4 } % GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI: ῄ -\def\greeketaperispomeni {\char"01FC6 } % GREEK SMALL LETTER ETA WITH PERISPOMENI: ῆ -\def\greeketaiotasubperispomeni {\char"01FC7 } % GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI: ῇ -\def\greekEpsilonvaria {\char"01FC8 } % GREEK CAPITAL LETTER EPSILON WITH VARIA: Ὲ -\def\greekEpsilontonos {\char"01FC9 } % GREEK CAPITAL LETTER EPSILON WITH OXIA: Έ -\def\greekEtavaria {\char"01FCA } % GREEK CAPITAL LETTER ETA WITH VARIA: Ὴ -\def\greekEtatonos {\char"01FCB } % GREEK CAPITAL LETTER ETA WITH OXIA: Ή -\def\greekEtaiotasub {\char"01FCC } % GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI: ῌ -\def\greekpsilivaria {\char"01FCD } % GREEK PSILI AND VARIA: ῍ -\def\greekpsilitonos {\char"01FCE } % GREEK PSILI AND OXIA: ῎ -\def\greekpsiliperispomeni {\char"01FCF } % GREEK PSILI AND PERISPOMENI: ῏ -\def\greekiotavrachy {\char"01FD0 } % GREEK SMALL LETTER IOTA WITH VRACHY: ῐ -\def\greekiotamacron {\char"01FD1 } % GREEK SMALL LETTER IOTA WITH MACRON: ῑ -\def\greekiotadialytikavaria {\char"01FD2 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA: ῒ -\def\greekiotadialytikatonos {\char"01FD3 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA: ΐ -\def\greekiotaperispomeni {\char"01FD6 } % GREEK SMALL LETTER IOTA WITH PERISPOMENI: ῖ -\def\greekiotadialytikaperispomeni {\char"01FD7 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI: ῗ -\def\greekIotavrachy {\char"01FD8 } % GREEK CAPITAL LETTER IOTA WITH VRACHY: Ῐ -\def\greekIotamacron {\char"01FD9 } % GREEK CAPITAL LETTER IOTA WITH MACRON: Ῑ -\def\greekIotavaria {\char"01FDA } % GREEK CAPITAL LETTER IOTA WITH VARIA: Ὶ -\def\greekIotatonos {\char"01FDB } % GREEK CAPITAL LETTER IOTA WITH OXIA: Ί -\def\greekdasiavaria {\char"01FDD } % GREEK DASIA AND VARIA: ῝ -\def\greekdasiatonos {\char"01FDE } % GREEK DASIA AND OXIA: ῞ -\def\greekdasiaperispomeni {\char"01FDF } % GREEK DASIA AND PERISPOMENI: ῟ -\def\greekupsilonvrachy {\char"01FE0 } % GREEK SMALL LETTER UPSILON WITH VRACHY: ῠ -\def\greekupsilonmacron {\char"01FE1 } % GREEK SMALL LETTER UPSILON WITH MACRON: ῡ -\def\greekupsilondialytikavaria {\char"01FE2 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA: ῢ -\def\greekupsilondialytikatonos {\char"01FE3 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA: ΰ -\def\greekrhopsili {\char"01FE4 } % GREEK SMALL LETTER RHO WITH PSILI: ῤ -\def\greekrhodasia {\char"01FE5 } % GREEK SMALL LETTER RHO WITH DASIA: ῥ -\def\greekupsilonperispomeni {\char"01FE6 } % GREEK SMALL LETTER UPSILON WITH PERISPOMENI: ῦ -\def\greekupsilondialytikaperispomeni {\char"01FE7 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI: ῧ -\def\greekUpsilonvrachy {\char"01FE8 } % GREEK CAPITAL LETTER UPSILON WITH VRACHY: Ῠ -\def\greekUpsilonmacron {\char"01FE9 } % GREEK CAPITAL LETTER UPSILON WITH MACRON: Ῡ -\def\greekUpsilonvaria {\char"01FEA } % GREEK CAPITAL LETTER UPSILON WITH VARIA: Ὺ -\def\greekUpsilontonos {\char"01FEB } % GREEK CAPITAL LETTER UPSILON WITH OXIA: Ύ -\def\greekRhodasia {\char"01FEC } % GREEK CAPITAL LETTER RHO WITH DASIA: Ῥ -\def\greekdialytikavaria {\char"01FED } % GREEK DIALYTIKA AND VARIA: ῭ -\def\greekdialytikatonos {\char"01FEE } % GREEK DIALYTIKA AND OXIA: ΅ -\def\greekvaria {\char"01FEF } % GREEK VARIA: ` -\def\greekomegaiotasubvaria {\char"01FF2 } % GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI: ῲ -\def\greekomegaiotasub {\char"01FF3 } % GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI: ῳ -\def\greekomegaiotasubtonos {\char"01FF4 } % GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI: ῴ -\def\greekomegaperispomeni {\char"01FF6 } % GREEK SMALL LETTER OMEGA WITH PERISPOMENI: ῶ -\def\greekomegaiotasubperispomeni {\char"01FF7 } % GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI: ῷ -\def\greekOmicronvaria {\char"01FF8 } % GREEK CAPITAL LETTER OMICRON WITH VARIA: Ὸ -\def\greekOmicrontonos {\char"01FF9 } % GREEK CAPITAL LETTER OMICRON WITH OXIA: Ό -\def\greekOmegavaria {\char"01FFA } % GREEK CAPITAL LETTER OMEGA WITH VARIA: Ὼ -\def\greekOmegatonos {\char"01FFB } % GREEK CAPITAL LETTER OMEGA WITH OXIA: Ώ -\def\greekOmegaiotasub {\char"01FFC } % GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI: ῼ -\def\greekoxia {\char"01FFD } % GREEK OXIA: ´ -\def\greekdasia {\char"01FFE } % GREEK DASIA: ῾ -\def\enspace {\char"02002 } % EN SPACE:   -\def\emspace {\char"02003 } % EM SPACE:   -\def\threeperemspace {\char"02004 } % THREE-PER-EM SPACE:   -\def\fourperemspace {\char"02005 } % FOUR-PER-EM SPACE:   -\def\sixperemspace {\char"02006 } % SIX-PER-EM SPACE:   -\def\figurespace {\char"02007 } % FIGURE SPACE:   -\def\punctuationspace {\char"02008 } % PUNCTUATION SPACE:   -\def\thinspace {\char"02009 } % THIN SPACE:   -\def\figurespace {\char"0200A } % HAIR SPACE:   -\def\zerowidthspace {\char"0200B } % ZERO WIDTH SPACE: ​ -\def\textminus {\char"02012 } % FIGURE DASH: ‒ -\def\endash {\char"02013 } % EN DASH: – -\def\emdash {\char"02014 } % EM DASH: — -\def\texthorizontalbar {\char"02015 } % HORIZONTAL BAR: ― -\def\quoteleft {\char"02018 } % LEFT SINGLE QUOTATION MARK: ‘ -\def\quoteright {\char"02019 } % RIGHT SINGLE QUOTATION MARK: ’ -\def\quotesinglebase {\char"0201A } % SINGLE LOW-0x0009 QUOTATION MARK: ‚ -\def\quotedblleft {\char"0201C } % LEFT DOUBLE QUOTATION MARK: “ -\def\quotedblright {\char"0201D } % RIGHT DOUBLE QUOTATION MARK: ” -\def\quotedblbase {\char"0201E } % DOUBLE LOW-0x0009 QUOTATION MARK: „ -\def\textdag {\char"02020 } % DAGGER: † -\def\textddag {\char"02021 } % DOUBLE DAGGER: ‡ -\def\textbullet {\char"02022 } % BULLET: • -\def\textellipsis {\char"02026 } % HORIZONTAL ELLIPSIS: … -\def\narrownobreakspace {\char"0202F } % NARROW NO-BREAK SPACE:   -\def\perthousand {\char"02030 } % PER MILLE SIGN: ‰ -\def\guilsingleleft {\char"02039 } % SINGLE LEFT-POINTING ANGLE QUOTATION MARK: ‹ -\def\guilsingleright {\char"0203A } % SINGLE RIGHT-POINTING ANGLE QUOTATION MARK: › -\def\textfraction {\char"02044 } % FRACTION SLASH: ⁄ -\def\medspace {\char"0205F } % MEDIUM MATHEMATICAL SPACE:   -\def\textdong {\char"020AB } % DONG SIGN: ₫ -\def\texteuro {\char"020AC } % EURO SIGN: € -\def\textcelsius {\char"02103 } % DEGREE CELSIUS: ℃ -\def\textnumero {\char"02116 } % NUMERO SIGN: № -\def\textcircledP {\char"02117 } % SOUND RECORDING COPYRIGHT: ℗ -\def\trademark {\char"02122 } % TRADE MARK SIGN: ™ -\def\textounce {\char"02125 } % OUNCE SIGN: ℥ -\def\textohm {\char"02126 } % OHM SIGN: Ω -\def\textmho {\char"02127 } % INVERTED OHM SIGN: ℧ -\def\textkelvin {\char"0212A } % KELVIN SIGN: K -\def\textAngstrom {\char"0212B } % ANGSTROM SIGN: Å -\def\onethird {\char"02153 } % VULGAR FRACTION ONE THIRD: ⅓ -\def\twothirds {\char"02154 } % VULGAR FRACTION TWO THIRDS: ⅔ -\def\onefifth {\char"02155 } % VULGAR FRACTION ONE FIFTH: ⅕ -\def\twofifths {\char"02156 } % VULGAR FRACTION TWO FIFTHS: ⅖ -\def\threefifths {\char"02157 } % VULGAR FRACTION THREE FIFTHS: ⅗ -\def\fourfifths {\char"02158 } % VULGAR FRACTION FOUR FIFTHS: ⅘ -\def\onesixth {\char"02159 } % VULGAR FRACTION ONE SIXTH: ⅙ -\def\fivesixths {\char"0215A } % VULGAR FRACTION FIVE SIXTHS: ⅚ -\def\oneeighth {\char"0215B } % VULGAR FRACTION ONE EIGHTH: ⅛ -\def\threeeighths {\char"0215C } % VULGAR FRACTION THREE EIGHTHS: ⅜ -\def\fiveeighths {\char"0215D } % VULGAR FRACTION FIVE EIGHTHS: ⅝ -\def\seveneighths {\char"0215E } % VULGAR FRACTION SEVEN EIGHTHS: ⅞ -\def\romanI {\char"02160 } % ROMAN NUMERAL ONE: Ⅰ -\def\romanII {\char"02161 } % ROMAN NUMERAL TWO: Ⅱ -\def\romanIII {\char"02162 } % ROMAN NUMERAL THREE: Ⅲ -\def\romanIV {\char"02163 } % ROMAN NUMERAL FOUR: Ⅳ -\def\romanV {\char"02164 } % ROMAN NUMERAL FIVE: Ⅴ -\def\romanVI {\char"02165 } % ROMAN NUMERAL SIX: Ⅵ -\def\romanVII {\char"02166 } % ROMAN NUMERAL SEVEN: Ⅶ -\def\romanVIII {\char"02167 } % ROMAN NUMERAL EIGHT: Ⅷ -\def\romanIX {\char"02168 } % ROMAN NUMERAL NINE: Ⅸ -\def\romanX {\char"02169 } % ROMAN NUMERAL TEN: Ⅹ -\def\romanXI {\char"0216A } % ROMAN NUMERAL ELEVEN: Ⅺ -\def\romanXII {\char"0216B } % ROMAN NUMERAL TWELVE: Ⅻ -\def\romanL {\char"0216C } % ROMAN NUMERAL FIFTY: Ⅼ -\def\romanC {\char"0216D } % ROMAN NUMERAL ONE HUNDRED: Ⅽ -\def\romanD {\char"0216E } % ROMAN NUMERAL FIVE HUNDRED: Ⅾ -\def\romanM {\char"0216F } % ROMAN NUMERAL ONE THOUSAND: Ⅿ -\def\romani {\char"02170 } % SMALL ROMAN NUMERAL ONE: ⅰ -\def\romanii {\char"02171 } % SMALL ROMAN NUMERAL TWO: ⅱ -\def\romaniii {\char"02172 } % SMALL ROMAN NUMERAL THREE: ⅲ -\def\romaniv {\char"02173 } % SMALL ROMAN NUMERAL FOUR: ⅳ -\def\romanv {\char"02174 } % SMALL ROMAN NUMERAL FIVE: ⅴ -\def\romanvi {\char"02175 } % SMALL ROMAN NUMERAL SIX: ⅵ -\def\romanvii {\char"02176 } % SMALL ROMAN NUMERAL SEVEN: ⅶ -\def\romanviii {\char"02177 } % SMALL ROMAN NUMERAL EIGHT: ⅷ -\def\romanix {\char"02178 } % SMALL ROMAN NUMERAL NINE: ⅸ -\def\romanx {\char"02179 } % SMALL ROMAN NUMERAL TEN: ⅹ -\def\romanxi {\char"0217A } % SMALL ROMAN NUMERAL ELEVEN: ⅺ -\def\romanxii {\char"0217B } % SMALL ROMAN NUMERAL TWELVE: ⅻ -\def\romanl {\char"0217C } % SMALL ROMAN NUMERAL FIFTY: ⅼ -\def\romanc {\char"0217D } % SMALL ROMAN NUMERAL ONE HUNDRED: ⅽ -\def\romand {\char"0217E } % SMALL ROMAN NUMERAL FIVE HUNDRED: ⅾ -\def\romanm {\char"0217F } % SMALL ROMAN NUMERAL ONE THOUSAND: ⅿ -\def\carriagereturn {\char"021B5 } % DOWNWARDS ARROW WITH CORNER LEFTWARDS: ↵ -\def\ideographicspace {\char"03000 } % IDEOGRAPHIC SPACE:   -\def\ideographichalffillspace {\char"0303F } % IDEOGRAPHIC HALF FILL SPACE: 〿 -\def\ffligature {\char"0FB00 } % LATIN SMALL LIGATURE FF: ff -\def\filigature {\char"0FB01 } % LATIN SMALL LIGATURE FI: fi -\def\flligature {\char"0FB02 } % LATIN SMALL LIGATURE FL: fl -\def\ffiligature {\char"0FB03 } % LATIN SMALL LIGATURE FFI: ffi -\def\fflligature {\char"0FB04 } % LATIN SMALL LIGATURE FFL: ffl -\def\stligature {\char"0FB06 } % LATIN SMALL LIGATURE ST: st -\def\zerowidthnobreakspace {\char"0FEFF } % ZERO WIDTH NO-BREAK SPACE:  - -\endinput diff --git a/tex/context/base/xetx-cls.mkii b/tex/context/base/xetx-cls.mkii new file mode 100644 index 000000000..6ce696f71 --- /dev/null +++ b/tex/context/base/xetx-cls.mkii @@ -0,0 +1,378 @@ +% filename : xetx-cls.tex +% comment : generated by mtxrun --script chars --xtx +% author : Hans Hagen, PRAGMA-ADE, Hasselt NL +% copyright: PRAGMA ADE / ConTeXt Development Team +% license : see context related readme files + +% some character classes for xetex; seems to be rather hard coded, these numbers +% and also a mix of several classes; here we do linebreaks + +\defineXTXcharinjectionclass[lb:cl] +\defineXTXcharinjectionclass[lb:ex] +\defineXTXcharinjectionclass[lb:ns] +\defineXTXcharinjectionclass[lb:id] +\defineXTXcharinjectionclass[lb:op] +\defineXTXcharinjectionclass[lb:cm] +\defineXTXcharinjectionclass[lb:is] + +\dofastrecurse{"00000}{"00008}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"0000E}{"0001F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"00021}{lb:ex} +\dosetXTXcharacterclass{"00028}{lb:op} +\dosetXTXcharacterclass{"00029}{lb:cl} +\dosetXTXcharacterclass{"0002C}{lb:is} +\dosetXTXcharacterclass{"0002E}{lb:is} +\dofastrecurse{"0003A}{"0003B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:is}} +\dosetXTXcharacterclass{"0003F}{lb:ex} +\dosetXTXcharacterclass{"0005B}{lb:op} +\dosetXTXcharacterclass{"0005D}{lb:cl} +\dosetXTXcharacterclass{"0007B}{lb:op} +\dosetXTXcharacterclass{"0007D}{lb:cl} +\dofastrecurse{"0007F}{"00084}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00086}{"0009F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00300}{"0034E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00350}{"0035B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00363}{"0036F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"0037E}{lb:is} +\dofastrecurse{"00483}{"00489}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"00589}{lb:is} +\dofastrecurse{"00591}{"005BD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"005BF}{lb:cm} +\dofastrecurse{"005C1}{"005C2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"005C4}{"005C5}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"005C6}{lb:ex} +\dosetXTXcharacterclass{"005C7}{lb:cm} +\dosetXTXcharacterclass{"0060C}{lb:ex} +\dosetXTXcharacterclass{"0060D}{lb:is} +\dofastrecurse{"00610}{"00615}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"0061B}{"0061F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} +\dofastrecurse{"0064B}{"0065E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"0066A}{lb:ex} +\dosetXTXcharacterclass{"00670}{lb:cm} +\dosetXTXcharacterclass{"006D4}{lb:ex} +\dofastrecurse{"006D6}{"006DC}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"006DE}{"006E4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"006E7}{"006E8}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"006EA}{"006ED}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"00711}{lb:cm} +\dofastrecurse{"00730}{"0074A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"007A6}{"007B0}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"007EB}{"007F3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"007F8}{lb:is} +\dosetXTXcharacterclass{"007F9}{lb:ex} +\dofastrecurse{"00901}{"00903}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"0093C}{lb:cm} +\dofastrecurse{"0093E}{"0094D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00951}{"00954}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00962}{"00963}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00981}{"00983}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"009BC}{lb:cm} +\dofastrecurse{"009BE}{"009CD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"009D7}{lb:cm} +\dofastrecurse{"009E2}{"009E3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00A01}{"00A03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00A3C}{"00A4D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00A70}{"00A71}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00A81}{"00A83}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"00ABC}{lb:cm} +\dofastrecurse{"00ABE}{"00ACD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00AE2}{"00AE3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00B01}{"00B03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"00B3C}{lb:cm} +\dofastrecurse{"00B3E}{"00B57}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"00B82}{lb:cm} +\dofastrecurse{"00BBE}{"00BD7}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00C01}{"00C03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00C3E}{"00C56}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00C82}{"00C83}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"00CBC}{lb:cm} +\dofastrecurse{"00CBE}{"00CD6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00CE2}{"00CE3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00D02}{"00D03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00D3E}{"00D57}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00D82}{"00D83}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00DCA}{"00DF3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00F0D}{"00F11}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} +\dosetXTXcharacterclass{"00F14}{lb:ex} +\dofastrecurse{"00F18}{"00F19}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"00F35}{lb:cm} +\dosetXTXcharacterclass{"00F37}{lb:cm} +\dosetXTXcharacterclass{"00F39}{lb:cm} +\dosetXTXcharacterclass{"00F3A}{lb:op} +\dosetXTXcharacterclass{"00F3B}{lb:cl} +\dosetXTXcharacterclass{"00F3C}{lb:op} +\dosetXTXcharacterclass{"00F3D}{lb:cl} +\dofastrecurse{"00F3E}{"00F3F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00F71}{"00F7E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00F80}{"00F84}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00F86}{"00F87}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"00F90}{"00FBC}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"00FC6}{lb:cm} +\dosetXTXcharacterclass{"0135F}{lb:cm} +\dosetXTXcharacterclass{"0169B}{lb:op} +\dosetXTXcharacterclass{"0169C}{lb:cl} +\dofastrecurse{"01712}{"01714}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"01732}{"01734}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"01752}{"01753}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"01772}{"01773}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"017D6}{lb:ns} +\dofastrecurse{"0180B}{"0180D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"018A9}{lb:cm} +\dofastrecurse{"01920}{"0193B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"01944}{"01945}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} +\dofastrecurse{"01A17}{"01A1B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"01B00}{"01B04}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"01B34}{"01B44}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"01B6B}{"01B73}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"01DC0}{"01DFF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"0200C}{"0200F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"0201A}{lb:op} +\dosetXTXcharacterclass{"0201E}{lb:op} +\dofastrecurse{"0202A}{"0202E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"0203C}{"0203D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dosetXTXcharacterclass{"02044}{lb:is} +\dosetXTXcharacterclass{"02045}{lb:op} +\dosetXTXcharacterclass{"02046}{lb:cl} +\dofastrecurse{"02047}{"02049}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"0206A}{"0206F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"0207D}{lb:op} +\dosetXTXcharacterclass{"0207E}{lb:cl} +\dosetXTXcharacterclass{"0208D}{lb:op} +\dosetXTXcharacterclass{"0208E}{lb:cl} +\dofastrecurse{"020D0}{"020EF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"02329}{lb:op} +\dosetXTXcharacterclass{"0232A}{lb:cl} +\dofastrecurse{"02762}{"02763}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} +\dosetXTXcharacterclass{"02768}{lb:op} +\dosetXTXcharacterclass{"02769}{lb:cl} +\dosetXTXcharacterclass{"0276A}{lb:op} +\dosetXTXcharacterclass{"0276B}{lb:cl} +\dosetXTXcharacterclass{"0276C}{lb:op} +\dosetXTXcharacterclass{"0276D}{lb:cl} +\dosetXTXcharacterclass{"0276E}{lb:op} +\dosetXTXcharacterclass{"0276F}{lb:cl} +\dosetXTXcharacterclass{"02770}{lb:op} +\dosetXTXcharacterclass{"02771}{lb:cl} +\dosetXTXcharacterclass{"02772}{lb:op} +\dosetXTXcharacterclass{"02773}{lb:cl} +\dosetXTXcharacterclass{"02774}{lb:op} +\dosetXTXcharacterclass{"02775}{lb:cl} +\dosetXTXcharacterclass{"027C5}{lb:op} +\dosetXTXcharacterclass{"027C6}{lb:cl} +\dosetXTXcharacterclass{"027E6}{lb:op} +\dosetXTXcharacterclass{"027E7}{lb:cl} +\dosetXTXcharacterclass{"027E8}{lb:op} +\dosetXTXcharacterclass{"027E9}{lb:cl} +\dosetXTXcharacterclass{"027EA}{lb:op} +\dosetXTXcharacterclass{"027EB}{lb:cl} +\dosetXTXcharacterclass{"02983}{lb:op} +\dosetXTXcharacterclass{"02984}{lb:cl} +\dosetXTXcharacterclass{"02985}{lb:op} +\dosetXTXcharacterclass{"02986}{lb:cl} +\dosetXTXcharacterclass{"02987}{lb:op} +\dosetXTXcharacterclass{"02988}{lb:cl} +\dosetXTXcharacterclass{"02989}{lb:op} +\dosetXTXcharacterclass{"0298A}{lb:cl} +\dosetXTXcharacterclass{"0298B}{lb:op} +\dosetXTXcharacterclass{"0298C}{lb:cl} +\dosetXTXcharacterclass{"0298D}{lb:op} +\dosetXTXcharacterclass{"0298E}{lb:cl} +\dosetXTXcharacterclass{"0298F}{lb:op} +\dosetXTXcharacterclass{"02990}{lb:cl} +\dosetXTXcharacterclass{"02991}{lb:op} +\dosetXTXcharacterclass{"02992}{lb:cl} +\dosetXTXcharacterclass{"02993}{lb:op} +\dosetXTXcharacterclass{"02994}{lb:cl} +\dosetXTXcharacterclass{"02995}{lb:op} +\dosetXTXcharacterclass{"02996}{lb:cl} +\dosetXTXcharacterclass{"02997}{lb:op} +\dosetXTXcharacterclass{"02998}{lb:cl} +\dosetXTXcharacterclass{"029D8}{lb:op} +\dosetXTXcharacterclass{"029D9}{lb:cl} +\dosetXTXcharacterclass{"029DA}{lb:op} +\dosetXTXcharacterclass{"029DB}{lb:cl} +\dosetXTXcharacterclass{"029FC}{lb:op} +\dosetXTXcharacterclass{"029FD}{lb:cl} +\dofastrecurse{"02E80}{"03000}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"03001}{"03002}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} +\dofastrecurse{"03003}{"03004}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"03005}{lb:ns} +\dofastrecurse{"03006}{"03007}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"03008}{lb:op} +\dosetXTXcharacterclass{"03009}{lb:cl} +\dosetXTXcharacterclass{"0300A}{lb:op} +\dosetXTXcharacterclass{"0300B}{lb:cl} +\dosetXTXcharacterclass{"0300C}{lb:op} +\dosetXTXcharacterclass{"0300D}{lb:cl} +\dosetXTXcharacterclass{"0300E}{lb:op} +\dosetXTXcharacterclass{"0300F}{lb:cl} +\dosetXTXcharacterclass{"03010}{lb:op} +\dosetXTXcharacterclass{"03011}{lb:cl} +\dofastrecurse{"03012}{"03013}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"03014}{lb:op} +\dosetXTXcharacterclass{"03015}{lb:cl} +\dosetXTXcharacterclass{"03016}{lb:op} +\dosetXTXcharacterclass{"03017}{lb:cl} +\dosetXTXcharacterclass{"03018}{lb:op} +\dosetXTXcharacterclass{"03019}{lb:cl} +\dosetXTXcharacterclass{"0301A}{lb:op} +\dosetXTXcharacterclass{"0301B}{lb:cl} +\dosetXTXcharacterclass{"0301C}{lb:ns} +\dosetXTXcharacterclass{"0301D}{lb:op} +\dofastrecurse{"0301E}{"0301F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} +\dofastrecurse{"03020}{"03029}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"0302A}{"0302F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"03030}{"0303A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"0303B}{"0303C}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"0303D}{"0303F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"03041}{lb:ns} +\dosetXTXcharacterclass{"03042}{lb:id} +\dosetXTXcharacterclass{"03043}{lb:ns} +\dosetXTXcharacterclass{"03044}{lb:id} +\dosetXTXcharacterclass{"03045}{lb:ns} +\dosetXTXcharacterclass{"03046}{lb:id} +\dosetXTXcharacterclass{"03047}{lb:ns} +\dosetXTXcharacterclass{"03048}{lb:id} +\dosetXTXcharacterclass{"03049}{lb:ns} +\dofastrecurse{"0304A}{"03062}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"03063}{lb:ns} +\dofastrecurse{"03064}{"03082}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"03083}{lb:ns} +\dosetXTXcharacterclass{"03084}{lb:id} +\dosetXTXcharacterclass{"03085}{lb:ns} +\dosetXTXcharacterclass{"03086}{lb:id} +\dosetXTXcharacterclass{"03087}{lb:ns} +\dofastrecurse{"03088}{"0308D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0308E}{lb:ns} +\dofastrecurse{"0308F}{"03094}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"03095}{"03096}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"03099}{"0309A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"0309B}{"0309E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dosetXTXcharacterclass{"0309F}{lb:id} +\dofastrecurse{"030A0}{"030A1}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dosetXTXcharacterclass{"030A2}{lb:id} +\dosetXTXcharacterclass{"030A3}{lb:ns} +\dosetXTXcharacterclass{"030A4}{lb:id} +\dosetXTXcharacterclass{"030A5}{lb:ns} +\dosetXTXcharacterclass{"030A6}{lb:id} +\dosetXTXcharacterclass{"030A7}{lb:ns} +\dosetXTXcharacterclass{"030A8}{lb:id} +\dosetXTXcharacterclass{"030A9}{lb:ns} +\dofastrecurse{"030AA}{"030C2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"030C3}{lb:ns} +\dofastrecurse{"030C4}{"030E2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"030E3}{lb:ns} +\dosetXTXcharacterclass{"030E4}{lb:id} +\dosetXTXcharacterclass{"030E5}{lb:ns} +\dosetXTXcharacterclass{"030E6}{lb:id} +\dosetXTXcharacterclass{"030E7}{lb:ns} +\dofastrecurse{"030E8}{"030ED}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"030EE}{lb:ns} +\dofastrecurse{"030EF}{"030F4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"030F5}{"030F6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"030F7}{"030FA}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"030FB}{"030FE}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"030FF}{"031CF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"031F0}{"031FF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"03200}{"03400}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"04E00}{"0A014}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0A015}{lb:ns} +\dofastrecurse{"0A016}{"0A4C6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0A802}{lb:cm} +\dosetXTXcharacterclass{"0A806}{lb:cm} +\dosetXTXcharacterclass{"0A80B}{lb:cm} +\dofastrecurse{"0A823}{"0A827}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"0A876}{"0A877}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} +\dofastrecurse{"0F900}{"0FAD9}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FB1E}{lb:cm} +\dosetXTXcharacterclass{"0FD3E}{lb:op} +\dosetXTXcharacterclass{"0FD3F}{lb:cl} +\dofastrecurse{"0FE00}{"0FE0F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dosetXTXcharacterclass{"0FE10}{lb:is} +\dofastrecurse{"0FE11}{"0FE12}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} +\dofastrecurse{"0FE13}{"0FE14}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:is}} +\dofastrecurse{"0FE15}{"0FE16}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} +\dosetXTXcharacterclass{"0FE17}{lb:op} +\dosetXTXcharacterclass{"0FE18}{lb:cl} +\dofastrecurse{"0FE20}{"0FE23}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"0FE30}{"0FE34}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FE35}{lb:op} +\dosetXTXcharacterclass{"0FE36}{lb:cl} +\dosetXTXcharacterclass{"0FE37}{lb:op} +\dosetXTXcharacterclass{"0FE38}{lb:cl} +\dosetXTXcharacterclass{"0FE39}{lb:op} +\dosetXTXcharacterclass{"0FE3A}{lb:cl} +\dosetXTXcharacterclass{"0FE3B}{lb:op} +\dosetXTXcharacterclass{"0FE3C}{lb:cl} +\dosetXTXcharacterclass{"0FE3D}{lb:op} +\dosetXTXcharacterclass{"0FE3E}{lb:cl} +\dosetXTXcharacterclass{"0FE3F}{lb:op} +\dosetXTXcharacterclass{"0FE40}{lb:cl} +\dosetXTXcharacterclass{"0FE41}{lb:op} +\dosetXTXcharacterclass{"0FE42}{lb:cl} +\dosetXTXcharacterclass{"0FE43}{lb:op} +\dosetXTXcharacterclass{"0FE44}{lb:cl} +\dofastrecurse{"0FE45}{"0FE46}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FE47}{lb:op} +\dosetXTXcharacterclass{"0FE48}{lb:cl} +\dofastrecurse{"0FE49}{"0FE4F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FE50}{lb:cl} +\dosetXTXcharacterclass{"0FE51}{lb:id} +\dosetXTXcharacterclass{"0FE52}{lb:cl} +\dofastrecurse{"0FE54}{"0FE55}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"0FE56}{"0FE57}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} +\dosetXTXcharacterclass{"0FE58}{lb:id} +\dosetXTXcharacterclass{"0FE59}{lb:op} +\dosetXTXcharacterclass{"0FE5A}{lb:cl} +\dosetXTXcharacterclass{"0FE5B}{lb:op} +\dosetXTXcharacterclass{"0FE5C}{lb:cl} +\dosetXTXcharacterclass{"0FE5D}{lb:op} +\dosetXTXcharacterclass{"0FE5E}{lb:cl} +\dofastrecurse{"0FE5F}{"0FE68}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FE6B}{lb:id} +\dosetXTXcharacterclass{"0FF01}{lb:ex} +\dofastrecurse{"0FF02}{"0FF03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"0FF06}{"0FF07}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FF08}{lb:op} +\dosetXTXcharacterclass{"0FF09}{lb:cl} +\dofastrecurse{"0FF0A}{"0FF0B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FF0C}{lb:cl} +\dosetXTXcharacterclass{"0FF0D}{lb:id} +\dosetXTXcharacterclass{"0FF0E}{lb:cl} +\dofastrecurse{"0FF0F}{"0FF19}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"0FF1A}{"0FF1B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"0FF1C}{"0FF1E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FF1F}{lb:ex} +\dofastrecurse{"0FF20}{"0FF3A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FF3B}{lb:op} +\dosetXTXcharacterclass{"0FF3C}{lb:id} +\dosetXTXcharacterclass{"0FF3D}{lb:cl} +\dofastrecurse{"0FF3E}{"0FF5A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dosetXTXcharacterclass{"0FF5B}{lb:op} +\dosetXTXcharacterclass{"0FF5C}{lb:id} +\dosetXTXcharacterclass{"0FF5D}{lb:cl} +\dosetXTXcharacterclass{"0FF5E}{lb:id} +\dosetXTXcharacterclass{"0FF5F}{lb:op} +\dofastrecurse{"0FF60}{"0FF61}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} +\dosetXTXcharacterclass{"0FF62}{lb:op} +\dofastrecurse{"0FF63}{"0FF64}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} +\dosetXTXcharacterclass{"0FF65}{lb:ns} +\dofastrecurse{"0FF67}{"0FF70}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"0FF9E}{"0FF9F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} +\dofastrecurse{"0FFE2}{"0FFE4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"0FFF9}{"0FFFB}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"10A01}{"10A0F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"10A38}{"10A3F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"1D165}{"1D169}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"1D16D}{"1D182}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"1D185}{"1D18B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"1D1AA}{"1D1AD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"1D242}{"1D244}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} +\dofastrecurse{"20000}{"2FA1D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"E0001}{"E01EF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} + +\dofastrecurse{"03400}{"04DB5}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"04E00}{"09FBB}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} +\dofastrecurse{"20000}{"2A6D6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} + +\endinput diff --git a/tex/context/base/xetx-cls.tex b/tex/context/base/xetx-cls.tex deleted file mode 100644 index 6ce696f71..000000000 --- a/tex/context/base/xetx-cls.tex +++ /dev/null @@ -1,378 +0,0 @@ -% filename : xetx-cls.tex -% comment : generated by mtxrun --script chars --xtx -% author : Hans Hagen, PRAGMA-ADE, Hasselt NL -% copyright: PRAGMA ADE / ConTeXt Development Team -% license : see context related readme files - -% some character classes for xetex; seems to be rather hard coded, these numbers -% and also a mix of several classes; here we do linebreaks - -\defineXTXcharinjectionclass[lb:cl] -\defineXTXcharinjectionclass[lb:ex] -\defineXTXcharinjectionclass[lb:ns] -\defineXTXcharinjectionclass[lb:id] -\defineXTXcharinjectionclass[lb:op] -\defineXTXcharinjectionclass[lb:cm] -\defineXTXcharinjectionclass[lb:is] - -\dofastrecurse{"00000}{"00008}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"0000E}{"0001F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"00021}{lb:ex} -\dosetXTXcharacterclass{"00028}{lb:op} -\dosetXTXcharacterclass{"00029}{lb:cl} -\dosetXTXcharacterclass{"0002C}{lb:is} -\dosetXTXcharacterclass{"0002E}{lb:is} -\dofastrecurse{"0003A}{"0003B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:is}} -\dosetXTXcharacterclass{"0003F}{lb:ex} -\dosetXTXcharacterclass{"0005B}{lb:op} -\dosetXTXcharacterclass{"0005D}{lb:cl} -\dosetXTXcharacterclass{"0007B}{lb:op} -\dosetXTXcharacterclass{"0007D}{lb:cl} -\dofastrecurse{"0007F}{"00084}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00086}{"0009F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00300}{"0034E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00350}{"0035B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00363}{"0036F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"0037E}{lb:is} -\dofastrecurse{"00483}{"00489}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"00589}{lb:is} -\dofastrecurse{"00591}{"005BD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"005BF}{lb:cm} -\dofastrecurse{"005C1}{"005C2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"005C4}{"005C5}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"005C6}{lb:ex} -\dosetXTXcharacterclass{"005C7}{lb:cm} -\dosetXTXcharacterclass{"0060C}{lb:ex} -\dosetXTXcharacterclass{"0060D}{lb:is} -\dofastrecurse{"00610}{"00615}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"0061B}{"0061F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} -\dofastrecurse{"0064B}{"0065E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"0066A}{lb:ex} -\dosetXTXcharacterclass{"00670}{lb:cm} -\dosetXTXcharacterclass{"006D4}{lb:ex} -\dofastrecurse{"006D6}{"006DC}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"006DE}{"006E4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"006E7}{"006E8}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"006EA}{"006ED}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"00711}{lb:cm} -\dofastrecurse{"00730}{"0074A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"007A6}{"007B0}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"007EB}{"007F3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"007F8}{lb:is} -\dosetXTXcharacterclass{"007F9}{lb:ex} -\dofastrecurse{"00901}{"00903}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"0093C}{lb:cm} -\dofastrecurse{"0093E}{"0094D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00951}{"00954}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00962}{"00963}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00981}{"00983}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"009BC}{lb:cm} -\dofastrecurse{"009BE}{"009CD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"009D7}{lb:cm} -\dofastrecurse{"009E2}{"009E3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00A01}{"00A03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00A3C}{"00A4D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00A70}{"00A71}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00A81}{"00A83}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"00ABC}{lb:cm} -\dofastrecurse{"00ABE}{"00ACD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00AE2}{"00AE3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00B01}{"00B03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"00B3C}{lb:cm} -\dofastrecurse{"00B3E}{"00B57}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"00B82}{lb:cm} -\dofastrecurse{"00BBE}{"00BD7}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00C01}{"00C03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00C3E}{"00C56}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00C82}{"00C83}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"00CBC}{lb:cm} -\dofastrecurse{"00CBE}{"00CD6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00CE2}{"00CE3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00D02}{"00D03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00D3E}{"00D57}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00D82}{"00D83}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00DCA}{"00DF3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00F0D}{"00F11}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} -\dosetXTXcharacterclass{"00F14}{lb:ex} -\dofastrecurse{"00F18}{"00F19}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"00F35}{lb:cm} -\dosetXTXcharacterclass{"00F37}{lb:cm} -\dosetXTXcharacterclass{"00F39}{lb:cm} -\dosetXTXcharacterclass{"00F3A}{lb:op} -\dosetXTXcharacterclass{"00F3B}{lb:cl} -\dosetXTXcharacterclass{"00F3C}{lb:op} -\dosetXTXcharacterclass{"00F3D}{lb:cl} -\dofastrecurse{"00F3E}{"00F3F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00F71}{"00F7E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00F80}{"00F84}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00F86}{"00F87}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"00F90}{"00FBC}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"00FC6}{lb:cm} -\dosetXTXcharacterclass{"0135F}{lb:cm} -\dosetXTXcharacterclass{"0169B}{lb:op} -\dosetXTXcharacterclass{"0169C}{lb:cl} -\dofastrecurse{"01712}{"01714}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"01732}{"01734}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"01752}{"01753}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"01772}{"01773}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"017D6}{lb:ns} -\dofastrecurse{"0180B}{"0180D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"018A9}{lb:cm} -\dofastrecurse{"01920}{"0193B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"01944}{"01945}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} -\dofastrecurse{"01A17}{"01A1B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"01B00}{"01B04}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"01B34}{"01B44}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"01B6B}{"01B73}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"01DC0}{"01DFF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"0200C}{"0200F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"0201A}{lb:op} -\dosetXTXcharacterclass{"0201E}{lb:op} -\dofastrecurse{"0202A}{"0202E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"0203C}{"0203D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dosetXTXcharacterclass{"02044}{lb:is} -\dosetXTXcharacterclass{"02045}{lb:op} -\dosetXTXcharacterclass{"02046}{lb:cl} -\dofastrecurse{"02047}{"02049}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"0206A}{"0206F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"0207D}{lb:op} -\dosetXTXcharacterclass{"0207E}{lb:cl} -\dosetXTXcharacterclass{"0208D}{lb:op} -\dosetXTXcharacterclass{"0208E}{lb:cl} -\dofastrecurse{"020D0}{"020EF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"02329}{lb:op} -\dosetXTXcharacterclass{"0232A}{lb:cl} -\dofastrecurse{"02762}{"02763}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} -\dosetXTXcharacterclass{"02768}{lb:op} -\dosetXTXcharacterclass{"02769}{lb:cl} -\dosetXTXcharacterclass{"0276A}{lb:op} -\dosetXTXcharacterclass{"0276B}{lb:cl} -\dosetXTXcharacterclass{"0276C}{lb:op} -\dosetXTXcharacterclass{"0276D}{lb:cl} -\dosetXTXcharacterclass{"0276E}{lb:op} -\dosetXTXcharacterclass{"0276F}{lb:cl} -\dosetXTXcharacterclass{"02770}{lb:op} -\dosetXTXcharacterclass{"02771}{lb:cl} -\dosetXTXcharacterclass{"02772}{lb:op} -\dosetXTXcharacterclass{"02773}{lb:cl} -\dosetXTXcharacterclass{"02774}{lb:op} -\dosetXTXcharacterclass{"02775}{lb:cl} -\dosetXTXcharacterclass{"027C5}{lb:op} -\dosetXTXcharacterclass{"027C6}{lb:cl} -\dosetXTXcharacterclass{"027E6}{lb:op} -\dosetXTXcharacterclass{"027E7}{lb:cl} -\dosetXTXcharacterclass{"027E8}{lb:op} -\dosetXTXcharacterclass{"027E9}{lb:cl} -\dosetXTXcharacterclass{"027EA}{lb:op} -\dosetXTXcharacterclass{"027EB}{lb:cl} -\dosetXTXcharacterclass{"02983}{lb:op} -\dosetXTXcharacterclass{"02984}{lb:cl} -\dosetXTXcharacterclass{"02985}{lb:op} -\dosetXTXcharacterclass{"02986}{lb:cl} -\dosetXTXcharacterclass{"02987}{lb:op} -\dosetXTXcharacterclass{"02988}{lb:cl} -\dosetXTXcharacterclass{"02989}{lb:op} -\dosetXTXcharacterclass{"0298A}{lb:cl} -\dosetXTXcharacterclass{"0298B}{lb:op} -\dosetXTXcharacterclass{"0298C}{lb:cl} -\dosetXTXcharacterclass{"0298D}{lb:op} -\dosetXTXcharacterclass{"0298E}{lb:cl} -\dosetXTXcharacterclass{"0298F}{lb:op} -\dosetXTXcharacterclass{"02990}{lb:cl} -\dosetXTXcharacterclass{"02991}{lb:op} -\dosetXTXcharacterclass{"02992}{lb:cl} -\dosetXTXcharacterclass{"02993}{lb:op} -\dosetXTXcharacterclass{"02994}{lb:cl} -\dosetXTXcharacterclass{"02995}{lb:op} -\dosetXTXcharacterclass{"02996}{lb:cl} -\dosetXTXcharacterclass{"02997}{lb:op} -\dosetXTXcharacterclass{"02998}{lb:cl} -\dosetXTXcharacterclass{"029D8}{lb:op} -\dosetXTXcharacterclass{"029D9}{lb:cl} -\dosetXTXcharacterclass{"029DA}{lb:op} -\dosetXTXcharacterclass{"029DB}{lb:cl} -\dosetXTXcharacterclass{"029FC}{lb:op} -\dosetXTXcharacterclass{"029FD}{lb:cl} -\dofastrecurse{"02E80}{"03000}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"03001}{"03002}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} -\dofastrecurse{"03003}{"03004}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"03005}{lb:ns} -\dofastrecurse{"03006}{"03007}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"03008}{lb:op} -\dosetXTXcharacterclass{"03009}{lb:cl} -\dosetXTXcharacterclass{"0300A}{lb:op} -\dosetXTXcharacterclass{"0300B}{lb:cl} -\dosetXTXcharacterclass{"0300C}{lb:op} -\dosetXTXcharacterclass{"0300D}{lb:cl} -\dosetXTXcharacterclass{"0300E}{lb:op} -\dosetXTXcharacterclass{"0300F}{lb:cl} -\dosetXTXcharacterclass{"03010}{lb:op} -\dosetXTXcharacterclass{"03011}{lb:cl} -\dofastrecurse{"03012}{"03013}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"03014}{lb:op} -\dosetXTXcharacterclass{"03015}{lb:cl} -\dosetXTXcharacterclass{"03016}{lb:op} -\dosetXTXcharacterclass{"03017}{lb:cl} -\dosetXTXcharacterclass{"03018}{lb:op} -\dosetXTXcharacterclass{"03019}{lb:cl} -\dosetXTXcharacterclass{"0301A}{lb:op} -\dosetXTXcharacterclass{"0301B}{lb:cl} -\dosetXTXcharacterclass{"0301C}{lb:ns} -\dosetXTXcharacterclass{"0301D}{lb:op} -\dofastrecurse{"0301E}{"0301F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} -\dofastrecurse{"03020}{"03029}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"0302A}{"0302F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"03030}{"0303A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"0303B}{"0303C}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"0303D}{"0303F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"03041}{lb:ns} -\dosetXTXcharacterclass{"03042}{lb:id} -\dosetXTXcharacterclass{"03043}{lb:ns} -\dosetXTXcharacterclass{"03044}{lb:id} -\dosetXTXcharacterclass{"03045}{lb:ns} -\dosetXTXcharacterclass{"03046}{lb:id} -\dosetXTXcharacterclass{"03047}{lb:ns} -\dosetXTXcharacterclass{"03048}{lb:id} -\dosetXTXcharacterclass{"03049}{lb:ns} -\dofastrecurse{"0304A}{"03062}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"03063}{lb:ns} -\dofastrecurse{"03064}{"03082}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"03083}{lb:ns} -\dosetXTXcharacterclass{"03084}{lb:id} -\dosetXTXcharacterclass{"03085}{lb:ns} -\dosetXTXcharacterclass{"03086}{lb:id} -\dosetXTXcharacterclass{"03087}{lb:ns} -\dofastrecurse{"03088}{"0308D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0308E}{lb:ns} -\dofastrecurse{"0308F}{"03094}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"03095}{"03096}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"03099}{"0309A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"0309B}{"0309E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dosetXTXcharacterclass{"0309F}{lb:id} -\dofastrecurse{"030A0}{"030A1}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dosetXTXcharacterclass{"030A2}{lb:id} -\dosetXTXcharacterclass{"030A3}{lb:ns} -\dosetXTXcharacterclass{"030A4}{lb:id} -\dosetXTXcharacterclass{"030A5}{lb:ns} -\dosetXTXcharacterclass{"030A6}{lb:id} -\dosetXTXcharacterclass{"030A7}{lb:ns} -\dosetXTXcharacterclass{"030A8}{lb:id} -\dosetXTXcharacterclass{"030A9}{lb:ns} -\dofastrecurse{"030AA}{"030C2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"030C3}{lb:ns} -\dofastrecurse{"030C4}{"030E2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"030E3}{lb:ns} -\dosetXTXcharacterclass{"030E4}{lb:id} -\dosetXTXcharacterclass{"030E5}{lb:ns} -\dosetXTXcharacterclass{"030E6}{lb:id} -\dosetXTXcharacterclass{"030E7}{lb:ns} -\dofastrecurse{"030E8}{"030ED}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"030EE}{lb:ns} -\dofastrecurse{"030EF}{"030F4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"030F5}{"030F6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"030F7}{"030FA}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"030FB}{"030FE}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"030FF}{"031CF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"031F0}{"031FF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"03200}{"03400}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"04E00}{"0A014}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0A015}{lb:ns} -\dofastrecurse{"0A016}{"0A4C6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0A802}{lb:cm} -\dosetXTXcharacterclass{"0A806}{lb:cm} -\dosetXTXcharacterclass{"0A80B}{lb:cm} -\dofastrecurse{"0A823}{"0A827}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"0A876}{"0A877}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} -\dofastrecurse{"0F900}{"0FAD9}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FB1E}{lb:cm} -\dosetXTXcharacterclass{"0FD3E}{lb:op} -\dosetXTXcharacterclass{"0FD3F}{lb:cl} -\dofastrecurse{"0FE00}{"0FE0F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dosetXTXcharacterclass{"0FE10}{lb:is} -\dofastrecurse{"0FE11}{"0FE12}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} -\dofastrecurse{"0FE13}{"0FE14}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:is}} -\dofastrecurse{"0FE15}{"0FE16}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} -\dosetXTXcharacterclass{"0FE17}{lb:op} -\dosetXTXcharacterclass{"0FE18}{lb:cl} -\dofastrecurse{"0FE20}{"0FE23}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"0FE30}{"0FE34}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FE35}{lb:op} -\dosetXTXcharacterclass{"0FE36}{lb:cl} -\dosetXTXcharacterclass{"0FE37}{lb:op} -\dosetXTXcharacterclass{"0FE38}{lb:cl} -\dosetXTXcharacterclass{"0FE39}{lb:op} -\dosetXTXcharacterclass{"0FE3A}{lb:cl} -\dosetXTXcharacterclass{"0FE3B}{lb:op} -\dosetXTXcharacterclass{"0FE3C}{lb:cl} -\dosetXTXcharacterclass{"0FE3D}{lb:op} -\dosetXTXcharacterclass{"0FE3E}{lb:cl} -\dosetXTXcharacterclass{"0FE3F}{lb:op} -\dosetXTXcharacterclass{"0FE40}{lb:cl} -\dosetXTXcharacterclass{"0FE41}{lb:op} -\dosetXTXcharacterclass{"0FE42}{lb:cl} -\dosetXTXcharacterclass{"0FE43}{lb:op} -\dosetXTXcharacterclass{"0FE44}{lb:cl} -\dofastrecurse{"0FE45}{"0FE46}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FE47}{lb:op} -\dosetXTXcharacterclass{"0FE48}{lb:cl} -\dofastrecurse{"0FE49}{"0FE4F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FE50}{lb:cl} -\dosetXTXcharacterclass{"0FE51}{lb:id} -\dosetXTXcharacterclass{"0FE52}{lb:cl} -\dofastrecurse{"0FE54}{"0FE55}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"0FE56}{"0FE57}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}} -\dosetXTXcharacterclass{"0FE58}{lb:id} -\dosetXTXcharacterclass{"0FE59}{lb:op} -\dosetXTXcharacterclass{"0FE5A}{lb:cl} -\dosetXTXcharacterclass{"0FE5B}{lb:op} -\dosetXTXcharacterclass{"0FE5C}{lb:cl} -\dosetXTXcharacterclass{"0FE5D}{lb:op} -\dosetXTXcharacterclass{"0FE5E}{lb:cl} -\dofastrecurse{"0FE5F}{"0FE68}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FE6B}{lb:id} -\dosetXTXcharacterclass{"0FF01}{lb:ex} -\dofastrecurse{"0FF02}{"0FF03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"0FF06}{"0FF07}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FF08}{lb:op} -\dosetXTXcharacterclass{"0FF09}{lb:cl} -\dofastrecurse{"0FF0A}{"0FF0B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FF0C}{lb:cl} -\dosetXTXcharacterclass{"0FF0D}{lb:id} -\dosetXTXcharacterclass{"0FF0E}{lb:cl} -\dofastrecurse{"0FF0F}{"0FF19}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"0FF1A}{"0FF1B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"0FF1C}{"0FF1E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FF1F}{lb:ex} -\dofastrecurse{"0FF20}{"0FF3A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FF3B}{lb:op} -\dosetXTXcharacterclass{"0FF3C}{lb:id} -\dosetXTXcharacterclass{"0FF3D}{lb:cl} -\dofastrecurse{"0FF3E}{"0FF5A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dosetXTXcharacterclass{"0FF5B}{lb:op} -\dosetXTXcharacterclass{"0FF5C}{lb:id} -\dosetXTXcharacterclass{"0FF5D}{lb:cl} -\dosetXTXcharacterclass{"0FF5E}{lb:id} -\dosetXTXcharacterclass{"0FF5F}{lb:op} -\dofastrecurse{"0FF60}{"0FF61}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} -\dosetXTXcharacterclass{"0FF62}{lb:op} -\dofastrecurse{"0FF63}{"0FF64}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}} -\dosetXTXcharacterclass{"0FF65}{lb:ns} -\dofastrecurse{"0FF67}{"0FF70}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"0FF9E}{"0FF9F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}} -\dofastrecurse{"0FFE2}{"0FFE4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"0FFF9}{"0FFFB}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"10A01}{"10A0F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"10A38}{"10A3F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"1D165}{"1D169}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"1D16D}{"1D182}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"1D185}{"1D18B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"1D1AA}{"1D1AD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"1D242}{"1D244}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} -\dofastrecurse{"20000}{"2FA1D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"E0001}{"E01EF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}} - -\dofastrecurse{"03400}{"04DB5}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"04E00}{"09FBB}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} -\dofastrecurse{"20000}{"2A6D6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}} - -\endinput diff --git a/tex/context/base/xetx-ini.mkii b/tex/context/base/xetx-ini.mkii new file mode 100644 index 000000000..db3cccabd --- /dev/null +++ b/tex/context/base/xetx-ini.mkii @@ -0,0 +1,132 @@ +%D \module +%D [ file=xetx-ini, +%D version=2004.09.11, +%D title=\CONTEXT\ System Macros, +%D subtitle=\XETEX\ Initializations, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 moved some code around and now have reorganized the xetex +%D code in the \type {xetx} module namespace. + +\unprotect + +%D Some defaults. + +\ifdefined\XeTeXuseglyphmetrics + \XeTeXuseglyphmetrics\plusone +\fi + +%D Character classes. + +\newcount\nofXTXcharinjections + +\def\defineXTXcharinjectionclass[#1]% + {\global\advance\nofXTXcharinjections\plusone + \setxvalue{@xtx@cc@#1}{\number\nofXTXcharinjections}} + +\setxvalue{@xtx@cc@\s!default}{0} + +\def\getXTXcharinjectionclass#1% + {\csname @xtx@cc@\ifcsname @xtx@cc@#1\endcsname#1\else\s!default\fi\endcsname} + +\let\currentXTXcharinjection\s!default + +\def\startXTXcharinjecxtions[#1]% + {\pushmacro\currentXTXcharinjection + \def\currentXTXcharinjection{#1}} + +\def\stopXTXcharinjections + {\popmacro\currentXTXcharinjection} + +\def\defineXTXcharinjection #1 #2 % + {\doifnumberelse{#1}{\edef\XTXclassone{\number#1}}{\edef\XTXclassone{\getXTXcharinjectionclas{#1}}}% + \doifnumberelse{#2}{\edef\XTXclasstwo{\number#2}}{\edef\XTXclasstwo{\getXTXcharinjectionclas{#2}}}% + \expanded{\dodefineXTXcharinjection{\XTXclassone}{\XTXclasstwo}}} + +\def\setXTXcharcodes #1 #2 #3 % encoding syntax + {\catcode#1=11 \lccode #1=#2 \uccode #1=#3 } + +\def\dosetXTXcharcodes#1#2#3% compact syntax + {\catcode#1=11 \lccode #1=#2 \uccode #1=#3 } + +\ifdefined\XeTeXinterchartoks + + \long\def\dodefineXTXcharinjection#1#2#3% + {\XeTeXinterchartoks #1 #2 {\XTXcharinjection{#1}{#2}}% + \setvalue{@xtx@ch@\currentXTXcharinjection @#1@#2@}{#3}} + + \def\setXTXcharacterclass #1 #2 % + {\doifnumberelse{#2} + {\XeTeXcharclass#1=#2\relax} + {\XeTeXcharclass#1=\getXTXcharinjectionclass{#2}\relax}} + + \def\dosetXTXcharacterclass#1% #2 fast one + {\XeTeXcharclass#1=\getXTXcharinjectionclass} + +\else + + \long\def\dodefineXTXcharinjection#1#2#3% + {\setvalue{@xtx@ch@\currentXTXcharinjection @#1@#2@}{#3}} + + \def\setXTXcharacterclass #1 #2 % + {} + +\fi + +\chardef\XTXcharinjectionsmode=1 + +\letvalue{@xtx@ch@\s!empty}\empty + +\def\XTXcharinjection#1#2% + {\csname @xtx@ch@% + \ifcase\XTXcharinjectionsmode + \s!empty + \or + \ifcsname @xtx@ch@\currentXTXcharinjection @#1@#2@\endcsname \currentXTXcharinjection @#1@#2@\fi + \or + \ifcsname @xtx@ch@\currentXTXcharinjection @#1@#2@\endcsname \currentXTXcharinjection @#1@#2@\else + \ifcsname @xtx@ch@\s!default @#1@#2@\endcsname \s!default @#1@#2@\else + \s!empty + \fi\fi + \else + \s!empty + \fi + \endcsname} + +\def\enableXTXcharinjections[#1]% + {\def\currentXTXcharinjection{#1}} + +\protect \endinput + +\starttext + +\startXTXcharinjecxtions[default] + \defineXTXcharinjection 10 40 {[default]} +\stopXTXcharinjections + +\startXTXcharinjecxtions[whatever] + \defineXTXcharinjection 20 40 {[whatever]} +\stopXTXcharinjections + +\chardef\XTXcharinjectionsmode=0 + +\enableXTXcharinjections[default] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C +\enableXTXcharinjections[whatever] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C + +\chardef\XTXcharinjectionsmode=1 + +\enableXTXcharinjections[default] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C +\enableXTXcharinjections[whatever] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C + +\chardef\XTXcharinjectionsmode=2 + +\enableXTXcharinjections[default] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C +\enableXTXcharinjections[whatever] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C + +\stoptext diff --git a/tex/context/base/xetx-ini.tex b/tex/context/base/xetx-ini.tex deleted file mode 100644 index db3cccabd..000000000 --- a/tex/context/base/xetx-ini.tex +++ /dev/null @@ -1,132 +0,0 @@ -%D \module -%D [ file=xetx-ini, -%D version=2004.09.11, -%D title=\CONTEXT\ System Macros, -%D subtitle=\XETEX\ Initializations, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 moved some code around and now have reorganized the xetex -%D code in the \type {xetx} module namespace. - -\unprotect - -%D Some defaults. - -\ifdefined\XeTeXuseglyphmetrics - \XeTeXuseglyphmetrics\plusone -\fi - -%D Character classes. - -\newcount\nofXTXcharinjections - -\def\defineXTXcharinjectionclass[#1]% - {\global\advance\nofXTXcharinjections\plusone - \setxvalue{@xtx@cc@#1}{\number\nofXTXcharinjections}} - -\setxvalue{@xtx@cc@\s!default}{0} - -\def\getXTXcharinjectionclass#1% - {\csname @xtx@cc@\ifcsname @xtx@cc@#1\endcsname#1\else\s!default\fi\endcsname} - -\let\currentXTXcharinjection\s!default - -\def\startXTXcharinjecxtions[#1]% - {\pushmacro\currentXTXcharinjection - \def\currentXTXcharinjection{#1}} - -\def\stopXTXcharinjections - {\popmacro\currentXTXcharinjection} - -\def\defineXTXcharinjection #1 #2 % - {\doifnumberelse{#1}{\edef\XTXclassone{\number#1}}{\edef\XTXclassone{\getXTXcharinjectionclas{#1}}}% - \doifnumberelse{#2}{\edef\XTXclasstwo{\number#2}}{\edef\XTXclasstwo{\getXTXcharinjectionclas{#2}}}% - \expanded{\dodefineXTXcharinjection{\XTXclassone}{\XTXclasstwo}}} - -\def\setXTXcharcodes #1 #2 #3 % encoding syntax - {\catcode#1=11 \lccode #1=#2 \uccode #1=#3 } - -\def\dosetXTXcharcodes#1#2#3% compact syntax - {\catcode#1=11 \lccode #1=#2 \uccode #1=#3 } - -\ifdefined\XeTeXinterchartoks - - \long\def\dodefineXTXcharinjection#1#2#3% - {\XeTeXinterchartoks #1 #2 {\XTXcharinjection{#1}{#2}}% - \setvalue{@xtx@ch@\currentXTXcharinjection @#1@#2@}{#3}} - - \def\setXTXcharacterclass #1 #2 % - {\doifnumberelse{#2} - {\XeTeXcharclass#1=#2\relax} - {\XeTeXcharclass#1=\getXTXcharinjectionclass{#2}\relax}} - - \def\dosetXTXcharacterclass#1% #2 fast one - {\XeTeXcharclass#1=\getXTXcharinjectionclass} - -\else - - \long\def\dodefineXTXcharinjection#1#2#3% - {\setvalue{@xtx@ch@\currentXTXcharinjection @#1@#2@}{#3}} - - \def\setXTXcharacterclass #1 #2 % - {} - -\fi - -\chardef\XTXcharinjectionsmode=1 - -\letvalue{@xtx@ch@\s!empty}\empty - -\def\XTXcharinjection#1#2% - {\csname @xtx@ch@% - \ifcase\XTXcharinjectionsmode - \s!empty - \or - \ifcsname @xtx@ch@\currentXTXcharinjection @#1@#2@\endcsname \currentXTXcharinjection @#1@#2@\fi - \or - \ifcsname @xtx@ch@\currentXTXcharinjection @#1@#2@\endcsname \currentXTXcharinjection @#1@#2@\else - \ifcsname @xtx@ch@\s!default @#1@#2@\endcsname \s!default @#1@#2@\else - \s!empty - \fi\fi - \else - \s!empty - \fi - \endcsname} - -\def\enableXTXcharinjections[#1]% - {\def\currentXTXcharinjection{#1}} - -\protect \endinput - -\starttext - -\startXTXcharinjecxtions[default] - \defineXTXcharinjection 10 40 {[default]} -\stopXTXcharinjections - -\startXTXcharinjecxtions[whatever] - \defineXTXcharinjection 20 40 {[whatever]} -\stopXTXcharinjections - -\chardef\XTXcharinjectionsmode=0 - -\enableXTXcharinjections[default] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C -\enableXTXcharinjections[whatever] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C - -\chardef\XTXcharinjectionsmode=1 - -\enableXTXcharinjections[default] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C -\enableXTXcharinjections[whatever] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C - -\chardef\XTXcharinjectionsmode=2 - -\enableXTXcharinjections[default] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C -\enableXTXcharinjections[whatever] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C - -\stoptext diff --git a/tex/context/base/xetx-utf.mkii b/tex/context/base/xetx-utf.mkii new file mode 100644 index 000000000..79bd00745 --- /dev/null +++ b/tex/context/base/xetx-utf.mkii @@ -0,0 +1,1989 @@ +% filename : xetx-utf.tex +% comment : generated by mtxrun --script chars --xtx +% author : Hans Hagen, PRAGMA-ADE, Hasselt NL +% copyright: PRAGMA ADE / ConTeXt Development Team +% license : see context related readme files + +% lc/uc/catcode mappings + +\setXTXcharcodes "00041 "00061 "00041 % LATIN CAPITAL LETTER A +\setXTXcharcodes "00042 "00062 "00042 % LATIN CAPITAL LETTER B +\setXTXcharcodes "00043 "00063 "00043 % LATIN CAPITAL LETTER C +\setXTXcharcodes "00044 "00064 "00044 % LATIN CAPITAL LETTER D +\setXTXcharcodes "00045 "00065 "00045 % LATIN CAPITAL LETTER E +\setXTXcharcodes "00046 "00066 "00046 % LATIN CAPITAL LETTER F +\setXTXcharcodes "00047 "00067 "00047 % LATIN CAPITAL LETTER G +\setXTXcharcodes "00048 "00068 "00048 % LATIN CAPITAL LETTER H +\setXTXcharcodes "00049 "00069 "00049 % LATIN CAPITAL LETTER I +\setXTXcharcodes "0004A "0006A "0004A % LATIN CAPITAL LETTER J +\setXTXcharcodes "0004B "0006B "0004B % LATIN CAPITAL LETTER K +\setXTXcharcodes "0004C "0006C "0004C % LATIN CAPITAL LETTER L +\setXTXcharcodes "0004D "0006D "0004D % LATIN CAPITAL LETTER M +\setXTXcharcodes "0004E "0006E "0004E % LATIN CAPITAL LETTER N +\setXTXcharcodes "0004F "0006F "0004F % LATIN CAPITAL LETTER O +\setXTXcharcodes "00050 "00070 "00050 % LATIN CAPITAL LETTER P +\setXTXcharcodes "00051 "00071 "00051 % LATIN CAPITAL LETTER Q +\setXTXcharcodes "00052 "00072 "00052 % LATIN CAPITAL LETTER R +\setXTXcharcodes "00053 "00073 "00053 % LATIN CAPITAL LETTER S +\setXTXcharcodes "00054 "00074 "00054 % LATIN CAPITAL LETTER T +\setXTXcharcodes "00055 "00075 "00055 % LATIN CAPITAL LETTER U +\setXTXcharcodes "00056 "00076 "00056 % LATIN CAPITAL LETTER V +\setXTXcharcodes "00057 "00077 "00057 % LATIN CAPITAL LETTER W +\setXTXcharcodes "00058 "00078 "00058 % LATIN CAPITAL LETTER X +\setXTXcharcodes "00059 "00079 "00059 % LATIN CAPITAL LETTER Y +\setXTXcharcodes "0005A "0007A "0005A % LATIN CAPITAL LETTER Z +\setXTXcharcodes "00061 "00061 "00041 % LATIN SMALL LETTER A +\setXTXcharcodes "00062 "00062 "00042 % LATIN SMALL LETTER B +\setXTXcharcodes "00063 "00063 "00043 % LATIN SMALL LETTER C +\setXTXcharcodes "00064 "00064 "00044 % LATIN SMALL LETTER D +\setXTXcharcodes "00065 "00065 "00045 % LATIN SMALL LETTER E +\setXTXcharcodes "00066 "00066 "00046 % LATIN SMALL LETTER F +\setXTXcharcodes "00067 "00067 "00047 % LATIN SMALL LETTER G +\setXTXcharcodes "00068 "00068 "00048 % LATIN SMALL LETTER H +\setXTXcharcodes "00069 "00069 "00049 % LATIN SMALL LETTER I +\setXTXcharcodes "0006A "0006A "0004A % LATIN SMALL LETTER J +\setXTXcharcodes "0006B "0006B "0004B % LATIN SMALL LETTER K +\setXTXcharcodes "0006C "0006C "0004C % LATIN SMALL LETTER L +\setXTXcharcodes "0006D "0006D "0004D % LATIN SMALL LETTER M +\setXTXcharcodes "0006E "0006E "0004E % LATIN SMALL LETTER N +\setXTXcharcodes "0006F "0006F "0004F % LATIN SMALL LETTER O +\setXTXcharcodes "00070 "00070 "00050 % LATIN SMALL LETTER P +\setXTXcharcodes "00071 "00071 "00051 % LATIN SMALL LETTER Q +\setXTXcharcodes "00072 "00072 "00052 % LATIN SMALL LETTER R +\setXTXcharcodes "00073 "00073 "00053 % LATIN SMALL LETTER S +\setXTXcharcodes "00074 "00074 "00054 % LATIN SMALL LETTER T +\setXTXcharcodes "00075 "00075 "00055 % LATIN SMALL LETTER U +\setXTXcharcodes "00076 "00076 "00056 % LATIN SMALL LETTER V +\setXTXcharcodes "00077 "00077 "00057 % LATIN SMALL LETTER W +\setXTXcharcodes "00078 "00078 "00058 % LATIN SMALL LETTER X +\setXTXcharcodes "00079 "00079 "00059 % LATIN SMALL LETTER Y +\setXTXcharcodes "0007A "0007A "0005A % LATIN SMALL LETTER Z +\setXTXcharcodes "000AA "000AA "000AA % FEMININE ORDINAL INDICATOR +\setXTXcharcodes "000B5 "000B5 "0039C % MICRO SIGN +\setXTXcharcodes "000BA "000BA "000BA % MASCULINE ORDINAL INDICATOR +\setXTXcharcodes "000C0 "000E0 "000C0 % LATIN CAPITAL LETTER A WITH GRAVE +\setXTXcharcodes "000C1 "000E1 "000C1 % LATIN CAPITAL LETTER A WITH ACUTE +\setXTXcharcodes "000C2 "000E2 "000C2 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX +\setXTXcharcodes "000C3 "000E3 "000C3 % LATIN CAPITAL LETTER A WITH TILDE +\setXTXcharcodes "000C4 "000E4 "000C4 % LATIN CAPITAL LETTER A WITH DIAERESIS +\setXTXcharcodes "000C5 "000E5 "000C5 % LATIN CAPITAL LETTER A WITH RING ABOVE +\setXTXcharcodes "000C6 "000E6 "000C6 % LATIN CAPITAL LETTER AE +\setXTXcharcodes "000C7 "000E7 "000C7 % LATIN CAPITAL LETTER C WITH CEDILLA +\setXTXcharcodes "000C8 "000E8 "000C8 % LATIN CAPITAL LETTER E WITH GRAVE +\setXTXcharcodes "000C9 "000E9 "000C9 % LATIN CAPITAL LETTER E WITH ACUTE +\setXTXcharcodes "000CA "000EA "000CA % LATIN CAPITAL LETTER E WITH CIRCUMFLEX +\setXTXcharcodes "000CB "000EB "000CB % LATIN CAPITAL LETTER E WITH DIAERESIS +\setXTXcharcodes "000CC "000EC "000CC % LATIN CAPITAL LETTER I WITH GRAVE +\setXTXcharcodes "000CD "000ED "000CD % LATIN CAPITAL LETTER I WITH ACUTE +\setXTXcharcodes "000CE "000EE "000CE % LATIN CAPITAL LETTER I WITH CIRCUMFLEX +\setXTXcharcodes "000CF "000EF "000CF % LATIN CAPITAL LETTER I WITH DIAERESIS +\setXTXcharcodes "000D0 "000F0 "000D0 % LATIN CAPITAL LETTER ETH +\setXTXcharcodes "000D1 "000F1 "000D1 % LATIN CAPITAL LETTER N WITH TILDE +\setXTXcharcodes "000D2 "000F2 "000D2 % LATIN CAPITAL LETTER O WITH GRAVE +\setXTXcharcodes "000D3 "000F3 "000D3 % LATIN CAPITAL LETTER O WITH ACUTE +\setXTXcharcodes "000D4 "000F4 "000D4 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX +\setXTXcharcodes "000D5 "000F5 "000D5 % LATIN CAPITAL LETTER O WITH TILDE +\setXTXcharcodes "000D6 "000F6 "000D6 % LATIN CAPITAL LETTER O WITH DIAERESIS +\setXTXcharcodes "000D8 "000F8 "000D8 % LATIN CAPITAL LETTER O WITH STROKE +\setXTXcharcodes "000D9 "000F9 "000D9 % LATIN CAPITAL LETTER U WITH GRAVE +\setXTXcharcodes "000DA "000FA "000DA % LATIN CAPITAL LETTER U WITH ACUTE +\setXTXcharcodes "000DB "000FB "000DB % LATIN CAPITAL LETTER U WITH CIRCUMFLEX +\setXTXcharcodes "000DC "000FC "000DC % LATIN CAPITAL LETTER U WITH DIAERESIS +\setXTXcharcodes "000DD "000FD "000DD % LATIN CAPITAL LETTER Y WITH ACUTE +\setXTXcharcodes "000DE "000FE "000DE % LATIN CAPITAL LETTER THORN +\setXTXcharcodes "000DF "000DF "000DF % LATIN SMALL LETTER SHARP S +\setXTXcharcodes "000E0 "000E0 "000C0 % LATIN SMALL LETTER A WITH GRAVE +\setXTXcharcodes "000E1 "000E1 "000C1 % LATIN SMALL LETTER A WITH ACUTE +\setXTXcharcodes "000E2 "000E2 "000C2 % LATIN SMALL LETTER A WITH CIRCUMFLEX +\setXTXcharcodes "000E3 "000E3 "000C3 % LATIN SMALL LETTER A WITH TILDE +\setXTXcharcodes "000E4 "000E4 "000C4 % LATIN SMALL LETTER A WITH DIAERESIS +\setXTXcharcodes "000E5 "000E5 "000C5 % LATIN SMALL LETTER A WITH RING ABOVE +\setXTXcharcodes "000E6 "000E6 "000C6 % LATIN SMALL LETTER AE +\setXTXcharcodes "000E7 "000E7 "000C7 % LATIN SMALL LETTER C WITH CEDILLA +\setXTXcharcodes "000E8 "000E8 "000C8 % LATIN SMALL LETTER E WITH GRAVE +\setXTXcharcodes "000E9 "000E9 "000C9 % LATIN SMALL LETTER E WITH ACUTE +\setXTXcharcodes "000EA "000EA "000CA % LATIN SMALL LETTER E WITH CIRCUMFLEX +\setXTXcharcodes "000EB "000EB "000CB % LATIN SMALL LETTER E WITH DIAERESIS +\setXTXcharcodes "000EC "000EC "000CC % LATIN SMALL LETTER I WITH GRAVE +\setXTXcharcodes "000ED "000ED "000CD % LATIN SMALL LETTER I WITH ACUTE +\setXTXcharcodes "000EE "000EE "000CE % LATIN SMALL LETTER I WITH CIRCUMFLEX +\setXTXcharcodes "000EF "000EF "000CF % LATIN SMALL LETTER I WITH DIAERESIS +\setXTXcharcodes "000F0 "000F0 "000D0 % LATIN SMALL LETTER ETH +\setXTXcharcodes "000F1 "000F1 "000D1 % LATIN SMALL LETTER N WITH TILDE +\setXTXcharcodes "000F2 "000F2 "000D2 % LATIN SMALL LETTER O WITH GRAVE +\setXTXcharcodes "000F3 "000F3 "000D3 % LATIN SMALL LETTER O WITH ACUTE +\setXTXcharcodes "000F4 "000F4 "000D4 % LATIN SMALL LETTER O WITH CIRCUMFLEX +\setXTXcharcodes "000F5 "000F5 "000D5 % LATIN SMALL LETTER O WITH TILDE +\setXTXcharcodes "000F6 "000F6 "000D6 % LATIN SMALL LETTER O WITH DIAERESIS +\setXTXcharcodes "000F8 "000F8 "000D8 % LATIN SMALL LETTER O WITH STROKE +\setXTXcharcodes "000F9 "000F9 "000D9 % LATIN SMALL LETTER U WITH GRAVE +\setXTXcharcodes "000FA "000FA "000DA % LATIN SMALL LETTER U WITH ACUTE +\setXTXcharcodes "000FB "000FB "000DB % LATIN SMALL LETTER U WITH CIRCUMFLEX +\setXTXcharcodes "000FC "000FC "000DC % LATIN SMALL LETTER U WITH DIAERESIS +\setXTXcharcodes "000FD "000FD "000DD % LATIN SMALL LETTER Y WITH ACUTE +\setXTXcharcodes "000FE "000FE "000DE % LATIN SMALL LETTER THORN +\setXTXcharcodes "000FF "000FF "00178 % LATIN SMALL LETTER Y WITH DIAERESIS +\setXTXcharcodes "00100 "00101 "00100 % LATIN CAPITAL LETTER A WITH MACRON +\setXTXcharcodes "00101 "00101 "00100 % LATIN SMALL LETTER A WITH MACRON +\setXTXcharcodes "00102 "00103 "00102 % LATIN CAPITAL LETTER A WITH BREVE +\setXTXcharcodes "00103 "00103 "00102 % LATIN SMALL LETTER A WITH BREVE +\setXTXcharcodes "00104 "00105 "00104 % LATIN CAPITAL LETTER A WITH OGONEK +\setXTXcharcodes "00105 "00105 "00104 % LATIN SMALL LETTER A WITH OGONEK +\setXTXcharcodes "00106 "00107 "00106 % LATIN CAPITAL LETTER C WITH ACUTE +\setXTXcharcodes "00107 "00107 "00106 % LATIN SMALL LETTER C WITH ACUTE +\setXTXcharcodes "00108 "00109 "00108 % LATIN CAPITAL LETTER C WITH CIRCUMFLEX +\setXTXcharcodes "00109 "00109 "00108 % LATIN SMALL LETTER C WITH CIRCUMFLEX +\setXTXcharcodes "0010A "0010B "0010A % LATIN CAPITAL LETTER C WITH DOT ABOVE +\setXTXcharcodes "0010B "0010B "0010A % LATIN SMALL LETTER C WITH DOT ABOVE +\setXTXcharcodes "0010C "0010D "0010C % LATIN CAPITAL LETTER C WITH CARON +\setXTXcharcodes "0010D "0010D "0010C % LATIN SMALL LETTER C WITH CARON +\setXTXcharcodes "0010E "0010F "0010E % LATIN CAPITAL LETTER D WITH CARON +\setXTXcharcodes "0010F "0010F "0010E % LATIN SMALL LETTER D WITH CARON +\setXTXcharcodes "00110 "00111 "00110 % LATIN CAPITAL LETTER D WITH STROKE +\setXTXcharcodes "00111 "00111 "00110 % LATIN SMALL LETTER D WITH STROKE +\setXTXcharcodes "00112 "00113 "00112 % LATIN CAPITAL LETTER E WITH MACRON +\setXTXcharcodes "00113 "00113 "00112 % LATIN SMALL LETTER E WITH MACRON +\setXTXcharcodes "00114 "00115 "00114 % LATIN CAPITAL LETTER E WITH BREVE +\setXTXcharcodes "00115 "00115 "00114 % LATIN SMALL LETTER E WITH BREVE +\setXTXcharcodes "00116 "00117 "00116 % LATIN CAPITAL LETTER E WITH DOT ABOVE +\setXTXcharcodes "00117 "00117 "00116 % LATIN SMALL LETTER E WITH DOT ABOVE +\setXTXcharcodes "00118 "00119 "00118 % LATIN CAPITAL LETTER E WITH OGONEK +\setXTXcharcodes "00119 "00119 "00118 % LATIN SMALL LETTER E WITH OGONEK +\setXTXcharcodes "0011A "0011B "0011A % LATIN CAPITAL LETTER E WITH CARON +\setXTXcharcodes "0011B "0011B "0011A % LATIN SMALL LETTER E WITH CARON +\setXTXcharcodes "0011C "0011D "0011C % LATIN CAPITAL LETTER G WITH CIRCUMFLEX +\setXTXcharcodes "0011D "0011D "0011C % LATIN SMALL LETTER G WITH CIRCUMFLEX +\setXTXcharcodes "0011E "0011F "0011E % LATIN CAPITAL LETTER G WITH BREVE +\setXTXcharcodes "0011F "0011F "0011E % LATIN SMALL LETTER G WITH BREVE +\setXTXcharcodes "00120 "00121 "00120 % LATIN CAPITAL LETTER G WITH DOT ABOVE +\setXTXcharcodes "00121 "00121 "00120 % LATIN SMALL LETTER G WITH DOT ABOVE +\setXTXcharcodes "00122 "00123 "00122 % LATIN CAPITAL LETTER G WITH CEDILLA +\setXTXcharcodes "00123 "00123 "00122 % LATIN SMALL LETTER G WITH CEDILLA +\setXTXcharcodes "00124 "00125 "00124 % LATIN CAPITAL LETTER H WITH CIRCUMFLEX +\setXTXcharcodes "00125 "00125 "00124 % LATIN SMALL LETTER H WITH CIRCUMFLEX +\setXTXcharcodes "00126 "00127 "00126 % LATIN CAPITAL LETTER H WITH STROKE +\setXTXcharcodes "00127 "00127 "00126 % LATIN SMALL LETTER H WITH STROKE +\setXTXcharcodes "00128 "00129 "00128 % LATIN CAPITAL LETTER I WITH TILDE +\setXTXcharcodes "00129 "00129 "00128 % LATIN SMALL LETTER I WITH TILDE +\setXTXcharcodes "0012A "0012B "0012A % LATIN CAPITAL LETTER I WITH MACRON +\setXTXcharcodes "0012B "0012B "0012A % LATIN SMALL LETTER I WITH MACRON +\setXTXcharcodes "0012C "0012D "0012C % LATIN CAPITAL LETTER I WITH BREVE +\setXTXcharcodes "0012D "0012D "0012C % LATIN SMALL LETTER I WITH BREVE +\setXTXcharcodes "0012E "0012F "0012E % LATIN CAPITAL LETTER I WITH OGONEK +\setXTXcharcodes "0012F "0012F "0012E % LATIN SMALL LETTER I WITH OGONEK +\setXTXcharcodes "00130 "00069 "00130 % LATIN CAPITAL LETTER I WITH DOT ABOVE +\setXTXcharcodes "00131 "00131 "00049 % LATIN SMALL LETTER DOTLESS I +\setXTXcharcodes "00132 "00133 "00132 % LATIN CAPITAL LIGATURE IJ +\setXTXcharcodes "00133 "00133 "00132 % LATIN SMALL LIGATURE IJ +\setXTXcharcodes "00134 "00135 "00134 % LATIN CAPITAL LETTER J WITH CIRCUMFLEX +\setXTXcharcodes "00135 "00135 "00134 % LATIN SMALL LETTER J WITH CIRCUMFLEX +\setXTXcharcodes "00136 "00137 "00136 % LATIN CAPITAL LETTER K WITH CEDILLA +\setXTXcharcodes "00137 "00137 "00136 % LATIN SMALL LETTER K WITH CEDILLA +\setXTXcharcodes "00138 "00138 "00138 % LATIN SMALL LETTER KRA +\setXTXcharcodes "00139 "0013A "00139 % LATIN CAPITAL LETTER L WITH ACUTE +\setXTXcharcodes "0013A "0013A "00139 % LATIN SMALL LETTER L WITH ACUTE +\setXTXcharcodes "0013B "0013C "0013B % LATIN CAPITAL LETTER L WITH CEDILLA +\setXTXcharcodes "0013C "0013C "0013B % LATIN SMALL LETTER L WITH CEDILLA +\setXTXcharcodes "0013D "0013E "0013D % LATIN CAPITAL LETTER L WITH CARON +\setXTXcharcodes "0013E "0013E "0013D % LATIN SMALL LETTER L WITH CARON +\setXTXcharcodes "0013F "00140 "0013F % LATIN CAPITAL LETTER L WITH MIDDLE DOT +\setXTXcharcodes "00140 "00140 "0013F % LATIN SMALL LETTER L WITH MIDDLE DOT +\setXTXcharcodes "00141 "00142 "00141 % LATIN CAPITAL LETTER L WITH STROKE +\setXTXcharcodes "00142 "00142 "00141 % LATIN SMALL LETTER L WITH STROKE +\setXTXcharcodes "00143 "00144 "00143 % LATIN CAPITAL LETTER N WITH ACUTE +\setXTXcharcodes "00144 "00144 "00143 % LATIN SMALL LETTER N WITH ACUTE +\setXTXcharcodes "00145 "00146 "00145 % LATIN CAPITAL LETTER N WITH CEDILLA +\setXTXcharcodes "00146 "00146 "00145 % LATIN SMALL LETTER N WITH CEDILLA +\setXTXcharcodes "00147 "00148 "00147 % LATIN CAPITAL LETTER N WITH CARON +\setXTXcharcodes "00148 "00148 "00147 % LATIN SMALL LETTER N WITH CARON +\setXTXcharcodes "00149 "00149 "00149 % LATIN SMALL LETTER N PRECEDED BY APOSTROPHE +\setXTXcharcodes "0014A "0014B "0014A % LATIN CAPITAL LETTER ENG +\setXTXcharcodes "0014B "0014B "0014A % LATIN SMALL LETTER ENG +\setXTXcharcodes "0014C "0014D "0014C % LATIN CAPITAL LETTER O WITH MACRON +\setXTXcharcodes "0014D "0014D "0014C % LATIN SMALL LETTER O WITH MACRON +\setXTXcharcodes "0014E "0014F "0014E % LATIN CAPITAL LETTER O WITH BREVE +\setXTXcharcodes "0014F "0014F "0014E % LATIN SMALL LETTER O WITH BREVE +\setXTXcharcodes "00150 "00151 "00150 % LATIN CAPITAL LETTER O WITH DOUBLE ACUTE +\setXTXcharcodes "00151 "00151 "00150 % LATIN SMALL LETTER O WITH DOUBLE ACUTE +\setXTXcharcodes "00152 "00153 "00152 % LATIN CAPITAL LIGATURE OE +\setXTXcharcodes "00153 "00153 "00152 % LATIN SMALL LIGATURE OE +\setXTXcharcodes "00154 "00155 "00154 % LATIN CAPITAL LETTER R WITH ACUTE +\setXTXcharcodes "00155 "00155 "00154 % LATIN SMALL LETTER R WITH ACUTE +\setXTXcharcodes "00156 "00157 "00156 % LATIN CAPITAL LETTER R WITH CEDILLA +\setXTXcharcodes "00157 "00157 "00156 % LATIN SMALL LETTER R WITH CEDILLA +\setXTXcharcodes "00158 "00159 "00158 % LATIN CAPITAL LETTER R WITH CARON +\setXTXcharcodes "00159 "00159 "00158 % LATIN SMALL LETTER R WITH CARON +\setXTXcharcodes "0015A "0015B "0015A % LATIN CAPITAL LETTER S WITH ACUTE +\setXTXcharcodes "0015B "0015B "0015A % LATIN SMALL LETTER S WITH ACUTE +\setXTXcharcodes "0015C "0015D "0015C % LATIN CAPITAL LETTER S WITH CIRCUMFLEX +\setXTXcharcodes "0015D "0015D "0015C % LATIN SMALL LETTER S WITH CIRCUMFLEX +\setXTXcharcodes "0015E "0015F "0015E % LATIN CAPITAL LETTER S WITH CEDILLA +\setXTXcharcodes "0015F "0015F "0015E % LATIN SMALL LETTER S WITH CEDILLA +\setXTXcharcodes "00160 "00161 "00160 % LATIN CAPITAL LETTER S WITH CARON +\setXTXcharcodes "00161 "00161 "00160 % LATIN SMALL LETTER S WITH CARON +\setXTXcharcodes "00162 "00163 "00162 % LATIN CAPITAL LETTER T WITH CEDILLA +\setXTXcharcodes "00163 "00163 "00162 % LATIN SMALL LETTER T WITH CEDILLA +\setXTXcharcodes "00164 "00165 "00164 % LATIN CAPITAL LETTER T WITH CARON +\setXTXcharcodes "00165 "00165 "00164 % LATIN SMALL LETTER T WITH CARON +\setXTXcharcodes "00166 "00167 "00166 % LATIN CAPITAL LETTER T WITH STROKE +\setXTXcharcodes "00167 "00167 "00166 % LATIN SMALL LETTER T WITH STROKE +\setXTXcharcodes "00168 "00169 "00168 % LATIN CAPITAL LETTER U WITH TILDE +\setXTXcharcodes "00169 "00169 "00168 % LATIN SMALL LETTER U WITH TILDE +\setXTXcharcodes "0016A "0016B "0016A % LATIN CAPITAL LETTER U WITH MACRON +\setXTXcharcodes "0016B "0016B "0016A % LATIN SMALL LETTER U WITH MACRON +\setXTXcharcodes "0016C "0016D "0016C % LATIN CAPITAL LETTER U WITH BREVE +\setXTXcharcodes "0016D "0016D "0016C % LATIN SMALL LETTER U WITH BREVE +\setXTXcharcodes "0016E "0016F "0016E % LATIN CAPITAL LETTER U WITH RING ABOVE +\setXTXcharcodes "0016F "0016F "0016E % LATIN SMALL LETTER U WITH RING ABOVE +\setXTXcharcodes "00170 "00171 "00170 % LATIN CAPITAL LETTER U WITH DOUBLE ACUTE +\setXTXcharcodes "00171 "00171 "00170 % LATIN SMALL LETTER U WITH DOUBLE ACUTE +\setXTXcharcodes "00172 "00173 "00172 % LATIN CAPITAL LETTER U WITH OGONEK +\setXTXcharcodes "00173 "00173 "00172 % LATIN SMALL LETTER U WITH OGONEK +\setXTXcharcodes "00174 "00175 "00174 % LATIN CAPITAL LETTER W WITH CIRCUMFLEX +\setXTXcharcodes "00175 "00175 "00174 % LATIN SMALL LETTER W WITH CIRCUMFLEX +\setXTXcharcodes "00176 "00177 "00176 % LATIN CAPITAL LETTER Y WITH CIRCUMFLEX +\setXTXcharcodes "00177 "00177 "00176 % LATIN SMALL LETTER Y WITH CIRCUMFLEX +\setXTXcharcodes "00178 "000FF "00178 % LATIN CAPITAL LETTER Y WITH DIAERESIS +\setXTXcharcodes "00179 "0017A "00179 % LATIN CAPITAL LETTER Z WITH ACUTE +\setXTXcharcodes "0017A "0017A "00179 % LATIN SMALL LETTER Z WITH ACUTE +\setXTXcharcodes "0017B "0017C "0017B % LATIN CAPITAL LETTER Z WITH DOT ABOVE +\setXTXcharcodes "0017C "0017C "0017B % LATIN SMALL LETTER Z WITH DOT ABOVE +\setXTXcharcodes "0017D "0017E "0017D % LATIN CAPITAL LETTER Z WITH CARON +\setXTXcharcodes "0017E "0017E "0017D % LATIN SMALL LETTER Z WITH CARON +\setXTXcharcodes "0017F "0017F "00053 % LATIN SMALL LETTER LONG S +\setXTXcharcodes "00180 "00180 "00243 % LATIN SMALL LETTER B WITH STROKE +\setXTXcharcodes "00181 "00253 "00181 % LATIN CAPITAL LETTER B WITH HOOK +\setXTXcharcodes "00182 "00183 "00182 % LATIN CAPITAL LETTER B WITH TOPBAR +\setXTXcharcodes "00183 "00183 "00182 % LATIN SMALL LETTER B WITH TOPBAR +\setXTXcharcodes "00184 "00185 "00184 % LATIN CAPITAL LETTER TONE SIX +\setXTXcharcodes "00185 "00185 "00184 % LATIN SMALL LETTER TONE SIX +\setXTXcharcodes "00186 "00254 "00186 % LATIN CAPITAL LETTER OPEN O +\setXTXcharcodes "00187 "00188 "00187 % LATIN CAPITAL LETTER C WITH HOOK +\setXTXcharcodes "00188 "00188 "00187 % LATIN SMALL LETTER C WITH HOOK +\setXTXcharcodes "00189 "00256 "00189 % LATIN CAPITAL LETTER AFRICAN D +\setXTXcharcodes "0018A "00257 "0018A % LATIN CAPITAL LETTER D WITH HOOK +\setXTXcharcodes "0018B "0018C "0018B % LATIN CAPITAL LETTER D WITH TOPBAR +\setXTXcharcodes "0018C "0018C "0018B % LATIN SMALL LETTER D WITH TOPBAR +\setXTXcharcodes "0018D "0018D "0018D % LATIN SMALL LETTER TURNED DELTA +\setXTXcharcodes "0018E "001DD "0018E % LATIN CAPITAL LETTER REVERSED E +\setXTXcharcodes "0018F "00259 "0018F % LATIN CAPITAL LETTER SCHWA +\setXTXcharcodes "00190 "0025B "00190 % LATIN CAPITAL LETTER OPEN E +\setXTXcharcodes "00191 "00192 "00191 % LATIN CAPITAL LETTER F WITH HOOK +\setXTXcharcodes "00192 "00192 "00191 % LATIN SMALL LETTER F WITH HOOK +\setXTXcharcodes "00193 "00260 "00193 % LATIN CAPITAL LETTER G WITH HOOK +\setXTXcharcodes "00194 "00263 "00194 % LATIN CAPITAL LETTER GAMMA +\setXTXcharcodes "00195 "00195 "001F6 % LATIN SMALL LETTER HV +\setXTXcharcodes "00196 "00269 "00196 % LATIN CAPITAL LETTER IOTA +\setXTXcharcodes "00197 "00268 "00197 % LATIN CAPITAL LETTER I WITH STROKE +\setXTXcharcodes "00198 "00199 "00198 % LATIN CAPITAL LETTER K WITH HOOK +\setXTXcharcodes "00199 "00199 "00198 % LATIN SMALL LETTER K WITH HOOK +\setXTXcharcodes "0019A "0019A "0023D % LATIN SMALL LETTER L WITH BAR +\setXTXcharcodes "0019B "0019B "0019B % LATIN SMALL LETTER LAMBDA WITH STROKE +\setXTXcharcodes "0019C "0026F "0019C % LATIN CAPITAL LETTER TURNED M +\setXTXcharcodes "0019D "00272 "0019D % LATIN CAPITAL LETTER N WITH LEFT HOOK +\setXTXcharcodes "0019E "0019E "00220 % LATIN SMALL LETTER N WITH LONG RIGHT LEG +\setXTXcharcodes "0019F "00275 "0019F % LATIN CAPITAL LETTER O WITH MIDDLE TILDE +\setXTXcharcodes "001A0 "001A1 "001A0 % LATIN CAPITAL LETTER O WITH HORN +\setXTXcharcodes "001A1 "001A1 "001A0 % LATIN SMALL LETTER O WITH HORN +\setXTXcharcodes "001A2 "001A3 "001A2 % LATIN CAPITAL LETTER OI +\setXTXcharcodes "001A3 "001A3 "001A2 % LATIN SMALL LETTER OI +\setXTXcharcodes "001A4 "001A5 "001A4 % LATIN CAPITAL LETTER P WITH HOOK +\setXTXcharcodes "001A5 "001A5 "001A4 % LATIN SMALL LETTER P WITH HOOK +\setXTXcharcodes "001A6 "00280 "001A6 % LATIN LETTER YR +\setXTXcharcodes "001A7 "001A8 "001A7 % LATIN CAPITAL LETTER TONE TWO +\setXTXcharcodes "001A8 "001A8 "001A7 % LATIN SMALL LETTER TONE TWO +\setXTXcharcodes "001A9 "00283 "001A9 % LATIN CAPITAL LETTER ESH +\setXTXcharcodes "001AA "001AA "001AA % LATIN LETTER REVERSED ESH LOOP +\setXTXcharcodes "001AB "001AB "001AB % LATIN SMALL LETTER T WITH PALATAL HOOK +\setXTXcharcodes "001AC "001AD "001AC % LATIN CAPITAL LETTER T WITH HOOK +\setXTXcharcodes "001AD "001AD "001AC % LATIN SMALL LETTER T WITH HOOK +\setXTXcharcodes "001AE "00288 "001AE % LATIN CAPITAL LETTER T WITH RETROFLEX HOOK +\setXTXcharcodes "001AF "001B0 "001AF % LATIN CAPITAL LETTER U WITH HORN +\setXTXcharcodes "001B0 "001B0 "001AF % LATIN SMALL LETTER U WITH HORN +\setXTXcharcodes "001B1 "0028A "001B1 % LATIN CAPITAL LETTER UPSILON +\setXTXcharcodes "001B2 "0028B "001B2 % LATIN CAPITAL LETTER V WITH HOOK +\setXTXcharcodes "001B3 "001B4 "001B3 % LATIN CAPITAL LETTER Y WITH HOOK +\setXTXcharcodes "001B4 "001B4 "001B3 % LATIN SMALL LETTER Y WITH HOOK +\setXTXcharcodes "001B5 "001B6 "001B5 % LATIN CAPITAL LETTER Z WITH STROKE +\setXTXcharcodes "001B6 "001B6 "001B5 % LATIN SMALL LETTER Z WITH STROKE +\setXTXcharcodes "001B7 "00292 "001B7 % LATIN CAPITAL LETTER EZH +\setXTXcharcodes "001B8 "001B9 "001B8 % LATIN CAPITAL LETTER EZH REVERSED +\setXTXcharcodes "001B9 "001B9 "001B8 % LATIN SMALL LETTER EZH REVERSED +\setXTXcharcodes "001BA "001BA "001BA % LATIN SMALL LETTER EZH WITH TAIL +\setXTXcharcodes "001BC "001BD "001BC % LATIN CAPITAL LETTER TONE FIVE +\setXTXcharcodes "001BD "001BD "001BC % LATIN SMALL LETTER TONE FIVE +\setXTXcharcodes "001BE "001BE "001BE % LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE +\setXTXcharcodes "001BF "001BF "001F7 % LATIN LETTER WYNN +\setXTXcharcodes "001C4 "001C6 "001C5 % LATIN CAPITAL LETTER DZ WITH CARON +\setXTXcharcodes "001C5 "001C6 "001C4 % LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON +\setXTXcharcodes "001C6 "001C6 "001C4 % LATIN SMALL LETTER DZ WITH CARON +\setXTXcharcodes "001C7 "001C9 "001C8 % LATIN CAPITAL LETTER LJ +\setXTXcharcodes "001C8 "001C9 "001C7 % LATIN CAPITAL LETTER L WITH SMALL LETTER J +\setXTXcharcodes "001C9 "001C9 "001C7 % LATIN SMALL LETTER LJ +\setXTXcharcodes "001CA "001CC "001CB % LATIN CAPITAL LETTER NJ +\setXTXcharcodes "001CB "001CC "001CA % LATIN CAPITAL LETTER N WITH SMALL LETTER J +\setXTXcharcodes "001CC "001CC "001CA % LATIN SMALL LETTER NJ +\setXTXcharcodes "001CD "001CE "001CD % LATIN CAPITAL LETTER A WITH CARON +\setXTXcharcodes "001CE "001CE "001CD % LATIN SMALL LETTER A WITH CARON +\setXTXcharcodes "001CF "001D0 "001CF % LATIN CAPITAL LETTER I WITH CARON +\setXTXcharcodes "001D0 "001D0 "001CF % LATIN SMALL LETTER I WITH CARON +\setXTXcharcodes "001D1 "001D2 "001D1 % LATIN CAPITAL LETTER O WITH CARON +\setXTXcharcodes "001D2 "001D2 "001D1 % LATIN SMALL LETTER O WITH CARON +\setXTXcharcodes "001D3 "001D4 "001D3 % LATIN CAPITAL LETTER U WITH CARON +\setXTXcharcodes "001D4 "001D4 "001D3 % LATIN SMALL LETTER U WITH CARON +\setXTXcharcodes "001D5 "001D6 "001D5 % LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON +\setXTXcharcodes "001D6 "001D6 "001D5 % LATIN SMALL LETTER U WITH DIAERESIS AND MACRON +\setXTXcharcodes "001D7 "001D8 "001D7 % LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE +\setXTXcharcodes "001D8 "001D8 "001D7 % LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE +\setXTXcharcodes "001D9 "001DA "001D9 % LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON +\setXTXcharcodes "001DA "001DA "001D9 % LATIN SMALL LETTER U WITH DIAERESIS AND CARON +\setXTXcharcodes "001DB "001DC "001DB % LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE +\setXTXcharcodes "001DC "001DC "001DB % LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE +\setXTXcharcodes "001DD "001DD "0018E % LATIN SMALL LETTER TURNED E +\setXTXcharcodes "001DE "001DF "001DE % LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON +\setXTXcharcodes "001DF "001DF "001DE % LATIN SMALL LETTER A WITH DIAERESIS AND MACRON +\setXTXcharcodes "001E0 "001E1 "001E0 % LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON +\setXTXcharcodes "001E1 "001E1 "001E0 % LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON +\setXTXcharcodes "001E2 "001E3 "001E2 % LATIN CAPITAL LETTER AE WITH MACRON +\setXTXcharcodes "001E3 "001E3 "001E2 % LATIN SMALL LETTER AE WITH MACRON +\setXTXcharcodes "001E4 "001E5 "001E4 % LATIN CAPITAL LETTER G WITH STROKE +\setXTXcharcodes "001E5 "001E5 "001E4 % LATIN SMALL LETTER G WITH STROKE +\setXTXcharcodes "001E6 "001E7 "001E6 % LATIN CAPITAL LETTER G WITH CARON +\setXTXcharcodes "001E7 "001E7 "001E6 % LATIN SMALL LETTER G WITH CARON +\setXTXcharcodes "001E8 "001E9 "001E8 % LATIN CAPITAL LETTER K WITH CARON +\setXTXcharcodes "001E9 "001E9 "001E8 % LATIN SMALL LETTER K WITH CARON +\setXTXcharcodes "001EA "001EB "001EA % LATIN CAPITAL LETTER O WITH OGONEK +\setXTXcharcodes "001EB "001EB "001EA % LATIN SMALL LETTER O WITH OGONEK +\setXTXcharcodes "001EC "001ED "001EC % LATIN CAPITAL LETTER O WITH OGONEK AND MACRON +\setXTXcharcodes "001ED "001ED "001EC % LATIN SMALL LETTER O WITH OGONEK AND MACRON +\setXTXcharcodes "001EE "001EF "001EE % LATIN CAPITAL LETTER EZH WITH CARON +\setXTXcharcodes "001EF "001EF "001EE % LATIN SMALL LETTER EZH WITH CARON +\setXTXcharcodes "001F0 "001F0 "001F0 % LATIN SMALL LETTER J WITH CARON +\setXTXcharcodes "001F1 "001F3 "001F2 % LATIN CAPITAL LETTER DZ +\setXTXcharcodes "001F2 "001F3 "001F1 % LATIN CAPITAL LETTER D WITH SMALL LETTER Z +\setXTXcharcodes "001F3 "001F3 "001F1 % LATIN SMALL LETTER DZ +\setXTXcharcodes "001F4 "001F5 "001F4 % LATIN CAPITAL LETTER G WITH ACUTE +\setXTXcharcodes "001F5 "001F5 "001F4 % LATIN SMALL LETTER G WITH ACUTE +\setXTXcharcodes "001F6 "00195 "001F6 % LATIN CAPITAL LETTER HWAIR +\setXTXcharcodes "001F7 "001BF "001F7 % LATIN CAPITAL LETTER WYNN +\setXTXcharcodes "001F8 "001F9 "001F8 % LATIN CAPITAL LETTER N WITH GRAVE +\setXTXcharcodes "001F9 "001F9 "001F8 % LATIN SMALL LETTER N WITH GRAVE +\setXTXcharcodes "001FA "001FB "001FA % LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE +\setXTXcharcodes "001FB "001FB "001FA % LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE +\setXTXcharcodes "001FC "001FD "001FC % LATIN CAPITAL LETTER AE WITH ACUTE +\setXTXcharcodes "001FD "001FD "001FC % LATIN SMALL LETTER AE WITH ACUTE +\setXTXcharcodes "001FE "001FF "001FE % LATIN CAPITAL LETTER O WITH STROKE AND ACUTE +\setXTXcharcodes "001FF "001FF "001FE % LATIN SMALL LETTER O WITH STROKE AND ACUTE +\setXTXcharcodes "00200 "00201 "00200 % LATIN CAPITAL LETTER A WITH DOUBLE GRAVE +\setXTXcharcodes "00201 "00201 "00200 % LATIN SMALL LETTER A WITH DOUBLE GRAVE +\setXTXcharcodes "00202 "00203 "00202 % LATIN CAPITAL LETTER A WITH INVERTED BREVE +\setXTXcharcodes "00203 "00203 "00202 % LATIN SMALL LETTER A WITH INVERTED BREVE +\setXTXcharcodes "00204 "00205 "00204 % LATIN CAPITAL LETTER E WITH DOUBLE GRAVE +\setXTXcharcodes "00205 "00205 "00204 % LATIN SMALL LETTER E WITH DOUBLE GRAVE +\setXTXcharcodes "00206 "00207 "00206 % LATIN CAPITAL LETTER E WITH INVERTED BREVE +\setXTXcharcodes "00207 "00207 "00206 % LATIN SMALL LETTER E WITH INVERTED BREVE +\setXTXcharcodes "00208 "00209 "00208 % LATIN CAPITAL LETTER I WITH DOUBLE GRAVE +\setXTXcharcodes "00209 "00209 "00208 % LATIN SMALL LETTER I WITH DOUBLE GRAVE +\setXTXcharcodes "0020A "0020B "0020A % LATIN CAPITAL LETTER I WITH INVERTED BREVE +\setXTXcharcodes "0020B "0020B "0020A % LATIN SMALL LETTER I WITH INVERTED BREVE +\setXTXcharcodes "0020C "0020D "0020C % LATIN CAPITAL LETTER O WITH DOUBLE GRAVE +\setXTXcharcodes "0020D "0020D "0020C % LATIN SMALL LETTER O WITH DOUBLE GRAVE +\setXTXcharcodes "0020E "0020F "0020E % LATIN CAPITAL LETTER O WITH INVERTED BREVE +\setXTXcharcodes "0020F "0020F "0020E % LATIN SMALL LETTER O WITH INVERTED BREVE +\setXTXcharcodes "00210 "00211 "00210 % LATIN CAPITAL LETTER R WITH DOUBLE GRAVE +\setXTXcharcodes "00211 "00211 "00210 % LATIN SMALL LETTER R WITH DOUBLE GRAVE +\setXTXcharcodes "00212 "00213 "00212 % LATIN CAPITAL LETTER R WITH INVERTED BREVE +\setXTXcharcodes "00213 "00213 "00212 % LATIN SMALL LETTER R WITH INVERTED BREVE +\setXTXcharcodes "00214 "00215 "00214 % LATIN CAPITAL LETTER U WITH DOUBLE GRAVE +\setXTXcharcodes "00215 "00215 "00214 % LATIN SMALL LETTER U WITH DOUBLE GRAVE +\setXTXcharcodes "00216 "00217 "00216 % LATIN CAPITAL LETTER U WITH INVERTED BREVE +\setXTXcharcodes "00217 "00217 "00216 % LATIN SMALL LETTER U WITH INVERTED BREVE +\setXTXcharcodes "00218 "00219 "00218 % LATIN CAPITAL LETTER S WITH COMMA BELOW +\setXTXcharcodes "00219 "00219 "00218 % LATIN SMALL LETTER S WITH COMMA BELOW +\setXTXcharcodes "0021A "0021B "0021A % LATIN CAPITAL LETTER T WITH COMMA BELOW +\setXTXcharcodes "0021B "0021B "0021A % LATIN SMALL LETTER T WITH COMMA BELOW +\setXTXcharcodes "0021C "0021D "0021C % LATIN CAPITAL LETTER YOGH +\setXTXcharcodes "0021D "0021D "0021C % LATIN SMALL LETTER YOGH +\setXTXcharcodes "0021E "0021F "0021E % LATIN CAPITAL LETTER H WITH CARON +\setXTXcharcodes "0021F "0021F "0021E % LATIN SMALL LETTER H WITH CARON +\setXTXcharcodes "00220 "0019E "00220 % LATIN CAPITAL LETTER N WITH LONG RIGHT LEG +\setXTXcharcodes "00221 "00221 "00221 % LATIN SMALL LETTER D WITH CURL +\setXTXcharcodes "00222 "00223 "00222 % LATIN CAPITAL LETTER OU +\setXTXcharcodes "00223 "00223 "00222 % LATIN SMALL LETTER OU +\setXTXcharcodes "00224 "00225 "00224 % LATIN CAPITAL LETTER Z WITH HOOK +\setXTXcharcodes "00225 "00225 "00224 % LATIN SMALL LETTER Z WITH HOOK +\setXTXcharcodes "00226 "00227 "00226 % LATIN CAPITAL LETTER A WITH DOT ABOVE +\setXTXcharcodes "00227 "00227 "00226 % LATIN SMALL LETTER A WITH DOT ABOVE +\setXTXcharcodes "00228 "00229 "00228 % LATIN CAPITAL LETTER E WITH CEDILLA +\setXTXcharcodes "00229 "00229 "00228 % LATIN SMALL LETTER E WITH CEDILLA +\setXTXcharcodes "0022A "0022B "0022A % LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON +\setXTXcharcodes "0022B "0022B "0022A % LATIN SMALL LETTER O WITH DIAERESIS AND MACRON +\setXTXcharcodes "0022C "0022D "0022C % LATIN CAPITAL LETTER O WITH TILDE AND MACRON +\setXTXcharcodes "0022D "0022D "0022C % LATIN SMALL LETTER O WITH TILDE AND MACRON +\setXTXcharcodes "0022E "0022F "0022E % LATIN CAPITAL LETTER O WITH DOT ABOVE +\setXTXcharcodes "0022F "0022F "0022E % LATIN SMALL LETTER O WITH DOT ABOVE +\setXTXcharcodes "00230 "00231 "00230 % LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON +\setXTXcharcodes "00231 "00231 "00230 % LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON +\setXTXcharcodes "00232 "00233 "00232 % LATIN CAPITAL LETTER Y WITH MACRON +\setXTXcharcodes "00233 "00233 "00232 % LATIN SMALL LETTER Y WITH MACRON +\setXTXcharcodes "00234 "00234 "00234 % LATIN SMALL LETTER L WITH CURL +\setXTXcharcodes "00235 "00235 "00235 % LATIN SMALL LETTER N WITH CURL +\setXTXcharcodes "00236 "00236 "00236 % LATIN SMALL LETTER T WITH CURL +\setXTXcharcodes "00237 "00237 "00237 % LATIN SMALL LETTER DOTLESS J +\setXTXcharcodes "00238 "00238 "00238 % LATIN SMALL LETTER DB DIGRAPH +\setXTXcharcodes "00239 "00239 "00239 % LATIN SMALL LETTER QP DIGRAPH +\setXTXcharcodes "0023A "02C65 "0023A % LATIN CAPITAL LETTER A WITH STROKE +\setXTXcharcodes "0023B "0023C "0023B % LATIN CAPITAL LETTER C WITH STROKE +\setXTXcharcodes "0023C "0023C "0023B % LATIN SMALL LETTER C WITH STROKE +\setXTXcharcodes "0023D "0019A "0023D % LATIN CAPITAL LETTER L WITH BAR +\setXTXcharcodes "0023E "02C66 "0023E % LATIN CAPITAL LETTER T WITH DIAGONAL STROKE +\setXTXcharcodes "0023F "0023F "0023F % LATIN SMALL LETTER S WITH SWASH TAIL +\setXTXcharcodes "00240 "00240 "00240 % LATIN SMALL LETTER Z WITH SWASH TAIL +\setXTXcharcodes "00241 "00242 "00241 % LATIN CAPITAL LETTER GLOTTAL STOP +\setXTXcharcodes "00242 "00242 "00241 % LATIN SMALL LETTER GLOTTAL STOP +\setXTXcharcodes "00243 "00180 "00243 % LATIN CAPITAL LETTER B WITH STROKE +\setXTXcharcodes "00244 "00289 "00244 % LATIN CAPITAL LETTER U BAR +\setXTXcharcodes "00245 "0028C "00245 % LATIN CAPITAL LETTER TURNED V +\setXTXcharcodes "00246 "00247 "00246 % LATIN CAPITAL LETTER E WITH STROKE +\setXTXcharcodes "00247 "00247 "00246 % LATIN SMALL LETTER E WITH STROKE +\setXTXcharcodes "00248 "00249 "00248 % LATIN CAPITAL LETTER J WITH STROKE +\setXTXcharcodes "00249 "00249 "00248 % LATIN SMALL LETTER J WITH STROKE +\setXTXcharcodes "0024A "0024B "0024A % LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL +\setXTXcharcodes "0024B "0024B "0024A % LATIN SMALL LETTER Q WITH HOOK TAIL +\setXTXcharcodes "0024C "0024D "0024C % LATIN CAPITAL LETTER R WITH STROKE +\setXTXcharcodes "0024D "0024D "0024C % LATIN SMALL LETTER R WITH STROKE +\setXTXcharcodes "0024E "0024F "0024E % LATIN CAPITAL LETTER Y WITH STROKE +\setXTXcharcodes "0024F "0024F "0024E % LATIN SMALL LETTER Y WITH STROKE +\setXTXcharcodes "00250 "00250 "00250 % LATIN SMALL LETTER TURNED A +\setXTXcharcodes "00251 "00251 "00251 % LATIN SMALL LETTER ALPHA +\setXTXcharcodes "00252 "00252 "00252 % LATIN SMALL LETTER TURNED ALPHA +\setXTXcharcodes "00253 "00253 "00181 % LATIN SMALL LETTER B WITH HOOK +\setXTXcharcodes "00254 "00254 "00186 % LATIN SMALL LETTER OPEN O +\setXTXcharcodes "00255 "00255 "00255 % LATIN SMALL LETTER C WITH CURL +\setXTXcharcodes "00256 "00256 "00189 % LATIN SMALL LETTER D WITH TAIL +\setXTXcharcodes "00257 "00257 "0018A % LATIN SMALL LETTER D WITH HOOK +\setXTXcharcodes "00258 "00258 "00258 % LATIN SMALL LETTER REVERSED E +\setXTXcharcodes "00259 "00259 "0018F % LATIN SMALL LETTER SCHWA +\setXTXcharcodes "0025A "0025A "0025A % LATIN SMALL LETTER SCHWA WITH HOOK +\setXTXcharcodes "0025B "0025B "00190 % LATIN SMALL LETTER OPEN E +\setXTXcharcodes "0025C "0025C "0025C % LATIN SMALL LETTER REVERSED OPEN E +\setXTXcharcodes "0025D "0025D "0025D % LATIN SMALL LETTER REVERSED OPEN E WITH HOOK +\setXTXcharcodes "0025E "0025E "0025E % LATIN SMALL LETTER CLOSED REVERSED OPEN E +\setXTXcharcodes "0025F "0025F "0025F % LATIN SMALL LETTER DOTLESS J WITH STROKE +\setXTXcharcodes "00260 "00260 "00193 % LATIN SMALL LETTER G WITH HOOK +\setXTXcharcodes "00261 "00261 "00261 % LATIN SMALL LETTER SCRIPT G +\setXTXcharcodes "00262 "00262 "00262 % LATIN LETTER SMALL CAPITAL G +\setXTXcharcodes "00263 "00263 "00194 % LATIN SMALL LETTER GAMMA +\setXTXcharcodes "00264 "00264 "00264 % LATIN SMALL LETTER RAMS HORN +\setXTXcharcodes "00265 "00265 "00265 % LATIN SMALL LETTER TURNED H +\setXTXcharcodes "00266 "00266 "00266 % LATIN SMALL LETTER H WITH HOOK +\setXTXcharcodes "00267 "00267 "00267 % LATIN SMALL LETTER HENG WITH HOOK +\setXTXcharcodes "00268 "00268 "00197 % LATIN SMALL LETTER I WITH STROKE +\setXTXcharcodes "00269 "00269 "00196 % LATIN SMALL LETTER IOTA +\setXTXcharcodes "0026A "0026A "0026A % LATIN LETTER SMALL CAPITAL I +\setXTXcharcodes "0026B "0026B "02C62 % LATIN SMALL LETTER L WITH MIDDLE TILDE +\setXTXcharcodes "0026C "0026C "0026C % LATIN SMALL LETTER L WITH BELT +\setXTXcharcodes "0026D "0026D "0026D % LATIN SMALL LETTER L WITH RETROFLEX HOOK +\setXTXcharcodes "0026E "0026E "0026E % LATIN SMALL LETTER LEZH +\setXTXcharcodes "0026F "0026F "0019C % LATIN SMALL LETTER TURNED M +\setXTXcharcodes "00270 "00270 "00270 % LATIN SMALL LETTER TURNED M WITH LONG LEG +\setXTXcharcodes "00271 "00271 "00271 % LATIN SMALL LETTER M WITH HOOK +\setXTXcharcodes "00272 "00272 "0019D % LATIN SMALL LETTER N WITH LEFT HOOK +\setXTXcharcodes "00273 "00273 "00273 % LATIN SMALL LETTER N WITH RETROFLEX HOOK +\setXTXcharcodes "00274 "00274 "00274 % LATIN LETTER SMALL CAPITAL N +\setXTXcharcodes "00275 "00275 "0019F % LATIN SMALL LETTER BARRED O +\setXTXcharcodes "00276 "00276 "00276 % LATIN LETTER SMALL CAPITAL OE +\setXTXcharcodes "00277 "00277 "00277 % LATIN SMALL LETTER CLOSED OMEGA +\setXTXcharcodes "00278 "00278 "00278 % LATIN SMALL LETTER PHI +\setXTXcharcodes "00279 "00279 "00279 % LATIN SMALL LETTER TURNED R +\setXTXcharcodes "0027A "0027A "0027A % LATIN SMALL LETTER TURNED R WITH LONG LEG +\setXTXcharcodes "0027B "0027B "0027B % LATIN SMALL LETTER TURNED R WITH HOOK +\setXTXcharcodes "0027C "0027C "0027C % LATIN SMALL LETTER R WITH LONG LEG +\setXTXcharcodes "0027D "0027D "02C64 % LATIN SMALL LETTER R WITH TAIL +\setXTXcharcodes "0027E "0027E "0027E % LATIN SMALL LETTER R WITH FISHHOOK +\setXTXcharcodes "0027F "0027F "0027F % LATIN SMALL LETTER REVERSED R WITH FISHHOOK +\setXTXcharcodes "00280 "00280 "001A6 % LATIN LETTER SMALL CAPITAL R +\setXTXcharcodes "00281 "00281 "00281 % LATIN LETTER SMALL CAPITAL INVERTED R +\setXTXcharcodes "00282 "00282 "00282 % LATIN SMALL LETTER S WITH HOOK +\setXTXcharcodes "00283 "00283 "001A9 % LATIN SMALL LETTER ESH +\setXTXcharcodes "00284 "00284 "00284 % LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK +\setXTXcharcodes "00285 "00285 "00285 % LATIN SMALL LETTER SQUAT REVERSED ESH +\setXTXcharcodes "00286 "00286 "00286 % LATIN SMALL LETTER ESH WITH CURL +\setXTXcharcodes "00287 "00287 "00287 % LATIN SMALL LETTER TURNED T +\setXTXcharcodes "00288 "00288 "001AE % LATIN SMALL LETTER T WITH RETROFLEX HOOK +\setXTXcharcodes "00289 "00289 "00244 % LATIN SMALL LETTER U BAR +\setXTXcharcodes "0028A "0028A "001B1 % LATIN SMALL LETTER UPSILON +\setXTXcharcodes "0028B "0028B "001B2 % LATIN SMALL LETTER V WITH HOOK +\setXTXcharcodes "0028C "0028C "00245 % LATIN SMALL LETTER TURNED V +\setXTXcharcodes "0028D "0028D "0028D % LATIN SMALL LETTER TURNED W +\setXTXcharcodes "0028E "0028E "0028E % LATIN SMALL LETTER TURNED Y +\setXTXcharcodes "0028F "0028F "0028F % LATIN LETTER SMALL CAPITAL Y +\setXTXcharcodes "00290 "00290 "00290 % LATIN SMALL LETTER Z WITH RETROFLEX HOOK +\setXTXcharcodes "00291 "00291 "00291 % LATIN SMALL LETTER Z WITH CURL +\setXTXcharcodes "00292 "00292 "001B7 % LATIN SMALL LETTER EZH +\setXTXcharcodes "00293 "00293 "00293 % LATIN SMALL LETTER EZH WITH CURL +\setXTXcharcodes "00295 "00295 "00295 % LATIN LETTER PHARYNGEAL VOICED FRICATIVE +\setXTXcharcodes "00296 "00296 "00296 % LATIN LETTER INVERTED GLOTTAL STOP +\setXTXcharcodes "00297 "00297 "00297 % LATIN LETTER STRETCHED C +\setXTXcharcodes "00298 "00298 "00298 % LATIN LETTER BILABIAL CLICK +\setXTXcharcodes "00299 "00299 "00299 % LATIN LETTER SMALL CAPITAL B +\setXTXcharcodes "0029A "0029A "0029A % LATIN SMALL LETTER CLOSED OPEN E +\setXTXcharcodes "0029B "0029B "0029B % LATIN LETTER SMALL CAPITAL G WITH HOOK +\setXTXcharcodes "0029C "0029C "0029C % LATIN LETTER SMALL CAPITAL H +\setXTXcharcodes "0029D "0029D "0029D % LATIN SMALL LETTER J WITH CROSSED-TAIL +\setXTXcharcodes "0029E "0029E "0029E % LATIN SMALL LETTER TURNED K +\setXTXcharcodes "0029F "0029F "0029F % LATIN LETTER SMALL CAPITAL L +\setXTXcharcodes "002A0 "002A0 "002A0 % LATIN SMALL LETTER Q WITH HOOK +\setXTXcharcodes "002A1 "002A1 "002A1 % LATIN LETTER GLOTTAL STOP WITH STROKE +\setXTXcharcodes "002A2 "002A2 "002A2 % LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE +\setXTXcharcodes "002A3 "002A3 "002A3 % LATIN SMALL LETTER DZ DIGRAPH +\setXTXcharcodes "002A4 "002A4 "002A4 % LATIN SMALL LETTER DEZH DIGRAPH +\setXTXcharcodes "002A5 "002A5 "002A5 % LATIN SMALL LETTER DZ DIGRAPH WITH CURL +\setXTXcharcodes "002A6 "002A6 "002A6 % LATIN SMALL LETTER TS DIGRAPH +\setXTXcharcodes "002A7 "002A7 "002A7 % LATIN SMALL LETTER TESH DIGRAPH +\setXTXcharcodes "002A8 "002A8 "002A8 % LATIN SMALL LETTER TC DIGRAPH WITH CURL +\setXTXcharcodes "002A9 "002A9 "002A9 % LATIN SMALL LETTER FENG DIGRAPH +\setXTXcharcodes "002AA "002AA "002AA % LATIN SMALL LETTER LS DIGRAPH +\setXTXcharcodes "002AB "002AB "002AB % LATIN SMALL LETTER LZ DIGRAPH +\setXTXcharcodes "002AC "002AC "002AC % LATIN LETTER BILABIAL PERCUSSIVE +\setXTXcharcodes "002AD "002AD "002AD % LATIN LETTER BIDENTAL PERCUSSIVE +\setXTXcharcodes "002AE "002AE "002AE % LATIN SMALL LETTER TURNED H WITH FISHHOOK +\setXTXcharcodes "002AF "002AF "002AF % LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL +\setXTXcharcodes "0037B "0037B "003FD % GREEK SMALL REVERSED LUNATE SIGMA SYMBOL +\setXTXcharcodes "0037C "0037C "003FE % GREEK SMALL DOTTED LUNATE SIGMA SYMBOL +\setXTXcharcodes "0037D "0037D "003FF % GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL +\setXTXcharcodes "00386 "003AC "00386 % GREEK CAPITAL LETTER ALPHA WITH TONOS +\setXTXcharcodes "00388 "003AD "00388 % GREEK CAPITAL LETTER EPSILON WITH TONOS +\setXTXcharcodes "00389 "003AE "00389 % GREEK CAPITAL LETTER ETA WITH TONOS +\setXTXcharcodes "0038A "003AF "0038A % GREEK CAPITAL LETTER IOTA WITH TONOS +\setXTXcharcodes "0038C "003CC "0038C % GREEK CAPITAL LETTER OMICRON WITH TONOS +\setXTXcharcodes "0038E "003CD "0038E % GREEK CAPITAL LETTER UPSILON WITH TONOS +\setXTXcharcodes "0038F "003CE "0038F % GREEK CAPITAL LETTER OMEGA WITH TONOS +\setXTXcharcodes "00390 "00390 "00390 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS +\setXTXcharcodes "00391 "003B1 "00391 % GREEK CAPITAL LETTER ALPHA +\setXTXcharcodes "00392 "003B2 "00392 % GREEK CAPITAL LETTER BETA +\setXTXcharcodes "00393 "003B3 "00393 % GREEK CAPITAL LETTER GAMMA +\setXTXcharcodes "00394 "003B4 "00394 % GREEK CAPITAL LETTER DELTA +\setXTXcharcodes "00395 "003B5 "00395 % GREEK CAPITAL LETTER EPSILON +\setXTXcharcodes "00396 "003B6 "00396 % GREEK CAPITAL LETTER ZETA +\setXTXcharcodes "00397 "003B7 "00397 % GREEK CAPITAL LETTER ETA +\setXTXcharcodes "00398 "003B8 "00398 % GREEK CAPITAL LETTER THETA +\setXTXcharcodes "00399 "003B9 "00399 % GREEK CAPITAL LETTER IOTA +\setXTXcharcodes "0039A "003BA "0039A % GREEK CAPITAL LETTER KAPPA +\setXTXcharcodes "0039B "003BB "0039B % GREEK CAPITAL LETTER LAMDA +\setXTXcharcodes "0039C "003BC "0039C % GREEK CAPITAL LETTER MU +\setXTXcharcodes "0039D "003BD "0039D % GREEK CAPITAL LETTER NU +\setXTXcharcodes "0039E "003BE "0039E % GREEK CAPITAL LETTER XI +\setXTXcharcodes "0039F "003BF "0039F % GREEK CAPITAL LETTER OMICRON +\setXTXcharcodes "003A0 "003C0 "003A0 % GREEK CAPITAL LETTER PI +\setXTXcharcodes "003A1 "003C1 "003A1 % GREEK CAPITAL LETTER RHO +\setXTXcharcodes "003A3 "003C3 "003A3 % GREEK CAPITAL LETTER SIGMA +\setXTXcharcodes "003A4 "003C4 "003A4 % GREEK CAPITAL LETTER TAU +\setXTXcharcodes "003A5 "003C5 "003A5 % GREEK CAPITAL LETTER UPSILON +\setXTXcharcodes "003A6 "003C6 "003A6 % GREEK CAPITAL LETTER PHI +\setXTXcharcodes "003A7 "003C7 "003A7 % GREEK CAPITAL LETTER CHI +\setXTXcharcodes "003A8 "003C8 "003A8 % GREEK CAPITAL LETTER PSI +\setXTXcharcodes "003A9 "003C9 "003A9 % GREEK CAPITAL LETTER OMEGA +\setXTXcharcodes "003AA "003CA "003AA % GREEK CAPITAL LETTER IOTA WITH DIALYTIKA +\setXTXcharcodes "003AB "003CB "003AB % GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA +\setXTXcharcodes "003AC "003AC "00386 % GREEK SMALL LETTER ALPHA WITH TONOS +\setXTXcharcodes "003AD "003AD "00388 % GREEK SMALL LETTER EPSILON WITH TONOS +\setXTXcharcodes "003AE "003AE "00389 % GREEK SMALL LETTER ETA WITH TONOS +\setXTXcharcodes "003AF "003AF "0038A % GREEK SMALL LETTER IOTA WITH TONOS +\setXTXcharcodes "003B0 "003B0 "003B0 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS +\setXTXcharcodes "003B1 "003B1 "00391 % GREEK SMALL LETTER ALPHA +\setXTXcharcodes "003B2 "003B2 "00392 % GREEK SMALL LETTER BETA +\setXTXcharcodes "003B3 "003B3 "00393 % GREEK SMALL LETTER GAMMA +\setXTXcharcodes "003B4 "003B4 "00394 % GREEK SMALL LETTER DELTA +\setXTXcharcodes "003B5 "003B5 "00395 % GREEK SMALL LETTER EPSILON +\setXTXcharcodes "003B6 "003B6 "00396 % GREEK SMALL LETTER ZETA +\setXTXcharcodes "003B7 "003B7 "00397 % GREEK SMALL LETTER ETA +\setXTXcharcodes "003B8 "003B8 "00398 % GREEK SMALL LETTER THETA +\setXTXcharcodes "003B9 "003B9 "00399 % GREEK SMALL LETTER IOTA +\setXTXcharcodes "003BA "003BA "0039A % GREEK SMALL LETTER KAPPA +\setXTXcharcodes "003BB "003BB "0039B % GREEK SMALL LETTER LAMDA +\setXTXcharcodes "003BC "003BC "0039C % GREEK SMALL LETTER MU +\setXTXcharcodes "003BD "003BD "0039D % GREEK SMALL LETTER NU +\setXTXcharcodes "003BE "003BE "0039E % GREEK SMALL LETTER XI +\setXTXcharcodes "003BF "003BF "0039F % GREEK SMALL LETTER OMICRON +\setXTXcharcodes "003C0 "003C0 "003A0 % GREEK SMALL LETTER PI +\setXTXcharcodes "003C1 "003C1 "003A1 % GREEK SMALL LETTER RHO +\setXTXcharcodes "003C2 "003C2 "003A3 % GREEK SMALL LETTER FINAL SIGMA +\setXTXcharcodes "003C3 "003C3 "003A3 % GREEK SMALL LETTER SIGMA +\setXTXcharcodes "003C4 "003C4 "003A4 % GREEK SMALL LETTER TAU +\setXTXcharcodes "003C5 "003C5 "003A5 % GREEK SMALL LETTER UPSILON +\setXTXcharcodes "003C6 "003C6 "003A6 % GREEK SMALL LETTER PHI +\setXTXcharcodes "003C7 "003C7 "003A7 % GREEK SMALL LETTER CHI +\setXTXcharcodes "003C8 "003C8 "003A8 % GREEK SMALL LETTER PSI +\setXTXcharcodes "003C9 "003C9 "003A9 % GREEK SMALL LETTER OMEGA +\setXTXcharcodes "003CA "003CA "003AA % GREEK SMALL LETTER IOTA WITH DIALYTIKA +\setXTXcharcodes "003CB "003CB "003AB % GREEK SMALL LETTER UPSILON WITH DIALYTIKA +\setXTXcharcodes "003CC "003CC "0038C % GREEK SMALL LETTER OMICRON WITH TONOS +\setXTXcharcodes "003CD "003CD "0038E % GREEK SMALL LETTER UPSILON WITH TONOS +\setXTXcharcodes "003CE "003CE "0038F % GREEK SMALL LETTER OMEGA WITH TONOS +\setXTXcharcodes "003D0 "003D0 "00392 % GREEK BETA SYMBOL +\setXTXcharcodes "003D1 "003D1 "00398 % GREEK THETA SYMBOL +\setXTXcharcodes "003D2 "003D2 "003D2 % GREEK UPSILON WITH HOOK SYMBOL +\setXTXcharcodes "003D3 "003D3 "003D3 % GREEK UPSILON WITH ACUTE AND HOOK SYMBOL +\setXTXcharcodes "003D4 "003D4 "003D4 % GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL +\setXTXcharcodes "003D5 "003D5 "003A6 % GREEK PHI SYMBOL +\setXTXcharcodes "003D6 "003D6 "003A0 % GREEK PI SYMBOL +\setXTXcharcodes "003D7 "003D7 "003D7 % GREEK KAI SYMBOL +\setXTXcharcodes "003D8 "003D9 "003D8 % GREEK LETTER ARCHAIC KOPPA +\setXTXcharcodes "003D9 "003D9 "003D8 % GREEK SMALL LETTER ARCHAIC KOPPA +\setXTXcharcodes "003DA "003DB "003DA % GREEK LETTER STIGMA +\setXTXcharcodes "003DB "003DB "003DA % GREEK SMALL LETTER STIGMA +\setXTXcharcodes "003DC "003DD "003DC % GREEK LETTER DIGAMMA +\setXTXcharcodes "003DD "003DD "003DC % GREEK SMALL LETTER DIGAMMA +\setXTXcharcodes "003DE "003DF "003DE % GREEK LETTER KOPPA +\setXTXcharcodes "003DF "003DF "003DE % GREEK SMALL LETTER KOPPA +\setXTXcharcodes "003E0 "003E1 "003E0 % GREEK LETTER SAMPI +\setXTXcharcodes "003E1 "003E1 "003E0 % GREEK SMALL LETTER SAMPI +\setXTXcharcodes "003E2 "003E3 "003E2 % COPTIC CAPITAL LETTER SHEI +\setXTXcharcodes "003E3 "003E3 "003E2 % COPTIC SMALL LETTER SHEI +\setXTXcharcodes "003E4 "003E5 "003E4 % COPTIC CAPITAL LETTER FEI +\setXTXcharcodes "003E5 "003E5 "003E4 % COPTIC SMALL LETTER FEI +\setXTXcharcodes "003E6 "003E7 "003E6 % COPTIC CAPITAL LETTER KHEI +\setXTXcharcodes "003E7 "003E7 "003E6 % COPTIC SMALL LETTER KHEI +\setXTXcharcodes "003E8 "003E9 "003E8 % COPTIC CAPITAL LETTER HORI +\setXTXcharcodes "003E9 "003E9 "003E8 % COPTIC SMALL LETTER HORI +\setXTXcharcodes "003EA "003EB "003EA % COPTIC CAPITAL LETTER GANGIA +\setXTXcharcodes "003EB "003EB "003EA % COPTIC SMALL LETTER GANGIA +\setXTXcharcodes "003EC "003ED "003EC % COPTIC CAPITAL LETTER SHIMA +\setXTXcharcodes "003ED "003ED "003EC % COPTIC SMALL LETTER SHIMA +\setXTXcharcodes "003EE "003EF "003EE % COPTIC CAPITAL LETTER DEI +\setXTXcharcodes "003EF "003EF "003EE % COPTIC SMALL LETTER DEI +\setXTXcharcodes "003F0 "003F0 "0039A % GREEK KAPPA SYMBOL +\setXTXcharcodes "003F1 "003F1 "003A1 % GREEK RHO SYMBOL +\setXTXcharcodes "003F2 "003F2 "003F9 % GREEK LUNATE SIGMA SYMBOL +\setXTXcharcodes "003F3 "003F3 "003F3 % GREEK LETTER YOT +\setXTXcharcodes "003F4 "003B8 "003F4 % GREEK CAPITAL THETA SYMBOL +\setXTXcharcodes "003F5 "003F5 "00395 % GREEK LUNATE EPSILON SYMBOL +\setXTXcharcodes "003F7 "003F8 "003F7 % GREEK CAPITAL LETTER SHO +\setXTXcharcodes "003F8 "003F8 "003F7 % GREEK SMALL LETTER SHO +\setXTXcharcodes "003F9 "003F2 "003F9 % GREEK CAPITAL LUNATE SIGMA SYMBOL +\setXTXcharcodes "003FA "003FB "003FA % GREEK CAPITAL LETTER SAN +\setXTXcharcodes "003FB "003FB "003FA % GREEK SMALL LETTER SAN +\setXTXcharcodes "003FC "003FC "003FC % GREEK RHO WITH STROKE SYMBOL +\setXTXcharcodes "003FD "0037B "003FD % GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL +\setXTXcharcodes "003FE "0037C "003FE % GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL +\setXTXcharcodes "003FF "0037D "003FF % GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL +\setXTXcharcodes "00400 "00450 "00400 % CYRILLIC CAPITAL LETTER IE WITH GRAVE +\setXTXcharcodes "00401 "00451 "00401 % CYRILLIC CAPITAL LETTER IO +\setXTXcharcodes "00402 "00452 "00402 % CYRILLIC CAPITAL LETTER DJE +\setXTXcharcodes "00403 "00453 "00403 % CYRILLIC CAPITAL LETTER GJE +\setXTXcharcodes "00404 "00454 "00404 % CYRILLIC CAPITAL LETTER UKRAINIAN IE +\setXTXcharcodes "00405 "00455 "00405 % CYRILLIC CAPITAL LETTER DZE +\setXTXcharcodes "00406 "00456 "00406 % CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I +\setXTXcharcodes "00407 "00457 "00407 % CYRILLIC CAPITAL LETTER YI +\setXTXcharcodes "00408 "00458 "00408 % CYRILLIC CAPITAL LETTER JE +\setXTXcharcodes "00409 "00459 "00409 % CYRILLIC CAPITAL LETTER LJE +\setXTXcharcodes "0040A "0045A "0040A % CYRILLIC CAPITAL LETTER NJE +\setXTXcharcodes "0040B "0045B "0040B % CYRILLIC CAPITAL LETTER TSHE +\setXTXcharcodes "0040C "0045C "0040C % CYRILLIC CAPITAL LETTER KJE +\setXTXcharcodes "0040D "0045D "0040D % CYRILLIC CAPITAL LETTER I WITH GRAVE +\setXTXcharcodes "0040E "0045E "0040E % CYRILLIC CAPITAL LETTER SHORT U +\setXTXcharcodes "0040F "0045F "0040F % CYRILLIC CAPITAL LETTER DZHE +\setXTXcharcodes "00410 "00430 "00410 % CYRILLIC CAPITAL LETTER A +\setXTXcharcodes "00411 "00431 "00411 % CYRILLIC CAPITAL LETTER BE +\setXTXcharcodes "00412 "00432 "00412 % CYRILLIC CAPITAL LETTER VE +\setXTXcharcodes "00413 "00433 "00413 % CYRILLIC CAPITAL LETTER GHE +\setXTXcharcodes "00414 "00434 "00414 % CYRILLIC CAPITAL LETTER DE +\setXTXcharcodes "00415 "00435 "00415 % CYRILLIC CAPITAL LETTER IE +\setXTXcharcodes "00416 "00436 "00416 % CYRILLIC CAPITAL LETTER ZHE +\setXTXcharcodes "00417 "00437 "00417 % CYRILLIC CAPITAL LETTER ZE +\setXTXcharcodes "00418 "00438 "00418 % CYRILLIC CAPITAL LETTER I +\setXTXcharcodes "00419 "00439 "00419 % CYRILLIC CAPITAL LETTER SHORT I +\setXTXcharcodes "0041A "0043A "0041A % CYRILLIC CAPITAL LETTER KA +\setXTXcharcodes "0041B "0043B "0041B % CYRILLIC CAPITAL LETTER EL +\setXTXcharcodes "0041C "0043C "0041C % CYRILLIC CAPITAL LETTER EM +\setXTXcharcodes "0041D "0043D "0041D % CYRILLIC CAPITAL LETTER EN +\setXTXcharcodes "0041E "0043E "0041E % CYRILLIC CAPITAL LETTER O +\setXTXcharcodes "0041F "0043F "0041F % CYRILLIC CAPITAL LETTER PE +\setXTXcharcodes "00420 "00440 "00420 % CYRILLIC CAPITAL LETTER ER +\setXTXcharcodes "00421 "00441 "00421 % CYRILLIC CAPITAL LETTER ES +\setXTXcharcodes "00422 "00442 "00422 % CYRILLIC CAPITAL LETTER TE +\setXTXcharcodes "00423 "00443 "00423 % CYRILLIC CAPITAL LETTER U +\setXTXcharcodes "00424 "00444 "00424 % CYRILLIC CAPITAL LETTER EF +\setXTXcharcodes "00425 "00445 "00425 % CYRILLIC CAPITAL LETTER HA +\setXTXcharcodes "00426 "00446 "00426 % CYRILLIC CAPITAL LETTER TSE +\setXTXcharcodes "00427 "00447 "00427 % CYRILLIC CAPITAL LETTER CHE +\setXTXcharcodes "00428 "00448 "00428 % CYRILLIC CAPITAL LETTER SHA +\setXTXcharcodes "00429 "00449 "00429 % CYRILLIC CAPITAL LETTER SHCHA +\setXTXcharcodes "0042A "0044A "0042A % CYRILLIC CAPITAL LETTER HARD SIGN +\setXTXcharcodes "0042B "0044B "0042B % CYRILLIC CAPITAL LETTER YERU +\setXTXcharcodes "0042C "0044C "0042C % CYRILLIC CAPITAL LETTER SOFT SIGN +\setXTXcharcodes "0042D "0044D "0042D % CYRILLIC CAPITAL LETTER E +\setXTXcharcodes "0042E "0044E "0042E % CYRILLIC CAPITAL LETTER YU +\setXTXcharcodes "0042F "0044F "0042F % CYRILLIC CAPITAL LETTER YA +\setXTXcharcodes "00430 "00430 "00410 % CYRILLIC SMALL LETTER A +\setXTXcharcodes "00431 "00431 "00411 % CYRILLIC SMALL LETTER BE +\setXTXcharcodes "00432 "00432 "00412 % CYRILLIC SMALL LETTER VE +\setXTXcharcodes "00433 "00433 "00413 % CYRILLIC SMALL LETTER GHE +\setXTXcharcodes "00434 "00434 "00414 % CYRILLIC SMALL LETTER DE +\setXTXcharcodes "00435 "00435 "00415 % CYRILLIC SMALL LETTER IE +\setXTXcharcodes "00436 "00436 "00416 % CYRILLIC SMALL LETTER ZHE +\setXTXcharcodes "00437 "00437 "00417 % CYRILLIC SMALL LETTER ZE +\setXTXcharcodes "00438 "00438 "00418 % CYRILLIC SMALL LETTER I +\setXTXcharcodes "00439 "00439 "00419 % CYRILLIC SMALL LETTER SHORT I +\setXTXcharcodes "0043A "0043A "0041A % CYRILLIC SMALL LETTER KA +\setXTXcharcodes "0043B "0043B "0041B % CYRILLIC SMALL LETTER EL +\setXTXcharcodes "0043C "0043C "0041C % CYRILLIC SMALL LETTER EM +\setXTXcharcodes "0043D "0043D "0041D % CYRILLIC SMALL LETTER EN +\setXTXcharcodes "0043E "0043E "0041E % CYRILLIC SMALL LETTER O +\setXTXcharcodes "0043F "0043F "0041F % CYRILLIC SMALL LETTER PE +\setXTXcharcodes "00440 "00440 "00420 % CYRILLIC SMALL LETTER ER +\setXTXcharcodes "00441 "00441 "00421 % CYRILLIC SMALL LETTER ES +\setXTXcharcodes "00442 "00442 "00422 % CYRILLIC SMALL LETTER TE +\setXTXcharcodes "00443 "00443 "00423 % CYRILLIC SMALL LETTER U +\setXTXcharcodes "00444 "00444 "00424 % CYRILLIC SMALL LETTER EF +\setXTXcharcodes "00445 "00445 "00425 % CYRILLIC SMALL LETTER HA +\setXTXcharcodes "00446 "00446 "00426 % CYRILLIC SMALL LETTER TSE +\setXTXcharcodes "00447 "00447 "00427 % CYRILLIC SMALL LETTER CHE +\setXTXcharcodes "00448 "00448 "00428 % CYRILLIC SMALL LETTER SHA +\setXTXcharcodes "00449 "00449 "00429 % CYRILLIC SMALL LETTER SHCHA +\setXTXcharcodes "0044A "0044A "0042A % CYRILLIC SMALL LETTER HARD SIGN +\setXTXcharcodes "0044B "0044B "0042B % CYRILLIC SMALL LETTER YERU +\setXTXcharcodes "0044C "0044C "0042C % CYRILLIC SMALL LETTER SOFT SIGN +\setXTXcharcodes "0044D "0044D "0042D % CYRILLIC SMALL LETTER E +\setXTXcharcodes "0044E "0044E "0042E % CYRILLIC SMALL LETTER YU +\setXTXcharcodes "0044F "0044F "0042F % CYRILLIC SMALL LETTER YA +\setXTXcharcodes "00450 "00450 "00400 % CYRILLIC SMALL LETTER IE WITH GRAVE +\setXTXcharcodes "00451 "00451 "00401 % CYRILLIC SMALL LETTER IO +\setXTXcharcodes "00452 "00452 "00402 % CYRILLIC SMALL LETTER DJE +\setXTXcharcodes "00453 "00453 "00403 % CYRILLIC SMALL LETTER GJE +\setXTXcharcodes "00454 "00454 "00404 % CYRILLIC SMALL LETTER UKRAINIAN IE +\setXTXcharcodes "00455 "00455 "00405 % CYRILLIC SMALL LETTER DZE +\setXTXcharcodes "00456 "00456 "00406 % CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I +\setXTXcharcodes "00457 "00457 "00407 % CYRILLIC SMALL LETTER YI +\setXTXcharcodes "00458 "00458 "00408 % CYRILLIC SMALL LETTER JE +\setXTXcharcodes "00459 "00459 "00409 % CYRILLIC SMALL LETTER LJE +\setXTXcharcodes "0045A "0045A "0040A % CYRILLIC SMALL LETTER NJE +\setXTXcharcodes "0045B "0045B "0040B % CYRILLIC SMALL LETTER TSHE +\setXTXcharcodes "0045C "0045C "0040C % CYRILLIC SMALL LETTER KJE +\setXTXcharcodes "0045D "0045D "0040D % CYRILLIC SMALL LETTER I WITH GRAVE +\setXTXcharcodes "0045E "0045E "0040E % CYRILLIC SMALL LETTER SHORT U +\setXTXcharcodes "0045F "0045F "0040F % CYRILLIC SMALL LETTER DZHE +\setXTXcharcodes "00460 "00461 "00460 % CYRILLIC CAPITAL LETTER OMEGA +\setXTXcharcodes "00461 "00461 "00460 % CYRILLIC SMALL LETTER OMEGA +\setXTXcharcodes "00462 "00463 "00462 % CYRILLIC CAPITAL LETTER YAT +\setXTXcharcodes "00463 "00463 "00462 % CYRILLIC SMALL LETTER YAT +\setXTXcharcodes "00464 "00465 "00464 % CYRILLIC CAPITAL LETTER IOTIFIED E +\setXTXcharcodes "00465 "00465 "00464 % CYRILLIC SMALL LETTER IOTIFIED E +\setXTXcharcodes "00466 "00467 "00466 % CYRILLIC CAPITAL LETTER LITTLE YUS +\setXTXcharcodes "00467 "00467 "00466 % CYRILLIC SMALL LETTER LITTLE YUS +\setXTXcharcodes "00468 "00469 "00468 % CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS +\setXTXcharcodes "00469 "00469 "00468 % CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS +\setXTXcharcodes "0046A "0046B "0046A % CYRILLIC CAPITAL LETTER BIG YUS +\setXTXcharcodes "0046B "0046B "0046A % CYRILLIC SMALL LETTER BIG YUS +\setXTXcharcodes "0046C "0046D "0046C % CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS +\setXTXcharcodes "0046D "0046D "0046C % CYRILLIC SMALL LETTER IOTIFIED BIG YUS +\setXTXcharcodes "0046E "0046F "0046E % CYRILLIC CAPITAL LETTER KSI +\setXTXcharcodes "0046F "0046F "0046E % CYRILLIC SMALL LETTER KSI +\setXTXcharcodes "00470 "00471 "00470 % CYRILLIC CAPITAL LETTER PSI +\setXTXcharcodes "00471 "00471 "00470 % CYRILLIC SMALL LETTER PSI +\setXTXcharcodes "00472 "00473 "00472 % CYRILLIC CAPITAL LETTER FITA +\setXTXcharcodes "00473 "00473 "00472 % CYRILLIC SMALL LETTER FITA +\setXTXcharcodes "00474 "00475 "00474 % CYRILLIC CAPITAL LETTER IZHITSA +\setXTXcharcodes "00475 "00475 "00474 % CYRILLIC SMALL LETTER IZHITSA +\setXTXcharcodes "00476 "00477 "00476 % CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT +\setXTXcharcodes "00477 "00477 "00476 % CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT +\setXTXcharcodes "00478 "00479 "00478 % CYRILLIC CAPITAL LETTER UK +\setXTXcharcodes "00479 "00479 "00478 % CYRILLIC SMALL LETTER UK +\setXTXcharcodes "0047A "0047B "0047A % CYRILLIC CAPITAL LETTER ROUND OMEGA +\setXTXcharcodes "0047B "0047B "0047A % CYRILLIC SMALL LETTER ROUND OMEGA +\setXTXcharcodes "0047C "0047D "0047C % CYRILLIC CAPITAL LETTER OMEGA WITH TITLO +\setXTXcharcodes "0047D "0047D "0047C % CYRILLIC SMALL LETTER OMEGA WITH TITLO +\setXTXcharcodes "0047E "0047F "0047E % CYRILLIC CAPITAL LETTER OT +\setXTXcharcodes "0047F "0047F "0047E % CYRILLIC SMALL LETTER OT +\setXTXcharcodes "00480 "00481 "00480 % CYRILLIC CAPITAL LETTER KOPPA +\setXTXcharcodes "00481 "00481 "00480 % CYRILLIC SMALL LETTER KOPPA +\setXTXcharcodes "0048A "0048B "0048A % CYRILLIC CAPITAL LETTER SHORT I WITH TAIL +\setXTXcharcodes "0048B "0048B "0048A % CYRILLIC SMALL LETTER SHORT I WITH TAIL +\setXTXcharcodes "0048C "0048D "0048C % CYRILLIC CAPITAL LETTER SEMISOFT SIGN +\setXTXcharcodes "0048D "0048D "0048C % CYRILLIC SMALL LETTER SEMISOFT SIGN +\setXTXcharcodes "0048E "0048F "0048E % CYRILLIC CAPITAL LETTER ER WITH TICK +\setXTXcharcodes "0048F "0048F "0048E % CYRILLIC SMALL LETTER ER WITH TICK +\setXTXcharcodes "00490 "00491 "00490 % CYRILLIC CAPITAL LETTER GHE WITH UPTURN +\setXTXcharcodes "00491 "00491 "00490 % CYRILLIC SMALL LETTER GHE WITH UPTURN +\setXTXcharcodes "00492 "00493 "00492 % CYRILLIC CAPITAL LETTER GHE WITH STROKE +\setXTXcharcodes "00493 "00493 "00492 % CYRILLIC SMALL LETTER GHE WITH STROKE +\setXTXcharcodes "00494 "00495 "00494 % CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK +\setXTXcharcodes "00495 "00495 "00494 % CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK +\setXTXcharcodes "00496 "00497 "00496 % CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER +\setXTXcharcodes "00497 "00497 "00496 % CYRILLIC SMALL LETTER ZHE WITH DESCENDER +\setXTXcharcodes "00498 "00499 "00498 % CYRILLIC CAPITAL LETTER ZE WITH DESCENDER +\setXTXcharcodes "00499 "00499 "00498 % CYRILLIC SMALL LETTER ZE WITH DESCENDER +\setXTXcharcodes "0049A "0049B "0049A % CYRILLIC CAPITAL LETTER KA WITH DESCENDER +\setXTXcharcodes "0049B "0049B "0049A % CYRILLIC SMALL LETTER KA WITH DESCENDER +\setXTXcharcodes "0049C "0049D "0049C % CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE +\setXTXcharcodes "0049D "0049D "0049C % CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE +\setXTXcharcodes "0049E "0049F "0049E % CYRILLIC CAPITAL LETTER KA WITH STROKE +\setXTXcharcodes "0049F "0049F "0049E % CYRILLIC SMALL LETTER KA WITH STROKE +\setXTXcharcodes "004A0 "004A1 "004A0 % CYRILLIC CAPITAL LETTER BASHKIR KA +\setXTXcharcodes "004A1 "004A1 "004A0 % CYRILLIC SMALL LETTER BASHKIR KA +\setXTXcharcodes "004A2 "004A3 "004A2 % CYRILLIC CAPITAL LETTER EN WITH DESCENDER +\setXTXcharcodes "004A3 "004A3 "004A2 % CYRILLIC SMALL LETTER EN WITH DESCENDER +\setXTXcharcodes "004A4 "004A5 "004A4 % CYRILLIC CAPITAL LIGATURE EN GHE +\setXTXcharcodes "004A5 "004A5 "004A4 % CYRILLIC SMALL LIGATURE EN GHE +\setXTXcharcodes "004A6 "004A7 "004A6 % CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK +\setXTXcharcodes "004A7 "004A7 "004A6 % CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK +\setXTXcharcodes "004A8 "004A9 "004A8 % CYRILLIC CAPITAL LETTER ABKHASIAN HA +\setXTXcharcodes "004A9 "004A9 "004A8 % CYRILLIC SMALL LETTER ABKHASIAN HA +\setXTXcharcodes "004AA "004AB "004AA % CYRILLIC CAPITAL LETTER ES WITH DESCENDER +\setXTXcharcodes "004AB "004AB "004AA % CYRILLIC SMALL LETTER ES WITH DESCENDER +\setXTXcharcodes "004AC "004AD "004AC % CYRILLIC CAPITAL LETTER TE WITH DESCENDER +\setXTXcharcodes "004AD "004AD "004AC % CYRILLIC SMALL LETTER TE WITH DESCENDER +\setXTXcharcodes "004AE "004AF "004AE % CYRILLIC CAPITAL LETTER STRAIGHT U +\setXTXcharcodes "004AF "004AF "004AE % CYRILLIC SMALL LETTER STRAIGHT U +\setXTXcharcodes "004B0 "004B1 "004B0 % CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE +\setXTXcharcodes "004B1 "004B1 "004B0 % CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE +\setXTXcharcodes "004B2 "004B3 "004B2 % CYRILLIC CAPITAL LETTER HA WITH DESCENDER +\setXTXcharcodes "004B3 "004B3 "004B2 % CYRILLIC SMALL LETTER HA WITH DESCENDER +\setXTXcharcodes "004B4 "004B5 "004B4 % CYRILLIC CAPITAL LIGATURE TE TSE +\setXTXcharcodes "004B5 "004B5 "004B4 % CYRILLIC SMALL LIGATURE TE TSE +\setXTXcharcodes "004B6 "004B7 "004B6 % CYRILLIC CAPITAL LETTER CHE WITH DESCENDER +\setXTXcharcodes "004B7 "004B7 "004B6 % CYRILLIC SMALL LETTER CHE WITH DESCENDER +\setXTXcharcodes "004B8 "004B9 "004B8 % CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE +\setXTXcharcodes "004B9 "004B9 "004B8 % CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE +\setXTXcharcodes "004BA "004BB "004BA % CYRILLIC CAPITAL LETTER SHHA +\setXTXcharcodes "004BB "004BB "004BA % CYRILLIC SMALL LETTER SHHA +\setXTXcharcodes "004BC "004BD "004BC % CYRILLIC CAPITAL LETTER ABKHASIAN CHE +\setXTXcharcodes "004BD "004BD "004BC % CYRILLIC SMALL LETTER ABKHASIAN CHE +\setXTXcharcodes "004BE "004BF "004BE % CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER +\setXTXcharcodes "004BF "004BF "004BE % CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER +\setXTXcharcodes "004C0 "004CF "004C0 % CYRILLIC LETTER PALOCHKA +\setXTXcharcodes "004C1 "004C2 "004C1 % CYRILLIC CAPITAL LETTER ZHE WITH BREVE +\setXTXcharcodes "004C2 "004C2 "004C1 % CYRILLIC SMALL LETTER ZHE WITH BREVE +\setXTXcharcodes "004C3 "004C4 "004C3 % CYRILLIC CAPITAL LETTER KA WITH HOOK +\setXTXcharcodes "004C4 "004C4 "004C3 % CYRILLIC SMALL LETTER KA WITH HOOK +\setXTXcharcodes "004C5 "004C6 "004C5 % CYRILLIC CAPITAL LETTER EL WITH TAIL +\setXTXcharcodes "004C6 "004C6 "004C5 % CYRILLIC SMALL LETTER EL WITH TAIL +\setXTXcharcodes "004C7 "004C8 "004C7 % CYRILLIC CAPITAL LETTER EN WITH HOOK +\setXTXcharcodes "004C8 "004C8 "004C7 % CYRILLIC SMALL LETTER EN WITH HOOK +\setXTXcharcodes "004C9 "004CA "004C9 % CYRILLIC CAPITAL LETTER EN WITH TAIL +\setXTXcharcodes "004CA "004CA "004C9 % CYRILLIC SMALL LETTER EN WITH TAIL +\setXTXcharcodes "004CB "004CC "004CB % CYRILLIC CAPITAL LETTER KHAKASSIAN CHE +\setXTXcharcodes "004CC "004CC "004CB % CYRILLIC SMALL LETTER KHAKASSIAN CHE +\setXTXcharcodes "004CD "004CE "004CD % CYRILLIC CAPITAL LETTER EM WITH TAIL +\setXTXcharcodes "004CE "004CE "004CD % CYRILLIC SMALL LETTER EM WITH TAIL +\setXTXcharcodes "004CF "004CF "004C0 % CYRILLIC SMALL LETTER PALOCHKA +\setXTXcharcodes "004D0 "004D1 "004D0 % CYRILLIC CAPITAL LETTER A WITH BREVE +\setXTXcharcodes "004D1 "004D1 "004D0 % CYRILLIC SMALL LETTER A WITH BREVE +\setXTXcharcodes "004D2 "004D3 "004D2 % CYRILLIC CAPITAL LETTER A WITH DIAERESIS +\setXTXcharcodes "004D3 "004D3 "004D2 % CYRILLIC SMALL LETTER A WITH DIAERESIS +\setXTXcharcodes "004D4 "004D5 "004D4 % CYRILLIC CAPITAL LIGATURE A IE +\setXTXcharcodes "004D5 "004D5 "004D4 % CYRILLIC SMALL LIGATURE A IE +\setXTXcharcodes "004D6 "004D7 "004D6 % CYRILLIC CAPITAL LETTER IE WITH BREVE +\setXTXcharcodes "004D7 "004D7 "004D6 % CYRILLIC SMALL LETTER IE WITH BREVE +\setXTXcharcodes "004D8 "004D9 "004D8 % CYRILLIC CAPITAL LETTER SCHWA +\setXTXcharcodes "004D9 "004D9 "004D8 % CYRILLIC SMALL LETTER SCHWA +\setXTXcharcodes "004DA "004DB "004DA % CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS +\setXTXcharcodes "004DB "004DB "004DA % CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS +\setXTXcharcodes "004DC "004DD "004DC % CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS +\setXTXcharcodes "004DD "004DD "004DC % CYRILLIC SMALL LETTER ZHE WITH DIAERESIS +\setXTXcharcodes "004DE "004DF "004DE % CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS +\setXTXcharcodes "004DF "004DF "004DE % CYRILLIC SMALL LETTER ZE WITH DIAERESIS +\setXTXcharcodes "004E0 "004E1 "004E0 % CYRILLIC CAPITAL LETTER ABKHASIAN DZE +\setXTXcharcodes "004E1 "004E1 "004E0 % CYRILLIC SMALL LETTER ABKHASIAN DZE +\setXTXcharcodes "004E2 "004E3 "004E2 % CYRILLIC CAPITAL LETTER I WITH MACRON +\setXTXcharcodes "004E3 "004E3 "004E2 % CYRILLIC SMALL LETTER I WITH MACRON +\setXTXcharcodes "004E4 "004E5 "004E4 % CYRILLIC CAPITAL LETTER I WITH DIAERESIS +\setXTXcharcodes "004E5 "004E5 "004E4 % CYRILLIC SMALL LETTER I WITH DIAERESIS +\setXTXcharcodes "004E6 "004E7 "004E6 % CYRILLIC CAPITAL LETTER O WITH DIAERESIS +\setXTXcharcodes "004E7 "004E7 "004E6 % CYRILLIC SMALL LETTER O WITH DIAERESIS +\setXTXcharcodes "004E8 "004E9 "004E8 % CYRILLIC CAPITAL LETTER BARRED O +\setXTXcharcodes "004E9 "004E9 "004E8 % CYRILLIC SMALL LETTER BARRED O +\setXTXcharcodes "004EA "004EB "004EA % CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS +\setXTXcharcodes "004EB "004EB "004EA % CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS +\setXTXcharcodes "004EC "004ED "004EC % CYRILLIC CAPITAL LETTER E WITH DIAERESIS +\setXTXcharcodes "004ED "004ED "004EC % CYRILLIC SMALL LETTER E WITH DIAERESIS +\setXTXcharcodes "004EE "004EF "004EE % CYRILLIC CAPITAL LETTER U WITH MACRON +\setXTXcharcodes "004EF "004EF "004EE % CYRILLIC SMALL LETTER U WITH MACRON +\setXTXcharcodes "004F0 "004F1 "004F0 % CYRILLIC CAPITAL LETTER U WITH DIAERESIS +\setXTXcharcodes "004F1 "004F1 "004F0 % CYRILLIC SMALL LETTER U WITH DIAERESIS +\setXTXcharcodes "004F2 "004F3 "004F2 % CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE +\setXTXcharcodes "004F3 "004F3 "004F2 % CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE +\setXTXcharcodes "004F4 "004F5 "004F4 % CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS +\setXTXcharcodes "004F5 "004F5 "004F4 % CYRILLIC SMALL LETTER CHE WITH DIAERESIS +\setXTXcharcodes "004F6 "004F7 "004F6 % CYRILLIC CAPITAL LETTER GHE WITH DESCENDER +\setXTXcharcodes "004F7 "004F7 "004F6 % CYRILLIC SMALL LETTER GHE WITH DESCENDER +\setXTXcharcodes "004F8 "004F9 "004F8 % CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS +\setXTXcharcodes "004F9 "004F9 "004F8 % CYRILLIC SMALL LETTER YERU WITH DIAERESIS +\setXTXcharcodes "004FA "004FB "004FA % CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK +\setXTXcharcodes "004FB "004FB "004FA % CYRILLIC SMALL LETTER GHE WITH STROKE AND HOOK +\setXTXcharcodes "004FC "004FD "004FC % CYRILLIC CAPITAL LETTER HA WITH HOOK +\setXTXcharcodes "004FD "004FD "004FC % CYRILLIC SMALL LETTER HA WITH HOOK +\setXTXcharcodes "004FE "004FF "004FE % CYRILLIC CAPITAL LETTER HA WITH STROKE +\setXTXcharcodes "004FF "004FF "004FE % CYRILLIC SMALL LETTER HA WITH STROKE +\setXTXcharcodes "00500 "00501 "00500 % CYRILLIC CAPITAL LETTER KOMI DE +\setXTXcharcodes "00501 "00501 "00500 % CYRILLIC SMALL LETTER KOMI DE +\setXTXcharcodes "00502 "00503 "00502 % CYRILLIC CAPITAL LETTER KOMI DJE +\setXTXcharcodes "00503 "00503 "00502 % CYRILLIC SMALL LETTER KOMI DJE +\setXTXcharcodes "00504 "00505 "00504 % CYRILLIC CAPITAL LETTER KOMI ZJE +\setXTXcharcodes "00505 "00505 "00504 % CYRILLIC SMALL LETTER KOMI ZJE +\setXTXcharcodes "00506 "00507 "00506 % CYRILLIC CAPITAL LETTER KOMI DZJE +\setXTXcharcodes "00507 "00507 "00506 % CYRILLIC SMALL LETTER KOMI DZJE +\setXTXcharcodes "00508 "00509 "00508 % CYRILLIC CAPITAL LETTER KOMI LJE +\setXTXcharcodes "00509 "00509 "00508 % CYRILLIC SMALL LETTER KOMI LJE +\setXTXcharcodes "0050A "0050B "0050A % CYRILLIC CAPITAL LETTER KOMI NJE +\setXTXcharcodes "0050B "0050B "0050A % CYRILLIC SMALL LETTER KOMI NJE +\setXTXcharcodes "0050C "0050D "0050C % CYRILLIC CAPITAL LETTER KOMI SJE +\setXTXcharcodes "0050D "0050D "0050C % CYRILLIC SMALL LETTER KOMI SJE +\setXTXcharcodes "0050E "0050F "0050E % CYRILLIC CAPITAL LETTER KOMI TJE +\setXTXcharcodes "0050F "0050F "0050E % CYRILLIC SMALL LETTER KOMI TJE +\setXTXcharcodes "00510 "00511 "00510 % CYRILLIC CAPITAL LETTER REVERSED ZE +\setXTXcharcodes "00511 "00511 "00510 % CYRILLIC SMALL LETTER REVERSED ZE +\setXTXcharcodes "00512 "00513 "00512 % CYRILLIC CAPITAL LETTER EL WITH HOOK +\setXTXcharcodes "00513 "00513 "00512 % CYRILLIC SMALL LETTER EL WITH HOOK +\setXTXcharcodes "00531 "00561 "00531 % ARMENIAN CAPITAL LETTER AYB +\setXTXcharcodes "00532 "00562 "00532 % ARMENIAN CAPITAL LETTER BEN +\setXTXcharcodes "00533 "00563 "00533 % ARMENIAN CAPITAL LETTER GIM +\setXTXcharcodes "00534 "00564 "00534 % ARMENIAN CAPITAL LETTER DA +\setXTXcharcodes "00535 "00565 "00535 % ARMENIAN CAPITAL LETTER ECH +\setXTXcharcodes "00536 "00566 "00536 % ARMENIAN CAPITAL LETTER ZA +\setXTXcharcodes "00537 "00567 "00537 % ARMENIAN CAPITAL LETTER EH +\setXTXcharcodes "00538 "00568 "00538 % ARMENIAN CAPITAL LETTER ET +\setXTXcharcodes "00539 "00569 "00539 % ARMENIAN CAPITAL LETTER TO +\setXTXcharcodes "0053A "0056A "0053A % ARMENIAN CAPITAL LETTER ZHE +\setXTXcharcodes "0053B "0056B "0053B % ARMENIAN CAPITAL LETTER INI +\setXTXcharcodes "0053C "0056C "0053C % ARMENIAN CAPITAL LETTER LIWN +\setXTXcharcodes "0053D "0056D "0053D % ARMENIAN CAPITAL LETTER XEH +\setXTXcharcodes "0053E "0056E "0053E % ARMENIAN CAPITAL LETTER CA +\setXTXcharcodes "0053F "0056F "0053F % ARMENIAN CAPITAL LETTER KEN +\setXTXcharcodes "00540 "00570 "00540 % ARMENIAN CAPITAL LETTER HO +\setXTXcharcodes "00541 "00571 "00541 % ARMENIAN CAPITAL LETTER JA +\setXTXcharcodes "00542 "00572 "00542 % ARMENIAN CAPITAL LETTER GHAD +\setXTXcharcodes "00543 "00573 "00543 % ARMENIAN CAPITAL LETTER CHEH +\setXTXcharcodes "00544 "00574 "00544 % ARMENIAN CAPITAL LETTER MEN +\setXTXcharcodes "00545 "00575 "00545 % ARMENIAN CAPITAL LETTER YI +\setXTXcharcodes "00546 "00576 "00546 % ARMENIAN CAPITAL LETTER NOW +\setXTXcharcodes "00547 "00577 "00547 % ARMENIAN CAPITAL LETTER SHA +\setXTXcharcodes "00548 "00578 "00548 % ARMENIAN CAPITAL LETTER VO +\setXTXcharcodes "00549 "00579 "00549 % ARMENIAN CAPITAL LETTER CHA +\setXTXcharcodes "0054A "0057A "0054A % ARMENIAN CAPITAL LETTER PEH +\setXTXcharcodes "0054B "0057B "0054B % ARMENIAN CAPITAL LETTER JHEH +\setXTXcharcodes "0054C "0057C "0054C % ARMENIAN CAPITAL LETTER RA +\setXTXcharcodes "0054D "0057D "0054D % ARMENIAN CAPITAL LETTER SEH +\setXTXcharcodes "0054E "0057E "0054E % ARMENIAN CAPITAL LETTER VEW +\setXTXcharcodes "0054F "0057F "0054F % ARMENIAN CAPITAL LETTER TIWN +\setXTXcharcodes "00550 "00580 "00550 % ARMENIAN CAPITAL LETTER REH +\setXTXcharcodes "00551 "00581 "00551 % ARMENIAN CAPITAL LETTER CO +\setXTXcharcodes "00552 "00582 "00552 % ARMENIAN CAPITAL LETTER YIWN +\setXTXcharcodes "00553 "00583 "00553 % ARMENIAN CAPITAL LETTER PIWR +\setXTXcharcodes "00554 "00584 "00554 % ARMENIAN CAPITAL LETTER KEH +\setXTXcharcodes "00555 "00585 "00555 % ARMENIAN CAPITAL LETTER OH +\setXTXcharcodes "00556 "00586 "00556 % ARMENIAN CAPITAL LETTER FEH +\setXTXcharcodes "00561 "00561 "00531 % ARMENIAN SMALL LETTER AYB +\setXTXcharcodes "00562 "00562 "00532 % ARMENIAN SMALL LETTER BEN +\setXTXcharcodes "00563 "00563 "00533 % ARMENIAN SMALL LETTER GIM +\setXTXcharcodes "00564 "00564 "00534 % ARMENIAN SMALL LETTER DA +\setXTXcharcodes "00565 "00565 "00535 % ARMENIAN SMALL LETTER ECH +\setXTXcharcodes "00566 "00566 "00536 % ARMENIAN SMALL LETTER ZA +\setXTXcharcodes "00567 "00567 "00537 % ARMENIAN SMALL LETTER EH +\setXTXcharcodes "00568 "00568 "00538 % ARMENIAN SMALL LETTER ET +\setXTXcharcodes "00569 "00569 "00539 % ARMENIAN SMALL LETTER TO +\setXTXcharcodes "0056A "0056A "0053A % ARMENIAN SMALL LETTER ZHE +\setXTXcharcodes "0056B "0056B "0053B % ARMENIAN SMALL LETTER INI +\setXTXcharcodes "0056C "0056C "0053C % ARMENIAN SMALL LETTER LIWN +\setXTXcharcodes "0056D "0056D "0053D % ARMENIAN SMALL LETTER XEH +\setXTXcharcodes "0056E "0056E "0053E % ARMENIAN SMALL LETTER CA +\setXTXcharcodes "0056F "0056F "0053F % ARMENIAN SMALL LETTER KEN +\setXTXcharcodes "00570 "00570 "00540 % ARMENIAN SMALL LETTER HO +\setXTXcharcodes "00571 "00571 "00541 % ARMENIAN SMALL LETTER JA +\setXTXcharcodes "00572 "00572 "00542 % ARMENIAN SMALL LETTER GHAD +\setXTXcharcodes "00573 "00573 "00543 % ARMENIAN SMALL LETTER CHEH +\setXTXcharcodes "00574 "00574 "00544 % ARMENIAN SMALL LETTER MEN +\setXTXcharcodes "00575 "00575 "00545 % ARMENIAN SMALL LETTER YI +\setXTXcharcodes "00576 "00576 "00546 % ARMENIAN SMALL LETTER NOW +\setXTXcharcodes "00577 "00577 "00547 % ARMENIAN SMALL LETTER SHA +\setXTXcharcodes "00578 "00578 "00548 % ARMENIAN SMALL LETTER VO +\setXTXcharcodes "00579 "00579 "00549 % ARMENIAN SMALL LETTER CHA +\setXTXcharcodes "0057A "0057A "0054A % ARMENIAN SMALL LETTER PEH +\setXTXcharcodes "0057B "0057B "0054B % ARMENIAN SMALL LETTER JHEH +\setXTXcharcodes "0057C "0057C "0054C % ARMENIAN SMALL LETTER RA +\setXTXcharcodes "0057D "0057D "0054D % ARMENIAN SMALL LETTER SEH +\setXTXcharcodes "0057E "0057E "0054E % ARMENIAN SMALL LETTER VEW +\setXTXcharcodes "0057F "0057F "0054F % ARMENIAN SMALL LETTER TIWN +\setXTXcharcodes "00580 "00580 "00550 % ARMENIAN SMALL LETTER REH +\setXTXcharcodes "00581 "00581 "00551 % ARMENIAN SMALL LETTER CO +\setXTXcharcodes "00582 "00582 "00552 % ARMENIAN SMALL LETTER YIWN +\setXTXcharcodes "00583 "00583 "00553 % ARMENIAN SMALL LETTER PIWR +\setXTXcharcodes "00584 "00584 "00554 % ARMENIAN SMALL LETTER KEH +\setXTXcharcodes "00585 "00585 "00555 % ARMENIAN SMALL LETTER OH +\setXTXcharcodes "00586 "00586 "00556 % ARMENIAN SMALL LETTER FEH +\setXTXcharcodes "00587 "00587 "00587 % ARMENIAN SMALL LIGATURE ECH YIWN +\setXTXcharcodes "010A0 "02D00 "010A0 % GEORGIAN CAPITAL LETTER AN +\setXTXcharcodes "010A1 "02D01 "010A1 % GEORGIAN CAPITAL LETTER BAN +\setXTXcharcodes "010A2 "02D02 "010A2 % GEORGIAN CAPITAL LETTER GAN +\setXTXcharcodes "010A3 "02D03 "010A3 % GEORGIAN CAPITAL LETTER DON +\setXTXcharcodes "010A4 "02D04 "010A4 % GEORGIAN CAPITAL LETTER EN +\setXTXcharcodes "010A5 "02D05 "010A5 % GEORGIAN CAPITAL LETTER VIN +\setXTXcharcodes "010A6 "02D06 "010A6 % GEORGIAN CAPITAL LETTER ZEN +\setXTXcharcodes "010A7 "02D07 "010A7 % GEORGIAN CAPITAL LETTER TAN +\setXTXcharcodes "010A8 "02D08 "010A8 % GEORGIAN CAPITAL LETTER IN +\setXTXcharcodes "010A9 "02D09 "010A9 % GEORGIAN CAPITAL LETTER KAN +\setXTXcharcodes "010AA "02D0A "010AA % GEORGIAN CAPITAL LETTER LAS +\setXTXcharcodes "010AB "02D0B "010AB % GEORGIAN CAPITAL LETTER MAN +\setXTXcharcodes "010AC "02D0C "010AC % GEORGIAN CAPITAL LETTER NAR +\setXTXcharcodes "010AD "02D0D "010AD % GEORGIAN CAPITAL LETTER ON +\setXTXcharcodes "010AE "02D0E "010AE % GEORGIAN CAPITAL LETTER PAR +\setXTXcharcodes "010AF "02D0F "010AF % GEORGIAN CAPITAL LETTER ZHAR +\setXTXcharcodes "010B0 "02D10 "010B0 % GEORGIAN CAPITAL LETTER RAE +\setXTXcharcodes "010B1 "02D11 "010B1 % GEORGIAN CAPITAL LETTER SAN +\setXTXcharcodes "010B2 "02D12 "010B2 % GEORGIAN CAPITAL LETTER TAR +\setXTXcharcodes "010B3 "02D13 "010B3 % GEORGIAN CAPITAL LETTER UN +\setXTXcharcodes "010B4 "02D14 "010B4 % GEORGIAN CAPITAL LETTER PHAR +\setXTXcharcodes "010B5 "02D15 "010B5 % GEORGIAN CAPITAL LETTER KHAR +\setXTXcharcodes "010B6 "02D16 "010B6 % GEORGIAN CAPITAL LETTER GHAN +\setXTXcharcodes "010B7 "02D17 "010B7 % GEORGIAN CAPITAL LETTER QAR +\setXTXcharcodes "010B8 "02D18 "010B8 % GEORGIAN CAPITAL LETTER SHIN +\setXTXcharcodes "010B9 "02D19 "010B9 % GEORGIAN CAPITAL LETTER CHIN +\setXTXcharcodes "010BA "02D1A "010BA % GEORGIAN CAPITAL LETTER CAN +\setXTXcharcodes "010BB "02D1B "010BB % GEORGIAN CAPITAL LETTER JIL +\setXTXcharcodes "010BC "02D1C "010BC % GEORGIAN CAPITAL LETTER CIL +\setXTXcharcodes "010BD "02D1D "010BD % GEORGIAN CAPITAL LETTER CHAR +\setXTXcharcodes "010BE "02D1E "010BE % GEORGIAN CAPITAL LETTER XAN +\setXTXcharcodes "010BF "02D1F "010BF % GEORGIAN CAPITAL LETTER JHAN +\setXTXcharcodes "010C0 "02D20 "010C0 % GEORGIAN CAPITAL LETTER HAE +\setXTXcharcodes "010C1 "02D21 "010C1 % GEORGIAN CAPITAL LETTER HE +\setXTXcharcodes "010C2 "02D22 "010C2 % GEORGIAN CAPITAL LETTER HIE +\setXTXcharcodes "010C3 "02D23 "010C3 % GEORGIAN CAPITAL LETTER WE +\setXTXcharcodes "010C4 "02D24 "010C4 % GEORGIAN CAPITAL LETTER HAR +\setXTXcharcodes "010C5 "02D25 "010C5 % GEORGIAN CAPITAL LETTER HOE +\setXTXcharcodes "01D00 "01D00 "01D00 % LATIN LETTER SMALL CAPITAL A +\setXTXcharcodes "01D01 "01D01 "01D01 % LATIN LETTER SMALL CAPITAL AE +\setXTXcharcodes "01D02 "01D02 "01D02 % LATIN SMALL LETTER TURNED AE +\setXTXcharcodes "01D03 "01D03 "01D03 % LATIN LETTER SMALL CAPITAL BARRED B +\setXTXcharcodes "01D04 "01D04 "01D04 % LATIN LETTER SMALL CAPITAL C +\setXTXcharcodes "01D05 "01D05 "01D05 % LATIN LETTER SMALL CAPITAL D +\setXTXcharcodes "01D06 "01D06 "01D06 % LATIN LETTER SMALL CAPITAL ETH +\setXTXcharcodes "01D07 "01D07 "01D07 % LATIN LETTER SMALL CAPITAL E +\setXTXcharcodes "01D08 "01D08 "01D08 % LATIN SMALL LETTER TURNED OPEN E +\setXTXcharcodes "01D09 "01D09 "01D09 % LATIN SMALL LETTER TURNED I +\setXTXcharcodes "01D0A "01D0A "01D0A % LATIN LETTER SMALL CAPITAL J +\setXTXcharcodes "01D0B "01D0B "01D0B % LATIN LETTER SMALL CAPITAL K +\setXTXcharcodes "01D0C "01D0C "01D0C % LATIN LETTER SMALL CAPITAL L WITH STROKE +\setXTXcharcodes "01D0D "01D0D "01D0D % LATIN LETTER SMALL CAPITAL M +\setXTXcharcodes "01D0E "01D0E "01D0E % LATIN LETTER SMALL CAPITAL REVERSED N +\setXTXcharcodes "01D0F "01D0F "01D0F % LATIN LETTER SMALL CAPITAL O +\setXTXcharcodes "01D10 "01D10 "01D10 % LATIN LETTER SMALL CAPITAL OPEN O +\setXTXcharcodes "01D11 "01D11 "01D11 % LATIN SMALL LETTER SIDEWAYS O +\setXTXcharcodes "01D12 "01D12 "01D12 % LATIN SMALL LETTER SIDEWAYS OPEN O +\setXTXcharcodes "01D13 "01D13 "01D13 % LATIN SMALL LETTER SIDEWAYS O WITH STROKE +\setXTXcharcodes "01D14 "01D14 "01D14 % LATIN SMALL LETTER TURNED OE +\setXTXcharcodes "01D15 "01D15 "01D15 % LATIN LETTER SMALL CAPITAL OU +\setXTXcharcodes "01D16 "01D16 "01D16 % LATIN SMALL LETTER TOP HALF O +\setXTXcharcodes "01D17 "01D17 "01D17 % LATIN SMALL LETTER BOTTOM HALF O +\setXTXcharcodes "01D18 "01D18 "01D18 % LATIN LETTER SMALL CAPITAL P +\setXTXcharcodes "01D19 "01D19 "01D19 % LATIN LETTER SMALL CAPITAL REVERSED R +\setXTXcharcodes "01D1A "01D1A "01D1A % LATIN LETTER SMALL CAPITAL TURNED R +\setXTXcharcodes "01D1B "01D1B "01D1B % LATIN LETTER SMALL CAPITAL T +\setXTXcharcodes "01D1C "01D1C "01D1C % LATIN LETTER SMALL CAPITAL U +\setXTXcharcodes "01D1D "01D1D "01D1D % LATIN SMALL LETTER SIDEWAYS U +\setXTXcharcodes "01D1E "01D1E "01D1E % LATIN SMALL LETTER SIDEWAYS DIAERESIZED U +\setXTXcharcodes "01D1F "01D1F "01D1F % LATIN SMALL LETTER SIDEWAYS TURNED M +\setXTXcharcodes "01D20 "01D20 "01D20 % LATIN LETTER SMALL CAPITAL V +\setXTXcharcodes "01D21 "01D21 "01D21 % LATIN LETTER SMALL CAPITAL W +\setXTXcharcodes "01D22 "01D22 "01D22 % LATIN LETTER SMALL CAPITAL Z +\setXTXcharcodes "01D23 "01D23 "01D23 % LATIN LETTER SMALL CAPITAL EZH +\setXTXcharcodes "01D24 "01D24 "01D24 % LATIN LETTER VOICED LARYNGEAL SPIRANT +\setXTXcharcodes "01D25 "01D25 "01D25 % LATIN LETTER AIN +\setXTXcharcodes "01D26 "01D26 "01D26 % GREEK LETTER SMALL CAPITAL GAMMA +\setXTXcharcodes "01D27 "01D27 "01D27 % GREEK LETTER SMALL CAPITAL LAMDA +\setXTXcharcodes "01D28 "01D28 "01D28 % GREEK LETTER SMALL CAPITAL PI +\setXTXcharcodes "01D29 "01D29 "01D29 % GREEK LETTER SMALL CAPITAL RHO +\setXTXcharcodes "01D2A "01D2A "01D2A % GREEK LETTER SMALL CAPITAL PSI +\setXTXcharcodes "01D2B "01D2B "01D2B % CYRILLIC LETTER SMALL CAPITAL EL +\setXTXcharcodes "01D62 "01D62 "01D62 % LATIN SUBSCRIPT SMALL LETTER I +\setXTXcharcodes "01D63 "01D63 "01D63 % LATIN SUBSCRIPT SMALL LETTER R +\setXTXcharcodes "01D64 "01D64 "01D64 % LATIN SUBSCRIPT SMALL LETTER U +\setXTXcharcodes "01D65 "01D65 "01D65 % LATIN SUBSCRIPT SMALL LETTER V +\setXTXcharcodes "01D66 "01D66 "01D66 % GREEK SUBSCRIPT SMALL LETTER BETA +\setXTXcharcodes "01D67 "01D67 "01D67 % GREEK SUBSCRIPT SMALL LETTER GAMMA +\setXTXcharcodes "01D68 "01D68 "01D68 % GREEK SUBSCRIPT SMALL LETTER RHO +\setXTXcharcodes "01D69 "01D69 "01D69 % GREEK SUBSCRIPT SMALL LETTER PHI +\setXTXcharcodes "01D6A "01D6A "01D6A % GREEK SUBSCRIPT SMALL LETTER CHI +\setXTXcharcodes "01D6B "01D6B "01D6B % LATIN SMALL LETTER UE +\setXTXcharcodes "01D6C "01D6C "01D6C % LATIN SMALL LETTER B WITH MIDDLE TILDE +\setXTXcharcodes "01D6D "01D6D "01D6D % LATIN SMALL LETTER D WITH MIDDLE TILDE +\setXTXcharcodes "01D6E "01D6E "01D6E % LATIN SMALL LETTER F WITH MIDDLE TILDE +\setXTXcharcodes "01D6F "01D6F "01D6F % LATIN SMALL LETTER M WITH MIDDLE TILDE +\setXTXcharcodes "01D70 "01D70 "01D70 % LATIN SMALL LETTER N WITH MIDDLE TILDE +\setXTXcharcodes "01D71 "01D71 "01D71 % LATIN SMALL LETTER P WITH MIDDLE TILDE +\setXTXcharcodes "01D72 "01D72 "01D72 % LATIN SMALL LETTER R WITH MIDDLE TILDE +\setXTXcharcodes "01D73 "01D73 "01D73 % LATIN SMALL LETTER R WITH FISHHOOK AND MIDDLE TILDE +\setXTXcharcodes "01D74 "01D74 "01D74 % LATIN SMALL LETTER S WITH MIDDLE TILDE +\setXTXcharcodes "01D75 "01D75 "01D75 % LATIN SMALL LETTER T WITH MIDDLE TILDE +\setXTXcharcodes "01D76 "01D76 "01D76 % LATIN SMALL LETTER Z WITH MIDDLE TILDE +\setXTXcharcodes "01D77 "01D77 "01D77 % LATIN SMALL LETTER TURNED G +\setXTXcharcodes "01D79 "01D79 "01D79 % LATIN SMALL LETTER INSULAR G +\setXTXcharcodes "01D7A "01D7A "01D7A % LATIN SMALL LETTER TH WITH STRIKETHROUGH +\setXTXcharcodes "01D7B "01D7B "01D7B % LATIN SMALL CAPITAL LETTER I WITH STROKE +\setXTXcharcodes "01D7C "01D7C "01D7C % LATIN SMALL LETTER IOTA WITH STROKE +\setXTXcharcodes "01D7D "01D7D "02C63 % LATIN SMALL LETTER P WITH STROKE +\setXTXcharcodes "01D7E "01D7E "01D7E % LATIN SMALL CAPITAL LETTER U WITH STROKE +\setXTXcharcodes "01D7F "01D7F "01D7F % LATIN SMALL LETTER UPSILON WITH STROKE +\setXTXcharcodes "01D80 "01D80 "01D80 % LATIN SMALL LETTER B WITH PALATAL HOOK +\setXTXcharcodes "01D81 "01D81 "01D81 % LATIN SMALL LETTER D WITH PALATAL HOOK +\setXTXcharcodes "01D82 "01D82 "01D82 % LATIN SMALL LETTER F WITH PALATAL HOOK +\setXTXcharcodes "01D83 "01D83 "01D83 % LATIN SMALL LETTER G WITH PALATAL HOOK +\setXTXcharcodes "01D84 "01D84 "01D84 % LATIN SMALL LETTER K WITH PALATAL HOOK +\setXTXcharcodes "01D85 "01D85 "01D85 % LATIN SMALL LETTER L WITH PALATAL HOOK +\setXTXcharcodes "01D86 "01D86 "01D86 % LATIN SMALL LETTER M WITH PALATAL HOOK +\setXTXcharcodes "01D87 "01D87 "01D87 % LATIN SMALL LETTER N WITH PALATAL HOOK +\setXTXcharcodes "01D88 "01D88 "01D88 % LATIN SMALL LETTER P WITH PALATAL HOOK +\setXTXcharcodes "01D89 "01D89 "01D89 % LATIN SMALL LETTER R WITH PALATAL HOOK +\setXTXcharcodes "01D8A "01D8A "01D8A % LATIN SMALL LETTER S WITH PALATAL HOOK +\setXTXcharcodes "01D8B "01D8B "01D8B % LATIN SMALL LETTER ESH WITH PALATAL HOOK +\setXTXcharcodes "01D8C "01D8C "01D8C % LATIN SMALL LETTER V WITH PALATAL HOOK +\setXTXcharcodes "01D8D "01D8D "01D8D % LATIN SMALL LETTER X WITH PALATAL HOOK +\setXTXcharcodes "01D8E "01D8E "01D8E % LATIN SMALL LETTER Z WITH PALATAL HOOK +\setXTXcharcodes "01D8F "01D8F "01D8F % LATIN SMALL LETTER A WITH RETROFLEX HOOK +\setXTXcharcodes "01D90 "01D90 "01D90 % LATIN SMALL LETTER ALPHA WITH RETROFLEX HOOK +\setXTXcharcodes "01D91 "01D91 "01D91 % LATIN SMALL LETTER D WITH HOOK AND TAIL +\setXTXcharcodes "01D92 "01D92 "01D92 % LATIN SMALL LETTER E WITH RETROFLEX HOOK +\setXTXcharcodes "01D93 "01D93 "01D93 % LATIN SMALL LETTER OPEN E WITH RETROFLEX HOOK +\setXTXcharcodes "01D94 "01D94 "01D94 % LATIN SMALL LETTER REVERSED OPEN E WITH RETROFLEX HOOK +\setXTXcharcodes "01D95 "01D95 "01D95 % LATIN SMALL LETTER SCHWA WITH RETROFLEX HOOK +\setXTXcharcodes "01D96 "01D96 "01D96 % LATIN SMALL LETTER I WITH RETROFLEX HOOK +\setXTXcharcodes "01D97 "01D97 "01D97 % LATIN SMALL LETTER OPEN O WITH RETROFLEX HOOK +\setXTXcharcodes "01D98 "01D98 "01D98 % LATIN SMALL LETTER ESH WITH RETROFLEX HOOK +\setXTXcharcodes "01D99 "01D99 "01D99 % LATIN SMALL LETTER U WITH RETROFLEX HOOK +\setXTXcharcodes "01D9A "01D9A "01D9A % LATIN SMALL LETTER EZH WITH RETROFLEX HOOK +\setXTXcharcodes "01E00 "01E01 "01E00 % LATIN CAPITAL LETTER A WITH RING BELOW +\setXTXcharcodes "01E01 "01E01 "01E00 % LATIN SMALL LETTER A WITH RING BELOW +\setXTXcharcodes "01E02 "01E03 "01E02 % LATIN CAPITAL LETTER B WITH DOT ABOVE +\setXTXcharcodes "01E03 "01E03 "01E02 % LATIN SMALL LETTER B WITH DOT ABOVE +\setXTXcharcodes "01E04 "01E05 "01E04 % LATIN CAPITAL LETTER B WITH DOT BELOW +\setXTXcharcodes "01E05 "01E05 "01E04 % LATIN SMALL LETTER B WITH DOT BELOW +\setXTXcharcodes "01E06 "01E07 "01E06 % LATIN CAPITAL LETTER B WITH LINE BELOW +\setXTXcharcodes "01E07 "01E07 "01E06 % LATIN SMALL LETTER B WITH LINE BELOW +\setXTXcharcodes "01E08 "01E09 "01E08 % LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE +\setXTXcharcodes "01E09 "01E09 "01E08 % LATIN SMALL LETTER C WITH CEDILLA AND ACUTE +\setXTXcharcodes "01E0A "01E0B "01E0A % LATIN CAPITAL LETTER D WITH DOT ABOVE +\setXTXcharcodes "01E0B "01E0B "01E0A % LATIN SMALL LETTER D WITH DOT ABOVE +\setXTXcharcodes "01E0C "01E0D "01E0C % LATIN CAPITAL LETTER D WITH DOT BELOW +\setXTXcharcodes "01E0D "01E0D "01E0C % LATIN SMALL LETTER D WITH DOT BELOW +\setXTXcharcodes "01E0E "01E0F "01E0E % LATIN CAPITAL LETTER D WITH LINE BELOW +\setXTXcharcodes "01E0F "01E0F "01E0E % LATIN SMALL LETTER D WITH LINE BELOW +\setXTXcharcodes "01E10 "01E11 "01E10 % LATIN CAPITAL LETTER D WITH CEDILLA +\setXTXcharcodes "01E11 "01E11 "01E10 % LATIN SMALL LETTER D WITH CEDILLA +\setXTXcharcodes "01E12 "01E13 "01E12 % LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E13 "01E13 "01E12 % LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E14 "01E15 "01E14 % LATIN CAPITAL LETTER E WITH MACRON AND GRAVE +\setXTXcharcodes "01E15 "01E15 "01E14 % LATIN SMALL LETTER E WITH MACRON AND GRAVE +\setXTXcharcodes "01E16 "01E17 "01E16 % LATIN CAPITAL LETTER E WITH MACRON AND ACUTE +\setXTXcharcodes "01E17 "01E17 "01E16 % LATIN SMALL LETTER E WITH MACRON AND ACUTE +\setXTXcharcodes "01E18 "01E19 "01E18 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E19 "01E19 "01E18 % LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E1A "01E1B "01E1A % LATIN CAPITAL LETTER E WITH TILDE BELOW +\setXTXcharcodes "01E1B "01E1B "01E1A % LATIN SMALL LETTER E WITH TILDE BELOW +\setXTXcharcodes "01E1C "01E1D "01E1C % LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE +\setXTXcharcodes "01E1D "01E1D "01E1C % LATIN SMALL LETTER E WITH CEDILLA AND BREVE +\setXTXcharcodes "01E1E "01E1F "01E1E % LATIN CAPITAL LETTER F WITH DOT ABOVE +\setXTXcharcodes "01E1F "01E1F "01E1E % LATIN SMALL LETTER F WITH DOT ABOVE +\setXTXcharcodes "01E20 "01E21 "01E20 % LATIN CAPITAL LETTER G WITH MACRON +\setXTXcharcodes "01E21 "01E21 "01E20 % LATIN SMALL LETTER G WITH MACRON +\setXTXcharcodes "01E22 "01E23 "01E22 % LATIN CAPITAL LETTER H WITH DOT ABOVE +\setXTXcharcodes "01E23 "01E23 "01E22 % LATIN SMALL LETTER H WITH DOT ABOVE +\setXTXcharcodes "01E24 "01E25 "01E24 % LATIN CAPITAL LETTER H WITH DOT BELOW +\setXTXcharcodes "01E25 "01E25 "01E24 % LATIN SMALL LETTER H WITH DOT BELOW +\setXTXcharcodes "01E26 "01E27 "01E26 % LATIN CAPITAL LETTER H WITH DIAERESIS +\setXTXcharcodes "01E27 "01E27 "01E26 % LATIN SMALL LETTER H WITH DIAERESIS +\setXTXcharcodes "01E28 "01E29 "01E28 % LATIN CAPITAL LETTER H WITH CEDILLA +\setXTXcharcodes "01E29 "01E29 "01E28 % LATIN SMALL LETTER H WITH CEDILLA +\setXTXcharcodes "01E2A "01E2B "01E2A % LATIN CAPITAL LETTER H WITH BREVE BELOW +\setXTXcharcodes "01E2B "01E2B "01E2A % LATIN SMALL LETTER H WITH BREVE BELOW +\setXTXcharcodes "01E2C "01E2D "01E2C % LATIN CAPITAL LETTER I WITH TILDE BELOW +\setXTXcharcodes "01E2D "01E2D "01E2C % LATIN SMALL LETTER I WITH TILDE BELOW +\setXTXcharcodes "01E2E "01E2F "01E2E % LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE +\setXTXcharcodes "01E2F "01E2F "01E2E % LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE +\setXTXcharcodes "01E30 "01E31 "01E30 % LATIN CAPITAL LETTER K WITH ACUTE +\setXTXcharcodes "01E31 "01E31 "01E30 % LATIN SMALL LETTER K WITH ACUTE +\setXTXcharcodes "01E32 "01E33 "01E32 % LATIN CAPITAL LETTER K WITH DOT BELOW +\setXTXcharcodes "01E33 "01E33 "01E32 % LATIN SMALL LETTER K WITH DOT BELOW +\setXTXcharcodes "01E34 "01E35 "01E34 % LATIN CAPITAL LETTER K WITH LINE BELOW +\setXTXcharcodes "01E35 "01E35 "01E34 % LATIN SMALL LETTER K WITH LINE BELOW +\setXTXcharcodes "01E36 "01E37 "01E36 % LATIN CAPITAL LETTER L WITH DOT BELOW +\setXTXcharcodes "01E37 "01E37 "01E36 % LATIN SMALL LETTER L WITH DOT BELOW +\setXTXcharcodes "01E38 "01E39 "01E38 % LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON +\setXTXcharcodes "01E39 "01E39 "01E38 % LATIN SMALL LETTER L WITH DOT BELOW AND MACRON +\setXTXcharcodes "01E3A "01E3B "01E3A % LATIN CAPITAL LETTER L WITH LINE BELOW +\setXTXcharcodes "01E3B "01E3B "01E3A % LATIN SMALL LETTER L WITH LINE BELOW +\setXTXcharcodes "01E3C "01E3D "01E3C % LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E3D "01E3D "01E3C % LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E3E "01E3F "01E3E % LATIN CAPITAL LETTER M WITH ACUTE +\setXTXcharcodes "01E3F "01E3F "01E3E % LATIN SMALL LETTER M WITH ACUTE +\setXTXcharcodes "01E40 "01E41 "01E40 % LATIN CAPITAL LETTER M WITH DOT ABOVE +\setXTXcharcodes "01E41 "01E41 "01E40 % LATIN SMALL LETTER M WITH DOT ABOVE +\setXTXcharcodes "01E42 "01E43 "01E42 % LATIN CAPITAL LETTER M WITH DOT BELOW +\setXTXcharcodes "01E43 "01E43 "01E42 % LATIN SMALL LETTER M WITH DOT BELOW +\setXTXcharcodes "01E44 "01E45 "01E44 % LATIN CAPITAL LETTER N WITH DOT ABOVE +\setXTXcharcodes "01E45 "01E45 "01E44 % LATIN SMALL LETTER N WITH DOT ABOVE +\setXTXcharcodes "01E46 "01E47 "01E46 % LATIN CAPITAL LETTER N WITH DOT BELOW +\setXTXcharcodes "01E47 "01E47 "01E46 % LATIN SMALL LETTER N WITH DOT BELOW +\setXTXcharcodes "01E48 "01E49 "01E48 % LATIN CAPITAL LETTER N WITH LINE BELOW +\setXTXcharcodes "01E49 "01E49 "01E48 % LATIN SMALL LETTER N WITH LINE BELOW +\setXTXcharcodes "01E4A "01E4B "01E4A % LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E4B "01E4B "01E4A % LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E4C "01E4D "01E4C % LATIN CAPITAL LETTER O WITH TILDE AND ACUTE +\setXTXcharcodes "01E4D "01E4D "01E4C % LATIN SMALL LETTER O WITH TILDE AND ACUTE +\setXTXcharcodes "01E4E "01E4F "01E4E % LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS +\setXTXcharcodes "01E4F "01E4F "01E4E % LATIN SMALL LETTER O WITH TILDE AND DIAERESIS +\setXTXcharcodes "01E50 "01E51 "01E50 % LATIN CAPITAL LETTER O WITH MACRON AND GRAVE +\setXTXcharcodes "01E51 "01E51 "01E50 % LATIN SMALL LETTER O WITH MACRON AND GRAVE +\setXTXcharcodes "01E52 "01E53 "01E52 % LATIN CAPITAL LETTER O WITH MACRON AND ACUTE +\setXTXcharcodes "01E53 "01E53 "01E52 % LATIN SMALL LETTER O WITH MACRON AND ACUTE +\setXTXcharcodes "01E54 "01E55 "01E54 % LATIN CAPITAL LETTER P WITH ACUTE +\setXTXcharcodes "01E55 "01E55 "01E54 % LATIN SMALL LETTER P WITH ACUTE +\setXTXcharcodes "01E56 "01E57 "01E56 % LATIN CAPITAL LETTER P WITH DOT ABOVE +\setXTXcharcodes "01E57 "01E57 "01E56 % LATIN SMALL LETTER P WITH DOT ABOVE +\setXTXcharcodes "01E58 "01E59 "01E58 % LATIN CAPITAL LETTER R WITH DOT ABOVE +\setXTXcharcodes "01E59 "01E59 "01E58 % LATIN SMALL LETTER R WITH DOT ABOVE +\setXTXcharcodes "01E5A "01E5B "01E5A % LATIN CAPITAL LETTER R WITH DOT BELOW +\setXTXcharcodes "01E5B "01E5B "01E5A % LATIN SMALL LETTER R WITH DOT BELOW +\setXTXcharcodes "01E5C "01E5D "01E5C % LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON +\setXTXcharcodes "01E5D "01E5D "01E5C % LATIN SMALL LETTER R WITH DOT BELOW AND MACRON +\setXTXcharcodes "01E5E "01E5F "01E5E % LATIN CAPITAL LETTER R WITH LINE BELOW +\setXTXcharcodes "01E5F "01E5F "01E5E % LATIN SMALL LETTER R WITH LINE BELOW +\setXTXcharcodes "01E60 "01E61 "01E60 % LATIN CAPITAL LETTER S WITH DOT ABOVE +\setXTXcharcodes "01E61 "01E61 "01E60 % LATIN SMALL LETTER S WITH DOT ABOVE +\setXTXcharcodes "01E62 "01E63 "01E62 % LATIN CAPITAL LETTER S WITH DOT BELOW +\setXTXcharcodes "01E63 "01E63 "01E62 % LATIN SMALL LETTER S WITH DOT BELOW +\setXTXcharcodes "01E64 "01E65 "01E64 % LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE +\setXTXcharcodes "01E65 "01E65 "01E64 % LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE +\setXTXcharcodes "01E66 "01E67 "01E66 % LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE +\setXTXcharcodes "01E67 "01E67 "01E66 % LATIN SMALL LETTER S WITH CARON AND DOT ABOVE +\setXTXcharcodes "01E68 "01E69 "01E68 % LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE +\setXTXcharcodes "01E69 "01E69 "01E68 % LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE +\setXTXcharcodes "01E6A "01E6B "01E6A % LATIN CAPITAL LETTER T WITH DOT ABOVE +\setXTXcharcodes "01E6B "01E6B "01E6A % LATIN SMALL LETTER T WITH DOT ABOVE +\setXTXcharcodes "01E6C "01E6D "01E6C % LATIN CAPITAL LETTER T WITH DOT BELOW +\setXTXcharcodes "01E6D "01E6D "01E6C % LATIN SMALL LETTER T WITH DOT BELOW +\setXTXcharcodes "01E6E "01E6F "01E6E % LATIN CAPITAL LETTER T WITH LINE BELOW +\setXTXcharcodes "01E6F "01E6F "01E6E % LATIN SMALL LETTER T WITH LINE BELOW +\setXTXcharcodes "01E70 "01E71 "01E70 % LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E71 "01E71 "01E70 % LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E72 "01E73 "01E72 % LATIN CAPITAL LETTER U WITH DIAERESIS BELOW +\setXTXcharcodes "01E73 "01E73 "01E72 % LATIN SMALL LETTER U WITH DIAERESIS BELOW +\setXTXcharcodes "01E74 "01E75 "01E74 % LATIN CAPITAL LETTER U WITH TILDE BELOW +\setXTXcharcodes "01E75 "01E75 "01E74 % LATIN SMALL LETTER U WITH TILDE BELOW +\setXTXcharcodes "01E76 "01E77 "01E76 % LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E77 "01E77 "01E76 % LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW +\setXTXcharcodes "01E78 "01E79 "01E78 % LATIN CAPITAL LETTER U WITH TILDE AND ACUTE +\setXTXcharcodes "01E79 "01E79 "01E78 % LATIN SMALL LETTER U WITH TILDE AND ACUTE +\setXTXcharcodes "01E7A "01E7B "01E7A % LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS +\setXTXcharcodes "01E7B "01E7B "01E7A % LATIN SMALL LETTER U WITH MACRON AND DIAERESIS +\setXTXcharcodes "01E7C "01E7D "01E7C % LATIN CAPITAL LETTER V WITH TILDE +\setXTXcharcodes "01E7D "01E7D "01E7C % LATIN SMALL LETTER V WITH TILDE +\setXTXcharcodes "01E7E "01E7F "01E7E % LATIN CAPITAL LETTER V WITH DOT BELOW +\setXTXcharcodes "01E7F "01E7F "01E7E % LATIN SMALL LETTER V WITH DOT BELOW +\setXTXcharcodes "01E80 "01E81 "01E80 % LATIN CAPITAL LETTER W WITH GRAVE +\setXTXcharcodes "01E81 "01E81 "01E80 % LATIN SMALL LETTER W WITH GRAVE +\setXTXcharcodes "01E82 "01E83 "01E82 % LATIN CAPITAL LETTER W WITH ACUTE +\setXTXcharcodes "01E83 "01E83 "01E82 % LATIN SMALL LETTER W WITH ACUTE +\setXTXcharcodes "01E84 "01E85 "01E84 % LATIN CAPITAL LETTER W WITH DIAERESIS +\setXTXcharcodes "01E85 "01E85 "01E84 % LATIN SMALL LETTER W WITH DIAERESIS +\setXTXcharcodes "01E86 "01E87 "01E86 % LATIN CAPITAL LETTER W WITH DOT ABOVE +\setXTXcharcodes "01E87 "01E87 "01E86 % LATIN SMALL LETTER W WITH DOT ABOVE +\setXTXcharcodes "01E88 "01E89 "01E88 % LATIN CAPITAL LETTER W WITH DOT BELOW +\setXTXcharcodes "01E89 "01E89 "01E88 % LATIN SMALL LETTER W WITH DOT BELOW +\setXTXcharcodes "01E8A "01E8B "01E8A % LATIN CAPITAL LETTER X WITH DOT ABOVE +\setXTXcharcodes "01E8B "01E8B "01E8A % LATIN SMALL LETTER X WITH DOT ABOVE +\setXTXcharcodes "01E8C "01E8D "01E8C % LATIN CAPITAL LETTER X WITH DIAERESIS +\setXTXcharcodes "01E8D "01E8D "01E8C % LATIN SMALL LETTER X WITH DIAERESIS +\setXTXcharcodes "01E8E "01E8F "01E8E % LATIN CAPITAL LETTER Y WITH DOT ABOVE +\setXTXcharcodes "01E8F "01E8F "01E8E % LATIN SMALL LETTER Y WITH DOT ABOVE +\setXTXcharcodes "01E90 "01E91 "01E90 % LATIN CAPITAL LETTER Z WITH CIRCUMFLEX +\setXTXcharcodes "01E91 "01E91 "01E90 % LATIN SMALL LETTER Z WITH CIRCUMFLEX +\setXTXcharcodes "01E92 "01E93 "01E92 % LATIN CAPITAL LETTER Z WITH DOT BELOW +\setXTXcharcodes "01E93 "01E93 "01E92 % LATIN SMALL LETTER Z WITH DOT BELOW +\setXTXcharcodes "01E94 "01E95 "01E94 % LATIN CAPITAL LETTER Z WITH LINE BELOW +\setXTXcharcodes "01E95 "01E95 "01E94 % LATIN SMALL LETTER Z WITH LINE BELOW +\setXTXcharcodes "01E96 "01E96 "01E96 % LATIN SMALL LETTER H WITH LINE BELOW +\setXTXcharcodes "01E97 "01E97 "01E97 % LATIN SMALL LETTER T WITH DIAERESIS +\setXTXcharcodes "01E98 "01E98 "01E98 % LATIN SMALL LETTER W WITH RING ABOVE +\setXTXcharcodes "01E99 "01E99 "01E99 % LATIN SMALL LETTER Y WITH RING ABOVE +\setXTXcharcodes "01E9A "01E9A "01E9A % LATIN SMALL LETTER A WITH RIGHT HALF RING +\setXTXcharcodes "01E9B "01E9B "01E60 % LATIN SMALL LETTER LONG S WITH DOT ABOVE +\setXTXcharcodes "01EA0 "01EA1 "01EA0 % LATIN CAPITAL LETTER A WITH DOT BELOW +\setXTXcharcodes "01EA1 "01EA1 "01EA0 % LATIN SMALL LETTER A WITH DOT BELOW +\setXTXcharcodes "01EA2 "01EA3 "01EA2 % LATIN CAPITAL LETTER A WITH HOOK ABOVE +\setXTXcharcodes "01EA3 "01EA3 "01EA2 % LATIN SMALL LETTER A WITH HOOK ABOVE +\setXTXcharcodes "01EA4 "01EA5 "01EA4 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE +\setXTXcharcodes "01EA5 "01EA5 "01EA4 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE +\setXTXcharcodes "01EA6 "01EA7 "01EA6 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE +\setXTXcharcodes "01EA7 "01EA7 "01EA6 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE +\setXTXcharcodes "01EA8 "01EA9 "01EA8 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE +\setXTXcharcodes "01EA9 "01EA9 "01EA8 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE +\setXTXcharcodes "01EAA "01EAB "01EAA % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE +\setXTXcharcodes "01EAB "01EAB "01EAA % LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE +\setXTXcharcodes "01EAC "01EAD "01EAC % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW +\setXTXcharcodes "01EAD "01EAD "01EAC % LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW +\setXTXcharcodes "01EAE "01EAF "01EAE % LATIN CAPITAL LETTER A WITH BREVE AND ACUTE +\setXTXcharcodes "01EAF "01EAF "01EAE % LATIN SMALL LETTER A WITH BREVE AND ACUTE +\setXTXcharcodes "01EB0 "01EB1 "01EB0 % LATIN CAPITAL LETTER A WITH BREVE AND GRAVE +\setXTXcharcodes "01EB1 "01EB1 "01EB0 % LATIN SMALL LETTER A WITH BREVE AND GRAVE +\setXTXcharcodes "01EB2 "01EB3 "01EB2 % LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE +\setXTXcharcodes "01EB3 "01EB3 "01EB2 % LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE +\setXTXcharcodes "01EB4 "01EB5 "01EB4 % LATIN CAPITAL LETTER A WITH BREVE AND TILDE +\setXTXcharcodes "01EB5 "01EB5 "01EB4 % LATIN SMALL LETTER A WITH BREVE AND TILDE +\setXTXcharcodes "01EB6 "01EB7 "01EB6 % LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW +\setXTXcharcodes "01EB7 "01EB7 "01EB6 % LATIN SMALL LETTER A WITH BREVE AND DOT BELOW +\setXTXcharcodes "01EB8 "01EB9 "01EB8 % LATIN CAPITAL LETTER E WITH DOT BELOW +\setXTXcharcodes "01EB9 "01EB9 "01EB8 % LATIN SMALL LETTER E WITH DOT BELOW +\setXTXcharcodes "01EBA "01EBB "01EBA % LATIN CAPITAL LETTER E WITH HOOK ABOVE +\setXTXcharcodes "01EBB "01EBB "01EBA % LATIN SMALL LETTER E WITH HOOK ABOVE +\setXTXcharcodes "01EBC "01EBD "01EBC % LATIN CAPITAL LETTER E WITH TILDE +\setXTXcharcodes "01EBD "01EBD "01EBC % LATIN SMALL LETTER E WITH TILDE +\setXTXcharcodes "01EBE "01EBF "01EBE % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE +\setXTXcharcodes "01EBF "01EBF "01EBE % LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE +\setXTXcharcodes "01EC0 "01EC1 "01EC0 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE +\setXTXcharcodes "01EC1 "01EC1 "01EC0 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE +\setXTXcharcodes "01EC2 "01EC3 "01EC2 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE +\setXTXcharcodes "01EC3 "01EC3 "01EC2 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE +\setXTXcharcodes "01EC4 "01EC5 "01EC4 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE +\setXTXcharcodes "01EC5 "01EC5 "01EC4 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE +\setXTXcharcodes "01EC6 "01EC7 "01EC6 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW +\setXTXcharcodes "01EC7 "01EC7 "01EC6 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW +\setXTXcharcodes "01EC8 "01EC9 "01EC8 % LATIN CAPITAL LETTER I WITH HOOK ABOVE +\setXTXcharcodes "01EC9 "01EC9 "01EC8 % LATIN SMALL LETTER I WITH HOOK ABOVE +\setXTXcharcodes "01ECA "01ECB "01ECA % LATIN CAPITAL LETTER I WITH DOT BELOW +\setXTXcharcodes "01ECB "01ECB "01ECA % LATIN SMALL LETTER I WITH DOT BELOW +\setXTXcharcodes "01ECC "01ECD "01ECC % LATIN CAPITAL LETTER O WITH DOT BELOW +\setXTXcharcodes "01ECD "01ECD "01ECC % LATIN SMALL LETTER O WITH DOT BELOW +\setXTXcharcodes "01ECE "01ECF "01ECE % LATIN CAPITAL LETTER O WITH HOOK ABOVE +\setXTXcharcodes "01ECF "01ECF "01ECE % LATIN SMALL LETTER O WITH HOOK ABOVE +\setXTXcharcodes "01ED0 "01ED1 "01ED0 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE +\setXTXcharcodes "01ED1 "01ED1 "01ED0 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE +\setXTXcharcodes "01ED2 "01ED3 "01ED2 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE +\setXTXcharcodes "01ED3 "01ED3 "01ED2 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE +\setXTXcharcodes "01ED4 "01ED5 "01ED4 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE +\setXTXcharcodes "01ED5 "01ED5 "01ED4 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE +\setXTXcharcodes "01ED6 "01ED7 "01ED6 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE +\setXTXcharcodes "01ED7 "01ED7 "01ED6 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE +\setXTXcharcodes "01ED8 "01ED9 "01ED8 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW +\setXTXcharcodes "01ED9 "01ED9 "01ED8 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW +\setXTXcharcodes "01EDA "01EDB "01EDA % LATIN CAPITAL LETTER O WITH HORN AND ACUTE +\setXTXcharcodes "01EDB "01EDB "01EDA % LATIN SMALL LETTER O WITH HORN AND ACUTE +\setXTXcharcodes "01EDC "01EDD "01EDC % LATIN CAPITAL LETTER O WITH HORN AND GRAVE +\setXTXcharcodes "01EDD "01EDD "01EDC % LATIN SMALL LETTER O WITH HORN AND GRAVE +\setXTXcharcodes "01EDE "01EDF "01EDE % LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE +\setXTXcharcodes "01EDF "01EDF "01EDE % LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE +\setXTXcharcodes "01EE0 "01EE1 "01EE0 % LATIN CAPITAL LETTER O WITH HORN AND TILDE +\setXTXcharcodes "01EE1 "01EE1 "01EE0 % LATIN SMALL LETTER O WITH HORN AND TILDE +\setXTXcharcodes "01EE2 "01EE3 "01EE2 % LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW +\setXTXcharcodes "01EE3 "01EE3 "01EE2 % LATIN SMALL LETTER O WITH HORN AND DOT BELOW +\setXTXcharcodes "01EE4 "01EE5 "01EE4 % LATIN CAPITAL LETTER U WITH DOT BELOW +\setXTXcharcodes "01EE5 "01EE5 "01EE4 % LATIN SMALL LETTER U WITH DOT BELOW +\setXTXcharcodes "01EE6 "01EE7 "01EE6 % LATIN CAPITAL LETTER U WITH HOOK ABOVE +\setXTXcharcodes "01EE7 "01EE7 "01EE6 % LATIN SMALL LETTER U WITH HOOK ABOVE +\setXTXcharcodes "01EE8 "01EE9 "01EE8 % LATIN CAPITAL LETTER U WITH HORN AND ACUTE +\setXTXcharcodes "01EE9 "01EE9 "01EE8 % LATIN SMALL LETTER U WITH HORN AND ACUTE +\setXTXcharcodes "01EEA "01EEB "01EEA % LATIN CAPITAL LETTER U WITH HORN AND GRAVE +\setXTXcharcodes "01EEB "01EEB "01EEA % LATIN SMALL LETTER U WITH HORN AND GRAVE +\setXTXcharcodes "01EEC "01EED "01EEC % LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE +\setXTXcharcodes "01EED "01EED "01EEC % LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE +\setXTXcharcodes "01EEE "01EEF "01EEE % LATIN CAPITAL LETTER U WITH HORN AND TILDE +\setXTXcharcodes "01EEF "01EEF "01EEE % LATIN SMALL LETTER U WITH HORN AND TILDE +\setXTXcharcodes "01EF0 "01EF1 "01EF0 % LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW +\setXTXcharcodes "01EF1 "01EF1 "01EF0 % LATIN SMALL LETTER U WITH HORN AND DOT BELOW +\setXTXcharcodes "01EF2 "01EF3 "01EF2 % LATIN CAPITAL LETTER Y WITH GRAVE +\setXTXcharcodes "01EF3 "01EF3 "01EF2 % LATIN SMALL LETTER Y WITH GRAVE +\setXTXcharcodes "01EF4 "01EF5 "01EF4 % LATIN CAPITAL LETTER Y WITH DOT BELOW +\setXTXcharcodes "01EF5 "01EF5 "01EF4 % LATIN SMALL LETTER Y WITH DOT BELOW +\setXTXcharcodes "01EF6 "01EF7 "01EF6 % LATIN CAPITAL LETTER Y WITH HOOK ABOVE +\setXTXcharcodes "01EF7 "01EF7 "01EF6 % LATIN SMALL LETTER Y WITH HOOK ABOVE +\setXTXcharcodes "01EF8 "01EF9 "01EF8 % LATIN CAPITAL LETTER Y WITH TILDE +\setXTXcharcodes "01EF9 "01EF9 "01EF8 % LATIN SMALL LETTER Y WITH TILDE +\setXTXcharcodes "01F00 "01F00 "01F08 % GREEK SMALL LETTER ALPHA WITH PSILI +\setXTXcharcodes "01F01 "01F01 "01F09 % GREEK SMALL LETTER ALPHA WITH DASIA +\setXTXcharcodes "01F02 "01F02 "01F0A % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA +\setXTXcharcodes "01F03 "01F03 "01F0B % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA +\setXTXcharcodes "01F04 "01F04 "01F0C % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA +\setXTXcharcodes "01F05 "01F05 "01F0D % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA +\setXTXcharcodes "01F06 "01F06 "01F0E % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI +\setXTXcharcodes "01F07 "01F07 "01F0F % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F08 "01F00 "01F08 % GREEK CAPITAL LETTER ALPHA WITH PSILI +\setXTXcharcodes "01F09 "01F01 "01F09 % GREEK CAPITAL LETTER ALPHA WITH DASIA +\setXTXcharcodes "01F0A "01F02 "01F0A % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA +\setXTXcharcodes "01F0B "01F03 "01F0B % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA +\setXTXcharcodes "01F0C "01F04 "01F0C % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA +\setXTXcharcodes "01F0D "01F05 "01F0D % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA +\setXTXcharcodes "01F0E "01F06 "01F0E % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI +\setXTXcharcodes "01F0F "01F07 "01F0F % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F10 "01F10 "01F18 % GREEK SMALL LETTER EPSILON WITH PSILI +\setXTXcharcodes "01F11 "01F11 "01F19 % GREEK SMALL LETTER EPSILON WITH DASIA +\setXTXcharcodes "01F12 "01F12 "01F1A % GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA +\setXTXcharcodes "01F13 "01F13 "01F1B % GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA +\setXTXcharcodes "01F14 "01F14 "01F1C % GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA +\setXTXcharcodes "01F15 "01F15 "01F1D % GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA +\setXTXcharcodes "01F18 "01F10 "01F18 % GREEK CAPITAL LETTER EPSILON WITH PSILI +\setXTXcharcodes "01F19 "01F11 "01F19 % GREEK CAPITAL LETTER EPSILON WITH DASIA +\setXTXcharcodes "01F1A "01F12 "01F1A % GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA +\setXTXcharcodes "01F1B "01F13 "01F1B % GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA +\setXTXcharcodes "01F1C "01F14 "01F1C % GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA +\setXTXcharcodes "01F1D "01F15 "01F1D % GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA +\setXTXcharcodes "01F20 "01F20 "01F28 % GREEK SMALL LETTER ETA WITH PSILI +\setXTXcharcodes "01F21 "01F21 "01F29 % GREEK SMALL LETTER ETA WITH DASIA +\setXTXcharcodes "01F22 "01F22 "01F2A % GREEK SMALL LETTER ETA WITH PSILI AND VARIA +\setXTXcharcodes "01F23 "01F23 "01F2B % GREEK SMALL LETTER ETA WITH DASIA AND VARIA +\setXTXcharcodes "01F24 "01F24 "01F2C % GREEK SMALL LETTER ETA WITH PSILI AND OXIA +\setXTXcharcodes "01F25 "01F25 "01F2D % GREEK SMALL LETTER ETA WITH DASIA AND OXIA +\setXTXcharcodes "01F26 "01F26 "01F2E % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI +\setXTXcharcodes "01F27 "01F27 "01F2F % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F28 "01F20 "01F28 % GREEK CAPITAL LETTER ETA WITH PSILI +\setXTXcharcodes "01F29 "01F21 "01F29 % GREEK CAPITAL LETTER ETA WITH DASIA +\setXTXcharcodes "01F2A "01F22 "01F2A % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA +\setXTXcharcodes "01F2B "01F23 "01F2B % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA +\setXTXcharcodes "01F2C "01F24 "01F2C % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA +\setXTXcharcodes "01F2D "01F25 "01F2D % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA +\setXTXcharcodes "01F2E "01F26 "01F2E % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI +\setXTXcharcodes "01F2F "01F27 "01F2F % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F30 "01F30 "01F38 % GREEK SMALL LETTER IOTA WITH PSILI +\setXTXcharcodes "01F31 "01F31 "01F39 % GREEK SMALL LETTER IOTA WITH DASIA +\setXTXcharcodes "01F32 "01F32 "01F3A % GREEK SMALL LETTER IOTA WITH PSILI AND VARIA +\setXTXcharcodes "01F33 "01F33 "01F3B % GREEK SMALL LETTER IOTA WITH DASIA AND VARIA +\setXTXcharcodes "01F34 "01F34 "01F3C % GREEK SMALL LETTER IOTA WITH PSILI AND OXIA +\setXTXcharcodes "01F35 "01F35 "01F3D % GREEK SMALL LETTER IOTA WITH DASIA AND OXIA +\setXTXcharcodes "01F36 "01F36 "01F3E % GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI +\setXTXcharcodes "01F37 "01F37 "01F3F % GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F38 "01F30 "01F38 % GREEK CAPITAL LETTER IOTA WITH PSILI +\setXTXcharcodes "01F39 "01F31 "01F39 % GREEK CAPITAL LETTER IOTA WITH DASIA +\setXTXcharcodes "01F3A "01F32 "01F3A % GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA +\setXTXcharcodes "01F3B "01F33 "01F3B % GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA +\setXTXcharcodes "01F3C "01F34 "01F3C % GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA +\setXTXcharcodes "01F3D "01F35 "01F3D % GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA +\setXTXcharcodes "01F3E "01F36 "01F3E % GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI +\setXTXcharcodes "01F3F "01F37 "01F3F % GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F40 "01F40 "01F48 % GREEK SMALL LETTER OMICRON WITH PSILI +\setXTXcharcodes "01F41 "01F41 "01F49 % GREEK SMALL LETTER OMICRON WITH DASIA +\setXTXcharcodes "01F42 "01F42 "01F4A % GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA +\setXTXcharcodes "01F43 "01F43 "01F4B % GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA +\setXTXcharcodes "01F44 "01F44 "01F4C % GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA +\setXTXcharcodes "01F45 "01F45 "01F4D % GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA +\setXTXcharcodes "01F48 "01F40 "01F48 % GREEK CAPITAL LETTER OMICRON WITH PSILI +\setXTXcharcodes "01F49 "01F41 "01F49 % GREEK CAPITAL LETTER OMICRON WITH DASIA +\setXTXcharcodes "01F4A "01F42 "01F4A % GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA +\setXTXcharcodes "01F4B "01F43 "01F4B % GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA +\setXTXcharcodes "01F4C "01F44 "01F4C % GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA +\setXTXcharcodes "01F4D "01F45 "01F4D % GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA +\setXTXcharcodes "01F50 "01F50 "01F50 % GREEK SMALL LETTER UPSILON WITH PSILI +\setXTXcharcodes "01F51 "01F51 "01F59 % GREEK SMALL LETTER UPSILON WITH DASIA +\setXTXcharcodes "01F52 "01F52 "01F52 % GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA +\setXTXcharcodes "01F53 "01F53 "01F5B % GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA +\setXTXcharcodes "01F54 "01F54 "01F54 % GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA +\setXTXcharcodes "01F55 "01F55 "01F5D % GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA +\setXTXcharcodes "01F56 "01F56 "01F56 % GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI +\setXTXcharcodes "01F57 "01F57 "01F5F % GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F59 "01F51 "01F59 % GREEK CAPITAL LETTER UPSILON WITH DASIA +\setXTXcharcodes "01F5B "01F53 "01F5B % GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA +\setXTXcharcodes "01F5D "01F55 "01F5D % GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA +\setXTXcharcodes "01F5F "01F57 "01F5F % GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F60 "01F60 "01F68 % GREEK SMALL LETTER OMEGA WITH PSILI +\setXTXcharcodes "01F61 "01F61 "01F69 % GREEK SMALL LETTER OMEGA WITH DASIA +\setXTXcharcodes "01F62 "01F62 "01F6A % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA +\setXTXcharcodes "01F63 "01F63 "01F6B % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA +\setXTXcharcodes "01F64 "01F64 "01F6C % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA +\setXTXcharcodes "01F65 "01F65 "01F6D % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA +\setXTXcharcodes "01F66 "01F66 "01F6E % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI +\setXTXcharcodes "01F67 "01F67 "01F6F % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F68 "01F60 "01F68 % GREEK CAPITAL LETTER OMEGA WITH PSILI +\setXTXcharcodes "01F69 "01F61 "01F69 % GREEK CAPITAL LETTER OMEGA WITH DASIA +\setXTXcharcodes "01F6A "01F62 "01F6A % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA +\setXTXcharcodes "01F6B "01F63 "01F6B % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA +\setXTXcharcodes "01F6C "01F64 "01F6C % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA +\setXTXcharcodes "01F6D "01F65 "01F6D % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA +\setXTXcharcodes "01F6E "01F66 "01F6E % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI +\setXTXcharcodes "01F6F "01F67 "01F6F % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI +\setXTXcharcodes "01F70 "01F70 "01FBA % GREEK SMALL LETTER ALPHA WITH VARIA +\setXTXcharcodes "01F71 "01F71 "01FBB % GREEK SMALL LETTER ALPHA WITH OXIA +\setXTXcharcodes "01F72 "01F72 "01FC8 % GREEK SMALL LETTER EPSILON WITH VARIA +\setXTXcharcodes "01F73 "01F73 "01FC9 % GREEK SMALL LETTER EPSILON WITH OXIA +\setXTXcharcodes "01F74 "01F74 "01FCA % GREEK SMALL LETTER ETA WITH VARIA +\setXTXcharcodes "01F75 "01F75 "01FCB % GREEK SMALL LETTER ETA WITH OXIA +\setXTXcharcodes "01F76 "01F76 "01FDA % GREEK SMALL LETTER IOTA WITH VARIA +\setXTXcharcodes "01F77 "01F77 "01FDB % GREEK SMALL LETTER IOTA WITH OXIA +\setXTXcharcodes "01F78 "01F78 "01FF8 % GREEK SMALL LETTER OMICRON WITH VARIA +\setXTXcharcodes "01F79 "01F79 "01FF9 % GREEK SMALL LETTER OMICRON WITH OXIA +\setXTXcharcodes "01F7A "01F7A "01FEA % GREEK SMALL LETTER UPSILON WITH VARIA +\setXTXcharcodes "01F7B "01F7B "01FEB % GREEK SMALL LETTER UPSILON WITH OXIA +\setXTXcharcodes "01F7C "01F7C "01FFA % GREEK SMALL LETTER OMEGA WITH VARIA +\setXTXcharcodes "01F7D "01F7D "01FFB % GREEK SMALL LETTER OMEGA WITH OXIA +\setXTXcharcodes "01F80 "01F80 "01F88 % GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI +\setXTXcharcodes "01F81 "01F81 "01F89 % GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F82 "01F82 "01F8A % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F83 "01F83 "01F8B % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F84 "01F84 "01F8C % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F85 "01F85 "01F8D % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F86 "01F86 "01F8E % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI +\setXTXcharcodes "01F87 "01F87 "01F8F % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI +\setXTXcharcodes "01F88 "01F80 "01F88 % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI +\setXTXcharcodes "01F89 "01F81 "01F89 % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F8A "01F82 "01F8A % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F8B "01F83 "01F8B % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F8C "01F84 "01F8C % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F8D "01F85 "01F8D % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F8E "01F86 "01F8E % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI +\setXTXcharcodes "01F8F "01F87 "01F8F % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI +\setXTXcharcodes "01F90 "01F90 "01F98 % GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI +\setXTXcharcodes "01F91 "01F91 "01F99 % GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F92 "01F92 "01F9A % GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F93 "01F93 "01F9B % GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F94 "01F94 "01F9C % GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F95 "01F95 "01F9D % GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI +\setXTXcharcodes "01F96 "01F96 "01F9E % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI +\setXTXcharcodes "01F97 "01F97 "01F9F % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI +\setXTXcharcodes "01F98 "01F90 "01F98 % GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI +\setXTXcharcodes "01F99 "01F91 "01F99 % GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F9A "01F92 "01F9A % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F9B "01F93 "01F9B % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F9C "01F94 "01F9C % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F9D "01F95 "01F9D % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI +\setXTXcharcodes "01F9E "01F96 "01F9E % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI +\setXTXcharcodes "01F9F "01F97 "01F9F % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI +\setXTXcharcodes "01FA0 "01FA0 "01FA8 % GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI +\setXTXcharcodes "01FA1 "01FA1 "01FA9 % GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FA2 "01FA2 "01FAA % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FA3 "01FA3 "01FAB % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FA4 "01FA4 "01FAC % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FA5 "01FA5 "01FAD % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FA6 "01FA6 "01FAE % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI +\setXTXcharcodes "01FA7 "01FA7 "01FAF % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI +\setXTXcharcodes "01FA8 "01FA0 "01FA8 % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI +\setXTXcharcodes "01FA9 "01FA1 "01FA9 % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI +\setXTXcharcodes "01FAA "01FA2 "01FAA % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI +\setXTXcharcodes "01FAB "01FA3 "01FAB % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI +\setXTXcharcodes "01FAC "01FA4 "01FAC % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI +\setXTXcharcodes "01FAD "01FA5 "01FAD % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI +\setXTXcharcodes "01FAE "01FA6 "01FAE % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI +\setXTXcharcodes "01FAF "01FA7 "01FAF % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI +\setXTXcharcodes "01FB0 "01FB0 "01FB8 % GREEK SMALL LETTER ALPHA WITH VRACHY +\setXTXcharcodes "01FB1 "01FB1 "01FB9 % GREEK SMALL LETTER ALPHA WITH MACRON +\setXTXcharcodes "01FB2 "01FB2 "01FB2 % GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FB3 "01FB3 "01FBC % GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI +\setXTXcharcodes "01FB4 "01FB4 "01FB4 % GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FB6 "01FB6 "01FB6 % GREEK SMALL LETTER ALPHA WITH PERISPOMENI +\setXTXcharcodes "01FB7 "01FB7 "01FB7 % GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI +\setXTXcharcodes "01FB8 "01FB0 "01FB8 % GREEK CAPITAL LETTER ALPHA WITH VRACHY +\setXTXcharcodes "01FB9 "01FB1 "01FB9 % GREEK CAPITAL LETTER ALPHA WITH MACRON +\setXTXcharcodes "01FBA "01F70 "01FBA % GREEK CAPITAL LETTER ALPHA WITH VARIA +\setXTXcharcodes "01FBB "01F71 "01FBB % GREEK CAPITAL LETTER ALPHA WITH OXIA +\setXTXcharcodes "01FBC "01FB3 "01FBC % GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI +\setXTXcharcodes "01FBE "01FBE "00399 % GREEK PROSGEGRAMMENI +\setXTXcharcodes "01FC2 "01FC2 "01FC2 % GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FC3 "01FC3 "01FCC % GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI +\setXTXcharcodes "01FC4 "01FC4 "01FC4 % GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FC6 "01FC6 "01FC6 % GREEK SMALL LETTER ETA WITH PERISPOMENI +\setXTXcharcodes "01FC7 "01FC7 "01FC7 % GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI +\setXTXcharcodes "01FC8 "01F72 "01FC8 % GREEK CAPITAL LETTER EPSILON WITH VARIA +\setXTXcharcodes "01FC9 "01F73 "01FC9 % GREEK CAPITAL LETTER EPSILON WITH OXIA +\setXTXcharcodes "01FCA "01F74 "01FCA % GREEK CAPITAL LETTER ETA WITH VARIA +\setXTXcharcodes "01FCB "01F75 "01FCB % GREEK CAPITAL LETTER ETA WITH OXIA +\setXTXcharcodes "01FCC "01FC3 "01FCC % GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI +\setXTXcharcodes "01FD0 "01FD0 "01FD8 % GREEK SMALL LETTER IOTA WITH VRACHY +\setXTXcharcodes "01FD1 "01FD1 "01FD9 % GREEK SMALL LETTER IOTA WITH MACRON +\setXTXcharcodes "01FD2 "01FD2 "01FD2 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA +\setXTXcharcodes "01FD3 "01FD3 "01FD3 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA +\setXTXcharcodes "01FD6 "01FD6 "01FD6 % GREEK SMALL LETTER IOTA WITH PERISPOMENI +\setXTXcharcodes "01FD7 "01FD7 "01FD7 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI +\setXTXcharcodes "01FD8 "01FD0 "01FD8 % GREEK CAPITAL LETTER IOTA WITH VRACHY +\setXTXcharcodes "01FD9 "01FD1 "01FD9 % GREEK CAPITAL LETTER IOTA WITH MACRON +\setXTXcharcodes "01FDA "01F76 "01FDA % GREEK CAPITAL LETTER IOTA WITH VARIA +\setXTXcharcodes "01FDB "01F77 "01FDB % GREEK CAPITAL LETTER IOTA WITH OXIA +\setXTXcharcodes "01FE0 "01FE0 "01FE8 % GREEK SMALL LETTER UPSILON WITH VRACHY +\setXTXcharcodes "01FE1 "01FE1 "01FE9 % GREEK SMALL LETTER UPSILON WITH MACRON +\setXTXcharcodes "01FE2 "01FE2 "01FE2 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA +\setXTXcharcodes "01FE3 "01FE3 "01FE3 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA +\setXTXcharcodes "01FE4 "01FE4 "01FE4 % GREEK SMALL LETTER RHO WITH PSILI +\setXTXcharcodes "01FE5 "01FE5 "01FEC % GREEK SMALL LETTER RHO WITH DASIA +\setXTXcharcodes "01FE6 "01FE6 "01FE6 % GREEK SMALL LETTER UPSILON WITH PERISPOMENI +\setXTXcharcodes "01FE7 "01FE7 "01FE7 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI +\setXTXcharcodes "01FE8 "01FE0 "01FE8 % GREEK CAPITAL LETTER UPSILON WITH VRACHY +\setXTXcharcodes "01FE9 "01FE1 "01FE9 % GREEK CAPITAL LETTER UPSILON WITH MACRON +\setXTXcharcodes "01FEA "01F7A "01FEA % GREEK CAPITAL LETTER UPSILON WITH VARIA +\setXTXcharcodes "01FEB "01F7B "01FEB % GREEK CAPITAL LETTER UPSILON WITH OXIA +\setXTXcharcodes "01FEC "01FE5 "01FEC % GREEK CAPITAL LETTER RHO WITH DASIA +\setXTXcharcodes "01FF2 "01FF2 "01FF2 % GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FF3 "01FF3 "01FFC % GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI +\setXTXcharcodes "01FF4 "01FF4 "01FF4 % GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI +\setXTXcharcodes "01FF6 "01FF6 "01FF6 % GREEK SMALL LETTER OMEGA WITH PERISPOMENI +\setXTXcharcodes "01FF7 "01FF7 "01FF7 % GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI +\setXTXcharcodes "01FF8 "01F78 "01FF8 % GREEK CAPITAL LETTER OMICRON WITH VARIA +\setXTXcharcodes "01FF9 "01F79 "01FF9 % GREEK CAPITAL LETTER OMICRON WITH OXIA +\setXTXcharcodes "01FFA "01F7C "01FFA % GREEK CAPITAL LETTER OMEGA WITH VARIA +\setXTXcharcodes "01FFB "01F7D "01FFB % GREEK CAPITAL LETTER OMEGA WITH OXIA +\setXTXcharcodes "01FFC "01FF3 "01FFC % GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI +\setXTXcharcodes "02071 "02071 "02071 % SUPERSCRIPT LATIN SMALL LETTER I +\setXTXcharcodes "0207F "0207F "0207F % SUPERSCRIPT LATIN SMALL LETTER N +\setXTXcharcodes "02102 "02102 "02102 % DOUBLE-STRUCK CAPITAL C +\setXTXcharcodes "02107 "02107 "02107 % EULER CONSTANT +\setXTXcharcodes "0210A "0210A "0210A % SCRIPT SMALL G +\setXTXcharcodes "0210B "0210B "0210B % SCRIPT CAPITAL H +\setXTXcharcodes "0210C "0210C "0210C % BLACK-LETTER CAPITAL H +\setXTXcharcodes "0210D "0210D "0210D % DOUBLE-STRUCK CAPITAL H +\setXTXcharcodes "0210E "0210E "0210E % PLANCK CONSTANT +\setXTXcharcodes "0210F "0210F "0210F % PLANCK CONSTANT OVER TWO PI +\setXTXcharcodes "02110 "02110 "02110 % SCRIPT CAPITAL I +\setXTXcharcodes "02111 "02111 "02111 % BLACK-LETTER CAPITAL I +\setXTXcharcodes "02112 "02112 "02112 % SCRIPT CAPITAL L +\setXTXcharcodes "02113 "02113 "02113 % SCRIPT SMALL L +\setXTXcharcodes "02115 "02115 "02115 % DOUBLE-STRUCK CAPITAL N +\setXTXcharcodes "02119 "02119 "02119 % DOUBLE-STRUCK CAPITAL P +\setXTXcharcodes "0211A "0211A "0211A % DOUBLE-STRUCK CAPITAL Q +\setXTXcharcodes "0211B "0211B "0211B % SCRIPT CAPITAL R +\setXTXcharcodes "0211C "0211C "0211C % BLACK-LETTER CAPITAL R +\setXTXcharcodes "0211D "0211D "0211D % DOUBLE-STRUCK CAPITAL R +\setXTXcharcodes "02124 "02124 "02124 % DOUBLE-STRUCK CAPITAL Z +\setXTXcharcodes "02126 "003C9 "02126 % OHM SIGN +\setXTXcharcodes "02128 "02128 "02128 % BLACK-LETTER CAPITAL Z +\setXTXcharcodes "0212A "0006B "0212A % KELVIN SIGN +\setXTXcharcodes "0212B "000E5 "0212B % ANGSTROM SIGN +\setXTXcharcodes "0212C "0212C "0212C % SCRIPT CAPITAL B +\setXTXcharcodes "0212D "0212D "0212D % BLACK-LETTER CAPITAL C +\setXTXcharcodes "0212F "0212F "0212F % SCRIPT SMALL E +\setXTXcharcodes "02130 "02130 "02130 % SCRIPT CAPITAL E +\setXTXcharcodes "02131 "02131 "02131 % SCRIPT CAPITAL F +\setXTXcharcodes "02132 "0214E "02132 % TURNED CAPITAL F +\setXTXcharcodes "02133 "02133 "02133 % SCRIPT CAPITAL M +\setXTXcharcodes "02134 "02134 "02134 % SCRIPT SMALL O +\setXTXcharcodes "02139 "02139 "02139 % INFORMATION SOURCE +\setXTXcharcodes "0213C "0213C "0213C % DOUBLE-STRUCK SMALL PI +\setXTXcharcodes "0213D "0213D "0213D % DOUBLE-STRUCK SMALL GAMMA +\setXTXcharcodes "0213E "0213E "0213E % DOUBLE-STRUCK CAPITAL GAMMA +\setXTXcharcodes "0213F "0213F "0213F % DOUBLE-STRUCK CAPITAL PI +\setXTXcharcodes "02145 "02145 "02145 % DOUBLE-STRUCK ITALIC CAPITAL D +\setXTXcharcodes "02146 "02146 "02146 % DOUBLE-STRUCK ITALIC SMALL D +\setXTXcharcodes "02147 "02147 "02147 % DOUBLE-STRUCK ITALIC SMALL E +\setXTXcharcodes "02148 "02148 "02148 % DOUBLE-STRUCK ITALIC SMALL I +\setXTXcharcodes "02149 "02149 "02149 % DOUBLE-STRUCK ITALIC SMALL J +\setXTXcharcodes "0214E "0214E "02132 % TURNED SMALL F +\setXTXcharcodes "02183 "02184 "02183 % ROMAN NUMERAL REVERSED ONE HUNDRED +\setXTXcharcodes "02184 "02184 "02183 % LATIN SMALL LETTER REVERSED C +\setXTXcharcodes "02C00 "02C30 "02C00 % GLAGOLITIC CAPITAL LETTER AZU +\setXTXcharcodes "02C01 "02C31 "02C01 % GLAGOLITIC CAPITAL LETTER BUKY +\setXTXcharcodes "02C02 "02C32 "02C02 % GLAGOLITIC CAPITAL LETTER VEDE +\setXTXcharcodes "02C03 "02C33 "02C03 % GLAGOLITIC CAPITAL LETTER GLAGOLI +\setXTXcharcodes "02C04 "02C34 "02C04 % GLAGOLITIC CAPITAL LETTER DOBRO +\setXTXcharcodes "02C05 "02C35 "02C05 % GLAGOLITIC CAPITAL LETTER YESTU +\setXTXcharcodes "02C06 "02C36 "02C06 % GLAGOLITIC CAPITAL LETTER ZHIVETE +\setXTXcharcodes "02C07 "02C37 "02C07 % GLAGOLITIC CAPITAL LETTER DZELO +\setXTXcharcodes "02C08 "02C38 "02C08 % GLAGOLITIC CAPITAL LETTER ZEMLJA +\setXTXcharcodes "02C09 "02C39 "02C09 % GLAGOLITIC CAPITAL LETTER IZHE +\setXTXcharcodes "02C0A "02C3A "02C0A % GLAGOLITIC CAPITAL LETTER INITIAL IZHE +\setXTXcharcodes "02C0B "02C3B "02C0B % GLAGOLITIC CAPITAL LETTER I +\setXTXcharcodes "02C0C "02C3C "02C0C % GLAGOLITIC CAPITAL LETTER DJERVI +\setXTXcharcodes "02C0D "02C3D "02C0D % GLAGOLITIC CAPITAL LETTER KAKO +\setXTXcharcodes "02C0E "02C3E "02C0E % GLAGOLITIC CAPITAL LETTER LJUDIJE +\setXTXcharcodes "02C0F "02C3F "02C0F % GLAGOLITIC CAPITAL LETTER MYSLITE +\setXTXcharcodes "02C10 "02C40 "02C10 % GLAGOLITIC CAPITAL LETTER NASHI +\setXTXcharcodes "02C11 "02C41 "02C11 % GLAGOLITIC CAPITAL LETTER ONU +\setXTXcharcodes "02C12 "02C42 "02C12 % GLAGOLITIC CAPITAL LETTER POKOJI +\setXTXcharcodes "02C13 "02C43 "02C13 % GLAGOLITIC CAPITAL LETTER RITSI +\setXTXcharcodes "02C14 "02C44 "02C14 % GLAGOLITIC CAPITAL LETTER SLOVO +\setXTXcharcodes "02C15 "02C45 "02C15 % GLAGOLITIC CAPITAL LETTER TVRIDO +\setXTXcharcodes "02C16 "02C46 "02C16 % GLAGOLITIC CAPITAL LETTER UKU +\setXTXcharcodes "02C17 "02C47 "02C17 % GLAGOLITIC CAPITAL LETTER FRITU +\setXTXcharcodes "02C18 "02C48 "02C18 % GLAGOLITIC CAPITAL LETTER HERU +\setXTXcharcodes "02C19 "02C49 "02C19 % GLAGOLITIC CAPITAL LETTER OTU +\setXTXcharcodes "02C1A "02C4A "02C1A % GLAGOLITIC CAPITAL LETTER PE +\setXTXcharcodes "02C1B "02C4B "02C1B % GLAGOLITIC CAPITAL LETTER SHTA +\setXTXcharcodes "02C1C "02C4C "02C1C % GLAGOLITIC CAPITAL LETTER TSI +\setXTXcharcodes "02C1D "02C4D "02C1D % GLAGOLITIC CAPITAL LETTER CHRIVI +\setXTXcharcodes "02C1E "02C4E "02C1E % GLAGOLITIC CAPITAL LETTER SHA +\setXTXcharcodes "02C1F "02C4F "02C1F % GLAGOLITIC CAPITAL LETTER YERU +\setXTXcharcodes "02C20 "02C50 "02C20 % GLAGOLITIC CAPITAL LETTER YERI +\setXTXcharcodes "02C21 "02C51 "02C21 % GLAGOLITIC CAPITAL LETTER YATI +\setXTXcharcodes "02C22 "02C52 "02C22 % GLAGOLITIC CAPITAL LETTER SPIDERY HA +\setXTXcharcodes "02C23 "02C53 "02C23 % GLAGOLITIC CAPITAL LETTER YU +\setXTXcharcodes "02C24 "02C54 "02C24 % GLAGOLITIC CAPITAL LETTER SMALL YUS +\setXTXcharcodes "02C25 "02C55 "02C25 % GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL +\setXTXcharcodes "02C26 "02C56 "02C26 % GLAGOLITIC CAPITAL LETTER YO +\setXTXcharcodes "02C27 "02C57 "02C27 % GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS +\setXTXcharcodes "02C28 "02C58 "02C28 % GLAGOLITIC CAPITAL LETTER BIG YUS +\setXTXcharcodes "02C29 "02C59 "02C29 % GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS +\setXTXcharcodes "02C2A "02C5A "02C2A % GLAGOLITIC CAPITAL LETTER FITA +\setXTXcharcodes "02C2B "02C5B "02C2B % GLAGOLITIC CAPITAL LETTER IZHITSA +\setXTXcharcodes "02C2C "02C5C "02C2C % GLAGOLITIC CAPITAL LETTER SHTAPIC +\setXTXcharcodes "02C2D "02C5D "02C2D % GLAGOLITIC CAPITAL LETTER TROKUTASTI A +\setXTXcharcodes "02C2E "02C5E "02C2E % GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE +\setXTXcharcodes "02C30 "02C30 "02C00 % GLAGOLITIC SMALL LETTER AZU +\setXTXcharcodes "02C31 "02C31 "02C01 % GLAGOLITIC SMALL LETTER BUKY +\setXTXcharcodes "02C32 "02C32 "02C02 % GLAGOLITIC SMALL LETTER VEDE +\setXTXcharcodes "02C33 "02C33 "02C03 % GLAGOLITIC SMALL LETTER GLAGOLI +\setXTXcharcodes "02C34 "02C34 "02C04 % GLAGOLITIC SMALL LETTER DOBRO +\setXTXcharcodes "02C35 "02C35 "02C05 % GLAGOLITIC SMALL LETTER YESTU +\setXTXcharcodes "02C36 "02C36 "02C06 % GLAGOLITIC SMALL LETTER ZHIVETE +\setXTXcharcodes "02C37 "02C37 "02C07 % GLAGOLITIC SMALL LETTER DZELO +\setXTXcharcodes "02C38 "02C38 "02C08 % GLAGOLITIC SMALL LETTER ZEMLJA +\setXTXcharcodes "02C39 "02C39 "02C09 % GLAGOLITIC SMALL LETTER IZHE +\setXTXcharcodes "02C3A "02C3A "02C0A % GLAGOLITIC SMALL LETTER INITIAL IZHE +\setXTXcharcodes "02C3B "02C3B "02C0B % GLAGOLITIC SMALL LETTER I +\setXTXcharcodes "02C3C "02C3C "02C0C % GLAGOLITIC SMALL LETTER DJERVI +\setXTXcharcodes "02C3D "02C3D "02C0D % GLAGOLITIC SMALL LETTER KAKO +\setXTXcharcodes "02C3E "02C3E "02C0E % GLAGOLITIC SMALL LETTER LJUDIJE +\setXTXcharcodes "02C3F "02C3F "02C0F % GLAGOLITIC SMALL LETTER MYSLITE +\setXTXcharcodes "02C40 "02C40 "02C10 % GLAGOLITIC SMALL LETTER NASHI +\setXTXcharcodes "02C41 "02C41 "02C11 % GLAGOLITIC SMALL LETTER ONU +\setXTXcharcodes "02C42 "02C42 "02C12 % GLAGOLITIC SMALL LETTER POKOJI +\setXTXcharcodes "02C43 "02C43 "02C13 % GLAGOLITIC SMALL LETTER RITSI +\setXTXcharcodes "02C44 "02C44 "02C14 % GLAGOLITIC SMALL LETTER SLOVO +\setXTXcharcodes "02C45 "02C45 "02C15 % GLAGOLITIC SMALL LETTER TVRIDO +\setXTXcharcodes "02C46 "02C46 "02C16 % GLAGOLITIC SMALL LETTER UKU +\setXTXcharcodes "02C47 "02C47 "02C17 % GLAGOLITIC SMALL LETTER FRITU +\setXTXcharcodes "02C48 "02C48 "02C18 % GLAGOLITIC SMALL LETTER HERU +\setXTXcharcodes "02C49 "02C49 "02C19 % GLAGOLITIC SMALL LETTER OTU +\setXTXcharcodes "02C4A "02C4A "02C1A % GLAGOLITIC SMALL LETTER PE +\setXTXcharcodes "02C4B "02C4B "02C1B % GLAGOLITIC SMALL LETTER SHTA +\setXTXcharcodes "02C4C "02C4C "02C1C % GLAGOLITIC SMALL LETTER TSI +\setXTXcharcodes "02C4D "02C4D "02C1D % GLAGOLITIC SMALL LETTER CHRIVI +\setXTXcharcodes "02C4E "02C4E "02C1E % GLAGOLITIC SMALL LETTER SHA +\setXTXcharcodes "02C4F "02C4F "02C1F % GLAGOLITIC SMALL LETTER YERU +\setXTXcharcodes "02C50 "02C50 "02C20 % GLAGOLITIC SMALL LETTER YERI +\setXTXcharcodes "02C51 "02C51 "02C21 % GLAGOLITIC SMALL LETTER YATI +\setXTXcharcodes "02C52 "02C52 "02C22 % GLAGOLITIC SMALL LETTER SPIDERY HA +\setXTXcharcodes "02C53 "02C53 "02C23 % GLAGOLITIC SMALL LETTER YU +\setXTXcharcodes "02C54 "02C54 "02C24 % GLAGOLITIC SMALL LETTER SMALL YUS +\setXTXcharcodes "02C55 "02C55 "02C25 % GLAGOLITIC SMALL LETTER SMALL YUS WITH TAIL +\setXTXcharcodes "02C56 "02C56 "02C26 % GLAGOLITIC SMALL LETTER YO +\setXTXcharcodes "02C57 "02C57 "02C27 % GLAGOLITIC SMALL LETTER IOTATED SMALL YUS +\setXTXcharcodes "02C58 "02C58 "02C28 % GLAGOLITIC SMALL LETTER BIG YUS +\setXTXcharcodes "02C59 "02C59 "02C29 % GLAGOLITIC SMALL LETTER IOTATED BIG YUS +\setXTXcharcodes "02C5A "02C5A "02C2A % GLAGOLITIC SMALL LETTER FITA +\setXTXcharcodes "02C5B "02C5B "02C2B % GLAGOLITIC SMALL LETTER IZHITSA +\setXTXcharcodes "02C5C "02C5C "02C2C % GLAGOLITIC SMALL LETTER SHTAPIC +\setXTXcharcodes "02C5D "02C5D "02C2D % GLAGOLITIC SMALL LETTER TROKUTASTI A +\setXTXcharcodes "02C5E "02C5E "02C2E % GLAGOLITIC SMALL LETTER LATINATE MYSLITE +\setXTXcharcodes "02C60 "02C61 "02C60 % LATIN CAPITAL LETTER L WITH DOUBLE BAR +\setXTXcharcodes "02C61 "02C61 "02C60 % LATIN SMALL LETTER L WITH DOUBLE BAR +\setXTXcharcodes "02C62 "0026B "02C62 % LATIN CAPITAL LETTER L WITH MIDDLE TILDE +\setXTXcharcodes "02C63 "01D7D "02C63 % LATIN CAPITAL LETTER P WITH STROKE +\setXTXcharcodes "02C64 "0027D "02C64 % LATIN CAPITAL LETTER R WITH TAIL +\setXTXcharcodes "02C65 "02C65 "0023A % LATIN SMALL LETTER A WITH STROKE +\setXTXcharcodes "02C66 "02C66 "0023E % LATIN SMALL LETTER T WITH DIAGONAL STROKE +\setXTXcharcodes "02C67 "02C68 "02C67 % LATIN CAPITAL LETTER H WITH DESCENDER +\setXTXcharcodes "02C68 "02C68 "02C67 % LATIN SMALL LETTER H WITH DESCENDER +\setXTXcharcodes "02C69 "02C6A "02C69 % LATIN CAPITAL LETTER K WITH DESCENDER +\setXTXcharcodes "02C6A "02C6A "02C69 % LATIN SMALL LETTER K WITH DESCENDER +\setXTXcharcodes "02C6B "02C6C "02C6B % LATIN CAPITAL LETTER Z WITH DESCENDER +\setXTXcharcodes "02C6C "02C6C "02C6B % LATIN SMALL LETTER Z WITH DESCENDER +\setXTXcharcodes "02C74 "02C74 "02C74 % LATIN SMALL LETTER V WITH CURL +\setXTXcharcodes "02C75 "02C76 "02C75 % LATIN CAPITAL LETTER HALF H +\setXTXcharcodes "02C76 "02C76 "02C75 % LATIN SMALL LETTER HALF H +\setXTXcharcodes "02C77 "02C77 "02C77 % LATIN SMALL LETTER TAILLESS PHI +\setXTXcharcodes "02C80 "02C81 "02C80 % COPTIC CAPITAL LETTER ALFA +\setXTXcharcodes "02C81 "02C81 "02C80 % COPTIC SMALL LETTER ALFA +\setXTXcharcodes "02C82 "02C83 "02C82 % COPTIC CAPITAL LETTER VIDA +\setXTXcharcodes "02C83 "02C83 "02C82 % COPTIC SMALL LETTER VIDA +\setXTXcharcodes "02C84 "02C85 "02C84 % COPTIC CAPITAL LETTER GAMMA +\setXTXcharcodes "02C85 "02C85 "02C84 % COPTIC SMALL LETTER GAMMA +\setXTXcharcodes "02C86 "02C87 "02C86 % COPTIC CAPITAL LETTER DALDA +\setXTXcharcodes "02C87 "02C87 "02C86 % COPTIC SMALL LETTER DALDA +\setXTXcharcodes "02C88 "02C89 "02C88 % COPTIC CAPITAL LETTER EIE +\setXTXcharcodes "02C89 "02C89 "02C88 % COPTIC SMALL LETTER EIE +\setXTXcharcodes "02C8A "02C8B "02C8A % COPTIC CAPITAL LETTER SOU +\setXTXcharcodes "02C8B "02C8B "02C8A % COPTIC SMALL LETTER SOU +\setXTXcharcodes "02C8C "02C8D "02C8C % COPTIC CAPITAL LETTER ZATA +\setXTXcharcodes "02C8D "02C8D "02C8C % COPTIC SMALL LETTER ZATA +\setXTXcharcodes "02C8E "02C8F "02C8E % COPTIC CAPITAL LETTER HATE +\setXTXcharcodes "02C8F "02C8F "02C8E % COPTIC SMALL LETTER HATE +\setXTXcharcodes "02C90 "02C91 "02C90 % COPTIC CAPITAL LETTER THETHE +\setXTXcharcodes "02C91 "02C91 "02C90 % COPTIC SMALL LETTER THETHE +\setXTXcharcodes "02C92 "02C93 "02C92 % COPTIC CAPITAL LETTER IAUDA +\setXTXcharcodes "02C93 "02C93 "02C92 % COPTIC SMALL LETTER IAUDA +\setXTXcharcodes "02C94 "02C95 "02C94 % COPTIC CAPITAL LETTER KAPA +\setXTXcharcodes "02C95 "02C95 "02C94 % COPTIC SMALL LETTER KAPA +\setXTXcharcodes "02C96 "02C97 "02C96 % COPTIC CAPITAL LETTER LAULA +\setXTXcharcodes "02C97 "02C97 "02C96 % COPTIC SMALL LETTER LAULA +\setXTXcharcodes "02C98 "02C99 "02C98 % COPTIC CAPITAL LETTER MI +\setXTXcharcodes "02C99 "02C99 "02C98 % COPTIC SMALL LETTER MI +\setXTXcharcodes "02C9A "02C9B "02C9A % COPTIC CAPITAL LETTER NI +\setXTXcharcodes "02C9B "02C9B "02C9A % COPTIC SMALL LETTER NI +\setXTXcharcodes "02C9C "02C9D "02C9C % COPTIC CAPITAL LETTER KSI +\setXTXcharcodes "02C9D "02C9D "02C9C % COPTIC SMALL LETTER KSI +\setXTXcharcodes "02C9E "02C9F "02C9E % COPTIC CAPITAL LETTER O +\setXTXcharcodes "02C9F "02C9F "02C9E % COPTIC SMALL LETTER O +\setXTXcharcodes "02CA0 "02CA1 "02CA0 % COPTIC CAPITAL LETTER PI +\setXTXcharcodes "02CA1 "02CA1 "02CA0 % COPTIC SMALL LETTER PI +\setXTXcharcodes "02CA2 "02CA3 "02CA2 % COPTIC CAPITAL LETTER RO +\setXTXcharcodes "02CA3 "02CA3 "02CA2 % COPTIC SMALL LETTER RO +\setXTXcharcodes "02CA4 "02CA5 "02CA4 % COPTIC CAPITAL LETTER SIMA +\setXTXcharcodes "02CA5 "02CA5 "02CA4 % COPTIC SMALL LETTER SIMA +\setXTXcharcodes "02CA6 "02CA7 "02CA6 % COPTIC CAPITAL LETTER TAU +\setXTXcharcodes "02CA7 "02CA7 "02CA6 % COPTIC SMALL LETTER TAU +\setXTXcharcodes "02CA8 "02CA9 "02CA8 % COPTIC CAPITAL LETTER UA +\setXTXcharcodes "02CA9 "02CA9 "02CA8 % COPTIC SMALL LETTER UA +\setXTXcharcodes "02CAA "02CAB "02CAA % COPTIC CAPITAL LETTER FI +\setXTXcharcodes "02CAB "02CAB "02CAA % COPTIC SMALL LETTER FI +\setXTXcharcodes "02CAC "02CAD "02CAC % COPTIC CAPITAL LETTER KHI +\setXTXcharcodes "02CAD "02CAD "02CAC % COPTIC SMALL LETTER KHI +\setXTXcharcodes "02CAE "02CAF "02CAE % COPTIC CAPITAL LETTER PSI +\setXTXcharcodes "02CAF "02CAF "02CAE % COPTIC SMALL LETTER PSI +\setXTXcharcodes "02CB0 "02CB1 "02CB0 % COPTIC CAPITAL LETTER OOU +\setXTXcharcodes "02CB1 "02CB1 "02CB0 % COPTIC SMALL LETTER OOU +\setXTXcharcodes "02CB2 "02CB3 "02CB2 % COPTIC CAPITAL LETTER DIALECT-P ALEF +\setXTXcharcodes "02CB3 "02CB3 "02CB2 % COPTIC SMALL LETTER DIALECT-P ALEF +\setXTXcharcodes "02CB4 "02CB5 "02CB4 % COPTIC CAPITAL LETTER OLD COPTIC AIN +\setXTXcharcodes "02CB5 "02CB5 "02CB4 % COPTIC SMALL LETTER OLD COPTIC AIN +\setXTXcharcodes "02CB6 "02CB7 "02CB6 % COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE +\setXTXcharcodes "02CB7 "02CB7 "02CB6 % COPTIC SMALL LETTER CRYPTOGRAMMIC EIE +\setXTXcharcodes "02CB8 "02CB9 "02CB8 % COPTIC CAPITAL LETTER DIALECT-P KAPA +\setXTXcharcodes "02CB9 "02CB9 "02CB8 % COPTIC SMALL LETTER DIALECT-P KAPA +\setXTXcharcodes "02CBA "02CBB "02CBA % COPTIC CAPITAL LETTER DIALECT-P NI +\setXTXcharcodes "02CBB "02CBB "02CBA % COPTIC SMALL LETTER DIALECT-P NI +\setXTXcharcodes "02CBC "02CBD "02CBC % COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI +\setXTXcharcodes "02CBD "02CBD "02CBC % COPTIC SMALL LETTER CRYPTOGRAMMIC NI +\setXTXcharcodes "02CBE "02CBF "02CBE % COPTIC CAPITAL LETTER OLD COPTIC OOU +\setXTXcharcodes "02CBF "02CBF "02CBE % COPTIC SMALL LETTER OLD COPTIC OOU +\setXTXcharcodes "02CC0 "02CC1 "02CC0 % COPTIC CAPITAL LETTER SAMPI +\setXTXcharcodes "02CC1 "02CC1 "02CC0 % COPTIC SMALL LETTER SAMPI +\setXTXcharcodes "02CC2 "02CC3 "02CC2 % COPTIC CAPITAL LETTER CROSSED SHEI +\setXTXcharcodes "02CC3 "02CC3 "02CC2 % COPTIC SMALL LETTER CROSSED SHEI +\setXTXcharcodes "02CC4 "02CC5 "02CC4 % COPTIC CAPITAL LETTER OLD COPTIC SHEI +\setXTXcharcodes "02CC5 "02CC5 "02CC4 % COPTIC SMALL LETTER OLD COPTIC SHEI +\setXTXcharcodes "02CC6 "02CC7 "02CC6 % COPTIC CAPITAL LETTER OLD COPTIC ESH +\setXTXcharcodes "02CC7 "02CC7 "02CC6 % COPTIC SMALL LETTER OLD COPTIC ESH +\setXTXcharcodes "02CC8 "02CC9 "02CC8 % COPTIC CAPITAL LETTER AKHMIMIC KHEI +\setXTXcharcodes "02CC9 "02CC9 "02CC8 % COPTIC SMALL LETTER AKHMIMIC KHEI +\setXTXcharcodes "02CCA "02CCB "02CCA % COPTIC CAPITAL LETTER DIALECT-P HORI +\setXTXcharcodes "02CCB "02CCB "02CCA % COPTIC SMALL LETTER DIALECT-P HORI +\setXTXcharcodes "02CCC "02CCD "02CCC % COPTIC CAPITAL LETTER OLD COPTIC HORI +\setXTXcharcodes "02CCD "02CCD "02CCC % COPTIC SMALL LETTER OLD COPTIC HORI +\setXTXcharcodes "02CCE "02CCF "02CCE % COPTIC CAPITAL LETTER OLD COPTIC HA +\setXTXcharcodes "02CCF "02CCF "02CCE % COPTIC SMALL LETTER OLD COPTIC HA +\setXTXcharcodes "02CD0 "02CD1 "02CD0 % COPTIC CAPITAL LETTER L-SHAPED HA +\setXTXcharcodes "02CD1 "02CD1 "02CD0 % COPTIC SMALL LETTER L-SHAPED HA +\setXTXcharcodes "02CD2 "02CD3 "02CD2 % COPTIC CAPITAL LETTER OLD COPTIC HEI +\setXTXcharcodes "02CD3 "02CD3 "02CD2 % COPTIC SMALL LETTER OLD COPTIC HEI +\setXTXcharcodes "02CD4 "02CD5 "02CD4 % COPTIC CAPITAL LETTER OLD COPTIC HAT +\setXTXcharcodes "02CD5 "02CD5 "02CD4 % COPTIC SMALL LETTER OLD COPTIC HAT +\setXTXcharcodes "02CD6 "02CD7 "02CD6 % COPTIC CAPITAL LETTER OLD COPTIC GANGIA +\setXTXcharcodes "02CD7 "02CD7 "02CD6 % COPTIC SMALL LETTER OLD COPTIC GANGIA +\setXTXcharcodes "02CD8 "02CD9 "02CD8 % COPTIC CAPITAL LETTER OLD COPTIC DJA +\setXTXcharcodes "02CD9 "02CD9 "02CD8 % COPTIC SMALL LETTER OLD COPTIC DJA +\setXTXcharcodes "02CDA "02CDB "02CDA % COPTIC CAPITAL LETTER OLD COPTIC SHIMA +\setXTXcharcodes "02CDB "02CDB "02CDA % COPTIC SMALL LETTER OLD COPTIC SHIMA +\setXTXcharcodes "02CDC "02CDD "02CDC % COPTIC CAPITAL LETTER OLD NUBIAN SHIMA +\setXTXcharcodes "02CDD "02CDD "02CDC % COPTIC SMALL LETTER OLD NUBIAN SHIMA +\setXTXcharcodes "02CDE "02CDF "02CDE % COPTIC CAPITAL LETTER OLD NUBIAN NGI +\setXTXcharcodes "02CDF "02CDF "02CDE % COPTIC SMALL LETTER OLD NUBIAN NGI +\setXTXcharcodes "02CE0 "02CE1 "02CE0 % COPTIC CAPITAL LETTER OLD NUBIAN NYI +\setXTXcharcodes "02CE1 "02CE1 "02CE0 % COPTIC SMALL LETTER OLD NUBIAN NYI +\setXTXcharcodes "02CE2 "02CE3 "02CE2 % COPTIC CAPITAL LETTER OLD NUBIAN WAU +\setXTXcharcodes "02CE3 "02CE3 "02CE2 % COPTIC SMALL LETTER OLD NUBIAN WAU +\setXTXcharcodes "02CE4 "02CE4 "02CE4 % COPTIC SYMBOL KAI +\setXTXcharcodes "02D00 "02D00 "010A0 % GEORGIAN SMALL LETTER AN +\setXTXcharcodes "02D01 "02D01 "010A1 % GEORGIAN SMALL LETTER BAN +\setXTXcharcodes "02D02 "02D02 "010A2 % GEORGIAN SMALL LETTER GAN +\setXTXcharcodes "02D03 "02D03 "010A3 % GEORGIAN SMALL LETTER DON +\setXTXcharcodes "02D04 "02D04 "010A4 % GEORGIAN SMALL LETTER EN +\setXTXcharcodes "02D05 "02D05 "010A5 % GEORGIAN SMALL LETTER VIN +\setXTXcharcodes "02D06 "02D06 "010A6 % GEORGIAN SMALL LETTER ZEN +\setXTXcharcodes "02D07 "02D07 "010A7 % GEORGIAN SMALL LETTER TAN +\setXTXcharcodes "02D08 "02D08 "010A8 % GEORGIAN SMALL LETTER IN +\setXTXcharcodes "02D09 "02D09 "010A9 % GEORGIAN SMALL LETTER KAN +\setXTXcharcodes "02D0A "02D0A "010AA % GEORGIAN SMALL LETTER LAS +\setXTXcharcodes "02D0B "02D0B "010AB % GEORGIAN SMALL LETTER MAN +\setXTXcharcodes "02D0C "02D0C "010AC % GEORGIAN SMALL LETTER NAR +\setXTXcharcodes "02D0D "02D0D "010AD % GEORGIAN SMALL LETTER ON +\setXTXcharcodes "02D0E "02D0E "010AE % GEORGIAN SMALL LETTER PAR +\setXTXcharcodes "02D0F "02D0F "010AF % GEORGIAN SMALL LETTER ZHAR +\setXTXcharcodes "02D10 "02D10 "010B0 % GEORGIAN SMALL LETTER RAE +\setXTXcharcodes "02D11 "02D11 "010B1 % GEORGIAN SMALL LETTER SAN +\setXTXcharcodes "02D12 "02D12 "010B2 % GEORGIAN SMALL LETTER TAR +\setXTXcharcodes "02D13 "02D13 "010B3 % GEORGIAN SMALL LETTER UN +\setXTXcharcodes "02D14 "02D14 "010B4 % GEORGIAN SMALL LETTER PHAR +\setXTXcharcodes "02D15 "02D15 "010B5 % GEORGIAN SMALL LETTER KHAR +\setXTXcharcodes "02D16 "02D16 "010B6 % GEORGIAN SMALL LETTER GHAN +\setXTXcharcodes "02D17 "02D17 "010B7 % GEORGIAN SMALL LETTER QAR +\setXTXcharcodes "02D18 "02D18 "010B8 % GEORGIAN SMALL LETTER SHIN +\setXTXcharcodes "02D19 "02D19 "010B9 % GEORGIAN SMALL LETTER CHIN +\setXTXcharcodes "02D1A "02D1A "010BA % GEORGIAN SMALL LETTER CAN +\setXTXcharcodes "02D1B "02D1B "010BB % GEORGIAN SMALL LETTER JIL +\setXTXcharcodes "02D1C "02D1C "010BC % GEORGIAN SMALL LETTER CIL +\setXTXcharcodes "02D1D "02D1D "010BD % GEORGIAN SMALL LETTER CHAR +\setXTXcharcodes "02D1E "02D1E "010BE % GEORGIAN SMALL LETTER XAN +\setXTXcharcodes "02D1F "02D1F "010BF % GEORGIAN SMALL LETTER JHAN +\setXTXcharcodes "02D20 "02D20 "010C0 % GEORGIAN SMALL LETTER HAE +\setXTXcharcodes "02D21 "02D21 "010C1 % GEORGIAN SMALL LETTER HE +\setXTXcharcodes "02D22 "02D22 "010C2 % GEORGIAN SMALL LETTER HIE +\setXTXcharcodes "02D23 "02D23 "010C3 % GEORGIAN SMALL LETTER WE +\setXTXcharcodes "02D24 "02D24 "010C4 % GEORGIAN SMALL LETTER HAR +\setXTXcharcodes "02D25 "02D25 "010C5 % GEORGIAN SMALL LETTER HOE +\setXTXcharcodes "0FB00 "0FB00 "0FB00 % LATIN SMALL LIGATURE FF +\setXTXcharcodes "0FB01 "0FB01 "0FB01 % LATIN SMALL LIGATURE FI +\setXTXcharcodes "0FB02 "0FB02 "0FB02 % LATIN SMALL LIGATURE FL +\setXTXcharcodes "0FB03 "0FB03 "0FB03 % LATIN SMALL LIGATURE FFI +\setXTXcharcodes "0FB04 "0FB04 "0FB04 % LATIN SMALL LIGATURE FFL +\setXTXcharcodes "0FB05 "0FB05 "0FB05 % LATIN SMALL LIGATURE LONG S T +\setXTXcharcodes "0FB06 "0FB06 "0FB06 % LATIN SMALL LIGATURE ST +\setXTXcharcodes "0FB13 "0FB13 "0FB13 % ARMENIAN SMALL LIGATURE MEN NOW +\setXTXcharcodes "0FB14 "0FB14 "0FB14 % ARMENIAN SMALL LIGATURE MEN ECH +\setXTXcharcodes "0FB15 "0FB15 "0FB15 % ARMENIAN SMALL LIGATURE MEN INI +\setXTXcharcodes "0FB16 "0FB16 "0FB16 % ARMENIAN SMALL LIGATURE VEW NOW +\setXTXcharcodes "0FB17 "0FB17 "0FB17 % ARMENIAN SMALL LIGATURE MEN XEH +\setXTXcharcodes "0FF21 "0FF41 "0FF21 % FULLWIDTH LATIN CAPITAL LETTER A +\setXTXcharcodes "0FF22 "0FF42 "0FF22 % FULLWIDTH LATIN CAPITAL LETTER B +\setXTXcharcodes "0FF23 "0FF43 "0FF23 % FULLWIDTH LATIN CAPITAL LETTER C +\setXTXcharcodes "0FF24 "0FF44 "0FF24 % FULLWIDTH LATIN CAPITAL LETTER D +\setXTXcharcodes "0FF25 "0FF45 "0FF25 % FULLWIDTH LATIN CAPITAL LETTER E +\setXTXcharcodes "0FF26 "0FF46 "0FF26 % FULLWIDTH LATIN CAPITAL LETTER F +\setXTXcharcodes "0FF27 "0FF47 "0FF27 % FULLWIDTH LATIN CAPITAL LETTER G +\setXTXcharcodes "0FF28 "0FF48 "0FF28 % FULLWIDTH LATIN CAPITAL LETTER H +\setXTXcharcodes "0FF29 "0FF49 "0FF29 % FULLWIDTH LATIN CAPITAL LETTER I +\setXTXcharcodes "0FF2A "0FF4A "0FF2A % FULLWIDTH LATIN CAPITAL LETTER J +\setXTXcharcodes "0FF2B "0FF4B "0FF2B % FULLWIDTH LATIN CAPITAL LETTER K +\setXTXcharcodes "0FF2C "0FF4C "0FF2C % FULLWIDTH LATIN CAPITAL LETTER L +\setXTXcharcodes "0FF2D "0FF4D "0FF2D % FULLWIDTH LATIN CAPITAL LETTER M +\setXTXcharcodes "0FF2E "0FF4E "0FF2E % FULLWIDTH LATIN CAPITAL LETTER N +\setXTXcharcodes "0FF2F "0FF4F "0FF2F % FULLWIDTH LATIN CAPITAL LETTER O +\setXTXcharcodes "0FF30 "0FF50 "0FF30 % FULLWIDTH LATIN CAPITAL LETTER P +\setXTXcharcodes "0FF31 "0FF51 "0FF31 % FULLWIDTH LATIN CAPITAL LETTER Q +\setXTXcharcodes "0FF32 "0FF52 "0FF32 % FULLWIDTH LATIN CAPITAL LETTER R +\setXTXcharcodes "0FF33 "0FF53 "0FF33 % FULLWIDTH LATIN CAPITAL LETTER S +\setXTXcharcodes "0FF34 "0FF54 "0FF34 % FULLWIDTH LATIN CAPITAL LETTER T +\setXTXcharcodes "0FF35 "0FF55 "0FF35 % FULLWIDTH LATIN CAPITAL LETTER U +\setXTXcharcodes "0FF36 "0FF56 "0FF36 % FULLWIDTH LATIN CAPITAL LETTER V +\setXTXcharcodes "0FF37 "0FF57 "0FF37 % FULLWIDTH LATIN CAPITAL LETTER W +\setXTXcharcodes "0FF38 "0FF58 "0FF38 % FULLWIDTH LATIN CAPITAL LETTER X +\setXTXcharcodes "0FF39 "0FF59 "0FF39 % FULLWIDTH LATIN CAPITAL LETTER Y +\setXTXcharcodes "0FF3A "0FF5A "0FF3A % FULLWIDTH LATIN CAPITAL LETTER Z +\setXTXcharcodes "0FF41 "0FF41 "0FF21 % FULLWIDTH LATIN SMALL LETTER A +\setXTXcharcodes "0FF42 "0FF42 "0FF22 % FULLWIDTH LATIN SMALL LETTER B +\setXTXcharcodes "0FF43 "0FF43 "0FF23 % FULLWIDTH LATIN SMALL LETTER C +\setXTXcharcodes "0FF44 "0FF44 "0FF24 % FULLWIDTH LATIN SMALL LETTER D +\setXTXcharcodes "0FF45 "0FF45 "0FF25 % FULLWIDTH LATIN SMALL LETTER E +\setXTXcharcodes "0FF46 "0FF46 "0FF26 % FULLWIDTH LATIN SMALL LETTER F +\setXTXcharcodes "0FF47 "0FF47 "0FF27 % FULLWIDTH LATIN SMALL LETTER G +\setXTXcharcodes "0FF48 "0FF48 "0FF28 % FULLWIDTH LATIN SMALL LETTER H +\setXTXcharcodes "0FF49 "0FF49 "0FF29 % FULLWIDTH LATIN SMALL LETTER I +\setXTXcharcodes "0FF4A "0FF4A "0FF2A % FULLWIDTH LATIN SMALL LETTER J +\setXTXcharcodes "0FF4B "0FF4B "0FF2B % FULLWIDTH LATIN SMALL LETTER K +\setXTXcharcodes "0FF4C "0FF4C "0FF2C % FULLWIDTH LATIN SMALL LETTER L +\setXTXcharcodes "0FF4D "0FF4D "0FF2D % FULLWIDTH LATIN SMALL LETTER M +\setXTXcharcodes "0FF4E "0FF4E "0FF2E % FULLWIDTH LATIN SMALL LETTER N +\setXTXcharcodes "0FF4F "0FF4F "0FF2F % FULLWIDTH LATIN SMALL LETTER O +\setXTXcharcodes "0FF50 "0FF50 "0FF30 % FULLWIDTH LATIN SMALL LETTER P +\setXTXcharcodes "0FF51 "0FF51 "0FF31 % FULLWIDTH LATIN SMALL LETTER Q +\setXTXcharcodes "0FF52 "0FF52 "0FF32 % FULLWIDTH LATIN SMALL LETTER R +\setXTXcharcodes "0FF53 "0FF53 "0FF33 % FULLWIDTH LATIN SMALL LETTER S +\setXTXcharcodes "0FF54 "0FF54 "0FF34 % FULLWIDTH LATIN SMALL LETTER T +\setXTXcharcodes "0FF55 "0FF55 "0FF35 % FULLWIDTH LATIN SMALL LETTER U +\setXTXcharcodes "0FF56 "0FF56 "0FF36 % FULLWIDTH LATIN SMALL LETTER V +\setXTXcharcodes "0FF57 "0FF57 "0FF37 % FULLWIDTH LATIN SMALL LETTER W +\setXTXcharcodes "0FF58 "0FF58 "0FF38 % FULLWIDTH LATIN SMALL LETTER X +\setXTXcharcodes "0FF59 "0FF59 "0FF39 % FULLWIDTH LATIN SMALL LETTER Y +\setXTXcharcodes "0FF5A "0FF5A "0FF3A % FULLWIDTH LATIN SMALL LETTER Z + +\dofastrecurse{"03400}{"04DB5}{1}{\dosetXTXcharcodes\recurselevel\recurselevel\recurselevel} +\dofastrecurse{"04E00}{"09FBB}{1}{\dosetXTXcharcodes\recurselevel\recurselevel\recurselevel} +\dofastrecurse{"0AC00}{"0D7A3}{1}{\dosetXTXcharcodes\recurselevel\recurselevel\recurselevel} +\dofastrecurse{"20000}{"2A6D6}{1}{\dosetXTXcharcodes\recurselevel\recurselevel\recurselevel} + +% patch needed for turkish + +\setXTXcharcodes "201C "201C "201C +\setXTXcharcodes "201D "201D "201D + +\endinput diff --git a/tex/context/base/xetx-utf.tex b/tex/context/base/xetx-utf.tex deleted file mode 100644 index 79bd00745..000000000 --- a/tex/context/base/xetx-utf.tex +++ /dev/null @@ -1,1989 +0,0 @@ -% filename : xetx-utf.tex -% comment : generated by mtxrun --script chars --xtx -% author : Hans Hagen, PRAGMA-ADE, Hasselt NL -% copyright: PRAGMA ADE / ConTeXt Development Team -% license : see context related readme files - -% lc/uc/catcode mappings - -\setXTXcharcodes "00041 "00061 "00041 % LATIN CAPITAL LETTER A -\setXTXcharcodes "00042 "00062 "00042 % LATIN CAPITAL LETTER B -\setXTXcharcodes "00043 "00063 "00043 % LATIN CAPITAL LETTER C -\setXTXcharcodes "00044 "00064 "00044 % LATIN CAPITAL LETTER D -\setXTXcharcodes "00045 "00065 "00045 % LATIN CAPITAL LETTER E -\setXTXcharcodes "00046 "00066 "00046 % LATIN CAPITAL LETTER F -\setXTXcharcodes "00047 "00067 "00047 % LATIN CAPITAL LETTER G -\setXTXcharcodes "00048 "00068 "00048 % LATIN CAPITAL LETTER H -\setXTXcharcodes "00049 "00069 "00049 % LATIN CAPITAL LETTER I -\setXTXcharcodes "0004A "0006A "0004A % LATIN CAPITAL LETTER J -\setXTXcharcodes "0004B "0006B "0004B % LATIN CAPITAL LETTER K -\setXTXcharcodes "0004C "0006C "0004C % LATIN CAPITAL LETTER L -\setXTXcharcodes "0004D "0006D "0004D % LATIN CAPITAL LETTER M -\setXTXcharcodes "0004E "0006E "0004E % LATIN CAPITAL LETTER N -\setXTXcharcodes "0004F "0006F "0004F % LATIN CAPITAL LETTER O -\setXTXcharcodes "00050 "00070 "00050 % LATIN CAPITAL LETTER P -\setXTXcharcodes "00051 "00071 "00051 % LATIN CAPITAL LETTER Q -\setXTXcharcodes "00052 "00072 "00052 % LATIN CAPITAL LETTER R -\setXTXcharcodes "00053 "00073 "00053 % LATIN CAPITAL LETTER S -\setXTXcharcodes "00054 "00074 "00054 % LATIN CAPITAL LETTER T -\setXTXcharcodes "00055 "00075 "00055 % LATIN CAPITAL LETTER U -\setXTXcharcodes "00056 "00076 "00056 % LATIN CAPITAL LETTER V -\setXTXcharcodes "00057 "00077 "00057 % LATIN CAPITAL LETTER W -\setXTXcharcodes "00058 "00078 "00058 % LATIN CAPITAL LETTER X -\setXTXcharcodes "00059 "00079 "00059 % LATIN CAPITAL LETTER Y -\setXTXcharcodes "0005A "0007A "0005A % LATIN CAPITAL LETTER Z -\setXTXcharcodes "00061 "00061 "00041 % LATIN SMALL LETTER A -\setXTXcharcodes "00062 "00062 "00042 % LATIN SMALL LETTER B -\setXTXcharcodes "00063 "00063 "00043 % LATIN SMALL LETTER C -\setXTXcharcodes "00064 "00064 "00044 % LATIN SMALL LETTER D -\setXTXcharcodes "00065 "00065 "00045 % LATIN SMALL LETTER E -\setXTXcharcodes "00066 "00066 "00046 % LATIN SMALL LETTER F -\setXTXcharcodes "00067 "00067 "00047 % LATIN SMALL LETTER G -\setXTXcharcodes "00068 "00068 "00048 % LATIN SMALL LETTER H -\setXTXcharcodes "00069 "00069 "00049 % LATIN SMALL LETTER I -\setXTXcharcodes "0006A "0006A "0004A % LATIN SMALL LETTER J -\setXTXcharcodes "0006B "0006B "0004B % LATIN SMALL LETTER K -\setXTXcharcodes "0006C "0006C "0004C % LATIN SMALL LETTER L -\setXTXcharcodes "0006D "0006D "0004D % LATIN SMALL LETTER M -\setXTXcharcodes "0006E "0006E "0004E % LATIN SMALL LETTER N -\setXTXcharcodes "0006F "0006F "0004F % LATIN SMALL LETTER O -\setXTXcharcodes "00070 "00070 "00050 % LATIN SMALL LETTER P -\setXTXcharcodes "00071 "00071 "00051 % LATIN SMALL LETTER Q -\setXTXcharcodes "00072 "00072 "00052 % LATIN SMALL LETTER R -\setXTXcharcodes "00073 "00073 "00053 % LATIN SMALL LETTER S -\setXTXcharcodes "00074 "00074 "00054 % LATIN SMALL LETTER T -\setXTXcharcodes "00075 "00075 "00055 % LATIN SMALL LETTER U -\setXTXcharcodes "00076 "00076 "00056 % LATIN SMALL LETTER V -\setXTXcharcodes "00077 "00077 "00057 % LATIN SMALL LETTER W -\setXTXcharcodes "00078 "00078 "00058 % LATIN SMALL LETTER X -\setXTXcharcodes "00079 "00079 "00059 % LATIN SMALL LETTER Y -\setXTXcharcodes "0007A "0007A "0005A % LATIN SMALL LETTER Z -\setXTXcharcodes "000AA "000AA "000AA % FEMININE ORDINAL INDICATOR -\setXTXcharcodes "000B5 "000B5 "0039C % MICRO SIGN -\setXTXcharcodes "000BA "000BA "000BA % MASCULINE ORDINAL INDICATOR -\setXTXcharcodes "000C0 "000E0 "000C0 % LATIN CAPITAL LETTER A WITH GRAVE -\setXTXcharcodes "000C1 "000E1 "000C1 % LATIN CAPITAL LETTER A WITH ACUTE -\setXTXcharcodes "000C2 "000E2 "000C2 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX -\setXTXcharcodes "000C3 "000E3 "000C3 % LATIN CAPITAL LETTER A WITH TILDE -\setXTXcharcodes "000C4 "000E4 "000C4 % LATIN CAPITAL LETTER A WITH DIAERESIS -\setXTXcharcodes "000C5 "000E5 "000C5 % LATIN CAPITAL LETTER A WITH RING ABOVE -\setXTXcharcodes "000C6 "000E6 "000C6 % LATIN CAPITAL LETTER AE -\setXTXcharcodes "000C7 "000E7 "000C7 % LATIN CAPITAL LETTER C WITH CEDILLA -\setXTXcharcodes "000C8 "000E8 "000C8 % LATIN CAPITAL LETTER E WITH GRAVE -\setXTXcharcodes "000C9 "000E9 "000C9 % LATIN CAPITAL LETTER E WITH ACUTE -\setXTXcharcodes "000CA "000EA "000CA % LATIN CAPITAL LETTER E WITH CIRCUMFLEX -\setXTXcharcodes "000CB "000EB "000CB % LATIN CAPITAL LETTER E WITH DIAERESIS -\setXTXcharcodes "000CC "000EC "000CC % LATIN CAPITAL LETTER I WITH GRAVE -\setXTXcharcodes "000CD "000ED "000CD % LATIN CAPITAL LETTER I WITH ACUTE -\setXTXcharcodes "000CE "000EE "000CE % LATIN CAPITAL LETTER I WITH CIRCUMFLEX -\setXTXcharcodes "000CF "000EF "000CF % LATIN CAPITAL LETTER I WITH DIAERESIS -\setXTXcharcodes "000D0 "000F0 "000D0 % LATIN CAPITAL LETTER ETH -\setXTXcharcodes "000D1 "000F1 "000D1 % LATIN CAPITAL LETTER N WITH TILDE -\setXTXcharcodes "000D2 "000F2 "000D2 % LATIN CAPITAL LETTER O WITH GRAVE -\setXTXcharcodes "000D3 "000F3 "000D3 % LATIN CAPITAL LETTER O WITH ACUTE -\setXTXcharcodes "000D4 "000F4 "000D4 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX -\setXTXcharcodes "000D5 "000F5 "000D5 % LATIN CAPITAL LETTER O WITH TILDE -\setXTXcharcodes "000D6 "000F6 "000D6 % LATIN CAPITAL LETTER O WITH DIAERESIS -\setXTXcharcodes "000D8 "000F8 "000D8 % LATIN CAPITAL LETTER O WITH STROKE -\setXTXcharcodes "000D9 "000F9 "000D9 % LATIN CAPITAL LETTER U WITH GRAVE -\setXTXcharcodes "000DA "000FA "000DA % LATIN CAPITAL LETTER U WITH ACUTE -\setXTXcharcodes "000DB "000FB "000DB % LATIN CAPITAL LETTER U WITH CIRCUMFLEX -\setXTXcharcodes "000DC "000FC "000DC % LATIN CAPITAL LETTER U WITH DIAERESIS -\setXTXcharcodes "000DD "000FD "000DD % LATIN CAPITAL LETTER Y WITH ACUTE -\setXTXcharcodes "000DE "000FE "000DE % LATIN CAPITAL LETTER THORN -\setXTXcharcodes "000DF "000DF "000DF % LATIN SMALL LETTER SHARP S -\setXTXcharcodes "000E0 "000E0 "000C0 % LATIN SMALL LETTER A WITH GRAVE -\setXTXcharcodes "000E1 "000E1 "000C1 % LATIN SMALL LETTER A WITH ACUTE -\setXTXcharcodes "000E2 "000E2 "000C2 % LATIN SMALL LETTER A WITH CIRCUMFLEX -\setXTXcharcodes "000E3 "000E3 "000C3 % LATIN SMALL LETTER A WITH TILDE -\setXTXcharcodes "000E4 "000E4 "000C4 % LATIN SMALL LETTER A WITH DIAERESIS -\setXTXcharcodes "000E5 "000E5 "000C5 % LATIN SMALL LETTER A WITH RING ABOVE -\setXTXcharcodes "000E6 "000E6 "000C6 % LATIN SMALL LETTER AE -\setXTXcharcodes "000E7 "000E7 "000C7 % LATIN SMALL LETTER C WITH CEDILLA -\setXTXcharcodes "000E8 "000E8 "000C8 % LATIN SMALL LETTER E WITH GRAVE -\setXTXcharcodes "000E9 "000E9 "000C9 % LATIN SMALL LETTER E WITH ACUTE -\setXTXcharcodes "000EA "000EA "000CA % LATIN SMALL LETTER E WITH CIRCUMFLEX -\setXTXcharcodes "000EB "000EB "000CB % LATIN SMALL LETTER E WITH DIAERESIS -\setXTXcharcodes "000EC "000EC "000CC % LATIN SMALL LETTER I WITH GRAVE -\setXTXcharcodes "000ED "000ED "000CD % LATIN SMALL LETTER I WITH ACUTE -\setXTXcharcodes "000EE "000EE "000CE % LATIN SMALL LETTER I WITH CIRCUMFLEX -\setXTXcharcodes "000EF "000EF "000CF % LATIN SMALL LETTER I WITH DIAERESIS -\setXTXcharcodes "000F0 "000F0 "000D0 % LATIN SMALL LETTER ETH -\setXTXcharcodes "000F1 "000F1 "000D1 % LATIN SMALL LETTER N WITH TILDE -\setXTXcharcodes "000F2 "000F2 "000D2 % LATIN SMALL LETTER O WITH GRAVE -\setXTXcharcodes "000F3 "000F3 "000D3 % LATIN SMALL LETTER O WITH ACUTE -\setXTXcharcodes "000F4 "000F4 "000D4 % LATIN SMALL LETTER O WITH CIRCUMFLEX -\setXTXcharcodes "000F5 "000F5 "000D5 % LATIN SMALL LETTER O WITH TILDE -\setXTXcharcodes "000F6 "000F6 "000D6 % LATIN SMALL LETTER O WITH DIAERESIS -\setXTXcharcodes "000F8 "000F8 "000D8 % LATIN SMALL LETTER O WITH STROKE -\setXTXcharcodes "000F9 "000F9 "000D9 % LATIN SMALL LETTER U WITH GRAVE -\setXTXcharcodes "000FA "000FA "000DA % LATIN SMALL LETTER U WITH ACUTE -\setXTXcharcodes "000FB "000FB "000DB % LATIN SMALL LETTER U WITH CIRCUMFLEX -\setXTXcharcodes "000FC "000FC "000DC % LATIN SMALL LETTER U WITH DIAERESIS -\setXTXcharcodes "000FD "000FD "000DD % LATIN SMALL LETTER Y WITH ACUTE -\setXTXcharcodes "000FE "000FE "000DE % LATIN SMALL LETTER THORN -\setXTXcharcodes "000FF "000FF "00178 % LATIN SMALL LETTER Y WITH DIAERESIS -\setXTXcharcodes "00100 "00101 "00100 % LATIN CAPITAL LETTER A WITH MACRON -\setXTXcharcodes "00101 "00101 "00100 % LATIN SMALL LETTER A WITH MACRON -\setXTXcharcodes "00102 "00103 "00102 % LATIN CAPITAL LETTER A WITH BREVE -\setXTXcharcodes "00103 "00103 "00102 % LATIN SMALL LETTER A WITH BREVE -\setXTXcharcodes "00104 "00105 "00104 % LATIN CAPITAL LETTER A WITH OGONEK -\setXTXcharcodes "00105 "00105 "00104 % LATIN SMALL LETTER A WITH OGONEK -\setXTXcharcodes "00106 "00107 "00106 % LATIN CAPITAL LETTER C WITH ACUTE -\setXTXcharcodes "00107 "00107 "00106 % LATIN SMALL LETTER C WITH ACUTE -\setXTXcharcodes "00108 "00109 "00108 % LATIN CAPITAL LETTER C WITH CIRCUMFLEX -\setXTXcharcodes "00109 "00109 "00108 % LATIN SMALL LETTER C WITH CIRCUMFLEX -\setXTXcharcodes "0010A "0010B "0010A % LATIN CAPITAL LETTER C WITH DOT ABOVE -\setXTXcharcodes "0010B "0010B "0010A % LATIN SMALL LETTER C WITH DOT ABOVE -\setXTXcharcodes "0010C "0010D "0010C % LATIN CAPITAL LETTER C WITH CARON -\setXTXcharcodes "0010D "0010D "0010C % LATIN SMALL LETTER C WITH CARON -\setXTXcharcodes "0010E "0010F "0010E % LATIN CAPITAL LETTER D WITH CARON -\setXTXcharcodes "0010F "0010F "0010E % LATIN SMALL LETTER D WITH CARON -\setXTXcharcodes "00110 "00111 "00110 % LATIN CAPITAL LETTER D WITH STROKE -\setXTXcharcodes "00111 "00111 "00110 % LATIN SMALL LETTER D WITH STROKE -\setXTXcharcodes "00112 "00113 "00112 % LATIN CAPITAL LETTER E WITH MACRON -\setXTXcharcodes "00113 "00113 "00112 % LATIN SMALL LETTER E WITH MACRON -\setXTXcharcodes "00114 "00115 "00114 % LATIN CAPITAL LETTER E WITH BREVE -\setXTXcharcodes "00115 "00115 "00114 % LATIN SMALL LETTER E WITH BREVE -\setXTXcharcodes "00116 "00117 "00116 % LATIN CAPITAL LETTER E WITH DOT ABOVE -\setXTXcharcodes "00117 "00117 "00116 % LATIN SMALL LETTER E WITH DOT ABOVE -\setXTXcharcodes "00118 "00119 "00118 % LATIN CAPITAL LETTER E WITH OGONEK -\setXTXcharcodes "00119 "00119 "00118 % LATIN SMALL LETTER E WITH OGONEK -\setXTXcharcodes "0011A "0011B "0011A % LATIN CAPITAL LETTER E WITH CARON -\setXTXcharcodes "0011B "0011B "0011A % LATIN SMALL LETTER E WITH CARON -\setXTXcharcodes "0011C "0011D "0011C % LATIN CAPITAL LETTER G WITH CIRCUMFLEX -\setXTXcharcodes "0011D "0011D "0011C % LATIN SMALL LETTER G WITH CIRCUMFLEX -\setXTXcharcodes "0011E "0011F "0011E % LATIN CAPITAL LETTER G WITH BREVE -\setXTXcharcodes "0011F "0011F "0011E % LATIN SMALL LETTER G WITH BREVE -\setXTXcharcodes "00120 "00121 "00120 % LATIN CAPITAL LETTER G WITH DOT ABOVE -\setXTXcharcodes "00121 "00121 "00120 % LATIN SMALL LETTER G WITH DOT ABOVE -\setXTXcharcodes "00122 "00123 "00122 % LATIN CAPITAL LETTER G WITH CEDILLA -\setXTXcharcodes "00123 "00123 "00122 % LATIN SMALL LETTER G WITH CEDILLA -\setXTXcharcodes "00124 "00125 "00124 % LATIN CAPITAL LETTER H WITH CIRCUMFLEX -\setXTXcharcodes "00125 "00125 "00124 % LATIN SMALL LETTER H WITH CIRCUMFLEX -\setXTXcharcodes "00126 "00127 "00126 % LATIN CAPITAL LETTER H WITH STROKE -\setXTXcharcodes "00127 "00127 "00126 % LATIN SMALL LETTER H WITH STROKE -\setXTXcharcodes "00128 "00129 "00128 % LATIN CAPITAL LETTER I WITH TILDE -\setXTXcharcodes "00129 "00129 "00128 % LATIN SMALL LETTER I WITH TILDE -\setXTXcharcodes "0012A "0012B "0012A % LATIN CAPITAL LETTER I WITH MACRON -\setXTXcharcodes "0012B "0012B "0012A % LATIN SMALL LETTER I WITH MACRON -\setXTXcharcodes "0012C "0012D "0012C % LATIN CAPITAL LETTER I WITH BREVE -\setXTXcharcodes "0012D "0012D "0012C % LATIN SMALL LETTER I WITH BREVE -\setXTXcharcodes "0012E "0012F "0012E % LATIN CAPITAL LETTER I WITH OGONEK -\setXTXcharcodes "0012F "0012F "0012E % LATIN SMALL LETTER I WITH OGONEK -\setXTXcharcodes "00130 "00069 "00130 % LATIN CAPITAL LETTER I WITH DOT ABOVE -\setXTXcharcodes "00131 "00131 "00049 % LATIN SMALL LETTER DOTLESS I -\setXTXcharcodes "00132 "00133 "00132 % LATIN CAPITAL LIGATURE IJ -\setXTXcharcodes "00133 "00133 "00132 % LATIN SMALL LIGATURE IJ -\setXTXcharcodes "00134 "00135 "00134 % LATIN CAPITAL LETTER J WITH CIRCUMFLEX -\setXTXcharcodes "00135 "00135 "00134 % LATIN SMALL LETTER J WITH CIRCUMFLEX -\setXTXcharcodes "00136 "00137 "00136 % LATIN CAPITAL LETTER K WITH CEDILLA -\setXTXcharcodes "00137 "00137 "00136 % LATIN SMALL LETTER K WITH CEDILLA -\setXTXcharcodes "00138 "00138 "00138 % LATIN SMALL LETTER KRA -\setXTXcharcodes "00139 "0013A "00139 % LATIN CAPITAL LETTER L WITH ACUTE -\setXTXcharcodes "0013A "0013A "00139 % LATIN SMALL LETTER L WITH ACUTE -\setXTXcharcodes "0013B "0013C "0013B % LATIN CAPITAL LETTER L WITH CEDILLA -\setXTXcharcodes "0013C "0013C "0013B % LATIN SMALL LETTER L WITH CEDILLA -\setXTXcharcodes "0013D "0013E "0013D % LATIN CAPITAL LETTER L WITH CARON -\setXTXcharcodes "0013E "0013E "0013D % LATIN SMALL LETTER L WITH CARON -\setXTXcharcodes "0013F "00140 "0013F % LATIN CAPITAL LETTER L WITH MIDDLE DOT -\setXTXcharcodes "00140 "00140 "0013F % LATIN SMALL LETTER L WITH MIDDLE DOT -\setXTXcharcodes "00141 "00142 "00141 % LATIN CAPITAL LETTER L WITH STROKE -\setXTXcharcodes "00142 "00142 "00141 % LATIN SMALL LETTER L WITH STROKE -\setXTXcharcodes "00143 "00144 "00143 % LATIN CAPITAL LETTER N WITH ACUTE -\setXTXcharcodes "00144 "00144 "00143 % LATIN SMALL LETTER N WITH ACUTE -\setXTXcharcodes "00145 "00146 "00145 % LATIN CAPITAL LETTER N WITH CEDILLA -\setXTXcharcodes "00146 "00146 "00145 % LATIN SMALL LETTER N WITH CEDILLA -\setXTXcharcodes "00147 "00148 "00147 % LATIN CAPITAL LETTER N WITH CARON -\setXTXcharcodes "00148 "00148 "00147 % LATIN SMALL LETTER N WITH CARON -\setXTXcharcodes "00149 "00149 "00149 % LATIN SMALL LETTER N PRECEDED BY APOSTROPHE -\setXTXcharcodes "0014A "0014B "0014A % LATIN CAPITAL LETTER ENG -\setXTXcharcodes "0014B "0014B "0014A % LATIN SMALL LETTER ENG -\setXTXcharcodes "0014C "0014D "0014C % LATIN CAPITAL LETTER O WITH MACRON -\setXTXcharcodes "0014D "0014D "0014C % LATIN SMALL LETTER O WITH MACRON -\setXTXcharcodes "0014E "0014F "0014E % LATIN CAPITAL LETTER O WITH BREVE -\setXTXcharcodes "0014F "0014F "0014E % LATIN SMALL LETTER O WITH BREVE -\setXTXcharcodes "00150 "00151 "00150 % LATIN CAPITAL LETTER O WITH DOUBLE ACUTE -\setXTXcharcodes "00151 "00151 "00150 % LATIN SMALL LETTER O WITH DOUBLE ACUTE -\setXTXcharcodes "00152 "00153 "00152 % LATIN CAPITAL LIGATURE OE -\setXTXcharcodes "00153 "00153 "00152 % LATIN SMALL LIGATURE OE -\setXTXcharcodes "00154 "00155 "00154 % LATIN CAPITAL LETTER R WITH ACUTE -\setXTXcharcodes "00155 "00155 "00154 % LATIN SMALL LETTER R WITH ACUTE -\setXTXcharcodes "00156 "00157 "00156 % LATIN CAPITAL LETTER R WITH CEDILLA -\setXTXcharcodes "00157 "00157 "00156 % LATIN SMALL LETTER R WITH CEDILLA -\setXTXcharcodes "00158 "00159 "00158 % LATIN CAPITAL LETTER R WITH CARON -\setXTXcharcodes "00159 "00159 "00158 % LATIN SMALL LETTER R WITH CARON -\setXTXcharcodes "0015A "0015B "0015A % LATIN CAPITAL LETTER S WITH ACUTE -\setXTXcharcodes "0015B "0015B "0015A % LATIN SMALL LETTER S WITH ACUTE -\setXTXcharcodes "0015C "0015D "0015C % LATIN CAPITAL LETTER S WITH CIRCUMFLEX -\setXTXcharcodes "0015D "0015D "0015C % LATIN SMALL LETTER S WITH CIRCUMFLEX -\setXTXcharcodes "0015E "0015F "0015E % LATIN CAPITAL LETTER S WITH CEDILLA -\setXTXcharcodes "0015F "0015F "0015E % LATIN SMALL LETTER S WITH CEDILLA -\setXTXcharcodes "00160 "00161 "00160 % LATIN CAPITAL LETTER S WITH CARON -\setXTXcharcodes "00161 "00161 "00160 % LATIN SMALL LETTER S WITH CARON -\setXTXcharcodes "00162 "00163 "00162 % LATIN CAPITAL LETTER T WITH CEDILLA -\setXTXcharcodes "00163 "00163 "00162 % LATIN SMALL LETTER T WITH CEDILLA -\setXTXcharcodes "00164 "00165 "00164 % LATIN CAPITAL LETTER T WITH CARON -\setXTXcharcodes "00165 "00165 "00164 % LATIN SMALL LETTER T WITH CARON -\setXTXcharcodes "00166 "00167 "00166 % LATIN CAPITAL LETTER T WITH STROKE -\setXTXcharcodes "00167 "00167 "00166 % LATIN SMALL LETTER T WITH STROKE -\setXTXcharcodes "00168 "00169 "00168 % LATIN CAPITAL LETTER U WITH TILDE -\setXTXcharcodes "00169 "00169 "00168 % LATIN SMALL LETTER U WITH TILDE -\setXTXcharcodes "0016A "0016B "0016A % LATIN CAPITAL LETTER U WITH MACRON -\setXTXcharcodes "0016B "0016B "0016A % LATIN SMALL LETTER U WITH MACRON -\setXTXcharcodes "0016C "0016D "0016C % LATIN CAPITAL LETTER U WITH BREVE -\setXTXcharcodes "0016D "0016D "0016C % LATIN SMALL LETTER U WITH BREVE -\setXTXcharcodes "0016E "0016F "0016E % LATIN CAPITAL LETTER U WITH RING ABOVE -\setXTXcharcodes "0016F "0016F "0016E % LATIN SMALL LETTER U WITH RING ABOVE -\setXTXcharcodes "00170 "00171 "00170 % LATIN CAPITAL LETTER U WITH DOUBLE ACUTE -\setXTXcharcodes "00171 "00171 "00170 % LATIN SMALL LETTER U WITH DOUBLE ACUTE -\setXTXcharcodes "00172 "00173 "00172 % LATIN CAPITAL LETTER U WITH OGONEK -\setXTXcharcodes "00173 "00173 "00172 % LATIN SMALL LETTER U WITH OGONEK -\setXTXcharcodes "00174 "00175 "00174 % LATIN CAPITAL LETTER W WITH CIRCUMFLEX -\setXTXcharcodes "00175 "00175 "00174 % LATIN SMALL LETTER W WITH CIRCUMFLEX -\setXTXcharcodes "00176 "00177 "00176 % LATIN CAPITAL LETTER Y WITH CIRCUMFLEX -\setXTXcharcodes "00177 "00177 "00176 % LATIN SMALL LETTER Y WITH CIRCUMFLEX -\setXTXcharcodes "00178 "000FF "00178 % LATIN CAPITAL LETTER Y WITH DIAERESIS -\setXTXcharcodes "00179 "0017A "00179 % LATIN CAPITAL LETTER Z WITH ACUTE -\setXTXcharcodes "0017A "0017A "00179 % LATIN SMALL LETTER Z WITH ACUTE -\setXTXcharcodes "0017B "0017C "0017B % LATIN CAPITAL LETTER Z WITH DOT ABOVE -\setXTXcharcodes "0017C "0017C "0017B % LATIN SMALL LETTER Z WITH DOT ABOVE -\setXTXcharcodes "0017D "0017E "0017D % LATIN CAPITAL LETTER Z WITH CARON -\setXTXcharcodes "0017E "0017E "0017D % LATIN SMALL LETTER Z WITH CARON -\setXTXcharcodes "0017F "0017F "00053 % LATIN SMALL LETTER LONG S -\setXTXcharcodes "00180 "00180 "00243 % LATIN SMALL LETTER B WITH STROKE -\setXTXcharcodes "00181 "00253 "00181 % LATIN CAPITAL LETTER B WITH HOOK -\setXTXcharcodes "00182 "00183 "00182 % LATIN CAPITAL LETTER B WITH TOPBAR -\setXTXcharcodes "00183 "00183 "00182 % LATIN SMALL LETTER B WITH TOPBAR -\setXTXcharcodes "00184 "00185 "00184 % LATIN CAPITAL LETTER TONE SIX -\setXTXcharcodes "00185 "00185 "00184 % LATIN SMALL LETTER TONE SIX -\setXTXcharcodes "00186 "00254 "00186 % LATIN CAPITAL LETTER OPEN O -\setXTXcharcodes "00187 "00188 "00187 % LATIN CAPITAL LETTER C WITH HOOK -\setXTXcharcodes "00188 "00188 "00187 % LATIN SMALL LETTER C WITH HOOK -\setXTXcharcodes "00189 "00256 "00189 % LATIN CAPITAL LETTER AFRICAN D -\setXTXcharcodes "0018A "00257 "0018A % LATIN CAPITAL LETTER D WITH HOOK -\setXTXcharcodes "0018B "0018C "0018B % LATIN CAPITAL LETTER D WITH TOPBAR -\setXTXcharcodes "0018C "0018C "0018B % LATIN SMALL LETTER D WITH TOPBAR -\setXTXcharcodes "0018D "0018D "0018D % LATIN SMALL LETTER TURNED DELTA -\setXTXcharcodes "0018E "001DD "0018E % LATIN CAPITAL LETTER REVERSED E -\setXTXcharcodes "0018F "00259 "0018F % LATIN CAPITAL LETTER SCHWA -\setXTXcharcodes "00190 "0025B "00190 % LATIN CAPITAL LETTER OPEN E -\setXTXcharcodes "00191 "00192 "00191 % LATIN CAPITAL LETTER F WITH HOOK -\setXTXcharcodes "00192 "00192 "00191 % LATIN SMALL LETTER F WITH HOOK -\setXTXcharcodes "00193 "00260 "00193 % LATIN CAPITAL LETTER G WITH HOOK -\setXTXcharcodes "00194 "00263 "00194 % LATIN CAPITAL LETTER GAMMA -\setXTXcharcodes "00195 "00195 "001F6 % LATIN SMALL LETTER HV -\setXTXcharcodes "00196 "00269 "00196 % LATIN CAPITAL LETTER IOTA -\setXTXcharcodes "00197 "00268 "00197 % LATIN CAPITAL LETTER I WITH STROKE -\setXTXcharcodes "00198 "00199 "00198 % LATIN CAPITAL LETTER K WITH HOOK -\setXTXcharcodes "00199 "00199 "00198 % LATIN SMALL LETTER K WITH HOOK -\setXTXcharcodes "0019A "0019A "0023D % LATIN SMALL LETTER L WITH BAR -\setXTXcharcodes "0019B "0019B "0019B % LATIN SMALL LETTER LAMBDA WITH STROKE -\setXTXcharcodes "0019C "0026F "0019C % LATIN CAPITAL LETTER TURNED M -\setXTXcharcodes "0019D "00272 "0019D % LATIN CAPITAL LETTER N WITH LEFT HOOK -\setXTXcharcodes "0019E "0019E "00220 % LATIN SMALL LETTER N WITH LONG RIGHT LEG -\setXTXcharcodes "0019F "00275 "0019F % LATIN CAPITAL LETTER O WITH MIDDLE TILDE -\setXTXcharcodes "001A0 "001A1 "001A0 % LATIN CAPITAL LETTER O WITH HORN -\setXTXcharcodes "001A1 "001A1 "001A0 % LATIN SMALL LETTER O WITH HORN -\setXTXcharcodes "001A2 "001A3 "001A2 % LATIN CAPITAL LETTER OI -\setXTXcharcodes "001A3 "001A3 "001A2 % LATIN SMALL LETTER OI -\setXTXcharcodes "001A4 "001A5 "001A4 % LATIN CAPITAL LETTER P WITH HOOK -\setXTXcharcodes "001A5 "001A5 "001A4 % LATIN SMALL LETTER P WITH HOOK -\setXTXcharcodes "001A6 "00280 "001A6 % LATIN LETTER YR -\setXTXcharcodes "001A7 "001A8 "001A7 % LATIN CAPITAL LETTER TONE TWO -\setXTXcharcodes "001A8 "001A8 "001A7 % LATIN SMALL LETTER TONE TWO -\setXTXcharcodes "001A9 "00283 "001A9 % LATIN CAPITAL LETTER ESH -\setXTXcharcodes "001AA "001AA "001AA % LATIN LETTER REVERSED ESH LOOP -\setXTXcharcodes "001AB "001AB "001AB % LATIN SMALL LETTER T WITH PALATAL HOOK -\setXTXcharcodes "001AC "001AD "001AC % LATIN CAPITAL LETTER T WITH HOOK -\setXTXcharcodes "001AD "001AD "001AC % LATIN SMALL LETTER T WITH HOOK -\setXTXcharcodes "001AE "00288 "001AE % LATIN CAPITAL LETTER T WITH RETROFLEX HOOK -\setXTXcharcodes "001AF "001B0 "001AF % LATIN CAPITAL LETTER U WITH HORN -\setXTXcharcodes "001B0 "001B0 "001AF % LATIN SMALL LETTER U WITH HORN -\setXTXcharcodes "001B1 "0028A "001B1 % LATIN CAPITAL LETTER UPSILON -\setXTXcharcodes "001B2 "0028B "001B2 % LATIN CAPITAL LETTER V WITH HOOK -\setXTXcharcodes "001B3 "001B4 "001B3 % LATIN CAPITAL LETTER Y WITH HOOK -\setXTXcharcodes "001B4 "001B4 "001B3 % LATIN SMALL LETTER Y WITH HOOK -\setXTXcharcodes "001B5 "001B6 "001B5 % LATIN CAPITAL LETTER Z WITH STROKE -\setXTXcharcodes "001B6 "001B6 "001B5 % LATIN SMALL LETTER Z WITH STROKE -\setXTXcharcodes "001B7 "00292 "001B7 % LATIN CAPITAL LETTER EZH -\setXTXcharcodes "001B8 "001B9 "001B8 % LATIN CAPITAL LETTER EZH REVERSED -\setXTXcharcodes "001B9 "001B9 "001B8 % LATIN SMALL LETTER EZH REVERSED -\setXTXcharcodes "001BA "001BA "001BA % LATIN SMALL LETTER EZH WITH TAIL -\setXTXcharcodes "001BC "001BD "001BC % LATIN CAPITAL LETTER TONE FIVE -\setXTXcharcodes "001BD "001BD "001BC % LATIN SMALL LETTER TONE FIVE -\setXTXcharcodes "001BE "001BE "001BE % LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE -\setXTXcharcodes "001BF "001BF "001F7 % LATIN LETTER WYNN -\setXTXcharcodes "001C4 "001C6 "001C5 % LATIN CAPITAL LETTER DZ WITH CARON -\setXTXcharcodes "001C5 "001C6 "001C4 % LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON -\setXTXcharcodes "001C6 "001C6 "001C4 % LATIN SMALL LETTER DZ WITH CARON -\setXTXcharcodes "001C7 "001C9 "001C8 % LATIN CAPITAL LETTER LJ -\setXTXcharcodes "001C8 "001C9 "001C7 % LATIN CAPITAL LETTER L WITH SMALL LETTER J -\setXTXcharcodes "001C9 "001C9 "001C7 % LATIN SMALL LETTER LJ -\setXTXcharcodes "001CA "001CC "001CB % LATIN CAPITAL LETTER NJ -\setXTXcharcodes "001CB "001CC "001CA % LATIN CAPITAL LETTER N WITH SMALL LETTER J -\setXTXcharcodes "001CC "001CC "001CA % LATIN SMALL LETTER NJ -\setXTXcharcodes "001CD "001CE "001CD % LATIN CAPITAL LETTER A WITH CARON -\setXTXcharcodes "001CE "001CE "001CD % LATIN SMALL LETTER A WITH CARON -\setXTXcharcodes "001CF "001D0 "001CF % LATIN CAPITAL LETTER I WITH CARON -\setXTXcharcodes "001D0 "001D0 "001CF % LATIN SMALL LETTER I WITH CARON -\setXTXcharcodes "001D1 "001D2 "001D1 % LATIN CAPITAL LETTER O WITH CARON -\setXTXcharcodes "001D2 "001D2 "001D1 % LATIN SMALL LETTER O WITH CARON -\setXTXcharcodes "001D3 "001D4 "001D3 % LATIN CAPITAL LETTER U WITH CARON -\setXTXcharcodes "001D4 "001D4 "001D3 % LATIN SMALL LETTER U WITH CARON -\setXTXcharcodes "001D5 "001D6 "001D5 % LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON -\setXTXcharcodes "001D6 "001D6 "001D5 % LATIN SMALL LETTER U WITH DIAERESIS AND MACRON -\setXTXcharcodes "001D7 "001D8 "001D7 % LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE -\setXTXcharcodes "001D8 "001D8 "001D7 % LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE -\setXTXcharcodes "001D9 "001DA "001D9 % LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON -\setXTXcharcodes "001DA "001DA "001D9 % LATIN SMALL LETTER U WITH DIAERESIS AND CARON -\setXTXcharcodes "001DB "001DC "001DB % LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE -\setXTXcharcodes "001DC "001DC "001DB % LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE -\setXTXcharcodes "001DD "001DD "0018E % LATIN SMALL LETTER TURNED E -\setXTXcharcodes "001DE "001DF "001DE % LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON -\setXTXcharcodes "001DF "001DF "001DE % LATIN SMALL LETTER A WITH DIAERESIS AND MACRON -\setXTXcharcodes "001E0 "001E1 "001E0 % LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON -\setXTXcharcodes "001E1 "001E1 "001E0 % LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON -\setXTXcharcodes "001E2 "001E3 "001E2 % LATIN CAPITAL LETTER AE WITH MACRON -\setXTXcharcodes "001E3 "001E3 "001E2 % LATIN SMALL LETTER AE WITH MACRON -\setXTXcharcodes "001E4 "001E5 "001E4 % LATIN CAPITAL LETTER G WITH STROKE -\setXTXcharcodes "001E5 "001E5 "001E4 % LATIN SMALL LETTER G WITH STROKE -\setXTXcharcodes "001E6 "001E7 "001E6 % LATIN CAPITAL LETTER G WITH CARON -\setXTXcharcodes "001E7 "001E7 "001E6 % LATIN SMALL LETTER G WITH CARON -\setXTXcharcodes "001E8 "001E9 "001E8 % LATIN CAPITAL LETTER K WITH CARON -\setXTXcharcodes "001E9 "001E9 "001E8 % LATIN SMALL LETTER K WITH CARON -\setXTXcharcodes "001EA "001EB "001EA % LATIN CAPITAL LETTER O WITH OGONEK -\setXTXcharcodes "001EB "001EB "001EA % LATIN SMALL LETTER O WITH OGONEK -\setXTXcharcodes "001EC "001ED "001EC % LATIN CAPITAL LETTER O WITH OGONEK AND MACRON -\setXTXcharcodes "001ED "001ED "001EC % LATIN SMALL LETTER O WITH OGONEK AND MACRON -\setXTXcharcodes "001EE "001EF "001EE % LATIN CAPITAL LETTER EZH WITH CARON -\setXTXcharcodes "001EF "001EF "001EE % LATIN SMALL LETTER EZH WITH CARON -\setXTXcharcodes "001F0 "001F0 "001F0 % LATIN SMALL LETTER J WITH CARON -\setXTXcharcodes "001F1 "001F3 "001F2 % LATIN CAPITAL LETTER DZ -\setXTXcharcodes "001F2 "001F3 "001F1 % LATIN CAPITAL LETTER D WITH SMALL LETTER Z -\setXTXcharcodes "001F3 "001F3 "001F1 % LATIN SMALL LETTER DZ -\setXTXcharcodes "001F4 "001F5 "001F4 % LATIN CAPITAL LETTER G WITH ACUTE -\setXTXcharcodes "001F5 "001F5 "001F4 % LATIN SMALL LETTER G WITH ACUTE -\setXTXcharcodes "001F6 "00195 "001F6 % LATIN CAPITAL LETTER HWAIR -\setXTXcharcodes "001F7 "001BF "001F7 % LATIN CAPITAL LETTER WYNN -\setXTXcharcodes "001F8 "001F9 "001F8 % LATIN CAPITAL LETTER N WITH GRAVE -\setXTXcharcodes "001F9 "001F9 "001F8 % LATIN SMALL LETTER N WITH GRAVE -\setXTXcharcodes "001FA "001FB "001FA % LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE -\setXTXcharcodes "001FB "001FB "001FA % LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE -\setXTXcharcodes "001FC "001FD "001FC % LATIN CAPITAL LETTER AE WITH ACUTE -\setXTXcharcodes "001FD "001FD "001FC % LATIN SMALL LETTER AE WITH ACUTE -\setXTXcharcodes "001FE "001FF "001FE % LATIN CAPITAL LETTER O WITH STROKE AND ACUTE -\setXTXcharcodes "001FF "001FF "001FE % LATIN SMALL LETTER O WITH STROKE AND ACUTE -\setXTXcharcodes "00200 "00201 "00200 % LATIN CAPITAL LETTER A WITH DOUBLE GRAVE -\setXTXcharcodes "00201 "00201 "00200 % LATIN SMALL LETTER A WITH DOUBLE GRAVE -\setXTXcharcodes "00202 "00203 "00202 % LATIN CAPITAL LETTER A WITH INVERTED BREVE -\setXTXcharcodes "00203 "00203 "00202 % LATIN SMALL LETTER A WITH INVERTED BREVE -\setXTXcharcodes "00204 "00205 "00204 % LATIN CAPITAL LETTER E WITH DOUBLE GRAVE -\setXTXcharcodes "00205 "00205 "00204 % LATIN SMALL LETTER E WITH DOUBLE GRAVE -\setXTXcharcodes "00206 "00207 "00206 % LATIN CAPITAL LETTER E WITH INVERTED BREVE -\setXTXcharcodes "00207 "00207 "00206 % LATIN SMALL LETTER E WITH INVERTED BREVE -\setXTXcharcodes "00208 "00209 "00208 % LATIN CAPITAL LETTER I WITH DOUBLE GRAVE -\setXTXcharcodes "00209 "00209 "00208 % LATIN SMALL LETTER I WITH DOUBLE GRAVE -\setXTXcharcodes "0020A "0020B "0020A % LATIN CAPITAL LETTER I WITH INVERTED BREVE -\setXTXcharcodes "0020B "0020B "0020A % LATIN SMALL LETTER I WITH INVERTED BREVE -\setXTXcharcodes "0020C "0020D "0020C % LATIN CAPITAL LETTER O WITH DOUBLE GRAVE -\setXTXcharcodes "0020D "0020D "0020C % LATIN SMALL LETTER O WITH DOUBLE GRAVE -\setXTXcharcodes "0020E "0020F "0020E % LATIN CAPITAL LETTER O WITH INVERTED BREVE -\setXTXcharcodes "0020F "0020F "0020E % LATIN SMALL LETTER O WITH INVERTED BREVE -\setXTXcharcodes "00210 "00211 "00210 % LATIN CAPITAL LETTER R WITH DOUBLE GRAVE -\setXTXcharcodes "00211 "00211 "00210 % LATIN SMALL LETTER R WITH DOUBLE GRAVE -\setXTXcharcodes "00212 "00213 "00212 % LATIN CAPITAL LETTER R WITH INVERTED BREVE -\setXTXcharcodes "00213 "00213 "00212 % LATIN SMALL LETTER R WITH INVERTED BREVE -\setXTXcharcodes "00214 "00215 "00214 % LATIN CAPITAL LETTER U WITH DOUBLE GRAVE -\setXTXcharcodes "00215 "00215 "00214 % LATIN SMALL LETTER U WITH DOUBLE GRAVE -\setXTXcharcodes "00216 "00217 "00216 % LATIN CAPITAL LETTER U WITH INVERTED BREVE -\setXTXcharcodes "00217 "00217 "00216 % LATIN SMALL LETTER U WITH INVERTED BREVE -\setXTXcharcodes "00218 "00219 "00218 % LATIN CAPITAL LETTER S WITH COMMA BELOW -\setXTXcharcodes "00219 "00219 "00218 % LATIN SMALL LETTER S WITH COMMA BELOW -\setXTXcharcodes "0021A "0021B "0021A % LATIN CAPITAL LETTER T WITH COMMA BELOW -\setXTXcharcodes "0021B "0021B "0021A % LATIN SMALL LETTER T WITH COMMA BELOW -\setXTXcharcodes "0021C "0021D "0021C % LATIN CAPITAL LETTER YOGH -\setXTXcharcodes "0021D "0021D "0021C % LATIN SMALL LETTER YOGH -\setXTXcharcodes "0021E "0021F "0021E % LATIN CAPITAL LETTER H WITH CARON -\setXTXcharcodes "0021F "0021F "0021E % LATIN SMALL LETTER H WITH CARON -\setXTXcharcodes "00220 "0019E "00220 % LATIN CAPITAL LETTER N WITH LONG RIGHT LEG -\setXTXcharcodes "00221 "00221 "00221 % LATIN SMALL LETTER D WITH CURL -\setXTXcharcodes "00222 "00223 "00222 % LATIN CAPITAL LETTER OU -\setXTXcharcodes "00223 "00223 "00222 % LATIN SMALL LETTER OU -\setXTXcharcodes "00224 "00225 "00224 % LATIN CAPITAL LETTER Z WITH HOOK -\setXTXcharcodes "00225 "00225 "00224 % LATIN SMALL LETTER Z WITH HOOK -\setXTXcharcodes "00226 "00227 "00226 % LATIN CAPITAL LETTER A WITH DOT ABOVE -\setXTXcharcodes "00227 "00227 "00226 % LATIN SMALL LETTER A WITH DOT ABOVE -\setXTXcharcodes "00228 "00229 "00228 % LATIN CAPITAL LETTER E WITH CEDILLA -\setXTXcharcodes "00229 "00229 "00228 % LATIN SMALL LETTER E WITH CEDILLA -\setXTXcharcodes "0022A "0022B "0022A % LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON -\setXTXcharcodes "0022B "0022B "0022A % LATIN SMALL LETTER O WITH DIAERESIS AND MACRON -\setXTXcharcodes "0022C "0022D "0022C % LATIN CAPITAL LETTER O WITH TILDE AND MACRON -\setXTXcharcodes "0022D "0022D "0022C % LATIN SMALL LETTER O WITH TILDE AND MACRON -\setXTXcharcodes "0022E "0022F "0022E % LATIN CAPITAL LETTER O WITH DOT ABOVE -\setXTXcharcodes "0022F "0022F "0022E % LATIN SMALL LETTER O WITH DOT ABOVE -\setXTXcharcodes "00230 "00231 "00230 % LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON -\setXTXcharcodes "00231 "00231 "00230 % LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON -\setXTXcharcodes "00232 "00233 "00232 % LATIN CAPITAL LETTER Y WITH MACRON -\setXTXcharcodes "00233 "00233 "00232 % LATIN SMALL LETTER Y WITH MACRON -\setXTXcharcodes "00234 "00234 "00234 % LATIN SMALL LETTER L WITH CURL -\setXTXcharcodes "00235 "00235 "00235 % LATIN SMALL LETTER N WITH CURL -\setXTXcharcodes "00236 "00236 "00236 % LATIN SMALL LETTER T WITH CURL -\setXTXcharcodes "00237 "00237 "00237 % LATIN SMALL LETTER DOTLESS J -\setXTXcharcodes "00238 "00238 "00238 % LATIN SMALL LETTER DB DIGRAPH -\setXTXcharcodes "00239 "00239 "00239 % LATIN SMALL LETTER QP DIGRAPH -\setXTXcharcodes "0023A "02C65 "0023A % LATIN CAPITAL LETTER A WITH STROKE -\setXTXcharcodes "0023B "0023C "0023B % LATIN CAPITAL LETTER C WITH STROKE -\setXTXcharcodes "0023C "0023C "0023B % LATIN SMALL LETTER C WITH STROKE -\setXTXcharcodes "0023D "0019A "0023D % LATIN CAPITAL LETTER L WITH BAR -\setXTXcharcodes "0023E "02C66 "0023E % LATIN CAPITAL LETTER T WITH DIAGONAL STROKE -\setXTXcharcodes "0023F "0023F "0023F % LATIN SMALL LETTER S WITH SWASH TAIL -\setXTXcharcodes "00240 "00240 "00240 % LATIN SMALL LETTER Z WITH SWASH TAIL -\setXTXcharcodes "00241 "00242 "00241 % LATIN CAPITAL LETTER GLOTTAL STOP -\setXTXcharcodes "00242 "00242 "00241 % LATIN SMALL LETTER GLOTTAL STOP -\setXTXcharcodes "00243 "00180 "00243 % LATIN CAPITAL LETTER B WITH STROKE -\setXTXcharcodes "00244 "00289 "00244 % LATIN CAPITAL LETTER U BAR -\setXTXcharcodes "00245 "0028C "00245 % LATIN CAPITAL LETTER TURNED V -\setXTXcharcodes "00246 "00247 "00246 % LATIN CAPITAL LETTER E WITH STROKE -\setXTXcharcodes "00247 "00247 "00246 % LATIN SMALL LETTER E WITH STROKE -\setXTXcharcodes "00248 "00249 "00248 % LATIN CAPITAL LETTER J WITH STROKE -\setXTXcharcodes "00249 "00249 "00248 % LATIN SMALL LETTER J WITH STROKE -\setXTXcharcodes "0024A "0024B "0024A % LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL -\setXTXcharcodes "0024B "0024B "0024A % LATIN SMALL LETTER Q WITH HOOK TAIL -\setXTXcharcodes "0024C "0024D "0024C % LATIN CAPITAL LETTER R WITH STROKE -\setXTXcharcodes "0024D "0024D "0024C % LATIN SMALL LETTER R WITH STROKE -\setXTXcharcodes "0024E "0024F "0024E % LATIN CAPITAL LETTER Y WITH STROKE -\setXTXcharcodes "0024F "0024F "0024E % LATIN SMALL LETTER Y WITH STROKE -\setXTXcharcodes "00250 "00250 "00250 % LATIN SMALL LETTER TURNED A -\setXTXcharcodes "00251 "00251 "00251 % LATIN SMALL LETTER ALPHA -\setXTXcharcodes "00252 "00252 "00252 % LATIN SMALL LETTER TURNED ALPHA -\setXTXcharcodes "00253 "00253 "00181 % LATIN SMALL LETTER B WITH HOOK -\setXTXcharcodes "00254 "00254 "00186 % LATIN SMALL LETTER OPEN O -\setXTXcharcodes "00255 "00255 "00255 % LATIN SMALL LETTER C WITH CURL -\setXTXcharcodes "00256 "00256 "00189 % LATIN SMALL LETTER D WITH TAIL -\setXTXcharcodes "00257 "00257 "0018A % LATIN SMALL LETTER D WITH HOOK -\setXTXcharcodes "00258 "00258 "00258 % LATIN SMALL LETTER REVERSED E -\setXTXcharcodes "00259 "00259 "0018F % LATIN SMALL LETTER SCHWA -\setXTXcharcodes "0025A "0025A "0025A % LATIN SMALL LETTER SCHWA WITH HOOK -\setXTXcharcodes "0025B "0025B "00190 % LATIN SMALL LETTER OPEN E -\setXTXcharcodes "0025C "0025C "0025C % LATIN SMALL LETTER REVERSED OPEN E -\setXTXcharcodes "0025D "0025D "0025D % LATIN SMALL LETTER REVERSED OPEN E WITH HOOK -\setXTXcharcodes "0025E "0025E "0025E % LATIN SMALL LETTER CLOSED REVERSED OPEN E -\setXTXcharcodes "0025F "0025F "0025F % LATIN SMALL LETTER DOTLESS J WITH STROKE -\setXTXcharcodes "00260 "00260 "00193 % LATIN SMALL LETTER G WITH HOOK -\setXTXcharcodes "00261 "00261 "00261 % LATIN SMALL LETTER SCRIPT G -\setXTXcharcodes "00262 "00262 "00262 % LATIN LETTER SMALL CAPITAL G -\setXTXcharcodes "00263 "00263 "00194 % LATIN SMALL LETTER GAMMA -\setXTXcharcodes "00264 "00264 "00264 % LATIN SMALL LETTER RAMS HORN -\setXTXcharcodes "00265 "00265 "00265 % LATIN SMALL LETTER TURNED H -\setXTXcharcodes "00266 "00266 "00266 % LATIN SMALL LETTER H WITH HOOK -\setXTXcharcodes "00267 "00267 "00267 % LATIN SMALL LETTER HENG WITH HOOK -\setXTXcharcodes "00268 "00268 "00197 % LATIN SMALL LETTER I WITH STROKE -\setXTXcharcodes "00269 "00269 "00196 % LATIN SMALL LETTER IOTA -\setXTXcharcodes "0026A "0026A "0026A % LATIN LETTER SMALL CAPITAL I -\setXTXcharcodes "0026B "0026B "02C62 % LATIN SMALL LETTER L WITH MIDDLE TILDE -\setXTXcharcodes "0026C "0026C "0026C % LATIN SMALL LETTER L WITH BELT -\setXTXcharcodes "0026D "0026D "0026D % LATIN SMALL LETTER L WITH RETROFLEX HOOK -\setXTXcharcodes "0026E "0026E "0026E % LATIN SMALL LETTER LEZH -\setXTXcharcodes "0026F "0026F "0019C % LATIN SMALL LETTER TURNED M -\setXTXcharcodes "00270 "00270 "00270 % LATIN SMALL LETTER TURNED M WITH LONG LEG -\setXTXcharcodes "00271 "00271 "00271 % LATIN SMALL LETTER M WITH HOOK -\setXTXcharcodes "00272 "00272 "0019D % LATIN SMALL LETTER N WITH LEFT HOOK -\setXTXcharcodes "00273 "00273 "00273 % LATIN SMALL LETTER N WITH RETROFLEX HOOK -\setXTXcharcodes "00274 "00274 "00274 % LATIN LETTER SMALL CAPITAL N -\setXTXcharcodes "00275 "00275 "0019F % LATIN SMALL LETTER BARRED O -\setXTXcharcodes "00276 "00276 "00276 % LATIN LETTER SMALL CAPITAL OE -\setXTXcharcodes "00277 "00277 "00277 % LATIN SMALL LETTER CLOSED OMEGA -\setXTXcharcodes "00278 "00278 "00278 % LATIN SMALL LETTER PHI -\setXTXcharcodes "00279 "00279 "00279 % LATIN SMALL LETTER TURNED R -\setXTXcharcodes "0027A "0027A "0027A % LATIN SMALL LETTER TURNED R WITH LONG LEG -\setXTXcharcodes "0027B "0027B "0027B % LATIN SMALL LETTER TURNED R WITH HOOK -\setXTXcharcodes "0027C "0027C "0027C % LATIN SMALL LETTER R WITH LONG LEG -\setXTXcharcodes "0027D "0027D "02C64 % LATIN SMALL LETTER R WITH TAIL -\setXTXcharcodes "0027E "0027E "0027E % LATIN SMALL LETTER R WITH FISHHOOK -\setXTXcharcodes "0027F "0027F "0027F % LATIN SMALL LETTER REVERSED R WITH FISHHOOK -\setXTXcharcodes "00280 "00280 "001A6 % LATIN LETTER SMALL CAPITAL R -\setXTXcharcodes "00281 "00281 "00281 % LATIN LETTER SMALL CAPITAL INVERTED R -\setXTXcharcodes "00282 "00282 "00282 % LATIN SMALL LETTER S WITH HOOK -\setXTXcharcodes "00283 "00283 "001A9 % LATIN SMALL LETTER ESH -\setXTXcharcodes "00284 "00284 "00284 % LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK -\setXTXcharcodes "00285 "00285 "00285 % LATIN SMALL LETTER SQUAT REVERSED ESH -\setXTXcharcodes "00286 "00286 "00286 % LATIN SMALL LETTER ESH WITH CURL -\setXTXcharcodes "00287 "00287 "00287 % LATIN SMALL LETTER TURNED T -\setXTXcharcodes "00288 "00288 "001AE % LATIN SMALL LETTER T WITH RETROFLEX HOOK -\setXTXcharcodes "00289 "00289 "00244 % LATIN SMALL LETTER U BAR -\setXTXcharcodes "0028A "0028A "001B1 % LATIN SMALL LETTER UPSILON -\setXTXcharcodes "0028B "0028B "001B2 % LATIN SMALL LETTER V WITH HOOK -\setXTXcharcodes "0028C "0028C "00245 % LATIN SMALL LETTER TURNED V -\setXTXcharcodes "0028D "0028D "0028D % LATIN SMALL LETTER TURNED W -\setXTXcharcodes "0028E "0028E "0028E % LATIN SMALL LETTER TURNED Y -\setXTXcharcodes "0028F "0028F "0028F % LATIN LETTER SMALL CAPITAL Y -\setXTXcharcodes "00290 "00290 "00290 % LATIN SMALL LETTER Z WITH RETROFLEX HOOK -\setXTXcharcodes "00291 "00291 "00291 % LATIN SMALL LETTER Z WITH CURL -\setXTXcharcodes "00292 "00292 "001B7 % LATIN SMALL LETTER EZH -\setXTXcharcodes "00293 "00293 "00293 % LATIN SMALL LETTER EZH WITH CURL -\setXTXcharcodes "00295 "00295 "00295 % LATIN LETTER PHARYNGEAL VOICED FRICATIVE -\setXTXcharcodes "00296 "00296 "00296 % LATIN LETTER INVERTED GLOTTAL STOP -\setXTXcharcodes "00297 "00297 "00297 % LATIN LETTER STRETCHED C -\setXTXcharcodes "00298 "00298 "00298 % LATIN LETTER BILABIAL CLICK -\setXTXcharcodes "00299 "00299 "00299 % LATIN LETTER SMALL CAPITAL B -\setXTXcharcodes "0029A "0029A "0029A % LATIN SMALL LETTER CLOSED OPEN E -\setXTXcharcodes "0029B "0029B "0029B % LATIN LETTER SMALL CAPITAL G WITH HOOK -\setXTXcharcodes "0029C "0029C "0029C % LATIN LETTER SMALL CAPITAL H -\setXTXcharcodes "0029D "0029D "0029D % LATIN SMALL LETTER J WITH CROSSED-TAIL -\setXTXcharcodes "0029E "0029E "0029E % LATIN SMALL LETTER TURNED K -\setXTXcharcodes "0029F "0029F "0029F % LATIN LETTER SMALL CAPITAL L -\setXTXcharcodes "002A0 "002A0 "002A0 % LATIN SMALL LETTER Q WITH HOOK -\setXTXcharcodes "002A1 "002A1 "002A1 % LATIN LETTER GLOTTAL STOP WITH STROKE -\setXTXcharcodes "002A2 "002A2 "002A2 % LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE -\setXTXcharcodes "002A3 "002A3 "002A3 % LATIN SMALL LETTER DZ DIGRAPH -\setXTXcharcodes "002A4 "002A4 "002A4 % LATIN SMALL LETTER DEZH DIGRAPH -\setXTXcharcodes "002A5 "002A5 "002A5 % LATIN SMALL LETTER DZ DIGRAPH WITH CURL -\setXTXcharcodes "002A6 "002A6 "002A6 % LATIN SMALL LETTER TS DIGRAPH -\setXTXcharcodes "002A7 "002A7 "002A7 % LATIN SMALL LETTER TESH DIGRAPH -\setXTXcharcodes "002A8 "002A8 "002A8 % LATIN SMALL LETTER TC DIGRAPH WITH CURL -\setXTXcharcodes "002A9 "002A9 "002A9 % LATIN SMALL LETTER FENG DIGRAPH -\setXTXcharcodes "002AA "002AA "002AA % LATIN SMALL LETTER LS DIGRAPH -\setXTXcharcodes "002AB "002AB "002AB % LATIN SMALL LETTER LZ DIGRAPH -\setXTXcharcodes "002AC "002AC "002AC % LATIN LETTER BILABIAL PERCUSSIVE -\setXTXcharcodes "002AD "002AD "002AD % LATIN LETTER BIDENTAL PERCUSSIVE -\setXTXcharcodes "002AE "002AE "002AE % LATIN SMALL LETTER TURNED H WITH FISHHOOK -\setXTXcharcodes "002AF "002AF "002AF % LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL -\setXTXcharcodes "0037B "0037B "003FD % GREEK SMALL REVERSED LUNATE SIGMA SYMBOL -\setXTXcharcodes "0037C "0037C "003FE % GREEK SMALL DOTTED LUNATE SIGMA SYMBOL -\setXTXcharcodes "0037D "0037D "003FF % GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL -\setXTXcharcodes "00386 "003AC "00386 % GREEK CAPITAL LETTER ALPHA WITH TONOS -\setXTXcharcodes "00388 "003AD "00388 % GREEK CAPITAL LETTER EPSILON WITH TONOS -\setXTXcharcodes "00389 "003AE "00389 % GREEK CAPITAL LETTER ETA WITH TONOS -\setXTXcharcodes "0038A "003AF "0038A % GREEK CAPITAL LETTER IOTA WITH TONOS -\setXTXcharcodes "0038C "003CC "0038C % GREEK CAPITAL LETTER OMICRON WITH TONOS -\setXTXcharcodes "0038E "003CD "0038E % GREEK CAPITAL LETTER UPSILON WITH TONOS -\setXTXcharcodes "0038F "003CE "0038F % GREEK CAPITAL LETTER OMEGA WITH TONOS -\setXTXcharcodes "00390 "00390 "00390 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS -\setXTXcharcodes "00391 "003B1 "00391 % GREEK CAPITAL LETTER ALPHA -\setXTXcharcodes "00392 "003B2 "00392 % GREEK CAPITAL LETTER BETA -\setXTXcharcodes "00393 "003B3 "00393 % GREEK CAPITAL LETTER GAMMA -\setXTXcharcodes "00394 "003B4 "00394 % GREEK CAPITAL LETTER DELTA -\setXTXcharcodes "00395 "003B5 "00395 % GREEK CAPITAL LETTER EPSILON -\setXTXcharcodes "00396 "003B6 "00396 % GREEK CAPITAL LETTER ZETA -\setXTXcharcodes "00397 "003B7 "00397 % GREEK CAPITAL LETTER ETA -\setXTXcharcodes "00398 "003B8 "00398 % GREEK CAPITAL LETTER THETA -\setXTXcharcodes "00399 "003B9 "00399 % GREEK CAPITAL LETTER IOTA -\setXTXcharcodes "0039A "003BA "0039A % GREEK CAPITAL LETTER KAPPA -\setXTXcharcodes "0039B "003BB "0039B % GREEK CAPITAL LETTER LAMDA -\setXTXcharcodes "0039C "003BC "0039C % GREEK CAPITAL LETTER MU -\setXTXcharcodes "0039D "003BD "0039D % GREEK CAPITAL LETTER NU -\setXTXcharcodes "0039E "003BE "0039E % GREEK CAPITAL LETTER XI -\setXTXcharcodes "0039F "003BF "0039F % GREEK CAPITAL LETTER OMICRON -\setXTXcharcodes "003A0 "003C0 "003A0 % GREEK CAPITAL LETTER PI -\setXTXcharcodes "003A1 "003C1 "003A1 % GREEK CAPITAL LETTER RHO -\setXTXcharcodes "003A3 "003C3 "003A3 % GREEK CAPITAL LETTER SIGMA -\setXTXcharcodes "003A4 "003C4 "003A4 % GREEK CAPITAL LETTER TAU -\setXTXcharcodes "003A5 "003C5 "003A5 % GREEK CAPITAL LETTER UPSILON -\setXTXcharcodes "003A6 "003C6 "003A6 % GREEK CAPITAL LETTER PHI -\setXTXcharcodes "003A7 "003C7 "003A7 % GREEK CAPITAL LETTER CHI -\setXTXcharcodes "003A8 "003C8 "003A8 % GREEK CAPITAL LETTER PSI -\setXTXcharcodes "003A9 "003C9 "003A9 % GREEK CAPITAL LETTER OMEGA -\setXTXcharcodes "003AA "003CA "003AA % GREEK CAPITAL LETTER IOTA WITH DIALYTIKA -\setXTXcharcodes "003AB "003CB "003AB % GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA -\setXTXcharcodes "003AC "003AC "00386 % GREEK SMALL LETTER ALPHA WITH TONOS -\setXTXcharcodes "003AD "003AD "00388 % GREEK SMALL LETTER EPSILON WITH TONOS -\setXTXcharcodes "003AE "003AE "00389 % GREEK SMALL LETTER ETA WITH TONOS -\setXTXcharcodes "003AF "003AF "0038A % GREEK SMALL LETTER IOTA WITH TONOS -\setXTXcharcodes "003B0 "003B0 "003B0 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS -\setXTXcharcodes "003B1 "003B1 "00391 % GREEK SMALL LETTER ALPHA -\setXTXcharcodes "003B2 "003B2 "00392 % GREEK SMALL LETTER BETA -\setXTXcharcodes "003B3 "003B3 "00393 % GREEK SMALL LETTER GAMMA -\setXTXcharcodes "003B4 "003B4 "00394 % GREEK SMALL LETTER DELTA -\setXTXcharcodes "003B5 "003B5 "00395 % GREEK SMALL LETTER EPSILON -\setXTXcharcodes "003B6 "003B6 "00396 % GREEK SMALL LETTER ZETA -\setXTXcharcodes "003B7 "003B7 "00397 % GREEK SMALL LETTER ETA -\setXTXcharcodes "003B8 "003B8 "00398 % GREEK SMALL LETTER THETA -\setXTXcharcodes "003B9 "003B9 "00399 % GREEK SMALL LETTER IOTA -\setXTXcharcodes "003BA "003BA "0039A % GREEK SMALL LETTER KAPPA -\setXTXcharcodes "003BB "003BB "0039B % GREEK SMALL LETTER LAMDA -\setXTXcharcodes "003BC "003BC "0039C % GREEK SMALL LETTER MU -\setXTXcharcodes "003BD "003BD "0039D % GREEK SMALL LETTER NU -\setXTXcharcodes "003BE "003BE "0039E % GREEK SMALL LETTER XI -\setXTXcharcodes "003BF "003BF "0039F % GREEK SMALL LETTER OMICRON -\setXTXcharcodes "003C0 "003C0 "003A0 % GREEK SMALL LETTER PI -\setXTXcharcodes "003C1 "003C1 "003A1 % GREEK SMALL LETTER RHO -\setXTXcharcodes "003C2 "003C2 "003A3 % GREEK SMALL LETTER FINAL SIGMA -\setXTXcharcodes "003C3 "003C3 "003A3 % GREEK SMALL LETTER SIGMA -\setXTXcharcodes "003C4 "003C4 "003A4 % GREEK SMALL LETTER TAU -\setXTXcharcodes "003C5 "003C5 "003A5 % GREEK SMALL LETTER UPSILON -\setXTXcharcodes "003C6 "003C6 "003A6 % GREEK SMALL LETTER PHI -\setXTXcharcodes "003C7 "003C7 "003A7 % GREEK SMALL LETTER CHI -\setXTXcharcodes "003C8 "003C8 "003A8 % GREEK SMALL LETTER PSI -\setXTXcharcodes "003C9 "003C9 "003A9 % GREEK SMALL LETTER OMEGA -\setXTXcharcodes "003CA "003CA "003AA % GREEK SMALL LETTER IOTA WITH DIALYTIKA -\setXTXcharcodes "003CB "003CB "003AB % GREEK SMALL LETTER UPSILON WITH DIALYTIKA -\setXTXcharcodes "003CC "003CC "0038C % GREEK SMALL LETTER OMICRON WITH TONOS -\setXTXcharcodes "003CD "003CD "0038E % GREEK SMALL LETTER UPSILON WITH TONOS -\setXTXcharcodes "003CE "003CE "0038F % GREEK SMALL LETTER OMEGA WITH TONOS -\setXTXcharcodes "003D0 "003D0 "00392 % GREEK BETA SYMBOL -\setXTXcharcodes "003D1 "003D1 "00398 % GREEK THETA SYMBOL -\setXTXcharcodes "003D2 "003D2 "003D2 % GREEK UPSILON WITH HOOK SYMBOL -\setXTXcharcodes "003D3 "003D3 "003D3 % GREEK UPSILON WITH ACUTE AND HOOK SYMBOL -\setXTXcharcodes "003D4 "003D4 "003D4 % GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL -\setXTXcharcodes "003D5 "003D5 "003A6 % GREEK PHI SYMBOL -\setXTXcharcodes "003D6 "003D6 "003A0 % GREEK PI SYMBOL -\setXTXcharcodes "003D7 "003D7 "003D7 % GREEK KAI SYMBOL -\setXTXcharcodes "003D8 "003D9 "003D8 % GREEK LETTER ARCHAIC KOPPA -\setXTXcharcodes "003D9 "003D9 "003D8 % GREEK SMALL LETTER ARCHAIC KOPPA -\setXTXcharcodes "003DA "003DB "003DA % GREEK LETTER STIGMA -\setXTXcharcodes "003DB "003DB "003DA % GREEK SMALL LETTER STIGMA -\setXTXcharcodes "003DC "003DD "003DC % GREEK LETTER DIGAMMA -\setXTXcharcodes "003DD "003DD "003DC % GREEK SMALL LETTER DIGAMMA -\setXTXcharcodes "003DE "003DF "003DE % GREEK LETTER KOPPA -\setXTXcharcodes "003DF "003DF "003DE % GREEK SMALL LETTER KOPPA -\setXTXcharcodes "003E0 "003E1 "003E0 % GREEK LETTER SAMPI -\setXTXcharcodes "003E1 "003E1 "003E0 % GREEK SMALL LETTER SAMPI -\setXTXcharcodes "003E2 "003E3 "003E2 % COPTIC CAPITAL LETTER SHEI -\setXTXcharcodes "003E3 "003E3 "003E2 % COPTIC SMALL LETTER SHEI -\setXTXcharcodes "003E4 "003E5 "003E4 % COPTIC CAPITAL LETTER FEI -\setXTXcharcodes "003E5 "003E5 "003E4 % COPTIC SMALL LETTER FEI -\setXTXcharcodes "003E6 "003E7 "003E6 % COPTIC CAPITAL LETTER KHEI -\setXTXcharcodes "003E7 "003E7 "003E6 % COPTIC SMALL LETTER KHEI -\setXTXcharcodes "003E8 "003E9 "003E8 % COPTIC CAPITAL LETTER HORI -\setXTXcharcodes "003E9 "003E9 "003E8 % COPTIC SMALL LETTER HORI -\setXTXcharcodes "003EA "003EB "003EA % COPTIC CAPITAL LETTER GANGIA -\setXTXcharcodes "003EB "003EB "003EA % COPTIC SMALL LETTER GANGIA -\setXTXcharcodes "003EC "003ED "003EC % COPTIC CAPITAL LETTER SHIMA -\setXTXcharcodes "003ED "003ED "003EC % COPTIC SMALL LETTER SHIMA -\setXTXcharcodes "003EE "003EF "003EE % COPTIC CAPITAL LETTER DEI -\setXTXcharcodes "003EF "003EF "003EE % COPTIC SMALL LETTER DEI -\setXTXcharcodes "003F0 "003F0 "0039A % GREEK KAPPA SYMBOL -\setXTXcharcodes "003F1 "003F1 "003A1 % GREEK RHO SYMBOL -\setXTXcharcodes "003F2 "003F2 "003F9 % GREEK LUNATE SIGMA SYMBOL -\setXTXcharcodes "003F3 "003F3 "003F3 % GREEK LETTER YOT -\setXTXcharcodes "003F4 "003B8 "003F4 % GREEK CAPITAL THETA SYMBOL -\setXTXcharcodes "003F5 "003F5 "00395 % GREEK LUNATE EPSILON SYMBOL -\setXTXcharcodes "003F7 "003F8 "003F7 % GREEK CAPITAL LETTER SHO -\setXTXcharcodes "003F8 "003F8 "003F7 % GREEK SMALL LETTER SHO -\setXTXcharcodes "003F9 "003F2 "003F9 % GREEK CAPITAL LUNATE SIGMA SYMBOL -\setXTXcharcodes "003FA "003FB "003FA % GREEK CAPITAL LETTER SAN -\setXTXcharcodes "003FB "003FB "003FA % GREEK SMALL LETTER SAN -\setXTXcharcodes "003FC "003FC "003FC % GREEK RHO WITH STROKE SYMBOL -\setXTXcharcodes "003FD "0037B "003FD % GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL -\setXTXcharcodes "003FE "0037C "003FE % GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL -\setXTXcharcodes "003FF "0037D "003FF % GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL -\setXTXcharcodes "00400 "00450 "00400 % CYRILLIC CAPITAL LETTER IE WITH GRAVE -\setXTXcharcodes "00401 "00451 "00401 % CYRILLIC CAPITAL LETTER IO -\setXTXcharcodes "00402 "00452 "00402 % CYRILLIC CAPITAL LETTER DJE -\setXTXcharcodes "00403 "00453 "00403 % CYRILLIC CAPITAL LETTER GJE -\setXTXcharcodes "00404 "00454 "00404 % CYRILLIC CAPITAL LETTER UKRAINIAN IE -\setXTXcharcodes "00405 "00455 "00405 % CYRILLIC CAPITAL LETTER DZE -\setXTXcharcodes "00406 "00456 "00406 % CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I -\setXTXcharcodes "00407 "00457 "00407 % CYRILLIC CAPITAL LETTER YI -\setXTXcharcodes "00408 "00458 "00408 % CYRILLIC CAPITAL LETTER JE -\setXTXcharcodes "00409 "00459 "00409 % CYRILLIC CAPITAL LETTER LJE -\setXTXcharcodes "0040A "0045A "0040A % CYRILLIC CAPITAL LETTER NJE -\setXTXcharcodes "0040B "0045B "0040B % CYRILLIC CAPITAL LETTER TSHE -\setXTXcharcodes "0040C "0045C "0040C % CYRILLIC CAPITAL LETTER KJE -\setXTXcharcodes "0040D "0045D "0040D % CYRILLIC CAPITAL LETTER I WITH GRAVE -\setXTXcharcodes "0040E "0045E "0040E % CYRILLIC CAPITAL LETTER SHORT U -\setXTXcharcodes "0040F "0045F "0040F % CYRILLIC CAPITAL LETTER DZHE -\setXTXcharcodes "00410 "00430 "00410 % CYRILLIC CAPITAL LETTER A -\setXTXcharcodes "00411 "00431 "00411 % CYRILLIC CAPITAL LETTER BE -\setXTXcharcodes "00412 "00432 "00412 % CYRILLIC CAPITAL LETTER VE -\setXTXcharcodes "00413 "00433 "00413 % CYRILLIC CAPITAL LETTER GHE -\setXTXcharcodes "00414 "00434 "00414 % CYRILLIC CAPITAL LETTER DE -\setXTXcharcodes "00415 "00435 "00415 % CYRILLIC CAPITAL LETTER IE -\setXTXcharcodes "00416 "00436 "00416 % CYRILLIC CAPITAL LETTER ZHE -\setXTXcharcodes "00417 "00437 "00417 % CYRILLIC CAPITAL LETTER ZE -\setXTXcharcodes "00418 "00438 "00418 % CYRILLIC CAPITAL LETTER I -\setXTXcharcodes "00419 "00439 "00419 % CYRILLIC CAPITAL LETTER SHORT I -\setXTXcharcodes "0041A "0043A "0041A % CYRILLIC CAPITAL LETTER KA -\setXTXcharcodes "0041B "0043B "0041B % CYRILLIC CAPITAL LETTER EL -\setXTXcharcodes "0041C "0043C "0041C % CYRILLIC CAPITAL LETTER EM -\setXTXcharcodes "0041D "0043D "0041D % CYRILLIC CAPITAL LETTER EN -\setXTXcharcodes "0041E "0043E "0041E % CYRILLIC CAPITAL LETTER O -\setXTXcharcodes "0041F "0043F "0041F % CYRILLIC CAPITAL LETTER PE -\setXTXcharcodes "00420 "00440 "00420 % CYRILLIC CAPITAL LETTER ER -\setXTXcharcodes "00421 "00441 "00421 % CYRILLIC CAPITAL LETTER ES -\setXTXcharcodes "00422 "00442 "00422 % CYRILLIC CAPITAL LETTER TE -\setXTXcharcodes "00423 "00443 "00423 % CYRILLIC CAPITAL LETTER U -\setXTXcharcodes "00424 "00444 "00424 % CYRILLIC CAPITAL LETTER EF -\setXTXcharcodes "00425 "00445 "00425 % CYRILLIC CAPITAL LETTER HA -\setXTXcharcodes "00426 "00446 "00426 % CYRILLIC CAPITAL LETTER TSE -\setXTXcharcodes "00427 "00447 "00427 % CYRILLIC CAPITAL LETTER CHE -\setXTXcharcodes "00428 "00448 "00428 % CYRILLIC CAPITAL LETTER SHA -\setXTXcharcodes "00429 "00449 "00429 % CYRILLIC CAPITAL LETTER SHCHA -\setXTXcharcodes "0042A "0044A "0042A % CYRILLIC CAPITAL LETTER HARD SIGN -\setXTXcharcodes "0042B "0044B "0042B % CYRILLIC CAPITAL LETTER YERU -\setXTXcharcodes "0042C "0044C "0042C % CYRILLIC CAPITAL LETTER SOFT SIGN -\setXTXcharcodes "0042D "0044D "0042D % CYRILLIC CAPITAL LETTER E -\setXTXcharcodes "0042E "0044E "0042E % CYRILLIC CAPITAL LETTER YU -\setXTXcharcodes "0042F "0044F "0042F % CYRILLIC CAPITAL LETTER YA -\setXTXcharcodes "00430 "00430 "00410 % CYRILLIC SMALL LETTER A -\setXTXcharcodes "00431 "00431 "00411 % CYRILLIC SMALL LETTER BE -\setXTXcharcodes "00432 "00432 "00412 % CYRILLIC SMALL LETTER VE -\setXTXcharcodes "00433 "00433 "00413 % CYRILLIC SMALL LETTER GHE -\setXTXcharcodes "00434 "00434 "00414 % CYRILLIC SMALL LETTER DE -\setXTXcharcodes "00435 "00435 "00415 % CYRILLIC SMALL LETTER IE -\setXTXcharcodes "00436 "00436 "00416 % CYRILLIC SMALL LETTER ZHE -\setXTXcharcodes "00437 "00437 "00417 % CYRILLIC SMALL LETTER ZE -\setXTXcharcodes "00438 "00438 "00418 % CYRILLIC SMALL LETTER I -\setXTXcharcodes "00439 "00439 "00419 % CYRILLIC SMALL LETTER SHORT I -\setXTXcharcodes "0043A "0043A "0041A % CYRILLIC SMALL LETTER KA -\setXTXcharcodes "0043B "0043B "0041B % CYRILLIC SMALL LETTER EL -\setXTXcharcodes "0043C "0043C "0041C % CYRILLIC SMALL LETTER EM -\setXTXcharcodes "0043D "0043D "0041D % CYRILLIC SMALL LETTER EN -\setXTXcharcodes "0043E "0043E "0041E % CYRILLIC SMALL LETTER O -\setXTXcharcodes "0043F "0043F "0041F % CYRILLIC SMALL LETTER PE -\setXTXcharcodes "00440 "00440 "00420 % CYRILLIC SMALL LETTER ER -\setXTXcharcodes "00441 "00441 "00421 % CYRILLIC SMALL LETTER ES -\setXTXcharcodes "00442 "00442 "00422 % CYRILLIC SMALL LETTER TE -\setXTXcharcodes "00443 "00443 "00423 % CYRILLIC SMALL LETTER U -\setXTXcharcodes "00444 "00444 "00424 % CYRILLIC SMALL LETTER EF -\setXTXcharcodes "00445 "00445 "00425 % CYRILLIC SMALL LETTER HA -\setXTXcharcodes "00446 "00446 "00426 % CYRILLIC SMALL LETTER TSE -\setXTXcharcodes "00447 "00447 "00427 % CYRILLIC SMALL LETTER CHE -\setXTXcharcodes "00448 "00448 "00428 % CYRILLIC SMALL LETTER SHA -\setXTXcharcodes "00449 "00449 "00429 % CYRILLIC SMALL LETTER SHCHA -\setXTXcharcodes "0044A "0044A "0042A % CYRILLIC SMALL LETTER HARD SIGN -\setXTXcharcodes "0044B "0044B "0042B % CYRILLIC SMALL LETTER YERU -\setXTXcharcodes "0044C "0044C "0042C % CYRILLIC SMALL LETTER SOFT SIGN -\setXTXcharcodes "0044D "0044D "0042D % CYRILLIC SMALL LETTER E -\setXTXcharcodes "0044E "0044E "0042E % CYRILLIC SMALL LETTER YU -\setXTXcharcodes "0044F "0044F "0042F % CYRILLIC SMALL LETTER YA -\setXTXcharcodes "00450 "00450 "00400 % CYRILLIC SMALL LETTER IE WITH GRAVE -\setXTXcharcodes "00451 "00451 "00401 % CYRILLIC SMALL LETTER IO -\setXTXcharcodes "00452 "00452 "00402 % CYRILLIC SMALL LETTER DJE -\setXTXcharcodes "00453 "00453 "00403 % CYRILLIC SMALL LETTER GJE -\setXTXcharcodes "00454 "00454 "00404 % CYRILLIC SMALL LETTER UKRAINIAN IE -\setXTXcharcodes "00455 "00455 "00405 % CYRILLIC SMALL LETTER DZE -\setXTXcharcodes "00456 "00456 "00406 % CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I -\setXTXcharcodes "00457 "00457 "00407 % CYRILLIC SMALL LETTER YI -\setXTXcharcodes "00458 "00458 "00408 % CYRILLIC SMALL LETTER JE -\setXTXcharcodes "00459 "00459 "00409 % CYRILLIC SMALL LETTER LJE -\setXTXcharcodes "0045A "0045A "0040A % CYRILLIC SMALL LETTER NJE -\setXTXcharcodes "0045B "0045B "0040B % CYRILLIC SMALL LETTER TSHE -\setXTXcharcodes "0045C "0045C "0040C % CYRILLIC SMALL LETTER KJE -\setXTXcharcodes "0045D "0045D "0040D % CYRILLIC SMALL LETTER I WITH GRAVE -\setXTXcharcodes "0045E "0045E "0040E % CYRILLIC SMALL LETTER SHORT U -\setXTXcharcodes "0045F "0045F "0040F % CYRILLIC SMALL LETTER DZHE -\setXTXcharcodes "00460 "00461 "00460 % CYRILLIC CAPITAL LETTER OMEGA -\setXTXcharcodes "00461 "00461 "00460 % CYRILLIC SMALL LETTER OMEGA -\setXTXcharcodes "00462 "00463 "00462 % CYRILLIC CAPITAL LETTER YAT -\setXTXcharcodes "00463 "00463 "00462 % CYRILLIC SMALL LETTER YAT -\setXTXcharcodes "00464 "00465 "00464 % CYRILLIC CAPITAL LETTER IOTIFIED E -\setXTXcharcodes "00465 "00465 "00464 % CYRILLIC SMALL LETTER IOTIFIED E -\setXTXcharcodes "00466 "00467 "00466 % CYRILLIC CAPITAL LETTER LITTLE YUS -\setXTXcharcodes "00467 "00467 "00466 % CYRILLIC SMALL LETTER LITTLE YUS -\setXTXcharcodes "00468 "00469 "00468 % CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS -\setXTXcharcodes "00469 "00469 "00468 % CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS -\setXTXcharcodes "0046A "0046B "0046A % CYRILLIC CAPITAL LETTER BIG YUS -\setXTXcharcodes "0046B "0046B "0046A % CYRILLIC SMALL LETTER BIG YUS -\setXTXcharcodes "0046C "0046D "0046C % CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS -\setXTXcharcodes "0046D "0046D "0046C % CYRILLIC SMALL LETTER IOTIFIED BIG YUS -\setXTXcharcodes "0046E "0046F "0046E % CYRILLIC CAPITAL LETTER KSI -\setXTXcharcodes "0046F "0046F "0046E % CYRILLIC SMALL LETTER KSI -\setXTXcharcodes "00470 "00471 "00470 % CYRILLIC CAPITAL LETTER PSI -\setXTXcharcodes "00471 "00471 "00470 % CYRILLIC SMALL LETTER PSI -\setXTXcharcodes "00472 "00473 "00472 % CYRILLIC CAPITAL LETTER FITA -\setXTXcharcodes "00473 "00473 "00472 % CYRILLIC SMALL LETTER FITA -\setXTXcharcodes "00474 "00475 "00474 % CYRILLIC CAPITAL LETTER IZHITSA -\setXTXcharcodes "00475 "00475 "00474 % CYRILLIC SMALL LETTER IZHITSA -\setXTXcharcodes "00476 "00477 "00476 % CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT -\setXTXcharcodes "00477 "00477 "00476 % CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT -\setXTXcharcodes "00478 "00479 "00478 % CYRILLIC CAPITAL LETTER UK -\setXTXcharcodes "00479 "00479 "00478 % CYRILLIC SMALL LETTER UK -\setXTXcharcodes "0047A "0047B "0047A % CYRILLIC CAPITAL LETTER ROUND OMEGA -\setXTXcharcodes "0047B "0047B "0047A % CYRILLIC SMALL LETTER ROUND OMEGA -\setXTXcharcodes "0047C "0047D "0047C % CYRILLIC CAPITAL LETTER OMEGA WITH TITLO -\setXTXcharcodes "0047D "0047D "0047C % CYRILLIC SMALL LETTER OMEGA WITH TITLO -\setXTXcharcodes "0047E "0047F "0047E % CYRILLIC CAPITAL LETTER OT -\setXTXcharcodes "0047F "0047F "0047E % CYRILLIC SMALL LETTER OT -\setXTXcharcodes "00480 "00481 "00480 % CYRILLIC CAPITAL LETTER KOPPA -\setXTXcharcodes "00481 "00481 "00480 % CYRILLIC SMALL LETTER KOPPA -\setXTXcharcodes "0048A "0048B "0048A % CYRILLIC CAPITAL LETTER SHORT I WITH TAIL -\setXTXcharcodes "0048B "0048B "0048A % CYRILLIC SMALL LETTER SHORT I WITH TAIL -\setXTXcharcodes "0048C "0048D "0048C % CYRILLIC CAPITAL LETTER SEMISOFT SIGN -\setXTXcharcodes "0048D "0048D "0048C % CYRILLIC SMALL LETTER SEMISOFT SIGN -\setXTXcharcodes "0048E "0048F "0048E % CYRILLIC CAPITAL LETTER ER WITH TICK -\setXTXcharcodes "0048F "0048F "0048E % CYRILLIC SMALL LETTER ER WITH TICK -\setXTXcharcodes "00490 "00491 "00490 % CYRILLIC CAPITAL LETTER GHE WITH UPTURN -\setXTXcharcodes "00491 "00491 "00490 % CYRILLIC SMALL LETTER GHE WITH UPTURN -\setXTXcharcodes "00492 "00493 "00492 % CYRILLIC CAPITAL LETTER GHE WITH STROKE -\setXTXcharcodes "00493 "00493 "00492 % CYRILLIC SMALL LETTER GHE WITH STROKE -\setXTXcharcodes "00494 "00495 "00494 % CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK -\setXTXcharcodes "00495 "00495 "00494 % CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK -\setXTXcharcodes "00496 "00497 "00496 % CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER -\setXTXcharcodes "00497 "00497 "00496 % CYRILLIC SMALL LETTER ZHE WITH DESCENDER -\setXTXcharcodes "00498 "00499 "00498 % CYRILLIC CAPITAL LETTER ZE WITH DESCENDER -\setXTXcharcodes "00499 "00499 "00498 % CYRILLIC SMALL LETTER ZE WITH DESCENDER -\setXTXcharcodes "0049A "0049B "0049A % CYRILLIC CAPITAL LETTER KA WITH DESCENDER -\setXTXcharcodes "0049B "0049B "0049A % CYRILLIC SMALL LETTER KA WITH DESCENDER -\setXTXcharcodes "0049C "0049D "0049C % CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE -\setXTXcharcodes "0049D "0049D "0049C % CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE -\setXTXcharcodes "0049E "0049F "0049E % CYRILLIC CAPITAL LETTER KA WITH STROKE -\setXTXcharcodes "0049F "0049F "0049E % CYRILLIC SMALL LETTER KA WITH STROKE -\setXTXcharcodes "004A0 "004A1 "004A0 % CYRILLIC CAPITAL LETTER BASHKIR KA -\setXTXcharcodes "004A1 "004A1 "004A0 % CYRILLIC SMALL LETTER BASHKIR KA -\setXTXcharcodes "004A2 "004A3 "004A2 % CYRILLIC CAPITAL LETTER EN WITH DESCENDER -\setXTXcharcodes "004A3 "004A3 "004A2 % CYRILLIC SMALL LETTER EN WITH DESCENDER -\setXTXcharcodes "004A4 "004A5 "004A4 % CYRILLIC CAPITAL LIGATURE EN GHE -\setXTXcharcodes "004A5 "004A5 "004A4 % CYRILLIC SMALL LIGATURE EN GHE -\setXTXcharcodes "004A6 "004A7 "004A6 % CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK -\setXTXcharcodes "004A7 "004A7 "004A6 % CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK -\setXTXcharcodes "004A8 "004A9 "004A8 % CYRILLIC CAPITAL LETTER ABKHASIAN HA -\setXTXcharcodes "004A9 "004A9 "004A8 % CYRILLIC SMALL LETTER ABKHASIAN HA -\setXTXcharcodes "004AA "004AB "004AA % CYRILLIC CAPITAL LETTER ES WITH DESCENDER -\setXTXcharcodes "004AB "004AB "004AA % CYRILLIC SMALL LETTER ES WITH DESCENDER -\setXTXcharcodes "004AC "004AD "004AC % CYRILLIC CAPITAL LETTER TE WITH DESCENDER -\setXTXcharcodes "004AD "004AD "004AC % CYRILLIC SMALL LETTER TE WITH DESCENDER -\setXTXcharcodes "004AE "004AF "004AE % CYRILLIC CAPITAL LETTER STRAIGHT U -\setXTXcharcodes "004AF "004AF "004AE % CYRILLIC SMALL LETTER STRAIGHT U -\setXTXcharcodes "004B0 "004B1 "004B0 % CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE -\setXTXcharcodes "004B1 "004B1 "004B0 % CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE -\setXTXcharcodes "004B2 "004B3 "004B2 % CYRILLIC CAPITAL LETTER HA WITH DESCENDER -\setXTXcharcodes "004B3 "004B3 "004B2 % CYRILLIC SMALL LETTER HA WITH DESCENDER -\setXTXcharcodes "004B4 "004B5 "004B4 % CYRILLIC CAPITAL LIGATURE TE TSE -\setXTXcharcodes "004B5 "004B5 "004B4 % CYRILLIC SMALL LIGATURE TE TSE -\setXTXcharcodes "004B6 "004B7 "004B6 % CYRILLIC CAPITAL LETTER CHE WITH DESCENDER -\setXTXcharcodes "004B7 "004B7 "004B6 % CYRILLIC SMALL LETTER CHE WITH DESCENDER -\setXTXcharcodes "004B8 "004B9 "004B8 % CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE -\setXTXcharcodes "004B9 "004B9 "004B8 % CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE -\setXTXcharcodes "004BA "004BB "004BA % CYRILLIC CAPITAL LETTER SHHA -\setXTXcharcodes "004BB "004BB "004BA % CYRILLIC SMALL LETTER SHHA -\setXTXcharcodes "004BC "004BD "004BC % CYRILLIC CAPITAL LETTER ABKHASIAN CHE -\setXTXcharcodes "004BD "004BD "004BC % CYRILLIC SMALL LETTER ABKHASIAN CHE -\setXTXcharcodes "004BE "004BF "004BE % CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER -\setXTXcharcodes "004BF "004BF "004BE % CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER -\setXTXcharcodes "004C0 "004CF "004C0 % CYRILLIC LETTER PALOCHKA -\setXTXcharcodes "004C1 "004C2 "004C1 % CYRILLIC CAPITAL LETTER ZHE WITH BREVE -\setXTXcharcodes "004C2 "004C2 "004C1 % CYRILLIC SMALL LETTER ZHE WITH BREVE -\setXTXcharcodes "004C3 "004C4 "004C3 % CYRILLIC CAPITAL LETTER KA WITH HOOK -\setXTXcharcodes "004C4 "004C4 "004C3 % CYRILLIC SMALL LETTER KA WITH HOOK -\setXTXcharcodes "004C5 "004C6 "004C5 % CYRILLIC CAPITAL LETTER EL WITH TAIL -\setXTXcharcodes "004C6 "004C6 "004C5 % CYRILLIC SMALL LETTER EL WITH TAIL -\setXTXcharcodes "004C7 "004C8 "004C7 % CYRILLIC CAPITAL LETTER EN WITH HOOK -\setXTXcharcodes "004C8 "004C8 "004C7 % CYRILLIC SMALL LETTER EN WITH HOOK -\setXTXcharcodes "004C9 "004CA "004C9 % CYRILLIC CAPITAL LETTER EN WITH TAIL -\setXTXcharcodes "004CA "004CA "004C9 % CYRILLIC SMALL LETTER EN WITH TAIL -\setXTXcharcodes "004CB "004CC "004CB % CYRILLIC CAPITAL LETTER KHAKASSIAN CHE -\setXTXcharcodes "004CC "004CC "004CB % CYRILLIC SMALL LETTER KHAKASSIAN CHE -\setXTXcharcodes "004CD "004CE "004CD % CYRILLIC CAPITAL LETTER EM WITH TAIL -\setXTXcharcodes "004CE "004CE "004CD % CYRILLIC SMALL LETTER EM WITH TAIL -\setXTXcharcodes "004CF "004CF "004C0 % CYRILLIC SMALL LETTER PALOCHKA -\setXTXcharcodes "004D0 "004D1 "004D0 % CYRILLIC CAPITAL LETTER A WITH BREVE -\setXTXcharcodes "004D1 "004D1 "004D0 % CYRILLIC SMALL LETTER A WITH BREVE -\setXTXcharcodes "004D2 "004D3 "004D2 % CYRILLIC CAPITAL LETTER A WITH DIAERESIS -\setXTXcharcodes "004D3 "004D3 "004D2 % CYRILLIC SMALL LETTER A WITH DIAERESIS -\setXTXcharcodes "004D4 "004D5 "004D4 % CYRILLIC CAPITAL LIGATURE A IE -\setXTXcharcodes "004D5 "004D5 "004D4 % CYRILLIC SMALL LIGATURE A IE -\setXTXcharcodes "004D6 "004D7 "004D6 % CYRILLIC CAPITAL LETTER IE WITH BREVE -\setXTXcharcodes "004D7 "004D7 "004D6 % CYRILLIC SMALL LETTER IE WITH BREVE -\setXTXcharcodes "004D8 "004D9 "004D8 % CYRILLIC CAPITAL LETTER SCHWA -\setXTXcharcodes "004D9 "004D9 "004D8 % CYRILLIC SMALL LETTER SCHWA -\setXTXcharcodes "004DA "004DB "004DA % CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS -\setXTXcharcodes "004DB "004DB "004DA % CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS -\setXTXcharcodes "004DC "004DD "004DC % CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS -\setXTXcharcodes "004DD "004DD "004DC % CYRILLIC SMALL LETTER ZHE WITH DIAERESIS -\setXTXcharcodes "004DE "004DF "004DE % CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS -\setXTXcharcodes "004DF "004DF "004DE % CYRILLIC SMALL LETTER ZE WITH DIAERESIS -\setXTXcharcodes "004E0 "004E1 "004E0 % CYRILLIC CAPITAL LETTER ABKHASIAN DZE -\setXTXcharcodes "004E1 "004E1 "004E0 % CYRILLIC SMALL LETTER ABKHASIAN DZE -\setXTXcharcodes "004E2 "004E3 "004E2 % CYRILLIC CAPITAL LETTER I WITH MACRON -\setXTXcharcodes "004E3 "004E3 "004E2 % CYRILLIC SMALL LETTER I WITH MACRON -\setXTXcharcodes "004E4 "004E5 "004E4 % CYRILLIC CAPITAL LETTER I WITH DIAERESIS -\setXTXcharcodes "004E5 "004E5 "004E4 % CYRILLIC SMALL LETTER I WITH DIAERESIS -\setXTXcharcodes "004E6 "004E7 "004E6 % CYRILLIC CAPITAL LETTER O WITH DIAERESIS -\setXTXcharcodes "004E7 "004E7 "004E6 % CYRILLIC SMALL LETTER O WITH DIAERESIS -\setXTXcharcodes "004E8 "004E9 "004E8 % CYRILLIC CAPITAL LETTER BARRED O -\setXTXcharcodes "004E9 "004E9 "004E8 % CYRILLIC SMALL LETTER BARRED O -\setXTXcharcodes "004EA "004EB "004EA % CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS -\setXTXcharcodes "004EB "004EB "004EA % CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS -\setXTXcharcodes "004EC "004ED "004EC % CYRILLIC CAPITAL LETTER E WITH DIAERESIS -\setXTXcharcodes "004ED "004ED "004EC % CYRILLIC SMALL LETTER E WITH DIAERESIS -\setXTXcharcodes "004EE "004EF "004EE % CYRILLIC CAPITAL LETTER U WITH MACRON -\setXTXcharcodes "004EF "004EF "004EE % CYRILLIC SMALL LETTER U WITH MACRON -\setXTXcharcodes "004F0 "004F1 "004F0 % CYRILLIC CAPITAL LETTER U WITH DIAERESIS -\setXTXcharcodes "004F1 "004F1 "004F0 % CYRILLIC SMALL LETTER U WITH DIAERESIS -\setXTXcharcodes "004F2 "004F3 "004F2 % CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE -\setXTXcharcodes "004F3 "004F3 "004F2 % CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE -\setXTXcharcodes "004F4 "004F5 "004F4 % CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS -\setXTXcharcodes "004F5 "004F5 "004F4 % CYRILLIC SMALL LETTER CHE WITH DIAERESIS -\setXTXcharcodes "004F6 "004F7 "004F6 % CYRILLIC CAPITAL LETTER GHE WITH DESCENDER -\setXTXcharcodes "004F7 "004F7 "004F6 % CYRILLIC SMALL LETTER GHE WITH DESCENDER -\setXTXcharcodes "004F8 "004F9 "004F8 % CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS -\setXTXcharcodes "004F9 "004F9 "004F8 % CYRILLIC SMALL LETTER YERU WITH DIAERESIS -\setXTXcharcodes "004FA "004FB "004FA % CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK -\setXTXcharcodes "004FB "004FB "004FA % CYRILLIC SMALL LETTER GHE WITH STROKE AND HOOK -\setXTXcharcodes "004FC "004FD "004FC % CYRILLIC CAPITAL LETTER HA WITH HOOK -\setXTXcharcodes "004FD "004FD "004FC % CYRILLIC SMALL LETTER HA WITH HOOK -\setXTXcharcodes "004FE "004FF "004FE % CYRILLIC CAPITAL LETTER HA WITH STROKE -\setXTXcharcodes "004FF "004FF "004FE % CYRILLIC SMALL LETTER HA WITH STROKE -\setXTXcharcodes "00500 "00501 "00500 % CYRILLIC CAPITAL LETTER KOMI DE -\setXTXcharcodes "00501 "00501 "00500 % CYRILLIC SMALL LETTER KOMI DE -\setXTXcharcodes "00502 "00503 "00502 % CYRILLIC CAPITAL LETTER KOMI DJE -\setXTXcharcodes "00503 "00503 "00502 % CYRILLIC SMALL LETTER KOMI DJE -\setXTXcharcodes "00504 "00505 "00504 % CYRILLIC CAPITAL LETTER KOMI ZJE -\setXTXcharcodes "00505 "00505 "00504 % CYRILLIC SMALL LETTER KOMI ZJE -\setXTXcharcodes "00506 "00507 "00506 % CYRILLIC CAPITAL LETTER KOMI DZJE -\setXTXcharcodes "00507 "00507 "00506 % CYRILLIC SMALL LETTER KOMI DZJE -\setXTXcharcodes "00508 "00509 "00508 % CYRILLIC CAPITAL LETTER KOMI LJE -\setXTXcharcodes "00509 "00509 "00508 % CYRILLIC SMALL LETTER KOMI LJE -\setXTXcharcodes "0050A "0050B "0050A % CYRILLIC CAPITAL LETTER KOMI NJE -\setXTXcharcodes "0050B "0050B "0050A % CYRILLIC SMALL LETTER KOMI NJE -\setXTXcharcodes "0050C "0050D "0050C % CYRILLIC CAPITAL LETTER KOMI SJE -\setXTXcharcodes "0050D "0050D "0050C % CYRILLIC SMALL LETTER KOMI SJE -\setXTXcharcodes "0050E "0050F "0050E % CYRILLIC CAPITAL LETTER KOMI TJE -\setXTXcharcodes "0050F "0050F "0050E % CYRILLIC SMALL LETTER KOMI TJE -\setXTXcharcodes "00510 "00511 "00510 % CYRILLIC CAPITAL LETTER REVERSED ZE -\setXTXcharcodes "00511 "00511 "00510 % CYRILLIC SMALL LETTER REVERSED ZE -\setXTXcharcodes "00512 "00513 "00512 % CYRILLIC CAPITAL LETTER EL WITH HOOK -\setXTXcharcodes "00513 "00513 "00512 % CYRILLIC SMALL LETTER EL WITH HOOK -\setXTXcharcodes "00531 "00561 "00531 % ARMENIAN CAPITAL LETTER AYB -\setXTXcharcodes "00532 "00562 "00532 % ARMENIAN CAPITAL LETTER BEN -\setXTXcharcodes "00533 "00563 "00533 % ARMENIAN CAPITAL LETTER GIM -\setXTXcharcodes "00534 "00564 "00534 % ARMENIAN CAPITAL LETTER DA -\setXTXcharcodes "00535 "00565 "00535 % ARMENIAN CAPITAL LETTER ECH -\setXTXcharcodes "00536 "00566 "00536 % ARMENIAN CAPITAL LETTER ZA -\setXTXcharcodes "00537 "00567 "00537 % ARMENIAN CAPITAL LETTER EH -\setXTXcharcodes "00538 "00568 "00538 % ARMENIAN CAPITAL LETTER ET -\setXTXcharcodes "00539 "00569 "00539 % ARMENIAN CAPITAL LETTER TO -\setXTXcharcodes "0053A "0056A "0053A % ARMENIAN CAPITAL LETTER ZHE -\setXTXcharcodes "0053B "0056B "0053B % ARMENIAN CAPITAL LETTER INI -\setXTXcharcodes "0053C "0056C "0053C % ARMENIAN CAPITAL LETTER LIWN -\setXTXcharcodes "0053D "0056D "0053D % ARMENIAN CAPITAL LETTER XEH -\setXTXcharcodes "0053E "0056E "0053E % ARMENIAN CAPITAL LETTER CA -\setXTXcharcodes "0053F "0056F "0053F % ARMENIAN CAPITAL LETTER KEN -\setXTXcharcodes "00540 "00570 "00540 % ARMENIAN CAPITAL LETTER HO -\setXTXcharcodes "00541 "00571 "00541 % ARMENIAN CAPITAL LETTER JA -\setXTXcharcodes "00542 "00572 "00542 % ARMENIAN CAPITAL LETTER GHAD -\setXTXcharcodes "00543 "00573 "00543 % ARMENIAN CAPITAL LETTER CHEH -\setXTXcharcodes "00544 "00574 "00544 % ARMENIAN CAPITAL LETTER MEN -\setXTXcharcodes "00545 "00575 "00545 % ARMENIAN CAPITAL LETTER YI -\setXTXcharcodes "00546 "00576 "00546 % ARMENIAN CAPITAL LETTER NOW -\setXTXcharcodes "00547 "00577 "00547 % ARMENIAN CAPITAL LETTER SHA -\setXTXcharcodes "00548 "00578 "00548 % ARMENIAN CAPITAL LETTER VO -\setXTXcharcodes "00549 "00579 "00549 % ARMENIAN CAPITAL LETTER CHA -\setXTXcharcodes "0054A "0057A "0054A % ARMENIAN CAPITAL LETTER PEH -\setXTXcharcodes "0054B "0057B "0054B % ARMENIAN CAPITAL LETTER JHEH -\setXTXcharcodes "0054C "0057C "0054C % ARMENIAN CAPITAL LETTER RA -\setXTXcharcodes "0054D "0057D "0054D % ARMENIAN CAPITAL LETTER SEH -\setXTXcharcodes "0054E "0057E "0054E % ARMENIAN CAPITAL LETTER VEW -\setXTXcharcodes "0054F "0057F "0054F % ARMENIAN CAPITAL LETTER TIWN -\setXTXcharcodes "00550 "00580 "00550 % ARMENIAN CAPITAL LETTER REH -\setXTXcharcodes "00551 "00581 "00551 % ARMENIAN CAPITAL LETTER CO -\setXTXcharcodes "00552 "00582 "00552 % ARMENIAN CAPITAL LETTER YIWN -\setXTXcharcodes "00553 "00583 "00553 % ARMENIAN CAPITAL LETTER PIWR -\setXTXcharcodes "00554 "00584 "00554 % ARMENIAN CAPITAL LETTER KEH -\setXTXcharcodes "00555 "00585 "00555 % ARMENIAN CAPITAL LETTER OH -\setXTXcharcodes "00556 "00586 "00556 % ARMENIAN CAPITAL LETTER FEH -\setXTXcharcodes "00561 "00561 "00531 % ARMENIAN SMALL LETTER AYB -\setXTXcharcodes "00562 "00562 "00532 % ARMENIAN SMALL LETTER BEN -\setXTXcharcodes "00563 "00563 "00533 % ARMENIAN SMALL LETTER GIM -\setXTXcharcodes "00564 "00564 "00534 % ARMENIAN SMALL LETTER DA -\setXTXcharcodes "00565 "00565 "00535 % ARMENIAN SMALL LETTER ECH -\setXTXcharcodes "00566 "00566 "00536 % ARMENIAN SMALL LETTER ZA -\setXTXcharcodes "00567 "00567 "00537 % ARMENIAN SMALL LETTER EH -\setXTXcharcodes "00568 "00568 "00538 % ARMENIAN SMALL LETTER ET -\setXTXcharcodes "00569 "00569 "00539 % ARMENIAN SMALL LETTER TO -\setXTXcharcodes "0056A "0056A "0053A % ARMENIAN SMALL LETTER ZHE -\setXTXcharcodes "0056B "0056B "0053B % ARMENIAN SMALL LETTER INI -\setXTXcharcodes "0056C "0056C "0053C % ARMENIAN SMALL LETTER LIWN -\setXTXcharcodes "0056D "0056D "0053D % ARMENIAN SMALL LETTER XEH -\setXTXcharcodes "0056E "0056E "0053E % ARMENIAN SMALL LETTER CA -\setXTXcharcodes "0056F "0056F "0053F % ARMENIAN SMALL LETTER KEN -\setXTXcharcodes "00570 "00570 "00540 % ARMENIAN SMALL LETTER HO -\setXTXcharcodes "00571 "00571 "00541 % ARMENIAN SMALL LETTER JA -\setXTXcharcodes "00572 "00572 "00542 % ARMENIAN SMALL LETTER GHAD -\setXTXcharcodes "00573 "00573 "00543 % ARMENIAN SMALL LETTER CHEH -\setXTXcharcodes "00574 "00574 "00544 % ARMENIAN SMALL LETTER MEN -\setXTXcharcodes "00575 "00575 "00545 % ARMENIAN SMALL LETTER YI -\setXTXcharcodes "00576 "00576 "00546 % ARMENIAN SMALL LETTER NOW -\setXTXcharcodes "00577 "00577 "00547 % ARMENIAN SMALL LETTER SHA -\setXTXcharcodes "00578 "00578 "00548 % ARMENIAN SMALL LETTER VO -\setXTXcharcodes "00579 "00579 "00549 % ARMENIAN SMALL LETTER CHA -\setXTXcharcodes "0057A "0057A "0054A % ARMENIAN SMALL LETTER PEH -\setXTXcharcodes "0057B "0057B "0054B % ARMENIAN SMALL LETTER JHEH -\setXTXcharcodes "0057C "0057C "0054C % ARMENIAN SMALL LETTER RA -\setXTXcharcodes "0057D "0057D "0054D % ARMENIAN SMALL LETTER SEH -\setXTXcharcodes "0057E "0057E "0054E % ARMENIAN SMALL LETTER VEW -\setXTXcharcodes "0057F "0057F "0054F % ARMENIAN SMALL LETTER TIWN -\setXTXcharcodes "00580 "00580 "00550 % ARMENIAN SMALL LETTER REH -\setXTXcharcodes "00581 "00581 "00551 % ARMENIAN SMALL LETTER CO -\setXTXcharcodes "00582 "00582 "00552 % ARMENIAN SMALL LETTER YIWN -\setXTXcharcodes "00583 "00583 "00553 % ARMENIAN SMALL LETTER PIWR -\setXTXcharcodes "00584 "00584 "00554 % ARMENIAN SMALL LETTER KEH -\setXTXcharcodes "00585 "00585 "00555 % ARMENIAN SMALL LETTER OH -\setXTXcharcodes "00586 "00586 "00556 % ARMENIAN SMALL LETTER FEH -\setXTXcharcodes "00587 "00587 "00587 % ARMENIAN SMALL LIGATURE ECH YIWN -\setXTXcharcodes "010A0 "02D00 "010A0 % GEORGIAN CAPITAL LETTER AN -\setXTXcharcodes "010A1 "02D01 "010A1 % GEORGIAN CAPITAL LETTER BAN -\setXTXcharcodes "010A2 "02D02 "010A2 % GEORGIAN CAPITAL LETTER GAN -\setXTXcharcodes "010A3 "02D03 "010A3 % GEORGIAN CAPITAL LETTER DON -\setXTXcharcodes "010A4 "02D04 "010A4 % GEORGIAN CAPITAL LETTER EN -\setXTXcharcodes "010A5 "02D05 "010A5 % GEORGIAN CAPITAL LETTER VIN -\setXTXcharcodes "010A6 "02D06 "010A6 % GEORGIAN CAPITAL LETTER ZEN -\setXTXcharcodes "010A7 "02D07 "010A7 % GEORGIAN CAPITAL LETTER TAN -\setXTXcharcodes "010A8 "02D08 "010A8 % GEORGIAN CAPITAL LETTER IN -\setXTXcharcodes "010A9 "02D09 "010A9 % GEORGIAN CAPITAL LETTER KAN -\setXTXcharcodes "010AA "02D0A "010AA % GEORGIAN CAPITAL LETTER LAS -\setXTXcharcodes "010AB "02D0B "010AB % GEORGIAN CAPITAL LETTER MAN -\setXTXcharcodes "010AC "02D0C "010AC % GEORGIAN CAPITAL LETTER NAR -\setXTXcharcodes "010AD "02D0D "010AD % GEORGIAN CAPITAL LETTER ON -\setXTXcharcodes "010AE "02D0E "010AE % GEORGIAN CAPITAL LETTER PAR -\setXTXcharcodes "010AF "02D0F "010AF % GEORGIAN CAPITAL LETTER ZHAR -\setXTXcharcodes "010B0 "02D10 "010B0 % GEORGIAN CAPITAL LETTER RAE -\setXTXcharcodes "010B1 "02D11 "010B1 % GEORGIAN CAPITAL LETTER SAN -\setXTXcharcodes "010B2 "02D12 "010B2 % GEORGIAN CAPITAL LETTER TAR -\setXTXcharcodes "010B3 "02D13 "010B3 % GEORGIAN CAPITAL LETTER UN -\setXTXcharcodes "010B4 "02D14 "010B4 % GEORGIAN CAPITAL LETTER PHAR -\setXTXcharcodes "010B5 "02D15 "010B5 % GEORGIAN CAPITAL LETTER KHAR -\setXTXcharcodes "010B6 "02D16 "010B6 % GEORGIAN CAPITAL LETTER GHAN -\setXTXcharcodes "010B7 "02D17 "010B7 % GEORGIAN CAPITAL LETTER QAR -\setXTXcharcodes "010B8 "02D18 "010B8 % GEORGIAN CAPITAL LETTER SHIN -\setXTXcharcodes "010B9 "02D19 "010B9 % GEORGIAN CAPITAL LETTER CHIN -\setXTXcharcodes "010BA "02D1A "010BA % GEORGIAN CAPITAL LETTER CAN -\setXTXcharcodes "010BB "02D1B "010BB % GEORGIAN CAPITAL LETTER JIL -\setXTXcharcodes "010BC "02D1C "010BC % GEORGIAN CAPITAL LETTER CIL -\setXTXcharcodes "010BD "02D1D "010BD % GEORGIAN CAPITAL LETTER CHAR -\setXTXcharcodes "010BE "02D1E "010BE % GEORGIAN CAPITAL LETTER XAN -\setXTXcharcodes "010BF "02D1F "010BF % GEORGIAN CAPITAL LETTER JHAN -\setXTXcharcodes "010C0 "02D20 "010C0 % GEORGIAN CAPITAL LETTER HAE -\setXTXcharcodes "010C1 "02D21 "010C1 % GEORGIAN CAPITAL LETTER HE -\setXTXcharcodes "010C2 "02D22 "010C2 % GEORGIAN CAPITAL LETTER HIE -\setXTXcharcodes "010C3 "02D23 "010C3 % GEORGIAN CAPITAL LETTER WE -\setXTXcharcodes "010C4 "02D24 "010C4 % GEORGIAN CAPITAL LETTER HAR -\setXTXcharcodes "010C5 "02D25 "010C5 % GEORGIAN CAPITAL LETTER HOE -\setXTXcharcodes "01D00 "01D00 "01D00 % LATIN LETTER SMALL CAPITAL A -\setXTXcharcodes "01D01 "01D01 "01D01 % LATIN LETTER SMALL CAPITAL AE -\setXTXcharcodes "01D02 "01D02 "01D02 % LATIN SMALL LETTER TURNED AE -\setXTXcharcodes "01D03 "01D03 "01D03 % LATIN LETTER SMALL CAPITAL BARRED B -\setXTXcharcodes "01D04 "01D04 "01D04 % LATIN LETTER SMALL CAPITAL C -\setXTXcharcodes "01D05 "01D05 "01D05 % LATIN LETTER SMALL CAPITAL D -\setXTXcharcodes "01D06 "01D06 "01D06 % LATIN LETTER SMALL CAPITAL ETH -\setXTXcharcodes "01D07 "01D07 "01D07 % LATIN LETTER SMALL CAPITAL E -\setXTXcharcodes "01D08 "01D08 "01D08 % LATIN SMALL LETTER TURNED OPEN E -\setXTXcharcodes "01D09 "01D09 "01D09 % LATIN SMALL LETTER TURNED I -\setXTXcharcodes "01D0A "01D0A "01D0A % LATIN LETTER SMALL CAPITAL J -\setXTXcharcodes "01D0B "01D0B "01D0B % LATIN LETTER SMALL CAPITAL K -\setXTXcharcodes "01D0C "01D0C "01D0C % LATIN LETTER SMALL CAPITAL L WITH STROKE -\setXTXcharcodes "01D0D "01D0D "01D0D % LATIN LETTER SMALL CAPITAL M -\setXTXcharcodes "01D0E "01D0E "01D0E % LATIN LETTER SMALL CAPITAL REVERSED N -\setXTXcharcodes "01D0F "01D0F "01D0F % LATIN LETTER SMALL CAPITAL O -\setXTXcharcodes "01D10 "01D10 "01D10 % LATIN LETTER SMALL CAPITAL OPEN O -\setXTXcharcodes "01D11 "01D11 "01D11 % LATIN SMALL LETTER SIDEWAYS O -\setXTXcharcodes "01D12 "01D12 "01D12 % LATIN SMALL LETTER SIDEWAYS OPEN O -\setXTXcharcodes "01D13 "01D13 "01D13 % LATIN SMALL LETTER SIDEWAYS O WITH STROKE -\setXTXcharcodes "01D14 "01D14 "01D14 % LATIN SMALL LETTER TURNED OE -\setXTXcharcodes "01D15 "01D15 "01D15 % LATIN LETTER SMALL CAPITAL OU -\setXTXcharcodes "01D16 "01D16 "01D16 % LATIN SMALL LETTER TOP HALF O -\setXTXcharcodes "01D17 "01D17 "01D17 % LATIN SMALL LETTER BOTTOM HALF O -\setXTXcharcodes "01D18 "01D18 "01D18 % LATIN LETTER SMALL CAPITAL P -\setXTXcharcodes "01D19 "01D19 "01D19 % LATIN LETTER SMALL CAPITAL REVERSED R -\setXTXcharcodes "01D1A "01D1A "01D1A % LATIN LETTER SMALL CAPITAL TURNED R -\setXTXcharcodes "01D1B "01D1B "01D1B % LATIN LETTER SMALL CAPITAL T -\setXTXcharcodes "01D1C "01D1C "01D1C % LATIN LETTER SMALL CAPITAL U -\setXTXcharcodes "01D1D "01D1D "01D1D % LATIN SMALL LETTER SIDEWAYS U -\setXTXcharcodes "01D1E "01D1E "01D1E % LATIN SMALL LETTER SIDEWAYS DIAERESIZED U -\setXTXcharcodes "01D1F "01D1F "01D1F % LATIN SMALL LETTER SIDEWAYS TURNED M -\setXTXcharcodes "01D20 "01D20 "01D20 % LATIN LETTER SMALL CAPITAL V -\setXTXcharcodes "01D21 "01D21 "01D21 % LATIN LETTER SMALL CAPITAL W -\setXTXcharcodes "01D22 "01D22 "01D22 % LATIN LETTER SMALL CAPITAL Z -\setXTXcharcodes "01D23 "01D23 "01D23 % LATIN LETTER SMALL CAPITAL EZH -\setXTXcharcodes "01D24 "01D24 "01D24 % LATIN LETTER VOICED LARYNGEAL SPIRANT -\setXTXcharcodes "01D25 "01D25 "01D25 % LATIN LETTER AIN -\setXTXcharcodes "01D26 "01D26 "01D26 % GREEK LETTER SMALL CAPITAL GAMMA -\setXTXcharcodes "01D27 "01D27 "01D27 % GREEK LETTER SMALL CAPITAL LAMDA -\setXTXcharcodes "01D28 "01D28 "01D28 % GREEK LETTER SMALL CAPITAL PI -\setXTXcharcodes "01D29 "01D29 "01D29 % GREEK LETTER SMALL CAPITAL RHO -\setXTXcharcodes "01D2A "01D2A "01D2A % GREEK LETTER SMALL CAPITAL PSI -\setXTXcharcodes "01D2B "01D2B "01D2B % CYRILLIC LETTER SMALL CAPITAL EL -\setXTXcharcodes "01D62 "01D62 "01D62 % LATIN SUBSCRIPT SMALL LETTER I -\setXTXcharcodes "01D63 "01D63 "01D63 % LATIN SUBSCRIPT SMALL LETTER R -\setXTXcharcodes "01D64 "01D64 "01D64 % LATIN SUBSCRIPT SMALL LETTER U -\setXTXcharcodes "01D65 "01D65 "01D65 % LATIN SUBSCRIPT SMALL LETTER V -\setXTXcharcodes "01D66 "01D66 "01D66 % GREEK SUBSCRIPT SMALL LETTER BETA -\setXTXcharcodes "01D67 "01D67 "01D67 % GREEK SUBSCRIPT SMALL LETTER GAMMA -\setXTXcharcodes "01D68 "01D68 "01D68 % GREEK SUBSCRIPT SMALL LETTER RHO -\setXTXcharcodes "01D69 "01D69 "01D69 % GREEK SUBSCRIPT SMALL LETTER PHI -\setXTXcharcodes "01D6A "01D6A "01D6A % GREEK SUBSCRIPT SMALL LETTER CHI -\setXTXcharcodes "01D6B "01D6B "01D6B % LATIN SMALL LETTER UE -\setXTXcharcodes "01D6C "01D6C "01D6C % LATIN SMALL LETTER B WITH MIDDLE TILDE -\setXTXcharcodes "01D6D "01D6D "01D6D % LATIN SMALL LETTER D WITH MIDDLE TILDE -\setXTXcharcodes "01D6E "01D6E "01D6E % LATIN SMALL LETTER F WITH MIDDLE TILDE -\setXTXcharcodes "01D6F "01D6F "01D6F % LATIN SMALL LETTER M WITH MIDDLE TILDE -\setXTXcharcodes "01D70 "01D70 "01D70 % LATIN SMALL LETTER N WITH MIDDLE TILDE -\setXTXcharcodes "01D71 "01D71 "01D71 % LATIN SMALL LETTER P WITH MIDDLE TILDE -\setXTXcharcodes "01D72 "01D72 "01D72 % LATIN SMALL LETTER R WITH MIDDLE TILDE -\setXTXcharcodes "01D73 "01D73 "01D73 % LATIN SMALL LETTER R WITH FISHHOOK AND MIDDLE TILDE -\setXTXcharcodes "01D74 "01D74 "01D74 % LATIN SMALL LETTER S WITH MIDDLE TILDE -\setXTXcharcodes "01D75 "01D75 "01D75 % LATIN SMALL LETTER T WITH MIDDLE TILDE -\setXTXcharcodes "01D76 "01D76 "01D76 % LATIN SMALL LETTER Z WITH MIDDLE TILDE -\setXTXcharcodes "01D77 "01D77 "01D77 % LATIN SMALL LETTER TURNED G -\setXTXcharcodes "01D79 "01D79 "01D79 % LATIN SMALL LETTER INSULAR G -\setXTXcharcodes "01D7A "01D7A "01D7A % LATIN SMALL LETTER TH WITH STRIKETHROUGH -\setXTXcharcodes "01D7B "01D7B "01D7B % LATIN SMALL CAPITAL LETTER I WITH STROKE -\setXTXcharcodes "01D7C "01D7C "01D7C % LATIN SMALL LETTER IOTA WITH STROKE -\setXTXcharcodes "01D7D "01D7D "02C63 % LATIN SMALL LETTER P WITH STROKE -\setXTXcharcodes "01D7E "01D7E "01D7E % LATIN SMALL CAPITAL LETTER U WITH STROKE -\setXTXcharcodes "01D7F "01D7F "01D7F % LATIN SMALL LETTER UPSILON WITH STROKE -\setXTXcharcodes "01D80 "01D80 "01D80 % LATIN SMALL LETTER B WITH PALATAL HOOK -\setXTXcharcodes "01D81 "01D81 "01D81 % LATIN SMALL LETTER D WITH PALATAL HOOK -\setXTXcharcodes "01D82 "01D82 "01D82 % LATIN SMALL LETTER F WITH PALATAL HOOK -\setXTXcharcodes "01D83 "01D83 "01D83 % LATIN SMALL LETTER G WITH PALATAL HOOK -\setXTXcharcodes "01D84 "01D84 "01D84 % LATIN SMALL LETTER K WITH PALATAL HOOK -\setXTXcharcodes "01D85 "01D85 "01D85 % LATIN SMALL LETTER L WITH PALATAL HOOK -\setXTXcharcodes "01D86 "01D86 "01D86 % LATIN SMALL LETTER M WITH PALATAL HOOK -\setXTXcharcodes "01D87 "01D87 "01D87 % LATIN SMALL LETTER N WITH PALATAL HOOK -\setXTXcharcodes "01D88 "01D88 "01D88 % LATIN SMALL LETTER P WITH PALATAL HOOK -\setXTXcharcodes "01D89 "01D89 "01D89 % LATIN SMALL LETTER R WITH PALATAL HOOK -\setXTXcharcodes "01D8A "01D8A "01D8A % LATIN SMALL LETTER S WITH PALATAL HOOK -\setXTXcharcodes "01D8B "01D8B "01D8B % LATIN SMALL LETTER ESH WITH PALATAL HOOK -\setXTXcharcodes "01D8C "01D8C "01D8C % LATIN SMALL LETTER V WITH PALATAL HOOK -\setXTXcharcodes "01D8D "01D8D "01D8D % LATIN SMALL LETTER X WITH PALATAL HOOK -\setXTXcharcodes "01D8E "01D8E "01D8E % LATIN SMALL LETTER Z WITH PALATAL HOOK -\setXTXcharcodes "01D8F "01D8F "01D8F % LATIN SMALL LETTER A WITH RETROFLEX HOOK -\setXTXcharcodes "01D90 "01D90 "01D90 % LATIN SMALL LETTER ALPHA WITH RETROFLEX HOOK -\setXTXcharcodes "01D91 "01D91 "01D91 % LATIN SMALL LETTER D WITH HOOK AND TAIL -\setXTXcharcodes "01D92 "01D92 "01D92 % LATIN SMALL LETTER E WITH RETROFLEX HOOK -\setXTXcharcodes "01D93 "01D93 "01D93 % LATIN SMALL LETTER OPEN E WITH RETROFLEX HOOK -\setXTXcharcodes "01D94 "01D94 "01D94 % LATIN SMALL LETTER REVERSED OPEN E WITH RETROFLEX HOOK -\setXTXcharcodes "01D95 "01D95 "01D95 % LATIN SMALL LETTER SCHWA WITH RETROFLEX HOOK -\setXTXcharcodes "01D96 "01D96 "01D96 % LATIN SMALL LETTER I WITH RETROFLEX HOOK -\setXTXcharcodes "01D97 "01D97 "01D97 % LATIN SMALL LETTER OPEN O WITH RETROFLEX HOOK -\setXTXcharcodes "01D98 "01D98 "01D98 % LATIN SMALL LETTER ESH WITH RETROFLEX HOOK -\setXTXcharcodes "01D99 "01D99 "01D99 % LATIN SMALL LETTER U WITH RETROFLEX HOOK -\setXTXcharcodes "01D9A "01D9A "01D9A % LATIN SMALL LETTER EZH WITH RETROFLEX HOOK -\setXTXcharcodes "01E00 "01E01 "01E00 % LATIN CAPITAL LETTER A WITH RING BELOW -\setXTXcharcodes "01E01 "01E01 "01E00 % LATIN SMALL LETTER A WITH RING BELOW -\setXTXcharcodes "01E02 "01E03 "01E02 % LATIN CAPITAL LETTER B WITH DOT ABOVE -\setXTXcharcodes "01E03 "01E03 "01E02 % LATIN SMALL LETTER B WITH DOT ABOVE -\setXTXcharcodes "01E04 "01E05 "01E04 % LATIN CAPITAL LETTER B WITH DOT BELOW -\setXTXcharcodes "01E05 "01E05 "01E04 % LATIN SMALL LETTER B WITH DOT BELOW -\setXTXcharcodes "01E06 "01E07 "01E06 % LATIN CAPITAL LETTER B WITH LINE BELOW -\setXTXcharcodes "01E07 "01E07 "01E06 % LATIN SMALL LETTER B WITH LINE BELOW -\setXTXcharcodes "01E08 "01E09 "01E08 % LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE -\setXTXcharcodes "01E09 "01E09 "01E08 % LATIN SMALL LETTER C WITH CEDILLA AND ACUTE -\setXTXcharcodes "01E0A "01E0B "01E0A % LATIN CAPITAL LETTER D WITH DOT ABOVE -\setXTXcharcodes "01E0B "01E0B "01E0A % LATIN SMALL LETTER D WITH DOT ABOVE -\setXTXcharcodes "01E0C "01E0D "01E0C % LATIN CAPITAL LETTER D WITH DOT BELOW -\setXTXcharcodes "01E0D "01E0D "01E0C % LATIN SMALL LETTER D WITH DOT BELOW -\setXTXcharcodes "01E0E "01E0F "01E0E % LATIN CAPITAL LETTER D WITH LINE BELOW -\setXTXcharcodes "01E0F "01E0F "01E0E % LATIN SMALL LETTER D WITH LINE BELOW -\setXTXcharcodes "01E10 "01E11 "01E10 % LATIN CAPITAL LETTER D WITH CEDILLA -\setXTXcharcodes "01E11 "01E11 "01E10 % LATIN SMALL LETTER D WITH CEDILLA -\setXTXcharcodes "01E12 "01E13 "01E12 % LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E13 "01E13 "01E12 % LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E14 "01E15 "01E14 % LATIN CAPITAL LETTER E WITH MACRON AND GRAVE -\setXTXcharcodes "01E15 "01E15 "01E14 % LATIN SMALL LETTER E WITH MACRON AND GRAVE -\setXTXcharcodes "01E16 "01E17 "01E16 % LATIN CAPITAL LETTER E WITH MACRON AND ACUTE -\setXTXcharcodes "01E17 "01E17 "01E16 % LATIN SMALL LETTER E WITH MACRON AND ACUTE -\setXTXcharcodes "01E18 "01E19 "01E18 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E19 "01E19 "01E18 % LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E1A "01E1B "01E1A % LATIN CAPITAL LETTER E WITH TILDE BELOW -\setXTXcharcodes "01E1B "01E1B "01E1A % LATIN SMALL LETTER E WITH TILDE BELOW -\setXTXcharcodes "01E1C "01E1D "01E1C % LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE -\setXTXcharcodes "01E1D "01E1D "01E1C % LATIN SMALL LETTER E WITH CEDILLA AND BREVE -\setXTXcharcodes "01E1E "01E1F "01E1E % LATIN CAPITAL LETTER F WITH DOT ABOVE -\setXTXcharcodes "01E1F "01E1F "01E1E % LATIN SMALL LETTER F WITH DOT ABOVE -\setXTXcharcodes "01E20 "01E21 "01E20 % LATIN CAPITAL LETTER G WITH MACRON -\setXTXcharcodes "01E21 "01E21 "01E20 % LATIN SMALL LETTER G WITH MACRON -\setXTXcharcodes "01E22 "01E23 "01E22 % LATIN CAPITAL LETTER H WITH DOT ABOVE -\setXTXcharcodes "01E23 "01E23 "01E22 % LATIN SMALL LETTER H WITH DOT ABOVE -\setXTXcharcodes "01E24 "01E25 "01E24 % LATIN CAPITAL LETTER H WITH DOT BELOW -\setXTXcharcodes "01E25 "01E25 "01E24 % LATIN SMALL LETTER H WITH DOT BELOW -\setXTXcharcodes "01E26 "01E27 "01E26 % LATIN CAPITAL LETTER H WITH DIAERESIS -\setXTXcharcodes "01E27 "01E27 "01E26 % LATIN SMALL LETTER H WITH DIAERESIS -\setXTXcharcodes "01E28 "01E29 "01E28 % LATIN CAPITAL LETTER H WITH CEDILLA -\setXTXcharcodes "01E29 "01E29 "01E28 % LATIN SMALL LETTER H WITH CEDILLA -\setXTXcharcodes "01E2A "01E2B "01E2A % LATIN CAPITAL LETTER H WITH BREVE BELOW -\setXTXcharcodes "01E2B "01E2B "01E2A % LATIN SMALL LETTER H WITH BREVE BELOW -\setXTXcharcodes "01E2C "01E2D "01E2C % LATIN CAPITAL LETTER I WITH TILDE BELOW -\setXTXcharcodes "01E2D "01E2D "01E2C % LATIN SMALL LETTER I WITH TILDE BELOW -\setXTXcharcodes "01E2E "01E2F "01E2E % LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE -\setXTXcharcodes "01E2F "01E2F "01E2E % LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE -\setXTXcharcodes "01E30 "01E31 "01E30 % LATIN CAPITAL LETTER K WITH ACUTE -\setXTXcharcodes "01E31 "01E31 "01E30 % LATIN SMALL LETTER K WITH ACUTE -\setXTXcharcodes "01E32 "01E33 "01E32 % LATIN CAPITAL LETTER K WITH DOT BELOW -\setXTXcharcodes "01E33 "01E33 "01E32 % LATIN SMALL LETTER K WITH DOT BELOW -\setXTXcharcodes "01E34 "01E35 "01E34 % LATIN CAPITAL LETTER K WITH LINE BELOW -\setXTXcharcodes "01E35 "01E35 "01E34 % LATIN SMALL LETTER K WITH LINE BELOW -\setXTXcharcodes "01E36 "01E37 "01E36 % LATIN CAPITAL LETTER L WITH DOT BELOW -\setXTXcharcodes "01E37 "01E37 "01E36 % LATIN SMALL LETTER L WITH DOT BELOW -\setXTXcharcodes "01E38 "01E39 "01E38 % LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON -\setXTXcharcodes "01E39 "01E39 "01E38 % LATIN SMALL LETTER L WITH DOT BELOW AND MACRON -\setXTXcharcodes "01E3A "01E3B "01E3A % LATIN CAPITAL LETTER L WITH LINE BELOW -\setXTXcharcodes "01E3B "01E3B "01E3A % LATIN SMALL LETTER L WITH LINE BELOW -\setXTXcharcodes "01E3C "01E3D "01E3C % LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E3D "01E3D "01E3C % LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E3E "01E3F "01E3E % LATIN CAPITAL LETTER M WITH ACUTE -\setXTXcharcodes "01E3F "01E3F "01E3E % LATIN SMALL LETTER M WITH ACUTE -\setXTXcharcodes "01E40 "01E41 "01E40 % LATIN CAPITAL LETTER M WITH DOT ABOVE -\setXTXcharcodes "01E41 "01E41 "01E40 % LATIN SMALL LETTER M WITH DOT ABOVE -\setXTXcharcodes "01E42 "01E43 "01E42 % LATIN CAPITAL LETTER M WITH DOT BELOW -\setXTXcharcodes "01E43 "01E43 "01E42 % LATIN SMALL LETTER M WITH DOT BELOW -\setXTXcharcodes "01E44 "01E45 "01E44 % LATIN CAPITAL LETTER N WITH DOT ABOVE -\setXTXcharcodes "01E45 "01E45 "01E44 % LATIN SMALL LETTER N WITH DOT ABOVE -\setXTXcharcodes "01E46 "01E47 "01E46 % LATIN CAPITAL LETTER N WITH DOT BELOW -\setXTXcharcodes "01E47 "01E47 "01E46 % LATIN SMALL LETTER N WITH DOT BELOW -\setXTXcharcodes "01E48 "01E49 "01E48 % LATIN CAPITAL LETTER N WITH LINE BELOW -\setXTXcharcodes "01E49 "01E49 "01E48 % LATIN SMALL LETTER N WITH LINE BELOW -\setXTXcharcodes "01E4A "01E4B "01E4A % LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E4B "01E4B "01E4A % LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E4C "01E4D "01E4C % LATIN CAPITAL LETTER O WITH TILDE AND ACUTE -\setXTXcharcodes "01E4D "01E4D "01E4C % LATIN SMALL LETTER O WITH TILDE AND ACUTE -\setXTXcharcodes "01E4E "01E4F "01E4E % LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS -\setXTXcharcodes "01E4F "01E4F "01E4E % LATIN SMALL LETTER O WITH TILDE AND DIAERESIS -\setXTXcharcodes "01E50 "01E51 "01E50 % LATIN CAPITAL LETTER O WITH MACRON AND GRAVE -\setXTXcharcodes "01E51 "01E51 "01E50 % LATIN SMALL LETTER O WITH MACRON AND GRAVE -\setXTXcharcodes "01E52 "01E53 "01E52 % LATIN CAPITAL LETTER O WITH MACRON AND ACUTE -\setXTXcharcodes "01E53 "01E53 "01E52 % LATIN SMALL LETTER O WITH MACRON AND ACUTE -\setXTXcharcodes "01E54 "01E55 "01E54 % LATIN CAPITAL LETTER P WITH ACUTE -\setXTXcharcodes "01E55 "01E55 "01E54 % LATIN SMALL LETTER P WITH ACUTE -\setXTXcharcodes "01E56 "01E57 "01E56 % LATIN CAPITAL LETTER P WITH DOT ABOVE -\setXTXcharcodes "01E57 "01E57 "01E56 % LATIN SMALL LETTER P WITH DOT ABOVE -\setXTXcharcodes "01E58 "01E59 "01E58 % LATIN CAPITAL LETTER R WITH DOT ABOVE -\setXTXcharcodes "01E59 "01E59 "01E58 % LATIN SMALL LETTER R WITH DOT ABOVE -\setXTXcharcodes "01E5A "01E5B "01E5A % LATIN CAPITAL LETTER R WITH DOT BELOW -\setXTXcharcodes "01E5B "01E5B "01E5A % LATIN SMALL LETTER R WITH DOT BELOW -\setXTXcharcodes "01E5C "01E5D "01E5C % LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON -\setXTXcharcodes "01E5D "01E5D "01E5C % LATIN SMALL LETTER R WITH DOT BELOW AND MACRON -\setXTXcharcodes "01E5E "01E5F "01E5E % LATIN CAPITAL LETTER R WITH LINE BELOW -\setXTXcharcodes "01E5F "01E5F "01E5E % LATIN SMALL LETTER R WITH LINE BELOW -\setXTXcharcodes "01E60 "01E61 "01E60 % LATIN CAPITAL LETTER S WITH DOT ABOVE -\setXTXcharcodes "01E61 "01E61 "01E60 % LATIN SMALL LETTER S WITH DOT ABOVE -\setXTXcharcodes "01E62 "01E63 "01E62 % LATIN CAPITAL LETTER S WITH DOT BELOW -\setXTXcharcodes "01E63 "01E63 "01E62 % LATIN SMALL LETTER S WITH DOT BELOW -\setXTXcharcodes "01E64 "01E65 "01E64 % LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE -\setXTXcharcodes "01E65 "01E65 "01E64 % LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE -\setXTXcharcodes "01E66 "01E67 "01E66 % LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE -\setXTXcharcodes "01E67 "01E67 "01E66 % LATIN SMALL LETTER S WITH CARON AND DOT ABOVE -\setXTXcharcodes "01E68 "01E69 "01E68 % LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE -\setXTXcharcodes "01E69 "01E69 "01E68 % LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE -\setXTXcharcodes "01E6A "01E6B "01E6A % LATIN CAPITAL LETTER T WITH DOT ABOVE -\setXTXcharcodes "01E6B "01E6B "01E6A % LATIN SMALL LETTER T WITH DOT ABOVE -\setXTXcharcodes "01E6C "01E6D "01E6C % LATIN CAPITAL LETTER T WITH DOT BELOW -\setXTXcharcodes "01E6D "01E6D "01E6C % LATIN SMALL LETTER T WITH DOT BELOW -\setXTXcharcodes "01E6E "01E6F "01E6E % LATIN CAPITAL LETTER T WITH LINE BELOW -\setXTXcharcodes "01E6F "01E6F "01E6E % LATIN SMALL LETTER T WITH LINE BELOW -\setXTXcharcodes "01E70 "01E71 "01E70 % LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E71 "01E71 "01E70 % LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E72 "01E73 "01E72 % LATIN CAPITAL LETTER U WITH DIAERESIS BELOW -\setXTXcharcodes "01E73 "01E73 "01E72 % LATIN SMALL LETTER U WITH DIAERESIS BELOW -\setXTXcharcodes "01E74 "01E75 "01E74 % LATIN CAPITAL LETTER U WITH TILDE BELOW -\setXTXcharcodes "01E75 "01E75 "01E74 % LATIN SMALL LETTER U WITH TILDE BELOW -\setXTXcharcodes "01E76 "01E77 "01E76 % LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E77 "01E77 "01E76 % LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW -\setXTXcharcodes "01E78 "01E79 "01E78 % LATIN CAPITAL LETTER U WITH TILDE AND ACUTE -\setXTXcharcodes "01E79 "01E79 "01E78 % LATIN SMALL LETTER U WITH TILDE AND ACUTE -\setXTXcharcodes "01E7A "01E7B "01E7A % LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS -\setXTXcharcodes "01E7B "01E7B "01E7A % LATIN SMALL LETTER U WITH MACRON AND DIAERESIS -\setXTXcharcodes "01E7C "01E7D "01E7C % LATIN CAPITAL LETTER V WITH TILDE -\setXTXcharcodes "01E7D "01E7D "01E7C % LATIN SMALL LETTER V WITH TILDE -\setXTXcharcodes "01E7E "01E7F "01E7E % LATIN CAPITAL LETTER V WITH DOT BELOW -\setXTXcharcodes "01E7F "01E7F "01E7E % LATIN SMALL LETTER V WITH DOT BELOW -\setXTXcharcodes "01E80 "01E81 "01E80 % LATIN CAPITAL LETTER W WITH GRAVE -\setXTXcharcodes "01E81 "01E81 "01E80 % LATIN SMALL LETTER W WITH GRAVE -\setXTXcharcodes "01E82 "01E83 "01E82 % LATIN CAPITAL LETTER W WITH ACUTE -\setXTXcharcodes "01E83 "01E83 "01E82 % LATIN SMALL LETTER W WITH ACUTE -\setXTXcharcodes "01E84 "01E85 "01E84 % LATIN CAPITAL LETTER W WITH DIAERESIS -\setXTXcharcodes "01E85 "01E85 "01E84 % LATIN SMALL LETTER W WITH DIAERESIS -\setXTXcharcodes "01E86 "01E87 "01E86 % LATIN CAPITAL LETTER W WITH DOT ABOVE -\setXTXcharcodes "01E87 "01E87 "01E86 % LATIN SMALL LETTER W WITH DOT ABOVE -\setXTXcharcodes "01E88 "01E89 "01E88 % LATIN CAPITAL LETTER W WITH DOT BELOW -\setXTXcharcodes "01E89 "01E89 "01E88 % LATIN SMALL LETTER W WITH DOT BELOW -\setXTXcharcodes "01E8A "01E8B "01E8A % LATIN CAPITAL LETTER X WITH DOT ABOVE -\setXTXcharcodes "01E8B "01E8B "01E8A % LATIN SMALL LETTER X WITH DOT ABOVE -\setXTXcharcodes "01E8C "01E8D "01E8C % LATIN CAPITAL LETTER X WITH DIAERESIS -\setXTXcharcodes "01E8D "01E8D "01E8C % LATIN SMALL LETTER X WITH DIAERESIS -\setXTXcharcodes "01E8E "01E8F "01E8E % LATIN CAPITAL LETTER Y WITH DOT ABOVE -\setXTXcharcodes "01E8F "01E8F "01E8E % LATIN SMALL LETTER Y WITH DOT ABOVE -\setXTXcharcodes "01E90 "01E91 "01E90 % LATIN CAPITAL LETTER Z WITH CIRCUMFLEX -\setXTXcharcodes "01E91 "01E91 "01E90 % LATIN SMALL LETTER Z WITH CIRCUMFLEX -\setXTXcharcodes "01E92 "01E93 "01E92 % LATIN CAPITAL LETTER Z WITH DOT BELOW -\setXTXcharcodes "01E93 "01E93 "01E92 % LATIN SMALL LETTER Z WITH DOT BELOW -\setXTXcharcodes "01E94 "01E95 "01E94 % LATIN CAPITAL LETTER Z WITH LINE BELOW -\setXTXcharcodes "01E95 "01E95 "01E94 % LATIN SMALL LETTER Z WITH LINE BELOW -\setXTXcharcodes "01E96 "01E96 "01E96 % LATIN SMALL LETTER H WITH LINE BELOW -\setXTXcharcodes "01E97 "01E97 "01E97 % LATIN SMALL LETTER T WITH DIAERESIS -\setXTXcharcodes "01E98 "01E98 "01E98 % LATIN SMALL LETTER W WITH RING ABOVE -\setXTXcharcodes "01E99 "01E99 "01E99 % LATIN SMALL LETTER Y WITH RING ABOVE -\setXTXcharcodes "01E9A "01E9A "01E9A % LATIN SMALL LETTER A WITH RIGHT HALF RING -\setXTXcharcodes "01E9B "01E9B "01E60 % LATIN SMALL LETTER LONG S WITH DOT ABOVE -\setXTXcharcodes "01EA0 "01EA1 "01EA0 % LATIN CAPITAL LETTER A WITH DOT BELOW -\setXTXcharcodes "01EA1 "01EA1 "01EA0 % LATIN SMALL LETTER A WITH DOT BELOW -\setXTXcharcodes "01EA2 "01EA3 "01EA2 % LATIN CAPITAL LETTER A WITH HOOK ABOVE -\setXTXcharcodes "01EA3 "01EA3 "01EA2 % LATIN SMALL LETTER A WITH HOOK ABOVE -\setXTXcharcodes "01EA4 "01EA5 "01EA4 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE -\setXTXcharcodes "01EA5 "01EA5 "01EA4 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE -\setXTXcharcodes "01EA6 "01EA7 "01EA6 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE -\setXTXcharcodes "01EA7 "01EA7 "01EA6 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE -\setXTXcharcodes "01EA8 "01EA9 "01EA8 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE -\setXTXcharcodes "01EA9 "01EA9 "01EA8 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE -\setXTXcharcodes "01EAA "01EAB "01EAA % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE -\setXTXcharcodes "01EAB "01EAB "01EAA % LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE -\setXTXcharcodes "01EAC "01EAD "01EAC % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW -\setXTXcharcodes "01EAD "01EAD "01EAC % LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW -\setXTXcharcodes "01EAE "01EAF "01EAE % LATIN CAPITAL LETTER A WITH BREVE AND ACUTE -\setXTXcharcodes "01EAF "01EAF "01EAE % LATIN SMALL LETTER A WITH BREVE AND ACUTE -\setXTXcharcodes "01EB0 "01EB1 "01EB0 % LATIN CAPITAL LETTER A WITH BREVE AND GRAVE -\setXTXcharcodes "01EB1 "01EB1 "01EB0 % LATIN SMALL LETTER A WITH BREVE AND GRAVE -\setXTXcharcodes "01EB2 "01EB3 "01EB2 % LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE -\setXTXcharcodes "01EB3 "01EB3 "01EB2 % LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE -\setXTXcharcodes "01EB4 "01EB5 "01EB4 % LATIN CAPITAL LETTER A WITH BREVE AND TILDE -\setXTXcharcodes "01EB5 "01EB5 "01EB4 % LATIN SMALL LETTER A WITH BREVE AND TILDE -\setXTXcharcodes "01EB6 "01EB7 "01EB6 % LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW -\setXTXcharcodes "01EB7 "01EB7 "01EB6 % LATIN SMALL LETTER A WITH BREVE AND DOT BELOW -\setXTXcharcodes "01EB8 "01EB9 "01EB8 % LATIN CAPITAL LETTER E WITH DOT BELOW -\setXTXcharcodes "01EB9 "01EB9 "01EB8 % LATIN SMALL LETTER E WITH DOT BELOW -\setXTXcharcodes "01EBA "01EBB "01EBA % LATIN CAPITAL LETTER E WITH HOOK ABOVE -\setXTXcharcodes "01EBB "01EBB "01EBA % LATIN SMALL LETTER E WITH HOOK ABOVE -\setXTXcharcodes "01EBC "01EBD "01EBC % LATIN CAPITAL LETTER E WITH TILDE -\setXTXcharcodes "01EBD "01EBD "01EBC % LATIN SMALL LETTER E WITH TILDE -\setXTXcharcodes "01EBE "01EBF "01EBE % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE -\setXTXcharcodes "01EBF "01EBF "01EBE % LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE -\setXTXcharcodes "01EC0 "01EC1 "01EC0 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE -\setXTXcharcodes "01EC1 "01EC1 "01EC0 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE -\setXTXcharcodes "01EC2 "01EC3 "01EC2 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE -\setXTXcharcodes "01EC3 "01EC3 "01EC2 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE -\setXTXcharcodes "01EC4 "01EC5 "01EC4 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE -\setXTXcharcodes "01EC5 "01EC5 "01EC4 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE -\setXTXcharcodes "01EC6 "01EC7 "01EC6 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW -\setXTXcharcodes "01EC7 "01EC7 "01EC6 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW -\setXTXcharcodes "01EC8 "01EC9 "01EC8 % LATIN CAPITAL LETTER I WITH HOOK ABOVE -\setXTXcharcodes "01EC9 "01EC9 "01EC8 % LATIN SMALL LETTER I WITH HOOK ABOVE -\setXTXcharcodes "01ECA "01ECB "01ECA % LATIN CAPITAL LETTER I WITH DOT BELOW -\setXTXcharcodes "01ECB "01ECB "01ECA % LATIN SMALL LETTER I WITH DOT BELOW -\setXTXcharcodes "01ECC "01ECD "01ECC % LATIN CAPITAL LETTER O WITH DOT BELOW -\setXTXcharcodes "01ECD "01ECD "01ECC % LATIN SMALL LETTER O WITH DOT BELOW -\setXTXcharcodes "01ECE "01ECF "01ECE % LATIN CAPITAL LETTER O WITH HOOK ABOVE -\setXTXcharcodes "01ECF "01ECF "01ECE % LATIN SMALL LETTER O WITH HOOK ABOVE -\setXTXcharcodes "01ED0 "01ED1 "01ED0 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE -\setXTXcharcodes "01ED1 "01ED1 "01ED0 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE -\setXTXcharcodes "01ED2 "01ED3 "01ED2 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE -\setXTXcharcodes "01ED3 "01ED3 "01ED2 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE -\setXTXcharcodes "01ED4 "01ED5 "01ED4 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE -\setXTXcharcodes "01ED5 "01ED5 "01ED4 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE -\setXTXcharcodes "01ED6 "01ED7 "01ED6 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE -\setXTXcharcodes "01ED7 "01ED7 "01ED6 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE -\setXTXcharcodes "01ED8 "01ED9 "01ED8 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW -\setXTXcharcodes "01ED9 "01ED9 "01ED8 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW -\setXTXcharcodes "01EDA "01EDB "01EDA % LATIN CAPITAL LETTER O WITH HORN AND ACUTE -\setXTXcharcodes "01EDB "01EDB "01EDA % LATIN SMALL LETTER O WITH HORN AND ACUTE -\setXTXcharcodes "01EDC "01EDD "01EDC % LATIN CAPITAL LETTER O WITH HORN AND GRAVE -\setXTXcharcodes "01EDD "01EDD "01EDC % LATIN SMALL LETTER O WITH HORN AND GRAVE -\setXTXcharcodes "01EDE "01EDF "01EDE % LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE -\setXTXcharcodes "01EDF "01EDF "01EDE % LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE -\setXTXcharcodes "01EE0 "01EE1 "01EE0 % LATIN CAPITAL LETTER O WITH HORN AND TILDE -\setXTXcharcodes "01EE1 "01EE1 "01EE0 % LATIN SMALL LETTER O WITH HORN AND TILDE -\setXTXcharcodes "01EE2 "01EE3 "01EE2 % LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW -\setXTXcharcodes "01EE3 "01EE3 "01EE2 % LATIN SMALL LETTER O WITH HORN AND DOT BELOW -\setXTXcharcodes "01EE4 "01EE5 "01EE4 % LATIN CAPITAL LETTER U WITH DOT BELOW -\setXTXcharcodes "01EE5 "01EE5 "01EE4 % LATIN SMALL LETTER U WITH DOT BELOW -\setXTXcharcodes "01EE6 "01EE7 "01EE6 % LATIN CAPITAL LETTER U WITH HOOK ABOVE -\setXTXcharcodes "01EE7 "01EE7 "01EE6 % LATIN SMALL LETTER U WITH HOOK ABOVE -\setXTXcharcodes "01EE8 "01EE9 "01EE8 % LATIN CAPITAL LETTER U WITH HORN AND ACUTE -\setXTXcharcodes "01EE9 "01EE9 "01EE8 % LATIN SMALL LETTER U WITH HORN AND ACUTE -\setXTXcharcodes "01EEA "01EEB "01EEA % LATIN CAPITAL LETTER U WITH HORN AND GRAVE -\setXTXcharcodes "01EEB "01EEB "01EEA % LATIN SMALL LETTER U WITH HORN AND GRAVE -\setXTXcharcodes "01EEC "01EED "01EEC % LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE -\setXTXcharcodes "01EED "01EED "01EEC % LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE -\setXTXcharcodes "01EEE "01EEF "01EEE % LATIN CAPITAL LETTER U WITH HORN AND TILDE -\setXTXcharcodes "01EEF "01EEF "01EEE % LATIN SMALL LETTER U WITH HORN AND TILDE -\setXTXcharcodes "01EF0 "01EF1 "01EF0 % LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW -\setXTXcharcodes "01EF1 "01EF1 "01EF0 % LATIN SMALL LETTER U WITH HORN AND DOT BELOW -\setXTXcharcodes "01EF2 "01EF3 "01EF2 % LATIN CAPITAL LETTER Y WITH GRAVE -\setXTXcharcodes "01EF3 "01EF3 "01EF2 % LATIN SMALL LETTER Y WITH GRAVE -\setXTXcharcodes "01EF4 "01EF5 "01EF4 % LATIN CAPITAL LETTER Y WITH DOT BELOW -\setXTXcharcodes "01EF5 "01EF5 "01EF4 % LATIN SMALL LETTER Y WITH DOT BELOW -\setXTXcharcodes "01EF6 "01EF7 "01EF6 % LATIN CAPITAL LETTER Y WITH HOOK ABOVE -\setXTXcharcodes "01EF7 "01EF7 "01EF6 % LATIN SMALL LETTER Y WITH HOOK ABOVE -\setXTXcharcodes "01EF8 "01EF9 "01EF8 % LATIN CAPITAL LETTER Y WITH TILDE -\setXTXcharcodes "01EF9 "01EF9 "01EF8 % LATIN SMALL LETTER Y WITH TILDE -\setXTXcharcodes "01F00 "01F00 "01F08 % GREEK SMALL LETTER ALPHA WITH PSILI -\setXTXcharcodes "01F01 "01F01 "01F09 % GREEK SMALL LETTER ALPHA WITH DASIA -\setXTXcharcodes "01F02 "01F02 "01F0A % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA -\setXTXcharcodes "01F03 "01F03 "01F0B % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA -\setXTXcharcodes "01F04 "01F04 "01F0C % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA -\setXTXcharcodes "01F05 "01F05 "01F0D % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA -\setXTXcharcodes "01F06 "01F06 "01F0E % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI -\setXTXcharcodes "01F07 "01F07 "01F0F % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F08 "01F00 "01F08 % GREEK CAPITAL LETTER ALPHA WITH PSILI -\setXTXcharcodes "01F09 "01F01 "01F09 % GREEK CAPITAL LETTER ALPHA WITH DASIA -\setXTXcharcodes "01F0A "01F02 "01F0A % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA -\setXTXcharcodes "01F0B "01F03 "01F0B % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA -\setXTXcharcodes "01F0C "01F04 "01F0C % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA -\setXTXcharcodes "01F0D "01F05 "01F0D % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA -\setXTXcharcodes "01F0E "01F06 "01F0E % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI -\setXTXcharcodes "01F0F "01F07 "01F0F % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F10 "01F10 "01F18 % GREEK SMALL LETTER EPSILON WITH PSILI -\setXTXcharcodes "01F11 "01F11 "01F19 % GREEK SMALL LETTER EPSILON WITH DASIA -\setXTXcharcodes "01F12 "01F12 "01F1A % GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA -\setXTXcharcodes "01F13 "01F13 "01F1B % GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA -\setXTXcharcodes "01F14 "01F14 "01F1C % GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA -\setXTXcharcodes "01F15 "01F15 "01F1D % GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA -\setXTXcharcodes "01F18 "01F10 "01F18 % GREEK CAPITAL LETTER EPSILON WITH PSILI -\setXTXcharcodes "01F19 "01F11 "01F19 % GREEK CAPITAL LETTER EPSILON WITH DASIA -\setXTXcharcodes "01F1A "01F12 "01F1A % GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA -\setXTXcharcodes "01F1B "01F13 "01F1B % GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA -\setXTXcharcodes "01F1C "01F14 "01F1C % GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA -\setXTXcharcodes "01F1D "01F15 "01F1D % GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA -\setXTXcharcodes "01F20 "01F20 "01F28 % GREEK SMALL LETTER ETA WITH PSILI -\setXTXcharcodes "01F21 "01F21 "01F29 % GREEK SMALL LETTER ETA WITH DASIA -\setXTXcharcodes "01F22 "01F22 "01F2A % GREEK SMALL LETTER ETA WITH PSILI AND VARIA -\setXTXcharcodes "01F23 "01F23 "01F2B % GREEK SMALL LETTER ETA WITH DASIA AND VARIA -\setXTXcharcodes "01F24 "01F24 "01F2C % GREEK SMALL LETTER ETA WITH PSILI AND OXIA -\setXTXcharcodes "01F25 "01F25 "01F2D % GREEK SMALL LETTER ETA WITH DASIA AND OXIA -\setXTXcharcodes "01F26 "01F26 "01F2E % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI -\setXTXcharcodes "01F27 "01F27 "01F2F % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F28 "01F20 "01F28 % GREEK CAPITAL LETTER ETA WITH PSILI -\setXTXcharcodes "01F29 "01F21 "01F29 % GREEK CAPITAL LETTER ETA WITH DASIA -\setXTXcharcodes "01F2A "01F22 "01F2A % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA -\setXTXcharcodes "01F2B "01F23 "01F2B % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA -\setXTXcharcodes "01F2C "01F24 "01F2C % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA -\setXTXcharcodes "01F2D "01F25 "01F2D % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA -\setXTXcharcodes "01F2E "01F26 "01F2E % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI -\setXTXcharcodes "01F2F "01F27 "01F2F % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F30 "01F30 "01F38 % GREEK SMALL LETTER IOTA WITH PSILI -\setXTXcharcodes "01F31 "01F31 "01F39 % GREEK SMALL LETTER IOTA WITH DASIA -\setXTXcharcodes "01F32 "01F32 "01F3A % GREEK SMALL LETTER IOTA WITH PSILI AND VARIA -\setXTXcharcodes "01F33 "01F33 "01F3B % GREEK SMALL LETTER IOTA WITH DASIA AND VARIA -\setXTXcharcodes "01F34 "01F34 "01F3C % GREEK SMALL LETTER IOTA WITH PSILI AND OXIA -\setXTXcharcodes "01F35 "01F35 "01F3D % GREEK SMALL LETTER IOTA WITH DASIA AND OXIA -\setXTXcharcodes "01F36 "01F36 "01F3E % GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI -\setXTXcharcodes "01F37 "01F37 "01F3F % GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F38 "01F30 "01F38 % GREEK CAPITAL LETTER IOTA WITH PSILI -\setXTXcharcodes "01F39 "01F31 "01F39 % GREEK CAPITAL LETTER IOTA WITH DASIA -\setXTXcharcodes "01F3A "01F32 "01F3A % GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA -\setXTXcharcodes "01F3B "01F33 "01F3B % GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA -\setXTXcharcodes "01F3C "01F34 "01F3C % GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA -\setXTXcharcodes "01F3D "01F35 "01F3D % GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA -\setXTXcharcodes "01F3E "01F36 "01F3E % GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI -\setXTXcharcodes "01F3F "01F37 "01F3F % GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F40 "01F40 "01F48 % GREEK SMALL LETTER OMICRON WITH PSILI -\setXTXcharcodes "01F41 "01F41 "01F49 % GREEK SMALL LETTER OMICRON WITH DASIA -\setXTXcharcodes "01F42 "01F42 "01F4A % GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA -\setXTXcharcodes "01F43 "01F43 "01F4B % GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA -\setXTXcharcodes "01F44 "01F44 "01F4C % GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA -\setXTXcharcodes "01F45 "01F45 "01F4D % GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA -\setXTXcharcodes "01F48 "01F40 "01F48 % GREEK CAPITAL LETTER OMICRON WITH PSILI -\setXTXcharcodes "01F49 "01F41 "01F49 % GREEK CAPITAL LETTER OMICRON WITH DASIA -\setXTXcharcodes "01F4A "01F42 "01F4A % GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA -\setXTXcharcodes "01F4B "01F43 "01F4B % GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA -\setXTXcharcodes "01F4C "01F44 "01F4C % GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA -\setXTXcharcodes "01F4D "01F45 "01F4D % GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA -\setXTXcharcodes "01F50 "01F50 "01F50 % GREEK SMALL LETTER UPSILON WITH PSILI -\setXTXcharcodes "01F51 "01F51 "01F59 % GREEK SMALL LETTER UPSILON WITH DASIA -\setXTXcharcodes "01F52 "01F52 "01F52 % GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA -\setXTXcharcodes "01F53 "01F53 "01F5B % GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA -\setXTXcharcodes "01F54 "01F54 "01F54 % GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA -\setXTXcharcodes "01F55 "01F55 "01F5D % GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA -\setXTXcharcodes "01F56 "01F56 "01F56 % GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI -\setXTXcharcodes "01F57 "01F57 "01F5F % GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F59 "01F51 "01F59 % GREEK CAPITAL LETTER UPSILON WITH DASIA -\setXTXcharcodes "01F5B "01F53 "01F5B % GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA -\setXTXcharcodes "01F5D "01F55 "01F5D % GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA -\setXTXcharcodes "01F5F "01F57 "01F5F % GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F60 "01F60 "01F68 % GREEK SMALL LETTER OMEGA WITH PSILI -\setXTXcharcodes "01F61 "01F61 "01F69 % GREEK SMALL LETTER OMEGA WITH DASIA -\setXTXcharcodes "01F62 "01F62 "01F6A % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA -\setXTXcharcodes "01F63 "01F63 "01F6B % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA -\setXTXcharcodes "01F64 "01F64 "01F6C % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA -\setXTXcharcodes "01F65 "01F65 "01F6D % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA -\setXTXcharcodes "01F66 "01F66 "01F6E % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI -\setXTXcharcodes "01F67 "01F67 "01F6F % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F68 "01F60 "01F68 % GREEK CAPITAL LETTER OMEGA WITH PSILI -\setXTXcharcodes "01F69 "01F61 "01F69 % GREEK CAPITAL LETTER OMEGA WITH DASIA -\setXTXcharcodes "01F6A "01F62 "01F6A % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA -\setXTXcharcodes "01F6B "01F63 "01F6B % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA -\setXTXcharcodes "01F6C "01F64 "01F6C % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA -\setXTXcharcodes "01F6D "01F65 "01F6D % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA -\setXTXcharcodes "01F6E "01F66 "01F6E % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI -\setXTXcharcodes "01F6F "01F67 "01F6F % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI -\setXTXcharcodes "01F70 "01F70 "01FBA % GREEK SMALL LETTER ALPHA WITH VARIA -\setXTXcharcodes "01F71 "01F71 "01FBB % GREEK SMALL LETTER ALPHA WITH OXIA -\setXTXcharcodes "01F72 "01F72 "01FC8 % GREEK SMALL LETTER EPSILON WITH VARIA -\setXTXcharcodes "01F73 "01F73 "01FC9 % GREEK SMALL LETTER EPSILON WITH OXIA -\setXTXcharcodes "01F74 "01F74 "01FCA % GREEK SMALL LETTER ETA WITH VARIA -\setXTXcharcodes "01F75 "01F75 "01FCB % GREEK SMALL LETTER ETA WITH OXIA -\setXTXcharcodes "01F76 "01F76 "01FDA % GREEK SMALL LETTER IOTA WITH VARIA -\setXTXcharcodes "01F77 "01F77 "01FDB % GREEK SMALL LETTER IOTA WITH OXIA -\setXTXcharcodes "01F78 "01F78 "01FF8 % GREEK SMALL LETTER OMICRON WITH VARIA -\setXTXcharcodes "01F79 "01F79 "01FF9 % GREEK SMALL LETTER OMICRON WITH OXIA -\setXTXcharcodes "01F7A "01F7A "01FEA % GREEK SMALL LETTER UPSILON WITH VARIA -\setXTXcharcodes "01F7B "01F7B "01FEB % GREEK SMALL LETTER UPSILON WITH OXIA -\setXTXcharcodes "01F7C "01F7C "01FFA % GREEK SMALL LETTER OMEGA WITH VARIA -\setXTXcharcodes "01F7D "01F7D "01FFB % GREEK SMALL LETTER OMEGA WITH OXIA -\setXTXcharcodes "01F80 "01F80 "01F88 % GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI -\setXTXcharcodes "01F81 "01F81 "01F89 % GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F82 "01F82 "01F8A % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F83 "01F83 "01F8B % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F84 "01F84 "01F8C % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F85 "01F85 "01F8D % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F86 "01F86 "01F8E % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -\setXTXcharcodes "01F87 "01F87 "01F8F % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -\setXTXcharcodes "01F88 "01F80 "01F88 % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI -\setXTXcharcodes "01F89 "01F81 "01F89 % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F8A "01F82 "01F8A % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F8B "01F83 "01F8B % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F8C "01F84 "01F8C % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F8D "01F85 "01F8D % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F8E "01F86 "01F8E % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -\setXTXcharcodes "01F8F "01F87 "01F8F % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -\setXTXcharcodes "01F90 "01F90 "01F98 % GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI -\setXTXcharcodes "01F91 "01F91 "01F99 % GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F92 "01F92 "01F9A % GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F93 "01F93 "01F9B % GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F94 "01F94 "01F9C % GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F95 "01F95 "01F9D % GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI -\setXTXcharcodes "01F96 "01F96 "01F9E % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -\setXTXcharcodes "01F97 "01F97 "01F9F % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -\setXTXcharcodes "01F98 "01F90 "01F98 % GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI -\setXTXcharcodes "01F99 "01F91 "01F99 % GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F9A "01F92 "01F9A % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F9B "01F93 "01F9B % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F9C "01F94 "01F9C % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F9D "01F95 "01F9D % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI -\setXTXcharcodes "01F9E "01F96 "01F9E % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -\setXTXcharcodes "01F9F "01F97 "01F9F % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -\setXTXcharcodes "01FA0 "01FA0 "01FA8 % GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI -\setXTXcharcodes "01FA1 "01FA1 "01FA9 % GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FA2 "01FA2 "01FAA % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FA3 "01FA3 "01FAB % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FA4 "01FA4 "01FAC % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FA5 "01FA5 "01FAD % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FA6 "01FA6 "01FAE % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -\setXTXcharcodes "01FA7 "01FA7 "01FAF % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -\setXTXcharcodes "01FA8 "01FA0 "01FA8 % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI -\setXTXcharcodes "01FA9 "01FA1 "01FA9 % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI -\setXTXcharcodes "01FAA "01FA2 "01FAA % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI -\setXTXcharcodes "01FAB "01FA3 "01FAB % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI -\setXTXcharcodes "01FAC "01FA4 "01FAC % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI -\setXTXcharcodes "01FAD "01FA5 "01FAD % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI -\setXTXcharcodes "01FAE "01FA6 "01FAE % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -\setXTXcharcodes "01FAF "01FA7 "01FAF % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -\setXTXcharcodes "01FB0 "01FB0 "01FB8 % GREEK SMALL LETTER ALPHA WITH VRACHY -\setXTXcharcodes "01FB1 "01FB1 "01FB9 % GREEK SMALL LETTER ALPHA WITH MACRON -\setXTXcharcodes "01FB2 "01FB2 "01FB2 % GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FB3 "01FB3 "01FBC % GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI -\setXTXcharcodes "01FB4 "01FB4 "01FB4 % GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FB6 "01FB6 "01FB6 % GREEK SMALL LETTER ALPHA WITH PERISPOMENI -\setXTXcharcodes "01FB7 "01FB7 "01FB7 % GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI -\setXTXcharcodes "01FB8 "01FB0 "01FB8 % GREEK CAPITAL LETTER ALPHA WITH VRACHY -\setXTXcharcodes "01FB9 "01FB1 "01FB9 % GREEK CAPITAL LETTER ALPHA WITH MACRON -\setXTXcharcodes "01FBA "01F70 "01FBA % GREEK CAPITAL LETTER ALPHA WITH VARIA -\setXTXcharcodes "01FBB "01F71 "01FBB % GREEK CAPITAL LETTER ALPHA WITH OXIA -\setXTXcharcodes "01FBC "01FB3 "01FBC % GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI -\setXTXcharcodes "01FBE "01FBE "00399 % GREEK PROSGEGRAMMENI -\setXTXcharcodes "01FC2 "01FC2 "01FC2 % GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FC3 "01FC3 "01FCC % GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI -\setXTXcharcodes "01FC4 "01FC4 "01FC4 % GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FC6 "01FC6 "01FC6 % GREEK SMALL LETTER ETA WITH PERISPOMENI -\setXTXcharcodes "01FC7 "01FC7 "01FC7 % GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI -\setXTXcharcodes "01FC8 "01F72 "01FC8 % GREEK CAPITAL LETTER EPSILON WITH VARIA -\setXTXcharcodes "01FC9 "01F73 "01FC9 % GREEK CAPITAL LETTER EPSILON WITH OXIA -\setXTXcharcodes "01FCA "01F74 "01FCA % GREEK CAPITAL LETTER ETA WITH VARIA -\setXTXcharcodes "01FCB "01F75 "01FCB % GREEK CAPITAL LETTER ETA WITH OXIA -\setXTXcharcodes "01FCC "01FC3 "01FCC % GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI -\setXTXcharcodes "01FD0 "01FD0 "01FD8 % GREEK SMALL LETTER IOTA WITH VRACHY -\setXTXcharcodes "01FD1 "01FD1 "01FD9 % GREEK SMALL LETTER IOTA WITH MACRON -\setXTXcharcodes "01FD2 "01FD2 "01FD2 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA -\setXTXcharcodes "01FD3 "01FD3 "01FD3 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA -\setXTXcharcodes "01FD6 "01FD6 "01FD6 % GREEK SMALL LETTER IOTA WITH PERISPOMENI -\setXTXcharcodes "01FD7 "01FD7 "01FD7 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI -\setXTXcharcodes "01FD8 "01FD0 "01FD8 % GREEK CAPITAL LETTER IOTA WITH VRACHY -\setXTXcharcodes "01FD9 "01FD1 "01FD9 % GREEK CAPITAL LETTER IOTA WITH MACRON -\setXTXcharcodes "01FDA "01F76 "01FDA % GREEK CAPITAL LETTER IOTA WITH VARIA -\setXTXcharcodes "01FDB "01F77 "01FDB % GREEK CAPITAL LETTER IOTA WITH OXIA -\setXTXcharcodes "01FE0 "01FE0 "01FE8 % GREEK SMALL LETTER UPSILON WITH VRACHY -\setXTXcharcodes "01FE1 "01FE1 "01FE9 % GREEK SMALL LETTER UPSILON WITH MACRON -\setXTXcharcodes "01FE2 "01FE2 "01FE2 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA -\setXTXcharcodes "01FE3 "01FE3 "01FE3 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA -\setXTXcharcodes "01FE4 "01FE4 "01FE4 % GREEK SMALL LETTER RHO WITH PSILI -\setXTXcharcodes "01FE5 "01FE5 "01FEC % GREEK SMALL LETTER RHO WITH DASIA -\setXTXcharcodes "01FE6 "01FE6 "01FE6 % GREEK SMALL LETTER UPSILON WITH PERISPOMENI -\setXTXcharcodes "01FE7 "01FE7 "01FE7 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI -\setXTXcharcodes "01FE8 "01FE0 "01FE8 % GREEK CAPITAL LETTER UPSILON WITH VRACHY -\setXTXcharcodes "01FE9 "01FE1 "01FE9 % GREEK CAPITAL LETTER UPSILON WITH MACRON -\setXTXcharcodes "01FEA "01F7A "01FEA % GREEK CAPITAL LETTER UPSILON WITH VARIA -\setXTXcharcodes "01FEB "01F7B "01FEB % GREEK CAPITAL LETTER UPSILON WITH OXIA -\setXTXcharcodes "01FEC "01FE5 "01FEC % GREEK CAPITAL LETTER RHO WITH DASIA -\setXTXcharcodes "01FF2 "01FF2 "01FF2 % GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FF3 "01FF3 "01FFC % GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI -\setXTXcharcodes "01FF4 "01FF4 "01FF4 % GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI -\setXTXcharcodes "01FF6 "01FF6 "01FF6 % GREEK SMALL LETTER OMEGA WITH PERISPOMENI -\setXTXcharcodes "01FF7 "01FF7 "01FF7 % GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI -\setXTXcharcodes "01FF8 "01F78 "01FF8 % GREEK CAPITAL LETTER OMICRON WITH VARIA -\setXTXcharcodes "01FF9 "01F79 "01FF9 % GREEK CAPITAL LETTER OMICRON WITH OXIA -\setXTXcharcodes "01FFA "01F7C "01FFA % GREEK CAPITAL LETTER OMEGA WITH VARIA -\setXTXcharcodes "01FFB "01F7D "01FFB % GREEK CAPITAL LETTER OMEGA WITH OXIA -\setXTXcharcodes "01FFC "01FF3 "01FFC % GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI -\setXTXcharcodes "02071 "02071 "02071 % SUPERSCRIPT LATIN SMALL LETTER I -\setXTXcharcodes "0207F "0207F "0207F % SUPERSCRIPT LATIN SMALL LETTER N -\setXTXcharcodes "02102 "02102 "02102 % DOUBLE-STRUCK CAPITAL C -\setXTXcharcodes "02107 "02107 "02107 % EULER CONSTANT -\setXTXcharcodes "0210A "0210A "0210A % SCRIPT SMALL G -\setXTXcharcodes "0210B "0210B "0210B % SCRIPT CAPITAL H -\setXTXcharcodes "0210C "0210C "0210C % BLACK-LETTER CAPITAL H -\setXTXcharcodes "0210D "0210D "0210D % DOUBLE-STRUCK CAPITAL H -\setXTXcharcodes "0210E "0210E "0210E % PLANCK CONSTANT -\setXTXcharcodes "0210F "0210F "0210F % PLANCK CONSTANT OVER TWO PI -\setXTXcharcodes "02110 "02110 "02110 % SCRIPT CAPITAL I -\setXTXcharcodes "02111 "02111 "02111 % BLACK-LETTER CAPITAL I -\setXTXcharcodes "02112 "02112 "02112 % SCRIPT CAPITAL L -\setXTXcharcodes "02113 "02113 "02113 % SCRIPT SMALL L -\setXTXcharcodes "02115 "02115 "02115 % DOUBLE-STRUCK CAPITAL N -\setXTXcharcodes "02119 "02119 "02119 % DOUBLE-STRUCK CAPITAL P -\setXTXcharcodes "0211A "0211A "0211A % DOUBLE-STRUCK CAPITAL Q -\setXTXcharcodes "0211B "0211B "0211B % SCRIPT CAPITAL R -\setXTXcharcodes "0211C "0211C "0211C % BLACK-LETTER CAPITAL R -\setXTXcharcodes "0211D "0211D "0211D % DOUBLE-STRUCK CAPITAL R -\setXTXcharcodes "02124 "02124 "02124 % DOUBLE-STRUCK CAPITAL Z -\setXTXcharcodes "02126 "003C9 "02126 % OHM SIGN -\setXTXcharcodes "02128 "02128 "02128 % BLACK-LETTER CAPITAL Z -\setXTXcharcodes "0212A "0006B "0212A % KELVIN SIGN -\setXTXcharcodes "0212B "000E5 "0212B % ANGSTROM SIGN -\setXTXcharcodes "0212C "0212C "0212C % SCRIPT CAPITAL B -\setXTXcharcodes "0212D "0212D "0212D % BLACK-LETTER CAPITAL C -\setXTXcharcodes "0212F "0212F "0212F % SCRIPT SMALL E -\setXTXcharcodes "02130 "02130 "02130 % SCRIPT CAPITAL E -\setXTXcharcodes "02131 "02131 "02131 % SCRIPT CAPITAL F -\setXTXcharcodes "02132 "0214E "02132 % TURNED CAPITAL F -\setXTXcharcodes "02133 "02133 "02133 % SCRIPT CAPITAL M -\setXTXcharcodes "02134 "02134 "02134 % SCRIPT SMALL O -\setXTXcharcodes "02139 "02139 "02139 % INFORMATION SOURCE -\setXTXcharcodes "0213C "0213C "0213C % DOUBLE-STRUCK SMALL PI -\setXTXcharcodes "0213D "0213D "0213D % DOUBLE-STRUCK SMALL GAMMA -\setXTXcharcodes "0213E "0213E "0213E % DOUBLE-STRUCK CAPITAL GAMMA -\setXTXcharcodes "0213F "0213F "0213F % DOUBLE-STRUCK CAPITAL PI -\setXTXcharcodes "02145 "02145 "02145 % DOUBLE-STRUCK ITALIC CAPITAL D -\setXTXcharcodes "02146 "02146 "02146 % DOUBLE-STRUCK ITALIC SMALL D -\setXTXcharcodes "02147 "02147 "02147 % DOUBLE-STRUCK ITALIC SMALL E -\setXTXcharcodes "02148 "02148 "02148 % DOUBLE-STRUCK ITALIC SMALL I -\setXTXcharcodes "02149 "02149 "02149 % DOUBLE-STRUCK ITALIC SMALL J -\setXTXcharcodes "0214E "0214E "02132 % TURNED SMALL F -\setXTXcharcodes "02183 "02184 "02183 % ROMAN NUMERAL REVERSED ONE HUNDRED -\setXTXcharcodes "02184 "02184 "02183 % LATIN SMALL LETTER REVERSED C -\setXTXcharcodes "02C00 "02C30 "02C00 % GLAGOLITIC CAPITAL LETTER AZU -\setXTXcharcodes "02C01 "02C31 "02C01 % GLAGOLITIC CAPITAL LETTER BUKY -\setXTXcharcodes "02C02 "02C32 "02C02 % GLAGOLITIC CAPITAL LETTER VEDE -\setXTXcharcodes "02C03 "02C33 "02C03 % GLAGOLITIC CAPITAL LETTER GLAGOLI -\setXTXcharcodes "02C04 "02C34 "02C04 % GLAGOLITIC CAPITAL LETTER DOBRO -\setXTXcharcodes "02C05 "02C35 "02C05 % GLAGOLITIC CAPITAL LETTER YESTU -\setXTXcharcodes "02C06 "02C36 "02C06 % GLAGOLITIC CAPITAL LETTER ZHIVETE -\setXTXcharcodes "02C07 "02C37 "02C07 % GLAGOLITIC CAPITAL LETTER DZELO -\setXTXcharcodes "02C08 "02C38 "02C08 % GLAGOLITIC CAPITAL LETTER ZEMLJA -\setXTXcharcodes "02C09 "02C39 "02C09 % GLAGOLITIC CAPITAL LETTER IZHE -\setXTXcharcodes "02C0A "02C3A "02C0A % GLAGOLITIC CAPITAL LETTER INITIAL IZHE -\setXTXcharcodes "02C0B "02C3B "02C0B % GLAGOLITIC CAPITAL LETTER I -\setXTXcharcodes "02C0C "02C3C "02C0C % GLAGOLITIC CAPITAL LETTER DJERVI -\setXTXcharcodes "02C0D "02C3D "02C0D % GLAGOLITIC CAPITAL LETTER KAKO -\setXTXcharcodes "02C0E "02C3E "02C0E % GLAGOLITIC CAPITAL LETTER LJUDIJE -\setXTXcharcodes "02C0F "02C3F "02C0F % GLAGOLITIC CAPITAL LETTER MYSLITE -\setXTXcharcodes "02C10 "02C40 "02C10 % GLAGOLITIC CAPITAL LETTER NASHI -\setXTXcharcodes "02C11 "02C41 "02C11 % GLAGOLITIC CAPITAL LETTER ONU -\setXTXcharcodes "02C12 "02C42 "02C12 % GLAGOLITIC CAPITAL LETTER POKOJI -\setXTXcharcodes "02C13 "02C43 "02C13 % GLAGOLITIC CAPITAL LETTER RITSI -\setXTXcharcodes "02C14 "02C44 "02C14 % GLAGOLITIC CAPITAL LETTER SLOVO -\setXTXcharcodes "02C15 "02C45 "02C15 % GLAGOLITIC CAPITAL LETTER TVRIDO -\setXTXcharcodes "02C16 "02C46 "02C16 % GLAGOLITIC CAPITAL LETTER UKU -\setXTXcharcodes "02C17 "02C47 "02C17 % GLAGOLITIC CAPITAL LETTER FRITU -\setXTXcharcodes "02C18 "02C48 "02C18 % GLAGOLITIC CAPITAL LETTER HERU -\setXTXcharcodes "02C19 "02C49 "02C19 % GLAGOLITIC CAPITAL LETTER OTU -\setXTXcharcodes "02C1A "02C4A "02C1A % GLAGOLITIC CAPITAL LETTER PE -\setXTXcharcodes "02C1B "02C4B "02C1B % GLAGOLITIC CAPITAL LETTER SHTA -\setXTXcharcodes "02C1C "02C4C "02C1C % GLAGOLITIC CAPITAL LETTER TSI -\setXTXcharcodes "02C1D "02C4D "02C1D % GLAGOLITIC CAPITAL LETTER CHRIVI -\setXTXcharcodes "02C1E "02C4E "02C1E % GLAGOLITIC CAPITAL LETTER SHA -\setXTXcharcodes "02C1F "02C4F "02C1F % GLAGOLITIC CAPITAL LETTER YERU -\setXTXcharcodes "02C20 "02C50 "02C20 % GLAGOLITIC CAPITAL LETTER YERI -\setXTXcharcodes "02C21 "02C51 "02C21 % GLAGOLITIC CAPITAL LETTER YATI -\setXTXcharcodes "02C22 "02C52 "02C22 % GLAGOLITIC CAPITAL LETTER SPIDERY HA -\setXTXcharcodes "02C23 "02C53 "02C23 % GLAGOLITIC CAPITAL LETTER YU -\setXTXcharcodes "02C24 "02C54 "02C24 % GLAGOLITIC CAPITAL LETTER SMALL YUS -\setXTXcharcodes "02C25 "02C55 "02C25 % GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL -\setXTXcharcodes "02C26 "02C56 "02C26 % GLAGOLITIC CAPITAL LETTER YO -\setXTXcharcodes "02C27 "02C57 "02C27 % GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS -\setXTXcharcodes "02C28 "02C58 "02C28 % GLAGOLITIC CAPITAL LETTER BIG YUS -\setXTXcharcodes "02C29 "02C59 "02C29 % GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS -\setXTXcharcodes "02C2A "02C5A "02C2A % GLAGOLITIC CAPITAL LETTER FITA -\setXTXcharcodes "02C2B "02C5B "02C2B % GLAGOLITIC CAPITAL LETTER IZHITSA -\setXTXcharcodes "02C2C "02C5C "02C2C % GLAGOLITIC CAPITAL LETTER SHTAPIC -\setXTXcharcodes "02C2D "02C5D "02C2D % GLAGOLITIC CAPITAL LETTER TROKUTASTI A -\setXTXcharcodes "02C2E "02C5E "02C2E % GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE -\setXTXcharcodes "02C30 "02C30 "02C00 % GLAGOLITIC SMALL LETTER AZU -\setXTXcharcodes "02C31 "02C31 "02C01 % GLAGOLITIC SMALL LETTER BUKY -\setXTXcharcodes "02C32 "02C32 "02C02 % GLAGOLITIC SMALL LETTER VEDE -\setXTXcharcodes "02C33 "02C33 "02C03 % GLAGOLITIC SMALL LETTER GLAGOLI -\setXTXcharcodes "02C34 "02C34 "02C04 % GLAGOLITIC SMALL LETTER DOBRO -\setXTXcharcodes "02C35 "02C35 "02C05 % GLAGOLITIC SMALL LETTER YESTU -\setXTXcharcodes "02C36 "02C36 "02C06 % GLAGOLITIC SMALL LETTER ZHIVETE -\setXTXcharcodes "02C37 "02C37 "02C07 % GLAGOLITIC SMALL LETTER DZELO -\setXTXcharcodes "02C38 "02C38 "02C08 % GLAGOLITIC SMALL LETTER ZEMLJA -\setXTXcharcodes "02C39 "02C39 "02C09 % GLAGOLITIC SMALL LETTER IZHE -\setXTXcharcodes "02C3A "02C3A "02C0A % GLAGOLITIC SMALL LETTER INITIAL IZHE -\setXTXcharcodes "02C3B "02C3B "02C0B % GLAGOLITIC SMALL LETTER I -\setXTXcharcodes "02C3C "02C3C "02C0C % GLAGOLITIC SMALL LETTER DJERVI -\setXTXcharcodes "02C3D "02C3D "02C0D % GLAGOLITIC SMALL LETTER KAKO -\setXTXcharcodes "02C3E "02C3E "02C0E % GLAGOLITIC SMALL LETTER LJUDIJE -\setXTXcharcodes "02C3F "02C3F "02C0F % GLAGOLITIC SMALL LETTER MYSLITE -\setXTXcharcodes "02C40 "02C40 "02C10 % GLAGOLITIC SMALL LETTER NASHI -\setXTXcharcodes "02C41 "02C41 "02C11 % GLAGOLITIC SMALL LETTER ONU -\setXTXcharcodes "02C42 "02C42 "02C12 % GLAGOLITIC SMALL LETTER POKOJI -\setXTXcharcodes "02C43 "02C43 "02C13 % GLAGOLITIC SMALL LETTER RITSI -\setXTXcharcodes "02C44 "02C44 "02C14 % GLAGOLITIC SMALL LETTER SLOVO -\setXTXcharcodes "02C45 "02C45 "02C15 % GLAGOLITIC SMALL LETTER TVRIDO -\setXTXcharcodes "02C46 "02C46 "02C16 % GLAGOLITIC SMALL LETTER UKU -\setXTXcharcodes "02C47 "02C47 "02C17 % GLAGOLITIC SMALL LETTER FRITU -\setXTXcharcodes "02C48 "02C48 "02C18 % GLAGOLITIC SMALL LETTER HERU -\setXTXcharcodes "02C49 "02C49 "02C19 % GLAGOLITIC SMALL LETTER OTU -\setXTXcharcodes "02C4A "02C4A "02C1A % GLAGOLITIC SMALL LETTER PE -\setXTXcharcodes "02C4B "02C4B "02C1B % GLAGOLITIC SMALL LETTER SHTA -\setXTXcharcodes "02C4C "02C4C "02C1C % GLAGOLITIC SMALL LETTER TSI -\setXTXcharcodes "02C4D "02C4D "02C1D % GLAGOLITIC SMALL LETTER CHRIVI -\setXTXcharcodes "02C4E "02C4E "02C1E % GLAGOLITIC SMALL LETTER SHA -\setXTXcharcodes "02C4F "02C4F "02C1F % GLAGOLITIC SMALL LETTER YERU -\setXTXcharcodes "02C50 "02C50 "02C20 % GLAGOLITIC SMALL LETTER YERI -\setXTXcharcodes "02C51 "02C51 "02C21 % GLAGOLITIC SMALL LETTER YATI -\setXTXcharcodes "02C52 "02C52 "02C22 % GLAGOLITIC SMALL LETTER SPIDERY HA -\setXTXcharcodes "02C53 "02C53 "02C23 % GLAGOLITIC SMALL LETTER YU -\setXTXcharcodes "02C54 "02C54 "02C24 % GLAGOLITIC SMALL LETTER SMALL YUS -\setXTXcharcodes "02C55 "02C55 "02C25 % GLAGOLITIC SMALL LETTER SMALL YUS WITH TAIL -\setXTXcharcodes "02C56 "02C56 "02C26 % GLAGOLITIC SMALL LETTER YO -\setXTXcharcodes "02C57 "02C57 "02C27 % GLAGOLITIC SMALL LETTER IOTATED SMALL YUS -\setXTXcharcodes "02C58 "02C58 "02C28 % GLAGOLITIC SMALL LETTER BIG YUS -\setXTXcharcodes "02C59 "02C59 "02C29 % GLAGOLITIC SMALL LETTER IOTATED BIG YUS -\setXTXcharcodes "02C5A "02C5A "02C2A % GLAGOLITIC SMALL LETTER FITA -\setXTXcharcodes "02C5B "02C5B "02C2B % GLAGOLITIC SMALL LETTER IZHITSA -\setXTXcharcodes "02C5C "02C5C "02C2C % GLAGOLITIC SMALL LETTER SHTAPIC -\setXTXcharcodes "02C5D "02C5D "02C2D % GLAGOLITIC SMALL LETTER TROKUTASTI A -\setXTXcharcodes "02C5E "02C5E "02C2E % GLAGOLITIC SMALL LETTER LATINATE MYSLITE -\setXTXcharcodes "02C60 "02C61 "02C60 % LATIN CAPITAL LETTER L WITH DOUBLE BAR -\setXTXcharcodes "02C61 "02C61 "02C60 % LATIN SMALL LETTER L WITH DOUBLE BAR -\setXTXcharcodes "02C62 "0026B "02C62 % LATIN CAPITAL LETTER L WITH MIDDLE TILDE -\setXTXcharcodes "02C63 "01D7D "02C63 % LATIN CAPITAL LETTER P WITH STROKE -\setXTXcharcodes "02C64 "0027D "02C64 % LATIN CAPITAL LETTER R WITH TAIL -\setXTXcharcodes "02C65 "02C65 "0023A % LATIN SMALL LETTER A WITH STROKE -\setXTXcharcodes "02C66 "02C66 "0023E % LATIN SMALL LETTER T WITH DIAGONAL STROKE -\setXTXcharcodes "02C67 "02C68 "02C67 % LATIN CAPITAL LETTER H WITH DESCENDER -\setXTXcharcodes "02C68 "02C68 "02C67 % LATIN SMALL LETTER H WITH DESCENDER -\setXTXcharcodes "02C69 "02C6A "02C69 % LATIN CAPITAL LETTER K WITH DESCENDER -\setXTXcharcodes "02C6A "02C6A "02C69 % LATIN SMALL LETTER K WITH DESCENDER -\setXTXcharcodes "02C6B "02C6C "02C6B % LATIN CAPITAL LETTER Z WITH DESCENDER -\setXTXcharcodes "02C6C "02C6C "02C6B % LATIN SMALL LETTER Z WITH DESCENDER -\setXTXcharcodes "02C74 "02C74 "02C74 % LATIN SMALL LETTER V WITH CURL -\setXTXcharcodes "02C75 "02C76 "02C75 % LATIN CAPITAL LETTER HALF H -\setXTXcharcodes "02C76 "02C76 "02C75 % LATIN SMALL LETTER HALF H -\setXTXcharcodes "02C77 "02C77 "02C77 % LATIN SMALL LETTER TAILLESS PHI -\setXTXcharcodes "02C80 "02C81 "02C80 % COPTIC CAPITAL LETTER ALFA -\setXTXcharcodes "02C81 "02C81 "02C80 % COPTIC SMALL LETTER ALFA -\setXTXcharcodes "02C82 "02C83 "02C82 % COPTIC CAPITAL LETTER VIDA -\setXTXcharcodes "02C83 "02C83 "02C82 % COPTIC SMALL LETTER VIDA -\setXTXcharcodes "02C84 "02C85 "02C84 % COPTIC CAPITAL LETTER GAMMA -\setXTXcharcodes "02C85 "02C85 "02C84 % COPTIC SMALL LETTER GAMMA -\setXTXcharcodes "02C86 "02C87 "02C86 % COPTIC CAPITAL LETTER DALDA -\setXTXcharcodes "02C87 "02C87 "02C86 % COPTIC SMALL LETTER DALDA -\setXTXcharcodes "02C88 "02C89 "02C88 % COPTIC CAPITAL LETTER EIE -\setXTXcharcodes "02C89 "02C89 "02C88 % COPTIC SMALL LETTER EIE -\setXTXcharcodes "02C8A "02C8B "02C8A % COPTIC CAPITAL LETTER SOU -\setXTXcharcodes "02C8B "02C8B "02C8A % COPTIC SMALL LETTER SOU -\setXTXcharcodes "02C8C "02C8D "02C8C % COPTIC CAPITAL LETTER ZATA -\setXTXcharcodes "02C8D "02C8D "02C8C % COPTIC SMALL LETTER ZATA -\setXTXcharcodes "02C8E "02C8F "02C8E % COPTIC CAPITAL LETTER HATE -\setXTXcharcodes "02C8F "02C8F "02C8E % COPTIC SMALL LETTER HATE -\setXTXcharcodes "02C90 "02C91 "02C90 % COPTIC CAPITAL LETTER THETHE -\setXTXcharcodes "02C91 "02C91 "02C90 % COPTIC SMALL LETTER THETHE -\setXTXcharcodes "02C92 "02C93 "02C92 % COPTIC CAPITAL LETTER IAUDA -\setXTXcharcodes "02C93 "02C93 "02C92 % COPTIC SMALL LETTER IAUDA -\setXTXcharcodes "02C94 "02C95 "02C94 % COPTIC CAPITAL LETTER KAPA -\setXTXcharcodes "02C95 "02C95 "02C94 % COPTIC SMALL LETTER KAPA -\setXTXcharcodes "02C96 "02C97 "02C96 % COPTIC CAPITAL LETTER LAULA -\setXTXcharcodes "02C97 "02C97 "02C96 % COPTIC SMALL LETTER LAULA -\setXTXcharcodes "02C98 "02C99 "02C98 % COPTIC CAPITAL LETTER MI -\setXTXcharcodes "02C99 "02C99 "02C98 % COPTIC SMALL LETTER MI -\setXTXcharcodes "02C9A "02C9B "02C9A % COPTIC CAPITAL LETTER NI -\setXTXcharcodes "02C9B "02C9B "02C9A % COPTIC SMALL LETTER NI -\setXTXcharcodes "02C9C "02C9D "02C9C % COPTIC CAPITAL LETTER KSI -\setXTXcharcodes "02C9D "02C9D "02C9C % COPTIC SMALL LETTER KSI -\setXTXcharcodes "02C9E "02C9F "02C9E % COPTIC CAPITAL LETTER O -\setXTXcharcodes "02C9F "02C9F "02C9E % COPTIC SMALL LETTER O -\setXTXcharcodes "02CA0 "02CA1 "02CA0 % COPTIC CAPITAL LETTER PI -\setXTXcharcodes "02CA1 "02CA1 "02CA0 % COPTIC SMALL LETTER PI -\setXTXcharcodes "02CA2 "02CA3 "02CA2 % COPTIC CAPITAL LETTER RO -\setXTXcharcodes "02CA3 "02CA3 "02CA2 % COPTIC SMALL LETTER RO -\setXTXcharcodes "02CA4 "02CA5 "02CA4 % COPTIC CAPITAL LETTER SIMA -\setXTXcharcodes "02CA5 "02CA5 "02CA4 % COPTIC SMALL LETTER SIMA -\setXTXcharcodes "02CA6 "02CA7 "02CA6 % COPTIC CAPITAL LETTER TAU -\setXTXcharcodes "02CA7 "02CA7 "02CA6 % COPTIC SMALL LETTER TAU -\setXTXcharcodes "02CA8 "02CA9 "02CA8 % COPTIC CAPITAL LETTER UA -\setXTXcharcodes "02CA9 "02CA9 "02CA8 % COPTIC SMALL LETTER UA -\setXTXcharcodes "02CAA "02CAB "02CAA % COPTIC CAPITAL LETTER FI -\setXTXcharcodes "02CAB "02CAB "02CAA % COPTIC SMALL LETTER FI -\setXTXcharcodes "02CAC "02CAD "02CAC % COPTIC CAPITAL LETTER KHI -\setXTXcharcodes "02CAD "02CAD "02CAC % COPTIC SMALL LETTER KHI -\setXTXcharcodes "02CAE "02CAF "02CAE % COPTIC CAPITAL LETTER PSI -\setXTXcharcodes "02CAF "02CAF "02CAE % COPTIC SMALL LETTER PSI -\setXTXcharcodes "02CB0 "02CB1 "02CB0 % COPTIC CAPITAL LETTER OOU -\setXTXcharcodes "02CB1 "02CB1 "02CB0 % COPTIC SMALL LETTER OOU -\setXTXcharcodes "02CB2 "02CB3 "02CB2 % COPTIC CAPITAL LETTER DIALECT-P ALEF -\setXTXcharcodes "02CB3 "02CB3 "02CB2 % COPTIC SMALL LETTER DIALECT-P ALEF -\setXTXcharcodes "02CB4 "02CB5 "02CB4 % COPTIC CAPITAL LETTER OLD COPTIC AIN -\setXTXcharcodes "02CB5 "02CB5 "02CB4 % COPTIC SMALL LETTER OLD COPTIC AIN -\setXTXcharcodes "02CB6 "02CB7 "02CB6 % COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE -\setXTXcharcodes "02CB7 "02CB7 "02CB6 % COPTIC SMALL LETTER CRYPTOGRAMMIC EIE -\setXTXcharcodes "02CB8 "02CB9 "02CB8 % COPTIC CAPITAL LETTER DIALECT-P KAPA -\setXTXcharcodes "02CB9 "02CB9 "02CB8 % COPTIC SMALL LETTER DIALECT-P KAPA -\setXTXcharcodes "02CBA "02CBB "02CBA % COPTIC CAPITAL LETTER DIALECT-P NI -\setXTXcharcodes "02CBB "02CBB "02CBA % COPTIC SMALL LETTER DIALECT-P NI -\setXTXcharcodes "02CBC "02CBD "02CBC % COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI -\setXTXcharcodes "02CBD "02CBD "02CBC % COPTIC SMALL LETTER CRYPTOGRAMMIC NI -\setXTXcharcodes "02CBE "02CBF "02CBE % COPTIC CAPITAL LETTER OLD COPTIC OOU -\setXTXcharcodes "02CBF "02CBF "02CBE % COPTIC SMALL LETTER OLD COPTIC OOU -\setXTXcharcodes "02CC0 "02CC1 "02CC0 % COPTIC CAPITAL LETTER SAMPI -\setXTXcharcodes "02CC1 "02CC1 "02CC0 % COPTIC SMALL LETTER SAMPI -\setXTXcharcodes "02CC2 "02CC3 "02CC2 % COPTIC CAPITAL LETTER CROSSED SHEI -\setXTXcharcodes "02CC3 "02CC3 "02CC2 % COPTIC SMALL LETTER CROSSED SHEI -\setXTXcharcodes "02CC4 "02CC5 "02CC4 % COPTIC CAPITAL LETTER OLD COPTIC SHEI -\setXTXcharcodes "02CC5 "02CC5 "02CC4 % COPTIC SMALL LETTER OLD COPTIC SHEI -\setXTXcharcodes "02CC6 "02CC7 "02CC6 % COPTIC CAPITAL LETTER OLD COPTIC ESH -\setXTXcharcodes "02CC7 "02CC7 "02CC6 % COPTIC SMALL LETTER OLD COPTIC ESH -\setXTXcharcodes "02CC8 "02CC9 "02CC8 % COPTIC CAPITAL LETTER AKHMIMIC KHEI -\setXTXcharcodes "02CC9 "02CC9 "02CC8 % COPTIC SMALL LETTER AKHMIMIC KHEI -\setXTXcharcodes "02CCA "02CCB "02CCA % COPTIC CAPITAL LETTER DIALECT-P HORI -\setXTXcharcodes "02CCB "02CCB "02CCA % COPTIC SMALL LETTER DIALECT-P HORI -\setXTXcharcodes "02CCC "02CCD "02CCC % COPTIC CAPITAL LETTER OLD COPTIC HORI -\setXTXcharcodes "02CCD "02CCD "02CCC % COPTIC SMALL LETTER OLD COPTIC HORI -\setXTXcharcodes "02CCE "02CCF "02CCE % COPTIC CAPITAL LETTER OLD COPTIC HA -\setXTXcharcodes "02CCF "02CCF "02CCE % COPTIC SMALL LETTER OLD COPTIC HA -\setXTXcharcodes "02CD0 "02CD1 "02CD0 % COPTIC CAPITAL LETTER L-SHAPED HA -\setXTXcharcodes "02CD1 "02CD1 "02CD0 % COPTIC SMALL LETTER L-SHAPED HA -\setXTXcharcodes "02CD2 "02CD3 "02CD2 % COPTIC CAPITAL LETTER OLD COPTIC HEI -\setXTXcharcodes "02CD3 "02CD3 "02CD2 % COPTIC SMALL LETTER OLD COPTIC HEI -\setXTXcharcodes "02CD4 "02CD5 "02CD4 % COPTIC CAPITAL LETTER OLD COPTIC HAT -\setXTXcharcodes "02CD5 "02CD5 "02CD4 % COPTIC SMALL LETTER OLD COPTIC HAT -\setXTXcharcodes "02CD6 "02CD7 "02CD6 % COPTIC CAPITAL LETTER OLD COPTIC GANGIA -\setXTXcharcodes "02CD7 "02CD7 "02CD6 % COPTIC SMALL LETTER OLD COPTIC GANGIA -\setXTXcharcodes "02CD8 "02CD9 "02CD8 % COPTIC CAPITAL LETTER OLD COPTIC DJA -\setXTXcharcodes "02CD9 "02CD9 "02CD8 % COPTIC SMALL LETTER OLD COPTIC DJA -\setXTXcharcodes "02CDA "02CDB "02CDA % COPTIC CAPITAL LETTER OLD COPTIC SHIMA -\setXTXcharcodes "02CDB "02CDB "02CDA % COPTIC SMALL LETTER OLD COPTIC SHIMA -\setXTXcharcodes "02CDC "02CDD "02CDC % COPTIC CAPITAL LETTER OLD NUBIAN SHIMA -\setXTXcharcodes "02CDD "02CDD "02CDC % COPTIC SMALL LETTER OLD NUBIAN SHIMA -\setXTXcharcodes "02CDE "02CDF "02CDE % COPTIC CAPITAL LETTER OLD NUBIAN NGI -\setXTXcharcodes "02CDF "02CDF "02CDE % COPTIC SMALL LETTER OLD NUBIAN NGI -\setXTXcharcodes "02CE0 "02CE1 "02CE0 % COPTIC CAPITAL LETTER OLD NUBIAN NYI -\setXTXcharcodes "02CE1 "02CE1 "02CE0 % COPTIC SMALL LETTER OLD NUBIAN NYI -\setXTXcharcodes "02CE2 "02CE3 "02CE2 % COPTIC CAPITAL LETTER OLD NUBIAN WAU -\setXTXcharcodes "02CE3 "02CE3 "02CE2 % COPTIC SMALL LETTER OLD NUBIAN WAU -\setXTXcharcodes "02CE4 "02CE4 "02CE4 % COPTIC SYMBOL KAI -\setXTXcharcodes "02D00 "02D00 "010A0 % GEORGIAN SMALL LETTER AN -\setXTXcharcodes "02D01 "02D01 "010A1 % GEORGIAN SMALL LETTER BAN -\setXTXcharcodes "02D02 "02D02 "010A2 % GEORGIAN SMALL LETTER GAN -\setXTXcharcodes "02D03 "02D03 "010A3 % GEORGIAN SMALL LETTER DON -\setXTXcharcodes "02D04 "02D04 "010A4 % GEORGIAN SMALL LETTER EN -\setXTXcharcodes "02D05 "02D05 "010A5 % GEORGIAN SMALL LETTER VIN -\setXTXcharcodes "02D06 "02D06 "010A6 % GEORGIAN SMALL LETTER ZEN -\setXTXcharcodes "02D07 "02D07 "010A7 % GEORGIAN SMALL LETTER TAN -\setXTXcharcodes "02D08 "02D08 "010A8 % GEORGIAN SMALL LETTER IN -\setXTXcharcodes "02D09 "02D09 "010A9 % GEORGIAN SMALL LETTER KAN -\setXTXcharcodes "02D0A "02D0A "010AA % GEORGIAN SMALL LETTER LAS -\setXTXcharcodes "02D0B "02D0B "010AB % GEORGIAN SMALL LETTER MAN -\setXTXcharcodes "02D0C "02D0C "010AC % GEORGIAN SMALL LETTER NAR -\setXTXcharcodes "02D0D "02D0D "010AD % GEORGIAN SMALL LETTER ON -\setXTXcharcodes "02D0E "02D0E "010AE % GEORGIAN SMALL LETTER PAR -\setXTXcharcodes "02D0F "02D0F "010AF % GEORGIAN SMALL LETTER ZHAR -\setXTXcharcodes "02D10 "02D10 "010B0 % GEORGIAN SMALL LETTER RAE -\setXTXcharcodes "02D11 "02D11 "010B1 % GEORGIAN SMALL LETTER SAN -\setXTXcharcodes "02D12 "02D12 "010B2 % GEORGIAN SMALL LETTER TAR -\setXTXcharcodes "02D13 "02D13 "010B3 % GEORGIAN SMALL LETTER UN -\setXTXcharcodes "02D14 "02D14 "010B4 % GEORGIAN SMALL LETTER PHAR -\setXTXcharcodes "02D15 "02D15 "010B5 % GEORGIAN SMALL LETTER KHAR -\setXTXcharcodes "02D16 "02D16 "010B6 % GEORGIAN SMALL LETTER GHAN -\setXTXcharcodes "02D17 "02D17 "010B7 % GEORGIAN SMALL LETTER QAR -\setXTXcharcodes "02D18 "02D18 "010B8 % GEORGIAN SMALL LETTER SHIN -\setXTXcharcodes "02D19 "02D19 "010B9 % GEORGIAN SMALL LETTER CHIN -\setXTXcharcodes "02D1A "02D1A "010BA % GEORGIAN SMALL LETTER CAN -\setXTXcharcodes "02D1B "02D1B "010BB % GEORGIAN SMALL LETTER JIL -\setXTXcharcodes "02D1C "02D1C "010BC % GEORGIAN SMALL LETTER CIL -\setXTXcharcodes "02D1D "02D1D "010BD % GEORGIAN SMALL LETTER CHAR -\setXTXcharcodes "02D1E "02D1E "010BE % GEORGIAN SMALL LETTER XAN -\setXTXcharcodes "02D1F "02D1F "010BF % GEORGIAN SMALL LETTER JHAN -\setXTXcharcodes "02D20 "02D20 "010C0 % GEORGIAN SMALL LETTER HAE -\setXTXcharcodes "02D21 "02D21 "010C1 % GEORGIAN SMALL LETTER HE -\setXTXcharcodes "02D22 "02D22 "010C2 % GEORGIAN SMALL LETTER HIE -\setXTXcharcodes "02D23 "02D23 "010C3 % GEORGIAN SMALL LETTER WE -\setXTXcharcodes "02D24 "02D24 "010C4 % GEORGIAN SMALL LETTER HAR -\setXTXcharcodes "02D25 "02D25 "010C5 % GEORGIAN SMALL LETTER HOE -\setXTXcharcodes "0FB00 "0FB00 "0FB00 % LATIN SMALL LIGATURE FF -\setXTXcharcodes "0FB01 "0FB01 "0FB01 % LATIN SMALL LIGATURE FI -\setXTXcharcodes "0FB02 "0FB02 "0FB02 % LATIN SMALL LIGATURE FL -\setXTXcharcodes "0FB03 "0FB03 "0FB03 % LATIN SMALL LIGATURE FFI -\setXTXcharcodes "0FB04 "0FB04 "0FB04 % LATIN SMALL LIGATURE FFL -\setXTXcharcodes "0FB05 "0FB05 "0FB05 % LATIN SMALL LIGATURE LONG S T -\setXTXcharcodes "0FB06 "0FB06 "0FB06 % LATIN SMALL LIGATURE ST -\setXTXcharcodes "0FB13 "0FB13 "0FB13 % ARMENIAN SMALL LIGATURE MEN NOW -\setXTXcharcodes "0FB14 "0FB14 "0FB14 % ARMENIAN SMALL LIGATURE MEN ECH -\setXTXcharcodes "0FB15 "0FB15 "0FB15 % ARMENIAN SMALL LIGATURE MEN INI -\setXTXcharcodes "0FB16 "0FB16 "0FB16 % ARMENIAN SMALL LIGATURE VEW NOW -\setXTXcharcodes "0FB17 "0FB17 "0FB17 % ARMENIAN SMALL LIGATURE MEN XEH -\setXTXcharcodes "0FF21 "0FF41 "0FF21 % FULLWIDTH LATIN CAPITAL LETTER A -\setXTXcharcodes "0FF22 "0FF42 "0FF22 % FULLWIDTH LATIN CAPITAL LETTER B -\setXTXcharcodes "0FF23 "0FF43 "0FF23 % FULLWIDTH LATIN CAPITAL LETTER C -\setXTXcharcodes "0FF24 "0FF44 "0FF24 % FULLWIDTH LATIN CAPITAL LETTER D -\setXTXcharcodes "0FF25 "0FF45 "0FF25 % FULLWIDTH LATIN CAPITAL LETTER E -\setXTXcharcodes "0FF26 "0FF46 "0FF26 % FULLWIDTH LATIN CAPITAL LETTER F -\setXTXcharcodes "0FF27 "0FF47 "0FF27 % FULLWIDTH LATIN CAPITAL LETTER G -\setXTXcharcodes "0FF28 "0FF48 "0FF28 % FULLWIDTH LATIN CAPITAL LETTER H -\setXTXcharcodes "0FF29 "0FF49 "0FF29 % FULLWIDTH LATIN CAPITAL LETTER I -\setXTXcharcodes "0FF2A "0FF4A "0FF2A % FULLWIDTH LATIN CAPITAL LETTER J -\setXTXcharcodes "0FF2B "0FF4B "0FF2B % FULLWIDTH LATIN CAPITAL LETTER K -\setXTXcharcodes "0FF2C "0FF4C "0FF2C % FULLWIDTH LATIN CAPITAL LETTER L -\setXTXcharcodes "0FF2D "0FF4D "0FF2D % FULLWIDTH LATIN CAPITAL LETTER M -\setXTXcharcodes "0FF2E "0FF4E "0FF2E % FULLWIDTH LATIN CAPITAL LETTER N -\setXTXcharcodes "0FF2F "0FF4F "0FF2F % FULLWIDTH LATIN CAPITAL LETTER O -\setXTXcharcodes "0FF30 "0FF50 "0FF30 % FULLWIDTH LATIN CAPITAL LETTER P -\setXTXcharcodes "0FF31 "0FF51 "0FF31 % FULLWIDTH LATIN CAPITAL LETTER Q -\setXTXcharcodes "0FF32 "0FF52 "0FF32 % FULLWIDTH LATIN CAPITAL LETTER R -\setXTXcharcodes "0FF33 "0FF53 "0FF33 % FULLWIDTH LATIN CAPITAL LETTER S -\setXTXcharcodes "0FF34 "0FF54 "0FF34 % FULLWIDTH LATIN CAPITAL LETTER T -\setXTXcharcodes "0FF35 "0FF55 "0FF35 % FULLWIDTH LATIN CAPITAL LETTER U -\setXTXcharcodes "0FF36 "0FF56 "0FF36 % FULLWIDTH LATIN CAPITAL LETTER V -\setXTXcharcodes "0FF37 "0FF57 "0FF37 % FULLWIDTH LATIN CAPITAL LETTER W -\setXTXcharcodes "0FF38 "0FF58 "0FF38 % FULLWIDTH LATIN CAPITAL LETTER X -\setXTXcharcodes "0FF39 "0FF59 "0FF39 % FULLWIDTH LATIN CAPITAL LETTER Y -\setXTXcharcodes "0FF3A "0FF5A "0FF3A % FULLWIDTH LATIN CAPITAL LETTER Z -\setXTXcharcodes "0FF41 "0FF41 "0FF21 % FULLWIDTH LATIN SMALL LETTER A -\setXTXcharcodes "0FF42 "0FF42 "0FF22 % FULLWIDTH LATIN SMALL LETTER B -\setXTXcharcodes "0FF43 "0FF43 "0FF23 % FULLWIDTH LATIN SMALL LETTER C -\setXTXcharcodes "0FF44 "0FF44 "0FF24 % FULLWIDTH LATIN SMALL LETTER D -\setXTXcharcodes "0FF45 "0FF45 "0FF25 % FULLWIDTH LATIN SMALL LETTER E -\setXTXcharcodes "0FF46 "0FF46 "0FF26 % FULLWIDTH LATIN SMALL LETTER F -\setXTXcharcodes "0FF47 "0FF47 "0FF27 % FULLWIDTH LATIN SMALL LETTER G -\setXTXcharcodes "0FF48 "0FF48 "0FF28 % FULLWIDTH LATIN SMALL LETTER H -\setXTXcharcodes "0FF49 "0FF49 "0FF29 % FULLWIDTH LATIN SMALL LETTER I -\setXTXcharcodes "0FF4A "0FF4A "0FF2A % FULLWIDTH LATIN SMALL LETTER J -\setXTXcharcodes "0FF4B "0FF4B "0FF2B % FULLWIDTH LATIN SMALL LETTER K -\setXTXcharcodes "0FF4C "0FF4C "0FF2C % FULLWIDTH LATIN SMALL LETTER L -\setXTXcharcodes "0FF4D "0FF4D "0FF2D % FULLWIDTH LATIN SMALL LETTER M -\setXTXcharcodes "0FF4E "0FF4E "0FF2E % FULLWIDTH LATIN SMALL LETTER N -\setXTXcharcodes "0FF4F "0FF4F "0FF2F % FULLWIDTH LATIN SMALL LETTER O -\setXTXcharcodes "0FF50 "0FF50 "0FF30 % FULLWIDTH LATIN SMALL LETTER P -\setXTXcharcodes "0FF51 "0FF51 "0FF31 % FULLWIDTH LATIN SMALL LETTER Q -\setXTXcharcodes "0FF52 "0FF52 "0FF32 % FULLWIDTH LATIN SMALL LETTER R -\setXTXcharcodes "0FF53 "0FF53 "0FF33 % FULLWIDTH LATIN SMALL LETTER S -\setXTXcharcodes "0FF54 "0FF54 "0FF34 % FULLWIDTH LATIN SMALL LETTER T -\setXTXcharcodes "0FF55 "0FF55 "0FF35 % FULLWIDTH LATIN SMALL LETTER U -\setXTXcharcodes "0FF56 "0FF56 "0FF36 % FULLWIDTH LATIN SMALL LETTER V -\setXTXcharcodes "0FF57 "0FF57 "0FF37 % FULLWIDTH LATIN SMALL LETTER W -\setXTXcharcodes "0FF58 "0FF58 "0FF38 % FULLWIDTH LATIN SMALL LETTER X -\setXTXcharcodes "0FF59 "0FF59 "0FF39 % FULLWIDTH LATIN SMALL LETTER Y -\setXTXcharcodes "0FF5A "0FF5A "0FF3A % FULLWIDTH LATIN SMALL LETTER Z - -\dofastrecurse{"03400}{"04DB5}{1}{\dosetXTXcharcodes\recurselevel\recurselevel\recurselevel} -\dofastrecurse{"04E00}{"09FBB}{1}{\dosetXTXcharcodes\recurselevel\recurselevel\recurselevel} -\dofastrecurse{"0AC00}{"0D7A3}{1}{\dosetXTXcharcodes\recurselevel\recurselevel\recurselevel} -\dofastrecurse{"20000}{"2A6D6}{1}{\dosetXTXcharcodes\recurselevel\recurselevel\recurselevel} - -% patch needed for turkish - -\setXTXcharcodes "201C "201C "201C -\setXTXcharcodes "201D "201D "201D - -\endinput diff --git a/tex/context/base/xtag-exp.tex b/tex/context/base/xtag-exp.tex index 72e956199..337b49348 100644 --- a/tex/context/base/xtag-exp.tex +++ b/tex/context/base/xtag-exp.tex @@ -37,12 +37,19 @@ \fi \decrement \XMLfilenesting \relax} -\def\enableXMLfiledata - {\prependtoks \enableXMLelements \to \mainoutput % brrr, will change - \appendtoks \startXMLreading \to \everybeforeutilityread - \appendtoks \stopXMLreading \to \everyafterutilityread - \appendtoks \forcefileexpansiontrue \to \everyenableXML - \let\enableXMLfiledata\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] @@ -52,26 +59,30 @@ %D Here we overload the mark handler. -\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}} +\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.tex b/tex/context/base/xtag-ext.tex index 1a9e3e058..9a132c677 100644 --- a/tex/context/base/xtag-ext.tex +++ b/tex/context/base/xtag-ext.tex @@ -382,6 +382,8 @@ % \processXMLfilegrouped{test.xml} % \stoptext +% obsolete in mkiv + \chardef\xmlexpandmode\plusone \def\defexpandedxmlargumentcmd {\chardef\xmlexpandmode\plusone\defexpandedxmlargument\defconvertedcommand} @@ -392,7 +394,7 @@ \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} @@ -403,4 +405,35 @@ % % \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.tex b/tex/context/base/xtag-hyp.tex index 573b546c7..e4e048e2b 100644 --- a/tex/context/base/xtag-hyp.tex +++ b/tex/context/base/xtag-hyp.tex @@ -16,13 +16,21 @@ %D This filter is kind of obsolete, since \UTF\ is not %D limited to \XML. So, here we only enable \UTF\ support. -\defineXMLenvironment [hyphenations] [language=\currentlanguage,regime=utf,encoding=\defaultencoding] - {\startnointerference - \defineXMLargument [hyphenation] \hyphenation - \language[\XMLop{language}]% - \enableregime[\XMLop{regime}]% - \enableencoding[\XMLop{encoding}]} - {\stopnointerference} +\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] {\-} diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex index 495f4ea07..e48ef3da6 100644 --- a/tex/context/base/xtag-ini.tex +++ b/tex/context/base/xtag-ini.tex @@ -1275,9 +1275,14 @@ \def\simpleXMLencoding{raw} -\def\simplifyXMLentities - {\fastenableencoding\simpleXMLencoding - \XMLsimpleentitiestrue} +\ifnum\texengine=\luatexengine + \def\simplifyXMLentities + {\XMLsimpleentitiestrue} +\else + \def\simplifyXMLentities + {\fastenableencoding\simpleXMLencoding + \XMLsimpleentitiestrue} +\fi \def\defineXMLentity {\dodoubleempty\dodefineXMLentity} @@ -2181,7 +2186,7 @@ %D Interesting what kind of things are needed \unknown \appendtoks - \disablelanguagespecifics + \ifdefined\disablelanguagespecifics\disablelanguagespecifics\fi \to \everyenableXML \long\def\longempty{} diff --git a/tex/context/base/xtag-pre.tex b/tex/context/base/xtag-pre.tex index 3f1d4dca0..94a213d94 100644 --- a/tex/context/base/xtag-pre.tex +++ b/tex/context/base/xtag-pre.tex @@ -37,8 +37,13 @@ %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} +% \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. diff --git a/tex/context/bib/bibl-ams.tex b/tex/context/bib/bibl-ams.tex index ddfe927c3..77008a66b 100644 --- a/tex/context/bib/bibl-ams.tex +++ b/tex/context/bib/bibl-ams.tex @@ -282,30 +282,30 @@ } \setuppublicationlayout[incollection]{% - \insertartauthors{}{}{\insertthekey{}{, }{}}% -% \insertarttitle{\bgroup }{\egroup. }{}% - \inserttitle - {, in % - \bgroup\it}% - {\egroup - \inserteditors{, edited by }% - {}% - {} - \insertseries - {\insertvolume{, number }{~in }{ }}% - {}% - {}% - \insertchap{\unskip, }{ }{ }% - \insertpubyear{(% - \insertpublisher{}%{, }%{}% - }{)\insertEdition{, }{ ed. }{}}{}% - \insertpages{\unskip, p.~}{. }{\unskip. }% - }% - {In \insertcrossref{}{}{}% - \insertchap{\unskip, }{ }{ }% - \insertpages{\unskip, p.~}{. }{\unskip. }% - }% - \insertNote{ }{.}{}% + \insertartauthors{}{}{\insertthekey{}{, }{}}% + \insertarttitle{, \bgroup }{\egroup}{}% + \inserttitle + {, in % + \bgroup\it}% + {\egroup + \inserteditors{, edited by }% + {}% + {} + \insertseries + {\insertvolume{, number }{~in }{ }}% + {}% + {}% + \insertchap{\unskip, }{ }{ }% + \insertpubyear{(% + \insertpublisher{}%{, }%{}% + }{)\insertEdition{, }{ ed. }{}}{}% + \insertpages{\unskip, p.~}{. }{\unskip. }% + }% + {In \insertcrossref{}{}{}% + \insertchap{\unskip, }{ }{ }% + \insertpages{\unskip, p.~}{. }{\unskip. }% + }% + \insertNote{ }{.}{}% } \setuppublicationlayout[inproceedings]{% diff --git a/tex/context/bib/t-bib.mkiv b/tex/context/bib/t-bib.mkiv index 4316d380e..9a01bc7cd 100644 --- a/tex/context/bib/t-bib.mkiv +++ b/tex/context/bib/t-bib.mkiv @@ -18,8 +18,6 @@ bibtexhacks = { } \stopluacode -\unprotect - % HACK WILL GO: \def\namedlistparameter#1#2{\csname\dolistparameter{\??li#1}#2\endcsname} diff --git a/tex/context/bib/t-bib.tex b/tex/context/bib/t-bib.tex index 35a3de6ca..05b2d0b3e 100644 --- a/tex/context/bib/t-bib.tex +++ b/tex/context/bib/t-bib.tex @@ -1,6 +1,6 @@ %D \module %D [ file=t-bib, -%D version=2009.04.27, +%D version=2009.06.08, %D title=\CONTEXT\ Publication Module, %D subtitle=Publications, %D author=Taco Hoekwater, @@ -133,6 +133,8 @@ %D \item Added a patch to \type{t-bib.mkiv} from Hans to make the %D cross referencing between multiple citations an %D bibliographies work (27/04/2009) +%D \item Remove a superfluous \type{\unprotect} in t-bib.mkiv (11/05/2009). +%D \item Patch of incollection in bibl-ams.tex from Xan (08/06/2009). %D \stopitemize %D %D \subject{WISHLIST} diff --git a/tex/context/interface/cont-cs.xml b/tex/context/interface/cont-cs.xml index 15700ee08..a94af8caf 100644 --- a/tex/context/interface/cont-cs.xml +++ b/tex/context/interface/cont-cs.xml @@ -5356,6 +5356,9 @@ + + + diff --git a/tex/context/interface/cont-de.xml b/tex/context/interface/cont-de.xml index ace1fb315..b70518625 100644 --- a/tex/context/interface/cont-de.xml +++ b/tex/context/interface/cont-de.xml @@ -5356,6 +5356,9 @@ + + + diff --git a/tex/context/interface/cont-en.xml b/tex/context/interface/cont-en.xml index 6e3ac4db7..354bdab81 100644 --- a/tex/context/interface/cont-en.xml +++ b/tex/context/interface/cont-en.xml @@ -5356,6 +5356,9 @@ + + + diff --git a/tex/context/interface/cont-fr.xml b/tex/context/interface/cont-fr.xml index bd14281c9..bdec329eb 100644 --- a/tex/context/interface/cont-fr.xml +++ b/tex/context/interface/cont-fr.xml @@ -5356,6 +5356,9 @@ + + + diff --git a/tex/context/interface/cont-it.xml b/tex/context/interface/cont-it.xml index 47ec1ffdd..e0f77e265 100644 --- a/tex/context/interface/cont-it.xml +++ b/tex/context/interface/cont-it.xml @@ -5356,6 +5356,9 @@ + + + diff --git a/tex/context/interface/cont-nl.xml b/tex/context/interface/cont-nl.xml index df538ad8f..d6a236795 100644 --- a/tex/context/interface/cont-nl.xml +++ b/tex/context/interface/cont-nl.xml @@ -5356,6 +5356,9 @@ + + + diff --git a/tex/context/interface/cont-pe.xml b/tex/context/interface/cont-pe.xml index df7d55387..c2e43dc32 100644 --- a/tex/context/interface/cont-pe.xml +++ b/tex/context/interface/cont-pe.xml @@ -5356,6 +5356,9 @@ + + + diff --git a/tex/context/interface/cont-ro.xml b/tex/context/interface/cont-ro.xml index 726c3f272..61dd00f59 100644 --- a/tex/context/interface/cont-ro.xml +++ b/tex/context/interface/cont-ro.xml @@ -5356,6 +5356,9 @@ + + + diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml index 40d1aa60d..352245d6b 100644 --- a/tex/context/interface/keys-cs.xml +++ b/tex/context/interface/keys-cs.xml @@ -236,6 +236,7 @@ + @@ -849,6 +850,7 @@ + diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index 7bada6e26..521a731c6 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -236,6 +236,7 @@ + @@ -849,6 +850,7 @@ + diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 18a56ac76..2b7c68915 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -236,6 +236,7 @@ + @@ -849,6 +850,7 @@ + diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index aaba0e4cb..d03d72a88 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -236,6 +236,7 @@ + @@ -849,6 +850,7 @@ + diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index 5f3ef93e4..b2c01b916 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -236,6 +236,7 @@ + @@ -849,6 +850,7 @@ + diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index 52e98c157..9bb953e9b 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -236,6 +236,7 @@ + @@ -849,6 +850,7 @@ + diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml index b0771b5b0..0086e5d13 100644 --- a/tex/context/interface/keys-pe.xml +++ b/tex/context/interface/keys-pe.xml @@ -236,6 +236,7 @@ + @@ -849,6 +850,7 @@ + diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index bc55773b4..964c8a714 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -236,6 +236,7 @@ + @@ -849,6 +850,7 @@ + diff --git a/tex/context/sample/demo-cld.cld b/tex/context/sample/demo-cld.cld new file mode 100644 index 000000000..7e470da62 --- /dev/null +++ b/tex/context/sample/demo-cld.cld @@ -0,0 +1,74 @@ +-- context.enabletrackers {"tud.trace"} + +context.setuplayout( { + width = "middle", + height = "middle", +}) + +context.showframe() + +context.starttext() + +context.chapter({ "someref" }, "Hello There") + +context.readfile("tufte","","not found") + +context.startitemize({ "packed" }) + for i=1,10 do + context.startitem() + context("this is item %i",i) + context.stopitem() + end +context.stopitemize() + +context.startchapter({ title = "test" }, { more = "oeps" }) + + context["in"]("chapter",{ "someref" }) + + context.startlinecorrection( { "blank" }) + context.bTABLE() + for i=1,10 do + context.bTR() + for i=1,20 do + context.bTD({ align= "middle", style = "type" }) + context("%#2i",math.random(99)) + context.eTD() + end + context.eTR() + end + context.eTABLE() + context.stoplinecorrection() + + context.mathematics("x^{2 \\times 4}") + + context.placefigure("caption", function() + context.externalfigure( { "cow.pdf" } ) + end) + + context.placefigure("caption", function() + context.bTABLE() + context.bTR() + context.bTD() + context.externalfigure( { "cow.pdf" }, { width = "3cm", height = "3cm" } ) + context.eTD() + context.bTD({ align = "{lohi,middle}" } ) + context("and") + context.eTD() + context.bTD() + context.externalfigure( { "cow.pdf" }, { width = "4cm", height = "3cm" } ) + context.eTD() + context.eTR() + context.eTABLE() + end) + +context.stopchapter() + +context.chapter("Speed Test 1") + +for i=1,50 do + context.readfile("tufte","","not found") + context.par() +end + +context.stoptext() + diff --git a/tex/context/sample/sample.tex b/tex/context/sample/sample.tex index f39c328ee..d54d8b747 100644 --- a/tex/context/sample/sample.tex +++ b/tex/context/sample/sample.tex @@ -40,12 +40,15 @@ used in testing bibliographic references and citations. Thomas Dunne Books, 2007, p.160 \NC \NR \NC montgomery.tex \NC David R Montgomery \NC Dirt, The Erosion of Civilizations, \endgraf University of California Press, 2007, p.199 \NC \NR +\NC carrol.tex \NC Sean B. Carrol \NC The Making of the Fittest, \endgraf + Quercus, London, 2006 \NC \NR \stoptabulate % Tufte: This quote will always produce hyphenated text, apart from the content, % it's a pretty good test case for protruding. -% Ward: I should find a quote in the extremely well written Rare Earth as well. +% Ward: I should find a quote in the extremely well written Rare Earth as well. All Wards +% books excell. % A Short History of Nearly Everything: I wish that I had the memory to remember this book % verbatim. @@ -62,4 +65,7 @@ used in testing bibliographic references and citations. % Dirt, The Erosion of Civilizations: one of those books that you buy immediately after % reading a few sentences. Also one of those books that every politician should read. +% The Making of the Fittest: nice sample for color ans subsentence testing. A very +% readable book but unfortunately it has inter-character spacing. + \stoptext diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 1726750f1..e369b6746 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua --- merge date : 06/13/09 14:05:57 +-- merge date : 07/17/09 13:18:01 do -- begin closure to overcome local limits and interference @@ -1138,7 +1138,7 @@ function table.insert_after_value(t,value,str) end local function are_equal(a,b,n,m) -- indexed - if #a == #b then + if a and b and #a == #b then n = n or 1 m = m or #a for i=n,m do @@ -2033,7 +2033,6 @@ local whatsit = node.id('whatsit') local traverse_id = node.traverse_id local traverse = node.traverse -local slide_nodes = node.slide local free_node = node.free local remove_node = node.remove @@ -2055,10 +2054,10 @@ function nodes.delete(head,current) return nodes.remove(head,current,true) end -nodes.before = node.insert_before -- broken +nodes.before = node.insert_before nodes.after = node.insert_after --- we need to test this, as it might be fixed +-- we need to test this, as it might be fixed now function nodes.before(h,c,n) if c then @@ -2168,7 +2167,7 @@ if not modules then modules = { } end modules ['node-res'] = { } local gmatch, format = string.gmatch, string.format -local copy_node, free_node, new_node = node.copy, node.free, node.new +local copy_node, free_node, free_list, new_node = node.copy, node.free, node.flush_list, node.new --[[ldx--

The next function is not that much needed but in we use @@ -2212,7 +2211,6 @@ function nodes.usage() return t end -local pdfliteral = nodes.register(new_node("whatsit",8)) pdfliteral.mode = 1 local disc = nodes.register(new_node("disc")) local kern = nodes.register(new_node("kern",1)) local penalty = nodes.register(new_node("penalty")) @@ -2221,6 +2219,7 @@ local glue_spec = nodes.register(new_node("glue_spec")) local glyph = nodes.register(new_node("glyph",0)) local textdir = nodes.register(new_node("whatsit",7)) local rule = nodes.register(new_node("rule")) +local latelua = nodes.register(new_node("whatsit",35)) function nodes.glyph(fnt,chr) local n = copy_node(glyph) @@ -2252,11 +2251,6 @@ end function nodes.disc() return copy_node(disc) end -function nodes.pdfliteral(str) - local t = copy_node(pdfliteral) - t.data = str - return t -end function nodes.textdir(dir) local t = copy_node(textdir) t.dir = dir @@ -2269,6 +2263,11 @@ function nodes.rule(w,h,d) if d then n.depth = d end return n end +function nodes.latelua(code) + local n = copy_node(latelua) + n.data = code + return n +end statistics.register("cleaned up reserved nodes", function() return format("%s nodes, %s lists of %s", nodes.cleanup_reserved(tex.count["lastallocatedbox"])) @@ -2398,7 +2397,7 @@ end function nodes.trace_injection(head) local function dir(n) - return (n<0 and "r-to-l") or (n>0 and "l-to-r") or ("unset") + return (n and n<0 and "r-to-l") or (n and n>0 and "l-to-r") or ("unset") end local function report(...) logs.report("nodes finisher",...) @@ -2416,9 +2415,9 @@ function nodes.trace_injection(head) if kp then local k = kerns[kp] if k[3] then - report(" pairkern: dir=%s, x=%s, y=%s, w=%s, h=%s",dir(k[1]),k[2],k[3],k[4],k[5]) + report(" pairkern: dir=%s, x=%s, y=%s, w=%s, h=%s",dir(k[1]),k[2] or "?",k[3] or "?",k[4] or "?",k[5] or "?") else - report(" kern: dir=%s, dx=%s",dir(k[1]),k[2]) + report(" kern: dir=%s, dx=%s",dir(k[1]),k[2] or "?") end end if mb then @@ -2429,13 +2428,13 @@ function nodes.trace_injection(head) if mb then local m = m[mb] if m then - report(" markmark: bound=%s, index=%s, dx=%s, dy=%s",mm,j,m[1],m[2]) + report(" markmark: bound=%s, index=%s, dx=%s, dy=%s",mm,md or "?",m[1] or "?",m[2] or "?") else report(" markmark: bound=%s, missing index",mm) end else m = m[1] - report(" markmark: bound=%s, dx=%s, dy=%s",mm,m[1],m[2]) + report(" markmark: bound=%s, dx=%s, dy=%s",mm,m[1] or "?",m[2] or "?") end end if cb then @@ -2443,7 +2442,7 @@ function nodes.trace_injection(head) end if cc then local c = cursives[cc] - report(" curscurs: bound=%s, dir=%s, dx=%s, dy=%s",cc,dir(c[1]),c[2],c[3]) + report(" curscurs: bound=%s, dir=%s, dx=%s, dy=%s",cc,dir(c[1]),c[2] or "?",c[3] or "?") end end end @@ -2452,18 +2451,24 @@ end -- todo: reuse tables (i.e. no collection), but will be extra fields anyway -function nodes.inject_kerns(head,tail,where,keep) - if trace_injections then - nodes.trace_injection(head) - end +function nodes.inject_kerns(head,where,keep) local has_marks, has_cursives, has_kerns = next(marks), next(cursives), next(kerns) if has_marks or has_cursives then + if trace_injections then + nodes.trace_injection(head) + end -- in the future variant we will not copy items but refs to tables - local done, ky, rl, valid, cx, wx = false, { }, { }, { }, { }, { } + local done, ky, rl, valid, cx, wx, mk = false, { }, { }, { }, { }, { }, { } if has_kerns then -- move outside loop + local nf, tm = nil, nil for n in traverse_id(glyph,head) do if n.subtype < 256 then valid[#valid+1] = n + if n.font ~= nf then + nf = n.font + tm = fontdata[nf].marks + end + mk[n] = tm[n.char] local k = has_attribute(n,kernpair) if k then local kk = kerns[k] @@ -2482,9 +2487,15 @@ function nodes.inject_kerns(head,tail,where,keep) end end else + local nf, tm = nil, nil for n in traverse_id(glyph,head) do if n.subtype < 256 then valid[#valid+1] = n + if n.font ~= nf then + nf = n.font + tm = fontdata[nf].marks + end + mk[n] = tm[n.char] end end end @@ -2498,22 +2509,15 @@ function nodes.inject_kerns(head,tail,where,keep) end -- todo: reuse t and use maxt if has_cursives then - local n_cursbase, n_curscurs, p_cursbase, n, p, nf, tm = nil, nil, nil, nil, nil, nil, nil + local p_cursbase, p = nil, nil -- since we need valid[n+1] we can also use a "while true do" local t, d, maxt = { }, { }, 0 for i=1,#valid do -- valid == glyphs - n = valid[i] - if n.font ~= nf then - nf = n.font ---~ print(n.font,nf,fontdata[nf]) - tm = fontdata[nf].marks - -- maybe flush - maxt = 0 - end - if not tm[n.char] then - n_cursbase = has_attribute(n,cursbase) - n_curscurs = has_attribute(n,curscurs) + local n = valid[i] + if not mk[n] then + local n_cursbase = has_attribute(n,cursbase) if p_cursbase then + local n_curscurs = has_attribute(n,curscurs) if p_cursbase == n_curscurs then local c = cursives[n_curscurs] if c then @@ -2541,7 +2545,8 @@ function nodes.inject_kerns(head,tail,where,keep) local ny = n.yoffset for i=maxt,1,-1 do ny = ny + d[i] - t[i].yoffset = t[i].yoffset + ny + local ti = t[i] + ti.yoffset = ti.yoffset + ny end maxt = 0 end @@ -2549,7 +2554,8 @@ function nodes.inject_kerns(head,tail,where,keep) local ny = n.yoffset for i=maxt,1,-1 do ny = ny + d[i] - t[i].yoffset = ny + local ti = t[i] + ti.yoffset = ny end maxt = 0 end @@ -2560,7 +2566,8 @@ function nodes.inject_kerns(head,tail,where,keep) local ny = n.yoffset for i=maxt,1,-1 do ny = ny + d[i] - t[i].yoffset = ny + local ti = t[i] + ti.yoffset = ny end maxt = 0 end @@ -2569,14 +2576,13 @@ function nodes.inject_kerns(head,tail,where,keep) end end if has_marks then - local p_markbase, n_markmark = nil, nil for i=1,#valid do local p = valid[i] - p_markbase = has_attribute(p,markbase) + local p_markbase = has_attribute(p,markbase) if p_markbase then local mrks = marks[p_markbase] for n in traverse_id(glyph,p.next) do - n_markmark = has_attribute(n,markmark) + local n_markmark = has_attribute(n,markmark) if p_markbase == n_markmark then local index = has_attribute(n,markdone) or 1 local d = mrks[index] @@ -2585,9 +2591,17 @@ function nodes.inject_kerns(head,tail,where,keep) -- if rlmode and rlmode < 0 then -- n.xoffset = p.xoffset + d[1] -- else - n.xoffset = p.xoffset - d[1] + n.xoffset = p.xoffset - d[1] +--~ local k = wx[p] +--~ if k then +--~ wx[n] = k +--~ end -- end - n.yoffset = p.yoffset + d[2] + if mk[p] then + n.yoffset = p.yoffset + d[2] + else + n.yoffset = n.yoffset + p.yoffset + d[2] + end end else break @@ -2642,224 +2656,9 @@ function nodes.inject_kerns(head,tail,where,keep) kerns, cursives, marks = { }, { }, { } end elseif has_kerns then - -- we assume done is true because there are kerns - for n in traverse_id(glyph,head) do - local k = has_attribute(n,kernpair) - if k then - local kk = kerns[k] - if kk then - -- only w can be nil, can be sped up when w == nil - local rl, x, y, w = kk[1], kk[2] or 0, kk[3] or 0, kk[4] or 0 - if y ~= 0 then - n.yoffset = y -- todo: h ? - end - local wx = w - x - if rl < 0 then - if wx ~= 0 then - insert_node_before(head,n,newkern(wx)) - end - if x ~= 0 then - insert_node_after (head,n,newkern(x)) - end - else - -- if wx ~= 0 then - -- insert_node_after(head,n,newkern(wx)) - -- end - if x ~= 0 then - insert_node_before(head,n,newkern(x)) - end - end - end - end - end - if not keep then - kerns = { } - end - return head, true - end - return head, false -end - --- -- -- KEEP OLD ONE, THE NEXT IS JUST OPTIMIZED -- -- -- - -function nodes.XXXXXXXxinject_kerns(head,tail,keep) - if trace_injections then - nodes.trace_injection(head) - end - local has_marks, has_cursives, has_kerns = next(marks), next(cursives), next(kerns) - if has_marks or has_cursives then - -- in the future variant we will not copy items but refs to tables - local done, ky, valid, cx, wx = false, { }, { }, { }, { } - for n in traverse_id(glyph,head) do - if n.subtype < 256 then - valid[#valid+1] = n - if has_kerns then -- move outside loop - local k = has_attribute(n,kernpair) - if k then - local kk = kerns[k] - if kk then - local x, y, w, h = kk[2], kk[3], kk[4], kk[5] - local dy = y - h - if dy ~= 0 then - ky[n] = dy - end - if w ~= 0 or x ~= 0 then - wx[n] = kk - end - end - end - end - end - end - if #valid > 0 then - -- we can assume done == true because we have cursives and marks - local cx = { } - if has_kerns and next(ky) then - for n, k in next, ky do - n.yoffset = k - end - end - -- todo: reuse t and use maxt - if has_cursives then - local n_cursbase, n_curscurs, p_cursbase, n, p, nf, tm = nil, nil, nil, nil, nil, nil, nil - -- since we need valid[n+1] we can also use a "while true do" - local t, d, maxt = { }, { }, 0 - for i=1,#valid do -- valid == glyphs - n = valid[i] - if n.font ~= nf then - nf = n.font - tm = fontdata[nf].marks - -- maybe flush - maxt = 0 - end - if not tm[n.char] then - n_cursbase = has_attribute(n,cursbase) - n_curscurs = has_attribute(n,curscurs) - if p_cursbase then - if p_cursbase == n_curscurs then - local c = cursives[n_curscurs] - if c then - local rlmode, dx, dy, ws, wn = c[1], c[2], c[3], c[4], c[5] - if rlmode >= 0 then - dx = dx - ws - else - dx = dx + wn - end - if dx ~= 0 then -if rlmode < 0 then - cx[n] = -dx -else - cx[n] = dx -end - end - -- if rlmode and rlmode < 0 then - dy = -dy - -- end - maxt = maxt + 1 - t[maxt] = p - d[maxt] = dy - else - maxt = 0 - end - end - elseif maxt > 0 then - local ny = n.yoffset - for i=maxt,1,-1 do - ny = ny + d[i] - t[i].yoffset = t[i].yoffset + ny - end - maxt = 0 - end - if not n_cursbase and maxt > 0 then - local ny = n.yoffset - for i=maxt,1,-1 do - ny = ny + d[i] - t[i].yoffset = ny - end - maxt = 0 - end - p_cursbase, p = n_cursbase, n - end - end - if maxt > 0 then - local ny = n.yoffset - for i=maxt,1,-1 do - ny = ny + d[i] - t[i].yoffset = ny - end - maxt = 0 - end - if not keep then - cursives = { } - end - end - if has_marks then - local p_markbase, n_markmark = nil, nil - for i=1,#valid do - local p = valid[i] - p_markbase = has_attribute(p,markbase) - if p_markbase then - local mrks = marks[p_markbase] - for n in traverse_id(glyph,p.next) do - n_markmark = has_attribute(n,markmark) - if p_markbase == n_markmark then - local index = has_attribute(n,markdone) or 1 - local d = mrks[index] - if d then - local d1, d2 = d[1], d[2] - if d1 ~= 0 then - n.xoffset = p.xoffset - d[1] - end - if d2 ~= 0 then - n.yoffset = p.yoffset + d[2] - end - end - else - break - end - end - end - end - if not keep then - marks = { } - end - end - -- todo : combine - if next(wx) then - for n, k in next, wx do - -- only w can be nil, can be sped up when w == nil - local rl, x, w = k[1], k[2] or 0, k[4] or 0 - local wx = w - x - if rl < 0 then - if wx ~= 0 then - insert_node_before(head,n,newkern(wx)) - end - if x ~= 0 then - insert_node_after (head,n,newkern(x)) - end - else - -- if wx ~= 0 then - -- insert_node_after(head,n,newkern(wx)) - -- end - if x ~= 0 then - insert_node_before(head,n,newkern(x)) - end - end - end - end - if next(cx) then - for n, k in next, cx do - insert_node_before(head,n,newkern(k)) - end - end - if not keep then - kerns = { } - end - return head, true - elseif not keep then - kerns, cursives, marks = { }, { }, { } + if trace_injections then + nodes.trace_injection(head) end - elseif has_kerns then -- we assume done is true because there are kerns for n in traverse_id(glyph,head) do local k = has_attribute(n,kernpair) @@ -2894,6 +2693,8 @@ end kerns = { } end return head, true + else + -- no tracing needed end return head, false end @@ -3124,17 +2925,17 @@ if not modules then modules = { } end modules ['node-dum'] = { nodes = nodes or { } function nodes.simple_font_dummy(head,tail) - return tail + -- ligaturing, kerning + return head, tail end function nodes.simple_font_handler(head) - local tail = node.slide(head) --- lang.hyphenate(head,tail) - head = nodes.process_characters(head,tail) +-- lang.hyphenate(head) + head = nodes.process_characters(head) nodes.inject_kerns(head) nodes.protect_glyphs(head) - tail = node.ligaturing(head,tail) - tail = node.kerning(head,tail) + head = node.ligaturing(head) + head = node.kerning(head) return head end @@ -3486,7 +3287,7 @@ function tfm.do_scale(tfmtable, scaledpoints) end -- status local isvirtual = tfmtable.type == "virtual" or tfmtable.virtualized - local hasmath = tfmtable.math_parameters ~= nil or tfmtable.MathConstants ~= nil + local hasmath = (tfmtable.math_parameters ~= nil and next(tfmtable.math_parameters) ~= nil) or (tfmtable.MathConstants ~= nil and next(tfmtable.MathConstants) ~= nil) local nodemode = tfmtable.mode == "node" local hasquality = tfmtable.auto_expand or tfmtable.auto_protrude local hasitalic = tfmtable.has_italic @@ -3534,6 +3335,7 @@ function tfm.do_scale(tfmtable, scaledpoints) local scaledheight = defaultheight * delta local scaleddepth = defaultdepth * delta local stackmath = tfmtable.ignore_stack_math ~= true +local private = fonts.private for k,v in next, characters do local chr, description, index if ischanged then @@ -3596,7 +3398,7 @@ function tfm.do_scale(tfmtable, scaledpoints) -- logs.report("define font","t=%s, u=%s, i=%s, n=%s c=%s",k,chr.tounicode or k,description.index,description.name or '-',description.class or '-') -- end if tounicode then - local tu = tounicode[index] + local tu = tounicode[index] -- nb: index! if tu then chr.tounicode = tu end @@ -3769,6 +3571,7 @@ function tfm.do_scale(tfmtable, scaledpoints) end -- needed for \high cum suis local tpx = tp.x_height +if hasmath then if not tp[13] then tp[13] = .86*tpx end -- mathsupdisplay if not tp[14] then tp[14] = .86*tpx end -- mathsupnormal if not tp[15] then tp[15] = .86*tpx end -- mathsupcramped @@ -3776,11 +3579,22 @@ function tfm.do_scale(tfmtable, scaledpoints) if not tp[17] then tp[17] = .48*tpx end -- mathsubcombined if not tp[22] then tp[22] = 0 end -- mathaxisheight if t.MathConstants then t.MathConstants.AccentBaseHeight = nil end -- safeguard +end t.tounicode = 1 t.cidinfo = tfmtable.cidinfo -- we have t.name=metricfile and t.fullname=RealName and t.filename=diskfilename -- when collapsing fonts, luatex looks as both t.name and t.fullname as ttc files -- can have multiple subfonts + if hasmath then + if trace_defining then + logs.report("define font","math enabled for: %s %s %s",t.name or "noname",t.fullname or "nofullname",t.filename or "nofilename") + end + else + if trace_defining then + logs.report("define font","math disabled for: %s %s %s",t.name or "noname",t.fullname or "nofullname",t.filename or "nofilename") + end + t.nomath, t.MathConstants = true, nil + end return t, delta end @@ -3955,7 +3769,7 @@ function tfm.set_features(tfmdata) local value = features[f] if value and fi.tfm[f] then -- brr if tfm.trace_features then - logs.report("define tfm","initializing feature %s to %s for mode %s for font %s",f,tostring(value),mode or 'unknown',tfmdata.name or 'unknown') + logs.report("define font","initializing feature %s to %s for mode %s for font %s",f,tostring(value),mode or 'unknown',tfmdata.name or 'unknown') end fi.tfm[f](tfmdata,value) mode = tfmdata.mode or fonts.mode @@ -4157,6 +3971,7 @@ local function locate(registry,ordering,supplement) logs.report("load otf","using cidmap file %s",filename) end fonts.cid.map[filename] = cidmap + cidmap.usedname = file.basename(filename) return cidmap end end @@ -5164,12 +4979,13 @@ local concat, getn, utfbyte = table.concat, table.getn, utf.byte local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip local type, next, tonumber, tostring = type, next, tonumber, tostring -local trace_private = false trackers.register("otf.private", function(v) trace_private = v end) -local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end) -local trace_features = false trackers.register("otf.features", function(v) trace_features = v end) -local trace_dynamics = false trackers.register("otf.dynamics", function(v) trace_dynamics = v end) -local trace_sequences = false trackers.register("otf.sequences", function(v) trace_sequences = v end) -local trace_math = false trackers.register("otf.math", function(v) trace_math = v end) +local trace_private = false trackers.register("otf.private", function(v) trace_private = v end) +local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end) +local trace_features = false trackers.register("otf.features", function(v) trace_features = v end) +local trace_dynamics = false trackers.register("otf.dynamics", function(v) trace_dynamics = v end) +local trace_sequences = false trackers.register("otf.sequences", function(v) trace_sequences = v end) +local trace_math = false trackers.register("otf.math", function(v) trace_math = v end) +local trace_unimapping = false trackers.register("otf.unimapping", function(v) trace_unimapping = v end) --~ trackers.enable("otf.loading") @@ -5233,7 +5049,7 @@ otf.features.default = otf.features.default or { } otf.enhancers = otf.enhancers or { } otf.glists = { "gsub", "gpos" } -otf.version = 2.626 -- beware: also sync font-mis.lua +otf.version = 2.628 -- beware: also sync font-mis.lua otf.pack = true -- beware: also sync font-mis.lua otf.syncspace = true otf.notdef = false @@ -5616,15 +5432,18 @@ otf.enhancers["analyse marks"] = function(data,filename) end end -local other = lpeg.C((1 - lpeg.S("_."))^0) -local ligsplitter = lpeg.Ct(other * (lpeg.P("_") * other)^0) +local separator = lpeg.S("_.") +local other = lpeg.C((1 - separator)^1) +local ligsplitter = lpeg.Ct(other * (separator * other)^0) ---~ print(splitter:match("this")) ---~ print(splitter:match("this.that")) ---~ print(splitter:match("such_so_more")) ---~ print(splitter:match("such_so_more.that")) +--~ print(table.serialize(ligsplitter:match("this"))) +--~ print(table.serialize(ligsplitter:match("this.that"))) +--~ print(table.serialize(ligsplitter:match("japan1.123"))) +--~ print(table.serialize(ligsplitter:match("such_so_more"))) +--~ print(table.serialize(ligsplitter:match("such_so_more.that"))) otf.enhancers["analyse unicodes"] = function(data,filename) + local tounicode16, tounicode16sequence = fonts.map.tounicode16, fonts.map.tounicode16sequence local unicodes = data.luatex.unicodes -- we need to move this code unicodes['space'] = unicodes['space'] or 32 -- handly later on @@ -5634,53 +5453,113 @@ otf.enhancers["analyse unicodes"] = function(data,filename) -- the tounicode mapping is sparse and only needed for alternatives local tounicode, originals, ns, nl, private, unknown = { }, { }, 0, 0, fonts.private, format("%04X",utfbyte("?")) data.luatex.tounicode, data.luatex.originals = tounicode, originals + local lumunic, uparser, oparser + if false then -- will become an option + lumunic = fonts.map.load_lum_table(filename) + lumunic = lumunic and lumunic.tounicode + end + local cidinfo, cidnames, cidcodes = data.cidinfo + local usedmap = cidinfo and cidinfo.usedname + usedmap = usedmap and fonts.cid.map[usedmap] + if usedmap then + oparser = usedmap and fonts.map.make_name_parser(cidinfo.ordering) + cidnames = usedmap.names + cidcodes = usedmap.unicodes + end + uparser = fonts.map.make_name_parser() for index, glyph in next, data.glyphs do local name, unic = glyph.name, glyph.unicode or -1 -- play safe if unic == -1 or unic >= private or (unic >= 0xE000 and unic <= 0xF8FF) or unic == 0xFFFE or unic == 0xFFFF then - -- a.whatever or a_b_c.whatever or a_b_c - local split = ligsplitter:match(name) - if #split == 0 then - -- skip - elseif #split == 1 then - local u = unicodes[split[1]] - if u then - if type(u) == "table" then - u = u[1] - end - if u < 0x10000 then - originals[index], tounicode[index] = u, format("%04X",u) - else - originals[index], tounicode[index] = u, format("%04X%04X",u/1024+0xD800,u%1024+0xDC00) + local unicode = lumunic and lumunic[name] + if unicode then + originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1 + end + -- cidmap heuristics, beware, there is no guarantee for a match unless + -- the chain resolves + if not unicode and usedmap then + local foundindex = oparser:match(name) + if foundindex then + unicode = cidcodes[foundindex] -- name to number + if not unicode then + local reference = cidnames[foundindex] -- number to name + if reference then + local foundindex = oparser:match(reference) + if foundindex then + unicode = cidcodes[foundindex] + if unicode then + originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1 + end + end + if not unicode then + local foundcodes, multiple = uparser:match(reference) + if foundcodes then + if multiple then + originals[index], tounicode[index], nl, unicode = foundcodes, tounicode16sequence(foundcodes), nl + 1, true + else + originals[index], tounicode[index], ns, unicode = foundcodes, tounicode16(foundcodes), ns + 1, foundcodes + end + end + end + end end - ns = ns + 1 - else - originals[index], tounicode[index] = 0xFFFD, "FFFD" end - else - local as = { } - for l=1,#split do - local u = unicodes[split[l]] - if not u then - as[l], split[l] = 0xFFFD, "FFFD" - else - if type(u) == "table" then - u = u[1] + end + -- a.whatever or a_b_c.whatever or a_b_c (no numbers) + if not unicode then + local split = ligsplitter:match(name) + local nplit = (split and #split) or 0 + if nplit == 0 then + -- skip + elseif nplit == 1 then + unicode = unicodes[split[1]] + if unicode then + if type(unicode) == "table" then + unicode = unicode[1] end - if u < 0x10000 then - as[l], split[l] = u, format("%04X",u) + originals[index], tounicode[index], ns = unicode, tounicode16(unicode), ns + 1 + end + else + local done = true + for l=1,nplit do + local u = unicodes[split[l]] + if not u then + done = false + break + elseif type(u) == "table" then + split[l] = u[1] else - as[l], split[l] = u, format("%04X%04X",u/1024+0xD800,u%1024+0xDC00) + split[l] = u end end + if done then + originals[index], tounicode[index], nl, unicode = split, tounicode16sequence(split), nl + 1, true + end end - split = concat(split) - if split ~= "" then - originals[index], tounicode[index] = as, split - nl = nl + 1 - else - originals[index], tounicode[index] = 0xFFFD, "FFFD" + end + -- last resort + if not unicode then + local foundcodes, multiple = uparser:match(name) + if foundcodes then + if multiple then + originals[index], tounicode[index], nl, unicode = foundcodes, tounicode16sequence(foundcodes), nl + 1, true + else + originals[index], tounicode[index], ns, unicode = foundcodes, tounicode16(foundcodes), ns + 1, foundcodes + end end end + if not unicode then + originals[index], tounicode[index] = 0xFFFD, "FFFD" + end + end + end + if trace_unimapping then + for index, glyph in table.sortedpairs(data.glyphs) do + local toun, name, unic = tounicode[index], glyph.name, glyph.unicode or -1 -- play safe + if toun then + logs.report("load otf","internal: 0x%05X, name: %s, unicode: 0x%05X, tounicode: %s",index,name,unic,toun) + else + logs.report("load otf","internal: 0x%05X, name: %s, unicode: 0x%05X",index,name,unic) + end end end if trace_loading and (ns > 0 or nl > 0) then @@ -5698,16 +5577,14 @@ otf.enhancers["analyse subtables"] = function(data,filename) for _, g in next, { data.gsub, data.gpos } do for k=1,#g do local gk = g[k] - -local typ = gk.type -if typ == "gsub_contextchain" or typ == "gpos_contextchain" then - gk.chain = 1 -elseif typ == "gsub_reversecontextchain" or typ == "gpos_reversecontextchain" then - gk.chain = -1 -else - gk.chain = 0 -end - + local typ = gk.type + if typ == "gsub_contextchain" or typ == "gpos_contextchain" then + gk.chain = 1 + elseif typ == "gsub_reversecontextchain" or typ == "gpos_reversecontextchain" then + gk.chain = -1 + else + gk.chain = 0 + end local features = gk.features if features then sequences[#sequences+1] = gk @@ -5762,8 +5639,9 @@ otf.enhancers["merge cid fonts"] = function(data,filename) local cidinfo = data.cidinfo local verbose = fonts.verbose if cidinfo.registry then - local cidmap = fonts.cid.getmap and fonts.cid.getmap(cidinfo.registry,cidinfo.ordering,cidinfo.supplement) + local cidmap, cidname = fonts.cid.getmap(cidinfo.registry,cidinfo.ordering,cidinfo.supplement) if cidmap then + cidinfo.usedname = cidmap.usedname local glyphs, uni_to_int, int_to_uni, nofnames, nofunicodes = { }, { }, { }, 0, 0 local unicodes, names = cidmap.unicodes, cidmap.names for n, subfont in next, data.subfonts do @@ -6495,7 +6373,7 @@ function otf.copy_to_tfm(data,cache_id) -- we can save a copy when we reorder th } -- indices maps from unicodes to indices for u, i in next, indices do - characters[u] = { } -- we need this because for instance we add protruding info + characters[u] = { } -- we need this because for instance we add protruding info and loop over characters descriptions[u] = glyphs[i] end -- math @@ -7370,7 +7248,7 @@ trackers.register("*otf.sample","otf.steps,otf.actions,otf.analyzing") local insert_node_after = node.insert_after local delete_node = nodes.delete local copy_node = node.copy -local slide_node_list = node.slide +local find_node_tail = node.tail or node.slide local set_attribute = node.set_attribute local has_attribute = node.has_attribute @@ -9125,7 +9003,7 @@ function fonts.methods.node.otf.features(head,font,attr) local handler = handlers[typ] local thecache = featuredata[typ] or { } -- we need to get rid of this slide ! - start = slide_node_list(head) -- slow (we can store tail because there's always a skip at the end): todo + start = find_node_tail(head) -- slow (we can store tail because there's always a skip at the end): todo while start do local id = start.id if id == glyph then @@ -11006,6 +10884,229 @@ end fonts.define.register_split(":", fonts.define.specify.colonized) +end -- closure + +do -- begin closure to overcome local limits and interference + +if not modules then modules = { } end modules ['font-map'] = { + version = 1.001, + comment = "companion to font-ini.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local match, format, find, concat = string.match, string.format, string.find, table.concat + +local trace_loading = false trackers.register("otf.loading", function(v) trace_loading = v end) + +local ctxcatcodes = tex.ctxcatcodes + +--[[ldx-- +

Eventually this code will disappear because map files are kind +of obsolete. Some code may move to runtime or auxiliary modules.

+

The name to unciode related code will stay of course.

+--ldx]]-- + +fonts = fonts or { } +fonts.map = fonts.map or { } +fonts.map.data = fonts.map.data or { } +fonts.map.encodings = fonts.map.encodings or { } +fonts.map.done = fonts.map.done or { } +fonts.map.loaded = fonts.map.loaded or { } +fonts.map.direct = fonts.map.direct or { } +fonts.map.line = fonts.map.line or { } + +function fonts.map.line.pdfmapline(tag,str) + return "\\loadmapline[" .. tag .. "][" .. str .. "]" +end + +function fonts.map.line.pdftex(e) -- so far no combination of slant and stretch + if e.name and e.fontfile then + local fullname = e.fullname or "" + if e.slant and e.slant ~= 0 then + if e.encoding then + return fonts.map.line.pdfmapline("=",format('%s %s "%g SlantFont" <%s <%s',e.name,fullname,e.slant,e.encoding,e.fontfile)) + else + return fonts.map.line.pdfmapline("=",format('%s %s "%g SlantFont" <%s',e.name,fullname,e.slant,e.fontfile)) + end + elseif e.stretch and e.stretch ~= 1 and e.stretch ~= 0 then + if e.encoding then + return fonts.map.line.pdfmapline("=",format('%s %s "%g ExtendFont" <%s <%s',e.name,fullname,e.stretch,e.encoding,e.fontfile)) + else + return fonts.map.line.pdfmapline("=",format('%s %s "%g ExtendFont" <%s',e.name,fullname,e.stretch,e.fontfile)) + end + else + if e.encoding then + return fonts.map.line.pdfmapline("=",format('%s %s <%s <%s',e.name,fullname,e.encoding,e.fontfile)) + else + return fonts.map.line.pdfmapline("=",format('%s %s <%s',e.name,fullname,e.fontfile)) + end + end + else + return nil + end +end + +function fonts.map.flush(backend) -- will also erase the accumulated data + local flushline = fonts.map.line[backend or "pdftex"] or fonts.map.line.pdftex + for _, e in pairs(fonts.map.data) do + tex.sprint(ctxcatcodes,flushline(e)) + end + fonts.map.data = { } +end + +fonts.map.line.dvips = fonts.map.line.pdftex +fonts.map.line.dvipdfmx = function() end + +function fonts.map.convert_entries(filename) + if not fonts.map.loaded[filename] then + fonts.map.data, fonts.map.encodings = fonts.map.load_file(filename,fonts.map.data, fonts.map.encodings) + fonts.map.loaded[filename] = true + end +end + +function fonts.map.load_file(filename, entries, encodings) + entries = entries or { } + encodings = encodings or { } + local f = io.open(filename) + if f then + local data = f:read("*a") + if data then + for line in gmatch(data,"(.-)[\n\t]") do + if find(line,"^[%#%%%s]") then + -- print(line) + else + local stretch, slant, name, fullname, fontfile, encoding + line = line:gsub('"(.+)"', function(s) + stretch = find(s,'"([^"]+) ExtendFont"') + slant = find(s,'"([^"]+) SlantFont"') + return "" + end) + if not name then + -- name fullname encoding fontfile + name, fullname, encoding, fontfile = match(line,"^(%S+)%s+(%S*)[%s<]+(%S*)[%s<]+(%S*)%s*$") + end + if not name then + -- name fullname (flag) fontfile encoding + name, fullname, fontfile, encoding = match(line,"^(%S+)%s+(%S*)[%d%s<]+(%S*)[%s<]+(%S*)%s*$") + end + if not name then + -- name fontfile + name, fontfile = match(line,"^(%S+)%s+[%d%s<]+(%S*)%s*$") + end + if name then + if encoding == "" then encoding = nil end + entries[name] = { + name = name, -- handy + fullname = fullname, + encoding = encoding, + fontfile = fontfile, + slant = tonumber(slant), + stretch = tonumber(stretch) + } + encodings[name] = encoding + elseif line ~= "" then + -- print(line) + end + end + end + end + f:close() + end + return entries, encodings +end + +function fonts.map.load_lum_table(filename) + local lumname = file.replacesuffix(file.basename(filename),"lum") + local lumfile = resolvers.find_file(lumname,"map") or "" + if lumfile ~= "" and lfs.isfile(lumfile) then + if trace_loading or trace_unimapping then + logs.report("load otf","enhance: loading %s ",lumfile) + end + lumunic = dofile(lumfile) + return lumunic, lumfile + end +end + +local hex = lpeg.R("AF","09") +local hexfour = (hex*hex*hex*hex) / function(s) return tonumber(s,16) end +local dec = (lpeg.R("09")^1) / tonumber +local period = lpeg.P(".") + +local unicode = lpeg.P("uni") * (hexfour * (period + lpeg.P(-1)) * lpeg.Cc(false) + lpeg.Ct(hexfour^1) * lpeg.Cc(true)) +local index = lpeg.P("index") * dec * lpeg.Cc(false) + +local parser = unicode + index + +local parsers = { } + +function fonts.map.make_name_parser(str) + if not str or str == "" then + return parser + else + local p = parsers[str] + if not p then + p = lpeg.P(str) * period * dec * lpeg.Cc(false) + parsers[str] = p + end + return p + end +end + +--~ local parser = fonts.map.make_name_parser("Japan1") +--~ local function test(str) +--~ local b, a = parser:match(str) +--~ print((a and table.serialize(b)) or b) +--~ end +--~ test("uni1234") +--~ test("uni1234.xx") +--~ test("uni12349876") +--~ test("index1234") +--~ test("Japan1.123") + +function fonts.map.tounicode16(unicode) + if unicode < 0x10000 then + return format("%04X",unicode) + else + return format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) + end +end + +function fonts.map.tounicode16sequence(unicodes) + local t = { } + for l=1,#unicodes do + local unicode = unicodes[l] + if unicode < 0x10000 then + t[l] = format("%04X",unicode) + else + t[l] = format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) + end + end + return concat(t) +end + +--~ This is quite a bit faster but at the cost of some memory but if we +--~ do this we will also use it elsewhere so let's not follow this route +--~ now. I might use this method in the plain variant (no caching there) +--~ but then I need a flag that distinguishes between code branches. +--~ +--~ local cache = { } +--~ +--~ function fonts.map.tounicode16(unicode) +--~ local s = cache[unicode] +--~ if not s then +--~ if unicode < 0x10000 then +--~ s = format("%04X",unicode) +--~ else +--~ s = format("%04X%04X",unicode/1024+0xD800,unicode%1024+0xDC00) +--~ end +--~ cache[unicode] = s +--~ end +--~ return s +--~ end + + end -- closure do -- begin closure to overcome local limits and interference diff --git a/tex/generic/context/luatex-fonts.lua b/tex/generic/context/luatex-fonts.lua index be565c7b3..690a6e599 100644 --- a/tex/generic/context/luatex-fonts.lua +++ b/tex/generic/context/luatex-fonts.lua @@ -120,6 +120,7 @@ else loadmodule('font-otc.lua') loadmodule('font-def.lua') loadmodule('font-xtx.lua') + loadmodule('font-map.lua') -- for loading lum file (will be stripped) loadmodule('font-dum.lua') end @@ -127,8 +128,8 @@ end -- In order to deal with the fonts we need to initialize some -- callbacks. One can overload them later on if needed. -callback.register('ligaturing', nodes.simple_font_dummy) -callback.register('kerning', nodes.simple_font_dummy) +callback.register('ligaturing', nodes.simple_font_dummy) -- better: false +callback.register('kerning', nodes.simple_font_dummy) -- better: false callback.register('pre_linebreak_filter', nodes.simple_font_handler) callback.register('hpack_filter', nodes.simple_font_handler) callback.register('define_font' , fonts.define.read) diff --git a/tex/generic/context/mptopdf.tex b/tex/generic/context/mptopdf.tex index fe3ad2ed9..1f229678d 100644 --- a/tex/generic/context/mptopdf.tex +++ b/tex/generic/context/mptopdf.tex @@ -70,7 +70,7 @@ %D allocation macros, we preload plain \TEX. We don't load %D fonts yet. -\input syst-tex +\input syst-tex.mkii %D We check for the usage of \PDFTEX, and quit if another %D \TEX\ is used. @@ -83,9 +83,9 @@ %D The conversion to \PDF\ is carried out by macros, that %D are collected in the file: -\input supp-mis -\input supp-pdf -\input supp-mpe \MPcmykcolorstrue \MPspotcolorstrue +\input supp-mis.mkii +\input supp-pdf.mkii +\input supp-mpe.mkii \MPcmykcolorstrue \MPspotcolorstrue %D We use no output routine. diff --git a/tex/generic/context/ppchtex.noc b/tex/generic/context/ppchtex.noc index 8819de024..99d073255 100644 --- a/tex/generic/context/ppchtex.noc +++ b/tex/generic/context/ppchtex.noc @@ -30,8 +30,8 @@ %D First we load some auxiliary macro's: -\input supp-mis.tex \let\writestatus\undefined -\input syst-gen.tex +\input supp-mis.mkii \let\writestatus\undefined +\input syst-gen.mkii \input syst-fnt.mkii %D after which we can go on with: diff --git a/tpm/t-bib.tpm b/tpm/t-bib.tpm index 9f426e53e..8c0ac1dff 100644 --- a/tpm/t-bib.tpm +++ b/tpm/t-bib.tpm @@ -11,9 +11,9 @@ A bibliographic subsystem for ConTeXt Taco Hoekwater - 575117 + 575221 - + tex/context/bib/bibl-ams.tex tex/context/bib/bibl-apa-de.tex tex/context/bib/bibl-apa-fr.tex diff --git a/web2c/context.cnf b/web2c/context.cnf index 13c385ba4..07ca3f7f5 100644 --- a/web2c/context.cnf +++ b/web2c/context.cnf @@ -146,7 +146,9 @@ shell_escape = t openout_any = p openin_any = a parse_first_line = f -allow_multiple_suffixes = f + +% allow_multiple_suffixes = f +try_std_extension_first = f shell_escape.context = t shell_escape_commands.context = mtxrun,luatools,texmfstart,texexec,mpost -- cgit v1.2.3